@hanzo/app 0.3.56 → 0.3.58
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/Chat.js +4 -4
- package/dist/NeedMoreUsage.d.ts +2 -2
- package/dist/NeedMoreUsage.js +2 -2
- package/dist/Shell.js +6 -3
- package/dist/Upgrade.js +9 -9
- package/dist/lib/destination.js +2 -2
- package/dist/lib/host.d.ts +10 -10
- package/dist/lib/host.js +22 -15
- package/dist/lib/limits.d.ts +8 -4
- package/dist/lib/limits.js +9 -5
- package/package.json +1 -1
package/dist/Chat.js
CHANGED
|
@@ -49,7 +49,7 @@ import { bearer, hasSession, named, org } from "./lib/session.js";
|
|
|
49
49
|
import { api } from "./lib/api.js";
|
|
50
50
|
import { app, dev, follow, go } from "./lib/host.js";
|
|
51
51
|
import { useHost } from "./host.js";
|
|
52
|
-
import { chats, house, paidPlan, paused, setCreditsAfterAllowance, spends,
|
|
52
|
+
import { chats, house, paidPlan, paused, setCreditsAfterAllowance, spends, uncapped, useLimits } from "./lib/limits.js";
|
|
53
53
|
import { LimitedBanner } from "@hanzo/ui/product/LimitedBanner";
|
|
54
54
|
import { NeedMoreUsageBanner, NeedMoreUsageModal } from "./NeedMoreUsage.js";
|
|
55
55
|
import { WEB } from "./lib/web.js";
|
|
@@ -823,7 +823,7 @@ function Thread({ placeholder = message(), initial, anonymous = false, settled =
|
|
|
823
823
|
const [shut, setShut] = useState(null);
|
|
824
824
|
const which = pause ? `${kept ?? open ?? ""}:${chat.messages[chat.messages.length - 1]?.id ?? ""}` : null;
|
|
825
825
|
const banner = which !== shut ? spent : null;
|
|
826
|
-
const isUsageLimitReached = Boolean(pause && (spends(pause.reason) || !pause.reason) && !
|
|
826
|
+
const isUsageLimitReached = Boolean(pause && (spends(pause.reason) || !pause.reason) && !uncapped(limits));
|
|
827
827
|
const [needMoreUsageOpen, setNeedMoreUsageOpen] = useState(false);
|
|
828
828
|
const [simulatedResetAt, setSimulatedResetAt] = useState(null);
|
|
829
829
|
const seenUsageLimit = useRef(null);
|
|
@@ -1722,7 +1722,7 @@ function Thread({ placeholder = message(), initial, anonymous = false, settled =
|
|
|
1722
1722
|
: failed.empty
|
|
1723
1723
|
? t("{model} answered with nothing.", { model: nameOf(model, listed) })
|
|
1724
1724
|
: bill
|
|
1725
|
-
? spent?.message ?? (spends(bill.code) ? (
|
|
1725
|
+
? spent?.message ?? (spends(bill.code) ? (uncapped(limits) ? t("Your balance is empty.") : t("Usage reached.")) : bill.message || plainly(wrong, t("this conversation"), t))
|
|
1726
1726
|
: resign
|
|
1727
1727
|
? t(anonymous
|
|
1728
1728
|
? "Sign in to ask this."
|
|
@@ -1820,7 +1820,7 @@ function Thread({ placeholder = message(), initial, anonymous = false, settled =
|
|
|
1820
1820
|
},
|
|
1821
1821
|
// WHAT GOES WITH THE MESSAGE, above the frame and at its width: the
|
|
1822
1822
|
// pause and its ways past, one chip a file, and talk mode's words.
|
|
1823
|
-
head: files.length || turnedAway || prepWrong || preparing || talk.open || talk.refusal || pause || simulatedResetAt ? (_jsxs(_Fragment, { children: [(banner && isUsageLimitReached) || simulatedResetAt ? (_jsx(NeedMoreUsageBanner, { resetsAt: pause?.resets_at ?? simulatedResetAt, fallbackModel: pause?.fallback ? nameOf(pause.fallback, listed) : null,
|
|
1823
|
+
head: files.length || turnedAway || prepWrong || preparing || talk.open || talk.refusal || pause || simulatedResetAt ? (_jsxs(_Fragment, { children: [(banner && isUsageLimitReached) || simulatedResetAt ? (_jsx(NeedMoreUsageBanner, { resetsAt: pause?.resets_at ?? simulatedResetAt, fallbackModel: pause?.fallback ? nameOf(pause.fallback, listed) : null, isUncapped: uncapped(limits), customMessage: banner?.message ?? null, onGetMoreUsage: () => setNeedMoreUsageOpen(true), onSeeUsage: () => showSettings("usage") })) : 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
|
|
1824
1824
|
? worded(talk.refusal)
|
|
1825
1825
|
: talk.reply
|
|
1826
1826
|
? `Hanzo: ${talk.reply}`
|
package/dist/NeedMoreUsage.d.ts
CHANGED
|
@@ -7,12 +7,12 @@ export declare function formatResetParts(iso: string | null | undefined, now?: n
|
|
|
7
7
|
export interface NeedMoreUsageBannerProps {
|
|
8
8
|
resetsAt?: string | null;
|
|
9
9
|
fallbackModel?: string | null;
|
|
10
|
-
|
|
10
|
+
isUncapped?: boolean;
|
|
11
11
|
customMessage?: string | null;
|
|
12
12
|
onGetMoreUsage: () => void;
|
|
13
13
|
onSeeUsage: () => void;
|
|
14
14
|
}
|
|
15
|
-
export declare function NeedMoreUsageBanner({ resetsAt, fallbackModel,
|
|
15
|
+
export declare function NeedMoreUsageBanner({ resetsAt, fallbackModel, isUncapped, customMessage, onGetMoreUsage, onSeeUsage, }: NeedMoreUsageBannerProps): import("react").JSX.Element;
|
|
16
16
|
export interface NeedMoreUsageModalProps {
|
|
17
17
|
open: boolean;
|
|
18
18
|
onClose: () => void;
|
package/dist/NeedMoreUsage.js
CHANGED
|
@@ -38,10 +38,10 @@ function HandCoinMeterIcon() {
|
|
|
38
38
|
function TeamTrendIcon() {
|
|
39
39
|
return (_jsxs("svg", { width: "44", height: "40", viewBox: "0 0 44 40", fill: "none", xmlns: "http://www.w3.org/2000/svg", "aria-hidden": "true", children: [_jsx("line", { x1: "8.2", y1: "30.2", x2: "15.3", y2: "19.8", stroke: "var(--foreground)", strokeWidth: "1.5", strokeLinecap: "round" }), _jsx("line", { x1: "19.2", y1: "18.8", x2: "25.8", y2: "22.2", stroke: "var(--foreground)", strokeWidth: "1.5", strokeLinecap: "round" }), _jsx("line", { x1: "29.3", y1: "21.0", x2: "36.5", y2: "10.5", stroke: "var(--foreground)", strokeWidth: "1.5", strokeLinecap: "round" }), _jsx("path", { d: "M31.5 10H37V15.5", stroke: "var(--foreground)", strokeWidth: "1.5", strokeLinecap: "round", strokeLinejoin: "round" }), _jsx("circle", { cx: "6.5", cy: "32.5", r: "2.5", stroke: "var(--foreground)", strokeWidth: "1.5", fill: "var(--card)" }), _jsx("circle", { cx: "17", cy: "17.5", r: "2.5", stroke: "var(--foreground)", strokeWidth: "1.5", fill: "var(--card)" }), _jsx("circle", { cx: "28", cy: "23.5", r: "2.5", stroke: "var(--foreground)", strokeWidth: "1.5", fill: "var(--card)" })] }));
|
|
40
40
|
}
|
|
41
|
-
export function NeedMoreUsageBanner({ resetsAt, fallbackModel,
|
|
41
|
+
export function NeedMoreUsageBanner({ resetsAt, fallbackModel, isUncapped, customMessage, onGetMoreUsage, onSeeUsage, }) {
|
|
42
42
|
const { t } = useI18n();
|
|
43
43
|
const reset = formatResetParts(resetsAt);
|
|
44
|
-
const headlinePrefix =
|
|
44
|
+
const headlinePrefix = isUncapped
|
|
45
45
|
? t("Your balance is empty")
|
|
46
46
|
: customMessage && !resetsAt
|
|
47
47
|
? customMessage.replace(/\.$/, "")
|
package/dist/Shell.js
CHANGED
|
@@ -79,7 +79,7 @@ import { Face } from "./cast.js";
|
|
|
79
79
|
import { useStarred, titleOf } from "./stars.js";
|
|
80
80
|
import { channelName } from "./network.js";
|
|
81
81
|
import { useChannels, teamKey, channelHref } from "./channels.js";
|
|
82
|
-
import { apex, app, away, dev, ENTRY, leaves, WORKSPACE } from "./lib/host.js";
|
|
82
|
+
import { apex, app, away, chat, CHAT as TALK, dev, ENTRY, leaves, WORKSPACE } from "./lib/host.js";
|
|
83
83
|
import { netKey } from "./conversations.js";
|
|
84
84
|
import { FIRST, SettingsList, } from "./Settings.js";
|
|
85
85
|
import { Search } from "./Search.js";
|
|
@@ -167,7 +167,10 @@ const HOME = {
|
|
|
167
167
|
*/
|
|
168
168
|
const CHAT = {
|
|
169
169
|
id: "chat",
|
|
170
|
-
|
|
170
|
+
// Chat's own address: `/` on the app's host, /chat elsewhere (lib/host `chat`).
|
|
171
|
+
get route() {
|
|
172
|
+
return chat();
|
|
173
|
+
},
|
|
171
174
|
get name() {
|
|
172
175
|
return brand();
|
|
173
176
|
},
|
|
@@ -1468,5 +1471,5 @@ function Frame({ mode, children, navigate, back, forward, }) {
|
|
|
1468
1471
|
setPeeking(false);
|
|
1469
1472
|
}, children: list })) : null, _jsx(Split, { swap: settingsPane ? _jsx(Suspense, { fallback: null, children: _jsx(SettingsPane, { id: settingsPane }) }) : undefined, children: children }), finding ? (_jsx(Search, { actions: doors, onClose: found,
|
|
1470
1473
|
// A chat opens in this workspace's Chat, the palette having picked it; the rest is the app's.
|
|
1471
|
-
go: (to) => navigate?.(to.startsWith(
|
|
1474
|
+
go: (to) => navigate?.(to.startsWith(TALK) ? chat() : site(to)) })) : null] }));
|
|
1472
1475
|
}
|
package/dist/Upgrade.js
CHANGED
|
@@ -11,7 +11,7 @@ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
|
11
11
|
// in-card seat types (Standard & Premium), and enterprise notice at the bottom.
|
|
12
12
|
import { useEffect, useState } from 'react';
|
|
13
13
|
import { useI18n } from '@hanzo/i18n/react';
|
|
14
|
-
import { BarChart2, Check, Cpu, Crown,
|
|
14
|
+
import { BarChart2, Check, Cpu, Crown, Gem, Layers, Link2, Lock, Rocket, ShieldCheck, Sliders, Sparkles, Sprout, Users, Workflow, X, Zap, } from 'lucide-react';
|
|
15
15
|
import { Anchor, Box, Button, Dialog, DialogContent, DialogTitle, Text, View, XStack, YStack } from '@hanzo/ui';
|
|
16
16
|
import { track } from './lib/tags.js';
|
|
17
17
|
import { org } from './lib/session.js';
|
|
@@ -43,7 +43,7 @@ function here() {
|
|
|
43
43
|
}
|
|
44
44
|
const MULTIPLIERS = {
|
|
45
45
|
'3x': {
|
|
46
|
-
id: 'pro-
|
|
46
|
+
id: 'pro-3x',
|
|
47
47
|
name: 'Pro',
|
|
48
48
|
multiple: '3×',
|
|
49
49
|
price: 15,
|
|
@@ -58,16 +58,16 @@ const MULTIPLIERS = {
|
|
|
58
58
|
price: 45,
|
|
59
59
|
icon: Cpu,
|
|
60
60
|
subtitle: '5× higher limits for autonomous coding agents.',
|
|
61
|
-
bots:
|
|
61
|
+
bots: 2,
|
|
62
62
|
},
|
|
63
63
|
'15x': {
|
|
64
|
-
id: 'max-
|
|
64
|
+
id: 'max-15x',
|
|
65
65
|
name: 'Max',
|
|
66
66
|
multiple: '15×',
|
|
67
67
|
price: 95,
|
|
68
68
|
icon: Crown,
|
|
69
69
|
subtitle: '15× limits for heavy continuous coding sessions.',
|
|
70
|
-
bots:
|
|
70
|
+
bots: 5,
|
|
71
71
|
},
|
|
72
72
|
};
|
|
73
73
|
export function Upgrade({ ask, onClose }) {
|
|
@@ -108,9 +108,9 @@ export function Upgrade({ ask, onClose }) {
|
|
|
108
108
|
};
|
|
109
109
|
const activeMultiplier = MULTIPLIERS[multiplier];
|
|
110
110
|
const goHref = term(payUrl('/cart', { plan: 'go', org: org(), returnUrl: here() }), 'month');
|
|
111
|
-
const proHref = term(payUrl('/cart', { plan: 'pro-
|
|
111
|
+
const proHref = term(payUrl('/cart', { plan: 'pro-3x', org: org(), returnUrl: here() }), 'month');
|
|
112
112
|
const devHref = term(payUrl('/cart', { plan: 'dev-5x', org: org(), returnUrl: here() }), 'month');
|
|
113
|
-
const maxHref = term(payUrl('/cart', { plan: 'max-
|
|
113
|
+
const maxHref = term(payUrl('/cart', { plan: 'max-15x', org: org(), returnUrl: here() }), 'month');
|
|
114
114
|
const multiplierHref = term(payUrl('/cart', { plan: activeMultiplier.id, org: org(), returnUrl: here() }), 'month');
|
|
115
115
|
const ultraHref = term(payUrl('/cart', { plan: 'ultra', org: org(), returnUrl: here() }), 'month');
|
|
116
116
|
const businessHref = term(payUrl('/cart', { plan: 'team', quantity: '5', org: org(), returnUrl: here() }), businessCycle);
|
|
@@ -127,14 +127,14 @@ export function Upgrade({ ask, onClose }) {
|
|
|
127
127
|
t('Community support'),
|
|
128
128
|
].map((feat) => (_jsxs(XStack, { items: "center", gap: "$2.5", children: [_jsx(Check, { size: 16, color: SOFT, "aria-hidden": true }), _jsx(Text, { fontSize: 13, color: "$ink", children: feat })] }, feat))) })] }) }), _jsx(YStack, { bg: "var(--surface-card-emphasis)", borderWidth: 1.5, borderColor: "var(--border-selected)", rounded: "$6", p: "$6", gap: "$4", justify: "space-between", boxShadow: "var(--shadow-lg)", 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: INK, "aria-hidden": true }), _jsx(Text, { fontSize: 16, fontWeight: "700", color: "$ink", children: activeMultiplier.name })] }), _jsx(XStack, { items: "center", bg: "var(--secondary)", p: 2, rounded: "$10", gap: 1, borderWidth: 1, borderColor: "var(--border)", children: ['3x', '5x', '15x'].map((m) => (_jsx(Box, { render: "button", onClick: () => setMultiplier(m), bg: multiplier === m ? 'var(--card)' : '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 ? '$ink' : '$soft', 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: "$soft", children: t(activeMultiplier.subtitle) })] }), _jsxs(Anchor, { href: multiplierHref, onPress: () => handleBuy(activeMultiplier.id, activeMultiplier.name, activeMultiplier.price), bg: "var(--primary)", hoverStyle: { bg: 'var(--primary-hover)' }, rounded: "$10", width: "100%", py: "$3", my: "$1", color: "var(--primary-foreground)", fontWeight: "600", fontSize: 14, text: "center", textDecorationLine: "none", items: "center", justify: "center", gap: "$2", children: [_jsx(Sparkles, { size: 16, color: "var(--primary-foreground)", "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: "$soft", children: t('/ month') })] }), _jsx(YStack, { gap: "$2.5", pt: "$1", children: [
|
|
129
129
|
t('Everything in Free, plus:'),
|
|
130
|
-
t('{multiple} more usage than
|
|
130
|
+
t('{multiple} more usage than Go', { multiple: activeMultiplier.multiple }),
|
|
131
131
|
t('Access to Enso Ultra, Kai, and frontier models'),
|
|
132
132
|
t('Build apps with Hanzo Dev & CLI'),
|
|
133
133
|
t('Connect any MCP server'),
|
|
134
134
|
t('Background agents & automations'),
|
|
135
135
|
t('Hanzo Bot: {bots} custom {bots, plural, one {bot} other {bots}}', { bots: activeMultiplier.bots }),
|
|
136
136
|
t('Dedicated priority support'),
|
|
137
|
-
].map((feat, idx) => (_jsxs(XStack, { items: "center", gap: "$2.5", children: [_jsx(Check, { size: 16, color: INK, "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: "var(--glass)", hoverStyle: { bg: 'var(--glass-strong)' }, px: "$4", py: "$2", rounded: "$10", borderWidth: 1, borderColor: "var(--border)", cursor: "pointer", children: _jsx(Text, { fontSize: 13, fontWeight: "500", color: "$ink", children: t('Show all plans (Free, Go, Pro, Dev, Max, Ultra) ↓') }) }) })] })) : (_jsxs(YStack, { gap: "$4", width: "100%", children: [_jsxs(View, { display: "grid", gridTemplateColumns: "repeat(auto-fit, minmax(220px, 1fr))", gap: 14, width: "100%", items: "stretch", children: [_jsx(YStack, { bg: "var(--surface-card-quiet)", borderWidth: 1, borderColor: "var(--border)", 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: SOFT, "aria-hidden": true }), _jsx(Text, { fontSize: 12, fontWeight: "600", color: "$soft", children: t('Free') })] }), _jsx(Text, { fontSize: 18, fontWeight: "700", color: "$ink", children: t('Try Hanzo') }), _jsx(Text, { fontSize: 12, color: "$soft", minH: 32, children: t('See what AI can do.') }), _jsx(Button, { disabled: true, variant: "outline", rounded: "$10", py: "$1.5", borderColor: "var(--border-control)", bg: "transparent", cursor: "default", children: _jsx(Text, { fontSize: 12, fontWeight: "500", color: "$soft", 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: "$soft", 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: SOFT, "aria-hidden": true }), _jsx(Text, { fontSize: 11, color: "$ink", children: f })] }, f))) })] }) }), _jsx(YStack, { bg: "var(--surface-card-quiet)", borderWidth: 1, borderColor: "var(--border)", 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: INK, "aria-hidden": true }), _jsx(Text, { fontSize: 12, fontWeight: "600", color: "$soft", children: t('Go') })] }), _jsx(Text, { fontSize: 18, fontWeight: "700", color: "$ink", children: t('Everyday AI') }), _jsx(Text, { fontSize: 12, color: "$soft", 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: "var(--primary-foreground)", 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: "$soft", 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: INK, "aria-hidden": true }), _jsx(Text, { fontSize: 11, color: "$ink", children: f })] }, f))) })] }) }), _jsx(YStack, { bg: "var(--surface-card)", borderWidth: 1.5, borderColor: "var(--border-selected)", 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: INK, "aria-hidden": true }), _jsx(Text, { fontSize: 12, fontWeight: "700", color: "$ink", children: t('Pro 3×') })] }), _jsx(Text, { fontSize: 18, fontWeight: "700", color: "$ink", children: t('Pro') }), _jsx(Text, { fontSize: 12, color: "$soft", minH: 32, children: t('3× limits for builders.') }), _jsx(Anchor, { href: proHref, onPress: () => handleBuy('pro-2x', 'Pro', 15), bg: "var(--primary)", rounded: "$10", py: "$1.5", px: "$3", color: "var(--primary-foreground)", 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: "$soft", children: t('/ mo') })] }), _jsx(YStack, { gap: "$1.5", pt: "$1", children: [t('3× more usage than Go'), t('3× 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: INK, "aria-hidden": true }), _jsx(Text, { fontSize: 11, color: "$ink", children: f })] }, f))) })] }) }), _jsx(YStack, { bg: "var(--surface-card-quiet)", borderWidth: 1, borderColor: "var(--border)", 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: INK, "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: "$soft", 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: "var(--primary-foreground)", 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: "$soft", 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: INK, "aria-hidden": true }), _jsx(Text, { fontSize: 11, color: "$ink", children: f })] }, f))) })] }) }), _jsx(YStack, { bg: "var(--surface-card-quiet)", borderWidth: 1, borderColor: "var(--border)", 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: INK, "aria-hidden": true }), _jsx(Text, { fontSize: 12, fontWeight: "700", color: "$ink", children: t('Max 15×') })] }), _jsx(Text, { fontSize: 18, fontWeight: "700", color: "$ink", children: t('Max') }), _jsx(Text, { fontSize: 12, color: "$soft", minH: 32, children: t('15× continuous limits.') }), _jsx(Anchor, { href: maxHref, onPress: () => handleBuy('max-10x', 'Max', 95), bg: "var(--primary)", rounded: "$10", py: "$1.5", px: "$3", color: "var(--primary-foreground)", 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: "$soft", children: t('/ mo') })] }), _jsx(YStack, { gap: "$1.5", pt: "$1", children: [t('15× more usage than Go'), t('15× 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: INK, "aria-hidden": true }), _jsx(Text, { fontSize: 11, color: "$ink", children: f })] }, f))) })] }) }), _jsx(YStack, { bg: "var(--surface-card-quiet)", borderWidth: 1, borderColor: "var(--border)", 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: INK, "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: "$soft", minH: 32, children: t('Unlimited intelligence.') }), _jsx(Anchor, { href: ultraHref, onPress: () => handleBuy('ultra', 'Ultra', 195), bg: "var(--secondary)", rounded: "$10", py: "$1.5", px: "$3", color: "$ink", 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: "$soft", 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: INK, "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: '$hover' }, px: "$4", py: "$2", rounded: "$10", borderWidth: 1, borderColor: "var(--border)", cursor: "pointer", children: _jsx(Text, { fontSize: 13, fontWeight: "500", color: "$soft", children: t('Show fewer plans ↑') }) }) })] }))) : (_jsxs(YStack, { gap: "$4", width: "100%", children: [_jsxs(View, { display: "grid", gridTemplateColumns: "repeat(auto-fit, minmax(320px, 1fr))", gap: 24, width: "100%", items: "stretch", children: [_jsx(YStack, { bg: "var(--surface-card-quiet)", borderWidth: 1, borderColor: "var(--border)", rounded: "$6", p: "$6", gap: "$5", justify: "space-between", children: _jsxs(YStack, { gap: "$3.5", children: [_jsx(Text, { fontSize: 14, fontWeight: "500", color: "$soft", 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: "$soft", children: t('See what AI can do.') })] }), _jsx(Button, { disabled: true, variant: "outline", rounded: "$10", width: "100%", py: "$2.5", my: "$2", borderColor: "var(--border-control)", bg: "transparent", cursor: "default", children: _jsx(Text, { fontSize: 14, fontWeight: "500", color: "$soft", 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: "$soft", children: t('/ month') })] }), _jsx(YStack, { gap: "$3", pt: "$3", children: [
|
|
137
|
+
].map((feat, idx) => (_jsxs(XStack, { items: "center", gap: "$2.5", children: [_jsx(Check, { size: 16, color: INK, "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: "var(--glass)", hoverStyle: { bg: 'var(--glass-strong)' }, px: "$4", py: "$2", rounded: "$10", borderWidth: 1, borderColor: "var(--border)", cursor: "pointer", children: _jsx(Text, { fontSize: 13, fontWeight: "500", color: "$ink", children: t('Show all plans (Free, Go, Pro, Dev, Max, Ultra) ↓') }) }) })] })) : (_jsxs(YStack, { gap: "$4", width: "100%", children: [_jsxs(View, { display: "grid", gridTemplateColumns: "repeat(auto-fit, minmax(220px, 1fr))", gap: 14, width: "100%", items: "stretch", children: [_jsx(YStack, { bg: "var(--surface-card-quiet)", borderWidth: 1, borderColor: "var(--border)", 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: SOFT, "aria-hidden": true }), _jsx(Text, { fontSize: 12, fontWeight: "600", color: "$soft", children: t('Free') })] }), _jsx(Text, { fontSize: 18, fontWeight: "700", color: "$ink", children: t('Try Hanzo') }), _jsx(Text, { fontSize: 12, color: "$soft", minH: 32, children: t('See what AI can do.') }), _jsx(Button, { disabled: true, variant: "outline", rounded: "$10", py: "$1.5", borderColor: "var(--border-control)", bg: "transparent", cursor: "default", children: _jsx(Text, { fontSize: 12, fontWeight: "500", color: "$soft", 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: "$soft", 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: SOFT, "aria-hidden": true }), _jsx(Text, { fontSize: 11, color: "$ink", children: f })] }, f))) })] }) }), _jsx(YStack, { bg: "var(--surface-card-quiet)", borderWidth: 1, borderColor: "var(--border)", 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: INK, "aria-hidden": true }), _jsx(Text, { fontSize: 12, fontWeight: "600", color: "$soft", children: t('Go') })] }), _jsx(Text, { fontSize: 18, fontWeight: "700", color: "$ink", children: t('Everyday AI') }), _jsx(Text, { fontSize: 12, color: "$soft", 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: "var(--primary-foreground)", 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: "$soft", 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: INK, "aria-hidden": true }), _jsx(Text, { fontSize: 11, color: "$ink", children: f })] }, f))) })] }) }), _jsx(YStack, { bg: "var(--surface-card)", borderWidth: 1.5, borderColor: "var(--border-selected)", 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: INK, "aria-hidden": true }), _jsx(Text, { fontSize: 12, fontWeight: "700", color: "$ink", children: t('Pro 3×') })] }), _jsx(Text, { fontSize: 18, fontWeight: "700", color: "$ink", children: t('Pro') }), _jsx(Text, { fontSize: 12, color: "$soft", minH: 32, children: t('3× limits for builders.') }), _jsx(Anchor, { href: proHref, onPress: () => handleBuy('pro-3x', 'Pro', 15), bg: "var(--primary)", rounded: "$10", py: "$1.5", px: "$3", color: "var(--primary-foreground)", 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: "$soft", children: t('/ mo') })] }), _jsx(YStack, { gap: "$1.5", pt: "$1", children: [t('3× more usage than Go'), t('3× 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: INK, "aria-hidden": true }), _jsx(Text, { fontSize: 11, color: "$ink", children: f })] }, f))) })] }) }), _jsx(YStack, { bg: "var(--surface-card-quiet)", borderWidth: 1, borderColor: "var(--border)", 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: INK, "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: "$soft", 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: "var(--primary-foreground)", 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: "$soft", children: t('/ mo') })] }), _jsx(YStack, { gap: "$1.5", pt: "$1", children: [t('5× more usage than Go'), t('5× higher 5h limits'), t('2 custom Hanzo Bots'), t('Train custom models')].map((f) => (_jsxs(XStack, { items: "center", gap: "$1.5", children: [_jsx(Check, { size: 13, color: INK, "aria-hidden": true }), _jsx(Text, { fontSize: 11, color: "$ink", children: f })] }, f))) })] }) }), _jsx(YStack, { bg: "var(--surface-card-quiet)", borderWidth: 1, borderColor: "var(--border)", 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: INK, "aria-hidden": true }), _jsx(Text, { fontSize: 12, fontWeight: "700", color: "$ink", children: t('Max 15×') })] }), _jsx(Text, { fontSize: 18, fontWeight: "700", color: "$ink", children: t('Max') }), _jsx(Text, { fontSize: 12, color: "$soft", minH: 32, children: t('15× continuous limits.') }), _jsx(Anchor, { href: maxHref, onPress: () => handleBuy('max-15x', 'Max', 95), bg: "var(--primary)", rounded: "$10", py: "$1.5", px: "$3", color: "var(--primary-foreground)", 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: "$soft", children: t('/ mo') })] }), _jsx(YStack, { gap: "$1.5", pt: "$1", children: [t('15× more usage than Go'), t('15× higher 5h limits'), t('5 custom Hanzo Bots'), t('Dedicated support')].map((f) => (_jsxs(XStack, { items: "center", gap: "$1.5", children: [_jsx(Check, { size: 13, color: INK, "aria-hidden": true }), _jsx(Text, { fontSize: 11, color: "$ink", children: f })] }, f))) })] }) }), _jsx(YStack, { bg: "var(--surface-card-quiet)", borderWidth: 1, borderColor: "var(--border)", rounded: "$6", p: "$4", justify: "space-between", gap: "$3", children: _jsxs(YStack, { gap: "$2", children: [_jsxs(XStack, { items: "center", gap: "$1.5", children: [_jsx(Gem, { size: 15, color: INK, "aria-hidden": true }), _jsx(Text, { fontSize: 12, fontWeight: "700", color: "$ink", children: t('Ultra 25×') })] }), _jsx(Text, { fontSize: 18, fontWeight: "700", color: "$ink", children: t('Frontier Scale') }), _jsx(Text, { fontSize: 12, color: "$soft", minH: 32, children: t('25× limits for the biggest workloads.') }), _jsx(Anchor, { href: ultraHref, onPress: () => handleBuy('ultra', 'Ultra', 195), bg: "var(--secondary)", rounded: "$10", py: "$1.5", px: "$3", color: "$ink", 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: "$soft", children: t('/ mo') })] }), _jsx(YStack, { gap: "$1.5", pt: "$1", children: [t('25× more usage than Go'), t('25× higher 5h limits'), t('10 custom Hanzo Bots'), t('Engineering Slack')].map((f) => (_jsxs(XStack, { items: "center", gap: "$1.5", children: [_jsx(Check, { size: 13, color: INK, "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: '$hover' }, px: "$4", py: "$2", rounded: "$10", borderWidth: 1, borderColor: "var(--border)", cursor: "pointer", children: _jsx(Text, { fontSize: 13, fontWeight: "500", color: "$soft", children: t('Show fewer plans ↑') }) }) })] }))) : (_jsxs(YStack, { gap: "$4", width: "100%", children: [_jsxs(View, { display: "grid", gridTemplateColumns: "repeat(auto-fit, minmax(320px, 1fr))", gap: 24, width: "100%", items: "stretch", children: [_jsx(YStack, { bg: "var(--surface-card-quiet)", borderWidth: 1, borderColor: "var(--border)", rounded: "$6", p: "$6", gap: "$5", justify: "space-between", children: _jsxs(YStack, { gap: "$3.5", children: [_jsx(Text, { fontSize: 14, fontWeight: "500", color: "$soft", 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: "$soft", children: t('See what AI can do.') })] }), _jsx(Button, { disabled: true, variant: "outline", rounded: "$10", width: "100%", py: "$2.5", my: "$2", borderColor: "var(--border-control)", bg: "transparent", cursor: "default", children: _jsx(Text, { fontSize: 14, fontWeight: "500", color: "$soft", 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: "$soft", children: t('/ month') })] }), _jsx(YStack, { gap: "$3", pt: "$3", children: [
|
|
138
138
|
t('Unlimited everyday text chats'),
|
|
139
139
|
t('Limited access to image creation'),
|
|
140
140
|
t('Limited memory and storage'),
|
package/dist/lib/destination.js
CHANGED
|
@@ -19,7 +19,7 @@
|
|
|
19
19
|
* person who cannot be sent back to their page must still be signed in, so a
|
|
20
20
|
* refusal degrades to the default and never to an exception.
|
|
21
21
|
*/
|
|
22
|
-
import { apex,
|
|
22
|
+
import { apex, guest, HOST, signs } from "./host.js";
|
|
23
23
|
import { SHARED } from "./share.js";
|
|
24
24
|
import { where } from "../where.js";
|
|
25
25
|
/** The default on the apex: `/`, which takes anyone signed in to the app, in
|
|
@@ -176,7 +176,7 @@ export function handoff(address) {
|
|
|
176
176
|
const asked = new URLSearchParams(address.split("#")[0].split("?")[1] ?? "").has("client_id");
|
|
177
177
|
if (!guest(host) && !(signs(host) && !asked))
|
|
178
178
|
return false;
|
|
179
|
-
window.location.assign(
|
|
179
|
+
window.location.assign(HOST + address);
|
|
180
180
|
return true;
|
|
181
181
|
}
|
|
182
182
|
/**
|
package/dist/lib/host.d.ts
CHANGED
|
@@ -49,6 +49,8 @@ export declare const TABS = "https://tabs.hanzo.ai";
|
|
|
49
49
|
*/
|
|
50
50
|
export declare const CHAT = "/chat";
|
|
51
51
|
export declare const DEV = "/dev";
|
|
52
|
+
/** Chat's own address on this host: `/` on the app's, /chat on every other. */
|
|
53
|
+
export declare const chat: () => string;
|
|
52
54
|
/**
|
|
53
55
|
* Studio: making images, audio, video and documents, and editing them.
|
|
54
56
|
* hanzo.ai/studio, whose page draws the app for a signed-in reader.
|
|
@@ -82,7 +84,7 @@ export declare const studio: (at: string) => string;
|
|
|
82
84
|
export declare const design: (at: string) => string;
|
|
83
85
|
/** Flow at an address of its own (@hanzo/studio `FlowStudio`): '' is New, /flow. */
|
|
84
86
|
export declare const flow: (at: string) => string;
|
|
85
|
-
/** Chat on a conversation, or
|
|
87
|
+
/** Chat on a conversation, or Chat itself for a new one (`chat`: `/` on the app's host). */
|
|
86
88
|
export declare const talk: (id?: string | null) => string;
|
|
87
89
|
/**
|
|
88
90
|
* Settings, and every page under it: the person's and the organization's, the
|
|
@@ -201,17 +203,15 @@ export declare const away: (hostname: string, address: string) => string | null;
|
|
|
201
203
|
export declare const SIGNIN = "https://hanzo.ai";
|
|
202
204
|
/** Whether a host is the one Hanzo signs in on. */
|
|
203
205
|
export declare const signs: (hostname: string) => boolean;
|
|
206
|
+
/** The app's own host. Chat is its root. */
|
|
207
|
+
export declare const HOST = "https://hanzo.app";
|
|
208
|
+
/** The Hanzo App, to get: the page with Download, Install CLI and Open in web, this export's /app. */
|
|
209
|
+
export declare const GET = "https://hanzo.app/app";
|
|
204
210
|
/**
|
|
205
|
-
* The
|
|
206
|
-
*
|
|
207
|
-
* static-sites `hanzo-app`), so it is linked by that address.
|
|
211
|
+
* The app, opened from another host: Chat, at hanzo.app's root. A reader who is
|
|
212
|
+
* signed out signs in on hanzo.ai's page and lands back in it.
|
|
208
213
|
*/
|
|
209
|
-
export declare const
|
|
210
|
-
/**
|
|
211
|
-
* The app, opened from another host: the chat at hanzo.app/chat. A reader who
|
|
212
|
-
* is signed out signs in on hanzo.ai's page and lands back in the chat.
|
|
213
|
-
*/
|
|
214
|
-
export declare const WEB = "https://hanzo.app/chat";
|
|
214
|
+
export declare const WEB = "https://hanzo.app/";
|
|
215
215
|
/**
|
|
216
216
|
* Whether a host serves this export and signs nobody in: every `<slug>.hanzo.app`
|
|
217
217
|
* alias the Sites plane serves it at, and hanzo.chat, whose root is /forward.
|
package/dist/lib/host.js
CHANGED
|
@@ -53,6 +53,15 @@ export const TABS = 'https://tabs.hanzo.ai';
|
|
|
53
53
|
*/
|
|
54
54
|
export const CHAT = '/chat';
|
|
55
55
|
export const DEV = '/dev';
|
|
56
|
+
/**
|
|
57
|
+
* Whether this page is on the app's own host, where Chat is the root: `/` is a new
|
|
58
|
+
* conversation and /chat forwards to it (universe static-sites `hanzo-app`). Read in
|
|
59
|
+
* the browser; a prerender has no host and answers no. A conversation keeps its
|
|
60
|
+
* path, /chat/<id>, on every host.
|
|
61
|
+
*/
|
|
62
|
+
const rooted = () => typeof window !== 'undefined' && apex(window.location.hostname);
|
|
63
|
+
/** Chat's own address on this host: `/` on the app's, /chat on every other. */
|
|
64
|
+
export const chat = () => (rooted() ? '/' : CHAT);
|
|
56
65
|
/**
|
|
57
66
|
* Studio: making images, audio, video and documents, and editing them.
|
|
58
67
|
* hanzo.ai/studio, whose page draws the app for a signed-in reader.
|
|
@@ -88,8 +97,8 @@ export const studio = (at) => (at ? `${STUDIO}/${at.replace(/^\/+/, '')}` : STUD
|
|
|
88
97
|
export const design = (at) => (at ? `${DESIGN}/${at.replace(/^\/+/, '')}` : DESIGN);
|
|
89
98
|
/** Flow at an address of its own (@hanzo/studio `FlowStudio`): '' is New, /flow. */
|
|
90
99
|
export const flow = (at) => (at ? `${FLOW}/${at.replace(/^\/+/, '')}` : FLOW);
|
|
91
|
-
/** Chat on a conversation, or
|
|
92
|
-
export const talk = (id) => (id ? `${CHAT}/${encodeURIComponent(id)}` :
|
|
100
|
+
/** Chat on a conversation, or Chat itself for a new one (`chat`: `/` on the app's host). */
|
|
101
|
+
export const talk = (id) => (id ? `${CHAT}/${encodeURIComponent(id)}` : chat());
|
|
93
102
|
/**
|
|
94
103
|
* Settings, and every page under it: the person's and the organization's, the
|
|
95
104
|
* host's own pages beside the app (hanzo.ai's app/(app)/settings), served
|
|
@@ -131,7 +140,7 @@ const SHARED = 'shared';
|
|
|
131
140
|
/** The place a path names, or null when it names none of the app's. */
|
|
132
141
|
export function place(pathname) {
|
|
133
142
|
const p = pathname.replace(/\/+$/, '') || '/';
|
|
134
|
-
if (p === CHAT)
|
|
143
|
+
if (p === CHAT || (p === '/' && rooted()))
|
|
135
144
|
return { mode: 'chat', thread: null };
|
|
136
145
|
if (p === DEV || p.startsWith(`${DEV}/`))
|
|
137
146
|
return { mode: 'dev', at: path(parse(p.slice(DEV.length))) };
|
|
@@ -273,10 +282,10 @@ export function remember(mode) {
|
|
|
273
282
|
export function resume() {
|
|
274
283
|
try {
|
|
275
284
|
const kept = window.localStorage.getItem(MODE);
|
|
276
|
-
return kept === 'dev' ? DEV : kept === 'studio' ? STUDIO : kept === 'design' ? DESIGN : kept === 'flow' ? FLOW : kept === 'tabs' ? TERMINALS :
|
|
285
|
+
return kept === 'dev' ? DEV : kept === 'studio' ? STUDIO : kept === 'design' ? DESIGN : kept === 'flow' ? FLOW : kept === 'tabs' ? TERMINALS : chat();
|
|
277
286
|
}
|
|
278
287
|
catch {
|
|
279
|
-
return
|
|
288
|
+
return chat();
|
|
280
289
|
}
|
|
281
290
|
}
|
|
282
291
|
/** The routes under app/(app) the apex keeps: the app — /chat, a chat shared by link, and /dev. */
|
|
@@ -309,7 +318,7 @@ export { APPS as ROOMS, leaves as room };
|
|
|
309
318
|
*/
|
|
310
319
|
export const away = (hostname, address) => {
|
|
311
320
|
if (guest(hostname))
|
|
312
|
-
return
|
|
321
|
+
return HOST + address;
|
|
313
322
|
if (!apex(hostname) || !leaves(address))
|
|
314
323
|
return null;
|
|
315
324
|
const home = address.match(/^\/home\/?(?=[?#]|$)/);
|
|
@@ -323,17 +332,15 @@ export const away = (hostname, address) => {
|
|
|
323
332
|
export const SIGNIN = 'https://hanzo.ai';
|
|
324
333
|
/** Whether a host is the one Hanzo signs in on. */
|
|
325
334
|
export const signs = (hostname) => hostname === 'hanzo.ai' || hostname === 'www.hanzo.ai';
|
|
335
|
+
/** The app's own host. Chat is its root. */
|
|
336
|
+
export const HOST = 'https://hanzo.app';
|
|
337
|
+
/** The Hanzo App, to get: the page with Download, Install CLI and Open in web, this export's /app. */
|
|
338
|
+
export const GET = `${HOST}/app`;
|
|
326
339
|
/**
|
|
327
|
-
* The
|
|
328
|
-
*
|
|
329
|
-
* static-sites `hanzo-app`), so it is linked by that address.
|
|
330
|
-
*/
|
|
331
|
-
export const GET = 'https://hanzo.app';
|
|
332
|
-
/**
|
|
333
|
-
* The app, opened from another host: the chat at hanzo.app/chat. A reader who
|
|
334
|
-
* is signed out signs in on hanzo.ai's page and lands back in the chat.
|
|
340
|
+
* The app, opened from another host: Chat, at hanzo.app's root. A reader who is
|
|
341
|
+
* signed out signs in on hanzo.ai's page and lands back in it.
|
|
335
342
|
*/
|
|
336
|
-
export const WEB = `${
|
|
343
|
+
export const WEB = `${HOST}/`;
|
|
337
344
|
/**
|
|
338
345
|
* Whether a host serves this export and signs nobody in: every `<slug>.hanzo.app`
|
|
339
346
|
* alias the Sites plane serves it at, and hanzo.chat, whose root is /forward.
|
package/dist/lib/limits.d.ts
CHANGED
|
@@ -21,8 +21,12 @@ export declare const useLimits: (enabled?: boolean, org?: string | null, name?:
|
|
|
21
21
|
*/
|
|
22
22
|
export declare const spendShown: ({ limits, answered }: Pick<UseLimits, 'limits' | 'answered'>) => boolean;
|
|
23
23
|
export { paidPlan };
|
|
24
|
-
/**
|
|
25
|
-
|
|
24
|
+
/**
|
|
25
|
+
* Whether the plan has no caps: Unlimited, with no windows and no included-usage
|
|
26
|
+
* limit. Its id, compared as `paidPlan` compares it. Ultra has Go's windows x25,
|
|
27
|
+
* so it is capped like any paid plan.
|
|
28
|
+
*/
|
|
29
|
+
export declare const uncapped: (l: Pick<Limits, 'plan'> | null | undefined) => boolean;
|
|
26
30
|
/**
|
|
27
31
|
* When a spent allowance comes back, on the reader's own clock, or null when the
|
|
28
32
|
* server names no instant still ahead (none, one not RFC 3339, or one passed).
|
|
@@ -48,8 +52,8 @@ export declare const spends: (code: string) => boolean;
|
|
|
48
52
|
* pay's amount step to add some), both for this browser's organization and
|
|
49
53
|
* coming back here, and Try again later, which the host takes as putting the
|
|
50
54
|
* banner away. Until the plan is read (`limits` null) there is no upgrade: the
|
|
51
|
-
* plan could be
|
|
52
|
-
* an empty balance, said as that, and its one way on is credits. Any other
|
|
55
|
+
* plan could be Unlimited. Unlimited has no allowance to spend, so what turns it
|
|
56
|
+
* away is an empty balance, said as that, and its one way on is credits. Any other
|
|
53
57
|
* refusal is the server's own words and ways (@hanzo/build `ways`). Everything
|
|
54
58
|
* said goes through `t`, and the time through `f`.
|
|
55
59
|
*/
|
package/dist/lib/limits.js
CHANGED
|
@@ -50,8 +50,12 @@ export const useLimits = (enabled = true, org = null, name) => useHeld(enabled ?
|
|
|
50
50
|
*/
|
|
51
51
|
export const spendShown = ({ limits, answered }) => answered && !paidPlan(limits);
|
|
52
52
|
export { paidPlan };
|
|
53
|
-
/**
|
|
54
|
-
|
|
53
|
+
/**
|
|
54
|
+
* Whether the plan has no caps: Unlimited, with no windows and no included-usage
|
|
55
|
+
* limit. Its id, compared as `paidPlan` compares it. Ultra has Go's windows x25,
|
|
56
|
+
* so it is capped like any paid plan.
|
|
57
|
+
*/
|
|
58
|
+
export const uncapped = (l) => l?.plan === 'unlimited';
|
|
55
59
|
/** An instant as the server writes one: RFC 3339, with its offset. Anything else names no instant. */
|
|
56
60
|
const INSTANT = /^\d{4}-\d{2}-\d{2}T\d{2}:\d{2}(:\d{2}(\.\d+)?)?(Z|[+-]\d{2}:\d{2})$/i;
|
|
57
61
|
/**
|
|
@@ -102,8 +106,8 @@ export const spends = (code) => SPENT.has(code);
|
|
|
102
106
|
* pay's amount step to add some), both for this browser's organization and
|
|
103
107
|
* coming back here, and Try again later, which the host takes as putting the
|
|
104
108
|
* banner away. Until the plan is read (`limits` null) there is no upgrade: the
|
|
105
|
-
* plan could be
|
|
106
|
-
* an empty balance, said as that, and its one way on is credits. Any other
|
|
109
|
+
* plan could be Unlimited. Unlimited has no allowance to spend, so what turns it
|
|
110
|
+
* away is an empty balance, said as that, and its one way on is credits. Any other
|
|
107
111
|
* refusal is the server's own words and ways (@hanzo/build `ways`). Everything
|
|
108
112
|
* said goes through `t`, and the time through `f`.
|
|
109
113
|
*/
|
|
@@ -113,7 +117,7 @@ export function paused(n, limits, name = (id) => id, now = Date.now(), t = engli
|
|
|
113
117
|
return { message: n.message, actions: ways(n.actions, t) };
|
|
114
118
|
const here = typeof window === 'undefined' ? undefined : window.location.href;
|
|
115
119
|
const topup = { kind: 'topup', label: t('Add credits'), url: payUrl('/amount/card', { org: org(), returnUrl: here }) };
|
|
116
|
-
if (
|
|
120
|
+
if (uncapped(limits))
|
|
117
121
|
return { message: t('Your balance is empty.') + on, actions: [topup] };
|
|
118
122
|
const credits = n.actions.find((a) => a.kind === 'credits');
|
|
119
123
|
const way = credits ? { ...credits, label: t('Continue with credits') } : topup;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@hanzo/app",
|
|
3
|
-
"version": "0.3.
|
|
3
|
+
"version": "0.3.58",
|
|
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",
|