@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
@@ -0,0 +1 @@
1
+ {"version":3,"file":"AgentAbout.js","names":[],"sources":["../src/AgentAbout.tsx"],"sourcesContent":["import {\n useCallback,\n useEffect,\n useId,\n useLayoutEffect,\n useMemo,\n useRef,\n useState,\n type ReactNode,\n} from \"react\";\n\nimport {\n BooksIcon,\n BroadcastIcon,\n KeyIcon,\n LightbulbIcon,\n PuzzlePieceIcon,\n WrenchIcon,\n type Icon as Glyph,\n} from \"@phosphor-icons/react\";\nimport {\n aboutState,\n appTitle,\n automationsOf,\n countOf,\n formatSize,\n toneOf,\n toolName,\n toolTitle,\n type AboutOut,\n type ActionFact,\n type AutomationFact,\n type AutomationKind,\n type ChannelFact,\n type ChannelKind,\n type ConnectionFact,\n type DataFact,\n type Facts,\n type FileFact,\n type Icon,\n type MemoryFact,\n type Provider,\n type StatusTone,\n type Told,\n type Topic,\n type VaultFact,\n} from \"./about\";\nimport { Automation } from \"./automation/Automation\";\nimport { RunView } from \"./automation/RunView\";\nimport type { Automation as Standing, Run } from \"./automation/types\";\nimport { agentGlyph } from \"./agentIcons\";\nimport { classes } from \"./classes\";\nimport { ApiError, type Client } from \"./client\";\nimport { baseName } from \"./files\";\nimport { GLYPHS } from \"./icons\";\nimport { KitProvider, useKit, type KitClassNames, type KitPart } from \"./kit/context\";\nimport { FileMark } from \"./kit/FileMark\";\nimport { List, Row } from \"./kit/List\";\nimport { Mark } from \"./kit/Mark\";\nimport { MarkStack } from \"./kit/MarkStack\";\nimport { Tag } from \"./kit/Tag\";\nimport { KIT_MESSAGES, type KitLocale, type KitMessages } from \"./kit/messages\";\nimport { actionMark, channelMark, deviceMark, providerMark } from \"./marks\";\n\n/** What each part of what it works with is, at a glance: bare, beside its name. */\nconst TOPIC_GLYPHS: Readonly<Record<Topic, Glyph>> = {\n apps: PuzzlePieceIcon,\n tools: WrenchIcon,\n knowledge: BooksIcon,\n learning: LightbulbIcon,\n channels: BroadcastIcon,\n keys: KeyIcon,\n};\nimport type { Channel, ChannelStatus } from \"./types\";\nimport { agentTint } from \"./tint\";\nimport { usePolled } from \"./usePolled\";\n\n/** The words Qué puede says; a host gives its own, in its language. */\nexport interface AboutMessages {\n /** While the words are read, before anything is known. */\n loading: string;\n /** While the agent writes what it does the first time: a model call, a few seconds. */\n writing: (name: string) => string;\n /** Under the words while the agent writes them again, because it changed since. */\n updating: string;\n /** The button that tries again when the words could not be read or written. */\n refresh: string;\n /** Over what it asks the person's leave for. */\n asks: string;\n /** Over the tools that come with every agent, when it has its own too. */\n builtIn: string;\n /** The words could not be read or written; the server's own sentence follows when it gave one. */\n failed: string;\n /** Over what it does on its own. */\n does: string;\n /** In their place when it does nothing on its own yet. */\n noAutomations: string;\n /** On an automation that is off. */\n paused: string;\n /** What an automation waits for, when the agent hasn't said when yet. */\n kinds: Readonly<Record<AutomationKind, string>>;\n /** Each topic's name, on its tile and over it when open. */\n topics: Readonly<Record<Topic, string>>;\n /** A topic with nothing: on its row, and as its one line when open. */\n empty: Readonly<Record<Topic, string>>;\n /** Under an open topic's name: what it is, in a line. */\n hints: Readonly<Record<Topic, string>>;\n /** Over what is the agent's own, inside what it knows and its keys. */\n theirs: (name: string) => string;\n /** Over what is the organization's, shared with every agent: said once, by this heading. */\n organization: string;\n /** Over the tables, inside what it knows. */\n tables: string;\n /** Under a file `search_files` does not read: it is only kept. */\n kept: string;\n /** Beside a tool that is off. */\n off: string;\n /** What it may do in a table, beside it. */\n can: Readonly<Record<string, string>>;\n /** Over the words, and on the way back from a topic: who this is about. */\n title: (name: string) => string;\n /** Over the topics. */\n facts: string;\n /** In place of a run that is no longer there. */\n runGone: string;\n /** What the kit's pieces say in it (an automation, a run): their words, in the host's language. */\n kit: Partial<KitMessages>;\n /** A shipped action's name in the owner's words, by its code name; the rest keep the code name. */\n actions: Readonly<Record<string, string>>;\n /** A file's size, as the host's people read it. */\n size: (bytes: number) => string;\n /** When a memory was kept, beside it. */\n ago: (when: Date) => string;\n /** A channel's name, by its kind: its row's title. */\n channelNames: Readonly<Record<ChannelKind, string>>;\n /** How a channel stands, beside its dot. */\n channelStates: Readonly<Record<ChannelStatus, string>>;\n /** The provider's word on a channel's status (English, as the API keeps it), in the host's. */\n channelDetail: (detail: string) => string;\n}\n\nexport const ABOUT_MESSAGES: AboutMessages = {\n loading: \"Loading…\",\n writing: (name) => `${name} is writing down what it does…`,\n updating: \"Updating…\",\n refresh: \"Try again\",\n asks: \"It asks you before\",\n builtIn: \"Built in\",\n failed: \"What it can do could not be read.\",\n does: \"What it does on its own\",\n noAutomations: \"Nothing on its own yet: it answers when someone writes to it.\",\n paused: \"Paused\",\n kinds: { schedule: \"At a time\", webhook: \"When called\", event: \"On an event\" },\n topics: {\n apps: \"Apps\",\n tools: \"Tools\",\n knowledge: \"Knowledge\",\n learning: \"Learning\",\n channels: \"Channels\",\n keys: \"Keys\",\n },\n empty: {\n apps: \"None yet\",\n tools: \"None on\",\n knowledge: \"Nothing yet\",\n learning: \"Nothing yet\",\n channels: \"None yet\",\n keys: \"None\",\n },\n hints: {\n apps: \"The business's apps it uses, and what it may do in each.\",\n tools: \"What it can do while it talks with someone.\",\n knowledge: \"The documents and tables it reads to answer.\",\n learning: \"What it has learned from its conversations.\",\n channels: \"Where it works: where people write to it, and the devices it uses.\",\n keys: \"Passwords and keys it uses, kept sealed.\",\n },\n theirs: (name) => `${name}'s own`,\n organization: \"The organization's\",\n tables: \"Tables\",\n kept: \"Only kept\",\n off: \"off\",\n can: { find: \"looks up\", add: \"adds\", update: \"changes\" },\n title: (name) => `About ${name}`,\n facts: \"What it works with\",\n runGone: \"This run is no longer there.\",\n kit: KIT_MESSAGES,\n actions: {},\n size: (bytes) => formatSize(bytes),\n ago: (when) => when.toLocaleDateString(),\n channelNames: {\n whatsapp: \"WhatsApp\",\n instagram: \"Instagram\",\n sms: \"SMS\",\n email: \"Email\",\n web: \"Web chat\",\n phone: \"Phone\",\n },\n channelStates: {\n active: \"Active\",\n pending: \"Pending\",\n error: \"Error\",\n disconnected: \"Disconnected\",\n },\n channelDetail: (detail) => detail,\n};\n\n/** The parts, by the class each carries; `classNames` adds a host's own under the same keys. */\nexport type AboutPart =\n | \"sc-about\"\n | \"sc-about__pane\"\n | \"sc-about__intro\"\n | \"sc-about__heading\"\n | \"sc-about__name\"\n | \"sc-about__topics\"\n | \"sc-about__topic\"\n | \"sc-about__topic-name\"\n | \"sc-about__topic-none\"\n | \"sc-about__topic-count\"\n | \"sc-about__topic-go\"\n | \"sc-about__lead\"\n | \"sc-about__updated\"\n | \"sc-about__updating\"\n | \"sc-about__section\"\n | \"sc-about__label\"\n | \"sc-about__asks\"\n | \"sc-about__menu\"\n | \"sc-about__memory\"\n | \"sc-about__back\"\n | \"sc-about__bar\"\n | \"sc-about__bar-end\"\n | \"sc-about__automation\"\n | \"sc-about__run\"\n | \"sc-about__group\"\n | \"sc-about__title\"\n | \"sc-about__subtitle\"\n | \"sc-about__file\"\n | \"sc-about__detail\"\n | \"sc-about__hint\"\n | \"sc-about__count\"\n | \"sc-about__tools\"\n | \"sc-about__dot\"\n | \"sc-about__state\"\n | \"sc-about__empty\"\n | \"sc-about__writing\";\n\n/** The panel's own parts and the kit's it is drawn with: a host styles both under one prop. */\ntype ClassNames = Partial<Record<AboutPart | KitPart, string>> | undefined;\n\n/** What a host's control is given, besides the thing it stands beside. */\nexport interface AboutTools {\n /**\n * Reads the facts again, and has the agent write its words anew when the change made them\n * stale; the open topic stays. Call it after a change.\n */\n refresh: () => Promise<void>;\n}\n\ntype Control<T> = ((thing: T, tools: AboutTools) => ReactNode) | undefined;\n\n/**\n * The host's own controls: the package only reads, a host that lets its people change things\n * draws them here. Each one is drawn at the right end of what it stands beside.\n */\nexport interface AboutControls {\n /** Over what it does on its own (a new automation). */\n newAutomation?: ((tools: AboutTools) => ReactNode) | undefined;\n /** On each automation (switch it off, delete it). */\n automation?: Control<AutomationFact>;\n /** Under its automations: what else it does on its own (the tasks it runs for contacts). */\n automationsNote?: ((tools: AboutTools) => ReactNode) | undefined;\n /** Over an open topic (add an app, upload a file, add a key). */\n topic?: Partial<Record<Topic, (tools: AboutTools) => ReactNode>> | undefined;\n app?: Control<ConnectionFact>;\n tool?: Control<ActionFact>;\n file?: Control<FileFact>;\n table?: Control<DataFact>;\n memory?: Control<MemoryFact>;\n key?: Control<VaultFact>;\n /** On each channel the agent answers (its settings, a check, disconnecting it). */\n channel?: Control<Channel>;\n}\n\n/**\n * How a host draws an app's mark, with its own brands (the package carries none): v2's\n * `AppDirectory`. `provider` says the catalog and the app (`arcade:gmail`); `icon` is the one the\n * provider declares, when it does.\n */\nexport interface AppDirectory {\n logo: (app: {\n provider: string;\n name: string;\n icon?: string | null | undefined;\n size: number;\n }) => ReactNode;\n}\n\nexport interface AgentAboutProps {\n client: Client;\n agentId: string;\n /** Its mark (`AGENT_ICONS`), drawn beside its name in its tint; a sparkle until it has one. */\n icon?: string | null | undefined;\n /** The agent's name, for the words that address it. */\n name: string;\n messages?: Partial<AboutMessages> | undefined;\n classNames?: ClassNames;\n controls?: AboutControls | undefined;\n /** The host's logos for apps; without them an app shows the mark its provider gives. */\n apps?: AppDirectory | undefined;\n /**\n * Opens a file the owner presses in what it knows (in the host's viewer: `FileView` in a\n * dialog); without it the files are only listed.\n */\n onOpenFile?: ((file: FileFact) => void) | undefined;\n /**\n * What is open in it: its home, a topic, an automation, a run of one. Given, the host keeps it\n * (in its address, say) and hears each move through `onViewChange`; without it the panel keeps\n * its own.\n */\n view?: AboutView | undefined;\n onViewChange?: ((view: AboutView) => void) | undefined;\n /** Opens a conversation a run opened or was asked in; without it, none opens. */\n onOpenConversation?: ((id: string) => void) | undefined;\n /** The language its dates and times are said in. */\n locale?: KitLocale | undefined;\n}\n\n/**\n * What is open in the panel, one level under another: its home; a topic or an automation from\n * it; a run from its automation.\n */\nexport type AboutView =\n | { kind: \"home\" }\n | { kind: \"topic\"; topic: Topic }\n | { kind: \"automation\"; name: string }\n | { kind: \"run\"; name: string; run: string };\n\nexport const ABOUT_HOME: AboutView = { kind: \"home\" };\n\n/** How far a view is from the home: what says whether a move goes in or back out. */\nconst depthOf = (view: AboutView): number =>\n view.kind === \"home\" ? 0 : view.kind === \"run\" ? 2 : 1;\n\n/** A view as one string: what tells two apart. */\nconst keyOf = (view: AboutView): string =>\n view.kind === \"home\"\n ? \"home\"\n : view.kind === \"topic\"\n ? `topic:${view.topic}`\n : view.kind === \"automation\"\n ? `automation:${view.name}`\n : `run:${view.name}:${view.run}`;\n\n/** The view a step back from `view` goes to. */\nexport function aboutBack(view: AboutView): AboutView {\n return view.kind === \"run\" ? { kind: \"automation\", name: view.name } : ABOUT_HOME;\n}\n\n/**\n * Qué puede, made to sit beside the conversation: who it is about, in its own words (a line or\n * two); what it does on its own, one row per automation (its kind's mark, or its app's logo),\n * what it does and when, as the agent tells it; what it asks leave for; then what it works with,\n * as a grid of tiles, one per topic (its apps, tools, what it knows and has learned, where it\n * works, its keys), each with its count and a glimpse of what it holds, opening it in the same\n * place. Every list is the kit's `List` and `Row`, and every tile its `Tile`, the ones an agent's\n * screens use, so a host styles them once. The words are written by the agent the first time and\n * again whenever it changed since, by themselves. The component only reads; a host draws its own\n * controls through `controls` and calls `tools.refresh()` after a change, and opens a file\n * through `onOpenFile`. An automation opens in the panel itself, one level in (what it does, its\n * steps, its runs), and a run one more, each with its way back; `view` lets the host keep where\n * it is. Another agent starts afresh.\n */\nexport function AgentAbout(props: AgentAboutProps) {\n return (\n <KitProvider\n classNames={props.classNames as KitClassNames}\n messages={props.messages?.kit}\n locale={props.locale}\n >\n <View key={props.agentId} {...props} />\n </KitProvider>\n );\n}\n\nfunction View({\n client,\n agentId,\n icon,\n name,\n messages,\n classNames,\n controls,\n apps,\n onOpenFile,\n view: given,\n onViewChange,\n onOpenConversation,\n}: AgentAboutProps) {\n const words = { ...ABOUT_MESSAGES, ...messages };\n const [data, setData] = useState<AboutOut | null>(null);\n const [live, setLive] = useState<readonly Standing[] | null>(null);\n const [writing, setWriting] = useState(false);\n const [problem, setProblem] = useState<unknown>(null);\n // Every change the host makes reads the open automation or run again, too.\n const [version, setVersion] = useState(0);\n const [own, setOwn] = useState<AboutView>(ABOUT_HOME);\n const view = given ?? own;\n const motion = useMotion(view);\n const root = useRef<HTMLDivElement>(null);\n const scrolled = useRef(new Map<string, number>());\n const intro = useId();\n\n /** Opens `next`, keeping where the panel was scrolled to on the way in, for the way back. */\n const go = (next: AboutView) => {\n const scroller = scrollerOf(root.current);\n if (scroller !== null && depthOf(next) > depthOf(view)) {\n scrolled.current.set(keyOf(view), scroller.scrollTop);\n }\n (onViewChange ?? setOwn)(next);\n };\n\n // A view opens at its top, or back where it was left.\n const shown = keyOf(view);\n useLayoutEffect(() => {\n const scroller = scrollerOf(root.current);\n if (scroller !== null) scroller.scrollTop = scrolled.current.get(shown) ?? 0;\n }, [shown]);\n\n // Each call takes `still`, whether its answer is still wanted: a mount undone before the answer\n // (StrictMode runs effects twice) keeps nothing, so one writing runs, not two.\n\n /** Has the agent write about itself anew; what it answers is the words and the facts both. */\n const write = useCallback(\n async (still: () => boolean) => {\n setProblem(null);\n setWriting(true);\n try {\n const written = await client.agents.describe(agentId);\n if (still()) setData(written);\n } catch (error) {\n if (still()) setProblem(error);\n } finally {\n if (still()) setWriting(false);\n }\n },\n [client, agentId],\n );\n\n /**\n * Reads the words and the facts, and how each automation stands (a server without them leaves\n * the rows as they were told); when the words are missing or stale, has the agent write them.\n */\n const read = useCallback(\n async (still: () => boolean) => {\n setProblem(null);\n try {\n const [first, standing] = await Promise.all([\n client.agents.about(agentId),\n client.automations.list(agentId).catch(() => null),\n ]);\n if (!still()) return;\n setData(first);\n setLive(standing);\n // Words never written, or written before the agent last changed: it writes them again\n // by itself, so what it says stays true without anyone asking.\n if (first.about === null || first.about_at === null) await write(still);\n } catch (error) {\n if (still()) setProblem(error);\n }\n },\n [client, agentId, write],\n );\n\n useEffect(() => {\n let gone = false;\n void read(() => !gone);\n return () => {\n gone = true;\n };\n }, [read]);\n\n const tools = useMemo<AboutTools>(\n () => ({\n refresh: async () => {\n setVersion((count) => count + 1);\n await read(() => true);\n },\n }),\n [read],\n );\n // What to try again after a failure: the reading when nothing was read, the writing otherwise.\n const retry = () => (data === null ? read(() => true) : write(() => true));\n // A tool by the owner's words for it; one of its own code, by its name made words.\n const label = (action: ActionFact) =>\n action.source === \"own\" ? toolName(action.name) : (words.actions[action.name] ?? action.name);\n const pane = (bar: ReactNode, children: ReactNode) => (\n <div ref={root} className={`sc ${classes(classNames, \"sc-about\")}`}>\n <div key={shown} data-motion={motion} className={classes(classNames, \"sc-about__pane\")}>\n {bar}\n {children}\n </div>\n </div>\n );\n const home = words.title(name);\n\n if (view.kind === \"topic\" && data !== null) {\n return pane(\n <Bar back={home} onBack={() => go(ABOUT_HOME)} classNames={classNames} />,\n <TopicView\n client={client}\n agentId={agentId}\n name={name}\n version={version}\n topic={view.topic}\n facts={data.facts}\n apps={apps}\n label={label}\n words={words}\n classNames={classNames}\n tools={tools}\n controls={controls}\n onOpenFile={onOpenFile}\n />,\n );\n }\n\n if (view.kind === \"automation\") {\n const fact = data?.facts.automations.find((each) => each.name === view.name);\n return pane(\n <Bar\n back={home}\n onBack={() => go(ABOUT_HOME)}\n end={fact !== undefined ? controls?.automation?.(fact, tools) : undefined}\n classNames={classNames}\n />,\n <AutomationPane\n key={version}\n client={client}\n agentId={agentId}\n name={view.name}\n apps={apps}\n words={words}\n classNames={classNames}\n onOpenRun={(run) => go({ kind: \"run\", name: view.name, run: run.id })}\n />,\n );\n }\n\n if (view.kind === \"run\") {\n return pane(\n <Bar\n back={live?.find((each) => each.name === view.name)?.title ?? home}\n onBack={() => go({ kind: \"automation\", name: view.name })}\n classNames={classNames}\n />,\n <RunPane\n key={version}\n client={client}\n agentId={agentId}\n name={view.name}\n run={view.run}\n apps={apps}\n words={words}\n classNames={classNames}\n onOpenConversation={onOpenConversation}\n />,\n );\n }\n\n const state = data === null ? null : aboutState(data.about, data.about_at, writing);\n return pane(\n null,\n <>\n <section aria-labelledby={intro} className={classes(classNames, \"sc-about__intro\")}>\n <AgentName\n id={intro}\n agentId={agentId}\n icon={icon}\n name={name}\n label={home}\n classNames={classNames}\n />\n {problem !== null ? (\n <Problem words={words} classNames={classNames} onRetry={retry}>\n {words.failed}\n {problem instanceof ApiError && ` ${problem.detail}`}\n </Problem>\n ) : data === null || data.about === null ? (\n <Writing\n text={data === null ? words.loading : words.writing(name)}\n classNames={classNames}\n />\n ) : (\n <p className={classes(classNames, \"sc-about__lead\")}>{data.about.summary}</p>\n )}\n {state === \"writing\" && data?.about != null && (\n <p role=\"status\" className={classes(classNames, \"sc-about__updating\")}>\n {words.updating}\n </p>\n )}\n </section>\n {data !== null && (\n <>\n <Automations\n apps={apps}\n told={automationsOf(data.about, data.facts)}\n live={live}\n words={words}\n classNames={classNames}\n tools={tools}\n controls={controls}\n onOpen={(automation) => go({ kind: \"automation\", name: automation.name })}\n />\n {data.about !== null && data.about.asks.length > 0 && (\n <Asks asks={data.about.asks} words={words} classNames={classNames} />\n )}\n <nav aria-label={words.facts} className={classes(classNames, \"sc-about__menu\")}>\n <p className={classes(classNames, \"sc-about__label\")}>{words.facts}</p>\n <div className={classes(classNames, \"sc-about__topics\")}>\n {HOME_TOPICS.map((topic) => (\n <TopicRow\n key={topic}\n topic={topic}\n facts={data.facts}\n apps={apps}\n words={words}\n classNames={classNames}\n onOpen={() => go({ kind: \"topic\", topic })}\n />\n ))}\n </div>\n </nav>\n </>\n )}\n </>,\n );\n}\n\n/**\n * What the panel's home shows the agent works with, in the order the owner looks for it: where\n * people reach it, the apps it uses, what it knows, what it learned, its keys. Its tools are\n * the platform's business: they show in the technical view, not here.\n */\nconst HOME_TOPICS: readonly Topic[] = [\"channels\", \"apps\", \"knowledge\", \"learning\", \"keys\"];\n\n/** How many icons a topic's row draws before \"+N\". */\nconst MOST_MARKS = 5;\n\n/**\n * A topic on the panel's home, as icons: its name, then what it holds as their logos or marks\n * (the channels', the apps', the files') and how many; a topic with nothing says so, quietly.\n * Pressing it opens the topic.\n */\nfunction TopicRow({\n topic,\n facts,\n apps,\n words,\n classNames,\n onOpen,\n}: {\n topic: Topic;\n facts: Facts;\n apps: AppDirectory | undefined;\n words: AboutMessages;\n classNames: ClassNames;\n onOpen: () => void;\n}) {\n const count = countOf(topic, facts);\n return (\n <button\n type=\"button\"\n onClick={onOpen}\n data-empty={count === 0 || undefined}\n className={classes(classNames, \"sc-about__topic\")}\n >\n <span className={classes(classNames, \"sc-about__topic-name\")}>{words.topics[topic]}</span>\n {count === 0 ? (\n <span className={classes(classNames, \"sc-about__topic-none\")}>{words.empty[topic]}</span>\n ) : (\n <>\n <TopicMarks topic={topic} facts={facts} apps={apps} words={words} count={count} />\n <span className={classes(classNames, \"sc-about__topic-count\")}>{count}</span>\n </>\n )}\n <svg\n viewBox=\"0 0 16 16\"\n fill=\"none\"\n aria-hidden\n className={classes(classNames, \"sc-about__topic-go\")}\n >\n <path\n d=\"M6 3.5 10.5 8 6 12.5\"\n stroke=\"currentColor\"\n strokeWidth=\"1.5\"\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n />\n </svg>\n </button>\n );\n}\n\n/** What a topic holds, as icons: each channel's and app's logo, each file's mark; else its glyph. */\nfunction TopicMarks({\n topic,\n facts,\n apps,\n words,\n count,\n}: {\n topic: Topic;\n facts: Facts;\n apps: AppDirectory | undefined;\n words: AboutMessages;\n count: number;\n}) {\n const marks: ReactNode[] =\n topic === \"channels\"\n ? facts.channels.map((channel) => (\n <span key={`${channel.kind}:${channel.name}`}>\n {channelLogo(channel.kind, apps, words, 20)}\n </span>\n ))\n : topic === \"apps\"\n ? facts.connections.map((connection) => (\n <span key={connection.name}>{appMark(connectionApp(connection), apps, 20)}</span>\n ))\n : topic === \"knowledge\"\n ? facts.files.map((file) => <FileMark key={file.path} name={file.path} size={20} />)\n : [<Mark key={topic} icon={TOPIC_GLYPHS[topic]} size={20} />];\n const shown = marks.slice(0, MOST_MARKS);\n const drawn = topic === \"learning\" || topic === \"keys\" ? 0 : count;\n return <MarkStack more={Math.max(0, drawn - shown.length)}>{shown}</MarkStack>;\n}\n\n/**\n * Who the panel is about, at its top: the agent's mark in its tint, bare, beside its name; the\n * panel's title (\"About Ana\") stays for screen readers.\n */\nfunction AgentName({\n id,\n agentId,\n icon,\n name,\n label,\n classNames,\n}: {\n id: string;\n agentId: string;\n icon: string | null | undefined;\n name: string;\n label: string;\n classNames: ClassNames;\n}) {\n const Glyph = agentGlyph(icon);\n return (\n <h2\n id={id}\n aria-label={label}\n data-tint={agentTint(agentId)}\n className={classes(classNames, \"sc-about__name\")}\n >\n <Glyph aria-hidden weight=\"duotone\" />\n <span>{name}</span>\n </h2>\n );\n}\n\n/**\n * Which way the panel moved to show `view`: in (one level deeper), back out, or nowhere (the first\n * view). Kept per view, so a view's own updates never replay it.\n */\nfunction useMotion(view: AboutView): \"in\" | \"out\" | undefined {\n const key = keyOf(view);\n const depth = depthOf(view);\n const [moved, setMoved] = useState<{\n key: string;\n depth: number;\n motion: \"in\" | \"out\" | undefined;\n }>({ key, depth, motion: undefined });\n if (moved.key !== key) {\n setMoved({ key, depth, motion: depth >= moved.depth ? \"in\" : \"out\" });\n }\n return moved.motion;\n}\n\n/** The nearest box around `element` that scrolls: where the panel's place is kept. */\nfunction scrollerOf(element: HTMLElement | null): HTMLElement | null {\n for (let at = element?.parentElement ?? null; at !== null; at = at.parentElement) {\n const overflow = getComputedStyle(at).overflowY;\n if (overflow === \"auto\" || overflow === \"scroll\") return at;\n }\n return null;\n}\n\n/**\n * The bar over a view opened from another: the way back to it, named, at its start; the host's\n * controls at its end. It stays at the top as the view scrolls.\n */\nfunction Bar({\n back,\n onBack,\n end,\n classNames,\n}: {\n back: string;\n onBack: () => void;\n end?: ReactNode;\n classNames: ClassNames;\n}) {\n return (\n <div className={classes(classNames, \"sc-about__bar\")}>\n <button type=\"button\" onClick={onBack} className={classes(classNames, \"sc-about__back\")}>\n <svg viewBox=\"0 0 16 16\" fill=\"none\" aria-hidden>\n <path\n d=\"M10 3.5 5.5 8l4.5 4.5\"\n stroke=\"currentColor\"\n strokeWidth=\"1.5\"\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n />\n </svg>\n <span>{back}</span>\n </button>\n {end != null && <span className={classes(classNames, \"sc-about__bar-end\")}>{end}</span>}\n </div>\n );\n}\n\n/**\n * An automation, open in the panel: what starts it and when it runs next, the owner's sentence,\n * its steps, the table it moves, its runs (each opening its record). Read again every few\n * seconds while a run of it is under way.\n */\nfunction AutomationPane({\n client,\n agentId,\n name,\n apps,\n words,\n classNames,\n onOpenRun,\n}: Drawn & {\n client: Client;\n agentId: string;\n name: string;\n apps: AppDirectory | undefined;\n onOpenRun: (run: Run) => void;\n}) {\n const { messages } = useKit();\n const read = usePolled(\n () => client.automations.get(agentId, name),\n `${agentId}:${name}`,\n (automation) => automation.runs.some((run) => run.status === \"running\"),\n );\n if (read.gone) return <Gone classNames={classNames}>{messages.automation.gone}</Gone>;\n if (read.value === null) {\n return read.problem === null ? (\n <Loading words={words} classNames={classNames} />\n ) : (\n <Gone classNames={classNames}>{words.failed}</Gone>\n );\n }\n return (\n <Automation\n className={classes(classNames, \"sc-about__automation\")}\n automation={read.value}\n runs={read.value.runs}\n apps={apps}\n onOpenRun={onOpenRun}\n />\n );\n}\n\n/**\n * A run, open in the panel: how it went, step by step in words, what it opened. Read with its\n * automation (its steps' order and its apps' names), again while it is under way.\n */\nfunction RunPane({\n client,\n agentId,\n name,\n run,\n apps,\n words,\n classNames,\n onOpenConversation,\n}: Drawn & {\n client: Client;\n agentId: string;\n name: string;\n run: string;\n apps: AppDirectory | undefined;\n onOpenConversation: ((id: string) => void) | undefined;\n}) {\n const read = usePolled(\n async () => {\n const [record, automation] = await Promise.all([\n client.runs.get(run),\n client.automations.get(agentId, name).catch(() => null),\n ]);\n return { record, automation };\n },\n run,\n ({ record }) => record.status === \"running\",\n );\n if (read.gone) return <Gone classNames={classNames}>{words.runGone}</Gone>;\n if (read.value === null) {\n return read.problem === null ? (\n <Loading words={words} classNames={classNames} />\n ) : (\n <Gone classNames={classNames}>{words.failed}</Gone>\n );\n }\n return (\n <RunView\n className={classes(classNames, \"sc-about__run\")}\n run={read.value.record}\n automation={read.value.automation}\n apps={apps}\n onOpenConversation={onOpenConversation}\n />\n );\n}\n\n/** A view whose thing is being read: lines with a light sweeping them. */\nfunction Loading({ words, classNames }: Drawn) {\n return <Writing text={words.loading} classNames={classNames} />;\n}\n\n/** In place of what is no longer there, or could not be read. */\nfunction Gone({ classNames, children }: { classNames: ClassNames; children: ReactNode }) {\n return <p className={classes(classNames, \"sc-about__empty\")}>{children}</p>;\n}\n\n/** An automation's mark says its kind: a time, a call from another system, an event. */\nconst KIND_ICONS: Readonly<Record<AutomationKind, Icon>> = {\n schedule: \"clock\",\n webhook: \"code\",\n event: \"bell\",\n};\n\n/** An app's mark: the host's logo when it draws one, else the provider's, bare. */\nfunction appMark(\n app: { provider: string; name: string; icon?: string | null | undefined },\n apps: AppDirectory | undefined,\n size: number,\n) {\n if (apps !== undefined) return apps.logo({ ...app, size });\n return (\n <Mark logo size={size}>\n {providerMark(app.provider.split(\":\")[0] as Provider, app.icon ?? undefined)}\n </Mark>\n );\n}\n\nconst connectionApp = (connection: ConnectionFact) => ({\n provider: `${connection.provider}:${connection.toolkit ?? connection.name}`,\n name: appTitle(connection),\n icon: connection.icon,\n});\n\n/**\n * A channel's mark: the host's logo for its brand when it draws apps (WhatsApp, Instagram, the\n * plain mark of a text message), else the package's glyph, bare.\n */\nfunction channelLogo(\n kind: ChannelKind,\n apps: AppDirectory | undefined,\n words: AboutMessages,\n size: number,\n) {\n if (apps !== undefined)\n return apps.logo({ provider: kind, name: words.channelNames[kind], size });\n return <Mark size={size}>{channelMark(kind)}</Mark>;\n}\n\ninterface Drawn {\n words: AboutMessages;\n classNames: ClassNames;\n}\n\n/** What could not be read or written, in the warning tone, and the button to try again. */\nfunction Problem({\n words,\n classNames,\n onRetry,\n children,\n}: Drawn & { onRetry: () => Promise<void>; children: ReactNode }) {\n return (\n <p role=\"alert\" className={classes(classNames, \"sc-about__updated\")}>\n <span>{children}</span>\n <button type=\"button\" onClick={() => void onRetry()}>\n {words.refresh}\n </button>\n </p>\n );\n}\n\n/** The agent writing: the lead's lines with a light sweeping them, and the sentence saying so. */\nfunction Writing({ text, classNames }: { text: string; classNames: ClassNames }) {\n return (\n <div role=\"status\" className={classes(classNames, \"sc-about__writing\")}>\n <div aria-hidden>\n <i />\n <i />\n </div>\n <p>{text}</p>\n </div>\n );\n}\n\n/** What it asks leave for: its label, then the things, a short list. */\nfunction Asks({ asks, words, classNames }: Drawn & { asks: string[] }) {\n const id = useId();\n return (\n <section\n aria-labelledby={id}\n className={classes(classNames, \"sc-about__section\", \"sc-about__asks\")}\n >\n <div className={classes(classNames, \"sc-about__label\")}>\n <h3 id={id}>{words.asks}</h3>\n </div>\n <ul>\n {asks.map((ask, index) => (\n <li key={index}>{ask}</li>\n ))}\n </ul>\n </section>\n );\n}\n\n/**\n * What it does on its own: one row per automation, its kind's mark (or, on an app's event, the\n * app's logo), what it does then over when, as the agent tells it (its title and its kind until\n * it has), a paused one quieter; how it stands now when that needs a look (a run under way, the\n * last one failed); the host's control at each row's end, and over them the way to a new one. A\n * row opens its automation.\n */\nfunction Automations({\n told,\n live,\n words,\n classNames,\n tools,\n controls,\n apps,\n onOpen,\n}: Drawn & {\n told: Told[];\n live: readonly Standing[] | null;\n tools: AboutTools;\n controls: AboutControls | undefined;\n apps: AppDirectory | undefined;\n onOpen: (automation: AutomationFact) => void;\n}) {\n const id = useId();\n const { messages } = useKit();\n const standing = new Map(live?.map((automation) => [automation.name, automation]));\n return (\n <section aria-labelledby={id} className={classes(classNames, \"sc-about__section\")}>\n <div className={classes(classNames, \"sc-about__label\")}>\n <h3 id={id}>{words.does}</h3>\n {controls?.newAutomation !== undefined && (\n <span className={classes(classNames, \"sc-about__tools\")}>\n {controls.newAutomation(tools)}\n </span>\n )}\n </div>\n {told.length === 0 ? (\n <p className={classes(classNames, \"sc-about__empty\")}>{words.noAutomations}</p>\n ) : (\n <List>\n {told.map(({ automation, line }) => {\n const when = line?.when ?? words.kinds[automation.kind];\n const now = standing.get(automation.name);\n const going = now?.last_run?.status === \"running\";\n return (\n <Row\n key={automation.id}\n mark={\n automation.provider === undefined ? (\n <Mark icon={GLYPHS[KIND_ICONS[automation.kind]]} />\n ) : (\n appMark(\n {\n provider: automation.provider,\n name:\n automation.app_title ?? toolName(automation.app ?? automation.provider),\n icon: automation.icon,\n },\n apps,\n 28,\n )\n )\n }\n title={line?.text ?? automation.title}\n subtitle={when}\n error={now?.state === \"failing\" ? messages.automation.states.failing : undefined}\n meta={\n going ? (\n <Tag tone=\"info\">\n <i aria-hidden className={classes(classNames, \"sc-run__live\")} />\n {messages.automation.statuses.running}\n </Tag>\n ) : automation.on ? undefined : (\n <Tag>{words.paused}</Tag>\n )\n }\n quiet={!automation.on}\n onPress={() => onOpen(automation)}\n trailing={controls?.automation?.(automation, tools)}\n />\n );\n })}\n </List>\n )}\n {controls?.automationsNote?.(tools)}\n </section>\n );\n}\n\n/**\n * One topic, open: its name with its count and the host's control, a line saying what it is, then\n * its rows (what it knows as its files and its tables; what it learned; the rest with a mark and\n * a note), or its one line when it holds nothing.\n */\nfunction TopicView({\n client,\n agentId,\n name,\n version,\n topic,\n facts,\n apps,\n label,\n words,\n classNames,\n tools,\n controls,\n onOpenFile,\n}: Drawn & {\n client: Client;\n agentId: string;\n /** The agent's name, over what is its own. */\n name: string;\n /** Moves with every change the host makes: what the topic reads itself, it reads again. */\n version: number;\n topic: Topic;\n facts: Facts;\n apps: AppDirectory | undefined;\n label: (action: ActionFact) => string;\n tools: AboutTools;\n controls: AboutControls | undefined;\n onOpenFile: ((file: FileFact) => void) | undefined;\n}) {\n const id = useId();\n const tool = controls?.topic?.[topic];\n const count = countOf(topic, facts);\n // The tools are all listed, the ones that are off too: they are what the owner turns on.\n const shown = topic === \"tools\" ? facts.actions.length : count;\n return (\n <section aria-labelledby={id} className={classes(classNames, \"sc-about__group\")}>\n <h3 id={id} className={classes(classNames, \"sc-about__title\")}>\n <span>{words.topics[topic]}</span>\n {count > 0 && <b className={classes(classNames, \"sc-about__count\")}>{count}</b>}\n {tool !== undefined && (\n <span className={classes(classNames, \"sc-about__tools\")}>{tool(tools)}</span>\n )}\n </h3>\n <p className={classes(classNames, \"sc-about__hint\")}>{words.hints[topic]}</p>\n {topic === \"channels\" ? (\n <Channels\n client={client}\n agentId={agentId}\n version={version}\n facts={facts}\n apps={apps}\n words={words}\n classNames={classNames}\n tools={tools}\n controls={controls}\n />\n ) : shown === 0 ? (\n <p className={classes(classNames, \"sc-about__empty\")}>{words.empty[topic]}</p>\n ) : topic === \"knowledge\" ? (\n <Knowledge\n name={name}\n facts={facts}\n words={words}\n classNames={classNames}\n tools={tools}\n controls={controls}\n onOpenFile={onOpenFile}\n />\n ) : topic === \"tools\" ? (\n <Tools\n name={name}\n facts={facts}\n label={label}\n words={words}\n classNames={classNames}\n tools={tools}\n controls={controls}\n />\n ) : topic === \"keys\" ? (\n <Keys\n name={name}\n facts={facts}\n words={words}\n classNames={classNames}\n tools={tools}\n controls={controls}\n />\n ) : topic === \"learning\" ? (\n <List>\n {facts.memories.map((memory) => (\n <Row\n key={memory.id}\n className={classes(classNames, \"sc-about__memory\")}\n title={memory.text}\n subtitle={words.ago(new Date(memory.created_at))}\n trailing={controls?.memory?.(memory, tools)}\n />\n ))}\n </List>\n ) : (\n <Rows items={appItems(facts, tools, controls, apps)} classNames={classNames} />\n )}\n </section>\n );\n}\n\n/** How each state of a channel reads beside its dot: working, waiting, broken, or off. */\nconst CHANNEL_TONES: Readonly<Record<ChannelStatus, StatusTone | \"wait\">> = {\n active: \"on\",\n pending: \"wait\",\n error: \"off\",\n disconnected: \"quiet\",\n};\n\nconst isStatus = (status: string): status is ChannelStatus => status in CHANNEL_TONES;\n\n/** The order channels are listed in: by kind, as people reach a business most; disconnected last. */\nconst KIND_ORDER: readonly ChannelKind[] = [\n \"whatsapp\",\n \"instagram\",\n \"sms\",\n \"email\",\n \"web\",\n \"phone\",\n];\n\nconst inOrder = (channels: readonly Channel[]): Channel[] =>\n [...channels].sort(\n (a, b) =>\n Number(a.status === \"disconnected\") - Number(b.status === \"disconnected\") ||\n KIND_ORDER.indexOf(a.kind) - KIND_ORDER.indexOf(b.kind),\n );\n\n/**\n * Where it works: each channel it answers, as the API lists them (WhatsApp, Instagram, SMS; the\n * disconnected ones last, quieter), by its brand's mark and name, its number or handle, how it stands with the\n * provider's word on it, and the host's control at its end; then the devices it uses. Read\n * when the topic opens and after each change the host makes; until then, or on a server without\n * the list, the facts' rows.\n */\nfunction Channels({\n client,\n agentId,\n version,\n facts,\n apps,\n words,\n classNames,\n tools,\n controls,\n}: Drawn & {\n client: Client;\n agentId: string;\n version: number;\n facts: Facts;\n apps: AppDirectory | undefined;\n tools: AboutTools;\n controls: AboutControls | undefined;\n}) {\n const [listed, setListed] = useState<readonly Channel[] | null>(null);\n useEffect(() => {\n let gone = false;\n client.channels.list(agentId).then(\n (channels) => {\n if (!gone) setListed(channels);\n },\n () => undefined,\n );\n return () => {\n gone = true;\n };\n }, [client, agentId, version]);\n\n const state = (status: string) => {\n const known = isStatus(status);\n return (\n <span\n data-tone={known ? CHANNEL_TONES[status] : toneOf(status)}\n className={classes(classNames, \"sc-about__state\")}\n >\n <i aria-hidden className={classes(classNames, \"sc-about__dot\")} />\n {known ? words.channelStates[status] : status}\n </span>\n );\n };\n // Its number or handle, and under it the provider's word on it; on an error, that word is why.\n const told = (channel: Channel) => {\n const detail = channel.detail === null ? null : words.channelDetail(channel.detail);\n const error = channel.status === \"error\";\n return {\n subtitle: (\n <>\n {channel.name}\n {!error && detail !== null && detail !== \"\" && (\n <span className={classes(classNames, \"sc-about__detail\")}>{detail}</span>\n )}\n </>\n ),\n error: error ? (detail ?? undefined) : undefined,\n };\n };\n const rows =\n listed === null\n ? facts.channels.map((channel: ChannelFact) => (\n <Row\n key={`${channel.kind}:${channel.name}`}\n mark={channelLogo(channel.kind, apps, words, 28)}\n title={words.channelNames[channel.kind]}\n subtitle={channel.name}\n meta={state(channel.status)}\n />\n ))\n : inOrder(listed).map((channel) => (\n <Row\n key={channel.id}\n mark={channelLogo(channel.kind, apps, words, 28)}\n title={words.channelNames[channel.kind]}\n {...told(channel)}\n meta={state(channel.status)}\n quiet={channel.status === \"disconnected\"}\n trailing={controls?.channel?.(channel, tools) ?? undefined}\n />\n ));\n const devices = facts.devices.map((device) => (\n <Row\n key={`device:${device.kind}:${device.name}`}\n mark={<Mark>{deviceMark(device.kind)}</Mark>}\n title={device.name}\n meta={\n <i\n aria-hidden\n data-tone={toneOf(device.status)}\n className={classes(classNames, \"sc-about__dot\")}\n />\n }\n />\n ));\n if (rows.length + devices.length === 0) {\n return <p className={classes(classNames, \"sc-about__empty\")}>{words.empty.channels}</p>;\n }\n return (\n <List>\n {rows}\n {devices}\n </List>\n );\n}\n\n/**\n * One row of a topic: a mark, a name, a quieter line (what an app may do there, a note), a dot\n * for a status, and the host's control at its end.\n */\ninterface Item {\n key: string;\n mark: ReactNode;\n label: string;\n note?: string | undefined;\n status?: StatusTone | undefined;\n off?: boolean | undefined;\n control?: ReactNode;\n}\n\n/** Its apps: each by its logo and name, what it may do there under it, how it stands at its end. */\nfunction appItems(\n facts: Facts,\n tools: AboutTools,\n controls: AboutControls | undefined,\n apps: AppDirectory | undefined,\n): Item[] {\n return facts.connections.map((connection) => ({\n key: `${connection.provider}:${connection.name}`,\n mark: appMark(connectionApp(connection), apps, 28),\n label: appTitle(connection),\n note: connection.actions.map((action) => toolTitle(connection, action)).join(\", \"),\n status: connection.status === undefined ? undefined : toneOf(connection.status),\n control: controls?.app?.(connection, tools),\n }));\n}\n\n/**\n * What it can do while it talks: its own code's actions, then the ones every agent comes with\n * (each under its heading when it has both); in each, the ones it has first, then the ones the\n * owner can turn on, quieter, saying so.\n */\nfunction Tools({\n name,\n facts,\n label,\n words,\n classNames,\n tools,\n controls,\n}: Drawn & {\n name: string;\n facts: Facts;\n label: (action: ActionFact) => string;\n tools: AboutTools;\n controls: AboutControls | undefined;\n}) {\n const groups = [\n { key: \"own\", title: words.theirs(name), actions: facts.actions.filter(isOwn) },\n { key: \"built\", title: words.builtIn, actions: facts.actions.filter((a) => !isOwn(a)) },\n ].filter((group) => group.actions.length > 0);\n const rows = (actions: readonly ActionFact[]) => (\n <Rows\n items={[...actions.filter((a) => a.on), ...actions.filter((a) => !a.on)].map((action) => ({\n key: `${action.source}:${action.name}`,\n mark: <Mark>{actionMark(action.name, action.source)}</Mark>,\n label: label(action),\n note: action.on ? undefined : words.off,\n off: !action.on,\n control: controls?.tool?.(action, tools),\n }))}\n classNames={classNames}\n />\n );\n if (groups.length === 1) return rows(groups[0]?.actions ?? []);\n return (\n <>\n {groups.map((group) => (\n <Group key={group.key} title={group.title} classNames={classNames}>\n {rows(group.actions)}\n </Group>\n ))}\n </>\n );\n}\n\nconst isOwn = (action: ActionFact): boolean => action.source === \"own\";\n\n/** A part of a topic under its small heading: whose things they are, or what kind. */\nfunction Group({\n title,\n classNames,\n children,\n}: {\n title: string;\n classNames: ClassNames;\n children: ReactNode;\n}) {\n return (\n <>\n <h4 className={classes(classNames, \"sc-about__subtitle\")}>{title}</h4>\n {children}\n </>\n );\n}\n\n/** What is the agent's own, then the organization's: the heading says whose, once. */\nfunction byOwner<T extends { shared?: boolean | undefined }>(\n things: readonly T[],\n name: string,\n words: AboutMessages,\n): { key: string; title: string; things: T[] }[] {\n return [\n { key: \"own\", title: words.theirs(name), things: things.filter((thing) => !thing.shared) },\n {\n key: \"shared\",\n title: words.organization,\n things: things.filter((thing) => thing.shared === true),\n },\n ].filter((group) => group.things.length > 0);\n}\n\n/**\n * What it knows, by whose it is: its own files, then the organization's (shared with every\n * agent: the heading says so, once), then the tables it reads or writes. A file is its kind's\n * mark, its name on one line, its folder under it (and that it is only kept, when `search_files`\n * does not read it), its size at the right; pressed, the host opens it; the host's controls at\n * its end.\n */\nfunction Knowledge({\n name,\n facts,\n words,\n classNames,\n tools,\n controls,\n onOpenFile,\n}: Drawn & {\n name: string;\n facts: Facts;\n tools: AboutTools;\n controls: AboutControls | undefined;\n onOpenFile: ((file: FileFact) => void) | undefined;\n}) {\n return (\n <>\n {byOwner(facts.files, name, words).map((group) => (\n <Group key={group.key} title={group.title} classNames={classNames}>\n <List>\n {group.things.map((file) => (\n <Row\n key={file.path}\n className={classes(classNames, \"sc-about__file\")}\n mark={<FileMark name={file.path} />}\n title={<span title={file.path}>{baseName(file.path)}</span>}\n subtitle={fileLine(file, words)}\n meta={words.size(file.size)}\n onPress={onOpenFile && (() => onOpenFile(file))}\n trailing={controls?.file?.(file, tools) ?? undefined}\n />\n ))}\n </List>\n </Group>\n ))}\n {facts.data.length > 0 && (\n <Group title={words.tables} classNames={classNames}>\n <Rows\n items={facts.data.map((table) => ({\n key: table.table,\n mark: <Mark icon={GLYPHS.table} />,\n label: table.title ?? table.table,\n note: table.can.map((can) => words.can[can] ?? can).join(\", \"),\n control: controls?.table?.(table, tools),\n }))}\n classNames={classNames}\n />\n </Group>\n )}\n </>\n );\n}\n\n/** Under a file's name: its folder, and that it is only kept when nothing reads it at a search. */\nfunction fileLine(file: FileFact, words: AboutMessages): string | undefined {\n const folder = folderOf(file.path);\n if (file.searchable) return folder === \"\" ? undefined : folder;\n return folder === \"\" ? words.kept : `${folder} · ${words.kept}`;\n}\n\n/** Its keys, its own then the organization's, each with where it may be sent. */\nfunction Keys({\n name,\n facts,\n words,\n classNames,\n tools,\n controls,\n}: Drawn & {\n name: string;\n facts: Facts;\n tools: AboutTools;\n controls: AboutControls | undefined;\n}) {\n return (\n <>\n {byOwner(facts.vault, name, words).map((group) => (\n <Group key={group.key} title={group.title} classNames={classNames}>\n <Rows\n items={group.things.map((secret) => ({\n key: `${group.key}:${secret.name}`,\n mark: <Mark icon={GLYPHS.lock} />,\n label: secret.name,\n note: secret.hosts?.join(\", \"),\n control: controls?.key?.(secret, tools),\n }))}\n classNames={classNames}\n />\n </Group>\n ))}\n </>\n );\n}\n\n/** The folders a file sits in: \"\" for one at the top. */\nconst folderOf = (path: string): string => path.slice(0, Math.max(0, path.lastIndexOf(\"/\")));\n\nfunction Rows({ items, classNames }: { items: Item[]; classNames: ClassNames }) {\n return (\n <List>\n {items.map((item) => (\n <Row\n key={item.key}\n mark={item.mark}\n title={item.label}\n subtitle={item.note === undefined || item.note === \"\" ? undefined : item.note}\n meta={\n item.status === undefined ? undefined : (\n <i\n aria-hidden\n data-tone={item.status}\n className={classes(classNames, \"sc-about__dot\")}\n />\n )\n }\n quiet={item.off}\n trailing={item.control ?? undefined}\n />\n ))}\n </List>\n );\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;AAiEA,MAAM,eAA+C;CACnD,MAAM;CACN,OAAO;CACP,WAAW;CACX,UAAU;CACV,UAAU;CACV,MAAM;AACR;AAqEA,MAAa,iBAAgC;CAC3C,SAAS;CACT,UAAU,SAAS,GAAG,KAAK;CAC3B,UAAU;CACV,SAAS;CACT,MAAM;CACN,SAAS;CACT,QAAQ;CACR,MAAM;CACN,eAAe;CACf,QAAQ;CACR,OAAO;EAAE,UAAU;EAAa,SAAS;EAAe,OAAO;CAAc;CAC7E,QAAQ;EACN,MAAM;EACN,OAAO;EACP,WAAW;EACX,UAAU;EACV,UAAU;EACV,MAAM;CACR;CACA,OAAO;EACL,MAAM;EACN,OAAO;EACP,WAAW;EACX,UAAU;EACV,UAAU;EACV,MAAM;CACR;CACA,OAAO;EACL,MAAM;EACN,OAAO;EACP,WAAW;EACX,UAAU;EACV,UAAU;EACV,MAAM;CACR;CACA,SAAS,SAAS,GAAG,KAAK;CAC1B,cAAc;CACd,QAAQ;CACR,MAAM;CACN,KAAK;CACL,KAAK;EAAE,MAAM;EAAY,KAAK;EAAQ,QAAQ;CAAU;CACxD,QAAQ,SAAS,SAAS;CAC1B,OAAO;CACP,SAAS;CACT,KAAK;CACL,SAAS,CAAC;CACV,OAAO,UAAU,WAAW,KAAK;CACjC,MAAM,SAAS,KAAK,mBAAmB;CACvC,cAAc;EACZ,UAAU;EACV,WAAW;EACX,KAAK;EACL,OAAO;EACP,KAAK;EACL,OAAO;CACT;CACA,eAAe;EACb,QAAQ;EACR,SAAS;EACT,OAAO;EACP,cAAc;CAChB;CACA,gBAAgB,WAAW;AAC7B;AAoIA,MAAa,aAAwB,EAAE,MAAM,OAAO;;AAGpD,MAAM,WAAW,SACf,KAAK,SAAS,SAAS,IAAI,KAAK,SAAS,QAAQ,IAAI;;AAGvD,MAAM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,MAAM,KAAK;EACX,OAAO,KAAK;EACZ,UAAU,KAAK,SAAS,KAAA,KAAa,KAAK,SAAS,KAAK,KAAA,IAAY,KAAK;EACzE,MACE,KAAK,WAAW,KAAA,IAAY,KAAA,IAC1B,oBAAC,KAAD;GACE,eAAA;GACA,aAAW,KAAK;GAChB,WAAW,QAAQ,YAAY,eAAe;EAC/C,CAAA;EAGL,OAAO,KAAK;EACZ,UAAU,KAAK,WAAW,KAAA;CAC3B,GAfM,KAAK,GAeX,CACF,EACG,CAAA;AAEV"}
@@ -0,0 +1,49 @@
1
+ import { ReactNode } from "react";
2
+ //#region src/AgentCard.d.ts
3
+ /**
4
+ * One thing the card says: what the host knows it by (`renderValue` switches on it), its label,
5
+ * its text, the words that stand in while it is empty, and whether it is a long text.
6
+ */
7
+ export interface CardField<Key extends string = string> {
8
+ key: Key;
9
+ label: string;
10
+ value: string;
11
+ /** Drawn, muted, while the value is empty. */
12
+ placeholder?: string | undefined;
13
+ /** A long text: its own section under a small heading, at a reading measure. */
14
+ block?: boolean | undefined;
15
+ }
16
+ /** The parts, by the class each carries; `classNames` adds a host's own under the same keys. */
17
+ export type CardPart = "sc-card" | "sc-card--sky" | "sc-card--rose" | "sc-card--sand" | "sc-card__head" | "sc-card__mark" | "sc-card__who" | "sc-card__name" | "sc-card__role" | "sc-card__facts" | "sc-card__fact" | "sc-card__body" | "sc-card__row" | "sc-card__label" | "sc-card__value" | "sc-card__empty";
18
+ type ClassNames = Partial<Record<CardPart, string>> | undefined;
19
+ export interface AgentCardProps<Key extends string = string> {
20
+ /** The agent's id: its mark keeps the tint `agentTint` gives it wherever it appears. */
21
+ id: string;
22
+ /** Its mark (`AGENT_ICONS`), in its tint; a sparkle until it has one. */
23
+ icon?: string | null | undefined;
24
+ /** Who it is, at the top: the name over the role. */
25
+ name: CardField<Key>;
26
+ role: CardField<Key>;
27
+ /**
28
+ * What it says, in order: the short ones (its model, when it was made) as a list of
29
+ * properties, each label beside its value; the long ones (`block`: its description, its
30
+ * instructions) under them, each its own section.
31
+ */
32
+ fields: readonly CardField<Key>[];
33
+ /**
34
+ * Draws a value in the text's place, the name and role included: the host's own control, so
35
+ * the card edits where it stands. `undefined` leaves that field to the card.
36
+ */
37
+ renderValue?: ((field: CardField<Key>) => ReactNode) | undefined;
38
+ classNames?: ClassNames;
39
+ }
40
+ /**
41
+ * The Ficha, as a page about the agent: its mark bare in its tint beside its name, the role
42
+ * under it; its short facts as a quiet list of properties, the label beside its value; then its
43
+ * long texts, each under a small heading at a reading measure. Typography and space carry it; no
44
+ * band, no tiles. The card draws text; a host that edits in place gives `renderValue`.
45
+ */
46
+ export declare function AgentCard<Key extends string = string>({ id, icon, name, role, fields, renderValue, classNames }: AgentCardProps<Key>): import("react").JSX.Element;
47
+ //#endregion
48
+ export {};
49
+ //# sourceMappingURL=AgentCard.d.ts.map
@@ -0,0 +1,77 @@
1
+ import { classes } from "./classes.js";
2
+ import { agentGlyph } from "./agentIcons.js";
3
+ import { agentTint } from "./tint.js";
4
+ import { jsx, jsxs } from "react/jsx-runtime";
5
+ //#region src/AgentCard.tsx
6
+ /**
7
+ * The Ficha, as a page about the agent: its mark bare in its tint beside its name, the role
8
+ * under it; its short facts as a quiet list of properties, the label beside its value; then its
9
+ * long texts, each under a small heading at a reading measure. Typography and space carry it; no
10
+ * band, no tiles. The card draws text; a host that edits in place gives `renderValue`.
11
+ */
12
+ function AgentCard({ id, icon, name, role, fields, renderValue, classNames }) {
13
+ const Glyph = agentGlyph(icon);
14
+ const draw = (field) => {
15
+ const own = renderValue?.(field);
16
+ if (own !== void 0) return own;
17
+ if (field.value.trim() !== "") return field.value;
18
+ return /* @__PURE__ */ jsx("span", {
19
+ className: classes(classNames, "sc-card__empty"),
20
+ children: field.placeholder ?? "—"
21
+ });
22
+ };
23
+ const facts = fields.filter((field) => !field.block);
24
+ const texts = fields.filter((field) => field.block);
25
+ return /* @__PURE__ */ jsxs("article", {
26
+ className: `sc ${classes(classNames, "sc-card", `sc-card--${agentTint(id)}`)}`,
27
+ children: [
28
+ /* @__PURE__ */ jsxs("header", {
29
+ className: classes(classNames, "sc-card__head"),
30
+ children: [/* @__PURE__ */ jsx("span", {
31
+ "aria-hidden": true,
32
+ className: classes(classNames, "sc-card__mark"),
33
+ children: /* @__PURE__ */ jsx(Glyph, { weight: "duotone" })
34
+ }), /* @__PURE__ */ jsxs("div", {
35
+ className: classes(classNames, "sc-card__who"),
36
+ children: [/* @__PURE__ */ jsx("h2", {
37
+ className: classes(classNames, "sc-card__name"),
38
+ children: draw(name)
39
+ }), /* @__PURE__ */ jsx("p", {
40
+ className: classes(classNames, "sc-card__role"),
41
+ children: draw(role)
42
+ })]
43
+ })]
44
+ }),
45
+ facts.length > 0 && /* @__PURE__ */ jsx("dl", {
46
+ className: classes(classNames, "sc-card__facts"),
47
+ children: facts.map((field) => /* @__PURE__ */ jsxs("div", {
48
+ className: classes(classNames, "sc-card__fact"),
49
+ children: [/* @__PURE__ */ jsx("dt", {
50
+ className: classes(classNames, "sc-card__label"),
51
+ children: field.label
52
+ }), /* @__PURE__ */ jsx("dd", {
53
+ className: classes(classNames, "sc-card__value"),
54
+ children: draw(field)
55
+ })]
56
+ }, field.key))
57
+ }),
58
+ texts.length > 0 && /* @__PURE__ */ jsx("dl", {
59
+ className: classes(classNames, "sc-card__body"),
60
+ children: texts.map((field) => /* @__PURE__ */ jsxs("div", {
61
+ className: classes(classNames, "sc-card__row"),
62
+ children: [/* @__PURE__ */ jsx("dt", {
63
+ className: classes(classNames, "sc-card__label"),
64
+ children: field.label
65
+ }), /* @__PURE__ */ jsx("dd", {
66
+ className: classes(classNames, "sc-card__value"),
67
+ children: draw(field)
68
+ })]
69
+ }, field.key))
70
+ })
71
+ ]
72
+ });
73
+ }
74
+ //#endregion
75
+ export { AgentCard };
76
+
77
+ //# sourceMappingURL=AgentCard.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"AgentCard.js","names":[],"sources":["../src/AgentCard.tsx"],"sourcesContent":["import type { ReactNode } from \"react\";\n\nimport { agentGlyph } from \"./agentIcons\";\nimport { classes } from \"./classes\";\nimport { agentTint } from \"./tint\";\n\n/**\n * One thing the card says: what the host knows it by (`renderValue` switches on it), its label,\n * its text, the words that stand in while it is empty, and whether it is a long text.\n */\nexport interface CardField<Key extends string = string> {\n key: Key;\n label: string;\n value: string;\n /** Drawn, muted, while the value is empty. */\n placeholder?: string | undefined;\n /** A long text: its own section under a small heading, at a reading measure. */\n block?: boolean | undefined;\n}\n\n/** The parts, by the class each carries; `classNames` adds a host's own under the same keys. */\nexport type CardPart =\n | \"sc-card\"\n | \"sc-card--sky\"\n | \"sc-card--rose\"\n | \"sc-card--sand\"\n | \"sc-card__head\"\n | \"sc-card__mark\"\n | \"sc-card__who\"\n | \"sc-card__name\"\n | \"sc-card__role\"\n | \"sc-card__facts\"\n | \"sc-card__fact\"\n | \"sc-card__body\"\n | \"sc-card__row\"\n | \"sc-card__label\"\n | \"sc-card__value\"\n | \"sc-card__empty\";\n\ntype ClassNames = Partial<Record<CardPart, string>> | undefined;\n\nexport interface AgentCardProps<Key extends string = string> {\n /** The agent's id: its mark keeps the tint `agentTint` gives it wherever it appears. */\n id: string;\n /** Its mark (`AGENT_ICONS`), in its tint; a sparkle until it has one. */\n icon?: string | null | undefined;\n /** Who it is, at the top: the name over the role. */\n name: CardField<Key>;\n role: CardField<Key>;\n /**\n * What it says, in order: the short ones (its model, when it was made) as a list of\n * properties, each label beside its value; the long ones (`block`: its description, its\n * instructions) under them, each its own section.\n */\n fields: readonly CardField<Key>[];\n /**\n * Draws a value in the text's place, the name and role included: the host's own control, so\n * the card edits where it stands. `undefined` leaves that field to the card.\n */\n renderValue?: ((field: CardField<Key>) => ReactNode) | undefined;\n classNames?: ClassNames;\n}\n\n/**\n * The Ficha, as a page about the agent: its mark bare in its tint beside its name, the role\n * under it; its short facts as a quiet list of properties, the label beside its value; then its\n * long texts, each under a small heading at a reading measure. Typography and space carry it; no\n * band, no tiles. The card draws text; a host that edits in place gives `renderValue`.\n */\nexport function AgentCard<Key extends string = string>({\n id,\n icon,\n name,\n role,\n fields,\n renderValue,\n classNames,\n}: AgentCardProps<Key>) {\n const Glyph = agentGlyph(icon);\n const draw = (field: CardField<Key>): ReactNode => {\n const own = renderValue?.(field);\n if (own !== undefined) return own;\n if (field.value.trim() !== \"\") return field.value;\n return (\n <span className={classes(classNames, \"sc-card__empty\")}>{field.placeholder ?? \"—\"}</span>\n );\n };\n const facts = fields.filter((field) => !field.block);\n const texts = fields.filter((field) => field.block);\n return (\n <article className={`sc ${classes(classNames, \"sc-card\", `sc-card--${agentTint(id)}`)}`}>\n <header className={classes(classNames, \"sc-card__head\")}>\n <span aria-hidden className={classes(classNames, \"sc-card__mark\")}>\n <Glyph weight=\"duotone\" />\n </span>\n <div className={classes(classNames, \"sc-card__who\")}>\n <h2 className={classes(classNames, \"sc-card__name\")}>{draw(name)}</h2>\n <p className={classes(classNames, \"sc-card__role\")}>{draw(role)}</p>\n </div>\n </header>\n {facts.length > 0 && (\n <dl className={classes(classNames, \"sc-card__facts\")}>\n {facts.map((field) => (\n <div key={field.key} className={classes(classNames, \"sc-card__fact\")}>\n <dt className={classes(classNames, \"sc-card__label\")}>{field.label}</dt>\n <dd className={classes(classNames, \"sc-card__value\")}>{draw(field)}</dd>\n </div>\n ))}\n </dl>\n )}\n {texts.length > 0 && (\n <dl className={classes(classNames, \"sc-card__body\")}>\n {texts.map((field) => (\n <div key={field.key} className={classes(classNames, \"sc-card__row\")}>\n <dt className={classes(classNames, \"sc-card__label\")}>{field.label}</dt>\n <dd className={classes(classNames, \"sc-card__value\")}>{draw(field)}</dd>\n </div>\n ))}\n </dl>\n )}\n </article>\n );\n}\n"],"mappings":";;;;;;;;;;;AAqEA,SAAgB,UAAuC,EACrD,IACA,MACA,MACA,MACA,QACA,aACA,cACsB;CACtB,MAAM,QAAQ,WAAW,IAAI;CAC7B,MAAM,QAAQ,UAAqC;EACjD,MAAM,MAAM,cAAc,KAAK;EAC/B,IAAI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AAC,MAAD;IAAI,WAAW,QAAQ,YAAY,eAAe;IAC/C,UAAA,MAAM,KAAK,UACV,qBAAC,OAAD;KAAqB,WAAW,QAAQ,YAAY,cAAc;KAAlE,UAAA,CACE,oBAAC,MAAD;MAAI,WAAW,QAAQ,YAAY,gBAAgB;MAAI,UAAA,MAAM;KAAU,CAAA,GACvE,oBAAC,MAAD;MAAI,WAAW,QAAQ,YAAY,gBAAgB;MAAI,UAAA,KAAK,KAAK;KAAM,CAAA,CACpE;IAHK,GAAA,MAAM,GAGX,CACN;GACC,CAAA;EAEC;;AAEb"}
@@ -0,0 +1,233 @@
1
+ import { Attachment, Delivery, Handover, Holder } from "./types.js";
2
+ import { Client } from "./client.js";
3
+ import { KitLocale, KitMessages } from "./kit/messages.js";
4
+ import { KitPart } from "./kit/context.js";
5
+ import { ToolHandler } from "./useConversation.js";
6
+ import { BrowserMessages, BrowserPart } from "./BrowserView.js";
7
+ import { Dictate } from "./useDictation.js";
8
+ import { SurfaceComponents, SurfacePart } from "./surface/scope.js";
9
+ import { ReactNode } from "react";
10
+ //#region src/AgentChat.d.ts
11
+ /** The words the chat says; a host gives its own, in its language. */
12
+ export interface ChatMessages {
13
+ /** The composer's invitation, and the field's name; `fresh` while nothing has been said. */
14
+ placeholder: (name: string, fresh: boolean) => string;
15
+ /** In the composer while the socket is not open. */
16
+ connecting: string;
17
+ /** In the composer while the turn waits for the person to act above. */
18
+ awaiting: string;
19
+ /** Over the composer while a reply is on its way. */
20
+ thinking: (name: string) => string;
21
+ /** Over the composer while a reply is on its way, where the agent's steps are hidden. */
22
+ typing: string;
23
+ /** The builder's line over the composer, while nothing runs and nothing is written yet. */
24
+ working: string;
25
+ /** The builder's line over the composer, while its words come. */
26
+ writing: string;
27
+ /** How long the reply has taken so far, beside it. */
28
+ elapsed: (seconds: number) => string;
29
+ /** At the end of that line: how to stop the reply. */
30
+ escape: string;
31
+ /** Under the log once a reply is in: how long it took. */
32
+ done: (seconds: number) => string;
33
+ /** A conversation with nothing said yet: its title. */
34
+ empty: (name: string) => string;
35
+ /** Under the title, a line on what to say; nothing when empty. */
36
+ intro: (name: string) => string;
37
+ /** The send button's name. */
38
+ send: string;
39
+ /** The button that attaches files, by its name. */
40
+ attach: string;
41
+ /** Over the chat while files are dragged over it. */
42
+ drop: string;
43
+ /** The microphone's name: to dictate, and to stop and have it written. */
44
+ dictate: string;
45
+ dictateStop: string;
46
+ /** Beside the microphone while it listens, writes, or could not. */
47
+ dictation: Readonly<Record<"listening" | "writing" | "failed", string>>;
48
+ /** The stop button's name, in the send button's place while a reply is on its way. */
49
+ stop: string;
50
+ /** The message list's name, for screen readers. */
51
+ log: string;
52
+ /** A step's name, by the action's name as the platform gives it; the name itself otherwise. */
53
+ steps: Readonly<Record<string, string>>;
54
+ /** Beside a step that failed, in the builder's look: the colour is never the whole message. */
55
+ failed: string;
56
+ /** What heads the card of an action that needs the person's leave. */
57
+ approval: string;
58
+ /** The agent wants to run an action that needs the person's leave. */
59
+ request: (name: string, action: string) => string;
60
+ /** An action's input fields, by their name, as the approval card labels them. */
61
+ inputs: Readonly<Record<string, string>>;
62
+ allow: string;
63
+ decline: string;
64
+ /**
65
+ * On a person's page, in place of the approval card: what the agent asked to do waits for the
66
+ * business's yes (`decides: "business"`), which its people give from their app.
67
+ */
68
+ confirming: string;
69
+ /** The line across the log where the agent handed the conversation to a person. */
70
+ handedOff: string;
71
+ /**
72
+ * The line across the log where who answers the conversation changed (`handovers`), before
73
+ * why: to whom (`holder`), and who changed it (`by`).
74
+ */
75
+ handover: (holder: Holder, by: HandoverBy, name: string) => string;
76
+ /** Under a person's message the agent let pass this time (a `skip`), before why. */
77
+ skipped: string;
78
+ /**
79
+ * On a call, under a reply the person cut short: the last of what they heard of it (`""`:
80
+ * nothing of it).
81
+ */
82
+ cut: (heard: string) => string;
83
+ /** The composer's invitation when the host takes what is written (`write`): the business's. */
84
+ write: string;
85
+ /** Under what a person of the business wrote on the channel: who it was. */
86
+ business: string;
87
+ /** A voice note's player, by its name. */
88
+ voiceNote: string;
89
+ /** Where what went out on a channel got to, as its mark's name. */
90
+ delivery: Readonly<Record<Delivery, string>>;
91
+ /** Beside a message that never reached the person, with the provider's reason when it gave one. */
92
+ undelivered: (error: string | null) => string;
93
+ /**
94
+ * What the page answers when the agent calls one of the host's tools and the chat was given no
95
+ * `onTool` to run it: read by the agent, never shown.
96
+ */
97
+ noTool: string;
98
+ /** What the kit's controls say on the agent's screens: a form's checks, a calendar, a list. */
99
+ kit: Partial<KitMessages>;
100
+ /** What the browser the agent drives says: who holds it, take it, give it back. */
101
+ browser: BrowserMessages;
102
+ }
103
+ export declare const CHAT_MESSAGES: ChatMessages;
104
+ /** The chat's parts, by the class each carries; `classNames` adds a host's own under the same keys. */
105
+ export type ChatPart = "sc-chat" | "sc-chat--builder" | "sc-chat--console" | "sc-chat__log" | "sc-chat__log--channel" | "sc-chat__message" | "sc-chat__message--person" | "sc-chat__message--agent" | "sc-chat__message--action" | "sc-chat__message--business" | "sc-chat__said" | "sc-chat__business" | "sc-chat__meta" | "sc-chat__delivery" | "sc-chat__text" | "sc-chat__steps" | "sc-chat__step" | "sc-chat__mark" | "sc-chat__step--running" | "sc-chat__step--queued" | "sc-chat__step--waiting" | "sc-chat__step--done" | "sc-chat__step--failed" | "sc-chat__output" | "sc-chat__request" | "sc-chat__confirming" | "sc-chat__screen" | "sc-chat__screen--bare" | "sc-chat__handoff" | "sc-chat__handover" | "sc-chat__decision" | "sc-chat__message--heard" | "sc-chat__message--voice" | "sc-chat__transcript" | "sc-chat__cut" | "sc-chat__reply" | "sc-chat__status" | "sc-chat__done" | "sc-chat__empty" | "sc-chat__suggestion" | "sc-chat__composer" | "sc-chat__files" | "sc-chat__attach" | "sc-chat__dictate" | "sc-chat__typing" | "sc-chat__dictation" | "sc-chat__drop" | "sc-chat__input" | "sc-chat__actions" | "sc-chat__send" | "sc-chat__stop";
106
+ type ClassNames = Partial<Record<ChatPart | SurfacePart | KitPart | BrowserPart, string>> | undefined;
107
+ /**
108
+ * How the chat looks. `agent` is an agent's conversation. `builder` is the builder's, v2's: the
109
+ * working line says what it does under the brand's sweeping light, the steps open on what they
110
+ * returned, the send is the brand's; `console` is the same seen as a console beside the work, the
111
+ * person's words as prompt lines.
112
+ */
113
+ export type ChatLook = "agent" | "builder" | "console";
114
+ /**
115
+ * Whether the chat shows the steps the agent took (searching its files, remembering, calling a
116
+ * tool, with what each returned): `shown` for the business, who wants to see the work; `hidden`
117
+ * for the people it serves, who see only what the agent says and shows, and a quiet line while
118
+ * it works.
119
+ */
120
+ export type ChatSteps = "shown" | "hidden";
121
+ /**
122
+ * Who changed who answers a conversation: one of the business's people (`owner`), the agent itself
123
+ * (its `escalate`), the platform (a release after quiet hours, a contact the owner marked), or an
124
+ * automation, by its title.
125
+ */
126
+ export type HandoverBy = {
127
+ kind: "owner" | "agent" | "platform";
128
+ } | {
129
+ kind: "automation";
130
+ title: string;
131
+ };
132
+ /** Something the host hands the chat from outside it, to say or to leave in the composer. */
133
+ export interface ChatCompose {
134
+ text: string;
135
+ /** Said at once; otherwise left in the composer for the person to finish. */
136
+ send: boolean;
137
+ /** Tells one request from the last: each new key is taken once. */
138
+ key: number;
139
+ }
140
+ export interface AgentChatProps {
141
+ client: Client;
142
+ conversationId: string;
143
+ /** The agent's name, for the words that address it. */
144
+ name: string;
145
+ messages?: Partial<ChatMessages> | undefined;
146
+ classNames?: ClassNames;
147
+ /** The host's own drawing of a block type, for every surface the agent shows. */
148
+ components?: SurfaceComponents | undefined;
149
+ /** The language of the surfaces' calendars, days, times and numbers; English by default. */
150
+ locale?: KitLocale | undefined;
151
+ /** An error's code, from the socket or `load` for a history that could not be read; the host words it. */
152
+ onError?: ((code: string) => void) | undefined;
153
+ /** The host's own controls, at the composer's left. */
154
+ actions?: ReactNode;
155
+ /** A few things the person might say first, offered while nothing has been said; a click says it. */
156
+ suggestions?: readonly string[] | undefined;
157
+ /**
158
+ * A request from elsewhere on the page (a button beside the chat), taken once each time `key`
159
+ * changes; the one the chat mounts with is not. With `send` it is said, once the socket is open;
160
+ * while a reply is on its way or the turn waits, it goes into the composer instead. Without, it
161
+ * goes into the composer, focused with the caret at its end.
162
+ */
163
+ compose?: ChatCompose | undefined;
164
+ /** An agent's conversation by default; the builder's, or the builder's as a console. */
165
+ look?: ChatLook | undefined;
166
+ /**
167
+ * Whether the agent's steps show: by default as the page speaks (`client.who`): `shown` for the
168
+ * business, `hidden` for a person or a visitor, who see what the agent says and shows (its
169
+ * surfaces, files, a yes it waits for) and `typing` while it works.
170
+ */
171
+ steps?: ChatSteps | undefined;
172
+ /**
173
+ * Whether the person can attach files to what they say (the paperclip, dropping them on the
174
+ * chat, pasting a picture): each uploads to the conversation at once. On in every look, the
175
+ * builder's too; a host turns it off where nobody talks (a transcript read).
176
+ */
177
+ attachments?: boolean | undefined;
178
+ /**
179
+ * Opens a file of the conversation (one the person sent, one sent through a form), as the host
180
+ * shows files (`FileView` in a dialog, its bytes from the API); without it, files only read.
181
+ */
182
+ onOpenFile?: ((file: Attachment) => void) | undefined;
183
+ /**
184
+ * Turns what the person says out loud into words in the composer (the microphone beside the
185
+ * paperclip): the host's speech to text. Without it there is no microphone.
186
+ */
187
+ dictate?: Dictate | undefined;
188
+ /**
189
+ * Where what is written goes instead of the socket: on a conversation on a channel, a person of
190
+ * the business writing to the person there (`POST /conversations/{id}/operator`). The composer
191
+ * then says `write`, takes words and files whatever the agent is doing, and empties once the
192
+ * promise resolves (a rejection leaves them, for the host to say why); what was written comes
193
+ * back on the socket as a message.
194
+ */
195
+ write?: ((text: string, files: readonly string[]) => Promise<unknown>) | undefined;
196
+ /**
197
+ * Whether the log draws who answers the conversation, for a host of the business's (the inbox,
198
+ * the activity): each change (read with the history, then heard live) a quiet line where it
199
+ * fell, with why and when, and under a person's message the agent let pass, that it did. Off,
200
+ * the log draws only where the agent handed it to a person, from its `escalate` step.
201
+ */
202
+ handovers?: boolean | undefined;
203
+ /** Hears each change of who answers the conversation, live: the host's own views of it follow. */
204
+ onHolder?: ((holder: Holder, handover: Handover) => void) | undefined;
205
+ /** Hears each step the agent starts, live, by its action's name: the host's views follow. */
206
+ onStep?: ((action: string) => void) | undefined;
207
+ /**
208
+ * The conversation's last change of who answers it, as the host knows it (one it made itself,
209
+ * as its request answered): drawn at once, whether or not the socket tells it, and kept once.
210
+ */
211
+ handover?: Handover | null | undefined;
212
+ /**
213
+ * Runs one of the host's own tools the agent calls in the page (opening a record in the host's
214
+ * screen, say): what it resolves to goes back to the agent, what it rejects with as why it
215
+ * failed; its step shows as working meanwhile. Without it, each is refused with `noTool`.
216
+ */
217
+ onTool?: ToolHandler | undefined;
218
+ }
219
+ /**
220
+ * The conversation with an agent: the person's messages at the right in a bubble, the agent's at
221
+ * the left as text with the steps it took and what they drew, its reply growing as it streams;
222
+ * the composer at the foot. On a channel, the business's side stays at the left: the agent's
223
+ * words with where they got to (a quiet mark), and what a person of the business wrote set apart
224
+ * in a bubble of its own; the surfaces went to the person there, so they only read here, and the
225
+ * reply, which runs on its own time, can't be stopped from here. With `handovers`, each change of
226
+ * who answers it is a quiet line where it fell, the moment it is made, and a person's message the
227
+ * agent let pass says so under it. The host picks the conversation; another id starts the chat
228
+ * afresh.
229
+ */
230
+ export declare function AgentChat(props: AgentChatProps): import("react").JSX.Element;
231
+ //#endregion
232
+ export {};
233
+ //# sourceMappingURL=AgentChat.d.ts.map