@hanzo/build 0.2.121 → 0.2.123
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/cli.d.ts +59 -0
- package/lib/api/cli.js +133 -0
- package/lib/api/sessions.d.ts +13 -0
- package/lib/api/sessions.js +23 -2
- package/lib/api/talk.d.ts +44 -0
- package/lib/api/talk.js +71 -0
- package/lib/api/turn.d.ts +29 -3
- package/lib/api/turn.js +121 -5
- package/lib/builder.js +2 -2
- package/lib/data.d.ts +4 -2
- package/lib/data.js +43 -10
- package/lib/index.d.ts +2 -1
- package/lib/index.js +2 -1
- package/lib/landing.js +15 -14
- package/lib/mind.d.ts +2 -0
- package/lib/mind.js +28 -1
- package/lib/project.js +4 -1
- package/lib/run.d.ts +1 -0
- package/lib/run.js +30 -5
- package/lib/section.d.ts +5 -0
- package/lib/section.js +7 -1
- package/lib/shelf.js +5 -4
- package/lib/talk.d.ts +5 -0
- package/lib/talk.js +104 -0
- package/lib/transcript.d.ts +5 -1
- package/lib/transcript.js +15 -4
- package/package.json +1 -1
package/lib/transcript.js
CHANGED
|
@@ -3,7 +3,8 @@ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
|
3
3
|
* A run's transcript, drawn by what each part is (turn.ts `cards`): what the
|
|
4
4
|
* agent said as markdown, its reasoning folded, each command it ran as a card
|
|
5
5
|
* that opens onto its output, the files it changed, its plan as a checklist, the
|
|
6
|
-
* run's own steps,
|
|
6
|
+
* run's own steps, a plan run's plan with the button that builds it, and in a
|
|
7
|
+
* conversation the coding runs its turns started, each opening on its own page.
|
|
7
8
|
* What the agent said, and its plan, can be copied and judged, as a reply on
|
|
8
9
|
* claude.ai can: a thumb pressed again takes the verdict back.
|
|
9
10
|
*
|
|
@@ -22,6 +23,7 @@ import { Button } from '@hanzo/ui';
|
|
|
22
23
|
import { Feedback } from '@hanzo/ui/agents';
|
|
23
24
|
import { Code, GAP, MEASURE, Message, Step, Thread } from '@hanzo/ui/chat';
|
|
24
25
|
import { useState } from 'react';
|
|
26
|
+
import { counted, edited, explored } from './api/cli.js';
|
|
25
27
|
import { Prose } from './prose.js';
|
|
26
28
|
import { artifacts, lead, Reply } from './reply.js';
|
|
27
29
|
/** A card's output, its tail: what a command said last is why it stopped. */
|
|
@@ -36,7 +38,7 @@ function UserSaid({ text }) {
|
|
|
36
38
|
const long = text.length > 180 || text.includes('\n');
|
|
37
39
|
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
40
|
}
|
|
39
|
-
export function Transcript({ cards, live, empty, header, onApprove, approving = false, onVerdict, onOpen, onDiff, listen, end, view = 'normal', queued = [], onSendQueued, }) {
|
|
41
|
+
export function Transcript({ cards, live, empty, header, onApprove, approving = false, onVerdict, onOpen, onDiff, listen, end, view = 'normal', queued = [], onSendQueued, onRun, onAnswer, }) {
|
|
40
42
|
const { t } = useI18n();
|
|
41
43
|
// A card the run never finished is cut off once the run has ended, not still going.
|
|
42
44
|
const state = (ran) => (ran === 'running' && !live ? 'cancelled' : ran);
|
|
@@ -58,13 +60,22 @@ export function Transcript({ cards, live, empty, header, onApprove, approving =
|
|
|
58
60
|
case 'todo':
|
|
59
61
|
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));
|
|
60
62
|
case 'shell':
|
|
61
|
-
|
|
63
|
+
// The CLI's words: Ran (Running while it works), the command as the shell got it, its output under it.
|
|
64
|
+
return (_jsx(Step, { name: state(c.ran) === 'running' ? t('Running') : t('Ran'), 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 || t('(no output)'), children: c.output ? tail(c.output.replace(/\n+$/, '')) : t('(no output)') }) }, `${c.key}:${view}`));
|
|
65
|
+
case 'explore':
|
|
66
|
+
// The CLI's Explored block: one line an action, consecutive reads on one line (cli.ts explored).
|
|
67
|
+
return (_jsxs(YStack, { gap: "$1", "aria-label": state(c.ran) === 'running' ? t('Exploring') : t('Explored'), children: [_jsx(SizableText, { size: "$2", color: "$ink", fontWeight: "600", children: state(c.ran) === 'running' ? t('Exploring') : t('Explored') }), explored(c.calls).map((l, i) => (_jsxs(XStack, { gap: "$2", pl: "$3", children: [_jsx(SizableText, { size: "$2", color: "$soft", shrink: 0, children: t(l.title) }), _jsx(SizableText, { size: "$2", color: "$ink", style: { ...mono, overflowWrap: 'anywhere' }, children: l.text })] }, i)))] }, c.key));
|
|
62
68
|
case 'edit':
|
|
63
|
-
|
|
69
|
+
// The CLI's patch header: Added / Deleted / Edited a file, or Edited N files, with the lines added and removed.
|
|
70
|
+
return (_jsx(Step, { name: !c.files.length ? t('Edited files') : c.files.length > 1 ? `Edited ${c.files.length} files` : edited(c.files).split(' ')[0], detail: !c.files.length ? '' : c.files.length > 1 ? edited(c.files).split(' ').slice(3).join(' ') : edited(c.files).split(' ').slice(1).join(' '), status: state(c.ran), defaultOpen: expandVerbose, "aria-label": c.files.length ? edited(c.files) : 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.map((f) => `${f.path} ${counted(f)}`.trimEnd()).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}`));
|
|
64
71
|
case 'step':
|
|
65
72
|
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}`));
|
|
66
73
|
case 'note':
|
|
67
74
|
return (_jsx(SizableText, { size: "$1", color: "$soft", role: "note", children: t(c.text) }, c.key));
|
|
75
|
+
case 'run':
|
|
76
|
+
return (_jsxs(XStack, { items: "center", gap: "$2", px: "$3", py: "$2", rounded: "$3", borderWidth: 1, borderColor: "$borderColor", "aria-label": t('Coding run'), children: [_jsx(SizableText, { flex: 1, minW: 0, size: "$2", color: "$ink", numberOfLines: 1, children: t('Coding run') }), onRun ? (_jsx(Button, { size: "sm", variant: "outline", onPress: () => onRun(c.session), children: t('Open the run') })) : null] }, c.key));
|
|
77
|
+
case 'ask':
|
|
78
|
+
return (_jsxs(YStack, { gap: "$2", p: "$3", rounded: "$3", borderWidth: 1, borderColor: "$borderColor", "aria-label": t('Question'), children: [_jsx(Prose, { text: c.text }), c.answer ? (_jsx(SizableText, { size: "$2", color: "$soft", children: `✓ ${c.answer}` })) : (_jsx(XStack, { gap: "$2", flexWrap: "wrap", children: c.options.map((label) => (_jsx(Button, { size: "sm", variant: "outline", disabled: !onAnswer, onPress: () => onAnswer?.(c.question, label), children: label }, label))) }))] }, c.key));
|
|
68
79
|
case 'plan':
|
|
69
80
|
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));
|
|
70
81
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@hanzo/build",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.123",
|
|
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.",
|