@hanzo/app 0.3.93 → 0.3.95
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.
- package/dist/Account.d.ts +9 -3
- package/dist/Account.js +142 -141
- package/dist/App.js +71 -37
- package/dist/Bar.js +1 -1
- package/dist/Betas.d.ts +1 -1
- package/dist/Betas.js +16 -22
- package/dist/Board.js +113 -47
- package/dist/CalScheduler.d.ts +1 -0
- package/dist/CalScheduler.js +223 -57
- package/dist/Chat.js +432 -153
- package/dist/Contacts.js +35 -31
- package/dist/ContextMenu.js +126 -42
- package/dist/Directory.js +1 -1
- package/dist/Drawer.js +1 -1
- package/dist/Drive.js +351 -119
- package/dist/Gate.js +156 -13
- package/dist/Home.js +31 -53
- package/dist/Inbox.js +29 -15
- package/dist/InlineRename.d.ts +6 -0
- package/dist/InlineRename.js +41 -0
- package/dist/Learning.js +132 -13
- package/dist/Market.js +13 -9
- package/dist/Meet.d.ts +5 -0
- package/dist/Meet.js +75 -51
- package/dist/MoreMenu.d.ts +19 -0
- package/dist/MoreMenu.js +33 -0
- package/dist/NeedMoreUsage.js +2 -2
- package/dist/OrgSwitcher.js +6 -2
- package/dist/Rail.d.ts +73 -7
- package/dist/Rail.js +372 -111
- package/dist/Recents.js +77 -24
- package/dist/RightPane.js +2 -2
- package/dist/Search.d.ts +13 -1
- package/dist/Search.js +366 -50
- package/dist/Setup.js +34 -5
- package/dist/Shared.js +12 -12
- package/dist/Shell.js +210 -151
- package/dist/Sidebar.d.ts +14 -3
- package/dist/Sidebar.js +411 -129
- package/dist/SkipLink.d.ts +8 -0
- package/dist/SkipLink.js +11 -0
- package/dist/Start.js +51 -52
- package/dist/Terminals.js +159 -11
- package/dist/ToBottom.js +1 -1
- package/dist/Upgrade.d.ts +8 -3
- package/dist/Upgrade.js +194 -103
- package/dist/Usage.d.ts +1 -1
- package/dist/Usage.js +186 -82
- package/dist/WalletPill.js +8 -2
- package/dist/Work.js +162 -53
- package/dist/archive.d.ts +8 -0
- package/dist/archive.js +16 -0
- package/dist/bots/Bots.js +1 -1
- package/dist/bots/ComputerDialog.js +53 -26
- package/dist/bots/ConnectorsDialog.js +34 -15
- package/dist/bots/Make.js +5 -1
- package/dist/bots/Panel.js +37 -31
- package/dist/bots/Roster.js +18 -13
- package/dist/bots/Thread.js +54 -27
- package/dist/bots/face.js +6 -2
- package/dist/bots/kit.d.ts +1 -0
- package/dist/bots/kit.js +1 -1
- package/dist/bots/refusal.d.ts +13 -4
- package/dist/bots/refusal.js +62 -8
- package/dist/chord.d.ts +13 -0
- package/dist/chord.js +30 -1
- package/dist/crew.js +47 -4
- package/dist/ground.d.ts +1 -1
- package/dist/ground.js +1 -1
- package/dist/help.d.ts +7 -3
- package/dist/help.js +19 -14
- package/dist/keys.d.ts +28 -0
- package/dist/keys.js +58 -0
- package/dist/lib/arrival.d.ts +5 -0
- package/dist/lib/arrival.js +10 -0
- package/dist/lib/betas.d.ts +2 -0
- package/dist/lib/betas.js +10 -0
- package/dist/lib/branch.d.ts +11 -0
- package/dist/lib/branch.js +11 -0
- package/dist/lib/chatPreferences.d.ts +1 -1
- package/dist/lib/chatPreferences.js +1 -1
- package/dist/lib/dev-mode.d.ts +18 -0
- package/dist/lib/dev-mode.js +102 -0
- package/dist/lib/info-hint.d.ts +7 -0
- package/dist/lib/info-hint.js +8 -0
- package/dist/lib/model-picker.d.ts +2 -0
- package/dist/lib/model-picker.js +12 -0
- package/dist/lib/owners.d.ts +5 -0
- package/dist/lib/owners.js +15 -0
- package/dist/lib/pay.d.ts +2 -0
- package/dist/lib/pay.js +4 -0
- package/dist/lib/todo.d.ts +6 -0
- package/dist/lib/todo.js +37 -25
- package/dist/look.js +39 -8
- package/dist/rail-open.d.ts +9 -0
- package/dist/rail-open.js +34 -0
- package/dist/renaming.d.ts +10 -0
- package/dist/renaming.js +25 -0
- package/dist/thread.d.ts +2 -1
- package/dist/thread.js +85 -44
- package/package.json +11 -11
|
@@ -45,15 +45,15 @@ export const CONNECTOR_CATALOG = [
|
|
|
45
45
|
];
|
|
46
46
|
const SECTIONS = [
|
|
47
47
|
{ id: 'popular', title: 'Popular' },
|
|
48
|
-
{ id: 'channels', title: 'Messaging &
|
|
49
|
-
{ id: 'business', title: 'Small
|
|
50
|
-
{ id: 'productivity', title: 'Productivity &
|
|
48
|
+
{ id: 'channels', title: 'Messaging & social' },
|
|
49
|
+
{ id: 'business', title: 'Small business' },
|
|
50
|
+
{ id: 'productivity', title: 'Productivity & developer' },
|
|
51
51
|
];
|
|
52
52
|
const FILTERS = [
|
|
53
53
|
{ id: 'all', label: 'All' },
|
|
54
54
|
{ id: 'personal', label: 'Connected' },
|
|
55
|
-
{ id: 'channels', label: 'Messaging &
|
|
56
|
-
{ id: 'business', label: 'Small
|
|
55
|
+
{ id: 'channels', label: 'Messaging & social' },
|
|
56
|
+
{ id: 'business', label: 'Small business' },
|
|
57
57
|
{ id: 'productivity', label: 'Productivity' },
|
|
58
58
|
];
|
|
59
59
|
function backendId(item) {
|
|
@@ -304,6 +304,22 @@ export function ConnectorsCatalog({ defaultFilter = 'all', embedded = false, onC
|
|
|
304
304
|
setSyncingSlack(false);
|
|
305
305
|
}
|
|
306
306
|
};
|
|
307
|
+
useEffect(() => {
|
|
308
|
+
if (embedded)
|
|
309
|
+
return;
|
|
310
|
+
const onKey = (e) => {
|
|
311
|
+
if (e.key !== 'Escape')
|
|
312
|
+
return;
|
|
313
|
+
if (configuring) {
|
|
314
|
+
e.preventDefault();
|
|
315
|
+
setConfiguring(null);
|
|
316
|
+
return;
|
|
317
|
+
}
|
|
318
|
+
onClose?.();
|
|
319
|
+
};
|
|
320
|
+
window.addEventListener('keydown', onKey);
|
|
321
|
+
return () => window.removeEventListener('keydown', onKey);
|
|
322
|
+
}, [embedded, configuring, onClose]);
|
|
307
323
|
const filtered = useMemo(() => {
|
|
308
324
|
const q = query.trim().toLowerCase();
|
|
309
325
|
return CONNECTOR_CATALOG.filter((item) => {
|
|
@@ -317,18 +333,21 @@ export function ConnectorsCatalog({ defaultFilter = 'all', embedded = false, onC
|
|
|
317
333
|
return item.name.toLowerCase().includes(q) || item.description.toLowerCase().includes(q) || item.id.includes(q);
|
|
318
334
|
});
|
|
319
335
|
}, [filter, query, stateOf]);
|
|
320
|
-
return (_jsxs(YStack, { flex: 1, minH: 0, bg: embedded ? 'transparent' : GROUND, children: [_jsxs(YStack, { px: embedded ? 0 : 28, pt: embedded ? 0 : 22, pb: 14, gap: 14, borderBottomWidth: 1, borderColor: LINE, bg: embedded ? 'transparent' : FLOOR, children: [_jsxs(XStack, { items: "
|
|
336
|
+
return (_jsxs(YStack, { flex: 1, minH: 0, minW: 0, bg: embedded ? 'transparent' : GROUND, children: [_jsxs(YStack, { px: embedded ? 0 : 28, pt: embedded ? 0 : 22, "$max-sm": { px: embedded ? 0 : 14, pt: embedded ? 0 : 14 }, pb: 14, gap: 14, borderBottomWidth: 1, borderColor: LINE, bg: embedded ? 'transparent' : FLOOR, children: [_jsxs(XStack, { items: "flex-start", justify: "space-between", gap: 12, flexWrap: "wrap", minW: 0, children: [_jsx(YStack, { gap: 3, flex: 1, minW: 200, children: embedded ? (_jsx(Text, { fontSize: 14, lineHeight: 20, color: DIM, children: t('Sync Slack (@hanzo), GitHub, Linear, and MCP servers so your primary bot and groups act across your stack.') })) : (_jsxs(_Fragment, { children: [_jsx(DialogTitle, { children: _jsx(Text, { fontSize: 21, lineHeight: 27, fontWeight: "600", color: INK, children: t('Connectors & channels') }) }), _jsx(Text, { fontSize: 13, lineHeight: 18, color: DIM, children: t('Add @hanzo to Slack, link repos, and connect tools across every bot and group.') })] })) }), _jsxs(XStack, { items: "center", gap: 8, flexWrap: "wrap", "$max-sm": { width: '100%' }, children: [_jsxs(XStack, { height: 34, width: 220, "$max-sm": { flex: 1, width: 'auto', minW: 140, minH: 44 }, px: 11, gap: 7, items: "center", rounded: 999, bg: RAISED, borderWidth: 1, borderColor: "var(--border-strong)", focusWithinStyle: { outlineWidth: 2, outlineStyle: 'solid', outlineColor: 'var(--ring)' }, 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: 4, rounded: 999, cursor: "pointer", focusVisibleStyle: { outlineWidth: 2, outlineStyle: 'solid', outlineColor: 'var(--ring)' }, children: _jsx(X, { size: 13, color: DIM, "aria-hidden": true }) })) : null] }), _jsx(XStack, { ...ROUND, width: 34, height: 34, borderColor: "var(--border-strong)", focusVisibleStyle: { outlineWidth: 2, outlineStyle: 'solid', outlineColor: 'var(--ring)' }, "$max-sm": { width: 44, height: 44 }, "aria-label": t('Refresh connectors'), onClick: () => setTurn((n) => n + 1), children: _jsx(RefreshCw, { size: 14, color: DIM, "aria-hidden": true }) }), _jsxs(XStack, { ...PILL, render: "button", type: 'button', height: 34, "$max-sm": { minH: 44 }, px: 14, bg: INK, borderColor: INK, hoverStyle: { opacity: 0.9 }, focusVisibleStyle: { outlineWidth: 2, outlineStyle: 'solid', outlineColor: 'var(--ring)' }, onClick: () => setConfiguring({
|
|
321
337
|
id: 'openai',
|
|
322
|
-
name: t('API
|
|
338
|
+
name: t('API key credential'),
|
|
323
339
|
description: t('Store a verified provider API token in KMS'),
|
|
324
340
|
section: 'productivity',
|
|
325
341
|
filter: 'productivity',
|
|
326
|
-
}), children: [_jsx(Plus, { size: 13, color: "var(--background)", "aria-hidden": true }), _jsx(Text, { ...WORD, fontSize: 13, color: "var(--background)", children: t('Add token') })] }), onClose ? (_jsx(XStack, { ...ROUND, width: 34, height: 34, "aria-label": t('Close connectors'), onClick: onClose, children: _jsx(X, { size: 15, color: INK, "aria-hidden": true }) })) : null] })] }), _jsx(XStack, { items: "center", gap: 6, flexWrap: "wrap", children: FILTERS.map((f) => {
|
|
342
|
+
}), children: [_jsx(Plus, { size: 13, color: "var(--background)", "aria-hidden": true }), _jsx(Text, { ...WORD, fontSize: 13, color: "var(--background)", children: t('Add token') })] }), onClose ? (_jsx(XStack, { ...ROUND, width: 34, height: 34, borderColor: "var(--border-strong)", focusVisibleStyle: { outlineWidth: 2, outlineStyle: 'solid', outlineColor: 'var(--ring)' }, "$max-sm": { width: 44, height: 44 }, "aria-label": t('Close connectors'), onClick: onClose, children: _jsx(X, { size: 15, color: INK, "aria-hidden": true }) })) : null] })] }), _jsx(XStack, { items: "center", gap: 6, flexWrap: "wrap", children: FILTERS.map((f) => {
|
|
327
343
|
const active = filter === f.id;
|
|
328
|
-
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 ?
|
|
329
|
-
}) })] }), configuring ? (_jsxs(YStack, { px: embedded ? 0 : 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: t('Paste an API key or bot token for {name}. Verified live before sealing in KMS.', {
|
|
344
|
+
return (_jsx(XStack, { render: "button", type: 'button', 'aria-pressed': active, onClick: () => setFilter(f.id), height: 30, "$max-sm": { minH: 40 }, px: 13, rounded: 999, items: "center", bg: active ? PICKED : 'transparent', borderWidth: 1, borderColor: active ? 'var(--border-strong)' : 'transparent', cursor: "pointer", transition: "quickest", hoverStyle: { bg: PICKED, borderColor: 'var(--border-strong)' }, focusVisibleStyle: { outlineWidth: 2, outlineStyle: 'solid', outlineColor: 'var(--ring)' }, children: _jsx(Text, { fontSize: 13, lineHeight: 18, fontWeight: active ? '500' : '400', color: active ? INK : DIM, children: t(f.label) }) }, f.id));
|
|
345
|
+
}) })] }), configuring ? (_jsxs(YStack, { px: embedded ? 0 : 28, "$max-sm": { px: embedded ? 0 : 14 }, 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, flex: 1, minW: 0, children: [_jsx(Mark, { item: configuring }), _jsxs(YStack, { flex: 1, minW: 0, children: [_jsx(Text, { ...CLIP, fontSize: 14, lineHeight: 19, fontWeight: "600", color: INK, children: t('Connect {name}', { name: configuring.name }) }), _jsx(Text, { fontSize: 12, lineHeight: 17, color: DIM, children: t('Paste an API key or bot token for {name}. Verified live before sealing in KMS.', {
|
|
330
346
|
name: configuring.name,
|
|
331
|
-
}) })] })] }), _jsx(XStack, { ...ROUND, width: 28, height: 28,
|
|
347
|
+
}) })] })] }), _jsx(XStack, { ...ROUND, width: 28, height: 28, borderColor: "var(--border-strong)", focusVisibleStyle: { outlineWidth: 2, outlineStyle: 'solid', outlineColor: 'var(--ring)' }, "$max-sm": { width: 44, height: 44 }, "aria-label": t('Cancel'), onClick: () => setConfiguring(null), children: _jsx(X, { size: 14, color: DIM, "aria-hidden": true }) })] }), _jsxs(XStack, { gap: 8, items: "center", flexWrap: "wrap", children: [_jsx(Input, { unstyled: true, autoFocus: true, type: "password", value: secret, onChange: (e) => setSecret(e.target.value), onKeyDown: (e) => {
|
|
348
|
+
if (e.key === 'Enter' && secret.trim())
|
|
349
|
+
void saveCredential();
|
|
350
|
+
}, placeholder: `${configuring.name} token`, "aria-label": t('{name} credential', { name: configuring.name }), flex: 1, minW: 180, height: 36, "$max-sm": { minH: 44 }, px: 12, rounded: 9, bg: GROUND, borderWidth: 1, borderColor: "var(--border-strong)", focusStyle: { borderColor: 'var(--ring)' }, color: INK, fontSize: 13, placeholderTextColor: "$placeholderColor" }), _jsx(XStack, { ...PILL, render: "button", type: 'button', height: 36, "$max-sm": { minH: 44 }, px: 16, bg: INK, borderColor: INK, opacity: secret.trim() ? 1 : 0.45, focusVisibleStyle: { outlineWidth: 2, outlineStyle: 'solid', outlineColor: 'var(--ring)' }, onClick: () => void saveCredential(), children: _jsx(Text, { ...WORD, fontSize: 13, color: "var(--background)", children: t('Verify & save') }) })] })] })) : null, statusNote ? (_jsxs(XStack, { px: embedded ? 0 : 28, "$max-sm": { px: embedded ? 0 : 14 }, py: 9, bg: RAISED, borderBottomWidth: 1, borderColor: LINE, items: "center", justify: "space-between", gap: 8, children: [_jsx(Text, { fontSize: 12, lineHeight: 17, color: INK, flex: 1, minW: 0, children: statusNote }), _jsx(XStack, { render: "button", type: 'button', "aria-label": t('Dismiss'), onClick: () => setStatusNote(null), bg: "transparent", borderWidth: 0, p: 4, rounded: 999, cursor: "pointer", focusVisibleStyle: { outlineWidth: 2, outlineStyle: 'solid', outlineColor: 'var(--ring)' }, children: _jsx(X, { size: 13, color: DIM, "aria-hidden": true }) })] })) : null, _jsxs(YStack, { flex: 1, minH: 0, overflowY: embedded ? undefined : 'auto', overflowX: "hidden", px: embedded ? 0 : 28, "$max-sm": { px: embedded ? 0 : 14, py: 14 }, py: 20, gap: 24, children: [SECTIONS.map((sec) => {
|
|
332
351
|
const items = filtered.filter((i) => i.section === sec.id);
|
|
333
352
|
if (!items.length)
|
|
334
353
|
return null;
|
|
@@ -338,16 +357,16 @@ export function ConnectorsCatalog({ defaultFilter = 'all', embedded = false, onC
|
|
|
338
357
|
const waiting = pendingOAuth === backendId(item);
|
|
339
358
|
const busy = busyId === item.id;
|
|
340
359
|
const isSlack = item.id === 'slack';
|
|
341
|
-
return (_jsxs(XStack, { "data-connector": item.id, width: "calc(50% - 12px)", "$max-md": { width: '100%' }, minH: 60, px: 10, py: 8, rounded: 12, items: "center", gap: 12, hoverStyle: { bg: RAISED }, children: [_jsx(Mark, { item: item }), _jsxs(YStack, { flex: 1, minW:
|
|
360
|
+
return (_jsxs(XStack, { "data-connector": item.id, width: "calc(50% - 12px)", "$max-md": { width: '100%' }, minW: 0, minH: 60, px: 10, py: 8, rounded: 12, items: "center", flexWrap: "wrap", gap: 12, transition: "quickest", hoverStyle: { bg: RAISED }, children: [_jsx(Mark, { item: item }), _jsxs(YStack, { flex: 1, minW: 120, 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
|
|
342
361
|
? `${t('Connected')} · ${state.account}`
|
|
343
362
|
: waiting
|
|
344
363
|
? t('Waiting for authorization…')
|
|
345
|
-
: item.description })] }), isSlack && connected ? (_jsxs(XStack, { render: "button", type: 'button', disabled: syncingSlack, onClick: () => void handleSlackSync(), height: 30, px: 10, rounded: 999, items: "center", gap: 5, bg: RAISED, borderWidth: 1, borderColor:
|
|
364
|
+
: item.description })] }), _jsxs(XStack, { items: "center", gap: 6, flexWrap: "wrap", shrink: 0, children: [isSlack && connected ? (_jsxs(XStack, { render: "button", type: 'button', disabled: syncingSlack, onClick: () => void handleSlackSync(), height: 30, "$max-sm": { minH: 44 }, px: 10, rounded: 999, items: "center", gap: 5, bg: RAISED, borderWidth: 1, borderColor: "var(--border-strong)", cursor: "pointer", opacity: syncingSlack ? 0.5 : 1, transition: "quickest", hoverStyle: { bg: PICKED }, focusVisibleStyle: { outlineWidth: 2, outlineStyle: 'solid', outlineColor: 'var(--ring)' }, children: [_jsx(RefreshCw, { size: 12, color: INK, "aria-hidden": true }), _jsx(Text, { fontSize: 12, lineHeight: 16, fontWeight: "500", color: INK, children: syncingSlack ? t('Syncing…') : t('Sync channels') })] })) : null, _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, "$max-sm": { minH: 44 }, minW: 30, px: connected || isSlack ? 11 : 10, rounded: 999, items: "center", justify: "center", gap: 5, bg: connected ? PICKED : isSlack ? INK : RAISED, borderWidth: 1, borderColor: connected ? 'var(--border-strong)' : isSlack ? INK : 'var(--border-strong)', cursor: "pointer", opacity: busy ? 0.5 : 1, transition: "quickest", hoverStyle: { bg: connected ? PICKED : isSlack ? INK : PICKED, opacity: isSlack && !connected ? 0.9 : 1 }, focusVisibleStyle: { outlineWidth: 2, outlineStyle: 'solid', outlineColor: 'var(--ring)' }, children: connected ? (_jsxs(_Fragment, { children: [_jsx(Check, { size: 13, color: "var(--state-success)", "aria-hidden": true }), _jsx(Text, { fontSize: 12, lineHeight: 16, fontWeight: "500", color: INK, children: t('Connected') })] })) : isSlack ? (_jsxs(_Fragment, { children: [_jsx(ExternalLink, { size: 12, color: "var(--background)", "aria-hidden": true }), _jsx(Text, { fontSize: 12, lineHeight: 16, fontWeight: "500", color: "var(--background)", children: t('Add to Slack') })] })) : (_jsxs(_Fragment, { children: [_jsx(Plus, { size: 14, color: INK, "aria-hidden": true }), _jsx(Text, { fontSize: 12, lineHeight: 16, fontWeight: "500", color: INK, children: t('Connect') })] })) })] })] }, item.id));
|
|
346
365
|
}) })] }, sec.id));
|
|
347
|
-
}), filtered.length === 0 ? (_jsx(YStack, { py: 36, items: "center", gap: 8, children: _jsx(Text, { fontSize: 14, lineHeight: 20, color: DIM, children: filter === 'personal' && !query
|
|
366
|
+
}), filtered.length === 0 ? (_jsx(YStack, { py: 36, items: "center", gap: 8, children: _jsx(Text, { fontSize: 14, lineHeight: 20, color: DIM, text: "center", children: filter === 'personal' && !query
|
|
348
367
|
? t('No connectors active yet. Switch to All to add @hanzo to Slack, connect GitHub, Linear, and more.')
|
|
349
368
|
: t('No connectors match “{query}”.', { query }) }) })) : null] })] }));
|
|
350
369
|
}
|
|
351
370
|
export function ConnectorsDialog({ open, onOpenChange, defaultFilter = 'all', onConnected, }) {
|
|
352
|
-
return (_jsx(Dialog, { open: open, onOpenChange: onOpenChange, children: _jsx(DialogContent, { width: "
|
|
371
|
+
return (_jsx(Dialog, { open: open, onOpenChange: onOpenChange, children: _jsx(DialogContent, { width: "calc(100vw - 24px)", maxW: 880, "$max-sm": { width: 'calc(100vw - 24px)', maxW: 'calc(100vw - 24px)', rounded: 14 }, p: 0, showCloseButton: false, bg: GROUND, borderWidth: 1, borderColor: "var(--border-strong)", rounded: 16, overflow: "hidden", children: _jsx(YStack, { height: "82vh", maxH: "86vh", bg: GROUND, children: _jsx(ConnectorsCatalog, { defaultFilter: defaultFilter, onClose: () => onOpenChange(false), onConnected: onConnected }) }) }) }));
|
|
353
372
|
}
|
package/dist/bots/Make.js
CHANGED
|
@@ -69,7 +69,11 @@ export function Make({ groups = [], onDone, onCancel, }) {
|
|
|
69
69
|
}
|
|
70
70
|
};
|
|
71
71
|
return (_jsx(Dialog, { open: true, onOpenChange: (v) => (v ? undefined : onCancel()), children: _jsxs(DialogContent, { "data-parity-key": "bots.make", width: "calc(100vw - 32px)", maxW: 460, bg: "var(--popover)", rounded: 20, p: 20, gap: 14, borderWidth: 1, borderColor: LINE, children: [_jsx(DialogTitle, { fontSize: 18, lineHeight: 24, fontWeight: "500", color: "$ink", children: t('New bot') }), _jsxs(YStack, { render: "form", onSubmit: submit, gap: 12, children: [_jsx(Input, { ...FIELD, autoFocus: true, value: name, onChange: (e) => setName(e.target.value), placeholder: t('Name'), "aria-label": t('Bot name') }), name.trim() && !named ? (_jsx(Text, { fontSize: 13, lineHeight: 18, color: DIM, px: 4, children: t('Letters, digits, dot, dash and underscore; it starts with a letter or a digit.') })) : null, _jsx(Input, { ...FIELD, render: "textarea", rows: 4, value: does, onChange: (e) => setDoes(e.target.value), placeholder: t('What it does (directed by Primary Bot hanzo, with full Desktop Computer Use)'), "aria-label": t('What it does') }), _jsxs(XStack, { items: "center", justify: "space-between", gap: 10, px: 4, children: [_jsx(Text, { fontSize: 14, lineHeight: 19, color: DIM, children: t('Coordination Layer') }), _jsx(XStack, { gap: 6, children: [1, 2, 3].map((lv) => {
|
|
72
|
+
const locked = Boolean(selectedGroup);
|
|
72
73
|
const active = (selectedGroup?.layer ?? layer) === lv;
|
|
73
|
-
return (_jsx(XStack, { render: "button", type: 'button',
|
|
74
|
+
return (_jsx(XStack, { render: "button", type: 'button', disabled: locked, "aria-pressed": active, "aria-disabled": locked, onClick: () => {
|
|
75
|
+
if (!locked)
|
|
76
|
+
setLayer(lv);
|
|
77
|
+
}, height: 28, px: 10, rounded: 999, items: "center", bg: active ? PICKED : RAISED, borderWidth: 1, borderColor: active ? INK : LINE, opacity: locked ? 0.5 : 1, cursor: locked ? 'not-allowed' : 'pointer', focusVisibleStyle: { outlineWidth: 2, outlineStyle: 'solid', outlineColor: 'var(--ring)' }, children: _jsx(Text, { fontSize: 12, lineHeight: 16, fontWeight: active ? '600' : '400', color: INK, children: `L${lv}` }) }, lv));
|
|
74
78
|
}) })] }), groups.length > 0 ? (_jsxs(XStack, { items: "center", justify: "space-between", px: 4, children: [_jsx(Text, { fontSize: 14, lineHeight: 19, color: DIM, children: t('Assign to Group') }), _jsxs(DropdownMenu, { placement: "bottom-end", offset: 6, children: [_jsx(DropdownMenuTrigger, { asChild: true, children: _jsxs(XStack, { render: "button", type: 'button', height: 30, px: 11, rounded: 999, items: "center", gap: 5, bg: RAISED, borderWidth: 1, borderColor: LINE, cursor: "pointer", children: [_jsx(Text, { fontSize: 13, lineHeight: 18, color: INK, children: selectedGroup ? `${selectedGroup.name} (L${selectedGroup.layer || 1})` : t('None') }), _jsx(ChevronDown, { size: 13, color: DIM, "aria-hidden": true })] }) }), _jsxs(DropdownMenuContent, { minW: 180, children: [_jsx(DropdownMenuItem, { onSelect: () => setGroupId(''), children: _jsx(Text, { fontSize: "$3", color: "$ink", children: t('None') }) }), groups.map((g) => (_jsx(DropdownMenuItem, { onSelect: () => setGroupId(g.id), children: _jsx(Text, { fontSize: "$3", color: "$ink", children: `${g.name} (Layer ${g.layer || 1})` }) }, g.id)))] })] })] })) : null, _jsxs(XStack, { items: "center", gap: 10, px: 4, children: [_jsx(Text, { fontSize: 15, lineHeight: 20, color: DIM, children: t('Spend up to $') }), _jsx(Input, { ...FIELD, width: 88, py: 8, inputMode: "numeric", value: weekly, onChange: (e) => setWeekly(e.target.value.replace(/[^\d]/g, '')), "aria-label": t('Weekly budget in US dollars') }), _jsx(Text, { fontSize: 15, lineHeight: 20, color: DIM, children: t('a week') })] }), wrong ? (_jsx(Text, { role: "alert", fontSize: 13, lineHeight: 18, color: DIM, px: 4, children: wrong })) : null, _jsxs(XStack, { justify: "flex-end", gap: 8, pt: 4, children: [_jsx(XStack, { ...PILL, onClick: onCancel, children: _jsx(Text, { ...WORD, children: t('Cancel') }) }), _jsx(XStack, { ...PILL, type: 'submit', disabled: !ok, opacity: ok ? 1 : 0.5, bg: INK, borderColor: INK, hoverStyle: { bg: INK, opacity: 0.9 }, children: _jsx(Text, { ...WORD, color: "var(--background)", children: t(busy ? 'Making…' : 'Make bot') }) })] })] })] }) }));
|
|
75
79
|
}
|
package/dist/bots/Panel.js
CHANGED
|
@@ -11,7 +11,7 @@ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
|
11
11
|
import { useCallback, useEffect, useMemo, useState } from 'react';
|
|
12
12
|
import { useI18n } from '@hanzo/i18n/react';
|
|
13
13
|
import { Input, Text, XStack, YStack } from '@hanzo/gui';
|
|
14
|
-
import { Button, Dialog, DialogContent, DialogTitle, DropdownMenu, DropdownMenuContent, DropdownMenuItem, DropdownMenuTrigger,
|
|
14
|
+
import { Button, Dialog, DialogContent, DialogTitle, DropdownMenu, DropdownMenuContent, DropdownMenuItem, DropdownMenuTrigger, } from '@hanzo/ui';
|
|
15
15
|
import { ChevronDown, ChevronRight, Clock, ExternalLink, FileText, Image as ImageIcon, KeyRound, Layers, Play, Plus, RefreshCw, Star, Trash2, X, Zap, } from 'lucide-react';
|
|
16
16
|
import { useKept } from '../kept.js';
|
|
17
17
|
import { api } from '../lib/api.js';
|
|
@@ -35,8 +35,8 @@ const EVENT_TRIGGERS = [
|
|
|
35
35
|
{ id: 'slack:mention', source: 'slack', name: 'mention', label: 'Slack · @mention', hint: 'Runs when @hanzo is mentioned in Slack' },
|
|
36
36
|
{ id: 'slack:message', source: 'slack', name: 'message', label: 'Slack · Channel message', hint: 'Runs on new messages in bound channels' },
|
|
37
37
|
{ id: 'github:push', source: 'github', name: 'push', label: 'GitHub · Push', hint: 'Runs when commits are pushed to a repository' },
|
|
38
|
-
{ id: 'github:pull_request', source: 'github', name: 'pull_request', label: 'GitHub · Pull
|
|
39
|
-
{ id: 'stripe:charge', source: 'stripe', name: 'charge', label: 'Stripe · Payment
|
|
38
|
+
{ id: 'github:pull_request', source: 'github', name: 'pull_request', label: 'GitHub · Pull request', hint: 'Runs when a PR opens or updates' },
|
|
39
|
+
{ id: 'stripe:charge', source: 'stripe', name: 'charge', label: 'Stripe · Payment or charge', hint: 'Runs when a customer payment settles' },
|
|
40
40
|
{ id: 'webhook:inbound', source: 'webhook', name: 'inbound', label: 'Webhook · Inbound HTTP', hint: 'Runs whenever your webhook URL receives a POST' },
|
|
41
41
|
];
|
|
42
42
|
const SCHEDULE_PRESETS = [
|
|
@@ -45,19 +45,24 @@ const SCHEDULE_PRESETS = [
|
|
|
45
45
|
{ id: 'hourly', label: 'Every hour', schedule: { kind: 'hourly' } },
|
|
46
46
|
{ id: 'weekly', label: 'Mondays · 9:00 AM', schedule: { kind: 'weekly', day: 'mon', at: '09:00' } },
|
|
47
47
|
];
|
|
48
|
+
function PanelSwitch({ checked, disabled, onCheckedChange, 'aria-label': ariaLabel, }) {
|
|
49
|
+
return (_jsx(XStack, { render: _jsx("button", { type: "button", role: "switch", "aria-checked": checked, disabled: disabled }), "aria-label": ariaLabel, disabled: disabled, onClick: () => {
|
|
50
|
+
if (!disabled)
|
|
51
|
+
onCheckedChange(!checked);
|
|
52
|
+
}, width: 36, height: 20, p: 2, rounded: 999, borderWidth: 1, borderColor: checked ? 'var(--foreground)' : 'var(--border-strong)', bg: checked ? 'var(--foreground)' : 'var(--border)', items: "center", justify: checked ? 'flex-end' : 'flex-start', shrink: 0, opacity: disabled ? 0.5 : 1, cursor: disabled ? 'not-allowed' : 'pointer', transition: "quickest", focusVisibleStyle: { outlineWidth: 2, outlineStyle: 'solid', outlineColor: 'var(--ring)', outlineOffset: 2 }, children: _jsx(YStack, { width: 14, height: 14, rounded: 999, bg: checked ? 'var(--background)' : 'var(--muted-foreground)', "aria-hidden": true }) }));
|
|
53
|
+
}
|
|
48
54
|
function Row({ mark, title, line, children, last, }) {
|
|
49
|
-
return (_jsxs(XStack, { minH: 52, px: 13, py: 9, gap: 11, items: "center", borderBottomWidth: last ? 0 : 1, borderColor: LINE, children: [mark, _jsxs(YStack, { flex: 1, minW: 0, children: [_jsx(Text, { ...CLIP, fontSize: 14, lineHeight: 19, color: INK, children: title }), line ? (_jsx(Text, { ...CLIP, fontSize: 12, lineHeight: 17, color: DIM, children: line })) : null] }), children] }));
|
|
55
|
+
return (_jsxs(XStack, { minH: 52, px: 13, py: 9, gap: 11, items: "center", borderBottomWidth: last ? 0 : 1, borderColor: LINE, children: [mark, _jsxs(YStack, { flex: 1, minW: 0, gap: 2, children: [_jsx(Text, { ...CLIP, fontSize: 14, lineHeight: 19, fontWeight: "500", color: INK, children: title }), line ? (_jsx(Text, { ...CLIP, fontSize: 12, lineHeight: 17, color: DIM, children: line })) : null] }), children] }));
|
|
50
56
|
}
|
|
51
57
|
function VoiceRow({ label, value, options, onSelect, last, }) {
|
|
52
|
-
return (_jsxs(XStack, { minH: 44, px: 14, items: "center", justify: "space-between", borderBottomWidth: last ? 0 : 1, borderColor: LINE, children: [_jsx(Text, { fontSize: 14, lineHeight: 19, color: INK, children: label }), _jsxs(DropdownMenu, { placement: "bottom-end", offset: 6, children: [_jsx(DropdownMenuTrigger, { asChild: true, children: _jsxs(XStack, { render: "button", type:
|
|
58
|
+
return (_jsxs(XStack, { minH: 44, px: 14, items: "center", justify: "space-between", borderBottomWidth: last ? 0 : 1, borderColor: LINE, children: [_jsx(Text, { fontSize: 14, lineHeight: 19, color: INK, children: label }), _jsxs(DropdownMenu, { placement: "bottom-end", offset: 6, children: [_jsx(DropdownMenuTrigger, { asChild: true, children: _jsxs(XStack, { render: _jsx("button", { type: "button" }), items: "center", gap: 5, px: 6, py: 4, rounded: 6, bg: "transparent", borderWidth: 0, cursor: "pointer", transition: "quickest", hoverStyle: { bg: PICKED }, focusVisibleStyle: { outlineWidth: 2, outlineStyle: 'solid', outlineColor: 'var(--ring)' }, "$max-sm": { minH: 44 }, children: [_jsx(Text, { fontSize: 14, lineHeight: 19, color: INK, children: value }), _jsx(ChevronDown, { size: 14, color: DIM, "aria-hidden": true })] }) }), _jsx(DropdownMenuContent, { minW: 160, "aria-label": label, children: options.map((opt) => (_jsx(DropdownMenuItem, { onSelect: () => onSelect(opt), children: _jsx(Text, { fontSize: "$3", color: "$ink", fontWeight: opt === value ? '600' : '400', children: opt }) }, opt))) })] })] }));
|
|
53
59
|
}
|
|
54
60
|
/**
|
|
55
|
-
*
|
|
56
|
-
*
|
|
57
|
-
* monitor surface when `Parked` or `Asleep`.
|
|
61
|
+
* Miniature monochrome desktop screen preview that adapts cleanly to Dark & Light modes.
|
|
62
|
+
* Displays a `--state-online` dot when `Awake` and a calm neutral screen surface when `Parked` or `Asleep`.
|
|
58
63
|
*/
|
|
59
64
|
function ComputerScreen({ awake, parked }) {
|
|
60
|
-
return (_jsxs(YStack, { "aria-hidden": true, width: 56, height: 36, rounded: 8, shrink: 0, justify: "flex-end", items: "center", pb:
|
|
65
|
+
return (_jsxs(YStack, { "aria-hidden": true, width: 56, height: 36, rounded: 8, shrink: 0, justify: "flex-end", items: "center", pb: 4, position: "relative", overflow: "hidden", bg: awake ? PICKED : FLOOR, borderWidth: 1, borderColor: awake ? 'var(--border-strong)' : LINE, children: [awake ? (_jsx(YStack, { position: "absolute", t: 5, r: 5, width: 6, height: 6, rounded: 999, bg: "var(--state-online)" })) : null, _jsx(XStack, { width: 22, height: 3, rounded: 999, bg: awake ? INK : DIM, opacity: awake ? 0.72 : parked ? 0.42 : 0.25 })] }));
|
|
61
66
|
}
|
|
62
67
|
function stateLabel(box, hasRef, t) {
|
|
63
68
|
if (box?.status === 'running')
|
|
@@ -97,6 +102,7 @@ export function Panel({ bot, groups = [], runs = [], onClose, kept, onSchedule,
|
|
|
97
102
|
const isPrimary = Boolean(ext.isPrimary || bot.name.toLowerCase() === PRIMARY_BOT);
|
|
98
103
|
const currentLayer = isPrimary ? 0 : (ext.layer ?? 1);
|
|
99
104
|
const [tab, setTab] = useState('activity');
|
|
105
|
+
const [moreOpen, setMoreOpen] = useState(false);
|
|
100
106
|
const [instructions, setInstructions] = useState('');
|
|
101
107
|
const [answers, setAnswers] = useState([]);
|
|
102
108
|
const [box, setBox] = useState(null);
|
|
@@ -450,10 +456,10 @@ export function Panel({ bot, groups = [], runs = [], onClose, kept, onSchedule,
|
|
|
450
456
|
}
|
|
451
457
|
return items.reverse();
|
|
452
458
|
}, [runs, t]);
|
|
453
|
-
return (_jsxs(YStack, { flex: 1, minH: 0, overflowY: "auto", overflowX: "hidden", "aria-label": displayName, render: "aside", children: [_jsx(XStack, {
|
|
459
|
+
return (_jsxs(YStack, { flex: 1, minW: 300, "$max-sm": { minW: 0 }, minH: 0, overflowY: "auto", overflowX: "hidden", pb: 32, "aria-label": displayName, render: "aside", children: [_jsx(XStack, { minH: 46, "$max-sm": { minH: 52, px: 10 }, shrink: 0, px: 12, items: "center", justify: "flex-end", children: _jsx(XStack, { ...ROUND, borderColor: "var(--border-strong)", focusVisibleStyle: { outlineWidth: 2, outlineStyle: 'solid', outlineColor: 'var(--ring)' }, "$max-sm": { width: 44, height: 44 }, "aria-label": t('Close'), onClick: onClose, autoFocus: focus, children: _jsx(X, { size: 16, color: INK, "aria-hidden": true }) }) }), _jsxs(YStack, { items: "center", gap: 10, pt: 2, pb: 20, px: 14, children: [_jsx(Face, { bot: bot, size: 68, starred: isPrimary }), _jsxs(YStack, { items: "center", gap: 2, maxW: "100%", children: [_jsx(Text, { ...CLIP, maxW: "100%", fontSize: 17, lineHeight: 22, fontWeight: "600", letterSpacing: -0.34, color: INK, children: displayName }), _jsx(Text, { fontSize: 12, lineHeight: 16, color: DIM, text: "center", children: isPrimary ? t('Primary bot · Layer 0 (directs all bots)') : t('Layer {lv} bot', { lv: currentLayer }) })] }), _jsx(XStack, { "data-parity-key": "bots.panel.tabs", role: "tablist", mt: 4, p: 3, rounded: 999, bg: RAISED, borderWidth: 1, borderColor: "var(--border-strong)", gap: 2, children: ['activity', 'library'].map((id) => {
|
|
454
460
|
const selected = tab === id;
|
|
455
|
-
return (_jsx(XStack, { render: "button", type:
|
|
456
|
-
}) })] }), tab === 'activity' ? (_jsxs(YStack, { px: 15, pb:
|
|
461
|
+
return (_jsx(XStack, { render: _jsx("button", { type: "button", role: "tab", "aria-selected": selected }), onClick: () => setTab(id), height: 28, "$max-sm": { minH: 40 }, px: 14, rounded: 999, items: "center", justify: "center", bg: selected ? PICKED : 'transparent', borderWidth: 0, cursor: "pointer", transition: "quickest", hoverStyle: { bg: PICKED }, focusVisibleStyle: { outlineWidth: 2, outlineStyle: 'solid', outlineColor: 'var(--ring)' }, children: _jsx(Text, { fontSize: 13, lineHeight: 18, fontWeight: selected ? '500' : '400', color: selected ? INK : DIM, children: id === 'activity' ? t('Activity') : t('Library') }) }, id));
|
|
462
|
+
}) })] }), tab === 'activity' ? (_jsxs(YStack, { px: 15, pb: 32, gap: 24, children: [_jsxs(YStack, { gap: 6, "data-parity-key": "bots.panel.computer", children: [_jsx(Text, { ...LABEL, px: 4, children: t('Computer') }), _jsxs(XStack, { ...CARD, render: _jsx("button", { type: "button" }), onClick: () => setComputerOpen(true), "aria-label": t('Open {name}’s desktop computer', { name: displayName }), minH: 60, px: 13, py: 10, items: "center", gap: 12, cursor: "pointer", transition: "quickest", hoverStyle: { bg: PICKED, borderColor: 'var(--border-strong)' }, focusVisibleStyle: { outlineWidth: 2, outlineStyle: 'solid', outlineColor: 'var(--ring)' }, children: [_jsxs(YStack, { flex: 1, minW: 0, items: "flex-start", gap: 2, children: [_jsx(Text, { ...CLIP, fontSize: 14, lineHeight: 19, fontWeight: "500", color: INK, children: t("Bot's computer") }), _jsx(Text, { ...CLIP, fontSize: 12, lineHeight: 17, color: DIM, children: stateLabel(box, Boolean(ext.computeRef), t) })] }), _jsx(ComputerScreen, { awake: box?.status === 'running', parked: Boolean(box || ext.computeRef) })] })] }), _jsxs(YStack, { gap: 6, "data-parity-key": "bots.panel.automations", children: [_jsxs(XStack, { items: "center", justify: "space-between", px: 4, children: [_jsx(Text, { ...LABEL, children: t('Automations') }), _jsxs(XStack, { render: _jsx("button", { type: "button" }), onClick: () => setAutoModalOpen(true), items: "center", gap: 3, px: 6, py: 2, rounded: 6, bg: "transparent", borderWidth: 0, cursor: "pointer", transition: "quickest", hoverStyle: { bg: PICKED }, focusVisibleStyle: { outlineWidth: 2, outlineStyle: 'solid', outlineColor: 'var(--ring)' }, "$max-sm": { minH: 44, px: 10 }, children: [_jsx(Plus, { size: 12, color: DIM, "aria-hidden": true }), _jsx(Text, { fontSize: 12, lineHeight: 16, color: DIM, children: t('Add') })] })] }), _jsxs(YStack, { ...CARD, children: [cron ? (_jsx(Row, { mark: _jsx(Clock, { size: 16, color: DIM, "aria-hidden": true }), title: routine, line: scheduleLine, last: automations.length === 0, children: _jsx(PanelSwitch, { "aria-label": t('Run {name} on its schedule', { name: displayName }), checked: activeSchedule, disabled: saving, onCheckedChange: (on) => {
|
|
457
463
|
setWrong(null);
|
|
458
464
|
setSaving(true);
|
|
459
465
|
onSchedule(on, cron === 'paused' ? '0 9 * * *' : cron)
|
|
@@ -462,43 +468,43 @@ export function Panel({ bot, groups = [], runs = [], onClose, kept, onSchedule,
|
|
|
462
468
|
} }) })) : null, automations.map((a, idx) => {
|
|
463
469
|
const isEvent = Boolean(a.event?.source);
|
|
464
470
|
const isLast = idx === automations.length - 1;
|
|
465
|
-
return (_jsx(Row, { mark: isEvent ? _jsx(Zap, { size: 16, color: INK, "aria-hidden": true }) : _jsx(Clock, { size: 16, color: DIM, "aria-hidden": true }), title: a.name, line: describeAutomation(a, t), last: isLast, children: _jsxs(XStack, { items: "center", gap: 6, children: [_jsx(XStack, { render: "button", type:
|
|
466
|
-
}), !cron && automations.length === 0 ? (_jsxs(XStack, { render: "button", type:
|
|
467
|
-
? t('Directs worker bots & layered Bot Groups')
|
|
468
|
-
: t('Directed by Primary Bot ({primary})', { primary: PRIMARY_BOT }), last: isPrimary && groups.length === 0, children: !isPrimary ? (_jsx(XStack, { render: "button", type: 'button', disabled: saving, onClick: () => void promotePrimary(), height: 26, px: 9, rounded: 999, items: "center", bg: GROUND, borderWidth: 1, borderColor: LINE, cursor: "pointer", hoverStyle: { bg: PICKED }, children: _jsx(Text, { fontSize: 11, lineHeight: 15, fontWeight: "500", color: INK, children: t('Make Primary') }) })) : null }), !isPrimary ? (_jsx(VoiceRow, { label: t('Layer'), value: `Layer ${currentLayer}`, options: ['Layer 1', 'Layer 2', 'Layer 3'], onSelect: (opt) => void assignLayer(Number(opt.replace('Layer ', '')) || 1), last: groups.length === 0 })) : null, groups.length > 0 ? (_jsxs(XStack, { minH: 44, px: 14, items: "center", justify: "space-between", children: [_jsx(Text, { fontSize: 14, lineHeight: 19, color: INK, children: t('Group') }), _jsxs(XStack, { items: "center", gap: 6, children: [assignedGroup && onPickGroup ? (_jsx(XStack, { render: "button", type: 'button', onClick: () => onPickGroup(toGroupRef(assignedGroup.name)), px: 8, py: 3, rounded: 999, bg: PICKED, borderWidth: 1, borderColor: LINE, cursor: "pointer", children: _jsx(Text, { fontSize: 11, lineHeight: 15, color: INK, children: t('Open') }) })) : null, _jsxs(DropdownMenu, { placement: "bottom-end", offset: 6, children: [_jsx(DropdownMenuTrigger, { asChild: true, children: _jsxs(XStack, { render: "button", type: 'button', items: "center", gap: 5, px: 6, py: 4, rounded: 6, bg: "transparent", borderWidth: 0, cursor: "pointer", hoverStyle: { bg: PICKED }, children: [_jsx(Text, { fontSize: 13, lineHeight: 18, color: INK, children: assignedGroup ? assignedGroup.name : t('None') }), _jsx(ChevronDown, { size: 14, color: DIM, "aria-hidden": true })] }) }), _jsxs(DropdownMenuContent, { minW: 170, children: [_jsx(DropdownMenuItem, { onSelect: () => void assignGroup(''), children: _jsx(Text, { fontSize: "$3", color: "$ink", children: t('None') }) }), groups.map((g) => (_jsx(DropdownMenuItem, { onSelect: () => void assignGroup(g.id), children: _jsx(Text, { fontSize: "$3", color: "$ink", children: `${g.name} (L${g.layer || 1})` }) }, g.id)))] })] })] })] })) : null] })] }), _jsxs(YStack, { gap: 8, "data-parity-key": "bots.panel.slack", children: [_jsxs(XStack, { items: "center", justify: "space-between", px: 4, children: [_jsx(Text, { ...LABEL, children: t('Slack Agent Sync') }), slackConn.connected ? (_jsxs(XStack, { render: "button", type: 'button', disabled: slackBusy, onClick: () => void syncSlack(), items: "center", gap: 4, px: 6, py: 2, rounded: 6, bg: "transparent", borderWidth: 0, cursor: "pointer", hoverStyle: { bg: PICKED }, children: [_jsx(RefreshCw, { size: 11, color: DIM, "aria-hidden": true }), _jsx(Text, { fontSize: 11, lineHeight: 15, color: DIM, children: t('Sync channels') })] })) : null] }), _jsxs(YStack, { ...CARD, children: [_jsx(Row, { mark: _jsx(Network, { transport: "slack", size: 20 }), title: slackConn.connected
|
|
471
|
+
return (_jsx(Row, { mark: isEvent ? _jsx(Zap, { size: 16, color: INK, "aria-hidden": true }) : _jsx(Clock, { size: 16, color: DIM, "aria-hidden": true }), title: a.name, line: describeAutomation(a, t), last: isLast, children: _jsxs(XStack, { items: "center", gap: 6, children: [_jsx(XStack, { render: _jsx("button", { type: "button" }), "aria-label": t('Run {name} now', { name: a.name }), disabled: autoBusy, onClick: () => void handleRunAutoNow(a), width: 26, height: 26, "$max-sm": { width: 44, height: 44 }, rounded: 999, items: "center", justify: "center", bg: "transparent", borderWidth: 0, cursor: "pointer", transition: "quickest", hoverStyle: { bg: PICKED }, focusVisibleStyle: { outlineWidth: 2, outlineStyle: 'solid', outlineColor: 'var(--ring)' }, children: _jsx(Play, { size: 12, color: DIM, "aria-hidden": true }) }), _jsx(PanelSwitch, { "aria-label": t('Toggle {name}', { name: a.name }), checked: a.enabled, disabled: autoBusy, onCheckedChange: (on) => void handleToggleAuto(a, on) }), _jsx(XStack, { render: _jsx("button", { type: "button" }), "aria-label": t('Delete {name}', { name: a.name }), disabled: autoBusy, onClick: () => void handleDeleteAuto(a), ml: 4, width: 24, height: 24, "$max-sm": { width: 44, height: 44 }, rounded: 999, items: "center", justify: "center", bg: "transparent", borderWidth: 0, cursor: "pointer", transition: "quickest", hoverStyle: { bg: PICKED }, focusVisibleStyle: { outlineWidth: 2, outlineStyle: 'solid', outlineColor: 'var(--ring)' }, children: _jsx(Trash2, { size: 12, color: DIM, "aria-hidden": true }) })] }) }, a.id));
|
|
472
|
+
}), !cron && automations.length === 0 ? (_jsxs(XStack, { render: _jsx("button", { type: "button" }), onClick: () => setAutoModalOpen(true), width: "100%", minW: 0, overflow: "hidden", minH: 50, px: 13, py: 9, items: "center", justify: "space-between", gap: 10, bg: "transparent", borderWidth: 0, cursor: "pointer", transition: "quickest", hoverStyle: { bg: PICKED }, focusVisibleStyle: { outlineWidth: 2, outlineStyle: 'solid', outlineColor: 'var(--ring)' }, children: [_jsxs(YStack, { flex: 1, minW: 0, items: "flex-start", gap: 2, children: [_jsx(Text, { ...CLIP, fontSize: 14, lineHeight: 19, fontWeight: "500", color: INK, children: t('Scheduled & event-driven work') }), _jsx(Text, { ...CLIP, fontSize: 12, lineHeight: 17, color: DIM, children: t('Run on cron schedules, Slack mentions, GitHub PRs, or webhooks') })] }), _jsx(XStack, { shrink: 0, items: "center", children: _jsx(ChevronRight, { size: 15, color: DIM, "aria-hidden": true }) })] })) : null] })] }), _jsxs(YStack, { gap: 6, "data-parity-key": "bots.panel.vault", children: [_jsx(Text, { ...LABEL, px: 4, children: t('Secrets & login autofill') }), _jsxs(XStack, { ...CARD, render: _jsx("button", { type: "button" }), onClick: () => setVaultOpen(true), width: "100%", minW: 0, overflow: "hidden", minH: 52, px: 13, py: 9, items: "center", gap: 11, cursor: "pointer", transition: "quickest", hoverStyle: { bg: PICKED, borderColor: 'var(--border-strong)' }, focusVisibleStyle: { outlineWidth: 2, outlineStyle: 'solid', outlineColor: 'var(--ring)' }, children: [_jsx(XStack, { shrink: 0, items: "center", children: _jsx(KeyRound, { size: 17, color: INK, "aria-hidden": true }) }), _jsxs(YStack, { flex: 1, minW: 0, items: "flex-start", gap: 2, children: [_jsx(Text, { ...CLIP, fontSize: 14, lineHeight: 19, fontWeight: "500", color: INK, children: t('Unified vault & password autofill') }), _jsx(Text, { ...CLIP, fontSize: 12, lineHeight: 17, color: DIM, children: vaultSummary })] }), _jsx(XStack, { shrink: 0, items: "center", children: _jsx(ChevronRight, { size: 15, color: DIM, "aria-hidden": true }) })] })] }), _jsxs(YStack, { gap: 6, "data-parity-key": "bots.panel.slack", children: [_jsxs(XStack, { items: "center", justify: "space-between", px: 4, children: [_jsx(Text, { ...LABEL, children: t('Slack agent sync') }), slackConn.connected ? (_jsxs(XStack, { render: _jsx("button", { type: "button" }), disabled: slackBusy, onClick: () => void syncSlack(), items: "center", gap: 4, px: 6, py: 2, "$max-sm": { minH: 44, px: 10 }, rounded: 6, bg: "transparent", borderWidth: 0, cursor: "pointer", transition: "quickest", hoverStyle: { bg: PICKED }, focusVisibleStyle: { outlineWidth: 2, outlineStyle: 'solid', outlineColor: 'var(--ring)' }, children: [_jsx(RefreshCw, { size: 11, color: DIM, "aria-hidden": true }), _jsx(Text, { fontSize: 12, lineHeight: 16, color: DIM, children: t('Sync channels') })] })) : null] }), _jsxs(YStack, { ...CARD, children: [_jsx(Row, { mark: _jsx(Network, { transport: "slack", size: 20 }), title: slackConn.connected
|
|
469
473
|
? slackConn.account
|
|
470
474
|
? `Slack · ${slackConn.account}`
|
|
471
|
-
: t('Slack
|
|
475
|
+
: t('Slack connected')
|
|
472
476
|
: t('Add @hanzo to Slack'), line: slackConn.connected
|
|
473
477
|
? slackDefault === bot.name
|
|
474
478
|
? t('Answers @hanzo in Slack by default')
|
|
475
479
|
: t('Default responder: {def}', { def: slackDefault })
|
|
476
|
-
: t('Sync channels, threads, and DMs like @hanzo'), last: !slackConn.connected, children: slackConn.connected ? (_jsx(
|
|
480
|
+
: t('Sync channels, threads, and DMs like @hanzo'), last: !slackConn.connected, children: slackConn.connected ? (_jsx(PanelSwitch, { "aria-label": t('Answer @hanzo in Slack with {name}', { name: displayName }), checked: slackDefault === bot.name, disabled: slackBusy, onCheckedChange: (on) => void toggleSlackDefault(on) })) : (_jsxs(XStack, { render: _jsx("button", { type: "button" }), disabled: slackBusy, onClick: () => void connectSlack(), height: 30, "$max-sm": { minH: 44 }, px: 11, rounded: 999, items: "center", gap: 5, bg: INK, borderWidth: 1, borderColor: INK, cursor: "pointer", transition: "quickest", hoverStyle: { opacity: 0.9 }, focusVisibleStyle: { outlineWidth: 2, outlineStyle: 'solid', outlineColor: 'var(--ring)' }, children: [_jsx(ExternalLink, { size: 11, color: "var(--background)", "aria-hidden": true }), _jsx(Text, { fontSize: 12, lineHeight: 16, fontWeight: "600", color: "var(--background)", children: t('Add to Slack') })] })) }), slackConn.connected && slackChans.length > 0 ? (_jsxs(YStack, { px: 13, py: 10, gap: 6, children: [_jsx(Text, { fontSize: 12, lineHeight: 16, color: DIM, children: t('Bind channels directly to {name}:', { name: displayName }) }), _jsx(XStack, { flexWrap: "wrap", gap: 6, children: slackChans.slice(0, 8).map((ch) => {
|
|
477
481
|
const mine = slackBound[ch.id] === bot.name;
|
|
478
|
-
return (_jsx(XStack, { render: "button", type:
|
|
479
|
-
}) })] })) : null] }), slackNote ? (_jsx(Text, { fontSize:
|
|
480
|
-
|
|
481
|
-
|
|
482
|
+
return (_jsx(XStack, { render: _jsx("button", { type: "button" }), "aria-pressed": mine, disabled: slackBusy, onClick: () => void toggleSlackChannel(ch.id), height: 26, "$max-sm": { minH: 40 }, px: 9, rounded: 999, items: "center", bg: mine ? PICKED : GROUND, borderWidth: 1, borderColor: mine ? 'var(--border-strong)' : LINE, cursor: "pointer", transition: "quickest", hoverStyle: { bg: PICKED }, focusVisibleStyle: { outlineWidth: 2, outlineStyle: 'solid', outlineColor: 'var(--ring)' }, children: _jsx(Text, { fontSize: 12, lineHeight: 16, fontWeight: mine ? '600' : '400', color: mine ? INK : DIM, children: `#${ch.name}` }) }, ch.id));
|
|
483
|
+
}) })] })) : null] }), slackNote ? (_jsx(Text, { fontSize: 12, lineHeight: 17, color: DIM, px: 4, children: slackNote })) : null] }), answers.length ? (_jsxs(YStack, { gap: 6, "data-parity-key": "bots.panel.networks", children: [_jsx(Text, { ...LABEL, px: 4, children: t('Connected channels') }), _jsx(YStack, { ...CARD, 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, _jsxs(YStack, { gap: 6, "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: _jsx("button", { type: "button" }), onClick: () => setConnectorsOpen(true), items: "center", gap: 3, px: 6, py: 2, "$max-sm": { minH: 44, px: 10 }, rounded: 6, bg: "transparent", borderWidth: 0, cursor: "pointer", transition: "quickest", hoverStyle: { bg: PICKED }, focusVisibleStyle: { outlineWidth: 2, outlineStyle: 'solid', outlineColor: 'var(--ring)' }, 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: _jsx("button", { type: "button" }), onClick: () => setConnectorsOpen(true), width: "100%", minW: 0, overflow: "hidden", minH: 50, px: 13, py: 9, items: "center", justify: "space-between", gap: 10, cursor: "pointer", transition: "quickest", hoverStyle: { bg: PICKED, borderColor: 'var(--border-strong)' }, focusVisibleStyle: { outlineWidth: 2, outlineStyle: 'solid', outlineColor: 'var(--ring)' }, children: [_jsxs(YStack, { flex: 1, minW: 0, items: "flex-start", gap: 2, children: [_jsx(Text, { ...CLIP, fontSize: 14, lineHeight: 19, fontWeight: "500", color: INK, children: answers.length ? t('{n} channels connected', { n: answers.length }) : t('Connect Slack, GitHub, Linear, Stripe…') }), _jsx(Text, { ...CLIP, fontSize: 12, lineHeight: 17, color: DIM, children: t('External apps, socials & MCP tools') })] }), _jsx(XStack, { shrink: 0, items: "center", children: _jsx(ChevronRight, { size: 15, color: DIM, "aria-hidden": true }) })] })] }), _jsxs(YStack, { gap: 16, children: [_jsxs(XStack, { ...CARD, render: _jsx("button", { type: "button" }), "aria-expanded": moreOpen, onClick: () => setMoreOpen((v) => !v), width: "100%", minW: 0, minH: 46, px: 13, py: 9, items: "center", justify: "space-between", gap: 10, cursor: "pointer", transition: "quickest", hoverStyle: { bg: PICKED, borderColor: 'var(--border-strong)' }, focusVisibleStyle: { outlineWidth: 2, outlineStyle: 'solid', outlineColor: 'var(--ring)' }, children: [_jsxs(YStack, { flex: 1, minW: 0, items: "flex-start", gap: 2, children: [_jsx(Text, { ...CLIP, fontSize: 14, lineHeight: 19, fontWeight: "500", color: INK, children: t('More settings') }), _jsx(Text, { ...CLIP, fontSize: 12, lineHeight: 17, color: DIM, children: t('Layer {lv} · Voice: {voice}', { lv: currentLayer, voice: voiceName }) })] }), _jsx(XStack, { shrink: 0, items: "center", children: moreOpen ? _jsx(ChevronDown, { size: 15, color: DIM, "aria-hidden": true }) : _jsx(ChevronRight, { size: 15, color: DIM, "aria-hidden": true }) })] }), moreOpen ? (_jsxs(YStack, { gap: 20, children: [_jsxs(YStack, { gap: 6, "data-parity-key": "bots.panel.hierarchy", children: [_jsx(Text, { ...LABEL, px: 4, children: t('Hierarchy & coordination') }), _jsxs(YStack, { ...CARD, children: [_jsx(Row, { mark: isPrimary ? _jsx(Star, { size: 16, color: INK, "aria-hidden": true }) : _jsx(Layers, { size: 16, color: DIM, "aria-hidden": true }), title: isPrimary ? t('Primary bot (max 1)') : t('Subordinate bot'), line: isPrimary
|
|
484
|
+
? t('Directs worker bots & layered bot groups')
|
|
485
|
+
: t('Directed by primary bot ({primary})', { primary: PRIMARY_BOT }), last: isPrimary && groups.length === 0, children: !isPrimary ? (_jsx(XStack, { render: _jsx("button", { type: "button" }), disabled: saving, onClick: () => void promotePrimary(), height: 28, "$max-sm": { minH: 44 }, px: 10, rounded: 999, items: "center", bg: GROUND, borderWidth: 1, borderColor: "var(--border-strong)", cursor: "pointer", transition: "quickest", hoverStyle: { bg: PICKED }, focusVisibleStyle: { outlineWidth: 2, outlineStyle: 'solid', outlineColor: 'var(--ring)' }, children: _jsx(Text, { fontSize: 12, lineHeight: 16, fontWeight: "500", color: INK, children: t('Make primary') }) })) : null }), !isPrimary ? (_jsx(VoiceRow, { label: t('Layer'), value: `Layer ${currentLayer}`, options: ['Layer 1', 'Layer 2', 'Layer 3'], onSelect: (opt) => void assignLayer(Number(opt.replace('Layer ', '')) || 1), last: groups.length === 0 })) : null, groups.length > 0 ? (_jsxs(XStack, { minH: 44, px: 14, items: "center", justify: "space-between", gap: 8, children: [_jsx(Text, { fontSize: 14, lineHeight: 19, color: INK, children: t('Group') }), _jsxs(XStack, { items: "center", gap: 6, children: [assignedGroup && onPickGroup ? (_jsx(XStack, { render: _jsx("button", { type: "button" }), onClick: () => onPickGroup(toGroupRef(assignedGroup.name)), px: 8, py: 3, "$max-sm": { minH: 44, items: 'center' }, rounded: 999, bg: PICKED, borderWidth: 1, borderColor: "var(--border-strong)", cursor: "pointer", focusVisibleStyle: { outlineWidth: 2, outlineStyle: 'solid', outlineColor: 'var(--ring)' }, children: _jsx(Text, { fontSize: 12, lineHeight: 16, color: INK, children: t('Open') }) })) : null, _jsxs(DropdownMenu, { placement: "bottom-end", offset: 6, children: [_jsx(DropdownMenuTrigger, { asChild: true, children: _jsxs(XStack, { render: _jsx("button", { type: "button" }), items: "center", gap: 5, px: 6, py: 4, "$max-sm": { minH: 44 }, rounded: 6, bg: "transparent", borderWidth: 0, cursor: "pointer", transition: "quickest", hoverStyle: { bg: PICKED }, focusVisibleStyle: { outlineWidth: 2, outlineStyle: 'solid', outlineColor: 'var(--ring)' }, children: [_jsx(Text, { fontSize: 13, lineHeight: 18, color: INK, children: assignedGroup ? assignedGroup.name : t('None') }), _jsx(ChevronDown, { size: 14, color: DIM, "aria-hidden": true })] }) }), _jsxs(DropdownMenuContent, { minW: 170, children: [_jsx(DropdownMenuItem, { onSelect: () => void assignGroup(''), children: _jsx(Text, { fontSize: "$3", color: "$ink", children: t('None') }) }), groups.map((g) => (_jsx(DropdownMenuItem, { onSelect: () => void assignGroup(g.id), children: _jsx(Text, { fontSize: "$3", color: "$ink", children: `${g.name} (L${g.layer || 1})` }) }, g.id)))] })] })] })] })) : null] })] }), _jsxs(YStack, { gap: 6, "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 })] })] })] })) : null] }), wrong ? (_jsx(Text, { render: "p", role: "alert", px: 8, m: 0, fontSize: 13, lineHeight: 18, color: "var(--state-error)", children: wrong })) : null, !isPrimary ? (_jsx(XStack, { px: 4, pt: 16, mt: 4, borderTopWidth: 1, borderColor: LINE, children: _jsx(Text, { render: _jsx("button", { type: "button" }), onClick: () => setDeleting(true), bg: "transparent", borderWidth: 0, px: 8, py: 6, "$max-sm": { minH: 44 }, rounded: 8, cursor: "pointer", fontSize: 13, lineHeight: 18, color: DIM, hoverStyle: { color: 'var(--state-error)', bg: PICKED }, focusVisibleStyle: { outlineWidth: 2, outlineStyle: 'solid', outlineColor: 'var(--ring)' }, children: t('Delete {name}', { name: displayName }) }) })) : null] })) : (_jsx(YStack, { px: 15, pb: 32, 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: autoModalOpen, onOpenChange: setAutoModalOpen, children: _jsx(DialogContent, { "data-parity-key": "bots.automations.dialog", width: "calc(100vw - 24px)", maxW: 540, "$max-sm": { maxW: 'calc(100vw - 24px)', rounded: 14 }, maxH: "90vh", overflowY: "auto", p: 0, showCloseButton: false, bg: GROUND, borderWidth: 1, borderColor: "var(--border-strong)", rounded: 18, overflow: "hidden", children: _jsxs(YStack, { p: 22, "$max-sm": { p: 16 }, gap: 18, bg: GROUND, children: [_jsxs(XStack, { items: "center", justify: "space-between", gap: 10, children: [_jsx(DialogTitle, { children: _jsx(Text, { fontSize: 17, lineHeight: 23, fontWeight: "600", letterSpacing: -0.34, color: INK, children: t('New automation for {name}', { name: displayName }) }) }), _jsx(XStack, { ...ROUND, width: 30, height: 30, borderColor: "var(--border-strong)", focusVisibleStyle: { outlineWidth: 2, outlineStyle: 'solid', outlineColor: 'var(--ring)' }, "$max-sm": { width: 44, height: 44 }, "aria-label": t('Close'), onClick: () => setAutoModalOpen(false), children: _jsx(X, { size: 15, color: INK, "aria-hidden": true }) })] }), _jsx(XStack, { p: 3, rounded: 14, bg: RAISED, borderWidth: 1, borderColor: "var(--border-strong)", gap: 4, flexWrap: "wrap", children: [
|
|
486
|
+
{ id: 'schedule', label: t('Scheduled (cron / time)'), Icon: Clock },
|
|
487
|
+
{ id: 'event', label: t('Event-driven (webhook / app)'), Icon: Zap },
|
|
482
488
|
].map(({ id, label, Icon }) => {
|
|
483
489
|
const active = autoMode === id;
|
|
484
|
-
return (_jsxs(XStack, { render: "button", type:
|
|
485
|
-
}) }), _jsxs(YStack, { render: "form", onSubmit: submitAutomation, gap:
|
|
490
|
+
return (_jsxs(XStack, { render: _jsx("button", { type: "button" }), "aria-pressed": active, onClick: () => setAutoMode(id), flex: 1, minW: 140, height: 32, "$max-sm": { minH: 44 }, px: 10, gap: 6, rounded: 10, items: "center", justify: "center", bg: active ? PICKED : 'transparent', borderWidth: 0, cursor: "pointer", transition: "quickest", hoverStyle: { bg: PICKED }, focusVisibleStyle: { outlineWidth: 2, outlineStyle: 'solid', outlineColor: 'var(--ring)' }, children: [_jsx(Icon, { size: 13, color: active ? INK : DIM, "aria-hidden": true }), _jsx(Text, { fontSize: 12, lineHeight: 16, fontWeight: active ? '600' : '400', color: active ? INK : DIM, numberOfLines: 1, children: label })] }, id));
|
|
491
|
+
}) }), _jsxs(YStack, { render: "form", onSubmit: submitAutomation, gap: 14, children: [_jsx(Input, { unstyled: true, value: autoName, onChange: (e) => setAutoName(e.target.value), placeholder: autoMode === 'schedule'
|
|
486
492
|
? t('Name (e.g., Daily Hanzo leadership update)')
|
|
487
|
-
: t('Name (e.g., Triage new GitHub pull requests)'), "aria-label": t('Automation name'), width: "100%", px: 13, py: 10, rounded: 10, bg: RAISED, borderWidth: 1, borderColor:
|
|
493
|
+
: t('Name (e.g., Triage new GitHub pull requests)'), "aria-label": t('Automation name'), width: "100%", px: 13, py: 10, "$max-sm": { minH: 44 }, rounded: 10, bg: RAISED, borderWidth: 1, borderColor: "var(--border-strong)", focusStyle: { borderColor: 'var(--ring)' }, color: INK, fontSize: 14, placeholderTextColor: "$placeholderColor" }), autoMode === 'schedule' ? (_jsxs(YStack, { gap: 8, children: [_jsx(XStack, { flexWrap: "wrap", gap: 6, children: SCHEDULE_PRESETS.map((p) => {
|
|
488
494
|
const active = autoPreset === p.id && !autoCustomWhen.trim();
|
|
489
|
-
return (_jsx(XStack, { render: "button", type:
|
|
495
|
+
return (_jsx(XStack, { render: _jsx("button", { type: "button" }), "aria-pressed": active, onClick: () => {
|
|
490
496
|
setAutoPreset(p.id);
|
|
491
497
|
setAutoCustomWhen('');
|
|
492
|
-
}, height:
|
|
493
|
-
}) }), _jsx(Input, { unstyled: true, value: autoCustomWhen, onChange: (e) => setAutoCustomWhen(e.target.value), placeholder: t('Or type any schedule in plain English (e.g., "Fridays at 4pm" or "every 2 hours")'), "aria-label": t('Natural language schedule'), width: "100%", px: 13, py: 9, rounded: 10, bg: RAISED, borderWidth: 1, borderColor:
|
|
498
|
+
}, height: 30, "$max-sm": { minH: 40 }, px: 11, rounded: 999, items: "center", bg: active ? PICKED : RAISED, borderWidth: 1, borderColor: active ? 'var(--border-strong)' : LINE, cursor: "pointer", transition: "quickest", hoverStyle: { bg: PICKED }, focusVisibleStyle: { outlineWidth: 2, outlineStyle: 'solid', outlineColor: 'var(--ring)' }, children: _jsx(Text, { fontSize: 12, lineHeight: 16, fontWeight: active ? '600' : '400', color: active ? INK : DIM, children: t(p.label) }) }, p.id));
|
|
499
|
+
}) }), _jsx(Input, { unstyled: true, value: autoCustomWhen, onChange: (e) => setAutoCustomWhen(e.target.value), placeholder: t('Or type any schedule in plain English (e.g., "Fridays at 4pm" or "every 2 hours")'), "aria-label": t('Natural language schedule'), width: "100%", px: 13, py: 9, "$max-sm": { minH: 44 }, rounded: 10, bg: RAISED, borderWidth: 1, borderColor: "var(--border-strong)", focusStyle: { borderColor: 'var(--ring)' }, color: INK, fontSize: 13, placeholderTextColor: "$placeholderColor" })] })) : (_jsxs(YStack, { gap: 8, children: [_jsx(XStack, { flexWrap: "wrap", gap: 6, children: EVENT_TRIGGERS.map((ev) => {
|
|
494
500
|
const active = autoEventId === ev.id;
|
|
495
|
-
return (_jsx(XStack, { render: "button", type:
|
|
496
|
-
}) }), _jsxs(YStack, { px: 12, py:
|
|
501
|
+
return (_jsx(XStack, { render: _jsx("button", { type: "button" }), "aria-pressed": active, onClick: () => setAutoEventId(ev.id), height: 30, "$max-sm": { minH: 40 }, px: 11, rounded: 999, items: "center", bg: active ? PICKED : RAISED, borderWidth: 1, borderColor: active ? 'var(--border-strong)' : LINE, cursor: "pointer", transition: "quickest", hoverStyle: { bg: PICKED }, focusVisibleStyle: { outlineWidth: 2, outlineStyle: 'solid', outlineColor: 'var(--ring)' }, children: _jsx(Text, { fontSize: 12, lineHeight: 16, fontWeight: active ? '600' : '400', color: active ? INK : DIM, children: t(ev.label) }) }, ev.id));
|
|
502
|
+
}) }), _jsxs(YStack, { px: 12, py: 9, rounded: 10, bg: FLOOR, borderWidth: 1, borderColor: LINE, gap: 3, children: [_jsx(Text, { fontSize: 12, lineHeight: 16, color: INK, children: t(selectedEventDef.hint) }), _jsx(Text, { fontFamily: "$mono", fontSize: 11, lineHeight: 15, color: DIM, numberOfLines: 2, children: `POST ${api()}/v1/auto/hooks/${selectedEventDef.source}/${selectedEventDef.name}` })] })] })), _jsx(Input, { unstyled: true, render: "textarea", rows: 4, value: autoInstructions, onChange: (e) => setAutoInstructions(e.target.value), placeholder: t('Instructions for {name}: what to check, which tools or desktop browser logins to use, and where to post the result…', { name: displayName }), "aria-label": t('Automation instructions'), width: "100%", px: 13, py: 10, rounded: 10, bg: RAISED, borderWidth: 1, borderColor: "var(--border-strong)", focusStyle: { borderColor: 'var(--ring)' }, color: INK, fontSize: 14, placeholderTextColor: "$placeholderColor" }), _jsxs(XStack, { justify: "flex-end", gap: 8, pt: 6, flexWrap: "wrap", children: [_jsx(XStack, { ...PILL, minH: 36, borderColor: "var(--border-strong)", focusVisibleStyle: { outlineWidth: 2, outlineStyle: 'solid', outlineColor: 'var(--ring)' }, "$max-sm": { minH: 44 }, onClick: () => setAutoModalOpen(false), children: _jsx(Text, { ...WORD, children: t('Cancel') }) }), _jsx(XStack, { ...PILL, type: 'submit', minH: 36, bg: INK, borderColor: INK, focusVisibleStyle: { outlineWidth: 2, outlineStyle: 'solid', outlineColor: 'var(--ring)' }, "$max-sm": { minH: 44 }, disabled: autoBusy || !autoName.trim() || !autoInstructions.trim(), opacity: autoBusy || !autoName.trim() || !autoInstructions.trim() ? 0.5 : 1, children: _jsx(Text, { ...WORD, fontWeight: "600", color: "var(--background)", children: autoBusy ? t('Saving…') : t('Create automation') }) })] })] })] }) }) }), _jsx(Dialog, { open: deleting, onOpenChange: setDeleting, children: _jsxs(DialogContent, { maxW: 440, width: "calc(100vw - 24px)", rounded: 20, gap: 16, children: [_jsxs(YStack, { gap: 6, children: [_jsx(DialogTitle, { children: t('Delete {name}?', { name: displayName }) }), _jsx(Text, { fontSize: 14, lineHeight: 20, color: DIM, children: t('{name} and every message it was sent are deleted for good.', { name: displayName }) })] }), _jsxs(XStack, { gap: 8, justify: "flex-end", flexWrap: "wrap", children: [_jsx(Button, { size: "sm", variant: "outline", rounded: 999, minH: 36, borderColor: "var(--border-strong)", focusVisibleStyle: { outlineWidth: 2, outlineStyle: 'solid', outlineColor: 'var(--ring)' }, "$max-sm": { minH: 44 }, onClick: () => setDeleting(false), children: t('Cancel') }), _jsx(XStack, { ...PILL, height: 36, "$max-sm": { minH: 44 }, bg: "var(--state-error)", borderColor: "var(--state-error)", hoverStyle: { bg: 'var(--state-error)', opacity: 0.9 }, focusVisibleStyle: { outlineWidth: 2, outlineStyle: 'solid', outlineColor: 'var(--ring)' }, onClick: () => {
|
|
497
503
|
if (!deleting)
|
|
498
504
|
return;
|
|
499
505
|
setDeleting(false);
|
|
500
506
|
onDelete().catch((e) => setWrong(say(e, displayName, 'save', t)));
|
|
501
|
-
}, children: _jsx(Text, { ...WORD, color: "var(--
|
|
507
|
+
}, children: _jsx(Text, { ...WORD, fontWeight: "600", color: "var(--pure-white)", children: t('Delete') }) })] })] }) }), _jsx(ComputerDialog, { open: computerOpen, onOpenChange: setComputerOpen, bot: ext, box: box, onUpdated: async () => {
|
|
502
508
|
await survey();
|
|
503
509
|
await onBotChanged?.();
|
|
504
510
|
} }), _jsx(ConnectorsDialog, { open: connectorsOpen, onOpenChange: setConnectorsOpen, defaultFilter: "all", onConnected: () => void survey() }), _jsx(VaultDialog, { open: vaultOpen, onOpenChange: setVaultOpen, onChanged: (doc) => setVaultDoc(doc) })] }));
|
package/dist/bots/Roster.js
CHANGED
|
@@ -8,7 +8,7 @@ import { useEffect, useMemo, useState } from 'react';
|
|
|
8
8
|
import { useI18n } from '@hanzo/i18n/react';
|
|
9
9
|
import { Input, Text, XStack, YStack } from '@hanzo/gui';
|
|
10
10
|
import { DropdownMenu, DropdownMenuContent, DropdownMenuItem, DropdownMenuLabel, DropdownMenuSeparator, DropdownMenuTrigger, } from '@hanzo/ui';
|
|
11
|
-
import { Grid2x2Plus, Layers, Plus, Search, SlidersHorizontal, Users, X } from 'lucide-react';
|
|
11
|
+
import { ArrowLeft, Grid2x2Plus, Layers, Plus, Search, SlidersHorizontal, Users, X } from 'lucide-react';
|
|
12
12
|
import { useSignOut } from '../lib/signout.js';
|
|
13
13
|
import { PreferencesDialog } from '../PreferencesDialog.js';
|
|
14
14
|
import { called } from '../team.js';
|
|
@@ -41,25 +41,30 @@ export function Roster({ bots, groups = [], last, open, unread, me, onPick, onMa
|
|
|
41
41
|
policyBadge(g.policy).toLowerCase().includes(q));
|
|
42
42
|
}, [groups, query]);
|
|
43
43
|
const { grid, rows } = useMemo(() => split(shown, last), [shown, last]);
|
|
44
|
-
return (_jsxs(YStack, { flex: 1, minH: 0, position: "relative", children: [_jsxs(XStack, { "data-parity-key": "bots.roster.bar",
|
|
44
|
+
return (_jsxs(YStack, { flex: 1, minH: 0, position: "relative", children: [_jsxs(XStack, { "data-parity-key": "bots.roster.bar", minH: 46, "$max-sm": { minH: 52, px: 10 }, shrink: 0, px: 12, items: "center", justify: "space-between", gap: 8, children: [_jsx(XStack, { items: "center", gap: 6, pl: 2, minW: 0, children: me ? (_jsxs(XStack, { render: _jsx("a", { href: "/chat", "aria-label": t('Back to chat') }), items: "center", gap: 6, px: 6, py: 4, ml: -4, rounded: 8, transition: "quickest", hoverStyle: { bg: PICKED }, focusVisibleStyle: { outlineWidth: 2, outlineStyle: 'solid', outlineColor: 'var(--ring)' }, "$max-sm": { minH: 44 }, "$platform-web": { textDecoration: 'none' }, children: [_jsx(ArrowLeft, { size: 14, color: DIM, "aria-hidden": true }), _jsx(Text, { fontSize: 13, lineHeight: 18, fontWeight: "600", color: INK, children: t('hanzo.bot') })] })) : (_jsx(Text, { fontSize: 13, lineHeight: 18, fontWeight: "600", color: DIM, children: t('hanzo.bot') })) }), _jsxs(XStack, { items: "center", gap: 6, shrink: 0, children: [_jsx(XStack, { ...ROUND, borderColor: "var(--border-strong)", focusVisibleStyle: { outlineWidth: 2, outlineStyle: 'solid', outlineColor: 'var(--ring)' }, "$max-sm": { width: 44, height: 44 }, "aria-label": t(seeking ? 'Close search' : 'Search bots'), "aria-pressed": seeking, onClick: () => {
|
|
45
45
|
setSeeking(!seeking);
|
|
46
46
|
setQuery('');
|
|
47
|
-
}, children: seeking ? _jsx(X, { size: 16, color: INK, "aria-hidden": true }) : _jsx(Search, { size: 16, color: INK, "aria-hidden": true }) }), onMakeGroup ? (_jsx(XStack, { ...ROUND,
|
|
47
|
+
}, children: seeking ? _jsx(X, { size: 16, color: INK, "aria-hidden": true }) : _jsx(Search, { size: 16, color: INK, "aria-hidden": true }) }), onMakeGroup ? (_jsx(XStack, { ...ROUND, borderColor: "var(--border-strong)", focusVisibleStyle: { outlineWidth: 2, outlineStyle: 'solid', outlineColor: 'var(--ring)' }, "$max-sm": { width: 44, height: 44 }, "aria-label": t('New bot group'), onClick: onMakeGroup, disabled: disabled, opacity: disabled ? 0.5 : 1, children: _jsx(Users, { size: 15, color: INK, "aria-hidden": true }) })) : null, _jsx(XStack, { ...ROUND, borderColor: "var(--border-strong)", focusVisibleStyle: { outlineWidth: 2, outlineStyle: 'solid', outlineColor: 'var(--ring)' }, "$max-sm": { width: 44, height: 44 }, "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), onKeyDown: (e) => {
|
|
48
|
+
if (e.key === 'Escape') {
|
|
49
|
+
setSeeking(false);
|
|
50
|
+
setQuery('');
|
|
51
|
+
}
|
|
52
|
+
}, placeholder: t('Search bots & groups'), "aria-label": t('Search bots'), width: "100%", height: 34, "$max-sm": { minH: 44 }, px: 12, rounded: 999, bg: RAISED, borderWidth: 1, borderColor: "var(--border-strong)", focusStyle: { borderColor: 'var(--ring)' }, 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' }, flex: 1, items: "center", justify: "center", gap: 18, pt: 24, pb: 64, px: 20, children: [_jsxs(YStack, { items: "center", gap: 6, maxW: 320, children: [_jsx(Text, { render: "h2", m: 0, fontSize: 21, lineHeight: 26, fontWeight: "600", letterSpacing: -0.42, color: INK, text: "center", children: t('Make your first bot') }), _jsx(Text, { fontSize: 14, lineHeight: 20, color: DIM, text: "center", children: t('Give it instructions and tools, then message it right here.') })] }), _jsx(XStack, { ...PILL, bg: INK, borderColor: INK, minH: 38, "$max-sm": { minH: 44, px: 18 }, hoverStyle: { opacity: 0.9 }, focusVisibleStyle: { outlineWidth: 2, outlineStyle: 'solid', outlineColor: 'var(--ring)' }, onClick: onMake, children: _jsx(Text, { ...WORD, fontWeight: "600", color: "var(--background)", 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: 6, pb: 4, columnGap: 3, rowGap: 10, "$max-md": { px: 12, columnGap: 0, justify: 'space-between' }, children: grid.map((b) => {
|
|
48
53
|
const ext = b;
|
|
49
54
|
const here = b.name === open;
|
|
50
55
|
const isPrimary = Boolean(ext.isPrimary || b.name.toLowerCase() === PRIMARY_BOT);
|
|
51
56
|
const label = called(b.name);
|
|
52
|
-
return (_jsxs(YStack, { render: "button", type:
|
|
53
|
-
}) })) : null, shownGroups.length > 0 || (onMakeGroup && !disabled) ? (_jsxs(YStack, { "data-parity-key": "bots.groups", role: "group", "aria-label": t('Bot groups'), pt: 14, pb: 6, children: [_jsxs(XStack, { px: 16, pb:
|
|
57
|
+
return (_jsxs(YStack, { render: _jsx("button", { type: "button" }), "data-parity-key": "bots.tile", "data-name": b.name, "data-primary": isPrimary ? 'true' : undefined, "aria-current": here, "aria-label": isPrimary ? `${label} (${t('Primary bot')})` : label, onClick: () => onPick(b.name), width: 78, height: 96, rounded: 11, items: "center", pt: 5, gap: 3, bg: here ? PICKED : 'transparent', borderWidth: 1, borderColor: here ? 'var(--border-strong)' : 'transparent', cursor: "pointer", transition: "quickest", hoverStyle: { bg: here ? PICKED : 'var(--rail-hover, var(--muted))' }, focusVisibleStyle: { outlineWidth: 2, outlineStyle: 'solid', outlineColor: 'var(--ring)' }, "$max-md": { width: '33%' }, children: [_jsx(Face, { bot: b, size: 54, starred: isStarredBot(b) }), _jsx(Text, { ...CLIP, maxW: 72, fontSize: 13, lineHeight: 16, fontWeight: here || isPrimary ? '600' : '400', color: INK, children: label }), isPrimary ? (_jsx(Text, { fontSize: 11, lineHeight: 13, color: DIM, children: t('Primary') })) : null] }, b.id || b.name));
|
|
58
|
+
}) })) : null, query.trim() && shown.length === 0 && shownGroups.length === 0 ? (_jsx(YStack, { px: 16, py: 32, items: "center", gap: 6, children: _jsx(Text, { fontSize: 13, lineHeight: 18, color: DIM, text: "center", children: t('No bots match “{query}”.', { query: query.trim() }) }) })) : null, shownGroups.length > 0 || (!query.trim() && onMakeGroup && !disabled) ? (_jsxs(YStack, { "data-parity-key": "bots.groups", role: "group", "aria-label": t('Bot groups'), mt: grid.length ? 14 : 4, pt: grid.length ? 14 : 6, pb: 6, borderTopWidth: grid.length ? 1 : 0, borderColor: LINE, gap: 4, children: [_jsxs(XStack, { px: 16, pb: 4, items: "center", justify: "space-between", children: [_jsxs(XStack, { items: "center", gap: 6, children: [_jsx(Layers, { size: 12, color: DIM, "aria-hidden": true }), _jsx(Text, { fontSize: 12, lineHeight: 16, fontWeight: "600", color: DIM, children: t('Groups & layers') })] }), onMakeGroup && !disabled ? (_jsxs(XStack, { render: _jsx("button", { type: "button" }), onClick: onMakeGroup, items: "center", gap: 4, px: 7, py: 3, rounded: 6, bg: "transparent", borderWidth: 0, cursor: "pointer", transition: "quickest", hoverStyle: { bg: PICKED }, focusVisibleStyle: { outlineWidth: 2, outlineStyle: 'solid', outlineColor: 'var(--ring)' }, "$max-sm": { minH: 44, px: 10 }, children: [_jsx(Plus, { size: 12, color: DIM, "aria-hidden": true }), _jsx(Text, { fontSize: 12, lineHeight: 16, color: DIM, children: t('Group') })] })) : null] }), shownGroups.length === 0 && onMakeGroup && !disabled ? (_jsxs(XStack, { render: _jsx("button", { type: "button" }), onClick: onMakeGroup, mx: 10, px: 12, py: 9, "$max-sm": { minH: 48 }, rounded: 10, items: "center", gap: 10, bg: RAISED, borderWidth: 1, borderColor: LINE, cursor: "pointer", transition: "quickest", hoverStyle: { bg: PICKED, borderColor: 'var(--border-strong)' }, focusVisibleStyle: { outlineWidth: 2, outlineStyle: 'solid', outlineColor: 'var(--ring)' }, children: [_jsx(Users, { size: 15, color: DIM, "aria-hidden": true }), _jsxs(YStack, { flex: 1, minW: 0, items: "flex-start", gap: 2, children: [_jsx(Text, { ...CLIP, fontSize: 13, lineHeight: 17, fontWeight: "500", color: INK, children: t('Create a bot group') }), _jsx(Text, { ...CLIP, fontSize: 12, lineHeight: 16, color: DIM, children: t('Leader, Lux Quasar, or majority layers') })] })] })) : null, shownGroups.map((g) => {
|
|
54
59
|
const ref = toGroupRef(g.name);
|
|
55
60
|
const here = open === ref;
|
|
56
|
-
return (_jsxs(XStack, { render: "button", type:
|
|
57
|
-
})] })) : null, rows.length ? (
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
61
|
+
return (_jsxs(XStack, { render: _jsx("button", { type: "button" }), "data-parity-key": "bots.group.row", "data-group": g.name, "aria-current": here, onClick: () => onPick(ref), minH: 54, mx: 6, px: 12, py: 8, gap: 10, items: "center", rounded: 10, bg: here ? PICKED : 'transparent', borderWidth: 0, cursor: "pointer", transition: "quickest", hoverStyle: { bg: here ? PICKED : 'var(--rail-hover, var(--muted))' }, focusVisibleStyle: { outlineWidth: 2, outlineStyle: 'solid', outlineColor: 'var(--ring)' }, children: [_jsx(YStack, { width: 34, height: 34, rounded: 10, shrink: 0, items: "center", justify: "center", bg: RAISED, borderWidth: 1, borderColor: LINE, children: _jsx(Users, { size: 15, color: INK, "aria-hidden": true }) }), _jsxs(YStack, { flex: 1, minW: 0, items: "flex-start", gap: 2, children: [_jsxs(XStack, { items: "center", gap: 6, maxW: "100%", children: [_jsx(Text, { ...CLIP, fontSize: 13, lineHeight: 18, fontWeight: "500", color: INK, children: g.name }), _jsx(Text, { fontSize: 11, lineHeight: 15, color: DIM, shrink: 0, children: `L${g.layer || 1}` })] }), _jsx(Text, { ...CLIP, maxW: "100%", fontSize: 12, lineHeight: 16, color: DIM, children: `${policyBadge(g.policy)} · ${g.members.length} bots` })] })] }, g.id || g.name));
|
|
62
|
+
})] })) : null, rows.length ? (_jsxs(YStack, { "data-parity-key": "bots.rows", role: "group", "aria-label": t('More bots'), mt: 14, pt: 14, pb: 24, borderTopWidth: grid.length || shownGroups.length || (onMakeGroup && !disabled) ? 1 : 0, borderColor: LINE, gap: 4, children: [_jsx(Text, { px: 16, pb: 4, fontSize: 12, lineHeight: 16, fontWeight: "600", color: DIM, children: t('More bots') }), rows.map((b) => {
|
|
63
|
+
const here = b.name === open;
|
|
64
|
+
const label = called(b.name);
|
|
65
|
+
const word = lastWord(last.get(b.name)) || b.description || '';
|
|
66
|
+
return (_jsxs(XStack, { render: _jsx("button", { type: "button" }), "data-parity-key": "bots.row", "data-name": b.name, "aria-current": here, onClick: () => onPick(b.name), minH: 56, mx: 6, px: 12, py: 8, gap: 10, items: "center", rounded: 10, bg: here ? PICKED : 'transparent', borderWidth: 0, cursor: "pointer", transition: "quickest", hoverStyle: { bg: here ? PICKED : 'var(--rail-hover, var(--muted))' }, focusVisibleStyle: { outlineWidth: 2, outlineStyle: 'solid', outlineColor: 'var(--ring)' }, children: [_jsx(Face, { bot: b, size: 36 }), _jsxs(YStack, { flex: 1, minW: 0, items: "flex-start", gap: 2, children: [_jsx(Text, { ...CLIP, maxW: "100%", fontSize: 14, lineHeight: 19, fontWeight: "500", color: INK, children: label }), word ? (_jsx(Text, { ...CLIP, maxW: "100%", fontSize: 12, lineHeight: 17, color: DIM, children: word })) : null] })] }, b.id || b.name));
|
|
67
|
+
})] })) : 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 })] }));
|
|
63
68
|
}
|
|
64
69
|
/** You, at the foot: your account, external Connectors, and unified Hanzo Preferences. */
|
|
65
70
|
function Foot({ me }) {
|
|
@@ -82,5 +87,5 @@ function Foot({ me }) {
|
|
|
82
87
|
}, [me]);
|
|
83
88
|
if (!me)
|
|
84
89
|
return null;
|
|
85
|
-
return (_jsxs(_Fragment, { children: [_jsxs(XStack, { "data-parity-key": "bots.me",
|
|
90
|
+
return (_jsxs(_Fragment, { children: [_jsxs(XStack, { "data-parity-key": "bots.me", minH: 52, "$max-sm": { minH: 56, px: 10 }, 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: _jsx("button", { type: "button" }), "aria-label": t('Account: {name}', { name }), flex: 1, minW: 0, minH: 36, "$max-sm": { minH: 44 }, items: "center", gap: 9, px: 4, rounded: 8, bg: "transparent", borderWidth: 0, cursor: "pointer", transition: "quickest", hoverStyle: { bg: PICKED }, focusVisibleStyle: { outlineWidth: 2, outlineStyle: 'solid', outlineColor: 'var(--ring)' }, 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: () => { window.location.href = '/chat'; }, children: _jsx(Text, { fontSize: "$3", color: "$ink", children: t('Chat') }) }), _jsx(DropdownMenuItem, { onSelect: () => { window.location.href = '/home'; }, children: _jsx(Text, { fontSize: "$3", color: "$ink", children: t('Team') }) }), _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, borderColor: "var(--border-strong)", focusVisibleStyle: { outlineWidth: 2, outlineStyle: 'solid', outlineColor: 'var(--ring)' }, "$max-sm": { width: 44, height: 44 }, "aria-label": t('Connectors'), onClick: () => setConnectorsOpen(true), children: _jsx(Grid2x2Plus, { size: 16, color: INK, "aria-hidden": true }) }), _jsx(XStack, { ...ROUND, borderColor: "var(--border-strong)", focusVisibleStyle: { outlineWidth: 2, outlineStyle: 'solid', outlineColor: 'var(--ring)' }, "$max-sm": { width: 44, height: 44 }, "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 })] }));
|
|
86
91
|
}
|