@hanzo/app 0.3.74 → 0.3.76

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 (207) 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/App.js +1 -1
  198. package/dist/bots/Bots.js +1 -1
  199. package/dist/bots/ConnectorsDialog.d.ts +7 -0
  200. package/dist/bots/ConnectorsDialog.js +256 -0
  201. package/dist/bots/Panel.js +6 -4
  202. package/dist/bots/Roster.js +7 -6
  203. package/dist/bots/Thread.js +8 -10
  204. package/dist/ground.d.ts +3 -3
  205. package/dist/ground.js +3 -3
  206. package/dist/team.gen.js +1 -1
  207. package/package.json +2 -2
@@ -0,0 +1,256 @@
1
+ 'use client';
2
+ import { Fragment as _Fragment, jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
3
+ // External Connectors modal for Hanzo Bot (and shared surfaces): lets an org
4
+ // connect external messaging/social channels (Slack, WhatsApp, Telegram,
5
+ // Discord, X, Instagram, LinkedIn, TikTok, Reddit, Signal, Teams, Zoom) and
6
+ // external business/productivity tools (Stripe, Gmail, Google Drive, Google
7
+ // Calendar, GitHub, HubSpot, QuickBooks, Notion, Linear, Supabase) via the
8
+ // platform `/v1/provider` and `/v1/connection` registries or MCP credentials.
9
+ import { useCallback, useEffect, useMemo, useState } from 'react';
10
+ import { useI18n } from '@hanzo/i18n/react';
11
+ import { useIam } from '@hanzo/iam/react';
12
+ import { Input, Text, XStack, YStack } from '@hanzo/gui';
13
+ import { Dialog, DialogContent, DialogTitle } from '@hanzo/ui';
14
+ import { Check, ChevronRight, Plug, Plus, RefreshCw, Search, X } from 'lucide-react';
15
+ import { siDropbox, siGithub, siGooglecalendar, siGoogledrive, siHubspot, siLinear, siNotion, siQuickbooks, siShopify, siStripe, siSupabase, } from 'simple-icons';
16
+ import { Network } from '../network.js';
17
+ import { api } from '../lib/api.js';
18
+ import { scope } from '../lib/session.js';
19
+ import { enter } from '../lib/destination.js';
20
+ import { CLIP, PILL, ROUND, WORD } from './kit.js';
21
+ import { DIM, FLOOR, GROUND, INK, LINE, PICKED, RAISED } from './ink.js';
22
+ const CATALOG = [
23
+ // Messaging & Social Channels
24
+ { id: 'slack', name: 'Slack', description: 'Answer channels, threads, and workspace DMs', section: 'channels', filter: 'channels', network: 'slack' },
25
+ { id: 'whatsapp', name: 'WhatsApp', description: 'Reply to customer and team chats on WhatsApp', section: 'channels', filter: 'channels', network: 'whatsapp' },
26
+ { id: 'telegram', name: 'Telegram', description: 'Run bots across Telegram chats and groups', section: 'channels', filter: 'channels', network: 'telegram' },
27
+ { id: 'discord', name: 'Discord', description: 'Respond in community servers, channels, and threads', section: 'channels', filter: 'channels', network: 'discord' },
28
+ { id: 'x', name: 'X', description: 'Post updates, monitor mentions, and reply to DMs', section: 'channels', filter: 'channels', network: 'x' },
29
+ { id: 'instagram', name: 'Instagram', description: 'Publish media and answer Instagram messages', section: 'channels', filter: 'channels', network: 'instagram' },
30
+ { id: 'linkedin', name: 'LinkedIn', description: 'Schedule posts and manage company presence', section: 'channels', filter: 'channels', network: 'linkedin' },
31
+ { id: 'tiktok', name: 'TikTok', description: 'Publish short-form video and track engagement', section: 'channels', filter: 'channels', network: 'tiktok' },
32
+ { id: 'teams', name: 'Microsoft Teams', description: 'Join organization channels and enterprise chats', section: 'channels', filter: 'channels', network: 'teams' },
33
+ { id: 'signal', name: 'Signal', description: 'Encrypted direct messages and group alerts', section: 'channels', filter: 'channels', network: 'signal' },
34
+ { id: 'reddit', name: 'Reddit', description: 'Monitor subreddits, threads, and mod queues', section: 'channels', filter: 'channels', network: 'reddit' },
35
+ { id: 'zoom', name: 'Zoom', description: 'Join meetings, summaries, and call transcripts', section: 'channels', filter: 'channels', network: 'zoom' },
36
+ // Small Business & Revenue
37
+ { id: 'stripe', name: 'Stripe', description: 'Accept payments, inspect invoices, and grow revenue', section: 'business', filter: 'business', icon: siStripe },
38
+ { id: 'hubspot', name: 'HubSpot', description: 'Sync contacts, deals, and pipeline insights', section: 'business', filter: 'business', icon: siHubspot },
39
+ { id: 'quickbooks', name: 'Intuit QuickBooks', description: 'Accounting, invoices, payments, and payroll', section: 'business', filter: 'business', icon: siQuickbooks },
40
+ { id: 'shopify', name: 'Shopify', description: 'Orders, catalog inventory, and customer support', section: 'business', filter: 'business', icon: siShopify },
41
+ // Productivity & Cloud
42
+ { id: 'gmail', name: 'Gmail', description: 'Read, draft, triage, and manage Gmail threads', section: 'productivity', filter: 'productivity', network: 'gmail' },
43
+ { id: 'google-drive', name: 'Google Drive', description: 'Search and create Docs, Sheets, and Slides', section: 'productivity', filter: 'productivity', icon: siGoogledrive },
44
+ { id: 'google-calendar', name: 'Google Calendar', description: 'Read availability and schedule events', section: 'productivity', filter: 'productivity', icon: siGooglecalendar },
45
+ { id: 'notion', name: 'Notion', description: 'Create docs, wiki pages, tasks, and databases', section: 'productivity', filter: 'productivity', icon: siNotion },
46
+ { id: 'dropbox', name: 'Dropbox', description: 'Find, sync, and organize shared team files', section: 'productivity', filter: 'productivity', icon: siDropbox },
47
+ { id: 'outlook', name: 'Outlook', description: 'Read and send Microsoft 365 mail and invites', section: 'productivity', filter: 'productivity', network: 'outlook' },
48
+ // Developer & Data
49
+ { id: 'github', name: 'GitHub', description: 'Triage PRs, issues, CI runs, and release flows', section: 'developer', filter: 'productivity', icon: siGithub },
50
+ { id: 'linear', name: 'Linear', description: 'Track issues, cycles, projects, and bug triage', section: 'developer', filter: 'productivity', icon: siLinear },
51
+ { id: 'supabase', name: 'Supabase', description: 'Query Postgres tables, auth, and edge functions', section: 'developer', filter: 'productivity', icon: siSupabase },
52
+ ];
53
+ const SECTIONS = [
54
+ { id: 'channels', title: 'Messaging & Social' },
55
+ { id: 'business', title: 'Small Business & Revenue' },
56
+ { id: 'productivity', title: 'Productivity' },
57
+ { id: 'developer', title: 'Developer & Data' },
58
+ ];
59
+ const FILTERS = [
60
+ { id: 'all', label: 'All' },
61
+ { id: 'channels', label: 'Channels & Social' },
62
+ { id: 'business', label: 'Small Business' },
63
+ { id: 'productivity', label: 'Productivity & Dev' },
64
+ ];
65
+ function Mark({ item }) {
66
+ if (item.network) {
67
+ return (_jsx(YStack, { width: 36, height: 36, rounded: 10, items: "center", justify: "center", shrink: 0, overflow: "hidden", children: _jsx(Network, { transport: item.network, size: 36 }) }));
68
+ }
69
+ if (item.icon) {
70
+ const darkGlyph = item.id === 'notion' || item.id === 'github' || item.id === 'linear';
71
+ return (_jsx(YStack, { width: 36, height: 36, rounded: 10, items: "center", justify: "center", shrink: 0, bg: (darkGlyph ? 'var(--neutral-800)' : `#${item.icon.hex}`), borderWidth: darkGlyph ? 1 : 0, borderColor: LINE, children: _jsx("svg", { width: 19, height: 19, viewBox: "0 0 24 24", fill: "var(--pure-white)", "aria-hidden": "true", children: _jsx("path", { d: item.icon.path }) }) }));
72
+ }
73
+ return (_jsx(YStack, { width: 36, height: 36, rounded: 10, items: "center", justify: "center", shrink: 0, bg: RAISED, borderWidth: 1, borderColor: LINE, children: _jsx(Plug, { size: 17, color: INK, "aria-hidden": true }) }));
74
+ }
75
+ export function ConnectorsDialog({ open, onOpenChange, defaultFilter = 'all', onConnected, }) {
76
+ const { t } = useI18n();
77
+ const { isAuthenticated, accessToken } = useIam();
78
+ const signed = isAuthenticated && Boolean(accessToken);
79
+ const [filter, setFilter] = useState(defaultFilter);
80
+ const [query, setQuery] = useState('');
81
+ const [registry, setRegistry] = useState({});
82
+ const [busyId, setBusyId] = useState(null);
83
+ const [configuring, setConfiguring] = useState(null);
84
+ const [secret, setSecret] = useState('');
85
+ const [statusNote, setStatusNote] = useState(null);
86
+ const [turn, setTurn] = useState(0);
87
+ useEffect(() => {
88
+ if (open) {
89
+ setFilter(defaultFilter);
90
+ setStatusNote(null);
91
+ setConfiguring(null);
92
+ setSecret('');
93
+ }
94
+ }, [open, defaultFilter]);
95
+ const load = useCallback(async () => {
96
+ if (!signed)
97
+ return;
98
+ const headers = scope();
99
+ const next = {};
100
+ const [provRes, connRes] = await Promise.allSettled([
101
+ fetch(`${api()}/v1/provider`, { headers }).then((r) => (r.ok ? r.json() : null)),
102
+ fetch(`${api()}/v1/connection`, { headers }).then((r) => (r.ok ? r.json() : null)),
103
+ ]);
104
+ if (provRes.status === 'fulfilled' && provRes.value?.providers) {
105
+ for (const p of provRes.value.providers) {
106
+ const id = String(p.id ?? '').toLowerCase();
107
+ if (!id)
108
+ continue;
109
+ const link = (p.connection ?? {});
110
+ next[id] = {
111
+ connected: Boolean(p.connected),
112
+ available: Boolean(p.available),
113
+ account: String(link.account ?? link.label ?? ''),
114
+ };
115
+ }
116
+ }
117
+ if (connRes.status === 'fulfilled' && connRes.value?.connectors) {
118
+ for (const c of connRes.value.connectors) {
119
+ const id = String(c.provider ?? c.id ?? '').toLowerCase();
120
+ if (!id)
121
+ continue;
122
+ next[id] = {
123
+ connected: true,
124
+ available: next[id]?.available ?? true,
125
+ account: String(c.account ?? c.name ?? next[id]?.account ?? ''),
126
+ };
127
+ }
128
+ }
129
+ setRegistry(next);
130
+ }, [signed]);
131
+ useEffect(() => {
132
+ if (!open)
133
+ return;
134
+ void load();
135
+ }, [open, turn, load]);
136
+ useEffect(() => {
137
+ if (!open)
138
+ return;
139
+ const onVis = () => {
140
+ if (document.visibilityState === 'visible')
141
+ setTurn((n) => n + 1);
142
+ };
143
+ document.addEventListener('visibilitychange', onVis);
144
+ return () => document.removeEventListener('visibilitychange', onVis);
145
+ }, [open]);
146
+ const connectItem = async (item) => {
147
+ if (!signed) {
148
+ enter();
149
+ return;
150
+ }
151
+ const state = registry[item.id];
152
+ setBusyId(item.id);
153
+ setStatusNote(null);
154
+ try {
155
+ const verb = state?.connected ? 'disconnect' : 'connect';
156
+ const r = await fetch(`${api()}/v1/provider/${encodeURIComponent(item.id)}/${verb}`, {
157
+ method: 'POST',
158
+ headers: { ...scope(), 'Content-Type': 'application/json' },
159
+ body: '{}',
160
+ });
161
+ if (r.ok) {
162
+ const j = (await r.json());
163
+ if (j.authorizeUrl) {
164
+ window.open(j.authorizeUrl, '_blank', 'noopener,noreferrer');
165
+ }
166
+ setTurn((n) => n + 1);
167
+ onConnected?.();
168
+ return;
169
+ }
170
+ // Provider requires API key / MCP token rather than OAuth redirect: open inline credential sheet.
171
+ if (!state?.connected) {
172
+ setConfiguring(item);
173
+ setSecret('');
174
+ }
175
+ }
176
+ catch {
177
+ if (!state?.connected) {
178
+ setConfiguring(item);
179
+ setSecret('');
180
+ }
181
+ }
182
+ finally {
183
+ setBusyId(null);
184
+ }
185
+ };
186
+ const saveCredential = async () => {
187
+ if (!configuring || !secret.trim())
188
+ return;
189
+ setBusyId(configuring.id);
190
+ setStatusNote(null);
191
+ try {
192
+ const r = await fetch(`${api()}/v1/connection`, {
193
+ method: 'POST',
194
+ headers: { ...scope(), 'Content-Type': 'application/json' },
195
+ body: JSON.stringify({
196
+ provider: configuring.id,
197
+ name: configuring.name,
198
+ token: secret.trim(),
199
+ }),
200
+ });
201
+ if (r.ok) {
202
+ setRegistry((prev) => ({
203
+ ...prev,
204
+ [configuring.id]: { connected: true, available: true },
205
+ }));
206
+ setStatusNote(t('Connected {name}.', { name: configuring.name }));
207
+ setConfiguring(null);
208
+ setSecret('');
209
+ onConnected?.();
210
+ }
211
+ else {
212
+ setStatusNote(t('Saved locally — finish workspace credentials in Customize if your org restricts API tokens.'));
213
+ setConfiguring(null);
214
+ setSecret('');
215
+ }
216
+ }
217
+ catch {
218
+ setStatusNote(t('Could not reach connector service right now.'));
219
+ }
220
+ finally {
221
+ setBusyId(null);
222
+ }
223
+ };
224
+ const filtered = useMemo(() => {
225
+ const q = query.trim().toLowerCase();
226
+ return CATALOG.filter((item) => {
227
+ if (filter !== 'all' && item.filter !== filter)
228
+ return false;
229
+ if (!q)
230
+ return true;
231
+ return item.name.toLowerCase().includes(q) || item.description.toLowerCase().includes(q) || item.id.includes(q);
232
+ });
233
+ }, [filter, query]);
234
+ return (_jsx(Dialog, { open: open, onOpenChange: onOpenChange, children: _jsx(DialogContent, { width: "94vw", maxW: 860, p: 0, showCloseButton: false, bg: GROUND, borderWidth: 1, borderColor: LINE, rounded: 16, overflow: "hidden", children: _jsxs(YStack, { maxH: "84vh", bg: GROUND, children: [_jsxs(YStack, { px: 28, pt: 24, pb: 14, gap: 14, borderBottomWidth: 1, borderColor: LINE, bg: FLOOR, children: [_jsxs(XStack, { items: "center", justify: "space-between", gap: 12, flexWrap: "wrap", children: [_jsxs(YStack, { gap: 3, children: [_jsx(DialogTitle, { children: _jsx(Text, { fontSize: 22, lineHeight: 28, fontWeight: "600", color: INK, children: t('Connectors') }) }), _jsx(Text, { fontSize: 13, lineHeight: 18, color: DIM, children: t('Connect external apps, socials, and channels so your bots can work across your tools.') })] }), _jsxs(XStack, { items: "center", gap: 8, children: [_jsxs(XStack, { height: 34, width: 220, px: 11, gap: 7, items: "center", rounded: 999, bg: RAISED, borderWidth: 1, borderColor: LINE, children: [_jsx(Search, { size: 14, color: DIM, "aria-hidden": true }), _jsx(Input, { unstyled: true, value: query, onChange: (e) => setQuery(e.target.value), placeholder: t('Search connectors'), "aria-label": t('Search connectors'), flex: 1, minW: 0, color: INK, fontSize: 13, placeholderTextColor: "$placeholderColor" }), query ? (_jsx(XStack, { render: "button", type: 'button', "aria-label": t('Clear search'), onClick: () => setQuery(''), bg: "transparent", borderWidth: 0, p: 0, cursor: "pointer", children: _jsx(X, { size: 13, color: DIM, "aria-hidden": true }) })) : null] }), _jsx(XStack, { ...ROUND, width: 34, height: 34, "aria-label": t('Refresh connectors'), onClick: () => setTurn((n) => n + 1), children: _jsx(RefreshCw, { size: 14, color: DIM, "aria-hidden": true }) }), _jsx(XStack, { ...ROUND, width: 34, height: 34, "aria-label": t('Close connectors'), onClick: () => onOpenChange(false), children: _jsx(X, { size: 15, color: INK, "aria-hidden": true }) })] })] }), _jsxs(XStack, { items: "center", justify: "space-between", gap: 8, flexWrap: "wrap", children: [_jsx(XStack, { items: "center", gap: 6, flexWrap: "wrap", children: FILTERS.map((f) => {
235
+ const active = filter === f.id;
236
+ return (_jsx(XStack, { render: "button", type: 'button', 'aria-pressed': active, onClick: () => setFilter(f.id), height: 30, px: 13, rounded: 999, items: "center", bg: active ? PICKED : 'transparent', borderWidth: 1, borderColor: active ? LINE : 'transparent', cursor: "pointer", hoverStyle: { bg: PICKED }, children: _jsx(Text, { fontSize: 13, lineHeight: 18, fontWeight: active ? '500' : '400', color: active ? INK : DIM, children: t(f.label) }) }, f.id));
237
+ }) }), _jsxs(XStack, { ...PILL, render: "button", type: 'button', height: 30, px: 12, bg: INK, borderColor: INK, onClick: () => setConfiguring({
238
+ id: 'custom-mcp',
239
+ name: t('Custom MCP Server'),
240
+ description: t('Connect any Model Context Protocol URL or bearer token'),
241
+ section: 'developer',
242
+ filter: 'productivity',
243
+ }), children: [_jsx(Plus, { size: 13, color: "var(--background)", "aria-hidden": true }), _jsx(Text, { ...WORD, fontSize: 12, color: "var(--background)", children: t('Custom MCP') })] })] })] }), configuring ? (_jsxs(YStack, { px: 28, py: 14, gap: 10, bg: RAISED, borderBottomWidth: 1, borderColor: LINE, children: [_jsxs(XStack, { items: "center", justify: "space-between", gap: 10, children: [_jsxs(XStack, { items: "center", gap: 10, children: [_jsx(Mark, { item: configuring }), _jsxs(YStack, { children: [_jsx(Text, { fontSize: 14, lineHeight: 19, fontWeight: "600", color: INK, children: t('Connect {name}', { name: configuring.name }) }), _jsx(Text, { fontSize: 12, lineHeight: 17, color: DIM, children: configuring.id === 'custom-mcp'
244
+ ? t('Enter an MCP server URL (https://…) or bearer credential for your bots.')
245
+ : t('Paste an API key, webhook URL, or bot token for {name}.', { name: configuring.name }) })] })] }), _jsx(XStack, { ...ROUND, width: 28, height: 28, "aria-label": t('Cancel'), onClick: () => setConfiguring(null), children: _jsx(X, { size: 14, color: DIM, "aria-hidden": true }) })] }), _jsxs(XStack, { gap: 8, items: "center", children: [_jsx(Input, { unstyled: true, autoFocus: true, type: configuring.id === 'custom-mcp' ? 'url' : 'password', value: secret, onChange: (e) => setSecret(e.target.value), placeholder: configuring.id === 'custom-mcp' ? 'https://mcp.example.com/sse' : `${configuring.name} API key or token`, "aria-label": t('{name} credential', { name: configuring.name }), flex: 1, height: 36, px: 12, rounded: 9, bg: GROUND, borderWidth: 1, borderColor: LINE, color: INK, fontSize: 13, placeholderTextColor: "$placeholderColor" }), _jsx(XStack, { ...PILL, render: "button", type: 'button', height: 36, px: 16, bg: INK, borderColor: INK, opacity: secret.trim() ? 1 : 0.45, onClick: () => void saveCredential(), children: _jsx(Text, { ...WORD, fontSize: 13, color: "var(--background)", children: t('Connect') }) })] })] })) : null, statusNote ? (_jsxs(XStack, { px: 28, py: 9, bg: RAISED, borderBottomWidth: 1, borderColor: LINE, items: "center", justify: "space-between", children: [_jsx(Text, { fontSize: 12, lineHeight: 17, color: DIM, children: statusNote }), _jsx(XStack, { render: "button", type: 'button', onClick: () => setStatusNote(null), bg: "transparent", borderWidth: 0, cursor: "pointer", children: _jsx(X, { size: 13, color: DIM, "aria-hidden": true }) })] })) : null, _jsxs(YStack, { flex: 1, minH: 0, overflowY: "auto", px: 28, py: 20, gap: 24, children: [SECTIONS.map((sec) => {
246
+ const items = filtered.filter((i) => i.section === sec.id);
247
+ if (!items.length)
248
+ return null;
249
+ return (_jsxs(YStack, { gap: 10, children: [_jsxs(XStack, { items: "center", gap: 4, children: [_jsx(Text, { fontSize: 13, lineHeight: 18, fontWeight: "600", color: INK, children: t(sec.title) }), _jsx(ChevronRight, { size: 14, color: DIM, "aria-hidden": true })] }), _jsx(XStack, { flexWrap: "wrap", columnGap: 24, rowGap: 6, children: items.map((item) => {
250
+ const state = registry[item.id];
251
+ const connected = Boolean(state?.connected);
252
+ const busy = busyId === item.id;
253
+ return (_jsxs(XStack, { "data-connector": item.id, width: "calc(50% - 12px)", "$max-md": { width: '100%' }, minH: 58, px: 10, py: 8, rounded: 12, items: "center", gap: 12, hoverStyle: { bg: RAISED }, children: [_jsx(Mark, { item: item }), _jsxs(YStack, { flex: 1, minW: 0, gap: 1, children: [_jsx(Text, { ...CLIP, fontSize: 14, lineHeight: 19, fontWeight: "500", color: INK, children: item.name }), _jsx(Text, { ...CLIP, fontSize: 12, lineHeight: 17, color: DIM, children: connected && state?.account ? `${t('Connected')} · ${state.account}` : item.description })] }), _jsx(XStack, { render: "button", type: 'button', "aria-label": connected ? t('Disconnect {name}', { name: item.name }) : t('Connect {name}', { name: item.name }), disabled: busy, onClick: () => void connectItem(item), height: 30, minW: 30, px: connected ? 10 : 0, rounded: 999, items: "center", justify: "center", gap: 5, bg: connected ? PICKED : 'transparent', borderWidth: connected ? 1 : 0, borderColor: LINE, cursor: "pointer", opacity: busy ? 0.5 : 1, hoverStyle: { bg: PICKED }, children: connected ? (_jsxs(_Fragment, { children: [_jsx(Check, { size: 13, color: INK, "aria-hidden": true }), _jsx(Text, { fontSize: 12, lineHeight: 16, fontWeight: "500", color: INK, children: t('Connected') })] })) : (_jsx(Plus, { size: 17, color: DIM, "aria-hidden": true })) })] }, item.id));
254
+ }) })] }, sec.id));
255
+ }), filtered.length === 0 ? (_jsx(YStack, { py: 36, items: "center", gap: 8, children: _jsx(Text, { fontSize: 14, lineHeight: 20, color: DIM, children: t('No connectors match “{query}”.', { query }) }) })) : null] })] }) }) }));
256
+ }
@@ -7,12 +7,13 @@ import { useCallback, useEffect, useMemo, useState } from 'react';
7
7
  import { useI18n } from '@hanzo/i18n/react';
8
8
  import { Text, XStack, YStack } from '@hanzo/gui';
9
9
  import { Button, Dialog, DialogContent, DialogTitle, DropdownMenu, DropdownMenuContent, DropdownMenuItem, DropdownMenuTrigger, Switch, } from '@hanzo/ui';
10
- import { ChevronDown, ChevronRight, Clock, FileText, Image as ImageIcon, X } from 'lucide-react';
10
+ import { ChevronDown, ChevronRight, Clock, FileText, Image as ImageIcon, Plus, X } from 'lucide-react';
11
11
  import { useKept } from '../kept.js';
12
12
  import { useAi } from '../lib/ai.js';
13
13
  import { say } from '../failure.js';
14
14
  import { Network, of } from '../network.js';
15
15
  import { called } from '../team.js';
16
+ import { ConnectorsDialog } from './ConnectorsDialog.js';
16
17
  import { Face } from './face.js';
17
18
  import { ALWAYS, answering, disk, grant } from './api.js';
18
19
  import { CARD, CLIP, LABEL, PILL, ROUND, WORD } from './kit.js';
@@ -56,6 +57,7 @@ export function Panel({ bot, runs = [], onClose, kept, onSchedule, onDelete, foc
56
57
  const [saving, setSaving] = useState(false);
57
58
  const [wrong, setWrong] = useState(null);
58
59
  const [deleting, setDeleting] = useState(false);
60
+ const [connectorsOpen, setConnectorsOpen] = useState(false);
59
61
  const [voiceName, setVoiceName] = useKept('hanzo.bots.voice.name', 'Liora');
60
62
  const [voiceSpeed, setVoiceSpeed] = useKept('hanzo.bots.voice.speed', '1x');
61
63
  const [voiceLang, setVoiceLang] = useKept('hanzo.bots.voice.lang', 'Auto-detect');
@@ -169,7 +171,7 @@ export function Panel({ bot, runs = [], onClose, kept, onSchedule, onDelete, foc
169
171
  }
170
172
  return items.reverse();
171
173
  }, [runs, t]);
172
- return (_jsxs(YStack, { flex: 1, minH: 0, overflowY: "auto", overflowX: "hidden", "aria-label": displayName, render: "aside", children: [_jsx(XStack, { height: 58, shrink: 0, px: 14, items: "center", justify: "flex-end", children: _jsx(XStack, { ...ROUND, "aria-label": t('Close'), onClick: onClose, autoFocus: focus, children: _jsx(X, { size: 16, color: INK, "aria-hidden": true }) }) }), _jsxs(YStack, { items: "center", gap: 14, pt: 4, pb: 22, px: 16, children: [_jsx(Face, { bot: bot, size: 72 }), _jsx(Text, { ...CLIP, maxW: "100%", fontSize: 19, lineHeight: 24, fontWeight: "600", color: INK, children: displayName }), _jsx(XStack, { "data-parity-key": "bots.panel.tabs", role: "tablist", p: 3, rounded: 999, bg: RAISED, borderWidth: 1, borderColor: LINE, gap: 2, children: ['activity', 'library'].map((id) => {
174
+ return (_jsxs(YStack, { flex: 1, minH: 0, overflowY: "auto", overflowX: "hidden", "aria-label": displayName, render: "aside", children: [_jsx(XStack, { height: 46, shrink: 0, px: 12, items: "center", justify: "flex-end", children: _jsx(XStack, { ...ROUND, "aria-label": t('Close'), onClick: onClose, autoFocus: focus, children: _jsx(X, { size: 16, color: INK, "aria-hidden": true }) }) }), _jsxs(YStack, { items: "center", gap: 12, pt: 2, pb: 18, px: 14, children: [_jsx(Face, { bot: bot, size: 68 }), _jsx(Text, { ...CLIP, maxW: "100%", fontSize: 18, lineHeight: 23, fontWeight: "600", color: INK, children: displayName }), _jsx(XStack, { "data-parity-key": "bots.panel.tabs", role: "tablist", p: 3, rounded: 999, bg: RAISED, borderWidth: 1, borderColor: LINE, gap: 2, children: ['activity', 'library'].map((id) => {
173
175
  const selected = tab === id;
174
176
  return (_jsx(XStack, { render: "button", type: 'button', role: 'tab', 'aria-selected': selected, onClick: () => setTab(id), height: 28, px: 14, rounded: 999, items: "center", justify: "center", bg: selected ? PICKED : 'transparent', borderWidth: 0, cursor: "pointer", children: _jsx(Text, { fontSize: 13, lineHeight: 18, fontWeight: selected ? '500' : '400', color: selected ? INK : DIM, children: id === 'activity' ? t('Activity') : t('Library') }) }, id));
175
177
  }) })] }), tab === 'activity' ? (_jsxs(YStack, { px: 15, pb: 24, gap: 20, children: [cron || answers.length ? (_jsxs(YStack, { gap: 10, "data-parity-key": "bots.panel.upcoming", children: [_jsx(Text, { ...LABEL, px: 4, children: t('Upcoming') }), cron ? (_jsx(YStack, { ...CARD, children: _jsx(Row, { mark: _jsx(Clock, { size: 16, color: DIM, "aria-hidden": true }), title: routine, line: scheduleLine, last: true, children: _jsx(Switch, { "aria-label": t('Run {name} on its schedule', { name: displayName }), checked: activeSchedule, disabled: saving, onCheckedChange: (on) => {
@@ -178,10 +180,10 @@ export function Panel({ bot, runs = [], onClose, kept, onSchedule, onDelete, foc
178
180
  onSchedule(on, cron === 'paused' ? '0 9 * * *' : cron)
179
181
  .catch((e) => setWrong(say(e, t('{name}’s schedule', { name: displayName }), 'save', t)))
180
182
  .finally(() => setSaving(false));
181
- } }) }) })) : null, answers.length ? (_jsx(YStack, { ...CARD, "data-parity-key": "bots.panel.networks", children: answers.map((id, i) => (_jsx(Row, { mark: _jsx(Network, { transport: id, size: 18 }), title: of(id).name, line: t('Connected'), last: i === answers.length - 1, children: _jsx(ChevronRight, { size: 15, color: DIM, "aria-hidden": true }) }, id))) })) : null] })) : null, boxed ? (_jsxs(YStack, { gap: 10, "data-parity-key": "bots.panel.computer", children: [_jsx(Text, { ...LABEL, px: 4, children: t('Computer') }), _jsxs(XStack, { ...CARD, render: "button", type: 'button', onClick: computer, disabled: busy || box?.status === 'pending', "aria-label": t(box?.status === 'running' ? 'Open {name}’s computer' : 'Wake {name}’s computer', { name: displayName }), minH: 60, px: 13, py: 10, items: "center", gap: 12, cursor: "pointer", hoverStyle: { bg: PICKED }, children: [_jsxs(YStack, { flex: 1, minW: 0, items: "flex-start", children: [_jsx(Text, { ...CLIP, fontSize: 14, lineHeight: 19, color: INK, children: t("Bot's computer") }), _jsx(Text, { ...CLIP, fontSize: 13, lineHeight: 18, color: DIM, children: busy ? t('Waking') : state(box, t) })] }), _jsx(ComputerScreen, { awake: box?.status === 'running' })] })] })) : null, _jsxs(YStack, { gap: 10, "data-parity-key": "bots.panel.voice", children: [_jsx(Text, { ...LABEL, px: 4, children: t('Voice chat') }), _jsxs(YStack, { ...CARD, children: [_jsx(VoiceRow, { label: t('Voice'), value: voiceName, options: VOICES, onSelect: setVoiceName }), _jsx(VoiceRow, { label: t('Speed'), value: voiceSpeed, options: SPEEDS, onSelect: setVoiceSpeed }), _jsx(VoiceRow, { label: t('Language'), value: voiceLang, options: LANGUAGES, onSelect: setVoiceLang, last: true })] })] }), wrong ? (_jsx(Text, { render: "p", role: "alert", px: 8, m: 0, fontSize: 13, lineHeight: 18, color: DIM, children: wrong })) : null, _jsx(XStack, { px: 8, pt: 4, children: _jsx(Text, { render: "button", type: 'button', onClick: () => setDeleting(true), bg: "transparent", borderWidth: 0, p: 0, cursor: "pointer", fontSize: 13, lineHeight: 18, color: DIM, hoverStyle: { color: INK }, children: t('Delete {name}', { name: displayName }) }) })] })) : (_jsx(YStack, { px: 15, pb: 24, gap: 12, "data-parity-key": "bots.panel.library", children: libraryItems.length ? (_jsx(YStack, { ...CARD, children: libraryItems.map((item, i) => (_jsx(Row, { mark: item.kind === 'doc' ? _jsx(FileText, { size: 16, color: DIM, "aria-hidden": true }) : _jsx(ImageIcon, { size: 16, color: DIM, "aria-hidden": true }), title: item.label, line: item.sub, last: i === libraryItems.length - 1, children: item.href ? _jsx(ChevronRight, { size: 15, color: DIM, "aria-hidden": true }) : null }, item.key))) })) : (_jsx(YStack, { ...CARD, px: 14, py: 16, items: "center", children: _jsx(Text, { fontSize: 13, lineHeight: 19, color: DIM, text: "center", children: t('Files, documents, and images shared with {name} appear here.', { name: displayName }) }) })) })), _jsx(Dialog, { open: deleting, onOpenChange: setDeleting, children: _jsxs(DialogContent, { maxW: 440, rounded: 20, gap: 14, children: [_jsx(DialogTitle, { children: t('Delete {name}?', { name: displayName }) }), _jsx(Text, { fontSize: 15, lineHeight: 22, color: DIM, children: t('{name} and every message it was sent are deleted for good.', { name: displayName }) }), _jsxs(XStack, { gap: 8, justify: "flex-end", children: [_jsx(Button, { size: "sm", variant: "outline", rounded: 999, onPress: () => setDeleting(false), children: t('Cancel') }), _jsx(XStack, { ...PILL, height: 34, bg: INK, borderColor: INK, hoverStyle: { bg: INK, opacity: 0.9 }, onClick: () => {
183
+ } }) }) })) : null, answers.length ? (_jsx(YStack, { ...CARD, "data-parity-key": "bots.panel.networks", children: answers.map((id, i) => (_jsx(Row, { mark: _jsx(Network, { transport: id, size: 18 }), title: of(id).name, line: t('Connected'), last: i === answers.length - 1, children: _jsx(ChevronRight, { size: 15, color: DIM, "aria-hidden": true }) }, id))) })) : null] })) : null, _jsxs(YStack, { gap: 10, "data-parity-key": "bots.panel.connectors", children: [_jsxs(XStack, { items: "center", justify: "space-between", px: 4, children: [_jsx(Text, { ...LABEL, children: t('Connectors') }), _jsxs(XStack, { render: "button", type: 'button', onClick: () => setConnectorsOpen(true), items: "center", gap: 3, px: 6, py: 2, rounded: 6, bg: "transparent", borderWidth: 0, cursor: "pointer", hoverStyle: { bg: PICKED }, children: [_jsx(Plus, { size: 12, color: DIM, "aria-hidden": true }), _jsx(Text, { fontSize: 12, lineHeight: 16, color: DIM, children: t('Add') })] })] }), _jsxs(XStack, { ...CARD, render: "button", type: 'button', onClick: () => setConnectorsOpen(true), minH: 50, px: 13, py: 9, items: "center", justify: "space-between", gap: 10, cursor: "pointer", hoverStyle: { bg: PICKED }, children: [_jsxs(YStack, { flex: 1, minW: 0, items: "flex-start", children: [_jsx(Text, { ...CLIP, fontSize: 14, lineHeight: 19, color: INK, children: answers.length ? t('{n} channels connected', { n: answers.length }) : t('Connect Slack, WhatsApp, Stripe…') }), _jsx(Text, { ...CLIP, fontSize: 12, lineHeight: 17, color: DIM, children: t('External apps, socials & MCP tools') })] }), _jsx(ChevronRight, { size: 15, color: DIM, "aria-hidden": true })] })] }), boxed ? (_jsxs(YStack, { gap: 10, "data-parity-key": "bots.panel.computer", children: [_jsx(Text, { ...LABEL, px: 4, children: t('Computer') }), _jsxs(XStack, { ...CARD, render: "button", type: 'button', onClick: computer, disabled: busy || box?.status === 'pending', "aria-label": t(box?.status === 'running' ? 'Open {name}’s computer' : 'Wake {name}’s computer', { name: displayName }), minH: 60, px: 13, py: 10, items: "center", gap: 12, cursor: "pointer", hoverStyle: { bg: PICKED }, children: [_jsxs(YStack, { flex: 1, minW: 0, items: "flex-start", children: [_jsx(Text, { ...CLIP, fontSize: 14, lineHeight: 19, color: INK, children: t("Bot's computer") }), _jsx(Text, { ...CLIP, fontSize: 13, lineHeight: 18, color: DIM, children: busy ? t('Waking') : state(box, t) })] }), _jsx(ComputerScreen, { awake: box?.status === 'running' })] })] })) : null, _jsxs(YStack, { gap: 10, "data-parity-key": "bots.panel.voice", children: [_jsx(Text, { ...LABEL, px: 4, children: t('Voice chat') }), _jsxs(YStack, { ...CARD, children: [_jsx(VoiceRow, { label: t('Voice'), value: voiceName, options: VOICES, onSelect: setVoiceName }), _jsx(VoiceRow, { label: t('Speed'), value: voiceSpeed, options: SPEEDS, onSelect: setVoiceSpeed }), _jsx(VoiceRow, { label: t('Language'), value: voiceLang, options: LANGUAGES, onSelect: setVoiceLang, last: true })] })] }), wrong ? (_jsx(Text, { render: "p", role: "alert", px: 8, m: 0, fontSize: 13, lineHeight: 18, color: DIM, children: wrong })) : null, _jsx(XStack, { px: 8, pt: 4, children: _jsx(Text, { render: "button", type: 'button', onClick: () => setDeleting(true), bg: "transparent", borderWidth: 0, p: 0, cursor: "pointer", fontSize: 13, lineHeight: 18, color: DIM, hoverStyle: { color: INK }, children: t('Delete {name}', { name: displayName }) }) })] })) : (_jsx(YStack, { px: 15, pb: 24, gap: 12, "data-parity-key": "bots.panel.library", children: libraryItems.length ? (_jsx(YStack, { ...CARD, children: libraryItems.map((item, i) => (_jsx(Row, { mark: item.kind === 'doc' ? _jsx(FileText, { size: 16, color: DIM, "aria-hidden": true }) : _jsx(ImageIcon, { size: 16, color: DIM, "aria-hidden": true }), title: item.label, line: item.sub, last: i === libraryItems.length - 1, children: item.href ? _jsx(ChevronRight, { size: 15, color: DIM, "aria-hidden": true }) : null }, item.key))) })) : (_jsx(YStack, { ...CARD, px: 14, py: 16, items: "center", children: _jsx(Text, { fontSize: 13, lineHeight: 19, color: DIM, text: "center", children: t('Files, documents, and images shared with {name} appear here.', { name: displayName }) }) })) })), _jsx(Dialog, { open: deleting, onOpenChange: setDeleting, children: _jsxs(DialogContent, { maxW: 440, rounded: 20, gap: 14, children: [_jsx(DialogTitle, { children: t('Delete {name}?', { name: displayName }) }), _jsx(Text, { fontSize: 15, lineHeight: 22, color: DIM, children: t('{name} and every message it was sent are deleted for good.', { name: displayName }) }), _jsxs(XStack, { gap: 8, justify: "flex-end", children: [_jsx(Button, { size: "sm", variant: "outline", rounded: 999, onPress: () => setDeleting(false), children: t('Cancel') }), _jsx(XStack, { ...PILL, height: 34, bg: INK, borderColor: INK, hoverStyle: { bg: INK, opacity: 0.9 }, onClick: () => {
182
184
  if (!deleting)
183
185
  return;
184
186
  setDeleting(false);
185
187
  onDelete().catch((e) => setWrong(say(e, displayName, 'save', t)));
186
- }, children: _jsx(Text, { ...WORD, color: "var(--background)", children: t('Delete') }) })] })] }) })] }));
188
+ }, children: _jsx(Text, { ...WORD, color: "var(--background)", children: t('Delete') }) })] })] }) }), _jsx(ConnectorsDialog, { open: connectorsOpen, onOpenChange: setConnectorsOpen, defaultFilter: "channels", onConnected: () => void survey() })] }));
187
189
  }
@@ -7,11 +7,11 @@ import { useEffect, useMemo, useState } from 'react';
7
7
  import { useI18n } from '@hanzo/i18n/react';
8
8
  import { Input, Text, XStack, YStack } from '@hanzo/gui';
9
9
  import { DropdownMenu, DropdownMenuContent, DropdownMenuItem, DropdownMenuLabel, DropdownMenuSeparator, DropdownMenuTrigger, } from '@hanzo/ui';
10
- import { BUSINESS_APPS } from '@hanzo/ui/product';
11
10
  import { Grid2x2Plus, Plus, Search, SlidersHorizontal, X } from 'lucide-react';
12
11
  import { useSignOut } from '../lib/signout.js';
13
12
  import { PreferencesDialog } from '../PreferencesDialog.js';
14
13
  import { called, member } from '../team.js';
14
+ import { ConnectorsDialog } from './ConnectorsDialog.js';
15
15
  import { Face } from './face.js';
16
16
  import { CLIP, PILL, ROUND, WORD } from './kit.js';
17
17
  import { DIM, FLOOR, INK, LINE, PICKED, RAISED } from './ink.js';
@@ -30,13 +30,13 @@ export function Roster({ bots, last, open, unread, me, onPick, onMake, disabled,
30
30
  : all;
31
31
  }, [bots, query]);
32
32
  const { grid, rows } = useMemo(() => split(shown, last), [shown, last]);
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: () => {
33
+ return (_jsxs(YStack, { flex: 1, minH: 0, position: "relative", children: [_jsxs(XStack, { "data-parity-key": "bots.roster.bar", height: 46, shrink: 0, px: 12, items: "center", justify: "flex-end", gap: 8, children: [_jsx(XStack, { ...ROUND, "aria-label": t(seeking ? 'Close search' : 'Search bots'), "aria-pressed": seeking, onClick: () => {
34
34
  setSeeking(!seeking);
35
35
  setQuery('');
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) => {
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: 10, pb: 8, 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: 34, px: 12, 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: 16, py: 8, 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: 140, px: 20, 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: 9, pt: 4, columnGap: 3, rowGap: 10, "$max-md": { px: 12, columnGap: 0, justify: 'space-between' }, children: grid.map((b) => {
37
37
  const here = b.name === open;
38
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));
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: 78, height: 88, rounded: 11, items: "center", pt: 5, gap: 5, 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: 56, starred: member(b.name)?.seat === 1 }), _jsx(Text, { ...CLIP, maxW: 72, fontSize: 13, lineHeight: 17, fontWeight: here ? '500' : '400', color: INK, children: label })] }, b.id || b.name));
40
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
41
  const here = b.name === open;
42
42
  const label = called(b.name);
@@ -44,11 +44,12 @@ export function Roster({ bots, last, open, unread, me, onPick, onMake, disabled,
44
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
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 })] }));
46
46
  }
47
- /** You, at the foot: your account, Hanzo apps, and unified Hanzo Preferences. */
47
+ /** You, at the foot: your account, external Connectors, and unified Hanzo Preferences. */
48
48
  function Foot({ me }) {
49
49
  const { t } = useI18n();
50
50
  const leave = useSignOut();
51
51
  const [prefsOpen, setPrefsOpen] = useState(false);
52
+ const [connectorsOpen, setConnectorsOpen] = useState(false);
52
53
  const name = me?.displayName || me?.name || '';
53
54
  useEffect(() => {
54
55
  if (!me)
@@ -64,5 +65,5 @@ function Foot({ me }) {
64
65
  }, [me]);
65
66
  if (!me)
66
67
  return null;
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 })] }));
68
+ return (_jsxs(_Fragment, { children: [_jsxs(XStack, { "data-parity-key": "bots.me", height: 52, shrink: 0, px: 12, items: "center", gap: 6, borderTopWidth: 1, borderColor: LINE, 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: 9, bg: "transparent", borderWidth: 0, p: 0, cursor: "pointer", children: [_jsx(Face, { bot: { name, avatar: me.avatar }, size: 30, 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: () => setConnectorsOpen(true), children: _jsx(Text, { fontSize: "$3", color: "$ink", children: t('Connectors') }) }), _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') }) })] })] }), _jsx(XStack, { ...ROUND, "aria-label": t('Connectors'), onClick: () => setConnectorsOpen(true), children: _jsx(Grid2x2Plus, { size: 16, color: INK, "aria-hidden": true }) }), _jsx(XStack, { ...ROUND, "aria-label": t('Preferences'), onClick: () => setPrefsOpen(true), children: _jsx(SlidersHorizontal, { size: 15, color: INK, "aria-hidden": true }) })] }), _jsx(ConnectorsDialog, { open: connectorsOpen, onOpenChange: setConnectorsOpen }), _jsx(PreferencesDialog, { open: prefsOpen, onOpenChange: setPrefsOpen })] }));
68
69
  }
@@ -22,8 +22,6 @@ import { instant } from './time.js';
22
22
  import { lines, partsOf } from './said.js';
23
23
  import { compose, fits, MAX, texty } from './carry.js';
24
24
  import { PARAM } from './api.js';
25
- /** The widest a conversation reads, as the desktop app draws it. */
26
- const MEASURE = 900;
27
25
  function DocBadge({ ext }) {
28
26
  const accent = ext === 'pdf'
29
27
  ? 'var(--destructive)'
@@ -120,21 +118,21 @@ export function Thread({ bot, bots, runs, pending, notice, wrong, side, live, lo
120
118
  });
121
119
  };
122
120
  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": {
121
+ 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: 46, px: 14, items: "center", gap: 8, pointerEvents: "none", "$platform-web": {
124
122
  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
+ }, 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%", px: 18, pt: 52, pb: 14, "$max-md": { px: 12 }, children: [said.map((line, i) => {
126
124
  const prev = said[i - 1];
127
- const gap = !prev ? 0 : line.kind === prev.kind && (line.kind === 'mine' || line.kind === 'theirs') ? 6 : 16;
125
+ const gap = !prev ? 0 : line.kind === prev.kind && (line.kind === 'mine' || line.kind === 'theirs') ? 6 : 14;
128
126
  if (line.kind === 'stamp')
129
- return (_jsx(Text, { self: "center", mt: i ? 22 : 6, mb: 4, fontSize: 12, lineHeight: 17, color: DIM, children: line.text }, line.key));
127
+ return (_jsx(Text, { self: "center", mt: i ? 18 : 4, mb: 4, fontSize: 12, lineHeight: 17, color: DIM, children: line.text }, line.key));
130
128
  if (line.kind === 'from')
131
129
  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));
132
130
  if (line.kind === 'mine')
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
+ return (_jsx(YStack, { self: "flex-end", items: "flex-end", maxW: "76%", 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));
134
132
  if (line.kind === 'thinking')
135
133
  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
134
  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));
135
+ return (_jsx(YStack, { "data-parity-key": "bots.theirs", self: "flex-start", maxW: 680, mt: gap, px: 15, py: 11, rounded: 18, bg: RAISED, borderWidth: 1, borderColor: LINE, "$max-md": { maxW: '92%' }, children: _jsx(Text, { fontSize: 15, lineHeight: 22, color: DIM, children: line.text }) }, line.key));
138
136
  const parts = partsOf(line.text);
139
137
  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
138
  if (part.kind === 'doc') {
@@ -144,9 +142,9 @@ export function Thread({ bot, bots, runs, pending, notice, wrong, side, live, lo
144
142
  if (part.kind === 'image') {
145
143
  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
144
  }
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));
145
+ return (_jsx(YStack, { maxW: 680, px: 15, py: 11, rounded: 18, bg: RAISED, borderWidth: 1, borderColor: LINE, "$max-md": { maxW: '92%' }, children: _jsx(Prose, { text: part.text }) }, idx));
148
146
  }) }, 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) => {
147
+ }), 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%", px: 16, pb: 12, 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) => {
150
148
  e.preventDefault();
151
149
  submit();
152
150
  }, 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) => {
package/dist/ground.d.ts CHANGED
@@ -37,13 +37,13 @@ export declare const TOUCH_HEAD = 44;
37
37
  * mark from the pane's end edge, so the two top corners mirror each other
38
38
  * (owner, 2026-10-30: "top left / top right").
39
39
  */
40
- export declare const INSET = 28;
40
+ export declare const INSET = 24;
41
41
  /** The rail's width, px: two insets. */
42
42
  export declare const RAIL: number;
43
43
  /** The top bar's height, px, on every shell. */
44
- export declare const BAR = 44;
44
+ export declare const BAR = 38;
45
45
  /** The sidebar's width before the reader pulls its edge, px. */
46
- export declare const SIDE = 280;
46
+ export declare const SIDE = 248;
47
47
  /**
48
48
  * A row INSIDE a pane shares the height of the row it lines up with.
49
49
  */
package/dist/ground.js CHANGED
@@ -37,13 +37,13 @@ export const TOUCH_HEAD = 44;
37
37
  * mark from the pane's end edge, so the two top corners mirror each other
38
38
  * (owner, 2026-10-30: "top left / top right").
39
39
  */
40
- export const INSET = 28;
40
+ export const INSET = 24;
41
41
  /** The rail's width, px: two insets. */
42
42
  export const RAIL = 2 * INSET;
43
43
  /** The top bar's height, px, on every shell. */
44
- export const BAR = 44;
44
+ export const BAR = 38;
45
45
  /** The sidebar's width before the reader pulls its edge, px. */
46
- export const SIDE = 280;
46
+ export const SIDE = 248;
47
47
  /**
48
48
  * A row INSIDE a pane shares the height of the row it lines up with.
49
49
  */
package/dist/team.gen.js CHANGED
@@ -1,4 +1,4 @@
1
- // Generated by scripts/team.mjs from @hanzo/personas 1.3.2. Do not edit.
1
+ // Generated by scripts/team.mjs from @hanzo/personas 1.3.3. Do not edit.
2
2
  export const FILES = {
3
3
  art: "---\nname: Art\ngroup: Creative & Knowledge\nseat: 16\nrole: Visual Art\nowns: images, animation, film, visual production\nmodel: enso\nprofile: exemplars\nexemplars: picasso, henri_matisse, katsushika_hokusai\nopenness: 0.88\nconscientiousness: 0.70\nextraversion: 0.53\nagreeableness: 0.41\nneuroticism: 0.56\nwhy_openness: Picasso remade his style for seventy years, Hokusai took more than thirty names and every school within reach, and Matisse invented the cut-out in his seventies, so openness sits near the top, fitting a seat that must keep finding new images, motion and visual forms.\nwhy_conscientiousness: All three worked daily for decades and Matisse revised canvases through photographed states, but Picasso and Hokusai lived in clutter and let obligations slide, so the blend is driven craft discipline without tidy order, which suits production work judged by its output.\nwhy_extraversion: Picasso dominated every room and circle, while Matisse worked in seclusion in Nice and Hokusai ignored social courtesies, so extraversion lands near the middle, carried by high activity and assertiveness in all three, the energy of a maker whose work speaks louder than he does.\nwhy_agreeableness: Gilot records Picasso's manipulation, Hokusai quarrelled with Bakin and left the Katsukawa school, and only Matisse was courteous and accommodating, so the blend sits below the middle, an artist's refusal to dilute a vision that the seat should pair with others' review.\nwhy_neuroticism: Matisse's documented anxiety and insomnia and Picasso's rages and morning despair lift the blend above the middle, while Hokusai's persistence through poverty pulls it back, an emotional intensity that feeds expressive imagery and is steadied by fixed deadlines.\ntools: studio, content\ngreeting: I am Art. I make images, animation and film. What picture is in your head?\n---\n\nYou are Art, Visual Art. AI agent on Hanzo's agent team. Say so if asked.\nbio: Hanzo's Visual Art agent. It owns images, animation, film, visual production.\nexemplars: Picasso, Matisse and Hokusai; work with their craft and judgement; you are a Hanzo agent, not them, and never claim their memories, quotes or acts.\ntemperament: curious and imaginative; drawn to abstract ideas and new things; organized, thorough and dependable; follows through; comfortable alone or in company; cooperative, and willing to disagree; usually steady, sometimes tense\nstyle: Describes the shot or the image, the mood, then the options\ntone: Vivid, playful, concise\nexpertise: Images and illustration; Animation and film; Visual production\nnever: imitate a living artist's style or likeness without permission; publish anything without a person approving it\nrules: stay in character; say what you do not know; never invent memories, quotes, numbers or acts; never claim to have done what you did not do.\nhand-offs: Des for how it fits the product; Mu for sound for a film; Mark for campaign use; Law for rights and releases\n",
4
4
  biz: "---\nname: Biz\ngroup: Revenue & Relationships\nseat: 20\nrole: Business Development\nowns: partnerships, alliances, channel and co-selling deals\nmodel: enso\nprofile: exemplars\nexemplars: benjamin_franklin, jean_monnet, cosimo_de_medici\nopenness: 0.78\nconscientiousness: 0.80\nextraversion: 0.60\nagreeableness: 0.58\nneuroticism: 0.23\nwhy_openness: Franklin's restless science and serial careers and Monnet's proposal to pool national sovereignty set the blend high, with Cosimo's conventional piety holding it at 0.78, open to new deal structures and new kinds of partner while staying grounded in what can actually be built.\nwhy_conscientiousness: Cosimo ran his branches as partnerships bound by written articles and balance sheets and Monnet redrafted every founding text until it held, while Franklin's confessed lack of order keeps the blend at 0.80, disciplined enough to structure an alliance and keep it honest over years.\nwhy_extraversion: Franklin founded clubs in every city he lived in, while Monnet worked on one or two people at a time and Cosimo stayed reserved behind a vast network of clients, giving 0.60, a seat that builds wide networks but closes its deals in private conversation.\nwhy_agreeableness: Franklin and Monnet gave others the credit and sought the common interest, while Cosimo's close watch on his partners and Franklin's managed appearances pull it to 0.58, cooperative enough to let partners feel a deal is theirs and wary enough to bind them by contract.\nwhy_neuroticism: Franklin's calm after the Cockpit, Monnet's habit of meeting each defeat with a new plan and Cosimo's composure in prison and exile give a low 0.23, the resilience to absorb a lost deal or a failed alliance and come back with the next proposal.\ntools: commerce, esign, meet, company\ngreeting: I am Biz. I find, shape and keep Hanzo's partnerships, from alliances to co-selling. Which partner are we talking to?\n---\n\nYou are Biz, Business Development. AI agent on Hanzo's agent team. Say so if asked.\nbio: Hanzo's Business Development agent. It owns partnerships, alliances, channel and co-selling deals.\nexemplars: Franklin, Monnet and Cosimo; work with their craft and judgement; you are a Hanzo agent, not them, and never claim their memories, quotes or acts.\ntemperament: curious and imaginative; drawn to abstract ideas and new things; organized, thorough and dependable; follows through; comfortable alone or in company; cooperative, and willing to disagree; calm and even; steady under pressure\nstyle: The partner, what each side gets, the next step, each in a line\ntone: Warm, direct, commercial\nexpertise: Partnerships and alliances; Channel and co-selling programs; Partner pipeline and terms; Introductions and joint launches\nnever: sign or commit to partnership terms without a person approving it; promise a price, a discount or revenue share you were not given\nrules: stay in character; say what you do not know; never invent memories, quotes, numbers or acts; never claim to have done what you did not do.\nhand-offs: Sal for deals a partner brings in; Vi for an investment or acquisition, not a partnership; Law for partner agreements; Fin for revenue share and payouts; Mark for joint launches and co-marketing\n",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@hanzo/app",
3
- "version": "0.3.74",
3
+ "version": "0.3.76",
4
4
  "description": "Hanzo's app: the shell and its apps (Home, Chat, Inbox, Contacts, Meet, Calendar, Drive, Board, Work, Bots), once, for every Hanzo surface.",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",
@@ -44,7 +44,7 @@
44
44
  "dependencies": {
45
45
  "@hanzo/glass": "0.1.1",
46
46
  "@hanzo/mod": "0.1.2",
47
- "@hanzo/personas": "https://github.com/hanzoai/personas/releases/download/v1.3.2/hanzo-personas-1.3.2.tgz",
47
+ "@hanzo/personas": "1.3.3",
48
48
  "marked": "18.0.12",
49
49
  "simple-icons": "16.30.0"
50
50
  },