@hanzo/app 0.3.52 → 0.3.53
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/App.js +1 -1
- package/dist/Bar.d.ts +1 -3
- package/dist/Bar.js +22 -28
- package/dist/Chat.js +4 -3
- package/dist/Home.js +4 -3
- package/dist/Rail.js +14 -12
- package/dist/Search.js +16 -12
- package/dist/SettingsPane.js +1 -1
- package/dist/Sidebar.d.ts +5 -0
- package/dist/Sidebar.js +9 -7
- package/dist/dev.js +2 -1
- package/dist/lib/chatPreferences.d.ts +2 -0
- package/dist/lib/chatPreferences.js +4 -3
- package/dist/lib/pay.d.ts +8 -0
- package/dist/lib/pay.js +15 -0
- package/package.json +5 -5
package/dist/App.js
CHANGED
|
@@ -357,7 +357,7 @@ function Window({ bar, betas }) {
|
|
|
357
357
|
// scrolls inside, collapsed to its border (Projects drew blank). The rest of the row
|
|
358
358
|
// beside the rail and the sidebar, never width 100%: a View does not shrink, so at the
|
|
359
359
|
// row's full width again the pane stood past the window's edge.
|
|
360
|
-
flex: 1, minW: 0, minH: 0, marginInlineStart: closed || alone ? 0 : 'var(--pane-gap)', "$max-md": { marginInlineStart: 0, pb: `max(var(--pane-gap), ${FOOT})` }, children: [bar ? null : _jsx(Bar, { host: host, mode: mode, places: sidebar, open: drawer.state !== 'shut', go: move, onMenu: drawer.open
|
|
360
|
+
flex: 1, minW: 0, minH: 0, marginInlineStart: closed || alone ? 0 : 'var(--pane-gap)', "$max-md": { marginInlineStart: 0, pb: `max(var(--pane-gap), ${FOOT})` }, children: [bar ? null : _jsx(Bar, { host: host, mode: mode, places: sidebar, open: drawer.state !== 'shut', go: move, onMenu: drawer.open }), _jsx(XStack, { "data-slot": "panes", flex: 1, display: "grid", gridTemplateAreas: '"pane side"', gridTemplateColumns: "minmax(0, 1fr) auto", gridTemplateRows: "minmax(0, 1fr)", minW: 0, minH: 0, children: anonSettings && host.person === null ? (_jsx(YStack, { render: "main", "data-slot": "pane", ...pane(), overflow: "hidden", flex: 1, minW: 0, minH: 0, children: _jsx(AnonSettingsPane, { host: host, onClose: () => {
|
|
361
361
|
setAnonSettings(false);
|
|
362
362
|
if (typeof window !== 'undefined') {
|
|
363
363
|
window.dispatchEvent(new CustomEvent('hanzo:anon-settings', { detail: { open: false } }));
|
package/dist/Bar.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { type Host } from '@hanzo/build';
|
|
2
2
|
import type { RailLink } from '@hanzo/ui/chat';
|
|
3
3
|
import { type Place } from './lib/host.js';
|
|
4
|
-
export declare function Bar({ host, mode, places, open, go, onMenu,
|
|
4
|
+
export declare function Bar({ host, mode, places, open, go, onMenu, }: {
|
|
5
5
|
host: Host;
|
|
6
6
|
mode: Place['mode'];
|
|
7
7
|
/** The mode's places, where they are not Dev's (Studio's `nav`). */
|
|
@@ -14,6 +14,4 @@ export declare function Bar({ host, mode, places, open, go, onMenu, onChat, onDe
|
|
|
14
14
|
/** Moves the app, the drawer away first. */
|
|
15
15
|
go: (address: string) => void;
|
|
16
16
|
onMenu: () => void;
|
|
17
|
-
onChat: () => void;
|
|
18
|
-
onDev: () => void;
|
|
19
17
|
}): import("react").JSX.Element;
|
package/dist/Bar.js
CHANGED
|
@@ -1,37 +1,32 @@
|
|
|
1
1
|
'use client';
|
|
2
2
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
3
|
// A phone's bar, which has neither rail nor sidebar to move the app: the
|
|
4
|
-
// drawer's button at the start
|
|
5
|
-
// (
|
|
6
|
-
//
|
|
4
|
+
// drawer's button at the start and New at the end. The drawer lists the places
|
|
5
|
+
// (Chat, Dev, Studio, Tabs, Library, Scheduled tasks, Customize) as rows, so the
|
|
6
|
+
// bar carries no switch of its own. Right to left the row turns with the page,
|
|
7
|
+
// and the drawer's mark is mirrored.
|
|
7
8
|
//
|
|
8
|
-
// (≡)
|
|
9
|
+
// (≡) (✎)
|
|
9
10
|
//
|
|
10
|
-
//
|
|
11
|
-
//
|
|
11
|
+
// Both are glass: the pane's material (ground.ts) cut round, its edge one step
|
|
12
|
+
// stronger so a circle on the bare floor reads as one. Measured on the
|
|
12
13
|
// reference at 440×956: the buttons are 44px circles 20px in from each edge,
|
|
13
|
-
//
|
|
14
|
-
// medium, all centred on one line 48px tall under the device's top inset.
|
|
14
|
+
// all centred on one line 48px tall under the device's top inset.
|
|
15
15
|
//
|
|
16
|
-
// Chat
|
|
17
|
-
//
|
|
18
|
-
// mode's
|
|
19
|
-
//
|
|
16
|
+
// New is Chat's New chat, and elsewhere the mode's own New row (@hanzo/build's
|
|
17
|
+
// and @hanzo/studio's `nav`, `NEW`), so the bar names it as the sidebar does;
|
|
18
|
+
// its icon is the mode's `make` mark (@hanzo/build `MARKS`): the pen in Chat,
|
|
19
|
+
// `</>` in Dev, the terminal in Tabs.
|
|
20
20
|
import { useI18n } from '@hanzo/i18n/react';
|
|
21
|
-
import {
|
|
22
|
-
import {
|
|
23
|
-
import { nav, NEW } from '@hanzo/build';
|
|
24
|
-
import { ToggleGroup, ToggleGroupItem } from '@hanzo/ui';
|
|
21
|
+
import { XStack } from '@hanzo/gui';
|
|
22
|
+
import { MARKS, nav, NEW } from '@hanzo/build';
|
|
25
23
|
import { BAND, pane } from './ground.js';
|
|
26
24
|
import { empty } from './open.js';
|
|
27
25
|
import { talk } from './lib/host.js';
|
|
26
|
+
import { dispatchTabsAction } from './Sidebar.js';
|
|
28
27
|
/** A button, px: compact and refined. */
|
|
29
28
|
const ROUND = 34;
|
|
30
|
-
/** The
|
|
31
|
-
const LINE = 34;
|
|
32
|
-
/** A segment, px: compact switcher button. */
|
|
33
|
-
const SEGMENT = 56;
|
|
34
|
-
/** The glass the three are cut from. */
|
|
29
|
+
/** The glass the two are cut from. */
|
|
35
30
|
const GLASS = {
|
|
36
31
|
...pane(),
|
|
37
32
|
borderWidth: 1,
|
|
@@ -48,11 +43,7 @@ function Round({ label, onPress, opacity, pointerEvents, children, ...rest }) {
|
|
|
48
43
|
function Lines() {
|
|
49
44
|
return (_jsx("svg", { width: 15, height: 9, viewBox: "0 0 19 11", fill: "none", stroke: "currentColor", strokeWidth: 2, strokeLinecap: "round", "aria-hidden": true, "data-i18n-mirror": true, children: _jsx("path", { d: "M1 1h17M1 10h10.7" }) }));
|
|
50
45
|
}
|
|
51
|
-
|
|
52
|
-
function Segment({ value, children }) {
|
|
53
|
-
return (_jsx(ToggleGroupItem, { value: value, size: "sm", width: SEGMENT, height: 24, maxH: 24, minH: 0, $touchable: { minH: 0 }, p: 0, px: 0, py: 0, m: 0, borderWidth: 0, overflow: "hidden", boxSizing: "border-box", rounded: 9999, bg: "transparent", borderColor: "transparent", hoverStyle: { bg: '$hover' }, activeStyle: { bg: '$raised', borderColor: 'transparent', borderWidth: 0 }, children: _jsx(Text, { fontSize: "$2", fontWeight: "600", color: "$ink", numberOfLines: 1, children: children }) }));
|
|
54
|
-
}
|
|
55
|
-
export function Bar({ host, mode, places, open = false, go, onMenu, onChat, onDev, }) {
|
|
46
|
+
export function Bar({ host, mode, places, open = false, go, onMenu, }) {
|
|
56
47
|
const { t } = useI18n();
|
|
57
48
|
const made = mode === 'chat' ? null : (places ?? nav(host, (p) => host.go(p), t)).flatMap((g) => g.links).find((l) => l.id === NEW);
|
|
58
49
|
const fresh = mode === 'chat'
|
|
@@ -63,6 +54,9 @@ export function Bar({ host, mode, places, open = false, go, onMenu, onChat, onDe
|
|
|
63
54
|
go(talk());
|
|
64
55
|
},
|
|
65
56
|
}
|
|
66
|
-
:
|
|
67
|
-
|
|
57
|
+
: mode === 'tabs'
|
|
58
|
+
? { label: t('New terminal'), onPress: () => dispatchTabsAction({ kind: 'shell' }) }
|
|
59
|
+
: { label: made?.label ?? t('New'), onPress: made?.onPress };
|
|
60
|
+
const Make = mode === 'chat' || mode === 'dev' || mode === 'tabs' || mode === 'studio' ? MARKS[mode].make : MARKS.chat.make;
|
|
61
|
+
return (_jsxs(XStack, { "data-slot": "app-bar", items: "center", justify: "space-between", height: `calc(${BAND}px + var(--safe-top) + var(--pane-gap))`, pt: "calc(var(--safe-top) + var(--pane-gap))", px: "$4.5", shrink: 0, $md: { display: 'none' }, children: [_jsx(Round, { label: t('Open sidebar'), "data-slot": "bar-menu", onPress: onMenu, pointerEvents: open ? 'none' : 'auto', children: _jsx(Lines, {}) }), fresh.onPress ? (_jsx(Round, { label: fresh.label, "data-slot": "bar-new", onPress: fresh.onPress, children: _jsx(Make, { size: 16, strokeWidth: 1.75, "aria-hidden": true }) })) : (_jsx(XStack, { width: ROUND, height: ROUND, "aria-hidden": true }))] }));
|
|
68
62
|
}
|
package/dist/Chat.js
CHANGED
|
@@ -69,7 +69,7 @@ import { keepFile, useAttach, useKeep } from "./keep.js";
|
|
|
69
69
|
import { useKept } from "./kept.js";
|
|
70
70
|
import { dragWindow, toggleWindowMaximize } from "./WindowControls.js";
|
|
71
71
|
import { artifacts, lead, nameOf, PAGE, Panel, PanelToggle, renders, Reply, Summary, useDeck, useKey, Suggestions, useCarry, useLanguage, useMind, useSuggestions, taken, CHAT_MODES, usePanel, frames, name as tabName, } from "@hanzo/build";
|
|
72
|
-
import { checkoutUrl, payUrl } from './lib/pay.js';
|
|
72
|
+
import { checkoutUrl, payUrl, topUp } from './lib/pay.js';
|
|
73
73
|
import { Upgrade, useFree } from './Upgrade.js';
|
|
74
74
|
import { enter, LOGIN } from './lib/destination.js';
|
|
75
75
|
import { first } from './lib/first.js';
|
|
@@ -556,7 +556,7 @@ function Thread({ placeholder = message(), initial, anonymous = false, settled =
|
|
|
556
556
|
const catalog = useRef([]);
|
|
557
557
|
const planUsage = useLimits(!anonymous, org(), (id) => nameOf(id, catalog.current));
|
|
558
558
|
const { limits, notice, reload: reread } = planUsage;
|
|
559
|
-
const mind = useMind(target, anonymous ? "free" : limits?.plan);
|
|
559
|
+
const mind = useMind(target, anonymous ? "free" : limits?.plan, anonymous ? undefined : topUp);
|
|
560
560
|
catalog.current = mind.models;
|
|
561
561
|
// Chat's effort is its own (six steps, sent as `reasoning_effort`); a
|
|
562
562
|
// pick of one Dev offers too moves Dev's, where it is made, and opening Chat
|
|
@@ -1904,7 +1904,8 @@ function Thread({ placeholder = message(), initial, anonymous = false, settled =
|
|
|
1904
1904
|
},
|
|
1905
1905
|
},
|
|
1906
1906
|
// The model, only where the person turned the model selector on; the effort, always.
|
|
1907
|
-
|
|
1907
|
+
// The picker lists what the person has turned on: third-party models (paid from the balance) unless they turned them off.
|
|
1908
|
+
mind: anonymous ? null : { ...mind, models: filteredListed },
|
|
1908
1909
|
effort: {
|
|
1909
1910
|
value: chatPrefs.effort || "auto",
|
|
1910
1911
|
set: (eff) => {
|
package/dist/Home.js
CHANGED
|
@@ -16,9 +16,10 @@ import { dev } from './lib/host.js';
|
|
|
16
16
|
import { phrase } from '@hanzo/i18n';
|
|
17
17
|
import { useI18n } from '@hanzo/i18n/react';
|
|
18
18
|
import { useEffect, useMemo, useState } from 'react';
|
|
19
|
-
import { AtSign, Blocks, Bot,
|
|
19
|
+
import { AtSign, Blocks, Bot, FolderGit2, Hash, Plus, UserPlus } from 'lucide-react';
|
|
20
20
|
import { useAgents, usePeople, useSessions, useThreads } from '@hanzo/ai/react';
|
|
21
21
|
import { Composer } from '@hanzo/ui/chat';
|
|
22
|
+
import { MARKS } from '@hanzo/build';
|
|
22
23
|
import { Crew } from './crew.js';
|
|
23
24
|
import { Box, Text, XStack, YStack } from '@hanzo/ui';
|
|
24
25
|
import { tap } from './lib/tap.js';
|
|
@@ -236,7 +237,7 @@ function Chats() {
|
|
|
236
237
|
const { t } = useI18n();
|
|
237
238
|
const { threads, loading } = useThreads();
|
|
238
239
|
const { open } = useOpen();
|
|
239
|
-
return (_jsx(Card, { kind: "chats", icon: _jsx(
|
|
240
|
+
return (_jsx(Card, { kind: "chats", icon: _jsx(MARKS.chat.icon, { size: 14, "aria-hidden": true }), title: t('Chats'), children: loading && threads.length === 0 ? (_jsx(Waiting, { subject: t('your chats') })) : threads.length === 0 ? (_jsx(Quiet, { children: t('No chats yet.') })) : (_jsx(YStack, { gap: "$1", children: threads.slice(0, 3).map((one) => (_jsx(Row, { onPress: () => open(one.id), children: one.title || t('Untitled') }, one.id))) })) }));
|
|
240
241
|
}
|
|
241
242
|
/**
|
|
242
243
|
* What is going, then what to do next.
|
|
@@ -315,5 +316,5 @@ function Mates({ owner }) {
|
|
|
315
316
|
}
|
|
316
317
|
function Build() {
|
|
317
318
|
const { t } = useI18n();
|
|
318
|
-
return (_jsxs(Card, { kind: "build", icon: _jsx(
|
|
319
|
+
return (_jsxs(Card, { kind: "build", icon: _jsx(MARKS.dev.icon, { size: 14, "aria-hidden": true }), title: t('Build'), children: [_jsx(Quiet, { children: t('Hanzo Dev writes it, runs it, ships it.') }), _jsx(Go, { href: dev(), children: t('Open Dev') })] }));
|
|
319
320
|
}
|
package/dist/Rail.js
CHANGED
|
@@ -5,8 +5,10 @@ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
|
5
5
|
// More (Team, on a host of its own, then the apps in beta this reader may open
|
|
6
6
|
// and Betas, the list of every app in beta; none of it in Studio), and the
|
|
7
7
|
// account at the foot. It
|
|
8
|
-
// is how the app moves between its products; a phone
|
|
9
|
-
//
|
|
8
|
+
// is how the app moves between its products; a phone's drawer holds it down its
|
|
9
|
+
// start edge, as a laptop's window does, and its bar carries no switch of its
|
|
10
|
+
// own. Every mark is @hanzo/build's `MARKS`, the one source the sidebars, the
|
|
11
|
+
// bar, the palette and the landing pages draw from.
|
|
10
12
|
//
|
|
11
13
|
// Studio is the app's third mode (@hanzo/studio at /studio), each of the three
|
|
12
14
|
// opened where the reader left it.
|
|
@@ -30,14 +32,14 @@ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
|
30
32
|
// a browser tab. A host that is a window draws the toggle in its bar beside Back
|
|
31
33
|
// and Forward (App.tsx `bar`), and its rail starts with Chat. A phone has no
|
|
32
34
|
// rail: its menu (Drawer.tsx) lists the places as rows (`rows`) under the mode's
|
|
33
|
-
// own — Studio, Tabs, then More, which Library, Scheduled tasks and
|
|
34
|
-
// lead there. Chat and Dev are the
|
|
35
|
-
// the menu's foot.
|
|
35
|
+
// own — Design, Studio, Tabs, then More, which Library, Scheduled tasks and
|
|
36
|
+
// Customize lead there. Chat and Dev are the rail's marks beside them, and the
|
|
37
|
+
// account is the menu's foot.
|
|
36
38
|
import { useI18n } from '@hanzo/i18n/react';
|
|
37
|
-
import { Bot, CircleHelp,
|
|
39
|
+
import { Bot, CircleHelp, Compass, Ellipsis, FlaskConical, PanelLeft, Settings, Sparkles, Users } from 'lucide-react';
|
|
38
40
|
import { useState } from 'react';
|
|
39
41
|
import { Text, XStack, YStack } from '@hanzo/gui';
|
|
40
|
-
import { route } from '@hanzo/build';
|
|
42
|
+
import { MARKS, route } from '@hanzo/build';
|
|
41
43
|
import { DropdownMenu } from '@hanzo/ui';
|
|
42
44
|
import { SidebarItem } from '@hanzo/ui/chat';
|
|
43
45
|
import { BetasDialog, useBetas } from './Betas.js';
|
|
@@ -106,9 +108,9 @@ export function Rail({ host, mode, at, open, toggle, inside = null, rows = false
|
|
|
106
108
|
const rest = [
|
|
107
109
|
...(rows
|
|
108
110
|
? [
|
|
109
|
-
{ key: 'library', label: t('Library'), icon: _jsx(
|
|
110
|
-
{ key: 'scheduled', label: t('Scheduled tasks'), icon: _jsx(
|
|
111
|
-
{ key: 'customize', label: t('Customize'), icon: _jsx(
|
|
111
|
+
{ key: 'library', label: t('Library'), icon: _jsx(MARKS.library.icon, { size: 16, "aria-hidden": true }), onSelect: to(RAISED.library) },
|
|
112
|
+
{ key: 'scheduled', label: t('Scheduled tasks'), icon: _jsx(MARKS.scheduled.icon, { size: 16, "aria-hidden": true }), onSelect: to(RAISED.scheduled) },
|
|
113
|
+
{ key: 'customize', label: t('Customize'), icon: _jsx(MARKS.customize.icon, { size: 16, "aria-hidden": true }), onSelect: to(RAISED.customize) },
|
|
112
114
|
...(team ? [{ type: 'separator', key: 'raised' }] : []),
|
|
113
115
|
]
|
|
114
116
|
: []),
|
|
@@ -123,12 +125,12 @@ export function Rail({ host, mode, at, open, toggle, inside = null, rows = false
|
|
|
123
125
|
];
|
|
124
126
|
const betasDialog = _jsx(BetasDialog, { open: betas, onOpenChange: setBetas, go: reach });
|
|
125
127
|
if (rows)
|
|
126
|
-
return (_jsxs(YStack, { "data-slot": "places", render: "nav", "aria-label": t('Products'), pt: "$2", shrink: 0, children: [_jsxs(YStack, { role: "list", gap: 2, children: [anon ? null : (_jsx(YStack, { role: "listitem", children: _jsx(Row, { label: "Design", on: mode === 'design', onPress: onDesign, "data-slot": "place-design", icon: _jsx(
|
|
128
|
+
return (_jsxs(YStack, { "data-slot": "places", render: "nav", "aria-label": t('Products'), pt: "$2", shrink: 0, children: [_jsxs(YStack, { role: "list", gap: 2, children: [anon ? null : (_jsx(YStack, { role: "listitem", children: _jsx(Row, { label: "Design", on: mode === 'design', onPress: onDesign, "data-slot": "place-design", icon: _jsx(MARKS.design.icon, { size: 16, "aria-hidden": true }) }) })), !anon && opened('studio') ? (_jsx(YStack, { role: "listitem", children: _jsx(Row, { label: "Studio", on: mode === 'studio', onPress: onStudio, "data-slot": "place-studio", icon: _jsx(MARKS.studio.icon, { size: 16, "aria-hidden": true }) }) })) : null, anon ? null : (_jsx(YStack, { role: "listitem", children: _jsx(Row, { label: "Tabs", on: mode === 'tabs', onPress: onTabs, "data-slot": "place-tabs", icon: _jsx(MARKS.tabs.icon, { size: 16, "aria-hidden": true }) }) })), apps.map((a) => (_jsx(YStack, { role: "listitem", children: _jsx(Row, { label: a.name, on: inside === a.id, onPress: () => go(hosted(a.id)), "data-slot": `place-app-${a.id}`, icon: _jsx(a.icon, { size: 16, "aria-hidden": true }) }) }, a.id))), anon ? null : (_jsx(YStack, { role: "listitem", children: _jsx(DropdownMenu, { placement: "bottom-start", minWidth: 220, trigger: _jsx(Row, { label: t('More'), "data-slot": "place-more", "aria-haspopup": "menu", icon: _jsx(Ellipsis, { size: 16, "aria-hidden": true }) }), items: rest }) }))] }), betasDialog] }));
|
|
127
129
|
return (_jsxs(YStack, { "data-slot": "rail", render: "nav", "aria-label": t('Products'), width: RAIL, flex: 1,
|
|
128
130
|
// As tall as the window and no taller: its marks scroll inside it (below), never the page.
|
|
129
131
|
minH: 0,
|
|
130
132
|
// The first mark stands at the pane's top edge, one head row high (HEAD), the account on the sidebar's foot (Sidebar's `pb`).
|
|
131
|
-
pt: (HEAD - MARK) / 2, pb: "$2", gap: 4, shrink: 0, items: "center", $touchable: { pt: (TOUCH_HEAD - TOUCH) / 2 }, children: [toggle ? (_jsx(YStack, { children: _jsx(Toggle, { open: open, onPress: toggle }) })) : null, _jsxs(YStack, { flex: 1, minH: 0, overflowY: "auto", overflowX: "hidden", items: "center", gap: 4, width: "100%", "$platform-web": { scrollbarWidth: 'none' }, children: [_jsx(Mark, { label: t('Chat'), on: mode === 'chat', onPress: onChat, "data-slot": "rail-chat", children: _jsx(
|
|
133
|
+
pt: (HEAD - MARK) / 2, pb: "$2", gap: 4, shrink: 0, items: "center", $touchable: { pt: (TOUCH_HEAD - TOUCH) / 2 }, children: [toggle ? (_jsx(YStack, { children: _jsx(Toggle, { open: open, onPress: toggle }) })) : null, _jsxs(YStack, { flex: 1, minH: 0, overflowY: "auto", overflowX: "hidden", items: "center", gap: 4, width: "100%", "$platform-web": { scrollbarWidth: 'none' }, children: [_jsx(Mark, { label: t('Chat'), on: mode === 'chat', onPress: onChat, "data-slot": "rail-chat", children: _jsx(MARKS.chat.icon, { size: 18, "aria-hidden": true }) }), _jsx(Mark, { label: "Dev", on: mode === 'dev' && !here, onPress: onDev, "data-slot": "rail-dev", children: _jsx(MARKS.dev.icon, { size: 18, "aria-hidden": true }) }), anon ? null : (_jsx(Mark, { label: "Design", on: mode === 'design', onPress: onDesign, "data-slot": "rail-design", children: _jsx(MARKS.design.icon, { size: 18, "aria-hidden": true }) })), !anon && opened('studio') ? (_jsx(Mark, { label: "Studio", on: mode === 'studio', onPress: onStudio, "data-slot": "rail-studio", children: _jsx(MARKS.studio.icon, { size: 18, "aria-hidden": true }) })) : null, anon ? null : (_jsx(Mark, { label: "Tabs", on: mode === 'tabs', onPress: onTabs, "data-slot": "rail-tabs", children: _jsx(MARKS.tabs.icon, { size: 18, "aria-hidden": true }) })), apps.map((a) => (_jsx(Mark, { label: a.name, on: inside === a.id, onPress: () => go(hosted(a.id)), "data-slot": `rail-app-${a.id}`, children: _jsx(a.icon, { size: 18, "aria-hidden": true }) }, a.id))), _jsx(Mark, { label: t('Library'), on: here === 'library', onPress: to(RAISED.library), "data-slot": "rail-library", children: _jsx(MARKS.library.icon, { size: 18, "aria-hidden": true }) }), anon ? null : (_jsx(Mark, { label: t('Scheduled tasks'), on: here === 'scheduled', onPress: to(RAISED.scheduled), "data-slot": "rail-scheduled", children: _jsx(MARKS.scheduled.icon, { size: 18, "aria-hidden": true }) })), anon ? null : (_jsx(Mark, { label: t('Customize'), on: here === 'customize', onPress: to(RAISED.customize), "data-slot": "rail-customize", children: _jsx(MARKS.customize.icon, { size: 18, "aria-hidden": true }) })), anon ? null : (_jsx(Mark, { label: t('Betas'), on: mode === 'beta', onPress: () => go('/beta'), "data-slot": "rail-betas", children: _jsx(FlaskConical, { size: 18, "aria-hidden": true }) })), betasDialog, !anon && rest.length ? (_jsx(DropdownMenu
|
|
132
134
|
// Toward the content: right of the rail, left of it right to left.
|
|
133
135
|
, {
|
|
134
136
|
// Toward the content: right of the rail, left of it right to left.
|
package/dist/Search.js
CHANGED
|
@@ -30,9 +30,9 @@ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
|
30
30
|
import { useEffect, useMemo, useState } from 'react';
|
|
31
31
|
import { isolate, english } from '@hanzo/i18n';
|
|
32
32
|
import { useI18n } from '@hanzo/i18n/react';
|
|
33
|
-
import { BookOpen, Bot, Building2, CircleHelp,
|
|
33
|
+
import { BookOpen, Bot, Building2, CircleHelp, FlaskConical, FolderGit2, Gift, Keyboard, LogOut, MessageCircle, Plug, Settings, Sparkles, SunMoon, Users, } from 'lucide-react';
|
|
34
34
|
import { useAi } from '@hanzo/ai/react';
|
|
35
|
-
import { library, nav, NEW, path as written, sections, tabs, useSessions } from '@hanzo/build';
|
|
35
|
+
import { library, MARKS, nav, NEW, path as written, sections, tabs, useSessions } from '@hanzo/build';
|
|
36
36
|
import { nav as made } from '@hanzo/studio';
|
|
37
37
|
import { Dialog, DialogContent, DialogTitle } from '@hanzo/ui';
|
|
38
38
|
import { CommandMenu } from '@hanzo/ui/product/CommandMenu';
|
|
@@ -74,12 +74,12 @@ export function places(host, go, t = english) {
|
|
|
74
74
|
const anon = host?.person === null;
|
|
75
75
|
const builder = (p) => go(app(p));
|
|
76
76
|
const top = [
|
|
77
|
-
{ id: 'chat', label: t('Chat'), icon: _jsx(
|
|
78
|
-
{ id: 'dev', label: 'Dev', icon: _jsx(
|
|
77
|
+
{ id: 'chat', label: t('Chat'), icon: _jsx(MARKS.chat.icon, { ...ICON }), run: () => go(talk()) },
|
|
78
|
+
{ id: 'dev', label: 'Dev', icon: _jsx(MARKS.dev.icon, { ...ICON }), run: () => go(app('')) },
|
|
79
79
|
...(!anon
|
|
80
80
|
? [
|
|
81
|
-
{ id: 'studio', label: 'Studio', icon: _jsx(
|
|
82
|
-
{ id: 'tabs', label: 'Tabs', icon: _jsx(
|
|
81
|
+
{ id: 'studio', label: 'Studio', icon: _jsx(MARKS.studio.icon, { ...ICON }), run: () => go(studio('')) },
|
|
82
|
+
{ id: 'tabs', label: 'Tabs', icon: _jsx(MARKS.tabs.icon, { ...ICON }), run: () => go(TERMINALS) },
|
|
83
83
|
...(host ? [{ id: 'team', label: 'Team', icon: _jsx(Users, { ...ICON }), keywords: ['workspace'], run: () => out(WORKSPACE) }] : []),
|
|
84
84
|
...(host ? rows(nav(host, builder, t).map((g) => ({ links: g.links.filter((l) => l.id !== NEW) })), '', 'dev') : []),
|
|
85
85
|
]
|
|
@@ -138,12 +138,16 @@ function tune(go) {
|
|
|
138
138
|
/** The palette's actions, named through `t`; a host that cannot do one (no theme to change, no org to pick) is not offered it. */
|
|
139
139
|
export function actions(host, go, signOut, keys, t = english) {
|
|
140
140
|
const anon = host?.person === null;
|
|
141
|
-
|
|
141
|
+
// The Library's own acts (@hanzo/build `library`): Make something new and Upload, where the build has them.
|
|
142
|
+
const acts = host && !anon ? (library(host, (p) => go(app(p)), t)[0]?.links ?? []) : [];
|
|
143
|
+
const make = acts.find((l) => l.id === 'make');
|
|
144
|
+
const upload = acts.find((l) => l.id === 'upload');
|
|
142
145
|
const list = [
|
|
143
|
-
{ id: 'new-chat', label: t('New chat'), icon: _jsx(
|
|
144
|
-
{ id: 'new-task', label: t('New Dev task'), icon: _jsx(
|
|
145
|
-
!anon && { id: 'new-creation', label: t('New Studio creation'), icon: _jsx(
|
|
146
|
-
!anon && { id: 'new-scheduled', label: t('New scheduled task'), icon: _jsx(
|
|
146
|
+
{ id: 'new-chat', label: t('New chat'), icon: _jsx(MARKS.chat.make, { ...ICON }), run: () => (empty(), go(talk())) },
|
|
147
|
+
{ id: 'new-task', label: t('New Dev task'), icon: _jsx(MARKS.dev.make, { ...ICON }), keywords: ['run'], run: () => go(app('')) },
|
|
148
|
+
!anon && { id: 'new-creation', label: t('New Studio creation'), icon: _jsx(MARKS.studio.make, { ...ICON }), keywords: ['image', 'video'], run: () => go(studio('')) },
|
|
149
|
+
!anon && { id: 'new-scheduled', label: t('New scheduled task'), icon: _jsx(MARKS.scheduled.icon, { ...ICON }), keywords: ['automation'], run: () => go(app(written({ kind: 'automation', id: 'new' }))) },
|
|
150
|
+
!!make && { id: 'make', label: t('Make something new'), icon: make.icon, keywords: ['template', 'gallery', 'library'], run: () => make.onPress?.() },
|
|
147
151
|
!!upload && { id: 'upload', label: t('Upload'), icon: upload.icon, keywords: ['file', 'library'], run: () => upload.onPress?.() },
|
|
148
152
|
{ id: 'model', label: t('Switch model'), icon: _jsx(Sparkles, { ...ICON }), keywords: ['model'], run: () => tune(go) },
|
|
149
153
|
!!host?.chooseTheme && {
|
|
@@ -238,7 +242,7 @@ export function Search({ onClose, go, actions: frame = [], mode = 'chat', host,
|
|
|
238
242
|
label: tidy(s.title, 80, t('Untitled run')),
|
|
239
243
|
at: s.updatedAt || s.createdAt,
|
|
240
244
|
keywords: [s.status ?? ''],
|
|
241
|
-
icon: _jsx(
|
|
245
|
+
icon: _jsx(MARKS.dev.icon, { ...ICON }),
|
|
242
246
|
run: () => go(app(s.id)),
|
|
243
247
|
}));
|
|
244
248
|
const mine = mode === 'dev'
|
package/dist/SettingsPane.js
CHANGED
|
@@ -101,7 +101,7 @@ function Model() {
|
|
|
101
101
|
].map((opt) => {
|
|
102
102
|
const active = (chatPrefs.approvalMode || 'auto') === opt.id;
|
|
103
103
|
return (_jsxs(Box, { render: _jsx("button", { type: "button" }), ...tap, onClick: () => setChatPrefs({ approvalMode: opt.id }), ...CHOICE, flex: 1, p: 10, bg: active ? 'var(--edge, var(--white-14))' : 'transparent', borderColor: active ? 'var(--borderColor, var(--white-22))' : 'var(--white-08)', children: [_jsxs(XStack, { items: "center", justify: "space-between", children: [_jsx(Text, { fontSize: "$2", fontWeight: "600", color: "$ink", children: opt.label }), active ? _jsx(Check, { size: 12, color: "var(--primary)", "aria-hidden": true }) : null] }), _jsx(Text, { fontSize: "$1", color: "$soft", children: opt.desc })] }, opt.id));
|
|
104
|
-
}) })] }), _jsx(Separator, {}), _jsxs(YStack, { gap: "$3", children: [_jsx(XStack, { items: "center", justify: "space-between", children: _jsxs(YStack, { gap: "$0.5", children: [_jsxs(XStack, { items: "center", gap: "$1.5", children: [_jsx(Text, { fontSize: "$4", fontWeight: "600", color: "$ink", children: t('Advanced composer controls') }), !paid ? (_jsxs(XStack, { items: "center", gap: "$1", px: "$2", py: "$0.5", rounded: 9999, bg: "var(--edge, var(--white-10))", children: [_jsx(Lock, { size: 11, color: "$soft", "aria-hidden": true }), _jsx(Text, { fontSize: "$1", fontWeight: "600", color: "$soft", children: t('Paid plan') })] })) : null] }), _jsx(Text, { fontSize: "$2", color: "$soft", children: t('Third-party model access, and the language dictation listens in.') })] }) }), _jsx(YStack, { p: "$3", rounded: "$3", borderWidth: 1, borderColor: "$borderColor", gap: "$2", children: _jsxs(XStack, { items: "center", justify: "space-between", children: [_jsxs(YStack, { flex: 1, pr: "$2", children: [_jsx(Text, { fontSize: "$3", fontWeight: "600", color: "$ink", children: t('Enable third-party models') }), _jsx(Text, { fontSize: "$2", color: "$soft", children: t('Third-party models (OpenAI, Anthropic, Google, DeepSeek) are
|
|
104
|
+
}) })] }), _jsx(Separator, {}), _jsxs(YStack, { gap: "$3", children: [_jsx(XStack, { items: "center", justify: "space-between", children: _jsxs(YStack, { gap: "$0.5", children: [_jsxs(XStack, { items: "center", gap: "$1.5", children: [_jsx(Text, { fontSize: "$4", fontWeight: "600", color: "$ink", children: t('Advanced composer controls') }), !paid ? (_jsxs(XStack, { items: "center", gap: "$1", px: "$2", py: "$0.5", rounded: 9999, bg: "var(--edge, var(--white-10))", children: [_jsx(Lock, { size: 11, color: "$soft", "aria-hidden": true }), _jsx(Text, { fontSize: "$1", fontWeight: "600", color: "$soft", children: t('Paid plan') })] })) : null] }), _jsx(Text, { fontSize: "$2", color: "$soft", children: t('Third-party model access, and the language dictation listens in.') })] }) }), _jsx(YStack, { p: "$3", rounded: "$3", borderWidth: 1, borderColor: "$borderColor", gap: "$2", children: _jsxs(XStack, { items: "center", justify: "space-between", children: [_jsxs(YStack, { flex: 1, pr: "$2", children: [_jsx(Text, { fontSize: "$3", fontWeight: "600", color: "$ink", children: t('Enable third-party models') }), _jsx(Text, { fontSize: "$2", color: "$soft", children: t('Third-party models (OpenAI, Anthropic, Google, DeepSeek) are paid from your pre-paid balance on any plan. First-party models (Enso, Zen, Kai) are covered by your plan.') })] }), _jsx(Button, { size: "sm", variant: chatPrefs.allowThirdPartyModels ? 'default' : 'outline', onClick: () => setChatPrefs({ allowThirdPartyModels: !chatPrefs.allowThirdPartyModels, thirdPartyChosen: true }), children: chatPrefs.allowThirdPartyModels ? t('Enabled') : t('Disabled') })] }) }), _jsx(YStack, { p: "$3", rounded: "$3", borderWidth: 1, borderColor: "$borderColor", gap: "$2", children: _jsxs(XStack, { items: "center", justify: "space-between", children: [_jsxs(YStack, { flex: 1, pr: "$2", children: [_jsx(Text, { fontSize: "$3", fontWeight: "600", color: "$ink", children: t('Show language selector beside +') }), _jsx(Text, { fontSize: "$2", color: "$soft", children: t('Display the dictation language indicator next to the + context button on the composer row.') })] }), _jsx(Button, { size: "sm", variant: chatPrefs.showLanguage ? 'default' : 'outline', onClick: () => setChatPrefs({ showLanguage: !chatPrefs.showLanguage }), children: chatPrefs.showLanguage ? t('Enabled') : t('Disabled') })] }) }), !paid ? (_jsx(XStack, { pt: "$1", children: _jsxs(Button, { size: "sm", variant: "outline", onClick: () => window.location.assign(site('/pricing')), children: [_jsx(Sparkles, { size: 14, color: "var(--primary)", "aria-hidden": true }), t('Upgrade to unlock advanced model controls')] }) })) : null] })] }));
|
|
105
105
|
}
|
|
106
106
|
/**
|
|
107
107
|
* WHAT THE GATEWAY SERVES, read from the same `/v1/models` the apps read.
|
package/dist/Sidebar.d.ts
CHANGED
|
@@ -2,6 +2,11 @@ import { type Host } from '@hanzo/build';
|
|
|
2
2
|
import { type RailLink } from '@hanzo/ui/chat';
|
|
3
3
|
import { type ReactNode } from 'react';
|
|
4
4
|
import { type Place } from './lib/host.js';
|
|
5
|
+
export declare function dispatchTabsAction(detail: {
|
|
6
|
+
kind: string;
|
|
7
|
+
id?: string;
|
|
8
|
+
machine?: string;
|
|
9
|
+
}): void;
|
|
5
10
|
export declare function Sidebar({ host, mode, thread, go, onShut, onSeek, onBack, drawer, rail, foot, places, }: {
|
|
6
11
|
host: Host;
|
|
7
12
|
mode: Place['mode'];
|
package/dist/Sidebar.js
CHANGED
|
@@ -29,8 +29,8 @@ import { Fragment as _Fragment, jsx as _jsx, jsxs as _jsxs } from "react/jsx-run
|
|
|
29
29
|
import { locales, phrase } from '@hanzo/i18n';
|
|
30
30
|
import { useI18n } from '@hanzo/i18n/react';
|
|
31
31
|
import { Text, XStack, YStack } from '@hanzo/gui';
|
|
32
|
-
import { ArrowLeft, ArrowRight, Bell, ChevronDown, ChevronUp, Cloud, Globe, Image as ImageMark, Monitor, Puzzle, Search, Sparkles
|
|
33
|
-
import { DOTS, Gutter, library, NEW, own, tabs, useLanguage, useScheduled, useSessions } from '@hanzo/build';
|
|
32
|
+
import { ArrowLeft, ArrowRight, Bell, ChevronDown, ChevronUp, Cloud, Globe, Image as ImageMark, Monitor, Puzzle, Search, Sparkles } from 'lucide-react';
|
|
33
|
+
import { DOTS, Gutter, library, MARKS, NEW, own, tabs, useLanguage, useScheduled, useSessions } from '@hanzo/build';
|
|
34
34
|
import { tidy } from './lib/title.js';
|
|
35
35
|
import { Button, DropdownMenu, Switch } from '@hanzo/ui';
|
|
36
36
|
import { Sidebar as Base, SidebarIconButton, SidebarItem, StatusDot } from '@hanzo/ui/chat';
|
|
@@ -76,7 +76,7 @@ const RECENT = 6;
|
|
|
76
76
|
const TITLE = { library: phrase('Library'), scheduled: phrase('Scheduled tasks'), customize: phrase('Customize') };
|
|
77
77
|
/** A header mark: a 16px glyph in a 32px target, a thumb's 44 on a touch screen. */
|
|
78
78
|
const HEAD = { width: 32, height: 32, rounded: '$3', $touchable: { width: 44, height: 44 } };
|
|
79
|
-
function dispatchTabsAction(detail) {
|
|
79
|
+
export function dispatchTabsAction(detail) {
|
|
80
80
|
if (typeof window === 'undefined')
|
|
81
81
|
return;
|
|
82
82
|
window.dispatchEvent(new CustomEvent('hanzo:tabs-action', { detail }));
|
|
@@ -139,7 +139,7 @@ function useTabsGroups(t, active) {
|
|
|
139
139
|
{
|
|
140
140
|
id: 'new-terminal',
|
|
141
141
|
label: t('New terminal'),
|
|
142
|
-
icon: _jsx(
|
|
142
|
+
icon: _jsx(MARKS.tabs.make, { size: 16, "aria-hidden": true }),
|
|
143
143
|
onPress: () => dispatchTabsAction({ kind: 'shell' }),
|
|
144
144
|
},
|
|
145
145
|
{
|
|
@@ -207,7 +207,7 @@ function useTabsGroups(t, active) {
|
|
|
207
207
|
return {
|
|
208
208
|
id: `tab-${id}`,
|
|
209
209
|
label: machine ? `${machine}${name ? ` (${name})` : ''}` : t('Terminal'),
|
|
210
|
-
icon: _jsx(
|
|
210
|
+
icon: _jsx(MARKS.tabs.icon, { size: 16, "aria-hidden": true }),
|
|
211
211
|
onPress: () => dispatchTabsAction({ kind: 'focus', id }),
|
|
212
212
|
};
|
|
213
213
|
});
|
|
@@ -275,6 +275,8 @@ export function Sidebar({ host, mode, thread, go, onShut, onSeek, onBack, drawer
|
|
|
275
275
|
const span = useSpan(SPAN, WIDTH, FLOOR, CEIL);
|
|
276
276
|
const dev = (p) => host.go(p);
|
|
277
277
|
const at = mode === 'dev' ? raised(host.path) : null;
|
|
278
|
+
// A New row that brings no icon of its own wears its mode's `make` mark.
|
|
279
|
+
const Make = mode === 'chat' || mode === 'dev' || mode === 'tabs' || mode === 'studio' ? MARKS[mode].make : MARKS.chat.make;
|
|
278
280
|
// Each place the rail holds lists its own rows: Library its kinds and Upload, Scheduled tasks its tasks and New task.
|
|
279
281
|
const scheduled = useScheduled(host, dev, at === 'scheduled');
|
|
280
282
|
const tabsGroups = useTabsGroups(t, mode === 'tabs');
|
|
@@ -325,7 +327,7 @@ export function Sidebar({ host, mode, thread, go, onShut, onSeek, onBack, drawer
|
|
|
325
327
|
borderColor: 'var(--border-strong)',
|
|
326
328
|
bg: 'var(--pane-fill)',
|
|
327
329
|
}
|
|
328
|
-
: HEAD), children: _jsx(Search, { size: drawer ? 18 : 16, "aria-hidden": true }) }))] })), mode === 'chat' ? (_jsxs(YStack, { role: "list", gap: 2, shrink: 0, pt: drawer ? 0 : 4, children: [_jsx(YStack, { role: "listitem", self: "flex-start", children: _jsx(SidebarItem, { "data-slot": "app-new", ...COMPACT_ROW, active: !thread && !anonSettingsOpen && !anonThreadTitle, bg: "transparent", hoverStyle: { bg: '$hover' }, icon: _jsx(XStack, { width: 20, height: 20, items: "center", justify: "center", shrink: 0, children: _jsx(
|
|
330
|
+
: HEAD), children: _jsx(Search, { size: drawer ? 18 : 16, "aria-hidden": true }) }))] })), mode === 'chat' ? (_jsxs(YStack, { role: "list", gap: 2, shrink: 0, pt: drawer ? 0 : 4, children: [_jsx(YStack, { role: "listitem", self: "flex-start", children: _jsx(SidebarItem, { "data-slot": "app-new", ...COMPACT_ROW, active: !thread && !anonSettingsOpen && !anonThreadTitle, bg: "transparent", hoverStyle: { bg: '$hover' }, icon: _jsx(XStack, { width: 20, height: 20, items: "center", justify: "center", shrink: 0, children: _jsx(MARKS.chat.make, { size: 16, "aria-hidden": true }) }), onPress: create, ...keys(create), children: _jsx(Text, { fontSize: "$3", color: "$ink", children: t('New chat') }) }) }), anon ? (_jsxs(_Fragment, { children: [_jsx(YStack, { role: "listitem", self: "flex-start", children: _jsx(SidebarItem, { "data-slot": "app-images", ...COMPACT_ROW, bg: "transparent", hoverStyle: { bg: '$hover' }, icon: _jsx(XStack, { width: 20, height: 20, items: "center", justify: "center", shrink: 0, children: _jsx(ImageMark, { size: 16, "aria-hidden": true }) }), onPress: () => {
|
|
329
331
|
create();
|
|
330
332
|
if (typeof window !== 'undefined') {
|
|
331
333
|
window.dispatchEvent(new CustomEvent('hanzo:anon-prompt', { detail: { text: t('Create an image of ') } }));
|
|
@@ -345,7 +347,7 @@ export function Sidebar({ host, mode, thread, go, onShut, onSeek, onBack, drawer
|
|
|
345
347
|
if (typeof window !== 'undefined') {
|
|
346
348
|
window.dispatchEvent(new CustomEvent('hanzo:anon-plugins'));
|
|
347
349
|
}
|
|
348
|
-
}), children: _jsx(Text, { fontSize: "$3", color: "$ink", children: t('Plugins') }) }) })] })) : null] })) : mode === 'beta' && !drawer ? null : (_jsx(YStack, { "data-slot": "app-places", shrink: 0, pt: drawer ? 0 : 4, 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", self: "flex-start", children: _jsx(SidebarItem, { ...COMPACT_ROW, "data-place-id": link.id, ...(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(
|
|
350
|
+
}), children: _jsx(Text, { fontSize: "$3", color: "$ink", children: t('Plugins') }) }) })] })) : null] })) : mode === 'beta' && !drawer ? null : (_jsx(YStack, { "data-slot": "app-places", shrink: 0, pt: drawer ? 0 : 4, 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", self: "flex-start", children: _jsx(SidebarItem, { ...COMPACT_ROW, "data-place-id": link.id, ...(link.id === NEW ? { 'data-slot': 'app-new' } : {}), active: link.active, icon: link.icon || link.id === NEW ? (_jsx(XStack, { width: 20, height: 20, items: "center", justify: "center", shrink: 0, children: link.icon ?? _jsx(Make, { size: 16, "aria-hidden": true }) })) : 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, pt: 4 })) : anon && mode === 'chat' && anonThreadTitle ? (_jsxs(YStack, { "data-slot": "recents", flex: 1, minH: 0, pt: "$3", children: [_jsx(Text, { paddingInlineStart: "$2", pb: "$1", fontSize: "$3", color: "$soft", children: t('Recents') }), _jsx(YStack, { role: "list", gap: 1, children: _jsx(YStack, { role: "listitem", children: _jsx(SidebarItem, { ...ROW, active: !anonSettingsOpen, onPress: () => setAnonSettings(false), children: _jsx(Text, { fontSize: "$3", color: "$ink", numberOfLines: 1, children: anonThreadTitle }) }) }) })] })) : mode === 'hosted' || mode === 'beta' || anon || at ? (_jsx(YStack, { flex: 1, minH: 0 })) : (_jsx(Recents, { host: host, mode: mode === 'dev' ? 'dev' : 'chat', thread: thread, onOpen: open, onNew: create })), anon ? (_jsx(YStack, { "data-slot": "anon-foot", gap: "$2", pt: "$2", shrink: 0, z: 10, children: _jsxs(YStack, { "data-slot": "anon-tailored", gap: "$2", pt: "$1", pb: "$1", px: "$2", children: [_jsxs(XStack, { render: "button", "aria-expanded": tailoredOpen, "aria-label": t('Get responses tailored to you'), items: "center", justify: "space-between", gap: "$1.5", cursor: "pointer", onPress: () => setTailoredOpen((v) => !v), hoverStyle: { opacity: 0.85 }, children: [_jsx(Text, { fontSize: 13, lineHeight: 18, fontWeight: "700", color: "$ink", numberOfLines: 1, flex: 1, children: t('Get responses tailored to you') }), tailoredOpen ? (_jsx(ChevronDown, { size: 14, "aria-hidden": true, color: "var(--soft, var(--muted-foreground))" })) : (_jsx(ChevronUp, { size: 14, "aria-hidden": true, color: "var(--soft, var(--muted-foreground))" }))] }), tailoredOpen ? (_jsx(Text, { fontSize: 12, lineHeight: 17, color: "$soft", children: t('Log in to get answers based on saved chats, plus create images and upload files.') })) : null, _jsxs(XStack, { gap: "$2", pt: "$0.5", children: [_jsx(Button, { size: "sm", variant: "outline", flex: 1, rounded: 9999, "data-slot": "column-login", onPress: () => {
|
|
349
351
|
if (typeof window !== 'undefined')
|
|
350
352
|
window.location.assign('/login?next=%2Fchat');
|
|
351
353
|
}, children: t('Log in') }), _jsx(Button, { size: "sm", flex: 1, rounded: 9999, "data-slot": "column-signup", onPress: () => {
|
package/dist/dev.js
CHANGED
|
@@ -41,7 +41,7 @@ import { api } from './lib/api.js';
|
|
|
41
41
|
import { CAST, personas } from './agents.js';
|
|
42
42
|
import { app, place, settings, visit } from './lib/host.js';
|
|
43
43
|
import { link } from './lib/tags.js';
|
|
44
|
-
import { payUrl } from './lib/pay.js';
|
|
44
|
+
import { payUrl, topUp } from './lib/pay.js';
|
|
45
45
|
/** Where the builder links out: every one of them an address of this site. */
|
|
46
46
|
const LINKS = {
|
|
47
47
|
github: app('-/sync'),
|
|
@@ -117,6 +117,7 @@ export function useDevHost() {
|
|
|
117
117
|
admin: administers(bearer(), scoped),
|
|
118
118
|
path: here,
|
|
119
119
|
go: (to, how) => (isPlans(to) ? leave('here') : visit(router, app(to), how?.replace)),
|
|
120
|
+
topUp: signedIn ? topUp : undefined,
|
|
120
121
|
links: LINKS,
|
|
121
122
|
// The sidebar lists Settings' sections and Customize's tabs (Sidebar.tsx), and Customize › Agents offers the cast.
|
|
122
123
|
sections: true,
|
|
@@ -4,6 +4,8 @@ export type ApprovalMode = 'auto' | 'manual';
|
|
|
4
4
|
export declare const DEFAULT_EFFORT: Effort;
|
|
5
5
|
export interface ChatPreferences {
|
|
6
6
|
allowThirdPartyModels: boolean;
|
|
7
|
+
/** The person turned third-party models on or off themselves; until then they are on. */
|
|
8
|
+
thirdPartyChosen?: boolean;
|
|
7
9
|
effort: Effort;
|
|
8
10
|
approvalMode: ApprovalMode;
|
|
9
11
|
showLanguage?: boolean;
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
* What Chat does, kept in this browser. What the composer DRAWS (the key that
|
|
3
3
|
* sends, the chips, the model selector, the mode) is not here: it is one setting
|
|
4
4
|
* for every composer (@hanzo/appearance `composing`, Settings → Appearance).
|
|
5
|
-
* - allowThirdPartyModels: whether 3rd-party models (OpenAI, Anthropic, etc.) are
|
|
5
|
+
* - allowThirdPartyModels: whether 3rd-party models (OpenAI, Anthropic, etc.) are listed. They are paid from the pre-paid balance on any plan, so they are on until the person turns them off (`thirdPartyChosen` says they did)
|
|
6
6
|
* - approvalMode: whether tools/actions run automatically ('auto') or ask for confirmation first ('manual') (default: 'auto')
|
|
7
7
|
* - effort: the reasoning effort a message asks for (default: auto, the router decides)
|
|
8
8
|
* - showLanguage: dictation listens in the person's own language rather than Auto
|
|
@@ -16,7 +16,7 @@ const AUTONOMY_KEY = 'hanzo.agent.autonomy';
|
|
|
16
16
|
const EVENT_NAME = 'hanzo:chat:preferences';
|
|
17
17
|
const EFFORT_SCHEMA_VERSION = 4;
|
|
18
18
|
const DEFAULT_PREFERENCES = {
|
|
19
|
-
allowThirdPartyModels:
|
|
19
|
+
allowThirdPartyModels: true,
|
|
20
20
|
effort: DEFAULT_EFFORT,
|
|
21
21
|
approvalMode: 'auto',
|
|
22
22
|
showLanguage: false,
|
|
@@ -51,7 +51,8 @@ export function getChatPreferences() {
|
|
|
51
51
|
const parsed = JSON.parse(raw);
|
|
52
52
|
const migratedEffort = parsed.effortVersion === EFFORT_SCHEMA_VERSION ? validEffort(parsed.effort) : DEFAULT_EFFORT;
|
|
53
53
|
return {
|
|
54
|
-
allowThirdPartyModels: Boolean(parsed.allowThirdPartyModels),
|
|
54
|
+
allowThirdPartyModels: parsed.thirdPartyChosen ? Boolean(parsed.allowThirdPartyModels) : true,
|
|
55
|
+
...(parsed.thirdPartyChosen ? { thirdPartyChosen: true } : {}),
|
|
55
56
|
effort: migratedEffort,
|
|
56
57
|
approvalMode: validApprovalMode(parsed.approvalMode, autonomy),
|
|
57
58
|
showLanguage: Boolean(parsed.showLanguage),
|
package/dist/lib/pay.d.ts
CHANGED
|
@@ -48,6 +48,14 @@ export declare function checkoutUrl(id?: string, back?: string): string;
|
|
|
48
48
|
export declare function payPage(path?: string): string;
|
|
49
49
|
/** The pay address with its query, written in one place for both callers above. */
|
|
50
50
|
export declare function payUrl(path: string, query: Record<string, string | null | undefined>): string;
|
|
51
|
+
/**
|
|
52
|
+
* The plain top-up (no plan): pay's amount page for the card, for the organization in
|
|
53
|
+
* use, coming back to this page with the model it was for (`?model=`) so the chat
|
|
54
|
+
* resumes on it. Another maker's models are paid from this balance on any plan.
|
|
55
|
+
*/
|
|
56
|
+
export declare function topUpUrl(model?: string): string;
|
|
57
|
+
/** Leaves for the top-up. */
|
|
58
|
+
export declare function topUp(model?: string): void;
|
|
51
59
|
export declare const dollars: (n: number) => string;
|
|
52
60
|
/**
|
|
53
61
|
* Money as a sentence says it. English stays `$20` or `$16.67`. Any other
|
package/dist/lib/pay.js
CHANGED
|
@@ -66,6 +66,21 @@ export function payUrl(path, query) {
|
|
|
66
66
|
return at;
|
|
67
67
|
return `${at}${path}${s ? `?${s}` : ""}`;
|
|
68
68
|
}
|
|
69
|
+
/**
|
|
70
|
+
* The plain top-up (no plan): pay's amount page for the card, for the organization in
|
|
71
|
+
* use, coming back to this page with the model it was for (`?model=`) so the chat
|
|
72
|
+
* resumes on it. Another maker's models are paid from this balance on any plan.
|
|
73
|
+
*/
|
|
74
|
+
export function topUpUrl(model) {
|
|
75
|
+
const back = new URL(window.location.href);
|
|
76
|
+
if (model)
|
|
77
|
+
back.searchParams.set("model", model);
|
|
78
|
+
return payUrl("/amount/card", { org: org(), returnUrl: back.toString() });
|
|
79
|
+
}
|
|
80
|
+
/** Leaves for the top-up. */
|
|
81
|
+
export function topUp(model) {
|
|
82
|
+
window.location.assign(topUpUrl(model));
|
|
83
|
+
}
|
|
69
84
|
export const dollars = (n) => `$${n.toFixed(2)}`;
|
|
70
85
|
/**
|
|
71
86
|
* Money as a sentence says it. English stays `$20` or `$16.67`. Any other
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@hanzo/app",
|
|
3
|
-
"version": "0.3.
|
|
3
|
+
"version": "0.3.53",
|
|
4
4
|
"description": "Hanzo's app: the shell and its apps (Home, Chat, Inbox, Contacts, Meet, Calendar, Drive, Board, Work, Bots), once, for every Hanzo surface.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/index.js",
|
|
@@ -51,7 +51,7 @@
|
|
|
51
51
|
"peerDependencies": {
|
|
52
52
|
"@hanzo/ai": ">=0.7.0",
|
|
53
53
|
"@hanzo/appearance": ">=0.2.13",
|
|
54
|
-
"@hanzo/build": ">=0.2.
|
|
54
|
+
"@hanzo/build": ">=0.2.120",
|
|
55
55
|
"@hanzo/composer": ">=0.2.0",
|
|
56
56
|
"@hanzo/design": ">=0.5.39",
|
|
57
57
|
"@hanzo/event": ">=0.3.56",
|
|
@@ -61,7 +61,7 @@
|
|
|
61
61
|
"@hanzo/logo": ">=1.0.26",
|
|
62
62
|
"@hanzo/studio": ">=0.1.0",
|
|
63
63
|
"@hanzo/tabs": ">=0.1.8",
|
|
64
|
-
"@hanzo/ui": ">=8.
|
|
64
|
+
"@hanzo/ui": ">=8.30.4",
|
|
65
65
|
"@hanzo/usage": ">=0.1.18",
|
|
66
66
|
"@hanzo/voice": ">=0.1.16",
|
|
67
67
|
"@hanzogui/shell": "^8.3.20",
|
|
@@ -72,7 +72,7 @@
|
|
|
72
72
|
"devDependencies": {
|
|
73
73
|
"@hanzo/ai": "0.7.0",
|
|
74
74
|
"@hanzo/appearance": "0.2.14",
|
|
75
|
-
"@hanzo/build": "
|
|
75
|
+
"@hanzo/build": "0.2.120",
|
|
76
76
|
"@hanzo/composer": "0.2.0",
|
|
77
77
|
"@hanzo/design": "0.5.39",
|
|
78
78
|
"@hanzo/event": "0.3.56",
|
|
@@ -82,7 +82,7 @@
|
|
|
82
82
|
"@hanzo/logo": "1.0.26",
|
|
83
83
|
"@hanzo/studio": "0.1.0",
|
|
84
84
|
"@hanzo/tabs": "github:hanzo-inc/tabs",
|
|
85
|
-
"@hanzo/ui": "
|
|
85
|
+
"@hanzo/ui": "8.30.4",
|
|
86
86
|
"@hanzo/usage": "0.1.18",
|
|
87
87
|
"@hanzo/voice": "0.1.19",
|
|
88
88
|
"@hanzogui/config": "8.3.5",
|