@hanzo/app 0.3.95 → 0.3.96

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/Board.js CHANGED
@@ -9,7 +9,7 @@ import { Fragment as _Fragment, jsx as _jsx, jsxs as _jsxs } from "react/jsx-run
9
9
  // engine, and asks why their cards are not replayable. Tasks keeps the word it
10
10
  // earned; this is the Board.
11
11
  //
12
- // A CARD IS A FORGE ISSUE. `/v1/todo` says so itself — "the column is a LABEL on
12
+ // A CARD IS A FORGE ISSUE. `/v1/task` says so itself — "the column is a LABEL on
13
13
  // the forge, so the board and the forge web UI are the same object seen twice:
14
14
  // relabelling in either moves the card in both" — so this surface keeps no work
15
15
  // of its own. Everything drawn here is a row somebody could also have moved from
@@ -2,7 +2,7 @@
2
2
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
3
3
  import { useEffect, useState } from 'react';
4
4
  import { useI18n } from '@hanzo/i18n/react';
5
- import { Dialog, DialogContent, DialogTitle, Input, XStack, YStack } from '@hanzo/ui';
5
+ import { Dialog, DialogContent, DialogTitle, Text, XStack, YStack } from '@hanzo/ui';
6
6
  import { Search, X } from 'lucide-react';
7
7
  import { FIRST, SettingsList } from './Settings.js';
8
8
  import { SettingsPane } from './SettingsPane.js';
@@ -21,5 +21,8 @@ export function PreferencesDialog({ open, onOpenChange, initialSection = FIRST,
21
21
  }
22
22
  setActive(row.id);
23
23
  };
24
- return (_jsx(Dialog, { open: open, onOpenChange: onOpenChange, children: _jsxs(DialogContent, { "data-slot": "preferences-dialog", width: "94vw", maxW: 980, height: "84vh", maxH: 760, p: 0, gap: 0, rounded: 14, overflow: "hidden", bg: "var(--pane-fill, var(--card))", borderWidth: 1, borderColor: "var(--pane-edge, var(--border))", children: [_jsx(DialogTitle, { display: "none", children: t('Settings') }), _jsxs(XStack, { flex: 1, minH: 0, width: "100%", children: [_jsxs(YStack, { width: 236, shrink: 0, height: "100%", bg: "var(--side-fill, var(--background))", borderRightWidth: 1, borderColor: "var(--pane-edge, var(--border))", "$max-md": { width: 184 }, children: [_jsx(XStack, { px: 12, pt: 12, pb: 8, shrink: 0, children: _jsxs(XStack, { flex: 1, height: 32, px: 10, gap: 7, items: "center", rounded: 8, bg: "var(--surface-card-emphasis)", borderWidth: 1, borderColor: "var(--pane-edge, var(--border))", children: [_jsx(Search, { size: 13, color: "var(--muted-foreground)", "aria-hidden": true }), _jsx(Input, { unstyled: true, value: filter, onChange: (e) => setFilter(e.target.value), placeholder: t('Search settings'), "aria-label": t('Search settings'), flex: 1, minW: 0, fontSize: 13, color: "var(--foreground)", placeholderTextColor: "$placeholderColor" })] }) }), _jsx(YStack, { flex: 1, minH: 0, px: 8, pb: 12, overflowY: "auto", overflowX: "hidden", children: _jsx(SettingsList, { active: active, filter: filter, onPick: pick, onBack: () => onOpenChange(false) }) })] }), _jsxs(YStack, { flex: 1, minW: 0, minH: 0, height: "100%", bg: "var(--pane-fill, var(--card))", position: "relative", children: [_jsx(XStack, { position: "absolute", t: 12, r: 14, z: 5, children: _jsx(XStack, { render: "button", type: 'button', "aria-label": t('Close'), onClick: () => onOpenChange(false), width: 32, height: 32, rounded: 999, items: "center", justify: "center", bg: "var(--surface-card-emphasis)", borderWidth: 1, borderColor: "var(--pane-edge, var(--border))", cursor: "pointer", hoverStyle: { bg: 'var(--secondary)' }, children: _jsx(X, { size: 15, color: "var(--foreground)", "aria-hidden": true }) }) }), _jsx(SettingsPane, { id: active })] })] })] }) }));
24
+ return (_jsx(Dialog, { open: open, onOpenChange: onOpenChange, children: _jsxs(DialogContent, { "data-slot": "preferences-dialog", width: "94vw", maxW: 980, height: "84vh", maxH: 760, p: 0, gap: 0, rounded: 14, overflow: "hidden", bg: "var(--pane-fill, var(--card))", borderWidth: 1, borderColor: "var(--pane-edge, var(--white-08))", children: [_jsx(DialogTitle, { display: "none", children: t('Settings') }), _jsxs(XStack, { flex: 1, minH: 0, minW: 0, width: "100%", overflow: "hidden", "$max-md": { flexDirection: 'column' }, children: [_jsxs(YStack, { width: 256, shrink: 0, height: "100%", minW: 0, bg: "var(--side-fill, var(--background))", borderRightWidth: 1, borderColor: "var(--pane-edge, var(--white-08))", "$max-md": { width: '100%', height: 'auto', maxH: '42%', borderRightWidth: 0, borderBottomWidth: 1 }, children: [_jsx(XStack, { px: 12, pt: 12, pb: 8, shrink: 0, children: _jsxs(XStack, { "data-slot": "settings-search", flex: 1, height: 32, px: 10, gap: 8, items: "center", rounded: 8, bg: "var(--surface-card-quiet, var(--card))", borderWidth: 1, borderColor: "var(--pane-edge, var(--white-08))", children: [_jsx(XStack, { "data-slot": "settings-search-icon", width: 14, height: 14, shrink: 0, items: "center", justify: "center", pointerEvents: "none", "aria-hidden": true, children: _jsx(Search, { size: 13, color: "var(--muted-foreground)", "aria-hidden": true }) }), _jsx(Text, { "data-slot": "settings-search-input", render: _jsx("input", { type: "search", value: filter, onChange: (e) => setFilter(e.target.value), onKeyDown: (e) => {
25
+ if (e.key === 'Escape')
26
+ setFilter('');
27
+ }, placeholder: t('Search settings'), "aria-label": t('Search settings') }), flex: 1, minW: 0, width: "100%", height: "100%", p: 0, bg: "transparent", borderWidth: 0, outlineStyle: "none", fontSize: 13, color: "var(--foreground)" }), filter ? (_jsx(XStack, { render: "button", type: 'button', "aria-label": t('Clear search'), onClick: () => setFilter(''), width: 18, height: 18, shrink: 0, rounded: 999, items: "center", justify: "center", bg: "transparent", borderWidth: 0, cursor: "pointer", hoverStyle: { bg: 'var(--secondary)' }, children: _jsx(X, { size: 11, color: "var(--muted-foreground)", "aria-hidden": true }) })) : null] }) }), _jsx(YStack, { flex: 1, minH: 0, px: 8, pb: 12, overflowY: "auto", overflowX: "hidden", children: _jsx(SettingsList, { active: active, filter: filter, onPick: pick, onBack: () => onOpenChange(false) }) })] }), _jsxs(YStack, { flex: 1, minW: 0, minH: 0, height: "100%", bg: "var(--pane-fill, var(--card))", position: "relative", children: [_jsx(XStack, { position: "absolute", t: 12, r: 14, z: 5, children: _jsx(XStack, { render: "button", type: 'button', "aria-label": t('Close'), onClick: () => onOpenChange(false), width: 32, height: 32, rounded: 999, items: "center", justify: "center", bg: "var(--surface-card-quiet, var(--card))", borderWidth: 1, borderColor: "var(--pane-edge, var(--white-08))", cursor: "pointer", hoverStyle: { bg: 'var(--secondary)' }, children: _jsx(X, { size: 15, color: "var(--foreground)", "aria-hidden": true }) }) }), _jsx(SettingsPane, { id: active })] })] })] }) }));
25
28
  }
package/dist/Shell.d.ts CHANGED
@@ -26,6 +26,8 @@ export declare function Shell({ mode, front, children, }: {
26
26
  front?: boolean;
27
27
  children: ReactNode;
28
28
  }): import("react").JSX.Element;
29
+ /** The shell's sidebar: its default width, px (unified with ground.ts SIDE). */
30
+ export declare const SIDEBAR_WIDTH = 256;
29
31
  /** Whether the pane is drawn in the app's frame (`Split framed`), where what
30
32
  * floats on the frame's ground is cut as a pane. */
31
33
  export declare const Framed: import("react").Context<boolean>;
@@ -60,3 +62,11 @@ export declare function Split({ children, swap, framed, bare, }: {
60
62
  framed?: boolean;
61
63
  bare?: boolean;
62
64
  }): import("react").JSX.Element;
65
+ /** What a place holds, for the list column. */
66
+ export declare function ShellIndex({ mode, owner, filter, onPick, navigate, }: {
67
+ mode: Mode;
68
+ owner: string;
69
+ filter: string;
70
+ onPick?: () => void;
71
+ navigate?: (route: string) => void;
72
+ }): import("react").JSX.Element;
package/dist/Shell.js CHANGED
@@ -55,7 +55,7 @@ import { parseModels } from "@hanzo/ui/models/catalog";
55
55
  import { mark } from "./lib/mark.js";
56
56
  import { useOpen } from "./open.js";
57
57
  import { useSpan } from "./span.js";
58
- import { pane, RAIL } from "./ground.js";
58
+ import { pane, RAIL, SIDE } from "./ground.js";
59
59
  import { useFree } from "./Upgrade.js";
60
60
  import { payUrl } from "./lib/pay.js";
61
61
  import { rememberSettingsReturn, useDevMode } from "./lib/dev-mode.js";
@@ -84,7 +84,7 @@ import { Face } from "./cast.js";
84
84
  import { useStarred, titleOf } from "./stars.js";
85
85
  import { channelName } from "./network.js";
86
86
  import { useChannels, teamKey, channelHref } from "./channels.js";
87
- import { apex, app, away, chat, CHAT as TALK, dev, ENTRY, leaves, WORKSPACE } from "./lib/host.js";
87
+ import { apex, app, away, chat, CHAT as TALK, dev, ENTRY, FLOW, leaves, WORKSPACE } from "./lib/host.js";
88
88
  import { netKey } from "./conversations.js";
89
89
  import { FIRST, SettingsList, } from "./Settings.js";
90
90
  import { Search } from "./Search.js";
@@ -962,8 +962,8 @@ const FLOOR = 200;
962
962
  const CEIL = 420;
963
963
  /** Per-reader, per-browser. A width that resets is a width you set every load. */
964
964
  const SPAN = "hanzo.app.column";
965
- /** The shell's sidebar: its default width, px. */
966
- const SIDEBAR_WIDTH = 280;
965
+ /** The shell's sidebar: its default width, px (unified with ground.ts SIDE). */
966
+ export const SIDEBAR_WIDTH = SIDE;
967
967
  /**
968
968
  * Where an app's own column goes, when it has one.
969
969
  *
@@ -1029,10 +1029,11 @@ export function Split({ children, swap, framed = false, bare = false, }) {
1029
1029
  : { ...pane(), overflow: "hidden" }
1030
1030
  : {
1031
1031
  ...sheet(0),
1032
+ backgroundColor: "var(--pane-fill, var(--card))",
1032
1033
  // The edge the pane shares with the column before it: the left, or the right in a right-to-left language.
1033
1034
  borderInlineStartWidth: 1,
1034
1035
  borderInlineStartStyle: "solid",
1035
- borderColor: "var(--edge, var(--border))",
1036
+ borderColor: "var(--pane-edge, var(--edge, var(--border)))",
1036
1037
  }), ref: split.main, width: "100%", height: "100%", minW: 0, minH: 0, children: [swap ?? (_jsx(Framed.Provider, { value: framed, children: _jsx(SideProvider, { value: split.side, children: _jsx(Slot.Provider, { value: slot, children: children }) }) })), !aside && !swap ? (_jsx(YStack, { "data-slot": "side-pull", "aria-hidden": true, ...{ title: t("Drag to open split browser") }, position: "absolute", t: 0, b: 0, insetInlineEnd: 0, width: 10, z: 10, items: "center", justify: "center", cursor: "col-resize", display: "none", $lg: { display: "flex" }, ...{ touchAction: "none" }, onDoubleClick: () => showAside("tasks"), onPointerDown: (e) => {
1037
1038
  if (e.button !== 0)
1038
1039
  return;
@@ -1121,15 +1122,15 @@ function ShellProfileHover({ name, email, avatar, orgId, signedIn, onSettings, o
1121
1122
  }
1122
1123
  function Rail({ mode, places, team, open, hiddenOnDesktop = false, navigate, onMore, avatarSlot, }) {
1123
1124
  const { t } = useI18n();
1124
- return (_jsxs(YStack, { "data-slot": "rail", render: "nav", "aria-label": t("Places"), ...sheet(0), gridArea: "rail", minH: 0, borderInlineEndWidth: 1, borderInlineEndStyle: "solid", borderColor: "var(--edge, var(--white-06))", $md: hiddenOnDesktop ? { display: "none" } : undefined, "$max-md": {
1125
+ return (_jsxs(YStack, { "data-slot": "rail", render: "nav", "aria-label": t("Places"), ...sheet(0), bg: "var(--side-fill, var(--background))", gridArea: "rail", minH: 0, borderInlineEndWidth: 1, borderInlineEndStyle: "solid", borderColor: "var(--pane-edge, var(--edge, var(--white-08)))", $md: hiddenOnDesktop ? { display: "none" } : undefined, "$max-md": {
1125
1126
  flexDirection: "row",
1126
1127
  items: "center",
1127
1128
  borderInlineEndWidth: 0,
1128
1129
  borderTopWidth: 1,
1129
- borderTopColor: "var(--border)",
1130
+ borderTopColor: "var(--pane-edge, var(--white-08))",
1130
1131
  },
1131
1132
  // Clear of the home indicator on a phone; zero on a flat screen.
1132
- pb: HOME_INDICATOR, children: [_jsx(YStack, { "$max-md": { display: "none" }, borderBottomWidth: 1, borderColor: "var(--edge, var(--white-06))", mx: "$2", children: _jsx(Tiles, {}) }), _jsxs(YStack, { "data-slot": "places", ...bare, items: "center", gap: "$0.5", flex: 1, minW: 0, minH: 0, overflowY: "auto", overflowX: "hidden", pt: "$2", $md: open ? { display: "none" } : undefined, "$max-md": {
1133
+ pb: HOME_INDICATOR, children: [_jsx(YStack, { "$max-md": { display: "none" }, borderBottomWidth: 1, borderColor: "var(--pane-edge, var(--white-08))", mx: "$2", children: _jsx(Tiles, {}) }), _jsxs(YStack, { "data-slot": "places", ...bare, items: "center", gap: "$0.5", flex: 1, minW: 0, minH: 0, overflowY: "auto", overflowX: "hidden", pt: "$2", $md: open ? { display: "none" } : undefined, "$max-md": {
1133
1134
  display: "grid",
1134
1135
  gridAutoFlow: "column",
1135
1136
  gridAutoColumns: "minmax(0, 1fr)",
@@ -1159,15 +1160,51 @@ function App({ filter, onPick, navigate, }) {
1159
1160
  onPick?.();
1160
1161
  } }), _jsx(SidebarFolder, { name: t("Projects"), open: filter ? true : undefined, children: _jsx(Projects, { filter: filter, onPick: open }) }), _jsx(Chats, { filter: filter, onPick: onPick })] }));
1161
1162
  }
1163
+ /**
1164
+ * Dev's column: start a thread, projects first, then threads. Keeps Dev
1165
+ * composable on the canonical shell without falling through to generic Chats.
1166
+ */
1167
+ function DevIndex({ filter, onPick, navigate, }) {
1168
+ const { t } = useI18n();
1169
+ const { empty } = useOpen();
1170
+ const openProject = (slug) => {
1171
+ navigate?.(dev(slug));
1172
+ onPick?.();
1173
+ };
1174
+ return (_jsxs(YStack, { "data-slot": "dev-index", children: [_jsx(SidebarNewChat, { label: t("New thread"), onPress: () => {
1175
+ empty();
1176
+ navigate?.(dev(""));
1177
+ onPick?.();
1178
+ } }), _jsx(YStack, { "data-slot": "dev-projects", children: _jsx(SidebarFolder, { name: t("Projects"), defaultOpen: true, open: filter ? true : undefined, children: _jsx(Projects, { filter: filter, onPick: openProject }) }) }), _jsx(YStack, { "data-slot": "dev-threads", children: _jsx(SidebarFolder, { name: t("Threads"), defaultOpen: true, open: filter ? true : undefined, children: _jsx(Chats, { filter: filter, onPick: onPick }) }) })] }));
1179
+ }
1180
+ /**
1181
+ * Bots' column: the agents roster with a subtle `/flow` Workflows entry below
1182
+ * a monochrome hairline divider.
1183
+ */
1184
+ function BotsIndex({ owner, filter, onPick, navigate, }) {
1185
+ const { t } = useI18n();
1186
+ const showWorkflows = matches(t("Workflows"), filter) || matches("flow", filter);
1187
+ return (_jsxs(YStack, { "data-slot": "bots-index", children: [_jsx(Bots, { show: "agents", owner: owner, filter: filter, onPick: onPick, navigate: navigate }), showWorkflows ? (_jsx(YStack, { "data-slot": "bots-workflows", pt: "$2", mt: "$2", borderTopWidth: 1, borderColor: "var(--pane-edge, var(--white-08))", children: _jsx(SidebarSection, { label: t("Automation"), children: _jsx(SidebarItem, { "data-slot": "bots-workflows-link", icon: _jsx(Workflow, { size: 15, "aria-hidden": true }), onPress: () => {
1188
+ if (navigate)
1189
+ navigate(FLOW);
1190
+ else if (typeof window !== "undefined")
1191
+ window.location.assign(FLOW);
1192
+ onPick?.();
1193
+ }, children: t("Workflows") }) }) })) : null] }));
1194
+ }
1162
1195
  /** What a place holds, for the list column. */
1163
- function Index({ mode, owner, filter, onPick, navigate, }) {
1196
+ export function ShellIndex({ mode, owner, filter, onPick, navigate, }) {
1164
1197
  const { t } = useI18n();
1165
1198
  const channels = (_jsxs(_Fragment, { children: [_jsx(Channels, { onPick: onPick, navigate: navigate }), _jsx(Team, { filter: filter, onPick: onPick, navigate: navigate })] }));
1166
1199
  if (mode === "chat")
1167
1200
  return _jsx(App, { filter: filter, onPick: onPick, navigate: navigate });
1201
+ if (mode === "dev")
1202
+ return _jsx(DevIndex, { filter: filter, onPick: onPick, navigate: navigate });
1168
1203
  if (mode === "home")
1169
1204
  return (_jsxs(_Fragment, { children: [_jsx(Chats, { filter: filter, onPick: onPick }), channels, _jsx(Bots, { show: "people", owner: owner, filter: filter, onPick: onPick, navigate: navigate }), _jsx(Bots, { show: "agents", owner: owner, filter: filter, onPick: onPick, navigate: navigate })] }));
1170
- if (mode === "bots" || mode === "agents")
1205
+ if (mode === "bots")
1206
+ return _jsx(BotsIndex, { owner: owner, filter: filter, onPick: onPick, navigate: navigate });
1207
+ if (mode === "agents")
1171
1208
  return _jsx(Bots, { show: "agents", owner: owner, filter: filter, onPick: onPick, navigate: navigate });
1172
1209
  if (mode === "contacts")
1173
1210
  return _jsx(Bots, { show: "people", owner: owner, filter: filter, onPick: onPick, navigate: navigate });
@@ -1175,11 +1212,6 @@ function Index({ mode, owner, filter, onPick, navigate, }) {
1175
1212
  return channels;
1176
1213
  if (mode === "tasks")
1177
1214
  return _jsx(Projects, { filter: filter, onPick: onPick });
1178
- if (mode === "dev")
1179
- return (_jsx(Projects, { filter: filter, onPick: (slug) => {
1180
- navigate?.(dev(slug));
1181
- onPick?.();
1182
- } }));
1183
1215
  if (mode === "drive")
1184
1216
  return (_jsx(SidebarSection, { label: t("Storage"), children: _jsx(Note, { children: t("Browse cloud buckets, project files, and local folders in Drive.") }) }));
1185
1217
  if (mode === "cal")
@@ -1252,10 +1284,19 @@ function Frame({ mode, children, navigate, back, forward, }) {
1252
1284
  const tiers = useTiers();
1253
1285
  const [hidden] = useHidden();
1254
1286
  const shown = asked || peeking;
1255
- const toggle = () => {
1287
+ const toggle = useCallback(() => {
1256
1288
  setPeeking(false);
1257
- setAsked((open) => !open);
1258
- };
1289
+ setAsked((open) => {
1290
+ const next = !open;
1291
+ try {
1292
+ localStorage.setItem("hanzo:sidebar:open", String(next));
1293
+ }
1294
+ catch {
1295
+ // No storage still toggles the sidebar in memory.
1296
+ }
1297
+ return next;
1298
+ });
1299
+ }, []);
1259
1300
  const dismiss = () => {
1260
1301
  setPeeking(false);
1261
1302
  if (typeof window !== "undefined" && window.innerWidth < 1024)
@@ -1415,7 +1456,7 @@ function Frame({ mode, children, navigate, back, forward, }) {
1415
1456
  const list = (_jsxs(Sidebar, { ref: side.ref, ...side.props, $md: { width: "var(--span)" }, "$max-md": { width: "100%", maxW: 280 }, ...sheet(0),
1416
1457
  // The kit draws the sidebar's edge on its right, a physical side, so the edge is
1417
1458
  // traded here: the left in a right-to-left language, where the sidebar stands at the right.
1418
- bg: "var(--side-fill, var(--sheet-2))", rounded: "var(--pane-round)", borderWidth: 1, borderColor: "var(--pane-edge, var(--edge, var(--white-06)))", overflowX: "hidden", position: "relative", children: [_jsx(Gutter
1459
+ bg: "var(--side-fill, var(--background))", rounded: "var(--pane-round)", borderWidth: 1, borderColor: "var(--pane-edge, var(--edge, var(--white-08)))", overflowX: "hidden", position: "relative", children: [_jsx(Gutter
1419
1460
  // The edge the sidebar is pinned to (Grip's, physical): its free edge is the other one.
1420
1461
  , {
1421
1462
  // The edge the sidebar is pinned to (Grip's, physical): its free edge is the other one.
@@ -1427,14 +1468,14 @@ function Frame({ mode, children, navigate, back, forward, }) {
1427
1468
  }, "aria-label": t("{brandName} home", { brandName: brand() }), title: t("Home") }), "data-slot": "home", display: "flex", items: "center", justify: "center", width: 28, height: 28, $touchable: { width: 44, height: 44, minW: 44, minH: 44 }, color: "inherit", children: _jsx(HanzoMark, { size: 18 }) }), settled && isAuthenticated ? (_jsx(XStack, { shrink: 1, minW: 0, children: _jsx(TopOrgSelector, {}) })) : null] }), _jsx(YStack, { "data-slot": "places-list", px: "$2", pt: "$2", pb: "$2", gap: 1, "$max-md": { display: "none" }, children: places.filter((place) => matches(t(place.label), filter)).map((place) => (_jsx(SidebarItem, { gap: "$2.5", minH: 34, $touchable: { minH: 44 }, "$max-sm": { minH: 44 }, bg: place.id === mode ? "$raised" : "transparent", hoverStyle: { bg: place.id === mode ? "$raised" : "$hover" }, icon: _jsx(XStack, { width: 18, height: 18, items: "center", justify: "center", shrink: 0, opacity: place.id === mode ? 1 : 0.78, children: _jsx(place.icon, { size: 16, "aria-hidden": true }) }), active: place.id === mode, onPress: () => {
1428
1469
  navigate?.(place.route);
1429
1470
  onPick?.();
1430
- }, children: t(place.label) }, place.id))) }), more.length ? (_jsx(YStack, { "data-slot": "setup-list", px: "$2", pb: "$2", children: _jsx(SidebarSection, { label: t("Setup"), mt: "$1", children: more.map((tool) => (_jsx(SidebarItem, { gap: "$2.5", minH: 32, $touchable: { minH: 44 }, "$max-sm": { minH: 44 }, icon: _jsx(XStack, { width: 18, height: 18, items: "center", justify: "center", shrink: 0, opacity: 0.78, children: _jsx(tool.icon, { size: 15, "aria-hidden": true }) }), onPress: tool.go, children: tool.label }, tool.id))) }) })) : null, _jsx(XStack, { px: "$3", pb: "$2", children: _jsxs(XStack, { flex: 1, minW: 0, height: 30, $touchable: { minH: 44 }, items: "center", gap: "$2", px: "$2", rounded: "$2", borderWidth: 1, borderColor: "var(--border-strong)", children: [_jsx(SearchIcon, { size: 13, "aria-hidden": true }), _jsx(Text, { render: _jsx("input", { value: filter, onChange: (e) => setFilter(e.target.value), onKeyDown: (e) => {
1471
+ }, children: t(place.label) }, place.id))) }), more.length ? (_jsx(YStack, { "data-slot": "setup-list", px: "$2", pb: "$2", children: _jsx(SidebarSection, { label: t("Setup"), mt: "$1", children: more.map((tool) => (_jsx(SidebarItem, { gap: "$2.5", minH: 32, $touchable: { minH: 44 }, "$max-sm": { minH: 44 }, icon: _jsx(XStack, { width: 18, height: 18, items: "center", justify: "center", shrink: 0, opacity: 0.78, children: _jsx(tool.icon, { size: 15, "aria-hidden": true }) }), onPress: tool.go, children: tool.label }, tool.id))) }) })) : null, _jsx(XStack, { px: "$3", pb: "$2", children: _jsxs(XStack, { flex: 1, minW: 0, height: 30, $touchable: { minH: 44 }, items: "center", gap: "$2", px: "$2", rounded: "$2", borderWidth: 1, borderColor: "var(--border-strong)", children: [_jsx(XStack, { shrink: 0, items: "center", justify: "center", pointerEvents: "none", "aria-hidden": true, children: _jsx(SearchIcon, { size: 13, "aria-hidden": true }) }), _jsx(Text, { render: _jsx("input", { value: filter, onChange: (e) => setFilter(e.target.value), onKeyDown: (e) => {
1431
1472
  if (e.key === "Escape")
1432
1473
  setFilter("");
1433
1474
  },
1434
1475
  // FILTER, not Search. Two controls that both said Search did two
1435
1476
  // different things: this one narrows the list beside you, and the
1436
1477
  // bar above opens the palette that finds anything anywhere.
1437
- placeholder: t("Filter"), "aria-label": t("Filter sidebar") }), flex: 1, minW: 0, bg: "transparent", borderWidth: 0, outlineStyle: "none", color: "inherit", fontSize: "$2" })] }) }), settingsPane ? (_jsx(SidebarScroll, { children: _jsx(SettingsList, { active: settingsPane, filter: filter, onPick: pick, onBack: () => showSettings(null) }) })) : (_jsx(_Fragment, { children: _jsx(SidebarScroll, { children: _jsxs(_Fragment, { children: [settled ? (_jsx(Index, { mode: mode, owner: owner, filter: filter, onPick: onPick, navigate: navigate })) : null, devMode && products.length ? (_jsx(SidebarFolder, { name: t("Cloud & Platform"), open: filter ? true : undefined, children: products.map((prod) => (_jsx(SidebarItem, { icon: _jsx(prod.icon, { size: 13, "aria-hidden": true }), onPress: () => window.open(prod.href, "_blank", "noopener"), children: t(prod.label) }, prod.id))) })) : null] }) }) })), settled && onApex ? _jsx(Leave, { href: signedIn ? ENTRY : WORKSPACE, children: t("Workspace") }) : null, settled ? (signedIn ? (_jsxs(_Fragment, { children: [free ? (_jsx(SidebarItem, { gap: "$2.5", minH: 34, $touchable: { minH: 44 }, "$max-sm": { minH: 44 }, icon: _jsx(Sparkles, { size: 15, "aria-hidden": true, color: "var(--foreground)" }), onPress: () => {
1478
+ placeholder: t("Filter"), "aria-label": t("Filter sidebar") }), flex: 1, minW: 0, bg: "transparent", borderWidth: 0, outlineStyle: "none", color: "inherit", fontSize: "$2" })] }) }), settingsPane ? (_jsx(SidebarScroll, { children: _jsx(SettingsList, { active: settingsPane, filter: filter, onPick: pick, onBack: () => showSettings(null) }) })) : (_jsx(_Fragment, { children: _jsx(SidebarScroll, { children: _jsxs(_Fragment, { children: [settled ? (_jsx(ShellIndex, { mode: mode, owner: owner, filter: filter, onPick: onPick, navigate: navigate })) : null, devMode && products.length ? (_jsx(SidebarFolder, { name: t("Cloud & Platform"), open: filter ? true : undefined, children: products.map((prod) => (_jsx(SidebarItem, { icon: _jsx(prod.icon, { size: 13, "aria-hidden": true }), onPress: () => window.open(prod.href, "_blank", "noopener"), children: t(prod.label) }, prod.id))) })) : null] }) }) })), settled && onApex ? _jsx(Leave, { href: signedIn ? ENTRY : WORKSPACE, children: t("Workspace") }) : null, settled ? (signedIn ? (_jsxs(_Fragment, { children: [free ? (_jsx(SidebarItem, { gap: "$2.5", minH: 34, $touchable: { minH: 44 }, "$max-sm": { minH: 44 }, icon: _jsx(Sparkles, { size: 15, "aria-hidden": true, color: "var(--foreground)" }), onPress: () => {
1438
1479
  window.location.assign(payUrl("/cart", { returnUrl: window.location.href }));
1439
1480
  dismiss();
1440
1481
  }, children: t("Upgrade plan") })) : null, _jsx(SidebarItem, { gap: "$2.5", minH: 34, $touchable: { minH: 44 }, "$max-sm": { minH: 44 }, icon: _jsx(UserPlus, { size: 15, "aria-hidden": true }), onPress: () => window.open(invite(), "_blank", "noopener"), children: t("Invite teammates") }), _jsx(SidebarItem, { gap: "$2.5", minH: 34, $touchable: { minH: 44 }, "$max-sm": { minH: 44 }, icon: _jsx(Share2, { size: 15, "aria-hidden": true }), onPress: () => {
@@ -1512,7 +1553,7 @@ function Frame({ mode, children, navigate, back, forward, }) {
1512
1553
  gridTemplateColumns: "minmax(0, 1fr)",
1513
1554
  gridTemplateRows: `${SHELL_BAR}px minmax(0, 1fr) ${TABS_HEIGHT}`,
1514
1555
  gridTemplateAreas: '"bar" "pane" "rail"',
1515
- }, position: "relative", width: "100%", flex: 1, minH: 0, overflow: "hidden", bg: "$background", backgroundImage: "var(--pane-ground)", children: [_jsx(Rail, { mode: mode, places: places, open: asked, hiddenOnDesktop: !showDesktopRail, team: onApex ? (signedIn ? ENTRY : WORKSPACE) : undefined, navigate: navigate, onMore: () => setFinding(true), avatarSlot: settled && signedIn ? (_jsx(ShellProfileHover, { name: who.person.name || who.person.email || t("You"), email: who.person.email, avatar: who.person.avatar, orgId: owner || scoped() || "", signedIn: signedIn, onSettings: () => {
1556
+ }, position: "relative", width: "100%", flex: 1, minH: 0, overflow: "hidden", bg: "var(--pane-floor, var(--background))", backgroundImage: "var(--pane-ground)", children: [_jsx(Rail, { mode: mode, places: places, open: asked, hiddenOnDesktop: !showDesktopRail, team: onApex ? (signedIn ? ENTRY : WORKSPACE) : undefined, navigate: navigate, onMore: () => setFinding(true), avatarSlot: settled && signedIn ? (_jsx(ShellProfileHover, { name: who.person.name || who.person.email || t("You"), email: who.person.email, avatar: who.person.avatar, orgId: owner || scoped() || "", signedIn: signedIn, onSettings: () => {
1516
1557
  setAsked(true);
1517
1558
  showSettings(FIRST);
1518
1559
  }, onSignOut: () => void logout(), children: _jsx(XStack, { render: _jsx("button", { type: "button" }), "data-slot": "rail-profile", "aria-label": t("Account: {name}", { name: who.person.name || who.person.email || t("You") }), onClick: () => {
package/dist/Sidebar.js CHANGED
@@ -605,7 +605,7 @@ export function Sidebar({ pins, host, mode, thread, go, onShut, onSeek, onBack,
605
605
  const primaryNewLabel = mode === 'dev' ? t('New run') : mode === 'design' ? t('New design') : mode === 'studio' ? t('New creation') : mode === 'flow' ? t('New flow') : t('New chat');
606
606
  const showPrimaryNew = !at && (mode === 'chat' || (!anon && (mode === 'dev' || mode === 'design' || mode === 'studio' || mode === 'flow')));
607
607
  const showRecents = !(mode === 'hosted' || mode === 'beta' || mode === 'tabs' || mode === 'studio' || mode === 'flow' || anon || at);
608
- return (_jsx(TooltipProvider, { delay: 120, children: _jsxs(YStack, { "data-slot": "app-column", ref: drawer ? undefined : span.ref, ...(drawer ? null : { '$platform-web': { '--span': `${span.span}px`, ...(anon ? { overflow: 'visible' } : null) } }), position: "relative", flex: drawer ? 1 : undefined, shrink: drawer ? 1 : 0, minW: 0, height: "100%", width: drawer ? undefined : `var(--span, ${WIDTH}px)`, maxW: drawer ? undefined : `var(--span, ${WIDTH}px)`, bg: drawer ? undefined : 'var(--side-fill, var(--sheet-2))', rounded: drawer ? undefined : 'var(--pane-round)', borderWidth: drawer ? 0 : 1, borderColor: "var(--pane-edge, var(--edge, var(--white-06)))", children: [_jsxs(Base, { "data-slot": "app-rail", role: "navigation", "aria-label": brand(), bg: "transparent", borderWidth: 0, ...FILL, px: 8, pt: drawer ? 'var(--pane-gap)' : 4, pb: drawer ? 0 : '$2', gap: "$0", "$platform-web": anon && !drawer ? { overflow: 'visible' } : undefined, children: [at ? (_jsxs(XStack, { "data-slot": "app-head", items: "center", gap: 2, paddingInlineStart: 0, paddingInlineEnd: 0, height: drawer ? BAND : LINE, $touchable: drawer ? undefined : { height: TOUCH_HEAD }, shrink: 0, minW: 0, "data-tauri-drag-region": "deep", onMouseDown: dragWindow, onDoubleClick: toggleWindowMaximize, children: [_jsx(SidebarIconButton, { label: t('Back'), "data-slot": "place-back", "data-tauri-drag-region": "false", onPress: onBack, ...SUB_HEAD, children: _jsx(ArrowLeft, { size: 16, "aria-hidden": true, "data-i18n-mirror": true }) }), _jsx(Text, { flex: 1, minW: 0, fontSize: "$3", fontWeight: "600", color: "$ink", numberOfLines: 1, "data-slot": "place-name", children: t(TITLE[at]) }), anon ? null : (_jsx(SidebarIconButton, { label: t('Search'), "data-tauri-drag-region": "false", onPress: onSeek, "aria-haspopup": "dialog", ...SUB_HEAD, children: _jsx(Search, { size: 15, "aria-hidden": true }) })), drawer || !onShut ? null : (_jsx(SidebarIconButton, { label: t('Fold sidebar to icons'), "data-slot": "sidebar-fold", "data-tauri-drag-region": "false", onPress: onShut, ...SUB_HEAD, children: _jsx(PanelLeftClose, { size: 15, "aria-hidden": true, "data-i18n-mirror": true }) }))] })) : (_jsxs(XStack, { "data-slot": "app-head", items: "center", gap: 2, paddingInlineStart: 8, paddingInlineEnd: 2, height: drawer ? BAND : LINE, $touchable: drawer ? undefined : { height: TOUCH_HEAD }, shrink: 0, minW: 0, "data-tauri-drag-region": "deep", onMouseDown: dragWindow, onDoubleClick: toggleWindowMaximize, children: [_jsx(XStack, { flex: 1, minW: 0, items: "center", gap: 4, children: _jsx(Text, { fontSize: "$4", fontWeight: "600", color: "$ink", numberOfLines: 1, children: brand() }) }), drawer || anon ? null : _jsx(Activity, { host: host }), anon ? null : (_jsx(SidebarIconButton, { label: t('Search'), "data-tauri-drag-region": "false", onPress: onSeek, "aria-haspopup": "dialog", ...(drawer
608
+ return (_jsx(TooltipProvider, { delay: 120, children: _jsxs(YStack, { "data-slot": "app-column", ref: drawer ? undefined : span.ref, ...(drawer ? null : { '$platform-web': { '--span': `${span.span}px`, ...(anon ? { overflow: 'visible' } : null) } }), position: "relative", flex: drawer ? 1 : undefined, shrink: drawer ? 1 : 0, minW: 0, height: "100%", width: drawer ? undefined : `var(--span, ${WIDTH}px)`, maxW: drawer ? undefined : `var(--span, ${WIDTH}px)`, bg: drawer ? undefined : 'var(--side-fill, var(--background))', rounded: drawer ? undefined : 'var(--pane-round)', borderWidth: drawer ? 0 : 1, borderColor: "var(--pane-edge, var(--edge, var(--white-08)))", children: [_jsxs(Base, { "data-slot": "app-rail", role: "navigation", "aria-label": brand(), bg: "transparent", borderWidth: 0, ...FILL, px: 8, pt: drawer ? 'var(--pane-gap)' : 4, pb: drawer ? 0 : '$2', gap: "$0", "$platform-web": anon && !drawer ? { overflow: 'visible' } : undefined, children: [at ? (_jsxs(XStack, { "data-slot": "app-head", items: "center", gap: 2, paddingInlineStart: 0, paddingInlineEnd: 0, height: drawer ? BAND : LINE, $touchable: drawer ? undefined : { height: TOUCH_HEAD }, shrink: 0, minW: 0, "data-tauri-drag-region": "deep", onMouseDown: dragWindow, onDoubleClick: toggleWindowMaximize, children: [_jsx(SidebarIconButton, { label: t('Back'), "data-slot": "place-back", "data-tauri-drag-region": "false", onPress: onBack, ...SUB_HEAD, children: _jsx(ArrowLeft, { size: 16, "aria-hidden": true, "data-i18n-mirror": true }) }), _jsx(Text, { flex: 1, minW: 0, fontSize: "$3", fontWeight: "600", color: "$ink", numberOfLines: 1, "data-slot": "place-name", children: t(TITLE[at]) }), anon ? null : (_jsx(SidebarIconButton, { label: t('Search'), "data-tauri-drag-region": "false", onPress: onSeek, "aria-haspopup": "dialog", ...SUB_HEAD, children: _jsx(Search, { size: 15, "aria-hidden": true }) })), drawer || !onShut ? null : (_jsx(SidebarIconButton, { label: t('Fold sidebar to icons'), "data-slot": "sidebar-fold", "data-tauri-drag-region": "false", onPress: onShut, ...SUB_HEAD, children: _jsx(PanelLeftClose, { size: 15, "aria-hidden": true, "data-i18n-mirror": true }) }))] })) : (_jsxs(XStack, { "data-slot": "app-head", items: "center", gap: 2, paddingInlineStart: 8, paddingInlineEnd: 2, height: drawer ? BAND : LINE, $touchable: drawer ? undefined : { height: TOUCH_HEAD }, shrink: 0, minW: 0, "data-tauri-drag-region": "deep", onMouseDown: dragWindow, onDoubleClick: toggleWindowMaximize, children: [_jsx(XStack, { flex: 1, minW: 0, items: "center", gap: 4, children: _jsx(Text, { fontSize: "$4", fontWeight: "600", color: "$ink", numberOfLines: 1, children: brand() }) }), drawer || anon ? null : _jsx(Activity, { host: host }), anon ? null : (_jsx(SidebarIconButton, { label: t('Search'), "data-tauri-drag-region": "false", onPress: onSeek, "aria-haspopup": "dialog", ...(drawer
609
609
  ? {
610
610
  width: 40,
611
611
  height: 40,
package/dist/bots/Bots.js CHANGED
@@ -12,9 +12,13 @@ import { useCallback, useEffect, useMemo, useRef, useState } from 'react';
12
12
  import { useIam } from '@hanzo/iam/react';
13
13
  import { useI18n } from '@hanzo/i18n/react';
14
14
  import { XStack, YStack } from '@hanzo/gui';
15
+ import { Gutter } from '@hanzo/build';
15
16
  import { ENSO, useAi } from '../lib/ai.js';
17
+ import { SIDE } from '../ground.js';
16
18
  import { useKept } from '../kept.js';
19
+ import { useSpan } from '../span.js';
17
20
  import { say } from '../failure.js';
21
+ import { ROSTER_WIDTH_MAX, ROSTER_WIDTH_MIN } from './grid.js';
18
22
  import { Roster } from './Roster.js';
19
23
  import { Thread } from './Thread.js';
20
24
  import { GroupPanel, GroupThread, MakeGroupDialog } from './Groups.js';
@@ -80,6 +84,11 @@ export function Bots({ foot = true, bot: held, onBot, } = {}) {
80
84
  const [over, setOver] = useState(false);
81
85
  const wide = useWide('(min-width: 768px)');
82
86
  const laptop = useWide('(min-width: 1280px)');
87
+ const rosterSpan = useSpan('hanzo.bots.roster.width', SIDE, ROSTER_WIDTH_MIN, ROSTER_WIDTH_MAX);
88
+ const [rosterWidth, setRosterWidth] = useState(SIDE);
89
+ useEffect(() => {
90
+ setRosterWidth(rosterSpan.span);
91
+ }, [rosterSpan.span]);
83
92
  useEffect(() => {
84
93
  if (hosted)
85
94
  return;
@@ -324,7 +333,13 @@ export function Bots({ foot = true, bot: held, onBot, } = {}) {
324
333
  const panel = activeGroup ? (_jsx(GroupPanel, { group: activeGroup, groups: groups, bots: bots ?? [], onClose: close, onEdit: () => setEditingGroup(activeGroup), onDelete: removeGroup, onPickBot: pick }, `grp:${activeGroup.name}`)) : bot ? (_jsx(Panel, { bot: bot, groups: groups, runs: runs ?? [], kept: kept[bot.name] ?? '', onClose: close, onSchedule: schedule, onDelete: remove, onBotChanged: read, onPickGroup: pick, focus: over && !laptop }, bot.name)) : null;
325
334
  const shown = laptop ? side : over;
326
335
  const hasSelection = Boolean(bot || activeGroup);
327
- return (_jsxs(XStack, { "data-parity-key": "bots.window", width: "100%", height: "100%", overflow: "hidden", bg: FLOOR, position: "relative", children: [_jsx(YStack, { "data-parity-key": "bots.roster", width: 260, shrink: 0, height: "100%", bg: FLOOR, borderRightWidth: 1, borderColor: LINE, "$max-md": { width: '100%', borderRightWidth: 0, display: hasSelection ? 'none' : 'flex' }, children: _jsx(Roster, { bots: bots, groups: groups, last: last, open: openRef, unread: unread, me: foot ? user : null, onPick: pick, onMake: () => setMaking(true), onMakeGroup: () => setMakingGroup(true), disabled: !live }) }), _jsx(YStack, { "data-parity-key": "bots.center", flex: 1, minW: 0, height: "100%", bg: GROUND, "$max-md": { display: hasSelection ? 'flex' : 'none' }, children: activeGroup ? (_jsx(GroupThread, { group: activeGroup, bots: bots ?? [], side: shown, onSide: () => (laptop ? setSide(!side) : setOver(!over)), onBack: back, onEdit: () => setEditingGroup(activeGroup), onPickBot: pick }, activeGroup.name)) : (_jsx(Thread, { bot: bot, bots: bots ?? [], runs: runs, pending: pending, notice: notice, wrong: wrong, side: shown, live: live, loaded: bots !== null, onSend: send, onDismiss: () => setNotice(null), onSide: () => (laptop ? setSide(!side) : setOver(!over)), onBack: back, onMake: () => setMaking(true) })) }), laptop && side && panel ? (_jsx(YStack, { "data-parity-key": "bots.panel", width: 312, minW: 300, shrink: 0, height: "100%", bg: GROUND, borderLeftWidth: 1, borderColor: LINE, "$max-xl": { display: 'none' }, children: panel })) : null, over && panel && !laptop ? (_jsx(YStack, { "data-parity-key": "bots.panel.over", role: "dialog", "aria-modal": true, "aria-label": activeGroup?.name || bot?.name, position: "absolute", t: 0, r: 0, b: 0, width: 312, minW: 300, "$max-sm": { minW: 0 }, maxW: "100%", z: 10, bg: GROUND, borderLeftWidth: 1, borderColor: LINE, boxShadow: "var(--shadow-floating)", children: panel })) : null, making ? _jsx(Make, { groups: groups, onDone: made, onCancel: () => setMaking(false) }) : null, makingGroup || editingGroup ? (_jsx(MakeGroupDialog, { bots: bots ?? [], groups: groups, initial: editingGroup, onDone: savedGroup, onCancel: () => {
336
+ return (_jsxs(XStack, { "data-parity-key": "bots.window", width: "100%", height: "100%", overflow: "hidden", bg: FLOOR, position: "relative", children: [_jsxs(YStack, { ref: rosterSpan.ref, "data-parity-key": "bots.roster", position: "relative", width: rosterWidth, shrink: 0, height: "100%", bg: FLOOR, borderRightWidth: 1, borderColor: LINE, "$max-md": { width: '100%', borderRightWidth: 0, display: hasSelection ? 'none' : 'flex' }, children: [_jsx(Roster, { bots: bots, groups: groups, last: last, open: openRef, unread: unread, me: foot ? user : null, width: rosterWidth, onPick: pick, onMake: () => setMaking(true), onMakeGroup: () => setMakingGroup(true), disabled: !live }), wide ? (_jsx(Gutter, { side: "left", span: rosterWidth, floor: ROSTER_WIDTH_MIN, ceil: ROSTER_WIDTH_MAX, reset: SIDE, onSpan: (n) => {
337
+ rosterSpan.move(n);
338
+ setRosterWidth(n);
339
+ }, onKeep: (n) => {
340
+ rosterSpan.keep(n);
341
+ setRosterWidth(n);
342
+ }, label: t('Resize bots sidebar') })) : null] }), _jsx(YStack, { "data-parity-key": "bots.center", flex: 1, minW: 0, height: "100%", bg: GROUND, "$max-md": { display: hasSelection ? 'flex' : 'none' }, children: activeGroup ? (_jsx(GroupThread, { group: activeGroup, bots: bots ?? [], side: shown, onSide: () => (laptop ? setSide(!side) : setOver(!over)), onBack: back, onEdit: () => setEditingGroup(activeGroup), onPickBot: pick }, activeGroup.name)) : (_jsx(Thread, { bot: bot, bots: bots ?? [], runs: runs, pending: pending, notice: notice, wrong: wrong, side: shown, live: live, loaded: bots !== null, onSend: send, onDismiss: () => setNotice(null), onSide: () => (laptop ? setSide(!side) : setOver(!over)), onBack: back, onMake: () => setMaking(true) })) }), laptop && side && panel ? (_jsx(YStack, { "data-parity-key": "bots.panel", width: 312, minW: 300, shrink: 0, height: "100%", bg: GROUND, borderLeftWidth: 1, borderColor: LINE, "$max-xl": { display: 'none' }, children: panel })) : null, over && panel && !laptop ? (_jsx(YStack, { "data-parity-key": "bots.panel.over", role: "dialog", "aria-modal": true, "aria-label": activeGroup?.name || bot?.name, position: "absolute", t: 0, r: 0, b: 0, width: 312, minW: 300, "$max-sm": { minW: 0 }, maxW: "100%", z: 10, bg: GROUND, borderLeftWidth: 1, borderColor: LINE, boxShadow: "var(--shadow-floating)", children: panel })) : null, making ? _jsx(Make, { groups: groups, onDone: made, onCancel: () => setMaking(false) }) : null, makingGroup || editingGroup ? (_jsx(MakeGroupDialog, { bots: bots ?? [], groups: groups, initial: editingGroup, onDone: savedGroup, onCancel: () => {
328
343
  setMakingGroup(false);
329
344
  setEditingGroup(null);
330
345
  } })) : null] }));
@@ -1,14 +1,17 @@
1
1
  import type { Agent, AgentRun } from '@hanzo/ai';
2
2
  import { type BotGroup } from './api.js';
3
- export declare function Roster({ bots, groups, last, open, unread, me, onPick, onMake, onMakeGroup, disabled, }: {
3
+ export declare function Roster({ bots, groups, last, open, unread, me, width, onPick, onMake, onMakeGroup, onWorkflows, disabled, }: {
4
4
  bots: Agent[] | null;
5
5
  groups?: readonly BotGroup[];
6
6
  last: ReadonlyMap<string, AgentRun>;
7
7
  open: string | null;
8
8
  unread: string | null;
9
9
  me: unknown;
10
+ /** Live sidebar width in px, driving the 1 → 2 → 3 column Pinned Bots grid. */
11
+ width?: number;
10
12
  onPick: (name: string) => void;
11
13
  onMake: () => void;
12
14
  onMakeGroup?: () => void;
15
+ onWorkflows?: () => void;
13
16
  disabled: boolean;
14
17
  }): import("react").JSX.Element;
@@ -1,14 +1,17 @@
1
1
  'use client';
2
2
  import { Fragment as _Fragment, jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
3
- // The roster: search, + Group, and + New bot at the top; Primary Bot ("hanzo")
4
- // leading the 3x4 grid of faces; layered Bot Groups (Layer 1, Layer 2+) with
5
- // policy badges; the remaining bots as rows with their last word; and the reader
6
- // + Connectors + Preferences at the foot.
7
- import { useEffect, useMemo, useState } from 'react';
3
+ // The roster: search, density/column menu, + Group, and + New bot at the top;
4
+ // Pinned Bots in a 1→2→3 column resizable grid with 4 avatar sizes (xs/sm/md/lg);
5
+ // a monochrome hairline divider; layered Bot Groups (GROUPS & LAYERS); unpinned
6
+ // bots in single-column rows; a subtle /flow Workflows entry; and the reader +
7
+ // Connectors + Preferences at the foot.
8
+ import { useCallback, useEffect, useMemo, useState } from 'react';
8
9
  import { useI18n } from '@hanzo/i18n/react';
9
10
  import { Input, Text, XStack, YStack } from '@hanzo/gui';
10
11
  import { DropdownMenu, DropdownMenuContent, DropdownMenuItem, DropdownMenuLabel, DropdownMenuSeparator, DropdownMenuTrigger, } from '@hanzo/ui';
11
- import { ArrowLeft, Grid2x2Plus, Layers, Plus, Search, SlidersHorizontal, Users, X } from 'lucide-react';
12
+ import { ArrowLeft, Check, Grid2x2Plus, Layers, LayoutGrid, Pin, PinOff, Plus, Search, SlidersHorizontal, Users, Workflow, X, } from 'lucide-react';
13
+ import { useKept } from '../kept.js';
14
+ import { FLOW } from '../lib/host.js';
12
15
  import { useSignOut } from '../lib/signout.js';
13
16
  import { PreferencesDialog } from '../PreferencesDialog.js';
14
17
  import { called } from '../team.js';
@@ -17,11 +20,25 @@ import { Face } from './face.js';
17
20
  import { PRIMARY_BOT, toGroupRef } from './api.js';
18
21
  import { CLIP, PILL, ROUND, WORD } from './kit.js';
19
22
  import { DIM, FLOOR, INK, LINE, PICKED, RAISED } from './ink.js';
20
- import { isStarredBot, lastWord, policyBadge, sortGroupsByLayer, split } from './grid.js';
21
- export function Roster({ bots, groups = [], last, open, unread, me, onPick, onMake, onMakeGroup, disabled, }) {
23
+ import { avatarSizePx, BOT_AVATAR_PX, BOT_ICON_SIZES, defaultPinnedNames, isBotIconSize, isStarredBot, lastWord, partitionPinned, policyBadge, resolveColumns, ROSTER_WIDTH_DEFAULT, sortGroupsByLayer, togglePinnedBot, } from './grid.js';
24
+ const SIZE_LABELS = {
25
+ xs: 'XS',
26
+ sm: 'SM',
27
+ md: 'MD',
28
+ lg: 'LG',
29
+ };
30
+ const COL_OPTIONS = ['auto', 1, 2, 3];
31
+ export function Roster({ bots, groups = [], last, open, unread, me, width = ROSTER_WIDTH_DEFAULT, onPick, onMake, onMakeGroup, onWorkflows, disabled, }) {
22
32
  const { t } = useI18n();
23
33
  const [seeking, setSeeking] = useState(false);
24
34
  const [query, setQuery] = useState('');
35
+ const [storedSize, setIconSize] = useKept('hanzo.bots.roster.iconSize', 'md');
36
+ const [storedCols, setColPref] = useKept('hanzo.bots.roster.cols', 'auto');
37
+ const [pinnedNames, setPinnedNames] = useKept('hanzo.bots.roster.pinned', null);
38
+ const iconSize = isBotIconSize(storedSize) ? storedSize : 'md';
39
+ const colPref = storedCols === 'auto' || storedCols === 1 || storedCols === 2 || storedCols === 3 ? storedCols : 'auto';
40
+ const cols = resolveColumns(width, colPref);
41
+ const avatarPx = avatarSizePx(iconSize);
25
42
  const shown = useMemo(() => {
26
43
  const q = query.trim().toLowerCase();
27
44
  const all = bots ?? [];
@@ -40,8 +57,28 @@ export function Roster({ bots, groups = [], last, open, unread, me, onPick, onMa
40
57
  (g.description ?? '').toLowerCase().includes(q) ||
41
58
  policyBadge(g.policy).toLowerCase().includes(q));
42
59
  }, [groups, query]);
43
- const { grid, rows } = useMemo(() => split(shown, last), [shown, last]);
44
- return (_jsxs(YStack, { flex: 1, minH: 0, position: "relative", children: [_jsxs(XStack, { "data-parity-key": "bots.roster.bar", minH: 46, "$max-sm": { minH: 52, px: 10 }, shrink: 0, px: 12, items: "center", justify: "space-between", gap: 8, children: [_jsx(XStack, { items: "center", gap: 6, pl: 2, minW: 0, children: me ? (_jsxs(XStack, { render: _jsx("a", { href: "/chat", "aria-label": t('Back to chat') }), items: "center", gap: 6, px: 6, py: 4, ml: -4, rounded: 8, transition: "quickest", hoverStyle: { bg: PICKED }, focusVisibleStyle: { outlineWidth: 2, outlineStyle: 'solid', outlineColor: 'var(--ring)' }, "$max-sm": { minH: 44 }, "$platform-web": { textDecoration: 'none' }, children: [_jsx(ArrowLeft, { size: 14, color: DIM, "aria-hidden": true }), _jsx(Text, { fontSize: 13, lineHeight: 18, fontWeight: "600", color: INK, children: t('hanzo.bot') })] })) : (_jsx(Text, { fontSize: 13, lineHeight: 18, fontWeight: "600", color: DIM, children: t('hanzo.bot') })) }), _jsxs(XStack, { items: "center", gap: 6, shrink: 0, children: [_jsx(XStack, { ...ROUND, borderColor: "var(--border-strong)", focusVisibleStyle: { outlineWidth: 2, outlineStyle: 'solid', outlineColor: 'var(--ring)' }, "$max-sm": { width: 44, height: 44 }, "aria-label": t(seeking ? 'Close search' : 'Search bots'), "aria-pressed": seeking, onClick: () => {
60
+ const { pinned, unpinned } = useMemo(() => partitionPinned(shown, last, pinnedNames), [shown, last, pinnedNames]);
61
+ const togglePin = useCallback((name) => {
62
+ const base = pinnedNames ?? defaultPinnedNames(bots ?? []);
63
+ setPinnedNames(togglePinnedBot(base, name));
64
+ }, [bots, pinnedNames, setPinnedNames]);
65
+ const openWorkflows = () => {
66
+ if (onWorkflows) {
67
+ onWorkflows();
68
+ return;
69
+ }
70
+ if (typeof window !== 'undefined')
71
+ window.location.assign(FLOW);
72
+ };
73
+ const showWorkflows = !query.trim() || 'workflows'.includes(query.trim().toLowerCase()) || 'flow'.includes(query.trim().toLowerCase());
74
+ return (_jsxs(YStack, { flex: 1, minH: 0, position: "relative", children: [_jsxs(XStack, { "data-parity-key": "bots.roster.bar", minH: 46, "$max-sm": { minH: 52, px: 10 }, shrink: 0, px: 12, items: "center", justify: "space-between", gap: 8, children: [_jsx(XStack, { items: "center", gap: 6, pl: 2, minW: 0, children: me ? (_jsxs(XStack, { render: _jsx("a", { href: "/chat", "aria-label": t('Back to chat') }), items: "center", gap: 6, px: 6, py: 4, ml: -4, rounded: 8, transition: "quickest", hoverStyle: { bg: PICKED }, focusVisibleStyle: { outlineWidth: 2, outlineStyle: 'solid', outlineColor: 'var(--ring)' }, "$max-sm": { minH: 44 }, "$platform-web": { textDecoration: 'none' }, children: [_jsx(ArrowLeft, { size: 14, color: DIM, "aria-hidden": true }), _jsx(Text, { ...CLIP, fontSize: 13, lineHeight: 18, fontWeight: "600", color: INK, children: t('hanzo.bot') })] })) : (_jsx(Text, { ...CLIP, fontSize: 13, lineHeight: 18, fontWeight: "600", color: DIM, children: t('hanzo.bot') })) }), _jsxs(XStack, { items: "center", gap: 6, shrink: 0, children: [_jsxs(DropdownMenu, { placement: "bottom-end", offset: 6, children: [_jsx(DropdownMenuTrigger, { asChild: true, children: _jsx(XStack, { ...ROUND, borderColor: "var(--border-strong)", focusVisibleStyle: { outlineWidth: 2, outlineStyle: 'solid', outlineColor: 'var(--ring)' }, "$max-sm": { width: 44, height: 44 }, "data-slot": "bots-density-trigger", "aria-label": t('Sidebar layout'), children: _jsx(LayoutGrid, { size: 14, color: INK, "aria-hidden": true }) }) }), _jsxs(DropdownMenuContent, { minW: 196, "aria-label": t('Sidebar layout'), children: [_jsx(DropdownMenuLabel, { children: _jsx(Text, { fontSize: 11, color: DIM, fontWeight: "600", children: t('Avatar size') }) }), BOT_ICON_SIZES.map((sz) => {
75
+ const active = iconSize === sz;
76
+ return (_jsx(DropdownMenuItem, { "data-slot": `bots-size-${sz}`, onSelect: () => setIconSize(sz), children: _jsxs(XStack, { flex: 1, items: "center", justify: "space-between", gap: 8, children: [_jsx(Text, { fontSize: 13, color: INK, fontWeight: active ? '600' : '400', children: `${SIZE_LABELS[sz]} · ${BOT_AVATAR_PX[sz]}px` }), active ? _jsx(Check, { size: 13, color: INK, "aria-hidden": true }) : null] }) }, sz));
77
+ }), _jsx(DropdownMenuSeparator, {}), _jsx(DropdownMenuLabel, { children: _jsx(Text, { fontSize: 11, color: DIM, fontWeight: "600", children: t('Pinned columns') }) }), COL_OPTIONS.map((opt) => {
78
+ const active = colPref === opt;
79
+ const label = opt === 'auto' ? t('Auto (1–3)') : opt === 1 ? t('1 column') : t('{n} columns', { n: opt });
80
+ return (_jsx(DropdownMenuItem, { "data-slot": `bots-cols-${opt}`, onSelect: () => setColPref(opt), children: _jsxs(XStack, { flex: 1, items: "center", justify: "space-between", gap: 8, children: [_jsx(Text, { fontSize: 13, color: INK, fontWeight: active ? '600' : '400', children: label }), active ? _jsx(Check, { size: 13, color: INK, "aria-hidden": true }) : null] }) }, String(opt)));
81
+ })] })] }), _jsx(XStack, { ...ROUND, borderColor: "var(--border-strong)", focusVisibleStyle: { outlineWidth: 2, outlineStyle: 'solid', outlineColor: 'var(--ring)' }, "$max-sm": { width: 44, height: 44 }, "aria-label": t(seeking ? 'Close search' : 'Search bots'), "aria-pressed": seeking, onClick: () => {
45
82
  setSeeking(!seeking);
46
83
  setQuery('');
47
84
  }, children: seeking ? _jsx(X, { size: 16, color: INK, "aria-hidden": true }) : _jsx(Search, { size: 16, color: INK, "aria-hidden": true }) }), onMakeGroup ? (_jsx(XStack, { ...ROUND, borderColor: "var(--border-strong)", focusVisibleStyle: { outlineWidth: 2, outlineStyle: 'solid', outlineColor: 'var(--ring)' }, "$max-sm": { width: 44, height: 44 }, "aria-label": t('New bot group'), onClick: onMakeGroup, disabled: disabled, opacity: disabled ? 0.5 : 1, children: _jsx(Users, { size: 15, color: INK, "aria-hidden": true }) })) : null, _jsx(XStack, { ...ROUND, borderColor: "var(--border-strong)", focusVisibleStyle: { outlineWidth: 2, outlineStyle: 'solid', outlineColor: 'var(--ring)' }, "$max-sm": { width: 44, height: 44 }, "aria-label": t('New bot'), onClick: onMake, disabled: disabled, opacity: disabled ? 0.5 : 1, children: _jsx(Plus, { size: 18, color: INK, "aria-hidden": true }) })] })] }), seeking ? (_jsx(XStack, { px: 10, pb: 8, shrink: 0, children: _jsx(Input, { unstyled: true, autoFocus: true, value: query, onChange: (e) => setQuery(e.target.value), onKeyDown: (e) => {
@@ -49,22 +86,26 @@ export function Roster({ bots, groups = [], last, open, unread, me, onPick, onMa
49
86
  setSeeking(false);
50
87
  setQuery('');
51
88
  }
52
- }, placeholder: t('Search bots & groups'), "aria-label": t('Search bots'), width: "100%", height: 34, "$max-sm": { minH: 44 }, px: 12, rounded: 999, bg: RAISED, borderWidth: 1, borderColor: "var(--border-strong)", focusStyle: { borderColor: 'var(--ring)' }, color: INK, fontSize: 14, placeholderTextColor: "$placeholderColor" }) })) : null, _jsxs(YStack, { flex: 1, minH: 0, position: "relative", children: [_jsxs(YStack, { flex: 1, minH: 0, overflowY: "auto", overflowX: "hidden", children: [unread ? (_jsx(Text, { render: "p", px: 16, py: 8, fontSize: 13, lineHeight: 18, color: DIM, children: unread })) : null, bots && bots.length === 0 && !unread && !disabled ? (_jsxs(YStack, { display: "none", "$max-md": { display: 'flex' }, flex: 1, items: "center", justify: "center", gap: 18, pt: 24, pb: 64, px: 20, children: [_jsxs(YStack, { items: "center", gap: 6, maxW: 320, children: [_jsx(Text, { render: "h2", m: 0, fontSize: 21, lineHeight: 26, fontWeight: "600", letterSpacing: -0.42, color: INK, text: "center", children: t('Make your first bot') }), _jsx(Text, { fontSize: 14, lineHeight: 20, color: DIM, text: "center", children: t('Give it instructions and tools, then message it right here.') })] }), _jsx(XStack, { ...PILL, bg: INK, borderColor: INK, minH: 38, "$max-sm": { minH: 44, px: 18 }, hoverStyle: { opacity: 0.9 }, focusVisibleStyle: { outlineWidth: 2, outlineStyle: 'solid', outlineColor: 'var(--ring)' }, onClick: onMake, children: _jsx(Text, { ...WORD, fontWeight: "600", color: "var(--background)", children: t('New bot') }) })] })) : null, grid.length ? (_jsx(XStack, { "data-parity-key": "bots.grid", role: "group", "aria-label": t('Bots'), flexWrap: "wrap", px: 9, pt: 6, pb: 4, columnGap: 3, rowGap: 10, "$max-md": { px: 12, columnGap: 0, justify: 'space-between' }, children: grid.map((b) => {
53
- const ext = b;
54
- const here = b.name === open;
55
- const isPrimary = Boolean(ext.isPrimary || b.name.toLowerCase() === PRIMARY_BOT);
56
- const label = called(b.name);
57
- return (_jsxs(YStack, { render: _jsx("button", { type: "button" }), "data-parity-key": "bots.tile", "data-name": b.name, "data-primary": isPrimary ? 'true' : undefined, "aria-current": here, "aria-label": isPrimary ? `${label} (${t('Primary bot')})` : label, onClick: () => onPick(b.name), width: 78, height: 96, rounded: 11, items: "center", pt: 5, gap: 3, bg: here ? PICKED : 'transparent', borderWidth: 1, borderColor: here ? 'var(--border-strong)' : 'transparent', cursor: "pointer", transition: "quickest", hoverStyle: { bg: here ? PICKED : 'var(--rail-hover, var(--muted))' }, focusVisibleStyle: { outlineWidth: 2, outlineStyle: 'solid', outlineColor: 'var(--ring)' }, "$max-md": { width: '33%' }, children: [_jsx(Face, { bot: b, size: 54, starred: isStarredBot(b) }), _jsx(Text, { ...CLIP, maxW: 72, fontSize: 13, lineHeight: 16, fontWeight: here || isPrimary ? '600' : '400', color: INK, children: label }), isPrimary ? (_jsx(Text, { fontSize: 11, lineHeight: 13, color: DIM, children: t('Primary') })) : null] }, b.id || b.name));
58
- }) })) : null, query.trim() && shown.length === 0 && shownGroups.length === 0 ? (_jsx(YStack, { px: 16, py: 32, items: "center", gap: 6, children: _jsx(Text, { fontSize: 13, lineHeight: 18, color: DIM, text: "center", children: t('No bots match “{query}”.', { query: query.trim() }) }) })) : null, shownGroups.length > 0 || (!query.trim() && onMakeGroup && !disabled) ? (_jsxs(YStack, { "data-parity-key": "bots.groups", role: "group", "aria-label": t('Bot groups'), mt: grid.length ? 14 : 4, pt: grid.length ? 14 : 6, pb: 6, borderTopWidth: grid.length ? 1 : 0, borderColor: LINE, gap: 4, children: [_jsxs(XStack, { px: 16, pb: 4, items: "center", justify: "space-between", children: [_jsxs(XStack, { items: "center", gap: 6, children: [_jsx(Layers, { size: 12, color: DIM, "aria-hidden": true }), _jsx(Text, { fontSize: 12, lineHeight: 16, fontWeight: "600", color: DIM, children: t('Groups & layers') })] }), onMakeGroup && !disabled ? (_jsxs(XStack, { render: _jsx("button", { type: "button" }), onClick: onMakeGroup, items: "center", gap: 4, px: 7, py: 3, rounded: 6, bg: "transparent", borderWidth: 0, cursor: "pointer", transition: "quickest", hoverStyle: { bg: PICKED }, focusVisibleStyle: { outlineWidth: 2, outlineStyle: 'solid', outlineColor: 'var(--ring)' }, "$max-sm": { minH: 44, px: 10 }, children: [_jsx(Plus, { size: 12, color: DIM, "aria-hidden": true }), _jsx(Text, { fontSize: 12, lineHeight: 16, color: DIM, children: t('Group') })] })) : null] }), shownGroups.length === 0 && onMakeGroup && !disabled ? (_jsxs(XStack, { render: _jsx("button", { type: "button" }), onClick: onMakeGroup, mx: 10, px: 12, py: 9, "$max-sm": { minH: 48 }, rounded: 10, items: "center", gap: 10, bg: RAISED, borderWidth: 1, borderColor: LINE, cursor: "pointer", transition: "quickest", hoverStyle: { bg: PICKED, borderColor: 'var(--border-strong)' }, focusVisibleStyle: { outlineWidth: 2, outlineStyle: 'solid', outlineColor: 'var(--ring)' }, children: [_jsx(Users, { size: 15, color: DIM, "aria-hidden": true }), _jsxs(YStack, { flex: 1, minW: 0, items: "flex-start", gap: 2, children: [_jsx(Text, { ...CLIP, fontSize: 13, lineHeight: 17, fontWeight: "500", color: INK, children: t('Create a bot group') }), _jsx(Text, { ...CLIP, fontSize: 12, lineHeight: 16, color: DIM, children: t('Leader, Lux Quasar, or majority layers') })] })] })) : null, shownGroups.map((g) => {
89
+ }, placeholder: t('Search bots & groups'), "aria-label": t('Search bots'), width: "100%", height: 34, "$max-sm": { minH: 44 }, px: 12, rounded: 999, bg: RAISED, borderWidth: 1, borderColor: "var(--border-strong)", focusStyle: { borderColor: 'var(--ring)' }, color: INK, fontSize: 14, placeholderTextColor: "$placeholderColor" }) })) : null, _jsxs(YStack, { flex: 1, minH: 0, position: "relative", children: [_jsxs(YStack, { flex: 1, minH: 0, overflowY: "auto", overflowX: "hidden", children: [unread ? (_jsx(Text, { render: "p", px: 16, py: 8, fontSize: 13, lineHeight: 18, color: DIM, children: unread })) : null, bots && bots.length === 0 && !unread && !disabled ? (_jsxs(YStack, { display: "none", "$max-md": { display: 'flex' }, flex: 1, items: "center", justify: "center", gap: 18, pt: 24, pb: 64, px: 20, children: [_jsxs(YStack, { items: "center", gap: 6, maxW: 320, children: [_jsx(Text, { render: "h2", m: 0, fontSize: 21, lineHeight: 26, fontWeight: "600", letterSpacing: -0.42, color: INK, text: "center", children: t('Make your first bot') }), _jsx(Text, { fontSize: 14, lineHeight: 20, color: DIM, text: "center", children: t('Give it instructions and tools, then message it right here.') })] }), _jsx(XStack, { ...PILL, bg: INK, borderColor: INK, minH: 38, "$max-sm": { minH: 44, px: 18 }, hoverStyle: { opacity: 0.9 }, focusVisibleStyle: { outlineWidth: 2, outlineStyle: 'solid', outlineColor: 'var(--ring)' }, onClick: onMake, children: _jsx(Text, { ...WORD, fontWeight: "600", color: "var(--background)", children: t('New bot') }) })] })) : null, pinned.length ? (_jsxs(YStack, { "data-slot": "bots-pinned", "data-cols": cols, "data-icon-size": iconSize, "data-avatar-px": avatarPx, pt: 2, pb: 10, children: [_jsxs(XStack, { px: 14, pb: 6, items: "center", justify: "space-between", children: [_jsxs(XStack, { items: "center", gap: 5, children: [_jsx(Pin, { size: 11, color: DIM, "aria-hidden": true }), _jsx(Text, { fontSize: 11, lineHeight: 15, fontWeight: "600", color: DIM, children: t('PINNED') })] }), _jsx(Text, { fontSize: 10, lineHeight: 14, color: DIM, children: `${SIZE_LABELS[iconSize]} · ${cols}c` })] }), _jsx(YStack, { "data-parity-key": "bots.grid", role: "group", "aria-label": t('Pinned bots'), display: "grid", gridTemplateColumns: `repeat(${cols}, minmax(0, 1fr))`, "$max-md": colPref === 'auto' ? { gridTemplateColumns: 'repeat(3, minmax(0, 1fr))' } : undefined, px: 8, gap: cols === 1 ? 4 : 6, minW: 0, children: pinned.map((b) => {
90
+ const ext = b;
91
+ const here = b.name === open;
92
+ const isPrimary = Boolean(ext.isPrimary || b.name.toLowerCase() === PRIMARY_BOT);
93
+ const label = called(b.name);
94
+ const nameFont = iconSize === 'xs' ? 11 : iconSize === 'sm' ? 12 : 13;
95
+ if (cols === 1) {
96
+ return (_jsxs(XStack, { "data-parity-key": "bots.tile", "data-name": b.name, "data-primary": isPrimary ? 'true' : undefined, items: "center", gap: 8, px: 8, py: iconSize === 'xs' ? 5 : 6, rounded: 10, bg: here ? PICKED : 'transparent', borderWidth: 1, borderColor: here ? 'var(--border-strong)' : 'transparent', transition: "quickest", hoverStyle: { bg: here ? PICKED : 'var(--rail-hover, var(--muted))' }, children: [_jsxs(XStack, { render: _jsx("button", { type: "button" }), "aria-current": here, "aria-label": isPrimary ? `${label} (${t('Primary bot')})` : label, onClick: () => onPick(b.name), flex: 1, minW: 0, items: "center", gap: 8, p: 0, bg: "transparent", borderWidth: 0, cursor: "pointer", focusVisibleStyle: { outlineWidth: 2, outlineStyle: 'solid', outlineColor: 'var(--ring)' }, children: [_jsx(Face, { bot: b, size: avatarPx, starred: isStarredBot(b) }), _jsxs(YStack, { flex: 1, minW: 0, items: "flex-start", children: [_jsx(Text, { ...CLIP, maxW: "100%", fontSize: nameFont, lineHeight: 16, fontWeight: here || isPrimary ? '600' : '500', color: INK, children: label }), isPrimary ? (_jsx(Text, { fontSize: 11, lineHeight: 13, color: DIM, children: t('Primary') })) : null] })] }), _jsx(XStack, { render: _jsx("button", { type: "button" }), "data-slot": "bots-unpin", "aria-label": t('Unpin {name}', { name: label }), onClick: () => togglePin(b.name), width: 22, height: 22, shrink: 0, rounded: 6, items: "center", justify: "center", bg: "transparent", borderWidth: 0, cursor: "pointer", opacity: 0.55, transition: "quickest", hoverStyle: { opacity: 1, bg: PICKED }, focusVisibleStyle: { opacity: 1, outlineWidth: 2, outlineStyle: 'solid', outlineColor: 'var(--ring)' }, children: _jsx(PinOff, { size: 11, color: DIM, "aria-hidden": true }) })] }, b.id || b.name));
97
+ }
98
+ return (_jsxs(YStack, { position: "relative", "data-parity-key": "bots.tile", "data-name": b.name, "data-primary": isPrimary ? 'true' : undefined, rounded: 11, bg: here ? PICKED : 'transparent', borderWidth: 1, borderColor: here ? 'var(--border-strong)' : 'transparent', transition: "quickest", hoverStyle: { bg: here ? PICKED : 'var(--rail-hover, var(--muted))' }, children: [_jsxs(YStack, { render: _jsx("button", { type: "button" }), "aria-current": here, "aria-label": isPrimary ? `${label} (${t('Primary bot')})` : label, onClick: () => onPick(b.name), width: "100%", minW: 0, rounded: 10, items: "center", pt: iconSize === 'xs' ? 6 : 8, pb: iconSize === 'xs' ? 5 : 7, px: 4, gap: iconSize === 'xs' ? 3 : 5, bg: "transparent", borderWidth: 0, cursor: "pointer", focusVisibleStyle: { outlineWidth: 2, outlineStyle: 'solid', outlineColor: 'var(--ring)' }, children: [_jsx(Face, { bot: b, size: avatarPx, starred: isStarredBot(b) }), _jsx(Text, { ...CLIP, maxW: "100%", fontSize: nameFont, lineHeight: 16, fontWeight: here || isPrimary ? '600' : '400', color: INK, children: label }), isPrimary ? (_jsx(Text, { fontSize: 11, lineHeight: 13, color: DIM, children: t('Primary') })) : null] }), _jsx(XStack, { render: _jsx("button", { type: "button" }), "data-slot": "bots-unpin", "aria-label": t('Unpin {name}', { name: label }), onClick: () => togglePin(b.name), position: "absolute", t: 3, r: 3, width: 18, height: 18, rounded: 5, items: "center", justify: "center", bg: "transparent", borderWidth: 0, cursor: "pointer", opacity: 0.45, transition: "quickest", hoverStyle: { opacity: 1, bg: PICKED }, focusVisibleStyle: { opacity: 1, outlineWidth: 2, outlineStyle: 'solid', outlineColor: 'var(--ring)' }, children: _jsx(PinOff, { size: 10, color: DIM, "aria-hidden": true }) })] }, b.id || b.name));
99
+ }) })] })) : null, pinned.length ? (_jsx(YStack, { "data-slot": "bots-divider", mx: 10, borderTopWidth: 1, borderColor: LINE })) : null, query.trim() && shown.length === 0 && shownGroups.length === 0 ? (_jsx(YStack, { px: 16, py: 32, items: "center", gap: 6, children: _jsx(Text, { fontSize: 13, lineHeight: 18, color: DIM, text: "center", children: t('No bots match “{query}”.', { query: query.trim() }) }) })) : null, shownGroups.length > 0 || (!query.trim() && onMakeGroup && !disabled) ? (_jsxs(YStack, { "data-parity-key": "bots.groups", role: "group", "aria-label": t('Bot groups'), mt: pinned.length ? 10 : 4, pt: pinned.length ? 8 : 6, pb: 6, gap: 4, children: [_jsxs(XStack, { px: 16, pb: 4, items: "center", justify: "space-between", children: [_jsxs(XStack, { items: "center", gap: 6, children: [_jsx(Layers, { size: 12, color: DIM, "aria-hidden": true }), _jsx(Text, { fontSize: 12, lineHeight: 16, fontWeight: "600", color: DIM, children: t('Groups & layers') })] }), onMakeGroup && !disabled ? (_jsxs(XStack, { render: _jsx("button", { type: "button" }), onClick: onMakeGroup, items: "center", gap: 4, px: 7, py: 3, rounded: 6, bg: "transparent", borderWidth: 0, cursor: "pointer", transition: "quickest", hoverStyle: { bg: PICKED }, focusVisibleStyle: { outlineWidth: 2, outlineStyle: 'solid', outlineColor: 'var(--ring)' }, "$max-sm": { minH: 44, px: 10 }, children: [_jsx(Plus, { size: 12, color: DIM, "aria-hidden": true }), _jsx(Text, { fontSize: 12, lineHeight: 16, color: DIM, children: t('Group') })] })) : null] }), shownGroups.length === 0 && onMakeGroup && !disabled ? (_jsxs(XStack, { render: _jsx("button", { type: "button" }), onClick: onMakeGroup, mx: 10, px: 12, py: 9, "$max-sm": { minH: 48 }, rounded: 10, items: "center", gap: 10, bg: RAISED, borderWidth: 1, borderColor: LINE, cursor: "pointer", transition: "quickest", hoverStyle: { bg: PICKED, borderColor: 'var(--border-strong)' }, focusVisibleStyle: { outlineWidth: 2, outlineStyle: 'solid', outlineColor: 'var(--ring)' }, children: [_jsx(Users, { size: 15, color: DIM, "aria-hidden": true }), _jsxs(YStack, { flex: 1, minW: 0, items: "flex-start", gap: 2, children: [_jsx(Text, { ...CLIP, fontSize: 13, lineHeight: 17, fontWeight: "500", color: INK, children: t('Create a bot group') }), _jsx(Text, { ...CLIP, fontSize: 12, lineHeight: 16, color: DIM, children: t('Leader, Lux Quasar, or majority layers') })] })] })) : null, shownGroups.map((g) => {
59
100
  const ref = toGroupRef(g.name);
60
101
  const here = open === ref;
61
102
  return (_jsxs(XStack, { render: _jsx("button", { type: "button" }), "data-parity-key": "bots.group.row", "data-group": g.name, "aria-current": here, onClick: () => onPick(ref), minH: 54, mx: 6, px: 12, py: 8, gap: 10, items: "center", rounded: 10, bg: here ? PICKED : 'transparent', borderWidth: 0, cursor: "pointer", transition: "quickest", hoverStyle: { bg: here ? PICKED : 'var(--rail-hover, var(--muted))' }, focusVisibleStyle: { outlineWidth: 2, outlineStyle: 'solid', outlineColor: 'var(--ring)' }, children: [_jsx(YStack, { width: 34, height: 34, rounded: 10, shrink: 0, items: "center", justify: "center", bg: RAISED, borderWidth: 1, borderColor: LINE, children: _jsx(Users, { size: 15, color: INK, "aria-hidden": true }) }), _jsxs(YStack, { flex: 1, minW: 0, items: "flex-start", gap: 2, children: [_jsxs(XStack, { items: "center", gap: 6, maxW: "100%", children: [_jsx(Text, { ...CLIP, fontSize: 13, lineHeight: 18, fontWeight: "500", color: INK, children: g.name }), _jsx(Text, { fontSize: 11, lineHeight: 15, color: DIM, shrink: 0, children: `L${g.layer || 1}` })] }), _jsx(Text, { ...CLIP, maxW: "100%", fontSize: 12, lineHeight: 16, color: DIM, children: `${policyBadge(g.policy)} · ${g.members.length} bots` })] })] }, g.id || g.name));
62
- })] })) : null, rows.length ? (_jsxs(YStack, { "data-parity-key": "bots.rows", role: "group", "aria-label": t('More bots'), mt: 14, pt: 14, pb: 24, borderTopWidth: grid.length || shownGroups.length || (onMakeGroup && !disabled) ? 1 : 0, borderColor: LINE, gap: 4, children: [_jsx(Text, { px: 16, pb: 4, fontSize: 12, lineHeight: 16, fontWeight: "600", color: DIM, children: t('More bots') }), rows.map((b) => {
103
+ })] })) : null, unpinned.length ? (_jsxs(YStack, { "data-slot": "bots-unpinned", "data-parity-key": "bots.rows", role: "group", "aria-label": t('All bots'), mt: 10, pt: 12, pb: 12, borderTopWidth: pinned.length || shownGroups.length || (onMakeGroup && !disabled) ? 1 : 0, borderColor: LINE, gap: 4, children: [_jsx(XStack, { px: 16, pb: 4, items: "center", children: _jsx(Text, { fontSize: 12, lineHeight: 16, fontWeight: "600", color: DIM, children: t('BOTS') }) }), unpinned.map((b) => {
63
104
  const here = b.name === open;
64
105
  const label = called(b.name);
65
106
  const word = lastWord(last.get(b.name)) || b.description || '';
66
- return (_jsxs(XStack, { render: _jsx("button", { type: "button" }), "data-parity-key": "bots.row", "data-name": b.name, "aria-current": here, onClick: () => onPick(b.name), minH: 56, mx: 6, px: 12, py: 8, gap: 10, items: "center", rounded: 10, bg: here ? PICKED : 'transparent', borderWidth: 0, cursor: "pointer", transition: "quickest", hoverStyle: { bg: here ? PICKED : 'var(--rail-hover, var(--muted))' }, focusVisibleStyle: { outlineWidth: 2, outlineStyle: 'solid', outlineColor: 'var(--ring)' }, children: [_jsx(Face, { bot: b, size: 36 }), _jsxs(YStack, { flex: 1, minW: 0, items: "flex-start", gap: 2, children: [_jsx(Text, { ...CLIP, maxW: "100%", fontSize: 14, lineHeight: 19, fontWeight: "500", color: INK, children: label }), word ? (_jsx(Text, { ...CLIP, maxW: "100%", fontSize: 12, lineHeight: 17, color: DIM, children: word })) : null] })] }, b.id || b.name));
67
- })] })) : null] }), rows.length ? (_jsx(YStack, { "aria-hidden": true, pointerEvents: "none", position: "absolute", l: 0, r: 0, b: 0, height: 28, "$platform-web": { backgroundImage: `linear-gradient(to bottom, transparent, ${FLOOR})` } })) : null] }), _jsx(Foot, { me: me })] }));
107
+ return (_jsxs(XStack, { "data-parity-key": "bots.row", "data-name": b.name, minH: 56, mx: 6, px: 10, py: 8, gap: 8, items: "center", rounded: 10, bg: here ? PICKED : 'transparent', transition: "quickest", hoverStyle: { bg: here ? PICKED : 'var(--rail-hover, var(--muted))' }, children: [_jsxs(XStack, { render: _jsx("button", { type: "button" }), "aria-current": here, onClick: () => onPick(b.name), flex: 1, minW: 0, gap: 10, items: "center", p: 0, bg: "transparent", borderWidth: 0, cursor: "pointer", focusVisibleStyle: { outlineWidth: 2, outlineStyle: 'solid', outlineColor: 'var(--ring)' }, children: [_jsx(Face, { bot: b, size: 36 }), _jsxs(YStack, { flex: 1, minW: 0, items: "flex-start", gap: 2, children: [_jsx(Text, { ...CLIP, maxW: "100%", fontSize: 14, lineHeight: 19, fontWeight: "500", color: INK, children: label }), word ? (_jsx(Text, { ...CLIP, maxW: "100%", fontSize: 12, lineHeight: 17, color: DIM, children: word })) : null] })] }), _jsx(XStack, { render: _jsx("button", { type: "button" }), "data-slot": "bots-pin", "aria-label": t('Pin {name}', { name: label }), onClick: () => togglePin(b.name), width: 24, height: 24, shrink: 0, rounded: 6, items: "center", justify: "center", bg: "transparent", borderWidth: 0, cursor: "pointer", opacity: 0.5, transition: "quickest", hoverStyle: { opacity: 1, bg: PICKED }, focusVisibleStyle: { opacity: 1, outlineWidth: 2, outlineStyle: 'solid', outlineColor: 'var(--ring)' }, children: _jsx(Pin, { size: 12, color: DIM, "aria-hidden": true }) })] }, b.id || b.name));
108
+ })] })) : null, showWorkflows ? (_jsxs(YStack, { "data-slot": "bots-workflows", pt: 6, pb: 14, children: [_jsx(YStack, { mx: 10, mb: 8, borderTopWidth: 1, borderColor: LINE }), _jsxs(XStack, { render: "button", type: 'button', "data-slot": "bots-workflows-link", "aria-label": t('Workflows'), onClick: openWorkflows, height: 38, $touchable: { minH: 44 }, mx: 6, px: 12, gap: 10, minW: 0, items: "center", rounded: 10, bg: "transparent", borderWidth: 0, cursor: "pointer", hoverStyle: { bg: 'var(--rail-hover, var(--muted))' }, focusVisibleStyle: { outlineWidth: 2, outlineStyle: 'solid', outlineColor: '$outlineColor' }, children: [_jsx(Workflow, { size: 15, color: DIM, "aria-hidden": true }), _jsx(Text, { ...CLIP, flex: 1, text: "left", fontSize: 13, lineHeight: 18, fontWeight: "500", color: INK, children: t('Workflows') }), _jsx(Text, { fontSize: 11, lineHeight: 14, color: DIM, children: FLOW })] })] })) : null] }), unpinned.length ? (_jsx(YStack, { "aria-hidden": true, pointerEvents: "none", position: "absolute", l: 0, r: 0, b: 0, height: 28, "$platform-web": { backgroundImage: `linear-gradient(to bottom, transparent, ${FLOOR})` } })) : null] }), _jsx(Foot, { me: me })] }));
68
109
  }
69
110
  /** You, at the foot: your account, external Connectors, and unified Hanzo Preferences. */
70
111
  function Foot({ me }) {
package/dist/bots/face.js CHANGED
@@ -40,5 +40,7 @@ export function Face({ bot, size = 36, person = false, starred = false, }) {
40
40
  const disc = src ? (_jsx(YStack, { render: "img", src, alt: '', onError: () => setFailed(true), "aria-hidden": true, ...round, objectFit: "cover" })) : (_jsx(YStack, { "aria-hidden": true, ...round, items: "center", justify: "center", bg: "var(--raised)", borderWidth: 1, borderColor: "var(--border)", userSelect: 'none', children: _jsx(Text, { color: INK, fontSize: glyph, lineHeight: glyph, fontWeight: "600", children: bot.emoji || initials }) }));
41
41
  if (!starred)
42
42
  return disc;
43
- return (_jsxs(YStack, { position: "relative", width: size, height: size, shrink: 0, children: [disc, _jsx(YStack, { "aria-hidden": true, position: "absolute", r: -1, b: -1, width: 20, height: 20, rounded: 9999, items: "center", justify: "center", bg: "var(--warning, var(--chrome-dot-yellow))", borderWidth: 2, borderColor: FLOOR, children: _jsx(Star, { size: 10, color: "var(--pure-white, var(--foreground))", fill: "currentColor", strokeWidth: 2 }) })] }));
43
+ const badge = Math.max(12, Math.min(20, Math.round(size * 0.36)));
44
+ const star = Math.max(7, Math.round(badge * 0.52));
45
+ return (_jsxs(YStack, { position: "relative", width: size, height: size, shrink: 0, children: [disc, _jsx(YStack, { "aria-hidden": true, position: "absolute", r: -1, b: -1, width: badge, height: badge, rounded: 9999, items: "center", justify: "center", bg: "var(--warning, var(--chrome-dot-yellow))", borderWidth: size <= 28 ? 1.5 : 2, borderColor: FLOOR, children: _jsx(Star, { size: star, color: "var(--pure-white, var(--foreground))", fill: "currentColor", strokeWidth: 2 }) })] }));
44
46
  }
@@ -2,6 +2,28 @@ import type { Agent, AgentRun } from '@hanzo/ai';
2
2
  import type { BotGroup, GroupPolicy } from './api.js';
3
3
  /** How many bots the grid holds before the rest become rows. */
4
4
  export declare const GRID = 12;
5
+ /** Sidebar column count for the Pinned Bots grid (1 → 2 → 3). */
6
+ export type RosterColumns = 1 | 2 | 3;
7
+ /** User column preference: responsive width-driven (`auto`) or an explicit 1–3 column lock. */
8
+ export type RosterColumnPref = 'auto' | RosterColumns;
9
+ /** Default, minimum, and maximum widths (px) for the drag-resizable Bots sidebar. */
10
+ export declare const ROSTER_WIDTH_DEFAULT = 256;
11
+ export declare const ROSTER_WIDTH_MIN = 180;
12
+ export declare const ROSTER_WIDTH_MAX = 400;
13
+ /** Width breakpoints (px): <= 220 = 1 col, 221–295 = 2 cols, >= 296 = 3 cols. */
14
+ export declare const ROSTER_COL_2_MIN = 221;
15
+ export declare const ROSTER_COL_3_MIN = 296;
16
+ /** Maps a sidebar width (px) to 1, 2, or 3 pinned-bot grid columns. */
17
+ export declare function columnsForWidth(width: number): RosterColumns;
18
+ /** Resolves effective column count from sidebar width and optional explicit column preference. */
19
+ export declare function resolveColumns(width: number, pref?: RosterColumnPref): RosterColumns;
20
+ /** Four user-selectable avatar density sizes for the Pinned Bots sidebar. */
21
+ export type BotIconSize = 'xs' | 'sm' | 'md' | 'lg';
22
+ export declare const BOT_ICON_SIZES: readonly BotIconSize[];
23
+ export declare const BOT_AVATAR_PX: Record<BotIconSize, number>;
24
+ export declare function isBotIconSize(value: unknown): value is BotIconSize;
25
+ /** Pixel diameter for a bot avatar at the chosen density step. */
26
+ export declare function avatarSizePx(size: BotIconSize): number;
5
27
  /** Whether a bot wears the Primary / Lead star badge in the roster grid. */
6
28
  export declare function isStarredBot(bot: Agent): boolean;
7
29
  /** What a row says under a bot's name: its newest run's last word. */
@@ -11,6 +33,20 @@ export declare function split(bots: readonly Agent[], last: ReadonlyMap<string,
11
33
  grid: Agent[];
12
34
  rows: Agent[];
13
35
  };
36
+ /** Default pinned bot names (lowercase) before the user customizes their pinned grid. */
37
+ export declare function defaultPinnedNames(bots: readonly Agent[]): string[];
38
+ /** Toggles a bot's membership in the pinned list (case-insensitive by name). */
39
+ export declare function togglePinnedBot(current: readonly string[], name: string): string[];
40
+ /**
41
+ * Partitions real bots into top Pinned Bots (`pinned`) and normal vertical rows (`unpinned`).
42
+ * When `pinnedNames` is `null`, falls back to the default `split()` grid/rows ordering.
43
+ * When `pinnedNames` is an explicit list, pinned bots stay above the hairline in pin/primary order
44
+ * and all remaining bots appear below sorted by latest activity, then rank/creation order.
45
+ */
46
+ export declare function partitionPinned(bots: readonly Agent[], last: ReadonlyMap<string, AgentRun>, pinnedNames: readonly string[] | null): {
47
+ pinned: Agent[];
48
+ unpinned: Agent[];
49
+ };
14
50
  /** Orders Bot Groups by layer ascending (`Layer 1`, `Layer 2`, ...), then alphabetically. */
15
51
  export declare function sortGroupsByLayer(groups: readonly BotGroup[]): BotGroup[];
16
52
  /** Compact human-readable badge for a group's consensus or leadership policy. */
package/dist/bots/grid.js CHANGED
@@ -6,6 +6,39 @@ import { PRIMARY_BOT } from './api.js';
6
6
  import { instant } from './time.js';
7
7
  /** How many bots the grid holds before the rest become rows. */
8
8
  export const GRID = 12;
9
+ /** Default, minimum, and maximum widths (px) for the drag-resizable Bots sidebar. */
10
+ export const ROSTER_WIDTH_DEFAULT = 256;
11
+ export const ROSTER_WIDTH_MIN = 180;
12
+ export const ROSTER_WIDTH_MAX = 400;
13
+ /** Width breakpoints (px): <= 220 = 1 col, 221–295 = 2 cols, >= 296 = 3 cols. */
14
+ export const ROSTER_COL_2_MIN = 221;
15
+ export const ROSTER_COL_3_MIN = 296;
16
+ /** Maps a sidebar width (px) to 1, 2, or 3 pinned-bot grid columns. */
17
+ export function columnsForWidth(width) {
18
+ if (width >= ROSTER_COL_3_MIN)
19
+ return 3;
20
+ if (width >= ROSTER_COL_2_MIN)
21
+ return 2;
22
+ return 1;
23
+ }
24
+ /** Resolves effective column count from sidebar width and optional explicit column preference. */
25
+ export function resolveColumns(width, pref = 'auto') {
26
+ return pref === 'auto' ? columnsForWidth(width) : pref;
27
+ }
28
+ export const BOT_ICON_SIZES = ['xs', 'sm', 'md', 'lg'];
29
+ export const BOT_AVATAR_PX = {
30
+ xs: 24,
31
+ sm: 32,
32
+ md: 44,
33
+ lg: 56,
34
+ };
35
+ export function isBotIconSize(value) {
36
+ return value === 'xs' || value === 'sm' || value === 'md' || value === 'lg';
37
+ }
38
+ /** Pixel diameter for a bot avatar at the chosen density step. */
39
+ export function avatarSizePx(size) {
40
+ return BOT_AVATAR_PX[size];
41
+ }
9
42
  const LEAD_ORDER = new Map(['vi', 'opera', 'mana', 'dev', 'des', 'fin', 'huma', 'mark', 'sal', 'sci', 'su', 'cyber'].map((id, i) => [id, i]));
10
43
  function rankOf(bot) {
11
44
  const ext = bot;
@@ -48,6 +81,64 @@ export function split(bots, last) {
48
81
  .sort((a, b) => (instant(last.get(b.name)?.createdAt) ?? 0) - (instant(last.get(a.name)?.createdAt) ?? 0));
49
82
  return { grid, rows };
50
83
  }
84
+ /** Default pinned bot names (lowercase) before the user customizes their pinned grid. */
85
+ export function defaultPinnedNames(bots) {
86
+ return split(bots, new Map()).grid.map((b) => b.name.toLowerCase());
87
+ }
88
+ /** Toggles a bot's membership in the pinned list (case-insensitive by name). */
89
+ export function togglePinnedBot(current, name) {
90
+ const key = name.trim().toLowerCase();
91
+ if (!key)
92
+ return [...current];
93
+ const normalized = current.map((n) => n.trim().toLowerCase()).filter(Boolean);
94
+ if (normalized.includes(key)) {
95
+ return normalized.filter((n) => n !== key);
96
+ }
97
+ return [...normalized, key];
98
+ }
99
+ /**
100
+ * Partitions real bots into top Pinned Bots (`pinned`) and normal vertical rows (`unpinned`).
101
+ * When `pinnedNames` is `null`, falls back to the default `split()` grid/rows ordering.
102
+ * When `pinnedNames` is an explicit list, pinned bots stay above the hairline in pin/primary order
103
+ * and all remaining bots appear below sorted by latest activity, then rank/creation order.
104
+ */
105
+ export function partitionPinned(bots, last, pinnedNames) {
106
+ if (pinnedNames === null) {
107
+ const { grid, rows } = split(bots, last);
108
+ return { pinned: grid, unpinned: rows };
109
+ }
110
+ const order = new Map();
111
+ pinnedNames.forEach((n, idx) => {
112
+ const key = n.trim().toLowerCase();
113
+ if (key && !order.has(key))
114
+ order.set(key, idx);
115
+ });
116
+ const pinned = [];
117
+ const unpinned = [];
118
+ for (const bot of bots) {
119
+ if (order.has(bot.name.toLowerCase()))
120
+ pinned.push(bot);
121
+ else
122
+ unpinned.push(bot);
123
+ }
124
+ pinned.sort((a, b) => {
125
+ const oa = order.get(a.name.toLowerCase()) ?? Number.MAX_SAFE_INTEGER;
126
+ const ob = order.get(b.name.toLowerCase()) ?? Number.MAX_SAFE_INTEGER;
127
+ if (oa !== ob)
128
+ return oa - ob;
129
+ return rankOf(a) - rankOf(b);
130
+ });
131
+ unpinned.sort((a, b) => {
132
+ const dt = (instant(last.get(b.name)?.createdAt) ?? 0) - (instant(last.get(a.name)?.createdAt) ?? 0);
133
+ if (dt !== 0)
134
+ return dt;
135
+ const dr = rankOf(a) - rankOf(b);
136
+ if (dr !== 0)
137
+ return dr;
138
+ return (instant(a.createdAt) ?? 0) - (instant(b.createdAt) ?? 0);
139
+ });
140
+ return { pinned, unpinned };
141
+ }
51
142
  /** Orders Bot Groups by layer ascending (`Layer 1`, `Layer 2`, ...), then alphabetically. */
52
143
  export function sortGroupsByLayer(groups) {
53
144
  return [...groups].sort((a, b) => {
@@ -11,6 +11,6 @@ export declare const MINE = "color-mix(in oklab, var(--foreground) 17%, var(--pa
11
11
  export declare const INK = "var(--foreground)";
12
12
  export declare const DIM = "var(--text-secondary, var(--muted-foreground))";
13
13
  export declare const FAINT = "$faint";
14
- export declare const LINE = "var(--pane-edge, var(--border))";
14
+ export declare const LINE = "var(--pane-edge, var(--white-08))";
15
15
  /** The composer's edge, the one control drawn a step louder. */
16
16
  export declare const EDGE = "var(--border-strong)";
package/dist/bots/ink.js CHANGED
@@ -15,6 +15,6 @@ export const MINE = 'color-mix(in oklab, var(--foreground) 17%, var(--pane-fill,
15
15
  export const INK = 'var(--foreground)';
16
16
  export const DIM = 'var(--text-secondary, var(--muted-foreground))';
17
17
  export const FAINT = '$faint';
18
- export const LINE = 'var(--pane-edge, var(--border))';
18
+ export const LINE = 'var(--pane-edge, var(--white-08))';
19
19
  /** The composer's edge, the one control drawn a step louder. */
20
20
  export const EDGE = 'var(--border-strong)';
@@ -1,14 +1,18 @@
1
- /** A round icon control, 34px: the roster's search and new, Share, Preferences, Close. */
1
+ /** A round icon control, 34px on desktop and 44px under touch pointers: the roster's search and new, Share, Preferences, Close. */
2
2
  export declare const ROUND: {
3
3
  readonly render: 'button';
4
4
  readonly type: 'button';
5
5
  readonly width: 34;
6
6
  readonly height: 34;
7
+ readonly $touchable: {
8
+ readonly minW: 44;
9
+ readonly minH: 44;
10
+ };
7
11
  readonly shrink: 0;
8
12
  readonly rounded: 999;
9
13
  readonly bg: "var(--surface-card-emphasis)";
10
14
  readonly borderWidth: 1;
11
- readonly borderColor: "var(--pane-edge, var(--border))";
15
+ readonly borderColor: "var(--pane-edge, var(--white-08))";
12
16
  readonly items: 'center';
13
17
  readonly justify: 'center';
14
18
  readonly cursor: 'pointer';
@@ -34,7 +38,7 @@ export declare const PILL: {
34
38
  readonly rounded: 999;
35
39
  readonly bg: "var(--surface-card-emphasis)";
36
40
  readonly borderWidth: 1;
37
- readonly borderColor: "var(--pane-edge, var(--border))";
41
+ readonly borderColor: "var(--pane-edge, var(--white-08))";
38
42
  readonly cursor: 'pointer';
39
43
  readonly shrink: 0;
40
44
  readonly hoverStyle: {
@@ -67,7 +71,7 @@ export declare const LABEL: {
67
71
  export declare const CARD: {
68
72
  readonly bg: "var(--surface-card-emphasis)";
69
73
  readonly borderWidth: 1;
70
- readonly borderColor: "var(--pane-edge, var(--border))";
74
+ readonly borderColor: "var(--pane-edge, var(--white-08))";
71
75
  readonly rounded: 14;
72
76
  };
73
77
  /** One line, cut with an ellipsis where it runs out of space. */
package/dist/bots/kit.js CHANGED
@@ -1,12 +1,13 @@
1
1
  // The controls the Bots app is drawn from, as gui props, stated once and spread
2
2
  // where they are drawn.
3
3
  import { DIM, INK, LINE, PICKED, RAISED } from './ink.js';
4
- /** A round icon control, 34px: the roster's search and new, Share, Preferences, Close. */
4
+ /** A round icon control, 34px on desktop and 44px under touch pointers: the roster's search and new, Share, Preferences, Close. */
5
5
  export const ROUND = {
6
6
  render: 'button',
7
7
  type: 'button',
8
8
  width: 34,
9
9
  height: 34,
10
+ $touchable: { minW: 44, minH: 44 },
10
11
  shrink: 0,
11
12
  rounded: 999,
12
13
  bg: RAISED,
package/dist/ground.d.ts CHANGED
@@ -17,7 +17,7 @@ export declare const pane: (fill?: string) => {
17
17
  readonly borderRadius: 'var(--pane-round)';
18
18
  readonly borderWidth: 1;
19
19
  readonly borderStyle: 'solid';
20
- readonly borderColor: 'var(--pane-edge, var(--border))';
20
+ readonly borderColor: 'var(--pane-edge, var(--white-08))';
21
21
  readonly backdropFilter: 'var(--pane-blur)';
22
22
  };
23
23
  /**
package/dist/ground.js CHANGED
@@ -12,12 +12,12 @@
12
12
  * `!important`: a Dev run's pane steps aside for the two panes inside it by
13
13
  * slot (@hanzo/build's `run-split`), and an important shadow would stay behind.
14
14
  */
15
- export const pane = (fill = 'var(--pane-fill)') => ({
15
+ export const pane = (fill = 'var(--pane-fill, var(--card))') => ({
16
16
  backgroundColor: fill,
17
17
  borderRadius: 'var(--pane-round)',
18
18
  borderWidth: 1,
19
19
  borderStyle: 'solid',
20
- borderColor: 'var(--pane-edge, var(--border))',
20
+ borderColor: 'var(--pane-edge, var(--white-08))',
21
21
  backdropFilter: 'var(--pane-blur)',
22
22
  });
23
23
  /**
@@ -1,7 +1,7 @@
1
1
  /**
2
2
  * Hanzo Tasks — the durable execution engine — as the board reaches it.
3
3
  *
4
- * TWO SUBSYSTEMS, ONE SEAM, and the seam is the point. `/v1/todo` holds what
4
+ * TWO SUBSYSTEMS, ONE SEAM, and the seam is the point. `/v1/task` holds what
5
5
  * should be done and who holds it; `/v1/tasks` runs work that survives a crash,
6
6
  * event-sourced and replayable. They are not two spellings of one thing: a card
7
7
  * is dragged between columns and a run is replayed, and neither verb makes sense
@@ -1,7 +1,7 @@
1
1
  /**
2
2
  * Hanzo Tasks — the durable execution engine — as the board reaches it.
3
3
  *
4
- * TWO SUBSYSTEMS, ONE SEAM, and the seam is the point. `/v1/todo` holds what
4
+ * TWO SUBSYSTEMS, ONE SEAM, and the seam is the point. `/v1/task` holds what
5
5
  * should be done and who holds it; `/v1/tasks` runs work that survives a crash,
6
6
  * event-sourced and replayable. They are not two spellings of one thing: a card
7
7
  * is dragged between columns and a run is replayed, and neither verb makes sense
@@ -1,5 +1,5 @@
1
1
  /**
2
- * The board's store: `/v1/todo` with resilient local cache fallback.
2
+ * The board's store: `/v1/task` with resilient local cache fallback.
3
3
  *
4
4
  * A card IS a forge issue — the platform's own words: "the column is a LABEL on
5
5
  * the forge, so the board and the forge web UI are the same object seen twice:
package/dist/lib/todo.js CHANGED
@@ -145,7 +145,7 @@ export async function board(client, params = {}, signal) {
145
145
  if (params.scheduled !== undefined)
146
146
  query.scheduled = String(params.scheduled);
147
147
  const out = await client.http.json({
148
- path: '/v1/todo/board',
148
+ path: '/v1/task/board',
149
149
  query,
150
150
  signal,
151
151
  });
@@ -178,7 +178,7 @@ async function served(client, signal, map = new Map()) {
178
178
  const [todoPs, devPs] = await Promise.all([
179
179
  client.http
180
180
  .json({
181
- path: '/v1/todo/projects',
181
+ path: '/v1/task/projects',
182
182
  signal,
183
183
  })
184
184
  .catch(() => null),
@@ -248,7 +248,7 @@ export async function open(client, key, card, signal) {
248
248
  try {
249
249
  const created = await client.http.json({
250
250
  method: 'POST',
251
- path: `/v1/todo/projects/${encodeURIComponent(key)}/issues`,
251
+ path: `/v1/task/projects/${encodeURIComponent(key)}/issues`,
252
252
  body: card,
253
253
  signal,
254
254
  });
@@ -288,7 +288,7 @@ export async function edit(client, key, num, patch, signal) {
288
288
  try {
289
289
  const serverUpdated = await client.http.json({
290
290
  method: 'PATCH',
291
- path: `/v1/todo/projects/${encodeURIComponent(key)}/issues/${num}`,
291
+ path: `/v1/task/projects/${encodeURIComponent(key)}/issues/${num}`,
292
292
  body: patch,
293
293
  signal,
294
294
  });
@@ -306,7 +306,7 @@ export async function claim(client, key, num, signal) {
306
306
  try {
307
307
  return await client.http.json({
308
308
  method: 'POST',
309
- path: `/v1/todo/projects/${encodeURIComponent(key)}/issues/${num}/claim`,
309
+ path: `/v1/task/projects/${encodeURIComponent(key)}/issues/${num}/claim`,
310
310
  body: {},
311
311
  signal,
312
312
  });
package/dist/seek.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- import type { Press } from './chord.js';
1
+ import { type Press } from './chord.js';
2
2
  /** A row the palette can list. */
3
3
  export interface Hit {
4
4
  id: string;
@@ -40,3 +40,8 @@ export declare function find<T extends Hit>(query: string, recent: T[], idle: Gr
40
40
  * unless something on the page already answered it (Dev's composer opens its own commands and claims it).
41
41
  */
42
42
  export declare const summons: (e: Press) => boolean;
43
+ /**
44
+ * Whether a key press toggles the sidebar: ⌘B or Ctrl+B, once a press,
45
+ * ignored while typing in an input, textarea, select, or contenteditable target.
46
+ */
47
+ export declare const togglesSidebar: (e: Press) => boolean;
package/dist/seek.js CHANGED
@@ -2,6 +2,7 @@
2
2
  // in what order, under which heading, and which key press opens it. No React,
3
3
  // so a spec reads them as they are.
4
4
  import { phrase } from '@hanzo/i18n';
5
+ import { typing } from './chord.js';
5
6
  /** The most rows one group shows for a query. */
6
7
  export const CAP = 5;
7
8
  /** The rows Recent lists on an empty field. */
@@ -81,3 +82,15 @@ export function find(query, recent, idle, all) {
81
82
  * unless something on the page already answered it (Dev's composer opens its own commands and claims it).
82
83
  */
83
84
  export const summons = (e) => !e.defaultPrevented && (e.metaKey || e.ctrlKey) && !e.altKey && !e.shiftKey && !e.repeat && !e.isComposing && (e.key ?? '').toLowerCase() === 'k';
85
+ /**
86
+ * Whether a key press toggles the sidebar: ⌘B or Ctrl+B, once a press,
87
+ * ignored while typing in an input, textarea, select, or contenteditable target.
88
+ */
89
+ export const togglesSidebar = (e) => !e.defaultPrevented &&
90
+ (e.metaKey || e.ctrlKey) &&
91
+ !e.altKey &&
92
+ !e.shiftKey &&
93
+ !e.repeat &&
94
+ !e.isComposing &&
95
+ (e.key ?? '').toLowerCase() === 'b' &&
96
+ !typing(e.target);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@hanzo/app",
3
- "version": "0.3.95",
3
+ "version": "0.3.96",
4
4
  "description": "Hanzo's app: the shell and its apps (Home, Chat, Inbox, Contacts, Meet, Calendar, Drive, Board, Work, Bots), once, for every Hanzo surface.",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",