@hanzo/app 0.3.94 → 0.3.96
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 +114 -48
- 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/PreferencesDialog.js +5 -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.d.ts +10 -0
- package/dist/Shell.js +258 -158
- 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 +16 -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.d.ts +4 -1
- package/dist/bots/Roster.js +71 -25
- package/dist/bots/Thread.js +54 -27
- package/dist/bots/face.js +9 -3
- package/dist/bots/grid.d.ts +36 -0
- package/dist/bots/grid.js +91 -0
- package/dist/bots/ink.d.ts +1 -1
- package/dist/bots/ink.js +1 -1
- package/dist/bots/kit.d.ts +9 -4
- package/dist/bots/kit.js +3 -2
- package/dist/chord.d.ts +13 -0
- package/dist/chord.js +30 -1
- package/dist/crew.js +47 -4
- package/dist/ground.d.ts +2 -2
- package/dist/ground.js +3 -3
- 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/durable.d.ts +1 -1
- package/dist/lib/durable.js +1 -1
- 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 +7 -1
- package/dist/lib/todo.js +41 -29
- 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/seek.d.ts +6 -1
- package/dist/seek.js +13 -0
- package/dist/thread.d.ts +2 -1
- package/dist/thread.js +85 -44
- package/package.json +11 -11
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.d.ts
CHANGED
|
@@ -1,14 +1,17 @@
|
|
|
1
1
|
import type { Agent, AgentRun } from '@hanzo/ai';
|
|
2
2
|
import { type BotGroup } from './api.js';
|
|
3
|
-
export declare function Roster({ bots, groups, last, open, unread, me, onPick, onMake, onMakeGroup, disabled, }: {
|
|
3
|
+
export declare function Roster({ bots, groups, last, open, unread, me, width, onPick, onMake, onMakeGroup, onWorkflows, disabled, }: {
|
|
4
4
|
bots: Agent[] | null;
|
|
5
5
|
groups?: readonly BotGroup[];
|
|
6
6
|
last: ReadonlyMap<string, AgentRun>;
|
|
7
7
|
open: string | null;
|
|
8
8
|
unread: string | null;
|
|
9
9
|
me: unknown;
|
|
10
|
+
/** Live sidebar width in px, driving the 1 → 2 → 3 column Pinned Bots grid. */
|
|
11
|
+
width?: number;
|
|
10
12
|
onPick: (name: string) => void;
|
|
11
13
|
onMake: () => void;
|
|
12
14
|
onMakeGroup?: () => void;
|
|
15
|
+
onWorkflows?: () => void;
|
|
13
16
|
disabled: boolean;
|
|
14
17
|
}): import("react").JSX.Element;
|
package/dist/bots/Roster.js
CHANGED
|
@@ -1,14 +1,17 @@
|
|
|
1
1
|
'use client';
|
|
2
2
|
import { Fragment as _Fragment, jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
|
-
// The roster: search, + Group, and + New bot at the top;
|
|
4
|
-
//
|
|
5
|
-
//
|
|
6
|
-
//
|
|
7
|
-
|
|
3
|
+
// The roster: search, density/column menu, + Group, and + New bot at the top;
|
|
4
|
+
// Pinned Bots in a 1→2→3 column resizable grid with 4 avatar sizes (xs/sm/md/lg);
|
|
5
|
+
// a monochrome hairline divider; layered Bot Groups (GROUPS & LAYERS); unpinned
|
|
6
|
+
// bots in single-column rows; a subtle /flow Workflows entry; and the reader +
|
|
7
|
+
// Connectors + Preferences at the foot.
|
|
8
|
+
import { useCallback, useEffect, useMemo, useState } from 'react';
|
|
8
9
|
import { useI18n } from '@hanzo/i18n/react';
|
|
9
10
|
import { Input, Text, XStack, YStack } from '@hanzo/gui';
|
|
10
11
|
import { DropdownMenu, DropdownMenuContent, DropdownMenuItem, DropdownMenuLabel, DropdownMenuSeparator, DropdownMenuTrigger, } from '@hanzo/ui';
|
|
11
|
-
import { Grid2x2Plus, Layers, Plus, Search, SlidersHorizontal, Users, X } from 'lucide-react';
|
|
12
|
+
import { ArrowLeft, Check, Grid2x2Plus, Layers, LayoutGrid, Pin, PinOff, Plus, Search, SlidersHorizontal, Users, Workflow, X, } from 'lucide-react';
|
|
13
|
+
import { useKept } from '../kept.js';
|
|
14
|
+
import { FLOW } from '../lib/host.js';
|
|
12
15
|
import { useSignOut } from '../lib/signout.js';
|
|
13
16
|
import { PreferencesDialog } from '../PreferencesDialog.js';
|
|
14
17
|
import { called } from '../team.js';
|
|
@@ -17,11 +20,25 @@ import { Face } from './face.js';
|
|
|
17
20
|
import { PRIMARY_BOT, toGroupRef } from './api.js';
|
|
18
21
|
import { CLIP, PILL, ROUND, WORD } from './kit.js';
|
|
19
22
|
import { DIM, FLOOR, INK, LINE, PICKED, RAISED } from './ink.js';
|
|
20
|
-
import { isStarredBot, lastWord, policyBadge, sortGroupsByLayer,
|
|
21
|
-
|
|
23
|
+
import { avatarSizePx, BOT_AVATAR_PX, BOT_ICON_SIZES, defaultPinnedNames, isBotIconSize, isStarredBot, lastWord, partitionPinned, policyBadge, resolveColumns, ROSTER_WIDTH_DEFAULT, sortGroupsByLayer, togglePinnedBot, } from './grid.js';
|
|
24
|
+
const SIZE_LABELS = {
|
|
25
|
+
xs: 'XS',
|
|
26
|
+
sm: 'SM',
|
|
27
|
+
md: 'MD',
|
|
28
|
+
lg: 'LG',
|
|
29
|
+
};
|
|
30
|
+
const COL_OPTIONS = ['auto', 1, 2, 3];
|
|
31
|
+
export function Roster({ bots, groups = [], last, open, unread, me, width = ROSTER_WIDTH_DEFAULT, onPick, onMake, onMakeGroup, onWorkflows, disabled, }) {
|
|
22
32
|
const { t } = useI18n();
|
|
23
33
|
const [seeking, setSeeking] = useState(false);
|
|
24
34
|
const [query, setQuery] = useState('');
|
|
35
|
+
const [storedSize, setIconSize] = useKept('hanzo.bots.roster.iconSize', 'md');
|
|
36
|
+
const [storedCols, setColPref] = useKept('hanzo.bots.roster.cols', 'auto');
|
|
37
|
+
const [pinnedNames, setPinnedNames] = useKept('hanzo.bots.roster.pinned', null);
|
|
38
|
+
const iconSize = isBotIconSize(storedSize) ? storedSize : 'md';
|
|
39
|
+
const colPref = storedCols === 'auto' || storedCols === 1 || storedCols === 2 || storedCols === 3 ? storedCols : 'auto';
|
|
40
|
+
const cols = resolveColumns(width, colPref);
|
|
41
|
+
const avatarPx = avatarSizePx(iconSize);
|
|
25
42
|
const shown = useMemo(() => {
|
|
26
43
|
const q = query.trim().toLowerCase();
|
|
27
44
|
const all = bots ?? [];
|
|
@@ -40,26 +57,55 @@ export function Roster({ bots, groups = [], last, open, unread, me, onPick, onMa
|
|
|
40
57
|
(g.description ?? '').toLowerCase().includes(q) ||
|
|
41
58
|
policyBadge(g.policy).toLowerCase().includes(q));
|
|
42
59
|
}, [groups, query]);
|
|
43
|
-
const {
|
|
44
|
-
|
|
60
|
+
const { pinned, unpinned } = useMemo(() => partitionPinned(shown, last, pinnedNames), [shown, last, pinnedNames]);
|
|
61
|
+
const togglePin = useCallback((name) => {
|
|
62
|
+
const base = pinnedNames ?? defaultPinnedNames(bots ?? []);
|
|
63
|
+
setPinnedNames(togglePinnedBot(base, name));
|
|
64
|
+
}, [bots, pinnedNames, setPinnedNames]);
|
|
65
|
+
const openWorkflows = () => {
|
|
66
|
+
if (onWorkflows) {
|
|
67
|
+
onWorkflows();
|
|
68
|
+
return;
|
|
69
|
+
}
|
|
70
|
+
if (typeof window !== 'undefined')
|
|
71
|
+
window.location.assign(FLOW);
|
|
72
|
+
};
|
|
73
|
+
const showWorkflows = !query.trim() || 'workflows'.includes(query.trim().toLowerCase()) || 'flow'.includes(query.trim().toLowerCase());
|
|
74
|
+
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, { ...CLIP, fontSize: 13, lineHeight: 18, fontWeight: "600", color: INK, children: t('hanzo.bot') })] })) : (_jsx(Text, { ...CLIP, fontSize: 13, lineHeight: 18, fontWeight: "600", color: DIM, children: t('hanzo.bot') })) }), _jsxs(XStack, { items: "center", gap: 6, shrink: 0, children: [_jsxs(DropdownMenu, { placement: "bottom-end", offset: 6, children: [_jsx(DropdownMenuTrigger, { asChild: true, children: _jsx(XStack, { ...ROUND, borderColor: "var(--border-strong)", focusVisibleStyle: { outlineWidth: 2, outlineStyle: 'solid', outlineColor: 'var(--ring)' }, "$max-sm": { width: 44, height: 44 }, "data-slot": "bots-density-trigger", "aria-label": t('Sidebar layout'), children: _jsx(LayoutGrid, { size: 14, color: INK, "aria-hidden": true }) }) }), _jsxs(DropdownMenuContent, { minW: 196, "aria-label": t('Sidebar layout'), children: [_jsx(DropdownMenuLabel, { children: _jsx(Text, { fontSize: 11, color: DIM, fontWeight: "600", children: t('Avatar size') }) }), BOT_ICON_SIZES.map((sz) => {
|
|
75
|
+
const active = iconSize === sz;
|
|
76
|
+
return (_jsx(DropdownMenuItem, { "data-slot": `bots-size-${sz}`, onSelect: () => setIconSize(sz), children: _jsxs(XStack, { flex: 1, items: "center", justify: "space-between", gap: 8, children: [_jsx(Text, { fontSize: 13, color: INK, fontWeight: active ? '600' : '400', children: `${SIZE_LABELS[sz]} · ${BOT_AVATAR_PX[sz]}px` }), active ? _jsx(Check, { size: 13, color: INK, "aria-hidden": true }) : null] }) }, sz));
|
|
77
|
+
}), _jsx(DropdownMenuSeparator, {}), _jsx(DropdownMenuLabel, { children: _jsx(Text, { fontSize: 11, color: DIM, fontWeight: "600", children: t('Pinned columns') }) }), COL_OPTIONS.map((opt) => {
|
|
78
|
+
const active = colPref === opt;
|
|
79
|
+
const label = opt === 'auto' ? t('Auto (1–3)') : opt === 1 ? t('1 column') : t('{n} columns', { n: opt });
|
|
80
|
+
return (_jsx(DropdownMenuItem, { "data-slot": `bots-cols-${opt}`, onSelect: () => setColPref(opt), children: _jsxs(XStack, { flex: 1, items: "center", justify: "space-between", gap: 8, children: [_jsx(Text, { fontSize: 13, color: INK, fontWeight: active ? '600' : '400', children: label }), active ? _jsx(Check, { size: 13, color: INK, "aria-hidden": true }) : null] }) }, String(opt)));
|
|
81
|
+
})] })] }), _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
82
|
setSeeking(!seeking);
|
|
46
83
|
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,
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
84
|
+
}, 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) => {
|
|
85
|
+
if (e.key === 'Escape') {
|
|
86
|
+
setSeeking(false);
|
|
87
|
+
setQuery('');
|
|
88
|
+
}
|
|
89
|
+
}, 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, pinned.length ? (_jsxs(YStack, { "data-slot": "bots-pinned", "data-cols": cols, "data-icon-size": iconSize, "data-avatar-px": avatarPx, pt: 2, pb: 10, children: [_jsxs(XStack, { px: 14, pb: 6, items: "center", justify: "space-between", children: [_jsxs(XStack, { items: "center", gap: 5, children: [_jsx(Pin, { size: 11, color: DIM, "aria-hidden": true }), _jsx(Text, { fontSize: 11, lineHeight: 15, fontWeight: "600", color: DIM, children: t('PINNED') })] }), _jsx(Text, { fontSize: 10, lineHeight: 14, color: DIM, children: `${SIZE_LABELS[iconSize]} · ${cols}c` })] }), _jsx(YStack, { "data-parity-key": "bots.grid", role: "group", "aria-label": t('Pinned bots'), display: "grid", gridTemplateColumns: `repeat(${cols}, minmax(0, 1fr))`, "$max-md": colPref === 'auto' ? { gridTemplateColumns: 'repeat(3, minmax(0, 1fr))' } : undefined, px: 8, gap: cols === 1 ? 4 : 6, minW: 0, children: pinned.map((b) => {
|
|
90
|
+
const ext = b;
|
|
91
|
+
const here = b.name === open;
|
|
92
|
+
const isPrimary = Boolean(ext.isPrimary || b.name.toLowerCase() === PRIMARY_BOT);
|
|
93
|
+
const label = called(b.name);
|
|
94
|
+
const nameFont = iconSize === 'xs' ? 11 : iconSize === 'sm' ? 12 : 13;
|
|
95
|
+
if (cols === 1) {
|
|
96
|
+
return (_jsxs(XStack, { "data-parity-key": "bots.tile", "data-name": b.name, "data-primary": isPrimary ? 'true' : undefined, items: "center", gap: 8, px: 8, py: iconSize === 'xs' ? 5 : 6, rounded: 10, bg: here ? PICKED : 'transparent', borderWidth: 1, borderColor: here ? 'var(--border-strong)' : 'transparent', transition: "quickest", hoverStyle: { bg: here ? PICKED : 'var(--rail-hover, var(--muted))' }, children: [_jsxs(XStack, { render: _jsx("button", { type: "button" }), "aria-current": here, "aria-label": isPrimary ? `${label} (${t('Primary bot')})` : label, onClick: () => onPick(b.name), flex: 1, minW: 0, items: "center", gap: 8, p: 0, bg: "transparent", borderWidth: 0, cursor: "pointer", focusVisibleStyle: { outlineWidth: 2, outlineStyle: 'solid', outlineColor: 'var(--ring)' }, children: [_jsx(Face, { bot: b, size: avatarPx, starred: isStarredBot(b) }), _jsxs(YStack, { flex: 1, minW: 0, items: "flex-start", children: [_jsx(Text, { ...CLIP, maxW: "100%", fontSize: nameFont, lineHeight: 16, fontWeight: here || isPrimary ? '600' : '500', color: INK, children: label }), isPrimary ? (_jsx(Text, { fontSize: 11, lineHeight: 13, color: DIM, children: t('Primary') })) : null] })] }), _jsx(XStack, { render: _jsx("button", { type: "button" }), "data-slot": "bots-unpin", "aria-label": t('Unpin {name}', { name: label }), onClick: () => togglePin(b.name), width: 22, height: 22, shrink: 0, rounded: 6, items: "center", justify: "center", bg: "transparent", borderWidth: 0, cursor: "pointer", opacity: 0.55, transition: "quickest", hoverStyle: { opacity: 1, bg: PICKED }, focusVisibleStyle: { opacity: 1, outlineWidth: 2, outlineStyle: 'solid', outlineColor: 'var(--ring)' }, children: _jsx(PinOff, { size: 11, color: DIM, "aria-hidden": true }) })] }, b.id || b.name));
|
|
97
|
+
}
|
|
98
|
+
return (_jsxs(YStack, { position: "relative", "data-parity-key": "bots.tile", "data-name": b.name, "data-primary": isPrimary ? 'true' : undefined, rounded: 11, bg: here ? PICKED : 'transparent', borderWidth: 1, borderColor: here ? 'var(--border-strong)' : 'transparent', transition: "quickest", hoverStyle: { bg: here ? PICKED : 'var(--rail-hover, var(--muted))' }, children: [_jsxs(YStack, { render: _jsx("button", { type: "button" }), "aria-current": here, "aria-label": isPrimary ? `${label} (${t('Primary bot')})` : label, onClick: () => onPick(b.name), width: "100%", minW: 0, rounded: 10, items: "center", pt: iconSize === 'xs' ? 6 : 8, pb: iconSize === 'xs' ? 5 : 7, px: 4, gap: iconSize === 'xs' ? 3 : 5, bg: "transparent", borderWidth: 0, cursor: "pointer", focusVisibleStyle: { outlineWidth: 2, outlineStyle: 'solid', outlineColor: 'var(--ring)' }, children: [_jsx(Face, { bot: b, size: avatarPx, starred: isStarredBot(b) }), _jsx(Text, { ...CLIP, maxW: "100%", fontSize: nameFont, lineHeight: 16, fontWeight: here || isPrimary ? '600' : '400', color: INK, children: label }), isPrimary ? (_jsx(Text, { fontSize: 11, lineHeight: 13, color: DIM, children: t('Primary') })) : null] }), _jsx(XStack, { render: _jsx("button", { type: "button" }), "data-slot": "bots-unpin", "aria-label": t('Unpin {name}', { name: label }), onClick: () => togglePin(b.name), position: "absolute", t: 3, r: 3, width: 18, height: 18, rounded: 5, items: "center", justify: "center", bg: "transparent", borderWidth: 0, cursor: "pointer", opacity: 0.45, transition: "quickest", hoverStyle: { opacity: 1, bg: PICKED }, focusVisibleStyle: { opacity: 1, outlineWidth: 2, outlineStyle: 'solid', outlineColor: 'var(--ring)' }, children: _jsx(PinOff, { size: 10, color: DIM, "aria-hidden": true }) })] }, b.id || b.name));
|
|
99
|
+
}) })] })) : null, pinned.length ? (_jsx(YStack, { "data-slot": "bots-divider", mx: 10, borderTopWidth: 1, borderColor: LINE })) : 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: pinned.length ? 10 : 4, pt: pinned.length ? 8 : 6, pb: 6, 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
100
|
const ref = toGroupRef(g.name);
|
|
55
101
|
const here = open === ref;
|
|
56
|
-
return (_jsxs(XStack, { render: "button", type:
|
|
57
|
-
})] })) : null,
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
102
|
+
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));
|
|
103
|
+
})] })) : null, unpinned.length ? (_jsxs(YStack, { "data-slot": "bots-unpinned", "data-parity-key": "bots.rows", role: "group", "aria-label": t('All bots'), mt: 10, pt: 12, pb: 12, borderTopWidth: pinned.length || shownGroups.length || (onMakeGroup && !disabled) ? 1 : 0, borderColor: LINE, gap: 4, children: [_jsx(XStack, { px: 16, pb: 4, items: "center", children: _jsx(Text, { fontSize: 12, lineHeight: 16, fontWeight: "600", color: DIM, children: t('BOTS') }) }), unpinned.map((b) => {
|
|
104
|
+
const here = b.name === open;
|
|
105
|
+
const label = called(b.name);
|
|
106
|
+
const word = lastWord(last.get(b.name)) || b.description || '';
|
|
107
|
+
return (_jsxs(XStack, { "data-parity-key": "bots.row", "data-name": b.name, minH: 56, mx: 6, px: 10, py: 8, gap: 8, items: "center", rounded: 10, bg: here ? PICKED : 'transparent', transition: "quickest", hoverStyle: { bg: here ? PICKED : 'var(--rail-hover, var(--muted))' }, children: [_jsxs(XStack, { render: _jsx("button", { type: "button" }), "aria-current": here, onClick: () => onPick(b.name), flex: 1, minW: 0, gap: 10, items: "center", p: 0, bg: "transparent", borderWidth: 0, cursor: "pointer", 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] })] }), _jsx(XStack, { render: _jsx("button", { type: "button" }), "data-slot": "bots-pin", "aria-label": t('Pin {name}', { name: label }), onClick: () => togglePin(b.name), width: 24, height: 24, shrink: 0, rounded: 6, items: "center", justify: "center", bg: "transparent", borderWidth: 0, cursor: "pointer", opacity: 0.5, transition: "quickest", hoverStyle: { opacity: 1, bg: PICKED }, focusVisibleStyle: { opacity: 1, outlineWidth: 2, outlineStyle: 'solid', outlineColor: 'var(--ring)' }, children: _jsx(Pin, { size: 12, color: DIM, "aria-hidden": true }) })] }, b.id || b.name));
|
|
108
|
+
})] })) : null, showWorkflows ? (_jsxs(YStack, { "data-slot": "bots-workflows", pt: 6, pb: 14, children: [_jsx(YStack, { mx: 10, mb: 8, borderTopWidth: 1, borderColor: LINE }), _jsxs(XStack, { render: "button", type: 'button', "data-slot": "bots-workflows-link", "aria-label": t('Workflows'), onClick: openWorkflows, height: 38, $touchable: { minH: 44 }, mx: 6, px: 12, gap: 10, minW: 0, items: "center", rounded: 10, bg: "transparent", borderWidth: 0, cursor: "pointer", hoverStyle: { bg: 'var(--rail-hover, var(--muted))' }, focusVisibleStyle: { outlineWidth: 2, outlineStyle: 'solid', outlineColor: '$outlineColor' }, children: [_jsx(Workflow, { size: 15, color: DIM, "aria-hidden": true }), _jsx(Text, { ...CLIP, flex: 1, text: "left", fontSize: 13, lineHeight: 18, fontWeight: "500", color: INK, children: t('Workflows') }), _jsx(Text, { fontSize: 11, lineHeight: 14, color: DIM, children: FLOW })] })] })) : null] }), unpinned.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
109
|
}
|
|
64
110
|
/** You, at the foot: your account, external Connectors, and unified Hanzo Preferences. */
|
|
65
111
|
function Foot({ me }) {
|
|
@@ -82,5 +128,5 @@ function Foot({ me }) {
|
|
|
82
128
|
}, [me]);
|
|
83
129
|
if (!me)
|
|
84
130
|
return null;
|
|
85
|
-
return (_jsxs(_Fragment, { children: [_jsxs(XStack, { "data-parity-key": "bots.me",
|
|
131
|
+
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
132
|
}
|