@mhome/conversation-protocol 4.3.0 → 5.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 CHANGED
@@ -55,11 +55,25 @@ data. The UI operates on that exact session. A status check returns its actual r
55
55
  only a new tool call can request further human interaction. Prepared approvals retain their
56
56
  business prepare/commit contract. Card state and responses are separate from model history.
57
57
 
58
+ A UserAction response may carry optional `clientReport` beside `actionId` and
59
+ `response`: `{ "warnings": [{ "code": "SYNC_PENDING", "message": "Sync pending" }] }`.
60
+ It is allowed with continue or cancel, never approve/reject. Warning code/message
61
+ must be nonblank, the list nonempty, and unknown report fields are rejected. No
62
+ report is required when the Operation observed no warning. This contains only
63
+ public client observations during the Operation; it is not proof of completion.
64
+ Business handlers still validate the input or read authoritative state. Runtime
65
+ adds the report to the final result only after execution: a framework-owned
66
+ `CLIENT_OPERATION_REPORT` warning on success/partial/cancelled, or
67
+ `error.details.clientReport` on error. The source is `frontend_operation` with
68
+ `verified: false`; neither status nor business data is overwritten. Reports are
69
+ private answer data until included, explicitly attributed, in the tool result.
70
+
58
71
  The Conversation backend accepts a nonempty subset of distinct known item answers, persists
59
72
  partial responses privately with their responder identities, and resumes Runtime only after
60
73
  all items are answered. Public `PendingInteraction.answeredActionIds` is required and carries
61
74
  only progress. Clients show the first unanswered item and advance after canonical acknowledgement.
62
- Identical retries by the same responder are idempotent; accepted answers cannot be edited.
75
+ Identical retries by the same responder are idempotent; accepted answers, including
76
+ their client reports, cannot be edited.
63
77
  Runtime's execution command still carries the complete batch. User actions may open a shared
64
78
  frontend Operation that performs its business writes before returning a safe result. The
65
79
  saved handler validates or reads that result rather than repeating the write.
@@ -0,0 +1,28 @@
1
+ {
2
+ "target": "/chat/interaction/answer",
3
+ "direction": "request",
4
+ "body": {
5
+ "requestId": "request-1",
6
+ "batchId": "batch-1",
7
+ "occurredAtUnixMs": 1787587200000,
8
+ "responses": [
9
+ {
10
+ "actionId": "action-1",
11
+ "response": {
12
+ "action": "continue",
13
+ "data": {
14
+ "spaceId": "space-demo"
15
+ }
16
+ },
17
+ "clientReport": {
18
+ "warnings": [
19
+ {
20
+ "code": "SYNC_PENDING",
21
+ "message": "Saved; synchronization is pending"
22
+ }
23
+ ]
24
+ }
25
+ }
26
+ ]
27
+ }
28
+ }
@@ -0,0 +1,27 @@
1
+ {
2
+ "target": "/chat/interaction/submit",
3
+ "direction": "request",
4
+ "body": {
5
+ "threadId": "thread-2",
6
+ "batchId": "batch-1",
7
+ "responses": [
8
+ {
9
+ "actionId": "action-1",
10
+ "response": {
11
+ "action": "continue",
12
+ "data": {
13
+ "spaceId": "space-demo"
14
+ }
15
+ },
16
+ "clientReport": {
17
+ "warnings": [
18
+ {
19
+ "code": "SYNC_PENDING",
20
+ "message": "Saved; synchronization is pending"
21
+ }
22
+ ]
23
+ }
24
+ }
25
+ ]
26
+ }
27
+ }
@@ -47,10 +47,9 @@
47
47
  }
48
48
  },
49
49
  {
50
- "name": "success empty text",
50
+ "name": "success empty string data",
51
51
  "value": {
52
52
  "status": "success",
53
- "text": "",
54
53
  "warnings": [
55
54
  {
56
55
  "code": "STALE",
@@ -59,14 +58,14 @@
59
58
  "source": "cloud"
60
59
  }
61
60
  }
62
- ]
61
+ ],
62
+ "data": ""
63
63
  }
64
64
  },
65
65
  {
66
- "name": "success YAML text",
66
+ "name": "success YAML string data",
67
67
  "value": {
68
68
  "status": "success",
69
- "text": "ids:\n- a\n",
70
69
  "warnings": [
71
70
  {
72
71
  "code": "STALE",
@@ -75,7 +74,8 @@
75
74
  "source": "cloud"
76
75
  }
77
76
  }
78
- ]
77
+ ],
78
+ "data": "ids:\n- a\n"
79
79
  }
80
80
  },
81
81
  {
@@ -137,10 +137,9 @@
137
137
  }
138
138
  },
139
139
  {
140
- "name": "partial empty text",
140
+ "name": "partial empty string data",
141
141
  "value": {
142
142
  "status": "partial",
143
- "text": "",
144
143
  "warnings": [
145
144
  {
146
145
  "code": "STALE",
@@ -149,14 +148,14 @@
149
148
  "source": "cloud"
150
149
  }
151
150
  }
152
- ]
151
+ ],
152
+ "data": ""
153
153
  }
154
154
  },
155
155
  {
156
- "name": "partial YAML text",
156
+ "name": "partial YAML string data",
157
157
  "value": {
158
158
  "status": "partial",
159
- "text": "ids:\n- a\n",
160
159
  "warnings": [
161
160
  {
162
161
  "code": "STALE",
@@ -165,7 +164,8 @@
165
164
  "source": "cloud"
166
165
  }
167
166
  }
168
- ]
167
+ ],
168
+ "data": "ids:\n- a\n"
169
169
  }
170
170
  },
171
171
  {
@@ -253,15 +253,38 @@
253
253
  "status": "cancelled",
254
254
  "warnings": []
255
255
  }
256
- }
257
- ],
258
- "invalid": [
256
+ },
259
257
  {
260
- "name": "success no content",
258
+ "name": "success acknowledgement",
261
259
  "value": {
262
260
  "status": "success"
263
261
  }
264
262
  },
263
+ {
264
+ "name": "success acknowledgement warnings",
265
+ "value": {
266
+ "status": "success",
267
+ "warnings": [
268
+ {
269
+ "code": "SYNC_PENDING",
270
+ "message": "Saved"
271
+ }
272
+ ]
273
+ }
274
+ },
275
+ {
276
+ "name": "essential error diagnostic data",
277
+ "value": {
278
+ "status": "error",
279
+ "error": {
280
+ "code": "BAD_REQUEST",
281
+ "message": "Invalid description"
282
+ },
283
+ "data": "status: error\nerror:\n code: BAD_REQUEST\n message: Invalid description\n"
284
+ }
285
+ }
286
+ ],
287
+ "invalid": [
265
288
  {
266
289
  "name": "success both contents",
267
290
  "value": {
@@ -544,6 +567,42 @@
544
567
  {
545
568
  "name": "null response",
546
569
  "value": null
570
+ },
571
+ {
572
+ "name": "success legacy text",
573
+ "value": {
574
+ "status": "success",
575
+ "text": "ids: []"
576
+ }
577
+ },
578
+ {
579
+ "name": "partial legacy text",
580
+ "value": {
581
+ "status": "partial",
582
+ "text": "ids: []"
583
+ }
584
+ },
585
+ {
586
+ "name": "error nonstring data",
587
+ "value": {
588
+ "status": "error",
589
+ "error": {
590
+ "code": "BAD_REQUEST",
591
+ "message": "Invalid"
592
+ },
593
+ "data": {}
594
+ }
595
+ },
596
+ {
597
+ "name": "error legacy text",
598
+ "value": {
599
+ "status": "error",
600
+ "error": {
601
+ "code": "BAD_REQUEST",
602
+ "message": "Invalid"
603
+ },
604
+ "text": "legacy"
605
+ }
547
606
  }
548
607
  ]
549
608
  }
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "manifest": "mhome.conversation.targets.v1",
3
- "contractVersion": "4.3.0",
3
+ "contractVersion": "5.0.0",
4
4
  "requestTargets": [
5
5
  "/chat/control/get",
6
6
  "/chat/thread/list",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mhome/conversation-protocol",
3
- "version": "4.3.0",
3
+ "version": "5.0.0",
4
4
  "description": "Build-time protocol artifacts for mhome.conversation",
5
5
  "license": "MIT",
6
6
  "repository": {
package/protocol.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "protocol": "mhome.conversation",
3
- "contractVersion": "4.3.0",
3
+ "contractVersion": "5.0.0",
4
4
  "manifest": "manifest/targets.v1.json",
5
5
  "schemas": {
6
6
  "frame": "schema/conversation-frame.v2.schema.json",
@@ -3059,6 +3059,56 @@
3059
3059
  }
3060
3060
  }
3061
3061
  ]
3062
+ },
3063
+ "clientReport": {
3064
+ "type": "object",
3065
+ "additionalProperties": false,
3066
+ "required": [
3067
+ "warnings"
3068
+ ],
3069
+ "properties": {
3070
+ "warnings": {
3071
+ "type": "array",
3072
+ "minItems": 1,
3073
+ "items": {
3074
+ "type": "object",
3075
+ "additionalProperties": false,
3076
+ "required": [
3077
+ "code",
3078
+ "message"
3079
+ ],
3080
+ "properties": {
3081
+ "code": {
3082
+ "type": "string",
3083
+ "minLength": 1,
3084
+ "pattern": "\\S"
3085
+ },
3086
+ "message": {
3087
+ "type": "string",
3088
+ "minLength": 1,
3089
+ "pattern": "\\S"
3090
+ }
3091
+ }
3092
+ }
3093
+ }
3094
+ }
3095
+ }
3096
+ },
3097
+ "dependentSchemas": {
3098
+ "clientReport": {
3099
+ "properties": {
3100
+ "response": {
3101
+ "type": "object",
3102
+ "properties": {
3103
+ "action": {
3104
+ "enum": [
3105
+ "continue",
3106
+ "cancel"
3107
+ ]
3108
+ }
3109
+ }
3110
+ }
3111
+ }
3062
3112
  }
3063
3113
  }
3064
3114
  }
@@ -2062,6 +2062,56 @@
2062
2062
  }
2063
2063
  }
2064
2064
  ]
2065
+ },
2066
+ "clientReport": {
2067
+ "type": "object",
2068
+ "additionalProperties": false,
2069
+ "required": [
2070
+ "warnings"
2071
+ ],
2072
+ "properties": {
2073
+ "warnings": {
2074
+ "type": "array",
2075
+ "minItems": 1,
2076
+ "items": {
2077
+ "type": "object",
2078
+ "additionalProperties": false,
2079
+ "required": [
2080
+ "code",
2081
+ "message"
2082
+ ],
2083
+ "properties": {
2084
+ "code": {
2085
+ "type": "string",
2086
+ "minLength": 1,
2087
+ "pattern": "\\S"
2088
+ },
2089
+ "message": {
2090
+ "type": "string",
2091
+ "minLength": 1,
2092
+ "pattern": "\\S"
2093
+ }
2094
+ }
2095
+ }
2096
+ }
2097
+ }
2098
+ }
2099
+ },
2100
+ "dependentSchemas": {
2101
+ "clientReport": {
2102
+ "properties": {
2103
+ "response": {
2104
+ "type": "object",
2105
+ "properties": {
2106
+ "action": {
2107
+ "enum": [
2108
+ "continue",
2109
+ "cancel"
2110
+ ]
2111
+ }
2112
+ }
2113
+ }
2114
+ }
2065
2115
  }
2066
2116
  }
2067
2117
  },
@@ -2079,74 +2129,33 @@
2079
2129
  "const": "success"
2080
2130
  },
2081
2131
  "data": true,
2082
- "text": {
2083
- "type": "string"
2084
- },
2085
2132
  "warnings": {
2086
2133
  "type": "array",
2087
2134
  "items": {
2088
2135
  "$ref": "#/$defs/facade_response/$defs/problem"
2089
2136
  }
2090
2137
  }
2091
- },
2092
- "oneOf": [
2093
- {
2094
- "required": [
2095
- "data"
2096
- ],
2097
- "properties": {
2098
- "data": true
2099
- }
2100
- },
2101
- {
2102
- "required": [
2103
- "text"
2104
- ],
2105
- "properties": {
2106
- "text": true
2107
- }
2108
- }
2109
- ]
2138
+ }
2110
2139
  },
2111
2140
  {
2112
2141
  "type": "object",
2113
2142
  "additionalProperties": false,
2114
2143
  "required": [
2115
- "status"
2144
+ "status",
2145
+ "data"
2116
2146
  ],
2117
2147
  "properties": {
2118
2148
  "status": {
2119
2149
  "const": "partial"
2120
2150
  },
2121
2151
  "data": true,
2122
- "text": {
2123
- "type": "string"
2124
- },
2125
2152
  "warnings": {
2126
2153
  "type": "array",
2127
2154
  "items": {
2128
2155
  "$ref": "#/$defs/facade_response/$defs/problem"
2129
2156
  }
2130
2157
  }
2131
- },
2132
- "oneOf": [
2133
- {
2134
- "required": [
2135
- "data"
2136
- ],
2137
- "properties": {
2138
- "data": true
2139
- }
2140
- },
2141
- {
2142
- "required": [
2143
- "text"
2144
- ],
2145
- "properties": {
2146
- "text": true
2147
- }
2148
- }
2149
- ]
2158
+ }
2150
2159
  },
2151
2160
  {
2152
2161
  "type": "object",
@@ -2161,6 +2170,9 @@
2161
2170
  },
2162
2171
  "error": {
2163
2172
  "$ref": "#/$defs/facade_response/$defs/problem"
2173
+ },
2174
+ "data": {
2175
+ "type": "string"
2164
2176
  }
2165
2177
  }
2166
2178
  },