@hanzo/studio 0.1.22 → 0.1.23
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/app/director.js +7 -34
- package/lib/spend.js +1 -0
- package/package.json +1 -1
package/lib/app/director.js
CHANGED
|
@@ -485,8 +485,12 @@ export function DirectorStudio({ host }) {
|
|
|
485
485
|
if (generatingDoc)
|
|
486
486
|
return;
|
|
487
487
|
setGeneratingDoc(true);
|
|
488
|
-
setStatusNote(`Generating ${tpl.title} (${tpl.format}) with ${selectedBrand.name} design system → ${tpl.endpoint}…`);
|
|
489
488
|
try {
|
|
489
|
+
if (!(await confirm('document', { what: `This makes one ${tpl.title} (${tpl.format}) from your brief.` }))) {
|
|
490
|
+
setStatusNote('Not started.');
|
|
491
|
+
return;
|
|
492
|
+
}
|
|
493
|
+
setStatusNote(`Generating ${tpl.title} (${tpl.format}) with ${selectedBrand.name} design system → ${tpl.endpoint}…`);
|
|
490
494
|
const fields = { category: tpl.category, format: tpl.format, brand_system: selectedBrand.id };
|
|
491
495
|
const body = tpl.endpoint === '/v1/documents/generate'
|
|
492
496
|
? await documents.generate(wire, { templateId: tpl.id, description: docBrief, fields })
|
|
@@ -914,31 +918,6 @@ export function DirectorStudio({ host }) {
|
|
|
914
918
|
raf = requestAnimationFrame(draw3D);
|
|
915
919
|
return () => cancelAnimationFrame(raf);
|
|
916
920
|
}, [section, activeMesh, meshShader, meshAutoRotate, meshLightAngle, meshOctree]);
|
|
917
|
-
const triggerCinemaAudio = () => {
|
|
918
|
-
try {
|
|
919
|
-
const Ctx = window.AudioContext || window.webkitAudioContext;
|
|
920
|
-
const ctx = audioCtxRef.current ?? new Ctx();
|
|
921
|
-
audioCtxRef.current = ctx;
|
|
922
|
-
if (ctx.state === 'suspended')
|
|
923
|
-
void ctx.resume();
|
|
924
|
-
const now = ctx.currentTime;
|
|
925
|
-
const osc = ctx.createOscillator();
|
|
926
|
-
const gain = ctx.createGain();
|
|
927
|
-
osc.type = 'sawtooth';
|
|
928
|
-
osc.frequency.setValueAtTime(55, now);
|
|
929
|
-
osc.frequency.exponentialRampToValueAtTime(110, now + 1.2);
|
|
930
|
-
gain.gain.setValueAtTime(0.001, now);
|
|
931
|
-
gain.gain.exponentialRampToValueAtTime(0.12, now + 0.15);
|
|
932
|
-
gain.gain.exponentialRampToValueAtTime(0.001, now + 1.6);
|
|
933
|
-
osc.connect(gain);
|
|
934
|
-
gain.connect(ctx.destination);
|
|
935
|
-
osc.start(now);
|
|
936
|
-
osc.stop(now + 1.65);
|
|
937
|
-
}
|
|
938
|
-
catch {
|
|
939
|
-
// Ignore if audio is blocked
|
|
940
|
-
}
|
|
941
|
-
};
|
|
942
921
|
const renderShotOnCloud = async (shot) => {
|
|
943
922
|
if (renderingId)
|
|
944
923
|
return;
|
|
@@ -1189,10 +1168,7 @@ export function DirectorStudio({ host }) {
|
|
|
1189
1168
|
}) }), _jsxs(YStack, { gap: "$1.5", children: [_jsx(SizableText, { size: "$1", color: "$soft", children: "Octree marching-cubes resolution" }), _jsx(XStack, { gap: "$2", children: [256, 384, 512].map((res) => {
|
|
1190
1169
|
const on = meshOctree === res;
|
|
1191
1170
|
return (_jsx(XStack, { render: _jsx("button", { type: "button" }), "aria-pressed": on, onClick: () => setMeshOctree(res), px: "$3", minH: 44, "$max-sm": { minH: 44 }, $md: { minH: 28, height: 28 }, items: "center", rounded: 999, borderWidth: 1, borderColor: on ? '$ink' : 'var(--border-strong)', bg: on ? 'var(--surface-card-emphasis)' : 'transparent', hoverStyle: { bg: '$hover' }, focusVisibleStyle: RING, cursor: "pointer", children: _jsx(SizableText, { size: "$1", fontFamily: "$mono", fontWeight: on ? '600' : '500', color: on ? '$ink' : '$soft', children: `${res}³` }) }, res));
|
|
1192
|
-
}) })] }), _jsx(StudioTextarea, { "aria-label": "3D mesh conditioning prompt", style: { resize: 'none' }, ...{ value: meshPrompt, rows: 3 }, onChange: (e) => setMeshPrompt(e.currentTarget.value) }), _jsxs(
|
|
1193
|
-
triggerCinemaAudio();
|
|
1194
|
-
setStatusNote(`Dispatched Mori 3D 2.1 mesh job (${meshOctree}³ octree) → /v1/library/model3d`);
|
|
1195
|
-
}, height: 36, rounded: 999, bg: "$ink", items: "center", justify: "center", gap: "$1.5", cursor: "pointer", children: [_jsx(Box, { size: 14 }), _jsx(SizableText, { size: "$2", color: "$background", fontWeight: "600", children: "Generate 3D Mesh (.GLB)" })] })] }), _jsxs(YStack, { width: "100%", minW: 0, $lg: { flex: 1 }, gap: "$3", p: "$3.5", rounded: "$4", borderWidth: 1, borderColor: "var(--border)", bg: "var(--surface-card)", children: [_jsxs(YStack, { gap: "$2", minW: 0, children: [_jsxs(YStack, { gap: 2, minW: 0, children: [_jsx(SizableText, { render: "h2", size: "$3", fontWeight: "600", color: "$ink", children: activeMesh.name }), _jsx(SizableText, { size: "$1", color: "$soft", fontFamily: "$mono", children: `${activeMesh.vertices.toLocaleString()} vertices · ${activeMesh.faces.toLocaleString()} triangles · Watertight PBR GLB` })] }), _jsxs(XStack, { gap: "$1.5", flexWrap: "wrap", items: "center", children: [[
|
|
1171
|
+
}) })] }), _jsx(StudioTextarea, { "aria-label": "3D mesh conditioning prompt", style: { resize: 'none' }, ...{ value: meshPrompt, rows: 3 }, onChange: (e) => setMeshPrompt(e.currentTarget.value) }), _jsx(SizableText, { size: "$1", color: "$soft", children: "Making a 3D mesh from here is not connected yet, so nothing is sent. The preview above is a sample shape, not a result." })] }), _jsxs(YStack, { width: "100%", minW: 0, $lg: { flex: 1 }, gap: "$3", p: "$3.5", rounded: "$4", borderWidth: 1, borderColor: "var(--border)", bg: "var(--surface-card)", children: [_jsxs(YStack, { gap: "$2", minW: 0, children: [_jsxs(YStack, { gap: 2, minW: 0, children: [_jsx(SizableText, { render: "h2", size: "$3", fontWeight: "600", color: "$ink", children: activeMesh.name }), _jsx(SizableText, { size: "$1", color: "$soft", fontFamily: "$mono", children: `${activeMesh.vertices.toLocaleString()} vertices · ${activeMesh.faces.toLocaleString()} triangles · Watertight PBR GLB` })] }), _jsxs(XStack, { gap: "$1.5", flexWrap: "wrap", items: "center", children: [[
|
|
1196
1172
|
{ id: 'pbr', label: 'PBR' },
|
|
1197
1173
|
{ id: 'wireframe', label: 'Wireframe' },
|
|
1198
1174
|
{ id: 'normal', label: 'Normal' },
|
|
@@ -1214,10 +1190,7 @@ export function DirectorStudio({ host }) {
|
|
|
1214
1190
|
.map((it) => (_jsxs(YStack, { role: "listitem", width: "100%", $sm: { width: 'calc(50% - 5px)' }, minW: 0, p: "$3", rounded: "$3", borderWidth: 1, borderColor: "var(--border-strong)", bg: "var(--background)", gap: "$2", children: [_jsxs(XStack, { justify: "space-between", items: "center", gap: "$2", children: [_jsxs(XStack, { items: "center", gap: "$1.5", flex: 1, minW: 0, children: [_jsx(Folder, { size: 12, color: "$soft" }), _jsx(SizableText, { size: "$1", color: "$soft", numberOfLines: 1, children: it.stack })] }), _jsx(SizableText, { size: "$1", fontFamily: "$mono", color: it.status === 'published' || it.status === 'approved' ? 'var(--state-success)' : '$soft', shrink: 0, children: it.status === 'published' ? 'Published' : it.status === 'approved' ? 'Approved' : 'Draft' })] }), _jsx(SizableText, { size: "$2", fontWeight: "600", color: "$ink", children: it.title }), it.modality === 'image' && /^(blob:|data:image\/|https?:)/.test(it.path) ? (_jsx("img", { src: it.path, alt: it.title, style: { width: '100%', borderRadius: 8, display: 'block' } })) : null, _jsx(SizableText, { size: "$1", color: "$soft", fontFamily: "$mono", numberOfLines: 2, children: `${/^(blob|data):/.test(it.path) ? 'Generated image' : it.path} · graph: ${it.workflow}` }), it.critique ? (_jsx(SizableText, { size: "$1", color: "$soft", children: `Conditioning note: “${it.critique}”` })) : null, _jsxs(XStack, { justify: "space-between", items: "center", flexWrap: "wrap", gap: "$1.5", pt: "$1", children: [_jsxs(XStack, { gap: "$1.5", children: [_jsxs(XStack, { render: _jsx("button", { type: "button" }), "aria-pressed": it.vote === 1, onClick: () => setLibraryItems((prev) => prev.map((x) => (x.id === it.id ? { ...x, vote: x.vote === 1 ? 0 : 1 } : x))), px: "$2", minH: 44, "$max-sm": { minH: 44 }, $md: { minH: 26, height: 26 }, items: "center", gap: "$1", rounded: "$2", borderWidth: 1, borderColor: it.vote === 1 ? 'var(--state-success)' : 'var(--border-strong)', bg: it.vote === 1 ? 'var(--state-success-bg)' : 'transparent', hoverStyle: { bg: '$hover' }, focusVisibleStyle: RING, cursor: "pointer", children: [_jsx(ThumbsUp, { size: 12, color: it.vote === 1 ? 'var(--state-success)' : '$ink' }), _jsx(SizableText, { size: "$1", color: it.vote === 1 ? 'var(--state-success)' : '$ink', children: "Good" })] }), _jsxs(XStack, { render: _jsx("button", { type: "button" }), "aria-pressed": it.vote === -1, onClick: () => setLibraryItems((prev) => prev.map((x) => (x.id === it.id ? { ...x, vote: x.vote === -1 ? 0 : -1 } : x))), px: "$2", minH: 44, "$max-sm": { minH: 44 }, $md: { minH: 26, height: 26 }, items: "center", gap: "$1", rounded: "$2", borderWidth: 1, borderColor: it.vote === -1 ? 'var(--state-error)' : 'var(--border-strong)', bg: it.vote === -1 ? 'var(--state-error-bg)' : 'transparent', hoverStyle: { bg: '$hover' }, focusVisibleStyle: RING, cursor: "pointer", children: [_jsx(ThumbsDown, { size: 12, color: it.vote === -1 ? 'var(--state-error)' : '$ink' }), _jsx(SizableText, { size: "$1", color: it.vote === -1 ? 'var(--state-error)' : '$ink', children: "Fix" })] })] }), _jsx(XStack, { render: "button", onPress: () => {
|
|
1215
1191
|
setLibraryItems((prev) => prev.map((x) => (x.id === it.id ? { ...x, status: 'published' } : x)));
|
|
1216
1192
|
setStatusNote(`Published "${it.title}" to Gallery & cms.hanzo.ai`);
|
|
1217
|
-
}, px: "$2.5", height: 26, items: "center", rounded: "$2", borderWidth: 1, borderColor: "$borderColor", cursor: "pointer", children: _jsx(SizableText, { size: "$1", children: "\u2601 Publish CMS" }) })] })] }, it.id))) })] }), _jsxs(YStack, { width: "100%", minW: 0, $lg: { width: 272, shrink: 0 }, $xl: { width: 280 }, gap: "$3", p: "$3", rounded: "$4", borderWidth: 1, borderColor: "var(--border)", bg: "var(--surface-card)", children: [_jsx(SizableText, { render: "h2", size: "$3", fontWeight: "600", color: "$ink", children: "Iro-Image-Edit 2511 mask inpaint" }), _jsx(SizableText, { size: "$1", color: "$soft", children: "Paint a mask region or attach 2\u20135 references to edit only the selected area while preserving subject identity and lighting (/v1/library/fix)." }), _jsxs(YStack, { gap: "$1", children: [_jsx(SizableText, { size: "$1", color: "$soft", children: "Edit instruction" }), _jsx(StudioTextarea, { "aria-label": "Inpaint edit instruction", style: { resize: 'none' }, ...{ value: inpaintInstruction, rows: 3 }, onChange: (e) => setInpaintInstruction(e.currentTarget.value) })] }), _jsxs(YStack, { gap: "$1", children: [_jsx(SizableText, { size: "$1", color: "$soft", fontFamily: "$mono", children: `Denoise / edit strength: ${inpaintStrength}%` }), _jsx("input", { "aria-label": "Edit strength percentage", type: "range", min: 10, max: 95, step: 5, value: inpaintStrength, onChange: (e) => setInpaintStrength(Number(e.currentTarget.value)) })] }), _jsx("canvas", { ref: inpaintCanvasRef, width: 280, height: 4, style: { display: 'none' } }), _jsxs(XStack, { render: "button", onPress: () => {
|
|
1218
|
-
triggerCinemaAudio();
|
|
1219
|
-
setStatusNote(`Queued Iro-Image-Edit 2511 pass (${inpaintStrength}% denoise) → /v1/library/fix`);
|
|
1220
|
-
}, height: 34, rounded: 999, bg: "$ink", items: "center", justify: "center", gap: "$1.5", cursor: "pointer", children: [_jsx(Wand2, { size: 13 }), _jsx(SizableText, { size: "$1", color: "$background", fontWeight: "600", children: "Run Region Edit (/v1/library/fix)" })] })] })] })) : null, section === 'queue' ? (_jsxs(YStack, { gap: "$3", p: "$3.5", rounded: "$4", borderWidth: 1, borderColor: "var(--border)", bg: "var(--surface-card)", minW: 0, children: [_jsxs(XStack, { items: "center", justify: "space-between", flexWrap: "wrap", gap: "$2", children: [_jsxs(YStack, { gap: 2, flex: 1, minW: 200, children: [_jsx(SizableText, { render: "h2", size: "$3", fontWeight: "600", color: "$ink", children: "GPU federation fleet & durable render queue (tasks.hanzo.ai)" }), _jsx(SizableText, { size: "$1", color: "$soft", children: "Select a target GPU node (X-Target-GPU) or route jobs across the shared gpu-jobs cluster." })] }), _jsxs(XStack, { render: "button", onPress: () => setStatusNote('Refreshed /v1/gpu-status & /v1/queue/status'), px: "$3", height: 30, items: "center", gap: "$1.5", rounded: 999, borderWidth: 1, borderColor: "$borderColor", cursor: "pointer", children: [_jsx(RefreshCw, { size: 12 }), _jsx(SizableText, { size: "$1", children: "Refresh Fleet" })] })] }), _jsx(XStack, { gap: "$2.5", flexWrap: "wrap", role: "list", "aria-label": "GPU nodes", width: "100%", minW: 0, children: gpuNodes.map((n) => {
|
|
1193
|
+
}, px: "$2.5", height: 26, items: "center", rounded: "$2", borderWidth: 1, borderColor: "$borderColor", cursor: "pointer", children: _jsx(SizableText, { size: "$1", children: "\u2601 Publish CMS" }) })] })] }, it.id))) })] }), _jsxs(YStack, { width: "100%", minW: 0, $lg: { width: 272, shrink: 0 }, $xl: { width: 280 }, gap: "$3", p: "$3", rounded: "$4", borderWidth: 1, borderColor: "var(--border)", bg: "var(--surface-card)", children: [_jsx(SizableText, { render: "h2", size: "$3", fontWeight: "600", color: "$ink", children: "Iro-Image-Edit 2511 mask inpaint" }), _jsx(SizableText, { size: "$1", color: "$soft", children: "Paint a mask region or attach 2\u20135 references to edit only the selected area while preserving subject identity and lighting (/v1/library/fix)." }), _jsxs(YStack, { gap: "$1", children: [_jsx(SizableText, { size: "$1", color: "$soft", children: "Edit instruction" }), _jsx(StudioTextarea, { "aria-label": "Inpaint edit instruction", style: { resize: 'none' }, ...{ value: inpaintInstruction, rows: 3 }, onChange: (e) => setInpaintInstruction(e.currentTarget.value) })] }), _jsxs(YStack, { gap: "$1", children: [_jsx(SizableText, { size: "$1", color: "$soft", fontFamily: "$mono", children: `Denoise / edit strength: ${inpaintStrength}%` }), _jsx("input", { "aria-label": "Edit strength percentage", type: "range", min: 10, max: 95, step: 5, value: inpaintStrength, onChange: (e) => setInpaintStrength(Number(e.currentTarget.value)) })] }), _jsx("canvas", { ref: inpaintCanvasRef, width: 280, height: 4, style: { display: 'none' } }), _jsx(SizableText, { size: "$1", color: "$soft", children: "Region edit is not connected yet, so nothing is sent and no edited picture is made from here." })] })] })) : null, section === 'queue' ? (_jsxs(YStack, { gap: "$3", p: "$3.5", rounded: "$4", borderWidth: 1, borderColor: "var(--border)", bg: "var(--surface-card)", minW: 0, children: [_jsxs(XStack, { items: "center", justify: "space-between", flexWrap: "wrap", gap: "$2", children: [_jsxs(YStack, { gap: 2, flex: 1, minW: 200, children: [_jsx(SizableText, { render: "h2", size: "$3", fontWeight: "600", color: "$ink", children: "GPU federation fleet & durable render queue (tasks.hanzo.ai)" }), _jsx(SizableText, { size: "$1", color: "$soft", children: "Select a target GPU node (X-Target-GPU) or route jobs across the shared gpu-jobs cluster." })] }), _jsxs(XStack, { render: "button", onPress: () => setStatusNote('Refreshed /v1/gpu-status & /v1/queue/status'), px: "$3", height: 30, items: "center", gap: "$1.5", rounded: 999, borderWidth: 1, borderColor: "$borderColor", cursor: "pointer", children: [_jsx(RefreshCw, { size: 12 }), _jsx(SizableText, { size: "$1", children: "Refresh Fleet" })] })] }), _jsx(XStack, { gap: "$2.5", flexWrap: "wrap", role: "list", "aria-label": "GPU nodes", width: "100%", minW: 0, children: gpuNodes.map((n) => {
|
|
1221
1194
|
const selected = targetGpu === n.name;
|
|
1222
1195
|
return (_jsx(YStack, { role: "listitem", width: "100%", $sm: { width: 'calc(50% - 5px)' }, minW: 0, children: _jsxs(YStack, { render: _jsx("button", { type: "button" }), onClick: () => {
|
|
1223
1196
|
setTargetGpu(selected ? 'any' : n.name);
|
package/lib/spend.js
CHANGED
|
@@ -25,6 +25,7 @@ export const WORDS = {
|
|
|
25
25
|
'design-video': { title: 'Make this clip?', what: 'This makes one short video clip, which keeps rendering if you leave this page.', yes: 'Make clip' },
|
|
26
26
|
'design-gpu': { title: 'Render on your GPU?', what: "This renders on your organization's GPU, where it keeps going if you leave this page.", yes: 'Start render' },
|
|
27
27
|
voice: { title: 'Read this aloud?', what: "This makes speech from your words with the platform's voice.", yes: 'Read it' },
|
|
28
|
+
document: { title: 'Make this document?', what: 'This makes one document from your brief.', yes: 'Make it' },
|
|
28
29
|
'flow-run': { title: 'Run this flow?', what: 'This queues the flow on the GPU, where it keeps running if you leave this page.', yes: 'Run flow' },
|
|
29
30
|
'flow-mutate': { title: 'Ask Copilot to change the flow?', what: 'This sends your words and the flow to a model.', yes: 'Ask Copilot' },
|
|
30
31
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@hanzo/studio",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.23",
|
|
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.",
|