@columenlabs/lumen-ui 0.1.269 → 0.1.271
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.
|
@@ -109,7 +109,7 @@ export declare function readAssistantImage(file: File): Promise<AssistantImage |
|
|
|
109
109
|
* point at (the `sources`), `#` a tier for this message; a picked tier or thing shows as a chip.
|
|
110
110
|
*/
|
|
111
111
|
export declare function LumenComposer({ name, busy, queued, queue, canSteer, onSteerQueued, onUnqueue, disabled, commands, tiers, sources, page, images: canAttach, modes, onSend, onStop, meter, }: {
|
|
112
|
-
/** Drawn in the icon row
|
|
112
|
+
/** Drawn in the icon row after the paperclip and the modes: `LumenAssistant` puts its context donut here. */
|
|
113
113
|
meter?: ReactNode;
|
|
114
114
|
/** Toggles beside the paperclip (`LumenAssistant` `modes`). */
|
|
115
115
|
modes?: AssistantMode[];
|
|
@@ -904,7 +904,7 @@ export function LumenComposer({ name, busy, queued, queue, canSteer = false, onS
|
|
|
904
904
|
if (e.target.files)
|
|
905
905
|
attach(e.target.files);
|
|
906
906
|
e.target.value = '';
|
|
907
|
-
} })] })),
|
|
907
|
+
} })] })), modes.map((md) => (_jsx(IconButton, { icon: md.icon, label: md.label, size: "icon-xs", variant: use === md.id ? 'secondary' : 'ghost', "aria-pressed": use === md.id, className: cn(use === md.id && 'text-primary'), disabled: disabled, onClick: () => setUse((u) => (u === md.id ? null : md.id)) }, md.id))), meter, _jsx("div", { className: "ml-auto", children: busy && !text.trim() ? (_jsx(IconButton, { icon: SquareIcon, label: "Stop", variant: "outline", size: "icon-xs", onClick: onStop })) : busy ? (_jsxs("span", { className: "flex gap-1", children: [_jsx(IconButton, { icon: ListPlusIcon, label: canSteer ? 'Queue for after (⌥↩)' : 'Queue for after (↩)', variant: canSteer ? 'outline' : 'default', size: "icon-xs", disabled: disabled, onClick: () => send('queue') }), canSteer && (_jsx(IconButton, { icon: CornerDownRightIcon, label: "Steer now (\u21A9)", variant: "default", size: "icon-xs", disabled: disabled, onClick: () => send('steer') }))] })) : (_jsx(IconButton, { icon: ArrowUpIcon, label: "Send", variant: "default", size: "icon-xs", disabled: !text.trim() || disabled, onClick: () => send() })) })] })] })] }));
|
|
908
908
|
}
|
|
909
909
|
/**
|
|
910
910
|
* What waits above the box while an answer runs: steering messages until the answer reads them,
|
|
@@ -933,7 +933,7 @@ const pointedRef = (p) => p.kind === 'card'
|
|
|
933
933
|
const CONTEXT_WATCH = 75_000;
|
|
934
934
|
const CONTEXT_ALERT = 100_000;
|
|
935
935
|
/**
|
|
936
|
-
* How full the chat's context is, as a small donut in the composer's icon row (after the paperclip):
|
|
936
|
+
* How full the chat's context is, as a small donut in the composer's icon row (after the paperclip and the modes):
|
|
937
937
|
* it fills against `CONTEXT_MAX`, neutral below 75k, yellow from 75k, red from 100k. The hover gives
|
|
938
938
|
* the tokens used, where the chat compacts, and how much of the last turn came from the prompt cache.
|
|
939
939
|
* What a chat cost is not shown here: a person reads their use in Settings.
|
|
@@ -952,7 +952,7 @@ function ContextDonut({ usage, compactAt }) {
|
|
|
952
952
|
: 'text-muted-foreground';
|
|
953
953
|
const cached = usage && usage.in > 0 ? Math.round((usage.read / usage.in) * 100) : null;
|
|
954
954
|
const said = `Context ${tokens(ctx)} of ${tokens(CONTEXT_MAX)}`;
|
|
955
|
-
return (_jsxs(Tooltip, { children: [_jsx(TooltipTrigger, { asChild: true, children: _jsx("button", { type: "button", "aria-label": said, "data-testid": "context-donut", className: cn('grid size-6 place-items-center rounded-md hover:bg-muted focus-visible:ring-2 focus-visible:ring-ring focus-visible:outline-none', tone), children: _jsxs("svg", { viewBox: "0 0 16 16", className: "size-4 -rotate-90", "aria-hidden": "true", children: [_jsx("title", { children: said }), _jsx("circle", { cx: "8", cy: "8", r: r, fill: "none", strokeWidth: "2.5", className: "stroke-muted" }), _jsx("circle", { cx: "8", cy: "8", r: r, fill: "none", strokeWidth: "2.5", stroke: "currentColor", strokeDasharray: `${share * round} ${round}` })] }) }) }), _jsxs(TooltipContent, { className: "flex flex-col gap-0.5", children: [_jsx("span", { className: "num", children: said }), _jsxs("span", { className: "num text-muted-foreground", children: ["Compacts at ", tokens(compactAt)] }), cached !== null && (_jsxs("span", { className: "num text-muted-foreground", children: [cached, "% of the last turn read from cache"] }))] })] }));
|
|
955
|
+
return (_jsxs(Tooltip, { children: [_jsx(TooltipTrigger, { asChild: true, children: _jsx("button", { type: "button", "aria-label": said, "data-testid": "context-donut", className: cn('grid size-6 place-items-center rounded-md hover:bg-muted focus-visible:ring-2 focus-visible:ring-ring focus-visible:outline-none', tone), children: _jsxs("svg", { viewBox: "0 0 16 16", className: "size-4 -rotate-90", "aria-hidden": "true", children: [_jsx("title", { children: said }), _jsx("circle", { cx: "8", cy: "8", r: r, fill: "none", strokeWidth: "2.5", className: "stroke-muted-foreground/25" }), _jsx("circle", { cx: "8", cy: "8", r: r, fill: "none", strokeWidth: "2.5", stroke: "currentColor", strokeDasharray: `${share * round} ${round}` })] }) }) }), _jsxs(TooltipContent, { className: "flex flex-col items-start gap-0.5 text-left", children: [_jsx("span", { className: "num", children: said }), _jsxs("span", { className: "num text-muted-foreground", children: ["Compacts at ", tokens(compactAt)] }), cached !== null && (_jsxs("span", { className: "num text-muted-foreground", children: [cached, "% of the last turn read from cache"] }))] })] }));
|
|
956
956
|
}
|
|
957
957
|
/**
|
|
958
958
|
* The assistant docked in LumenShell: put `button` in `headerActions` and `panel` in `panel`.
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@columenlabs/lumen-ui",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.271",
|
|
4
4
|
"description": "Lumen: shared React components (frame, views, widgets, charts, drawers).",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"type": "module",
|
|
@@ -49,7 +49,7 @@
|
|
|
49
49
|
"@codemirror/lang-javascript": "6.2.5",
|
|
50
50
|
"@codemirror/lang-json": "6.0.2",
|
|
51
51
|
"@codemirror/lang-sql": "6.10.0",
|
|
52
|
-
"@columenlabs/lumen-ui-types": "0.1.
|
|
52
|
+
"@columenlabs/lumen-ui-types": "0.1.271",
|
|
53
53
|
"@dnd-kit/core": "6.3.1",
|
|
54
54
|
"@dnd-kit/sortable": "10.0.0",
|
|
55
55
|
"@dnd-kit/utilities": "3.2.2",
|