@plaisolutions/react 0.18.0 → 0.19.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.
- package/dist/components/index.d.ts.map +1 -1
- package/dist/components/index.js +567 -550
- package/dist/components/index.js.map +1 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +567 -550
- package/dist/index.js.map +1 -1
- package/dist/styles.css +1 -1
- package/package.json +1 -1
package/dist/components/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Bot, Brain, CalendarDays, Check, CheckCircle2, ChevronDown, CircleAlert, CircleX, Clock, Copy, Database, Download,
|
|
1
|
+
import { ArrowUpRight, Bot, Brain, CalendarDays, Check, CheckCircle2, ChevronDown, ChevronUp, CircleAlert, CircleX, Clock, Copy, Database, Download, File, FileText, Globe, LoaderCircle, Mail, MessageSquare, Paperclip as Paperclip$1, Plug, RotateCcw, ThumbsDown, ThumbsUp, Video, Workflow, X as X$1, XCircle } from "lucide-react";
|
|
2
2
|
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
3
3
|
import { createContext, forwardRef, useCallback, useContext, useEffect, useId, useLayoutEffect, useMemo, useRef, useState } from "react";
|
|
4
4
|
import { HttpStatusError, isHiddenMessage, toolConfirmationAt } from "@plaisolutions/client";
|
|
@@ -179,7 +179,7 @@ function ChatError({ error, locale, title, children, className,...props }) {
|
|
|
179
179
|
return /* @__PURE__ */ jsxs("div", {
|
|
180
180
|
role: "alert",
|
|
181
181
|
...props,
|
|
182
|
-
className: joinClasses("plai-chat-error flex gap-3 rounded-lg border border-
|
|
182
|
+
className: joinClasses("plai-chat-error flex gap-3 rounded-lg border border-danger-border bg-danger-subtle p-4 text-sm text-danger-strong ", className),
|
|
183
183
|
children: [/* @__PURE__ */ jsx(CircleAlert, {
|
|
184
184
|
"aria-hidden": "true",
|
|
185
185
|
className: "mt-0.5 size-4 shrink-0"
|
|
@@ -1347,7 +1347,7 @@ function DatasourceToolResultCardContent({ title, description, type, icon, resou
|
|
|
1347
1347
|
children: description
|
|
1348
1348
|
}),
|
|
1349
1349
|
resourceCount === void 0 ? null : /* @__PURE__ */ jsxs("p", {
|
|
1350
|
-
className: "mt-2 text-xs leading-4 text-
|
|
1350
|
+
className: "mt-2 text-xs leading-4 text-secondary",
|
|
1351
1351
|
children: [
|
|
1352
1352
|
resourceCount,
|
|
1353
1353
|
" ",
|
|
@@ -1359,7 +1359,7 @@ function DatasourceToolResultCardContent({ title, description, type, icon, resou
|
|
|
1359
1359
|
function DatasourceToolResultCard(props) {
|
|
1360
1360
|
return /* @__PURE__ */ jsx("article", {
|
|
1361
1361
|
"aria-label": `${props.type}: ${props.title}`,
|
|
1362
|
-
className: "w-46.5 rounded-lg bg-
|
|
1362
|
+
className: "plai-datasource-tool-result-card w-46.5 rounded-lg bg-surface-subtle p-4 text-foreground",
|
|
1363
1363
|
children: /* @__PURE__ */ jsx(DatasourceToolResultCardContent, { ...props })
|
|
1364
1364
|
});
|
|
1365
1365
|
}
|
|
@@ -1392,7 +1392,7 @@ function ResourceCardContent({ icon, type, title, description, variant = "card"
|
|
|
1392
1392
|
children: bodyTitle
|
|
1393
1393
|
}) : null,
|
|
1394
1394
|
bodyDescription ? /* @__PURE__ */ jsx("p", {
|
|
1395
|
-
className: "mt-2 line-clamp-2 text-xs leading-4 text-
|
|
1395
|
+
className: "mt-2 line-clamp-2 text-xs leading-4 text-secondary",
|
|
1396
1396
|
children: bodyDescription
|
|
1397
1397
|
}) : null
|
|
1398
1398
|
] });
|
|
@@ -1402,8 +1402,8 @@ function ResourceCard(props) {
|
|
|
1402
1402
|
const copy = getUiCopy(locale);
|
|
1403
1403
|
const [downloadState, setDownloadState] = useState("idle");
|
|
1404
1404
|
const abortControllerRef = useRef(null);
|
|
1405
|
-
const className = joinClasses("block rounded-lg bg-
|
|
1406
|
-
const interactiveClassName = `${className} transition-colors hover:bg-
|
|
1405
|
+
const className = joinClasses("plai-resource-card block rounded-lg bg-surface-subtle p-4 text-left text-foreground", variant === "card" ? "min-h-[183px] w-[186px] max-w-full" : "w-full", customClassName);
|
|
1406
|
+
const interactiveClassName = `${className} transition-colors hover:bg-surface-hover focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-ring`;
|
|
1407
1407
|
useEffect(() => () => {
|
|
1408
1408
|
abortControllerRef.current?.abort();
|
|
1409
1409
|
}, []);
|
|
@@ -1449,12 +1449,12 @@ function ResourceCard(props) {
|
|
|
1449
1449
|
variant
|
|
1450
1450
|
}),
|
|
1451
1451
|
downloadState === "loading" ? /* @__PURE__ */ jsx("span", {
|
|
1452
|
-
className: "mt-2 block text-xs text-
|
|
1452
|
+
className: "mt-2 block text-xs text-secondary",
|
|
1453
1453
|
"aria-live": "polite",
|
|
1454
1454
|
children: copy.openingResource
|
|
1455
1455
|
}) : null,
|
|
1456
1456
|
downloadState === "error" ? /* @__PURE__ */ jsx("span", {
|
|
1457
|
-
className: "mt-2 block text-xs text-
|
|
1457
|
+
className: "mt-2 block text-xs text-danger-strong",
|
|
1458
1458
|
role: "alert",
|
|
1459
1459
|
children: copy.resourceOpenFailed
|
|
1460
1460
|
}) : null
|
|
@@ -1748,7 +1748,7 @@ const SheetContent = forwardRef(function SheetContent$1({ children, className, s
|
|
|
1748
1748
|
"aria-label": ariaLabel,
|
|
1749
1749
|
"aria-labelledby": ariaLabelledBy ?? labelledBy,
|
|
1750
1750
|
"aria-describedby": ariaDescribedBy ?? describedBy,
|
|
1751
|
-
className: "plai-sheet-overlay fixed inset-0 m-0 h-full max-h-none w-full max-w-none border-0 bg-
|
|
1751
|
+
className: "plai-sheet-overlay fixed inset-0 m-0 h-full max-h-none w-full max-w-none border-0 bg-overlay p-0",
|
|
1752
1752
|
onCancel: (event) => {
|
|
1753
1753
|
onCancel?.(event);
|
|
1754
1754
|
if (!event.defaultPrevented) {
|
|
@@ -1764,13 +1764,13 @@ const SheetContent = forwardRef(function SheetContent$1({ children, className, s
|
|
|
1764
1764
|
"data-slot": "sheet-content",
|
|
1765
1765
|
"data-state": state,
|
|
1766
1766
|
"data-side": side,
|
|
1767
|
-
className: joinClasses("plai-sheet-content fixed overflow-y-auto border-
|
|
1767
|
+
className: joinClasses("plai-sheet-content fixed overflow-y-auto border-border bg-surface px-6 py-5 text-foreground shadow-2xl outline-none", getSideClasses(side), className),
|
|
1768
1768
|
onAnimationEnd: (event) => {
|
|
1769
1769
|
if (event.currentTarget === event.target && !open) setPresent(false);
|
|
1770
1770
|
},
|
|
1771
1771
|
children: [showCloseButton ? /* @__PURE__ */ jsx(SheetClose, {
|
|
1772
1772
|
"aria-label": closeLabel ?? getUiCopy(locale).close,
|
|
1773
|
-
className: "absolute right-4 top-2 rounded-sm p-1 text-
|
|
1773
|
+
className: "absolute right-4 top-2 rounded-sm p-1 text-muted transition-colors hover:bg-surface-subtle hover:text-foreground focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-ring",
|
|
1774
1774
|
children: /* @__PURE__ */ jsx(X, { className: "h-5 w-5" })
|
|
1775
1775
|
}) : null, children]
|
|
1776
1776
|
})
|
|
@@ -1824,7 +1824,7 @@ const SheetDescription = forwardRef(function SheetDescription$1({ className, id,
|
|
|
1824
1824
|
ref: forwardedRef,
|
|
1825
1825
|
id: resolvedId,
|
|
1826
1826
|
"data-slot": "sheet-description",
|
|
1827
|
-
className: joinClasses("text-sm text-
|
|
1827
|
+
className: joinClasses("text-sm text-secondary", className)
|
|
1828
1828
|
});
|
|
1829
1829
|
});
|
|
1830
1830
|
|
|
@@ -1834,7 +1834,7 @@ function DatasourceFolderCard({ icon, title, description, type, url, resources,
|
|
|
1834
1834
|
const copy = getUiCopy(locale);
|
|
1835
1835
|
return /* @__PURE__ */ jsxs(Sheet, { children: [/* @__PURE__ */ jsx(SheetTrigger, {
|
|
1836
1836
|
"aria-label": `${type}: ${title}`,
|
|
1837
|
-
className: `${variant === "card" ? "min-h-[183px] w-[186px] max-w-full" : "w-full"} rounded-lg bg-
|
|
1837
|
+
className: `${variant === "card" ? "min-h-[183px] w-[186px] max-w-full" : "w-full"} plai-datasource-folder-card rounded-lg bg-surface-subtle p-4 text-left font-normal text-foreground transition-colors hover:bg-surface-hover focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-ring`,
|
|
1838
1838
|
children: /* @__PURE__ */ jsx(DatasourceToolResultCardContent, {
|
|
1839
1839
|
icon,
|
|
1840
1840
|
title,
|
|
@@ -1867,7 +1867,7 @@ function DatasourceFolderCard({ icon, title, description, type, url, resources,
|
|
|
1867
1867
|
href: url,
|
|
1868
1868
|
target: "_blank",
|
|
1869
1869
|
rel: "noreferrer noopener",
|
|
1870
|
-
className: "text-xs font-medium text-
|
|
1870
|
+
className: "text-xs font-medium text-strong underline underline-offset-2",
|
|
1871
1871
|
children: copy.view
|
|
1872
1872
|
}) : null
|
|
1873
1873
|
]
|
|
@@ -2214,18 +2214,18 @@ function WebSearchResultItem({ result }) {
|
|
|
2214
2214
|
const imageUrl = toStringOrNull$2(result.image_url);
|
|
2215
2215
|
const faviconUrl = getFaviconUrl(result.url);
|
|
2216
2216
|
return /* @__PURE__ */ jsx("article", {
|
|
2217
|
-
className: "rounded-lg border border-
|
|
2217
|
+
className: "rounded-lg border border-border bg-surface p-4",
|
|
2218
2218
|
children: /* @__PURE__ */ jsxs("div", {
|
|
2219
2219
|
className: "flex items-start gap-3",
|
|
2220
2220
|
children: [/* @__PURE__ */ jsxs("span", {
|
|
2221
2221
|
"aria-hidden": "true",
|
|
2222
|
-
className: "relative flex h-8 w-8 shrink-0 items-center justify-center overflow-hidden rounded-full border border-
|
|
2222
|
+
className: "relative flex h-8 w-8 shrink-0 items-center justify-center overflow-hidden rounded-full border border-border-strong bg-surface text-secondary",
|
|
2223
2223
|
children: [/* @__PURE__ */ jsx(Globe, { className: "h-4 w-4" }), faviconUrl ? /* @__PURE__ */ jsx("img", {
|
|
2224
2224
|
src: faviconUrl,
|
|
2225
2225
|
alt: "",
|
|
2226
2226
|
width: "16",
|
|
2227
2227
|
height: "16",
|
|
2228
|
-
className: "absolute h-4 w-4 bg-
|
|
2228
|
+
className: "absolute h-4 w-4 bg-surface",
|
|
2229
2229
|
onError: (event) => {
|
|
2230
2230
|
event.currentTarget.style.display = "none";
|
|
2231
2231
|
}
|
|
@@ -2237,28 +2237,28 @@ function WebSearchResultItem({ result }) {
|
|
|
2237
2237
|
href: result.url,
|
|
2238
2238
|
target: "_blank",
|
|
2239
2239
|
rel: "noreferrer noopener",
|
|
2240
|
-
className: "block line-clamp-2 text-sm font-medium leading-5 text-
|
|
2240
|
+
className: "block line-clamp-2 text-sm font-medium leading-5 text-foreground hover:underline",
|
|
2241
2241
|
children: result.title
|
|
2242
2242
|
}),
|
|
2243
2243
|
/* @__PURE__ */ jsxs("div", {
|
|
2244
|
-
className: "flex flex-wrap items-center gap-1.5 text-xs text-
|
|
2244
|
+
className: "flex flex-wrap items-center gap-1.5 text-xs text-muted",
|
|
2245
2245
|
children: [
|
|
2246
2246
|
date ? /* @__PURE__ */ jsx("span", { children: date }) : null,
|
|
2247
2247
|
source ? /* @__PURE__ */ jsx("span", {
|
|
2248
|
-
className: "rounded-full bg-
|
|
2248
|
+
className: "rounded-full bg-surface-subtle px-1.5 py-0.5 capitalize text-secondary",
|
|
2249
2249
|
children: source
|
|
2250
2250
|
}) : null,
|
|
2251
2251
|
!date && !source && hostname ? /* @__PURE__ */ jsx("span", { children: hostname }) : null
|
|
2252
2252
|
]
|
|
2253
2253
|
}),
|
|
2254
2254
|
snippet ? /* @__PURE__ */ jsx("p", {
|
|
2255
|
-
className: "line-clamp-2 text-xs leading-5 text-
|
|
2255
|
+
className: "line-clamp-2 text-xs leading-5 text-secondary",
|
|
2256
2256
|
children: snippet
|
|
2257
2257
|
}) : null,
|
|
2258
2258
|
imageUrl ? /* @__PURE__ */ jsx("img", {
|
|
2259
2259
|
src: imageUrl,
|
|
2260
2260
|
alt: "",
|
|
2261
|
-
className: "max-h-64 w-full rounded-md border border-
|
|
2261
|
+
className: "max-h-64 w-full rounded-md border border-border object-contain",
|
|
2262
2262
|
loading: "lazy"
|
|
2263
2263
|
}) : null
|
|
2264
2264
|
]
|
|
@@ -2275,7 +2275,7 @@ function ToolResultWebSearchCard({ part, locale, className }) {
|
|
|
2275
2275
|
const sourceLabel = searchResults.length === 1 ? copy.singularSource : copy.pluralSources;
|
|
2276
2276
|
return /* @__PURE__ */ jsxs(Sheet, { children: [/* @__PURE__ */ jsxs(SheetTrigger, {
|
|
2277
2277
|
"aria-label": `Web: ${copy.webSearchTitle}, ${searchResults.length} ${sourceLabel}`,
|
|
2278
|
-
className: joinClasses("plai-tool-result-web-search-card min-h-[183px] w-[186px] rounded-lg bg-
|
|
2278
|
+
className: joinClasses("plai-tool-result-web-search-card min-h-[183px] w-[186px] rounded-lg bg-surface-subtle p-4 text-left font-normal text-foreground transition-colors hover:bg-surface-hover focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-ring", className),
|
|
2279
2279
|
children: [
|
|
2280
2280
|
/* @__PURE__ */ jsxs("header", {
|
|
2281
2281
|
className: "flex items-center gap-3",
|
|
@@ -2292,7 +2292,7 @@ function ToolResultWebSearchCard({ part, locale, className }) {
|
|
|
2292
2292
|
children: copy.webSearchTitle
|
|
2293
2293
|
}),
|
|
2294
2294
|
/* @__PURE__ */ jsx("p", {
|
|
2295
|
-
className: "mt-2 text-xs leading-4 text-
|
|
2295
|
+
className: "mt-2 text-xs leading-4 text-secondary",
|
|
2296
2296
|
children: part.state === "pending" ? uiCopy.searching : `${searchResults.length} ${sourceLabel}`
|
|
2297
2297
|
})
|
|
2298
2298
|
]
|
|
@@ -2319,13 +2319,13 @@ function ToolResultWebSearchResults({ part, searchResults = getWebSearchResults(
|
|
|
2319
2319
|
className: "space-y-3",
|
|
2320
2320
|
children: searchResults.map((result, index) => /* @__PURE__ */ jsx(WebSearchResultItem, { result }, `${result.url}-${index}`))
|
|
2321
2321
|
}) : part.state === "pending" ? /* @__PURE__ */ jsx("p", {
|
|
2322
|
-
className: "text-sm text-
|
|
2322
|
+
className: "text-sm text-secondary",
|
|
2323
2323
|
children: copy.searchingForSources
|
|
2324
2324
|
}) : /* @__PURE__ */ jsx("p", {
|
|
2325
|
-
className: "text-sm text-
|
|
2325
|
+
className: "text-sm text-secondary",
|
|
2326
2326
|
children: copy.noSourcesReturned
|
|
2327
2327
|
}), errorDetails ? /* @__PURE__ */ jsxs("p", {
|
|
2328
|
-
className: "mt-4 rounded border border-
|
|
2328
|
+
className: "mt-4 rounded border border-danger-border bg-danger-subtle px-3 py-2 text-xs text-danger-strong",
|
|
2329
2329
|
children: [
|
|
2330
2330
|
/* @__PURE__ */ jsxs("span", {
|
|
2331
2331
|
className: "font-semibold",
|
|
@@ -2370,7 +2370,7 @@ function SourceCard({ source, locale, variant = "card" }) {
|
|
|
2370
2370
|
locale
|
|
2371
2371
|
});
|
|
2372
2372
|
return /* @__PURE__ */ jsxs("section", {
|
|
2373
|
-
className: "rounded-lg bg-
|
|
2373
|
+
className: "rounded-lg bg-surface-subtle p-4",
|
|
2374
2374
|
children: [/* @__PURE__ */ jsxs("header", {
|
|
2375
2375
|
className: "mb-4 flex items-center gap-3",
|
|
2376
2376
|
children: [/* @__PURE__ */ jsx(Globe, {
|
|
@@ -2408,7 +2408,7 @@ function AggregatedSourceResults({ parts, locale, maxVisible = 3, className, get
|
|
|
2408
2408
|
locale
|
|
2409
2409
|
}, source.key)), overflowCount > 0 ? /* @__PURE__ */ jsxs(Sheet, { children: [/* @__PURE__ */ jsxs(SheetTrigger, {
|
|
2410
2410
|
"aria-label": `+${overflowCount} ${overflowLabel}`,
|
|
2411
|
-
className: "flex min-h-[183px] w-[186px] max-w-full flex-col justify-center rounded-lg bg-
|
|
2411
|
+
className: "flex min-h-[183px] w-[186px] max-w-full flex-col justify-center rounded-lg bg-surface-subtle p-4 text-left font-normal text-foreground transition-colors hover:bg-surface-hover focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-ring",
|
|
2412
2412
|
children: [/* @__PURE__ */ jsxs("span", {
|
|
2413
2413
|
className: "text-2xl font-medium leading-7",
|
|
2414
2414
|
children: ["+", overflowCount]
|
|
@@ -2461,15 +2461,15 @@ function getFileExtension(name, contentType) {
|
|
|
2461
2461
|
return null;
|
|
2462
2462
|
}
|
|
2463
2463
|
function getFileIconClass(extension) {
|
|
2464
|
-
if (extension === "pdf") return "text-
|
|
2465
|
-
if (["doc", "docx"].includes(extension ?? "")) return "text-
|
|
2464
|
+
if (extension === "pdf") return "text-danger";
|
|
2465
|
+
if (["doc", "docx"].includes(extension ?? "")) return "text-info";
|
|
2466
2466
|
if ([
|
|
2467
2467
|
"xls",
|
|
2468
2468
|
"xlsx",
|
|
2469
2469
|
"csv"
|
|
2470
|
-
].includes(extension ?? "")) return "text-
|
|
2471
|
-
if (["ppt", "pptx"].includes(extension ?? "")) return "text-
|
|
2472
|
-
return "text-
|
|
2470
|
+
].includes(extension ?? "")) return "text-success";
|
|
2471
|
+
if (["ppt", "pptx"].includes(extension ?? "")) return "text-warning";
|
|
2472
|
+
return "text-muted";
|
|
2473
2473
|
}
|
|
2474
2474
|
|
|
2475
2475
|
//#endregion
|
|
@@ -2725,88 +2725,94 @@ function MemoryProposalCard({ proposal: initial, actions, activeAgentId, locale,
|
|
|
2725
2725
|
const statusCopy = proposal.status === "ACCEPTED" ? copy.accepted : proposal.status === "REJECTED" ? copy.rejected : proposal.status === "EXPIRED" ? copy.expired : proposal.status === "CONFLICTED" ? copy.conflicted : null;
|
|
2726
2726
|
const operation = proposal.operation === "CREATE" ? copy.create : proposal.operation === "UPDATE" ? copy.update : copy.delete;
|
|
2727
2727
|
return /* @__PURE__ */ jsxs("section", {
|
|
2728
|
-
className: joinClasses("
|
|
2728
|
+
className: joinClasses("plai-memory-proposal-card overflow-hidden rounded-lg border border-success-border bg-success-subtle/30 text-left", className),
|
|
2729
2729
|
"data-memory-proposal-id": proposal.id,
|
|
2730
|
-
children: [
|
|
2731
|
-
|
|
2732
|
-
|
|
2730
|
+
children: [/* @__PURE__ */ jsx("header", {
|
|
2731
|
+
className: "border-b border-success-border px-3 py-2",
|
|
2732
|
+
children: /* @__PURE__ */ jsxs("div", {
|
|
2733
|
+
className: "flex items-center gap-2",
|
|
2733
2734
|
children: [/* @__PURE__ */ jsxs("h4", {
|
|
2734
|
-
className: "flex items-center gap-2 text-sm font-semibold text-
|
|
2735
|
-
children: [/* @__PURE__ */ jsx(Brain, { className: "size-4" }), copy.
|
|
2735
|
+
className: "flex items-center gap-2 text-sm font-semibold text-foreground",
|
|
2736
|
+
children: [/* @__PURE__ */ jsx(Brain, { className: "size-4" }), proposal.scope === "USER" ? copy.user : copy.project]
|
|
2736
2737
|
}), /* @__PURE__ */ jsxs("div", {
|
|
2738
|
+
"aria-label": "type",
|
|
2737
2739
|
className: "flex flex-wrap gap-2 text-xs",
|
|
2738
|
-
children: [
|
|
2739
|
-
|
|
2740
|
-
|
|
2741
|
-
|
|
2742
|
-
|
|
2743
|
-
|
|
2744
|
-
|
|
2745
|
-
children: operation
|
|
2746
|
-
}),
|
|
2747
|
-
/* @__PURE__ */ jsx("span", {
|
|
2748
|
-
className: "rounded-full bg-slate-100 px-2 py-0.5",
|
|
2749
|
-
children: formatCategory(proposal.category)
|
|
2750
|
-
})
|
|
2751
|
-
]
|
|
2752
|
-
})]
|
|
2753
|
-
}),
|
|
2754
|
-
proposal.previous_content && proposal.previous_content !== REDACTED ? /* @__PURE__ */ jsxs("div", {
|
|
2755
|
-
className: "rounded-md bg-slate-100 p-3 text-sm",
|
|
2756
|
-
children: [/* @__PURE__ */ jsx("span", {
|
|
2757
|
-
className: "mb-1 block text-xs font-medium text-slate-500",
|
|
2758
|
-
children: copy.previous
|
|
2759
|
-
}), /* @__PURE__ */ jsx("p", {
|
|
2760
|
-
className: "whitespace-pre-wrap break-words",
|
|
2761
|
-
children: proposal.previous_content
|
|
2762
|
-
})]
|
|
2763
|
-
}) : null,
|
|
2764
|
-
proposal.content && proposal.content !== REDACTED ? /* @__PURE__ */ jsxs("div", {
|
|
2765
|
-
className: "text-sm",
|
|
2766
|
-
children: [/* @__PURE__ */ jsx("span", {
|
|
2767
|
-
className: "mb-1 block text-xs font-medium text-slate-500",
|
|
2768
|
-
children: copy.proposed
|
|
2769
|
-
}), /* @__PURE__ */ jsx("p", {
|
|
2770
|
-
className: "whitespace-pre-wrap break-words",
|
|
2771
|
-
children: proposal.content
|
|
2772
|
-
})]
|
|
2773
|
-
}) : null,
|
|
2774
|
-
canResolve ? /* @__PURE__ */ jsxs("div", {
|
|
2775
|
-
className: "flex gap-2",
|
|
2776
|
-
children: [/* @__PURE__ */ jsxs("button", {
|
|
2777
|
-
type: "button",
|
|
2778
|
-
disabled: resolving,
|
|
2779
|
-
onClick: () => void resolve(true),
|
|
2780
|
-
className: "inline-flex items-center rounded-md bg-slate-900 px-3 py-1.5 text-xs font-medium text-white disabled:opacity-50",
|
|
2781
|
-
children: [resolving ? /* @__PURE__ */ jsx(LoaderCircle, { className: "mr-2 size-3 animate-spin" }) : null, copy.accept]
|
|
2782
|
-
}), /* @__PURE__ */ jsx("button", {
|
|
2783
|
-
type: "button",
|
|
2784
|
-
disabled: resolving,
|
|
2785
|
-
onClick: () => void resolve(false),
|
|
2786
|
-
className: "rounded-md border border-slate-300 bg-white px-3 py-1.5 text-xs font-medium disabled:opacity-50",
|
|
2787
|
-
children: copy.reject
|
|
2788
|
-
})]
|
|
2789
|
-
}) : null,
|
|
2790
|
-
proposal.status === "PENDING" && !canResolve ? /* @__PURE__ */ jsx("p", {
|
|
2791
|
-
className: "text-xs font-medium text-slate-500",
|
|
2792
|
-
children: proposal.scope === "PROJECT" ? copy.review : copy.unavailable
|
|
2793
|
-
}) : null,
|
|
2794
|
-
proposal.status === "ACCEPTED" && statusCopy ? /* @__PURE__ */ jsxs("span", {
|
|
2795
|
-
className: "inline-flex items-center gap-1.5 rounded-full border bg-white px-3 py-1 text-xs font-medium text-slate-900 shadow-sm",
|
|
2796
|
-
children: [statusCopy, /* @__PURE__ */ jsx(Check, {
|
|
2797
|
-
className: "size-3.5 stroke-[2.5] text-emerald-600",
|
|
2798
|
-
"aria-hidden": "true"
|
|
2740
|
+
children: [/* @__PURE__ */ jsx("span", {
|
|
2741
|
+
className: "rounded-full bg-surface-subtle px-2 py-0.5",
|
|
2742
|
+
children: operation
|
|
2743
|
+
}), /* @__PURE__ */ jsx("span", {
|
|
2744
|
+
className: "rounded-full bg-surface-subtle px-2 py-0.5",
|
|
2745
|
+
children: formatCategory(proposal.category)
|
|
2746
|
+
})]
|
|
2799
2747
|
})]
|
|
2800
|
-
})
|
|
2801
|
-
|
|
2802
|
-
|
|
2803
|
-
|
|
2804
|
-
|
|
2805
|
-
|
|
2806
|
-
|
|
2807
|
-
|
|
2808
|
-
|
|
2809
|
-
|
|
2748
|
+
})
|
|
2749
|
+
}), /* @__PURE__ */ jsxs("div", {
|
|
2750
|
+
className: "space-y-3 px-3 py-2",
|
|
2751
|
+
children: [
|
|
2752
|
+
" ",
|
|
2753
|
+
proposal.previous_content && proposal.previous_content !== REDACTED ? /* @__PURE__ */ jsxs("div", {
|
|
2754
|
+
className: "rounded-md bg-surface-subtle p-3 text-sm",
|
|
2755
|
+
children: [/* @__PURE__ */ jsx("span", {
|
|
2756
|
+
className: "mb-1 block text-xs font-medium text-muted",
|
|
2757
|
+
children: copy.previous
|
|
2758
|
+
}), /* @__PURE__ */ jsx("p", {
|
|
2759
|
+
className: "whitespace-pre-wrap break-words",
|
|
2760
|
+
children: proposal.previous_content
|
|
2761
|
+
})]
|
|
2762
|
+
}) : null,
|
|
2763
|
+
proposal.content && proposal.content !== REDACTED ? /* @__PURE__ */ jsxs("div", {
|
|
2764
|
+
className: "text-sm",
|
|
2765
|
+
children: [/* @__PURE__ */ jsx("span", {
|
|
2766
|
+
className: "mb-1 block text-xs font-medium text-muted",
|
|
2767
|
+
children: copy.proposed
|
|
2768
|
+
}), /* @__PURE__ */ jsx("p", {
|
|
2769
|
+
className: "whitespace-pre-wrap break-words",
|
|
2770
|
+
children: proposal.content
|
|
2771
|
+
})]
|
|
2772
|
+
}) : null,
|
|
2773
|
+
canResolve ? /* @__PURE__ */ jsxs("div", {
|
|
2774
|
+
className: "flex gap-2",
|
|
2775
|
+
children: [/* @__PURE__ */ jsxs("button", {
|
|
2776
|
+
type: "button",
|
|
2777
|
+
disabled: resolving,
|
|
2778
|
+
onClick: () => void resolve(true),
|
|
2779
|
+
className: "inline-flex items-center rounded-md bg-inverse px-3 py-1.5 text-xs font-medium text-inverse-foreground disabled:opacity-50",
|
|
2780
|
+
children: [resolving ? /* @__PURE__ */ jsx(LoaderCircle, { className: "mr-2 size-3 animate-spin" }) : null, copy.accept]
|
|
2781
|
+
}), /* @__PURE__ */ jsx("button", {
|
|
2782
|
+
type: "button",
|
|
2783
|
+
disabled: resolving,
|
|
2784
|
+
onClick: () => void resolve(false),
|
|
2785
|
+
className: "rounded-md border border-border-strong bg-surface px-3 py-1.5 text-xs font-medium disabled:opacity-50",
|
|
2786
|
+
children: copy.reject
|
|
2787
|
+
})]
|
|
2788
|
+
}) : null,
|
|
2789
|
+
proposal.status === "PENDING" && !canResolve ? /* @__PURE__ */ jsxs("span", {
|
|
2790
|
+
className: "inline-flex items-center gap-1.5 rounded-full border bg-surface px-3 py-1 text-xs font-medium text-foreground",
|
|
2791
|
+
children: [proposal.scope === "PROJECT" ? copy.review : copy.unavailable, /* @__PURE__ */ jsx(Clock, {
|
|
2792
|
+
className: "size-3.5 stroke-[2.5] text-muted",
|
|
2793
|
+
"aria-hidden": "true"
|
|
2794
|
+
})]
|
|
2795
|
+
}) : null,
|
|
2796
|
+
proposal.status === "ACCEPTED" && statusCopy ? /* @__PURE__ */ jsxs("span", {
|
|
2797
|
+
className: "inline-flex items-center gap-1.5 rounded-full border bg-surface px-3 py-1 text-xs font-medium text-foreground",
|
|
2798
|
+
children: [statusCopy, /* @__PURE__ */ jsx(Check, {
|
|
2799
|
+
className: "size-3.5 stroke-[2.5] text-success",
|
|
2800
|
+
"aria-hidden": "true"
|
|
2801
|
+
})]
|
|
2802
|
+
}) : null,
|
|
2803
|
+
statusCopy && proposal.status !== "ACCEPTED" ? /* @__PURE__ */ jsxs("span", {
|
|
2804
|
+
className: "inline-flex items-center gap-1.5 rounded-full border border-danger bg-surface px-3 py-1 text-xs font-medium text-danger",
|
|
2805
|
+
children: [statusCopy, /* @__PURE__ */ jsx(X$1, {
|
|
2806
|
+
className: "size-3.5 stroke-[2.5]",
|
|
2807
|
+
"aria-hidden": "true"
|
|
2808
|
+
})]
|
|
2809
|
+
}) : null,
|
|
2810
|
+
error ? /* @__PURE__ */ jsx("p", {
|
|
2811
|
+
className: "text-xs text-danger",
|
|
2812
|
+
children: error
|
|
2813
|
+
}) : null
|
|
2814
|
+
]
|
|
2815
|
+
})]
|
|
2810
2816
|
});
|
|
2811
2817
|
}
|
|
2812
2818
|
function mergeProposal(current, incoming) {
|
|
@@ -2913,7 +2919,7 @@ function ToolError({ part, locale, defaultOpen = false, className,...props }) {
|
|
|
2913
2919
|
const copy = getToolErrorCopy(part, locale);
|
|
2914
2920
|
const errorDetails = formatToolErrorDetails(part.errorDetails);
|
|
2915
2921
|
return /* @__PURE__ */ jsxs("section", {
|
|
2916
|
-
className: joinClasses("text-sm text-
|
|
2922
|
+
className: joinClasses("text-sm text-secondary", className),
|
|
2917
2923
|
"data-tool-call-id": part.id,
|
|
2918
2924
|
"data-tool-call-state": part.state,
|
|
2919
2925
|
...props,
|
|
@@ -2921,14 +2927,17 @@ function ToolError({ part, locale, defaultOpen = false, className,...props }) {
|
|
|
2921
2927
|
type: "button",
|
|
2922
2928
|
"aria-controls": contentId,
|
|
2923
2929
|
"aria-expanded": isOpen,
|
|
2924
|
-
className: "inline-flex items-center gap-2 rounded-md py-1 text-left font-medium text-
|
|
2930
|
+
className: "inline-flex items-center gap-2 rounded-md py-1 text-left font-medium text-danger transition-colors hover:text-danger-strong focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-ring",
|
|
2925
2931
|
onClick: () => setIsOpen((value) => !value),
|
|
2926
2932
|
children: [
|
|
2927
2933
|
/* @__PURE__ */ jsx(CircleX, {
|
|
2928
2934
|
className: "size-4 shrink-0",
|
|
2929
2935
|
"aria-hidden": "true"
|
|
2930
2936
|
}),
|
|
2931
|
-
/* @__PURE__ */ jsx("span", {
|
|
2937
|
+
/* @__PURE__ */ jsx("span", {
|
|
2938
|
+
className: "line-clamp-1",
|
|
2939
|
+
children: copy.summary
|
|
2940
|
+
}),
|
|
2932
2941
|
/* @__PURE__ */ jsx(ChevronDown, {
|
|
2933
2942
|
className: joinClasses("size-4 shrink-0 transition-transform motion-reduce:transition-none", isOpen ? "rotate-180" : void 0),
|
|
2934
2943
|
"aria-hidden": "true"
|
|
@@ -2936,27 +2945,27 @@ function ToolError({ part, locale, defaultOpen = false, className,...props }) {
|
|
|
2936
2945
|
]
|
|
2937
2946
|
}), isOpen ? /* @__PURE__ */ jsxs("div", {
|
|
2938
2947
|
id: contentId,
|
|
2939
|
-
className: "mt-2 space-y-3 border-l-2 border-
|
|
2948
|
+
className: "mt-2 space-y-3 border-l-2 border-danger-border pl-3",
|
|
2940
2949
|
children: [
|
|
2941
2950
|
/* @__PURE__ */ jsxs("div", { children: [/* @__PURE__ */ jsx("p", {
|
|
2942
|
-
className: "mb-2 text-xs font-semibold text-
|
|
2951
|
+
className: "mb-2 text-xs font-semibold text-strong",
|
|
2943
2952
|
children: copy.input
|
|
2944
2953
|
}), /* @__PURE__ */ jsx("pre", {
|
|
2945
|
-
className: "overflow-x-auto whitespace-pre-wrap rounded-md bg-
|
|
2954
|
+
className: "overflow-x-auto whitespace-pre-wrap rounded-md bg-surface-subtle p-3 text-xs leading-5 text-strong",
|
|
2946
2955
|
children: formatJson$1(part.input)
|
|
2947
2956
|
})] }),
|
|
2948
2957
|
/* @__PURE__ */ jsxs("div", { children: [/* @__PURE__ */ jsx("p", {
|
|
2949
|
-
className: "mb-2 text-xs font-semibold text-
|
|
2958
|
+
className: "mb-2 text-xs font-semibold text-strong",
|
|
2950
2959
|
children: copy.output
|
|
2951
2960
|
}), /* @__PURE__ */ jsx("pre", {
|
|
2952
|
-
className: "overflow-x-auto whitespace-pre-wrap rounded-md bg-
|
|
2961
|
+
className: "overflow-x-auto whitespace-pre-wrap rounded-md bg-surface-subtle p-3 text-xs leading-5 text-strong",
|
|
2953
2962
|
children: part.result === void 0 ? copy.noOutput : formatJson$1(part.result)
|
|
2954
2963
|
})] }),
|
|
2955
2964
|
errorDetails ? /* @__PURE__ */ jsxs("div", { children: [/* @__PURE__ */ jsx("p", {
|
|
2956
|
-
className: "mb-2 text-xs font-semibold text-
|
|
2965
|
+
className: "mb-2 text-xs font-semibold text-danger-strong",
|
|
2957
2966
|
children: copy.details
|
|
2958
2967
|
}), /* @__PURE__ */ jsx("p", {
|
|
2959
|
-
className: "whitespace-pre-wrap text-xs leading-5 text-
|
|
2968
|
+
className: "whitespace-pre-wrap text-xs leading-5 text-danger-strong",
|
|
2960
2969
|
children: errorDetails
|
|
2961
2970
|
})] }) : null
|
|
2962
2971
|
]
|
|
@@ -2996,12 +3005,12 @@ function ToolResultAgentInvocationCard({ part, className, onOpenThread, locale }
|
|
|
2996
3005
|
const pending = part.state === "pending";
|
|
2997
3006
|
return /* @__PURE__ */ jsxs(Sheet, { children: [/* @__PURE__ */ jsx(SheetTrigger, {
|
|
2998
3007
|
"aria-label": `${copy.agent}: ${agentName}`,
|
|
2999
|
-
className: joinClasses("w-full rounded-lg border border-
|
|
3008
|
+
className: joinClasses("plai-tool-result-agent-invocation-card w-full rounded-lg border border-border bg-surface text-left font-normal text-foreground transition-colors hover:bg-surface-muted focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-ring", className),
|
|
3000
3009
|
children: /* @__PURE__ */ jsxs("span", {
|
|
3001
3010
|
className: "flex items-center gap-2 px-3 py-2 text-sm",
|
|
3002
3011
|
children: [
|
|
3003
3012
|
/* @__PURE__ */ jsx(Bot, {
|
|
3004
|
-
className: "h-4 w-4 shrink-0 text-
|
|
3013
|
+
className: "h-4 w-4 shrink-0 text-muted",
|
|
3005
3014
|
"aria-hidden": "true"
|
|
3006
3015
|
}),
|
|
3007
3016
|
/* @__PURE__ */ jsx("span", {
|
|
@@ -3009,19 +3018,19 @@ function ToolResultAgentInvocationCard({ part, className, onOpenThread, locale }
|
|
|
3009
3018
|
children: copy.agent
|
|
3010
3019
|
}),
|
|
3011
3020
|
/* @__PURE__ */ jsx("span", {
|
|
3012
|
-
className: "min-w-0 truncate border-
|
|
3021
|
+
className: "min-w-0 truncate border-border-strong border px-2 py-0.5 rounded-md text-xs text-muted",
|
|
3013
3022
|
children: agentName
|
|
3014
3023
|
}),
|
|
3015
3024
|
/* @__PURE__ */ jsx("span", {
|
|
3016
3025
|
className: "ml-auto shrink-0",
|
|
3017
3026
|
children: pending ? /* @__PURE__ */ jsx(LoaderCircle, {
|
|
3018
|
-
className: "h-4 w-4 animate-spin text-
|
|
3027
|
+
className: "h-4 w-4 animate-spin text-warning",
|
|
3019
3028
|
"aria-label": copy.pending
|
|
3020
3029
|
}) : failed ? /* @__PURE__ */ jsx(XCircle, {
|
|
3021
|
-
className: "h-4 w-4 text-
|
|
3030
|
+
className: "h-4 w-4 text-danger",
|
|
3022
3031
|
"aria-hidden": "true"
|
|
3023
3032
|
}) : /* @__PURE__ */ jsx(CheckCircle2, {
|
|
3024
|
-
className: "h-4 w-4 text-
|
|
3033
|
+
className: "h-4 w-4 text-success",
|
|
3025
3034
|
"aria-hidden": "true"
|
|
3026
3035
|
})
|
|
3027
3036
|
})
|
|
@@ -3040,25 +3049,25 @@ function ToolResultAgentInvocationCard({ part, className, onOpenThread, locale }
|
|
|
3040
3049
|
className: "grid gap-2 text-sm",
|
|
3041
3050
|
children: [
|
|
3042
3051
|
/* @__PURE__ */ jsxs("div", { children: [/* @__PURE__ */ jsx("dt", {
|
|
3043
|
-
className: "text-xs text-
|
|
3052
|
+
className: "text-xs text-muted",
|
|
3044
3053
|
children: copy.status
|
|
3045
3054
|
}), /* @__PURE__ */ jsx("dd", { children: getUiStatusLabel(part.state, copy) })] }),
|
|
3046
3055
|
metadata?.agent_id ? /* @__PURE__ */ jsxs("div", { children: [/* @__PURE__ */ jsx("dt", {
|
|
3047
|
-
className: "text-xs text-
|
|
3056
|
+
className: "text-xs text-muted",
|
|
3048
3057
|
children: copy.agentId
|
|
3049
3058
|
}), /* @__PURE__ */ jsx("dd", {
|
|
3050
3059
|
className: "break-all",
|
|
3051
3060
|
children: metadata.agent_id
|
|
3052
3061
|
})] }) : null,
|
|
3053
3062
|
metadata?.tracked_execution_id ? /* @__PURE__ */ jsxs("div", { children: [/* @__PURE__ */ jsx("dt", {
|
|
3054
|
-
className: "text-xs text-
|
|
3063
|
+
className: "text-xs text-muted",
|
|
3055
3064
|
children: copy.executionId
|
|
3056
3065
|
}), /* @__PURE__ */ jsx("dd", {
|
|
3057
3066
|
className: "break-all",
|
|
3058
3067
|
children: metadata.tracked_execution_id
|
|
3059
3068
|
})] }) : null,
|
|
3060
3069
|
threadId ? /* @__PURE__ */ jsxs("div", { children: [/* @__PURE__ */ jsx("dt", {
|
|
3061
|
-
className: "text-xs text-
|
|
3070
|
+
className: "text-xs text-muted",
|
|
3062
3071
|
children: copy.threadId
|
|
3063
3072
|
}), /* @__PURE__ */ jsx("dd", {
|
|
3064
3073
|
className: "break-all",
|
|
@@ -3070,19 +3079,19 @@ function ToolResultAgentInvocationCard({ part, className, onOpenThread, locale }
|
|
|
3070
3079
|
className: "mb-2 text-sm font-medium",
|
|
3071
3080
|
children: copy.prompt
|
|
3072
3081
|
}), /* @__PURE__ */ jsx("p", {
|
|
3073
|
-
className: "whitespace-pre-wrap rounded-md border border-
|
|
3082
|
+
className: "whitespace-pre-wrap rounded-md border border-border bg-surface-muted p-3 text-sm leading-6",
|
|
3074
3083
|
children: prompt
|
|
3075
3084
|
})] }) : null,
|
|
3076
3085
|
output$1 ? /* @__PURE__ */ jsxs("div", { children: [/* @__PURE__ */ jsx("h3", {
|
|
3077
3086
|
className: "mb-2 text-sm font-medium",
|
|
3078
3087
|
children: copy.result
|
|
3079
3088
|
}), /* @__PURE__ */ jsx("pre", {
|
|
3080
|
-
className: "overflow-x-auto whitespace-pre-wrap rounded-md border border-
|
|
3089
|
+
className: "overflow-x-auto whitespace-pre-wrap rounded-md border border-border bg-surface-muted p-3 text-xs leading-5",
|
|
3081
3090
|
children: output$1
|
|
3082
3091
|
})] }) : null,
|
|
3083
3092
|
threadId && onOpenThread ? /* @__PURE__ */ jsxs("button", {
|
|
3084
3093
|
type: "button",
|
|
3085
|
-
className: "inline-flex items-center gap-2 rounded-md border border-
|
|
3094
|
+
className: "inline-flex items-center gap-2 rounded-md border border-border-strong px-3 py-2 text-sm font-medium text-foreground transition-colors hover:bg-surface-muted focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-ring",
|
|
3086
3095
|
onClick: () => onOpenThread(threadId),
|
|
3087
3096
|
children: [/* @__PURE__ */ jsx(MessageSquare, {
|
|
3088
3097
|
className: "h-4 w-4",
|
|
@@ -3090,7 +3099,7 @@ function ToolResultAgentInvocationCard({ part, className, onOpenThread, locale }
|
|
|
3090
3099
|
}), copy.openConversation]
|
|
3091
3100
|
}) : null,
|
|
3092
3101
|
error ? /* @__PURE__ */ jsxs("p", {
|
|
3093
|
-
className: "rounded border border-
|
|
3102
|
+
className: "rounded border border-danger-border bg-danger-subtle px-3 py-2 text-xs text-danger-strong",
|
|
3094
3103
|
children: [
|
|
3095
3104
|
/* @__PURE__ */ jsxs("span", {
|
|
3096
3105
|
className: "font-semibold",
|
|
@@ -3142,66 +3151,67 @@ function ToolResultBrowserCard({ part, className, locale }) {
|
|
|
3142
3151
|
const pending = part.state === "pending";
|
|
3143
3152
|
const canExpand = Boolean(preview || error || url);
|
|
3144
3153
|
return /* @__PURE__ */ jsxs("section", {
|
|
3145
|
-
className: joinClasses("overflow-hidden rounded-lg border border-
|
|
3154
|
+
className: joinClasses("plai-tool-result-browser-card overflow-hidden rounded-lg border border-border bg-surface", className),
|
|
3146
3155
|
"aria-label": copy.browserResult,
|
|
3147
|
-
children: [/* @__PURE__ */
|
|
3148
|
-
className: "flex items-center gap-2 px-3 py-2 text-
|
|
3149
|
-
children:
|
|
3150
|
-
|
|
3151
|
-
|
|
3152
|
-
|
|
3153
|
-
|
|
3154
|
-
|
|
3155
|
-
|
|
3156
|
-
|
|
3157
|
-
|
|
3158
|
-
|
|
3159
|
-
className: "min-w-0 truncate border-neutral-500 border px-2 py-0.5 rounded-md text-xs text-neutral-500",
|
|
3160
|
-
children: subtitle
|
|
3161
|
-
}) : null,
|
|
3162
|
-
/* @__PURE__ */ jsxs("span", {
|
|
3163
|
-
className: "ml-auto flex shrink-0 items-center gap-2",
|
|
3164
|
-
children: [pending ? /* @__PURE__ */ jsx(LoaderCircle, {
|
|
3165
|
-
className: "h-4 w-4 animate-spin text-amber-600",
|
|
3166
|
-
"aria-label": copy.pending
|
|
3167
|
-
}) : failed ? /* @__PURE__ */ jsx(XCircle, {
|
|
3168
|
-
className: "h-4 w-4 text-rose-600",
|
|
3169
|
-
"aria-hidden": "true"
|
|
3170
|
-
}) : /* @__PURE__ */ jsx(CheckCircle2, {
|
|
3171
|
-
className: "h-4 w-4 text-emerald-600",
|
|
3156
|
+
children: [/* @__PURE__ */ jsx("header", {
|
|
3157
|
+
className: "flex items-center gap-2 border-b border-border px-3 py-2 text-xs text-secondary",
|
|
3158
|
+
children: /* @__PURE__ */ jsxs("button", {
|
|
3159
|
+
type: "button",
|
|
3160
|
+
disabled: !canExpand,
|
|
3161
|
+
"aria-label": expanded ? copy.collapseBrowserResult : copy.expandBrowserResult,
|
|
3162
|
+
"aria-expanded": canExpand ? expanded : void 0,
|
|
3163
|
+
className: "flex w-full items-center gap-2 px-3 py-2 text-left text-sm transition-colors enabled:cursor-pointer enabled:hover:bg-surface-subtle focus-visible:outline-2 focus-visible:-outline-offset-2 focus-visible:outline-ring",
|
|
3164
|
+
onClick: () => setExpanded((value) => !value),
|
|
3165
|
+
children: [
|
|
3166
|
+
/* @__PURE__ */ jsx(Globe, {
|
|
3167
|
+
className: "h-4 w-4 shrink-0 text-muted",
|
|
3172
3168
|
"aria-hidden": "true"
|
|
3173
|
-
}),
|
|
3174
|
-
|
|
3175
|
-
"
|
|
3176
|
-
|
|
3177
|
-
|
|
3178
|
-
|
|
3179
|
-
|
|
3180
|
-
|
|
3169
|
+
}),
|
|
3170
|
+
/* @__PURE__ */ jsx("span", {
|
|
3171
|
+
className: "font-medium text-strong",
|
|
3172
|
+
children: copy.browser
|
|
3173
|
+
}),
|
|
3174
|
+
subtitle ? /* @__PURE__ */ jsx("span", {
|
|
3175
|
+
className: "min-w-0 truncate border-border-strong border px-2 py-0.5 rounded-md text-xs text-muted",
|
|
3176
|
+
children: subtitle
|
|
3177
|
+
}) : null,
|
|
3178
|
+
/* @__PURE__ */ jsxs("span", {
|
|
3179
|
+
className: "ml-auto flex shrink-0 items-center gap-2",
|
|
3180
|
+
children: [pending ? /* @__PURE__ */ jsx(LoaderCircle, {
|
|
3181
|
+
className: "h-4 w-4 animate-spin text-warning",
|
|
3182
|
+
"aria-label": copy.pending
|
|
3183
|
+
}) : failed ? /* @__PURE__ */ jsx(XCircle, {
|
|
3184
|
+
className: "h-4 w-4 text-danger",
|
|
3181
3185
|
"aria-hidden": "true"
|
|
3182
|
-
}) : /* @__PURE__ */ jsx(
|
|
3183
|
-
className: "h-
|
|
3186
|
+
}) : /* @__PURE__ */ jsx(CheckCircle2, {
|
|
3187
|
+
className: "h-4 w-4 text-success",
|
|
3184
3188
|
"aria-hidden": "true"
|
|
3185
|
-
})
|
|
3186
|
-
|
|
3187
|
-
|
|
3188
|
-
|
|
3189
|
+
}), canExpand ? expanded ? /* @__PURE__ */ jsx(ChevronUp, {
|
|
3190
|
+
className: "h-4 w-4 text-muted",
|
|
3191
|
+
"aria-hidden": "true"
|
|
3192
|
+
}) : /* @__PURE__ */ jsx(ChevronDown, {
|
|
3193
|
+
className: "h-4 w-4 text-muted",
|
|
3194
|
+
"aria-hidden": "true"
|
|
3195
|
+
}) : null]
|
|
3196
|
+
})
|
|
3197
|
+
]
|
|
3198
|
+
})
|
|
3189
3199
|
}), expanded ? /* @__PURE__ */ jsxs("div", {
|
|
3190
|
-
className: "space-y-3 border-t border-
|
|
3200
|
+
className: "space-y-3 border-t border-border bg-surface-muted p-3",
|
|
3191
3201
|
children: [
|
|
3192
3202
|
url ? /* @__PURE__ */ jsx("a", {
|
|
3193
3203
|
href: url,
|
|
3194
3204
|
target: "_blank",
|
|
3195
3205
|
rel: "noreferrer noopener",
|
|
3196
|
-
className: "block truncate text-xs text-
|
|
3206
|
+
className: "block truncate text-xs text-info-strong underline underline-offset-2 hover:text-info-strong",
|
|
3197
3207
|
children: url
|
|
3198
3208
|
}) : null,
|
|
3199
3209
|
preview ? /* @__PURE__ */ jsx("p", {
|
|
3200
|
-
className: "whitespace-pre-wrap text-xs leading-5 text-
|
|
3210
|
+
className: "whitespace-pre-wrap text-xs leading-5 text-secondary",
|
|
3201
3211
|
children: preview
|
|
3202
3212
|
}) : null,
|
|
3203
3213
|
error ? /* @__PURE__ */ jsxs("p", {
|
|
3204
|
-
className: "text-xs text-
|
|
3214
|
+
className: "text-xs text-danger-strong",
|
|
3205
3215
|
children: [
|
|
3206
3216
|
/* @__PURE__ */ jsxs("span", {
|
|
3207
3217
|
className: "font-semibold",
|
|
@@ -3280,159 +3290,161 @@ function ToolResultEmailSendCard({ part, className, locale }) {
|
|
|
3280
3290
|
const emailInput = parseEmailSendInput(part);
|
|
3281
3291
|
const emailResult = parseEmailSendResult(part);
|
|
3282
3292
|
const errorDetails = formatToolErrorDetails(part.errorDetails);
|
|
3283
|
-
const statusClass = part.state === "error" ? "border-
|
|
3293
|
+
const statusClass = part.state === "error" ? "border-danger-border bg-danger-subtle text-danger-strong" : part.state === "pending" ? "border-warning-border bg-warning-subtle text-warning-strong" : "border-success-border bg-success-subtle text-success-strong";
|
|
3284
3294
|
return /* @__PURE__ */ jsxs("section", {
|
|
3285
|
-
className: joinClasses("
|
|
3295
|
+
className: joinClasses("plai-tool-result-email-send-card overflow-hidden rounded-lg border border-border bg-surface-muted", className),
|
|
3286
3296
|
"data-tool-call-id": part.id,
|
|
3287
3297
|
"data-tool-call-state": part.state,
|
|
3288
|
-
children: [
|
|
3289
|
-
|
|
3290
|
-
|
|
3291
|
-
|
|
3292
|
-
|
|
3298
|
+
children: [/* @__PURE__ */ jsx("header", {
|
|
3299
|
+
className: "flex items-center gap-2 border-b border-border px-3 py-2 text-xs text-secondary",
|
|
3300
|
+
children: /* @__PURE__ */ jsxs("button", {
|
|
3301
|
+
type: "button",
|
|
3302
|
+
"aria-expanded": isExpanded,
|
|
3303
|
+
"aria-label": isExpanded ? copy.collapse : copy.expand,
|
|
3304
|
+
"aria-controls": `tool-email-details-${part.id}`,
|
|
3305
|
+
className: "flex w-full cursor-pointer items-center justify-between gap-2 rounded text-left focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-ring",
|
|
3306
|
+
onClick: () => setIsExpanded((previous) => !previous),
|
|
3307
|
+
children: [/* @__PURE__ */ jsx("span", {
|
|
3308
|
+
className: "text-sm font-semibold text-foreground",
|
|
3293
3309
|
children: copy.email
|
|
3294
|
-
}), /* @__PURE__ */ jsxs("
|
|
3310
|
+
}), /* @__PURE__ */ jsxs("span", {
|
|
3295
3311
|
className: "flex items-center gap-2",
|
|
3296
3312
|
children: [/* @__PURE__ */ jsx("span", {
|
|
3297
|
-
className: joinClasses("rounded-full
|
|
3313
|
+
className: joinClasses("rounded-full border capitalize px-2 py-0.5 text-xs", statusClass),
|
|
3298
3314
|
children: getUiStatusLabel(part.state, copy)
|
|
3299
|
-
}), /* @__PURE__ */ jsx(
|
|
3300
|
-
|
|
3301
|
-
"aria-
|
|
3302
|
-
|
|
3303
|
-
"
|
|
3304
|
-
|
|
3305
|
-
onClick: () => setIsExpanded((previous) => !previous),
|
|
3306
|
-
children: isExpanded ? /* @__PURE__ */ jsx(Minus, {
|
|
3307
|
-
className: "h-3 w-3",
|
|
3308
|
-
"aria-hidden": "true"
|
|
3309
|
-
}) : /* @__PURE__ */ jsx(Plus, {
|
|
3310
|
-
className: "h-3 w-3",
|
|
3311
|
-
"aria-hidden": "true"
|
|
3312
|
-
})
|
|
3315
|
+
}), isExpanded ? /* @__PURE__ */ jsx(ChevronUp, {
|
|
3316
|
+
className: "h-4 w-4 text-muted",
|
|
3317
|
+
"aria-hidden": "true"
|
|
3318
|
+
}) : /* @__PURE__ */ jsx(ChevronDown, {
|
|
3319
|
+
className: "h-4 w-4 text-muted",
|
|
3320
|
+
"aria-hidden": "true"
|
|
3313
3321
|
})]
|
|
3314
3322
|
})]
|
|
3315
|
-
})
|
|
3316
|
-
|
|
3317
|
-
|
|
3318
|
-
|
|
3319
|
-
|
|
3320
|
-
|
|
3321
|
-
}), /* @__PURE__ */ jsx("p", {
|
|
3322
|
-
className: "text-xs text-slate-900",
|
|
3323
|
-
children: emailInput.subject
|
|
3324
|
-
})]
|
|
3325
|
-
}) : null,
|
|
3326
|
-
/* @__PURE__ */ jsxs("div", {
|
|
3327
|
-
className: "flex items-center gap-1",
|
|
3328
|
-
children: [/* @__PURE__ */ jsxs("p", {
|
|
3329
|
-
className: "text-xs font-semibold text-slate-600",
|
|
3330
|
-
children: [copy.to, ":"]
|
|
3331
|
-
}), emailInput.to.length > 0 ? /* @__PURE__ */ jsx("div", {
|
|
3332
|
-
className: "flex flex-wrap gap-2",
|
|
3333
|
-
children: emailInput.to.map((recipient) => /* @__PURE__ */ jsx("span", {
|
|
3334
|
-
className: "rounded-full border border-slate-300 bg-slate-100 px-2 py-0.5 text-xs text-slate-700",
|
|
3335
|
-
children: recipient
|
|
3336
|
-
}, recipient))
|
|
3337
|
-
}) : /* @__PURE__ */ jsx("p", {
|
|
3338
|
-
className: "text-xs text-slate-500",
|
|
3339
|
-
children: copy.noRecipientsProvided
|
|
3340
|
-
})]
|
|
3341
|
-
}),
|
|
3342
|
-
/* @__PURE__ */ jsxs("div", {
|
|
3343
|
-
id: `tool-email-details-${part.id}`,
|
|
3344
|
-
"data-testid": "email-send-details",
|
|
3345
|
-
className: joinClasses(isExpanded ? "block space-y-4" : "hidden"),
|
|
3346
|
-
children: [emailInput.text ? /* @__PURE__ */ jsxs("div", {
|
|
3347
|
-
className: "space-y-1",
|
|
3323
|
+
})
|
|
3324
|
+
}), /* @__PURE__ */ jsxs("div", {
|
|
3325
|
+
className: "space-y-4 px-3 py-2",
|
|
3326
|
+
children: [
|
|
3327
|
+
emailInput.subject ? /* @__PURE__ */ jsxs("div", {
|
|
3328
|
+
className: "flex items-center gap-1",
|
|
3348
3329
|
children: [/* @__PURE__ */ jsxs("p", {
|
|
3349
|
-
className: "text-xs font-semibold text-
|
|
3350
|
-
children: [copy.
|
|
3330
|
+
className: "text-xs font-semibold text-secondary",
|
|
3331
|
+
children: [copy.subject, ":"]
|
|
3351
3332
|
}), /* @__PURE__ */ jsx("p", {
|
|
3352
|
-
className: "
|
|
3353
|
-
children: emailInput.
|
|
3333
|
+
className: "text-xs text-foreground",
|
|
3334
|
+
children: emailInput.subject
|
|
3354
3335
|
})]
|
|
3355
|
-
}) : null,
|
|
3356
|
-
|
|
3336
|
+
}) : null,
|
|
3337
|
+
/* @__PURE__ */ jsxs("div", {
|
|
3338
|
+
className: "flex items-center gap-1",
|
|
3339
|
+
children: [/* @__PURE__ */ jsxs("p", {
|
|
3340
|
+
className: "text-xs font-semibold text-secondary",
|
|
3341
|
+
children: [copy.to, ":"]
|
|
3342
|
+
}), emailInput.to.length > 0 ? /* @__PURE__ */ jsx("div", {
|
|
3343
|
+
className: "flex flex-wrap gap-2",
|
|
3344
|
+
children: emailInput.to.map((recipient) => /* @__PURE__ */ jsx("span", {
|
|
3345
|
+
className: "rounded-full border border-border-strong bg-surface-subtle px-2 py-0.5 text-xs text-strong",
|
|
3346
|
+
children: recipient
|
|
3347
|
+
}, recipient))
|
|
3348
|
+
}) : /* @__PURE__ */ jsx("p", {
|
|
3349
|
+
className: "text-xs text-muted",
|
|
3350
|
+
children: copy.noRecipientsProvided
|
|
3351
|
+
})]
|
|
3352
|
+
}),
|
|
3353
|
+
/* @__PURE__ */ jsxs("div", {
|
|
3354
|
+
id: `tool-email-details-${part.id}`,
|
|
3355
|
+
"data-testid": "email-send-details",
|
|
3356
|
+
className: joinClasses(isExpanded ? "block space-y-4" : "hidden"),
|
|
3357
|
+
children: [emailInput.text ? /* @__PURE__ */ jsxs("div", {
|
|
3358
|
+
className: "space-y-1",
|
|
3359
|
+
children: [/* @__PURE__ */ jsxs("p", {
|
|
3360
|
+
className: "text-xs font-semibold text-secondary",
|
|
3361
|
+
children: [copy.body, ":"]
|
|
3362
|
+
}), /* @__PURE__ */ jsx("p", {
|
|
3363
|
+
className: "whitespace-pre-wrap rounded border border-border bg-surface p-2 text-sm text-strong",
|
|
3364
|
+
children: emailInput.text
|
|
3365
|
+
})]
|
|
3366
|
+
}) : null, part.result !== void 0 ? /* @__PURE__ */ jsxs("div", {
|
|
3367
|
+
className: "space-y-2 rounded border border-border bg-surface-muted p-3",
|
|
3368
|
+
children: [
|
|
3369
|
+
/* @__PURE__ */ jsx("p", {
|
|
3370
|
+
className: "text-xs font-semibold capitalize tracking-wide text-muted",
|
|
3371
|
+
children: copy.delivery
|
|
3372
|
+
}),
|
|
3373
|
+
emailResult.status ? /* @__PURE__ */ jsxs("p", {
|
|
3374
|
+
className: "text-xs text-strong",
|
|
3375
|
+
children: [
|
|
3376
|
+
/* @__PURE__ */ jsxs("span", {
|
|
3377
|
+
className: "font-semibold text-foreground",
|
|
3378
|
+
children: [copy.status, ":"]
|
|
3379
|
+
}),
|
|
3380
|
+
" ",
|
|
3381
|
+
emailResult.status
|
|
3382
|
+
]
|
|
3383
|
+
}) : null,
|
|
3384
|
+
emailResult.recipientsCount !== null ? /* @__PURE__ */ jsxs("p", {
|
|
3385
|
+
className: "text-xs text-strong",
|
|
3386
|
+
children: [
|
|
3387
|
+
/* @__PURE__ */ jsxs("span", {
|
|
3388
|
+
className: "font-semibold text-foreground",
|
|
3389
|
+
children: [copy.recipients, ":"]
|
|
3390
|
+
}),
|
|
3391
|
+
" ",
|
|
3392
|
+
emailResult.recipientsCount
|
|
3393
|
+
]
|
|
3394
|
+
}) : null,
|
|
3395
|
+
emailResult.receiptProvider ? /* @__PURE__ */ jsxs("p", {
|
|
3396
|
+
className: "text-xs text-strong",
|
|
3397
|
+
children: [
|
|
3398
|
+
/* @__PURE__ */ jsxs("span", {
|
|
3399
|
+
className: "font-semibold text-foreground",
|
|
3400
|
+
children: [copy.provider, ":"]
|
|
3401
|
+
}),
|
|
3402
|
+
" ",
|
|
3403
|
+
emailResult.receiptProvider
|
|
3404
|
+
]
|
|
3405
|
+
}) : null,
|
|
3406
|
+
emailResult.receiptMessageId ? /* @__PURE__ */ jsxs("p", {
|
|
3407
|
+
className: "break-all text-xs text-strong",
|
|
3408
|
+
children: [
|
|
3409
|
+
/* @__PURE__ */ jsxs("span", {
|
|
3410
|
+
className: "font-semibold text-foreground",
|
|
3411
|
+
children: [copy.messageId, ":"]
|
|
3412
|
+
}),
|
|
3413
|
+
" ",
|
|
3414
|
+
emailResult.receiptMessageId
|
|
3415
|
+
]
|
|
3416
|
+
}) : null,
|
|
3417
|
+
emailResult.receiptRawStatus ? /* @__PURE__ */ jsxs("p", {
|
|
3418
|
+
className: "text-xs text-strong",
|
|
3419
|
+
children: [
|
|
3420
|
+
/* @__PURE__ */ jsxs("span", {
|
|
3421
|
+
className: "font-semibold text-foreground",
|
|
3422
|
+
children: [copy.rawStatus, ":"]
|
|
3423
|
+
}),
|
|
3424
|
+
" ",
|
|
3425
|
+
emailResult.receiptRawStatus
|
|
3426
|
+
]
|
|
3427
|
+
}) : null,
|
|
3428
|
+
emailResult.raw ? /* @__PURE__ */ jsx("p", {
|
|
3429
|
+
className: "whitespace-pre-wrap text-xs text-strong",
|
|
3430
|
+
children: emailResult.raw
|
|
3431
|
+
}) : null
|
|
3432
|
+
]
|
|
3433
|
+
}) : null]
|
|
3434
|
+
}),
|
|
3435
|
+
errorDetails ? /* @__PURE__ */ jsxs("p", {
|
|
3436
|
+
className: "rounded border border-danger-border bg-danger-subtle px-3 py-2 text-xs text-danger-strong",
|
|
3357
3437
|
children: [
|
|
3358
|
-
/* @__PURE__ */
|
|
3359
|
-
className: "
|
|
3360
|
-
children: copy.
|
|
3438
|
+
/* @__PURE__ */ jsxs("span", {
|
|
3439
|
+
className: "font-semibold",
|
|
3440
|
+
children: [copy.errorDetails, ":"]
|
|
3361
3441
|
}),
|
|
3362
|
-
|
|
3363
|
-
|
|
3364
|
-
children: [
|
|
3365
|
-
/* @__PURE__ */ jsxs("span", {
|
|
3366
|
-
className: "font-semibold text-slate-900",
|
|
3367
|
-
children: [copy.status, ":"]
|
|
3368
|
-
}),
|
|
3369
|
-
" ",
|
|
3370
|
-
emailResult.status
|
|
3371
|
-
]
|
|
3372
|
-
}) : null,
|
|
3373
|
-
emailResult.recipientsCount !== null ? /* @__PURE__ */ jsxs("p", {
|
|
3374
|
-
className: "text-xs text-slate-700",
|
|
3375
|
-
children: [
|
|
3376
|
-
/* @__PURE__ */ jsxs("span", {
|
|
3377
|
-
className: "font-semibold text-slate-900",
|
|
3378
|
-
children: [copy.recipients, ":"]
|
|
3379
|
-
}),
|
|
3380
|
-
" ",
|
|
3381
|
-
emailResult.recipientsCount
|
|
3382
|
-
]
|
|
3383
|
-
}) : null,
|
|
3384
|
-
emailResult.receiptProvider ? /* @__PURE__ */ jsxs("p", {
|
|
3385
|
-
className: "text-xs text-slate-700",
|
|
3386
|
-
children: [
|
|
3387
|
-
/* @__PURE__ */ jsxs("span", {
|
|
3388
|
-
className: "font-semibold text-slate-900",
|
|
3389
|
-
children: [copy.provider, ":"]
|
|
3390
|
-
}),
|
|
3391
|
-
" ",
|
|
3392
|
-
emailResult.receiptProvider
|
|
3393
|
-
]
|
|
3394
|
-
}) : null,
|
|
3395
|
-
emailResult.receiptMessageId ? /* @__PURE__ */ jsxs("p", {
|
|
3396
|
-
className: "break-all text-xs text-slate-700",
|
|
3397
|
-
children: [
|
|
3398
|
-
/* @__PURE__ */ jsxs("span", {
|
|
3399
|
-
className: "font-semibold text-slate-900",
|
|
3400
|
-
children: [copy.messageId, ":"]
|
|
3401
|
-
}),
|
|
3402
|
-
" ",
|
|
3403
|
-
emailResult.receiptMessageId
|
|
3404
|
-
]
|
|
3405
|
-
}) : null,
|
|
3406
|
-
emailResult.receiptRawStatus ? /* @__PURE__ */ jsxs("p", {
|
|
3407
|
-
className: "text-xs text-slate-700",
|
|
3408
|
-
children: [
|
|
3409
|
-
/* @__PURE__ */ jsxs("span", {
|
|
3410
|
-
className: "font-semibold text-slate-900",
|
|
3411
|
-
children: [copy.rawStatus, ":"]
|
|
3412
|
-
}),
|
|
3413
|
-
" ",
|
|
3414
|
-
emailResult.receiptRawStatus
|
|
3415
|
-
]
|
|
3416
|
-
}) : null,
|
|
3417
|
-
emailResult.raw ? /* @__PURE__ */ jsx("p", {
|
|
3418
|
-
className: "whitespace-pre-wrap text-xs text-slate-700",
|
|
3419
|
-
children: emailResult.raw
|
|
3420
|
-
}) : null
|
|
3442
|
+
" ",
|
|
3443
|
+
errorDetails
|
|
3421
3444
|
]
|
|
3422
|
-
}) : null
|
|
3423
|
-
|
|
3424
|
-
|
|
3425
|
-
className: "rounded border border-rose-200 bg-rose-50 px-3 py-2 text-xs text-rose-700",
|
|
3426
|
-
children: [
|
|
3427
|
-
/* @__PURE__ */ jsxs("span", {
|
|
3428
|
-
className: "font-semibold",
|
|
3429
|
-
children: [copy.errorDetails, ":"]
|
|
3430
|
-
}),
|
|
3431
|
-
" ",
|
|
3432
|
-
errorDetails
|
|
3433
|
-
]
|
|
3434
|
-
}) : null
|
|
3435
|
-
]
|
|
3445
|
+
}) : null
|
|
3446
|
+
]
|
|
3447
|
+
})]
|
|
3436
3448
|
});
|
|
3437
3449
|
}
|
|
3438
3450
|
|
|
@@ -3507,15 +3519,15 @@ function ToolResultExternalDatasourceCard({ part, className, locale }) {
|
|
|
3507
3519
|
const sqlQuery = toStringOrNull(part.metadata?.sql_query);
|
|
3508
3520
|
const table = normalizeTable(getTableValue(part), copy);
|
|
3509
3521
|
const errorDetails = formatToolErrorDetails(part.errorDetails);
|
|
3510
|
-
const statusClass = part.state === "error" ? "text-
|
|
3522
|
+
const statusClass = part.state === "error" ? "text-danger" : part.state === "pending" ? "text-warning" : "text-success";
|
|
3511
3523
|
return /* @__PURE__ */ jsxs(Sheet, { children: [/* @__PURE__ */ jsx(SheetTrigger, {
|
|
3512
3524
|
"aria-label": `${copy.externalDatasource}: ${getUiStatusLabel(part.state, copy)}`,
|
|
3513
|
-
className: joinClasses("w-full overflow-hidden rounded-lg border border-
|
|
3525
|
+
className: joinClasses("plai-tool-result-external-datasource-card w-full overflow-hidden rounded-lg border border-border bg-surface text-left font-normal text-foreground transition-colors hover:bg-surface-muted focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-ring", className),
|
|
3514
3526
|
children: /* @__PURE__ */ jsxs("span", {
|
|
3515
3527
|
className: "flex items-center gap-2 px-3 py-2 text-sm",
|
|
3516
3528
|
children: [
|
|
3517
3529
|
/* @__PURE__ */ jsx(Database, {
|
|
3518
|
-
className: "h-4 w-4 shrink-0 text-
|
|
3530
|
+
className: "h-4 w-4 shrink-0 text-muted",
|
|
3519
3531
|
"aria-hidden": "true"
|
|
3520
3532
|
}),
|
|
3521
3533
|
/* @__PURE__ */ jsx("span", {
|
|
@@ -3551,14 +3563,14 @@ function ToolResultExternalDatasourceCard({ part, className, locale }) {
|
|
|
3551
3563
|
children: [/* @__PURE__ */ jsxs("div", {
|
|
3552
3564
|
className: "flex items-center gap-2",
|
|
3553
3565
|
children: [/* @__PURE__ */ jsx(Database, {
|
|
3554
|
-
className: "h-5 w-5 text-
|
|
3566
|
+
className: "h-5 w-5 text-info",
|
|
3555
3567
|
"aria-hidden": "true"
|
|
3556
3568
|
}), /* @__PURE__ */ jsx("h3", {
|
|
3557
3569
|
className: "text-sm font-medium",
|
|
3558
3570
|
children: copy.sqlQuery
|
|
3559
3571
|
})]
|
|
3560
3572
|
}), /* @__PURE__ */ jsx("pre", {
|
|
3561
|
-
className: "overflow-x-auto rounded-md border border-
|
|
3573
|
+
className: "overflow-x-auto rounded-md border border-border bg-surface-muted p-3 text-xs leading-5 text-strong",
|
|
3562
3574
|
children: sqlQuery
|
|
3563
3575
|
})]
|
|
3564
3576
|
}) : null,
|
|
@@ -3568,22 +3580,22 @@ function ToolResultExternalDatasourceCard({ part, className, locale }) {
|
|
|
3568
3580
|
className: "text-sm font-medium",
|
|
3569
3581
|
children: copy.queryResults
|
|
3570
3582
|
}), /* @__PURE__ */ jsx("div", {
|
|
3571
|
-
className: "overflow-x-auto rounded-md border border-
|
|
3583
|
+
className: "overflow-x-auto rounded-md border border-border",
|
|
3572
3584
|
children: /* @__PURE__ */ jsxs("table", {
|
|
3573
3585
|
className: "w-full border-collapse text-left text-xs",
|
|
3574
3586
|
children: [/* @__PURE__ */ jsx("thead", {
|
|
3575
|
-
className: "bg-
|
|
3587
|
+
className: "bg-surface-muted text-secondary",
|
|
3576
3588
|
children: /* @__PURE__ */ jsx("tr", { children: table.columns.map((column) => /* @__PURE__ */ jsx("th", {
|
|
3577
|
-
className: "max-w-56 truncate border-b border-
|
|
3589
|
+
className: "max-w-56 truncate border-b border-border px-3 py-2 font-medium",
|
|
3578
3590
|
title: column,
|
|
3579
3591
|
children: column
|
|
3580
3592
|
}, column)) })
|
|
3581
3593
|
}), /* @__PURE__ */ jsx("tbody", { children: table.rows.map((row) => /* @__PURE__ */ jsx("tr", {
|
|
3582
|
-
className: "border-b border-
|
|
3594
|
+
className: "border-b border-divider last:border-0",
|
|
3583
3595
|
children: table.columns.map((column, columnIndex) => {
|
|
3584
3596
|
const value = formatCell(row[columnIndex]);
|
|
3585
3597
|
return /* @__PURE__ */ jsx("td", {
|
|
3586
|
-
className: "max-w-56 truncate px-3 py-2 text-
|
|
3598
|
+
className: "max-w-56 truncate px-3 py-2 text-strong",
|
|
3587
3599
|
title: value,
|
|
3588
3600
|
children: value
|
|
3589
3601
|
}, column);
|
|
@@ -3592,11 +3604,11 @@ function ToolResultExternalDatasourceCard({ part, className, locale }) {
|
|
|
3592
3604
|
})
|
|
3593
3605
|
})]
|
|
3594
3606
|
}) : part.state === "completed" && !errorDetails ? /* @__PURE__ */ jsx("p", {
|
|
3595
|
-
className: "text-sm text-
|
|
3607
|
+
className: "text-sm text-secondary",
|
|
3596
3608
|
children: copy.noDataToDisplay
|
|
3597
3609
|
}) : null,
|
|
3598
3610
|
errorDetails ? /* @__PURE__ */ jsxs("p", {
|
|
3599
|
-
className: "rounded border border-
|
|
3611
|
+
className: "rounded border border-danger-border bg-danger-subtle px-3 py-2 text-xs text-danger-strong",
|
|
3600
3612
|
children: [
|
|
3601
3613
|
/* @__PURE__ */ jsxs("span", {
|
|
3602
3614
|
className: "font-semibold",
|
|
@@ -3632,12 +3644,12 @@ function ToolResultHttpRequestCard({ part, className, locale }) {
|
|
|
3632
3644
|
const status = statusCode ? `${statusCode}${metadata?.status_reason ? ` ${metadata.status_reason}` : ""}` : getUiStatusLabel(part.state, copy);
|
|
3633
3645
|
return /* @__PURE__ */ jsxs(Sheet, { children: [/* @__PURE__ */ jsx(SheetTrigger, {
|
|
3634
3646
|
"aria-label": `${copy.httpRequest}: ${status}`,
|
|
3635
|
-
className: joinClasses("w-full rounded-lg border border-
|
|
3647
|
+
className: joinClasses("plai-tool-result-http-request-card w-full rounded-lg border border-border bg-surface text-left font-normal text-foreground transition-colors hover:bg-surface-muted focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-ring", className),
|
|
3636
3648
|
children: /* @__PURE__ */ jsxs("span", {
|
|
3637
3649
|
className: "flex items-center gap-2 px-3 py-2 text-sm",
|
|
3638
3650
|
children: [
|
|
3639
3651
|
/* @__PURE__ */ jsx(Globe, {
|
|
3640
|
-
className: "h-4 w-4 shrink-0 text-
|
|
3652
|
+
className: "h-4 w-4 shrink-0 text-muted",
|
|
3641
3653
|
"aria-hidden": "true"
|
|
3642
3654
|
}),
|
|
3643
3655
|
/* @__PURE__ */ jsx("span", {
|
|
@@ -3645,11 +3657,11 @@ function ToolResultHttpRequestCard({ part, className, locale }) {
|
|
|
3645
3657
|
children: metadata?.method ?? "HTTP"
|
|
3646
3658
|
}),
|
|
3647
3659
|
/* @__PURE__ */ jsx("span", {
|
|
3648
|
-
className: "min-w-0 truncate text-
|
|
3660
|
+
className: "min-w-0 truncate text-secondary",
|
|
3649
3661
|
children: metadata?.url ?? part.name
|
|
3650
3662
|
}),
|
|
3651
3663
|
/* @__PURE__ */ jsx("span", {
|
|
3652
|
-
className: joinClasses("ml-auto shrink-0", failed ? "text-
|
|
3664
|
+
className: joinClasses("ml-auto shrink-0", failed ? "text-danger" : "text-success"),
|
|
3653
3665
|
children: failed ? /* @__PURE__ */ jsx(XCircle, {
|
|
3654
3666
|
className: "h-4 w-4",
|
|
3655
3667
|
"aria-hidden": "true"
|
|
@@ -3673,25 +3685,25 @@ function ToolResultHttpRequestCard({ part, className, locale }) {
|
|
|
3673
3685
|
className: "grid gap-2 text-sm",
|
|
3674
3686
|
children: [
|
|
3675
3687
|
/* @__PURE__ */ jsxs("div", { children: [/* @__PURE__ */ jsx("dt", {
|
|
3676
|
-
className: "text-xs text-
|
|
3688
|
+
className: "text-xs text-muted",
|
|
3677
3689
|
children: copy.status
|
|
3678
3690
|
}), /* @__PURE__ */ jsx("dd", { children: status })] }),
|
|
3679
3691
|
metadata?.url ? /* @__PURE__ */ jsxs("div", { children: [/* @__PURE__ */ jsx("dt", {
|
|
3680
|
-
className: "text-xs text-
|
|
3692
|
+
className: "text-xs text-muted",
|
|
3681
3693
|
children: copy.requestUrl
|
|
3682
3694
|
}), /* @__PURE__ */ jsx("dd", {
|
|
3683
3695
|
className: "break-all",
|
|
3684
3696
|
children: metadata.url
|
|
3685
3697
|
})] }) : null,
|
|
3686
3698
|
metadata?.response_url && metadata.response_url !== metadata.url ? /* @__PURE__ */ jsxs("div", { children: [/* @__PURE__ */ jsx("dt", {
|
|
3687
|
-
className: "text-xs text-
|
|
3699
|
+
className: "text-xs text-muted",
|
|
3688
3700
|
children: copy.responseUrl
|
|
3689
3701
|
}), /* @__PURE__ */ jsx("dd", {
|
|
3690
3702
|
className: "break-all",
|
|
3691
3703
|
children: metadata.response_url
|
|
3692
3704
|
})] }) : null,
|
|
3693
3705
|
metadata?.content_type ? /* @__PURE__ */ jsxs("div", { children: [/* @__PURE__ */ jsx("dt", {
|
|
3694
|
-
className: "text-xs text-
|
|
3706
|
+
className: "text-xs text-muted",
|
|
3695
3707
|
children: copy.contentType
|
|
3696
3708
|
}), /* @__PURE__ */ jsx("dd", { children: metadata.content_type })] }) : null
|
|
3697
3709
|
]
|
|
@@ -3700,18 +3712,18 @@ function ToolResultHttpRequestCard({ part, className, locale }) {
|
|
|
3700
3712
|
className: "mb-2 text-sm font-medium",
|
|
3701
3713
|
children: copy.response
|
|
3702
3714
|
}), /* @__PURE__ */ jsx("pre", {
|
|
3703
|
-
className: "overflow-x-auto rounded-md border border-
|
|
3715
|
+
className: "overflow-x-auto rounded-md border border-border bg-surface-muted p-3 text-xs leading-5",
|
|
3704
3716
|
children: response
|
|
3705
3717
|
})] }) : null,
|
|
3706
3718
|
metadata?.response_headers && Object.keys(metadata.response_headers).length ? /* @__PURE__ */ jsxs("details", { children: [/* @__PURE__ */ jsx("summary", {
|
|
3707
3719
|
className: "cursor-pointer text-sm font-medium",
|
|
3708
3720
|
children: copy.responseHeaders
|
|
3709
3721
|
}), /* @__PURE__ */ jsx("pre", {
|
|
3710
|
-
className: "mt-2 overflow-x-auto rounded-md border border-
|
|
3722
|
+
className: "mt-2 overflow-x-auto rounded-md border border-border bg-surface-muted p-3 text-xs",
|
|
3711
3723
|
children: JSON.stringify(metadata.response_headers, null, 2)
|
|
3712
3724
|
})] }) : null,
|
|
3713
3725
|
errorDetails ? /* @__PURE__ */ jsxs("p", {
|
|
3714
|
-
className: "rounded border border-
|
|
3726
|
+
className: "rounded border border-danger-border bg-danger-subtle px-3 py-2 text-xs text-danger-strong",
|
|
3715
3727
|
children: [
|
|
3716
3728
|
/* @__PURE__ */ jsxs("span", {
|
|
3717
3729
|
className: "font-semibold",
|
|
@@ -3747,12 +3759,12 @@ function ToolResultMcpCard({ part, className, locale }) {
|
|
|
3747
3759
|
const failed = part.state === "error";
|
|
3748
3760
|
return /* @__PURE__ */ jsxs(Sheet, { children: [/* @__PURE__ */ jsx(SheetTrigger, {
|
|
3749
3761
|
"aria-label": `${copy.mcpTool}: ${tool}`,
|
|
3750
|
-
className: joinClasses("w-full rounded-lg border border-
|
|
3762
|
+
className: joinClasses("plai-tool-result-mcp-card w-full rounded-lg border border-border bg-surface text-left font-normal text-foreground transition-colors hover:bg-surface-muted focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-ring", className),
|
|
3751
3763
|
children: /* @__PURE__ */ jsxs("span", {
|
|
3752
3764
|
className: "flex items-center gap-2 px-3 py-2 text-sm",
|
|
3753
3765
|
children: [
|
|
3754
3766
|
/* @__PURE__ */ jsx(Plug, {
|
|
3755
|
-
className: "h-4 w-4 shrink-0 text-
|
|
3767
|
+
className: "h-4 w-4 shrink-0 text-muted",
|
|
3756
3768
|
"aria-hidden": "true"
|
|
3757
3769
|
}),
|
|
3758
3770
|
/* @__PURE__ */ jsx("span", {
|
|
@@ -3760,11 +3772,11 @@ function ToolResultMcpCard({ part, className, locale }) {
|
|
|
3760
3772
|
children: "MCP"
|
|
3761
3773
|
}),
|
|
3762
3774
|
/* @__PURE__ */ jsx("span", {
|
|
3763
|
-
className: "min-w-0 truncate border-
|
|
3775
|
+
className: "min-w-0 truncate border-border-strong border px-2 py-0.5 rounded-md text-xs text-muted",
|
|
3764
3776
|
children: tool
|
|
3765
3777
|
}),
|
|
3766
3778
|
/* @__PURE__ */ jsx("span", {
|
|
3767
|
-
className: joinClasses("ml-auto shrink-0", failed ? "text-
|
|
3779
|
+
className: joinClasses("ml-auto shrink-0", failed ? "text-danger" : "text-success"),
|
|
3768
3780
|
children: failed ? /* @__PURE__ */ jsx(XCircle, {
|
|
3769
3781
|
className: "h-4 w-4",
|
|
3770
3782
|
"aria-hidden": "true"
|
|
@@ -3787,10 +3799,10 @@ function ToolResultMcpCard({ part, className, locale }) {
|
|
|
3787
3799
|
/* @__PURE__ */ jsxs("dl", {
|
|
3788
3800
|
className: "grid gap-2 text-sm",
|
|
3789
3801
|
children: [/* @__PURE__ */ jsxs("div", { children: [/* @__PURE__ */ jsx("dt", {
|
|
3790
|
-
className: "text-xs text-
|
|
3802
|
+
className: "text-xs text-muted",
|
|
3791
3803
|
children: copy.tool
|
|
3792
3804
|
}), /* @__PURE__ */ jsx("dd", { children: tool })] }), server ? /* @__PURE__ */ jsxs("div", { children: [/* @__PURE__ */ jsx("dt", {
|
|
3793
|
-
className: "text-xs text-
|
|
3805
|
+
className: "text-xs text-muted",
|
|
3794
3806
|
children: copy.server
|
|
3795
3807
|
}), /* @__PURE__ */ jsx("dd", {
|
|
3796
3808
|
className: "break-all",
|
|
@@ -3801,11 +3813,11 @@ function ToolResultMcpCard({ part, className, locale }) {
|
|
|
3801
3813
|
className: "mb-2 text-sm font-medium",
|
|
3802
3814
|
children: copy.result
|
|
3803
3815
|
}), /* @__PURE__ */ jsx("pre", {
|
|
3804
|
-
className: "overflow-x-auto rounded-md border border-
|
|
3816
|
+
className: "overflow-x-auto rounded-md border border-border bg-surface-muted p-3 text-xs leading-5",
|
|
3805
3817
|
children: result
|
|
3806
3818
|
})] }) : null,
|
|
3807
3819
|
error ? /* @__PURE__ */ jsxs("p", {
|
|
3808
|
-
className: "rounded border border-
|
|
3820
|
+
className: "rounded border border-danger-border bg-danger-subtle px-3 py-2 text-xs text-danger-strong",
|
|
3809
3821
|
children: [
|
|
3810
3822
|
/* @__PURE__ */ jsxs("span", {
|
|
3811
3823
|
className: "font-semibold",
|
|
@@ -3877,7 +3889,7 @@ function FileDownloadButton({ file, label, copy, className }) {
|
|
|
3877
3889
|
className: "ml-auto flex shrink-0 items-center gap-2",
|
|
3878
3890
|
children: [state === "error" ? /* @__PURE__ */ jsx("span", {
|
|
3879
3891
|
role: "alert",
|
|
3880
|
-
className: "text-xs text-
|
|
3892
|
+
className: "text-xs text-danger",
|
|
3881
3893
|
children: copy.downloadFailed
|
|
3882
3894
|
}) : null, /* @__PURE__ */ jsx("button", {
|
|
3883
3895
|
type: "button",
|
|
@@ -3885,7 +3897,7 @@ function FileDownloadButton({ file, label, copy, className }) {
|
|
|
3885
3897
|
disabled: isDownloading,
|
|
3886
3898
|
"aria-label": `${isDownloading ? copy.downloading : copy.download}: ${label}`,
|
|
3887
3899
|
title: isDownloading ? copy.downloading : copy.download,
|
|
3888
|
-
className: joinClasses("inline-flex h-8 w-8 items-center justify-center rounded-md border border-
|
|
3900
|
+
className: joinClasses("inline-flex h-8 w-8 items-center justify-center rounded-md border border-border bg-surface text-strong transition-colors hover:bg-surface-subtle focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-ring disabled:cursor-wait disabled:opacity-60", className),
|
|
3889
3901
|
children: isDownloading ? /* @__PURE__ */ jsx(LoaderCircle, {
|
|
3890
3902
|
className: "h-4 w-4 animate-spin",
|
|
3891
3903
|
"aria-hidden": "true"
|
|
@@ -3914,14 +3926,14 @@ function ToolResultOfficeDocumentsCard({ part, className, locale }) {
|
|
|
3914
3926
|
const files = getFiles(part);
|
|
3915
3927
|
const errorDetails = formatToolErrorDetails(part.errorDetails);
|
|
3916
3928
|
const fileLabel = files.length === 1 ? copy.file : copy.files;
|
|
3917
|
-
const statusClass = part.state === "error" ? "text-
|
|
3929
|
+
const statusClass = part.state === "error" ? "text-danger" : part.state === "pending" ? "text-warning" : "text-success";
|
|
3918
3930
|
const singleFile = part.state === "completed" && files.length === 1 && !errorDetails ? files[0] : void 0;
|
|
3919
3931
|
if (singleFile) {
|
|
3920
3932
|
const extension = getExtension(singleFile);
|
|
3921
3933
|
const label = getLabel(singleFile);
|
|
3922
3934
|
return /* @__PURE__ */ jsxs("section", {
|
|
3923
3935
|
"aria-label": `${copy.officeDocuments}: ${label}`,
|
|
3924
|
-
className: joinClasses("flex w-full items-center gap-3 overflow-hidden rounded-lg border border-
|
|
3936
|
+
className: joinClasses("plai-tool-result-office-documents-card flex w-full items-center gap-3 overflow-hidden rounded-lg border border-border bg-surface px-3 py-2 text-left font-normal text-foreground", className),
|
|
3925
3937
|
children: [
|
|
3926
3938
|
/* @__PURE__ */ jsx(File, {
|
|
3927
3939
|
className: joinClasses("h-6 w-6 shrink-0", getFileIconClass(extension)),
|
|
@@ -3933,7 +3945,7 @@ function ToolResultOfficeDocumentsCard({ part, className, locale }) {
|
|
|
3933
3945
|
className: "truncate text-sm font-medium",
|
|
3934
3946
|
children: label
|
|
3935
3947
|
}), /* @__PURE__ */ jsxs("p", {
|
|
3936
|
-
className: "truncate text-[11px] text-
|
|
3948
|
+
className: "truncate text-[11px] text-muted",
|
|
3937
3949
|
children: [copy.officeDocuments, extension ? ` · ${extension.toUpperCase()}` : null]
|
|
3938
3950
|
})]
|
|
3939
3951
|
}),
|
|
@@ -3945,7 +3957,7 @@ function ToolResultOfficeDocumentsCard({ part, className, locale }) {
|
|
|
3945
3957
|
label,
|
|
3946
3958
|
copy
|
|
3947
3959
|
}) : /* @__PURE__ */ jsx(CheckCircle2, {
|
|
3948
|
-
className: "ml-auto h-4 w-4 shrink-0 text-
|
|
3960
|
+
className: "ml-auto h-4 w-4 shrink-0 text-success",
|
|
3949
3961
|
"aria-hidden": "true"
|
|
3950
3962
|
})
|
|
3951
3963
|
]
|
|
@@ -3953,12 +3965,12 @@ function ToolResultOfficeDocumentsCard({ part, className, locale }) {
|
|
|
3953
3965
|
}
|
|
3954
3966
|
return /* @__PURE__ */ jsxs(Sheet, { children: [/* @__PURE__ */ jsx(SheetTrigger, {
|
|
3955
3967
|
"aria-label": `${copy.officeDocuments}: ${files.length} ${fileLabel}`,
|
|
3956
|
-
className: joinClasses("w-full overflow-hidden rounded-lg border border-
|
|
3968
|
+
className: joinClasses("plai-tool-result-office-documents-card w-full overflow-hidden rounded-lg border border-border bg-surface text-left font-normal text-foreground transition-colors hover:bg-surface-muted focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-ring", className),
|
|
3957
3969
|
children: /* @__PURE__ */ jsxs("span", {
|
|
3958
3970
|
className: "flex items-center gap-2 px-3 py-2 text-sm",
|
|
3959
3971
|
children: [
|
|
3960
3972
|
/* @__PURE__ */ jsx(FileText, {
|
|
3961
|
-
className: "h-4 w-4 shrink-0 text-
|
|
3973
|
+
className: "h-4 w-4 shrink-0 text-muted",
|
|
3962
3974
|
"aria-hidden": "true"
|
|
3963
3975
|
}),
|
|
3964
3976
|
/* @__PURE__ */ jsx("span", {
|
|
@@ -3966,7 +3978,7 @@ function ToolResultOfficeDocumentsCard({ part, className, locale }) {
|
|
|
3966
3978
|
children: copy.officeDocuments
|
|
3967
3979
|
}),
|
|
3968
3980
|
/* @__PURE__ */ jsx("span", {
|
|
3969
|
-
className: "min-w-0 truncate border-
|
|
3981
|
+
className: "min-w-0 truncate border-border-strong border px-2 py-0.5 rounded-md text-xs text-muted",
|
|
3970
3982
|
children: part.state === "pending" ? copy.pending : `${files.length} ${fileLabel}`
|
|
3971
3983
|
}),
|
|
3972
3984
|
/* @__PURE__ */ jsx("span", {
|
|
@@ -3994,7 +4006,7 @@ function ToolResultOfficeDocumentsCard({ part, className, locale }) {
|
|
|
3994
4006
|
const extension = getExtension(file);
|
|
3995
4007
|
const label = getLabel(file);
|
|
3996
4008
|
return /* @__PURE__ */ jsxs("div", {
|
|
3997
|
-
className: "flex items-center gap-3 rounded-lg border border-
|
|
4009
|
+
className: "flex items-center gap-3 rounded-lg border border-border bg-surface p-3",
|
|
3998
4010
|
children: [
|
|
3999
4011
|
/* @__PURE__ */ jsx(File, {
|
|
4000
4012
|
className: joinClasses("h-8 w-8 shrink-0", getFileIconClass(extension)),
|
|
@@ -4006,7 +4018,7 @@ function ToolResultOfficeDocumentsCard({ part, className, locale }) {
|
|
|
4006
4018
|
className: "truncate text-sm font-medium",
|
|
4007
4019
|
children: label
|
|
4008
4020
|
}), extension ? /* @__PURE__ */ jsx("p", {
|
|
4009
|
-
className: "text-[11px] uppercase text-
|
|
4021
|
+
className: "text-[11px] uppercase text-muted",
|
|
4010
4022
|
children: extension
|
|
4011
4023
|
}) : null]
|
|
4012
4024
|
}),
|
|
@@ -4022,15 +4034,15 @@ function ToolResultOfficeDocumentsCard({ part, className, locale }) {
|
|
|
4022
4034
|
}, file.id);
|
|
4023
4035
|
}),
|
|
4024
4036
|
files.length === 0 && part.state === "pending" ? /* @__PURE__ */ jsx("p", {
|
|
4025
|
-
className: "text-sm text-
|
|
4037
|
+
className: "text-sm text-secondary",
|
|
4026
4038
|
children: copy.creatingDocuments
|
|
4027
4039
|
}) : null,
|
|
4028
4040
|
files.length === 0 && part.state === "completed" && !errorDetails ? /* @__PURE__ */ jsx("p", {
|
|
4029
|
-
className: "text-sm text-
|
|
4041
|
+
className: "text-sm text-secondary",
|
|
4030
4042
|
children: copy.noFilesGenerated
|
|
4031
4043
|
}) : null,
|
|
4032
4044
|
errorDetails ? /* @__PURE__ */ jsxs("p", {
|
|
4033
|
-
className: "rounded border border-
|
|
4045
|
+
className: "rounded border border-danger-border bg-danger-subtle px-3 py-2 text-xs text-danger-strong",
|
|
4034
4046
|
children: [
|
|
4035
4047
|
/* @__PURE__ */ jsxs("span", {
|
|
4036
4048
|
className: "font-semibold",
|
|
@@ -4824,11 +4836,11 @@ function statusLabel(status, copy) {
|
|
|
4824
4836
|
return key ? copy[key] : null;
|
|
4825
4837
|
}
|
|
4826
4838
|
const BADGE_TONE = {
|
|
4827
|
-
pending: "border-
|
|
4839
|
+
pending: "border-warning-border bg-warning-subtle text-warning-strong",
|
|
4828
4840
|
executing: "border-sky-200 bg-sky-50 text-sky-800",
|
|
4829
|
-
executed: "border-
|
|
4830
|
-
failed: "border-
|
|
4831
|
-
unknown: "border-
|
|
4841
|
+
executed: "border-success-border bg-success-subtle text-success-strong",
|
|
4842
|
+
failed: "border-danger-border bg-danger-subtle text-danger-strong",
|
|
4843
|
+
unknown: "border-warning-border bg-warning-subtle text-warning-strong"
|
|
4832
4844
|
};
|
|
4833
4845
|
/** Header badge of a held action: "Awaiting your confirmation" or its outcome. */
|
|
4834
4846
|
function ConfirmationBadge({ state, copy }) {
|
|
@@ -4836,7 +4848,7 @@ function ConfirmationBadge({ state, copy }) {
|
|
|
4836
4848
|
const label = status === "pending" ? copy.awaitingConfirmation : statusLabel(status, copy);
|
|
4837
4849
|
const Icon = status === "executed" ? CheckCircle2 : status === "failed" ? XCircle : status === "executing" ? LoaderCircle : Clock;
|
|
4838
4850
|
return /* @__PURE__ */ jsxs("span", {
|
|
4839
|
-
className: joinClasses("ml-auto inline-flex shrink-0 items-center gap-1 rounded-full border px-2 py-0.5 font-medium", BADGE_TONE[status] ?? "border-
|
|
4851
|
+
className: joinClasses("ml-auto inline-flex shrink-0 items-center gap-1 rounded-full border px-2 py-0.5 font-medium", BADGE_TONE[status] ?? "border-border bg-surface-muted text-strong"),
|
|
4840
4852
|
"data-confirmation-status": status,
|
|
4841
4853
|
children: [/* @__PURE__ */ jsx(Icon, {
|
|
4842
4854
|
className: joinClasses("h-3 w-3", status === "executing" ? "animate-spin" : void 0),
|
|
@@ -4860,18 +4872,18 @@ function PendingConfirmationFooter({ pending, toolConfirmation, copy }) {
|
|
|
4860
4872
|
const [sending, setSending] = useState(null);
|
|
4861
4873
|
const [failed, setFailed] = useState(false);
|
|
4862
4874
|
if (!toolConfirmation) return /* @__PURE__ */ jsx("p", {
|
|
4863
|
-
className: "border-t border-
|
|
4875
|
+
className: "border-t border-border bg-warning-subtle/60 px-3 py-2 text-xs text-strong",
|
|
4864
4876
|
children: copy.confirmHint
|
|
4865
4877
|
});
|
|
4866
4878
|
if (!state) return /* @__PURE__ */ jsx("p", {
|
|
4867
|
-
className: "border-t border-
|
|
4879
|
+
className: "border-t border-divider bg-surface-muted px-3 py-2 text-xs text-muted",
|
|
4868
4880
|
"aria-live": "polite",
|
|
4869
4881
|
children: copy.verifying
|
|
4870
4882
|
});
|
|
4871
4883
|
if (state.status !== "pending") {
|
|
4872
4884
|
const label = statusLabel(state.status, copy);
|
|
4873
4885
|
return label ? /* @__PURE__ */ jsxs("p", {
|
|
4874
|
-
className: "border-t border-
|
|
4886
|
+
className: "border-t border-divider bg-surface-muted px-3 py-2 text-xs text-strong",
|
|
4875
4887
|
"aria-live": "polite",
|
|
4876
4888
|
children: [label, state.status === "failed" && state.error ? `: ${state.error}` : null]
|
|
4877
4889
|
}) : null;
|
|
@@ -4895,14 +4907,14 @@ function PendingConfirmationFooter({ pending, toolConfirmation, copy }) {
|
|
|
4895
4907
|
const expiry = expiryText(state, toolConfirmation.states.serverOffsetMs, now, copy);
|
|
4896
4908
|
const unavailable = state.error === "tool_unavailable";
|
|
4897
4909
|
return /* @__PURE__ */ jsxs("div", {
|
|
4898
|
-
className: "flex flex-wrap items-center gap-2 border-t border-
|
|
4910
|
+
className: "flex flex-wrap items-center gap-2 border-t border-border bg-warning-subtle/60 px-3 py-2",
|
|
4899
4911
|
"data-confirmation-actions": pending.action_id,
|
|
4900
4912
|
children: [
|
|
4901
4913
|
state.canConfirm ? /* @__PURE__ */ jsxs("button", {
|
|
4902
4914
|
type: "button",
|
|
4903
4915
|
disabled,
|
|
4904
4916
|
onClick: () => void decide("confirm"),
|
|
4905
|
-
className: joinClasses("inline-flex items-center rounded-md px-3 py-1.5 text-xs font-medium text-
|
|
4917
|
+
className: joinClasses("inline-flex items-center rounded-md px-3 py-1.5 text-xs font-medium text-inverse-foreground disabled:opacity-50", destructive ? "bg-danger hover:bg-danger-strong" : "bg-inverse hover:bg-inverse-hover"),
|
|
4906
4918
|
children: [sending === "confirm" ? /* @__PURE__ */ jsx(LoaderCircle, {
|
|
4907
4919
|
className: "mr-2 size-3 animate-spin",
|
|
4908
4920
|
"aria-hidden": "true"
|
|
@@ -4912,14 +4924,14 @@ function PendingConfirmationFooter({ pending, toolConfirmation, copy }) {
|
|
|
4912
4924
|
type: "button",
|
|
4913
4925
|
disabled,
|
|
4914
4926
|
onClick: () => void decide("reject"),
|
|
4915
|
-
className: "inline-flex items-center rounded-md border border-
|
|
4927
|
+
className: "inline-flex items-center rounded-md border border-border-strong bg-surface px-3 py-1.5 text-xs font-medium text-strong hover:bg-surface-muted disabled:opacity-50",
|
|
4916
4928
|
children: [sending === "reject" ? /* @__PURE__ */ jsx(LoaderCircle, {
|
|
4917
4929
|
className: "mr-2 size-3 animate-spin",
|
|
4918
4930
|
"aria-hidden": "true"
|
|
4919
4931
|
}) : null, sending === "reject" ? copy.cancelling : copy.cancel]
|
|
4920
4932
|
}) : null,
|
|
4921
4933
|
/* @__PURE__ */ jsx("span", {
|
|
4922
|
-
className: "ml-auto text-xs text-
|
|
4934
|
+
className: "ml-auto text-xs text-secondary",
|
|
4923
4935
|
"aria-live": "polite",
|
|
4924
4936
|
children: failed ? copy.decisionError : unavailable ? copy.toolUnavailable : expiry
|
|
4925
4937
|
})
|
|
@@ -5054,7 +5066,7 @@ function ExternalAnchor({ href, className, children, label }) {
|
|
|
5054
5066
|
target: "_blank",
|
|
5055
5067
|
rel: "noreferrer noopener",
|
|
5056
5068
|
"aria-label": label,
|
|
5057
|
-
className: joinClasses("inline-flex items-center gap-1 text-xs font-medium text-
|
|
5069
|
+
className: joinClasses("inline-flex items-center gap-1 text-xs font-medium text-strong hover:text-muted", className),
|
|
5058
5070
|
children
|
|
5059
5071
|
});
|
|
5060
5072
|
}
|
|
@@ -5063,7 +5075,7 @@ function ShowAllToggle({ total, expanded, onToggle, copy }) {
|
|
|
5063
5075
|
return /* @__PURE__ */ jsx("button", {
|
|
5064
5076
|
type: "button",
|
|
5065
5077
|
onClick: onToggle,
|
|
5066
|
-
className: "w-full border-t border-
|
|
5078
|
+
className: "w-full border-t border-border px-3 py-2 text-left text-xs font-medium text-secondary hover:bg-surface-muted hover:text-foreground",
|
|
5067
5079
|
children: expanded ? copy.showLess : fillCopy(copy.showAll, { count: total })
|
|
5068
5080
|
});
|
|
5069
5081
|
}
|
|
@@ -5074,24 +5086,24 @@ function MailRow({ message, locale, copy }) {
|
|
|
5074
5086
|
children: [
|
|
5075
5087
|
/* @__PURE__ */ jsx("span", {
|
|
5076
5088
|
"aria-label": message.unread ? copy.unread : void 0,
|
|
5077
|
-
className: joinClasses("h-2 w-2 shrink-0 self-center rounded-full", message.unread ? "bg-
|
|
5089
|
+
className: joinClasses("h-2 w-2 shrink-0 self-center rounded-full", message.unread ? "bg-info" : "bg-transparent")
|
|
5078
5090
|
}),
|
|
5079
5091
|
/* @__PURE__ */ jsx("span", {
|
|
5080
|
-
className: joinClasses("min-w-0 flex-1 truncate text-sm", message.unread ? "font-semibold text-
|
|
5092
|
+
className: joinClasses("min-w-0 flex-1 truncate text-sm", message.unread ? "font-semibold text-foreground" : "text-strong"),
|
|
5081
5093
|
children: displayName(message.from) ?? "—"
|
|
5082
5094
|
}),
|
|
5083
5095
|
/* @__PURE__ */ jsx("span", {
|
|
5084
|
-
className: "shrink-0 text-xs text-
|
|
5096
|
+
className: "shrink-0 text-xs text-muted",
|
|
5085
5097
|
children: formatMailDate(message.date, locale)
|
|
5086
5098
|
})
|
|
5087
5099
|
]
|
|
5088
5100
|
}),
|
|
5089
5101
|
/* @__PURE__ */ jsx("p", {
|
|
5090
|
-
className: joinClasses("truncate pl-4 text-sm", message.unread ? "font-medium text-
|
|
5102
|
+
className: joinClasses("truncate pl-4 text-sm", message.unread ? "font-medium text-foreground" : "text-strong"),
|
|
5091
5103
|
children: text(message.subject) ?? copy.noSubject
|
|
5092
5104
|
}),
|
|
5093
5105
|
text(message.snippet) ? /* @__PURE__ */ jsx("p", {
|
|
5094
|
-
className: "line-clamp-1 pl-4 text-xs text-
|
|
5106
|
+
className: "line-clamp-1 pl-4 text-xs text-muted",
|
|
5095
5107
|
children: message.snippet
|
|
5096
5108
|
}) : null
|
|
5097
5109
|
] });
|
|
@@ -5100,7 +5112,7 @@ function MailRow({ message, locale, copy }) {
|
|
|
5100
5112
|
href: message.link,
|
|
5101
5113
|
target: "_blank",
|
|
5102
5114
|
rel: "noreferrer noopener",
|
|
5103
|
-
className: joinClasses(className, "hover:bg-
|
|
5115
|
+
className: joinClasses(className, "hover:bg-surface-muted"),
|
|
5104
5116
|
children: content
|
|
5105
5117
|
}) : /* @__PURE__ */ jsx("div", {
|
|
5106
5118
|
className,
|
|
@@ -5110,11 +5122,11 @@ function MailRow({ message, locale, copy }) {
|
|
|
5110
5122
|
function MailList({ messages, locale, copy }) {
|
|
5111
5123
|
const [expanded, setExpanded] = useState(false);
|
|
5112
5124
|
if (messages.length === 0) return /* @__PURE__ */ jsx("p", {
|
|
5113
|
-
className: "px-3 py-3 text-sm text-
|
|
5125
|
+
className: "px-3 py-3 text-sm text-secondary",
|
|
5114
5126
|
children: copy.noEmails
|
|
5115
5127
|
});
|
|
5116
5128
|
return /* @__PURE__ */ jsxs(Fragment, { children: [/* @__PURE__ */ jsx("ul", {
|
|
5117
|
-
className: "divide-y divide-
|
|
5129
|
+
className: "divide-y divide-divider",
|
|
5118
5130
|
children: (expanded ? messages : messages.slice(0, COLLAPSED_ITEMS)).map((message) => /* @__PURE__ */ jsx("li", { children: /* @__PURE__ */ jsx(MailRow, {
|
|
5119
5131
|
message,
|
|
5120
5132
|
locale,
|
|
@@ -5139,13 +5151,13 @@ function MailMessageView({ message, connector, locale, copy }) {
|
|
|
5139
5151
|
className: "space-y-1",
|
|
5140
5152
|
children: [
|
|
5141
5153
|
/* @__PURE__ */ jsx("h4", {
|
|
5142
|
-
className: "text-sm font-semibold text-
|
|
5154
|
+
className: "text-sm font-semibold text-foreground",
|
|
5143
5155
|
children: text(message.subject) ?? copy.noSubject
|
|
5144
5156
|
}),
|
|
5145
5157
|
/* @__PURE__ */ jsxs("div", {
|
|
5146
|
-
className: "flex items-baseline gap-2 text-xs text-
|
|
5158
|
+
className: "flex items-baseline gap-2 text-xs text-secondary",
|
|
5147
5159
|
children: [/* @__PURE__ */ jsx("span", {
|
|
5148
|
-
className: "min-w-0 flex-1 truncate font-medium text-
|
|
5160
|
+
className: "min-w-0 flex-1 truncate font-medium text-strong",
|
|
5149
5161
|
children: message.from ?? "—"
|
|
5150
5162
|
}), /* @__PURE__ */ jsx("span", {
|
|
5151
5163
|
className: "shrink-0",
|
|
@@ -5153,7 +5165,7 @@ function MailMessageView({ message, connector, locale, copy }) {
|
|
|
5153
5165
|
})]
|
|
5154
5166
|
}),
|
|
5155
5167
|
text(message.to) ? /* @__PURE__ */ jsxs("p", {
|
|
5156
|
-
className: "truncate text-xs text-
|
|
5168
|
+
className: "truncate text-xs text-muted",
|
|
5157
5169
|
children: [
|
|
5158
5170
|
copy.to,
|
|
5159
5171
|
": ",
|
|
@@ -5161,7 +5173,7 @@ function MailMessageView({ message, connector, locale, copy }) {
|
|
|
5161
5173
|
]
|
|
5162
5174
|
}) : null,
|
|
5163
5175
|
text(message.cc) ? /* @__PURE__ */ jsxs("p", {
|
|
5164
|
-
className: "truncate text-xs text-
|
|
5176
|
+
className: "truncate text-xs text-muted",
|
|
5165
5177
|
children: [
|
|
5166
5178
|
copy.cc,
|
|
5167
5179
|
": ",
|
|
@@ -5171,7 +5183,7 @@ function MailMessageView({ message, connector, locale, copy }) {
|
|
|
5171
5183
|
]
|
|
5172
5184
|
}),
|
|
5173
5185
|
shownBody ? /* @__PURE__ */ jsx("p", {
|
|
5174
|
-
className: "whitespace-pre-wrap break-words text-sm leading-6 text-
|
|
5186
|
+
className: "whitespace-pre-wrap break-words text-sm leading-6 text-strong",
|
|
5175
5187
|
children: shownBody
|
|
5176
5188
|
}) : null,
|
|
5177
5189
|
/* @__PURE__ */ jsxs("div", {
|
|
@@ -5179,11 +5191,11 @@ function MailMessageView({ message, connector, locale, copy }) {
|
|
|
5179
5191
|
children: [long ? /* @__PURE__ */ jsx("button", {
|
|
5180
5192
|
type: "button",
|
|
5181
5193
|
onClick: () => setExpanded((value) => !value),
|
|
5182
|
-
className: "text-xs font-medium text-
|
|
5194
|
+
className: "text-xs font-medium text-secondary hover:text-foreground",
|
|
5183
5195
|
children: expanded ? copy.showLess : copy.showMore
|
|
5184
5196
|
}) : null, message.link ? /* @__PURE__ */ jsxs(ExternalAnchor, {
|
|
5185
5197
|
href: message.link,
|
|
5186
|
-
children: [fillCopy(copy.openIn, { service: connector?.label ?? "" }), /* @__PURE__ */ jsx(
|
|
5198
|
+
children: [fillCopy(copy.openIn, { service: connector?.label ?? "" }), /* @__PURE__ */ jsx(ArrowUpRight, {
|
|
5187
5199
|
className: "h-3 w-3",
|
|
5188
5200
|
"aria-hidden": "true"
|
|
5189
5201
|
})]
|
|
@@ -5223,7 +5235,7 @@ function EventRow({ event, locale, copy }) {
|
|
|
5223
5235
|
className: "flex gap-3 px-3 py-2",
|
|
5224
5236
|
children: [
|
|
5225
5237
|
/* @__PURE__ */ jsx("span", {
|
|
5226
|
-
className: "w-24 shrink-0 pt-0.5 text-xs tabular-nums text-
|
|
5238
|
+
className: "w-24 shrink-0 pt-0.5 text-xs tabular-nums text-secondary",
|
|
5227
5239
|
children: eventTime(event, locale, copy)
|
|
5228
5240
|
}),
|
|
5229
5241
|
/* @__PURE__ */ jsxs("div", {
|
|
@@ -5232,13 +5244,13 @@ function EventRow({ event, locale, copy }) {
|
|
|
5232
5244
|
href: event.link,
|
|
5233
5245
|
target: "_blank",
|
|
5234
5246
|
rel: "noreferrer noopener",
|
|
5235
|
-
className: "block truncate text-sm font-medium text-
|
|
5247
|
+
className: "block truncate text-sm font-medium text-foreground hover:underline",
|
|
5236
5248
|
children: text(event.title) ?? copy.noSubject
|
|
5237
5249
|
}) : /* @__PURE__ */ jsx("p", {
|
|
5238
|
-
className: "truncate text-sm font-medium text-
|
|
5250
|
+
className: "truncate text-sm font-medium text-foreground",
|
|
5239
5251
|
children: text(event.title) ?? copy.noSubject
|
|
5240
5252
|
}), details.length > 0 ? /* @__PURE__ */ jsx("p", {
|
|
5241
|
-
className: "truncate text-xs text-
|
|
5253
|
+
className: "truncate text-xs text-muted",
|
|
5242
5254
|
children: details.join(" · ")
|
|
5243
5255
|
}) : null]
|
|
5244
5256
|
}),
|
|
@@ -5256,7 +5268,7 @@ function EventRow({ event, locale, copy }) {
|
|
|
5256
5268
|
function Agenda({ events, locale, copy }) {
|
|
5257
5269
|
const [expanded, setExpanded] = useState(false);
|
|
5258
5270
|
if (events.length === 0) return /* @__PURE__ */ jsx("p", {
|
|
5259
|
-
className: "px-3 py-3 text-sm text-
|
|
5271
|
+
className: "px-3 py-3 text-sm text-secondary",
|
|
5260
5272
|
children: copy.noEvents
|
|
5261
5273
|
});
|
|
5262
5274
|
const visible = expanded ? events : events.slice(0, COLLAPSED_ITEMS);
|
|
@@ -5266,12 +5278,12 @@ function Agenda({ events, locale, copy }) {
|
|
|
5266
5278
|
month: "long"
|
|
5267
5279
|
});
|
|
5268
5280
|
return /* @__PURE__ */ jsxs(Fragment, { children: [/* @__PURE__ */ jsx("div", {
|
|
5269
|
-
className: "divide-y divide-
|
|
5281
|
+
className: "divide-y divide-divider",
|
|
5270
5282
|
children: groupByDay(visible).map((group, index) => /* @__PURE__ */ jsxs("section", { children: [group.day ? /* @__PURE__ */ jsx("h4", {
|
|
5271
|
-
className: "bg-
|
|
5283
|
+
className: "bg-surface-muted px-3 py-1 text-xs font-medium capitalize text-secondary",
|
|
5272
5284
|
children: dayFormat.format(group.day)
|
|
5273
5285
|
}) : null, /* @__PURE__ */ jsx("ul", {
|
|
5274
|
-
className: "divide-y divide-
|
|
5286
|
+
className: "divide-y divide-divider",
|
|
5275
5287
|
children: group.events.map((event) => /* @__PURE__ */ jsx(EventRow, {
|
|
5276
5288
|
event,
|
|
5277
5289
|
locale,
|
|
@@ -5292,12 +5304,12 @@ function CollapsibleBody({ body, copy }) {
|
|
|
5292
5304
|
return /* @__PURE__ */ jsxs("div", {
|
|
5293
5305
|
className: "space-y-1",
|
|
5294
5306
|
children: [/* @__PURE__ */ jsx("p", {
|
|
5295
|
-
className: "whitespace-pre-wrap break-words text-sm leading-6 text-
|
|
5307
|
+
className: "whitespace-pre-wrap break-words text-sm leading-6 text-strong",
|
|
5296
5308
|
children: long && !expanded ? `${body.slice(0, COLLAPSED_BODY_CHARS).trimEnd()}…` : body
|
|
5297
5309
|
}), long ? /* @__PURE__ */ jsx("button", {
|
|
5298
5310
|
type: "button",
|
|
5299
5311
|
onClick: () => setExpanded((value) => !value),
|
|
5300
|
-
className: "text-xs font-medium text-
|
|
5312
|
+
className: "text-xs font-medium text-secondary hover:text-foreground",
|
|
5301
5313
|
children: expanded ? copy.showLess : copy.showMore
|
|
5302
5314
|
}) : null]
|
|
5303
5315
|
});
|
|
@@ -5310,15 +5322,15 @@ function DraftView({ view, copy }) {
|
|
|
5310
5322
|
className: "space-y-1",
|
|
5311
5323
|
children: [
|
|
5312
5324
|
/* @__PURE__ */ jsx("p", {
|
|
5313
|
-
className: "text-sm font-medium text-
|
|
5325
|
+
className: "text-sm font-medium text-foreground",
|
|
5314
5326
|
children: copy.draftSaved
|
|
5315
5327
|
}),
|
|
5316
5328
|
view.subject ? /* @__PURE__ */ jsx("p", {
|
|
5317
|
-
className: "truncate text-sm text-
|
|
5329
|
+
className: "truncate text-sm text-strong",
|
|
5318
5330
|
children: view.subject
|
|
5319
5331
|
}) : null,
|
|
5320
5332
|
view.to.length > 0 ? /* @__PURE__ */ jsxs("p", {
|
|
5321
|
-
className: "truncate text-xs text-
|
|
5333
|
+
className: "truncate text-xs text-muted",
|
|
5322
5334
|
children: [
|
|
5323
5335
|
copy.to,
|
|
5324
5336
|
": ",
|
|
@@ -5333,7 +5345,7 @@ function DraftView({ view, copy }) {
|
|
|
5333
5345
|
}),
|
|
5334
5346
|
view.link ? /* @__PURE__ */ jsxs(ExternalAnchor, {
|
|
5335
5347
|
href: view.link,
|
|
5336
|
-
children: [copy.openDraft, /* @__PURE__ */ jsx(
|
|
5348
|
+
children: [copy.openDraft, /* @__PURE__ */ jsx(ArrowUpRight, {
|
|
5337
5349
|
className: "h-3 w-3",
|
|
5338
5350
|
"aria-hidden": "true"
|
|
5339
5351
|
})]
|
|
@@ -5348,10 +5360,10 @@ function Field({ label, children }) {
|
|
|
5348
5360
|
return /* @__PURE__ */ jsxs("div", {
|
|
5349
5361
|
className: "flex gap-3 text-sm",
|
|
5350
5362
|
children: [/* @__PURE__ */ jsx("dt", {
|
|
5351
|
-
className: "w-24 shrink-0 text-xs leading-5 text-
|
|
5363
|
+
className: "w-24 shrink-0 text-xs leading-5 text-muted",
|
|
5352
5364
|
children: label
|
|
5353
5365
|
}), /* @__PURE__ */ jsx("dd", {
|
|
5354
|
-
className: "min-w-0 flex-1 break-words text-
|
|
5366
|
+
className: "min-w-0 flex-1 break-words text-foreground",
|
|
5355
5367
|
children
|
|
5356
5368
|
})]
|
|
5357
5369
|
});
|
|
@@ -5384,11 +5396,11 @@ function PendingMailView({ pending, copy }) {
|
|
|
5384
5396
|
]
|
|
5385
5397
|
}),
|
|
5386
5398
|
text(mail.reply_to_message_id) ? /* @__PURE__ */ jsx("p", {
|
|
5387
|
-
className: "text-xs text-
|
|
5399
|
+
className: "text-xs text-muted",
|
|
5388
5400
|
children: copy.replyInThread
|
|
5389
5401
|
}) : null,
|
|
5390
5402
|
/* @__PURE__ */ jsx("div", {
|
|
5391
|
-
className: "rounded-md border border-
|
|
5403
|
+
className: "rounded-md border border-border bg-surface-muted px-3 py-2",
|
|
5392
5404
|
children: /* @__PURE__ */ jsx(CollapsibleBody, {
|
|
5393
5405
|
body: text(mail.body),
|
|
5394
5406
|
copy
|
|
@@ -5420,7 +5432,7 @@ function Change({ before, after }) {
|
|
|
5420
5432
|
className: "flex flex-wrap items-baseline gap-x-2",
|
|
5421
5433
|
children: [
|
|
5422
5434
|
/* @__PURE__ */ jsx("span", {
|
|
5423
|
-
className: "text-
|
|
5435
|
+
className: "text-muted line-through",
|
|
5424
5436
|
children: before
|
|
5425
5437
|
}),
|
|
5426
5438
|
/* @__PURE__ */ jsx("span", {
|
|
@@ -5439,19 +5451,19 @@ function PendingEventView({ operation, pending, locale, copy }) {
|
|
|
5439
5451
|
className: "space-y-1 px-3 py-3",
|
|
5440
5452
|
children: [
|
|
5441
5453
|
/* @__PURE__ */ jsx("p", {
|
|
5442
|
-
className: "text-xs font-medium
|
|
5454
|
+
className: "text-xs font-medium capitalize tracking-wide text-danger-strong",
|
|
5443
5455
|
children: copy.deleteEvent
|
|
5444
5456
|
}),
|
|
5445
5457
|
/* @__PURE__ */ jsx("p", {
|
|
5446
|
-
className: "text-sm font-medium text-
|
|
5458
|
+
className: "text-sm font-medium text-foreground line-through",
|
|
5447
5459
|
children: text(current?.title) ?? text(action.event_id) ?? copy.noSubject
|
|
5448
5460
|
}),
|
|
5449
5461
|
current ? /* @__PURE__ */ jsx("p", {
|
|
5450
|
-
className: "text-xs text-
|
|
5462
|
+
className: "text-xs text-muted",
|
|
5451
5463
|
children: formatRange(current.start, current.end, Boolean(current.all_day), locale, copy)
|
|
5452
5464
|
}) : null,
|
|
5453
5465
|
(current?.attendees?.length ?? 0) > 0 ? /* @__PURE__ */ jsx("p", {
|
|
5454
|
-
className: "pt-1 text-xs text-
|
|
5466
|
+
className: "pt-1 text-xs text-secondary",
|
|
5455
5467
|
children: copy.attendeesNotified
|
|
5456
5468
|
}) : null
|
|
5457
5469
|
]
|
|
@@ -5466,7 +5478,7 @@ function PendingEventView({ operation, pending, locale, copy }) {
|
|
|
5466
5478
|
className: "space-y-2 px-3 py-3",
|
|
5467
5479
|
children: [
|
|
5468
5480
|
/* @__PURE__ */ jsx("p", {
|
|
5469
|
-
className: "text-xs font-medium
|
|
5481
|
+
className: "text-xs font-medium capitalize tracking-wide text-muted",
|
|
5470
5482
|
children: isUpdate ? copy.eventChange : copy.newEvent
|
|
5471
5483
|
}),
|
|
5472
5484
|
/* @__PURE__ */ jsxs("dl", {
|
|
@@ -5519,7 +5531,7 @@ function PendingEventView({ operation, pending, locale, copy }) {
|
|
|
5519
5531
|
]
|
|
5520
5532
|
}),
|
|
5521
5533
|
attendees.length > 0 ? /* @__PURE__ */ jsx("p", {
|
|
5522
|
-
className: "text-xs text-
|
|
5534
|
+
className: "text-xs text-secondary",
|
|
5523
5535
|
children: copy.attendeesNotified
|
|
5524
5536
|
}) : null
|
|
5525
5537
|
]
|
|
@@ -5541,24 +5553,24 @@ function ToolResultPersonalConnectorCard({ part, locale, className, toolConfirma
|
|
|
5541
5553
|
const total = headerCount(view, copy);
|
|
5542
5554
|
const isPending = view.kind === "pending-mail" || view.kind === "pending-event";
|
|
5543
5555
|
return /* @__PURE__ */ jsxs("section", {
|
|
5544
|
-
className: joinClasses("plai-tool-result-personal-connector-card overflow-hidden rounded-lg border border-
|
|
5556
|
+
className: joinClasses("plai-tool-result-personal-connector-card overflow-hidden rounded-lg border border-border bg-surface text-foreground", className),
|
|
5545
5557
|
"data-tool-call-id": part.id,
|
|
5546
5558
|
"data-tool-call-state": part.state,
|
|
5547
5559
|
"data-connector-action": view.kind,
|
|
5548
5560
|
children: [
|
|
5549
5561
|
/* @__PURE__ */ jsxs("header", {
|
|
5550
|
-
className: "flex items-center gap-2 border-b border-
|
|
5562
|
+
className: "flex items-center gap-2 border-b border-border px-3 py-2 text-xs text-secondary",
|
|
5551
5563
|
children: [
|
|
5552
5564
|
/* @__PURE__ */ jsx(Icon, {
|
|
5553
|
-
className: "h-4 w-4 shrink-0 text-
|
|
5565
|
+
className: "h-4 w-4 shrink-0 text-strong",
|
|
5554
5566
|
"aria-hidden": "true"
|
|
5555
5567
|
}),
|
|
5556
5568
|
/* @__PURE__ */ jsx("span", {
|
|
5557
|
-
className: "shrink-0 font-medium text-
|
|
5569
|
+
className: "shrink-0 font-medium text-foreground",
|
|
5558
5570
|
children: connector?.label
|
|
5559
5571
|
}),
|
|
5560
5572
|
connector?.account_email ? /* @__PURE__ */ jsx("span", {
|
|
5561
|
-
className: "min-w-0 truncate border-
|
|
5573
|
+
className: "min-w-0 truncate border-border-strong border px-2 py-0.5 rounded-md text-xs text-muted",
|
|
5562
5574
|
children: connector.account_email
|
|
5563
5575
|
}) : null,
|
|
5564
5576
|
isPending ? /* @__PURE__ */ jsx(ConfirmationBadge, {
|
|
@@ -5633,39 +5645,42 @@ function ConfirmedActionRow({ action, copy }) {
|
|
|
5633
5645
|
"data-confirmation-status": action.status,
|
|
5634
5646
|
children: [
|
|
5635
5647
|
failed ? /* @__PURE__ */ jsx(XCircle, {
|
|
5636
|
-
className: "mt-0.5 h-4 w-4 shrink-0 text-
|
|
5648
|
+
className: "mt-0.5 h-4 w-4 shrink-0 text-danger",
|
|
5637
5649
|
"aria-hidden": "true"
|
|
5638
5650
|
}) : executed ? /* @__PURE__ */ jsx(CheckCircle2, {
|
|
5639
|
-
className: "mt-0.5 h-4 w-4 shrink-0 text-
|
|
5651
|
+
className: "mt-0.5 h-4 w-4 shrink-0 text-success",
|
|
5640
5652
|
"aria-hidden": "true"
|
|
5641
5653
|
}) : /* @__PURE__ */ jsx(Clock, {
|
|
5642
|
-
className: "mt-0.5 h-4 w-4 shrink-0 text-
|
|
5654
|
+
className: "mt-0.5 h-4 w-4 shrink-0 text-muted",
|
|
5643
5655
|
"aria-hidden": "true"
|
|
5644
5656
|
}),
|
|
5645
5657
|
/* @__PURE__ */ jsxs("div", {
|
|
5646
5658
|
className: "min-w-0 flex-1 space-y-0.5",
|
|
5647
5659
|
children: [
|
|
5648
5660
|
/* @__PURE__ */ jsx("p", {
|
|
5649
|
-
className: "text-sm font-medium text-
|
|
5661
|
+
className: "text-sm font-medium text-foreground",
|
|
5650
5662
|
children: title
|
|
5651
5663
|
}),
|
|
5652
5664
|
connector ? /* @__PURE__ */ jsxs("div", {
|
|
5653
|
-
className: "flex items-center gap-2 truncate text-xs text-
|
|
5665
|
+
className: "flex items-center gap-2 truncate text-xs text-muted",
|
|
5654
5666
|
children: [connector.label, connector.account_email ? /* @__PURE__ */ jsx("span", {
|
|
5655
|
-
className: "min-w-0 truncate border-
|
|
5667
|
+
className: "min-w-0 truncate border-border-strong border px-2 py-0.5 rounded-md text-xs text-muted",
|
|
5656
5668
|
children: connector.account_email
|
|
5657
5669
|
}) : null]
|
|
5658
5670
|
}) : null,
|
|
5659
5671
|
failed && text(action.error) ? /* @__PURE__ */ jsx("p", {
|
|
5660
|
-
className: "line-clamp-2 text-xs text-
|
|
5672
|
+
className: "line-clamp-2 text-xs text-danger-strong",
|
|
5661
5673
|
children: action.error
|
|
5662
5674
|
}) : null
|
|
5663
5675
|
]
|
|
5664
5676
|
}),
|
|
5665
|
-
executed && link ? /* @__PURE__ */
|
|
5677
|
+
executed && link ? /* @__PURE__ */ jsxs(ExternalAnchor, {
|
|
5666
5678
|
href: link,
|
|
5667
5679
|
className: "shrink-0",
|
|
5668
|
-
children: operation === "send" ? copy.openEmail : copy.openEvent
|
|
5680
|
+
children: [operation === "send" ? copy.openEmail : copy.openEvent, /* @__PURE__ */ jsx(ArrowUpRight, {
|
|
5681
|
+
className: "h-3 w-3",
|
|
5682
|
+
"aria-hidden": "true"
|
|
5683
|
+
})]
|
|
5669
5684
|
}) : null
|
|
5670
5685
|
]
|
|
5671
5686
|
});
|
|
@@ -5675,7 +5690,7 @@ function ToolResultToolConfirmationCard({ part, locale, className }) {
|
|
|
5675
5690
|
if (actions.length === 0) return null;
|
|
5676
5691
|
const copy = getPersonalConnectorCopy(locale);
|
|
5677
5692
|
return /* @__PURE__ */ jsx("ul", {
|
|
5678
|
-
className: joinClasses("plai-tool-result-tool-confirmation-card divide-y divide-
|
|
5693
|
+
className: joinClasses("plai-tool-result-tool-confirmation-card divide-y divide-divider overflow-hidden rounded-lg border border-border bg-surface text-foreground", className),
|
|
5679
5694
|
"data-tool-call-id": part.id,
|
|
5680
5695
|
"data-tool-call-state": part.state,
|
|
5681
5696
|
children: actions.map((action) => /* @__PURE__ */ jsx(ConfirmedActionRow, {
|
|
@@ -5700,14 +5715,14 @@ function ToolResultPendingConfirmationCard({ part, locale, className, toolConfir
|
|
|
5700
5715
|
const copy = getPersonalConnectorCopy(locale);
|
|
5701
5716
|
const entries = Object.entries(pending.action).filter(([key, value]) => key !== "operation" && value !== null && value !== void 0);
|
|
5702
5717
|
return /* @__PURE__ */ jsxs("section", {
|
|
5703
|
-
className: joinClasses("plai-tool-result-pending-confirmation-card overflow-hidden rounded-lg border border-
|
|
5718
|
+
className: joinClasses("plai-tool-result-pending-confirmation-card overflow-hidden rounded-lg border border-border bg-surface text-foreground", className),
|
|
5704
5719
|
"data-tool-call-id": part.id,
|
|
5705
5720
|
"data-tool-call-state": part.state,
|
|
5706
5721
|
children: [
|
|
5707
5722
|
/* @__PURE__ */ jsxs("header", {
|
|
5708
|
-
className: "flex items-center gap-2 border-b border-
|
|
5723
|
+
className: "flex items-center gap-2 border-b border-border px-3 py-2 text-xs text-secondary",
|
|
5709
5724
|
children: [/* @__PURE__ */ jsx("span", {
|
|
5710
|
-
className: "truncate font-mono font-medium text-
|
|
5725
|
+
className: "truncate font-mono font-medium text-foreground",
|
|
5711
5726
|
children: part.name
|
|
5712
5727
|
}), /* @__PURE__ */ jsx(ConfirmationBadge, {
|
|
5713
5728
|
state: confirmationState,
|
|
@@ -5770,12 +5785,12 @@ function ToolResultWorkflowDispatchCard({ part, className, locale }) {
|
|
|
5770
5785
|
const error = formatToolErrorDetails(part.errorDetails);
|
|
5771
5786
|
return /* @__PURE__ */ jsxs(Sheet, { children: [/* @__PURE__ */ jsx(SheetTrigger, {
|
|
5772
5787
|
"aria-label": `${copy.workflow}: ${workflowName}`,
|
|
5773
|
-
className: joinClasses("w-full rounded-lg border border-
|
|
5788
|
+
className: joinClasses("plai-tool-result-workflow-dispatch-card w-full rounded-lg border border-border bg-surface text-left font-normal text-foreground transition-colors hover:bg-surface-muted focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-ring", className),
|
|
5774
5789
|
children: /* @__PURE__ */ jsxs("span", {
|
|
5775
5790
|
className: "flex items-center gap-2 px-3 py-2 text-sm",
|
|
5776
5791
|
children: [
|
|
5777
5792
|
/* @__PURE__ */ jsx(Workflow, {
|
|
5778
|
-
className: "h-4 w-4 shrink-0 text-
|
|
5793
|
+
className: "h-4 w-4 shrink-0 text-muted",
|
|
5779
5794
|
"aria-hidden": "true"
|
|
5780
5795
|
}),
|
|
5781
5796
|
/* @__PURE__ */ jsx("span", {
|
|
@@ -5783,19 +5798,19 @@ function ToolResultWorkflowDispatchCard({ part, className, locale }) {
|
|
|
5783
5798
|
children: copy.workflow
|
|
5784
5799
|
}),
|
|
5785
5800
|
/* @__PURE__ */ jsx("span", {
|
|
5786
|
-
className: "min-w-0 truncate border-
|
|
5801
|
+
className: "min-w-0 truncate border-border-strong border px-2 py-0.5 rounded-md text-xs text-muted",
|
|
5787
5802
|
children: workflowName
|
|
5788
5803
|
}),
|
|
5789
5804
|
/* @__PURE__ */ jsxs("span", {
|
|
5790
5805
|
className: "ml-auto flex shrink-0 items-center gap-2",
|
|
5791
5806
|
children: [/* @__PURE__ */ jsx("span", {
|
|
5792
|
-
className: "text-xs text-
|
|
5807
|
+
className: "text-xs text-muted",
|
|
5793
5808
|
children: status
|
|
5794
5809
|
}), failed ? /* @__PURE__ */ jsx(XCircle, {
|
|
5795
|
-
className: "h-4 w-4 text-
|
|
5810
|
+
className: "h-4 w-4 text-danger",
|
|
5796
5811
|
"aria-hidden": "true"
|
|
5797
5812
|
}) : /* @__PURE__ */ jsx(CheckCircle2, {
|
|
5798
|
-
className: "h-4 w-4 text-
|
|
5813
|
+
className: "h-4 w-4 text-success",
|
|
5799
5814
|
"aria-hidden": "true"
|
|
5800
5815
|
})]
|
|
5801
5816
|
})
|
|
@@ -5814,22 +5829,22 @@ function ToolResultWorkflowDispatchCard({ part, className, locale }) {
|
|
|
5814
5829
|
className: "grid gap-2 text-sm",
|
|
5815
5830
|
children: [
|
|
5816
5831
|
/* @__PURE__ */ jsxs("div", { children: [/* @__PURE__ */ jsx("dt", {
|
|
5817
|
-
className: "text-xs text-
|
|
5832
|
+
className: "text-xs text-muted",
|
|
5818
5833
|
children: copy.workflow
|
|
5819
5834
|
}), /* @__PURE__ */ jsx("dd", { children: workflowName })] }),
|
|
5820
5835
|
/* @__PURE__ */ jsxs("div", { children: [/* @__PURE__ */ jsx("dt", {
|
|
5821
|
-
className: "text-xs text-
|
|
5836
|
+
className: "text-xs text-muted",
|
|
5822
5837
|
children: copy.status
|
|
5823
5838
|
}), /* @__PURE__ */ jsx("dd", { children: status })] }),
|
|
5824
5839
|
result.executionId ? /* @__PURE__ */ jsxs("div", { children: [/* @__PURE__ */ jsx("dt", {
|
|
5825
|
-
className: "text-xs text-
|
|
5840
|
+
className: "text-xs text-muted",
|
|
5826
5841
|
children: copy.executionId
|
|
5827
5842
|
}), /* @__PURE__ */ jsx("dd", {
|
|
5828
5843
|
className: "break-all",
|
|
5829
5844
|
children: result.executionId
|
|
5830
5845
|
})] }) : null,
|
|
5831
5846
|
result.workflowId ? /* @__PURE__ */ jsxs("div", { children: [/* @__PURE__ */ jsx("dt", {
|
|
5832
|
-
className: "text-xs text-
|
|
5847
|
+
className: "text-xs text-muted",
|
|
5833
5848
|
children: copy.workflowId
|
|
5834
5849
|
}), /* @__PURE__ */ jsx("dd", {
|
|
5835
5850
|
className: "break-all",
|
|
@@ -5841,11 +5856,11 @@ function ToolResultWorkflowDispatchCard({ part, className, locale }) {
|
|
|
5841
5856
|
className: "mb-2 text-sm font-medium",
|
|
5842
5857
|
children: copy.result
|
|
5843
5858
|
}), /* @__PURE__ */ jsx("pre", {
|
|
5844
|
-
className: "overflow-x-auto rounded-md border border-
|
|
5859
|
+
className: "overflow-x-auto rounded-md border border-border bg-surface-muted p-3 text-xs leading-5",
|
|
5845
5860
|
children: output$1
|
|
5846
5861
|
})] }) : null,
|
|
5847
5862
|
error ? /* @__PURE__ */ jsxs("p", {
|
|
5848
|
-
className: "rounded border border-
|
|
5863
|
+
className: "rounded border border-danger-border bg-danger-subtle px-3 py-2 text-xs text-danger-strong",
|
|
5849
5864
|
children: [
|
|
5850
5865
|
/* @__PURE__ */ jsxs("span", {
|
|
5851
5866
|
className: "font-semibold",
|
|
@@ -6152,79 +6167,81 @@ function ToolResultCard({ part, className, detailsOpen = true, locale, onOpenAge
|
|
|
6152
6167
|
});
|
|
6153
6168
|
if (part.toolType === "datasource") return null;
|
|
6154
6169
|
return /* @__PURE__ */ jsxs("section", {
|
|
6155
|
-
className: joinClasses("
|
|
6170
|
+
className: joinClasses("plai-tool-result-card overflow-hidden rounded-lg border border-border bg-surface-muted", className),
|
|
6156
6171
|
"data-tool-call-id": part.id,
|
|
6157
6172
|
"data-tool-call-state": part.state,
|
|
6158
|
-
children: [
|
|
6159
|
-
|
|
6160
|
-
|
|
6161
|
-
|
|
6162
|
-
|
|
6163
|
-
|
|
6164
|
-
|
|
6165
|
-
|
|
6166
|
-
|
|
6167
|
-
|
|
6168
|
-
|
|
6169
|
-
|
|
6170
|
-
|
|
6171
|
-
|
|
6172
|
-
|
|
6173
|
-
|
|
6174
|
-
|
|
6175
|
-
|
|
6176
|
-
|
|
6177
|
-
|
|
6178
|
-
|
|
6179
|
-
|
|
6180
|
-
|
|
6181
|
-
|
|
6182
|
-
|
|
6183
|
-
|
|
6184
|
-
|
|
6185
|
-
|
|
6186
|
-
|
|
6187
|
-
|
|
6188
|
-
|
|
6189
|
-
|
|
6190
|
-
|
|
6191
|
-
|
|
6192
|
-
|
|
6193
|
-
|
|
6194
|
-
|
|
6195
|
-
|
|
6196
|
-
|
|
6197
|
-
|
|
6198
|
-
|
|
6199
|
-
|
|
6200
|
-
|
|
6201
|
-
|
|
6202
|
-
|
|
6203
|
-
|
|
6204
|
-
|
|
6205
|
-
|
|
6206
|
-
|
|
6207
|
-
|
|
6208
|
-
|
|
6209
|
-
|
|
6210
|
-
|
|
6211
|
-
|
|
6212
|
-
|
|
6213
|
-
|
|
6214
|
-
|
|
6215
|
-
|
|
6216
|
-
|
|
6217
|
-
|
|
6218
|
-
|
|
6219
|
-
|
|
6220
|
-
|
|
6221
|
-
|
|
6222
|
-
|
|
6223
|
-
|
|
6224
|
-
|
|
6225
|
-
|
|
6226
|
-
|
|
6227
|
-
|
|
6173
|
+
children: [/* @__PURE__ */ jsxs("header", {
|
|
6174
|
+
className: "flex items-center justify-between gap-2 border-b border-border px-3 py-2",
|
|
6175
|
+
children: [/* @__PURE__ */ jsx("h4", {
|
|
6176
|
+
className: "text-sm font-semibold text-foreground",
|
|
6177
|
+
children: part.name
|
|
6178
|
+
}), /* @__PURE__ */ jsx("span", {
|
|
6179
|
+
className: "rounded-full border capitalize border-success-border bg-success-subtle px-2 py-0.5 text-xs text-success-strong",
|
|
6180
|
+
children: copy.completed
|
|
6181
|
+
})]
|
|
6182
|
+
}), /* @__PURE__ */ jsxs("div", {
|
|
6183
|
+
className: "space-y-3 px-3 py-2",
|
|
6184
|
+
children: [
|
|
6185
|
+
part.toolType ? /* @__PURE__ */ jsxs("p", {
|
|
6186
|
+
className: "text-xs text-secondary",
|
|
6187
|
+
children: [
|
|
6188
|
+
/* @__PURE__ */ jsxs("span", {
|
|
6189
|
+
className: "font-semibold",
|
|
6190
|
+
children: [copy.type, ":"]
|
|
6191
|
+
}),
|
|
6192
|
+
" ",
|
|
6193
|
+
part.toolType
|
|
6194
|
+
]
|
|
6195
|
+
}) : null,
|
|
6196
|
+
/* @__PURE__ */ jsxs("details", {
|
|
6197
|
+
open: detailsOpen,
|
|
6198
|
+
className: "space-y-2",
|
|
6199
|
+
children: [/* @__PURE__ */ jsx("summary", {
|
|
6200
|
+
className: "cursor-pointer text-xs font-semibold text-secondary",
|
|
6201
|
+
children: copy.input
|
|
6202
|
+
}), /* @__PURE__ */ jsx("pre", {
|
|
6203
|
+
className: "overflow-x-auto rounded bg-inverse p-2 text-xs text-inverse-foreground",
|
|
6204
|
+
children: formatJson(part.input)
|
|
6205
|
+
})]
|
|
6206
|
+
}),
|
|
6207
|
+
part.result !== void 0 ? /* @__PURE__ */ jsxs("details", {
|
|
6208
|
+
open: detailsOpen,
|
|
6209
|
+
className: "space-y-2",
|
|
6210
|
+
children: [
|
|
6211
|
+
/* @__PURE__ */ jsx("summary", {
|
|
6212
|
+
className: "cursor-pointer text-xs font-semibold text-secondary",
|
|
6213
|
+
children: copy.output
|
|
6214
|
+
}),
|
|
6215
|
+
officeMediaFiles.length > 0 ? /* @__PURE__ */ jsxs("div", {
|
|
6216
|
+
className: "space-y-2 rounded border border-border bg-surface p-3",
|
|
6217
|
+
children: [/* @__PURE__ */ jsx("p", {
|
|
6218
|
+
className: "text-xs font-semibold text-strong",
|
|
6219
|
+
children: copy.generatedFiles
|
|
6220
|
+
}), /* @__PURE__ */ jsx("ul", {
|
|
6221
|
+
className: "space-y-1",
|
|
6222
|
+
children: officeMediaFiles.map((file) => {
|
|
6223
|
+
const label = file.name || file.pathname || file.id;
|
|
6224
|
+
return /* @__PURE__ */ jsx("li", {
|
|
6225
|
+
className: "text-xs text-strong",
|
|
6226
|
+
children: file.url ? /* @__PURE__ */ jsx("a", {
|
|
6227
|
+
href: file.url,
|
|
6228
|
+
target: "_blank",
|
|
6229
|
+
rel: "noreferrer noopener",
|
|
6230
|
+
className: "hover:underline",
|
|
6231
|
+
children: label
|
|
6232
|
+
}) : /* @__PURE__ */ jsx("span", { children: label })
|
|
6233
|
+
}, file.id);
|
|
6234
|
+
})
|
|
6235
|
+
})]
|
|
6236
|
+
}) : null,
|
|
6237
|
+
/* @__PURE__ */ jsx("pre", {
|
|
6238
|
+
className: "overflow-x-auto rounded bg-inverse p-2 text-xs text-inverse-foreground",
|
|
6239
|
+
children: formatJson(part.result)
|
|
6240
|
+
})
|
|
6241
|
+
]
|
|
6242
|
+
}) : null
|
|
6243
|
+
]
|
|
6244
|
+
})]
|
|
6228
6245
|
});
|
|
6229
6246
|
}
|
|
6230
6247
|
|
|
@@ -6243,7 +6260,7 @@ function Thinking({ part, thinkingLabel, completedLabel, locale, defaultOpen, cl
|
|
|
6243
6260
|
previousState.current = part.state;
|
|
6244
6261
|
}, [isStreaming, part.state]);
|
|
6245
6262
|
return /* @__PURE__ */ jsxs("section", {
|
|
6246
|
-
className: joinClasses("text-sm text-
|
|
6263
|
+
className: joinClasses("text-sm text-secondary", className),
|
|
6247
6264
|
"data-thinking-state": part.state,
|
|
6248
6265
|
...props,
|
|
6249
6266
|
children: [
|
|
@@ -6253,7 +6270,7 @@ function Thinking({ part, thinkingLabel, completedLabel, locale, defaultOpen, cl
|
|
|
6253
6270
|
"aria-expanded": hasContent ? isOpen : void 0,
|
|
6254
6271
|
"aria-label": hasContent ? `${isOpen ? copy.collapse : copy.expand} ${label}` : label,
|
|
6255
6272
|
disabled: !hasContent,
|
|
6256
|
-
className: joinClasses("inline-flex items-center gap-2 rounded-md py-1 text-left font-medium transition-colors focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-
|
|
6273
|
+
className: joinClasses("inline-flex items-center gap-2 rounded-md py-1 text-left font-medium transition-colors focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-ring", hasContent ? "cursor-pointer hover:text-foreground" : "cursor-default"),
|
|
6257
6274
|
onClick: () => setIsOpen((value) => !value),
|
|
6258
6275
|
children: [
|
|
6259
6276
|
isStreaming ? /* @__PURE__ */ jsx(LoaderCircle, {
|
|
@@ -6277,7 +6294,7 @@ function Thinking({ part, thinkingLabel, completedLabel, locale, defaultOpen, cl
|
|
|
6277
6294
|
}),
|
|
6278
6295
|
hasContent && isOpen ? /* @__PURE__ */ jsx("p", {
|
|
6279
6296
|
id: contentId,
|
|
6280
|
-
className: "mt-1 whitespace-pre-wrap border-l-2 border-
|
|
6297
|
+
className: "mt-1 whitespace-pre-wrap border-l-2 border-border pl-3 text-sm leading-6 text-secondary",
|
|
6281
6298
|
children: part.thinking
|
|
6282
6299
|
}) : null
|
|
6283
6300
|
]
|
|
@@ -6304,7 +6321,7 @@ function MessageAvatar({ src, fallback, alt = fallback, className, imageClassNam
|
|
|
6304
6321
|
const showImage = src.trim().length > 0 && failedSrc !== src;
|
|
6305
6322
|
const initials = getFallbackInitials(fallback);
|
|
6306
6323
|
return /* @__PURE__ */ jsx("div", {
|
|
6307
|
-
className: joinClasses("plai-message-avatar flex size-10 shrink-0 items-center justify-center overflow-hidden rounded-full bg-
|
|
6324
|
+
className: joinClasses("plai-message-avatar flex size-10 shrink-0 items-center justify-center overflow-hidden rounded-full bg-surface-hover text-xs font-semibold uppercase text-strong", className),
|
|
6308
6325
|
...props,
|
|
6309
6326
|
children: showImage ? /* @__PURE__ */ jsx("img", {
|
|
6310
6327
|
src,
|
|
@@ -6326,7 +6343,7 @@ function MessageContent({ className,...props }) {
|
|
|
6326
6343
|
}
|
|
6327
6344
|
function MessageHeader({ className,...props }) {
|
|
6328
6345
|
return /* @__PURE__ */ jsx("header", {
|
|
6329
|
-
className: joinClasses("text-xs font-semibold uppercase tracking-wide text-
|
|
6346
|
+
className: joinClasses("text-xs font-semibold uppercase tracking-wide text-muted", className),
|
|
6330
6347
|
...props
|
|
6331
6348
|
});
|
|
6332
6349
|
}
|
|
@@ -6367,13 +6384,13 @@ function renderPart(part, index, message, isStreaming, onOpenAgentThread, getRes
|
|
|
6367
6384
|
href: part.url,
|
|
6368
6385
|
target: "_blank",
|
|
6369
6386
|
rel: "noreferrer noopener",
|
|
6370
|
-
className: "block w-fit rounded-lg border border-
|
|
6387
|
+
className: "block w-fit rounded-lg border border-border bg-surface p-2",
|
|
6371
6388
|
children: [/* @__PURE__ */ jsx("img", {
|
|
6372
6389
|
src: part.url,
|
|
6373
6390
|
alt: title || copy.uploadedImage,
|
|
6374
6391
|
className: "max-h-56 rounded-md object-contain"
|
|
6375
6392
|
}), title ? /* @__PURE__ */ jsx("p", {
|
|
6376
|
-
className: "mt-2 max-w-xs truncate text-xs font-medium text-
|
|
6393
|
+
className: "mt-2 max-w-xs truncate text-xs font-medium text-strong",
|
|
6377
6394
|
children: title
|
|
6378
6395
|
}) : null]
|
|
6379
6396
|
}, `image-${index}`);
|
|
@@ -6385,17 +6402,17 @@ function renderPart(part, index, message, isStreaming, onOpenAgentThread, getRes
|
|
|
6385
6402
|
href: part.fileUrl,
|
|
6386
6403
|
target: "_blank",
|
|
6387
6404
|
rel: "noreferrer noopener",
|
|
6388
|
-
className: "flex w-fit items-center gap-3 rounded-lg border border-
|
|
6405
|
+
className: "flex w-fit items-center gap-3 rounded-lg border border-border bg-surface-muted px-3 py-2 text-left",
|
|
6389
6406
|
children: [/* @__PURE__ */ jsx("span", {
|
|
6390
|
-
className: "rounded bg-
|
|
6407
|
+
className: "rounded bg-inverse px-2 py-1 text-[10px] font-semibold uppercase tracking-wide text-inverse-foreground",
|
|
6391
6408
|
children: extension ?? copy.file
|
|
6392
6409
|
}), /* @__PURE__ */ jsxs("div", {
|
|
6393
6410
|
className: "min-w-0",
|
|
6394
6411
|
children: [/* @__PURE__ */ jsx("p", {
|
|
6395
|
-
className: "max-w-xs truncate text-sm font-medium text-
|
|
6412
|
+
className: "max-w-xs truncate text-sm font-medium text-foreground",
|
|
6396
6413
|
children: fileName
|
|
6397
6414
|
}), part.mimeType ? /* @__PURE__ */ jsx("p", {
|
|
6398
|
-
className: "text-xs text-
|
|
6415
|
+
className: "text-xs text-muted",
|
|
6399
6416
|
children: part.mimeType
|
|
6400
6417
|
}) : null]
|
|
6401
6418
|
})]
|
|
@@ -6422,7 +6439,7 @@ function renderPart(part, index, message, isStreaming, onOpenAgentThread, getRes
|
|
|
6422
6439
|
}, `thinking-${index}`);
|
|
6423
6440
|
}
|
|
6424
6441
|
if (part.type === "guardrail") return /* @__PURE__ */ jsx("p", {
|
|
6425
|
-
className: "rounded-lg border border-
|
|
6442
|
+
className: "rounded-lg border border-warning-border bg-warning-subtle px-3 py-2 text-sm text-warning-strong",
|
|
6426
6443
|
children: part.content
|
|
6427
6444
|
}, `guardrail-${index}`);
|
|
6428
6445
|
return null;
|
|
@@ -6499,7 +6516,7 @@ function MessageParts({ message, collapseThreshold = DEFAULT_COLLAPSE_THRESHOLD,
|
|
|
6499
6516
|
getResourceDownloadUrl
|
|
6500
6517
|
}, `source-results-${item.index}`) : renderPart(item.part, item.index, message, isStreaming, onOpenAgentThread, getResourceDownloadUrl, locale, memoryProposal, renderText, renderToolCall, renderThinking, thinkingLabel, completedThinkingLabel, textClassName, toolConfirmation)), canCollapse ? /* @__PURE__ */ jsx("button", {
|
|
6501
6518
|
type: "button",
|
|
6502
|
-
className: "text-xs font-medium text-
|
|
6519
|
+
className: "text-xs font-medium text-secondary hover:text-foreground",
|
|
6503
6520
|
onClick: () => setIsExpanded((previous) => !previous),
|
|
6504
6521
|
children: isExpanded ? readLessLabel ?? copy.readLess : readMoreLabel ?? copy.readMore
|
|
6505
6522
|
}) : null]
|
|
@@ -6686,7 +6703,7 @@ function Clipboard({ text: text$2, onCopy, copiedDuration = 2e3, copyLabel, copi
|
|
|
6686
6703
|
return /* @__PURE__ */ jsxs("button", {
|
|
6687
6704
|
type,
|
|
6688
6705
|
"aria-label": isCopied ? resolvedCopiedLabel : resolvedCopyLabel,
|
|
6689
|
-
className: joinClasses("inline-flex size-9 shrink-0 items-center justify-center rounded-lg border border-
|
|
6706
|
+
className: joinClasses("inline-flex size-9 shrink-0 items-center justify-center rounded-lg border border-border bg-surface text-strong transition-colors hover:bg-surface-muted focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-ring disabled:cursor-not-allowed disabled:opacity-40", className),
|
|
6690
6707
|
disabled: disabled || isCopying,
|
|
6691
6708
|
onClick: handleClick,
|
|
6692
6709
|
...props,
|
|
@@ -6710,7 +6727,7 @@ function ThumbButton({ label, icon, className, type = "button",...props }) {
|
|
|
6710
6727
|
return /* @__PURE__ */ jsxs("button", {
|
|
6711
6728
|
type,
|
|
6712
6729
|
"aria-label": label,
|
|
6713
|
-
className: joinClasses("inline-flex size-9 shrink-0 items-center justify-center rounded-lg border border-
|
|
6730
|
+
className: joinClasses("inline-flex size-9 shrink-0 items-center justify-center rounded-lg border border-border bg-surface text-strong transition-colors hover:bg-surface-muted focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-ring disabled:cursor-not-allowed disabled:opacity-40 aria-pressed:border-inverse aria-pressed:bg-inverse aria-pressed:text-inverse-foreground", className),
|
|
6714
6731
|
...props,
|
|
6715
6732
|
children: [icon, /* @__PURE__ */ jsx("span", {
|
|
6716
6733
|
className: "sr-only",
|
|
@@ -6746,7 +6763,7 @@ function Reload({ label, locale, className, type = "button",...props }) {
|
|
|
6746
6763
|
return /* @__PURE__ */ jsxs("button", {
|
|
6747
6764
|
type,
|
|
6748
6765
|
"aria-label": resolvedLabel,
|
|
6749
|
-
className: joinClasses("inline-flex size-9 shrink-0 items-center justify-center rounded-lg border border-
|
|
6766
|
+
className: joinClasses("inline-flex size-9 shrink-0 items-center justify-center rounded-lg border border-border bg-surface text-strong transition-colors hover:bg-surface-muted focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-ring disabled:cursor-not-allowed disabled:opacity-40", className),
|
|
6750
6767
|
...props,
|
|
6751
6768
|
children: [/* @__PURE__ */ jsx(RotateCcw, {
|
|
6752
6769
|
className: "size-4",
|
|
@@ -6833,7 +6850,7 @@ function PromptFormAttachButton({ onFilesSelected, onInvalidFiles, locale, accep
|
|
|
6833
6850
|
|
|
6834
6851
|
//#endregion
|
|
6835
6852
|
//#region src/components/prompt-form/prompt-form.tsx
|
|
6836
|
-
const actionButtonClassName = "inline-flex size-8 shrink-0 items-center justify-center rounded-md bg-
|
|
6853
|
+
const actionButtonClassName = "inline-flex size-8 shrink-0 items-center justify-center rounded-md bg-surface-subtle text-secondary transition-colors hover:bg-surface-hover disabled:cursor-not-allowed disabled:opacity-40";
|
|
6837
6854
|
const defaultMaxRows = 4;
|
|
6838
6855
|
function resizeTextarea(textarea, maxRows) {
|
|
6839
6856
|
const styles = getComputedStyle(textarea);
|
|
@@ -6885,7 +6902,7 @@ function PromptForm({ value, onValueChange, onSubmit, status = "ready", locale,
|
|
|
6885
6902
|
setFiles(files.filter((_, fileIndex) => fileIndex !== index));
|
|
6886
6903
|
}
|
|
6887
6904
|
return /* @__PURE__ */ jsxs("form", {
|
|
6888
|
-
className: joinClasses("flex w-full flex-col overflow-hidden rounded-2xl border border-
|
|
6905
|
+
className: joinClasses("flex w-full flex-col overflow-hidden rounded-2xl border border-border bg-surface", className),
|
|
6889
6906
|
onSubmit: async (event) => {
|
|
6890
6907
|
event.preventDefault();
|
|
6891
6908
|
if (!canSubmit) return;
|
|
@@ -6917,7 +6934,7 @@ function PromptForm({ value, onValueChange, onSubmit, status = "ready", locale,
|
|
|
6917
6934
|
/* @__PURE__ */ jsx("textarea", {
|
|
6918
6935
|
ref: textareaRef,
|
|
6919
6936
|
rows: 1,
|
|
6920
|
-
className: joinClasses("min-h-10 flex-1 resize-none overflow-hidden border-0 bg-transparent px-0 py-1.5 text-sm leading-6 text-
|
|
6937
|
+
className: joinClasses("min-h-10 flex-1 resize-none overflow-hidden border-0 bg-transparent px-0 py-1.5 text-sm leading-6 text-foreground outline-none placeholder:text-muted", textareaClassName),
|
|
6921
6938
|
value,
|
|
6922
6939
|
onChange: (event) => {
|
|
6923
6940
|
onValueChange(event.target.value);
|
|
@@ -6961,17 +6978,17 @@ function PromptForm({ value, onValueChange, onSubmit, status = "ready", locale,
|
|
|
6961
6978
|
})
|
|
6962
6979
|
]
|
|
6963
6980
|
}), files.length > 0 ? /* @__PURE__ */ jsxs("div", {
|
|
6964
|
-
className: joinClasses("border-t border-
|
|
6981
|
+
className: joinClasses("border-t border-border", attachmentsClassName),
|
|
6965
6982
|
children: [/* @__PURE__ */ jsx("div", {
|
|
6966
6983
|
className: "flex flex-wrap gap-2 px-4 py-2",
|
|
6967
6984
|
children: files.map((file, index) => /* @__PURE__ */ jsxs("div", {
|
|
6968
|
-
className: "flex max-w-full items-center gap-1.5 rounded-md bg-
|
|
6985
|
+
className: "flex max-w-full items-center gap-1.5 rounded-md bg-surface-subtle px-2 py-1 text-xs text-strong",
|
|
6969
6986
|
children: [/* @__PURE__ */ jsx("span", {
|
|
6970
6987
|
className: "max-w-[150px] truncate",
|
|
6971
6988
|
children: file.name
|
|
6972
6989
|
}), /* @__PURE__ */ jsx("button", {
|
|
6973
6990
|
type: "button",
|
|
6974
|
-
className: "text-
|
|
6991
|
+
className: "text-muted transition-colors hover:text-strong disabled:cursor-not-allowed disabled:opacity-40",
|
|
6975
6992
|
"aria-label": `${removeFileLabel}: ${file.name}`,
|
|
6976
6993
|
disabled: isInteractionDisabled,
|
|
6977
6994
|
onClick: () => removeFile(index),
|
|
@@ -6987,14 +7004,14 @@ function PromptForm({ value, onValueChange, onSubmit, status = "ready", locale,
|
|
|
6987
7004
|
"aria-valuemin": 0,
|
|
6988
7005
|
"aria-valuemax": 100,
|
|
6989
7006
|
"aria-valuenow": Math.round(uploadState.progress),
|
|
6990
|
-
className: joinClasses("h-1.5 overflow-hidden rounded-full bg-
|
|
7007
|
+
className: joinClasses("h-1.5 overflow-hidden rounded-full bg-surface-hover", uploadProgressClassName),
|
|
6991
7008
|
children: /* @__PURE__ */ jsx("div", {
|
|
6992
|
-
className: "h-full rounded-full bg-
|
|
7009
|
+
className: "h-full rounded-full bg-inverse transition-[width] duration-150",
|
|
6993
7010
|
style: { width: `${uploadState.progress}%` }
|
|
6994
7011
|
})
|
|
6995
7012
|
})
|
|
6996
7013
|
}) : uploadState?.status === "error" ? /* @__PURE__ */ jsx("p", {
|
|
6997
|
-
className: "px-4 pb-3 text-xs text-
|
|
7014
|
+
className: "px-4 pb-3 text-xs text-danger",
|
|
6998
7015
|
children: uploadErrorLabel
|
|
6999
7016
|
}) : null]
|
|
7000
7017
|
}) : null]
|
|
@@ -7198,7 +7215,7 @@ function SpeechToTextToggle({ controller, onTranscriptionComplete, onTranscripti
|
|
|
7198
7215
|
"aria-pressed": isListening,
|
|
7199
7216
|
"aria-busy": isRequesting || isTranscribing,
|
|
7200
7217
|
disabled: disabled || isRequesting || isTranscribing,
|
|
7201
|
-
className: joinClasses(isListening && !isTranscribing ? "text-
|
|
7218
|
+
className: joinClasses(isListening && !isTranscribing ? "text-danger" : void 0, className),
|
|
7202
7219
|
onClick: (event) => {
|
|
7203
7220
|
onClick?.(event);
|
|
7204
7221
|
if (event.defaultPrevented) return;
|
|
@@ -7303,7 +7320,7 @@ function ConversationFilesList({ messages, locale, className }) {
|
|
|
7303
7320
|
className: joinClasses("space-y-6", className),
|
|
7304
7321
|
children: [
|
|
7305
7322
|
uploaded.length === 0 && generated.length === 0 ? /* @__PURE__ */ jsx("p", {
|
|
7306
|
-
className: "text-sm text-
|
|
7323
|
+
className: "text-sm text-secondary",
|
|
7307
7324
|
children: copy.noConversationFiles
|
|
7308
7325
|
}) : null,
|
|
7309
7326
|
/* @__PURE__ */ jsx(FileSection, {
|
|
@@ -7325,7 +7342,7 @@ function FileSection({ title, files, copy }) {
|
|
|
7325
7342
|
className: "space-y-3",
|
|
7326
7343
|
"aria-label": title,
|
|
7327
7344
|
children: [/* @__PURE__ */ jsxs("h3", {
|
|
7328
|
-
className: "text-xs font-semibold uppercase tracking-wide text-
|
|
7345
|
+
className: "text-xs font-semibold uppercase tracking-wide text-muted",
|
|
7329
7346
|
children: [
|
|
7330
7347
|
title,
|
|
7331
7348
|
" (",
|
|
@@ -7333,7 +7350,7 @@ function FileSection({ title, files, copy }) {
|
|
|
7333
7350
|
")"
|
|
7334
7351
|
]
|
|
7335
7352
|
}), files.map((file) => /* @__PURE__ */ jsxs("div", {
|
|
7336
|
-
className: "flex items-center gap-3 rounded-lg border border-
|
|
7353
|
+
className: "flex items-center gap-3 rounded-lg border border-border bg-surface p-3",
|
|
7337
7354
|
children: [
|
|
7338
7355
|
/* @__PURE__ */ jsx(File, {
|
|
7339
7356
|
className: joinClasses("h-8 w-8 shrink-0", getFileIconClass(file.extension)),
|
|
@@ -7345,7 +7362,7 @@ function FileSection({ title, files, copy }) {
|
|
|
7345
7362
|
className: "truncate text-sm font-medium",
|
|
7346
7363
|
children: file.name
|
|
7347
7364
|
}), file.extension ? /* @__PURE__ */ jsx("p", {
|
|
7348
|
-
className: "text-[11px] uppercase text-
|
|
7365
|
+
className: "text-[11px] uppercase text-muted",
|
|
7349
7366
|
children: file.extension
|
|
7350
7367
|
}) : null]
|
|
7351
7368
|
}),
|
|
@@ -7374,7 +7391,7 @@ function ConversationFilesSheet({ messages, locale, className, open, onOpenChang
|
|
|
7374
7391
|
children: [showTrigger ? /* @__PURE__ */ jsxs(SheetTrigger, {
|
|
7375
7392
|
"aria-label": `${copy.conversationFiles}: ${count$1}`,
|
|
7376
7393
|
title: copy.conversationFiles,
|
|
7377
|
-
className: joinClasses("inline-flex h-8 items-center gap-1.5 rounded-md border border-
|
|
7394
|
+
className: joinClasses("inline-flex h-8 items-center gap-1.5 rounded-md border border-border bg-surface px-2 text-sm text-strong transition-colors hover:bg-surface-subtle focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-ring", triggerClassName),
|
|
7378
7395
|
children: [/* @__PURE__ */ jsx(Paperclip$1, {
|
|
7379
7396
|
className: "h-4 w-4",
|
|
7380
7397
|
"aria-hidden": "true"
|