@mhome/conversation-protocol 3.15.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.
@@ -454,29 +454,19 @@
454
454
  "additionalProperties": false,
455
455
  "required": [
456
456
  "batch_id",
457
- "decisions"
457
+ "responses"
458
458
  ],
459
459
  "properties": {
460
460
  "batch_id": {
461
- "$ref": "#/$defs/identifier"
461
+ "type": "string",
462
+ "minLength": 1,
463
+ "pattern": "\\S"
462
464
  },
463
- "decisions": {
465
+ "responses": {
464
466
  "type": "array",
467
+ "minItems": 1,
465
468
  "items": {
466
- "type": "object",
467
- "additionalProperties": false,
468
- "required": [
469
- "action_id",
470
- "proceed"
471
- ],
472
- "properties": {
473
- "action_id": {
474
- "$ref": "#/$defs/identifier"
475
- },
476
- "proceed": {
477
- "type": "boolean"
478
- }
479
- }
469
+ "$ref": "#/$defs/interactionItemResponse"
480
470
  }
481
471
  }
482
472
  }
@@ -705,160 +695,15 @@
705
695
  }
706
696
  }
707
697
  },
708
- "preview_value": {
709
- "oneOf": [
710
- {
711
- "type": "object",
712
- "additionalProperties": false,
713
- "required": [
714
- "type",
715
- "text"
716
- ],
717
- "properties": {
718
- "type": {
719
- "const": "text"
720
- },
721
- "text": {
722
- "type": "string"
723
- }
724
- }
725
- },
726
- {
727
- "type": "object",
728
- "additionalProperties": false,
729
- "required": [
730
- "type",
731
- "items"
732
- ],
733
- "properties": {
734
- "type": {
735
- "const": "text_list"
736
- },
737
- "items": {
738
- "type": "array",
739
- "items": {
740
- "type": "string"
741
- }
742
- }
743
- }
744
- },
745
- {
746
- "type": "object",
747
- "additionalProperties": false,
748
- "required": [
749
- "type",
750
- "value"
751
- ],
752
- "properties": {
753
- "type": {
754
- "const": "number"
755
- },
756
- "value": {
757
- "type": "number"
758
- }
759
- }
760
- },
761
- {
762
- "type": "object",
763
- "additionalProperties": false,
764
- "required": [
765
- "type",
766
- "value"
767
- ],
768
- "properties": {
769
- "type": {
770
- "const": "bool"
771
- },
772
- "value": {
773
- "type": "boolean"
774
- }
775
- }
776
- }
777
- ]
778
- },
779
- "interaction_preview": {
780
- "type": "object",
781
- "additionalProperties": false,
782
- "required": [
783
- "actionCode",
784
- "title",
785
- "message",
786
- "tone",
787
- "details",
788
- "proceedLabel",
789
- "rejectLabel"
790
- ],
791
- "properties": {
792
- "actionCode": {
793
- "$ref": "#/$defs/identifier"
794
- },
795
- "title": {
796
- "$ref": "#/$defs/identifier"
797
- },
798
- "message": {
799
- "type": "string"
800
- },
801
- "tone": {
802
- "enum": [
803
- "normal",
804
- "danger"
805
- ]
806
- },
807
- "details": {
808
- "type": "array",
809
- "items": {
810
- "type": "object",
811
- "additionalProperties": false,
812
- "required": [
813
- "label",
814
- "value"
815
- ],
816
- "properties": {
817
- "label": {
818
- "$ref": "#/$defs/identifier"
819
- },
820
- "value": {
821
- "$ref": "#/$defs/preview_value"
822
- }
823
- }
824
- }
825
- },
826
- "proceedLabel": {
827
- "$ref": "#/$defs/identifier"
828
- },
829
- "rejectLabel": {
830
- "$ref": "#/$defs/identifier"
831
- },
832
- "clientTask": {
833
- "type": "object",
834
- "additionalProperties": false,
835
- "required": [
836
- "type",
837
- "integrationId"
838
- ],
839
- "properties": {
840
- "type": {
841
- "const": "install_integration"
842
- },
843
- "integrationId": {
844
- "type": "string",
845
- "minLength": 1,
846
- "pattern": "\\S"
847
- }
848
- }
849
- }
850
- }
851
- },
852
698
  "prepared_action": {
853
699
  "type": "object",
854
700
  "additionalProperties": false,
855
701
  "required": [
856
702
  "action_id",
857
703
  "operation_id",
858
- "preview",
704
+ "card",
859
705
  "payload",
860
- "revision",
861
- "interaction_kind"
706
+ "revision"
862
707
  ],
863
708
  "properties": {
864
709
  "action_id": {
@@ -867,19 +712,13 @@
867
712
  "operation_id": {
868
713
  "$ref": "#/$defs/identifier"
869
714
  },
870
- "preview": {
871
- "$ref": "#/$defs/interaction_preview"
872
- },
873
715
  "payload": true,
874
716
  "revision": {
875
717
  "type": "integer",
876
718
  "minimum": 0
877
719
  },
878
- "interaction_kind": {
879
- "enum": [
880
- "approval",
881
- "user_action"
882
- ]
720
+ "card": {
721
+ "$ref": "#/$defs/interactionCard"
883
722
  }
884
723
  }
885
724
  },
@@ -987,7 +826,7 @@
987
826
  "required": [
988
827
  "type",
989
828
  "batch_id",
990
- "actions",
829
+ "items",
991
830
  "usage"
992
831
  ],
993
832
  "properties": {
@@ -997,14 +836,31 @@
997
836
  "batch_id": {
998
837
  "$ref": "#/$defs/identifier"
999
838
  },
1000
- "actions": {
839
+ "usage": {
840
+ "$ref": "#/$defs/usage"
841
+ },
842
+ "items": {
1001
843
  "type": "array",
844
+ "minItems": 1,
1002
845
  "items": {
1003
- "$ref": "#/$defs/prepared_action"
846
+ "type": "object",
847
+ "additionalProperties": false,
848
+ "required": [
849
+ "item",
850
+ "prepared_action_id"
851
+ ],
852
+ "properties": {
853
+ "item": {
854
+ "$ref": "#/$defs/interactionItem"
855
+ },
856
+ "prepared_action_id": {
857
+ "type": [
858
+ "string",
859
+ "null"
860
+ ]
861
+ }
862
+ }
1004
863
  }
1005
- },
1006
- "usage": {
1007
- "$ref": "#/$defs/usage"
1008
864
  }
1009
865
  }
1010
866
  },
@@ -1359,9 +1215,6 @@
1359
1215
  ],
1360
1216
  "properties": {
1361
1217
  "value": true,
1362
- "continuation": {
1363
- "$ref": "#/$defs/prepared_action"
1364
- },
1365
1218
  "context_invalidation": {
1366
1219
  "type": "object",
1367
1220
  "additionalProperties": false,
@@ -1959,6 +1812,248 @@
1959
1812
  }
1960
1813
  }
1961
1814
  ]
1815
+ },
1816
+ "interactionCard": {
1817
+ "type": "object",
1818
+ "additionalProperties": false,
1819
+ "required": [
1820
+ "type",
1821
+ "title",
1822
+ "message",
1823
+ "tone",
1824
+ "continueLabel",
1825
+ "cancelLabel",
1826
+ "data"
1827
+ ],
1828
+ "properties": {
1829
+ "type": {
1830
+ "type": "string",
1831
+ "minLength": 1,
1832
+ "pattern": "^[a-z0-9._]+$"
1833
+ },
1834
+ "title": {
1835
+ "type": "string",
1836
+ "minLength": 1,
1837
+ "pattern": "\\S"
1838
+ },
1839
+ "message": {
1840
+ "type": "string"
1841
+ },
1842
+ "tone": {
1843
+ "enum": [
1844
+ "normal",
1845
+ "danger"
1846
+ ]
1847
+ },
1848
+ "continueLabel": {
1849
+ "type": "string",
1850
+ "minLength": 1,
1851
+ "pattern": "\\S"
1852
+ },
1853
+ "cancelLabel": {
1854
+ "type": "string",
1855
+ "minLength": 1,
1856
+ "pattern": "\\S"
1857
+ },
1858
+ "data": {
1859
+ "type": "object"
1860
+ }
1861
+ }
1862
+ },
1863
+ "interactionAnswer": {
1864
+ "oneOf": [
1865
+ {
1866
+ "type": "object",
1867
+ "additionalProperties": false,
1868
+ "required": [
1869
+ "action"
1870
+ ],
1871
+ "properties": {
1872
+ "action": {
1873
+ "const": "approve"
1874
+ }
1875
+ }
1876
+ },
1877
+ {
1878
+ "type": "object",
1879
+ "additionalProperties": false,
1880
+ "required": [
1881
+ "action"
1882
+ ],
1883
+ "properties": {
1884
+ "action": {
1885
+ "const": "reject"
1886
+ }
1887
+ }
1888
+ },
1889
+ {
1890
+ "type": "object",
1891
+ "additionalProperties": false,
1892
+ "required": [
1893
+ "action",
1894
+ "data"
1895
+ ],
1896
+ "properties": {
1897
+ "action": {
1898
+ "const": "continue"
1899
+ },
1900
+ "data": {}
1901
+ }
1902
+ },
1903
+ {
1904
+ "type": "object",
1905
+ "additionalProperties": false,
1906
+ "required": [
1907
+ "action"
1908
+ ],
1909
+ "properties": {
1910
+ "action": {
1911
+ "const": "cancel"
1912
+ }
1913
+ }
1914
+ }
1915
+ ]
1916
+ },
1917
+ "interactionItem": {
1918
+ "type": "object",
1919
+ "additionalProperties": false,
1920
+ "required": [
1921
+ "actionId",
1922
+ "kind",
1923
+ "card"
1924
+ ],
1925
+ "properties": {
1926
+ "actionId": {
1927
+ "type": "string",
1928
+ "minLength": 1,
1929
+ "pattern": "\\S"
1930
+ },
1931
+ "kind": {
1932
+ "enum": [
1933
+ "approval",
1934
+ "user_action"
1935
+ ]
1936
+ },
1937
+ "expiresAt": {
1938
+ "type": "string"
1939
+ },
1940
+ "card": {
1941
+ "type": "object",
1942
+ "additionalProperties": false,
1943
+ "required": [
1944
+ "type",
1945
+ "title",
1946
+ "message",
1947
+ "tone",
1948
+ "continueLabel",
1949
+ "cancelLabel",
1950
+ "data"
1951
+ ],
1952
+ "properties": {
1953
+ "type": {
1954
+ "type": "string",
1955
+ "minLength": 1,
1956
+ "pattern": "^[a-z0-9._]+$"
1957
+ },
1958
+ "title": {
1959
+ "type": "string",
1960
+ "minLength": 1,
1961
+ "pattern": "\\S"
1962
+ },
1963
+ "message": {
1964
+ "type": "string"
1965
+ },
1966
+ "tone": {
1967
+ "enum": [
1968
+ "normal",
1969
+ "danger"
1970
+ ]
1971
+ },
1972
+ "continueLabel": {
1973
+ "type": "string",
1974
+ "minLength": 1,
1975
+ "pattern": "\\S"
1976
+ },
1977
+ "cancelLabel": {
1978
+ "type": "string",
1979
+ "minLength": 1,
1980
+ "pattern": "\\S"
1981
+ },
1982
+ "data": {
1983
+ "type": "object"
1984
+ }
1985
+ }
1986
+ }
1987
+ }
1988
+ },
1989
+ "interactionItemResponse": {
1990
+ "type": "object",
1991
+ "additionalProperties": false,
1992
+ "required": [
1993
+ "actionId",
1994
+ "response"
1995
+ ],
1996
+ "properties": {
1997
+ "actionId": {
1998
+ "type": "string",
1999
+ "minLength": 1,
2000
+ "pattern": "\\S"
2001
+ },
2002
+ "response": {
2003
+ "oneOf": [
2004
+ {
2005
+ "type": "object",
2006
+ "additionalProperties": false,
2007
+ "required": [
2008
+ "action"
2009
+ ],
2010
+ "properties": {
2011
+ "action": {
2012
+ "const": "approve"
2013
+ }
2014
+ }
2015
+ },
2016
+ {
2017
+ "type": "object",
2018
+ "additionalProperties": false,
2019
+ "required": [
2020
+ "action"
2021
+ ],
2022
+ "properties": {
2023
+ "action": {
2024
+ "const": "reject"
2025
+ }
2026
+ }
2027
+ },
2028
+ {
2029
+ "type": "object",
2030
+ "additionalProperties": false,
2031
+ "required": [
2032
+ "action",
2033
+ "data"
2034
+ ],
2035
+ "properties": {
2036
+ "action": {
2037
+ "const": "continue"
2038
+ },
2039
+ "data": {}
2040
+ }
2041
+ },
2042
+ {
2043
+ "type": "object",
2044
+ "additionalProperties": false,
2045
+ "required": [
2046
+ "action"
2047
+ ],
2048
+ "properties": {
2049
+ "action": {
2050
+ "const": "cancel"
2051
+ }
2052
+ }
2053
+ }
2054
+ ]
2055
+ }
2056
+ }
1962
2057
  }
1963
2058
  }
1964
2059
  }
@@ -1,49 +0,0 @@
1
- {
2
- "metadata": {
3
- "version": 1,
4
- "message_id": "message-user-action-1",
5
- "correlation_id": "correlation-tool-2",
6
- "causation_id": "message-prepare-2",
7
- "sent_at_unix_ms": 1700000000520,
8
- "dispatch": {
9
- "dispatch_id": "dispatch-1",
10
- "agent_session_id": "agent-session-1"
11
- }
12
- },
13
- "payload": {
14
- "family": "app_facade_response",
15
- "payload": {
16
- "type": "prepared",
17
- "action": {
18
- "action_id": "action-install-1",
19
- "operation_id": "run-1:step:0:tool:call-2",
20
- "preview": {
21
- "actionCode": "integration.install",
22
- "title": "Connect integration",
23
- "message": "Complete the connection flow, then check installation.",
24
- "tone": "normal",
25
- "details": [
26
- {
27
- "label": "Integration",
28
- "value": {
29
- "type": "text",
30
- "text": "provider.example"
31
- }
32
- }
33
- ],
34
- "proceedLabel": "Done, check installation",
35
- "rejectLabel": "Cancel",
36
- "clientTask": {
37
- "type": "install_integration",
38
- "integrationId": "provider.example"
39
- }
40
- },
41
- "payload": {
42
- "target": "/app/integration/install"
43
- },
44
- "revision": 8,
45
- "interaction_kind": "user_action"
46
- }
47
- }
48
- }
49
- }