@agentage/components 0.21.1 → 0.22.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 (71) hide show
  1. package/README.md +4 -0
  2. package/dist/components/accordion.trigger.js +1 -1
  3. package/dist/components/approval-bar.d.ts +14 -0
  4. package/dist/components/approval-bar.d.ts.map +1 -0
  5. package/dist/components/approval-bar.js +40 -0
  6. package/dist/components/chat.icons.d.ts +6 -0
  7. package/dist/components/chat.icons.d.ts.map +1 -0
  8. package/dist/components/chat.icons.js +23 -0
  9. package/dist/components/check-list.js +1 -1
  10. package/dist/components/code-block.body.d.ts +7 -0
  11. package/dist/components/code-block.body.d.ts.map +1 -0
  12. package/dist/components/code-block.body.js +24 -0
  13. package/dist/components/code-block.d.ts +5 -1
  14. package/dist/components/code-block.d.ts.map +1 -1
  15. package/dist/components/code-block.js +39 -37
  16. package/dist/components/context-meter.d.ts +16 -0
  17. package/dist/components/context-meter.d.ts.map +1 -0
  18. package/dist/components/context-meter.js +58 -0
  19. package/dist/components/conversation.d.ts +13 -0
  20. package/dist/components/conversation.d.ts.map +1 -0
  21. package/dist/components/conversation.js +61 -0
  22. package/dist/components/data-table.variants.d.ts.map +1 -1
  23. package/dist/components/data-table.variants.js +2 -2
  24. package/dist/components/data-view.board-card.d.ts.map +1 -1
  25. package/dist/components/data-view.board-card.js +1 -1
  26. package/dist/components/description-list.property.js +1 -1
  27. package/dist/components/group-header.js +1 -1
  28. package/dist/components/index.d.ts +18 -0
  29. package/dist/components/index.d.ts.map +1 -1
  30. package/dist/components/index.js +10 -1
  31. package/dist/components/log-view.row.d.ts.map +1 -1
  32. package/dist/components/log-view.row.js +26 -27
  33. package/dist/components/markdown.d.ts +11 -0
  34. package/dist/components/markdown.d.ts.map +1 -0
  35. package/dist/components/markdown.js +21 -0
  36. package/dist/components/markdown.parts.d.ts +4 -0
  37. package/dist/components/markdown.parts.d.ts.map +1 -0
  38. package/dist/components/markdown.parts.js +91 -0
  39. package/dist/components/menu.variants.js +1 -1
  40. package/dist/components/message.d.ts +10 -0
  41. package/dist/components/message.d.ts.map +1 -0
  42. package/dist/components/message.js +22 -0
  43. package/dist/components/prompt-input.d.ts +22 -0
  44. package/dist/components/prompt-input.d.ts.map +1 -0
  45. package/dist/components/prompt-input.js +59 -0
  46. package/dist/components/reasoning.d.ts +13 -0
  47. package/dist/components/reasoning.d.ts.map +1 -0
  48. package/dist/components/reasoning.js +43 -0
  49. package/dist/components/row.variants.d.ts.map +1 -1
  50. package/dist/components/row.variants.js +1 -1
  51. package/dist/components/table.js +1 -1
  52. package/dist/components/tool-call.d.ts +25 -0
  53. package/dist/components/tool-call.d.ts.map +1 -0
  54. package/dist/components/tool-call.js +52 -0
  55. package/dist/components/tool-call.parts.d.ts +29 -0
  56. package/dist/components/tool-call.parts.d.ts.map +1 -0
  57. package/dist/components/tool-call.parts.js +96 -0
  58. package/dist/components/tool-group.d.ts +20 -0
  59. package/dist/components/tool-group.d.ts.map +1 -0
  60. package/dist/components/tool-group.js +49 -0
  61. package/dist/index.js +10 -1
  62. package/dist/lib/highlight-code.d.ts +9 -0
  63. package/dist/lib/highlight-code.d.ts.map +1 -0
  64. package/dist/lib/highlight-code.js +67 -0
  65. package/dist/lib/utils.d.ts +4 -4
  66. package/dist/lib/utils.d.ts.map +1 -1
  67. package/dist/lib/utils.js +1 -1
  68. package/package.json +40 -4
  69. package/src/styles/syntax.css +92 -0
  70. package/src/styles/theme.css +3 -0
  71. package/src/styles/tokens.css +68 -0
@@ -0,0 +1,96 @@
1
+ "use client";
2
+ import { MUTED_ON_HOVER as e, cn as t } from "../lib/utils.js";
3
+ import { highlightCode as n } from "../lib/highlight-code.js";
4
+ import { DisclosureChevron as r } from "./disclosure.js";
5
+ import { StatusGlyph as i } from "./status-glyph.js";
6
+ import * as a from "react";
7
+ import { Fragment as o, jsx as s, jsxs as c } from "react/jsx-runtime";
8
+ // src/components/tool-call.parts.tsx
9
+ var l = {
10
+ running: {
11
+ shape: "disc",
12
+ tone: "primary",
13
+ pulse: !0,
14
+ label: "Running"
15
+ },
16
+ succeeded: {
17
+ shape: "check",
18
+ tone: "success",
19
+ label: "Succeeded"
20
+ },
21
+ failed: {
22
+ shape: "cross",
23
+ tone: "destructive",
24
+ label: "Failed"
25
+ },
26
+ waiting: {
27
+ shape: "alert",
28
+ tone: "primary",
29
+ label: "Waiting for approval"
30
+ }
31
+ }, u = a.createContext(!1), d = ({ name: e }) => {
32
+ let t = e.indexOf(".");
33
+ return /* @__PURE__ */ c("span", {
34
+ className: "flex-none whitespace-nowrap font-mono text-xs text-foreground",
35
+ children: [t > 0 && /* @__PURE__ */ s("span", {
36
+ className: "text-muted-foreground",
37
+ children: e.slice(0, t + 1)
38
+ }), t > 0 ? e.slice(t + 1) : e]
39
+ });
40
+ }, f = "flex w-full min-w-0 items-center gap-2 pl-2.5 pr-1.5 text-left", p = ({ glyph: n, duration: i, open: a, nested: l, className: u, children: d, ...p }) => {
41
+ let m = /* @__PURE__ */ c(o, { children: [
42
+ /* @__PURE__ */ s("span", {
43
+ className: "grid size-3.5 flex-none place-items-center",
44
+ children: n
45
+ }),
46
+ d,
47
+ i !== void 0 && /* @__PURE__ */ s("span", {
48
+ className: "w-11 flex-none text-right text-xs tabular-nums text-muted-foreground",
49
+ children: i
50
+ }),
51
+ /* @__PURE__ */ s("span", {
52
+ className: "grid size-4 flex-none place-items-center",
53
+ children: a !== void 0 && /* @__PURE__ */ s(r, { open: a })
54
+ })
55
+ ] }), h = l ? "h-7" : "h-8";
56
+ return a === void 0 ? /* @__PURE__ */ s("div", {
57
+ className: t(f, h, "cursor-default", u),
58
+ children: m
59
+ }) : /* @__PURE__ */ s("button", {
60
+ type: "button",
61
+ "aria-expanded": a,
62
+ className: t(f, h, "rounded-lg hover:bg-accent focus-ring", e, u),
63
+ ...p,
64
+ children: m
65
+ });
66
+ }, m = ({ status: e }) => /* @__PURE__ */ s(i, { ...l[e] }), h = (e) => {
67
+ try {
68
+ return String(e);
69
+ } catch {
70
+ return "[unprintable value]";
71
+ }
72
+ }, g = (e) => {
73
+ if (typeof e == "string") return e;
74
+ try {
75
+ return JSON.stringify(e, null, 2) ?? h(e);
76
+ } catch {
77
+ return h(e);
78
+ }
79
+ }, _ = ({ label: e, value: r, error: i }) => {
80
+ let o = a.useMemo(() => g(r), [r]), l = a.useMemo(() => i ? null : n(o, "json"), [o, i]);
81
+ return /* @__PURE__ */ c("div", {
82
+ className: "flex min-w-0 flex-col gap-1",
83
+ children: [/* @__PURE__ */ s("span", {
84
+ className: "flex h-5 items-center text-2xs uppercase tracking-[0.08em] text-muted-foreground",
85
+ children: e
86
+ }), /* @__PURE__ */ s("pre", {
87
+ tabIndex: 0,
88
+ className: t("m-0 max-h-[180px] overflow-auto whitespace-pre-wrap rounded-md border border-border bg-card px-2 py-1.5 font-mono text-xs leading-[1.55] [overflow-wrap:anywhere] focus-ring", i && "text-destructive"),
89
+ children: l === null ? o : /* @__PURE__ */ s("code", {
90
+ className: "hljs",
91
+ dangerouslySetInnerHTML: { __html: l }
92
+ })
93
+ })]
94
+ });
95
+ };
96
+ export { _ as Payload, m as StatusMark, l as TOOL_GLYPH, u as ToolGroupContext, d as ToolName, p as ToolRow };
@@ -0,0 +1,20 @@
1
+ import * as React from 'react';
2
+ export interface ToolGroupProps extends Omit<React.HTMLAttributes<HTMLDivElement>, 'title'> {
3
+ /** `running` reads "Step N of M", `succeeded` "Completed N steps", `failed` "Stopped at step N". */
4
+ status: 'running' | 'succeeded' | 'failed';
5
+ /**
6
+ * M in "Step N of M": the planned number of steps. Default: the number of calls so far. N counts
7
+ * the direct `ToolCall` children only; calls nested inside a wrapper element are not counted.
8
+ */
9
+ total?: number;
10
+ /** For example "3.1 s". */
11
+ duration?: React.ReactNode;
12
+ /** Replaces the counted title. */
13
+ label?: React.ReactNode;
14
+ open?: boolean;
15
+ defaultOpen?: boolean;
16
+ onOpenChange?: (open: boolean) => void;
17
+ }
18
+ /** A run of ToolCall steps folded under one 32 px row; open it to see each call. */
19
+ export declare const ToolGroup: React.ForwardRefExoticComponent<ToolGroupProps & React.RefAttributes<HTMLDivElement>>;
20
+ //# sourceMappingURL=tool-group.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"tool-group.d.ts","sourceRoot":"","sources":["../../src/components/tool-group.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAM/B,MAAM,WAAW,cAAe,SAAQ,IAAI,CAAC,KAAK,CAAC,cAAc,CAAC,cAAc,CAAC,EAAE,OAAO,CAAC;IACzF,oGAAoG;IACpG,MAAM,EAAE,SAAS,GAAG,WAAW,GAAG,QAAQ,CAAC;IAC3C;;;OAGG;IACH,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,2BAA2B;IAC3B,QAAQ,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IAC3B,kCAAkC;IAClC,KAAK,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IACxB,IAAI,CAAC,EAAE,OAAO,CAAC;IACf,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,YAAY,CAAC,EAAE,CAAC,IAAI,EAAE,OAAO,KAAK,IAAI,CAAC;CACxC;AAQD,oFAAoF;AACpF,eAAO,MAAM,SAAS,uFAuDrB,CAAC"}
@@ -0,0 +1,49 @@
1
+ "use client";
2
+ import { cn as e } from "../lib/utils.js";
3
+ import { useControlled as t } from "../lib/use-controlled.js";
4
+ import { Disclosure as n } from "./disclosure.js";
5
+ import { StatusMark as r, ToolGroupContext as i, ToolRow as a } from "./tool-call.parts.js";
6
+ import * as o from "react";
7
+ import { jsx as s, jsxs as c } from "react/jsx-runtime";
8
+ // src/components/tool-group.tsx
9
+ var l = (e) => {
10
+ let t = o.Children.toArray(e).filter(o.isValidElement).at(-1)?.props;
11
+ return typeof t?.name == "string" ? t.name : void 0;
12
+ }, u = o.forwardRef(({ status: u, total: d, duration: f, label: p, open: m, defaultOpen: h = !1, onOpenChange: g, className: _, children: v, ...y }, b) => {
13
+ let [x, S] = t(m, h, g), C = o.useId(), w = o.Children.toArray(v).filter(o.isValidElement).length, T = p ?? (u === "running" ? `Step ${String(w)} of ${String(Math.max(d ?? w, w))}` : u === "failed" ? `Stopped at step ${String(w)}` : `Completed ${String(w)} ${w === 1 ? "step" : "steps"}`), E = u === "running" ? l(v) : void 0;
14
+ return /* @__PURE__ */ c("div", {
15
+ ref: b,
16
+ className: e("min-w-0 rounded-lg border border-border bg-background", _),
17
+ "data-slot": "tool-group",
18
+ "data-status": u,
19
+ ...y,
20
+ children: [/* @__PURE__ */ c(a, {
21
+ glyph: /* @__PURE__ */ s(r, { status: u }),
22
+ duration: f,
23
+ open: x,
24
+ "aria-controls": C,
25
+ onClick: () => S(!x),
26
+ children: [/* @__PURE__ */ s("span", {
27
+ className: "flex-none whitespace-nowrap text-xs text-foreground",
28
+ children: T
29
+ }), /* @__PURE__ */ s("span", {
30
+ className: "min-w-0 flex-1 truncate font-mono text-xs text-muted-foreground",
31
+ children: E
32
+ })]
33
+ }), /* @__PURE__ */ s(n, {
34
+ open: x,
35
+ id: C,
36
+ shrink: !0,
37
+ children: /* @__PURE__ */ s("div", {
38
+ className: "border-t border-border py-1",
39
+ "data-slot": "tool-group-body",
40
+ children: /* @__PURE__ */ s(i.Provider, {
41
+ value: !0,
42
+ children: v
43
+ })
44
+ })
45
+ })]
46
+ });
47
+ });
48
+ u.displayName = "ToolGroup";
49
+ export { u as ToolGroup };
package/dist/index.js CHANGED
@@ -93,4 +93,13 @@ import { Tooltip as Jt } from "./components/tooltip.js";
93
93
  import { ActionBar as Yt } from "./components/action-bar.js";
94
94
  import { DirtyBar as Xt } from "./components/dirty-bar.js";
95
95
  import { ToastProvider as Zt, useToast as Qt } from "./components/toast.js";
96
- export { tt as Accordion, nt as AccordionContent, rt as AccordionItem, et as AccordionTrigger, Yt as ActionBar, Ge as ActiveFilters, dt as Alert, t as Avatar, n as Badge, W as Breadcrumb, G as BreadcrumbItem, K as BreadcrumbLink, q as BreadcrumbList, J as BreadcrumbPage, Y as BreadcrumbSeparator, i as Button, ze as Card, Fe as CardAction, Be as CardContent, Ie as CardDescription, Ve as CardFooter, Le as CardHeader, Pe as CardMeta, Re as CardTitle, it as CheckItem, at as CheckList, y as Checkbox, a as Chip, ot as CodeBlock, ct as Collapsible, lt as CollapsibleContent, ut as CollapsibleTrigger, Ft as Command, jt as CommandEmpty, Mt as CommandGroup, Nt as CommandItem, Pt as CommandSeparator, gt as ContentBlocks, o as CopyButton, ue as DataTree, Xe as DataView, E as DatePicker, ft as DescriptionDetail, pt as DescriptionGroup, mt as DescriptionList, ht as DescriptionTerm, It as Dialog, Lt as DialogFooter, Xt as DirtyBar, S as Disclosure, We as DisplayMenu, ke as DropdownMenu, Ce as DropdownMenuCheckboxItem, we as DropdownMenuItem, Te as DropdownMenuLabel, Ee as DropdownMenuRadioGroup, De as DropdownMenuRadioItem, Oe as DropdownMenuSeparator, de as EMPTY_LIST_CONTROLS, je as EmptyState, Ue as FilterMenu, D as FormField, me as GroupHeader, s as IconButton, st as InlineCode, O as InlineEdit, C as Input, c as Kbd, k as Label, Qe as List, Ze as ListRow, qe as ListToolbar, Je as ListToolbarEnd, $e as LogView, X as MetaItem, Tt as MiniBars, B as NavRow, V as NavTree, l as PRIORITY_LABEL, Z as PageHeader, Q as Pagination, T as Popover, u as PriorityGlyph, wt as Progress, _t as Property, xt as PropertyDate, St as PropertyMultiSelect, Ct as PropertySelect, vt as PropertyText, yt as PropertyValue, d as Prose, A as RadioGroup, j as RadioGroupItem, Ne as RelativeTime, Vt as ResizableHandle, Ht as ResizablePanel, Ut as ResizablePanelGroup, Gt as ResizableSplit, Kt as ResizableSplitPrepaint, M as SecretInput, N as Section, $ as SectionIndex, P as SectionLabel, F as Select, qt as Sheet, ee as Sidebar, te as SidebarContent, ne as SidebarFooter, re as SidebarGroup, ie as SidebarGroupLabel, ae as SidebarHeader, f as Skeleton, Et as Sparkline, p as Spinner, Dt as StatCard, Ot as StatusBar, m as StatusGlyph, kt as Step, At as StepList, I as Switch, he as Table, ge as TableBody, _e as TableCaption, ve as TableCell, ye as TableFooter, be as TableHead, xe as TableHeader, Se as TableRow, se as Tabs, ce as TabsContent, le as TabsList, oe as TabsTrigger, w as Textarea, Zt as ToastProvider, L as ToggleButton, R as ToggleGroup, He as ToolbarSearch, Ye as ToolbarToggle, Jt as Tooltip, H as TreeSelect, z as Truncate, Ke as ViewSwitch, fe as activeFilterCount, _ as activeSection, h as announce, pe as applyListControls, r as buttonVariants, e as cn, U as describeCron, bt as formatPropertyDate, Me as formatRelativeTime, b as parseRelativeRange, Rt as resizableSplitCollapsedVar, zt as resizableSplitPrepaint, Bt as resizableSplitVar, x as resolveDateRange, g as useAnnounce, Ae as useListControls, Wt as useResizableSplit, v as useScrollSpy, Qt as useToast };
96
+ import { ApprovalBar as $t } from "./components/approval-bar.js";
97
+ import { ContextMeter as en, meterTone as tn } from "./components/context-meter.js";
98
+ import { Conversation as nn } from "./components/conversation.js";
99
+ import { Markdown as rn } from "./components/markdown.js";
100
+ import { Message as an } from "./components/message.js";
101
+ import { PromptInput as on } from "./components/prompt-input.js";
102
+ import { Reasoning as sn } from "./components/reasoning.js";
103
+ import { ToolCall as cn } from "./components/tool-call.js";
104
+ import { ToolGroup as ln } from "./components/tool-group.js";
105
+ export { tt as Accordion, nt as AccordionContent, rt as AccordionItem, et as AccordionTrigger, Yt as ActionBar, Ge as ActiveFilters, dt as Alert, $t as ApprovalBar, t as Avatar, n as Badge, W as Breadcrumb, G as BreadcrumbItem, K as BreadcrumbLink, q as BreadcrumbList, J as BreadcrumbPage, Y as BreadcrumbSeparator, i as Button, ze as Card, Fe as CardAction, Be as CardContent, Ie as CardDescription, Ve as CardFooter, Le as CardHeader, Pe as CardMeta, Re as CardTitle, it as CheckItem, at as CheckList, y as Checkbox, a as Chip, ot as CodeBlock, ct as Collapsible, lt as CollapsibleContent, ut as CollapsibleTrigger, Ft as Command, jt as CommandEmpty, Mt as CommandGroup, Nt as CommandItem, Pt as CommandSeparator, gt as ContentBlocks, en as ContextMeter, nn as Conversation, o as CopyButton, ue as DataTree, Xe as DataView, E as DatePicker, ft as DescriptionDetail, pt as DescriptionGroup, mt as DescriptionList, ht as DescriptionTerm, It as Dialog, Lt as DialogFooter, Xt as DirtyBar, S as Disclosure, We as DisplayMenu, ke as DropdownMenu, Ce as DropdownMenuCheckboxItem, we as DropdownMenuItem, Te as DropdownMenuLabel, Ee as DropdownMenuRadioGroup, De as DropdownMenuRadioItem, Oe as DropdownMenuSeparator, de as EMPTY_LIST_CONTROLS, je as EmptyState, Ue as FilterMenu, D as FormField, me as GroupHeader, s as IconButton, st as InlineCode, O as InlineEdit, C as Input, c as Kbd, k as Label, Qe as List, Ze as ListRow, qe as ListToolbar, Je as ListToolbarEnd, $e as LogView, rn as Markdown, an as Message, X as MetaItem, Tt as MiniBars, B as NavRow, V as NavTree, l as PRIORITY_LABEL, Z as PageHeader, Q as Pagination, T as Popover, u as PriorityGlyph, wt as Progress, on as PromptInput, _t as Property, xt as PropertyDate, St as PropertyMultiSelect, Ct as PropertySelect, vt as PropertyText, yt as PropertyValue, d as Prose, A as RadioGroup, j as RadioGroupItem, sn as Reasoning, Ne as RelativeTime, Vt as ResizableHandle, Ht as ResizablePanel, Ut as ResizablePanelGroup, Gt as ResizableSplit, Kt as ResizableSplitPrepaint, M as SecretInput, N as Section, $ as SectionIndex, P as SectionLabel, F as Select, qt as Sheet, ee as Sidebar, te as SidebarContent, ne as SidebarFooter, re as SidebarGroup, ie as SidebarGroupLabel, ae as SidebarHeader, f as Skeleton, Et as Sparkline, p as Spinner, Dt as StatCard, Ot as StatusBar, m as StatusGlyph, kt as Step, At as StepList, I as Switch, he as Table, ge as TableBody, _e as TableCaption, ve as TableCell, ye as TableFooter, be as TableHead, xe as TableHeader, Se as TableRow, se as Tabs, ce as TabsContent, le as TabsList, oe as TabsTrigger, w as Textarea, Zt as ToastProvider, L as ToggleButton, R as ToggleGroup, cn as ToolCall, ln as ToolGroup, He as ToolbarSearch, Ye as ToolbarToggle, Jt as Tooltip, H as TreeSelect, z as Truncate, Ke as ViewSwitch, fe as activeFilterCount, _ as activeSection, h as announce, pe as applyListControls, r as buttonVariants, e as cn, U as describeCron, bt as formatPropertyDate, Me as formatRelativeTime, tn as meterTone, b as parseRelativeRange, Rt as resizableSplitCollapsedVar, zt as resizableSplitPrepaint, Bt as resizableSplitVar, x as resolveDateRange, g as useAnnounce, Ae as useListControls, Wt as useResizableSplit, v as useScrollSpy, Qt as useToast };
@@ -0,0 +1,9 @@
1
+ /** The registered language a name or alias resolves to, or undefined when it is not known. */
2
+ export declare const codeLanguage: (language?: string) => string | undefined;
3
+ /**
4
+ * Highlighted HTML for `code`, or null for an unknown language. The output is escaped by
5
+ * highlight.js (only its own `hljs-*` spans are markup), so it is safe as inner HTML. It never
6
+ * throws: if highlighting fails, the escaped plain text comes back.
7
+ */
8
+ export declare const highlightCode: (code: string, language?: string) => string | null;
9
+ //# sourceMappingURL=highlight-code.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"highlight-code.d.ts","sourceRoot":"","sources":["../../src/lib/highlight-code.ts"],"names":[],"mappings":"AA+DA,8FAA8F;AAC9F,eAAO,MAAM,YAAY,GAAI,WAAW,MAAM,KAAG,MAAM,GAAG,SAKzD,CAAC;AAEF;;;;GAIG;AACH,eAAO,MAAM,aAAa,GAAI,MAAM,MAAM,EAAE,WAAW,MAAM,KAAG,MAAM,GAAG,IASxE,CAAC"}
@@ -0,0 +1,67 @@
1
+ import e from "highlight.js/lib/core";
2
+ import t from "highlight.js/lib/languages/bash";
3
+ import n from "highlight.js/lib/languages/css";
4
+ import r from "highlight.js/lib/languages/diff";
5
+ import i from "highlight.js/lib/languages/dockerfile";
6
+ import a from "highlight.js/lib/languages/go";
7
+ import o from "highlight.js/lib/languages/javascript";
8
+ import s from "highlight.js/lib/languages/json";
9
+ import c from "highlight.js/lib/languages/markdown";
10
+ import l from "highlight.js/lib/languages/python";
11
+ import u from "highlight.js/lib/languages/shell";
12
+ import d from "highlight.js/lib/languages/sql";
13
+ import f from "highlight.js/lib/languages/typescript";
14
+ import p from "highlight.js/lib/languages/xml";
15
+ import m from "highlight.js/lib/languages/yaml";
16
+ // src/lib/highlight-code.ts
17
+ var h = {
18
+ typescript: f,
19
+ javascript: o,
20
+ bash: t,
21
+ shell: u,
22
+ yaml: m,
23
+ json: s,
24
+ python: l,
25
+ sql: d,
26
+ diff: r,
27
+ xml: p,
28
+ css: n,
29
+ markdown: c,
30
+ go: a,
31
+ dockerfile: i
32
+ }, g = {
33
+ "&": "&amp;",
34
+ "<": "&lt;",
35
+ ">": "&gt;",
36
+ "\"": "&quot;",
37
+ "'": "&#x27;"
38
+ }, _ = (e) => e.replace(/[&<>"']/g, (e) => g[e] ?? e), v = {
39
+ ts: "typescript",
40
+ tsx: "typescript",
41
+ js: "javascript",
42
+ jsx: "javascript",
43
+ sh: "bash",
44
+ zsh: "bash",
45
+ yml: "yaml",
46
+ html: "xml"
47
+ }, y = !1, b = () => {
48
+ if (!y) {
49
+ for (let [t, n] of Object.entries(h)) e.registerLanguage(t, n);
50
+ y = !0;
51
+ }
52
+ }, x = (e) => {
53
+ let t = e?.trim().toLowerCase();
54
+ if (t) return Object.hasOwn(h, t) ? t : Object.hasOwn(v, t) ? v[t] : void 0;
55
+ }, S = (t, n) => {
56
+ let r = x(n);
57
+ if (!r) return null;
58
+ try {
59
+ return b(), e.highlight(t, {
60
+ language: r,
61
+ ignoreIllegals: !0
62
+ }).value;
63
+ } catch {
64
+ return _(t);
65
+ }
66
+ };
67
+ export { x as codeLanguage, S as highlightCode };
@@ -1,12 +1,12 @@
1
1
  import { ClassValue } from 'clsx';
2
2
  export declare const cn: (...inputs: ClassValue[]) => string;
3
3
  /**
4
- * Raises muted text on an accent surface (selected row, open trigger) to a readable mix of the
5
- * foreground, so secondary text keeps AA contrast in both themes.
4
+ * The `on-accent` class (src/styles/tokens.css): muted and destructive text on an accent surface
5
+ * keeps AA contrast in both themes.
6
6
  */
7
- export declare const MUTED_ON_ACCENT = "[--color-muted-foreground:color-mix(in_oklab,var(--color-foreground)_72%,var(--color-accent))]";
7
+ export declare const MUTED_ON_ACCENT = "on-accent";
8
8
  /** `MUTED_ON_ACCENT` for surfaces that turn accent on hover. */
9
- export declare const MUTED_ON_HOVER = "hover:[--color-muted-foreground:color-mix(in_oklab,var(--color-foreground)_72%,var(--color-accent))]";
9
+ export declare const MUTED_ON_HOVER = "hover:on-accent";
10
10
  /** Default number format: a fixed locale, so the server and the browser render the same text. */
11
11
  export declare const formatNumber: (n: number) => string;
12
12
  //# sourceMappingURL=utils.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../src/lib/utils.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,UAAU,EAAQ,MAAM,MAAM,CAAC;AAM7C,eAAO,MAAM,EAAE,GAAI,GAAG,QAAQ,UAAU,EAAE,KAAG,MAA+B,CAAC;AAE7E;;;GAGG;AACH,eAAO,MAAM,eAAe,mGACsE,CAAC;AAEnG,gEAAgE;AAChE,eAAO,MAAM,cAAc,yGAC6E,CAAC;AAEzG,iGAAiG;AACjG,eAAO,MAAM,YAAY,GAAI,GAAG,MAAM,KAAG,MAAmC,CAAC"}
1
+ {"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../src/lib/utils.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,UAAU,EAAQ,MAAM,MAAM,CAAC;AAM7C,eAAO,MAAM,EAAE,GAAI,GAAG,QAAQ,UAAU,EAAE,KAAG,MAA+B,CAAC;AAE7E;;;GAGG;AACH,eAAO,MAAM,eAAe,cAAc,CAAC;AAE3C,gEAAgE;AAChE,eAAO,MAAM,cAAc,oBAAoB,CAAC;AAEhD,iGAAiG;AACjG,eAAO,MAAM,YAAY,GAAI,GAAG,MAAM,KAAG,MAAmC,CAAC"}
package/dist/lib/utils.js CHANGED
@@ -5,5 +5,5 @@ var n = t({ extend: { theme: { text: [
5
5
  "3xs",
6
6
  "2xs",
7
7
  "ui"
8
- ] } } }), r = (...t) => n(e(t)), i = "[--color-muted-foreground:color-mix(in_oklab,var(--color-foreground)_72%,var(--color-accent))]", a = "hover:[--color-muted-foreground:color-mix(in_oklab,var(--color-foreground)_72%,var(--color-accent))]", o = (e) => e.toLocaleString("en-US");
8
+ ] } } }), r = (...t) => n(e(t)), i = "on-accent", a = "hover:on-accent", o = (e) => e.toLocaleString("en-US");
9
9
  export { i as MUTED_ON_ACCENT, a as MUTED_ON_HOVER, r as cn, o as formatNumber };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@agentage/components",
3
- "version": "0.21.1",
3
+ "version": "0.22.0",
4
4
  "description": "Agentage Components - OKLCH design tokens and accessible React 19 components. RSC-safe (per-module \"use client\"), Tailwind CSS v4, tree-shakeable ESM with per-component subpath exports.",
5
5
  "keywords": [
6
6
  "design-system",
@@ -52,6 +52,10 @@
52
52
  "types": "./dist/components/alert.d.ts",
53
53
  "import": "./dist/components/alert.js"
54
54
  },
55
+ "./approval-bar": {
56
+ "types": "./dist/components/approval-bar.d.ts",
57
+ "import": "./dist/components/approval-bar.js"
58
+ },
55
59
  "./avatar": {
56
60
  "types": "./dist/components/avatar.d.ts",
57
61
  "import": "./dist/components/avatar.js"
@@ -104,6 +108,14 @@
104
108
  "types": "./dist/components/content-blocks.d.ts",
105
109
  "import": "./dist/components/content-blocks.js"
106
110
  },
111
+ "./context-meter": {
112
+ "types": "./dist/components/context-meter.d.ts",
113
+ "import": "./dist/components/context-meter.js"
114
+ },
115
+ "./conversation": {
116
+ "types": "./dist/components/conversation.d.ts",
117
+ "import": "./dist/components/conversation.js"
118
+ },
107
119
  "./copy-button": {
108
120
  "types": "./dist/components/copy-button.d.ts",
109
121
  "import": "./dist/components/copy-button.js"
@@ -196,6 +208,14 @@
196
208
  "types": "./dist/components/log-view.d.ts",
197
209
  "import": "./dist/components/log-view.js"
198
210
  },
211
+ "./markdown": {
212
+ "types": "./dist/components/markdown.d.ts",
213
+ "import": "./dist/components/markdown.js"
214
+ },
215
+ "./message": {
216
+ "types": "./dist/components/message.d.ts",
217
+ "import": "./dist/components/message.js"
218
+ },
199
219
  "./nav-tree": {
200
220
  "types": "./dist/components/nav-tree.d.ts",
201
221
  "import": "./dist/components/nav-tree.js"
@@ -220,6 +240,10 @@
220
240
  "types": "./dist/components/progress.d.ts",
221
241
  "import": "./dist/components/progress.js"
222
242
  },
243
+ "./prompt-input": {
244
+ "types": "./dist/components/prompt-input.d.ts",
245
+ "import": "./dist/components/prompt-input.js"
246
+ },
223
247
  "./property-date": {
224
248
  "types": "./dist/components/property-date.d.ts",
225
249
  "import": "./dist/components/property-date.js"
@@ -240,6 +264,10 @@
240
264
  "types": "./dist/components/radio-group.d.ts",
241
265
  "import": "./dist/components/radio-group.js"
242
266
  },
267
+ "./reasoning": {
268
+ "types": "./dist/components/reasoning.d.ts",
269
+ "import": "./dist/components/reasoning.js"
270
+ },
243
271
  "./relative-time": {
244
272
  "types": "./dist/components/relative-time.d.ts",
245
273
  "import": "./dist/components/relative-time.js"
@@ -332,6 +360,14 @@
332
360
  "types": "./dist/components/toggle-group.d.ts",
333
361
  "import": "./dist/components/toggle-group.js"
334
362
  },
363
+ "./tool-call": {
364
+ "types": "./dist/components/tool-call.d.ts",
365
+ "import": "./dist/components/tool-call.js"
366
+ },
367
+ "./tool-group": {
368
+ "types": "./dist/components/tool-group.d.ts",
369
+ "import": "./dist/components/tool-group.js"
370
+ },
335
371
  "./tooltip": {
336
372
  "types": "./dist/components/tooltip.d.ts",
337
373
  "import": "./dist/components/tooltip.js"
@@ -405,6 +441,9 @@
405
441
  "@radix-ui/react-slot": "^1.2.4",
406
442
  "class-variance-authority": "^0.7.1",
407
443
  "clsx": "^2.1.1",
444
+ "highlight.js": "^11.12.0",
445
+ "react-markdown": "^10.1.0",
446
+ "remark-gfm": "^4.0.1",
408
447
  "tailwind-merge": "^3.7.0"
409
448
  },
410
449
  "peerDependencies": {
@@ -436,15 +475,12 @@
436
475
  "eslint-plugin-jsx-a11y": "^6.10.2",
437
476
  "eslint-plugin-prettier": "^5.5.7",
438
477
  "eslint-plugin-react-hooks": "^7.1.1",
439
- "highlight.js": "^11.12.0",
440
478
  "jsdom": "^31.0.1",
441
479
  "postcss": "^8.5.33",
442
480
  "prettier": "^3.10.1",
443
481
  "react": "^19.3.1",
444
482
  "react-dom": "^19.3.1",
445
- "react-markdown": "^10.1.0",
446
483
  "rehype-raw": "^7.0.0",
447
- "remark-gfm": "^4.0.1",
448
484
  "tailwindcss": "^4.3.1",
449
485
  "typescript": "^6.0.3",
450
486
  "vite": "^8.3.7",
@@ -0,0 +1,92 @@
1
+ /* ============================================================================
2
+ * Agentage Components - Syntax colours
3
+ *
4
+ * highlight.js classes mapped to the --syntax-* tokens (tokens.css), so every
5
+ * highlighted block in both themes uses one palette.
6
+ * ============================================================================ */
7
+
8
+ .hljs {
9
+ color: var(--syntax-text);
10
+ background: transparent;
11
+ }
12
+
13
+ .hljs-comment,
14
+ .hljs-quote {
15
+ color: var(--syntax-comment);
16
+ }
17
+
18
+ .hljs-keyword,
19
+ .hljs-literal,
20
+ .hljs-meta,
21
+ .hljs-name,
22
+ .hljs-section,
23
+ .hljs-strong,
24
+ .hljs-meta .hljs-keyword {
25
+ color: var(--syntax-keyword);
26
+ }
27
+
28
+ .hljs-built_in,
29
+ .hljs-type,
30
+ .hljs-title.class_ {
31
+ color: var(--syntax-type);
32
+ }
33
+
34
+ .hljs-title,
35
+ .hljs-title.function_ {
36
+ color: var(--syntax-function);
37
+ }
38
+
39
+ .hljs-string,
40
+ .hljs-code,
41
+ .hljs-link,
42
+ .hljs-deletion,
43
+ .hljs-meta .hljs-string {
44
+ color: var(--syntax-string);
45
+ }
46
+
47
+ .hljs-regexp {
48
+ color: var(--syntax-regexp);
49
+ }
50
+
51
+ .hljs-char.escape_,
52
+ .hljs-selector-tag,
53
+ .hljs-selector-class,
54
+ .hljs-selector-id,
55
+ .hljs-selector-attr,
56
+ .hljs-selector-pseudo {
57
+ color: var(--syntax-selector);
58
+ }
59
+
60
+ .hljs-number,
61
+ .hljs-addition {
62
+ color: var(--syntax-number);
63
+ }
64
+
65
+ .hljs-attr,
66
+ .hljs-attribute,
67
+ .hljs-property,
68
+ .hljs-variable,
69
+ .hljs-template-variable,
70
+ .hljs-params,
71
+ .hljs-symbol {
72
+ color: var(--syntax-property);
73
+ }
74
+
75
+ .hljs-bullet {
76
+ color: var(--syntax-bullet);
77
+ }
78
+
79
+ .hljs-tag,
80
+ .hljs-punctuation,
81
+ .hljs-operator {
82
+ color: var(--syntax-text);
83
+ }
84
+
85
+ .hljs-emphasis {
86
+ font-style: italic;
87
+ }
88
+
89
+ .hljs-section,
90
+ .hljs-strong {
91
+ font-weight: 600;
92
+ }
@@ -6,5 +6,8 @@
6
6
  /* Semantic tokens, typography, shadows, animation - theme-dependent */
7
7
  @import './tokens.css';
8
8
 
9
+ /* highlight.js classes on the --syntax-* tokens */
10
+ @import './syntax.css';
11
+
9
12
  /* Base element styles - resets, scrollbar, body defaults */
10
13
  @import './base.css';
@@ -170,6 +170,25 @@
170
170
  --z-toast: 100;
171
171
  }
172
172
 
173
+ /* ============================================================================
174
+ * Syntax colours (code blocks): the editor dark palette, light values below.
175
+ * Plain vars, not @theme: they colour highlight.js spans in syntax.css only.
176
+ * ============================================================================ */
177
+
178
+ :root {
179
+ --syntax-text: #d4d4d4;
180
+ --syntax-comment: #6a9955;
181
+ --syntax-keyword: #569cd6;
182
+ --syntax-string: #ce9178;
183
+ --syntax-number: #b5cea8;
184
+ --syntax-property: #9cdcfe;
185
+ --syntax-function: #dcdcaa;
186
+ --syntax-type: #4ec9b0;
187
+ --syntax-selector: #d7ba7d;
188
+ --syntax-regexp: #d16969;
189
+ --syntax-bullet: #6796e6;
190
+ }
191
+
173
192
  /* ============================================================================
174
193
  * Light Theme Overrides
175
194
  * ============================================================================ */
@@ -241,6 +260,19 @@ html[data-theme='light'] {
241
260
  --shadow-md: 0 4px 6px -1px oklch(0 0 0 / 0.06), 0 2px 4px -2px oklch(0 0 0 / 0.06);
242
261
  --shadow-lg: 0 10px 15px -3px oklch(0 0 0 / 0.06), 0 4px 6px -4px oklch(0 0 0 / 0.06);
243
262
  --shadow-popover: 0 8px 24px -6px oklch(0 0 0 / 0.16), 0 2px 6px -2px oklch(0 0 0 / 0.08);
263
+
264
+ /* Editor light palette; number and type are one step darker so they clear 4.5:1 on the card. */
265
+ --syntax-text: #1f1f1f;
266
+ --syntax-comment: #008000;
267
+ --syntax-keyword: #0000ff;
268
+ --syntax-string: #a31515;
269
+ --syntax-number: #07754d;
270
+ --syntax-property: #001080;
271
+ --syntax-function: #795e26;
272
+ --syntax-type: #1f6f84;
273
+ --syntax-selector: #800000;
274
+ --syntax-regexp: #811f3f;
275
+ --syntax-bullet: #0451a5;
244
276
  }
245
277
 
246
278
  /* System preference fallback */
@@ -308,6 +340,19 @@ html[data-theme='light'] {
308
340
  --shadow-md: 0 4px 6px -1px oklch(0 0 0 / 0.06), 0 2px 4px -2px oklch(0 0 0 / 0.06);
309
341
  --shadow-lg: 0 10px 15px -3px oklch(0 0 0 / 0.06), 0 4px 6px -4px oklch(0 0 0 / 0.06);
310
342
  --shadow-popover: 0 8px 24px -6px oklch(0 0 0 / 0.16), 0 2px 6px -2px oklch(0 0 0 / 0.08);
343
+
344
+ /* Mirrors the html[data-theme='light'] syntax values. */
345
+ --syntax-text: #1f1f1f;
346
+ --syntax-comment: #008000;
347
+ --syntax-keyword: #0000ff;
348
+ --syntax-string: #a31515;
349
+ --syntax-number: #07754d;
350
+ --syntax-property: #001080;
351
+ --syntax-function: #795e26;
352
+ --syntax-type: #1f6f84;
353
+ --syntax-selector: #800000;
354
+ --syntax-regexp: #811f3f;
355
+ --syntax-bullet: #0451a5;
311
356
  }
312
357
  }
313
358
 
@@ -334,6 +379,29 @@ html[data-theme='light'] {
334
379
  transition-duration: var(--duration-normal);
335
380
  }
336
381
 
382
+ /* Derived once on the root so `on-accent` can read it (a property cannot read itself). */
383
+ :root {
384
+ --color-destructive-on-accent: color-mix(
385
+ in oklab,
386
+ var(--color-destructive) 70%,
387
+ var(--color-foreground)
388
+ );
389
+ }
390
+
391
+ /* Text on an accent surface (hover, selected, open): lifts muted and destructive text to AA.
392
+ * Use it with the state variant: `hover:bg-accent hover:on-accent`. Contrast on the accent, dark / light:
393
+ * muted 7.2:1 / 8.2:1 (the plain token is 3.6:1 in dark), destructive 5.8:1 / 8.2:1 (plain 3.75:1 in
394
+ * dark). The destructive mix is computed at the root; where that variable is missing the fallback
395
+ * mixes the solid red instead (5.2:1 / 6.6:1), since a property cannot read itself. It resets nothing
396
+ * below it: do not put a card or popover surface inside an on-accent element. */
397
+ @utility on-accent {
398
+ --color-muted-foreground: color-mix(in oklab, var(--color-foreground) 72%, var(--color-accent));
399
+ --color-destructive: var(
400
+ --color-destructive-on-accent,
401
+ color-mix(in oklab, var(--color-destructive-solid) 70%, var(--color-foreground))
402
+ );
403
+ }
404
+
337
405
  /* Same ring on a visual box whose focusable element is the `group` parent. */
338
406
  @utility group-focus-ring {
339
407
  :where(.group):focus-visible & {