@hanzo/app 0.3.4 → 0.3.6
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 +5 -2
- package/dist/Gate.js +11 -21
- package/dist/Rail.d.ts +1 -1
- package/dist/Rail.js +2 -2
- package/dist/ground.d.ts +7 -0
- package/dist/ground.js +7 -0
- package/dist/lib/session.d.ts +3 -5
- package/dist/lib/session.js +3 -6
- package/package.json +1 -1
package/dist/Chat.js
CHANGED
|
@@ -73,7 +73,7 @@ import { enter, LOGIN } from './lib/destination.js';
|
|
|
73
73
|
import { first } from './lib/first.js';
|
|
74
74
|
import { BAD } from "./lib/mix.js";
|
|
75
75
|
import { brand } from './where.js';
|
|
76
|
-
import { BAND, HEAD, TOUCH_HEAD, inPane } from './ground.js';
|
|
76
|
+
import { BAND, HEAD, INSET, TOUCH_HEAD, inPane } from './ground.js';
|
|
77
77
|
import { UsageControl } from './Usage.js';
|
|
78
78
|
import { shared, useChatPreferences } from './lib/chatPreferences.js';
|
|
79
79
|
import { handleHint } from './hint.js';
|
|
@@ -1535,7 +1535,10 @@ function Thread({ placeholder = message(), initial, anonymous = false, heading,
|
|
|
1535
1535
|
setPlan(null);
|
|
1536
1536
|
}, prompt: plan ?? "", model: model, models: models.map((m) => ({ id: m.id, name: nameOf(m.id, listed) })) }), dragging ? (_jsx(YStack, { "aria-hidden": true, position: "absolute", t: 0, r: 0, b: 0, l: 0, z: 10, items: "center", justify: "center", bg: "var(--surface-scrim)", borderWidth: 2, borderStyle: "dashed", borderColor: "$borderColor", rounded: "var(--pane-round)", pointerEvents: "none", children: _jsxs(XStack, { items: "center", gap: "$2", px: "$4", py: "$2.5", rounded: "$10", bg: "$background", borderWidth: 1, borderColor: "$borderColor", children: [_jsx(Paperclip, { size: 15, "aria-hidden": true }), _jsx(Text, { fontSize: "$4", color: "$ink", children: t("Drop files to attach") })] }) })) : null, _jsxs(XStack, { "data-slot": "conversation-head",
|
|
1537
1537
|
// On the rail's line from a tablet up (HEAD, less the pane's edge); a phone's own bar is BAND.
|
|
1538
|
-
height: BAND, $md: { height: inPane(HEAD) }, $touchable: { height: inPane(TOUCH_HEAD) }, display: "grid", gridTemplateColumns: "minmax(0, 1fr) auto", items: "center", gap: "$3", paddingInlineStart: "$4",
|
|
1538
|
+
height: BAND, $md: { height: inPane(HEAD) }, $touchable: { height: inPane(TOUCH_HEAD) }, display: "grid", gridTemplateColumns: "minmax(0, 1fr) auto", items: "center", gap: "$3", paddingInlineStart: "$4",
|
|
1539
|
+
// The last mark's centre INSET from the pane's end edge, as the rail's first is from the
|
|
1540
|
+
// window's start: the edge's 1px, then half the 32px mark.
|
|
1541
|
+
paddingInlineEnd: INSET - 1 - 16, shrink: 0, "data-tauri-drag-region": "deep", onMouseDown: dragWindow, onDoubleClick: toggleWindowMaximize, "$max-md": !mine && !cast.length ? { display: 'none' } : undefined, children: [_jsxs(XStack, { items: "center", gap: "$2", minW: 0, children: [mine ? (_jsx(Text, { fontSize: 15, lineHeight: 20, color: "$ink", numberOfLines: 1, shrink: 1, minW: 0, children: tidy(mine.title) })) : null, cast.length ? (_jsx(XStack, { role: "list", "aria-label": t("Agents in this chat"), items: "center", gap: "$1.5", minW: 0, overflowX: "auto", "$platform-web": { scrollbarWidth: "none" }, children: cast.map((name) => (_jsxs(XStack, { role: "listitem", items: "center", gap: "$1.5", paddingInlineStart: "$1", paddingInlineEnd: "$0.5", py: "$0.5", rounded: 999, borderWidth: 1, borderColor: "$borderColor", shrink: 0, children: [_jsx(Face, { src: faces[name]?.avatar ?? (name === withWhom ? portrait : undefined), emoji: faces[name]?.emoji ?? (name === withWhom ? persona?.emoji : undefined), name: name, size: 22 }), _jsx(Text, { fontSize: "$2", fontWeight: "600", color: "$color", numberOfLines: 1, display: "none", $sm: { display: "flex" }, children: name }), _jsx(Box, { render: "button", onClick: () => openAgent(name), "aria-label": t("Remove {name} from this chat", { name }), title: t("Remove {name}", { name }), width: 24, height: 24, rounded: 999, items: "center", justify: "center", hoverStyle: { bg: "$hover" }, children: _jsx(X, { size: 13, "aria-hidden": true, color: "var(--soft, var(--muted-foreground))" }) })] }, name))) })) : null] }), _jsxs(XStack, { "data-slot": "conversation-controls", "data-tauri-drag-region": "false", items: "center", gap: 4, shrink: 0, children: [free ? (_jsxs(Button, { size: "xs", variant: "outline", "data-slot": "header-upgrade", gap: "$1.5", px: "$2.5", py: "$1", rounded: "$4", cursor: "pointer", hoverStyle: { bg: 'var(--white-10)' }, onPress: () => window.location.assign(payUrl('/cart', { org: org(), returnUrl: window.location.href })), "aria-label": t("Upgrade plan"), children: [_jsx(Sparkles, { size: 13, color: "var(--primary)", "aria-hidden": true }), _jsx(Text, { fontSize: "$1", fontWeight: "600", color: "$ink", children: t("Upgrade plan") })] })) : null, open ? _jsx(Share, { thread: open }) : null, said.length > 0 ? (_jsx(ConversationMenu, { threads: currentThreadMap, active: open || currentThread.id, onSchedule: anonymous || forgetful ? undefined : () => setPlan(lastAsked()), children: _jsx(XStack, { children: _jsx(ThreadMore, { t: currentThread }) }) })) : (_jsxs(Tooltip, { children: [_jsx(TooltipTrigger, { asChild: true, children: _jsx(XStack, { render: "button", "data-slot": "header-private-chat", "aria-label": t("Private chat"), "aria-pressed": forgetful, width: 32, height: 32, items: "center", justify: "center", rounded: "$3", bg: "transparent", cursor: "pointer", hoverStyle: { bg: "$hover" }, focusVisibleStyle: { outlineWidth: 2, outlineStyle: "solid", outlineColor: "var(--ring)" }, onPress: () => setForgetful(!forgetful), children: _jsx(Ghost, { size: 16, strokeWidth: 1.75, color: forgetful ? "var(--foreground)" : "var(--muted-foreground)", fill: forgetful ? "currentColor" : "none", "aria-hidden": true }) }) }), _jsx(TooltipContent, { children: forgetful ? t("Private chat is on: this conversation is not saved") : t("Private chat") })] })), _jsx(XStack, { "$max-md": { display: 'none' }, children: _jsx(Summary, { sections: sections, onOpen: () => setPanel(true), label: t("Summary") }) }), _jsx(XStack, { "$max-md": { display: 'none' }, children: _jsx(PanelToggle, { open: panel, onToggle: () => setPanel(!panel) }) })] })] }), wide && aside !== null ? (_jsx(Side, { children: _jsx(Panel, { side: deck, kinds: NONE, onHide: () => setPanel(false), label: t("Tabs"), ...browsing }) })) : null, !wide && panel ? _jsx(Panel, { side: deck, kinds: NONE, sheet: true, onHide: () => setPanel(false), label: t("Tabs"), ...browsing }) : null, _jsx(YStack, { "data-slot": "talk", flex: 1, minH: 0, children: _jsx(ChatSurface, { ...chat, messages: shown, send: guarded,
|
|
1539
1542
|
// WHILE NOTHING HAS BEEN SAID, from a tablet up, the opening and the
|
|
1540
1543
|
// composer are one pair centred in the pane (`center`: rows `1fr auto auto
|
|
1541
1544
|
// 1fr`), so the heading reads close above the field and nothing stands at
|
package/dist/Gate.js
CHANGED
|
@@ -44,7 +44,7 @@ import { useHostname } from './lib/hostname.js';
|
|
|
44
44
|
import { useHydrated } from './lib/hydrated.js';
|
|
45
45
|
import { api } from './lib/api.js';
|
|
46
46
|
import { usePersonal, useTier } from './lib/tier.js';
|
|
47
|
-
import { CHOOSE, ORG,
|
|
47
|
+
import { CHOOSE, ORG, assumed, bearer, hasSession, org, orgs as claimed, pick, renew, role, scope, superAdmin, support } from './lib/session.js';
|
|
48
48
|
import { matches, refusal, slugify } from './lib/orgname.js';
|
|
49
49
|
import { team as workspace } from './lib/host.js';
|
|
50
50
|
import { checkoutUrl, money } from './lib/pay.js';
|
|
@@ -85,7 +85,6 @@ export function Gate({ children, front = false, forward, signup = false, }) {
|
|
|
85
85
|
window.removeEventListener('storage', on);
|
|
86
86
|
};
|
|
87
87
|
}, [accessToken]);
|
|
88
|
-
const [picked, setPicked] = useState(false);
|
|
89
88
|
// The team being set up in this page. Once its name is taken the setup owns
|
|
90
89
|
// the screen until checkout, whatever `Gate` reads of the new organization.
|
|
91
90
|
const [founding, setFounding] = useState(null);
|
|
@@ -106,14 +105,6 @@ export function Gate({ children, front = false, forward, signup = false, }) {
|
|
|
106
105
|
const supporting = Boolean(current) && assumed() === current;
|
|
107
106
|
const open = !asks || live || supporting;
|
|
108
107
|
const { client } = useAi();
|
|
109
|
-
useEffect(() => {
|
|
110
|
-
try {
|
|
111
|
-
setPicked(Boolean(localStorage.getItem(PICKED)));
|
|
112
|
-
}
|
|
113
|
-
catch {
|
|
114
|
-
setPicked(true);
|
|
115
|
-
}
|
|
116
|
-
}, [accessToken]);
|
|
117
108
|
// Back from checkout: the plan may be live now.
|
|
118
109
|
useEffect(() => {
|
|
119
110
|
const back = () => {
|
|
@@ -136,7 +127,6 @@ export function Gate({ children, front = false, forward, signup = false, }) {
|
|
|
136
127
|
}, []);
|
|
137
128
|
const choose = useCallback((o) => {
|
|
138
129
|
pick(o);
|
|
139
|
-
setPicked(true);
|
|
140
130
|
setChoosing(false);
|
|
141
131
|
}, []);
|
|
142
132
|
// The organization a link arrives for. hanzo.ai opens the workspace at
|
|
@@ -155,11 +145,6 @@ export function Gate({ children, front = false, forward, signup = false, }) {
|
|
|
155
145
|
if (members.includes(asked))
|
|
156
146
|
choose(asked);
|
|
157
147
|
}, [door, hydrated, isLoading, isAuthenticated, members, choose]);
|
|
158
|
-
// One organization is not a choice.
|
|
159
|
-
useEffect(() => {
|
|
160
|
-
if (members.length === 1 && !picked)
|
|
161
|
-
choose(members[0]);
|
|
162
|
-
}, [members, picked, choose]);
|
|
163
148
|
// The template chosen at creation, set up once the organization opens.
|
|
164
149
|
useEffect(() => {
|
|
165
150
|
if (!open || !client)
|
|
@@ -213,11 +198,17 @@ export function Gate({ children, front = false, forward, signup = false, }) {
|
|
|
213
198
|
return _jsx(Landing, { member: true });
|
|
214
199
|
return door ? _jsx(Start, { onFounded: setFounding, first: true }) : _jsx(Create, {});
|
|
215
200
|
}
|
|
216
|
-
|
|
201
|
+
// The organization this browser works in is the choice (session.ts `org`: the
|
|
202
|
+
// SDK's selection when the token names it, else the person's only one). Only a
|
|
203
|
+
// browser working in none of the person's is asked, so a sign-in goes straight
|
|
204
|
+
// to the app in the organization the person last worked in, and the account
|
|
205
|
+
// menu switches it (`choosing`).
|
|
206
|
+
if (!current)
|
|
217
207
|
return _jsx(Pick, { members: members, current: current, onPick: choose });
|
|
218
|
-
// Asked for over an open app, the app keeps its place under the chooser and closing it goes back
|
|
208
|
+
// Asked for over an open app, the app keeps its place under the chooser and closing it goes back;
|
|
209
|
+
// asked for from a plan's page (`swap`), the chooser stands alone, since that app is not open.
|
|
219
210
|
if (choosing)
|
|
220
|
-
return _jsxs(_Fragment, { children: [_jsx(Held, { veiled: true, children: children }), _jsx(Pick, { members: members, current: current, onPick: choose, onClose: () => setChoosing(false) })] });
|
|
211
|
+
return _jsxs(_Fragment, { children: [open ? _jsx(Held, { veiled: true, children: children }) : null, _jsx(Pick, { members: members, current: current, onPick: choose, onClose: () => setChoosing(false) })] });
|
|
221
212
|
if (open)
|
|
222
213
|
return forward ? _jsx(Forward, { to: forward }) : _jsx(_Fragment, { children: _jsx(Held, { veiled: false, children: children }) });
|
|
223
214
|
// IN THE WORKSPACE NOTHING OPENS WITHOUT A LIVE PLAN. Every branch here
|
|
@@ -230,7 +221,7 @@ export function Gate({ children, front = false, forward, signup = false, }) {
|
|
|
230
221
|
return _jsxs(_Fragment, { children: [_jsx(Held, { veiled: true, children: children }), _jsx(Veil, {})] });
|
|
231
222
|
if (free && personal === null)
|
|
232
223
|
return _jsxs(_Fragment, { children: [_jsx(Held, { veiled: true, children: children }), _jsx(Veil, {})] });
|
|
233
|
-
const swap = () =>
|
|
224
|
+
const swap = () => setChoosing(true);
|
|
234
225
|
if (door) {
|
|
235
226
|
// A billing OUTAGE is ours; the plan is still the condition.
|
|
236
227
|
if (!tier)
|
|
@@ -449,7 +440,6 @@ function CreateDialog({ onClose }) {
|
|
|
449
440
|
try {
|
|
450
441
|
if (template)
|
|
451
442
|
localStorage.setItem(SETUP, template);
|
|
452
|
-
localStorage.setItem(PICKED, '1');
|
|
453
443
|
}
|
|
454
444
|
catch {
|
|
455
445
|
/* the next load re-derives both */
|
package/dist/Rail.d.ts
CHANGED
|
@@ -2,7 +2,7 @@ import { type ReactNode } from 'react';
|
|
|
2
2
|
import { type Host } from '@hanzo/build';
|
|
3
3
|
import { type Place } from './lib/host.js';
|
|
4
4
|
/** The rail's width, px. */
|
|
5
|
-
export declare const RAIL
|
|
5
|
+
export declare const RAIL: number;
|
|
6
6
|
/** A mark, px: a 36px square on a 44px pitch. */
|
|
7
7
|
export declare const MARK = 36;
|
|
8
8
|
/** The places the rail holds beside the products, by the builder address each opens. */
|
package/dist/Rail.js
CHANGED
|
@@ -45,10 +45,10 @@ import { out } from './help.js';
|
|
|
45
45
|
import { BETAS } from './lib/betas.js';
|
|
46
46
|
import { HOSTED_APPS } from './lib/hosted.js';
|
|
47
47
|
import { Account } from './Account.js';
|
|
48
|
-
import { HEAD, TOUCH_HEAD } from './ground.js';
|
|
48
|
+
import { HEAD, INSET, TOUCH_HEAD } from './ground.js';
|
|
49
49
|
import { app, hosted, WORKSPACE } from './lib/host.js';
|
|
50
50
|
/** The rail's width, px. */
|
|
51
|
-
export const RAIL =
|
|
51
|
+
export const RAIL = 2 * INSET;
|
|
52
52
|
/** A mark, px: a 36px square on a 44px pitch. */
|
|
53
53
|
export const MARK = 36;
|
|
54
54
|
/** A mark on a touch screen, px: a thumb's 44. */
|
package/dist/ground.d.ts
CHANGED
|
@@ -34,6 +34,13 @@ export declare const BAND = 52;
|
|
|
34
34
|
*/
|
|
35
35
|
export declare const HEAD = 36;
|
|
36
36
|
export declare const TOUCH_HEAD = 44;
|
|
37
|
+
/**
|
|
38
|
+
* A corner mark's centre from its edge, px: the rail's first mark from the
|
|
39
|
+
* window's start edge (the rail is twice this wide), and the pane head's last
|
|
40
|
+
* mark from the pane's end edge, so the two top corners mirror each other
|
|
41
|
+
* (owner, 2026-10-30: "top left / top right").
|
|
42
|
+
*/
|
|
43
|
+
export declare const INSET = 22;
|
|
37
44
|
/**
|
|
38
45
|
* A row INSIDE a pane is 2px shorter than the row it lines up with: the pane's
|
|
39
46
|
* 1px top edge sets its content 1px down, so its centre stays on the line.
|
package/dist/ground.js
CHANGED
|
@@ -34,6 +34,13 @@ export const BAND = 52;
|
|
|
34
34
|
*/
|
|
35
35
|
export const HEAD = 36;
|
|
36
36
|
export const TOUCH_HEAD = 44;
|
|
37
|
+
/**
|
|
38
|
+
* A corner mark's centre from its edge, px: the rail's first mark from the
|
|
39
|
+
* window's start edge (the rail is twice this wide), and the pane head's last
|
|
40
|
+
* mark from the pane's end edge, so the two top corners mirror each other
|
|
41
|
+
* (owner, 2026-10-30: "top left / top right").
|
|
42
|
+
*/
|
|
43
|
+
export const INSET = 22;
|
|
37
44
|
/**
|
|
38
45
|
* A row INSIDE a pane is 2px shorter than the row it lines up with: the pane's
|
|
39
46
|
* 1px top edge sets its content 1px down, so its centre stays on the line.
|
package/dist/lib/session.d.ts
CHANGED
|
@@ -182,12 +182,10 @@ export declare function scope(): Record<string, string>;
|
|
|
182
182
|
export declare function renew(): void;
|
|
183
183
|
/** Fired on `window` when the organization this browser works in changes. */
|
|
184
184
|
export declare const ORG = "hanzo:org";
|
|
185
|
-
/** This person picked an organization in this browser. `own()` clears it with the person. */
|
|
186
|
-
export declare const PICKED = "hanzo:org:picked";
|
|
187
185
|
/**
|
|
188
|
-
* Work in this organization from now on: the SDK's selection,
|
|
189
|
-
*
|
|
190
|
-
*
|
|
186
|
+
* Work in this organization from now on: the SDK's selection, announced. A choice
|
|
187
|
+
* made anywhere (the shell's gate, the app's account menu) is the one `org()`
|
|
188
|
+
* answers, so the gate does not ask for it again.
|
|
191
189
|
*/
|
|
192
190
|
export declare function pick(o: string): void;
|
|
193
191
|
/** Fired on `window` to open the organization chooser over the shell. */
|
package/dist/lib/session.js
CHANGED
|
@@ -453,17 +453,14 @@ export function renew() {
|
|
|
453
453
|
}
|
|
454
454
|
/** Fired on `window` when the organization this browser works in changes. */
|
|
455
455
|
export const ORG = 'hanzo:org';
|
|
456
|
-
/** This person picked an organization in this browser. `own()` clears it with the person. */
|
|
457
|
-
export const PICKED = 'hanzo:org:picked';
|
|
458
456
|
/**
|
|
459
|
-
* Work in this organization from now on: the SDK's selection,
|
|
460
|
-
*
|
|
461
|
-
*
|
|
457
|
+
* Work in this organization from now on: the SDK's selection, announced. A choice
|
|
458
|
+
* made anywhere (the shell's gate, the app's account menu) is the one `org()`
|
|
459
|
+
* answers, so the gate does not ask for it again.
|
|
462
460
|
*/
|
|
463
461
|
export function pick(o) {
|
|
464
462
|
try {
|
|
465
463
|
window.localStorage.setItem(`${PREFIX}current_org`, o);
|
|
466
|
-
window.localStorage.setItem(PICKED, '1');
|
|
467
464
|
}
|
|
468
465
|
catch {
|
|
469
466
|
/* the choice lives only in this page */
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@hanzo/app",
|
|
3
|
-
"version": "0.3.
|
|
3
|
+
"version": "0.3.6",
|
|
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",
|