@bluefly/openstandardagents 0.4.9 → 0.5.1
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/.version.json +3 -3
- package/CHANGELOG.md +35 -4
- package/README.md +77 -62
- package/dist/.version.json +3 -3
- package/dist/adapters/a2a/a2a-protocol.js +4 -2
- package/dist/adapters/a2a/a2a-tool.js +4 -2
- package/dist/adapters/a2a/mcp-integration.d.ts +2 -1
- package/dist/adapters/a2a/mcp-integration.js +6 -3
- package/dist/adapters/browser/browser-exporter.d.ts +26 -0
- package/dist/adapters/browser/browser-exporter.js +73 -0
- package/dist/adapters/browser/browser-runner.d.ts +23 -0
- package/dist/adapters/browser/browser-runner.js +46 -0
- package/dist/adapters/browser/index.d.ts +9 -0
- package/dist/adapters/browser/index.js +9 -0
- package/dist/adapters/claude-code/adapter.js +2 -2
- package/dist/adapters/docker/generators.js +19 -19
- package/dist/adapters/docker/index.d.ts +2 -0
- package/dist/adapters/docker/index.js +2 -0
- package/dist/adapters/docker/openclaw-bridge.d.ts +57 -0
- package/dist/adapters/docker/openclaw-bridge.js +173 -0
- package/dist/adapters/drupal/generator.js +76 -76
- package/dist/adapters/drupal/index.d.ts +1 -0
- package/dist/adapters/drupal/index.js +2 -0
- package/dist/adapters/drupal/twig-renderer.d.ts +23 -0
- package/dist/adapters/drupal/twig-renderer.js +99 -0
- package/dist/adapters/gitlab/agent-generator.js +2 -1
- package/dist/adapters/openai-agents/adapter.js +2 -2
- package/dist/api/index.js +2 -1
- package/dist/api/routes/mcp.router.js +3 -1
- package/dist/api/routes/wizard.router.js +3 -1
- package/dist/cli/commands/agent/discover-type.command.js +1 -1
- package/dist/cli/commands/agent-card.command.js +37 -10
- package/dist/cli/commands/agents-sync.command.d.ts +2 -2
- package/dist/cli/commands/agents-sync.command.js +27 -17
- package/dist/cli/commands/catalog/config.js +1 -1
- package/dist/cli/commands/catalog/validate.command.js +2 -2
- package/dist/cli/commands/config.command.js +2 -2
- package/dist/cli/commands/daemon.command.js +32 -8
- package/dist/cli/commands/discover.d.ts +1 -1
- package/dist/cli/commands/discover.js +16 -8
- package/dist/cli/commands/economics.command.d.ts +9 -0
- package/dist/cli/commands/economics.command.js +113 -0
- package/dist/cli/commands/export.command.js +6 -3
- package/dist/cli/commands/mcp.command.js +3 -1
- package/dist/cli/commands/memory.command.d.ts +18 -0
- package/dist/cli/commands/memory.command.js +168 -0
- package/dist/cli/commands/publish.command.js +7 -4
- package/dist/cli/commands/serve-builder-routes.js +1 -1
- package/dist/cli/commands/usie-skills.command.d.ts +24 -0
- package/dist/cli/commands/usie-skills.command.js +297 -0
- package/dist/cli/commands/validate.command.js +8 -1
- package/dist/cli/commands/verify.d.ts +3 -3
- package/dist/cli/commands/verify.js +12 -6
- package/dist/cli/commands/workspace.command.d.ts +1 -0
- package/dist/cli/commands/workspace.command.js +28 -4
- package/dist/cli/index.js +12 -0
- package/dist/cli/schema-driven/schema-loader.js +5 -5
- package/dist/cli/workspace-validate.d.ts +23 -0
- package/dist/cli/workspace-validate.js +117 -0
- package/dist/data/platform-matrix.js +1 -4
- package/dist/generated/types.d.ts +97 -97
- package/dist/index.d.ts +2 -0
- package/dist/index.js +2 -0
- package/dist/mcp-server/index.js +658 -982
- package/dist/mesh/discovery-gkg.d.ts +26 -0
- package/dist/mesh/discovery-gkg.js +92 -0
- package/dist/messenger/Handler/AgentBatchHandler.js +3 -2
- package/dist/messenger/Handler/AgentExecutionHandler.js +6 -1
- package/dist/package.json +43 -14
- package/dist/sdks/shared/types.d.ts +1 -1
- package/dist/services/agent-card-generator.js +6 -2
- package/dist/services/daemon/audit-log.service.js +3 -1
- package/dist/services/daemon/execution.service.js +8 -4
- package/dist/services/daemon/fs-watcher.service.js +6 -7
- package/dist/services/daemon/pairing.service.js +2 -1
- package/dist/services/daemon/skill-aggregator.service.js +105 -21
- package/dist/services/daemon/sse-endpoints.js +1 -1
- package/dist/services/daemon/ws-server.js +10 -3
- package/dist/services/export/langchain/langchain-exporter.js +2 -2
- package/dist/services/export/langchain/memory-generator.js +2 -2
- package/dist/services/export/testing/test-generator.js +1 -1
- package/dist/services/governance/cedar-provider.js +12 -8
- package/dist/services/governance/cedar-validator.service.js +1 -1
- package/dist/services/mcp/bridge.service.js +40 -9
- package/dist/services/openapi-extensions-validation.d.ts +20 -0
- package/dist/services/openapi-extensions-validation.js +193 -0
- package/dist/services/release-automation/merge-request.service.d.ts +4 -4
- package/dist/services/release-automation/release-buttons.js +3 -3
- package/dist/services/release-automation/schemas/release.schema.d.ts +3 -3
- package/dist/services/runtime/openai.adapter.d.ts +46 -13
- package/dist/services/runtime/openai.adapter.js +169 -131
- package/dist/services/skill-registry.service.d.ts +1 -1
- package/dist/services/skills-pipeline/skills-research.service.js +47 -7
- package/dist/services/taxonomy-service.d.ts +3 -3
- package/dist/services/trust/trust.service.js +6 -4
- package/dist/services/validation-zod.service.js +3 -22
- package/dist/services/validators/index.d.ts +1 -0
- package/dist/services/validators/index.js +1 -0
- package/dist/services/validators/registry.d.ts +21 -0
- package/dist/services/validators/registry.js +42 -0
- package/dist/skills/test-skill/package.json +1 -1
- package/dist/spec/extensions/cognition.schema.json +87 -0
- package/dist/spec/extensions/role-manifest.md +188 -0
- package/dist/spec/layer4-economics/duadp-examples.json +44 -0
- package/dist/spec/v0.4/agent.schema.json +14 -0
- package/dist/spec/v0.4/extensions/mcp/README.md +1 -1
- package/dist/spec/v0.5/agent-builder-openapi.yaml +230 -0
- package/dist/spec/v0.5/agent.schema.json +34 -2
- package/dist/spec/v0.5/extensions/cognition/cognition.schema.json +78 -1
- package/dist/spec/v0.5/extensions/economics/context-pack.schema.json +91 -0
- package/dist/spec/v0.5/extensions/economics/execution-profile.schema.json +148 -0
- package/dist/spec/v0.5/extensions/economics/failure-semantics.schema.json +32 -0
- package/dist/spec/v0.5/extensions/economics/replay-packet.schema.json +120 -0
- package/dist/spec/v0.5/memory-hierarchy.yaml +120 -0
- package/dist/spec/v0.5/role.schema.json +268 -0
- package/dist/spec/v1/agent-card.schema.json +254 -0
- package/dist/types/cognition.zod.d.ts +312 -0
- package/dist/types/cognition.zod.js +223 -0
- package/dist/types/identity.zod.d.ts +5 -5
- package/dist/types/index.d.ts +54 -6
- package/dist/types/index.js +6 -2
- package/dist/types/personality.zod.d.ts +3 -3
- package/dist/types/role.d.ts +126 -0
- package/dist/types/role.js +38 -0
- package/dist/utils/http-client.d.ts +22 -0
- package/dist/utils/http-client.js +51 -0
- package/dist/utils/index.d.ts +3 -0
- package/dist/utils/index.js +3 -0
- package/dist/utils/proxy-resolver.d.ts +36 -0
- package/dist/utils/proxy-resolver.js +59 -0
- package/dist/utils/user-agent.d.ts +11 -0
- package/dist/utils/user-agent.js +17 -0
- package/dist/validation/validator.js +1 -1
- package/dist/validation/version-compliance.js +1 -1
- package/examples/agents/01-customer-support-bot/agent.ossa.yaml +24 -31
- package/examples/agents/05-sales-assistant/agent.ossa.yaml +35 -23
- package/examples/agents/07-research-assistant/agent.ossa.yaml +27 -21
- package/examples/agents/10-meeting-assistant/agent.ossa.yaml +27 -35
- package/examples/agents/security-audit-agent.ossa.yaml +234 -0
- package/examples/agentscope/react-assistant/README.md +1 -1
- package/examples/agentscope/react-assistant/agent.ossa.yaml +37 -33
- package/examples/drupal/content-moderator.ossa.yaml +2 -2
- package/examples/drupal/drupal-contributor-agent/.eslintrc.json +58 -0
- package/examples/drupal/drupal-contributor-agent/.prettierrc.json +10 -0
- package/examples/drupal/drupal-contributor-agent/package.json +55 -0
- package/examples/drupal/drupal-contributor-agent/src/core/index.ts +10 -0
- package/examples/drupal/drupal-contributor-agent/src/index.ts +17 -0
- package/examples/drupal/drupal-contributor-agent/src/types/index.ts +180 -0
- package/examples/drupal/drupal-contributor-agent/tsconfig.json +36 -0
- package/examples/drupal/drupal-contributor.ossa.yaml +247 -0
- package/examples/export/langchain/production-agent-with-memory/README.md +1 -1
- package/examples/export/langchain/production-agent-with-memory/agent.ossa.yaml +13 -23
- package/examples/export/langchain/production-agent-with-streaming/agent.ossa.yaml +1 -15
- package/examples/export/langchain/production-agent-with-tools/agent.ossa.yaml +28 -29
- package/examples/getting-started/01-minimal-agent.ossa.yaml +1 -1
- 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 +1 -1
- package/examples/getting-started/05-workflow-composition.ossa.yaml +1 -1
- package/examples/getting-started/README.md +3 -3
- package/examples/getting-started/hello-world-complete.ossa.yaml +1 -1
- package/examples/gitlab-agents/gitlab-ci-agent.ossa.yaml +221 -0
- package/examples/hierarchical-agent.ossa.yaml +10 -53
- package/examples/kagent/ossa-kagent-anthropic.ossa.yaml +2 -25
- package/examples/kagent/ossa-kagent-mcp-tools.ossa.yaml +2 -30
- package/examples/kagent/ossa-kagent-multi-tool.ossa.yaml +2 -18
- package/examples/kagent/ossa-kagent-poc.ossa.yaml +2 -16
- package/examples/pipeline-agent.ossa.yaml +3 -3
- package/examples/platform-specific/claude-code-subagent.yaml +1 -1
- package/examples/platform-specific/cursor-coding-agent.yaml +1 -1
- package/examples/platform-specific/warp-terminal-agent.yaml +1 -1
- package/examples/production-ready/01-customer-support-bot/agent.ossa.yaml +24 -31
- package/examples/production-ready/05-sales-assistant/agent.ossa.yaml +35 -23
- package/examples/production-ready/07-research-assistant/agent.ossa.yaml +27 -19
- package/examples/production-ready/10-meeting-assistant/agent.ossa.yaml +27 -35
- package/examples/roles/drupal-developer.role.yaml +37 -0
- package/examples/roles/platform-operator.role.yaml +28 -0
- package/examples/roles/security-auditor.role.yaml +27 -0
- package/examples/swarm-agent.ossa.yaml +13 -51
- package/examples/team-agent.ossa.yaml +12 -61
- package/examples/team-lead-teammate.ossa.yaml +12 -17
- package/openapi/agent-cognition-sessions.yaml +580 -0
- package/openapi/agent-communication.yaml +260 -212
- package/openapi/agent-crud.yaml +237 -207
- package/openapi/agent-discovery.yaml +119 -81
- package/openapi/agent-identity.yaml +219 -187
- package/openapi/agent-taxonomy.yaml +95 -38
- package/openapi/agents-md-service.yaml +103 -30
- package/openapi/cli/openapi.yaml +147 -40
- package/openapi/core/ossa-core-api.openapi.yaml +327 -271
- package/openapi/core/ossa-registry-api.openapi.yaml +299 -236
- package/openapi/core/ossa-registry.openapi.yaml +299 -159
- package/openapi/core/unified-agent-gateway.openapi.yaml +234 -170
- package/openapi/daemon-api.openapi.yaml +323 -181
- package/openapi/dev-cli/openapi.yaml +137 -113
- package/openapi/github-sync.yaml +62 -19
- package/openapi/marketplace-plugin.openapi.yaml +539 -466
- package/openapi/ossa-api.openapi.yaml +354 -213
- package/openapi/ossa-cli-enhancements.openapi.yaml +109 -90
- package/openapi/ossa-cli.yaml +260 -184
- package/openapi/protocols/sse-streams.yaml +66 -74
- package/openapi/protocols/websocket-events.yaml +61 -54
- package/openapi/reference-implementations/aiflow-bridge-api.openapi.yaml +37 -20
- package/openapi/reference-implementations/compliance-agent-api.openapi.yaml +35 -23
- package/openapi/reference-implementations/crewai-agent-api.openapi.yaml +29 -18
- package/openapi/reference-implementations/critic-agent-api.openapi.yaml +45 -19
- package/openapi/reference-implementations/document-analyzer-api.openapi.yaml +30 -24
- package/openapi/reference-implementations/drupal-agent-api.openapi.yaml +101 -50
- package/openapi/reference-implementations/getting-started-hello-world-api.openapi.yaml +33 -22
- package/openapi/reference-implementations/gitlab-ml-recommender-api.openapi.yaml +20 -16
- package/openapi/reference-implementations/governor-agent-api.openapi.yaml +41 -23
- package/openapi/reference-implementations/helm-generator.openapi.yaml +88 -46
- package/openapi/reference-implementations/integrator-agent-api.openapi.yaml +30 -20
- package/openapi/reference-implementations/judge-agent-api.openapi.yaml +22 -16
- package/openapi/reference-implementations/k8s-troubleshooter-api.openapi.yaml +32 -18
- package/openapi/reference-implementations/langchain-agent-api.openapi.yaml +32 -21
- package/openapi/reference-implementations/monitor-agent-api.openapi.yaml +34 -21
- package/openapi/reference-implementations/orchestrator-agent-api.openapi.yaml +49 -27
- package/openapi/reference-implementations/quickstart-support-agent-api.openapi.yaml +27 -19
- package/openapi/reference-implementations/self-evolving-ecosystem.openapi.yaml +427 -293
- package/openapi/reference-implementations/worker-agent-api.openapi.yaml +34 -23
- package/openapi/reference-implementations/workflow-orchestrator-api.openapi.yaml +35 -21
- package/openapi/release-automation.openapi.yaml +48 -14
- package/openapi/schemas/common/agent.yaml +30 -29
- package/openapi/schemas/common/economics.yaml +98 -0
- package/openapi/schemas/common/errors.yaml +13 -3
- package/openapi/schemas/common/metadata.yaml +22 -7
- package/openapi/schemas/common/pagination.yaml +18 -6
- package/openapi/schemas/common/security.yaml +13 -5
- package/openapi/schemas/index.yaml +49 -42
- package/openapi/uadp-asyncapi.yaml +5 -3
- package/openapi/uadp-openapi.yaml +243 -165
- package/openapi/version-management.openapi.yaml +142 -135
- package/package.json +43 -14
- package/spec/extensions/cognition.schema.json +87 -0
- package/spec/extensions/role-manifest.md +188 -0
- package/spec/layer4-economics/duadp-examples.json +44 -0
- package/spec/v0.4/agent.schema.json +14 -0
- package/spec/v0.4/extensions/mcp/README.md +1 -1
- package/spec/v0.5/agent-builder-openapi.yaml +230 -0
- package/spec/v0.5/agent.schema.json +34 -2
- package/spec/v0.5/extensions/cognition/cognition.schema.json +78 -1
- package/spec/v0.5/extensions/economics/context-pack.schema.json +91 -0
- package/spec/v0.5/extensions/economics/execution-profile.schema.json +148 -0
- package/spec/v0.5/extensions/economics/failure-semantics.schema.json +32 -0
- package/spec/v0.5/extensions/economics/replay-packet.schema.json +120 -0
- package/spec/v0.5/memory-hierarchy.yaml +120 -0
- package/spec/v0.5/role.schema.json +268 -0
- package/spec/v1/agent-card.schema.json +254 -0
- package/dist/adapters/a2a/__tests__/mcp-integration.spec.d.ts +0 -5
- package/dist/adapters/a2a/__tests__/mcp-integration.spec.js +0 -268
- package/dist/adapters/a2a/__tests__/mcp-transport.spec.d.ts +0 -5
- package/dist/adapters/a2a/__tests__/mcp-transport.spec.js +0 -203
- package/dist/mcp-server/__tests__/mcp-server.spec.d.ts +0 -8
- package/dist/mcp-server/__tests__/mcp-server.spec.js +0 -557
- package/dist/validation/__tests__/error-codes.test.d.ts +0 -5
- package/dist/validation/__tests__/error-codes.test.js +0 -252
- package/dist/version-management/core/version-manager.test.d.ts +0 -2
- package/dist/version-management/core/version-manager.test.js +0 -210
|
@@ -0,0 +1,254 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$id": "https://ossa.dev/spec/v1/agent-card.schema.json",
|
|
3
|
+
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
|
4
|
+
"title": "Agent Card v1.0",
|
|
5
|
+
"description": "Machine-readable agent passport enabling auto-discovery, auth negotiation, capability verification, and A2A protocol compatibility.",
|
|
6
|
+
"type": "object",
|
|
7
|
+
"required": [
|
|
8
|
+
"schemaVersion",
|
|
9
|
+
"humanReadableId",
|
|
10
|
+
"agentVersion",
|
|
11
|
+
"name",
|
|
12
|
+
"description",
|
|
13
|
+
"url",
|
|
14
|
+
"capabilities",
|
|
15
|
+
"authSchemes"
|
|
16
|
+
],
|
|
17
|
+
"properties": {
|
|
18
|
+
"schemaVersion": {
|
|
19
|
+
"type": "string",
|
|
20
|
+
"const": "1.0",
|
|
21
|
+
"description": "Version of the Agent Card schema."
|
|
22
|
+
},
|
|
23
|
+
"humanReadableId": {
|
|
24
|
+
"type": "string",
|
|
25
|
+
"pattern": "^[a-z0-9][a-z0-9._-]*/[a-z0-9][a-z0-9._-]*$",
|
|
26
|
+
"description": "Unique namespace/agent identifier in 'org/agent-name' format.",
|
|
27
|
+
"examples": ["acme/weather-reporter", "blueflyio/code-review-agent"]
|
|
28
|
+
},
|
|
29
|
+
"agentVersion": {
|
|
30
|
+
"type": "string",
|
|
31
|
+
"pattern": "^(0|[1-9]\\d*)\\.(0|[1-9]\\d*)\\.(0|[1-9]\\d*)(?:-((?:0|[1-9]\\d*|\\d*[a-zA-Z-][0-9a-zA-Z-]*)(?:\\.(?:0|[1-9]\\d*|\\d*[a-zA-Z-][0-9a-zA-Z-]*))*))?(?:\\+([0-9a-zA-Z-]+(?:\\.[0-9a-zA-Z-]+)*))?$",
|
|
32
|
+
"description": "Semantic version (MAJOR.MINOR.PATCH) of the agent software.",
|
|
33
|
+
"examples": ["1.0.0", "2.1.0-beta.1"]
|
|
34
|
+
},
|
|
35
|
+
"name": {
|
|
36
|
+
"type": "string",
|
|
37
|
+
"maxLength": 150,
|
|
38
|
+
"description": "Human-readable display name."
|
|
39
|
+
},
|
|
40
|
+
"description": {
|
|
41
|
+
"type": "string",
|
|
42
|
+
"maxLength": 2000,
|
|
43
|
+
"description": "Clear description of the agent's purpose and capabilities."
|
|
44
|
+
},
|
|
45
|
+
"url": {
|
|
46
|
+
"type": "string",
|
|
47
|
+
"format": "uri",
|
|
48
|
+
"description": "Primary A2A endpoint URL. MUST use HTTPS except for localhost.",
|
|
49
|
+
"examples": ["https://api.my-agent.example.com/a2a"]
|
|
50
|
+
},
|
|
51
|
+
"provider": {
|
|
52
|
+
"$ref": "#/$defs/Provider"
|
|
53
|
+
},
|
|
54
|
+
"capabilities": {
|
|
55
|
+
"$ref": "#/$defs/Capabilities"
|
|
56
|
+
},
|
|
57
|
+
"authSchemes": {
|
|
58
|
+
"type": "array",
|
|
59
|
+
"minItems": 1,
|
|
60
|
+
"description": "Authentication schemes supported. At least one is required.",
|
|
61
|
+
"items": {
|
|
62
|
+
"$ref": "#/$defs/AuthScheme"
|
|
63
|
+
}
|
|
64
|
+
},
|
|
65
|
+
"skills": {
|
|
66
|
+
"type": "array",
|
|
67
|
+
"description": "Discrete operations the agent can perform.",
|
|
68
|
+
"items": {
|
|
69
|
+
"$ref": "#/$defs/Skill"
|
|
70
|
+
}
|
|
71
|
+
},
|
|
72
|
+
"tags": {
|
|
73
|
+
"type": "array",
|
|
74
|
+
"description": "Searchable discovery keywords.",
|
|
75
|
+
"items": {
|
|
76
|
+
"type": "string"
|
|
77
|
+
}
|
|
78
|
+
},
|
|
79
|
+
"privacyPolicyUrl": {
|
|
80
|
+
"type": "string",
|
|
81
|
+
"format": "uri",
|
|
82
|
+
"description": "URL to the agent's privacy policy."
|
|
83
|
+
},
|
|
84
|
+
"termsOfServiceUrl": {
|
|
85
|
+
"type": "string",
|
|
86
|
+
"format": "uri",
|
|
87
|
+
"description": "URL to the agent's terms of service."
|
|
88
|
+
},
|
|
89
|
+
"iconUrl": {
|
|
90
|
+
"type": "string",
|
|
91
|
+
"format": "uri",
|
|
92
|
+
"description": "URL to the agent's icon image."
|
|
93
|
+
},
|
|
94
|
+
"lastUpdated": {
|
|
95
|
+
"type": "string",
|
|
96
|
+
"format": "date-time",
|
|
97
|
+
"description": "ISO 8601 timestamp of last modification to this card."
|
|
98
|
+
}
|
|
99
|
+
},
|
|
100
|
+
"additionalProperties": false,
|
|
101
|
+
"$defs": {
|
|
102
|
+
"Provider": {
|
|
103
|
+
"type": "object",
|
|
104
|
+
"required": ["name"],
|
|
105
|
+
"description": "Organization or individual operating this agent.",
|
|
106
|
+
"properties": {
|
|
107
|
+
"name": {
|
|
108
|
+
"type": "string",
|
|
109
|
+
"description": "Display name of the provider."
|
|
110
|
+
},
|
|
111
|
+
"url": {
|
|
112
|
+
"type": "string",
|
|
113
|
+
"format": "uri",
|
|
114
|
+
"description": "Provider's homepage URL."
|
|
115
|
+
},
|
|
116
|
+
"support_contact": {
|
|
117
|
+
"type": "string",
|
|
118
|
+
"description": "Support contact (email, URL, or mailto: URI)."
|
|
119
|
+
}
|
|
120
|
+
},
|
|
121
|
+
"additionalProperties": false
|
|
122
|
+
},
|
|
123
|
+
"Capabilities": {
|
|
124
|
+
"type": "object",
|
|
125
|
+
"required": ["a2aVersion"],
|
|
126
|
+
"description": "Protocol capabilities for this agent.",
|
|
127
|
+
"properties": {
|
|
128
|
+
"a2aVersion": {
|
|
129
|
+
"type": "string",
|
|
130
|
+
"description": "A2A protocol version supported.",
|
|
131
|
+
"examples": ["1.0"]
|
|
132
|
+
},
|
|
133
|
+
"mcpVersion": {
|
|
134
|
+
"type": "string",
|
|
135
|
+
"description": "MCP protocol version supported, if any.",
|
|
136
|
+
"examples": ["0.6"]
|
|
137
|
+
},
|
|
138
|
+
"supportedMessageParts": {
|
|
139
|
+
"type": "array",
|
|
140
|
+
"description": "Message part types this agent can consume/produce.",
|
|
141
|
+
"items": {
|
|
142
|
+
"type": "string",
|
|
143
|
+
"enum": ["text", "file", "data", "image", "audio", "video"]
|
|
144
|
+
}
|
|
145
|
+
},
|
|
146
|
+
"supportsPushNotifications": {
|
|
147
|
+
"type": "boolean",
|
|
148
|
+
"default": false,
|
|
149
|
+
"description": "Whether the agent supports async push notifications."
|
|
150
|
+
},
|
|
151
|
+
"teeDetails": {
|
|
152
|
+
"$ref": "#/$defs/TeeDetails"
|
|
153
|
+
}
|
|
154
|
+
},
|
|
155
|
+
"additionalProperties": false
|
|
156
|
+
},
|
|
157
|
+
"TeeDetails": {
|
|
158
|
+
"type": "object",
|
|
159
|
+
"required": ["type"],
|
|
160
|
+
"description": "Trusted Execution Environment attestation details.",
|
|
161
|
+
"properties": {
|
|
162
|
+
"type": {
|
|
163
|
+
"type": "string",
|
|
164
|
+
"description": "TEE technology type.",
|
|
165
|
+
"examples": ["Intel SGX", "AMD SEV", "AWS Nitro"]
|
|
166
|
+
},
|
|
167
|
+
"attestationEndpoint": {
|
|
168
|
+
"type": "string",
|
|
169
|
+
"format": "uri",
|
|
170
|
+
"description": "URL of the TEE remote attestation endpoint."
|
|
171
|
+
},
|
|
172
|
+
"publicKey": {
|
|
173
|
+
"type": "string",
|
|
174
|
+
"description": "PEM-encoded public key of the enclave."
|
|
175
|
+
},
|
|
176
|
+
"description": {
|
|
177
|
+
"type": "string",
|
|
178
|
+
"description": "Human-readable explanation of what the TEE protects."
|
|
179
|
+
}
|
|
180
|
+
},
|
|
181
|
+
"additionalProperties": false
|
|
182
|
+
},
|
|
183
|
+
"AuthScheme": {
|
|
184
|
+
"type": "object",
|
|
185
|
+
"required": ["scheme"],
|
|
186
|
+
"description": "A single authentication method supported by the agent.",
|
|
187
|
+
"properties": {
|
|
188
|
+
"scheme": {
|
|
189
|
+
"type": "string",
|
|
190
|
+
"enum": ["apiKey", "oauth2", "bearer", "none"],
|
|
191
|
+
"description": "Authentication scheme identifier."
|
|
192
|
+
},
|
|
193
|
+
"description": {
|
|
194
|
+
"type": "string",
|
|
195
|
+
"description": "How to obtain and use credentials for this scheme."
|
|
196
|
+
},
|
|
197
|
+
"tokenUrl": {
|
|
198
|
+
"type": "string",
|
|
199
|
+
"format": "uri",
|
|
200
|
+
"description": "OAuth2 token endpoint. Required when scheme is 'oauth2'."
|
|
201
|
+
},
|
|
202
|
+
"scopes": {
|
|
203
|
+
"type": "array",
|
|
204
|
+
"description": "OAuth2 scopes required (scheme: oauth2 only).",
|
|
205
|
+
"items": {
|
|
206
|
+
"type": "string"
|
|
207
|
+
}
|
|
208
|
+
},
|
|
209
|
+
"service_identifier": {
|
|
210
|
+
"type": "string",
|
|
211
|
+
"description": "Stable key for credential managers (e.g., 'acme-weather-api')."
|
|
212
|
+
}
|
|
213
|
+
},
|
|
214
|
+
"if": {
|
|
215
|
+
"properties": { "scheme": { "const": "oauth2" } }
|
|
216
|
+
},
|
|
217
|
+
"then": {
|
|
218
|
+
"required": ["tokenUrl"]
|
|
219
|
+
},
|
|
220
|
+
"additionalProperties": false
|
|
221
|
+
},
|
|
222
|
+
"Skill": {
|
|
223
|
+
"type": "object",
|
|
224
|
+
"required": ["id", "name", "description"],
|
|
225
|
+
"description": "A discrete callable operation the agent can perform.",
|
|
226
|
+
"properties": {
|
|
227
|
+
"id": {
|
|
228
|
+
"type": "string",
|
|
229
|
+
"pattern": "^[a-z][a-z0-9_-]*$",
|
|
230
|
+
"description": "Stable machine-readable skill identifier, unique within the agent."
|
|
231
|
+
},
|
|
232
|
+
"name": {
|
|
233
|
+
"type": "string",
|
|
234
|
+
"description": "Human-readable display name."
|
|
235
|
+
},
|
|
236
|
+
"description": {
|
|
237
|
+
"type": "string",
|
|
238
|
+
"description": "Purpose and behaviour of this skill."
|
|
239
|
+
},
|
|
240
|
+
"input_schema": {
|
|
241
|
+
"type": "object",
|
|
242
|
+
"description": "JSON Schema describing the expected input payload.",
|
|
243
|
+
"additionalProperties": true
|
|
244
|
+
},
|
|
245
|
+
"output_schema": {
|
|
246
|
+
"type": "object",
|
|
247
|
+
"description": "JSON Schema describing the response payload structure.",
|
|
248
|
+
"additionalProperties": true
|
|
249
|
+
}
|
|
250
|
+
},
|
|
251
|
+
"additionalProperties": false
|
|
252
|
+
}
|
|
253
|
+
}
|
|
254
|
+
}
|
|
@@ -1,268 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* MCP Integration Service Tests
|
|
3
|
-
*/
|
|
4
|
-
import { afterEach, beforeEach, describe, expect, it } from '@jest/globals';
|
|
5
|
-
import { SPEC_VERSION } from '../../../version.js';
|
|
6
|
-
import { A2AMessageType, MessagePriority } from '../a2a-protocol.js';
|
|
7
|
-
import { MCPIntegrationService, MCPMessageType } from '../mcp-integration.js';
|
|
8
|
-
// Helper to create test agent identity
|
|
9
|
-
function createTestAgent(name, namespace) {
|
|
10
|
-
return {
|
|
11
|
-
id: crypto.randomUUID(),
|
|
12
|
-
uri: `uadp://${namespace}/${name}`,
|
|
13
|
-
name,
|
|
14
|
-
namespace,
|
|
15
|
-
capabilities: ['test'],
|
|
16
|
-
version: '1.0.0',
|
|
17
|
-
};
|
|
18
|
-
}
|
|
19
|
-
describe('MCPIntegrationService', () => {
|
|
20
|
-
let service;
|
|
21
|
-
beforeEach(() => {
|
|
22
|
-
service = new MCPIntegrationService();
|
|
23
|
-
});
|
|
24
|
-
afterEach(async () => {
|
|
25
|
-
await service.cleanup();
|
|
26
|
-
});
|
|
27
|
-
describe('Connection Management', () => {
|
|
28
|
-
it('should connect to MCP server (mock)', async () => {
|
|
29
|
-
const uri = 'http://localhost:3000/mcp';
|
|
30
|
-
try {
|
|
31
|
-
const connection = await service.connectMCPServer(uri);
|
|
32
|
-
expect(connection).toBeDefined();
|
|
33
|
-
expect(connection.uri).toBe(uri);
|
|
34
|
-
expect(connection.status).toBe('connected');
|
|
35
|
-
}
|
|
36
|
-
catch (error) {
|
|
37
|
-
// Expected to fail without real server, but should attempt connection
|
|
38
|
-
expect(error).toBeDefined();
|
|
39
|
-
}
|
|
40
|
-
});
|
|
41
|
-
it('should disconnect from MCP server', async () => {
|
|
42
|
-
const uri = 'http://localhost:3000/mcp';
|
|
43
|
-
try {
|
|
44
|
-
const connection = await service.connectMCPServer(uri);
|
|
45
|
-
await service.disconnectMCPServer(connection.id);
|
|
46
|
-
}
|
|
47
|
-
catch (error) {
|
|
48
|
-
// Expected to fail without real server
|
|
49
|
-
}
|
|
50
|
-
});
|
|
51
|
-
it('should handle disconnect of non-existent connection', async () => {
|
|
52
|
-
await expect(service.disconnectMCPServer('non-existent-id')).rejects.toThrow('MCP connection not found');
|
|
53
|
-
});
|
|
54
|
-
});
|
|
55
|
-
describe('Server Exposure', () => {
|
|
56
|
-
it('should expose agent as MCP server', async () => {
|
|
57
|
-
const agent = createTestAgent('Test Agent', 'test-namespace');
|
|
58
|
-
const server = await service.exposeMCPServer(agent);
|
|
59
|
-
expect(server).toBeDefined();
|
|
60
|
-
expect(server.agent).toEqual(agent);
|
|
61
|
-
expect(server.endpoint).toContain(agent.namespace);
|
|
62
|
-
expect(server.endpoint).toContain(agent.name);
|
|
63
|
-
expect(server.capabilities).toBeDefined();
|
|
64
|
-
});
|
|
65
|
-
it('should set default capabilities for exposed server', async () => {
|
|
66
|
-
const agent = createTestAgent('Test Agent', 'test-namespace');
|
|
67
|
-
const server = await service.exposeMCPServer(agent);
|
|
68
|
-
expect(server.capabilities.resources?.list).toBe(true);
|
|
69
|
-
expect(server.capabilities.prompts?.list).toBe(true);
|
|
70
|
-
expect(server.capabilities.tools?.list).toBe(true);
|
|
71
|
-
expect(server.capabilities.logging).toBeDefined();
|
|
72
|
-
});
|
|
73
|
-
});
|
|
74
|
-
describe('Discovery Operations', () => {
|
|
75
|
-
it('should discover resources (connection required)', async () => {
|
|
76
|
-
const uri = 'http://localhost:3000/mcp';
|
|
77
|
-
try {
|
|
78
|
-
const connection = await service.connectMCPServer(uri);
|
|
79
|
-
const resources = await service.discoverResources(connection.id);
|
|
80
|
-
expect(Array.isArray(resources)).toBe(true);
|
|
81
|
-
}
|
|
82
|
-
catch (error) {
|
|
83
|
-
// Expected to fail without real server
|
|
84
|
-
expect(error).toBeDefined();
|
|
85
|
-
}
|
|
86
|
-
});
|
|
87
|
-
it('should discover prompts (connection required)', async () => {
|
|
88
|
-
const uri = 'http://localhost:3000/mcp';
|
|
89
|
-
try {
|
|
90
|
-
const connection = await service.connectMCPServer(uri);
|
|
91
|
-
const prompts = await service.discoverPrompts(connection.id);
|
|
92
|
-
expect(Array.isArray(prompts)).toBe(true);
|
|
93
|
-
}
|
|
94
|
-
catch (error) {
|
|
95
|
-
// Expected to fail without real server
|
|
96
|
-
expect(error).toBeDefined();
|
|
97
|
-
}
|
|
98
|
-
});
|
|
99
|
-
it('should discover tools (connection required)', async () => {
|
|
100
|
-
const uri = 'http://localhost:3000/mcp';
|
|
101
|
-
try {
|
|
102
|
-
const connection = await service.connectMCPServer(uri);
|
|
103
|
-
const tools = await service.discoverTools(connection.id);
|
|
104
|
-
expect(Array.isArray(tools)).toBe(true);
|
|
105
|
-
}
|
|
106
|
-
catch (error) {
|
|
107
|
-
// Expected to fail without real server
|
|
108
|
-
expect(error).toBeDefined();
|
|
109
|
-
}
|
|
110
|
-
});
|
|
111
|
-
it('should handle discovery with invalid connection ID', async () => {
|
|
112
|
-
await expect(service.discoverResources('invalid-id')).rejects.toThrow('MCP connection not found');
|
|
113
|
-
await expect(service.discoverPrompts('invalid-id')).rejects.toThrow('MCP connection not found');
|
|
114
|
-
await expect(service.discoverTools('invalid-id')).rejects.toThrow('MCP connection not found');
|
|
115
|
-
});
|
|
116
|
-
});
|
|
117
|
-
describe('Tool Invocation', () => {
|
|
118
|
-
it('should call MCP tool (connection required)', async () => {
|
|
119
|
-
const uri = 'http://localhost:3000/mcp';
|
|
120
|
-
try {
|
|
121
|
-
const connection = await service.connectMCPServer(uri);
|
|
122
|
-
const result = await service.callTool(connection.id, 'test-tool', {
|
|
123
|
-
arg1: 'value1',
|
|
124
|
-
});
|
|
125
|
-
expect(result).toBeDefined();
|
|
126
|
-
}
|
|
127
|
-
catch (error) {
|
|
128
|
-
// Expected to fail without real server
|
|
129
|
-
expect(error).toBeDefined();
|
|
130
|
-
}
|
|
131
|
-
});
|
|
132
|
-
it('should handle tool call with invalid connection', async () => {
|
|
133
|
-
await expect(service.callTool('invalid-id', 'test-tool', {})).rejects.toThrow('MCP connection not found');
|
|
134
|
-
});
|
|
135
|
-
});
|
|
136
|
-
describe('Resource Reading', () => {
|
|
137
|
-
it('should read MCP resource (connection required)', async () => {
|
|
138
|
-
const uri = 'http://localhost:3000/mcp';
|
|
139
|
-
try {
|
|
140
|
-
const connection = await service.connectMCPServer(uri);
|
|
141
|
-
const content = await service.readResource(connection.id, 'resource://test/path');
|
|
142
|
-
expect(content).toBeDefined();
|
|
143
|
-
}
|
|
144
|
-
catch (error) {
|
|
145
|
-
// Expected to fail without real server
|
|
146
|
-
expect(error).toBeDefined();
|
|
147
|
-
}
|
|
148
|
-
});
|
|
149
|
-
it('should handle resource read with invalid connection', async () => {
|
|
150
|
-
await expect(service.readResource('invalid-id', 'resource://test')).rejects.toThrow('MCP connection not found');
|
|
151
|
-
});
|
|
152
|
-
});
|
|
153
|
-
describe('Protocol Conversion', () => {
|
|
154
|
-
it('should convert A2A message to MCP format', () => {
|
|
155
|
-
const from = createTestAgent('Sender', 'sender');
|
|
156
|
-
const to = createTestAgent('Receiver', 'receiver');
|
|
157
|
-
const a2aMessage = {
|
|
158
|
-
id: 'test-123',
|
|
159
|
-
from,
|
|
160
|
-
to,
|
|
161
|
-
type: A2AMessageType.COMMAND,
|
|
162
|
-
payload: { action: 'test' },
|
|
163
|
-
version: SPEC_VERSION,
|
|
164
|
-
metadata: {
|
|
165
|
-
priority: MessagePriority.NORMAL,
|
|
166
|
-
timeout: 30000,
|
|
167
|
-
retries: 3,
|
|
168
|
-
traceContext: {
|
|
169
|
-
traceparent: '00-trace-span-01',
|
|
170
|
-
traceId: 'trace',
|
|
171
|
-
spanId: 'span',
|
|
172
|
-
},
|
|
173
|
-
createdAt: new Date().toISOString(),
|
|
174
|
-
},
|
|
175
|
-
};
|
|
176
|
-
const mcpMessage = service.a2aToMCP(a2aMessage);
|
|
177
|
-
expect(mcpMessage).toHaveProperty('jsonrpc', '2.0');
|
|
178
|
-
expect(mcpMessage).toHaveProperty('id', 'test-123');
|
|
179
|
-
expect(mcpMessage).toHaveProperty('method');
|
|
180
|
-
expect(mcpMessage).toHaveProperty('params');
|
|
181
|
-
expect(mcpMessage.metadata).toHaveProperty('from', from.uri);
|
|
182
|
-
});
|
|
183
|
-
it('should convert MCP message to A2A format', () => {
|
|
184
|
-
const from = createTestAgent('Sender', 'sender');
|
|
185
|
-
const to = createTestAgent('Receiver', 'receiver');
|
|
186
|
-
const mcpMessage = {
|
|
187
|
-
jsonrpc: '2.0',
|
|
188
|
-
id: 'mcp-123',
|
|
189
|
-
method: MCPMessageType.TOOLS_CALL,
|
|
190
|
-
params: { tool: 'test' },
|
|
191
|
-
};
|
|
192
|
-
const a2aMessage = service.mcpToA2A(mcpMessage, from, to);
|
|
193
|
-
expect(a2aMessage).toHaveProperty('id', 'mcp-123');
|
|
194
|
-
expect(a2aMessage).toHaveProperty('from', from);
|
|
195
|
-
expect(a2aMessage).toHaveProperty('to', to);
|
|
196
|
-
expect(a2aMessage).toHaveProperty('type');
|
|
197
|
-
expect(a2aMessage).toHaveProperty('payload');
|
|
198
|
-
expect(a2aMessage).toHaveProperty('version', '0.4.4');
|
|
199
|
-
expect(a2aMessage.metadata).toBeDefined();
|
|
200
|
-
});
|
|
201
|
-
it('should map A2A types to MCP methods correctly', () => {
|
|
202
|
-
const agent = createTestAgent('Test', 'test');
|
|
203
|
-
const baseMessage = {
|
|
204
|
-
id: '1',
|
|
205
|
-
from: agent,
|
|
206
|
-
to: agent,
|
|
207
|
-
payload: {},
|
|
208
|
-
version: SPEC_VERSION,
|
|
209
|
-
metadata: {
|
|
210
|
-
priority: MessagePriority.NORMAL,
|
|
211
|
-
timeout: 30000,
|
|
212
|
-
retries: 3,
|
|
213
|
-
traceContext: { traceparent: '00-t-s-01', traceId: 't', spanId: 's' },
|
|
214
|
-
createdAt: new Date().toISOString(),
|
|
215
|
-
},
|
|
216
|
-
};
|
|
217
|
-
// Test request -> tools/call
|
|
218
|
-
const requestMsg = { ...baseMessage, type: A2AMessageType.REQUEST };
|
|
219
|
-
const mcpRequest = service.a2aToMCP(requestMsg);
|
|
220
|
-
expect(mcpRequest.method).toBe(MCPMessageType.TOOLS_CALL);
|
|
221
|
-
// Test command -> tools/call
|
|
222
|
-
const commandMsg = { ...baseMessage, type: A2AMessageType.COMMAND };
|
|
223
|
-
const mcpCommand = service.a2aToMCP(commandMsg);
|
|
224
|
-
expect(mcpCommand.method).toBe(MCPMessageType.TOOLS_CALL);
|
|
225
|
-
// Test event -> notification
|
|
226
|
-
const eventMsg = { ...baseMessage, type: A2AMessageType.EVENT };
|
|
227
|
-
const mcpEvent = service.a2aToMCP(eventMsg);
|
|
228
|
-
expect(mcpEvent.method).toBe(MCPMessageType.NOTIFICATION);
|
|
229
|
-
});
|
|
230
|
-
});
|
|
231
|
-
describe('Statistics and State', () => {
|
|
232
|
-
it('should track connections', () => {
|
|
233
|
-
const connections = service.getConnections();
|
|
234
|
-
expect(Array.isArray(connections)).toBe(true);
|
|
235
|
-
});
|
|
236
|
-
it('should track exposed servers', async () => {
|
|
237
|
-
const agent = createTestAgent('Test', 'test');
|
|
238
|
-
await service.exposeMCPServer(agent);
|
|
239
|
-
const servers = service.getServers();
|
|
240
|
-
expect(servers.length).toBeGreaterThan(0);
|
|
241
|
-
expect(servers[0].agent).toEqual(agent);
|
|
242
|
-
});
|
|
243
|
-
it('should provide transport statistics', () => {
|
|
244
|
-
const stats = service.getTransportStats();
|
|
245
|
-
expect(stats).toHaveProperty('totalConnections');
|
|
246
|
-
expect(stats).toHaveProperty('totalRequests');
|
|
247
|
-
expect(stats).toHaveProperty('connections');
|
|
248
|
-
});
|
|
249
|
-
});
|
|
250
|
-
describe('Cleanup', () => {
|
|
251
|
-
it('should cleanup all connections', async () => {
|
|
252
|
-
await expect(service.cleanup()).resolves.not.toThrow();
|
|
253
|
-
});
|
|
254
|
-
it('should disconnect all transport connections on cleanup', async () => {
|
|
255
|
-
const uri = 'http://localhost:3000/mcp';
|
|
256
|
-
try {
|
|
257
|
-
await service.connectMCPServer(uri);
|
|
258
|
-
}
|
|
259
|
-
catch (error) {
|
|
260
|
-
// Ignore connection errors
|
|
261
|
-
}
|
|
262
|
-
await service.cleanup();
|
|
263
|
-
const stats = service.getTransportStats();
|
|
264
|
-
expect(stats.totalConnections).toBe(0);
|
|
265
|
-
});
|
|
266
|
-
});
|
|
267
|
-
});
|
|
268
|
-
//# sourceMappingURL=mcp-integration.spec.js.map
|