@athenaintel/react 0.11.0 → 0.11.2
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/README.md +150 -3
- package/dist/index.cjs +257 -56
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +257 -56
- package/dist/index.js.map +1 -1
- package/dist/provider/AthenaProvider.d.ts +1 -1
- package/dist/styles.css +2 -150
- package/dist/tools/tool-uis.d.ts +18 -0
- package/package.json +8 -4
package/dist/index.cjs
CHANGED
|
@@ -72,7 +72,7 @@ function _interopNamespaceDefault(e) {
|
|
|
72
72
|
}
|
|
73
73
|
const React__namespace = /* @__PURE__ */ _interopNamespaceDefault(React);
|
|
74
74
|
const ReactDOM__namespace = /* @__PURE__ */ _interopNamespaceDefault(ReactDOM);
|
|
75
|
-
const version$1 = "0.11.
|
|
75
|
+
const version$1 = "0.11.2";
|
|
76
76
|
const packageJson = {
|
|
77
77
|
version: version$1
|
|
78
78
|
};
|
|
@@ -12070,6 +12070,9 @@ function useDeepAgentThread({
|
|
|
12070
12070
|
return statewireTransport(
|
|
12071
12071
|
{
|
|
12072
12072
|
url: `${baseUrl.replace(/\/+$/, "")}/${encodeURIComponent(threadId)}`,
|
|
12073
|
+
// A never-started chat has no server session yet: the transport
|
|
12074
|
+
// makes no network calls until the first command send.
|
|
12075
|
+
...preloadRef.current.preload && { isNew: true },
|
|
12073
12076
|
headers: (ctx) => headersRef.current(ctx),
|
|
12074
12077
|
...sessionStore && { sessionStore }
|
|
12075
12078
|
},
|
|
@@ -16559,6 +16562,9 @@ function TooltipContent({
|
|
|
16559
16562
|
"data-slot": "tooltip-content",
|
|
16560
16563
|
sideOffset,
|
|
16561
16564
|
className: cn(
|
|
16565
|
+
// Portaled outside the provider wrapper — carries the SDK scope
|
|
16566
|
+
// classes itself so tokens and the scoped reset still apply.
|
|
16567
|
+
"athena-sdk athena-sdk-chrome",
|
|
16562
16568
|
"bg-foreground text-background animate-in fade-in-0 zoom-in-95 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 z-50 w-fit origin-(--radix-tooltip-content-transform-origin) rounded-md px-3 py-1.5 text-xs text-balance",
|
|
16563
16569
|
className
|
|
16564
16570
|
),
|
|
@@ -21018,10 +21024,14 @@ function AthenaProvider({
|
|
|
21018
21024
|
);
|
|
21019
21025
|
}
|
|
21020
21026
|
let result = /* @__PURE__ */ jsxRuntime.jsx(PostHogProvider, { config: posthogConfig, children: inner });
|
|
21021
|
-
|
|
21022
|
-
|
|
21023
|
-
|
|
21024
|
-
|
|
21027
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
21028
|
+
"div",
|
|
21029
|
+
{
|
|
21030
|
+
className: themeStyleVars ? "athena-sdk athena-themed" : "athena-sdk",
|
|
21031
|
+
style: themeStyleVars,
|
|
21032
|
+
children: result
|
|
21033
|
+
}
|
|
21034
|
+
);
|
|
21025
21035
|
}
|
|
21026
21036
|
function OrderedMap(content) {
|
|
21027
21037
|
this.content = content;
|
|
@@ -55471,7 +55481,7 @@ const MentionSuggestionPopup = React.forwardRef(({ store: store2, query, command
|
|
|
55471
55481
|
{
|
|
55472
55482
|
ref: refs.setFloating,
|
|
55473
55483
|
style: floatingStyles,
|
|
55474
|
-
className: "z-[9999]",
|
|
55484
|
+
className: "athena-sdk athena-sdk-chrome z-[9999]",
|
|
55475
55485
|
onMouseDown: (e) => e.preventDefault(),
|
|
55476
55486
|
children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
55477
55487
|
MentionSuggestionList,
|
|
@@ -56038,13 +56048,13 @@ const TiptapComposer = ({ tools = [], rootCategories }) => {
|
|
|
56038
56048
|
});
|
|
56039
56049
|
if (fullMessage) {
|
|
56040
56050
|
aui.composer.setText(fullMessage);
|
|
56041
|
-
aui.composer.send();
|
|
56051
|
+
aui.composer.send({ steer: false });
|
|
56042
56052
|
clearAttachments();
|
|
56043
56053
|
clearQuote();
|
|
56044
56054
|
}
|
|
56045
56055
|
} else {
|
|
56046
56056
|
aui.composer.setText(markdown);
|
|
56047
|
-
aui.composer.send();
|
|
56057
|
+
aui.composer.send({ steer: false });
|
|
56048
56058
|
}
|
|
56049
56059
|
editor2.commands.clearContent();
|
|
56050
56060
|
}, [aui, clearAttachments, clearQuote, appUrl]);
|
|
@@ -56681,6 +56691,10 @@ const TOOL_META = {
|
|
|
56681
56691
|
// Presentations
|
|
56682
56692
|
create_powerpoint_deck: { displayName: "Building presentation", icon: Monitor },
|
|
56683
56693
|
execute_presentation_code: { displayName: "Generating slides", icon: Monitor },
|
|
56694
|
+
execute_word_document_code: { displayName: "Editing Word document", icon: FileText },
|
|
56695
|
+
execute_spreadsheet_code: { displayName: "Editing spreadsheet", icon: ChartColumn },
|
|
56696
|
+
execute_spreadsheet_commands: { displayName: "Editing spreadsheet", icon: ChartColumn },
|
|
56697
|
+
unified_email_list_accounts: { displayName: "Checking email accounts", icon: Mail },
|
|
56684
56698
|
// Code & Data
|
|
56685
56699
|
run_python_code: { displayName: "Running analysis", icon: Code },
|
|
56686
56700
|
run_sql_query_tool: { displayName: "Running SQL query", icon: Database, describer: (a) => a.sql_query ?? a.query ?? a.sql ? `"${truncateLine(a.sql_query ?? a.query ?? a.sql)}"` : "" },
|
|
@@ -56728,14 +56742,14 @@ function extractResultMessage(result) {
|
|
|
56728
56742
|
return null;
|
|
56729
56743
|
}
|
|
56730
56744
|
function isResultSuccess(result) {
|
|
56731
|
-
|
|
56732
|
-
|
|
56733
|
-
if (
|
|
56734
|
-
|
|
56735
|
-
|
|
56736
|
-
return result.success === true;
|
|
56745
|
+
const obj = typeof result === "string" ? tryParseJson$1(result) : typeof result === "object" && result !== null ? result : null;
|
|
56746
|
+
if (obj) {
|
|
56747
|
+
if (obj.success === false || obj.ok === false) return false;
|
|
56748
|
+
if (typeof obj.error === "string" && obj.error.length > 0) return false;
|
|
56749
|
+
return true;
|
|
56737
56750
|
}
|
|
56738
|
-
return
|
|
56751
|
+
if (typeof result === "string") return !/^\s*error\b/i.test(result);
|
|
56752
|
+
return true;
|
|
56739
56753
|
}
|
|
56740
56754
|
function extractAssetId$1(result) {
|
|
56741
56755
|
if (!result) return null;
|
|
@@ -56900,7 +56914,7 @@ function ToolFallbackTrigger({
|
|
|
56900
56914
|
"span",
|
|
56901
56915
|
{
|
|
56902
56916
|
className: cn(
|
|
56903
|
-
"relative inline-block leading-tight",
|
|
56917
|
+
"relative inline-block text-[13px] font-medium leading-tight",
|
|
56904
56918
|
isCancelled && "text-muted-foreground line-through"
|
|
56905
56919
|
),
|
|
56906
56920
|
children: [
|
|
@@ -57885,17 +57899,103 @@ BrowseToolUI.displayName = "BrowseToolUI";
|
|
|
57885
57899
|
function parseEmailResults(data) {
|
|
57886
57900
|
const results = data.limited_results ?? data.results ?? data.emails ?? data.messages;
|
|
57887
57901
|
if (!Array.isArray(results)) return [];
|
|
57888
|
-
return results.slice(0,
|
|
57889
|
-
const item = r2;
|
|
57890
|
-
return
|
|
57891
|
-
|
|
57892
|
-
|
|
57893
|
-
|
|
57894
|
-
|
|
57895
|
-
|
|
57896
|
-
|
|
57902
|
+
return results.slice(0, 50).flatMap((r2) => {
|
|
57903
|
+
const item = asRecord(r2);
|
|
57904
|
+
if (!item) return [];
|
|
57905
|
+
return [
|
|
57906
|
+
{
|
|
57907
|
+
subject: asString(item.subject) ?? asString(item.title),
|
|
57908
|
+
from: asString(item.from) ?? asString(item.sender) ?? asString(item.from_email),
|
|
57909
|
+
date: asString(item.date) ?? asString(item.received_at) ?? asString(item.sent_at),
|
|
57910
|
+
snippet: asString(item.snippet) ?? asString(item.preview) ?? asString(item.body_preview),
|
|
57911
|
+
isDraft: item.is_draft === true
|
|
57912
|
+
}
|
|
57913
|
+
];
|
|
57897
57914
|
});
|
|
57898
57915
|
}
|
|
57916
|
+
function formatEmailDate(raw) {
|
|
57917
|
+
if (!raw) return void 0;
|
|
57918
|
+
const dateOnly = /^(\d{4})-(\d{2})-(\d{2})$/.exec(raw.trim());
|
|
57919
|
+
const date2 = dateOnly ? new Date(Number(dateOnly[1]), Number(dateOnly[2]) - 1, Number(dateOnly[3])) : new Date(raw);
|
|
57920
|
+
if (Number.isNaN(date2.getTime())) return raw;
|
|
57921
|
+
const now = /* @__PURE__ */ new Date();
|
|
57922
|
+
if (!dateOnly && date2.toDateString() === now.toDateString()) {
|
|
57923
|
+
return date2.toLocaleTimeString(void 0, {
|
|
57924
|
+
hour: "numeric",
|
|
57925
|
+
minute: "2-digit"
|
|
57926
|
+
});
|
|
57927
|
+
}
|
|
57928
|
+
const sameYear = date2.getFullYear() === now.getFullYear();
|
|
57929
|
+
return date2.toLocaleDateString(void 0, {
|
|
57930
|
+
month: "short",
|
|
57931
|
+
day: "numeric",
|
|
57932
|
+
...sameYear ? {} : { year: "numeric" }
|
|
57933
|
+
});
|
|
57934
|
+
}
|
|
57935
|
+
const EMAIL_QUERY_OPERATOR = /(?:^|\s)(received|after|before|from|to|subject|has|in|is):(?:"([^"]+)"|(\S+))/gi;
|
|
57936
|
+
function humanEmailDate(raw) {
|
|
57937
|
+
return formatEmailDate(raw.replace(/\//g, "-")) ?? raw;
|
|
57938
|
+
}
|
|
57939
|
+
function humanizeEmailQuery(query) {
|
|
57940
|
+
if (!query.trim()) return "";
|
|
57941
|
+
const phrases = [];
|
|
57942
|
+
let freeText = query;
|
|
57943
|
+
for (const match2 of query.matchAll(EMAIL_QUERY_OPERATOR)) {
|
|
57944
|
+
const [token, op, quoted, bare] = match2;
|
|
57945
|
+
const value = quoted ?? bare ?? "";
|
|
57946
|
+
freeText = freeText.replace(token, " ");
|
|
57947
|
+
switch (op.toLowerCase()) {
|
|
57948
|
+
case "received": {
|
|
57949
|
+
const [start, end] = value.split("..");
|
|
57950
|
+
phrases.push(
|
|
57951
|
+
end ? `${humanEmailDate(start)} – ${humanEmailDate(end)}` : humanEmailDate(start)
|
|
57952
|
+
);
|
|
57953
|
+
break;
|
|
57954
|
+
}
|
|
57955
|
+
case "after":
|
|
57956
|
+
phrases.push(`after ${humanEmailDate(value)}`);
|
|
57957
|
+
break;
|
|
57958
|
+
case "before":
|
|
57959
|
+
phrases.push(`before ${humanEmailDate(value)}`);
|
|
57960
|
+
break;
|
|
57961
|
+
case "from":
|
|
57962
|
+
phrases.push(`from ${value}`);
|
|
57963
|
+
break;
|
|
57964
|
+
case "to":
|
|
57965
|
+
phrases.push(`to ${value}`);
|
|
57966
|
+
break;
|
|
57967
|
+
case "subject":
|
|
57968
|
+
phrases.push(`subject “${value}”`);
|
|
57969
|
+
break;
|
|
57970
|
+
case "has":
|
|
57971
|
+
phrases.push(value === "attachment" ? "with attachments" : `has ${value}`);
|
|
57972
|
+
break;
|
|
57973
|
+
case "in":
|
|
57974
|
+
phrases.push(value === "drafts" ? "drafts only" : `in ${value}`);
|
|
57975
|
+
break;
|
|
57976
|
+
case "is":
|
|
57977
|
+
phrases.push(value);
|
|
57978
|
+
break;
|
|
57979
|
+
}
|
|
57980
|
+
}
|
|
57981
|
+
const remainder = freeText.trim().replace(/\s+/g, " ");
|
|
57982
|
+
if (remainder) phrases.push(`“${remainder}”`);
|
|
57983
|
+
return phrases.join(" · ");
|
|
57984
|
+
}
|
|
57985
|
+
const INLINE_EMAIL_ROWS = 3;
|
|
57986
|
+
function EmailResultRow({ email: email2 }) {
|
|
57987
|
+
return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex flex-col gap-0.5 py-2 first:pt-0 last:pb-0", children: [
|
|
57988
|
+
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-baseline justify-between gap-2", children: [
|
|
57989
|
+
/* @__PURE__ */ jsxRuntime.jsxs("span", { className: "flex min-w-0 items-baseline gap-1.5 text-[12px] font-medium text-foreground", children: [
|
|
57990
|
+
email2.isDraft && /* @__PURE__ */ jsxRuntime.jsx("span", { className: "shrink-0 rounded bg-amber-100 px-1 py-px text-[9px] font-semibold uppercase tracking-wide text-amber-700", children: "Draft" }),
|
|
57991
|
+
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "truncate", children: email2.subject || "No subject" })
|
|
57992
|
+
] }),
|
|
57993
|
+
email2.date && /* @__PURE__ */ jsxRuntime.jsx("span", { className: "shrink-0 text-[10px] text-muted-foreground", children: formatEmailDate(email2.date) })
|
|
57994
|
+
] }),
|
|
57995
|
+
email2.from && /* @__PURE__ */ jsxRuntime.jsx("span", { className: "truncate text-[11px] text-muted-foreground", children: email2.from }),
|
|
57996
|
+
email2.snippet && /* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-[11px] leading-relaxed text-muted-foreground/80", children: truncate(email2.snippet, 150) })
|
|
57997
|
+
] });
|
|
57998
|
+
}
|
|
57899
57999
|
const EmailSearchToolUIImpl = ({
|
|
57900
58000
|
toolName,
|
|
57901
58001
|
args,
|
|
@@ -57906,35 +58006,96 @@ const EmailSearchToolUIImpl = ({
|
|
|
57906
58006
|
const query = (typedArgs == null ? void 0 : typedArgs.query) ?? (typedArgs == null ? void 0 : typedArgs.search_query) ?? "";
|
|
57907
58007
|
const data = React.useMemo(() => normalizeResult(result), [result]);
|
|
57908
58008
|
const emails = React.useMemo(() => data ? parseEmailResults(data) : [], [data]);
|
|
58009
|
+
const provider = typeof (data == null ? void 0 : data.provider) === "string" ? data.provider : void 0;
|
|
58010
|
+
const totalCount = typeof (data == null ? void 0 : data.count) === "number" ? data.count : emails.length;
|
|
57909
58011
|
const isRunning = (status == null ? void 0 : status.type) === "running";
|
|
57910
58012
|
const isComplete = (status == null ? void 0 : status.type) === "complete";
|
|
57911
58013
|
const errorMsg = (status == null ? void 0 : status.type) === "incomplete" ? status.error : null;
|
|
58014
|
+
const readableQuery = React.useMemo(() => humanizeEmailQuery(query), [query]);
|
|
58015
|
+
const inlineEmails = emails.slice(0, INLINE_EMAIL_ROWS);
|
|
58016
|
+
const overflowEmails = emails.slice(INLINE_EMAIL_ROWS);
|
|
58017
|
+
const countLabel = emails.length > 0 && totalCount > emails.length ? `${emails.length} of ${totalCount}` : `${totalCount}`;
|
|
57912
58018
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
57913
58019
|
ToolCard,
|
|
57914
58020
|
{
|
|
57915
58021
|
icon: Mail,
|
|
57916
58022
|
status: (status == null ? void 0 : status.type) ?? "complete",
|
|
57917
|
-
title: isRunning ? "Searching
|
|
57918
|
-
subtitle:
|
|
58023
|
+
title: isRunning ? "Searching email…" : "Email search",
|
|
58024
|
+
subtitle: readableQuery ? truncate(readableQuery, 90) : void 0,
|
|
57919
58025
|
toolName,
|
|
57920
58026
|
args: typedArgs,
|
|
57921
58027
|
result,
|
|
57922
|
-
badge: isComplete
|
|
58028
|
+
badge: isComplete ? totalCount > 0 ? `${countLabel} email${totalCount === 1 ? "" : "s"}${provider ? ` · ${provider}` : ""}` : "No matches" : void 0,
|
|
58029
|
+
error: errorMsg,
|
|
58030
|
+
children: isComplete && emails.length > 0 && /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "border-t border-border/40 px-4 py-2.5", children: [
|
|
58031
|
+
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex flex-col divide-y divide-border/30", children: inlineEmails.map((email2, i) => /* @__PURE__ */ jsxRuntime.jsx(EmailResultRow, { email: email2 }, i)) }),
|
|
58032
|
+
overflowEmails.length > 0 && /* @__PURE__ */ jsxRuntime.jsx(
|
|
58033
|
+
ExpandableSection,
|
|
58034
|
+
{
|
|
58035
|
+
label: `Show ${overflowEmails.length} more`,
|
|
58036
|
+
children: /* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex flex-col divide-y divide-border/30", children: overflowEmails.map((email2, i) => /* @__PURE__ */ jsxRuntime.jsx(EmailResultRow, { email: email2 }, i)) })
|
|
58037
|
+
}
|
|
58038
|
+
)
|
|
58039
|
+
] })
|
|
58040
|
+
}
|
|
58041
|
+
);
|
|
58042
|
+
};
|
|
58043
|
+
const EmailSearchToolUI = React.memo(
|
|
58044
|
+
EmailSearchToolUIImpl
|
|
58045
|
+
);
|
|
58046
|
+
EmailSearchToolUI.displayName = "EmailSearchToolUI";
|
|
58047
|
+
function parseEmailAccounts(data) {
|
|
58048
|
+
const accounts = data.accounts ?? data.results;
|
|
58049
|
+
if (!Array.isArray(accounts)) return [];
|
|
58050
|
+
return accounts.slice(0, 10).flatMap((raw) => {
|
|
58051
|
+
const item = asRecord(raw);
|
|
58052
|
+
if (!item) return [];
|
|
58053
|
+
const defaultFlag = typeof item.is_default === "boolean" ? item.is_default : item.default;
|
|
58054
|
+
return [
|
|
58055
|
+
{
|
|
58056
|
+
address: asString(item.email_address) ?? asString(item.email) ?? asString(item.address),
|
|
58057
|
+
provider: asString(item.provider) ?? asString(item.provider_name),
|
|
58058
|
+
name: asString(item.account_name) ?? asString(item.name),
|
|
58059
|
+
isDefault: defaultFlag === true
|
|
58060
|
+
}
|
|
58061
|
+
];
|
|
58062
|
+
});
|
|
58063
|
+
}
|
|
58064
|
+
const EmailAccountsToolUIImpl = ({
|
|
58065
|
+
toolName,
|
|
58066
|
+
args,
|
|
58067
|
+
result,
|
|
58068
|
+
status
|
|
58069
|
+
}) => {
|
|
58070
|
+
const data = React.useMemo(() => normalizeResult(result), [result]);
|
|
58071
|
+
const accounts = React.useMemo(
|
|
58072
|
+
() => data ? parseEmailAccounts(data) : [],
|
|
58073
|
+
[data]
|
|
58074
|
+
);
|
|
58075
|
+
const isRunning = (status == null ? void 0 : status.type) === "running";
|
|
58076
|
+
const isComplete = (status == null ? void 0 : status.type) === "complete";
|
|
58077
|
+
const errorMsg = (status == null ? void 0 : status.type) === "incomplete" ? status.error : null;
|
|
58078
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
58079
|
+
ToolCard,
|
|
58080
|
+
{
|
|
58081
|
+
icon: Mail,
|
|
58082
|
+
status: (status == null ? void 0 : status.type) ?? "complete",
|
|
58083
|
+
title: isRunning ? "Checking connected email accounts…" : "Email accounts",
|
|
58084
|
+
toolName,
|
|
58085
|
+
args,
|
|
58086
|
+
result,
|
|
58087
|
+
badge: isComplete && accounts.length > 0 ? `${accounts.length} connected` : void 0,
|
|
57923
58088
|
error: errorMsg,
|
|
57924
|
-
children: isComplete &&
|
|
58089
|
+
children: isComplete && accounts.length > 0 && /* @__PURE__ */ jsxRuntime.jsx("div", { className: "border-t border-border/40 px-4 py-2.5", children: /* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex flex-col divide-y divide-border/30", children: accounts.map((account, i) => /* @__PURE__ */ jsxRuntime.jsxs(
|
|
57925
58090
|
"div",
|
|
57926
58091
|
{
|
|
57927
|
-
className:
|
|
58092
|
+
className: "flex items-center justify-between gap-2 py-1.5 first:pt-0 last:pb-0",
|
|
57928
58093
|
children: [
|
|
57929
|
-
/* @__PURE__ */ jsxRuntime.
|
|
57930
|
-
|
|
57931
|
-
|
|
57932
|
-
|
|
57933
|
-
|
|
57934
|
-
email2.date && /* @__PURE__ */ jsxRuntime.jsx("span", { className: "shrink-0 text-[10px] text-muted-foreground", children: email2.date })
|
|
57935
|
-
] }),
|
|
57936
|
-
email2.from && /* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-[11px] text-muted-foreground", children: email2.from }),
|
|
57937
|
-
email2.snippet && /* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-[11px] leading-relaxed text-muted-foreground/80", children: truncate(email2.snippet, 150) })
|
|
58094
|
+
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "min-w-0 truncate text-[12px] text-foreground", children: account.address || account.name || "Unknown account" }),
|
|
58095
|
+
/* @__PURE__ */ jsxRuntime.jsxs("span", { className: "flex shrink-0 items-center gap-1.5", children: [
|
|
58096
|
+
account.isDefault && /* @__PURE__ */ jsxRuntime.jsx("span", { className: "rounded-full bg-emerald-50 px-1.5 py-px text-[9px] font-semibold uppercase tracking-wide text-emerald-700", children: "Default" }),
|
|
58097
|
+
account.provider && /* @__PURE__ */ jsxRuntime.jsx("span", { className: "rounded-md bg-muted/60 px-1.5 py-0.5 text-[10px] text-muted-foreground", children: account.provider })
|
|
58098
|
+
] })
|
|
57938
58099
|
]
|
|
57939
58100
|
},
|
|
57940
58101
|
i
|
|
@@ -57942,10 +58103,10 @@ const EmailSearchToolUIImpl = ({
|
|
|
57942
58103
|
}
|
|
57943
58104
|
);
|
|
57944
58105
|
};
|
|
57945
|
-
const
|
|
57946
|
-
|
|
58106
|
+
const EmailAccountsToolUI = React.memo(
|
|
58107
|
+
EmailAccountsToolUIImpl
|
|
57947
58108
|
);
|
|
57948
|
-
|
|
58109
|
+
EmailAccountsToolUI.displayName = "EmailAccountsToolUI";
|
|
57949
58110
|
function extractAssetId(result) {
|
|
57950
58111
|
const data = normalizeResult(result);
|
|
57951
58112
|
if (!data) return null;
|
|
@@ -57982,6 +58143,9 @@ function asRecord(value) {
|
|
|
57982
58143
|
}
|
|
57983
58144
|
return value;
|
|
57984
58145
|
}
|
|
58146
|
+
function asString(value) {
|
|
58147
|
+
return typeof value === "string" ? value : void 0;
|
|
58148
|
+
}
|
|
57985
58149
|
const PRESENTATION_CODE_SLIDE_NUMBER_KEYS = [
|
|
57986
58150
|
"slideNumber",
|
|
57987
58151
|
"slide_number",
|
|
@@ -58078,22 +58242,51 @@ function CreateAssetToolUIImpl({
|
|
|
58078
58242
|
args: typedArgs,
|
|
58079
58243
|
result,
|
|
58080
58244
|
error: errorMsg,
|
|
58081
|
-
children: assetId && isComplete && !isCancelled && /* @__PURE__ */ jsxRuntime.jsx("div", { className: "border-t border-border/40 px-4 py-2", children: /* @__PURE__ */ jsxRuntime.jsxs(
|
|
58245
|
+
children: assetId && isComplete && !isCancelled && /* @__PURE__ */ jsxRuntime.jsx("div", { className: "border-t border-border/40 px-4 py-2.5", children: /* @__PURE__ */ jsxRuntime.jsxs(
|
|
58082
58246
|
"button",
|
|
58083
58247
|
{
|
|
58084
58248
|
type: "button",
|
|
58085
58249
|
onClick: handleOpen,
|
|
58086
|
-
className: "flex items-center gap-
|
|
58250
|
+
className: "group flex w-full items-center gap-3 rounded-lg border border-border/60 bg-muted/20 px-3 py-2.5 text-left transition-colors hover:border-border hover:bg-muted/40",
|
|
58087
58251
|
children: [
|
|
58088
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
58089
|
-
|
|
58090
|
-
|
|
58252
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
58253
|
+
"div",
|
|
58254
|
+
{
|
|
58255
|
+
className: cn(
|
|
58256
|
+
"flex size-10 shrink-0 items-center justify-center rounded-lg",
|
|
58257
|
+
ASSET_TILE_STYLE[assetType] ?? ASSET_TILE_STYLE.unknown
|
|
58258
|
+
),
|
|
58259
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(Icon2, { className: "size-5" })
|
|
58260
|
+
}
|
|
58261
|
+
),
|
|
58262
|
+
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "min-w-0 flex-1", children: [
|
|
58263
|
+
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "truncate text-[13px] font-medium text-foreground", children: createdName || name || "Untitled" }),
|
|
58264
|
+
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "text-[11px] text-muted-foreground", children: [
|
|
58265
|
+
ASSET_TILE_LABEL[assetType] ?? "Asset",
|
|
58266
|
+
" · Click to open"
|
|
58267
|
+
] })
|
|
58268
|
+
] }),
|
|
58269
|
+
/* @__PURE__ */ jsxRuntime.jsx(ExternalLink, { className: "size-3.5 shrink-0 text-muted-foreground opacity-0 transition-opacity group-hover:opacity-100" })
|
|
58091
58270
|
]
|
|
58092
58271
|
}
|
|
58093
58272
|
) })
|
|
58094
58273
|
}
|
|
58095
58274
|
);
|
|
58096
58275
|
}
|
|
58276
|
+
const ASSET_TILE_STYLE = {
|
|
58277
|
+
document: "bg-blue-500/10 text-blue-600",
|
|
58278
|
+
spreadsheet: "bg-emerald-500/10 text-emerald-600",
|
|
58279
|
+
presentation: "bg-orange-500/10 text-orange-600",
|
|
58280
|
+
notebook: "bg-violet-500/10 text-violet-600",
|
|
58281
|
+
unknown: "bg-muted text-muted-foreground"
|
|
58282
|
+
};
|
|
58283
|
+
const ASSET_TILE_LABEL = {
|
|
58284
|
+
document: "Document",
|
|
58285
|
+
spreadsheet: "Spreadsheet",
|
|
58286
|
+
presentation: "Presentation",
|
|
58287
|
+
notebook: "Notebook",
|
|
58288
|
+
unknown: "Asset"
|
|
58289
|
+
};
|
|
58097
58290
|
const CreateDocumentToolUIImpl = (props) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
58098
58291
|
CreateAssetToolUIImpl,
|
|
58099
58292
|
{
|
|
@@ -60516,6 +60709,8 @@ const TOOL_UI_REGISTRY = {
|
|
|
60516
60709
|
open_browser: OpenBrowserToolUI,
|
|
60517
60710
|
search_email: EmailSearchToolUI,
|
|
60518
60711
|
unified_email_search: EmailSearchToolUI,
|
|
60712
|
+
unified_email_list_accounts: EmailAccountsToolUI,
|
|
60713
|
+
email_list_accounts: EmailAccountsToolUI,
|
|
60519
60714
|
create_email_draft: CreateEmailDraftToolUI,
|
|
60520
60715
|
unified_email_create_draft: CreateEmailDraftToolUI,
|
|
60521
60716
|
create_new_document: CreateDocumentToolUI,
|
|
@@ -61274,7 +61469,7 @@ function useSendMessage() {
|
|
|
61274
61469
|
shouldReplace || !currentText ? text2 : `${currentText}
|
|
61275
61470
|
${text2}`
|
|
61276
61471
|
);
|
|
61277
|
-
await aui.composer.send();
|
|
61472
|
+
await aui.composer.send({ steer: false });
|
|
61278
61473
|
},
|
|
61279
61474
|
[aui]
|
|
61280
61475
|
);
|
|
@@ -61874,13 +62069,13 @@ const ComposerSendWithQuote = () => {
|
|
|
61874
62069
|
});
|
|
61875
62070
|
if (!fullMessage) return;
|
|
61876
62071
|
aui.composer.setText(fullMessage);
|
|
61877
|
-
aui.composer.send();
|
|
62072
|
+
aui.composer.send({ steer: false });
|
|
61878
62073
|
clearQuote();
|
|
61879
62074
|
clearAttachments();
|
|
61880
62075
|
} else {
|
|
61881
62076
|
if (!userText) return;
|
|
61882
62077
|
aui.composer.setText(userText);
|
|
61883
|
-
aui.composer.send();
|
|
62078
|
+
aui.composer.send({ steer: false });
|
|
61884
62079
|
}
|
|
61885
62080
|
editor == null ? void 0 : editor.clear();
|
|
61886
62081
|
}, [aui, quote, attachments, hasExtras, isUploading, isThreadRunning, clearQuote, clearAttachments, editorRef, appUrl]);
|
|
@@ -62593,7 +62788,7 @@ const AthenaAssetEmbed = ({
|
|
|
62593
62788
|
if (error2) onError == null ? void 0 : onError(new Error(error2));
|
|
62594
62789
|
}, [error2, onError]);
|
|
62595
62790
|
if (isLoading) {
|
|
62596
|
-
return loadingFallback ?? /* @__PURE__ */ jsxRuntime.jsxs("output", { className: "flex h-full w-full items-center justify-center", children: [
|
|
62791
|
+
return loadingFallback ?? /* @__PURE__ */ jsxRuntime.jsxs("output", { className: "athena-sdk-chrome flex h-full w-full items-center justify-center", children: [
|
|
62597
62792
|
/* @__PURE__ */ jsxRuntime.jsx(LoaderCircle, { className: "size-6 animate-spin text-muted-foreground" }),
|
|
62598
62793
|
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "sr-only", children: "Loading asset" })
|
|
62599
62794
|
] });
|
|
@@ -62604,7 +62799,7 @@ const AthenaAssetEmbed = ({
|
|
|
62604
62799
|
return errorFallback ?? /* @__PURE__ */ jsxRuntime.jsxs(
|
|
62605
62800
|
"div",
|
|
62606
62801
|
{
|
|
62607
|
-
className: "flex h-full w-full items-center justify-center gap-2 p-4 text-sm text-muted-foreground",
|
|
62802
|
+
className: "athena-sdk-chrome flex h-full w-full items-center justify-center gap-2 p-4 text-sm text-muted-foreground",
|
|
62608
62803
|
role: "alert",
|
|
62609
62804
|
children: [
|
|
62610
62805
|
/* @__PURE__ */ jsxRuntime.jsx(CircleAlert, { className: "size-4 text-destructive" }),
|
|
@@ -62977,21 +63172,27 @@ const AthenaLayout = ({
|
|
|
62977
63172
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
62978
63173
|
"div",
|
|
62979
63174
|
{
|
|
62980
|
-
className: "flex h-full w-1 shrink-0 cursor-col-resize items-center bg-border/40 transition-colors hover:bg-border active:bg-primary/30",
|
|
63175
|
+
className: "athena-sdk-chrome flex h-full w-1 shrink-0 cursor-col-resize items-center bg-border/40 transition-colors hover:bg-border active:bg-primary/30",
|
|
62981
63176
|
onPointerDown,
|
|
62982
63177
|
onPointerMove,
|
|
62983
63178
|
onPointerUp
|
|
62984
63179
|
}
|
|
62985
63180
|
),
|
|
62986
|
-
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex h-full flex-1 flex-col overflow-hidden", children: /* @__PURE__ */ jsxRuntime.jsx(AssetPanel, { manageAssetPanelHostRegistration: false }) })
|
|
63181
|
+
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "athena-sdk-chrome flex h-full flex-1 flex-col overflow-hidden", children: /* @__PURE__ */ jsxRuntime.jsx(AssetPanel, { manageAssetPanelHostRegistration: false }) })
|
|
62987
63182
|
] });
|
|
62988
63183
|
};
|
|
62989
63184
|
function ThreadList({ className }) {
|
|
62990
63185
|
const statewireList = useAthenaStatewireThreadList();
|
|
62991
63186
|
if (statewireList) {
|
|
62992
|
-
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
63187
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
63188
|
+
StatewireThreadList,
|
|
63189
|
+
{
|
|
63190
|
+
list: statewireList,
|
|
63191
|
+
className: cn("athena-sdk-chrome", className)
|
|
63192
|
+
}
|
|
63193
|
+
);
|
|
62993
63194
|
}
|
|
62994
|
-
return /* @__PURE__ */ jsxRuntime.jsx(LegacyThreadList, { className });
|
|
63195
|
+
return /* @__PURE__ */ jsxRuntime.jsx(LegacyThreadList, { className: cn("athena-sdk-chrome", className) });
|
|
62995
63196
|
}
|
|
62996
63197
|
function LegacyThreadList({ className }) {
|
|
62997
63198
|
const refresh = useRefreshThreadList();
|