@simai-studio/chat 0.0.0-stage → 1.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.
Files changed (261) hide show
  1. package/LICENSE.md +182 -0
  2. package/README.md +65 -2
  3. package/dist/package-receipt.json +1551 -0
  4. package/dist/set.json +105 -0
  5. package/dist/smart/chat-composer/aliases.json +56 -0
  6. package/dist/smart/chat-composer/aliases.json.gz +0 -0
  7. package/dist/smart/chat-composer/component.json +658 -0
  8. package/dist/smart/chat-composer/component.json.gz +0 -0
  9. package/dist/smart/chat-composer/css/chat-composer.css +318 -0
  10. package/dist/smart/chat-composer/css/chat-composer.css.gz +0 -0
  11. package/dist/smart/chat-composer/css/chat-composer.min.css +2 -0
  12. package/dist/smart/chat-composer/css/chat-composer.min.css.gz +0 -0
  13. package/dist/smart/chat-composer/examples.json +531 -0
  14. package/dist/smart/chat-composer/examples.json.gz +0 -0
  15. package/dist/smart/chat-composer/js/chat-composer.js +1023 -0
  16. package/dist/smart/chat-composer/js/chat-composer.js.gz +0 -0
  17. package/dist/smart/chat-composer/js/chat-composer.min.js +75 -0
  18. package/dist/smart/chat-composer/js/chat-composer.min.js.gz +0 -0
  19. package/dist/smart/chat-composer/lang/en.json +31 -0
  20. package/dist/smart/chat-composer/lang/en.json.gz +0 -0
  21. package/dist/smart/chat-composer/lang/ru.json +31 -0
  22. package/dist/smart/chat-composer/lang/ru.json.gz +0 -0
  23. package/dist/smart/chat-composer/probe.json +400 -0
  24. package/dist/smart/chat-composer/probe.json.gz +0 -0
  25. package/dist/smart/chat-composer/smart.manifest.json +625 -0
  26. package/dist/smart/chat-composer/smart.manifest.json.gz +0 -0
  27. package/dist/smart/chat-composer/static/default/busy.html +20 -0
  28. package/dist/smart/chat-composer/static/default/busy.html.gz +0 -0
  29. package/dist/smart/chat-composer/static/default/disabled.html +20 -0
  30. package/dist/smart/chat-composer/static/default/disabled.html.gz +0 -0
  31. package/dist/smart/chat-composer/static/default/files.html +44 -0
  32. package/dist/smart/chat-composer/static/default/files.html.gz +0 -0
  33. package/dist/smart/chat-composer/static/default/near-limit.html +20 -0
  34. package/dist/smart/chat-composer/static/default/near-limit.html.gz +0 -0
  35. package/dist/smart/chat-composer/static/default/reference.html +20 -0
  36. package/dist/smart/chat-composer/static/default/reference.html.gz +0 -0
  37. package/dist/smart/chat-composer/static/sheets.json +88 -0
  38. package/dist/smart/chat-composer/static/sheets.json.gz +0 -0
  39. package/dist/smart/chat-composer/studio.fixture.json +18 -0
  40. package/dist/smart/chat-composer/studio.fixture.json.gz +0 -0
  41. package/dist/smart/chat-composer/studio.scenario.json +37 -0
  42. package/dist/smart/chat-composer/studio.scenario.json.gz +0 -0
  43. package/dist/smart/chat-composer/template/default.css +273 -0
  44. package/dist/smart/chat-composer/template/default.css.gz +0 -0
  45. package/dist/smart/chat-composer/template/default.js +109 -0
  46. package/dist/smart/chat-composer/template/default.js.gz +0 -0
  47. package/dist/smart/chat-composer/template/parts.js +82 -0
  48. package/dist/smart/chat-composer/template/parts.js.gz +0 -0
  49. package/dist/smart/chat-interlocutor/aliases.json +20 -0
  50. package/dist/smart/chat-interlocutor/aliases.json.gz +0 -0
  51. package/dist/smart/chat-interlocutor/component.json +435 -0
  52. package/dist/smart/chat-interlocutor/component.json.gz +0 -0
  53. package/dist/smart/chat-interlocutor/css/chat-interlocutor.css +107 -0
  54. package/dist/smart/chat-interlocutor/css/chat-interlocutor.css.gz +0 -0
  55. package/dist/smart/chat-interlocutor/css/chat-interlocutor.min.css +2 -0
  56. package/dist/smart/chat-interlocutor/css/chat-interlocutor.min.css.gz +0 -0
  57. package/dist/smart/chat-interlocutor/examples.json +379 -0
  58. package/dist/smart/chat-interlocutor/examples.json.gz +0 -0
  59. package/dist/smart/chat-interlocutor/js/chat-interlocutor.js +531 -0
  60. package/dist/smart/chat-interlocutor/js/chat-interlocutor.js.gz +0 -0
  61. package/dist/smart/chat-interlocutor/js/chat-interlocutor.min.js +22 -0
  62. package/dist/smart/chat-interlocutor/js/chat-interlocutor.min.js.gz +0 -0
  63. package/dist/smart/chat-interlocutor/lang/en.json +13 -0
  64. package/dist/smart/chat-interlocutor/lang/en.json.gz +0 -0
  65. package/dist/smart/chat-interlocutor/lang/ru.json +13 -0
  66. package/dist/smart/chat-interlocutor/lang/ru.json.gz +0 -0
  67. package/dist/smart/chat-interlocutor/probe.json +204 -0
  68. package/dist/smart/chat-interlocutor/probe.json.gz +0 -0
  69. package/dist/smart/chat-interlocutor/smart.manifest.json +406 -0
  70. package/dist/smart/chat-interlocutor/smart.manifest.json.gz +0 -0
  71. package/dist/smart/chat-interlocutor/static/default/former.html +10 -0
  72. package/dist/smart/chat-interlocutor/static/default/former.html.gz +0 -0
  73. package/dist/smart/chat-interlocutor/static/default/grouped.html +10 -0
  74. package/dist/smart/chat-interlocutor/static/default/grouped.html.gz +0 -0
  75. package/dist/smart/chat-interlocutor/static/default/reference.html +10 -0
  76. package/dist/smart/chat-interlocutor/static/default/reference.html.gz +0 -0
  77. package/dist/smart/chat-interlocutor/static/default/single.html +10 -0
  78. package/dist/smart/chat-interlocutor/static/default/single.html.gz +0 -0
  79. package/dist/smart/chat-interlocutor/static/sheets.json +105 -0
  80. package/dist/smart/chat-interlocutor/static/sheets.json.gz +0 -0
  81. package/dist/smart/chat-interlocutor/studio.fixture.json +25 -0
  82. package/dist/smart/chat-interlocutor/studio.fixture.json.gz +0 -0
  83. package/dist/smart/chat-interlocutor/studio.scenario.json +41 -0
  84. package/dist/smart/chat-interlocutor/studio.scenario.json.gz +0 -0
  85. package/dist/smart/chat-interlocutor/template/default.css +58 -0
  86. package/dist/smart/chat-interlocutor/template/default.css.gz +0 -0
  87. package/dist/smart/chat-interlocutor/template/default.js +43 -0
  88. package/dist/smart/chat-interlocutor/template/default.js.gz +0 -0
  89. package/dist/smart/chat-message/aliases.json +114 -0
  90. package/dist/smart/chat-message/aliases.json.gz +0 -0
  91. package/dist/smart/chat-message/component.json +822 -0
  92. package/dist/smart/chat-message/component.json.gz +0 -0
  93. package/dist/smart/chat-message/css/chat-message.css +3291 -0
  94. package/dist/smart/chat-message/css/chat-message.css.gz +0 -0
  95. package/dist/smart/chat-message/css/chat-message.min.css +2 -0
  96. package/dist/smart/chat-message/css/chat-message.min.css.gz +0 -0
  97. package/dist/smart/chat-message/examples.json +1604 -0
  98. package/dist/smart/chat-message/examples.json.gz +0 -0
  99. package/dist/smart/chat-message/js/chat-message.js +5498 -0
  100. package/dist/smart/chat-message/js/chat-message.js.gz +0 -0
  101. package/dist/smart/chat-message/js/chat-message.min.js +25 -0
  102. package/dist/smart/chat-message/js/chat-message.min.js.gz +0 -0
  103. package/dist/smart/chat-message/lang/en.json +181 -0
  104. package/dist/smart/chat-message/lang/en.json.gz +0 -0
  105. package/dist/smart/chat-message/lang/ru.json +185 -0
  106. package/dist/smart/chat-message/lang/ru.json.gz +0 -0
  107. package/dist/smart/chat-message/probe.json +1029 -0
  108. package/dist/smart/chat-message/probe.json.gz +0 -0
  109. package/dist/smart/chat-message/smart.manifest.json +814 -0
  110. package/dist/smart/chat-message/smart.manifest.json.gz +0 -0
  111. package/dist/smart/chat-message/static/default/brief-card.html +2 -0
  112. package/dist/smart/chat-message/static/default/brief-card.html.gz +0 -0
  113. package/dist/smart/chat-message/static/default/brief-questions.html +2 -0
  114. package/dist/smart/chat-message/static/default/brief-questions.html.gz +0 -0
  115. package/dist/smart/chat-message/static/default/deliverables.html +2 -0
  116. package/dist/smart/chat-message/static/default/deliverables.html.gz +0 -0
  117. package/dist/smart/chat-message/static/default/document.html +13 -0
  118. package/dist/smart/chat-message/static/default/document.html.gz +0 -0
  119. package/dist/smart/chat-message/static/default/failed.html +2 -0
  120. package/dist/smart/chat-message/static/default/failed.html.gz +0 -0
  121. package/dist/smart/chat-message/static/default/feedback-reason.html +2 -0
  122. package/dist/smart/chat-message/static/default/feedback-reason.html.gz +0 -0
  123. package/dist/smart/chat-message/static/default/limit.html +2 -0
  124. package/dist/smart/chat-message/static/default/limit.html.gz +0 -0
  125. package/dist/smart/chat-message/static/default/proposal.html +42 -0
  126. package/dist/smart/chat-message/static/default/proposal.html.gz +0 -0
  127. package/dist/smart/chat-message/static/default/question.html +18 -0
  128. package/dist/smart/chat-message/static/default/question.html.gz +0 -0
  129. package/dist/smart/chat-message/static/default/reference.html +2 -0
  130. package/dist/smart/chat-message/static/default/reference.html.gz +0 -0
  131. package/dist/smart/chat-message/static/default/steps.html +2 -0
  132. package/dist/smart/chat-message/static/default/steps.html.gz +0 -0
  133. package/dist/smart/chat-message/static/default/stopped.html +2 -0
  134. package/dist/smart/chat-message/static/default/stopped.html.gz +0 -0
  135. package/dist/smart/chat-message/static/default/waiting.html +2 -0
  136. package/dist/smart/chat-message/static/default/waiting.html.gz +0 -0
  137. package/dist/smart/chat-message/static/person/person-own.html +2 -0
  138. package/dist/smart/chat-message/static/person/person-own.html.gz +0 -0
  139. package/dist/smart/chat-message/static/person/person-reply.html +6 -0
  140. package/dist/smart/chat-message/static/person/person-reply.html.gz +0 -0
  141. package/dist/smart/chat-message/static/person/person.html +14 -0
  142. package/dist/smart/chat-message/static/person/person.html.gz +0 -0
  143. package/dist/smart/chat-message/static/sheets.json +398 -0
  144. package/dist/smart/chat-message/static/sheets.json.gz +0 -0
  145. package/dist/smart/chat-message/studio.fixture.json +27 -0
  146. package/dist/smart/chat-message/studio.fixture.json.gz +0 -0
  147. package/dist/smart/chat-message/studio.scenario.json +22 -0
  148. package/dist/smart/chat-message/studio.scenario.json.gz +0 -0
  149. package/dist/smart/chat-message/template/default.css +1895 -0
  150. package/dist/smart/chat-message/template/default.css.gz +0 -0
  151. package/dist/smart/chat-message/template/default.js +27 -0
  152. package/dist/smart/chat-message/template/default.js.gz +0 -0
  153. package/dist/smart/chat-message/template/person.js +11 -0
  154. package/dist/smart/chat-message/template/person.js.gz +0 -0
  155. package/dist/smart/chat-threads/aliases.json +174 -0
  156. package/dist/smart/chat-threads/aliases.json.gz +0 -0
  157. package/dist/smart/chat-threads/component.json +1232 -0
  158. package/dist/smart/chat-threads/component.json.gz +0 -0
  159. package/dist/smart/chat-threads/css/chat-threads.css +150 -0
  160. package/dist/smart/chat-threads/css/chat-threads.css.gz +0 -0
  161. package/dist/smart/chat-threads/css/chat-threads.min.css +2 -0
  162. package/dist/smart/chat-threads/css/chat-threads.min.css.gz +0 -0
  163. package/dist/smart/chat-threads/examples.json +689 -0
  164. package/dist/smart/chat-threads/examples.json.gz +0 -0
  165. package/dist/smart/chat-threads/js/chat-threads.js +859 -0
  166. package/dist/smart/chat-threads/js/chat-threads.js.gz +0 -0
  167. package/dist/smart/chat-threads/js/chat-threads.min.js +39 -0
  168. package/dist/smart/chat-threads/js/chat-threads.min.js.gz +0 -0
  169. package/dist/smart/chat-threads/lang/en.json +18 -0
  170. package/dist/smart/chat-threads/lang/en.json.gz +0 -0
  171. package/dist/smart/chat-threads/lang/ru.json +18 -0
  172. package/dist/smart/chat-threads/lang/ru.json.gz +0 -0
  173. package/dist/smart/chat-threads/probe.json +406 -0
  174. package/dist/smart/chat-threads/probe.json.gz +0 -0
  175. package/dist/smart/chat-threads/smart.manifest.json +1152 -0
  176. package/dist/smart/chat-threads/smart.manifest.json.gz +0 -0
  177. package/dist/smart/chat-threads/static/default/activity.html +139 -0
  178. package/dist/smart/chat-threads/static/default/activity.html.gz +0 -0
  179. package/dist/smart/chat-threads/static/default/activity.skeleton.html +139 -0
  180. package/dist/smart/chat-threads/static/default/activity.skeleton.html.gz +0 -0
  181. package/dist/smart/chat-threads/static/default/archive.html +55 -0
  182. package/dist/smart/chat-threads/static/default/archive.html.gz +0 -0
  183. package/dist/smart/chat-threads/static/default/archive.skeleton.html +55 -0
  184. package/dist/smart/chat-threads/static/default/archive.skeleton.html.gz +0 -0
  185. package/dist/smart/chat-threads/static/default/avatars.html +104 -0
  186. package/dist/smart/chat-threads/static/default/avatars.html.gz +0 -0
  187. package/dist/smart/chat-threads/static/default/avatars.skeleton.html +104 -0
  188. package/dist/smart/chat-threads/static/default/avatars.skeleton.html.gz +0 -0
  189. package/dist/smart/chat-threads/static/default/empty.html +48 -0
  190. package/dist/smart/chat-threads/static/default/empty.html.gz +0 -0
  191. package/dist/smart/chat-threads/static/default/loading.html +48 -0
  192. package/dist/smart/chat-threads/static/default/loading.html.gz +0 -0
  193. package/dist/smart/chat-threads/static/default/people.html +95 -0
  194. package/dist/smart/chat-threads/static/default/people.html.gz +0 -0
  195. package/dist/smart/chat-threads/static/default/people.skeleton.html +95 -0
  196. package/dist/smart/chat-threads/static/default/people.skeleton.html.gz +0 -0
  197. package/dist/smart/chat-threads/static/default/reference.html +114 -0
  198. package/dist/smart/chat-threads/static/default/reference.html.gz +0 -0
  199. package/dist/smart/chat-threads/static/default/reference.skeleton.html +114 -0
  200. package/dist/smart/chat-threads/static/default/reference.skeleton.html.gz +0 -0
  201. package/dist/smart/chat-threads/static/default/ungrouped.html +94 -0
  202. package/dist/smart/chat-threads/static/default/ungrouped.html.gz +0 -0
  203. package/dist/smart/chat-threads/static/default/ungrouped.skeleton.html +94 -0
  204. package/dist/smart/chat-threads/static/default/ungrouped.skeleton.html.gz +0 -0
  205. package/dist/smart/chat-threads/static/sheets.json +422 -0
  206. package/dist/smart/chat-threads/static/sheets.json.gz +0 -0
  207. package/dist/smart/chat-threads/studio.fixture.json +23 -0
  208. package/dist/smart/chat-threads/studio.fixture.json.gz +0 -0
  209. package/dist/smart/chat-threads/template/default.css +113 -0
  210. package/dist/smart/chat-threads/template/default.css.gz +0 -0
  211. package/dist/smart/chat-threads/template/default.js +62 -0
  212. package/dist/smart/chat-threads/template/default.js.gz +0 -0
  213. package/dist/smart/chat-window/aliases.json +395 -0
  214. package/dist/smart/chat-window/aliases.json.gz +0 -0
  215. package/dist/smart/chat-window/component.json +2809 -0
  216. package/dist/smart/chat-window/component.json.gz +0 -0
  217. package/dist/smart/chat-window/css/chat-window.css +1717 -0
  218. package/dist/smart/chat-window/css/chat-window.css.gz +0 -0
  219. package/dist/smart/chat-window/css/chat-window.min.css +2 -0
  220. package/dist/smart/chat-window/css/chat-window.min.css.gz +0 -0
  221. package/dist/smart/chat-window/examples.json +2798 -0
  222. package/dist/smart/chat-window/examples.json.gz +0 -0
  223. package/dist/smart/chat-window/js/chat-window.js +12382 -0
  224. package/dist/smart/chat-window/js/chat-window.js.gz +0 -0
  225. package/dist/smart/chat-window/js/chat-window.min.js +1 -0
  226. package/dist/smart/chat-window/js/chat-window.min.js.gz +0 -0
  227. package/dist/smart/chat-window/lang/en.json +212 -0
  228. package/dist/smart/chat-window/lang/en.json.gz +0 -0
  229. package/dist/smart/chat-window/lang/ru.json +218 -0
  230. package/dist/smart/chat-window/lang/ru.json.gz +0 -0
  231. package/dist/smart/chat-window/probe.json +2023 -0
  232. package/dist/smart/chat-window/probe.json.gz +0 -0
  233. package/dist/smart/chat-window/smart.manifest.json +2835 -0
  234. package/dist/smart/chat-window/smart.manifest.json.gz +0 -0
  235. package/dist/smart/chat-window/static/default/archived.html +97 -0
  236. package/dist/smart/chat-window/static/default/archived.html.gz +0 -0
  237. package/dist/smart/chat-window/static/default/embedded.html +119 -0
  238. package/dist/smart/chat-window/static/default/embedded.html.gz +0 -0
  239. package/dist/smart/chat-window/static/default/greeting.html +119 -0
  240. package/dist/smart/chat-window/static/default/greeting.html.gz +0 -0
  241. package/dist/smart/chat-window/static/default/people.html +110 -0
  242. package/dist/smart/chat-window/static/default/people.html.gz +0 -0
  243. package/dist/smart/chat-window/static/default/proposal.html +157 -0
  244. package/dist/smart/chat-window/static/default/proposal.html.gz +0 -0
  245. package/dist/smart/chat-window/static/default/reference.html +117 -0
  246. package/dist/smart/chat-window/static/default/reference.html.gz +0 -0
  247. package/dist/smart/chat-window/static/default/waiting.html +117 -0
  248. package/dist/smart/chat-window/static/default/waiting.html.gz +0 -0
  249. package/dist/smart/chat-window/static/sheets.json +476 -0
  250. package/dist/smart/chat-window/static/sheets.json.gz +0 -0
  251. package/dist/smart/chat-window/studio.fixture.json +13 -0
  252. package/dist/smart/chat-window/studio.fixture.json.gz +0 -0
  253. package/dist/smart/chat-window/studio.scenario.json +95 -0
  254. package/dist/smart/chat-window/studio.scenario.json.gz +0 -0
  255. package/dist/smart/chat-window/template/default.css +1168 -0
  256. package/dist/smart/chat-window/template/default.css.gz +0 -0
  257. package/dist/smart/chat-window/template/default.js +12 -0
  258. package/dist/smart/chat-window/template/default.js.gz +0 -0
  259. package/dist/smart/rule.js +185 -0
  260. package/dist/smart/rule.js.gz +0 -0
  261. package/package.json +29 -4
@@ -0,0 +1,379 @@
1
+ {
2
+ "examples": [
3
+ {
4
+ "name": "reference",
5
+ "title": "Два помощника: выбор",
6
+ "settings": {
7
+ "options": [
8
+ {
9
+ "id": "personal",
10
+ "title": "Мой помощник",
11
+ "kind": "personal"
12
+ },
13
+ {
14
+ "id": "shop",
15
+ "title": "Поддержка магазина",
16
+ "kind": "knowledge"
17
+ }
18
+ ],
19
+ "value": "personal"
20
+ },
21
+ "expect": {
22
+ "name": "Помощник: Мой помощник",
23
+ "values": {
24
+ "value": "personal"
25
+ },
26
+ "texts": {
27
+ ".sf-chat-interlocutor__title": "Мой помощник"
28
+ }
29
+ },
30
+ "studio": {
31
+ "id": "interlocutor-reference",
32
+ "title": "Interlocutor reference",
33
+ "summary": "Deterministic reference fixture for sf-chat-interlocutor: two interlocutors, the personal one current.",
34
+ "props": {
35
+ "value": "personal",
36
+ "options": [
37
+ {
38
+ "id": "personal",
39
+ "title": "Мой помощник",
40
+ "kind": "personal"
41
+ },
42
+ {
43
+ "id": "admin",
44
+ "title": "Ассистент администратора",
45
+ "kind": "admin"
46
+ }
47
+ ]
48
+ },
49
+ "scenario": {
50
+ "steps": [
51
+ {
52
+ "invoke": "setOptions",
53
+ "with": [
54
+ [
55
+ {
56
+ "id": "personal",
57
+ "title": "Мой помощник",
58
+ "kind": "personal"
59
+ },
60
+ {
61
+ "id": "admin",
62
+ "title": "Ассистент администратора",
63
+ "kind": "admin"
64
+ }
65
+ ]
66
+ ]
67
+ }
68
+ ]
69
+ }
70
+ }
71
+ },
72
+ {
73
+ "name": "single",
74
+ "title": "Один помощник: только имя",
75
+ "settings": {
76
+ "options": [
77
+ {
78
+ "id": "personal",
79
+ "title": "Мой помощник",
80
+ "kind": "personal"
81
+ }
82
+ ],
83
+ "value": "personal"
84
+ },
85
+ "expect": {
86
+ "name": "Помощник: Мой помощник",
87
+ "texts": {
88
+ ".sf-chat-interlocutor__title": "Мой помощник"
89
+ }
90
+ }
91
+ },
92
+ {
93
+ "name": "former",
94
+ "title": "Старый разговор с помощником, которого нет в списке",
95
+ "settings": {
96
+ "options": [
97
+ {
98
+ "id": "personal",
99
+ "title": "Мой помощник",
100
+ "kind": "personal"
101
+ }
102
+ ],
103
+ "value": "admin"
104
+ },
105
+ "expect": {
106
+ "name": "Помощник",
107
+ "texts": {
108
+ ".sf-chat-interlocutor__title": "Помощник"
109
+ }
110
+ }
111
+ },
112
+ {
113
+ "name": "grouped",
114
+ "title": "Свои помощники и базы знаний, с поиском",
115
+ "settings": {
116
+ "options": [
117
+ {
118
+ "id": "personal",
119
+ "title": "Мой помощник",
120
+ "kind": "personal"
121
+ },
122
+ {
123
+ "id": "base-1",
124
+ "title": "База 1",
125
+ "kind": "knowledge"
126
+ },
127
+ {
128
+ "id": "base-2",
129
+ "title": "База 2",
130
+ "kind": "knowledge"
131
+ },
132
+ {
133
+ "id": "base-3",
134
+ "title": "База 3",
135
+ "kind": "knowledge"
136
+ },
137
+ {
138
+ "id": "base-4",
139
+ "title": "База 4",
140
+ "kind": "knowledge"
141
+ },
142
+ {
143
+ "id": "base-5",
144
+ "title": "База 5",
145
+ "kind": "knowledge"
146
+ },
147
+ {
148
+ "id": "base-6",
149
+ "title": "База 6",
150
+ "kind": "knowledge"
151
+ },
152
+ {
153
+ "id": "base-7",
154
+ "title": "База 7",
155
+ "kind": "knowledge"
156
+ },
157
+ {
158
+ "id": "base-8",
159
+ "title": "База 8",
160
+ "kind": "knowledge"
161
+ }
162
+ ],
163
+ "value": "base-3"
164
+ },
165
+ "expect": {
166
+ "name": "Помощник: База 3",
167
+ "texts": {
168
+ ".sf-chat-interlocutor__title": "База 3"
169
+ }
170
+ }
171
+ }
172
+ ],
173
+ "pages": [
174
+ {
175
+ "name": "conformance",
176
+ "title": "sf-chat-interlocutor against component.json (standard simai.smart-component 1.3.9 §12, gate 20); the behaviour simai/ui-chat's tests/browser/staff.test.mjs holds for it: one interlocutor names it and offers no choice, two are a choice, an old thread with neither is «Помощник»",
177
+ "format": "stands/15-scenarios (A4 modal: a page, probes in steps); the runner is ui-source tests/browser/manifest-probes.browser.mjs, run for the package by scripts/run-manifest-probes.mjs",
178
+ "page": {
179
+ "lang": "ru",
180
+ "body": [
181
+ "<main>",
182
+ " <sf-chat-interlocutor id=\"two\" value=\"personal\"><script type=\"application/json\" data-sf-settings>{\"options\": [{\"id\": \"personal\", \"title\": \"Мой помощник\", \"kind\": \"personal\"}, {\"id\": \"shop\", \"title\": \"Поддержка магазина\", \"kind\": \"knowledge\"}]}</script></sf-chat-interlocutor>",
183
+ " <sf-chat-interlocutor id=\"one\" value=\"personal\"><script type=\"application/json\" data-sf-settings>{\"options\": [{\"id\": \"personal\", \"title\": \"Мой помощник\", \"kind\": \"personal\"}]}</script></sf-chat-interlocutor>",
184
+ " <sf-chat-interlocutor id=\"former\" value=\"admin\"><script type=\"application/json\" data-sf-settings>{\"options\": [{\"id\": \"personal\", \"title\": \"Мой помощник\", \"kind\": \"personal\"}]}</script></sf-chat-interlocutor>",
185
+ " <sf-chat-interlocutor id=\"many\" value=\"personal\"><script type=\"application/json\" data-sf-settings>{\"options\": [{\"id\": \"personal\", \"title\": \"Мой помощник\", \"kind\": \"personal\"}, {\"id\": \"base-1\", \"title\": \"База 1\", \"kind\": \"knowledge\"}, {\"id\": \"base-2\", \"title\": \"База 2\", \"kind\": \"knowledge\"}, {\"id\": \"base-3\", \"title\": \"База 3\", \"kind\": \"knowledge\"}, {\"id\": \"base-4\", \"title\": \"База 4\", \"kind\": \"knowledge\"}, {\"id\": \"base-5\", \"title\": \"База 5\", \"kind\": \"knowledge\"}, {\"id\": \"base-6\", \"title\": \"База 6\", \"kind\": \"knowledge\"}, {\"id\": \"base-7\", \"title\": \"База 7\", \"kind\": \"knowledge\"}, {\"id\": \"base-8\", \"title\": \"База 8\", \"kind\": \"knowledge\"}]}</script></sf-chat-interlocutor>",
186
+ " <sf-chat-interlocutor id=\"late\" value=\"personal\"></sf-chat-interlocutor>",
187
+ "</main>"
188
+ ]
189
+ },
190
+ "checks": [
191
+ {
192
+ "id": "p1-two-is-a-choice",
193
+ "title": "two interlocutors: the button names the current one, is a closed menu button described by what a change does; a press opens the Framework's menu with two radio rows, the current one checked, the own and the knowledge base's under their headings and a closing heading that says a change starts a new conversation",
194
+ "covers": "settings.options, values.value, accessibility.name runtime.button-label, keyboard.host Enter open, actions.open",
195
+ "steps": [
196
+ {
197
+ "script": "(document.activeElement?.blur?.(), true)",
198
+ "wait": 60,
199
+ "check": "(() => { const b = document.querySelector('#two .sf-chat-interlocutor__button'); const note = document.getElementById(b.getAttribute('aria-describedby')); return b.getAttribute('aria-label') === 'Помощник: Мой помощник' && b.getAttribute('aria-haspopup') === 'menu' && b.getAttribute('aria-expanded') === 'false' && !b.disabled && note?.textContent === 'При смене помощника начнётся новый разговор' && note.classList.contains('sr-only') && b.querySelector('.sf-chat-interlocutor__title').textContent === 'Мой помощник'; })()"
200
+ },
201
+ {
202
+ "script": "(document.querySelector('#two .sf-chat-interlocutor__button').focus(), true)",
203
+ "wait": 60
204
+ },
205
+ {
206
+ "user": "keyboard:Enter",
207
+ "wait": 500,
208
+ "check": "(() => { const rows = [...document.querySelectorAll('#two .sf-context-menu-item[role=menuitemradio]')]; return rows.length === 2 && rows[0].getAttribute('aria-checked') === 'true' && rows[1].getAttribute('aria-checked') === 'false' && rows[1].textContent.includes('Поддержка магазина') && document.querySelector('#two .sf-chat-interlocutor__button').getAttribute('aria-expanded') === 'true' && [...document.querySelectorAll('#two .sf-context-menu-heading')].map((one) => one.textContent.trim()).join('|') === 'Мои помощники|Помощники баз|При смене помощника начнётся новый разговор'; })()"
209
+ }
210
+ ]
211
+ },
212
+ {
213
+ "id": "p2-choice-is-select",
214
+ "title": "choosing another interlocutor sends sf-chat-interlocutor-select {id} once and the 0.3 name sf-chat-interlocutor once, noted with its dates; the element leaves value to the host",
215
+ "covers": "events.select, aliases sf-chat-interlocutor, values.value controlled",
216
+ "steps": [
217
+ {
218
+ "action": {
219
+ "name": "open"
220
+ },
221
+ "target": "#two",
222
+ "wait": 500,
223
+ "expect": {
224
+ "returns": {
225
+ "outcome": "applied"
226
+ }
227
+ }
228
+ },
229
+ {
230
+ "script": "([...document.querySelectorAll('#two .sf-context-menu-item[role=menuitemradio]')].find((row) => row.textContent.includes('Поддержка магазина')).click(), true)",
231
+ "expect": {
232
+ "events": [
233
+ {
234
+ "name": "sf-chat-interlocutor-select",
235
+ "count": 1,
236
+ "detail": {
237
+ "id": "shop"
238
+ }
239
+ },
240
+ {
241
+ "name": "sf-chat-interlocutor",
242
+ "count": 1,
243
+ "detail": {
244
+ "id": "shop"
245
+ }
246
+ }
247
+ ],
248
+ "journal": [
249
+ {
250
+ "from": "sf-chat-interlocutor",
251
+ "to": "sf-chat-interlocutor-select",
252
+ "since": "2026-10-28",
253
+ "remove_after": "2026-12-01"
254
+ }
255
+ ]
256
+ },
257
+ "check": "document.querySelector('#two').value === 'personal'"
258
+ },
259
+ {
260
+ "script": "(document.querySelector('#two').value = 'shop', true)",
261
+ "wait": 200,
262
+ "check": "document.querySelector('#two .sf-chat-interlocutor__button').getAttribute('aria-label') === 'Помощник: Поддержка магазина'"
263
+ }
264
+ ]
265
+ },
266
+ {
267
+ "id": "p3-current-is-no-choice",
268
+ "title": "choosing the current interlocutor again sends nothing",
269
+ "covers": "events.select",
270
+ "steps": [
271
+ {
272
+ "action": {
273
+ "name": "open"
274
+ },
275
+ "target": "#two",
276
+ "wait": 500
277
+ },
278
+ {
279
+ "script": "([...document.querySelectorAll('#two .sf-context-menu-item[role=menuitemradio]')].find((row) => row.textContent.includes('Мой помощник')).click(), true)",
280
+ "expect": {
281
+ "events": [
282
+ {
283
+ "name": "sf-chat-interlocutor-select",
284
+ "count": 0
285
+ },
286
+ {
287
+ "name": "sf-chat-interlocutor",
288
+ "count": 0
289
+ }
290
+ ]
291
+ }
292
+ }
293
+ ]
294
+ },
295
+ {
296
+ "id": "p4-one-is-a-name",
297
+ "title": "one interlocutor: the header names it and offers no choice that does not exist -- a disabled button without aria-haspopup, aria-expanded or a description, the --single class, open refused single and no menu rows",
298
+ "covers": "actions.open refused single, accessibility.name",
299
+ "steps": [
300
+ {
301
+ "action": {
302
+ "name": "open"
303
+ },
304
+ "target": "#one",
305
+ "expect": {
306
+ "returns": {
307
+ "outcome": "refused",
308
+ "reason": "single"
309
+ }
310
+ },
311
+ "check": "(() => { const b = document.querySelector('#one .sf-chat-interlocutor__button'); return b.disabled && b.getAttribute('aria-label') === 'Помощник: Мой помощник' && !b.hasAttribute('aria-haspopup') && !b.hasAttribute('aria-expanded') && !b.hasAttribute('aria-describedby') && document.querySelector('#one .sf-chat-interlocutor--single') !== null && document.querySelectorAll('#one [role=menuitemradio]').length === 0; })()"
312
+ }
313
+ ]
314
+ },
315
+ {
316
+ "id": "p5-former-is-assistant",
317
+ "title": "a conversation with an interlocutor the server no longer lists is named «Помощник», never an empty line or undefined",
318
+ "covers": "runtime.assistant-text",
319
+ "steps": [
320
+ {
321
+ "script": "true",
322
+ "wait": 60,
323
+ "check": "(() => { const b = document.querySelector('#former .sf-chat-interlocutor__button'); return b.querySelector('.sf-chat-interlocutor__title').textContent.trim() === 'Помощник' && b.getAttribute('aria-label') === 'Помощник' && !/undefined|null/.test(b.textContent); })()"
324
+ }
325
+ ]
326
+ },
327
+ {
328
+ "id": "p6-many-grouped-with-search",
329
+ "title": "from eight interlocutors the menu has its search «Найти помощника»; the person's own and the knowledge bases' go under their headings",
330
+ "covers": "settings.options kind knowledge, runtime.search-placeholder, runtime.group-own-text, runtime.group-knowledge-text",
331
+ "steps": [
332
+ {
333
+ "user": "click:#many .sf-chat-interlocutor__button",
334
+ "wait": 600,
335
+ "check": "(() => { const field = document.querySelector('#many .sf-context-menu-search-input'); const headings = [...document.querySelectorAll('#many .sf-context-menu-heading')].map((one) => one.textContent.trim()); return field?.getAttribute('placeholder') === 'Найти помощника' && headings.includes('Мои помощники') && headings.includes('Помощники баз') && document.querySelectorAll('#many [role=menuitemradio]').length === 9; })()"
336
+ }
337
+ ]
338
+ },
339
+ {
340
+ "id": "p7-set-options",
341
+ "title": "set-options, the 0.3 setOptions(list): no list is a name only; two make the button a choice",
342
+ "covers": "actions.set-options",
343
+ "steps": [
344
+ {
345
+ "script": "true",
346
+ "wait": 60,
347
+ "check": "document.querySelector('#late .sf-chat-interlocutor__button').disabled && document.querySelector('#late .sf-chat-interlocutor__title').textContent.trim() === 'Помощник'"
348
+ },
349
+ {
350
+ "action": {
351
+ "name": "set-options",
352
+ "with": [
353
+ {
354
+ "id": "personal",
355
+ "title": "Мой помощник",
356
+ "kind": "personal"
357
+ },
358
+ {
359
+ "id": "shop",
360
+ "title": "Поддержка магазина",
361
+ "kind": "knowledge"
362
+ }
363
+ ]
364
+ },
365
+ "target": "#late",
366
+ "wait": 200,
367
+ "expect": {
368
+ "returns": {
369
+ "outcome": "applied"
370
+ }
371
+ },
372
+ "check": "(() => { const b = document.querySelector('#late .sf-chat-interlocutor__button'); return !b.disabled && b.getAttribute('aria-haspopup') === 'menu' && b.getAttribute('aria-expanded') === 'false' && b.getAttribute('aria-label') === 'Помощник: Мой помощник' && !document.querySelector('#late .sf-chat-interlocutor--single'); })()"
373
+ }
374
+ ]
375
+ }
376
+ ]
377
+ }
378
+ ]
379
+ }