@signalcore/ui 0.1.0 → 1.0.0-beta.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (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 +1119 -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 +534 -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 +1795 -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 +270 -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 +6961 -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 +596 -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,11 +0,0 @@
1
- import type { UiClient } from "../client.js";
2
- /**
3
- * The same client, told of the run behind each answer the agent gives. A shell needs the runs'
4
- * journals (that is where the app's own windows are opened, `ui.window`), and a turn can be sent
5
- * from the chat, from a voice window or from a generated one: listening at the client is the one
6
- * place that sees them all, and none of them has to know the shell is there.
7
- *
8
- * A client that cannot invoke an agent, or cannot read a run's journal, is returned as it is:
9
- * there is nothing to hear, or nothing to follow it with.
10
- */
11
- export declare function hearingRuns(client: UiClient | undefined, onRun: (runId: string) => void): UiClient | undefined;
@@ -1,26 +0,0 @@
1
- /**
2
- * The same client, told of the run behind each answer the agent gives. A shell needs the runs'
3
- * journals (that is where the app's own windows are opened, `ui.window`), and a turn can be sent
4
- * from the chat, from a voice window or from a generated one: listening at the client is the one
5
- * place that sees them all, and none of them has to know the shell is there.
6
- *
7
- * A client that cannot invoke an agent, or cannot read a run's journal, is returned as it is:
8
- * there is nothing to hear, or nothing to follow it with.
9
- */
10
- export function hearingRuns(client, onRun) {
11
- const invoke = client?.agents?.invoke;
12
- if (!client?.runs || !invoke)
13
- return client;
14
- return {
15
- ...client,
16
- agents: {
17
- ...client.agents,
18
- invoke: async (agentId, body) => {
19
- const answer = await invoke(agentId, body);
20
- if (answer.run_id !== null)
21
- onRun(answer.run_id);
22
- return answer;
23
- },
24
- },
25
- };
26
- }
@@ -1,47 +0,0 @@
1
- import type { ComponentType } from "react";
2
- /**
3
- * The windows the app draws from facts, never generates (ADR 0011). The first four are the ones
4
- * an agent may open for a person (`signalcore_core.ui.windows`, which this mirrors: the kinds are
5
- * the engine's, so a `ui.window` event names one of them); `browser` and `live` are windows too,
6
- * but the platform opens those as a run shows what it drives, and the agent never asks for them.
7
- */
8
- export declare const DEFAULT_WINDOW_KINDS: readonly ["chat", "automations", "flow", "voice", "browser", "live"];
9
- export type DefaultWindowKind = (typeof DEFAULT_WINDOW_KINDS)[number];
10
- /**
11
- * The windows an end user of the business may be shown (ADR 0009): the conversation and the
12
- * voice. The ones about the business itself (what it automates, how the agent is built, the
13
- * browser it drives) are its owner's, and need an owner's credential: the engine does not offer
14
- * them to an end user's agent, and the shell does not open them for an end user's client.
15
- */
16
- export declare const END_USER_WINDOW_KINDS: readonly DefaultWindowKind[];
17
- /** Who is looking: the business's owner (or its team), or a person the business serves. */
18
- export type Viewer = "owner" | "end_user";
19
- export declare function isDefaultWindowKind(value: unknown): value is DefaultWindowKind;
20
- /** The kinds of window this viewer may be shown. */
21
- export declare function kindsFor(viewer: Viewer): readonly DefaultWindowKind[];
22
- /**
23
- * What a component that draws a default window is given by the shell. Every kind takes the same
24
- * props, so a host registers its own for any kind, and the windows that live in other entries
25
- * (`FlowWindow` from `@signalcore/ui/flow`, `VoiceWindow` from `@signalcore/ui/voice`) are
26
- * registered as they are: what they do not read, they ignore.
27
- */
28
- export interface DefaultWindowProps {
29
- agentId: string;
30
- /** The conversation the shell speaks in; the voice speaks in the same one. */
31
- thread: string | undefined;
32
- /** What the window is called: its title, for someone who cannot see it. */
33
- label: string;
34
- /**
35
- * What the agent said the window shows, when it opened it (`ui.window`): the text twin, for a
36
- * window that is drawn by no component here. Absent for a window the host opened.
37
- */
38
- fallbackText: string | undefined;
39
- /**
40
- * What the host opened the window with, for the kinds that need more than the agent can say:
41
- * `sessionId` for a `browser`, `streamId` (and `aspect`) for a `live`.
42
- */
43
- params: Readonly<Record<string, string>>;
44
- className?: string | undefined;
45
- }
46
- /** The components that draw the default windows, by kind. A kind with none shows its text twin. */
47
- export type DefaultWindowComponents = Partial<Record<DefaultWindowKind, ComponentType<DefaultWindowProps>>>;
@@ -1,28 +0,0 @@
1
- /**
2
- * The windows the app draws from facts, never generates (ADR 0011). The first four are the ones
3
- * an agent may open for a person (`signalcore_core.ui.windows`, which this mirrors: the kinds are
4
- * the engine's, so a `ui.window` event names one of them); `browser` and `live` are windows too,
5
- * but the platform opens those as a run shows what it drives, and the agent never asks for them.
6
- */
7
- export const DEFAULT_WINDOW_KINDS = [
8
- "chat",
9
- "automations",
10
- "flow",
11
- "voice",
12
- "browser",
13
- "live",
14
- ];
15
- /**
16
- * The windows an end user of the business may be shown (ADR 0009): the conversation and the
17
- * voice. The ones about the business itself (what it automates, how the agent is built, the
18
- * browser it drives) are its owner's, and need an owner's credential: the engine does not offer
19
- * them to an end user's agent, and the shell does not open them for an end user's client.
20
- */
21
- export const END_USER_WINDOW_KINDS = ["chat", "voice"];
22
- export function isDefaultWindowKind(value) {
23
- return DEFAULT_WINDOW_KINDS.some((kind) => kind === value);
24
- }
25
- /** The kinds of window this viewer may be shown. */
26
- export function kindsFor(viewer) {
27
- return viewer === "owner" ? DEFAULT_WINDOW_KINDS : END_USER_WINDOW_KINDS;
28
- }
@@ -1,98 +0,0 @@
1
- import type { Placement, SurfaceData } from "../surface/types.js";
2
- import type { RunEvent } from "../stream/reduce.js";
3
- import { type DefaultWindowKind } from "./kinds.js";
4
- /** The conversation is a window every stage has, first in the order, and it cannot be closed. */
5
- export declare const CHAT_ID: DefaultWindowKind;
6
- interface Opened {
7
- /** Stable for as long as the window is the same one: its slot, or its kind. */
8
- id: string;
9
- title: string;
10
- /** When it was opened (milliseconds, the host's clock); a reopened window starts again. */
11
- openedAt: number;
12
- }
13
- /**
14
- * A page the agent composed and placed (`Surface.window`): the last surface of its slot. Nothing
15
- * is patched in place; a new surface in the slot replaces this one.
16
- */
17
- export interface GeneratedWindow extends Opened {
18
- kind: "surface";
19
- slot: string;
20
- surface: SurfaceData;
21
- }
22
- /** A window the app draws from facts, never generated (`chat`, `automations`, `flow`…). */
23
- export interface DefaultWindow extends Opened {
24
- kind: DefaultWindowKind;
25
- /** The agent's words for what the window shows, when it opened it: the window's text twin. */
26
- fallbackText: string | undefined;
27
- /** What the host opened it with (`sessionId` of a browser, `streamId` of a live stream). */
28
- params: Readonly<Record<string, string>>;
29
- }
30
- export type AgentWindow = GeneratedWindow | DefaultWindow;
31
- export declare const isDefault: (window: AgentWindow) => window is DefaultWindow;
32
- /** What a default window is called when nobody named it. */
33
- export type TitleOf = (kind: DefaultWindowKind) => string;
34
- /** The state of a stage, derived from facts and from what the person did; see `reduce`. */
35
- export interface WindowsState {
36
- /** The open windows, in the order they were opened; the conversation is the first. */
37
- windows: AgentWindow[];
38
- /** The one on the stage. */
39
- focusedId: string;
40
- /**
41
- * The windows the person closed, the latest first, for them to reopen. A closed window stays
42
- * closed until they reopen it or the agent puts something new in it: the same surface or
43
- * event reaching the stage again (a history read twice) does not bring it back.
44
- */
45
- closed: AgentWindow[];
46
- /** The default windows this viewer may be shown; the others are never opened. */
47
- allowed: readonly DefaultWindowKind[];
48
- titleOf: TitleOf;
49
- /** The surfaces and journal events already dealt with, so nothing is placed twice. */
50
- seen: ReadonlySet<string>;
51
- }
52
- export interface BeginOptions {
53
- /** Default windows to open besides the conversation; the first one listed takes the stage. */
54
- initial: readonly DefaultWindowKind[];
55
- allowed: readonly DefaultWindowKind[];
56
- titleOf: TitleOf;
57
- at: number;
58
- }
59
- export type Action =
60
- /** The agent showed these surfaces; the ones with a window are placed (not taking the stage if `quiet`). */
61
- {
62
- type: "place";
63
- surfaces: readonly SurfaceData[];
64
- quiet: boolean;
65
- at: number;
66
- }
67
- /** A run's journal, from the start or with more of it: what it placed and opened. */
68
- | {
69
- type: "journal";
70
- runId: string;
71
- events: readonly RunEvent[];
72
- at: number;
73
- } | {
74
- type: "open";
75
- kind: DefaultWindowKind;
76
- title?: string | undefined;
77
- fallbackText?: string | undefined;
78
- params?: Readonly<Record<string, string>> | undefined;
79
- at: number;
80
- } | {
81
- type: "focus";
82
- id: string;
83
- } | {
84
- type: "close";
85
- id: string;
86
- } | {
87
- type: "reopen";
88
- id: string;
89
- at: number;
90
- };
91
- export declare function begin({ initial, allowed, titleOf, at }: BeginOptions): WindowsState;
92
- export declare function reduce(state: WindowsState, action: Action): WindowsState;
93
- /**
94
- * Where a surface says it goes, if it does, with the title the window will have: the one it was
95
- * placed with, else its slot. The payload is a model's, so it is read defensively.
96
- */
97
- export declare function placementOf(surface: SurfaceData): Placement | undefined;
98
- export {};
@@ -1,151 +0,0 @@
1
- import { surfaceOf } from "../surface/check.js";
2
- import { isDefaultWindowKind } from "./kinds.js";
3
- /** The conversation is a window every stage has, first in the order, and it cannot be closed. */
4
- export const CHAT_ID = "chat";
5
- /** How many closed windows the stage remembers, for the person to reopen. */
6
- const MAX_CLOSED = 8;
7
- export const isDefault = (window) => window.kind !== "surface";
8
- export function begin({ initial, allowed, titleOf, at }) {
9
- // The conversation is the window every viewer has.
10
- const permitted = allowed.includes(CHAT_ID) ? allowed : [CHAT_ID, ...allowed];
11
- const first = {
12
- windows: [],
13
- focusedId: CHAT_ID,
14
- closed: [],
15
- allowed: permitted,
16
- titleOf,
17
- seen: new Set(),
18
- };
19
- const opened = [CHAT_ID, ...initial].reduce((state, kind) => open(state, { kind, at }), first);
20
- const listed = initial.find((kind) => permitted.includes(kind));
21
- return { ...opened, focusedId: listed ?? CHAT_ID };
22
- }
23
- export function reduce(state, action) {
24
- switch (action.type) {
25
- case "place":
26
- return action.surfaces.reduce((now, surface) => place(now, surface, action.quiet, action.at), state);
27
- case "journal":
28
- return action.events.reduce((now, event, index) => hear(now, `${action.runId}#${index}`, event, action.at), state);
29
- case "open":
30
- return open(state, action);
31
- case "focus":
32
- return state.windows.some((window) => window.id === action.id)
33
- ? { ...state, focusedId: action.id }
34
- : state;
35
- case "close":
36
- return close(state, action.id);
37
- case "reopen": {
38
- const window = state.closed.find((each) => each.id === action.id);
39
- if (!window)
40
- return state;
41
- return {
42
- ...state,
43
- windows: [...state.windows, { ...window, openedAt: action.at }],
44
- closed: state.closed.filter((each) => each.id !== action.id),
45
- focusedId: window.id,
46
- };
47
- }
48
- }
49
- }
50
- /** A surface the agent showed: a window if it says where, replacing what its slot had. */
51
- function place(state, surface, quiet, at) {
52
- const placement = placementOf(surface);
53
- if (!placement || state.seen.has(surface.id))
54
- return state;
55
- const id = `slot:${placement.slot}`;
56
- const before = state.windows.find((window) => window.id === id);
57
- const window = {
58
- id,
59
- kind: "surface",
60
- slot: placement.slot,
61
- title: placement.title,
62
- surface,
63
- openedAt: before?.openedAt ?? at,
64
- };
65
- return {
66
- ...state,
67
- windows: withWindow(state.windows, window),
68
- closed: state.closed.filter((each) => each.id !== id),
69
- focusedId: quiet ? state.focusedId : id,
70
- seen: remembering(state.seen, surface.id),
71
- };
72
- }
73
- /** One event of a run's journal; `key` is where it came from, so a replay changes nothing. */
74
- function hear(state, key, event, at) {
75
- if (state.seen.has(key))
76
- return state;
77
- const heard = { ...state, seen: remembering(state.seen, key) };
78
- if (event.type === "ui.surface") {
79
- const surface = surfaceOf(event.surface);
80
- return surface ? place(heard, surface, false, at) : heard;
81
- }
82
- if (event.type !== "ui.window" || !isDefaultWindowKind(event.kind))
83
- return heard;
84
- const title = event.title?.trim();
85
- return open(heard, {
86
- kind: event.kind,
87
- title: title === "" ? undefined : title,
88
- fallbackText: event.fallback_text,
89
- at,
90
- });
91
- }
92
- /**
93
- * Opens a default window and puts it on the stage; one that is open already is only brought
94
- * forward (with a new title or words if it came with some). A kind this viewer may not be shown
95
- * is not opened.
96
- */
97
- function open(state, opening) {
98
- const { kind } = opening;
99
- if (!state.allowed.includes(kind))
100
- return state;
101
- const before = state.windows.find((window) => isDefault(window) && window.id === kind);
102
- const window = {
103
- id: kind,
104
- kind,
105
- title: opening.title ?? before?.title ?? state.titleOf(kind),
106
- fallbackText: opening.fallbackText ?? before?.fallbackText,
107
- params: opening.params ?? before?.params ?? {},
108
- openedAt: before?.openedAt ?? opening.at,
109
- };
110
- return {
111
- ...state,
112
- windows: withWindow(state.windows, window),
113
- closed: state.closed.filter((each) => each.id !== kind),
114
- focusedId: kind,
115
- };
116
- }
117
- /** Closes a window; the stage goes to the one opened before it if it was on it. */
118
- function close(state, id) {
119
- const index = state.windows.findIndex((window) => window.id === id);
120
- const window = state.windows[index];
121
- if (!window || window.id === CHAT_ID)
122
- return state;
123
- const windows = state.windows.filter((each) => each.id !== id);
124
- return {
125
- ...state,
126
- windows,
127
- closed: [window, ...state.closed].slice(0, MAX_CLOSED),
128
- focusedId: state.focusedId === id ? (windows[index - 1]?.id ?? CHAT_ID) : state.focusedId,
129
- };
130
- }
131
- /** The window where its place already is, else at the end. */
132
- function withWindow(windows, window) {
133
- return windows.some((each) => each.id === window.id)
134
- ? windows.map((each) => (each.id === window.id ? window : each))
135
- : [...windows, window];
136
- }
137
- const remembering = (seen, key) => new Set(seen).add(key);
138
- /**
139
- * Where a surface says it goes, if it does, with the title the window will have: the one it was
140
- * placed with, else its slot. The payload is a model's, so it is read defensively.
141
- */
142
- export function placementOf(surface) {
143
- const placement = surface.window;
144
- if (typeof placement !== "object" || placement === null)
145
- return undefined;
146
- const { slot, title } = placement;
147
- if (typeof slot !== "string" || slot === "")
148
- return undefined;
149
- const named = typeof title === "string" ? title.trim() : "";
150
- return { slot, title: named === "" ? slot : named };
151
- }
@@ -1,18 +0,0 @@
1
- import type { DefaultWindowComponents } from "./kinds.js";
2
- /**
3
- * What a window says when nothing here draws it, or what it needs to be drawn is missing: its
4
- * text twin if the agent gave one when it opened it, else that it is not available. Never an
5
- * error: a host that has not registered a kind is a host that does not show it.
6
- */
7
- export declare function WindowTwin({ text }: {
8
- text: string | undefined;
9
- }): import("react").JSX.Element;
10
- /**
11
- * The windows the core of the package draws. A host's `windows` on the provider are laid over
12
- * them, and the kinds that live in other entries (`flow`, `voice`) or need an owner's data
13
- * (`automations`) are the host's to register, so a page that never shows them does not load
14
- * them.
15
- */
16
- export declare const CORE_WINDOWS: DefaultWindowComponents;
17
- /** The components that draw the default windows here: the core's, with the host's laid over. */
18
- export declare function useWindowComponents(): DefaultWindowComponents;
@@ -1,61 +0,0 @@
1
- import { jsx as _jsx } from "react/jsx-runtime";
2
- import { useMemo } from "react";
3
- import { AgentChat } from "../chat/AgentChat.js";
4
- import { ChatView } from "../chat/ChatView.js";
5
- import { BrowserView } from "../browser/BrowserView.js";
6
- import { LiveView } from "../live/LiveView.js";
7
- import { useMessages, useParts, useSignalcore } from "../SignalcoreProvider.js";
8
- import { Captions } from "./Captions.js";
9
- import { useSpaceChat } from "./space.js";
10
- /**
11
- * What a window says when nothing here draws it, or what it needs to be drawn is missing: its
12
- * text twin if the agent gave one when it opened it, else that it is not available. Never an
13
- * error: a host that has not registered a kind is a host that does not show it.
14
- */
15
- export function WindowTwin({ text }) {
16
- const part = useParts();
17
- const copy = useMessages();
18
- return _jsx("p", { ...part("window__twin"), children: text ?? copy.space.noComponent });
19
- }
20
- /**
21
- * The conversation. Inside a shell it is the shell's own (the box is in the dock, and when the
22
- * person speaks the transcript collapses to captions); on its own, where a host lays windows out
23
- * itself, it is a chat of its own, `AgentChat`.
24
- */
25
- function ChatWindow({ agentId, thread, label, className }) {
26
- const chat = useSpaceChat();
27
- if (!chat) {
28
- return _jsx(AgentChat, { agentId: agentId, thread: thread, label: label, className: className });
29
- }
30
- return chat.voice ? (_jsx(Captions, { chat: chat, className: className })) : (_jsx(ChatView, { conversation: chat.conversation, label: label, className: className, docked: true }));
31
- }
32
- /** A hosted browser, which the host opens with the session to watch (`params.sessionId`). */
33
- function BrowserWindow({ params, fallbackText, label, className }) {
34
- const sessionId = params["sessionId"];
35
- if (sessionId === undefined)
36
- return _jsx(WindowTwin, { text: fallbackText });
37
- return (_jsx(BrowserView, { sessionId: sessionId, streamId: params["streamId"], url: params["url"], title: params["title"] ?? label, className: className }));
38
- }
39
- /** A live stream, which the host opens with the stream to watch (`params.streamId`). */
40
- function LiveWindow({ params, fallbackText, label, className }) {
41
- const streamId = params["streamId"];
42
- if (streamId === undefined)
43
- return _jsx(WindowTwin, { text: fallbackText });
44
- return (_jsx(LiveView, { streamId: streamId, aspect: params["aspect"], input: params["input"] === "true", label: label, className: className }));
45
- }
46
- /**
47
- * The windows the core of the package draws. A host's `windows` on the provider are laid over
48
- * them, and the kinds that live in other entries (`flow`, `voice`) or need an owner's data
49
- * (`automations`) are the host's to register, so a page that never shows them does not load
50
- * them.
51
- */
52
- export const CORE_WINDOWS = {
53
- chat: ChatWindow,
54
- browser: BrowserWindow,
55
- live: LiveWindow,
56
- };
57
- /** The components that draw the default windows here: the core's, with the host's laid over. */
58
- export function useWindowComponents() {
59
- const { windows } = useSignalcore();
60
- return useMemo(() => ({ ...CORE_WINDOWS, ...windows }), [windows]);
61
- }
@@ -1,9 +0,0 @@
1
- /**
2
- * Brings the window of a slot to the stage, opening it again if the person closed it. A shell
3
- * (`AgentSpace`) provides it; where there is none, the chat has no stage to point at, and a
4
- * surface the agent placed in a window is drawn in the transcript, as it always was.
5
- */
6
- export type Reveal = (slot: string) => void;
7
- export declare const RevealContext: import("react").Context<Reveal | undefined>;
8
- /** The way to bring a window forward, when the chat is part of a shell; else nothing. */
9
- export declare function useReveal(): Reveal | undefined;
@@ -1,6 +0,0 @@
1
- import { createContext, useContext } from "react";
2
- export const RevealContext = createContext(undefined);
3
- /** The way to bring a window forward, when the chat is part of a shell; else nothing. */
4
- export function useReveal() {
5
- return useContext(RevealContext);
6
- }
@@ -1,21 +0,0 @@
1
- import type { Conversation } from "../chat/useConversation.js";
2
- /** What the voice heard and was answered in its latest turn: the words the chat collapses to. */
3
- export interface Spoken {
4
- said: string;
5
- answer: string;
6
- }
7
- /**
8
- * What a shell holds that its conversation window draws: the conversation itself, which lives in
9
- * the shell so that the box in the dock, the transcript on the stage and the picks on a generated
10
- * window all speak in the same one, and whether the person is listening instead of reading.
11
- */
12
- export interface SpaceChat {
13
- conversation: Conversation;
14
- /** The person talks and listens: the transcript collapses to the words just said. */
15
- voice: boolean;
16
- /** The voice's latest turn, which the captions show while it is newer than the transcript. */
17
- spoken: Spoken | undefined;
18
- }
19
- export declare const SpaceChatContext: import("react").Context<SpaceChat | undefined>;
20
- /** The shell's conversation, when the window is drawn inside one; else nothing. */
21
- export declare function useSpaceChat(): SpaceChat | undefined;
@@ -1,6 +0,0 @@
1
- import { createContext, useContext } from "react";
2
- export const SpaceChatContext = createContext(undefined);
3
- /** The shell's conversation, when the window is drawn inside one; else nothing. */
4
- export function useSpaceChat() {
5
- return useContext(SpaceChatContext);
6
- }
@@ -1,11 +0,0 @@
1
- import type { Messages } from "../messages/types.js";
2
- /** How a state is coloured; the color is never the whole message, a word always goes with it. */
3
- export type Tone = "ok" | "signal" | "danger" | "neutral";
4
- export interface Status {
5
- word: string;
6
- tone: Tone;
7
- }
8
- /** How a channel stands: "Conectado", "Esperando el primer mensaje"… */
9
- export declare function channelStatus(state: string, copy: Messages): Status;
10
- /** How an automation stands: "Activa", "Sin activar", "Cambios sin activar". */
11
- export declare function automationStatus(state: string, copy: Messages): Status;
@@ -1,30 +0,0 @@
1
- const CHANNEL_TONE = {
2
- active: "ok",
3
- pending: "signal",
4
- error: "danger",
5
- disconnected: "neutral",
6
- };
7
- const AUTOMATION_TONE = {
8
- active: "ok",
9
- draft: "neutral",
10
- changed: "neutral",
11
- };
12
- const toneOf = (table, state) => Object.hasOwn(table, state) ? (table[state] ?? "neutral") : "neutral";
13
- /** The word for a state the API named, or the state itself when this package does not know it. */
14
- function wordOf(words, state) {
15
- return Object.hasOwn(words, state) ? (words[state] ?? state) : state;
16
- }
17
- /** How a channel stands: "Conectado", "Esperando el primer mensaje"… */
18
- export function channelStatus(state, copy) {
19
- return {
20
- word: wordOf(copy.automations.channelStatus, state),
21
- tone: toneOf(CHANNEL_TONE, state),
22
- };
23
- }
24
- /** How an automation stands: "Activa", "Sin activar", "Cambios sin activar". */
25
- export function automationStatus(state, copy) {
26
- return {
27
- word: wordOf(copy.automations.status, state),
28
- tone: toneOf(AUTOMATION_TONE, state),
29
- };
30
- }
@@ -1,15 +0,0 @@
1
- import type { Schemas } from "@signalcore/sdk";
2
- /**
3
- * The agent as its owner sees it (`GET /v1/agents/{id}/overview`, `client.agents.overview`):
4
- * what the windows of an agent draw. A host that holds it already (the web app keeps it in its
5
- * cache) passes it as a prop; a window given only an `agentId` asks for it.
6
- */
7
- export type Overview = Schemas["Overview"];
8
- /** One automation of the overview: how it starts, how it stands, how the last run went. */
9
- export type Automation = Schemas["Automation"];
10
- /** An app a part uses, with what it does there and whether the owner has connected it. */
11
- export type AppChip = Schemas["AppChip"];
12
- /** What a model wrote about a part so the owner reads it in their words (`presentations`). */
13
- export type Presentation = Schemas["Part"];
14
- /** The files of an agent's package, by path: `agents.get(id).draft_files`. */
15
- export type PackageFiles = Record<string, string>;
@@ -1 +0,0 @@
1
- export {};
@@ -1,44 +0,0 @@
1
- import type { Overview, PackageFiles } from "./types.js";
2
- /** What a window has to draw: ready, on its way, failed, or with no way to get it. */
3
- export type Loaded<T> = {
4
- state: "ready";
5
- value: T;
6
- } | {
7
- state: "loading";
8
- } | {
9
- state: "failed";
10
- } | {
11
- state: "unavailable";
12
- };
13
- /**
14
- * What a window draws: what the host gave, else what the client fetches for `key`. The props
15
- * are the source of truth, so nothing is asked while they are there; without them and without a
16
- * client that can, the window says it cannot be drawn. A new `key` (another agent) asks again,
17
- * and an answer to an old one is never shown.
18
- */
19
- export declare function useLoaded<T>(given: T | undefined, key: string | undefined, load: ((key: string) => Promise<T>) | undefined): Loaded<T>;
20
- /** The overview of an agent: the host's, else `agents.overview` of the provider's client. */
21
- export declare function useOverview(given: Overview | undefined, agentId: string | undefined): Loaded<{
22
- live: boolean;
23
- gear: import("@signalcore/sdk").components["schemas"]["Gear"][];
24
- documents: number;
25
- channels: import("@signalcore/sdk").components["schemas"]["ChannelFlow"][];
26
- automations: import("@signalcore/sdk").components["schemas"]["Automation"][];
27
- skills: import("@signalcore/sdk").components["schemas"]["Skill"][];
28
- knowledge: import("@signalcore/sdk").components["schemas"]["Knowledge"][];
29
- unpublished: import("@signalcore/sdk").components["schemas"]["Change"][];
30
- warnings: string[];
31
- presentations?: {
32
- [key: string]: import("@signalcore/sdk").components["schemas"]["Part"];
33
- };
34
- presenting?: boolean;
35
- }>;
36
- /** The files of an agent's package: the host's, else the draft of `agents.get`. */
37
- export declare function usePackageFiles(given: PackageFiles | undefined, agentId: string | undefined): Loaded<{
38
- [key: string]: string;
39
- }>;
40
- /**
41
- * Two things a window needs, as one: ready when both are. Otherwise what will never come says
42
- * so first (nothing to ask with, then a failure), and until then it is loading.
43
- */
44
- export declare function both<A, B>(a: Loaded<A>, b: Loaded<B>): Loaded<[A, B]>;
@@ -1,58 +0,0 @@
1
- import { useEffect, useMemo, useState } from "react";
2
- import { useSignalcore } from "../SignalcoreProvider.js";
3
- /**
4
- * What a window draws: what the host gave, else what the client fetches for `key`. The props
5
- * are the source of truth, so nothing is asked while they are there; without them and without a
6
- * client that can, the window says it cannot be drawn. A new `key` (another agent) asks again,
7
- * and an answer to an old one is never shown.
8
- */
9
- export function useLoaded(given, key, load) {
10
- const [answer, setAnswer] = useState();
11
- useEffect(() => {
12
- if (given !== undefined || key === undefined || load === undefined)
13
- return undefined;
14
- let current = true;
15
- load(key).then((value) => {
16
- if (current)
17
- setAnswer({ key, load, value });
18
- }, () => {
19
- if (current)
20
- setAnswer({ key, load, failed: true });
21
- });
22
- return () => {
23
- current = false;
24
- };
25
- }, [given, key, load]);
26
- if (given !== undefined)
27
- return { state: "ready", value: given };
28
- if (key === undefined || load === undefined)
29
- return { state: "unavailable" };
30
- if (answer?.key !== key || answer.load !== load)
31
- return { state: "loading" };
32
- return "failed" in answer ? { state: "failed" } : { state: "ready", value: answer.value };
33
- }
34
- /** The overview of an agent: the host's, else `agents.overview` of the provider's client. */
35
- export function useOverview(given, agentId) {
36
- const load = useSignalcore().client?.agents?.overview;
37
- return useLoaded(given, agentId, load);
38
- }
39
- /** The files of an agent's package: the host's, else the draft of `agents.get`. */
40
- export function usePackageFiles(given, agentId) {
41
- const get = useSignalcore().client?.agents?.get;
42
- const load = useMemo(() => get && (async (id) => (await get(id)).draft_files), [get]);
43
- return useLoaded(given, agentId, load);
44
- }
45
- /**
46
- * Two things a window needs, as one: ready when both are. Otherwise what will never come says
47
- * so first (nothing to ask with, then a failure), and until then it is loading.
48
- */
49
- export function both(a, b) {
50
- if (a.state === "ready" && b.state === "ready") {
51
- return { state: "ready", value: [a.value, b.value] };
52
- }
53
- for (const state of ["unavailable", "failed"]) {
54
- if (a.state === state || b.state === state)
55
- return { state };
56
- }
57
- return { state: "loading" };
58
- }