@hanzo/app 0.3.73 → 0.3.75

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 (216) hide show
  1. package/assets/personas/abai_qunanbaiuly.svg +3 -3
  2. package/assets/personas/ada.svg +3 -3
  3. package/assets/personas/adonis.svg +3 -3
  4. package/assets/personas/aime_cesaire.svg +3 -3
  5. package/assets/personas/al_biruni.svg +3 -3
  6. package/assets/personas/al_farabi.svg +3 -3
  7. package/assets/personas/al_khwarizmi.svg +3 -3
  8. package/assets/personas/al_kindi.svg +3 -3
  9. package/assets/personas/alan_watts.svg +3 -3
  10. package/assets/personas/alexandra_david_neel.svg +3 -3
  11. package/assets/personas/alisher_navoi.svg +3 -3
  12. package/assets/personas/amir_khusrau.svg +3 -3
  13. package/assets/personas/angelou.svg +3 -3
  14. package/assets/personas/anne_sexton.svg +3 -3
  15. package/assets/personas/aquinas.svg +3 -3
  16. package/assets/personas/aryabhata.svg +3 -3
  17. package/assets/personas/attar.svg +3 -3
  18. package/assets/personas/augustine.svg +3 -3
  19. package/assets/personas/averroes.svg +3 -3
  20. package/assets/personas/avicenna.svg +3 -3
  21. package/assets/personas/baal_shem_tov.svg +3 -3
  22. package/assets/personas/baha_ullah.svg +3 -3
  23. package/assets/personas/basho.svg +3 -3
  24. package/assets/personas/basil_great.svg +3 -3
  25. package/assets/personas/bernard_clairvaux.svg +3 -3
  26. package/assets/personas/bhaskara_ii.svg +3 -3
  27. package/assets/personas/brahmagupta.svg +3 -3
  28. package/assets/personas/cao_xueqin.svg +3 -3
  29. package/assets/personas/cesare_beccaria.svg +3 -3
  30. package/assets/personas/chikamatsu_monzaemon.svg +3 -3
  31. package/assets/personas/christiaan_huygens.svg +3 -3
  32. package/assets/personas/cicero.svg +3 -3
  33. package/assets/personas/clarice_lispector.svg +3 -3
  34. package/assets/personas/claudio_monteverdi.svg +3 -3
  35. package/assets/personas/clement_alexandria.svg +3 -3
  36. package/assets/personas/coltrane.svg +3 -3
  37. package/assets/personas/constance_garnett.svg +3 -3
  38. package/assets/personas/creative.svg +3 -3
  39. package/assets/personas/cv_raman.svg +3 -3
  40. package/assets/personas/cynthia_dwork.svg +3 -3
  41. package/assets/personas/dali.svg +3 -3
  42. package/assets/personas/david_bowie.svg +3 -3
  43. package/assets/personas/david_chaum.svg +3 -3
  44. package/assets/personas/davis.svg +3 -3
  45. package/assets/personas/desmond_tutu.svg +3 -3
  46. package/assets/personas/dogen.svg +3 -3
  47. package/assets/personas/donald_knuth.svg +3 -3
  48. package/assets/personas/du_fu.svg +3 -3
  49. package/assets/personas/edgar_codd.svg +3 -3
  50. package/assets/personas/eileen_chang.svg +3 -3
  51. package/assets/personas/emilie_du_chatelet.svg +3 -3
  52. package/assets/personas/emmeline_pankhurst.svg +3 -3
  53. package/assets/personas/forugh_farrokhzad.svg +3 -3
  54. package/assets/personas/france_preseren.svg +3 -3
  55. package/assets/personas/frances_perkins.svg +3 -3
  56. package/assets/personas/franz_schubert.svg +3 -3
  57. package/assets/personas/gabriel_garcia_marquez.svg +3 -3
  58. package/assets/personas/gabriela_mistral.svg +3 -3
  59. package/assets/personas/galois.svg +3 -3
  60. package/assets/personas/gandhi.svg +3 -3
  61. package/assets/personas/gao_xingjian.svg +3 -3
  62. package/assets/personas/geoffrey_hinton.svg +2 -2
  63. package/assets/personas/george_eliot.svg +3 -3
  64. package/assets/personas/george_martin.svg +3 -3
  65. package/assets/personas/georges_lemaitre.svg +3 -3
  66. package/assets/personas/giambattista_vico.svg +3 -3
  67. package/assets/personas/godel.svg +3 -3
  68. package/assets/personas/goethe.svg +3 -3
  69. package/assets/personas/gregory_nazianzus.svg +3 -3
  70. package/assets/personas/gregory_palamas.svg +3 -3
  71. package/assets/personas/grothendieck.svg +3 -3
  72. package/assets/personas/guru_nanak.svg +3 -3
  73. package/assets/personas/hafez.svg +3 -3
  74. package/assets/personas/hickey.svg +2 -2
  75. package/assets/personas/hildegard_bingen.svg +3 -3
  76. package/assets/personas/hua_luogeng.svg +3 -3
  77. package/assets/personas/hubert_dreyfus.svg +3 -3
  78. package/assets/personas/hugo.svg +3 -3
  79. package/assets/personas/ibn_al_haytham.svg +3 -3
  80. package/assets/personas/ibn_arabi.svg +3 -3
  81. package/assets/personas/jack_ma.svg +3 -3
  82. package/assets/personas/jamsetji_tata.svg +3 -3
  83. package/assets/personas/janis_joplin.svg +3 -3
  84. package/assets/personas/jcr_licklider.svg +3 -3
  85. package/assets/personas/jerome.svg +3 -3
  86. package/assets/personas/jimi_hendrix.svg +3 -3
  87. package/assets/personas/john_cage.svg +3 -3
  88. package/assets/personas/john_maynard_keynes.svg +3 -3
  89. package/assets/personas/john_wanamaker.svg +3 -3
  90. package/assets/personas/joseph_weizenbaum.svg +3 -3
  91. package/assets/personas/junichiro_tanizaki.svg +3 -3
  92. package/assets/personas/kalidasa.svg +3 -3
  93. package/assets/personas/kamo_no_chomei.svg +3 -3
  94. package/assets/personas/kaoru_ishikawa.svg +3 -3
  95. package/assets/personas/karen_sparck_jones.svg +3 -3
  96. package/assets/personas/katsushika_hokusai.svg +3 -3
  97. package/assets/personas/khalil_gibran.svg +3 -3
  98. package/assets/personas/kovalevskaya.svg +3 -3
  99. package/assets/personas/kunihiko_fukushima.svg +3 -3
  100. package/assets/personas/kwasi_wiredu.svg +3 -3
  101. package/assets/personas/leibniz.svg +3 -3
  102. package/assets/personas/leo_burnett.svg +3 -3
  103. package/assets/personas/li_qingzhao.svg +3 -3
  104. package/assets/personas/liu_hui.svg +3 -3
  105. package/assets/personas/lu_xun.svg +3 -3
  106. package/assets/personas/lucretius.svg +3 -3
  107. package/assets/personas/madhava.svg +3 -3
  108. package/assets/personas/madonna.svg +3 -3
  109. package/assets/personas/mahmoud_darwish.svg +3 -3
  110. package/assets/personas/maimonides.svg +3 -3
  111. package/assets/personas/mandela.svg +3 -3
  112. package/assets/personas/mandela_contextual.svg +3 -3
  113. package/assets/personas/mariama_ba.svg +3 -3
  114. package/assets/personas/marina_tsvetaeva.svg +3 -3
  115. package/assets/personas/mary_parker_follett.svg +3 -3
  116. package/assets/personas/mary_shelley.svg +3 -3
  117. package/assets/personas/massimo_vignelli.svg +2 -2
  118. package/assets/personas/meister_eckhart.svg +3 -3
  119. package/assets/personas/miguel_angel_asturias.svg +3 -3
  120. package/assets/personas/mircea_eliade.svg +3 -3
  121. package/assets/personas/mirza_ghalib.svg +3 -3
  122. package/assets/personas/morrison.svg +3 -3
  123. package/assets/personas/muhammad_ali.svg +3 -3
  124. package/assets/personas/murasaki_shikibu.svg +3 -3
  125. package/assets/personas/nagarjuna.svg +3 -3
  126. package/assets/personas/nazim_hikmet.svg +3 -3
  127. package/assets/personas/nguyen_du.svg +3 -3
  128. package/assets/personas/nina_simone.svg +3 -3
  129. package/assets/personas/nishida_kitaro.svg +3 -3
  130. package/assets/personas/nizami.svg +3 -3
  131. package/assets/personas/norbert_wiener.svg +3 -3
  132. package/assets/personas/paglia.svg +2 -2
  133. package/assets/personas/pascal.svg +3 -3
  134. package/assets/personas/plato.svg +3 -3
  135. package/assets/personas/plotinus.svg +3 -3
  136. package/assets/personas/plutarch.svg +3 -3
  137. package/assets/personas/pramoedya_ananta_toer.svg +3 -3
  138. package/assets/personas/premchand.svg +3 -3
  139. package/assets/personas/prince.svg +3 -3
  140. package/assets/personas/pseudo_dionysius.svg +3 -3
  141. package/assets/personas/ptolemy.svg +3 -3
  142. package/assets/personas/pythagoras.svg +3 -3
  143. package/assets/personas/qu_yuan.svg +3 -3
  144. package/assets/personas/queen_liliuokalani.svg +3 -3
  145. package/assets/personas/rabia_al_adawiyya.svg +3 -3
  146. package/assets/personas/radia_perlman.svg +3 -3
  147. package/assets/personas/ralph_ellison.svg +3 -3
  148. package/assets/personas/ralph_merkle.svg +3 -3
  149. package/assets/personas/ramanujan.svg +3 -3
  150. package/assets/personas/ravi_shankar.svg +3 -3
  151. package/assets/personas/richard_victor.svg +3 -3
  152. package/assets/personas/robert_boyle.svg +3 -3
  153. package/assets/personas/romulo_gallegos.svg +3 -3
  154. package/assets/personas/ruben_dario.svg +3 -3
  155. package/assets/personas/rumi.svg +3 -3
  156. package/assets/personas/rumi_contextual.svg +3 -3
  157. package/assets/personas/saadi.svg +3 -3
  158. package/assets/personas/samuel_johnson.svg +3 -3
  159. package/assets/personas/sei_shonagon.svg +3 -3
  160. package/assets/personas/seki_takakazu.svg +3 -3
  161. package/assets/personas/sergey_brin.svg +3 -3
  162. package/assets/personas/sesshu_toyo.svg +3 -3
  163. package/assets/personas/shafi_goldwasser.svg +3 -3
  164. package/assets/personas/shen_congwen.svg +3 -3
  165. package/assets/personas/shen_kuo.svg +3 -3
  166. package/assets/personas/shitao.svg +3 -3
  167. package/assets/personas/sima_guang.svg +3 -3
  168. package/assets/personas/sima_qian.svg +3 -3
  169. package/assets/personas/sor_juana_ines_de_la_cruz.svg +3 -3
  170. package/assets/personas/stanley_marcus.svg +3 -3
  171. package/assets/personas/taher_elgamal.svg +3 -3
  172. package/assets/personas/tatsumi_hijikata.svg +3 -3
  173. package/assets/personas/tesla.svg +3 -3
  174. package/assets/personas/thelonious_monk.svg +3 -3
  175. package/assets/personas/thurgood_marshall.svg +3 -3
  176. package/assets/personas/tim_burton.svg +3 -3
  177. package/assets/personas/toru_takemitsu.svg +3 -3
  178. package/assets/personas/tpope.svg +3 -3
  179. package/assets/personas/trevor_noah.svg +3 -3
  180. package/assets/personas/tsongkhapa.svg +3 -3
  181. package/assets/personas/u_thant.svg +3 -3
  182. package/assets/personas/verghese_kurien.svg +3 -3
  183. package/assets/personas/vs_naipaul.svg +3 -3
  184. package/assets/personas/wang_anshi.svg +3 -3
  185. package/assets/personas/wang_wei.svg +3 -3
  186. package/assets/personas/wang_yangming.svg +3 -3
  187. package/assets/personas/whitfield_diffie.svg +3 -3
  188. package/assets/personas/william_harvey.svg +3 -3
  189. package/assets/personas/xunzi.svg +3 -3
  190. package/assets/personas/yasunari_kawabata.svg +3 -3
  191. package/assets/personas/yogananda.svg +3 -3
  192. package/assets/personas/yukio_mishima.svg +3 -3
  193. package/assets/personas/zeami_motokiyo.svg +3 -3
  194. package/assets/personas/zeekay.svg +2 -2
  195. package/assets/personas/zhu_xi.svg +3 -3
  196. package/assets/personas/zora_neale_hurston.svg +3 -3
  197. package/dist/PreferencesDialog.d.ts +5 -0
  198. package/dist/PreferencesDialog.js +25 -0
  199. package/dist/bots/Bots.js +1 -1
  200. package/dist/bots/Panel.d.ts +3 -4
  201. package/dist/bots/Panel.js +74 -36
  202. package/dist/bots/Roster.js +40 -22
  203. package/dist/bots/Thread.d.ts +0 -1
  204. package/dist/bots/Thread.js +45 -30
  205. package/dist/bots/face.d.ts +3 -1
  206. package/dist/bots/face.js +12 -8
  207. package/dist/bots/grid.d.ts +1 -1
  208. package/dist/bots/grid.js +17 -2
  209. package/dist/bots/ink.d.ts +6 -6
  210. package/dist/bots/ink.js +8 -16
  211. package/dist/bots/kit.d.ts +13 -12
  212. package/dist/bots/kit.js +33 -11
  213. package/dist/bots/said.d.ts +16 -0
  214. package/dist/bots/said.js +63 -0
  215. package/dist/team.gen.js +1 -1
  216. package/package.json +2 -2
@@ -1,21 +1,20 @@
1
1
  'use client';
2
- import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
3
- // The roster: search and new at the top, the bots as a grid of faces, the rest
4
- // as rows with the last thing each said, and the reader at the foot.
5
- //
6
- // The grid holds twelve, four rows of three, in the order the bots were made, so
7
- // a face does not move once you know where it is. A bot past the twelfth is a
8
- // row, newest conversation first, which is where a bot you are busy with is.
9
- import { useMemo, useState } from 'react';
2
+ import { Fragment as _Fragment, jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
3
+ // The roster: search and new at the top, the bots as a 3x4 grid of faces, the
4
+ // rest as rows with the last thing each said, and the reader + Preferences at
5
+ // the foot.
6
+ import { useEffect, useMemo, useState } from 'react';
10
7
  import { useI18n } from '@hanzo/i18n/react';
11
8
  import { Input, Text, XStack, YStack } from '@hanzo/gui';
12
9
  import { DropdownMenu, DropdownMenuContent, DropdownMenuItem, DropdownMenuLabel, DropdownMenuSeparator, DropdownMenuTrigger, } from '@hanzo/ui';
13
10
  import { BUSINESS_APPS } from '@hanzo/ui/product';
14
- import { LayoutGrid, Plus, Search, X } from 'lucide-react';
11
+ import { Grid2x2Plus, Plus, Search, SlidersHorizontal, X } from 'lucide-react';
15
12
  import { useSignOut } from '../lib/signout.js';
13
+ import { PreferencesDialog } from '../PreferencesDialog.js';
14
+ import { called, member } from '../team.js';
16
15
  import { Face } from './face.js';
17
16
  import { CLIP, PILL, ROUND, WORD } from './kit.js';
18
- import { DIM, INK, LINE, PICKED, RAISED } from './ink.js';
17
+ import { DIM, FLOOR, INK, LINE, PICKED, RAISED } from './ink.js';
19
18
  import { lastWord, split } from './grid.js';
20
19
  export function Roster({ bots, last, open, unread, me, onPick, onMake, disabled, }) {
21
20
  const { t } = useI18n();
@@ -24,27 +23,46 @@ export function Roster({ bots, last, open, unread, me, onPick, onMake, disabled,
24
23
  const shown = useMemo(() => {
25
24
  const q = query.trim().toLowerCase();
26
25
  const all = bots ?? [];
27
- return q ? all.filter((b) => b.name.toLowerCase().includes(q) || (b.description ?? '').toLowerCase().includes(q)) : all;
26
+ return q
27
+ ? all.filter((b) => b.name.toLowerCase().includes(q) ||
28
+ called(b.name).toLowerCase().includes(q) ||
29
+ (b.description ?? '').toLowerCase().includes(q))
30
+ : all;
28
31
  }, [bots, query]);
29
32
  const { grid, rows } = useMemo(() => split(shown, last), [shown, last]);
30
- return (_jsxs(YStack, { flex: 1, minH: 0, children: [_jsxs(XStack, { "data-parity-key": "bots.roster.bar", height: 58, shrink: 0, px: 16, items: "center", justify: "flex-end", gap: 11, children: [_jsx(XStack, { ...ROUND, "aria-label": t(seeking ? 'Close search' : 'Search bots'), "aria-pressed": seeking, onClick: () => {
33
+ return (_jsxs(YStack, { flex: 1, minH: 0, position: "relative", children: [_jsxs(XStack, { "data-parity-key": "bots.roster.bar", height: 58, shrink: 0, px: 16, items: "center", justify: "flex-end", gap: 10, children: [_jsx(XStack, { ...ROUND, "aria-label": t(seeking ? 'Close search' : 'Search bots'), "aria-pressed": seeking, onClick: () => {
31
34
  setSeeking(!seeking);
32
35
  setQuery('');
33
- }, children: seeking ? _jsx(X, { size: 16, color: INK, "aria-hidden": true }) : _jsx(Search, { size: 16, color: INK, "aria-hidden": true }) }), _jsx(XStack, { ...ROUND, "aria-label": t('New bot'), onClick: onMake, disabled: disabled, opacity: disabled ? 0.5 : 1, children: _jsx(Plus, { size: 18, color: INK, "aria-hidden": true }) })] }), seeking ? (_jsx(XStack, { px: 12, pb: 10, shrink: 0, children: _jsx(Input, { unstyled: true, autoFocus: true, value: query, onChange: (e) => setQuery(e.target.value), placeholder: t('Search'), "aria-label": t('Search bots'), width: "100%", height: 36, px: 14, rounded: 999, bg: RAISED, borderWidth: 1, borderColor: LINE, color: INK, fontSize: 15, placeholderTextColor: "$placeholderColor" }) })) : null, _jsxs(YStack, { flex: 1, minH: 0, overflowY: "auto", overflowX: "hidden", children: [unread ? (_jsx(Text, { render: "p", px: 18, py: 10, fontSize: 13, lineHeight: 18, color: DIM, children: unread })) : null, bots && bots.length === 0 && !unread && !disabled ? (_jsxs(YStack, { display: "none", "$max-md": { display: 'flex' }, items: "center", gap: 16, pt: 160, px: 24, children: [_jsx(Text, { render: "h1", m: 0, fontSize: 22, lineHeight: 28, fontWeight: "500", color: INK, children: t('Make your first bot') }), _jsx(XStack, { ...PILL, onClick: onMake, children: _jsx(Text, { ...WORD, children: t('New bot') }) })] })) : null, grid.length ? (_jsx(XStack, { "data-parity-key": "bots.grid", role: "group", "aria-label": t('Bots'), flexWrap: "wrap", px: 11, pt: 11, columnGap: 3, rowGap: 13, "$max-md": { px: 12, columnGap: 0, justify: 'space-between' }, children: grid.map((b) => {
34
- const here = b.name === open;
35
- return (_jsxs(YStack, { render: "button", type: 'button', "data-parity-key": "bots.tile", "data-name": b.name, "aria-current": here, "aria-label": b.name, onClick: () => onPick(b.name), width: 83, height: 91, rounded: 12, items: "center", pt: 6, gap: 6, bg: here ? PICKED : 'transparent', borderWidth: 0, cursor: "pointer", hoverStyle: { bg: here ? PICKED : 'var(--muted)' }, focusVisibleStyle: { outlineWidth: 2, outlineStyle: 'solid', outlineColor: '$outlineColor' }, "$max-md": { width: '33%' }, children: [_jsx(Face, { bot: b, size: 60 }), _jsx(Text, { ...CLIP, maxW: 77, fontSize: 13, lineHeight: 17, color: INK, children: b.name })] }, b.id || b.name));
36
- }) })) : null, rows.length ? (_jsx(YStack, { "data-parity-key": "bots.rows", role: "group", "aria-label": t('More bots'), pt: 17, pb: 8, children: rows.map((b) => {
37
- const here = b.name === open;
38
- const word = lastWord(last.get(b.name)) || b.description || '';
39
- return (_jsxs(XStack, { render: "button", type: 'button', "data-parity-key": "bots.row", "data-name": b.name, "aria-current": here, onClick: () => onPick(b.name), height: 58, mx: 6, px: 13, gap: 10, items: "center", rounded: 10, bg: here ? PICKED : 'transparent', borderWidth: 0, cursor: "pointer", hoverStyle: { bg: here ? PICKED : 'var(--muted)' }, focusVisibleStyle: { outlineWidth: 2, outlineStyle: 'solid', outlineColor: '$outlineColor' }, children: [_jsx(Face, { bot: b, size: 36 }), _jsxs(YStack, { flex: 1, minW: 0, items: "flex-start", children: [_jsx(Text, { ...CLIP, maxW: "100%", fontSize: 15, lineHeight: 20, color: INK, children: b.name }), word ? (_jsx(Text, { ...CLIP, maxW: "100%", fontSize: 13, lineHeight: 18, color: DIM, children: word })) : null] })] }, b.id || b.name));
40
- }) })) : null] }), _jsx(Foot, { me: me })] }));
36
+ }, children: seeking ? _jsx(X, { size: 16, color: INK, "aria-hidden": true }) : _jsx(Search, { size: 16, color: INK, "aria-hidden": true }) }), _jsx(XStack, { ...ROUND, "aria-label": t('New bot'), onClick: onMake, disabled: disabled, opacity: disabled ? 0.5 : 1, children: _jsx(Plus, { size: 18, color: INK, "aria-hidden": true }) })] }), seeking ? (_jsx(XStack, { px: 12, pb: 10, shrink: 0, children: _jsx(Input, { unstyled: true, autoFocus: true, value: query, onChange: (e) => setQuery(e.target.value), placeholder: t('Search'), "aria-label": t('Search bots'), width: "100%", height: 36, px: 14, rounded: 999, bg: RAISED, borderWidth: 1, borderColor: LINE, color: INK, fontSize: 14, placeholderTextColor: "$placeholderColor" }) })) : null, _jsxs(YStack, { flex: 1, minH: 0, position: "relative", children: [_jsxs(YStack, { flex: 1, minH: 0, overflowY: "auto", overflowX: "hidden", children: [unread ? (_jsx(Text, { render: "p", px: 18, py: 10, fontSize: 13, lineHeight: 18, color: DIM, children: unread })) : null, bots && bots.length === 0 && !unread && !disabled ? (_jsxs(YStack, { display: "none", "$max-md": { display: 'flex' }, items: "center", gap: 16, pt: 160, px: 24, children: [_jsx(Text, { render: "h1", m: 0, fontSize: 22, lineHeight: 28, fontWeight: "500", color: INK, children: t('Make your first bot') }), _jsx(XStack, { ...PILL, onClick: onMake, children: _jsx(Text, { ...WORD, children: t('New bot') }) })] })) : null, grid.length ? (_jsx(XStack, { "data-parity-key": "bots.grid", role: "group", "aria-label": t('Bots'), flexWrap: "wrap", px: 11, pt: 6, columnGap: 3, rowGap: 12, "$max-md": { px: 12, columnGap: 0, justify: 'space-between' }, children: grid.map((b) => {
37
+ const here = b.name === open;
38
+ const label = called(b.name);
39
+ return (_jsxs(YStack, { render: "button", type: 'button', "data-parity-key": "bots.tile", "data-name": b.name, "aria-current": here, "aria-label": label, onClick: () => onPick(b.name), width: 83, height: 92, rounded: 12, items: "center", pt: 6, gap: 6, bg: here ? PICKED : 'transparent', borderWidth: 0, cursor: "pointer", hoverStyle: { bg: here ? PICKED : 'var(--rail-hover, var(--muted))' }, focusVisibleStyle: { outlineWidth: 2, outlineStyle: 'solid', outlineColor: '$outlineColor' }, "$max-md": { width: '33%' }, children: [_jsx(Face, { bot: b, size: 60, starred: member(b.name)?.seat === 1 }), _jsx(Text, { ...CLIP, maxW: 77, fontSize: 13, lineHeight: 17, fontWeight: here ? '500' : '400', color: INK, children: label })] }, b.id || b.name));
40
+ }) })) : null, rows.length ? (_jsx(YStack, { "data-parity-key": "bots.rows", role: "group", "aria-label": t('More bots'), pt: 16, pb: 22, children: rows.map((b) => {
41
+ const here = b.name === open;
42
+ const label = called(b.name);
43
+ const word = lastWord(last.get(b.name)) || b.description || '';
44
+ return (_jsxs(XStack, { render: "button", type: 'button', "data-parity-key": "bots.row", "data-name": b.name, "aria-current": here, onClick: () => onPick(b.name), height: 56, mx: 6, px: 12, gap: 10, items: "center", rounded: 10, bg: here ? PICKED : 'transparent', borderWidth: 0, cursor: "pointer", hoverStyle: { bg: here ? PICKED : 'var(--rail-hover, var(--muted))' }, focusVisibleStyle: { outlineWidth: 2, outlineStyle: 'solid', outlineColor: '$outlineColor' }, children: [_jsx(Face, { bot: b, size: 36 }), _jsxs(YStack, { flex: 1, minW: 0, items: "flex-start", children: [_jsx(Text, { ...CLIP, maxW: "100%", fontSize: 14, lineHeight: 19, fontWeight: "500", color: INK, children: label }), word ? (_jsx(Text, { ...CLIP, maxW: "100%", fontSize: 13, lineHeight: 18, color: DIM, children: word })) : null] })] }, b.id || b.name));
45
+ }) })) : null] }), rows.length ? (_jsx(YStack, { "aria-hidden": true, pointerEvents: "none", position: "absolute", l: 0, r: 0, b: 0, height: 28, "$platform-web": { backgroundImage: `linear-gradient(to bottom, transparent, ${FLOOR})` } })) : null] }), _jsx(Foot, { me: me })] }));
41
46
  }
42
- /** You, at the foot: your account, and the other Hanzo apps a press away. */
47
+ /** You, at the foot: your account, Hanzo apps, and unified Hanzo Preferences. */
43
48
  function Foot({ me }) {
44
49
  const { t } = useI18n();
45
50
  const leave = useSignOut();
51
+ const [prefsOpen, setPrefsOpen] = useState(false);
46
52
  const name = me?.displayName || me?.name || '';
53
+ useEffect(() => {
54
+ if (!me)
55
+ return;
56
+ const onKey = (e) => {
57
+ if ((e.metaKey || e.ctrlKey) && e.key === ',') {
58
+ e.preventDefault();
59
+ setPrefsOpen(true);
60
+ }
61
+ };
62
+ window.addEventListener('keydown', onKey);
63
+ return () => window.removeEventListener('keydown', onKey);
64
+ }, [me]);
47
65
  if (!me)
48
66
  return null;
49
- return (_jsxs(XStack, { "data-parity-key": "bots.me", height: 68, shrink: 0, px: 15, items: "center", gap: 10, children: [_jsxs(DropdownMenu, { placement: "top-start", offset: 8, children: [_jsx(DropdownMenuTrigger, { asChild: true, children: _jsxs(XStack, { render: "button", type: 'button', "aria-label": t('Account: {name}', { name }), flex: 1, minW: 0, items: "center", gap: 10, bg: "transparent", borderWidth: 0, p: 0, cursor: "pointer", children: [_jsx(Face, { bot: { name, avatar: me.avatar }, size: 36 }), _jsx(Text, { ...CLIP, fontSize: 15, lineHeight: 20, color: INK, children: name })] }) }), _jsxs(DropdownMenuContent, { minW: 240, "aria-label": t('Account'), children: [_jsx(DropdownMenuLabel, { children: _jsxs(YStack, { minW: 0, gap: 2, children: [_jsx(Text, { fontSize: "$3", color: "$ink", numberOfLines: 1, children: name }), me.email ? (_jsx(Text, { fontSize: "$2", color: "$soft", numberOfLines: 1, children: me.email })) : null] }) }), _jsx(DropdownMenuSeparator, {}), _jsx(DropdownMenuItem, { onSelect: () => void leave(), children: _jsx(Text, { fontSize: "$3", color: "$ink", children: t('Log out') }) })] })] }), _jsxs(DropdownMenu, { placement: "top-end", offset: 8, children: [_jsx(DropdownMenuTrigger, { asChild: true, children: _jsx(XStack, { ...ROUND, "aria-label": t('Hanzo apps'), children: _jsx(LayoutGrid, { size: 16, color: INK, "aria-hidden": true }) }) }), _jsx(DropdownMenuContent, { minW: 240, maxH: 420, "aria-label": t('Hanzo apps'), children: BUSINESS_APPS.map((app) => (_jsx(DropdownMenuItem, { onSelect: () => window.location.assign(app.href), children: _jsxs(YStack, { minW: 0, children: [_jsx(Text, { fontSize: "$3", color: "$ink", numberOfLines: 1, children: app.productTitle }), _jsx(Text, { fontSize: "$1", color: "$soft", numberOfLines: 1, children: app.description })] }) }, app.id))) })] })] }));
67
+ return (_jsxs(_Fragment, { children: [_jsxs(XStack, { "data-parity-key": "bots.me", height: 64, shrink: 0, px: 14, items: "center", gap: 8, children: [_jsxs(DropdownMenu, { placement: "top-start", offset: 8, children: [_jsx(DropdownMenuTrigger, { asChild: true, children: _jsxs(XStack, { render: "button", type: 'button', "aria-label": t('Account: {name}', { name }), flex: 1, minW: 0, items: "center", gap: 10, bg: "transparent", borderWidth: 0, p: 0, cursor: "pointer", children: [_jsx(Face, { bot: { name, avatar: me.avatar }, size: 34, person: true }), _jsx(Text, { ...CLIP, fontSize: 14, lineHeight: 19, fontWeight: "500", color: INK, children: name })] }) }), _jsxs(DropdownMenuContent, { minW: 240, "aria-label": t('Account'), children: [_jsx(DropdownMenuLabel, { children: _jsxs(YStack, { minW: 0, gap: 2, children: [_jsx(Text, { fontSize: "$3", color: "$ink", numberOfLines: 1, children: name }), me.email ? (_jsx(Text, { fontSize: "$2", color: "$soft", numberOfLines: 1, children: me.email })) : null] }) }), _jsx(DropdownMenuSeparator, {}), _jsx(DropdownMenuItem, { onSelect: () => setPrefsOpen(true), children: _jsx(Text, { fontSize: "$3", color: "$ink", children: t('Preferences') }) }), _jsx(DropdownMenuItem, { onSelect: () => void leave(), children: _jsx(Text, { fontSize: "$3", color: "$ink", children: t('Log out') }) })] })] }), _jsxs(DropdownMenu, { placement: "top-end", offset: 8, children: [_jsx(DropdownMenuTrigger, { asChild: true, children: _jsx(XStack, { ...ROUND, "aria-label": t('Hanzo apps'), children: _jsx(Grid2x2Plus, { size: 16, color: INK, "aria-hidden": true }) }) }), _jsx(DropdownMenuContent, { minW: 240, maxH: 420, "aria-label": t('Hanzo apps'), children: BUSINESS_APPS.map((app) => (_jsx(DropdownMenuItem, { onSelect: () => window.location.assign(app.href), children: _jsxs(YStack, { minW: 0, children: [_jsx(Text, { fontSize: "$3", color: "$ink", numberOfLines: 1, children: app.productTitle }), _jsx(Text, { fontSize: "$1", color: "$soft", numberOfLines: 1, children: app.description })] }) }, app.id))) })] }), _jsx(XStack, { ...ROUND, "aria-label": t('Preferences'), onClick: () => setPrefsOpen(true), children: _jsx(SlidersHorizontal, { size: 15, color: INK, "aria-hidden": true }) })] }), _jsx(PreferencesDialog, { open: prefsOpen, onOpenChange: setPrefsOpen })] }));
50
68
  }
@@ -10,7 +10,6 @@ export declare function Thread({ bot, bots, runs, pending, notice, wrong, side,
10
10
  wrong: string | null;
11
11
  side: boolean;
12
12
  live: boolean;
13
- /** The roster has answered, so an empty one is an empty org and not a slow one. */
14
13
  loaded: boolean;
15
14
  onSend: (input: string) => Promise<boolean>;
16
15
  onDismiss: () => void;
@@ -1,11 +1,8 @@
1
1
  'use client';
2
2
  import { Fragment as _Fragment, jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
3
- // The thread with the open bot: its pill and Share in the bar, what was said
4
- // with a stamp wherever the conversation paused, and the composer.
5
- //
6
- // A message is a run the platform recorded: your words are its input, the bot's
7
- // its output (or the error its model returned). A run another bot asked for is
8
- // marked as that bot's message. Nothing here is drawn that the runs do not say.
3
+ // The thread with the open bot: floating frosted bot pill and circular Share
4
+ // button over the scrolling messages, structured attachment/image cards,
5
+ // timestamps wherever the conversation paused, and the pill composer.
9
6
  import { useEffect, useMemo, useRef, useState } from 'react';
10
7
  import { navigable } from '@hanzo/ui/product/limits';
11
8
  import { useI18n } from '@hanzo/i18n/react';
@@ -14,18 +11,27 @@ import { Text, XStack, YStack } from '@hanzo/gui';
14
11
  import { Caret } from '@hanzo/ui/chat';
15
12
  import { Composer, Control, Field } from '@hanzo/composer';
16
13
  import { speech, useDictation, useVoice, Voice } from '@hanzo/voice';
17
- import { ArrowLeft, ArrowUp, Gauge, Mic, Plus, X } from 'lucide-react';
14
+ import { ArrowLeft, ArrowUp, AudioLines, Check, Gauge, Mic, Plus, Share, X } from 'lucide-react';
18
15
  import { base } from '../lib/ai.js';
19
16
  import { Prose } from '../Prose.js';
17
+ import { called } from '../team.js';
20
18
  import { Face } from './face.js';
21
19
  import { CLIP, PILL, ROUND, WORD } from './kit.js';
22
- import { DIM, EDGE, INK, LINE, MINE, RAISED } from './ink.js';
20
+ import { DIM, EDGE, GROUND, INK, LINE, MINE, RAISED } from './ink.js';
23
21
  import { instant } from './time.js';
24
- import { lines } from './said.js';
22
+ import { lines, partsOf } from './said.js';
25
23
  import { compose, fits, MAX, texty } from './carry.js';
26
24
  import { PARAM } from './api.js';
27
25
  /** The widest a conversation reads, as the desktop app draws it. */
28
- const MEASURE = 960;
26
+ const MEASURE = 900;
27
+ function DocBadge({ ext }) {
28
+ const accent = ext === 'pdf'
29
+ ? 'var(--destructive)'
30
+ : ext === 'ppt' || ext === 'pptx'
31
+ ? 'var(--warning, var(--chrome-dot-yellow))'
32
+ : 'var(--info, var(--muted-foreground))';
33
+ return (_jsxs(YStack, { "aria-hidden": true, width: 40, height: 44, shrink: 0, rounded: 9, overflow: "hidden", bg: "var(--secondary)", borderWidth: 1, borderColor: LINE, children: [_jsxs(YStack, { flex: 1, px: 7, pt: 7, gap: 4, justify: "center", children: [_jsxs(XStack, { gap: 3, children: [_jsx(YStack, { width: 9, height: 9, rounded: 2, bg: "var(--muted-foreground)", opacity: 0.4 }), _jsxs(YStack, { flex: 1, gap: 3, justify: "center", children: [_jsx(YStack, { height: 3, rounded: 2, bg: "var(--muted-foreground)", opacity: 0.4 }), _jsx(YStack, { height: 3, width: "75%", rounded: 2, bg: "var(--muted-foreground)", opacity: 0.3 })] })] }), _jsx(YStack, { height: 3, rounded: 2, bg: "var(--muted-foreground)", opacity: 0.34 })] }), _jsx(YStack, { height: 12, bg: accent })] }));
34
+ }
29
35
  /** "It resets in 3 days." from the instant a refusal lifts, in the reader's calendar days. */
30
36
  function lifts(iso, now, t) {
31
37
  const at = instant(iso ?? undefined);
@@ -46,14 +52,11 @@ export function Thread({ bot, bots, runs, pending, notice, wrong, side, live, lo
46
52
  const [note, setNote] = useState(null);
47
53
  const foot = useRef(null);
48
54
  const pick = useRef(null);
49
- // Dictation through Hanzo's own ear, as Chat's composer does: each pause is
50
- // transcribed and lands after what the draft already held.
51
55
  const { token } = useIamToken();
52
56
  const ear = useMemo(() => speech({ ...base(), ...(token ? { token } : {}) }), [token]);
53
57
  const voice = useVoice({ speech: ear, ...useDictation(draft, setDraft) });
54
58
  const now = Date.now();
55
59
  const said = useMemo(() => (bot ? lines(runs ?? [], bots, bot.name, pending, now, locale, t) : []),
56
- // `now` moves every render; the stamps only need it when the thread does.
57
60
  // eslint-disable-next-line react-hooks/exhaustive-deps
58
61
  [bot, runs, bots, pending, locale, t]);
59
62
  useEffect(() => {
@@ -64,7 +67,7 @@ export function Thread({ bot, bots, runs, pending, notice, wrong, side, live, lo
64
67
  setFile(null);
65
68
  setNote(null);
66
69
  }, [bot?.name]);
67
- /** The address of this bot's conversation, whatever the address bar says now. */
70
+ const displayName = bot ? called(bot.name) : '';
68
71
  const share = async () => {
69
72
  if (!bot)
70
73
  return;
@@ -74,20 +77,18 @@ export function Thread({ bot, bots, runs, pending, notice, wrong, side, live, lo
74
77
  const nav = navigator;
75
78
  try {
76
79
  if (nav.share && window.matchMedia('(pointer: coarse)').matches)
77
- await nav.share({ url: link, title: bot.name });
80
+ await nav.share({ url: link, title: displayName });
78
81
  else
79
82
  await navigator.clipboard.writeText(link);
80
83
  setShared(t('Link copied'));
81
84
  }
82
85
  catch (e) {
83
- // A share the reader closed is not a failure; a copy the browser refused is.
84
86
  if (e?.name === 'AbortError')
85
87
  return;
86
88
  setShared(t('Copy failed'));
87
89
  }
88
90
  window.setTimeout(() => setShared(null), 2000);
89
91
  };
90
- // A text file goes with the message, held beside the draft until it is sent.
91
92
  const carry = async (picked) => {
92
93
  setNote(null);
93
94
  try {
@@ -111,35 +112,49 @@ export function Thread({ bot, bots, runs, pending, notice, wrong, side, live, lo
111
112
  setDraft('');
112
113
  setFile(null);
113
114
  setNote(null);
114
- void onSend(input).then((said) => {
115
- // Not recorded: the words and the file come back, unless something new is there.
116
- if (said)
115
+ void onSend(input).then((ok) => {
116
+ if (ok)
117
117
  return;
118
118
  setDraft((d) => d || words);
119
119
  setFile((f) => f ?? held);
120
120
  });
121
121
  };
122
- return (_jsxs(YStack, { flex: 1, minH: 0, position: "relative", children: [_jsxs(XStack, { "data-parity-key": "bots.bar", height: 58, shrink: 0, px: 13, items: "center", gap: 8, children: [_jsx(XStack, { flex: 1, minW: 0, items: "center", children: _jsx(XStack, { ...ROUND, "aria-label": t('All bots'), onClick: onBack, display: "none", "$max-md": { display: 'flex' }, children: _jsx(ArrowLeft, { size: 16, color: INK, "aria-hidden": true, "data-i18n-mirror": true }) }) }), bot ? (_jsxs(XStack, { ...PILL, "data-parity-key": "bots.pill", "aria-label": t('{name}’s details', { name: bot.name }), "aria-expanded": side, onClick: onSide, height: 40, pl: 7, maxW: "60%", children: [_jsx(Face, { bot: bot, size: 24 }), _jsx(Text, { ...WORD, ...CLIP, children: bot.name })] })) : null, _jsx(XStack, { flex: 1, minW: 0, items: "center", justify: "flex-end", children: bot ? (_jsx(XStack, { ...PILL, "data-parity-key": "bots.share", px: 15, onClick: share, children: _jsx(Text, { ...WORD, children: shared ?? t('Share') }) })) : null })] }), !bot ? (_jsx(YStack, { flex: 1, items: "center", justify: "center", gap: 16, px: 24, children: live && loaded && bots.length === 0 ? (_jsxs(_Fragment, { children: [_jsx(Text, { render: "h1", m: 0, fontSize: 22, lineHeight: 28, fontWeight: "500", color: INK, children: t('Make your first bot') }), _jsx(XStack, { ...PILL, onClick: onMake, children: _jsx(Text, { ...WORD, children: t('New bot') }) })] })) : null })) : (_jsx(YStack, { "data-parity-key": "bots.thread", flex: 1, minH: 0, overflowY: "auto", overflowX: "hidden", children: _jsxs(YStack, { width: "100%", maxW: MEASURE + 48, mx: "auto", px: 24, pt: 12, pb: 16, "$max-md": { px: 12 }, children: [said.map((line, i) => {
122
+ const hasDraft = Boolean(draft.trim() || file);
123
+ return (_jsxs(YStack, { flex: 1, minH: 0, position: "relative", children: [_jsxs(XStack, { "data-parity-key": "bots.bar", position: "absolute", t: 0, l: 0, r: 0, z: 4, height: 58, px: 14, items: "center", gap: 8, pointerEvents: "none", "$platform-web": {
124
+ backgroundImage: `linear-gradient(to bottom, ${GROUND} 18%, color-mix(in srgb, ${GROUND} 68%, transparent) 64%, transparent)`,
125
+ }, children: [_jsx(XStack, { flex: 1, minW: 0, items: "center", children: _jsx(XStack, { ...ROUND, pointerEvents: "auto", "aria-label": t('All bots'), onClick: onBack, display: "none", "$max-md": { display: 'flex' }, children: _jsx(ArrowLeft, { size: 16, color: INK, "aria-hidden": true, "data-i18n-mirror": true }) }) }), bot ? (_jsxs(XStack, { ...PILL, pointerEvents: "auto", "data-parity-key": "bots.pill", "aria-label": t('{name}’s details', { name: displayName }), "aria-expanded": side, onClick: onSide, height: 36, pl: 6, pr: 13, maxW: "60%", bg: RAISED, "$platform-web": { backdropFilter: 'blur(16px)', WebkitBackdropFilter: 'blur(16px)' }, children: [_jsx(Face, { bot: bot, size: 24 }), _jsx(Text, { ...WORD, ...CLIP, children: displayName })] })) : null, _jsx(XStack, { flex: 1, minW: 0, items: "center", justify: "flex-end", children: bot ? (_jsx(XStack, { ...ROUND, pointerEvents: "auto", "data-parity-key": "bots.share", "aria-label": shared ?? t('Share'), onClick: share, "$platform-web": { backdropFilter: 'blur(16px)', WebkitBackdropFilter: 'blur(16px)' }, children: shared ? _jsx(Check, { size: 15, color: INK, "aria-hidden": true }) : _jsx(Share, { size: 15, color: INK, "aria-hidden": true }) })) : null })] }), !bot ? (_jsx(YStack, { flex: 1, items: "center", justify: "center", gap: 16, px: 24, children: live && loaded && bots.length === 0 ? (_jsxs(_Fragment, { children: [_jsx(Text, { render: "h1", m: 0, fontSize: 22, lineHeight: 28, fontWeight: "500", color: INK, children: t('Make your first bot') }), _jsx(XStack, { ...PILL, onClick: onMake, children: _jsx(Text, { ...WORD, children: t('New bot') }) })] })) : null })) : (_jsx(YStack, { "data-parity-key": "bots.thread", flex: 1, minH: 0, overflowY: "auto", overflowX: "hidden", children: _jsxs(YStack, { width: "100%", maxW: MEASURE + 48, mx: "auto", px: 24, pt: 64, pb: 18, "$max-md": { px: 12 }, children: [said.map((line, i) => {
123
126
  const prev = said[i - 1];
124
- const gap = !prev ? 0 : line.kind === prev.kind && (line.kind === 'mine' || line.kind === 'theirs') ? 3 : 16;
127
+ const gap = !prev ? 0 : line.kind === prev.kind && (line.kind === 'mine' || line.kind === 'theirs') ? 6 : 16;
125
128
  if (line.kind === 'stamp')
126
- return (_jsx(Text, { self: "center", mt: i ? 22 : 8, mb: 2, fontSize: 13, lineHeight: 18, color: DIM, children: line.text }, line.key));
129
+ return (_jsx(Text, { self: "center", mt: i ? 22 : 6, mb: 4, fontSize: 12, lineHeight: 17, color: DIM, children: line.text }, line.key));
127
130
  if (line.kind === 'from')
128
- return (_jsxs(XStack, { self: "center", mt: gap, items: "center", gap: 6, children: [_jsx(Text, { fontSize: 13, lineHeight: 18, color: DIM, children: t('Message from') }), _jsx(Face, { bot: line.bot, size: 16 }), _jsx(Text, { fontSize: 13, lineHeight: 18, color: DIM, children: line.bot.name })] }, line.key));
131
+ return (_jsxs(XStack, { self: "center", mt: gap, items: "center", gap: 6, children: [_jsx(Text, { fontSize: 12, lineHeight: 17, color: DIM, children: t('Message from') }), _jsx(Face, { bot: line.bot, size: 16 }), _jsx(Text, { fontSize: 12, lineHeight: 17, color: DIM, children: called(line.bot.name) })] }, line.key));
129
132
  if (line.kind === 'mine')
130
- return (_jsx(YStack, { self: "flex-end", items: "flex-end", maxW: "78%", mt: gap, children: _jsx(Text, { "data-parity-key": "bots.mine", render: "div", px: 12, py: 7, rounded: 18, fontSize: 15, lineHeight: 22, color: INK, whiteSpace: "pre-wrap", "$platform-web": { overflowWrap: 'anywhere', backgroundColor: MINE }, children: line.text }) }, line.key));
133
+ return (_jsx(YStack, { self: "flex-end", items: "flex-end", maxW: "78%", mt: gap, children: _jsx(Text, { "data-parity-key": "bots.mine", render: "div", px: 14, py: 8, rounded: 18, fontSize: 15, lineHeight: 22, color: INK, whiteSpace: "pre-wrap", "$platform-web": { overflowWrap: 'anywhere', backgroundColor: MINE }, children: line.text }) }, line.key));
131
134
  if (line.kind === 'thinking')
132
- return (_jsx(XStack, { "data-parity-key": "bots.thinking", role: "status", "aria-label": t('{name} is working', { name: bot.name }), self: "flex-start", mt: gap, px: 14, height: 38, items: "center", rounded: 16, bg: RAISED, borderWidth: 1, borderColor: LINE, children: _jsx(Caret, {}) }, line.key));
133
- return (_jsx(YStack, { "data-parity-key": line.kind === 'other' ? 'bots.other' : 'bots.theirs', self: "flex-start", maxW: 560, mt: gap, px: 12, py: 10, rounded: 16, bg: RAISED, borderWidth: 1, borderColor: LINE, "$max-md": { maxW: '88%' }, children: line.kind === 'theirs' && line.failed ? (_jsx(Text, { fontSize: 15, lineHeight: 22, color: DIM, children: line.text })) : (_jsx(Prose, { text: line.text })) }, line.key));
134
- }), wrong ? (_jsx(Text, { render: "p", self: "center", mt: 12, fontSize: 13, lineHeight: 18, color: DIM, children: wrong })) : null, _jsx("div", { ref: foot })] }) })), bot ? (_jsxs(YStack, { width: "100%", maxW: MEASURE + 48, mx: "auto", px: 24, pb: 15, gap: 8, shrink: 0, "$max-md": { px: 8, pb: 8 }, children: [notice ? (_jsxs(YStack, { "data-parity-key": "bots.notice", role: "alert", bg: RAISED, borderWidth: 1, borderColor: LINE, rounded: 16, pt: 12, pb: 10, px: 14, gap: 10, children: [_jsxs(XStack, { items: "flex-start", gap: 10, children: [_jsx(YStack, { pt: 3, children: _jsx(Gauge, { size: 16, color: DIM, "aria-hidden": true }) }), _jsxs(YStack, { flex: 1, minW: 0, children: [_jsx(Text, { fontSize: 15, lineHeight: 22, color: INK, children: notice.message }), lifts(notice.resets, now, t) ? (_jsx(Text, { fontSize: 15, lineHeight: 22, color: DIM, children: lifts(notice.resets, now, t) })) : null] }), _jsx(XStack, { ...ROUND, width: 28, height: 28, bg: "transparent", borderWidth: 0, "aria-label": t('Dismiss'), onClick: onDismiss, children: _jsx(X, { size: 14, color: DIM, "aria-hidden": true }) })] }), notice.actions.some(navigable) ? (_jsx(XStack, { justify: "flex-end", gap: 8, flexWrap: "wrap", children: notice.actions.filter(navigable).map((a, i, all) => (_jsx(XStack, { ...PILL, render: "a", href: a.url, height: 34, bg: i === all.length - 1 ? INK : RAISED, borderColor: i === all.length - 1 ? INK : LINE, "$platform-web": { textDecoration: 'none' }, children: _jsx(Text, { ...WORD, color: i === all.length - 1 ? 'var(--background)' : INK, children: a.label }) }, `${a.kind}-${a.label}`))) })) : null] })) : null, file ? (_jsxs(XStack, { self: "flex-start", items: "center", gap: 6, height: 30, pl: 12, pr: 4, rounded: 999, bg: RAISED, borderWidth: 1, borderColor: LINE, children: [_jsx(Text, { ...CLIP, maxW: 260, fontSize: 13, lineHeight: 18, color: INK, children: file.name }), _jsx(XStack, { ...ROUND, width: 24, height: 24, bg: "transparent", borderWidth: 0, "aria-label": t('Remove {name}', { name: file.name }), onClick: () => setFile(null), children: _jsx(X, { size: 12, color: DIM, "aria-hidden": true }) })] })) : null, note ? (_jsx(Text, { role: "alert", fontSize: 13, lineHeight: 18, color: DIM, px: 8, children: note })) : null, _jsx(Composer, { render: "form", onSubmit: (e) => {
135
+ return (_jsx(XStack, { "data-parity-key": "bots.thinking", role: "status", "aria-label": t('{name} is working', { name: displayName }), self: "flex-start", mt: gap, px: 14, height: 38, items: "center", rounded: 16, bg: RAISED, borderWidth: 1, borderColor: LINE, children: _jsx(Caret, {}) }, line.key));
136
+ if (line.kind === 'theirs' && line.failed)
137
+ return (_jsx(YStack, { "data-parity-key": "bots.theirs", self: "flex-start", maxW: 520, mt: gap, px: 15, py: 11, rounded: 18, bg: RAISED, borderWidth: 1, borderColor: LINE, "$max-md": { maxW: '88%' }, children: _jsx(Text, { fontSize: 15, lineHeight: 22, color: DIM, children: line.text }) }, line.key));
138
+ const parts = partsOf(line.text);
139
+ return (_jsx(YStack, { "data-parity-key": line.kind === 'other' ? 'bots.other' : 'bots.theirs', self: "flex-start", items: "flex-start", gap: 10, maxW: "100%", mt: gap, children: parts.map((part, idx) => {
140
+ if (part.kind === 'doc') {
141
+ const inner = (_jsxs(XStack, { px: 12, py: 10, gap: 12, items: "center", rounded: 16, bg: RAISED, borderWidth: 1, borderColor: LINE, maxW: 290, children: [_jsx(DocBadge, { ext: part.ext }), _jsxs(YStack, { flex: 1, minW: 0, children: [_jsx(Text, { ...CLIP, fontSize: 14, lineHeight: 19, fontWeight: "500", color: INK, children: part.name }), part.size ? (_jsx(Text, { fontSize: 12, lineHeight: 17, color: DIM, children: part.size })) : null] })] }));
142
+ return part.href ? (_jsx(YStack, { render: "a", href: part.href, target: '_blank', rel: 'noopener noreferrer', "$platform-web": { textDecoration: 'none' }, children: inner }, idx)) : (_jsx(YStack, { children: inner }, idx));
143
+ }
144
+ if (part.kind === 'image') {
145
+ return (_jsx(YStack, { width: 172, rounded: 14, overflow: "hidden", bg: RAISED, borderWidth: 1, borderColor: LINE, children: _jsx(YStack, { render: "img", src: part.src, alt: part.alt, width: "100%", height: "auto", display: "block" }) }, idx));
146
+ }
147
+ return (_jsx(YStack, { maxW: 520, px: 15, py: 11, rounded: 18, bg: RAISED, borderWidth: 1, borderColor: LINE, "$max-md": { maxW: '88%' }, children: _jsx(Prose, { text: part.text }) }, idx));
148
+ }) }, line.key));
149
+ }), wrong ? (_jsx(Text, { render: "p", self: "center", mt: 12, fontSize: 13, lineHeight: 18, color: DIM, children: wrong })) : null, _jsx("div", { ref: foot })] }) })), bot ? (_jsxs(YStack, { width: "100%", maxW: MEASURE + 48, mx: "auto", px: 20, pb: 14, gap: 8, shrink: 0, "$max-md": { px: 8, pb: 8 }, children: [notice ? (_jsxs(YStack, { "data-parity-key": "bots.notice", role: "alert", bg: RAISED, borderWidth: 1, borderColor: LINE, rounded: 16, pt: 12, pb: 10, px: 14, gap: 10, children: [_jsxs(XStack, { items: "flex-start", gap: 10, children: [_jsx(YStack, { pt: 3, children: _jsx(Gauge, { size: 16, color: DIM, "aria-hidden": true }) }), _jsxs(YStack, { flex: 1, minW: 0, children: [_jsx(Text, { fontSize: 15, lineHeight: 22, color: INK, children: notice.message }), lifts(notice.resets, now, t) ? (_jsx(Text, { fontSize: 15, lineHeight: 22, color: DIM, children: lifts(notice.resets, now, t) })) : null] }), _jsx(XStack, { ...ROUND, width: 28, height: 28, bg: "transparent", borderWidth: 0, "aria-label": t('Dismiss'), onClick: onDismiss, children: _jsx(X, { size: 14, color: DIM, "aria-hidden": true }) })] }), notice.actions.some(navigable) ? (_jsx(XStack, { justify: "flex-end", gap: 8, flexWrap: "wrap", children: notice.actions.filter(navigable).map((a, i, all) => (_jsx(XStack, { ...PILL, render: "a", href: a.url, height: 34, bg: i === all.length - 1 ? INK : RAISED, borderColor: i === all.length - 1 ? INK : LINE, "$platform-web": { textDecoration: 'none' }, children: _jsx(Text, { ...WORD, color: i === all.length - 1 ? 'var(--background)' : INK, children: a.label }) }, `${a.kind}-${a.label}`))) })) : null] })) : null, file ? (_jsxs(XStack, { self: "flex-start", items: "center", gap: 6, height: 30, pl: 12, pr: 4, rounded: 999, bg: RAISED, borderWidth: 1, borderColor: LINE, children: [_jsx(Text, { ...CLIP, maxW: 260, fontSize: 13, lineHeight: 18, color: INK, children: file.name }), _jsx(XStack, { ...ROUND, width: 24, height: 24, bg: "transparent", borderWidth: 0, "aria-label": t('Remove {name}', { name: file.name }), onClick: () => setFile(null), children: _jsx(X, { size: 12, color: DIM, "aria-hidden": true }) })] })) : null, note ? (_jsx(Text, { role: "alert", fontSize: 13, lineHeight: 18, color: DIM, px: 8, children: note })) : null, _jsx(Composer, { render: "form", onSubmit: (e) => {
135
150
  e.preventDefault();
136
151
  submit();
137
- }, control: 32, width: "100%", children: _jsxs(XStack, { "data-parity-key": "bots.composer", height: 44, pl: 6, pr: 6, gap: 6, items: "center", rounded: 999, bg: RAISED, borderWidth: 1, borderColor: EDGE, focusWithinStyle: { borderColor: 'var(--ring)' }, children: [_jsx(Control, { type: "button", "aria-label": t('Add a text file'), onClick: () => pick.current?.click(), disabled: !live, children: _jsx(Plus, { size: 16 }) }), _jsx(Field, { value: draft, onChangeText: setDraft, onKeyDown: (e) => {
152
+ }, control: 32, width: "100%", children: _jsxs(XStack, { "data-parity-key": "bots.composer", height: 46, pl: 7, pr: 7, gap: 6, items: "center", rounded: 999, bg: RAISED, borderWidth: 1, borderColor: EDGE, focusWithinStyle: { borderColor: 'var(--ring)' }, children: [_jsx(Control, { type: "button", "aria-label": t('Add a text file'), onClick: () => pick.current?.click(), disabled: !live, children: _jsx(Plus, { size: 16 }) }), _jsx(Field, { value: draft, onChangeText: setDraft, onKeyDown: (e) => {
138
153
  if (e.key === 'Enter' && !e.shiftKey && !e.nativeEvent?.isComposing) {
139
154
  e.preventDefault();
140
155
  submit();
141
156
  }
142
- }, placeholder: t('Message {name}', { name: bot.name }), "aria-label": t('Message {name}', { name: bot.name }), disabled: !live, fontSize: 15, px: 4 }), _jsx(Control, { asChild: true, children: _jsx(Voice, { voice: voice, disabled: !live, children: (state) => _jsx(Mic, { size: 15, fill: state === 'idle' ? 'none' : 'currentColor' }) }) }), _jsx(Control, { type: "submit", "aria-label": t('Send'), fill: true, disabled: !(draft.trim() || file) || !live || Boolean(pending), children: _jsx(ArrowUp, { size: 15, strokeWidth: 2.5 }) })] }) }), _jsx("input", { ref: pick, type: "file", hidden: true, accept: "text/*,.md,.txt,.csv,.json,.yaml,.yml,.tsv,.log", onChange: (e) => {
157
+ }, placeholder: t('Message {name}', { name: displayName }), "aria-label": t('Message {name}', { name: displayName }), disabled: !live, fontSize: 15, px: 4 }), _jsx(Control, { asChild: true, children: _jsx(Voice, { voice: voice, disabled: !live, children: (state) => _jsx(Mic, { size: 15, fill: state === 'idle' ? 'none' : 'currentColor' }) }) }), hasDraft ? (_jsx(Control, { type: "submit", "aria-label": t('Send'), fill: true, disabled: !live || Boolean(pending), children: _jsx(ArrowUp, { size: 15, strokeWidth: 2.5 }) })) : (_jsx(Voice, { voice: voice, disabled: !live, children: () => (_jsx(XStack, { width: 32, height: 32, rounded: 999, items: "center", justify: "center", bg: INK, opacity: live ? 1 : 0.45, children: _jsx(AudioLines, { size: 15, color: "var(--background)", strokeWidth: 2.2, "aria-hidden": true }) })) }))] }) }), _jsx("input", { ref: pick, type: "file", hidden: true, accept: "text/*,.md,.txt,.csv,.json,.yaml,.yml,.tsv,.log", onChange: (e) => {
143
158
  const picked = e.target.files?.[0];
144
159
  e.target.value = '';
145
160
  if (picked)
@@ -1,5 +1,7 @@
1
1
  import type { Agent } from '@hanzo/ai';
2
- export declare function Face({ bot, size }: {
2
+ export declare function Face({ bot, size, person, starred, }: {
3
3
  bot: Pick<Agent, 'name' | 'avatar' | 'emoji'>;
4
4
  size?: number;
5
+ person?: boolean;
6
+ starred?: boolean;
5
7
  }): import("react").JSX.Element;
package/dist/bots/face.js CHANGED
@@ -1,13 +1,17 @@
1
1
  'use client';
2
- import { jsx as _jsx } from "react/jsx-runtime";
2
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
3
3
  import { Text, YStack } from '@hanzo/gui';
4
- import { INK } from './ink.js';
5
- export function Face({ bot, size = 36 }) {
4
+ import { Star } from 'lucide-react';
5
+ import { roleOf } from '../cast.js';
6
+ import { called } from '../team.js';
7
+ import { FLOOR, INK } from './ink.js';
8
+ export function Face({ bot, size = 36, person = false, starred = false, }) {
6
9
  const round = { width: size, height: size, shrink: 0, rounded: 9999, overflow: 'hidden' };
7
- if (bot.avatar)
8
- return _jsx(YStack, { render: "img", src: bot.avatar, alt: '', "aria-hidden": true, ...round, objectFit: "cover" });
9
- // The glyph scales with the disc, so its size is a number of pixels rather
10
- // than a rung; the leading is the size itself, which centres it.
10
+ const src = bot.avatar || (!person ? roleOf(bot.name)?.portrait : undefined);
11
+ const label = person ? (bot.name || '') : called(bot.name || '');
11
12
  const glyph = Math.round(size * (bot.emoji ? 0.5 : 0.42));
12
- return (_jsx(YStack, { "aria-hidden": true, ...round, items: "center", justify: "center", bg: "var(--secondary)", userSelect: 'none', children: _jsx(Text, { color: INK, fontSize: glyph, lineHeight: glyph, fontWeight: "500", children: bot.emoji || (bot.name || '?').trim().charAt(0).toUpperCase() }) }));
13
+ const disc = src ? (_jsx(YStack, { render: "img", src, alt: '', "aria-hidden": true, ...round, objectFit: "cover" })) : (_jsx(YStack, { "aria-hidden": true, ...round, items: "center", justify: "center", bg: person ? 'var(--info, var(--secondary))' : 'var(--secondary)', userSelect: 'none', children: _jsx(Text, { color: person ? 'var(--pure-white, var(--foreground))' : INK, fontSize: glyph, lineHeight: glyph, fontWeight: "600", children: bot.emoji || (label || '?').trim().charAt(0).toUpperCase() }) }));
14
+ if (!starred)
15
+ return disc;
16
+ return (_jsxs(YStack, { position: "relative", width: size, height: size, shrink: 0, children: [disc, _jsx(YStack, { "aria-hidden": true, position: "absolute", r: -1, b: -1, width: 20, height: 20, rounded: 9999, items: "center", justify: "center", bg: "var(--warning, var(--chrome-dot-yellow))", borderWidth: 2, borderColor: FLOOR, children: _jsx(Star, { size: 10, color: "var(--pure-white, var(--foreground))", fill: "currentColor", strokeWidth: 2 }) })] }));
13
17
  }
@@ -3,7 +3,7 @@ import type { Agent, AgentRun } from '@hanzo/ai';
3
3
  export declare const GRID = 12;
4
4
  /** What a row says under a bot's name: its newest run's last word. */
5
5
  export declare function lastWord(run: AgentRun | undefined): string;
6
- /** The bots in the grid and the bots in rows. */
6
+ /** The bots in the grid (lead seat order first, then creation order) and the rest in rows. */
7
7
  export declare function split(bots: readonly Agent[], last: ReadonlyMap<string, AgentRun>): {
8
8
  grid: Agent[];
9
9
  rows: Agent[];
package/dist/bots/grid.js CHANGED
@@ -1,17 +1,32 @@
1
1
  // Which bots are faces in the grid and which are rows, and what a row says.
2
2
  // Pure, so the roster's order is tested as data.
3
+ import { member } from '../team.js';
3
4
  import { instant } from './time.js';
4
5
  /** How many bots the grid holds before the rest become rows. */
5
6
  export const GRID = 12;
7
+ const LEAD_ORDER = new Map(['vi', 'opera', 'mana', 'dev', 'des', 'fin', 'huma', 'mark', 'sal', 'sci', 'su', 'cyber'].map((id, i) => [id, i]));
8
+ function rankOf(name) {
9
+ const lead = LEAD_ORDER.get(name.toLowerCase());
10
+ if (lead !== undefined)
11
+ return lead;
12
+ const seat = member(name)?.seat;
13
+ return seat !== undefined ? 100 + seat : Number.MAX_SAFE_INTEGER;
14
+ }
6
15
  /** What a row says under a bot's name: its newest run's last word. */
7
16
  export function lastWord(run) {
8
17
  if (!run)
9
18
  return '';
10
19
  return (run.output || run.error || run.input || '').replace(/\s+/g, ' ').trim();
11
20
  }
12
- /** The bots in the grid and the bots in rows. */
21
+ /** The bots in the grid (lead seat order first, then creation order) and the rest in rows. */
13
22
  export function split(bots, last) {
14
- const made = [...bots].sort((a, b) => (instant(a.createdAt) ?? 0) - (instant(b.createdAt) ?? 0));
23
+ const made = [...bots].sort((a, b) => {
24
+ const sa = rankOf(a.name);
25
+ const sb = rankOf(b.name);
26
+ if (sa !== sb)
27
+ return sa - sb;
28
+ return (instant(a.createdAt) ?? 0) - (instant(b.createdAt) ?? 0);
29
+ });
15
30
  const grid = made.slice(0, GRID);
16
31
  const rows = made
17
32
  .slice(GRID)
@@ -1,16 +1,16 @@
1
- /** The roster's ground: the window itself. */
2
- export declare const FLOOR = "var(--background)";
3
- /** The thread's and the panel's ground. */
4
- export declare const GROUND = "var(--card)";
1
+ /** The roster's ground: matches hanzo.app and hanzo.team sidebar surface. */
2
+ export declare const FLOOR = "var(--side-fill, var(--background))";
3
+ /** The thread's and the panel's ground: matches hanzo.app and hanzo.team main canvas. */
4
+ export declare const GROUND = "var(--pane-fill, var(--card))";
5
5
  /** What stands on the ground: the pills, the cards, the composer, a bot's message. */
6
6
  export declare const RAISED = "var(--surface-card-emphasis)";
7
7
  /** The bot that is open, in the roster. */
8
8
  export declare const PICKED = "var(--secondary)";
9
9
  /** Your own message: lighter than a bot's, in either theme. */
10
- export declare const MINE = "color-mix(in oklab, var(--foreground) 22%, var(--card))";
10
+ export declare const MINE = "color-mix(in oklab, var(--foreground) 17%, var(--pane-fill, var(--card)))";
11
11
  export declare const INK = "var(--foreground)";
12
12
  export declare const DIM = "var(--muted-foreground)";
13
13
  export declare const FAINT = "$faint";
14
- export declare const LINE = "var(--border)";
14
+ export declare const LINE = "var(--pane-edge, var(--border))";
15
15
  /** The composer's edge, the one control drawn a step louder. */
16
16
  export declare const EDGE = "var(--border-strong)";
package/dist/bots/ink.js CHANGED
@@ -1,28 +1,20 @@
1
1
  // The ramp the Bots app is drawn in.
2
2
  //
3
- // Greyscale, because nothing on this screen is a category: a bot is not red and
4
- // a run is not green. Status is said in words.
5
- //
6
- // ROLES, NOT VALUES. Each name is a @hanzo/design token, which tunes both
7
- // grounds; a literal here would read right in one theme by coincidence.
8
- //
9
- // Two grounds, as the window is drawn: the roster stands on the floor and the
10
- // thread and the panel on the ground one step above it.
11
- /** The roster's ground: the window itself. */
12
- export const FLOOR = 'var(--background)';
13
- /** The thread's and the panel's ground. */
14
- export const GROUND = 'var(--card)';
3
+ // Greyscale, aligned to the shared Hanzo deep-black product family (--side-fill
4
+ // on the roster column, --pane-fill on the thread and inspector surfaces).
5
+ /** The roster's ground: matches hanzo.app and hanzo.team sidebar surface. */
6
+ export const FLOOR = 'var(--side-fill, var(--background))';
7
+ /** The thread's and the panel's ground: matches hanzo.app and hanzo.team main canvas. */
8
+ export const GROUND = 'var(--pane-fill, var(--card))';
15
9
  /** What stands on the ground: the pills, the cards, the composer, a bot's message. */
16
10
  export const RAISED = 'var(--surface-card-emphasis)';
17
11
  /** The bot that is open, in the roster. */
18
12
  export const PICKED = 'var(--secondary)';
19
13
  /** Your own message: lighter than a bot's, in either theme. */
20
- export const MINE = 'color-mix(in oklab, var(--foreground) 22%, var(--card))';
14
+ export const MINE = 'color-mix(in oklab, var(--foreground) 17%, var(--pane-fill, var(--card)))';
21
15
  export const INK = 'var(--foreground)';
22
16
  export const DIM = 'var(--muted-foreground)';
23
- // The dimmest ink is gui's `$faint` rung: design's --text-tertiary is 4.32:1 on
24
- // the light ground, under text's 4.5.
25
17
  export const FAINT = '$faint';
26
- export const LINE = 'var(--border)';
18
+ export const LINE = 'var(--pane-edge, var(--border))';
27
19
  /** The composer's edge, the one control drawn a step louder. */
28
20
  export const EDGE = 'var(--border-strong)';
@@ -1,4 +1,4 @@
1
- /** A round icon control, 34px: the roster's search and new, the panel's close. */
1
+ /** A round icon control, 34px: the roster's search and new, Share, Preferences, Close. */
2
2
  export declare const ROUND: {
3
3
  readonly render: 'button';
4
4
  readonly type: 'button';
@@ -8,13 +8,13 @@ export declare const ROUND: {
8
8
  readonly rounded: 999;
9
9
  readonly bg: "var(--surface-card-emphasis)";
10
10
  readonly borderWidth: 1;
11
- readonly borderColor: "var(--border)";
11
+ readonly borderColor: "var(--pane-edge, var(--border))";
12
12
  readonly items: 'center';
13
13
  readonly justify: 'center';
14
14
  readonly cursor: 'pointer';
15
15
  readonly p: 0;
16
16
  readonly hoverStyle: {
17
- readonly bg: 'var(--secondary)';
17
+ readonly bg: "var(--secondary)";
18
18
  };
19
19
  readonly focusVisibleStyle: {
20
20
  readonly outlineWidth: 2;
@@ -22,23 +22,23 @@ export declare const ROUND: {
22
22
  readonly outlineColor: '$outlineColor';
23
23
  };
24
24
  };
25
- /** A pill: the open bot in the bar, Share, a notice's ways past. */
25
+ /** A pill: the open bot in the bar, a notice's ways past. */
26
26
  export declare const PILL: {
27
27
  readonly render: 'button';
28
28
  readonly type: 'button';
29
29
  readonly display: 'flex';
30
30
  readonly items: 'center';
31
31
  readonly gap: 8;
32
- readonly height: 38;
33
- readonly px: 14;
32
+ readonly height: 36;
33
+ readonly px: 13;
34
34
  readonly rounded: 999;
35
35
  readonly bg: "var(--surface-card-emphasis)";
36
36
  readonly borderWidth: 1;
37
- readonly borderColor: "var(--border)";
37
+ readonly borderColor: "var(--pane-edge, var(--border))";
38
38
  readonly cursor: 'pointer';
39
39
  readonly shrink: 0;
40
40
  readonly hoverStyle: {
41
- readonly bg: 'var(--secondary)';
41
+ readonly bg: "var(--secondary)";
42
42
  };
43
43
  readonly focusVisibleStyle: {
44
44
  readonly outlineWidth: 2;
@@ -48,8 +48,9 @@ export declare const PILL: {
48
48
  };
49
49
  /** A pill's words. */
50
50
  export declare const WORD: {
51
- readonly fontSize: 15;
52
- readonly lineHeight: 20;
51
+ readonly fontSize: 14;
52
+ readonly lineHeight: 19;
53
+ readonly fontWeight: '500';
53
54
  readonly color: "var(--foreground)";
54
55
  readonly numberOfLines: 1;
55
56
  };
@@ -66,8 +67,8 @@ export declare const LABEL: {
66
67
  export declare const CARD: {
67
68
  readonly bg: "var(--surface-card-emphasis)";
68
69
  readonly borderWidth: 1;
69
- readonly borderColor: "var(--border)";
70
- readonly rounded: 12;
70
+ readonly borderColor: "var(--pane-edge, var(--border))";
71
+ readonly rounded: 14;
71
72
  };
72
73
  /** One line, cut with an ellipsis where it runs out of space. */
73
74
  export declare const CLIP: {
package/dist/bots/kit.js CHANGED
@@ -1,25 +1,47 @@
1
1
  // The controls the Bots app is drawn from, as gui props, stated once and spread
2
2
  // where they are drawn.
3
- import { DIM, INK, LINE, RAISED } from './ink.js';
4
- /** A round icon control, 34px: the roster's search and new, the panel's close. */
3
+ import { DIM, INK, LINE, PICKED, RAISED } from './ink.js';
4
+ /** A round icon control, 34px: the roster's search and new, Share, Preferences, Close. */
5
5
  export const ROUND = {
6
- render: 'button', type: 'button', width: 34, height: 34, shrink: 0, rounded: 999, bg: RAISED,
7
- borderWidth: 1, borderColor: LINE, items: 'center', justify: 'center', cursor: 'pointer', p: 0,
8
- hoverStyle: { bg: 'var(--secondary)' },
6
+ render: 'button',
7
+ type: 'button',
8
+ width: 34,
9
+ height: 34,
10
+ shrink: 0,
11
+ rounded: 999,
12
+ bg: RAISED,
13
+ borderWidth: 1,
14
+ borderColor: LINE,
15
+ items: 'center',
16
+ justify: 'center',
17
+ cursor: 'pointer',
18
+ p: 0,
19
+ hoverStyle: { bg: PICKED },
9
20
  focusVisibleStyle: { outlineWidth: 2, outlineStyle: 'solid', outlineColor: '$outlineColor' },
10
21
  };
11
- /** A pill: the open bot in the bar, Share, a notice's ways past. */
22
+ /** A pill: the open bot in the bar, a notice's ways past. */
12
23
  export const PILL = {
13
- render: 'button', type: 'button', display: 'flex', items: 'center', gap: 8, height: 38, px: 14, rounded: 999,
14
- bg: RAISED, borderWidth: 1, borderColor: LINE, cursor: 'pointer', shrink: 0,
15
- hoverStyle: { bg: 'var(--secondary)' },
24
+ render: 'button',
25
+ type: 'button',
26
+ display: 'flex',
27
+ items: 'center',
28
+ gap: 8,
29
+ height: 36,
30
+ px: 13,
31
+ rounded: 999,
32
+ bg: RAISED,
33
+ borderWidth: 1,
34
+ borderColor: LINE,
35
+ cursor: 'pointer',
36
+ shrink: 0,
37
+ hoverStyle: { bg: PICKED },
16
38
  focusVisibleStyle: { outlineWidth: 2, outlineStyle: 'solid', outlineColor: '$outlineColor' },
17
39
  };
18
40
  /** A pill's words. */
19
- export const WORD = { fontSize: 15, lineHeight: 20, color: INK, numberOfLines: 1 };
41
+ export const WORD = { fontSize: 14, lineHeight: 19, fontWeight: '500', color: INK, numberOfLines: 1 };
20
42
  /** A section's heading in the panel. */
21
43
  export const LABEL = { render: 'h3', fontSize: 13, lineHeight: 18, fontWeight: '400', color: DIM, m: 0 };
22
44
  /** A card in the panel. */
23
- export const CARD = { bg: RAISED, borderWidth: 1, borderColor: LINE, rounded: 12 };
45
+ export const CARD = { bg: RAISED, borderWidth: 1, borderColor: LINE, rounded: 14 };
24
46
  /** One line, cut with an ellipsis where it runs out of space. */
25
47
  export const CLIP = { whiteSpace: 'nowrap', overflow: 'hidden', textOverflow: 'ellipsis' };
@@ -32,3 +32,19 @@ export type Line = {
32
32
  };
33
33
  /** The thread as lines: stamps where it paused, each run as the messages it holds. */
34
34
  export declare function lines(runs: readonly AgentRun[], bots: readonly Agent[], self: string, pending: Pending | null, now: number, locale: string, t: (s: string, v?: Record<string, unknown>) => string): Line[];
35
+ export type MessagePart = {
36
+ kind: 'prose';
37
+ text: string;
38
+ } | {
39
+ kind: 'doc';
40
+ name: string;
41
+ size?: string;
42
+ href?: string;
43
+ ext: string;
44
+ } | {
45
+ kind: 'image';
46
+ alt: string;
47
+ src: string;
48
+ };
49
+ /** Splits a message into prose blocks, standalone document cards, and standalone preview images. */
50
+ export declare function partsOf(raw: string): MessagePart[];