@hanzo/build 0.2.98 → 0.2.110
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/api/agents.d.ts +24 -1
- package/lib/api/agents.js +52 -2
- package/lib/api/coding.d.ts +8 -0
- package/lib/api/coding.js +27 -3
- package/lib/api/library.d.ts +6 -2
- package/lib/api/library.js +50 -6
- package/lib/api/sessions.js +16 -1
- package/lib/api/turn.d.ts +2 -0
- package/lib/api/turn.js +12 -0
- package/lib/carry.js +79 -7
- package/lib/customize/agents.js +73 -5
- package/lib/desk.d.ts +7 -1
- package/lib/desk.js +56 -11
- package/lib/files.js +6 -2
- package/lib/landing.js +38 -34
- package/lib/library.js +36 -8
- package/lib/nav.js +19 -9
- package/lib/panel.js +2 -2
- package/lib/plugins/index.js +1 -1
- package/lib/reply.d.ts +13 -4
- package/lib/reply.js +74 -14
- package/lib/route.d.ts +2 -2
- package/lib/route.js +2 -2
- package/lib/run.js +185 -13
- package/lib/summary.d.ts +11 -1
- package/lib/summary.js +17 -3
- package/lib/transcript.d.ts +12 -1
- package/lib/transcript.js +16 -8
- package/package.json +1 -1
package/lib/run.js
CHANGED
|
@@ -9,8 +9,10 @@ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
|
9
9
|
* by sequence. A reconnect after a drop re-reads the detail — the platform drops
|
|
10
10
|
* a subscriber that falls behind, and frames missed then are only in the read.
|
|
11
11
|
*
|
|
12
|
-
* Steering is a queue
|
|
13
|
-
* RECORDED, and the status is left to the feed to correct.
|
|
12
|
+
* Steering a machine's run is a queue it drains between steps: a press is
|
|
13
|
+
* confirmed as RECORDED, and the status is left to the feed to correct. A
|
|
14
|
+
* sandbox run is steered through `POST /v1/agent/coding/{session}/steer`, which
|
|
15
|
+
* stops it with its work kept and opens a follow-up with the words.
|
|
14
16
|
*
|
|
15
17
|
* A sandbox run is one agent invocation that takes its task on its command line
|
|
16
18
|
* (apps/coding steer.go), so what continues it is a new run: a paused run is
|
|
@@ -26,17 +28,17 @@ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
|
26
28
|
import { SizableText, useMedia, XStack, YStack } from '@hanzo/gui';
|
|
27
29
|
import { phrase } from '@hanzo/i18n';
|
|
28
30
|
import { useI18n } from '@hanzo/i18n/react';
|
|
29
|
-
import { ChevronDown, ChevronRight, Clock, Copy, ExternalLink, GitPullRequest, Globe, Pencil, Share } from '@hanzogui/lucide-icons-2';
|
|
30
|
-
import { Button, Dialog, DialogContent, DialogTitle, DropdownMenu, Input } from '@hanzo/ui';
|
|
31
|
+
import { Check, ChevronDown, ChevronRight, Clock, Copy, ExternalLink, FileDiff, Folder, GitPullRequest, Globe, Layers, MessageSquare, MoreHorizontal, Pencil, Share, SlidersHorizontal, SquareTerminal, } from '@hanzogui/lucide-icons-2';
|
|
32
|
+
import { Button, Dialog, DialogContent, DialogTitle, DropdownMenu, DropdownMenuContent, DropdownMenuItem, DropdownMenuSeparator, DropdownMenuShortcut, DropdownMenuSub, DropdownMenuSubContent, DropdownMenuSubTrigger, DropdownMenuTrigger, Input, Switch, } from '@hanzo/ui';
|
|
31
33
|
import { Steer } from '@hanzo/ui/agents';
|
|
32
34
|
import { Composer, Failure, measure } from '@hanzo/ui/chat';
|
|
33
35
|
import { useLimits } from '@hanzo/ui/product/useLimits';
|
|
34
36
|
import { useDictation, useVoice } from '@hanzo/voice';
|
|
35
|
-
import { useEffect, useMemo, useState } from 'react';
|
|
36
|
-
import { approve, followUp, headline, retry, start } from './api/coding.js';
|
|
37
|
+
import { useEffect, useMemo, useRef, useState } from 'react';
|
|
38
|
+
import { approve, followUp, headline, retry, start, steer } from './api/coding.js';
|
|
37
39
|
import { limits as readLimits } from './api/models.js';
|
|
38
40
|
import { list, message, pause, publish, rename, resume, stop, story, took } from './api/sessions.js';
|
|
39
|
-
import { answer, cards, outcome, pull, settled, steps } from './api/turn.js';
|
|
41
|
+
import { answer, cards, followed, outcome, pull, settled, steps } from './api/turn.js';
|
|
40
42
|
import { verdict } from './api/verdict.js';
|
|
41
43
|
import { useKept, useProjects, useRead, useRun } from './data.js';
|
|
42
44
|
import { Desk, SEED } from './desk.js';
|
|
@@ -83,10 +85,20 @@ export function Run({ id }) {
|
|
|
83
85
|
const split = useSplit(desk && wide, 'run', () => setDesk(false));
|
|
84
86
|
// Stop was pressed here: the run keeps its work after it answers, and says so with its status.
|
|
85
87
|
const [stopping, setStopping] = useState(false);
|
|
88
|
+
// The working sandbox run words were said to here: its follow-up opens once it starts.
|
|
89
|
+
const [steered, setSteered] = useState('');
|
|
86
90
|
const [naming, setNaming] = useState(false);
|
|
87
91
|
const [name, setName] = useState('');
|
|
88
92
|
const [copied, setCopied] = useState('');
|
|
89
93
|
const [unfolded, setUnfolded] = useState(false);
|
|
94
|
+
const [transcriptView, setTranscriptView] = useKept('hanzo.build.transcript.view', 'normal');
|
|
95
|
+
const [outputStyle, setOutputStyle] = useKept('hanzo.build.output.style', 'default');
|
|
96
|
+
const [envColumn, setEnvColumn] = useState(false);
|
|
97
|
+
const [splitPanes, setSplitPanes] = useState([]);
|
|
98
|
+
const [queued, setQueued] = useState([]);
|
|
99
|
+
const [keepAwake, setKeepAwake] = useState(false);
|
|
100
|
+
const wakeLockRef = useRef(null);
|
|
101
|
+
const [nowMs, setNowMs] = useState(() => Date.now());
|
|
90
102
|
// The model and effort a run started here uses: the one choice Chat and New share.
|
|
91
103
|
const mind = useMind(t);
|
|
92
104
|
const { limits } = useLimits(signed ? (signal) => readLimits(t, signal) : null, t);
|
|
@@ -103,6 +115,7 @@ export function Run({ id }) {
|
|
|
103
115
|
const end = outcome(events);
|
|
104
116
|
const plan = useMemo(() => steps(events), [events]);
|
|
105
117
|
const kept = useMemo(() => settled(events), [events]);
|
|
118
|
+
const next = useMemo(() => followed(events), [events]);
|
|
106
119
|
const state = status || end.status;
|
|
107
120
|
// Where the run's work is published: its project's own address, read again when
|
|
108
121
|
// the run says it went live, never an address an event names.
|
|
@@ -234,15 +247,36 @@ export function Run({ id }) {
|
|
|
234
247
|
host.go(run.session);
|
|
235
248
|
return '';
|
|
236
249
|
};
|
|
250
|
+
/**
|
|
251
|
+
* Words for the run while it works. A machine drains them between steps; a
|
|
252
|
+
* sandbox run reads nothing after it starts, so the platform stops it with its
|
|
253
|
+
* work kept and a follow-up takes the words on (api/coding.ts `steer`).
|
|
254
|
+
*/
|
|
255
|
+
const tell = async (words) => {
|
|
256
|
+
if (held) {
|
|
257
|
+
await steer(t, id, words);
|
|
258
|
+
setSteered(id);
|
|
259
|
+
return say('Sent — the run stops with its work kept, and a follow-up takes it from here');
|
|
260
|
+
}
|
|
261
|
+
await message(t, id, words);
|
|
262
|
+
return say('Sent — recorded on this run');
|
|
263
|
+
};
|
|
264
|
+
// The follow-up the words said here started: it is where the run goes on.
|
|
265
|
+
useEffect(() => {
|
|
266
|
+
if (steered === id && next)
|
|
267
|
+
host.go(next);
|
|
268
|
+
// On the follow-up's arrival.
|
|
269
|
+
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
270
|
+
}, [steered, id, next]);
|
|
237
271
|
// The composer sends words, with any files fenced after them, and only while it is enabled.
|
|
238
272
|
const send = () => {
|
|
239
273
|
const words = compose(draft.trim(), files);
|
|
240
274
|
if (steering) {
|
|
241
275
|
void act(async () => {
|
|
242
|
-
await
|
|
276
|
+
const said = await tell(words);
|
|
243
277
|
setDraft('');
|
|
244
278
|
setFiles([]);
|
|
245
|
-
return
|
|
279
|
+
return said;
|
|
246
280
|
});
|
|
247
281
|
return;
|
|
248
282
|
}
|
|
@@ -330,6 +364,84 @@ export function Run({ id }) {
|
|
|
330
364
|
...(link ? [{ key: 'link', label: copied === 'link' ? say('Copied') : say('Copy public link'), icon: _jsx(Copy, { size: 16 }), description: link, onSelect: () => void copy('link', link) }] : []),
|
|
331
365
|
]
|
|
332
366
|
: [];
|
|
367
|
+
const sendQueued = (qid) => {
|
|
368
|
+
const item = queued.find((q) => q.id === qid);
|
|
369
|
+
if (!item)
|
|
370
|
+
return;
|
|
371
|
+
setQueued((prev) => prev.filter((q) => q.id !== qid));
|
|
372
|
+
if (steering) {
|
|
373
|
+
void act(() => tell(item.text));
|
|
374
|
+
return;
|
|
375
|
+
}
|
|
376
|
+
void act(() => carry(item.text));
|
|
377
|
+
};
|
|
378
|
+
const enqueue = () => {
|
|
379
|
+
const words = compose(draft.trim(), files);
|
|
380
|
+
if (!words)
|
|
381
|
+
return;
|
|
382
|
+
setQueued((prev) => [...prev, { id: `q-${Date.now()}-${prev.length}`, text: words }]);
|
|
383
|
+
setDraft('');
|
|
384
|
+
setFiles([]);
|
|
385
|
+
};
|
|
386
|
+
useEffect(() => {
|
|
387
|
+
if (!running || paused)
|
|
388
|
+
return;
|
|
389
|
+
const timer = setInterval(() => setNowMs(Date.now()), 1000);
|
|
390
|
+
return () => clearInterval(timer);
|
|
391
|
+
}, [running, paused]);
|
|
392
|
+
const toggleKeepAwake = async (on) => {
|
|
393
|
+
setKeepAwake(on);
|
|
394
|
+
try {
|
|
395
|
+
const nav = navigator;
|
|
396
|
+
if (on && nav.wakeLock) {
|
|
397
|
+
wakeLockRef.current = await nav.wakeLock.request('screen');
|
|
398
|
+
}
|
|
399
|
+
else if (!on && wakeLockRef.current?.release) {
|
|
400
|
+
await wakeLockRef.current.release();
|
|
401
|
+
wakeLockRef.current = null;
|
|
402
|
+
}
|
|
403
|
+
}
|
|
404
|
+
catch {
|
|
405
|
+
/* WakeLock API optional */
|
|
406
|
+
}
|
|
407
|
+
};
|
|
408
|
+
const toggleDockPane = (kind, label) => {
|
|
409
|
+
if (!desk)
|
|
410
|
+
setDesk(true);
|
|
411
|
+
setSplitPanes((prev) => {
|
|
412
|
+
if (prev.includes(kind)) {
|
|
413
|
+
const next = prev.filter((k) => k !== kind);
|
|
414
|
+
if (next.length === 1) {
|
|
415
|
+
const single = next[0];
|
|
416
|
+
side.open({ kind: single, title: say(single.charAt(0).toUpperCase() + single.slice(1)) });
|
|
417
|
+
}
|
|
418
|
+
return next;
|
|
419
|
+
}
|
|
420
|
+
const activeKind = side.tabs.find((x) => x.id === side.at)?.kind ?? '';
|
|
421
|
+
const base = prev.length === 0 && activeKind && ['terminal', 'preview', 'diff', 'files'].includes(activeKind) && activeKind !== kind ? [activeKind] : prev;
|
|
422
|
+
const next = [...base, kind];
|
|
423
|
+
if (next.length === 1)
|
|
424
|
+
side.open({ kind, title: label });
|
|
425
|
+
return next;
|
|
426
|
+
});
|
|
427
|
+
};
|
|
428
|
+
const elapsedSec = useMemo(() => {
|
|
429
|
+
const startMs = record?.createdAt ? Date.parse(record.createdAt) : NaN;
|
|
430
|
+
if (!Number.isFinite(startMs))
|
|
431
|
+
return 0;
|
|
432
|
+
return Math.max(1, Math.floor((nowMs - startMs) / 1000));
|
|
433
|
+
}, [record?.createdAt, nowMs]);
|
|
434
|
+
const elapsedLabel = useMemo(() => {
|
|
435
|
+
const mins = Math.floor(elapsedSec / 60);
|
|
436
|
+
const secs = elapsedSec % 60;
|
|
437
|
+
return mins > 0 ? `${mins}m ${secs}s` : `${secs}s`;
|
|
438
|
+
}, [elapsedSec]);
|
|
439
|
+
const tokenLabel = useMemo(() => {
|
|
440
|
+
const chars = events.reduce((sum, e) => sum + JSON.stringify(e.payload ?? '').length, 0);
|
|
441
|
+
const tok = Math.max(100, Math.round(chars / 4));
|
|
442
|
+
return tok >= 1000 ? `${(tok / 1000).toFixed(1)}k tokens` : `${tok} tokens`;
|
|
443
|
+
}, [events]);
|
|
444
|
+
const bgTaskCount = useMemo(() => shown.filter((c) => (c.kind === 'shell' || c.kind === 'step') && c.ran === 'running' && running).length, [shown, running]);
|
|
333
445
|
const save = () => void act(async () => {
|
|
334
446
|
await rename(t, id, name);
|
|
335
447
|
setNaming(false);
|
|
@@ -351,8 +463,61 @@ export function Run({ id }) {
|
|
|
351
463
|
: finished
|
|
352
464
|
? say('Follow up — continues in a new run')
|
|
353
465
|
: say('Reading this run…');
|
|
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
|
-
|
|
466
|
+
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), envColumn: envColumn, splitPanes: splitPanes, onCloseSplitPane: (pid) => setSplitPanes((prev) => prev.filter((k) => k !== pid)), onExpandSplitPane: (pid) => {
|
|
467
|
+
setSplitPanes([]);
|
|
468
|
+
side.open({ kind: pid, title: say(pid.charAt(0).toUpperCase() + pid.slice(1)) });
|
|
469
|
+
} }));
|
|
470
|
+
const triggerButton = (_jsxs(XStack, { render: "button", "aria-label": say('Manage this run'), items: "center", gap: "$1.5", maxW: "100%", minW: 0, 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, opacity: 0.7 })] }));
|
|
471
|
+
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: "$1.5", items: "center", minH: 44, children: [_jsxs(YStack, { flex: 1, minW: 0, items: "flex-start", children: [_jsx(XStack, { items: "center", gap: "$1", maxW: "100%", minW: 0, children: signed && record ? (_jsxs(DropdownMenu, { children: [_jsx(DropdownMenuTrigger, { asChild: true, children: triggerButton }), _jsxs(DropdownMenuContent, { align: "start", minW: 210, children: [_jsxs(DropdownMenuSub, { children: [_jsx(DropdownMenuSubTrigger, { children: _jsx(SizableText, { size: "$2", color: "$ink", flex: 1, children: say('Open in') }) }), _jsxs(DropdownMenuSubContent, { minW: 170, children: [_jsx(DropdownMenuItem, { onSelect: () => {
|
|
472
|
+
window.open(`vscode://file/home/z/work/${record.repo.split('/').pop() || ''}`, '_blank');
|
|
473
|
+
}, children: _jsx(SizableText, { size: "$2", color: "$ink", children: "VS Code" }) }), _jsx(DropdownMenuItem, { onSelect: () => {
|
|
474
|
+
window.open(`cursor://file/home/z/work/${record.repo.split('/').pop() || ''}`, '_blank');
|
|
475
|
+
}, children: _jsx(SizableText, { size: "$2", color: "$ink", children: "Cursor" }) }), _jsx(DropdownMenuItem, { onSelect: () => {
|
|
476
|
+
side.open({ kind: 'terminal', title: say('Terminal') });
|
|
477
|
+
setDesk(true);
|
|
478
|
+
}, children: _jsx(SizableText, { size: "$2", color: "$ink", children: say('Terminal') }) }), record.repo ? (_jsx(DropdownMenuItem, { onSelect: () => {
|
|
479
|
+
window.open(pr.href || `https://github.com/${record.repo}`, '_blank', 'noopener,noreferrer');
|
|
480
|
+
}, children: _jsx(SizableText, { size: "$2", color: "$ink", children: "GitHub" }) })) : null, _jsx(DropdownMenuItem, { onSelect: () => void copy('path', record.repo || id), children: _jsx(SizableText, { size: "$2", color: "$ink", children: say('Copy path') }) })] })] }), _jsx(DropdownMenuSeparator, {}), _jsxs(DropdownMenuItem, { "aria-label": say('Rename'), onSelect: () => {
|
|
481
|
+
setName(title);
|
|
482
|
+
setNaming(true);
|
|
483
|
+
}, children: [_jsx(SizableText, { size: "$2", color: "$ink", flex: 1, children: say('Rename') }), _jsx(DropdownMenuShortcut, { children: "R" })] }), _jsxs(DropdownMenuItem, { "aria-label": say('Fork'), onSelect: () => {
|
|
484
|
+
void act(() => carry(again || headline(record.title, record.repo), 'follow'));
|
|
485
|
+
}, children: [_jsx(SizableText, { size: "$2", color: "$ink", flex: 1, children: say('Fork') }), _jsx(DropdownMenuShortcut, { children: "F" })] }), _jsx(DropdownMenuSeparator, {}), _jsxs(DropdownMenuSub, { children: [_jsx(DropdownMenuSubTrigger, { children: _jsx(SizableText, { size: "$2", color: "$ink", flex: 1, children: say('Transcript view') }) }), _jsx(DropdownMenuSubContent, { minW: 160, children: [
|
|
486
|
+
['normal', say('Normal')],
|
|
487
|
+
['thinking', say('Thinking')],
|
|
488
|
+
['verbose', say('Verbose')],
|
|
489
|
+
].map(([val, label]) => (_jsxs(DropdownMenuItem, { onSelect: () => setTranscriptView(val), children: [_jsx(SizableText, { size: "$2", color: "$ink", flex: 1, children: label }), transcriptView === val ? _jsx(Check, { size: 14, color: "$blue10" }) : null] }, val))) })] }), _jsxs(DropdownMenuSub, { children: [_jsx(DropdownMenuSubTrigger, { children: _jsx(SizableText, { size: "$2", color: "$ink", flex: 1, children: say('Output style') }) }), _jsxs(DropdownMenuSubContent, { minW: 170, children: [[
|
|
490
|
+
['default', say('Default')],
|
|
491
|
+
['proactive', say('Proactive')],
|
|
492
|
+
['concise', say('Concise')],
|
|
493
|
+
['explanatory', say('Explanatory')],
|
|
494
|
+
['learning', say('Learning')],
|
|
495
|
+
].map(([val, label]) => (_jsxs(DropdownMenuItem, { onSelect: () => setOutputStyle(val), children: [_jsx(SizableText, { size: "$2", color: "$ink", flex: 1, children: label }), outputStyle === val ? _jsx(Check, { size: 14, color: "$blue10" }) : null] }, val))), _jsx(DropdownMenuSeparator, {}), _jsx(DropdownMenuItem, { onSelect: () => setOutputStyle('custom'), children: _jsx(SizableText, { size: "$2", color: "$ink", flex: 1, children: say('New style...') }) })] })] }), _jsx(DropdownMenuSeparator, {}), _jsx(DropdownMenuItem, { onSelect: () => void copy('id', id), children: _jsx(SizableText, { size: "$2", color: "$ink", flex: 1, children: copied === 'id' ? say('Copied') : say('Copy run id') }) }), _jsx(DropdownMenuItem, { onSelect: () => {
|
|
496
|
+
const first = shown.find((c) => c.kind === 'said' && c.who === 'person');
|
|
497
|
+
schedule(first && 'text' in first ? first.text : headline(record.title, record.repo), host.go);
|
|
498
|
+
}, children: _jsx(SizableText, { size: "$2", color: "$ink", flex: 1, children: say('Schedule this') }) }), _jsx(DropdownMenuSeparator, {}), _jsxs(DropdownMenuItem, { "aria-label": say('Archive'), onSelect: () => {
|
|
499
|
+
if (running)
|
|
500
|
+
void stop(t, id, 'Archived').catch(() => undefined);
|
|
501
|
+
host.go('');
|
|
502
|
+
}, children: [_jsx(SizableText, { size: "$2", color: "$ink", flex: 1, children: say('Archive') }), _jsx(DropdownMenuShortcut, { children: "A" })] }), _jsxs(DropdownMenuItem, { "aria-label": say('Delete'), variant: "destructive", onSelect: () => {
|
|
503
|
+
if (running)
|
|
504
|
+
void stop(t, id, 'Deleted').catch(() => undefined);
|
|
505
|
+
host.go('');
|
|
506
|
+
}, children: [_jsx(SizableText, { size: "$2", color: "$red10", flex: 1, children: say('Delete') }), _jsx(DropdownMenuShortcut, { children: "D" })] })] })] })) : (_jsx(DropdownMenu, { trigger: triggerButton, 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, wide ? (_jsxs(XStack, { items: "center", gap: "$0.5", children: [_jsx(XStack, { render: "button", "aria-label": say('Toggle environment column'), "aria-pressed": envColumn, onPress: () => {
|
|
507
|
+
if (!desk)
|
|
508
|
+
setDesk(true);
|
|
509
|
+
setEnvColumn((v) => !v);
|
|
510
|
+
}, p: "$1.5", rounded: "$2", bg: envColumn ? '$hover' : 'transparent', hoverStyle: { bg: '$hover' }, children: _jsx(SlidersHorizontal, { size: 15, opacity: envColumn ? 1 : 0.7 }) }), _jsx(XStack, { render: "button", "aria-label": say('Toggle terminal pane'), "aria-pressed": splitPanes.includes('terminal'), onPress: () => toggleDockPane('terminal', say('Terminal')), p: "$1.5", rounded: "$2", bg: splitPanes.includes('terminal') ? '$hover' : 'transparent', hoverStyle: { bg: '$hover' }, children: _jsx(SquareTerminal, { size: 15, opacity: splitPanes.includes('terminal') ? 1 : 0.7 }) }), _jsx(XStack, { render: "button", "aria-label": say('Toggle diff pane'), "aria-pressed": splitPanes.includes('diff'), onPress: () => toggleDockPane('diff', say('Diff')), p: "$1.5", rounded: "$2", bg: splitPanes.includes('diff') ? '$hover' : 'transparent', hoverStyle: { bg: '$hover' }, children: _jsx(FileDiff, { size: 15, opacity: splitPanes.includes('diff') ? 1 : 0.7 }) }), _jsx(XStack, { render: "button", "aria-label": say('Toggle browser pane'), "aria-pressed": splitPanes.includes('preview'), onPress: () => toggleDockPane('preview', say('Preview')), p: "$1.5", rounded: "$2", bg: splitPanes.includes('preview') ? '$hover' : 'transparent', hoverStyle: { bg: '$hover' }, children: _jsx(Globe, { size: 15, opacity: splitPanes.includes('preview') ? 1 : 0.7 }) }), _jsx(XStack, { render: "button", "aria-label": say('Toggle files pane'), "aria-pressed": splitPanes.includes('files'), onPress: () => toggleDockPane('files', say('Files')), p: "$1.5", rounded: "$2", bg: splitPanes.includes('files') ? '$hover' : 'transparent', hoverStyle: { bg: '$hover' }, children: _jsx(Folder, { size: 15, opacity: splitPanes.includes('files') ? 1 : 0.7 }) }), _jsxs(DropdownMenu, { children: [_jsx(DropdownMenuTrigger, { asChild: true, children: _jsx(XStack, { render: "button", "aria-label": say('More workspace options'), p: "$1.5", rounded: "$2", hoverStyle: { bg: '$hover' }, children: _jsx(MoreHorizontal, { size: 15, opacity: 0.7 }) }) }), _jsxs(DropdownMenuContent, { align: "end", minW: 220, children: [_jsxs(DropdownMenuItem, { onSelect: () => {
|
|
511
|
+
if (!desk)
|
|
512
|
+
setDesk(true);
|
|
513
|
+
setEnvColumn((v) => !v);
|
|
514
|
+
}, children: [_jsx(MessageSquare, { size: 15 }), _jsx(SizableText, { size: "$2", color: "$ink", flex: 1, children: say('Side chat') }), _jsx(DropdownMenuShortcut, { children: "Ctrl+;" })] }), _jsxs(DropdownMenuItem, { onSelect: () => {
|
|
515
|
+
if (!desk)
|
|
516
|
+
setDesk(true);
|
|
517
|
+
setEnvColumn(true);
|
|
518
|
+
}, children: [_jsx(Layers, { size: 15 }), _jsx(SizableText, { size: "$2", color: "$ink", flex: 1, children: say('Background tasks') }), _jsx(XStack, { px: "$1.5", py: "$0.5", rounded: 99, bg: "$hover", children: _jsx(SizableText, { size: "$1", color: "$soft", children: String(bgTaskCount) }) })] }), _jsx(DropdownMenuSeparator, {}), _jsxs(DropdownMenuItem, { preventCloseOnSelect: true, onSelect: () => {
|
|
519
|
+
void toggleKeepAwake(!keepAwake);
|
|
520
|
+
}, children: [_jsxs(YStack, { flex: 1, minW: 0, children: [_jsx(SizableText, { size: "$2", color: "$ink", children: say('Keep computer awake') }), _jsx(SizableText, { size: "$1", color: "$soft", children: say('Only for this session') })] }), _jsx(Switch, { checked: keepAwake, onCheckedChange: (v) => void toggleKeepAwake(v), size: "sm", "aria-label": say('Keep computer awake') })] })] })] })] })) : null, _jsx(PanelToggle, { open: desk, onToggle: () => setDesk(!desk) })] }), _jsx(Transcript, { cards: shown, view: transcriptView, queued: queued, onSendQueued: sendQueued, onOpen: look, onDiff: () => {
|
|
356
521
|
side.open({ kind: 'diff', title: say('Diff') });
|
|
357
522
|
setDesk(true);
|
|
358
523
|
}, listen: signed ? listen : undefined, end: failed ? (_jsx(Failure, { onRetry: busy ? undefined : () => void act(() => carry(again, 'retry')), children: end.problem
|
|
@@ -376,7 +541,7 @@ export function Run({ id }) {
|
|
|
376
541
|
const on = s === current;
|
|
377
542
|
return (_jsxs(XStack, { items: "center", gap: "$2", px: "$3", py: "$1.5", borderTopWidth: 1, borderColor: "$borderColor", children: [_jsx(SizableText, { size: "$2", color: s.done || on ? '$ink' : '$soft', children: s.done ? '✓' : on ? '●' : '○' }), _jsx(SizableText, { size: "$2", color: s.done ? '$soft' : '$ink', numberOfLines: 1, children: s.name })] }, s.name));
|
|
378
543
|
})
|
|
379
|
-
: null] })) : null, setup && running && !seen ? _jsx(Onboarding, { onDone: () => setSeen(true) }) : null, running ? (_jsxs(XStack, { items: "center", gap: "$2", px: "$3", py: "$2", rounded: "$10", borderWidth: 1, borderColor: "$borderColor", flexWrap: "wrap", rowGap: "$1", children: [_jsx(SizableText, { size: "$2", color: "$ink", flex: 1, minW: 160, children: paused
|
|
544
|
+
: null] })) : null, setup && running && !seen ? _jsx(Onboarding, { onDone: () => setSeen(true) }) : null, running && !paused ? (_jsxs(XStack, { items: "center", gap: "$2", px: "$1", children: [_jsx(SizableText, { size: "$1", color: "$orange10", children: "\u2022\u00B7" }), _jsx(SizableText, { size: "$1", color: "$soft", children: `${elapsedLabel} · ${tokenLabel} · ${say('Thinking')}` })] })) : null, running ? (_jsxs(XStack, { items: "center", gap: "$2", px: "$3", py: "$2", rounded: "$10", borderWidth: 1, borderColor: "$borderColor", flexWrap: "wrap", rowGap: "$1", children: [_jsx(SizableText, { size: "$2", color: "$ink", flex: 1, minW: 160, children: paused
|
|
380
545
|
? kept.pushed
|
|
381
546
|
? say('Paused — its work so far is on its branch.')
|
|
382
547
|
: say('Paused.')
|
|
@@ -387,7 +552,14 @@ export function Run({ id }) {
|
|
|
387
552
|
: say('This run is still working.') }), _jsx(Steer, { onCommand: command, withhold: [
|
|
388
553
|
...(paused ? ['pause'] : ['resume']),
|
|
389
554
|
...(busy || waiting ? ['pause', 'resume', 'stop'] : []),
|
|
390
|
-
] }), _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'),
|
|
555
|
+
] }), _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'), field: {
|
|
556
|
+
onKeyDown: (e) => {
|
|
557
|
+
if ((e.ctrlKey || e.metaKey) && e.key === 'Enter' && steering && draft.trim()) {
|
|
558
|
+
e.preventDefault?.();
|
|
559
|
+
enqueue();
|
|
560
|
+
}
|
|
561
|
+
},
|
|
562
|
+
}, plus: { upload: () => pick(files, setFiles, setNote, say) }, carried: carrying(files, setFiles),
|
|
391
563
|
// What a new run from here is made with; words that steer this run use neither.
|
|
392
564
|
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,
|
|
393
565
|
// A pane of its own beside the run's, the gutter between them (useSplit reads it as the inline-start margin).
|
package/lib/summary.d.ts
CHANGED
|
@@ -38,11 +38,21 @@ export interface Section {
|
|
|
38
38
|
/**
|
|
39
39
|
* The summary, from the outline mark in a header. `onOpen` runs after a row is
|
|
40
40
|
* pressed, for the host to show the panel the row opened a tab in.
|
|
41
|
+
*
|
|
42
|
+
* When `docked` is true (wide viewports where space allows), the header mark
|
|
43
|
+
* toggles `open` via `onOpenChange` without opening a floating popover, and a
|
|
44
|
+
* second `<Summary sections={sections} onOpen={...} pane />` docks the summary
|
|
45
|
+
* inline on the right edge of the inner pane, shifting the main content left so
|
|
46
|
+
* it stays open while toggled.
|
|
41
47
|
*/
|
|
42
|
-
export declare function Summary({ sections, onOpen, label: named }: {
|
|
48
|
+
export declare function Summary({ sections, onOpen, label: named, open: controlledOpen, onOpenChange, docked, pane, }: {
|
|
43
49
|
sections: readonly Section[];
|
|
44
50
|
onOpen?: () => void;
|
|
45
51
|
label?: string;
|
|
52
|
+
open?: boolean;
|
|
53
|
+
onOpenChange?: (open: boolean) => void;
|
|
54
|
+
docked?: boolean;
|
|
55
|
+
pane?: boolean;
|
|
46
56
|
}): import("react").JSX.Element;
|
|
47
57
|
/** Each section as a kind of tab for `Panel`: the same rows, with their second lines. */
|
|
48
58
|
export declare function kinds(sections: readonly Section[], icons?: Record<string, ReactNode>): Kind[];
|
package/lib/summary.js
CHANGED
|
@@ -40,16 +40,30 @@ function Rows({ section, done, details = false }) {
|
|
|
40
40
|
/**
|
|
41
41
|
* The summary, from the outline mark in a header. `onOpen` runs after a row is
|
|
42
42
|
* pressed, for the host to show the panel the row opened a tab in.
|
|
43
|
+
*
|
|
44
|
+
* When `docked` is true (wide viewports where space allows), the header mark
|
|
45
|
+
* toggles `open` via `onOpenChange` without opening a floating popover, and a
|
|
46
|
+
* second `<Summary sections={sections} onOpen={...} pane />` docks the summary
|
|
47
|
+
* inline on the right edge of the inner pane, shifting the main content left so
|
|
48
|
+
* it stays open while toggled.
|
|
43
49
|
*/
|
|
44
|
-
export function Summary({ sections, onOpen, label: named }) {
|
|
50
|
+
export function Summary({ sections, onOpen, label: named, open: controlledOpen, onOpenChange, docked = false, pane = false, }) {
|
|
45
51
|
const { t } = useI18n();
|
|
46
52
|
const label = named ?? t('Summary');
|
|
47
|
-
const [
|
|
53
|
+
const [uncontrolledOpen, setUncontrolledOpen] = useState(false);
|
|
54
|
+
const open = controlledOpen ?? uncontrolledOpen;
|
|
55
|
+
const setOpen = onOpenChange ?? setUncontrolledOpen;
|
|
56
|
+
if (pane) {
|
|
57
|
+
return (_jsx(YStack, { "data-slot": "summary", role: "complementary", "aria-label": label, width: 280, shrink: 0, minH: 0, self: "stretch", p: 8, overflowY: "auto", overflowX: "hidden", children: sections.map((s, i) => (_jsxs(YStack, { pt: i ? 8 : 0, children: [_jsx(Head, { action: s.action, children: s.title }), _jsx(Rows, { section: s, done: onOpen, details: true })] }, s.id))) }));
|
|
58
|
+
}
|
|
59
|
+
const toggle = (_jsx(XStack, { render: "button", "data-slot": "summary-toggle", "aria-label": label, "aria-haspopup": docked ? undefined : 'dialog', "aria-expanded": open, ...{ title: label }, onPress: docked ? () => setOpen(!open) : undefined, width: 32, height: 32, rounded: "$3", items: "center", justify: "center", cursor: "pointer", bg: open ? '$hover' : 'transparent', hoverStyle: { bg: '$hover' }, focusVisibleStyle: { outlineWidth: 2, outlineStyle: 'solid', outlineColor: '$outlineColor' }, children: _jsx(ListTodo, { size: 16, "aria-hidden": true }) }));
|
|
60
|
+
if (docked)
|
|
61
|
+
return toggle;
|
|
48
62
|
const done = () => {
|
|
49
63
|
setOpen(false);
|
|
50
64
|
onOpen?.();
|
|
51
65
|
};
|
|
52
|
-
return (_jsxs(Popover, { open: open, onOpenChange: setOpen, allowFlip: true, children: [_jsx(PopoverTrigger, { children:
|
|
66
|
+
return (_jsxs(Popover, { open: open, onOpenChange: setOpen, allowFlip: true, children: [_jsx(PopoverTrigger, { children: toggle }), _jsx(PopoverContent, { solid: true, align: "end", sideOffset: 8, p: 4, width: 288, maxW: "calc(100vw - 24px)", children: _jsx(YStack, { "data-slot": "summary", role: "dialog", "aria-label": label, self: "stretch", width: "100%", maxH: "min(70dvh, 520px)", overflowY: "auto", overflowX: "hidden", children: sections.map((s, i) => (_jsxs(YStack, { pt: i ? 8 : 0, children: [_jsx(Head, { action: s.action, children: s.title }), _jsx(Rows, { section: s, done: done })] }, s.id))) }) })] }));
|
|
53
67
|
}
|
|
54
68
|
/** Each section as a kind of tab for `Panel`: the same rows, with their second lines. */
|
|
55
69
|
export function kinds(sections, icons = {}) {
|
package/lib/transcript.d.ts
CHANGED
|
@@ -2,7 +2,12 @@ import { type Verdict } from '@hanzo/ui/agents';
|
|
|
2
2
|
import { type ReactNode } from 'react';
|
|
3
3
|
import type { Card } from './api/turn.ts';
|
|
4
4
|
import { type Artifact, type Listen } from './reply.tsx';
|
|
5
|
-
export
|
|
5
|
+
export interface QueuedMessage {
|
|
6
|
+
id: string;
|
|
7
|
+
text: string;
|
|
8
|
+
}
|
|
9
|
+
export type TranscriptView = 'normal' | 'thinking' | 'verbose';
|
|
10
|
+
export declare function Transcript({ cards, live, empty, header, onApprove, approving, onVerdict, onOpen, onDiff, listen, end, view, queued, onSendQueued, }: {
|
|
6
11
|
cards: Card[];
|
|
7
12
|
/** The run is still working: a card still running shows it; otherwise it was cut off. */
|
|
8
13
|
live: boolean;
|
|
@@ -21,4 +26,10 @@ export declare function Transcript({ cards, live, empty, header, onApprove, appr
|
|
|
21
26
|
listen?: Listen;
|
|
22
27
|
/** After the last card: how the run ended, when it ended on an error. */
|
|
23
28
|
end?: ReactNode;
|
|
29
|
+
/** How much of the agent's internal reasoning and tool output is unfolded by default. */
|
|
30
|
+
view?: TranscriptView;
|
|
31
|
+
/** Messages queued with Ctrl+Enter while the run works, waiting to be sent. */
|
|
32
|
+
queued?: QueuedMessage[];
|
|
33
|
+
/** Send a queued message immediately. */
|
|
34
|
+
onSendQueued?: (id: string) => void;
|
|
24
35
|
}): import("react").JSX.Element;
|
package/lib/transcript.js
CHANGED
|
@@ -30,37 +30,45 @@ const tail = (s) => (s.length > TAIL ? `…${s.slice(-TAIL)}` : s);
|
|
|
30
30
|
const mono = { fontFamily: 'var(--f-mono, ui-monospace, monospace)' };
|
|
31
31
|
/** What a thought is about: its first line, without the markdown that bolds it. */
|
|
32
32
|
const firstLine = (text) => text.trim().split('\n')[0].replace(/[*_#`]/g, '').slice(0, 120);
|
|
33
|
-
|
|
33
|
+
function UserSaid({ text }) {
|
|
34
|
+
const { t } = useI18n();
|
|
35
|
+
const [open, setOpen] = useState(false);
|
|
36
|
+
const long = text.length > 180 || text.includes('\n');
|
|
37
|
+
return (_jsxs(YStack, { gap: "$1", children: [_jsx(YStack, { ...(long && !open ? { maxHeight: 72, overflow: 'hidden' } : null), children: _jsx(Prose, { text: text }) }), long ? (_jsx(XStack, { render: "button", "aria-expanded": open, onPress: () => setOpen((v) => !v), self: "flex-start", px: "$2", py: "$1", rounded: "$2", hoverStyle: { bg: '$hover' }, children: _jsx(SizableText, { size: "$1", color: "$soft", children: open ? t('Show less') : t('Show more') }) })) : null] }));
|
|
38
|
+
}
|
|
39
|
+
export function Transcript({ cards, live, empty, header, onApprove, approving = false, onVerdict, onOpen, onDiff, listen, end, view = 'normal', queued = [], onSendQueued, }) {
|
|
34
40
|
const { t } = useI18n();
|
|
35
41
|
// A card the run never finished is cut off once the run has ended, not still going.
|
|
36
42
|
const state = (ran) => (ran === 'running' && !live ? 'cancelled' : ran);
|
|
37
43
|
// The answer still arriving: the last thing the agent said while the run works.
|
|
38
44
|
const last = live ? [...cards].reverse().find((c) => c.kind === 'said' && c.who === 'agent')?.key : undefined;
|
|
39
|
-
|
|
45
|
+
const expandThink = view === 'thinking' || view === 'verbose';
|
|
46
|
+
const expandVerbose = view === 'verbose';
|
|
47
|
+
return (_jsxs(Thread, { gap: GAP, column: { maxW: MEASURE }, "aria-label": t('Transcript'), children: [header, cards.length === 0 && queued.length === 0 ? _jsx(YStack, { py: "$2", children: empty }) : null, cards.map((c) => {
|
|
40
48
|
switch (c.kind) {
|
|
41
49
|
case 'said': {
|
|
42
50
|
if (c.who === 'person')
|
|
43
|
-
return (_jsx(Message, { role: "user", children: _jsx(
|
|
51
|
+
return (_jsx(Message, { role: "user", children: _jsx(UserSaid, { text: c.text }) }, c.key));
|
|
44
52
|
const made = artifacts(c.text);
|
|
45
53
|
const first = lead(made);
|
|
46
54
|
return (_jsx(Message, { role: "assistant", busy: c.key === last, children: _jsxs(YStack, { gap: "$1", children: [_jsx(Prose, { text: c.text }), c.key === last ? null : (_jsx(Reply, { text: c.text, listen: listen, onOpen: first && onOpen ? () => onOpen(first) : undefined, children: _jsx(Judge, { onVerdict: onVerdict }) }))] }) }, c.key));
|
|
47
55
|
}
|
|
48
56
|
case 'think':
|
|
49
|
-
return (_jsx(Step, { name: t('Thought'), detail: firstLine(c.text), status: "done", "aria-label": t('Thought'), children: _jsx(Prose, { text: c.text }) }, c.key));
|
|
57
|
+
return (_jsx(Step, { name: t('Thought'), detail: firstLine(c.text), status: "done", defaultOpen: expandThink, "aria-label": t('Thought'), children: _jsx(Prose, { text: c.text }) }, `${c.key}:${view}`));
|
|
50
58
|
case 'todo':
|
|
51
59
|
return (_jsx(YStack, { gap: "$1", px: "$3", py: "$2", rounded: "$3", borderWidth: 1, borderColor: "$borderColor", "aria-label": t('Plan checklist'), children: c.items.map((x, i) => (_jsxs(XStack, { gap: "$2", items: "flex-start", children: [_jsx(SizableText, { size: "$2", color: x.done ? '$ink' : '$soft', children: x.done ? '✓' : '○' }), _jsx(SizableText, { flex: 1, size: "$2", color: x.done ? '$soft' : '$ink', children: x.text })] }, i))) }, c.key));
|
|
52
60
|
case 'shell':
|
|
53
|
-
return (_jsx(Step, { name: t('Shell'), detail: c.command, status: state(c.ran), "aria-label": t('Command {command}', { command: c.command }), children: _jsx(Code, { language: "shell", value: c.output ? `$ ${c.command}\n${c.output}` : `$ ${c.command}`, children: c.output ? `$ ${c.command}\n${tail(c.output)}` : `$ ${c.command}` }) }, c.key));
|
|
61
|
+
return (_jsx(Step, { name: t('Shell'), detail: c.command, status: state(c.ran), defaultOpen: expandVerbose, "aria-label": t('Command {command}', { command: c.command }), children: _jsx(Code, { language: "shell", value: c.output ? `$ ${c.command}\n${c.output}` : `$ ${c.command}`, children: c.output ? `$ ${c.command}\n${tail(c.output)}` : `$ ${c.command}` }) }, `${c.key}:${view}`));
|
|
54
62
|
case 'edit':
|
|
55
|
-
return (_jsx(Step, { name: c.files.length === 1 ? t('Edited') : c.files.length ? t('Edited {n} files', { n: c.files.length }) : t('Edited files'), detail: c.files.join(', '), status: state(c.ran), "aria-label": c.files.length ? t('Edited {files}', { files: c.files.join(', ') }) : t('Edited files'), children: _jsxs(YStack, { gap: "$2", items: "flex-start", children: [_jsx(SizableText, { size: "$1", color: "$soft", style: { whiteSpace: 'pre-wrap' }, children: c.files.length ? c.files.join('\n') : t('The agent named no files.') }), onDiff ? (_jsx(Button, { size: "sm", variant: "outline", onPress: onDiff, children: t('Open the diff') })) : null] }) }, c.key));
|
|
63
|
+
return (_jsx(Step, { name: c.files.length === 1 ? t('Edited') : c.files.length ? t('Edited {n} files', { n: c.files.length }) : t('Edited files'), detail: c.files.join(', '), status: state(c.ran), defaultOpen: expandVerbose, "aria-label": c.files.length ? t('Edited {files}', { files: c.files.join(', ') }) : t('Edited files'), children: _jsxs(YStack, { gap: "$2", items: "flex-start", children: [_jsx(SizableText, { size: "$1", color: "$soft", style: { whiteSpace: 'pre-wrap' }, children: c.files.length ? c.files.join('\n') : t('The agent named no files.') }), onDiff ? (_jsx(Button, { size: "sm", variant: "outline", onPress: onDiff, children: t('Open the diff') })) : null] }) }, `${c.key}:${view}`));
|
|
56
64
|
case 'step':
|
|
57
|
-
return (_jsx(Step, { name: t(c.name), detail: c.detail, status: state(c.ran), defaultOpen: c.name === 'Error', "aria-label": `${t(c.name)} ${c.detail}`.trim(), children: c.name === 'Error' ? (_jsx(SizableText, { size: "$2", color: "$ink", style: { ...mono, whiteSpace: 'pre-wrap', overflowWrap: 'anywhere' }, children: c.output })) : c.output.trim() ? (_jsx(Code, { language: "output", value: c.output, children: tail(c.output.replace(/\n+$/, '')) })) : undefined }, c.key));
|
|
65
|
+
return (_jsx(Step, { name: t(c.name), detail: c.detail, status: state(c.ran), defaultOpen: c.name === 'Error' || expandVerbose, "aria-label": `${t(c.name)} ${c.detail}`.trim(), children: c.name === 'Error' ? (_jsx(SizableText, { size: "$2", color: "$ink", style: { ...mono, whiteSpace: 'pre-wrap', overflowWrap: 'anywhere' }, children: c.output })) : c.output.trim() ? (_jsx(Code, { language: "output", value: c.output, children: tail(c.output.replace(/\n+$/, '')) })) : undefined }, `${c.key}:${view}`));
|
|
58
66
|
case 'note':
|
|
59
67
|
return (_jsx(SizableText, { size: "$1", color: "$soft", role: "note", children: t(c.text) }, c.key));
|
|
60
68
|
case 'plan':
|
|
61
69
|
return (_jsxs(YStack, { gap: "$3", p: "$4", rounded: "$4", borderWidth: 1, borderColor: "$borderColor", bg: "$panel", "aria-label": t('Plan'), children: [_jsx(SizableText, { size: "$2", color: "$soft", children: t('Plan') }), _jsx(Prose, { text: c.text }), _jsxs(XStack, { items: "center", gap: "$2", flexWrap: "wrap", children: [_jsx(Reply, { text: c.text, listen: listen }), onApprove ? (_jsx(Button, { size: "sm", disabled: approving, onPress: () => onApprove(c.text), children: approving ? t('Starting the build…') : t('Approve and build') })) : null, _jsx(Judge, { onVerdict: onVerdict })] })] }, c.key));
|
|
62
70
|
}
|
|
63
|
-
}), end] }));
|
|
71
|
+
}), queued.map((q) => (_jsxs(YStack, { gap: "$1", items: "flex-end", children: [_jsx(Message, { role: "user", children: _jsx(UserSaid, { text: q.text }) }), onSendQueued ? (_jsx(XStack, { render: "button", "aria-label": t('Send now'), onPress: () => onSendQueued(q.id), px: "$2", py: "$0.5", rounded: "$2", hoverStyle: { bg: '$hover' }, children: _jsx(SizableText, { size: "$1", color: "$soft", children: t('Send now') }) })) : null] }, q.id))), end] }));
|
|
64
72
|
}
|
|
65
73
|
/** Say whether what the agent said was good. A verdict that did not land is taken back and says why. */
|
|
66
74
|
function Judge({ onVerdict }) {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@hanzo/build",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.110",
|
|
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.",
|