@hanphone/dsh-a2a 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/LICENSE +21 -0
- package/README.md +196 -0
- package/README.zh.md +195 -0
- package/cordis.patch.yml +11 -0
- package/lib/client.js +166 -0
- package/lib/index.js +2073 -0
- package/lib/tsconfig.client.tsbuildinfo +1 -0
- package/lib/tsconfig.tsbuildinfo +1 -0
- package/lib/types/api.d.ts +41 -0
- package/lib/types/api.d.ts.map +1 -0
- package/lib/types/api.js +86 -0
- package/lib/types/api.js.map +1 -0
- package/lib/types/client/index.d.ts +35 -0
- package/lib/types/client/index.d.ts.map +1 -0
- package/lib/types/client/index.js +155 -0
- package/lib/types/client/index.js.map +1 -0
- package/lib/types/commands.d.ts +10 -0
- package/lib/types/commands.d.ts.map +1 -0
- package/lib/types/commands.js +93 -0
- package/lib/types/commands.js.map +1 -0
- package/lib/types/events.d.ts +74 -0
- package/lib/types/events.d.ts.map +1 -0
- package/lib/types/events.js +10 -0
- package/lib/types/events.js.map +1 -0
- package/lib/types/index.d.ts +54 -0
- package/lib/types/index.d.ts.map +1 -0
- package/lib/types/index.js +296 -0
- package/lib/types/index.js.map +1 -0
- package/lib/types/jsonrpc.d.ts +20 -0
- package/lib/types/jsonrpc.d.ts.map +1 -0
- package/lib/types/jsonrpc.js +48 -0
- package/lib/types/jsonrpc.js.map +1 -0
- package/lib/types/outbound/calls.d.ts +37 -0
- package/lib/types/outbound/calls.d.ts.map +1 -0
- package/lib/types/outbound/calls.js +120 -0
- package/lib/types/outbound/calls.js.map +1 -0
- package/lib/types/outbound/registry.d.ts +102 -0
- package/lib/types/outbound/registry.d.ts.map +1 -0
- package/lib/types/outbound/registry.js +249 -0
- package/lib/types/outbound/registry.js.map +1 -0
- package/lib/types/outbound/tools.d.ts +30 -0
- package/lib/types/outbound/tools.d.ts.map +1 -0
- package/lib/types/outbound/tools.js +86 -0
- package/lib/types/outbound/tools.js.map +1 -0
- package/lib/types/protocol.d.ts +194 -0
- package/lib/types/protocol.d.ts.map +1 -0
- package/lib/types/protocol.js +78 -0
- package/lib/types/protocol.js.map +1 -0
- package/lib/types/server/a2a-server.d.ts +98 -0
- package/lib/types/server/a2a-server.d.ts.map +1 -0
- package/lib/types/server/a2a-server.js +397 -0
- package/lib/types/server/a2a-server.js.map +1 -0
- package/lib/types/server/card.d.ts +48 -0
- package/lib/types/server/card.d.ts.map +1 -0
- package/lib/types/server/card.js +75 -0
- package/lib/types/server/card.js.map +1 -0
- package/lib/types/server/exec/agent-runtime.d.ts +126 -0
- package/lib/types/server/exec/agent-runtime.d.ts.map +1 -0
- package/lib/types/server/exec/agent-runtime.js +138 -0
- package/lib/types/server/exec/agent-runtime.js.map +1 -0
- package/lib/types/server/exec/session.d.ts +11 -0
- package/lib/types/server/exec/session.d.ts.map +1 -0
- package/lib/types/server/exec/session.js +22 -0
- package/lib/types/server/exec/session.js.map +1 -0
- package/lib/types/server/exec/subagent.d.ts +39 -0
- package/lib/types/server/exec/subagent.d.ts.map +1 -0
- package/lib/types/server/exec/subagent.js +44 -0
- package/lib/types/server/exec/subagent.js.map +1 -0
- package/lib/types/server/executor.d.ts +63 -0
- package/lib/types/server/executor.d.ts.map +1 -0
- package/lib/types/server/executor.js +38 -0
- package/lib/types/server/executor.js.map +1 -0
- package/lib/types/server/routes.d.ts +32 -0
- package/lib/types/server/routes.d.ts.map +1 -0
- package/lib/types/server/routes.js +131 -0
- package/lib/types/server/routes.js.map +1 -0
- package/lib/types/server/store.d.ts +157 -0
- package/lib/types/server/store.d.ts.map +1 -0
- package/lib/types/server/store.js +239 -0
- package/lib/types/server/store.js.map +1 -0
- package/lib/types/service.d.ts +49 -0
- package/lib/types/service.d.ts.map +1 -0
- package/lib/types/service.js +46 -0
- package/lib/types/service.js.map +1 -0
- package/package.json +82 -0
- package/src/api.ts +115 -0
- package/src/client/index.ts +293 -0
- package/src/commands.ts +92 -0
- package/src/events.ts +58 -0
- package/src/index.ts +353 -0
- package/src/jsonrpc.ts +61 -0
- package/src/outbound/calls.ts +145 -0
- package/src/outbound/registry.ts +290 -0
- package/src/outbound/tools.ts +118 -0
- package/src/protocol.ts +212 -0
- package/src/server/a2a-server.ts +455 -0
- package/src/server/card.ts +106 -0
- package/src/server/exec/agent-runtime.ts +197 -0
- package/src/server/exec/session.ts +25 -0
- package/src/server/exec/subagent.ts +67 -0
- package/src/server/executor.ts +73 -0
- package/src/server/routes.ts +156 -0
- package/src/server/store.ts +320 -0
- package/src/service.ts +78 -0
|
@@ -0,0 +1,296 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @hanphone/dsh-a2a — Cordis plugin entry.
|
|
3
|
+
*
|
|
4
|
+
* Mounts the A2A v1.0 dual-end plugin: the inbound server (AgentCard derived
|
|
5
|
+
* from the live tool registry, JSON-RPC + SSE, durable SQLite task store,
|
|
6
|
+
* session/subagent executors, the `a2a/inbound-task` policy gate + audit)
|
|
7
|
+
* and the outbound client (persisted multi-agent registry, skills mapped to
|
|
8
|
+
* model tools, sync calls with per-agent timeout). Optional services are
|
|
9
|
+
* probed rather than injected so a composition lacking one half idles just
|
|
10
|
+
* that half; only the storage domain is required.
|
|
11
|
+
*
|
|
12
|
+
* Function-plugin export shape: named `name`/`inject`/`Config`/`apply`, no
|
|
13
|
+
* default export (mixing forms makes the Loader drop the namespace).
|
|
14
|
+
* @module dsh-a2a
|
|
15
|
+
*/
|
|
16
|
+
import z from '@deepseek-ai/schemastery';
|
|
17
|
+
import { homedir } from 'node:os';
|
|
18
|
+
import { join } from 'node:path';
|
|
19
|
+
import { mkdirSync } from 'node:fs';
|
|
20
|
+
import { deriveSkills, buildCard } from "./server/card.js";
|
|
21
|
+
import { openDomain, DomainTaskStore } from "./server/store.js";
|
|
22
|
+
import { ExecutorSet } from "./server/executor.js";
|
|
23
|
+
import { ContextSessionPool, probeService } from "./server/exec/agent-runtime.js";
|
|
24
|
+
import { createSessionExecutor } from "./server/exec/session.js";
|
|
25
|
+
import { createSubagentExecutor } from "./server/exec/subagent.js";
|
|
26
|
+
import { A2AServer } from "./server/a2a-server.js";
|
|
27
|
+
import { A2aRoutes } from "./server/routes.js";
|
|
28
|
+
import { handleApiRequest } from "./api.js";
|
|
29
|
+
import { OutboundAgentRegistry, DomainAgentStore } from "./outbound/registry.js";
|
|
30
|
+
import { A2AService } from "./service.js";
|
|
31
|
+
import { buildA2aCommand } from "./commands.js";
|
|
32
|
+
export const name = 'a2a';
|
|
33
|
+
/** Only the storage domain is required; the other halves are probed. */
|
|
34
|
+
export const inject = ['storageDomain'];
|
|
35
|
+
/** Loader-validated config schema (defaults applied by the Loader). */
|
|
36
|
+
export const Config = z.object({
|
|
37
|
+
server: z.object({
|
|
38
|
+
enabled: z.boolean().default(true),
|
|
39
|
+
name: z.string().default('My DSH Agent'),
|
|
40
|
+
description: z.string().default('A DeepSeek Harness agent exposed over A2A v1.0'),
|
|
41
|
+
version: z.string().default('0.1.0'),
|
|
42
|
+
baseUrl: z.string(),
|
|
43
|
+
endpointPath: z.string().default('/a2a'),
|
|
44
|
+
authTokenEnv: z.string(),
|
|
45
|
+
skills: z.object({
|
|
46
|
+
ids: z.array(z.string()).default([]),
|
|
47
|
+
exclude: z.array(z.string()).default([]),
|
|
48
|
+
}),
|
|
49
|
+
executors: z.dict(z.union(['session', 'subagent'])).default({ chat: 'session' }),
|
|
50
|
+
subagentProvider: z.string().default('in-process'),
|
|
51
|
+
}),
|
|
52
|
+
client: z.object({
|
|
53
|
+
agents: z.array(z.object({
|
|
54
|
+
name: z.string(),
|
|
55
|
+
agentCardUrl: z.string(),
|
|
56
|
+
bearerTokenEnv: z.string(),
|
|
57
|
+
enabled: z.boolean().default(true),
|
|
58
|
+
timeoutMs: z.number().default(60000),
|
|
59
|
+
})).default([]),
|
|
60
|
+
toolPrefix: z.string().default('a2a'),
|
|
61
|
+
}),
|
|
62
|
+
});
|
|
63
|
+
export function apply(ctx, config) {
|
|
64
|
+
const logger = ctx.logger('a2a');
|
|
65
|
+
const serverConfig = { ...config.server };
|
|
66
|
+
const clientConfig = { ...config.client };
|
|
67
|
+
const authToken = serverConfig.authTokenEnv !== undefined ? process.env[serverConfig.authTokenEnv] : undefined;
|
|
68
|
+
const toolPrefix = clientConfig.toolPrefix;
|
|
69
|
+
const subagentProvider = serverConfig.subagentProvider;
|
|
70
|
+
const inboundCwd = inboundSessionCwd();
|
|
71
|
+
ctx.inject(['storageDomain'], (ctx) => {
|
|
72
|
+
ctx.effect(async () => {
|
|
73
|
+
const domain = await openDomain(ctx.storageDomain);
|
|
74
|
+
const store = new DomainTaskStore(domain);
|
|
75
|
+
const holder = {
|
|
76
|
+
domain,
|
|
77
|
+
store,
|
|
78
|
+
registry: undefined,
|
|
79
|
+
server: undefined,
|
|
80
|
+
routes: undefined,
|
|
81
|
+
card: undefined,
|
|
82
|
+
executors: undefined,
|
|
83
|
+
enabled: serverConfig.enabled,
|
|
84
|
+
};
|
|
85
|
+
// ── inbound server half ────────────────────────────────────────────
|
|
86
|
+
const webServer = probeService(ctx, 'webServer', 'register');
|
|
87
|
+
if (webServer === undefined) {
|
|
88
|
+
logger.warn('a2a: webServer not mounted; inbound server idle');
|
|
89
|
+
}
|
|
90
|
+
else {
|
|
91
|
+
try {
|
|
92
|
+
const skills = deriveSkills(probeService(ctx, 'tools', 'get') ?? { get: () => undefined }, { ids: serverConfig.skills.ids, exclude: serverConfig.skills.exclude });
|
|
93
|
+
const baseUrl = serverConfig.baseUrl ?? `http://127.0.0.1:${process.env['DSH_A2A_PORT'] ?? '3000'}`;
|
|
94
|
+
const endpointPath = serverConfig.endpointPath ?? '/a2a';
|
|
95
|
+
const card = buildCard({
|
|
96
|
+
baseUrl,
|
|
97
|
+
endpointPath,
|
|
98
|
+
name: serverConfig.name ?? 'My DSH Agent',
|
|
99
|
+
description: serverConfig.description ?? 'A DeepSeek Harness agent exposed over A2A v1.0',
|
|
100
|
+
version: serverConfig.version ?? '0.1.0',
|
|
101
|
+
skills,
|
|
102
|
+
...(authToken ? { authToken } : {}),
|
|
103
|
+
});
|
|
104
|
+
holder.card = card;
|
|
105
|
+
// Executors: probe the agent loop; refuse tasks readably without it.
|
|
106
|
+
const agents = probeService(ctx, 'agents', 'create');
|
|
107
|
+
const presets = probeService(ctx, 'agentPresets', 'resolve');
|
|
108
|
+
const sessionPool = agents
|
|
109
|
+
? new ContextSessionPool(agents, {
|
|
110
|
+
cwd: inboundCwd,
|
|
111
|
+
...(presets ? { agentPresets: presets } : {}),
|
|
112
|
+
resolveAgentOptions: () => resolveDefaultModel(ctx),
|
|
113
|
+
})
|
|
114
|
+
: undefined;
|
|
115
|
+
const sessionExecutor = sessionPool ? createSessionExecutor(sessionPool) : refuseExecutor('no agent loop mounted');
|
|
116
|
+
const subagents = probeService(ctx, 'subagents', 'start');
|
|
117
|
+
const subagentExecutor = sessionPool !== undefined && subagents !== undefined
|
|
118
|
+
? createSubagentExecutor({ pool: sessionPool, subagents, provider: subagentProvider })
|
|
119
|
+
: undefined;
|
|
120
|
+
const executors = new ExecutorSet(serverConfig.executors, sessionExecutor, subagentExecutor);
|
|
121
|
+
holder.executors = executors;
|
|
122
|
+
const skillIds = new Set(skills.map((s) => s.id));
|
|
123
|
+
const gate = async (input) => {
|
|
124
|
+
if (!skillIds.has(input.skill)) {
|
|
125
|
+
return { ok: false, reason: `unknown skill "${input.skill}"` };
|
|
126
|
+
}
|
|
127
|
+
const decision = {
|
|
128
|
+
contextId: input.contextId,
|
|
129
|
+
skill: input.skill,
|
|
130
|
+
parts: input.parts,
|
|
131
|
+
remotePeerId: input.remotePeerId,
|
|
132
|
+
};
|
|
133
|
+
const decided = await ctx.waterfall('a2a/inbound-task', decision, async (d) => d);
|
|
134
|
+
// Built-in audit: every task decision is logged with its source.
|
|
135
|
+
logger.info(`[a2a] inbound skill=${decided.skill} remote=${decided.remotePeerId} rejected=${decided.rejected?.reason ?? 'no'}`);
|
|
136
|
+
if (decided.rejected !== undefined)
|
|
137
|
+
return { ok: false, reason: decided.rejected.reason };
|
|
138
|
+
return { ok: true };
|
|
139
|
+
};
|
|
140
|
+
const server = new A2AServer({
|
|
141
|
+
card,
|
|
142
|
+
store,
|
|
143
|
+
executors,
|
|
144
|
+
...(authToken ? { authToken } : {}),
|
|
145
|
+
gate,
|
|
146
|
+
onTaskSettled: (taskId) => logger.info(`[a2a] task settled ${taskId}`),
|
|
147
|
+
});
|
|
148
|
+
holder.server = server;
|
|
149
|
+
const routes = new A2aRoutes(webServer, server);
|
|
150
|
+
holder.routes = routes;
|
|
151
|
+
if (holder.enabled)
|
|
152
|
+
routes.enable();
|
|
153
|
+
}
|
|
154
|
+
catch (err) {
|
|
155
|
+
logger.error(`a2a: server half failed to build: ${err.message}`);
|
|
156
|
+
}
|
|
157
|
+
}
|
|
158
|
+
// ── outbound client half (after the inbound routes exist, so a
|
|
159
|
+
// loopback agent can fetch this server's own card) ──────────────────
|
|
160
|
+
const toolsService = probeService(ctx, 'tools', 'get');
|
|
161
|
+
if (toolsService === undefined) {
|
|
162
|
+
logger.warn('a2a: tools service not mounted; outbound client idle');
|
|
163
|
+
}
|
|
164
|
+
else {
|
|
165
|
+
const registry = new OutboundAgentRegistry({
|
|
166
|
+
registrar: { register: (def) => toolsService.register(def) },
|
|
167
|
+
store: new DomainAgentStore(domain.agents),
|
|
168
|
+
toolPrefix,
|
|
169
|
+
tokenOf: (env) => (env ? process.env[env] : undefined),
|
|
170
|
+
onError: (message) => logger.warn(message),
|
|
171
|
+
});
|
|
172
|
+
holder.registry = registry;
|
|
173
|
+
registry.loadAll();
|
|
174
|
+
// Declared agents seed the registry: the persisted store stays the
|
|
175
|
+
// runtime state, so a disabled or removed agent is not reconnected.
|
|
176
|
+
if (clientConfig.agents.length > 0)
|
|
177
|
+
await registry.seed(clientConfig.agents);
|
|
178
|
+
}
|
|
179
|
+
// ── service facade + commands ──────────────────────────────────────
|
|
180
|
+
const impl = makeFacade(holder, logger.info.bind(logger));
|
|
181
|
+
new A2AService(ctx, impl);
|
|
182
|
+
const commands = probeService(ctx, 'commands', 'register');
|
|
183
|
+
if (commands !== undefined) {
|
|
184
|
+
ctx.effect(() => commands.register(buildA2aCommand(impl)), 'a2a: command');
|
|
185
|
+
}
|
|
186
|
+
// ── GUI dashboard API (loopback-only /a2a/api) ─────────────────────
|
|
187
|
+
const dashboardWebServer = probeService(ctx, 'webServer', 'register');
|
|
188
|
+
if (dashboardWebServer !== undefined) {
|
|
189
|
+
ctx.effect(() => dashboardWebServer.register({
|
|
190
|
+
kind: 'prefix',
|
|
191
|
+
path: '/a2a/api',
|
|
192
|
+
handler: (req, res) => handleApiRequest(req, res, impl),
|
|
193
|
+
}), 'a2a: dashboard api');
|
|
194
|
+
}
|
|
195
|
+
else {
|
|
196
|
+
logger.warn('a2a: webServer not mounted; GUI dashboard API idle');
|
|
197
|
+
}
|
|
198
|
+
return async () => {
|
|
199
|
+
holder.routes?.dispose();
|
|
200
|
+
await holder.executors?.disposeAll();
|
|
201
|
+
await holder.registry?.disposeAll();
|
|
202
|
+
await domain.close();
|
|
203
|
+
};
|
|
204
|
+
}, 'a2a: domain + halves');
|
|
205
|
+
});
|
|
206
|
+
}
|
|
207
|
+
/** Facade closure over the shared holder (commands and `ctx.a2a` consumers). */
|
|
208
|
+
function makeFacade(holder, log) {
|
|
209
|
+
const serverEnabled = () => holder.routes?.active ?? false;
|
|
210
|
+
return {
|
|
211
|
+
status() {
|
|
212
|
+
return {
|
|
213
|
+
server: {
|
|
214
|
+
enabled: serverEnabled(),
|
|
215
|
+
cardUrl: holder.card?.supportedInterfaces?.[0]?.url,
|
|
216
|
+
skills: holder.card?.skills?.map((s) => s.id) ?? [],
|
|
217
|
+
executors: holder.executors ? ['session', ...(holder.executors['subagent'] !== undefined ? ['subagent'] : [])] : [],
|
|
218
|
+
},
|
|
219
|
+
tasks: holder.store.list().length,
|
|
220
|
+
agents: holder.registry?.list() ?? [],
|
|
221
|
+
};
|
|
222
|
+
},
|
|
223
|
+
async enableServer(enable) {
|
|
224
|
+
if (holder.routes === undefined)
|
|
225
|
+
return { ok: false, message: 'inbound server is not mounted (no webServer)' };
|
|
226
|
+
if (enable)
|
|
227
|
+
holder.routes.enable();
|
|
228
|
+
else
|
|
229
|
+
holder.routes.disable();
|
|
230
|
+
log(`[a2a] server ${enable ? 'enabled' : 'disabled'}`);
|
|
231
|
+
return { ok: true, message: `server ${enable ? 'enabled' : 'disabled'}` };
|
|
232
|
+
},
|
|
233
|
+
getTask(taskId) {
|
|
234
|
+
return holder.store.get(taskId);
|
|
235
|
+
},
|
|
236
|
+
listTasks() {
|
|
237
|
+
return holder.store.list();
|
|
238
|
+
},
|
|
239
|
+
async cancelTask(taskId) {
|
|
240
|
+
const record = holder.store.get(taskId);
|
|
241
|
+
if (record === undefined)
|
|
242
|
+
return { ok: false, message: `task ${taskId} not found` };
|
|
243
|
+
const aborted = holder.server?.abort?.(taskId) ?? false;
|
|
244
|
+
return { ok: true, message: aborted ? `task ${taskId} canceled` : `task ${taskId} already terminal` };
|
|
245
|
+
},
|
|
246
|
+
agents() {
|
|
247
|
+
return holder.registry?.list() ?? [];
|
|
248
|
+
},
|
|
249
|
+
async addAgent(spec) {
|
|
250
|
+
const registry = holder.registry;
|
|
251
|
+
if (registry === undefined)
|
|
252
|
+
return { ok: false, message: 'outbound client not mounted (no tools service)' };
|
|
253
|
+
const result = await registry.add({ ...spec, enabled: true, timeoutMs: 60000 });
|
|
254
|
+
return result;
|
|
255
|
+
},
|
|
256
|
+
async removeAgent(id) {
|
|
257
|
+
return holder.registry?.remove(id) ?? { ok: false, message: 'outbound client not mounted' };
|
|
258
|
+
},
|
|
259
|
+
async setAgentEnabled(id, enabled) {
|
|
260
|
+
return holder.registry?.setEnabled(id, enabled) ?? { ok: false, message: 'outbound client not mounted' };
|
|
261
|
+
},
|
|
262
|
+
async refreshAgentCard(id) {
|
|
263
|
+
return holder.registry?.refresh(id) ?? { ok: false, message: 'outbound client not mounted' };
|
|
264
|
+
},
|
|
265
|
+
};
|
|
266
|
+
}
|
|
267
|
+
/** A task that refuses readably on compositions without an agent loop. */
|
|
268
|
+
function refuseExecutor(reason) {
|
|
269
|
+
return {
|
|
270
|
+
name: 'refuse',
|
|
271
|
+
async execute() {
|
|
272
|
+
throw new Error(`a2a: ${reason}; refusing inbound task`);
|
|
273
|
+
},
|
|
274
|
+
};
|
|
275
|
+
}
|
|
276
|
+
function resolveDefaultModel(ctx) {
|
|
277
|
+
const service = probeService(ctx, 'agentDefaultModel', 'currentSelection');
|
|
278
|
+
return service?.currentSelection();
|
|
279
|
+
}
|
|
280
|
+
/** Absolute stable cwd for inbound per-context sessions (never profile root). */
|
|
281
|
+
function inboundSessionCwd() {
|
|
282
|
+
const home = join(homedir(), '.dsh');
|
|
283
|
+
const dshHome = process.env['DSH_HOME'] ?? home;
|
|
284
|
+
const dir = join(dshHome, 'a2a-sessions');
|
|
285
|
+
try {
|
|
286
|
+
mkdirSync(dir, { recursive: true });
|
|
287
|
+
}
|
|
288
|
+
catch {
|
|
289
|
+
// cwd fallback below stays valid
|
|
290
|
+
}
|
|
291
|
+
return dir;
|
|
292
|
+
}
|
|
293
|
+
export { A2AServer } from "./server/a2a-server.js";
|
|
294
|
+
export { A2AClient, A2AError } from "./outbound/calls.js";
|
|
295
|
+
export { A2AService } from "./service.js";
|
|
296
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAGH,OAAO,CAAC,MAAM,0BAA0B,CAAA;AACxC,OAAO,EAAE,OAAO,EAAE,MAAM,SAAS,CAAA;AACjC,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAA;AAChC,OAAO,EAAE,SAAS,EAAE,MAAM,SAAS,CAAA;AACnC,OAAO,EAAE,YAAY,EAAE,SAAS,EAAmB,MAAM,kBAAkB,CAAA;AAC3E,OAAO,EAAE,UAAU,EAAE,eAAe,EAAkC,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RPC 2.0 helpers and SSE framing for the A2A binding. Transport-agnostic:
|
|
3
|
+
* the A2AServer consumes these, and the HTTP route layer only maps requests to
|
|
4
|
+
* `handle` / `handleStream` and bytes back.
|
|
5
|
+
* @module dsh-a2a/jsonrpc
|
|
6
|
+
*/
|
|
7
|
+
import { type JsonRpcError, type JsonRpcRequest, type JsonRpcSuccess } from './protocol.ts';
|
|
8
|
+
/** Parse a request body into a JSON-RPC request, or undefined on malformed input. */
|
|
9
|
+
export declare function parseRpc(body: string): JsonRpcRequest | undefined;
|
|
10
|
+
/** Build a JSON-RPC error response object. */
|
|
11
|
+
export declare function rpcError(id: string | number | null | undefined, code: number, message: string, data?: unknown): JsonRpcError;
|
|
12
|
+
/** Build a JSON-RPC success response object. */
|
|
13
|
+
export declare function rpcSuccess(id: string | number | null | undefined, result: unknown): JsonRpcSuccess;
|
|
14
|
+
/** Invalid-method error for the SSE path (no request id on the wire). */
|
|
15
|
+
export declare function methodNotFound(method: string): JsonRpcError;
|
|
16
|
+
/** One data frame of an SSE stream. */
|
|
17
|
+
export declare function sseData(payload: unknown): string;
|
|
18
|
+
/** One named event frame of an SSE stream (e.g. `event: error`). */
|
|
19
|
+
export declare function sseEvent(name: string, payload: unknown): string;
|
|
20
|
+
//# sourceMappingURL=jsonrpc.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"jsonrpc.d.ts","sourceRoot":"","sources":["../../src/jsonrpc.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EAEL,KAAK,YAAY,EACjB,KAAK,cAAc,EACnB,KAAK,cAAc,EACpB,MAAM,eAAe,CAAA;AAEtB,qFAAqF;AACrF,wBAAgB,QAAQ,CAAC,IAAI,EAAE,MAAM,GAAG,cAAc,GAAG,SAAS,CAWjE;AAED,8CAA8C;AAC9C,wBAAgB,QAAQ,CACtB,EAAE,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI,GAAG,SAAS,EACtC,IAAI,EAAE,MAAM,EACZ,OAAO,EAAE,MAAM,EACf,IAAI,CAAC,EAAE,OAAO,GACb,YAAY,CAMd;AAED,gDAAgD;AAChD,wBAAgB,UAAU,CAAC,EAAE,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI,GAAG,SAAS,EAAE,MAAM,EAAE,OAAO,GAAG,cAAc,CAElG;AAED,yEAAyE;AACzE,wBAAgB,cAAc,CAAC,MAAM,EAAE,MAAM,GAAG,YAAY,CAE3D;AAED,uCAAuC;AACvC,wBAAgB,OAAO,CAAC,OAAO,EAAE,OAAO,GAAG,MAAM,CAEhD;AAED,oEAAoE;AACpE,wBAAgB,QAAQ,CAAC,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,OAAO,GAAG,MAAM,CAE/D"}
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* JSON-RPC 2.0 helpers and SSE framing for the A2A binding. Transport-agnostic:
|
|
3
|
+
* the A2AServer consumes these, and the HTTP route layer only maps requests to
|
|
4
|
+
* `handle` / `handleStream` and bytes back.
|
|
5
|
+
* @module dsh-a2a/jsonrpc
|
|
6
|
+
*/
|
|
7
|
+
import { A2A_ERROR_CODES, } from "./protocol.js";
|
|
8
|
+
/** Parse a request body into a JSON-RPC request, or undefined on malformed input. */
|
|
9
|
+
export function parseRpc(body) {
|
|
10
|
+
let value;
|
|
11
|
+
try {
|
|
12
|
+
value = JSON.parse(body);
|
|
13
|
+
}
|
|
14
|
+
catch {
|
|
15
|
+
return undefined;
|
|
16
|
+
}
|
|
17
|
+
if (typeof value !== 'object' || value === null)
|
|
18
|
+
return undefined;
|
|
19
|
+
const rpc = value;
|
|
20
|
+
if (rpc.jsonrpc !== '2.0' || typeof rpc.method !== 'string')
|
|
21
|
+
return undefined;
|
|
22
|
+
return rpc;
|
|
23
|
+
}
|
|
24
|
+
/** Build a JSON-RPC error response object. */
|
|
25
|
+
export function rpcError(id, code, message, data) {
|
|
26
|
+
return {
|
|
27
|
+
jsonrpc: '2.0',
|
|
28
|
+
id: id ?? null,
|
|
29
|
+
error: { code, message, ...(data === undefined ? {} : { data }) },
|
|
30
|
+
};
|
|
31
|
+
}
|
|
32
|
+
/** Build a JSON-RPC success response object. */
|
|
33
|
+
export function rpcSuccess(id, result) {
|
|
34
|
+
return { jsonrpc: '2.0', id: id ?? null, result };
|
|
35
|
+
}
|
|
36
|
+
/** Invalid-method error for the SSE path (no request id on the wire). */
|
|
37
|
+
export function methodNotFound(method) {
|
|
38
|
+
return rpcError(null, A2A_ERROR_CODES.METHOD_NOT_FOUND, `Unknown method ${method}`);
|
|
39
|
+
}
|
|
40
|
+
/** One data frame of an SSE stream. */
|
|
41
|
+
export function sseData(payload) {
|
|
42
|
+
return `data: ${JSON.stringify(payload)}\n\n`;
|
|
43
|
+
}
|
|
44
|
+
/** One named event frame of an SSE stream (e.g. `event: error`). */
|
|
45
|
+
export function sseEvent(name, payload) {
|
|
46
|
+
return `event: ${name}\ndata: ${JSON.stringify(payload)}\n\n`;
|
|
47
|
+
}
|
|
48
|
+
//# sourceMappingURL=jsonrpc.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"jsonrpc.js","sourceRoot":"","sources":["../../src/jsonrpc.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EACL,eAAe,GAIhB,MAAM,eAAe,CAAA;AAEtB,qFAAqF;AACrF,MAAM,UAAU,QAAQ,CAAC,IAAY;IACnC,IAAI,KAAc,CAAA;IAClB,IAAI,CAAC;QACH,KAAK,GAAG,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,CAAA;IAC1B,CAAC;IAAC,MAAM,CAAC;QACP,OAAO,SAAS,CAAA;IAClB,CAAC;IACD,IAAI,OAAO,KAAK,KAAK,QAAQ,IAAI,KAAK,KAAK,IAAI;QAAE,OAAO,SAAS,CAAA;IACjE,MAAM,GAAG,GAAG,KAAgC,CAAA;IAC5C,IAAI,GAAG,CAAC,OAAO,KAAK,KAAK,IAAI,OAAO,GAAG,CAAC,MAAM,KAAK,QAAQ;QAAE,OAAO,SAAS,CAAA;IAC7E,OAAO,GAAqB,CAAA;AAC9B,CAAC;AAED,8CAA8C;AAC9C,MAAM,UAAU,QAAQ,CACtB,EAAsC,EACtC,IAAY,EACZ,OAAe,EACf,IAAc;IAEd,OAAO;QACL,OAAO,EAAE,KAAK;QACd,EAAE,EAAE,EAAE,IAAI,IAAI;QACd,KAAK,EAAE,EAAE,IAAI,EAAE,OAAO,EAAE,GAAG,CAAC,IAAI,KAAK,SAAS,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,EAAE,IAAI,EAAE,CAAC,EAAE;KAClE,CAAA;AACH,CAAC;AAED,gDAAgD;AAChD,MAAM,UAAU,UAAU,CAAC,EAAsC,EAAE,MAAe;IAChF,OAAO,EAAE,OAAO,EAAE,KAAK,EAAE,EAAE,EAAE,EAAE,IAAI,IAAI,EAAE,MAAM,EAAE,CAAA;AACnD,CAAC;AAED,yEAAyE;AACzE,MAAM,UAAU,cAAc,CAAC,MAAc;IAC3C,OAAO,QAAQ,CAAC,IAAI,EAAE,eAAe,CAAC,gBAAgB,EAAE,kBAAkB,MAAM,EAAE,CAAC,CAAA;AACrF,CAAC;AAED,uCAAuC;AACvC,MAAM,UAAU,OAAO,CAAC,OAAgB;IACtC,OAAO,SAAS,IAAI,CAAC,SAAS,CAAC,OAAO,CAAC,MAAM,CAAA;AAC/C,CAAC;AAED,oEAAoE;AACpE,MAAM,UAAU,QAAQ,CAAC,IAAY,EAAE,OAAgB;IACrD,OAAO,UAAU,IAAI,WAAW,IAAI,CAAC,SAAS,CAAC,OAAO,CAAC,MAAM,CAAA;AAC/D,CAAC"}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Outbound A2A client: AgentCard discovery plus the JSON-RPC methods the
|
|
3
|
+
* tools layer needs. Sync-by-polling for P0 (each tool call waits for the
|
|
4
|
+
* task to settle up to a timeout); passive result injection replaces this in
|
|
5
|
+
* P1 without changing the transport.
|
|
6
|
+
* @module dsh-a2a/client/calls
|
|
7
|
+
*/
|
|
8
|
+
import { type AgentCard, type Message, type Task } from '../protocol.ts';
|
|
9
|
+
/** Error carrying the remote JSON-RPC error code. */
|
|
10
|
+
export declare class A2AError extends Error {
|
|
11
|
+
readonly code: number;
|
|
12
|
+
constructor(code: number, message: string);
|
|
13
|
+
}
|
|
14
|
+
export interface ClientOptions {
|
|
15
|
+
readonly bearerToken?: string;
|
|
16
|
+
/** Per-call timeout in ms. Default 60000. */
|
|
17
|
+
readonly timeoutMs?: number;
|
|
18
|
+
readonly fetchImpl?: typeof fetch;
|
|
19
|
+
}
|
|
20
|
+
/** A connected remote A2A agent (one AgentCard endpoint). */
|
|
21
|
+
export declare class A2AClient {
|
|
22
|
+
private readonly opts;
|
|
23
|
+
readonly card: AgentCard;
|
|
24
|
+
private readonly endpoint;
|
|
25
|
+
private constructor();
|
|
26
|
+
/** Fetch and validate an AgentCard, then connect to its JSON-RPC endpoint. */
|
|
27
|
+
static connect(agentCardUrl: string, opts?: ClientOptions): Promise<A2AClient>;
|
|
28
|
+
/** Send a message and wait (or poll) until the task settles. */
|
|
29
|
+
sendMessage(message: Message): Promise<Task>;
|
|
30
|
+
getTask(taskId: string): Promise<Task>;
|
|
31
|
+
listTasks(): Promise<Task[]>;
|
|
32
|
+
cancelTask(taskId: string): Promise<Task>;
|
|
33
|
+
/** Poll a task until terminal or the overall timeout elapses. */
|
|
34
|
+
private pollTask;
|
|
35
|
+
private call;
|
|
36
|
+
}
|
|
37
|
+
//# sourceMappingURL=calls.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"calls.d.ts","sourceRoot":"","sources":["../../../src/outbound/calls.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,EAIL,KAAK,SAAS,EAEd,KAAK,OAAO,EACZ,KAAK,IAAI,EACV,MAAM,gBAAgB,CAAA;AAEvB,qDAAqD;AACrD,qBAAa,QAAS,SAAQ,KAAK;IAE/B,QAAQ,CAAC,IAAI,EAAE,MAAM;gBAAZ,IAAI,EAAE,MAAM,EACrB,OAAO,EAAE,MAAM;CAKlB;AAED,MAAM,WAAW,aAAa;IAC5B,QAAQ,CAAC,WAAW,CAAC,EAAE,MAAM,CAAA;IAC7B,6CAA6C;IAC7C,QAAQ,CAAC,SAAS,CAAC,EAAE,MAAM,CAAA;IAC3B,QAAQ,CAAC,SAAS,CAAC,EAAE,OAAO,KAAK,CAAA;CAClC;AAED,6DAA6D;AAC7D,qBAAa,SAAS;IAOlB,OAAO,CAAC,QAAQ,CAAC,IAAI;IANvB,QAAQ,CAAC,IAAI,EAAE,SAAS,CAAA;IACxB,OAAO,CAAC,QAAQ,CAAC,QAAQ,CAAQ;IAEjC,OAAO;IASP,8EAA8E;WACjE,OAAO,CAAC,YAAY,EAAE,MAAM,EAAE,IAAI,GAAE,aAAkB,GAAG,OAAO,CAAC,SAAS,CAAC;IA0BxF,gEAAgE;IAC1D,WAAW,CAAC,OAAO,EAAE,OAAO,GAAG,OAAO,CAAC,IAAI,CAAC;IAM5C,OAAO,CAAC,MAAM,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;IAItC,SAAS,IAAI,OAAO,CAAC,IAAI,EAAE,CAAC;IAI5B,UAAU,CAAC,MAAM,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;IAI/C,iEAAiE;YACnD,QAAQ;YAaR,IAAI;CAkCnB"}
|
|
@@ -0,0 +1,120 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Outbound A2A client: AgentCard discovery plus the JSON-RPC methods the
|
|
3
|
+
* tools layer needs. Sync-by-polling for P0 (each tool call waits for the
|
|
4
|
+
* task to settle up to a timeout); passive result injection replaces this in
|
|
5
|
+
* P1 without changing the transport.
|
|
6
|
+
* @module dsh-a2a/client/calls
|
|
7
|
+
*/
|
|
8
|
+
import { A2A_ERROR_CODES, A2A_METHODS, isTerminal, } from "../protocol.js";
|
|
9
|
+
/** Error carrying the remote JSON-RPC error code. */
|
|
10
|
+
export class A2AError extends Error {
|
|
11
|
+
code;
|
|
12
|
+
constructor(code, message) {
|
|
13
|
+
super(message);
|
|
14
|
+
this.code = code;
|
|
15
|
+
this.name = 'A2AError';
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
/** A connected remote A2A agent (one AgentCard endpoint). */
|
|
19
|
+
export class A2AClient {
|
|
20
|
+
opts;
|
|
21
|
+
card;
|
|
22
|
+
endpoint;
|
|
23
|
+
constructor(card, endpoint, opts) {
|
|
24
|
+
this.opts = opts;
|
|
25
|
+
this.card = card;
|
|
26
|
+
this.endpoint = endpoint;
|
|
27
|
+
}
|
|
28
|
+
/** Fetch and validate an AgentCard, then connect to its JSON-RPC endpoint. */
|
|
29
|
+
static async connect(agentCardUrl, opts = {}) {
|
|
30
|
+
const timeoutMs = opts.timeoutMs ?? 60_000;
|
|
31
|
+
const fetchImpl = opts.fetchImpl ?? fetch;
|
|
32
|
+
const response = await fetchImpl(agentCardUrl, {
|
|
33
|
+
headers: {
|
|
34
|
+
accept: 'application/json',
|
|
35
|
+
...(opts.bearerToken ? { authorization: `Bearer ${opts.bearerToken}` } : {}),
|
|
36
|
+
},
|
|
37
|
+
signal: AbortSignal.timeout(timeoutMs),
|
|
38
|
+
});
|
|
39
|
+
if (!response.ok) {
|
|
40
|
+
throw new A2AError(A2A_ERROR_CODES.AGENT_CARD_NOT_FOUND, `agent card fetch failed: HTTP ${response.status}`);
|
|
41
|
+
}
|
|
42
|
+
const card = (await response.json());
|
|
43
|
+
if (typeof card.name !== 'string' || typeof card.description !== 'string') {
|
|
44
|
+
throw new A2AError(A2A_ERROR_CODES.AGENT_CARD_SIGNATURE_INVALID, `invalid agent card at ${agentCardUrl}`);
|
|
45
|
+
}
|
|
46
|
+
const iface = card.supportedInterfaces?.find((i) => (i.protocolBinding ?? 'JSONRPC') === 'JSONRPC')
|
|
47
|
+
?? card.supportedInterfaces?.[0];
|
|
48
|
+
const endpoint = iface?.url ?? card.url;
|
|
49
|
+
if (!endpoint) {
|
|
50
|
+
throw new A2AError(A2A_ERROR_CODES.AGENT_CARD_NOT_FOUND, `agent card at ${agentCardUrl} advertises no JSON-RPC interface`);
|
|
51
|
+
}
|
|
52
|
+
return new A2AClient(card, endpoint, opts);
|
|
53
|
+
}
|
|
54
|
+
/** Send a message and wait (or poll) until the task settles. */
|
|
55
|
+
async sendMessage(message) {
|
|
56
|
+
const task = await this.call(A2A_METHODS.sendMessage, { message });
|
|
57
|
+
if (isTerminal(task.status.state))
|
|
58
|
+
return task;
|
|
59
|
+
return this.pollTask(task.id);
|
|
60
|
+
}
|
|
61
|
+
async getTask(taskId) {
|
|
62
|
+
return this.call(A2A_METHODS.getTask, { id: taskId });
|
|
63
|
+
}
|
|
64
|
+
async listTasks() {
|
|
65
|
+
return this.call(A2A_METHODS.listTasks, {});
|
|
66
|
+
}
|
|
67
|
+
async cancelTask(taskId) {
|
|
68
|
+
return this.call(A2A_METHODS.cancelTask, { id: taskId });
|
|
69
|
+
}
|
|
70
|
+
/** Poll a task until terminal or the overall timeout elapses. */
|
|
71
|
+
async pollTask(taskId) {
|
|
72
|
+
const budget = this.opts.timeoutMs ?? 60_000;
|
|
73
|
+
const deadline = Date.now() + budget;
|
|
74
|
+
for (;;) {
|
|
75
|
+
const task = await this.getTask(taskId);
|
|
76
|
+
if (isTerminal(task.status.state))
|
|
77
|
+
return task;
|
|
78
|
+
if (Date.now() >= deadline) {
|
|
79
|
+
throw new A2AError(-32000, `task ${taskId} did not settle within ${budget}ms`);
|
|
80
|
+
}
|
|
81
|
+
await new Promise((resolve) => setTimeout(resolve, 250));
|
|
82
|
+
}
|
|
83
|
+
}
|
|
84
|
+
async call(method, params) {
|
|
85
|
+
const timeoutMs = this.opts.timeoutMs ?? 60_000;
|
|
86
|
+
const fetchImpl = this.opts.fetchImpl ?? fetch;
|
|
87
|
+
let response;
|
|
88
|
+
try {
|
|
89
|
+
response = await fetchImpl(this.endpoint, {
|
|
90
|
+
method: 'POST',
|
|
91
|
+
headers: {
|
|
92
|
+
'content-type': 'application/json',
|
|
93
|
+
accept: 'application/json',
|
|
94
|
+
...(this.opts.bearerToken ? { authorization: `Bearer ${this.opts.bearerToken}` } : {}),
|
|
95
|
+
},
|
|
96
|
+
body: JSON.stringify({ jsonrpc: '2.0', id: crypto.randomUUID(), method, params }),
|
|
97
|
+
signal: AbortSignal.timeout(timeoutMs),
|
|
98
|
+
});
|
|
99
|
+
}
|
|
100
|
+
catch (err) {
|
|
101
|
+
if (err instanceof Error && err.name === 'TimeoutError') {
|
|
102
|
+
throw new A2AError(-32000, `A2A call ${method} timed out after ${timeoutMs}ms`);
|
|
103
|
+
}
|
|
104
|
+
throw err;
|
|
105
|
+
}
|
|
106
|
+
if (response.status === 401) {
|
|
107
|
+
throw new A2AError(A2A_ERROR_CODES.UNAUTHORIZED, 'remote agent rejected credentials (401)');
|
|
108
|
+
}
|
|
109
|
+
if (!response.ok) {
|
|
110
|
+
throw new A2AError(A2A_ERROR_CODES.INTERNAL_ERROR, `A2A call ${method} failed: HTTP ${response.status}`);
|
|
111
|
+
}
|
|
112
|
+
const payload = (await response.json());
|
|
113
|
+
if ('error' in payload) {
|
|
114
|
+
const error = payload.error;
|
|
115
|
+
throw new A2AError(error.code, error.message);
|
|
116
|
+
}
|
|
117
|
+
return payload.result;
|
|
118
|
+
}
|
|
119
|
+
}
|
|
120
|
+
//# sourceMappingURL=calls.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"calls.js","sourceRoot":"","sources":["../../../src/outbound/calls.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,EACL,eAAe,EACf,WAAW,EACX,UAAU,GAKX,MAAM,gBAAgB,CAAA;AAEvB,qDAAqD;AACrD,MAAM,OAAO,QAAS,SAAQ,KAAK;IAEtB;IADX,YACW,IAAY,EACrB,OAAe;QAEf,KAAK,CAAC,OAAO,CAAC,CAAA;Q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