@hanzo/app 0.3.85 → 0.3.86

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.
@@ -0,0 +1,284 @@
1
+ 'use client';
2
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
3
+ // Multi-layer Bot Groups:
4
+ // - MakeGroupDialog: create or edit a Bot Group at Layer 1..3, attach a parent group
5
+ // for multi-layer hierarchies, choose member bots, and configure any coordination
6
+ // policy: Lux Quasar (Polaris/Aurora/Pulsar dual-certificate finality), Leader,
7
+ // Majority, Weighted, Unanimous, Kai neurosymbolic, or Custom rubric.
8
+ // - GroupThread + GroupPanel: run coordinated tasks across all bots in a group,
9
+ // inspect individual member verdicts/proposals, verify Lux Quasar SHA3-384
10
+ // threshold & checkpoint commitments, and route Slack channels to the group.
11
+ import { useEffect, useMemo, useState } from 'react';
12
+ import { useI18n } from '@hanzo/i18n/react';
13
+ import { Input, Text, XStack, YStack } from '@hanzo/gui';
14
+ import { Button, Dialog, DialogContent, DialogTitle, DropdownMenu, DropdownMenuContent, DropdownMenuItem, DropdownMenuTrigger, Switch, } from '@hanzo/ui';
15
+ import { ArrowLeft, Check, ChevronDown, ChevronRight, Layers, PanelRight, Send, ShieldCheck, Sparkles, Users, X, } from 'lucide-react';
16
+ import { useAi } from '../lib/ai.js';
17
+ import { plainly, say } from '../failure.js';
18
+ import { called } from '../team.js';
19
+ import { Face } from './face.js';
20
+ import { NAME, PRIMARY_BOT, answering, createGroup, runGroup, setAnswering, slackChannels, slackStatus, toGroupRef, updateGroup, } from './api.js';
21
+ import { policyBadge } from './grid.js';
22
+ import { CARD, CLIP, LABEL, PILL, ROUND, WORD } from './kit.js';
23
+ import { DIM, GROUND, INK, LINE, PICKED, RAISED } from './ink.js';
24
+ const FIELD = {
25
+ unstyled: true,
26
+ width: '100%',
27
+ px: 14,
28
+ py: 10,
29
+ rounded: 12,
30
+ bg: RAISED,
31
+ borderWidth: 1,
32
+ borderColor: LINE,
33
+ color: INK,
34
+ fontSize: 14,
35
+ placeholderTextColor: '$placeholderColor',
36
+ };
37
+ const POLICY_OPTIONS = [
38
+ {
39
+ id: 'quasar',
40
+ label: 'Lux Quasar Consensus',
41
+ summary: 'Metastable k-sample α-quorum + β-round finality with SHA3-384 threshold & checkpoint certificates.',
42
+ },
43
+ {
44
+ id: 'leader',
45
+ label: 'Leader Directed',
46
+ summary: 'Designated group leader directs members and synthesizes all subordinate proposals.',
47
+ },
48
+ {
49
+ id: 'majority',
50
+ label: 'Majority Vote',
51
+ summary: 'One-bot-one-vote (>50%) over structured member verdicts; escalates ties to Primary Bot.',
52
+ },
53
+ {
54
+ id: 'weighted',
55
+ label: 'Weighted Stake / Trust',
56
+ summary: 'Each member carries an explicit weight; highest weighted verdict wins.',
57
+ },
58
+ {
59
+ id: 'unanimous',
60
+ label: 'Unanimous Quorum',
61
+ summary: 'Requires 100% agreement across all active bots in the group.',
62
+ },
63
+ {
64
+ id: 'kai',
65
+ label: 'Kai Confidence Synthesis',
66
+ summary: 'Filters proposals by calibrated confidence floor and synthesizes high-certainty reasoning.',
67
+ },
68
+ {
69
+ id: 'custom',
70
+ label: 'Custom Policy Rubric',
71
+ summary: 'Evaluates member proposals against a custom governance or constitutional prompt.',
72
+ },
73
+ ];
74
+ const QUASAR_PROFILES = [
75
+ { id: 'polaris', label: 'Polaris', detail: 'k=3 · α=0.67 · β=1 (Low latency)', k: 3, alpha: 0.67, beta: 1 },
76
+ { id: 'aurora', label: 'Aurora', detail: 'k=5 · α=0.67 · β=2 (Balanced BFT)', k: 5, alpha: 0.67, beta: 2 },
77
+ { id: 'pulsar', label: 'Pulsar', detail: 'k=7 · α=0.75 · β=3 (High assurance)', k: 7, alpha: 0.75, beta: 3 },
78
+ ];
79
+ export function MakeGroupDialog({ bots, groups, initial, onDone, onCancel, }) {
80
+ const { t } = useI18n();
81
+ const { client } = useAi();
82
+ const [name, setName] = useState(initial?.name ?? '');
83
+ const [description, setDescription] = useState(initial?.description ?? '');
84
+ const [layer, setLayer] = useState(initial?.layer ?? 1);
85
+ const [parentGroupId, setParentGroupId] = useState(initial?.parentGroupId ?? '');
86
+ const [members, setMembers] = useState(() => {
87
+ if (initial?.members?.length)
88
+ return [...initial.members];
89
+ const workers = bots.filter((b) => !b.isPrimary && b.name.toLowerCase() !== PRIMARY_BOT).slice(0, 3);
90
+ return workers.map((b) => b.name);
91
+ });
92
+ const [kind, setKind] = useState(initial?.policy?.kind ?? 'quasar');
93
+ const [leader, setLeader] = useState(initial?.policy?.leader ?? '');
94
+ const [quasarProfile, setQuasarProfile] = useState(initial?.policy?.quasarProfile ?? 'aurora');
95
+ const [escalateToPrimary, setEscalateToPrimary] = useState(initial?.policy?.escalateToPrimary ?? true);
96
+ const [minConfidence, setMinConfidence] = useState(String(initial?.policy?.minConfidence ?? 0.65));
97
+ const [customPrompt, setCustomPrompt] = useState(initial?.policy?.customPrompt ?? '');
98
+ const [weights, setWeights] = useState(initial?.policy?.weights ?? {});
99
+ const [busy, setBusy] = useState(false);
100
+ const [wrong, setWrong] = useState(null);
101
+ const named = NAME.test(name.trim());
102
+ const ok = named && members.length > 0 && !busy;
103
+ const toggleMember = (botName) => {
104
+ setMembers((prev) => (prev.includes(botName) ? prev.filter((m) => m !== botName) : [...prev, botName]));
105
+ };
106
+ const parentChoices = useMemo(() => groups.filter((g) => g.id !== initial?.id && g.name !== initial?.name && (g.layer || 1) < layer), [groups, initial, layer]);
107
+ const submit = async (e) => {
108
+ e.preventDefault();
109
+ if (!client || !ok)
110
+ return;
111
+ setBusy(true);
112
+ setWrong(null);
113
+ try {
114
+ const prof = QUASAR_PROFILES.find((p) => p.id === quasarProfile) ?? QUASAR_PROFILES[1];
115
+ const policy = {
116
+ kind,
117
+ escalateToPrimary,
118
+ };
119
+ if (kind === 'leader') {
120
+ policy.leader = leader || members[0];
121
+ }
122
+ else if (kind === 'quasar') {
123
+ policy.quasarProfile = quasarProfile;
124
+ policy.sampleK = prof.k;
125
+ policy.alpha = prof.alpha;
126
+ policy.beta = prof.beta;
127
+ }
128
+ else if (kind === 'weighted') {
129
+ const w = {};
130
+ for (const m of members)
131
+ w[m] = Math.max(1, Number(weights[m] ?? 1));
132
+ policy.weights = w;
133
+ }
134
+ else if (kind === 'kai') {
135
+ const conf = Number(minConfidence);
136
+ policy.minConfidence = Number.isFinite(conf) && conf > 0 && conf <= 1 ? conf : 0.65;
137
+ }
138
+ else if (kind === 'custom') {
139
+ policy.customPrompt = customPrompt.trim() || 'Synthesize the strongest verified proposal and highlight risks.';
140
+ }
141
+ const payload = {
142
+ name: name.trim(),
143
+ description: description.trim(),
144
+ layer,
145
+ parentGroupId: parentGroupId || undefined,
146
+ members,
147
+ policy,
148
+ };
149
+ const saved = initial ? await updateGroup(client, initial.name, payload) : await createGroup(client, payload);
150
+ await onDone(saved);
151
+ }
152
+ catch (err) {
153
+ setWrong(plainly(err, t('this bot group'), t));
154
+ }
155
+ finally {
156
+ setBusy(false);
157
+ }
158
+ };
159
+ const activePolicy = POLICY_OPTIONS.find((p) => p.id === kind) ?? POLICY_OPTIONS[0];
160
+ return (_jsx(Dialog, { open: true, onOpenChange: (v) => (v ? undefined : onCancel()), children: _jsxs(DialogContent, { "data-parity-key": "bots.group.make", width: "calc(100vw - 32px)", maxW: 540, bg: "var(--popover)", rounded: 20, p: 20, gap: 14, borderWidth: 1, borderColor: LINE, children: [_jsx(DialogTitle, { fontSize: 18, lineHeight: 24, fontWeight: "600", color: "$ink", children: initial ? t('Edit Bot Group') : t('New Bot Group') }), _jsxs(YStack, { render: "form", onSubmit: submit, gap: 12, maxH: "76vh", overflowY: "auto", pr: 2, children: [_jsx(Input, { ...FIELD, autoFocus: true, disabled: Boolean(initial), value: name, onChange: (e) => setName(e.target.value), placeholder: t('Group name (e.g. core-eng, security-quorum)'), "aria-label": t('Group name') }), name.trim() && !named ? (_jsx(Text, { fontSize: 12, lineHeight: 17, color: DIM, px: 4, children: t('Letters, digits, dot, dash and underscore; starts with a letter or digit.') })) : null, _jsx(Input, { ...FIELD, value: description, onChange: (e) => setDescription(e.target.value), placeholder: t('Mission — what this layer of bots coordinates on'), "aria-label": t('Group description') }), _jsxs(XStack, { gap: 8, items: "center", flexWrap: "wrap", children: [_jsx(Text, { fontSize: 13, lineHeight: 18, color: DIM, px: 2, children: t('Coordination Layer:') }), [1, 2, 3].map((lv) => {
161
+ const active = layer === lv;
162
+ return (_jsx(XStack, { render: "button", type: 'button', onClick: () => {
163
+ setLayer(lv);
164
+ if (lv === 1)
165
+ setParentGroupId('');
166
+ }, height: 30, px: 12, rounded: 999, items: "center", bg: active ? INK : RAISED, borderWidth: 1, borderColor: active ? INK : LINE, cursor: "pointer", children: _jsx(Text, { fontSize: 12, lineHeight: 16, fontWeight: "500", color: active ? 'var(--background)' : INK, children: lv === 1 ? t('Layer 1 · Under Primary') : lv === 2 ? t('Layer 2 · Sub-group') : t('Layer 3 · Execution') }) }, lv));
167
+ })] }), layer > 1 && parentChoices.length > 0 ? (_jsxs(XStack, { items: "center", justify: "space-between", px: 12, py: 9, rounded: 12, bg: RAISED, borderWidth: 1, borderColor: LINE, children: [_jsx(Text, { fontSize: 13, lineHeight: 18, color: DIM, children: t('Reports to upper-layer group') }), _jsxs(DropdownMenu, { placement: "bottom-end", offset: 6, children: [_jsx(DropdownMenuTrigger, { asChild: true, children: _jsxs(XStack, { render: "button", type: 'button', items: "center", gap: 5, bg: "transparent", borderWidth: 0, cursor: "pointer", children: [_jsx(Text, { fontSize: 13, lineHeight: 18, fontWeight: "500", color: INK, children: parentChoices.find((g) => g.id === parentGroupId || g.name === parentGroupId)?.name || t('Primary Bot (hanzo)') }), _jsx(ChevronDown, { size: 14, color: DIM, "aria-hidden": true })] }) }), _jsxs(DropdownMenuContent, { minW: 200, children: [_jsx(DropdownMenuItem, { onSelect: () => setParentGroupId(''), children: _jsx(Text, { fontSize: "$3", color: "$ink", children: t('Primary Bot (hanzo · Layer 0)') }) }), parentChoices.map((pg) => (_jsx(DropdownMenuItem, { onSelect: () => setParentGroupId(pg.id), children: _jsx(Text, { fontSize: "$3", color: "$ink", children: `${pg.name} (Layer ${pg.layer})` }) }, pg.id)))] })] })] })) : null, _jsxs(YStack, { gap: 8, p: 12, rounded: 14, bg: RAISED, borderWidth: 1, borderColor: LINE, children: [_jsxs(XStack, { items: "center", justify: "space-between", children: [_jsx(Text, { fontSize: 13, lineHeight: 18, fontWeight: "500", color: INK, children: t('Consensus / Leadership Policy') }), _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: 6, bg: PICKED, borderWidth: 1, borderColor: LINE, cursor: "pointer", children: [_jsx(Text, { fontSize: 12, lineHeight: 16, fontWeight: "600", color: INK, children: activePolicy.label }), _jsx(ChevronDown, { size: 13, color: DIM, "aria-hidden": true })] }) }), _jsx(DropdownMenuContent, { minW: 250, children: POLICY_OPTIONS.map((opt) => (_jsx(DropdownMenuItem, { onSelect: () => setKind(opt.id), children: _jsx(YStack, { gap: 2, children: _jsx(Text, { fontSize: "$3", fontWeight: opt.id === kind ? '600' : '400', color: "$ink", children: opt.label }) }) }, opt.id))) })] })] }), _jsx(Text, { fontSize: 12, lineHeight: 17, color: DIM, children: activePolicy.summary }), kind === 'quasar' ? (_jsxs(YStack, { gap: 8, pt: 4, children: [_jsx(XStack, { gap: 6, flexWrap: "wrap", children: QUASAR_PROFILES.map((p) => {
168
+ const active = quasarProfile === p.id;
169
+ return (_jsx(XStack, { render: "button", type: 'button', onClick: () => setQuasarProfile(p.id), height: 28, px: 11, rounded: 999, items: "center", gap: 5, bg: active ? INK : GROUND, borderWidth: 1, borderColor: active ? INK : LINE, cursor: "pointer", children: _jsx(Text, { fontSize: 12, lineHeight: 16, fontWeight: "500", color: active ? 'var(--background)' : INK, children: p.label }) }, p.id));
170
+ }) }), _jsx(Text, { fontSize: 11, lineHeight: 16, color: DIM, children: QUASAR_PROFILES.find((p) => p.id === quasarProfile)?.detail })] })) : null, kind === 'leader' && members.length > 0 ? (_jsxs(XStack, { items: "center", justify: "space-between", pt: 4, children: [_jsx(Text, { fontSize: 12, lineHeight: 17, color: DIM, children: t('Group Leader Bot') }), _jsxs(DropdownMenu, { placement: "bottom-end", offset: 6, children: [_jsx(DropdownMenuTrigger, { asChild: true, children: _jsxs(XStack, { render: "button", type: 'button', height: 28, px: 10, rounded: 999, items: "center", gap: 5, bg: GROUND, borderWidth: 1, borderColor: LINE, cursor: "pointer", children: [_jsx(Text, { fontSize: 12, lineHeight: 16, fontWeight: "500", color: INK, children: called(leader || members[0]) }), _jsx(ChevronDown, { size: 13, color: DIM, "aria-hidden": true })] }) }), _jsx(DropdownMenuContent, { minW: 180, children: members.map((m) => (_jsx(DropdownMenuItem, { onSelect: () => setLeader(m), children: _jsx(Text, { fontSize: "$3", color: "$ink", children: called(m) }) }, m))) })] })] })) : null, kind === 'weighted' && members.length > 0 ? (_jsx(YStack, { gap: 6, pt: 4, children: members.map((m) => (_jsxs(XStack, { items: "center", justify: "space-between", children: [_jsx(Text, { fontSize: 12, lineHeight: 16, color: INK, children: called(m) }), _jsx(Input, { unstyled: true, width: 64, height: 28, px: 8, rounded: 8, bg: GROUND, borderWidth: 1, borderColor: LINE, color: INK, fontSize: 12, inputMode: "numeric", value: String(weights[m] ?? 1), onChange: (e) => setWeights((prev) => ({ ...prev, [m]: Math.max(1, Number(e.target.value.replace(/[^\d]/g, '')) || 1) })) })] }, m))) })) : null, kind === 'kai' ? (_jsxs(XStack, { items: "center", justify: "space-between", pt: 4, children: [_jsx(Text, { fontSize: 12, lineHeight: 17, color: DIM, children: t('Minimum confidence floor (0.1 – 1.0)') }), _jsx(Input, { unstyled: true, width: 72, height: 28, px: 8, rounded: 8, bg: GROUND, borderWidth: 1, borderColor: LINE, color: INK, fontSize: 12, value: minConfidence, onChange: (e) => setMinConfidence(e.target.value) })] })) : null, kind === 'custom' ? (_jsx(Input, { ...FIELD, render: "textarea", rows: 3, bg: GROUND, value: customPrompt, onChange: (e) => setCustomPrompt(e.target.value), placeholder: t('Describe how competing bot proposals should be judged and combined…') })) : null, _jsxs(XStack, { items: "center", justify: "space-between", pt: 4, children: [_jsx(Text, { fontSize: 12, lineHeight: 17, color: DIM, children: t('Escalate split quorum to Primary Bot (hanzo)') }), _jsx(Switch, { checked: escalateToPrimary, onCheckedChange: setEscalateToPrimary })] })] }), _jsxs(YStack, { gap: 8, children: [_jsxs(XStack, { items: "center", justify: "space-between", px: 4, children: [_jsx(Text, { fontSize: 13, lineHeight: 18, fontWeight: "500", color: INK, children: t('Member Bots ({n})', { n: members.length }) }), bots.length > 0 ? (_jsx(XStack, { render: "button", type: 'button', onClick: () => setMembers(bots.map((b) => b.name)), bg: "transparent", borderWidth: 0, cursor: "pointer", children: _jsx(Text, { fontSize: 12, lineHeight: 16, color: DIM, children: t('Select all') }) })) : null] }), _jsx(XStack, { flexWrap: "wrap", gap: 6, children: bots.map((b) => {
171
+ const picked = members.includes(b.name);
172
+ return (_jsxs(XStack, { render: "button", type: 'button', 'aria-pressed': picked, onClick: () => toggleMember(b.name), height: 32, pl: 6, pr: 11, rounded: 999, items: "center", gap: 6, bg: picked ? PICKED : RAISED, borderWidth: 1, borderColor: picked ? INK : LINE, cursor: "pointer", children: [_jsx(Face, { bot: b, size: 20 }), _jsx(Text, { fontSize: 12, lineHeight: 16, fontWeight: picked ? '500' : '400', color: INK, children: called(b.name) }), picked ? _jsx(Check, { size: 12, color: INK, "aria-hidden": true }) : null] }, b.name));
173
+ }) })] }), 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: busy ? t('Saving…') : initial ? t('Save group') : t('Create group') }) })] })] })] }) }));
174
+ }
175
+ export function GroupThread({ group, bots, side, onSide, onBack, onEdit, onPickBot, }) {
176
+ const { t } = useI18n();
177
+ const { client } = useAi();
178
+ const [turns, setTurns] = useState([]);
179
+ const [input, setInput] = useState('');
180
+ const [running, setRunning] = useState(false);
181
+ const [expanded, setExpanded] = useState({});
182
+ const send = async (e) => {
183
+ e.preventDefault();
184
+ const prompt = input.trim();
185
+ if (!client || !prompt || running)
186
+ return;
187
+ const id = `gt_${Date.now()}`;
188
+ setInput('');
189
+ setRunning(true);
190
+ setTurns((prev) => [...prev, { id, input: prompt, at: Date.now() }]);
191
+ try {
192
+ const res = await runGroup(client, group.name, prompt);
193
+ setTurns((prev) => prev.map((row) => (row.id === id ? { ...row, result: res } : row)));
194
+ }
195
+ catch (err) {
196
+ setTurns((prev) => prev.map((row) => (row.id === id ? { ...row, error: say(err, group.name, 'save', t) } : row)));
197
+ }
198
+ finally {
199
+ setRunning(false);
200
+ }
201
+ };
202
+ return (_jsxs(YStack, { flex: 1, minH: 0, height: "100%", bg: GROUND, children: [_jsxs(XStack, { "data-parity-key": "bots.bar", height: 54, px: 14, items: "center", justify: "space-between", gap: 10, borderBottomWidth: 1, borderColor: LINE, children: [_jsxs(XStack, { items: "center", gap: 8, minW: 0, children: [_jsx(XStack, { ...ROUND, display: "none", "$max-md": { display: 'flex' }, "aria-label": t('Back to roster'), onClick: onBack, children: _jsx(ArrowLeft, { size: 16, color: INK, "aria-hidden": true }) }), _jsxs(XStack, { ...PILL, "data-parity-key": "bots.pill", onClick: onEdit, children: [_jsx(Users, { size: 15, color: INK, "aria-hidden": true }), _jsx(Text, { ...WORD, children: group.name }), _jsx(Text, { fontSize: 12, lineHeight: 16, color: DIM, children: `Layer ${group.layer || 1} · ${policyBadge(group.policy)}` })] })] }), _jsx(XStack, { items: "center", gap: 8, children: _jsx(XStack, { ...ROUND, "aria-label": t('Toggle group inspector'), "aria-pressed": side, onClick: onSide, children: _jsx(PanelRight, { size: 16, color: INK, "aria-hidden": true }) }) })] }), _jsxs(YStack, { "data-parity-key": "bots.thread", flex: 1, minH: 0, overflowY: "auto", px: 20, py: 20, gap: 18, children: [turns.length === 0 ? (_jsxs(YStack, { flex: 1, items: "center", justify: "center", gap: 14, py: 48, maxW: 520, self: "center", children: [_jsx(YStack, { width: 56, height: 56, rounded: 16, bg: RAISED, borderWidth: 1, borderColor: LINE, items: "center", justify: "center", children: _jsx(Layers, { size: 24, color: INK, "aria-hidden": true }) }), _jsx(Text, { fontSize: 18, lineHeight: 24, fontWeight: "600", color: INK, text: "center", children: `${group.name} · ${policyBadge(group.policy)}` }), _jsx(Text, { fontSize: 13, lineHeight: 19, color: DIM, text: "center", children: group.description ||
203
+ t('Layer {layer} Bot Group with {n} bots. Send a directive below — every sampled bot proposes in parallel and resolves under {policy} (or Primary Bot hanzo can invoke group_{slug} automatically).', {
204
+ layer: group.layer || 1,
205
+ n: group.members.length,
206
+ policy: policyBadge(group.policy),
207
+ slug: group.name,
208
+ }) }), _jsx(XStack, { flexWrap: "wrap", justify: "center", gap: 6, children: group.members.map((m) => {
209
+ const b = bots.find((x) => x.name === m) ?? { name: m };
210
+ return (_jsxs(XStack, { render: "button", type: 'button', onClick: () => onPickBot(m), height: 30, pl: 6, pr: 10, rounded: 999, items: "center", gap: 6, bg: RAISED, borderWidth: 1, borderColor: LINE, cursor: "pointer", hoverStyle: { bg: PICKED }, children: [_jsx(Face, { bot: b, size: 20 }), _jsx(Text, { fontSize: 12, lineHeight: 16, color: INK, children: called(m) })] }, m));
211
+ }) })] })) : null, turns.map((turn) => {
212
+ const res = turn.result;
213
+ const quasar = res?.quasar;
214
+ const showProps = Boolean(expanded[turn.id]);
215
+ return (_jsxs(YStack, { gap: 12, maxW: 760, width: "100%", self: "center", children: [_jsx(XStack, { justify: "flex-end", children: _jsx(YStack, { "data-parity-key": "bots.mine", maxW: "82%", px: 15, py: 10, rounded: 18, bg: PICKED, borderWidth: 1, borderColor: LINE, children: _jsx(Text, { fontSize: 14, lineHeight: 20, color: INK, children: turn.input }) }) }), !res && !turn.error ? (_jsxs(XStack, { items: "center", gap: 8, px: 4, children: [_jsx(Sparkles, { size: 14, color: DIM, "aria-hidden": true }), _jsx(Text, { fontSize: 13, lineHeight: 18, color: DIM, children: t('Running {n} bots across Layer {layer} ({policy})…', {
216
+ n: group.members.length,
217
+ layer: group.layer || 1,
218
+ policy: policyBadge(group.policy),
219
+ }) })] })) : null, turn.error ? (_jsx(YStack, { px: 14, py: 11, rounded: 14, bg: RAISED, borderWidth: 1, borderColor: LINE, children: _jsx(Text, { fontSize: 13, lineHeight: 19, color: DIM, children: turn.error }) })) : null, res ? (_jsxs(YStack, { gap: 10, children: [quasar ? (_jsxs(YStack, { px: 13, py: 10, rounded: 12, bg: RAISED, borderWidth: 1, borderColor: LINE, gap: 5, children: [_jsxs(XStack, { items: "center", justify: "space-between", flexWrap: "wrap", gap: 8, children: [_jsxs(XStack, { items: "center", gap: 6, children: [_jsx(ShieldCheck, { size: 14, color: INK, "aria-hidden": true }), _jsx(Text, { fontSize: 12, lineHeight: 16, fontWeight: "600", color: INK, children: quasar.finalized
220
+ ? t('Lux Quasar Finalized · {profile}', { profile: quasar.profile.toUpperCase() })
221
+ : t('Lux Quasar Escalated to Primary ({to})', { to: res.escalatedTo || PRIMARY_BOT }) })] }), _jsx(Text, { fontSize: 11, lineHeight: 15, color: DIM, children: `Support ${Math.round((quasar.support || 0) * 100)}% · Rounds ${quasar.rounds}/${quasar.beta} · k=${quasar.sampleK}` })] }), _jsx(Text, { ...CLIP, fontSize: 11, lineHeight: 15, color: DIM, children: `SHA3-384 Cert: ${quasar.checkpointDigest.slice(0, 24)}… · Threshold: ${quasar.thresholdCommitment.slice(0, 20)}…` })] })) : null, _jsxs(YStack, { "data-parity-key": "bots.theirs", px: 16, py: 13, rounded: 16, bg: RAISED, borderWidth: 1, borderColor: LINE, gap: 8, children: [_jsx(Text, { fontSize: 14, lineHeight: 21, color: INK, whiteSpace: "pre-wrap", children: res.output }), res.proposals?.length ? (_jsxs(YStack, { pt: 6, borderTopWidth: 1, borderColor: LINE, gap: 8, children: [_jsxs(XStack, { render: "button", type: 'button', onClick: () => setExpanded((prev) => ({ ...prev, [turn.id]: !showProps })), items: "center", gap: 5, bg: "transparent", borderWidth: 0, p: 0, cursor: "pointer", children: [_jsx(ChevronRight, { size: 13, color: DIM, "aria-hidden": true }), _jsx(Text, { fontSize: 12, lineHeight: 16, color: DIM, children: showProps
222
+ ? t('Hide {n} bot proposals', { n: res.proposals.length })
223
+ : t('Inspect {n} bot proposals & verdicts ({ms}ms)', {
224
+ n: res.proposals.length,
225
+ ms: res.durationMs,
226
+ }) })] }), showProps ? (_jsx(YStack, { gap: 6, children: res.proposals.map((p) => (_jsxs(YStack, { p: 10, rounded: 10, bg: GROUND, borderWidth: 1, borderColor: LINE, gap: 4, children: [_jsxs(XStack, { items: "center", justify: "space-between", children: [_jsx(Text, { fontSize: 12, lineHeight: 16, fontWeight: "600", color: INK, children: `${called(p.agent)} (Layer ${p.layer})` }), _jsx(Text, { fontSize: 11, lineHeight: 15, color: DIM, children: `Verdict: ${p.verdict || 'propose'} · Conf ${Math.round((p.confidence || 0) * 100)}%` })] }), _jsx(Text, { fontSize: 12, lineHeight: 17, color: DIM, whiteSpace: "pre-wrap", children: p.output || p.error || '' })] }, p.agent))) })) : null] })) : null] })] })) : null] }, turn.id));
227
+ })] }), _jsx(YStack, { "data-parity-key": "bots.composer", px: 16, pb: 16, pt: 8, borderTopWidth: 1, borderColor: LINE, children: _jsxs(XStack, { render: "form", onSubmit: (e) => void send(e), maxW: 760, width: "100%", self: "center", gap: 8, items: "center", children: [_jsx(Input, { unstyled: true, value: input, onChange: (e) => setInput(e.target.value), placeholder: t('Direct {group} ({policy})…', { group: group.name, policy: policyBadge(group.policy) }), "aria-label": t('Message {group}', { group: group.name }), flex: 1, height: 42, px: 16, rounded: 999, bg: RAISED, borderWidth: 1, borderColor: LINE, color: INK, fontSize: 14, placeholderTextColor: "$placeholderColor" }), _jsxs(XStack, { ...PILL, type: 'submit', height: 42, px: 16, bg: INK, borderColor: INK, disabled: !input.trim() || running, opacity: !input.trim() || running ? 0.45 : 1, children: [_jsx(Send, { size: 14, color: "var(--background)", "aria-hidden": true }), _jsx(Text, { ...WORD, color: "var(--background)", children: running ? t('Coordinating…') : t('Run Group') })] })] }) })] }));
228
+ }
229
+ export function GroupPanel({ group, groups, bots, onClose, onEdit, onDelete, onPickBot, }) {
230
+ const { t } = useI18n();
231
+ const { client } = useAi();
232
+ const [deleting, setDeleting] = useState(false);
233
+ const [slackOk, setSlackOk] = useState(false);
234
+ const [channels, setChannels] = useState([]);
235
+ const [boundChannels, setBoundChannels] = useState([]);
236
+ const groupRef = toGroupRef(group.name);
237
+ const parentGroup = groups.find((g) => g.id === group.parentGroupId || g.name === group.parentGroupId);
238
+ const childGroups = groups.filter((g) => g.parentGroupId === group.id || g.parentGroupId === group.name);
239
+ useEffect(() => {
240
+ const stop = new AbortController();
241
+ void (async () => {
242
+ const st = await slackStatus(stop.signal);
243
+ if (stop.signal.aborted)
244
+ return;
245
+ setSlackOk(st.connected);
246
+ if (st.connected && client) {
247
+ const [chs, ans] = await Promise.all([slackChannels(stop.signal), answering(client, 'slack', stop.signal).catch(() => null)]);
248
+ if (stop.signal.aborted)
249
+ return;
250
+ setChannels(chs);
251
+ if (ans?.channels) {
252
+ setBoundChannels(Object.entries(ans.channels)
253
+ .filter(([, ag]) => ag === groupRef || ag === `group_${group.name}`)
254
+ .map(([cid]) => cid));
255
+ }
256
+ }
257
+ })();
258
+ return () => stop.abort();
259
+ }, [client, group.name, groupRef]);
260
+ const bindChannel = async (channelId) => {
261
+ if (!client)
262
+ return;
263
+ const already = boundChannels.includes(channelId);
264
+ const updated = await setAnswering(client, already ? { transport: 'slack', unbind: [channelId] } : { transport: 'slack', channels: { [channelId]: groupRef } }).catch(() => null);
265
+ if (updated?.channels) {
266
+ setBoundChannels(Object.entries(updated.channels)
267
+ .filter(([, ag]) => ag === groupRef || ag === `group_${group.name}`)
268
+ .map(([cid]) => cid));
269
+ }
270
+ };
271
+ return (_jsxs(YStack, { flex: 1, minH: 0, overflowY: "auto", overflowX: "hidden", render: "aside", "aria-label": group.name, children: [_jsx(XStack, { height: 46, shrink: 0, px: 12, items: "center", justify: "flex-end", children: _jsx(XStack, { ...ROUND, "aria-label": t('Close'), onClick: onClose, children: _jsx(X, { size: 16, color: INK, "aria-hidden": true }) }) }), _jsxs(YStack, { items: "center", gap: 8, pt: 2, pb: 18, px: 14, children: [_jsx(YStack, { width: 64, height: 64, rounded: 20, bg: RAISED, borderWidth: 1, borderColor: LINE, items: "center", justify: "center", children: _jsx(Users, { size: 26, color: INK, "aria-hidden": true }) }), _jsx(Text, { ...CLIP, maxW: "100%", fontSize: 18, lineHeight: 23, fontWeight: "600", color: INK, children: group.name }), _jsx(Text, { fontSize: 12, lineHeight: 16, color: DIM, children: `Layer ${group.layer || 1} · ${policyBadge(group.policy)}` }), _jsx(XStack, { ...PILL, height: 32, px: 13, onClick: onEdit, children: _jsx(Text, { fontSize: 12, lineHeight: 16, fontWeight: "500", color: INK, children: t('Configure Policy & Members') }) })] }), _jsxs(YStack, { px: 15, pb: 24, gap: 18, children: [_jsxs(YStack, { gap: 8, children: [_jsx(Text, { ...LABEL, px: 4, children: t('Layer Hierarchy') }), _jsxs(YStack, { ...CARD, p: 12, gap: 6, children: [_jsx(Text, { fontSize: 13, lineHeight: 18, color: INK, children: parentGroup
272
+ ? t('Directed by Group: {parent} (Layer {lv})', { parent: parentGroup.name, lv: parentGroup.layer })
273
+ : t('Directed by Primary Bot: hanzo (Layer 0)') }), _jsx(Text, { fontSize: 12, lineHeight: 17, color: DIM, children: t('Callable as tool group_{name} by upper-layer bots.', { name: group.name }) }), childGroups.length > 0 ? (_jsx(Text, { fontSize: 12, lineHeight: 17, color: DIM, children: t('Directs sub-groups: {list}', { list: childGroups.map((c) => c.name).join(', ') }) })) : null] })] }), _jsxs(YStack, { gap: 8, children: [_jsx(Text, { ...LABEL, px: 4, children: t('Members ({n})', { n: group.members.length }) }), _jsx(YStack, { ...CARD, children: group.members.map((m, idx) => {
274
+ const b = bots.find((x) => x.name === m) ?? { name: m };
275
+ const isLeader = group.policy?.kind === 'leader' && (group.policy.leader || group.members[0]) === m;
276
+ return (_jsxs(XStack, { render: "button", type: 'button', onClick: () => onPickBot(m), minH: 48, px: 12, gap: 10, items: "center", bg: "transparent", borderWidth: 0, borderBottomWidth: idx === group.members.length - 1 ? 0 : 1, borderColor: LINE, cursor: "pointer", hoverStyle: { bg: PICKED }, children: [_jsx(Face, { bot: b, size: 28 }), _jsxs(YStack, { flex: 1, minW: 0, items: "flex-start", children: [_jsx(Text, { ...CLIP, fontSize: 13, lineHeight: 18, fontWeight: "500", color: INK, children: called(m) }), isLeader ? (_jsx(Text, { fontSize: 11, lineHeight: 15, color: DIM, children: t('Group Leader') })) : null] }), _jsx(ChevronRight, { size: 14, color: DIM, "aria-hidden": true })] }, m));
277
+ }) })] }), slackOk && channels.length > 0 ? (_jsxs(YStack, { gap: 8, children: [_jsx(Text, { ...LABEL, px: 4, children: t('Slack Channel Routing') }), _jsxs(YStack, { ...CARD, p: 12, gap: 8, children: [_jsx(Text, { fontSize: 12, lineHeight: 17, color: DIM, children: t('Route specific Slack channels directly to this Bot Group:') }), _jsx(XStack, { flexWrap: "wrap", gap: 6, children: channels.slice(0, 12).map((ch) => {
278
+ const active = boundChannels.includes(ch.id);
279
+ return (_jsx(XStack, { render: "button", type: 'button', onClick: () => void bindChannel(ch.id), height: 26, px: 9, rounded: 999, items: "center", gap: 4, bg: active ? INK : GROUND, borderWidth: 1, borderColor: active ? INK : LINE, cursor: "pointer", children: _jsx(Text, { fontSize: 11, lineHeight: 15, color: active ? 'var(--background)' : INK, children: `#${ch.name}` }) }, ch.id));
280
+ }) })] })] })) : null, _jsx(XStack, { px: 8, pt: 4, children: _jsx(Text, { render: "button", type: 'button', onClick: () => setDeleting(true), bg: "transparent", borderWidth: 0, p: 0, cursor: "pointer", fontSize: 13, lineHeight: 18, color: DIM, hoverStyle: { color: INK }, children: t('Delete group {name}', { name: group.name }) }) })] }), _jsx(Dialog, { open: deleting, onOpenChange: setDeleting, children: _jsxs(DialogContent, { maxW: 420, rounded: 20, gap: 14, children: [_jsx(DialogTitle, { children: t('Delete group {name}?', { name: group.name }) }), _jsx(Text, { fontSize: 14, lineHeight: 20, color: DIM, children: t('Member bots are kept intact; only the {name} coordination group is removed.', { name: group.name }) }), _jsxs(XStack, { gap: 8, justify: "flex-end", children: [_jsx(Button, { size: "sm", variant: "outline", rounded: 999, onPress: () => setDeleting(false), children: t('Cancel') }), _jsx(XStack, { ...PILL, height: 34, bg: INK, borderColor: INK, onClick: () => {
281
+ setDeleting(false);
282
+ void onDelete();
283
+ }, children: _jsx(Text, { ...WORD, color: "var(--background)", children: t('Delete') }) })] })] }) })] }));
284
+ }
@@ -1,5 +1,7 @@
1
1
  import type { Agent } from '@hanzo/ai';
2
- export declare function Make({ onDone, onCancel }: {
2
+ import { type BotGroup } from './api.js';
3
+ export declare function Make({ groups, onDone, onCancel, }: {
4
+ groups?: readonly BotGroup[];
3
5
  onDone: (a: Agent) => void | Promise<void>;
4
6
  onCancel: () => void;
5
7
  }): import("react").JSX.Element;
package/dist/bots/Make.js CHANGED
@@ -1,20 +1,18 @@
1
1
  'use client';
2
2
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
3
- // Making a bot: a name, what it does, and what it may spend a week.
4
- //
5
- // The platform keeps every bot on a budget and refuses one without it, so the
6
- // budget is asked for here rather than chosen silently. Whatever the platform
7
- // refuses — a name already taken, a model it does not serve — is shown in its
8
- // own words.
3
+ // Making a bot: a name, what it does, optional Bot Group / Layer assignment,
4
+ // and what it may spend a week. Every bot is created with full tool access
5
+ // (`tools: ['*']`) including Desktop Sandbox Computer Use and Connectors.
9
6
  import { useState } from 'react';
10
7
  import { useI18n } from '@hanzo/i18n/react';
11
8
  import { Input, Text, XStack, YStack } from '@hanzo/gui';
12
- import { Dialog, DialogContent, DialogTitle } from '@hanzo/ui';
9
+ import { Dialog, DialogContent, DialogTitle, DropdownMenu, DropdownMenuContent, DropdownMenuItem, DropdownMenuTrigger } from '@hanzo/ui';
10
+ import { ChevronDown } from 'lucide-react';
13
11
  import { ENSO, useAi } from '../lib/ai.js';
14
12
  import { plainly } from '../failure.js';
15
- import { NAME, make } from './api.js';
13
+ import { NAME, make, updateGroup } from './api.js';
16
14
  import { PILL, WORD } from './kit.js';
17
- import { DIM, INK, LINE, RAISED } from './ink.js';
15
+ import { DIM, INK, LINE, PICKED, RAISED } from './ink.js';
18
16
  const FIELD = {
19
17
  unstyled: true,
20
18
  width: '100%',
@@ -28,18 +26,20 @@ const FIELD = {
28
26
  fontSize: 15,
29
27
  placeholderTextColor: '$placeholderColor',
30
28
  };
31
- export function Make({ onDone, onCancel }) {
29
+ export function Make({ groups = [], onDone, onCancel, }) {
32
30
  const { t } = useI18n();
33
31
  const { client } = useAi();
34
32
  const [name, setName] = useState('');
35
33
  const [does, setDoes] = useState('');
34
+ const [groupId, setGroupId] = useState('');
35
+ const [layer, setLayer] = useState(1);
36
36
  const [weekly, setWeekly] = useState('10');
37
37
  const [busy, setBusy] = useState(false);
38
38
  const [wrong, setWrong] = useState(null);
39
39
  const dollars = Number(weekly);
40
40
  const named = NAME.test(name.trim());
41
- // Up to ten thousand dollars a week: a cap is a guard, and past it a typo is a fortune.
42
41
  const ok = named && Number.isInteger(dollars) && dollars > 0 && dollars <= 10_000 && !busy;
42
+ const selectedGroup = groups.find((g) => g.id === groupId || g.name === groupId) ?? null;
43
43
  const submit = async (e) => {
44
44
  e.preventDefault();
45
45
  if (!client || !ok)
@@ -47,7 +47,19 @@ export function Make({ onDone, onCancel }) {
47
47
  setBusy(true);
48
48
  setWrong(null);
49
49
  try {
50
- await onDone(await make(client, { name: name.trim(), instructions: does.trim(), model: ENSO, weekly: dollars }));
50
+ const created = await make(client, {
51
+ name: name.trim(),
52
+ instructions: does.trim() ||
53
+ `You are ${name.trim()}, a Layer ${layer} worker bot directed by Primary Bot hanzo. Use your desktop sandbox computer and connected tools to complete tasks accurately.`,
54
+ model: ENSO,
55
+ weekly: dollars,
56
+ groupId: selectedGroup?.id || undefined,
57
+ layer: selectedGroup?.layer ?? layer,
58
+ });
59
+ if (selectedGroup && !selectedGroup.members.includes(created.name)) {
60
+ await updateGroup(client, selectedGroup.name, { members: [...selectedGroup.members, created.name] }).catch(() => null);
61
+ }
62
+ await onDone(created);
51
63
  }
52
64
  catch (err) {
53
65
  setWrong(plainly(err, t('this bot'), t));
@@ -56,5 +68,8 @@ export function Make({ onDone, onCancel }) {
56
68
  setBusy(false);
57
69
  }
58
70
  };
59
- return (_jsx(Dialog, { open: true, onOpenChange: (v) => (v ? undefined : onCancel()), children: _jsxs(DialogContent, { "data-parity-key": "bots.make", width: "calc(100vw - 32px)", maxW: 440, 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'), "aria-label": t('What it does') }), _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') }) })] })] })] }) }));
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 active = (selectedGroup?.layer ?? layer) === lv;
73
+ return (_jsx(XStack, { render: "button", type: 'button', onClick: () => setLayer(lv), height: 28, px: 10, rounded: 999, items: "center", bg: active ? PICKED : RAISED, borderWidth: 1, borderColor: active ? INK : LINE, cursor: "pointer", children: _jsx(Text, { fontSize: 12, lineHeight: 16, fontWeight: active ? '600' : '400', color: INK, children: `L${lv}` }) }, lv));
74
+ }) })] }), 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') }) })] })] })] }) }));
60
75
  }
@@ -1,10 +1,14 @@
1
1
  import type { Agent, AgentRun } from '@hanzo/ai';
2
- export declare function Panel({ bot, runs, onClose, kept, onSchedule, onDelete, focus, }: {
2
+ import { type BotGroup } from './api.js';
3
+ export declare function Panel({ bot, groups, runs, onClose, kept, onSchedule, onDelete, onBotChanged, onPickGroup, focus, }: {
3
4
  bot: Agent;
5
+ groups?: readonly BotGroup[];
4
6
  runs?: readonly AgentRun[];
5
7
  kept: string;
6
8
  onClose: () => void;
7
9
  onSchedule: (on: boolean, cron: string) => Promise<void>;
8
10
  onDelete: () => Promise<void>;
11
+ onBotChanged?: () => void | Promise<void>;
12
+ onPickGroup?: (ref: string) => void;
9
13
  focus?: boolean;
10
14
  }): import("react").JSX.Element;