@hanzo/studio 0.1.5 → 0.1.7
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/lib/chat/turn.js +8 -1
- package/lib/kinds/ad.js +1 -1
- package/lib/kinds/image.d.ts +2 -5
- package/lib/kinds/image.js +8 -22
- package/lib/kinds/kind.d.ts +2 -0
- package/lib/kinds/poster/index.js +2 -2
- package/lib/nav.d.ts +2 -2
- package/lib/nav.js +2 -10
- package/lib/talk.js +16 -20
- package/lib/wire.js +1 -1
- package/package.json +42 -38
package/lib/chat/turn.js
CHANGED
|
@@ -15,6 +15,7 @@
|
|
|
15
15
|
*/
|
|
16
16
|
import { complete, put, read } from '../wire.js';
|
|
17
17
|
import { ALL, called, kind } from '../kinds/index.js';
|
|
18
|
+
import { UNDRAWN } from '../kinds/image.js';
|
|
18
19
|
import { settle } from '../kinds/type/system.js';
|
|
19
20
|
import { current, dir } from '../made.js';
|
|
20
21
|
import { data } from '../raster.js';
|
|
@@ -125,6 +126,8 @@ export async function turn(start, asked, ctx) {
|
|
|
125
126
|
put_({ ...chat, turns: chat.turns.map((t) => (t.id === you.id ? { ...t, ...patch } : t)) });
|
|
126
127
|
};
|
|
127
128
|
const mine = () => chat.turns.find((t) => t.id === you.id);
|
|
129
|
+
// A picture the gateway did not draw: the turn ends on one plain sentence and a retry.
|
|
130
|
+
let missed = false;
|
|
128
131
|
const open = ALL.filter((k) => !k.needs(ctx));
|
|
129
132
|
const closed = ALL.filter((k) => k.needs(ctx));
|
|
130
133
|
const tools = [...open.map((k) => ({ type: 'function', function: k.tool })), REVISE, BRAND];
|
|
@@ -156,7 +159,7 @@ export async function turn(start, asked, ctx) {
|
|
|
156
159
|
messages.push({ role: 'tool', tool_call_id: c.id, content: JSON.stringify(answer) });
|
|
157
160
|
}
|
|
158
161
|
}
|
|
159
|
-
set({ doing: undefined });
|
|
162
|
+
set({ doing: undefined, ...(missed ? { failed: `${UNDRAWN} Try again?` } : {}) });
|
|
160
163
|
}
|
|
161
164
|
catch (e) {
|
|
162
165
|
if (e?.name === 'AbortError')
|
|
@@ -232,6 +235,9 @@ export async function turn(start, asked, ctx) {
|
|
|
232
235
|
wire: ctx.wire,
|
|
233
236
|
signal: ctx.signal,
|
|
234
237
|
doing: (line) => set({ doing: line }),
|
|
238
|
+
missed: () => {
|
|
239
|
+
missed = true;
|
|
240
|
+
},
|
|
235
241
|
keep: async (name, blob, extra) => {
|
|
236
242
|
const key = await put(ctx.wire, `${dir(chat.id, m, vid)}/${name}`, blob);
|
|
237
243
|
return { key, mime: blob.type || 'application/octet-stream', name, ...extra };
|
|
@@ -257,6 +263,7 @@ export async function edit(start, m, patch, note, ctx) {
|
|
|
257
263
|
wire: ctx.wire,
|
|
258
264
|
signal: ctx.signal,
|
|
259
265
|
doing: () => undefined,
|
|
266
|
+
missed: () => undefined,
|
|
260
267
|
keep: async (name, blob, extra) => ({ key: await put(ctx.wire, `${dir(start.id, m, vid)}/${name}`, blob), mime: blob.type || 'application/octet-stream', name, ...extra }),
|
|
261
268
|
picture: async (f) => data(await read(ctx.wire, f.key)),
|
|
262
269
|
find: (ref) => start.made.find((x) => x.id === (typeof ref === 'number' ? ctx.order()[ref - 1] : ref)) ?? null,
|
package/lib/kinds/ad.js
CHANGED
|
@@ -98,7 +98,7 @@ export const ad = {
|
|
|
98
98
|
}
|
|
99
99
|
}
|
|
100
100
|
const files = await draw(w, s);
|
|
101
|
-
return { title: str(args.title, s.headline), draft: { spec: s, files, note: why ? `Set in type alone
|
|
101
|
+
return { title: str(args.title, s.headline), draft: { spec: s, files, note: why ? `Set in type alone. ${why}` : s.headline, by: 'Studio layout' } };
|
|
102
102
|
},
|
|
103
103
|
revise: async (w, made, change) => {
|
|
104
104
|
const s = spec({ ...current(made).spec, ...(change.patch ?? {}), system: w.brand ?? current(made).spec.system });
|
package/lib/kinds/image.d.ts
CHANGED
|
@@ -24,11 +24,8 @@ export declare const ASPECTS: readonly ['1:1', '4:5', '3:4', '2:3', '9:16', '16:
|
|
|
24
24
|
export declare function lane(model: string, fleet: Fleet | null): string;
|
|
25
25
|
/** Which lane an edit takes: the one asked for, else Qwen Edit on a GPU that can run it, else the gateway. */
|
|
26
26
|
export declare function editing(model: string, fleet: Fleet | null): string;
|
|
27
|
-
/**
|
|
28
|
-
export declare
|
|
29
|
-
model: string;
|
|
30
|
-
reason: string;
|
|
31
|
-
} | null;
|
|
27
|
+
/** What a person reads when the gateway draws no picture: never a model, a provider or the plumbing between. */
|
|
28
|
+
export declare const UNDRAWN = "Couldn't draw the picture this time.";
|
|
32
29
|
/** Make pictures from words (and, for an edit, the pictures they start from), and keep them. */
|
|
33
30
|
export declare function picture(w: Work, o: {
|
|
34
31
|
prompt: string;
|
package/lib/kinds/image.js
CHANGED
|
@@ -11,7 +11,7 @@ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
|
11
11
|
*/
|
|
12
12
|
import { SizableText, XStack, YStack } from '@hanzo/gui';
|
|
13
13
|
import { Image as Picture } from '@hanzogui/lucide-icons-2';
|
|
14
|
-
import { useState
|
|
14
|
+
import { useState } from 'react';
|
|
15
15
|
import { render } from '../gpu.js';
|
|
16
16
|
import { current, filename } from '../made.js';
|
|
17
17
|
import { useUrl } from '../use.js';
|
|
@@ -67,23 +67,8 @@ async function size(blob) {
|
|
|
67
67
|
return {};
|
|
68
68
|
}
|
|
69
69
|
}
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
* that refused at the source says why, in the composer, until a call succeeds.
|
|
73
|
-
*/
|
|
74
|
-
let down = null;
|
|
75
|
-
const watchers = new Set();
|
|
76
|
-
const note = (next) => {
|
|
77
|
-
down = next;
|
|
78
|
-
watchers.forEach((w) => w());
|
|
79
|
-
};
|
|
80
|
-
/** Why the gateway's image models are not answering now, or null. */
|
|
81
|
-
export function useImageLane() {
|
|
82
|
-
return useSyncExternalStore((l) => {
|
|
83
|
-
watchers.add(l);
|
|
84
|
-
return () => watchers.delete(l);
|
|
85
|
-
}, () => down, () => down);
|
|
86
|
-
}
|
|
70
|
+
/** What a person reads when the gateway draws no picture: never a model, a provider or the plumbing between. */
|
|
71
|
+
export const UNDRAWN = "Couldn't draw the picture this time.";
|
|
87
72
|
/** Make pictures from words (and, for an edit, the pictures they start from), and keep them. */
|
|
88
73
|
export async function picture(w, o) {
|
|
89
74
|
const use = o.from?.length ? editing(o.model, w.fleet) : lane(o.model, w.fleet);
|
|
@@ -116,11 +101,12 @@ export async function picture(w, o) {
|
|
|
116
101
|
got = await draw(w.wire, use, ask, { from, aspect: o.aspect, signal: w.signal });
|
|
117
102
|
}
|
|
118
103
|
catch (e) {
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
104
|
+
// A plan's refusal says what lifts it; anything else is the one plain sentence, and the turn offers to try again.
|
|
105
|
+
if ((e instanceof Refusal && e.status === 402) || w.signal.aborted)
|
|
106
|
+
throw e;
|
|
107
|
+
w.missed();
|
|
108
|
+
throw new Error(UNDRAWN, { cause: e });
|
|
122
109
|
}
|
|
123
|
-
note(null);
|
|
124
110
|
for (const g of got)
|
|
125
111
|
files.push(await w.keep(`image-${files.length + 1}.${ext(g.mime)}`, g.blob, await size(g.blob)));
|
|
126
112
|
}
|
package/lib/kinds/kind.d.ts
CHANGED
|
@@ -28,6 +28,8 @@ export interface Work {
|
|
|
28
28
|
signal: AbortSignal;
|
|
29
29
|
/** Say what is happening now: drawn under the turn while it works. */
|
|
30
30
|
doing: (line: string) => void;
|
|
31
|
+
/** A picture could not be drawn: the turn ends offering to try again. */
|
|
32
|
+
missed: () => void;
|
|
31
33
|
/** Keep bytes as one of this version's files. */
|
|
32
34
|
keep: (name: string, blob: Blob, extra?: {
|
|
33
35
|
width?: number;
|
|
@@ -118,7 +118,7 @@ export const poster = {
|
|
|
118
118
|
const got = await art(w, s, num(args.image_tab, 0));
|
|
119
119
|
s.picture = got.key;
|
|
120
120
|
const files = await draw(w, s);
|
|
121
|
-
const note = got.why ? `Set in type alone
|
|
121
|
+
const note = got.why ? `Set in type alone. ${got.why}` : s.headline;
|
|
122
122
|
return { title: str(args.title, s.headline), draft: { spec: s, files, note, by: 'Studio layout' } };
|
|
123
123
|
},
|
|
124
124
|
revise: async (w, made, change) => {
|
|
@@ -149,7 +149,7 @@ export const poster = {
|
|
|
149
149
|
}
|
|
150
150
|
}
|
|
151
151
|
const files = await draw(w, next);
|
|
152
|
-
return { spec: next, files, note: why ? `${change.instruction}
|
|
152
|
+
return { spec: next, files, note: why ? `${change.instruction}. The picture is unchanged: ${why}` : (change.instruction ?? 'Edited'), by: 'Studio layout' };
|
|
153
153
|
},
|
|
154
154
|
View: Sheet,
|
|
155
155
|
exports: [
|
package/lib/nav.d.ts
CHANGED
|
@@ -6,9 +6,9 @@
|
|
|
6
6
|
*/
|
|
7
7
|
import type { Host } from '@hanzo/build';
|
|
8
8
|
import type { RailLink } from '@hanzo/ui/chat';
|
|
9
|
-
/**
|
|
9
|
+
/** Studio's places, as one run: a host draws no heading over its first group. */
|
|
10
10
|
export interface Group {
|
|
11
|
-
id: 'make'
|
|
11
|
+
id: 'make';
|
|
12
12
|
label: string;
|
|
13
13
|
links: RailLink[];
|
|
14
14
|
}
|
package/lib/nav.js
CHANGED
|
@@ -13,17 +13,9 @@ export function nav(host, go) {
|
|
|
13
13
|
links: [
|
|
14
14
|
{ id: NEW, label: 'New creation', icon: _jsx(SquarePen, { size: 16 }), onPress: to(''), active: r.kind === 'new' },
|
|
15
15
|
{ id: 'explore', label: 'Explore', icon: _jsx(LayoutTemplate, { size: 16 }), onPress: to(path({ kind: 'explore' })), active: r.kind === 'explore' },
|
|
16
|
+
{ id: 'library', label: 'Library', icon: _jsx(Library, { size: 16 }), onPress: to(path({ kind: 'library' })), active: r.kind === 'library' },
|
|
17
|
+
{ id: 'activity', label: 'Activity', icon: _jsx(Activity, { size: 16 }), onPress: to(path({ kind: 'activity' })), active: r.kind === 'activity' },
|
|
16
18
|
],
|
|
17
19
|
},
|
|
18
|
-
{
|
|
19
|
-
id: 'made',
|
|
20
|
-
label: 'Made',
|
|
21
|
-
links: [{ id: 'library', label: 'Library', icon: _jsx(Library, { size: 16 }), onPress: to(path({ kind: 'library' })), active: r.kind === 'library' }],
|
|
22
|
-
},
|
|
23
|
-
{
|
|
24
|
-
id: 'run',
|
|
25
|
-
label: 'Run',
|
|
26
|
-
links: [{ id: 'activity', label: 'Activity', icon: _jsx(Activity, { size: 16 }), onPress: to(path({ kind: 'activity' })), active: r.kind === 'activity' }],
|
|
27
|
-
},
|
|
28
20
|
];
|
|
29
21
|
}
|
package/lib/talk.js
CHANGED
|
@@ -2,14 +2,14 @@ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
|
2
2
|
/**
|
|
3
3
|
* A CONVERSATION and its tabs: the chat that makes things on the left, every
|
|
4
4
|
* thing it made in a tab on the right. The same two panes as a Dev run, from
|
|
5
|
-
* the same parts: @hanzo/ui's `Chat` for the thread and its composer (
|
|
6
|
-
*
|
|
5
|
+
* the same parts: @hanzo/ui's `Chat` for the thread and its composer (the one
|
|
6
|
+
* composer, handed Studio's pills), and @hanzo/build's `Panel` over a `Deck` for the
|
|
7
7
|
* tabs, scoped to this conversation so its tabs are kept with it.
|
|
8
8
|
*
|
|
9
9
|
* A new conversation has no id in the address until its first message is sent;
|
|
10
10
|
* then the address names it, and the conversation in hand is the one shown.
|
|
11
11
|
*/
|
|
12
|
-
import {
|
|
12
|
+
import { Gutter, Panel, PanelToggle, Reply, SideProvider, useDeck, useKey, usePanel, useSplit } from '@hanzo/build';
|
|
13
13
|
import { SizableText, useMedia, XStack, YStack } from '@hanzo/gui';
|
|
14
14
|
import { Check, ChevronDown, Ellipsis, Image as ImageIcon, LoaderCircle, Palette, Sparkles, X } from '@hanzogui/lucide-icons-2';
|
|
15
15
|
import { DropdownMenu } from '@hanzo/ui';
|
|
@@ -20,7 +20,7 @@ import { keep, listed, open } from './chat/store.js';
|
|
|
20
20
|
import { Desk } from './desk.js';
|
|
21
21
|
import { Home } from './home.js';
|
|
22
22
|
import { useHost } from './host.js';
|
|
23
|
-
import { MODELS,
|
|
23
|
+
import { MODELS, ZEN } from './kinds/image.js';
|
|
24
24
|
import { ALL, kind } from './kinds/index.js';
|
|
25
25
|
import { lit } from './kinds/kind.js';
|
|
26
26
|
import { PRESETS } from './kinds/type/system.js';
|
|
@@ -41,9 +41,6 @@ const pane = {
|
|
|
41
41
|
boxShadow: 'var(--shadow-sheet-2)',
|
|
42
42
|
};
|
|
43
43
|
const gap = 'var(--pane-gap, var(--space-2))';
|
|
44
|
-
const DESK = 560;
|
|
45
|
-
const DESK_FLOOR = 320;
|
|
46
|
-
const TALK_FLOOR = 320;
|
|
47
44
|
export function Talk({ id }) {
|
|
48
45
|
const host = useHost();
|
|
49
46
|
const wire = useWire(host);
|
|
@@ -97,14 +94,13 @@ function Conversation({ start, host, wire, available }) {
|
|
|
97
94
|
const [editFailed, setEditFailed] = useState({});
|
|
98
95
|
const wide = useMedia().md;
|
|
99
96
|
useLibrary(wire);
|
|
100
|
-
const imaging = useImageLane();
|
|
101
97
|
const [desk, setDesk] = usePanel('studio', true, wide);
|
|
102
98
|
useKey(() => setDesk(!desk));
|
|
99
|
+
// The tabs' column, as Chat's and a Dev run's: the person's width, the chat hidden behind it, full screen.
|
|
100
|
+
const split = useSplit(desk && wide && chat.made.length > 0, 'chat', () => setDesk(false));
|
|
103
101
|
const deck = useDeck(`studio.${chat.id}`, { tabs: chat.made.map((m) => ({ id: m.id, kind: m.id, title: m.title })), at: chat.made.at(-1)?.id ?? null });
|
|
104
102
|
const order = useRef([]);
|
|
105
103
|
order.current = [...deck.tabs.map((t) => t.kind).filter((k) => chat.made.some((m) => m.id === k)), ...chat.made.map((m) => m.id).filter((m) => !deck.tabs.some((t) => t.kind === m))];
|
|
106
|
-
const [span, setSpan] = useState(DESK);
|
|
107
|
-
const deskBox = useRef(null);
|
|
108
104
|
// Saved after every change, at most once a second and a half; at once when a turn ends.
|
|
109
105
|
const saving = useRef(null);
|
|
110
106
|
const persist = useCallback((c, now = false) => {
|
|
@@ -313,7 +309,7 @@ function Conversation({ start, host, wire, available }) {
|
|
|
313
309
|
{ type: 'label', key: 'm', label: 'Image model' },
|
|
314
310
|
{ key: 'auto', label: `${options.model === 'auto' ? '✓ ' : ''}Auto`, description: zen ? 'Zen Image on your GPU' : MODELS[0].label, onSelect: () => setOptions({ ...options, model: 'auto' }) },
|
|
315
311
|
...(zen ? [{ key: ZEN, label: `${options.model === ZEN ? '✓ ' : ''}Zen Image`, description: 'On your GPU', onSelect: () => setOptions({ ...options, model: ZEN }) }] : []),
|
|
316
|
-
...MODELS.map((m) => ({ key: m.id, label: `${options.model === m.id ? '✓ ' : ''}${m.label}`,
|
|
312
|
+
...MODELS.map((m) => ({ key: m.id, label: `${options.model === m.id ? '✓ ' : ''}${m.label}`, onSelect: () => setOptions({ ...options, model: m.id }) })),
|
|
317
313
|
{ type: 'separator', key: 's' },
|
|
318
314
|
{ type: 'label', key: 'a', label: 'Aspect' },
|
|
319
315
|
...['', '1:1', '4:5', '9:16', '16:9', '3:2'].map((a) => ({ key: `a${a}`, label: `${options.aspect === a ? '✓ ' : ''}${a || 'As asked'}`, onSelect: () => setOptions({ ...options, aspect: a }) })),
|
|
@@ -323,7 +319,7 @@ function Conversation({ start, host, wire, available }) {
|
|
|
323
319
|
];
|
|
324
320
|
const tools = (_jsxs(XStack, { items: "center", gap: 2, children: [_jsx(DropdownMenu, { trigger: _jsx(Pillish, { label: "Kind", icon: _jsx(Sparkles, { size: 13 }), value: picked ? kind(picked).label : 'Auto' }), items: kindItems }), _jsx(DropdownMenu, { trigger: _jsx(Pillish, { label: "Brand", icon: _jsx(Palette, { size: 13 }), value: brandName }), items: brandItems }), _jsx(DropdownMenu, { trigger: _jsx(XStack, { render: "button", "aria-label": "More options: model, aspect, count", width: 32, height: 32, items: "center", justify: "center", rounded: 999, cursor: "pointer", hoverStyle: { bg: '$hover' }, children: _jsx(Ellipsis, { size: 16 }) }), items: optionItems })] }));
|
|
325
321
|
const head = attached.length || uploading ? (_jsxs(XStack, { gap: "$2", flexWrap: "wrap", "data-slot": "attached", children: [attached.map((f) => (_jsxs(XStack, { position: "relative", children: [_jsx(Thumb, { wire: wire, file: f }), _jsx(XStack, { render: "button", "aria-label": `Remove ${f.name}`, onPress: () => setAttached((a) => a.filter((x) => x.key !== f.key)), position: "absolute", t: -6, r: -6, width: 20, height: 20, rounded: 99, bg: "$background", borderWidth: 1, borderColor: "$borderColor", items: "center", justify: "center", cursor: "pointer", children: _jsx(X, { size: 11 }) })] }, f.key))), uploading ? (_jsx(XStack, { width: 56, height: 56, rounded: "$3", bg: "$hover", items: "center", justify: "center", children: _jsx(LoaderCircle, { size: 16 }) })) : null] })) : undefined;
|
|
326
|
-
const composer =
|
|
322
|
+
const composer = {
|
|
327
323
|
value: draft,
|
|
328
324
|
onChange: setDraft,
|
|
329
325
|
onSend: () => void send(draft),
|
|
@@ -333,16 +329,16 @@ function Conversation({ start, host, wire, available }) {
|
|
|
333
329
|
placeholder: empty ? 'What should we create?' : 'Ask for a change, or something new',
|
|
334
330
|
label: 'What should we create?',
|
|
335
331
|
head,
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
332
|
+
plus: { upload: attach },
|
|
333
|
+
// Kind, Brand and the image options are the pills above the field.
|
|
334
|
+
pills: tools,
|
|
335
|
+
column: true,
|
|
339
336
|
narrow: !wide,
|
|
340
|
-
|
|
341
|
-
|
|
337
|
+
// While nothing has been made: where to start.
|
|
338
|
+
starters: empty ? _jsx(Home, { available: available, onStart: begin }) : undefined,
|
|
339
|
+
};
|
|
342
340
|
const deskPane = (sheet) => (_jsx(Panel, { side: deck, kinds: tabs, onHide: () => setDesk(false), sheet: sheet, label: "What this conversation made" }));
|
|
343
|
-
return (_jsxs(XStack, { "data-slot": "studio-split", flex: 1, minH: 0, minW: 0, width: "100%", children: [_jsxs(YStack, { "data-slot": "studio-talk", ...pane, flex: 1, minH: 0, minW: 0, width: "100%", overflow: "hidden", children: [_jsxs(XStack, { px: "$4", pt: "$3", pb: "$2", gap: "$2", items: "center", minH: 44, children: [_jsx(SizableText, { render: "h1", size: "$5", color: "$ink", numberOfLines: 1, flex: 1, minW: 0, children: empty ? 'Studio' : chat.title }), chat.made.length ? _jsx(PanelToggle, { open: desk, onToggle: () => setDesk(!desk) }) : null] }), _jsx(Thread, { messages: messages, streaming: busy, send: (text) => void send(text), stop: working ? () => working.abort() : undefined, body: body, center: true, onFiles: (files) => void upload(files), empty: _jsx(Opening, {}), composer:
|
|
344
|
-
deskBox.current = el instanceof HTMLElement ? el : null;
|
|
345
|
-
}, ...pane, ml: gap, position: "relative", shrink: 0, minH: 0, overflow: "hidden", style: { width: span, maxWidth: `calc(100% - ${TALK_FLOOR}px)`, minWidth: DESK_FLOOR }, children: [_jsx(Grip, { side: "right", span: span, floor: DESK_FLOOR, ceil: 1400, reset: DESK, onSpan: (n) => deskBox.current?.style.setProperty('width', `${n}px`), onKeep: setSpan, onShut: () => setDesk(false), label: "Resize the tabs", l: `calc(-1 * ${gap} - 1px)`, width: gap }), deskPane(false)] })) : null] }));
|
|
341
|
+
return (_jsxs(XStack, { "data-slot": "studio-split", flex: 1, minH: 0, minW: 0, width: "100%", children: [_jsxs(YStack, { "data-slot": "studio-talk", ref: split.main, style: split.mainStyle, ...pane, flex: 1, minH: 0, minW: 0, width: "100%", overflow: "hidden", children: [_jsxs(XStack, { px: "$4", pt: "$3", pb: "$2", gap: "$2", items: "center", minH: 44, children: [_jsx(SizableText, { render: "h1", size: "$5", color: "$ink", numberOfLines: 1, flex: 1, minW: 0, children: empty ? 'Studio' : chat.title }), chat.made.length ? _jsx(PanelToggle, { open: desk, onToggle: () => setDesk(!desk) }) : null] }), _jsx(Thread, { messages: messages, streaming: busy, send: (text) => void send(text), stop: working ? () => working.abort() : undefined, body: body, center: true, onFiles: (files) => void upload(files), empty: _jsx(Opening, {}), composer: composer })] }), desk && chat.made.length && !wide ? deskPane(true) : null, desk && chat.made.length && wide ? (_jsxs(YStack, { "data-slot": "studio-desk", ref: split.aside, ...pane, ml: gap, position: "relative", shrink: 0, minH: 0, style: split.asideStyle, children: [split.grip ? (_jsx(Gutter, { ...split.grip, label: "Resize the tabs", inset: pane.borderWidth })) : null, _jsx(SideProvider, { value: split.side, children: deskPane(false) })] })) : null] }));
|
|
346
342
|
}
|
|
347
343
|
function brandOf(chat) {
|
|
348
344
|
const m = chat.brand ? chat.made.find((x) => x.id === chat.brand) : null;
|
package/lib/wire.js
CHANGED
|
@@ -256,7 +256,7 @@ function withheld(model, h) {
|
|
|
256
256
|
if (!why)
|
|
257
257
|
return new Refusal(502, `${model} answered with no picture.`);
|
|
258
258
|
const fix = h?.get('X-Hanzo-Upgrade-Url') || h?.get('X-Hanzo-Topup-Url') || '';
|
|
259
|
-
return new Refusal(402, `${WITHHELD[why] ??
|
|
259
|
+
return new Refusal(402, `${WITHHELD[why] ?? 'Pictures are not available on this plan'}${fix ? `: ${fix}` : '.'}`, why);
|
|
260
260
|
}
|
|
261
261
|
/** Speech from words: the platform's voice. */
|
|
262
262
|
export async function speak(w, input, voice, model, signal) {
|
package/package.json
CHANGED
|
@@ -1,40 +1,52 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@hanzo/studio",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.7",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"license": "BSD-3-Clause",
|
|
6
6
|
"description": "Hanzo Studio: a chat that makes images, posters, documents, slides, type systems, 3D, video and sound, with every result open in a tab beside it. Mounted by the Hanzo app at hanzo.ai/studio and served whole at studio.hanzo.ai.",
|
|
7
7
|
"homepage": "https://studio.hanzo.ai",
|
|
8
|
+
"packageManager": "pnpm@11.24.0",
|
|
8
9
|
"engines": {
|
|
9
10
|
"node": ">=22.18"
|
|
10
11
|
},
|
|
12
|
+
"scripts": {
|
|
13
|
+
"dev": "vite",
|
|
14
|
+
"build": "tsc --noEmit && vite build",
|
|
15
|
+
"build:lib": "rm -rf lib && tsc -p tsconfig.lib.json",
|
|
16
|
+
"typecheck": "tsc --noEmit",
|
|
17
|
+
"preview": "vite preview",
|
|
18
|
+
"test": "vitest run",
|
|
19
|
+
"e2e": "playwright test",
|
|
20
|
+
"prepack": "pnpm run build:lib"
|
|
21
|
+
},
|
|
11
22
|
"dependencies": {
|
|
12
|
-
"three": "
|
|
23
|
+
"three": "catalog:"
|
|
13
24
|
},
|
|
14
25
|
"devDependencies": {
|
|
15
|
-
"@axe-core/playwright": "
|
|
16
|
-
"@hanzo/build": "
|
|
17
|
-
"@hanzo/composer": "
|
|
18
|
-
"@hanzo/font": "
|
|
19
|
-
"@hanzo/gui": "
|
|
20
|
-
"@hanzo/
|
|
21
|
-
"@hanzo/
|
|
22
|
-
"@hanzo/
|
|
23
|
-
"@
|
|
24
|
-
"@hanzogui/
|
|
25
|
-
"@
|
|
26
|
-
"@
|
|
27
|
-
"@types/
|
|
28
|
-
"@types/react
|
|
29
|
-
"@types/
|
|
30
|
-
"@
|
|
31
|
-
"
|
|
32
|
-
"
|
|
33
|
-
"react
|
|
34
|
-
"react-
|
|
35
|
-
"
|
|
36
|
-
"
|
|
37
|
-
"
|
|
26
|
+
"@axe-core/playwright": "catalog:",
|
|
27
|
+
"@hanzo/build": "catalog:",
|
|
28
|
+
"@hanzo/composer": "catalog:",
|
|
29
|
+
"@hanzo/font": "catalog:",
|
|
30
|
+
"@hanzo/gui": "catalog:",
|
|
31
|
+
"@hanzo/i18n": "catalog:",
|
|
32
|
+
"@hanzo/ui": "catalog:",
|
|
33
|
+
"@hanzo/vite": "catalog:",
|
|
34
|
+
"@hanzo/voice": "catalog:",
|
|
35
|
+
"@hanzogui/lucide-icons-2": "catalog:",
|
|
36
|
+
"@hanzogui/next-theme": "catalog:",
|
|
37
|
+
"@playwright/test": "catalog:",
|
|
38
|
+
"@types/node": "catalog:",
|
|
39
|
+
"@types/react": "catalog:",
|
|
40
|
+
"@types/react-dom": "catalog:",
|
|
41
|
+
"@types/three": "catalog:",
|
|
42
|
+
"@vitejs/plugin-react": "catalog:",
|
|
43
|
+
"next-themes": "catalog:",
|
|
44
|
+
"react": "catalog:",
|
|
45
|
+
"react-dom": "catalog:",
|
|
46
|
+
"react-native-web": "catalog:",
|
|
47
|
+
"typescript": "catalog:",
|
|
48
|
+
"vite": "catalog:",
|
|
49
|
+
"vitest": "catalog:"
|
|
38
50
|
},
|
|
39
51
|
"exports": {
|
|
40
52
|
".": {
|
|
@@ -58,21 +70,13 @@
|
|
|
58
70
|
"url": "git+https://github.com/hanzoai/studio.git"
|
|
59
71
|
},
|
|
60
72
|
"peerDependencies": {
|
|
61
|
-
"@hanzo/build": ">=0.2.
|
|
73
|
+
"@hanzo/build": ">=0.2.85",
|
|
62
74
|
"@hanzo/composer": ">=0.2.0",
|
|
63
75
|
"@hanzo/gui": ">=8.3.5",
|
|
64
|
-
"@hanzo/
|
|
65
|
-
"@hanzo/
|
|
76
|
+
"@hanzo/i18n": ">=0.4.0",
|
|
77
|
+
"@hanzo/ui": ">=8.29.24",
|
|
78
|
+
"@hanzo/voice": ">=0.1.19",
|
|
66
79
|
"@hanzogui/lucide-icons-2": ">=8.3.5",
|
|
67
80
|
"react": ">=19.2.8"
|
|
68
|
-
},
|
|
69
|
-
"scripts": {
|
|
70
|
-
"dev": "vite",
|
|
71
|
-
"build": "tsc --noEmit && vite build",
|
|
72
|
-
"build:lib": "rm -rf lib && tsc -p tsconfig.lib.json",
|
|
73
|
-
"typecheck": "tsc --noEmit",
|
|
74
|
-
"preview": "vite preview",
|
|
75
|
-
"test": "vitest run",
|
|
76
|
-
"e2e": "playwright test"
|
|
77
81
|
}
|
|
78
|
-
}
|
|
82
|
+
}
|