@columenlabs/lumen-ui 0.1.304 → 0.1.305

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.
@@ -1,4 +1,4 @@
1
- import type { ChatItem } from '@columenlabs/lumen-ui-types/assistant';
1
+ import { type ChatItem } from '@columenlabs/lumen-ui-types/assistant';
2
2
  /** The whole chat, its title as the heading. */
3
3
  export declare function chatMarkdown(title: string, items: ChatItem[], name: string): string;
4
4
  /** One turn: a message and everything the assistant did for it. */
@@ -1,3 +1,6 @@
1
+ // A chat as Markdown, for Copy chat and each turn's copy icon: every message, tool line and card as
2
+ // it shows, so a chat can be pasted into an issue, a doc or another agent.
3
+ import { stepLineText } from '@columenlabs/lumen-ui-types/assistant';
1
4
  import { lumenToast } from '../lumen-toast.js';
2
5
  /** The whole chat, its title as the heading. */
3
6
  export function chatMarkdown(title, items, name) {
@@ -52,7 +55,7 @@ function itemMarkdown(i, depth, name) {
52
55
  i.ms ? `${(i.ms / 1000).toFixed(1)} s` : '',
53
56
  i.write ? i.write.status : '',
54
57
  ].filter(Boolean);
55
- return `**${i.ok ? 'Tool' : 'Failed'}: ${i.title}** (${facts.join(', ')})${i.error ? `\n\nError: ${i.error}` : ''}`;
58
+ return `**${i.ok ? 'Tool' : 'Failed'}: ${stepLineText(i.title)}** (${facts.join(', ')})${i.error ? `\n\nError: ${i.error}` : ''}`;
56
59
  }
57
60
  case 'draft':
58
61
  return [
@@ -4,7 +4,7 @@ import { Fragment as _Fragment, jsx as _jsx, jsxs as _jsxs } from "react/jsx-run
4
4
  // (the person's messages, the answer as it streams, each tool call as a line, drafted changes as
5
5
  // cards to Save or Dismiss, work handed to a higher tier in its own section); and the composer,
6
6
  // with Stop, a queued message and the chat's cost and context under it.
7
- import { ASSISTANT_IMAGES_MAX, ASSISTANT_IMAGE_CHARS, COMPACT_AT, } from '@columenlabs/lumen-ui-types/assistant';
7
+ import { ASSISTANT_IMAGES_MAX, ASSISTANT_IMAGE_CHARS, COMPACT_AT, stepLineParts, stepLineText, } from '@columenlabs/lumen-ui-types/assistant';
8
8
  import { useQuery, useQueryClient } from '@tanstack/react-query';
9
9
  import { ArrowUpIcon, CheckCheckIcon, CheckIcon, ChevronDownIcon, ChevronRightIcon, ChevronUpIcon, CircleAlertIcon, CircleCheckIcon, CircleXIcon, CopyIcon, CornerDownRightIcon, CrosshairIcon, FileTextIcon, GlobeIcon, HandIcon, LightbulbIcon, ListPlusIcon, LoaderCircleIcon, MonitorIcon, PaperclipIcon, PencilIcon, PlusIcon, RefreshCwIcon, ReplyIcon, SearchIcon, SparklesIcon, SquareIcon, TriangleAlertIcon, Undo2Icon, WrenchIcon, XIcon, } from 'lucide-react';
10
10
  import { Fragment, createContext, useContext, useEffect, useRef, useState, } from 'react';
@@ -464,7 +464,7 @@ function ToolStep({ step, live }) {
464
464
  step.rows !== undefined ? `${step.rows} row${step.rows === 1 ? '' : 's'}` : '',
465
465
  seconds(step.ms),
466
466
  ].filter(Boolean);
467
- return (_jsxs("p", { "data-slot": "chat-step", "data-ok": ok, className: cn('flex min-w-0 items-center gap-1.5 text-xs', ok ? 'text-muted-foreground' : 'text-loss'), children: [live ? (_jsx(Spinner, { className: "size-3" })) : !ok ? (_jsx(CircleAlertIcon, { className: "size-3.5 shrink-0" })) : w ? (_jsx(PencilIcon, { className: "size-3.5 shrink-0" })) : (_jsx(WrenchIcon, { className: "size-3.5 shrink-0" })), _jsx("span", { className: "truncate", title: step.title, children: step.title }), !live && facts.length > 0 && (_jsx("span", { className: "shrink-0 tabular-nums", children: facts.join(' · ') })), (step.error || w?.error) && (_jsxs("span", { className: "truncate", title: step.error ?? w?.error, children: ["\u00B7 ", step.error ?? w?.error] })), w?.status === 'undone' ? (_jsx("span", { className: "shrink-0", children: "\u00B7 Undone" })) : (w?.undo &&
467
+ return (_jsxs("p", { "data-slot": "chat-step", "data-ok": ok, className: cn('flex min-w-0 items-center gap-1.5 text-xs', ok ? 'text-muted-foreground' : 'text-loss'), children: [live ? (_jsx(Spinner, { className: "size-3" })) : !ok ? (_jsx(CircleAlertIcon, { className: "size-3.5 shrink-0" })) : w ? (_jsx(PencilIcon, { className: "size-3.5 shrink-0" })) : (_jsx(WrenchIcon, { className: "size-3.5 shrink-0" })), _jsx("span", { className: "truncate", title: stepLineText(step.title), children: stepLineParts(step.title).map((part, i) => part.name ? (_jsx("span", { "data-step-name": true, className: cn('rounded px-1 font-medium', ok ? 'bg-primary/10 text-primary' : 'bg-loss/10'), children: part.text }, i)) : (part.text)) }), !live && facts.length > 0 && (_jsx("span", { className: "shrink-0 tabular-nums", children: facts.join(' · ') })), (step.error || w?.error) && (_jsxs("span", { className: "truncate", title: step.error ?? w?.error, children: ["\u00B7 ", step.error ?? w?.error] })), w?.status === 'undone' ? (_jsx("span", { className: "shrink-0", children: "\u00B7 Undone" })) : (w?.undo &&
468
468
  undo && (_jsxs(Button, { size: "sm", variant: "ghost", className: "ml-auto h-6 shrink-0 px-2 text-xs", disabled: undoing, onClick: () => void take(), children: [undoing ? _jsx(Spinner, {}) : _jsx(Undo2Icon, {}), "Undo"] })))] }));
469
469
  }
470
470
  /** The arguments as short lines: `name: value`. */
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@columenlabs/lumen-ui",
3
- "version": "0.1.304",
3
+ "version": "0.1.305",
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.304",
52
+ "@columenlabs/lumen-ui-types": "0.1.305",
53
53
  "@dnd-kit/core": "6.3.1",
54
54
  "@dnd-kit/sortable": "10.0.0",
55
55
  "@dnd-kit/utilities": "3.2.2",