@nelsonlongxiang/dsh-open-a2a-net 0.5.15 → 0.6.25
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/README.md +243 -121
- package/README_zh.md +144 -84
- package/assets/nexusDist/assets/index-034h1cNc.js +3 -0
- package/assets/nexusDist/assets/index-PG9EieGX.css +1 -0
- package/assets/nexusDist/index.html +26 -0
- package/assets/stageDist/assets/index-Bj7S2pA1.css +1 -0
- package/assets/stageDist/assets/index-C-28k_o5.js +974 -0
- package/assets/stageDist/assets/interiors-CQGBjffT.png +0 -0
- package/assets/stageDist/assets/office-tileset-CHQT-uYL.png +0 -0
- package/assets/stageDist/index.html +13 -0
- package/lib/a2a-client.js +190 -13
- package/lib/canvas-store.js +218 -0
- package/lib/card.js +25 -0
- package/lib/client/A2aControl.js +45 -137
- package/lib/client/locales.js +16 -40
- package/lib/client.js +164 -467
- package/lib/client.js.map +1 -1
- package/lib/exposure-store.js +82 -0
- package/lib/group-store.js +6 -0
- package/lib/idempotency-store.js +291 -0
- package/lib/index.js +4446 -271
- package/lib/joined-store.js +11 -0
- package/lib/layout-store.js +155 -0
- package/lib/peer-store.js +98 -13
- package/lib/receipt-ladder.js +35 -0
- package/lib/receipt.js +102 -0
- package/lib/self-suppress.js +62 -0
- package/lib/session-transcript.js +150 -0
- package/lib/skill/SKILL.md +77 -0
- package/lib/skill/references/discovery.md +38 -0
- package/lib/skill/references/membership.md +50 -0
- package/lib/skill/references/pitfalls.md +42 -0
- package/lib/skill/references/routing.md +43 -0
- package/lib/skill-registration.js +52 -0
- package/lib/stage-mount.js +32 -0
- package/lib/task-ledger.js +540 -0
- package/lib/team-store.js +122 -0
- package/lib/teams-bridge.js +18 -0
- package/lib/transport-caps.js +31 -0
- package/lib/types/a2a-client.d.ts +72 -1
- package/lib/types/canvas-store.d.ts +102 -0
- package/lib/types/client/A2aControl.d.ts +18 -28
- package/lib/types/client/locales.d.ts +1 -1
- package/lib/types/exposure-store.d.ts +45 -0
- package/lib/types/group-store.d.ts +6 -0
- package/lib/types/idempotency-store.d.ts +164 -0
- package/lib/types/index.d.ts +211 -11
- package/lib/types/joined-store.d.ts +9 -0
- package/lib/types/layout-store.d.ts +63 -0
- package/lib/types/peer-store.d.ts +45 -2
- package/lib/types/receipt-ladder.d.ts +25 -0
- package/lib/types/receipt.d.ts +51 -0
- package/lib/types/self-suppress.d.ts +41 -0
- package/lib/types/session-transcript.d.ts +37 -0
- package/lib/types/skill-registration.d.ts +3 -0
- package/lib/types/stage-mount.d.ts +29 -0
- package/lib/types/task-ledger.d.ts +308 -0
- package/lib/types/team-store.d.ts +55 -0
- package/lib/types/teams-bridge.d.ts +112 -0
- package/lib/types/transport-caps.d.ts +29 -0
- package/lib/types/types.d.ts +43 -0
- package/nexus-stage/package-lock.json +2262 -0
- package/nexus-stage/package.json +21 -0
- package/nexus-stage/scripts/__pycache__/mockhost.cpython-312.pyc +0 -0
- package/nexus-stage/scripts/mockhost.py +253 -0
- package/nexus-stage/src/canvas-ops.ts +175 -0
- package/nexus-stage/src/canvas-wire.ts +156 -0
- package/nexus-stage/src/edges.ts +72 -0
- package/nexus-stage/src/fault.ts +56 -0
- package/nexus-stage/src/federation.ts +234 -0
- package/nexus-stage/src/layout-doc.ts +143 -0
- package/nexus-stage/src/layout-wire.ts +158 -0
- package/nexus-stage/src/main.ts +361 -0
- package/nexus-stage/src/planning-menus.ts +352 -0
- package/nexus-stage/src/planning-nodelist.ts +294 -0
- package/nexus-stage/src/planning-types.ts +111 -0
- package/nexus-stage/src/planning-view.ts +1313 -0
- package/nexus-stage/src/planning.css +280 -0
- package/nexus-stage/src/seat.ts +35 -0
- package/nexus-stage/src/stage-name.ts +13 -0
- package/nexus-stage/src/tokens.ts +32 -0
- package/nexus-stage/src/viewport.ts +83 -0
- package/nexus-stage/src/workbench.css +267 -0
- package/nexus-stage/src/workbench.ts +1530 -0
- package/nexus-stage/src/world.ts +509 -0
- package/nexus-stage/tsconfig.json +25 -0
- package/nexus-stage/vite.config.ts +16 -0
- package/package.json +218 -157
- package/lib/types/client.d.ts +0 -73
package/package.json
CHANGED
|
@@ -1,157 +1,218 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "@nelsonlongxiang/dsh-open-a2a-net",
|
|
3
|
-
"version": "0.
|
|
4
|
-
"description": "Open A2A network plugin for DeepSeek Harness: signed agent cards, decentralized peer/zone discovery, direct routing model tools, and joinable session nodes with a sidebar control",
|
|
5
|
-
"type": "module",
|
|
6
|
-
"main": "lib/index.js",
|
|
7
|
-
"types": "lib/types/index.d.ts",
|
|
8
|
-
"exports": {
|
|
9
|
-
".": {
|
|
10
|
-
"types": "./lib/types/index.d.ts",
|
|
11
|
-
"default": "./lib/index.js"
|
|
12
|
-
},
|
|
13
|
-
"./invariant": {
|
|
14
|
-
"types": "./lib/types/invariant.d.ts",
|
|
15
|
-
"default": "./lib/invariant.js"
|
|
16
|
-
},
|
|
17
|
-
"./client": {
|
|
18
|
-
"types": "./lib/types/client/index.d.ts",
|
|
19
|
-
"default": "./lib/client.js"
|
|
20
|
-
},
|
|
21
|
-
"./
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
"
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
"
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
"
|
|
47
|
-
"
|
|
48
|
-
"
|
|
49
|
-
"
|
|
50
|
-
"
|
|
51
|
-
"
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
"
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
"
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
"
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
"
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
"
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
"
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
"@deepseek-ai/
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
"@deepseek-ai/dsh-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
"@deepseek-ai/dsh-client-ui-primitives":
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
"@deepseek-ai/dsh-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
"@deepseek-ai/dsh-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
"@deepseek-ai/dsh-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
"
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
"@deepseek-ai/
|
|
110
|
-
"optional": true
|
|
111
|
-
},
|
|
112
|
-
"@deepseek-ai/
|
|
113
|
-
"optional": true
|
|
114
|
-
},
|
|
115
|
-
"@deepseek-ai/
|
|
116
|
-
"optional": true
|
|
117
|
-
},
|
|
118
|
-
"@deepseek-ai/dsh-
|
|
119
|
-
"optional": true
|
|
120
|
-
},
|
|
121
|
-
"@deepseek-ai/dsh-
|
|
122
|
-
"optional": true
|
|
123
|
-
},
|
|
124
|
-
"@deepseek-ai/dsh-
|
|
125
|
-
"optional": true
|
|
126
|
-
},
|
|
127
|
-
"@deepseek-ai/dsh-
|
|
128
|
-
"optional": true
|
|
129
|
-
},
|
|
130
|
-
"@deepseek-ai/
|
|
131
|
-
"optional": true
|
|
132
|
-
},
|
|
133
|
-
"
|
|
134
|
-
"optional": true
|
|
135
|
-
}
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
"@
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
"@
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
"
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
"
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
"
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
1
|
+
{
|
|
2
|
+
"name": "@nelsonlongxiang/dsh-open-a2a-net",
|
|
3
|
+
"version": "0.6.25",
|
|
4
|
+
"description": "Open A2A network plugin for DeepSeek Harness: signed agent cards, decentralized peer/zone discovery, direct routing model tools, and joinable session nodes with a sidebar control",
|
|
5
|
+
"type": "module",
|
|
6
|
+
"main": "lib/index.js",
|
|
7
|
+
"types": "lib/types/index.d.ts",
|
|
8
|
+
"exports": {
|
|
9
|
+
".": {
|
|
10
|
+
"types": "./lib/types/index.d.ts",
|
|
11
|
+
"default": "./lib/index.js"
|
|
12
|
+
},
|
|
13
|
+
"./invariant": {
|
|
14
|
+
"types": "./lib/types/invariant.d.ts",
|
|
15
|
+
"default": "./lib/invariant.js"
|
|
16
|
+
},
|
|
17
|
+
"./client": {
|
|
18
|
+
"types": "./lib/types/client/index.d.ts",
|
|
19
|
+
"default": "./lib/client.js"
|
|
20
|
+
},
|
|
21
|
+
"./card": {
|
|
22
|
+
"types": "./lib/types/card.d.ts",
|
|
23
|
+
"default": "./lib/card.js"
|
|
24
|
+
},
|
|
25
|
+
"./receipt": {
|
|
26
|
+
"types": "./lib/types/receipt.d.ts",
|
|
27
|
+
"default": "./lib/receipt.js"
|
|
28
|
+
},
|
|
29
|
+
"./transport-caps": {
|
|
30
|
+
"types": "./lib/types/transport-caps.d.ts",
|
|
31
|
+
"default": "./lib/transport-caps.js"
|
|
32
|
+
},
|
|
33
|
+
"./a2a-client": {
|
|
34
|
+
"types": "./lib/types/a2a-client.d.ts",
|
|
35
|
+
"default": "./lib/a2a-client.js"
|
|
36
|
+
},
|
|
37
|
+
"./cordis.patch.yml": "./cordis.patch.yml",
|
|
38
|
+
"./package.json": "./package.json"
|
|
39
|
+
},
|
|
40
|
+
"files": [
|
|
41
|
+
"lib",
|
|
42
|
+
"assets/nexusDist",
|
|
43
|
+
"assets/stageDist",
|
|
44
|
+
"images",
|
|
45
|
+
"README_zh.md",
|
|
46
|
+
"cordis.patch.yml",
|
|
47
|
+
"README.md",
|
|
48
|
+
"nexus-stage/src",
|
|
49
|
+
"nexus-stage/scripts",
|
|
50
|
+
"nexus-stage/package.json",
|
|
51
|
+
"nexus-stage/package-lock.json",
|
|
52
|
+
"nexus-stage/tsconfig.json",
|
|
53
|
+
"nexus-stage/vite.config.ts"
|
|
54
|
+
],
|
|
55
|
+
"packageManager": "pnpm@11.28.5",
|
|
56
|
+
"engines": {
|
|
57
|
+
"pnpm": ">=11.24 <12"
|
|
58
|
+
},
|
|
59
|
+
"dsh": {
|
|
60
|
+
"bundle": {
|
|
61
|
+
"patch": "./cordis.patch.yml"
|
|
62
|
+
},
|
|
63
|
+
"client": {
|
|
64
|
+
"platform": "web",
|
|
65
|
+
"inject": [
|
|
66
|
+
"@deepseek-ai/dsh-client-runtime",
|
|
67
|
+
"@deepseek-ai/dsh-client-locale",
|
|
68
|
+
"@deepseek-ai/dsh-client-ui-slots",
|
|
69
|
+
"@deepseek-ai/dsh-client-ui-sidebar"
|
|
70
|
+
]
|
|
71
|
+
}
|
|
72
|
+
},
|
|
73
|
+
"scripts": {
|
|
74
|
+
"prepare": "pnpm build",
|
|
75
|
+
"build": "tsc -p tsconfig.json && tsc -p tsconfig.client.json && tsdown && node scripts/copy-skill.mjs",
|
|
76
|
+
"typecheck": "tsc -p tsconfig.json --noEmit && tsc -p tsconfig.client.json --noEmit",
|
|
77
|
+
"test": "vitest run",
|
|
78
|
+
"test:unit": "vitest run tests/unit",
|
|
79
|
+
"test:wire": "vitest run tests/wire",
|
|
80
|
+
"test:mesh": "vitest run tests/mesh",
|
|
81
|
+
"test:live": "vitest run tests/live",
|
|
82
|
+
"test:build-layout": "vitest run tests/gates/build-layout.spec.ts",
|
|
83
|
+
"verify:nexus": "node scripts/verify-nexus-ci.mjs && npm --prefix nexus-stage run build && npm --prefix nexus-stage run test && git diff --exit-code -- assets/nexusDist/assets && git diff --ignore-cr-at-eol --exit-code -- assets/nexusDist/index.html",
|
|
84
|
+
"verify": "pnpm typecheck && pnpm build && pnpm test && pnpm test:build-layout && pnpm verify:nexus"
|
|
85
|
+
},
|
|
86
|
+
"peerDependencies": {
|
|
87
|
+
"@deepseek-ai/cordis": ">=4.0.1",
|
|
88
|
+
"@deepseek-ai/cordis-plugin-loader": ">=1.0.2",
|
|
89
|
+
"@deepseek-ai/cordis-plugin-timer": ">=1.1.3",
|
|
90
|
+
"@deepseek-ai/dsh-agent": ">=0.1.7-alpha.2",
|
|
91
|
+
"@deepseek-ai/dsh-api-session-controller": ">=0.1.7-alpha.2",
|
|
92
|
+
"@deepseek-ai/dsh-client-locale": ">=0.1.7-alpha.2",
|
|
93
|
+
"@deepseek-ai/dsh-client-runtime": ">=0.1.1-rc.2",
|
|
94
|
+
"@deepseek-ai/dsh-client-ui-primitives": ">=0.1.7-alpha.2",
|
|
95
|
+
"@deepseek-ai/dsh-client-ui-sidebar": ">=0.1.7-alpha.2",
|
|
96
|
+
"@deepseek-ai/dsh-client-ui-slots": ">=0.1.7-alpha.2",
|
|
97
|
+
"@deepseek-ai/dsh-home-paths": ">=0.1.7-alpha.2",
|
|
98
|
+
"@deepseek-ai/dsh-host-webserver": ">=0.1.7-alpha.2",
|
|
99
|
+
"@deepseek-ai/dsh-invariants": ">=0.1.7-alpha.2",
|
|
100
|
+
"@deepseek-ai/dsh-llm": ">=0.1.7-alpha.2",
|
|
101
|
+
"@deepseek-ai/dsh-session": ">=0.1.7-alpha.2",
|
|
102
|
+
"@deepseek-ai/dsh-session-persistence": ">=0.1.7-alpha.2",
|
|
103
|
+
"@deepseek-ai/dsh-session-title": ">=0.1.7-alpha.2",
|
|
104
|
+
"@deepseek-ai/dsh-tools": ">=0.1.7-alpha.2",
|
|
105
|
+
"@deepseek-ai/schemastery": ">=3.18.1",
|
|
106
|
+
"react": "^18.2.0"
|
|
107
|
+
},
|
|
108
|
+
"peerDependenciesMeta": {
|
|
109
|
+
"@deepseek-ai/cordis": {
|
|
110
|
+
"optional": true
|
|
111
|
+
},
|
|
112
|
+
"@deepseek-ai/cordis-plugin-loader": {
|
|
113
|
+
"optional": true
|
|
114
|
+
},
|
|
115
|
+
"@deepseek-ai/cordis-plugin-timer": {
|
|
116
|
+
"optional": true
|
|
117
|
+
},
|
|
118
|
+
"@deepseek-ai/dsh-agent": {
|
|
119
|
+
"optional": true
|
|
120
|
+
},
|
|
121
|
+
"@deepseek-ai/dsh-client-locale": {
|
|
122
|
+
"optional": true
|
|
123
|
+
},
|
|
124
|
+
"@deepseek-ai/dsh-client-runtime": {
|
|
125
|
+
"optional": true
|
|
126
|
+
},
|
|
127
|
+
"@deepseek-ai/dsh-client-ui-primitives": {
|
|
128
|
+
"optional": true
|
|
129
|
+
},
|
|
130
|
+
"@deepseek-ai/dsh-client-ui-sidebar": {
|
|
131
|
+
"optional": true
|
|
132
|
+
},
|
|
133
|
+
"@deepseek-ai/dsh-client-ui-slots": {
|
|
134
|
+
"optional": true
|
|
135
|
+
},
|
|
136
|
+
"@deepseek-ai/dsh-api-session-controller": {
|
|
137
|
+
"optional": true
|
|
138
|
+
},
|
|
139
|
+
"@deepseek-ai/dsh-home-paths": {
|
|
140
|
+
"optional": true
|
|
141
|
+
},
|
|
142
|
+
"@deepseek-ai/dsh-host-webserver": {
|
|
143
|
+
"optional": true
|
|
144
|
+
},
|
|
145
|
+
"@deepseek-ai/dsh-invariants": {
|
|
146
|
+
"optional": true
|
|
147
|
+
},
|
|
148
|
+
"@deepseek-ai/dsh-llm": {
|
|
149
|
+
"optional": true
|
|
150
|
+
},
|
|
151
|
+
"@deepseek-ai/dsh-session": {
|
|
152
|
+
"optional": true
|
|
153
|
+
},
|
|
154
|
+
"@deepseek-ai/dsh-session-persistence": {
|
|
155
|
+
"optional": true
|
|
156
|
+
},
|
|
157
|
+
"@deepseek-ai/dsh-session-title": {
|
|
158
|
+
"optional": true
|
|
159
|
+
},
|
|
160
|
+
"@deepseek-ai/dsh-tools": {
|
|
161
|
+
"optional": true
|
|
162
|
+
},
|
|
163
|
+
"@deepseek-ai/schemastery": {
|
|
164
|
+
"optional": true
|
|
165
|
+
},
|
|
166
|
+
"react": {
|
|
167
|
+
"optional": true
|
|
168
|
+
}
|
|
169
|
+
},
|
|
170
|
+
"devDependencies": {
|
|
171
|
+
"@deepseek-ai/dsh-client-store": "0.2.0-rc.2",
|
|
172
|
+
"@deepseek-ai/dsh-client-ui-primitives": "0.2.0-rc.2",
|
|
173
|
+
"@deepseek-ai/dsh-scope": "0.0.1-rc.1",
|
|
174
|
+
"@deepseek-ai/dsh-system-prompt": "0.1.0-rc.6",
|
|
175
|
+
"@deepseek-ai/dsh-util-code-language": "0.1.7-rc.2",
|
|
176
|
+
"@deepseek-ai/dsh-util-workspace-path": "0.1.2-alpha.2",
|
|
177
|
+
"@shikijs/langs": "^4.5.0",
|
|
178
|
+
"@testing-library/react": "^16.3.0",
|
|
179
|
+
"@types/node": "^24.13.3",
|
|
180
|
+
"@types/react": "~18.3.1",
|
|
181
|
+
"@types/react-dom": "^18.3.7",
|
|
182
|
+
"anser": "^2.3.5",
|
|
183
|
+
"clsx": "^2.1.1",
|
|
184
|
+
"diff": "^9.0.0",
|
|
185
|
+
"jsdom": "^26.1.0",
|
|
186
|
+
"katex": "^0.19.0",
|
|
187
|
+
"lightningcss": "^1.33.0",
|
|
188
|
+
"mdast-util-from-markdown": "^2.1.0",
|
|
189
|
+
"mdast-util-gfm": "^3.1.0",
|
|
190
|
+
"mdast-util-math": "^3.0.0",
|
|
191
|
+
"micromark-core-commonmark": "^2.0.4",
|
|
192
|
+
"micromark-extension-gfm": "^3.0.0",
|
|
193
|
+
"micromark-extension-math": "^3.1.0",
|
|
194
|
+
"micromark-factory-space": "^2.1.0",
|
|
195
|
+
"micromark-util-character": "^2.1.1",
|
|
196
|
+
"micromark-util-classify-character": "^2.0.1",
|
|
197
|
+
"micromark-util-sanitize-uri": "^2.0.1",
|
|
198
|
+
"micromark-util-symbol": "^2.0.1",
|
|
199
|
+
"react": "^18.2.0",
|
|
200
|
+
"react-dom": "^18.2.0",
|
|
201
|
+
"shiki": "^4.5.0",
|
|
202
|
+
"simple-icons": "^16.35.0",
|
|
203
|
+
"tsdown": "0.22.2",
|
|
204
|
+
"typescript": "^5.9.3",
|
|
205
|
+
"vitest": "^4.1.8"
|
|
206
|
+
},
|
|
207
|
+
"pnpm": {
|
|
208
|
+
"overrides": {
|
|
209
|
+
"@deepseek-ai/cordis": "4.0.5",
|
|
210
|
+
"@deepseek-ai/cordis-plugin-loader": "1.0.5"
|
|
211
|
+
}
|
|
212
|
+
},
|
|
213
|
+
"license": "MIT",
|
|
214
|
+
"repository": {
|
|
215
|
+
"type": "git",
|
|
216
|
+
"url": "git+https://gitee.com/NelsonLongXiang/dsh-open-a2a-net.git"
|
|
217
|
+
}
|
|
218
|
+
}
|
package/lib/types/client.d.ts
DELETED
|
@@ -1,73 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* In-process decentralized A2A client: the outbound peer surface — verified
|
|
3
|
-
* agent-card fetches (discovery) and direct routes to a peer's
|
|
4
|
-
* `/a2a/direct` endpoint. Timing and fetch seams are constructor-injected so
|
|
5
|
-
* tests drive them without a network.
|
|
6
|
-
* @module @nelsonlongxiang/dsh-open-a2a-net/client
|
|
7
|
-
*/
|
|
8
|
-
import type { A2aPeerCard, A2aRouteResult } from './types.ts';
|
|
9
|
-
/** One-shot delayed callback returning its disposer. */
|
|
10
|
-
export type A2aSchedule = (callback: () => void, delayMs: number) => () => void;
|
|
11
|
-
/** Minimal fetch face; the first HTTP-level failure rejects. */
|
|
12
|
-
export type A2aFetch = (url: string, init: {
|
|
13
|
-
readonly method: 'GET' | 'POST';
|
|
14
|
-
readonly headers: Record<string, string>;
|
|
15
|
-
readonly body?: string;
|
|
16
|
-
readonly signal?: AbortSignal;
|
|
17
|
-
}) => Promise<{
|
|
18
|
-
readonly ok: boolean;
|
|
19
|
-
readonly status: number;
|
|
20
|
-
readonly text: () => Promise<string>;
|
|
21
|
-
}>;
|
|
22
|
-
/** Constructor facts; every seam is explicit so tests inject doubles. */
|
|
23
|
-
export interface A2aClientOptions {
|
|
24
|
-
/** `X-API-Key` value sent on peer requests; empty omits the header. */
|
|
25
|
-
readonly apiKey: string;
|
|
26
|
-
/** This node's caller label stamped on outbound routes. */
|
|
27
|
-
readonly sessionId: string;
|
|
28
|
-
/** Delayed-callback seam (HTTP timeouts). */
|
|
29
|
-
readonly schedule: A2aSchedule;
|
|
30
|
-
/** HTTP seam. */
|
|
31
|
-
readonly fetch: A2aFetch;
|
|
32
|
-
}
|
|
33
|
-
/**
|
|
34
|
-
* The A2A peer client. One instance serves the whole fiber's outbound
|
|
35
|
-
* card fetches and direct routes; it owns no connection state.
|
|
36
|
-
*/
|
|
37
|
-
export declare class A2aClient {
|
|
38
|
-
private readonly options;
|
|
39
|
-
/** @param options - resolved caller facts and injected seams. */
|
|
40
|
-
constructor(options: A2aClientOptions);
|
|
41
|
-
private headers;
|
|
42
|
-
private http;
|
|
43
|
-
/**
|
|
44
|
-
* Fetch one peer's agent card (discovery): team, session, capabilities.
|
|
45
|
-
* The card is verified at parse — unsigned, badly signed, or expired cards
|
|
46
|
-
* are rejected here, so a stale peer disappears from discovery without any
|
|
47
|
-
* background cleanup.
|
|
48
|
-
* @param baseUrl - the peer's base URL.
|
|
49
|
-
* @returns the verified card, or `undefined` when unreachable, malformed, or rejected.
|
|
50
|
-
*/
|
|
51
|
-
fetchCard(baseUrl: string): Promise<A2aPeerCard | undefined>;
|
|
52
|
-
/**
|
|
53
|
-
* Extract the reply text from a route result member: the wire carries a
|
|
54
|
-
* plain string, a `{text}` object, or anything else JSON-encoded.
|
|
55
|
-
* @param inner - the raw `result` member of a route response.
|
|
56
|
-
* @param fallback - what a nullish member encodes as.
|
|
57
|
-
* @returns the reply text.
|
|
58
|
-
*/
|
|
59
|
-
private replyText;
|
|
60
|
-
/**
|
|
61
|
-
* Route directly to a peer node's `/a2a/direct` endpoint. The peer steers
|
|
62
|
-
* the message into its live agent (or the named session team's agent) and
|
|
63
|
-
* answers within its own final-reply budget.
|
|
64
|
-
* @param baseUrl - the peer's base URL.
|
|
65
|
-
* @param team - target team name (the peer's own or a session team).
|
|
66
|
-
* @param message - request text.
|
|
67
|
-
* @param contextId - context id from a prior reply, for multi-turn.
|
|
68
|
-
* @param signal - caller cancellation.
|
|
69
|
-
* @param callerSession - caller label overriding the node's label (the calling session's node label).
|
|
70
|
-
* @returns the canonical route result (success or explicit failure).
|
|
71
|
-
*/
|
|
72
|
-
routeDirect(baseUrl: string, team: string, message: string, contextId?: string, signal?: AbortSignal, callerSession?: string): Promise<A2aRouteResult>;
|
|
73
|
-
}
|