@hanzo/build 0.2.89 → 0.2.91

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/landing.js CHANGED
@@ -366,7 +366,7 @@ export function Landing({ onStarted }) {
366
366
  };
367
367
  return (_jsxs(YStack, { display: "grid", gridTemplateRows: "minmax(0, 1fr) auto", items: "center", width: "100%", height: "100%", overflowX: "hidden", "data-slot": "new", children: [_jsx(YStack, { display: "grid", gridTemplateRows: "1fr auto", width: "100%", maxW: MEASURE, height: "100%", pb: "$3", overflowY: "auto", children: _jsx(SizableText, { render: "h1", fontSize: "$7", lineHeight: "$7", fontWeight: "700", color: "$ink", style: { textAlign: 'center' }, children: t('Build what’s next.') }) }), _jsx(YStack, { width: "100%", maxW: MEASURE, gap: "$2", pb: 12, children: _jsxs(YStack, { gap: "$2", children: [stranger ? (_jsxs(XStack, { items: "center", justify: "space-between", gap: "$3", px: "$3", py: "$2", rounded: "$10", borderWidth: 1, borderColor: "$borderColor", role: "alert", children: [_jsx(SizableText, { size: "$2", color: "$ink", flex: 1, minW: 0, children: t('{repo} is not one of this organization’s repositories.', { repo: codebase }) }), _jsx(Button, { size: "sm", variant: "outline", onPress: () => setPicking(true), children: t('Choose a repository') })] })) : env.value && (env.value.state === 'proposed' || unset(env.value)) && !place.id ? (_jsxs(XStack, { items: "center", justify: "space-between", gap: "$3", px: "$3", py: "$2", rounded: "$10", borderWidth: 1, borderColor: "$borderColor", children: [_jsx(SizableText, { size: "$2", color: "$ink", flex: 1, minW: 0, children: env.value.state === 'proposed'
368
368
  ? t('A proposed environment for {repo} is waiting for review.', { repo: codebase })
369
- : t('{repo} has no environment yet, so every run starts it bare.', { repo: codebase }) }), env.value.state === 'proposed' && env.value.session ? (_jsx(Button, { size: "sm", variant: "outline", onPress: () => host.go(env.value.session), children: t('Review') })) : (_jsx(Button, { size: "sm", onPress: () => setOffering(true), children: t('Set up environment') }))] })) : null, note || unhonoured(mode, place.id, t) || mind.note ? (_jsx(SizableText, { size: "$1", color: "$soft", role: "status", children: note || unhonoured(mode, place.id, t) || mind.note })) : null, _jsx(Composer, { column: true, framed: true, value: draft, onChange: setDraft, onSend: () => void send(), busy: busy, placeholder: t('Ask, build, or run anything…'), label: t('Describe a task or ask a question'), plus: {
369
+ : t('{repo} has no environment yet, so every run starts it bare.', { repo: codebase }) }), env.value.state === 'proposed' && env.value.session ? (_jsx(Button, { size: "sm", variant: "outline", onPress: () => host.go(env.value.session), children: t('Review') })) : (_jsx(Button, { size: "sm", onPress: () => setOffering(true), children: t('Set up environment') }))] })) : null, note || unhonoured(mode, place.id, t) || mind.note ? (_jsx(SizableText, { size: "$1", color: "$soft", role: "status", children: note || unhonoured(mode, place.id, t) || mind.note })) : null, _jsx(Composer, { column: true, value: draft, onChange: setDraft, onSend: () => void send(), busy: busy, placeholder: t('Ask, build, or run anything…'), label: t('Describe a task or ask a question'), plus: {
370
370
  upload: () => pick(files, setFiles, setNote, t),
371
371
  skills: carry.skills,
372
372
  design: carry.design,
package/lib/project.js CHANGED
@@ -422,7 +422,7 @@ export function Project({ at }) {
422
422
  ? t('{name} is loaded and nothing is published yet. Say what to change and it gets built.', { name: project.name })
423
423
  : named
424
424
  ? t('{repo} is open on {branch}. Say what to change and it gets built there.', { repo: `${named.org}/${named.name}`, branch: home })
425
- : t('{name} is loaded. Say what to change and it gets built.', { name: slug }) })) : (ordered.map((r) => (_jsxs(YStack, { gap: "$2", children: [_jsx(Turn, { run: r, open: r.id === current, onOpen: () => setChosen(r.id), project: slug }), r.id === current ? (_jsxs(YStack, { gap: "$1", paddingInlineStart: "$2", borderInlineStartWidth: 1, borderColor: "$borderColor", children: [fold(run.events.map((e) => ({ kind: e.kind, actor: who(e.actor), seq: e.seq, id: e.id, text: said(e, run.record?.mode, t) })).filter((b) => b.text)).map((b) => (_jsx(SizableText, { size: "$1", color: "$soft", children: b.text }, b.key))), pr.href ? (_jsxs(XStack, { items: "center", gap: "$2", flexWrap: "wrap", children: [_jsxs(Out, { href: pr.href, label: t('Open pull request {pr}', { pr: pr.label }), children: [_jsx(SizableText, { size: "$1", color: "$ink", textDecorationLine: "underline", children: t('Pull request {pr}', { pr: pr.label }) }), _jsx(ExternalLink, { size: 11 })] }), _jsx(Merge, { session: r.id, open: proposing, onMerged: merged })] })) : null] })) : null] }, r.id)))) }), _jsxs(YStack, { "data-slot": "project-ask", px: "$3", pb: "$3", gap: "$2", minW: 0, $md: { pr: 0 }, children: [note ? (_jsx(SizableText, { size: "$1", color: "$soft", role: "status", children: note })) : null, picked.length ? _jsx(Attachments, { items: picked, onRemove: () => setPicked([]) }) : null, _jsx(Composer, { column: true, framed: true, value: draft, onChange: setDraft, onSend: () => void (current && running ? steer(current) : send()), onStop: current
425
+ : t('{name} is loaded. Say what to change and it gets built.', { name: slug }) })) : (ordered.map((r) => (_jsxs(YStack, { gap: "$2", children: [_jsx(Turn, { run: r, open: r.id === current, onOpen: () => setChosen(r.id), project: slug }), r.id === current ? (_jsxs(YStack, { gap: "$1", paddingInlineStart: "$2", borderInlineStartWidth: 1, borderColor: "$borderColor", children: [fold(run.events.map((e) => ({ kind: e.kind, actor: who(e.actor), seq: e.seq, id: e.id, text: said(e, run.record?.mode, t) })).filter((b) => b.text)).map((b) => (_jsx(SizableText, { size: "$1", color: "$soft", children: b.text }, b.key))), pr.href ? (_jsxs(XStack, { items: "center", gap: "$2", flexWrap: "wrap", children: [_jsxs(Out, { href: pr.href, label: t('Open pull request {pr}', { pr: pr.label }), children: [_jsx(SizableText, { size: "$1", color: "$ink", textDecorationLine: "underline", children: t('Pull request {pr}', { pr: pr.label }) }), _jsx(ExternalLink, { size: 11 })] }), _jsx(Merge, { session: r.id, open: proposing, onMerged: merged })] })) : null] })) : null] }, r.id)))) }), _jsxs(YStack, { "data-slot": "project-ask", px: "$3", pb: "$3", gap: "$2", minW: 0, $md: { pr: 0 }, children: [note ? (_jsx(SizableText, { size: "$1", color: "$soft", role: "status", children: note })) : null, picked.length ? _jsx(Attachments, { items: picked, onRemove: () => setPicked([]) }) : null, _jsx(Composer, { column: true, value: draft, onChange: setDraft, onSend: () => void (current && running ? steer(current) : send()), onStop: current
426
426
  ? () => void stop(target, current).then(() => setNote(t('Stop requested — the run keeps its work on its branch')), (e) => setNote(e.message))
427
427
  : undefined, busy: busy || (running && !draft.trim()), placeholder: running ? t('Steer this run') : t('Ask Hanzo for edits'), label: t('Ask Hanzo for edits'), plus: { upload: () => pick(attached, setAttached, setNote, t) }, carried: carrying(attached, setAttached), mode: running ? null : { value: mode === 'plan' ? 'plan' : 'auto', set: (m) => setMode(m === 'plan' ? 'plan' : 'build'), items: MODES.filter((m) => m.id !== 'manual') }, mind: running ? null : mind, effort: running ? null : pacing(mind), voice: voice })] }), wide && !shut ? (_jsx(Gutter, { side: "left", span: across, floor: CHAT_FLOOR, ceil: most, reset: CHAT_WIDTH, onSpan: setSplit, label: t('Resize the chat'), gap: GUTTER })) : null] }));
428
428
  // The preview stays loaded while another view is open, so coming back to it
package/lib/run.js CHANGED
@@ -352,7 +352,7 @@ export function Run({ id }) {
352
352
  ? say('Follow up — continues in a new run')
353
353
  : say('Reading this run…');
354
354
  const desk_ = (sheet) => (_jsx(Desk, { id: id, repo: record?.repo ?? '', branch: record?.branch ?? '', base: record?.base ?? '', environment: record?.environment ?? '', mode: mode, pr: pr, title: title, project: record?.project ?? '', sandbox: record?.sandbox ?? '', site: site, published: end.published, events: events, live: running, menu: [...manage, ...sharing], refused: signed ? refused || (detail.error ? say(detail.error.message) : '') : say('Sign in to follow this run.'), retry: signed ? say('Retry') : say('Sign in'), onRetry: signed ? detail.reload : () => host.signIn?.(), side: side, sheet: sheet, onHide: () => setDesk(false) }));
355
- return (_jsxs(XStack, { "data-slot": "run-split", display: "grid", gridTemplateColumns: "minmax(0, 1fr) auto", width: "100%", height: "100%", minH: 0, minW: 0, children: [_jsxs(YStack, { "data-slot": "run", ref: split.main, style: split.mainStyle, ...pane, display: "grid", gridTemplateRows: "auto minmax(0, 1fr) auto", width: "100%", height: "100%", minH: 0, minW: 0, children: [_jsxs(XStack, { px: "$4", pt: "$3", pb: "$2", gap: "$2", items: "center", minH: 44, children: [_jsxs(YStack, { flex: 1, minW: 0, items: "flex-start", children: [_jsx(DropdownMenu, { trigger: _jsxs(XStack, { render: "button", "aria-label": say('Manage this run'), items: "center", gap: "$1.5", maxW: "100%", px: "$1.5", mx: "$-1.5", py: "$0.5", rounded: "$2", hoverStyle: { bg: '$hover' }, children: [_jsx(SizableText, { render: "h1", size: "$5", color: "$ink", numberOfLines: 1, minW: 0, children: title }), _jsx(ChevronDown, { size: 14 })] }), items: manage }), _jsx(SizableText, { size: "$1", color: "$soft", numberOfLines: 1, maxW: "100%", children: [state ? say(STATUS[state] ?? state) : detail.loading ? say('reading') : '', record?.repo, record?.branch, record?.published ? say('shared') : ''].filter(Boolean).join(' · ') })] }), pr.href ? (_jsx(Out, { href: pr.href, label: say('Open pull request {pr}', { pr: pr.label }), children: _jsxs(XStack, { items: "center", gap: "$1.5", px: "$2.5", py: "$1.5", rounded: "$3", borderWidth: 1, borderColor: "$borderColor", hoverStyle: { bg: '$hover' }, children: [_jsx(GitPullRequest, { size: 14 }), _jsx(SizableText, { size: "$2", color: "$ink", children: pr.label }), _jsx(ExternalLink, { size: 12, opacity: 0.6 })] }) })) : null, sharing.length ? (_jsx(DropdownMenu, { trigger: _jsxs(XStack, { render: "button", "aria-label": say('Share'), items: "center", gap: "$1.5", px: "$2.5", py: "$1.5", rounded: "$3", borderWidth: 1, borderColor: "$borderColor", hoverStyle: { bg: '$hover' }, children: [_jsx(Share, { size: 14 }), _jsx(SizableText, { size: "$2", color: "$ink", children: say('Share') })] }), items: sharing })) : null, _jsx(PanelToggle, { open: desk, onToggle: () => setDesk(!desk) })] }), _jsx(Transcript, { cards: shown, onOpen: look, onDiff: () => {
355
+ return (_jsxs(XStack, { "data-slot": "run-split", display: "grid", gridTemplateColumns: "minmax(0, 1fr) auto", width: "100%", height: "100%", minH: 0, minW: 0, children: [_jsxs(YStack, { "data-slot": "run", ref: split.main, ...pane, display: "grid", gridTemplateRows: "auto minmax(0, 1fr) auto", width: "100%", height: "100%", minH: 0, minW: 0, children: [_jsxs(XStack, { px: "$4", pt: "$3", pb: "$2", gap: "$2", items: "center", minH: 44, children: [_jsxs(YStack, { flex: 1, minW: 0, items: "flex-start", children: [_jsx(DropdownMenu, { trigger: _jsxs(XStack, { render: "button", "aria-label": say('Manage this run'), items: "center", gap: "$1.5", maxW: "100%", px: "$1.5", mx: "$-1.5", py: "$0.5", rounded: "$2", hoverStyle: { bg: '$hover' }, children: [_jsx(SizableText, { render: "h1", size: "$5", color: "$ink", numberOfLines: 1, minW: 0, children: title }), _jsx(ChevronDown, { size: 14 })] }), items: manage }), _jsx(SizableText, { size: "$1", color: "$soft", numberOfLines: 1, maxW: "100%", children: [state ? say(STATUS[state] ?? state) : detail.loading ? say('reading') : '', record?.repo, record?.branch, record?.published ? say('shared') : ''].filter(Boolean).join(' · ') })] }), pr.href ? (_jsx(Out, { href: pr.href, label: say('Open pull request {pr}', { pr: pr.label }), children: _jsxs(XStack, { items: "center", gap: "$1.5", px: "$2.5", py: "$1.5", rounded: "$3", borderWidth: 1, borderColor: "$borderColor", hoverStyle: { bg: '$hover' }, children: [_jsx(GitPullRequest, { size: 14 }), _jsx(SizableText, { size: "$2", color: "$ink", children: pr.label }), _jsx(ExternalLink, { size: 12, opacity: 0.6 })] }) })) : null, sharing.length ? (_jsx(DropdownMenu, { trigger: _jsxs(XStack, { render: "button", "aria-label": say('Share'), items: "center", gap: "$1.5", px: "$2.5", py: "$1.5", rounded: "$3", borderWidth: 1, borderColor: "$borderColor", hoverStyle: { bg: '$hover' }, children: [_jsx(Share, { size: 14 }), _jsx(SizableText, { size: "$2", color: "$ink", children: say('Share') })] }), items: sharing })) : null, _jsx(PanelToggle, { open: desk, onToggle: () => setDesk(!desk) })] }), _jsx(Transcript, { cards: shown, onOpen: look, onDiff: () => {
356
356
  side.open({ kind: 'diff', title: say('Diff') });
357
357
  setDesk(true);
358
358
  }, listen: signed ? listen : undefined, end: failed ? (_jsx(Failure, { onRetry: busy ? undefined : () => void act(() => carry(again, 'retry')), children: end.problem
@@ -383,11 +383,11 @@ export function Run({ id }) {
383
383
  : say('This run is still working.') }), _jsx(Steer, { onCommand: command, withhold: [
384
384
  ...(paused ? ['pause'] : ['resume']),
385
385
  ...(busy || waiting ? ['pause', 'resume', 'stop'] : []),
386
- ] }), _jsx(Button, { size: "sm", disabled: notify, onPress: () => void ask(), children: notify ? say('You will be notified') : say('Notify me') })] })) : null] }), _jsx(Composer, { column: true, framed: true, value: draft, onChange: setDraft, onSend: send, ready: Boolean(draft.trim()), disabled: !signed || busy || waiting || !(running || finished), placeholder: placeholder, label: steering ? say('Steer this run') : say('Follow up on this run'), plus: { upload: () => pick(files, setFiles, setNote, say) }, carried: carrying(files, setFiles),
386
+ ] }), _jsx(Button, { size: "sm", disabled: notify, onPress: () => void ask(), children: notify ? say('You will be notified') : say('Notify me') })] })) : null] }), _jsx(Composer, { column: true, value: draft, onChange: setDraft, onSend: send, ready: Boolean(draft.trim()), disabled: !signed || busy || waiting || !(running || finished), placeholder: placeholder, label: steering ? say('Steer this run') : say('Follow up on this run'), plus: { upload: () => pick(files, setFiles, setNote, say) }, carried: carrying(files, setFiles),
387
387
  // What a new run from here is made with; words that steer this run use neither.
388
388
  mind: signed && !steering ? mind : null, effort: signed && !steering ? pacing(mind) : null, limits: limits, voice: voice })] })] }), desk && !wide ? desk_(true) : null, desk && wide ? (_jsxs(YStack, { "data-slot": "desk", ref: split.aside, ...pane,
389
389
  // A pane of its own beside the run's, the gutter between them (useSplit reads it as the inline-start margin).
390
- marginInlineStart: gap, position: "relative", shrink: 0, minH: 0, style: split.asideStyle, children: [split.grip ? (_jsx(Gutter, { ...split.grip, label: say('Resize the side panel'), inset: pane.borderWidth })) : null, _jsx(SideProvider, { value: split.side, children: desk_(false) })] })) : null, _jsx(Dialog, { open: naming, onOpenChange: setNaming, children: _jsxs(DialogContent, { maxW: 480, children: [_jsx(DialogTitle, { children: say('Rename this run') }), _jsx(Input, { autoFocus: true, value: name, onChangeText: setName, "aria-label": say('The run’s name'), maxLength: 512, onKeyDown: (e) => {
390
+ marginInlineStart: gap, position: "relative", shrink: 0, minH: 0, children: [split.grip ? (_jsx(Gutter, { ...split.grip, label: say('Resize the side panel'), inset: pane.borderWidth })) : null, _jsx(SideProvider, { value: split.side, children: desk_(false) })] })) : null, _jsx(Dialog, { open: naming, onOpenChange: setNaming, children: _jsxs(DialogContent, { maxW: 480, children: [_jsx(DialogTitle, { children: say('Rename this run') }), _jsx(Input, { autoFocus: true, value: name, onChangeText: setName, "aria-label": say('The run’s name'), maxLength: 512, onKeyDown: (e) => {
391
391
  if (e.key === 'Enter')
392
392
  save();
393
393
  } }), _jsxs(XStack, { gap: "$2", justify: "flex-end", children: [_jsx(Button, { size: "sm", variant: "outline", onPress: () => setNaming(false), children: say('Cancel') }), _jsx(Button, { size: "sm", disabled: busy || !name.trim(), onPress: save, children: say('Save') })] })] }) })] }));
package/lib/side.d.ts CHANGED
@@ -1,4 +1,3 @@
1
- import { type CSSProperties } from 'react';
2
1
  /** What the panel's strip reads of the column it stands in. */
3
2
  export interface Side {
4
3
  /** What the middle column is called, in the button that brings it back: "chat", "run". */
@@ -17,12 +16,10 @@ export declare const useSide: () => Side | null;
17
16
  export interface Split {
18
17
  /** For `SideProvider`, around the middle column and the panel. */
19
18
  side: Side;
20
- /** The middle column's element and style. */
19
+ /** The middle column's element: its display is written on it. */
21
20
  main: (el: unknown) => void;
22
- mainStyle: CSSProperties;
23
- /** The panel's column's element and style. */
21
+ /** The panel's column's element: its width, and full screen, are written on it. */
24
22
  aside: (el: unknown) => void;
25
- asideStyle: CSSProperties;
26
23
  /** The kit `Grip`'s props, but its label and its place; none while the panel is full screen. */
27
24
  grip: {
28
25
  side: 'left' | 'right';
package/lib/side.js CHANGED
@@ -16,9 +16,10 @@
16
16
  * full the panel over the whole window. Escape or the button returns.
17
17
  *
18
18
  * A DRAG NEVER DRAWS REACT. Each frame writes the panel's width and the middle
19
- * column's display on the two elements (`paint`), the same properties React
20
- * writes from the settled state (`look`), so the two never disagree; React
21
- * learns the width once, when the drag lets go. The room the two share is
19
+ * column's display on the two elements (`paint`), and the settled state is
20
+ * written by the same hand once React commits it (`look`, after layout, before
21
+ * paint), so the two never disagree and the host spreads no style of its own;
22
+ * React learns the width once, when the drag lets go. The room the two share is
22
23
  * measured by a ResizeObserver, after layout, so a frame never reads layout
23
24
  * it has just dirtied. A window narrowed under the panel is painted the same
24
25
  * way: the panel gives way, and the person's width comes back with the room.
@@ -28,7 +29,7 @@
28
29
  * (@hanzo/i18n `dir`), and the grip grows it rightwards.
29
30
  */
30
31
  import { useI18n } from '@hanzo/i18n/react';
31
- import { createContext, useCallback, useContext, useEffect, useMemo, useRef, useState } from 'react';
32
+ import { createContext, useCallback, useContext, useEffect, useLayoutEffect, useMemo, useRef, useState } from 'react';
32
33
  import { usePrefs } from './prefs.js';
33
34
  /** The panel's least width, px, and the width it opens at before the person has chosen one. */
34
35
  const FLOOR = 240;
@@ -188,12 +189,18 @@ export function useSplit(open, main, onShut) {
188
189
  const mainRef = useCallback((el) => setEls((was) => (was.main === el ? was : { ...was, main: el instanceof HTMLElement ? el : null })), []);
189
190
  const asideRef = useCallback((el) => setEls((was) => (was.aside === el ? was : { ...was, aside: el instanceof HTMLElement ? el : null })), []);
190
191
  const across = room ? Math.max(FLOOR, Math.min(width, room - now.current.gap - MAIN)) : width;
192
+ // The settled state, on the elements a drag paints. Leaving full screen
193
+ // clears what full screen set, so every key is written every time.
194
+ useLayoutEffect(() => {
195
+ const full = Object.fromEntries(Object.entries(FULL).map(([k, v]) => [k, side.full ? v : '']));
196
+ write(els.aside, { ...full, ...look(across, side.hidden), ...(side.full ? FULL : null) });
197
+ if (els.main)
198
+ els.main.style.display = side.hidden ? 'none' : '';
199
+ }, [els, across, side.hidden, side.full]);
191
200
  return {
192
201
  side,
193
202
  main: mainRef,
194
- mainStyle: { display: side.hidden ? 'none' : '' },
195
203
  aside: asideRef,
196
- asideStyle: (side.full ? { ...look(across, side.hidden), ...FULL } : look(across, side.hidden)),
197
204
  grip: side.full
198
205
  ? null
199
206
  : { side: dir === 'rtl' ? 'left' : 'right', span: side.hidden ? room : across, floor: FLOOR, ceil: Math.max(FLOOR, room), reset: WIDTH, onSpan: (n) => void paint(n), onKeep: keep, onShut },
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@hanzo/build",
3
- "version": "0.2.89",
3
+ "version": "0.2.91",
4
4
  "type": "module",
5
5
  "license": "Apache-2.0 OR MIT",
6
6
  "description": "Hanzo Build — say what you want, watch it built, deployed and running. The builder as a component, mounted by the Hanzo app at hanzo.ai.",