@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,78 +0,0 @@
1
- import { type ReactNode } from "react";
2
- import type { ChatMessage } from "../chat/types.js";
3
- import type { SurfaceAction, SurfaceData } from "../surface/types.js";
4
- import { type SpaceDock, type SpaceMode } from "./Dock.js";
5
- import type { DefaultWindowKind } from "./kinds.js";
6
- import { type Spoken } from "./space.js";
7
- import { type SpaceStrip } from "./Strip.js";
8
- /**
9
- * What the host's voice is given to speak with, in the shape of the props `VoiceWindow` (from
10
- * `@signalcore/ui/voice`) takes, so that `renderVoice={(voice) => <VoiceWindow {...voice} />}`
11
- * is all there is to wire.
12
- */
13
- export interface SpaceVoice {
14
- agentId: string;
15
- thread: string | undefined;
16
- /** A turn was answered: what was said and what came back, which the captions show. */
17
- onTurn: (turn: Spoken) => void;
18
- /**
19
- * The agent showed something with its answer. It is placed as a window (one the agent placed
20
- * in none gets the `answer` window), because a person who is listening has no transcript to
21
- * read it in.
22
- */
23
- onSurfaces: (surfaces: readonly SurfaceData[]) => void;
24
- }
25
- export interface AgentSpaceProps {
26
- /** The agent the person talks to. */
27
- agentId: string;
28
- /** The conversation to speak in; the agent remembers it, and every window speaks in it. */
29
- thread?: string | undefined;
30
- /**
31
- * The app's own windows to open, besides the conversation, which is always there: the first
32
- * one listed is on the stage (`["automations", "flow"]`). Windows the viewer may not be shown
33
- * (the provider's `viewer`) are not opened. The agent opens more as it works.
34
- */
35
- windows?: readonly DefaultWindowKind[] | undefined;
36
- /**
37
- * How the person talks to the agent: `"text"` (the box in the dock) or `"voice"`. Without it
38
- * the space keeps the choice itself, starting with writing.
39
- */
40
- mode?: SpaceMode | undefined;
41
- /** The person chose to write or to speak with the dock's button. */
42
- onModeChange?: ((mode: SpaceMode) => void) | undefined;
43
- /**
44
- * What the dock draws when the person speaks (a `VoiceWindow` from `@signalcore/ui/voice`, or
45
- * a voice of the host's own). Without it, there is no voice to choose, and no button for it.
46
- */
47
- renderVoice?: ((voice: SpaceVoice) => ReactNode) | undefined;
48
- /** What was said in this thread before, as `AgentChat` takes it. */
49
- loadHistory?: ((thread: string | undefined) => Promise<ChatMessage[]>) | undefined;
50
- /** The person picked or submitted something on a surface; it has already gone to the agent. */
51
- onSurfaceAction?: ((action: SurfaceAction) => void) | undefined;
52
- /** Draws the strip of windows in place of ours. */
53
- renderStrip?: ((strip: SpaceStrip) => ReactNode) | undefined;
54
- /** Draws the dock in place of ours. */
55
- renderDock?: ((dock: SpaceDock) => ReactNode) | undefined;
56
- placeholder?: string | undefined;
57
- /** What the space is called to someone who cannot see it. */
58
- label?: string | undefined;
59
- className?: string | undefined;
60
- }
61
- /**
62
- * Everything a person sees of an agent, in one place (ADR 0011): a stage with the window that
63
- * matters now, a strip of the ones that are open, and a dock to talk from. The conversation is
64
- * always a window; the others are the app's own (`automations`, `flow`…, drawn from facts by the
65
- * components the provider registers) and the pages the agent places for the person ("show me
66
- * this week's sales" ends in a page, not a bubble in a transcript). A pick on one of those pages
67
- * goes to the agent as the next turn, the way a pick in the chat does.
68
- *
69
- * It follows the conversation (`useConversation`, which the dock, the transcript and the pages
70
- * all speak in) and the journals of the runs it hears the answers of, and gives them to the
71
- * stage (`useWindows`): the stage is rebuilt from the history when it opens, with no resource of
72
- * its own. A window the person closed stays closed until the agent puts something new in it.
73
- *
74
- * With the keyboard, Tab goes from the strip to the stage to the dock, and Esc closes the window
75
- * on the stage (never the conversation). Under 720 pixels wide the strip becomes tabs above the
76
- * stage, which takes the width.
77
- */
78
- export declare function AgentSpace(props: AgentSpaceProps): import("react").JSX.Element;
@@ -1,135 +0,0 @@
1
- import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
- import { useCallback, useEffect, useMemo, useRef, useState, } from "react";
3
- import { useConversation } from "../chat/useConversation.js";
4
- import { Scoped, useMessages, useParts, useSignalcore, WithClient } from "../SignalcoreProvider.js";
5
- import { Dock } from "./Dock.js";
6
- import { hearingRuns } from "./hearing.js";
7
- import { Journal } from "./Journal.js";
8
- import { CHAT_ID, placementOf } from "./reduce.js";
9
- import { RevealContext } from "./reveal.js";
10
- import { SpaceChatContext } from "./space.js";
11
- import { Stage } from "./Stage.js";
12
- import { Strip } from "./Strip.js";
13
- import { useUnread } from "./useUnread.js";
14
- import { useWindows } from "./useWindows.js";
15
- /** The slot of the window an answer's surface gets when the person is listening and it has none. */
16
- const ANSWER_SLOT = "answer";
17
- /**
18
- * Everything a person sees of an agent, in one place (ADR 0011): a stage with the window that
19
- * matters now, a strip of the ones that are open, and a dock to talk from. The conversation is
20
- * always a window; the others are the app's own (`automations`, `flow`…, drawn from facts by the
21
- * components the provider registers) and the pages the agent places for the person ("show me
22
- * this week's sales" ends in a page, not a bubble in a transcript). A pick on one of those pages
23
- * goes to the agent as the next turn, the way a pick in the chat does.
24
- *
25
- * It follows the conversation (`useConversation`, which the dock, the transcript and the pages
26
- * all speak in) and the journals of the runs it hears the answers of, and gives them to the
27
- * stage (`useWindows`): the stage is rebuilt from the history when it opens, with no resource of
28
- * its own. A window the person closed stays closed until the agent puts something new in it.
29
- *
30
- * With the keyboard, Tab goes from the strip to the stage to the dock, and Esc closes the window
31
- * on the stage (never the conversation). Under 720 pixels wide the strip becomes tabs above the
32
- * stage, which takes the width.
33
- */
34
- export function AgentSpace(props) {
35
- return (_jsx(Scoped, { children: _jsx(Hearing, { ...props }, `${props.agentId}/${props.thread ?? ""}`) }));
36
- }
37
- /**
38
- * Holds the stage, and listens at the client for the runs behind the answers so their journals
39
- * can be followed: that is where the app's windows are opened. Below this, every turn a window
40
- * sends is heard, wherever it is sent from.
41
- */
42
- function Hearing(props) {
43
- const { client } = useSignalcore();
44
- const stage = useWindows({ initial: props.windows });
45
- const { observe } = stage;
46
- const [runs, setRuns] = useState([]);
47
- const heard = useMemo(() => hearingRuns(client, (runId) => {
48
- setRuns((now) => (now.includes(runId) ? now : [...now, runId]));
49
- }), [client]);
50
- const ended = useCallback((runId) => {
51
- setRuns((now) => now.filter((each) => each !== runId));
52
- }, []);
53
- return (_jsxs(WithClient, { client: heard, children: [_jsx(Space, { ...props, stage: stage }), runs.map((runId) => (_jsx(Journal, { runId: runId, onEvents: observe, onEnd: ended }, runId)))] }));
54
- }
55
- function Space({ stage, agentId, thread, mode: chosen, onModeChange, renderVoice, loadHistory, onSurfaceAction, renderStrip, renderDock, placeholder, label, className, }) {
56
- const part = useParts();
57
- const copy = useMessages();
58
- const conversation = useConversation({ agentId, thread, loadHistory, onSurfaceAction });
59
- const { windows, closed, focused, focusedId, focus, close, reopen, place, restore } = stage;
60
- const stageBox = useRef(null);
61
- // What the agent placed in the conversation (its past, and each answer after it) is the stage's.
62
- const restored = useRef(false);
63
- const { loading, messages } = conversation;
64
- useEffect(() => {
65
- if (loading)
66
- return;
67
- const surfaces = messages.flatMap((message) => message.surfaces);
68
- if (restored.current) {
69
- place(surfaces);
70
- }
71
- else {
72
- restored.current = true;
73
- restore(surfaces);
74
- }
75
- }, [loading, messages, place, restore]);
76
- const reveal = useCallback((slot) => {
77
- const id = `slot:${slot}`;
78
- if (closed.some((each) => each.id === id))
79
- reopen(id);
80
- else
81
- focus(id);
82
- }, [closed, focus, reopen]);
83
- const [own, setOwn] = useState("text");
84
- const canSpeak = renderVoice !== undefined;
85
- const mode = canSpeak && (chosen ?? own) === "voice" ? "voice" : "text";
86
- const setMode = useCallback((next) => {
87
- setOwn(next);
88
- onModeChange?.(next);
89
- }, [onModeChange]);
90
- const [spoken, setSpoken] = useState();
91
- const voice = useMemo(() => ({
92
- agentId,
93
- thread,
94
- onTurn: (turn) => {
95
- setSpoken({ said: turn.said, answer: turn.answer });
96
- },
97
- onSurfaces: (surfaces) => {
98
- place(surfaces.map((surface) => placementOf(surface)
99
- ? surface
100
- : { ...surface, window: { slot: ANSWER_SLOT, title: copy.space.answer } }));
101
- },
102
- }), [agentId, thread, place, copy.space.answer]);
103
- const chat = useMemo(() => ({ conversation, voice: mode === "voice", spoken }), [conversation, mode, spoken]);
104
- const unread = useUnread(messages, loading, focusedId === CHAT_ID);
105
- const strip = { windows, closed, focusedId, focus, close, reopen, unread };
106
- const busy = conversation.answering || conversation.waiting || loading;
107
- const dock = {
108
- mode,
109
- setMode,
110
- canSpeak,
111
- send: conversation.send,
112
- answering: conversation.answering,
113
- waiting: conversation.waiting,
114
- loading,
115
- problem: conversation.problem,
116
- announcement: conversation.announcement,
117
- voice: mode === "voice" ? renderVoice?.(voice) : undefined,
118
- };
119
- // Esc closes the window on the stage, but not from the dock or while typing in a field of it
120
- // (there it means something else), and never the conversation.
121
- const closeOnEscape = (event) => {
122
- if (event.key !== "Escape" || event.defaultPrevented || focusedId === CHAT_ID)
123
- return;
124
- if (!(event.target instanceof Element) || event.target.closest('[data-sc="dock"]'))
125
- return;
126
- if (event.target.closest("input, textarea, select, [contenteditable]"))
127
- return;
128
- event.preventDefault();
129
- close(focusedId);
130
- stageBox.current?.focus();
131
- };
132
- return (_jsx(RevealContext, { value: reveal, children: _jsx(SpaceChatContext, { value: chat, children: _jsxs("section", { ...part("space", [mode === "voice" && "voice"], className), "aria-label": label ?? copy.space.label, onKeyDown: closeOnEscape, children: [_jsxs("div", { ...part("space__main"), children: [renderStrip ? renderStrip(strip) : _jsx(Strip, { ...strip }), _jsx("div", { ref: stageBox, tabIndex: -1, ...part("space__stage"), children: focused && (_jsx(Stage, { shown: focused, agentId: agentId, thread: thread, onAction: busy ? undefined : conversation.act, onClose: () => {
133
- close(focused.id);
134
- } }, focused.id)) })] }), renderDock ? renderDock(dock) : _jsx(Dock, { dock: dock, placeholder: placeholder })] }) }) }));
135
- }
@@ -1,13 +0,0 @@
1
- import type { SpaceChat } from "./space.js";
2
- export interface CaptionsProps {
3
- chat: Pick<SpaceChat, "conversation" | "spoken">;
4
- /** What the captions are called to someone who cannot see them. */
5
- label?: string | undefined;
6
- className?: string | undefined;
7
- }
8
- /**
9
- * The conversation when the person is listening instead of reading: the last thing they said and
10
- * the last thing the agent answered, as plain lines, and nothing of the transcript. The voice's
11
- * own turn is shown while it is the latest; before the first one, the end of what was written.
12
- */
13
- export declare function Captions({ chat, label, className }: CaptionsProps): import("react").JSX.Element;
@@ -1,22 +0,0 @@
1
- import { jsxs as _jsxs } from "react/jsx-runtime";
2
- import { useMessages, useParts } from "../SignalcoreProvider.js";
3
- /**
4
- * The conversation when the person is listening instead of reading: the last thing they said and
5
- * the last thing the agent answered, as plain lines, and nothing of the transcript. The voice's
6
- * own turn is shown while it is the latest; before the first one, the end of what was written.
7
- */
8
- export function Captions({ chat, label, className }) {
9
- const part = useParts();
10
- const copy = useMessages();
11
- const { said, answer } = chat.spoken ?? lastTurn(chat.conversation.messages);
12
- return (_jsxs("section", { ...part("captions", [], className), "aria-label": label ?? copy.space.captions, children: [said !== "" && (_jsxs("p", { ...part("captions__line", ["person"]), children: [_jsxs("span", { ...part("sr-only"), children: [copy.you, ": "] }), said] })), answer !== "" && (_jsxs("p", { ...part("captions__line", ["agent"]), children: [_jsxs("span", { ...part("sr-only"), children: [copy.theAgent, ": "] }), answer] }))] }));
13
- }
14
- /** What the person last said, and the agent's answer to it if it has come. */
15
- function lastTurn(messages) {
16
- const asked = messages.findLastIndex((message) => message.role === "person");
17
- const said = messages[asked]?.text ?? "";
18
- const reply = messages.slice(asked + 1).find((message) => message.role === "agent");
19
- // Before anyone spoke, the end of what the agent said is what there is.
20
- const answer = asked === -1 ? (messages.findLast((m) => m.role === "agent")?.text ?? "") : (reply?.text ?? "");
21
- return { said, answer };
22
- }
@@ -1,37 +0,0 @@
1
- import type { ReactNode } from "react";
2
- /** How the person talks to the agent: by writing, or by voice (ADR 0011). */
3
- export type SpaceMode = "text" | "voice";
4
- /**
5
- * What a dock is drawn from: how the person talks, how the conversation stands, and what sends
6
- * their words. A host that draws its own dock (`AgentSpace`'s `renderDock`) is given this.
7
- */
8
- export interface SpaceDock {
9
- mode: SpaceMode;
10
- setMode: (mode: SpaceMode) => void;
11
- /** The host gave a voice to speak with, so the person may choose it. */
12
- canSpeak: boolean;
13
- send: (text: string) => void;
14
- /** The agent is writing its answer. */
15
- answering: boolean;
16
- /** The run paused for the owner to confirm something, and goes on when they do. */
17
- waiting: boolean;
18
- /** The history is being read. */
19
- loading: boolean;
20
- /** Something went wrong; the text is for the person. */
21
- problem: string | undefined;
22
- /** What the agent just said, in words, for whoever cannot see the page. */
23
- announcement: string;
24
- /** What the host's voice draws in the dock while the person speaks; nothing when they write. */
25
- voice: ReactNode;
26
- }
27
- export interface DockProps {
28
- dock: SpaceDock;
29
- placeholder?: string | undefined;
30
- }
31
- /**
32
- * Where the person talks to the agent, whichever window is on the stage: the box to write in,
33
- * or the host's voice when they chose to speak, with the way to change between the two. It says
34
- * when the agent is writing or waiting for a confirmation, and what went wrong, because the
35
- * conversation may not be the window they are looking at.
36
- */
37
- export declare function Dock({ dock, placeholder }: DockProps): import("react").JSX.Element;
@@ -1,22 +0,0 @@
1
- import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
2
- import { Composer } from "../chat/Composer.js";
3
- import { Button } from "../parts/Button.js";
4
- import { ErrorText } from "../parts/Input.js";
5
- import { Spinner } from "../parts/Spinner.js";
6
- import { useMessages, useParts } from "../SignalcoreProvider.js";
7
- /**
8
- * Where the person talks to the agent, whichever window is on the stage: the box to write in,
9
- * or the host's voice when they chose to speak, with the way to change between the two. It says
10
- * when the agent is writing or waiting for a confirmation, and what went wrong, because the
11
- * conversation may not be the window they are looking at.
12
- */
13
- export function Dock({ dock, placeholder }) {
14
- const part = useParts();
15
- const copy = useMessages();
16
- const { mode, answering, waiting } = dock;
17
- const status = answering ? copy.writing : waiting ? copy.waitingForConfirmation : undefined;
18
- const toggle = dock.canSpeak && (_jsx(Button, { variant: "ghost", size: "sm", "aria-pressed": mode === "voice", onClick: () => {
19
- dock.setMode(mode === "voice" ? "text" : "voice");
20
- }, children: mode === "voice" ? copy.space.write : copy.space.speak }));
21
- return (_jsxs("div", { ...part("dock"), children: [_jsx("div", { "aria-live": "polite", "aria-atomic": "true", ...part("sr-only"), children: dock.announcement }), _jsx("div", { role: "status", ...part("dock__status"), children: status && (_jsxs(_Fragment, { children: [_jsx(Spinner, {}), " ", status] })) }), dock.problem && _jsx(ErrorText, { children: dock.problem }), mode === "voice" ? (_jsxs("div", { ...part("dock__voice"), children: [dock.voice, toggle] })) : (_jsx(Composer, { onSend: dock.send, live: answering || waiting, disabled: dock.loading, placeholder: placeholder ?? copy.defaultPlaceholder, tools: toggle }))] }));
22
- }
@@ -1,15 +0,0 @@
1
- import type { RunEvent } from "../stream/reduce.js";
2
- export interface JournalProps {
3
- runId: string;
4
- /** What the run has said so far, again and with more each time it says something. */
5
- onEvents: (runId: string, events: readonly RunEvent[]) => void;
6
- /** The run is over, or could not be followed: nothing more will come of it. */
7
- onEnd: (runId: string) => void;
8
- }
9
- /**
10
- * Follows one run's journal (`useRunStream`) and hands what it says to the stage: the surfaces it
11
- * placed and the windows it opened. It draws nothing. A shell keeps one for each answer it hears
12
- * until the run ends, so a run that opens a window late (after it paused for an approval) opens
13
- * it when it happens.
14
- */
15
- export declare function Journal({ runId, onEvents, onEnd }: JournalProps): null;
@@ -1,19 +0,0 @@
1
- import { useEffect } from "react";
2
- import { useRunStream } from "../stream/useRunStream.js";
3
- /**
4
- * Follows one run's journal (`useRunStream`) and hands what it says to the stage: the surfaces it
5
- * placed and the windows it opened. It draws nothing. A shell keeps one for each answer it hears
6
- * until the run ends, so a run that opens a window late (after it paused for an approval) opens
7
- * it when it happens.
8
- */
9
- export function Journal({ runId, onEvents, onEnd }) {
10
- const { events, status } = useRunStream(runId, { cards: false });
11
- useEffect(() => {
12
- onEvents(runId, events);
13
- }, [runId, events, onEvents]);
14
- useEffect(() => {
15
- if (status === "done" || status === "failed")
16
- onEnd(runId);
17
- }, [runId, status, onEnd]);
18
- return null;
19
- }
@@ -1,7 +0,0 @@
1
- import type { Slot } from "../look.js";
2
- import type { AgentWindow } from "./reduce.js";
3
- /** The mark of a kind of window; decoration only, the window's title is what names it. */
4
- export declare function KindMark({ kind, slot }: {
5
- kind: AgentWindow["kind"];
6
- slot: Slot;
7
- }): import("react").JSX.Element;
@@ -1,31 +0,0 @@
1
- import { jsx as _jsx } from "react/jsx-runtime";
2
- import { Icon, Mark } from "../parts/Icon.js";
3
- /**
4
- * What each kind of window is drawn with: a mark that says what it is at a glance, in the
5
- * strip and in the window's own bar. Phosphor Icons (MIT, phosphoricons.com), the regular
6
- * weight, like the rest of the package's marks.
7
- */
8
- const DRAWINGS = {
9
- chat: {
10
- path: "M128,24A104,104,0,0,0,36.18,176.88L24.83,210.93a16,16,0,0,0,20.24,20.24l34.05-11.35A104,104,0,1,0,128,24Zm0,192a87.87,87.87,0,0,1-44.06-11.81,8,8,0,0,0-6.54-.67L40,216,52.47,178.6a8,8,0,0,0-.66-6.54A88,88,0,1,1,128,216Z",
11
- },
12
- automations: { icon: "listChecks" },
13
- flow: {
14
- path: "M160,112h48a16,16,0,0,0,16-16V48a16,16,0,0,0-16-16H160a16,16,0,0,0-16,16V64H128a24,24,0,0,0-24,24v32H72v-8A16,16,0,0,0,56,96H24A16,16,0,0,0,8,112v32a16,16,0,0,0,16,16H56a16,16,0,0,0,16-16v-8h32v32a24,24,0,0,0,24,24h16v16a16,16,0,0,0,16,16h48a16,16,0,0,0,16-16V160a16,16,0,0,0-16-16H160a16,16,0,0,0-16,16v16H128a8,8,0,0,1-8-8V88a8,8,0,0,1,8-8h16V96A16,16,0,0,0,160,112ZM56,144H24V112H56v32Zm104,16h48v48H160Zm0-112h48V96H160Z",
15
- },
16
- voice: { icon: "microphone" },
17
- browser: {
18
- path: "M128,24h0A104,104,0,1,0,232,128,104.12,104.12,0,0,0,128,24Zm88,104a87.61,87.61,0,0,1-3.33,24H174.16a157.44,157.44,0,0,0,0-48h38.51A87.61,87.61,0,0,1,216,128ZM102,168H154a115.11,115.11,0,0,1-26,45A115.27,115.27,0,0,1,102,168Zm-3.9-16a140.84,140.84,0,0,1,0-48h59.88a140.84,140.84,0,0,1,0,48ZM40,128a87.61,87.61,0,0,1,3.33-24H81.84a157.44,157.44,0,0,0,0,48H43.33A87.61,87.61,0,0,1,40,128ZM154,88H102a115.11,115.11,0,0,1,26-45A115.27,115.27,0,0,1,154,88Zm52.33,0H170.71a135.28,135.28,0,0,0-22.3-45.6A88.29,88.29,0,0,1,206.37,88ZM107.59,42.4A135.28,135.28,0,0,0,85.29,88H49.63A88.29,88.29,0,0,1,107.59,42.4ZM49.63,168H85.29a135.28,135.28,0,0,0,22.3,45.6A88.29,88.29,0,0,1,49.63,168Zm98.78,45.6a135.28,135.28,0,0,0,22.3-45.6h35.66A88.29,88.29,0,0,1,148.41,213.6Z",
19
- },
20
- live: {
21
- path: "M128,88a40,40,0,1,0,40,40A40,40,0,0,0,128,88Zm0,64a24,24,0,1,1,24-24A24,24,0,0,1,128,152Zm73.71,7.14a80,80,0,0,1-14.08,22.2,8,8,0,0,1-11.92-10.67,63.95,63.95,0,0,0,0-85.33,8,8,0,1,1,11.92-10.67,80.08,80.08,0,0,1,14.08,84.47ZM69,103.09a64,64,0,0,0,11.26,67.58,8,8,0,0,1-11.92,10.67,79.93,79.93,0,0,1,0-106.67A8,8,0,1,1,80.29,85.34,63.77,63.77,0,0,0,69,103.09ZM248,128a119.58,119.58,0,0,1-34.29,84,8,8,0,1,1-11.42-11.2,103.9,103.9,0,0,0,0-145.56A8,8,0,1,1,213.71,44,119.58,119.58,0,0,1,248,128ZM53.71,200.78A8,8,0,1,1,42.29,212a119.87,119.87,0,0,1,0-168,8,8,0,1,1,11.42,11.2,103.9,103.9,0,0,0,0,145.56Z",
22
- },
23
- surface: {
24
- path: "M216,40H40A16,16,0,0,0,24,56V200a16,16,0,0,0,16,16H216a16,16,0,0,0,16-16V56A16,16,0,0,0,216,40Zm0,160H40V56H216V200ZM80,84A12,12,0,1,1,68,72,12,12,0,0,1,80,84Zm40,0a12,12,0,1,1-12-12A12,12,0,0,1,120,84Z",
25
- },
26
- };
27
- /** The mark of a kind of window; decoration only, the window's title is what names it. */
28
- export function KindMark({ kind, slot }) {
29
- const drawing = DRAWINGS[kind];
30
- return "icon" in drawing ? (_jsx(Icon, { name: drawing.icon, slot: slot })) : (_jsx(Mark, { path: drawing.path, slot: slot }));
31
- }
@@ -1,8 +0,0 @@
1
- /**
2
- * What a window says instead of itself: that it is loading, that it could not be (`failed` is the
3
- * window's own sentence), or that it has nothing to draw from.
4
- */
5
- export declare function Pending({ state, failed, }: {
6
- state: "loading" | "failed" | "unavailable";
7
- failed: string;
8
- }): import("react").JSX.Element;
@@ -1,17 +0,0 @@
1
- import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
- import { Spinner } from "../parts/Spinner.js";
3
- import { ErrorText } from "../parts/Input.js";
4
- import { useMessages, useParts } from "../SignalcoreProvider.js";
5
- /**
6
- * What a window says instead of itself: that it is loading, that it could not be (`failed` is the
7
- * window's own sentence), or that it has nothing to draw from.
8
- */
9
- export function Pending({ state, failed, }) {
10
- const part = useParts();
11
- const copy = useMessages();
12
- if (state === "failed")
13
- return _jsx(ErrorText, { children: failed });
14
- if (state === "unavailable")
15
- return _jsx("p", { ...part("note"), children: copy.windows.unavailable });
16
- return (_jsxs("p", { role: "status", ...part("note"), children: [_jsx(Spinner, {}), " ", copy.windows.loading] }));
17
- }
@@ -1,18 +0,0 @@
1
- import type { SurfaceAction } from "../surface/types.js";
2
- import { type AgentWindow } from "./reduce.js";
3
- export interface StageProps {
4
- /** The window on the stage. */
5
- shown: AgentWindow;
6
- agentId: string;
7
- thread: string | undefined;
8
- /** What the person does on a generated window; nothing while the conversation is busy. */
9
- onAction: ((action: SurfaceAction) => void) | undefined;
10
- onClose: () => void;
11
- }
12
- /**
13
- * The window on the stage, full size, in its frame. A generated window is a surface; a default
14
- * one is drawn by the component the provider's registry has for its kind, and one with none
15
- * says what the agent said it shows. Whatever a component does, it cannot take the shell down:
16
- * if it throws, the window shows its words instead and the rest carries on.
17
- */
18
- export declare function Stage({ shown, agentId, thread, onAction, onClose }: StageProps): import("react").JSX.Element;
@@ -1,21 +0,0 @@
1
- import { jsx as _jsx } from "react/jsx-runtime";
2
- import { SurfaceBoundary } from "../surface/SurfaceBoundary.js";
3
- import { CHAT_ID } from "./reduce.js";
4
- import { useWindowComponents, WindowTwin } from "./registry.js";
5
- import { SurfaceWindow } from "./SurfaceWindow.js";
6
- import { WindowFrame } from "./WindowFrame.js";
7
- /**
8
- * The window on the stage, full size, in its frame. A generated window is a surface; a default
9
- * one is drawn by the component the provider's registry has for its kind, and one with none
10
- * says what the agent said it shows. Whatever a component does, it cannot take the shell down:
11
- * if it throws, the window shows its words instead and the rest carries on.
12
- */
13
- export function Stage({ shown, agentId, thread, onAction, onClose }) {
14
- const components = useWindowComponents();
15
- if (shown.kind === "surface") {
16
- return (_jsx(SurfaceWindow, { surface: shown.surface, title: shown.title, onAction: onAction, onClose: onClose }));
17
- }
18
- const Component = components[shown.kind];
19
- const twin = _jsx(WindowTwin, { text: shown.fallbackText });
20
- return (_jsx(WindowFrame, { title: shown.title, kind: shown.kind, onClose: shown.id === CHAT_ID ? undefined : onClose, children: _jsx(SurfaceBoundary, { fallback: twin, resetKey: shown, children: Component ? (_jsx(Component, { agentId: agentId, thread: thread, label: shown.title, fallbackText: shown.fallbackText, params: shown.params })) : (twin) }) }));
21
- }
@@ -1,9 +0,0 @@
1
- import type { ReactNode } from "react";
2
- import type { Tone } from "./status.js";
3
- /** A state in words, with a dot of its color: the color is never the whole message. */
4
- export declare function StatusLabel({ tone, live, children, }: {
5
- tone: Tone;
6
- /** Something is happening right now: the dot breathes. */
7
- live?: boolean | undefined;
8
- children: ReactNode;
9
- }): import("react").JSX.Element;
@@ -1,7 +0,0 @@
1
- import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
- import { useParts } from "../SignalcoreProvider.js";
3
- /** A state in words, with a dot of its color: the color is never the whole message. */
4
- export function StatusLabel({ tone, live = false, children, }) {
5
- const part = useParts();
6
- return (_jsxs("span", { ...part("status", [tone, live && "live"]), children: [_jsx("span", { "aria-hidden": true, ...part("status__dot", [tone]) }), children] }));
7
- }
@@ -1,17 +0,0 @@
1
- import type { Windows } from "./useWindows.js";
2
- /**
3
- * What a strip is drawn from: the open windows and the ones the person closed, which window is
4
- * on the stage, and what the person can do about them. A host that draws its own strip
5
- * (`AgentSpace`'s `renderStrip`) is given this.
6
- */
7
- export type SpaceStrip = Pick<Windows, "windows" | "closed" | "focusedId" | "focus" | "close" | "reopen"> & {
8
- /** The agent said something while another window was on the stage. */
9
- unread: boolean;
10
- };
11
- /**
12
- * The open windows, each a button with its mark and title that brings it to the stage, the one
13
- * on the stage marked. A window is closed from its own bar (or with Esc), where it is; the ones
14
- * the person closed wait after the open ones, quieter, to be opened again with one press. Tab
15
- * goes from one button to the next, in the order the windows were opened.
16
- */
17
- export declare function Strip({ windows, closed, focusedId, focus, reopen, unread }: SpaceStrip): import("react").JSX.Element;
@@ -1,42 +0,0 @@
1
- import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
2
- import { useEffect, useRef } from "react";
3
- import { useMessages, useParts } from "../SignalcoreProvider.js";
4
- import { KindMark } from "./KindMark.js";
5
- import { CHAT_ID } from "./reduce.js";
6
- /**
7
- * The open windows, each a button with its mark and title that brings it to the stage, the one
8
- * on the stage marked. A window is closed from its own bar (or with Esc), where it is; the ones
9
- * the person closed wait after the open ones, quieter, to be opened again with one press. Tab
10
- * goes from one button to the next, in the order the windows were opened.
11
- */
12
- export function Strip({ windows, closed, focusedId, focus, reopen, unread }) {
13
- const part = useParts();
14
- const copy = useMessages();
15
- const onStage = useRef(null);
16
- // A window the agent opens may be past the edge of a narrow strip: bring it into sight.
17
- useEffect(() => {
18
- const tab = onStage.current;
19
- if (tab?.parentElement)
20
- showInBar(tab, tab.parentElement);
21
- }, [focusedId]);
22
- return (_jsxs("div", { role: "group", "aria-label": copy.space.windows, ...part("strip"), children: [windows.map((window) => {
23
- const current = window.id === focusedId;
24
- return (_jsxs("button", { ref: current ? onStage : undefined, type: "button", "aria-current": current ? "true" : undefined, onClick: () => {
25
- focus(window.id);
26
- }, ...part("strip__tab", [current && "current"]), children: [_jsx(KindMark, { kind: window.kind, slot: "strip__mark" }), _jsx("span", { ...part("strip__title"), children: window.title }), unread && window.id === CHAT_ID && (_jsxs(_Fragment, { children: [" ", _jsx("span", { role: "img", "aria-label": copy.space.newMessage, ...part("strip__dot") })] }))] }, window.id));
27
- }), closed.map((window) => (_jsxs("button", { type: "button", "aria-label": copy.space.reopen(window.title), onClick: () => {
28
- reopen(window.id);
29
- }, ...part("strip__tab", ["closed"]), children: [_jsx(KindMark, { kind: window.kind, slot: "strip__mark" }), _jsx("span", { ...part("strip__title"), children: window.title })] }, window.id)))] }));
30
- }
31
- /**
32
- * Scrolls the strip, and only the strip, so that the tab is in the middle of it where it
33
- * overflows (a row of tabs, or a long rail). The page it is on stays where it is.
34
- */
35
- function showInBar(tab, bar) {
36
- if (bar.scrollWidth > bar.clientWidth) {
37
- bar.scrollLeft = tab.offsetLeft - bar.offsetLeft - (bar.clientWidth - tab.offsetWidth) / 2;
38
- }
39
- if (bar.scrollHeight > bar.clientHeight) {
40
- bar.scrollTop = tab.offsetTop - bar.offsetTop - (bar.clientHeight - tab.offsetHeight) / 2;
41
- }
42
- }
@@ -1,20 +0,0 @@
1
- import type { SurfaceAction, SurfaceData } from "../surface/types.js";
2
- export interface SurfaceWindowProps {
3
- surface: SurfaceData;
4
- /** What the window is called. Default: the title the agent placed the surface with. */
5
- title?: string | undefined;
6
- /**
7
- * What the person did on the surface (a pick, a form), in the shape `invoke` expects. The shell
8
- * sends it to the agent as the next turn, the way the chat does; without it the window is a
9
- * record of what was shown.
10
- */
11
- onAction?: ((action: SurfaceAction) => void) | undefined;
12
- onClose?: (() => void) | undefined;
13
- className?: string | undefined;
14
- }
15
- /**
16
- * A generated window: a surface the agent composed from the catalog, drawn in a frame. It is the
17
- * same `Surface` the transcript draws, with the same rules (a surface it cannot draw shows its
18
- * text twin, picks go back as actions and never as typed text), in a page of its own.
19
- */
20
- export declare function SurfaceWindow({ surface, title, onAction, onClose, className, }: SurfaceWindowProps): import("react").JSX.Element;
@@ -1,12 +0,0 @@
1
- import { jsx as _jsx } from "react/jsx-runtime";
2
- import { Surface } from "../surface/Surface.js";
3
- import { placementOf } from "./reduce.js";
4
- import { WindowFrame } from "./WindowFrame.js";
5
- /**
6
- * A generated window: a surface the agent composed from the catalog, drawn in a frame. It is the
7
- * same `Surface` the transcript draws, with the same rules (a surface it cannot draw shows its
8
- * text twin, picks go back as actions and never as typed text), in a page of its own.
9
- */
10
- export function SurfaceWindow({ surface, title, onAction, onClose, className, }) {
11
- return (_jsx(WindowFrame, { title: title ?? placementOf(surface)?.title ?? surface.fallback_text, kind: "surface", onClose: onClose, className: className, children: _jsx(Surface, { surface: surface, onAction: onAction }) }));
12
- }
@@ -1,23 +0,0 @@
1
- import { type ReactNode } from "react";
2
- import type { AgentWindow } from "./reduce.js";
3
- export interface WindowFrameProps {
4
- /** What the window is called: its heading, which names it to someone who cannot see it. */
5
- title: string;
6
- /** What the window is, for its mark and for a host's styles (`sc-window--flow`). */
7
- kind: AgentWindow["kind"];
8
- /**
9
- * Closes the window, with a button in its bar. Without it the window has none: the
10
- * conversation is the one a stage cannot lose.
11
- */
12
- onClose?: (() => void) | undefined;
13
- children: ReactNode;
14
- className?: string | undefined;
15
- }
16
- /**
17
- * The chrome every window gets on a stage: its mark and title in a bar, a way to close it, and
18
- * the room for its content, which scrolls inside while the bar stays. A window is a plain
19
- * component, so a host may use the frame around its own content, anywhere, without the shell.
20
- * The frame is a named group, not a landmark: the windows it holds (the conversation, the
21
- * automations) are the landmarks, and nesting two regions of one name only repeats it.
22
- */
23
- export declare function WindowFrame(props: WindowFrameProps): import("react").JSX.Element;
@@ -1,22 +0,0 @@
1
- import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
- import { useId } from "react";
3
- import { IconButton } from "../parts/Button.js";
4
- import { Icon } from "../parts/Icon.js";
5
- import { Scoped, useMessages, useParts } from "../SignalcoreProvider.js";
6
- import { KindMark } from "./KindMark.js";
7
- /**
8
- * The chrome every window gets on a stage: its mark and title in a bar, a way to close it, and
9
- * the room for its content, which scrolls inside while the bar stays. A window is a plain
10
- * component, so a host may use the frame around its own content, anywhere, without the shell.
11
- * The frame is a named group, not a landmark: the windows it holds (the conversation, the
12
- * automations) are the landmarks, and nesting two regions of one name only repeats it.
13
- */
14
- export function WindowFrame(props) {
15
- return (_jsx(Scoped, { children: _jsx(Framed, { ...props }) }));
16
- }
17
- function Framed({ title, kind, onClose, children, className }) {
18
- const part = useParts();
19
- const copy = useMessages();
20
- const headingId = useId();
21
- return (_jsxs("div", { role: "group", ...part("window", [kind], className), "aria-labelledby": headingId, children: [_jsxs("header", { ...part("window__bar"), children: [_jsx(KindMark, { kind: kind, slot: "window__mark" }), _jsx("h2", { id: headingId, ...part("window__title"), children: title }), onClose && (_jsx(IconButton, { label: copy.space.close(title), onClick: onClose, children: _jsx(Icon, { name: "x" }) }))] }), _jsx("div", { ...part("window__body"), children: children })] }));
22
- }