basalt-ui 1.12.0 → 1.14.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (123) hide show
  1. package/AGENTS.md +21 -21
  2. package/CHANGELOG.md +24 -0
  3. package/README.md +38 -35
  4. package/agent/rules/basalt-agent.md +14 -0
  5. package/configs/oxlint-plugin.js +7 -3
  6. package/configs/oxlint-plugin.test.ts +34 -5
  7. package/configs/oxlint.json +4 -4
  8. package/dist/agent/adapter.d.ts +5 -1
  9. package/dist/agent/adapter.d.ts.map +1 -1
  10. package/dist/agent/adapter.js +22 -13
  11. package/dist/agent/ai-sdk-transport.d.ts.map +1 -1
  12. package/dist/agent/ai-sdk-transport.js +6 -2
  13. package/dist/agent/id.d.ts +67 -19
  14. package/dist/agent/id.d.ts.map +1 -1
  15. package/dist/agent/id.js +21 -7
  16. package/dist/agent/thread.d.ts +4 -0
  17. package/dist/agent/thread.d.ts.map +1 -1
  18. package/dist/agent/use-agent-stream.d.ts.map +1 -1
  19. package/dist/agent/use-agent-stream.js +2 -2
  20. package/dist/agent/use-agent-thread-runs.d.ts +24 -3
  21. package/dist/agent/use-agent-thread-runs.d.ts.map +1 -1
  22. package/dist/agent/use-agent-thread-runs.js +55 -15
  23. package/dist/agent-chat/index.d.ts +4 -0
  24. package/dist/agent-chat/index.d.ts.map +1 -1
  25. package/dist/agent-chat/index.js +2 -0
  26. package/dist/agent-chat/message-affordances.d.ts +59 -0
  27. package/dist/agent-chat/message-affordances.d.ts.map +1 -0
  28. package/dist/agent-chat/message-affordances.js +7 -0
  29. package/dist/agent-chat/relative-time.d.ts +27 -0
  30. package/dist/agent-chat/relative-time.d.ts.map +1 -0
  31. package/dist/agent-chat/relative-time.js +27 -0
  32. package/dist/agent-chat/relative-time.test.d.ts +2 -0
  33. package/dist/agent-chat/relative-time.test.d.ts.map +1 -0
  34. package/dist/agent-chat/thread-feed-row.d.ts +65 -0
  35. package/dist/agent-chat/thread-feed-row.d.ts.map +1 -0
  36. package/dist/agent-chat/thread-feed-row.js +156 -0
  37. package/dist/agent-chat/thread-feed-row.test.d.ts +2 -0
  38. package/dist/agent-chat/thread-feed-row.test.d.ts.map +1 -0
  39. package/dist/agent-chat/thread-feed.d.ts +34 -5
  40. package/dist/agent-chat/thread-feed.d.ts.map +1 -1
  41. package/dist/agent-chat/thread-feed.js +52 -19
  42. package/dist/agent-chat/thread-feed.test.d.ts +2 -0
  43. package/dist/agent-chat/thread-feed.test.d.ts.map +1 -0
  44. package/dist/agent-chat/thread-message.d.ts +183 -2
  45. package/dist/agent-chat/thread-message.d.ts.map +1 -1
  46. package/dist/agent-chat/thread-message.js +315 -34
  47. package/dist/agent-chat/thread-outcome-card.d.ts.map +1 -1
  48. package/dist/agent-chat/thread-outcome-card.js +1 -16
  49. package/dist/agent-chat/thread-workspace.d.ts +14 -2
  50. package/dist/agent-chat/thread-workspace.d.ts.map +1 -1
  51. package/dist/agent-chat/thread-workspace.js +29 -3
  52. package/dist/agent-chat/thread-workspace.test.d.ts +2 -0
  53. package/dist/agent-chat/thread-workspace.test.d.ts.map +1 -0
  54. package/dist/agent-chat/virtualize.d.ts +123 -0
  55. package/dist/agent-chat/virtualize.d.ts.map +1 -0
  56. package/dist/agent-chat/virtualize.js +9 -0
  57. package/dist/agent-chat/virtualize.type-guard.test.d.ts +2 -0
  58. package/dist/agent-chat/virtualize.type-guard.test.d.ts.map +1 -0
  59. package/dist/data/index.d.ts +5 -1
  60. package/dist/data/index.d.ts.map +1 -1
  61. package/dist/data/virtual-list.d.ts.map +1 -1
  62. package/dist/data/virtual.d.ts +2 -1
  63. package/dist/data/virtual.d.ts.map +1 -1
  64. package/dist/index.d.ts +2 -2
  65. package/dist/index.d.ts.map +1 -1
  66. package/dist/index.js +2 -0
  67. package/dist/shell/app-sidebar.d.ts +19 -1
  68. package/dist/shell/app-sidebar.d.ts.map +1 -1
  69. package/dist/shell/app-sidebar.js +30 -26
  70. package/dist/shell/app-sidebar.module.css +11 -0
  71. package/dist/shell/app-sidebar.module.css.d.ts +1 -0
  72. package/dist/shell/app-sidebar.test.d.ts +2 -0
  73. package/dist/shell/app-sidebar.test.d.ts.map +1 -0
  74. package/dist/shell/index.d.ts +10 -1
  75. package/dist/shell/index.d.ts.map +1 -1
  76. package/dist/shell/index.js +2 -0
  77. package/dist/shell/index.test.d.ts +2 -0
  78. package/dist/shell/index.test.d.ts.map +1 -0
  79. package/dist/surfaces.d.ts +2 -2
  80. package/dist/surfaces.d.ts.map +1 -1
  81. package/dist/surfaces.js +3 -2
  82. package/dist/theme/shadow-surfaces.test.d.ts.map +1 -1
  83. package/llms.txt +6 -6
  84. package/package.json +2 -2
  85. package/src/agent/adapter.test.ts +237 -0
  86. package/src/agent/adapter.ts +72 -14
  87. package/src/agent/ai-sdk-transport.test.ts +64 -0
  88. package/src/agent/ai-sdk-transport.ts +8 -2
  89. package/src/agent/id.test.ts +95 -1
  90. package/src/agent/id.ts +98 -28
  91. package/src/agent/thread.ts +4 -0
  92. package/src/agent/use-agent-stream.test.tsx +22 -0
  93. package/src/agent/use-agent-stream.ts +6 -3
  94. package/src/agent/use-agent-thread-runs.test.tsx +326 -0
  95. package/src/agent/use-agent-thread-runs.ts +159 -23
  96. package/src/agent/use-agent-thread-runs.wedge.test.tsx +80 -0
  97. package/src/agent-chat/index.ts +12 -0
  98. package/src/agent-chat/message-affordances.ts +61 -0
  99. package/src/agent-chat/relative-time.test.ts +95 -0
  100. package/src/agent-chat/relative-time.ts +55 -0
  101. package/src/agent-chat/thread-feed-row.test.tsx +510 -0
  102. package/src/agent-chat/thread-feed-row.tsx +274 -0
  103. package/src/agent-chat/thread-feed.test.tsx +241 -0
  104. package/src/agent-chat/thread-feed.tsx +119 -18
  105. package/src/agent-chat/thread-message.test.tsx +937 -3
  106. package/src/agent-chat/thread-message.tsx +766 -38
  107. package/src/agent-chat/thread-outcome-card.tsx +1 -25
  108. package/src/agent-chat/thread-workspace.test.tsx +169 -0
  109. package/src/agent-chat/thread-workspace.tsx +69 -5
  110. package/src/agent-chat/virtualize.ts +132 -0
  111. package/src/agent-chat/virtualize.type-guard.test.ts +49 -0
  112. package/src/data/index.ts +5 -1
  113. package/src/data/virtual-list.tsx +2 -1
  114. package/src/data/virtual.ts +2 -1
  115. package/src/index.ts +5 -0
  116. package/src/shell/app-sidebar.module.css +11 -0
  117. package/src/shell/app-sidebar.module.css.d.ts +1 -0
  118. package/src/shell/app-sidebar.test.tsx +98 -0
  119. package/src/shell/app-sidebar.tsx +22 -0
  120. package/src/shell/index.test.tsx +35 -0
  121. package/src/shell/index.tsx +11 -0
  122. package/src/surfaces.ts +2 -1
  123. package/src/theme/shadow-surfaces.test.ts +9 -0
@@ -2,26 +2,11 @@ import { jsx, jsxs } from "react/jsx-runtime";
2
2
  import { Badge, Group, Skeleton, Stack, Text, UnstyledButton } from "@mantine/core";
3
3
  import { useHover } from "@mantine/hooks";
4
4
  import { alpha, VX } from "../tokens/index.js";
5
+ import { formatRelativeTime } from "./relative-time.js";
5
6
  const STATUS_BADGE = {
6
7
  attention: { label: "Needs review", statusToken: VX.status.warn },
7
8
  error: { label: "Failed", statusToken: VX.status.bad }
8
9
  };
9
- const RELATIVE_TIME_FORMAT = new Intl.RelativeTimeFormat("en", { numeric: "auto" });
10
- const RELATIVE_TIME_UNITS = [
11
- { unit: "year", ms: 31536e6 },
12
- { unit: "month", ms: 2628e6 },
13
- { unit: "week", ms: 6048e5 },
14
- { unit: "day", ms: 864e5 },
15
- { unit: "hour", ms: 36e5 },
16
- { unit: "minute", ms: 6e4 }
17
- ];
18
- function formatRelativeTime(timestamp) {
19
- const diffMs = timestamp - Date.now();
20
- const absMs = Math.abs(diffMs);
21
- if (absMs < 6e4) return "just now";
22
- const unit = RELATIVE_TIME_UNITS.find(({ ms }) => absMs >= ms) ?? RELATIVE_TIME_UNITS.at(-1);
23
- return RELATIVE_TIME_FORMAT.format(Math.round(diffMs / unit.ms), unit.unit);
24
- }
25
10
  function OutcomeSkeleton() {
26
11
  return /* @__PURE__ */ jsxs(Stack, { gap: 6, children: [
27
12
  /* @__PURE__ */ jsx(Skeleton, { height: 14, width: "60%", radius: "sm" }),
@@ -12,8 +12,20 @@ export type ThreadWorkspaceProps = {
12
12
  readonly resolveOutcome: OutcomeResolver<AgentPart>;
13
13
  /** Placeholder for the new-thread composer pinned under the feed. */
14
14
  readonly newThreadPlaceholder?: string;
15
- /** Rendered in place of the feed while there are no threads yet. */
15
+ /**
16
+ * Rendered in place of the feed once the store is hydrated and there really are no threads.
17
+ * Shown ONLY when `store.hydrated` is true — while an async store's initial load is still in
18
+ * flight, `ThreadWorkspace` holds a neutral loading state instead (see `FeedHydratingState`),
19
+ * so a server-backed workspace never asserts "no threads yet" before it actually knows that.
20
+ */
16
21
  readonly emptyState?: ReactNode;
22
+ /**
23
+ * Rendered in place of the feed when the store's initial load has failed — `!store.hydrated &&
24
+ * store.error !== undefined` (see `ThreadsStore.hydrated`'s doc for the discriminant). Shown
25
+ * instead of `FeedHydratingState`, so a rejected `listThreads` surfaces a legible failure rather
26
+ * than an endless skeleton.
27
+ */
28
+ readonly errorState?: ReactNode;
17
29
  };
18
30
  /**
19
31
  * A two-pane master-detail thread workspace: a scrollable feed of threads with an anchored
@@ -23,5 +35,5 @@ export type ThreadWorkspaceProps = {
23
35
  * @example
24
36
  * <ThreadWorkspace useThreads={useThreads} transport={transport} resolveOutcome={heuristicOutcome} />
25
37
  */
26
- export declare function ThreadWorkspace({ useThreads, transport, resolveOutcome, newThreadPlaceholder, emptyState, }: ThreadWorkspaceProps): JSX.Element;
38
+ export declare function ThreadWorkspace({ useThreads, transport, resolveOutcome, newThreadPlaceholder, emptyState, errorState, }: ThreadWorkspaceProps): JSX.Element;
27
39
  //# sourceMappingURL=thread-workspace.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"thread-workspace.d.ts","sourceRoot":"","sources":["../../src/agent-chat/thread-workspace.tsx"],"names":[],"mappings":"AAoCA,OAAO,KAAK,EAAE,GAAG,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oB,CAAC,EAAE,MAAM,CAAA;IACtC;;;;;OAKG;IACH,QAAQ,CAAC,UAAU,CAAC,EAAE,SAAS,CAAA;IAC/B;;;;;OAKG;IACH,QAAQ,CAAC,UAAU,CAAC,EAAE,SAAS,CAAA;CAChC,CAAA;AA4DD;;;;;;;GAOG;AACH,wBAAgB,eAAe,CAAC,EAC9B,UAAU,EACV,SAAS,EACT,cAAc,EACd,oBAAoB,EACpB,UAAU,EACV,UAAU,GACX,EAAE,oBAAoB,GAAG,GAAG,CAAC,OAAO,CA8FpC"}
@@ -1,7 +1,8 @@
1
1
  import { jsx, jsxs } from "react/jsx-runtime";
2
- import { Box, Divider, Flex, Stack, Text } from "@mantine/core";
2
+ import { Box, Divider, Flex, Skeleton, Stack, Text } from "@mantine/core";
3
3
  import { useMediaQuery } from "@mantine/hooks";
4
4
  import { useAgentThreadRuns } from "../agent/index.js";
5
+ import { VX } from "../tokens/index.js";
5
6
  import { Composer } from "./composer.js";
6
7
  import { ThreadDetailPanel } from "./thread-detail-panel.js";
7
8
  import { ThreadFeed } from "./thread-feed.js";
@@ -13,12 +14,37 @@ function FeedEmptyState() {
13
14
  /* @__PURE__ */ jsx(Text, { size: "xs", c: "dimmed", ta: "center", children: "Send a message below to start your first thread." })
14
15
  ] });
15
16
  }
17
+ function FeedHydratingState() {
18
+ return /* @__PURE__ */ jsxs(Stack, { gap: "sm", p: "sm", "data-testid": "thread-workspace-hydrating", children: [
19
+ /* @__PURE__ */ jsx(Skeleton, { height: 54, radius: "sm" }),
20
+ /* @__PURE__ */ jsx(Skeleton, { height: 54, radius: "sm" }),
21
+ /* @__PURE__ */ jsx(Skeleton, { height: 54, radius: "sm" })
22
+ ] });
23
+ }
24
+ function FeedErrorState() {
25
+ return /* @__PURE__ */ jsxs(
26
+ Stack,
27
+ {
28
+ align: "center",
29
+ justify: "center",
30
+ gap: 4,
31
+ h: "100%",
32
+ p: "xl",
33
+ "data-testid": "thread-workspace-error",
34
+ children: [
35
+ /* @__PURE__ */ jsx(Text, { fw: 600, size: "sm", style: { color: VX.status.bad }, children: "Couldn't load threads" }),
36
+ /* @__PURE__ */ jsx(Text, { size: "xs", c: "dimmed", ta: "center", children: "Something went wrong loading your threads. Try refreshing the page." })
37
+ ]
38
+ }
39
+ );
40
+ }
16
41
  function ThreadWorkspace({
17
42
  useThreads,
18
43
  transport,
19
44
  resolveOutcome,
20
45
  newThreadPlaceholder,
21
- emptyState
46
+ emptyState,
47
+ errorState
22
48
  }) {
23
49
  const store = useThreads();
24
50
  const runs = useAgentThreadRuns({ transport, store, resolveOutcome });
@@ -50,7 +76,7 @@ function ThreadWorkspace({
50
76
  runs.retry(store.activeId);
51
77
  };
52
78
  const feed = /* @__PURE__ */ jsxs(Flex, { direction: "column", h: "100%", style: { overflow: "hidden" }, children: [
53
- /* @__PURE__ */ jsx(Box, { style: { flex: 1, minHeight: 0 }, children: store.threads.length === 0 ? emptyState ?? /* @__PURE__ */ jsx(FeedEmptyState, {}) : /* @__PURE__ */ jsx(ThreadFeed, { threads, activeId: store.activeId, onSelect: handleSelect }) }),
79
+ /* @__PURE__ */ jsx(Box, { style: { flex: 1, minHeight: 0 }, children: threads.length === 0 ? store.hydrated ? emptyState ?? /* @__PURE__ */ jsx(FeedEmptyState, {}) : store.error !== void 0 ? errorState ?? /* @__PURE__ */ jsx(FeedErrorState, {}) : /* @__PURE__ */ jsx(FeedHydratingState, {}) : /* @__PURE__ */ jsx(ThreadFeed, { threads, activeId: store.activeId, onSelect: handleSelect }) }),
54
80
  /* @__PURE__ */ jsx(Divider, { color: "var(--vx-divider)" }),
55
81
  /* @__PURE__ */ jsx(Box, { p: "sm", children: /* @__PURE__ */ jsx(
56
82
  Composer,
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=thread-workspace.test.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"thread-workspace.test.d.ts","sourceRoot":"","sources":["../../src/agent-chat/thread-workspace.test.tsx"],"names":[],"mappings":""}
@@ -0,0 +1,123 @@
1
+ /**
2
+ * Virtualization contract shared by the transcript/feed components that can opt into
3
+ * `@tanstack/react-virtual` for long lists.
4
+ *
5
+ * The `VirtualizeProps` union IS the guard: a virtualizer needs a measured scroll container, so
6
+ * turning `virtualize` on REQUIRES a `height` and turning it off (or omitting it) FORBIDS one. See
7
+ * `virtualize.type-guard.test.ts` beside this file for a compile-time proof that the union actually
8
+ * rejects the invalid combinations.
9
+ *
10
+ * The one piece of runtime here is {@link resolveVirtualize} — the single narrowing point every
11
+ * component that accepts `VirtualizeProps` goes through, so no call site has to re-derive (or
12
+ * assert its way past) the union's `virtualize`-implies-`height` link.
13
+ *
14
+ * The other half of the contract, not encoded in the types (it's a runtime/composition rule, not
15
+ * a shape): a virtualized transcript OWNS ITS OWN SCROLL NODE (the element `getScrollElement`
16
+ * measures) and must NOT be nested inside `BasaltStickToBottom` — unlike the non-virtual path,
17
+ * which `ThreadDetailPanel` nests inside `BasaltStickToBottom` today (its transcript body).
18
+ * Stacking a virtualizer's own scroll container inside `BasaltStickToBottom`'s would give the
19
+ * transcript two competing owners of "which element scrolls" and break both the virtualizer's
20
+ * `scrollToEnd` and stick-to-bottom's anchor tracking.
21
+ *
22
+ * A third composition rule, same category (runtime, not a shape): a virtualized transcript
23
+ * tolerates being hidden via `display: none` on an ANCESTOR (e.g. sitting inside a collapsible
24
+ * `ThreadFeedRow`) — collapsing does not corrupt its measurement cache, and re-expanding restores
25
+ * the same scroll position (same top-visible row) it had before the collapse. This is NOT free of
26
+ * virtual-core: hiding an ancestor makes every mounted row's ResizeObserver box report `0` (a
27
+ * `display: none` ancestor un-lays-out its descendants), and virtual-core 3.17.1's default
28
+ * `measureElement`/`resizeItem` write that `0` into `itemSizeCache` with no floor — unguarded, a
29
+ * few collapse/expand cycles permanently shrink `getTotalSize()` and silently scroll the visible
30
+ * window to a DIFFERENT part of the transcript (`scrollTop` stays put; the content under it moves).
31
+ * `thread-message.tsx` closes this with a `measureElement` override (`resolveGuardedMeasurement`)
32
+ * that treats a `0` reading as unreliable and keeps the last-known size instead of committing it —
33
+ * see that function's doc for the full mechanism, including why `useVirtualizer`'s `enabled` option
34
+ * is NOT the fix (it wipes the measurement cache outright, worse than the bug). A consumer combining a
35
+ * virtualized transcript with its own hide-via-CSS container gets this for free; a consumer who
36
+ * unmounts/remounts the transcript instead of hiding it is unaffected either way (a fresh
37
+ * `useVirtualizer` call has no stale cache to poison).
38
+ *
39
+ * A fourth composition rule: a virtualized transcript SCROLLS ITSELF on mount. `initialScroll`
40
+ * defaults to `'end'` — `anchorTo: 'end'` and `followOnAppend` (both wired in `thread-message.tsx`)
41
+ * only keep an ALREADY-at-the-end transcript pinned as content changes; neither performs the initial
42
+ * jump, so left alone a freshly mounted virtualized transcript renders at message #0, not the
43
+ * newest. The fix fires exactly once, on first mount, via `scrollToEnd()` — never again, so a user
44
+ * who has scrolled up is never yanked back down by a later append (that is precisely the failure
45
+ * `followOnAppend` exists to avoid, and re-introducing it here would be worse than the defect this
46
+ * closes). A consumer wiring its OWN scroll-restoration (e.g. `initialOffset` /
47
+ * `initialMeasurementsCache`, restoring a prior session's position) wants `initialScroll: 'start'` —
48
+ * otherwise this default jump fires first and the restoration has to fight it. `initialScroll` is
49
+ * ignored (no scroll, no throw) for an empty transcript, and is deferred rather than treated as done
50
+ * if the transcript's own scroll container measures 0px on mount (e.g. mounted behind a hidden
51
+ * ancestor) — it then lands on the first commit where the container is genuinely measurable, which
52
+ * is what makes "opens at the newest message" hold for a transcript whose lazy virtualizer settled
53
+ * while its `ThreadFeedRow` was collapsed. See `thread-message.tsx`'s `applyInitialScroll` for the
54
+ * guard, and `VirtualizedRowsInner` for why its effect is deliberately dependency-free.
55
+ *
56
+ * Firing `scrollToEnd()` once is not sufficient on its own to land there, because virtual-core
57
+ * 3.17.1's own `_willUpdate` writes to the SAME scroll container on the very next commit it runs
58
+ * on, from state that lags behind the DOM: `_scrollToOffset` only ever records the write's
59
+ * intent (`_intendedScrollOffset`) — `this.scrollOffset` itself updates ASYNCHRONOUSLY, from the
60
+ * native `scroll` event, not from the call that requested it. So a commit that runs `_willUpdate`
61
+ * before this effect had a chance to fire (element-attach) or that re-derives an anchor from
62
+ * `getScrollOffset()` while `this.scrollOffset` is still the pre-jump value (the anchor branch,
63
+ * gated on `pendingScrollAnchor`) writes that stale offset — 0, on first mount — straight back to
64
+ * `scrollTop`, clobbering this effect's jump within roughly one extra commit of it landing.
65
+ * `applyInitialScroll` survives this the same way the hidden-ancestor case above already
66
+ * (accidentally) does: by not treating one successful call as permanent. It fires, then — on a
67
+ * LATER call, i.e. a later commit, exactly the cadence this dependency-free effect already runs on
68
+ * — reads the container's REAL `scrollTop`/`scrollHeight`/`clientHeight` (never virtual-core's own
69
+ * `scrollOffset`, which is exactly the stale value that caused the clobber) to check whether the
70
+ * jump survived; if it didn't, it re-fires, bounded by `MAX_INITIAL_SCROLL_ATTEMPTS` so a DOM that
71
+ * pathologically never reports settled can never be fought forever. `resolveInitialScrollAction`
72
+ * itself is untouched by any of this — it is still the one-shot "should I even attempt this"
73
+ * decision; `applyInitialScroll` layers the across-commits verification on top.
74
+ *
75
+ * `initialOffset` (`number | (() => number)`, `virtual-core`'s own construction-time seed for
76
+ * `scrollOffset`) was investigated as a way to avoid the clobber altogether and rejected: it takes
77
+ * a concrete pixel number, not an `'end'` sentinel, and the only number available at the point
78
+ * it would need to resolve — before any row has ever been measured — is an ESTIMATE
79
+ * (`estimateSize` × count), not the real total. It would relocate the transcript's initial paint
80
+ * from message #0 to an approximately-right position, but the moment real measurements replace
81
+ * those estimates the total size (and therefore the true end offset) changes, which still needs a
82
+ * corrective `scrollToEnd()` once rows have actually measured — the exact write this whole
83
+ * mechanism exists to protect. It also can't reference the `virtualizer` instance it would be
84
+ * computing an offset for without a separate ref indirection, since it is itself one of the options
85
+ * passed to construct that instance. Not a fix for this defect, just a smaller wrong first paint.
86
+ */
87
+ /** Tuning knobs passed through to `@tanstack/react-virtual`'s `useVirtualizer`. */
88
+ export type VirtualizeOptions = {
89
+ /** Extra rows rendered beyond the visible viewport, each side. Library default: 1. */
90
+ readonly overscan?: number;
91
+ /** Estimated row height in px, used before a row has been measured. */
92
+ readonly estimateSize?: number;
93
+ /** Where the transcript sits on first mount. Default 'end' — a chat transcript opens at the
94
+ newest message. 'start' opens at the oldest. See this module's fourth composition rule
95
+ above for the mechanism and why a consumer restoring its own scroll position wants 'start'. */
96
+ readonly initialScroll?: 'end' | 'start';
97
+ };
98
+ /**
99
+ * `virtualize: false` (or omitted) → no `height` prop (content-sized, non-scrolling-owner layout).
100
+ * `virtualize: true | VirtualizeOptions` → `height` is REQUIRED — the virtualizer measures a fixed
101
+ * scroll container, so there is no valid virtualized layout without one.
102
+ */
103
+ export type VirtualizeProps = {
104
+ readonly virtualize?: false;
105
+ readonly height?: never;
106
+ } | {
107
+ readonly virtualize: true | VirtualizeOptions;
108
+ readonly height: number | string;
109
+ };
110
+ /** The enabled branch of {@link VirtualizeProps}, with `height` no longer optional. */
111
+ export type ResolvedVirtualize = {
112
+ readonly options: VirtualizeOptions;
113
+ readonly height: number | string;
114
+ };
115
+ /**
116
+ * Narrows a `VirtualizeProps` pair once, centrally: `null` when virtualization is off, otherwise
117
+ * the options object (normalizing the bare `virtualize: true` shorthand to `{}`) alongside the
118
+ * `height` the union guarantees is present. Every component accepting `VirtualizeProps` resolves
119
+ * through here rather than destructuring the two fields apart — destructuring severs the link TS
120
+ * needs, which is what forces a non-null assertion on `height` at each call site.
121
+ */
122
+ export declare function resolveVirtualize(props: VirtualizeProps): ResolvedVirtualize | null;
123
+ //# sourceMappingURL=virtualize.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"virtualize.d.ts","sourceRoot":"","sources":["../../src/agent-chat/virtualize.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAqFG;AAEH,mFAAmF;AACnF,MAAM,MAAM,iBAAiB,GAAG;IAC9B,sFAAsF;IACtF,QAAQ,CAAC,QAAQ,CAAC,EAAE,MAAM,CAAA;IAC1B,uEAAuE;IACvE,QAAQ,CAAC,YAAY,CAAC,EAAE,MAAM,CAAA;IAC9B;;sGAEkG;IAClG,QAAQ,CAAC,aAAa,CAAC,EAAE,KAAK,GAAG,OAAO,CAAA;CACzC,CAAA;AAED;;;;GAIG;AACH,MAAM,MAAM,eAAe,GACvB;IAAE,QAAQ,CAAC,UAAU,CAAC,EAAE,KAAK,CAAC;IAAC,QAAQ,CAAC,MAAM,CAAC,EAAE,KAAK,CAAA;CAAE,GACxD;IAAE,QAAQ,CAAC,UAAU,EAAE,IAAI,GAAG,iBAAiB,CAAC;IAAC,QAAQ,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,CAAA;CAAE,CAAA;AAEvF,uFAAuF;AACvF,MAAM,MAAM,kBAAkB,GAAG;IAC/B,QAAQ,CAAC,OAAO,EAAE,iBAAiB,CAAA;IACnC,QAAQ,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,CAAA;CACjC,CAAA;AAED;;;;;;GAMG;AACH,wBAAgB,iBAAiB,CAAC,KAAK,EAAE,eAAe,GAAG,kBAAkB,GAAG,IAAI,CAUnF"}
@@ -0,0 +1,9 @@
1
+ function resolveVirtualize(props) {
2
+ const { virtualize } = props;
3
+ if (virtualize === void 0 || virtualize === false) return null;
4
+ const height = props.height;
5
+ return { options: virtualize === true ? {} : virtualize, height };
6
+ }
7
+ export {
8
+ resolveVirtualize
9
+ };
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=virtualize.type-guard.test.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"virtualize.type-guard.test.d.ts","sourceRoot":"","sources":["../../src/agent-chat/virtualize.type-guard.test.ts"],"names":[],"mappings":""}
@@ -7,7 +7,11 @@
7
7
  *
8
8
  * Optional peers:
9
9
  * - @tanstack/react-table >=8 <9 (BasaltDataTable)
10
- * - @tanstack/react-virtual >=3 <4 (BasaltVirtualList)
10
+ * - @tanstack/react-virtual >=3.13.26 <4 (BasaltVirtualList)
11
+ *
12
+ * BasaltVirtualList itself works on any 3.x; the declared floor is set by ./agent-chat's
13
+ * ThreadTranscript virtualize mode (it calls scrollToEnd/anchorTo, added in virtual-core 3.16.0,
14
+ * first pinned by react-virtual 3.13.26). npm has one peer range per package, so do not lower it.
11
15
  *
12
16
  * Install with:
13
17
  * bun add @tanstack/react-table @tanstack/react-virtual
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/data/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA8BG;AAGH,cAAc,SAAS,CAAA;AAGvB,cAAc,WAAW,CAAA"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/data/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAkCG;AAGH,cAAc,SAAS,CAAA;AAGvB,cAAc,WAAW,CAAA"}
@@ -1 +1 @@
1
- {"version":3,"file":"virtual-list.d.ts","sourceRoot":"","sources":["../../src/data/virtual-list.tsx"],"names":[],"mappings":"AAmBA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAA;AAItC;;;;;;;;;;;;GAYG;AACH,MAAM,MAAM,sBAAsB,CAAC,CAAC,IAAI;IACtC,+EAA+E;IAC/E,KAAK,EAAE,CAAC,EAAE,CAAA;IACV,+FAA+F;IAC/F,MAAM,EAAE,MAAM,GAAG,MAAM,CAAA;IACvB;;;OAGG;IACH,YAAY,CAAC,EAAE,MAAM,CAAA;IACrB;;;OAGG;IACH,QAAQ,CAAC,EAAE,MAAM,CAAA;IACjB;;;OAGG;IACH,UAAU,EAAE,CAAC,IAAI,EAAE,CAAC,EAAE,KAAK,EAAE,MAAM,KAAK,SAAS,CAAA;IACjD;;;OAGG;IACH,UAAU,CAAC,EAAE,CAA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L,MAAM,EACN,YAAiB,EACjB,QAAY,EACZ,UAAU,EACV,UAAU,EACV,SAAiB,EACjB,YAAgB,GACjB,EAAE,sBAAsB,CAAC,CAAC,CAAC,+BAmF3B"}
@@ -2,7 +2,8 @@
2
2
  * ./data/virtual — BasaltVirtualList: a windowed virtual list over @tanstack/react-virtual,
3
3
  * rendered with a Mantine Box scroll container.
4
4
  *
5
- * Optional peer: @tanstack/react-virtual >=3 <4.
5
+ * Optional peer: @tanstack/react-virtual >=3.13.26 <4. This list works on any 3.x — the floor is
6
+ * set by ./agent-chat's virtualize mode (see ./data/index.ts), so do not lower it.
6
7
  *
7
8
  * Use this fine subpath instead of the `./data` barrel when your app only needs the virtual list
8
9
  * — it does NOT value-import @tanstack/react-table, so the data-table peer is never required.
@@ -1 +1 @@
1
- {"version":3,"file":"virtual.d.ts","sourceRoot":"","sources":["../../src/data/virtual.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAGH,OAAO,EAAE,iBAAiB,EAAE,MAAM,gBAAgB,CAAA;AAClD,YAAY,EAAE,sBAAsB,EAAE,MAAM,gBAAgB,CAAA"}
1
+ {"version":3,"file":"virtual.d.ts","sourceRoot":"","sources":["../../src/data/virtual.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;GAiBG;AAGH,OAAO,EAAE,iBAAiB,EAAE,MAAM,gBAAgB,CAAA;AAClD,YAAY,EAAE,sBAAsB,EAAE,MAAM,gBAAgB,CAAA"}
package/dist/index.d.ts CHANGED
@@ -18,8 +18,8 @@ export { ConnectivityProvider, ConnectivityIndicator, useConnectivity } from './
18
18
  export type { ConnectivityStatus, ConnectivitySnapshot, ConnectivityProviderProps, ConnectivityOverride, } from './connectivity/index.js';
19
19
  export type { SurfaceSpec, RuleName, SkillName } from './surfaces.js';
20
20
  export type { GuardKind } from './guard/types.js';
21
- export { ThreadWorkspace, ThreadFeed, ThreadOutcomeCard, ThreadDetailPanel, Composer, threadPartRenderers, ThreadTranscript, ToolChip, } from './agent-chat/index.js';
22
- export type { ThreadWorkspaceProps, ThreadFeedProps, ThreadOutcomeCardProps, ThreadDetailPanelProps, ComposerProps, ComposerSubmit, ComposerAttachment, ComposerHandle, ThreadTranscriptProps, ToolChipProps, } from './agent-chat/index.js';
21
+ export { ThreadWorkspace, ThreadFeed, ThreadFeedRow, ThreadOutcomeCard, ThreadDetailPanel, Composer, threadPartRenderers, ThreadTranscript, ToolChip, } from './agent-chat/index.js';
22
+ export type { ThreadWorkspaceProps, ThreadFeedProps, ThreadFeedRowProps, ThreadOutcomeCardProps, ThreadDetailPanelProps, ComposerProps, ComposerSubmit, ComposerAttachment, ComposerHandle, ThreadTranscriptProps, MessageAffordances, VirtualizeOptions, VirtualizeProps, ToolChipProps, } from './agent-chat/index.js';
23
23
  export { createAdapterThreadsStore, createThreadsStore, heuristicOutcome, threadsStoreAdapterContract, useAgentThreadRuns, } from './agent/index.js';
24
24
  export type { AdapterThreadsStoreOptions, AgentThread, AgentOutcome, ThreadStatus, ThreadsStore, ThreadsStoreAdapter, ThreadsStoreAdapterContractCase, ThreadsStoreOptions, OutcomeResolver, ChatMessage, AgentPart, AgentTransport, } from './agent/index.js';
25
25
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,EACL,cAAc,EACd,KAAK,mBAAmB,EACxB,mBAAmB,EACnB,KAAK,kBAAkB,GACxB,MAAM,YAAY,CAAA;AACnB,OAAO,EAAE,iBAAiB,EAAE,SAAS,EAAE,oBAAoB,EAAE,MAAM,SAAS,CAAA;AAC5E,YAAY,EAAE,iBAAiB,EAAE,wBAAwB,EAAE,MAAM,SAAS,CAAA;AAC1E,OAAO,EAAE,WAAW,EAAE,KAAK,gBAAgB,EAAE,MAAM,gBAAgB,CAAA;AACnE,OAAO,EAAE,eAAe,EAAE,aAAa,EAAE,oBAAoB,EA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EAAE,SAAS,EAAE,MAAM,eAAe,CAAA;AAU9C,OAAO,EACL,eAAe,EACf,UAAU,EACV,aAAa,EACb,iBAAiB,EACjB,iBAAiB,EACjB,QAAQ,EACR,mBAAmB,EACnB,gBAAgB,EAChB,QAAQ,GACT,MAAM,cAAc,CAAA;AACrB,YAAY,EACV,oBAAoB,EACpB,eAAe,EACf,kBAAkB,EAClB,sBAAsB,EACtB,sBAAsB,EACtB,aAAa,EACb,cAAc,EACd,kBAAkB,EAClB,cAAc,EACd,qBAAqB,EACrB,kBAAkB,EAClB,iBAAiB,EACjB,eAAe,EACf,aAAa,GACd,MAAM,cAAc,CAAA;AACrB,OAAO,EACL,yBAAyB,EACzB,kBAAkB,EAClB,gBAAgB,EAChB,2BAA2B,EAC3B,kBAAkB,GACnB,MAAM,SAAS,CAAA;AAChB,YAAY,EACV,0BAA0B,EAC1B,WAAW,EACX,YAAY,EACZ,YAAY,EACZ,YAAY,EACZ,mBAAmB,EACnB,+BAA+B,EAC/B,mBAAmB,EACnB,eAAe,EACf,WAAW,EACX,SAAS,EACT,cAAc,GACf,MAAM,SAAS,CAAA"}
package/dist/index.js CHANGED
@@ -37,6 +37,7 @@ import { ConnectivityProvider, ConnectivityIndicator, useConnectivity } from "./
37
37
  import {
38
38
  ThreadWorkspace,
39
39
  ThreadFeed,
40
+ ThreadFeedRow,
40
41
  ThreadOutcomeCard,
41
42
  ThreadDetailPanel,
42
43
  Composer,
@@ -79,6 +80,7 @@ export {
79
80
  ThemeToggle,
80
81
  ThreadDetailPanel,
81
82
  ThreadFeed,
83
+ ThreadFeedRow,
82
84
  ThreadOutcomeCard,
83
85
  ThreadTranscript,
84
86
  ThreadWorkspace,
@@ -51,6 +51,24 @@ export type AppSidebarProps = {
51
51
  * fixed, non-scrolling row. Pair with basalt-ui/commands' openSpotlight.
52
52
  */
53
53
  search?: SidebarSearchConfig;
54
+ /**
55
+ * Arbitrary content appended after `sections` inside the nav `ScrollArea` — a tree, a filter
56
+ * panel, a project list, anything a set of `SidebarItem`s can't express. Renders as the last
57
+ * child of the scrolling nav column, so a long list scrolls with the rest of the nav instead of
58
+ * fighting it for height. Pass `sections={[]}` to use this slot exclusively; the section-spacing
59
+ * rule only fires between adjacent children, so an empty `sections` produces no orphan divider or
60
+ * dead padding above it.
61
+ *
62
+ * Hidden on the collapsed desktop rail; still present in the mobile drawer, which opens at full
63
+ * width. The rail is ~56px of icon buttons with no sensible representation for arbitrary
64
+ * consumer content, so the CSS media query that drives the rail hides this slot the same way it
65
+ * hides `.childList` — never a JS check on `collapsed`, since that one value is shared by the
66
+ * rail AND the drawer (only the media query tells them apart). `SidebarSearch` gets to adapt
67
+ * itself to the rail (it takes `collapsed` and renders its own icon-only form) because the shell
68
+ * owns that control; it cannot adapt content it knows nothing about, so this slot hides instead
69
+ * of squashing it.
70
+ */
71
+ navExtra?: ReactNode;
54
72
  };
55
- export declare function AppSidebar({ brand, sections, collapsed, onToggleCollapse, onClose, renderNavLink, settingsMenuItems, footerExtra, account, search, }: AppSidebarProps): import("react").JSX.Element;
73
+ export declare function AppSidebar({ brand, sections, collapsed, onToggleCollapse, onClose, renderNavLink, settingsMenuItems, footerExtra, account, search, navExtra, }: AppSidebarProps): import("react").JSX.Element;
56
74
  //# sourceMappingURL=app-sidebar.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"app-sidebar.d.ts","sourceRoot":"","sources":["../../src/shell/app-sidebar.tsx"],"names":[],"mappings":"AA+BA,OAAO,KAAK,EAAc,SAAS,EAAE,MAAM,OAAO,CAAA;AAClD,OAAO,KAAK,EAAE,WAAW,EAAE,gBAAgB,EAAE,WAAW,EAAE,cAAc,EAAE,MAAM,SAAS,CAAA;AAEzF,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,iBAAiB,CAAA;AAEzD,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,kBAAkB,CAAA;AAK3D;;;;;;;;;;;;GAYG;AACH,MAAM,MAAM,eAAe,GAAG,CAC5B,IAAI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;;GAYG;AACH,MAAM,MAAM,eAAe,GAAG,CAC5B,IAAI,EAAE,WAAW,EACjB,IAAI,EAAE;IACJ,MAAM,EAAE,OAAO,CAAA;IACf,KAAK,CAAC,EAAE,CAAC,MAAM,IAAI,CAAC,GAAG,SAAS,CAAA;IAChC,gBAAgB,CAAC,EAAE,MAAM,GAAG,SAAS,CAAA;CACtC,KACE,SAAS,CAAA;AAEd,MAAM,MAAM,eAAe,GAAG;IAC5B,KAAK,EAAE,WAAW,CAAA;IAClB,QAAQ,EAAE,cAAc,EAAE,CAAA;IAC1B,SAAS,EAAE,OAAO,CAAA;IAClB,gBAAgB,EAAE,MAAM,IAAI,CAAA;IAC5B,OAAO,EAAE,MAAM,IAAI,CAAA;IACnB;;;OAGG;IACH,aAAa,CAAC,EAAE,eAAe,CAAA;IAC/B;;;;;OAKG;IACH,iBAAiB,CAAC,EAAE,gBAAgB,EAAE,CAAA;IACtC,mGAAmG;IACnG,WAAW,CAAC,EAAE,SAAS,CAAA;IACvB;;;;OAIG;IACH,OAAO,CAAC,EAAE,kBAAkB,CAAA;IAC5B;;;OAGG;IACH,MAAM,CAAC,EAAE,mBAAmB,CAAA;IAC5B;;;;;;;;;;;;;;;;OAgBG;IACH,QAAQ,CAAC,EAAE,SAAS,CAAA;CACrB,CAAA;AAkWD,wBAAgB,UAAU,CAAC,EACzB,KAAK,EACL,QAAQ,EACR,SAAS,EACT,gBAAgB,EAChB,OAAO,EACP,aAAa,EACb,iBAAiB,EACjB,WAAW,EACX,OAAO,EACP,MAAM,EACN,QAAQ,GACT,EAAE,eAAe,+BAyLjB"}
@@ -314,7 +314,8 @@ function AppSidebar({
314
314
  settingsMenuItems,
315
315
  footerExtra,
316
316
  account,
317
- search
317
+ search,
318
+ navExtra
318
319
  }) {
319
320
  const { step } = useBasaltSpacing();
320
321
  const [collapsedSections, setCollapsedSections] = useState(
@@ -410,33 +411,36 @@ function AppSidebar({
410
411
  scrollbarSize: 9,
411
412
  className: classes.navScroll,
412
413
  classNames: { viewport: classes.navViewport },
413
- children: /* @__PURE__ */ jsx(Stack, { gap: 0, className: classes.nav, children: sections.map((section) => {
414
- if (!section.collapsible) {
414
+ children: /* @__PURE__ */ jsxs(Stack, { gap: 0, className: classes.nav, children: [
415
+ sections.map((section) => {
416
+ if (!section.collapsible) {
417
+ return /* @__PURE__ */ jsxs("div", { children: [
418
+ /* @__PURE__ */ jsx("div", { className: classes.sectionBand, children: /* @__PURE__ */ jsx(SectionLabel, { flush: true, children: section.label }) }),
419
+ /* @__PURE__ */ jsx(Stack, { gap: 1, children: renderSectionItems(section) })
420
+ ] }, section.label);
421
+ }
422
+ const isOpen = !collapsedSections[section.label];
415
423
  return /* @__PURE__ */ jsxs("div", { children: [
416
- /* @__PURE__ */ jsx("div", { className: classes.sectionBand, children: /* @__PURE__ */ jsx(SectionLabel, { flush: true, children: section.label }) }),
417
- /* @__PURE__ */ jsx(Stack, { gap: 1, children: renderSectionItems(section) })
424
+ /* @__PURE__ */ jsxs(
425
+ UnstyledButton,
426
+ {
427
+ className: `${classes.sectionBand} ${classes.sectionHeader}`,
428
+ onClick: () => setCollapsedSections((prev) => ({
429
+ ...prev,
430
+ [section.label]: !prev[section.label]
431
+ })),
432
+ "aria-expanded": isOpen,
433
+ children: [
434
+ /* @__PURE__ */ jsx(SectionLabel, { flush: true, children: section.label }),
435
+ /* @__PURE__ */ jsx(IconChevron, { open: isOpen })
436
+ ]
437
+ }
438
+ ),
439
+ /* @__PURE__ */ jsx(Collapse, { expanded: isOpen, children: /* @__PURE__ */ jsx(Stack, { gap: 1, children: renderSectionItems(section) }) })
418
440
  ] }, section.label);
419
- }
420
- const isOpen = !collapsedSections[section.label];
421
- return /* @__PURE__ */ jsxs("div", { children: [
422
- /* @__PURE__ */ jsxs(
423
- UnstyledButton,
424
- {
425
- className: `${classes.sectionBand} ${classes.sectionHeader}`,
426
- onClick: () => setCollapsedSections((prev) => ({
427
- ...prev,
428
- [section.label]: !prev[section.label]
429
- })),
430
- "aria-expanded": isOpen,
431
- children: [
432
- /* @__PURE__ */ jsx(SectionLabel, { flush: true, children: section.label }),
433
- /* @__PURE__ */ jsx(IconChevron, { open: isOpen })
434
- ]
435
- }
436
- ),
437
- /* @__PURE__ */ jsx(Collapse, { expanded: isOpen, children: /* @__PURE__ */ jsx(Stack, { gap: 1, children: renderSectionItems(section) }) })
438
- ] }, section.label);
439
- }) })
441
+ }),
442
+ navExtra !== void 0 && navExtra !== null && /* @__PURE__ */ jsx("div", { className: classes.navExtra, children: navExtra })
443
+ ] })
440
444
  }
441
445
  ),
442
446
  account ? /* @__PURE__ */ jsxs(Stack, { gap: 0, className: classes.footer, children: [
@@ -419,4 +419,15 @@
419
419
  .root[data-collapsed] .childList {
420
420
  display: none;
421
421
  }
422
+
423
+ /* `navExtra` has no sensible icon-rail representation (arbitrary consumer content, not a nav
424
+ * row) — hide it in the rail, same treatment as `.childList`. It stays mounted (never a JS
425
+ * conditional on `collapsed`): `collapsed` is one value shared by the desktop rail AND the
426
+ * mobile drawer (`AppShell.Navbar`'s `collapsed: { mobile: !mobileOpened }` only ever un-collapses
427
+ * the mobile side), and the rail-vs-drawer split lives ENTIRELY in this media query, never in JS —
428
+ * a JS gate on `collapsed` would also drop `navExtra` from the mobile drawer, which opens at full
429
+ * width regardless of the persisted rail state. */
430
+ .root[data-collapsed] .navExtra {
431
+ display: none;
432
+ }
422
433
  }
@@ -29,6 +29,7 @@ declare const classes: {
29
29
  readonly sectionHeader: string
30
30
  readonly subnavDropdown: string
31
31
  readonly childList: string
32
+ readonly navExtra: string
32
33
  readonly ghostIcon: string
33
34
  }
34
35
  export default classes
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=app-sidebar.test.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"app-sidebar.test.d.ts","sourceRoot":"","sources":["../../src/shell/app-sidebar.test.tsx"],"names":[],"mappings":""}
@@ -73,6 +73,15 @@ export type BasaltShellProps = {
73
73
  globalActions?: ReactNode;
74
74
  /** Extra content appended to the sidebar footer, beside the settings menu (mobile close, etc.). */
75
75
  sidebarFooterExtra?: ReactNode;
76
+ /**
77
+ * Arbitrary content appended after `sections` inside the sidebar's nav scroll region (a tree, a
78
+ * filter panel, a project list, …). Hidden on the collapsed desktop rail; still present in the
79
+ * mobile drawer, which opens at full width — see `AppSidebarProps.navExtra`'s JSDoc for why.
80
+ * `AppSidebar` renders once and serves both the desktop rail and the mobile drawer (collapse
81
+ * styling is gated behind a `min-width: sm` media query, not a second render), so this slot
82
+ * reaches both.
83
+ */
84
+ sidebarNavExtra?: ReactNode;
76
85
  /** Entries appended to the sidebar settings menu. */
77
86
  settingsMenuItems?: SettingsMenuItem[];
78
87
  /**
@@ -119,5 +128,5 @@ export type BasaltShellProps = {
119
128
  export declare function NavCountBadge({ count }: {
120
129
  count: number;
121
130
  }): import("react").JSX.Element | null;
122
- export declare function BasaltShell({ brand, sections, renderNavLink, globalActions, sidebarFooterExtra, settingsMenuItems, storageKey, collapsed: collapsedProp, onCollapsedChange, renderBreadcrumbLink, account, search, children, }: BasaltShellProps): import("react").JSX.Element;
131
+ export declare function BasaltShell({ brand, sections, renderNavLink, globalActions, sidebarFooterExtra, sidebarNavExtra, settingsMenuItems, storageKey, collapsed: collapsedProp, onCollapsedChange, renderBreadcrumbLink, account, search, children, }: BasaltShellProps): import("react").JSX.Element;
123
132
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/shell/index.tsx"],"names":[],"mappings":"AAcA,OAAO,KAAK,EAAE,UAAU,EAAE,SAAS,EAAE,MAAM,OAAO,CAAA;AAElD,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,eAAe,CAAA;AAIpD,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,mBAAmB,CAAA;AAE/D,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,iBAAiB,CAAA;AACzD,OAAO,KAAK,EAAE,mBAAmB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AE,SAAS,CAAA;CACrB,CAAA;AAED;;;;;;GAMG;AACH,wBAAgB,aAAa,CAAC,EAAE,KAAK,EAAE,EAAE;IAAE,KAAK,EAAE,MAAM,CAAA;CAAE,sCAsBzD;AA2ED,wBAAgB,WAAW,CAAC,EAC1B,KAAK,EACL,QAAQ,EACR,aAAa,EACb,aAAa,EACb,kBAAkB,EAClB,eAAe,EACf,iBAAiB,EACjB,UAAuC,EACvC,SAAS,EAAE,aAAa,EACxB,iBAAiB,EACjB,oBAAoB,EACpB,OAAO,EACP,MAAM,EACN,QAAQ,GACT,EAAE,gBAAgB,+BAkFlB"}
@@ -95,6 +95,7 @@ function BasaltShell({
95
95
  renderNavLink,
96
96
  globalActions,
97
97
  sidebarFooterExtra,
98
+ sidebarNavExtra,
98
99
  settingsMenuItems,
99
100
  storageKey = "basalt-sidebar-collapsed",
100
101
  collapsed: collapsedProp,
@@ -153,6 +154,7 @@ function BasaltShell({
153
154
  onToggleCollapse: toggleCollapse,
154
155
  onClose: closeMobile,
155
156
  footerExtra: sidebarFooterExtra,
157
+ navExtra: sidebarNavExtra,
156
158
  ...renderNavLink !== void 0 && { renderNavLink },
157
159
  ...settingsMenuItems !== void 0 && { settingsMenuItems },
158
160
  ...account !== void 0 && { account },
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=index.test.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.test.d.ts","sourceRoot":"","sources":["../../src/shell/index.test.tsx"],"names":[],"mappings":""}
@@ -297,8 +297,8 @@ export declare const SURFACES: {
297
297
  readonly rule: "agent";
298
298
  readonly skill: readonly ["basalt-app"];
299
299
  readonly guardKinds: readonly [];
300
- readonly description: "Mantine-styled thread-chat components over basalt-ui/agent: ThreadWorkspace, ThreadFeed, ThreadOutcomeCard, ThreadDetailPanel, Composer, ThreadTranscript (open part-renderer registry via its renderers/fallbackRenderer props), threadPartRenderers, ToolChip (Mantine-coupled). motion is required, not optional — ThreadFeed/ThreadDetailPanel import motion/react eagerly, so this subpath fails to resolve without it installed even though peerDependenciesMeta marks it optional (npm has no per-subpath optionality). remend is genuinely optional here — ThreadTranscript reaches it only through the lazy dynamic import() inside content/markdown.tsx.";
301
- readonly optionalPeers: readonly ["ai", "motion", "remend", "use-stick-to-bottom", "react-markdown", "remark-gfm", "shiki", "@shikijs/langs", "@shikijs/themes", "beautiful-mermaid"];
300
+ readonly description: "Mantine-styled thread-chat components over basalt-ui/agent: ThreadWorkspace, ThreadFeed (variant/renderRow), ThreadFeedRow (inline-expanding Slack row, lazily mounted + kept mounted), ThreadOutcomeCard, ThreadDetailPanel, Composer, ThreadTranscript (open part-renderer registry via its renderers/fallbackRenderer props, per-message MessageAffordances, groupConsecutive, and an optional virtualize/height windowing mode whose VirtualizeOptions carry overscan/estimateSize/initialScroll — a virtualized transcript opens scrolled to the newest message unless initialScroll is \"start\"), threadPartRenderers, ToolChip (Mantine-coupled). motion is required, not optional — ThreadFeed/ThreadDetailPanel import motion/react eagerly, so this subpath fails to resolve without it installed even though peerDependenciesMeta marks it optional (npm has no per-subpath optionality). remend is genuinely optional here — ThreadTranscript reaches it only through the lazy dynamic import() inside content/markdown.tsx, and @tanstack/react-virtual the same way through the lazy import() behind ThreadTranscript virtualize (absent peer degrades to an unwindowed, height-bound pane).";
301
+ readonly optionalPeers: readonly ["ai", "motion", "remend", "use-stick-to-bottom", "react-markdown", "remark-gfm", "shiki", "@shikijs/langs", "@shikijs/themes", "beautiful-mermaid", "@tanstack/react-virtual"];
302
302
  readonly forbiddenImports: readonly [];
303
303
  };
304
304
  readonly './content': {
@@ -1 +1 @@
1
- {"version":3,"file":"surfaces.d.ts","sourceRoot":"","sources":["../src/surfaces.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AACH,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,eAAe,CAAA;AAI9C;;;;;GAKG;AACH,MAAM,MAAM,QAAQ,GAChB,QAAQ,GACR,QAAQ,GACR,SAAS,GACT,QAAQ,GAC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