@hanzo/app 0.2.23 → 0.2.25
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/App.js +3 -1
- package/dist/Betas.d.ts +4 -0
- package/dist/Betas.js +6 -1
- package/dist/Chat.js +12 -4
- package/dist/Column.js +10 -1
- package/dist/Drawer.d.ts +1 -1
- package/dist/Drawer.js +20 -5
- package/dist/Me.js +2 -2
- package/dist/Rail.js +2 -2
- package/dist/SettingsPane.js +9 -1
- package/dist/Top.js +1 -1
- package/dist/lib/chatPreferences.d.ts +4 -0
- package/dist/lib/chatPreferences.js +25 -2
- package/dist/lib/host.d.ts +6 -0
- package/dist/lib/host.js +8 -0
- package/dist/look.js +13 -1
- package/dist/where.d.ts +1 -1
- package/dist/where.js +1 -1
- package/package.json +1 -1
package/dist/App.js
CHANGED
|
@@ -90,6 +90,8 @@ import { dragWindow, toggleWindowMaximize, WindowControls } from './WindowContro
|
|
|
90
90
|
const Studio = lazy(() => import('@hanzo/studio').then((m) => ({ default: m.Studio })));
|
|
91
91
|
/** Tabs, the same way: the terminals on the reader's machines (Terminals.tsx). */
|
|
92
92
|
const Terminals = lazy(() => import('./Terminals.js'));
|
|
93
|
+
/** Betas, fetched when opening /beta in the app. */
|
|
94
|
+
const Betas = lazy(() => import('./Betas.js').then((m) => ({ default: m.BetasPane })));
|
|
93
95
|
/** `/` is Chat on a new conversation. */
|
|
94
96
|
const HOME = { mode: 'chat', thread: null };
|
|
95
97
|
/** The bar's height, px: the reference window's title bar. */
|
|
@@ -269,5 +271,5 @@ function Window({ bar }) {
|
|
|
269
271
|
};
|
|
270
272
|
return (_jsx(AiProvider, { client: client ?? undefined, children: _jsx(HostProvider, { host: host, children: _jsx(PrefsProvider, { 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-room": "", "data-app": mode, "data-slot": "frame", ...(bar ? null : floor), ...(drawer.slide ? RAISED : null),
|
|
271
273
|
// inline-style: the slide, a transform with no logical form whose sign and distance the drawer writes on the element itself, a drag every frame (Drawer.tsx).
|
|
272
|
-
style: drawer.slide ?? undefined, flex: 1, minW: 0, minH: 0, paddingInlineEnd: "var(--pane-gap)", pb: "var(--pane-gap)", pt: 0, "$max-md": { p: 0 }, children: [drawer.slide ? _jsx(Lift, {}) : null, _jsx(YStack, { height: "100%", "$max-md": { display: 'none' }, children: _jsx(Rail, { host: host, mode: mode, at: where, open: !closed, toggle: bar ? undefined : flip, onChat: toChat, onDev: toDev, onStudio: toStudio, onTabs: toTabs, go: move, onOrg: org }) }), closed || mode === 'tabs' ? null : (_jsx(YStack, { "$max-md": { display: 'none' }, children: _jsx(Column, { host: host, mode: mode, thread: thread, go: move, onShut: () => setClosed(true), onSeek: seek, onBack: back, places: sidebar }) })), _jsxs(YStack, { "data-slot": "stage", flex: 1, minW: 0, minH: 0, marginInlineStart: closed || mode === 'tabs' ? 0 : 'var(--pane-gap)', "$max-md": { marginInlineStart: 0, pb: FOOT }, children: [bar ? null : _jsx(Top, { host: host, mode: mode, places: sidebar, open: drawer.state !== 'shut', go: move, onMenu: drawer.open, onChat: toChat, onDev: toDev }), _jsx(XStack, { "data-slot": "panes", flex: 1, minW: 0, minH: 0, children: mode === 'chat' ? (_jsx(Paned, { framed: true, children: _jsx(Chat, {}) })) : mode === 'tabs' ? (_jsx(YStack, { render: "main", "data-slot": "pane", ...pane(), overflow: "hidden", flex: 1, minW: 0, minH: 0, children: _jsx(Suspense, { fallback: null, children: _jsx(Terminals, {}) }) })) : mode === 'studio' ? (_jsx(YStack, { render: "main", "data-slot": "pane", ...pane(), overflow: "hidden", flex: 1, minW: 0, minH: 0, children: _jsx(YStack, { flex: 1, minH: 0, height: "100%", children: _jsx(Suspense, { fallback: null, children: _jsx(Studio, { host: maker, rail: false }) }) }) })) : (_jsx(YStack, { render: "main", "data-slot": "pane", ...(run ? null : { ...pane(), overflow: 'hidden' }), flex: 1, minW: 0, minH: 0, children: plans ? null : _jsx(Builder, { host: host, rail: false }) })) })] })] }), drawer.state === 'shut' ? null : (_jsx(Layer, { drawer: drawer, top: bar ? BAR : 0, children: _jsx(Column, { host: host, mode: mode, thread: thread, go: move, onShut: shut, onSeek: seek, onBack: back, drawer: true, places: sidebar, rail: _jsx(Rail, { host: host, mode: mode, at: where, open: true, rows: true, onChat: toChat, onDev: toDev, onStudio: toStudio, onTabs: toTabs, go: move, onOrg: org }), foot: _jsx(Foot, { host: host, onChat: fresh, onOrg: org }) }) })), finding ? _jsx(Palette, { go: move, onClose: found, mode: mode, host: host }) : null, learning ? _jsx(Learning, { open: true, onClose: () => setLearning(false) }) : null] }) }) }) }));
|
|
274
|
+
style: drawer.slide ?? undefined, flex: 1, minW: 0, minH: 0, paddingInlineEnd: "var(--pane-gap)", pb: "var(--pane-gap)", pt: 0, "$max-md": { p: 0 }, children: [drawer.slide ? _jsx(Lift, {}) : null, _jsx(YStack, { height: "100%", "$max-md": { display: 'none' }, children: _jsx(Rail, { host: host, mode: mode, at: where, open: !closed, toggle: bar ? undefined : flip, onChat: toChat, onDev: toDev, onStudio: toStudio, onTabs: toTabs, go: move, onOrg: org }) }), closed || mode === 'tabs' ? null : (_jsx(YStack, { "$max-md": { display: 'none' }, children: _jsx(Column, { host: host, mode: mode, thread: thread, go: move, onShut: () => setClosed(true), onSeek: seek, onBack: back, places: sidebar }) })), _jsxs(YStack, { "data-slot": "stage", flex: 1, minW: 0, minH: 0, marginInlineStart: closed || mode === 'tabs' ? 0 : 'var(--pane-gap)', "$max-md": { marginInlineStart: 0, pb: FOOT }, children: [bar ? null : _jsx(Top, { host: host, mode: mode, places: sidebar, open: drawer.state !== 'shut', go: move, onMenu: drawer.open, onChat: toChat, onDev: toDev }), _jsx(XStack, { "data-slot": "panes", flex: 1, minW: 0, minH: 0, children: mode === 'chat' ? (_jsx(Paned, { framed: true, children: _jsx(Chat, {}) })) : mode === 'tabs' ? (_jsx(YStack, { render: "main", "data-slot": "pane", ...pane(), overflow: "hidden", flex: 1, minW: 0, minH: 0, children: _jsx(Suspense, { fallback: null, children: _jsx(Terminals, {}) }) })) : mode === 'studio' ? (_jsx(YStack, { render: "main", "data-slot": "pane", ...pane(), overflow: "hidden", flex: 1, minW: 0, minH: 0, children: _jsx(YStack, { flex: 1, minH: 0, height: "100%", children: _jsx(Suspense, { fallback: null, children: _jsx(Studio, { host: maker, rail: false }) }) }) })) : mode === 'beta' ? (_jsx(YStack, { render: "main", "data-slot": "pane", ...pane(), overflow: "scroll", flex: 1, minW: 0, minH: 0, p: "$4", $md: { p: '$6' }, children: _jsx(Suspense, { fallback: null, children: _jsx(Betas, { go: move }) }) })) : (_jsx(YStack, { render: "main", "data-slot": "pane", ...(run ? null : { ...pane(), overflow: 'hidden' }), flex: 1, minW: 0, minH: 0, children: plans ? null : _jsx(Builder, { host: host, rail: false }) })) })] })] }), drawer.state === 'shut' ? null : (_jsx(Layer, { drawer: drawer, top: bar ? BAR : 0, children: _jsx(Column, { host: host, mode: mode, thread: thread, go: move, onShut: shut, onSeek: seek, onBack: back, drawer: true, places: sidebar, rail: _jsx(Rail, { host: host, mode: mode, at: where, open: true, rows: true, onChat: toChat, onDev: toDev, onStudio: toStudio, onTabs: toTabs, go: move, onOrg: org }), foot: _jsx(Foot, { host: host, onChat: fresh, onOrg: org }) }) })), finding ? _jsx(Palette, { go: move, onClose: found, mode: mode, host: host }) : null, learning ? _jsx(Learning, { open: true, onClose: () => setLearning(false) }) : null] }) }) }) }));
|
|
273
275
|
}
|
package/dist/Betas.d.ts
CHANGED
|
@@ -19,3 +19,7 @@ export declare function BetasDialog({ open, onOpenChange, go }: {
|
|
|
19
19
|
onOpenChange: (open: boolean) => void;
|
|
20
20
|
go?: (href: string) => void;
|
|
21
21
|
}): import("react").JSX.Element;
|
|
22
|
+
/** The Betas view rendered inside the app's main pane under /beta. */
|
|
23
|
+
export declare function BetasPane({ go }: {
|
|
24
|
+
go?: (href: string) => void;
|
|
25
|
+
}): import("react").JSX.Element;
|
package/dist/Betas.js
CHANGED
|
@@ -16,7 +16,7 @@ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
|
16
16
|
// Signed out, still loading, or on any error nothing is open: a flags outage
|
|
17
17
|
// cannot leak an unfinished app.
|
|
18
18
|
import { useCallback, useEffect, useState, useSyncExternalStore } from 'react';
|
|
19
|
-
import { ArrowUpRight, Compass } from 'lucide-react';
|
|
19
|
+
import { ArrowUpRight, Compass, FlaskConical } from 'lucide-react';
|
|
20
20
|
import { phrase } from '@hanzo/i18n';
|
|
21
21
|
import { useI18n } from '@hanzo/i18n/react';
|
|
22
22
|
import { useIam } from '@hanzo/iam/react';
|
|
@@ -141,3 +141,8 @@ export function BetasDialog({ open, onOpenChange, go }) {
|
|
|
141
141
|
const { t } = useI18n();
|
|
142
142
|
return (_jsx(Dialog, { open: open, onOpenChange: onOpenChange, children: _jsxs(DialogContent, { maxW: 520, rounded: "$6", gap: "$3", children: [_jsx(DialogTitle, { children: t('Betas') }), _jsx(Text, { fontSize: "$2", color: "$color11", children: t('Apps we have not opened to everyone yet. Ask for the ones you want and we will let you in.') }), _jsx(YStack, { maxH: "60vh", overflowY: "auto", overflowX: "hidden", paddingInlineEnd: "$2", children: _jsx(BetasList, { go: go }) }), _jsxs(XStack, { items: "center", justify: "space-between", pt: "$3", borderTopWidth: 1, borderColor: "$borderColor", flexWrap: "wrap", gap: "$2", children: [_jsx(Text, { fontSize: "$2", color: "$color11", children: t('Looking for community plugins and MCP tools?') }), _jsx(Button, { size: "sm", variant: "outline", rounded: 999, onPress: () => window.open('https://hanzo.market', '_blank', 'noopener,noreferrer'), children: _jsxs(XStack, { items: "center", gap: "$1.5", children: [_jsx(Compass, { size: 14, "aria-hidden": true }), _jsx(Text, { fontSize: "$2", children: t('Explore on hanzo.market') }), _jsx(ArrowUpRight, { size: 13, "aria-hidden": true })] }) })] })] }) }));
|
|
143
143
|
}
|
|
144
|
+
/** The Betas view rendered inside the app's main pane under /beta. */
|
|
145
|
+
export function BetasPane({ go }) {
|
|
146
|
+
const { t } = useI18n();
|
|
147
|
+
return (_jsxs(YStack, { flex: 1, minH: 0, maxW: 900, mx: "auto", width: "100%", gap: "$5", pb: "$8", children: [_jsxs(YStack, { gap: "$1.5", pt: "$2", children: [_jsxs(XStack, { items: "center", gap: "$2", children: [_jsx(FlaskConical, { size: 22, color: "var(--primary)", "aria-hidden": true }), _jsx(Text, { fontSize: "$6", fontWeight: "600", color: "$color12", children: t('Ecosystem Betas & Early Access') })] }), _jsx(Text, { fontSize: "$3", color: "$color11", lineHeight: "$5", children: t('Preview upcoming releases, manage early access requests for your account, and explore models and developer tools.') })] }), _jsx(YStack, { rounded: "$4", borderWidth: 1, borderColor: "$borderColor", bg: "$background", p: "$4", $md: { p: '$6' }, gap: "$4", children: _jsx(BetasList, { go: go }) })] }));
|
|
148
|
+
}
|
package/dist/Chat.js
CHANGED
|
@@ -57,7 +57,7 @@ import { useHydrated } from "./lib/hydrated.js";
|
|
|
57
57
|
import { base, served } from "./lib/ai.js";
|
|
58
58
|
import { onServed } from "./lib/served.js";
|
|
59
59
|
import { refused as worded, speech, useDictation, useTalk, useVoice } from "@hanzo/voice";
|
|
60
|
-
import { Check, Clock, FileText, Image as ImageMark, Library as LibraryMark, Paperclip, Sparkles, X } from "lucide-react";
|
|
60
|
+
import { Check, Clock, FileText, Image as ImageMark, Library as LibraryMark, Paperclip, Sparkles, X, Zap } from "lucide-react";
|
|
61
61
|
import { FREE, ENSO } from "./lib/ai.js";
|
|
62
62
|
import { openThread, useOpen } from "./open.js";
|
|
63
63
|
import { Beside, Framed } from "./Shell.js";
|
|
@@ -541,6 +541,13 @@ function Thread({ placeholder = message(), initial, anonymous = false, heading,
|
|
|
541
541
|
attach: (f) => lent.current.attach(f),
|
|
542
542
|
go: (href) => (/^https?:/.test(href) ? void window.open(href, "_blank", "noopener,noreferrer") : go(href)),
|
|
543
543
|
}, CHAT_MODES);
|
|
544
|
+
useEffect(() => {
|
|
545
|
+
const wantedMode = chatPrefs.approvalMode || "auto";
|
|
546
|
+
if (!anonymous && carry.mode.value !== wantedMode) {
|
|
547
|
+
carry.mode.set(wantedMode);
|
|
548
|
+
}
|
|
549
|
+
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
550
|
+
}, [chatPrefs.approvalMode, anonymous]);
|
|
544
551
|
const agentShelf = useAgentShelf();
|
|
545
552
|
// The opening greets the person by the first word of their display name, capitalised ("What’s up, Z?").
|
|
546
553
|
// A username is a handle, not a name: without a display name the greeting has none.
|
|
@@ -1451,13 +1458,14 @@ function Thread({ placeholder = message(), initial, anonymous = false, heading,
|
|
|
1451
1458
|
],
|
|
1452
1459
|
slash: anonymous ? undefined : carry.skills,
|
|
1453
1460
|
at: anonymous ? undefined : carry.plugins,
|
|
1454
|
-
|
|
1461
|
+
// Auto vs Manual approval lives in Settings rather than floating under the composer.
|
|
1462
|
+
mode: null,
|
|
1455
1463
|
// The model, the effort and the mode under the frame (@hanzo/build).
|
|
1456
1464
|
mind,
|
|
1457
1465
|
limits,
|
|
1458
1466
|
onUpgrade: (id) => setAsk({ model: nameOf(id, listed) }),
|
|
1459
1467
|
voice,
|
|
1460
|
-
language: spoken,
|
|
1468
|
+
language: chatPrefs.showLanguage ? spoken : null,
|
|
1461
1469
|
onLanguage: speakIn,
|
|
1462
1470
|
talk,
|
|
1463
1471
|
// While nothing has been said: what is worth doing next.
|
|
@@ -1588,7 +1596,7 @@ function Thread({ placeholder = message(), initial, anonymous = false, heading,
|
|
|
1588
1596
|
}, mention.state);
|
|
1589
1597
|
return {
|
|
1590
1598
|
...basePrompt,
|
|
1591
|
-
send: (_jsxs(XStack, { items: "center", gap: "$1.5", shrink: 0, children: [_jsx(ThinkingEffort, { effort: chatPrefs.effort || 'high', onChange: (eff) => {
|
|
1599
|
+
send: (_jsxs(XStack, { items: "center", gap: "$1.5", shrink: 0, children: [chatPrefs.showTurboApproval ? (_jsxs(XStack, { items: "center", gap: "$1", px: "$2", py: "$1", rounded: 999, borderWidth: 1, borderColor: "$borderColor", bg: "$background", "aria-label": t("Turbo Approval: {mode}", { mode: chatPrefs.approvalMode }), children: [_jsx(Zap, { size: 12, color: "var(--primary)", "aria-hidden": true }), _jsx(Text, { fontSize: "$1", fontWeight: "600", color: "$ink", children: chatPrefs.approvalMode === "manual" ? t("Manual") : t("Turbo") })] })) : null, _jsx(ThinkingEffort, { effort: chatPrefs.effort || 'high', onChange: (eff) => {
|
|
1592
1600
|
setChatPrefs({ effort: eff });
|
|
1593
1601
|
if (eff === 'low' || eff === 'medium' || eff === 'high') {
|
|
1594
1602
|
mind.pace(eff);
|
package/dist/Column.js
CHANGED
|
@@ -118,5 +118,14 @@ export function Column({ host, mode, thread, go, onShut, onSeek, onBack, drawer
|
|
|
118
118
|
};
|
|
119
119
|
return (_jsxs(YStack, { "data-slot": "app-column", ref: drawer ? undefined : span.ref,
|
|
120
120
|
// inline-style: `--span`, the width a drag rewrites on the element itself (span.ts); no prop sets a variable.
|
|
121
|
-
style: drawer ? undefined : span.style, position: "relative", flex: drawer ? 1 : undefined, shrink: drawer ? 1 : 0, minW: 0, height: "100%", width: drawer ? undefined : 'var(--span)', children: [_jsxs(Sidebar, { "data-slot": "app-rail", role: "navigation", "aria-label": brand(), bg: "transparent", borderWidth: 0, ...FILL, px: "$2", pt: drawer ? '$2' : 0, pb: "$2", gap: "$0", children: [at ? (_jsxs(XStack, { "data-slot": "app-head", items: "center", gap: "$1", paddingInlineStart: 2, paddingInlineEnd: 2, height: 52, shrink: 0, minW: 0, "data-tauri-drag-region": "deep", onMouseDown: dragWindow, onDoubleClick: toggleWindowMaximize, children: [_jsx(SidebarIconButton, { label: t('Back'), "data-slot": "place-back", "data-tauri-drag-region": "false", onPress: onBack, ...HEAD, children: _jsx(ArrowLeft, { size: 16, "aria-hidden": true, "data-i18n-mirror": true }) }), _jsx(Text, { flex: 1, minW: 0, fontSize: 18, lineHeight: 24, fontWeight: "600", color: "$ink", numberOfLines: 1, "data-slot": "place-name", children: t(TITLE[at]) })] })) : (_jsxs(XStack, { "data-slot": "app-head", items: "center", gap: "$1", paddingInlineStart: "$2", paddingInlineEnd: 2, height: 52, shrink: 0, minW: 0, "data-tauri-drag-region": "deep", onMouseDown: dragWindow, onDoubleClick: toggleWindowMaximize, children: [_jsx(Text, { flex: 1, minW: 0, fontSize: 18, lineHeight: 24, fontWeight:
|
|
121
|
+
style: drawer ? undefined : span.style, position: "relative", flex: drawer ? 1 : undefined, shrink: drawer ? 1 : 0, minW: 0, height: "100%", width: drawer ? undefined : 'var(--span)', children: [_jsxs(Sidebar, { "data-slot": "app-rail", role: "navigation", "aria-label": brand(), bg: "transparent", borderWidth: 0, ...FILL, px: "$2", pt: drawer ? '$2' : 0, pb: "$2", gap: "$0", children: [at ? (_jsxs(XStack, { "data-slot": "app-head", items: "center", gap: "$1", paddingInlineStart: 2, paddingInlineEnd: 2, height: 52, shrink: 0, minW: 0, "data-tauri-drag-region": "deep", onMouseDown: dragWindow, onDoubleClick: toggleWindowMaximize, children: [_jsx(SidebarIconButton, { label: t('Back'), "data-slot": "place-back", "data-tauri-drag-region": "false", onPress: onBack, ...HEAD, children: _jsx(ArrowLeft, { size: 16, "aria-hidden": true, "data-i18n-mirror": true }) }), _jsx(Text, { flex: 1, minW: 0, fontSize: 18, lineHeight: 24, fontWeight: "600", color: "$ink", numberOfLines: 1, "data-slot": "place-name", children: t(TITLE[at]) })] })) : (_jsxs(XStack, { "data-slot": "app-head", items: "center", gap: "$1", paddingInlineStart: "$2", paddingInlineEnd: 2, height: 52, shrink: 0, minW: 0, "data-tauri-drag-region": "deep", onMouseDown: dragWindow, onDoubleClick: toggleWindowMaximize, children: [_jsx(Text, { flex: 1, minW: 0, fontSize: drawer ? 20 : 18, lineHeight: 24, fontWeight: drawer ? '700' : '600', color: "$ink", numberOfLines: 1, children: wordmark(mode) }), drawer ? null : _jsx(Activity, { host: host }), _jsx(SidebarIconButton, { label: t('Search'), "data-tauri-drag-region": "false", onPress: onSeek, "aria-haspopup": "dialog", ...(drawer
|
|
122
|
+
? {
|
|
123
|
+
width: 40,
|
|
124
|
+
height: 40,
|
|
125
|
+
rounded: 9999,
|
|
126
|
+
borderWidth: 1,
|
|
127
|
+
borderColor: 'var(--border-strong)',
|
|
128
|
+
bg: 'var(--pane-fill)',
|
|
129
|
+
}
|
|
130
|
+
: HEAD), children: _jsx(Search, { size: drawer ? 18 : 16, "aria-hidden": true }) })] })), mode === 'chat' ? (_jsx(YStack, { role: "list", gap: 2, shrink: 0, children: _jsx(YStack, { role: "listitem", children: _jsx(SidebarItem, { "data-slot": "app-new", ...ROW, active: !thread, bg: "transparent", hoverStyle: { bg: '$hover' }, icon: _jsx(XStack, { width: 20, height: 20, items: "center", justify: "center", shrink: 0, children: _jsx(SquarePen, { size: 16, "aria-hidden": true }) }), onPress: create, ...keys(create), children: _jsx(Text, { fontSize: "$3", color: "$ink", children: t('New chat') }) }) }) })) : (_jsx(YStack, { "data-slot": "app-places", shrink: 0, children: groups.map((g, i) => (_jsxs(YStack, { pt: i ? '$2' : 0, children: [i && g.label ? (_jsx(Text, { id: `${uid}-${g.id}`, paddingInlineStart: "$2", pb: 2, fontSize: "$3", color: "$soft", children: g.label })) : null, _jsx(YStack, { role: "list", "aria-labelledby": i && g.label ? `${uid}-${g.id}` : undefined, "aria-label": i && g.label ? undefined : g.label || (at ? t(TITLE[at]) : g.id), gap: 1, children: g.links.map((link) => (_jsx(YStack, { role: "listitem", children: _jsx(SidebarItem, { ...ROW, ...(link.id === NEW ? { 'data-slot': 'app-new' } : {}), active: link.active, icon: link.id === NEW ? (_jsx(XStack, { width: 20, height: 20, items: "center", justify: "center", shrink: 0, children: _jsx(SquarePen, { size: 16, "aria-hidden": true }) })) : link.icon ? (_jsx(XStack, { width: 20, height: 20, items: "center", justify: "center", shrink: 0, children: link.icon })) : null, onPress: link.onPress, ...keys(() => link.onPress?.()), children: _jsx(Text, { fontSize: "$3", color: link.active ? '$ink' : '$quiet', children: link.label }) }) }, link.id))) })] }, g.id))) })), rail, mode === 'studio' || mode === 'tabs' || mode === 'beta' || at ? null : _jsx(Recents, { host: host, mode: mode, thread: thread, onOpen: open, onNew: create }), at ? null : (_jsxs(YStack, { gap: "$2", pt: "$2", shrink: 0, children: [_jsx(Made, {}), _jsx(Setup, {})] })), free ? (_jsx(YStack, { role: "list", gap: 2, shrink: 0, pt: "$2", children: _jsx(YStack, { role: "listitem", children: _jsx(SidebarItem, { ...ROW, "data-slot": "column-upgrade", icon: _jsx(XStack, { width: 20, height: 20, items: "center", justify: "center", shrink: 0, children: _jsx(Sparkles, { size: 16, "aria-hidden": true, color: "var(--primary)" }) }), onPress: () => window.location.assign(payUrl('/cart', { returnUrl: window.location.href })), ...keys(() => window.location.assign(payUrl('/cart', { returnUrl: window.location.href }))), children: _jsx(Text, { fontSize: "$3", color: "$ink", children: t('Upgrade plan') }) }) }) })) : null, foot] }), drawer ? null : (_jsx(Gutter, { side: dir === 'rtl' ? 'right' : 'left', span: span.span, floor: FLOOR, ceil: CEIL, reset: WIDTH, onSpan: span.move, onKeep: span.keep, onShut: onShut, label: t('Resize sidebar') }))] }));
|
|
122
131
|
}
|
package/dist/Drawer.d.ts
CHANGED
|
@@ -53,7 +53,7 @@ export declare function Layer({ drawer, top, children }: {
|
|
|
53
53
|
top?: number;
|
|
54
54
|
children: ReactNode;
|
|
55
55
|
}): import("react").JSX.Element;
|
|
56
|
-
/** The menu's foot: the account (its menu opens above it)
|
|
56
|
+
/** The menu's foot: the accent New chat at the start and the account (its menu opens above it) at the end. */
|
|
57
57
|
export declare function Foot({ host, onChat, onOrg }: {
|
|
58
58
|
host: Who;
|
|
59
59
|
onChat: () => void;
|
package/dist/Drawer.js
CHANGED
|
@@ -48,9 +48,15 @@ import { axis, OPEN, pull, settle, sign } from './slide.js';
|
|
|
48
48
|
* rewrites the distance every frame, no React commit). Its start corners round.
|
|
49
49
|
*/
|
|
50
50
|
const SLIDE = {
|
|
51
|
+
position: 'relative',
|
|
52
|
+
zIndex: 'var(--z-raised)',
|
|
53
|
+
overflow: 'hidden',
|
|
54
|
+
backgroundColor: 'var(--pane-solid)',
|
|
51
55
|
transform: 'translateX(calc(var(--drawer-way, 1) * var(--drawer-at, 0px)))',
|
|
52
56
|
borderStartStartRadius: 'var(--radius-composer)',
|
|
53
57
|
borderEndStartRadius: 'var(--radius-composer)',
|
|
58
|
+
boxShadow: '0 0 0 1px var(--border-strong), var(--shadow-floating)',
|
|
59
|
+
willChange: 'transform',
|
|
54
60
|
};
|
|
55
61
|
/** The slide's motion: the system's base duration on its entrance curve. */
|
|
56
62
|
const MOTION = 'transform var(--duration-base) var(--ease-emphasis)';
|
|
@@ -193,8 +199,17 @@ export function useDrawer() {
|
|
|
193
199
|
return;
|
|
194
200
|
}
|
|
195
201
|
s.setProperty('--drawer-way', String(way));
|
|
196
|
-
|
|
197
|
-
|
|
202
|
+
if (state === 'open') {
|
|
203
|
+
s.setProperty('transition', 'none');
|
|
204
|
+
s.setProperty('--drawer-at', '0px');
|
|
205
|
+
void pane.current?.getBoundingClientRect();
|
|
206
|
+
s.setProperty('transition', still ? 'none' : MOTION);
|
|
207
|
+
s.setProperty('--drawer-at', OPEN);
|
|
208
|
+
}
|
|
209
|
+
else {
|
|
210
|
+
s.setProperty('transition', still ? 'none' : MOTION);
|
|
211
|
+
s.setProperty('--drawer-at', '0px');
|
|
212
|
+
}
|
|
198
213
|
}, [state, way, still]);
|
|
199
214
|
// Closing ends when the slide does, or after it would have.
|
|
200
215
|
useEffect(() => {
|
|
@@ -334,10 +349,10 @@ export function Lift() {
|
|
|
334
349
|
*/
|
|
335
350
|
export function Layer({ drawer, top = 0, children }) {
|
|
336
351
|
const { t } = useI18n();
|
|
337
|
-
return (_jsxs(YStack, { ref: drawer.layer, role: "dialog", "aria-modal": true, "aria-label": t('Menu'), tabIndex: -1, "data-slot": "drawer", "data-state": drawer.state, position: "absolute", t: top, b: 0, insetInlineStart: 0, insetInlineEnd: 0, outlineStyle: "none", $md: { display: 'none' }, children: [_jsx(YStack, { "data-slot": "menu", position: "absolute", t: 0, b: 0, insetInlineStart: 0, width: OPEN, bg: "var(--pane-floor)", pt: "var(--safe-top)", pb: "max(var(--pane-gap), var(--safe-bottom))", ...{ paddingInlineStart: 'max(var(--safe-left), var(--safe-right))', touchAction: 'pan-y' }, children: children }), drawer.state === 'open' ? (_jsx(YStack, { render: "button", "data-slot": "drawer-close", "aria-label": t('Close sidebar'), onPress: drawer.close, position: "absolute", t: 0, b: 0, insetInlineEnd: 0, z: "var(--z-
|
|
352
|
+
return (_jsxs(YStack, { ref: drawer.layer, role: "dialog", "aria-modal": true, "aria-label": t('Menu'), tabIndex: -1, "data-slot": "drawer", "data-state": drawer.state, position: "absolute", t: top, b: 0, insetInlineStart: 0, insetInlineEnd: 0, outlineStyle: "none", $md: { display: 'none' }, children: [_jsx(YStack, { "data-slot": "menu", position: "absolute", t: 0, b: 0, insetInlineStart: 0, z: "var(--z-base)", width: OPEN, bg: "var(--pane-floor)", pt: "var(--safe-top)", pb: "max(var(--pane-gap), var(--safe-bottom))", ...{ paddingInlineStart: 'max(var(--safe-left), var(--safe-right))', touchAction: 'pan-y' }, children: children }), drawer.state === 'open' ? (_jsx(YStack, { render: "button", "data-slot": "drawer-close", "aria-label": t('Close sidebar'), onPress: drawer.close, position: "absolute", t: 0, b: 0, insetInlineEnd: 0, z: "var(--z-drawer)", bg: "transparent", borderWidth: 0, cursor: "pointer", ...{ insetInlineStart: OPEN, touchAction: 'none' }, focusVisibleStyle: { outlineWidth: 2, outlineStyle: 'solid', outlineColor: '$outlineColor' } })) : null] }));
|
|
338
353
|
}
|
|
339
|
-
/** The menu's foot: the account (its menu opens above it)
|
|
354
|
+
/** The menu's foot: the accent New chat at the start and the account (its menu opens above it) at the end. */
|
|
340
355
|
export function Foot({ host, onChat, onOrg }) {
|
|
341
356
|
const { t } = useI18n();
|
|
342
|
-
return (_jsxs(XStack, { "data-slot": "drawer-foot", items: "center", justify: "space-between", gap: "$2", pt: "$2", px: "$1", shrink: 0, children: [
|
|
357
|
+
return (_jsxs(XStack, { "data-slot": "drawer-foot", items: "center", justify: "space-between", gap: "$2", pt: "$2", px: "$1", shrink: 0, children: [_jsxs(XStack, { render: "button", "data-slot": "drawer-chat", "aria-label": t('New chat'), onPress: onChat, height: 44, px: "$4.5", gap: "$2", rounded: 9999, items: "center", justify: "center", bg: "var(--accent)", borderWidth: 0, cursor: "pointer", hoverStyle: { bg: 'var(--accent-hover)' }, pressStyle: { bg: 'var(--accent-hover)' }, focusVisibleStyle: { outlineWidth: 2, outlineStyle: 'solid', outlineColor: '$outlineColor' }, children: [_jsx(SquarePen, { size: 18, color: "var(--accent-foreground)", "aria-hidden": true }), _jsx(Text, { fontSize: "$4", fontWeight: "600", color: "var(--accent-foreground)", children: t('Chat') })] }), _jsx(Me, { host: host, narrow: true, above: true, onOrg: onOrg })] }));
|
|
343
358
|
}
|
package/dist/Me.js
CHANGED
|
@@ -218,9 +218,9 @@ export function Me({ host, narrow = false, above = false, onOrg, defaultAccountO
|
|
|
218
218
|
// Clear of the rail's mark (or the row) it opens from, and flush with its foot.
|
|
219
219
|
offset: 8, children: [_jsx(DropdownMenuTrigger, { asChild: true, children: _jsxs(XStack, { ref: (el) => {
|
|
220
220
|
row.current = el instanceof HTMLElement ? el : null;
|
|
221
|
-
}, render: "button", "data-slot": "me", "aria-label": t('Account: {name}', { name: [who, current].filter(Boolean).join(' · ') }), ...{ title: who }, width: narrow ? 36 : '100%', minH: narrow ? 36 : 48,
|
|
221
|
+
}, render: "button", "data-slot": "me", "aria-label": t('Account: {name}', { name: [who, current].filter(Boolean).join(' · ') }), ...{ title: who }, width: narrow ? (above ? 44 : 36) : '100%', minH: narrow ? (above ? 44 : 36) : 48,
|
|
222
222
|
// A thumb's 44 on a touch screen.
|
|
223
|
-
$touchable: narrow ? { width: 44, minH: 44 } : undefined, px: narrow ? 0 : '$2', gap: "$2.5", rounded: narrow ? 999 : '$5', items: "center", justify: narrow ? 'center' : 'flex-start', hoverStyle: { bg: '$hover' }, focusVisibleStyle: { outlineWidth: 2, outlineStyle: 'solid', outlineColor: '$outlineColor' }, cursor: "pointer", children: [_jsx(Face, { host: host, size: narrow ? 26 : 32 }), narrow ? null : (_jsxs(_Fragment, { children: [_jsxs(YStack, { flex: 1, minW: 0, children: [_jsx(SizableText, { size: "$3", fontWeight: "600", color: "$ink", numberOfLines: 1, text: "start", children: who }), working ? (_jsx(SizableText, { size: "$1", color: "$soft", numberOfLines: 1, text: "start", children: working })) : null] }), isFree ? (_jsx(Button, { size: "xs", variant: "outline", "data-slot": "me-upgrade", px: "$2", py: "$0.5", rounded: "$3", onPress: (e) => {
|
|
223
|
+
$touchable: narrow ? { width: 44, minH: 44 } : undefined, px: narrow ? 0 : '$2', gap: "$2.5", rounded: narrow ? 999 : '$5', borderWidth: narrow && above ? 1 : 0, borderColor: narrow && above ? 'var(--border-strong)' : undefined, bg: narrow && above ? 'var(--pane-fill)' : undefined, items: "center", justify: narrow ? 'center' : 'flex-start', hoverStyle: { bg: '$hover' }, focusVisibleStyle: { outlineWidth: 2, outlineStyle: 'solid', outlineColor: '$outlineColor' }, cursor: "pointer", children: [_jsx(Face, { host: host, size: narrow ? (above ? 32 : 26) : 32 }), narrow ? null : (_jsxs(_Fragment, { children: [_jsxs(YStack, { flex: 1, minW: 0, children: [_jsx(SizableText, { size: "$3", fontWeight: "600", color: "$ink", numberOfLines: 1, text: "start", children: who }), working ? (_jsx(SizableText, { size: "$1", color: "$soft", numberOfLines: 1, text: "start", children: working })) : null] }), isFree ? (_jsx(Button, { size: "xs", variant: "outline", "data-slot": "me-upgrade", px: "$2", py: "$0.5", rounded: "$3", onPress: (e) => {
|
|
224
224
|
e?.stopPropagation?.();
|
|
225
225
|
getPro();
|
|
226
226
|
}, cursor: "pointer", children: t('Upgrade plan') })) : null, _jsx(ChevronsUpDown, { size: 14, "aria-hidden": true, opacity: 0.6 })] }))] }) }), _jsxs(DropdownMenuContent, { minW: 260, maxW: "calc(100vw - 16px)", "aria-labelledby": undefined, "aria-label": t('Account'), onCloseAutoFocus: back, children: [_jsxs(DropdownMenuSub, { open: account, onOpenChange: setAccount, children: [_jsxs(DropdownMenuSubTrigger, { minH: 48, gap: "$2.5", "data-slot": "me-account", children: [_jsx(Face, { host: host, size: 28 }), _jsxs(YStack, { flex: 1, minW: 0, children: [_jsx(SizableText, { size: "$2", fontWeight: "600", color: "$ink", numberOfLines: 1, children: who }), _jsx(SizableText, { size: "$1", color: "$soft", numberOfLines: 1, children: host.person.email || working })] })] }), account ? (_jsxs(DropdownMenuSubContent, { minW: 240, maxW: "calc(100vw - 16px)", pointerEvents: "auto", children: [_jsx(Meter, { read: read, onPlans: () => leave('here'), onBilling: () => (setOpen(false), showSettings('billing')) }), _jsx(DropdownMenuSeparator, {}), _jsx(DropdownMenuItem, { onSelect: () => showSettings('account'), children: _jsx(Line, { icon: _jsx(CircleUserRound, { size: 16, "aria-hidden": true }), children: t('Profile') }) }), _jsx(DropdownMenuItem, { onSelect: () => showSettings('general'), children: _jsx(Line, { icon: _jsx(Palette, { size: 16, "aria-hidden": true }), children: t('Personalization') }) }), _jsx(DropdownMenuItem, { "aria-keyshortcuts": "Control+, Meta+,", onSelect: () => showSettings('general'), children: _jsx(Line, { icon: _jsx(Settings, { size: 16, "aria-hidden": true }), trail: _jsx(DropdownMenuShortcut, { "aria-hidden": true, children: _jsx("bdi", { dir: "ltr", children: apple ? '⌘,' : 'Ctrl+,' }) }), children: t('Settings') }) }), _jsx(DropdownMenuItem, { onSelect: () => window.location.assign(site('/beta')), children: _jsx(Line, { icon: _jsx(FlaskConical, { size: 16, "aria-hidden": true }), children: t('Beta') }) })] })) : null] }), _jsxs(DropdownMenuSub, { open: orgs, onOpenChange: setOrgs, children: [_jsx(DropdownMenuSubTrigger, { "data-slot": "me-orgs", children: _jsx(Line, { icon: _jsx(Mark, { org: here ?? all[0] }), trail: _jsx(Check, { size: 16, "aria-label": t('Current') }), children: t('{org} · {plan}', { org: (here ? (here.personal ? t('Personal') : here.display) : current), plan: planName || t('No plan') }) }) }), orgs ? (_jsxs(DropdownMenuSubContent, { minW: 260, maxW: "calc(100vw - 16px)", pointerEvents: "auto", children: [_jsx(DropdownMenuLabel, { children: t('Organizations') }), all.map((o) => (_jsx(DropdownMenuItem, { onSelect: () => o.name !== current && onOrg(o.name), children: _jsx(Line, { icon: _jsx(Mark, { org: o }), sub: [o.personal ? t('Personal') : said(o.role, t), planFor(o) || (isFree && o.personal ? t('Free') : '')].filter(Boolean).join(' - '), trail: o.name === current ? _jsx(Check, { size: 16, "aria-label": t('Current') }) : null, children: o.display }) }, o.name))), _jsx(DropdownMenuItem, { onSelect: () => setCreating(true), children: _jsx(Line, { icon: _jsx(Plus, { size: 16, "aria-hidden": true }), children: t('Create organization') }) }), _jsx(DropdownMenuItem, { onSelect: () => out(site(settings('organization'))), children: _jsx(Line, { icon: _jsx(Settings, { size: 16, "aria-hidden": true }), children: t('Organization settings') }) }), where().team ? null : here && !here.personal ? (_jsx(DropdownMenuItem, { onSelect: () => out(`${ENTRY}&org=${encodeURIComponent(here.name)}`), children: _jsx(Line, { icon: _jsx(Users, { size: 16, "aria-hidden": true }), trail: _jsx(ArrowUpRight, { size: 14, "aria-hidden": true, opacity: 0.6 }), children: t('Open in Hanzo Team') }) })) : (_jsx(DropdownMenuItem, { onSelect: () => setCreating(true), children: _jsx(Line, { icon: _jsx(Users, { size: 16, "aria-hidden": true }), children: t('Create a team') }) })), superAdmin() ? (_jsx(DropdownMenuItem, { onSelect: choose, children: _jsx(Line, { icon: _jsx(Building2, { size: 16, "aria-hidden": true }), children: t('All organizations') }) })) : null] })) : null] }), _jsx(DropdownMenuItem, { onSelect: () => leave('here'), children: _jsx(Line, { icon: _jsx(Sparkles, { size: 16, "aria-hidden": true }), children: t(plans) }) }), _jsx(DropdownMenuSeparator, {}), _jsxs(DropdownMenuSub, { open: lang, onOpenChange: (next) => {
|
package/dist/Rail.js
CHANGED
|
@@ -109,7 +109,7 @@ export function Rail({ host, mode, at, open, toggle, rows = false, onChat, onDev
|
|
|
109
109
|
{ key: 'team', label: 'Team', icon: _jsx(Users, { size: 16, "aria-hidden": true }), onSelect: () => out(WORKSPACE) },
|
|
110
110
|
...granted.map((b) => ({ key: `beta-${b.id}`, label: b.name, icon: _jsx(Sparkles, { size: 16, "aria-hidden": true }), onSelect: () => out(b.href) })),
|
|
111
111
|
{ type: 'separator', key: 'betas-rule' },
|
|
112
|
-
{ key: 'betas', label: t('Betas'), icon: _jsx(FlaskConical, { size: 16, "aria-hidden": true }), onSelect: () =>
|
|
112
|
+
{ key: 'betas', label: t('Betas'), icon: _jsx(FlaskConical, { size: 16, "aria-hidden": true }), onSelect: () => go('/beta') },
|
|
113
113
|
{ key: 'market', label: t('Explore on hanzo.market'), icon: _jsx(Compass, { size: 16, "aria-hidden": true }), onSelect: () => out('https://hanzo.market') },
|
|
114
114
|
]
|
|
115
115
|
: []),
|
|
@@ -117,7 +117,7 @@ export function Rail({ host, mode, at, open, toggle, rows = false, onChat, onDev
|
|
|
117
117
|
const betasDialog = _jsx(BetasDialog, { open: betas, onOpenChange: setBetas, go: out });
|
|
118
118
|
if (rows)
|
|
119
119
|
return (_jsxs(YStack, { "data-slot": "places", render: "nav", "aria-label": t('Products'), pt: "$2", shrink: 0, children: [_jsxs(YStack, { role: "list", gap: 2, children: [_jsx(YStack, { role: "listitem", children: _jsx(Row, { label: "Studio", on: mode === 'studio', onPress: onStudio, "data-slot": "place-studio", icon: _jsx(WandSparkles, { size: 16, "aria-hidden": true }) }) }), _jsx(YStack, { role: "listitem", children: _jsx(Row, { label: "Tabs", on: mode === 'tabs', onPress: onTabs, "data-slot": "place-tabs", icon: _jsx(SquareTerminal, { size: 16, "aria-hidden": true }) }) }), _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] }));
|
|
120
|
-
return (_jsxs(YStack, { "data-slot": "rail", render: "nav", "aria-label": t('Products'), width: RAIL, flex: 1, pt: 4, pb: 4, gap: 4, shrink: 0, items: "center", children: [toggle ? (_jsx(YStack, { pb: 4, children: _jsx(Toggle, { open: open, onPress: toggle }) })) : null, _jsx(Mark, { label: t('Chat'), on: mode === 'chat', onPress: onChat, "data-slot": "rail-chat", children: _jsx(MessageSquare, { size: 18, "aria-hidden": true }) }), _jsx(Mark, { label: "Dev", on: mode === 'dev' && !here, onPress: onDev, "data-slot": "rail-dev", children: _jsx(Code2, { size: 18, "aria-hidden": true }) }), _jsx(Mark, { label: "Studio", on: mode === 'studio', onPress: onStudio, "data-slot": "rail-studio", children: _jsx(WandSparkles, { size: 18, "aria-hidden": true }) }), _jsx(Mark, { label: "Tabs", on: mode === 'tabs', onPress: onTabs, "data-slot": "rail-tabs", children: _jsx(SquareTerminal, { size: 18, "aria-hidden": true }) }), _jsx(Mark, { label: t('Library'), on: here === 'library', onPress: to(RAISED.library), "data-slot": "rail-library", children: _jsx(Library, { size: 18, "aria-hidden": true }) }), _jsx(Mark, { label: t('Scheduled tasks'), on: here === 'scheduled', onPress: to(RAISED.scheduled), "data-slot": "rail-scheduled", children: _jsx(Clock, { size: 18, "aria-hidden": true }) }), _jsx(Mark, { label: t('Customize'), on: here === 'customize', onPress: to(RAISED.customize), "data-slot": "rail-customize", children: _jsx(Puzzle, { size: 18, "aria-hidden": true }) }), _jsx(Mark, { label: t('Betas'), on:
|
|
120
|
+
return (_jsxs(YStack, { "data-slot": "rail", render: "nav", "aria-label": t('Products'), width: RAIL, flex: 1, pt: 4, pb: 4, gap: 4, shrink: 0, items: "center", children: [toggle ? (_jsx(YStack, { pb: 4, children: _jsx(Toggle, { open: open, onPress: toggle }) })) : null, _jsx(Mark, { label: t('Chat'), on: mode === 'chat', onPress: onChat, "data-slot": "rail-chat", children: _jsx(MessageSquare, { size: 18, "aria-hidden": true }) }), _jsx(Mark, { label: "Dev", on: mode === 'dev' && !here, onPress: onDev, "data-slot": "rail-dev", children: _jsx(Code2, { size: 18, "aria-hidden": true }) }), _jsx(Mark, { label: "Studio", on: mode === 'studio', onPress: onStudio, "data-slot": "rail-studio", children: _jsx(WandSparkles, { size: 18, "aria-hidden": true }) }), _jsx(Mark, { label: "Tabs", on: mode === 'tabs', onPress: onTabs, "data-slot": "rail-tabs", children: _jsx(SquareTerminal, { size: 18, "aria-hidden": true }) }), _jsx(Mark, { label: t('Library'), on: here === 'library', onPress: to(RAISED.library), "data-slot": "rail-library", children: _jsx(Library, { size: 18, "aria-hidden": true }) }), _jsx(Mark, { label: t('Scheduled tasks'), on: here === 'scheduled', onPress: to(RAISED.scheduled), "data-slot": "rail-scheduled", children: _jsx(Clock, { size: 18, "aria-hidden": true }) }), _jsx(Mark, { label: t('Customize'), on: here === 'customize', onPress: to(RAISED.customize), "data-slot": "rail-customize", children: _jsx(Puzzle, { size: 18, "aria-hidden": true }) }), _jsx(Mark, { label: t('Betas'), on: mode === 'beta', onPress: () => go('/beta'), "data-slot": "rail-betas", children: _jsx(FlaskConical, { size: 18, "aria-hidden": true }) }), betasDialog, rest.length ? (_jsx(DropdownMenu
|
|
121
121
|
// Toward the content: right of the rail, left of it right to left.
|
|
122
122
|
, {
|
|
123
123
|
// Toward the content: right of the rail, left of it right to left.
|
package/dist/SettingsPane.js
CHANGED
|
@@ -93,7 +93,13 @@ function Model() {
|
|
|
93
93
|
choose({ effort: step.id });
|
|
94
94
|
}
|
|
95
95
|
}, ...CHOICE, bg: active ? 'var(--edge, var(--white-14))' : 'transparent', borderColor: active ? 'var(--borderColor, var(--white-22))' : 'var(--white-08)', py: 6, px: 12, children: _jsxs(XStack, { items: "center", gap: "$1.5", children: [_jsx(Text, { fontSize: "$2", fontWeight: active ? '600' : '400', color: active ? '$ink' : '$soft', children: step.label }), active ? _jsx(Check, { size: 12, color: "var(--primary)", "aria-hidden": true }) : null] }) }, step.id));
|
|
96
|
-
}) })] }), _jsx(Separator, {}), _jsxs(YStack, { gap: "$
|
|
96
|
+
}) })] }), _jsx(Separator, {}), _jsxs(YStack, { gap: "$2", "data-slot": "settings-approval-mode", children: [_jsx(Text, { fontSize: "$4", fontWeight: "600", color: "$ink", children: t('Tool & action approval') }), _jsx(Text, { fontSize: "$2", color: "$soft", children: t('Choose whether agents run tools and connectors automatically or ask for manual approval before each action.') }), _jsx(XStack, { gap: "$2", pt: "$1", children: [
|
|
97
|
+
{ id: 'auto', label: t('Auto'), desc: t('Runs tools on its own; pauses only for anything risky.') },
|
|
98
|
+
{ id: 'manual', label: t('Manual'), desc: t('Asks before each tool, connector or site it opens.') },
|
|
99
|
+
].map((opt) => {
|
|
100
|
+
const active = (chatPrefs.approvalMode || 'auto') === opt.id;
|
|
101
|
+
return (_jsxs(Box, { render: _jsx("button", { type: "button" }), ...tap, onClick: () => setChatPrefs({ approvalMode: opt.id }), ...CHOICE, flex: 1, p: 10, bg: active ? 'var(--edge, var(--white-14))' : 'transparent', borderColor: active ? 'var(--borderColor, var(--white-22))' : 'var(--white-08)', children: [_jsxs(XStack, { items: "center", justify: "space-between", children: [_jsx(Text, { fontSize: "$2", fontWeight: "600", color: "$ink", children: opt.label }), active ? _jsx(Check, { size: 12, color: "var(--primary)", "aria-hidden": true }) : null] }), _jsx(Text, { fontSize: "$1", color: "$soft", children: opt.desc })] }, opt.id));
|
|
102
|
+
}) })] }), _jsx(Separator, {}), _jsxs(YStack, { gap: "$3", children: [_jsx(XStack, { items: "center", justify: "space-between", children: _jsxs(YStack, { gap: "$0.5", children: [_jsxs(XStack, { items: "center", gap: "$1.5", children: [_jsx(Text, { fontSize: "$4", fontWeight: "600", color: "$ink", children: t('Advanced composer controls') }), !paid ? (_jsxs(XStack, { items: "center", gap: "$1", px: "$2", py: "$0.5", rounded: 9999, bg: "var(--edge, var(--white-10))", children: [_jsx(Lock, { size: 11, color: "$soft", "aria-hidden": true }), _jsx(Text, { fontSize: "$1", fontWeight: "600", color: "$soft", children: t('Paid plan') })] })) : null] }), _jsx(Text, { fontSize: "$2", color: "$soft", children: t('Customize composer controls and third-party model access.') })] }) }), _jsx(YStack, { p: "$3", rounded: "$3", borderWidth: 1, borderColor: "$borderColor", gap: "$2", children: _jsxs(XStack, { items: "center", justify: "space-between", children: [_jsxs(YStack, { flex: 1, pr: "$2", children: [_jsx(Text, { fontSize: "$3", fontWeight: "600", color: "$ink", children: t('Show model selector in composer') }), _jsx(Text, { fontSize: "$2", color: "$soft", children: t('By default, chat composers simplify controls to reasoning effort only. Enable this to pick models on the fly in the composer.') })] }), _jsx(Button, { size: "sm", variant: chatPrefs.showModelSelector ? 'default' : 'outline', disabled: !paid, onClick: () => paid && setChatPrefs({ showModelSelector: !chatPrefs.showModelSelector }), children: chatPrefs.showModelSelector ? t('Enabled') : t('Disabled') })] }) }), _jsx(YStack, { p: "$3", rounded: "$3", borderWidth: 1, borderColor: "$borderColor", gap: "$2", children: _jsxs(XStack, { items: "center", justify: "space-between", children: [_jsxs(YStack, { flex: 1, pr: "$2", children: [_jsx(Text, { fontSize: "$3", fontWeight: "600", color: "$ink", children: t('Enable third-party models') }), _jsx(Text, { fontSize: "$2", color: "$soft", children: t('Third-party models (OpenAI, Anthropic, Google, DeepSeek) are billed from your pre-paid credit topup. First-party models (Enso, Zen, Kai) are covered by your plan.') })] }), _jsx(Button, { size: "sm", variant: chatPrefs.allowThirdPartyModels ? 'default' : 'outline', disabled: !paid, onClick: () => paid && setChatPrefs({ allowThirdPartyModels: !chatPrefs.allowThirdPartyModels }), children: chatPrefs.allowThirdPartyModels ? t('Enabled') : t('Disabled') })] }) }), _jsx(YStack, { p: "$3", rounded: "$3", borderWidth: 1, borderColor: "$borderColor", gap: "$2", children: _jsxs(XStack, { items: "center", justify: "space-between", children: [_jsxs(YStack, { flex: 1, pr: "$2", children: [_jsx(Text, { fontSize: "$3", fontWeight: "600", color: "$ink", children: t('Show language selector beside +') }), _jsx(Text, { fontSize: "$2", color: "$soft", children: t('Display the dictation language indicator next to the + context button on the composer row.') })] }), _jsx(Button, { size: "sm", variant: chatPrefs.showLanguage ? 'default' : 'outline', onClick: () => setChatPrefs({ showLanguage: !chatPrefs.showLanguage }), children: chatPrefs.showLanguage ? t('Enabled') : t('Disabled') })] }) }), _jsx(YStack, { p: "$3", rounded: "$3", borderWidth: 1, borderColor: "$borderColor", gap: "$2", children: _jsxs(XStack, { items: "center", justify: "space-between", children: [_jsxs(YStack, { flex: 1, pr: "$2", children: [_jsx(Text, { fontSize: "$3", fontWeight: "600", color: "$ink", children: t('Show turbo approval indicator') }), _jsx(Text, { fontSize: "$2", color: "$soft", children: t('Display the turbo / manual approval badge next to the thinking effort and send controls.') })] }), _jsx(Button, { size: "sm", variant: chatPrefs.showTurboApproval ? 'default' : 'outline', onClick: () => setChatPrefs({ showTurboApproval: !chatPrefs.showTurboApproval }), children: chatPrefs.showTurboApproval ? t('Enabled') : t('Disabled') })] }) }), !paid ? (_jsx(XStack, { pt: "$1", children: _jsxs(Button, { size: "sm", variant: "outline", onClick: () => window.location.assign(site('/pricing')), children: [_jsx(Sparkles, { size: 14, color: "var(--primary)", "aria-hidden": true }), t('Upgrade to unlock advanced model controls')] }) })) : null] })] }));
|
|
97
103
|
}
|
|
98
104
|
/**
|
|
99
105
|
* WHAT THE GATEWAY SERVES, read from the same `/v1/models` the rooms read.
|
|
@@ -323,10 +329,12 @@ function AgentSettings() {
|
|
|
323
329
|
return localStorage.getItem('hanzo.agent.autonomy') || 'autonomous';
|
|
324
330
|
});
|
|
325
331
|
const [saved, setSaved] = useState(false);
|
|
332
|
+
const [, setChatPrefs] = useChatPreferences();
|
|
326
333
|
const save = () => {
|
|
327
334
|
localStorage.setItem('hanzo.agent.instructions', instructions);
|
|
328
335
|
localStorage.setItem('hanzo.agent.persona', persona);
|
|
329
336
|
localStorage.setItem('hanzo.agent.autonomy', autonomy);
|
|
337
|
+
setChatPrefs({ approvalMode: autonomy === 'supervised' ? 'manual' : 'auto' });
|
|
330
338
|
setSaved(true);
|
|
331
339
|
setTimeout(() => setSaved(false), 2000);
|
|
332
340
|
};
|
package/dist/Top.js
CHANGED
|
@@ -63,5 +63,5 @@ export function Top({ host, mode, places, open = false, go, onMenu, onChat, onDe
|
|
|
63
63
|
},
|
|
64
64
|
}
|
|
65
65
|
: { label: made?.label ?? t('New'), onPress: made?.onPress };
|
|
66
|
-
return (_jsxs(XStack, { "data-slot": "app-bar", height: `calc(${LINE}px + var(--safe-top))`, pt: "var(--safe-top)", px: "$4.5", items: "center", justify: "space-between", shrink: 0, $md: { display: 'none' }, children: [_jsx(Round, { label: t('Open sidebar'), "data-slot": "bar-menu", onPress: onMenu,
|
|
66
|
+
return (_jsxs(XStack, { "data-slot": "app-bar", height: `calc(${LINE}px + var(--safe-top))`, pt: "var(--safe-top)", px: "$4.5", items: "center", justify: "space-between", shrink: 0, $md: { display: 'none' }, children: [_jsx(Round, { label: t('Open sidebar'), "data-slot": "bar-menu", onPress: onMenu, pointerEvents: open ? 'none' : 'auto', children: _jsx(Lines, {}) }), _jsx(XStack, { "data-slot": "bar-mode", ...GLASS, height: LINE, p: "$1", items: "center", children: _jsxs(ToggleGroup, { type: "single", "aria-label": t('App'), value: mode === 'chat' || mode === 'dev' ? mode : '', disableDeactivation: true, onValueChange: (v) => (v === 'chat' ? onChat() : v === 'dev' ? onDev() : undefined), children: [_jsx(Side, { value: "chat", children: t('Chat') }), _jsx(Side, { value: "dev", children: "Dev" })] }) }), _jsx(Round, { label: fresh.label, "data-slot": "bar-new", onPress: fresh.onPress, children: _jsx(SquarePen, { size: 20, "aria-hidden": true }) })] }));
|
|
67
67
|
}
|
|
@@ -1,8 +1,12 @@
|
|
|
1
1
|
import { type EffortLevel } from '../ThinkingEffort.js';
|
|
2
|
+
export type ApprovalMode = 'auto' | 'manual';
|
|
2
3
|
export interface ChatPreferences {
|
|
3
4
|
showModelSelector: boolean;
|
|
4
5
|
allowThirdPartyModels: boolean;
|
|
5
6
|
effort: EffortLevel;
|
|
7
|
+
approvalMode: ApprovalMode;
|
|
8
|
+
showLanguage?: boolean;
|
|
9
|
+
showTurboApproval?: boolean;
|
|
6
10
|
effortVersion?: number;
|
|
7
11
|
}
|
|
8
12
|
export declare function getChatPreferences(): ChatPreferences;
|
|
@@ -2,34 +2,54 @@
|
|
|
2
2
|
* Chat composer preferences:
|
|
3
3
|
* - showModelSelector: whether model selector is visible in composer (default: false, paid plan feature)
|
|
4
4
|
* - allowThirdPartyModels: whether 3rd-party models (OpenAI, Anthropic, etc.) are enabled via pre-paid credit (default: false)
|
|
5
|
+
* - approvalMode: whether tools/actions run automatically ('auto') or ask for confirmation first ('manual') (default: 'auto')
|
|
5
6
|
*/
|
|
6
7
|
import { useEffect, useState } from 'react';
|
|
7
8
|
import { DEFAULT_EFFORT, EFFORT_STEPS } from '../ThinkingEffort.js';
|
|
8
9
|
const STORAGE_KEY = 'hanzo.chat.preferences';
|
|
10
|
+
const AUTONOMY_KEY = 'hanzo.agent.autonomy';
|
|
9
11
|
const EVENT_NAME = 'hanzo:chat:preferences';
|
|
10
12
|
const EFFORT_SCHEMA_VERSION = 3;
|
|
11
13
|
const DEFAULT_PREFERENCES = {
|
|
12
14
|
showModelSelector: false,
|
|
13
15
|
allowThirdPartyModels: false,
|
|
14
16
|
effort: DEFAULT_EFFORT,
|
|
17
|
+
approvalMode: 'auto',
|
|
18
|
+
showLanguage: false,
|
|
19
|
+
showTurboApproval: false,
|
|
15
20
|
effortVersion: EFFORT_SCHEMA_VERSION,
|
|
16
21
|
};
|
|
17
22
|
function validEffort(v) {
|
|
18
23
|
return EFFORT_STEPS.some((s) => s.id === v) ? v : DEFAULT_EFFORT;
|
|
19
24
|
}
|
|
25
|
+
function validApprovalMode(v, fallbackAutonomy) {
|
|
26
|
+
if (v === 'manual' || v === 'auto')
|
|
27
|
+
return v;
|
|
28
|
+
if (fallbackAutonomy === 'supervised')
|
|
29
|
+
return 'manual';
|
|
30
|
+
return 'auto';
|
|
31
|
+
}
|
|
20
32
|
export function getChatPreferences() {
|
|
21
33
|
if (typeof window === 'undefined')
|
|
22
34
|
return DEFAULT_PREFERENCES;
|
|
23
35
|
try {
|
|
24
36
|
const raw = window.localStorage.getItem(STORAGE_KEY);
|
|
25
|
-
|
|
26
|
-
|
|
37
|
+
const autonomy = window.localStorage.getItem(AUTONOMY_KEY);
|
|
38
|
+
if (!raw) {
|
|
39
|
+
return {
|
|
40
|
+
...DEFAULT_PREFERENCES,
|
|
41
|
+
approvalMode: validApprovalMode(undefined, autonomy),
|
|
42
|
+
};
|
|
43
|
+
}
|
|
27
44
|
const parsed = JSON.parse(raw);
|
|
28
45
|
const migratedEffort = parsed.effortVersion === EFFORT_SCHEMA_VERSION ? validEffort(parsed.effort) : DEFAULT_EFFORT;
|
|
29
46
|
return {
|
|
30
47
|
showModelSelector: Boolean(parsed.showModelSelector),
|
|
31
48
|
allowThirdPartyModels: Boolean(parsed.allowThirdPartyModels),
|
|
32
49
|
effort: migratedEffort,
|
|
50
|
+
approvalMode: validApprovalMode(parsed.approvalMode, autonomy),
|
|
51
|
+
showLanguage: Boolean(parsed.showLanguage),
|
|
52
|
+
showTurboApproval: Boolean(parsed.showTurboApproval),
|
|
33
53
|
effortVersion: EFFORT_SCHEMA_VERSION,
|
|
34
54
|
};
|
|
35
55
|
}
|
|
@@ -43,6 +63,9 @@ export function setChatPreferences(patch) {
|
|
|
43
63
|
if (typeof window !== 'undefined') {
|
|
44
64
|
try {
|
|
45
65
|
window.localStorage.setItem(STORAGE_KEY, JSON.stringify(next));
|
|
66
|
+
if (patch.approvalMode) {
|
|
67
|
+
window.localStorage.setItem(AUTONOMY_KEY, patch.approvalMode === 'manual' ? 'supervised' : 'autonomous');
|
|
68
|
+
}
|
|
46
69
|
}
|
|
47
70
|
catch {
|
|
48
71
|
// ignore
|
package/dist/lib/host.d.ts
CHANGED
|
@@ -58,6 +58,10 @@ export declare const STUDIO = "/studio";
|
|
|
58
58
|
* (@hanzo/tabs `Workspace`), drawn in the app at hanzo.ai/tabs.
|
|
59
59
|
*/
|
|
60
60
|
export declare const TERMINALS = "/tabs";
|
|
61
|
+
/**
|
|
62
|
+
* Betas: ecosystem betas, early access preview, and waitlist dashboard.
|
|
63
|
+
*/
|
|
64
|
+
export declare const BETA = "/beta";
|
|
61
65
|
/** Studio at an address of its own (@hanzo/studio `route`): '' is New, /studio. */
|
|
62
66
|
export declare const studio: (at: string) => string;
|
|
63
67
|
/** Chat on a conversation, or /chat itself for a new one. */
|
|
@@ -93,6 +97,8 @@ export type Place = {
|
|
|
93
97
|
at: string;
|
|
94
98
|
} | {
|
|
95
99
|
mode: 'tabs';
|
|
100
|
+
} | {
|
|
101
|
+
mode: 'beta';
|
|
96
102
|
};
|
|
97
103
|
/** The place a path names, or null when it names none of the app's. */
|
|
98
104
|
export declare function place(pathname: string): Place | null;
|
package/dist/lib/host.js
CHANGED
|
@@ -61,6 +61,10 @@ export const STUDIO = '/studio';
|
|
|
61
61
|
* (@hanzo/tabs `Workspace`), drawn in the app at hanzo.ai/tabs.
|
|
62
62
|
*/
|
|
63
63
|
export const TERMINALS = '/tabs';
|
|
64
|
+
/**
|
|
65
|
+
* Betas: ecosystem betas, early access preview, and waitlist dashboard.
|
|
66
|
+
*/
|
|
67
|
+
export const BETA = '/beta';
|
|
64
68
|
/** Studio at an address of its own (@hanzo/studio `route`): '' is New, /studio. */
|
|
65
69
|
export const studio = (at) => (at ? `${STUDIO}/${at.replace(/^\/+/, '')}` : STUDIO);
|
|
66
70
|
/** Chat on a conversation, or /chat itself for a new one. */
|
|
@@ -112,6 +116,8 @@ export function place(pathname) {
|
|
|
112
116
|
return { mode: 'studio', at: p.slice(STUDIO.length + 1) };
|
|
113
117
|
if (p === TERMINALS)
|
|
114
118
|
return { mode: 'tabs' };
|
|
119
|
+
if (p === BETA)
|
|
120
|
+
return { mode: 'beta' };
|
|
115
121
|
if (!p.startsWith(`${CHAT}/`))
|
|
116
122
|
return null;
|
|
117
123
|
const id = p.slice(CHAT.length + 1);
|
|
@@ -135,6 +141,8 @@ export function page(pathname) {
|
|
|
135
141
|
return TERMINALS;
|
|
136
142
|
if (at.mode === 'studio')
|
|
137
143
|
return STUDIO;
|
|
144
|
+
if (at.mode === 'beta')
|
|
145
|
+
return BETA;
|
|
138
146
|
const r = route(at.at);
|
|
139
147
|
if (r.kind === 'run')
|
|
140
148
|
return `${DEV}/run/:id`;
|
package/dist/look.js
CHANGED
|
@@ -14,7 +14,9 @@ import { useIam } from '@hanzo/iam/react';
|
|
|
14
14
|
import { Check, Download, Palette, Smartphone, Type, Upload } from 'lucide-react';
|
|
15
15
|
import { setActivePlatform, BUILTIN_MODS, applyMod, exportMod, importMod, injectCustomFont, applyFontFamily, } from '@hanzo/mod';
|
|
16
16
|
import { api } from './lib/api.js';
|
|
17
|
+
import { useChatPreferences } from './lib/chatPreferences.js';
|
|
17
18
|
import { useOrg } from './host.js';
|
|
19
|
+
import { EFFORT_STEPS } from './ThinkingEffort.js';
|
|
18
20
|
import { brand } from './where.js';
|
|
19
21
|
import { tap } from './lib/tap.js';
|
|
20
22
|
const CHOICE = { rounded: 8, borderWidth: 1, borderStyle: 'solid', cursor: 'pointer' };
|
|
@@ -30,6 +32,7 @@ export function Look() {
|
|
|
30
32
|
const { t } = useI18n();
|
|
31
33
|
const { accessToken } = useIam();
|
|
32
34
|
const org = useOrg();
|
|
35
|
+
const [chatPrefs, setChatPrefs] = useChatPreferences();
|
|
33
36
|
const [activePlatform, setPlatform] = useState(() => {
|
|
34
37
|
if (typeof window === 'undefined')
|
|
35
38
|
return 'auto';
|
|
@@ -82,5 +85,14 @@ export function Look() {
|
|
|
82
85
|
return (_jsxs(YStack, { gap: "$5", maxW: 540, children: [_jsx(Text, { fontSize: "$3", color: "$soft", children: t('Customized per organization and kept with your account across all Hanzo surfaces.') }), _jsx(Appearance, { org: org.id, orgName: org.name || brand(), account: { base: api(), token: accessToken ?? undefined } }), _jsx(Separator, {}), _jsxs(YStack, { gap: "$2.5", children: [_jsxs(XStack, { items: "center", gap: "$2", children: [_jsx(Smartphone, { size: 16, color: "var(--primary)", "aria-hidden": true }), _jsx(Text, { fontSize: "$4", fontWeight: "600", color: "$ink", children: t('Native Platform Look & Feel') })] }), _jsx(Text, { fontSize: "$2", color: "$soft", children: t('Adaptive styling tailored to your OS: iOS Liquid Glass, Material 3, macOS Vibrant, or Windows Mica.') }), _jsx(YStack, { gap: "$1.5", pt: "$1", children: PLATFORM_OPTIONS.map((opt) => {
|
|
83
86
|
const active = activePlatform === opt.id;
|
|
84
87
|
return (_jsx(Box, { render: _jsx("button", { type: "button" }), ...tap, onClick: () => handlePlatformChange(opt.id), ...CHOICE, p: "$2.5", bg: active ? 'var(--edge, var(--white-14))' : 'transparent', borderColor: active ? 'var(--borderColor, var(--white-22))' : 'var(--white-08)', children: _jsxs(XStack, { items: "center", justify: "space-between", children: [_jsxs(YStack, { gap: "$0.5", children: [_jsx(Text, { fontSize: "$3", fontWeight: active ? '600' : '500', color: active ? '$ink' : '$ink', children: opt.label }), _jsx(Text, { fontSize: "$1", color: "$soft", children: opt.note })] }), active ? _jsx(Check, { size: 16, color: "var(--primary)", "aria-hidden": true }) : null] }) }, opt.id));
|
|
85
|
-
}) })] }), _jsx(Separator, {}), _jsxs(YStack, { gap: "$3", children: [_jsxs(XStack, { items: "center", gap: "$2", children: [_jsx(Palette, { size: 16, color: "var(--primary)", "aria-hidden": true }), _jsx(Text, { fontSize: "$4", fontWeight: "600", color: "$ink", children: t('Organization Theme Mods (@hanzo/mod)') })] }), _jsx(Text, { fontSize: "$2", color: "$soft", children: t('Select or fork designer themes for custom organization branding.') }), _jsx(XStack, { gap: "$2", flexWrap: "wrap", children: BUILTIN_MODS.map((mod) => (_jsx(Box, { render: _jsx("button", { type: "button" }), ...tap, onClick: () => applyMod(mod), ...CHOICE, py: 6, px: 12, bg: "transparent", borderColor: "var(--white-10)", hoverStyle: { bg: '$hover' }, children: _jsx(Text, { fontSize: "$2", color: "$ink", children: mod.name }) }, mod.id))) }), _jsxs(YStack, { gap: "$2", p: "$3", rounded: "$3", borderWidth: 1, borderColor: "$borderColor", children: [_jsxs(XStack, { items: "center", gap: "$2", children: [_jsx(Type, { size: 15, color: "var(--primary)", "aria-hidden": true }), _jsx(Text, { fontSize: "$3", fontWeight: "600", color: "$ink", children: t('Custom Typography') })] }), _jsx(Text, { fontSize: "$2", color: "$soft", children: t('Enter a font family name (e.g. "Geist", "Inter", "Cabinet Grotesk") or a webfont stylesheet URL.') }), _jsxs(XStack, { gap: "$2", items: "center", children: [_jsx(Input, { flex: 1, size: "sm", value: customFont, onChange: (e) => setCustomFont(e.target.value), placeholder: "e.g. Cabinet Grotesk or https://fonts.googleapis.com/..." }), _jsx(Button, { size: "sm", onClick: handleApplyFont, children: fontApplied ? t('Applied!') : t('Apply Font') })] })] }), _jsxs(YStack, { gap: "$2", p: "$3", rounded: "$3", borderWidth: 1, borderColor: "$borderColor", children: [_jsx(Text, { fontSize: "$3", fontWeight: "600", color: "$ink", children: t('Fork & Share Theme Mods') }), _jsx(Text, { fontSize: "$2", color: "$soft", children: t('Export current mod configuration or paste a mod JSON to import.') }), _jsxs(XStack, { gap: "$2", items: "center", children: [_jsx(Input, { flex: 1, size: "sm", value: modJson, onChange: (e) => setModJson(e.target.value), placeholder: t('Paste mod JSON here to import') }), _jsxs(Button, { size: "sm", variant: "outline", onClick: handleImportMod, children: [_jsx(Upload, { size: 13, "aria-hidden": true }), t('Import')] }), _jsxs(Button, { size: "sm", variant: "outline", onClick: () => handleExportMod(BUILTIN_MODS[0]), children: [_jsx(Download, { size: 13, "aria-hidden": true }), copiedMod ? t('Copied!') : t('Export JSON')] })] })] })] }), _jsx(Separator, {}), _jsxs(YStack, { gap: "$2", children: [_jsx(Text, { fontSize: "$4", fontWeight: "600", color: "$ink", children: t('Language') }), _jsx(Text, { fontSize: "$2", color: "$soft", children: t('The language Hanzo is shown in, on every Hanzo surface you sign in to.') }), _jsx(XStack, { pt: "$1", children: _jsx(LanguagePicker, {}) })] })
|
|
88
|
+
}) })] }), _jsx(Separator, {}), _jsxs(YStack, { gap: "$3", children: [_jsxs(XStack, { items: "center", gap: "$2", children: [_jsx(Palette, { size: 16, color: "var(--primary)", "aria-hidden": true }), _jsx(Text, { fontSize: "$4", fontWeight: "600", color: "$ink", children: t('Organization Theme Mods (@hanzo/mod)') })] }), _jsx(Text, { fontSize: "$2", color: "$soft", children: t('Select or fork designer themes for custom organization branding.') }), _jsx(XStack, { gap: "$2", flexWrap: "wrap", children: BUILTIN_MODS.map((mod) => (_jsx(Box, { render: _jsx("button", { type: "button" }), ...tap, onClick: () => applyMod(mod), ...CHOICE, py: 6, px: 12, bg: "transparent", borderColor: "var(--white-10)", hoverStyle: { bg: '$hover' }, children: _jsx(Text, { fontSize: "$2", color: "$ink", children: mod.name }) }, mod.id))) }), _jsxs(YStack, { gap: "$2", p: "$3", rounded: "$3", borderWidth: 1, borderColor: "$borderColor", children: [_jsxs(XStack, { items: "center", gap: "$2", children: [_jsx(Type, { size: 15, color: "var(--primary)", "aria-hidden": true }), _jsx(Text, { fontSize: "$3", fontWeight: "600", color: "$ink", children: t('Custom Typography') })] }), _jsx(Text, { fontSize: "$2", color: "$soft", children: t('Enter a font family name (e.g. "Geist", "Inter", "Cabinet Grotesk") or a webfont stylesheet URL.') }), _jsxs(XStack, { gap: "$2", items: "center", children: [_jsx(Input, { flex: 1, size: "sm", value: customFont, onChange: (e) => setCustomFont(e.target.value), placeholder: "e.g. Cabinet Grotesk or https://fonts.googleapis.com/..." }), _jsx(Button, { size: "sm", onClick: handleApplyFont, children: fontApplied ? t('Applied!') : t('Apply Font') })] })] }), _jsxs(YStack, { gap: "$2", p: "$3", rounded: "$3", borderWidth: 1, borderColor: "$borderColor", children: [_jsx(Text, { fontSize: "$3", fontWeight: "600", color: "$ink", children: t('Fork & Share Theme Mods') }), _jsx(Text, { fontSize: "$2", color: "$soft", children: t('Export current mod configuration or paste a mod JSON to import.') }), _jsxs(XStack, { gap: "$2", items: "center", children: [_jsx(Input, { flex: 1, size: "sm", value: modJson, onChange: (e) => setModJson(e.target.value), placeholder: t('Paste mod JSON here to import') }), _jsxs(Button, { size: "sm", variant: "outline", onClick: handleImportMod, children: [_jsx(Upload, { size: 13, "aria-hidden": true }), t('Import')] }), _jsxs(Button, { size: "sm", variant: "outline", onClick: () => handleExportMod(BUILTIN_MODS[0]), children: [_jsx(Download, { size: 13, "aria-hidden": true }), copiedMod ? t('Copied!') : t('Export JSON')] })] })] })] }), _jsx(Separator, {}), _jsxs(YStack, { gap: "$2", children: [_jsx(Text, { fontSize: "$4", fontWeight: "600", color: "$ink", children: t('Language') }), _jsx(Text, { fontSize: "$2", color: "$soft", children: t('The language Hanzo is shown in, on every Hanzo surface you sign in to.') }), _jsx(XStack, { pt: "$1", children: _jsx(LanguagePicker, {}) })] }), _jsx(Separator, {}), _jsxs(YStack, { gap: "$2", "data-slot": "settings-approval-mode", children: [_jsx(Text, { fontSize: "$4", fontWeight: "600", color: "$ink", children: t('Tool & Action Approval') }), _jsx(Text, { fontSize: "$2", color: "$soft", children: t('Control whether tools, connectors, and actions execute automatically or require manual approval first.') }), _jsx(XStack, { gap: "$2", pt: "$1", children: [
|
|
89
|
+
{ id: 'auto', label: t('Auto'), note: t('Runs tools on its own; pauses only for anything risky.') },
|
|
90
|
+
{ id: 'manual', label: t('Manual'), note: t('Asks before each tool, connector or site it opens.') },
|
|
91
|
+
].map((opt) => {
|
|
92
|
+
const active = (chatPrefs.approvalMode || 'auto') === opt.id;
|
|
93
|
+
return (_jsxs(Box, { render: _jsx("button", { type: "button" }), ...tap, onClick: () => setChatPrefs({ approvalMode: opt.id }), ...CHOICE, flex: 1, p: "$2.5", bg: active ? 'var(--edge, var(--white-14))' : 'transparent', borderColor: active ? 'var(--borderColor, var(--white-22))' : 'var(--white-08)', children: [_jsxs(XStack, { items: "center", justify: "space-between", children: [_jsx(Text, { fontSize: "$3", fontWeight: active ? '600' : '500', color: "$ink", children: opt.label }), active ? _jsx(Check, { size: 16, color: "var(--primary)", "aria-hidden": true }) : null] }), _jsx(Text, { fontSize: "$1", color: "$soft", children: opt.note })] }, opt.id));
|
|
94
|
+
}) })] }), _jsx(Separator, {}), _jsxs(YStack, { gap: "$2", "data-slot": "settings-reasoning-effort", children: [_jsx(Text, { fontSize: "$4", fontWeight: "600", color: "$ink", children: t('Default Reasoning Effort') }), _jsx(Text, { fontSize: "$2", color: "$soft", children: t('Sets how deeply models think before answering. Defaults to High.') }), _jsx(XStack, { gap: "$2", pt: "$1", flexWrap: "wrap", children: EFFORT_STEPS.map((step) => {
|
|
95
|
+
const active = (chatPrefs.effort || 'high') === step.id;
|
|
96
|
+
return (_jsx(Box, { render: _jsx("button", { type: "button" }), ...tap, onClick: () => setChatPrefs({ effort: step.id }), ...CHOICE, py: 6, px: 12, bg: active ? 'var(--edge, var(--white-14))' : 'transparent', borderColor: active ? 'var(--borderColor, var(--white-22))' : 'var(--white-08)', children: _jsxs(XStack, { items: "center", gap: "$1.5", children: [_jsx(Text, { fontSize: "$2", fontWeight: active ? '600' : '400', color: active ? '$ink' : '$soft', children: step.label }), active ? _jsx(Check, { size: 12, color: "var(--primary)", "aria-hidden": true }) : null] }) }, step.id));
|
|
97
|
+
}) })] })] }));
|
|
86
98
|
}
|
package/dist/where.d.ts
CHANGED
|
@@ -74,6 +74,6 @@ export declare const where: () => Addresses;
|
|
|
74
74
|
/** The product's name, as the host states it. Read at call time, like every address. */
|
|
75
75
|
export declare const brand: () => string;
|
|
76
76
|
/** The product's name in each mode of the app: the host's brand in Chat (Hanzo AI, Hanzo Team), Hanzo Dev in Dev. */
|
|
77
|
-
export declare const wordmark: (mode: 'chat' | 'dev' | 'studio' | 'tabs') => string;
|
|
77
|
+
export declare const wordmark: (mode: 'chat' | 'dev' | 'studio' | 'tabs' | 'beta') => string;
|
|
78
78
|
/** A page of the app's own, from wherever the rooms are mounted. */
|
|
79
79
|
export declare const site: (path: string) => string;
|
package/dist/where.js
CHANGED
|
@@ -12,6 +12,6 @@ export const where = () => addresses;
|
|
|
12
12
|
/** The product's name, as the host states it. Read at call time, like every address. */
|
|
13
13
|
export const brand = () => addresses.brand ?? 'Hanzo AI';
|
|
14
14
|
/** The product's name in each mode of the app: the host's brand in Chat (Hanzo AI, Hanzo Team), Hanzo Dev in Dev. */
|
|
15
|
-
export const wordmark = (mode) => (mode === 'dev' ? 'Hanzo Dev' : mode === 'studio' ? 'Hanzo Studio' : mode === 'tabs' ? 'Hanzo Tabs' : brand());
|
|
15
|
+
export const wordmark = (mode) => (mode === 'dev' ? 'Hanzo Dev' : mode === 'studio' ? 'Hanzo Studio' : mode === 'tabs' ? 'Hanzo Tabs' : mode === 'beta' ? 'Hanzo Betas' : brand());
|
|
16
16
|
/** A page of the app's own, from wherever the rooms are mounted. */
|
|
17
17
|
export const site = (path) => `${addresses.site}${path}`;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@hanzo/app",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.25",
|
|
4
4
|
"description": "Hanzo's app: the shell and its apps (Home, Chat, Inbox, Contacts, Meet, Calendar, Drive, Board, Work, Bots), once, for every Hanzo surface.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/index.js",
|