@signalcore/ui 0.1.0 → 1.0.0-beta.1

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 (611) hide show
  1. package/README.md +896 -513
  2. package/dist/AgentAbout.d.ts +186 -0
  3. package/dist/AgentAbout.js +1020 -0
  4. package/dist/AgentAbout.js.map +1 -0
  5. package/dist/AgentCard.d.ts +49 -0
  6. package/dist/AgentCard.js +77 -0
  7. package/dist/AgentCard.js.map +1 -0
  8. package/dist/AgentChat.d.ts +233 -0
  9. package/dist/AgentChat.js +1127 -0
  10. package/dist/AgentChat.js.map +1 -0
  11. package/dist/AgentSpace.d.ts +112 -0
  12. package/dist/AgentSpace.js +339 -0
  13. package/dist/AgentSpace.js.map +1 -0
  14. package/dist/AgentTasks.d.ts +48 -0
  15. package/dist/AgentTasks.js +120 -0
  16. package/dist/AgentTasks.js.map +1 -0
  17. package/dist/BrowserView.d.ts +52 -0
  18. package/dist/BrowserView.js +328 -0
  19. package/dist/BrowserView.js.map +1 -0
  20. package/dist/FileView.d.ts +63 -0
  21. package/dist/FileView.js +449 -0
  22. package/dist/FileView.js.map +1 -0
  23. package/dist/Modes.d.ts +13 -0
  24. package/dist/Modes.js +75 -0
  25. package/dist/Modes.js.map +1 -0
  26. package/dist/VoiceCall.d.ts +91 -0
  27. package/dist/VoiceCall.js +302 -0
  28. package/dist/VoiceCall.js.map +1 -0
  29. package/dist/about.d.ts +212 -0
  30. package/dist/about.js +136 -0
  31. package/dist/about.js.map +1 -0
  32. package/dist/agentIcons.d.ts +33 -0
  33. package/dist/agentIcons.js +36 -0
  34. package/dist/agentIcons.js.map +1 -0
  35. package/dist/automation/Automation.d.ts +35 -0
  36. package/dist/automation/Automation.js +268 -0
  37. package/dist/automation/Automation.js.map +1 -0
  38. package/dist/automation/RunView.d.ts +25 -0
  39. package/dist/automation/RunView.js +187 -0
  40. package/dist/automation/RunView.js.map +1 -0
  41. package/dist/automation/cron.d.ts +41 -0
  42. package/dist/automation/cron.js +169 -0
  43. package/dist/automation/cron.js.map +1 -0
  44. package/dist/automation/marks.js +121 -0
  45. package/dist/automation/marks.js.map +1 -0
  46. package/dist/automation/messages.d.ts +113 -0
  47. package/dist/automation/messages.js +113 -0
  48. package/dist/automation/messages.js.map +1 -0
  49. package/dist/automation/record.d.ts +47 -0
  50. package/dist/automation/record.js +177 -0
  51. package/dist/automation/record.js.map +1 -0
  52. package/dist/automation/types.d.ts +143 -0
  53. package/dist/automation/when.d.ts +36 -0
  54. package/dist/automation/when.js +168 -0
  55. package/dist/automation/when.js.map +1 -0
  56. package/dist/blocks.d.ts +185 -0
  57. package/dist/browser.js +292 -0
  58. package/dist/browser.js.map +1 -0
  59. package/dist/call.d.ts +89 -0
  60. package/dist/call.js +218 -0
  61. package/dist/call.js.map +1 -0
  62. package/dist/channelParts.js +26 -0
  63. package/dist/channelParts.js.map +1 -0
  64. package/dist/classes.js +8 -3
  65. package/dist/classes.js.map +1 -0
  66. package/dist/client.d.ts +146 -54
  67. package/dist/client.js +204 -1
  68. package/dist/client.js.map +1 -0
  69. package/dist/conversationFiles.js +46 -0
  70. package/dist/conversationFiles.js.map +1 -0
  71. package/dist/credentials.d.ts +45 -0
  72. package/dist/credentials.js +98 -0
  73. package/dist/credentials.js.map +1 -0
  74. package/dist/dev.js +17 -0
  75. package/dist/dev.js.map +1 -0
  76. package/dist/es.d.ts +17 -0
  77. package/dist/es.js +382 -0
  78. package/dist/es.js.map +1 -0
  79. package/dist/files.d.ts +21 -0
  80. package/dist/files.js +214 -0
  81. package/dist/files.js.map +1 -0
  82. package/dist/frames.d.ts +115 -0
  83. package/dist/frames.js +219 -0
  84. package/dist/frames.js.map +1 -0
  85. package/dist/icons.js +29 -0
  86. package/dist/icons.js.map +1 -0
  87. package/dist/index.d.ts +63 -60
  88. package/dist/index.js +59 -45
  89. package/dist/kit/AudioPlayer.d.ts +20 -0
  90. package/dist/kit/AudioPlayer.js +116 -0
  91. package/dist/kit/AudioPlayer.js.map +1 -0
  92. package/dist/kit/Button.d.ts +29 -0
  93. package/dist/kit/Button.js +59 -0
  94. package/dist/kit/Button.js.map +1 -0
  95. package/dist/kit/Card.d.ts +16 -0
  96. package/dist/kit/Card.js +36 -0
  97. package/dist/kit/Card.js.map +1 -0
  98. package/dist/kit/Chart.js +152 -0
  99. package/dist/kit/Chart.js.map +1 -0
  100. package/dist/kit/Choices.d.ts +21 -0
  101. package/dist/kit/Choices.js +99 -0
  102. package/dist/kit/Choices.js.map +1 -0
  103. package/dist/kit/Combobox.d.ts +26 -0
  104. package/dist/kit/Combobox.js +190 -0
  105. package/dist/kit/Combobox.js.map +1 -0
  106. package/dist/kit/DateField.d.ts +17 -0
  107. package/dist/kit/DateField.js +133 -0
  108. package/dist/kit/DateField.js.map +1 -0
  109. package/dist/kit/Field.d.ts +40 -0
  110. package/dist/kit/Field.js +98 -0
  111. package/dist/kit/Field.js.map +1 -0
  112. package/dist/kit/FileField.d.ts +113 -0
  113. package/dist/kit/FileField.js +341 -0
  114. package/dist/kit/FileField.js.map +1 -0
  115. package/dist/kit/FileMark.d.ts +15 -0
  116. package/dist/kit/FileMark.js +39 -0
  117. package/dist/kit/FileMark.js.map +1 -0
  118. package/dist/kit/Inputs.d.ts +59 -0
  119. package/dist/kit/Inputs.js +205 -0
  120. package/dist/kit/Inputs.js.map +1 -0
  121. package/dist/kit/List.d.ts +47 -0
  122. package/dist/kit/List.js +85 -0
  123. package/dist/kit/List.js.map +1 -0
  124. package/dist/kit/Mark.d.ts +30 -0
  125. package/dist/kit/Mark.js +27 -0
  126. package/dist/kit/Mark.js.map +1 -0
  127. package/dist/kit/MarkStack.d.ts +15 -0
  128. package/dist/kit/MarkStack.js +26 -0
  129. package/dist/kit/MarkStack.js.map +1 -0
  130. package/dist/kit/Note.d.ts +11 -0
  131. package/dist/kit/Note.js +31 -0
  132. package/dist/kit/Note.js.map +1 -0
  133. package/dist/kit/Popover.js +90 -0
  134. package/dist/kit/Popover.js.map +1 -0
  135. package/dist/kit/RangeField.d.ts +14 -0
  136. package/dist/kit/RangeField.js +47 -0
  137. package/dist/kit/RangeField.js.map +1 -0
  138. package/dist/kit/RatingField.d.ts +14 -0
  139. package/dist/kit/RatingField.js +50 -0
  140. package/dist/kit/RatingField.js.map +1 -0
  141. package/dist/kit/Stat.d.ts +26 -0
  142. package/dist/kit/Stat.js +46 -0
  143. package/dist/kit/Stat.js.map +1 -0
  144. package/dist/kit/Switch.d.ts +14 -0
  145. package/dist/kit/Switch.js +21 -0
  146. package/dist/kit/Switch.js.map +1 -0
  147. package/dist/kit/Tag.d.ts +16 -0
  148. package/dist/kit/Tag.js +20 -0
  149. package/dist/kit/Tag.js.map +1 -0
  150. package/dist/kit/Tile.d.ts +34 -0
  151. package/dist/kit/Tile.js +52 -0
  152. package/dist/kit/Tile.js.map +1 -0
  153. package/dist/kit/TimeField.d.ts +31 -0
  154. package/dist/kit/TimeField.js +109 -0
  155. package/dist/kit/TimeField.js.map +1 -0
  156. package/dist/kit/context.d.ts +22 -0
  157. package/dist/kit/context.js +46 -0
  158. package/dist/kit/context.js.map +1 -0
  159. package/dist/kit/dates.d.ts +14 -0
  160. package/dist/kit/dates.js +129 -0
  161. package/dist/kit/dates.js.map +1 -0
  162. package/dist/kit/messages.d.ts +99 -0
  163. package/dist/kit/messages.js +66 -0
  164. package/dist/kit/messages.js.map +1 -0
  165. package/dist/kit/numbers.d.ts +12 -0
  166. package/dist/kit/numbers.js +40 -0
  167. package/dist/kit/numbers.js.map +1 -0
  168. package/dist/kit/options.d.ts +10 -0
  169. package/dist/kit/options.js +23 -0
  170. package/dist/kit/options.js.map +1 -0
  171. package/dist/kit/uploads.d.ts +42 -0
  172. package/dist/kit/uploads.js +165 -0
  173. package/dist/kit/uploads.js.map +1 -0
  174. package/dist/kit/waveform.js +76 -0
  175. package/dist/kit/waveform.js.map +1 -0
  176. package/dist/locale.d.ts +1 -0
  177. package/dist/locale.js +1 -0
  178. package/dist/markdown.js +84 -0
  179. package/dist/markdown.js.map +1 -0
  180. package/dist/marks.js +217 -0
  181. package/dist/marks.js.map +1 -0
  182. package/dist/reveal.js +48 -0
  183. package/dist/reveal.js.map +1 -0
  184. package/dist/stepGlyphs.js +62 -0
  185. package/dist/stepGlyphs.js.map +1 -0
  186. package/dist/surface/Form.js +264 -0
  187. package/dist/surface/Form.js.map +1 -0
  188. package/dist/surface/Markdown.js +42 -0
  189. package/dist/surface/Markdown.js.map +1 -0
  190. package/dist/surface/Surface.d.ts +31 -17
  191. package/dist/surface/Surface.js +480 -57
  192. package/dist/surface/Surface.js.map +1 -0
  193. package/dist/surface/scope.d.ts +32 -0
  194. package/dist/surface/scope.js +23 -0
  195. package/dist/surface/scope.js.map +1 -0
  196. package/dist/surface/values.d.ts +44 -0
  197. package/dist/surface/values.js +237 -0
  198. package/dist/surface/values.js.map +1 -0
  199. package/dist/tint.d.ts +10 -0
  200. package/dist/tint.js +19 -0
  201. package/dist/tint.js.map +1 -0
  202. package/dist/types.d.ts +541 -0
  203. package/dist/types.js +16 -0
  204. package/dist/types.js.map +1 -0
  205. package/dist/useAgentFace.d.ts +18 -0
  206. package/dist/useAgentFace.js +45 -0
  207. package/dist/useAgentFace.js.map +1 -0
  208. package/dist/useCall.d.ts +39 -0
  209. package/dist/useCall.js +273 -0
  210. package/dist/useCall.js.map +1 -0
  211. package/dist/useConversation.d.ts +77 -0
  212. package/dist/useConversation.js +523 -0
  213. package/dist/useConversation.js.map +1 -0
  214. package/dist/useDictation.d.ts +17 -0
  215. package/dist/useDictation.js +68 -0
  216. package/dist/useDictation.js.map +1 -0
  217. package/dist/useLive.d.ts +26 -0
  218. package/dist/useLive.js +88 -0
  219. package/dist/useLive.js.map +1 -0
  220. package/dist/usePolled.js +68 -0
  221. package/dist/usePolled.js.map +1 -0
  222. package/dist/voice/Orb.d.ts +10 -9
  223. package/dist/voice/Orb.js +43 -39
  224. package/dist/voice/Orb.js.map +1 -0
  225. package/dist/voice/StillOrb.js +33 -0
  226. package/dist/voice/StillOrb.js.map +1 -0
  227. package/dist/voice/WebGLOrb.js +98 -0
  228. package/dist/voice/WebGLOrb.js.map +1 -0
  229. package/dist/voice/fluidDots.js +161 -0
  230. package/dist/voice/fluidDots.js.map +1 -0
  231. package/dist/voice/motion.js +84 -0
  232. package/dist/voice/motion.js.map +1 -0
  233. package/dist/voice/orbs.d.ts +32 -0
  234. package/dist/voice/orbs.js +16 -0
  235. package/dist/voice/orbs.js.map +1 -0
  236. package/dist/voice/useReducedMotion.js +16 -16
  237. package/dist/voice/useReducedMotion.js.map +1 -0
  238. package/dist/voice/wave.js +116 -0
  239. package/dist/voice/wave.js.map +1 -0
  240. package/dist/voice/webgl.js +177 -0
  241. package/dist/voice/webgl.js.map +1 -0
  242. package/dist/widget.js +284 -8
  243. package/package.json +49 -39
  244. package/src/AgentAbout.tsx +1621 -0
  245. package/src/AgentCard.tsx +123 -0
  246. package/src/AgentChat.tsx +1812 -0
  247. package/src/AgentSpace.tsx +540 -0
  248. package/src/AgentTasks.tsx +163 -0
  249. package/src/BrowserView.tsx +442 -0
  250. package/src/FileView.tsx +620 -0
  251. package/src/Modes.tsx +112 -0
  252. package/src/VoiceCall.tsx +411 -0
  253. package/src/about.ts +355 -0
  254. package/src/agentIcons.ts +56 -0
  255. package/src/automation/Automation.tsx +308 -0
  256. package/src/automation/RunView.tsx +213 -0
  257. package/src/automation/cron.ts +196 -0
  258. package/src/automation/marks.tsx +144 -0
  259. package/src/automation/messages.ts +231 -0
  260. package/src/automation/record.ts +206 -0
  261. package/src/automation/types.ts +146 -0
  262. package/src/automation/when.ts +195 -0
  263. package/src/blocks.ts +249 -0
  264. package/src/browser.ts +334 -0
  265. package/src/call.ts +300 -0
  266. package/src/channelParts.ts +17 -0
  267. package/src/classes.ts +10 -0
  268. package/src/client.ts +397 -0
  269. package/src/conversationFiles.ts +54 -0
  270. package/src/credentials.ts +158 -0
  271. package/src/dev.ts +20 -0
  272. package/src/es.ts +423 -0
  273. package/src/files.ts +238 -0
  274. package/src/frames.ts +291 -0
  275. package/src/icons.tsx +49 -0
  276. package/src/index.ts +271 -0
  277. package/src/kit/AudioPlayer.tsx +129 -0
  278. package/src/kit/Button.tsx +97 -0
  279. package/src/kit/Card.tsx +47 -0
  280. package/src/kit/Chart.tsx +129 -0
  281. package/src/kit/Choices.tsx +131 -0
  282. package/src/kit/Combobox.tsx +247 -0
  283. package/src/kit/DateField.tsx +156 -0
  284. package/src/kit/Field.tsx +137 -0
  285. package/src/kit/FileField.tsx +492 -0
  286. package/src/kit/FileMark.tsx +56 -0
  287. package/src/kit/Inputs.tsx +250 -0
  288. package/src/kit/List.tsx +135 -0
  289. package/src/kit/Mark.tsx +64 -0
  290. package/src/kit/MarkStack.tsx +29 -0
  291. package/src/kit/Note.tsx +42 -0
  292. package/src/kit/Popover.tsx +121 -0
  293. package/src/kit/RangeField.tsx +53 -0
  294. package/src/kit/RatingField.tsx +62 -0
  295. package/src/kit/Stat.tsx +60 -0
  296. package/src/kit/Switch.tsx +28 -0
  297. package/src/kit/Tag.tsx +32 -0
  298. package/src/kit/Tile.tsx +74 -0
  299. package/src/kit/TimeField.tsx +157 -0
  300. package/src/kit/context.tsx +246 -0
  301. package/src/kit/dates.ts +150 -0
  302. package/src/kit/messages.ts +160 -0
  303. package/src/kit/numbers.ts +44 -0
  304. package/src/kit/options.ts +30 -0
  305. package/src/kit/uploads.ts +244 -0
  306. package/src/kit/waveform.ts +84 -0
  307. package/src/locale.ts +6 -0
  308. package/src/markdown.ts +69 -0
  309. package/src/marks.tsx +328 -0
  310. package/src/reveal.ts +52 -0
  311. package/src/stepGlyphs.ts +83 -0
  312. package/src/styles.css +6970 -0
  313. package/src/surface/Form.tsx +299 -0
  314. package/src/surface/Markdown.tsx +55 -0
  315. package/src/surface/Surface.tsx +605 -0
  316. package/src/surface/scope.ts +82 -0
  317. package/src/surface/values.ts +361 -0
  318. package/src/tint.ts +14 -0
  319. package/src/types.ts +604 -0
  320. package/src/useAgentFace.ts +47 -0
  321. package/src/useCall.ts +292 -0
  322. package/src/useConversation.ts +627 -0
  323. package/src/useDictation.ts +83 -0
  324. package/src/useLive.ts +115 -0
  325. package/src/usePolled.ts +60 -0
  326. package/src/voice/Orb.tsx +45 -0
  327. package/src/voice/StillOrb.tsx +29 -0
  328. package/src/voice/WebGLOrb.tsx +98 -0
  329. package/src/voice/fluidDots.tsx +171 -0
  330. package/src/voice/motion.ts +112 -0
  331. package/src/voice/orbs.ts +39 -0
  332. package/src/voice/useReducedMotion.ts +24 -0
  333. package/src/voice/wave.tsx +129 -0
  334. package/src/voice/webgl.ts +209 -0
  335. package/src/widget/css.d.ts +5 -0
  336. package/src/widget/element.tsx +535 -0
  337. package/src/widget/index.ts +10 -0
  338. package/src/widget/mount.ts +27 -0
  339. package/src/widget/widget.css +253 -0
  340. package/dist/SignalcoreProvider.d.ts +0 -113
  341. package/dist/SignalcoreProvider.js +0 -84
  342. package/dist/automations/AppMarks.d.ts +0 -11
  343. package/dist/automations/AppMarks.js +0 -18
  344. package/dist/automations/AutomationCard.d.ts +0 -27
  345. package/dist/automations/AutomationCard.js +0 -53
  346. package/dist/automations/AutomationsWindow.d.ts +0 -38
  347. package/dist/automations/AutomationsWindow.js +0 -57
  348. package/dist/automations/Card.d.ts +0 -46
  349. package/dist/automations/Card.js +0 -45
  350. package/dist/automations/ScheduleMarks.d.ts +0 -13
  351. package/dist/automations/ScheduleMarks.js +0 -24
  352. package/dist/automations/presentationIcons.d.ts +0 -7
  353. package/dist/automations/presentationIcons.js +0 -67
  354. package/dist/automations/schedule.d.ts +0 -25
  355. package/dist/automations/schedule.js +0 -59
  356. package/dist/automations/time.d.ts +0 -3
  357. package/dist/automations/time.js +0 -25
  358. package/dist/browser/BrowserView.d.ts +0 -43
  359. package/dist/browser/BrowserView.js +0 -94
  360. package/dist/browser/room.d.ts +0 -21
  361. package/dist/browser/room.js +0 -33
  362. package/dist/browser/useBrowserSession.d.ts +0 -17
  363. package/dist/browser/useBrowserSession.js +0 -67
  364. package/dist/builder/BuilderChat.d.ts +0 -32
  365. package/dist/builder/BuilderChat.js +0 -41
  366. package/dist/builder/BuilderTranscript.d.ts +0 -49
  367. package/dist/builder/BuilderTranscript.js +0 -62
  368. package/dist/builder/StatusLine.d.ts +0 -8
  369. package/dist/builder/StatusLine.js +0 -17
  370. package/dist/builder/answer.d.ts +0 -7
  371. package/dist/builder/answer.js +0 -8
  372. package/dist/builder/blocks.d.ts +0 -31
  373. package/dist/builder/blocks.js +0 -74
  374. package/dist/builder/items.d.ts +0 -15
  375. package/dist/builder/items.js +0 -21
  376. package/dist/builder/steps.d.ts +0 -20
  377. package/dist/builder/steps.js +0 -120
  378. package/dist/builder/time.d.ts +0 -4
  379. package/dist/builder/time.js +0 -24
  380. package/dist/builder/useBuildSession.d.ts +0 -36
  381. package/dist/builder/useBuildSession.js +0 -130
  382. package/dist/builder/workingOn.d.ts +0 -7
  383. package/dist/builder/workingOn.js +0 -15
  384. package/dist/chat/AgentChat.d.ts +0 -37
  385. package/dist/chat/AgentChat.js +0 -21
  386. package/dist/chat/ChatView.d.ts +0 -25
  387. package/dist/chat/ChatView.js +0 -34
  388. package/dist/chat/Composer.d.ts +0 -20
  389. package/dist/chat/Composer.js +0 -22
  390. package/dist/chat/MessageRow.d.ts +0 -22
  391. package/dist/chat/MessageRow.js +0 -32
  392. package/dist/chat/arrival.d.ts +0 -15
  393. package/dist/chat/arrival.js +0 -25
  394. package/dist/chat/history.d.ts +0 -24
  395. package/dist/chat/history.js +0 -45
  396. package/dist/chat/moments.d.ts +0 -25
  397. package/dist/chat/moments.js +0 -72
  398. package/dist/chat/types.d.ts +0 -12
  399. package/dist/chat/types.js +0 -1
  400. package/dist/chat/useComposer.d.ts +0 -46
  401. package/dist/chat/useComposer.js +0 -62
  402. package/dist/chat/useConversation.d.ts +0 -35
  403. package/dist/chat/useConversation.js +0 -71
  404. package/dist/chat/useStickToBottom.d.ts +0 -9
  405. package/dist/chat/useStickToBottom.js +0 -33
  406. package/dist/chat/useTurns.d.ts +0 -49
  407. package/dist/chat/useTurns.js +0 -111
  408. package/dist/classes.d.ts +0 -2
  409. package/dist/development.d.ts +0 -5
  410. package/dist/development.js +0 -8
  411. package/dist/flow/FlowWindow.d.ts +0 -42
  412. package/dist/flow/FlowWindow.js +0 -126
  413. package/dist/flow/index.d.ts +0 -16
  414. package/dist/flow/index.js +0 -16
  415. package/dist/flow/kinds.d.ts +0 -23
  416. package/dist/flow/kinds.js +0 -48
  417. package/dist/flow/map.d.ts +0 -44
  418. package/dist/flow/map.js +0 -225
  419. package/dist/flow/nodePaths.d.ts +0 -7
  420. package/dist/flow/nodePaths.js +0 -17
  421. package/dist/flow/relations.d.ts +0 -42
  422. package/dist/flow/relations.js +0 -174
  423. package/dist/host.d.ts +0 -124
  424. package/dist/host.js +0 -1
  425. package/dist/live/LiveView.d.ts +0 -28
  426. package/dist/live/LiveView.js +0 -55
  427. package/dist/live/capture.d.ts +0 -20
  428. package/dist/live/capture.js +0 -100
  429. package/dist/live/follow.d.ts +0 -26
  430. package/dist/live/follow.js +0 -72
  431. package/dist/live/paint.d.ts +0 -13
  432. package/dist/live/paint.js +0 -77
  433. package/dist/live/useLiveStream.d.ts +0 -16
  434. package/dist/live/useLiveStream.js +0 -57
  435. package/dist/look.d.ts +0 -33
  436. package/dist/look.js +0 -241
  437. package/dist/messages/en.d.ts +0 -3
  438. package/dist/messages/en.js +0 -251
  439. package/dist/messages/es.d.ts +0 -3
  440. package/dist/messages/es.js +0 -251
  441. package/dist/messages/index.d.ts +0 -16
  442. package/dist/messages/index.js +0 -33
  443. package/dist/messages/types.d.ts +0 -246
  444. package/dist/messages/types.js +0 -1
  445. package/dist/parts/Button.d.ts +0 -18
  446. package/dist/parts/Button.js +0 -17
  447. package/dist/parts/Icon.d.ts +0 -39
  448. package/dist/parts/Icon.js +0 -37
  449. package/dist/parts/Input.d.ts +0 -6
  450. package/dist/parts/Input.js +0 -11
  451. package/dist/parts/Spinner.d.ts +0 -2
  452. package/dist/parts/Spinner.js +0 -7
  453. package/dist/patterns.d.ts +0 -15
  454. package/dist/patterns.js +0 -5
  455. package/dist/presets.d.ts +0 -82
  456. package/dist/presets.js +0 -81
  457. package/dist/primitives.d.ts +0 -22
  458. package/dist/primitives.js +0 -58
  459. package/dist/request/RequestCard.d.ts +0 -34
  460. package/dist/request/RequestCard.js +0 -101
  461. package/dist/request/approval/ApprovalPreview.d.ts +0 -5
  462. package/dist/request/approval/ApprovalPreview.js +0 -27
  463. package/dist/request/approval/shapes.d.ts +0 -32
  464. package/dist/request/approval/shapes.js +0 -68
  465. package/dist/request/apps.d.ts +0 -11
  466. package/dist/request/apps.js +0 -27
  467. package/dist/request/cards.d.ts +0 -12
  468. package/dist/request/cards.js +0 -24
  469. package/dist/request/deliver.d.ts +0 -12
  470. package/dist/request/deliver.js +0 -21
  471. package/dist/request/handOver.d.ts +0 -18
  472. package/dist/request/handOver.js +0 -33
  473. package/dist/request/kinds/Approval.d.ts +0 -3
  474. package/dist/request/kinds/Approval.js +0 -9
  475. package/dist/request/kinds/Choice.d.ts +0 -3
  476. package/dist/request/kinds/Choice.js +0 -8
  477. package/dist/request/kinds/Connect.d.ts +0 -9
  478. package/dist/request/kinds/Connect.js +0 -119
  479. package/dist/request/kinds/FreeText.d.ts +0 -3
  480. package/dist/request/kinds/FreeText.js +0 -20
  481. package/dist/request/kinds/HandOver.d.ts +0 -13
  482. package/dist/request/kinds/HandOver.js +0 -20
  483. package/dist/request/kinds/Secret.d.ts +0 -7
  484. package/dist/request/kinds/Secret.js +0 -49
  485. package/dist/request/kinds/Upload.d.ts +0 -6
  486. package/dist/request/kinds/Upload.js +0 -47
  487. package/dist/request/types.d.ts +0 -83
  488. package/dist/request/types.js +0 -1
  489. package/dist/safeUrl.d.ts +0 -6
  490. package/dist/safeUrl.js +0 -8
  491. package/dist/stream/builder.d.ts +0 -176
  492. package/dist/stream/builder.js +0 -202
  493. package/dist/stream/reduce.d.ts +0 -51
  494. package/dist/stream/reduce.js +0 -58
  495. package/dist/stream/untilAborted.d.ts +0 -7
  496. package/dist/stream/untilAborted.js +0 -32
  497. package/dist/stream/useRunStream.d.ts +0 -26
  498. package/dist/stream/useRunStream.js +0 -137
  499. package/dist/styles.css +0 -2318
  500. package/dist/surface/HostNode.d.ts +0 -14
  501. package/dist/surface/HostNode.js +0 -30
  502. package/dist/surface/Node.d.ts +0 -7
  503. package/dist/surface/Node.js +0 -49
  504. package/dist/surface/SurfaceBoundary.d.ts +0 -26
  505. package/dist/surface/SurfaceBoundary.js +0 -20
  506. package/dist/surface/bindings.d.ts +0 -14
  507. package/dist/surface/bindings.js +0 -37
  508. package/dist/surface/check.d.ts +0 -27
  509. package/dist/surface/check.js +0 -102
  510. package/dist/surface/format.d.ts +0 -10
  511. package/dist/surface/format.js +0 -32
  512. package/dist/surface/hosts.d.ts +0 -6
  513. package/dist/surface/hosts.js +0 -11
  514. package/dist/surface/scene.d.ts +0 -21
  515. package/dist/surface/scene.js +0 -8
  516. package/dist/surface/templates/Browser.d.ts +0 -6
  517. package/dist/surface/templates/Browser.js +0 -11
  518. package/dist/surface/templates/Chart.d.ts +0 -6
  519. package/dist/surface/templates/Chart.js +0 -13
  520. package/dist/surface/templates/Choices.d.ts +0 -3
  521. package/dist/surface/templates/Choices.js +0 -12
  522. package/dist/surface/templates/Form.d.ts +0 -3
  523. package/dist/surface/templates/Form.js +0 -44
  524. package/dist/surface/templates/KeyValue.d.ts +0 -3
  525. package/dist/surface/templates/KeyValue.js +0 -7
  526. package/dist/surface/templates/Layout.d.ts +0 -5
  527. package/dist/surface/templates/Layout.js +0 -16
  528. package/dist/surface/templates/Live.d.ts +0 -6
  529. package/dist/surface/templates/Live.js +0 -9
  530. package/dist/surface/templates/Media.d.ts +0 -5
  531. package/dist/surface/templates/Media.js +0 -13
  532. package/dist/surface/templates/Slots.d.ts +0 -3
  533. package/dist/surface/templates/Slots.js +0 -19
  534. package/dist/surface/templates/Table.d.ts +0 -3
  535. package/dist/surface/templates/Table.js +0 -12
  536. package/dist/surface/templates/Text.d.ts +0 -4
  537. package/dist/surface/templates/Text.js +0 -15
  538. package/dist/surface/templates/index.d.ts +0 -7
  539. package/dist/surface/templates/index.js +0 -32
  540. package/dist/surface/types.d.ts +0 -68
  541. package/dist/surface/types.js +0 -6
  542. package/dist/theme.d.ts +0 -62
  543. package/dist/theme.js +0 -9
  544. package/dist/useTokens.d.ts +0 -7
  545. package/dist/useTokens.js +0 -41
  546. package/dist/voice/VoiceWindow.d.ts +0 -18
  547. package/dist/voice/VoiceWindow.js +0 -35
  548. package/dist/voice/index.d.ts +0 -13
  549. package/dist/voice/index.js +0 -12
  550. package/dist/voice/meter.d.ts +0 -16
  551. package/dist/voice/meter.js +0 -52
  552. package/dist/voice/orbColors.d.ts +0 -16
  553. package/dist/voice/orbColors.js +0 -75
  554. package/dist/voice/pushable.d.ts +0 -16
  555. package/dist/voice/pushable.js +0 -56
  556. package/dist/voice/useDictation.d.ts +0 -24
  557. package/dist/voice/useDictation.js +0 -60
  558. package/dist/voice/useReducedMotion.d.ts +0 -5
  559. package/dist/voice/useVoice.d.ts +0 -70
  560. package/dist/voice/useVoice.js +0 -197
  561. package/dist/voice/useVoicePrimitives.d.ts +0 -7
  562. package/dist/voice/useVoicePrimitives.js +0 -11
  563. package/dist/voice/voice.d.ts +0 -55
  564. package/dist/voice/voice.js +0 -9
  565. package/dist/voice/webSpeech.d.ts +0 -33
  566. package/dist/voice/webSpeech.js +0 -258
  567. package/dist/widget.js.map +0 -1
  568. package/dist/windows/AgentSpace.d.ts +0 -78
  569. package/dist/windows/AgentSpace.js +0 -135
  570. package/dist/windows/Captions.d.ts +0 -13
  571. package/dist/windows/Captions.js +0 -22
  572. package/dist/windows/Dock.d.ts +0 -37
  573. package/dist/windows/Dock.js +0 -22
  574. package/dist/windows/Journal.d.ts +0 -15
  575. package/dist/windows/Journal.js +0 -19
  576. package/dist/windows/KindMark.d.ts +0 -7
  577. package/dist/windows/KindMark.js +0 -31
  578. package/dist/windows/Pending.d.ts +0 -8
  579. package/dist/windows/Pending.js +0 -17
  580. package/dist/windows/Stage.d.ts +0 -18
  581. package/dist/windows/Stage.js +0 -21
  582. package/dist/windows/StatusLabel.d.ts +0 -9
  583. package/dist/windows/StatusLabel.js +0 -7
  584. package/dist/windows/Strip.d.ts +0 -17
  585. package/dist/windows/Strip.js +0 -42
  586. package/dist/windows/SurfaceWindow.d.ts +0 -20
  587. package/dist/windows/SurfaceWindow.js +0 -12
  588. package/dist/windows/WindowFrame.d.ts +0 -23
  589. package/dist/windows/WindowFrame.js +0 -22
  590. package/dist/windows/hearing.d.ts +0 -11
  591. package/dist/windows/hearing.js +0 -26
  592. package/dist/windows/kinds.d.ts +0 -47
  593. package/dist/windows/kinds.js +0 -28
  594. package/dist/windows/reduce.d.ts +0 -98
  595. package/dist/windows/reduce.js +0 -151
  596. package/dist/windows/registry.d.ts +0 -18
  597. package/dist/windows/registry.js +0 -61
  598. package/dist/windows/reveal.d.ts +0 -9
  599. package/dist/windows/reveal.js +0 -6
  600. package/dist/windows/space.d.ts +0 -21
  601. package/dist/windows/space.js +0 -6
  602. package/dist/windows/status.d.ts +0 -11
  603. package/dist/windows/status.js +0 -30
  604. package/dist/windows/types.d.ts +0 -15
  605. package/dist/windows/types.js +0 -1
  606. package/dist/windows/useLoaded.d.ts +0 -44
  607. package/dist/windows/useLoaded.js +0 -58
  608. package/dist/windows/useUnread.d.ts +0 -7
  609. package/dist/windows/useUnread.js +0 -21
  610. package/dist/windows/useWindows.d.ts +0 -70
  611. package/dist/windows/useWindows.js +0 -60
@@ -1,36 +0,0 @@
1
- import { type BuildEvent, type Transcript } from "../stream/builder.js";
2
- export interface BuildSessionOptions {
3
- agentId: string;
4
- /** The conversation to show; none starts a new one on the first message. */
5
- sessionId?: string | null | undefined;
6
- /** Cards still waiting for an answer belong to the latest conversation only (default). */
7
- showPending?: boolean | undefined;
8
- /** A conversation started here got its id, with the first message. */
9
- onSession?: ((sessionId: string) => void) | undefined;
10
- /** The model a conversation started here runs on; none is the deployment's default. */
11
- model?: string | null | undefined;
12
- /** Every event of a turn as it arrives, for a host that refreshes what the builder changes. */
13
- onEvent?: ((event: BuildEvent) => void) | undefined;
14
- /** A turn is over, however it ended. */
15
- onTurnEnd?: (() => void) | undefined;
16
- }
17
- export interface BuildSession {
18
- transcript: Transcript;
19
- /** The history of the conversation is being read. */
20
- loading: boolean;
21
- /** Why the history could not be read. */
22
- error: Error | undefined;
23
- /** Sends the owner's message and follows the turn; nothing while one runs. */
24
- send: (text: string) => Promise<void>;
25
- /** Hangs up on the turn that runs. */
26
- stop: () => void;
27
- }
28
- /**
29
- * One conversation with the builder: its transcript, sending a message and stopping the turn.
30
- * The history is read again whenever the conversation changes, a conversation started here is
31
- * created with the first message (`onSession` hears its id), and a turn streams through the
32
- * provider's client (`build.sessions.say`) until its last event, or until `stop`.
33
- *
34
- * It is what `BuilderChat` is made of, for a host that draws the conversation its own way.
35
- */
36
- export declare function useBuildSession(options: BuildSessionOptions): BuildSession;
@@ -1,130 +0,0 @@
1
- import { useCallback, useEffect, useReducer, useRef, useState } from "react";
2
- import { cardOf } from "../request/cards.js";
3
- import { useMessages, useSignalcore } from "../SignalcoreProvider.js";
4
- import { emptyTranscript, isBuildEvent, reduceTranscript, } from "../stream/builder.js";
5
- import { untilAborted } from "../stream/untilAborted.js";
6
- const keyOf = (agentId, sessionId) => `${agentId}/${sessionId}`;
7
- const asError = (reason, connectionLost) => reason instanceof Error ? reason : new Error(connectionLost);
8
- /**
9
- * One conversation with the builder: its transcript, sending a message and stopping the turn.
10
- * The history is read again whenever the conversation changes, a conversation started here is
11
- * created with the first message (`onSession` hears its id), and a turn streams through the
12
- * provider's client (`build.sessions.say`) until its last event, or until `stop`.
13
- *
14
- * It is what `BuilderChat` is made of, for a host that draws the conversation its own way.
15
- */
16
- export function useBuildSession(options) {
17
- const { agentId, sessionId = null, showPending = true, model = null } = options;
18
- const { client } = useSignalcore();
19
- const { connectionLost } = useMessages();
20
- const sessions = client?.build?.sessions;
21
- const pending = client?.requests?.pending;
22
- const [transcript, dispatch] = useReducer(reduceTranscript, emptyTranscript);
23
- const [shown, setShown] = useState(null);
24
- const turn = useRef(null);
25
- // The host's callbacks (and the word for a lost connection) as of the last render, so neither
26
- // sending nor reading changes when they do.
27
- const latest = useRef({ ...options, connectionLost });
28
- useEffect(() => {
29
- latest.current = { ...options, connectionLost };
30
- });
31
- const key = sessionId === null ? null : keyOf(agentId, sessionId);
32
- const shownKey = shown?.key;
33
- useEffect(() => {
34
- // A conversation that is on screen already (started here, or read) is not read again.
35
- if (sessionId === null || key === shownKey || !sessions)
36
- return undefined;
37
- let current = true;
38
- const read = async () => {
39
- const [page, waiting] = await Promise.all([
40
- sessions.history(agentId, sessionId),
41
- showPending && pending
42
- ? pending({ agent_id: agentId, source: "builder" }).then((found) => found.items, () => [])
43
- : [],
44
- ]);
45
- const cards = waiting.flatMap((request) => cardOf(request) ?? []);
46
- const events = page.items.flatMap((item) => (isBuildEvent(item) ? [item] : []));
47
- return { events, pending: cards };
48
- };
49
- read().then((history) => {
50
- if (!current)
51
- return;
52
- dispatch({ type: "load", ...history });
53
- setShown({ key: keyOf(agentId, sessionId) });
54
- }, (reason) => {
55
- if (current) {
56
- const error = asError(reason, latest.current.connectionLost);
57
- setShown({ key: keyOf(agentId, sessionId), error });
58
- }
59
- });
60
- return () => {
61
- current = false;
62
- };
63
- }, [sessions, pending, agentId, sessionId, key, shownKey, showPending]);
64
- useEffect(() => {
65
- // Leaving a conversation stops its turn; a new conversation getting its id does not.
66
- const running = turn.current;
67
- if (running && running.sessionId !== sessionId)
68
- running.controller.abort();
69
- if (sessionId === null && !running) {
70
- dispatch({ type: "load", events: [], pending: [] });
71
- }
72
- }, [agentId, sessionId]);
73
- useEffect(() => () => {
74
- turn.current?.controller.abort();
75
- }, []);
76
- const send = useCallback(async (text) => {
77
- const message = text.trim();
78
- if (!message || turn.current || !sessions)
79
- return;
80
- const controller = new AbortController();
81
- const current = { controller, sessionId };
82
- turn.current = current;
83
- dispatch({ type: "start", text: message, at: Date.now() });
84
- let finished = false;
85
- try {
86
- let id = sessionId;
87
- if (id === null) {
88
- id = (await sessions.create(agentId, { model })).id;
89
- current.sessionId = id;
90
- setShown({ key: keyOf(agentId, id) });
91
- latest.current.onSession?.(id);
92
- }
93
- const said = sessions.say(agentId, id, message, { signal: controller.signal });
94
- for await (const event of untilAborted(said, controller.signal)) {
95
- if (!isBuildEvent(event))
96
- continue;
97
- dispatch({ type: "event", event, at: Date.now() });
98
- if (event.type === "done")
99
- finished = true;
100
- latest.current.onEvent?.(event);
101
- }
102
- }
103
- catch (reason) {
104
- if (!controller.signal.aborted) {
105
- const lost = {
106
- type: "error",
107
- message: asError(reason, latest.current.connectionLost).message,
108
- };
109
- dispatch({ type: "event", event: lost, at: Date.now() });
110
- }
111
- }
112
- finally {
113
- if (!finished)
114
- dispatch({ type: "stop", at: Date.now() });
115
- turn.current = null;
116
- latest.current.onTurnEnd?.();
117
- }
118
- }, [sessions, agentId, sessionId, model]);
119
- const stop = useCallback(() => {
120
- turn.current?.controller.abort();
121
- }, []);
122
- const reading = key !== null && key !== shownKey && sessions !== undefined;
123
- return {
124
- transcript,
125
- loading: reading,
126
- error: key !== null && key === shownKey ? shown?.error : undefined,
127
- send,
128
- stop,
129
- };
130
- }
@@ -1,7 +0,0 @@
1
- import type { Messages } from "../messages/index.js";
2
- import { type Transcript } from "../stream/builder.js";
3
- /**
4
- * What the builder is doing right now, in a few words: "Editar app.py", "Escribiendo". In the
5
- * language of `messages`, which a component takes from `useMessages()`; Spanish without it.
6
- */
7
- export declare function workingOn(transcript: Transcript, messages?: Messages): string;
@@ -1,15 +0,0 @@
1
- import { es } from "../messages/es.js";
2
- import { activity } from "../stream/builder.js";
3
- import { describeStep } from "./steps.js";
4
- /**
5
- * What the builder is doing right now, in a few words: "Editar app.py", "Escribiendo". In the
6
- * language of `messages`, which a component takes from `useMessages()`; Spanish without it.
7
- */
8
- export function workingOn(transcript, messages = es) {
9
- const current = activity(transcript);
10
- if (current?.kind === "step") {
11
- const step = describeStep(current.name, current.input, messages);
12
- return step.target ? `${step.verb} ${step.target}` : step.verb;
13
- }
14
- return current?.kind === "text" ? messages.writingReply : messages.working;
15
- }
@@ -1,37 +0,0 @@
1
- import type { SurfaceAction } from "../surface/types.js";
2
- import type { ChatMessage } from "./types.js";
3
- export interface AgentChatProps {
4
- /** The agent the person talks to. */
5
- agentId: string;
6
- /** The conversation to speak in; the agent remembers it across messages. */
7
- thread?: string | undefined;
8
- placeholder?: string | undefined;
9
- /**
10
- * The person picked or submitted something on a surface. The chat has already sent it to the
11
- * agent (`agents.invoke` with the action), so this is only to tell the host, for its own
12
- * records.
13
- */
14
- onSurfaceAction?: ((action: SurfaceAction) => void) | undefined;
15
- autoFocus?: boolean | undefined;
16
- /**
17
- * What was said in this thread before, oldest first; read once when the chat opens. See
18
- * `messagesFromConversation` for the API's conversation messages. Without it the chat reads
19
- * the caller's own conversation in the thread when the client can (`endUsers.myConversation`,
20
- * which an end user's token or a publishable key has), and otherwise starts empty.
21
- */
22
- loadHistory?: ((thread: string | undefined) => Promise<ChatMessage[]>) | undefined;
23
- /** What the conversation is called to someone who cannot see it. */
24
- label?: string | undefined;
25
- className?: string | undefined;
26
- }
27
- /**
28
- * The chat of the people an agent serves (ADR 0009): their messages and the agent's, the
29
- * agent's surfaces drawn inline, and a box to write in. It speaks to the agent as the person
30
- * (`agents.invoke` through the provider's client) and can never change the agent.
31
- *
32
- * It never shows an approval, a connection or a secret: when the agent needs the owner to
33
- * confirm something, the person sees that the answer is waiting, and gets it when it arrives.
34
- * New messages from the agent are announced to screen readers, and everything works from the
35
- * keyboard (Enter sends, Shift+Enter breaks the line, a surface's buttons are real buttons).
36
- */
37
- export declare function AgentChat(props: AgentChatProps): import("react").JSX.Element;
@@ -1,21 +0,0 @@
1
- import { jsx as _jsx } from "react/jsx-runtime";
2
- import { Scoped } from "../SignalcoreProvider.js";
3
- import { ChatView } from "./ChatView.js";
4
- import { useConversation } from "./useConversation.js";
5
- /**
6
- * The chat of the people an agent serves (ADR 0009): their messages and the agent's, the
7
- * agent's surfaces drawn inline, and a box to write in. It speaks to the agent as the person
8
- * (`agents.invoke` through the provider's client) and can never change the agent.
9
- *
10
- * It never shows an approval, a connection or a secret: when the agent needs the owner to
11
- * confirm something, the person sees that the answer is waiting, and gets it when it arrives.
12
- * New messages from the agent are announced to screen readers, and everything works from the
13
- * keyboard (Enter sends, Shift+Enter breaks the line, a surface's buttons are real buttons).
14
- */
15
- export function AgentChat(props) {
16
- return (_jsx(Scoped, { children: _jsx(Chat, { ...props }, `${props.agentId}/${props.thread ?? ""}`) }));
17
- }
18
- function Chat({ agentId, thread, placeholder, onSurfaceAction, autoFocus, loadHistory, label, className, }) {
19
- const conversation = useConversation({ agentId, thread, loadHistory, onSurfaceAction });
20
- return (_jsx(ChatView, { conversation: conversation, placeholder: placeholder, autoFocus: autoFocus, label: label, className: className }));
21
- }
@@ -1,25 +0,0 @@
1
- import type { Conversation } from "./useConversation.js";
2
- export interface ChatViewProps {
3
- conversation: Conversation;
4
- placeholder?: string | undefined;
5
- autoFocus?: boolean | undefined;
6
- /** What the conversation is called to someone who cannot see it. */
7
- label?: string | undefined;
8
- /**
9
- * The box to write in, the line saying the agent is writing, what went wrong and the
10
- * announcement of new words are somewhere else (the shell's dock), so this draws the
11
- * transcript alone.
12
- */
13
- docked?: boolean | undefined;
14
- className?: string | undefined;
15
- }
16
- /**
17
- * A conversation drawn: the person's messages and the agent's, the agent's surfaces inline,
18
- * and (unless it is docked) the box to write in. It draws a `Conversation` it is given, so the
19
- * chat of one agent (`AgentChat`) and the conversation window of a shell (`AgentSpace`) are the
20
- * same drawing of different holders of it.
21
- *
22
- * A surface takes a pick only while it is the last thing said: once the person has answered, in
23
- * a pick or in words, it is a record of what was shown.
24
- */
25
- export declare function ChatView({ conversation, placeholder, autoFocus, label, docked, className, }: ChatViewProps): import("react").JSX.Element;
@@ -1,34 +0,0 @@
1
- import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
2
- import { useMemo, useState } from "react";
3
- import { ErrorText } from "../parts/Input.js";
4
- import { Spinner } from "../parts/Spinner.js";
5
- import { useLanguage, useMessages, useParts } from "../SignalcoreProvider.js";
6
- import { Composer } from "./Composer.js";
7
- import { MessageRow } from "./MessageRow.js";
8
- import { rowsOf } from "./moments.js";
9
- import { useStickToBottom } from "./useStickToBottom.js";
10
- /**
11
- * A conversation drawn: the person's messages and the agent's, the agent's surfaces inline,
12
- * and (unless it is docked) the box to write in. It draws a `Conversation` it is given, so the
13
- * chat of one agent (`AgentChat`) and the conversation window of a shell (`AgentSpace`) are the
14
- * same drawing of different holders of it.
15
- *
16
- * A surface takes a pick only while it is the last thing said: once the person has answered, in
17
- * a pick or in words, it is a record of what was shown.
18
- */
19
- export function ChatView({ conversation, placeholder, autoFocus, label, docked = false, className, }) {
20
- const part = useParts();
21
- const language = useLanguage();
22
- const copy = useMessages();
23
- const { scroller, content } = useStickToBottom();
24
- // The day labels are relative to when the chat opened.
25
- const [now] = useState(() => new Date());
26
- const rows = useMemo(() => rowsOf(conversation.messages, now, language), [conversation.messages, now, language]);
27
- const { loading, answering, waiting } = conversation;
28
- const last = conversation.messages.at(-1);
29
- const latest = last && last.surfaces.length > 0 ? last.id : undefined;
30
- const status = answering ? copy.writing : waiting ? copy.waitingForConfirmation : undefined;
31
- return (_jsxs("section", { ...part("chat", [], className), "aria-label": label ?? copy.agentChat, children: [_jsx("div", { ref: scroller, ...part("chat__scroll"), children: _jsxs("div", { ref: content, ...part("chat__content"), children: [loading && (_jsxs("p", { ...part("chat__note"), children: [_jsx(Spinner, {}), " ", copy.loadingConversation] })), _jsx("ol", { ...part("messages"), children: rows.map((row) => row.kind === "moment" ? (_jsx("li", { ...part("moment"), children: row.label }, row.id)) : (_jsx(MessageRow, { message: row.message, joined: row.joined, onAction: row.message.id === latest && !answering && !waiting && !loading
32
- ? conversation.act
33
- : undefined }, row.message.id))) }), !docked && (_jsx("div", { role: "status", ...part("chat__status"), children: status && (_jsxs(_Fragment, { children: [_jsx(Spinner, {}), " ", status] })) })), !docked && conversation.problem && _jsx(ErrorText, { children: conversation.problem })] }) }), !docked && (_jsxs(_Fragment, { children: [_jsx("div", { "aria-live": "polite", "aria-atomic": "true", ...part("sr-only"), children: conversation.announcement }), _jsx(Composer, { onSend: conversation.send, live: answering || waiting, disabled: loading, placeholder: placeholder ?? copy.defaultPlaceholder, autoFocus: autoFocus })] }))] }));
34
- }
@@ -1,20 +0,0 @@
1
- import { type ReactNode } from "react";
2
- import { type ComposerOptions } from "./useComposer.js";
3
- export interface ComposerProps extends ComposerOptions {
4
- /** What the box is called to someone who cannot see it. */
5
- label?: string | undefined;
6
- placeholder?: string | undefined;
7
- autoFocus?: boolean | undefined;
8
- /** Above the box: what the message is about. */
9
- context?: ReactNode;
10
- /** In the box, beside the send button: the host's own tools (a model, a file, a microphone). */
11
- tools?: ReactNode;
12
- className?: string | undefined;
13
- }
14
- /**
15
- * The message box of both chats: grows with the text, Enter sends, Shift+Enter breaks the line
16
- * and Esc stops a running turn. While a turn runs the button becomes a stop button; while the
17
- * history loads it cannot send, but the box stays free to write in, so the person is never
18
- * dropped out of it. The behavior is `useComposer`'s.
19
- */
20
- export declare function Composer({ label, placeholder, autoFocus, context, tools, className, ...options }: ComposerProps): import("react").JSX.Element;
@@ -1,22 +0,0 @@
1
- import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
- import {} from "react";
3
- import { Icon } from "../parts/Icon.js";
4
- import { useMessages, useParts } from "../SignalcoreProvider.js";
5
- import { useComposer } from "./useComposer.js";
6
- /**
7
- * The message box of both chats: grows with the text, Enter sends, Shift+Enter breaks the line
8
- * and Esc stops a running turn. While a turn runs the button becomes a stop button; while the
9
- * history loads it cannot send, but the box stays free to write in, so the person is never
10
- * dropped out of it. The behavior is `useComposer`'s.
11
- */
12
- export function Composer({ label, placeholder, autoFocus, context, tools, className, ...options }) {
13
- const part = useParts();
14
- const messages = useMessages();
15
- const { input, canSend, send, focus } = useComposer(options);
16
- const { live, onStop } = options;
17
- const stoppable = live === true && onStop !== undefined;
18
- return (_jsxs("form", { ...part("composer", [], className), onSubmit: (event) => {
19
- event.preventDefault();
20
- send();
21
- }, children: [context && _jsx("div", { ...part("composer__context"), children: context }), _jsxs("div", { ...part("composer__box"), onClick: focus, children: [_jsx("textarea", { ...input, autoFocus: autoFocus, placeholder: placeholder, "aria-label": label ?? messages.message, ...part("composer__input") }), _jsxs("div", { ...part("composer__bar"), children: [_jsx("div", { ...part("composer__tools"), children: tools }), stoppable ? (_jsx("button", { type: "button", onClick: onStop, "aria-label": messages.stop, title: messages.stopWithKey, ...part("composer__send", ["stop"]), children: _jsx(Icon, { name: "stop" }) })) : (_jsx("button", { type: "submit", disabled: !canSend, "aria-label": messages.send, ...part("composer__send"), children: _jsx(Icon, { name: "arrowUp" }) }))] })] })] }));
22
- }
@@ -1,22 +0,0 @@
1
- import type { SurfaceAction } from "../surface/types.js";
2
- import type { ChatMessage } from "./types.js";
3
- export interface MessageRowProps {
4
- message: ChatMessage;
5
- /** The same side said the one before: they sit close together. */
6
- joined: boolean;
7
- /**
8
- * What the person does on this message's surfaces. Without it they are a record of what was
9
- * shown: only the latest message of a quiet conversation takes a pick.
10
- */
11
- onAction?: ((action: SurfaceAction) => void) | undefined;
12
- }
13
- /**
14
- * One message: the words (kept as written, line breaks included) and what the agent drew with
15
- * them. Its surfaces are the catalog's, drawn by `Surface`, which shows the text twin of any it
16
- * cannot draw. A person who cannot see the page hears who said it.
17
- *
18
- * A surface the agent placed in a window (`Surface.window`) is not drawn here when the chat is
19
- * part of a shell: the window has it, and the transcript says where, with a way to go there.
20
- * On its own, a chat has no windows, so the surface is drawn in the message.
21
- */
22
- export declare const MessageRow: import("react").MemoExoticComponent<({ message, joined, onAction }: MessageRowProps) => import("react").JSX.Element>;
@@ -1,32 +0,0 @@
1
- import { jsxs as _jsxs, jsx as _jsx } from "react/jsx-runtime";
2
- import { memo } from "react";
3
- import { useMessages, useParts } from "../SignalcoreProvider.js";
4
- import { Surface } from "../surface/Surface.js";
5
- import { placementOf } from "../windows/reduce.js";
6
- import { useReveal } from "../windows/reveal.js";
7
- /**
8
- * One message: the words (kept as written, line breaks included) and what the agent drew with
9
- * them. Its surfaces are the catalog's, drawn by `Surface`, which shows the text twin of any it
10
- * cannot draw. A person who cannot see the page hears who said it.
11
- *
12
- * A surface the agent placed in a window (`Surface.window`) is not drawn here when the chat is
13
- * part of a shell: the window has it, and the transcript says where, with a way to go there.
14
- * On its own, a chat has no windows, so the surface is drawn in the message.
15
- */
16
- export const MessageRow = memo(function MessageRow({ message, joined, onAction }) {
17
- const part = useParts();
18
- const messages = useMessages();
19
- const reveal = useReveal();
20
- return (_jsxs("li", { ...part("message", [message.role, joined && "joined"]), children: [_jsxs("span", { ...part("sr-only"), children: [message.role === "person" ? messages.you : messages.theAgent, ":", " "] }), message.text !== "" && _jsx("p", { ...part("message__text"), children: message.text }), message.surfaces.map((surface) => {
21
- const placement = placementOf(surface);
22
- return reveal && placement ? (_jsx(WindowNote, { placement: placement, reveal: reveal }, surface.id)) : (_jsx("div", { ...part("message__surface"), children: _jsx(Surface, { surface: surface, onAction: onAction }) }, surface.id));
23
- })] }));
24
- });
25
- /** "→ Abierto en Ventas": where a surface went, and a button to go there. */
26
- function WindowNote({ placement, reveal }) {
27
- const part = useParts();
28
- const messages = useMessages();
29
- return (_jsxs("p", { ...part("message__window"), children: [_jsx("span", { "aria-hidden": true, children: "\u2192" }), " ", messages.space.openedIn, " ", _jsx("button", { type: "button", onClick: () => {
30
- reveal(placement.slot);
31
- }, ...part("message__open"), children: placement.title })] }));
32
- }
@@ -1,15 +0,0 @@
1
- import type { SurfaceData } from "../surface/types.js";
2
- import type { RunEvent } from "../stream/reduce.js";
3
- /** What a run that waited for a confirmation said once it went on. */
4
- export interface Arrival {
5
- text: string;
6
- surfaces: SurfaceData[];
7
- /** The run ended without finishing its work (it failed, or was canceled). */
8
- failed: boolean;
9
- }
10
- /**
11
- * What a run said after it paused. The answer to the message already showed everything up to
12
- * the pause, and the journal replays from the start, so only what follows the first
13
- * `run.waiting` is new.
14
- */
15
- export declare function arrivalOf(events: readonly RunEvent[]): Arrival;
@@ -1,25 +0,0 @@
1
- import { surfaceOf } from "../surface/check.js";
2
- /**
3
- * What a run said after it paused. The answer to the message already showed everything up to
4
- * the pause, and the journal replays from the start, so only what follows the first
5
- * `run.waiting` is new.
6
- */
7
- export function arrivalOf(events) {
8
- const paused = events.findIndex((event) => event.type === "run.waiting");
9
- const after = paused === -1 ? events : events.slice(paused + 1);
10
- const words = [];
11
- const surfaces = [];
12
- let failed = false;
13
- for (const event of after) {
14
- if (event.type === "message.finished" && event.text.trim() !== "")
15
- words.push(event.text);
16
- else if (event.type === "ui.surface") {
17
- const surface = surfaceOf(event.surface);
18
- if (surface)
19
- surfaces.push(surface);
20
- }
21
- else if (event.type === "run.finished" && event.status !== "succeeded")
22
- failed = true;
23
- }
24
- return { text: words.join("\n\n"), surfaces, failed };
25
- }
@@ -1,24 +0,0 @@
1
- import type { Schemas } from "@signalcore/sdk";
2
- import type { UiClient } from "../client.js";
3
- import type { ChatMessage } from "./types.js";
4
- /**
5
- * How a chat reads its own past when the host gave it no loader: the caller's conversation in
6
- * the thread (`endUsers.myConversation`, which only an end user's token or a publishable key
7
- * has). A person who has not spoken yet has no conversation, which the API says is not found:
8
- * that is an empty history, not a failure. Nothing when the client cannot say.
9
- */
10
- export declare function historyOf(client: UiClient | undefined, agentId: string): ((thread: string | undefined) => Promise<ChatMessage[]>) | undefined;
11
- /**
12
- * The messages of a conversation as the API lists them (`conversations.messages`), ready for
13
- * `AgentChat`'s `loadHistory`: what a contact sent is the person's, everything the business
14
- * said (the agent, or a teammate who took over) is the agent's. A message with nothing to show
15
- * (a system note, a file this chat cannot draw) is left out.
16
- *
17
- * loadHistory={() => client.conversations.messages(id).then(messagesFromConversation)}
18
- */
19
- /** What a stored message must carry to be drawn: the team's listing and an end user's own
20
- * conversation both have it, the latter nothing more. */
21
- export type StoredMessage = Pick<Schemas["MessageOut"], "id" | "direction" | "author" | "body" | "surfaces" | "created_at">;
22
- export declare function messagesFromConversation(page: {
23
- items: readonly StoredMessage[];
24
- }): ChatMessage[];
@@ -1,45 +0,0 @@
1
- import { surfaceOf } from "../surface/check.js";
2
- /** The thread the API speaks in when a message names none. */
3
- const DEFAULT_THREAD = "default";
4
- /**
5
- * How a chat reads its own past when the host gave it no loader: the caller's conversation in
6
- * the thread (`endUsers.myConversation`, which only an end user's token or a publishable key
7
- * has). A person who has not spoken yet has no conversation, which the API says is not found:
8
- * that is an empty history, not a failure. Nothing when the client cannot say.
9
- */
10
- export function historyOf(client, agentId) {
11
- const mine = client?.endUsers?.myConversation;
12
- if (!mine)
13
- return undefined;
14
- return async (thread) => {
15
- try {
16
- const conversation = await mine(thread ?? DEFAULT_THREAD, { agent_id: agentId });
17
- return messagesFromConversation({ items: conversation.messages });
18
- }
19
- catch (reason) {
20
- if (isNotFound(reason))
21
- return [];
22
- throw reason;
23
- }
24
- };
25
- }
26
- const isNotFound = (reason) => typeof reason === "object" && reason !== null && "status" in reason && reason.status === 404;
27
- export function messagesFromConversation(page) {
28
- return page.items.flatMap((item) => {
29
- if (item.author === "system")
30
- return [];
31
- const surfaces = item.surfaces.flatMap((raw) => surfaceOf(raw) ?? []);
32
- const text = item.body ?? "";
33
- if (text === "" && surfaces.length === 0)
34
- return [];
35
- return [
36
- {
37
- id: item.id,
38
- role: item.direction === "in" ? "person" : "agent",
39
- text,
40
- surfaces,
41
- at: item.created_at,
42
- },
43
- ];
44
- });
45
- }
@@ -1,25 +0,0 @@
1
- import type { Language } from "../messages/index.js";
2
- import type { ChatMessage } from "./types.js";
3
- /** What the list shows, in order: the time a stretch of the conversation began, and messages. */
4
- export type Row = {
5
- kind: "moment";
6
- id: string;
7
- label: string;
8
- }
9
- /** `joined`: the same side said the one before, so they sit close together. */
10
- | {
11
- kind: "message";
12
- message: ChatMessage;
13
- joined: boolean;
14
- };
15
- /**
16
- * "Hoy 10:32", "Ayer 18:05", "12 oct, 09:00", and with the year when it is not this one; the
17
- * words and the dates of the language.
18
- */
19
- export declare function momentLabel(at: Date, now: Date, { locale, messages }: Language): string;
20
- /**
21
- * The conversation as rows: a time above the first message and after every long silence or new
22
- * day, and each message marked as joined to the one before when the same side said both.
23
- * Messages that carry no time (the ones just sent) follow the stretch they are in.
24
- */
25
- export declare function rowsOf(list: readonly ChatMessage[], now: Date, language: Language): Row[];
@@ -1,72 +0,0 @@
1
- /** A silence this long (or a new day) starts a new moment, with its time written above it. */
2
- const MOMENT_GAP_MS = 30 * 60_000;
3
- const FORMATS = new Map();
4
- /** How a locale writes a time and a day; made once, since a chat labels many moments. */
5
- function formatsOf(locale) {
6
- let formats = FORMATS.get(locale);
7
- if (!formats) {
8
- formats = {
9
- time: new Intl.DateTimeFormat(locale, { hour: "2-digit", minute: "2-digit" }),
10
- day: new Intl.DateTimeFormat(locale, { day: "numeric", month: "short" }),
11
- dayAndYear: new Intl.DateTimeFormat(locale, {
12
- day: "numeric",
13
- month: "short",
14
- year: "numeric",
15
- }),
16
- };
17
- FORMATS.set(locale, formats);
18
- }
19
- return formats;
20
- }
21
- const startOfDay = (date) => new Date(date.getFullYear(), date.getMonth(), date.getDate()).getTime();
22
- /**
23
- * "Hoy 10:32", "Ayer 18:05", "12 oct, 09:00", and with the year when it is not this one; the
24
- * words and the dates of the language.
25
- */
26
- export function momentLabel(at, now, { locale, messages }) {
27
- const formats = formatsOf(locale);
28
- const days = Math.round((startOfDay(now) - startOfDay(at)) / 86_400_000);
29
- const time = formats.time.format(at);
30
- if (days === 0)
31
- return `${messages.today} ${time}`;
32
- if (days === 1)
33
- return `${messages.yesterday} ${time}`;
34
- const day = (at.getFullYear() === now.getFullYear() ? formats.day : formats.dayAndYear).format(at);
35
- return `${day}, ${time}`;
36
- }
37
- function timeOf(message) {
38
- if (message.at === undefined)
39
- return undefined;
40
- const at = new Date(message.at);
41
- return Number.isNaN(at.getTime()) ? undefined : at;
42
- }
43
- const sameDay = (a, b) => startOfDay(a) === startOfDay(b);
44
- /**
45
- * The conversation as rows: a time above the first message and after every long silence or new
46
- * day, and each message marked as joined to the one before when the same side said both.
47
- * Messages that carry no time (the ones just sent) follow the stretch they are in.
48
- */
49
- export function rowsOf(list, now, language) {
50
- const rows = [];
51
- let last;
52
- list.forEach((message, index) => {
53
- const at = timeOf(message);
54
- const quiet = at !== undefined && (last === undefined || startsMoment(last, at));
55
- if (at !== undefined && quiet) {
56
- rows.push({
57
- kind: "moment",
58
- id: `moment-${message.id}`,
59
- label: momentLabel(at, now, language),
60
- });
61
- }
62
- const before = list[index - 1];
63
- const joined = !quiet && before?.role === message.role;
64
- rows.push({ kind: "message", message, joined });
65
- if (at !== undefined)
66
- last = at;
67
- });
68
- return rows;
69
- }
70
- function startsMoment(last, at) {
71
- return at.getTime() - last.getTime() >= MOMENT_GAP_MS || !sameDay(last, at);
72
- }
@@ -1,12 +0,0 @@
1
- import type { SurfaceData } from "../surface/types.js";
2
- /** One message of the conversation between a person and the agent that serves them. */
3
- export interface ChatMessage {
4
- id: string;
5
- /** `person` is whoever is talking to the agent; `agent` is the business's side. */
6
- role: "person" | "agent";
7
- text: string;
8
- /** What the agent showed with its words, ready to draw. */
9
- surfaces: SurfaceData[];
10
- /** When it was said, as an ISO 8601 time; a message without one is not placed in time. */
11
- at: string | undefined;
12
- }
@@ -1 +0,0 @@
1
- export {};