@mhome/conversation-protocol 3.3.0 → 3.6.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 (31) hide show
  1. package/README.md +20 -0
  2. package/fixtures/control-get.request.json +5 -0
  3. package/fixtures/control-get.response.json +24 -0
  4. package/fixtures/control.event.json +28 -0
  5. package/fixtures/enqueue.response.json +25 -3
  6. package/fixtures/execution/enqueue.v1.json +30 -278
  7. package/fixtures/execution/observation.v1.json +3 -3
  8. package/fixtures/interaction-answer.response.json +25 -3
  9. package/fixtures/interaction.response.json +24 -2
  10. package/fixtures/live.event.json +4 -2
  11. package/fixtures/progress-planning.event.json +4 -2
  12. package/fixtures/progress-thinking.event.json +4 -2
  13. package/fixtures/progress-tool-scheduled.event.json +8 -2
  14. package/fixtures/progress-tool-started.event.json +5 -2
  15. package/fixtures/progress-waiting.event.json +4 -2
  16. package/fixtures/queue-reorder.response.json +24 -2
  17. package/fixtures/request-cancel-waiting.response.json +26 -4
  18. package/fixtures/request-cancel.response.json +26 -4
  19. package/fixtures/session-start.response.json +39 -9
  20. package/fixtures/system-failed.event.json +5 -2
  21. package/fixtures/thread-archive.response.json +36 -5
  22. package/fixtures/thread-create.response.json +35 -5
  23. package/fixtures/thread-load.response.json +26 -5
  24. package/fixtures/thread-rotate.response.json +45 -6
  25. package/fixtures/turn-submit-waiting.response.json +28 -6
  26. package/fixtures/turn-submit.response.json +27 -5
  27. package/manifest/targets.v1.json +2 -1
  28. package/package.json +1 -1
  29. package/protocol.json +1 -1
  30. package/schema/conversation-frame.v2.schema.json +440 -157
  31. package/schema/execution/envelope.v1.schema.json +8 -27
@@ -842,7 +842,7 @@
842
842
  "threadId",
843
843
  "requestId",
844
844
  "baseSnapshotVersion",
845
- "offset",
845
+ "sequence",
846
846
  "occurredAt",
847
847
  "data"
848
848
  ],
@@ -863,10 +863,6 @@
863
863
  "type": "integer",
864
864
  "minimum": 0
865
865
  },
866
- "offset": {
867
- "type": "integer",
868
- "minimum": 1
869
- },
870
866
  "occurredAt": {
871
867
  "$ref": "#/$defs/time"
872
868
  },
@@ -874,17 +870,18 @@
874
870
  "type": "object",
875
871
  "additionalProperties": false,
876
872
  "required": [
877
- "text",
878
- "append"
873
+ "text"
879
874
  ],
880
875
  "properties": {
881
876
  "text": {
882
- "type": "string"
883
- },
884
- "append": {
885
- "type": "boolean"
877
+ "type": "string",
878
+ "maxLength": 8192
886
879
  }
887
880
  }
881
+ },
882
+ "sequence": {
883
+ "type": "integer",
884
+ "minimum": 1
888
885
  }
889
886
  }
890
887
  },
@@ -973,7 +970,7 @@
973
970
  "threadId",
974
971
  "requestId",
975
972
  "baseSnapshotVersion",
976
- "offset",
973
+ "sequence",
977
974
  "occurredAt",
978
975
  "data"
979
976
  ],
@@ -994,15 +991,15 @@
994
991
  "type": "integer",
995
992
  "minimum": 0
996
993
  },
997
- "offset": {
998
- "type": "integer",
999
- "minimum": 1
1000
- },
1001
994
  "occurredAt": {
1002
995
  "$ref": "#/$defs/time"
1003
996
  },
1004
997
  "data": {
1005
998
  "$ref": "#/$defs/runProgressData"
999
+ },
1000
+ "sequence": {
1001
+ "type": "integer",
1002
+ "minimum": 1
1006
1003
  }
1007
1004
  }
1008
1005
  },
@@ -1015,7 +1012,7 @@
1015
1012
  "threadId",
1016
1013
  "requestId",
1017
1014
  "baseSnapshotVersion",
1018
- "offset",
1015
+ "sequence",
1019
1016
  "occurredAt",
1020
1017
  "data"
1021
1018
  ],
@@ -1036,10 +1033,6 @@
1036
1033
  "type": "integer",
1037
1034
  "minimum": 0
1038
1035
  },
1039
- "offset": {
1040
- "type": "integer",
1041
- "minimum": 1
1042
- },
1043
1036
  "occurredAt": {
1044
1037
  "$ref": "#/$defs/time"
1045
1038
  },
@@ -1058,6 +1051,10 @@
1058
1051
  "type": "string"
1059
1052
  }
1060
1053
  }
1054
+ },
1055
+ "sequence": {
1056
+ "type": "integer",
1057
+ "minimum": 1
1061
1058
  }
1062
1059
  }
1063
1060
  },
@@ -1074,31 +1071,6 @@
1074
1071
  }
1075
1072
  ]
1076
1073
  },
1077
- "live": {
1078
- "type": "object",
1079
- "additionalProperties": false,
1080
- "required": [
1081
- "baseSnapshotVersion",
1082
- "lastOffset",
1083
- "events"
1084
- ],
1085
- "properties": {
1086
- "baseSnapshotVersion": {
1087
- "type": "integer",
1088
- "minimum": 0
1089
- },
1090
- "lastOffset": {
1091
- "type": "integer",
1092
- "minimum": 0
1093
- },
1094
- "events": {
1095
- "type": "array",
1096
- "items": {
1097
- "$ref": "#/$defs/liveEvent"
1098
- }
1099
- }
1100
- }
1101
- },
1102
1074
  "threadSession": {
1103
1075
  "type": "object",
1104
1076
  "additionalProperties": false,
@@ -1184,7 +1156,6 @@
1184
1156
  "thread",
1185
1157
  "session",
1186
1158
  "sync",
1187
- "live",
1188
1159
  "queue"
1189
1160
  ],
1190
1161
  "properties": {
@@ -1197,9 +1168,6 @@
1197
1168
  "sync": {
1198
1169
  "$ref": "#/$defs/threadSync"
1199
1170
  },
1200
- "live": {
1201
- "$ref": "#/$defs/live"
1202
- },
1203
1171
  "queue": {
1204
1172
  "$ref": "#/$defs/queue"
1205
1173
  }
@@ -1595,6 +1563,15 @@
1595
1563
  },
1596
1564
  {
1597
1565
  "$ref": "#/$defs/debugEventFrame"
1566
+ },
1567
+ {
1568
+ "$ref": "#/$defs/controlRequest"
1569
+ },
1570
+ {
1571
+ "$ref": "#/$defs/controlResponse"
1572
+ },
1573
+ {
1574
+ "$ref": "#/$defs/catalogCommandResponse"
1598
1575
  }
1599
1576
  ]
1600
1577
  },
@@ -2058,12 +2035,7 @@
2058
2035
  ],
2059
2036
  "properties": {
2060
2037
  "target": {
2061
- "enum": [
2062
- "/chat/thread/list",
2063
- "/chat/thread/create",
2064
- "/chat/thread/archive",
2065
- "/chat/thread/rotate"
2066
- ]
2038
+ "const": "/chat/thread/list"
2067
2039
  },
2068
2040
  "direction": {
2069
2041
  "const": "response"
@@ -2112,25 +2084,46 @@
2112
2084
  "type": "object",
2113
2085
  "additionalProperties": false,
2114
2086
  "required": [
2115
- "requestId",
2116
- "disposition"
2087
+ "receipt",
2088
+ "control"
2117
2089
  ],
2118
2090
  "properties": {
2119
- "requestId": {
2120
- "$ref": "#/$defs/id"
2091
+ "receipt": {
2092
+ "type": "object",
2093
+ "additionalProperties": false,
2094
+ "required": [
2095
+ "requestId",
2096
+ "disposition"
2097
+ ],
2098
+ "properties": {
2099
+ "requestId": {
2100
+ "$ref": "#/$defs/id"
2101
+ },
2102
+ "disposition": {
2103
+ "enum": [
2104
+ "scheduled",
2105
+ "queued",
2106
+ "duplicate"
2107
+ ]
2108
+ },
2109
+ "queueVersion": {
2110
+ "type": "integer",
2111
+ "minimum": 0
2112
+ },
2113
+ "admission": {
2114
+ "$ref": "#/$defs/requestAdmission"
2115
+ }
2116
+ }
2121
2117
  },
2122
- "disposition": {
2123
- "enum": [
2124
- "queued",
2125
- "duplicate"
2118
+ "control": {
2119
+ "oneOf": [
2120
+ {
2121
+ "$ref": "#/$defs/control"
2122
+ },
2123
+ {
2124
+ "type": "null"
2125
+ }
2126
2126
  ]
2127
- },
2128
- "queueVersion": {
2129
- "type": "integer",
2130
- "minimum": 0
2131
- },
2132
- "admission": {
2133
- "$ref": "#/$defs/requestAdmission"
2134
2127
  }
2135
2128
  }
2136
2129
  }
@@ -2155,36 +2148,57 @@
2155
2148
  "type": "object",
2156
2149
  "additionalProperties": false,
2157
2150
  "required": [
2158
- "requestId",
2159
- "disposition"
2151
+ "receipt",
2152
+ "control"
2160
2153
  ],
2161
2154
  "properties": {
2162
- "requestId": {
2163
- "$ref": "#/$defs/id"
2164
- },
2165
- "threadId": {
2166
- "$ref": "#/$defs/id"
2167
- },
2168
- "disposition": {
2169
- "enum": [
2170
- "queued",
2171
- "duplicate",
2172
- "blocked_pending_interaction"
2173
- ]
2155
+ "receipt": {
2156
+ "type": "object",
2157
+ "additionalProperties": false,
2158
+ "required": [
2159
+ "requestId",
2160
+ "disposition"
2161
+ ],
2162
+ "properties": {
2163
+ "requestId": {
2164
+ "$ref": "#/$defs/id"
2165
+ },
2166
+ "threadId": {
2167
+ "$ref": "#/$defs/id"
2168
+ },
2169
+ "disposition": {
2170
+ "enum": [
2171
+ "scheduled",
2172
+ "queued",
2173
+ "duplicate",
2174
+ "blocked_pending_interaction"
2175
+ ]
2176
+ },
2177
+ "sessionDisposition": {
2178
+ "enum": [
2179
+ "existing",
2180
+ "created",
2181
+ "rotated_idle_timeout"
2182
+ ]
2183
+ },
2184
+ "queueVersion": {
2185
+ "type": "integer",
2186
+ "minimum": 0
2187
+ },
2188
+ "admission": {
2189
+ "$ref": "#/$defs/requestAdmission"
2190
+ }
2191
+ }
2174
2192
  },
2175
- "sessionDisposition": {
2176
- "enum": [
2177
- "existing",
2178
- "created",
2179
- "rotated_idle_timeout"
2193
+ "control": {
2194
+ "oneOf": [
2195
+ {
2196
+ "$ref": "#/$defs/control"
2197
+ },
2198
+ {
2199
+ "type": "null"
2200
+ }
2180
2201
  ]
2181
- },
2182
- "queueVersion": {
2183
- "type": "integer",
2184
- "minimum": 0
2185
- },
2186
- "admission": {
2187
- "$ref": "#/$defs/requestAdmission"
2188
2202
  }
2189
2203
  }
2190
2204
  }
@@ -2206,7 +2220,27 @@
2206
2220
  "const": "response"
2207
2221
  },
2208
2222
  "body": {
2209
- "$ref": "#/$defs/queue"
2223
+ "type": "object",
2224
+ "additionalProperties": false,
2225
+ "required": [
2226
+ "receipt",
2227
+ "control"
2228
+ ],
2229
+ "properties": {
2230
+ "receipt": {
2231
+ "$ref": "#/$defs/queue"
2232
+ },
2233
+ "control": {
2234
+ "oneOf": [
2235
+ {
2236
+ "$ref": "#/$defs/control"
2237
+ },
2238
+ {
2239
+ "type": "null"
2240
+ }
2241
+ ]
2242
+ }
2243
+ }
2210
2244
  }
2211
2245
  }
2212
2246
  },
@@ -2229,34 +2263,54 @@
2229
2263
  "type": "object",
2230
2264
  "additionalProperties": false,
2231
2265
  "required": [
2232
- "requestId",
2233
- "phase",
2234
- "outcome"
2266
+ "receipt",
2267
+ "control"
2235
2268
  ],
2236
2269
  "properties": {
2237
- "requestId": {
2238
- "$ref": "#/$defs/id"
2239
- },
2240
- "phase": {
2241
- "enum": [
2242
- "admission_waiting",
2243
- "waiting",
2244
- "running"
2245
- ]
2270
+ "receipt": {
2271
+ "type": "object",
2272
+ "additionalProperties": false,
2273
+ "required": [
2274
+ "requestId",
2275
+ "phase",
2276
+ "outcome"
2277
+ ],
2278
+ "properties": {
2279
+ "requestId": {
2280
+ "$ref": "#/$defs/id"
2281
+ },
2282
+ "phase": {
2283
+ "enum": [
2284
+ "admission_waiting",
2285
+ "waiting",
2286
+ "running"
2287
+ ]
2288
+ },
2289
+ "outcome": {
2290
+ "enum": [
2291
+ "cancelled",
2292
+ "cancelling"
2293
+ ]
2294
+ },
2295
+ "queueVersion": {
2296
+ "type": "integer",
2297
+ "minimum": 0
2298
+ },
2299
+ "admissionVersion": {
2300
+ "type": "integer",
2301
+ "minimum": 0
2302
+ }
2303
+ }
2246
2304
  },
2247
- "outcome": {
2248
- "enum": [
2249
- "cancelled",
2250
- "cancelling"
2305
+ "control": {
2306
+ "oneOf": [
2307
+ {
2308
+ "$ref": "#/$defs/control"
2309
+ },
2310
+ {
2311
+ "type": "null"
2312
+ }
2251
2313
  ]
2252
- },
2253
- "queueVersion": {
2254
- "type": "integer",
2255
- "minimum": 0
2256
- },
2257
- "admissionVersion": {
2258
- "type": "integer",
2259
- "minimum": 0
2260
2314
  }
2261
2315
  }
2262
2316
  }
@@ -2281,15 +2335,35 @@
2281
2335
  "type": "object",
2282
2336
  "additionalProperties": false,
2283
2337
  "required": [
2284
- "requestId",
2285
- "disposition"
2338
+ "receipt",
2339
+ "control"
2286
2340
  ],
2287
2341
  "properties": {
2288
- "requestId": {
2289
- "$ref": "#/$defs/id"
2342
+ "receipt": {
2343
+ "type": "object",
2344
+ "additionalProperties": false,
2345
+ "required": [
2346
+ "requestId",
2347
+ "disposition"
2348
+ ],
2349
+ "properties": {
2350
+ "requestId": {
2351
+ "$ref": "#/$defs/id"
2352
+ },
2353
+ "disposition": {
2354
+ "const": "accepted"
2355
+ }
2356
+ }
2290
2357
  },
2291
- "disposition": {
2292
- "const": "accepted"
2358
+ "control": {
2359
+ "oneOf": [
2360
+ {
2361
+ "$ref": "#/$defs/control"
2362
+ },
2363
+ {
2364
+ "type": "null"
2365
+ }
2366
+ ]
2293
2367
  }
2294
2368
  }
2295
2369
  }
@@ -2329,6 +2403,9 @@
2329
2403
  },
2330
2404
  {
2331
2405
  "$ref": "#/$defs/liveEvent"
2406
+ },
2407
+ {
2408
+ "$ref": "#/$defs/controlEvent"
2332
2409
  }
2333
2410
  ]
2334
2411
  }
@@ -2406,26 +2483,46 @@
2406
2483
  "type": "object",
2407
2484
  "additionalProperties": false,
2408
2485
  "required": [
2409
- "operationId",
2410
- "threadId",
2411
- "disposition",
2412
- "catalog"
2486
+ "receipt",
2487
+ "control"
2413
2488
  ],
2414
2489
  "properties": {
2415
- "operationId": {
2416
- "$ref": "#/$defs/id"
2417
- },
2418
- "threadId": {
2419
- "$ref": "#/$defs/id"
2490
+ "receipt": {
2491
+ "type": "object",
2492
+ "additionalProperties": false,
2493
+ "required": [
2494
+ "operationId",
2495
+ "threadId",
2496
+ "disposition",
2497
+ "catalog"
2498
+ ],
2499
+ "properties": {
2500
+ "operationId": {
2501
+ "$ref": "#/$defs/id"
2502
+ },
2503
+ "threadId": {
2504
+ "$ref": "#/$defs/id"
2505
+ },
2506
+ "disposition": {
2507
+ "enum": [
2508
+ "rotated",
2509
+ "already_applied"
2510
+ ]
2511
+ },
2512
+ "catalog": {
2513
+ "$ref": "#/$defs/catalog"
2514
+ }
2515
+ }
2420
2516
  },
2421
- "disposition": {
2422
- "enum": [
2423
- "rotated",
2424
- "already_applied"
2517
+ "control": {
2518
+ "oneOf": [
2519
+ {
2520
+ "$ref": "#/$defs/control"
2521
+ },
2522
+ {
2523
+ "type": "null"
2524
+ }
2425
2525
  ]
2426
- },
2427
- "catalog": {
2428
- "$ref": "#/$defs/catalog"
2429
2526
  }
2430
2527
  }
2431
2528
  }
@@ -2512,23 +2609,209 @@
2512
2609
  "type": "object",
2513
2610
  "additionalProperties": false,
2514
2611
  "required": [
2515
- "requestId",
2516
- "threadId",
2517
- "disposition"
2612
+ "receipt",
2613
+ "control"
2518
2614
  ],
2519
2615
  "properties": {
2520
- "requestId": {
2521
- "$ref": "#/$defs/id"
2616
+ "receipt": {
2617
+ "type": "object",
2618
+ "additionalProperties": false,
2619
+ "required": [
2620
+ "requestId",
2621
+ "threadId",
2622
+ "disposition"
2623
+ ],
2624
+ "properties": {
2625
+ "requestId": {
2626
+ "$ref": "#/$defs/id"
2627
+ },
2628
+ "threadId": {
2629
+ "$ref": "#/$defs/id"
2630
+ },
2631
+ "disposition": {
2632
+ "enum": [
2633
+ "accepted",
2634
+ "duplicate",
2635
+ "unavailable",
2636
+ "expired_session"
2637
+ ]
2638
+ }
2639
+ }
2522
2640
  },
2523
- "threadId": {
2524
- "$ref": "#/$defs/id"
2641
+ "control": {
2642
+ "oneOf": [
2643
+ {
2644
+ "$ref": "#/$defs/control"
2645
+ },
2646
+ {
2647
+ "type": "null"
2648
+ }
2649
+ ]
2650
+ }
2651
+ }
2652
+ }
2653
+ }
2654
+ },
2655
+ "control": {
2656
+ "type": "object",
2657
+ "additionalProperties": false,
2658
+ "required": [
2659
+ "surfaceId",
2660
+ "version",
2661
+ "activeThread",
2662
+ "activeRun",
2663
+ "pendingInteraction",
2664
+ "queue",
2665
+ "historyVersion"
2666
+ ],
2667
+ "properties": {
2668
+ "surfaceId": {
2669
+ "$ref": "#/$defs/surfaceId"
2670
+ },
2671
+ "version": {
2672
+ "type": "string",
2673
+ "pattern": "^[0-9]{20}:[0-9]{20}$"
2674
+ },
2675
+ "activeThread": {
2676
+ "oneOf": [
2677
+ {
2678
+ "$ref": "#/$defs/threadSummary"
2525
2679
  },
2526
- "disposition": {
2527
- "enum": [
2528
- "accepted",
2529
- "duplicate",
2530
- "unavailable",
2531
- "expired_session"
2680
+ {
2681
+ "type": "null"
2682
+ }
2683
+ ]
2684
+ },
2685
+ "activeRun": {
2686
+ "oneOf": [
2687
+ {
2688
+ "$ref": "#/$defs/activeRun"
2689
+ },
2690
+ {
2691
+ "type": "null"
2692
+ }
2693
+ ]
2694
+ },
2695
+ "pendingInteraction": {
2696
+ "oneOf": [
2697
+ {
2698
+ "$ref": "#/$defs/pendingInteraction"
2699
+ },
2700
+ {
2701
+ "type": "null"
2702
+ }
2703
+ ]
2704
+ },
2705
+ "queue": {
2706
+ "$ref": "#/$defs/queue"
2707
+ },
2708
+ "historyVersion": {
2709
+ "type": "integer",
2710
+ "minimum": 0
2711
+ }
2712
+ }
2713
+ },
2714
+ "controlEvent": {
2715
+ "type": "object",
2716
+ "additionalProperties": false,
2717
+ "required": [
2718
+ "type",
2719
+ "surfaceId",
2720
+ "data"
2721
+ ],
2722
+ "properties": {
2723
+ "type": {
2724
+ "const": "control.updated"
2725
+ },
2726
+ "surfaceId": {
2727
+ "$ref": "#/$defs/surfaceId"
2728
+ },
2729
+ "data": {
2730
+ "$ref": "#/$defs/control"
2731
+ }
2732
+ }
2733
+ },
2734
+ "controlRequest": {
2735
+ "type": "object",
2736
+ "additionalProperties": false,
2737
+ "required": [
2738
+ "target",
2739
+ "direction",
2740
+ "body"
2741
+ ],
2742
+ "properties": {
2743
+ "target": {
2744
+ "const": "/chat/control/get"
2745
+ },
2746
+ "direction": {
2747
+ "const": "request"
2748
+ },
2749
+ "body": {
2750
+ "type": "object",
2751
+ "additionalProperties": false,
2752
+ "required": [],
2753
+ "properties": {}
2754
+ }
2755
+ }
2756
+ },
2757
+ "controlResponse": {
2758
+ "type": "object",
2759
+ "additionalProperties": false,
2760
+ "required": [
2761
+ "target",
2762
+ "direction",
2763
+ "body"
2764
+ ],
2765
+ "properties": {
2766
+ "target": {
2767
+ "const": "/chat/control/get"
2768
+ },
2769
+ "direction": {
2770
+ "const": "response"
2771
+ },
2772
+ "body": {
2773
+ "$ref": "#/$defs/control"
2774
+ }
2775
+ }
2776
+ },
2777
+ "catalogCommandResponse": {
2778
+ "type": "object",
2779
+ "additionalProperties": false,
2780
+ "required": [
2781
+ "target",
2782
+ "direction",
2783
+ "body"
2784
+ ],
2785
+ "properties": {
2786
+ "target": {
2787
+ "enum": [
2788
+ "/chat/thread/create",
2789
+ "/chat/thread/archive",
2790
+ "/chat/thread/rotate"
2791
+ ]
2792
+ },
2793
+ "direction": {
2794
+ "const": "response"
2795
+ },
2796
+ "body": {
2797
+ "type": "object",
2798
+ "additionalProperties": false,
2799
+ "required": [
2800
+ "receipt",
2801
+ "control"
2802
+ ],
2803
+ "properties": {
2804
+ "receipt": {
2805
+ "$ref": "#/$defs/catalog"
2806
+ },
2807
+ "control": {
2808
+ "oneOf": [
2809
+ {
2810
+ "$ref": "#/$defs/control"
2811
+ },
2812
+ {
2813
+ "type": "null"
2814
+ }
2532
2815
  ]
2533
2816
  }
2534
2817
  }