@hanzo/app 0.3.66 → 0.3.69

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.
Files changed (46) hide show
  1. package/dist/Account.js +1 -1
  2. package/dist/App.js +12 -5
  3. package/dist/Chat.js +82 -39
  4. package/dist/ProjectsTree.d.ts +39 -0
  5. package/dist/ProjectsTree.js +179 -0
  6. package/dist/Rail.d.ts +2 -2
  7. package/dist/Rail.js +5 -5
  8. package/dist/Recents.js +53 -10
  9. package/dist/RightPane.d.ts +10 -0
  10. package/dist/RightPane.js +18 -1
  11. package/dist/Shell.js +7 -7
  12. package/dist/Sidebar.js +12 -12
  13. package/dist/bots/Bots.d.ts +9 -2
  14. package/dist/bots/Bots.js +254 -467
  15. package/dist/bots/Make.d.ts +5 -0
  16. package/dist/bots/Make.js +60 -0
  17. package/dist/bots/Panel.d.ts +11 -0
  18. package/dist/bots/Panel.js +149 -0
  19. package/dist/bots/Roster.d.ts +11 -0
  20. package/dist/bots/Roster.js +50 -0
  21. package/dist/bots/Thread.d.ts +20 -0
  22. package/dist/bots/Thread.js +148 -0
  23. package/dist/bots/api.d.ts +27 -102
  24. package/dist/bots/api.js +26 -65
  25. package/dist/bots/carry.d.ts +18 -0
  26. package/dist/bots/carry.js +22 -0
  27. package/dist/bots/face.js +4 -4
  28. package/dist/bots/grid.d.ts +10 -0
  29. package/dist/bots/grid.js +20 -0
  30. package/dist/bots/ink.d.ts +12 -3
  31. package/dist/bots/ink.js +21 -22
  32. package/dist/bots/kit.d.ts +51 -87
  33. package/dist/bots/kit.js +21 -39
  34. package/dist/bots/refusal.d.ts +28 -0
  35. package/dist/bots/refusal.js +62 -0
  36. package/dist/bots/said.d.ts +34 -0
  37. package/dist/bots/said.js +43 -0
  38. package/dist/bots/time.d.ts +16 -0
  39. package/dist/bots/time.js +86 -0
  40. package/dist/lib/chatPreferences.d.ts +1 -1
  41. package/dist/lib/chatPreferences.js +5 -3
  42. package/dist/span.js +4 -0
  43. package/dist/thread.js +1 -1
  44. package/package.json +1 -1
  45. package/dist/bots/runtime.d.ts +0 -4
  46. package/dist/bots/runtime.js +0 -388
package/dist/Account.js CHANGED
@@ -129,7 +129,7 @@ function usePlan(org, enabled) {
129
129
  /** The person's picture, or their initials. */
130
130
  export function Face({ host, size = 28 }) {
131
131
  const p = host.person;
132
- return (_jsx(XStack, { width: size, height: size, rounded: 9999, items: "center", justify: "center", bg: "$raised", overflow: "hidden", shrink: 0, borderWidth: 1, borderColor: "$borderColor", children: p?.avatar ? (_jsx("img", { src: p.avatar, alt: "", width: size, height: size })) : (_jsx(SizableText, { size: "$1", fontWeight: "600", color: "$ink", children: initials(p?.name || p?.email || '') })) }));
132
+ return (_jsx(XStack, { width: size, height: size, rounded: 9999, items: "center", justify: "center", bg: p?.avatar ? '$raised' : 'var(--shell-avatar-bg, var(--art-ember))', overflow: "hidden", shrink: 0, borderWidth: p?.avatar ? 1 : 0, borderColor: "$borderColor", children: p?.avatar ? (_jsx("img", { src: p.avatar, alt: "", width: size, height: size })) : (_jsx(SizableText, { fontSize: Math.max(10, Math.round(size * 0.39)), lineHeight: size, fontWeight: "600", color: "var(--pure-white)", children: initials(p?.name || p?.email || '') })) }));
133
133
  }
134
134
  /** A row's face: its icon in a 20px well, its words, and what trails them. */
135
135
  function Line({ icon, children, sub, trail }) {
package/dist/App.js CHANGED
@@ -65,7 +65,7 @@ import { ArrowLeft, ArrowRight, Clapperboard, RefreshCw, Sparkles, Workflow } fr
65
65
  import { AiProvider } from '@hanzo/ai/react';
66
66
  import { XStack, YStack } from '@hanzo/gui';
67
67
  import { Button, Text } from '@hanzo/ui';
68
- import { Builder, HostProvider, PrefsProvider, route, tabs } from '@hanzo/build';
68
+ import { Builder, HostProvider, MARKS, PrefsProvider, route, tabs } from '@hanzo/build';
69
69
  import * as studioPkg from '@hanzo/studio';
70
70
  import { nav as places } from '@hanzo/studio';
71
71
  import { useAi } from './lib/ai.js';
@@ -112,8 +112,8 @@ const Hosted = lazy(() => import('./Hosted.js').then((m) => ({ default: m.Hosted
112
112
  const Betas = lazy(() => import('./Betas.js').then((m) => ({ default: m.BetasPane })));
113
113
  /** `/` is Chat on a new conversation. */
114
114
  const HOME = { mode: 'chat', thread: null };
115
- /** The bar's height, px: the reference window's title bar. */
116
- const BAR = 40;
115
+ /** The bar's height, px: the reference window's 38px top chrome bar. */
116
+ const BAR = 38;
117
117
  /** Where each mode was last, so the rail goes back to it. */
118
118
  const last = { chat: '', dev: '', studio: '', design: '', flow: '', tabs: '' };
119
119
  /** Whether a key press is the reader typing, where the app's keys are the field's. */
@@ -332,9 +332,16 @@ function Window({ bar, betas }) {
332
332
  shut();
333
333
  setFinding(true);
334
334
  };
335
- return (_jsx(AiProvider, { client: client ?? undefined, children: _jsx(HostProvider, { host: host, children: _jsx(PrefsProvider, { children: _jsx(UsageProvider, { children: _jsxs(YStack, { ref: windowRef, "data-slot": "window", ...(bar ? floor : null), flex: 1, minW: 0, height: bar ? '100%' : '100dvh', overflow: "hidden", rounded: bar ? '$3' : undefined, "$max-md": { position: 'fixed', t: TOP, l: 0, r: 0, height: HEIGHT, ...{ overflow: 'clip' } }, children: [bar ? (_jsxs(XStack, { "data-slot": "title-bar", height: BAR, shrink: 0, items: "center", gap: 2, pl: (bar.inset ?? 0) + 6, pr: "$2", onMouseDown: dragWindow, onDoubleClick: toggleWindowMaximize, ...bar.drag, children: [_jsx(XStack, { "$max-md": { display: 'none' }, children: _jsx(Toggle, { open: !closed, onPress: flip }) }), _jsx(XStack, { $md: { display: 'none' }, children: _jsx(Toggle, { open: drawer.state === 'open', onPress: drawer.open, label: t('Open sidebar') }) }), _jsx(Mark, { label: t('Back'), "data-slot": "back", onPress: () => router.back(), children: _jsx(ArrowLeft, { size: 18, "aria-hidden": true, "data-i18n-mirror": true }) }), _jsx(Mark, { label: t('Forward'), "data-slot": "forward", onPress: () => router.forward(), children: _jsx(ArrowRight, { size: 18, "aria-hidden": true, "data-i18n-mirror": true }) }), _jsx(XStack, { flex: 1, self: "stretch", ...bar.drag }), bar.controls !== undefined ? (bar.controls) : !bar.inset ? (_jsx(WindowControls, {})) : null] })) : null, _jsxs(XStack, { ref: drawer.pane, "data-app": mode, "data-slot": "frame", ...(bar ? null : floor), ...drawer.slide, flex: 1, minW: 0, minH: 0, paddingInlineEnd: "var(--pane-gap)", pb: "var(--pane-gap)",
335
+ return (_jsx(AiProvider, { client: client ?? undefined, children: _jsx(HostProvider, { host: host, children: _jsx(PrefsProvider, { children: _jsx(UsageProvider, { children: _jsxs(YStack, { ref: windowRef, "data-slot": "window", ...(bar ? floor : null), flex: 1, minW: 0, height: bar ? '100%' : '100dvh', overflow: "hidden", rounded: bar ? '$3' : undefined, "$max-md": { position: 'fixed', t: TOP, l: 0, r: 0, height: HEIGHT, ...{ overflow: 'clip' } }, children: [_jsxs(XStack, { "data-slot": "title-bar", height: BAR, shrink: 0, items: "center", bg: "var(--shell-bar-bg, var(--secondary))", borderBottomWidth: 1, borderColor: "var(--shell-bar-border, var(--border))", "$max-md": bar ? undefined : { display: 'none' }, onMouseDown: bar ? dragWindow : undefined, onDoubleClick: bar ? toggleWindowMaximize : undefined, ...(bar?.drag ?? null), children: [_jsxs(XStack, { "data-slot": "title-bar-start", height: "100%", items: "center", gap: 2, pl: (bar?.inset ?? 0) + 8, pr: 8, shrink: 0, width: closed ? 44 : 'calc(44px + var(--app-sidebar-span, 240px))', borderRightWidth: closed ? 0 : 1, borderColor: "var(--shell-bar-border, var(--border))", ...(bar?.drag ?? null), children: [_jsx(XStack, { $md: { display: 'none' }, children: _jsx(Toggle, { open: drawer.state === 'open', onPress: drawer.open, label: t('Open sidebar') }) }), _jsx(Mark, { label: t('Back'), "data-slot": "back", onPress: () => router.back(), children: _jsx(ArrowLeft, { size: 15, "aria-hidden": true, "data-i18n-mirror": true }) }), _jsx(Mark, { label: t('Forward'), "data-slot": "forward", onPress: () => router.forward(), children: _jsx(ArrowRight, { size: 15, "aria-hidden": true, "data-i18n-mirror": true }) }), _jsx(XStack, { "$max-md": { display: 'none' }, children: _jsx(Toggle, { open: !closed, onPress: flip }) })] }), _jsxs(XStack, { id: "hanzo-titlebar-slot", "data-slot": "title-bar-main", flex: 1, minW: 0, self: "stretch", items: "center", justify: "space-between", pl: 14, pr: 10, gap: 6, ...(bar?.drag ?? null), children: [_jsxs(XStack, { "data-slot": "titlebar-fallback", flex: 1, minW: 0, items: "center", justify: "space-between", gap: 8, children: [_jsx(Text, { fontSize: 13, lineHeight: 18, fontWeight: "500", color: "$ink", numberOfLines: 1, children: mode === 'chat' ? '' : mode === 'dev' ? 'Dev' : mode === 'studio' ? 'Studio' : mode === 'design' ? 'Design' : mode === 'flow' ? 'Flow' : mode === 'tabs' ? 'Tabs' : '' }), _jsx(XStack, { items: "center", gap: 2, "data-tauri-drag-region": "false", children: _jsx(Mark, { label: mode === 'dev' ? t('New run') : t('New chat'), "data-slot": "titlebar-new", onPress: () => {
336
+ if (mode === 'dev')
337
+ host.go('');
338
+ else {
339
+ empty();
340
+ move(talk());
341
+ }
342
+ }, children: mode === 'dev' ? _jsx(MARKS.dev.make, { size: 15, "aria-hidden": true }) : _jsx(MARKS.chat.make, { size: 15, "aria-hidden": true }) }) })] }), bar ? (bar.controls !== undefined ? (bar.controls) : !bar.inset ? (_jsx(WindowControls, {})) : null) : null] })] }), _jsxs(XStack, { ref: drawer.pane, "data-app": mode, "data-slot": "frame", ...(bar ? null : floor), ...drawer.slide, flex: 1, minW: 0, minH: 0, paddingInlineEnd: "var(--pane-gap)", pb: "var(--pane-gap)",
336
343
  // The gap above the pane is the gap at its end and foot; a window's own bar above it is that gap.
337
- pt: bar ? 0 : 'var(--pane-gap)', "$max-md": { p: 0 }, children: [drawer.slide ? _jsx(Lift, {}) : null, _jsxs(YStack, { height: "100%", position: "relative", "$max-md": { display: 'none' }, children: [_jsx(Rail, { host: host, mode: mode, at: where, inside: inside, open: !closed, toggle: bar ? undefined : flip, onChat: toChat, onDev: toDev, onDesign: toDesign, onStudio: toStudio, onTabs: toTabs, go: move, onOrg: org }), closed ? (_jsx(YStack, { "data-slot": "sidebar-reopen-edge", position: "absolute", t: 0, b: 0, r: -4, width: 8, z: 20, cursor: "ew-resize", onDoubleClick: () => setClosed(false), onMouseDown: (down) => {
344
+ pt: bar ? 0 : 'var(--pane-gap)', "$max-md": { p: 0 }, children: [drawer.slide ? _jsx(Lift, {}) : null, _jsxs(YStack, { height: "100%", position: "relative", "$max-md": { display: 'none' }, children: [_jsx(Rail, { host: host, mode: mode, at: where, inside: inside, open: !closed, onChat: toChat, onDev: toDev, onDesign: toDesign, onStudio: toStudio, onTabs: toTabs, go: move, onOrg: org }), closed ? (_jsx(YStack, { "data-slot": "sidebar-reopen-edge", position: "absolute", t: 0, b: 0, r: -4, width: 8, z: 20, cursor: "ew-resize", onDoubleClick: () => setClosed(false), onMouseDown: (down) => {
338
345
  const e = down;
339
346
  const startX = e.clientX ?? 0;
340
347
  const onMove = (mv) => {
package/dist/Chat.js CHANGED
@@ -28,12 +28,13 @@ import { Fragment as _Fragment, jsx as _jsx, jsxs as _jsxs } from "react/jsx-run
28
28
  // belongs in the thread where the reader can see it, not in a caption that
29
29
  // pre-emptively refuses on the gateway's behalf.
30
30
  import { useCallback, useEffect, useMemo, useRef, useState } from "react";
31
+ import { createPortal } from "react-dom";
31
32
  import { english, isolate, phrase } from "@hanzo/i18n";
32
33
  import { useI18n } from "@hanzo/i18n/react";
33
34
  import { billed, detail, familyOf, ours, planRequired, plainly, refused } from "./failure.js";
34
35
  import { Prose } from "./Prose.js";
35
36
  import { useAgent, useAi, useChat, } from "@hanzo/ai/react";
36
- import { Chat as ChatSurface, EFFORTS, Failure, MEASURE, Parts, useFamilies, words } from "@hanzo/ui/chat";
37
+ import { Chat as ChatSurface, EFFORTS, Failure, Parts, Tune, useFamilies, words } from "@hanzo/ui/chat";
37
38
  import { carriedIn, carrying, compose, partsOf, said as told, weigh } from "./lib/attach.js";
38
39
  import { download, dropped, fileOf, pct, readable, refOf, retrieve } from "./lib/files.js";
39
40
  import { conversation, drop, hold, landed, localOf, spend, take, usePane, useWorkFile } from "./pane.js";
@@ -57,13 +58,13 @@ import { useHydrated } from "./lib/hydrated.js";
57
58
  import { base, served } from "./lib/ai.js";
58
59
  import { onServed } from "./lib/served.js";
59
60
  import { refused as worded, speech, useDictation, useTalk, useVoice } from "@hanzo/voice";
60
- import { Check, FileText, Ghost, Image as ImageMark, Library as LibraryMark, Paperclip, Sparkles, X } from "lucide-react";
61
+ import { Check, ChevronDown, CircleAlert, Copy, FileText, Ghost, Image as ImageMark, Library as LibraryMark, Paperclip, Sparkles, SquarePlus, X } from "lucide-react";
61
62
  import { ENSO } from "./lib/ai.js";
62
63
  import { openThread, empty as emptyOpen, useOpen } from "./open.js";
63
64
  import { Side } from "./Shell.js";
64
- import { SEED, look, useSections, useSites } from "./RightPane.js";
65
+ import { ContextCard, SEED, look, useSections, useSites } from "./RightPane.js";
65
66
  import { Share } from "./Share.js";
66
- import { ConversationMenu, useThreadActions, useThreadList } from "./thread.js";
67
+ import { ConversationMenu, ThreadMore, useThreadActions, useThreadList } from "./thread.js";
67
68
  import { Schedule } from "./Schedule.js";
68
69
  import { keepFile, useAttach, useKeep } from "./keep.js";
69
70
  import { useKept } from "./kept.js";
@@ -76,7 +77,6 @@ import { first } from './lib/first.js';
76
77
  import { BAD } from "./lib/mix.js";
77
78
  import { brand } from './where.js';
78
79
  import { BAND, HEAD, inPane, INSET, TOUCH_HEAD } from './ground.js';
79
- import { UsageControl } from './Usage.js';
80
80
  import { shared, useChatPreferences } from './lib/chatPreferences.js';
81
81
  import { handleHint } from './hint.js';
82
82
  // NO REASONING PANEL HERE. Every assistant turn opened a "Thinking" disclosure
@@ -106,6 +106,26 @@ import { handleHint } from './hint.js';
106
106
  * since.
107
107
  */
108
108
  const MAX_ANON_TURNS = 3;
109
+ function extractWritingTurn(text) {
110
+ const trimmed = text.trim();
111
+ if (!trimmed)
112
+ return null;
113
+ const fenced = trimmed.match(/^```(?:writing|markdown|md|text)\s*\n([\s\S]*?)\n```\s*$/i);
114
+ if (fenced)
115
+ return fenced[1]?.trim() || null;
116
+ if (!trimmed.includes("```") && trimmed.includes("\n\n"))
117
+ return trimmed;
118
+ return null;
119
+ }
120
+ function WritingCard({ text, label, copyLabel, copiedLabel, }) {
121
+ const [copied, setCopied] = useState(false);
122
+ return (_jsxs(YStack, { "data-slot": "writing-card", width: "100%", rounded: 14, borderWidth: 1, borderColor: "var(--writing-border, var(--border-strong))", overflow: "hidden", children: [_jsxs(XStack, { "data-slot": "writing-head", height: 36, px: 16, items: "center", justify: "space-between", bg: "var(--writing-head-bg, var(--surface-3))", borderBottomWidth: 1, borderColor: "var(--writing-divider, var(--border))", children: [_jsx(Text, { fontSize: 12, lineHeight: 16, fontWeight: "500", color: "var(--shell-section-fg, var(--muted-foreground))", children: label }), _jsx(Box, { render: "button", "data-slot": "writing-copy", "aria-label": copied ? copiedLabel : copyLabel, title: copied ? copiedLabel : copyLabel, width: 26, height: 26, rounded: 6, items: "center", justify: "center", cursor: "pointer", hoverStyle: { bg: "$hover" }, onClick: () => {
123
+ void navigator.clipboard?.writeText(text).then(() => {
124
+ setCopied(true);
125
+ setTimeout(() => setCopied(false), 1600);
126
+ });
127
+ }, children: copied ? (_jsx(Check, { size: 14, color: "var(--foreground)", "aria-hidden": true })) : (_jsx(Copy, { size: 14, color: "var(--shell-section-fg, var(--muted-foreground))", "aria-hidden": true })) })] }), _jsx(YStack, { px: 18, py: 16, bg: "var(--writing-body-bg, var(--surface-2))", children: _jsx(Prose, { text: text }) })] }));
128
+ }
109
129
  function synthesizeAnonReply(prompt) {
110
130
  const q = prompt.trim();
111
131
  const lower = q.toLowerCase();
@@ -1791,6 +1811,13 @@ function Thread({ placeholder = message(), initial, anonymous = false, settled =
1791
1811
  }
1792
1812
  }, [initial, open, anonymous, settled, sendAnon]);
1793
1813
  const families = useFamilies(mind, (id) => setAsk({ model: nameOf(id, listed) }));
1814
+ const [titlebarSlot, setTitlebarSlot] = useState(null);
1815
+ useEffect(() => {
1816
+ if (typeof document === "undefined")
1817
+ return;
1818
+ setTitlebarSlot(document.getElementById("hanzo-titlebar-slot"));
1819
+ }, [media.md]);
1820
+ const inTopChrome = Boolean(media.md && titlebarSlot);
1794
1821
  const composer = {
1795
1822
  value: draft,
1796
1823
  onChange: setDraft,
@@ -1799,15 +1826,28 @@ function Thread({ placeholder = message(), initial, anonymous = false, settled =
1799
1826
  busy: chat.streaming || anonBusy,
1800
1827
  // Files alone are a message: what is held goes with an empty draft too.
1801
1828
  ready: Boolean(draft.trim() || files.length),
1802
- // `label` keeps the accessible name constant; the placeholder is the composer's own
1803
- // (the defaults @hanzo/ui and @hanzo/build each call ASK), said here so both are the reader's.
1829
+ // `label` keeps the accessible name constant; the placeholder matches the desktop workspace prompt.
1804
1830
  label: t("Ask anything"),
1805
- placeholder: t("Type / for skills"),
1831
+ placeholder: t("Work with {brand}", { brand: brand() }),
1806
1832
  // At the thread's measure.
1807
1833
  column: true,
1808
1834
  // Private: the frame drops its ground and dashes its edge (@hanzo/ui ≥ 8.29.40); the
1809
1835
  // toggled ghost in the head and this frame are the whole of what says it.
1810
1836
  forgetful,
1837
+ children: anonymous ? undefined : (_jsxs(XStack, { flex: 1, minW: 0, items: "center", justify: "space-between", gap: 6, children: [_jsxs(XStack, { render: "button", "data-slot": "composer-access-mode", "data-mode": chatPrefs.approvalMode === "manual" ? "manual" : "auto", "aria-label": chatPrefs.approvalMode === "manual" ? t("Manual approval") : t("Full access"), items: "center", gap: 5, height: 28, px: 6, rounded: 8, cursor: "pointer", hoverStyle: { bg: "$hover" }, onPress: () => {
1838
+ const next = chatPrefs.approvalMode === "manual" ? "auto" : "manual";
1839
+ setChatPrefs({ approvalMode: next });
1840
+ carry.mode.set(next);
1841
+ }, children: [_jsx(CircleAlert, { size: 14, strokeWidth: 1.9, color: chatPrefs.approvalMode === "manual" ? "var(--shell-section-fg, var(--muted-foreground))" : "var(--composer-full-access, var(--art-ember))", "aria-hidden": true }), _jsx(Text, { fontSize: 12.5, lineHeight: 16, fontWeight: "500", color: chatPrefs.approvalMode === "manual" ? "var(--shell-section-fg, var(--muted-foreground))" : "var(--composer-full-access, var(--art-ember))", numberOfLines: 1, children: chatPrefs.approvalMode === "manual" ? t("Manual approval") : t("Full access") })] }), _jsxs(XStack, { items: "center", gap: 2, shrink: 0, children: [_jsx(Tune, { mind: { ...mind, models: filteredListed }, effort: {
1842
+ value: chatPrefs.effort || "auto",
1843
+ set: (eff) => {
1844
+ setChatPrefs({ effort: eff });
1845
+ const next = shared(eff);
1846
+ if (next)
1847
+ mind.pace(next);
1848
+ },
1849
+ items: EFFORTS,
1850
+ }, mode: null, limits: limits, onUpgrade: (id) => setAsk({ model: nameOf(id, listed) }) }), _jsx(ChevronDown, { size: 12, color: "var(--shell-section-fg, var(--muted-foreground))", "aria-hidden": true })] })] })),
1811
1851
  // A file or an image pasted into the field is held like a picked one;
1812
1852
  // words paste as words.
1813
1853
  field: {
@@ -1891,35 +1931,13 @@ function Thread({ placeholder = message(), initial, anonymous = false, settled =
1891
1931
  ],
1892
1932
  slash: carry.skills,
1893
1933
  at: carry.plugins,
1894
- // The mode is Auto or Manual approval, the one Settings keeps; the person
1895
- // turns the pill on in Settings → Appearance, and it is off until they do.
1896
- mode: anonymous
1897
- ? null
1898
- : {
1899
- ...carry.mode,
1900
- set: (m) => {
1901
- const approval = m === "manual" ? "manual" : "auto";
1902
- setChatPrefs({ approvalMode: approval });
1903
- carry.mode.set(approval);
1904
- },
1905
- },
1906
- // The model, only where the person turned the model selector on; the effort, always.
1907
- // The picker lists what the person has turned on: third-party models (paid from the balance) unless they turned them off.
1908
- mind: anonymous ? null : { ...mind, models: filteredListed },
1909
- effort: {
1910
- value: chatPrefs.effort || "auto",
1911
- set: (eff) => {
1912
- setChatPrefs({ effort: eff });
1913
- const next = shared(eff);
1914
- if (next)
1915
- mind.pace(next);
1916
- },
1917
- items: EFFORTS,
1918
- },
1919
- // Chat keeps to the effort alone until the person asks for more: the family chips, the mode, the model.
1934
+ // Inline controls live inside the composer's bottom strip (`children` above), so the outer foot stays empty.
1935
+ mode: null,
1936
+ mind: null,
1937
+ effort: undefined,
1920
1938
  chips: anonymous ? undefined : families,
1921
1939
  defaults: { chips: false, mode: false, model: false },
1922
- status: anonymous ? null : _jsx(UsageControl, { read: planUsage, context: { model, window: rowOf(model)?.context_window, messages: chat.messages, draft, tools: !anonymous && carry.gear.gear.research && house(rowOf(model)?.family) ? WEB : undefined } }),
1940
+ status: null,
1923
1941
  limits,
1924
1942
  onUpgrade: (id) => setAsk({ model: nameOf(id, listed) }),
1925
1943
  voice,
@@ -1971,7 +1989,31 @@ function Thread({ placeholder = message(), initial, anonymous = false, settled =
1971
1989
  }, children: [_jsx(Schedule, { open: plan !== null, onOpenChange: (open) => {
1972
1990
  if (!open)
1973
1991
  setPlan(null);
1974
- }, 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", group: true,
1992
+ }, 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, inTopChrome && titlebarSlot
1993
+ ? createPortal(_jsxs(XStack, { "data-slot": "chat-titlebar-portal", flex: 1, minW: 0, items: "center", justify: "space-between", gap: 8, children: [_jsx(XStack, { items: "center", gap: "$2", minW: 0, flex: 1, "data-tauri-drag-region": "false", children: editingTitle && shownTitle ? (_jsx(Input, { "data-slot": "conversation-title-input", "aria-label": t("Chat title"), value: titleDraft, autoFocus: true, maxLength: 200, size: "sm", minW: 160, maxW: 360, onChangeText: setTitleDraft, onBlur: commitTitle, onKeyDown: (e) => {
1994
+ e.stopPropagation?.();
1995
+ if (e.key === "Enter") {
1996
+ e.preventDefault?.();
1997
+ commitTitle();
1998
+ }
1999
+ else if (e.key === "Escape") {
2000
+ e.preventDefault?.();
2001
+ setEditingTitle(false);
2002
+ }
2003
+ } })) : shownTitle ? (_jsx(XStack, { render: "button", "data-slot": "conversation-title", "aria-label": shownTitle, items: "center", gap: "$1.5", px: "$1.5", py: "$0.5", rounded: "$2", minW: 0, shrink: 1, cursor: "pointer", hoverStyle: { bg: "$hover" }, onPress: () => {
2004
+ setTitleDraft(shownTitle);
2005
+ setEditingTitle(true);
2006
+ }, children: _jsx(Text, { fontSize: 13, lineHeight: 18, fontWeight: "500", color: "$ink", numberOfLines: 1, shrink: 1, minW: 0, children: shownTitle }) })) : null }), _jsxs(XStack, { "data-slot": "conversation-controls", "data-tauri-drag-region": "false", items: "center", gap: 2, shrink: 0, children: [anonymous ? (_jsxs(XStack, { items: "center", gap: "$2", children: [_jsx(Button, { size: "xs", variant: "outline", rounded: 9999, px: "$3", "data-slot": "header-login", onPress: () => {
2007
+ if (typeof window !== "undefined")
2008
+ window.location.assign("/login?next=%2Fchat");
2009
+ }, children: t("Log in") }), _jsx(Button, { size: "xs", rounded: 9999, px: "$3", "data-slot": "header-signup", onPress: () => {
2010
+ if (typeof window !== "undefined")
2011
+ window.location.assign("/signup?next=%2Fchat");
2012
+ }, children: t("Sign up for free") })] })) : 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(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: 28, height: 28, 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: 15, 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(Summary, { sections: sections, onOpen: () => setPanel(true), label: t("Summary") }), _jsx(PanelToggle, { open: panel, onToggle: () => setPanel(!panel) }), _jsx(XStack, { render: "button", "data-slot": "titlebar-new-chat", "aria-label": t("New chat"), ...{ title: t("New chat") }, width: 28, height: 28, items: "center", justify: "center", rounded: "$3", bg: "transparent", cursor: "pointer", opacity: 0.78, hoverStyle: { bg: "$hover", opacity: 1 }, onPress: () => {
2013
+ emptyOpen();
2014
+ go("/chat");
2015
+ }, children: _jsx(SquarePlus, { size: 15, strokeWidth: 1.75, "aria-hidden": true }) })] })] }), titlebarSlot)
2016
+ : null, inTopChrome && !cast.length ? null : (_jsxs(XStack, { "data-slot": "conversation-head", group: true,
1975
2017
  // On the rail's line from a tablet up; a phone's own bar is BAND.
1976
2018
  height: BAND, $md: { height: inPane(HEAD) }, $touchable: { height: inPane(TOUCH_HEAD) }, display: "grid", gridTemplateColumns: "minmax(0, 1fr) auto", items: "center", gap: "$3", paddingInlineStart: INSET - 8,
1977
2019
  // The last mark's centre INSET from the pane's end edge, as the rail's first is from the
@@ -1998,7 +2040,7 @@ function Thread({ placeholder = message(), initial, anonymous = false, settled =
1998
2040
  }, 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: () => {
1999
2041
  if (typeof window !== "undefined")
2000
2042
  window.location.assign("/signup?next=%2Fchat");
2001
- }, 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") }) }), _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,
2043
+ }, 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) }) }))] })] })), !panel && !anonymous ? (_jsx(Box, { "data-slot": "context-card-dock", display: "none", $xl: { display: "flex" }, position: "absolute", t: 12, r: 16, z: 4, children: _jsx(ContextCard, { at: at, sections: sections, onCreate: create, onOpenPanel: () => setPanel(true) }) })) : null, 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,
2002
2044
  // WHILE NOTHING HAS BEEN SAID, from a tablet up, the opening and the
2003
2045
  // composer are one pair centred in the pane (`center`: rows `1fr auto auto
2004
2046
  // 1fr`), so the heading reads close above the field and nothing stands at
@@ -2062,7 +2104,8 @@ function Thread({ placeholder = message(), initial, anonymous = false, settled =
2062
2104
  : [];
2063
2105
  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)] }));
2064
2106
  }
2065
- return (_jsxs(YStack, { gap: "$1", "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] }));
2107
+ const writingBody = turn.role === "assistant" && said ? extractWritingTurn(said) : null;
2108
+ return (_jsxs(YStack, { gap: "$1.5", "data-turn-id": String(turn.id), "data-turn-role": turn.role, children: [writingBody ? (_jsx(WritingCard, { text: writingBody, label: t("Writing"), copyLabel: t("Copy"), copiedLabel: t("Copied") })) : (_jsx(Prose, { text: said })), turn.role === "assistant" && said ? (_jsx(Reply, { text: writingBody ?? 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] }));
2066
2109
  },
2067
2110
  // The page's ONE heading, and it belongs to the empty transcript rather
2068
2111
  // than to a signed-out branch — the branch is gone, and the heading went
@@ -2072,7 +2115,7 @@ function Thread({ placeholder = message(), initial, anonymous = false, settled =
2072
2115
  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] })),
2073
2116
  // The transcript reads at the same measure. `Thread` defaults to 768
2074
2117
  // itself; handing it the column here is what lets Width reach it.
2075
- column: { maxW: MEASURE }, 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: [
2118
+ 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: [
2076
2119
  ["Go", "Pro"],
2077
2120
  ["Dev", "Max"],
2078
2121
  ].flat().map((label) => (_jsx(XStack, { render: "button", onPress: () => {
@@ -0,0 +1,39 @@
1
+ import type { Thread } from '@hanzo/ai';
2
+ import { type Recent } from './recent.js';
3
+ export interface ProjectFolder {
4
+ id: string;
5
+ name: string;
6
+ }
7
+ export interface StoredChatProjects {
8
+ folders: ProjectFolder[];
9
+ open: Record<string, boolean>;
10
+ assigned: Record<string, string>;
11
+ }
12
+ export declare const EMPTY_CHAT_PROJECTS: StoredChatProjects;
13
+ export declare function normalizeProjectSlug(raw: string): string;
14
+ export declare function readStoredChatProjects(raw: unknown): StoredChatProjects;
15
+ export declare function mergeProjectFolders(remote: ProjectFolder[], local: ProjectFolder[]): ProjectFolder[];
16
+ export declare function groupThreadsByProject(rows: Recent[], folders: ProjectFolder[], assigned: Record<string, string>): {
17
+ byFolder: Map<string, Recent[]>;
18
+ filedIds: Set<string>;
19
+ };
20
+ export declare function hasUnreadUpdate(rowId: string, updatedAt: string | number | undefined, activeId: string | null, seenAt: Record<string, number>): boolean;
21
+ export declare function useChatProjects(rows: Recent[]): {
22
+ folders: ProjectFolder[];
23
+ openMap: Record<string, boolean>;
24
+ byFolder: Map<string, Recent[]>;
25
+ filedIds: Set<string>;
26
+ toggleFolder: (id: string) => void;
27
+ createFolder: (name: string) => void;
28
+ };
29
+ export declare function ProjectsTree({ folders, openMap, byFolder, threads, activeId, onToggle, onCreate, onOpen, onNew, }: {
30
+ folders: ProjectFolder[];
31
+ openMap: Record<string, boolean>;
32
+ byFolder: Map<string, Recent[]>;
33
+ threads: Map<string, Thread>;
34
+ activeId: string | null;
35
+ onToggle: (id: string) => void;
36
+ onCreate: (name: string) => void;
37
+ onOpen: (row: Recent) => void;
38
+ onNew: () => void;
39
+ }): import("react").JSX.Element;
@@ -0,0 +1,179 @@
1
+ 'use client';
2
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
3
+ import { useEffect, useMemo, useState } from 'react';
4
+ import { useI18n } from '@hanzo/i18n/react';
5
+ import { SizableText, XStack, YStack } from '@hanzo/gui';
6
+ import { Folder, FolderOpen, Plus } from 'lucide-react';
7
+ import { Button, Dialog, DialogContent, DialogTitle, Input } from '@hanzo/ui';
8
+ import { SidebarItem } from '@hanzo/ui/chat';
9
+ import { useKept } from './kept.js';
10
+ import { api } from './lib/api.js';
11
+ import { list } from './lib/list.js';
12
+ import { scope } from './lib/session.js';
13
+ import { UNTITLED } from './recent.js';
14
+ import { ConversationMenu, ThreadRow } from './thread.js';
15
+ export const EMPTY_CHAT_PROJECTS = {
16
+ folders: [],
17
+ open: {},
18
+ assigned: {},
19
+ };
20
+ export function normalizeProjectSlug(raw) {
21
+ return raw
22
+ .trim()
23
+ .toLowerCase()
24
+ .replace(/^[^/]+\//, '')
25
+ .replace(/[^a-z0-9._-]+/g, '-')
26
+ .replace(/^-+|-+$/g, '');
27
+ }
28
+ export function readStoredChatProjects(raw) {
29
+ if (!raw || typeof raw !== 'object')
30
+ return EMPTY_CHAT_PROJECTS;
31
+ const obj = raw;
32
+ const folders = Array.isArray(obj.folders)
33
+ ? obj.folders.filter((f) => Boolean(f && typeof f === 'object' && typeof f.id === 'string' && f.id && typeof f.name === 'string' && f.name.trim()))
34
+ : [];
35
+ const open = obj.open && typeof obj.open === 'object' ? obj.open : {};
36
+ const assigned = obj.assigned && typeof obj.assigned === 'object' ? obj.assigned : {};
37
+ return { folders, open, assigned };
38
+ }
39
+ export function mergeProjectFolders(remote, local) {
40
+ const seen = new Set();
41
+ const out = [];
42
+ for (const item of [...local, ...remote]) {
43
+ const key = normalizeProjectSlug(item.id || item.name);
44
+ if (!key || seen.has(key))
45
+ continue;
46
+ seen.add(key);
47
+ out.push({ id: key, name: item.name.trim() });
48
+ }
49
+ return out;
50
+ }
51
+ export function groupThreadsByProject(rows, folders, assigned) {
52
+ const byFolder = new Map();
53
+ const byKey = new Map();
54
+ for (const folder of folders) {
55
+ byFolder.set(folder.id, []);
56
+ byKey.set(normalizeProjectSlug(folder.id), folder.id);
57
+ byKey.set(normalizeProjectSlug(folder.name), folder.id);
58
+ }
59
+ const filedIds = new Set();
60
+ for (const row of rows) {
61
+ const explicit = assigned[row.id] ? normalizeProjectSlug(assigned[row.id]) : '';
62
+ const implicit = row.project ? normalizeProjectSlug(row.project) : '';
63
+ const target = (explicit && byKey.get(explicit)) || (implicit && byKey.get(implicit)) || null;
64
+ if (!target)
65
+ continue;
66
+ byFolder.get(target)?.push(row);
67
+ filedIds.add(row.id);
68
+ }
69
+ return { byFolder, filedIds };
70
+ }
71
+ export function hasUnreadUpdate(rowId, updatedAt, activeId, seenAt) {
72
+ if (!updatedAt || rowId === activeId)
73
+ return false;
74
+ const stamp = typeof updatedAt === 'number' ? updatedAt : Date.parse(updatedAt);
75
+ if (!Number.isFinite(stamp) || stamp <= 0)
76
+ return false;
77
+ const seen = seenAt[rowId];
78
+ return typeof seen === 'number' && stamp > seen;
79
+ }
80
+ function useRemoteProjectFolders() {
81
+ const [remote, setRemote] = useState([]);
82
+ useEffect(() => {
83
+ const stop = new AbortController();
84
+ const headers = scope();
85
+ Promise.all([
86
+ fetch(`${api()}/v1/git/repos`, { headers, signal: stop.signal })
87
+ .then((r) => (r.ok ? r.json() : null))
88
+ .catch(() => null),
89
+ fetch(`${api()}/v1/project`, { headers, signal: stop.signal })
90
+ .then((r) => (r.ok ? r.json() : null))
91
+ .catch(() => null),
92
+ ]).then(([reposBody, projectsBody]) => {
93
+ if (stop.signal.aborted)
94
+ return;
95
+ const repoRows = list(Array.isArray(reposBody) ? reposBody : reposBody?.data ?? reposBody?.repos);
96
+ const projRows = list(Array.isArray(projectsBody) ? projectsBody : projectsBody?.data ?? projectsBody?.projects);
97
+ const collected = [];
98
+ for (const r of [...repoRows, ...projRows]) {
99
+ const name = (r?.name || r?.slug || '').trim();
100
+ const id = normalizeProjectSlug(r?.slug || name);
101
+ if (id && name)
102
+ collected.push({ id, name });
103
+ }
104
+ setRemote(collected);
105
+ });
106
+ return () => stop.abort();
107
+ }, []);
108
+ return remote;
109
+ }
110
+ export function useChatProjects(rows) {
111
+ const [raw, save] = useKept('hanzo.chat.projects.v1', EMPTY_CHAT_PROJECTS);
112
+ const stored = useMemo(() => readStoredChatProjects(raw), [raw]);
113
+ const remote = useRemoteProjectFolders();
114
+ const folders = useMemo(() => mergeProjectFolders(remote, stored.folders), [remote, stored.folders]);
115
+ const grouped = useMemo(() => groupThreadsByProject(rows, folders, stored.assigned), [rows, folders, stored.assigned]);
116
+ const toggleFolder = (id) => {
117
+ save({
118
+ ...stored,
119
+ open: { ...stored.open, [id]: !stored.open[id] },
120
+ });
121
+ };
122
+ const createFolder = (name) => {
123
+ const trimmed = name.trim();
124
+ const id = normalizeProjectSlug(trimmed);
125
+ if (!id || !trimmed)
126
+ return;
127
+ const exists = stored.folders.some((f) => normalizeProjectSlug(f.id) === id);
128
+ save({
129
+ ...stored,
130
+ folders: exists ? stored.folders : [...stored.folders, { id, name: trimmed }],
131
+ open: { ...stored.open, [id]: true },
132
+ });
133
+ };
134
+ return {
135
+ folders,
136
+ openMap: stored.open,
137
+ byFolder: grouped.byFolder,
138
+ filedIds: grouped.filedIds,
139
+ toggleFolder,
140
+ createFolder,
141
+ };
142
+ }
143
+ export function ProjectsTree({ folders, openMap, byFolder, threads, activeId, onToggle, onCreate, onOpen, onNew, }) {
144
+ const { t } = useI18n();
145
+ const [creating, setCreating] = useState(false);
146
+ const [draft, setDraft] = useState('');
147
+ const submit = () => {
148
+ const next = draft.trim();
149
+ if (!next)
150
+ return;
151
+ onCreate(next);
152
+ setDraft('');
153
+ setCreating(false);
154
+ };
155
+ return (_jsxs(YStack, { "data-slot": "chat-projects", gap: 1, pt: "$2", children: [_jsxs(XStack, { group: true, items: "center", justify: "space-between", height: 26, paddingInlineStart: "$2", paddingInlineEnd: "$1", shrink: 0, children: [_jsx(SizableText, { fontSize: 11.5, lineHeight: 16, fontWeight: "500", color: "var(--shell-section-fg, var(--muted-foreground))", children: t('Projects') }), _jsx(XStack, { render: "button", "data-slot": "chat-project-add", "aria-label": t('New project'), ...{ title: t('New project') }, width: 22, height: 22, rounded: "$2", items: "center", justify: "center", cursor: "pointer", opacity: folders.length === 0 ? 0.72 : 0, "$group-hover": { opacity: 1 }, focusStyle: { opacity: 1 }, $touchable: { opacity: 1 }, hoverStyle: { bg: '$hover', opacity: 1 }, onPress: () => setCreating(true), children: _jsx(Plus, { size: 13, color: "var(--shell-section-fg, var(--muted-foreground))", "aria-hidden": true }) })] }), folders.length > 0 ? (_jsx(ConversationMenu, { threads: threads, active: activeId, onGone: onNew, primary: false, children: _jsx(YStack, { role: "list", "aria-label": t('Projects'), gap: 1, children: folders.map((folder) => {
156
+ const expanded = Boolean(openMap[folder.id]);
157
+ const children = byFolder.get(folder.id) ?? [];
158
+ return (_jsxs(YStack, { role: "listitem", gap: 1, children: [_jsx(SidebarItem, { "data-slot": "project-folder", "data-project-id": folder.id, "aria-expanded": expanded, rounded: 8, minH: 28, py: 0, px: "$2", $touchable: { minH: 40 }, icon: _jsx(XStack, { width: 18, height: 18, items: "center", justify: "center", shrink: 0, children: expanded ? (_jsx(FolderOpen, { size: 15, strokeWidth: 1.75, color: "var(--shell-icon-fg, var(--muted-foreground))", "aria-hidden": true })) : (_jsx(Folder, { size: 15, strokeWidth: 1.75, color: "var(--shell-icon-fg, var(--muted-foreground))", "aria-hidden": true })) }), onPress: () => onToggle(folder.id), onKeyDown: (e) => {
159
+ if (e.key !== 'Enter' && e.key !== ' ')
160
+ return;
161
+ e.preventDefault?.();
162
+ onToggle(folder.id);
163
+ }, children: _jsx(SizableText, { fontSize: 13, lineHeight: 18, color: "var(--shell-row-fg, var(--foreground))", numberOfLines: 1, display: "block", children: folder.name }) }), expanded ? (children.length > 0 ? (_jsx(YStack, { role: "list", "aria-label": folder.name, gap: 1, children: children.map((child) => {
164
+ const threadObj = threads.get(child.id);
165
+ const isOpen = child.id === activeId;
166
+ const labelText = child.title === UNTITLED ? t(UNTITLED) : child.title;
167
+ const item = (_jsx(SidebarItem, { "data-slot": "project-thread", active: isOpen, rounded: 8, minH: 27, py: 0, paddingInlineStart: 28, paddingInlineEnd: "$6", $touchable: { minH: 40, paddingInlineEnd: 48 }, onPress: () => onOpen(child), onKeyDown: (e) => {
168
+ if (e.key !== 'Enter' && e.key !== ' ')
169
+ return;
170
+ e.preventDefault?.();
171
+ onOpen(child);
172
+ }, children: _jsx(SizableText, { fontSize: 13, lineHeight: 18, color: isOpen ? 'var(--shell-row-active-fg, var(--text-primary))' : 'var(--shell-subrow-fg, var(--text-secondary))', numberOfLines: 1, display: "block", children: labelText }) }));
173
+ return threadObj ? (_jsx(ThreadRow, { t: threadObj, active: isOpen, children: item }, child.id)) : (_jsx(YStack, { role: "listitem", children: item }, child.id));
174
+ }) })) : (_jsx(XStack, { height: 25, items: "center", paddingInlineStart: 28, paddingInlineEnd: "$2", "data-slot": "project-empty", children: _jsx(SizableText, { fontSize: 12.5, lineHeight: 17, color: "var(--shell-muted-fg, var(--text-tertiary))", numberOfLines: 1, children: t('No chats') }) }))) : null] }, folder.id));
175
+ }) }) })) : null, _jsx(Dialog, { open: creating, onOpenChange: setCreating, children: _jsxs(DialogContent, { maxW: 400, rounded: "$6", gap: "$3", children: [_jsx(DialogTitle, { children: t('New project') }), _jsx(Input, { autoFocus: true, value: draft, onChangeText: setDraft, placeholder: t('Project name'), "aria-label": t('Project name'), maxLength: 64, onKeyDown: (e) => {
176
+ if (e.key === 'Enter' && !e.nativeEvent?.isComposing && e.keyCode !== 229)
177
+ submit();
178
+ } }), _jsxs(XStack, { gap: "$2", justify: "flex-end", children: [_jsx(Button, { size: "sm", variant: "outline", rounded: 999, onPress: () => setCreating(false), children: t('Cancel') }), _jsx(Button, { size: "sm", rounded: 999, disabled: !draft.trim(), onPress: submit, children: t('Create') })] })] }) })] }));
179
+ }
package/dist/Rail.d.ts CHANGED
@@ -3,8 +3,8 @@ import { type Host } from '@hanzo/build';
3
3
  import { type Place } from './lib/host.js';
4
4
  /** The rail's width, px. */
5
5
  export declare const RAIL: number;
6
- /** A mark, px: a 36px square on a 44px pitch. */
7
- export declare const MARK = 36;
6
+ /** A mark, px: a 32px rounded square on a 44px rail. */
7
+ export declare const MARK = 32;
8
8
  /** The places the rail holds beside the products, by the builder address each opens. */
9
9
  export declare const RAISED: {
10
10
  readonly library: '-/artifacts';
package/dist/Rail.js CHANGED
@@ -51,8 +51,8 @@ import { HEAD, INSET, TOUCH_HEAD } from './ground.js';
51
51
  import { app, hosted, WORKSPACE } from './lib/host.js';
52
52
  /** The rail's width, px. */
53
53
  export const RAIL = 2 * INSET;
54
- /** A mark, px: a 36px square on a 44px pitch. */
55
- export const MARK = 36;
54
+ /** A mark, px: a 32px rounded square on a 44px rail. */
55
+ export const MARK = 32;
56
56
  /** A mark on a touch screen, px: a thumb's 44. */
57
57
  const TOUCH = 44;
58
58
  /** The places the rail holds beside the products, by the builder address each opens. */
@@ -72,7 +72,7 @@ export function raised(at) {
72
72
  }
73
73
  /** 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
74
  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: "$4", items: "center", justify: "center", shrink: 0, cursor: "pointer", opacity: on ? 1 : 0.62, bg: on ? '$edge' : 'transparent', hoverStyle: { bg: on ? '$edge' : '$hover', opacity: 1 }, pressStyle: { bg: '$raised' }, focusVisibleStyle: { outlineWidth: 2, outlineStyle: 'solid', outlineColor: '$outlineColor' },
75
+ return (_jsx(XStack, { render: "button", "aria-label": label, ...{ title: label }, "aria-current": on ? 'page' : undefined, onPress: onPress, width: MARK, height: MARK, rounded: 8, items: "center", justify: "center", shrink: 0, cursor: "pointer", opacity: on ? 1 : 0.68, bg: on ? 'var(--shell-rail-active, var(--secondary-hover))' : 'transparent', hoverStyle: { bg: on ? 'var(--shell-rail-active, var(--secondary-hover))' : '$hover', opacity: 1 }, pressStyle: { bg: '$raised' }, focusVisibleStyle: { outlineWidth: 2, outlineStyle: 'solid', outlineColor: '$outlineColor' },
76
76
  // A thumb's 44px on a touch screen.
77
77
  $touchable: { width: TOUCH, height: TOUCH }, ...rest, children: children }));
78
78
  }
@@ -126,12 +126,12 @@ export function Rail({ host, mode, at, open, toggle, inside = null, rows = false
126
126
  const betasDialog = _jsx(BetasDialog, { open: betas, onOpenChange: setBetas, go: reach });
127
127
  if (rows)
128
128
  return (_jsxs(YStack, { "data-slot": "places", render: "nav", "aria-label": t('Products'), pt: "$2", shrink: 0, children: [_jsxs(YStack, { role: "list", gap: 2, children: [anon ? null : (_jsx(YStack, { role: "listitem", children: _jsx(Row, { label: "Design", on: mode === 'design', onPress: onDesign, "data-slot": "place-design", icon: _jsx(MARKS.design.icon, { size: 16, "aria-hidden": true }) }) })), !anon && opened('studio') ? (_jsx(YStack, { role: "listitem", children: _jsx(Row, { label: "Studio", on: mode === 'studio', onPress: onStudio, "data-slot": "place-studio", icon: _jsx(MARKS.studio.icon, { size: 16, "aria-hidden": true }) }) })) : null, anon ? null : (_jsx(YStack, { role: "listitem", children: _jsx(Row, { label: "Tabs", on: mode === 'tabs', onPress: onTabs, "data-slot": "place-tabs", icon: _jsx(MARKS.tabs.icon, { size: 16, "aria-hidden": true }) }) })), apps.map((a) => (_jsx(YStack, { role: "listitem", children: _jsx(Row, { label: a.name, on: inside === a.id, onPress: () => go(hosted(a.id)), "data-slot": `place-app-${a.id}`, icon: _jsx(a.icon, { size: 16, "aria-hidden": true }) }) }, a.id))), anon ? null : (_jsx(YStack, { role: "listitem", children: _jsx(DropdownMenu, { placement: "bottom-start", minWidth: 220, trigger: _jsx(Row, { label: t('More'), "data-slot": "place-more", "aria-haspopup": "menu", icon: _jsx(Ellipsis, { size: 16, "aria-hidden": true }) }), items: rest }) }))] }), betasDialog] }));
129
- return (_jsxs(YStack, { "data-slot": "rail", render: "nav", "aria-label": t('Products'), width: RAIL, flex: 1,
129
+ return (_jsxs(YStack, { "data-slot": "rail", render: "nav", "aria-label": t('Products'), width: RAIL, flex: 1, bg: "var(--shell-rail-bg, var(--secondary))", borderRightWidth: 1, borderColor: "var(--shell-rail-border, var(--border))",
130
130
  // As tall as the window and no taller: its marks scroll inside it (below), never the page.
131
131
  minH: 0,
132
132
  // The first mark stands at the pane's top edge, one head row high (HEAD), and the last at its foot by the
133
133
  // same inset, so the account mirrors the sidebar's toggle across the rail.
134
- pt: (HEAD - MARK) / 2, pb: (HEAD - MARK) / 2, gap: 4, 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
134
+ 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
135
  // Toward the content: right of the rail, left of it right to left.
136
136
  , {
137
137
  // Toward the content: right of the rail, left of it right to left.