@drewswiredin/backstage-plugin-assistants 0.1.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 (47) hide show
  1. package/LICENSE +201 -0
  2. package/README.md +113 -0
  3. package/dist/alpha.d.ts +64 -0
  4. package/dist/alpha.esm.js +35 -0
  5. package/dist/alpha.esm.js.map +1 -0
  6. package/dist/api/AssistantsApi.esm.js +55 -0
  7. package/dist/api/AssistantsApi.esm.js.map +1 -0
  8. package/dist/collapsible/AssistantDetailDialog.esm.js +209 -0
  9. package/dist/collapsible/AssistantDetailDialog.esm.js.map +1 -0
  10. package/dist/collapsible/AssistantsList.esm.js +119 -0
  11. package/dist/collapsible/AssistantsList.esm.js.map +1 -0
  12. package/dist/collapsible/CollapsiblePage.esm.js +724 -0
  13. package/dist/collapsible/CollapsiblePage.esm.js.map +1 -0
  14. package/dist/collapsible/ConversationsPanel.esm.js +198 -0
  15. package/dist/collapsible/ConversationsPanel.esm.js.map +1 -0
  16. package/dist/collapsible/FullHeightRegion.esm.js +54 -0
  17. package/dist/collapsible/FullHeightRegion.esm.js.map +1 -0
  18. package/dist/collapsible/SidePane.esm.js +89 -0
  19. package/dist/collapsible/SidePane.esm.js.map +1 -0
  20. package/dist/collapsible/surface/AssistantAvatar.esm.js +98 -0
  21. package/dist/collapsible/surface/AssistantAvatar.esm.js.map +1 -0
  22. package/dist/collapsible/surface/BackstageLogo.esm.js +24 -0
  23. package/dist/collapsible/surface/BackstageLogo.esm.js.map +1 -0
  24. package/dist/collapsible/surface/ConversationSurface.esm.js +268 -0
  25. package/dist/collapsible/surface/ConversationSurface.esm.js.map +1 -0
  26. package/dist/collapsible/surface/MarkdownText.esm.js +24 -0
  27. package/dist/collapsible/surface/MarkdownText.esm.js.map +1 -0
  28. package/dist/collapsible/surface/MermaidDiagram.esm.js +245 -0
  29. package/dist/collapsible/surface/MermaidDiagram.esm.js.map +1 -0
  30. package/dist/collapsible/surface/parts.esm.js +216 -0
  31. package/dist/collapsible/surface/parts.esm.js.map +1 -0
  32. package/dist/collapsible/surface/styles/assistant-ui-markdown.css.esm.js +5 -0
  33. package/dist/collapsible/surface/styles/assistant-ui-markdown.css.esm.js.map +1 -0
  34. package/dist/collapsible/surface/styles/assistant-ui.css.esm.js +5 -0
  35. package/dist/collapsible/surface/styles/assistant-ui.css.esm.js.map +1 -0
  36. package/dist/collapsible/unreadStore.esm.js +79 -0
  37. package/dist/collapsible/unreadStore.esm.js.map +1 -0
  38. package/dist/collapsible/useConversations.esm.js +171 -0
  39. package/dist/collapsible/useConversations.esm.js.map +1 -0
  40. package/dist/index.d.ts +63 -0
  41. package/dist/index.esm.js +3 -0
  42. package/dist/index.esm.js.map +1 -0
  43. package/dist/node_modules_dist/style-inject/dist/style-inject.es.esm.js +29 -0
  44. package/dist/node_modules_dist/style-inject/dist/style-inject.es.esm.js.map +1 -0
  45. package/dist/routes.esm.js +8 -0
  46. package/dist/routes.esm.js.map +1 -0
  47. package/package.json +107 -0
@@ -0,0 +1 @@
1
+ {"version":3,"file":"MermaidDiagram.esm.js","sources":["../../../src/collapsible/surface/MermaidDiagram.tsx"],"sourcesContent":["import { KeyboardEvent, useEffect, useRef, useState } from 'react';\nimport mermaid from 'mermaid';\nimport {\n CircularProgress,\n Dialog,\n IconButton,\n Tooltip,\n Typography,\n} from '@material-ui/core';\nimport { makeStyles } from '@material-ui/core/styles';\nimport CloseIcon from '@material-ui/icons/Close';\n\nmermaid.initialize({\n startOnLoad: false,\n theme: 'base',\n themeVariables: {\n background: '#ffffff',\n mainBkg: '#ffffff',\n primaryColor: '#f8fafc',\n primaryTextColor: '#111827',\n primaryBorderColor: '#334155',\n lineColor: '#475569',\n secondaryColor: '#eef2ff',\n tertiaryColor: '#f8fafc',\n clusterBkg: '#f8fafc',\n clusterBorder: '#cbd5e1',\n edgeLabelBackground: '#ffffff',\n fontFamily: 'Inter, Roboto, Arial, sans-serif',\n },\n suppressErrorRendering: true,\n});\n\nlet idCounter = 0;\nconst DEBOUNCE_MS = 600;\n\nconst useStyles = makeStyles(theme => ({\n wrapper: {\n position: 'relative',\n margin: theme.spacing(1.5, 0),\n borderRadius: theme.shape.borderRadius,\n overflow: 'hidden',\n minHeight: 80,\n },\n diagram: {\n display: 'flex',\n justifyContent: 'center',\n padding: theme.spacing(1),\n border: `1px solid ${theme.palette.divider}`,\n borderRadius: theme.shape.borderRadius,\n backgroundColor: '#ffffff',\n color: '#111827',\n cursor: 'zoom-in',\n overflow: 'auto',\n transition: 'filter 0.3s ease, opacity 0.3s ease',\n '&:focus-visible': {\n outline: `2px solid ${theme.palette.primary.main}`,\n outlineOffset: 2,\n },\n '& svg': {\n maxWidth: '100%',\n height: 'auto',\n },\n },\n diagramLoading: {\n filter: 'blur(4px)',\n opacity: 0.4,\n pointerEvents: 'none',\n },\n overlay: {\n position: 'absolute',\n inset: 0,\n display: 'flex',\n flexDirection: 'column',\n alignItems: 'center',\n justifyContent: 'center',\n gap: theme.spacing(1),\n zIndex: 1,\n // frosted glass\n backgroundColor:\n theme.palette.type === 'dark'\n ? 'rgba(30, 30, 30, 0.6)'\n : 'rgba(255, 255, 255, 0.6)',\n backdropFilter: 'blur(8px)',\n borderRadius: theme.shape.borderRadius,\n },\n dialogPaper: {\n backgroundColor: theme.palette.background.default,\n },\n dialogBody: {\n position: 'relative',\n display: 'flex',\n alignItems: 'center',\n justifyContent: 'center',\n minHeight: '100vh',\n padding: theme.spacing(7, 3, 3),\n overflow: 'auto',\n },\n closeButton: {\n position: 'fixed',\n top: theme.spacing(1.5),\n right: theme.spacing(1.5),\n zIndex: 1,\n backgroundColor: theme.palette.background.paper,\n '&:hover': {\n backgroundColor: theme.palette.action.hover,\n },\n },\n fullscreenDiagram: {\n display: 'flex',\n alignItems: 'center',\n justifyContent: 'center',\n minWidth: '100%',\n padding: theme.spacing(2),\n borderRadius: theme.shape.borderRadius,\n backgroundColor: '#ffffff',\n color: '#111827',\n '& svg': {\n width: 'auto',\n height: 'auto',\n maxWidth: 'calc(100vw - 48px)',\n maxHeight: 'calc(100vh - 96px)',\n },\n },\n error: {\n margin: theme.spacing(1.5, 0),\n padding: theme.spacing(1.5),\n overflow: 'auto',\n border: `1px solid ${theme.palette.divider}`,\n borderRadius: theme.shape.borderRadius,\n backgroundColor:\n theme.palette.type === 'dark'\n ? theme.palette.grey[900]\n : theme.palette.grey[100],\n color: theme.palette.text.primary,\n fontSize: theme.typography.caption.fontSize,\n },\n}));\n\n/**\n * Streaming-safe Mermaid renderer.\n *\n * Renders the first frame immediately, then debounces subsequent renders to\n * avoid thrashing while the diagram source is still streaming in. Keeps the\n * last good render on screen if an in-progress (incomplete) diagram fails to\n * parse, and only surfaces a parse error once the stream has settled. Clicking\n * the rendered diagram opens a fullscreen dialog.\n */\nexport function MermaidDiagram({ code }: { code: string }) {\n const classes = useStyles();\n const [svg, setSvg] = useState<string>('');\n const [rendering, setRendering] = useState(true);\n const [error, setError] = useState<string>('');\n const [showError, setShowError] = useState(false);\n const [open, setOpen] = useState(false);\n const timerRef = useRef<ReturnType<typeof setTimeout>>();\n const errorTimerRef = useRef<ReturnType<typeof setTimeout>>();\n const lastRenderedCode = useRef<string>('');\n\n useEffect(() => {\n const trimmed = code.trim();\n\n // If this is the first render (no svg yet), render immediately\n // Otherwise debounce to avoid rapid re-renders during streaming\n const isFirst = !svg && !error;\n const delay = isFirst ? 0 : DEBOUNCE_MS;\n\n setRendering(true);\n setError('');\n setShowError(false);\n\n clearTimeout(timerRef.current);\n clearTimeout(errorTimerRef.current);\n timerRef.current = setTimeout(() => {\n // Skip if code hasn't changed since last successful render\n if (trimmed === lastRenderedCode.current) {\n setRendering(false);\n return;\n }\n\n let active = true;\n const id = `mermaid-${++idCounter}`;\n\n mermaid\n .render(id, trimmed)\n .then(({ svg: rendered }) => {\n if (active) {\n setSvg(rendered);\n setError('');\n lastRenderedCode.current = trimmed;\n setRendering(false);\n }\n })\n .catch((err: Error) => {\n if (active) {\n // During streaming, don't replace a good render with an error\n // from incomplete code — just keep showing the loading state\n if (svg) {\n setRendering(false);\n } else {\n setError(err.message);\n setRendering(false);\n errorTimerRef.current = setTimeout(() => {\n setShowError(true);\n }, 1500);\n }\n }\n });\n\n return () => {\n active = false;\n };\n }, delay);\n\n return () => {\n clearTimeout(timerRef.current);\n clearTimeout(errorTimerRef.current);\n };\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [code]);\n\n const handleKeyDown = (event: KeyboardEvent<HTMLDivElement>) => {\n if (event.key === 'Enter' || event.key === ' ') {\n event.preventDefault();\n setOpen(true);\n }\n };\n\n if (error && !svg && showError) {\n return (\n <pre className={classes.error}>\n <code>{code}</code>\n </pre>\n );\n }\n\n const isLoading = rendering && !!svg;\n const isInitialLoading = !svg && (rendering || (error && !showError));\n\n return (\n <>\n <div className={classes.wrapper}>\n {isLoading && (\n <div className={classes.overlay}>\n <CircularProgress size={24} />\n <Typography variant=\"caption\" color=\"textSecondary\">\n Rendering diagram…\n </Typography>\n </div>\n )}\n\n {isInitialLoading && (\n <div className={classes.overlay}>\n <CircularProgress size={24} />\n <Typography variant=\"caption\" color=\"textSecondary\">\n Rendering diagram…\n </Typography>\n </div>\n )}\n\n {svg && (\n <Tooltip title=\"Open diagram fullscreen\">\n <div\n className={`${classes.diagram} ${\n isLoading ? classes.diagramLoading : ''\n }`}\n dangerouslySetInnerHTML={{ __html: svg }}\n role=\"button\"\n tabIndex={0}\n aria-label=\"Open Mermaid diagram fullscreen\"\n onClick={() => !isLoading && setOpen(true)}\n onKeyDown={handleKeyDown}\n />\n </Tooltip>\n )}\n </div>\n\n <Dialog\n fullScreen\n open={open}\n onClose={() => setOpen(false)}\n PaperProps={{ className: classes.dialogPaper }}\n >\n <div className={classes.dialogBody}>\n <Tooltip title=\"Close\">\n <IconButton\n className={classes.closeButton}\n aria-label=\"Close fullscreen diagram\"\n onClick={() => setOpen(false)}\n >\n <CloseIcon />\n </IconButton>\n </Tooltip>\n <div\n className={classes.fullscreenDiagram}\n dangerouslyS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AAAA,cACC,WAAW,OAAA,CAAQ,WAAA;AAAA,cACnB,YAAA,EAAW,0BAAA;AAAA,cACX,OAAA,EAAS,MAAM,OAAA,CAAQ,KAAK,CAAA;AAAA,cAE5B,8BAAC,SAAA,EAAA,EAAU;AAAA;AAAA,WACb,EACF,CAAA;AAAA,0BACA,GAAA;AAAA,YAAC,KAAA;AAAA,YAAA;AAAA,cACC,WAAW,OAAA,CAAQ,iBAAA;AAAA,cACnB,uBAAA,EAAyB,EAAE,MAAA,EAAQ,GAAA;AAAI;AAAA;AACzC,SAAA,EACF;AAAA;AAAA;AACF,GAAA,EACF,CAAA;AAEJ;;;;"}
@@ -0,0 +1,216 @@
1
+ import { jsxs, jsx } from 'react/jsx-runtime';
2
+ import { useState } from 'react';
3
+ import { makeStyles } from '@material-ui/core/styles';
4
+ import { Collapse, Box, Typography, CircularProgress } from '@material-ui/core';
5
+ import CheckCircleOutlineIcon from '@material-ui/icons/CheckCircleOutline';
6
+ import ErrorOutlineIcon from '@material-ui/icons/ErrorOutline';
7
+ import ExpandLessIcon from '@material-ui/icons/ExpandLess';
8
+ import ExpandMoreIcon from '@material-ui/icons/ExpandMore';
9
+ import HourglassEmptyIcon from '@material-ui/icons/HourglassEmpty';
10
+
11
+ const useStyles = makeStyles((theme) => ({
12
+ thinkingMessage: {
13
+ display: "inline-flex",
14
+ alignItems: "center",
15
+ gap: theme.spacing(1),
16
+ color: theme.palette.text.secondary
17
+ },
18
+ errorMessage: {
19
+ display: "flex",
20
+ alignItems: "center",
21
+ gap: theme.spacing(1),
22
+ margin: theme.spacing(0.5, 0),
23
+ padding: theme.spacing(1, 1.5),
24
+ borderRadius: theme.shape.borderRadius,
25
+ backgroundColor: theme.palette.type === "dark" ? "rgba(244,67,54,0.1)" : "rgba(244,67,54,0.06)",
26
+ color: theme.palette.error.main
27
+ },
28
+ reasoningToggle: {
29
+ display: "inline-flex",
30
+ alignItems: "center",
31
+ gap: theme.spacing(0.5),
32
+ margin: theme.spacing(0.5, 0),
33
+ padding: theme.spacing(0.25, 0.75),
34
+ border: "none",
35
+ borderRadius: theme.shape.borderRadius,
36
+ background: "none",
37
+ color: theme.palette.text.secondary,
38
+ fontSize: theme.typography.caption.fontSize,
39
+ cursor: "pointer",
40
+ "&:hover": {
41
+ backgroundColor: theme.palette.action.hover
42
+ }
43
+ },
44
+ reasoningText: {
45
+ margin: theme.spacing(0.5, 0, 0.5, 2.5),
46
+ padding: theme.spacing(1, 1.5),
47
+ borderLeft: `2px solid ${theme.palette.divider}`,
48
+ color: theme.palette.text.secondary,
49
+ fontFamily: theme.typography.fontFamily,
50
+ fontSize: theme.typography.caption.fontSize,
51
+ lineHeight: 1.55,
52
+ whiteSpace: "pre-wrap"
53
+ },
54
+ toolToggle: {
55
+ display: "inline-flex",
56
+ alignItems: "center",
57
+ gap: theme.spacing(0.5),
58
+ margin: theme.spacing(0.5, 0),
59
+ padding: theme.spacing(0.25, 0.75),
60
+ border: "none",
61
+ borderRadius: theme.shape.borderRadius,
62
+ background: "none",
63
+ color: theme.palette.text.secondary,
64
+ fontSize: theme.typography.caption.fontSize,
65
+ cursor: "pointer",
66
+ "&:hover": {
67
+ backgroundColor: theme.palette.action.hover
68
+ }
69
+ },
70
+ toolBody: {
71
+ margin: theme.spacing(0.5, 0, 0.5, 2.5),
72
+ padding: theme.spacing(1, 1.5),
73
+ borderLeft: `2px solid ${theme.palette.divider}`
74
+ },
75
+ payloadTitle: {
76
+ marginBottom: theme.spacing(0.5),
77
+ color: theme.palette.text.secondary,
78
+ fontWeight: 500
79
+ },
80
+ payloadBlock: {
81
+ margin: 0,
82
+ padding: theme.spacing(1),
83
+ overflow: "auto",
84
+ maxHeight: theme.spacing(30),
85
+ borderRadius: theme.shape.borderRadius,
86
+ backgroundColor: theme.palette.type === "dark" ? theme.palette.grey[900] : theme.palette.grey[100],
87
+ color: theme.palette.text.primary,
88
+ fontFamily: "monospace",
89
+ fontSize: theme.typography.caption.fontSize,
90
+ whiteSpace: "pre-wrap",
91
+ wordBreak: "break-word"
92
+ }
93
+ }));
94
+ function formatPayload(value) {
95
+ if (typeof value === "string") {
96
+ return value;
97
+ }
98
+ try {
99
+ return JSON.stringify(value, null, 2);
100
+ } catch {
101
+ return String(value);
102
+ }
103
+ }
104
+ function getToolStatus(status) {
105
+ switch (status?.type) {
106
+ case "complete":
107
+ return {
108
+ label: "Complete",
109
+ icon: /* @__PURE__ */ jsx(CheckCircleOutlineIcon, { fontSize: "small", color: "primary" })
110
+ };
111
+ case "incomplete":
112
+ return {
113
+ label: "Incomplete",
114
+ icon: /* @__PURE__ */ jsx(ErrorOutlineIcon, { fontSize: "small", color: "error" })
115
+ };
116
+ case "running":
117
+ return { label: "Running", icon: /* @__PURE__ */ jsx(CircularProgress, { size: 16 }) };
118
+ default:
119
+ return {
120
+ label: "Pending",
121
+ icon: /* @__PURE__ */ jsx(HourglassEmptyIcon, { fontSize: "small", color: "disabled" })
122
+ };
123
+ }
124
+ }
125
+ function ToolFallback({
126
+ toolName,
127
+ args,
128
+ result,
129
+ status
130
+ }) {
131
+ const classes = useStyles();
132
+ const [open, setOpen] = useState(false);
133
+ const { icon } = getToolStatus(status);
134
+ const hasArgs = args !== void 0 && args !== null;
135
+ const hasResult = result !== void 0 && result !== null;
136
+ return /* @__PURE__ */ jsxs("div", { children: [
137
+ /* @__PURE__ */ jsxs(
138
+ "button",
139
+ {
140
+ type: "button",
141
+ className: classes.toolToggle,
142
+ onClick: () => setOpen((v) => !v),
143
+ children: [
144
+ icon,
145
+ /* @__PURE__ */ jsx("span", { children: open ? toolName : "Tool Use" }),
146
+ open ? /* @__PURE__ */ jsx(ExpandLessIcon, { style: { fontSize: 14 } }) : /* @__PURE__ */ jsx(ExpandMoreIcon, { style: { fontSize: 14 } })
147
+ ]
148
+ }
149
+ ),
150
+ /* @__PURE__ */ jsx(Collapse, { in: open, unmountOnExit: true, children: /* @__PURE__ */ jsxs("div", { className: classes.toolBody, children: [
151
+ hasArgs && /* @__PURE__ */ jsxs(Box, { mb: hasResult ? 1 : 0, children: [
152
+ /* @__PURE__ */ jsx(
153
+ Typography,
154
+ {
155
+ variant: "caption",
156
+ component: "div",
157
+ className: classes.payloadTitle,
158
+ children: "Input"
159
+ }
160
+ ),
161
+ /* @__PURE__ */ jsx("pre", { className: classes.payloadBlock, children: formatPayload(args) })
162
+ ] }),
163
+ hasResult && /* @__PURE__ */ jsxs(Box, { children: [
164
+ /* @__PURE__ */ jsx(
165
+ Typography,
166
+ {
167
+ variant: "caption",
168
+ component: "div",
169
+ className: classes.payloadTitle,
170
+ children: "Output"
171
+ }
172
+ ),
173
+ /* @__PURE__ */ jsx("pre", { className: classes.payloadBlock, children: formatPayload(result) })
174
+ ] })
175
+ ] }) })
176
+ ] });
177
+ }
178
+ function ThinkingMessage({ status }) {
179
+ const classes = useStyles();
180
+ if (status.type === "running") {
181
+ return /* @__PURE__ */ jsxs(Box, { className: classes.thinkingMessage, "aria-live": "polite", children: [
182
+ /* @__PURE__ */ jsx(CircularProgress, { size: 14, thickness: 5 }),
183
+ /* @__PURE__ */ jsx(Typography, { variant: "body2", component: "span", children: "Reasoning\u2026" })
184
+ ] });
185
+ }
186
+ if (status.type === "complete" || status.type === "incomplete") {
187
+ return /* @__PURE__ */ jsxs(Box, { className: classes.errorMessage, "aria-live": "polite", children: [
188
+ /* @__PURE__ */ jsx(ErrorOutlineIcon, { fontSize: "small" }),
189
+ /* @__PURE__ */ jsx(Typography, { variant: "body2", component: "span", children: "Something went wrong. Please try again." })
190
+ ] });
191
+ }
192
+ return null;
193
+ }
194
+ function ReasoningPart({ text, status }) {
195
+ const classes = useStyles();
196
+ const [open, setOpen] = useState(false);
197
+ return /* @__PURE__ */ jsxs("div", { "aria-live": "polite", children: [
198
+ /* @__PURE__ */ jsxs(
199
+ "button",
200
+ {
201
+ type: "button",
202
+ className: classes.reasoningToggle,
203
+ onClick: () => setOpen((v) => !v),
204
+ children: [
205
+ status.type === "running" ? /* @__PURE__ */ jsx(CircularProgress, { size: 12, thickness: 5 }) : /* @__PURE__ */ jsx("span", { style: { fontSize: 12 }, children: "\u{1F4AD}" }),
206
+ /* @__PURE__ */ jsx("span", { children: "Reasoning" }),
207
+ text && (open ? /* @__PURE__ */ jsx(ExpandLessIcon, { style: { fontSize: 14 } }) : /* @__PURE__ */ jsx(ExpandMoreIcon, { style: { fontSize: 14 } }))
208
+ ]
209
+ }
210
+ ),
211
+ text && /* @__PURE__ */ jsx(Collapse, { in: open, unmountOnExit: true, children: /* @__PURE__ */ jsx("pre", { className: classes.reasoningText, children: text }) })
212
+ ] });
213
+ }
214
+
215
+ export { ReasoningPart, ThinkingMessage, ToolFallback, formatPayload, getToolStatus };
216
+ //# sourceMappingURL=parts.esm.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"parts.esm.js","sources":["../../../src/collapsible/surface/parts.tsx"],"sourcesContent":["import { useState } from 'react';\nimport { makeStyles } from '@material-ui/core/styles';\nimport { Box, CircularProgress, Collapse, Typography } from '@material-ui/core';\nimport CheckCircleOutlineIcon from '@material-ui/icons/CheckCircleOutline';\nimport ErrorOutlineIcon from '@material-ui/icons/ErrorOutline';\nimport ExpandLessIcon from '@material-ui/icons/ExpandLess';\nimport ExpandMoreIcon from '@material-ui/icons/ExpandMore';\nimport HourglassEmptyIcon from '@material-ui/icons/HourglassEmpty';\nimport type {\n EmptyMessagePartProps,\n ReasoningMessagePartProps,\n ToolCallMessagePartProps,\n} from '@assistant-ui/react';\n\nconst useStyles = makeStyles(theme => ({\n thinkingMessage: {\n display: 'inline-flex',\n alignItems: 'center',\n gap: theme.spacing(1),\n color: theme.palette.text.secondary,\n },\n errorMessage: {\n display: 'flex',\n alignItems: 'center',\n gap: theme.spacing(1),\n margin: theme.spacing(0.5, 0),\n padding: theme.spacing(1, 1.5),\n borderRadius: theme.shape.borderRadius,\n backgroundColor:\n theme.palette.type === 'dark'\n ? 'rgba(244,67,54,0.1)'\n : 'rgba(244,67,54,0.06)',\n color: theme.palette.error.main,\n },\n reasoningToggle: {\n display: 'inline-flex',\n alignItems: 'center',\n gap: theme.spacing(0.5),\n margin: theme.spacing(0.5, 0),\n padding: theme.spacing(0.25, 0.75),\n border: 'none',\n borderRadius: theme.shape.borderRadius,\n background: 'none',\n color: theme.palette.text.secondary,\n fontSize: theme.typography.caption.fontSize,\n cursor: 'pointer',\n '&:hover': {\n backgroundColor: theme.palette.action.hover,\n },\n },\n reasoningText: {\n margin: theme.spacing(0.5, 0, 0.5, 2.5),\n padding: theme.spacing(1, 1.5),\n borderLeft: `2px solid ${theme.palette.divider}`,\n color: theme.palette.text.secondary,\n fontFamily: theme.typography.fontFamily as string,\n fontSize: theme.typography.caption.fontSize,\n lineHeight: 1.55,\n whiteSpace: 'pre-wrap',\n },\n toolToggle: {\n display: 'inline-flex',\n alignItems: 'center',\n gap: theme.spacing(0.5),\n margin: theme.spacing(0.5, 0),\n padding: theme.spacing(0.25, 0.75),\n border: 'none',\n borderRadius: theme.shape.borderRadius,\n background: 'none',\n color: theme.palette.text.secondary,\n fontSize: theme.typography.caption.fontSize,\n cursor: 'pointer',\n '&:hover': {\n backgroundColor: theme.palette.action.hover,\n },\n },\n toolBody: {\n margin: theme.spacing(0.5, 0, 0.5, 2.5),\n padding: theme.spacing(1, 1.5),\n borderLeft: `2px solid ${theme.palette.divider}`,\n },\n payloadTitle: {\n marginBottom: theme.spacing(0.5),\n color: theme.palette.text.secondary,\n fontWeight: 500,\n },\n payloadBlock: {\n margin: 0,\n padding: theme.spacing(1),\n overflow: 'auto',\n maxHeight: theme.spacing(30),\n borderRadius: theme.shape.borderRadius,\n backgroundColor:\n theme.palette.type === 'dark'\n ? theme.palette.grey[900]\n : theme.palette.grey[100],\n color: theme.palette.text.primary,\n fontFamily: 'monospace',\n fontSize: theme.typography.caption.fontSize,\n whiteSpace: 'pre-wrap',\n wordBreak: 'break-word',\n },\n}));\n\n/** Serialize a tool input/output payload for display. */\nexport function formatPayload(value: unknown) {\n if (typeof value === 'string') {\n return value;\n }\n\n try {\n return JSON.stringify(value, null, 2);\n } catch {\n return String(value);\n }\n}\n\n/** Map a tool-call status to a human label + status icon. */\nexport function getToolStatus(status: ToolCallMessagePartProps['status']) {\n switch (status?.type) {\n case 'complete':\n return {\n label: 'Complete',\n icon: <CheckCircleOutlineIcon fontSize=\"small\" color=\"primary\" />,\n };\n case 'incomplete':\n return {\n label: 'Incomplete',\n icon: <ErrorOutlineIcon fontSize=\"small\" color=\"error\" />,\n };\n case 'running':\n return { label: 'Running', icon: <CircularProgress size={16} /> };\n default:\n return {\n label: 'Pending',\n icon: <HourglassEmptyIcon fontSize=\"small\" color=\"disabled\" />,\n };\n }\n}\n\n/**\n * Default renderer for tool calls that don't have a bespoke UI. Shows a compact\n * toggle with the tool's status, expanding to reveal the input args and result.\n */\nexport function ToolFallback({\n toolName,\n args,\n result,\n status,\n}: ToolCallMessagePartProps) {\n const classes = useStyles();\n const [open, setOpen] = useState(false);\n const { icon } = getToolStatus(status);\n const hasArgs = args !== undefined && args !== null;\n const hasResult = result !== undefined && result !== null;\n\n return (\n <div>\n <button\n type=\"button\"\n className={classes.toolToggle}\n onClick={() => setOpen(v => !v)}\n >\n {icon}\n <span>{open ? toolName : 'Tool Use'}</span>\n {open ? (\n <ExpandLessIcon style={{ fontSize: 14 }} />\n ) : (\n <ExpandMoreIcon style={{ fontSize: 14 }} />\n )}\n </button>\n\n <Collapse in={open} unmountOnExit>\n <div className={classes.toolBody}>\n {hasArgs && (\n <Box mb={hasResult ? 1 : 0}>\n <Typography\n variant=\"caption\"\n component=\"div\"\n className={classes.payloadTitle}\n >\n Input\n </Typography>\n <pre className={classes.payloadBlock}>{formatPayload(args)}</pre>\n </Box>\n )}\n {hasResult && (\n <Box>\n <Typography\n variant=\"caption\"\n component=\"div\"\n className={classes.payloadTitle}\n >\n Output\n </Typography>\n <pre className={classes.payloadBlock}>{formatPayload(result)}</pre>\n </Box>\n )}\n </div>\n </Collapse>\n </div>\n );\n}\n\n/**\n * Rendered in place of an empty assistant message: a \"Reasoning…\" spinner while\n * the model is thinking, or an error notice if the message completed with no\n * content (typically a stream/API failure).\n */\nexport function ThinkingMessage({ status }: EmptyMessagePartProps) {\n const classes = useStyles();\n\n if (status.type === 'running') {\n return (\n <Box className={classes.thinkingMessage} aria-live=\"polite\">\n <CircularProgress size={14} thickness={5} />\n <Typography variant=\"body2\" component=\"span\">\n Reasoning…\n </Typography>\n </Box>\n );\n }\n\n // Message completed with no content — likely a stream/API error\n if (status.type === 'complete' || status.type === 'incomplete') {\n return (\n <Box className={classes.errorMessage} aria-live=\"polite\">\n <ErrorOutlineIcon fontSize=\"small\" />\n <Typography variant=\"body2\" component=\"span\">\n Something went wrong. Please try again.\n </Typography>\n </Box>\n );\n }\n\n return null;\n}\n\n/** Collapsible renderer for an assistant message's reasoning (thinking) part. */\nexport function ReasoningPart({ text, status }: ReasoningMessagePartProps) {\n const classes = useStyles();\n const [open, setOpen] = useState(false);\n\n return (\n <div aria-live=\"polite\">\n <button\n type=\"button\"\n className={classes.reasoningToggle}\n onClick={() => setOpen(v => !v)}\n >\n {status.type === 'running' ? (\n <CircularProgress size={12} thickness={5} />\n ) : (\n <span style={{ fontSize: 12 }}>💭</span>\n )}\n <span>Reasoning</span>\n {text &&\n (open ? (\n <ExpandLessIcon style={{ fontSize: 14 }} />\n ) : (\n <ExpandMoreIcon style={{ fontSize: 14 }} />\n ))}\n </button>\n\n {text && (\n <Collapse in={open} unmountOnExit>\n <pre className={classes.reasoningText}>{text}</pre>\n </Collapse>\n )}\n </div>\n );\n}\n"],"names":[],"mappings":";;;;;;;;;;AAcA,MAAM,SAAA,GAAY,WAAW,CAAA,KAAA,MAAU;AAAA,EACrC,eAAA,EAAiB;AAAA,IACf,OAAA,EAAS,aAAA;AAAA,IACT,UAAA,EAAY,QAAA;AAAA,IACZ,GAAA,EAAK,KAAA,CAAM,OAAA,CAAQ,CAAC,CAAA;AAAA,IACpB,KAAA,EAAO,KAAA,CAAM,OAAA,CAAQ,IAAA,CAAK;AAAA,GAC5B;A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AA,GAAA,EAEJ,CAAA;AAEJ;;;;"}
@@ -0,0 +1,5 @@
1
+ import styleInject from '../../../node_modules_dist/style-inject/dist/style-inject.es.esm.js';
2
+
3
+ var css_248z = "/* src/styles/tailwindcss/markdown.css */\n@keyframes aui-pulse {\n 50% {\n opacity: .5;\n }\n}\n:where(.aui-md-running):empty::after,\n:where(.aui-md-running) > :where(:not(ol):not(ul):not(pre)):last-child::after,\n:where(.aui-md-running) > pre:last-child code::after,\n:where(.aui-md-running) > :where(:is(ol, ul):last-child) > :where(li:last-child:not(:has(* > li)))::after,\n:where(.aui-md-running) > :where(:is(ol, ul):last-child) > :where(li:last-child) > :where(:is(ol, ul):last-child) > :where(li:last-child:not(:has(* > li)))::after,\n:where(.aui-md-running) > :where(:is(ol, ul):last-child) > :where(li:last-child) > :where(:is(ol, ul):last-child) > :where(li:last-child) > :where(:is(ol, ul):last-child) > :where(li:last-child)::after {\n animation: aui-pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;\n font-family:\n ui-sans-serif,\n system-ui,\n sans-serif,\n \"Apple Color Emoji\",\n \"Segoe UI Emoji\",\n \"Segoe UI Symbol\",\n \"Noto Color Emoji\";\n --aui-content: \"\\25cf\";\n content: var(--aui-content);\n}\n:where(.aui-md-running):empty:where([dir=ltr], [dir=ltr] *)::after,\n:where(.aui-md-running) > :where(:not(ol):not(ul):not(pre)):last-child:where([dir=ltr], [dir=ltr] *)::after,\n:where(.aui-md-running) > pre:last-child code:where([dir=ltr], [dir=ltr] *)::after,\n:where(.aui-md-running) > :where(:is(ol, ul):last-child) > :where(li:last-child:not(:has(* > li))):where([dir=ltr], [dir=ltr] *)::after,\n:where(.aui-md-running) > :where(:is(ol, ul):last-child) > :where(li:last-child) > :where(:is(ol, ul):last-child) > :where(li:last-child:not(:has(* > li))):where([dir=ltr], [dir=ltr] *)::after,\n:where(.aui-md-running) > :where(:is(ol, ul):last-child) > :where(li:last-child) > :where(:is(ol, ul):last-child) > :where(li:last-child) > :where(:is(ol, ul):last-child) > :where(li:last-child):where([dir=ltr], [dir=ltr] *)::after {\n margin-left: 0.25rem;\n}\n:where(.aui-md-running):empty:where([dir=rtl], [dir=rtl] *)::after,\n:where(.aui-md-running) > :where(:not(ol):not(ul):not(pre)):last-child:where([dir=rtl], [dir=rtl] *)::after,\n:where(.aui-md-running) > pre:last-child code:where([dir=rtl], [dir=rtl] *)::after,\n:where(.aui-md-running) > :where(:is(ol, ul):last-child) > :where(li:last-child:not(:has(* > li))):where([dir=rtl], [dir=rtl] *)::after,\n:where(.aui-md-running) > :where(:is(ol, ul):last-child) > :where(li:last-child) > :where(:is(ol, ul):last-child) > :where(li:last-child:not(:has(* > li))):where([dir=rtl], [dir=rtl] *)::after,\n:where(.aui-md-running) > :where(:is(ol, ul):last-child) > :where(li:last-child) > :where(:is(ol, ul):last-child) > :where(li:last-child) > :where(:is(ol, ul):last-child) > :where(li:last-child):where([dir=rtl], [dir=rtl] *)::after {\n margin-right: 0.25rem;\n}\n.aui-md-h1 {\n margin-bottom: 2rem;\n scroll-margin: 5rem;\n font-size: 2.25rem;\n line-height: 2.5rem;\n font-weight: 800;\n letter-spacing: -0.025em;\n}\n.aui-md-h1:last-child {\n margin-bottom: 0px;\n}\n.aui-md-h2 {\n margin-bottom: 1rem;\n margin-top: 2rem;\n scroll-margin: 5rem;\n font-size: 1.875rem;\n line-height: 2.25rem;\n font-weight: 600;\n letter-spacing: -0.025em;\n}\n.aui-md-h2:first-child {\n margin-top: 0px;\n}\n.aui-md-h2:last-child {\n margin-bottom: 0px;\n}\n.aui-md-h3 {\n margin-bottom: 1rem;\n margin-top: 1.5rem;\n scroll-margin: 5rem;\n font-size: 1.5rem;\n line-height: 2rem;\n font-weight: 600;\n letter-spacing: -0.025em;\n}\n.aui-md-h3:first-child {\n margin-top: 0px;\n}\n.aui-md-h3:last-child {\n margin-bottom: 0px;\n}\n.aui-md-h4 {\n margin-bottom: 1rem;\n margin-top: 1.5rem;\n scroll-margin: 5rem;\n font-size: 1.25rem;\n line-height: 1.75rem;\n font-weight: 600;\n letter-spacing: -0.025em;\n}\n.aui-md-h4:first-child {\n margin-top: 0px;\n}\n.aui-md-h4:last-child {\n margin-bottom: 0px;\n}\n.aui-md-h5 {\n margin-top: 1rem;\n margin-bottom: 1rem;\n font-size: 1.125rem;\n line-height: 1.75rem;\n font-weight: 600;\n}\n.aui-md-h5:first-child {\n margin-top: 0px;\n}\n.aui-md-h5:last-child {\n margin-bottom: 0px;\n}\n.aui-md-h6 {\n margin-top: 1rem;\n margin-bottom: 1rem;\n font-weight: 600;\n}\n.aui-md-h6:first-child {\n margin-top: 0px;\n}\n.aui-md-h6:last-child {\n margin-bottom: 0px;\n}\n.aui-md-p {\n margin-bottom: 1.25rem;\n margin-top: 1.25rem;\n line-height: 1.75rem;\n}\n.aui-md-p:first-child {\n margin-top: 0px;\n}\n.aui-md-p:last-child {\n margin-bottom: 0px;\n}\n.aui-md-a {\n font-weight: 500;\n color: hsl(var(--aui-primary));\n text-decoration-line: underline;\n text-underline-offset: 4px;\n}\n.aui-md-blockquote {\n border-left-width: 2px;\n padding-left: 1.5rem;\n font-style: italic;\n}\n.aui-md-ul {\n margin-top: 1.25rem;\n margin-bottom: 1.25rem;\n margin-left: 1.5rem;\n list-style-type: disc;\n}\n.aui-md-ul > li {\n margin-top: 0.5rem;\n}\n.aui-md-ol {\n margin-top: 1.25rem;\n margin-bottom: 1.25rem;\n margin-left: 1.5rem;\n list-style-type: decimal;\n}\n.aui-md-ol > li {\n margin-top: 0.5rem;\n}\n.aui-md-hr {\n margin-top: 1.25rem;\n margin-bottom: 1.25rem;\n border-bottom-width: 1px;\n}\n.aui-md-table {\n margin-top: 1.25rem;\n margin-bottom: 1.25rem;\n width: 100%;\n border-collapse: separate;\n --aui-border-spacing-x: 0px;\n --aui-border-spacing-y: 0px;\n border-spacing: var(--aui-border-spacing-x) var(--aui-border-spacing-y);\n overflow-y: auto;\n}\n.aui-md-th {\n background-color: hsl(var(--aui-muted));\n padding-left: 1rem;\n padding-right: 1rem;\n padding-top: 0.5rem;\n padding-bottom: 0.5rem;\n text-align: left;\n font-weight: 700;\n}\n.aui-md-th:first-child {\n border-top-left-radius: var(--aui-radius);\n}\n.aui-md-th:last-child {\n border-top-right-radius: var(--aui-radius);\n}\n.aui-md-th[align=center] {\n text-align: center;\n}\n.aui-md-th[align=right] {\n text-align: right;\n}\n.aui-md-td {\n border-bottom-width: 1px;\n border-left-width: 1px;\n padding-left: 1rem;\n padding-right: 1rem;\n padding-top: 0.5rem;\n padding-bottom: 0.5rem;\n text-align: left;\n}\n.aui-md-td:last-child {\n border-right-width: 1px;\n}\n.aui-md-td[align=center] {\n text-align: center;\n}\n.aui-md-td[align=right] {\n text-align: right;\n}\n.aui-md-tr {\n margin: 0px;\n border-bottom-width: 1px;\n padding: 0px;\n}\n.aui-md-tr:first-child {\n border-top-width: 1px;\n}\n.aui-md-tr:last-child > td:first-child {\n border-bottom-left-radius: var(--aui-radius);\n}\n.aui-md-tr:last-child > td:last-child {\n border-bottom-right-radius: var(--aui-radius);\n}\n.aui-md-sup > a {\n font-size: 0.75rem;\n line-height: 1rem;\n text-decoration-line: none;\n}\n.aui-md-pre {\n overflow-x: auto;\n border-bottom-right-radius: var(--aui-radius);\n border-bottom-left-radius: var(--aui-radius);\n background-color: #000;\n padding: 1rem;\n --aui-text-opacity: 1;\n color: rgb(255 255 255 / var(--aui-text-opacity, 1));\n}\n.aui-md-inline-code {\n border-radius: 0.25rem;\n border-width: 1px;\n background-color: hsl(var(--aui-muted));\n font-weight: 600;\n}\n.aui-code-header-root {\n display: flex;\n align-items: center;\n justify-content: space-between;\n gap: 1rem;\n border-top-left-radius: var(--aui-radius);\n border-top-right-radius: var(--aui-radius);\n background-color: #18181b;\n padding-left: 1rem;\n padding-right: 1rem;\n padding-top: 0.5rem;\n padding-bottom: 0.5rem;\n font-size: 0.875rem;\n line-height: 1.25rem;\n font-weight: 600;\n --aui-text-opacity: 1;\n color: rgb(255 255 255 / var(--aui-text-opacity, 1));\n}\n.aui-code-header-language {\n text-transform: lowercase;\n}\n.aui-code-header-language > span {\n font-size: 0.75rem;\n line-height: 1rem;\n}\n\n/* src/styles/markdown.css */";
4
+ styleInject(css_248z);
5
+ //# sourceMappingURL=assistant-ui-markdown.css.esm.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"assistant-ui-markdown.css.esm.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;"}
@@ -0,0 +1,5 @@
1
+ import styleInject from '../../../node_modules_dist/style-inject/dist/style-inject.es.esm.js';
2
+
3
+ var css_248z = "/* src/styles/base.css */\n:where(.aui-root) *,\n:where(.aui-root) ::before,\n:where(.aui-root) ::after {\n --aui-border-spacing-x: 0;\n --aui-border-spacing-y: 0;\n --aui-translate-x: 0;\n --aui-translate-y: 0;\n --aui-rotate: 0;\n --aui-skew-x: 0;\n --aui-skew-y: 0;\n --aui-scale-x: 1;\n --aui-scale-y: 1;\n --aui-ring-inset: ;\n --aui-ring-offset-width: 0px;\n --aui-ring-offset-color: #fff;\n --aui-ring-color: rgb(59 130 246 / 0.5);\n --aui-ring-offset-shadow: 0 0 #0000;\n --aui-ring-shadow: 0 0 #0000;\n --aui-shadow: 0 0 #0000;\n --aui-shadow-colored: 0 0 #0000;\n --aui-blur: ;\n --aui-brightness: ;\n --aui-contrast: ;\n --aui-grayscale: ;\n --aui-hue-rotate: ;\n --aui-invert: ;\n --aui-saturate: ;\n --aui-sepia: ;\n --aui-drop-shadow: ;\n --aui-backdrop-blur: ;\n --aui-backdrop-brightness: ;\n --aui-backdrop-contrast: ;\n --aui-backdrop-grayscale: ;\n --aui-backdrop-hue-rotate: ;\n --aui-backdrop-invert: ;\n --aui-backdrop-opacity: ;\n --aui-backdrop-saturate: ;\n --aui-backdrop-sepia: ;\n --aui-contain-size: ;\n --aui-contain-layout: ;\n --aui-contain-paint: ;\n --aui-contain-style: ;\n}\n:where(.aui-root) ::backdrop {\n --aui-border-spacing-x: 0;\n --aui-border-spacing-y: 0;\n --aui-translate-x: 0;\n --aui-translate-y: 0;\n --aui-rotate: 0;\n --aui-skew-x: 0;\n --aui-skew-y: 0;\n --aui-scale-x: 1;\n --aui-scale-y: 1;\n --aui-ring-inset: ;\n --aui-ring-offset-width: 0px;\n --aui-ring-offset-color: #fff;\n --aui-ring-color: rgb(59 130 246 / 0.5);\n --aui-ring-offset-shadow: 0 0 #0000;\n --aui-ring-shadow: 0 0 #0000;\n --aui-shadow: 0 0 #0000;\n --aui-shadow-colored: 0 0 #0000;\n --aui-blur: ;\n --aui-brightness: ;\n --aui-contrast: ;\n --aui-grayscale: ;\n --aui-hue-rotate: ;\n --aui-invert: ;\n --aui-saturate: ;\n --aui-sepia: ;\n --aui-drop-shadow: ;\n --aui-backdrop-blur: ;\n --aui-backdrop-brightness: ;\n --aui-backdrop-contrast: ;\n --aui-backdrop-grayscale: ;\n --aui-backdrop-hue-rotate: ;\n --aui-backdrop-invert: ;\n --aui-backdrop-opacity: ;\n --aui-backdrop-saturate: ;\n --aui-backdrop-sepia: ;\n --aui-contain-size: ;\n --aui-contain-layout: ;\n --aui-contain-paint: ;\n --aui-contain-style: ;\n}\n:where(.aui-root) *,\n:where(.aui-root) ::before,\n:where(.aui-root) ::after {\n box-sizing: border-box;\n border-width: 0;\n border-style: solid;\n border-color: #e5e7eb;\n}\n:where(.aui-root) ::before,\n:where(.aui-root) ::after {\n --aui-content: \"\";\n}\n:where(.aui-root) html,\n:where(.aui-root) :host {\n line-height: 1.5;\n -webkit-text-size-adjust: 100%;\n -moz-tab-size: 4;\n -o-tab-size: 4;\n tab-size: 4;\n font-family:\n ui-sans-serif,\n system-ui,\n sans-serif,\n \"Apple Color Emoji\",\n \"Segoe UI Emoji\",\n \"Segoe UI Symbol\",\n \"Noto Color Emoji\";\n font-feature-settings: normal;\n font-variation-settings: normal;\n -webkit-tap-highlight-color: transparent;\n}\n:where(.aui-root) body {\n margin: 0;\n line-height: inherit;\n}\n:where(.aui-root) hr {\n height: 0;\n color: inherit;\n border-top-width: 1px;\n}\n:where(.aui-root) abbr:where([title]) {\n -webkit-text-decoration: underline dotted;\n text-decoration: underline dotted;\n}\n:where(.aui-root) h1,\n:where(.aui-root) h2,\n:where(.aui-root) h3,\n:where(.aui-root) h4,\n:where(.aui-root) h5,\n:where(.aui-root) h6 {\n font-size: inherit;\n font-weight: inherit;\n}\n:where(.aui-root) a {\n color: inherit;\n text-decoration: inherit;\n}\n:where(.aui-root) b,\n:where(.aui-root) strong {\n font-weight: bolder;\n}\n:where(.aui-root) code,\n:where(.aui-root) kbd,\n:where(.aui-root) samp,\n:where(.aui-root) pre {\n font-family:\n ui-monospace,\n SFMono-Regular,\n Menlo,\n Monaco,\n Consolas,\n \"Liberation Mono\",\n \"Courier New\",\n monospace;\n font-feature-settings: normal;\n font-variation-settings: normal;\n font-size: 1em;\n}\n:where(.aui-root) small {\n font-size: 80%;\n}\n:where(.aui-root) sub,\n:where(.aui-root) sup {\n font-size: 75%;\n line-height: 0;\n position: relative;\n vertical-align: baseline;\n}\n:where(.aui-root) sub {\n bottom: -0.25em;\n}\n:where(.aui-root) sup {\n top: -0.5em;\n}\n:where(.aui-root) table {\n text-indent: 0;\n border-color: inherit;\n border-collapse: collapse;\n}\n:where(.aui-root) button,\n:where(.aui-root) input,\n:where(.aui-root) optgroup,\n:where(.aui-root) select,\n:where(.aui-root) textarea {\n font-family: inherit;\n font-feature-settings: inherit;\n font-variation-settings: inherit;\n font-size: 100%;\n font-weight: inherit;\n line-height: inherit;\n letter-spacing: inherit;\n color: inherit;\n margin: 0;\n padding: 0;\n}\n:where(.aui-root) button,\n:where(.aui-root) select {\n text-transform: none;\n}\n:where(.aui-root) button,\n:where(.aui-root) input:where([type=button]),\n:where(.aui-root) input:where([type=reset]),\n:where(.aui-root) input:where([type=submit]) {\n -webkit-appearance: button;\n background-color: transparent;\n background-image: none;\n}\n:where(.aui-root) :-moz-focusring {\n outline: auto;\n}\n:where(.aui-root) :-moz-ui-invalid {\n box-shadow: none;\n}\n:where(.aui-root) progress {\n vertical-align: baseline;\n}\n:where(.aui-root) ::-webkit-inner-spin-button,\n:where(.aui-root) ::-webkit-outer-spin-button {\n height: auto;\n}\n:where(.aui-root) [type=search] {\n -webkit-appearance: textfield;\n outline-offset: -2px;\n}\n:where(.aui-root) ::-webkit-search-decoration {\n -webkit-appearance: none;\n}\n:where(.aui-root) ::-webkit-file-upload-button {\n -webkit-appearance: button;\n font: inherit;\n}\n:where(.aui-root) summary {\n display: list-item;\n}\n:where(.aui-root) blockquote,\n:where(.aui-root) dl,\n:where(.aui-root) dd,\n:where(.aui-root) h1,\n:where(.aui-root) h2,\n:where(.aui-root) h3,\n:where(.aui-root) h4,\n:where(.aui-root) h5,\n:where(.aui-root) h6,\n:where(.aui-root) hr,\n:where(.aui-root) figure,\n:where(.aui-root) p,\n:where(.aui-root) pre {\n margin: 0;\n}\n:where(.aui-root) fieldset {\n margin: 0;\n padding: 0;\n}\n:where(.aui-root) legend {\n padding: 0;\n}\n:where(.aui-root) ol,\n:where(.aui-root) ul,\n:where(.aui-root) menu {\n list-style: none;\n margin: 0;\n padding: 0;\n}\n:where(.aui-root) dialog {\n padding: 0;\n}\n:where(.aui-root) textarea {\n resize: vertical;\n}\n:where(.aui-root) input::-moz-placeholder,\n:where(.aui-root) textarea::-moz-placeholder {\n opacity: 1;\n color: #9ca3af;\n}\n:where(.aui-root) input::placeholder,\n:where(.aui-root) textarea::placeholder {\n opacity: 1;\n color: #9ca3af;\n}\n:where(.aui-root) button,\n:where(.aui-root) [role=button] {\n cursor: pointer;\n}\n:where(.aui-root) :disabled {\n cursor: default;\n}\n:where(.aui-root) img,\n:where(.aui-root) svg,\n:where(.aui-root) video,\n:where(.aui-root) canvas,\n:where(.aui-root) audio,\n:where(.aui-root) iframe,\n:where(.aui-root) embed,\n:where(.aui-root) object {\n display: block;\n vertical-align: middle;\n}\n:where(.aui-root) img,\n:where(.aui-root) video {\n max-width: 100%;\n height: auto;\n}\n:where(.aui-root) [hidden]:where(:not([hidden=until-found])) {\n display: none;\n}\n@keyframes aui-enter {\n from {\n opacity: var(--aui-enter-opacity, 1);\n transform: translate3d(var(--aui-enter-translate-x, 0), var(--aui-enter-translate-y, 0), 0) scale3d(var(--aui-enter-scale, 1), var(--aui-enter-scale, 1), var(--aui-enter-scale, 1)) rotate(var(--aui-enter-rotate, 0));\n }\n}\n@keyframes aui-exit {\n to {\n opacity: var(--aui-exit-opacity, 1);\n transform: translate3d(var(--aui-exit-translate-x, 0), var(--aui-exit-translate-y, 0), 0) scale3d(var(--aui-exit-scale, 1), var(--aui-exit-scale, 1), var(--aui-exit-scale, 1)) rotate(var(--aui-exit-rotate, 0));\n }\n}\n\n/* src/styles/tailwindcss/base-components.css */\n.aui-root {\n color: hsl(var(--aui-foreground));\n}\n.aui-root * {\n border-color: hsl(var(--aui-border));\n}\n.aui-button {\n display: inline-flex;\n align-items: center;\n justify-content: center;\n gap: 0.5rem;\n white-space: nowrap;\n border-radius: calc(var(--aui-radius) - 2px);\n font-size: 0.875rem;\n line-height: 1.25rem;\n font-weight: 500;\n transition-property:\n color,\n background-color,\n border-color,\n text-decoration-color,\n fill,\n stroke;\n transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);\n transition-duration: 150ms;\n}\n.aui-button:focus-visible {\n outline: 2px solid transparent;\n outline-offset: 2px;\n --aui-ring-offset-shadow: var(--aui-ring-inset) 0 0 0 var(--aui-ring-offset-width) var(--aui-ring-offset-color);\n --aui-ring-shadow: var(--aui-ring-inset) 0 0 0 calc(1px + var(--aui-ring-offset-width)) var(--aui-ring-color);\n box-shadow:\n var(--aui-ring-offset-shadow),\n var(--aui-ring-shadow),\n var(--aui-shadow, 0 0 #0000);\n --aui-ring-color: hsl(var(--aui-ring)) ;\n}\n.aui-button:disabled {\n pointer-events: none;\n opacity: 0.5;\n}\n.aui-button svg {\n pointer-events: none;\n width: 1rem;\n height: 1rem;\n flex-shrink: 0;\n}\n.aui-button-primary {\n background-color: hsl(var(--aui-primary));\n color: hsl(var(--aui-primary-foreground));\n --aui-shadow: 0 1px 3px 0 rgb(0 0 0 / 0.1), 0 1px 2px -1px rgb(0 0 0 / 0.1);\n --aui-shadow-colored: 0 1px 3px 0 var(--aui-shadow-color), 0 1px 2px -1px var(--aui-shadow-color);\n box-shadow:\n var(--aui-ring-offset-shadow, 0 0 #0000),\n var(--aui-ring-shadow, 0 0 #0000),\n var(--aui-shadow);\n}\n.aui-button-primary:hover {\n background-color: hsl(var(--aui-primary) / 0.9);\n}\n.aui-button-outline {\n border-width: 1px;\n border-color: hsl(var(--aui-input));\n background-color: hsl(var(--aui-background));\n --aui-shadow: 0 1px 2px 0 rgb(0 0 0 / 0.05);\n --aui-shadow-colored: 0 1px 2px 0 var(--aui-shadow-color);\n box-shadow:\n var(--aui-ring-offset-shadow, 0 0 #0000),\n var(--aui-ring-shadow, 0 0 #0000),\n var(--aui-shadow);\n}\n.aui-button-outline:hover {\n background-color: hsl(var(--aui-accent));\n color: hsl(var(--aui-accent-foreground));\n}\n.aui-button-ghost:hover {\n background-color: hsl(var(--aui-accent));\n color: hsl(var(--aui-accent-foreground));\n}\n.aui-button-medium {\n height: 2.25rem;\n padding-left: 1rem;\n padding-right: 1rem;\n padding-top: 0.5rem;\n padding-bottom: 0.5rem;\n}\n.aui-button-icon {\n width: 1.5rem;\n height: 1.5rem;\n padding: 0.25rem;\n}\n.aui-sr-only {\n position: absolute;\n width: 1px;\n height: 1px;\n padding: 0;\n margin: -1px;\n overflow: hidden;\n clip: rect(0, 0, 0, 0);\n white-space: nowrap;\n border-width: 0;\n}\n.aui-avatar-root {\n position: relative;\n display: flex;\n height: 2.5rem;\n width: 2.5rem;\n flex-shrink: 0;\n overflow: hidden;\n border-radius: 9999px;\n}\n.aui-avatar-image {\n aspect-ratio: 1 / 1;\n height: 100%;\n width: 100%;\n -o-object-fit: cover;\n object-fit: cover;\n}\n.aui-avatar-fallback {\n display: flex;\n height: 100%;\n width: 100%;\n align-items: center;\n justify-content: center;\n border-radius: 9999px;\n background-color: hsl(var(--aui-muted));\n}\n.aui-tooltip-content {\n z-index: 50;\n overflow: hidden;\n border-radius: calc(var(--aui-radius) - 2px);\n background-color: hsl(var(--aui-primary));\n padding-left: 0.75rem;\n padding-right: 0.75rem;\n padding-top: 0.375rem;\n padding-bottom: 0.375rem;\n font-size: 0.75rem;\n line-height: 1rem;\n color: hsl(var(--aui-primary-foreground));\n animation-name: aui-enter;\n animation-duration: 150ms;\n --aui-enter-opacity: initial;\n --aui-enter-scale: initial;\n --aui-enter-rotate: initial;\n --aui-enter-translate-x: initial;\n --aui-enter-translate-y: initial;\n --aui-enter-opacity: 0;\n --aui-enter-scale: .95 ;\n}\n.aui-tooltip-content[data-state=closed] {\n animation-name: aui-exit;\n animation-duration: 150ms;\n --aui-exit-opacity: initial;\n --aui-exit-scale: initial;\n --aui-exit-rotate: initial;\n --aui-exit-translate-x: initial;\n --aui-exit-translate-y: initial;\n --aui-exit-opacity: 0;\n --aui-exit-scale: .95 ;\n}\n.aui-tooltip-content[data-side=bottom] {\n --aui-enter-translate-y: -0.5rem ;\n}\n.aui-tooltip-content[data-side=left] {\n --aui-enter-translate-x: 0.5rem ;\n}\n.aui-tooltip-content[data-side=right] {\n --aui-enter-translate-x: -0.5rem ;\n}\n.aui-tooltip-content[data-side=top] {\n --aui-enter-translate-y: 0.5rem ;\n}\n.aui-dialog-overlay {\n position: fixed;\n inset: 0px;\n z-index: 50;\n background-color: rgb(0 0 0 / 0.8);\n}\n.aui-dialog-overlay[data-state=open] {\n animation-name: aui-enter;\n animation-duration: 150ms;\n --aui-enter-opacity: initial;\n --aui-enter-scale: initial;\n --aui-enter-rotate: initial;\n --aui-enter-translate-x: initial;\n --aui-enter-translate-y: initial ;\n}\n.aui-dialog-overlay[data-state=closed] {\n animation-name: aui-exit;\n animation-duration: 150ms;\n --aui-exit-opacity: initial;\n --aui-exit-scale: initial;\n --aui-exit-rotate: initial;\n --aui-exit-translate-x: initial;\n --aui-exit-translate-y: initial;\n --aui-exit-opacity: 0 ;\n}\n.aui-dialog-overlay[data-state=open] {\n --aui-enter-opacity: 0 ;\n}\n.aui-dialog-content {\n position: fixed;\n left: 50%;\n top: 50%;\n z-index: 50;\n}\n.aui-dialog-content[data-state=open] {\n animation-name: aui-enter;\n animation-duration: 150ms;\n --aui-enter-opacity: initial;\n --aui-enter-scale: initial;\n --aui-enter-rotate: initial;\n --aui-enter-translate-x: initial;\n --aui-enter-translate-y: initial ;\n}\n.aui-dialog-content[data-state=closed] {\n animation-name: aui-exit;\n animation-duration: 150ms;\n --aui-exit-opacity: initial;\n --aui-exit-scale: initial;\n --aui-exit-rotate: initial;\n --aui-exit-translate-x: initial;\n --aui-exit-translate-y: initial;\n --aui-exit-opacity: 0 ;\n}\n.aui-dialog-content[data-state=open] {\n --aui-enter-opacity: 0 ;\n}\n.aui-dialog-content[data-state=closed] {\n --aui-exit-scale: .95 ;\n}\n.aui-dialog-content[data-state=open] {\n --aui-enter-scale: .95 ;\n}\n.aui-dialog-content[data-state=closed] {\n --aui-exit-translate-x: -50%;\n --aui-exit-translate-y: -48% ;\n}\n.aui-dialog-content[data-state=open] {\n --aui-enter-translate-x: -50%;\n --aui-enter-translate-y: -48% ;\n}\n.aui-dialog-content {\n display: grid;\n --aui-translate-x: -50%;\n --aui-translate-y: -50%;\n transform: translate(var(--aui-translate-x), var(--aui-translate-y)) rotate(var(--aui-rotate)) skewX(var(--aui-skew-x)) skewY(var(--aui-skew-y)) scaleX(var(--aui-scale-x)) scaleY(var(--aui-scale-y));\n --aui-shadow: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);\n --aui-shadow-colored: 0 10px 15px -3px var(--aui-shadow-color), 0 4px 6px -4px var(--aui-shadow-color);\n box-shadow:\n var(--aui-ring-offset-shadow, 0 0 #0000),\n var(--aui-ring-shadow, 0 0 #0000),\n var(--aui-shadow);\n transition-duration: 200ms;\n animation-duration: 200ms;\n}\n\n/* src/styles/tailwindcss/thread.css */\n.aui-thread-root {\n box-sizing: border-box;\n display: flex;\n height: 100%;\n flex-direction: column;\n overflow: hidden;\n background-color: hsl(var(--aui-background));\n}\n.aui-thread-viewport {\n display: flex;\n height: 100%;\n flex-direction: column;\n align-items: center;\n overflow-y: scroll;\n scroll-behavior: smooth;\n background-color: inherit;\n padding-left: 1rem;\n padding-right: 1rem;\n padding-top: 2rem;\n}\n.aui-thread-viewport-footer {\n position: sticky;\n bottom: 0px;\n margin-top: 0.75rem;\n display: flex;\n width: 100%;\n max-width: var(--aui-thread-max-width);\n flex-direction: column;\n align-items: center;\n justify-content: flex-end;\n border-top-left-radius: var(--aui-radius);\n border-top-right-radius: var(--aui-radius);\n background-color: inherit;\n padding-bottom: 1rem;\n}\n.aui-thread-scroll-to-bottom {\n position: absolute;\n top: -2rem;\n border-radius: 9999px;\n}\n.aui-thread-scroll-to-bottom:disabled {\n visibility: hidden;\n}\n.aui-thread-followup-suggestions {\n display: flex;\n min-height: 2rem;\n align-items: center;\n justify-content: center;\n gap: 0.5rem;\n}\n.aui-thread-followup-suggestion {\n border-radius: 9999px;\n border-width: 1px;\n background-color: hsl(var(--aui-background));\n padding-left: 0.75rem;\n padding-right: 0.75rem;\n padding-top: 0.25rem;\n padding-bottom: 0.25rem;\n font-size: 0.875rem;\n line-height: 1.25rem;\n transition-property:\n color,\n background-color,\n border-color,\n text-decoration-color,\n fill,\n stroke;\n transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);\n transition-duration: 150ms;\n transition-timing-function: cubic-bezier(0.4, 0, 1, 1);\n animation-timing-function: cubic-bezier(0.4, 0, 1, 1);\n}\n.aui-thread-followup-suggestion:hover {\n background-color: hsl(var(--aui-muted) / 0.8);\n}\n.aui-thread-welcome-root {\n display: flex;\n width: 100%;\n max-width: var(--aui-thread-max-width);\n flex-grow: 1;\n flex-direction: column;\n}\n.aui-thread-welcome-center {\n display: flex;\n width: 100%;\n flex-grow: 1;\n flex-direction: column;\n align-items: center;\n justify-content: center;\n}\n.aui-thread-welcome-message {\n margin-top: 1rem;\n font-weight: 500;\n}\n.aui-thread-welcome-suggestions {\n margin-top: 0.75rem;\n display: flex;\n width: 100%;\n align-items: stretch;\n justify-content: center;\n gap: 1rem;\n}\n.aui-thread-welcome-suggestion {\n display: flex;\n max-width: 24rem;\n flex-grow: 1;\n flex-basis: 0px;\n flex-direction: column;\n align-items: center;\n justify-content: center;\n border-radius: var(--aui-radius);\n border-width: 1px;\n padding: 0.75rem;\n transition-property:\n color,\n background-color,\n border-color,\n text-decoration-color,\n fill,\n stroke;\n transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);\n transition-duration: 150ms;\n transition-timing-function: cubic-bezier(0.4, 0, 1, 1);\n animation-timing-function: cubic-bezier(0.4, 0, 1, 1);\n}\n.aui-thread-welcome-suggestion:hover {\n background-color: hsl(var(--aui-muted) / 0.8);\n}\n.aui-thread-welcome-suggestion-text {\n overflow: hidden;\n display: -webkit-box;\n -webkit-box-orient: vertical;\n -webkit-line-clamp: 2;\n text-overflow: ellipsis;\n font-size: 0.875rem;\n line-height: 1.25rem;\n font-weight: 600;\n}\n.aui-composer-root {\n display: flex;\n width: 100%;\n flex-wrap: wrap;\n align-items: flex-end;\n border-radius: var(--aui-radius);\n border-width: 1px;\n background-color: inherit;\n padding-left: 0.625rem;\n padding-right: 0.625rem;\n --aui-shadow: 0 1px 2px 0 rgb(0 0 0 / 0.05);\n --aui-shadow-colored: 0 1px 2px 0 var(--aui-shadow-color);\n box-shadow:\n var(--aui-ring-offset-shadow, 0 0 #0000),\n var(--aui-ring-shadow, 0 0 #0000),\n var(--aui-shadow);\n transition-property:\n color,\n background-color,\n border-color,\n text-decoration-color,\n fill,\n stroke;\n transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);\n transition-duration: 150ms;\n transition-timing-function: cubic-bezier(0.4, 0, 1, 1);\n animation-timing-function: cubic-bezier(0.4, 0, 1, 1);\n}\n.aui-composer-root:focus-within {\n border-color: hsl(var(--aui-ring) / 0.2);\n}\n.aui-composer-input {\n max-height: 10rem;\n flex-grow: 1;\n resize: none;\n border-style: none;\n background-color: transparent;\n padding-left: 0.5rem;\n padding-right: 0.5rem;\n padding-top: 1rem;\n padding-bottom: 1rem;\n font-size: 0.875rem;\n line-height: 1.25rem;\n outline: 2px solid transparent;\n outline-offset: 2px;\n}\n.aui-composer-input::-moz-placeholder {\n color: hsl(var(--aui-muted-foreground));\n}\n.aui-composer-input::placeholder {\n color: hsl(var(--aui-muted-foreground));\n}\n.aui-composer-input:focus {\n --aui-ring-offset-shadow: var(--aui-ring-inset) 0 0 0 var(--aui-ring-offset-width) var(--aui-ring-offset-color);\n --aui-ring-shadow: var(--aui-ring-inset) 0 0 0 calc(0px + var(--aui-ring-offset-width)) var(--aui-ring-color);\n box-shadow:\n var(--aui-ring-offset-shadow),\n var(--aui-ring-shadow),\n var(--aui-shadow, 0 0 #0000);\n}\n.aui-composer-input:disabled {\n cursor: not-allowed;\n}\n.aui-composer-send {\n margin-top: 0.625rem;\n margin-bottom: 0.625rem;\n width: 2rem;\n height: 2rem;\n padding: 0.5rem;\n transition-property: opacity;\n transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);\n transition-duration: 150ms;\n transition-timing-function: cubic-bezier(0.4, 0, 1, 1);\n animation-timing-function: cubic-bezier(0.4, 0, 1, 1);\n}\n.aui-composer-cancel {\n margin-top: 0.625rem;\n margin-bottom: 0.625rem;\n width: 2rem;\n height: 2rem;\n padding: 0.5rem;\n transition-property: opacity;\n transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);\n transition-duration: 150ms;\n transition-timing-function: cubic-bezier(0.4, 0, 1, 1);\n animation-timing-function: cubic-bezier(0.4, 0, 1, 1);\n}\n.aui-composer-attach {\n margin-top: 0.625rem;\n margin-bottom: 0.625rem;\n width: 2rem;\n height: 2rem;\n padding: 0.5rem;\n transition-property: opacity;\n transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);\n transition-duration: 150ms;\n transition-timing-function: cubic-bezier(0.4, 0, 1, 1);\n animation-timing-function: cubic-bezier(0.4, 0, 1, 1);\n}\n.aui-composer-attachments {\n display: flex;\n width: 100%;\n flex-direction: row;\n gap: 0.75rem;\n padding-left: 2.5rem;\n padding-right: 2.5rem;\n}\n.aui-attachment-root {\n position: relative;\n margin-top: 0.75rem;\n}\n.aui-attachment-content {\n display: flex;\n height: 3rem;\n width: 10rem;\n align-items: center;\n justify-content: center;\n gap: 0.5rem;\n border-radius: var(--aui-radius);\n border-width: 1px;\n padding: 0.25rem;\n}\n.aui-attachment-preview-trigger {\n cursor: pointer;\n transition-property:\n color,\n background-color,\n border-color,\n text-decoration-color,\n fill,\n stroke;\n transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);\n transition-duration: 150ms;\n}\n.aui-attachment-preview-trigger:hover {\n background-color: hsl(var(--aui-accent) / 0.5);\n}\n.aui-attachment-thumb {\n display: flex;\n width: 2.5rem;\n height: 2.5rem;\n align-items: center;\n justify-content: center;\n border-radius: 0.25rem;\n border-width: 1px;\n background-color: hsl(var(--aui-muted));\n font-size: 0.875rem;\n line-height: 1.25rem;\n}\n.aui-attachment-text {\n flex-grow: 1;\n flex-basis: 0px;\n}\n.aui-attachment-name {\n overflow: hidden;\n display: -webkit-box;\n -webkit-box-orient: vertical;\n -webkit-line-clamp: 1;\n text-overflow: ellipsis;\n word-break: break-all;\n font-size: 0.75rem;\n line-height: 1rem;\n font-weight: 700;\n color: hsl(var(--aui-muted-foreground));\n}\n.aui-attachment-type {\n font-size: 0.75rem;\n line-height: 1rem;\n color: hsl(var(--aui-muted-foreground));\n}\n.aui-attachment-remove {\n position: absolute;\n right: -0.75rem;\n top: -0.75rem;\n width: 1.5rem;\n height: 1.5rem;\n color: hsl(var(--aui-muted-foreground));\n}\n.aui-attachment-remove > svg {\n width: 1rem;\n height: 1rem;\n border-radius: 9999px;\n background-color: hsl(var(--aui-background));\n}\n.aui-user-message-root {\n display: grid;\n grid-auto-rows: auto;\n grid-template-columns: minmax(72px, 1fr) auto;\n row-gap: 0.5rem;\n}\n.aui-user-message-root:where(> *) {\n grid-column-start: 2;\n}\n.aui-user-message-root {\n width: 100%;\n max-width: var(--aui-thread-max-width);\n padding-top: 1rem;\n padding-bottom: 1rem;\n}\n:where(.aui-user-message-root) > .aui-branch-picker-root {\n grid-column: 1 / -1;\n grid-column-start: 1;\n grid-row-start: 3;\n margin-right: -0.25rem;\n justify-content: flex-end;\n}\n.aui-user-branch-picker {\n grid-column: 1 / -1;\n grid-column-start: 1;\n grid-row-start: 3;\n margin-right: -0.25rem;\n justify-content: flex-end;\n}\n.aui-user-message-content {\n max-width: calc(var(--aui-thread-max-width) * 0.8);\n overflow-wrap: break-word;\n border-radius: 1.5rem;\n background-color: hsl(var(--aui-muted));\n padding-left: 1.25rem;\n padding-right: 1.25rem;\n padding-top: 0.625rem;\n padding-bottom: 0.625rem;\n color: hsl(var(--aui-foreground));\n grid-column-start: 2;\n grid-row-start: 2;\n}\n.aui-user-message-attachments {\n display: flex;\n width: 100%;\n flex-direction: row;\n gap: 0.75rem;\n grid-column: 1 / -1;\n grid-column-start: 1;\n grid-row-start: 1;\n justify-content: flex-end;\n}\n.aui-user-action-bar-root {\n display: flex;\n flex-direction: column;\n align-items: flex-end;\n grid-column-start: 1;\n grid-row-start: 2;\n margin-right: 0.75rem;\n margin-top: 0.625rem;\n}\n.aui-edit-composer-root {\n margin-top: 1rem;\n margin-bottom: 1rem;\n display: flex;\n width: 100%;\n max-width: var(--aui-thread-max-width);\n flex-direction: column;\n gap: 0.5rem;\n border-radius: 0.75rem;\n background-color: hsl(var(--aui-muted));\n}\n.aui-edit-composer-input {\n display: flex;\n height: 2rem;\n width: 100%;\n resize: none;\n background-color: transparent;\n padding: 1rem;\n padding-bottom: 0px;\n color: hsl(var(--aui-foreground));\n outline: 2px solid transparent;\n outline-offset: 2px;\n}\n.aui-edit-composer-footer {\n margin-left: 0.75rem;\n margin-right: 0.75rem;\n margin-bottom: 0.75rem;\n display: flex;\n align-items: center;\n justify-content: center;\n gap: 0.5rem;\n align-self: flex-end;\n}\n.aui-assistant-message-root {\n display: grid;\n grid-template-columns: auto auto 1fr;\n grid-template-rows: auto 1fr;\n position: relative;\n width: 100%;\n max-width: var(--aui-thread-max-width);\n padding-top: 1rem;\n padding-bottom: 1rem;\n}\n:where(.aui-assistant-message-root) > .aui-avatar-root {\n grid-column-start: 1;\n grid-row: 1 / -1;\n grid-row-start: 1;\n margin-right: 1rem;\n}\n.aui-assistant-avatar {\n grid-column-start: 1;\n grid-row: 1 / -1;\n grid-row-start: 1;\n margin-right: 1rem;\n}\n:where(.aui-assistant-message-root) > .aui-branch-picker-root {\n grid-column-start: 2;\n grid-row-start: 2;\n margin-left: -0.5rem;\n margin-right: 0.5rem;\n}\n.aui-assistant-branch-picker {\n grid-column-start: 2;\n grid-row-start: 2;\n margin-left: -0.5rem;\n margin-right: 0.5rem;\n}\n.aui-assistant-message-content {\n max-width: calc(var(--aui-thread-max-width) * 0.8);\n overflow-wrap: break-word;\n line-height: 1.75rem;\n color: hsl(var(--aui-foreground));\n grid-column: span 2 / span 2;\n grid-column-start: 2;\n grid-row-start: 1;\n margin-top: 0.375rem;\n margin-bottom: 0.375rem;\n}\n.aui-assistant-action-bar-root {\n display: flex;\n gap: 0.25rem;\n color: hsl(var(--aui-muted-foreground));\n grid-column-start: 3;\n grid-row-start: 2;\n margin-left: -0.25rem;\n}\n.aui-assistant-action-bar-root[data-floating] {\n position: absolute;\n border-radius: calc(var(--aui-radius) - 2px);\n border-width: 1px;\n background-color: hsl(var(--aui-background));\n padding: 0.25rem;\n --aui-shadow: 0 1px 2px 0 rgb(0 0 0 / 0.05);\n --aui-shadow-colored: 0 1px 2px 0 var(--aui-shadow-color);\n box-shadow:\n var(--aui-ring-offset-shadow, 0 0 #0000),\n var(--aui-ring-shadow, 0 0 #0000),\n var(--aui-shadow);\n}\n.aui-assistant-action-bar-feedback-positive[data-submitted] {\n --aui-text-opacity: 1;\n color: rgb(22 163 74 / var(--aui-text-opacity, 1));\n}\n.aui-assistant-action-bar-feedback-positive:hover[data-submitted] {\n --aui-text-opacity: 1;\n color: rgb(21 128 61 / var(--aui-text-opacity, 1));\n}\n@media (prefers-color-scheme: dark) {\n .aui-assistant-action-bar-feedback-positive[data-submitted] {\n --aui-text-opacity: 1;\n color: rgb(34 197 94 / var(--aui-text-opacity, 1));\n }\n .aui-assistant-action-bar-feedback-positive:hover[data-submitted] {\n --aui-text-opacity: 1;\n color: rgb(74 222 128 / var(--aui-text-opacity, 1));\n }\n}\n.aui-assistant-action-bar-feedback-negative[data-submitted] {\n --aui-text-opacity: 1;\n color: rgb(220 38 38 / var(--aui-text-opacity, 1));\n}\n.aui-assistant-action-bar-feedback-negative:hover[data-submitted] {\n --aui-text-opacity: 1;\n color: rgb(185 28 28 / var(--aui-text-opacity, 1));\n}\n@media (prefers-color-scheme: dark) {\n .aui-assistant-action-bar-feedback-negative[data-submitted] {\n --aui-text-opacity: 1;\n color: rgb(239 68 68 / var(--aui-text-opacity, 1));\n }\n .aui-assistant-action-bar-feedback-negative:hover[data-submitted] {\n --aui-text-opacity: 1;\n color: rgb(248 113 113 / var(--aui-text-opacity, 1));\n }\n}\n.aui-branch-picker-root {\n display: inline-flex;\n align-items: center;\n font-size: 0.75rem;\n line-height: 1rem;\n color: hsl(var(--aui-muted-foreground));\n}\n.aui-branch-picker-state {\n font-weight: 500;\n}\n.aui-text {\n white-space: pre-line;\n}\n@keyframes aui-pulse {\n 50% {\n opacity: .5;\n }\n}\n.aui-text-running::after {\n animation: aui-pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;\n font-family:\n ui-sans-serif,\n system-ui,\n sans-serif,\n \"Apple Color Emoji\",\n \"Segoe UI Emoji\",\n \"Segoe UI Symbol\",\n \"Noto Color Emoji\";\n --aui-content: \"\\25cf\";\n content: var(--aui-content);\n}\n.aui-text-running:where([dir=ltr], [dir=ltr] *)::after {\n margin-left: 0.25rem;\n}\n.aui-text-running:where([dir=rtl], [dir=rtl] *)::after {\n margin-right: 0.25rem;\n}\n.aui-thread-list-root {\n display: flex;\n flex-direction: column;\n align-items: stretch;\n gap: 0.375rem;\n}\n.aui-thread-list-item {\n display: flex;\n align-items: center;\n gap: 0.5rem;\n border-radius: var(--aui-radius);\n transition-property: all;\n transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);\n transition-duration: 150ms;\n}\n.aui-thread-list-item:hover {\n background-color: hsl(var(--aui-muted));\n}\n.aui-thread-list-item:focus-visible {\n background-color: hsl(var(--aui-muted));\n outline: 2px solid transparent;\n outline-offset: 2px;\n --aui-ring-offset-shadow: var(--aui-ring-inset) 0 0 0 var(--aui-ring-offset-width) var(--aui-ring-offset-color);\n --aui-ring-shadow: var(--aui-ring-inset) 0 0 0 calc(2px + var(--aui-ring-offset-width)) var(--aui-ring-color);\n box-shadow:\n var(--aui-ring-offset-shadow),\n var(--aui-ring-shadow),\n var(--aui-shadow, 0 0 #0000);\n --aui-ring-color: hsl(var(--aui-ring)) ;\n}\n.aui-thread-list-item[data-active] {\n background-color: hsl(var(--aui-muted));\n}\n.aui-thread-list-new {\n display: flex;\n align-items: center;\n justify-content: flex-start;\n gap: 0.25rem;\n border-radius: var(--aui-radius);\n padding-left: 0.625rem;\n padding-right: 0.625rem;\n padding-top: 0.5rem;\n padding-bottom: 0.5rem;\n text-align: start;\n}\n.aui-thread-list-new:hover {\n background-color: hsl(var(--aui-muted));\n}\n.aui-thread-list-new[data-active] {\n background-color: hsl(var(--aui-muted));\n}\n.aui-thread-list-new > .lucide-plus {\n width: 1.25rem;\n height: 1.25rem;\n}\n.aui-thread-list-item-trigger {\n flex-grow: 1;\n padding-left: 0.75rem;\n padding-right: 0.75rem;\n padding-top: 0.5rem;\n padding-bottom: 0.5rem;\n text-align: start;\n}\n.aui-thread-list-item-title {\n font-size: 0.875rem;\n line-height: 1.25rem;\n}\n.aui-thread-list-item-archive {\n margin-left: auto;\n margin-right: 0.75rem;\n width: 1rem;\n height: 1rem;\n padding: 0px;\n color: hsl(var(--aui-foreground));\n}\n.aui-thread-list-item-archive:hover {\n color: hsl(var(--aui-primary));\n}\n\n/* src/styles/themes/default.css */\n:root {\n --aui-background: 0 0% 100%;\n --aui-foreground: 240 10% 3.9%;\n --aui-card: 0 0% 100%;\n --aui-card-foreground: 240 10% 3.9%;\n --aui-popover: 0 0% 100%;\n --aui-popover-foreground: 240 10% 3.9%;\n --aui-primary: 240 5.9% 10%;\n --aui-primary-foreground: 0 0% 98%;\n --aui-secondary: 240 4.8% 95.9%;\n --aui-secondary-foreground: 240 5.9% 10%;\n --aui-muted: 240 4.8% 95.9%;\n --aui-muted-foreground: 240 3.8% 46.1%;\n --aui-accent: 240 4.8% 95.9%;\n --aui-accent-foreground: 240 5.9% 10%;\n --aui-destructive: 0 84.2% 60.2%;\n --aui-destructive-foreground: 0 0% 98%;\n --aui-border: 240 5.9% 90%;\n --aui-input: 240 5.9% 90%;\n --aui-ring: 240 10% 3.9%;\n --aui-radius: 0.5rem;\n --aui-thread-max-width: 42rem;\n}\n.dark {\n --aui-background: 0 0% 7%;\n --aui-foreground: 0 0% 98%;\n --aui-card: 240 10% 3.9%;\n --aui-card-foreground: 0 0% 98%;\n --aui-popover: 240 10% 3.9%;\n --aui-popover-foreground: 0 0% 98%;\n --aui-primary: 0 0% 98%;\n --aui-primary-foreground: 240 5.9% 10%;\n --aui-secondary: 240 3.7% 15.9%;\n --aui-secondary-foreground: 0 0% 98%;\n --aui-muted: 240 3.7% 15.9%;\n --aui-muted-foreground: 240 5% 64.9%;\n --aui-accent: 240 3.7% 15.9%;\n --aui-accent-foreground: 0 0% 98%;\n --aui-destructive: 0 62.8% 30.6%;\n --aui-destructive-foreground: 0 0% 98%;\n --aui-border: 240 3.7% 15.9%;\n --aui-input: 240 3.7% 15.9%;\n --aui-ring: 240 4.9% 83.9%;\n}\n\n/* src/styles/index.css */";
4
+ styleInject(css_248z);
5
+ //# sourceMappingURL=assistant-ui.css.esm.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"assistant-ui.css.esm.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;"}
@@ -0,0 +1,79 @@
1
+ import { useSyncExternalStore } from 'react';
2
+
3
+ const listeners = /* @__PURE__ */ new Set();
4
+ let version = 0;
5
+ function key(assistantId) {
6
+ return `ai-chat-unread:${assistantId}`;
7
+ }
8
+ function read(assistantId) {
9
+ try {
10
+ const raw = localStorage.getItem(key(assistantId));
11
+ return raw ? JSON.parse(raw) : [];
12
+ } catch {
13
+ return [];
14
+ }
15
+ }
16
+ function write(assistantId, ids) {
17
+ try {
18
+ if (ids.length === 0) {
19
+ localStorage.removeItem(key(assistantId));
20
+ } else {
21
+ localStorage.setItem(key(assistantId), JSON.stringify(ids));
22
+ }
23
+ } catch {
24
+ }
25
+ }
26
+ function emit() {
27
+ version += 1;
28
+ listeners.forEach((l) => l());
29
+ }
30
+ function isConversationUnread(assistantId, conversationId) {
31
+ return read(assistantId).includes(conversationId);
32
+ }
33
+ function hasUnread(assistantId) {
34
+ return read(assistantId).length > 0;
35
+ }
36
+ function markUnread(assistantId, conversationId) {
37
+ const ids = read(assistantId);
38
+ if (!ids.includes(conversationId)) {
39
+ write(assistantId, [...ids, conversationId]);
40
+ emit();
41
+ }
42
+ }
43
+ function clearUnread(assistantId, conversationId) {
44
+ const ids = read(assistantId);
45
+ if (ids.includes(conversationId)) {
46
+ write(
47
+ assistantId,
48
+ ids.filter((id) => id !== conversationId)
49
+ );
50
+ emit();
51
+ }
52
+ }
53
+ function onStorage(e) {
54
+ if (e.key && e.key.startsWith("ai-chat-unread:")) {
55
+ emit();
56
+ }
57
+ }
58
+ function subscribe(listener) {
59
+ if (listeners.size === 0 && typeof window !== "undefined") {
60
+ window.addEventListener("storage", onStorage);
61
+ }
62
+ listeners.add(listener);
63
+ return () => {
64
+ listeners.delete(listener);
65
+ if (listeners.size === 0 && typeof window !== "undefined") {
66
+ window.removeEventListener("storage", onStorage);
67
+ }
68
+ };
69
+ }
70
+ function useUnreadVersion() {
71
+ return useSyncExternalStore(
72
+ subscribe,
73
+ () => version,
74
+ () => version
75
+ );
76
+ }
77
+
78
+ export { clearUnread, hasUnread, isConversationUnread, markUnread, useUnreadVersion };
79
+ //# sourceMappingURL=unreadStore.esm.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"unreadStore.esm.js","sources":["../../src/collapsible/unreadStore.ts"],"sourcesContent":["import { useSyncExternalStore } from 'react';\n\n/**\n * Tracks which conversations have an unread assistant reply — i.e. a reply that\n * landed (often in the background, via the live-thread manager) while the user\n * was looking at a different conversation or assistant. Persisted to\n * localStorage and namespaced per assistant, so the unread state — and the red\n * dots driven by it — survive assistant switches and reloads.\n *\n * State is exposed through a version counter + plain getters rather than a\n * React-shaped snapshot: `useUnreadVersion()` subscribes a component to changes,\n * and {@link getUnreadIds} / {@link hasUnread} read the current values during\n * render. (Returning a fresh array as the snapshot would loop useSyncExternalStore.)\n */\n\ntype Listener = () => void;\n\nconst listeners = new Set<Listener>();\nlet version = 0;\n\nfunction key(assistantId: string): string {\n return `ai-chat-unread:${assistantId}`;\n}\n\nfunction read(assistantId: string): string[] {\n try {\n const raw = localStorage.getItem(key(assistantId));\n return raw ? (JSON.parse(raw) as string[]) : [];\n } catch {\n return [];\n }\n}\n\nfunction write(assistantId: string, ids: string[]) {\n try {\n if (ids.length === 0) {\n localStorage.removeItem(key(assistantId));\n } else {\n localStorage.setItem(key(assistantId), JSON.stringify(ids));\n }\n } catch {\n // storage unavailable\n }\n}\n\nfunction emit() {\n version += 1;\n listeners.forEach(l => l());\n}\n\n/** Conversation ids with an unread reply for the given assistant. */\nexport function getUnreadIds(assistantId: string): string[] {\n return read(assistantId);\n}\n\n/** Whether a specific conversation has an unread reply. */\nexport function isConversationUnread(\n assistantId: string,\n conversationId: string,\n): boolean {\n return read(assistantId).includes(conversationId);\n}\n\n/** Whether any of an assistant's conversations have an unread reply. */\nexport function hasUnread(assistantId: string): boolean {\n return read(assistantId).length > 0;\n}\n\n/** Flag a conversation as having an unread reply. */\nexport function markUnread(assistantId: string, conversationId: string) {\n const ids = read(assistantId);\n if (!ids.includes(conversationId)) {\n write(assistantId, [...ids, conversationId]);\n emit();\n }\n}\n\n/** Clear the unread flag for a conversation (e.g. when the user opens it). */\nexport function clearUnread(assistantId: string, conversationId: string) {\n const ids = read(assistantId);\n if (ids.includes(conversationId)) {\n write(\n assistantId,\n ids.filter(id => id !== conversationId),\n );\n emit();\n }\n}\n\n// A single, stable handler so add/removeEventListener reference-match. Reflects\n// unread changes made in other tabs.\nfunction onStorage(e: StorageEvent) {\n if (e.key && e.key.startsWith('ai-chat-unread:')) {\n emit();\n }\n}\n\nfunction subscribe(listener: Listener): () => void {\n if (listeners.size === 0 && typeof window !== 'undefined') {\n window.addEventListener('storage', onStorage);\n }\n listeners.add(listener);\n return () => {\n listeners.delete(listener);\n if (listeners.size === 0 && typeof window !== 'undefined') {\n window.removeEventListener('storage', onStorage);\n }\n };\n}\n\n/**\n * Subscribe a component to unread changes. Returns an opaque version number;\n * components re-render when it changes and then read values via\n * {@link getUnreadIds} / {@link isConversationUnread} / {@link hasUnread}.\n */\nexport function useUnreadVersion(): number {\n return useSyncExternalStore(\n subscribe,\n () => version,\n () => version,\n );\n}\n"],"names":[],"mappings":";;AAiBA,MAAM,SAAA,uBAAgB,GAAA,EAAc;AACpC,IAAI,OAAA,GAAU,CAAA;AAEd,SAAS,IAAI,WAAA,EAA6B;AACxC,EAAA,OAAO,kBAAkB,WAAW,CAAA,CAAA;AACtC;AAEA,SAAS,KAAK,WAAA,EAA+B;AAC3C,EAAA,IAAI;AACF,IAAA,MAAM,GAAA,GAAM,YAAA,CAAa,OAAA,CAAQ,GAAA,CAAI,WAAW,CAAC,CAAA;AACjD,IAAA,OAAO,GAAA,GAAO,IAAA,CAAK,KAAA,CAAM,GAAG,IAAiB,EAAC;AAAA,EAChD,CAAA,CAAA,MAAQ;AACN,IAAA,OAAO,EAAC;AAAA,EACV;AACF;AAEA,SAAS,KAAA,CAA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