@hanzo/ui 8.14.0 → 8.14.2

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.
Files changed (53) hide show
  1. package/dist/agents/Board.cjs +119 -0
  2. package/dist/agents/Board.d.ts +98 -0
  3. package/dist/agents/Board.d.ts.map +1 -0
  4. package/dist/agents/Board.js +115 -0
  5. package/dist/agents/Board.js.map +1 -0
  6. package/dist/agents/Pane.cjs +74 -0
  7. package/dist/agents/Pane.d.ts +84 -0
  8. package/dist/agents/Pane.d.ts.map +1 -0
  9. package/dist/agents/Pane.js +68 -0
  10. package/dist/agents/Pane.js.map +1 -0
  11. package/dist/agents/Progress.cjs +130 -0
  12. package/dist/agents/Progress.d.ts +67 -0
  13. package/dist/agents/Progress.d.ts.map +1 -0
  14. package/dist/agents/Progress.js +127 -0
  15. package/dist/agents/Progress.js.map +1 -0
  16. package/dist/agents/Screen.cjs +91 -0
  17. package/dist/agents/Screen.d.ts +53 -0
  18. package/dist/agents/Screen.d.ts.map +1 -0
  19. package/dist/agents/Screen.js +89 -0
  20. package/dist/agents/Screen.js.map +1 -0
  21. package/dist/agents/Steer.cjs +42 -0
  22. package/dist/agents/Steer.d.ts +54 -0
  23. package/dist/agents/Steer.d.ts.map +1 -0
  24. package/dist/agents/Steer.js +39 -0
  25. package/dist/agents/Steer.js.map +1 -0
  26. package/dist/agents/Transcript.cjs +59 -0
  27. package/dist/agents/Transcript.d.ts +50 -0
  28. package/dist/agents/Transcript.d.ts.map +1 -0
  29. package/dist/agents/Transcript.js +56 -0
  30. package/dist/agents/Transcript.js.map +1 -0
  31. package/dist/agents/index.cjs +45 -0
  32. package/dist/agents/index.d.ts +28 -0
  33. package/dist/agents/index.d.ts.map +1 -0
  34. package/dist/agents/index.js +28 -0
  35. package/dist/agents/index.js.map +1 -0
  36. package/dist/box.cjs +19 -0
  37. package/dist/box.d.ts.map +1 -1
  38. package/dist/box.js +19 -0
  39. package/dist/box.js.map +1 -1
  40. package/dist/css.cjs +17 -0
  41. package/dist/css.d.ts +30 -0
  42. package/dist/css.d.ts.map +1 -0
  43. package/dist/css.js +14 -0
  44. package/dist/css.js.map +1 -0
  45. package/dist/gallery.html +1 -1
  46. package/dist/index.cjs +3 -1
  47. package/dist/index.d.ts +1 -0
  48. package/dist/index.d.ts.map +1 -1
  49. package/dist/index.js +1 -0
  50. package/dist/index.js.map +1 -1
  51. package/dist/index.node.js +1 -0
  52. package/dist/next.cjs +6 -0
  53. package/package.json +8 -2
@@ -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,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,IAAI,EACR,EAAE,eAAe,2CA+BjB;AAgBD;;;;;;;GAOG;AACH,wBAAgB,IAAI,CAAC,CAAC,SAAS;IAAE,EAAE,EAAE,MAAM,CAAC;IAAC,MAAM,CAAC,EAAE,MAAM,CAAA;CAAE,EAC5D,IAAI,EAAE,CAAC,EAAE,GACR,CAAC,CAAC,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,EA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AE,EAAE,EAAE,GAAG,GAAG,EAAE,QAAQ,EAAE,EAAE,EAAE,CAAC,CAAA;IAEtE,OAAO,CAAC,GAAG,KAAK,CAAC,MAAM,EAAE,CAAC,CAAA;AAC5B,CAAC"}
@@ -0,0 +1,74 @@
1
+ 'use client';"use strict";
2
+ 'use client';
3
+ Object.defineProperty(exports, "__esModule", { value: true });
4
+ exports.ChannelHeader = ChannelHeader;
5
+ exports.ArtifactCard = ArtifactCard;
6
+ exports.SystemLine = SystemLine;
7
+ exports.Pane = Pane;
8
+ exports.OrgRail = OrgRail;
9
+ const jsx_runtime_1 = require("react/jsx-runtime");
10
+ /**
11
+ * The channel's furniture: the header, the artifact card, the system line, the
12
+ * right-hand pane, and the org rail the whole shell hangs off.
13
+ *
14
+ * Each is presentational and takes its content. Together they are the working
15
+ * view: a channel names the work and counts what came out of it, the thread
16
+ * carries the conversation and the things produced, and the pane is where a
17
+ * produced thing is actually looked at.
18
+ */
19
+ const gui_1 = require("@hanzo/gui");
20
+ const lucide_icons_2_1 = require("@hanzogui/lucide-icons-2");
21
+ const react_1 = require("react");
22
+ const slot_1 = require("../backends/gui/slot.cjs");
23
+ function ChannelHeader({ name, artifacts, onArtifacts, children, ...rest }) {
24
+ return ((0, jsx_runtime_1.jsxs)(gui_1.XStack, { ...(0, slot_1.slot)('channel-header'), items: "center", gap: "$2", px: "$4", py: "$3", borderBottomWidth: 1, borderColor: "$borderColor", ...rest, children: [(0, jsx_runtime_1.jsx)(gui_1.XStack, { width: 26, height: 26, rounded: "$3", items: "center", justify: "center", bg: "$raised", shrink: 0, children: (0, jsx_runtime_1.jsx)(lucide_icons_2_1.Code2, { size: 13, opacity: 0.8 }) }), (0, jsx_runtime_1.jsx)(gui_1.SizableText, { size: "$5", fontWeight: "600", numberOfLines: 1, shrink: 1, children: name }), (0, jsx_runtime_1.jsx)(gui_1.XStack, { flex: 1 }), artifacts === undefined ? null : ((0, jsx_runtime_1.jsxs)(gui_1.XStack, { items: "center", gap: "$2", px: "$2.5", py: "$1", rounded: "$4", borderWidth: 1, borderColor: "$borderColor", cursor: onArtifacts ? 'pointer' : 'default', role: onArtifacts ? 'button' : undefined, tabIndex: onArtifacts ? 0 : undefined, hoverStyle: onArtifacts ? { bg: '$hover' } : undefined, onPress: onArtifacts, children: [(0, jsx_runtime_1.jsx)(gui_1.SizableText, { size: "$2", color: "$quiet", children: "Artifacts" }), (0, jsx_runtime_1.jsx)(gui_1.XStack, { minW: 18, height: 18, px: "$1", rounded: 9999, items: "center", justify: "center", bg: "$edge", children: (0, jsx_runtime_1.jsx)(gui_1.SizableText, { size: "$1", fontWeight: "600", children: artifacts }) })] })), children] }));
25
+ }
26
+ const ART = {
27
+ canvas: { icon: lucide_icons_2_1.FileText, says: 'Canvas' },
28
+ code: { icon: lucide_icons_2_1.Code2, says: 'Code' },
29
+ view: { icon: lucide_icons_2_1.Eye, says: 'View' },
30
+ };
31
+ /** A thing the agent made, offered in the thread. Opening it fills the pane. */
32
+ function ArtifactCard({ title, kind, onOpen, ...rest }) {
33
+ const { icon: Icon, says } = ART[kind];
34
+ return ((0, jsx_runtime_1.jsxs)(gui_1.XStack, { ...(0, slot_1.slot)('artifact-card'), items: "center", gap: "$3", p: "$3", rounded: "$4", borderWidth: 1, borderColor: "$borderColor", bg: "$panel", maxW: 420, cursor: onOpen ? 'pointer' : 'default', role: onOpen ? 'button' : undefined, tabIndex: onOpen ? 0 : undefined, hoverStyle: onOpen ? { bg: '$hover' } : undefined, onPress: onOpen, ...rest, children: [(0, jsx_runtime_1.jsx)(gui_1.XStack, { width: 34, height: 34, rounded: "$3", items: "center", justify: "center", bg: "$edge", shrink: 0, children: (0, jsx_runtime_1.jsx)(Icon, { size: 16 }) }), (0, jsx_runtime_1.jsxs)(gui_1.YStack, { flex: 1, shrink: 1, children: [(0, jsx_runtime_1.jsx)(gui_1.SizableText, { size: "$3", fontWeight: "600", numberOfLines: 1, children: title }), (0, jsx_runtime_1.jsx)(gui_1.SizableText, { size: "$2", color: "$soft", children: says })] })] }));
35
+ }
36
+ /** Something that happened TO the channel, not something anyone said. */
37
+ function SystemLine({ children, avatar, ...rest }) {
38
+ return ((0, jsx_runtime_1.jsxs)(gui_1.XStack, { ...(0, slot_1.slot)('system-line'), items: "flex-start", gap: "$3", ...rest, children: [avatar ?? (0, jsx_runtime_1.jsx)(gui_1.YStack, { width: 28, shrink: 0 }), (0, jsx_runtime_1.jsx)(gui_1.SizableText, { size: "$2", color: "$soft", flex: 1, children: children })] }));
39
+ }
40
+ /**
41
+ * The right-hand pane — Code, View, Canvas.
42
+ *
43
+ * Uncontrolled until `active` is supplied, so the common case needs no state
44
+ * while a surface that routes to a tab can drive it.
45
+ */
46
+ function Pane({ tabs, active, onActive, onClose, ...rest }) {
47
+ const [own, setOwn] = (0, react_1.useState)(tabs[0]?.id);
48
+ const current = active ?? own;
49
+ const shown = tabs.find((t) => t.id === current) ?? tabs[0];
50
+ return ((0, jsx_runtime_1.jsxs)(gui_1.YStack, { ...(0, slot_1.slot)('pane'), flex: 1, minH: 0, bg: "$panel", rounded: "$4", borderWidth: 1, borderColor: "$borderColor", overflow: "hidden", ...rest, children: [(0, jsx_runtime_1.jsxs)(gui_1.XStack, { items: "center", gap: "$1", px: "$2", py: "$2", borderBottomWidth: 1, borderColor: "$borderColor", children: [tabs.map((tab) => {
51
+ const on = tab.id === shown?.id;
52
+ const Icon = ART[tab.kind].icon;
53
+ return ((0, jsx_runtime_1.jsxs)(gui_1.XStack, { items: "center", gap: "$1.5", px: "$2.5", py: "$1.5", rounded: "$3", cursor: "pointer", role: "tab", tabIndex: 0, "aria-selected": on, opacity: on ? 1 : 0.6, bg: on ? '$edge' : undefined, hoverStyle: { bg: on ? '$edge' : '$hover', opacity: 1 }, onPress: () => {
54
+ setOwn(tab.id);
55
+ onActive?.(tab.id);
56
+ }, children: [(0, jsx_runtime_1.jsx)(Icon, { size: 13 }), (0, jsx_runtime_1.jsx)(gui_1.SizableText, { size: "$2", children: tab.label })] }, tab.id));
57
+ }), (0, jsx_runtime_1.jsx)(gui_1.XStack, { flex: 1 }), onClose ? ((0, jsx_runtime_1.jsx)(gui_1.XStack, { width: 26, height: 26, items: "center", justify: "center", rounded: "$3", cursor: "pointer", opacity: 0.7, role: "button", tabIndex: 0, "aria-label": "Close panel", ...(0, slot_1.tip)('Close panel'), hoverStyle: { bg: '$hover', opacity: 1 }, onPress: onClose, children: (0, jsx_runtime_1.jsx)(lucide_icons_2_1.X, { size: 15 }) })) : null] }), (0, jsx_runtime_1.jsx)(gui_1.ScrollView, { flex: 1, showsVerticalScrollIndicator: false, children: (0, jsx_runtime_1.jsx)(gui_1.YStack, { p: "$5", children: shown?.content }) })] }));
58
+ }
59
+ /**
60
+ * The outermost column: which organization you are in.
61
+ *
62
+ * A person belongs to several and can always start another, so this is a
63
+ * SWITCHER and not a logo — everything to the right of it (channels, DMs,
64
+ * activity, files) belongs to whichever org is lit here. It is its own column
65
+ * rather than a menu in the rail because the rail's contents change when this
66
+ * changes, and a control that reorganises the page beside it should not be
67
+ * hidden inside that page.
68
+ */
69
+ function OrgRail({ orgs, active, onSwitch, onAdd, ...rest }) {
70
+ return ((0, jsx_runtime_1.jsxs)(gui_1.YStack, { ...(0, slot_1.slot)('org-rail'), width: 56, shrink: 0, height: "100%", items: "center", gap: "$2", py: "$3", bg: "$background", borderRightWidth: 1, borderColor: "$borderColor", ...rest, children: [orgs.map((org) => {
71
+ const on = org.id === active;
72
+ return ((0, jsx_runtime_1.jsx)(gui_1.XStack, { width: 36, height: 36, rounded: "$4", items: "center", justify: "center", overflow: "hidden", cursor: "pointer", role: "button", tabIndex: 0, "aria-current": on ? 'true' : undefined, "aria-label": org.name, ...(0, slot_1.tip)(org.name), bg: on ? '$edge' : '$raised', borderWidth: 1, borderColor: on ? '$color8' : 'transparent', opacity: on ? 1 : 0.7, hoverStyle: { opacity: 1 }, onPress: () => onSwitch?.(org.id), children: org.avatar ?? ((0, jsx_runtime_1.jsx)(gui_1.SizableText, { size: "$3", fontWeight: "600", children: org.name.charAt(0).toUpperCase() })) }, org.id));
73
+ }), onAdd ? ((0, jsx_runtime_1.jsx)(gui_1.XStack, { width: 36, height: 36, rounded: "$4", items: "center", justify: "center", cursor: "pointer", role: "button", tabIndex: 0, "aria-label": "Add an organization", ...(0, slot_1.tip)('Add an organization'), borderWidth: 1, borderColor: "$borderColor", opacity: 0.6, hoverStyle: { bg: '$hover', opacity: 1 }, onPress: onAdd, children: (0, jsx_runtime_1.jsx)(lucide_icons_2_1.Plus, { size: 16 }) })) : null] }));
74
+ }
@@ -0,0 +1,84 @@
1
+ /**
2
+ * The channel's furniture: the header, the artifact card, the system line, the
3
+ * right-hand pane, and the org rail the whole shell hangs off.
4
+ *
5
+ * Each is presentational and takes its content. Together they are the working
6
+ * view: a channel names the work and counts what came out of it, the thread
7
+ * carries the conversation and the things produced, and the pane is where a
8
+ * produced thing is actually looked at.
9
+ */
10
+ import { XStack, YStack } from '@hanzo/gui';
11
+ import { type ComponentProps, type ReactNode } from 'react';
12
+ type Col = Omit<ComponentProps<typeof YStack>, 'children'>;
13
+ type Row = Omit<ComponentProps<typeof XStack>, 'children'>;
14
+ export interface ChannelHeaderProps extends Row {
15
+ name: string;
16
+ /** How many work products this channel has produced. Absent draws no badge —
17
+ * zero is a fact worth showing, absent is "not counted yet". */
18
+ artifacts?: number;
19
+ onArtifacts?: () => void;
20
+ /** Trailing controls. */
21
+ children?: ReactNode;
22
+ }
23
+ export declare function ChannelHeader({ name, artifacts, onArtifacts, children, ...rest }: ChannelHeaderProps): import("react/jsx-runtime").JSX.Element;
24
+ /** What a produced thing is. Names the icon and the card's second line. */
25
+ export type ArtifactKind = 'canvas' | 'code' | 'view';
26
+ export interface ArtifactCardProps extends Row {
27
+ title: string;
28
+ kind: ArtifactKind;
29
+ onOpen?: () => void;
30
+ }
31
+ /** A thing the agent made, offered in the thread. Opening it fills the pane. */
32
+ export declare function ArtifactCard({ title, kind, onOpen, ...rest }: ArtifactCardProps): import("react/jsx-runtime").JSX.Element;
33
+ export interface SystemLineProps extends Row {
34
+ /** The whole sentence, already written by the caller — "Zoe was added by
35
+ * Harry". Composing it here would need a grammar this component cannot have. */
36
+ children: ReactNode;
37
+ avatar?: ReactNode;
38
+ }
39
+ /** Something that happened TO the channel, not something anyone said. */
40
+ export declare function SystemLine({ children, avatar, ...rest }: SystemLineProps): import("react/jsx-runtime").JSX.Element;
41
+ export interface PaneTab {
42
+ id: string;
43
+ label: string;
44
+ kind: ArtifactKind;
45
+ content: ReactNode;
46
+ }
47
+ export interface PaneProps extends Col {
48
+ tabs: PaneTab[];
49
+ active?: string;
50
+ onActive?: (id: string) => void;
51
+ onClose?: () => void;
52
+ }
53
+ /**
54
+ * The right-hand pane — Code, View, Canvas.
55
+ *
56
+ * Uncontrolled until `active` is supplied, so the common case needs no state
57
+ * while a surface that routes to a tab can drive it.
58
+ */
59
+ export declare function Pane({ tabs, active, onActive, onClose, ...rest }: PaneProps): import("react/jsx-runtime").JSX.Element;
60
+ export interface Org {
61
+ id: string;
62
+ name: string;
63
+ /** A mark. Falls back to the first letter of `name`. */
64
+ avatar?: ReactNode;
65
+ }
66
+ export interface OrgRailProps extends Col {
67
+ orgs: Org[];
68
+ active?: string;
69
+ onSwitch?: (id: string) => void;
70
+ onAdd?: () => void;
71
+ }
72
+ /**
73
+ * The outermost column: which organization you are in.
74
+ *
75
+ * A person belongs to several and can always start another, so this is a
76
+ * SWITCHER and not a logo — everything to the right of it (channels, DMs,
77
+ * activity, files) belongs to whichever org is lit here. It is its own column
78
+ * rather than a menu in the rail because the rail's contents change when this
79
+ * changes, and a control that reorganises the page beside it should not be
80
+ * hidden inside that page.
81
+ */
82
+ export declare function OrgRail({ orgs, active, onSwitch, onAdd, ...rest }: OrgRailProps): import("react/jsx-runtime").JSX.Element;
83
+ export {};
84
+ //# sourceMappingURL=Pane.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Pane.d.ts","sourceRoot":"","sources":["../../src/agents/Pane.tsx"],"names":[],"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E,GAAG,IAAI,EAAE,EAAE,eAAe,2CASxE;AAID,MAAM,WAAW,OAAO;IACtB,EAAE,EAAE,MAAM,CAAA;IACV,KAAK,EAAE,MAAM,CAAA;IACb,IAAI,EAAE,YAAY,CAAA;IAClB,OAAO,EAAE,SAAS,CAAA;CACnB;AAED,MAAM,WAAW,SAAU,SAAQ,GAAG;IACpC,IAAI,EAAE,OAAO,EAAE,CAAA;IACf,MAAM,CAAC,EAAE,MAAM,CAAA;IACf,QAAQ,CAAC,EAAE,CAAC,EAAE,EAAE,MAAM,KAAK,IAAI,CAAA;IAC/B,OAAO,CAAC,EAAE,MAAM,IAAI,CAAA;CACrB;AAED;;;;;GAKG;AACH,wBAAgB,IAAI,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,QAAQ,EAAE,OAAO,EAAE,GAAG,IAAI,EAAE,EAAE,SAAS,2CAyE3E;AAID,MAAM,WAAW,GAAG;IAClB,EAAE,EAAE,MAAM,CAAA;IACV,IAAI,EAAE,MAAM,CAAA;IACZ,wDAAwD;IACxD,MAAM,CAAC,EAAE,SAAS,CAAA;CACnB;AAED,MAAM,WAAW,YAAa,SAAQ,GAAG;IACvC,IAAI,EAAE,GAAG,EAAE,CAAA;IACX,MAAM,CAAC,EAAE,MAAM,CAAA;IACf,QAAQ,CAAC,EAAE,CAAC,EAAE,EAAE,MAAM,KAAK,IAAI,CAAA;IAC/B,KAAK,CAAC,EAAE,MAAM,IAAI,CAAA;CACnB;AAED;;;;;;;;;GASG;AACH,wBAAgB,OAAO,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,QAAQ,EAAE,KAAK,EAAE,GAAG,IAAI,EAAE,EAAE,YAAY,2CAuE/E"}
@@ -0,0 +1,68 @@
1
+ 'use client';
2
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
3
+ /**
4
+ * The channel's furniture: the header, the artifact card, the system line, the
5
+ * right-hand pane, and the org rail the whole shell hangs off.
6
+ *
7
+ * Each is presentational and takes its content. Together they are the working
8
+ * view: a channel names the work and counts what came out of it, the thread
9
+ * carries the conversation and the things produced, and the pane is where a
10
+ * produced thing is actually looked at.
11
+ */
12
+ import { ScrollView, SizableText, XStack, YStack } from '@hanzo/gui';
13
+ import { Code2, Eye, FileText, Plus, X } from '@hanzogui/lucide-icons-2';
14
+ import { useState } from 'react';
15
+ import { slot, tip } from '../backends/gui/slot.js';
16
+ export function ChannelHeader({ name, artifacts, onArtifacts, children, ...rest }) {
17
+ return (_jsxs(XStack, { ...slot('channel-header'), items: "center", gap: "$2", px: "$4", py: "$3", borderBottomWidth: 1, borderColor: "$borderColor", ...rest, children: [_jsx(XStack, { width: 26, height: 26, rounded: "$3", items: "center", justify: "center", bg: "$raised", shrink: 0, children: _jsx(Code2, { size: 13, opacity: 0.8 }) }), _jsx(SizableText, { size: "$5", fontWeight: "600", numberOfLines: 1, shrink: 1, children: name }), _jsx(XStack, { flex: 1 }), artifacts === undefined ? null : (_jsxs(XStack, { items: "center", gap: "$2", px: "$2.5", py: "$1", rounded: "$4", borderWidth: 1, borderColor: "$borderColor", cursor: onArtifacts ? 'pointer' : 'default', role: onArtifacts ? 'button' : undefined, tabIndex: onArtifacts ? 0 : undefined, hoverStyle: onArtifacts ? { bg: '$hover' } : undefined, onPress: onArtifacts, children: [_jsx(SizableText, { size: "$2", color: "$quiet", children: "Artifacts" }), _jsx(XStack, { minW: 18, height: 18, px: "$1", rounded: 9999, items: "center", justify: "center", bg: "$edge", children: _jsx(SizableText, { size: "$1", fontWeight: "600", children: artifacts }) })] })), children] }));
18
+ }
19
+ const ART = {
20
+ canvas: { icon: FileText, says: 'Canvas' },
21
+ code: { icon: Code2, says: 'Code' },
22
+ view: { icon: Eye, says: 'View' },
23
+ };
24
+ /** A thing the agent made, offered in the thread. Opening it fills the pane. */
25
+ export function ArtifactCard({ title, kind, onOpen, ...rest }) {
26
+ const { icon: Icon, says } = ART[kind];
27
+ return (_jsxs(XStack, { ...slot('artifact-card'), items: "center", gap: "$3", p: "$3", rounded: "$4", borderWidth: 1, borderColor: "$borderColor", bg: "$panel", maxW: 420, cursor: onOpen ? 'pointer' : 'default', role: onOpen ? 'button' : undefined, tabIndex: onOpen ? 0 : undefined, hoverStyle: onOpen ? { bg: '$hover' } : undefined, onPress: onOpen, ...rest, children: [_jsx(XStack, { width: 34, height: 34, rounded: "$3", items: "center", justify: "center", bg: "$edge", shrink: 0, children: _jsx(Icon, { size: 16 }) }), _jsxs(YStack, { flex: 1, shrink: 1, children: [_jsx(SizableText, { size: "$3", fontWeight: "600", numberOfLines: 1, children: title }), _jsx(SizableText, { size: "$2", color: "$soft", children: says })] })] }));
28
+ }
29
+ /** Something that happened TO the channel, not something anyone said. */
30
+ export function SystemLine({ children, avatar, ...rest }) {
31
+ return (_jsxs(XStack, { ...slot('system-line'), items: "flex-start", gap: "$3", ...rest, children: [avatar ?? _jsx(YStack, { width: 28, shrink: 0 }), _jsx(SizableText, { size: "$2", color: "$soft", flex: 1, children: children })] }));
32
+ }
33
+ /**
34
+ * The right-hand pane — Code, View, Canvas.
35
+ *
36
+ * Uncontrolled until `active` is supplied, so the common case needs no state
37
+ * while a surface that routes to a tab can drive it.
38
+ */
39
+ export function Pane({ tabs, active, onActive, onClose, ...rest }) {
40
+ const [own, setOwn] = useState(tabs[0]?.id);
41
+ const current = active ?? own;
42
+ const shown = tabs.find((t) => t.id === current) ?? tabs[0];
43
+ return (_jsxs(YStack, { ...slot('pane'), flex: 1, minH: 0, bg: "$panel", rounded: "$4", borderWidth: 1, borderColor: "$borderColor", overflow: "hidden", ...rest, children: [_jsxs(XStack, { items: "center", gap: "$1", px: "$2", py: "$2", borderBottomWidth: 1, borderColor: "$borderColor", children: [tabs.map((tab) => {
44
+ const on = tab.id === shown?.id;
45
+ const Icon = ART[tab.kind].icon;
46
+ return (_jsxs(XStack, { items: "center", gap: "$1.5", px: "$2.5", py: "$1.5", rounded: "$3", cursor: "pointer", role: "tab", tabIndex: 0, "aria-selected": on, opacity: on ? 1 : 0.6, bg: on ? '$edge' : undefined, hoverStyle: { bg: on ? '$edge' : '$hover', opacity: 1 }, onPress: () => {
47
+ setOwn(tab.id);
48
+ onActive?.(tab.id);
49
+ }, children: [_jsx(Icon, { size: 13 }), _jsx(SizableText, { size: "$2", children: tab.label })] }, tab.id));
50
+ }), _jsx(XStack, { flex: 1 }), onClose ? (_jsx(XStack, { width: 26, height: 26, items: "center", justify: "center", rounded: "$3", cursor: "pointer", opacity: 0.7, role: "button", tabIndex: 0, "aria-label": "Close panel", ...tip('Close panel'), hoverStyle: { bg: '$hover', opacity: 1 }, onPress: onClose, children: _jsx(X, { size: 15 }) })) : null] }), _jsx(ScrollView, { flex: 1, showsVerticalScrollIndicator: false, children: _jsx(YStack, { p: "$5", children: shown?.content }) })] }));
51
+ }
52
+ /**
53
+ * The outermost column: which organization you are in.
54
+ *
55
+ * A person belongs to several and can always start another, so this is a
56
+ * SWITCHER and not a logo — everything to the right of it (channels, DMs,
57
+ * activity, files) belongs to whichever org is lit here. It is its own column
58
+ * rather than a menu in the rail because the rail's contents change when this
59
+ * changes, and a control that reorganises the page beside it should not be
60
+ * hidden inside that page.
61
+ */
62
+ export function OrgRail({ orgs, active, onSwitch, onAdd, ...rest }) {
63
+ return (_jsxs(YStack, { ...slot('org-rail'), width: 56, shrink: 0, height: "100%", items: "center", gap: "$2", py: "$3", bg: "$background", borderRightWidth: 1, borderColor: "$borderColor", ...rest, children: [orgs.map((org) => {
64
+ const on = org.id === active;
65
+ return (_jsx(XStack, { width: 36, height: 36, rounded: "$4", items: "center", justify: "center", overflow: "hidden", cursor: "pointer", role: "button", tabIndex: 0, "aria-current": on ? 'true' : undefined, "aria-label": org.name, ...tip(org.name), bg: on ? '$edge' : '$raised', borderWidth: 1, borderColor: on ? '$color8' : 'transparent', opacity: on ? 1 : 0.7, hoverStyle: { opacity: 1 }, onPress: () => onSwitch?.(org.id), children: org.avatar ?? (_jsx(SizableText, { size: "$3", fontWeight: "600", children: org.name.charAt(0).toUpperCase() })) }, org.id));
66
+ }), onAdd ? (_jsx(XStack, { width: 36, height: 36, rounded: "$4", items: "center", justify: "center", cursor: "pointer", role: "button", tabIndex: 0, "aria-label": "Add an organization", ...tip('Add an organization'), borderWidth: 1, borderColor: "$borderColor", opacity: 0.6, hoverStyle: { bg: '$hover', opacity: 1 }, onPress: onAdd, children: _jsx(Plus, { size: 16 }) })) : null] }));
67
+ }
68
+ //# sourceMappingURL=Pane.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Pane.js","sourceRoot":"","sources":["../../src/agents/Pane.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAA;;AAEZ;;;;;;;;GAQG;AACH,OAAO,EAAE,UAAU,EAAE,WAAW,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,YAAY,CAAA;AACpE,OAAO,EAAE,KAAK,EAAE,GAAG,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC,EAAE,MAAM,0BAA0B,CAAA;AACxE,OAAO,EAAE,QAAQ,EAAuC,MAAM,OAAO,CAAA;AAErE,OAAO,EAAE,IAAI,EAAE,GAAG,EAAE,MAAM,sBAAsB,CAAA;AAiBhD,MAAM,UAAU,aAAa,CAAC,EAC5B,IAAI,EACJ,SAAS,EACT,WAAW,EACX,QAAQ,EACR,GAAG,IAAI,EACY;IACnB,OAAO,CACL,MAAC,MAAM,OACD,IAAI,CAAC,gBAAgB,CAAC,EAC1B,KAAK,EAAC,QAAQ,EACd,GAAG,EAAC,IAAI,EACR,EAAE,EAAC,IAAI,EACP,EAAE,EAAC,IAAI,EACP,iBAAiB,EAAE,CAAC,EACpB,WAAW,EAAC,cAAc,KACtB,IAAI,aAER,KAAC,MAAM,IACL,KAAK,EAAE,EAAE,EACT,MAAM,EAAE,EAAE,EACV,OAAO,EAAC,IAAI,EACZ,KAAK,EAAC,QAAQ,EACd,OAAO,EAAC,QAAQ,EAChB,EAAE,EAAC,SAAS,EACZ,MAAM,EAAE,CAAC,YAET,KAAC,KAAK,IAAC,IAAI,EAAE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