@plaisolutions/react 0.18.0 → 0.20.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 +3 -1
- package/dist/components/index.d.ts.map +1 -1
- package/dist/components/index.js +625 -563
- package/dist/components/index.js.map +1 -1
- package/dist/index.d.ts +4 -2
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +625 -563
- package/dist/index.js.map +1 -1
- package/dist/styles.css +1 -1
- package/package.json +2 -2
package/dist/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { HttpStatusError, OPEN_TOOL_CONFIRMATION_STATUSES, PlaiChat, isHiddenMessage, pendingActionIds, toolConfirmationAt } from "@plaisolutions/client";
|
|
2
2
|
import { createContext, forwardRef, useCallback, useContext, useEffect, useId, useLayoutEffect, useMemo, useRef, useState, useSyncExternalStore } from "react";
|
|
3
|
-
import { Bot, Brain, CalendarDays, Check, CheckCircle2, ChevronDown, CircleAlert, CircleX, Clock, Copy, Database, Download,
|
|
3
|
+
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";
|
|
4
4
|
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
5
5
|
|
|
6
6
|
//#region src/use-tool-confirmations.ts
|
|
@@ -371,7 +371,7 @@ function ChatError({ error, locale, title, children, className,...props }) {
|
|
|
371
371
|
return /* @__PURE__ */ jsxs("div", {
|
|
372
372
|
role: "alert",
|
|
373
373
|
...props,
|
|
374
|
-
className: joinClasses("plai-chat-error flex gap-3 rounded-lg border border-
|
|
374
|
+
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),
|
|
375
375
|
children: [/* @__PURE__ */ jsx(CircleAlert, {
|
|
376
376
|
"aria-hidden": "true",
|
|
377
377
|
className: "mt-0.5 size-4 shrink-0"
|
|
@@ -1539,7 +1539,7 @@ function DatasourceToolResultCardContent({ title, description, type, icon, resou
|
|
|
1539
1539
|
children: description
|
|
1540
1540
|
}),
|
|
1541
1541
|
resourceCount === void 0 ? null : /* @__PURE__ */ jsxs("p", {
|
|
1542
|
-
className: "mt-2 text-xs leading-4 text-
|
|
1542
|
+
className: "mt-2 text-xs leading-4 text-secondary",
|
|
1543
1543
|
children: [
|
|
1544
1544
|
resourceCount,
|
|
1545
1545
|
" ",
|
|
@@ -1551,7 +1551,7 @@ function DatasourceToolResultCardContent({ title, description, type, icon, resou
|
|
|
1551
1551
|
function DatasourceToolResultCard(props) {
|
|
1552
1552
|
return /* @__PURE__ */ jsx("article", {
|
|
1553
1553
|
"aria-label": `${props.type}: ${props.title}`,
|
|
1554
|
-
className: "w-46.5 rounded-lg bg-
|
|
1554
|
+
className: "plai-datasource-tool-result-card w-46.5 rounded-lg bg-surface-subtle p-4 text-foreground",
|
|
1555
1555
|
children: /* @__PURE__ */ jsx(DatasourceToolResultCardContent, { ...props })
|
|
1556
1556
|
});
|
|
1557
1557
|
}
|
|
@@ -1584,7 +1584,7 @@ function ResourceCardContent({ icon, type, title, description, variant = "card"
|
|
|
1584
1584
|
children: bodyTitle
|
|
1585
1585
|
}) : null,
|
|
1586
1586
|
bodyDescription ? /* @__PURE__ */ jsx("p", {
|
|
1587
|
-
className: "mt-2 line-clamp-2 text-xs leading-4 text-
|
|
1587
|
+
className: "mt-2 line-clamp-2 text-xs leading-4 text-secondary",
|
|
1588
1588
|
children: bodyDescription
|
|
1589
1589
|
}) : null
|
|
1590
1590
|
] });
|
|
@@ -1594,8 +1594,8 @@ function ResourceCard(props) {
|
|
|
1594
1594
|
const copy = getUiCopy(locale);
|
|
1595
1595
|
const [downloadState, setDownloadState] = useState("idle");
|
|
1596
1596
|
const abortControllerRef = useRef(null);
|
|
1597
|
-
const className = joinClasses("block rounded-lg bg-
|
|
1598
|
-
const interactiveClassName = `${className} transition-colors hover:bg-
|
|
1597
|
+
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);
|
|
1598
|
+
const interactiveClassName = `${className} transition-colors hover:bg-surface-hover focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-ring`;
|
|
1599
1599
|
useEffect(() => () => {
|
|
1600
1600
|
abortControllerRef.current?.abort();
|
|
1601
1601
|
}, []);
|
|
@@ -1641,12 +1641,12 @@ function ResourceCard(props) {
|
|
|
1641
1641
|
variant
|
|
1642
1642
|
}),
|
|
1643
1643
|
downloadState === "loading" ? /* @__PURE__ */ jsx("span", {
|
|
1644
|
-
className: "mt-2 block text-xs text-
|
|
1644
|
+
className: "mt-2 block text-xs text-secondary",
|
|
1645
1645
|
"aria-live": "polite",
|
|
1646
1646
|
children: copy.openingResource
|
|
1647
1647
|
}) : null,
|
|
1648
1648
|
downloadState === "error" ? /* @__PURE__ */ jsx("span", {
|
|
1649
|
-
className: "mt-2 block text-xs text-
|
|
1649
|
+
className: "mt-2 block text-xs text-danger-strong",
|
|
1650
1650
|
role: "alert",
|
|
1651
1651
|
children: copy.resourceOpenFailed
|
|
1652
1652
|
}) : null
|
|
@@ -1940,7 +1940,7 @@ const SheetContent = forwardRef(function SheetContent$1({ children, className, s
|
|
|
1940
1940
|
"aria-label": ariaLabel,
|
|
1941
1941
|
"aria-labelledby": ariaLabelledBy ?? labelledBy,
|
|
1942
1942
|
"aria-describedby": ariaDescribedBy ?? describedBy,
|
|
1943
|
-
className: "plai-sheet-overlay fixed inset-0 m-0 h-full max-h-none w-full max-w-none border-0 bg-
|
|
1943
|
+
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",
|
|
1944
1944
|
onCancel: (event) => {
|
|
1945
1945
|
onCancel?.(event);
|
|
1946
1946
|
if (!event.defaultPrevented) {
|
|
@@ -1956,13 +1956,13 @@ const SheetContent = forwardRef(function SheetContent$1({ children, className, s
|
|
|
1956
1956
|
"data-slot": "sheet-content",
|
|
1957
1957
|
"data-state": state,
|
|
1958
1958
|
"data-side": side,
|
|
1959
|
-
className: joinClasses("plai-sheet-content fixed overflow-y-auto border-
|
|
1959
|
+
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),
|
|
1960
1960
|
onAnimationEnd: (event) => {
|
|
1961
1961
|
if (event.currentTarget === event.target && !open) setPresent(false);
|
|
1962
1962
|
},
|
|
1963
1963
|
children: [showCloseButton ? /* @__PURE__ */ jsx(SheetClose, {
|
|
1964
1964
|
"aria-label": closeLabel ?? getUiCopy(locale).close,
|
|
1965
|
-
className: "absolute right-4 top-2 rounded-sm p-1 text-
|
|
1965
|
+
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",
|
|
1966
1966
|
children: /* @__PURE__ */ jsx(X, { className: "h-5 w-5" })
|
|
1967
1967
|
}) : null, children]
|
|
1968
1968
|
})
|
|
@@ -2016,7 +2016,7 @@ const SheetDescription = forwardRef(function SheetDescription$1({ className, id,
|
|
|
2016
2016
|
ref: forwardedRef,
|
|
2017
2017
|
id: resolvedId,
|
|
2018
2018
|
"data-slot": "sheet-description",
|
|
2019
|
-
className: joinClasses("text-sm text-
|
|
2019
|
+
className: joinClasses("text-sm text-secondary", className)
|
|
2020
2020
|
});
|
|
2021
2021
|
});
|
|
2022
2022
|
|
|
@@ -2026,7 +2026,7 @@ function DatasourceFolderCard({ icon, title, description, type, url, resources,
|
|
|
2026
2026
|
const copy = getUiCopy(locale);
|
|
2027
2027
|
return /* @__PURE__ */ jsxs(Sheet, { children: [/* @__PURE__ */ jsx(SheetTrigger, {
|
|
2028
2028
|
"aria-label": `${type}: ${title}`,
|
|
2029
|
-
className: `${variant === "card" ? "min-h-[183px] w-[186px] max-w-full" : "w-full"} rounded-lg bg-
|
|
2029
|
+
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`,
|
|
2030
2030
|
children: /* @__PURE__ */ jsx(DatasourceToolResultCardContent, {
|
|
2031
2031
|
icon,
|
|
2032
2032
|
title,
|
|
@@ -2059,7 +2059,7 @@ function DatasourceFolderCard({ icon, title, description, type, url, resources,
|
|
|
2059
2059
|
href: url,
|
|
2060
2060
|
target: "_blank",
|
|
2061
2061
|
rel: "noreferrer noopener",
|
|
2062
|
-
className: "text-xs font-medium text-
|
|
2062
|
+
className: "text-xs font-medium text-strong underline underline-offset-2",
|
|
2063
2063
|
children: copy.view
|
|
2064
2064
|
}) : null
|
|
2065
2065
|
]
|
|
@@ -2228,12 +2228,42 @@ function isDatasourceResource(value) {
|
|
|
2228
2228
|
const datasource = value.datasource;
|
|
2229
2229
|
return typeof value.id === "string" && typeof value.name === "string" && typeof value.type === "string" && (value.url === null || typeof value.url === "string") && (value.external_url === null || typeof value.external_url === "string") && isObject(value.metadata) && isObject(value.extra_info) && (folder === null || isObject(folder) && typeof folder.id === "string" && typeof folder.name === "string" && isObject(folder.extra_info)) && (datasource === null || isObject(datasource) && typeof datasource.type === "string" && (datasource.description === null || typeof datasource.description === "string") && (datasource.summary === null || typeof datasource.summary === "string"));
|
|
2230
2230
|
}
|
|
2231
|
-
function
|
|
2231
|
+
function isResourceLink(value) {
|
|
2232
|
+
return isObject(value) && typeof value.id === "string" && typeof value.resource_id === "string" && typeof value.url === "string" && (value.title === null || typeof value.title === "string") && (value.favicon === null || typeof value.favicon === "string");
|
|
2233
|
+
}
|
|
2234
|
+
function getDatasourceResourceCards(resources, locale, getResourceDownloadUrl, resourceLinks = []) {
|
|
2232
2235
|
const folderGroups = /* @__PURE__ */ new Map();
|
|
2233
2236
|
const ungroupedResources = [];
|
|
2237
|
+
const linkCards = [];
|
|
2234
2238
|
const seenUrls = /* @__PURE__ */ new Set();
|
|
2239
|
+
const linksByResource = /* @__PURE__ */ new Map();
|
|
2240
|
+
for (const link of resourceLinks) {
|
|
2241
|
+
const group = linksByResource.get(link.resource_id);
|
|
2242
|
+
if (group) group.push(link);
|
|
2243
|
+
else linksByResource.set(link.resource_id, [link]);
|
|
2244
|
+
}
|
|
2235
2245
|
for (const resource of resources) {
|
|
2236
2246
|
if (resource.extra_info.public === false) continue;
|
|
2247
|
+
const links = linksByResource.get(resource.id);
|
|
2248
|
+
if (resource.type === "WEBPAGE" && links?.length) {
|
|
2249
|
+
for (const link of links) {
|
|
2250
|
+
if (seenUrls.has(link.url)) continue;
|
|
2251
|
+
seenUrls.add(link.url);
|
|
2252
|
+
linkCards.push({
|
|
2253
|
+
kind: "resource",
|
|
2254
|
+
key: `resource-link-${link.id}`,
|
|
2255
|
+
props: {
|
|
2256
|
+
icon: link.favicon ?? void 0,
|
|
2257
|
+
type: getResourceType(resource, locale),
|
|
2258
|
+
title: link.title?.trim() || link.url,
|
|
2259
|
+
url: link.url,
|
|
2260
|
+
resourceId: resource.id,
|
|
2261
|
+
locale
|
|
2262
|
+
}
|
|
2263
|
+
});
|
|
2264
|
+
}
|
|
2265
|
+
continue;
|
|
2266
|
+
}
|
|
2237
2267
|
const resourceUrl = getResourceUrl(resource, locale);
|
|
2238
2268
|
if (resourceUrl) {
|
|
2239
2269
|
if (seenUrls.has(resourceUrl)) continue;
|
|
@@ -2250,15 +2280,19 @@ function getDatasourceResourceCards(resources, locale, getResourceDownloadUrl) {
|
|
|
2250
2280
|
resources: [resource]
|
|
2251
2281
|
});
|
|
2252
2282
|
}
|
|
2253
|
-
return [
|
|
2254
|
-
|
|
2255
|
-
|
|
2256
|
-
|
|
2257
|
-
|
|
2258
|
-
|
|
2259
|
-
|
|
2260
|
-
|
|
2261
|
-
|
|
2283
|
+
return [
|
|
2284
|
+
...Array.from(folderGroups.values()).map(({ folder, resources: group }) => ({
|
|
2285
|
+
kind: "folder",
|
|
2286
|
+
key: `folder-${folder.id}`,
|
|
2287
|
+
props: toFolderCardProps(folder, group, locale, getResourceDownloadUrl)
|
|
2288
|
+
})),
|
|
2289
|
+
...ungroupedResources.map((resource) => ({
|
|
2290
|
+
kind: "resource",
|
|
2291
|
+
key: `resource-${resource.id}`,
|
|
2292
|
+
props: toResourceCardProps(resource, locale, getResourceDownloadUrl)
|
|
2293
|
+
})),
|
|
2294
|
+
...linkCards
|
|
2295
|
+
];
|
|
2262
2296
|
}
|
|
2263
2297
|
function DatasourceResourceCardView({ card, variant = "card" }) {
|
|
2264
2298
|
if (card.kind === "folder") return /* @__PURE__ */ jsx(DatasourceFolderCard, {
|
|
@@ -2270,8 +2304,8 @@ function DatasourceResourceCardView({ card, variant = "card" }) {
|
|
|
2270
2304
|
variant
|
|
2271
2305
|
});
|
|
2272
2306
|
}
|
|
2273
|
-
function DatasourceToolResources({ resources, locale, className, getResourceDownloadUrl }) {
|
|
2274
|
-
const cards = getDatasourceResourceCards(resources, locale, getResourceDownloadUrl);
|
|
2307
|
+
function DatasourceToolResources({ resources, resourceLinks, locale, className, getResourceDownloadUrl }) {
|
|
2308
|
+
const cards = getDatasourceResourceCards(resources, locale, getResourceDownloadUrl, resourceLinks);
|
|
2275
2309
|
return /* @__PURE__ */ jsx("section", {
|
|
2276
2310
|
"aria-label": getUiCopy(locale).datasourceResources,
|
|
2277
2311
|
className: joinClasses("flex flex-wrap gap-3", className),
|
|
@@ -2406,18 +2440,18 @@ function WebSearchResultItem({ result }) {
|
|
|
2406
2440
|
const imageUrl = toStringOrNull$2(result.image_url);
|
|
2407
2441
|
const faviconUrl = getFaviconUrl(result.url);
|
|
2408
2442
|
return /* @__PURE__ */ jsx("article", {
|
|
2409
|
-
className: "rounded-lg border border-
|
|
2443
|
+
className: "rounded-lg border border-border bg-surface p-4",
|
|
2410
2444
|
children: /* @__PURE__ */ jsxs("div", {
|
|
2411
2445
|
className: "flex items-start gap-3",
|
|
2412
2446
|
children: [/* @__PURE__ */ jsxs("span", {
|
|
2413
2447
|
"aria-hidden": "true",
|
|
2414
|
-
className: "relative flex h-8 w-8 shrink-0 items-center justify-center overflow-hidden rounded-full border border-
|
|
2448
|
+
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",
|
|
2415
2449
|
children: [/* @__PURE__ */ jsx(Globe, { className: "h-4 w-4" }), faviconUrl ? /* @__PURE__ */ jsx("img", {
|
|
2416
2450
|
src: faviconUrl,
|
|
2417
2451
|
alt: "",
|
|
2418
2452
|
width: "16",
|
|
2419
2453
|
height: "16",
|
|
2420
|
-
className: "absolute h-4 w-4 bg-
|
|
2454
|
+
className: "absolute h-4 w-4 bg-surface",
|
|
2421
2455
|
onError: (event) => {
|
|
2422
2456
|
event.currentTarget.style.display = "none";
|
|
2423
2457
|
}
|
|
@@ -2429,28 +2463,28 @@ function WebSearchResultItem({ result }) {
|
|
|
2429
2463
|
href: result.url,
|
|
2430
2464
|
target: "_blank",
|
|
2431
2465
|
rel: "noreferrer noopener",
|
|
2432
|
-
className: "block line-clamp-2 text-sm font-medium leading-5 text-
|
|
2466
|
+
className: "block line-clamp-2 text-sm font-medium leading-5 text-foreground hover:underline",
|
|
2433
2467
|
children: result.title
|
|
2434
2468
|
}),
|
|
2435
2469
|
/* @__PURE__ */ jsxs("div", {
|
|
2436
|
-
className: "flex flex-wrap items-center gap-1.5 text-xs text-
|
|
2470
|
+
className: "flex flex-wrap items-center gap-1.5 text-xs text-muted",
|
|
2437
2471
|
children: [
|
|
2438
2472
|
date ? /* @__PURE__ */ jsx("span", { children: date }) : null,
|
|
2439
2473
|
source ? /* @__PURE__ */ jsx("span", {
|
|
2440
|
-
className: "rounded-full bg-
|
|
2474
|
+
className: "rounded-full bg-surface-subtle px-1.5 py-0.5 capitalize text-secondary",
|
|
2441
2475
|
children: source
|
|
2442
2476
|
}) : null,
|
|
2443
2477
|
!date && !source && hostname ? /* @__PURE__ */ jsx("span", { children: hostname }) : null
|
|
2444
2478
|
]
|
|
2445
2479
|
}),
|
|
2446
2480
|
snippet ? /* @__PURE__ */ jsx("p", {
|
|
2447
|
-
className: "line-clamp-2 text-xs leading-5 text-
|
|
2481
|
+
className: "line-clamp-2 text-xs leading-5 text-secondary",
|
|
2448
2482
|
children: snippet
|
|
2449
2483
|
}) : null,
|
|
2450
2484
|
imageUrl ? /* @__PURE__ */ jsx("img", {
|
|
2451
2485
|
src: imageUrl,
|
|
2452
2486
|
alt: "",
|
|
2453
|
-
className: "max-h-64 w-full rounded-md border border-
|
|
2487
|
+
className: "max-h-64 w-full rounded-md border border-border object-contain",
|
|
2454
2488
|
loading: "lazy"
|
|
2455
2489
|
}) : null
|
|
2456
2490
|
]
|
|
@@ -2467,7 +2501,7 @@ function ToolResultWebSearchCard({ part, locale, className }) {
|
|
|
2467
2501
|
const sourceLabel = searchResults.length === 1 ? copy.singularSource : copy.pluralSources;
|
|
2468
2502
|
return /* @__PURE__ */ jsxs(Sheet, { children: [/* @__PURE__ */ jsxs(SheetTrigger, {
|
|
2469
2503
|
"aria-label": `Web: ${copy.webSearchTitle}, ${searchResults.length} ${sourceLabel}`,
|
|
2470
|
-
className: joinClasses("plai-tool-result-web-search-card min-h-[183px] w-[186px] rounded-lg bg-
|
|
2504
|
+
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),
|
|
2471
2505
|
children: [
|
|
2472
2506
|
/* @__PURE__ */ jsxs("header", {
|
|
2473
2507
|
className: "flex items-center gap-3",
|
|
@@ -2484,7 +2518,7 @@ function ToolResultWebSearchCard({ part, locale, className }) {
|
|
|
2484
2518
|
children: copy.webSearchTitle
|
|
2485
2519
|
}),
|
|
2486
2520
|
/* @__PURE__ */ jsx("p", {
|
|
2487
|
-
className: "mt-2 text-xs leading-4 text-
|
|
2521
|
+
className: "mt-2 text-xs leading-4 text-secondary",
|
|
2488
2522
|
children: part.state === "pending" ? uiCopy.searching : `${searchResults.length} ${sourceLabel}`
|
|
2489
2523
|
})
|
|
2490
2524
|
]
|
|
@@ -2511,13 +2545,13 @@ function ToolResultWebSearchResults({ part, searchResults = getWebSearchResults(
|
|
|
2511
2545
|
className: "space-y-3",
|
|
2512
2546
|
children: searchResults.map((result, index) => /* @__PURE__ */ jsx(WebSearchResultItem, { result }, `${result.url}-${index}`))
|
|
2513
2547
|
}) : part.state === "pending" ? /* @__PURE__ */ jsx("p", {
|
|
2514
|
-
className: "text-sm text-
|
|
2548
|
+
className: "text-sm text-secondary",
|
|
2515
2549
|
children: copy.searchingForSources
|
|
2516
2550
|
}) : /* @__PURE__ */ jsx("p", {
|
|
2517
|
-
className: "text-sm text-
|
|
2551
|
+
className: "text-sm text-secondary",
|
|
2518
2552
|
children: copy.noSourcesReturned
|
|
2519
2553
|
}), errorDetails ? /* @__PURE__ */ jsxs("p", {
|
|
2520
|
-
className: "mt-4 rounded border border-
|
|
2554
|
+
className: "mt-4 rounded border border-danger-border bg-danger-subtle px-3 py-2 text-xs text-danger-strong",
|
|
2521
2555
|
children: [
|
|
2522
2556
|
/* @__PURE__ */ jsxs("span", {
|
|
2523
2557
|
className: "font-semibold",
|
|
@@ -2539,8 +2573,12 @@ function getDatasourceResources$2(part) {
|
|
|
2539
2573
|
const resources = part.metadata?.resources;
|
|
2540
2574
|
return Array.isArray(resources) ? resources.filter(isDatasourceResource) : [];
|
|
2541
2575
|
}
|
|
2576
|
+
function getDatasourceResourceLinks$1(part) {
|
|
2577
|
+
const links = part.metadata?.resource_links;
|
|
2578
|
+
return Array.isArray(links) ? links.filter(isResourceLink) : [];
|
|
2579
|
+
}
|
|
2542
2580
|
function getAggregatedCards(parts, locale, getResourceDownloadUrl) {
|
|
2543
|
-
const datasourceCards = parts.filter((part) => part.toolType === "datasource").flatMap((part) => getDatasourceResourceCards(getDatasourceResources$2(part), locale, getResourceDownloadUrl).map((card) => ({
|
|
2581
|
+
const datasourceCards = parts.filter((part) => part.toolType === "datasource").flatMap((part) => getDatasourceResourceCards(getDatasourceResources$2(part), locale, getResourceDownloadUrl, getDatasourceResourceLinks$1(part)).map((card) => ({
|
|
2544
2582
|
kind: "datasource",
|
|
2545
2583
|
key: `${part.id}-${card.key}`,
|
|
2546
2584
|
card
|
|
@@ -2562,7 +2600,7 @@ function SourceCard({ source, locale, variant = "card" }) {
|
|
|
2562
2600
|
locale
|
|
2563
2601
|
});
|
|
2564
2602
|
return /* @__PURE__ */ jsxs("section", {
|
|
2565
|
-
className: "rounded-lg bg-
|
|
2603
|
+
className: "rounded-lg bg-surface-subtle p-4",
|
|
2566
2604
|
children: [/* @__PURE__ */ jsxs("header", {
|
|
2567
2605
|
className: "mb-4 flex items-center gap-3",
|
|
2568
2606
|
children: [/* @__PURE__ */ jsx(Globe, {
|
|
@@ -2600,7 +2638,7 @@ function AggregatedSourceResults({ parts, locale, maxVisible = 3, className, get
|
|
|
2600
2638
|
locale
|
|
2601
2639
|
}, source.key)), overflowCount > 0 ? /* @__PURE__ */ jsxs(Sheet, { children: [/* @__PURE__ */ jsxs(SheetTrigger, {
|
|
2602
2640
|
"aria-label": `+${overflowCount} ${overflowLabel}`,
|
|
2603
|
-
className: "flex min-h-[183px] w-[186px] max-w-full flex-col justify-center rounded-lg bg-
|
|
2641
|
+
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",
|
|
2604
2642
|
children: [/* @__PURE__ */ jsxs("span", {
|
|
2605
2643
|
className: "text-2xl font-medium leading-7",
|
|
2606
2644
|
children: ["+", overflowCount]
|
|
@@ -2653,15 +2691,15 @@ function getFileExtension(name, contentType) {
|
|
|
2653
2691
|
return null;
|
|
2654
2692
|
}
|
|
2655
2693
|
function getFileIconClass(extension) {
|
|
2656
|
-
if (extension === "pdf") return "text-
|
|
2657
|
-
if (["doc", "docx"].includes(extension ?? "")) return "text-
|
|
2694
|
+
if (extension === "pdf") return "text-danger";
|
|
2695
|
+
if (["doc", "docx"].includes(extension ?? "")) return "text-info";
|
|
2658
2696
|
if ([
|
|
2659
2697
|
"xls",
|
|
2660
2698
|
"xlsx",
|
|
2661
2699
|
"csv"
|
|
2662
|
-
].includes(extension ?? "")) return "text-
|
|
2663
|
-
if (["ppt", "pptx"].includes(extension ?? "")) return "text-
|
|
2664
|
-
return "text-
|
|
2700
|
+
].includes(extension ?? "")) return "text-success";
|
|
2701
|
+
if (["ppt", "pptx"].includes(extension ?? "")) return "text-warning";
|
|
2702
|
+
return "text-muted";
|
|
2665
2703
|
}
|
|
2666
2704
|
|
|
2667
2705
|
//#endregion
|
|
@@ -2917,88 +2955,94 @@ function MemoryProposalCard({ proposal: initial, actions, activeAgentId, locale,
|
|
|
2917
2955
|
const statusCopy = proposal.status === "ACCEPTED" ? copy.accepted : proposal.status === "REJECTED" ? copy.rejected : proposal.status === "EXPIRED" ? copy.expired : proposal.status === "CONFLICTED" ? copy.conflicted : null;
|
|
2918
2956
|
const operation = proposal.operation === "CREATE" ? copy.create : proposal.operation === "UPDATE" ? copy.update : copy.delete;
|
|
2919
2957
|
return /* @__PURE__ */ jsxs("section", {
|
|
2920
|
-
className: joinClasses("
|
|
2958
|
+
className: joinClasses("plai-memory-proposal-card overflow-hidden rounded-lg border border-success-border bg-success-subtle/30 text-left", className),
|
|
2921
2959
|
"data-memory-proposal-id": proposal.id,
|
|
2922
|
-
children: [
|
|
2923
|
-
|
|
2924
|
-
|
|
2960
|
+
children: [/* @__PURE__ */ jsx("header", {
|
|
2961
|
+
className: "border-b border-success-border px-3 py-2",
|
|
2962
|
+
children: /* @__PURE__ */ jsxs("div", {
|
|
2963
|
+
className: "flex items-center gap-2",
|
|
2925
2964
|
children: [/* @__PURE__ */ jsxs("h4", {
|
|
2926
|
-
className: "flex items-center gap-2 text-sm font-semibold text-
|
|
2927
|
-
children: [/* @__PURE__ */ jsx(Brain, { className: "size-4" }), copy.
|
|
2965
|
+
className: "flex items-center gap-2 text-sm font-semibold text-foreground",
|
|
2966
|
+
children: [/* @__PURE__ */ jsx(Brain, { className: "size-4" }), proposal.scope === "USER" ? copy.user : copy.project]
|
|
2928
2967
|
}), /* @__PURE__ */ jsxs("div", {
|
|
2968
|
+
"aria-label": "type",
|
|
2929
2969
|
className: "flex flex-wrap gap-2 text-xs",
|
|
2930
|
-
children: [
|
|
2931
|
-
|
|
2932
|
-
|
|
2933
|
-
|
|
2934
|
-
|
|
2935
|
-
|
|
2936
|
-
|
|
2937
|
-
children: operation
|
|
2938
|
-
}),
|
|
2939
|
-
/* @__PURE__ */ jsx("span", {
|
|
2940
|
-
className: "rounded-full bg-slate-100 px-2 py-0.5",
|
|
2941
|
-
children: formatCategory(proposal.category)
|
|
2942
|
-
})
|
|
2943
|
-
]
|
|
2944
|
-
})]
|
|
2945
|
-
}),
|
|
2946
|
-
proposal.previous_content && proposal.previous_content !== REDACTED ? /* @__PURE__ */ jsxs("div", {
|
|
2947
|
-
className: "rounded-md bg-slate-100 p-3 text-sm",
|
|
2948
|
-
children: [/* @__PURE__ */ jsx("span", {
|
|
2949
|
-
className: "mb-1 block text-xs font-medium text-slate-500",
|
|
2950
|
-
children: copy.previous
|
|
2951
|
-
}), /* @__PURE__ */ jsx("p", {
|
|
2952
|
-
className: "whitespace-pre-wrap break-words",
|
|
2953
|
-
children: proposal.previous_content
|
|
2954
|
-
})]
|
|
2955
|
-
}) : null,
|
|
2956
|
-
proposal.content && proposal.content !== REDACTED ? /* @__PURE__ */ jsxs("div", {
|
|
2957
|
-
className: "text-sm",
|
|
2958
|
-
children: [/* @__PURE__ */ jsx("span", {
|
|
2959
|
-
className: "mb-1 block text-xs font-medium text-slate-500",
|
|
2960
|
-
children: copy.proposed
|
|
2961
|
-
}), /* @__PURE__ */ jsx("p", {
|
|
2962
|
-
className: "whitespace-pre-wrap break-words",
|
|
2963
|
-
children: proposal.content
|
|
2964
|
-
})]
|
|
2965
|
-
}) : null,
|
|
2966
|
-
canResolve ? /* @__PURE__ */ jsxs("div", {
|
|
2967
|
-
className: "flex gap-2",
|
|
2968
|
-
children: [/* @__PURE__ */ jsxs("button", {
|
|
2969
|
-
type: "button",
|
|
2970
|
-
disabled: resolving,
|
|
2971
|
-
onClick: () => void resolve(true),
|
|
2972
|
-
className: "inline-flex items-center rounded-md bg-slate-900 px-3 py-1.5 text-xs font-medium text-white disabled:opacity-50",
|
|
2973
|
-
children: [resolving ? /* @__PURE__ */ jsx(LoaderCircle, { className: "mr-2 size-3 animate-spin" }) : null, copy.accept]
|
|
2974
|
-
}), /* @__PURE__ */ jsx("button", {
|
|
2975
|
-
type: "button",
|
|
2976
|
-
disabled: resolving,
|
|
2977
|
-
onClick: () => void resolve(false),
|
|
2978
|
-
className: "rounded-md border border-slate-300 bg-white px-3 py-1.5 text-xs font-medium disabled:opacity-50",
|
|
2979
|
-
children: copy.reject
|
|
2980
|
-
})]
|
|
2981
|
-
}) : null,
|
|
2982
|
-
proposal.status === "PENDING" && !canResolve ? /* @__PURE__ */ jsx("p", {
|
|
2983
|
-
className: "text-xs font-medium text-slate-500",
|
|
2984
|
-
children: proposal.scope === "PROJECT" ? copy.review : copy.unavailable
|
|
2985
|
-
}) : null,
|
|
2986
|
-
proposal.status === "ACCEPTED" && statusCopy ? /* @__PURE__ */ jsxs("span", {
|
|
2987
|
-
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",
|
|
2988
|
-
children: [statusCopy, /* @__PURE__ */ jsx(Check, {
|
|
2989
|
-
className: "size-3.5 stroke-[2.5] text-emerald-600",
|
|
2990
|
-
"aria-hidden": "true"
|
|
2970
|
+
children: [/* @__PURE__ */ jsx("span", {
|
|
2971
|
+
className: "rounded-full bg-surface-subtle px-2 py-0.5",
|
|
2972
|
+
children: operation
|
|
2973
|
+
}), /* @__PURE__ */ jsx("span", {
|
|
2974
|
+
className: "rounded-full bg-surface-subtle px-2 py-0.5",
|
|
2975
|
+
children: formatCategory(proposal.category)
|
|
2976
|
+
})]
|
|
2991
2977
|
})]
|
|
2992
|
-
})
|
|
2993
|
-
|
|
2994
|
-
|
|
2995
|
-
|
|
2996
|
-
|
|
2997
|
-
|
|
2998
|
-
|
|
2999
|
-
|
|
3000
|
-
|
|
3001
|
-
|
|
2978
|
+
})
|
|
2979
|
+
}), /* @__PURE__ */ jsxs("div", {
|
|
2980
|
+
className: "space-y-3 px-3 py-2",
|
|
2981
|
+
children: [
|
|
2982
|
+
" ",
|
|
2983
|
+
proposal.previous_content && proposal.previous_content !== REDACTED ? /* @__PURE__ */ jsxs("div", {
|
|
2984
|
+
className: "rounded-md bg-surface-subtle p-3 text-sm",
|
|
2985
|
+
children: [/* @__PURE__ */ jsx("span", {
|
|
2986
|
+
className: "mb-1 block text-xs font-medium text-muted",
|
|
2987
|
+
children: copy.previous
|
|
2988
|
+
}), /* @__PURE__ */ jsx("p", {
|
|
2989
|
+
className: "whitespace-pre-wrap break-words",
|
|
2990
|
+
children: proposal.previous_content
|
|
2991
|
+
})]
|
|
2992
|
+
}) : null,
|
|
2993
|
+
proposal.content && proposal.content !== REDACTED ? /* @__PURE__ */ jsxs("div", {
|
|
2994
|
+
className: "text-sm",
|
|
2995
|
+
children: [/* @__PURE__ */ jsx("span", {
|
|
2996
|
+
className: "mb-1 block text-xs font-medium text-muted",
|
|
2997
|
+
children: copy.proposed
|
|
2998
|
+
}), /* @__PURE__ */ jsx("p", {
|
|
2999
|
+
className: "whitespace-pre-wrap break-words",
|
|
3000
|
+
children: proposal.content
|
|
3001
|
+
})]
|
|
3002
|
+
}) : null,
|
|
3003
|
+
canResolve ? /* @__PURE__ */ jsxs("div", {
|
|
3004
|
+
className: "flex gap-2",
|
|
3005
|
+
children: [/* @__PURE__ */ jsxs("button", {
|
|
3006
|
+
type: "button",
|
|
3007
|
+
disabled: resolving,
|
|
3008
|
+
onClick: () => void resolve(true),
|
|
3009
|
+
className: "inline-flex items-center rounded-md bg-inverse px-3 py-1.5 text-xs font-medium text-inverse-foreground disabled:opacity-50",
|
|
3010
|
+
children: [resolving ? /* @__PURE__ */ jsx(LoaderCircle, { className: "mr-2 size-3 animate-spin" }) : null, copy.accept]
|
|
3011
|
+
}), /* @__PURE__ */ jsx("button", {
|
|
3012
|
+
type: "button",
|
|
3013
|
+
disabled: resolving,
|
|
3014
|
+
onClick: () => void resolve(false),
|
|
3015
|
+
className: "rounded-md border border-border-strong bg-surface px-3 py-1.5 text-xs font-medium disabled:opacity-50",
|
|
3016
|
+
children: copy.reject
|
|
3017
|
+
})]
|
|
3018
|
+
}) : null,
|
|
3019
|
+
proposal.status === "PENDING" && !canResolve ? /* @__PURE__ */ jsxs("span", {
|
|
3020
|
+
className: "inline-flex items-center gap-1.5 rounded-full border bg-surface px-3 py-1 text-xs font-medium text-foreground",
|
|
3021
|
+
children: [proposal.scope === "PROJECT" ? copy.review : copy.unavailable, /* @__PURE__ */ jsx(Clock, {
|
|
3022
|
+
className: "size-3.5 stroke-[2.5] text-muted",
|
|
3023
|
+
"aria-hidden": "true"
|
|
3024
|
+
})]
|
|
3025
|
+
}) : null,
|
|
3026
|
+
proposal.status === "ACCEPTED" && statusCopy ? /* @__PURE__ */ jsxs("span", {
|
|
3027
|
+
className: "inline-flex items-center gap-1.5 rounded-full border bg-surface px-3 py-1 text-xs font-medium text-foreground",
|
|
3028
|
+
children: [statusCopy, /* @__PURE__ */ jsx(Check, {
|
|
3029
|
+
className: "size-3.5 stroke-[2.5] text-success",
|
|
3030
|
+
"aria-hidden": "true"
|
|
3031
|
+
})]
|
|
3032
|
+
}) : null,
|
|
3033
|
+
statusCopy && proposal.status !== "ACCEPTED" ? /* @__PURE__ */ jsxs("span", {
|
|
3034
|
+
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",
|
|
3035
|
+
children: [statusCopy, /* @__PURE__ */ jsx(X$1, {
|
|
3036
|
+
className: "size-3.5 stroke-[2.5]",
|
|
3037
|
+
"aria-hidden": "true"
|
|
3038
|
+
})]
|
|
3039
|
+
}) : null,
|
|
3040
|
+
error ? /* @__PURE__ */ jsx("p", {
|
|
3041
|
+
className: "text-xs text-danger",
|
|
3042
|
+
children: error
|
|
3043
|
+
}) : null
|
|
3044
|
+
]
|
|
3045
|
+
})]
|
|
3002
3046
|
});
|
|
3003
3047
|
}
|
|
3004
3048
|
function mergeProposal(current, incoming) {
|
|
@@ -3105,7 +3149,7 @@ function ToolError({ part, locale, defaultOpen = false, className,...props }) {
|
|
|
3105
3149
|
const copy = getToolErrorCopy(part, locale);
|
|
3106
3150
|
const errorDetails = formatToolErrorDetails(part.errorDetails);
|
|
3107
3151
|
return /* @__PURE__ */ jsxs("section", {
|
|
3108
|
-
className: joinClasses("text-sm text-
|
|
3152
|
+
className: joinClasses("text-sm text-secondary", className),
|
|
3109
3153
|
"data-tool-call-id": part.id,
|
|
3110
3154
|
"data-tool-call-state": part.state,
|
|
3111
3155
|
...props,
|
|
@@ -3113,14 +3157,17 @@ function ToolError({ part, locale, defaultOpen = false, className,...props }) {
|
|
|
3113
3157
|
type: "button",
|
|
3114
3158
|
"aria-controls": contentId,
|
|
3115
3159
|
"aria-expanded": isOpen,
|
|
3116
|
-
className: "inline-flex items-center gap-2 rounded-md py-1 text-left font-medium text-
|
|
3160
|
+
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",
|
|
3117
3161
|
onClick: () => setIsOpen((value) => !value),
|
|
3118
3162
|
children: [
|
|
3119
3163
|
/* @__PURE__ */ jsx(CircleX, {
|
|
3120
3164
|
className: "size-4 shrink-0",
|
|
3121
3165
|
"aria-hidden": "true"
|
|
3122
3166
|
}),
|
|
3123
|
-
/* @__PURE__ */ jsx("span", {
|
|
3167
|
+
/* @__PURE__ */ jsx("span", {
|
|
3168
|
+
className: "line-clamp-1",
|
|
3169
|
+
children: copy.summary
|
|
3170
|
+
}),
|
|
3124
3171
|
/* @__PURE__ */ jsx(ChevronDown, {
|
|
3125
3172
|
className: joinClasses("size-4 shrink-0 transition-transform motion-reduce:transition-none", isOpen ? "rotate-180" : void 0),
|
|
3126
3173
|
"aria-hidden": "true"
|
|
@@ -3128,27 +3175,27 @@ function ToolError({ part, locale, defaultOpen = false, className,...props }) {
|
|
|
3128
3175
|
]
|
|
3129
3176
|
}), isOpen ? /* @__PURE__ */ jsxs("div", {
|
|
3130
3177
|
id: contentId,
|
|
3131
|
-
className: "mt-2 space-y-3 border-l-2 border-
|
|
3178
|
+
className: "mt-2 space-y-3 border-l-2 border-danger-border pl-3",
|
|
3132
3179
|
children: [
|
|
3133
3180
|
/* @__PURE__ */ jsxs("div", { children: [/* @__PURE__ */ jsx("p", {
|
|
3134
|
-
className: "mb-2 text-xs font-semibold text-
|
|
3181
|
+
className: "mb-2 text-xs font-semibold text-strong",
|
|
3135
3182
|
children: copy.input
|
|
3136
3183
|
}), /* @__PURE__ */ jsx("pre", {
|
|
3137
|
-
className: "overflow-x-auto whitespace-pre-wrap rounded-md bg-
|
|
3184
|
+
className: "overflow-x-auto whitespace-pre-wrap rounded-md bg-surface-subtle p-3 text-xs leading-5 text-strong",
|
|
3138
3185
|
children: formatJson$1(part.input)
|
|
3139
3186
|
})] }),
|
|
3140
3187
|
/* @__PURE__ */ jsxs("div", { children: [/* @__PURE__ */ jsx("p", {
|
|
3141
|
-
className: "mb-2 text-xs font-semibold text-
|
|
3188
|
+
className: "mb-2 text-xs font-semibold text-strong",
|
|
3142
3189
|
children: copy.output
|
|
3143
3190
|
}), /* @__PURE__ */ jsx("pre", {
|
|
3144
|
-
className: "overflow-x-auto whitespace-pre-wrap rounded-md bg-
|
|
3191
|
+
className: "overflow-x-auto whitespace-pre-wrap rounded-md bg-surface-subtle p-3 text-xs leading-5 text-strong",
|
|
3145
3192
|
children: part.result === void 0 ? copy.noOutput : formatJson$1(part.result)
|
|
3146
3193
|
})] }),
|
|
3147
3194
|
errorDetails ? /* @__PURE__ */ jsxs("div", { children: [/* @__PURE__ */ jsx("p", {
|
|
3148
|
-
className: "mb-2 text-xs font-semibold text-
|
|
3195
|
+
className: "mb-2 text-xs font-semibold text-danger-strong",
|
|
3149
3196
|
children: copy.details
|
|
3150
3197
|
}), /* @__PURE__ */ jsx("p", {
|
|
3151
|
-
className: "whitespace-pre-wrap text-xs leading-5 text-
|
|
3198
|
+
className: "whitespace-pre-wrap text-xs leading-5 text-danger-strong",
|
|
3152
3199
|
children: errorDetails
|
|
3153
3200
|
})] }) : null
|
|
3154
3201
|
]
|
|
@@ -3188,12 +3235,12 @@ function ToolResultAgentInvocationCard({ part, className, onOpenThread, locale }
|
|
|
3188
3235
|
const pending = part.state === "pending";
|
|
3189
3236
|
return /* @__PURE__ */ jsxs(Sheet, { children: [/* @__PURE__ */ jsx(SheetTrigger, {
|
|
3190
3237
|
"aria-label": `${copy.agent}: ${agentName}`,
|
|
3191
|
-
className: joinClasses("w-full rounded-lg border border-
|
|
3238
|
+
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),
|
|
3192
3239
|
children: /* @__PURE__ */ jsxs("span", {
|
|
3193
3240
|
className: "flex items-center gap-2 px-3 py-2 text-sm",
|
|
3194
3241
|
children: [
|
|
3195
3242
|
/* @__PURE__ */ jsx(Bot, {
|
|
3196
|
-
className: "h-4 w-4 shrink-0 text-
|
|
3243
|
+
className: "h-4 w-4 shrink-0 text-muted",
|
|
3197
3244
|
"aria-hidden": "true"
|
|
3198
3245
|
}),
|
|
3199
3246
|
/* @__PURE__ */ jsx("span", {
|
|
@@ -3201,19 +3248,19 @@ function ToolResultAgentInvocationCard({ part, className, onOpenThread, locale }
|
|
|
3201
3248
|
children: copy.agent
|
|
3202
3249
|
}),
|
|
3203
3250
|
/* @__PURE__ */ jsx("span", {
|
|
3204
|
-
className: "min-w-0 truncate border-
|
|
3251
|
+
className: "min-w-0 truncate border-border-strong border px-2 py-0.5 rounded-md text-xs text-muted",
|
|
3205
3252
|
children: agentName
|
|
3206
3253
|
}),
|
|
3207
3254
|
/* @__PURE__ */ jsx("span", {
|
|
3208
3255
|
className: "ml-auto shrink-0",
|
|
3209
3256
|
children: pending ? /* @__PURE__ */ jsx(LoaderCircle, {
|
|
3210
|
-
className: "h-4 w-4 animate-spin text-
|
|
3257
|
+
className: "h-4 w-4 animate-spin text-warning",
|
|
3211
3258
|
"aria-label": copy.pending
|
|
3212
3259
|
}) : failed ? /* @__PURE__ */ jsx(XCircle, {
|
|
3213
|
-
className: "h-4 w-4 text-
|
|
3260
|
+
className: "h-4 w-4 text-danger",
|
|
3214
3261
|
"aria-hidden": "true"
|
|
3215
3262
|
}) : /* @__PURE__ */ jsx(CheckCircle2, {
|
|
3216
|
-
className: "h-4 w-4 text-
|
|
3263
|
+
className: "h-4 w-4 text-success",
|
|
3217
3264
|
"aria-hidden": "true"
|
|
3218
3265
|
})
|
|
3219
3266
|
})
|
|
@@ -3232,25 +3279,25 @@ function ToolResultAgentInvocationCard({ part, className, onOpenThread, locale }
|
|
|
3232
3279
|
className: "grid gap-2 text-sm",
|
|
3233
3280
|
children: [
|
|
3234
3281
|
/* @__PURE__ */ jsxs("div", { children: [/* @__PURE__ */ jsx("dt", {
|
|
3235
|
-
className: "text-xs text-
|
|
3282
|
+
className: "text-xs text-muted",
|
|
3236
3283
|
children: copy.status
|
|
3237
3284
|
}), /* @__PURE__ */ jsx("dd", { children: getUiStatusLabel(part.state, copy) })] }),
|
|
3238
3285
|
metadata?.agent_id ? /* @__PURE__ */ jsxs("div", { children: [/* @__PURE__ */ jsx("dt", {
|
|
3239
|
-
className: "text-xs text-
|
|
3286
|
+
className: "text-xs text-muted",
|
|
3240
3287
|
children: copy.agentId
|
|
3241
3288
|
}), /* @__PURE__ */ jsx("dd", {
|
|
3242
3289
|
className: "break-all",
|
|
3243
3290
|
children: metadata.agent_id
|
|
3244
3291
|
})] }) : null,
|
|
3245
3292
|
metadata?.tracked_execution_id ? /* @__PURE__ */ jsxs("div", { children: [/* @__PURE__ */ jsx("dt", {
|
|
3246
|
-
className: "text-xs text-
|
|
3293
|
+
className: "text-xs text-muted",
|
|
3247
3294
|
children: copy.executionId
|
|
3248
3295
|
}), /* @__PURE__ */ jsx("dd", {
|
|
3249
3296
|
className: "break-all",
|
|
3250
3297
|
children: metadata.tracked_execution_id
|
|
3251
3298
|
})] }) : null,
|
|
3252
3299
|
threadId ? /* @__PURE__ */ jsxs("div", { children: [/* @__PURE__ */ jsx("dt", {
|
|
3253
|
-
className: "text-xs text-
|
|
3300
|
+
className: "text-xs text-muted",
|
|
3254
3301
|
children: copy.threadId
|
|
3255
3302
|
}), /* @__PURE__ */ jsx("dd", {
|
|
3256
3303
|
className: "break-all",
|
|
@@ -3262,19 +3309,19 @@ function ToolResultAgentInvocationCard({ part, className, onOpenThread, locale }
|
|
|
3262
3309
|
className: "mb-2 text-sm font-medium",
|
|
3263
3310
|
children: copy.prompt
|
|
3264
3311
|
}), /* @__PURE__ */ jsx("p", {
|
|
3265
|
-
className: "whitespace-pre-wrap rounded-md border border-
|
|
3312
|
+
className: "whitespace-pre-wrap rounded-md border border-border bg-surface-muted p-3 text-sm leading-6",
|
|
3266
3313
|
children: prompt
|
|
3267
3314
|
})] }) : null,
|
|
3268
3315
|
output$1 ? /* @__PURE__ */ jsxs("div", { children: [/* @__PURE__ */ jsx("h3", {
|
|
3269
3316
|
className: "mb-2 text-sm font-medium",
|
|
3270
3317
|
children: copy.result
|
|
3271
3318
|
}), /* @__PURE__ */ jsx("pre", {
|
|
3272
|
-
className: "overflow-x-auto whitespace-pre-wrap rounded-md border border-
|
|
3319
|
+
className: "overflow-x-auto whitespace-pre-wrap rounded-md border border-border bg-surface-muted p-3 text-xs leading-5",
|
|
3273
3320
|
children: output$1
|
|
3274
3321
|
})] }) : null,
|
|
3275
3322
|
threadId && onOpenThread ? /* @__PURE__ */ jsxs("button", {
|
|
3276
3323
|
type: "button",
|
|
3277
|
-
className: "inline-flex items-center gap-2 rounded-md border border-
|
|
3324
|
+
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",
|
|
3278
3325
|
onClick: () => onOpenThread(threadId),
|
|
3279
3326
|
children: [/* @__PURE__ */ jsx(MessageSquare, {
|
|
3280
3327
|
className: "h-4 w-4",
|
|
@@ -3282,7 +3329,7 @@ function ToolResultAgentInvocationCard({ part, className, onOpenThread, locale }
|
|
|
3282
3329
|
}), copy.openConversation]
|
|
3283
3330
|
}) : null,
|
|
3284
3331
|
error ? /* @__PURE__ */ jsxs("p", {
|
|
3285
|
-
className: "rounded border border-
|
|
3332
|
+
className: "rounded border border-danger-border bg-danger-subtle px-3 py-2 text-xs text-danger-strong",
|
|
3286
3333
|
children: [
|
|
3287
3334
|
/* @__PURE__ */ jsxs("span", {
|
|
3288
3335
|
className: "font-semibold",
|
|
@@ -3334,66 +3381,67 @@ function ToolResultBrowserCard({ part, className, locale }) {
|
|
|
3334
3381
|
const pending = part.state === "pending";
|
|
3335
3382
|
const canExpand = Boolean(preview || error || url);
|
|
3336
3383
|
return /* @__PURE__ */ jsxs("section", {
|
|
3337
|
-
className: joinClasses("overflow-hidden rounded-lg border border-
|
|
3384
|
+
className: joinClasses("plai-tool-result-browser-card overflow-hidden rounded-lg border border-border bg-surface", className),
|
|
3338
3385
|
"aria-label": copy.browserResult,
|
|
3339
|
-
children: [/* @__PURE__ */
|
|
3340
|
-
className: "flex items-center gap-2 px-3 py-2 text-
|
|
3341
|
-
children:
|
|
3342
|
-
|
|
3343
|
-
|
|
3344
|
-
|
|
3345
|
-
|
|
3346
|
-
|
|
3347
|
-
|
|
3348
|
-
|
|
3349
|
-
|
|
3350
|
-
|
|
3351
|
-
className: "min-w-0 truncate border-neutral-500 border px-2 py-0.5 rounded-md text-xs text-neutral-500",
|
|
3352
|
-
children: subtitle
|
|
3353
|
-
}) : null,
|
|
3354
|
-
/* @__PURE__ */ jsxs("span", {
|
|
3355
|
-
className: "ml-auto flex shrink-0 items-center gap-2",
|
|
3356
|
-
children: [pending ? /* @__PURE__ */ jsx(LoaderCircle, {
|
|
3357
|
-
className: "h-4 w-4 animate-spin text-amber-600",
|
|
3358
|
-
"aria-label": copy.pending
|
|
3359
|
-
}) : failed ? /* @__PURE__ */ jsx(XCircle, {
|
|
3360
|
-
className: "h-4 w-4 text-rose-600",
|
|
3361
|
-
"aria-hidden": "true"
|
|
3362
|
-
}) : /* @__PURE__ */ jsx(CheckCircle2, {
|
|
3363
|
-
className: "h-4 w-4 text-emerald-600",
|
|
3386
|
+
children: [/* @__PURE__ */ jsx("header", {
|
|
3387
|
+
className: "flex items-center gap-2 border-b border-border px-3 py-2 text-xs text-secondary",
|
|
3388
|
+
children: /* @__PURE__ */ jsxs("button", {
|
|
3389
|
+
type: "button",
|
|
3390
|
+
disabled: !canExpand,
|
|
3391
|
+
"aria-label": expanded ? copy.collapseBrowserResult : copy.expandBrowserResult,
|
|
3392
|
+
"aria-expanded": canExpand ? expanded : void 0,
|
|
3393
|
+
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",
|
|
3394
|
+
onClick: () => setExpanded((value) => !value),
|
|
3395
|
+
children: [
|
|
3396
|
+
/* @__PURE__ */ jsx(Globe, {
|
|
3397
|
+
className: "h-4 w-4 shrink-0 text-muted",
|
|
3364
3398
|
"aria-hidden": "true"
|
|
3365
|
-
}),
|
|
3366
|
-
|
|
3367
|
-
"
|
|
3368
|
-
|
|
3369
|
-
|
|
3370
|
-
|
|
3371
|
-
|
|
3372
|
-
|
|
3399
|
+
}),
|
|
3400
|
+
/* @__PURE__ */ jsx("span", {
|
|
3401
|
+
className: "font-medium text-strong",
|
|
3402
|
+
children: copy.browser
|
|
3403
|
+
}),
|
|
3404
|
+
subtitle ? /* @__PURE__ */ jsx("span", {
|
|
3405
|
+
className: "min-w-0 truncate border-border-strong border px-2 py-0.5 rounded-md text-xs text-muted",
|
|
3406
|
+
children: subtitle
|
|
3407
|
+
}) : null,
|
|
3408
|
+
/* @__PURE__ */ jsxs("span", {
|
|
3409
|
+
className: "ml-auto flex shrink-0 items-center gap-2",
|
|
3410
|
+
children: [pending ? /* @__PURE__ */ jsx(LoaderCircle, {
|
|
3411
|
+
className: "h-4 w-4 animate-spin text-warning",
|
|
3412
|
+
"aria-label": copy.pending
|
|
3413
|
+
}) : failed ? /* @__PURE__ */ jsx(XCircle, {
|
|
3414
|
+
className: "h-4 w-4 text-danger",
|
|
3373
3415
|
"aria-hidden": "true"
|
|
3374
|
-
}) : /* @__PURE__ */ jsx(
|
|
3375
|
-
className: "h-
|
|
3416
|
+
}) : /* @__PURE__ */ jsx(CheckCircle2, {
|
|
3417
|
+
className: "h-4 w-4 text-success",
|
|
3376
3418
|
"aria-hidden": "true"
|
|
3377
|
-
})
|
|
3378
|
-
|
|
3379
|
-
|
|
3380
|
-
|
|
3419
|
+
}), canExpand ? expanded ? /* @__PURE__ */ jsx(ChevronUp, {
|
|
3420
|
+
className: "h-4 w-4 text-muted",
|
|
3421
|
+
"aria-hidden": "true"
|
|
3422
|
+
}) : /* @__PURE__ */ jsx(ChevronDown, {
|
|
3423
|
+
className: "h-4 w-4 text-muted",
|
|
3424
|
+
"aria-hidden": "true"
|
|
3425
|
+
}) : null]
|
|
3426
|
+
})
|
|
3427
|
+
]
|
|
3428
|
+
})
|
|
3381
3429
|
}), expanded ? /* @__PURE__ */ jsxs("div", {
|
|
3382
|
-
className: "space-y-3 border-t border-
|
|
3430
|
+
className: "space-y-3 border-t border-border bg-surface-muted p-3",
|
|
3383
3431
|
children: [
|
|
3384
3432
|
url ? /* @__PURE__ */ jsx("a", {
|
|
3385
3433
|
href: url,
|
|
3386
3434
|
target: "_blank",
|
|
3387
3435
|
rel: "noreferrer noopener",
|
|
3388
|
-
className: "block truncate text-xs text-
|
|
3436
|
+
className: "block truncate text-xs text-info-strong underline underline-offset-2 hover:text-info-strong",
|
|
3389
3437
|
children: url
|
|
3390
3438
|
}) : null,
|
|
3391
3439
|
preview ? /* @__PURE__ */ jsx("p", {
|
|
3392
|
-
className: "whitespace-pre-wrap text-xs leading-5 text-
|
|
3440
|
+
className: "whitespace-pre-wrap text-xs leading-5 text-secondary",
|
|
3393
3441
|
children: preview
|
|
3394
3442
|
}) : null,
|
|
3395
3443
|
error ? /* @__PURE__ */ jsxs("p", {
|
|
3396
|
-
className: "text-xs text-
|
|
3444
|
+
className: "text-xs text-danger-strong",
|
|
3397
3445
|
children: [
|
|
3398
3446
|
/* @__PURE__ */ jsxs("span", {
|
|
3399
3447
|
className: "font-semibold",
|
|
@@ -3472,159 +3520,161 @@ function ToolResultEmailSendCard({ part, className, locale }) {
|
|
|
3472
3520
|
const emailInput = parseEmailSendInput(part);
|
|
3473
3521
|
const emailResult = parseEmailSendResult(part);
|
|
3474
3522
|
const errorDetails = formatToolErrorDetails(part.errorDetails);
|
|
3475
|
-
const statusClass = part.state === "error" ? "border-
|
|
3523
|
+
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";
|
|
3476
3524
|
return /* @__PURE__ */ jsxs("section", {
|
|
3477
|
-
className: joinClasses("
|
|
3525
|
+
className: joinClasses("plai-tool-result-email-send-card overflow-hidden rounded-lg border border-border bg-surface-muted", className),
|
|
3478
3526
|
"data-tool-call-id": part.id,
|
|
3479
3527
|
"data-tool-call-state": part.state,
|
|
3480
|
-
children: [
|
|
3481
|
-
|
|
3482
|
-
|
|
3483
|
-
|
|
3484
|
-
|
|
3528
|
+
children: [/* @__PURE__ */ jsx("header", {
|
|
3529
|
+
className: "flex items-center gap-2 border-b border-border px-3 py-2 text-xs text-secondary",
|
|
3530
|
+
children: /* @__PURE__ */ jsxs("button", {
|
|
3531
|
+
type: "button",
|
|
3532
|
+
"aria-expanded": isExpanded,
|
|
3533
|
+
"aria-label": isExpanded ? copy.collapse : copy.expand,
|
|
3534
|
+
"aria-controls": `tool-email-details-${part.id}`,
|
|
3535
|
+
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",
|
|
3536
|
+
onClick: () => setIsExpanded((previous) => !previous),
|
|
3537
|
+
children: [/* @__PURE__ */ jsx("span", {
|
|
3538
|
+
className: "text-sm font-semibold text-foreground",
|
|
3485
3539
|
children: copy.email
|
|
3486
|
-
}), /* @__PURE__ */ jsxs("
|
|
3540
|
+
}), /* @__PURE__ */ jsxs("span", {
|
|
3487
3541
|
className: "flex items-center gap-2",
|
|
3488
3542
|
children: [/* @__PURE__ */ jsx("span", {
|
|
3489
|
-
className: joinClasses("rounded-full
|
|
3543
|
+
className: joinClasses("rounded-full border capitalize px-2 py-0.5 text-xs", statusClass),
|
|
3490
3544
|
children: getUiStatusLabel(part.state, copy)
|
|
3491
|
-
}), /* @__PURE__ */ jsx(
|
|
3492
|
-
|
|
3493
|
-
"aria-
|
|
3494
|
-
|
|
3495
|
-
"
|
|
3496
|
-
|
|
3497
|
-
onClick: () => setIsExpanded((previous) => !previous),
|
|
3498
|
-
children: isExpanded ? /* @__PURE__ */ jsx(Minus, {
|
|
3499
|
-
className: "h-3 w-3",
|
|
3500
|
-
"aria-hidden": "true"
|
|
3501
|
-
}) : /* @__PURE__ */ jsx(Plus, {
|
|
3502
|
-
className: "h-3 w-3",
|
|
3503
|
-
"aria-hidden": "true"
|
|
3504
|
-
})
|
|
3545
|
+
}), isExpanded ? /* @__PURE__ */ jsx(ChevronUp, {
|
|
3546
|
+
className: "h-4 w-4 text-muted",
|
|
3547
|
+
"aria-hidden": "true"
|
|
3548
|
+
}) : /* @__PURE__ */ jsx(ChevronDown, {
|
|
3549
|
+
className: "h-4 w-4 text-muted",
|
|
3550
|
+
"aria-hidden": "true"
|
|
3505
3551
|
})]
|
|
3506
3552
|
})]
|
|
3507
|
-
})
|
|
3508
|
-
|
|
3509
|
-
|
|
3510
|
-
|
|
3511
|
-
|
|
3512
|
-
|
|
3513
|
-
}), /* @__PURE__ */ jsx("p", {
|
|
3514
|
-
className: "text-xs text-slate-900",
|
|
3515
|
-
children: emailInput.subject
|
|
3516
|
-
})]
|
|
3517
|
-
}) : null,
|
|
3518
|
-
/* @__PURE__ */ jsxs("div", {
|
|
3519
|
-
className: "flex items-center gap-1",
|
|
3520
|
-
children: [/* @__PURE__ */ jsxs("p", {
|
|
3521
|
-
className: "text-xs font-semibold text-slate-600",
|
|
3522
|
-
children: [copy.to, ":"]
|
|
3523
|
-
}), emailInput.to.length > 0 ? /* @__PURE__ */ jsx("div", {
|
|
3524
|
-
className: "flex flex-wrap gap-2",
|
|
3525
|
-
children: emailInput.to.map((recipient) => /* @__PURE__ */ jsx("span", {
|
|
3526
|
-
className: "rounded-full border border-slate-300 bg-slate-100 px-2 py-0.5 text-xs text-slate-700",
|
|
3527
|
-
children: recipient
|
|
3528
|
-
}, recipient))
|
|
3529
|
-
}) : /* @__PURE__ */ jsx("p", {
|
|
3530
|
-
className: "text-xs text-slate-500",
|
|
3531
|
-
children: copy.noRecipientsProvided
|
|
3532
|
-
})]
|
|
3533
|
-
}),
|
|
3534
|
-
/* @__PURE__ */ jsxs("div", {
|
|
3535
|
-
id: `tool-email-details-${part.id}`,
|
|
3536
|
-
"data-testid": "email-send-details",
|
|
3537
|
-
className: joinClasses(isExpanded ? "block space-y-4" : "hidden"),
|
|
3538
|
-
children: [emailInput.text ? /* @__PURE__ */ jsxs("div", {
|
|
3539
|
-
className: "space-y-1",
|
|
3553
|
+
})
|
|
3554
|
+
}), /* @__PURE__ */ jsxs("div", {
|
|
3555
|
+
className: "space-y-4 px-3 py-2",
|
|
3556
|
+
children: [
|
|
3557
|
+
emailInput.subject ? /* @__PURE__ */ jsxs("div", {
|
|
3558
|
+
className: "flex items-center gap-1",
|
|
3540
3559
|
children: [/* @__PURE__ */ jsxs("p", {
|
|
3541
|
-
className: "text-xs font-semibold text-
|
|
3542
|
-
children: [copy.
|
|
3560
|
+
className: "text-xs font-semibold text-secondary",
|
|
3561
|
+
children: [copy.subject, ":"]
|
|
3543
3562
|
}), /* @__PURE__ */ jsx("p", {
|
|
3544
|
-
className: "
|
|
3545
|
-
children: emailInput.
|
|
3563
|
+
className: "text-xs text-foreground",
|
|
3564
|
+
children: emailInput.subject
|
|
3546
3565
|
})]
|
|
3547
|
-
}) : null,
|
|
3548
|
-
|
|
3566
|
+
}) : null,
|
|
3567
|
+
/* @__PURE__ */ jsxs("div", {
|
|
3568
|
+
className: "flex items-center gap-1",
|
|
3569
|
+
children: [/* @__PURE__ */ jsxs("p", {
|
|
3570
|
+
className: "text-xs font-semibold text-secondary",
|
|
3571
|
+
children: [copy.to, ":"]
|
|
3572
|
+
}), emailInput.to.length > 0 ? /* @__PURE__ */ jsx("div", {
|
|
3573
|
+
className: "flex flex-wrap gap-2",
|
|
3574
|
+
children: emailInput.to.map((recipient) => /* @__PURE__ */ jsx("span", {
|
|
3575
|
+
className: "rounded-full border border-border-strong bg-surface-subtle px-2 py-0.5 text-xs text-strong",
|
|
3576
|
+
children: recipient
|
|
3577
|
+
}, recipient))
|
|
3578
|
+
}) : /* @__PURE__ */ jsx("p", {
|
|
3579
|
+
className: "text-xs text-muted",
|
|
3580
|
+
children: copy.noRecipientsProvided
|
|
3581
|
+
})]
|
|
3582
|
+
}),
|
|
3583
|
+
/* @__PURE__ */ jsxs("div", {
|
|
3584
|
+
id: `tool-email-details-${part.id}`,
|
|
3585
|
+
"data-testid": "email-send-details",
|
|
3586
|
+
className: joinClasses(isExpanded ? "block space-y-4" : "hidden"),
|
|
3587
|
+
children: [emailInput.text ? /* @__PURE__ */ jsxs("div", {
|
|
3588
|
+
className: "space-y-1",
|
|
3589
|
+
children: [/* @__PURE__ */ jsxs("p", {
|
|
3590
|
+
className: "text-xs font-semibold text-secondary",
|
|
3591
|
+
children: [copy.body, ":"]
|
|
3592
|
+
}), /* @__PURE__ */ jsx("p", {
|
|
3593
|
+
className: "whitespace-pre-wrap rounded border border-border bg-surface p-2 text-sm text-strong",
|
|
3594
|
+
children: emailInput.text
|
|
3595
|
+
})]
|
|
3596
|
+
}) : null, part.result !== void 0 ? /* @__PURE__ */ jsxs("div", {
|
|
3597
|
+
className: "space-y-2 rounded border border-border bg-surface-muted p-3",
|
|
3598
|
+
children: [
|
|
3599
|
+
/* @__PURE__ */ jsx("p", {
|
|
3600
|
+
className: "text-xs font-semibold capitalize tracking-wide text-muted",
|
|
3601
|
+
children: copy.delivery
|
|
3602
|
+
}),
|
|
3603
|
+
emailResult.status ? /* @__PURE__ */ jsxs("p", {
|
|
3604
|
+
className: "text-xs text-strong",
|
|
3605
|
+
children: [
|
|
3606
|
+
/* @__PURE__ */ jsxs("span", {
|
|
3607
|
+
className: "font-semibold text-foreground",
|
|
3608
|
+
children: [copy.status, ":"]
|
|
3609
|
+
}),
|
|
3610
|
+
" ",
|
|
3611
|
+
emailResult.status
|
|
3612
|
+
]
|
|
3613
|
+
}) : null,
|
|
3614
|
+
emailResult.recipientsCount !== null ? /* @__PURE__ */ jsxs("p", {
|
|
3615
|
+
className: "text-xs text-strong",
|
|
3616
|
+
children: [
|
|
3617
|
+
/* @__PURE__ */ jsxs("span", {
|
|
3618
|
+
className: "font-semibold text-foreground",
|
|
3619
|
+
children: [copy.recipients, ":"]
|
|
3620
|
+
}),
|
|
3621
|
+
" ",
|
|
3622
|
+
emailResult.recipientsCount
|
|
3623
|
+
]
|
|
3624
|
+
}) : null,
|
|
3625
|
+
emailResult.receiptProvider ? /* @__PURE__ */ jsxs("p", {
|
|
3626
|
+
className: "text-xs text-strong",
|
|
3627
|
+
children: [
|
|
3628
|
+
/* @__PURE__ */ jsxs("span", {
|
|
3629
|
+
className: "font-semibold text-foreground",
|
|
3630
|
+
children: [copy.provider, ":"]
|
|
3631
|
+
}),
|
|
3632
|
+
" ",
|
|
3633
|
+
emailResult.receiptProvider
|
|
3634
|
+
]
|
|
3635
|
+
}) : null,
|
|
3636
|
+
emailResult.receiptMessageId ? /* @__PURE__ */ jsxs("p", {
|
|
3637
|
+
className: "break-all text-xs text-strong",
|
|
3638
|
+
children: [
|
|
3639
|
+
/* @__PURE__ */ jsxs("span", {
|
|
3640
|
+
className: "font-semibold text-foreground",
|
|
3641
|
+
children: [copy.messageId, ":"]
|
|
3642
|
+
}),
|
|
3643
|
+
" ",
|
|
3644
|
+
emailResult.receiptMessageId
|
|
3645
|
+
]
|
|
3646
|
+
}) : null,
|
|
3647
|
+
emailResult.receiptRawStatus ? /* @__PURE__ */ jsxs("p", {
|
|
3648
|
+
className: "text-xs text-strong",
|
|
3649
|
+
children: [
|
|
3650
|
+
/* @__PURE__ */ jsxs("span", {
|
|
3651
|
+
className: "font-semibold text-foreground",
|
|
3652
|
+
children: [copy.rawStatus, ":"]
|
|
3653
|
+
}),
|
|
3654
|
+
" ",
|
|
3655
|
+
emailResult.receiptRawStatus
|
|
3656
|
+
]
|
|
3657
|
+
}) : null,
|
|
3658
|
+
emailResult.raw ? /* @__PURE__ */ jsx("p", {
|
|
3659
|
+
className: "whitespace-pre-wrap text-xs text-strong",
|
|
3660
|
+
children: emailResult.raw
|
|
3661
|
+
}) : null
|
|
3662
|
+
]
|
|
3663
|
+
}) : null]
|
|
3664
|
+
}),
|
|
3665
|
+
errorDetails ? /* @__PURE__ */ jsxs("p", {
|
|
3666
|
+
className: "rounded border border-danger-border bg-danger-subtle px-3 py-2 text-xs text-danger-strong",
|
|
3549
3667
|
children: [
|
|
3550
|
-
/* @__PURE__ */
|
|
3551
|
-
className: "
|
|
3552
|
-
children: copy.
|
|
3668
|
+
/* @__PURE__ */ jsxs("span", {
|
|
3669
|
+
className: "font-semibold",
|
|
3670
|
+
children: [copy.errorDetails, ":"]
|
|
3553
3671
|
}),
|
|
3554
|
-
|
|
3555
|
-
|
|
3556
|
-
children: [
|
|
3557
|
-
/* @__PURE__ */ jsxs("span", {
|
|
3558
|
-
className: "font-semibold text-slate-900",
|
|
3559
|
-
children: [copy.status, ":"]
|
|
3560
|
-
}),
|
|
3561
|
-
" ",
|
|
3562
|
-
emailResult.status
|
|
3563
|
-
]
|
|
3564
|
-
}) : null,
|
|
3565
|
-
emailResult.recipientsCount !== null ? /* @__PURE__ */ jsxs("p", {
|
|
3566
|
-
className: "text-xs text-slate-700",
|
|
3567
|
-
children: [
|
|
3568
|
-
/* @__PURE__ */ jsxs("span", {
|
|
3569
|
-
className: "font-semibold text-slate-900",
|
|
3570
|
-
children: [copy.recipients, ":"]
|
|
3571
|
-
}),
|
|
3572
|
-
" ",
|
|
3573
|
-
emailResult.recipientsCount
|
|
3574
|
-
]
|
|
3575
|
-
}) : null,
|
|
3576
|
-
emailResult.receiptProvider ? /* @__PURE__ */ jsxs("p", {
|
|
3577
|
-
className: "text-xs text-slate-700",
|
|
3578
|
-
children: [
|
|
3579
|
-
/* @__PURE__ */ jsxs("span", {
|
|
3580
|
-
className: "font-semibold text-slate-900",
|
|
3581
|
-
children: [copy.provider, ":"]
|
|
3582
|
-
}),
|
|
3583
|
-
" ",
|
|
3584
|
-
emailResult.receiptProvider
|
|
3585
|
-
]
|
|
3586
|
-
}) : null,
|
|
3587
|
-
emailResult.receiptMessageId ? /* @__PURE__ */ jsxs("p", {
|
|
3588
|
-
className: "break-all text-xs text-slate-700",
|
|
3589
|
-
children: [
|
|
3590
|
-
/* @__PURE__ */ jsxs("span", {
|
|
3591
|
-
className: "font-semibold text-slate-900",
|
|
3592
|
-
children: [copy.messageId, ":"]
|
|
3593
|
-
}),
|
|
3594
|
-
" ",
|
|
3595
|
-
emailResult.receiptMessageId
|
|
3596
|
-
]
|
|
3597
|
-
}) : null,
|
|
3598
|
-
emailResult.receiptRawStatus ? /* @__PURE__ */ jsxs("p", {
|
|
3599
|
-
className: "text-xs text-slate-700",
|
|
3600
|
-
children: [
|
|
3601
|
-
/* @__PURE__ */ jsxs("span", {
|
|
3602
|
-
className: "font-semibold text-slate-900",
|
|
3603
|
-
children: [copy.rawStatus, ":"]
|
|
3604
|
-
}),
|
|
3605
|
-
" ",
|
|
3606
|
-
emailResult.receiptRawStatus
|
|
3607
|
-
]
|
|
3608
|
-
}) : null,
|
|
3609
|
-
emailResult.raw ? /* @__PURE__ */ jsx("p", {
|
|
3610
|
-
className: "whitespace-pre-wrap text-xs text-slate-700",
|
|
3611
|
-
children: emailResult.raw
|
|
3612
|
-
}) : null
|
|
3672
|
+
" ",
|
|
3673
|
+
errorDetails
|
|
3613
3674
|
]
|
|
3614
|
-
}) : null
|
|
3615
|
-
|
|
3616
|
-
|
|
3617
|
-
className: "rounded border border-rose-200 bg-rose-50 px-3 py-2 text-xs text-rose-700",
|
|
3618
|
-
children: [
|
|
3619
|
-
/* @__PURE__ */ jsxs("span", {
|
|
3620
|
-
className: "font-semibold",
|
|
3621
|
-
children: [copy.errorDetails, ":"]
|
|
3622
|
-
}),
|
|
3623
|
-
" ",
|
|
3624
|
-
errorDetails
|
|
3625
|
-
]
|
|
3626
|
-
}) : null
|
|
3627
|
-
]
|
|
3675
|
+
}) : null
|
|
3676
|
+
]
|
|
3677
|
+
})]
|
|
3628
3678
|
});
|
|
3629
3679
|
}
|
|
3630
3680
|
|
|
@@ -3699,15 +3749,15 @@ function ToolResultExternalDatasourceCard({ part, className, locale }) {
|
|
|
3699
3749
|
const sqlQuery = toStringOrNull(part.metadata?.sql_query);
|
|
3700
3750
|
const table = normalizeTable(getTableValue(part), copy);
|
|
3701
3751
|
const errorDetails = formatToolErrorDetails(part.errorDetails);
|
|
3702
|
-
const statusClass = part.state === "error" ? "text-
|
|
3752
|
+
const statusClass = part.state === "error" ? "text-danger" : part.state === "pending" ? "text-warning" : "text-success";
|
|
3703
3753
|
return /* @__PURE__ */ jsxs(Sheet, { children: [/* @__PURE__ */ jsx(SheetTrigger, {
|
|
3704
3754
|
"aria-label": `${copy.externalDatasource}: ${getUiStatusLabel(part.state, copy)}`,
|
|
3705
|
-
className: joinClasses("w-full overflow-hidden rounded-lg border border-
|
|
3755
|
+
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),
|
|
3706
3756
|
children: /* @__PURE__ */ jsxs("span", {
|
|
3707
3757
|
className: "flex items-center gap-2 px-3 py-2 text-sm",
|
|
3708
3758
|
children: [
|
|
3709
3759
|
/* @__PURE__ */ jsx(Database, {
|
|
3710
|
-
className: "h-4 w-4 shrink-0 text-
|
|
3760
|
+
className: "h-4 w-4 shrink-0 text-muted",
|
|
3711
3761
|
"aria-hidden": "true"
|
|
3712
3762
|
}),
|
|
3713
3763
|
/* @__PURE__ */ jsx("span", {
|
|
@@ -3743,14 +3793,14 @@ function ToolResultExternalDatasourceCard({ part, className, locale }) {
|
|
|
3743
3793
|
children: [/* @__PURE__ */ jsxs("div", {
|
|
3744
3794
|
className: "flex items-center gap-2",
|
|
3745
3795
|
children: [/* @__PURE__ */ jsx(Database, {
|
|
3746
|
-
className: "h-5 w-5 text-
|
|
3796
|
+
className: "h-5 w-5 text-info",
|
|
3747
3797
|
"aria-hidden": "true"
|
|
3748
3798
|
}), /* @__PURE__ */ jsx("h3", {
|
|
3749
3799
|
className: "text-sm font-medium",
|
|
3750
3800
|
children: copy.sqlQuery
|
|
3751
3801
|
})]
|
|
3752
3802
|
}), /* @__PURE__ */ jsx("pre", {
|
|
3753
|
-
className: "overflow-x-auto rounded-md border border-
|
|
3803
|
+
className: "overflow-x-auto rounded-md border border-border bg-surface-muted p-3 text-xs leading-5 text-strong",
|
|
3754
3804
|
children: sqlQuery
|
|
3755
3805
|
})]
|
|
3756
3806
|
}) : null,
|
|
@@ -3760,22 +3810,22 @@ function ToolResultExternalDatasourceCard({ part, className, locale }) {
|
|
|
3760
3810
|
className: "text-sm font-medium",
|
|
3761
3811
|
children: copy.queryResults
|
|
3762
3812
|
}), /* @__PURE__ */ jsx("div", {
|
|
3763
|
-
className: "overflow-x-auto rounded-md border border-
|
|
3813
|
+
className: "overflow-x-auto rounded-md border border-border",
|
|
3764
3814
|
children: /* @__PURE__ */ jsxs("table", {
|
|
3765
3815
|
className: "w-full border-collapse text-left text-xs",
|
|
3766
3816
|
children: [/* @__PURE__ */ jsx("thead", {
|
|
3767
|
-
className: "bg-
|
|
3817
|
+
className: "bg-surface-muted text-secondary",
|
|
3768
3818
|
children: /* @__PURE__ */ jsx("tr", { children: table.columns.map((column) => /* @__PURE__ */ jsx("th", {
|
|
3769
|
-
className: "max-w-56 truncate border-b border-
|
|
3819
|
+
className: "max-w-56 truncate border-b border-border px-3 py-2 font-medium",
|
|
3770
3820
|
title: column,
|
|
3771
3821
|
children: column
|
|
3772
3822
|
}, column)) })
|
|
3773
3823
|
}), /* @__PURE__ */ jsx("tbody", { children: table.rows.map((row) => /* @__PURE__ */ jsx("tr", {
|
|
3774
|
-
className: "border-b border-
|
|
3824
|
+
className: "border-b border-divider last:border-0",
|
|
3775
3825
|
children: table.columns.map((column, columnIndex) => {
|
|
3776
3826
|
const value = formatCell(row[columnIndex]);
|
|
3777
3827
|
return /* @__PURE__ */ jsx("td", {
|
|
3778
|
-
className: "max-w-56 truncate px-3 py-2 text-
|
|
3828
|
+
className: "max-w-56 truncate px-3 py-2 text-strong",
|
|
3779
3829
|
title: value,
|
|
3780
3830
|
children: value
|
|
3781
3831
|
}, column);
|
|
@@ -3784,11 +3834,11 @@ function ToolResultExternalDatasourceCard({ part, className, locale }) {
|
|
|
3784
3834
|
})
|
|
3785
3835
|
})]
|
|
3786
3836
|
}) : part.state === "completed" && !errorDetails ? /* @__PURE__ */ jsx("p", {
|
|
3787
|
-
className: "text-sm text-
|
|
3837
|
+
className: "text-sm text-secondary",
|
|
3788
3838
|
children: copy.noDataToDisplay
|
|
3789
3839
|
}) : null,
|
|
3790
3840
|
errorDetails ? /* @__PURE__ */ jsxs("p", {
|
|
3791
|
-
className: "rounded border border-
|
|
3841
|
+
className: "rounded border border-danger-border bg-danger-subtle px-3 py-2 text-xs text-danger-strong",
|
|
3792
3842
|
children: [
|
|
3793
3843
|
/* @__PURE__ */ jsxs("span", {
|
|
3794
3844
|
className: "font-semibold",
|
|
@@ -3824,12 +3874,12 @@ function ToolResultHttpRequestCard({ part, className, locale }) {
|
|
|
3824
3874
|
const status = statusCode ? `${statusCode}${metadata?.status_reason ? ` ${metadata.status_reason}` : ""}` : getUiStatusLabel(part.state, copy);
|
|
3825
3875
|
return /* @__PURE__ */ jsxs(Sheet, { children: [/* @__PURE__ */ jsx(SheetTrigger, {
|
|
3826
3876
|
"aria-label": `${copy.httpRequest}: ${status}`,
|
|
3827
|
-
className: joinClasses("w-full rounded-lg border border-
|
|
3877
|
+
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),
|
|
3828
3878
|
children: /* @__PURE__ */ jsxs("span", {
|
|
3829
3879
|
className: "flex items-center gap-2 px-3 py-2 text-sm",
|
|
3830
3880
|
children: [
|
|
3831
3881
|
/* @__PURE__ */ jsx(Globe, {
|
|
3832
|
-
className: "h-4 w-4 shrink-0 text-
|
|
3882
|
+
className: "h-4 w-4 shrink-0 text-muted",
|
|
3833
3883
|
"aria-hidden": "true"
|
|
3834
3884
|
}),
|
|
3835
3885
|
/* @__PURE__ */ jsx("span", {
|
|
@@ -3837,11 +3887,11 @@ function ToolResultHttpRequestCard({ part, className, locale }) {
|
|
|
3837
3887
|
children: metadata?.method ?? "HTTP"
|
|
3838
3888
|
}),
|
|
3839
3889
|
/* @__PURE__ */ jsx("span", {
|
|
3840
|
-
className: "min-w-0 truncate text-
|
|
3890
|
+
className: "min-w-0 truncate text-secondary",
|
|
3841
3891
|
children: metadata?.url ?? part.name
|
|
3842
3892
|
}),
|
|
3843
3893
|
/* @__PURE__ */ jsx("span", {
|
|
3844
|
-
className: joinClasses("ml-auto shrink-0", failed ? "text-
|
|
3894
|
+
className: joinClasses("ml-auto shrink-0", failed ? "text-danger" : "text-success"),
|
|
3845
3895
|
children: failed ? /* @__PURE__ */ jsx(XCircle, {
|
|
3846
3896
|
className: "h-4 w-4",
|
|
3847
3897
|
"aria-hidden": "true"
|
|
@@ -3865,25 +3915,25 @@ function ToolResultHttpRequestCard({ part, className, locale }) {
|
|
|
3865
3915
|
className: "grid gap-2 text-sm",
|
|
3866
3916
|
children: [
|
|
3867
3917
|
/* @__PURE__ */ jsxs("div", { children: [/* @__PURE__ */ jsx("dt", {
|
|
3868
|
-
className: "text-xs text-
|
|
3918
|
+
className: "text-xs text-muted",
|
|
3869
3919
|
children: copy.status
|
|
3870
3920
|
}), /* @__PURE__ */ jsx("dd", { children: status })] }),
|
|
3871
3921
|
metadata?.url ? /* @__PURE__ */ jsxs("div", { children: [/* @__PURE__ */ jsx("dt", {
|
|
3872
|
-
className: "text-xs text-
|
|
3922
|
+
className: "text-xs text-muted",
|
|
3873
3923
|
children: copy.requestUrl
|
|
3874
3924
|
}), /* @__PURE__ */ jsx("dd", {
|
|
3875
3925
|
className: "break-all",
|
|
3876
3926
|
children: metadata.url
|
|
3877
3927
|
})] }) : null,
|
|
3878
3928
|
metadata?.response_url && metadata.response_url !== metadata.url ? /* @__PURE__ */ jsxs("div", { children: [/* @__PURE__ */ jsx("dt", {
|
|
3879
|
-
className: "text-xs text-
|
|
3929
|
+
className: "text-xs text-muted",
|
|
3880
3930
|
children: copy.responseUrl
|
|
3881
3931
|
}), /* @__PURE__ */ jsx("dd", {
|
|
3882
3932
|
className: "break-all",
|
|
3883
3933
|
children: metadata.response_url
|
|
3884
3934
|
})] }) : null,
|
|
3885
3935
|
metadata?.content_type ? /* @__PURE__ */ jsxs("div", { children: [/* @__PURE__ */ jsx("dt", {
|
|
3886
|
-
className: "text-xs text-
|
|
3936
|
+
className: "text-xs text-muted",
|
|
3887
3937
|
children: copy.contentType
|
|
3888
3938
|
}), /* @__PURE__ */ jsx("dd", { children: metadata.content_type })] }) : null
|
|
3889
3939
|
]
|
|
@@ -3892,18 +3942,18 @@ function ToolResultHttpRequestCard({ part, className, locale }) {
|
|
|
3892
3942
|
className: "mb-2 text-sm font-medium",
|
|
3893
3943
|
children: copy.response
|
|
3894
3944
|
}), /* @__PURE__ */ jsx("pre", {
|
|
3895
|
-
className: "overflow-x-auto rounded-md border border-
|
|
3945
|
+
className: "overflow-x-auto rounded-md border border-border bg-surface-muted p-3 text-xs leading-5",
|
|
3896
3946
|
children: response
|
|
3897
3947
|
})] }) : null,
|
|
3898
3948
|
metadata?.response_headers && Object.keys(metadata.response_headers).length ? /* @__PURE__ */ jsxs("details", { children: [/* @__PURE__ */ jsx("summary", {
|
|
3899
3949
|
className: "cursor-pointer text-sm font-medium",
|
|
3900
3950
|
children: copy.responseHeaders
|
|
3901
3951
|
}), /* @__PURE__ */ jsx("pre", {
|
|
3902
|
-
className: "mt-2 overflow-x-auto rounded-md border border-
|
|
3952
|
+
className: "mt-2 overflow-x-auto rounded-md border border-border bg-surface-muted p-3 text-xs",
|
|
3903
3953
|
children: JSON.stringify(metadata.response_headers, null, 2)
|
|
3904
3954
|
})] }) : null,
|
|
3905
3955
|
errorDetails ? /* @__PURE__ */ jsxs("p", {
|
|
3906
|
-
className: "rounded border border-
|
|
3956
|
+
className: "rounded border border-danger-border bg-danger-subtle px-3 py-2 text-xs text-danger-strong",
|
|
3907
3957
|
children: [
|
|
3908
3958
|
/* @__PURE__ */ jsxs("span", {
|
|
3909
3959
|
className: "font-semibold",
|
|
@@ -3939,12 +3989,12 @@ function ToolResultMcpCard({ part, className, locale }) {
|
|
|
3939
3989
|
const failed = part.state === "error";
|
|
3940
3990
|
return /* @__PURE__ */ jsxs(Sheet, { children: [/* @__PURE__ */ jsx(SheetTrigger, {
|
|
3941
3991
|
"aria-label": `${copy.mcpTool}: ${tool}`,
|
|
3942
|
-
className: joinClasses("w-full rounded-lg border border-
|
|
3992
|
+
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),
|
|
3943
3993
|
children: /* @__PURE__ */ jsxs("span", {
|
|
3944
3994
|
className: "flex items-center gap-2 px-3 py-2 text-sm",
|
|
3945
3995
|
children: [
|
|
3946
3996
|
/* @__PURE__ */ jsx(Plug, {
|
|
3947
|
-
className: "h-4 w-4 shrink-0 text-
|
|
3997
|
+
className: "h-4 w-4 shrink-0 text-muted",
|
|
3948
3998
|
"aria-hidden": "true"
|
|
3949
3999
|
}),
|
|
3950
4000
|
/* @__PURE__ */ jsx("span", {
|
|
@@ -3952,11 +4002,11 @@ function ToolResultMcpCard({ part, className, locale }) {
|
|
|
3952
4002
|
children: "MCP"
|
|
3953
4003
|
}),
|
|
3954
4004
|
/* @__PURE__ */ jsx("span", {
|
|
3955
|
-
className: "min-w-0 truncate border-
|
|
4005
|
+
className: "min-w-0 truncate border-border-strong border px-2 py-0.5 rounded-md text-xs text-muted",
|
|
3956
4006
|
children: tool
|
|
3957
4007
|
}),
|
|
3958
4008
|
/* @__PURE__ */ jsx("span", {
|
|
3959
|
-
className: joinClasses("ml-auto shrink-0", failed ? "text-
|
|
4009
|
+
className: joinClasses("ml-auto shrink-0", failed ? "text-danger" : "text-success"),
|
|
3960
4010
|
children: failed ? /* @__PURE__ */ jsx(XCircle, {
|
|
3961
4011
|
className: "h-4 w-4",
|
|
3962
4012
|
"aria-hidden": "true"
|
|
@@ -3979,10 +4029,10 @@ function ToolResultMcpCard({ part, className, locale }) {
|
|
|
3979
4029
|
/* @__PURE__ */ jsxs("dl", {
|
|
3980
4030
|
className: "grid gap-2 text-sm",
|
|
3981
4031
|
children: [/* @__PURE__ */ jsxs("div", { children: [/* @__PURE__ */ jsx("dt", {
|
|
3982
|
-
className: "text-xs text-
|
|
4032
|
+
className: "text-xs text-muted",
|
|
3983
4033
|
children: copy.tool
|
|
3984
4034
|
}), /* @__PURE__ */ jsx("dd", { children: tool })] }), server ? /* @__PURE__ */ jsxs("div", { children: [/* @__PURE__ */ jsx("dt", {
|
|
3985
|
-
className: "text-xs text-
|
|
4035
|
+
className: "text-xs text-muted",
|
|
3986
4036
|
children: copy.server
|
|
3987
4037
|
}), /* @__PURE__ */ jsx("dd", {
|
|
3988
4038
|
className: "break-all",
|
|
@@ -3993,11 +4043,11 @@ function ToolResultMcpCard({ part, className, locale }) {
|
|
|
3993
4043
|
className: "mb-2 text-sm font-medium",
|
|
3994
4044
|
children: copy.result
|
|
3995
4045
|
}), /* @__PURE__ */ jsx("pre", {
|
|
3996
|
-
className: "overflow-x-auto rounded-md border border-
|
|
4046
|
+
className: "overflow-x-auto rounded-md border border-border bg-surface-muted p-3 text-xs leading-5",
|
|
3997
4047
|
children: result
|
|
3998
4048
|
})] }) : null,
|
|
3999
4049
|
error ? /* @__PURE__ */ jsxs("p", {
|
|
4000
|
-
className: "rounded border border-
|
|
4050
|
+
className: "rounded border border-danger-border bg-danger-subtle px-3 py-2 text-xs text-danger-strong",
|
|
4001
4051
|
children: [
|
|
4002
4052
|
/* @__PURE__ */ jsxs("span", {
|
|
4003
4053
|
className: "font-semibold",
|
|
@@ -4069,7 +4119,7 @@ function FileDownloadButton({ file, label, copy, className }) {
|
|
|
4069
4119
|
className: "ml-auto flex shrink-0 items-center gap-2",
|
|
4070
4120
|
children: [state === "error" ? /* @__PURE__ */ jsx("span", {
|
|
4071
4121
|
role: "alert",
|
|
4072
|
-
className: "text-xs text-
|
|
4122
|
+
className: "text-xs text-danger",
|
|
4073
4123
|
children: copy.downloadFailed
|
|
4074
4124
|
}) : null, /* @__PURE__ */ jsx("button", {
|
|
4075
4125
|
type: "button",
|
|
@@ -4077,7 +4127,7 @@ function FileDownloadButton({ file, label, copy, className }) {
|
|
|
4077
4127
|
disabled: isDownloading,
|
|
4078
4128
|
"aria-label": `${isDownloading ? copy.downloading : copy.download}: ${label}`,
|
|
4079
4129
|
title: isDownloading ? copy.downloading : copy.download,
|
|
4080
|
-
className: joinClasses("inline-flex h-8 w-8 items-center justify-center rounded-md border border-
|
|
4130
|
+
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),
|
|
4081
4131
|
children: isDownloading ? /* @__PURE__ */ jsx(LoaderCircle, {
|
|
4082
4132
|
className: "h-4 w-4 animate-spin",
|
|
4083
4133
|
"aria-hidden": "true"
|
|
@@ -4106,14 +4156,14 @@ function ToolResultOfficeDocumentsCard({ part, className, locale }) {
|
|
|
4106
4156
|
const files = getFiles(part);
|
|
4107
4157
|
const errorDetails = formatToolErrorDetails(part.errorDetails);
|
|
4108
4158
|
const fileLabel = files.length === 1 ? copy.file : copy.files;
|
|
4109
|
-
const statusClass = part.state === "error" ? "text-
|
|
4159
|
+
const statusClass = part.state === "error" ? "text-danger" : part.state === "pending" ? "text-warning" : "text-success";
|
|
4110
4160
|
const singleFile = part.state === "completed" && files.length === 1 && !errorDetails ? files[0] : void 0;
|
|
4111
4161
|
if (singleFile) {
|
|
4112
4162
|
const extension = getExtension(singleFile);
|
|
4113
4163
|
const label = getLabel(singleFile);
|
|
4114
4164
|
return /* @__PURE__ */ jsxs("section", {
|
|
4115
4165
|
"aria-label": `${copy.officeDocuments}: ${label}`,
|
|
4116
|
-
className: joinClasses("flex w-full items-center gap-3 overflow-hidden rounded-lg border border-
|
|
4166
|
+
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),
|
|
4117
4167
|
children: [
|
|
4118
4168
|
/* @__PURE__ */ jsx(File, {
|
|
4119
4169
|
className: joinClasses("h-6 w-6 shrink-0", getFileIconClass(extension)),
|
|
@@ -4125,7 +4175,7 @@ function ToolResultOfficeDocumentsCard({ part, className, locale }) {
|
|
|
4125
4175
|
className: "truncate text-sm font-medium",
|
|
4126
4176
|
children: label
|
|
4127
4177
|
}), /* @__PURE__ */ jsxs("p", {
|
|
4128
|
-
className: "truncate text-[11px] text-
|
|
4178
|
+
className: "truncate text-[11px] text-muted",
|
|
4129
4179
|
children: [copy.officeDocuments, extension ? ` · ${extension.toUpperCase()}` : null]
|
|
4130
4180
|
})]
|
|
4131
4181
|
}),
|
|
@@ -4137,7 +4187,7 @@ function ToolResultOfficeDocumentsCard({ part, className, locale }) {
|
|
|
4137
4187
|
label,
|
|
4138
4188
|
copy
|
|
4139
4189
|
}) : /* @__PURE__ */ jsx(CheckCircle2, {
|
|
4140
|
-
className: "ml-auto h-4 w-4 shrink-0 text-
|
|
4190
|
+
className: "ml-auto h-4 w-4 shrink-0 text-success",
|
|
4141
4191
|
"aria-hidden": "true"
|
|
4142
4192
|
})
|
|
4143
4193
|
]
|
|
@@ -4145,12 +4195,12 @@ function ToolResultOfficeDocumentsCard({ part, className, locale }) {
|
|
|
4145
4195
|
}
|
|
4146
4196
|
return /* @__PURE__ */ jsxs(Sheet, { children: [/* @__PURE__ */ jsx(SheetTrigger, {
|
|
4147
4197
|
"aria-label": `${copy.officeDocuments}: ${files.length} ${fileLabel}`,
|
|
4148
|
-
className: joinClasses("w-full overflow-hidden rounded-lg border border-
|
|
4198
|
+
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),
|
|
4149
4199
|
children: /* @__PURE__ */ jsxs("span", {
|
|
4150
4200
|
className: "flex items-center gap-2 px-3 py-2 text-sm",
|
|
4151
4201
|
children: [
|
|
4152
4202
|
/* @__PURE__ */ jsx(FileText, {
|
|
4153
|
-
className: "h-4 w-4 shrink-0 text-
|
|
4203
|
+
className: "h-4 w-4 shrink-0 text-muted",
|
|
4154
4204
|
"aria-hidden": "true"
|
|
4155
4205
|
}),
|
|
4156
4206
|
/* @__PURE__ */ jsx("span", {
|
|
@@ -4158,7 +4208,7 @@ function ToolResultOfficeDocumentsCard({ part, className, locale }) {
|
|
|
4158
4208
|
children: copy.officeDocuments
|
|
4159
4209
|
}),
|
|
4160
4210
|
/* @__PURE__ */ jsx("span", {
|
|
4161
|
-
className: "min-w-0 truncate border-
|
|
4211
|
+
className: "min-w-0 truncate border-border-strong border px-2 py-0.5 rounded-md text-xs text-muted",
|
|
4162
4212
|
children: part.state === "pending" ? copy.pending : `${files.length} ${fileLabel}`
|
|
4163
4213
|
}),
|
|
4164
4214
|
/* @__PURE__ */ jsx("span", {
|
|
@@ -4186,7 +4236,7 @@ function ToolResultOfficeDocumentsCard({ part, className, locale }) {
|
|
|
4186
4236
|
const extension = getExtension(file);
|
|
4187
4237
|
const label = getLabel(file);
|
|
4188
4238
|
return /* @__PURE__ */ jsxs("div", {
|
|
4189
|
-
className: "flex items-center gap-3 rounded-lg border border-
|
|
4239
|
+
className: "flex items-center gap-3 rounded-lg border border-border bg-surface p-3",
|
|
4190
4240
|
children: [
|
|
4191
4241
|
/* @__PURE__ */ jsx(File, {
|
|
4192
4242
|
className: joinClasses("h-8 w-8 shrink-0", getFileIconClass(extension)),
|
|
@@ -4198,7 +4248,7 @@ function ToolResultOfficeDocumentsCard({ part, className, locale }) {
|
|
|
4198
4248
|
className: "truncate text-sm font-medium",
|
|
4199
4249
|
children: label
|
|
4200
4250
|
}), extension ? /* @__PURE__ */ jsx("p", {
|
|
4201
|
-
className: "text-[11px] uppercase text-
|
|
4251
|
+
className: "text-[11px] uppercase text-muted",
|
|
4202
4252
|
children: extension
|
|
4203
4253
|
}) : null]
|
|
4204
4254
|
}),
|
|
@@ -4214,15 +4264,15 @@ function ToolResultOfficeDocumentsCard({ part, className, locale }) {
|
|
|
4214
4264
|
}, file.id);
|
|
4215
4265
|
}),
|
|
4216
4266
|
files.length === 0 && part.state === "pending" ? /* @__PURE__ */ jsx("p", {
|
|
4217
|
-
className: "text-sm text-
|
|
4267
|
+
className: "text-sm text-secondary",
|
|
4218
4268
|
children: copy.creatingDocuments
|
|
4219
4269
|
}) : null,
|
|
4220
4270
|
files.length === 0 && part.state === "completed" && !errorDetails ? /* @__PURE__ */ jsx("p", {
|
|
4221
|
-
className: "text-sm text-
|
|
4271
|
+
className: "text-sm text-secondary",
|
|
4222
4272
|
children: copy.noFilesGenerated
|
|
4223
4273
|
}) : null,
|
|
4224
4274
|
errorDetails ? /* @__PURE__ */ jsxs("p", {
|
|
4225
|
-
className: "rounded border border-
|
|
4275
|
+
className: "rounded border border-danger-border bg-danger-subtle px-3 py-2 text-xs text-danger-strong",
|
|
4226
4276
|
children: [
|
|
4227
4277
|
/* @__PURE__ */ jsxs("span", {
|
|
4228
4278
|
className: "font-semibold",
|
|
@@ -5016,11 +5066,11 @@ function statusLabel(status, copy) {
|
|
|
5016
5066
|
return key ? copy[key] : null;
|
|
5017
5067
|
}
|
|
5018
5068
|
const BADGE_TONE = {
|
|
5019
|
-
pending: "border-
|
|
5069
|
+
pending: "border-warning-border bg-warning-subtle text-warning-strong",
|
|
5020
5070
|
executing: "border-sky-200 bg-sky-50 text-sky-800",
|
|
5021
|
-
executed: "border-
|
|
5022
|
-
failed: "border-
|
|
5023
|
-
unknown: "border-
|
|
5071
|
+
executed: "border-success-border bg-success-subtle text-success-strong",
|
|
5072
|
+
failed: "border-danger-border bg-danger-subtle text-danger-strong",
|
|
5073
|
+
unknown: "border-warning-border bg-warning-subtle text-warning-strong"
|
|
5024
5074
|
};
|
|
5025
5075
|
/** Header badge of a held action: "Awaiting your confirmation" or its outcome. */
|
|
5026
5076
|
function ConfirmationBadge({ state, copy }) {
|
|
@@ -5028,7 +5078,7 @@ function ConfirmationBadge({ state, copy }) {
|
|
|
5028
5078
|
const label = status === "pending" ? copy.awaitingConfirmation : statusLabel(status, copy);
|
|
5029
5079
|
const Icon = status === "executed" ? CheckCircle2 : status === "failed" ? XCircle : status === "executing" ? LoaderCircle : Clock;
|
|
5030
5080
|
return /* @__PURE__ */ jsxs("span", {
|
|
5031
|
-
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-
|
|
5081
|
+
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"),
|
|
5032
5082
|
"data-confirmation-status": status,
|
|
5033
5083
|
children: [/* @__PURE__ */ jsx(Icon, {
|
|
5034
5084
|
className: joinClasses("h-3 w-3", status === "executing" ? "animate-spin" : void 0),
|
|
@@ -5052,18 +5102,18 @@ function PendingConfirmationFooter({ pending, toolConfirmation, copy }) {
|
|
|
5052
5102
|
const [sending, setSending] = useState(null);
|
|
5053
5103
|
const [failed, setFailed] = useState(false);
|
|
5054
5104
|
if (!toolConfirmation) return /* @__PURE__ */ jsx("p", {
|
|
5055
|
-
className: "border-t border-
|
|
5105
|
+
className: "border-t border-border bg-warning-subtle/60 px-3 py-2 text-xs text-strong",
|
|
5056
5106
|
children: copy.confirmHint
|
|
5057
5107
|
});
|
|
5058
5108
|
if (!state) return /* @__PURE__ */ jsx("p", {
|
|
5059
|
-
className: "border-t border-
|
|
5109
|
+
className: "border-t border-divider bg-surface-muted px-3 py-2 text-xs text-muted",
|
|
5060
5110
|
"aria-live": "polite",
|
|
5061
5111
|
children: copy.verifying
|
|
5062
5112
|
});
|
|
5063
5113
|
if (state.status !== "pending") {
|
|
5064
5114
|
const label = statusLabel(state.status, copy);
|
|
5065
5115
|
return label ? /* @__PURE__ */ jsxs("p", {
|
|
5066
|
-
className: "border-t border-
|
|
5116
|
+
className: "border-t border-divider bg-surface-muted px-3 py-2 text-xs text-strong",
|
|
5067
5117
|
"aria-live": "polite",
|
|
5068
5118
|
children: [label, state.status === "failed" && state.error ? `: ${state.error}` : null]
|
|
5069
5119
|
}) : null;
|
|
@@ -5087,14 +5137,14 @@ function PendingConfirmationFooter({ pending, toolConfirmation, copy }) {
|
|
|
5087
5137
|
const expiry = expiryText(state, toolConfirmation.states.serverOffsetMs, now, copy);
|
|
5088
5138
|
const unavailable = state.error === "tool_unavailable";
|
|
5089
5139
|
return /* @__PURE__ */ jsxs("div", {
|
|
5090
|
-
className: "flex flex-wrap items-center gap-2 border-t border-
|
|
5140
|
+
className: "flex flex-wrap items-center gap-2 border-t border-border bg-warning-subtle/60 px-3 py-2",
|
|
5091
5141
|
"data-confirmation-actions": pending.action_id,
|
|
5092
5142
|
children: [
|
|
5093
5143
|
state.canConfirm ? /* @__PURE__ */ jsxs("button", {
|
|
5094
5144
|
type: "button",
|
|
5095
5145
|
disabled,
|
|
5096
5146
|
onClick: () => void decide("confirm"),
|
|
5097
|
-
className: joinClasses("inline-flex items-center rounded-md px-3 py-1.5 text-xs font-medium text-
|
|
5147
|
+
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"),
|
|
5098
5148
|
children: [sending === "confirm" ? /* @__PURE__ */ jsx(LoaderCircle, {
|
|
5099
5149
|
className: "mr-2 size-3 animate-spin",
|
|
5100
5150
|
"aria-hidden": "true"
|
|
@@ -5104,14 +5154,14 @@ function PendingConfirmationFooter({ pending, toolConfirmation, copy }) {
|
|
|
5104
5154
|
type: "button",
|
|
5105
5155
|
disabled,
|
|
5106
5156
|
onClick: () => void decide("reject"),
|
|
5107
|
-
className: "inline-flex items-center rounded-md border border-
|
|
5157
|
+
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",
|
|
5108
5158
|
children: [sending === "reject" ? /* @__PURE__ */ jsx(LoaderCircle, {
|
|
5109
5159
|
className: "mr-2 size-3 animate-spin",
|
|
5110
5160
|
"aria-hidden": "true"
|
|
5111
5161
|
}) : null, sending === "reject" ? copy.cancelling : copy.cancel]
|
|
5112
5162
|
}) : null,
|
|
5113
5163
|
/* @__PURE__ */ jsx("span", {
|
|
5114
|
-
className: "ml-auto text-xs text-
|
|
5164
|
+
className: "ml-auto text-xs text-secondary",
|
|
5115
5165
|
"aria-live": "polite",
|
|
5116
5166
|
children: failed ? copy.decisionError : unavailable ? copy.toolUnavailable : expiry
|
|
5117
5167
|
})
|
|
@@ -5246,7 +5296,7 @@ function ExternalAnchor({ href, className, children, label }) {
|
|
|
5246
5296
|
target: "_blank",
|
|
5247
5297
|
rel: "noreferrer noopener",
|
|
5248
5298
|
"aria-label": label,
|
|
5249
|
-
className: joinClasses("inline-flex items-center gap-1 text-xs font-medium text-
|
|
5299
|
+
className: joinClasses("inline-flex items-center gap-1 text-xs font-medium text-strong hover:text-muted", className),
|
|
5250
5300
|
children
|
|
5251
5301
|
});
|
|
5252
5302
|
}
|
|
@@ -5255,7 +5305,7 @@ function ShowAllToggle({ total, expanded, onToggle, copy }) {
|
|
|
5255
5305
|
return /* @__PURE__ */ jsx("button", {
|
|
5256
5306
|
type: "button",
|
|
5257
5307
|
onClick: onToggle,
|
|
5258
|
-
className: "w-full border-t border-
|
|
5308
|
+
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",
|
|
5259
5309
|
children: expanded ? copy.showLess : fillCopy(copy.showAll, { count: total })
|
|
5260
5310
|
});
|
|
5261
5311
|
}
|
|
@@ -5266,24 +5316,24 @@ function MailRow({ message, locale, copy }) {
|
|
|
5266
5316
|
children: [
|
|
5267
5317
|
/* @__PURE__ */ jsx("span", {
|
|
5268
5318
|
"aria-label": message.unread ? copy.unread : void 0,
|
|
5269
|
-
className: joinClasses("h-2 w-2 shrink-0 self-center rounded-full", message.unread ? "bg-
|
|
5319
|
+
className: joinClasses("h-2 w-2 shrink-0 self-center rounded-full", message.unread ? "bg-info" : "bg-transparent")
|
|
5270
5320
|
}),
|
|
5271
5321
|
/* @__PURE__ */ jsx("span", {
|
|
5272
|
-
className: joinClasses("min-w-0 flex-1 truncate text-sm", message.unread ? "font-semibold text-
|
|
5322
|
+
className: joinClasses("min-w-0 flex-1 truncate text-sm", message.unread ? "font-semibold text-foreground" : "text-strong"),
|
|
5273
5323
|
children: displayName(message.from) ?? "—"
|
|
5274
5324
|
}),
|
|
5275
5325
|
/* @__PURE__ */ jsx("span", {
|
|
5276
|
-
className: "shrink-0 text-xs text-
|
|
5326
|
+
className: "shrink-0 text-xs text-muted",
|
|
5277
5327
|
children: formatMailDate(message.date, locale)
|
|
5278
5328
|
})
|
|
5279
5329
|
]
|
|
5280
5330
|
}),
|
|
5281
5331
|
/* @__PURE__ */ jsx("p", {
|
|
5282
|
-
className: joinClasses("truncate pl-4 text-sm", message.unread ? "font-medium text-
|
|
5332
|
+
className: joinClasses("truncate pl-4 text-sm", message.unread ? "font-medium text-foreground" : "text-strong"),
|
|
5283
5333
|
children: text(message.subject) ?? copy.noSubject
|
|
5284
5334
|
}),
|
|
5285
5335
|
text(message.snippet) ? /* @__PURE__ */ jsx("p", {
|
|
5286
|
-
className: "line-clamp-1 pl-4 text-xs text-
|
|
5336
|
+
className: "line-clamp-1 pl-4 text-xs text-muted",
|
|
5287
5337
|
children: message.snippet
|
|
5288
5338
|
}) : null
|
|
5289
5339
|
] });
|
|
@@ -5292,7 +5342,7 @@ function MailRow({ message, locale, copy }) {
|
|
|
5292
5342
|
href: message.link,
|
|
5293
5343
|
target: "_blank",
|
|
5294
5344
|
rel: "noreferrer noopener",
|
|
5295
|
-
className: joinClasses(className, "hover:bg-
|
|
5345
|
+
className: joinClasses(className, "hover:bg-surface-muted"),
|
|
5296
5346
|
children: content
|
|
5297
5347
|
}) : /* @__PURE__ */ jsx("div", {
|
|
5298
5348
|
className,
|
|
@@ -5302,11 +5352,11 @@ function MailRow({ message, locale, copy }) {
|
|
|
5302
5352
|
function MailList({ messages, locale, copy }) {
|
|
5303
5353
|
const [expanded, setExpanded] = useState(false);
|
|
5304
5354
|
if (messages.length === 0) return /* @__PURE__ */ jsx("p", {
|
|
5305
|
-
className: "px-3 py-3 text-sm text-
|
|
5355
|
+
className: "px-3 py-3 text-sm text-secondary",
|
|
5306
5356
|
children: copy.noEmails
|
|
5307
5357
|
});
|
|
5308
5358
|
return /* @__PURE__ */ jsxs(Fragment, { children: [/* @__PURE__ */ jsx("ul", {
|
|
5309
|
-
className: "divide-y divide-
|
|
5359
|
+
className: "divide-y divide-divider",
|
|
5310
5360
|
children: (expanded ? messages : messages.slice(0, COLLAPSED_ITEMS)).map((message) => /* @__PURE__ */ jsx("li", { children: /* @__PURE__ */ jsx(MailRow, {
|
|
5311
5361
|
message,
|
|
5312
5362
|
locale,
|
|
@@ -5331,13 +5381,13 @@ function MailMessageView({ message, connector, locale, copy }) {
|
|
|
5331
5381
|
className: "space-y-1",
|
|
5332
5382
|
children: [
|
|
5333
5383
|
/* @__PURE__ */ jsx("h4", {
|
|
5334
|
-
className: "text-sm font-semibold text-
|
|
5384
|
+
className: "text-sm font-semibold text-foreground",
|
|
5335
5385
|
children: text(message.subject) ?? copy.noSubject
|
|
5336
5386
|
}),
|
|
5337
5387
|
/* @__PURE__ */ jsxs("div", {
|
|
5338
|
-
className: "flex items-baseline gap-2 text-xs text-
|
|
5388
|
+
className: "flex items-baseline gap-2 text-xs text-secondary",
|
|
5339
5389
|
children: [/* @__PURE__ */ jsx("span", {
|
|
5340
|
-
className: "min-w-0 flex-1 truncate font-medium text-
|
|
5390
|
+
className: "min-w-0 flex-1 truncate font-medium text-strong",
|
|
5341
5391
|
children: message.from ?? "—"
|
|
5342
5392
|
}), /* @__PURE__ */ jsx("span", {
|
|
5343
5393
|
className: "shrink-0",
|
|
@@ -5345,7 +5395,7 @@ function MailMessageView({ message, connector, locale, copy }) {
|
|
|
5345
5395
|
})]
|
|
5346
5396
|
}),
|
|
5347
5397
|
text(message.to) ? /* @__PURE__ */ jsxs("p", {
|
|
5348
|
-
className: "truncate text-xs text-
|
|
5398
|
+
className: "truncate text-xs text-muted",
|
|
5349
5399
|
children: [
|
|
5350
5400
|
copy.to,
|
|
5351
5401
|
": ",
|
|
@@ -5353,7 +5403,7 @@ function MailMessageView({ message, connector, locale, copy }) {
|
|
|
5353
5403
|
]
|
|
5354
5404
|
}) : null,
|
|
5355
5405
|
text(message.cc) ? /* @__PURE__ */ jsxs("p", {
|
|
5356
|
-
className: "truncate text-xs text-
|
|
5406
|
+
className: "truncate text-xs text-muted",
|
|
5357
5407
|
children: [
|
|
5358
5408
|
copy.cc,
|
|
5359
5409
|
": ",
|
|
@@ -5363,7 +5413,7 @@ function MailMessageView({ message, connector, locale, copy }) {
|
|
|
5363
5413
|
]
|
|
5364
5414
|
}),
|
|
5365
5415
|
shownBody ? /* @__PURE__ */ jsx("p", {
|
|
5366
|
-
className: "whitespace-pre-wrap break-words text-sm leading-6 text-
|
|
5416
|
+
className: "whitespace-pre-wrap break-words text-sm leading-6 text-strong",
|
|
5367
5417
|
children: shownBody
|
|
5368
5418
|
}) : null,
|
|
5369
5419
|
/* @__PURE__ */ jsxs("div", {
|
|
@@ -5371,11 +5421,11 @@ function MailMessageView({ message, connector, locale, copy }) {
|
|
|
5371
5421
|
children: [long ? /* @__PURE__ */ jsx("button", {
|
|
5372
5422
|
type: "button",
|
|
5373
5423
|
onClick: () => setExpanded((value) => !value),
|
|
5374
|
-
className: "text-xs font-medium text-
|
|
5424
|
+
className: "text-xs font-medium text-secondary hover:text-foreground",
|
|
5375
5425
|
children: expanded ? copy.showLess : copy.showMore
|
|
5376
5426
|
}) : null, message.link ? /* @__PURE__ */ jsxs(ExternalAnchor, {
|
|
5377
5427
|
href: message.link,
|
|
5378
|
-
children: [fillCopy(copy.openIn, { service: connector?.label ?? "" }), /* @__PURE__ */ jsx(
|
|
5428
|
+
children: [fillCopy(copy.openIn, { service: connector?.label ?? "" }), /* @__PURE__ */ jsx(ArrowUpRight, {
|
|
5379
5429
|
className: "h-3 w-3",
|
|
5380
5430
|
"aria-hidden": "true"
|
|
5381
5431
|
})]
|
|
@@ -5415,7 +5465,7 @@ function EventRow({ event, locale, copy }) {
|
|
|
5415
5465
|
className: "flex gap-3 px-3 py-2",
|
|
5416
5466
|
children: [
|
|
5417
5467
|
/* @__PURE__ */ jsx("span", {
|
|
5418
|
-
className: "w-24 shrink-0 pt-0.5 text-xs tabular-nums text-
|
|
5468
|
+
className: "w-24 shrink-0 pt-0.5 text-xs tabular-nums text-secondary",
|
|
5419
5469
|
children: eventTime(event, locale, copy)
|
|
5420
5470
|
}),
|
|
5421
5471
|
/* @__PURE__ */ jsxs("div", {
|
|
@@ -5424,13 +5474,13 @@ function EventRow({ event, locale, copy }) {
|
|
|
5424
5474
|
href: event.link,
|
|
5425
5475
|
target: "_blank",
|
|
5426
5476
|
rel: "noreferrer noopener",
|
|
5427
|
-
className: "block truncate text-sm font-medium text-
|
|
5477
|
+
className: "block truncate text-sm font-medium text-foreground hover:underline",
|
|
5428
5478
|
children: text(event.title) ?? copy.noSubject
|
|
5429
5479
|
}) : /* @__PURE__ */ jsx("p", {
|
|
5430
|
-
className: "truncate text-sm font-medium text-
|
|
5480
|
+
className: "truncate text-sm font-medium text-foreground",
|
|
5431
5481
|
children: text(event.title) ?? copy.noSubject
|
|
5432
5482
|
}), details.length > 0 ? /* @__PURE__ */ jsx("p", {
|
|
5433
|
-
className: "truncate text-xs text-
|
|
5483
|
+
className: "truncate text-xs text-muted",
|
|
5434
5484
|
children: details.join(" · ")
|
|
5435
5485
|
}) : null]
|
|
5436
5486
|
}),
|
|
@@ -5448,7 +5498,7 @@ function EventRow({ event, locale, copy }) {
|
|
|
5448
5498
|
function Agenda({ events, locale, copy }) {
|
|
5449
5499
|
const [expanded, setExpanded] = useState(false);
|
|
5450
5500
|
if (events.length === 0) return /* @__PURE__ */ jsx("p", {
|
|
5451
|
-
className: "px-3 py-3 text-sm text-
|
|
5501
|
+
className: "px-3 py-3 text-sm text-secondary",
|
|
5452
5502
|
children: copy.noEvents
|
|
5453
5503
|
});
|
|
5454
5504
|
const visible = expanded ? events : events.slice(0, COLLAPSED_ITEMS);
|
|
@@ -5458,12 +5508,12 @@ function Agenda({ events, locale, copy }) {
|
|
|
5458
5508
|
month: "long"
|
|
5459
5509
|
});
|
|
5460
5510
|
return /* @__PURE__ */ jsxs(Fragment, { children: [/* @__PURE__ */ jsx("div", {
|
|
5461
|
-
className: "divide-y divide-
|
|
5511
|
+
className: "divide-y divide-divider",
|
|
5462
5512
|
children: groupByDay(visible).map((group, index) => /* @__PURE__ */ jsxs("section", { children: [group.day ? /* @__PURE__ */ jsx("h4", {
|
|
5463
|
-
className: "bg-
|
|
5513
|
+
className: "bg-surface-muted px-3 py-1 text-xs font-medium capitalize text-secondary",
|
|
5464
5514
|
children: dayFormat.format(group.day)
|
|
5465
5515
|
}) : null, /* @__PURE__ */ jsx("ul", {
|
|
5466
|
-
className: "divide-y divide-
|
|
5516
|
+
className: "divide-y divide-divider",
|
|
5467
5517
|
children: group.events.map((event) => /* @__PURE__ */ jsx(EventRow, {
|
|
5468
5518
|
event,
|
|
5469
5519
|
locale,
|
|
@@ -5484,12 +5534,12 @@ function CollapsibleBody({ body, copy }) {
|
|
|
5484
5534
|
return /* @__PURE__ */ jsxs("div", {
|
|
5485
5535
|
className: "space-y-1",
|
|
5486
5536
|
children: [/* @__PURE__ */ jsx("p", {
|
|
5487
|
-
className: "whitespace-pre-wrap break-words text-sm leading-6 text-
|
|
5537
|
+
className: "whitespace-pre-wrap break-words text-sm leading-6 text-strong",
|
|
5488
5538
|
children: long && !expanded ? `${body.slice(0, COLLAPSED_BODY_CHARS).trimEnd()}…` : body
|
|
5489
5539
|
}), long ? /* @__PURE__ */ jsx("button", {
|
|
5490
5540
|
type: "button",
|
|
5491
5541
|
onClick: () => setExpanded((value) => !value),
|
|
5492
|
-
className: "text-xs font-medium text-
|
|
5542
|
+
className: "text-xs font-medium text-secondary hover:text-foreground",
|
|
5493
5543
|
children: expanded ? copy.showLess : copy.showMore
|
|
5494
5544
|
}) : null]
|
|
5495
5545
|
});
|
|
@@ -5502,15 +5552,15 @@ function DraftView({ view, copy }) {
|
|
|
5502
5552
|
className: "space-y-1",
|
|
5503
5553
|
children: [
|
|
5504
5554
|
/* @__PURE__ */ jsx("p", {
|
|
5505
|
-
className: "text-sm font-medium text-
|
|
5555
|
+
className: "text-sm font-medium text-foreground",
|
|
5506
5556
|
children: copy.draftSaved
|
|
5507
5557
|
}),
|
|
5508
5558
|
view.subject ? /* @__PURE__ */ jsx("p", {
|
|
5509
|
-
className: "truncate text-sm text-
|
|
5559
|
+
className: "truncate text-sm text-strong",
|
|
5510
5560
|
children: view.subject
|
|
5511
5561
|
}) : null,
|
|
5512
5562
|
view.to.length > 0 ? /* @__PURE__ */ jsxs("p", {
|
|
5513
|
-
className: "truncate text-xs text-
|
|
5563
|
+
className: "truncate text-xs text-muted",
|
|
5514
5564
|
children: [
|
|
5515
5565
|
copy.to,
|
|
5516
5566
|
": ",
|
|
@@ -5525,7 +5575,7 @@ function DraftView({ view, copy }) {
|
|
|
5525
5575
|
}),
|
|
5526
5576
|
view.link ? /* @__PURE__ */ jsxs(ExternalAnchor, {
|
|
5527
5577
|
href: view.link,
|
|
5528
|
-
children: [copy.openDraft, /* @__PURE__ */ jsx(
|
|
5578
|
+
children: [copy.openDraft, /* @__PURE__ */ jsx(ArrowUpRight, {
|
|
5529
5579
|
className: "h-3 w-3",
|
|
5530
5580
|
"aria-hidden": "true"
|
|
5531
5581
|
})]
|
|
@@ -5540,10 +5590,10 @@ function Field({ label, children }) {
|
|
|
5540
5590
|
return /* @__PURE__ */ jsxs("div", {
|
|
5541
5591
|
className: "flex gap-3 text-sm",
|
|
5542
5592
|
children: [/* @__PURE__ */ jsx("dt", {
|
|
5543
|
-
className: "w-24 shrink-0 text-xs leading-5 text-
|
|
5593
|
+
className: "w-24 shrink-0 text-xs leading-5 text-muted",
|
|
5544
5594
|
children: label
|
|
5545
5595
|
}), /* @__PURE__ */ jsx("dd", {
|
|
5546
|
-
className: "min-w-0 flex-1 break-words text-
|
|
5596
|
+
className: "min-w-0 flex-1 break-words text-foreground",
|
|
5547
5597
|
children
|
|
5548
5598
|
})]
|
|
5549
5599
|
});
|
|
@@ -5576,11 +5626,11 @@ function PendingMailView({ pending, copy }) {
|
|
|
5576
5626
|
]
|
|
5577
5627
|
}),
|
|
5578
5628
|
text(mail.reply_to_message_id) ? /* @__PURE__ */ jsx("p", {
|
|
5579
|
-
className: "text-xs text-
|
|
5629
|
+
className: "text-xs text-muted",
|
|
5580
5630
|
children: copy.replyInThread
|
|
5581
5631
|
}) : null,
|
|
5582
5632
|
/* @__PURE__ */ jsx("div", {
|
|
5583
|
-
className: "rounded-md border border-
|
|
5633
|
+
className: "rounded-md border border-border bg-surface-muted px-3 py-2",
|
|
5584
5634
|
children: /* @__PURE__ */ jsx(CollapsibleBody, {
|
|
5585
5635
|
body: text(mail.body),
|
|
5586
5636
|
copy
|
|
@@ -5612,7 +5662,7 @@ function Change({ before, after }) {
|
|
|
5612
5662
|
className: "flex flex-wrap items-baseline gap-x-2",
|
|
5613
5663
|
children: [
|
|
5614
5664
|
/* @__PURE__ */ jsx("span", {
|
|
5615
|
-
className: "text-
|
|
5665
|
+
className: "text-muted line-through",
|
|
5616
5666
|
children: before
|
|
5617
5667
|
}),
|
|
5618
5668
|
/* @__PURE__ */ jsx("span", {
|
|
@@ -5631,19 +5681,19 @@ function PendingEventView({ operation, pending, locale, copy }) {
|
|
|
5631
5681
|
className: "space-y-1 px-3 py-3",
|
|
5632
5682
|
children: [
|
|
5633
5683
|
/* @__PURE__ */ jsx("p", {
|
|
5634
|
-
className: "text-xs font-medium
|
|
5684
|
+
className: "text-xs font-medium capitalize tracking-wide text-danger-strong",
|
|
5635
5685
|
children: copy.deleteEvent
|
|
5636
5686
|
}),
|
|
5637
5687
|
/* @__PURE__ */ jsx("p", {
|
|
5638
|
-
className: "text-sm font-medium text-
|
|
5688
|
+
className: "text-sm font-medium text-foreground line-through",
|
|
5639
5689
|
children: text(current?.title) ?? text(action.event_id) ?? copy.noSubject
|
|
5640
5690
|
}),
|
|
5641
5691
|
current ? /* @__PURE__ */ jsx("p", {
|
|
5642
|
-
className: "text-xs text-
|
|
5692
|
+
className: "text-xs text-muted",
|
|
5643
5693
|
children: formatRange(current.start, current.end, Boolean(current.all_day), locale, copy)
|
|
5644
5694
|
}) : null,
|
|
5645
5695
|
(current?.attendees?.length ?? 0) > 0 ? /* @__PURE__ */ jsx("p", {
|
|
5646
|
-
className: "pt-1 text-xs text-
|
|
5696
|
+
className: "pt-1 text-xs text-secondary",
|
|
5647
5697
|
children: copy.attendeesNotified
|
|
5648
5698
|
}) : null
|
|
5649
5699
|
]
|
|
@@ -5658,7 +5708,7 @@ function PendingEventView({ operation, pending, locale, copy }) {
|
|
|
5658
5708
|
className: "space-y-2 px-3 py-3",
|
|
5659
5709
|
children: [
|
|
5660
5710
|
/* @__PURE__ */ jsx("p", {
|
|
5661
|
-
className: "text-xs font-medium
|
|
5711
|
+
className: "text-xs font-medium capitalize tracking-wide text-muted",
|
|
5662
5712
|
children: isUpdate ? copy.eventChange : copy.newEvent
|
|
5663
5713
|
}),
|
|
5664
5714
|
/* @__PURE__ */ jsxs("dl", {
|
|
@@ -5711,7 +5761,7 @@ function PendingEventView({ operation, pending, locale, copy }) {
|
|
|
5711
5761
|
]
|
|
5712
5762
|
}),
|
|
5713
5763
|
attendees.length > 0 ? /* @__PURE__ */ jsx("p", {
|
|
5714
|
-
className: "text-xs text-
|
|
5764
|
+
className: "text-xs text-secondary",
|
|
5715
5765
|
children: copy.attendeesNotified
|
|
5716
5766
|
}) : null
|
|
5717
5767
|
]
|
|
@@ -5733,24 +5783,24 @@ function ToolResultPersonalConnectorCard({ part, locale, className, toolConfirma
|
|
|
5733
5783
|
const total = headerCount(view, copy);
|
|
5734
5784
|
const isPending = view.kind === "pending-mail" || view.kind === "pending-event";
|
|
5735
5785
|
return /* @__PURE__ */ jsxs("section", {
|
|
5736
|
-
className: joinClasses("plai-tool-result-personal-connector-card overflow-hidden rounded-lg border border-
|
|
5786
|
+
className: joinClasses("plai-tool-result-personal-connector-card overflow-hidden rounded-lg border border-border bg-surface text-foreground", className),
|
|
5737
5787
|
"data-tool-call-id": part.id,
|
|
5738
5788
|
"data-tool-call-state": part.state,
|
|
5739
5789
|
"data-connector-action": view.kind,
|
|
5740
5790
|
children: [
|
|
5741
5791
|
/* @__PURE__ */ jsxs("header", {
|
|
5742
|
-
className: "flex items-center gap-2 border-b border-
|
|
5792
|
+
className: "flex items-center gap-2 border-b border-border px-3 py-2 text-xs text-secondary",
|
|
5743
5793
|
children: [
|
|
5744
5794
|
/* @__PURE__ */ jsx(Icon, {
|
|
5745
|
-
className: "h-4 w-4 shrink-0 text-
|
|
5795
|
+
className: "h-4 w-4 shrink-0 text-strong",
|
|
5746
5796
|
"aria-hidden": "true"
|
|
5747
5797
|
}),
|
|
5748
5798
|
/* @__PURE__ */ jsx("span", {
|
|
5749
|
-
className: "shrink-0 font-medium text-
|
|
5799
|
+
className: "shrink-0 font-medium text-foreground",
|
|
5750
5800
|
children: connector?.label
|
|
5751
5801
|
}),
|
|
5752
5802
|
connector?.account_email ? /* @__PURE__ */ jsx("span", {
|
|
5753
|
-
className: "min-w-0 truncate border-
|
|
5803
|
+
className: "min-w-0 truncate border-border-strong border px-2 py-0.5 rounded-md text-xs text-muted",
|
|
5754
5804
|
children: connector.account_email
|
|
5755
5805
|
}) : null,
|
|
5756
5806
|
isPending ? /* @__PURE__ */ jsx(ConfirmationBadge, {
|
|
@@ -5825,39 +5875,42 @@ function ConfirmedActionRow({ action, copy }) {
|
|
|
5825
5875
|
"data-confirmation-status": action.status,
|
|
5826
5876
|
children: [
|
|
5827
5877
|
failed ? /* @__PURE__ */ jsx(XCircle, {
|
|
5828
|
-
className: "mt-0.5 h-4 w-4 shrink-0 text-
|
|
5878
|
+
className: "mt-0.5 h-4 w-4 shrink-0 text-danger",
|
|
5829
5879
|
"aria-hidden": "true"
|
|
5830
5880
|
}) : executed ? /* @__PURE__ */ jsx(CheckCircle2, {
|
|
5831
|
-
className: "mt-0.5 h-4 w-4 shrink-0 text-
|
|
5881
|
+
className: "mt-0.5 h-4 w-4 shrink-0 text-success",
|
|
5832
5882
|
"aria-hidden": "true"
|
|
5833
5883
|
}) : /* @__PURE__ */ jsx(Clock, {
|
|
5834
|
-
className: "mt-0.5 h-4 w-4 shrink-0 text-
|
|
5884
|
+
className: "mt-0.5 h-4 w-4 shrink-0 text-muted",
|
|
5835
5885
|
"aria-hidden": "true"
|
|
5836
5886
|
}),
|
|
5837
5887
|
/* @__PURE__ */ jsxs("div", {
|
|
5838
5888
|
className: "min-w-0 flex-1 space-y-0.5",
|
|
5839
5889
|
children: [
|
|
5840
5890
|
/* @__PURE__ */ jsx("p", {
|
|
5841
|
-
className: "text-sm font-medium text-
|
|
5891
|
+
className: "text-sm font-medium text-foreground",
|
|
5842
5892
|
children: title
|
|
5843
5893
|
}),
|
|
5844
5894
|
connector ? /* @__PURE__ */ jsxs("div", {
|
|
5845
|
-
className: "flex items-center gap-2 truncate text-xs text-
|
|
5895
|
+
className: "flex items-center gap-2 truncate text-xs text-muted",
|
|
5846
5896
|
children: [connector.label, connector.account_email ? /* @__PURE__ */ jsx("span", {
|
|
5847
|
-
className: "min-w-0 truncate border-
|
|
5897
|
+
className: "min-w-0 truncate border-border-strong border px-2 py-0.5 rounded-md text-xs text-muted",
|
|
5848
5898
|
children: connector.account_email
|
|
5849
5899
|
}) : null]
|
|
5850
5900
|
}) : null,
|
|
5851
5901
|
failed && text(action.error) ? /* @__PURE__ */ jsx("p", {
|
|
5852
|
-
className: "line-clamp-2 text-xs text-
|
|
5902
|
+
className: "line-clamp-2 text-xs text-danger-strong",
|
|
5853
5903
|
children: action.error
|
|
5854
5904
|
}) : null
|
|
5855
5905
|
]
|
|
5856
5906
|
}),
|
|
5857
|
-
executed && link ? /* @__PURE__ */
|
|
5907
|
+
executed && link ? /* @__PURE__ */ jsxs(ExternalAnchor, {
|
|
5858
5908
|
href: link,
|
|
5859
5909
|
className: "shrink-0",
|
|
5860
|
-
children: operation === "send" ? copy.openEmail : copy.openEvent
|
|
5910
|
+
children: [operation === "send" ? copy.openEmail : copy.openEvent, /* @__PURE__ */ jsx(ArrowUpRight, {
|
|
5911
|
+
className: "h-3 w-3",
|
|
5912
|
+
"aria-hidden": "true"
|
|
5913
|
+
})]
|
|
5861
5914
|
}) : null
|
|
5862
5915
|
]
|
|
5863
5916
|
});
|
|
@@ -5867,7 +5920,7 @@ function ToolResultToolConfirmationCard({ part, locale, className }) {
|
|
|
5867
5920
|
if (actions.length === 0) return null;
|
|
5868
5921
|
const copy = getPersonalConnectorCopy(locale);
|
|
5869
5922
|
return /* @__PURE__ */ jsx("ul", {
|
|
5870
|
-
className: joinClasses("plai-tool-result-tool-confirmation-card divide-y divide-
|
|
5923
|
+
className: joinClasses("plai-tool-result-tool-confirmation-card divide-y divide-divider overflow-hidden rounded-lg border border-border bg-surface text-foreground", className),
|
|
5871
5924
|
"data-tool-call-id": part.id,
|
|
5872
5925
|
"data-tool-call-state": part.state,
|
|
5873
5926
|
children: actions.map((action) => /* @__PURE__ */ jsx(ConfirmedActionRow, {
|
|
@@ -5892,14 +5945,14 @@ function ToolResultPendingConfirmationCard({ part, locale, className, toolConfir
|
|
|
5892
5945
|
const copy = getPersonalConnectorCopy(locale);
|
|
5893
5946
|
const entries = Object.entries(pending.action).filter(([key, value]) => key !== "operation" && value !== null && value !== void 0);
|
|
5894
5947
|
return /* @__PURE__ */ jsxs("section", {
|
|
5895
|
-
className: joinClasses("plai-tool-result-pending-confirmation-card overflow-hidden rounded-lg border border-
|
|
5948
|
+
className: joinClasses("plai-tool-result-pending-confirmation-card overflow-hidden rounded-lg border border-border bg-surface text-foreground", className),
|
|
5896
5949
|
"data-tool-call-id": part.id,
|
|
5897
5950
|
"data-tool-call-state": part.state,
|
|
5898
5951
|
children: [
|
|
5899
5952
|
/* @__PURE__ */ jsxs("header", {
|
|
5900
|
-
className: "flex items-center gap-2 border-b border-
|
|
5953
|
+
className: "flex items-center gap-2 border-b border-border px-3 py-2 text-xs text-secondary",
|
|
5901
5954
|
children: [/* @__PURE__ */ jsx("span", {
|
|
5902
|
-
className: "truncate font-mono font-medium text-
|
|
5955
|
+
className: "truncate font-mono font-medium text-foreground",
|
|
5903
5956
|
children: part.name
|
|
5904
5957
|
}), /* @__PURE__ */ jsx(ConfirmationBadge, {
|
|
5905
5958
|
state: confirmationState,
|
|
@@ -5962,12 +6015,12 @@ function ToolResultWorkflowDispatchCard({ part, className, locale }) {
|
|
|
5962
6015
|
const error = formatToolErrorDetails(part.errorDetails);
|
|
5963
6016
|
return /* @__PURE__ */ jsxs(Sheet, { children: [/* @__PURE__ */ jsx(SheetTrigger, {
|
|
5964
6017
|
"aria-label": `${copy.workflow}: ${workflowName}`,
|
|
5965
|
-
className: joinClasses("w-full rounded-lg border border-
|
|
6018
|
+
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),
|
|
5966
6019
|
children: /* @__PURE__ */ jsxs("span", {
|
|
5967
6020
|
className: "flex items-center gap-2 px-3 py-2 text-sm",
|
|
5968
6021
|
children: [
|
|
5969
6022
|
/* @__PURE__ */ jsx(Workflow, {
|
|
5970
|
-
className: "h-4 w-4 shrink-0 text-
|
|
6023
|
+
className: "h-4 w-4 shrink-0 text-muted",
|
|
5971
6024
|
"aria-hidden": "true"
|
|
5972
6025
|
}),
|
|
5973
6026
|
/* @__PURE__ */ jsx("span", {
|
|
@@ -5975,19 +6028,19 @@ function ToolResultWorkflowDispatchCard({ part, className, locale }) {
|
|
|
5975
6028
|
children: copy.workflow
|
|
5976
6029
|
}),
|
|
5977
6030
|
/* @__PURE__ */ jsx("span", {
|
|
5978
|
-
className: "min-w-0 truncate border-
|
|
6031
|
+
className: "min-w-0 truncate border-border-strong border px-2 py-0.5 rounded-md text-xs text-muted",
|
|
5979
6032
|
children: workflowName
|
|
5980
6033
|
}),
|
|
5981
6034
|
/* @__PURE__ */ jsxs("span", {
|
|
5982
6035
|
className: "ml-auto flex shrink-0 items-center gap-2",
|
|
5983
6036
|
children: [/* @__PURE__ */ jsx("span", {
|
|
5984
|
-
className: "text-xs text-
|
|
6037
|
+
className: "text-xs text-muted",
|
|
5985
6038
|
children: status
|
|
5986
6039
|
}), failed ? /* @__PURE__ */ jsx(XCircle, {
|
|
5987
|
-
className: "h-4 w-4 text-
|
|
6040
|
+
className: "h-4 w-4 text-danger",
|
|
5988
6041
|
"aria-hidden": "true"
|
|
5989
6042
|
}) : /* @__PURE__ */ jsx(CheckCircle2, {
|
|
5990
|
-
className: "h-4 w-4 text-
|
|
6043
|
+
className: "h-4 w-4 text-success",
|
|
5991
6044
|
"aria-hidden": "true"
|
|
5992
6045
|
})]
|
|
5993
6046
|
})
|
|
@@ -6006,22 +6059,22 @@ function ToolResultWorkflowDispatchCard({ part, className, locale }) {
|
|
|
6006
6059
|
className: "grid gap-2 text-sm",
|
|
6007
6060
|
children: [
|
|
6008
6061
|
/* @__PURE__ */ jsxs("div", { children: [/* @__PURE__ */ jsx("dt", {
|
|
6009
|
-
className: "text-xs text-
|
|
6062
|
+
className: "text-xs text-muted",
|
|
6010
6063
|
children: copy.workflow
|
|
6011
6064
|
}), /* @__PURE__ */ jsx("dd", { children: workflowName })] }),
|
|
6012
6065
|
/* @__PURE__ */ jsxs("div", { children: [/* @__PURE__ */ jsx("dt", {
|
|
6013
|
-
className: "text-xs text-
|
|
6066
|
+
className: "text-xs text-muted",
|
|
6014
6067
|
children: copy.status
|
|
6015
6068
|
}), /* @__PURE__ */ jsx("dd", { children: status })] }),
|
|
6016
6069
|
result.executionId ? /* @__PURE__ */ jsxs("div", { children: [/* @__PURE__ */ jsx("dt", {
|
|
6017
|
-
className: "text-xs text-
|
|
6070
|
+
className: "text-xs text-muted",
|
|
6018
6071
|
children: copy.executionId
|
|
6019
6072
|
}), /* @__PURE__ */ jsx("dd", {
|
|
6020
6073
|
className: "break-all",
|
|
6021
6074
|
children: result.executionId
|
|
6022
6075
|
})] }) : null,
|
|
6023
6076
|
result.workflowId ? /* @__PURE__ */ jsxs("div", { children: [/* @__PURE__ */ jsx("dt", {
|
|
6024
|
-
className: "text-xs text-
|
|
6077
|
+
className: "text-xs text-muted",
|
|
6025
6078
|
children: copy.workflowId
|
|
6026
6079
|
}), /* @__PURE__ */ jsx("dd", {
|
|
6027
6080
|
className: "break-all",
|
|
@@ -6033,11 +6086,11 @@ function ToolResultWorkflowDispatchCard({ part, className, locale }) {
|
|
|
6033
6086
|
className: "mb-2 text-sm font-medium",
|
|
6034
6087
|
children: copy.result
|
|
6035
6088
|
}), /* @__PURE__ */ jsx("pre", {
|
|
6036
|
-
className: "overflow-x-auto rounded-md border border-
|
|
6089
|
+
className: "overflow-x-auto rounded-md border border-border bg-surface-muted p-3 text-xs leading-5",
|
|
6037
6090
|
children: output$1
|
|
6038
6091
|
})] }) : null,
|
|
6039
6092
|
error ? /* @__PURE__ */ jsxs("p", {
|
|
6040
|
-
className: "rounded border border-
|
|
6093
|
+
className: "rounded border border-danger-border bg-danger-subtle px-3 py-2 text-xs text-danger-strong",
|
|
6041
6094
|
children: [
|
|
6042
6095
|
/* @__PURE__ */ jsxs("span", {
|
|
6043
6096
|
className: "font-semibold",
|
|
@@ -6248,6 +6301,11 @@ function getDatasourceResources$1(part) {
|
|
|
6248
6301
|
const resources = part.metadata.resources;
|
|
6249
6302
|
return Array.isArray(resources) ? resources.filter(isDatasourceResource) : [];
|
|
6250
6303
|
}
|
|
6304
|
+
function getDatasourceResourceLinks(part) {
|
|
6305
|
+
if (part.toolType !== "datasource" || !part.metadata) return [];
|
|
6306
|
+
const links = part.metadata.resource_links;
|
|
6307
|
+
return Array.isArray(links) ? links.filter(isResourceLink) : [];
|
|
6308
|
+
}
|
|
6251
6309
|
function ToolResultCard({ part, className, detailsOpen = true, locale, onOpenAgentThread, getResourceDownloadUrl, memoryProposal, toolConfirmation }) {
|
|
6252
6310
|
const copy = getUiCopy(locale);
|
|
6253
6311
|
if (part.toolType === "memory_proposal") {
|
|
@@ -6284,6 +6342,7 @@ function ToolResultCard({ part, className, detailsOpen = true, locale, onOpenAge
|
|
|
6284
6342
|
});
|
|
6285
6343
|
const officeMediaFiles = getOfficeDocumentMediaFiles(part);
|
|
6286
6344
|
const datasourceResources = getDatasourceResources$1(part);
|
|
6345
|
+
const datasourceResourceLinks = getDatasourceResourceLinks(part);
|
|
6287
6346
|
if (part.toolType === "email_send") return /* @__PURE__ */ jsx(ToolResultEmailSendCard, {
|
|
6288
6347
|
part,
|
|
6289
6348
|
locale,
|
|
@@ -6338,85 +6397,88 @@ function ToolResultCard({ part, className, detailsOpen = true, locale, onOpenAge
|
|
|
6338
6397
|
});
|
|
6339
6398
|
if (datasourceResources.length > 0) return /* @__PURE__ */ jsx(DatasourceToolResources, {
|
|
6340
6399
|
resources: datasourceResources,
|
|
6400
|
+
resourceLinks: datasourceResourceLinks,
|
|
6341
6401
|
locale,
|
|
6342
6402
|
className,
|
|
6343
6403
|
getResourceDownloadUrl
|
|
6344
6404
|
});
|
|
6345
6405
|
if (part.toolType === "datasource") return null;
|
|
6346
6406
|
return /* @__PURE__ */ jsxs("section", {
|
|
6347
|
-
className: joinClasses("
|
|
6407
|
+
className: joinClasses("plai-tool-result-card overflow-hidden rounded-lg border border-border bg-surface-muted", className),
|
|
6348
6408
|
"data-tool-call-id": part.id,
|
|
6349
6409
|
"data-tool-call-state": part.state,
|
|
6350
|
-
children: [
|
|
6351
|
-
|
|
6352
|
-
|
|
6353
|
-
|
|
6354
|
-
|
|
6355
|
-
|
|
6356
|
-
|
|
6357
|
-
|
|
6358
|
-
|
|
6359
|
-
|
|
6360
|
-
|
|
6361
|
-
|
|
6362
|
-
|
|
6363
|
-
|
|
6364
|
-
|
|
6365
|
-
|
|
6366
|
-
|
|
6367
|
-
|
|
6368
|
-
|
|
6369
|
-
|
|
6370
|
-
|
|
6371
|
-
|
|
6372
|
-
|
|
6373
|
-
|
|
6374
|
-
|
|
6375
|
-
|
|
6376
|
-
|
|
6377
|
-
|
|
6378
|
-
|
|
6379
|
-
|
|
6380
|
-
|
|
6381
|
-
|
|
6382
|
-
|
|
6383
|
-
|
|
6384
|
-
|
|
6385
|
-
|
|
6386
|
-
|
|
6387
|
-
|
|
6388
|
-
|
|
6389
|
-
|
|
6390
|
-
|
|
6391
|
-
|
|
6392
|
-
|
|
6393
|
-
|
|
6394
|
-
|
|
6395
|
-
|
|
6396
|
-
|
|
6397
|
-
|
|
6398
|
-
|
|
6399
|
-
|
|
6400
|
-
|
|
6401
|
-
|
|
6402
|
-
|
|
6403
|
-
|
|
6404
|
-
|
|
6405
|
-
|
|
6406
|
-
|
|
6407
|
-
|
|
6408
|
-
|
|
6409
|
-
|
|
6410
|
-
|
|
6411
|
-
|
|
6412
|
-
|
|
6413
|
-
|
|
6414
|
-
|
|
6415
|
-
|
|
6416
|
-
|
|
6417
|
-
|
|
6418
|
-
|
|
6419
|
-
|
|
6410
|
+
children: [/* @__PURE__ */ jsxs("header", {
|
|
6411
|
+
className: "flex items-center justify-between gap-2 border-b border-border px-3 py-2",
|
|
6412
|
+
children: [/* @__PURE__ */ jsx("h4", {
|
|
6413
|
+
className: "text-sm font-semibold text-foreground",
|
|
6414
|
+
children: part.name
|
|
6415
|
+
}), /* @__PURE__ */ jsx("span", {
|
|
6416
|
+
className: "rounded-full border capitalize border-success-border bg-success-subtle px-2 py-0.5 text-xs text-success-strong",
|
|
6417
|
+
children: copy.completed
|
|
6418
|
+
})]
|
|
6419
|
+
}), /* @__PURE__ */ jsxs("div", {
|
|
6420
|
+
className: "space-y-3 px-3 py-2",
|
|
6421
|
+
children: [
|
|
6422
|
+
part.toolType ? /* @__PURE__ */ jsxs("p", {
|
|
6423
|
+
className: "text-xs text-secondary",
|
|
6424
|
+
children: [
|
|
6425
|
+
/* @__PURE__ */ jsxs("span", {
|
|
6426
|
+
className: "font-semibold",
|
|
6427
|
+
children: [copy.type, ":"]
|
|
6428
|
+
}),
|
|
6429
|
+
" ",
|
|
6430
|
+
part.toolType
|
|
6431
|
+
]
|
|
6432
|
+
}) : null,
|
|
6433
|
+
/* @__PURE__ */ jsxs("details", {
|
|
6434
|
+
open: detailsOpen,
|
|
6435
|
+
className: "space-y-2",
|
|
6436
|
+
children: [/* @__PURE__ */ jsx("summary", {
|
|
6437
|
+
className: "cursor-pointer text-xs font-semibold text-secondary",
|
|
6438
|
+
children: copy.input
|
|
6439
|
+
}), /* @__PURE__ */ jsx("pre", {
|
|
6440
|
+
className: "overflow-x-auto rounded bg-inverse p-2 text-xs text-inverse-foreground",
|
|
6441
|
+
children: formatJson(part.input)
|
|
6442
|
+
})]
|
|
6443
|
+
}),
|
|
6444
|
+
part.result !== void 0 ? /* @__PURE__ */ jsxs("details", {
|
|
6445
|
+
open: detailsOpen,
|
|
6446
|
+
className: "space-y-2",
|
|
6447
|
+
children: [
|
|
6448
|
+
/* @__PURE__ */ jsx("summary", {
|
|
6449
|
+
className: "cursor-pointer text-xs font-semibold text-secondary",
|
|
6450
|
+
children: copy.output
|
|
6451
|
+
}),
|
|
6452
|
+
officeMediaFiles.length > 0 ? /* @__PURE__ */ jsxs("div", {
|
|
6453
|
+
className: "space-y-2 rounded border border-border bg-surface p-3",
|
|
6454
|
+
children: [/* @__PURE__ */ jsx("p", {
|
|
6455
|
+
className: "text-xs font-semibold text-strong",
|
|
6456
|
+
children: copy.generatedFiles
|
|
6457
|
+
}), /* @__PURE__ */ jsx("ul", {
|
|
6458
|
+
className: "space-y-1",
|
|
6459
|
+
children: officeMediaFiles.map((file) => {
|
|
6460
|
+
const label = file.name || file.pathname || file.id;
|
|
6461
|
+
return /* @__PURE__ */ jsx("li", {
|
|
6462
|
+
className: "text-xs text-strong",
|
|
6463
|
+
children: file.url ? /* @__PURE__ */ jsx("a", {
|
|
6464
|
+
href: file.url,
|
|
6465
|
+
target: "_blank",
|
|
6466
|
+
rel: "noreferrer noopener",
|
|
6467
|
+
className: "hover:underline",
|
|
6468
|
+
children: label
|
|
6469
|
+
}) : /* @__PURE__ */ jsx("span", { children: label })
|
|
6470
|
+
}, file.id);
|
|
6471
|
+
})
|
|
6472
|
+
})]
|
|
6473
|
+
}) : null,
|
|
6474
|
+
/* @__PURE__ */ jsx("pre", {
|
|
6475
|
+
className: "overflow-x-auto rounded bg-inverse p-2 text-xs text-inverse-foreground",
|
|
6476
|
+
children: formatJson(part.result)
|
|
6477
|
+
})
|
|
6478
|
+
]
|
|
6479
|
+
}) : null
|
|
6480
|
+
]
|
|
6481
|
+
})]
|
|
6420
6482
|
});
|
|
6421
6483
|
}
|
|
6422
6484
|
|
|
@@ -6435,7 +6497,7 @@ function Thinking({ part, thinkingLabel, completedLabel, locale, defaultOpen, cl
|
|
|
6435
6497
|
previousState.current = part.state;
|
|
6436
6498
|
}, [isStreaming, part.state]);
|
|
6437
6499
|
return /* @__PURE__ */ jsxs("section", {
|
|
6438
|
-
className: joinClasses("text-sm text-
|
|
6500
|
+
className: joinClasses("text-sm text-secondary", className),
|
|
6439
6501
|
"data-thinking-state": part.state,
|
|
6440
6502
|
...props,
|
|
6441
6503
|
children: [
|
|
@@ -6445,7 +6507,7 @@ function Thinking({ part, thinkingLabel, completedLabel, locale, defaultOpen, cl
|
|
|
6445
6507
|
"aria-expanded": hasContent ? isOpen : void 0,
|
|
6446
6508
|
"aria-label": hasContent ? `${isOpen ? copy.collapse : copy.expand} ${label}` : label,
|
|
6447
6509
|
disabled: !hasContent,
|
|
6448
|
-
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-
|
|
6510
|
+
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"),
|
|
6449
6511
|
onClick: () => setIsOpen((value) => !value),
|
|
6450
6512
|
children: [
|
|
6451
6513
|
isStreaming ? /* @__PURE__ */ jsx(LoaderCircle, {
|
|
@@ -6469,7 +6531,7 @@ function Thinking({ part, thinkingLabel, completedLabel, locale, defaultOpen, cl
|
|
|
6469
6531
|
}),
|
|
6470
6532
|
hasContent && isOpen ? /* @__PURE__ */ jsx("p", {
|
|
6471
6533
|
id: contentId,
|
|
6472
|
-
className: "mt-1 whitespace-pre-wrap border-l-2 border-
|
|
6534
|
+
className: "mt-1 whitespace-pre-wrap border-l-2 border-border pl-3 text-sm leading-6 text-secondary",
|
|
6473
6535
|
children: part.thinking
|
|
6474
6536
|
}) : null
|
|
6475
6537
|
]
|
|
@@ -6496,7 +6558,7 @@ function MessageAvatar({ src, fallback, alt = fallback, className, imageClassNam
|
|
|
6496
6558
|
const showImage = src.trim().length > 0 && failedSrc !== src;
|
|
6497
6559
|
const initials = getFallbackInitials(fallback);
|
|
6498
6560
|
return /* @__PURE__ */ jsx("div", {
|
|
6499
|
-
className: joinClasses("plai-message-avatar flex size-10 shrink-0 items-center justify-center overflow-hidden rounded-full bg-
|
|
6561
|
+
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),
|
|
6500
6562
|
...props,
|
|
6501
6563
|
children: showImage ? /* @__PURE__ */ jsx("img", {
|
|
6502
6564
|
src,
|
|
@@ -6518,7 +6580,7 @@ function MessageContent({ className,...props }) {
|
|
|
6518
6580
|
}
|
|
6519
6581
|
function MessageHeader({ className,...props }) {
|
|
6520
6582
|
return /* @__PURE__ */ jsx("header", {
|
|
6521
|
-
className: joinClasses("text-xs font-semibold uppercase tracking-wide text-
|
|
6583
|
+
className: joinClasses("text-xs font-semibold uppercase tracking-wide text-muted", className),
|
|
6522
6584
|
...props
|
|
6523
6585
|
});
|
|
6524
6586
|
}
|
|
@@ -6559,13 +6621,13 @@ function renderPart(part, index, message, isStreaming, onOpenAgentThread, getRes
|
|
|
6559
6621
|
href: part.url,
|
|
6560
6622
|
target: "_blank",
|
|
6561
6623
|
rel: "noreferrer noopener",
|
|
6562
|
-
className: "block w-fit rounded-lg border border-
|
|
6624
|
+
className: "block w-fit rounded-lg border border-border bg-surface p-2",
|
|
6563
6625
|
children: [/* @__PURE__ */ jsx("img", {
|
|
6564
6626
|
src: part.url,
|
|
6565
6627
|
alt: title || copy.uploadedImage,
|
|
6566
6628
|
className: "max-h-56 rounded-md object-contain"
|
|
6567
6629
|
}), title ? /* @__PURE__ */ jsx("p", {
|
|
6568
|
-
className: "mt-2 max-w-xs truncate text-xs font-medium text-
|
|
6630
|
+
className: "mt-2 max-w-xs truncate text-xs font-medium text-strong",
|
|
6569
6631
|
children: title
|
|
6570
6632
|
}) : null]
|
|
6571
6633
|
}, `image-${index}`);
|
|
@@ -6577,17 +6639,17 @@ function renderPart(part, index, message, isStreaming, onOpenAgentThread, getRes
|
|
|
6577
6639
|
href: part.fileUrl,
|
|
6578
6640
|
target: "_blank",
|
|
6579
6641
|
rel: "noreferrer noopener",
|
|
6580
|
-
className: "flex w-fit items-center gap-3 rounded-lg border border-
|
|
6642
|
+
className: "flex w-fit items-center gap-3 rounded-lg border border-border bg-surface-muted px-3 py-2 text-left",
|
|
6581
6643
|
children: [/* @__PURE__ */ jsx("span", {
|
|
6582
|
-
className: "rounded bg-
|
|
6644
|
+
className: "rounded bg-inverse px-2 py-1 text-[10px] font-semibold uppercase tracking-wide text-inverse-foreground",
|
|
6583
6645
|
children: extension ?? copy.file
|
|
6584
6646
|
}), /* @__PURE__ */ jsxs("div", {
|
|
6585
6647
|
className: "min-w-0",
|
|
6586
6648
|
children: [/* @__PURE__ */ jsx("p", {
|
|
6587
|
-
className: "max-w-xs truncate text-sm font-medium text-
|
|
6649
|
+
className: "max-w-xs truncate text-sm font-medium text-foreground",
|
|
6588
6650
|
children: fileName
|
|
6589
6651
|
}), part.mimeType ? /* @__PURE__ */ jsx("p", {
|
|
6590
|
-
className: "text-xs text-
|
|
6652
|
+
className: "text-xs text-muted",
|
|
6591
6653
|
children: part.mimeType
|
|
6592
6654
|
}) : null]
|
|
6593
6655
|
})]
|
|
@@ -6614,7 +6676,7 @@ function renderPart(part, index, message, isStreaming, onOpenAgentThread, getRes
|
|
|
6614
6676
|
}, `thinking-${index}`);
|
|
6615
6677
|
}
|
|
6616
6678
|
if (part.type === "guardrail") return /* @__PURE__ */ jsx("p", {
|
|
6617
|
-
className: "rounded-lg border border-
|
|
6679
|
+
className: "rounded-lg border border-warning-border bg-warning-subtle px-3 py-2 text-sm text-warning-strong",
|
|
6618
6680
|
children: part.content
|
|
6619
6681
|
}, `guardrail-${index}`);
|
|
6620
6682
|
return null;
|
|
@@ -6691,7 +6753,7 @@ function MessageParts({ message, collapseThreshold = DEFAULT_COLLAPSE_THRESHOLD,
|
|
|
6691
6753
|
getResourceDownloadUrl
|
|
6692
6754
|
}, `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", {
|
|
6693
6755
|
type: "button",
|
|
6694
|
-
className: "text-xs font-medium text-
|
|
6756
|
+
className: "text-xs font-medium text-secondary hover:text-foreground",
|
|
6695
6757
|
onClick: () => setIsExpanded((previous) => !previous),
|
|
6696
6758
|
children: isExpanded ? readLessLabel ?? copy.readLess : readMoreLabel ?? copy.readMore
|
|
6697
6759
|
}) : null]
|
|
@@ -6878,7 +6940,7 @@ function Clipboard({ text: text$2, onCopy, copiedDuration = 2e3, copyLabel, copi
|
|
|
6878
6940
|
return /* @__PURE__ */ jsxs("button", {
|
|
6879
6941
|
type,
|
|
6880
6942
|
"aria-label": isCopied ? resolvedCopiedLabel : resolvedCopyLabel,
|
|
6881
|
-
className: joinClasses("inline-flex size-9 shrink-0 items-center justify-center rounded-lg border border-
|
|
6943
|
+
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),
|
|
6882
6944
|
disabled: disabled || isCopying,
|
|
6883
6945
|
onClick: handleClick,
|
|
6884
6946
|
...props,
|
|
@@ -6902,7 +6964,7 @@ function ThumbButton({ label, icon, className, type = "button",...props }) {
|
|
|
6902
6964
|
return /* @__PURE__ */ jsxs("button", {
|
|
6903
6965
|
type,
|
|
6904
6966
|
"aria-label": label,
|
|
6905
|
-
className: joinClasses("inline-flex size-9 shrink-0 items-center justify-center rounded-lg border border-
|
|
6967
|
+
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),
|
|
6906
6968
|
...props,
|
|
6907
6969
|
children: [icon, /* @__PURE__ */ jsx("span", {
|
|
6908
6970
|
className: "sr-only",
|
|
@@ -6938,7 +7000,7 @@ function Reload({ label, locale, className, type = "button",...props }) {
|
|
|
6938
7000
|
return /* @__PURE__ */ jsxs("button", {
|
|
6939
7001
|
type,
|
|
6940
7002
|
"aria-label": resolvedLabel,
|
|
6941
|
-
className: joinClasses("inline-flex size-9 shrink-0 items-center justify-center rounded-lg border border-
|
|
7003
|
+
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),
|
|
6942
7004
|
...props,
|
|
6943
7005
|
children: [/* @__PURE__ */ jsx(RotateCcw, {
|
|
6944
7006
|
className: "size-4",
|
|
@@ -7025,7 +7087,7 @@ function PromptFormAttachButton({ onFilesSelected, onInvalidFiles, locale, accep
|
|
|
7025
7087
|
|
|
7026
7088
|
//#endregion
|
|
7027
7089
|
//#region src/components/prompt-form/prompt-form.tsx
|
|
7028
|
-
const actionButtonClassName = "inline-flex size-8 shrink-0 items-center justify-center rounded-md bg-
|
|
7090
|
+
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";
|
|
7029
7091
|
const defaultMaxRows = 4;
|
|
7030
7092
|
function resizeTextarea(textarea, maxRows) {
|
|
7031
7093
|
const styles = getComputedStyle(textarea);
|
|
@@ -7077,7 +7139,7 @@ function PromptForm({ value, onValueChange, onSubmit, status = "ready", locale,
|
|
|
7077
7139
|
setFiles(files.filter((_, fileIndex) => fileIndex !== index));
|
|
7078
7140
|
}
|
|
7079
7141
|
return /* @__PURE__ */ jsxs("form", {
|
|
7080
|
-
className: joinClasses("flex w-full flex-col overflow-hidden rounded-2xl border border-
|
|
7142
|
+
className: joinClasses("flex w-full flex-col overflow-hidden rounded-2xl border border-border bg-surface", className),
|
|
7081
7143
|
onSubmit: async (event) => {
|
|
7082
7144
|
event.preventDefault();
|
|
7083
7145
|
if (!canSubmit) return;
|
|
@@ -7109,7 +7171,7 @@ function PromptForm({ value, onValueChange, onSubmit, status = "ready", locale,
|
|
|
7109
7171
|
/* @__PURE__ */ jsx("textarea", {
|
|
7110
7172
|
ref: textareaRef,
|
|
7111
7173
|
rows: 1,
|
|
7112
|
-
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-
|
|
7174
|
+
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),
|
|
7113
7175
|
value,
|
|
7114
7176
|
onChange: (event) => {
|
|
7115
7177
|
onValueChange(event.target.value);
|
|
@@ -7153,17 +7215,17 @@ function PromptForm({ value, onValueChange, onSubmit, status = "ready", locale,
|
|
|
7153
7215
|
})
|
|
7154
7216
|
]
|
|
7155
7217
|
}), files.length > 0 ? /* @__PURE__ */ jsxs("div", {
|
|
7156
|
-
className: joinClasses("border-t border-
|
|
7218
|
+
className: joinClasses("border-t border-border", attachmentsClassName),
|
|
7157
7219
|
children: [/* @__PURE__ */ jsx("div", {
|
|
7158
7220
|
className: "flex flex-wrap gap-2 px-4 py-2",
|
|
7159
7221
|
children: files.map((file, index) => /* @__PURE__ */ jsxs("div", {
|
|
7160
|
-
className: "flex max-w-full items-center gap-1.5 rounded-md bg-
|
|
7222
|
+
className: "flex max-w-full items-center gap-1.5 rounded-md bg-surface-subtle px-2 py-1 text-xs text-strong",
|
|
7161
7223
|
children: [/* @__PURE__ */ jsx("span", {
|
|
7162
7224
|
className: "max-w-[150px] truncate",
|
|
7163
7225
|
children: file.name
|
|
7164
7226
|
}), /* @__PURE__ */ jsx("button", {
|
|
7165
7227
|
type: "button",
|
|
7166
|
-
className: "text-
|
|
7228
|
+
className: "text-muted transition-colors hover:text-strong disabled:cursor-not-allowed disabled:opacity-40",
|
|
7167
7229
|
"aria-label": `${removeFileLabel}: ${file.name}`,
|
|
7168
7230
|
disabled: isInteractionDisabled,
|
|
7169
7231
|
onClick: () => removeFile(index),
|
|
@@ -7179,14 +7241,14 @@ function PromptForm({ value, onValueChange, onSubmit, status = "ready", locale,
|
|
|
7179
7241
|
"aria-valuemin": 0,
|
|
7180
7242
|
"aria-valuemax": 100,
|
|
7181
7243
|
"aria-valuenow": Math.round(uploadState.progress),
|
|
7182
|
-
className: joinClasses("h-1.5 overflow-hidden rounded-full bg-
|
|
7244
|
+
className: joinClasses("h-1.5 overflow-hidden rounded-full bg-surface-hover", uploadProgressClassName),
|
|
7183
7245
|
children: /* @__PURE__ */ jsx("div", {
|
|
7184
|
-
className: "h-full rounded-full bg-
|
|
7246
|
+
className: "h-full rounded-full bg-inverse transition-[width] duration-150",
|
|
7185
7247
|
style: { width: `${uploadState.progress}%` }
|
|
7186
7248
|
})
|
|
7187
7249
|
})
|
|
7188
7250
|
}) : uploadState?.status === "error" ? /* @__PURE__ */ jsx("p", {
|
|
7189
|
-
className: "px-4 pb-3 text-xs text-
|
|
7251
|
+
className: "px-4 pb-3 text-xs text-danger",
|
|
7190
7252
|
children: uploadErrorLabel
|
|
7191
7253
|
}) : null]
|
|
7192
7254
|
}) : null]
|
|
@@ -7390,7 +7452,7 @@ function SpeechToTextToggle({ controller, onTranscriptionComplete, onTranscripti
|
|
|
7390
7452
|
"aria-pressed": isListening,
|
|
7391
7453
|
"aria-busy": isRequesting || isTranscribing,
|
|
7392
7454
|
disabled: disabled || isRequesting || isTranscribing,
|
|
7393
|
-
className: joinClasses(isListening && !isTranscribing ? "text-
|
|
7455
|
+
className: joinClasses(isListening && !isTranscribing ? "text-danger" : void 0, className),
|
|
7394
7456
|
onClick: (event) => {
|
|
7395
7457
|
onClick?.(event);
|
|
7396
7458
|
if (event.defaultPrevented) return;
|
|
@@ -7495,7 +7557,7 @@ function ConversationFilesList({ messages, locale, className }) {
|
|
|
7495
7557
|
className: joinClasses("space-y-6", className),
|
|
7496
7558
|
children: [
|
|
7497
7559
|
uploaded.length === 0 && generated.length === 0 ? /* @__PURE__ */ jsx("p", {
|
|
7498
|
-
className: "text-sm text-
|
|
7560
|
+
className: "text-sm text-secondary",
|
|
7499
7561
|
children: copy.noConversationFiles
|
|
7500
7562
|
}) : null,
|
|
7501
7563
|
/* @__PURE__ */ jsx(FileSection, {
|
|
@@ -7517,7 +7579,7 @@ function FileSection({ title, files, copy }) {
|
|
|
7517
7579
|
className: "space-y-3",
|
|
7518
7580
|
"aria-label": title,
|
|
7519
7581
|
children: [/* @__PURE__ */ jsxs("h3", {
|
|
7520
|
-
className: "text-xs font-semibold uppercase tracking-wide text-
|
|
7582
|
+
className: "text-xs font-semibold uppercase tracking-wide text-muted",
|
|
7521
7583
|
children: [
|
|
7522
7584
|
title,
|
|
7523
7585
|
" (",
|
|
@@ -7525,7 +7587,7 @@ function FileSection({ title, files, copy }) {
|
|
|
7525
7587
|
")"
|
|
7526
7588
|
]
|
|
7527
7589
|
}), files.map((file) => /* @__PURE__ */ jsxs("div", {
|
|
7528
|
-
className: "flex items-center gap-3 rounded-lg border border-
|
|
7590
|
+
className: "flex items-center gap-3 rounded-lg border border-border bg-surface p-3",
|
|
7529
7591
|
children: [
|
|
7530
7592
|
/* @__PURE__ */ jsx(File, {
|
|
7531
7593
|
className: joinClasses("h-8 w-8 shrink-0", getFileIconClass(file.extension)),
|
|
@@ -7537,7 +7599,7 @@ function FileSection({ title, files, copy }) {
|
|
|
7537
7599
|
className: "truncate text-sm font-medium",
|
|
7538
7600
|
children: file.name
|
|
7539
7601
|
}), file.extension ? /* @__PURE__ */ jsx("p", {
|
|
7540
|
-
className: "text-[11px] uppercase text-
|
|
7602
|
+
className: "text-[11px] uppercase text-muted",
|
|
7541
7603
|
children: file.extension
|
|
7542
7604
|
}) : null]
|
|
7543
7605
|
}),
|
|
@@ -7566,7 +7628,7 @@ function ConversationFilesSheet({ messages, locale, className, open, onOpenChang
|
|
|
7566
7628
|
children: [showTrigger ? /* @__PURE__ */ jsxs(SheetTrigger, {
|
|
7567
7629
|
"aria-label": `${copy.conversationFiles}: ${count$1}`,
|
|
7568
7630
|
title: copy.conversationFiles,
|
|
7569
|
-
className: joinClasses("inline-flex h-8 items-center gap-1.5 rounded-md border border-
|
|
7631
|
+
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),
|
|
7570
7632
|
children: [/* @__PURE__ */ jsx(Paperclip$1, {
|
|
7571
7633
|
className: "h-4 w-4",
|
|
7572
7634
|
"aria-hidden": "true"
|