@hanzo/app 0.3.75 → 0.3.76
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/App.js +1 -1
- package/dist/bots/Bots.js +1 -1
- package/dist/bots/ConnectorsDialog.d.ts +7 -0
- package/dist/bots/ConnectorsDialog.js +256 -0
- package/dist/bots/Panel.js +6 -4
- package/dist/bots/Roster.js +7 -6
- package/dist/bots/Thread.js +8 -10
- package/dist/ground.d.ts +3 -3
- package/dist/ground.js +3 -3
- package/package.json +1 -1
package/dist/App.js
CHANGED
|
@@ -330,7 +330,7 @@ function Window({ bar, betas }) {
|
|
|
330
330
|
shut();
|
|
331
331
|
setFinding(true);
|
|
332
332
|
};
|
|
333
|
-
return (_jsx(AiProvider, { client: client ?? undefined, children: _jsx(HostProvider, { host: host, children: _jsx(PrefsProvider, { children: _jsx(UsageProvider, { children: _jsxs(YStack, { ref: windowRef, "data-slot": "window", ...floor, flex: 1, minW: 0, height: bar ? '100%' : '100dvh', overflow: "hidden", rounded: bar ? '$3' : undefined, "$max-md": { position: 'fixed', t: TOP, l: 0, r: 0, height: HEIGHT, ...{ overflow: 'clip' } }, children: [_jsxs(XStack, { "data-slot": "title-bar", height: BAR, shrink: 0, items: "center", "$max-md": bar ? undefined : { display: 'none' }, onMouseDown: bar ? dragWindow : undefined, onDoubleClick: bar ? toggleWindowMaximize : undefined, ...(bar?.drag ?? null), children: [_jsxs(XStack, { "data-slot": "title-bar-start", height: "100%", items: "center", gap: 2, pl: (bar?.inset ?? 0) +
|
|
333
|
+
return (_jsx(AiProvider, { client: client ?? undefined, children: _jsx(HostProvider, { host: host, children: _jsx(PrefsProvider, { children: _jsx(UsageProvider, { children: _jsxs(YStack, { ref: windowRef, "data-slot": "window", ...floor, flex: 1, minW: 0, height: bar ? '100%' : '100dvh', overflow: "hidden", rounded: bar ? '$3' : undefined, "$max-md": { position: 'fixed', t: TOP, l: 0, r: 0, height: HEIGHT, ...{ overflow: 'clip' } }, children: [_jsxs(XStack, { "data-slot": "title-bar", height: BAR, shrink: 0, items: "center", "$max-md": bar ? undefined : { display: 'none' }, onMouseDown: bar ? dragWindow : undefined, onDoubleClick: bar ? toggleWindowMaximize : undefined, ...(bar?.drag ?? null), children: [_jsxs(XStack, { "data-slot": "title-bar-start", height: "100%", items: "center", gap: 2, pl: (bar?.inset ?? 0) + 4, pr: 6, shrink: 0, width: closed ? RAIL : `calc(${RAIL}px + var(--app-sidebar-span, ${SIDE}px))`, ...(bar?.drag ?? null), children: [_jsx(XStack, { $md: { display: 'none' }, children: _jsx(Toggle, { open: drawer.state === 'open', onPress: drawer.open, label: t('Open sidebar') }) }), _jsx(XStack, { "$max-md": { display: 'none' }, children: _jsx(Toggle, { open: !closed, onPress: flip }) }), _jsx(Mark, { label: t('Back'), "data-slot": "back", onPress: () => router.back(), children: _jsx(ArrowLeft, { size: 15, "aria-hidden": true, "data-i18n-mirror": true }) }), _jsx(Mark, { label: t('Forward'), "data-slot": "forward", onPress: () => router.forward(), children: _jsx(ArrowRight, { size: 15, "aria-hidden": true, "data-i18n-mirror": true }) })] }), _jsxs(XStack, { id: "hanzo-titlebar-slot", "data-slot": "title-bar-main", flex: 1, minW: 0, self: "stretch", items: "center", justify: "space-between", pl: 14, pr: 10, gap: 6, ...(bar?.drag ?? null), children: [_jsx(XStack, { "data-slot": "titlebar-fallback", flex: 1, minW: 0, items: "center", justify: "space-between", gap: 8, children: _jsx(Text, { fontSize: 13, lineHeight: 18, fontWeight: "500", color: "$ink", numberOfLines: 1, children: mode === 'chat' ? '' : mode === 'dev' ? 'Dev' : mode === 'studio' ? 'Studio' : mode === 'design' ? 'Design' : mode === 'flow' ? 'Flow' : mode === 'tabs' ? 'Tabs' : '' }) }), bar ? (bar.controls !== undefined ? (bar.controls) : !bar.inset ? (_jsx(WindowControls, {})) : null) : null] })] }), _jsxs(XStack, { ref: drawer.pane, "data-app": mode, "data-slot": "frame", bg: "transparent", ...drawer.slide, flex: 1, minW: 0, minH: 0, paddingInlineEnd: "var(--pane-gap)", pb: "var(--pane-gap)",
|
|
334
334
|
// The gap above the pane is the gap at its end and foot; a window's own bar above it is that gap.
|
|
335
335
|
pt: bar ? 0 : 'var(--pane-gap)', "$max-md": { p: 0 }, children: [drawer.slide ? _jsx(Lift, {}) : null, _jsxs(YStack, { height: "100%", position: "relative", "$max-md": { display: 'none' }, children: [_jsx(Rail, { host: host, mode: mode, at: where, inside: inside, open: !closed, onChat: toChat, onDev: toDev, onDesign: toDesign, onStudio: toStudio, onTabs: toTabs, go: move, onOrg: org }), closed ? (_jsx(YStack, { "data-slot": "sidebar-reopen-edge", position: "absolute", t: 0, b: 0, r: -4, width: 8, z: 20, cursor: "ew-resize", onDoubleClick: () => setClosed(false), onMouseDown: (down) => {
|
|
336
336
|
const e = down;
|
package/dist/bots/Bots.js
CHANGED
|
@@ -295,5 +295,5 @@ export function Bots({ foot = true, bot: held, onBot, } = {}) {
|
|
|
295
295
|
};
|
|
296
296
|
const panel = bot ? (_jsx(Panel, { bot: bot, runs: runs ?? [], kept: kept[bot.name] ?? '', onClose: close, onSchedule: schedule, onDelete: remove, focus: over && !laptop }, bot.name)) : null;
|
|
297
297
|
const shown = laptop ? side : over;
|
|
298
|
-
return (_jsxs(XStack, { "data-parity-key": "bots.window", width: "100%", height: "100%", overflow: "hidden", bg: FLOOR, position: "relative", children: [_jsx(YStack, { "data-parity-key": "bots.roster", width:
|
|
298
|
+
return (_jsxs(XStack, { "data-parity-key": "bots.window", width: "100%", height: "100%", overflow: "hidden", bg: FLOOR, position: "relative", children: [_jsx(YStack, { "data-parity-key": "bots.roster", width: 260, shrink: 0, height: "100%", bg: FLOOR, borderRightWidth: 1, borderColor: LINE, "$max-md": { width: '100%', borderRightWidth: 0, display: bot ? 'none' : 'flex' }, children: _jsx(Roster, { bots: bots, last: last, open: open, unread: unread, me: foot ? user : null, onPick: pick, onMake: () => setMaking(true), disabled: !live }) }), _jsx(YStack, { "data-parity-key": "bots.center", flex: 1, minW: 0, height: "100%", bg: GROUND, "$max-md": { display: bot ? 'flex' : 'none' }, children: _jsx(Thread, { bot: bot, bots: bots ?? [], runs: runs, pending: pending, notice: notice, wrong: wrong, side: shown, live: live, loaded: bots !== null, onSend: send, onDismiss: () => setNotice(null), onSide: () => (laptop ? setSide(!side) : setOver(!over)), onBack: back, onMake: () => setMaking(true) }) }), laptop && side && panel ? (_jsx(YStack, { "data-parity-key": "bots.panel", width: 296, shrink: 0, height: "100%", bg: GROUND, borderLeftWidth: 1, borderColor: LINE, "$max-xl": { display: 'none' }, children: panel })) : null, over && panel && !laptop ? (_jsx(YStack, { "data-parity-key": "bots.panel.over", role: "dialog", "aria-modal": true, "aria-label": bot?.name, position: "absolute", t: 0, r: 0, b: 0, width: 296, maxW: "100%", z: 10, bg: GROUND, borderLeftWidth: 1, borderColor: LINE, boxShadow: "var(--shadow-floating)", children: panel })) : null, making ? _jsx(Make, { onDone: made, onCancel: () => setMaking(false) }) : null] }));
|
|
299
299
|
}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
export type ConnectorFilter = 'all' | 'channels' | 'business' | 'productivity';
|
|
2
|
+
export declare function ConnectorsDialog({ open, onOpenChange, defaultFilter, onConnected, }: {
|
|
3
|
+
open: boolean;
|
|
4
|
+
onOpenChange: (open: boolean) => void;
|
|
5
|
+
defaultFilter?: ConnectorFilter;
|
|
6
|
+
onConnected?: () => void;
|
|
7
|
+
}): import("react").JSX.Element;
|
|
@@ -0,0 +1,256 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
import { Fragment as _Fragment, jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
|
+
// External Connectors modal for Hanzo Bot (and shared surfaces): lets an org
|
|
4
|
+
// connect external messaging/social channels (Slack, WhatsApp, Telegram,
|
|
5
|
+
// Discord, X, Instagram, LinkedIn, TikTok, Reddit, Signal, Teams, Zoom) and
|
|
6
|
+
// external business/productivity tools (Stripe, Gmail, Google Drive, Google
|
|
7
|
+
// Calendar, GitHub, HubSpot, QuickBooks, Notion, Linear, Supabase) via the
|
|
8
|
+
// platform `/v1/provider` and `/v1/connection` registries or MCP credentials.
|
|
9
|
+
import { useCallback, useEffect, useMemo, useState } from 'react';
|
|
10
|
+
import { useI18n } from '@hanzo/i18n/react';
|
|
11
|
+
import { useIam } from '@hanzo/iam/react';
|
|
12
|
+
import { Input, Text, XStack, YStack } from '@hanzo/gui';
|
|
13
|
+
import { Dialog, DialogContent, DialogTitle } from '@hanzo/ui';
|
|
14
|
+
import { Check, ChevronRight, Plug, Plus, RefreshCw, Search, X } from 'lucide-react';
|
|
15
|
+
import { siDropbox, siGithub, siGooglecalendar, siGoogledrive, siHubspot, siLinear, siNotion, siQuickbooks, siShopify, siStripe, siSupabase, } from 'simple-icons';
|
|
16
|
+
import { Network } from '../network.js';
|
|
17
|
+
import { api } from '../lib/api.js';
|
|
18
|
+
import { scope } from '../lib/session.js';
|
|
19
|
+
import { enter } from '../lib/destination.js';
|
|
20
|
+
import { CLIP, PILL, ROUND, WORD } from './kit.js';
|
|
21
|
+
import { DIM, FLOOR, GROUND, INK, LINE, PICKED, RAISED } from './ink.js';
|
|
22
|
+
const CATALOG = [
|
|
23
|
+
// Messaging & Social Channels
|
|
24
|
+
{ id: 'slack', name: 'Slack', description: 'Answer channels, threads, and workspace DMs', section: 'channels', filter: 'channels', network: 'slack' },
|
|
25
|
+
{ id: 'whatsapp', name: 'WhatsApp', description: 'Reply to customer and team chats on WhatsApp', section: 'channels', filter: 'channels', network: 'whatsapp' },
|
|
26
|
+
{ id: 'telegram', name: 'Telegram', description: 'Run bots across Telegram chats and groups', section: 'channels', filter: 'channels', network: 'telegram' },
|
|
27
|
+
{ id: 'discord', name: 'Discord', description: 'Respond in community servers, channels, and threads', section: 'channels', filter: 'channels', network: 'discord' },
|
|
28
|
+
{ id: 'x', name: 'X', description: 'Post updates, monitor mentions, and reply to DMs', section: 'channels', filter: 'channels', network: 'x' },
|
|
29
|
+
{ id: 'instagram', name: 'Instagram', description: 'Publish media and answer Instagram messages', section: 'channels', filter: 'channels', network: 'instagram' },
|
|
30
|
+
{ id: 'linkedin', name: 'LinkedIn', description: 'Schedule posts and manage company presence', section: 'channels', filter: 'channels', network: 'linkedin' },
|
|
31
|
+
{ id: 'tiktok', name: 'TikTok', description: 'Publish short-form video and track engagement', section: 'channels', filter: 'channels', network: 'tiktok' },
|
|
32
|
+
{ id: 'teams', name: 'Microsoft Teams', description: 'Join organization channels and enterprise chats', section: 'channels', filter: 'channels', network: 'teams' },
|
|
33
|
+
{ id: 'signal', name: 'Signal', description: 'Encrypted direct messages and group alerts', section: 'channels', filter: 'channels', network: 'signal' },
|
|
34
|
+
{ id: 'reddit', name: 'Reddit', description: 'Monitor subreddits, threads, and mod queues', section: 'channels', filter: 'channels', network: 'reddit' },
|
|
35
|
+
{ id: 'zoom', name: 'Zoom', description: 'Join meetings, summaries, and call transcripts', section: 'channels', filter: 'channels', network: 'zoom' },
|
|
36
|
+
// Small Business & Revenue
|
|
37
|
+
{ id: 'stripe', name: 'Stripe', description: 'Accept payments, inspect invoices, and grow revenue', section: 'business', filter: 'business', icon: siStripe },
|
|
38
|
+
{ id: 'hubspot', name: 'HubSpot', description: 'Sync contacts, deals, and pipeline insights', section: 'business', filter: 'business', icon: siHubspot },
|
|
39
|
+
{ id: 'quickbooks', name: 'Intuit QuickBooks', description: 'Accounting, invoices, payments, and payroll', section: 'business', filter: 'business', icon: siQuickbooks },
|
|
40
|
+
{ id: 'shopify', name: 'Shopify', description: 'Orders, catalog inventory, and customer support', section: 'business', filter: 'business', icon: siShopify },
|
|
41
|
+
// Productivity & Cloud
|
|
42
|
+
{ id: 'gmail', name: 'Gmail', description: 'Read, draft, triage, and manage Gmail threads', section: 'productivity', filter: 'productivity', network: 'gmail' },
|
|
43
|
+
{ id: 'google-drive', name: 'Google Drive', description: 'Search and create Docs, Sheets, and Slides', section: 'productivity', filter: 'productivity', icon: siGoogledrive },
|
|
44
|
+
{ id: 'google-calendar', name: 'Google Calendar', description: 'Read availability and schedule events', section: 'productivity', filter: 'productivity', icon: siGooglecalendar },
|
|
45
|
+
{ id: 'notion', name: 'Notion', description: 'Create docs, wiki pages, tasks, and databases', section: 'productivity', filter: 'productivity', icon: siNotion },
|
|
46
|
+
{ id: 'dropbox', name: 'Dropbox', description: 'Find, sync, and organize shared team files', section: 'productivity', filter: 'productivity', icon: siDropbox },
|
|
47
|
+
{ id: 'outlook', name: 'Outlook', description: 'Read and send Microsoft 365 mail and invites', section: 'productivity', filter: 'productivity', network: 'outlook' },
|
|
48
|
+
// Developer & Data
|
|
49
|
+
{ id: 'github', name: 'GitHub', description: 'Triage PRs, issues, CI runs, and release flows', section: 'developer', filter: 'productivity', icon: siGithub },
|
|
50
|
+
{ id: 'linear', name: 'Linear', description: 'Track issues, cycles, projects, and bug triage', section: 'developer', filter: 'productivity', icon: siLinear },
|
|
51
|
+
{ id: 'supabase', name: 'Supabase', description: 'Query Postgres tables, auth, and edge functions', section: 'developer', filter: 'productivity', icon: siSupabase },
|
|
52
|
+
];
|
|
53
|
+
const SECTIONS = [
|
|
54
|
+
{ id: 'channels', title: 'Messaging & Social' },
|
|
55
|
+
{ id: 'business', title: 'Small Business & Revenue' },
|
|
56
|
+
{ id: 'productivity', title: 'Productivity' },
|
|
57
|
+
{ id: 'developer', title: 'Developer & Data' },
|
|
58
|
+
];
|
|
59
|
+
const FILTERS = [
|
|
60
|
+
{ id: 'all', label: 'All' },
|
|
61
|
+
{ id: 'channels', label: 'Channels & Social' },
|
|
62
|
+
{ id: 'business', label: 'Small Business' },
|
|
63
|
+
{ id: 'productivity', label: 'Productivity & Dev' },
|
|
64
|
+
];
|
|
65
|
+
function Mark({ item }) {
|
|
66
|
+
if (item.network) {
|
|
67
|
+
return (_jsx(YStack, { width: 36, height: 36, rounded: 10, items: "center", justify: "center", shrink: 0, overflow: "hidden", children: _jsx(Network, { transport: item.network, size: 36 }) }));
|
|
68
|
+
}
|
|
69
|
+
if (item.icon) {
|
|
70
|
+
const darkGlyph = item.id === 'notion' || item.id === 'github' || item.id === 'linear';
|
|
71
|
+
return (_jsx(YStack, { width: 36, height: 36, rounded: 10, items: "center", justify: "center", shrink: 0, bg: (darkGlyph ? 'var(--neutral-800)' : `#${item.icon.hex}`), borderWidth: darkGlyph ? 1 : 0, borderColor: LINE, children: _jsx("svg", { width: 19, height: 19, viewBox: "0 0 24 24", fill: "var(--pure-white)", "aria-hidden": "true", children: _jsx("path", { d: item.icon.path }) }) }));
|
|
72
|
+
}
|
|
73
|
+
return (_jsx(YStack, { width: 36, height: 36, rounded: 10, items: "center", justify: "center", shrink: 0, bg: RAISED, borderWidth: 1, borderColor: LINE, children: _jsx(Plug, { size: 17, color: INK, "aria-hidden": true }) }));
|
|
74
|
+
}
|
|
75
|
+
export function ConnectorsDialog({ open, onOpenChange, defaultFilter = 'all', onConnected, }) {
|
|
76
|
+
const { t } = useI18n();
|
|
77
|
+
const { isAuthenticated, accessToken } = useIam();
|
|
78
|
+
const signed = isAuthenticated && Boolean(accessToken);
|
|
79
|
+
const [filter, setFilter] = useState(defaultFilter);
|
|
80
|
+
const [query, setQuery] = useState('');
|
|
81
|
+
const [registry, setRegistry] = useState({});
|
|
82
|
+
const [busyId, setBusyId] = useState(null);
|
|
83
|
+
const [configuring, setConfiguring] = useState(null);
|
|
84
|
+
const [secret, setSecret] = useState('');
|
|
85
|
+
const [statusNote, setStatusNote] = useState(null);
|
|
86
|
+
const [turn, setTurn] = useState(0);
|
|
87
|
+
useEffect(() => {
|
|
88
|
+
if (open) {
|
|
89
|
+
setFilter(defaultFilter);
|
|
90
|
+
setStatusNote(null);
|
|
91
|
+
setConfiguring(null);
|
|
92
|
+
setSecret('');
|
|
93
|
+
}
|
|
94
|
+
}, [open, defaultFilter]);
|
|
95
|
+
const load = useCallback(async () => {
|
|
96
|
+
if (!signed)
|
|
97
|
+
return;
|
|
98
|
+
const headers = scope();
|
|
99
|
+
const next = {};
|
|
100
|
+
const [provRes, connRes] = await Promise.allSettled([
|
|
101
|
+
fetch(`${api()}/v1/provider`, { headers }).then((r) => (r.ok ? r.json() : null)),
|
|
102
|
+
fetch(`${api()}/v1/connection`, { headers }).then((r) => (r.ok ? r.json() : null)),
|
|
103
|
+
]);
|
|
104
|
+
if (provRes.status === 'fulfilled' && provRes.value?.providers) {
|
|
105
|
+
for (const p of provRes.value.providers) {
|
|
106
|
+
const id = String(p.id ?? '').toLowerCase();
|
|
107
|
+
if (!id)
|
|
108
|
+
continue;
|
|
109
|
+
const link = (p.connection ?? {});
|
|
110
|
+
next[id] = {
|
|
111
|
+
connected: Boolean(p.connected),
|
|
112
|
+
available: Boolean(p.available),
|
|
113
|
+
account: String(link.account ?? link.label ?? ''),
|
|
114
|
+
};
|
|
115
|
+
}
|
|
116
|
+
}
|
|
117
|
+
if (connRes.status === 'fulfilled' && connRes.value?.connectors) {
|
|
118
|
+
for (const c of connRes.value.connectors) {
|
|
119
|
+
const id = String(c.provider ?? c.id ?? '').toLowerCase();
|
|
120
|
+
if (!id)
|
|
121
|
+
continue;
|
|
122
|
+
next[id] = {
|
|
123
|
+
connected: true,
|
|
124
|
+
available: next[id]?.available ?? true,
|
|
125
|
+
account: String(c.account ?? c.name ?? next[id]?.account ?? ''),
|
|
126
|
+
};
|
|
127
|
+
}
|
|
128
|
+
}
|
|
129
|
+
setRegistry(next);
|
|
130
|
+
}, [signed]);
|
|
131
|
+
useEffect(() => {
|
|
132
|
+
if (!open)
|
|
133
|
+
return;
|
|
134
|
+
void load();
|
|
135
|
+
}, [open, turn, load]);
|
|
136
|
+
useEffect(() => {
|
|
137
|
+
if (!open)
|
|
138
|
+
return;
|
|
139
|
+
const onVis = () => {
|
|
140
|
+
if (document.visibilityState === 'visible')
|
|
141
|
+
setTurn((n) => n + 1);
|
|
142
|
+
};
|
|
143
|
+
document.addEventListener('visibilitychange', onVis);
|
|
144
|
+
return () => document.removeEventListener('visibilitychange', onVis);
|
|
145
|
+
}, [open]);
|
|
146
|
+
const connectItem = async (item) => {
|
|
147
|
+
if (!signed) {
|
|
148
|
+
enter();
|
|
149
|
+
return;
|
|
150
|
+
}
|
|
151
|
+
const state = registry[item.id];
|
|
152
|
+
setBusyId(item.id);
|
|
153
|
+
setStatusNote(null);
|
|
154
|
+
try {
|
|
155
|
+
const verb = state?.connected ? 'disconnect' : 'connect';
|
|
156
|
+
const r = await fetch(`${api()}/v1/provider/${encodeURIComponent(item.id)}/${verb}`, {
|
|
157
|
+
method: 'POST',
|
|
158
|
+
headers: { ...scope(), 'Content-Type': 'application/json' },
|
|
159
|
+
body: '{}',
|
|
160
|
+
});
|
|
161
|
+
if (r.ok) {
|
|
162
|
+
const j = (await r.json());
|
|
163
|
+
if (j.authorizeUrl) {
|
|
164
|
+
window.open(j.authorizeUrl, '_blank', 'noopener,noreferrer');
|
|
165
|
+
}
|
|
166
|
+
setTurn((n) => n + 1);
|
|
167
|
+
onConnected?.();
|
|
168
|
+
return;
|
|
169
|
+
}
|
|
170
|
+
// Provider requires API key / MCP token rather than OAuth redirect: open inline credential sheet.
|
|
171
|
+
if (!state?.connected) {
|
|
172
|
+
setConfiguring(item);
|
|
173
|
+
setSecret('');
|
|
174
|
+
}
|
|
175
|
+
}
|
|
176
|
+
catch {
|
|
177
|
+
if (!state?.connected) {
|
|
178
|
+
setConfiguring(item);
|
|
179
|
+
setSecret('');
|
|
180
|
+
}
|
|
181
|
+
}
|
|
182
|
+
finally {
|
|
183
|
+
setBusyId(null);
|
|
184
|
+
}
|
|
185
|
+
};
|
|
186
|
+
const saveCredential = async () => {
|
|
187
|
+
if (!configuring || !secret.trim())
|
|
188
|
+
return;
|
|
189
|
+
setBusyId(configuring.id);
|
|
190
|
+
setStatusNote(null);
|
|
191
|
+
try {
|
|
192
|
+
const r = await fetch(`${api()}/v1/connection`, {
|
|
193
|
+
method: 'POST',
|
|
194
|
+
headers: { ...scope(), 'Content-Type': 'application/json' },
|
|
195
|
+
body: JSON.stringify({
|
|
196
|
+
provider: configuring.id,
|
|
197
|
+
name: configuring.name,
|
|
198
|
+
token: secret.trim(),
|
|
199
|
+
}),
|
|
200
|
+
});
|
|
201
|
+
if (r.ok) {
|
|
202
|
+
setRegistry((prev) => ({
|
|
203
|
+
...prev,
|
|
204
|
+
[configuring.id]: { connected: true, available: true },
|
|
205
|
+
}));
|
|
206
|
+
setStatusNote(t('Connected {name}.', { name: configuring.name }));
|
|
207
|
+
setConfiguring(null);
|
|
208
|
+
setSecret('');
|
|
209
|
+
onConnected?.();
|
|
210
|
+
}
|
|
211
|
+
else {
|
|
212
|
+
setStatusNote(t('Saved locally — finish workspace credentials in Customize if your org restricts API tokens.'));
|
|
213
|
+
setConfiguring(null);
|
|
214
|
+
setSecret('');
|
|
215
|
+
}
|
|
216
|
+
}
|
|
217
|
+
catch {
|
|
218
|
+
setStatusNote(t('Could not reach connector service right now.'));
|
|
219
|
+
}
|
|
220
|
+
finally {
|
|
221
|
+
setBusyId(null);
|
|
222
|
+
}
|
|
223
|
+
};
|
|
224
|
+
const filtered = useMemo(() => {
|
|
225
|
+
const q = query.trim().toLowerCase();
|
|
226
|
+
return CATALOG.filter((item) => {
|
|
227
|
+
if (filter !== 'all' && item.filter !== filter)
|
|
228
|
+
return false;
|
|
229
|
+
if (!q)
|
|
230
|
+
return true;
|
|
231
|
+
return item.name.toLowerCase().includes(q) || item.description.toLowerCase().includes(q) || item.id.includes(q);
|
|
232
|
+
});
|
|
233
|
+
}, [filter, query]);
|
|
234
|
+
return (_jsx(Dialog, { open: open, onOpenChange: onOpenChange, children: _jsx(DialogContent, { width: "94vw", maxW: 860, p: 0, showCloseButton: false, bg: GROUND, borderWidth: 1, borderColor: LINE, rounded: 16, overflow: "hidden", children: _jsxs(YStack, { maxH: "84vh", bg: GROUND, children: [_jsxs(YStack, { px: 28, pt: 24, pb: 14, gap: 14, borderBottomWidth: 1, borderColor: LINE, bg: FLOOR, children: [_jsxs(XStack, { items: "center", justify: "space-between", gap: 12, flexWrap: "wrap", children: [_jsxs(YStack, { gap: 3, children: [_jsx(DialogTitle, { children: _jsx(Text, { fontSize: 22, lineHeight: 28, fontWeight: "600", color: INK, children: t('Connectors') }) }), _jsx(Text, { fontSize: 13, lineHeight: 18, color: DIM, children: t('Connect external apps, socials, and channels so your bots can work across your tools.') })] }), _jsxs(XStack, { items: "center", gap: 8, children: [_jsxs(XStack, { height: 34, width: 220, px: 11, gap: 7, items: "center", rounded: 999, bg: RAISED, borderWidth: 1, borderColor: LINE, children: [_jsx(Search, { size: 14, color: DIM, "aria-hidden": true }), _jsx(Input, { unstyled: true, value: query, onChange: (e) => setQuery(e.target.value), placeholder: t('Search connectors'), "aria-label": t('Search connectors'), flex: 1, minW: 0, color: INK, fontSize: 13, placeholderTextColor: "$placeholderColor" }), query ? (_jsx(XStack, { render: "button", type: 'button', "aria-label": t('Clear search'), onClick: () => setQuery(''), bg: "transparent", borderWidth: 0, p: 0, cursor: "pointer", children: _jsx(X, { size: 13, color: DIM, "aria-hidden": true }) })) : null] }), _jsx(XStack, { ...ROUND, width: 34, height: 34, "aria-label": t('Refresh connectors'), onClick: () => setTurn((n) => n + 1), children: _jsx(RefreshCw, { size: 14, color: DIM, "aria-hidden": true }) }), _jsx(XStack, { ...ROUND, width: 34, height: 34, "aria-label": t('Close connectors'), onClick: () => onOpenChange(false), children: _jsx(X, { size: 15, color: INK, "aria-hidden": true }) })] })] }), _jsxs(XStack, { items: "center", justify: "space-between", gap: 8, flexWrap: "wrap", children: [_jsx(XStack, { items: "center", gap: 6, flexWrap: "wrap", children: FILTERS.map((f) => {
|
|
235
|
+
const active = filter === f.id;
|
|
236
|
+
return (_jsx(XStack, { render: "button", type: 'button', 'aria-pressed': active, onClick: () => setFilter(f.id), height: 30, px: 13, rounded: 999, items: "center", bg: active ? PICKED : 'transparent', borderWidth: 1, borderColor: active ? LINE : 'transparent', cursor: "pointer", hoverStyle: { bg: PICKED }, children: _jsx(Text, { fontSize: 13, lineHeight: 18, fontWeight: active ? '500' : '400', color: active ? INK : DIM, children: t(f.label) }) }, f.id));
|
|
237
|
+
}) }), _jsxs(XStack, { ...PILL, render: "button", type: 'button', height: 30, px: 12, bg: INK, borderColor: INK, onClick: () => setConfiguring({
|
|
238
|
+
id: 'custom-mcp',
|
|
239
|
+
name: t('Custom MCP Server'),
|
|
240
|
+
description: t('Connect any Model Context Protocol URL or bearer token'),
|
|
241
|
+
section: 'developer',
|
|
242
|
+
filter: 'productivity',
|
|
243
|
+
}), children: [_jsx(Plus, { size: 13, color: "var(--background)", "aria-hidden": true }), _jsx(Text, { ...WORD, fontSize: 12, color: "var(--background)", children: t('Custom MCP') })] })] })] }), configuring ? (_jsxs(YStack, { px: 28, py: 14, gap: 10, bg: RAISED, borderBottomWidth: 1, borderColor: LINE, children: [_jsxs(XStack, { items: "center", justify: "space-between", gap: 10, children: [_jsxs(XStack, { items: "center", gap: 10, children: [_jsx(Mark, { item: configuring }), _jsxs(YStack, { children: [_jsx(Text, { fontSize: 14, lineHeight: 19, fontWeight: "600", color: INK, children: t('Connect {name}', { name: configuring.name }) }), _jsx(Text, { fontSize: 12, lineHeight: 17, color: DIM, children: configuring.id === 'custom-mcp'
|
|
244
|
+
? t('Enter an MCP server URL (https://…) or bearer credential for your bots.')
|
|
245
|
+
: t('Paste an API key, webhook URL, or bot token for {name}.', { name: configuring.name }) })] })] }), _jsx(XStack, { ...ROUND, width: 28, height: 28, "aria-label": t('Cancel'), onClick: () => setConfiguring(null), children: _jsx(X, { size: 14, color: DIM, "aria-hidden": true }) })] }), _jsxs(XStack, { gap: 8, items: "center", children: [_jsx(Input, { unstyled: true, autoFocus: true, type: configuring.id === 'custom-mcp' ? 'url' : 'password', value: secret, onChange: (e) => setSecret(e.target.value), placeholder: configuring.id === 'custom-mcp' ? 'https://mcp.example.com/sse' : `${configuring.name} API key or token`, "aria-label": t('{name} credential', { name: configuring.name }), flex: 1, height: 36, px: 12, rounded: 9, bg: GROUND, borderWidth: 1, borderColor: LINE, color: INK, fontSize: 13, placeholderTextColor: "$placeholderColor" }), _jsx(XStack, { ...PILL, render: "button", type: 'button', height: 36, px: 16, bg: INK, borderColor: INK, opacity: secret.trim() ? 1 : 0.45, onClick: () => void saveCredential(), children: _jsx(Text, { ...WORD, fontSize: 13, color: "var(--background)", children: t('Connect') }) })] })] })) : null, statusNote ? (_jsxs(XStack, { px: 28, py: 9, bg: RAISED, borderBottomWidth: 1, borderColor: LINE, items: "center", justify: "space-between", children: [_jsx(Text, { fontSize: 12, lineHeight: 17, color: DIM, children: statusNote }), _jsx(XStack, { render: "button", type: 'button', onClick: () => setStatusNote(null), bg: "transparent", borderWidth: 0, cursor: "pointer", children: _jsx(X, { size: 13, color: DIM, "aria-hidden": true }) })] })) : null, _jsxs(YStack, { flex: 1, minH: 0, overflowY: "auto", px: 28, py: 20, gap: 24, children: [SECTIONS.map((sec) => {
|
|
246
|
+
const items = filtered.filter((i) => i.section === sec.id);
|
|
247
|
+
if (!items.length)
|
|
248
|
+
return null;
|
|
249
|
+
return (_jsxs(YStack, { gap: 10, children: [_jsxs(XStack, { items: "center", gap: 4, children: [_jsx(Text, { fontSize: 13, lineHeight: 18, fontWeight: "600", color: INK, children: t(sec.title) }), _jsx(ChevronRight, { size: 14, color: DIM, "aria-hidden": true })] }), _jsx(XStack, { flexWrap: "wrap", columnGap: 24, rowGap: 6, children: items.map((item) => {
|
|
250
|
+
const state = registry[item.id];
|
|
251
|
+
const connected = Boolean(state?.connected);
|
|
252
|
+
const busy = busyId === item.id;
|
|
253
|
+
return (_jsxs(XStack, { "data-connector": item.id, width: "calc(50% - 12px)", "$max-md": { width: '100%' }, minH: 58, px: 10, py: 8, rounded: 12, items: "center", gap: 12, hoverStyle: { bg: RAISED }, children: [_jsx(Mark, { item: item }), _jsxs(YStack, { flex: 1, minW: 0, gap: 1, children: [_jsx(Text, { ...CLIP, fontSize: 14, lineHeight: 19, fontWeight: "500", color: INK, children: item.name }), _jsx(Text, { ...CLIP, fontSize: 12, lineHeight: 17, color: DIM, children: connected && state?.account ? `${t('Connected')} · ${state.account}` : item.description })] }), _jsx(XStack, { render: "button", type: 'button', "aria-label": connected ? t('Disconnect {name}', { name: item.name }) : t('Connect {name}', { name: item.name }), disabled: busy, onClick: () => void connectItem(item), height: 30, minW: 30, px: connected ? 10 : 0, rounded: 999, items: "center", justify: "center", gap: 5, bg: connected ? PICKED : 'transparent', borderWidth: connected ? 1 : 0, borderColor: LINE, cursor: "pointer", opacity: busy ? 0.5 : 1, hoverStyle: { bg: PICKED }, children: connected ? (_jsxs(_Fragment, { children: [_jsx(Check, { size: 13, color: INK, "aria-hidden": true }), _jsx(Text, { fontSize: 12, lineHeight: 16, fontWeight: "500", color: INK, children: t('Connected') })] })) : (_jsx(Plus, { size: 17, color: DIM, "aria-hidden": true })) })] }, item.id));
|
|
254
|
+
}) })] }, sec.id));
|
|
255
|
+
}), filtered.length === 0 ? (_jsx(YStack, { py: 36, items: "center", gap: 8, children: _jsx(Text, { fontSize: 14, lineHeight: 20, color: DIM, children: t('No connectors match “{query}”.', { query }) }) })) : null] })] }) }) }));
|
|
256
|
+
}
|
package/dist/bots/Panel.js
CHANGED
|
@@ -7,12 +7,13 @@ import { useCallback, useEffect, useMemo, useState } from 'react';
|
|
|
7
7
|
import { useI18n } from '@hanzo/i18n/react';
|
|
8
8
|
import { Text, XStack, YStack } from '@hanzo/gui';
|
|
9
9
|
import { Button, Dialog, DialogContent, DialogTitle, DropdownMenu, DropdownMenuContent, DropdownMenuItem, DropdownMenuTrigger, Switch, } from '@hanzo/ui';
|
|
10
|
-
import { ChevronDown, ChevronRight, Clock, FileText, Image as ImageIcon, X } from 'lucide-react';
|
|
10
|
+
import { ChevronDown, ChevronRight, Clock, FileText, Image as ImageIcon, Plus, X } from 'lucide-react';
|
|
11
11
|
import { useKept } from '../kept.js';
|
|
12
12
|
import { useAi } from '../lib/ai.js';
|
|
13
13
|
import { say } from '../failure.js';
|
|
14
14
|
import { Network, of } from '../network.js';
|
|
15
15
|
import { called } from '../team.js';
|
|
16
|
+
import { ConnectorsDialog } from './ConnectorsDialog.js';
|
|
16
17
|
import { Face } from './face.js';
|
|
17
18
|
import { ALWAYS, answering, disk, grant } from './api.js';
|
|
18
19
|
import { CARD, CLIP, LABEL, PILL, ROUND, WORD } from './kit.js';
|
|
@@ -56,6 +57,7 @@ export function Panel({ bot, runs = [], onClose, kept, onSchedule, onDelete, foc
|
|
|
56
57
|
const [saving, setSaving] = useState(false);
|
|
57
58
|
const [wrong, setWrong] = useState(null);
|
|
58
59
|
const [deleting, setDeleting] = useState(false);
|
|
60
|
+
const [connectorsOpen, setConnectorsOpen] = useState(false);
|
|
59
61
|
const [voiceName, setVoiceName] = useKept('hanzo.bots.voice.name', 'Liora');
|
|
60
62
|
const [voiceSpeed, setVoiceSpeed] = useKept('hanzo.bots.voice.speed', '1x');
|
|
61
63
|
const [voiceLang, setVoiceLang] = useKept('hanzo.bots.voice.lang', 'Auto-detect');
|
|
@@ -169,7 +171,7 @@ export function Panel({ bot, runs = [], onClose, kept, onSchedule, onDelete, foc
|
|
|
169
171
|
}
|
|
170
172
|
return items.reverse();
|
|
171
173
|
}, [runs, t]);
|
|
172
|
-
return (_jsxs(YStack, { flex: 1, minH: 0, overflowY: "auto", overflowX: "hidden", "aria-label": displayName, render: "aside", children: [_jsx(XStack, { height:
|
|
174
|
+
return (_jsxs(YStack, { flex: 1, minH: 0, overflowY: "auto", overflowX: "hidden", "aria-label": displayName, render: "aside", children: [_jsx(XStack, { height: 46, shrink: 0, px: 12, items: "center", justify: "flex-end", children: _jsx(XStack, { ...ROUND, "aria-label": t('Close'), onClick: onClose, autoFocus: focus, children: _jsx(X, { size: 16, color: INK, "aria-hidden": true }) }) }), _jsxs(YStack, { items: "center", gap: 12, pt: 2, pb: 18, px: 14, children: [_jsx(Face, { bot: bot, size: 68 }), _jsx(Text, { ...CLIP, maxW: "100%", fontSize: 18, lineHeight: 23, fontWeight: "600", color: INK, children: displayName }), _jsx(XStack, { "data-parity-key": "bots.panel.tabs", role: "tablist", p: 3, rounded: 999, bg: RAISED, borderWidth: 1, borderColor: LINE, gap: 2, children: ['activity', 'library'].map((id) => {
|
|
173
175
|
const selected = tab === id;
|
|
174
176
|
return (_jsx(XStack, { render: "button", type: 'button', role: 'tab', 'aria-selected': selected, onClick: () => setTab(id), height: 28, px: 14, rounded: 999, items: "center", justify: "center", bg: selected ? PICKED : 'transparent', borderWidth: 0, cursor: "pointer", children: _jsx(Text, { fontSize: 13, lineHeight: 18, fontWeight: selected ? '500' : '400', color: selected ? INK : DIM, children: id === 'activity' ? t('Activity') : t('Library') }) }, id));
|
|
175
177
|
}) })] }), tab === 'activity' ? (_jsxs(YStack, { px: 15, pb: 24, gap: 20, children: [cron || answers.length ? (_jsxs(YStack, { gap: 10, "data-parity-key": "bots.panel.upcoming", children: [_jsx(Text, { ...LABEL, px: 4, children: t('Upcoming') }), cron ? (_jsx(YStack, { ...CARD, children: _jsx(Row, { mark: _jsx(Clock, { size: 16, color: DIM, "aria-hidden": true }), title: routine, line: scheduleLine, last: true, children: _jsx(Switch, { "aria-label": t('Run {name} on its schedule', { name: displayName }), checked: activeSchedule, disabled: saving, onCheckedChange: (on) => {
|
|
@@ -178,10 +180,10 @@ export function Panel({ bot, runs = [], onClose, kept, onSchedule, onDelete, foc
|
|
|
178
180
|
onSchedule(on, cron === 'paused' ? '0 9 * * *' : cron)
|
|
179
181
|
.catch((e) => setWrong(say(e, t('{name}’s schedule', { name: displayName }), 'save', t)))
|
|
180
182
|
.finally(() => setSaving(false));
|
|
181
|
-
} }) }) })) : null, answers.length ? (_jsx(YStack, { ...CARD, "data-parity-key": "bots.panel.networks", children: answers.map((id, i) => (_jsx(Row, { mark: _jsx(Network, { transport: id, size: 18 }), title: of(id).name, line: t('Connected'), last: i === answers.length - 1, children: _jsx(ChevronRight, { size: 15, color: DIM, "aria-hidden": true }) }, id))) })) : null] })) : null, boxed ? (_jsxs(YStack, { gap: 10, "data-parity-key": "bots.panel.computer", children: [_jsx(Text, { ...LABEL, px: 4, children: t('Computer') }), _jsxs(XStack, { ...CARD, render: "button", type: 'button', onClick: computer, disabled: busy || box?.status === 'pending', "aria-label": t(box?.status === 'running' ? 'Open {name}’s computer' : 'Wake {name}’s computer', { name: displayName }), minH: 60, px: 13, py: 10, items: "center", gap: 12, cursor: "pointer", hoverStyle: { bg: PICKED }, children: [_jsxs(YStack, { flex: 1, minW: 0, items: "flex-start", children: [_jsx(Text, { ...CLIP, fontSize: 14, lineHeight: 19, color: INK, children: t("Bot's computer") }), _jsx(Text, { ...CLIP, fontSize: 13, lineHeight: 18, color: DIM, children: busy ? t('Waking') : state(box, t) })] }), _jsx(ComputerScreen, { awake: box?.status === 'running' })] })] })) : null, _jsxs(YStack, { gap: 10, "data-parity-key": "bots.panel.voice", children: [_jsx(Text, { ...LABEL, px: 4, children: t('Voice chat') }), _jsxs(YStack, { ...CARD, children: [_jsx(VoiceRow, { label: t('Voice'), value: voiceName, options: VOICES, onSelect: setVoiceName }), _jsx(VoiceRow, { label: t('Speed'), value: voiceSpeed, options: SPEEDS, onSelect: setVoiceSpeed }), _jsx(VoiceRow, { label: t('Language'), value: voiceLang, options: LANGUAGES, onSelect: setVoiceLang, last: true })] })] }), wrong ? (_jsx(Text, { render: "p", role: "alert", px: 8, m: 0, fontSize: 13, lineHeight: 18, color: DIM, children: wrong })) : null, _jsx(XStack, { px: 8, pt: 4, children: _jsx(Text, { render: "button", type: 'button', onClick: () => setDeleting(true), bg: "transparent", borderWidth: 0, p: 0, cursor: "pointer", fontSize: 13, lineHeight: 18, color: DIM, hoverStyle: { color: INK }, children: t('Delete {name}', { name: displayName }) }) })] })) : (_jsx(YStack, { px: 15, pb: 24, gap: 12, "data-parity-key": "bots.panel.library", children: libraryItems.length ? (_jsx(YStack, { ...CARD, children: libraryItems.map((item, i) => (_jsx(Row, { mark: item.kind === 'doc' ? _jsx(FileText, { size: 16, color: DIM, "aria-hidden": true }) : _jsx(ImageIcon, { size: 16, color: DIM, "aria-hidden": true }), title: item.label, line: item.sub, last: i === libraryItems.length - 1, children: item.href ? _jsx(ChevronRight, { size: 15, color: DIM, "aria-hidden": true }) : null }, item.key))) })) : (_jsx(YStack, { ...CARD, px: 14, py: 16, items: "center", children: _jsx(Text, { fontSize: 13, lineHeight: 19, color: DIM, text: "center", children: t('Files, documents, and images shared with {name} appear here.', { name: displayName }) }) })) })), _jsx(Dialog, { open: deleting, onOpenChange: setDeleting, children: _jsxs(DialogContent, { maxW: 440, rounded: 20, gap: 14, children: [_jsx(DialogTitle, { children: t('Delete {name}?', { name: displayName }) }), _jsx(Text, { fontSize: 15, lineHeight: 22, color: DIM, children: t('{name} and every message it was sent are deleted for good.', { name: displayName }) }), _jsxs(XStack, { gap: 8, justify: "flex-end", children: [_jsx(Button, { size: "sm", variant: "outline", rounded: 999, onPress: () => setDeleting(false), children: t('Cancel') }), _jsx(XStack, { ...PILL, height: 34, bg: INK, borderColor: INK, hoverStyle: { bg: INK, opacity: 0.9 }, onClick: () => {
|
|
183
|
+
} }) }) })) : null, answers.length ? (_jsx(YStack, { ...CARD, "data-parity-key": "bots.panel.networks", children: answers.map((id, i) => (_jsx(Row, { mark: _jsx(Network, { transport: id, size: 18 }), title: of(id).name, line: t('Connected'), last: i === answers.length - 1, children: _jsx(ChevronRight, { size: 15, color: DIM, "aria-hidden": true }) }, id))) })) : null] })) : null, _jsxs(YStack, { gap: 10, "data-parity-key": "bots.panel.connectors", children: [_jsxs(XStack, { items: "center", justify: "space-between", px: 4, children: [_jsx(Text, { ...LABEL, children: t('Connectors') }), _jsxs(XStack, { render: "button", type: 'button', onClick: () => setConnectorsOpen(true), items: "center", gap: 3, px: 6, py: 2, rounded: 6, bg: "transparent", borderWidth: 0, cursor: "pointer", hoverStyle: { bg: PICKED }, children: [_jsx(Plus, { size: 12, color: DIM, "aria-hidden": true }), _jsx(Text, { fontSize: 12, lineHeight: 16, color: DIM, children: t('Add') })] })] }), _jsxs(XStack, { ...CARD, render: "button", type: 'button', onClick: () => setConnectorsOpen(true), minH: 50, px: 13, py: 9, items: "center", justify: "space-between", gap: 10, cursor: "pointer", hoverStyle: { bg: PICKED }, children: [_jsxs(YStack, { flex: 1, minW: 0, items: "flex-start", children: [_jsx(Text, { ...CLIP, fontSize: 14, lineHeight: 19, color: INK, children: answers.length ? t('{n} channels connected', { n: answers.length }) : t('Connect Slack, WhatsApp, Stripe…') }), _jsx(Text, { ...CLIP, fontSize: 12, lineHeight: 17, color: DIM, children: t('External apps, socials & MCP tools') })] }), _jsx(ChevronRight, { size: 15, color: DIM, "aria-hidden": true })] })] }), boxed ? (_jsxs(YStack, { gap: 10, "data-parity-key": "bots.panel.computer", children: [_jsx(Text, { ...LABEL, px: 4, children: t('Computer') }), _jsxs(XStack, { ...CARD, render: "button", type: 'button', onClick: computer, disabled: busy || box?.status === 'pending', "aria-label": t(box?.status === 'running' ? 'Open {name}’s computer' : 'Wake {name}’s computer', { name: displayName }), minH: 60, px: 13, py: 10, items: "center", gap: 12, cursor: "pointer", hoverStyle: { bg: PICKED }, children: [_jsxs(YStack, { flex: 1, minW: 0, items: "flex-start", children: [_jsx(Text, { ...CLIP, fontSize: 14, lineHeight: 19, color: INK, children: t("Bot's computer") }), _jsx(Text, { ...CLIP, fontSize: 13, lineHeight: 18, color: DIM, children: busy ? t('Waking') : state(box, t) })] }), _jsx(ComputerScreen, { awake: box?.status === 'running' })] })] })) : null, _jsxs(YStack, { gap: 10, "data-parity-key": "bots.panel.voice", children: [_jsx(Text, { ...LABEL, px: 4, children: t('Voice chat') }), _jsxs(YStack, { ...CARD, children: [_jsx(VoiceRow, { label: t('Voice'), value: voiceName, options: VOICES, onSelect: setVoiceName }), _jsx(VoiceRow, { label: t('Speed'), value: voiceSpeed, options: SPEEDS, onSelect: setVoiceSpeed }), _jsx(VoiceRow, { label: t('Language'), value: voiceLang, options: LANGUAGES, onSelect: setVoiceLang, last: true })] })] }), wrong ? (_jsx(Text, { render: "p", role: "alert", px: 8, m: 0, fontSize: 13, lineHeight: 18, color: DIM, children: wrong })) : null, _jsx(XStack, { px: 8, pt: 4, children: _jsx(Text, { render: "button", type: 'button', onClick: () => setDeleting(true), bg: "transparent", borderWidth: 0, p: 0, cursor: "pointer", fontSize: 13, lineHeight: 18, color: DIM, hoverStyle: { color: INK }, children: t('Delete {name}', { name: displayName }) }) })] })) : (_jsx(YStack, { px: 15, pb: 24, gap: 12, "data-parity-key": "bots.panel.library", children: libraryItems.length ? (_jsx(YStack, { ...CARD, children: libraryItems.map((item, i) => (_jsx(Row, { mark: item.kind === 'doc' ? _jsx(FileText, { size: 16, color: DIM, "aria-hidden": true }) : _jsx(ImageIcon, { size: 16, color: DIM, "aria-hidden": true }), title: item.label, line: item.sub, last: i === libraryItems.length - 1, children: item.href ? _jsx(ChevronRight, { size: 15, color: DIM, "aria-hidden": true }) : null }, item.key))) })) : (_jsx(YStack, { ...CARD, px: 14, py: 16, items: "center", children: _jsx(Text, { fontSize: 13, lineHeight: 19, color: DIM, text: "center", children: t('Files, documents, and images shared with {name} appear here.', { name: displayName }) }) })) })), _jsx(Dialog, { open: deleting, onOpenChange: setDeleting, children: _jsxs(DialogContent, { maxW: 440, rounded: 20, gap: 14, children: [_jsx(DialogTitle, { children: t('Delete {name}?', { name: displayName }) }), _jsx(Text, { fontSize: 15, lineHeight: 22, color: DIM, children: t('{name} and every message it was sent are deleted for good.', { name: displayName }) }), _jsxs(XStack, { gap: 8, justify: "flex-end", children: [_jsx(Button, { size: "sm", variant: "outline", rounded: 999, onPress: () => setDeleting(false), children: t('Cancel') }), _jsx(XStack, { ...PILL, height: 34, bg: INK, borderColor: INK, hoverStyle: { bg: INK, opacity: 0.9 }, onClick: () => {
|
|
182
184
|
if (!deleting)
|
|
183
185
|
return;
|
|
184
186
|
setDeleting(false);
|
|
185
187
|
onDelete().catch((e) => setWrong(say(e, displayName, 'save', t)));
|
|
186
|
-
}, children: _jsx(Text, { ...WORD, color: "var(--background)", children: t('Delete') }) })] })] }) })] }));
|
|
188
|
+
}, children: _jsx(Text, { ...WORD, color: "var(--background)", children: t('Delete') }) })] })] }) }), _jsx(ConnectorsDialog, { open: connectorsOpen, onOpenChange: setConnectorsOpen, defaultFilter: "channels", onConnected: () => void survey() })] }));
|
|
187
189
|
}
|
package/dist/bots/Roster.js
CHANGED
|
@@ -7,11 +7,11 @@ import { useEffect, useMemo, useState } from 'react';
|
|
|
7
7
|
import { useI18n } from '@hanzo/i18n/react';
|
|
8
8
|
import { Input, Text, XStack, YStack } from '@hanzo/gui';
|
|
9
9
|
import { DropdownMenu, DropdownMenuContent, DropdownMenuItem, DropdownMenuLabel, DropdownMenuSeparator, DropdownMenuTrigger, } from '@hanzo/ui';
|
|
10
|
-
import { BUSINESS_APPS } from '@hanzo/ui/product';
|
|
11
10
|
import { Grid2x2Plus, Plus, Search, SlidersHorizontal, X } from 'lucide-react';
|
|
12
11
|
import { useSignOut } from '../lib/signout.js';
|
|
13
12
|
import { PreferencesDialog } from '../PreferencesDialog.js';
|
|
14
13
|
import { called, member } from '../team.js';
|
|
14
|
+
import { ConnectorsDialog } from './ConnectorsDialog.js';
|
|
15
15
|
import { Face } from './face.js';
|
|
16
16
|
import { CLIP, PILL, ROUND, WORD } from './kit.js';
|
|
17
17
|
import { DIM, FLOOR, INK, LINE, PICKED, RAISED } from './ink.js';
|
|
@@ -30,13 +30,13 @@ export function Roster({ bots, last, open, unread, me, onPick, onMake, disabled,
|
|
|
30
30
|
: all;
|
|
31
31
|
}, [bots, query]);
|
|
32
32
|
const { grid, rows } = useMemo(() => split(shown, last), [shown, last]);
|
|
33
|
-
return (_jsxs(YStack, { flex: 1, minH: 0, position: "relative", children: [_jsxs(XStack, { "data-parity-key": "bots.roster.bar", height:
|
|
33
|
+
return (_jsxs(YStack, { flex: 1, minH: 0, position: "relative", children: [_jsxs(XStack, { "data-parity-key": "bots.roster.bar", height: 46, shrink: 0, px: 12, items: "center", justify: "flex-end", gap: 8, children: [_jsx(XStack, { ...ROUND, "aria-label": t(seeking ? 'Close search' : 'Search bots'), "aria-pressed": seeking, onClick: () => {
|
|
34
34
|
setSeeking(!seeking);
|
|
35
35
|
setQuery('');
|
|
36
|
-
}, children: seeking ? _jsx(X, { size: 16, color: INK, "aria-hidden": true }) : _jsx(Search, { size: 16, color: INK, "aria-hidden": true }) }), _jsx(XStack, { ...ROUND, "aria-label": t('New bot'), onClick: onMake, disabled: disabled, opacity: disabled ? 0.5 : 1, children: _jsx(Plus, { size: 18, color: INK, "aria-hidden": true }) })] }), seeking ? (_jsx(XStack, { px:
|
|
36
|
+
}, children: seeking ? _jsx(X, { size: 16, color: INK, "aria-hidden": true }) : _jsx(Search, { size: 16, color: INK, "aria-hidden": true }) }), _jsx(XStack, { ...ROUND, "aria-label": t('New bot'), onClick: onMake, disabled: disabled, opacity: disabled ? 0.5 : 1, children: _jsx(Plus, { size: 18, color: INK, "aria-hidden": true }) })] }), seeking ? (_jsx(XStack, { px: 10, pb: 8, shrink: 0, children: _jsx(Input, { unstyled: true, autoFocus: true, value: query, onChange: (e) => setQuery(e.target.value), placeholder: t('Search'), "aria-label": t('Search bots'), width: "100%", height: 34, px: 12, rounded: 999, bg: RAISED, borderWidth: 1, borderColor: LINE, color: INK, fontSize: 14, placeholderTextColor: "$placeholderColor" }) })) : null, _jsxs(YStack, { flex: 1, minH: 0, position: "relative", children: [_jsxs(YStack, { flex: 1, minH: 0, overflowY: "auto", overflowX: "hidden", children: [unread ? (_jsx(Text, { render: "p", px: 16, py: 8, fontSize: 13, lineHeight: 18, color: DIM, children: unread })) : null, bots && bots.length === 0 && !unread && !disabled ? (_jsxs(YStack, { display: "none", "$max-md": { display: 'flex' }, items: "center", gap: 16, pt: 140, px: 20, children: [_jsx(Text, { render: "h1", m: 0, fontSize: 22, lineHeight: 28, fontWeight: "500", color: INK, children: t('Make your first bot') }), _jsx(XStack, { ...PILL, onClick: onMake, children: _jsx(Text, { ...WORD, children: t('New bot') }) })] })) : null, grid.length ? (_jsx(XStack, { "data-parity-key": "bots.grid", role: "group", "aria-label": t('Bots'), flexWrap: "wrap", px: 9, pt: 4, columnGap: 3, rowGap: 10, "$max-md": { px: 12, columnGap: 0, justify: 'space-between' }, children: grid.map((b) => {
|
|
37
37
|
const here = b.name === open;
|
|
38
38
|
const label = called(b.name);
|
|
39
|
-
return (_jsxs(YStack, { render: "button", type: 'button', "data-parity-key": "bots.tile", "data-name": b.name, "aria-current": here, "aria-label": label, onClick: () => onPick(b.name), width:
|
|
39
|
+
return (_jsxs(YStack, { render: "button", type: 'button', "data-parity-key": "bots.tile", "data-name": b.name, "aria-current": here, "aria-label": label, onClick: () => onPick(b.name), width: 78, height: 88, rounded: 11, items: "center", pt: 5, gap: 5, bg: here ? PICKED : 'transparent', borderWidth: 0, cursor: "pointer", hoverStyle: { bg: here ? PICKED : 'var(--rail-hover, var(--muted))' }, focusVisibleStyle: { outlineWidth: 2, outlineStyle: 'solid', outlineColor: '$outlineColor' }, "$max-md": { width: '33%' }, children: [_jsx(Face, { bot: b, size: 56, starred: member(b.name)?.seat === 1 }), _jsx(Text, { ...CLIP, maxW: 72, fontSize: 13, lineHeight: 17, fontWeight: here ? '500' : '400', color: INK, children: label })] }, b.id || b.name));
|
|
40
40
|
}) })) : null, rows.length ? (_jsx(YStack, { "data-parity-key": "bots.rows", role: "group", "aria-label": t('More bots'), pt: 16, pb: 22, children: rows.map((b) => {
|
|
41
41
|
const here = b.name === open;
|
|
42
42
|
const label = called(b.name);
|
|
@@ -44,11 +44,12 @@ export function Roster({ bots, last, open, unread, me, onPick, onMake, disabled,
|
|
|
44
44
|
return (_jsxs(XStack, { render: "button", type: 'button', "data-parity-key": "bots.row", "data-name": b.name, "aria-current": here, onClick: () => onPick(b.name), height: 56, mx: 6, px: 12, gap: 10, items: "center", rounded: 10, bg: here ? PICKED : 'transparent', borderWidth: 0, cursor: "pointer", hoverStyle: { bg: here ? PICKED : 'var(--rail-hover, var(--muted))' }, focusVisibleStyle: { outlineWidth: 2, outlineStyle: 'solid', outlineColor: '$outlineColor' }, children: [_jsx(Face, { bot: b, size: 36 }), _jsxs(YStack, { flex: 1, minW: 0, items: "flex-start", children: [_jsx(Text, { ...CLIP, maxW: "100%", fontSize: 14, lineHeight: 19, fontWeight: "500", color: INK, children: label }), word ? (_jsx(Text, { ...CLIP, maxW: "100%", fontSize: 13, lineHeight: 18, color: DIM, children: word })) : null] })] }, b.id || b.name));
|
|
45
45
|
}) })) : null] }), rows.length ? (_jsx(YStack, { "aria-hidden": true, pointerEvents: "none", position: "absolute", l: 0, r: 0, b: 0, height: 28, "$platform-web": { backgroundImage: `linear-gradient(to bottom, transparent, ${FLOOR})` } })) : null] }), _jsx(Foot, { me: me })] }));
|
|
46
46
|
}
|
|
47
|
-
/** You, at the foot: your account,
|
|
47
|
+
/** You, at the foot: your account, external Connectors, and unified Hanzo Preferences. */
|
|
48
48
|
function Foot({ me }) {
|
|
49
49
|
const { t } = useI18n();
|
|
50
50
|
const leave = useSignOut();
|
|
51
51
|
const [prefsOpen, setPrefsOpen] = useState(false);
|
|
52
|
+
const [connectorsOpen, setConnectorsOpen] = useState(false);
|
|
52
53
|
const name = me?.displayName || me?.name || '';
|
|
53
54
|
useEffect(() => {
|
|
54
55
|
if (!me)
|
|
@@ -64,5 +65,5 @@ function Foot({ me }) {
|
|
|
64
65
|
}, [me]);
|
|
65
66
|
if (!me)
|
|
66
67
|
return null;
|
|
67
|
-
return (_jsxs(_Fragment, { children: [_jsxs(XStack, { "data-parity-key": "bots.me", height:
|
|
68
|
+
return (_jsxs(_Fragment, { children: [_jsxs(XStack, { "data-parity-key": "bots.me", height: 52, shrink: 0, px: 12, items: "center", gap: 6, borderTopWidth: 1, borderColor: LINE, children: [_jsxs(DropdownMenu, { placement: "top-start", offset: 8, children: [_jsx(DropdownMenuTrigger, { asChild: true, children: _jsxs(XStack, { render: "button", type: 'button', "aria-label": t('Account: {name}', { name }), flex: 1, minW: 0, items: "center", gap: 9, bg: "transparent", borderWidth: 0, p: 0, cursor: "pointer", children: [_jsx(Face, { bot: { name, avatar: me.avatar }, size: 30, person: true }), _jsx(Text, { ...CLIP, fontSize: 14, lineHeight: 19, fontWeight: "500", color: INK, children: name })] }) }), _jsxs(DropdownMenuContent, { minW: 240, "aria-label": t('Account'), children: [_jsx(DropdownMenuLabel, { children: _jsxs(YStack, { minW: 0, gap: 2, children: [_jsx(Text, { fontSize: "$3", color: "$ink", numberOfLines: 1, children: name }), me.email ? (_jsx(Text, { fontSize: "$2", color: "$soft", numberOfLines: 1, children: me.email })) : null] }) }), _jsx(DropdownMenuSeparator, {}), _jsx(DropdownMenuItem, { onSelect: () => setConnectorsOpen(true), children: _jsx(Text, { fontSize: "$3", color: "$ink", children: t('Connectors') }) }), _jsx(DropdownMenuItem, { onSelect: () => setPrefsOpen(true), children: _jsx(Text, { fontSize: "$3", color: "$ink", children: t('Preferences') }) }), _jsx(DropdownMenuItem, { onSelect: () => void leave(), children: _jsx(Text, { fontSize: "$3", color: "$ink", children: t('Log out') }) })] })] }), _jsx(XStack, { ...ROUND, "aria-label": t('Connectors'), onClick: () => setConnectorsOpen(true), children: _jsx(Grid2x2Plus, { size: 16, color: INK, "aria-hidden": true }) }), _jsx(XStack, { ...ROUND, "aria-label": t('Preferences'), onClick: () => setPrefsOpen(true), children: _jsx(SlidersHorizontal, { size: 15, color: INK, "aria-hidden": true }) })] }), _jsx(ConnectorsDialog, { open: connectorsOpen, onOpenChange: setConnectorsOpen }), _jsx(PreferencesDialog, { open: prefsOpen, onOpenChange: setPrefsOpen })] }));
|
|
68
69
|
}
|
package/dist/bots/Thread.js
CHANGED
|
@@ -22,8 +22,6 @@ import { instant } from './time.js';
|
|
|
22
22
|
import { lines, partsOf } from './said.js';
|
|
23
23
|
import { compose, fits, MAX, texty } from './carry.js';
|
|
24
24
|
import { PARAM } from './api.js';
|
|
25
|
-
/** The widest a conversation reads, as the desktop app draws it. */
|
|
26
|
-
const MEASURE = 900;
|
|
27
25
|
function DocBadge({ ext }) {
|
|
28
26
|
const accent = ext === 'pdf'
|
|
29
27
|
? 'var(--destructive)'
|
|
@@ -120,21 +118,21 @@ export function Thread({ bot, bots, runs, pending, notice, wrong, side, live, lo
|
|
|
120
118
|
});
|
|
121
119
|
};
|
|
122
120
|
const hasDraft = Boolean(draft.trim() || file);
|
|
123
|
-
return (_jsxs(YStack, { flex: 1, minH: 0, position: "relative", children: [_jsxs(XStack, { "data-parity-key": "bots.bar", position: "absolute", t: 0, l: 0, r: 0, z: 4, height:
|
|
121
|
+
return (_jsxs(YStack, { flex: 1, minH: 0, position: "relative", children: [_jsxs(XStack, { "data-parity-key": "bots.bar", position: "absolute", t: 0, l: 0, r: 0, z: 4, height: 46, px: 14, items: "center", gap: 8, pointerEvents: "none", "$platform-web": {
|
|
124
122
|
backgroundImage: `linear-gradient(to bottom, ${GROUND} 18%, color-mix(in srgb, ${GROUND} 68%, transparent) 64%, transparent)`,
|
|
125
|
-
}, children: [_jsx(XStack, { flex: 1, minW: 0, items: "center", children: _jsx(XStack, { ...ROUND, pointerEvents: "auto", "aria-label": t('All bots'), onClick: onBack, display: "none", "$max-md": { display: 'flex' }, children: _jsx(ArrowLeft, { size: 16, color: INK, "aria-hidden": true, "data-i18n-mirror": true }) }) }), bot ? (_jsxs(XStack, { ...PILL, pointerEvents: "auto", "data-parity-key": "bots.pill", "aria-label": t('{name}’s details', { name: displayName }), "aria-expanded": side, onClick: onSide, height: 36, pl: 6, pr: 13, maxW: "60%", bg: RAISED, "$platform-web": { backdropFilter: 'blur(16px)', WebkitBackdropFilter: 'blur(16px)' }, children: [_jsx(Face, { bot: bot, size: 24 }), _jsx(Text, { ...WORD, ...CLIP, children: displayName })] })) : null, _jsx(XStack, { flex: 1, minW: 0, items: "center", justify: "flex-end", children: bot ? (_jsx(XStack, { ...ROUND, pointerEvents: "auto", "data-parity-key": "bots.share", "aria-label": shared ?? t('Share'), onClick: share, "$platform-web": { backdropFilter: 'blur(16px)', WebkitBackdropFilter: 'blur(16px)' }, children: shared ? _jsx(Check, { size: 15, color: INK, "aria-hidden": true }) : _jsx(Share, { size: 15, color: INK, "aria-hidden": true }) })) : null })] }), !bot ? (_jsx(YStack, { flex: 1, items: "center", justify: "center", gap: 16, px: 24, children: live && loaded && bots.length === 0 ? (_jsxs(_Fragment, { children: [_jsx(Text, { render: "h1", m: 0, fontSize: 22, lineHeight: 28, fontWeight: "500", color: INK, children: t('Make your first bot') }), _jsx(XStack, { ...PILL, onClick: onMake, children: _jsx(Text, { ...WORD, children: t('New bot') }) })] })) : null })) : (_jsx(YStack, { "data-parity-key": "bots.thread", flex: 1, minH: 0, overflowY: "auto", overflowX: "hidden", children: _jsxs(YStack, { width: "100%",
|
|
123
|
+
}, children: [_jsx(XStack, { flex: 1, minW: 0, items: "center", children: _jsx(XStack, { ...ROUND, pointerEvents: "auto", "aria-label": t('All bots'), onClick: onBack, display: "none", "$max-md": { display: 'flex' }, children: _jsx(ArrowLeft, { size: 16, color: INK, "aria-hidden": true, "data-i18n-mirror": true }) }) }), bot ? (_jsxs(XStack, { ...PILL, pointerEvents: "auto", "data-parity-key": "bots.pill", "aria-label": t('{name}’s details', { name: displayName }), "aria-expanded": side, onClick: onSide, height: 36, pl: 6, pr: 13, maxW: "60%", bg: RAISED, "$platform-web": { backdropFilter: 'blur(16px)', WebkitBackdropFilter: 'blur(16px)' }, children: [_jsx(Face, { bot: bot, size: 24 }), _jsx(Text, { ...WORD, ...CLIP, children: displayName })] })) : null, _jsx(XStack, { flex: 1, minW: 0, items: "center", justify: "flex-end", children: bot ? (_jsx(XStack, { ...ROUND, pointerEvents: "auto", "data-parity-key": "bots.share", "aria-label": shared ?? t('Share'), onClick: share, "$platform-web": { backdropFilter: 'blur(16px)', WebkitBackdropFilter: 'blur(16px)' }, children: shared ? _jsx(Check, { size: 15, color: INK, "aria-hidden": true }) : _jsx(Share, { size: 15, color: INK, "aria-hidden": true }) })) : null })] }), !bot ? (_jsx(YStack, { flex: 1, items: "center", justify: "center", gap: 16, px: 24, children: live && loaded && bots.length === 0 ? (_jsxs(_Fragment, { children: [_jsx(Text, { render: "h1", m: 0, fontSize: 22, lineHeight: 28, fontWeight: "500", color: INK, children: t('Make your first bot') }), _jsx(XStack, { ...PILL, onClick: onMake, children: _jsx(Text, { ...WORD, children: t('New bot') }) })] })) : null })) : (_jsx(YStack, { "data-parity-key": "bots.thread", flex: 1, minH: 0, overflowY: "auto", overflowX: "hidden", children: _jsxs(YStack, { width: "100%", px: 18, pt: 52, pb: 14, "$max-md": { px: 12 }, children: [said.map((line, i) => {
|
|
126
124
|
const prev = said[i - 1];
|
|
127
|
-
const gap = !prev ? 0 : line.kind === prev.kind && (line.kind === 'mine' || line.kind === 'theirs') ? 6 :
|
|
125
|
+
const gap = !prev ? 0 : line.kind === prev.kind && (line.kind === 'mine' || line.kind === 'theirs') ? 6 : 14;
|
|
128
126
|
if (line.kind === 'stamp')
|
|
129
|
-
return (_jsx(Text, { self: "center", mt: i ?
|
|
127
|
+
return (_jsx(Text, { self: "center", mt: i ? 18 : 4, mb: 4, fontSize: 12, lineHeight: 17, color: DIM, children: line.text }, line.key));
|
|
130
128
|
if (line.kind === 'from')
|
|
131
129
|
return (_jsxs(XStack, { self: "center", mt: gap, items: "center", gap: 6, children: [_jsx(Text, { fontSize: 12, lineHeight: 17, color: DIM, children: t('Message from') }), _jsx(Face, { bot: line.bot, size: 16 }), _jsx(Text, { fontSize: 12, lineHeight: 17, color: DIM, children: called(line.bot.name) })] }, line.key));
|
|
132
130
|
if (line.kind === 'mine')
|
|
133
|
-
return (_jsx(YStack, { self: "flex-end", items: "flex-end", maxW: "
|
|
131
|
+
return (_jsx(YStack, { self: "flex-end", items: "flex-end", maxW: "76%", mt: gap, children: _jsx(Text, { "data-parity-key": "bots.mine", render: "div", px: 14, py: 8, rounded: 18, fontSize: 15, lineHeight: 22, color: INK, whiteSpace: "pre-wrap", "$platform-web": { overflowWrap: 'anywhere', backgroundColor: MINE }, children: line.text }) }, line.key));
|
|
134
132
|
if (line.kind === 'thinking')
|
|
135
133
|
return (_jsx(XStack, { "data-parity-key": "bots.thinking", role: "status", "aria-label": t('{name} is working', { name: displayName }), self: "flex-start", mt: gap, px: 14, height: 38, items: "center", rounded: 16, bg: RAISED, borderWidth: 1, borderColor: LINE, children: _jsx(Caret, {}) }, line.key));
|
|
136
134
|
if (line.kind === 'theirs' && line.failed)
|
|
137
|
-
return (_jsx(YStack, { "data-parity-key": "bots.theirs", self: "flex-start", maxW:
|
|
135
|
+
return (_jsx(YStack, { "data-parity-key": "bots.theirs", self: "flex-start", maxW: 680, mt: gap, px: 15, py: 11, rounded: 18, bg: RAISED, borderWidth: 1, borderColor: LINE, "$max-md": { maxW: '92%' }, children: _jsx(Text, { fontSize: 15, lineHeight: 22, color: DIM, children: line.text }) }, line.key));
|
|
138
136
|
const parts = partsOf(line.text);
|
|
139
137
|
return (_jsx(YStack, { "data-parity-key": line.kind === 'other' ? 'bots.other' : 'bots.theirs', self: "flex-start", items: "flex-start", gap: 10, maxW: "100%", mt: gap, children: parts.map((part, idx) => {
|
|
140
138
|
if (part.kind === 'doc') {
|
|
@@ -144,9 +142,9 @@ export function Thread({ bot, bots, runs, pending, notice, wrong, side, live, lo
|
|
|
144
142
|
if (part.kind === 'image') {
|
|
145
143
|
return (_jsx(YStack, { width: 172, rounded: 14, overflow: "hidden", bg: RAISED, borderWidth: 1, borderColor: LINE, children: _jsx(YStack, { render: "img", src: part.src, alt: part.alt, width: "100%", height: "auto", display: "block" }) }, idx));
|
|
146
144
|
}
|
|
147
|
-
return (_jsx(YStack, { maxW:
|
|
145
|
+
return (_jsx(YStack, { maxW: 680, px: 15, py: 11, rounded: 18, bg: RAISED, borderWidth: 1, borderColor: LINE, "$max-md": { maxW: '92%' }, children: _jsx(Prose, { text: part.text }) }, idx));
|
|
148
146
|
}) }, line.key));
|
|
149
|
-
}), wrong ? (_jsx(Text, { render: "p", self: "center", mt: 12, fontSize: 13, lineHeight: 18, color: DIM, children: wrong })) : null, _jsx("div", { ref: foot })] }) })), bot ? (_jsxs(YStack, { width: "100%",
|
|
147
|
+
}), wrong ? (_jsx(Text, { render: "p", self: "center", mt: 12, fontSize: 13, lineHeight: 18, color: DIM, children: wrong })) : null, _jsx("div", { ref: foot })] }) })), bot ? (_jsxs(YStack, { width: "100%", px: 16, pb: 12, gap: 8, shrink: 0, "$max-md": { px: 8, pb: 8 }, children: [notice ? (_jsxs(YStack, { "data-parity-key": "bots.notice", role: "alert", bg: RAISED, borderWidth: 1, borderColor: LINE, rounded: 16, pt: 12, pb: 10, px: 14, gap: 10, children: [_jsxs(XStack, { items: "flex-start", gap: 10, children: [_jsx(YStack, { pt: 3, children: _jsx(Gauge, { size: 16, color: DIM, "aria-hidden": true }) }), _jsxs(YStack, { flex: 1, minW: 0, children: [_jsx(Text, { fontSize: 15, lineHeight: 22, color: INK, children: notice.message }), lifts(notice.resets, now, t) ? (_jsx(Text, { fontSize: 15, lineHeight: 22, color: DIM, children: lifts(notice.resets, now, t) })) : null] }), _jsx(XStack, { ...ROUND, width: 28, height: 28, bg: "transparent", borderWidth: 0, "aria-label": t('Dismiss'), onClick: onDismiss, children: _jsx(X, { size: 14, color: DIM, "aria-hidden": true }) })] }), notice.actions.some(navigable) ? (_jsx(XStack, { justify: "flex-end", gap: 8, flexWrap: "wrap", children: notice.actions.filter(navigable).map((a, i, all) => (_jsx(XStack, { ...PILL, render: "a", href: a.url, height: 34, bg: i === all.length - 1 ? INK : RAISED, borderColor: i === all.length - 1 ? INK : LINE, "$platform-web": { textDecoration: 'none' }, children: _jsx(Text, { ...WORD, color: i === all.length - 1 ? 'var(--background)' : INK, children: a.label }) }, `${a.kind}-${a.label}`))) })) : null] })) : null, file ? (_jsxs(XStack, { self: "flex-start", items: "center", gap: 6, height: 30, pl: 12, pr: 4, rounded: 999, bg: RAISED, borderWidth: 1, borderColor: LINE, children: [_jsx(Text, { ...CLIP, maxW: 260, fontSize: 13, lineHeight: 18, color: INK, children: file.name }), _jsx(XStack, { ...ROUND, width: 24, height: 24, bg: "transparent", borderWidth: 0, "aria-label": t('Remove {name}', { name: file.name }), onClick: () => setFile(null), children: _jsx(X, { size: 12, color: DIM, "aria-hidden": true }) })] })) : null, note ? (_jsx(Text, { role: "alert", fontSize: 13, lineHeight: 18, color: DIM, px: 8, children: note })) : null, _jsx(Composer, { render: "form", onSubmit: (e) => {
|
|
150
148
|
e.preventDefault();
|
|
151
149
|
submit();
|
|
152
150
|
}, control: 32, width: "100%", children: _jsxs(XStack, { "data-parity-key": "bots.composer", height: 46, pl: 7, pr: 7, gap: 6, items: "center", rounded: 999, bg: RAISED, borderWidth: 1, borderColor: EDGE, focusWithinStyle: { borderColor: 'var(--ring)' }, children: [_jsx(Control, { type: "button", "aria-label": t('Add a text file'), onClick: () => pick.current?.click(), disabled: !live, children: _jsx(Plus, { size: 16 }) }), _jsx(Field, { value: draft, onChangeText: setDraft, onKeyDown: (e) => {
|
package/dist/ground.d.ts
CHANGED
|
@@ -37,13 +37,13 @@ export declare const TOUCH_HEAD = 44;
|
|
|
37
37
|
* mark from the pane's end edge, so the two top corners mirror each other
|
|
38
38
|
* (owner, 2026-10-30: "top left / top right").
|
|
39
39
|
*/
|
|
40
|
-
export declare const INSET =
|
|
40
|
+
export declare const INSET = 24;
|
|
41
41
|
/** The rail's width, px: two insets. */
|
|
42
42
|
export declare const RAIL: number;
|
|
43
43
|
/** The top bar's height, px, on every shell. */
|
|
44
|
-
export declare const BAR =
|
|
44
|
+
export declare const BAR = 38;
|
|
45
45
|
/** The sidebar's width before the reader pulls its edge, px. */
|
|
46
|
-
export declare const SIDE =
|
|
46
|
+
export declare const SIDE = 248;
|
|
47
47
|
/**
|
|
48
48
|
* A row INSIDE a pane shares the height of the row it lines up with.
|
|
49
49
|
*/
|
package/dist/ground.js
CHANGED
|
@@ -37,13 +37,13 @@ export const TOUCH_HEAD = 44;
|
|
|
37
37
|
* mark from the pane's end edge, so the two top corners mirror each other
|
|
38
38
|
* (owner, 2026-10-30: "top left / top right").
|
|
39
39
|
*/
|
|
40
|
-
export const INSET =
|
|
40
|
+
export const INSET = 24;
|
|
41
41
|
/** The rail's width, px: two insets. */
|
|
42
42
|
export const RAIL = 2 * INSET;
|
|
43
43
|
/** The top bar's height, px, on every shell. */
|
|
44
|
-
export const BAR =
|
|
44
|
+
export const BAR = 38;
|
|
45
45
|
/** The sidebar's width before the reader pulls its edge, px. */
|
|
46
|
-
export const SIDE =
|
|
46
|
+
export const SIDE = 248;
|
|
47
47
|
/**
|
|
48
48
|
* A row INSIDE a pane shares the height of the row it lines up with.
|
|
49
49
|
*/
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@hanzo/app",
|
|
3
|
-
"version": "0.3.
|
|
3
|
+
"version": "0.3.76",
|
|
4
4
|
"description": "Hanzo's app: the shell and its apps (Home, Chat, Inbox, Contacts, Meet, Calendar, Drive, Board, Work, Bots), once, for every Hanzo surface.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/index.js",
|