@hanzo/app 0.2.43 → 0.2.45
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/Chat.js +35 -28
- package/dist/Meet.js +1 -1
- package/dist/Top.js +10 -10
- package/dist/hint.d.ts +18 -0
- package/dist/hint.js +76 -0
- package/dist/lib/host.js +5 -0
- package/dist/speech.js +1 -1
- package/dist/thread.d.ts +1 -0
- package/package.json +1 -1
package/dist/Chat.js
CHANGED
|
@@ -42,7 +42,7 @@ import { Face, brief as roomBrief, join, roleOf, roomTurn, roster as rosterLine,
|
|
|
42
42
|
import { cleanForSpeech, speakAgent } from "./speech.js";
|
|
43
43
|
import { AgentMaker, HOUSE, useAgentShelf, useCrew } from "./crew.js";
|
|
44
44
|
import { called } from "./team.js";
|
|
45
|
-
import { Anchor, Box, Button, Text, View, XStack, YStack } from "@hanzo/ui";
|
|
45
|
+
import { Anchor, Box, Button, Switch, Text, View, XStack, YStack } from "@hanzo/ui";
|
|
46
46
|
import { useMedia } from "@hanzo/gui";
|
|
47
47
|
import { given, tidy } from "./lib/title.js";
|
|
48
48
|
import { useIam, useIamToken } from "@hanzo/iam/react";
|
|
@@ -57,7 +57,7 @@ import { useHydrated } from "./lib/hydrated.js";
|
|
|
57
57
|
import { base, served } from "./lib/ai.js";
|
|
58
58
|
import { onServed } from "./lib/served.js";
|
|
59
59
|
import { refused as worded, speech, useDictation, useTalk, useVoice } from "@hanzo/voice";
|
|
60
|
-
import { Check, Clock, FileText, Image as ImageMark, Library as LibraryMark, Paperclip, Sparkles, X } from "lucide-react";
|
|
60
|
+
import { Check, Clock, FileText, Ghost, Image as ImageMark, Library as LibraryMark, Paperclip, Sparkles, X } from "lucide-react";
|
|
61
61
|
import { FREE, ENSO } from "./lib/ai.js";
|
|
62
62
|
import { openThread, useOpen } from "./open.js";
|
|
63
63
|
import { Beside, Framed } from "./Shell.js";
|
|
@@ -67,7 +67,7 @@ import { ConversationMenu, ThreadMore, useThreadList } from "./thread.js";
|
|
|
67
67
|
import { Schedule } from "./Schedule.js";
|
|
68
68
|
import { keepFile, useAttach, useKeep } from "./keep.js";
|
|
69
69
|
import { dragWindow, toggleWindowMaximize } from "./WindowControls.js";
|
|
70
|
-
import { artifacts, lead, nameOf, PAGE, Panel, PanelToggle, renders, Reply, Served, Summary, useDeck, useKey, Suggestions, useCarry, useLanguage, useMind, useSuggestions,
|
|
70
|
+
import { artifacts, lead, nameOf, PAGE, Panel, PanelToggle, renders, Reply, Served, Summary, useDeck, useKey, Suggestions, useCarry, useLanguage, useMind, useSuggestions, taken, CHAT_MODES, usePanel, frames, name as tabName, } from "@hanzo/build";
|
|
71
71
|
import { checkoutUrl, payUrl } from './lib/pay.js';
|
|
72
72
|
import { Upgrade, useFree } from './Upgrade.js';
|
|
73
73
|
import { enter, LOGIN } from './lib/destination.js';
|
|
@@ -76,6 +76,7 @@ import { BAD } from "./lib/mix.js";
|
|
|
76
76
|
import { brand } from './where.js';
|
|
77
77
|
import { BAND } from './ground.js';
|
|
78
78
|
import { shared, useChatPreferences } from './lib/chatPreferences.js';
|
|
79
|
+
import { handleHint } from './hint.js';
|
|
79
80
|
// NO REASONING PANEL HERE. Every assistant turn opened a "Thinking" disclosure
|
|
80
81
|
// listing seven steps — "Planning CSS extraction for chat styles", "Designing
|
|
81
82
|
// responsive top bar grid layout" — typed into this file as a literal array.
|
|
@@ -539,6 +540,8 @@ function Thread({ placeholder = message(), initial, anonymous = false, heading,
|
|
|
539
540
|
// The opening greets the person by the first word of their display name, capitalised ("What’s up, Z?").
|
|
540
541
|
// A username is a handle, not a name: without a display name the greeting has none.
|
|
541
542
|
const firstName = useMemo(() => (anonymous ? "" : given(named()?.display ?? "")), [anonymous]);
|
|
543
|
+
// Private / forgetful mode: an ephemeral conversation kept in memory only, never saved to server history.
|
|
544
|
+
const [forgetful, setForgetful] = useState(false);
|
|
542
545
|
// Up to three things worth doing next, from the person's own activity (@hanzo/build).
|
|
543
546
|
const hints = useSuggestions(target);
|
|
544
547
|
// THE HEADER'S ⋯ IS THE ROW'S MENU (thread.tsx): rename, pin, share, its
|
|
@@ -737,7 +740,7 @@ function Thread({ placeholder = message(), initial, anonymous = false, heading,
|
|
|
737
740
|
// — the Recent they opened — so a reply lands in it rather than beside it.
|
|
738
741
|
const chat = useChat({
|
|
739
742
|
model,
|
|
740
|
-
keep: !anonymous,
|
|
743
|
+
keep: !anonymous && !forgetful,
|
|
741
744
|
// THE PILL THAT WAS CUT READ A SETTING NOTHING SET, and that was the right
|
|
742
745
|
// reason to cut it. This is the other half: `params` is forwarded to the
|
|
743
746
|
// completion, so the effort chosen on the bar rides the request. An
|
|
@@ -1108,7 +1111,7 @@ function Thread({ placeholder = message(), initial, anonymous = false, heading,
|
|
|
1108
1111
|
// WHAT AN ANSWER MAKES IS KEPT IN THE LIBRARY as it finishes (keep.ts): the
|
|
1109
1112
|
// answer that just stopped, once the conversation it belongs to has an id.
|
|
1110
1113
|
const [finished, setFinished] = useState(null);
|
|
1111
|
-
useKeep(ai, !anonymous, kept ?? open, finished, artifacts);
|
|
1114
|
+
useKeep(ai, !anonymous && !forgetful, kept ?? open, finished, artifacts);
|
|
1112
1115
|
// WHAT AN ANSWER MAKES OPENS BESIDE IT. With the panel open, a page or a
|
|
1113
1116
|
// picture an answer just finished writing is opened as a tab; with it shut,
|
|
1114
1117
|
// the answer's own Open does it.
|
|
@@ -1135,6 +1138,23 @@ function Thread({ placeholder = message(), initial, anonymous = false, heading,
|
|
|
1135
1138
|
// brief in the transcript as though somebody had typed it, and would make a
|
|
1136
1139
|
// room nobody has spoken in look like a conversation already under way.
|
|
1137
1140
|
const said = useMemo(() => chat.messages.filter((m) => m.role !== "system"), [chat.messages]);
|
|
1141
|
+
const currentThread = useMemo(() => {
|
|
1142
|
+
const firstText = said[0]?.content;
|
|
1143
|
+
const initialText = typeof firstText === "string" ? firstText : Array.isArray(firstText) ? firstText[0]?.text : "";
|
|
1144
|
+
return mine ?? {
|
|
1145
|
+
id: open || "active-chat",
|
|
1146
|
+
title: tidy(initialText || t("New chat")),
|
|
1147
|
+
created: Date.now(),
|
|
1148
|
+
updated: Date.now(),
|
|
1149
|
+
room: room.length ? room : [],
|
|
1150
|
+
};
|
|
1151
|
+
}, [mine, open, said, t, room]);
|
|
1152
|
+
const currentThreadMap = useMemo(() => {
|
|
1153
|
+
const map = new Map(alone);
|
|
1154
|
+
if (!map.has(currentThread.id))
|
|
1155
|
+
map.set(currentThread.id, currentThread);
|
|
1156
|
+
return map;
|
|
1157
|
+
}, [alone, currentThread]);
|
|
1138
1158
|
// THE LIKENESS, WHERE ONE WAS DRAWN FOR THIS CHARACTER. `cast.tsx` is the one
|
|
1139
1159
|
// table of who looks like what, and it says a name it does not hold "is not a
|
|
1140
1160
|
// problem" — that name wears initials, never another character's face.
|
|
@@ -1352,27 +1372,8 @@ function Thread({ placeholder = message(), initial, anonymous = false, heading,
|
|
|
1352
1372
|
// What pressing a suggestion does, at once: open what it names, send its prompt
|
|
1353
1373
|
// here (the room is a new chat while one shows), hand its run to Dev, or make
|
|
1354
1374
|
// its scheduled task and show it in Scheduled tasks.
|
|
1355
|
-
const hint = (a) => {
|
|
1356
|
-
|
|
1357
|
-
case "open":
|
|
1358
|
-
if (a.item)
|
|
1359
|
-
want(a.item);
|
|
1360
|
-
if (/^https:\/\//.test(a.to))
|
|
1361
|
-
window.open(a.to, "_blank", "noopener,noreferrer");
|
|
1362
|
-
else
|
|
1363
|
-
go(a.to.startsWith("/") ? a.to : app(a.to));
|
|
1364
|
-
return;
|
|
1365
|
-
case "send":
|
|
1366
|
-
submit(a.prompt);
|
|
1367
|
-
return;
|
|
1368
|
-
case "task":
|
|
1369
|
-
hand("task", a.prompt);
|
|
1370
|
-
go(app(""));
|
|
1371
|
-
return;
|
|
1372
|
-
case "schedule":
|
|
1373
|
-
void book(target, a, "chat").then((made) => go(app(devPath({ kind: "automation", id: made.id }))), (e) => setPrepWrong(e instanceof Error && e.message ? e.message : t("The scheduled task could not be made.")));
|
|
1374
|
-
return;
|
|
1375
|
-
}
|
|
1375
|
+
const hint = (a, row) => {
|
|
1376
|
+
handleHint(a, row, { reopen, submit, target, setPrepWrong, t });
|
|
1376
1377
|
};
|
|
1377
1378
|
// A chat a suggestion in Dev left for this room is sent once the room is a new
|
|
1378
1379
|
// chat: the address's own conversation let go of, nothing said yet.
|
|
@@ -1479,7 +1480,13 @@ function Thread({ placeholder = message(), initial, anonymous = false, heading,
|
|
|
1479
1480
|
onLanguage: speakIn,
|
|
1480
1481
|
talk,
|
|
1481
1482
|
// While nothing has been said: what is worth doing next.
|
|
1482
|
-
starters: said.length === 0
|
|
1483
|
+
starters: said.length === 0
|
|
1484
|
+
? forgetful
|
|
1485
|
+
? (_jsxs(XStack, { items: "center", justify: "center", gap: "$2", py: "$2", px: "$3", rounded: "$3", bg: "var(--white-05)", borderWidth: 1, borderColor: "$borderColor", children: [_jsx(Ghost, { size: 14, strokeWidth: 1.75, color: "var(--primary)" }), _jsx(Text, { fontSize: "$2", color: "$soft", children: t("Private chat is active. Messages are temporary and won't be saved.") })] }))
|
|
1486
|
+
: !anonymous
|
|
1487
|
+
? _jsx(Suggestions, { rows: hints.rows, onAct: hint, onDismiss: hints.dismiss })
|
|
1488
|
+
: undefined
|
|
1489
|
+
: undefined,
|
|
1483
1490
|
};
|
|
1484
1491
|
return (_jsxs(YStack, { flex: 1, minH: 0, width: "100%", position: "relative", "data-slot": "chat-room",
|
|
1485
1492
|
// A LINK IN AN ANSWER OPENS IN A TAB beside the conversation when the tab
|
|
@@ -1523,7 +1530,7 @@ function Thread({ placeholder = message(), initial, anonymous = false, heading,
|
|
|
1523
1530
|
}, children: [_jsx(Schedule, { open: plan !== null, onOpenChange: (open) => {
|
|
1524
1531
|
if (!open)
|
|
1525
1532
|
setPlan(null);
|
|
1526
|
-
}, prompt: plan ?? "", model: model, models: models.map((m) => ({ id: m.id, name: nameOf(m.id, listed) })) }), dragging ? (_jsx(YStack, { "aria-hidden": true, position: "absolute", t: 0, r: 0, b: 0, l: 0, z: 10, items: "center", justify: "center", bg: "var(--surface-scrim)", borderWidth: 2, borderStyle: "dashed", borderColor: "$borderColor", rounded: "var(--pane-round)", pointerEvents: "none", children: _jsxs(XStack, { items: "center", gap: "$2", px: "$4", py: "$2.5", rounded: "$10", bg: "$background", borderWidth: 1, borderColor: "$borderColor", children: [_jsx(Paperclip, { size: 15, "aria-hidden": true }), _jsx(Text, { fontSize: "$4", color: "$ink", children: t("Drop files to attach") })] }) })) : null, _jsxs(XStack, { "data-slot": "conversation-head", height: BAND, items: "center", justify: "space-between", gap: "$3", paddingInlineStart: "$4", paddingInlineEnd: "$2", shrink: 0, "data-tauri-drag-region": "deep", onMouseDown: dragWindow, onDoubleClick: toggleWindowMaximize, "$max-md": !mine && !room.length ? { display: 'none' } : undefined, children: [_jsxs(XStack, { items: "center", gap: "$2", minW: 0, flex: 1, children: [mine ? (_jsx(Text, { fontSize: 15, lineHeight: 20, color: "$ink", numberOfLines: 1, shrink: 1, minW: 0, children: tidy(mine.title) })) : null, room.length ? (_jsx(XStack, { role: "list", "aria-label": t("Agents in this chat"), items: "center", gap: "$1.5", minW: 0, overflowX: "auto", "$platform-web": { scrollbarWidth: "none" }, children: room.map((name) => (_jsxs(XStack, { role: "listitem", items: "center", gap: "$1.5", paddingInlineStart: "$1", paddingInlineEnd: "$0.5", py: "$0.5", rounded: 999, borderWidth: 1, borderColor: "$borderColor", shrink: 0, children: [_jsx(Face, { src: faces[name]?.avatar ?? (name === withWhom ? portrait : undefined), emoji: faces[name]?.emoji ?? (name === withWhom ? persona?.emoji : undefined), name: name, size: 22 }), _jsx(Text, { fontSize: "$2", fontWeight: "600", color: "$color", numberOfLines: 1, display: "none", $sm: { display: "flex" }, children: name }), _jsx(Box, { render: "button", onClick: () => openAgent(name), "aria-label": t("Remove {name} from this chat", { name }), title: t("Remove {name}", { name }), width: 24, height: 24, rounded: 999, items: "center", justify: "center", hoverStyle: { bg: "$hover" }, children: _jsx(X, { size: 13, "aria-hidden": true, color: "var(--soft, var(--muted-foreground))" }) })] }, name))) })) : null] }), _jsxs(XStack, { "data-slot": "conversation-controls", "data-tauri-drag-region": "false", items: "center", gap: 4, shrink: 0, children: [free ? (_jsxs(Button, { size: "xs", variant: "outline", "data-slot": "header-upgrade", gap: "$1.5", px: "$2.5", py: "$1", rounded: "$4", cursor: "pointer", hoverStyle: { bg: 'var(--white-10)' }, onPress: () => window.location.assign(payUrl('/cart', { org: org(), returnUrl: window.location.href })), "aria-label": t("Upgrade plan"), children: [_jsx(Sparkles, { size: 13, color: "var(--primary)", "aria-hidden": true }), _jsx(Text, { fontSize: "$1", fontWeight: "600", color: "$ink", children: t("Upgrade plan") })] })) : null, open ? _jsx(Share, { thread: open }) : null,
|
|
1533
|
+
}, prompt: plan ?? "", model: model, models: models.map((m) => ({ id: m.id, name: nameOf(m.id, listed) })) }), dragging ? (_jsx(YStack, { "aria-hidden": true, position: "absolute", t: 0, r: 0, b: 0, l: 0, z: 10, items: "center", justify: "center", bg: "var(--surface-scrim)", borderWidth: 2, borderStyle: "dashed", borderColor: "$borderColor", rounded: "var(--pane-round)", pointerEvents: "none", children: _jsxs(XStack, { items: "center", gap: "$2", px: "$4", py: "$2.5", rounded: "$10", bg: "$background", borderWidth: 1, borderColor: "$borderColor", children: [_jsx(Paperclip, { size: 15, "aria-hidden": true }), _jsx(Text, { fontSize: "$4", color: "$ink", children: t("Drop files to attach") })] }) })) : null, _jsxs(XStack, { "data-slot": "conversation-head", height: BAND, items: "center", justify: "space-between", gap: "$3", paddingInlineStart: "$4", paddingInlineEnd: "$2", shrink: 0, "data-tauri-drag-region": "deep", onMouseDown: dragWindow, onDoubleClick: toggleWindowMaximize, "$max-md": !mine && !room.length ? { display: 'none' } : undefined, children: [_jsxs(XStack, { items: "center", gap: "$2", minW: 0, flex: 1, children: [mine ? (_jsx(Text, { fontSize: 15, lineHeight: 20, color: "$ink", numberOfLines: 1, shrink: 1, minW: 0, children: tidy(mine.title) })) : null, room.length ? (_jsx(XStack, { role: "list", "aria-label": t("Agents in this chat"), items: "center", gap: "$1.5", minW: 0, overflowX: "auto", "$platform-web": { scrollbarWidth: "none" }, children: room.map((name) => (_jsxs(XStack, { role: "listitem", items: "center", gap: "$1.5", paddingInlineStart: "$1", paddingInlineEnd: "$0.5", py: "$0.5", rounded: 999, borderWidth: 1, borderColor: "$borderColor", shrink: 0, children: [_jsx(Face, { src: faces[name]?.avatar ?? (name === withWhom ? portrait : undefined), emoji: faces[name]?.emoji ?? (name === withWhom ? persona?.emoji : undefined), name: name, size: 22 }), _jsx(Text, { fontSize: "$2", fontWeight: "600", color: "$color", numberOfLines: 1, display: "none", $sm: { display: "flex" }, children: name }), _jsx(Box, { render: "button", onClick: () => openAgent(name), "aria-label": t("Remove {name} from this chat", { name }), title: t("Remove {name}", { name }), width: 24, height: 24, rounded: 999, items: "center", justify: "center", hoverStyle: { bg: "$hover" }, children: _jsx(X, { size: 13, "aria-hidden": true, color: "var(--soft, var(--muted-foreground))" }) })] }, name))) })) : null] }), _jsxs(XStack, { "data-slot": "conversation-controls", "data-tauri-drag-region": "false", items: "center", gap: 4, shrink: 0, children: [free ? (_jsxs(Button, { size: "xs", variant: "outline", "data-slot": "header-upgrade", gap: "$1.5", px: "$2.5", py: "$1", rounded: "$4", cursor: "pointer", hoverStyle: { bg: 'var(--white-10)' }, onPress: () => window.location.assign(payUrl('/cart', { org: org(), returnUrl: window.location.href })), "aria-label": t("Upgrade plan"), children: [_jsx(Sparkles, { size: 13, color: "var(--primary)", "aria-hidden": true }), _jsx(Text, { fontSize: "$1", fontWeight: "600", color: "$ink", children: t("Upgrade plan") })] })) : null, open ? _jsx(Share, { thread: open }) : null, said.length > 0 ? (_jsx(ConversationMenu, { threads: currentThreadMap, active: open || currentThread.id, onSchedule: anonymous || forgetful ? undefined : () => setPlan(lastAsked()), children: _jsx(XStack, { children: _jsx(ThreadMore, { t: currentThread }) }) })) : (_jsxs(XStack, { render: "button", "data-slot": "header-private-chat", "aria-label": t("Private chat mode"), "aria-pressed": forgetful, ...{ title: forgetful ? t("Private chat enabled: messages will not be saved") : t("Private chat: forgetful mode") }, items: "center", gap: "$1.5", px: "$2", py: "$1", height: 28, rounded: "$3", cursor: "pointer", borderWidth: 1, borderColor: forgetful ? 'var(--primary)' : '$borderColor', bg: forgetful ? 'var(--primary-10, var(--white-10))' : 'transparent', hoverStyle: { bg: forgetful ? 'var(--primary-15, var(--white-15))' : '$hover' }, onPress: () => setForgetful(!forgetful), children: [_jsx(Ghost, { size: 13, strokeWidth: 1.75, color: forgetful ? 'var(--primary)' : 'var(--soft, var(--muted-foreground))', "aria-hidden": true }), _jsx(Text, { fontSize: "$1", fontWeight: forgetful ? '600' : '500', color: forgetful ? 'var(--primary)' : '$soft', children: t("Private") }), _jsx(Switch, { size: "sm", checked: forgetful, pointerEvents: "none" })] })), _jsx(XStack, { "$max-md": { display: 'none' }, children: _jsx(Summary, { sections: sections, onOpen: () => setPanel(true), label: t("Summary") }) }), _jsx(XStack, { "$max-md": { display: 'none' }, children: _jsx(PanelToggle, { open: panel, onToggle: () => setPanel(!panel) }) })] })] }), wide && aside !== null ? (_jsx(Beside, { children: _jsx(Panel, { side: deck, kinds: NONE, onHide: () => setPanel(false), label: t("Tabs"), ...browsing }) })) : null, !wide && panel ? _jsx(Panel, { side: deck, kinds: NONE, sheet: true, onHide: () => setPanel(false), label: t("Tabs"), ...browsing }) : null, _jsx(ChatSurface, { ...chat, messages: shown, send: guarded,
|
|
1527
1534
|
// THE COMPOSER IS FIXED TO THE FOOT, on a laptop and on a phone, empty or
|
|
1528
1535
|
// not: while nothing has been said the opening (the heading) stands at the
|
|
1529
1536
|
// foot of the height above it; once a turn exists the transcript scrolls
|
package/dist/Meet.js
CHANGED
|
@@ -310,7 +310,7 @@ export function Meet() {
|
|
|
310
310
|
}, children: "Copy Summary" })] })] })) : null] })) : (_jsxs(XStack, { flex: 1, overflow: "hidden", "$max-lg": { flexDirection: 'column', overflowY: 'auto', overflowX: 'hidden' }, children: [_jsxs(YStack, { flex: 1, minW: 0, p: 32, gap: 24, overflowY: "auto", "$max-lg": { p: 16, flexBasis: 'auto', shrink: 0, overflowY: 'visible', overflowX: 'hidden' }, children: [_jsxs(YStack, { gap: 6, children: [_jsx(Text, { fontSize: "$8", fontWeight: "800", color: "$ink", letterSpacing: -0.5, children: "Secure, High-Definition Video Calls" }), _jsxs(Text, { fontSize: "$3", color: "$soft", children: ["Powered by native Hanzo Meet (", _jsx(Text, { render: _jsx("a", { href: "https://meet.hanzo.ai", target: "_blank", rel: "noopener noreferrer" }), color: "$ink", textDecorationLine: "underline", children: "meet.hanzo.ai" }), "). Connect with team members, clients, and autonomous AI agents."] })] }), _jsxs(XStack, { gap: 12, flexWrap: "wrap", children: [_jsxs(Button, { variant: "primary", size: "lg", onClick: startInstantMeeting, children: [_jsx(Plus, { size: 16 }), "Start Instant Meeting"] }), _jsxs(XStack, { items: "center", gap: 6, bg: "$panel", borderWidth: 1, borderColor: "var(--border-control)", rounded: 8, px: 4, height: 42, children: [_jsx(Text, { render: _jsx("input", { type: "text", value: roomInput, onChange: (e) => setRoomInput(e.target.value), onKeyDown: (e) => e.key === 'Enter' && joinCustomMeeting(), placeholder: "Enter meeting code or link", "aria-label": "Meeting code or link" }), bg: "transparent", borderWidth: 0, outlineStyle: "none", color: "$ink", fontSize: "$2", width: 220, px: 8 }), _jsx(Button, { variant: "primary", size: "sm", disabled: !roomInput.trim(), onClick: joinCustomMeeting, children: "Join" })] }), _jsxs(Button, { size: "lg", variant: showAgentPicker ? 'secondary' : 'default', "aria-expanded": showAgentPicker, onClick: () => setShowAgentPicker(!showAgentPicker), children: [_jsx(UserPlus, { size: 14 }), `Invite Agents (${invitedAgents.length})`] })] }), showAgentPicker ? (_jsxs(YStack, { bg: "$panel", borderWidth: 1, borderColor: "var(--border-control)", rounded: 12, p: 16, maxW: 560, children: [_jsxs(XStack, { items: "center", justify: "space-between", mb: 12, children: [_jsx(Text, { fontSize: "$2", fontWeight: "700", color: "$ink", children: "Select AI Agents to Attend Meetings" }), _jsx(Text, { fontSize: "$1", color: "$soft", children: "Each agent joins the call with voice synthesis & pair programming" })] }), _jsx(View, { display: "grid", gridTemplateColumns: "repeat(auto-fill, minmax(220px, 1fr))", gap: 8, children: AVAILABLE_MEETING_AGENTS.map((agent) => {
|
|
311
311
|
const isInvited = invitedAgents.includes(agent.name);
|
|
312
312
|
return (_jsxs(XStack, { onClick: () => toggleAgentInvite(agent.name), items: "center", gap: 10, px: 10, py: 8, rounded: 8, bg: isInvited ? '$raised' : '$hover', borderWidth: 1, borderColor: isInvited ? 'var(--border-selected)' : '$borderColor', cursor: "pointer", transition: "quickest", children: [_jsx(Face, { name: agent.name, size: 32 }), _jsxs(YStack, { flex: 1, minW: 0, children: [_jsx(Text, { fontSize: "$2", fontWeight: "600", color: "$ink", children: agent.name }), _jsxs(Text, { fontSize: 10, color: "$faint", numberOfLines: 1, children: [agent.role, " \u00B7 Voice: ", agent.voice] })] }), _jsx(View, { width: 16, height: 16, rounded: 4, borderWidth: isInvited ? 0 : 1, borderColor: "var(--border-selected)", bg: isInvited ? 'var(--foreground)' : 'transparent', items: "center", justify: "center", children: isInvited ? _jsx(Check, { size: 11, strokeWidth: 3, color: "var(--background)" }) : null })] }, agent.id));
|
|
313
|
-
}) })] })) : null, _jsxs(YStack, { bg: "$panel", borderWidth: 1, borderColor: "$borderColor", rounded: 12, overflow: "hidden", maxW: 560, children: [_jsxs(XStack, { height: 280, bg: "$sunken", position: "relative", items: "center", justify: "center", children: [cameraOn ? (_jsx(View, { render: _jsx("video", { ref: videoRef, autoPlay: true, playsInline: true, muted: true }), width: "100%", height: "100%", objectFit: "cover" })) : (_jsxs(YStack, { items: "center", gap: 8, children: [_jsx(XStack, { width: 64, height: 64, rounded: 9999, bg: "$raised", items: "center", justify: "center", children: _jsx(VideoOff, { size: 28, color: "var(--muted-foreground)" }) }), _jsx(Text, { fontSize: "$2", color: "$soft", children: "Camera is off" })] })), _jsxs(XStack, { position: "absolute", b: 16, maxW: "calc(100% - 24px)", items: "center", justify: "center", flexWrap: "wrap", gap: 8, bg: "var(--surface-overlay)", backdropFilter: "blur(8px)", px: 12, py: 6, rounded: 24, borderWidth: 1, borderColor: "$borderColor", children: [_jsx(Button, { size: "icon", rounded: 9999, variant: cameraOn ? 'default' : 'destructive', "aria-label": cameraOn ? 'Turn Camera Off' : 'Turn Camera On', title: cameraOn ? 'Turn Camera Off' : 'Turn Camera On', onClick: () => setCameraOn(!cameraOn), children: cameraOn ? _jsx(Video, { size: 16 }) : _jsx(VideoOff, { size: 16 }) }), _jsx(Button, { size: "icon", rounded: 9999, variant: micOn ? 'default' : 'destructive', "aria-label": micOn ? 'Mute Mic' : 'Unmute Mic', title: micOn ? 'Mute Mic' : 'Unmute Mic', onClick: () => setMicOn(!micOn), children: micOn ? _jsx(Mic, { size:
|
|
313
|
+
}) })] })) : null, _jsxs(YStack, { bg: "$panel", borderWidth: 1, borderColor: "$borderColor", rounded: 12, overflow: "hidden", maxW: 560, children: [_jsxs(XStack, { height: 280, bg: "$sunken", position: "relative", items: "center", justify: "center", children: [cameraOn ? (_jsx(View, { render: _jsx("video", { ref: videoRef, autoPlay: true, playsInline: true, muted: true }), width: "100%", height: "100%", objectFit: "cover" })) : (_jsxs(YStack, { items: "center", gap: 8, children: [_jsx(XStack, { width: 64, height: 64, rounded: 9999, bg: "$raised", items: "center", justify: "center", children: _jsx(VideoOff, { size: 28, color: "var(--muted-foreground)" }) }), _jsx(Text, { fontSize: "$2", color: "$soft", children: "Camera is off" })] })), _jsxs(XStack, { position: "absolute", b: 16, maxW: "calc(100% - 24px)", items: "center", justify: "center", flexWrap: "wrap", gap: 8, bg: "var(--surface-overlay)", backdropFilter: "blur(8px)", px: 12, py: 6, rounded: 24, borderWidth: 1, borderColor: "$borderColor", children: [_jsx(Button, { size: "icon", rounded: 9999, variant: cameraOn ? 'default' : 'destructive', "aria-label": cameraOn ? 'Turn Camera Off' : 'Turn Camera On', title: cameraOn ? 'Turn Camera Off' : 'Turn Camera On', onClick: () => setCameraOn(!cameraOn), children: cameraOn ? _jsx(Video, { size: 16 }) : _jsx(VideoOff, { size: 16 }) }), _jsx(Button, { size: "icon", rounded: 9999, variant: micOn ? 'default' : 'destructive', "aria-label": micOn ? 'Mute Mic' : 'Unmute Mic', title: micOn ? 'Mute Mic' : 'Unmute Mic', onClick: () => setMicOn(!micOn), children: micOn ? _jsx(Mic, { size: 14, strokeWidth: 1.75 }) : _jsx(MicOff, { size: 14, strokeWidth: 1.75 }) }), _jsx(Button, { size: "sm", rounded: 9999, variant: audioTesting ? 'secondary' : 'default', title: "Test Agent Voice & Audio Output", onClick: testAudioSpeaker, children: audioTesting ? (_jsxs(_Fragment, { children: [_jsx(AudioWave, { active: true, color: "var(--state-success)" }), "Testing Audio\u2026"] })) : (_jsxs(_Fragment, { children: [_jsx(Volume2, { size: 12, strokeWidth: 1.75 }), "Test Audio"] })) }), _jsxs(Button, { size: "sm", rounded: 9999, variant: botAssisting ? 'secondary' : 'default', "aria-pressed": botAssisting, onClick: () => setBotAssisting(!botAssisting), children: [_jsx(Bot, { size: 13 }), botAssisting ? 'AI Bot Co-pilot ON' : 'AI Bot OFF'] })] })] }), _jsxs(XStack, { p: 12, items: "center", justify: "space-between", bg: "$panel", children: [_jsxs(Text, { fontSize: "$1", color: "$soft", children: ["Readiness: Camera ", cameraOn ? 'Active' : 'Muted', " \u00B7 Mic ", micOn ? 'Active' : 'Muted', " \u00B7 Audio ", audioTesting ? 'Testing' : 'Ready'] }), _jsx(Text, { fontSize: "$1", color: "$quiet", fontWeight: "600", children: "HD 1080p Ready" })] })] })] }), _jsxs(YStack, { grow: 1, shrink: 1, flexBasis: 380, minW: 0, maxW: "100%", bg: "$panel", borderLeftWidth: 1, borderLeftColor: "$borderColor", p: 16, gap: 14, overflowY: "auto", "$max-lg": {
|
|
314
314
|
shrink: 0,
|
|
315
315
|
flexBasis: 'auto',
|
|
316
316
|
borderLeftWidth: 0,
|
package/dist/Top.js
CHANGED
|
@@ -25,31 +25,31 @@ import { ToggleGroup, ToggleGroupItem } from '@hanzo/ui';
|
|
|
25
25
|
import { BAND, pane } from './ground.js';
|
|
26
26
|
import { empty } from './open.js';
|
|
27
27
|
import { talk } from './lib/host.js';
|
|
28
|
-
/** A button, px:
|
|
29
|
-
const ROUND =
|
|
28
|
+
/** A button, px: compact and refined. */
|
|
29
|
+
const ROUND = 34;
|
|
30
30
|
/** The bar's line under the device's top inset, px: the pill's height. */
|
|
31
|
-
const LINE =
|
|
32
|
-
/** A segment, px:
|
|
33
|
-
const SEGMENT =
|
|
31
|
+
const LINE = 34;
|
|
32
|
+
/** A segment, px: compact switcher button. */
|
|
33
|
+
const SEGMENT = 56;
|
|
34
34
|
/** The glass the three are cut from. */
|
|
35
35
|
const GLASS = {
|
|
36
36
|
...pane(),
|
|
37
37
|
borderColor: 'var(--border-strong)',
|
|
38
38
|
borderRadius: 9999,
|
|
39
|
-
boxShadow: '
|
|
39
|
+
boxShadow: 'var(--shadow-sheet-1)',
|
|
40
40
|
backdropFilter: 'blur(24px) saturate(190%) contrast(102%)',
|
|
41
41
|
};
|
|
42
42
|
/** A round glass button named for what it does (`label`, already in the reader's language). */
|
|
43
43
|
function Round({ label, onPress, opacity, pointerEvents, children, ...rest }) {
|
|
44
44
|
return (_jsx(XStack, { render: "button", "aria-label": label, onPress: onPress, ...GLASS, width: ROUND, height: ROUND, items: "center", justify: "center", shrink: 0, cursor: "pointer", opacity: opacity, pointerEvents: pointerEvents, pressStyle: { bg: '$raised', scale: 0.96 }, focusVisibleStyle: { outlineWidth: 2, outlineStyle: 'solid', outlineColor: '$outlineColor' }, ...rest, children: children }));
|
|
45
45
|
}
|
|
46
|
-
/** The drawer's mark: two strokes, the lower one shorter and flush with the start,
|
|
46
|
+
/** The drawer's mark: two strokes, the lower one shorter and flush with the start, 15×9. */
|
|
47
47
|
function Lines() {
|
|
48
|
-
return (_jsx("svg", { width:
|
|
48
|
+
return (_jsx("svg", { width: 15, height: 9, viewBox: "0 0 19 11", fill: "none", stroke: "currentColor", strokeWidth: 2, strokeLinecap: "round", "aria-hidden": true, "data-i18n-mirror": true, children: _jsx("path", { d: "M1 1h17M1 10h10.7" }) }));
|
|
49
49
|
}
|
|
50
50
|
/** One side of the pill. */
|
|
51
51
|
function Side({ value, children }) {
|
|
52
|
-
return (_jsx(ToggleGroupItem, { value: value, size: "
|
|
52
|
+
return (_jsx(ToggleGroupItem, { value: value, size: "sm", width: SEGMENT, height: 26, rounded: 9999, bg: "transparent", borderColor: "transparent", hoverStyle: { bg: '$hover' }, activeStyle: { bg: '$raised', borderColor: 'transparent' }, children: _jsx(Text, { fontSize: "$2", fontWeight: "600", color: "$ink", numberOfLines: 1, children: children }) }));
|
|
53
53
|
}
|
|
54
54
|
export function Top({ host, mode, places, open = false, go, onMenu, onChat, onDev, }) {
|
|
55
55
|
const { t } = useI18n();
|
|
@@ -63,5 +63,5 @@ export function Top({ host, mode, places, open = false, go, onMenu, onChat, onDe
|
|
|
63
63
|
},
|
|
64
64
|
}
|
|
65
65
|
: { label: made?.label ?? t('New'), onPress: made?.onPress };
|
|
66
|
-
return (_jsxs(XStack, { "data-slot": "app-bar", height: `calc(${BAND}px + var(--safe-top) + var(--pane-gap))`, pt: "calc(var(--safe-top) + var(--pane-gap))", px: "$4.5", items: "center", justify: "space-between", shrink: 0, $md: { display: 'none' }, children: [_jsx(Round, { label: t('Open sidebar'), "data-slot": "bar-menu", onPress: onMenu, pointerEvents: open ? 'none' : 'auto', children: _jsx(Lines, {}) }), _jsx(XStack, { "data-slot": "bar-mode", ...GLASS, height: LINE, p: "$1", items: "center", children: _jsxs(ToggleGroup, { type: "single", "aria-label": t('App'), value: mode === 'chat' || mode === 'dev' ? mode : '', disableDeactivation: true, onValueChange: (v) => (v === 'chat' ? onChat() : v === 'dev' ? onDev() : undefined), children: [_jsx(Side, { value: "chat", children: t('Chat') }), _jsx(Side, { value: "dev", children: "Dev" })] }) }), fresh.onPress ? (_jsx(Round, { label: fresh.label, "data-slot": "bar-new", onPress: fresh.onPress, children: _jsx(SquarePen, { size:
|
|
66
|
+
return (_jsxs(XStack, { "data-slot": "app-bar", height: `calc(${BAND}px + var(--safe-top) + var(--pane-gap))`, pt: "calc(var(--safe-top) + var(--pane-gap))", px: "$4.5", items: "center", justify: "space-between", shrink: 0, $md: { display: 'none' }, children: [_jsx(Round, { label: t('Open sidebar'), "data-slot": "bar-menu", onPress: onMenu, pointerEvents: open ? 'none' : 'auto', children: _jsx(Lines, {}) }), _jsx(XStack, { "data-slot": "bar-mode", ...GLASS, height: LINE, p: "$1", items: "center", children: _jsxs(ToggleGroup, { type: "single", "aria-label": t('App'), value: mode === 'chat' || mode === 'dev' ? mode : '', disableDeactivation: true, onValueChange: (v) => (v === 'chat' ? onChat() : v === 'dev' ? onDev() : undefined), children: [_jsx(Side, { value: "chat", children: t('Chat') }), _jsx(Side, { value: "dev", children: "Dev" })] }) }), fresh.onPress ? (_jsx(Round, { label: fresh.label, "data-slot": "bar-new", onPress: fresh.onPress, children: _jsx(SquarePen, { size: 16, strokeWidth: 1.75, "aria-hidden": true }) })) : (_jsx(XStack, { width: ROUND, height: ROUND, "aria-hidden": true }))] }));
|
|
67
67
|
}
|
package/dist/hint.d.ts
ADDED
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import type { Act, Hint } from '@hanzo/build';
|
|
2
|
+
export interface HintActions {
|
|
3
|
+
reopen: (threadId: string) => void;
|
|
4
|
+
submit: (query: string) => void;
|
|
5
|
+
target?: unknown;
|
|
6
|
+
setPrepWrong?: (err: string | null) => void;
|
|
7
|
+
t?: (s: string) => string;
|
|
8
|
+
}
|
|
9
|
+
/**
|
|
10
|
+
* Executes a suggestion action:
|
|
11
|
+
* - open: if it points to a chat thread (/chat/<id>), reopens that thread immediately and updates history;
|
|
12
|
+
* if external, opens in a new tab;
|
|
13
|
+
* if another app route, navigates via go;
|
|
14
|
+
* fallback: submits row title as query.
|
|
15
|
+
* - send / task: submits prompt or title directly into the chat room.
|
|
16
|
+
* - schedule: books automation or falls back to submitting the prompt.
|
|
17
|
+
*/
|
|
18
|
+
export declare function handleHint(a: Act, row: Hint | undefined, actions: HintActions): void;
|
package/dist/hint.js
ADDED
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
import { book, hand, want, path as devPath } from '@hanzo/build';
|
|
2
|
+
import { app, go } from './lib/host.js';
|
|
3
|
+
/**
|
|
4
|
+
* Executes a suggestion action:
|
|
5
|
+
* - open: if it points to a chat thread (/chat/<id>), reopens that thread immediately and updates history;
|
|
6
|
+
* if external, opens in a new tab;
|
|
7
|
+
* if another app route, navigates via go;
|
|
8
|
+
* fallback: submits row title as query.
|
|
9
|
+
* - send / task: submits prompt or title directly into the chat room.
|
|
10
|
+
* - schedule: books automation or falls back to submitting the prompt.
|
|
11
|
+
*/
|
|
12
|
+
export function handleHint(a, row, actions) {
|
|
13
|
+
const { reopen, submit, target, setPrepWrong, t = (s) => s } = actions;
|
|
14
|
+
switch (a.kind) {
|
|
15
|
+
case 'open': {
|
|
16
|
+
const chatMatch = a.to.match(/\/chat\/([^?#/]+)/);
|
|
17
|
+
if (chatMatch && chatMatch[1]) {
|
|
18
|
+
const threadId = decodeURIComponent(chatMatch[1]);
|
|
19
|
+
reopen(threadId);
|
|
20
|
+
go(a.to);
|
|
21
|
+
return;
|
|
22
|
+
}
|
|
23
|
+
if (a.item)
|
|
24
|
+
want(a.item);
|
|
25
|
+
if (/^https:\/\//.test(a.to)) {
|
|
26
|
+
if (typeof window !== 'undefined')
|
|
27
|
+
window.open(a.to, '_blank', 'noopener,noreferrer');
|
|
28
|
+
return;
|
|
29
|
+
}
|
|
30
|
+
if (a.to && a.to !== '/chat') {
|
|
31
|
+
go(a.to.startsWith('/') ? a.to : app(a.to));
|
|
32
|
+
return;
|
|
33
|
+
}
|
|
34
|
+
const query = row?.title;
|
|
35
|
+
if (query) {
|
|
36
|
+
submit(query);
|
|
37
|
+
return;
|
|
38
|
+
}
|
|
39
|
+
return;
|
|
40
|
+
}
|
|
41
|
+
case 'send': {
|
|
42
|
+
const query = a.prompt || row?.title || '';
|
|
43
|
+
if (query)
|
|
44
|
+
submit(query);
|
|
45
|
+
return;
|
|
46
|
+
}
|
|
47
|
+
case 'task': {
|
|
48
|
+
const query = a.prompt || row?.title || '';
|
|
49
|
+
if (query) {
|
|
50
|
+
submit(query);
|
|
51
|
+
}
|
|
52
|
+
else {
|
|
53
|
+
hand('task', '');
|
|
54
|
+
go(app(''));
|
|
55
|
+
}
|
|
56
|
+
return;
|
|
57
|
+
}
|
|
58
|
+
case 'schedule': {
|
|
59
|
+
if (target) {
|
|
60
|
+
void book(target, a, 'chat').then((made) => go(app(devPath({ kind: 'automation', id: made.id }))), (e) => {
|
|
61
|
+
if (a.prompt)
|
|
62
|
+
submit(a.prompt);
|
|
63
|
+
else if (setPrepWrong)
|
|
64
|
+
setPrepWrong(e instanceof Error && e.message ? e.message : t('The scheduled task could not be made.'));
|
|
65
|
+
});
|
|
66
|
+
}
|
|
67
|
+
else if (a.prompt) {
|
|
68
|
+
submit(a.prompt);
|
|
69
|
+
}
|
|
70
|
+
return;
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
if (row?.title) {
|
|
74
|
+
submit(row.title);
|
|
75
|
+
}
|
|
76
|
+
}
|
package/dist/lib/host.js
CHANGED
|
@@ -194,6 +194,11 @@ export function go(address, replace = false) {
|
|
|
194
194
|
window.history.replaceState(null, '', address);
|
|
195
195
|
else
|
|
196
196
|
window.history.pushState(null, '', address);
|
|
197
|
+
if (typeof window !== 'undefined' && typeof window.dispatchEvent === 'function') {
|
|
198
|
+
const ev = typeof PopStateEvent !== 'undefined' ? new PopStateEvent('popstate') : typeof Event !== 'undefined' ? new Event('popstate') : null;
|
|
199
|
+
if (ev)
|
|
200
|
+
window.dispatchEvent(ev);
|
|
201
|
+
}
|
|
197
202
|
}
|
|
198
203
|
/**
|
|
199
204
|
* Move to an address of this site: one of the app's (`place`) by `go`, which
|
package/dist/speech.js
CHANGED
|
@@ -221,5 +221,5 @@ export function SpeakButton({ text, agentName, compact = false, }) {
|
|
|
221
221
|
// speaks. The word for speaking is the one status here, so it alone takes
|
|
222
222
|
// the success ink (GOOD holds 4.5:1 on either theme); the icons follow the
|
|
223
223
|
// label through currentColor.
|
|
224
|
-
return (_jsx(Button, { variant: speaking ? 'secondary' : 'ghost', size: compact ? 'icon-sm' : 'sm', color: speaking ? GOOD : '$soft', onClick: () => toggle(text, agentName), "aria-label": (speaking ? t('Stop speaking') : listen) + stood, "aria-pressed": speaking, "data-refusal": refusal ? refusal.service : undefined, title: (speaking ? t('Stop speaking') : listenIn) + stood, children: speaking ? (_jsxs(_Fragment, { children: [_jsx(AudioWave, { active: true, color: GOOD }), !compact && t('Speaking…'), _jsx(Square, { size:
|
|
224
|
+
return (_jsx(Button, { variant: speaking ? 'secondary' : 'ghost', size: compact ? 'icon-sm' : 'sm', color: speaking ? GOOD : '$soft', onClick: () => toggle(text, agentName), "aria-label": (speaking ? t('Stop speaking') : listen) + stood, "aria-pressed": speaking, "data-refusal": refusal ? refusal.service : undefined, title: (speaking ? t('Stop speaking') : listenIn) + stood, children: speaking ? (_jsxs(_Fragment, { children: [_jsx(AudioWave, { active: true, color: GOOD }), !compact && t('Speaking…'), _jsx(Square, { size: 9, fill: "currentColor" })] })) : (_jsxs(_Fragment, { children: [_jsx(Volume2, { size: 12, strokeWidth: 1.75 }), !compact && t('Listen')] })) }));
|
|
225
225
|
}
|
package/dist/thread.d.ts
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@hanzo/app",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.45",
|
|
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",
|