@hanzo/ui 8.14.0 → 8.14.1

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.
@@ -0,0 +1,119 @@
1
+ 'use client';"use strict";
2
+ 'use client';
3
+ Object.defineProperty(exports, "__esModule", { value: true });
4
+ exports.RunRow = RunRow;
5
+ exports.AgentBoard = AgentBoard;
6
+ exports.nest = nest;
7
+ const jsx_runtime_1 = require("react/jsx-runtime");
8
+ /**
9
+ * AgentBoard — the agents working view: who is running, on what, and where.
10
+ *
11
+ * A run is a SESSION, and a session that spawned others is the root of a tree.
12
+ * A flat list draws a fan-out as N unrelated rows and loses the one fact worth
13
+ * seeing — that they are one piece of work — so the board nests children under
14
+ * their root and a collapsed root says how many it is hiding.
15
+ *
16
+ * Grouped by PROJECT, because that is the question a person opens this with:
17
+ * not "what is running" but "what is running on the thing I am working on".
18
+ * A session with no project groups under `ungrouped`, named rather than hidden.
19
+ *
20
+ * Presentational. It takes rows and raises `onOpen`; it does no fetching, no
21
+ * grouping policy beyond the field it is given, and no status derivation. The
22
+ * surface holds the data — `@hanzo/ai`'s `sessions.list` / `sessions.tree` and
23
+ * the stream — so the same board serves hanzo.ai, a channel workspace, or
24
+ * anything else that can answer with rows.
25
+ */
26
+ const gui_1 = require("@hanzo/gui");
27
+ const lucide_icons_2_1 = require("@hanzogui/lucide-icons-2");
28
+ const react_1 = require("react");
29
+ const slot_1 = require("../backends/gui/slot.cjs");
30
+ const TONE = {
31
+ running: '$green10',
32
+ paused: '$yellow10',
33
+ done: '$color10',
34
+ error: '$red10',
35
+ unknown: '$color8',
36
+ };
37
+ /** The label a status wears. Separate from the colour so neither is guessed. */
38
+ const SAYS = {
39
+ running: 'running',
40
+ paused: 'paused',
41
+ done: 'done',
42
+ error: 'error',
43
+ unknown: '—',
44
+ };
45
+ function Dot({ status }) {
46
+ return ((0, jsx_runtime_1.jsx)(gui_1.YStack, { width: 7, height: 7, rounded: 9999, bg: TONE[status], shrink: 0, "aria-label": SAYS[status] }));
47
+ }
48
+ /**
49
+ * One row, and its children under it.
50
+ *
51
+ * Expansion is per-row local state: a board is read top-down and a caller that
52
+ * wanted to persist which roots are open would be holding UI state for a list
53
+ * it does not own. A root with children opens by default, because the fan-out
54
+ * is the thing worth seeing.
55
+ */
56
+ function RunRow({ run, depth = 0, active = false, onOpen, trailing, ...rest }) {
57
+ const kids = run.children ?? [];
58
+ const [open, setOpen] = (0, react_1.useState)(true);
59
+ return ((0, jsx_runtime_1.jsxs)(gui_1.YStack, { ...(0, slot_1.slot)('run-row'), ...rest, children: [(0, jsx_runtime_1.jsxs)(gui_1.XStack, { items: "center", gap: "$2", px: "$2", py: "$1.5", rounded: "$3", pl: 8 + depth * 16, cursor: "pointer", role: "button", tabIndex: 0, "aria-current": active ? 'true' : undefined, bg: active ? '$edge' : undefined, hoverStyle: { bg: active ? '$edge' : '$hover' }, pressStyle: { bg: '$raised' }, onPress: () => onOpen?.(run.id), children: [kids.length ? ((0, jsx_runtime_1.jsx)(gui_1.XStack, { width: 16, height: 16, items: "center", justify: "center", shrink: 0, role: "button", tabIndex: 0, "aria-expanded": open, "aria-label": open ? 'Hide sub-agents' : 'Show sub-agents', onPress: (e) => {
60
+ e.stopPropagation?.();
61
+ setOpen((v) => !v);
62
+ }, children: open ? (0, jsx_runtime_1.jsx)(lucide_icons_2_1.ChevronDown, { size: 13, opacity: 0.6 }) : (0, jsx_runtime_1.jsx)(lucide_icons_2_1.ChevronRight, { size: 13, opacity: 0.6 }) })) : ((0, jsx_runtime_1.jsx)(gui_1.YStack, { width: 16, shrink: 0 })), (0, jsx_runtime_1.jsx)(Dot, { status: run.status }), (0, jsx_runtime_1.jsx)(gui_1.SizableText, { size: "$2", numberOfLines: 1, shrink: 1, color: active ? '$color' : '$quiet', children: run.agent }), run.doing ? ((0, jsx_runtime_1.jsx)(gui_1.SizableText, { size: "$1", numberOfLines: 1, flex: 1, color: "$soft", children: run.doing })) : ((0, jsx_runtime_1.jsx)(gui_1.XStack, { flex: 1 })), kids.length && !open ? ((0, jsx_runtime_1.jsxs)(gui_1.SizableText, { size: "$1", color: "$soft", children: [kids.length, " sub-agent", kids.length === 1 ? '' : 's'] })) : null, run.target ? ((0, jsx_runtime_1.jsx)(gui_1.SizableText, { size: "$1", color: "$soft", numberOfLines: 1, children: run.target })) : null, trailing] }), open && kids.length
63
+ ? kids.map((kid) => ((0, jsx_runtime_1.jsx)(RunRow, { run: kid, depth: depth + 1, onOpen: onOpen }, kid.id)))
64
+ : null] }));
65
+ }
66
+ /**
67
+ * The board.
68
+ *
69
+ * Groups are ordered by name with the un-projected group LAST, so the answer to
70
+ * "what is running on my project" is never below a pile of stray runs.
71
+ */
72
+ function AgentBoard({ runs, active, onOpen, empty, otherLabel = 'Other work', ...rest }) {
73
+ const groups = (0, react_1.useMemo)(() => group(runs, otherLabel), [runs, otherLabel]);
74
+ if (!runs.length) {
75
+ return ((0, jsx_runtime_1.jsx)(gui_1.YStack, { ...(0, slot_1.slot)('agent-board'), p: "$4", ...rest, children: empty ?? ((0, jsx_runtime_1.jsx)(gui_1.SizableText, { size: "$2", color: "$soft", children: "Nothing running." })) }));
76
+ }
77
+ return ((0, jsx_runtime_1.jsx)(gui_1.ScrollView, { ...(0, slot_1.slot)('agent-board'), flex: 1, showsVerticalScrollIndicator: false, ...rest, children: (0, jsx_runtime_1.jsx)(gui_1.YStack, { gap: "$1", p: "$2", children: groups.map(([project, rows]) => ((0, jsx_runtime_1.jsxs)(gui_1.YStack, { mt: "$2", gap: "$0.5", children: [(0, jsx_runtime_1.jsx)(gui_1.SizableText, { size: "$1", px: "$2", py: "$1", color: "$soft", fontWeight: "500", children: project }), rows.map((run) => ((0, jsx_runtime_1.jsx)(RunRow, { run: run, active: run.id === active, onOpen: onOpen }, run.id)))] }, project))) }) }));
78
+ }
79
+ /** Group roots by project, un-projected last. */
80
+ function group(runs, otherLabel) {
81
+ const by = new Map();
82
+ for (const run of runs) {
83
+ const key = run.project?.trim() || otherLabel;
84
+ const rows = by.get(key);
85
+ if (rows)
86
+ rows.push(run);
87
+ else
88
+ by.set(key, [run]);
89
+ }
90
+ return [...by.entries()].sort(([a], [b]) => a === otherLabel ? 1 : b === otherLabel ? -1 : a.localeCompare(b));
91
+ }
92
+ /**
93
+ * Build the tree a board draws from the flat list an API answers with.
94
+ *
95
+ * A session names its root rather than its parent, so a fan-out is TWO levels
96
+ * and not N: every non-root hangs off its root. A row whose root is not in the
97
+ * list is treated as a root itself — otherwise a filtered page silently drops
98
+ * work, which is the one thing a board must not do.
99
+ */
100
+ function nest(rows) {
101
+ const roots = new Map();
102
+ const orphans = [];
103
+ for (const row of rows) {
104
+ if (!row.rootId || row.rootId === row.id)
105
+ roots.set(row.id, { ...row, children: [] });
106
+ }
107
+ for (const row of rows) {
108
+ if (!row.rootId || row.rootId === row.id)
109
+ continue;
110
+ const root = roots.get(row.rootId);
111
+ if (root)
112
+ root.children.push({ ...row, children: [] });
113
+ else
114
+ orphans.push(row);
115
+ }
116
+ for (const row of orphans)
117
+ roots.set(row.id, { ...row, children: [] });
118
+ return [...roots.values()];
119
+ }
@@ -0,0 +1,98 @@
1
+ /**
2
+ * AgentBoard — the agents working view: who is running, on what, and where.
3
+ *
4
+ * A run is a SESSION, and a session that spawned others is the root of a tree.
5
+ * A flat list draws a fan-out as N unrelated rows and loses the one fact worth
6
+ * seeing — that they are one piece of work — so the board nests children under
7
+ * their root and a collapsed root says how many it is hiding.
8
+ *
9
+ * Grouped by PROJECT, because that is the question a person opens this with:
10
+ * not "what is running" but "what is running on the thing I am working on".
11
+ * A session with no project groups under `ungrouped`, named rather than hidden.
12
+ *
13
+ * Presentational. It takes rows and raises `onOpen`; it does no fetching, no
14
+ * grouping policy beyond the field it is given, and no status derivation. The
15
+ * surface holds the data — `@hanzo/ai`'s `sessions.list` / `sessions.tree` and
16
+ * the stream — so the same board serves hanzo.ai, a channel workspace, or
17
+ * anything else that can answer with rows.
18
+ */
19
+ import { ScrollView, YStack } from '@hanzo/gui';
20
+ import { type ComponentProps, type ReactNode } from 'react';
21
+ type Col = Omit<ComponentProps<typeof YStack>, 'children'>;
22
+ type Scroll = Omit<ComponentProps<typeof ScrollView>, 'children'>;
23
+ /** The states a run can be in. `unknown` is honest about a value we do not model. */
24
+ export type RunStatus = 'running' | 'paused' | 'done' | 'error' | 'unknown';
25
+ /**
26
+ * One run.
27
+ *
28
+ * `children` is the fan-out. It is the SHAPE the board draws, so a caller with
29
+ * a flat list plus parent ids builds the tree before handing it over — `nest()`
30
+ * below does exactly that and is exported for the purpose.
31
+ */
32
+ export interface Run {
33
+ id: string;
34
+ /** The agent doing the work. */
35
+ agent: string;
36
+ status: RunStatus;
37
+ /** What it is doing right now — one line, already trimmed by the caller. */
38
+ doing?: string;
39
+ /** Where it is running: a machine, a sandbox, a registered target. */
40
+ target?: string;
41
+ /** The project this run belongs to. Absent groups under "Other work". */
42
+ project?: string;
43
+ /** Sub-agents this run spawned. */
44
+ children?: Run[];
45
+ }
46
+ export interface RunRowProps extends Col {
47
+ run: Run;
48
+ depth?: number;
49
+ active?: boolean;
50
+ onOpen?: (id: string) => void;
51
+ /** Rendered at the end of the row — a watch affordance, a menu, a count. */
52
+ trailing?: ReactNode;
53
+ }
54
+ /**
55
+ * One row, and its children under it.
56
+ *
57
+ * Expansion is per-row local state: a board is read top-down and a caller that
58
+ * wanted to persist which roots are open would be holding UI state for a list
59
+ * it does not own. A root with children opens by default, because the fan-out
60
+ * is the thing worth seeing.
61
+ */
62
+ export declare function RunRow({ run, depth, active, onOpen, trailing, ...rest }: RunRowProps): import("react/jsx-runtime").JSX.Element;
63
+ export interface AgentBoardProps extends Scroll {
64
+ /** Roots. Children ride on each root's `children`. */
65
+ runs: Run[];
66
+ /** The run currently open, so the board can mark it. */
67
+ active?: string;
68
+ onOpen?: (id: string) => void;
69
+ /** What to draw when there is nothing running. */
70
+ empty?: ReactNode;
71
+ /** Heading for runs carrying no project. */
72
+ otherLabel?: string;
73
+ }
74
+ /**
75
+ * The board.
76
+ *
77
+ * Groups are ordered by name with the un-projected group LAST, so the answer to
78
+ * "what is running on my project" is never below a pile of stray runs.
79
+ */
80
+ export declare function AgentBoard({ runs, active, onOpen, empty, otherLabel, ...rest }: AgentBoardProps): import("react/jsx-runtime").JSX.Element;
81
+ /**
82
+ * Build the tree a board draws from the flat list an API answers with.
83
+ *
84
+ * A session names its root rather than its parent, so a fan-out is TWO levels
85
+ * and not N: every non-root hangs off its root. A row whose root is not in the
86
+ * list is treated as a root itself — otherwise a filtered page silently drops
87
+ * work, which is the one thing a board must not do.
88
+ */
89
+ export declare function nest<T extends {
90
+ id: string;
91
+ rootId?: string;
92
+ }>(rows: T[]): (T & {
93
+ children: (T & {
94
+ children: never[];
95
+ })[];
96
+ })[];
97
+ export {};
98
+ //# sourceMappingURL=Board.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Board.d.ts","sourceRoot":"","sources":["../../src/agents/Board.tsx"],"names":[],"mappings":"AAEA;;;;;;;;;;;;;;;;;GAiBG;AACH,OAAO,EAAE,UAAU,EAAuB,MAAM,EAAE,MAAM,YAAY,CAAA;AAEpE,OAAO,EAAqB,KAAK,cAAc,EAAE,KAAK,SAAS,EAAE,MAAM,OAAO,CAAA;AAI9E,KAAK,GAAG,GAAG,IAAI,CAAC,cAAc,CAAC,OAAO,MAAM,CAAC,EAAE,UAAU,CAAC,CAAA;AAC1D,KAAK,MAAM,GAAG,IAAI,CAAC,cAAc,CAAC,OAAO,UAAU,CAAC,EAAE,UAAU,CAAC,CAAA;AAEjE,qFAAqF;AACrF,MAAM,MAAM,SAAS,GAAG,SAAS,GAAG,QAAQ,GAAG,MAAM,GAAG,OAAO,GAAG,SAAS,CAAA;AAE3E;;;;;;GAMG;AACH,MAAM,WAAW,GAAG;IAClB,EAAE,EAAE,MAAM,CAAA;IACV,gCAAgC;IAChC,KAAK,EAAE,MAAM,CAAA;IACb,MAAM,EAAE,SAAS,CAAA;IACjB,4EAA4E;IAC5E,KAAK,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AC,GAAG;IAAE,QAAQ,EAAE,CAAC,CAAC,GAAG;QAAE,QAAQ,EAAE,KAAK,EAAE,CAAA;KAAE,CAAC,EAAE,CAAA;CAAE,CAAC,EAAE,CAgBrD"}
@@ -0,0 +1,115 @@
1
+ 'use client';
2
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
3
+ /**
4
+ * AgentBoard — the agents working view: who is running, on what, and where.
5
+ *
6
+ * A run is a SESSION, and a session that spawned others is the root of a tree.
7
+ * A flat list draws a fan-out as N unrelated rows and loses the one fact worth
8
+ * seeing — that they are one piece of work — so the board nests children under
9
+ * their root and a collapsed root says how many it is hiding.
10
+ *
11
+ * Grouped by PROJECT, because that is the question a person opens this with:
12
+ * not "what is running" but "what is running on the thing I am working on".
13
+ * A session with no project groups under `ungrouped`, named rather than hidden.
14
+ *
15
+ * Presentational. It takes rows and raises `onOpen`; it does no fetching, no
16
+ * grouping policy beyond the field it is given, and no status derivation. The
17
+ * surface holds the data — `@hanzo/ai`'s `sessions.list` / `sessions.tree` and
18
+ * the stream — so the same board serves hanzo.ai, a channel workspace, or
19
+ * anything else that can answer with rows.
20
+ */
21
+ import { ScrollView, SizableText, XStack, YStack } from '@hanzo/gui';
22
+ import { ChevronDown, ChevronRight } from '@hanzogui/lucide-icons-2';
23
+ import { useMemo, useState } from 'react';
24
+ import { slot } from '../backends/gui/slot.js';
25
+ const TONE = {
26
+ running: '$green10',
27
+ paused: '$yellow10',
28
+ done: '$color10',
29
+ error: '$red10',
30
+ unknown: '$color8',
31
+ };
32
+ /** The label a status wears. Separate from the colour so neither is guessed. */
33
+ const SAYS = {
34
+ running: 'running',
35
+ paused: 'paused',
36
+ done: 'done',
37
+ error: 'error',
38
+ unknown: '—',
39
+ };
40
+ function Dot({ status }) {
41
+ return (_jsx(YStack, { width: 7, height: 7, rounded: 9999, bg: TONE[status], shrink: 0, "aria-label": SAYS[status] }));
42
+ }
43
+ /**
44
+ * One row, and its children under it.
45
+ *
46
+ * Expansion is per-row local state: a board is read top-down and a caller that
47
+ * wanted to persist which roots are open would be holding UI state for a list
48
+ * it does not own. A root with children opens by default, because the fan-out
49
+ * is the thing worth seeing.
50
+ */
51
+ export function RunRow({ run, depth = 0, active = false, onOpen, trailing, ...rest }) {
52
+ const kids = run.children ?? [];
53
+ const [open, setOpen] = useState(true);
54
+ return (_jsxs(YStack, { ...slot('run-row'), ...rest, children: [_jsxs(XStack, { items: "center", gap: "$2", px: "$2", py: "$1.5", rounded: "$3", pl: 8 + depth * 16, cursor: "pointer", role: "button", tabIndex: 0, "aria-current": active ? 'true' : undefined, bg: active ? '$edge' : undefined, hoverStyle: { bg: active ? '$edge' : '$hover' }, pressStyle: { bg: '$raised' }, onPress: () => onOpen?.(run.id), children: [kids.length ? (_jsx(XStack, { width: 16, height: 16, items: "center", justify: "center", shrink: 0, role: "button", tabIndex: 0, "aria-expanded": open, "aria-label": open ? 'Hide sub-agents' : 'Show sub-agents', onPress: (e) => {
55
+ e.stopPropagation?.();
56
+ setOpen((v) => !v);
57
+ }, children: open ? _jsx(ChevronDown, { size: 13, opacity: 0.6 }) : _jsx(ChevronRight, { size: 13, opacity: 0.6 }) })) : (_jsx(YStack, { width: 16, shrink: 0 })), _jsx(Dot, { status: run.status }), _jsx(SizableText, { size: "$2", numberOfLines: 1, shrink: 1, color: active ? '$color' : '$quiet', children: run.agent }), run.doing ? (_jsx(SizableText, { size: "$1", numberOfLines: 1, flex: 1, color: "$soft", children: run.doing })) : (_jsx(XStack, { flex: 1 })), kids.length && !open ? (_jsxs(SizableText, { size: "$1", color: "$soft", children: [kids.length, " sub-agent", kids.length === 1 ? '' : 's'] })) : null, run.target ? (_jsx(SizableText, { size: "$1", color: "$soft", numberOfLines: 1, children: run.target })) : null, trailing] }), open && kids.length
58
+ ? kids.map((kid) => (_jsx(RunRow, { run: kid, depth: depth + 1, onOpen: onOpen }, kid.id)))
59
+ : null] }));
60
+ }
61
+ /**
62
+ * The board.
63
+ *
64
+ * Groups are ordered by name with the un-projected group LAST, so the answer to
65
+ * "what is running on my project" is never below a pile of stray runs.
66
+ */
67
+ export function AgentBoard({ runs, active, onOpen, empty, otherLabel = 'Other work', ...rest }) {
68
+ const groups = useMemo(() => group(runs, otherLabel), [runs, otherLabel]);
69
+ if (!runs.length) {
70
+ return (_jsx(YStack, { ...slot('agent-board'), p: "$4", ...rest, children: empty ?? (_jsx(SizableText, { size: "$2", color: "$soft", children: "Nothing running." })) }));
71
+ }
72
+ return (_jsx(ScrollView, { ...slot('agent-board'), flex: 1, showsVerticalScrollIndicator: false, ...rest, children: _jsx(YStack, { gap: "$1", p: "$2", children: groups.map(([project, rows]) => (_jsxs(YStack, { mt: "$2", gap: "$0.5", children: [_jsx(SizableText, { size: "$1", px: "$2", py: "$1", color: "$soft", fontWeight: "500", children: project }), rows.map((run) => (_jsx(RunRow, { run: run, active: run.id === active, onOpen: onOpen }, run.id)))] }, project))) }) }));
73
+ }
74
+ /** Group roots by project, un-projected last. */
75
+ function group(runs, otherLabel) {
76
+ const by = new Map();
77
+ for (const run of runs) {
78
+ const key = run.project?.trim() || otherLabel;
79
+ const rows = by.get(key);
80
+ if (rows)
81
+ rows.push(run);
82
+ else
83
+ by.set(key, [run]);
84
+ }
85
+ return [...by.entries()].sort(([a], [b]) => a === otherLabel ? 1 : b === otherLabel ? -1 : a.localeCompare(b));
86
+ }
87
+ /**
88
+ * Build the tree a board draws from the flat list an API answers with.
89
+ *
90
+ * A session names its root rather than its parent, so a fan-out is TWO levels
91
+ * and not N: every non-root hangs off its root. A row whose root is not in the
92
+ * list is treated as a root itself — otherwise a filtered page silently drops
93
+ * work, which is the one thing a board must not do.
94
+ */
95
+ export function nest(rows) {
96
+ const roots = new Map();
97
+ const orphans = [];
98
+ for (const row of rows) {
99
+ if (!row.rootId || row.rootId === row.id)
100
+ roots.set(row.id, { ...row, children: [] });
101
+ }
102
+ for (const row of rows) {
103
+ if (!row.rootId || row.rootId === row.id)
104
+ continue;
105
+ const root = roots.get(row.rootId);
106
+ if (root)
107
+ root.children.push({ ...row, children: [] });
108
+ else
109
+ orphans.push(row);
110
+ }
111
+ for (const row of orphans)
112
+ roots.set(row.id, { ...row, children: [] });
113
+ return [...roots.values()];
114
+ }
115
+ //# sourceMappingURL=Board.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Board.js","sourceRoot":"","sources":["../../src/agents/Board.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAA;;AAEZ;;;;;;;;;;;;;;;;;GAiBG;AACH,OAAO,EAAE,UAAU,EAAE,WAAW,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,YAAY,CAAA;AACpE,OAAO,EAAE,WAAW,EAAE,YAAY,EAAE,MAAM,0BAA0B,CAAA;AACpE,OAAO,EAAE,OAAO,EAAE,QAAQ,EAAuC,MAAM,OAAO,CAAA;AAE9E,OAAO,EAAE,IAAI,EAAE,MAAM,sBAAsB,CAAA;AA8B3C,MAAM,IAAI,GAAG;IACX,OAAO,EAAE,UAAU;IACnB,MAAM,EAAE,WAAW;IACnB,IAAI,EAAE,UAAU;IAChB,KAAK,EAAE,QAAQ;IACf,OAAO,EAAE,SAAS;CAC0B,CAAA;AAE9C,gFAAgF;AAChF,MAAM,IAAI,GAA8B;IACtC,OAAO,EAAE,SAAS;IAClB,MAAM,EAAE,QAAQ;IAChB,IAAI,EAAE,MAAM;IACZ,KAAK,EAAE,OAAO;IACd,OAAO,EAAE,GAAG;CACb,CAAA;AAED,SAAS,GAAG,CAAC,EAAE,MAAM,EAAyB;IAC5C,OAAO,CACL,KAAC,MAAM,IACL,KAAK,EAAE,CAAC,EACR,MAAM,EAAE,CAAC,EACT,OAAO,EAAE,IAAI,EACb,EAAE,EAAE,IAAI,CAAC,MAAM,CAAC,EAChB,MAAM,EAAE,CAAC,gBAGG,IAAI,CAAC,MAAM,CAAC,GACxB,CACH,CAAA;AACH,CAAC;AAWD;;;;;;;GAOG;AACH,MAAM,UAAU,MAAM,CAAC,EAAE,GAAG,EAAE,KAAK,GA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Property(exports, "__esModule", { value: true });
4
+ exports.Screen = Screen;
5
+ const jsx_runtime_1 = require("react/jsx-runtime");
6
+ /**
7
+ * Screen — watching a run while it works.
8
+ *
9
+ * Some runs have something to look at: a sandbox serving an interactive page, a
10
+ * headful browser a person can watch over VNC. Most have nothing, and this
11
+ * component's first job is to say which it is, honestly — a viewer that draws a
12
+ * black rectangle for a run with no screen has told the reader the run is
13
+ * broken.
14
+ *
15
+ * THE CREDENTIAL NEVER OUTLIVES THE VIEW. A watchable surface is authorized by
16
+ * a short-lived TICKET the caller mints per view; this component asks for one
17
+ * when it mounts, embeds the page the ticket names, and asks for another if the
18
+ * viewer stays past its life. It does NOT take a URL with a long-lived token in
19
+ * it, and there is no prop to pass one — an embed URL ends up in browser
20
+ * history, in a screenshot, and in whatever the parent frame can read.
21
+ *
22
+ * The mint is a PROP, not an import, because who may watch is the surface's
23
+ * question and the answer lives in `@hanzo/ai` on one deployment and behind a
24
+ * BFF on another. This file owns the frame, the states and the refresh.
25
+ */
26
+ const gui_1 = require("@hanzo/gui");
27
+ const react_1 = require("react");
28
+ const slot_1 = require("../backends/gui/slot.cjs");
29
+ const NAMES = {
30
+ sandbox: 'sandbox',
31
+ browser: 'browser',
32
+ };
33
+ /** Re-mint at 80% of a ticket's life — early enough that the frame never blinks. */
34
+ const EARLY = 0.8;
35
+ function Screen({ sessionId, kind, mint, empty, title, ...rest }) {
36
+ const [state, setState] = (0, react_1.useState)({ phase: 'idle' });
37
+ const timer = (0, react_1.useRef)(null);
38
+ const live = (0, react_1.useRef)(true);
39
+ const open = (0, react_1.useCallback)(async () => {
40
+ if (!mint || !kind)
41
+ return;
42
+ setState({ phase: 'minting' });
43
+ try {
44
+ const ticket = await mint(sessionId);
45
+ if (!live.current)
46
+ return;
47
+ setState({ phase: 'watching', url: ticket.url });
48
+ if (ticket.expiresIn && ticket.expiresIn > 0) {
49
+ if (timer.current)
50
+ clearTimeout(timer.current);
51
+ timer.current = setTimeout(() => void open(), ticket.expiresIn * 1000 * EARLY);
52
+ }
53
+ }
54
+ catch (err) {
55
+ if (!live.current)
56
+ return;
57
+ setState({
58
+ phase: 'failed',
59
+ message: err instanceof Error ? err.message : 'Could not open this screen.',
60
+ });
61
+ }
62
+ }, [mint, kind, sessionId]);
63
+ (0, react_1.useEffect)(() => {
64
+ live.current = true;
65
+ void open();
66
+ return () => {
67
+ live.current = false;
68
+ if (timer.current)
69
+ clearTimeout(timer.current);
70
+ };
71
+ }, [open]);
72
+ if (!kind) {
73
+ return ((0, jsx_runtime_1.jsx)(Frame, { title: title, ...rest, children: empty ?? ((0, jsx_runtime_1.jsx)(gui_1.SizableText, { size: "$2", color: "$soft", children: "This run has no screen." })) }));
74
+ }
75
+ if (!mint) {
76
+ return ((0, jsx_runtime_1.jsx)(Frame, { title: title, ...rest, children: (0, jsx_runtime_1.jsx)(gui_1.SizableText, { size: "$2", color: "$soft", children: "Watching is not wired up on this surface." }) }));
77
+ }
78
+ if (state.phase === 'failed') {
79
+ return ((0, jsx_runtime_1.jsx)(Frame, { title: title, ...rest, children: (0, jsx_runtime_1.jsxs)(gui_1.YStack, { gap: "$2", items: "center", children: [(0, jsx_runtime_1.jsx)(gui_1.SizableText, { size: "$2", color: "$soft", children: state.message }), (0, jsx_runtime_1.jsx)(gui_1.SizableText, { size: "$2", color: "$color", cursor: "pointer", role: "button", tabIndex: 0, onPress: () => void open(), children: "Try again" })] }) }));
80
+ }
81
+ if (state.phase !== 'watching') {
82
+ return ((0, jsx_runtime_1.jsx)(Frame, { title: title, ...rest, children: (0, jsx_runtime_1.jsxs)(gui_1.SizableText, { size: "$2", color: "$soft", children: ["Opening the ", NAMES[kind], "\u2026"] }) }));
83
+ }
84
+ return ((0, jsx_runtime_1.jsxs)(gui_1.YStack, { ...(0, slot_1.slot)('screen'), flex: 1, minH: 0, bg: "$panel", rounded: "$4", overflow: "hidden", ...rest, children: [title ? (0, jsx_runtime_1.jsx)(Caption, { children: title }) : null, (0, jsx_runtime_1.jsx)("iframe", { src: state.url, title: title ?? `Live ${NAMES[kind]}`, sandbox: "allow-scripts allow-same-origin allow-forms", referrerPolicy: "no-referrer", allow: "clipboard-read; clipboard-write", style: { border: 0, width: '100%', height: '100%', flex: 1, display: 'block' } })] }));
85
+ }
86
+ function Caption({ children }) {
87
+ return ((0, jsx_runtime_1.jsx)(gui_1.XStack, { px: "$3", py: "$2", borderBottomWidth: 1, borderColor: "$borderColor", children: (0, jsx_runtime_1.jsx)(gui_1.SizableText, { size: "$1", color: "$soft", numberOfLines: 1, children: children }) }));
88
+ }
89
+ function Frame({ title, children, ...rest }) {
90
+ return ((0, jsx_runtime_1.jsxs)(gui_1.YStack, { ...(0, slot_1.slot)('screen'), flex: 1, minH: 0, bg: "$panel", rounded: "$4", overflow: "hidden", ...rest, children: [title ? (0, jsx_runtime_1.jsx)(Caption, { children: title }) : null, (0, jsx_runtime_1.jsx)(gui_1.YStack, { flex: 1, items: "center", justify: "center", p: "$4", children: children })] }));
91
+ }
@@ -0,0 +1,53 @@
1
+ /**
2
+ * Screen — watching a run while it works.
3
+ *
4
+ * Some runs have something to look at: a sandbox serving an interactive page, a
5
+ * headful browser a person can watch over VNC. Most have nothing, and this
6
+ * component's first job is to say which it is, honestly — a viewer that draws a
7
+ * black rectangle for a run with no screen has told the reader the run is
8
+ * broken.
9
+ *
10
+ * THE CREDENTIAL NEVER OUTLIVES THE VIEW. A watchable surface is authorized by
11
+ * a short-lived TICKET the caller mints per view; this component asks for one
12
+ * when it mounts, embeds the page the ticket names, and asks for another if the
13
+ * viewer stays past its life. It does NOT take a URL with a long-lived token in
14
+ * it, and there is no prop to pass one — an embed URL ends up in browser
15
+ * history, in a screenshot, and in whatever the parent frame can read.
16
+ *
17
+ * The mint is a PROP, not an import, because who may watch is the surface's
18
+ * question and the answer lives in `@hanzo/ai` on one deployment and behind a
19
+ * BFF on another. This file owns the frame, the states and the refresh.
20
+ */
21
+ import { YStack } from '@hanzo/gui';
22
+ import { type ComponentProps, type ReactNode } from 'react';
23
+ type Col = Omit<ComponentProps<typeof YStack>, 'children'>;
24
+ /** What a mint answers with: where to look, and for how long. */
25
+ export interface Ticket {
26
+ /** The page to embed. Already carries whatever the grant put in it. */
27
+ url: string;
28
+ /** Seconds until it stops working. Absent, the view is not refreshed. */
29
+ expiresIn?: number;
30
+ }
31
+ /** How a run's screen is served, for the label a viewer reads. */
32
+ export type ScreenKind = 'sandbox' | 'browser';
33
+ export interface ScreenProps extends Col {
34
+ /** The run being watched. Changing it re-mints. */
35
+ sessionId: string;
36
+ /**
37
+ * What this run has to look at. `null` means nothing does — the honest empty
38
+ * state, and the common case. The caller decides; this component never guesses
39
+ * from a session's shape.
40
+ */
41
+ kind?: ScreenKind | null;
42
+ /**
43
+ * Mint a view. Called on mount, on `sessionId` change, and shortly before the
44
+ * previous ticket expires. Throwing renders the failure with a retry.
45
+ */
46
+ mint?: (sessionId: string) => Promise<Ticket>;
47
+ /** Shown when `kind` is null. */
48
+ empty?: ReactNode;
49
+ title?: string;
50
+ }
51
+ export declare function Screen({ sessionId, kind, mint, empty, title, ...rest }: ScreenProps): import("react/jsx-runtime").JSX.Element;
52
+ export {};
53
+ //# sourceMappingURL=Screen.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Screen.d.ts","sourceRoot":"","sources":["../../src/agents/Screen.tsx"],"names":[],"mappings":"AAEA;;;;;;;;;;;;;;;;;;;GAmBG;AACH,OAAO,EAAuB,MAAM,EAAE,MAAM,YAAY,CAAA;AACxD,OAAO,EAA4C,KAAK,cAAc,EAAE,KAAK,SAAS,EAAE,MAAM,OAAO,CAAA;AAIrG,KAAK,GAAG,GAAG,IAAI,CAAC,cAAc,CAAC,OAAO,MAAM,CAAC,EAAE,UAAU,CAAC,CAAA;AAE1D,iEAAiE;AACjE,MAAM,WAAW,MAAM;IACrB,uEAAuE;IACvE,GAAG,EAAE,MAAM,CAAA;IACX,yEAAyE;IACzE,SAAS,CAAC,EAAE,MAAM,CAAA;CACnB;AAED,kEAAkE;AAClE,MAAM,MAAM,UAAU,GAAG,SAAS,GAAG,SAAS,CAAA;AAO9C,MAAM,WAAW,WAAY,SAAQ,GAAG;IACtC,mDAAmD;IACnD,SAAS,EAAE,MAAM,CAAA;IACjB;;;;OAIG;IACH,IAAI,CAAC,EAAE,UAAU,GAAG,IAAI,CAAA;IACxB;;;OAGG;IACH,IAAI,CAAC,EAAE,CAAC,SAAS,EAAE,MAAM,KAAK,OAAO,CAAC,MAAM,CAAC,CAAA;IAC7C,iCAAiC;IACjC,KAAK,CAAC,EAAE,SAAS,CAAA;IACjB,KAAK,CAAC,EAAE,MAAM,CAAA;CACf;AAWD,wBAAgB,MAAM,CAAC,EAAE,SAAS,EAAE,IAAI,EAAE,IAAI,EAAE,KAAK,EAAE,KAAK,EAAE,GAAG,IAAI,EAAE,EAAE,WAAW,2CA2GnF"}
@@ -0,0 +1,89 @@
1
+ 'use client';
2
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
3
+ /**
4
+ * Screen — watching a run while it works.
5
+ *
6
+ * Some runs have something to look at: a sandbox serving an interactive page, a
7
+ * headful browser a person can watch over VNC. Most have nothing, and this
8
+ * component's first job is to say which it is, honestly — a viewer that draws a
9
+ * black rectangle for a run with no screen has told the reader the run is
10
+ * broken.
11
+ *
12
+ * THE CREDENTIAL NEVER OUTLIVES THE VIEW. A watchable surface is authorized by
13
+ * a short-lived TICKET the caller mints per view; this component asks for one
14
+ * when it mounts, embeds the page the ticket names, and asks for another if the
15
+ * viewer stays past its life. It does NOT take a URL with a long-lived token in
16
+ * it, and there is no prop to pass one — an embed URL ends up in browser
17
+ * history, in a screenshot, and in whatever the parent frame can read.
18
+ *
19
+ * The mint is a PROP, not an import, because who may watch is the surface's
20
+ * question and the answer lives in `@hanzo/ai` on one deployment and behind a
21
+ * BFF on another. This file owns the frame, the states and the refresh.
22
+ */
23
+ import { SizableText, XStack, YStack } from '@hanzo/gui';
24
+ import { useCallback, useEffect, useRef, useState } from 'react';
25
+ import { slot } from '../backends/gui/slot.js';
26
+ const NAMES = {
27
+ sandbox: 'sandbox',
28
+ browser: 'browser',
29
+ };
30
+ /** Re-mint at 80% of a ticket's life — early enough that the frame never blinks. */
31
+ const EARLY = 0.8;
32
+ export function Screen({ sessionId, kind, mint, empty, title, ...rest }) {
33
+ const [state, setState] = useState({ phase: 'idle' });
34
+ const timer = useRef(null);
35
+ const live = useRef(true);
36
+ const open = useCallback(async () => {
37
+ if (!mint || !kind)
38
+ return;
39
+ setState({ phase: 'minting' });
40
+ try {
41
+ const ticket = await mint(sessionId);
42
+ if (!live.current)
43
+ return;
44
+ setState({ phase: 'watching', url: ticket.url });
45
+ if (ticket.expiresIn && ticket.expiresIn > 0) {
46
+ if (timer.current)
47
+ clearTimeout(timer.current);
48
+ timer.current = setTimeout(() => void open(), ticket.expiresIn * 1000 * EARLY);
49
+ }
50
+ }
51
+ catch (err) {
52
+ if (!live.current)
53
+ return;
54
+ setState({
55
+ phase: 'failed',
56
+ message: err instanceof Error ? err.message : 'Could not open this screen.',
57
+ });
58
+ }
59
+ }, [mint, kind, sessionId]);
60
+ useEffect(() => {
61
+ live.current = true;
62
+ void open();
63
+ return () => {
64
+ live.current = false;
65
+ if (timer.current)
66
+ clearTimeout(timer.current);
67
+ };
68
+ }, [open]);
69
+ if (!kind) {
70
+ return (_jsx(Frame, { title: title, ...rest, children: empty ?? (_jsx(SizableText, { size: "$2", color: "$soft", children: "This run has no screen." })) }));
71
+ }
72
+ if (!mint) {
73
+ return (_jsx(Frame, { title: title, ...rest, children: _jsx(SizableText, { size: "$2", color: "$soft", children: "Watching is not wired up on this surface." }) }));
74
+ }
75
+ if (state.phase === 'failed') {
76
+ return (_jsx(Frame, { title: title, ...rest, children: _jsxs(YStack, { gap: "$2", items: "center", children: [_jsx(SizableText, { size: "$2", color: "$soft", children: state.message }), _jsx(SizableText, { size: "$2", color: "$color", cursor: "pointer", role: "button", tabIndex: 0, onPress: () => void open(), children: "Try again" })] }) }));
77
+ }
78
+ if (state.phase !== 'watching') {
79
+ return (_jsx(Frame, { title: title, ...rest, children: _jsxs(SizableText, { size: "$2", color: "$soft", children: ["Opening the ", NAMES[kind], "\u2026"] }) }));
80
+ }
81
+ return (_jsxs(YStack, { ...slot('screen'), flex: 1, minH: 0, bg: "$panel", rounded: "$4", overflow: "hidden", ...rest, children: [title ? _jsx(Caption, { children: title }) : null, _jsx("iframe", { src: state.url, title: title ?? `Live ${NAMES[kind]}`, sandbox: "allow-scripts allow-same-origin allow-forms", referrerPolicy: "no-referrer", allow: "clipboard-read; clipboard-write", style: { border: 0, width: '100%', height: '100%', flex: 1, display: 'block' } })] }));
82
+ }
83
+ function Caption({ children }) {
84
+ return (_jsx(XStack, { px: "$3", py: "$2", borderBottomWidth: 1, borderColor: "$borderColor", children: _jsx(SizableText, { size: "$1", color: "$soft", numberOfLines: 1, children: children }) }));
85
+ }
86
+ function Frame({ title, children, ...rest }) {
87
+ return (_jsxs(YStack, { ...slot('screen'), flex: 1, minH: 0, bg: "$panel", rounded: "$4", overflow: "hidden", ...rest, children: [title ? _jsx(Caption, { children: title }) : null, _jsx(YStack, { flex: 1, items: "center", justify: "center", p: "$4", children: children })] }));
88
+ }
89
+ //# sourceMappingURL=Screen.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Screen.js","sourceRoot":"","sources":["../../src/agents/Screen.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAA;;AAEZ;;;;;;;;;;;;;;;;;;;GAmBG;AACH,OAAO,EAAE,WAAW,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,YAAY,CAAA;AACxD,OAAO,EAAE,WAAW,EAAE,SAAS,EAAE,MAAM,EAAE,QAAQ,EAAuC,MAAM,OAAO,CAAA;AAErG,OAAO,EAAE,IAAI,EAAE,MAAM,sBAAsB,CAAA;AAe3C,MAAM,KAAK,GAA+B;IACxC,OAAO,EAAE,SAAS;IAClB,OAAO,EAAE,SAAS;CACnB,CAAA;AA2BD,oFAAoF;AACpF,MAAM,KA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AAW,EAAC,cAAc,YACtE,KAAC,WAAW,IAAC,IAAI,EAAC,IAAI,EAAC,KAAK,EAAC,OAAO,EAAC,aAAa,EAAE,CAAC,YAClD,QAAQ,GACG,GACP,CACV,CAAA;AACH,CAAC;AAED,SAAS,KAAK,CAAC,EAAE,KAAK,EAAE,QAAQ,EAAE,GAAG,IAAI,EAAiD;IACxF,OAAO,CACL,MAAC,MAAM,OAAK,IAAI,CAAC,QAAQ,CAAC,EAAE,IAAI,EAAE,CAAC,EAAE,IAAI,EAAE,CAAC,EAAE,EAAE,EAAC,QAAQ,EAAC,OAAO,EAAC,IAAI,EAAC,QAAQ,EAAC,QAAQ,KAAK,IAAI,aAC9F,KAAK,CAAC,CAAC,CAAC,KAAC,OAAO,cAAE,KAAK,GAAW,CAAC,CAAC,CAAC,IAAI,EAC1C,KAAC,MAAM,IAAC,IAAI,EAAE,CAAC,EAAE,KAAK,EAAC,QAAQ,EAAC,OAAO,EAAC,QAAQ,EAAC,CAAC,EAAC,IAAI,YACpD,QAAQ,GACF,IACF,CACV,CAAA;AACH,CAAC"}
@@ -0,0 +1,42 @@
1
+ 'use client';"use strict";
2
+ 'use client';
3
+ Object.defineProperty(exports, "__esModule", { value: true });
4
+ exports.Steer = Steer;
5
+ exports.MemberRow = MemberRow;
6
+ const jsx_runtime_1 = require("react/jsx-runtime");
7
+ /**
8
+ * Steer — the controls that reach a run mid-flight, and the roster row.
9
+ *
10
+ * A command is QUEUED, not applied: an agent reads it between turns, so the
11
+ * label a person sees after pressing has to say that. A control that reports
12
+ * "stopped" the instant it is pressed is lying for however long the current
13
+ * turn takes.
14
+ *
15
+ * Presentational: the verbs go out through `onCommand` and the surface decides
16
+ * what they mean. `@hanzo/ai`'s `sessions.steer(id, command)` is the one it
17
+ * wants, but this row does not import it — a channel workspace steering through
18
+ * a BFF composes the same control.
19
+ */
20
+ const gui_1 = require("@hanzo/gui");
21
+ const lucide_icons_2_1 = require("@hanzogui/lucide-icons-2");
22
+ const slot_1 = require("../backends/gui/slot.cjs");
23
+ const CONTROLS = [
24
+ { command: 'pause', label: 'Pause', icon: lucide_icons_2_1.Pause },
25
+ { command: 'resume', label: 'Resume', icon: lucide_icons_2_1.Play },
26
+ { command: 'stop', label: 'Stop', icon: lucide_icons_2_1.Square },
27
+ ];
28
+ function Steer({ onCommand, withhold = [], note, ...rest }) {
29
+ return ((0, jsx_runtime_1.jsxs)(gui_1.YStack, { ...(0, slot_1.slot)('steer'), gap: "$1", children: [(0, jsx_runtime_1.jsx)(gui_1.XStack, { gap: "$1", items: "center", ...rest, children: CONTROLS.map(({ command, label, icon: Icon }) => {
30
+ const off = withhold.includes(command);
31
+ return ((0, jsx_runtime_1.jsxs)(gui_1.XStack, { items: "center", gap: "$1.5", px: "$2", py: "$1", rounded: "$3", opacity: off ? 0.4 : 0.8, cursor: off ? 'default' : 'pointer', role: "button", tabIndex: off ? -1 : 0, "aria-disabled": off, "aria-label": label, ...(0, slot_1.tip)(label), hoverStyle: off ? undefined : { bg: '$hover', opacity: 1 }, pressStyle: off ? undefined : { bg: '$raised' }, onPress: () => !off && onCommand?.(command), children: [(0, jsx_runtime_1.jsx)(Icon, { size: 13 }), (0, jsx_runtime_1.jsx)(gui_1.SizableText, { size: "$1", children: label })] }, command));
32
+ }) }), note ? ((0, jsx_runtime_1.jsx)(gui_1.SizableText, { size: "$1", color: "$soft", children: note })) : null] }));
33
+ }
34
+ const KIND = {
35
+ agent: { icon: lucide_icons_2_1.Zap, says: 'agent' },
36
+ bot: { icon: lucide_icons_2_1.Bot, says: 'always on' },
37
+ human: { icon: lucide_icons_2_1.User, says: 'person' },
38
+ };
39
+ function MemberRow({ name, kind, detail, onPress, ...rest }) {
40
+ const { icon: Icon, says } = KIND[kind];
41
+ return ((0, jsx_runtime_1.jsxs)(gui_1.XStack, { ...(0, slot_1.slot)('member-row'), items: "center", gap: "$2", px: "$2", py: "$1.5", rounded: "$3", cursor: onPress ? 'pointer' : 'default', role: onPress ? 'button' : undefined, tabIndex: onPress ? 0 : undefined, hoverStyle: onPress ? { bg: '$hover' } : undefined, onPress: onPress, ...rest, children: [(0, jsx_runtime_1.jsx)(gui_1.XStack, { width: 22, height: 22, rounded: 9999, items: "center", justify: "center", bg: "$raised", shrink: 0, children: (0, jsx_runtime_1.jsx)(Icon, { size: 12 }) }), (0, jsx_runtime_1.jsxs)(gui_1.YStack, { flex: 1, shrink: 1, children: [(0, jsx_runtime_1.jsx)(gui_1.SizableText, { size: "$2", numberOfLines: 1, children: name }), detail ? ((0, jsx_runtime_1.jsx)(gui_1.SizableText, { size: "$1", color: "$soft", numberOfLines: 1, children: detail })) : null] }), (0, jsx_runtime_1.jsx)(gui_1.SizableText, { size: "$1", color: "$color8", children: says })] }));
42
+ }
@@ -0,0 +1,54 @@
1
+ /**
2
+ * Steer — the controls that reach a run mid-flight, and the roster row.
3
+ *
4
+ * A command is QUEUED, not applied: an agent reads it between turns, so the
5
+ * label a person sees after pressing has to say that. A control that reports
6
+ * "stopped" the instant it is pressed is lying for however long the current
7
+ * turn takes.
8
+ *
9
+ * Presentational: the verbs go out through `onCommand` and the surface decides
10
+ * what they mean. `@hanzo/ai`'s `sessions.steer(id, command)` is the one it
11
+ * wants, but this row does not import it — a channel workspace steering through
12
+ * a BFF composes the same control.
13
+ */
14
+ import { XStack } from '@hanzo/gui';
15
+ import type { ComponentProps, ReactNode } from 'react';
16
+ type Row = Omit<ComponentProps<typeof XStack>, 'children'>;
17
+ /** The verbs a run understands. `message` is the composer's, not a button's. */
18
+ export type Command = 'pause' | 'resume' | 'stop';
19
+ export interface SteerProps extends Row {
20
+ onCommand?: (command: Command) => void;
21
+ /**
22
+ * Verbs to withhold — a finished run cannot be paused.
23
+ *
24
+ * NOT `disabled`: that is gui's own boolean on the underlying stack, and
25
+ * taking the name means the row and the primitive disagree about the type of
26
+ * one prop.
27
+ */
28
+ withhold?: Command[];
29
+ /** The last thing that happened, in the surface's words. */
30
+ note?: ReactNode;
31
+ }
32
+ export declare function Steer({ onCommand, withhold, note, ...rest }: SteerProps): import("react/jsx-runtime").JSX.Element;
33
+ /**
34
+ * The three kinds of member, and why one row draws all three.
35
+ *
36
+ * An AGENT is summoned and lives for a session. A BOT is the same thing left
37
+ * running — it is present before anyone asks and after everyone leaves, which
38
+ * is the whole difference and the only one a reader needs. A HUMAN is a person.
39
+ *
40
+ * One component with a `kind` prop rather than three, because the three differ
41
+ * in a badge and an icon; three components is how the hover state comes to
42
+ * differ too.
43
+ */
44
+ export type MemberKind = 'agent' | 'bot' | 'human';
45
+ export interface MemberRowProps extends Row {
46
+ name: string;
47
+ kind: MemberKind;
48
+ /** A line under the name — what it does, or where it is. */
49
+ detail?: string;
50
+ onPress?: () => void;
51
+ }
52
+ export declare function MemberRow({ name, kind, detail, onPress, ...rest }: MemberRowProps): import("react/jsx-runtime").JSX.Element;
53
+ export {};
54
+ //# sourceMappingURL=Steer.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Steer.d.ts","sourceRoot":"","sources":["../../src/agents/Steer.tsx"],"names":[],"mappings":"AAEA;;;;;;;;;;;;GAYG;AACH,OAAO,EAAe,MAAM,EAAU,MAAM,YAAY,CAAA;AAExD,OAAO,KAAK,EAAE,cAAc,EAAE,SAAS,EAAE,MAAM,OAAO,CAAA;AAItD,KAAK,GAAG,GAAG,IAAI,CAAC,cAAc,CAAC,OAAO,MAAM,CAAC,EAAE,UAAU,CAAC,CAAA;AAE1D,gFAAgF;AAChF,MAAM,MAAM,OAAO,GAAG,OAAO,GAAG,QAAQ,GAAG,MAAM,CAAA;AAQjD,MAAM,WAAW,UAAW,SAAQ,GAAG;IACrC,SAAS,CAAC,EAAE,CAAC,OAAO,EAAE,OAAO,KAAK,IAAI,CAAA;IACtC;;;;;;OAMG;IACH,QAAQ,CAAC,EAAE,OAAO,EAAE,CAAA;IACpB,4DAA4D;IAC5D,IAAI,CAAC,EAAE,SAAS,CAAA;CACjB;AAED,wBAAgB,KAAK,CAAC,EAAE,SAAS,EAAE,QAAa,EAAE,IAAI,EAAE,GAAG,IAAI,EAAE,EAAE,UAAU,2CAsC5E;AAED;;;;;;;;;;GAUG;AACH,MAAM,MAAM,UAAU,GAAG,OAAO,GAAG,KAAK,GAAG,OAAO,CAAA;AAQlD,MAAM,WAAW,cAAe,SAAQ,GAAG;IACzC,IAAI,EAAE,MAAM,CAAA;IACZ,IAAI,EAAE,UAAU,CAAA;IAChB,4DAA4D;IAC5D,MAAM,CAAC,EAAE,MAAM,CAAA;IACf,OAAO,CAAC,EAAE,MAAM,IAAI,CAAA;CACrB;AAED,wBAAgB,SAAS,CAAC,EAAE,IAAI,EAAE,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,GAAG,IAAI,EAAE,EAAE,cAAc,2CA4CjF"}
@@ -0,0 +1,39 @@
1
+ 'use client';
2
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
3
+ /**
4
+ * Steer — the controls that reach a run mid-flight, and the roster row.
5
+ *
6
+ * A command is QUEUED, not applied: an agent reads it between turns, so the
7
+ * label a person sees after pressing has to say that. A control that reports
8
+ * "stopped" the instant it is pressed is lying for however long the current
9
+ * turn takes.
10
+ *
11
+ * Presentational: the verbs go out through `onCommand` and the surface decides
12
+ * what they mean. `@hanzo/ai`'s `sessions.steer(id, command)` is the one it
13
+ * wants, but this row does not import it — a channel workspace steering through
14
+ * a BFF composes the same control.
15
+ */
16
+ import { SizableText, XStack, YStack } from '@hanzo/gui';
17
+ import { Bot, Pause, Play, Square, User, Zap } from '@hanzogui/lucide-icons-2';
18
+ import { slot, tip } from '../backends/gui/slot.js';
19
+ const CONTROLS = [
20
+ { command: 'pause', label: 'Pause', icon: Pause },
21
+ { command: 'resume', label: 'Resume', icon: Play },
22
+ { command: 'stop', label: 'Stop', icon: Square },
23
+ ];
24
+ export function Steer({ onCommand, withhold = [], note, ...rest }) {
25
+ return (_jsxs(YStack, { ...slot('steer'), gap: "$1", children: [_jsx(XStack, { gap: "$1", items: "center", ...rest, children: CONTROLS.map(({ command, label, icon: Icon }) => {
26
+ const off = withhold.includes(command);
27
+ return (_jsxs(XStack, { items: "center", gap: "$1.5", px: "$2", py: "$1", rounded: "$3", opacity: off ? 0.4 : 0.8, cursor: off ? 'default' : 'pointer', role: "button", tabIndex: off ? -1 : 0, "aria-disabled": off, "aria-label": label, ...tip(label), hoverStyle: off ? undefined : { bg: '$hover', opacity: 1 }, pressStyle: off ? undefined : { bg: '$raised' }, onPress: () => !off && onCommand?.(command), children: [_jsx(Icon, { size: 13 }), _jsx(SizableText, { size: "$1", children: label })] }, command));
28
+ }) }), note ? (_jsx(SizableText, { size: "$1", color: "$soft", children: note })) : null] }));
29
+ }
30
+ const KIND = {
31
+ agent: { icon: Zap, says: 'agent' },
32
+ bot: { icon: Bot, says: 'always on' },
33
+ human: { icon: User, says: 'person' },
34
+ };
35
+ export function MemberRow({ name, kind, detail, onPress, ...rest }) {
36
+ const { icon: Icon, says } = KIND[kind];
37
+ return (_jsxs(XStack, { ...slot('member-row'), items: "center", gap: "$2", px: "$2", py: "$1.5", rounded: "$3", cursor: onPress ? 'pointer' : 'default', role: onPress ? 'button' : undefined, tabIndex: onPress ? 0 : undefined, hoverStyle: onPress ? { bg: '$hover' } : undefined, onPress: onPress, ...rest, children: [_jsx(XStack, { width: 22, height: 22, rounded: 9999, items: "center", justify: "center", bg: "$raised", shrink: 0, children: _jsx(Icon, { size: 12 }) }), _jsxs(YStack, { flex: 1, shrink: 1, children: [_jsx(SizableText, { size: "$2", numberOfLines: 1, children: name }), detail ? (_jsx(SizableText, { size: "$1", color: "$soft", numberOfLines: 1, children: detail })) : null] }), _jsx(SizableText, { size: "$1", color: "$color8", children: says })] }));
38
+ }
39
+ //# sourceMappingURL=Steer.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Steer.js","sourceRoot":"","sources":["../../src/agents/Steer.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAA;;AAEZ;;;;;;;;;;;;GAYG;AACH,OAAO,EAAE,WAAW,EAAE,MAAM,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';"use strict";
2
+ 'use client';
3
+ Object.defineProperty(exports, "__esModule", { value: true });
4
+ exports.fold = fold;
5
+ exports.Transcript = Transcript;
6
+ const jsx_runtime_1 = require("react/jsx-runtime");
7
+ /**
8
+ * Transcript — what a run has done, as blocks.
9
+ *
10
+ * A streamed answer arrives one TOKEN per event, so an unfolded transcript
11
+ * prints a sentence as a dozen mid-word cards each under its own actor line —
12
+ * measured at four parts label to one part text. `fold()` joins consecutive
13
+ * turns of the same kind and actor into one block with one label, and this
14
+ * component draws blocks. The folding is exported beside it because it is the
15
+ * same decision every surface has to make and it is pure.
16
+ *
17
+ * Presentational and total: an event whose payload is a shape nobody modelled
18
+ * still renders as its own text rather than as a gap.
19
+ */
20
+ const gui_1 = require("@hanzo/gui");
21
+ const react_1 = require("react");
22
+ const slot_1 = require("../backends/gui/slot.cjs");
23
+ /**
24
+ * Fold turns into blocks.
25
+ *
26
+ * Message tokens join with NOTHING, because each carries its own leading space
27
+ * and re-inserting one doubles it. Every other kind joins with a newline: two
28
+ * tool results are two facts, not one run-on sentence.
29
+ */
30
+ function fold(turns) {
31
+ const out = [];
32
+ turns.forEach((turn, i) => {
33
+ const kind = turn.kind ?? 'turn';
34
+ const last = out[out.length - 1];
35
+ if (last && last.kind === kind && last.actor === turn.actor)
36
+ last.parts.push(turn.text);
37
+ // Position is the fallback key and never a random one: a turn carrying
38
+ // neither seq nor id would otherwise be keyed differently on every render,
39
+ // so the list would grow a copy per paint.
40
+ else
41
+ out.push({ key: `${turn.seq ?? turn.id ?? i}`, kind, actor: turn.actor, parts: [turn.text] });
42
+ });
43
+ return out.map((b) => ({
44
+ key: b.key,
45
+ kind: b.kind,
46
+ actor: b.actor,
47
+ text: b.parts.join(b.kind === 'message' ? '' : '\n'),
48
+ }));
49
+ }
50
+ function Transcript({ blocks, follow = true, header, empty, ...rest }) {
51
+ const foot = (0, react_1.useRef)(null);
52
+ (0, react_1.useEffect)(() => {
53
+ if (follow)
54
+ foot.current?.scrollIntoView({ block: 'end' });
55
+ }, [blocks.length, follow]);
56
+ return ((0, jsx_runtime_1.jsx)(gui_1.ScrollView, { ...(0, slot_1.slot)('transcript'), flex: 1, showsVerticalScrollIndicator: false, ...rest, children: (0, jsx_runtime_1.jsxs)(gui_1.YStack, { gap: "$3", p: "$4", children: [header, !blocks.length
57
+ ? empty ?? ((0, jsx_runtime_1.jsx)(gui_1.SizableText, { size: "$2", color: "$soft", children: "Nothing yet." }))
58
+ : blocks.map((block) => ((0, jsx_runtime_1.jsxs)(gui_1.YStack, { gap: "$1", children: [(0, jsx_runtime_1.jsxs)(gui_1.XStack, { gap: "$2", items: "center", children: [(0, jsx_runtime_1.jsx)(gui_1.SizableText, { size: "$1", color: "$soft", children: block.actor ?? block.kind }), block.actor ? ((0, jsx_runtime_1.jsx)(gui_1.SizableText, { size: "$1", color: "$color8", children: block.kind })) : null] }), (0, jsx_runtime_1.jsx)(gui_1.SizableText, { size: "$2", color: "$quiet", children: block.text })] }, block.key))), (0, jsx_runtime_1.jsx)("div", { ref: foot })] }) }));
59
+ }
@@ -0,0 +1,50 @@
1
+ /**
2
+ * Transcript — what a run has done, as blocks.
3
+ *
4
+ * A streamed answer arrives one TOKEN per event, so an unfolded transcript
5
+ * prints a sentence as a dozen mid-word cards each under its own actor line —
6
+ * measured at four parts label to one part text. `fold()` joins consecutive
7
+ * turns of the same kind and actor into one block with one label, and this
8
+ * component draws blocks. The folding is exported beside it because it is the
9
+ * same decision every surface has to make and it is pure.
10
+ *
11
+ * Presentational and total: an event whose payload is a shape nobody modelled
12
+ * still renders as its own text rather than as a gap.
13
+ */
14
+ import { ScrollView } from '@hanzo/gui';
15
+ import { type ComponentProps, type ReactNode } from 'react';
16
+ type Scroll = Omit<ComponentProps<typeof ScrollView>, 'children'>;
17
+ /** The shape a transcript needs from an event. A superset is fine. */
18
+ export interface Turn {
19
+ kind?: string;
20
+ actor?: string;
21
+ seq?: number;
22
+ id?: string;
23
+ text: string;
24
+ }
25
+ /** One folded run of same-kind, same-actor turns. */
26
+ export interface Block {
27
+ key: string;
28
+ kind: string;
29
+ actor?: string;
30
+ text: string;
31
+ }
32
+ /**
33
+ * Fold turns into blocks.
34
+ *
35
+ * Message tokens join with NOTHING, because each carries its own leading space
36
+ * and re-inserting one doubles it. Every other kind joins with a newline: two
37
+ * tool results are two facts, not one run-on sentence.
38
+ */
39
+ export declare function fold(turns: Turn[]): Block[];
40
+ export interface TranscriptProps extends Scroll {
41
+ blocks: Block[];
42
+ /** Keep the newest turn in view as the run streams. */
43
+ follow?: boolean;
44
+ /** Drawn above the blocks — a status line, a turn count. */
45
+ header?: ReactNode;
46
+ empty?: ReactNode;
47
+ }
48
+ export declare function Transcript({ blocks, follow, header, empty, ...rest }: TranscriptProps): import("react/jsx-runtime").JSX.Element;
49
+ export {};
50
+ //# sourceMappingURL=Transcript.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Transcript.d.ts","sourceRoot":"","sources":["../../src/agents/Transcript.tsx"],"names":[],"mappings":"AAEA;;;;;;;;;;;;GAYG;AACH,OAAO,EAAE,UAAU,EAA+B,MAAM,YAAY,CAAA;AACpE,OAAO,EAAqB,KAAK,cAAc,EAAE,KAAK,SAAS,EAAE,MAAM,OAAO,CAAA;AAI9E,KAAK,MAAM,GAAG,IAAI,CAAC,cAAc,CAAC,OAAO,UAAU,CAAC,EAAE,UAAU,CAAC,CAAA;AAEjE,sEAAsE;AACtE,MAAM,WAAW,IAAI;IACnB,IAAI,CAAC,EAAE,MAAM,CAAA;IACb,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,GAAG,CAAC,EAAE,MAAM,CAAA;IACZ,EAAE,CAAC,EAAE,MAAM,CAAA;IACX,IAAI,EAAE,MAAM,CAAA;CACb;AAED,qDAAqD;AACrD,MAAM,WAAW,KAAK;IACpB,GAAG,EAAE,MAAM,CAAA;IACX,IAAI,EAAE,MAAM,CAAA;IACZ,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,IAAI,EAAE,MAAM,CAAA;CACb;AAED;;;;;;GAMG;AACH,wBAAgB,IAAI,CAAC,KAAK,EAAE,IAAI,EAAE,GAAG,KAAK,EAAE,CAiB3C;AAED,MAAM,WAAW,eAAgB,SAAQ,MAAM;IAC7C,MAAM,EAAE,KAAK,EAAE,CAAA;IACf,uDAAuD;IACvD,MAAM,CAAC,EAAE,OAAO,CAAA;IAChB,4DAA4D;IAC5D,MAAM,CAAC,EAAE,SAAS,CAAA;IAClB,KAAK,CAAC,EAAE,SAAS,CAAA;CAClB;AAED,wBAAgB,UAAU,CAAC,EAAE,MAAM,EAAE,MAAa,EAAE,MAAM,EAAE,KAAK,EAAE,GAAG,IAAI,EAAE,EAAE,eAAe,2CAsC5F"}
@@ -0,0 +1,56 @@
1
+ 'use client';
2
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
3
+ /**
4
+ * Transcript — what a run has done, as blocks.
5
+ *
6
+ * A streamed answer arrives one TOKEN per event, so an unfolded transcript
7
+ * prints a sentence as a dozen mid-word cards each under its own actor line —
8
+ * measured at four parts label to one part text. `fold()` joins consecutive
9
+ * turns of the same kind and actor into one block with one label, and this
10
+ * component draws blocks. The folding is exported beside it because it is the
11
+ * same decision every surface has to make and it is pure.
12
+ *
13
+ * Presentational and total: an event whose payload is a shape nobody modelled
14
+ * still renders as its own text rather than as a gap.
15
+ */
16
+ import { ScrollView, SizableText, XStack, YStack } from '@hanzo/gui';
17
+ import { useEffect, useRef } from 'react';
18
+ import { slot } from '../backends/gui/slot.js';
19
+ /**
20
+ * Fold turns into blocks.
21
+ *
22
+ * Message tokens join with NOTHING, because each carries its own leading space
23
+ * and re-inserting one doubles it. Every other kind joins with a newline: two
24
+ * tool results are two facts, not one run-on sentence.
25
+ */
26
+ export function fold(turns) {
27
+ const out = [];
28
+ turns.forEach((turn, i) => {
29
+ const kind = turn.kind ?? 'turn';
30
+ const last = out[out.length - 1];
31
+ if (last && last.kind === kind && last.actor === turn.actor)
32
+ last.parts.push(turn.text);
33
+ // Position is the fallback key and never a random one: a turn carrying
34
+ // neither seq nor id would otherwise be keyed differently on every render,
35
+ // so the list would grow a copy per paint.
36
+ else
37
+ out.push({ key: `${turn.seq ?? turn.id ?? i}`, kind, actor: turn.actor, parts: [turn.text] });
38
+ });
39
+ return out.map((b) => ({
40
+ key: b.key,
41
+ kind: b.kind,
42
+ actor: b.actor,
43
+ text: b.parts.join(b.kind === 'message' ? '' : '\n'),
44
+ }));
45
+ }
46
+ export function Transcript({ blocks, follow = true, header, empty, ...rest }) {
47
+ const foot = useRef(null);
48
+ useEffect(() => {
49
+ if (follow)
50
+ foot.current?.scrollIntoView({ block: 'end' });
51
+ }, [blocks.length, follow]);
52
+ return (_jsx(ScrollView, { ...slot('transcript'), flex: 1, showsVerticalScrollIndicator: false, ...rest, children: _jsxs(YStack, { gap: "$3", p: "$4", children: [header, !blocks.length
53
+ ? empty ?? (_jsx(SizableText, { size: "$2", color: "$soft", children: "Nothing yet." }))
54
+ : blocks.map((block) => (_jsxs(YStack, { gap: "$1", children: [_jsxs(XStack, { gap: "$2", items: "center", children: [_jsx(SizableText, { size: "$1", color: "$soft", children: block.actor ?? block.kind }), block.actor ? (_jsx(SizableText, { size: "$1", color: "$color8", children: block.kind })) : null] }), _jsx(SizableText, { size: "$2", color: "$quiet", children: block.text })] }, block.key))), _jsx("div", { ref: foot })] }) }));
55
+ }
56
+ //# sourceMappingURL=Transcript.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Transcript.js","sourceRoot":"","sources":["../../src/agents/Transcript.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAA;;AAEZ;;;;;;;;;;;;GAYG;AACH,OAAO,EAAE,UAAU,EAAE,WAAW,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,YAAY,CAAA;AACpE,OAAO,EAAE,SAAS,EAAE,MAAM,EAAuC,MAAM,OAAO,CAAA;AAE9E,OAAO,EAAE,IAAI,EAAE,MAAM,sBAAsB,CAAA;AAqB3C;;;;;;GAMG;AACH,MAA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,CAAA;AACH,CAAC"}
@@ -0,0 +1,36 @@
1
+ 'use client';"use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.Screen = exports.Steer = exports.MemberRow = exports.fold = exports.Transcript = exports.nest = exports.RunRow = exports.AgentBoard = void 0;
4
+ /**
5
+ * @hanzo/ui/agents — the agents working view, on @hanzo/gui primitives.
6
+ *
7
+ * `AgentBoard` shows what is running, grouped by project and nested by fan-out;
8
+ * `Transcript` shows what one run has done; `Steer` reaches a run mid-flight;
9
+ * `Screen` watches one that has something to look at; `MemberRow` draws an
10
+ * agent, a bot or a person with the kind legible.
11
+ *
12
+ * Props-in, callbacks-out — no transport, no store, no routing, and no import
13
+ * of `@hanzo/ai` anywhere in the module. The data belongs to the surface, which
14
+ * is what lets hanzo.ai, a channel workspace and the desktop compose the same
15
+ * five components over three different ways of fetching.
16
+ *
17
+ * The two pure helpers ship beside the components because both are decisions a
18
+ * surface would otherwise make differently each time: `nest` builds the tree a
19
+ * board draws from the flat list an API answers with, and `fold` joins a
20
+ * token-per-event stream into readable blocks.
21
+ *
22
+ * The composer is not here — a draft box is not agent-specific, so it stays at
23
+ * `@hanzo/ui/chat` and this module composes it.
24
+ */
25
+ var Board_1 = require("./Board.cjs");
26
+ Object.defineProperty(exports, "AgentBoard", { enumerable: true, get: function () { return Board_1.AgentBoard; } });
27
+ Object.defineProperty(exports, "RunRow", { enumerable: true, get: function () { return Board_1.RunRow; } });
28
+ Object.defineProperty(exports, "nest", { enumerable: true, get: function () { return Board_1.nest; } });
29
+ var Transcript_1 = require("./Transcript.cjs");
30
+ Object.defineProperty(exports, "Transcript", { enumerable: true, get: function () { return Transcript_1.Transcript; } });
31
+ Object.defineProperty(exports, "fold", { enumerable: true, get: function () { return Transcript_1.fold; } });
32
+ var Steer_1 = require("./Steer.cjs");
33
+ Object.defineProperty(exports, "MemberRow", { enumerable: true, get: function () { return Steer_1.MemberRow; } });
34
+ Object.defineProperty(exports, "Steer", { enumerable: true, get: function () { return Steer_1.Steer; } });
35
+ var Screen_1 = require("./Screen.cjs");
36
+ Object.defineProperty(exports, "Screen", { enumerable: true, get: function () { return Screen_1.Screen; } });
@@ -0,0 +1,26 @@
1
+ /**
2
+ * @hanzo/ui/agents — the agents working view, on @hanzo/gui primitives.
3
+ *
4
+ * `AgentBoard` shows what is running, grouped by project and nested by fan-out;
5
+ * `Transcript` shows what one run has done; `Steer` reaches a run mid-flight;
6
+ * `Screen` watches one that has something to look at; `MemberRow` draws an
7
+ * agent, a bot or a person with the kind legible.
8
+ *
9
+ * Props-in, callbacks-out — no transport, no store, no routing, and no import
10
+ * of `@hanzo/ai` anywhere in the module. The data belongs to the surface, which
11
+ * is what lets hanzo.ai, a channel workspace and the desktop compose the same
12
+ * five components over three different ways of fetching.
13
+ *
14
+ * The two pure helpers ship beside the components because both are decisions a
15
+ * surface would otherwise make differently each time: `nest` builds the tree a
16
+ * board draws from the flat list an API answers with, and `fold` joins a
17
+ * token-per-event stream into readable blocks.
18
+ *
19
+ * The composer is not here — a draft box is not agent-specific, so it stays at
20
+ * `@hanzo/ui/chat` and this module composes it.
21
+ */
22
+ export { AgentBoard, RunRow, nest, type AgentBoardProps, type Run, type RunRowProps, type RunStatus, } from './Board.js';
23
+ export { Transcript, fold, type Block, type TranscriptProps, type Turn } from './Transcript.js';
24
+ export { MemberRow, Steer, type Command, type MemberKind, type MemberRowProps, type SteerProps, } from './Steer.js';
25
+ export { Screen, type ScreenKind, type ScreenProps, type Ticket } from './Screen.js';
26
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/agents/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,OAAO,EACL,UAAU,EACV,MAAM,EACN,IAAI,EACJ,KAAK,eAAe,EACpB,KAAK,GAAG,EACR,KAAK,WAAW,EAChB,KAAK,SAAS,GACf,MAAM,SAAS,CAAA;AAEhB,OAAO,EAAE,UAAU,EAAE,IAAI,EAAE,KAAK,KAAK,EAAE,KAAK,eAAe,EAAE,KAAK,IAAI,EAAE,MAAM,cAAc,CAAA;AAE5F,OAAO,EACL,SAAS,EACT,KAAK,EACL,KAAK,OAAO,EACZ,KAAK,UAAU,EACf,KAAK,cAAc,EACnB,KAAK,UAAU,GAChB,MAAM,SAAS,CAAA;AAEhB,OAAO,EAAE,MAAM,EAAE,KAAK,UAAU,EAAE,KAAK,WAAW,EAAE,KAAK,MAAM,EAAE,MAAM,UAAU,CAAA"}
@@ -0,0 +1,26 @@
1
+ /**
2
+ * @hanzo/ui/agents — the agents working view, on @hanzo/gui primitives.
3
+ *
4
+ * `AgentBoard` shows what is running, grouped by project and nested by fan-out;
5
+ * `Transcript` shows what one run has done; `Steer` reaches a run mid-flight;
6
+ * `Screen` watches one that has something to look at; `MemberRow` draws an
7
+ * agent, a bot or a person with the kind legible.
8
+ *
9
+ * Props-in, callbacks-out — no transport, no store, no routing, and no import
10
+ * of `@hanzo/ai` anywhere in the module. The data belongs to the surface, which
11
+ * is what lets hanzo.ai, a channel workspace and the desktop compose the same
12
+ * five components over three different ways of fetching.
13
+ *
14
+ * The two pure helpers ship beside the components because both are decisions a
15
+ * surface would otherwise make differently each time: `nest` builds the tree a
16
+ * board draws from the flat list an API answers with, and `fold` joins a
17
+ * token-per-event stream into readable blocks.
18
+ *
19
+ * The composer is not here — a draft box is not agent-specific, so it stays at
20
+ * `@hanzo/ui/chat` and this module composes it.
21
+ */
22
+ export { AgentBoard, RunRow, nest, } from './Board.js';
23
+ export { Transcript, fold } from './Transcript.js';
24
+ export { MemberRow, Steer, } from './Steer.js';
25
+ export { Screen } from './Screen.js';
26
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/agents/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,OAAO,EACL,UAAU,EACV,MAAM,EACN,IAAI,GAKL,MAAM,SAAS,CAAA;AAEhB,OAAO,EAAE,UAAU,EAAE,IAAI,EAA+C,MAAM,cAAc,CAAA;AAE5F,OAAO,EACL,SAAS,EACT,KAAK,GAKN,MAAM,SAAS,CAAA;AAEhB,OAAO,EAAE,MAAM,EAAkD,MAAM,UAAU,CAAA"}
package/dist/box.cjs CHANGED
@@ -39,6 +39,25 @@ const jsx_runtime_1 = require("react/jsx-runtime");
39
39
  const react_1 = require("react");
40
40
  const gui_1 = require("@hanzo/gui");
41
41
  const tw_1 = require("./tw.cjs");
42
+ const gui_config_1 = require("./gui-config.cjs");
43
+ /**
44
+ * The process-global gui config, named as a VALUE so it survives bundling.
45
+ *
46
+ * A rendered gui component resolves `$background` and friends against one
47
+ * config, and it is `gui-config.ts` calling `createGui` at module scope that
48
+ * installs it. `<Hanzo>` names it too — but an app that imports only `Box`
49
+ * never loads `<Hanzo>`, so nothing installed it and the first render throws
50
+ *
51
+ * Error: Err0
52
+ *
53
+ * which in production is the whole message. A bare `import './gui-config.cjs'`
54
+ * does not fix it: Vite 8 ignores a package.json `sideEffects` ARRAY, so the
55
+ * side-effect-only import is shaken out. A value the module references cannot
56
+ * be. Measured on zoo.industries, where 58 files render Box and none mount
57
+ * Hanzo directly.
58
+ */
59
+ if (!gui_config_1.config)
60
+ throw new Error('@hanzo/ui: the gui config did not install');
42
61
  /**
43
62
  * The display each element has before any class touches it.
44
63
  *
package/dist/box.d.ts.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"box.d.ts","sourceRoot":"","sources":["../src/box.tsx"],"names":[],"mappings":"AAEA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAgCG;AACH,OAAO,EAA6B,KAAK,SAAS,EAAE,MAAM,OAAO,CAAA;AACjE,OAAO,EAAE,MAAM,EAAE,MAAM,YAAY,CAAA;AACnC,OAAO,EAAM,KAAK,UAAU,EAAE,MAAM,MAAM,CAAA;AA+C1C;;;;;;;;;GASG;AACH,MAAM,MAAM,QAAQ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AAwEH;;;;;;;GAOG;AACH,eAAO,MAAM,GAAG,EAAe,CAAC,CAAC,SAAS,MAAM,KAAK,CAAC,GAAG,CAAC,iBAAiB,GAAG,KAAK,EACjF,KAAK,EAAE,QAAQ,CAAC,CAAC,CAAC,GAAG;IAAE,GAAG,CAAC,EAAE,KAAK,CAAC,GAAG,CAAC,GAAG,CAAC,CAAA;CAAE,KAC1C,KAAK,CAAC,YAAY,GAAG,IAAI,CAAA;eAEf,GAAG"}
package/dist/box.js CHANGED
@@ -36,6 +36,25 @@ import { jsx as _jsx } from "react/jsx-runtime";
36
36
  import { createElement, forwardRef } from 'react';
37
37
  import { YStack } from '@hanzo/gui';
38
38
  import { tw } from './tw.js';
39
+ import { config } from './gui-config.js';
40
+ /**
41
+ * The process-global gui config, named as a VALUE so it survives bundling.
42
+ *
43
+ * A rendered gui component resolves `$background` and friends against one
44
+ * config, and it is `gui-config.ts` calling `createGui` at module scope that
45
+ * installs it. `<Hanzo>` names it too — but an app that imports only `Box`
46
+ * never loads `<Hanzo>`, so nothing installed it and the first render throws
47
+ *
48
+ * Error: Err0
49
+ *
50
+ * which in production is the whole message. A bare `import './gui-config.js'`
51
+ * does not fix it: Vite 8 ignores a package.json `sideEffects` ARRAY, so the
52
+ * side-effect-only import is shaken out. A value the module references cannot
53
+ * be. Measured on zoo.industries, where 58 files render Box and none mount
54
+ * Hanzo directly.
55
+ */
56
+ if (!config)
57
+ throw new Error('@hanzo/ui: the gui config did not install');
39
58
  /**
40
59
  * The display each element has before any class touches it.
41
60
  *
package/dist/box.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"box.js","sourceRoot":"","sources":["../src/box.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAA;;AAEZ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAgCG;AACH,OAAO,EAAE,aAAa,EAAE,UAAU,EAAkB,MAAM,OAAO,CAAA;AACjE,OAAO,EAAE,MAAM,EAAE,MAAM,YAAY,CAAA;AACnC,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@
1
- <!doctype html><html lang="en" class="t_dark"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width,initial-scale=1"><title>@hanzo/ui 8.14.0</title><style>/* @hanzo/ui — generated by scripts/gen-css.mjs. Do not edit. */
1
+ <!doctype html><html lang="en" class="t_dark"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width,initial-scale=1"><title>@hanzo/ui 8.14.1</title><style>/* @hanzo/ui — generated by scripts/gen-css.mjs. Do not edit. */
2
2
  :root { --hanzo-ui-styles: 1; }
3
3
  /* Hanzo Design System — the entry point. Import THIS one file.
4
4
  *
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@hanzo/ui",
3
- "version": "8.14.0",
3
+ "version": "8.14.1",
4
4
  "type": "module",
5
5
  "description": "Hanzo UI — the one canonical Hanzo component library, on @hanzo/gui + @hanzo/design. ONE substrate: every component renders through @hanzo/gui primitives, so the same import works on web, native (expo) and desktop (Tauri). Self-contained (theme.css), presentational, host-agnostic, clean-room.",
6
6
  "exports": {
@@ -207,7 +207,13 @@
207
207
  "require": "./dist/types.cjs",
208
208
  "default": "./dist/types.js"
209
209
  },
210
- "./next": "./dist/next.cjs"
210
+ "./next": "./dist/next.cjs",
211
+ "./agents": {
212
+ "types": "./dist/agents/index.d.ts",
213
+ "import": "./dist/agents/index.js",
214
+ "require": "./dist/agents/index.cjs",
215
+ "default": "./dist/agents/index.js"
216
+ }
211
217
  },
212
218
  "main": "./dist/index.cjs",
213
219
  "module": "./dist/index.js",