kompass-sdk 0.1.0
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/dist/a2a/agent-card.d.ts +13 -0
- package/dist/a2a/agent-card.d.ts.map +1 -0
- package/dist/a2a/agent-card.js +52 -0
- package/dist/a2a/agent-card.js.map +1 -0
- package/dist/a2a/bridge.d.ts +52 -0
- package/dist/a2a/bridge.d.ts.map +1 -0
- package/dist/a2a/bridge.js +123 -0
- package/dist/a2a/bridge.js.map +1 -0
- package/dist/a2a/client.d.ts +34 -0
- package/dist/a2a/client.d.ts.map +1 -0
- package/dist/a2a/client.js +65 -0
- package/dist/a2a/client.js.map +1 -0
- package/dist/a2a/server.d.ts +17 -0
- package/dist/a2a/server.d.ts.map +1 -0
- package/dist/a2a/server.js +194 -0
- package/dist/a2a/server.js.map +1 -0
- package/dist/abi.d.ts +1068 -0
- package/dist/abi.d.ts.map +1 -0
- package/dist/abi.js +1372 -0
- package/dist/abi.js.map +1 -0
- package/dist/adapters/agentkit.d.ts +41 -0
- package/dist/adapters/agentkit.d.ts.map +1 -0
- package/dist/adapters/agentkit.js +67 -0
- package/dist/adapters/agentkit.js.map +1 -0
- package/dist/adapters/generic.d.ts +35 -0
- package/dist/adapters/generic.d.ts.map +1 -0
- package/dist/adapters/generic.js +47 -0
- package/dist/adapters/generic.js.map +1 -0
- package/dist/adapters/index.d.ts +5 -0
- package/dist/adapters/index.d.ts.map +1 -0
- package/dist/adapters/index.js +5 -0
- package/dist/adapters/index.js.map +1 -0
- package/dist/adapters/langchain.d.ts +26 -0
- package/dist/adapters/langchain.d.ts.map +1 -0
- package/dist/adapters/langchain.js +228 -0
- package/dist/adapters/langchain.js.map +1 -0
- package/dist/adapters/openclaw.d.ts +18 -0
- package/dist/adapters/openclaw.d.ts.map +1 -0
- package/dist/adapters/openclaw.js +168 -0
- package/dist/adapters/openclaw.js.map +1 -0
- package/dist/aggregator.d.ts +36 -0
- package/dist/aggregator.d.ts.map +1 -0
- package/dist/aggregator.js +168 -0
- package/dist/aggregator.js.map +1 -0
- package/dist/backends/acp.d.ts +29 -0
- package/dist/backends/acp.d.ts.map +1 -0
- package/dist/backends/acp.js +126 -0
- package/dist/backends/acp.js.map +1 -0
- package/dist/backends/types.d.ts +59 -0
- package/dist/backends/types.d.ts.map +1 -0
- package/dist/backends/types.js +2 -0
- package/dist/backends/types.js.map +1 -0
- package/dist/bridge.d.ts +35 -0
- package/dist/bridge.d.ts.map +1 -0
- package/dist/bridge.js +192 -0
- package/dist/bridge.js.map +1 -0
- package/dist/cli.d.ts +12 -0
- package/dist/cli.d.ts.map +1 -0
- package/dist/cli.js +331 -0
- package/dist/cli.js.map +1 -0
- package/dist/discover.d.ts +15 -0
- package/dist/discover.d.ts.map +1 -0
- package/dist/discover.js +163 -0
- package/dist/discover.js.map +1 -0
- package/dist/escrow.d.ts +45 -0
- package/dist/escrow.d.ts.map +1 -0
- package/dist/escrow.js +243 -0
- package/dist/escrow.js.map +1 -0
- package/dist/index.d.ts +63 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +145 -0
- package/dist/index.js.map +1 -0
- package/dist/intents.d.ts +28 -0
- package/dist/intents.d.ts.map +1 -0
- package/dist/intents.js +111 -0
- package/dist/intents.js.map +1 -0
- package/dist/matching.d.ts +29 -0
- package/dist/matching.d.ts.map +1 -0
- package/dist/matching.js +147 -0
- package/dist/matching.js.map +1 -0
- package/dist/pipelineAbi.d.ts +113 -0
- package/dist/pipelineAbi.d.ts.map +1 -0
- package/dist/pipelineAbi.js +74 -0
- package/dist/pipelineAbi.js.map +1 -0
- package/dist/pipelines.d.ts +42 -0
- package/dist/pipelines.d.ts.map +1 -0
- package/dist/pipelines.js +185 -0
- package/dist/pipelines.js.map +1 -0
- package/dist/registry.d.ts +36 -0
- package/dist/registry.d.ts.map +1 -0
- package/dist/registry.js +187 -0
- package/dist/registry.js.map +1 -0
- package/dist/reputation.d.ts +10 -0
- package/dist/reputation.d.ts.map +1 -0
- package/dist/reputation.js +33 -0
- package/dist/reputation.js.map +1 -0
- package/dist/router.d.ts +72 -0
- package/dist/router.d.ts.map +1 -0
- package/dist/router.js +190 -0
- package/dist/router.js.map +1 -0
- package/dist/simple.d.ts +160 -0
- package/dist/simple.d.ts.map +1 -0
- package/dist/simple.js +237 -0
- package/dist/simple.js.map +1 -0
- package/dist/sources/a2a-wellknown.d.ts +8 -0
- package/dist/sources/a2a-wellknown.d.ts.map +1 -0
- package/dist/sources/a2a-wellknown.js +104 -0
- package/dist/sources/a2a-wellknown.js.map +1 -0
- package/dist/sources/acp.d.ts +7 -0
- package/dist/sources/acp.d.ts.map +1 -0
- package/dist/sources/acp.js +86 -0
- package/dist/sources/acp.js.map +1 -0
- package/dist/sources/adp.d.ts +7 -0
- package/dist/sources/adp.d.ts.map +1 -0
- package/dist/sources/adp.js +59 -0
- package/dist/sources/adp.js.map +1 -0
- package/dist/sources/erc8004.d.ts +7 -0
- package/dist/sources/erc8004.d.ts.map +1 -0
- package/dist/sources/erc8004.js +150 -0
- package/dist/sources/erc8004.js.map +1 -0
- package/dist/sources/index.d.ts +17 -0
- package/dist/sources/index.d.ts.map +1 -0
- package/dist/sources/index.js +35 -0
- package/dist/sources/index.js.map +1 -0
- package/dist/sources/kompass-registry.d.ts +8 -0
- package/dist/sources/kompass-registry.d.ts.map +1 -0
- package/dist/sources/kompass-registry.js +62 -0
- package/dist/sources/kompass-registry.js.map +1 -0
- package/dist/sources/l402-directory.d.ts +7 -0
- package/dist/sources/l402-directory.d.ts.map +1 -0
- package/dist/sources/l402-directory.js +42 -0
- package/dist/sources/l402-directory.js.map +1 -0
- package/dist/sources/mcp-registry.d.ts +8 -0
- package/dist/sources/mcp-registry.d.ts.map +1 -0
- package/dist/sources/mcp-registry.js +85 -0
- package/dist/sources/mcp-registry.js.map +1 -0
- package/dist/sources/skills.d.ts +8 -0
- package/dist/sources/skills.d.ts.map +1 -0
- package/dist/sources/skills.js +153 -0
- package/dist/sources/skills.js.map +1 -0
- package/dist/sources/types.d.ts +72 -0
- package/dist/sources/types.d.ts.map +1 -0
- package/dist/sources/types.js +8 -0
- package/dist/sources/types.js.map +1 -0
- package/dist/sources/x402-ecosystem.d.ts +7 -0
- package/dist/sources/x402-ecosystem.d.ts.map +1 -0
- package/dist/sources/x402-ecosystem.js +78 -0
- package/dist/sources/x402-ecosystem.js.map +1 -0
- package/dist/types.d.ts +133 -0
- package/dist/types.d.ts.map +1 -0
- package/dist/types.js +2 -0
- package/dist/types.js.map +1 -0
- package/dist/unified.d.ts +90 -0
- package/dist/unified.d.ts.map +1 -0
- package/dist/unified.js +107 -0
- package/dist/unified.js.map +1 -0
- package/dist/x402.d.ts +30 -0
- package/dist/x402.d.ts.map +1 -0
- package/dist/x402.js +79 -0
- package/dist/x402.js.map +1 -0
- package/package.json +61 -0
- package/scripts/bootstrap-agents.mjs +246 -0
- package/src/.gitkeep +0 -0
- package/src/a2a/agent-card.ts +66 -0
- package/src/a2a/bridge.ts +168 -0
- package/src/a2a/client.ts +92 -0
- package/src/a2a/server.ts +234 -0
- package/src/abi.ts +1373 -0
- package/src/adapters/agentkit.ts +83 -0
- package/src/adapters/generic.ts +62 -0
- package/src/adapters/index.ts +4 -0
- package/src/adapters/langchain.ts +282 -0
- package/src/adapters/openclaw.ts +203 -0
- package/src/aggregator.ts +203 -0
- package/src/backends/acp.ts +199 -0
- package/src/backends/types.ts +78 -0
- package/src/bridge.ts +263 -0
- package/src/cli.ts +397 -0
- package/src/discover.ts +187 -0
- package/src/escrow.ts +284 -0
- package/src/index.ts +245 -0
- package/src/intents.ts +166 -0
- package/src/matching.ts +192 -0
- package/src/pipelineAbi.ts +74 -0
- package/src/pipelines.ts +253 -0
- package/src/registry.ts +232 -0
- package/src/reputation.ts +43 -0
- package/src/router.ts +279 -0
- package/src/simple.ts +366 -0
- package/src/sources/a2a-wellknown.ts +120 -0
- package/src/sources/acp.ts +91 -0
- package/src/sources/adp.ts +64 -0
- package/src/sources/erc8004.ts +166 -0
- package/src/sources/index.ts +52 -0
- package/src/sources/kompass-registry.ts +67 -0
- package/src/sources/l402-directory.ts +51 -0
- package/src/sources/mcp-registry.ts +104 -0
- package/src/sources/skills.ts +161 -0
- package/src/sources/types.ts +82 -0
- package/src/sources/x402-ecosystem.ts +86 -0
- package/src/types.ts +147 -0
- package/src/unified.ts +155 -0
- package/src/x402.ts +122 -0
- package/tests/pipelineFlow.test.ts +239 -0
- package/tsconfig.json +20 -0
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Kompass Agent Card Generator
|
|
3
|
+
* Creates an A2A-compatible agent card for Kompass discovery + coordination
|
|
4
|
+
*/
|
|
5
|
+
import type { AgentCard } from "@a2a-js/sdk";
|
|
6
|
+
export interface KompassAgentCardOptions {
|
|
7
|
+
url: string;
|
|
8
|
+
name?: string;
|
|
9
|
+
description?: string;
|
|
10
|
+
version?: string;
|
|
11
|
+
}
|
|
12
|
+
export declare function createKompassAgentCard(options: KompassAgentCardOptions): AgentCard;
|
|
13
|
+
//# sourceMappingURL=agent-card.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"agent-card.d.ts","sourceRoot":"","sources":["../../src/a2a/agent-card.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AAE7C,MAAM,WAAW,uBAAuB;IACtC,GAAG,EAAE,MAAM,CAAC;IACZ,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,OAAO,CAAC,EAAE,MAAM,CAAC;CAClB;AAED,wBAAgB,sBAAsB,CAAC,OAAO,EAAE,uBAAuB,GAAG,SAAS,CAmDlF"}
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Kompass Agent Card Generator
|
|
3
|
+
* Creates an A2A-compatible agent card for Kompass discovery + coordination
|
|
4
|
+
*/
|
|
5
|
+
export function createKompassAgentCard(options) {
|
|
6
|
+
return {
|
|
7
|
+
name: options.name ?? "Kompass",
|
|
8
|
+
description: options.description ??
|
|
9
|
+
"Universal agent discovery + coordination. Searches ACP, MCP, x402, ERC-8004, A2A, L402 registries in one query. Bridges non-A2A agents to A2A protocol.",
|
|
10
|
+
url: options.url,
|
|
11
|
+
provider: {
|
|
12
|
+
organization: "Kompass Protocol",
|
|
13
|
+
url: "https://github.com/kompass-protocol",
|
|
14
|
+
},
|
|
15
|
+
version: options.version ?? "1.0.0",
|
|
16
|
+
capabilities: {
|
|
17
|
+
streaming: true,
|
|
18
|
+
pushNotifications: false,
|
|
19
|
+
},
|
|
20
|
+
skills: [
|
|
21
|
+
{
|
|
22
|
+
id: "universal-discovery",
|
|
23
|
+
name: "Universal Agent Discovery",
|
|
24
|
+
description: "Search for agents across 8+ registries (ACP, MCP Registry, ERC-8004, x402, A2A, L402, ADP). Returns ranked results with reputation scores.",
|
|
25
|
+
inputModes: ["text"],
|
|
26
|
+
outputModes: ["text", "data"],
|
|
27
|
+
},
|
|
28
|
+
{
|
|
29
|
+
id: "cross-protocol-hire",
|
|
30
|
+
name: "Cross-Protocol Agent Hiring",
|
|
31
|
+
description: "Hire any agent regardless of protocol. Kompass bridges ACP, x402, MCP, and A2A automatically.",
|
|
32
|
+
inputModes: ["text"],
|
|
33
|
+
outputModes: ["text", "data"],
|
|
34
|
+
},
|
|
35
|
+
{
|
|
36
|
+
id: "multi-agent-coordination",
|
|
37
|
+
name: "Multi-Agent Coordination",
|
|
38
|
+
description: "Coordinate multiple agents across different protocols into a pipeline. Discovers agents, assigns roles, manages task dependencies.",
|
|
39
|
+
inputModes: ["text"],
|
|
40
|
+
outputModes: ["text", "data"],
|
|
41
|
+
},
|
|
42
|
+
{
|
|
43
|
+
id: "reputation-check",
|
|
44
|
+
name: "Agent Reputation Check",
|
|
45
|
+
description: "Check an agent's on-chain reputation via ERC-8004. Aggregates trust signals across protocols.",
|
|
46
|
+
inputModes: ["text"],
|
|
47
|
+
outputModes: ["data"],
|
|
48
|
+
},
|
|
49
|
+
],
|
|
50
|
+
};
|
|
51
|
+
}
|
|
52
|
+
//# sourceMappingURL=agent-card.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"agent-card.js","sourceRoot":"","sources":["../../src/a2a/agent-card.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAWH,MAAM,UAAU,sBAAsB,CAAC,OAAgC;IACrE,OAAO;QACL,IAAI,EAAE,OAAO,CAAC,IAAI,IAAI,SAAS;QAC/B,WAAW,EACT,OAAO,CAAC,WAAW;YACnB,yJAAyJ;QAC3J,GAAG,EAAE,OAAO,CAAC,GAAG;QAChB,QAAQ,EAAE;YACR,YAAY,EAAE,kBAAkB;YAChC,GAAG,EAAE,qCAAqC;SAC3C;QACD,OAAO,EAAE,OAAO,CAAC,OAAO,IAAI,OAAO;QACnC,YAAY,EAAE;YACZ,SAAS,EAAE,IAAI;YACf,iBAAiB,EAAE,KAAK;SACzB;QACD,MAAM,EAAE;YACN;gBACE,EAAE,EAAE,qBAAqB;gBACzB,IAAI,EAAE,2BAA2B;gBACjC,WAAW,EACT,4IAA4I;gBAC9I,UAAU,EAAE,CAAC,MAAM,CAAC;gBACpB,WAAW,EAAE,CAAC,MAAM,EAAE,MAAM,CAAC;aAC9B;YACD;gBACE,EAAE,EAAE,qBAAqB;gBACzB,IAAI,EAAE,6BAA6B;gBACnC,WAAW,EACT,+FAA+F;gBACjG,UAAU,EAAE,CAAC,MAAM,CAAC;gBACpB,WAAW,EAAE,CAAC,MAAM,EAAE,MAAM,CAAC;aAC9B;YACD;gBACE,EAAE,EAAE,0BAA0B;gBAC9B,IAAI,EAAE,0BAA0B;gBAChC,WAAW,EACT,oIAAoI;gBACtI,UAAU,EAAE,CAAC,MAAM,CAAC;gBACpB,WAAW,EAAE,CAAC,MAAM,EAAE,MAAM,CAAC;aAC9B;YACD;gBACE,EAAE,EAAE,kBAAkB;gBACtB,IAAI,EAAE,wBAAwB;gBAC9B,WAAW,EACT,+FAA+F;gBACjG,UAAU,EAAE,CAAC,MAAM,CAAC;gBACpB,WAAW,EAAE,CAAC,MAAM,CAAC;aACtB;SACF;KACW,CAAC;AACjB,CAAC"}
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Kompass A2A Bridge
|
|
3
|
+
* Translates between A2A tasks and non-A2A protocols (ACP, x402, MCP)
|
|
4
|
+
* Makes every agent A2A-compatible through Kompass
|
|
5
|
+
*/
|
|
6
|
+
import type { UnifiedAgent } from "../sources/types.js";
|
|
7
|
+
import { type A2ATaskResult } from "./client.js";
|
|
8
|
+
import { ProtocolBridge } from "../bridge.js";
|
|
9
|
+
export declare class A2ABridge {
|
|
10
|
+
private a2aClient;
|
|
11
|
+
private protocolBridge;
|
|
12
|
+
constructor(protocolBridge: ProtocolBridge);
|
|
13
|
+
/**
|
|
14
|
+
* Send a task to any agent, regardless of protocol.
|
|
15
|
+
* If A2A-native → direct A2A task
|
|
16
|
+
* If not → bridge through protocol-specific path, wrap result as A2A
|
|
17
|
+
*/
|
|
18
|
+
sendTask(agent: UnifiedAgent, task: string, contextId?: string): Promise<A2ATaskResult>;
|
|
19
|
+
/**
|
|
20
|
+
* Coordinate a multi-step pipeline across protocols.
|
|
21
|
+
* Each step: discover → send task (A2A or bridged) → pass result to next step.
|
|
22
|
+
*/
|
|
23
|
+
coordinate(steps: CoordinationStep[], findAgent: (query: string) => Promise<UnifiedAgent | null>): Promise<CoordinationResult>;
|
|
24
|
+
}
|
|
25
|
+
export interface CoordinationStep {
|
|
26
|
+
id: string;
|
|
27
|
+
role: string;
|
|
28
|
+
query?: string;
|
|
29
|
+
task?: string;
|
|
30
|
+
agent?: UnifiedAgent;
|
|
31
|
+
dependsOn?: string;
|
|
32
|
+
}
|
|
33
|
+
export interface StepResult {
|
|
34
|
+
stepId: string;
|
|
35
|
+
role: string;
|
|
36
|
+
agent?: {
|
|
37
|
+
name: string;
|
|
38
|
+
source: string;
|
|
39
|
+
protocol: string;
|
|
40
|
+
};
|
|
41
|
+
success: boolean;
|
|
42
|
+
result?: A2ATaskResult;
|
|
43
|
+
error?: string;
|
|
44
|
+
skipped?: boolean;
|
|
45
|
+
}
|
|
46
|
+
export interface CoordinationResult {
|
|
47
|
+
steps: StepResult[];
|
|
48
|
+
completedCount: number;
|
|
49
|
+
totalCount: number;
|
|
50
|
+
context: Record<string, unknown>;
|
|
51
|
+
}
|
|
52
|
+
//# sourceMappingURL=bridge.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"bridge.d.ts","sourceRoot":"","sources":["../../src/a2a/bridge.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAC;AACxD,OAAO,EAAoB,KAAK,aAAa,EAAE,MAAM,aAAa,CAAC;AACnE,OAAO,EAAE,cAAc,EAAE,MAAM,cAAc,CAAC;AAE9C,qBAAa,SAAS;IACpB,OAAO,CAAC,SAAS,CAAmB;IACpC,OAAO,CAAC,cAAc,CAAiB;gBAE3B,cAAc,EAAE,cAAc;IAK1C;;;;OAIG;IACG,QAAQ,CAAC,KAAK,EAAE,YAAY,EAAE,IAAI,EAAE,MAAM,EAAE,SAAS,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,aAAa,CAAC;IA6C7F;;;OAGG;IACG,UAAU,CACd,KAAK,EAAE,gBAAgB,EAAE,EACzB,SAAS,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,OAAO,CAAC,YAAY,GAAG,IAAI,CAAC,GACzD,OAAO,CAAC,kBAAkB,CAAC;CAiE/B;AAED,MAAM,WAAW,gBAAgB;IAC/B,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,KAAK,CAAC,EAAE,YAAY,CAAC;IACrB,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAED,MAAM,WAAW,UAAU;IACzB,MAAM,EAAE,MAAM,CAAC;IACf,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,CAAC,EAAE;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,MAAM,EAAE,MAAM,CAAC;QAAC,QAAQ,EAAE,MAAM,CAAA;KAAE,CAAC;IAC3D,OAAO,EAAE,OAAO,CAAC;IACjB,MAAM,CAAC,EAAE,aAAa,CAAC;IACvB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,OAAO,CAAC,EAAE,OAAO,CAAC;CACnB;AAED,MAAM,WAAW,kBAAkB;IACjC,KAAK,EAAE,UAAU,EAAE,CAAC;IACpB,cAAc,EAAE,MAAM,CAAC;IACvB,UAAU,EAAE,MAAM,CAAC;IACnB,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;CAClC"}
|
|
@@ -0,0 +1,123 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Kompass A2A Bridge
|
|
3
|
+
* Translates between A2A tasks and non-A2A protocols (ACP, x402, MCP)
|
|
4
|
+
* Makes every agent A2A-compatible through Kompass
|
|
5
|
+
*/
|
|
6
|
+
import { KompassA2AClient } from "./client.js";
|
|
7
|
+
export class A2ABridge {
|
|
8
|
+
a2aClient;
|
|
9
|
+
protocolBridge;
|
|
10
|
+
constructor(protocolBridge) {
|
|
11
|
+
this.a2aClient = new KompassA2AClient();
|
|
12
|
+
this.protocolBridge = protocolBridge;
|
|
13
|
+
}
|
|
14
|
+
/**
|
|
15
|
+
* Send a task to any agent, regardless of protocol.
|
|
16
|
+
* If A2A-native → direct A2A task
|
|
17
|
+
* If not → bridge through protocol-specific path, wrap result as A2A
|
|
18
|
+
*/
|
|
19
|
+
async sendTask(agent, task, contextId) {
|
|
20
|
+
// Check if agent has an A2A endpoint
|
|
21
|
+
if (agent.protocol === "a2a" && agent.endpoints.a2a) {
|
|
22
|
+
// Direct A2A communication
|
|
23
|
+
return this.a2aClient.sendTask({
|
|
24
|
+
agentUrl: agent.endpoints.a2a,
|
|
25
|
+
message: task,
|
|
26
|
+
contextId,
|
|
27
|
+
});
|
|
28
|
+
}
|
|
29
|
+
// Bridge non-A2A agents
|
|
30
|
+
const bridgeResult = await this.protocolBridge.hire(agent, { task });
|
|
31
|
+
// Wrap the result as an A2A-compatible response
|
|
32
|
+
return {
|
|
33
|
+
taskId: bridgeResult.jobId ?? `kompass-bridge-${Date.now()}`,
|
|
34
|
+
state: bridgeResult.success ? "completed" : "failed",
|
|
35
|
+
artifacts: bridgeResult.deliverable
|
|
36
|
+
? [
|
|
37
|
+
{
|
|
38
|
+
type: "data",
|
|
39
|
+
parts: [
|
|
40
|
+
{
|
|
41
|
+
type: "text",
|
|
42
|
+
text: typeof bridgeResult.deliverable === "string"
|
|
43
|
+
? bridgeResult.deliverable
|
|
44
|
+
: JSON.stringify(bridgeResult.deliverable),
|
|
45
|
+
},
|
|
46
|
+
],
|
|
47
|
+
metadata: {
|
|
48
|
+
bridgedFrom: agent.protocol,
|
|
49
|
+
source: agent.source,
|
|
50
|
+
agentName: agent.name,
|
|
51
|
+
txHash: bridgeResult.txHash,
|
|
52
|
+
},
|
|
53
|
+
},
|
|
54
|
+
]
|
|
55
|
+
: [],
|
|
56
|
+
messages: [],
|
|
57
|
+
error: bridgeResult.error,
|
|
58
|
+
};
|
|
59
|
+
}
|
|
60
|
+
/**
|
|
61
|
+
* Coordinate a multi-step pipeline across protocols.
|
|
62
|
+
* Each step: discover → send task (A2A or bridged) → pass result to next step.
|
|
63
|
+
*/
|
|
64
|
+
async coordinate(steps, findAgent) {
|
|
65
|
+
const results = [];
|
|
66
|
+
const context = new Map();
|
|
67
|
+
for (const step of steps) {
|
|
68
|
+
// Wait for dependencies
|
|
69
|
+
if (step.dependsOn) {
|
|
70
|
+
const depResult = results.find((r) => r.stepId === step.dependsOn);
|
|
71
|
+
if (depResult && !depResult.success) {
|
|
72
|
+
results.push({
|
|
73
|
+
stepId: step.id,
|
|
74
|
+
role: step.role,
|
|
75
|
+
success: false,
|
|
76
|
+
error: `Dependency "${step.dependsOn}" failed`,
|
|
77
|
+
skipped: true,
|
|
78
|
+
});
|
|
79
|
+
continue;
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
// Find agent for this step
|
|
83
|
+
const agent = step.agent ?? (await findAgent(step.query ?? step.role));
|
|
84
|
+
if (!agent) {
|
|
85
|
+
results.push({
|
|
86
|
+
stepId: step.id,
|
|
87
|
+
role: step.role,
|
|
88
|
+
success: false,
|
|
89
|
+
error: `No agent found for role: ${step.role}`,
|
|
90
|
+
skipped: true,
|
|
91
|
+
});
|
|
92
|
+
continue;
|
|
93
|
+
}
|
|
94
|
+
// Build task with context from previous steps
|
|
95
|
+
let taskMessage = step.task ?? step.query ?? step.role;
|
|
96
|
+
if (step.dependsOn && context.has(step.dependsOn)) {
|
|
97
|
+
const prevData = context.get(step.dependsOn);
|
|
98
|
+
taskMessage += `\n\nContext from previous step:\n${JSON.stringify(prevData, null, 2).slice(0, 2000)}`;
|
|
99
|
+
}
|
|
100
|
+
// Send task via A2A (or bridge)
|
|
101
|
+
const taskResult = await this.sendTask(agent, taskMessage);
|
|
102
|
+
const success = taskResult.state === "completed";
|
|
103
|
+
if (success && taskResult.artifacts.length > 0) {
|
|
104
|
+
context.set(step.id, taskResult.artifacts);
|
|
105
|
+
}
|
|
106
|
+
results.push({
|
|
107
|
+
stepId: step.id,
|
|
108
|
+
role: step.role,
|
|
109
|
+
agent: { name: agent.name, source: agent.source, protocol: agent.protocol },
|
|
110
|
+
success,
|
|
111
|
+
result: taskResult,
|
|
112
|
+
error: taskResult.error,
|
|
113
|
+
});
|
|
114
|
+
}
|
|
115
|
+
return {
|
|
116
|
+
steps: results,
|
|
117
|
+
completedCount: results.filter((r) => r.success).length,
|
|
118
|
+
totalCount: steps.length,
|
|
119
|
+
context: Object.fromEntries(context),
|
|
120
|
+
};
|
|
121
|
+
}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AI,EAAE,IAAI,CAAC,IAAI;gBACf,KAAK,EAAE,EAAE,IAAI,EAAE,KAAK,CAAC,IAAI,EAAE,MAAM,EAAE,KAAK,CAAC,MAAM,EAAE,QAAQ,EAAE,KAAK,CAAC,QAAQ,EAAE;gBAC3E,OAAO;gBACP,MAAM,EAAE,UAAU;gBAClB,KAAK,EAAE,UAAU,CAAC,KAAK;aACxB,CAAC,CAAC;QACL,CAAC;QAED,OAAO;YACL,KAAK,EAAE,OAAO;YACd,cAAc,EAAE,OAAO,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,MAAM;YACvD,UAAU,EAAE,KAAK,CAAC,MAAM;YACxB,OAAO,EAAE,MAAM,CAAC,WAAW,CAAC,OAAO,CAAC;SACrC,CAAC;IACJ,CAAC;CACF"}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Kompass A2A Client
|
|
3
|
+
* Sends tasks to A2A-compatible agents
|
|
4
|
+
*/
|
|
5
|
+
export interface A2ATaskOptions {
|
|
6
|
+
/** The A2A agent URL (where agent-card.json is hosted) */
|
|
7
|
+
agentUrl: string;
|
|
8
|
+
/** Task message text */
|
|
9
|
+
message: string;
|
|
10
|
+
/** Optional context from previous tasks */
|
|
11
|
+
contextId?: string;
|
|
12
|
+
/** Timeout in ms */
|
|
13
|
+
timeout?: number;
|
|
14
|
+
}
|
|
15
|
+
export interface A2ATaskResult {
|
|
16
|
+
taskId: string;
|
|
17
|
+
state: string;
|
|
18
|
+
artifacts: unknown[];
|
|
19
|
+
messages: unknown[];
|
|
20
|
+
error?: string;
|
|
21
|
+
}
|
|
22
|
+
export declare class KompassA2AClient {
|
|
23
|
+
private factory;
|
|
24
|
+
constructor();
|
|
25
|
+
/**
|
|
26
|
+
* Send a task to an A2A-compatible agent and wait for completion.
|
|
27
|
+
*/
|
|
28
|
+
sendTask(options: A2ATaskOptions): Promise<A2ATaskResult>;
|
|
29
|
+
/**
|
|
30
|
+
* Send a streaming task to an A2A agent and collect results.
|
|
31
|
+
*/
|
|
32
|
+
sendStreamingTask(options: A2ATaskOptions): Promise<A2ATaskResult>;
|
|
33
|
+
}
|
|
34
|
+
//# sourceMappingURL=client.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"client.d.ts","sourceRoot":"","sources":["../../src/a2a/client.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAKH,MAAM,WAAW,cAAc;IAC7B,0DAA0D;IAC1D,QAAQ,EAAE,MAAM,CAAC;IACjB,wBAAwB;IACxB,OAAO,EAAE,MAAM,CAAC;IAChB,2CAA2C;IAC3C,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,oBAAoB;IACpB,OAAO,CAAC,EAAE,MAAM,CAAC;CAClB;AAED,MAAM,WAAW,aAAa;IAC5B,MAAM,EAAE,MAAM,CAAC;IACf,KAAK,EAAE,MAAM,CAAC;IACd,SAAS,EAAE,OAAO,EAAE,CAAC;IACrB,QAAQ,EAAE,OAAO,EAAE,CAAC;IACpB,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB;AAED,qBAAa,gBAAgB;IAC3B,OAAO,CAAC,OAAO,CAAgB;;IAQ/B;;OAEG;IACG,QAAQ,CAAC,OAAO,EAAE,cAAc,GAAG,OAAO,CAAC,aAAa,CAAC;IA6C/D;;OAEG;IACG,iBAAiB,CAAC,OAAO,EAAE,cAAc,GAAG,OAAO,CAAC,aAAa,CAAC;CAIzE"}
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Kompass A2A Client
|
|
3
|
+
* Sends tasks to A2A-compatible agents
|
|
4
|
+
*/
|
|
5
|
+
import { ClientFactory, JsonRpcTransportFactory, RestTransportFactory } from "@a2a-js/sdk/client";
|
|
6
|
+
export class KompassA2AClient {
|
|
7
|
+
factory;
|
|
8
|
+
constructor() {
|
|
9
|
+
this.factory = new ClientFactory({
|
|
10
|
+
transports: [new JsonRpcTransportFactory(), new RestTransportFactory()],
|
|
11
|
+
});
|
|
12
|
+
}
|
|
13
|
+
/**
|
|
14
|
+
* Send a task to an A2A-compatible agent and wait for completion.
|
|
15
|
+
*/
|
|
16
|
+
async sendTask(options) {
|
|
17
|
+
try {
|
|
18
|
+
const client = await this.factory.createFromUrl(options.agentUrl);
|
|
19
|
+
// Send message and get task
|
|
20
|
+
const response = await client.sendMessage({
|
|
21
|
+
message: {
|
|
22
|
+
role: "user",
|
|
23
|
+
parts: [{ type: "text", text: options.message }],
|
|
24
|
+
},
|
|
25
|
+
configuration: {
|
|
26
|
+
blocking: true, // Wait for completion
|
|
27
|
+
},
|
|
28
|
+
});
|
|
29
|
+
// Extract task info from response
|
|
30
|
+
const task = response?.result;
|
|
31
|
+
if (!task) {
|
|
32
|
+
return {
|
|
33
|
+
taskId: "unknown",
|
|
34
|
+
state: "failed",
|
|
35
|
+
artifacts: [],
|
|
36
|
+
messages: [],
|
|
37
|
+
error: "No task returned from agent",
|
|
38
|
+
};
|
|
39
|
+
}
|
|
40
|
+
return {
|
|
41
|
+
taskId: task.id ?? task.taskId ?? "unknown",
|
|
42
|
+
state: task.status?.state ?? task.state ?? "completed",
|
|
43
|
+
artifacts: task.artifacts ?? [],
|
|
44
|
+
messages: task.history ?? [],
|
|
45
|
+
};
|
|
46
|
+
}
|
|
47
|
+
catch (err) {
|
|
48
|
+
return {
|
|
49
|
+
taskId: "error",
|
|
50
|
+
state: "failed",
|
|
51
|
+
artifacts: [],
|
|
52
|
+
messages: [],
|
|
53
|
+
error: err instanceof Error ? err.message : String(err),
|
|
54
|
+
};
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
/**
|
|
58
|
+
* Send a streaming task to an A2A agent and collect results.
|
|
59
|
+
*/
|
|
60
|
+
async sendStreamingTask(options) {
|
|
61
|
+
// Streaming falls back to blocking send for compatibility
|
|
62
|
+
return this.sendTask(options);
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
//# s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;gBAC3C,KAAK,EAAE,IAAI,CAAC,MAAM,EAAE,KAAK,IAAI,IAAI,CAAC,KAAK,IAAI,WAAW;gBACtD,SAAS,EAAE,IAAI,CAAC,SAAS,IAAI,EAAE;gBAC/B,QAAQ,EAAE,IAAI,CAAC,OAAO,IAAI,EAAE;aAC7B,CAAC;QACJ,CAAC;QAAC,OAAO,GAAG,EAAE,CAAC;YACb,OAAO;gBACL,MAAM,EAAE,OAAO;gBACf,KAAK,EAAE,QAAQ;gBACf,SAAS,EAAE,EAAE;gBACb,QAAQ,EAAE,EAAE;gBACZ,KAAK,EAAE,GAAG,YAAY,KAAK,CAAC,CAAC,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,GAAG,CAAC;aACxD,CAAC;QACJ,CAAC;IACH,CAAC;IAED;;OAEG;IACH,KAAK,CAAC,iBAAiB,CAAC,OAAuB;QAC7C,0DAA0D;QAC1D,OAAO,IAAI,CAAC,QAAQ,CAAC,OAAO,CAAC,CAAC;IAChC,CAAC;CACF"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Kompass A2A Server
|
|
3
|
+
* Exposes Kompass discovery + coordination as an A2A-compatible agent.
|
|
4
|
+
* Any A2A client can send tasks to Kompass to discover or coordinate agents.
|
|
5
|
+
*/
|
|
6
|
+
import { KompassUnified } from "../unified.js";
|
|
7
|
+
export interface KompassA2AServerOptions {
|
|
8
|
+
port?: number;
|
|
9
|
+
hostname?: string;
|
|
10
|
+
kompass?: KompassUnified;
|
|
11
|
+
}
|
|
12
|
+
export declare function startA2AServer(options: KompassA2AServerOptions): Promise<{
|
|
13
|
+
app: import("express-serve-static-core").Express;
|
|
14
|
+
baseUrl: string;
|
|
15
|
+
agentCard: import("@a2a-js/sdk").AgentCard;
|
|
16
|
+
}>;
|
|
17
|
+
//# sourceMappingURL=server.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"server.d.ts","sourceRoot":"","sources":["../../src/a2a/server.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAIH,OAAO,EAAE,cAAc,EAAE,MAAM,eAAe,CAAC;AAK/C,MAAM,WAAW,uBAAuB;IACtC,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,OAAO,CAAC,EAAE,cAAc,CAAC;CAC1B;AAED,wBAAsB,cAAc,CAAC,OAAO,EAAE,uBAAuB;;;;GAwGpE"}
|
|
@@ -0,0 +1,194 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Kompass A2A Server
|
|
3
|
+
* Exposes Kompass discovery + coordination as an A2A-compatible agent.
|
|
4
|
+
* Any A2A client can send tasks to Kompass to discover or coordinate agents.
|
|
5
|
+
*/
|
|
6
|
+
import express from "express";
|
|
7
|
+
import { createKompassAgentCard } from "./agent-card.js";
|
|
8
|
+
import { KompassUnified } from "../unified.js";
|
|
9
|
+
import { A2ABridge } from "./bridge.js";
|
|
10
|
+
import { ProtocolBridge } from "../bridge.js";
|
|
11
|
+
import { AGENT_CARD_PATH } from "@a2a-js/sdk";
|
|
12
|
+
export async function startA2AServer(options) {
|
|
13
|
+
const port = options.port ?? 3000;
|
|
14
|
+
const hostname = options.hostname ?? "localhost";
|
|
15
|
+
const baseUrl = `http://${hostname}:${port}`;
|
|
16
|
+
// Initialize Kompass if not provided
|
|
17
|
+
const kompass = options.kompass ?? (await KompassUnified.create());
|
|
18
|
+
// Create agent card
|
|
19
|
+
const agentCard = createKompassAgentCard({ url: baseUrl });
|
|
20
|
+
// Create A2A bridge
|
|
21
|
+
const protocolBridge = new ProtocolBridge();
|
|
22
|
+
const a2aBridge = new A2ABridge(protocolBridge);
|
|
23
|
+
const app = express();
|
|
24
|
+
app.use(express.json());
|
|
25
|
+
// ── Agent Card (Discovery) ─────────────────────────────
|
|
26
|
+
app.get(AGENT_CARD_PATH, (_req, res) => {
|
|
27
|
+
res.json(agentCard);
|
|
28
|
+
});
|
|
29
|
+
// Also serve at /agent-card.json for convenience
|
|
30
|
+
app.get("/agent-card.json", (_req, res) => {
|
|
31
|
+
res.json(agentCard);
|
|
32
|
+
});
|
|
33
|
+
// ── A2A JSON-RPC Endpoint ──────────────────────────────
|
|
34
|
+
app.post("/", async (req, res) => {
|
|
35
|
+
const { method, params, id } = req.body;
|
|
36
|
+
try {
|
|
37
|
+
let result;
|
|
38
|
+
switch (method) {
|
|
39
|
+
case "message/send":
|
|
40
|
+
case "SendMessage": {
|
|
41
|
+
const message = params?.message;
|
|
42
|
+
const text = extractText(message);
|
|
43
|
+
if (!text) {
|
|
44
|
+
res.json(jsonRpcError(id, -32602, "No text in message"));
|
|
45
|
+
return;
|
|
46
|
+
}
|
|
47
|
+
// Parse intent from message
|
|
48
|
+
result = await handleTask(text, kompass, a2aBridge);
|
|
49
|
+
break;
|
|
50
|
+
}
|
|
51
|
+
case "tasks/get":
|
|
52
|
+
case "GetTask": {
|
|
53
|
+
// For now, return task not found (we're stateless)
|
|
54
|
+
res.json(jsonRpcError(id, -32001, "Task not found — Kompass is stateless"));
|
|
55
|
+
return;
|
|
56
|
+
}
|
|
57
|
+
case "tasks/cancel":
|
|
58
|
+
case "CancelTask": {
|
|
59
|
+
res.json(jsonRpcError(id, -32001, "Task not cancelable"));
|
|
60
|
+
return;
|
|
61
|
+
}
|
|
62
|
+
default:
|
|
63
|
+
res.json(jsonRpcError(id, -32601, `Method not found: ${method}`));
|
|
64
|
+
return;
|
|
65
|
+
}
|
|
66
|
+
res.json({
|
|
67
|
+
jsonrpc: "2.0",
|
|
68
|
+
id,
|
|
69
|
+
result,
|
|
70
|
+
});
|
|
71
|
+
}
|
|
72
|
+
catch (err) {
|
|
73
|
+
res.json(jsonRpcError(id, -32603, err instanceof Error ? err.message : String(err)));
|
|
74
|
+
}
|
|
75
|
+
});
|
|
76
|
+
// ── Health & Info ──────────────────────────────────────
|
|
77
|
+
app.get("/health", async (_req, res) => {
|
|
78
|
+
const sources = await kompass.sources();
|
|
79
|
+
const online = sources.filter((s) => s.healthy).length;
|
|
80
|
+
res.json({
|
|
81
|
+
status: "healthy",
|
|
82
|
+
sources: `${online}/${sources.length} online`,
|
|
83
|
+
protocol: "a2a",
|
|
84
|
+
version: "1.0.0",
|
|
85
|
+
});
|
|
86
|
+
});
|
|
87
|
+
// ── Start ──────────────────────────────────────────────
|
|
88
|
+
app.listen(port, () => {
|
|
89
|
+
console.log(`\n🟢 Kompass A2A Server running at ${baseUrl}`);
|
|
90
|
+
console.log(` Agent Card: ${baseUrl}${AGENT_CARD_PATH}`);
|
|
91
|
+
console.log(` JSON-RPC: POST ${baseUrl}/`);
|
|
92
|
+
console.log(` Health: GET ${baseUrl}/health\n`);
|
|
93
|
+
});
|
|
94
|
+
return { app, baseUrl, agentCard };
|
|
95
|
+
}
|
|
96
|
+
// ── Helpers ──────────────────────────────────────────────
|
|
97
|
+
function extractText(message) {
|
|
98
|
+
if (!message?.parts)
|
|
99
|
+
return null;
|
|
100
|
+
for (const part of message.parts) {
|
|
101
|
+
if (part.type === "text" && part.text)
|
|
102
|
+
return part.text;
|
|
103
|
+
}
|
|
104
|
+
return null;
|
|
105
|
+
}
|
|
106
|
+
async function handleTask(text, kompass, bridge) {
|
|
107
|
+
const lower = text.toLowerCase();
|
|
108
|
+
// Detect intent: discovery, hire, or coordination
|
|
109
|
+
if (lower.startsWith("find ") || lower.startsWith("discover ") || lower.startsWith("search ")) {
|
|
110
|
+
// Discovery task
|
|
111
|
+
const query = text.replace(/^(find|discover|search)\s+/i, "");
|
|
112
|
+
const result = await kompass.find(query, { limit: 10 });
|
|
113
|
+
return {
|
|
114
|
+
id: `kompass-${Date.now()}`,
|
|
115
|
+
status: { state: "completed" },
|
|
116
|
+
artifacts: [
|
|
117
|
+
{
|
|
118
|
+
parts: [
|
|
119
|
+
{
|
|
120
|
+
type: "text",
|
|
121
|
+
text: `Found ${result.agents.length} agents across ${result.sources.length} registries:\n\n` +
|
|
122
|
+
result.agents
|
|
123
|
+
.map((a, i) => `${i + 1}. ${a.name} [${a.protocol.toUpperCase()}] (${a.source})\n ${a.description.slice(0, 100)}`)
|
|
124
|
+
.join("\n\n"),
|
|
125
|
+
},
|
|
126
|
+
{
|
|
127
|
+
type: "data",
|
|
128
|
+
data: {
|
|
129
|
+
agents: result.agents,
|
|
130
|
+
sources: result.sources,
|
|
131
|
+
queryTimeMs: result.queryTimeMs,
|
|
132
|
+
},
|
|
133
|
+
},
|
|
134
|
+
],
|
|
135
|
+
},
|
|
136
|
+
],
|
|
137
|
+
};
|
|
138
|
+
}
|
|
139
|
+
if (lower.startsWith("coordinate ") || lower.startsWith("orchestrate ")) {
|
|
140
|
+
// Coordination task
|
|
141
|
+
const intent = text.replace(/^(coordinate|orchestrate)\s+/i, "");
|
|
142
|
+
const steps = [
|
|
143
|
+
{ id: "research", role: "research", query: `research ${intent}` },
|
|
144
|
+
{ id: "analysis", role: "analysis", query: `analyze ${intent}`, dependsOn: "research" },
|
|
145
|
+
];
|
|
146
|
+
const result = await bridge.coordinate(steps, async (query) => {
|
|
147
|
+
const found = await kompass.find(query, { limit: 3 });
|
|
148
|
+
return found.agents[0] ?? null;
|
|
149
|
+
});
|
|
150
|
+
return {
|
|
151
|
+
id: `kompass-coord-${Date.now()}`,
|
|
152
|
+
status: { state: result.completedCount > 0 ? "completed" : "failed" },
|
|
153
|
+
artifacts: [
|
|
154
|
+
{
|
|
155
|
+
parts: [
|
|
156
|
+
{
|
|
157
|
+
type: "text",
|
|
158
|
+
text: `Coordination complete: ${result.completedCount}/${result.totalCount} steps succeeded.`,
|
|
159
|
+
},
|
|
160
|
+
{ type: "data", data: result },
|
|
161
|
+
],
|
|
162
|
+
},
|
|
163
|
+
],
|
|
164
|
+
};
|
|
165
|
+
}
|
|
166
|
+
// Default: treat as a discovery query
|
|
167
|
+
const result = await kompass.find(text, { limit: 10 });
|
|
168
|
+
return {
|
|
169
|
+
id: `kompass-${Date.now()}`,
|
|
170
|
+
status: { state: "completed" },
|
|
171
|
+
artifacts: [
|
|
172
|
+
{
|
|
173
|
+
parts: [
|
|
174
|
+
{
|
|
175
|
+
type: "text",
|
|
176
|
+
text: `Found ${result.agents.length} agents for "${text}":\n\n` +
|
|
177
|
+
result.agents
|
|
178
|
+
.map((a) => `• ${a.name} [${a.protocol}] — ${a.description.slice(0, 80)}`)
|
|
179
|
+
.join("\n"),
|
|
180
|
+
},
|
|
181
|
+
{ type: "data", data: { agents: result.agents, sources: result.sources } },
|
|
182
|
+
],
|
|
183
|
+
},
|
|
184
|
+
],
|
|
185
|
+
};
|
|
186
|
+
}
|
|
187
|
+
function jsonRpcError(id, code, message) {
|
|
188
|
+
return {
|
|
189
|
+
jsonrpc: "2.0",
|
|
190
|
+
id,
|
|
191
|
+
error: { code, message },
|
|
192
|
+
};
|
|
193
|
+
}
|
|
194
|
+
//# sourceMappingURL=server.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"server.js","sourceRoot":"","sources":["../../src/a2a/server.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,OAAO,MAAM,SAAS,CAAC;AAC9B,OAAO,EAAE,sBAAsB,EAAE,MAAM,iBAAiB,CAAC;AACzD,OAAO,EAAE,cAAc,EAAE,MAAM,eAAe,CAAC;AAC/C,OAAO,EAAE,SAAS,EAAyB,MAAM,aAAa,CAAC;AAC/D,OAAO,EAAE,cAAc,EAAE,MAAM,cAAc,CAAC;AAC9C,OAAO,EAAE,eAAe,EAAE,MAAM,aAAa,CAAC;AAQ9C,MAAM,CAAC,KAAK,UAAU,cAAc,CAAC,OAAgC;IACnE,MAAM,IAAI,GAAG,OAAO,CAAC,IAAI,IAAI,IAAI,CAAC;IAClC,MAAM,QAAQ,GAAG,OAAO,CAAC,QAAQ,IAAI,WAAW,CAAC;IACjD,MAAM,OAAO,GAAG,UAAU,QAAQ,IAAI,IAAI,EAAE,CAAC;IAE7C,qCAAqC;IACrC,MAAM,OAAO,GAAG,OAAO,CAAC,OAAO,IAAI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