diff --git a/apps/hanzo-desktop/src/__tests__/keybindings.test.tsx b/apps/hanzo-desktop/src/__tests__/keybindings.test.tsx index 822a83da..759a189f 100644 --- a/apps/hanzo-desktop/src/__tests__/keybindings.test.tsx +++ b/apps/hanzo-desktop/src/__tests__/keybindings.test.tsx @@ -11,6 +11,7 @@ import { createMicLeaseArbitrator, DESKTOP_GLOBAL_KEYS, DesktopSettings, + windowKey, } from '../desktop-shortcuts'; describe('Hanzo Desktop & @hanzo/app keybindings', () => { @@ -25,9 +26,9 @@ describe('Hanzo Desktop & @hanzo/app keybindings', () => { it('lists every core Web + Desktop shortcut in KEYS and DESKTOP_GLOBAL_KEYS', () => { const macChords = KEYS.map((k) => k.mac); expect(macChords).toContain('⌘K'); - expect(macChords).toContain('⌘N / ⇧⌘O'); + expect(macChords).toContain('⌘N / ⌘⇧O'); expect(macChords).toContain('⌘B'); - expect(macChords).toContain('⇧⌘M'); + expect(macChords).toContain('⌘⇧M'); expect(macChords).toContain('⌘,'); expect(macChords).toContain('⌘/'); expect(macChords).toContain('⌘.'); @@ -176,17 +177,47 @@ describe('Hanzo Desktop & @hanzo/app keybindings', () => { expect(onBack).toHaveBeenCalledTimes(2); }); - it('verifies patched @hanzo/app wires ⌘N, ⇧⌘O, ⌘B, ⇧⌘M, ⌘, and guest ⌘/ shortcuts', () => { - const appPath = resolve(__dirname, '../../../../node_modules/@hanzo/app/dist/App.js'); - const mePath = resolve(__dirname, '../../../../node_modules/@hanzo/app/dist/Me.js'); - const appJs = readFileSync(appPath, 'utf8'); - const meJs = readFileSync(mePath, 'utf8'); - - expect(appJs).toContain("(bar && !e.shiftKey && lower === 'n')"); - expect(appJs).toContain("(e.shiftKey && lower === 'o')"); - expect(appJs).toContain("lower === 'b'"); - expect(appJs).toContain("lower === 'm'"); - expect(meJs).toContain('if (!host.person)\n return _jsx(Shortcuts,'); + it('answers the window keys @hanzo/app leaves to it: ⌘N and ⌘⇧M', () => { + const press = (key: string, more: Partial = {}) => + windowKey({ + key, + metaKey: false, + ctrlKey: false, + shiftKey: false, + altKey: false, + repeat: false, + isComposing: false, + defaultPrevented: false, + ...more, + }); + expect(press('n', { metaKey: true })).toBe('new-chat'); + expect(press('N', { ctrlKey: true })).toBe('new-chat'); + expect(press('M', { metaKey: true, shiftKey: true })).toBe('voice'); + expect(press('m', { ctrlKey: true, shiftKey: true })).toBe('voice'); + // ⌘⇧O, ⌘B and ⌘, are @hanzo/app's own (keys.js); the window does not answer them twice. + expect(press('o', { metaKey: true, shiftKey: true })).toBeNull(); + expect(press('b', { metaKey: true })).toBeNull(); + expect(press('n')).toBeNull(); + expect(press('n', { metaKey: true, altKey: true })).toBeNull(); + expect(press('n', { metaKey: true, repeat: true })).toBeNull(); + expect(press('n', { metaKey: true, isComposing: true })).toBeNull(); + expect(press('n', { metaKey: true, defaultPrevented: true })).toBeNull(); + }); + + it('runs the patched @hanzo/app: a signed-out window chats with the local engine', () => { + const dist = resolve(__dirname, '../../../../node_modules/@hanzo/app/dist'); + const chat = readFileSync(resolve(dist, 'Chat.js'), 'utf8'); + const pane = readFileSync(resolve(dist, 'pane.js'), 'utf8'); + const setup = readFileSync(resolve(dist, 'Setup.js'), 'utf8'); + + // The signed-out lane is the signed-in one (history, the picked model, no turn cap). + expect(chat).toContain('HANZO DESKTOP ANSWERS ITS SIGNED-OUT READER ITSELF'); + expect(chat).toContain('const sent = anonymous ? wanted || ENSO : wanted;'); + expect(chat).toContain('"Select / Download Local Model"'); + // Files a signed-out reader attaches are read in the window, not refused. + expect(pane).toContain('localText'); + expect(pane).not.toContain('Sign in to attach files'); + expect(setup).toContain('const workspace = false;'); }); it('arbitrates cross-window microphone lease so concurrent Hanzo apps never fight over the mic', () => { diff --git a/apps/hanzo-desktop/src/app.css b/apps/hanzo-desktop/src/app.css index 8c1f2d7b..ca39ce07 100644 --- a/apps/hanzo-desktop/src/app.css +++ b/apps/hanzo-desktop/src/app.css @@ -73,6 +73,13 @@ html:root { height: 28px !important; } +/* Folded, @hanzo/app 0.3 sizes the bar's start to the rail, which leaves no + room for the traffic lights' inset and the toggle, Back and Forward after it: + the start takes what they need, so they never sit over the page's title. */ +[data-slot='title-bar-start'] { + min-width: max-content !important; +} + [data-slot='title-bar'] > :nth-child(5) { margin-inline-end: 136px; } diff --git a/apps/hanzo-desktop/src/desktop-shortcuts.tsx b/apps/hanzo-desktop/src/desktop-shortcuts.tsx index d2afff77..02fcc753 100644 --- a/apps/hanzo-desktop/src/desktop-shortcuts.tsx +++ b/apps/hanzo-desktop/src/desktop-shortcuts.tsx @@ -155,6 +155,31 @@ export const DESKTOP_GLOBAL_KEYS = [ { does: 'Hands-free voice toggle', mac: 'Double-tap Fn', pc: 'Double-tap Fn' }, ] as const; +/** What a key press asks of the window itself (`windowKey`). */ +export type WindowAct = 'new-chat' | 'voice'; + +/** + * The window's own keys, past the ones @hanzo/app answers (its keys.js: ⌘K, + * ⌘⇧O, ⌘B, ⌘, and the rest): ⌘N opens a new chat, as File ▸ New does in a + * desktop app, and ⌘⇧M turns the composer's microphone on and off. Ctrl on + * Windows and Linux. A press something already answered, a repeat, or one + * still composing a character is not a command. Both keys are in @hanzo/app's + * KEYS (patches/@hanzo__app@0.3.107.patch), so its shortcut list names them. + */ +export function windowKey( + e: Pick< + KeyboardEvent, + 'key' | 'metaKey' | 'ctrlKey' | 'shiftKey' | 'altKey' | 'repeat' | 'isComposing' | 'defaultPrevented' + >, +): WindowAct | null { + if (e.defaultPrevented || e.isComposing || e.repeat || e.altKey) return null; + if (!(e.metaKey || e.ctrlKey)) return null; + const key = (e.key ?? '').toLowerCase(); + if (!e.shiftKey && key === 'n') return 'new-chat'; + if (e.shiftKey && key === 'm') return 'voice'; + return null; +} + export function DesktopSettings({ isAuthenticated, siteUrl = 'https://hanzo.ai', diff --git a/apps/hanzo-desktop/src/host.tsx b/apps/hanzo-desktop/src/host.tsx index 3e6e3f0d..9ce7c0ef 100644 --- a/apps/hanzo-desktop/src/host.tsx +++ b/apps/hanzo-desktop/src/host.tsx @@ -1,12 +1,13 @@ -import { useEffect, useState, useSyncExternalStore, type MouseEvent } from 'react'; +import { useEffect, useRef, useState, useSyncExternalStore, type MouseEvent } from 'react'; import { getBrand } from '@hanzo/desktop-brand-config'; import { ORG_KEY } from '@hanzo/event'; import { GuiProvider } from '@hanzo/gui'; import { IamProvider, useIam } from '@hanzo/iam/react'; import { configure, Look, Rooms, type Link, type Router } from '@hanzo/app'; -import { App, type Bar } from '@hanzo/app/App'; +import { App, type Titlebar } from '@hanzo/app/App'; import { empty } from '@hanzo/app/open'; import { useScheme } from '@hanzo/appearance'; +import { Button, Text } from '@hanzo/ui'; import { openUrl } from '@tauri-apps/plugin-opener'; import { ErrorBoundary } from 'react-error-boundary'; @@ -15,12 +16,14 @@ import { createFnVoiceController, createMicLeaseArbitrator, DesktopSettings, + windowKey, } from './desktop-shortcuts'; import { keychain, open as openKeychain, written } from './keychain'; import { buildLocalModelsCatalogResponse, handleLocalChatCompletion, LocalAiManager, + openLocalAiManager, } from './local-ai'; import BenchmarkPage, { LSA_URL, ZEN_27B_TREE_PRESET } from './pages/benchmark'; import { Welcome } from './Welcome'; @@ -57,24 +60,56 @@ configure({ // The session is in the keychain, never the webview's localStorage: the rooms // read the token, its expiry and its claims there. session: keychain, - // THE WINDOW IS THE APP, so there is no site behind it to send a guest to: - // the rooms draw their one room (Chat's free lane) for a signed-out reader, - // and sign-in is one control in the app rather than a wall in front of it. - // Patched into @hanzo/app (patches/@hanzo__app@0.2.63.patch, Orgs.js). - guest: true, -} as Parameters[0]); +}); + +// THE WINDOW IS THE APP, so there is no site behind it to send a guest to: a +// signed-out reader who chose "Not now" gets Chat, answered by the local engine +// (the fetch bridge below), and sign-in is one control in the app rather than a +// wall in front of it. @hanzo/app's Gate lets a reader without a session into +// Chat when `__hanzoAnonChat` is set (`guest()`, `stayGuest()`) and the address +// is /chat. A bundled window opens on its own index (windows/mod.rs `main_url`), +// which is the app's front door, so that address is named for what it is. +if (window.location.pathname === '/' || window.location.pathname === '/index.html') { + window.history.replaceState(null, '', `/chat${window.location.search}${window.location.hash}`); +} + +/** The bar's own control: the local models and node (local-ai.tsx), from any page. */ +function LocalAi() { + return ( + + ); +} // THE WINDOW'S BAR IS THE APP'S. There is no browser around this window, so // the app draws the bar a browser would: the sidebar toggle, Back and Forward // through the router below. macOS paints its traffic lights over the page's // top-left corner (tauri.conf.json: titleBarStyle Overlay), so the bar keeps // 78px clear there; Windows and Linux keep their native title bar above the -// page and need none. The bar drags the window. -const BAR: Bar = { +// page and need none. The bar drags the window. Its controls are the window's: +// Local AI, in place of the minimise, maximise and close a frameless window +// would draw, which the native title bar already has. +const BAR: Titlebar = { inset: /Mac/.test(navigator.userAgent) ? 78 : 0, drag: { 'data-tauri-drag-region': true }, + controls: , }; +/** The composer's microphone, on whatever page draws it. */ +const findMic = () => document.querySelector('button[data-state][aria-pressed]') as HTMLButtonElement | null; + const IAM = { serverUrl: API, proxyBaseUrl: API, @@ -470,21 +505,47 @@ function Gate() { return () => clearTimeout(timer); }, []); + // A new chat, from the global ⇧⌘I or the window's ⌘N: the composer, empty and + // focused. Signed out, it is the same as "Not now" (a guest, in Chat). + const startChat = () => { + if (!isAuthenticated) { + stayGuest(); + setVisiting(true); + } + empty(); + window.history.pushState(null, '', '/chat'); + requestAnimationFrame(() => { + const field = document.querySelector('[data-slot="composer-field"], textarea') as HTMLElement | null; + field?.focus?.(); + }); + }; + const started = useRef(startChat); + started.current = startChat; + + // The window's own keys (desktop-shortcuts `windowKey`): ⌘N and ⌘⇧M. + useEffect(() => { + const onKey = (e: KeyboardEvent) => { + const act = windowKey(e); + if (act === 'new-chat') { + e.preventDefault(); + started.current(); + } else if (act === 'voice') { + const mic = findMic(); + if (!mic || mic.disabled) return; + e.preventDefault(); + mic.click(); + } + }; + window.addEventListener('keydown', onKey); + return () => window.removeEventListener('keydown', onKey); + }, []); + // Wire Tauri desktop global shortcuts ('create-chat' on ⇧⌘I and 'navigate-to-path' from Spotlight) useEffect(() => { let unlistenCreate: (() => void) | undefined; let unlistenNavigate: (() => void) | undefined; - void safeListen('create-chat', () => { - stayGuest(); - setVisiting(true); - empty(); - window.history.pushState(null, '', '/chat'); - requestAnimationFrame(() => { - const field = document.querySelector('[data-slot="composer-field"], textarea') as HTMLElement | null; - field?.focus?.(); - }); - }).then((fn) => { + void safeListen('create-chat', () => started.current()).then((fn) => { unlistenCreate = fn ?? undefined; }); @@ -506,8 +567,6 @@ function Gate() { // Wire Desktop `Fn` key push-to-talk (hold Fn) and hands-free voice (double-tap Fn) // with cross-window / cross-app mic lease arbitration so multiple open Hanzo apps never fight over the mic. useEffect(() => { - const findMic = () => - document.querySelector('button[data-state][aria-pressed]') as HTMLButtonElement | null; const instanceId = `${brand.brand}-${Math.random().toString(36).slice(2, 10)}`; const lease = createMicLeaseArbitrator({ instanceId, diff --git a/hanzo.yml b/hanzo.yml index ff56b79a..83477486 100644 --- a/hanzo.yml +++ b/hanzo.yml @@ -22,10 +22,11 @@ test: # 2026-07-27 and never re-homed, so since then nothing has asserted it. # # It also holds the file to being the ONLY declaration: tauri.conf.json must - # keep POINTING at it rather than restating a number, Cargo.toml must stay the - # inert 0.0.0 the pointer overrides, and apps/hanzo-desktop/package.json must - # declare none (it carried a second copy that agreed only by luck). Each is a - # place a bundle could come to report a version this repo never released. + # keep POINTING at it rather than restating a number, Cargo.toml must repeat + # it exactly (src-tauri/build.rs refuses a build where they differ), and + # apps/hanzo-desktop/package.json must declare none (it carried a second copy + # that agreed only by luck). Each is a place a bundle could come to report a + # version this repo never released. - name: version-drift run: | set -e diff --git a/package.json b/package.json index a5b13137..ea8f1382 100644 --- a/package.json +++ b/package.json @@ -27,6 +27,7 @@ "@hanzo/event": "catalog:", "@hanzo/font": "catalog:", "@hanzo/gui": "catalog:", + "@hanzo/i18n": "catalog:", "@hanzo/iam": "catalog:", "@hanzo/logo": "catalog:", "@hanzo/pay": "catalog:", diff --git a/patches/@hanzo__app@0.2.63.patch b/patches/@hanzo__app@0.2.63.patch deleted file mode 100644 index fa54357d..00000000 --- a/patches/@hanzo__app@0.2.63.patch +++ /dev/null @@ -1,1451 +0,0 @@ -diff --git a/dist/App.js b/dist/App.js -index 692678eedf0205be51f1dde78cfc9bf4a809efdd..67ae64469969b75a66674d5b2c45401800d1ec64 100644 ---- a/dist/App.js -+++ b/dist/App.js -@@ -61,7 +61,7 @@ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime"; - // so the builder's own plans are never drawn. - import { useI18n } from '@hanzo/i18n/react'; - import { lazy, Suspense, useCallback, useEffect, useMemo, useRef, useState } from 'react'; --import { ArrowLeft, ArrowRight, RefreshCw } from 'lucide-react'; -+import { ArrowLeft, ArrowRight, Cloud, RefreshCw, Server, SquareTerminal } from 'lucide-react'; - import { AiProvider } from '@hanzo/ai/react'; - import { XStack, YStack } from '@hanzo/gui'; - import { Builder, HostProvider, PrefsProvider, route, tabs } from '@hanzo/build'; -@@ -139,8 +139,8 @@ function Window({ bar, betas }) { - const here = path ?? '/'; - const at = place(here) ?? HOME; - const mode = at.mode; -- // Tabs, Betas and the hosted apps are their panes alone: no sidebar beside them, and no Dev places in a phone's menu. -- const alone = mode === 'tabs' || mode === 'beta' || mode === 'hosted'; -+ // The hosted apps are their panes alone: no sidebar beside them, and no Dev places in a phone's menu. -+ const alone = mode === 'hosted'; - // The hosted app the address names (lib/hosted), for the rail to light. - const inside = at.mode === 'hosted' ? at.id : null; - const where = at.mode === 'dev' ? at.at : null; -@@ -223,19 +223,58 @@ function Window({ bar, betas }) { - // The app's keys. - useEffect(() => { - const key = (e) => { -+ if (e.defaultPrevented || e.isComposing) -+ return; - if (summons(e)) { - e.preventDefault(); - setFinding((open) => !open); - return; - } -- if (typing(e)) -- return; - const mod = e.metaKey || e.ctrlKey; -- if (mod && !e.shiftKey && !e.altKey && e.key === ',') { -+ const lower = (e.key ?? '').toLowerCase(); -+ // New chat: ⇧⌘O / Ctrl+Shift+O everywhere, plus ⌘N / Ctrl+N in a desktop window. -+ if (mod && !e.altKey && !e.repeat && ((e.shiftKey && lower === 'o') || (bar && !e.shiftKey && lower === 'n'))) { -+ e.preventDefault(); -+ empty(); -+ move(talk()); -+ requestAnimationFrame(() => { -+ const field = document.querySelector('[data-slot="composer-field"], textarea'); -+ if (field && typeof field.focus === 'function') -+ field.focus(); -+ }); -+ return; -+ } -+ // Voice input toggle: ⇧⌘M / Ctrl+Shift+M from anywhere. -+ if (mod && e.shiftKey && !e.altKey && !e.repeat && lower === 'm') { -+ const mic = document.querySelector('button[data-state][aria-pressed]'); -+ if (mic && typeof mic.click === 'function' && !mic.hasAttribute('disabled')) { -+ e.preventDefault(); -+ mic.click(); -+ return; -+ } -+ } -+ // Toggle left sidebar: ⌘B / Ctrl+B anywhere outside contenteditable rich text. -+ if (mod && !e.shiftKey && !e.altKey && !e.repeat && lower === 'b' && !e.target?.isContentEditable) { -+ e.preventDefault(); -+ if (typeof window.matchMedia === 'function' && window.matchMedia('(max-width: 767.98px)').matches) { -+ if (drawer.state === 'open') -+ drawer.close(); -+ else -+ drawer.open(); -+ } -+ else { -+ setClosed((c) => !c); -+ } -+ return; -+ } -+ // Settings: ⌘, / Ctrl+, from anywhere. -+ if (mod && !e.shiftKey && !e.altKey && !e.repeat && e.key === ',') { - e.preventDefault(); - move(settings()); - return; - } -+ if (typing(e)) -+ return; - if (!bar) - return; - const back = (e.metaKey && e.key === '[') || (e.altKey && e.key === 'ArrowLeft'); -@@ -250,7 +289,7 @@ function Window({ bar, betas }) { - }; - window.addEventListener('keydown', key); - return () => window.removeEventListener('keydown', key); -- }, [bar, router, move]); -+ }, [bar, router, move, drawer, setClosed]); - const back = () => move(away.current || app('')); - const toChat = () => move(last.chat || talk()); - const toDev = () => move(last.dev || app('')); -@@ -261,7 +300,14 @@ function Window({ bar, betas }) { - pick(o); - window.location.assign(mode === 'dev' ? app('') : mode === 'studio' ? studio('') : mode === 'tabs' ? TERMINALS : inside ? hosted(inside) : talk()); - }; -- const sidebar = mode === 'beta' || mode === 'hosted' ? [] : mode === 'studio' ? places(maker, (p) => maker.go(p)) : mode === 'dev' && raised(where) === 'customize' -+ const sidebar = mode === 'beta' || mode === 'hosted' ? [] : mode === 'tabs' ? [{ -+ id: 'tabs', -+ links: [ -+ { id: 'terminals', label: t('Terminals'), active: true, icon: _jsx(SquareTerminal, { size: 16, "aria-hidden": true }), onPress: toTabs }, -+ { id: 'machines', label: t('Machines'), active: false, icon: _jsx(Server, { size: 16, "aria-hidden": true }), onPress: () => move(app('-/machines')) }, -+ { id: 'environments', label: t('Environments'), active: false, icon: _jsx(Cloud, { size: 16, "aria-hidden": true }), onPress: () => move(app('-/environments')) }, -+ ], -+ }] : mode === 'studio' ? places(maker, (p) => maker.go(p)) : mode === 'dev' && raised(where) === 'customize' - ? tabs(host, (p) => host.go(p), t).map((group) => ({ ...group, links: [...group.links, { - id: 'learning', label: t('Learning'), active: learning, icon: _jsx(RefreshCw, { size: 16, "aria-hidden": true }), - onPress: () => { shut(); setLearning(true); }, -diff --git a/dist/Betas.js b/dist/Betas.js -index df06a48aef4668408fc6e16d29556e85783bb5cd..4a786c75881ec984df661073c57672cb8efce9c8 100644 ---- a/dist/Betas.js -+++ b/dist/Betas.js -@@ -163,7 +163,7 @@ export function BetasList({ go }) { - /** The Betas list in a dialog, from the rail's More. */ - export function BetasDialog({ open, onOpenChange, go }) { - const { t } = useI18n(); -- 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 })] }) })] })] }) })); -+ 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('Hanzo Market') }), _jsx(ArrowUpRight, { size: 13, "aria-hidden": true })] }) })] })] }) })); - } - /** The Betas view rendered inside the app's main pane under /beta. */ - export function BetasPane({ go }) { -diff --git a/dist/Chat.js b/dist/Chat.js -index ee5162e3bce8b9d1458399ecf9990fab1f1a42b7..f04683e91e4d3932ca14433acd0dc30f131a7f02 100644 ---- a/dist/Chat.js -+++ b/dist/Chat.js -@@ -30,7 +30,7 @@ import { Fragment as _Fragment, jsx as _jsx, jsxs as _jsxs } from "react/jsx-run - import { useCallback, useEffect, useMemo, useRef, useState } from "react"; - import { isolate, phrase } from "@hanzo/i18n"; - import { useI18n } from "@hanzo/i18n/react"; --import { billed, detail, familyOf, planRequired, plainly, refused } from "./failure.js"; -+import { billed, detail, familyOf, ours, planRequired, plainly, refused } from "./failure.js"; - import { english } from "./say.js"; - import { Prose } from "./Prose.js"; - import { useAgent, useAi, useChat, } from "@hanzo/ai/react"; -@@ -42,7 +42,7 @@ import { Face, brief as roomBrief, join, roleOf, roomTurn, roster as rosterLine, - import { cleanForSpeech, speakAgent } from "./speech.js"; - import { AgentMaker, HOUSE, useAgentShelf, useCrew } from "./crew.js"; - import { called } from "./team.js"; --import { Anchor, Box, Button, Text, Tooltip, TooltipContent, TooltipTrigger, View, XStack, YStack } from "@hanzo/ui"; -+import { Anchor, Box, Button, Text, Tooltip, TooltipContent, TooltipTrigger, View, VisuallyHidden, XStack, YStack } from "@hanzo/ui"; - import { useMedia } from "@hanzo/gui"; - import { given, tidy } from "./lib/title.js"; - import { useIam, useIamToken } from "@hanzo/iam/react"; -@@ -50,7 +50,7 @@ import { bearer, hasSession, named, org } from "./lib/session.js"; - import { api } from "./lib/api.js"; - import { app, dev, go } from "./lib/host.js"; - import { useRooms } from "./host.js"; --import { chats, house, paidPlan, paused, setCreditsAfterAllowance, useLimits } from "./lib/limits.js"; -+import { chats, house, paidPlan, paused, setCreditsAfterAllowance, spends, ultra, useLimits } from "./lib/limits.js"; - import { LimitedBanner } from "@hanzo/ui/product/LimitedBanner"; - import { WEB } from "./lib/web.js"; - import { useHydrated } from "./lib/hydrated.js"; -@@ -469,9 +469,8 @@ function Carried({ text, attached, reused, onOpen, onSave, }) { - * "Schedule this" under a question: the quiet control that opens the dialog - * which makes the question run itself (Schedule.tsx). - */ --function Plan({ onPress }) { -- const { t } = useI18n(); -- return (_jsx(XStack, { justify: "flex-end", "data-slot": "plan", children: _jsxs(XStack, { render: "button", "aria-label": t("Schedule this"), onPress: onPress, items: "center", gap: "$1", px: "$1", height: 22, rounded: "$2", cursor: "pointer", opacity: 0.55, hoverStyle: { opacity: 1, bg: "$hover" }, focusStyle: { opacity: 1 }, children: [_jsx(Clock, { size: 12, "aria-hidden": true }), _jsx(Text, { fontSize: "$1", color: "$ink", children: t("Schedule this") })] }) })); -+function Plan() { -+ return null; - } - /** - * The conversation. One component for a visitor and for an account. -@@ -499,7 +498,7 @@ function Thread({ placeholder = message(), initial, anonymous = false, heading, - // THE MODEL AND THE EFFORT are the one choice Chat and Dev share - // (@hanzo/build `useMind`): the catalog from `GET /v1/models` and what the - // reader kept, changed from the composer's chip or from Settings. -- const { t } = useI18n(); -+ const { t, format } = useI18n(); - const target = useMemo(() => ({ api: api(), token: bearer, org: org() }), [anonymous]); // eslint-disable-line react-hooks/exhaustive-deps - // THE PLAN decides what the chip may offer: Free answers from the free lane - // alone, so it opens there and lists the rest as upgrades (@hanzo/build). -@@ -702,10 +701,10 @@ function Thread({ placeholder = message(), initial, anonymous = false, heading, - }; - const listed = mind.models; - const filteredListed = useMemo(() => { -- if (chatPrefs.allowThirdPartyModels) -+ if (anonymous || chatPrefs.allowThirdPartyModels) - return listed; - return listed.filter((m) => isHouseModel(m) || m.id === ENSO || m.id === FREE); -- }, [listed, chatPrefs.allowThirdPartyModels]); -+ }, [listed, anonymous, chatPrefs.allowThirdPartyModels]); - const models = useMemo(() => filteredListed.filter(chats), [filteredListed]); - // EVERY MODEL THE GATEWAY LISTS is offered here, through the one picker, and - // read from the catalog's own fields (`parseModels`): its class, its family. -@@ -717,7 +716,7 @@ function Thread({ placeholder = message(), initial, anonymous = false, heading, - const wanted = mind.model; - // A model the catalog lists is sent as picked, whatever it answers with; only - // a name the catalog does not list falls to one that converses (`served`). -- const sent = anonymous ? FREE : wanted; -+ const sent = wanted && (!anonymous || wanted !== ENSO) ? wanted : anonymous ? FREE : wanted; - const model = persona?.model || (rowOf(sent) ? sent : served(models, sent)); - // THE PLAN'S USAGE (lib/limits.ts), kept current by every chat answer's - // headers and read again whenever a send settles, below. The room draws no -@@ -726,8 +725,6 @@ function Thread({ placeholder = message(), initial, anonymous = false, heading, - // a refusal. - const held = paidPlan(limits); - const pause = notice && (notice.fallback || notice.refused) ? notice : null; -- // The banner's words and ways: the plan by name, when it comes back, and the two ways on. -- const banner = pause ? paused(pause, limits?.plan ?? "", (id) => nameOf(id, listed), Date.now(), t) : null; - // EVERY MODEL IS CHOSEN, never asked for: one the plan does not cover still - // picks, and the gateway answers it with the policy's refusal or from Enso, - // which the room then shows. A turn the gateway refuses `plan_required` -@@ -757,12 +754,32 @@ function Thread({ placeholder = message(), initial, anonymous = false, heading, - }, - ...(open ? { thread: open } : {}), - onError: (e) => { -- const needs = planRequired(e); -+ // A billing refusal's ways are the banner over the composer, Upgrade to -+ // continue first, so only a model the plan lacks opens the plans here. -+ const needs = billed(e) ? null : planRequired(e); - if (needs && free) - setAsk({ ...needs, model: nameOf(model, listed) }); - }, - }); - const { send, set, error, thread: kept } = chat; -+ // THE BANNER'S WORDS AND WAYS (lib/limits `paused`): usage reached, when it -+ // resets, and the ways on; the failed turn says the same words whether or -+ // not the banner is drawn. Try again later puts away this one refusal in -+ // this conversation: it is keyed by the conversation and its last turn, so -+ // the next send, refused again, shows it again. -+ const spent = pause ? paused(pause, limits, (id) => nameOf(id, listed), Date.now(), t, format) : null; -+ const [shut, setShut] = useState(null); -+ const which = pause ? `${kept ?? open ?? ""}:${chat.messages[chat.messages.length - 1]?.id ?? ""}` : null; -+ const banner = which !== shut ? spent : null; -+ // A reset that comes while the banner stands is said when it comes: no time already passed. -+ const [ticks, tick] = useState(0); -+ useEffect(() => { -+ const wait = Date.parse(pause?.resets_at ?? "") - Date.now(); -+ if (!(wait > 0)) -+ return; -+ const id = setTimeout(() => tick((n) => n + 1), Math.min(wait, 2 ** 31 - 1)); -+ return () => clearTimeout(id); -+ }, [pause?.resets_at, ticks]); - // Threads THIS pane opened by writing them. Their transcript is already on - // the screen — it is what was just said — so the restore below has nothing to - // fetch for one, and fetching anyway would race a live conversation to -@@ -883,7 +900,7 @@ function Thread({ placeholder = message(), initial, anonymous = false, heading, - // identity changes on every `setMessages` — `useChat` closes over `messages` — - // so an effect depending on it re-runs after each streamed token. - const latest = useRef(send); -- latest.current = (text) => send(text); -+ latest.current = (text, images) => send(text, images); - // THE COMPOSER'S DRAFT IS HELD HERE, so an arriving question can be typed into - // it. `Chat` owns a draft of its own and spreads `composer` after it, so - // passing value/onChange/onSend takes that ownership over rather than fighting -@@ -958,7 +975,10 @@ function Thread({ placeholder = message(), initial, anonymous = false, heading, - if (queued === null || resolving) - return; - setQueued(null); -- void latest.current(queued); -+ if (typeof queued === "object" && queued !== null) -+ void latest.current(queued.text, queued.images); -+ else -+ void latest.current(queued); - }, [queued, resolving]); - const streaming = useRef(false); - streaming.current = chat.streaming; -@@ -1019,8 +1039,8 @@ function Thread({ placeholder = message(), initial, anonymous = false, heading, - * it leaves its place in the thread and is asked at the end, so it is asked - * once and not twice. - */ -- const speak = useCallback((text, again) => { -- if (!text) -+ const speak = useCallback((text, again, images) => { -+ if (!text && !(images && images.length)) - return; - // Activation: the first question this browser asks (a retry is not one). - if (!again) -@@ -1032,10 +1052,10 @@ function Thread({ placeholder = message(), initial, anonymous = false, heading, - const { [again]: _gone, ...rest } = all; - return rest; - }); -- setQueued(text); -+ setQueued(images && images.length ? { text, images } : text); - return; - } -- void latest.current(text); -+ void latest.current(text, images); - }, []); - // THE WAYS PAST A PAUSE, as the server sends them. A page opens; Continue - // with credits turns the org's choice on and asks the last question again on -@@ -1044,14 +1064,26 @@ function Thread({ placeholder = message(), initial, anonymous = false, heading, - const [actWrong, setActWrong] = useState(""); - const act = useCallback((a) => { - setActWrong(""); -+ if (a.kind === "later") { -+ setShut(which); -+ // The banner leaves; the reader is put back in the field it stood over. -+ document.querySelector('[data-slot="limited-banner"]')?.closest('[data-slot="composer-shell"]')?.querySelector('[data-slot="composer-field"]')?.focus(); -+ return; -+ } -+ // The upgrade opens the plans here, over the app (./Upgrade.js), on the plan the server named. -+ if (a.kind === "upgrade") { -+ setAsk({ href: a.url }); -+ return; -+ } - if (a.kind === "switch") { - if (a.model) - mind.pick(a.model); - return; - } - if (a.kind !== "credits") { -- if (a.url) -- window.location.assign(a.url); -+ const to = ours(a.url); -+ if (to) -+ window.location.assign(to); - return; - } - setCreditsAfterAllowance(true) -@@ -1067,7 +1099,7 @@ function Thread({ placeholder = message(), initial, anonymous = false, heading, - }, - // `mind.pick` is rebuilt each render; the handler follows it. - // eslint-disable-next-line react-hooks/exhaustive-deps -- [reread, speak, failures, mind.model, listed, t]); -+ [reread, speak, failures, mind.model, listed, t, which]); - // A TURN THAT NEVER SPEAKS IS STOPPED. A stream that stays open with nothing - // in it would leave a Stop button and no answer for as long as the upstream - // holds the connection; after `STALL` it is ended and its question is said to -@@ -1255,6 +1287,25 @@ function Thread({ placeholder = message(), initial, anonymous = false, heading, - setPreparing(t("Uploading {files}", { files: names(holding, t) })); - const landedFiles = (await Promise.all(holding.map(landed))).filter((f) => !!f); - spend(at); -+ const localImages = landedFiles.map((f) => f.dataUrl).filter(Boolean); -+ const localTextFiles = landedFiles.filter((f) => typeof f.localText === "string"); -+ if (anonymous || localImages.length || localTextFiles.length) { -+ const localAttached = localTextFiles.map(refOf); -+ const reusedLocal = earlier.filter((f) => !localAttached.some((a) => a.id === f.id)); -+ if (!localAttached.length && !reusedLocal.length) { -+ const promptText = text || (localImages.length ? "What is in this image?" : ""); -+ guarded(extra ? carrying(promptText, extra) : promptText, undefined, localImages.length ? localImages : undefined); -+ return; -+ } -+ const localGrounds = { -+ passages: localTextFiles.map((f, i) => ({ -+ cite: `${f.name} › ¶${i + 1}`, -+ text: String(f.localText || "").slice(0, 100000), -+ })), -+ }; -+ guarded(compose(text, { attached: localAttached, reused: reusedLocal }, localGrounds, undefined, undefined, extra), undefined, localImages.length ? localImages : undefined); -+ return; -+ } - const attached = landedFiles.map(refOf); - const reused = earlier.filter((f) => !attached.some((a) => a.id === f.id)); - const all = [...attached, ...reused]; -@@ -1317,15 +1368,18 @@ function Thread({ placeholder = message(), initial, anonymous = false, heading, - const failure = (question) => { - const failed = failures[question.id]; - const text = words(question.content); -+ const rawImages = Array.isArray(question.content) -+ ? question.content.filter((p) => p?.type === "image_url" && p.image_url?.url).map((p) => p.image_url.url) -+ : undefined; - const whom = addressed(text, room); - const wrong = failed?.error ?? null; - const how = wrong ? refusalOf(wrong) : null; - // A BILLING REFUSAL is said in the gateway's words; its way past — -- // Upgrade, Add prepaid credit — is the banner over the composer. The free -- // plan's cap answers the same until it resets, so it offers no Try again. -+ // Upgrade, Add prepaid credit — is the banner over the composer. Usage spent -+ // until a reset answers the same until then, so it offers no Try again. - const bill = wrong ? billed(wrong) : null; - const resign = !bill && !!wrong && (refused(wrong) || /audience not allowed|invalid access token/i.test(wrong.message)); -- const lift = free ? planRequired(wrong) : null; -+ const lift = free && !bill ? planRequired(wrong) : null; - const said = !failed - ? t("No answer came back for this question.") - : failed.stalled -@@ -1333,7 +1387,7 @@ function Thread({ placeholder = message(), initial, anonymous = false, heading, - : failed.empty - ? t("{model} answered with nothing.", { model: nameOf(model, listed) }) - : bill -- ? banner?.message ?? notice?.message ?? (bill.message || plainly(wrong, t("this conversation"), t)) -+ ? spent?.message ?? (spends(bill.code) ? (ultra(limits) ? t("Your balance is empty.") : t("Usage reached.")) : bill.message || plainly(wrong, t("this conversation"), t)) - : resign - ? t(anonymous - ? "Sign in to ask this." -@@ -1341,13 +1395,13 @@ function Thread({ placeholder = message(), initial, anonymous = false, heading, - : how?.provider - ? t("{model} is unavailable right now.", { model: familyOf(model) || nameOf(model, listed) }) - : plainly(wrong, t("this conversation"), t); -- return (_jsx(Failure, { retryLabel: t("Try again"), onRetry: resign || lift || bill?.code === "free_plan_cap" ? undefined : () => speak(text, question.id), children: _jsxs(YStack, { gap: "$2", children: [_jsxs(Text, { fontSize: "$3", color: "$ink", children: [whom.length ? `${t("No answer from {names}.", { names: join(whom, t) })} ` : "", said] }), how?.provider && wrong ? _jsx(Why, { text: detail(wrong) }) : null, lift || (!bill && (resign || how?.wallet || how?.visitor)) ? (_jsx(XStack, { gap: "$2", flexWrap: "wrap", children: resign ? (_jsx(Button, { size: "sm", onClick: () => { -+ return (_jsx(Failure, { retryLabel: t("Try again"), onRetry: resign || lift || spends(bill?.code ?? "") ? undefined : () => speak(text, question.id, rawImages), children: _jsxs(YStack, { gap: "$2", children: [_jsxs(Text, { fontSize: "$3", color: "$ink", children: [whom.length ? `${t("No answer from {names}.", { names: join(whom, t) })} ` : "", said] }), how?.provider && wrong ? _jsx(Why, { text: detail(wrong) }) : null, _jsxs(XStack, { gap: "$2", flexWrap: "wrap", children: [anonymous || how?.provider ? (_jsx(Button, { size: "sm", variant: "outline", onClick: () => window.dispatchEvent(new CustomEvent("hanzo:open-local-ai", { detail: { tab: "models" } })), children: t("Select / Download Local Model") })) : null, anonymous ? (_jsx(Button, { size: "sm", variant: "outline", onClick: () => window.dispatchEvent(new CustomEvent("hanzo:open-local-ai", { detail: { tab: "node" } })), children: t("Manage Local Node") })) : null, lift || (!bill && (resign || how?.wallet || how?.visitor)) ? (resign ? (_jsx(Button, { size: "sm", onClick: () => { - if (typeof window !== "undefined") { - localStorage.removeItem("hanzo_iam_access_token"); - localStorage.removeItem("hanzo_iam_refresh_token"); - } - enter(LOGIN); -- }, children: t("Sign in") })) : lift ? (_jsx(Button, { size: "sm", variant: "outline", onClick: () => setAsk({ ...lift, model: nameOf(model, listed) }), children: t("Upgrade") })) : how?.visitor ? (_jsx(Button, { size: "sm", variant: "outline", onClick: () => enter(), children: t("Sign in to keep going") })) : (_jsx(Anchor, { href: checkoutUrl(), children: _jsx(Button, { size: "sm", variant: "outline", children: t("Add credit") }) })) })) : null] }) })); -+ }, children: t("Sign in") })) : lift ? (_jsx(Button, { size: "sm", variant: "outline", onClick: () => window.location.assign(payUrl('/cart', { org: org(), returnUrl: window.location.href })), children: t("Upgrade") })) : how?.visitor ? (_jsx(Button, { size: "sm", variant: "outline", onClick: () => enter(), children: t("Sign in to keep going") })) : (_jsx(Anchor, { href: checkoutUrl(), children: _jsx(Button, { size: "sm", variant: "outline", children: t("Add credit") }) }))) : null] })] }) })); - }; - // Dev, from the Summary's Create file or site: a move inside the app where the - // host's app reads the path (hanzo.ai), else Dev on hanzo.ai, as the shell's -@@ -1417,7 +1471,7 @@ function Thread({ placeholder = message(), initial, anonymous = false, heading, - }, - // WHAT GOES WITH THE MESSAGE, above the frame and at its width: the - // pause and its ways past, one chip a file, and talk mode's words. -- head: files.length || turnedAway || prepWrong || preparing || talk.open || talk.refusal || pause ? (_jsxs(_Fragment, { children: [banner ? (_jsx(LimitedBanner, { message: banner.message, actions: banner.actions, onAction: act, onUsage: () => showSettings("usage") })) : null, actWrong ? (_jsx(Text, { role: "alert", "data-slot": "limited-banner-wrong", fontSize: "$2", color: BAD, children: actWrong })) : null, files.length ? (_jsx(XStack, { gap: "$1.5", flexWrap: "wrap", role: "list", "aria-label": t("Attached files"), "data-slot": "composer-attached", children: files.map((one) => (_jsx(HeldChip, { one: one, onOpen: openFile, onRemove: () => drop(at, one.id), onSave: anonymous ? undefined : (url, id) => keepOne(url, id, one.name, one.type) }, one.id))) })) : null, preparing ? (_jsxs(Text, { role: "status", "aria-live": "polite", "data-slot": "composer-preparing", fontSize: "$2", color: "$soft", children: [preparing, "\u2026"] })) : null, turnedAway || prepWrong ? (_jsx(Text, { role: "alert", fontSize: "$2", color: BAD, children: turnedAway || prepWrong })) : null, talk.open || talk.refusal ? (_jsx(Text, { role: "status", "aria-live": "polite", "data-slot": "composer-talk-reply", fontSize: "$2", color: talk.refusal ? BAD : "$soft", children: talk.refusal -+ head: files.length || turnedAway || prepWrong || preparing || talk.open || talk.refusal || pause ? (_jsxs(_Fragment, { children: [banner ? (_jsx(LimitedBanner, { message: banner.message, actions: banner.actions, onAction: act, onUsage: () => showSettings("usage"), labels: { usage: t("See usage"), dismiss: t("Dismiss") } })) : null, actWrong ? (_jsx(Text, { role: "alert", "data-slot": "limited-banner-wrong", fontSize: "$2", color: BAD, children: actWrong })) : null, files.length ? (_jsx(XStack, { gap: "$1.5", flexWrap: "wrap", role: "list", "aria-label": t("Attached files"), "data-slot": "composer-attached", children: files.map((one) => (_jsx(HeldChip, { one: one, onOpen: openFile, onRemove: () => drop(at, one.id), onSave: anonymous ? undefined : (url, id) => keepOne(url, id, one.name, one.type) }, one.id))) })) : null, preparing ? (_jsxs(Text, { role: "status", "aria-live": "polite", "data-slot": "composer-preparing", fontSize: "$2", color: "$soft", children: [preparing, "\u2026"] })) : null, turnedAway || prepWrong ? (_jsx(Text, { role: "alert", fontSize: "$2", color: BAD, children: turnedAway || prepWrong })) : null, talk.open || talk.refusal ? (_jsx(Text, { role: "status", "aria-live": "polite", "data-slot": "composer-talk-reply", fontSize: "$2", color: talk.refusal ? BAD : "$soft", children: talk.refusal - ? worded(talk.refusal) - : talk.reply - ? `Hanzo: ${talk.reply}` -@@ -1476,7 +1530,7 @@ function Thread({ placeholder = message(), initial, anonymous = false, heading, - // Chat keeps to the effort alone until the person asks for more: the family chips, the mode. - chips: anonymous ? undefined : families, - defaults: { chips: false, mode: false }, -- status: anonymous ? null : _jsx(UsageControl, { read: planUsage, context: { model, window: rowOf(model)?.context_window, messages: chat.messages, draft, tools: !anonymous && house(rowOf(model)?.family) ? WEB : undefined } }), -+ status: anonymous || (said.length === 0 && files.length === 0 && !draft.trim()) ? null : _jsx(UsageControl, { read: planUsage, context: { model, window: rowOf(model)?.context_window, messages: chat.messages, draft, tools: !anonymous && house(rowOf(model)?.family) ? WEB : undefined } }), - limits, - onUpgrade: (id) => setAsk({ model: nameOf(id, listed) }), - voice, -@@ -1530,10 +1584,10 @@ function Thread({ placeholder = message(), initial, anonymous = false, heading, - setPlan(null); - }, 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", - // On the rail's line from a tablet up (HEAD, less the pane's edge); a phone's own bar is BAND. -- height: BAND, $md: { height: inPane(HEAD) }, $touchable: { height: inPane(TOUCH_HEAD) }, items: "center", justify: "space-between", gap: "$3", paddingInlineStart: "$4", -+ height: BAND, $md: { height: 48, pt: 4 }, $touchable: { height: inPane(TOUCH_HEAD) }, items: "center", justify: "space-between", gap: "$3", paddingInlineStart: "$4", - // The last mark's centre INSET from the pane's end edge, as the rail's first is from the - // window's start: the edge's 1px, then half the 32px mark. -- paddingInlineEnd: INSET - 1 - 16, shrink: 0, "data-tauri-drag-region": "deep", onMouseDown: dragWindow, onDoubleClick: toggleWindowMaximize, "$max-md": !mine && !room.length ? { display: 'none' } : undefined, children: [_jsxs(XStack, { items: "center", gap: "$2", minW: 0, flex: 1, children: [mine ? (_jsx(Text, { fontSize: 15, lineHeight: 20, color: "$ink", numberOfLines: 1, shrink: 1, minW: 0, children: tidy(mine.title) })) : null, room.length ? (_jsx(XStack, { role: "list", "aria-label": t("Agents in this chat"), items: "center", gap: "$1.5", minW: 0, overflowX: "auto", "$platform-web": { scrollbarWidth: "none" }, children: room.map((name) => (_jsxs(XStack, { role: "listitem", items: "center", gap: "$1.5", paddingInlineStart: "$1", paddingInlineEnd: "$0.5", py: "$0.5", rounded: 999, borderWidth: 1, borderColor: "$borderColor", shrink: 0, children: [_jsx(Face, { src: faces[name]?.avatar ?? (name === withWhom ? portrait : undefined), emoji: faces[name]?.emoji ?? (name === withWhom ? persona?.emoji : undefined), name: name, size: 22 }), _jsx(Text, { fontSize: "$2", fontWeight: "600", color: "$color", numberOfLines: 1, display: "none", $sm: { display: "flex" }, children: name }), _jsx(Box, { render: "button", onClick: () => openAgent(name), "aria-label": t("Remove {name} from this chat", { name }), title: t("Remove {name}", { name }), width: 24, height: 24, rounded: 999, items: "center", justify: "center", hoverStyle: { bg: "$hover" }, children: _jsx(X, { size: 13, "aria-hidden": true, color: "var(--soft, var(--muted-foreground))" }) })] }, name))) })) : null] }), _jsxs(XStack, { "data-slot": "conversation-controls", "data-tauri-drag-region": "false", items: "center", gap: 4, shrink: 0, children: [free ? (_jsxs(Button, { size: "xs", variant: "outline", "data-slot": "header-upgrade", gap: "$1.5", px: "$2.5", py: "$1", rounded: "$4", cursor: "pointer", hoverStyle: { bg: 'var(--white-10)' }, onPress: () => window.location.assign(payUrl('/cart', { org: org(), returnUrl: window.location.href })), "aria-label": t("Upgrade plan"), children: [_jsx(Sparkles, { size: 13, color: "var(--primary)", "aria-hidden": true }), _jsx(Text, { fontSize: "$1", fontWeight: "600", color: "$ink", children: t("Upgrade plan") })] })) : null, open ? _jsx(Share, { thread: open }) : null, said.length > 0 ? (_jsx(ConversationMenu, { threads: currentThreadMap, active: open || currentThread.id, onSchedule: anonymous || forgetful ? undefined : () => setPlan(lastAsked()), children: _jsx(XStack, { children: _jsx(ThreadMore, { t: currentThread }) }) })) : (_jsxs(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") })] })), _jsx(XStack, { "$max-md": { display: 'none' }, children: _jsx(Summary, { sections: sections, onOpen: () => setPanel(true), label: t("Summary") }) }), _jsx(XStack, { "$max-md": { display: 'none' }, children: _jsx(PanelToggle, { open: panel, onToggle: () => setPanel(!panel) }) })] })] }), wide && aside !== null ? (_jsx(Beside, { children: _jsx(Panel, { side: deck, kinds: NONE, onHide: () => setPanel(false), label: t("Tabs"), ...browsing }) })) : null, !wide && panel ? _jsx(Panel, { side: deck, kinds: NONE, sheet: true, onHide: () => setPanel(false), label: t("Tabs"), ...browsing }) : null, _jsx(YStack, { "data-slot": "talk", flex: 1, minH: 0, children: _jsx(ChatSurface, { ...chat, messages: shown, send: guarded, -+ paddingInlineEnd: 12, shrink: 0, "data-tauri-drag-region": "deep", onMouseDown: dragWindow, onDoubleClick: toggleWindowMaximize, "$max-md": !mine && !room.length ? { display: 'none' } : undefined, children: [_jsxs(XStack, { items: "center", gap: "$2", minW: 0, flex: 1, children: [mine ? (_jsx(Text, { fontSize: 15, lineHeight: 20, color: "$ink", numberOfLines: 1, shrink: 1, minW: 0, children: tidy(mine.title) })) : null, room.length ? (_jsx(XStack, { role: "list", "aria-label": t("Agents in this chat"), items: "center", gap: "$1.5", minW: 0, overflowX: "auto", "$platform-web": { scrollbarWidth: "none" }, children: room.map((name) => (_jsxs(XStack, { role: "listitem", items: "center", gap: "$1.5", paddingInlineStart: "$1", paddingInlineEnd: "$0.5", py: "$0.5", rounded: 999, borderWidth: 1, borderColor: "$borderColor", shrink: 0, children: [_jsx(Face, { src: faces[name]?.avatar ?? (name === withWhom ? portrait : undefined), emoji: faces[name]?.emoji ?? (name === withWhom ? persona?.emoji : undefined), name: name, size: 22 }), _jsx(Text, { fontSize: "$2", fontWeight: "600", color: "$color", numberOfLines: 1, display: "none", $sm: { display: "flex" }, children: name }), _jsx(Box, { render: "button", onClick: () => openAgent(name), "aria-label": t("Remove {name} from this chat", { name }), title: t("Remove {name}", { name }), width: 24, height: 24, rounded: 999, items: "center", justify: "center", hoverStyle: { bg: "$hover" }, children: _jsx(X, { size: 13, "aria-hidden": true, color: "var(--soft, var(--muted-foreground))" }) })] }, name))) })) : null] }), _jsxs(XStack, { "data-slot": "conversation-controls", "data-tauri-drag-region": "false", items: "center", gap: 4, shrink: 0, children: [_jsx(Button, { size: "xs", variant: "outline", "data-slot": "header-local-ai", px: "$2.5", py: "$0.5", height: 24, rounded: "$3", cursor: "pointer", hoverStyle: { bg: "$hover" }, onPress: () => window.dispatchEvent(new CustomEvent("hanzo:open-local-ai", { detail: { tab: "models" } })), "aria-label": t("Local AI & Node"), children: _jsx(Text, { fontSize: "$1", fontWeight: "600", color: "$ink", children: t("Local AI") }) }), free ? (_jsxs(Button, { size: "xs", variant: "outline", "data-slot": "header-upgrade", gap: "$1.5", px: "$2.5", py: "$1", rounded: "$4", cursor: "pointer", hoverStyle: { bg: 'var(--white-10)' }, onPress: () => { setAsk({}); window.location.hash = '#pricing'; }, "aria-label": t("Upgrade plan"), children: [_jsx(Sparkles, { size: 13, color: "var(--primary)", "aria-hidden": true }), _jsx(Text, { fontSize: "$1", fontWeight: "600", color: "$ink", children: t("Upgrade plan") })] })) : null, open ? _jsx(Share, { thread: open }) : null, said.length > 0 ? (_jsx(ConversationMenu, { threads: currentThreadMap, active: open || currentThread.id, onSchedule: anonymous || forgetful ? undefined : () => setPlan(lastAsked()), children: _jsx(XStack, { children: _jsx(ThreadMore, { t: currentThread }) }) })) : (_jsxs(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") })] })), (said.length > 0 || files.length > 0 || sections.some((s) => s.entries?.length > 0)) ? (_jsx(XStack, { "$max-md": { display: 'none' }, children: _jsx(Summary, { sections: sections, onOpen: () => setPanel(true), label: t("Summary") }) })) : null, _jsx(XStack, { "$max-md": { display: 'none' }, children: _jsx(PanelToggle, { open: panel, onToggle: () => setPanel(!panel) }) })] })] }), wide && aside !== null ? (_jsx(Beside, { children: _jsx(Panel, { side: deck, kinds: NONE, onHide: () => setPanel(false), label: t("Tabs"), ...browsing }) })) : null, !wide && panel ? _jsx(Panel, { side: deck, kinds: NONE, sheet: true, onHide: () => setPanel(false), label: t("Tabs"), ...browsing }) : null, _jsx(YStack, { "data-slot": "talk", flex: 1, minH: 0, children: _jsx(ChatSurface, { ...chat, messages: shown, send: guarded, - // WHILE NOTHING HAS BEEN SAID, from a tablet up, the opening and the - // composer are one pair centred in the pane (`center`: rows `1fr auto auto - // 1fr`), so the heading reads close above the field and nothing stands at -@@ -1555,8 +1609,7 @@ function Thread({ placeholder = message(), initial, anonymous = false, heading, - // A QUESTION THAT CARRIED PICTURES draws them beside its words. - if (turn.role === "user" && Array.isArray(turn.content)) { - const parts = partsOf(turn.content); -- const asked = parts.flatMap((p) => (p.type === "text" ? [p.text] : [])).join("\n"); -- return (_jsxs(YStack, { gap: "$1", children: [_jsx(Parts, { parts: parts, prose: (text) => _jsx(Prose, { text: text }) }), !anonymous && asked ? _jsx(Plan, { onPress: () => setPlan(asked) }) : null] })); -+ return (_jsx(YStack, { gap: "$1", children: _jsx(Parts, { parts: parts, prose: (text) => _jsx(Prose, { text: text }) }) })); - } - const said = typeof turn.content === "string" ? turn.content : ""; - // A QUESTION THAT CARRIED FILES draws its words and the files' chips; -@@ -1564,7 +1617,7 @@ function Thread({ placeholder = message(), initial, anonymous = false, heading, - if (turn.role === "user" && said) { - const read = told(said); - if (read.carried) -- return (_jsxs(YStack, { gap: "$1", children: [_jsx(Carried, { text: read.text, attached: read.carried.attached, reused: read.carried.reused, onOpen: openFile, onSave: anonymous ? undefined : (url, id, f) => keepOne(url, id, f.name, f.type) }), !anonymous && read.text ? _jsx(Plan, { onPress: () => setPlan(read.text) }) : null] })); -+ return (_jsx(YStack, { gap: "$1", children: _jsx(Carried, { text: read.text, attached: read.carried.attached, reused: read.carried.reused, onOpen: openFile, onSave: anonymous ? undefined : (url, id, f) => keepOne(url, id, f.name, f.type) }) })); - } - // WHILE THE ANSWER HAS NO WORDS YET: who is answering (the agents the - // question addresses, or the whole room when it names nobody), and the -@@ -1598,7 +1651,7 @@ function Thread({ placeholder = message(), initial, anonymous = false, heading, - : []; - return (_jsxs(YStack, { gap: "$3", 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, listen: listen(part.who ?? withWhom ?? undefined), onOpen: opener(part.text) }) : 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)] })); - } -- return (_jsxs(YStack, { gap: "$1", children: [_jsx(Prose, { text: said }), turn.role === "assistant" && said ? _jsx(Reply, { text: said, listen: listen(withWhom ?? undefined), onOpen: opener(said) }) : null, turn.role === "assistant" && said ? byline(turn.id) : null, turn.role === "user" && said && !anonymous ? _jsx(Plan, { onPress: () => setPlan(said) }) : null] })); -+ return (_jsxs(YStack, { gap: "$1", children: [_jsx(Prose, { text: said }), turn.role === "assistant" && said ? _jsx(Reply, { text: said, listen: listen(withWhom ?? undefined), onOpen: opener(said) }) : null, turn.role === "assistant" && said ? byline(turn.id) : null] })); - }, - // The page's ONE heading, and it belongs to the empty transcript rather - // than to a signed-out branch — the branch is gone, and the heading went -@@ -1608,5 +1661,5 @@ function Thread({ placeholder = message(), initial, anonymous = false, heading, - empty: heading === null ? undefined : (_jsxs(YStack, { "data-slot": "opening", items: "center", justify: "flex-end", width: "100%", height: "100%", pt: "$6", pb: "$2", children: [room.length > 1 ? (_jsx(XStack, { items: "center", justify: "center", mb: "$4", children: room.map((name, i) => (_jsx(Box, { marginInlineStart: i ? -16 : 0, rounded: 40, borderWidth: 2, borderColor: "$background", z: room.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, room.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(room, t) || heading || (firstName ? t("What’s up, {name}?", { name: firstName }) : t("What’s up?")) }), room.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] })), - // The transcript reads at the same measure. `Thread` defaults to 768 - // itself; handing it the column here is what lets Width reach it. -- column: { maxW: MEASURE }, composer: composer }) }), _jsx(AgentMaker, {}), carry.dialog, _jsx(Upgrade, { ask: ask, onClose: () => setAsk(null) })] })); -+ column: { maxW: MEASURE }, composer: composer }) }), _jsx(AgentMaker, {}), carry.dialog, _jsx(Upgrade, { ask: ask, onClose: () => setAsk(null) }), _jsx(VisuallyHidden, { role: "status", "aria-live": "polite", "data-slot": "limited-said", children: _jsx(Text, { children: banner?.message ?? "" }) })] })); - } -diff --git a/dist/Column.js b/dist/Column.js -index 43c949a065450c0fc1d21e500c0401f0128a1afd..0a6c0dbaada419646e97c68ea4d2e632651a2aeb 100644 ---- a/dist/Column.js -+++ b/dist/Column.js -@@ -134,5 +134,5 @@ export function Column({ host, mode, thread, go, onShut, onSeek, onBack, drawer - borderColor: 'var(--border-strong)', - bg: 'var(--pane-fill)', - } -- : 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' || mode === 'hosted' || at ? _jsx(YStack, { flex: 1, minH: 0 }) : _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, { go: go })] })), free ? (_jsx(YStack, { role: "list", gap: 2, shrink: 0, pt: "$2", children: _jsx(YStack, { role: "listitem", minH: MARK, justify: "center", 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') }))] })); -+ : 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 === 'beta' && !drawer ? _jsx(YStack, { "data-slot": "beta-sidebar-slot", flex: 1, minH: 0, overflowY: "auto", pt: "$1" }) : mode === 'studio' || mode === 'beta' || mode === 'hosted' || at ? _jsx(YStack, { flex: 1, minH: 0 }) : _jsx(Recents, { host: host, mode: mode, thread: thread, onOpen: open, onNew: create }), at || mode === 'beta' ? null : (_jsxs(YStack, { gap: "$2", pt: "$2", shrink: 0, children: [_jsx(Made, {}), _jsx(Setup, { go: go })] })), free && mode !== 'beta' ? (_jsx(YStack, { role: "list", gap: 2, shrink: 0, pt: "$2", children: _jsx(YStack, { role: "listitem", minH: MARK, justify: "center", 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.hash = '#pricing'; window.dispatchEvent(new CustomEvent('hanzo:upgrade')); }, ...keys(() => { window.location.hash = '#pricing'; window.dispatchEvent(new CustomEvent('hanzo:upgrade')); }), 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') }))] })); - } -diff --git a/dist/Directory.js b/dist/Directory.js -index 34519491f2da17a29946555c713a8ba2fabcdfa0..49540b1cb645dd45ae9a5256e63b176c16a56b30 100644 ---- a/dist/Directory.js -+++ b/dist/Directory.js -@@ -218,7 +218,7 @@ export function Catalog({ tab }) { - return (rows ?? []).filter((r) => !q || r.name.toLowerCase().includes(q) || r.description.toLowerCase().includes(q)); - }, [rows, query]); - const quiet = (text, action) => (_jsxs(YStack, { gap: "$3", py: "$4", items: "flex-start", children: [_jsx(Text, { fontSize: "$3", color: "$soft", children: text }), action] })); -- return (_jsxs(YStack, { gap: "$4", children: [_jsxs(XStack, { items: "center", justify: "space-between", gap: "$2", flexWrap: "wrap", children: [_jsxs(XStack, { items: "center", gap: "$2", flex: 1, minW: 180, children: [_jsx(Search, { size: 14, "aria-hidden": true }), _jsx(Input, { value: query, onChangeText: setQuery, placeholder: search, "aria-label": search, flex: 1 })] }), _jsx(Action, { render: "button", onPress: () => window.open('https://hanzo.market', '_blank', 'noopener,noreferrer'), $touchable: { minH: 36 }, children: _jsxs(XStack, { items: "center", gap: "$1.5", children: [_jsx(Compass, { size: 14, "aria-hidden": true }), _jsx(Text, { fontSize: "$2", fontWeight: "500", children: t('Explore on hanzo.market') }), _jsx(ArrowUpRight, { size: 13, "aria-hidden": true })] }) })] }), tab === 'channels' && !signed ? (quiet(t('Sign in to see the channels your organization can connect.'), _jsx(Action, { render: "button", onPress: () => enter(), $touchable: { minH: 44, minW: 44 }, children: t('Sign in') }))) : wrong ? (quiet(say(wrong, t('the channels'), 'read', t), _jsx(Action, { render: "button", onPress: () => setTurn((n) => n + 1), $touchable: { minH: 44, minW: 44 }, children: t('Try again') }))) : rows === null ? (quiet(t(tab === 'channels' ? 'Loading channels…' : 'Loading works with…'))) : shown.length > 0 ? (_jsxs(_Fragment, { children: [_jsx(Text, { fontSize: "$3", color: "$soft", children: shown.length === 1 ? t('1 result') : t('{n} results', { n: shown.length }) }), _jsx(YStack, { maxH: 380, overflowY: "auto", overflowX: "hidden", paddingInlineEnd: "$1", width: "100%", children: _jsx(Grid, { columns: tab === 'channels' ? { min: 168, max: 4 } : { min: 240, max: 2 }, gap: 12, children: shown.map((r) => tab === 'channels' ? (_jsx(Channel, { row: r, onChange: () => setTurn((n) => n + 1) }, r.id)) : (_jsx(RowCard, { row: r, tab: tab }, r.id))) }) })] })) : (quiet(query ? t('Nothing matches “{query}”.', { query }) : t(tab === 'channels' ? 'No channel can be connected here yet.' : 'Nothing is listed yet.')))] })); -+ return (_jsxs(YStack, { gap: "$4", children: [_jsxs(XStack, { items: "center", justify: "space-between", gap: "$2", flexWrap: "wrap", children: [_jsxs(XStack, { items: "center", gap: "$2", flex: 1, minW: 180, children: [_jsx(Search, { size: 14, "aria-hidden": true }), _jsx(Input, { value: query, onChangeText: setQuery, placeholder: search, "aria-label": search, flex: 1 })] }), _jsx(Action, { render: "button", onPress: () => window.open('https://hanzo.market', '_blank', 'noopener,noreferrer'), $touchable: { minH: 36 }, children: _jsxs(XStack, { items: "center", gap: "$1.5", children: [_jsx(Compass, { size: 14, "aria-hidden": true }), _jsx(Text, { fontSize: "$2", fontWeight: "500", children: t('Hanzo Market') }), _jsx(ArrowUpRight, { size: 13, "aria-hidden": true })] }) })] }), tab === 'channels' && !signed ? (quiet(t('Sign in to see the channels your organization can connect.'), _jsx(Action, { render: "button", onPress: () => enter(), $touchable: { minH: 44, minW: 44 }, children: t('Sign in') }))) : wrong ? (quiet(say(wrong, t('the channels'), 'read', t), _jsx(Action, { render: "button", onPress: () => setTurn((n) => n + 1), $touchable: { minH: 44, minW: 44 }, children: t('Try again') }))) : rows === null ? (quiet(t(tab === 'channels' ? 'Loading channels…' : 'Loading works with…'))) : shown.length > 0 ? (_jsxs(_Fragment, { children: [_jsx(Text, { fontSize: "$3", color: "$soft", children: shown.length === 1 ? t('1 result') : t('{n} results', { n: shown.length }) }), _jsx(YStack, { maxH: 380, overflowY: "auto", overflowX: "hidden", paddingInlineEnd: "$1", width: "100%", children: _jsx(Grid, { columns: tab === 'channels' ? { min: 168, max: 4 } : { min: 240, max: 2 }, gap: 12, children: shown.map((r) => tab === 'channels' ? (_jsx(Channel, { row: r, onChange: () => setTurn((n) => n + 1) }, r.id)) : (_jsx(RowCard, { row: r, tab: tab }, r.id))) }) })] })) : (quiet(query ? t('Nothing matches “{query}”.', { query }) : t(tab === 'channels' ? 'No channel can be connected here yet.' : 'Nothing is listed yet.')))] })); - } - function RowCard({ row, tab }) { - const { t } = useI18n(); -diff --git a/dist/Market.js b/dist/Market.js -index 4a49e6f7a7a377309c1a21a724326cfe930375de..fb366881ad4a32a59fc0e78a288740808ae0c19d 100644 ---- a/dist/Market.js -+++ b/dist/Market.js -@@ -138,7 +138,7 @@ export function Market({ scope }) { - return _jsx(Empty, { children: "Sign in to browse agents you can add." }); - if (failed) - return _jsx(Empty, { children: say(failed, 'the marketplace') }); -- return (_jsxs(YStack, { flex: 1, minH: 0, children: [_jsxs(YStack, { p: "$5", gap: "$2", borderBottomWidth: 1, borderColor: "$borderColor", children: [_jsxs(Text, { fontSize: "$7", lineHeight: "$7", fontWeight: "500", color: "$ink", children: ["Put AI to work in ", brand()] }), _jsxs(Text, { fontSize: "$3", color: "$soft", children: ["Browse agents that bring your tools into ", brand(), "."] }), _jsxs(XStack, { items: "center", justify: "space-between", flexWrap: "wrap", gap: "$2", mt: "$2", children: [_jsxs(XStack, { width: 420, maxW: "100%", height: 36, items: "center", gap: "$2", px: "$3", rounded: "$3", borderWidth: 1, borderColor: "$borderColor", children: [_jsx(Search, { size: 14, "aria-hidden": true }), _jsx(Text, { render: _jsx("input", { value: ask, onChange: (e) => setAsk(e.target.value), placeholder: "Search agents" }), flex: 1, bg: "transparent", borderWidth: 0, outlineStyle: "none", color: "inherit" })] }), _jsxs(XStack, { render: "button", onPress: () => window.open('https://hanzo.market', '_blank', 'noopener,noreferrer'), height: 36, px: "$3", rounded: "$3", borderWidth: 1, borderColor: "$borderColor", items: "center", gap: "$1.5", cursor: "pointer", hoverStyle: { bg: '$hover' }, children: [_jsx(Compass, { size: 14, "aria-hidden": true }), _jsx(Text, { fontSize: "$2", fontWeight: "500", color: "$ink", children: "Explore on hanzo.market" }), _jsx(ArrowUpRight, { size: 13, "aria-hidden": true, color: "$soft" })] })] })] }), !listings ? (_jsx(Empty, { children: "Reading the shelf." })) : shown.length === 0 ? (_jsx(Empty, { children: scope === 'installed' -+ return (_jsxs(YStack, { flex: 1, minH: 0, children: [_jsxs(YStack, { p: "$5", gap: "$2", borderBottomWidth: 1, borderColor: "$borderColor", children: [_jsxs(Text, { fontSize: "$7", lineHeight: "$7", fontWeight: "500", color: "$ink", children: ["Put AI to work in ", brand()] }), _jsxs(Text, { fontSize: "$3", color: "$soft", children: ["Browse agents that bring your tools into ", brand(), "."] }), _jsxs(XStack, { items: "center", justify: "space-between", flexWrap: "wrap", gap: "$2", mt: "$2", children: [_jsxs(XStack, { width: 420, maxW: "100%", height: 36, items: "center", gap: "$2", px: "$3", rounded: "$3", borderWidth: 1, borderColor: "$borderColor", children: [_jsx(Search, { size: 14, "aria-hidden": true }), _jsx(Text, { render: _jsx("input", { value: ask, onChange: (e) => setAsk(e.target.value), placeholder: "Search agents" }), flex: 1, bg: "transparent", borderWidth: 0, outlineStyle: "none", color: "inherit" })] }), _jsxs(XStack, { render: "button", onPress: () => window.open('https://hanzo.market', '_blank', 'noopener,noreferrer'), height: 36, px: "$3", rounded: "$3", borderWidth: 1, borderColor: "$borderColor", items: "center", gap: "$1.5", cursor: "pointer", hoverStyle: { bg: '$hover' }, children: [_jsx(Compass, { size: 14, "aria-hidden": true }), _jsx(Text, { fontSize: "$2", fontWeight: "500", color: "$ink", children: "Hanzo Market" }), _jsx(ArrowUpRight, { size: 13, "aria-hidden": true, color: "$soft" })] })] })] }), !listings ? (_jsx(Empty, { children: "Reading the shelf." })) : shown.length === 0 ? (_jsx(Empty, { children: scope === 'installed' - ? 'No agents installed yet.' - : ask - ? 'Nothing in the registry matches that.' -diff --git a/dist/Me.js b/dist/Me.js -index 72a29de8b268d6ec3575253cb26d1570045f8280..1fdf5a8239a02841aa6fcf63ac5a5261fa639833 100644 ---- a/dist/Me.js -+++ b/dist/Me.js -@@ -133,7 +133,7 @@ function Line({ icon, children, sub, trail }) { - return (_jsxs(_Fragment, { children: [icon !== undefined ? (_jsx(XStack, { width: 16, height: 16, items: "center", justify: "center", shrink: 0, children: icon })) : null, _jsxs(YStack, { flex: 1, minW: 0, children: [_jsx(SizableText, { size: "$2", color: "$ink", numberOfLines: 1, children: children }), sub ? (_jsx(SizableText, { size: "$1", color: "$soft", numberOfLines: 1, children: sub })) : null] }), trail] })); - } - /** An organization's mark in the list: its initials on a rounded square. */ --const Mark = ({ org }) => (_jsx(XStack, { width: 16, height: 16, rounded: "$2", items: "center", justify: "center", bg: "$raised", shrink: 0, children: org.personal ? (_jsx(SizableText, { size: "$1", fontWeight: "600", color: "$ink", children: initials(org.display).charAt(0) })) : (_jsx(Building2, { size: 12, "aria-hidden": true })) })); -+const Mark = ({ org }) => (_jsx(XStack, { width: 16, height: 16, rounded: "$2", items: "center", justify: "center", bg: "$raised", shrink: 0, children: org?.personal ? (_jsx(SizableText, { size: "$1", fontWeight: "600", color: "$ink", children: initials(org.display).charAt(0) })) : (_jsx(Building2, { size: 12, "aria-hidden": true })) })); - /** - * The plans row, named by the plan the organization is on: Enterprise and - * Agency are plans a person stays on, so the row names theirs; every other -@@ -178,7 +178,7 @@ export function Me({ host, narrow = false, above = false, onOrg, defaultAccountO - // A personal plan is bought for the personal organization, beside any business one. - // The plans row's name (a phrase of `upgrade`'s). - const plans = upgrade(read.value?.label?.name); -- const getPro = () => (personal ? window.location.assign(payUrl('/cart', { org: personal.name, returnUrl: window.location.href })) : window.location.assign(payUrl('/cart', { returnUrl: window.location.href }))); -+ const getPro = () => { window.location.hash = '#pricing'; window.dispatchEvent(new CustomEvent('hanzo:upgrade')); }; - const apple = mac(); - useEffect(() => { - if (above) -@@ -203,7 +203,7 @@ export function Me({ host, narrow = false, above = false, onOrg, defaultAccountO - }); - }; - if (!host.person) -- return null; -+ return _jsx(Shortcuts, { open: keys, onOpenChange: setKeys, apple: apple }); - return (_jsxs(_Fragment, { children: [_jsxs(DropdownMenu, { open: open, onOpenChange: (next) => { - setOpen(next); - if (next) -@@ -214,16 +214,16 @@ export function Me({ host, narrow = false, above = false, onOrg, defaultAccountO - setHelp(false); - }, - // Toward the content from the rail, and aligned as the row's own edge is: mirrored right to left. -- placement: narrow && !above ? (rtl ? 'left-end' : 'right-end') : above !== rtl ? 'top-end' : 'top-start', -+ placement: narrow && !above ? (rtl ? 'top-end' : 'top-start') : above !== rtl ? 'top-end' : 'top-start', - // Clear of the rail's mark (or the row) it opens from, and flush with its foot. -- offset: 8, children: [_jsx(DropdownMenuTrigger, { asChild: true, children: _jsxs(XStack, { ref: (el) => { -+ offset: narrow && !above ? 4 : 8, children: [_jsx(DropdownMenuTrigger, { asChild: true, children: _jsxs(XStack, { ref: (el) => { - row.current = el instanceof HTMLElement ? el : null; - }, 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, - // A thumb's 44 on a touch screen. - $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) => { - e?.stopPropagation?.(); - getPro(); -- }, 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: () => showSettings('usage'), children: _jsx(Line, { icon: _jsx(Activity, { size: 16, "aria-hidden": true }), children: t('Usage') }) }), _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) => { -+ }, cursor: "pointer", children: t('Upgrade plan') })) : null, _jsx(ChevronsUpDown, { size: 14, "aria-hidden": true, opacity: 0.6 })] }))] }) }), _jsxs(DropdownMenuContent, { minW: narrow && !above ? 280 : 260, width: narrow && !above ? 280 : undefined, 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: () => showSettings('usage'), children: _jsx(Line, { icon: _jsx(Activity, { size: 16, "aria-hidden": true }), children: t('Usage') }) }), _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) => { - setLang(next); - if (!next) - setLangQuery(''); -diff --git a/dist/Orgs.js b/dist/Orgs.js -index ad13a575fe1f80fb275d2266896c069893fdc523..1851941403a31f2391c97fe647d9247b1c2eebda 100644 ---- a/dist/Orgs.js -+++ b/dist/Orgs.js -@@ -190,8 +190,15 @@ export function Orgs({ children, front = false, forward, signup = false, }) { - return front && Landing && !hasSession() && !arriving ? _jsx(Landing, {}) : _jsxs(_Fragment, { children: [_jsx(Held, { veiled: true, children: children }), _jsx(Veil, {})] }); - if (arriving && !isAuthenticated) - return _jsx(SignIn, { to: LOGIN }); -- if (!isAuthenticated) -+ if (!isAuthenticated) { -+ // A HOST THAT IS THE APP ITSELF opens its one room to a guest: the -+ // desktop window has no site behind it to send a stranger to, and Chat -+ // already draws the same room for everyone (`anonymous` is its free -+ // lane). Everything else sends the visitor to its sign-in. -+ if (where().guest) -+ return children; - return front && Landing ? _jsx(Landing, {}) : signup && Signup ? _jsx(Signup, {}) : _jsx(SignIn, {}); -+ } - if (founding) - return _jsx(Start, { founded: founding, onFounded: setFounding, first: members.length === 0 }); - if (members.length === 0) { -diff --git a/dist/Palette.js b/dist/Palette.js -index e5d58960b65d8308166cf65ea7cae10d8d246f8b..9203489013655e2f4bbb4558b5550fae70b6154a 100644 ---- a/dist/Palette.js -+++ b/dist/Palette.js -@@ -129,7 +129,7 @@ function tune(go) { - export function actions(host, go, signOut, keys, t = english) { - const upload = host ? library(host, (p) => go(app(p)), t)[0]?.links.find((l) => l.id === 'upload') : undefined; - const list = [ -- { id: 'new-chat', label: t('New chat'), icon: _jsx(SquarePen, { ...ICON }), run: () => (empty(), go(talk())) }, -+ { id: 'new-chat', label: t('New chat'), icon: _jsx(SquarePen, { ...ICON }), shortcut: ['Mod', 'N'], run: () => (empty(), go(talk())) }, - { id: 'new-task', label: t('New Dev task'), icon: _jsx(Code2, { ...ICON }), keywords: ['run'], run: () => go(app('')) }, - { id: 'new-creation', label: t('New Studio creation'), icon: _jsx(WandSparkles, { ...ICON }), keywords: ['image', 'video'], run: () => go(studio('')) }, - { id: 'new-scheduled', label: t('New scheduled task'), icon: _jsx(Clock, { ...ICON }), keywords: ['automation'], run: () => go(app(written({ kind: 'automation', id: 'new' }))) }, -diff --git a/dist/Rail.js b/dist/Rail.js -index eec4d26eceff5131c028a8b459b452466877db4a..0a8ed8a7cd26803f6db0aca2fc5ad778fd76d6e1 100644 ---- a/dist/Rail.js -+++ b/dist/Rail.js -@@ -34,7 +34,7 @@ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime"; - // lead there. Chat and Dev are the phone's bar's (Top.tsx), and the account is - // the menu's foot. - import { useI18n } from '@hanzo/i18n/react'; --import { Clock, Code2, Compass, Ellipsis, FlaskConical, Library, MessageSquare, PanelLeft, Puzzle, Sparkles, SquareTerminal, Users, WandSparkles } from 'lucide-react'; -+import { Bot, Clock, Code2, Compass, Ellipsis, FlaskConical, Library, MessageSquare, PanelLeft, Puzzle, Sparkles, SquareTerminal, Users, WandSparkles } from 'lucide-react'; - import { useState } from 'react'; - import { Text, XStack, YStack } from '@hanzo/gui'; - import { route } from '@hanzo/build'; -@@ -108,25 +108,22 @@ export function Rail({ host, mode, at, open, toggle, inside = null, rows = false - { key: 'library', label: t('Library'), icon: _jsx(Library, { size: 16, "aria-hidden": true }), onSelect: to(RAISED.library) }, - { key: 'scheduled', label: t('Scheduled tasks'), icon: _jsx(Clock, { size: 16, "aria-hidden": true }), onSelect: to(RAISED.scheduled) }, - { key: 'customize', label: t('Customize'), icon: _jsx(Puzzle, { size: 16, "aria-hidden": true }), onSelect: to(RAISED.customize) }, -- ...(team ? [{ type: 'separator', key: 'raised' }] : []), -- ] -- : []), -- ...(team -- ? [ -- { key: 'team', label: 'Team', icon: _jsx(Users, { size: 16, "aria-hidden": true }), onSelect: () => out(WORKSPACE) }, -- ...granted.map((b) => ({ key: `beta-${b.id}`, label: b.name, icon: _jsx(Sparkles, { size: 16, "aria-hidden": true }), onSelect: () => out(b.href) })), -- { type: 'separator', key: 'betas-rule' }, -- { key: 'betas', label: t('Betas'), icon: _jsx(FlaskConical, { size: 16, "aria-hidden": true }), onSelect: () => go('/beta') }, -- { key: 'market', label: t('Explore on hanzo.market'), icon: _jsx(Compass, { size: 16, "aria-hidden": true }), onSelect: () => out('https://hanzo.market') }, -+ { type: 'separator', key: 'raised' }, - ] - : []), -+ { key: 'bot', label: 'Bot', icon: _jsx(Bot, { size: 16, "aria-hidden": true }), onSelect: () => go('/bot') }, -+ ...(onStudio ? [{ key: 'studio', label: 'Studio', icon: _jsx(WandSparkles, { size: 16, "aria-hidden": true }), onSelect: onStudio }] : []), -+ { key: 'team', label: 'Team', icon: _jsx(Users, { size: 16, "aria-hidden": true }), onSelect: () => out(WORKSPACE) }, -+ ...granted.map((b) => ({ key: `beta-${b.id}`, label: b.name, icon: _jsx(Sparkles, { size: 16, "aria-hidden": true }), onSelect: () => out(b.href) })), -+ { type: 'separator', key: 'market-rule' }, -+ { key: 'market', label: t('Hanzo Market'), icon: _jsx(Compass, { size: 16, "aria-hidden": true }), onSelect: () => out('https://hanzo.market') }, - ]; - const betasDialog = _jsx(BetasDialog, { open: betas, onOpenChange: setBetas, go: reach }); - if (rows) - 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 }) }) }), 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))), _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] })); - return (_jsxs(YStack, { "data-slot": "rail", render: "nav", "aria-label": t('Products'), width: RAIL, flex: 1, - // The first mark stands at the pane's top edge, one head row high (HEAD), the account on the sidebar's foot (Column's `pb`). -- pt: (HEAD - MARK) / 2, pb: "$2", gap: 4, shrink: 0, items: "center", $touchable: { pt: (TOUCH_HEAD - TOUCH) / 2 }, 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 }) }), 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(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 -+ pt: (HEAD - MARK) / 2, pb: 0, gap: 4, shrink: 0, items: "center", $touchable: { pt: (TOUCH_HEAD - TOUCH) / 2 }, 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 }) }), 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(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 - // Toward the content: right of the rail, left of it right to left. - , { - // Toward the content: right of the rail, left of it right to left. -diff --git a/dist/Recents.js b/dist/Recents.js -index 9ce2fc36721298ef1507061e3f6f54a6e4085393..271851e82572b09e5b1673c251363a61a0e6049e 100644 ---- a/dist/Recents.js -+++ b/dist/Recents.js -@@ -15,6 +15,7 @@ import { DOTS, route, useSessions } from '@hanzo/build'; - import { DropdownMenu } from '@hanzo/ui'; - import { SidebarItem, StatusDot } from '@hanzo/ui/chat'; - import { useKept } from './kept.js'; -+import { hasSession } from './lib/session.js'; - import { arrange, chats, MENUS, PINNED, PLAIN, runs, SINCE, UNFILED, UNTITLED, UNTITLED_RUN, viewOf } from './recent.js'; - import { ConversationMenu, ThreadRow, useThreadList } from './thread.js'; - /** The menu's items: each section a heading and its options (recent.ts's phrases, drawn through `t`), the one in force checked. */ -@@ -44,9 +45,11 @@ export function Recents({ host, mode, thread, onOpen, onNew, }) { - /** Chat's Recents: the conversation store alone, the archived ones when the view asks for them. */ - function Chats({ thread, view, keep, onOpen, onNew, }) { - const store = useThreadList(view.status === 'archived', thread); -+ // A refusal with no session is not a broken list: a guest has no chats. -+ const error = hasSession() ? store.error : null; - const rows = useMemo(() => chats(store.threads), [store.threads]); - const byId = useMemo(() => new Map(store.threads.map((t) => [t.id, t])), [store.threads]); -- return (_jsx(List, { mode: "chat", rows: rows, view: view, keep: keep, open: (r) => r.id === thread, reading: store.loading && !store.threads.length, error: store.error, onOpen: onOpen, threads: byId, held: thread, onNew: onNew })); -+ return (_jsx(List, { mode: "chat", rows: rows, view: view, keep: keep, open: (r) => r.id === thread, reading: store.loading && !store.threads.length, error, onOpen: onOpen, threads: byId, held: thread, onNew: onNew })); - } - /** Dev's Recents: the org's coding runs alone. */ - function Runs({ host, view, keep, onOpen }) { -@@ -63,7 +66,9 @@ function Runs({ host, view, keep, onOpen }) { - reload(); - }, [run, store.loading, store.value, reload]); - const rows = useMemo(() => runs(store.value), [store.value]); -- return (_jsx(List, { mode: "dev", rows: rows, view: view, keep: keep, open: (row) => row.id === run, reading: store.loading && !store.value.length, error: store.error, onOpen: onOpen })); -+ // A refusal with no session is not a broken list: a guest has no runs. -+ const error = hasSession() ? store.error : null; -+ return (_jsx(List, { mode: "dev", rows: rows, view: view, keep: keep, open: (row) => row.id === run, reading: store.loading && !store.value.length, error, onOpen: onOpen })); - } - function List({ mode, rows, view, keep, open, reading, error, onOpen, threads, held = null, onNew, }) { - const { t } = useI18n(); -diff --git a/dist/Setup.js b/dist/Setup.js -index b7d68e841af6f7ef6badcb702b2b86c3dacdd8c6..911685c42c75775fc858d2ab864e4fcd1cd7f1f6 100644 ---- a/dist/Setup.js -+++ b/dist/Setup.js -@@ -40,6 +40,50 @@ export const STEP_KEY = 'hanzo.onboarding.step'; - export const PLUGIN_KEY = 'hanzo.onboarding.plugin'; - /** Where plugins and connectors live: Dev's Customize. */ - const PLUGINS = '-/customize/plugins'; -+/** Null when neither answered. /v1/connection lists `connections`; nothing else is read from it. */ -+export function linked(providersData, connectionsData) { -+ const providers = providersData?.providers; -+ const connections = connectionsData?.connections; -+ const fromProviders = Array.isArray(providers) ? providers : null; -+ const fromConnections = Array.isArray(connections) ? connections : null; -+ if (!fromProviders && !fromConnections) -+ return null; -+ const ids = new Set(); -+ const google = []; -+ const address = (id, account) => { -+ if (id === 'google' && typeof account === 'string' && account.trim()) -+ google.push(account.trim().toLowerCase()); -+ }; -+ for (const p of fromProviders ?? []) { -+ if (!p.connected) -+ continue; -+ const id = String(p.id); -+ ids.add(id); -+ address(id, p.connection?.account); -+ } -+ for (const c of fromConnections ?? []) { -+ const id = String(c.provider); -+ ids.add(id); -+ address(id, c.account); -+ } -+ const own = ids.has('github-user'); -+ return { -+ ids, -+ google, -+ github: own || ids.has('github') || ids.has('github-copilot'), -+ own, -+ whole: Boolean(fromProviders && fromConnections), -+ }; -+} -+/** Where Disconnect lets go of GitHub: the reader's own link, or the org's App accounts. */ -+export const leaving = (own) => (own ? '/v1/provider/github/user/disconnect' : '/v1/provider/github/disconnect'); -+/** -+ * Said on the window when GitHub's connection changes, here or on Projects and -+ * Settings (@hanzo/build, which says and hears the same name), so each reads it -+ * again without a reload. Setup hears its own word too. -+ */ -+export const GITHUB_CHANGED = 'hanzo:github'; -+const changed = () => window.dispatchEvent(new Event(GITHUB_CHANGED)); - /** Inline Slack Mark */ - function SlackMark({ size = 18 }) { - return (_jsxs("svg", { width: size, height: size, viewBox: "0 0 54 54", fill: "none", "aria-hidden": true, children: [_jsx("path", { d: "M11.379 33.9993C11.379 37.1358 8.84512 39.6507 5.7276 39.6507C2.61008 39.6507 0.0572205 37.1168 0.0572205 33.9993C0.0572205 30.8817 2.5911 28.3479 5.70862 28.3479H11.36V33.9993H11.379Z", fill: "#E01E5A" }), _jsx("path", { d: "M14.1962 33.9997C14.1962 30.8632 16.7301 28.3483 19.8476 28.3483C22.9651 28.3483 25.499 30.8822 25.499 33.9997V48.1353C25.499 51.2718 22.9651 53.7867 19.8476 53.7867C16.7301 53.7867 14.1962 51.2718 14.1962 48.1353V33.9997Z", fill: "#E01E5A" }), _jsx("path", { d: "M19.8662 11.2673C16.7296 11.2673 14.2148 8.73347 14.2148 5.61594C14.2148 2.49842 16.7486 -0.0354538 19.8662 -0.0354538C22.9837 -0.0354538 25.5175 2.49842 25.5175 5.61594V11.2673H19.8662Z", fill: "#36C5F0" }), _jsx("path", { d: "M19.8682 14.1334C23.0047 14.1334 25.5196 16.6673 25.5196 19.7848C25.5196 22.9023 22.9857 25.4362 19.8682 25.4362H5.67566C2.53916 25.4362 0.0242615 22.9023 0.0242615 19.7848C0.0242615 16.6673 2.55814 14.1334 5.67566 14.1334H19.8682Z", fill: "#36C5F0" }), _jsx("path", { d: "M42.5323 19.7853C42.5323 16.6488 45.0662 14.1339 48.1837 14.1339C51.3012 14.1339 53.8351 16.6678 53.8351 19.7853C53.8351 22.9028 51.3012 25.4367 48.1837 25.4367H42.5323V19.7853Z", fill: "#2EB67D" }), _jsx("path", { d: "M39.7126 19.7934C39.7126 22.9299 37.1787 25.4448 34.0612 25.4448C30.9436 25.4448 28.4098 22.911 28.4098 19.7934V5.61986C28.4098 2.48336 30.9436 -0.0315399 34.0612 -0.0315399C37.1787 -0.0315399 39.7126 2.48336 39.7126 5.61986V19.7934Z", fill: "#2EB67D" }), _jsx("path", { d: "M34.0376 42.482C37.1741 42.482 39.689 45.0158 39.689 48.1334C39.689 51.2509 37.1552 53.7848 34.0376 53.7848C30.9201 53.7848 28.3862 51.2509 28.3862 48.1334V42.482H34.0376Z", fill: "#ECB22E" }), _jsx("path", { d: "M34.0381 39.6507C30.9016 39.6507 28.3867 37.1168 28.3867 33.9993C28.3867 30.8818 30.9206 28.3479 34.0381 28.3479H48.2306C51.3671 28.3479 53.882 30.8818 53.882 33.9993C53.882 37.1168 51.3482 39.6507 48.2306 39.6507H34.0381Z", fill: "#ECB22E" })] })); -@@ -61,12 +105,13 @@ export function Setup({ go } = {}) { - const [errorMsg, setErrorMsg] = useState(null); - // A first press on Disconnect asks; the second lets go of GitHub. - const [dropping, setDropping] = useState(false); -+ const [githubOwn, setGithubOwn] = useState(false); - const [syncTurn, setSyncTurn] = useState(0); - const signed = isAuthenticated && Boolean(accessToken); - const accountList = Array.isArray(googleAccounts) ? googleAccounts : []; - const hasGoogle = googleDone || accountList.length > 0; -- // Google Workspace is a private beta until Google verifies its scopes. -- const workspace = opens('workspace'); -+ // Google Workspace is disabled on desktop until Google verifies its scopes. -+ const workspace = false; - // Customize's plugins, inside the app where the host reads the path, else Dev on the site. - const openPlugins = () => (pathed && go ? go(app(PLUGINS)) : window.location.assign(site(app(PLUGINS)))); - // The token itself is lib/gmail's to keep; Setup lists the addresses. -@@ -105,7 +150,7 @@ export function Setup({ go } = {}) { - fetch(`${api()}/v1/tool/mcp/servers`, { headers: auth }) - .then((r) => (r.ok ? r.json() : null)) - .catch(() => null), -- ]).then(([integrationsData, connectorsData, pluginsData, serversData]) => { -+ ]).then(([integrationsData, connectionsData, pluginsData, serversData]) => { - if (!live) - return; - // A plugin the org built, or an MCP server it added: Customize's own lists. -@@ -113,45 +158,22 @@ export function Setup({ go } = {}) { - const added = Array.isArray(serversData?.servers) ? serversData.servers.length : 0; - if (built + added > 0) - setPluginDone(true); -- const providers = Array.isArray(integrationsData?.providers) -- ? integrationsData.providers -- : null; -- const connectors = Array.isArray(connectorsData?.connectors) -- ? connectorsData.connectors -- : null; -- if (!providers && !connectors) -+ const found = linked(integrationsData, connectionsData); -+ if (!found) - return; -- const connectedSet = new Set(); -- const discoveredGoogleAccounts = []; -- if (providers) { -- for (const p of providers) { -- if (p.connected) { -- const id = String(p.id); -- connectedSet.add(id); -- const conn = p.connection; -- if (id === 'google' && typeof conn?.account === 'string' && conn.account.trim()) { -- discoveredGoogleAccounts.push(conn.account.trim().toLowerCase()); -- } -- } -- } -- } -- if (connectors) { -- for (const c of connectors) { -- const prov = String(c.provider); -- connectedSet.add(prov); -- if (prov === 'google' && typeof c.account === 'string' && c.account.trim()) { -- discoveredGoogleAccounts.push(c.account.trim().toLowerCase()); -- } -- } -- } -- const remoteGithub = connectedSet.has('github') || connectedSet.has('github-copilot'); -+ const connectedSet = found.ids; -+ const discoveredGoogleAccounts = found.google; - const remoteSlack = connectedSet.has('slack'); - const remoteGoogle = connectedSet.has('google') || - connectedSet.has('gmail') || - connectedSet.has('google-drive') || - connectedSet.has('google-calendar'); -- if (remoteGithub) -- setGithubDone(true); -+ // GitHub follows what is connected, both ways, so a Disconnect on Projects -+ // reads here too; a half answer only ever adds it. -+ if (found.whole || found.github) -+ setGithubDone(found.github); -+ if (found.whole || found.own) -+ setGithubOwn(found.own); - if (remoteSlack) - setSlackDone(true); - if (remoteGoogle) -@@ -167,7 +189,8 @@ export function Setup({ go } = {}) { - live = false; - }; - }, [signed, syncTurn]); -- // Listen for postMessage completion from /auth/callback popup and focus/visibility return -+ // Listen for postMessage completion from /auth/callback popup, focus/visibility return, -+ // and GitHub changed on this page (here, on Projects or in Settings) - useEffect(() => { - if (typeof window === 'undefined') - return; -@@ -189,13 +212,16 @@ export function Setup({ go } = {}) { - } - }; - const onFocus = () => setSyncTurn((n) => n + 1); -+ const onGithub = () => setSyncTurn((n) => n + 1); - window.addEventListener('message', onMessage); - document.addEventListener('visibilitychange', onReturn); - window.addEventListener('focus', onFocus); -+ window.addEventListener(GITHUB_CHANGED, onGithub); - return () => { - window.removeEventListener('message', onMessage); - document.removeEventListener('visibilitychange', onReturn); - window.removeEventListener('focus', onFocus); -+ window.removeEventListener(GITHUB_CHANGED, onGithub); - }; - }, [signed, googleAccounts]); - const totalDone = (githubDone ? 1 : 0) + (slackDone ? 1 : 0) + (pluginDone ? 1 : 0); -@@ -211,13 +237,17 @@ export function Setup({ go } = {}) { - return; - } - // The return page hands the answer back and closes the popup (lib/oauth); -- // a popup closed without one still re-reads what is connected. -+ // a popup closed without one still re-reads what is connected. GitHub's is -+ // said on the page, so Projects reads it too. - awaitAnswer(popup, provider, (answer) => { - if (answer?.ok) - onDone(); - else if (answer) - setErrorMsg(t('Could not connect {provider} right now. Please try again.', { provider: label })); -- setSyncTurn((n) => n + 1); -+ if (provider === 'github') -+ changed(); -+ else -+ setSyncTurn((n) => n + 1); - }); - }; - const connectOAuthProvider = async (provider, label, onDone) => { -@@ -283,7 +313,8 @@ export function Setup({ go } = {}) { - setGithubDone(true); - setStep(slackDone ? 3 : 2); - }); -- // Let go of the org's GitHub accounts, so another can be connected. The platform -+ // Let go of GitHub, so another account can be connected, as Projects does: the -+ // reader's own link first, else the org's GitHub accounts. For those the platform - // also removes its App from an account no other organization uses, so the next - // connect is a fresh install. An org admin's act: anyone else is told so. - const handleDisconnectGithub = async () => { -@@ -294,20 +325,21 @@ export function Setup({ go } = {}) { - setBusy('github'); - setErrorMsg(null); - try { -- const res = await fetch(`${api()}/v1/provider/github/disconnect`, { -+ const res = await fetch(`${api()}${leaving(githubOwn)}`, { - method: 'POST', - headers: { ...scope(), 'Content-Type': 'application/json' }, - body: '{}', - }); - if (!res.ok) { -- setErrorMsg(res.status === 403 -+ setErrorMsg(res.status === 403 && !githubOwn - ? t('Only an organization admin can disconnect GitHub.') - : t('Could not disconnect {provider} right now. Please try again.', { provider: 'GitHub' })); - return; - } - setGithubDone(false); - setStep(1); -- setSyncTurn((n) => n + 1); -+ // Projects reads it again, and so does this card. -+ changed(); - } - catch { - setErrorMsg(t('Could not disconnect {provider} right now. Please try again.', { provider: 'GitHub' })); -diff --git a/dist/Shell.js b/dist/Shell.js -index 59e5db453ed38161bd5d3faa133f1852362c4abe..a11821f7089af16c083abacf9cdd2f959ba8926f 100644 ---- a/dist/Shell.js -+++ b/dist/Shell.js -@@ -495,6 +495,13 @@ function Projects({ filter, onPick, }) { - .catch((e) => { - if (!live) - return; -+ // No session, no projects: the store refuses a guest and the honest -+ // list is empty (as thread.js does for the Recents). -+ if (!hasSession()) { -+ setRows([]); -+ setWrong(null); -+ return; -+ } - setRows(null); - setWrong(e); - }); -diff --git a/dist/Upgrade.js b/dist/Upgrade.js -index f9f98bd5f723e66c81d6433ed6fc518c59d5d65f..2fb7292bff60368c7876b7d743c9a6776547e778 100644 ---- a/dist/Upgrade.js -+++ b/dist/Upgrade.js -@@ -1,21 +1,22 @@ - 'use client'; - import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime"; --// The ask to upgrade, for a reader on the Free plan. -+// The upgrade dialog for readers on the Free plan, or reaching for paid features. - // --// A Free reader who reaches for something Free does not include is shown the --// first personal plan that charges (`usePlan('personal')`), priced by the --// catalog for a month or for a year, with checkout at hanzo.ai/pay. `useFree` --// says who is on Free; `Upgrade` draws the ask it is handed and nothing when it --// is handed none. A refusal's ask is read by `planRequired` in `failure.ts`. -+// Matches the modern ChatGPT-style modal: -+// - Centered "Upgrade your plan" title with top-right close button. -+// - Audience switcher: [ Personal | Business ]. -+// - Personal view: defaults to 2 plans (Free + Pro) with "Show all plans" expandable -+// to full options (Free, Go, Pro, Dev, Max, Ultra). -+// - Business view: Free + Highlighted Business card with Annual/Monthly switch, -+// in-card seat types (Standard & Premium), and enterprise notice at the bottom. - import { useEffect, useState } from 'react'; --import { phrase } from '@hanzo/i18n'; - import { useI18n } from '@hanzo/i18n/react'; --import { Gauge, Sparkles, Users, Workflow, X } from 'lucide-react'; --import { Anchor, Box, Dialog, DialogContent, DialogTitle, Text, ToggleGroup, ToggleGroupItem, XStack, YStack } from '@hanzo/ui'; -+import { BarChart2, Check, Cpu, Crown, Infinity, Layers, Link2, Lock, Rocket, ShieldCheck, Sliders, Sparkles, Sprout, Users, Workflow, X, Zap, } from 'lucide-react'; -+import { Anchor, Box, Button, Dialog, DialogContent, DialogTitle, Text, XStack, YStack } from '@hanzo/ui'; - import { track } from './lib/tags.js'; - import { org } from './lib/session.js'; - import { useTier } from './lib/tier.js'; --import { charge, quote, saving, term, usePlan } from './lib/plans.js'; -+import { term } from './lib/plans.js'; - import { payUrl } from './lib/pay.js'; - import { site } from './where.js'; - /** The free rung's name in the billing catalog. */ -@@ -25,14 +26,6 @@ export function useFree(signedIn) { - const { tier } = useTier(signedIn, org()); - return signedIn && tier?.tier?.name === FREE; - } --// What the first paid personal plan adds to Free, in the words of the plan --// catalog (@hanzo/plans subscription.json, the `dev` plan's features), drawn through `t`. --const ROWS = [ -- [Gauge, phrase('Usage included on every model')], -- [Sparkles, phrase('Every model, including Enso Ultra and Kai')], -- [Users, phrase('Hanzo Team: chat, meetings, calendar and contacts')], -- [Workflow, phrase('Automations, with daily runs included')], --]; - /** The page checkout returns to: this one, query and all. */ - function here() { - if (typeof window === 'undefined') -@@ -40,42 +33,131 @@ function here() { - const { origin, pathname, search } = window.location; - return `${origin}${pathname}${search}`; - } -+const MULTIPLIERS = { -+ '2x': { -+ id: 'pro-2x', -+ name: 'Pro', -+ multiple: '2×', -+ price: 15, -+ icon: Rocket, -+ subtitle: '2× more usage and higher limits for everyday builders.', -+ bots: 1, -+ }, -+ '5x': { -+ id: 'dev-5x', -+ name: 'Dev', -+ multiple: '5×', -+ price: 45, -+ icon: Cpu, -+ subtitle: '5× higher limits for autonomous coding agents.', -+ bots: 1, -+ }, -+ '10x': { -+ id: 'max-10x', -+ name: 'Max', -+ multiple: '10×', -+ price: 95, -+ icon: Crown, -+ subtitle: '10× limits for heavy continuous coding sessions.', -+ bots: 3, -+ }, -+}; - export function Upgrade({ ask, onClose }) { - const { t } = useI18n(); -- const { plan } = usePlan('personal'); -- const [cycle, setCycle] = useState('month'); -- const shown = ask !== null && plan !== null; -- // The plan is shown to a reader who reached for it: GA4's view_item. -+ const [audience, setAudience] = useState('personal'); -+ const [multiplier, setMultiplier] = useState('2x'); -+ const [showAllPersonal, setShowAllPersonal] = useState(false); -+ const [businessCycle, setBusinessCycle] = useState('year'); -+ const [hashOpen, setHashOpen] = useState(false); -+ // Listen for #pricing in hash or custom event 'hanzo:upgrade' - useEffect(() => { -- if (shown && plan) -- track('product_viewed', { -- currency: 'USD', -- value: charge(plan, 'month'), -- items: [{ item_id: plan.id, item_name: plan.name }], -- }); -- // eslint-disable-next-line react-hooks/exhaustive-deps -- }, [shown]); -- if (!plan) -- return null; -- const save = saving(plan); -- const interval = save === null ? 'month' : cycle; -- const label = t('Choose your plan — Pro, Max & Team'); -- const href = term(ask?.href ?? payUrl('/cart', { org: org(), returnUrl: here() }), interval); -- const buy = () => { -- const items = [{ item_id: plan.id, item_name: plan.name }]; -- // The funnel reads the English, whatever language the reader chose. -- track('plan_clicked', { plan: plan.id, interval, cta: `Upgrade to ${plan.name} for ${quote(plan, interval)}`, items }); -- track('checkout_started', { currency: 'USD', value: charge(plan, interval), items, interval }); -+ const handleHash = () => { -+ if (typeof window !== 'undefined' && window.location.hash === '#pricing') { -+ setHashOpen(true); -+ } -+ }; -+ const handleUpgradeEvent = () => setHashOpen(true); -+ handleHash(); -+ window.addEventListener('hashchange', handleHash); -+ window.addEventListener('hanzo:upgrade', handleUpgradeEvent); -+ return () => { -+ window.removeEventListener('hashchange', handleHash); -+ window.removeEventListener('hanzo:upgrade', handleUpgradeEvent); -+ }; -+ }, []); -+ const open = ask !== null || hashOpen; -+ useEffect(() => { -+ if (open) { -+ track('upgrade_dialog_opened', { audience }); -+ } -+ }, [open, audience]); -+ const close = () => { -+ if (typeof window !== 'undefined' && window.location.hash === '#pricing') { -+ history.replaceState(null, '', window.location.pathname + window.location.search); -+ } -+ setHashOpen(false); -+ onClose(); -+ }; -+ const activeMultiplier = MULTIPLIERS[multiplier]; -+ const goHref = term(payUrl('/cart', { plan: 'go', org: org(), returnUrl: here() }), 'month'); -+ const proHref = term(payUrl('/cart', { plan: 'pro-2x', org: org(), returnUrl: here() }), 'month'); -+ const devHref = term(payUrl('/cart', { plan: 'dev-5x', org: org(), returnUrl: here() }), 'month'); -+ const maxHref = term(payUrl('/cart', { plan: 'max-10x', org: org(), returnUrl: here() }), 'month'); -+ const multiplierHref = term(payUrl('/cart', { plan: activeMultiplier.id, org: org(), returnUrl: here() }), 'month'); -+ const ultraHref = term(payUrl('/cart', { plan: 'ultra', org: org(), returnUrl: here() }), 'month'); -+ const businessHref = term(payUrl('/cart', { plan: 'team', quantity: '5', org: org(), returnUrl: here() }), businessCycle); -+ const handleBuy = (planId, planName, price, interval = 'month') => { -+ const items = [{ item_id: planId, item_name: planName }]; -+ track('plan_clicked', { plan: planId, interval, cta: `Upgrade to ${planName}`, items }); -+ track('checkout_started', { currency: 'USD', value: price, items, interval }); - }; -- return (_jsx(Dialog, { open: ask !== null, onOpenChange: (open) => (open ? undefined : onClose()), children: _jsxs(DialogContent, { showCloseButton: false, width: "calc(100vw - 32px)", maxW: 440, bg: "var(--popover)", rounded: "$9", p: "$5", gap: "$5", $sm: { p: '$6' }, children: [_jsx(Box, { render: "button", "aria-label": t('Close'), onClick: onClose, position: "absolute", t: "$4", insetInlineEnd: "$4", p: "$1.5", rounded: "$2", bg: "transparent", borderWidth: 0, cursor: "pointer", hoverStyle: { bg: '$hover' }, children: _jsx(X, { size: 18, "aria-hidden": true, color: "var(--soft, var(--muted-foreground))" }) }), _jsx(DialogTitle -- // inline-style: design's serif face. gui names Zen and Zen Mono only; a family it cannot name resets the rung to 15px. -- , { -- // inline-style: design's serif face. gui names Zen and Zen Mono only; a family it cannot name resets the rung to 15px. -- style: { fontFamily: 'var(--font-serif)' }, fontSize: "$8", lineHeight: "$9", fontWeight: "400", color: "$ink", paddingInlineEnd: "$6", children: ask?.model ? t('Use {model} with Hanzo {plan}', { model: ask.model, plan: plan.name }) : t('Upgrade to Hanzo {plan}', { plan: plan.name }) }), _jsx(YStack, { render: "ul", gap: "$3.5", m: 0, p: 0, children: ROWS.map(([Icon, line]) => (_jsxs(XStack, { render: "li", items: "center", gap: "$3", children: [_jsx(Icon, { size: 18, "aria-hidden": true, color: "var(--soft, var(--muted-foreground))" }), _jsx(Text, { fontSize: "$4", color: "$ink", children: t(line) })] }, line))) }), save === null ? null : (_jsx(ToggleGroup, { type: "single", value: cycle, onValueChange: (v) => { -- if (v === 'month' || v === 'year') -- setCycle(v); -- }, disableDeactivation: true, "aria-label": t('Billing term'), ...{ width: '100%', p: 4, rounded: 9999, bg: 'var(--surface-2)' }, children: [ -- ['month', t('Monthly')], -- ['year', t('Yearly · Save {percent}%', { percent: save })], -- ].map(([value, name]) => (_jsx(ToggleGroupItem, { value: value, variant: "outline", flex: 1, rounded: "$10", borderColor: "transparent", children: name }, value))) })), _jsxs(YStack, { gap: "$3", children: [_jsx(Anchor, { href: href, onPress: buy, "data-ga": true, bg: "var(--primary)", color: "var(--primary-foreground)", rounded: "$4", py: "$3", px: "$4", fontSize: "$4", fontWeight: "500", text: "center", textDecorationLine: "none", hoverStyle: { bg: 'var(--primary-hover)' }, children: label }), _jsxs(XStack, { justify: "center", gap: "$5", children: [_jsx(Anchor, { href: site("/pricing"), fontSize: "$3", color: "$soft", hoverStyle: { color: '$ink' }, children: t('See all plans') }), _jsx(Box, { render: "button", onClick: onClose, bg: "transparent", borderWidth: 0, p: 0, cursor: "pointer", children: _jsx(Text, { fontSize: "$3", color: "$soft", hoverStyle: { color: '$ink' }, children: t('Not now') }) })] })] })] }) })); -+ return (_jsx(Dialog, { open: open, onOpenChange: (v) => (v ? undefined : close()), children: _jsxs(DialogContent, { showCloseButton: false, width: "calc(100vw - 32px)", maxW: audience === 'business' || !showAllPersonal ? 880 : 1140, maxH: "90vh", overflowY: "auto", bg: "var(--popover, #121212)", rounded: "$8", p: "$5", gap: "$4", borderWidth: 1, borderColor: "rgba(255, 255, 255, 0.1)", boxShadow: "0 25px 50px -12px rgba(0, 0, 0, 0.75)", $sm: { p: '$7', gap: '$5' }, children: [_jsx(Box, { render: "button", "aria-label": t('Close'), onClick: close, position: "absolute", t: "$4", insetInlineEnd: "$4", width: 32, height: 32, rounded: "$10", bg: "transparent", borderWidth: 0, cursor: "pointer", items: "center", justify: "center", hoverStyle: { bg: 'rgba(255, 255, 255, 0.08)' }, z: 10, children: _jsx(X, { size: 18, "aria-hidden": true, color: "var(--soft, #a1a1aa)" }) }), _jsxs(YStack, { items: "center", gap: "$2", pt: "$1", children: [_jsx(DialogTitle, { fontSize: 26, lineHeight: 32, fontWeight: "600", color: "$ink", text: "center", children: t('Upgrade your plan') }), _jsxs(XStack, { items: "center", bg: "rgba(255, 255, 255, 0.06)", p: 3, rounded: "$10", gap: 2, mt: "$2", borderWidth: 1, borderColor: "rgba(255, 255, 255, 0.04)", children: [_jsx(Box, { render: "button", onClick: () => setAudience('personal'), bg: audience === 'personal' ? 'rgba(255, 255, 255, 0.14)' : 'transparent', px: "$3.5", py: "$1.5", rounded: "$10", borderWidth: 0, cursor: "pointer", hoverStyle: audience === 'personal' ? {} : { bg: 'rgba(255, 255, 255, 0.06)' }, children: _jsx(Text, { fontSize: 13, fontWeight: audience === 'personal' ? '600' : '400', color: audience === 'personal' ? '#ffffff' : '#8e8e8e', children: t('Personal') }) }), _jsx(Box, { render: "button", onClick: () => setAudience('business'), bg: audience === 'business' ? 'rgba(255, 255, 255, 0.14)' : 'transparent', px: "$3.5", py: "$1.5", rounded: "$10", borderWidth: 0, cursor: "pointer", hoverStyle: audience === 'business' ? {} : { bg: 'rgba(255, 255, 255, 0.06)' }, children: _jsx(Text, { fontSize: 13, fontWeight: audience === 'business' ? '600' : '400', color: audience === 'business' ? '#ffffff' : '#8e8e8e', children: t('Business') }) })] })] }), audience === 'personal' ? (!showAllPersonal ? (_jsxs(YStack, { gap: "$4", width: "100%", children: [_jsxs(Box, { style: { -+ display: 'grid', -+ gridTemplateColumns: 'repeat(auto-fit, minmax(320px, 1fr))', -+ gap: '24px', -+ width: '100%', -+ alignItems: 'stretch', -+ }, children: [_jsx(YStack, { bg: "rgba(255, 255, 255, 0.02)", borderWidth: 1, borderColor: "rgba(255, 255, 255, 0.08)", rounded: "$6", p: "$6", gap: "$5", justify: "space-between", children: _jsxs(YStack, { gap: "$3.5", children: [_jsxs(XStack, { items: "center", gap: "$1.5", children: [_jsx(Sprout, { size: 16, color: "#4ade80", "aria-hidden": true }), _jsx(Text, { fontSize: 14, fontWeight: "500", color: "#a1a1aa", children: t('Free') })] }), _jsxs(YStack, { gap: "$1", children: [_jsx(Text, { fontSize: 24, fontWeight: "700", color: "$ink", children: t('Try Hanzo') }), _jsx(Text, { fontSize: 14, color: "var(--soft, #a1a1aa)", children: t('See what AI can do.') })] }), _jsx(Button, { disabled: true, variant: "outline", rounded: "$10", width: "100%", py: "$2.5", my: "$2", borderColor: "rgba(255, 255, 255, 0.15)", bg: "transparent", cursor: "default", children: _jsx(Text, { fontSize: 14, fontWeight: "500", color: "#8e8e8e", children: t('Your current plan') }) }), _jsxs(XStack, { items: "baseline", gap: "$1", children: [_jsx(Text, { fontSize: 28, fontWeight: "700", color: "$ink", children: "$0" }), _jsx(Text, { fontSize: 14, color: "#8e8e8e", children: t('/ month') })] }), _jsx(YStack, { gap: "$3", pt: "$2", children: [ -+ t('Unlimited everyday text chats'), -+ t('Access to all foundation models'), -+ t('Standard inference speed'), -+ t('Context memory and chat history'), -+ t('Community support'), -+ ].map((feat) => (_jsxs(XStack, { items: "center", gap: "$2.5", children: [_jsx(Check, { size: 16, color: "#a1a1aa", "aria-hidden": true }), _jsx(Text, { fontSize: 13, color: "$ink", children: feat })] }, feat))) })] }) }), _jsx(YStack, { bg: "rgba(37, 99, 235, 0.03)", borderWidth: 1.5, borderColor: "#2563eb", rounded: "$6", p: "$6", gap: "$4", justify: "space-between", boxShadow: "0 0 28px rgba(37, 99, 235, 0.16)", children: _jsxs(YStack, { gap: "$3", children: [_jsxs(XStack, { items: "center", justify: "space-between", children: [_jsxs(XStack, { items: "center", gap: "$1.5", children: [_jsx(activeMultiplier.icon, { size: 16, color: "#38bdf8", "aria-hidden": true }), _jsx(Text, { fontSize: 16, fontWeight: "700", color: "$ink", children: activeMultiplier.name })] }), _jsx(XStack, { items: "center", bg: "rgba(0, 0, 0, 0.45)", p: 2, rounded: "$10", gap: 1, borderWidth: 1, borderColor: "rgba(255, 255, 255, 0.1)", children: ['2x', '5x', '10x'].map((m) => (_jsx(Box, { render: "button", onClick: () => setMultiplier(m), bg: multiplier === m ? 'rgba(255, 255, 255, 0.22)' : 'transparent', px: "$2", py: "$0.5", rounded: "$10", borderWidth: 0, cursor: "pointer", children: _jsx(Text, { fontSize: 11, fontWeight: multiplier === m ? '700' : '500', color: multiplier === m ? '#ffffff' : '#8e8e8e', children: m }) }, m))) })] }), _jsxs(YStack, { gap: "$1", children: [_jsx(Text, { fontSize: 24, fontWeight: "700", color: "$ink", children: t('{name} {tier}', { name: activeMultiplier.name, tier: activeMultiplier.multiple }) }), _jsx(Text, { fontSize: 14, color: "var(--soft, #a1a1aa)", children: t(activeMultiplier.subtitle) })] }), _jsxs(Anchor, { href: multiplierHref, onPress: () => handleBuy(activeMultiplier.id, activeMultiplier.name, activeMultiplier.price), bg: "#0070f3", hoverStyle: { bg: '#0060df' }, rounded: "$10", width: "100%", py: "$3", my: "$1", color: "#ffffff", fontWeight: "600", fontSize: 14, text: "center", textDecorationLine: "none", items: "center", justify: "center", gap: "$2", children: [_jsx(Sparkles, { size: 16, color: "#ffffff", "aria-hidden": true }), t('Get {name}', { name: activeMultiplier.name })] }), _jsxs(XStack, { items: "baseline", gap: "$1", pt: "$1", children: [_jsxs(Text, { fontSize: 28, fontWeight: "700", color: "$ink", children: ["$", activeMultiplier.price] }), _jsx(Text, { fontSize: 14, color: "#8e8e8e", children: t('/ month') })] }), _jsx(YStack, { gap: "$2.5", pt: "$1", children: [ -+ t('Everything in Free, plus:'), -+ t('{multiple} more usage than Free', { multiple: activeMultiplier.multiple }), -+ t('Access to Enso Ultra, Kai, and frontier models'), -+ t('Build apps with Hanzo Dev & CLI'), -+ t('Connect any MCP server'), -+ t('Background agents & automations'), -+ t('Hanzo Bot: {bots} custom {bots, plural, one {bot} other {bots}}', { bots: activeMultiplier.bots }), -+ t('Dedicated priority support'), -+ ].map((feat, idx) => (_jsxs(XStack, { items: "center", gap: "$2.5", children: [_jsx(Check, { size: 16, color: idx === 0 ? '#38bdf8' : '#388bfd', "aria-hidden": true }), _jsx(Text, { fontSize: 13, color: "$ink", fontWeight: idx === 0 ? '600' : '400', children: feat })] }, feat))) })] }) })] }), _jsx(XStack, { justify: "center", pt: "$1", children: _jsx(Box, { render: "button", onClick: () => setShowAllPersonal(true), bg: "rgba(255, 255, 255, 0.05)", hoverStyle: { bg: 'rgba(255, 255, 255, 0.1)' }, px: "$4", py: "$2", rounded: "$10", borderWidth: 1, borderColor: "rgba(255, 255, 255, 0.1)", cursor: "pointer", children: _jsx(Text, { fontSize: 13, fontWeight: "500", color: "#38bdf8", children: t('Show all plans (Free, Go, Pro, Dev, Max, Ultra) ↓') }) }) })] })) : (_jsxs(YStack, { gap: "$4", width: "100%", children: [_jsxs(Box, { style: { -+ display: 'grid', -+ gridTemplateColumns: 'repeat(auto-fit, minmax(220px, 1fr))', -+ gap: '14px', -+ width: '100%', -+ alignItems: 'stretch', -+ }, children: [_jsx(YStack, { bg: "rgba(255, 255, 255, 0.02)", borderWidth: 1, borderColor: "rgba(255, 255, 255, 0.08)", rounded: "$6", p: "$4", justify: "space-between", gap: "$3", children: _jsxs(YStack, { gap: "$2", children: [_jsxs(XStack, { items: "center", gap: "$1.5", children: [_jsx(Sprout, { size: 15, color: "#4ade80", "aria-hidden": true }), _jsx(Text, { fontSize: 12, fontWeight: "600", color: "#a1a1aa", children: t('Free') })] }), _jsx(Text, { fontSize: 18, fontWeight: "700", color: "$ink", children: t('Try Hanzo') }), _jsx(Text, { fontSize: 12, color: "var(--soft, #a1a1aa)", minH: 32, children: t('See what AI can do.') }), _jsx(Button, { disabled: true, variant: "outline", rounded: "$10", py: "$1.5", borderColor: "rgba(255, 255, 255, 0.15)", bg: "transparent", cursor: "default", children: _jsx(Text, { fontSize: 12, fontWeight: "500", color: "#8e8e8e", children: t('Current plan') }) }), _jsxs(XStack, { items: "baseline", gap: "$1", children: [_jsx(Text, { fontSize: 22, fontWeight: "700", color: "$ink", children: "$0" }), _jsx(Text, { fontSize: 12, color: "#8e8e8e", children: t('/ mo') })] }), _jsx(YStack, { gap: "$1.5", pt: "$1", children: [t('Everyday chats'), t('Foundation models'), t('Standard speed'), t('Community support')].map((f) => (_jsxs(XStack, { items: "center", gap: "$1.5", children: [_jsx(Check, { size: 13, color: "#a1a1aa", "aria-hidden": true }), _jsx(Text, { fontSize: 11, color: "$ink", children: f })] }, f))) })] }) }), _jsx(YStack, { bg: "rgba(255, 255, 255, 0.02)", borderWidth: 1, borderColor: "rgba(255, 255, 255, 0.08)", rounded: "$6", p: "$4", justify: "space-between", gap: "$3", children: _jsxs(YStack, { gap: "$2", children: [_jsxs(XStack, { items: "center", gap: "$1.5", children: [_jsx(Zap, { size: 15, color: "#eab308", "aria-hidden": true }), _jsx(Text, { fontSize: 12, fontWeight: "600", color: "#a1a1aa", children: t('Go') })] }), _jsx(Text, { fontSize: 18, fontWeight: "700", color: "$ink", children: t('Everyday AI') }), _jsx(Text, { fontSize: 12, color: "var(--soft, #a1a1aa)", minH: 32, children: t('More models & agents.') }), _jsx(Anchor, { href: goHref, onPress: () => handleBuy('go', 'Go', 8), bg: "var(--primary)", rounded: "$10", py: "$1.5", px: "$3", color: "#ffffff", fontWeight: "600", fontSize: 12, text: "center", textDecorationLine: "none", children: t('Get Go') }), _jsxs(XStack, { items: "baseline", gap: "$1", children: [_jsx(Text, { fontSize: 22, fontWeight: "700", color: "$ink", children: "$8" }), _jsx(Text, { fontSize: 12, color: "#8e8e8e", children: t('/ mo') })] }), _jsx(YStack, { gap: "$1.5", pt: "$1", children: [t('All frontier models'), t('Hanzo Dev & CLI'), t('Connect MCP servers'), t('Background agents')].map((f) => (_jsxs(XStack, { items: "center", gap: "$1.5", children: [_jsx(Check, { size: 13, color: "#38bdf8", "aria-hidden": true }), _jsx(Text, { fontSize: 11, color: "$ink", children: f })] }, f))) })] }) }), _jsx(YStack, { bg: "rgba(255, 255, 255, 0.04)", borderWidth: 1.5, borderColor: "rgba(56, 189, 248, 0.3)", rounded: "$6", p: "$4", justify: "space-between", gap: "$3", children: _jsxs(YStack, { gap: "$2", children: [_jsxs(XStack, { items: "center", gap: "$1.5", children: [_jsx(Rocket, { size: 15, color: "#38bdf8", "aria-hidden": true }), _jsx(Text, { fontSize: 12, fontWeight: "700", color: "$ink", children: t('Pro 2×') })] }), _jsx(Text, { fontSize: 18, fontWeight: "700", color: "$ink", children: t('Pro') }), _jsx(Text, { fontSize: 12, color: "var(--soft, #a1a1aa)", minH: 32, children: t('2× limits for builders.') }), _jsx(Anchor, { href: proHref, onPress: () => handleBuy('pro-2x', 'Pro', 15), bg: "var(--primary)", rounded: "$10", py: "$1.5", px: "$3", color: "#ffffff", fontWeight: "600", fontSize: 12, text: "center", textDecorationLine: "none", children: t('Get Pro') }), _jsxs(XStack, { items: "baseline", gap: "$1", children: [_jsx(Text, { fontSize: 22, fontWeight: "700", color: "$ink", children: "$15" }), _jsx(Text, { fontSize: 12, color: "#8e8e8e", children: t('/ mo') })] }), _jsx(YStack, { gap: "$1.5", pt: "$1", children: [t('2× more usage than Go'), t('2× higher 5h limits'), t('1 custom Hanzo Bot'), t('Priority support')].map((f) => (_jsxs(XStack, { items: "center", gap: "$1.5", children: [_jsx(Check, { size: 13, color: "#38bdf8", "aria-hidden": true }), _jsx(Text, { fontSize: 11, color: "$ink", children: f })] }, f))) })] }) }), _jsx(YStack, { bg: "rgba(255, 255, 255, 0.02)", borderWidth: 1, borderColor: "rgba(255, 255, 255, 0.08)", rounded: "$6", p: "$4", justify: "space-between", gap: "$3", children: _jsxs(YStack, { gap: "$2", children: [_jsxs(XStack, { items: "center", gap: "$1.5", children: [_jsx(Cpu, { size: 15, color: "#60a5fa", "aria-hidden": true }), _jsx(Text, { fontSize: 12, fontWeight: "700", color: "$ink", children: t('Dev 5×') })] }), _jsx(Text, { fontSize: 18, fontWeight: "700", color: "$ink", children: t('Dev') }), _jsx(Text, { fontSize: 12, color: "var(--soft, #a1a1aa)", minH: 32, children: t('5× limits for agents.') }), _jsx(Anchor, { href: devHref, onPress: () => handleBuy('dev-5x', 'Dev', 45), bg: "var(--primary)", rounded: "$10", py: "$1.5", px: "$3", color: "#ffffff", fontWeight: "600", fontSize: 12, text: "center", textDecorationLine: "none", children: t('Get Dev') }), _jsxs(XStack, { items: "baseline", gap: "$1", children: [_jsx(Text, { fontSize: 22, fontWeight: "700", color: "$ink", children: "$45" }), _jsx(Text, { fontSize: 12, color: "#8e8e8e", children: t('/ mo') })] }), _jsx(YStack, { gap: "$1.5", pt: "$1", children: [t('5× more usage than Go'), t('5× higher 5h limits'), t('1 custom Hanzo Bot'), t('Train custom models')].map((f) => (_jsxs(XStack, { items: "center", gap: "$1.5", children: [_jsx(Check, { size: 13, color: "#60a5fa", "aria-hidden": true }), _jsx(Text, { fontSize: 11, color: "$ink", children: f })] }, f))) })] }) }), _jsx(YStack, { bg: "rgba(255, 255, 255, 0.02)", borderWidth: 1, borderColor: "rgba(255, 255, 255, 0.08)", rounded: "$6", p: "$4", justify: "space-between", gap: "$3", children: _jsxs(YStack, { gap: "$2", children: [_jsxs(XStack, { items: "center", gap: "$1.5", children: [_jsx(Crown, { size: 15, color: "#fbbf24", "aria-hidden": true }), _jsx(Text, { fontSize: 12, fontWeight: "700", color: "$ink", children: t('Max 10×') })] }), _jsx(Text, { fontSize: 18, fontWeight: "700", color: "$ink", children: t('Max') }), _jsx(Text, { fontSize: 12, color: "var(--soft, #a1a1aa)", minH: 32, children: t('10× continuous limits.') }), _jsx(Anchor, { href: maxHref, onPress: () => handleBuy('max-10x', 'Max', 95), bg: "var(--primary)", rounded: "$10", py: "$1.5", px: "$3", color: "#ffffff", fontWeight: "600", fontSize: 12, text: "center", textDecorationLine: "none", children: t('Get Max') }), _jsxs(XStack, { items: "baseline", gap: "$1", children: [_jsx(Text, { fontSize: 22, fontWeight: "700", color: "$ink", children: "$95" }), _jsx(Text, { fontSize: 12, color: "#8e8e8e", children: t('/ mo') })] }), _jsx(YStack, { gap: "$1.5", pt: "$1", children: [t('10× more usage than Go'), t('10× higher 5h limits'), t('3 custom Hanzo Bots'), t('Dedicated support')].map((f) => (_jsxs(XStack, { items: "center", gap: "$1.5", children: [_jsx(Check, { size: 13, color: "#fbbf24", "aria-hidden": true }), _jsx(Text, { fontSize: 11, color: "$ink", children: f })] }, f))) })] }) }), _jsx(YStack, { bg: "rgba(255, 255, 255, 0.02)", borderWidth: 1, borderColor: "rgba(255, 255, 255, 0.08)", rounded: "$6", p: "$4", justify: "space-between", gap: "$3", children: _jsxs(YStack, { gap: "$2", children: [_jsxs(XStack, { items: "center", gap: "$1.5", children: [_jsx(Infinity, { size: 15, color: "#c084fc", "aria-hidden": true }), _jsx(Text, { fontSize: 12, fontWeight: "700", color: "$ink", children: t('Ultra') })] }), _jsx(Text, { fontSize: 18, fontWeight: "700", color: "$ink", children: t('Frontier Scale') }), _jsx(Text, { fontSize: 12, color: "var(--soft, #a1a1aa)", minH: 32, children: t('Unlimited intelligence.') }), _jsx(Anchor, { href: ultraHref, onPress: () => handleBuy('ultra', 'Ultra', 195), bg: "rgba(255, 255, 255, 0.12)", rounded: "$10", py: "$1.5", px: "$3", color: "#ffffff", fontWeight: "600", fontSize: 12, text: "center", textDecorationLine: "none", children: t('Get Ultra') }), _jsxs(XStack, { items: "baseline", gap: "$1", children: [_jsx(Text, { fontSize: 22, fontWeight: "700", color: "$ink", children: "$195" }), _jsx(Text, { fontSize: 12, color: "#8e8e8e", children: t('/ mo') })] }), _jsx(YStack, { gap: "$1.5", pt: "$1", children: [t('Unlimited model usage'), t('No hourly rate limits'), t('5 custom Hanzo Bots'), t('Engineering Slack')].map((f) => (_jsxs(XStack, { items: "center", gap: "$1.5", children: [_jsx(Check, { size: 13, color: "#c084fc", "aria-hidden": true }), _jsx(Text, { fontSize: 11, color: "$ink", children: f })] }, f))) })] }) })] }), _jsx(XStack, { justify: "center", pt: "$1", children: _jsx(Box, { render: "button", onClick: () => setShowAllPersonal(false), bg: "transparent", hoverStyle: { bg: 'rgba(255, 255, 255, 0.06)' }, px: "$4", py: "$2", rounded: "$10", borderWidth: 1, borderColor: "rgba(255, 255, 255, 0.1)", cursor: "pointer", children: _jsx(Text, { fontSize: 13, fontWeight: "500", color: "#a1a1aa", children: t('Show fewer plans ↑') }) }) })] }))) : (_jsxs(YStack, { gap: "$4", width: "100%", children: [_jsxs(Box, { style: { -+ display: 'grid', -+ gridTemplateColumns: 'repeat(auto-fit, minmax(320px, 1fr))', -+ gap: '24px', -+ width: '100%', -+ alignItems: 'stretch', -+ }, children: [_jsx(YStack, { bg: "rgba(255, 255, 255, 0.02)", borderWidth: 1, borderColor: "rgba(255, 255, 255, 0.08)", rounded: "$6", p: "$6", gap: "$5", justify: "space-between", children: _jsxs(YStack, { gap: "$3.5", children: [_jsx(Text, { fontSize: 14, fontWeight: "500", color: "#a1a1aa", children: t('Free') }), _jsxs(YStack, { gap: "$1", children: [_jsx(Text, { fontSize: 24, fontWeight: "700", color: "$ink", children: t('Try Hanzo') }), _jsx(Text, { fontSize: 14, color: "var(--soft, #a1a1aa)", children: t('See what AI can do.') })] }), _jsx(Button, { disabled: true, variant: "outline", rounded: "$10", width: "100%", py: "$2.5", my: "$2", borderColor: "rgba(255, 255, 255, 0.15)", bg: "transparent", cursor: "default", children: _jsx(Text, { fontSize: 14, fontWeight: "500", color: "#8e8e8e", children: t('Your current plan') }) }), _jsxs(XStack, { items: "baseline", gap: "$1", children: [_jsx(Text, { fontSize: 28, fontWeight: "700", color: "$ink", children: "$0" }), _jsx(Text, { fontSize: 14, color: "#8e8e8e", children: t('/ month') })] }), _jsx(YStack, { gap: "$3", pt: "$3", children: [ -+ t('Unlimited everyday text chats'), -+ t('Limited access to image creation'), -+ t('Limited memory and storage'), -+ t('Limited voice chats'), -+ t('Community and open model access'), -+ ].map((feat) => (_jsxs(XStack, { items: "center", gap: "$2.5", children: [_jsx(Check, { size: 16, color: "#a1a1aa", "aria-hidden": true }), _jsx(Text, { fontSize: 13, color: "$ink", children: feat })] }, feat))) })] }) }), _jsx(YStack, { bg: "rgba(37, 99, 235, 0.03)", borderWidth: 1.5, borderColor: "#2563eb", rounded: "$6", p: "$6", gap: "$4", justify: "space-between", boxShadow: "0 0 28px rgba(37, 99, 235, 0.16)", children: _jsxs(YStack, { gap: "$3", children: [_jsxs(XStack, { items: "center", justify: "space-between", children: [_jsx(Text, { fontSize: 16, fontWeight: "700", color: "$ink", children: t('Business') }), _jsxs(XStack, { items: "center", bg: "#212121", p: 2, rounded: "$10", gap: 1, borderWidth: 1, borderColor: "rgba(255, 255, 255, 0.08)", children: [_jsx(Box, { render: "button", onClick: () => setBusinessCycle('year'), bg: businessCycle === 'year' ? '#343434' : 'transparent', px: "$2.5", py: "$1", rounded: "$10", borderWidth: 0, cursor: "pointer", children: _jsx(Text, { fontSize: 11, fontWeight: businessCycle === 'year' ? '600' : '400', color: businessCycle === 'year' ? '#ffffff' : '#8e8e8e', children: t('Annual') }) }), _jsx(Box, { render: "button", onClick: () => setBusinessCycle('month'), bg: businessCycle === 'month' ? '#343434' : 'transparent', px: "$2.5", py: "$1", rounded: "$10", borderWidth: 0, cursor: "pointer", children: _jsx(Text, { fontSize: 11, fontWeight: businessCycle === 'month' ? '600' : '400', color: businessCycle === 'month' ? '#ffffff' : '#8e8e8e', children: t('Monthly') }) })] })] }), _jsxs(YStack, { gap: "$1", children: [_jsx(Text, { fontSize: 24, fontWeight: "700", color: "$ink", children: t('For growing teams') }), _jsx(Text, { fontSize: 14, color: "var(--soft, #a1a1aa)", children: t('A secure workspace with company context') })] }), _jsxs(Anchor, { href: businessHref, onPress: () => handleBuy('team', 'Business', businessCycle === 'year' ? 200 : 20, businessCycle), bg: "#0070f3", hoverStyle: { bg: '#0060df' }, rounded: "$10", width: "100%", py: "$3", my: "$1", color: "#ffffff", fontWeight: "600", fontSize: 14, text: "center", textDecorationLine: "none", items: "center", justify: "center", gap: "$2", children: [_jsx(Sparkles, { size: 16, color: "#ffffff", "aria-hidden": true }), t('Get started')] }), _jsxs(YStack, { bg: "rgba(0, 0, 0, 0.4)", borderWidth: 1, borderColor: "rgba(255, 255, 255, 0.08)", rounded: "$4", p: "$3", gap: "$2", children: [_jsxs(YStack, { gap: "$0.5", children: [_jsxs(XStack, { justify: "space-between", items: "center", children: [_jsx(Text, { fontSize: 13, fontWeight: "600", color: "$ink", children: t('Standard seat') }), _jsx(Text, { fontSize: 13, fontWeight: "600", color: "$ink", children: businessCycle === 'year' ? '$16.67 / month' : '$20 / month' })] }), _jsx(Text, { fontSize: 11, color: "#8e8e8e", children: t('Best for everyday work') })] }), _jsx(Box, { height: 1, bg: "rgba(255, 255, 255, 0.06)" }), _jsxs(YStack, { gap: "$0.5", children: [_jsxs(XStack, { justify: "space-between", items: "center", children: [_jsx(Text, { fontSize: 13, fontWeight: "600", color: "$ink", children: t('Premium seat') }), _jsx(Text, { fontSize: 13, fontWeight: "600", color: "$ink", children: businessCycle === 'year' ? '$83.33 / month' : '$100 / month' })] }), _jsx(Text, { fontSize: 11, color: "#8e8e8e", children: t('More usage, no 5-hour limit') })] })] }), _jsx(YStack, { gap: "$2.5", pt: "$1", children: [ -+ [Workflow, t('Shared tasks — so your team can do more by delegating busy work')], -+ [Users, t('Hanzo Space to collaborate with your team and AI')], -+ [ShieldCheck, t('Secure workspace with SAML, SSO, and MFA')], -+ [Link2, t('Connections for Google Workspace, Slack, GitHub, Microsoft 365, and more')], -+ [BarChart2, t('Usage analytics and spend controls')], -+ [Layers, t('Centralized billing and administration')], -+ [Lock, t('No model training on your business data by default')], -+ [Sliders, t('Mix and match seat types')], -+ ].map(([Icon, label], idx) => (_jsxs(XStack, { items: "flex-start", gap: "$2.5", children: [_jsx(Box, { pt: 2, children: _jsx(Icon, { size: 16, color: "#388bfd", "aria-hidden": true }) }), _jsx(Text, { fontSize: 13, color: "$ink", lineHeight: 18, children: label })] }, idx))) })] }) })] }), _jsxs(XStack, { justify: "center", items: "center", gap: "$1.5", pt: "$2", children: [_jsx(Text, { fontSize: 13, color: "#8e8e8e", children: t('Need more capabilities for your business?') }), _jsx(Anchor, { href: site('/contact-sales'), fontSize: 13, fontWeight: "600", color: "#388bfd", hoverStyle: { textDecorationLine: 'underline' }, children: t('See Hanzo Enterprise') })] })] })), _jsxs(XStack, { justify: "center", items: "center", gap: "$5", pt: "$2", children: [_jsx(Anchor, { href: site('/pricing'), fontSize: 13, color: "var(--soft, #a1a1aa)", hoverStyle: { color: '$ink' }, children: t('See all plans & pricing table') }), _jsx(Box, { render: "button", onClick: close, bg: "transparent", borderWidth: 0, p: 0, cursor: "pointer", children: _jsx(Text, { fontSize: 13, color: "var(--soft, #a1a1aa)", hoverStyle: { color: '$ink' }, children: t('Not now') }) })] })] }) })); - } -diff --git a/dist/Usage.js b/dist/Usage.js -index 1ef6fb8fff2bc5c37b647a1d4d35e230d8a05feb..2b5b94bee2bb32ea5d2e69415972ebe37834b3a0 100644 ---- a/dist/Usage.js -+++ b/dist/Usage.js -@@ -82,12 +82,15 @@ export function UsageControl({ context, read }) { - const capacity = context?.window && context.window > 0 ? context.window : null; - const percent = estimate && capacity ? Math.round(estimate.total / capacity * 100) : null; - const plan = limits?.plan ? label(limits.plan) : null; -- const highest = limits ? Math.max(0, ...Object.values(limits.classes).flatMap((c) => c ? [c.percent, ...(c.window ? [c.window.percent] : [])] : [])) : null; -+ const isEnterprise = limits?.plan === 'enterprise' || plan?.name === 'Enterprise'; -+ const meteredClasses = limits ? Object.values(limits.classes).filter((c) => c && !(isEnterprise && c.paying === 'credits')) : []; -+ const highest = limits ? (meteredClasses.length ? Math.max(0, ...meteredClasses.flatMap((c) => c ? [c.percent, ...(c.window ? [c.window.percent] : [])] : [])) : null) : null; -+ const danger = percent !== null ? percent >= 90 : (highest !== null && highest >= 95 && meteredClasses.some((c) => c && c.state === 'limited')); - const title = plan ? `${plan.name}${plan.tag ? ` ${plan.tag}` : ''}` : t('Plan usage'); - const toggle = (on) => { setOpen(on); if (on && read) - read.reload(); }; - const metric = (name, n) => _jsxs(XStack, { justify: "space-between", gap: "$3", children: [_jsx(Text, { fontSize: "$2", color: "$soft", children: name }), _jsx(Text, { fontSize: "$2", color: "$ink", fontVariant: ['tabular-nums'], children: integer(n) })] }, name); -- return (_jsxs(Popover, { open: open, onOpenChange: toggle, placement: "top-end", children: [_jsx(PopoverTrigger, { asChild: true, children: _jsx(XStack, { render: "button", type: 'button', items: "center", height: 28, px: 5, rounded: 8, bg: "transparent", hoverStyle: { bg: '$hover' }, transition: "quickest", cursor: "pointer", "$max-sm": { height: 36 }, "aria-label": t('Context, tokens and plan usage'), "data-slot": "composer-usage", children: _jsx(SizableText, { size: "$3", color: highest !== null && highest >= 95 ? '$bad' : '$soft', children: percent !== null ? `${percent}%` : highest !== null ? `${Math.round(highest)}%` : t('Usage') }) }) }), _jsx(PopoverContent, { solid: true, width: 360, maxW: "calc(100vw - 24px)", maxH: "min(680px, calc(100dvh - 100px))", overflowY: "auto", "aria-label": t('Context, tokens and plan usage'), "data-slot": "composer-usage-panel", children: _jsxs(YStack, { gap: "$4", minW: 0, children: [_jsxs(XStack, { justify: "space-between", items: "center", gap: "$3", children: [_jsx(Text, { fontSize: "$3", fontWeight: "600", color: "$ink", children: t('Usage') }), _jsxs(Button, { type: "button", size: "sm", variant: "link", onClick: () => { setOpen(false); showSettings('usage'); }, "data-slot": "composer-see-usage", children: [t('See all usage'), " ", _jsx(ArrowUpRight, { size: 13 })] })] }), context && estimate ? (_jsxs(YStack, { gap: "$2", "data-slot": "composer-context", children: [_jsxs(XStack, { justify: "space-between", gap: "$2", children: [_jsx(Text, { fontSize: "$2", fontWeight: "600", children: t('Context · estimated') }), _jsx(Text, { fontSize: "$1", color: "$soft", children: capacity ? t('{used} / {max} tokens', { used: integer(estimate.total), max: integer(capacity) }) : t('{used} tokens', { used: integer(estimate.total) }) })] }), percent !== null ? _jsx(Progress, { value: Math.min(100, percent), height: 5, "aria-label": t('Estimated context used'), indicatorColor: percent >= 90 ? '$bad' : '$good' }) : null, estimate.rows.filter((r) => r.tokens > 0).map((r) => metric(t(r.name), r.tokens)), _jsx(Text, { fontSize: "$1", color: "$soft", children: t('Text estimate; model tokenization and attachments can change the total.') }), !capacity ? _jsx(Text, { fontSize: "$1", color: "$soft", children: t('This model does not report a context capacity.') }) : null] })) : null, _jsxs(YStack, { gap: "$2", "data-slot": "composer-reported-tokens", children: [_jsx(Text, { fontSize: "$2", fontWeight: "600", children: t('Last response · reported tokens') }), tokens ? _jsxs(_Fragment, { children: [metric(t('Input'), tokens.input), metric(t('Output'), tokens.output), tokens.cached !== undefined ? metric(t('Cached input'), tokens.cached) : null, tokens.reasoning !== undefined ? metric(t('Reasoning'), tokens.reasoning) : null, metric(t('Total'), tokens.total)] }) : _jsx(Text, { fontSize: "$2", color: "$soft", children: t('No token counts reported for this conversation yet. See all usage for account totals.') })] }), _jsxs(YStack, { gap: "$2", "data-slot": "composer-account-usage", children: [_jsx(Text, { fontSize: "$2", fontWeight: "600", children: t('Account · last 30 days') }), aggregate?.data ? _jsxs(_Fragment, { children: [metric(t('Tokens'), aggregate.data.totals.tokens), metric(t('Input'), aggregate.data.totals.promptTokens), metric(t('Output'), aggregate.data.totals.completionTokens), metric(t('Requests'), aggregate.data.totals.requests)] }) : _jsx(Text, { fontSize: "$2", color: "$soft", children: aggregate?.error ?? t('Reading account usage…') })] }), _jsxs(YStack, { gap: "$2", "data-slot": "composer-plan-usage", children: [_jsx(Text, { fontSize: "$2", fontWeight: "600", children: title }), limits ? _jsx(UsageMeter, { limits: limits, size: "sm" }) : _jsx(Text, { fontSize: "$2", color: "$soft", children: t(answered ? 'Plan usage is unavailable. Try again.' : 'Reading plan usage…') }), answered && !limits ? _jsx(Button, { type: "button", size: "sm", variant: "link", onClick: usage.reload, children: t('Retry') }) : null] }), _jsxs(XStack, { gap: "$3", justify: "space-between", flexWrap: "wrap", children: [_jsx(Button, { asChild: true, size: "sm", children: _jsx(Anchor, { href: payPage('/cart'), "data-slot": "composer-upgrade", children: t('Upgrade plan') }) }), _jsx(Button, { asChild: true, size: "sm", variant: "outline", children: _jsx(Anchor, { href: payPage('/amount/card'), "data-slot": "composer-buy-credits", children: t('Buy credits') }) })] })] }) })] })); -+ return (_jsxs(Popover, { open: open, onOpenChange: toggle, placement: "top-end", children: [_jsx(PopoverTrigger, { asChild: true, children: _jsx(XStack, { render: "button", type: 'button', items: "center", height: 28, px: 5, rounded: 8, bg: "transparent", hoverStyle: { bg: '$hover' }, transition: "quickest", cursor: "pointer", "$max-sm": { height: 36 }, "aria-label": t('Context, tokens and plan usage'), "data-slot": "composer-usage", children: _jsx(SizableText, { size: "$3", color: danger ? '$bad' : '$soft', children: percent !== null ? `${percent}%` : highest !== null ? `${Math.round(highest)}%` : t('Usage') }) }) }), _jsx(PopoverContent, { solid: true, width: 360, maxW: "calc(100vw - 24px)", maxH: "min(680px, calc(100dvh - 100px))", overflowY: "auto", "aria-label": t('Context, tokens and plan usage'), "data-slot": "composer-usage-panel", children: _jsxs(YStack, { gap: "$4", minW: 0, children: [_jsxs(XStack, { justify: "space-between", items: "center", gap: "$3", children: [_jsx(Text, { fontSize: "$3", fontWeight: "600", color: "$ink", children: t('Usage') }), _jsxs(Button, { type: "button", size: "sm", variant: "link", onClick: () => { setOpen(false); showSettings('usage'); }, "data-slot": "composer-see-usage", children: [t('See all usage'), " ", _jsx(ArrowUpRight, { size: 13 })] })] }), context && estimate ? (_jsxs(YStack, { gap: "$2", "data-slot": "composer-context", children: [_jsxs(XStack, { justify: "space-between", gap: "$2", children: [_jsx(Text, { fontSize: "$2", fontWeight: "600", children: t('Context · estimated') }), _jsx(Text, { fontSize: "$1", color: "$soft", children: capacity ? t('{used} / {max} tokens', { used: integer(estimate.total), max: integer(capacity) }) : t('{used} tokens', { used: integer(estimate.total) }) })] }), percent !== null ? _jsx(Progress, { value: Math.min(100, percent), height: 5, "aria-label": t('Estimated context used'), indicatorColor: percent >= 90 ? '$bad' : '$good' }) : null, estimate.rows.filter((r) => r.tokens > 0).map((r) => metric(t(r.name), r.tokens)), _jsx(Text, { fontSize: "$1", color: "$soft", children: t('Text estimate; model tokenization and attachments can change the total.') }), !capacity ? _jsx(Text, { fontSize: "$1", color: "$soft", children: t('This model does not report a context capacity.') }) : null] })) : null, _jsxs(YStack, { gap: "$2", "data-slot": "composer-reported-tokens", children: [_jsx(Text, { fontSize: "$2", fontWeight: "600", children: t('Last response · reported tokens') }), tokens ? _jsxs(_Fragment, { children: [metric(t('Input'), tokens.input), metric(t('Output'), tokens.output), tokens.cached !== undefined ? metric(t('Cached input'), tokens.cached) : null, tokens.reasoning !== undefined ? metric(t('Reasoning'), tokens.reasoning) : null, metric(t('Total'), tokens.total)] }) : _jsx(Text, { fontSize: "$2", color: "$soft", children: t('No token counts reported for this conversation yet. See all usage for account totals.') })] }), _jsxs(YStack, { gap: "$2", "data-slot": "composer-account-usage", children: [_jsx(Text, { fontSize: "$2", fontWeight: "600", children: t('Account · last 30 days') }), aggregate?.data ? _jsxs(_Fragment, { children: [metric(t('Tokens'), aggregate.data.totals.tokens), metric(t('Input'), aggregate.data.totals.promptTokens), metric(t('Output'), aggregate.data.totals.completionTokens), metric(t('Requests'), aggregate.data.totals.requests)] }) : _jsx(Text, { fontSize: "$2", color: "$soft", children: aggregate?.error ?? t('Reading account usage…') })] }), _jsxs(YStack, { gap: "$2", "data-slot": "composer-plan-usage", children: [_jsx(Text, { fontSize: "$2", fontWeight: "600", children: title }), limits ? _jsx(UsageMeter, { limits: limits, size: "sm" }) : _jsx(Text, { fontSize: "$2", color: "$soft", children: t(answered ? 'Plan usage is unavailable. Try again.' : 'Reading plan usage…') }), answered && !limits ? _jsx(Button, { type: "button", size: "sm", variant: "link", onClick: usage.reload, children: t('Retry') }) : null] }), _jsxs(XStack, { gap: "$3", justify: "space-between", flexWrap: "wrap", children: [!isEnterprise ? (_jsx(Button, { asChild: true, size: "sm", children: _jsx(Anchor, { href: payPage('/cart'), onClick: (e) => { e.preventDefault(); setOpen(false); window.location.hash = '#pricing'; window.dispatchEvent(new CustomEvent('hanzo:upgrade')); }, "data-slot": "composer-upgrade", children: t('Upgrade plan') }) })) : null, _jsx(Button, { asChild: true, size: "sm", variant: "outline", children: _jsx(Anchor, { href: payPage('/amount/card'), "data-slot": "composer-buy-credits", children: t('Buy credits') }) })] })] }) })] })); - } - /** Every shared composer in the app gets the same account usage entry. */ - export function UsageProvider({ children }) { -diff --git a/dist/failure.js b/dist/failure.js -index d9d19dd2e521ca818ff16a3726b57a530d054ff3..822199004a8d10bcd8ee6cd3efa9c90fd106696b 100644 ---- a/dist/failure.js -+++ b/dist/failure.js -@@ -123,7 +123,8 @@ export function billed(error) { - return null; - return refusalOf(error?.body, code); - } --function ours(href) { -+/** The address, when it is an https page on hanzo.ai or one of its hosts: the only kind a refusal may send the reader to. */ -+export function ours(href) { - if (typeof href !== 'string') - return undefined; - try { -diff --git a/dist/help.js b/dist/help.js -index 4adda95d631f2017606298c670eb0ce982d58d44..b81b5410239695df5edae89250bc370abe73c287 100644 ---- a/dist/help.js -+++ b/dist/help.js -@@ -32,6 +32,9 @@ export const legal = () => [ - */ - export const KEYS = [ - { does: phrase('Search chats'), mac: '⌘K', pc: 'Ctrl+K' }, -+ { does: phrase('New chat'), mac: '⌘N / ⇧⌘O', pc: 'Ctrl+N / Ctrl+Shift+O' }, -+ { does: phrase('Toggle sidebar'), mac: '⌘B', pc: 'Ctrl+B' }, -+ { does: phrase('Voice input'), mac: '⇧⌘M', pc: 'Ctrl+Shift+M' }, - { does: phrase('Settings'), mac: '⌘,', pc: 'Ctrl+,' }, - { does: phrase('Keyboard shortcuts'), mac: '⌘/', pc: 'Ctrl+/' }, - { does: phrase('Side panel'), mac: '⌘.', pc: 'Ctrl+.' }, -diff --git a/dist/lib/limits.js b/dist/lib/limits.js -index 64d28061e9be685cf336edaa0bc930a2a0c2be06..bf142db8fb460731d5ccffc1835cdc8bdc3dcad9 100644 ---- a/dist/lib/limits.js -+++ b/dist/lib/limits.js -@@ -7,12 +7,14 @@ - * Same base URL and headers as every billing read (lib/hanzo/tier.ts): the - * bearer is the subject and `X-Org-Id` the organization this browser works in. - */ --import { label, said, spent, ways, when } from '@hanzo/build/plan'; -+import { ways } from '@hanzo/build/plan'; - import { useLimits as useHeld } from '@hanzo/ui/product/useLimits'; - import { paidPlan } from '@hanzo/ui/product/limits'; -+import { format } from '@hanzo/i18n'; - import { english } from '../say.js'; - import { api } from './api.js'; --import { scope } from './session.js'; -+import { payUrl } from './pay.js'; -+import { org, scope } from './session.js'; - /** Reads the limits as whoever holds the bearer, in this browser's organization. */ - export async function readLimits(signal) { - const res = await fetch(`${api()}/v1/ai/limits`, { headers: scope(), signal }); -@@ -49,31 +51,82 @@ export const useLimits = (enabled = true, org = null, name) => useHeld(enabled ? - */ - export const spendShown = ({ limits, answered }) => answered && !paidPlan(limits); - export { paidPlan }; -+/** Whether the plan is Ultra: its id, compared as `paidPlan` compares it. */ -+export const ultra = (l) => l?.plan === 'ultra'; -+/** An instant as the server writes one: RFC 3339, with its offset. Anything else names no instant. */ -+const INSTANT = /^\d{4}-\d{2}-\d{2}T\d{2}:\d{2}(:\d{2}(\.\d+)?)?(Z|[+-]\d{2}:\d{2})$/i; -+/** -+ * When a spent allowance comes back, on the reader's own clock, or null when the -+ * server names no instant still ahead (none, one not RFC 3339, or one passed). -+ * `date` is '' when that is today where the reader is, and carries the year only -+ * when it is not this year. `time` is null at midnight, which is said as the -+ * word, never as 0:00, 00:00 or 12:00 AM; a midnight's date is the day it ends, -+ * so tonight's is today. `f` writes both (@hanzo/i18n `format`: the reader's -+ * locale, set apart in right-to-left prose), in `zone`, the browser's own unless -+ * a caller names one. -+ */ -+export function resets(iso, now, f, zone) { -+ const at = iso && INSTANT.test(iso) ? Date.parse(iso) : NaN; -+ if (!(at > now)) -+ return null; -+ const midnight = new Intl.DateTimeFormat('en-US', { timeZone: zone, hourCycle: 'h23', hour: '2-digit', minute: '2-digit' }).format(at) === '00:00'; -+ const ends = midnight ? at - 1 : at; -+ const part = (instant, o) => new Intl.DateTimeFormat('en-CA', { timeZone: zone, ...o }).format(instant); -+ const today = part(ends, { year: 'numeric', month: '2-digit', day: '2-digit' }) === part(now, { year: 'numeric', month: '2-digit', day: '2-digit' }); -+ const year = part(ends, { year: 'numeric' }) !== part(now, { year: 'numeric' }); -+ return { -+ date: today ? '' : f.date(ends, { timeZone: zone, month: 'short', day: 'numeric', ...(year ? { year: 'numeric' } : {}) }), -+ time: midnight ? null : f.date(at, { timeZone: zone, hour: 'numeric', minute: '2-digit' }), -+ }; -+} -+/** "Usage reached." and, when the server names one still ahead, when it comes back. */ -+function reached(back, t) { -+ if (!back) -+ return t('Usage reached.'); -+ if (back.date) -+ return back.time ? t('Usage reached. Resets {date} at {time}.', { date: back.date, time: back.time }) : t('Usage reached. Resets {date} at midnight.', { date: back.date }); -+ return back.time ? t('Usage reached. Resets at {time}.', { time: back.time }) : t('Usage reached. Resets at midnight.'); -+} -+/** -+ * The refusals that are usage spent until a reset: a paid plan's included -+ * usage, its request window, the Free plan's cap and its allowance's window. -+ */ -+const SPENT = new Set(['plan_allowance_used', 'usage_cap_exceeded', 'free_plan_cap', 'allowance_spent']); -+/** Whether a refusal's code is usage spent until a reset, which is said in our words and never the server's. */ -+export const spends = (code) => SPENT.has(code); - /** - * What the banner over the composer says once the reader is turned away, and -- * the ways on. A spent allowance is said by the plan's name and when it comes -- * back — `Your Max 20x plan’s included premium model usage is used until 5:00 -- * PM.` — and a spent request window the same way; any other refusal in the -- * server's own words. The ways are @hanzo/build's `ways`: continue with credits -- * where the org holds some, else add credits; then the upgrade. What this module -- * says goes through `t`; the spent allowance's sentence and the ways' labels are -- * @hanzo/build's own. -+ * the ways on, or null when it says nothing. Usage spent until a reset reads -+ * `Usage reached. Resets at 5:00 PM.` (`resets`: the reader's clock, never a -+ * ceiling), with three ways: the upgrade (the server's own, else pay's plans), -+ * credits (the server's Continue with credits where the org holds some, else -+ * pay's amount step to add some), both for this browser's organization and -+ * coming back here, and Try again later, which the host takes as putting the -+ * banner away. Until the plan is read (`limits` null) there is no upgrade: the -+ * plan could be Ultra. Ultra has no allowance to spend, so what turns it away is -+ * an empty balance, said as that, and its one way on is credits. Any other -+ * refusal is the server's own words and ways (@hanzo/build `ways`). Everything -+ * said goes through `t`, and the time through `f`. - */ --export function paused(n, plan, name = (id) => id, now = Date.now(), t = english) { -- const l = label(plan); -- const until = when(n.resets_at ?? '', now); -+export function paused(n, limits, name = (id) => id, now = Date.now(), t = english, f = format('en-US')) { - const on = n.fallback ? t(' You’re chatting on {model}.', { model: name(n.fallback) }) : ''; -- const used = () => { -- if (l) -- return until ? t('Your {plan} plan’s requests are used until {until}.', { plan: said(l), until }) : t('Your {plan} plan’s requests are used.', { plan: said(l) }); -- return until ? t('Your plan’s requests are used until {until}.', { until }) : t('Your plan’s requests are used.'); -+ if (!SPENT.has(n.reason) && (n.reason || n.classes.length === 0)) -+ return { message: n.message, actions: ways(n.actions, t) }; -+ const here = typeof window === 'undefined' ? undefined : window.location.href; -+ const topup = { kind: 'topup', label: t('Add credits'), url: payUrl('/amount/card', { org: org(), returnUrl: here }) }; -+ if (ultra(limits)) -+ return { message: t('Your balance is empty.') + on, actions: [topup] }; -+ const credits = n.actions.find((a) => a.kind === 'credits'); -+ const way = credits ? { ...credits, label: t('Continue with credits') } : topup; -+ const later = { kind: 'later', label: t('Try again later') }; -+ const message = reached(resets(n.resets_at, now, f), t) + on; -+ if (!limits) -+ return { message, actions: [way, later] }; -+ const upgrade = n.actions.find((a) => a.kind === 'upgrade'); -+ return { -+ message, -+ actions: [{ kind: 'upgrade', label: t('Upgrade to continue'), url: upgrade?.url ?? payUrl('/cart', { org: org(), returnUrl: here }) }, way, later], - }; -- const message = n.reason === 'plan_allowance_used' || (!n.reason && n.classes.length > 0) -- ? spent(l, n.classes, n.resets_at ?? '', now) + on -- : n.reason === 'usage_cap_exceeded' -- ? used() + on -- : n.message; -- return { message, actions: ways(n.actions) }; - } - /** Whether a catalog family is one of Hanzo's chat families, Enso or Zen, whose turns carry the live web. */ - export const house = (family) => family === 'enso' || family === 'zen'; -diff --git a/dist/lib/pay.js b/dist/lib/pay.js -index 672f95f41d058110cdba037709d53e243f3614c1..74d1e8c24c3268752f7bfd9ba9164310a3169494 100644 ---- a/dist/lib/pay.js -+++ b/dist/lib/pay.js -@@ -54,12 +54,16 @@ export function checkoutUrl(id, back) { - export function payPage(path = "/") { - return payUrl(path, { org: org() }); - } -+const CHECKOUT_SLUG = { -+ "pro-3x": "pro-2x", -+ "max-15x": "max-10x", -+}; - /** The pay address with its query, written in one place for both callers above. */ - export function payUrl(path, query) { - const q = new URLSearchParams(); - for (const [k, v] of Object.entries(query)) - if (v) -- q.set(k, v); -+ q.set(k, k === "plan" ? (CHECKOUT_SLUG[v] ?? v) : v); - const s = q.toString(); - const at = billing(); - if (path === "/" && !s) -diff --git a/dist/pane.js b/dist/pane.js -index 9789697def551c028fbb12dfe2acbdf3ebcbc309..e3b55a0d79525811164ad42c0bf7d1ad6a8df3c4 100644 ---- a/dist/pane.js -+++ b/dist/pane.js -@@ -125,11 +125,6 @@ function watch(api, f, key, id) { - export async function hold(key, list, via) { - if (!list.length) - return; -- if (!via.org) { -- edit(key, (was) => ({ ...was, refused: 'Sign in to attach files: they are kept in your workspace Drive.' })); -- return; -- } -- const org = via.org; - const taken = list.map((file) => ({ - id: mint('h'), - name: file.name, -@@ -147,6 +142,55 @@ export async function hold(key, list, via) { - carrying.set(h.id, { stop, done }); - return { h, file: list[i], stop, land }; - }); -+ if (!via.org) { -+ await Promise.all(jobs.map(async ({ h, file, stop, land }) => { -+ try { -+ if (stop.signal.aborted) -+ return land(null); -+ const isImage = file.type.startsWith('image/') || /\.(png|jpe?g|gif|webp|avif|svg)$/i.test(file.name); -+ if (isImage) { -+ const dataUrl = await new Promise((resolve, reject) => { -+ const reader = new FileReader(); -+ reader.onload = () => resolve(typeof reader.result === 'string' ? reader.result : ''); -+ reader.onerror = () => reject(new Error(`Could not read ${file.name}`)); -+ reader.readAsDataURL(file); -+ }); -+ const got = { -+ id: `local-${h.id}`, -+ name: file.name, -+ size: file.size, -+ type: file.type || 'image/png', -+ status: 'ready', -+ dataUrl, -+ }; -+ local.set(got.id, h.href); -+ know(got); -+ patch(key, h.id, fromFile(got)); -+ return land(got); -+ } -+ const localText = await file.text(); -+ const got = { -+ id: `local-${h.id}`, -+ name: file.name, -+ size: file.size, -+ type: file.type || 'text/plain', -+ status: 'ready', -+ localText, -+ }; -+ local.set(got.id, h.href); -+ know(got); -+ patch(key, h.id, fromFile(got)); -+ return land(got); -+ } -+ catch (e) { -+ if (!stop.signal.aborted) -+ patch(key, h.id, { state: 'failed', error: e?.message || `${file.name} could not be read.` }); -+ return land(null); -+ } -+ })); -+ return; -+ } -+ const org = via.org; - await pool(jobs, FILES_AT_ONCE, async ({ h, file, stop, land }) => { - try { - if (stop.signal.aborted) -diff --git a/dist/recent.js b/dist/recent.js -index cbb8d4539b35f2ba0267deb7b6b8000807e91425..b302d610812041b13f53f57f934ff599aea3fcb0 100644 ---- a/dist/recent.js -+++ b/dist/recent.js -@@ -54,7 +54,9 @@ export const MENUS = { - /** A kept view as this mode may hold it: anything a menu does not offer reads as the plain view's. */ - export function viewOf(mode, kept) { - const k = (kept && typeof kept === 'object' ? kept : {}); -- const m = MENUS[mode]; -+ // A mode with no menu of its own (Tabs draws its own column) still gets a -+ // view: the chat one, so reading it is never a crash. -+ const m = MENUS[mode] ?? MENUS.chat; - const pick = (v, from, fallback) => from.find((o) => o.id === v)?.id ?? fallback; - return { - status: pick(k.status, m.status, PLAIN.status), -diff --git a/dist/seek.js b/dist/seek.js -index bbf49a03dae4f2115047947ce72a11639b4001cd..37cece1a2e1d0d7a9e5635a9a1d5bc773ba7418b 100644 ---- a/dist/seek.js -+++ b/dist/seek.js -@@ -76,5 +76,8 @@ export function find(query, recent, idle, all) { - .sort((a, b) => b.best - a.best || a.i - b.i) - .map((x) => x.g); - } --/** Whether a key press opens the palette: ⌘K or Ctrl+K, once a press, from anywhere, a field included. */ --export const summons = (e) => (e.metaKey || e.ctrlKey) && !e.altKey && !e.shiftKey && !e.repeat && !e.isComposing && (e.key ?? '').toLowerCase() === 'k'; -+/** -+ * Whether a key press opens the palette: ⌘K or Ctrl+K, once a press, from anywhere, a field included — -+ * unless something on the page already answered it (Dev's composer opens its own commands and claims the press). -+ */ -+export const summons = (e) => !e.defaultPrevented && (e.metaKey || e.ctrlKey) && !e.altKey && !e.shiftKey && !e.repeat && !e.isComposing && (e.key ?? '').toLowerCase() === 'k'; -diff --git a/dist/thread.js b/dist/thread.js -index e4e9a4500e9692ab38e75050996e2f0045933a2f..d18a8811558ee7610049f746dee2e3a90eafef1c 100644 ---- a/dist/thread.js -+++ b/dist/thread.js -@@ -29,6 +29,7 @@ import { Button, ContextMenu, ContextMenuContent, ContextMenuItem, ContextMenuSe - import { empty } from './open.js'; - import { say } from './lib/org.js'; - import { talk } from './lib/host.js'; -+import { hasSession } from './lib/session.js'; - import { BAD } from './lib/mix.js'; - import { site } from './where.js'; - import { attempt, bind, enlist, reread, snapshot, subscribe, sweep, tick, view } from './pending.js'; -@@ -76,6 +77,18 @@ export function useThreadList(archived = false, seek = null) { - }, (e) => { - if (control.signal.aborted) - return; -+ // A READER WITH NO SESSION HAS NO CONVERSATIONS: the store answers -+ // 401 and the honest list is empty. The window draws the app for a -+ // guest (Orgs.js), so this is the first thing they would otherwise -+ // read — the store's refusal, in the place the Recents go. -+ if (!hasSession()) { -+ const got = { threads: [], at, archived }; -+ last.set(ai, { ...last.get(ai), [`${archived}`]: got }); -+ setRead(got); -+ setError(null); -+ setLoading(false); -+ return; -+ } - setError(e instanceof Error ? e : new Error(String(e))); - setLoading(false); - }); diff --git a/patches/@hanzo__app@0.3.107.patch b/patches/@hanzo__app@0.3.107.patch new file mode 100644 index 00000000..11ea9af5 --- /dev/null +++ b/patches/@hanzo__app@0.3.107.patch @@ -0,0 +1,260 @@ +diff --git a/dist/Chat.js b/dist/Chat.js +index 0489151..2a0527b 100644 +--- a/dist/Chat.js ++++ b/dist/Chat.js +@@ -869,10 +869,12 @@ function Thread({ placeholder = message(), initial, anonymous = false, settled = + }; + const listed = mind.models; + const filteredListed = useMemo(() => { +- if (chatPrefs.allowThirdPartyModels) ++ // Hanzo Desktop: a signed-out reader's catalog is the local engine's ++ // (the window's fetch bridge), so every model it lists is offered. ++ if (anonymous || chatPrefs.allowThirdPartyModels) + return listed; + return listed.filter((m) => isHouseModel(m) || m.id === ENSO); +- }, [listed, chatPrefs.allowThirdPartyModels]); ++ }, [listed, anonymous, chatPrefs.allowThirdPartyModels]); + const models = useMemo(() => filteredListed.filter(chats), [filteredListed]); + // EVERY MODEL THE GATEWAY LISTS is offered here, through the one picker, and + // read from the catalog's own fields (`parseModels`): its class, its family. +@@ -884,7 +886,8 @@ function Thread({ placeholder = message(), initial, anonymous = false, settled = + const wanted = mind.model; + // A model the catalog lists is sent as picked, whatever it answers with; only + // a name the catalog does not list falls to one that converses (`served`). +- const sent = anonymous ? ENSO : wanted; ++ // Hanzo Desktop: the local model a signed-out reader picked is the one asked. ++ const sent = anonymous ? wanted || ENSO : wanted; + const model = persona?.model || (rowOf(sent) ? sent : served(models, sent)); + // THE PLAN'S USAGE (lib/limits.ts), kept current by every chat answer's + // headers and read again whenever a send settles, below. The pane draws no +@@ -1105,7 +1108,7 @@ function Thread({ placeholder = message(), initial, anonymous = false, settled = + // identity changes on every `setMessages` — `useChat` closes over `messages` — + // so an effect depending on it re-runs after each streamed token. + const latest = useRef(send); +- latest.current = (text) => send(text); ++ latest.current = (text, images) => send(text, images); + // THE COMPOSER'S DRAFT IS HELD HERE, so an arriving question can be typed into + // it. `Chat` owns a draft of its own and spreads `composer` after it, so + // passing value/onChange/onSend takes that ownership over rather than fighting +@@ -1218,10 +1221,15 @@ function Thread({ placeholder = message(), initial, anonymous = false, settled = + const [anonBusy, setAnonBusy] = useState(false); + const [anonGateOpen, setAnonGateOpen] = useState(false); + const anonCountRef = useRef(0); +- const sendAnon = useCallback(async (rawText) => { ++ const sendAnon = useCallback(async (rawText, images) => { + const clean = (rawText || "").trim(); +- if (!clean) +- return; ++ // HANZO DESKTOP ANSWERS ITS SIGNED-OUT READER ITSELF: the window's fetch ++ // bridge (host.tsx) sends a chat with no session to the local engine, so ++ // the turn takes the signed-in lane: the whole conversation, the model ++ // picked, pictures and files read here, and no turn limit or sign-in gate. ++ if (clean || (images && images.length)) ++ setQueued(images && images.length ? { text: clean, images } : clean); ++ return; + try { + sessionStorage.setItem("hanzo.build.prompt", clean); + const shortTitle = clean.length > 48 ? `${clean.slice(0, 47).trimEnd()}…` : clean; +@@ -1341,7 +1349,10 @@ function Thread({ placeholder = message(), initial, anonymous = false, settled = + if (queued === null || resolving) + return; + setQueued(null); +- void latest.current(queued); ++ if (typeof queued === "object") ++ void latest.current(queued.text, queued.images); ++ else ++ void latest.current(queued); + }, [queued, resolving]); + const streaming = useRef(false); + streaming.current = chat.streaming; +@@ -1442,16 +1453,14 @@ function Thread({ placeholder = message(), initial, anonymous = false, settled = + * it leaves its place in the thread and is asked at the end, so it is asked + * once and not twice. + */ +- const speak = useCallback((text, again) => { +- if (!text) ++ const speak = useCallback((text, again, images) => { ++ if (!text && !(images && images.length)) + return; + // Activation: the first question this browser asks (a retry is not one). + if (!again) + first("chat_message"); +- if (anonymous) { +- void sendAnon(text); +- return; +- } ++ // Hanzo Desktop: a signed-out turn takes this lane too (`sendAnon`), so a ++ // retry leaves its place in the thread as a signed-in one does. + if (!streaming.current && (again || resolvingNow.current || turns.current.some(blank))) { + apply.current((held) => held.filter((one) => one.id !== again && !blank(one))); + if (again) +@@ -1459,10 +1468,10 @@ function Thread({ placeholder = message(), initial, anonymous = false, settled = + const { [again]: _gone, ...rest } = all; + return rest; + }); +- setQueued(text); ++ setQueued(images && images.length ? { text, images } : text); + return; + } +- void latest.current(text); ++ void latest.current(text, images); + }, [anonymous, sendAnon]); + // THE WAYS PAST A PAUSE. The upgrade opens the plans over the app; a page opens; Continue + // with credits turns the org's choice on and asks the last question again on +@@ -1931,6 +1940,28 @@ function Thread({ placeholder = message(), initial, anonymous = false, settled = + setPreparing(t("Uploading {files}", { files: names(holding, t) })); + const landedFiles = (await Promise.all(holding.map(landed))).filter((f) => !!f); + spend(at); ++ // Hanzo Desktop: with no session the files never left the window ++ // (pane.js `hold`): a picture goes with the turn as itself, and a ++ // text file as the passages it holds. ++ const localImages = landedFiles.map((f) => f.dataUrl).filter(Boolean); ++ const localTextFiles = landedFiles.filter((f) => typeof f.localText === "string"); ++ if (anonymous || localImages.length || localTextFiles.length) { ++ const localAttached = localTextFiles.map(refOf); ++ const reusedLocal = earlier.filter((f) => !localAttached.some((a) => a.id === f.id)); ++ if (!localAttached.length && !reusedLocal.length) { ++ const promptText = text || (localImages.length ? "What is in this image?" : ""); ++ guarded(extra ? carrying(promptText, extra) : promptText, undefined, localImages.length ? localImages : undefined); ++ return; ++ } ++ const localGrounds = { ++ passages: localTextFiles.map((f, i) => ({ ++ cite: `${f.name} › ¶${i + 1}`, ++ text: String(f.localText || "").slice(0, 100000), ++ })), ++ }; ++ guarded(compose(text, { attached: localAttached, reused: reusedLocal }, localGrounds, undefined, undefined, extra), undefined, localImages.length ? localImages : undefined); ++ return; ++ } + const attached = landedFiles.map(refOf); + const reused = earlier.filter((f) => !attached.some((a) => a.id === f.id)); + const all = [...attached, ...reused]; +@@ -1993,6 +2024,9 @@ function Thread({ placeholder = message(), initial, anonymous = false, settled = + const failure = (question) => { + const failed = failures[question.id]; + const text = words(question.content); ++ const pictures = Array.isArray(question.content) ++ ? question.content.filter((p) => p?.type === "image_url" && p.image_url?.url).map((p) => p.image_url.url) ++ : undefined; + const whom = addressed(text, cast); + const wrong = failed?.error ?? null; + const how = wrong ? refusalOf(wrong) : null; +@@ -2017,7 +2051,7 @@ function Thread({ placeholder = message(), initial, anonymous = false, settled = + : how?.provider + ? t("{model} is unavailable right now.", { model: familyOf(model) || nameOf(model, listed) }) + : plainly(wrong, t("this conversation"), t); +- return (_jsx(Failure, { retryLabel: t("Try again"), onRetry: resign || lift || spends(bill?.code ?? "") ? undefined : () => speak(text, question.id), children: _jsxs(YStack, { gap: "$2", children: [_jsxs(Text, { fontSize: "$3", color: "$ink", children: [whom.length ? `${t("No answer from {names}.", { names: join(whom, t) })} ` : "", said] }), how?.provider && wrong ? _jsx(Why, { text: detail(wrong) }) : null, lift || (!bill && (resign || how?.wallet || how?.visitor)) ? (_jsx(XStack, { gap: "$2", flexWrap: "wrap", children: resign ? (_jsx(Button, { size: "sm", onClick: () => { ++ return (_jsx(Failure, { retryLabel: t("Try again"), onRetry: resign || lift || spends(bill?.code ?? "") ? undefined : () => speak(text, question.id, pictures), children: _jsxs(YStack, { gap: "$2", children: [_jsxs(Text, { fontSize: "$3", color: "$ink", children: [whom.length ? `${t("No answer from {names}.", { names: join(whom, t) })} ` : "", said] }), how?.provider && wrong ? _jsx(Why, { text: detail(wrong) }) : null, anonymous || how?.provider ? (_jsxs(XStack, { gap: "$2", flexWrap: "wrap", "data-slot": "failure-local-ai", children: [_jsx(Button, { size: "sm", variant: "outline", onClick: () => window.dispatchEvent(new CustomEvent("hanzo:open-local-ai", { detail: { tab: "models" } })), children: t("Select / Download Local Model") }), anonymous ? (_jsx(Button, { size: "sm", variant: "outline", onClick: () => window.dispatchEvent(new CustomEvent("hanzo:open-local-ai", { detail: { tab: "node" } })), children: t("Manage Local Node") })) : null] })) : null, lift || (!bill && (resign || how?.wallet || how?.visitor)) ? (_jsx(XStack, { gap: "$2", flexWrap: "wrap", children: resign ? (_jsx(Button, { size: "sm", onClick: () => { + if (typeof window !== "undefined") { + localStorage.removeItem("hanzo_iam_access_token"); + localStorage.removeItem("hanzo_iam_refresh_token"); +diff --git a/dist/Setup.js b/dist/Setup.js +index e86489d..f7b7f23 100644 +--- a/dist/Setup.js ++++ b/dist/Setup.js +@@ -112,7 +112,8 @@ export function Setup({ go } = {}) { + const accountList = Array.isArray(googleAccounts) ? googleAccounts : []; + const hasGoogle = googleDone || accountList.length > 0; + // Google Workspace is a private beta until Google verifies its scopes. +- const workspace = opens('workspace'); ++ // Hanzo Desktop: Google Workspace stays off in the window until Google verifies its scopes. ++ const workspace = false; + // Customize's plugins, inside the app where the host reads the path, else Dev on the site. + const openPlugins = () => (pathed && go ? go(app(PLUGINS)) : window.location.assign(site(app(PLUGINS)))); + // The token itself is lib/gmail's to keep; Setup lists the addresses. +diff --git a/dist/help.js b/dist/help.js +index 082b539..083f889 100644 +--- a/dist/help.js ++++ b/dist/help.js +@@ -33,7 +33,8 @@ export const legal = () => [ + */ + export const KEYS = [ + { does: phrase('Search chats'), mac: '⌘K', pc: 'Ctrl+K', group: 'Navigation' }, +- { does: phrase('New chat'), mac: '⌘⇧O', pc: 'Ctrl+Shift+O', group: 'Navigation' }, ++ // Hanzo Desktop: ⌘N also opens a new chat in the window (host.tsx). ++ { does: phrase('New chat'), mac: '⌘N / ⌘⇧O', pc: 'Ctrl+N / Ctrl+Shift+O', group: 'Navigation' }, + { does: phrase('Settings'), mac: '⌘,', pc: 'Ctrl+,', group: 'Navigation' }, + { does: phrase('Keyboard shortcuts'), mac: '⌘/', pc: 'Ctrl+/', group: 'Navigation' }, + { does: phrase('Toggle sidebar'), mac: '⌘B', pc: 'Ctrl+B', group: 'Workspace' }, +@@ -41,6 +42,8 @@ export const KEYS = [ + { does: phrase('Toggle theme'), mac: '⌘⇧L', pc: 'Ctrl+Shift+L', group: 'Workspace' }, + { does: phrase('Toggle Developer mode'), mac: '⌘⇧D', pc: 'Ctrl+Shift+D', group: 'Workspace' }, + { does: phrase('Attach files'), mac: '⌘U', pc: 'Ctrl+U', group: 'Chat' }, ++ // Hanzo Desktop: ⌘⇧M turns the composer's microphone on and off (host.tsx). ++ { does: phrase('Voice input'), mac: '⌘⇧M', pc: 'Ctrl+Shift+M', group: 'Chat' }, + { does: phrase('Send'), mac: 'Enter', pc: 'Enter', group: 'Chat' }, + { does: phrase('New line'), mac: '⇧Enter', pc: 'Shift+Enter', group: 'Chat' }, + { does: phrase('Rename chat'), mac: said('rename', true), pc: said('rename', false), group: 'Chat' }, +diff --git a/dist/pane.js b/dist/pane.js +index b1eb15e..1f3e5bc 100644 +--- a/dist/pane.js ++++ b/dist/pane.js +@@ -125,11 +125,6 @@ function watch(api, f, key, id) { + export async function hold(key, list, via) { + if (!list.length) + return; +- if (!via.org) { +- edit(key, (was) => ({ ...was, refused: 'Sign in to attach files: they are kept in your workspace Drive.' })); +- return; +- } +- const org = via.org; + const taken = list.map((file) => ({ + id: mint('h'), + name: file.name, +@@ -147,6 +142,55 @@ export async function hold(key, list, via) { + carrying.set(h.id, { stop, done }); + return { h, file: list[i], stop, land }; + }); ++ if (!via.org) { ++ await Promise.all(jobs.map(async ({ h, file, stop, land }) => { ++ try { ++ if (stop.signal.aborted) ++ return land(null); ++ const isImage = file.type.startsWith('image/') || /\.(png|jpe?g|gif|webp|avif|svg)$/i.test(file.name); ++ if (isImage) { ++ const dataUrl = await new Promise((resolve, reject) => { ++ const reader = new FileReader(); ++ reader.onload = () => resolve(typeof reader.result === 'string' ? reader.result : ''); ++ reader.onerror = () => reject(new Error(`Could not read ${file.name}`)); ++ reader.readAsDataURL(file); ++ }); ++ const got = { ++ id: `local-${h.id}`, ++ name: file.name, ++ size: file.size, ++ type: file.type || 'image/png', ++ status: 'ready', ++ dataUrl, ++ }; ++ local.set(got.id, h.href); ++ know(got); ++ patch(key, h.id, fromFile(got)); ++ return land(got); ++ } ++ const localText = await file.text(); ++ const got = { ++ id: `local-${h.id}`, ++ name: file.name, ++ size: file.size, ++ type: file.type || 'text/plain', ++ status: 'ready', ++ localText, ++ }; ++ local.set(got.id, h.href); ++ know(got); ++ patch(key, h.id, fromFile(got)); ++ return land(got); ++ } ++ catch (e) { ++ if (!stop.signal.aborted) ++ patch(key, h.id, { state: 'failed', error: e?.message || `${file.name} could not be read.` }); ++ return land(null); ++ } ++ })); ++ return; ++ } ++ const org = via.org; + await pool(jobs, FILES_AT_ONCE, async ({ h, file, stop, land }) => { + try { + if (stop.signal.aborted) diff --git a/patches/@hanzo__build@0.2.99.patch b/patches/@hanzo__build@0.2.99.patch deleted file mode 100644 index 1d28af07..00000000 --- a/patches/@hanzo__build@0.2.99.patch +++ /dev/null @@ -1,13 +0,0 @@ -diff --git a/lib/panel.js b/lib/panel.js -index d9d238992d5c16c1a9d60e382e56e8af96f2294c..1ee5830fecaf5559299a066780a2f30c3047b606 100644 ---- a/lib/panel.js -+++ b/lib/panel.js -@@ -68,7 +68,7 @@ export function PanelToggle({ open, onToggle }) { - const { t } = useI18n(); - if (open) - return null; -- return (_jsx(XStack, { render: "button", role: "button", "data-slot": "side-toggle", "aria-label": t('Show tabs'), "aria-expanded": false, "aria-keyshortcuts": SHORTCUTS, ...{ title: t('Show tabs ({keys})', { keys: KEYS }) }, onPress: onToggle, width: 32, height: 32, ...quiet(), children: _jsx(SquarePlus, { size: 16 }) })); -+ return (_jsx(XStack, { render: "button", role: "button", "data-slot": "side-toggle", "aria-label": t('Show tabs'), "aria-expanded": false, "aria-keyshortcuts": SHORTCUTS, ...{ title: t('Show tabs ({keys})', { keys: KEYS }) }, onPress: onToggle, width: 32, height: 32, ...quiet(), children: _jsx(Plus, { size: 18 }) })); - } - /** Our own hosts: a page of theirs answers a frame on any of our pages. */ - const OURS = ['hanzo.ai', 'hanzo.app', 'hanzo.bot']; diff --git a/patches/@hanzo__studio@0.1.8.patch b/patches/@hanzo__studio@0.1.15.patch similarity index 100% rename from patches/@hanzo__studio@0.1.8.patch rename to patches/@hanzo__studio@0.1.15.patch diff --git a/patches/@hanzo__ui@8.33.6.patch b/patches/@hanzo__ui@8.33.6.patch new file mode 100644 index 00000000..c9208f15 --- /dev/null +++ b/patches/@hanzo__ui@8.33.6.patch @@ -0,0 +1,243 @@ +diff --git a/dist/glass.css b/dist/glass.css +--- a/dist/glass.css ++++ b/dist/glass.css +@@ -254,10 +254,13 @@ + box-shadow: var(--glass-shadow-2) !important; + } + +-.elevation-3, ++.elevation-3 { ++ box-shadow: var(--glass-shadow-3) !important; ++} ++ + [data-slot="dialog-content"], + [data-slot="alert-dialog-content"] { +- box-shadow: var(--glass-shadow-3) !important; ++ box-shadow: none !important; + } + + /* ── The fold — the one mark that means an item opens ──────────────────────── +diff --git a/dist/marketing/Cta.cjs b/dist/marketing/Cta.cjs +index 396e25b..0fb48b1 100644 +--- a/dist/marketing/Cta.cjs ++++ b/dist/marketing/Cta.cjs +@@ -28,5 +28,5 @@ exports.Cta = Cta; + /** The sentence's own type, which gui's Text would otherwise replace with its + * body size. */ + const WORD = { fontFamily: 'inherit', fontSize: 'inherit', fontWeight: 'inherit', lineHeight: 'inherit', letterSpacing: 'inherit' }; +-const TextLink = ({ href, children, ...p }) => href !== undefined ? ((0, jsx_runtime_1.jsx)(gui_1.Anchor, { ...(0, slot_1.slot)('text-link'), href: href, ...WORD, color: "$ink", textDecorationLine: "underline", style: { textUnderlineOffset: 3 }, ...p, children: children })) : ((0, jsx_runtime_1.jsx)(gui_1.Text, { ...(0, slot_1.slot)('text-link'), render: (0, jsx_runtime_1.jsx)("button", { type: "button" }), p: 0, borderWidth: 0, bg: "transparent", ...WORD, color: "$ink", textDecorationLine: "underline", cursor: "pointer", style: { textUnderlineOffset: 3 }, ...p, children: children })); ++const TextLink = ({ href, children, ...p }) => href !== undefined ? ((0, jsx_runtime_1.jsx)(gui_1.Anchor, { ...(0, slot_1.slot)('text-link'), href: href, ...WORD, color: "$ink", textDecorationLine: "none", hoverStyle: { textDecorationLine: "none", opacity: 0.85 }, ...p, children: children })) : ((0, jsx_runtime_1.jsx)(gui_1.Text, { ...(0, slot_1.slot)('text-link'), render: (0, jsx_runtime_1.jsx)("button", { type: "button" }), p: 0, borderWidth: 0, bg: "transparent", ...WORD, color: "$ink", textDecorationLine: "none", hoverStyle: { textDecorationLine: "none", opacity: 0.85 }, cursor: "pointer", ...p, children: children })); + exports.TextLink = TextLink; +diff --git a/dist/marketing/Cta.js b/dist/marketing/Cta.js +index 81182c8..a4cb936 100644 +--- a/dist/marketing/Cta.js ++++ b/dist/marketing/Cta.js +@@ -25,6 +25,6 @@ export { Cta }; + /** The sentence's own type, which gui's Text would otherwise replace with its + * body size. */ + const WORD = { fontFamily: 'inherit', fontSize: 'inherit', fontWeight: 'inherit', lineHeight: 'inherit', letterSpacing: 'inherit' }; +-const TextLink = ({ href, children, ...p }) => href !== undefined ? (_jsx(Anchor, { ...slot('text-link'), href: href, ...WORD, color: "$ink", textDecorationLine: "underline", style: { textUnderlineOffset: 3 }, ...p, children: children })) : (_jsx(Text, { ...slot('text-link'), render: _jsx("button", { type: "button" }), p: 0, borderWidth: 0, bg: "transparent", ...WORD, color: "$ink", textDecorationLine: "underline", cursor: "pointer", style: { textUnderlineOffset: 3 }, ...p, children: children })); ++const TextLink = ({ href, children, ...p }) => href !== undefined ? (_jsx(Anchor, { ...slot('text-link'), href: href, ...WORD, color: "$ink", textDecorationLine: "none", hoverStyle: { textDecorationLine: "none", opacity: 0.85 }, ...p, children: children })) : (_jsx(Text, { ...slot('text-link'), render: _jsx("button", { type: "button" }), p: 0, borderWidth: 0, bg: "transparent", ...WORD, color: "$ink", textDecorationLine: "none", hoverStyle: { textDecorationLine: "none", opacity: 0.85 }, cursor: "pointer", ...p, children: children })); + export { TextLink }; + //# sourceMappingURL=Cta.js.map +\ No newline at end of file +diff --git a/dist/models/research.cjs b/dist/models/research.cjs +index 8611481..1cc2adb 100644 +--- a/dist/models/research.cjs ++++ b/dist/models/research.cjs +@@ -27,6 +27,5 @@ exports.RESEARCH = [ + ]; + /** The catalog with the research models it does not already list, appended. */ + function withResearch(models) { +- const ids = new Set(models.map((m) => m.id)); +- return [...models, ...exports.RESEARCH.filter((m) => !ids.has(m.id))]; ++ return [...models]; + } +diff --git a/dist/models/research.js b/dist/models/research.js +index 65008c6..920f1ac 100644 +--- a/dist/models/research.js ++++ b/dist/models/research.js +@@ -23,7 +23,6 @@ export const RESEARCH = [ + ]; + /** The catalog with the research models it does not already list, appended. */ + export function withResearch(models) { +- const ids = new Set(models.map((m) => m.id)); +- return [...models, ...RESEARCH.filter((m) => !ids.has(m.id))]; ++ return [...models]; + } + //# sourceMappingURL=research.js.map +\ No newline at end of file +diff --git a/dist/onboarding/api.cjs b/dist/onboarding/api.cjs +index ce63950..6f61dbb 100644 +--- a/dist/onboarding/api.cjs ++++ b/dist/onboarding/api.cjs +@@ -60,7 +60,7 @@ async function call(base, path, init = {}, explicitToken) { + const res = await fetch(`${base}${path}`, { + ...init, + cache: 'no-store', +- credentials: 'include', ++ credentials: init.credentials ?? (!token && (!base || (typeof window !== 'undefined' && (base === window.location.origin || /^(hanzo\.id|(?:iam|id)\.hanzo\.ai)$/.test(window.location.hostname)))) ? 'include' : 'omit'), + headers: { + 'Content-Type': 'application/json', + ...(token ? { Authorization: `Bearer ${token}` } : {}), +diff --git a/dist/onboarding/api.js b/dist/onboarding/api.js +index b3b9d5d..52de30d 100644 +--- a/dist/onboarding/api.js ++++ b/dist/onboarding/api.js +@@ -54,7 +54,7 @@ export async function call(base, path, init = {}, explicitToken) { + const res = await fetch(`${base}${path}`, { + ...init, + cache: 'no-store', +- credentials: 'include', ++ credentials: init.credentials ?? (!token && (!base || (typeof window !== 'undefined' && (base === window.location.origin || /^(hanzo\.id|(?:iam|id)\.hanzo\.ai)$/.test(window.location.hostname)))) ? 'include' : 'omit'), + headers: { + 'Content-Type': 'application/json', + ...(token ? { Authorization: `Bearer ${token}` } : {}), +diff --git a/dist/product/UsageMeter.cjs b/dist/product/UsageMeter.cjs +index d9b4929..b640a0b 100644 +--- a/dist/product/UsageMeter.cjs ++++ b/dist/product/UsageMeter.cjs +@@ -18,7 +18,13 @@ const limits_1 = require("./limits.cjs"); + /** The status rung each state paints its bar in. */ + exports.STATE_COLOR = { ok: '$good', near: '$yellow10', limited: '$bad' }; + /** What a class row says under its bar about who pays now. */ +-function caption(c) { ++function caption(c, cls, plan) { ++ if (plan === 'enterprise' && c.state !== 'limited') { ++ if (cls === 'ours') ++ return (0, i18n_1.phrase)('Included in Enterprise'); ++ if (cls === 'premium') ++ return (0, i18n_1.phrase)('Pre-paid · requires top-up'); ++ } + if (c.paying === 'credits') + return (0, i18n_1.phrase)('Paying from credits'); + if (c.state === 'limited' && (c.paying === 'none' || c.paying === 'free')) +@@ -44,7 +50,7 @@ function UsageMeter({ limits, classes = limits_1.CLASSES, size = 'md', now }) { + return ((0, jsx_runtime_1.jsx)(gui_1.YStack, { gap: sm ? '$2.5' : '$5', width: "100%", minW: 0, ...(0, slot_1.slot)('usage-meter'), children: rows.map(({ c, k }) => { + const label = (0, limits_1.classesLabel)([c], t); + const resets = (0, limits_1.when)(k.resets_at, now); +- const note = caption(k); ++ const note = caption(k, c, limits.plan); + return ((0, jsx_runtime_1.jsxs)(gui_1.YStack, { gap: sm ? '$1.5' : '$2', minW: 0, "data-class": c, "data-state": k.state, ...(0, slot_1.slot)('usage-meter-row'), children: [(0, jsx_runtime_1.jsxs)(gui_1.XStack, { justify: "space-between", items: "baseline", gap: "$3", minW: 0, children: [(0, jsx_runtime_1.jsx)(gui_1.Text, { fontSize: sm ? '$2' : '$3', color: "$ink", fontWeight: "500", numberOfLines: 1, children: label }), (0, jsx_runtime_1.jsx)(gui_1.Text, { fontSize: sm ? '$2' : '$3', color: "$ink", fontVariant: ['tabular-nums'], shrink: 0, children: t('{percent}% used', { percent: k.percent }) })] }), (0, jsx_runtime_1.jsx)(progress_1.Progress, { value: k.percent, height: sm ? 4 : 8, minW: 0, indicatorColor: exports.STATE_COLOR[k.state], "aria-label": t('{label}: {percent}% used', { label, percent: k.percent }) }), resets || note ? ((0, jsx_runtime_1.jsxs)(gui_1.XStack, { justify: "space-between", gap: "$3", flexWrap: "wrap", minW: 0, children: [(0, jsx_runtime_1.jsx)(gui_1.Text, { fontSize: sm ? '$1' : '$2', color: "$soft", children: resets ? t('Resets {until}', { until: resets }) : '' }), note ? ((0, jsx_runtime_1.jsx)(gui_1.Text, { fontSize: sm ? '$1' : '$2', color: k.state === 'limited' ? '$bad' : '$soft', children: t(note) })) : null] })) : null, k.window ? (0, jsx_runtime_1.jsx)(Session, { label: label, w: k.window, now: now }) : null] }, c)); + }) })); + } +diff --git a/dist/product/UsageMeter.js b/dist/product/UsageMeter.js +index 6d94802..78e8e8e 100644 +--- a/dist/product/UsageMeter.js ++++ b/dist/product/UsageMeter.js +@@ -14,7 +14,13 @@ import { CLASSES, classesLabel, when } from './limits.js'; + /** The status rung each state paints its bar in. */ + export const STATE_COLOR = { ok: '$good', near: '$yellow10', limited: '$bad' }; + /** What a class row says under its bar about who pays now. */ +-function caption(c) { ++function caption(c, cls, plan) { ++ if (plan === 'enterprise' && c.state !== 'limited') { ++ if (cls === 'ours') ++ return phrase('Included in Enterprise'); ++ if (cls === 'premium') ++ return phrase('Pre-paid · requires top-up'); ++ } + if (c.paying === 'credits') + return phrase('Paying from credits'); + if (c.state === 'limited' && (c.paying === 'none' || c.paying === 'free')) +@@ -40,7 +46,7 @@ export function UsageMeter({ limits, classes = CLASSES, size = 'md', now }) { + return (_jsx(YStack, { gap: sm ? '$2.5' : '$5', width: "100%", minW: 0, ...slot('usage-meter'), children: rows.map(({ c, k }) => { + const label = classesLabel([c], t); + const resets = when(k.resets_at, now); +- const note = caption(k); ++ const note = caption(k, c, limits.plan); + return (_jsxs(YStack, { gap: sm ? '$1.5' : '$2', minW: 0, "data-class": c, "data-state": k.state, ...slot('usage-meter-row'), children: [_jsxs(XStack, { justify: "space-between", items: "baseline", gap: "$3", minW: 0, children: [_jsx(Text, { fontSize: sm ? '$2' : '$3', color: "$ink", fontWeight: "500", numberOfLines: 1, children: label }), _jsx(Text, { fontSize: sm ? '$2' : '$3', color: "$ink", fontVariant: ['tabular-nums'], shrink: 0, children: t('{percent}% used', { percent: k.percent }) })] }), _jsx(Progress, { value: k.percent, height: sm ? 4 : 8, minW: 0, indicatorColor: STATE_COLOR[k.state], "aria-label": t('{label}: {percent}% used', { label, percent: k.percent }) }), resets || note ? (_jsxs(XStack, { justify: "space-between", gap: "$3", flexWrap: "wrap", minW: 0, children: [_jsx(Text, { fontSize: sm ? '$1' : '$2', color: "$soft", children: resets ? t('Resets {until}', { until: resets }) : '' }), note ? (_jsx(Text, { fontSize: sm ? '$1' : '$2', color: k.state === 'limited' ? '$bad' : '$soft', children: t(note) })) : null] })) : null, k.window ? _jsx(Session, { label: label, w: k.window, now: now }) : null] }, c)); + }) })); + } +diff --git a/dist/product/limits.cjs b/dist/product/limits.cjs +index f130669..847bc03 100644 +--- a/dist/product/limits.cjs ++++ b/dist/product/limits.cjs +@@ -27,14 +27,14 @@ const english_1 = require("../core/english.cjs"); + /** The actions that are pages a browser can simply open. */ + const navigable = (a) => (a.kind === 'upgrade' || a.kind === 'topup') && Boolean(a.url); + exports.navigable = navigable; +-exports.CLASSES = ['premium', 'ours', 'free']; ++exports.CLASSES = ['ours', 'premium', 'free']; + exports.CLASS_LABEL = { +- premium: 'Premium models', ++ premium: 'Third-party models', + ours: 'Hanzo models', + free: 'Free models', + }; + /** A class's name inside a list ("Premium and Hanzo models"). Hanzo is a name. */ +-const className = (c, t) => (c === 'premium' ? t('Premium') : c === 'ours' ? 'Hanzo' : t('Free')); ++const className = (c, t) => (c === 'premium' ? t('Third-party') : c === 'ours' ? 'Hanzo' : t('Free')); + const STATES = ['ok', 'near', 'limited']; + const PAYERS = ['plan', 'credits', 'free', 'none']; + const KINDS = ['upgrade', 'topup', 'credits', 'switch']; +@@ -129,7 +129,10 @@ function limitsOf(body) { + const classes = {}; + const raw = record(o?.classes); + for (const c of exports.CLASSES) { +- const got = classOfBody(raw?.[c]); ++ let got = classOfBody(raw?.[c]); ++ if (got && plan === 'enterprise' && got.paying === 'credits' && got.state !== 'limited') { ++ got = { ...got, percent: 0, state: 'ok' }; ++ } + if (got) + classes[c] = got; + } +@@ -333,9 +336,9 @@ function nearOf(limits, now = Date.now(), t = english_1.english) { + const until = when(earliest(near.map((c) => resetOf(limits.classes[c]))), now); + // Only premium and Hanzo models are ever near (the free lane is not counted). + const close = near.length > 1 +- ? t("You're close to your plan's included premium and Hanzo model usage.") ++ ? t("You're close to your plan's included third-party and Hanzo model usage.") + : near[0] === 'premium' +- ? t("You're close to your plan's included premium model usage.") ++ ? t("You're close to your plan's included third-party model usage.") + : t("You're close to your plan's included Hanzo model usage."); + return until ? `${close} ${t('Resets {until}.', { until })}` : close; + } +diff --git a/dist/product/limits.js b/dist/product/limits.js +index 1b20acc..100ae36 100644 +--- a/dist/product/limits.js ++++ b/dist/product/limits.js +@@ -14,14 +14,14 @@ + import { english } from '../core/english.js'; + /** The actions that are pages a browser can simply open. */ + export const navigable = (a) => (a.kind === 'upgrade' || a.kind === 'topup') && Boolean(a.url); +-export const CLASSES = ['premium', 'ours', 'free']; ++export const CLASSES = ['ours', 'premium', 'free']; + export const CLASS_LABEL = { +- premium: 'Premium models', ++ premium: 'Third-party models', + ours: 'Hanzo models', + free: 'Free models', + }; + /** A class's name inside a list ("Premium and Hanzo models"). Hanzo is a name. */ +-const className = (c, t) => (c === 'premium' ? t('Premium') : c === 'ours' ? 'Hanzo' : t('Free')); ++const className = (c, t) => (c === 'premium' ? t('Third-party') : c === 'ours' ? 'Hanzo' : t('Free')); + const STATES = ['ok', 'near', 'limited']; + const PAYERS = ['plan', 'credits', 'free', 'none']; + const KINDS = ['upgrade', 'topup', 'credits', 'switch']; +@@ -114,7 +114,10 @@ export function limitsOf(body) { + const classes = {}; + const raw = record(o?.classes); + for (const c of CLASSES) { +- const got = classOfBody(raw?.[c]); ++ let got = classOfBody(raw?.[c]); ++ if (got && plan === 'enterprise' && got.paying === 'credits' && got.state !== 'limited') { ++ got = { ...got, percent: 0, state: 'ok' }; ++ } + if (got) + classes[c] = got; + } +@@ -318,9 +321,9 @@ export function nearOf(limits, now = Date.now(), t = english) { + const until = when(earliest(near.map((c) => resetOf(limits.classes[c]))), now); + // Only premium and Hanzo models are ever near (the free lane is not counted). + const close = near.length > 1 +- ? t("You're close to your plan's included premium and Hanzo model usage.") ++ ? t("You're close to your plan's included third-party and Hanzo model usage.") + : near[0] === 'premium' +- ? t("You're close to your plan's included premium model usage.") ++ ? t("You're close to your plan's included third-party model usage.") + : t("You're close to your plan's included Hanzo model usage."); + return until ? `${close} ${t('Resets {until}.', { until })}` : close; + } diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index cefb0448..0a0de819 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -7,20 +7,17 @@ settings: catalogs: default: '@hanzo/ai': - specifier: 0.6.24 - version: 0.6.24 + specifier: 0.7.0 + version: 0.7.0 '@hanzo/app': - specifier: https://registry.npmjs.org/@hanzo/app/-/app-0.2.63.tgz - version: 0.2.63 - '@hanzo/appearance': - specifier: 0.2.13 - version: 0.2.13 + specifier: 0.3.107 + version: 0.3.107 '@hanzo/brand': specifier: 1.4.8 version: 1.4.8 '@hanzo/build': - specifier: 0.2.99 - version: 0.2.99 + specifier: 0.2.130 + version: 0.2.130 '@hanzo/composer': specifier: 0.2.1 version: 0.2.1 @@ -30,6 +27,9 @@ catalogs: '@hanzo/font': specifier: 1.9.3 version: 1.9.3 + '@hanzo/i18n': + specifier: 0.6.1 + version: 0.6.1 '@hanzo/logo': specifier: 1.0.26 version: 1.0.26 @@ -42,12 +42,9 @@ catalogs: '@hanzo/plans': specifier: 1.8.17 version: 1.8.17 - '@hanzo/studio': - specifier: 0.1.8 - version: 0.1.8 '@hanzo/tabs': - specifier: 0.1.7 - version: 0.1.7 + specifier: github:hanzo-inc/tabs#26a30cbc5fac232e5b11d5d77939f9573ca0c8d8 + version: 0.1.17 '@hanzo/usage': specifier: 0.1.18 version: 0.1.18 @@ -513,10 +510,12 @@ catalogs: overrides: '@hanzo/gui': 8.3.5 - '@hanzo/ui': 8.29.45 - '@hanzo/event': 0.3.66 - '@hanzo/design': 0.5.38 - '@hanzo/iam': 0.21.41 + '@hanzo/ui': 8.33.6 + '@hanzo/event': 0.3.69 + '@hanzo/design': 0.5.44 + '@hanzo/iam': 0.21.42 + '@hanzo/appearance': 0.2.15 + '@hanzo/studio': 0.1.15 '@noble/hashes': 1.8.0 zod: ^4.5.2 react-reconciler: ^0.33.0 @@ -557,9 +556,9 @@ overrides: yaml@2: '>=2.8.3' patchedDependencies: - '@hanzo/app@0.2.63': 334fbf01e48da282ada010622855afffe9ecc799639c3df073752176a2519ef3 - '@hanzo/build@0.2.99': a08c7ba528738d86a39a8a9b82ee1dbb385f6992f87265da8b436aed35359c99 - '@hanzo/studio@0.1.8': 817ae0169a4e5838aae68d3566da0daf75627679b5bad66049bb0fe88af97f0a + '@hanzo/app@0.3.107': 41f954969de2f19b30930730b65d95fdc8fdf9ca7d93ab77080f7e4d46354015 + '@hanzo/studio@0.1.15': 817ae0169a4e5838aae68d3566da0daf75627679b5bad66049bb0fe88af97f0a + '@hanzo/ui@8.33.6': 27de2b4513cb844e2ce60f1dd0977b32f388e070e726fd44f68985bc6cb9f293 '@hanzogui/shell@8.4.3': bc6bb68834f778be4185df3076fce2a9ebe0ca820c582d4ef7226023abc8941d importers: @@ -568,19 +567,19 @@ importers: dependencies: '@hanzo/ai': specifier: 'catalog:' - version: 0.6.24(react@19.2.8) + version: 0.7.0(react@19.2.8) '@hanzo/app': specifier: 'catalog:' - version: https://registry.npmjs.org/@hanzo/app/-/app-0.2.63.tgz(patch_hash=334fbf01e48da282ada010622855afffe9ecc799639c3df073752176a2519ef3)(6d4bd7ed8883fd3b6d652b90987357c5) + version: 0.3.107(patch_hash=41f954969de2f19b30930730b65d95fdc8fdf9ca7d93ab77080f7e4d46354015)(92ea3567ad612d781812d55490366b9b) '@hanzo/appearance': - specifier: 'catalog:' - version: 0.2.13(react@19.2.8) + specifier: 0.2.15 + version: 0.2.15(react@19.2.8) '@hanzo/brand': specifier: 'catalog:' version: 1.4.8(react@19.2.8) '@hanzo/build': specifier: 'catalog:' - version: 0.2.99(patch_hash=a08c7ba528738d86a39a8a9b82ee1dbb385f6992f87265da8b436aed35359c99)(@hanzo/composer@0.2.1(@hanzo/gui@8.3.5(@hanzogui/react-native-web-lite@8.3.5(react-dom@19.2.8(react@19.2.8))(react@19.2.8))(react-dom@19.2.8(react@19.2.8))(react@19.2.8))(react@19.2.8))(@hanzo/gui@8.3.5(@hanzogui/react-native-web-lite@8.3.5(react-dom@19.2.8(react@19.2.8))(react@19.2.8))(react-dom@19.2.8(react@19.2.8))(react@19.2.8))(@hanzo/i18n@0.5.4(react@19.2.8))(@hanzo/ui@8.29.45(7447157379aed6ea6a1cd99f09a3454a))(@hanzo/voice@0.1.19(react@19.2.8))(@hanzogui/lucide-icons-2@8.3.5(react-dom@19.2.8(react@19.2.8))(react-native-svg@15.15.5(@hanzogui/react-native-web-lite@8.3.5(react-dom@19.2.8(react@19.2.8))(react@19.2.8))(react@19.2.8))(react@19.2.8))(react@19.2.8) + version: 0.2.130(@hanzo/composer@0.2.1(@hanzo/gui@8.3.5(@hanzogui/react-native-web-lite@8.3.5(react-dom@19.2.8(react@19.2.8))(react@19.2.8))(react-dom@19.2.8(react@19.2.8))(react@19.2.8))(react@19.2.8))(@hanzo/gui@8.3.5(@hanzogui/react-native-web-lite@8.3.5(react-dom@19.2.8(react@19.2.8))(react@19.2.8))(react-dom@19.2.8(react@19.2.8))(react@19.2.8))(@hanzo/i18n@0.6.1(react@19.2.8))(@hanzo/ui@8.33.6(patch_hash=27de2b4513cb844e2ce60f1dd0977b32f388e070e726fd44f68985bc6cb9f293)(41142f5e92d2ce7242c2bcfed8ee29c8))(@hanzo/voice@0.1.19(react@19.2.8))(@hanzogui/lucide-icons-2@8.3.5(react-dom@19.2.8(react@19.2.8))(react-native-svg@15.15.5(@hanzogui/react-native-web-lite@8.3.5(react-dom@19.2.8(react@19.2.8))(react@19.2.8))(react@19.2.8))(react@19.2.8))(react@19.2.8) '@hanzo/composer': specifier: 'catalog:' version: 0.2.1(@hanzo/gui@8.3.5(@hanzogui/react-native-web-lite@8.3.5(react-dom@19.2.8(react@19.2.8))(react@19.2.8))(react-dom@19.2.8(react@19.2.8))(react@19.2.8))(react@19.2.8) @@ -588,20 +587,23 @@ importers: specifier: 'catalog:' version: 1.2.4(@hanzo/gui@8.3.5(@hanzogui/react-native-web-lite@8.3.5(react-dom@19.2.8(react@19.2.8))(react@19.2.8))(react-dom@19.2.8(react@19.2.8))(react@19.2.8))(react-dom@19.2.8(react@19.2.8))(react-native-svg@15.15.5(@hanzogui/react-native-web-lite@8.3.5(react-dom@19.2.8(react@19.2.8))(react@19.2.8))(react@19.2.8))(react@19.2.8) '@hanzo/design': - specifier: 0.5.38 - version: 0.5.38 + specifier: 0.5.44 + version: 0.5.44 '@hanzo/event': - specifier: 0.3.66 - version: 0.3.66(react@19.2.8) + specifier: 0.3.69 + version: 0.3.69(react@19.2.8) '@hanzo/font': specifier: 'catalog:' version: 1.9.3(next@16.3.4(@babel/core@7.29.7(supports-color@8.1.1))(@playwright/test@1.63.0)(@types/node@26.4.0)(babel-plugin-react-compiler@1.0.0)(react-dom@19.2.8(react@19.2.8))(react@19.2.8)) '@hanzo/gui': specifier: 8.3.5 version: 8.3.5(@hanzogui/react-native-web-lite@8.3.5(react-dom@19.2.8(react@19.2.8))(react@19.2.8))(react-dom@19.2.8(react@19.2.8))(react@19.2.8) + '@hanzo/i18n': + specifier: 'catalog:' + version: 0.6.1(react@19.2.8) '@hanzo/iam': - specifier: 0.21.41 - version: 0.21.41(react-dom@19.2.8(react@19.2.8))(react@19.2.8) + specifier: 0.21.42 + version: 0.21.42(react-dom@19.2.8(react@19.2.8))(react@19.2.8) '@hanzo/logo': specifier: 'catalog:' version: 1.0.26(react@19.2.8) @@ -615,14 +617,14 @@ importers: specifier: 'catalog:' version: 1.8.17 '@hanzo/studio': - specifier: 'catalog:' - version: 0.1.8(patch_hash=817ae0169a4e5838aae68d3566da0daf75627679b5bad66049bb0fe88af97f0a)(17e09baef92b467ff94f7e2ead4a9806) + specifier: 0.1.15 + version: 0.1.15(patch_hash=817ae0169a4e5838aae68d3566da0daf75627679b5bad66049bb0fe88af97f0a)(cbc9a839ece463321676e5e12686ebf6) '@hanzo/tabs': specifier: 'catalog:' - version: 0.1.7(@hanzo/gui@8.3.5(@hanzogui/react-native-web-lite@8.3.5(react-dom@19.2.8(react@19.2.8))(react@19.2.8))(react-dom@19.2.8(react@19.2.8))(react@19.2.8))(@hanzo/ui@8.29.45(7447157379aed6ea6a1cd99f09a3454a))(lucide-react@1.44.0(react@19.2.8))(react-dom@19.2.8(react@19.2.8))(react@19.2.8) + version: https://codeload.github.com/hanzo-inc/tabs/tar.gz/26a30cbc5fac232e5b11d5d77939f9573ca0c8d8(@hanzo/gui@8.3.5(@hanzogui/react-native-web-lite@8.3.5(react-dom@19.2.8(react@19.2.8))(react@19.2.8))(react-dom@19.2.8(react@19.2.8))(react@19.2.8))(@hanzo/ui@8.33.6(patch_hash=27de2b4513cb844e2ce60f1dd0977b32f388e070e726fd44f68985bc6cb9f293)(41142f5e92d2ce7242c2bcfed8ee29c8))(lucide-react@1.44.0(react@19.2.8))(react-dom@19.2.8(react@19.2.8))(react@19.2.8) '@hanzo/ui': - specifier: 8.29.45 - version: 8.29.45(7447157379aed6ea6a1cd99f09a3454a) + specifier: 8.33.6 + version: 8.33.6(patch_hash=27de2b4513cb844e2ce60f1dd0977b32f388e070e726fd44f68985bc6cb9f293)(41142f5e92d2ce7242c2bcfed8ee29c8) '@hanzo/usage': specifier: 'catalog:' version: 0.1.18(@hanzo/gui@8.3.5(@hanzogui/react-native-web-lite@8.3.5(react-dom@19.2.8(react@19.2.8))(react@19.2.8))(react-dom@19.2.8(react@19.2.8))(react@19.2.8))(@hanzogui/lucide-icons-2@8.3.5(react-dom@19.2.8(react@19.2.8))(react-native-svg@15.15.5(@hanzogui/react-native-web-lite@8.3.5(react-dom@19.2.8(react@19.2.8))(react@19.2.8))(react@19.2.8))(react@19.2.8))(react@19.2.8) @@ -649,7 +651,7 @@ importers: version: 8.3.5(react-dom@19.2.8(react@19.2.8))(react@19.2.8) '@hanzogui/shell': specifier: 'catalog:' - version: 8.4.3(patch_hash=bc6bb68834f778be4185df3076fce2a9ebe0ca820c582d4ef7226023abc8941d)(@hanzo/i18n@0.5.4(react@19.2.8))(react-dom@19.2.8(react@19.2.8))(react@19.2.8) + version: 8.4.3(patch_hash=bc6bb68834f778be4185df3076fce2a9ebe0ca820c582d4ef7226023abc8941d)(@hanzo/i18n@0.6.1(react@19.2.8))(react-dom@19.2.8(react@19.2.8))(react@19.2.8) '@hanzogui/web': specifier: 'catalog:' version: 8.3.5(react-dom@19.2.8(react@19.2.8))(react@19.2.8) @@ -1775,8 +1777,8 @@ packages: '@floating-ui/utils@0.2.12': resolution: {integrity: sha512-HpCo8tmWzLVad5s2d19EhAz5zqrrQ6s69qd6moPMQvkOuSwDT1YgRfWSVuc4ennqrgv3OHppiOGMQ7oC13yIww==} - '@hanzo/ai@0.6.24': - resolution: {integrity: sha512-n3STS1OYGRoclCTxVdqPpIMuAK8VbbTUNDXbhlDtn8rtGePwFK5V/24TOO9XrJ+vf/mCwkVWKOXdRyNN7xEKcw==} + '@hanzo/ai@0.7.0': + resolution: {integrity: sha512-5TvRXMb5GTNGn9dH31vxFEkQaxOr4h3UZDi5PWkkO1XioB8IA1KZE5eb8EovMlxgAfDHJWWjsxUPMLOh8b6QmQ==} engines: {node: '>=18'} peerDependencies: react: '>=19.2.8' @@ -1784,23 +1786,23 @@ packages: react: optional: true - '@hanzo/app@https://registry.npmjs.org/@hanzo/app/-/app-0.2.63.tgz': - resolution: {integrity: sha512-kBl9+LfSKVpyqoFkaAk79b9F2e+Wa9dLqI6mKz9REJ58rVhF+EIy+7vEoHhIq7zURAa+pkSeH526rFwyT0RD0A==, tarball: https://registry.npmjs.org/@hanzo/app/-/app-0.2.63.tgz} - version: 0.2.63 + '@hanzo/app@0.3.107': + resolution: {integrity: sha512-Wqq3MekzJglmM3mP+b0NsvZwszwDQX9s1i3NGaN4htdkaymL7fS0dEEInqx31KkEtKPlV4hT7ZbCbhunwNScXQ==} engines: {node: '>=22.18'} peerDependencies: - '@hanzo/ai': '>=0.6.23' - '@hanzo/appearance': '>=0.2.12' - '@hanzo/build': '>=0.2.84' + '@hanzo/ai': '>=0.7.0' + '@hanzo/appearance': 0.2.15 + '@hanzo/build': '>=0.2.129' '@hanzo/composer': '>=0.2.0' - '@hanzo/event': 0.3.66 + '@hanzo/design': 0.5.44 + '@hanzo/event': 0.3.69 '@hanzo/gui': 8.3.5 - '@hanzo/i18n': '>=0.4.0' - '@hanzo/iam': 0.21.41 + '@hanzo/i18n': '>=0.5.5' + '@hanzo/iam': 0.21.42 '@hanzo/logo': '>=1.0.26' - '@hanzo/studio': '>=0.1.0' + '@hanzo/studio': 0.1.15 '@hanzo/tabs': '>=0.1.8' - '@hanzo/ui': 8.29.45 + '@hanzo/ui': 8.33.6 '@hanzo/usage': '>=0.1.18' '@hanzo/voice': '>=0.1.16' '@hanzogui/shell': ^8.3.20 @@ -1811,8 +1813,8 @@ packages: '@hanzo/tabs': optional: true - '@hanzo/appearance@0.2.13': - resolution: {integrity: sha512-8xg9yuH5dFyWcJBkTZdl8UkkyBGgEOH+jUddpGpZlJHV9FSPpUCttfPubrWXr4FmHF3t7SB3FzX2cWxrDLhw5A==} + '@hanzo/appearance@0.2.15': + resolution: {integrity: sha512-a3f6MfLkpnhJMteWkerdtHzevzF/ijzhI9iy/GUQ9GfxtzDg6eNMGn+ZVpW8AuRSP2LYTgwXmsx9c/MVZxyqsQ==} peerDependencies: react: '>=19.2.8' @@ -1825,14 +1827,14 @@ packages: react: optional: true - '@hanzo/build@0.2.99': - resolution: {integrity: sha512-V51fb0FC23UNn2hCII5W8/tx7ULgrl1+399oZWInBPWvAkiddgsR2bgQMuv99gWYADrkNUtghPwInaRVw1unhA==} + '@hanzo/build@0.2.130': + resolution: {integrity: sha512-UvxSyObJ302VGgHVjeJxFzO2HJuG0R1OYbxDb7f89al/lAz182m+nWiZpS05JxyVfPegdn2lwiX+147D+Gn7bg==} engines: {node: '>=22.18'} peerDependencies: '@hanzo/composer': '>=0.2.0' '@hanzo/gui': 8.3.5 - '@hanzo/i18n': '>=0.4.0' - '@hanzo/ui': 8.29.45 + '@hanzo/i18n': '>=0.5.5' + '@hanzo/ui': 8.33.6 '@hanzo/voice': '>=0.1.19' '@hanzogui/lucide-icons-2': '>=8.3.5' react: '>=19.2.8' @@ -1849,20 +1851,20 @@ packages: '@hanzo/gui': 8.3.5 react: '>=19' - '@hanzo/design@0.5.38': - resolution: {integrity: sha512-CNGAkwN4BYKaIf852uJ5KDFh8wF08SIQvEUEQ3v4/zQso9jRSCRv3RF6iLwRADZfWGQcIjS9OUJUCX0/mX/nUg==} + '@hanzo/design@0.5.44': + resolution: {integrity: sha512-XsQaR3ePVv5KqGRoRyM/s4fYn/kfIGFYJCxHGQJ8hpvKd0/6Pkm1DnR1yVXrLnjKgUGd3sDYPjqrYixj/H0nKQ==} hasBin: true - '@hanzo/event@0.3.66': - resolution: {integrity: sha512-trBYhxs103HDBgR3lV4Jp9cwWizcsd7s4GX7hdKmiR9cIXtTsKipu/E93+rZrAYJ7BHSpRqXnHL7KomNwvrrEA==} + '@hanzo/event@0.3.69': + resolution: {integrity: sha512-M85xTYkCbYlXN01/8ddnyO/u/uQztLdNpoo6AVqmk4sogn83QH8SEKllBu+GfD79SPKtNdZcV1wmQDYIwMbgmA==} peerDependencies: react: '>=19.2.8' peerDependenciesMeta: react: optional: true - '@hanzo/events@0.3.2': - resolution: {integrity: sha512-2MIY5Yw6tCrJyz2DR6wlsTq9H7ibL/671yXvnmYWIXFNLWKxrBwhZyQRJ/S6NiR8gIdYGQ3zO01tv1jYiQ+95g==} + '@hanzo/events@0.3.4': + resolution: {integrity: sha512-pW+dHXJIDbUnP3F9En+LhR9IACBDT49etvK4pD9RQQcGR+wbszzUSRwi+8kjFgqL9YfNKZ4Uk/XPZWxksZdP5Q==} '@hanzo/font@1.9.2': resolution: {integrity: sha512-CXKXhfRgAj9SnhRJtraS6jEToGz74hbrMSJm85Kp8y6uN64zOH+IvohpWT/Surh9Qn1KWIGXsIx216JMa++X6A==} @@ -1874,9 +1876,10 @@ packages: peerDependencies: next: '>=13.2.0' - '@hanzo/glass@0.1.0': - resolution: {integrity: sha512-dPTISvpanjX1k9zSiJIP67pz+mLN5FqtgpxNXybiVfl4KQoKCA07hIP5yKlICuMM+qklVC34jNdv1OZpKC9Vpw==} + '@hanzo/glass@0.1.1': + resolution: {integrity: sha512-rfqhfSm9PZNbU+BFChtTybW08c9wcuGw8GVs0iOoDD8Qvkhlxl2A9Bvyb+mlnwHGK78iBoybP6PqHEg65wqNSw==} peerDependencies: + '@hanzo/gui': 8.3.5 react: '>=19.0.0' '@hanzo/gui@8.3.5': @@ -1885,16 +1888,16 @@ packages: peerDependencies: react: '>=19.2.8' - '@hanzo/i18n@0.5.4': - resolution: {integrity: sha512-g5QY0u2q7PMSbp+yk7EZRQWdj0b87fh9m8QH1oVxsHUS0EbeCh1jyE10ZefWnPChxraZN+HgokTMdX+nx3sl+A==} + '@hanzo/i18n@0.6.1': + resolution: {integrity: sha512-SVtAG7dbVYitgms9EOv0UC9uFuVogcjvK3fSh6U8TBukFAkJ41u6tYoex2+3sMMm8J+M2Bfvsy+5X7mO3fihQg==} peerDependencies: react: '>=18' peerDependenciesMeta: react: optional: true - '@hanzo/iam@0.21.41': - resolution: {integrity: sha512-x1+g6jXL9gCIk7znT38X1eiTfayGwS4TjauVOQyUfRYEMqyD2IGVl5wOg8gmvXBnmBb1Y0Vr2wif5p5mfWpErw==} + '@hanzo/iam@0.21.42': + resolution: {integrity: sha512-UT8PJltMzlYOvyJ/05fdpnGoZydpMa0veaTXKD1d9V+qMs8p88ZCKVe/TmZri3TMi4zrR5RTbljXHGACAxTfRg==} engines: {node: '>=18'} peerDependencies: react: '>=17' @@ -1921,8 +1924,8 @@ packages: react: optional: true - '@hanzo/mod@0.1.0': - resolution: {integrity: sha512-nvh+pZkfxq1/vT+7SrxL+rOpMRnnFLnsKgydDOASQSGcgcNEPtOm1meF5okw1bTa5i7NM/QCwErzR0FsfGEKGQ==} + '@hanzo/mod@0.1.2': + resolution: {integrity: sha512-3rxenHhh2ZVZfh35rLp3hy64c4+SPC29q4YsHHMIwQopb6QMiJ4EIE7vy575Wdp6aiU1zkQ0zWGoQnNtaqH7dQ==} peerDependencies: react: '>=19.0.0' @@ -1945,6 +1948,9 @@ packages: '@hanzo/personas@1.0.5': resolution: {integrity: sha512-GQPgJy4gnDyVSFDMojiBLBZtS62dljV44U8/uYmcnsGN+uKVMgm+0QZqxsrU/Uxw/s0BSLahYMnOWSCkGOasxg==} + '@hanzo/personas@1.3.3': + resolution: {integrity: sha512-1W4qeozx5hiHpMzxM9QT+zR95LryIxLJpwnR3o0fVGpita0XpzzbEiLhWmbMfDMtWf1fKyuqbPLcxUEzoM14hQ==} + '@hanzo/plans@1.8.17': resolution: {integrity: sha512-gMJZzeHTsfvQOn6/s8NIMvhlacKWH1TA4taFEOYZz3xlfhw+TRYy3srL7UetMr2rGR1bRLlU7LzUpfpw/ZBtrA==} @@ -1959,43 +1965,44 @@ packages: react: optional: true - '@hanzo/studio@0.1.8': - resolution: {integrity: sha512-9Vr+jzUJPcMR8flVl4oX8yXhqVZMRj/M+Y29BopxY6LXQVtnpEKMdNpWiJ6R99tLbb9SI8InIUg9gKX1G8NQag==} + '@hanzo/studio@0.1.15': + resolution: {integrity: sha512-KSglLJeC1OimlhU2CogBATR/4iaYNeCc3hVHcRqZ1b5T5soE9/LAjvcLUXpNdW0led7E8F673/5GzdDmmVm0Rw==} engines: {node: '>=22.18'} peerDependencies: '@hanzo/build': '>=0.2.85' '@hanzo/composer': '>=0.2.0' '@hanzo/gui': 8.3.5 '@hanzo/i18n': '>=0.4.0' - '@hanzo/ui': 8.29.45 + '@hanzo/ui': 8.33.6 '@hanzo/voice': '>=0.1.19' '@hanzogui/lucide-icons-2': '>=8.3.5' react: '>=19.2.8' - '@hanzo/tabs@0.1.7': - resolution: {integrity: sha512-s6B0Hldvieo/X4QtKZHH2HS3dLjcHCYhpQsFwmnm2d7/AF88UqOKZb6cv9UFYz3TgkLWRUNFZrg9VR6bKOlq/Q==} + '@hanzo/tabs@https://codeload.github.com/hanzo-inc/tabs/tar.gz/26a30cbc5fac232e5b11d5d77939f9573ca0c8d8': + resolution: {gitHosted: true, tarball: https://codeload.github.com/hanzo-inc/tabs/tar.gz/26a30cbc5fac232e5b11d5d77939f9573ca0c8d8} + version: 0.1.17 peerDependencies: '@hanzo/gui': 8.3.5 - '@hanzo/ui': 8.29.45 + '@hanzo/ui': 8.33.6 lucide-react: ^1.33.0 react: ^19.0.0 react-dom: ^19.0.0 - '@hanzo/tokens@1.1.1': - resolution: {integrity: sha512-T2kl+Rl0D7c3WdILc2RI3krPY23LBo78uWc93J7d6wKfI/B9Z9mw0CnY3FHmbN0hu2xyUs/AW8SoARPn3FOeHg==} + '@hanzo/tokens@1.1.3': + resolution: {integrity: sha512-X3qXyLZONyVzGXjXpY+H6079AOSJGIDWnMVyOnoe6N2+LndvsnvHdPR+J18D27274vfP2EqSVKwLLH8nVjgLQg==} - '@hanzo/ui@8.29.45': - resolution: {integrity: sha512-zeqRQgAAkWNrPc5ILH1hdZA+kmHjR3l51rBEW38zLrpBgg+5AGwNFff3dvD/0av9y0LzG09pKh55fAxZ5iMNwA==} + '@hanzo/ui@8.33.6': + resolution: {integrity: sha512-dv4hri8nTLXsp5Fb8ERyjb6DYkW4Zij4q9vvEBGvPN4pxKF/peJMTGc2R4b3detZ6A1ssK17Deot15VfqnXOog==} peerDependencies: '@hanzo/canvas': '>=0.2.3' '@hanzo/cd': '>=0.1.2' '@hanzo/composer': '>=0.2.0' '@hanzo/dashboard': '>=0.2.0' '@hanzo/data': '>=1.2.4' - '@hanzo/event': 0.3.66 + '@hanzo/event': 0.3.69 '@hanzo/gui': 8.3.5 '@hanzo/i18n': '>=0.4.0' - '@hanzo/iam': 0.21.41 + '@hanzo/iam': 0.21.42 '@hanzo/pay': '>=0.1.1' '@hanzo/plans': '>=1.8.1' '@hanzo/usage': '>=0.1.13' @@ -2019,6 +2026,8 @@ packages: optional: true '@hanzo/dashboard': optional: true + '@hanzo/i18n': + optional: true '@hanzo/iam': optional: true '@hanzo/pay': @@ -12604,40 +12613,41 @@ snapshots: '@floating-ui/utils@0.2.12': {} - '@hanzo/ai@0.6.24(react@19.2.8)': + '@hanzo/ai@0.7.0(react@19.2.8)': optionalDependencies: react: 19.2.8 - '@hanzo/app@https://registry.npmjs.org/@hanzo/app/-/app-0.2.63.tgz(patch_hash=334fbf01e48da282ada010622855afffe9ecc799639c3df073752176a2519ef3)(6d4bd7ed8883fd3b6d652b90987357c5)': + '@hanzo/app@0.3.107(patch_hash=41f954969de2f19b30930730b65d95fdc8fdf9ca7d93ab77080f7e4d46354015)(92ea3567ad612d781812d55490366b9b)': dependencies: - '@hanzo/ai': 0.6.24(react@19.2.8) - '@hanzo/appearance': 0.2.13(react@19.2.8) - '@hanzo/build': 0.2.99(patch_hash=a08c7ba528738d86a39a8a9b82ee1dbb385f6992f87265da8b436aed35359c99)(@hanzo/composer@0.2.1(@hanzo/gui@8.3.5(@hanzogui/react-native-web-lite@8.3.5(react-dom@19.2.8(react@19.2.8))(react@19.2.8))(react-dom@19.2.8(react@19.2.8))(react@19.2.8))(react@19.2.8))(@hanzo/gui@8.3.5(@hanzogui/react-native-web-lite@8.3.5(react-dom@19.2.8(react@19.2.8))(react@19.2.8))(react-dom@19.2.8(react@19.2.8))(react@19.2.8))(@hanzo/i18n@0.5.4(react@19.2.8))(@hanzo/ui@8.29.45(7447157379aed6ea6a1cd99f09a3454a))(@hanzo/voice@0.1.19(react@19.2.8))(@hanzogui/lucide-icons-2@8.3.5(react-dom@19.2.8(react@19.2.8))(react-native-svg@15.15.5(@hanzogui/react-native-web-lite@8.3.5(react-dom@19.2.8(react@19.2.8))(react@19.2.8))(react@19.2.8))(react@19.2.8))(react@19.2.8) + '@hanzo/ai': 0.7.0(react@19.2.8) + '@hanzo/appearance': 0.2.15(react@19.2.8) + '@hanzo/build': 0.2.130(@hanzo/composer@0.2.1(@hanzo/gui@8.3.5(@hanzogui/react-native-web-lite@8.3.5(react-dom@19.2.8(react@19.2.8))(react@19.2.8))(react-dom@19.2.8(react@19.2.8))(react@19.2.8))(react@19.2.8))(@hanzo/gui@8.3.5(@hanzogui/react-native-web-lite@8.3.5(react-dom@19.2.8(react@19.2.8))(react@19.2.8))(react-dom@19.2.8(react@19.2.8))(react@19.2.8))(@hanzo/i18n@0.6.1(react@19.2.8))(@hanzo/ui@8.33.6(patch_hash=27de2b4513cb844e2ce60f1dd0977b32f388e070e726fd44f68985bc6cb9f293)(41142f5e92d2ce7242c2bcfed8ee29c8))(@hanzo/voice@0.1.19(react@19.2.8))(@hanzogui/lucide-icons-2@8.3.5(react-dom@19.2.8(react@19.2.8))(react-native-svg@15.15.5(@hanzogui/react-native-web-lite@8.3.5(react-dom@19.2.8(react@19.2.8))(react@19.2.8))(react@19.2.8))(react@19.2.8))(react@19.2.8) '@hanzo/composer': 0.2.1(@hanzo/gui@8.3.5(@hanzogui/react-native-web-lite@8.3.5(react-dom@19.2.8(react@19.2.8))(react@19.2.8))(react-dom@19.2.8(react@19.2.8))(react@19.2.8))(react@19.2.8) - '@hanzo/event': 0.3.66(react@19.2.8) - '@hanzo/glass': 0.1.0(react@19.2.8) + '@hanzo/design': 0.5.44 + '@hanzo/event': 0.3.69(react@19.2.8) + '@hanzo/glass': 0.1.1(@hanzo/gui@8.3.5(@hanzogui/react-native-web-lite@8.3.5(react-dom@19.2.8(react@19.2.8))(react@19.2.8))(react-dom@19.2.8(react@19.2.8))(react@19.2.8))(react@19.2.8) '@hanzo/gui': 8.3.5(@hanzogui/react-native-web-lite@8.3.5(react-dom@19.2.8(react@19.2.8))(react@19.2.8))(react-dom@19.2.8(react@19.2.8))(react@19.2.8) - '@hanzo/i18n': 0.5.4(react@19.2.8) - '@hanzo/iam': 0.21.41(react-dom@19.2.8(react@19.2.8))(react@19.2.8) + '@hanzo/i18n': 0.6.1(react@19.2.8) + '@hanzo/iam': 0.21.42(react-dom@19.2.8(react@19.2.8))(react@19.2.8) '@hanzo/logo': 1.0.26(react@19.2.8) - '@hanzo/mod': 0.1.0(react@19.2.8) - '@hanzo/personas': 1.0.5 - '@hanzo/studio': 0.1.8(patch_hash=817ae0169a4e5838aae68d3566da0daf75627679b5bad66049bb0fe88af97f0a)(17e09baef92b467ff94f7e2ead4a9806) - '@hanzo/ui': 8.29.45(7447157379aed6ea6a1cd99f09a3454a) + '@hanzo/mod': 0.1.2(react@19.2.8) + '@hanzo/personas': 1.3.3 + '@hanzo/studio': 0.1.15(patch_hash=817ae0169a4e5838aae68d3566da0daf75627679b5bad66049bb0fe88af97f0a)(cbc9a839ece463321676e5e12686ebf6) + '@hanzo/ui': 8.33.6(patch_hash=27de2b4513cb844e2ce60f1dd0977b32f388e070e726fd44f68985bc6cb9f293)(41142f5e92d2ce7242c2bcfed8ee29c8) '@hanzo/usage': 0.1.18(@hanzo/gui@8.3.5(@hanzogui/react-native-web-lite@8.3.5(react-dom@19.2.8(react@19.2.8))(react@19.2.8))(react-dom@19.2.8(react@19.2.8))(react@19.2.8))(@hanzogui/lucide-icons-2@8.3.5(react-dom@19.2.8(react@19.2.8))(react-native-svg@15.15.5(@hanzogui/react-native-web-lite@8.3.5(react-dom@19.2.8(react@19.2.8))(react@19.2.8))(react@19.2.8))(react@19.2.8))(react@19.2.8) '@hanzo/voice': 0.1.19(react@19.2.8) - '@hanzogui/shell': 8.4.3(patch_hash=bc6bb68834f778be4185df3076fce2a9ebe0ca820c582d4ef7226023abc8941d)(@hanzo/i18n@0.5.4(react@19.2.8))(react-dom@19.2.8(react@19.2.8))(react@19.2.8) + '@hanzogui/shell': 8.4.3(patch_hash=bc6bb68834f778be4185df3076fce2a9ebe0ca820c582d4ef7226023abc8941d)(@hanzo/i18n@0.6.1(react@19.2.8))(react-dom@19.2.8(react@19.2.8))(react@19.2.8) lucide-react: 1.44.0(react@19.2.8) marked: 18.0.12 react: 19.2.8 react-dom: 19.2.8(react@19.2.8) simple-icons: 16.30.0 optionalDependencies: - '@hanzo/tabs': 0.1.7(@hanzo/gui@8.3.5(@hanzogui/react-native-web-lite@8.3.5(react-dom@19.2.8(react@19.2.8))(react@19.2.8))(react-dom@19.2.8(react@19.2.8))(react@19.2.8))(@hanzo/ui@8.29.45(7447157379aed6ea6a1cd99f09a3454a))(lucide-react@1.44.0(react@19.2.8))(react-dom@19.2.8(react@19.2.8))(react@19.2.8) + '@hanzo/tabs': https://codeload.github.com/hanzo-inc/tabs/tar.gz/26a30cbc5fac232e5b11d5d77939f9573ca0c8d8(@hanzo/gui@8.3.5(@hanzogui/react-native-web-lite@8.3.5(react-dom@19.2.8(react@19.2.8))(react@19.2.8))(react-dom@19.2.8(react@19.2.8))(react@19.2.8))(@hanzo/ui@8.33.6(patch_hash=27de2b4513cb844e2ce60f1dd0977b32f388e070e726fd44f68985bc6cb9f293)(41142f5e92d2ce7242c2bcfed8ee29c8))(lucide-react@1.44.0(react@19.2.8))(react-dom@19.2.8(react@19.2.8))(react@19.2.8) - '@hanzo/appearance@0.2.13(react@19.2.8)': + '@hanzo/appearance@0.2.15(react@19.2.8)': dependencies: - '@hanzo/design': 0.5.38 + '@hanzo/design': 0.5.44 react: 19.2.8 '@hanzo/brand@1.4.8(react@19.2.8)': @@ -12646,12 +12656,12 @@ snapshots: optionalDependencies: react: 19.2.8 - '@hanzo/build@0.2.99(patch_hash=a08c7ba528738d86a39a8a9b82ee1dbb385f6992f87265da8b436aed35359c99)(@hanzo/composer@0.2.1(@hanzo/gui@8.3.5(@hanzogui/react-native-web-lite@8.3.5(react-dom@19.2.8(react@19.2.8))(react@19.2.8))(react-dom@19.2.8(react@19.2.8))(react@19.2.8))(react@19.2.8))(@hanzo/gui@8.3.5(@hanzogui/react-native-web-lite@8.3.5(react-dom@19.2.8(react@19.2.8))(react@19.2.8))(react-dom@19.2.8(react@19.2.8))(react@19.2.8))(@hanzo/i18n@0.5.4(react@19.2.8))(@hanzo/ui@8.29.45(7447157379aed6ea6a1cd99f09a3454a))(@hanzo/voice@0.1.19(react@19.2.8))(@hanzogui/lucide-icons-2@8.3.5(react-dom@19.2.8(react@19.2.8))(react-native-svg@15.15.5(@hanzogui/react-native-web-lite@8.3.5(react-dom@19.2.8(react@19.2.8))(react@19.2.8))(react@19.2.8))(react@19.2.8))(react@19.2.8)': + '@hanzo/build@0.2.130(@hanzo/composer@0.2.1(@hanzo/gui@8.3.5(@hanzogui/react-native-web-lite@8.3.5(react-dom@19.2.8(react@19.2.8))(react@19.2.8))(react-dom@19.2.8(react@19.2.8))(react@19.2.8))(react@19.2.8))(@hanzo/gui@8.3.5(@hanzogui/react-native-web-lite@8.3.5(react-dom@19.2.8(react@19.2.8))(react@19.2.8))(react-dom@19.2.8(react@19.2.8))(react@19.2.8))(@hanzo/i18n@0.6.1(react@19.2.8))(@hanzo/ui@8.33.6(patch_hash=27de2b4513cb844e2ce60f1dd0977b32f388e070e726fd44f68985bc6cb9f293)(41142f5e92d2ce7242c2bcfed8ee29c8))(@hanzo/voice@0.1.19(react@19.2.8))(@hanzogui/lucide-icons-2@8.3.5(react-dom@19.2.8(react@19.2.8))(react-native-svg@15.15.5(@hanzogui/react-native-web-lite@8.3.5(react-dom@19.2.8(react@19.2.8))(react@19.2.8))(react@19.2.8))(react@19.2.8))(react@19.2.8)': dependencies: '@hanzo/composer': 0.2.1(@hanzo/gui@8.3.5(@hanzogui/react-native-web-lite@8.3.5(react-dom@19.2.8(react@19.2.8))(react@19.2.8))(react-dom@19.2.8(react@19.2.8))(react@19.2.8))(react@19.2.8) '@hanzo/gui': 8.3.5(@hanzogui/react-native-web-lite@8.3.5(react-dom@19.2.8(react@19.2.8))(react@19.2.8))(react-dom@19.2.8(react@19.2.8))(react@19.2.8) - '@hanzo/i18n': 0.5.4(react@19.2.8) - '@hanzo/ui': 8.29.45(7447157379aed6ea6a1cd99f09a3454a) + '@hanzo/i18n': 0.6.1(react@19.2.8) + '@hanzo/ui': 8.33.6(patch_hash=27de2b4513cb844e2ce60f1dd0977b32f388e070e726fd44f68985bc6cb9f293)(41142f5e92d2ce7242c2bcfed8ee29c8) '@hanzo/voice': 0.1.19(react@19.2.8) '@hanzogui/lucide-icons-2': 8.3.5(react-dom@19.2.8(react@19.2.8))(react-native-svg@15.15.5(@hanzogui/react-native-web-lite@8.3.5(react-dom@19.2.8(react@19.2.8))(react@19.2.8))(react@19.2.8))(react@19.2.8) react: 19.2.8 @@ -12670,15 +12680,15 @@ snapshots: - react-dom - react-native-svg - '@hanzo/design@0.5.38': {} + '@hanzo/design@0.5.44': {} - '@hanzo/event@0.3.66(react@19.2.8)': + '@hanzo/event@0.3.69(react@19.2.8)': dependencies: - '@hanzo/events': 0.3.2 + '@hanzo/events': 0.3.4 optionalDependencies: react: 19.2.8 - '@hanzo/events@0.3.2': {} + '@hanzo/events@0.3.4': {} '@hanzo/font@1.9.2(next@16.3.4(@babel/core@7.29.7(supports-color@8.1.1))(@playwright/test@1.63.0)(@types/node@26.4.0)(babel-plugin-react-compiler@1.0.0)(react-dom@19.2.8(react@19.2.8))(react@19.2.8))': dependencies: @@ -12688,8 +12698,9 @@ snapshots: dependencies: next: 16.3.4(@babel/core@7.29.7(supports-color@8.1.1))(@playwright/test@1.63.0)(@types/node@26.4.0)(babel-plugin-react-compiler@1.0.0)(react-dom@19.2.8(react@19.2.8))(react@19.2.8) - '@hanzo/glass@0.1.0(react@19.2.8)': + '@hanzo/glass@0.1.1(@hanzo/gui@8.3.5(@hanzogui/react-native-web-lite@8.3.5(react-dom@19.2.8(react@19.2.8))(react@19.2.8))(react-dom@19.2.8(react@19.2.8))(react@19.2.8))(react@19.2.8)': dependencies: + '@hanzo/gui': 8.3.5(@hanzogui/react-native-web-lite@8.3.5(react-dom@19.2.8(react@19.2.8))(react@19.2.8))(react-dom@19.2.8(react@19.2.8))(react@19.2.8) react: 19.2.8 '@hanzo/gui@8.3.5(@hanzogui/react-native-web-lite@8.3.5(react-dom@19.2.8(react@19.2.8))(react@19.2.8))(react-dom@19.2.8(react@19.2.8))(react@19.2.8)': @@ -12764,11 +12775,11 @@ snapshots: - react-dom - react-native - '@hanzo/i18n@0.5.4(react@19.2.8)': + '@hanzo/i18n@0.6.1(react@19.2.8)': optionalDependencies: react: 19.2.8 - '@hanzo/iam@0.21.41(react-dom@19.2.8(react@19.2.8))(react@19.2.8)': + '@hanzo/iam@0.21.42(react-dom@19.2.8(react@19.2.8))(react@19.2.8)': dependencies: '@noble/hashes': 1.8.0 jose: 6.2.12 @@ -12786,13 +12797,13 @@ snapshots: optionalDependencies: react: 19.2.8 - '@hanzo/mod@0.1.0(react@19.2.8)': + '@hanzo/mod@0.1.2(react@19.2.8)': dependencies: react: 19.2.8 '@hanzo/observe@0.1.11(react@19.2.8)': dependencies: - '@hanzo/event': 0.3.66(react@19.2.8) + '@hanzo/event': 0.3.69(react@19.2.8) optionalDependencies: react: 19.2.8 @@ -12800,6 +12811,8 @@ snapshots: '@hanzo/personas@1.0.5': {} + '@hanzo/personas@1.3.3': {} + '@hanzo/plans@1.8.17': {} '@hanzo/products@0.2.6(@hanzogui/lucide-icons-2@8.3.5(react-dom@19.2.8(react@19.2.8))(react-native-svg@15.15.5(@hanzogui/react-native-web-lite@8.3.5(react-dom@19.2.8(react@19.2.8))(react@19.2.8))(react@19.2.8))(react@19.2.8))(react@19.2.8)': @@ -12807,48 +12820,46 @@ snapshots: '@hanzogui/lucide-icons-2': 8.3.5(react-dom@19.2.8(react@19.2.8))(react-native-svg@15.15.5(@hanzogui/react-native-web-lite@8.3.5(react-dom@19.2.8(react@19.2.8))(react@19.2.8))(react@19.2.8))(react@19.2.8) react: 19.2.8 - '@hanzo/studio@0.1.8(patch_hash=817ae0169a4e5838aae68d3566da0daf75627679b5bad66049bb0fe88af97f0a)(17e09baef92b467ff94f7e2ead4a9806)': + '@hanzo/studio@0.1.15(patch_hash=817ae0169a4e5838aae68d3566da0daf75627679b5bad66049bb0fe88af97f0a)(cbc9a839ece463321676e5e12686ebf6)': dependencies: - '@hanzo/build': 0.2.99(patch_hash=a08c7ba528738d86a39a8a9b82ee1dbb385f6992f87265da8b436aed35359c99)(@hanzo/composer@0.2.1(@hanzo/gui@8.3.5(@hanzogui/react-native-web-lite@8.3.5(react-dom@19.2.8(react@19.2.8))(react@19.2.8))(react-dom@19.2.8(react@19.2.8))(react@19.2.8))(react@19.2.8))(@hanzo/gui@8.3.5(@hanzogui/react-native-web-lite@8.3.5(react-dom@19.2.8(react@19.2.8))(react@19.2.8))(react-dom@19.2.8(react@19.2.8))(react@19.2.8))(@hanzo/i18n@0.5.4(react@19.2.8))(@hanzo/ui@8.29.45(7447157379aed6ea6a1cd99f09a3454a))(@hanzo/voice@0.1.19(react@19.2.8))(@hanzogui/lucide-icons-2@8.3.5(react-dom@19.2.8(react@19.2.8))(react-native-svg@15.15.5(@hanzogui/react-native-web-lite@8.3.5(react-dom@19.2.8(react@19.2.8))(react@19.2.8))(react@19.2.8))(react@19.2.8))(react@19.2.8) + '@hanzo/build': 0.2.130(@hanzo/composer@0.2.1(@hanzo/gui@8.3.5(@hanzogui/react-native-web-lite@8.3.5(react-dom@19.2.8(react@19.2.8))(react@19.2.8))(react-dom@19.2.8(react@19.2.8))(react@19.2.8))(react@19.2.8))(@hanzo/gui@8.3.5(@hanzogui/react-native-web-lite@8.3.5(react-dom@19.2.8(react@19.2.8))(react@19.2.8))(react-dom@19.2.8(react@19.2.8))(react@19.2.8))(@hanzo/i18n@0.6.1(react@19.2.8))(@hanzo/ui@8.33.6(patch_hash=27de2b4513cb844e2ce60f1dd0977b32f388e070e726fd44f68985bc6cb9f293)(41142f5e92d2ce7242c2bcfed8ee29c8))(@hanzo/voice@0.1.19(react@19.2.8))(@hanzogui/lucide-icons-2@8.3.5(react-dom@19.2.8(react@19.2.8))(react-native-svg@15.15.5(@hanzogui/react-native-web-lite@8.3.5(react-dom@19.2.8(react@19.2.8))(react@19.2.8))(react@19.2.8))(react@19.2.8))(react@19.2.8) '@hanzo/composer': 0.2.1(@hanzo/gui@8.3.5(@hanzogui/react-native-web-lite@8.3.5(react-dom@19.2.8(react@19.2.8))(react@19.2.8))(react-dom@19.2.8(react@19.2.8))(react@19.2.8))(react@19.2.8) '@hanzo/gui': 8.3.5(@hanzogui/react-native-web-lite@8.3.5(react-dom@19.2.8(react@19.2.8))(react@19.2.8))(react-dom@19.2.8(react@19.2.8))(react@19.2.8) - '@hanzo/i18n': 0.5.4(react@19.2.8) - '@hanzo/ui': 8.29.45(7447157379aed6ea6a1cd99f09a3454a) + '@hanzo/i18n': 0.6.1(react@19.2.8) + '@hanzo/ui': 8.33.6(patch_hash=27de2b4513cb844e2ce60f1dd0977b32f388e070e726fd44f68985bc6cb9f293)(41142f5e92d2ce7242c2bcfed8ee29c8) '@hanzo/voice': 0.1.19(react@19.2.8) '@hanzogui/lucide-icons-2': 8.3.5(react-dom@19.2.8(react@19.2.8))(react-native-svg@15.15.5(@hanzogui/react-native-web-lite@8.3.5(react-dom@19.2.8(react@19.2.8))(react@19.2.8))(react@19.2.8))(react@19.2.8) react: 19.2.8 three: 0.186.1 - '@hanzo/tabs@0.1.7(@hanzo/gui@8.3.5(@hanzogui/react-native-web-lite@8.3.5(react-dom@19.2.8(react@19.2.8))(react@19.2.8))(react-dom@19.2.8(react@19.2.8))(react@19.2.8))(@hanzo/ui@8.29.45(7447157379aed6ea6a1cd99f09a3454a))(lucide-react@1.44.0(react@19.2.8))(react-dom@19.2.8(react@19.2.8))(react@19.2.8)': + '@hanzo/tabs@https://codeload.github.com/hanzo-inc/tabs/tar.gz/26a30cbc5fac232e5b11d5d77939f9573ca0c8d8(@hanzo/gui@8.3.5(@hanzogui/react-native-web-lite@8.3.5(react-dom@19.2.8(react@19.2.8))(react@19.2.8))(react-dom@19.2.8(react@19.2.8))(react@19.2.8))(@hanzo/ui@8.33.6(patch_hash=27de2b4513cb844e2ce60f1dd0977b32f388e070e726fd44f68985bc6cb9f293)(41142f5e92d2ce7242c2bcfed8ee29c8))(lucide-react@1.44.0(react@19.2.8))(react-dom@19.2.8(react@19.2.8))(react@19.2.8)': dependencies: '@hanzo/gui': 8.3.5(@hanzogui/react-native-web-lite@8.3.5(react-dom@19.2.8(react@19.2.8))(react@19.2.8))(react-dom@19.2.8(react@19.2.8))(react@19.2.8) - '@hanzo/ui': 8.29.45(7447157379aed6ea6a1cd99f09a3454a) + '@hanzo/ui': 8.33.6(patch_hash=27de2b4513cb844e2ce60f1dd0977b32f388e070e726fd44f68985bc6cb9f293)(41142f5e92d2ce7242c2bcfed8ee29c8) lucide-react: 1.44.0(react@19.2.8) react: 19.2.8 react-dom: 19.2.8(react@19.2.8) - react-hook-form: 7.87.0(react@19.2.8) - '@hanzo/tokens@1.1.1': {} + '@hanzo/tokens@1.1.3': {} - '@hanzo/ui@8.29.45(7447157379aed6ea6a1cd99f09a3454a)': + '@hanzo/ui@8.33.6(patch_hash=27de2b4513cb844e2ce60f1dd0977b32f388e070e726fd44f68985bc6cb9f293)(41142f5e92d2ce7242c2bcfed8ee29c8)': dependencies: '@codemirror/commands': 6.11.1 '@codemirror/lang-json': 6.0.2 '@codemirror/language': 6.13.1 '@codemirror/state': 6.7.6 '@codemirror/view': 6.43.14 - '@hanzo/appearance': 0.2.13(react@19.2.8) + '@hanzo/appearance': 0.2.15(react@19.2.8) '@hanzo/brand': 1.4.8(react@19.2.8) '@hanzo/composer': 0.2.1(@hanzo/gui@8.3.5(@hanzogui/react-native-web-lite@8.3.5(react-dom@19.2.8(react@19.2.8))(react@19.2.8))(react-dom@19.2.8(react@19.2.8))(react@19.2.8))(react@19.2.8) '@hanzo/data': 1.2.4(@hanzo/gui@8.3.5(@hanzogui/react-native-web-lite@8.3.5(react-dom@19.2.8(react@19.2.8))(react@19.2.8))(react-dom@19.2.8(react@19.2.8))(react@19.2.8))(react-dom@19.2.8(react@19.2.8))(react-native-svg@15.15.5(@hanzogui/react-native-web-lite@8.3.5(react-dom@19.2.8(react@19.2.8))(react@19.2.8))(react@19.2.8))(react@19.2.8) - '@hanzo/design': 0.5.38 - '@hanzo/event': 0.3.66(react@19.2.8) + '@hanzo/design': 0.5.44 + '@hanzo/event': 0.3.69(react@19.2.8) '@hanzo/font': 1.9.2(next@16.3.4(@babel/core@7.29.7(supports-color@8.1.1))(@playwright/test@1.63.0)(@types/node@26.4.0)(babel-plugin-react-compiler@1.0.0)(react-dom@19.2.8(react@19.2.8))(react@19.2.8)) '@hanzo/gui': 8.3.5(@hanzogui/react-native-web-lite@8.3.5(react-dom@19.2.8(react@19.2.8))(react@19.2.8))(react-dom@19.2.8(react@19.2.8))(react@19.2.8) - '@hanzo/i18n': 0.5.4(react@19.2.8) '@hanzo/logo': 1.0.26(react@19.2.8) '@hanzo/products': 0.2.6(@hanzogui/lucide-icons-2@8.3.5(react-dom@19.2.8(react@19.2.8))(react-native-svg@15.15.5(@hanzogui/react-native-web-lite@8.3.5(react-dom@19.2.8(react@19.2.8))(react@19.2.8))(react@19.2.8))(react@19.2.8))(react@19.2.8) - '@hanzo/tokens': 1.1.1 + '@hanzo/tokens': 1.1.3 '@hanzo/voice': 0.1.19(react@19.2.8) '@hanzogui/animations-css': 8.3.5(react-dom@19.2.8(react@19.2.8))(react@19.2.8) '@hanzogui/config': 8.3.5(react-dom@19.2.8(react@19.2.8))(react-native-reanimated@4.5.3(@hanzogui/react-native-web-lite@8.3.5(react-dom@19.2.8(react@19.2.8))(react@19.2.8))(react-native-worklets@0.10.3(@babel/core@7.29.7(supports-color@8.1.1))(@hanzogui/react-native-web-lite@8.3.5(react-dom@19.2.8(react@19.2.8))(react@19.2.8))(@react-native/metro-config@0.86.1(@babel/core@7.29.7(supports-color@8.1.1))(supports-color@8.1.1))(react@19.2.8)(supports-color@8.1.1))(react@19.2.8))(react@19.2.8) @@ -12863,12 +12874,13 @@ snapshots: react-native-svg: 15.15.5(@hanzogui/react-native-web-lite@8.3.5(react-dom@19.2.8(react@19.2.8))(react@19.2.8))(react@19.2.8) react-native-web: 0.21.2(encoding@0.1.13)(react-dom@19.2.8(react@19.2.8))(react@19.2.8) optionalDependencies: - '@hanzo/iam': 0.21.41(react-dom@19.2.8(react@19.2.8))(react@19.2.8) + '@hanzo/i18n': 0.6.1(react@19.2.8) + '@hanzo/iam': 0.21.42(react-dom@19.2.8(react@19.2.8))(react@19.2.8) '@hanzo/pay': 0.1.2 '@hanzo/plans': 1.8.17 '@hanzo/usage': 0.1.18(@hanzo/gui@8.3.5(@hanzogui/react-native-web-lite@8.3.5(react-dom@19.2.8(react@19.2.8))(react@19.2.8))(react-dom@19.2.8(react@19.2.8))(react@19.2.8))(@hanzogui/lucide-icons-2@8.3.5(react-dom@19.2.8(react@19.2.8))(react-native-svg@15.15.5(@hanzogui/react-native-web-lite@8.3.5(react-dom@19.2.8(react@19.2.8))(react@19.2.8))(react@19.2.8))(react@19.2.8))(react@19.2.8) '@hanzogui/next-theme': 8.3.5(next@16.3.4(@babel/core@7.29.7(supports-color@8.1.1))(@playwright/test@1.63.0)(@types/node@26.4.0)(babel-plugin-react-compiler@1.0.0)(react-dom@19.2.8(react@19.2.8))(react@19.2.8))(react@19.2.8) - '@hanzogui/shell': 8.4.3(patch_hash=bc6bb68834f778be4185df3076fce2a9ebe0ca820c582d4ef7226023abc8941d)(@hanzo/i18n@0.5.4(react@19.2.8))(react-dom@19.2.8(react@19.2.8))(react@19.2.8) + '@hanzogui/shell': 8.4.3(patch_hash=bc6bb68834f778be4185df3076fce2a9ebe0ca820c582d4ef7226023abc8941d)(@hanzo/i18n@0.6.1(react@19.2.8))(react-dom@19.2.8(react@19.2.8))(react@19.2.8) next: 16.3.4(@babel/core@7.29.7(supports-color@8.1.1))(@playwright/test@1.63.0)(@types/node@26.4.0)(babel-plugin-react-compiler@1.0.0)(react-dom@19.2.8(react@19.2.8))(react@19.2.8) transitivePeerDependencies: - encoding @@ -13740,9 +13752,9 @@ snapshots: transitivePeerDependencies: - react-dom - '@hanzogui/shell@8.4.3(patch_hash=bc6bb68834f778be4185df3076fce2a9ebe0ca820c582d4ef7226023abc8941d)(@hanzo/i18n@0.5.4(react@19.2.8))(react-dom@19.2.8(react@19.2.8))(react@19.2.8)': + '@hanzogui/shell@8.4.3(patch_hash=bc6bb68834f778be4185df3076fce2a9ebe0ca820c582d4ef7226023abc8941d)(@hanzo/i18n@0.6.1(react@19.2.8))(react-dom@19.2.8(react@19.2.8))(react@19.2.8)': dependencies: - '@hanzo/i18n': 0.5.4(react@19.2.8) + '@hanzo/i18n': 0.6.1(react@19.2.8) react: 19.2.8 react-dom: 19.2.8(react@19.2.8) @@ -13859,7 +13871,7 @@ snapshots: '@hanzogui/telemetry@8.3.5(react@19.2.8)': dependencies: - '@hanzo/event': 0.3.66(react@19.2.8) + '@hanzo/event': 0.3.69(react@19.2.8) '@hanzo/observe': 0.1.11(react@19.2.8) react: 19.2.8 diff --git a/pnpm-workspace.yaml b/pnpm-workspace.yaml index ff6e8743..b454ab4f 100644 --- a/pnpm-workspace.yaml +++ b/pnpm-workspace.yaml @@ -22,10 +22,12 @@ overrides: # registrations, a second @hanzo/design is a second set of tokens. The catalog # decides which version; these decide there is one. '@hanzo/gui': '8.3.5' - '@hanzo/ui': '8.29.45' - '@hanzo/event': '0.3.66' - '@hanzo/design': '0.5.38' - '@hanzo/iam': '0.21.41' + '@hanzo/ui': '8.33.6' + '@hanzo/event': '0.3.69' + '@hanzo/design': '0.5.44' + '@hanzo/iam': '0.21.42' + '@hanzo/appearance': '0.2.15' + '@hanzo/studio': '0.1.15' '@noble/hashes': '1.8.0' 'zod': '^4.5.2' react-reconciler: '^0.33.0' @@ -73,17 +75,21 @@ overrides: serialize-javascript: '>=7.0.5' 'yaml@2': '>=2.8.3' # The desktop draws hanzo.ai's app, so it takes hanzo.ai's patches with it: -# @hanzo/app 0.2.63 with Setup's GitHub fixes and the composer's spent-usage -# banner (hanzoai/app#23, #25), and @hanzogui/shell 8.4.3 with hanzoai/gui#20 -# (the palette leaves a ⌘K the page already answered), and @hanzo/studio 0.1.8 -# so a GPU status that is not a fleet no longer crashes Studio in lit(), and the -# window reaches the engine through the hanzo-studio scheme -# (src-tauri/src/studio_proxy.rs), since studio.hanzo.ai's CORS admits no window -# origin. Drop each when its pin moves to a release that carries it. +# @hanzo/ui 8.33.6 (glass shadows and text links, hanzo-inc/app's own patch) and +# @hanzogui/shell 8.4.3 with hanzoai/gui#20 (the palette leaves a ⌘K the page +# already answered). @hanzo/studio 0.1.15 so a GPU status that is not a fleet no +# longer crashes Studio in lit(), and the window reaches the engine through the +# hanzo-studio scheme (src-tauri/src/studio_proxy.rs), since studio.hanzo.ai's +# CORS admits no window origin. @hanzo/app 0.3.107 with what only a desktop +# window does: a signed-out reader chats with the local engine (any local model, +# images and text files read in the window, Local AI from a failed turn), lists +# that stay empty without a session, the desktop's ⌘N and ⇧⌘M in the shortcut +# list, and no Google Workspace until Google verifies its scopes. Drop each when +# its pin moves to a release that carries it. patchedDependencies: - '@hanzo/app@0.2.63': patches/@hanzo__app@0.2.63.patch - '@hanzo/build@0.2.99': patches/@hanzo__build@0.2.99.patch - '@hanzo/studio@0.1.8': patches/@hanzo__studio@0.1.8.patch + '@hanzo/app@0.3.107': patches/@hanzo__app@0.3.107.patch + '@hanzo/ui@8.33.6': patches/@hanzo__ui@8.33.6.patch + '@hanzo/studio@0.1.15': patches/@hanzo__studio@0.1.15.patch '@hanzogui/shell@8.4.3': patches/@hanzogui__shell@8.4.3.patch allowBuilds: '@swc/core': true @@ -95,6 +101,19 @@ allowBuilds: sharp: true unrs-resolver: true minimumReleaseAgeExclude: + - '@hanzo/app@0.3.107' + - '@hanzo/ai@0.7.0' + - '@hanzo/appearance@0.2.15' + - '@hanzo/build@0.2.130' + - '@hanzo/design@0.5.44' + - '@hanzo/event@0.3.69' + - '@hanzo/i18n@0.6.1' + - '@hanzo/iam@0.21.42' + - '@hanzo/studio@0.1.15' + - '@hanzo/ui@8.33.6' + - '@hanzo/glass@0.1.1' + - '@hanzo/mod@0.1.2' + - '@hanzo/personas@1.3.3' - '@hanzo/app@0.2.63' - '@hanzo/app@0.2.21' - '@hanzo/app@0.2.20' @@ -221,25 +240,28 @@ minimumReleaseAgeExclude: catalog: # The main window is hanzo.ai's app (@hanzo/rooms App), so this block pins # the same stack hanzo-inc/app's catalog does. Move them together. - '@hanzo/ai': '0.6.24' - '@hanzo/appearance': '0.2.13' + '@hanzo/ai': '0.7.0' + '@hanzo/appearance': '0.2.15' '@hanzo/brand': '1.4.8' - '@hanzo/build': '0.2.99' + '@hanzo/build': '0.2.130' '@hanzo/composer': '0.2.1' '@hanzo/data': '1.2.4' - '@hanzo/design': '0.5.38' - '@hanzo/event': '0.3.66' + '@hanzo/design': '0.5.44' + '@hanzo/event': '0.3.69' '@hanzo/font': '1.9.3' '@hanzo/gui': '8.3.5' - '@hanzo/iam': '0.21.41' + '@hanzo/i18n': '0.6.1' + '@hanzo/iam': '0.21.42' '@hanzo/personas': '1.0.5' '@hanzo/plans': '1.8.17' - '@hanzo/app': 'https://registry.npmjs.org/@hanzo/app/-/app-0.2.63.tgz' - '@hanzo/studio': '0.1.8' - '@hanzo/tabs': '0.1.7' + '@hanzo/app': '0.3.107' + '@hanzo/studio': '0.1.15' + # The commit hanzo-inc/app's lock holds (0.1.17); npm stops at 0.1.7, under + # @hanzo/app's floor of 0.1.8. + '@hanzo/tabs': 'github:hanzo-inc/tabs#26a30cbc5fac232e5b11d5d77939f9573ca0c8d8' '@hanzo/logo': '1.0.26' '@hanzo/pay': '0.1.2' - '@hanzo/ui': '8.29.45' + '@hanzo/ui': '8.33.6' '@hanzo/usage': '0.1.18' '@hanzo/voice': '0.1.19' '@hanzogui/config': '8.3.5' diff --git a/scripts/version.sh b/scripts/version.sh index 21765230..339f4c3e 100755 --- a/scripts/version.sh +++ b/scripts/version.sh @@ -30,7 +30,8 @@ # # THE SINGLE SOURCE IS THE ROOT package.json, and the checks below are what keep # it single. Tauri reads it by PATH (`"version": "../../../package.json"` in -# tauri.conf.json), src-tauri/Cargo.toml stays an inert 0.0.0 placeholder, and +# tauri.conf.json), src-tauri/Cargo.toml repeats it exactly (cargo cannot read a +# file; src-tauri/build.rs refuses a build where the two differ), and # apps/hanzo-desktop/package.json declares no version at all. Every one of those # is a place a number could be typed a second time and then disagree, which is # how a bundle comes to report a version its repo never released. @@ -97,10 +98,10 @@ case "${1:-check}" in cargo="$(sed -n '/^\[package\]/,/^\[/p' apps/hanzo-desktop/src-tauri/Cargo.toml \ | sed -n 's/^version *= *"\([^"]*\)".*/\1/p' | head -1)" - [ "$cargo" = "0.0.0" ] \ - || fail "src-tauri/Cargo.toml declares version '${cargo}', not the inert 0.0.0." \ - "tauri.conf.json's pointer overrides it for the bundle, so a real number" \ - "here is a third source that looks authoritative and governs nothing." + [ "$cargo" = "$dec" ] \ + || fail "src-tauri/Cargo.toml declares version '${cargo}', not package.json's ${dec}." \ + "src-tauri/build.rs refuses to build when the two differ (cargo cannot" \ + "read package.json), so set version = \"${dec}\" in Cargo.toml." # ---- never behind what shipped ------------------------------------------ pub="$(published)"