@hanphone/dsh-a2a 0.2.0 → 0.3.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.
Files changed (78) hide show
  1. package/README.md +101 -106
  2. package/README.zh.md +50 -74
  3. package/cordis.patch.yml +4 -7
  4. package/lib/client.js +217 -73
  5. package/lib/index.js +1258 -867
  6. package/lib/types/api.d.ts +40 -23
  7. package/lib/types/api.d.ts.map +1 -1
  8. package/lib/types/api.js +58 -23
  9. package/lib/types/api.js.map +1 -1
  10. package/lib/types/client/index.d.ts +50 -19
  11. package/lib/types/client/index.d.ts.map +1 -1
  12. package/lib/types/commands.d.ts +4 -2
  13. package/lib/types/commands.d.ts.map +1 -1
  14. package/lib/types/commands.js +59 -46
  15. package/lib/types/commands.js.map +1 -1
  16. package/lib/types/events.d.ts +32 -9
  17. package/lib/types/events.d.ts.map +1 -1
  18. package/lib/types/index.d.ts +21 -32
  19. package/lib/types/index.d.ts.map +1 -1
  20. package/lib/types/index.js +173 -272
  21. package/lib/types/index.js.map +1 -1
  22. package/lib/types/outbound/calls.d.ts.map +1 -1
  23. package/lib/types/outbound/calls.js +8 -6
  24. package/lib/types/outbound/calls.js.map +1 -1
  25. package/lib/types/protocol.d.ts +174 -109
  26. package/lib/types/protocol.d.ts.map +1 -1
  27. package/lib/types/protocol.js +58 -34
  28. package/lib/types/protocol.js.map +1 -1
  29. package/lib/types/server/a2a-server.d.ts +4 -0
  30. package/lib/types/server/a2a-server.d.ts.map +1 -1
  31. package/lib/types/server/a2a-server.js +6 -2
  32. package/lib/types/server/a2a-server.js.map +1 -1
  33. package/lib/types/server/card.d.ts +6 -30
  34. package/lib/types/server/card.d.ts.map +1 -1
  35. package/lib/types/server/card.js +13 -49
  36. package/lib/types/server/card.js.map +1 -1
  37. package/lib/types/server/exec/agent-runtime.d.ts +3 -0
  38. package/lib/types/server/exec/agent-runtime.d.ts.map +1 -1
  39. package/lib/types/server/exec/agent-runtime.js +2 -1
  40. package/lib/types/server/exec/agent-runtime.js.map +1 -1
  41. package/lib/types/server/routes.d.ts +5 -1
  42. package/lib/types/server/routes.d.ts.map +1 -1
  43. package/lib/types/server/routes.js +9 -5
  44. package/lib/types/server/routes.js.map +1 -1
  45. package/lib/types/server/store.d.ts +35 -1
  46. package/lib/types/server/store.d.ts.map +1 -1
  47. package/lib/types/server/store.js +10 -0
  48. package/lib/types/server/store.js.map +1 -1
  49. package/lib/types/servers/inbound-manager.d.ts +131 -0
  50. package/lib/types/servers/inbound-manager.d.ts.map +1 -0
  51. package/lib/types/servers/inbound-manager.js +312 -0
  52. package/lib/types/servers/inbound-manager.js.map +1 -0
  53. package/lib/types/servers/outbound-manager.d.ts +129 -0
  54. package/lib/types/servers/outbound-manager.d.ts.map +1 -0
  55. package/lib/types/servers/outbound-manager.js +238 -0
  56. package/lib/types/servers/outbound-manager.js.map +1 -0
  57. package/lib/types/service.d.ts +106 -40
  58. package/lib/types/service.d.ts.map +1 -1
  59. package/lib/types/service.js +36 -27
  60. package/lib/types/service.js.map +1 -1
  61. package/package.json +2 -2
  62. package/src/api.ts +67 -53
  63. package/src/client/index.ts +309 -148
  64. package/src/commands.ts +59 -43
  65. package/src/events.ts +14 -7
  66. package/src/index.ts +199 -310
  67. package/src/outbound/calls.ts +8 -6
  68. package/src/protocol.ts +204 -95
  69. package/src/server/a2a-server.ts +9 -2
  70. package/src/server/card.ts +13 -62
  71. package/src/server/exec/agent-runtime.ts +5 -2
  72. package/src/server/routes.ts +6 -4
  73. package/src/server/store.ts +45 -4
  74. package/src/servers/inbound-manager.ts +385 -0
  75. package/src/servers/outbound-manager.ts +289 -0
  76. package/src/service.ts +125 -40
  77. package/lib/tsconfig.client.tsbuildinfo +0 -1
  78. package/lib/tsconfig.tsbuildinfo +0 -1
@@ -1,7 +1,7 @@
1
1
  /**
2
- * The `ctx.a2a` service facade: the thin read/control surface commands and
3
- * other plugins use. Registered as a Cordis Service so the key disappears
4
- * with the plugin fiber.
2
+ * The `ctx.a2a` service facade: the thin read/control surface commands, the
3
+ * GUI API, and other plugins use. Registered as a Cordis Service so the key
4
+ * disappears with the plugin fiber.
5
5
  * @module dsh-a2a/service
6
6
  */
7
7
  import { Service } from '@deepseek-ai/cordis';
@@ -15,44 +15,53 @@ export class A2AService extends Service {
15
15
  status() {
16
16
  return this.impl.status();
17
17
  }
18
- async enableServer(enable) {
19
- return this.impl.enableServer(enable);
18
+ async presets() {
19
+ return this.impl.presets();
20
20
  }
21
- getTask(taskId) {
22
- return this.impl.getTask(taskId);
21
+ listInboundServers() {
22
+ return this.impl.listInboundServers();
23
23
  }
24
- listTasks() {
25
- return this.impl.listTasks();
24
+ async createInboundServer(input) {
25
+ return this.impl.createInboundServer(input);
26
26
  }
27
- async cancelTask(taskId) {
28
- return this.impl.cancelTask(taskId);
27
+ async removeInboundServer(id) {
28
+ return this.impl.removeInboundServer(id);
29
29
  }
30
- agents() {
31
- return this.impl.agents();
30
+ async setInboundServerEnabled(id, enabled) {
31
+ return this.impl.setInboundServerEnabled(id, enabled);
32
32
  }
33
- async addAgent(spec) {
34
- return this.impl.addAgent(spec);
33
+ async updateInboundServer(id, patch) {
34
+ return this.impl.updateInboundServer(id, patch);
35
35
  }
36
- async removeAgent(id) {
37
- return this.impl.removeAgent(id);
36
+ listOutboundServers() {
37
+ return this.impl.listOutboundServers();
38
38
  }
39
- async setAgentEnabled(id, enabled) {
40
- return this.impl.setAgentEnabled(id, enabled);
39
+ async createOutboundServer(input) {
40
+ return this.impl.createOutboundServer(input);
41
41
  }
42
- async refreshAgentCard(id) {
43
- return this.impl.refreshAgentCard(id);
42
+ async removeOutboundServer(id) {
43
+ return this.impl.removeOutboundServer(id);
44
44
  }
45
- identity() {
46
- return this.impl.identity();
45
+ async setOutboundServerEnabled(id, enabled) {
46
+ return this.impl.setOutboundServerEnabled(id, enabled);
47
47
  }
48
- async updateIdentity(patch) {
49
- return this.impl.updateIdentity(patch);
48
+ async refreshOutboundServer(id) {
49
+ return this.impl.refreshOutboundServer(id);
50
50
  }
51
- async closeInbound(peerId) {
52
- return this.impl.closeInbound(peerId);
51
+ getTask(taskId) {
52
+ return this.impl.getTask(taskId);
53
+ }
54
+ listTasks() {
55
+ return this.impl.listTasks();
56
+ }
57
+ async cancelTask(taskId) {
58
+ return this.impl.cancelTask(taskId);
53
59
  }
54
60
  inbounds() {
55
61
  return this.impl.inbounds();
56
62
  }
63
+ async closeInbound(peerId) {
64
+ return this.impl.closeInbound(peerId);
65
+ }
57
66
  }
58
67
  //# sourceMappingURL=service.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"service.js","sourceRoot":"","sources":["../../src/service.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EAAE,OAAO,EAAgB,MAAM,qBAAqB,CAAA;AA6B3D,mDAAmD;AACnD,MAAM,OAAO,UAAW,SAAQ,OAAO;IAGlB;IAFnB,YACE,GAAY,EACK,IAAoB;QAErC,KAAK,CAAC,GAAG,EAAE,KAAK,CAAC,CAAA;QAFA,SAAI,GAAJ,IAAI,CAAgB;IAGvC,CAAC;IAED,MAAM;QACJ,OAAO,IAAI,CAAC,IAAI,CAAC,MAAM,EAAE,CAAA;IAC3B,CAAC;IAED,KAAK,CAAC,YAAY,CAAC,MAAe;QAChC,OAAO,IAAI,CAAC,IAAI,CAAC,YAAY,CAAC,MAAM,CAAC,CAAA;IACvC,CAAC;IAED,OAAO,CAAC,MAAc;QACpB,OAAO,IAAI,CAAC,IAAI,CAAC,OAAO,CAAC,MAAM,CAAC,CAAA;IAClC,CAAC;IAED,SAAS;QACP,OAAO,IAAI,CAAC,IAAI,CAAC,SAAS,EAAE,CAAA;IAC9B,CAAC;IAED,KAAK,CAAC,UAAU,CAAC,MAAc;QAC7B,OAAO,IAAI,CAAC,IAAI,CAAC,UAAU,CAAC,MAAM,CAAC,CAAA;IACrC,CAAC;IAED,MAAM;QACJ,OAAO,IAAI,CAAC,IAAI,CAAC,MAAM,EAAE,CAAA;IAC3B,CAAC;IA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,CAAC,EAAU;QACpC,OAAO,IAAI,CAAC,IAAI,CAAC,qBAAqB,CAAC,EAAE,CAAC,CAAA;IAC5C,CAAC;IAED,OAAO,CAAC,MAAc;QACpB,OAAO,IAAI,CAAC,IAAI,CAAC,OAAO,CAAC,MAAM,CAAC,CAAA;IAClC,CAAC;IAED,SAAS;QACP,OAAO,IAAI,CAAC,IAAI,CAAC,SAAS,EAAE,CAAA;IAC9B,CAAC;IAED,KAAK,CAAC,UAAU,CAAC,MAAc;QAC7B,OAAO,IAAI,CAAC,IAAI,CAAC,UAAU,CAAC,MAAM,CAAC,CAAA;IACrC,CAAC;IAED,QAAQ;QACN,OAAO,IAAI,CAAC,IAAI,CAAC,QAAQ,EAAE,CAAA;IAC7B,CAAC;IAED,KAAK,CAAC,YAAY,CAAC,MAAc;QAC/B,OAAO,IAAI,CAAC,IAAI,CAAC,YAAY,CAAC,MAAM,CAAC,CAAA;IACvC,CAAC;CACF"}
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@hanphone/dsh-a2a",
3
- "version": "0.2.0",
4
- "description": "Agent2Agent (A2A) v1.0 dual-end plugin for DeepSeek Harness: governed inbound tasks, durable task store, pluggable executors, multi-agent outbound consumption, GUI management dashboard.",
3
+ "version": "0.3.0",
4
+ "description": "Agent2Agent (A2A) v1.0.1 dual-end plugin for DeepSeek Harness: multiple inbound servers (per-instance agent presets, creator-declared skill advertisements), multiple outbound connections, GUI-managed instance lifecycle.",
5
5
  "type": "module",
6
6
  "license": "MIT",
7
7
  "keywords": [
package/src/api.ts CHANGED
@@ -1,9 +1,10 @@
1
1
  /**
2
2
  * GUI control API for the A2A settings dashboard: one `GET /a2a/api`
3
- * snapshot plus `POST /a2a/api` control actions (server toggle, outbound
4
- * agent management, task view). The browser half talks only to this route;
5
- * it carries no protocol knowledge. Loopback-only by default so the
6
- * dashboard cannot be driven from the wire.
3
+ * snapshot plus `POST /a2a/api` control actions (inbound/outbound server
4
+ * CRUD + enable/disable, task view/cancel) and `GET /a2a/api/presets` for the
5
+ * preset roster the pickers need. The browser half talks only to this route;
6
+ * it carries no protocol knowledge. Loopback-only by default so the dashboard
7
+ * cannot be driven from the wire.
7
8
  *
8
9
  * The route body is bound to the same `A2AServiceImpl` facade the `/a2a`
9
10
  * command surface uses, so GUI actions and commands cannot disagree.
@@ -15,27 +16,19 @@ import type { A2AServiceImpl } from './service.ts'
15
16
 
16
17
  /** Control actions the dashboard can issue. */
17
18
  export type ApiAction =
18
- | { readonly action: 'server.enable' | 'server.disable' }
19
- | { readonly action: 'agent.add'; readonly name: string; readonly agentCardUrl: string; readonly bearerTokenEnv?: string }
20
- | { readonly action: 'agent.remove' | 'agent.enable' | 'agent.disable' | 'agent.refresh'; readonly id: string }
19
+ | { readonly action: 'inbound.create'; readonly name: string; readonly description: string; readonly version: string; readonly endpointPath?: string; readonly preset?: string; readonly authTokenEnv?: string; readonly skills?: readonly { id: string; name: string; description?: string }[]; readonly enabled?: boolean }
20
+ | { readonly action: 'inbound.remove' | 'inbound.enable' | 'inbound.disable' | 'inbound.update'; readonly id: string; readonly name?: string; readonly description?: string; readonly version?: string; readonly endpointPath?: string; readonly preset?: string; readonly authTokenEnv?: string; readonly skills?: readonly { id: string; name: string; description?: string }[] }
21
+ | { readonly action: 'outbound.create'; readonly name: string; readonly agentCardUrl: string; readonly bearerTokenEnv?: string; readonly preset?: string; readonly enabled?: boolean; readonly timeoutMs?: number }
22
+ | { readonly action: 'outbound.remove' | 'outbound.enable' | 'outbound.disable' | 'outbound.refresh'; readonly id: string }
21
23
  | { readonly action: 'task.cancel'; readonly id: string }
22
- | { readonly action: 'identity.update'; readonly name?: string; readonly description?: string; readonly version?: string }
23
24
  | { readonly action: 'inbound.close'; readonly id: string }
24
25
 
25
26
  /** One snapshot of the whole plugin for the dashboard. */
26
27
  export interface ApiSnapshot {
27
- readonly server: {
28
- readonly enabled: boolean
29
- readonly cardUrl?: string
30
- readonly skills: readonly string[]
31
- readonly name?: string
32
- readonly description?: string
33
- readonly version?: string
34
- readonly configured: boolean
35
- }
36
- readonly tasks: readonly unknown[]
37
- readonly agents: readonly unknown[]
38
28
  readonly inbounds: readonly unknown[]
29
+ readonly outbounds: readonly unknown[]
30
+ readonly tasks: readonly unknown[]
31
+ readonly peers: readonly unknown[]
39
32
  }
40
33
 
41
34
  function readBody(req: IncomingMessage): Promise<string> {
@@ -69,6 +62,11 @@ export async function handleApiRequest(
69
62
  res.end('forbidden')
70
63
  return
71
64
  }
65
+ const path = (req.url ?? '').split('?')[0] ?? ''
66
+ if (req.method === 'GET' && path === '/a2a/api/presets') {
67
+ json(res, 200, await impl.presets())
68
+ return
69
+ }
72
70
  if (req.method === 'GET') {
73
71
  json(res, 200, snapshotOf(impl))
74
72
  return
@@ -90,51 +88,67 @@ export async function handleApiRequest(
90
88
  }
91
89
 
92
90
  function snapshotOf(impl: A2AServiceImpl): ApiSnapshot {
93
- const status = impl.status() as {
94
- server: {
95
- enabled: boolean
96
- cardUrl?: string
97
- skills: readonly string[]
98
- name?: string
99
- description?: string
100
- version?: string
101
- configured: boolean
102
- }
103
- tasks: number
104
- agents: readonly unknown[]
105
- inbounds: readonly unknown[]
106
- }
91
+ const status = impl.status() as { inbounds: readonly unknown[]; outbounds: readonly unknown[]; tasks: number; peers?: readonly unknown[] }
107
92
  return {
108
- server: status.server,
109
- tasks: impl.listTasks() as readonly unknown[],
110
- agents: impl.agents() as readonly unknown[],
111
93
  inbounds: status.inbounds ?? [],
94
+ outbounds: status.outbounds ?? [],
95
+ tasks: impl.listTasks() as readonly unknown[],
96
+ // `status()` may already carry aggregated peers; fall back to the facade.
97
+ peers: (status.peers ?? impl.inbounds()) as readonly unknown[],
112
98
  }
113
99
  }
114
100
 
115
101
  async function dispatch(payload: ApiAction, impl: A2AServiceImpl): Promise<{ readonly ok: boolean; readonly message: string }> {
116
102
  switch (payload.action) {
117
- case 'server.enable':
118
- return impl.enableServer(true)
119
- case 'server.disable':
120
- return impl.enableServer(false)
121
- case 'agent.add':
122
- return impl.addAgent({ name: payload.name, agentCardUrl: payload.agentCardUrl, ...(payload.bearerTokenEnv ? { bearerTokenEnv: payload.bearerTokenEnv } : {}) })
123
- case 'agent.remove':
124
- return impl.removeAgent(payload.id)
125
- case 'agent.enable':
126
- return impl.setAgentEnabled(payload.id, true)
127
- case 'agent.disable':
128
- return impl.setAgentEnabled(payload.id, false)
129
- case 'agent.refresh':
130
- return impl.refreshAgentCard(payload.id)
103
+ case 'inbound.create':
104
+ return impl.createInboundServer({
105
+ name: payload.name,
106
+ description: payload.description,
107
+ version: payload.version,
108
+ ...(payload.endpointPath !== undefined ? { endpointPath: payload.endpointPath } : {}),
109
+ ...(payload.preset !== undefined ? { preset: payload.preset } : {}),
110
+ ...(payload.authTokenEnv !== undefined ? { authTokenEnv: payload.authTokenEnv } : {}),
111
+ ...(payload.skills !== undefined ? { skills: payload.skills } : {}),
112
+ ...(payload.enabled !== undefined ? { enabled: payload.enabled } : {}),
113
+ })
114
+ case 'inbound.remove':
115
+ return impl.removeInboundServer(payload.id)
116
+ case 'inbound.enable':
117
+ return impl.setInboundServerEnabled(payload.id, true)
118
+ case 'inbound.disable':
119
+ return impl.setInboundServerEnabled(payload.id, false)
120
+ case 'inbound.update':
121
+ return impl.updateInboundServer(payload.id, {
122
+ ...(payload.name !== undefined ? { name: payload.name } : {}),
123
+ ...(payload.description !== undefined ? { description: payload.description } : {}),
124
+ ...(payload.version !== undefined ? { version: payload.version } : {}),
125
+ ...(payload.endpointPath !== undefined ? { endpointPath: payload.endpointPath } : {}),
126
+ ...(payload.preset !== undefined ? { preset: payload.preset } : {}),
127
+ ...(payload.authTokenEnv !== undefined ? { authTokenEnv: payload.authTokenEnv } : {}),
128
+ ...(payload.skills !== undefined ? { skills: payload.skills } : {}),
129
+ })
130
+ case 'outbound.create':
131
+ return impl.createOutboundServer({
132
+ name: payload.name,
133
+ agentCardUrl: payload.agentCardUrl,
134
+ ...(payload.bearerTokenEnv !== undefined ? { bearerTokenEnv: payload.bearerTokenEnv } : {}),
135
+ ...(payload.preset !== undefined ? { preset: payload.preset } : {}),
136
+ ...(payload.enabled !== undefined ? { enabled: payload.enabled } : {}),
137
+ ...(payload.timeoutMs !== undefined ? { timeoutMs: payload.timeoutMs } : {}),
138
+ })
139
+ case 'outbound.remove':
140
+ return impl.removeOutboundServer(payload.id)
141
+ case 'outbound.enable':
142
+ return impl.setOutboundServerEnabled(payload.id, true)
143
+ case 'outbound.disable':
144
+ return impl.setOutboundServerEnabled(payload.id, false)
145
+ case 'outbound.refresh':
146
+ return impl.refreshOutboundServer(payload.id)
131
147
  case 'task.cancel':
132
148
  return impl.cancelTask(payload.id)
133
- case 'identity.update':
134
- return impl.updateIdentity({ ...(payload.name !== undefined ? { name: payload.name } : {}), ...(payload.description !== undefined ? { description: payload.description } : {}), ...(payload.version !== undefined ? { version: payload.version } : {}) })
135
149
  case 'inbound.close':
136
150
  return impl.closeInbound(payload.id)
137
151
  default:
138
152
  return { ok: false, message: `unknown action ${String((payload as { action?: unknown }).action)}` }
139
153
  }
140
- }
154
+ }