@mhome/conversation-protocol 3.16.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 +11 -8
- package/fixtures/execution/app-facade-prepared.v1.json +12 -25
- package/fixtures/execution/interaction-required-event.v1.json +19 -21
- package/fixtures/execution/user-action-required-event.v1.json +85 -0
- package/fixtures/interaction-answer.request.json +9 -4
- package/fixtures/interaction.event.json +12 -6
- package/fixtures/interaction.request.json +7 -2
- package/manifest/targets.v1.json +1 -1
- package/package.json +1 -1
- package/protocol.json +1 -1
- package/schema/conversation-frame.v2.schema.json +253 -216
- package/schema/execution/envelope.v1.schema.json +276 -187
- package/fixtures/execution/app-facade-user-action.v1.json +0 -50
package/README.md
CHANGED
|
@@ -40,12 +40,15 @@ Model data is re-exported from `llm-api`; there is one model-message representat
|
|
|
40
40
|
messages intentionally use separate content types and never contain private model continuation.
|
|
41
41
|
Runtime state machines, checkpoint formats, prompts and recovery policy remain in Agent Runtime.
|
|
42
42
|
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
43
|
+
HITL items share one public card contract: `kind` selects approval or user action; `card.type`
|
|
44
|
+
selects trusted frontend presentation and `card.data` retains structured business data. Approval
|
|
45
|
+
responses use approve/reject. User-action responses use continue with required `data` (null when
|
|
46
|
+
no input is needed), or cancel. Public and execution requests carry the same typed `responses`.
|
|
47
|
+
A saved tool handler produces one final result after acceptance; `FacadeResult` cannot suspend.
|
|
48
|
+
Integration connection cards use `integration.connect` with `integrationId` and `sessionId` in
|
|
49
|
+
data. The UI operates on that exact session. A status check returns its actual result once;
|
|
50
|
+
only a new tool call can request further human interaction. Prepared approvals retain their
|
|
51
|
+
business prepare/commit contract. Card state and responses are separate from model history.
|
|
49
52
|
|
|
50
53
|
`RunErrorCode` is the closed catalog for `runOutcome.errorCode` and Agent `Failed.code`. Host
|
|
51
54
|
terminalize and Agent failures emit the same strings. `status` and `failure.source` are properties
|
|
@@ -66,7 +69,7 @@ adopted by Lion and Cloud together before deployment.
|
|
|
66
69
|
|
|
67
70
|
### Strict execution envelope decoding
|
|
68
71
|
|
|
69
|
-
Execution commands, events, facade responses and their typed nested objects reject undeclared fields, including null-valued unknown fields. Opaque JSON inputs/results and model continuation payloads remain extensible; known optional null fields remain accepted. Enforcement lives on the typed DTOs as well as the wire entry point because Serde's internally tagged enum buffering bypasses an outer `serde_ignored` observer. Tagged unit variants explicitly require an empty remaining map.
|
|
72
|
+
Execution commands, events, facade responses and their typed nested objects reject undeclared fields, including null-valued unknown fields. Opaque JSON inputs/results and model continuation payloads remain extensible; known optional null fields remain accepted. Enforcement lives on the typed DTOs as well as the wire entry point because Serde's internally tagged enum buffering bypasses an outer `serde_ignored` observer. Tagged unit variants explicitly require an empty remaining map. The enclosing wire envelope retains version 1; callers must adopt the current package contract together.
|
|
70
73
|
|
|
71
74
|
## Disposable execution presentation
|
|
72
75
|
|
|
@@ -141,7 +144,7 @@ settlement; archived-thread results never replace a different active view.
|
|
|
141
144
|
Reply offsets count UTF-8 bytes in the immutable plain text identified by
|
|
142
145
|
`contentRevision`. A single bounded window includes explicit next/previous
|
|
143
146
|
offsets. Pending previews mark omissions and prohibit approving incomplete
|
|
144
|
-
|
|
147
|
+
cards or unsupported user actions. Spoken responses target the original
|
|
145
148
|
thread, request and batch, with a second validation before canonical submission.
|
|
146
149
|
|
|
147
150
|
The complete escaped MWS frame is limited to 64 KiB, changed notifications to
|
|
@@ -17,35 +17,22 @@
|
|
|
17
17
|
"action": {
|
|
18
18
|
"action_id": "action-1",
|
|
19
19
|
"operation_id": "run-1:step:0:tool:call-1",
|
|
20
|
-
"preview": {
|
|
21
|
-
"actionCode": "device.power.update",
|
|
22
|
-
"title": "Turn on device",
|
|
23
|
-
"message": "Turn on the kitchen light.",
|
|
24
|
-
"tone": "normal",
|
|
25
|
-
"details": [
|
|
26
|
-
{
|
|
27
|
-
"label": "Device",
|
|
28
|
-
"value": {
|
|
29
|
-
"type": "text",
|
|
30
|
-
"text": "Kitchen light"
|
|
31
|
-
}
|
|
32
|
-
},
|
|
33
|
-
{
|
|
34
|
-
"label": "Power",
|
|
35
|
-
"value": {
|
|
36
|
-
"type": "bool",
|
|
37
|
-
"value": true
|
|
38
|
-
}
|
|
39
|
-
}
|
|
40
|
-
],
|
|
41
|
-
"proceedLabel": "Continue",
|
|
42
|
-
"rejectLabel": "Cancel"
|
|
43
|
-
},
|
|
44
20
|
"payload": {
|
|
45
21
|
"target": "/app/capability/invoke"
|
|
46
22
|
},
|
|
47
23
|
"revision": 7,
|
|
48
|
-
"
|
|
24
|
+
"card": {
|
|
25
|
+
"type": "device.power.update",
|
|
26
|
+
"title": "Turn on device",
|
|
27
|
+
"message": "Turn on the kitchen light.",
|
|
28
|
+
"tone": "normal",
|
|
29
|
+
"continueLabel": "Continue",
|
|
30
|
+
"cancelLabel": "Cancel",
|
|
31
|
+
"data": {
|
|
32
|
+
"Device": "Kitchen light",
|
|
33
|
+
"Power": true
|
|
34
|
+
}
|
|
35
|
+
}
|
|
49
36
|
}
|
|
50
37
|
}
|
|
51
38
|
}
|
|
@@ -39,26 +39,6 @@
|
|
|
39
39
|
"event": {
|
|
40
40
|
"type": "interaction_required",
|
|
41
41
|
"batch_id": "batch-1",
|
|
42
|
-
"actions": [
|
|
43
|
-
{
|
|
44
|
-
"action_id": "action-1",
|
|
45
|
-
"operation_id": "operation-1",
|
|
46
|
-
"preview": {
|
|
47
|
-
"actionCode": "dashboard.canvas.delete",
|
|
48
|
-
"title": "Delete canvas",
|
|
49
|
-
"message": "Delete this canvas?",
|
|
50
|
-
"tone": "danger",
|
|
51
|
-
"details": [],
|
|
52
|
-
"proceedLabel": "Delete",
|
|
53
|
-
"rejectLabel": "Cancel"
|
|
54
|
-
},
|
|
55
|
-
"payload": {
|
|
56
|
-
"canvasId": "canvas-1"
|
|
57
|
-
},
|
|
58
|
-
"revision": 1,
|
|
59
|
-
"interaction_kind": "approval"
|
|
60
|
-
}
|
|
61
|
-
],
|
|
62
42
|
"usage": {
|
|
63
43
|
"model_requests": 2,
|
|
64
44
|
"reported_model_requests": 2,
|
|
@@ -71,7 +51,25 @@
|
|
|
71
51
|
"tool_calls": 1,
|
|
72
52
|
"window_truncations": 0,
|
|
73
53
|
"trimmed_messages": 0
|
|
74
|
-
}
|
|
54
|
+
},
|
|
55
|
+
"items": [
|
|
56
|
+
{
|
|
57
|
+
"item": {
|
|
58
|
+
"actionId": "action-1",
|
|
59
|
+
"kind": "approval",
|
|
60
|
+
"card": {
|
|
61
|
+
"type": "dashboard.canvas.delete",
|
|
62
|
+
"title": "Delete canvas",
|
|
63
|
+
"message": "Delete this canvas?",
|
|
64
|
+
"tone": "danger",
|
|
65
|
+
"continueLabel": "Delete",
|
|
66
|
+
"cancelLabel": "Cancel",
|
|
67
|
+
"data": {}
|
|
68
|
+
}
|
|
69
|
+
},
|
|
70
|
+
"prepared_action_id": "action-1"
|
|
71
|
+
}
|
|
72
|
+
]
|
|
75
73
|
}
|
|
76
74
|
},
|
|
77
75
|
"checkpoint": {
|
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
{
|
|
2
|
+
"metadata": {
|
|
3
|
+
"version": 1,
|
|
4
|
+
"message_id": "message-2",
|
|
5
|
+
"correlation_id": "correlation-1",
|
|
6
|
+
"causation_id": "message-1",
|
|
7
|
+
"sent_at_unix_ms": 1700000001000,
|
|
8
|
+
"dispatch": {
|
|
9
|
+
"dispatch_id": "dispatch-1",
|
|
10
|
+
"agent_session_id": "agent-session-1"
|
|
11
|
+
}
|
|
12
|
+
},
|
|
13
|
+
"payload": {
|
|
14
|
+
"family": "event",
|
|
15
|
+
"payload": {
|
|
16
|
+
"event": {
|
|
17
|
+
"id": "event-1",
|
|
18
|
+
"sequence": 2,
|
|
19
|
+
"context": {
|
|
20
|
+
"scope": {
|
|
21
|
+
"tenant_id": "tenant-1",
|
|
22
|
+
"scope_id": "scope-1"
|
|
23
|
+
},
|
|
24
|
+
"actor": {
|
|
25
|
+
"principal": {
|
|
26
|
+
"kind": "user",
|
|
27
|
+
"userId": "user-1"
|
|
28
|
+
},
|
|
29
|
+
"client_id": "client-1",
|
|
30
|
+
"credential_id": null
|
|
31
|
+
},
|
|
32
|
+
"thread_id": "thread-1",
|
|
33
|
+
"run_id": "run-1",
|
|
34
|
+
"operation_id": "operation-1",
|
|
35
|
+
"deadline_unix_ms": null,
|
|
36
|
+
"traceparent": null,
|
|
37
|
+
"surface_id": "cs1:cp:dXNlci0x"
|
|
38
|
+
},
|
|
39
|
+
"event": {
|
|
40
|
+
"type": "interaction_required",
|
|
41
|
+
"batch_id": "batch-1",
|
|
42
|
+
"usage": {
|
|
43
|
+
"model_requests": 2,
|
|
44
|
+
"reported_model_requests": 2,
|
|
45
|
+
"input_tokens": 30,
|
|
46
|
+
"output_tokens": 6,
|
|
47
|
+
"cached_input_tokens": null,
|
|
48
|
+
"reasoning_output_tokens": null,
|
|
49
|
+
"peak_input_tokens": 20,
|
|
50
|
+
"credits": 3,
|
|
51
|
+
"tool_calls": 1,
|
|
52
|
+
"window_truncations": 0,
|
|
53
|
+
"trimmed_messages": 0
|
|
54
|
+
},
|
|
55
|
+
"items": [
|
|
56
|
+
{
|
|
57
|
+
"item": {
|
|
58
|
+
"actionId": "action-1",
|
|
59
|
+
"kind": "user_action",
|
|
60
|
+
"card": {
|
|
61
|
+
"type": "integration.connect",
|
|
62
|
+
"title": "Connect Integration",
|
|
63
|
+
"message": "Complete this connection.",
|
|
64
|
+
"tone": "normal",
|
|
65
|
+
"continueLabel": "Done",
|
|
66
|
+
"cancelLabel": "Cancel",
|
|
67
|
+
"data": {
|
|
68
|
+
"integrationId": "provider.example",
|
|
69
|
+
"sessionId": "connection-session"
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
},
|
|
73
|
+
"prepared_action_id": null
|
|
74
|
+
}
|
|
75
|
+
]
|
|
76
|
+
}
|
|
77
|
+
},
|
|
78
|
+
"checkpoint": {
|
|
79
|
+
"object_key": "checkpoints/abc.json",
|
|
80
|
+
"sha256": "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
|
|
81
|
+
"format_version": 1
|
|
82
|
+
}
|
|
83
|
+
}
|
|
84
|
+
}
|
|
85
|
+
}
|
|
@@ -4,9 +4,14 @@
|
|
|
4
4
|
"body": {
|
|
5
5
|
"requestId": "request-1",
|
|
6
6
|
"batchId": "batch-1",
|
|
7
|
-
"
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
7
|
+
"occurredAtUnixMs": 1787587200000,
|
|
8
|
+
"responses": [
|
|
9
|
+
{
|
|
10
|
+
"actionId": "action-1",
|
|
11
|
+
"response": {
|
|
12
|
+
"action": "approve"
|
|
13
|
+
}
|
|
14
|
+
}
|
|
15
|
+
]
|
|
11
16
|
}
|
|
12
17
|
}
|
|
@@ -21,19 +21,25 @@
|
|
|
21
21
|
{
|
|
22
22
|
"actionId": "action-1",
|
|
23
23
|
"kind": "approval",
|
|
24
|
-
"
|
|
25
|
-
"
|
|
24
|
+
"card": {
|
|
25
|
+
"type": "room.delete",
|
|
26
26
|
"title": "Delete room",
|
|
27
27
|
"message": "Delete room Kitchen",
|
|
28
28
|
"tone": "danger",
|
|
29
|
-
"
|
|
30
|
-
"
|
|
31
|
-
"
|
|
29
|
+
"continueLabel": "Delete",
|
|
30
|
+
"cancelLabel": "Cancel",
|
|
31
|
+
"data": {
|
|
32
|
+
"Room": "Kitchen"
|
|
33
|
+
}
|
|
32
34
|
}
|
|
33
35
|
}
|
|
34
36
|
]
|
|
35
37
|
},
|
|
36
|
-
"runOutcome": {
|
|
38
|
+
"runOutcome": {
|
|
39
|
+
"requestId": "request-1",
|
|
40
|
+
"status": "interaction_required",
|
|
41
|
+
"failure": null
|
|
42
|
+
}
|
|
37
43
|
}
|
|
38
44
|
}
|
|
39
45
|
}
|
package/manifest/targets.v1.json
CHANGED
package/package.json
CHANGED