@hanzo/app 0.3.72 → 0.3.74

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 CHANGED
@@ -79,6 +79,8 @@ import { brand } from './where.js';
79
79
  import { BAND, HEAD, inPane, INSET, TOUCH_HEAD } from './ground.js';
80
80
  import { shared, useChatPreferences } from './lib/chatPreferences.js';
81
81
  import { handleHint } from './hint.js';
82
+ import { ProviderMark } from './ProviderMark.js';
83
+ import { ToBottom } from './ToBottom.js';
82
84
  // NO REASONING PANEL HERE. Every assistant turn opened a "Thinking" disclosure
83
85
  // listing seven steps — "Planning CSS extraction for chat styles", "Designing
84
86
  // responsive top bar grid layout" — typed into this file as a literal array.
@@ -106,22 +108,8 @@ import { handleHint } from './hint.js';
106
108
  * since.
107
109
  */
108
110
  const MAX_ANON_TURNS = 3;
109
- function synthesizeAnonReply(prompt) {
110
- const q = prompt.trim();
111
- const lower = q.toLowerCase();
112
- if (lower.includes("beta") || lower.includes("join") || lower.includes("access") || lower.includes("waitlist")) {
113
- return `You can join and explore **Hanzo Beta** right now:\n\n1. **Sign in or create a free account** at [hanzo.ai/signup](/signup) for instant access to open betas.\n2. **Open the Betas portal** at [hanzo.ai/beta](/beta) (or from the left rail once signed in) to apply for early access to **Hanzo Studio**, **Design**, **Flow**, and **Operative** computer-use agents.\n3. **Upgrade anytime** to **Go**, **Pro**, **Dev**, **Max**, or **Ultra** for priority beta access.`;
114
- }
115
- if (lower.includes("majorana") || lower.includes("quantum") || lower.includes("qubit") || lower.includes("decoherence")) {
116
- return `**Majorana zero modes (MZMs)** protect quantum information topologically rather than locally:\n\n1. **Non-Local Fermionic Parity**: Two spatially separated Majorana quasiparticles $\\gamma_1$ and $\\gamma_2$ form a single Dirac fermion operator $c = (\\gamma_1 + i\\gamma_2)/2$. Because the occupation state $|0\\rangle$ or $|1\\rangle$ is delocalized across the wire ends, local electromagnetic noise cannot flip the parity.\n2. **Non-Abelian Braiding**: Quantum gates are executed by braiding vortices in 2D $p+ip$ superconductors, producing unitary matrices determined by knot topology.\n3. **Exponential Suppression**: Residual energy splitting scales as $\\exp(-L/\\xi)$, where $L$ is wire separation and $\\xi$ is superconducting coherence length.`;
117
- }
118
- if (lower.includes("code") || lower.includes("build") || lower.includes("middleware") || lower.includes("jwt") || lower.includes("typescript") || lower.includes("python")) {
119
- return `Here is a production TypeScript middleware:\n\n\`\`\`ts\nexport async function guard(req: Request): Promise<Response | null> {\n const token = req.headers.get('authorization')?.replace(/^Bearer\\s+/i, '')\n if (!token) return Response.json({ error: 'unauthorized' }, { status: 401 })\n const claims = await verifyJwt(token)\n const allowed = await rateLimit(\`org:\${claims.org}\`, { rpm: 600 })\n if (!allowed) return Response.json({ error: 'rate_limited' }, { status: 429 })\n return null\n}\n\`\`\`\n\nRun \`hanzo dev\` in your repository or sign in to execute and deploy this in a cloud sandbox.`;
120
- }
121
- return q.length <= 8 || /^(hi|hello|hey|yo|sup|test|asdf|qwerty|ping)\b/i.test(q)
122
- ? `Hey! How can I help you today? Feel free to ask a question, write or debug code, analyze a system architecture, or explore a topic.`
123
- : `Here are the key points on **${q.slice(0, 96)}**:\n\n1. **Core Mechanism & Architecture**: Break the problem into clear, composable layers with well-defined interfaces, explicit state transitions, and deterministic validation.\n2. **Implementation Strategy**: Start with a minimal, testable baseline and benchmark latency, throughput, and correctness under realistic workloads.\n3. **Next Steps**: Tell me if you want to dive into the implementation code, mathematical formulation, or system architecture and I will write it out in full.`;
124
- }
111
+ /** What an anonymous send says when the API gave no answer. */
112
+ const NO_ANSWER = phrase("No answer came back. Sign in to keep going.");
125
113
  function readOpeningQuery() {
126
114
  if (typeof window === "undefined")
127
115
  return { text: "", thread: null };
@@ -588,7 +576,7 @@ function Thread({ placeholder = message(), initial, anonymous = false, settled =
588
576
  // eslint-disable-next-line react-hooks/exhaustive-deps
589
577
  }, [chatPrefs.approvalMode, anonymous]);
590
578
  const agentShelf = useAgentShelf();
591
- // The opening greets the person by the first word of their display name, capitalised ("What’s up, Z?").
579
+ // The opening greets the person by the first word of their display name, capitalised ("Good to see you, Z. What’s next?").
592
580
  // A username is a handle, not a name: without a display name the greeting has none.
593
581
  const firstName = useMemo(() => (anonymous ? "" : given(named()?.display ?? "")), [anonymous]);
594
582
  // Private / forgetful mode: an ephemeral conversation kept in memory only, never saved to server history.
@@ -610,6 +598,8 @@ function Thread({ placeholder = message(), initial, anonymous = false, settled =
610
598
  // kept per conversation with its tabs, so a chat opens as it was left and
611
599
  // never as the last chat was. The header's Panel button and ⌘. move it.
612
600
  const media = useMedia();
601
+ const [talkBox, setTalkBox] = useState(null);
602
+ const talkRef = useCallback((el) => setTalkBox(el instanceof HTMLElement ? el : null), []);
613
603
  const wide = media.lg;
614
604
  const [panel, setPanel] = usePanel(`chat:${at}`, false, wide);
615
605
  const deck = useDeck(`chat:${at}`, SEED);
@@ -1078,7 +1068,11 @@ function Thread({ placeholder = message(), initial, anonymous = false, settled =
1078
1068
  }
1079
1069
  catch { }
1080
1070
  if (!replyText) {
1081
- replyText = synthesizeAnonReply(clean);
1071
+ // No answer came back: say so and ask for a sign-in, never a made-up reply.
1072
+ apply.current((held) => held.map((m) => (m.id === aId ? { ...m, content: NO_ANSWER } : m)));
1073
+ setAnonBusy(false);
1074
+ setAnonGateOpen(true);
1075
+ return;
1082
1076
  }
1083
1077
  const wordsList = replyText.split(" ");
1084
1078
  let idx = 0;
@@ -2020,81 +2014,83 @@ function Thread({ placeholder = message(), initial, anonymous = false, settled =
2020
2014
  }, children: t("Sign up for free") }) }), _jsx(XStack, { display: "flex", $sm: { display: "none" }, children: _jsx(Button, { size: "xs", rounded: 9999, px: "$3", "data-slot": "header-signup-compact", onPress: () => {
2021
2015
  if (typeof window !== "undefined")
2022
2016
  window.location.assign("/signup?next=%2Fchat");
2023
- }, children: t("Sign up") }) })] })) : free && (sidebarClosed || !media.md) ? (_jsxs(XStack, { render: "button", "data-slot": "header-upgrade", "aria-label": t("Upgrade plan"), items: "center", gap: "$1.5", px: "$2", py: "$1", rounded: "$3", bg: "transparent", cursor: "pointer", hoverStyle: { bg: "$hover" }, onPress: () => window.location.assign(payUrl('/cart', { org: org(), returnUrl: window.location.href })), children: [_jsx(Sparkles, { size: 14, color: "var(--muted-foreground)", "aria-hidden": true }), _jsx(Text, { fontSize: 15, lineHeight: 20, fontWeight: "500", color: "$soft", numberOfLines: 1, children: t("Upgrade plan") })] })) : null, said.length > 0 ? (_jsx(ConversationMenu, { threads: currentThreadMap, active: open || currentThread.id, onSchedule: anonymous || forgetful ? undefined : () => setPlan(lastAsked()), children: _jsx(XStack, {}) })) : (_jsxs(Tooltip, { children: [_jsx(TooltipTrigger, { asChild: true, children: _jsx(XStack, { render: "button", "data-slot": "header-private-chat", "aria-label": t("Private chat"), "aria-pressed": forgetful, width: 32, height: 32, items: "center", justify: "center", rounded: "$3", bg: "transparent", cursor: "pointer", hoverStyle: { bg: "$hover" }, focusVisibleStyle: { outlineWidth: 2, outlineStyle: "solid", outlineColor: "var(--ring)" }, onPress: () => setForgetful(!forgetful), children: _jsx(Ghost, { size: 16, strokeWidth: 1.75, color: forgetful ? "var(--foreground)" : "var(--muted-foreground)", fill: forgetful ? "currentColor" : "none", "aria-hidden": true }) }) }), _jsx(TooltipContent, { children: forgetful ? t("Private chat is on: this conversation is not saved") : t("Private chat") })] })), open ? _jsx(Share, { thread: open }) : null, _jsx(XStack, { "$max-md": { display: 'none' }, children: _jsx(Summary, { sections: sections, onOpen: () => setPanel(true), label: t("Summary") }) }), inTopChrome ? null : (_jsx(XStack, { "$max-md": { display: 'none' }, children: _jsx(PanelToggle, { open: panel, onToggle: () => setPanel(!panel) }) }))] })] })), wide && aside !== null ? (_jsx(Side, { 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(XStack, { flex: 1, minH: 0, minW: 0, children: _jsx(YStack, { "data-slot": "talk", flex: 1, minH: 0, minW: 0, children: _jsx(ChatSurface, { ...chat, messages: shown, send: guarded,
2024
- // WHILE NOTHING HAS BEEN SAID, from a tablet up, the opening and the
2025
- // composer are one pair centred in the pane (`center`: rows `1fr auto auto
2026
- // 1fr`), so the heading reads close above the field and nothing stands at
2027
- // the window's foot (owner, 2026-10-30). A phone keeps the composer at the
2028
- // foot, over the keyboard, from the first moment; once a turn exists every
2029
- // width does, and the transcript scrolls under it.
2030
- center: media.md,
2031
- // AS IT WAS WRITTEN. The package renders a turn's words plainly and
2032
- // says so — it ships no markdown pipeline because the plugin set is the
2033
- // surface's to choose — so an answer arrived here reading "```ts" with
2034
- // the backticks on screen. `Prose` is the site's one renderer, reading
2035
- // with the same `marked` the legal pages parse with and drawing every
2036
- // token in gui elements, and the shared view draws through it too.
2037
- body: (turn) => {
2038
- if (String(turn.id).startsWith(`${FAILED}:`)) {
2039
- const question = shown.find((one) => one.id === String(turn.id).slice(FAILED.length + 1));
2040
- return question ? failure(question) : null;
2041
- }
2042
- // A QUESTION THAT CARRIED PICTURES draws them beside its words.
2043
- if (turn.role === "user" && Array.isArray(turn.content)) {
2044
- const parts = partsOf(turn.content);
2045
- return (_jsx(YStack, { gap: "$1", children: _jsx(Parts, { parts: parts, prose: (text) => _jsx(Prose, { text: text }) }) }));
2046
- }
2047
- const said = typeof turn.content === "string" ? turn.content : "";
2048
- // A QUESTION THAT CARRIED FILES draws its words and the files' chips;
2049
- // the passages it handed the model are the model's to read, not ours.
2050
- if (turn.role === "user" && said) {
2051
- const read = told(said);
2052
- if (read.carried)
2053
- return (_jsx(YStack, { gap: "$1", children: _jsx(Carried, { text: read.text, attached: read.carried.attached, reused: read.carried.reused, onOpen: openFile, onSave: anonymous ? undefined : (url, id, f) => keepOne(url, id, f.name, f.type) }) }));
2054
- }
2055
- // WHILE THE ANSWER HAS NO WORDS YET: who is answering (the agents the
2056
- // question addresses, or the whole cast when it names nobody), and the
2057
- // model's reasoning as it streams (`reasoning` on the turn), dimmed and
2058
- // cut to its last lines.
2059
- const thought = turn.role === "assistant" && !said && chat.streaming ? (turn.reasoning ?? "").trim() : "";
2060
- if (turn.role === "assistant" && !said && chat.streaming && (cast.length || thought)) {
2061
- const q = [...shown].reverse().find((one) => one.role === "user");
2062
- const whom = cast.length ? addressed(words(q?.content), cast) : [];
2063
- return (_jsxs(YStack, { gap: "$1", "data-slot": "thinking", children: [_jsx(Text, { fontSize: "$2", color: "$soft", children: whom.length
2064
- ? whom.length > 1
2065
- ? thought
2066
- ? t("{names} are thinking…", { names: join(whom, t) })
2067
- : t("{names} are answering…", { names: join(whom, t) })
2068
- : thought
2069
- ? t("{names} is thinking…", { names: join(whom, t) })
2070
- : t("{names} is answering…", { names: join(whom, t) })
2071
- : t("Thinking…") }), thought ? (_jsx(Text, { fontSize: "$2", color: "$soft", opacity: 0.72, "data-slot": "thought", children: thought.length > THOUGHT ? `…${thought.slice(-THOUGHT).replace(/^\S*\s/, "")}` : thought })) : null] }));
2072
- }
2073
- // A CAST'S ANSWER IS SEVERAL PEOPLE'S. Each opens a line with their
2074
- // name, as the brief asks, so each is drawn under their own face and
2075
- // read in their own voice. A reply that names nobody is drawn whole.
2076
- const parts = turn.role === "assistant" ? speakers(said, known) : null;
2077
- if (parts && parts.some((part) => part.who)) {
2078
- // Asked and silent: an agent the question addressed who has no part
2079
- // in this reply.
2080
- const at = shown.findIndex((one) => one.id === turn.id);
2081
- const q = shown.slice(0, at).reverse().find((one) => one.role === "user");
2082
- const silent = cast.length > 1 && !(chat.streaming && at === shown.length - 1)
2083
- ? addressed(words(q?.content), cast).filter((name) => !parts.some((part) => part.who?.toLowerCase() === name.toLowerCase()))
2084
- : [];
2085
- return (_jsxs(YStack, { gap: "$3", "data-turn-id": String(turn.id), "data-turn-role": turn.role, children: [parts.map((part, i) => (_jsxs(YStack, { gap: "$1", children: [part.who ? (_jsxs(XStack, { items: "center", gap: "$2", children: [_jsx(Face, { src: faces[part.who]?.avatar, emoji: faces[part.who]?.emoji, name: part.who, size: 20 }), _jsx(Text, { fontSize: "$2", fontWeight: "600", color: "$ink", children: part.who })] })) : null, _jsx(Prose, { text: part.text }), part.text ? (_jsx(Reply, { text: part.text, title: shownTitle, listen: listen(part.who ?? withWhom ?? undefined), onOpen: opener(part.text), onRedo: (act) => redoTurn(turn.id, act), onBranch: () => branchTurn(turn.id) })) : null] }, i))), silent.length ? (_jsx(Text, { fontSize: "$2", color: "$soft", children: t("No answer from {names} in this reply.", { names: join(silent, t) }) })) : null, byline(turn.id)] }));
2086
- }
2087
- return (_jsxs(YStack, { gap: "$1.5", "data-turn-id": String(turn.id), "data-turn-role": turn.role, children: [_jsx(Prose, { text: said }), turn.role === "assistant" && said ? (_jsx(Reply, { text: said, title: shownTitle, listen: listen(withWhom ?? undefined), onOpen: opener(said), onRedo: (act) => redoTurn(turn.id, act), onBranch: () => branchTurn(turn.id) })) : null, turn.role === "assistant" && said ? byline(turn.id) : null] }));
2088
- },
2089
- // The page's ONE heading, and it belongs to the empty transcript rather
2090
- // than to a signed-out branch — the branch is gone, and the heading went
2091
- // with it when it did. `Ask` passes its own, because the page embedding
2092
- // it already has an `<h1>` and a second is the defect that took the
2093
- // landings off /chat and /dev.
2094
- empty: heading === null ? undefined : (_jsxs(YStack, { "data-slot": "opening", items: "center", justify: "flex-end", width: "100%", height: "100%", pt: "$6", pb: "$2", children: [cast.length > 1 ? (_jsx(XStack, { items: "center", justify: "center", mb: "$4", children: cast.map((name, i) => (_jsx(Box, { marginInlineStart: i ? -16 : 0, rounded: 40, borderWidth: 2, borderColor: "$background", z: cast.length - i, children: _jsx(Face, { src: faces[name]?.avatar, emoji: faces[name]?.emoji, name: name, size: 72 }) }, name))) })) : portrait ? (_jsx(Box, { width: 160, height: 160, rounded: 24, overflow: "hidden", borderWidth: 2, borderColor: "var(--white-15)", boxShadow: "0 10px 24px color-mix(in srgb, var(--pure-black) 70%, transparent)", mb: "$4", bg: "var(--neutral-900)", children: _jsx(View, { render: _jsx("img", { src: portrait, alt: withWhom }), width: "100%", height: "100%", objectFit: "cover" }) })) : null, cast.length === 1 && !portrait ? (_jsx(Box, { mb: "$3", children: _jsx(Face, { emoji: mate?.emoji ?? persona?.emoji, name: withWhom, size: 72 }) })) : null, _jsx(Text, { render: "h1", fontSize: "$7", lineHeight: "$7", fontWeight: "700", color: "$ink", text: "center", mb: "$1", children: join(cast, t) || heading || (firstName ? t("What’s up, {name}?", { name: firstName }) : t("What’s up?")) }), cast.length === 1 && (mate?.description ?? persona?.description) ? (_jsx(Text, { fontSize: "$3", color: "$soft", text: "center", maxW: 500, mb: "$4", lineHeight: "$4", children: mate?.description ?? persona?.description })) : null] })),
2095
- // The transcript reads at the same measure. `Thread` defaults to 768
2096
- // itself; handing it the column here is what lets Width reach it.
2097
- column: { maxW: "var(--chat-column-measure, 640px)" }, composer: composer }) }) }), _jsx(AgentMaker, {}), carry.dialog, _jsx(Dialog, { open: anonPluginsOpen, onOpenChange: setAnonPluginsOpen, children: _jsxs(DialogContent, { maxW: 480, width: "100%", gap: "$3", "data-slot": "anon-plugins-dialog", children: [_jsx(DialogTitle, { children: t("Plugins & Skills") }), _jsx(Text, { fontSize: "$2", color: "$soft", children: t("Enable plugins and skills for this conversation, or type / and @ in the composer.") }), _jsxs(YStack, { maxH: 320, overflow: "scroll", gap: "$1.5", children: [carry.plugins.rows.map((p) => (_jsxs(XStack, { render: "button", onPress: () => carry.plugins.pick(p.id), items: "center", justify: "space-between", p: "$2.5", rounded: "$3", borderWidth: 1, borderColor: p.on ? "$ink" : "$borderColor", bg: p.on ? "$hover" : "transparent", hoverStyle: { bg: "$hover" }, cursor: "pointer", children: [_jsxs(XStack, { items: "center", gap: "$2.5", minW: 0, flex: 1, children: [p.icon, _jsxs(YStack, { minW: 0, flex: 1, children: [_jsx(Text, { fontSize: "$2", fontWeight: "600", color: "$ink", numberOfLines: 1, children: p.label }), p.note ? (_jsx(Text, { fontSize: "$1", color: "$soft", numberOfLines: 1, children: p.note })) : null] })] }), _jsx(Text, { fontSize: "$1", fontWeight: "600", color: p.on ? "$ink" : "$soft", children: p.on ? t("On") : t("Plugin") })] }, `plugin:${p.id}`))), carry.skills.rows.slice(0, 24).map((s) => (_jsxs(XStack, { render: "button", onPress: () => carry.skills.pick(s.id), items: "center", justify: "space-between", p: "$2", rounded: "$3", borderWidth: 1, borderColor: s.on ? "$ink" : "$borderColor", bg: s.on ? "$hover" : "transparent", hoverStyle: { bg: "$hover" }, cursor: "pointer", children: [_jsxs(XStack, { items: "center", gap: "$2", minW: 0, flex: 1, children: [s.icon, _jsxs(Text, { fontSize: "$2", color: "$ink", numberOfLines: 1, children: ["/", s.label] })] }), _jsx(Text, { fontSize: "$1", fontWeight: "600", color: s.on ? "$ink" : "$soft", children: s.on ? t("On") : t("Skill") })] }, `skill:${s.id}`)))] })] }) }), _jsx(Dialog, { open: anonGateOpen, onOpenChange: setAnonGateOpen, children: _jsxs(DialogContent, { maxW: 480, rounded: "$6", gap: "$3.5", children: [_jsx(DialogTitle, { children: t("Sign in to continue chatting") }), _jsx(Text, { fontSize: "$3", color: "$soft", lineHeight: "$4", children: t("Sign in or create a free Hanzo account to save this conversation and continue chatting.") }), _jsxs(YStack, { gap: "$2", pt: "$1", children: [_jsx(Button, { variant: "primary", size: "lg", width: "100%", onPress: () => window.location.assign("/signup?next=%2Fchat"), children: t("Create Free Account") }), _jsx(Button, { variant: "outline", size: "default", width: "100%", onPress: () => enter(LOGIN), children: t("Sign In") })] }), _jsxs(YStack, { gap: "$2", pt: "$2.5", borderTopWidth: 1, borderColor: "$borderColor", children: [_jsx(Text, { fontSize: "$1", fontFamily: "$mono", color: "$soft", children: t("NEED MORE CAPACITY? UPGRADE ANYTIME") }), _jsx(XStack, { gap: "$2", flexWrap: "wrap", children: [
2017
+ }, children: t("Sign up") }) })] })) : free && (sidebarClosed || !media.md) ? (_jsxs(XStack, { render: "button", "data-slot": "header-upgrade", "aria-label": t("Upgrade plan"), items: "center", gap: "$1.5", px: "$2", py: "$1", rounded: "$3", bg: "transparent", cursor: "pointer", hoverStyle: { bg: "$hover" }, onPress: () => window.location.assign(payUrl('/cart', { org: org(), returnUrl: window.location.href })), children: [_jsx(Sparkles, { size: 14, color: "var(--muted-foreground)", "aria-hidden": true }), _jsx(Text, { fontSize: 15, lineHeight: 20, fontWeight: "500", color: "$soft", numberOfLines: 1, children: t("Upgrade plan") })] })) : null, said.length > 0 ? (_jsx(ConversationMenu, { threads: currentThreadMap, active: open || currentThread.id, onSchedule: anonymous || forgetful ? undefined : () => setPlan(lastAsked()), children: _jsx(XStack, {}) })) : (_jsxs(Tooltip, { children: [_jsx(TooltipTrigger, { asChild: true, children: _jsx(XStack, { render: "button", "data-slot": "header-private-chat", "aria-label": t("Private chat"), "aria-pressed": forgetful, width: 32, height: 32, items: "center", justify: "center", rounded: "$3", bg: "transparent", cursor: "pointer", hoverStyle: { bg: "$hover" }, focusVisibleStyle: { outlineWidth: 2, outlineStyle: "solid", outlineColor: "var(--ring)" }, onPress: () => setForgetful(!forgetful), children: _jsx(Ghost, { size: 16, strokeWidth: 1.75, color: forgetful ? "var(--foreground)" : "var(--muted-foreground)", fill: forgetful ? "currentColor" : "none", "aria-hidden": true }) }) }), _jsx(TooltipContent, { children: forgetful ? t("Private chat is on: this conversation is not saved") : t("Private chat") })] })), open ? _jsx(Share, { thread: open }) : null, _jsx(XStack, { "$max-md": { display: 'none' }, children: _jsx(Summary, { sections: sections, onOpen: () => setPanel(true), label: t("Summary") }) }), inTopChrome ? null : (_jsx(XStack, { "$max-md": { display: 'none' }, children: _jsx(PanelToggle, { open: panel, onToggle: () => setPanel(!panel) }) }))] })] })), wide && aside !== null ? (_jsx(Side, { 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(XStack, { flex: 1, minH: 0, minW: 0, children: _jsxs(YStack, { ref: talkRef, "data-slot": "talk", flex: 1, minH: 0, minW: 0, position: "relative", children: [_jsx(ChatSurface, { ...chat, messages: shown, send: guarded,
2018
+ // WHILE NOTHING HAS BEEN SAID, from a tablet up, the opening and the
2019
+ // composer are one pair centred in the pane (`center`: rows `1fr auto auto
2020
+ // 1fr`), so the heading reads close above the field and nothing stands at
2021
+ // the window's foot (owner, 2026-10-30). A phone keeps the composer at the
2022
+ // foot, over the keyboard, from the first moment; once a turn exists every
2023
+ // width does, and the transcript scrolls under it.
2024
+ center: media.md,
2025
+ // AS IT WAS WRITTEN. The package renders a turn's words plainly and
2026
+ // says so — it ships no markdown pipeline because the plugin set is the
2027
+ // surface's to choose — so an answer arrived here reading "```ts" with
2028
+ // the backticks on screen. `Prose` is the site's one renderer, reading
2029
+ // with the same `marked` the legal pages parse with and drawing every
2030
+ // token in gui elements, and the shared view draws through it too.
2031
+ body: (turn) => {
2032
+ if (String(turn.id).startsWith(`${FAILED}:`)) {
2033
+ const question = shown.find((one) => one.id === String(turn.id).slice(FAILED.length + 1));
2034
+ return question ? failure(question) : null;
2035
+ }
2036
+ // A QUESTION THAT CARRIED PICTURES draws them beside its words.
2037
+ if (turn.role === "user" && Array.isArray(turn.content)) {
2038
+ const parts = partsOf(turn.content);
2039
+ return (_jsx(YStack, { gap: "$1", children: _jsx(Parts, { parts: parts, prose: (text) => _jsx(Prose, { text: text }) }) }));
2040
+ }
2041
+ const said = typeof turn.content === "string" ? turn.content : "";
2042
+ // A QUESTION THAT CARRIED FILES draws its words and the files' chips;
2043
+ // the passages it handed the model are the model's to read, not ours.
2044
+ if (turn.role === "user" && said) {
2045
+ const read = told(said);
2046
+ if (read.carried)
2047
+ return (_jsx(YStack, { gap: "$1", children: _jsx(Carried, { text: read.text, attached: read.carried.attached, reused: read.carried.reused, onOpen: openFile, onSave: anonymous ? undefined : (url, id, f) => keepOne(url, id, f.name, f.type) }) }));
2048
+ }
2049
+ // WHILE THE ANSWER HAS NO WORDS YET: who is answering (the agents the
2050
+ // question addresses, or the whole cast when it names nobody), and the
2051
+ // model's reasoning as it streams (`reasoning` on the turn), dimmed and
2052
+ // cut to its last lines.
2053
+ const thought = turn.role === "assistant" && !said && chat.streaming ? (turn.reasoning ?? "").trim() : "";
2054
+ if (turn.role === "assistant" && !said && chat.streaming && (cast.length || thought)) {
2055
+ const q = [...shown].reverse().find((one) => one.role === "user");
2056
+ const whom = cast.length ? addressed(words(q?.content), cast) : [];
2057
+ return (_jsxs(YStack, { gap: "$1", "data-slot": "thinking", children: [_jsx(Text, { fontSize: "$2", color: "$soft", children: whom.length
2058
+ ? whom.length > 1
2059
+ ? thought
2060
+ ? t("{names} are thinking…", { names: join(whom, t) })
2061
+ : t("{names} are answering…", { names: join(whom, t) })
2062
+ : thought
2063
+ ? t("{names} is thinking…", { names: join(whom, t) })
2064
+ : t("{names} is answering…", { names: join(whom, t) })
2065
+ : t("Thinking…") }), thought ? (_jsx(Text, { fontSize: "$2", color: "$soft", opacity: 0.72, "data-slot": "thought", children: thought.length > THOUGHT ? `…${thought.slice(-THOUGHT).replace(/^\S*\s/, "")}` : thought })) : null] }));
2066
+ }
2067
+ // A CAST'S ANSWER IS SEVERAL PEOPLE'S. Each opens a line with their
2068
+ // name, as the brief asks, so each is drawn under their own face and
2069
+ // read in their own voice. A reply that names nobody is drawn whole.
2070
+ const parts = turn.role === "assistant" ? speakers(said, known) : null;
2071
+ if (parts && parts.some((part) => part.who)) {
2072
+ // Asked and silent: an agent the question addressed who has no part
2073
+ // in this reply.
2074
+ const at = shown.findIndex((one) => one.id === turn.id);
2075
+ const q = shown.slice(0, at).reverse().find((one) => one.role === "user");
2076
+ const silent = cast.length > 1 && !(chat.streaming && at === shown.length - 1)
2077
+ ? addressed(words(q?.content), cast).filter((name) => !parts.some((part) => part.who?.toLowerCase() === name.toLowerCase()))
2078
+ : [];
2079
+ return (_jsxs(YStack, { gap: "$3", "data-turn-id": String(turn.id), "data-turn-role": turn.role, children: [parts.map((part, i) => (_jsxs(YStack, { gap: "$1", children: [part.who ? (_jsxs(XStack, { items: "center", gap: "$2", children: [_jsx(Face, { src: faces[part.who]?.avatar, emoji: faces[part.who]?.emoji, name: part.who, size: 20 }), _jsx(Text, { fontSize: "$2", fontWeight: "600", color: "$ink", children: part.who })] })) : null, _jsx(Prose, { text: part.text }), part.text ? (_jsx(Reply, { text: part.text, title: shownTitle, listen: listen(part.who ?? withWhom ?? undefined), onOpen: opener(part.text), onRedo: (act) => redoTurn(turn.id, act), onBranch: () => branchTurn(turn.id) })) : null] }, i))), silent.length ? (_jsx(Text, { fontSize: "$2", color: "$soft", children: t("No answer from {names} in this reply.", { names: join(silent, t) }) })) : null, byline(turn.id)] }));
2080
+ }
2081
+ const ms = turn.durationMs;
2082
+ const worked = turn.role === "assistant" && typeof ms === "number" && ms >= 1000 ? ms : 0;
2083
+ return (_jsxs(YStack, { gap: "$1.5", "data-turn-id": String(turn.id), "data-turn-role": turn.role, children: [worked ? (_jsx(Text, { "data-slot": "worked-for", fontSize: "$2", color: "$soft", children: t("Worked for {n}s", { n: Math.round(worked / 1000) }) })) : null, _jsx(Prose, { text: said }), turn.role === "assistant" && said ? (_jsx(Reply, { text: said, title: shownTitle, listen: listen(withWhom ?? undefined), onOpen: opener(said), onRedo: (act) => redoTurn(turn.id, act), onBranch: () => branchTurn(turn.id) })) : null, turn.role === "assistant" && said ? byline(turn.id) : null] }));
2084
+ },
2085
+ // The page's ONE heading, and it belongs to the empty transcript rather
2086
+ // than to a signed-out branch — the branch is gone, and the heading went
2087
+ // with it when it did. `Ask` passes its own, because the page embedding
2088
+ // it already has an `<h1>` and a second is the defect that took the
2089
+ // landings off /chat and /dev.
2090
+ empty: heading === null ? undefined : (_jsxs(YStack, { "data-slot": "opening", items: "center", justify: "flex-end", width: "100%", height: "100%", pt: "$6", pb: "$2", children: [cast.length > 1 ? (_jsx(XStack, { items: "center", justify: "center", mb: "$4", children: cast.map((name, i) => (_jsx(Box, { marginInlineStart: i ? -16 : 0, rounded: 40, borderWidth: 2, borderColor: "$background", z: cast.length - i, children: _jsx(Face, { src: faces[name]?.avatar, emoji: faces[name]?.emoji, name: name, size: 72 }) }, name))) })) : portrait ? (_jsx(Box, { width: 160, height: 160, rounded: 24, overflow: "hidden", borderWidth: 2, borderColor: "var(--white-15)", boxShadow: "0 10px 24px color-mix(in srgb, var(--pure-black) 70%, transparent)", mb: "$4", bg: "var(--neutral-900)", children: _jsx(View, { render: _jsx("img", { src: portrait, alt: withWhom }), width: "100%", height: "100%", objectFit: "cover" }) })) : null, cast.length === 1 && !portrait ? (_jsx(Box, { mb: "$3", children: _jsx(Face, { emoji: mate?.emoji ?? persona?.emoji, name: withWhom, size: 72 }) })) : null, cast.length === 0 && !portrait ? (_jsx(Box, { mb: "$3", "data-slot": "opening-mark", children: _jsx(ProviderMark, { org: "hanzo", size: 44, ink: true }) })) : null, _jsx(Text, { render: "h1", fontSize: "$7", lineHeight: "$7", fontWeight: "700", color: "$ink", text: "center", mb: "$1", children: join(cast, t) || heading || (firstName ? t("Good to see you, {name}. What’s next?", { name: firstName }) : t("What’s next?")) }), cast.length === 1 && (mate?.description ?? persona?.description) ? (_jsx(Text, { fontSize: "$3", color: "$soft", text: "center", maxW: 500, mb: "$4", lineHeight: "$4", children: mate?.description ?? persona?.description })) : null] })),
2091
+ // The transcript reads at the same measure. `Thread` defaults to 768
2092
+ // itself; handing it the column here is what lets Width reach it.
2093
+ column: { maxW: "var(--chat-column-measure, 640px)" }, composer: composer }), _jsx(ToBottom, { within: talkBox })] }) }), _jsx(AgentMaker, {}), carry.dialog, _jsx(Dialog, { open: anonPluginsOpen, onOpenChange: setAnonPluginsOpen, children: _jsxs(DialogContent, { maxW: 480, width: "100%", gap: "$3", "data-slot": "anon-plugins-dialog", children: [_jsx(DialogTitle, { children: t("Plugins & Skills") }), _jsx(Text, { fontSize: "$2", color: "$soft", children: t("Enable plugins and skills for this conversation, or type / and @ in the composer.") }), _jsxs(YStack, { maxH: 320, overflow: "scroll", gap: "$1.5", children: [carry.plugins.rows.map((p) => (_jsxs(XStack, { render: "button", onPress: () => carry.plugins.pick(p.id), items: "center", justify: "space-between", p: "$2.5", rounded: "$3", borderWidth: 1, borderColor: p.on ? "$ink" : "$borderColor", bg: p.on ? "$hover" : "transparent", hoverStyle: { bg: "$hover" }, cursor: "pointer", children: [_jsxs(XStack, { items: "center", gap: "$2.5", minW: 0, flex: 1, children: [p.icon, _jsxs(YStack, { minW: 0, flex: 1, children: [_jsx(Text, { fontSize: "$2", fontWeight: "600", color: "$ink", numberOfLines: 1, children: p.label }), p.note ? (_jsx(Text, { fontSize: "$1", color: "$soft", numberOfLines: 1, children: p.note })) : null] })] }), _jsx(Text, { fontSize: "$1", fontWeight: "600", color: p.on ? "$ink" : "$soft", children: p.on ? t("On") : t("Plugin") })] }, `plugin:${p.id}`))), carry.skills.rows.slice(0, 24).map((s) => (_jsxs(XStack, { render: "button", onPress: () => carry.skills.pick(s.id), items: "center", justify: "space-between", p: "$2", rounded: "$3", borderWidth: 1, borderColor: s.on ? "$ink" : "$borderColor", bg: s.on ? "$hover" : "transparent", hoverStyle: { bg: "$hover" }, cursor: "pointer", children: [_jsxs(XStack, { items: "center", gap: "$2", minW: 0, flex: 1, children: [s.icon, _jsxs(Text, { fontSize: "$2", color: "$ink", numberOfLines: 1, children: ["/", s.label] })] }), _jsx(Text, { fontSize: "$1", fontWeight: "600", color: s.on ? "$ink" : "$soft", children: s.on ? t("On") : t("Skill") })] }, `skill:${s.id}`)))] })] }) }), _jsx(Dialog, { open: anonGateOpen, onOpenChange: setAnonGateOpen, children: _jsxs(DialogContent, { maxW: 480, rounded: "$6", gap: "$3.5", children: [_jsx(DialogTitle, { children: t("Sign in to continue chatting") }), _jsx(Text, { fontSize: "$3", color: "$soft", lineHeight: "$4", children: t("Sign in or create a free Hanzo account to save this conversation and continue chatting.") }), _jsxs(YStack, { gap: "$2", pt: "$1", children: [_jsx(Button, { variant: "primary", size: "lg", width: "100%", onPress: () => window.location.assign("/signup?next=%2Fchat"), children: t("Create Free Account") }), _jsx(Button, { variant: "outline", size: "default", width: "100%", onPress: () => enter(LOGIN), children: t("Sign In") })] }), _jsxs(YStack, { gap: "$2", pt: "$2.5", borderTopWidth: 1, borderColor: "$borderColor", children: [_jsx(Text, { fontSize: "$1", fontFamily: "$mono", color: "$soft", children: t("NEED MORE CAPACITY? UPGRADE ANYTIME") }), _jsx(XStack, { gap: "$2", flexWrap: "wrap", children: [
2098
2094
  ["Go", "Pro"],
2099
2095
  ["Dev", "Max"],
2100
2096
  ].flat().map((label) => (_jsx(XStack, { render: "button", onPress: () => {
@@ -0,0 +1,5 @@
1
+ export declare function PreferencesDialog({ open, onOpenChange, initialSection, }: {
2
+ open: boolean;
3
+ onOpenChange: (open: boolean) => void;
4
+ initialSection?: string;
5
+ }): import("react").JSX.Element;
@@ -0,0 +1,25 @@
1
+ 'use client';
2
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
3
+ import { useEffect, useState } from 'react';
4
+ import { useI18n } from '@hanzo/i18n/react';
5
+ import { Dialog, DialogContent, DialogTitle, Input, XStack, YStack } from '@hanzo/ui';
6
+ import { Search, X } from 'lucide-react';
7
+ import { FIRST, SettingsList } from './Settings.js';
8
+ import { SettingsPane } from './SettingsPane.js';
9
+ export function PreferencesDialog({ open, onOpenChange, initialSection = FIRST, }) {
10
+ const { t } = useI18n();
11
+ const [active, setActive] = useState(initialSection);
12
+ const [filter, setFilter] = useState('');
13
+ useEffect(() => {
14
+ if (open)
15
+ setActive(initialSection);
16
+ }, [open, initialSection]);
17
+ const pick = (row) => {
18
+ if (row.href) {
19
+ window.open(row.href, '_blank', 'noopener,noreferrer');
20
+ return;
21
+ }
22
+ setActive(row.id);
23
+ };
24
+ return (_jsx(Dialog, { open: open, onOpenChange: onOpenChange, children: _jsxs(DialogContent, { "data-slot": "preferences-dialog", width: "94vw", maxW: 980, height: "84vh", maxH: 760, p: 0, gap: 0, rounded: 14, overflow: "hidden", bg: "var(--pane-fill, var(--card))", borderWidth: 1, borderColor: "var(--pane-edge, var(--border))", children: [_jsx(DialogTitle, { display: "none", children: t('Settings') }), _jsxs(XStack, { flex: 1, minH: 0, width: "100%", children: [_jsxs(YStack, { width: 236, shrink: 0, height: "100%", bg: "var(--side-fill, var(--background))", borderRightWidth: 1, borderColor: "var(--pane-edge, var(--border))", "$max-md": { width: 184 }, children: [_jsx(XStack, { px: 12, pt: 12, pb: 8, shrink: 0, children: _jsxs(XStack, { flex: 1, height: 32, px: 10, gap: 7, items: "center", rounded: 8, bg: "var(--surface-card-emphasis)", borderWidth: 1, borderColor: "var(--pane-edge, var(--border))", children: [_jsx(Search, { size: 13, color: "var(--muted-foreground)", "aria-hidden": true }), _jsx(Input, { unstyled: true, value: filter, onChange: (e) => setFilter(e.target.value), placeholder: t('Search settings'), "aria-label": t('Search settings'), flex: 1, minW: 0, fontSize: 13, color: "var(--foreground)", placeholderTextColor: "$placeholderColor" })] }) }), _jsx(YStack, { flex: 1, minH: 0, px: 8, pb: 12, overflowY: "auto", overflowX: "hidden", children: _jsx(SettingsList, { active: active, filter: filter, onPick: pick, onBack: () => onOpenChange(false) }) })] }), _jsxs(YStack, { flex: 1, minW: 0, minH: 0, height: "100%", bg: "var(--pane-fill, var(--card))", position: "relative", children: [_jsx(XStack, { position: "absolute", t: 12, r: 14, z: 5, children: _jsx(XStack, { render: "button", type: 'button', "aria-label": t('Close'), onClick: () => onOpenChange(false), width: 32, height: 32, rounded: 999, items: "center", justify: "center", bg: "var(--surface-card-emphasis)", borderWidth: 1, borderColor: "var(--pane-edge, var(--border))", cursor: "pointer", hoverStyle: { bg: 'var(--secondary)' }, children: _jsx(X, { size: 15, color: "var(--foreground)", "aria-hidden": true }) }) }), _jsx(SettingsPane, { id: active })] })] })] }) }));
25
+ }
package/dist/Rail.d.ts CHANGED
@@ -2,9 +2,8 @@ import { type ReactNode } from 'react';
2
2
  import { type Host } from '@hanzo/build';
3
3
  import { type Place } from './lib/host.js';
4
4
  /** The rail's width, px. */
5
- export declare const RAIL: number;
6
- /** A mark, px: a 34px rounded square on the rail's 48px. */
7
- export declare const MARK = 34;
5
+ /** A mark, px: a 40px rounded square on the rail's 56px. */
6
+ export declare const MARK = 40;
8
7
  /** The places the rail holds beside the products, by the builder address each opens. */
9
8
  export declare const RAISED: {
10
9
  readonly library: '-/artifacts';
package/dist/Rail.js CHANGED
@@ -47,12 +47,11 @@ import { out } from './help.js';
47
47
  import { BETAS } from './lib/betas.js';
48
48
  import { HOSTED_APPS } from './lib/hosted.js';
49
49
  import { Account } from './Account.js';
50
- import { HEAD, INSET, TOUCH_HEAD } from './ground.js';
50
+ import { HEAD, RAIL, TOUCH_HEAD } from './ground.js';
51
51
  import { app, hosted, WORKSPACE } from './lib/host.js';
52
52
  /** The rail's width, px. */
53
- export const RAIL = 2 * INSET;
54
- /** A mark, px: a 34px rounded square on the rail's 48px. */
55
- export const MARK = 34;
53
+ /** A mark, px: a 40px rounded square on the rail's 56px. */
54
+ export const MARK = 40;
56
55
  /** A mark on a touch screen, px: a thumb's 44. */
57
56
  const TOUCH = 44;
58
57
  /** The places the rail holds beside the products, by the builder address each opens. */
@@ -72,7 +71,7 @@ export function raised(at) {
72
71
  }
73
72
  /** One mark: an icon button named for where it goes (`label`, already in the reader's language), its name its tooltip, lit where the reader is. */
74
73
  export function Mark({ label, on = false, onPress, children, ...rest }) {
75
- return (_jsx(XStack, { render: "button", "aria-label": label, ...{ title: label }, "aria-current": on ? 'page' : undefined, onPress: onPress, width: MARK, height: MARK, rounded: 10, items: "center", justify: "center", shrink: 0, cursor: "pointer", opacity: on ? 1 : 0.72, bg: on ? 'var(--rail-active, var(--white-14))' : 'transparent', hoverStyle: { bg: on ? 'var(--rail-active, var(--white-14))' : 'var(--rail-hover, var(--white-08))', opacity: 1 }, pressStyle: { bg: '$raised' }, focusVisibleStyle: { outlineWidth: 2, outlineStyle: 'solid', outlineColor: '$outlineColor' },
74
+ return (_jsx(XStack, { render: "button", "aria-label": label, ...{ title: label }, "aria-current": on ? 'page' : undefined, onPress: onPress, width: MARK, height: MARK, rounded: 12, items: "center", justify: "center", shrink: 0, cursor: "pointer", opacity: on ? 1 : 0.7, bg: on ? '$edge' : 'transparent', hoverStyle: { bg: on ? '$edge' : '$hover', opacity: 1 }, pressStyle: { bg: '$raised' }, focusVisibleStyle: { outlineWidth: 2, outlineStyle: 'solid', outlineColor: '$outlineColor' },
76
75
  // A thumb's 44px on a touch screen.
77
76
  $touchable: { width: TOUCH, height: TOUCH }, ...rest, children: children }));
78
77
  }
@@ -131,7 +130,7 @@ export function Rail({ host, mode, at, open, toggle, inside = null, rows = false
131
130
  minH: 0,
132
131
  // The first mark stands at the pane's top edge, one head row high (HEAD), and the last at its foot by the
133
132
  // same inset, so the account mirrors the sidebar's toggle across the rail.
134
- pt: (HEAD - MARK) / 2 + 3, pb: 8, gap: 3, shrink: 0, items: "center", "$max-md": { pb: 0 }, $touchable: { pt: (TOUCH_HEAD - TOUCH) / 2, pb: 0 }, children: [toggle ? (_jsx(YStack, { children: _jsx(Toggle, { open: open, onPress: toggle }) })) : null, _jsxs(YStack, { flex: 1, minH: 0, overflowY: "auto", overflowX: "hidden", items: "center", gap: 4, width: "100%", "$platform-web": { scrollbarWidth: 'none' }, children: [_jsx(Mark, { label: t('Chat'), on: mode === 'chat', onPress: onChat, "data-slot": "rail-chat", children: _jsx(MARKS.chat.icon, { size: 18, "aria-hidden": true }) }), _jsx(Mark, { label: "Dev", on: mode === 'dev' && !here, onPress: onDev, "data-slot": "rail-dev", children: _jsx(MARKS.dev.icon, { size: 18, "aria-hidden": true }) }), anon ? null : (_jsx(Mark, { label: "Design", on: mode === 'design', onPress: onDesign, "data-slot": "rail-design", children: _jsx(MARKS.design.icon, { size: 18, "aria-hidden": true }) })), !anon && opened('studio') ? (_jsx(Mark, { label: "Studio", on: mode === 'studio', onPress: onStudio, "data-slot": "rail-studio", children: _jsx(MARKS.studio.icon, { size: 18, "aria-hidden": true }) })) : null, anon ? null : (_jsx(Mark, { label: "Tabs", on: mode === 'tabs', onPress: onTabs, "data-slot": "rail-tabs", children: _jsx(MARKS.tabs.icon, { size: 18, "aria-hidden": true }) })), apps.map((a) => (_jsx(Mark, { label: a.name, on: inside === a.id, onPress: () => go(hosted(a.id)), "data-slot": `rail-app-${a.id}`, children: _jsx(a.icon, { size: 18, "aria-hidden": true }) }, a.id))), _jsx(Mark, { label: t('Library'), on: here === 'library', onPress: to(RAISED.library), "data-slot": "rail-library", children: _jsx(MARKS.library.icon, { size: 18, "aria-hidden": true }) }), anon ? null : (_jsx(Mark, { label: t('Scheduled tasks'), on: here === 'scheduled', onPress: to(RAISED.scheduled), "data-slot": "rail-scheduled", children: _jsx(MARKS.scheduled.icon, { size: 18, "aria-hidden": true }) })), anon ? null : (_jsx(Mark, { label: t('Customize'), on: here === 'customize', onPress: to(RAISED.customize), "data-slot": "rail-customize", children: _jsx(MARKS.customize.icon, { size: 18, "aria-hidden": true }) })), anon ? null : (_jsx(Mark, { label: t('Betas'), on: mode === 'beta', onPress: () => go('/beta'), "data-slot": "rail-betas", children: _jsx(FlaskConical, { size: 18, "aria-hidden": true }) })), betasDialog, !anon && rest.length ? (_jsx(DropdownMenu
133
+ pt: (HEAD - MARK) / 2 + 2, pb: 10, gap: 3, shrink: 0, items: "center", $touchable: { pt: (TOUCH_HEAD - TOUCH) / 2, pb: (TOUCH_HEAD - TOUCH) / 2 }, children: [toggle ? (_jsx(YStack, { children: _jsx(Toggle, { open: open, onPress: toggle }) })) : null, _jsxs(YStack, { flex: 1, minH: 0, overflowY: "auto", overflowX: "hidden", items: "center", gap: 4, width: "100%", "$platform-web": { scrollbarWidth: 'none' }, children: [_jsx(Mark, { label: t('Chat'), on: mode === 'chat', onPress: onChat, "data-slot": "rail-chat", children: _jsx(MARKS.chat.icon, { size: 18, "aria-hidden": true }) }), _jsx(Mark, { label: "Dev", on: mode === 'dev' && !here, onPress: onDev, "data-slot": "rail-dev", children: _jsx(MARKS.dev.icon, { size: 18, "aria-hidden": true }) }), anon ? null : (_jsx(Mark, { label: "Design", on: mode === 'design', onPress: onDesign, "data-slot": "rail-design", children: _jsx(MARKS.design.icon, { size: 18, "aria-hidden": true }) })), !anon && opened('studio') ? (_jsx(Mark, { label: "Studio", on: mode === 'studio', onPress: onStudio, "data-slot": "rail-studio", children: _jsx(MARKS.studio.icon, { size: 18, "aria-hidden": true }) })) : null, anon ? null : (_jsx(Mark, { label: "Tabs", on: mode === 'tabs', onPress: onTabs, "data-slot": "rail-tabs", children: _jsx(MARKS.tabs.icon, { size: 18, "aria-hidden": true }) })), apps.map((a) => (_jsx(Mark, { label: a.name, on: inside === a.id, onPress: () => go(hosted(a.id)), "data-slot": `rail-app-${a.id}`, children: _jsx(a.icon, { size: 18, "aria-hidden": true }) }, a.id))), _jsx(Mark, { label: t('Library'), on: here === 'library', onPress: to(RAISED.library), "data-slot": "rail-library", children: _jsx(MARKS.library.icon, { size: 18, "aria-hidden": true }) }), anon ? null : (_jsx(Mark, { label: t('Scheduled tasks'), on: here === 'scheduled', onPress: to(RAISED.scheduled), "data-slot": "rail-scheduled", children: _jsx(MARKS.scheduled.icon, { size: 18, "aria-hidden": true }) })), anon ? null : (_jsx(Mark, { label: t('Customize'), on: here === 'customize', onPress: to(RAISED.customize), "data-slot": "rail-customize", children: _jsx(MARKS.customize.icon, { size: 18, "aria-hidden": true }) })), anon ? null : (_jsx(Mark, { label: t('Betas'), on: mode === 'beta', onPress: () => go('/beta'), "data-slot": "rail-betas", children: _jsx(FlaskConical, { size: 18, "aria-hidden": true }) })), betasDialog, !anon && rest.length ? (_jsx(DropdownMenu
135
134
  // Toward the content: right of the rail, left of it right to left.
136
135
  , {
137
136
  // Toward the content: right of the rail, left of it right to left.
package/dist/Recents.js CHANGED
@@ -17,7 +17,7 @@ import { SidebarItem, StatusDot } from '@hanzo/ui/chat';
17
17
  import { useKept } from './kept.js';
18
18
  import { app } from './lib/host.js';
19
19
  import { site } from './where.js';
20
- import { arrange, chats, MENUS, PINNED, PLAIN, runs, SINCE, UNFILED, UNTITLED, UNTITLED_RUN, viewOf } from './recent.js';
20
+ import { ago, arrange, chats, MENUS, PINNED, PLAIN, runs, SINCE, UNFILED, UNTITLED, UNTITLED_RUN, viewOf } from './recent.js';
21
21
  import { hasUnreadUpdate, ProjectsTree, useChatProjects } from './ProjectsTree.js';
22
22
  import { ConversationMenu, ThreadRow, useThreadList } from './thread.js';
23
23
  /** The menu's items: each section a heading and its options (recent.ts's phrases, drawn through `t`), the one in force checked. */
@@ -202,8 +202,10 @@ function List({ mode, rows, view, keep, open, reading, error, onOpen, threads, h
202
202
  const row = (r) => {
203
203
  const one = threads?.get(r.id);
204
204
  const isUnread = Boolean(r.kind === 'chat' && !open(r) && unreadIds?.has(r.id));
205
- const rowAside = r.kind === 'dev' ? (_jsxs(XStack, { items: "center", gap: "$1", children: [r.pr ? _jsx(GitPullRequest, { size: 13, color: "var(--state-success)", "aria-hidden": true }) : null, _jsx(StatusDot, { status: DOTS[r.status] ?? 'idle' })] })) : isUnread ? (_jsx(XStack, { "data-slot": "thread-unread-dot", width: 6, height: 6, rounded: 999, bg: "var(--foreground)", "aria-hidden": true })) : undefined;
206
- const item = (_jsx(SidebarItem, { "data-kind": r.kind, active: open(r), rounded: 8, minH: 29, paddingInlineStart: "$2", paddingInlineEnd: one || r.kind === 'dev' ? '$6' : '$2',
205
+ const age = ago(r.at, new Date(), t);
206
+ const when = age ? (_jsx(SizableText, { "data-slot": "row-age", fontSize: 12, lineHeight: 16, color: "var(--muted-foreground)", children: age })) : null;
207
+ const rowAside = r.kind === 'dev' ? (_jsxs(XStack, { items: "center", gap: "$1.5", children: [when, r.pr ? _jsx(GitPullRequest, { size: 13, color: "var(--state-success)", "aria-hidden": true }) : null, _jsx(StatusDot, { status: DOTS[r.status] ?? 'idle' })] })) : isUnread || when ? (_jsxs(XStack, { items: "center", gap: "$1.5", children: [when, isUnread ? (_jsx(XStack, { "data-slot": "thread-unread-dot", width: 6, height: 6, rounded: 999, bg: "var(--foreground)", "aria-hidden": true })) : null] })) : undefined;
208
+ const item = (_jsx(SidebarItem, { "data-kind": r.kind, active: open(r), rounded: 8, minH: 29, paddingInlineStart: "$2", paddingInlineEnd: one || rowAside ? 52 : '$2',
207
209
  // A thumb's 44 on a touch screen; a conversation's ⋯ is a thumb wide there and always there: the title stops short of it.
208
210
  $touchable: one ? { minH: 44, paddingInlineEnd: 52 } : { minH: 44 }, onKeyDown: (e) => {
209
211
  if (e.key !== 'Enter' && e.key !== ' ')
package/dist/Shell.js CHANGED
@@ -54,7 +54,7 @@ import { parseModels } from "@hanzo/ui/models/catalog";
54
54
  import { mark } from "./lib/mark.js";
55
55
  import { useOpen } from "./open.js";
56
56
  import { useSpan } from "./span.js";
57
- import { pane } from "./ground.js";
57
+ import { BAR, pane, RAIL } from "./ground.js";
58
58
  import { useFree } from "./Upgrade.js";
59
59
  import { payUrl } from "./lib/pay.js";
60
60
  /** The new-agent row's fields: an outlined box in the shell's own ink. */
@@ -1018,7 +1018,7 @@ export function Split({ children, swap, framed = false, bare = false, }) {
1018
1018
  return (_jsxs(_Fragment, { children: [_jsxs(YStack, { render: "main", "data-slot": "pane", gridArea: "pane", position: "relative", ...(framed
1019
1019
  ? bare
1020
1020
  ? null
1021
- : { ...pane(), overflow: "hidden", $md: { rounded: 0 } }
1021
+ : { ...pane(), overflow: "hidden" }
1022
1022
  : {
1023
1023
  ...sheet(0),
1024
1024
  // The edge the pane shares with the column before it: the left, or the right in a right-to-left language.
@@ -1052,14 +1052,9 @@ export function Split({ children, swap, framed = false, bare = false, }) {
1052
1052
  target.addEventListener("pointermove", onMove);
1053
1053
  target.addEventListener("pointerup", cleanup);
1054
1054
  target.addEventListener("pointercancel", cleanup);
1055
- } })) : null] }), aside ? (_jsxs(YStack, { render: "aside", "data-slot": "side", gridArea: "side", ...pane(framed ? "var(--side-fill, var(--pane-fill))" : sheet(1).backgroundColor), ...(framed
1056
- ? {
1057
- rounded: 0,
1058
- borderInlineStartWidth: 1,
1059
- borderInlineStartStyle: "solid",
1060
- borderColor: "var(--pane-edge, var(--edge, var(--white-06)))",
1061
- }
1062
- : null), marginInlineStart: 0, ref: split.aside, position: "relative", shrink: 0, minH: 0, display: "none", $lg: { display: "flex" }, children: [split.grip ? (_jsx(Gutter, { ...split.grip, label: t("Resize side panel"), gap: split.side.hidden ? 0 : undefined, inset: split.side.hidden ? -4 : 1 })) : null, _jsx(YStack, { flex: 1, minH: 0, overflowY: "auto", overflowX: "hidden", rounded: framed ? 0 : "var(--pane-round)", ref: (el) => setSlot(el instanceof HTMLElement ? el : null) })] })) : null] }));
1055
+ } })) : null] }), aside ? (_jsxs(YStack, { render: "aside", "data-slot": "side", gridArea: "side", ...pane(framed ? undefined : sheet(1).backgroundColor),
1056
+ // In the frame the gutter stands between the pane and this column.
1057
+ marginInlineStart: framed ? "var(--pane-gap)" : undefined, ref: split.aside, position: "relative", shrink: 0, minH: 0, display: "none", $lg: { display: "flex" }, children: [split.grip ? (_jsx(Gutter, { ...split.grip, label: t("Resize side panel"), gap: split.side.hidden ? 0 : undefined, inset: split.side.hidden ? -4 : 1 })) : null, _jsx(YStack, { flex: 1, minH: 0, overflowY: "auto", overflowX: "hidden", rounded: "var(--pane-round)", ref: (el) => setSlot(el instanceof HTMLElement ? el : null) })] })) : null] }));
1063
1058
  }
1064
1059
  /**
1065
1060
  * THE RAIL: where you can go, as marks with their names under them. It is the
@@ -1104,8 +1099,8 @@ function Rail({ mode, places, team, open, navigate, onSettings, onMore, }) {
1104
1099
  overflow: "hidden",
1105
1100
  }, children: [places.map((place, i) => {
1106
1101
  const here = place.id === mode;
1107
- return (_jsxs(Box, { render: "button", onClick: () => navigate?.(place.route), "aria-label": t(place.label), "aria-current": here ? "page" : undefined, title: place.name ?? (place.title ? t(place.title) : t(place.label)), display: "flex", "$max-md": { display: i < 4 ? "flex" : "none", width: "auto", minW: 0 }, flexDirection: "column", width: 56, minH: 44, py: "$1", rounded: "$2", items: "center", justify: "center", gap: 2, bg: here ? "$edge" : undefined, hoverStyle: { bg: here ? "$edge" : "$hover" }, children: [_jsx(place.icon, { size: 18, "aria-hidden": true }), _jsx(Text, { fontSize: 12, lineHeight: 14, color: here ? "$ink" : "$quiet", numberOfLines: 1, children: t(place.label) })] }, place.id));
1108
- }), team ? (_jsx(XStack, { "$max-md": { display: places.length < 4 ? "flex" : "none", width: "auto", minW: 0 }, children: _jsx(Text, { render: _jsx("a", { href: team, "aria-label": t("Workspace"), title: "Hanzo Team" }), display: "flex", width: 56, color: "inherit", children: _jsxs(Box, { display: "flex", flex: 1, flexDirection: "column", minH: 44, py: "$1", rounded: "$2", items: "center", justify: "center", gap: 2, hoverStyle: { bg: "$hover" }, children: [_jsx(LayoutGrid, { size: 18, "aria-hidden": true }), _jsx(Text, { fontSize: 12, lineHeight: 14, color: "$quiet", numberOfLines: 1, children: t("Workspace") })] }) }) })) : null, _jsxs(Box, { "data-slot": "more", render: "button", onClick: onMore, "aria-label": t("More places"), title: t("More"), display: "none", "$max-md": { display: "flex", width: "auto", minW: 0 }, flexDirection: "column", width: 56, minH: 44, py: "$1", rounded: "$2", items: "center", justify: "center", gap: 2, hoverStyle: { bg: "$hover" }, children: [_jsx(SearchIcon, { size: 18, "aria-hidden": true }), _jsx(Text, { fontSize: 12, lineHeight: 14, color: "$quiet", children: t("More") })] })] }), _jsx(YStack, { items: "center", pb: "$2", $md: open ? { display: "none" } : undefined, children: _jsxs(Box, { render: "button", onClick: onSettings, "aria-label": t("Settings"), title: t("Settings"), display: "flex", flexDirection: "column", width: 56, minH: 44, py: "$1", rounded: "$2", items: "center", justify: "center", gap: 2, hoverStyle: { bg: "$hover" }, children: [_jsx(Settings2, { size: 18, "aria-hidden": true }), _jsx(Text, { fontSize: 12, lineHeight: 14, color: "$quiet", children: t("Settings") })] }) })] }));
1102
+ return (_jsxs(Box, { render: "button", onClick: () => navigate?.(place.route), "aria-label": t(place.label), "aria-current": here ? "page" : undefined, title: place.name ?? (place.title ? t(place.title) : t(place.label)), display: "flex", "$max-md": { display: i < 4 ? "flex" : "none", width: "auto", minW: 0 }, flexDirection: "column", width: 40, minH: 44, py: "$1", rounded: "$2", items: "center", justify: "center", gap: 2, bg: here ? "$edge" : undefined, hoverStyle: { bg: here ? "$edge" : "$hover" }, children: [_jsx(place.icon, { size: 18, "aria-hidden": true }), _jsx(Text, { fontSize: 12, lineHeight: 14, color: here ? "$ink" : "$quiet", numberOfLines: 1, children: t(place.label) })] }, place.id));
1103
+ }), team ? (_jsx(XStack, { "$max-md": { display: places.length < 4 ? "flex" : "none", width: "auto", minW: 0 }, children: _jsx(Text, { render: _jsx("a", { href: team, "aria-label": t("Workspace"), title: "Hanzo Team" }), display: "flex", width: RAIL, color: "inherit", children: _jsxs(Box, { display: "flex", flex: 1, flexDirection: "column", minH: 44, py: "$1", rounded: "$2", items: "center", justify: "center", gap: 2, hoverStyle: { bg: "$hover" }, children: [_jsx(LayoutGrid, { size: 18, "aria-hidden": true }), _jsx(Text, { fontSize: 12, lineHeight: 14, color: "$quiet", numberOfLines: 1, children: t("Workspace") })] }) }) })) : null, _jsxs(Box, { "data-slot": "more", render: "button", onClick: onMore, "aria-label": t("More places"), title: t("More"), display: "none", "$max-md": { display: "flex", width: "auto", minW: 0 }, flexDirection: "column", width: RAIL, minH: 44, py: "$1", rounded: "$2", items: "center", justify: "center", gap: 2, hoverStyle: { bg: "$hover" }, children: [_jsx(SearchIcon, { size: 18, "aria-hidden": true }), _jsx(Text, { fontSize: 12, lineHeight: 14, color: "$quiet", children: t("More") })] })] }), _jsx(YStack, { items: "center", pb: "$2", $md: open ? { display: "none" } : undefined, children: _jsxs(Box, { render: "button", onClick: onSettings, "aria-label": t("Settings"), title: t("Settings"), display: "flex", flexDirection: "column", width: RAIL, minH: 44, py: "$1", rounded: "$2", items: "center", justify: "center", gap: 2, hoverStyle: { bg: "$hover" }, children: [_jsx(Settings2, { size: 18, "aria-hidden": true }), _jsx(Text, { fontSize: 12, lineHeight: 14, color: "$quiet", children: t("Settings") })] }) })] }));
1109
1104
  }
1110
1105
  /**
1111
1106
  * Chat's column: start a chat, the projects, then every conversation. The app
@@ -1378,7 +1373,10 @@ function Frame({ mode, children, navigate, back, forward, }) {
1378
1373
  },
1379
1374
  signOut: () => void logout(),
1380
1375
  };
1381
- const list = (_jsxs(Sidebar, { ref: side.ref, ...side.props, $md: { width: "var(--span)" }, "$max-md": { width: "100%", maxW: 280 }, ...sheet(0), ...(dir === "rtl" ? { borderRightWidth: 0, borderLeftWidth: 1 } : { borderRightWidth: 1 }), borderColor: "var(--edge, var(--white-06))", position: "relative", children: [_jsx(Gutter
1376
+ const list = (_jsxs(Sidebar, { ref: side.ref, ...side.props, $md: { width: "var(--span)" }, "$max-md": { width: "100%", maxW: 280 }, ...sheet(0),
1377
+ // The kit draws the sidebar's edge on its right, a physical side, so the edge is
1378
+ // traded here: the left in a right-to-left language, where the sidebar stands at the right.
1379
+ bg: "var(--side-fill, var(--sheet-2))", rounded: "var(--pane-round)", borderWidth: 1, borderColor: "var(--pane-edge, var(--edge, var(--white-06)))", position: "relative", children: [_jsx(Gutter
1382
1380
  // The edge the sidebar is pinned to (Grip's, physical): its free edge is the other one.
1383
1381
  , {
1384
1382
  // The edge the sidebar is pinned to (Grip's, physical): its free edge is the other one.
@@ -1404,9 +1402,9 @@ function Frame({ mode, children, navigate, back, forward, }) {
1404
1402
  navigate?.(site("/referral"));
1405
1403
  dismiss();
1406
1404
  }, children: t("Share Hanzo") }), _jsx(XStack, { items: "center", justify: "flex-end", gap: "$1", px: "$1.5", py: "$1", borderTopWidth: 1, borderColor: "$borderColor", children: _jsx(Box, { render: "button", onClick: toggle, "aria-label": t("Collapse sidebar"), p: "$2", rounded: "$2", hoverStyle: { bg: "$hover" }, cursor: "pointer", children: _jsx(PanelLeftClose, { size: 16, "aria-hidden": true, "data-i18n-mirror": "" }) }) })] })) : null) : null] }));
1407
- return (_jsxs(YStack, { "data-slot": "workspace", "data-hydrated": settled ? "true" : undefined, "data-sidebar": asked ? "open" : "shut", display: "grid", gridTemplateColumns: "64px auto minmax(0, 1fr) auto", gridTemplateRows: "56px minmax(0, 1fr)", gridTemplateAreas: '"bar bar bar bar" "rail list pane side"', "$max-md": {
1405
+ return (_jsxs(YStack, { "data-slot": "workspace", "data-hydrated": settled ? "true" : undefined, "data-sidebar": asked ? "open" : "shut", display: "grid", gridTemplateColumns: `${RAIL}px auto minmax(0, 1fr) auto`, gridTemplateRows: `${BAR}px minmax(0, 1fr)`, gridTemplateAreas: '"bar bar bar bar" "rail list pane side"', "$max-md": {
1408
1406
  gridTemplateColumns: "minmax(0, 1fr)",
1409
- gridTemplateRows: `56px minmax(0, 1fr) ${TABS_HEIGHT}`,
1407
+ gridTemplateRows: `${BAR}px minmax(0, 1fr) ${TABS_HEIGHT}`,
1410
1408
  gridTemplateAreas: '"bar" "pane" "rail"',
1411
1409
  }, position: "relative", width: "100%", height: "100dvh", overflow: "hidden", bg: "$background", backgroundImage: "var(--pane-ground)", children: [_jsx(Rail, { mode: mode, places: places, open: asked, team: onApex ? (signedIn ? ENTRY : WORKSPACE) : undefined, navigate: navigate, onSettings: () => showSettings(FIRST), onMore: () => setFinding(true) }), _jsx(Box, { gridArea: "bar", "data-slot": "bar", "data-tauri-drag-region": "deep", onMouseDown: dragWindow, onDoubleClick: toggleWindowMaximize, shrink: 0, children: _jsx(BusinessHeader, { appId: onApex ? (mode === "dev" ? "dev" : "chat") : "team", appTitle: onApex ? (mode === "dev" ? "Hanzo Dev" : "Hanzo Chat") : "Hanzo Team", apps: BUSINESS_APPS, brandMark: _jsx(HanzoMark, { size: 18 }), onSelectApp: (item) => {
1412
1410
  if (typeof window === "undefined")
@@ -1471,7 +1469,7 @@ function Frame({ mode, children, navigate, back, forward, }) {
1471
1469
  void switchToAccount(found);
1472
1470
  else
1473
1471
  void addAccount();
1474
- }, onAddAccount: () => void addAccount(), onSettings: () => showSettings(FIRST), onSignOut: () => void logout(), leftSlot: _jsxs(XStack, { items: "center", gap: "$1", shrink: 0, children: [_jsx(SidebarIconButton, { ...TAP, label: t(shown ? "Close sidebar" : "Open sidebar"), onPress: toggle, onMouseEnter: () => setPeeking(true), children: _jsx(PanelLeft, { size: 16, "aria-hidden": true, "data-i18n-mirror": "" }) }), back || forward ? (_jsxs(XStack, { display: "none", $md: { display: "flex" }, items: "center", gap: "$1", shrink: 0, children: [_jsx(SidebarIconButton, { ...TAP, label: t("Back"), onPress: () => back?.(), children: _jsx(ArrowLeft, { size: 16, "aria-hidden": true, "data-i18n-mirror": "" }) }), _jsx(SidebarIconButton, { ...TAP, label: t("Forward"), onPress: () => forward?.(), children: _jsx(ArrowRight, { size: 16, "aria-hidden": true, "data-i18n-mirror": "" }) })] })) : null] }), rightSlot: _jsxs(XStack, { shrink: 0, minW: 0, justify: "flex-end", items: "center", gap: "$2", children: [settled && !signedIn ? (_jsx(Box, { ...TAP, render: "button", onClick: () => enter(LOGIN), display: "flex", items: "center", justify: "center", cursor: "pointer", children: _jsx(XStack, { items: "center", justify: "center", height: CONTROL, px: "$2.5", rounded: "$2", borderWidth: 1, borderColor: "$borderColor", hoverStyle: { bg: "$hover" }, children: _jsx(Text, { fontSize: "$1", fontWeight: "600", color: "$ink", children: t("Sign in") }) }) })) : null, settled && signedIn && free ? (_jsx(Box, { ...TAP, render: "button", onClick: () => window.location.assign(payUrl("/cart", { returnUrl: window.location.href })), display: "flex", items: "center", justify: "center", cursor: "pointer", "aria-label": t("Upgrade"), "data-slot": "bar-upgrade", children: _jsxs(XStack, { items: "center", justify: "center", height: CONTROL, px: "$2.5", rounded: "$2", borderWidth: 1, borderColor: "$borderColor", gap: "$1.5", hoverStyle: { bg: "$hover" }, children: [_jsx(Sparkles, { size: 13, "aria-hidden": true, color: "var(--primary)" }), _jsx(Text, { fontSize: "$1", fontWeight: "600", color: "$ink", children: t("Upgrade") })] }) })) : null, _jsxs(XStack, { display: "none", $lg: { display: "flex" }, items: "center", gap: "$1", children: [_jsx(SidebarIconButton, { ...TAP, label: t(aside === "roster" ? "Hide directory & roster" : "Show directory & roster"), onPress: () => showAside(aside === "roster" ? null : "roster"), children: _jsx(Users, { size: 16, "aria-hidden": true }) }), _jsx(SidebarIconButton, { ...TAP, label: t(aside === "tasks" ? "Close side panel" : "Open side panel"), onPress: () => showAside(aside === "tasks" ? null : "tasks"), children: _jsx(PanelRight, { size: 16, "aria-hidden": true, "data-i18n-mirror": "" }) })] }), _jsx(WindowControls, {})] }), children: _jsx(YStack, { width: 420, maxW: "100%", position: "relative", children: _jsxs(Box, { render: "button", onClick: () => setFinding(true), display: "flex", flexDirection: "row", "data-slot": "find", items: "center", "$max-md": { justify: "center" }, gap: "$2", width: "100%", height: CONTROL, px: "$2.5", rounded: "$2", borderWidth: 1, borderColor: "$borderColor", hoverStyle: { bg: "$hover" }, children: [_jsx(SearchIcon, { size: 13, "aria-hidden": true, color: "var(--soft, var(--muted-foreground))" }), _jsx(Text, { fontSize: "$1", color: "$soft", "$max-md": { display: "none" }, children: t("Search {workspace}", { workspace }) }), _jsx(Shortcut, { keys: ["Mod", "K"], marginInlineStart: "auto", "data-i18n-ltr": "", "$max-md": { display: "none" } })] }) }) }) }), shown ? (_jsx(Box, { render: "button", "aria-label": t("Close sidebar"), onClick: dismiss, ...scrim, "data-slot": "scrim", position: "absolute", t: 56, r: 0, b: TABS_HEIGHT, l: 0, z: "var(--z-scrim)", $md: { display: "none" } })) : null, shown ? (_jsx(XStack, { "data-slot": "list", gridArea: "list", position: asked ? "relative" : "absolute", ...(asked ? {} : { top: 56, bottom: 0, insetInlineStart: 64 }), "$max-md": { position: "fixed", t: 56, r: 0, b: TABS_HEIGHT, l: 0, width: "100%" }, z: "var(--z-drawer)", bg: "$background", onMouseEnter: () => setPeeking(true), onMouseLeave: () => {
1472
+ }, onAddAccount: () => void addAccount(), onSettings: () => showSettings(FIRST), onSignOut: () => void logout(), leftSlot: _jsxs(XStack, { items: "center", gap: "$1", shrink: 0, children: [_jsx(SidebarIconButton, { ...TAP, label: t(shown ? "Close sidebar" : "Open sidebar"), onPress: toggle, onMouseEnter: () => setPeeking(true), children: _jsx(PanelLeft, { size: 16, "aria-hidden": true, "data-i18n-mirror": "" }) }), back || forward ? (_jsxs(XStack, { display: "none", $md: { display: "flex" }, items: "center", gap: "$1", shrink: 0, children: [_jsx(SidebarIconButton, { ...TAP, label: t("Back"), onPress: () => back?.(), children: _jsx(ArrowLeft, { size: 16, "aria-hidden": true, "data-i18n-mirror": "" }) }), _jsx(SidebarIconButton, { ...TAP, label: t("Forward"), onPress: () => forward?.(), children: _jsx(ArrowRight, { size: 16, "aria-hidden": true, "data-i18n-mirror": "" }) })] })) : null] }), rightSlot: _jsxs(XStack, { shrink: 0, minW: 0, justify: "flex-end", items: "center", gap: "$2", children: [settled && !signedIn ? (_jsx(Box, { ...TAP, render: "button", onClick: () => enter(LOGIN), display: "flex", items: "center", justify: "center", cursor: "pointer", children: _jsx(XStack, { items: "center", justify: "center", height: CONTROL, px: "$2.5", rounded: "$2", borderWidth: 1, borderColor: "$borderColor", hoverStyle: { bg: "$hover" }, children: _jsx(Text, { fontSize: "$1", fontWeight: "600", color: "$ink", children: t("Sign in") }) }) })) : null, settled && signedIn && free ? (_jsx(Box, { ...TAP, render: "button", onClick: () => window.location.assign(payUrl("/cart", { returnUrl: window.location.href })), display: "flex", items: "center", justify: "center", cursor: "pointer", "aria-label": t("Upgrade"), "data-slot": "bar-upgrade", children: _jsxs(XStack, { items: "center", justify: "center", height: CONTROL, px: "$2.5", rounded: "$2", borderWidth: 1, borderColor: "$borderColor", gap: "$1.5", hoverStyle: { bg: "$hover" }, children: [_jsx(Sparkles, { size: 13, "aria-hidden": true, color: "var(--primary)" }), _jsx(Text, { fontSize: "$1", fontWeight: "600", color: "$ink", children: t("Upgrade") })] }) })) : null, _jsxs(XStack, { display: "none", $lg: { display: "flex" }, items: "center", gap: "$1", children: [_jsx(SidebarIconButton, { ...TAP, label: t(aside === "roster" ? "Hide directory & roster" : "Show directory & roster"), onPress: () => showAside(aside === "roster" ? null : "roster"), children: _jsx(Users, { size: 16, "aria-hidden": true }) }), _jsx(SidebarIconButton, { ...TAP, label: t(aside === "tasks" ? "Close side panel" : "Open side panel"), onPress: () => showAside(aside === "tasks" ? null : "tasks"), children: _jsx(PanelRight, { size: 16, "aria-hidden": true, "data-i18n-mirror": "" }) })] }), _jsx(WindowControls, {})] }), children: _jsx(YStack, { width: 420, maxW: "100%", position: "relative", children: _jsxs(Box, { render: "button", onClick: () => setFinding(true), display: "flex", flexDirection: "row", "data-slot": "find", items: "center", "$max-md": { justify: "center" }, gap: "$2", width: "100%", height: CONTROL, px: "$2.5", rounded: "$2", borderWidth: 1, borderColor: "$borderColor", hoverStyle: { bg: "$hover" }, children: [_jsx(SearchIcon, { size: 13, "aria-hidden": true, color: "var(--soft, var(--muted-foreground))" }), _jsx(Text, { fontSize: "$1", color: "$soft", "$max-md": { display: "none" }, children: t("Search {workspace}", { workspace }) }), _jsx(Shortcut, { keys: ["Mod", "K"], marginInlineStart: "auto", "data-i18n-ltr": "", "$max-md": { display: "none" } })] }) }) }) }), shown ? (_jsx(Box, { render: "button", "aria-label": t("Close sidebar"), onClick: dismiss, ...scrim, "data-slot": "scrim", position: "absolute", t: BAR, r: 0, b: TABS_HEIGHT, l: 0, z: "var(--z-scrim)", $md: { display: "none" } })) : null, shown ? (_jsx(XStack, { "data-slot": "list", gridArea: "list", position: asked ? "relative" : "absolute", ...(asked ? {} : { top: BAR, bottom: 0, insetInlineStart: RAIL }), "$max-md": { position: "fixed", t: BAR, r: 0, b: TABS_HEIGHT, l: 0, width: "100%" }, z: "var(--z-drawer)", bg: "$background", onMouseEnter: () => setPeeking(true), onMouseLeave: () => {
1475
1473
  if (!asked)
1476
1474
  setPeeking(false);
1477
1475
  }, children: list })) : null, _jsx(Split, { swap: settingsPane ? _jsx(Suspense, { fallback: null, children: _jsx(SettingsPane, { id: settingsPane }) }) : undefined, children: children }), finding ? (_jsx(Search, { actions: doors, onClose: found,