@aramisfa/openclaw-a2a-outbound 2.0.0 → 4.0.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/README.md +142 -54
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +13 -2
- package/dist/index.js.map +1 -1
- package/dist/result-shape.d.ts +9 -0
- package/dist/result-shape.d.ts.map +1 -1
- package/dist/result-shape.js +19 -7
- package/dist/result-shape.js.map +1 -1
- package/dist/schemas.d.ts +26 -0
- package/dist/schemas.d.ts.map +1 -1
- package/dist/schemas.js +150 -5
- package/dist/schemas.js.map +1 -1
- package/dist/sdk-client-pool.d.ts +3 -0
- package/dist/sdk-client-pool.d.ts.map +1 -1
- package/dist/sdk-client-pool.js +16 -0
- package/dist/sdk-client-pool.js.map +1 -1
- package/dist/service.d.ts +1 -0
- package/dist/service.d.ts.map +1 -1
- package/dist/service.js +89 -0
- package/dist/service.js.map +1 -1
- package/dist/task-handle-registry.d.ts.map +1 -1
- package/dist/task-handle-registry.js +30 -5
- package/dist/task-handle-registry.js.map +1 -1
- package/openclaw.plugin.json +1 -1
- package/package.json +4 -4
- package/skills/remote-agent/SKILL.md +21 -11
package/README.md
CHANGED
|
@@ -24,6 +24,15 @@ clawhub install a2a-delegation-setup
|
|
|
24
24
|
|
|
25
25
|
The ClawHub skill is an optional guided setup helper for installing, enabling, configuring, verifying, updating, and troubleshooting `@aramisfa/openclaw-a2a-outbound`. The plugin itself still installs through `openclaw plugins install @aramisfa/openclaw-a2a-outbound`.
|
|
26
26
|
|
|
27
|
+
## Routing Boundary
|
|
28
|
+
|
|
29
|
+
`@aramisfa/openclaw-a2a-outbound` is the only outbound A2A continuation surface in this repository.
|
|
30
|
+
|
|
31
|
+
- `summary.continuation` is for `remote_agent` follow-up only.
|
|
32
|
+
- Do not replay `summary.continuation` back through inbound channel delivery on channel `a2a`.
|
|
33
|
+
- Do not treat an inbound A2A channel turn, `OriginatingChannel`, `OriginatingTo`, or inbound `capabilities.reply` as proof that generic channel-level queued follow-up is supported.
|
|
34
|
+
- If you see `A2A_OUTBOUND_DELIVERY_UNSUPPORTED`, OpenClaw tried to route a queued follow-up through `openclaw-a2a-inbound`; switch the workflow back to persisted `summary.continuation` plus `remote_agent`.
|
|
35
|
+
|
|
27
36
|
## Requirements
|
|
28
37
|
|
|
29
38
|
- Node.js `>=22.12.0`
|
|
@@ -31,7 +40,7 @@ The ClawHub skill is an optional guided setup helper for installing, enabling, c
|
|
|
31
40
|
|
|
32
41
|
## OpenClaw Plugin Config
|
|
33
42
|
|
|
34
|
-
|
|
43
|
+
`openclaw plugins install` enables the plugin at the OpenClaw system level automatically — no separate `openclaw plugins enable` step is required. However, the `remote_agent` tool is gated by the plugin's own `"enabled"` flag inside its configuration object. Set `"enabled": true` under plugin id `openclaw-a2a-outbound` in your OpenClaw plugin config to activate the tool:
|
|
35
44
|
|
|
36
45
|
```json
|
|
37
46
|
{
|
|
@@ -48,7 +57,7 @@ The plugin installs through the OpenClaw CLI, but the tool stays disabled until
|
|
|
48
57
|
"baseUrl": "https://support.example",
|
|
49
58
|
"description": "Primary support lane",
|
|
50
59
|
"tags": ["support"],
|
|
51
|
-
"examples": ["Summarize this incident and propose
|
|
60
|
+
"examples": ["Summarize this incident and propose immediate actions."],
|
|
52
61
|
"default": true
|
|
53
62
|
}
|
|
54
63
|
],
|
|
@@ -78,7 +87,7 @@ Call `list_targets` first to discover configured aliases and refreshed peer-card
|
|
|
78
87
|
- `message_id`: optional client-supplied message id for `send`.
|
|
79
88
|
- `task_handle`: opaque delegated-task handle. `send`, `watch`, `status`, and `cancel` all accept it.
|
|
80
89
|
- `task_id`: for `send`, continue an existing remote task when no `task_handle` is available; for `watch`/`status`/`cancel`, fallback follow-up key when no live `task_handle` is available.
|
|
81
|
-
- `context_id`: optional remote conversation context id for `send
|
|
90
|
+
- `context_id`: optional remote conversation context id for `send` only. Use it either with `task_id` or by itself to start a new task inside an existing conversation. Flat `context_id` must not be used for `watch`, `status`, or `cancel`.
|
|
82
91
|
- `reference_task_ids`: optional related task ids for `send`. `task_id` continues an existing task; `reference_task_ids` references prior tasks without continuing them.
|
|
83
92
|
- `task_requirement`: optional `send` contract. Defaults to `"optional"`; set `task_requirement="required"` to require a real task.
|
|
84
93
|
- `follow_updates`: stream the initial `send`. `follow_updates=true` means “stream the initial send”; it does not guarantee task creation unless `task_requirement="required"`.
|
|
@@ -102,42 +111,41 @@ Snake_case tool fields are translated internally to the A2A SDK camelCase reques
|
|
|
102
111
|
|
|
103
112
|
Failed `send` and `sendStream` calls include `error.details.capability_diagnostics` so remote validation or content-type rejections can be compared against the stored peer card without blocking permissive runtime sends.
|
|
104
113
|
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
- new task: `send` with `target_alias`/`target_url` or a configured default target, and no continuation fields
|
|
108
|
-
- existing task continuation: `send` with `task_handle`, or `task_id` plus `target_alias`/`target_url` or a configured default target
|
|
109
|
-
- related new task: `send` with `reference_task_ids`, optionally plus `context_id`, plus `target_alias`/`target_url` or a configured default target
|
|
110
|
-
- new task in an existing conversation: `send` with `context_id` plus `target_alias`/`target_url` or a configured default target
|
|
111
|
-
|
|
112
|
-
When a delegated task pauses in `input-required` or an approval workflow, resume it with `send` again. Prefer `task_handle` first. If the handle is expired or unavailable, fall back to `target_alias` + `task_id`.
|
|
114
|
+
## Continuation Rules
|
|
113
115
|
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
This package returns continuation metadata under `summary.continuation`.
|
|
116
|
+
This package returns continuation metadata under `summary.continuation`. Persist that subtree verbatim and use it to choose the next action.
|
|
117
117
|
|
|
118
|
+
- `summary.continuation.target`: the canonical persisted routing contract for machine follow-up. Persist `target_url`, `card_path`, and `preferred_transports` verbatim; `target_alias` is optional descriptive metadata.
|
|
118
119
|
- `summary.continuation.task`: the only machine-readable signal that a real remote task exists. Read `task_handle`, `task_id`, `status`, `can_resume_send`, `can_watch`, and the deprecated alias `can_send` from here, and use it for follow-up `send`, `watch`, `status`, and `cancel`.
|
|
119
120
|
- `summary.continuation.conversation`: send-only conversation continuity. Read `context_id` from here and use it only for follow-up `send`.
|
|
120
121
|
- `response_kind`: descriptive wire-shape classification only. `response_kind="message"` means the peer returned a `Message`; `response_kind="task"` means a task-bearing response or event appeared. `response_kind` does not replace `summary.continuation`.
|
|
121
|
-
- Do not
|
|
122
|
-
-
|
|
123
|
-
-
|
|
124
|
-
-
|
|
122
|
+
- `summary.target_*` and other top-level compatibility aliases are descriptive only. Do not infer lifecycle continuity from flat `task_id`, flat `context_id`, or other top-level fields.
|
|
123
|
+
- `watch`, `status`, and `cancel` require `summary.continuation.task`.
|
|
124
|
+
- Conversation-only follow-up uses `context_id`, not task actions.
|
|
125
|
+
- `summary.continuation` is not a license to route follow-ups through channel `a2a`; it is the persisted contract for `remote_agent` only.
|
|
126
|
+
|
|
127
|
+
Supported `send` modes:
|
|
128
|
+
|
|
129
|
+
- new task: `send` with `target_alias`/`target_url` or a configured default target, and no continuation fields
|
|
130
|
+
- existing task continuation: `send` with a persisted `continuation`; flat `task_handle`, or `task_id` plus `target_alias`/`target_url`, remain manual compatibility inputs only
|
|
131
|
+
- related new task: `send` with `reference_task_ids`, optionally plus `context_id`, plus `target_alias`/`target_url` or a configured default target
|
|
132
|
+
- new task in an existing conversation: `send` with a persisted conversation-only `continuation`; flat `context_id` plus `target_alias`/`target_url` remains manual compatibility only
|
|
133
|
+
|
|
134
|
+
When a delegated task pauses in `input-required` or an approval workflow, resume it with `send` again. If the nested `task_handle` is expired or unavailable, the plugin automatically falls back within that nested contract to `continuation.target` + `continuation.task.task_id`; callers should not flatten persisted follow-up state back into `target_alias`/`task_id`.
|
|
125
135
|
|
|
126
|
-
|
|
136
|
+
Choose the next action based on the continuation shape:
|
|
127
137
|
|
|
128
138
|
```ts
|
|
129
|
-
const
|
|
130
|
-
const
|
|
139
|
+
const continuation = result.summary.continuation
|
|
140
|
+
const task = continuation?.task
|
|
141
|
+
const conversation = continuation?.conversation
|
|
131
142
|
|
|
132
143
|
if (task) {
|
|
133
|
-
const followUp =
|
|
134
|
-
? { action: "status", task_handle: task.task_handle }
|
|
135
|
-
: { action: "status", target_alias: "support", task_id: task.task_id }
|
|
144
|
+
const followUp = { action: "status", continuation }
|
|
136
145
|
} else if (conversation) {
|
|
137
146
|
const followUp = {
|
|
138
147
|
action: "send",
|
|
139
|
-
|
|
140
|
-
context_id: conversation.context_id,
|
|
148
|
+
continuation,
|
|
141
149
|
parts: [{ kind: "text", text: "Start a related task in the same conversation." }],
|
|
142
150
|
}
|
|
143
151
|
}
|
|
@@ -163,9 +171,10 @@ if (task) {
|
|
|
163
171
|
"target_url": "https://support.example/",
|
|
164
172
|
"default": true,
|
|
165
173
|
"tags": ["support"],
|
|
166
|
-
"examples": ["Summarize this incident and propose
|
|
174
|
+
"examples": ["Summarize this incident and propose immediate actions."],
|
|
167
175
|
"target_name": "Support Agent",
|
|
168
176
|
"description": "Primary support lane",
|
|
177
|
+
"streaming_supported": true,
|
|
169
178
|
"peer_card": {
|
|
170
179
|
"preferred_transport": "JSONRPC",
|
|
171
180
|
"additional_interfaces": [
|
|
@@ -191,7 +200,7 @@ if (task) {
|
|
|
191
200
|
"name": "Incident Triage",
|
|
192
201
|
"description": "Summarize incidents and propose next actions.",
|
|
193
202
|
"tags": ["support"],
|
|
194
|
-
"examples": ["Summarize this incident and propose
|
|
203
|
+
"examples": ["Summarize this incident and propose immediate actions."],
|
|
195
204
|
"input_modes": ["application/json"],
|
|
196
205
|
"output_modes": ["application/pdf"]
|
|
197
206
|
}
|
|
@@ -214,7 +223,7 @@ if (task) {
|
|
|
214
223
|
"configuredDescription": "Primary support lane",
|
|
215
224
|
"default": true,
|
|
216
225
|
"tags": ["support"],
|
|
217
|
-
"examples": ["Summarize this incident and propose
|
|
226
|
+
"examples": ["Summarize this incident and propose immediate actions."],
|
|
218
227
|
"card": {
|
|
219
228
|
"displayName": "Support Agent",
|
|
220
229
|
"description": "Summarize incidents and propose next actions.",
|
|
@@ -242,7 +251,7 @@ if (task) {
|
|
|
242
251
|
"name": "Incident Triage",
|
|
243
252
|
"description": "Summarize incidents and propose next actions.",
|
|
244
253
|
"tags": ["support"],
|
|
245
|
-
"examples": ["Summarize this incident and propose
|
|
254
|
+
"examples": ["Summarize this incident and propose immediate actions."],
|
|
246
255
|
"inputModes": ["application/json"],
|
|
247
256
|
"outputModes": ["application/pdf"]
|
|
248
257
|
}
|
|
@@ -349,6 +358,12 @@ If one target is marked `"default": true`, `send` can omit `target_alias`:
|
|
|
349
358
|
"target_url": "https://support.example/",
|
|
350
359
|
"response_kind": "task",
|
|
351
360
|
"continuation": {
|
|
361
|
+
"target": {
|
|
362
|
+
"target_url": "https://support.example/",
|
|
363
|
+
"card_path": "/.well-known/agent-card.json",
|
|
364
|
+
"preferred_transports": ["JSONRPC", "HTTP+JSON"],
|
|
365
|
+
"target_alias": "support"
|
|
366
|
+
},
|
|
352
367
|
"task": {
|
|
353
368
|
"task_handle": "rah_0a3ff8c2-4a6d-48cb-a57d-4ae6f3c589d0",
|
|
354
369
|
"task_id": "task-456",
|
|
@@ -415,12 +430,27 @@ const followUpContext = conversation?.context_id
|
|
|
415
430
|
|
|
416
431
|
### Continue An Existing Remote Task With `task_handle`
|
|
417
432
|
|
|
418
|
-
|
|
433
|
+
Resend the persisted continuation subtree:
|
|
419
434
|
|
|
420
435
|
```json
|
|
421
436
|
{
|
|
422
437
|
"action": "send",
|
|
423
|
-
"
|
|
438
|
+
"continuation": {
|
|
439
|
+
"target": {
|
|
440
|
+
"target_url": "https://support.example/",
|
|
441
|
+
"card_path": "/.well-known/agent-card.json",
|
|
442
|
+
"preferred_transports": ["JSONRPC", "HTTP+JSON"],
|
|
443
|
+
"target_alias": "support"
|
|
444
|
+
},
|
|
445
|
+
"task": {
|
|
446
|
+
"task_handle": "rah_0a3ff8c2-4a6d-48cb-a57d-4ae6f3c589d0",
|
|
447
|
+
"task_id": "task-456"
|
|
448
|
+
},
|
|
449
|
+
"conversation": {
|
|
450
|
+
"context_id": "ctx-456",
|
|
451
|
+
"can_send": true
|
|
452
|
+
}
|
|
453
|
+
},
|
|
424
454
|
"parts": [
|
|
425
455
|
{
|
|
426
456
|
"kind": "text",
|
|
@@ -432,14 +462,26 @@ Use `summary.continuation.task.task_handle` from the prior result when a delegat
|
|
|
432
462
|
|
|
433
463
|
### Continue An Existing Remote Task With `task_id`
|
|
434
464
|
|
|
435
|
-
|
|
465
|
+
Use the persisted continuation without `task_handle`:
|
|
436
466
|
|
|
437
467
|
```json
|
|
438
468
|
{
|
|
439
469
|
"action": "send",
|
|
440
|
-
"
|
|
441
|
-
|
|
442
|
-
|
|
470
|
+
"continuation": {
|
|
471
|
+
"target": {
|
|
472
|
+
"target_url": "https://support.example/",
|
|
473
|
+
"card_path": "/.well-known/agent-card.json",
|
|
474
|
+
"preferred_transports": ["JSONRPC", "HTTP+JSON"],
|
|
475
|
+
"target_alias": "support"
|
|
476
|
+
},
|
|
477
|
+
"task": {
|
|
478
|
+
"task_id": "task-456"
|
|
479
|
+
},
|
|
480
|
+
"conversation": {
|
|
481
|
+
"context_id": "ctx-456",
|
|
482
|
+
"can_send": true
|
|
483
|
+
}
|
|
484
|
+
},
|
|
443
485
|
"parts": [
|
|
444
486
|
{
|
|
445
487
|
"kind": "text",
|
|
@@ -451,13 +493,23 @@ If `summary.continuation.task.task_handle` is unavailable, use `summary.continua
|
|
|
451
493
|
|
|
452
494
|
### Start A New Task In An Existing Conversation
|
|
453
495
|
|
|
454
|
-
Use `summary.continuation.conversation.context_id` when
|
|
496
|
+
Use `summary.continuation.conversation.context_id` when only conversation continuity exists:
|
|
455
497
|
|
|
456
498
|
```json
|
|
457
499
|
{
|
|
458
500
|
"action": "send",
|
|
459
|
-
"
|
|
460
|
-
|
|
501
|
+
"continuation": {
|
|
502
|
+
"target": {
|
|
503
|
+
"target_url": "https://support.example/",
|
|
504
|
+
"card_path": "/.well-known/agent-card.json",
|
|
505
|
+
"preferred_transports": ["JSONRPC", "HTTP+JSON"],
|
|
506
|
+
"target_alias": "support"
|
|
507
|
+
},
|
|
508
|
+
"conversation": {
|
|
509
|
+
"context_id": "ctx-456",
|
|
510
|
+
"can_send": true
|
|
511
|
+
}
|
|
512
|
+
},
|
|
461
513
|
"parts": [
|
|
462
514
|
{
|
|
463
515
|
"kind": "text",
|
|
@@ -478,6 +530,12 @@ Use `summary.continuation.conversation.context_id` when the prior result has con
|
|
|
478
530
|
"response_kind": "message",
|
|
479
531
|
"message_text": "Conversation continued. Start the next task when ready.",
|
|
480
532
|
"continuation": {
|
|
533
|
+
"target": {
|
|
534
|
+
"target_url": "https://support.example/",
|
|
535
|
+
"card_path": "/.well-known/agent-card.json",
|
|
536
|
+
"preferred_transports": ["JSONRPC", "HTTP+JSON"],
|
|
537
|
+
"target_alias": "support"
|
|
538
|
+
},
|
|
481
539
|
"conversation": {
|
|
482
540
|
"context_id": "ctx-456",
|
|
483
541
|
"can_send": true
|
|
@@ -501,21 +559,35 @@ if (task) {
|
|
|
501
559
|
if (conversation) {
|
|
502
560
|
const followUp = {
|
|
503
561
|
action: "send",
|
|
504
|
-
|
|
505
|
-
context_id: conversation.context_id,
|
|
562
|
+
continuation: result.summary.continuation,
|
|
506
563
|
parts: [{ kind: "text", text: "Start the next task in this conversation." }],
|
|
507
564
|
}
|
|
508
565
|
}
|
|
509
566
|
```
|
|
510
567
|
|
|
511
|
-
|
|
568
|
+
Conversation continuity is send-only. `watch`, `status`, and `cancel` require `summary.continuation.task`.
|
|
512
569
|
|
|
513
570
|
### Check Task Status With `task_handle`
|
|
514
571
|
|
|
515
572
|
```json
|
|
516
573
|
{
|
|
517
574
|
"action": "status",
|
|
518
|
-
"
|
|
575
|
+
"continuation": {
|
|
576
|
+
"target": {
|
|
577
|
+
"target_url": "https://support.example/",
|
|
578
|
+
"card_path": "/.well-known/agent-card.json",
|
|
579
|
+
"preferred_transports": ["JSONRPC", "HTTP+JSON"],
|
|
580
|
+
"target_alias": "support"
|
|
581
|
+
},
|
|
582
|
+
"task": {
|
|
583
|
+
"task_handle": "rah_0a3ff8c2-4a6d-48cb-a57d-4ae6f3c589d0",
|
|
584
|
+
"task_id": "task-456"
|
|
585
|
+
},
|
|
586
|
+
"conversation": {
|
|
587
|
+
"context_id": "ctx-456",
|
|
588
|
+
"can_send": true
|
|
589
|
+
}
|
|
590
|
+
},
|
|
519
591
|
"history_length": 2
|
|
520
592
|
}
|
|
521
593
|
```
|
|
@@ -530,6 +602,12 @@ Do not poll from conversation continuity.
|
|
|
530
602
|
"target_url": "https://support.example/",
|
|
531
603
|
"response_kind": "task",
|
|
532
604
|
"continuation": {
|
|
605
|
+
"target": {
|
|
606
|
+
"target_url": "https://support.example/",
|
|
607
|
+
"card_path": "/.well-known/agent-card.json",
|
|
608
|
+
"preferred_transports": ["JSONRPC", "HTTP+JSON"],
|
|
609
|
+
"target_alias": "support"
|
|
610
|
+
},
|
|
533
611
|
"task": {
|
|
534
612
|
"task_handle": "rah_0a3ff8c2-4a6d-48cb-a57d-4ae6f3c589d0",
|
|
535
613
|
"task_id": "task-456",
|
|
@@ -565,32 +643,42 @@ if (!task) {
|
|
|
565
643
|
}
|
|
566
644
|
|
|
567
645
|
const nextStatus = task.task_handle
|
|
568
|
-
? { action: "status",
|
|
569
|
-
: { action: "status",
|
|
646
|
+
? { action: "status", continuation: result.summary.continuation }
|
|
647
|
+
: { action: "status", continuation: result.summary.continuation }
|
|
570
648
|
|
|
571
649
|
const nextSend = conversation
|
|
572
|
-
? { action: "send",
|
|
650
|
+
? { action: "send", continuation: result.summary.continuation }
|
|
573
651
|
: undefined
|
|
574
652
|
```
|
|
575
653
|
|
|
576
|
-
|
|
654
|
+
If `summary.continuation.task.task_handle` is expired or unavailable, retry with the same persisted `continuation`:
|
|
577
655
|
|
|
578
656
|
```json
|
|
579
657
|
{
|
|
580
658
|
"action": "status",
|
|
581
|
-
"
|
|
582
|
-
|
|
659
|
+
"continuation": {
|
|
660
|
+
"target": {
|
|
661
|
+
"target_url": "https://support.example/",
|
|
662
|
+
"card_path": "/.well-known/agent-card.json",
|
|
663
|
+
"preferred_transports": ["JSONRPC", "HTTP+JSON"],
|
|
664
|
+
"target_alias": "support"
|
|
665
|
+
},
|
|
666
|
+
"task": {
|
|
667
|
+
"task_handle": "rah_0a3ff8c2-4a6d-48cb-a57d-4ae6f3c589d0",
|
|
668
|
+
"task_id": "task-456"
|
|
669
|
+
}
|
|
670
|
+
}
|
|
583
671
|
}
|
|
584
672
|
```
|
|
585
673
|
|
|
586
|
-
`watch` and `cancel`
|
|
674
|
+
`watch` and `cancel` require `summary.continuation.task` from a prior result:
|
|
587
675
|
|
|
588
676
|
```json
|
|
589
|
-
{ "action": "watch", "task_handle": "rah_0a3ff8c2-4a6d-48cb-a57d-4ae6f3c589d0" }
|
|
677
|
+
{ "action": "watch", "continuation": { "target": { "target_url": "https://support.example/", "card_path": "/.well-known/agent-card.json", "preferred_transports": ["JSONRPC", "HTTP+JSON"], "target_alias": "support" }, "task": { "task_handle": "rah_0a3ff8c2-4a6d-48cb-a57d-4ae6f3c589d0", "task_id": "task-456" } } }
|
|
590
678
|
```
|
|
591
679
|
|
|
592
680
|
```json
|
|
593
|
-
{ "action": "cancel", "task_handle": "rah_0a3ff8c2-4a6d-48cb-a57d-4ae6f3c589d0" }
|
|
681
|
+
{ "action": "cancel", "continuation": { "target": { "target_url": "https://support.example/", "card_path": "/.well-known/agent-card.json", "preferred_transports": ["JSONRPC", "HTTP+JSON"], "target_alias": "support" }, "task": { "task_handle": "rah_0a3ff8c2-4a6d-48cb-a57d-4ae6f3c589d0", "task_id": "task-456" } } }
|
|
594
682
|
```
|
|
595
683
|
|
|
596
684
|
## Validation And Actionable Errors
|
|
@@ -632,10 +720,10 @@ Expired handles return an actionable recovery envelope:
|
|
|
632
720
|
"message": "task handle \"rah_0a3ff8c2-4a6d-48cb-a57d-4ae6f3c589d0\" has expired",
|
|
633
721
|
"details": {
|
|
634
722
|
"taskHandle": "rah_0a3ff8c2-4a6d-48cb-a57d-4ae6f3c589d0",
|
|
635
|
-
"retryHint": "Retry with
|
|
723
|
+
"retryHint": "Retry with the same nested continuation so the plugin can fall back to the persisted target plus taskId, or resend the original request after a restart to obtain a new handle.",
|
|
636
724
|
"restartInvalidatesHandles": true,
|
|
637
725
|
"suggested_actions": ["status", "send"],
|
|
638
|
-
"hint": "Retry with target_alias + task_id
|
|
726
|
+
"hint": "Retry with the same nested continuation, or use flat target_alias + task_id only as manual compatibility."
|
|
639
727
|
}
|
|
640
728
|
}
|
|
641
729
|
}
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,KAAK,iBAAiB,EACtB,KAAK,0BAA0B,EAChC,MAAM,qBAAqB,CAAC;AA4D7B,iBAAS,aAAa,CAAC,GAAG,EAAE,iBAAiB,GAAG,IAAI,CAoDnD;AAED,eAAO,MAAM,EAAE,0BAAY,CAAC;AAE5B,eAAO,MAAM,MAAM;;;;CAIO,CAAC;AAE3B,eAAe,MAAM,CAAC"}
|
package/dist/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { jsonResult
|
|
1
|
+
import { jsonResult } from "openclaw/plugin-sdk/core";
|
|
2
2
|
import { PLUGIN_ID } from "./constants.js";
|
|
3
3
|
import { A2A_OUTBOUND_OPENCLAW_CONFIG_SCHEMA, } from "./config.js";
|
|
4
4
|
import { log } from "./logging.js";
|
|
@@ -34,8 +34,18 @@ function resolveExecuteArgs(args) {
|
|
|
34
34
|
}
|
|
35
35
|
function registerTools(api) {
|
|
36
36
|
const config = A2A_OUTBOUND_OPENCLAW_CONFIG_SCHEMA.parse?.(api.pluginConfig ?? {});
|
|
37
|
+
if (api.registrationMode !== "full") {
|
|
38
|
+
log(api.logger, "debug", "a2a.plugin.registration.deferred", {
|
|
39
|
+
pluginId: PLUGIN_ID,
|
|
40
|
+
registrationMode: api.registrationMode,
|
|
41
|
+
});
|
|
42
|
+
return;
|
|
43
|
+
}
|
|
37
44
|
if (config.enabled !== true) {
|
|
38
|
-
log(api.logger, "info", "a2a.plugin.disabled", {
|
|
45
|
+
log(api.logger, "info", "a2a.plugin.disabled", {
|
|
46
|
+
pluginId: PLUGIN_ID,
|
|
47
|
+
registrationMode: api.registrationMode,
|
|
48
|
+
});
|
|
39
49
|
return;
|
|
40
50
|
}
|
|
41
51
|
const service = buildService({
|
|
@@ -61,6 +71,7 @@ function registerTools(api) {
|
|
|
61
71
|
api.registerTool(remoteAgentTool, { optional: true });
|
|
62
72
|
log(api.logger, "info", "a2a.plugin.loaded", {
|
|
63
73
|
pluginId: PLUGIN_ID,
|
|
74
|
+
registrationMode: api.registrationMode,
|
|
64
75
|
tools: [remoteAgentTool.name],
|
|
65
76
|
});
|
|
66
77
|
}
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,UAAU,EAAE,MAAM,0BAA0B,CAAC;AACtD,OAAO,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAC;AAC3C,OAAO,EACL,mCAAmC,GAEpC,MAAM,aAAa,CAAC;AACrB,OAAO,EAAE,GAAG,EAAE,MAAM,cAAc,CAAC;AACnC,OAAO,EAAE,8BAA8B,EAAE,MAAM,cAAc,CAAC;AAC9D,OAAO,EAAE,YAAY,EAAE,MAAM,cAAc,CAAC;AAgB5C,SAAS,aAAa,CAAC,KAAc;IACnC,OAAO,CACL,OAAO,KAAK,KAAK,QAAQ;QACzB,KAAK,KAAK,IAAI;QACd,SAAS,IAAI,KAAK;QAClB,OAAQ,KAAqB,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E,CAAC,eAAe,CAAC,IAAI,CAAC;KAC9B,CAAC,CAAC;AACL,CAAC;AAED,MAAM,CAAC,MAAM,EAAE,GAAG,SAAS,CAAC;AAE5B,MAAM,CAAC,MAAM,MAAM,GAAG;IACpB,EAAE,EAAE,SAAS;IACb,YAAY,EAAE,mCAAmC;IACjD,QAAQ,EAAE,aAAa;CACC,CAAC;AAE3B,eAAe,MAAM,CAAC"}
|
package/dist/result-shape.d.ts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import type { Artifact, Message, Task, TaskArtifactUpdateEvent, TaskStatusUpdateEvent } from "@a2a-js/sdk";
|
|
2
2
|
import type { ToolError } from "./errors.js";
|
|
3
|
+
import type { A2ATransport } from "./constants.js";
|
|
3
4
|
import type { RemoteAgentAction } from "./schemas.js";
|
|
4
5
|
import type { ResolvedTarget } from "./sdk-client-pool.js";
|
|
5
6
|
import type { TargetCatalogEntry, TargetCardCapabilitiesSnapshot, TargetCardSnapshot } from "./target-catalog.js";
|
|
@@ -48,6 +49,7 @@ export interface TargetListSummary {
|
|
|
48
49
|
examples: string[];
|
|
49
50
|
target_name?: string;
|
|
50
51
|
description?: string;
|
|
52
|
+
streaming_supported?: boolean;
|
|
51
53
|
peer_card: TargetListPeerCardSummary;
|
|
52
54
|
last_refreshed_at?: string;
|
|
53
55
|
last_refresh_error?: ToolError;
|
|
@@ -77,7 +79,14 @@ export interface ConversationContinuationSummary {
|
|
|
77
79
|
context_id: string;
|
|
78
80
|
can_send: true;
|
|
79
81
|
}
|
|
82
|
+
export interface ContinuationTargetSummary {
|
|
83
|
+
target_url: string;
|
|
84
|
+
card_path: string;
|
|
85
|
+
preferred_transports: A2ATransport[];
|
|
86
|
+
target_alias?: string;
|
|
87
|
+
}
|
|
80
88
|
export interface RemoteAgentContinuationSummary {
|
|
89
|
+
target: ContinuationTargetSummary;
|
|
81
90
|
task?: TaskContinuationSummary;
|
|
82
91
|
conversation?: ConversationContinuationSummary;
|
|
83
92
|
}
|
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EAAE,OAAO,EACf,KAAK,EAAE,SAAS,GACf,eAAe,CAAC,OAAO,CAAC,CAO1B;AA0ED,wBAAgB,kBAAkB,CAChC,OAAO,EAAE,kBAAkB,EAAE,GAC5B,eAAe,CAAC,cAAc,CAAC,CAQjC;AAED,wBAAgB,WAAW,CACzB,MAAM,EAAE,cAAc,EACtB,GAAG,EAAE,OAAO,GAAG,IAAI,EACnB,OAAO,GAAE,kBAAuB,GAC/B,eAAe,CAAC,MAAM,CAAC,CAQzB;AAwBD,wBAAgB,iBAAiB,CAC/B,MAAM,EAAE,cAAc,EACtB,MAAM,EAAE,kBAAkB,EAAE,EAC5B,OAAO,GAAE,kBAAuB,GAC/B,eAAe,CAAC,MAAM,CAAC,CAEzB;AAED,wBAAgB,YAAY,CAC1B,MAAM,EAAE,cAAc,EACtB,MAAM,EAAE,kBAAkB,EAAE,EAC5B,OAAO,GAAE,kBAAuB,GAC/B,eAAe,CAAC,OAAO,CAAC,CAE1B;AAED,wBAAgB,aAAa,CAC3B,MAAM,EAAE,cAAc,EACtB,GAAG,EAAE,IAAI,EACT,OAAO,GAAE,kBAAuB,GAC/B,eAAe,CAAC,QAAQ,CAAC,CAE3B;AAED,wBAAgB,aAAa,CAC3B,MAAM,EAAE,cAAc,EACtB,GAAG,EAAE,IAAI,EACT,OAAO,GAAE,kBAAuB,GAC/B,eAAe,CAAC,QAAQ,CAAC,CAE3B;AAED,wBAAgB,YAAY,CAAC,OAAO,SAAS,eAAe,EAC1D,MAAM,EAAE,OAAO,EACf,MAAM,EAAE,cAAc,EACtB,GAAG,EAAE,kBAAkB,GAAG,SAAS,kBAAkB,EAAE,EACvD,OAAO,GAAE,kBAAuB,GAC/B,oBAAoB,CAAC,OAAO,CAAC,CAgB/B"}
|
package/dist/result-shape.js
CHANGED
|
@@ -63,6 +63,9 @@ function baseSummary(target) {
|
|
|
63
63
|
};
|
|
64
64
|
}
|
|
65
65
|
function continuationSummary(target, context) {
|
|
66
|
+
const streamingAvailabilityKnown = target.streamingSupported !== undefined;
|
|
67
|
+
const canWatch = context.taskId !== undefined &&
|
|
68
|
+
(streamingAvailabilityKnown ? target.streamingSupported !== false : true);
|
|
66
69
|
const task = context.taskId !== undefined
|
|
67
70
|
? {
|
|
68
71
|
task_id: context.taskId,
|
|
@@ -74,9 +77,7 @@ function continuationSummary(target, context) {
|
|
|
74
77
|
can_send: !isTerminalTaskStatus(context.status),
|
|
75
78
|
can_status: true,
|
|
76
79
|
can_cancel: !isTerminalTaskStatus(context.status),
|
|
77
|
-
can_watch:
|
|
78
|
-
!isTerminalTaskStatus(context.status) &&
|
|
79
|
-
target.streamingSupported === true,
|
|
80
|
+
can_watch: canWatch,
|
|
80
81
|
}
|
|
81
82
|
: undefined;
|
|
82
83
|
const conversation = context.contextId !== undefined
|
|
@@ -89,6 +90,12 @@ function continuationSummary(target, context) {
|
|
|
89
90
|
return undefined;
|
|
90
91
|
}
|
|
91
92
|
return {
|
|
93
|
+
target: {
|
|
94
|
+
target_url: target.baseUrl,
|
|
95
|
+
card_path: target.cardPath,
|
|
96
|
+
preferred_transports: [...target.preferredTransports],
|
|
97
|
+
...(target.alias !== undefined ? { target_alias: target.alias } : {}),
|
|
98
|
+
},
|
|
92
99
|
...(task !== undefined ? { task } : {}),
|
|
93
100
|
...(conversation !== undefined ? { conversation } : {}),
|
|
94
101
|
};
|
|
@@ -102,14 +109,15 @@ function withContinuationContext(target, summary, context) {
|
|
|
102
109
|
}
|
|
103
110
|
function messageSummary(target, raw, context = {}) {
|
|
104
111
|
const messageText = extractMessageText(raw);
|
|
112
|
+
const taskId = raw.taskId ?? context.taskId;
|
|
105
113
|
return withContinuationContext(target, {
|
|
106
114
|
...baseSummary(target),
|
|
107
115
|
response_kind: "message",
|
|
108
116
|
...(messageText !== undefined ? { message_text: messageText } : {}),
|
|
109
117
|
}, {
|
|
110
|
-
...(
|
|
118
|
+
...(taskId !== undefined ? { taskId } : {}),
|
|
111
119
|
contextId: raw.contextId ?? context.contextId,
|
|
112
|
-
...(
|
|
120
|
+
...(taskId !== undefined && context.taskHandle !== undefined
|
|
113
121
|
? { taskHandle: context.taskHandle }
|
|
114
122
|
: {}),
|
|
115
123
|
});
|
|
@@ -277,14 +285,15 @@ export function summarizeStreamEvents(target, events, context = {}) {
|
|
|
277
285
|
const responseKind = events.length === 1 && latestEvent.kind === "message"
|
|
278
286
|
? "message"
|
|
279
287
|
: undefined;
|
|
288
|
+
const taskId = latestEvent.taskId ?? context.taskId;
|
|
280
289
|
return withContinuationContext(target, {
|
|
281
290
|
...baseSummary(target),
|
|
282
291
|
...(responseKind !== undefined ? { response_kind: responseKind } : {}),
|
|
283
292
|
...(messageText !== undefined ? { message_text: messageText } : {}),
|
|
284
293
|
}, {
|
|
285
|
-
...(
|
|
294
|
+
...(taskId !== undefined ? { taskId } : {}),
|
|
286
295
|
contextId: latestEvent.contextId ?? context.contextId,
|
|
287
|
-
...(
|
|
296
|
+
...(taskId !== undefined && context.taskHandle !== undefined
|
|
288
297
|
? { taskHandle: context.taskHandle }
|
|
289
298
|
: {}),
|
|
290
299
|
});
|
|
@@ -396,6 +405,9 @@ function listTargetSummary(entry) {
|
|
|
396
405
|
...(entry.target.description !== undefined
|
|
397
406
|
? { description: entry.target.description }
|
|
398
407
|
: {}),
|
|
408
|
+
...(entry.target.streamingSupported !== undefined
|
|
409
|
+
? { streaming_supported: entry.target.streamingSupported }
|
|
410
|
+
: {}),
|
|
399
411
|
peer_card: peerCard,
|
|
400
412
|
...(entry.card.lastRefreshedAt !== undefined
|
|
401
413
|
? { last_refreshed_at: entry.card.lastRefreshedAt }
|