@athenaintel/react 0.10.30 → 0.10.31
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/index.cjs +558 -87
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +558 -87
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -45016,51 +45016,51 @@ const createLucideIcon = (iconName, iconNode) => {
|
|
|
45016
45016
|
* This source code is licensed under the ISC license.
|
|
45017
45017
|
* See the LICENSE file in the root directory of this source tree.
|
|
45018
45018
|
*/
|
|
45019
|
-
const __iconNode$
|
|
45019
|
+
const __iconNode$19 = [
|
|
45020
45020
|
["path", { d: "M12 5v14", key: "s699le" }],
|
|
45021
45021
|
["path", { d: "m19 12-7 7-7-7", key: "1idqje" }]
|
|
45022
45022
|
];
|
|
45023
|
-
const ArrowDown = createLucideIcon("arrow-down", __iconNode$
|
|
45023
|
+
const ArrowDown = createLucideIcon("arrow-down", __iconNode$19);
|
|
45024
45024
|
/**
|
|
45025
45025
|
* @license lucide-react v0.575.0 - ISC
|
|
45026
45026
|
*
|
|
45027
45027
|
* This source code is licensed under the ISC license.
|
|
45028
45028
|
* See the LICENSE file in the root directory of this source tree.
|
|
45029
45029
|
*/
|
|
45030
|
-
const __iconNode$
|
|
45030
|
+
const __iconNode$18 = [
|
|
45031
45031
|
["path", { d: "m12 19-7-7 7-7", key: "1l729n" }],
|
|
45032
45032
|
["path", { d: "M19 12H5", key: "x3x0zl" }]
|
|
45033
45033
|
];
|
|
45034
|
-
const ArrowLeft = createLucideIcon("arrow-left", __iconNode$
|
|
45034
|
+
const ArrowLeft = createLucideIcon("arrow-left", __iconNode$18);
|
|
45035
45035
|
/**
|
|
45036
45036
|
* @license lucide-react v0.575.0 - ISC
|
|
45037
45037
|
*
|
|
45038
45038
|
* This source code is licensed under the ISC license.
|
|
45039
45039
|
* See the LICENSE file in the root directory of this source tree.
|
|
45040
45040
|
*/
|
|
45041
|
-
const __iconNode$
|
|
45041
|
+
const __iconNode$17 = [
|
|
45042
45042
|
["path", { d: "M5 12h14", key: "1ays0h" }],
|
|
45043
45043
|
["path", { d: "m12 5 7 7-7 7", key: "xquz4c" }]
|
|
45044
45044
|
];
|
|
45045
|
-
const ArrowRight = createLucideIcon("arrow-right", __iconNode$
|
|
45045
|
+
const ArrowRight = createLucideIcon("arrow-right", __iconNode$17);
|
|
45046
45046
|
/**
|
|
45047
45047
|
* @license lucide-react v0.575.0 - ISC
|
|
45048
45048
|
*
|
|
45049
45049
|
* This source code is licensed under the ISC license.
|
|
45050
45050
|
* See the LICENSE file in the root directory of this source tree.
|
|
45051
45051
|
*/
|
|
45052
|
-
const __iconNode$
|
|
45052
|
+
const __iconNode$16 = [
|
|
45053
45053
|
["path", { d: "m5 12 7-7 7 7", key: "hav0vg" }],
|
|
45054
45054
|
["path", { d: "M12 19V5", key: "x0mq9r" }]
|
|
45055
45055
|
];
|
|
45056
|
-
const ArrowUp = createLucideIcon("arrow-up", __iconNode$
|
|
45056
|
+
const ArrowUp = createLucideIcon("arrow-up", __iconNode$16);
|
|
45057
45057
|
/**
|
|
45058
45058
|
* @license lucide-react v0.575.0 - ISC
|
|
45059
45059
|
*
|
|
45060
45060
|
* This source code is licensed under the ISC license.
|
|
45061
45061
|
* See the LICENSE file in the root directory of this source tree.
|
|
45062
45062
|
*/
|
|
45063
|
-
const __iconNode$
|
|
45063
|
+
const __iconNode$15 = [
|
|
45064
45064
|
["path", { d: "M12 7v14", key: "1akyts" }],
|
|
45065
45065
|
[
|
|
45066
45066
|
"path",
|
|
@@ -45070,14 +45070,14 @@ const __iconNode$14 = [
|
|
|
45070
45070
|
}
|
|
45071
45071
|
]
|
|
45072
45072
|
];
|
|
45073
|
-
const BookOpen = createLucideIcon("book-open", __iconNode$
|
|
45073
|
+
const BookOpen = createLucideIcon("book-open", __iconNode$15);
|
|
45074
45074
|
/**
|
|
45075
45075
|
* @license lucide-react v0.575.0 - ISC
|
|
45076
45076
|
*
|
|
45077
45077
|
* This source code is licensed under the ISC license.
|
|
45078
45078
|
* See the LICENSE file in the root directory of this source tree.
|
|
45079
45079
|
*/
|
|
45080
|
-
const __iconNode$
|
|
45080
|
+
const __iconNode$14 = [
|
|
45081
45081
|
[
|
|
45082
45082
|
"path",
|
|
45083
45083
|
{
|
|
@@ -45109,14 +45109,14 @@ const __iconNode$13 = [
|
|
|
45109
45109
|
["path", { d: "m12 8 4.74-2.85", key: "3rx089" }],
|
|
45110
45110
|
["path", { d: "M12 13.5V8", key: "1io7kd" }]
|
|
45111
45111
|
];
|
|
45112
|
-
const Boxes = createLucideIcon("boxes", __iconNode$
|
|
45112
|
+
const Boxes = createLucideIcon("boxes", __iconNode$14);
|
|
45113
45113
|
/**
|
|
45114
45114
|
* @license lucide-react v0.575.0 - ISC
|
|
45115
45115
|
*
|
|
45116
45116
|
* This source code is licensed under the ISC license.
|
|
45117
45117
|
* See the LICENSE file in the root directory of this source tree.
|
|
45118
45118
|
*/
|
|
45119
|
-
const __iconNode$
|
|
45119
|
+
const __iconNode$13 = [
|
|
45120
45120
|
["path", { d: "M12 18V5", key: "adv99a" }],
|
|
45121
45121
|
["path", { d: "M15 13a4.17 4.17 0 0 1-3-4 4.17 4.17 0 0 1-3 4", key: "1e3is1" }],
|
|
45122
45122
|
["path", { d: "M17.598 6.5A3 3 0 1 0 12 5a3 3 0 1 0-5.598 1.5", key: "1gqd8o" }],
|
|
@@ -45126,27 +45126,27 @@ const __iconNode$12 = [
|
|
|
45126
45126
|
["path", { d: "M6 18a4 4 0 0 1-2-7.464", key: "k1g0md" }],
|
|
45127
45127
|
["path", { d: "M6.003 5.125a4 4 0 0 0-2.526 5.77", key: "q97ue3" }]
|
|
45128
45128
|
];
|
|
45129
|
-
const Brain = createLucideIcon("brain", __iconNode$
|
|
45129
|
+
const Brain = createLucideIcon("brain", __iconNode$13);
|
|
45130
45130
|
/**
|
|
45131
45131
|
* @license lucide-react v0.575.0 - ISC
|
|
45132
45132
|
*
|
|
45133
45133
|
* This source code is licensed under the ISC license.
|
|
45134
45134
|
* See the LICENSE file in the root directory of this source tree.
|
|
45135
45135
|
*/
|
|
45136
|
-
const __iconNode$
|
|
45136
|
+
const __iconNode$12 = [
|
|
45137
45137
|
["path", { d: "M12 12h.01", key: "1mp3jc" }],
|
|
45138
45138
|
["path", { d: "M16 6V4a2 2 0 0 0-2-2h-4a2 2 0 0 0-2 2v2", key: "1ksdt3" }],
|
|
45139
45139
|
["path", { d: "M22 13a18.15 18.15 0 0 1-20 0", key: "12hx5q" }],
|
|
45140
45140
|
["rect", { width: "20", height: "14", x: "2", y: "6", rx: "2", key: "i6l2r4" }]
|
|
45141
45141
|
];
|
|
45142
|
-
const BriefcaseBusiness = createLucideIcon("briefcase-business", __iconNode$
|
|
45142
|
+
const BriefcaseBusiness = createLucideIcon("briefcase-business", __iconNode$12);
|
|
45143
45143
|
/**
|
|
45144
45144
|
* @license lucide-react v0.575.0 - ISC
|
|
45145
45145
|
*
|
|
45146
45146
|
* This source code is licensed under the ISC license.
|
|
45147
45147
|
* See the LICENSE file in the root directory of this source tree.
|
|
45148
45148
|
*/
|
|
45149
|
-
const __iconNode$
|
|
45149
|
+
const __iconNode$11 = [
|
|
45150
45150
|
[
|
|
45151
45151
|
"path",
|
|
45152
45152
|
{ d: "M17 19a1 1 0 0 1-1-1v-2a2 2 0 0 1 2-2h2a2 2 0 0 1 2 2v2a1 1 0 0 1-1 1z", key: "trhst0" }
|
|
@@ -45161,27 +45161,27 @@ const __iconNode$10 = [
|
|
|
45161
45161
|
],
|
|
45162
45162
|
["path", { d: "M7 5V3", key: "1t1388" }]
|
|
45163
45163
|
];
|
|
45164
|
-
const Cable = createLucideIcon("cable", __iconNode$
|
|
45164
|
+
const Cable = createLucideIcon("cable", __iconNode$11);
|
|
45165
45165
|
/**
|
|
45166
45166
|
* @license lucide-react v0.575.0 - ISC
|
|
45167
45167
|
*
|
|
45168
45168
|
* This source code is licensed under the ISC license.
|
|
45169
45169
|
* See the LICENSE file in the root directory of this source tree.
|
|
45170
45170
|
*/
|
|
45171
|
-
const __iconNode
|
|
45171
|
+
const __iconNode$10 = [
|
|
45172
45172
|
["path", { d: "M8 2v4", key: "1cmpym" }],
|
|
45173
45173
|
["path", { d: "M16 2v4", key: "4m81vk" }],
|
|
45174
45174
|
["rect", { width: "18", height: "18", x: "3", y: "4", rx: "2", key: "1hopcy" }],
|
|
45175
45175
|
["path", { d: "M3 10h18", key: "8toen8" }]
|
|
45176
45176
|
];
|
|
45177
|
-
const Calendar = createLucideIcon("calendar", __iconNode
|
|
45177
|
+
const Calendar = createLucideIcon("calendar", __iconNode$10);
|
|
45178
45178
|
/**
|
|
45179
45179
|
* @license lucide-react v0.575.0 - ISC
|
|
45180
45180
|
*
|
|
45181
45181
|
* This source code is licensed under the ISC license.
|
|
45182
45182
|
* See the LICENSE file in the root directory of this source tree.
|
|
45183
45183
|
*/
|
|
45184
|
-
const __iconNode
|
|
45184
|
+
const __iconNode$$ = [
|
|
45185
45185
|
[
|
|
45186
45186
|
"path",
|
|
45187
45187
|
{
|
|
@@ -45191,57 +45191,65 @@ const __iconNode$_ = [
|
|
|
45191
45191
|
],
|
|
45192
45192
|
["circle", { cx: "12", cy: "13", r: "3", key: "1vg3eu" }]
|
|
45193
45193
|
];
|
|
45194
|
-
const Camera = createLucideIcon("camera", __iconNode
|
|
45194
|
+
const Camera = createLucideIcon("camera", __iconNode$$);
|
|
45195
45195
|
/**
|
|
45196
45196
|
* @license lucide-react v0.575.0 - ISC
|
|
45197
45197
|
*
|
|
45198
45198
|
* This source code is licensed under the ISC license.
|
|
45199
45199
|
* See the LICENSE file in the root directory of this source tree.
|
|
45200
45200
|
*/
|
|
45201
|
-
const __iconNode$
|
|
45201
|
+
const __iconNode$_ = [
|
|
45202
45202
|
["path", { d: "M3 3v16a2 2 0 0 0 2 2h16", key: "c24i48" }],
|
|
45203
45203
|
["path", { d: "M7 16h8", key: "srdodz" }],
|
|
45204
45204
|
["path", { d: "M7 11h12", key: "127s9w" }],
|
|
45205
45205
|
["path", { d: "M7 6h3", key: "w9rmul" }]
|
|
45206
45206
|
];
|
|
45207
|
-
const ChartBar = createLucideIcon("chart-bar", __iconNode$
|
|
45207
|
+
const ChartBar = createLucideIcon("chart-bar", __iconNode$_);
|
|
45208
45208
|
/**
|
|
45209
45209
|
* @license lucide-react v0.575.0 - ISC
|
|
45210
45210
|
*
|
|
45211
45211
|
* This source code is licensed under the ISC license.
|
|
45212
45212
|
* See the LICENSE file in the root directory of this source tree.
|
|
45213
45213
|
*/
|
|
45214
|
-
const __iconNode$
|
|
45214
|
+
const __iconNode$Z = [
|
|
45215
45215
|
["path", { d: "M3 3v16a2 2 0 0 0 2 2h16", key: "c24i48" }],
|
|
45216
45216
|
["path", { d: "M18 17V9", key: "2bz60n" }],
|
|
45217
45217
|
["path", { d: "M13 17V5", key: "1frdt8" }],
|
|
45218
45218
|
["path", { d: "M8 17v-3", key: "17ska0" }]
|
|
45219
45219
|
];
|
|
45220
|
-
const ChartColumn = createLucideIcon("chart-column", __iconNode$
|
|
45220
|
+
const ChartColumn = createLucideIcon("chart-column", __iconNode$Z);
|
|
45221
|
+
/**
|
|
45222
|
+
* @license lucide-react v0.575.0 - ISC
|
|
45223
|
+
*
|
|
45224
|
+
* This source code is licensed under the ISC license.
|
|
45225
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
45226
|
+
*/
|
|
45227
|
+
const __iconNode$Y = [["path", { d: "M20 6 9 17l-5-5", key: "1gmf2c" }]];
|
|
45228
|
+
const Check = createLucideIcon("check", __iconNode$Y);
|
|
45221
45229
|
/**
|
|
45222
45230
|
* @license lucide-react v0.575.0 - ISC
|
|
45223
45231
|
*
|
|
45224
45232
|
* This source code is licensed under the ISC license.
|
|
45225
45233
|
* See the LICENSE file in the root directory of this source tree.
|
|
45226
45234
|
*/
|
|
45227
|
-
const __iconNode$X = [["path", { d: "
|
|
45228
|
-
const
|
|
45235
|
+
const __iconNode$X = [["path", { d: "m6 9 6 6 6-6", key: "qrunsl" }]];
|
|
45236
|
+
const ChevronDown = createLucideIcon("chevron-down", __iconNode$X);
|
|
45229
45237
|
/**
|
|
45230
45238
|
* @license lucide-react v0.575.0 - ISC
|
|
45231
45239
|
*
|
|
45232
45240
|
* This source code is licensed under the ISC license.
|
|
45233
45241
|
* See the LICENSE file in the root directory of this source tree.
|
|
45234
45242
|
*/
|
|
45235
|
-
const __iconNode$W = [["path", { d: "
|
|
45236
|
-
const
|
|
45243
|
+
const __iconNode$W = [["path", { d: "m9 18 6-6-6-6", key: "mthhwq" }]];
|
|
45244
|
+
const ChevronRight = createLucideIcon("chevron-right", __iconNode$W);
|
|
45237
45245
|
/**
|
|
45238
45246
|
* @license lucide-react v0.575.0 - ISC
|
|
45239
45247
|
*
|
|
45240
45248
|
* This source code is licensed under the ISC license.
|
|
45241
45249
|
* See the LICENSE file in the root directory of this source tree.
|
|
45242
45250
|
*/
|
|
45243
|
-
const __iconNode$V = [["path", { d: "
|
|
45244
|
-
const
|
|
45251
|
+
const __iconNode$V = [["path", { d: "m18 15-6-6-6 6", key: "153udz" }]];
|
|
45252
|
+
const ChevronUp = createLucideIcon("chevron-up", __iconNode$V);
|
|
45245
45253
|
/**
|
|
45246
45254
|
* @license lucide-react v0.575.0 - ISC
|
|
45247
45255
|
*
|
|
@@ -52682,6 +52690,480 @@ const TOOL_UI_REGISTRY = {
|
|
|
52682
52690
|
run_database_sql: RunSqlToolUI,
|
|
52683
52691
|
run_sql_query_tool: RunSqlToolUI
|
|
52684
52692
|
};
|
|
52693
|
+
const TOOLKIT_THEMES = {
|
|
52694
|
+
Web: { color: "#7BCCFA" },
|
|
52695
|
+
Document: { color: "#4586F9" },
|
|
52696
|
+
"Document (Word)": { color: "#4586F9" },
|
|
52697
|
+
Notebook: { color: "#FFAB00" },
|
|
52698
|
+
Python: { color: "#00A76F" },
|
|
52699
|
+
Spreadsheet: { color: "#00A76F" },
|
|
52700
|
+
Email: { color: "#B584FF" },
|
|
52701
|
+
AOP: { color: "#336DFF" },
|
|
52702
|
+
App: { color: "#7336F5" },
|
|
52703
|
+
"Presentation (PowerPoint)": { color: "#F56B36" },
|
|
52704
|
+
Presentation: { color: "#F56B36" },
|
|
52705
|
+
"User Interface": { color: "#7336F5" },
|
|
52706
|
+
Canvas: { color: "#002542" },
|
|
52707
|
+
Computer: { color: "#3E0042" },
|
|
52708
|
+
Database: { color: "#7336F5" }
|
|
52709
|
+
};
|
|
52710
|
+
const DEFAULT_THEME = { color: "#919EAB" };
|
|
52711
|
+
const CollapsibleGroup = ({ groupKey, indices, children }) => {
|
|
52712
|
+
const isMessageRunning = useAuiState((s) => {
|
|
52713
|
+
var _a2;
|
|
52714
|
+
return ((_a2 = s.message.status) == null ? void 0 : _a2.type) === "running";
|
|
52715
|
+
});
|
|
52716
|
+
const [userOpened, setOpen] = useState();
|
|
52717
|
+
const open = userOpened ?? isMessageRunning;
|
|
52718
|
+
const toolCallCount = useAuiState((s) => {
|
|
52719
|
+
if (s.message.role !== "assistant") return 0;
|
|
52720
|
+
const parts = s.message.content;
|
|
52721
|
+
if (!parts) return 0;
|
|
52722
|
+
return indices.reduce((acc, idx) => {
|
|
52723
|
+
const part = parts[idx];
|
|
52724
|
+
return (part == null ? void 0 : part.type) === "tool-call" ? acc + 1 : acc;
|
|
52725
|
+
}, 0);
|
|
52726
|
+
});
|
|
52727
|
+
const theme = useMemo(
|
|
52728
|
+
() => groupKey ? TOOLKIT_THEMES[groupKey] ?? DEFAULT_THEME : DEFAULT_THEME,
|
|
52729
|
+
[groupKey]
|
|
52730
|
+
);
|
|
52731
|
+
if (!groupKey || indices.length <= 1) return /* @__PURE__ */ jsx(Fragment$1, { children });
|
|
52732
|
+
return /* @__PURE__ */ jsxs(
|
|
52733
|
+
"div",
|
|
52734
|
+
{
|
|
52735
|
+
className: "my-4 rounded-2xl border shadow-sm",
|
|
52736
|
+
style: {
|
|
52737
|
+
borderColor: `${theme.color}33`,
|
|
52738
|
+
background: `linear-gradient(to right, ${theme.color}0d, transparent, ${theme.color}0d)`
|
|
52739
|
+
},
|
|
52740
|
+
children: [
|
|
52741
|
+
/* @__PURE__ */ jsxs(
|
|
52742
|
+
"button",
|
|
52743
|
+
{
|
|
52744
|
+
type: "button",
|
|
52745
|
+
onClick: () => setOpen(!open),
|
|
52746
|
+
className: "flex w-full items-center justify-between gap-3 rounded-2xl px-5 py-3 transition-colors hover:bg-black/5 dark:hover:bg-white/5",
|
|
52747
|
+
"aria-expanded": open,
|
|
52748
|
+
children: [
|
|
52749
|
+
/* @__PURE__ */ jsxs("div", { className: "flex items-center gap-3 text-foreground/90", children: [
|
|
52750
|
+
/* @__PURE__ */ jsx(
|
|
52751
|
+
"span",
|
|
52752
|
+
{
|
|
52753
|
+
className: "inline-block size-2 rounded-full",
|
|
52754
|
+
style: { backgroundColor: theme.color },
|
|
52755
|
+
"aria-hidden": "true"
|
|
52756
|
+
}
|
|
52757
|
+
),
|
|
52758
|
+
/* @__PURE__ */ jsxs("span", { className: "text-sm font-semibold", children: [
|
|
52759
|
+
isMessageRunning ? "Using " : "Used ",
|
|
52760
|
+
groupKey,
|
|
52761
|
+
" Toolkit"
|
|
52762
|
+
] })
|
|
52763
|
+
] }),
|
|
52764
|
+
/* @__PURE__ */ jsxs("div", { className: "flex items-center gap-3", children: [
|
|
52765
|
+
/* @__PURE__ */ jsxs("span", { className: "text-xs font-medium text-muted-foreground", children: [
|
|
52766
|
+
toolCallCount,
|
|
52767
|
+
" tool ",
|
|
52768
|
+
toolCallCount === 1 ? "call" : "calls"
|
|
52769
|
+
] }),
|
|
52770
|
+
open ? /* @__PURE__ */ jsx(ChevronUp, { size: 16 }) : /* @__PURE__ */ jsx(ChevronDown, { size: 16 })
|
|
52771
|
+
] })
|
|
52772
|
+
]
|
|
52773
|
+
}
|
|
52774
|
+
),
|
|
52775
|
+
/* @__PURE__ */ jsx(
|
|
52776
|
+
"div",
|
|
52777
|
+
{
|
|
52778
|
+
className: cn(
|
|
52779
|
+
"grid overflow-hidden border-t transition-[grid-template-rows] duration-200 ease-in-out",
|
|
52780
|
+
open ? "grid-rows-[1fr]" : "grid-rows-[0fr]"
|
|
52781
|
+
),
|
|
52782
|
+
style: { borderColor: `${theme.color}33` },
|
|
52783
|
+
children: /* @__PURE__ */ jsx("div", { className: "overflow-hidden", children: /* @__PURE__ */ jsx("div", { className: "space-y-2 px-5 py-4", children }) })
|
|
52784
|
+
}
|
|
52785
|
+
)
|
|
52786
|
+
]
|
|
52787
|
+
}
|
|
52788
|
+
);
|
|
52789
|
+
};
|
|
52790
|
+
const createToolBasedGroupingFunction = (getToolGroupKey) => (parts) => {
|
|
52791
|
+
const groups = [];
|
|
52792
|
+
let currentGroup = null;
|
|
52793
|
+
for (let idx = 0; idx < parts.length; idx++) {
|
|
52794
|
+
const part = parts[idx];
|
|
52795
|
+
if ((part == null ? void 0 : part.type) === "reasoning") {
|
|
52796
|
+
if (currentGroup) {
|
|
52797
|
+
currentGroup.indices.push(idx);
|
|
52798
|
+
} else {
|
|
52799
|
+
groups.push({ groupKey: void 0, indices: [idx] });
|
|
52800
|
+
}
|
|
52801
|
+
continue;
|
|
52802
|
+
}
|
|
52803
|
+
let key;
|
|
52804
|
+
if ((part == null ? void 0 : part.type) === "tool-call" && part.toolName) {
|
|
52805
|
+
key = getToolGroupKey(part.toolName);
|
|
52806
|
+
} else if ((part == null ? void 0 : part.type) === "text") {
|
|
52807
|
+
const prevKey = currentGroup == null ? void 0 : currentGroup.groupKey;
|
|
52808
|
+
let nextKey;
|
|
52809
|
+
for (let lookIdx = idx + 1; lookIdx < parts.length; lookIdx++) {
|
|
52810
|
+
const lookPart = parts[lookIdx];
|
|
52811
|
+
if ((lookPart == null ? void 0 : lookPart.type) === "reasoning" || (lookPart == null ? void 0 : lookPart.type) === "text") continue;
|
|
52812
|
+
if ((lookPart == null ? void 0 : lookPart.type) === "tool-call" && lookPart.toolName) {
|
|
52813
|
+
nextKey = getToolGroupKey(lookPart.toolName);
|
|
52814
|
+
}
|
|
52815
|
+
break;
|
|
52816
|
+
}
|
|
52817
|
+
if (prevKey && nextKey && prevKey === nextKey) {
|
|
52818
|
+
key = prevKey;
|
|
52819
|
+
}
|
|
52820
|
+
}
|
|
52821
|
+
if (currentGroup && currentGroup.groupKey === key) {
|
|
52822
|
+
currentGroup.indices.push(idx);
|
|
52823
|
+
} else {
|
|
52824
|
+
if (currentGroup) groups.push(currentGroup);
|
|
52825
|
+
currentGroup = { groupKey: key, indices: [idx] };
|
|
52826
|
+
}
|
|
52827
|
+
}
|
|
52828
|
+
if (currentGroup) groups.push(currentGroup);
|
|
52829
|
+
return groups;
|
|
52830
|
+
};
|
|
52831
|
+
const TOOL_STATUS_LABELS = {
|
|
52832
|
+
// Document tools
|
|
52833
|
+
read_asset: { running: "Reviewing asset content", complete: "Asset content reviewed" },
|
|
52834
|
+
read_full_asset: { running: "Reviewing asset content", complete: "Asset content reviewed" },
|
|
52835
|
+
create_new_document: { running: "Creating document", complete: "Created document" },
|
|
52836
|
+
create_document_from_markdown: { running: "Creating document", complete: "Created document" },
|
|
52837
|
+
append_markdown_to_athena_document: { running: "Updating document", complete: "Updated document" },
|
|
52838
|
+
replace_markdown_in_athena_document: { running: "Updating document", complete: "Updated document" },
|
|
52839
|
+
convert_athena_doc_to_pdf: { running: "Converting to PDF", complete: "Converted to PDF" },
|
|
52840
|
+
convert_to_pdf: { running: "Converting to PDF", complete: "Converted to PDF" },
|
|
52841
|
+
// Spreadsheet tools
|
|
52842
|
+
create_new_sheet: { running: "Creating spreadsheet", complete: "Created spreadsheet" },
|
|
52843
|
+
update_sheet_range: { running: "Updating spreadsheet", complete: "Updated spreadsheet" },
|
|
52844
|
+
format_sheet_range: { running: "Formatting spreadsheet", complete: "Formatted spreadsheet" },
|
|
52845
|
+
bulk_format_sheet_range: { running: "Formatting spreadsheet ranges", complete: "Formatted spreadsheet ranges" },
|
|
52846
|
+
create_table: { running: "Creating table", complete: "Created table" },
|
|
52847
|
+
update_table: { running: "Updating table", complete: "Updated table" },
|
|
52848
|
+
create_chart: { running: "Creating chart", complete: "Created chart" },
|
|
52849
|
+
update_chart: { running: "Updating chart", complete: "Updated chart" },
|
|
52850
|
+
// Web / search
|
|
52851
|
+
search: { running: "Searching the web", complete: "Web search complete" },
|
|
52852
|
+
browse: { running: "Reading webpage", complete: "Read webpage" },
|
|
52853
|
+
web_search: { running: "Searching the web", complete: "Web search complete" },
|
|
52854
|
+
search_web: { running: "Searching the web", complete: "Web search complete" },
|
|
52855
|
+
web_scrape: { running: "Reading webpage", complete: "Read webpage" },
|
|
52856
|
+
scrape_web: { running: "Reading webpage", complete: "Read webpage" },
|
|
52857
|
+
open_asset_in_workspace: { running: "Opening in workspace", complete: "Opened in workspace" },
|
|
52858
|
+
// Email / calendar
|
|
52859
|
+
create_email_draft: { running: "Drafting email", complete: "Email drafted" },
|
|
52860
|
+
send_email: { running: "Sending email", complete: "Email sent" },
|
|
52861
|
+
unified_email_create_draft: { running: "Drafting email", complete: "Email drafted" },
|
|
52862
|
+
unified_email_send: { running: "Sending email", complete: "Email sent" },
|
|
52863
|
+
unified_email_edit_draft: { running: "Editing email draft", complete: "Draft updated" },
|
|
52864
|
+
search_email: { running: "Searching email", complete: "Email search complete" },
|
|
52865
|
+
unified_email_search: { running: "Searching email", complete: "Email search complete" },
|
|
52866
|
+
// Python / code execution
|
|
52867
|
+
run_python: { running: "Running Python code", complete: "Python execution complete" },
|
|
52868
|
+
run_python_code: { running: "Running Python code", complete: "Python execution complete" },
|
|
52869
|
+
run_sql: { running: "Running database query", complete: "Query complete" },
|
|
52870
|
+
execute_sql: { running: "Running database query", complete: "Query complete" },
|
|
52871
|
+
run_database_sql: { running: "Running database query", complete: "Query complete" },
|
|
52872
|
+
run_sql_query_tool: { running: "Running database query", complete: "Query complete" },
|
|
52873
|
+
// Presentation
|
|
52874
|
+
create_powerpoint_deck: { running: "Creating presentation", complete: "Created presentation" },
|
|
52875
|
+
execute_presentation_code: { running: "Updating presentation", complete: "Updated presentation" },
|
|
52876
|
+
capture_slide_screenshot: { running: "Capturing slide", complete: "Slide captured" },
|
|
52877
|
+
// Notebook
|
|
52878
|
+
create_new_notebook: { running: "Creating notebook", complete: "Created notebook" },
|
|
52879
|
+
run_notebook_cell: { running: "Running notebook cell", complete: "Cell execution complete" },
|
|
52880
|
+
// Media capture
|
|
52881
|
+
capture_moment: { running: "Capturing moment", complete: "Moment captured" }
|
|
52882
|
+
};
|
|
52883
|
+
function getToolStatusLabel(toolName, status) {
|
|
52884
|
+
const entry = TOOL_STATUS_LABELS[toolName];
|
|
52885
|
+
if (entry) return status === "complete" ? entry.complete : entry.running;
|
|
52886
|
+
const formatted = formatToolName(toolName);
|
|
52887
|
+
return status === "complete" ? formatted : `Running ${formatted.toLowerCase()}`;
|
|
52888
|
+
}
|
|
52889
|
+
const DEFAULT_TOOL_TO_TOOLKIT = {
|
|
52890
|
+
// Web
|
|
52891
|
+
search: "Web",
|
|
52892
|
+
browse: "Web",
|
|
52893
|
+
web_search: "Web",
|
|
52894
|
+
search_web: "Web",
|
|
52895
|
+
web_scrape: "Web",
|
|
52896
|
+
scrape_web: "Web",
|
|
52897
|
+
// Document
|
|
52898
|
+
create_new_document: "Document",
|
|
52899
|
+
create_document_from_markdown: "Document",
|
|
52900
|
+
append_markdown_to_athena_document: "Document",
|
|
52901
|
+
replace_markdown_in_athena_document: "Document",
|
|
52902
|
+
delete_blocks_from_athena_document: "Document",
|
|
52903
|
+
convert_athena_doc_to_pdf: "Document",
|
|
52904
|
+
convert_to_pdf: "Document",
|
|
52905
|
+
// Word document (Studio)
|
|
52906
|
+
CreateDocument: "Document (Word)",
|
|
52907
|
+
CreateParagraph: "Document (Word)",
|
|
52908
|
+
OpenDocument: "Document (Word)",
|
|
52909
|
+
execute_word_commands: "Document (Word)",
|
|
52910
|
+
create_new_word_document: "Document (Word)",
|
|
52911
|
+
// Spreadsheet
|
|
52912
|
+
create_new_sheet: "Spreadsheet",
|
|
52913
|
+
update_sheet_range: "Spreadsheet",
|
|
52914
|
+
format_sheet_range: "Spreadsheet",
|
|
52915
|
+
bulk_format_sheet_range: "Spreadsheet",
|
|
52916
|
+
create_table: "Spreadsheet",
|
|
52917
|
+
update_table: "Spreadsheet",
|
|
52918
|
+
create_chart: "Spreadsheet",
|
|
52919
|
+
update_chart: "Spreadsheet",
|
|
52920
|
+
// Studio sheet PTC
|
|
52921
|
+
CreateWorkbook: "Spreadsheet",
|
|
52922
|
+
AddSheet: "Spreadsheet",
|
|
52923
|
+
OpenWorkbook: "Spreadsheet",
|
|
52924
|
+
// Presentation
|
|
52925
|
+
create_powerpoint_deck: "Presentation (PowerPoint)",
|
|
52926
|
+
execute_presentation_code: "Presentation (PowerPoint)",
|
|
52927
|
+
capture_slide_screenshot: "Presentation (PowerPoint)",
|
|
52928
|
+
// Studio presentation PTC
|
|
52929
|
+
CreatePresentation: "Presentation (PowerPoint)",
|
|
52930
|
+
OpenPresentation: "Presentation (PowerPoint)",
|
|
52931
|
+
AddSlide: "Presentation (PowerPoint)",
|
|
52932
|
+
// Notebook
|
|
52933
|
+
create_new_notebook: "Notebook",
|
|
52934
|
+
run_notebook_cell: "Notebook",
|
|
52935
|
+
// Python / code execution
|
|
52936
|
+
run_python_code: "Python",
|
|
52937
|
+
run_python: "Python",
|
|
52938
|
+
// Database
|
|
52939
|
+
run_sql: "Database",
|
|
52940
|
+
run_database_sql: "Database",
|
|
52941
|
+
run_sql_query_tool: "Database",
|
|
52942
|
+
execute_sql: "Database",
|
|
52943
|
+
describe_database: "Database",
|
|
52944
|
+
list_database_tables: "Database",
|
|
52945
|
+
get_database_table_schema: "Database",
|
|
52946
|
+
// Email / calendar
|
|
52947
|
+
search_email: "Email",
|
|
52948
|
+
unified_email_search: "Email",
|
|
52949
|
+
// Media
|
|
52950
|
+
capture_moment: "Computer"
|
|
52951
|
+
};
|
|
52952
|
+
const UNGROUPED_TOOLS = [
|
|
52953
|
+
"read_asset",
|
|
52954
|
+
"read_full_asset",
|
|
52955
|
+
"open_asset_in_workspace",
|
|
52956
|
+
"create_email_draft",
|
|
52957
|
+
"unified_email_create_draft",
|
|
52958
|
+
"unified_email_send",
|
|
52959
|
+
"unified_email_edit_draft"
|
|
52960
|
+
];
|
|
52961
|
+
const defaultGetToolGroupKey = (toolName) => {
|
|
52962
|
+
if (UNGROUPED_TOOLS.includes(toolName)) return void 0;
|
|
52963
|
+
return DEFAULT_TOOL_TO_TOOLKIT[toolName];
|
|
52964
|
+
};
|
|
52965
|
+
const MAX_VISIBLE_STATUSES = 5;
|
|
52966
|
+
const EMPTY_STATUSES = [];
|
|
52967
|
+
function PulsingDots() {
|
|
52968
|
+
return /* @__PURE__ */ jsxs("span", { className: "inline-flex items-center gap-[3px]", "aria-hidden": "true", children: [
|
|
52969
|
+
/* @__PURE__ */ jsx("span", { className: "h-[5px] w-[5px] rounded-full bg-gray-800 animate-[aui-sg-pulse-dot_1.4s_ease-in-out_infinite]" }),
|
|
52970
|
+
/* @__PURE__ */ jsx("span", { className: "h-[5px] w-[5px] rounded-full bg-gray-800 animate-[aui-sg-pulse-dot_1.4s_ease-in-out_0.2s_infinite]" }),
|
|
52971
|
+
/* @__PURE__ */ jsx("span", { className: "h-[5px] w-[5px] rounded-full bg-gray-800 animate-[aui-sg-pulse-dot_1.4s_ease-in-out_0.4s_infinite]" }),
|
|
52972
|
+
/* @__PURE__ */ jsx("style", { children: `
|
|
52973
|
+
@keyframes aui-sg-pulse-dot {
|
|
52974
|
+
0%, 80%, 100% { opacity: 0.2; transform: scale(0.8); }
|
|
52975
|
+
40% { opacity: 1; transform: scale(1); }
|
|
52976
|
+
}
|
|
52977
|
+
@keyframes aui-sg-shimmer-bar {
|
|
52978
|
+
0% { transform: translateX(-100%); }
|
|
52979
|
+
100% { transform: translateX(400%); }
|
|
52980
|
+
}
|
|
52981
|
+
` })
|
|
52982
|
+
] });
|
|
52983
|
+
}
|
|
52984
|
+
const SuperGroupingFinalText = memo(function SuperGroupingFinalText2({
|
|
52985
|
+
TextComponent
|
|
52986
|
+
}) {
|
|
52987
|
+
const messageContent = useAuiState((s) => s.message.content);
|
|
52988
|
+
const isRunning = useAuiState((s) => {
|
|
52989
|
+
var _a2;
|
|
52990
|
+
return ((_a2 = s.message.status) == null ? void 0 : _a2.type) === "running";
|
|
52991
|
+
});
|
|
52992
|
+
const finalText = useMemo(() => {
|
|
52993
|
+
if (!(messageContent == null ? void 0 : messageContent.length)) return null;
|
|
52994
|
+
let lastToolIdx = -1;
|
|
52995
|
+
for (let i = messageContent.length - 1; i >= 0; i--) {
|
|
52996
|
+
if (messageContent[i].type === "tool-call") {
|
|
52997
|
+
lastToolIdx = i;
|
|
52998
|
+
break;
|
|
52999
|
+
}
|
|
53000
|
+
}
|
|
53001
|
+
if (lastToolIdx === -1) return null;
|
|
53002
|
+
const texts = [];
|
|
53003
|
+
for (let i = lastToolIdx + 1; i < messageContent.length; i++) {
|
|
53004
|
+
const part = messageContent[i];
|
|
53005
|
+
if (part.type === "text" && part.text) texts.push(part.text);
|
|
53006
|
+
}
|
|
53007
|
+
return texts.length > 0 ? texts.join("\n\n") : null;
|
|
53008
|
+
}, [messageContent]);
|
|
53009
|
+
if (isRunning || !finalText) return null;
|
|
53010
|
+
return /* @__PURE__ */ jsx(TextComponent, { type: "text", text: finalText, status: { type: "complete" } });
|
|
53011
|
+
});
|
|
53012
|
+
const SuperGroupingCard = memo(function SuperGroupingCard2({
|
|
53013
|
+
toolUIs,
|
|
53014
|
+
TextComponent,
|
|
53015
|
+
ReasoningComponent,
|
|
53016
|
+
getToolGroupKey = defaultGetToolGroupKey
|
|
53017
|
+
}) {
|
|
53018
|
+
const [showDetails, setShowDetails] = useState(false);
|
|
53019
|
+
const handleToggleDetails = useCallback(() => setShowDetails((p) => !p), []);
|
|
53020
|
+
const handleHideDetails = useCallback(() => setShowDetails(false), []);
|
|
53021
|
+
const messageStatus = useAuiState((s) => {
|
|
53022
|
+
var _a2;
|
|
53023
|
+
return (_a2 = s.message.status) == null ? void 0 : _a2.type;
|
|
53024
|
+
});
|
|
53025
|
+
const isRunning = messageStatus === "running";
|
|
53026
|
+
const isError = messageStatus === "incomplete";
|
|
53027
|
+
const isComplete = !isRunning && !isError;
|
|
53028
|
+
const groupingFunction = useMemo(() => {
|
|
53029
|
+
const inner = createToolBasedGroupingFunction(getToolGroupKey);
|
|
53030
|
+
return (parts) => {
|
|
53031
|
+
const lastToolIdx = parts.findLastIndex((p) => (p == null ? void 0 : p.type) === "tool-call");
|
|
53032
|
+
return inner(parts).map((g) => ({
|
|
53033
|
+
...g,
|
|
53034
|
+
indices: g.indices.filter((i) => {
|
|
53035
|
+
var _a2;
|
|
53036
|
+
return ((_a2 = parts[i]) == null ? void 0 : _a2.type) !== "text" || i <= lastToolIdx;
|
|
53037
|
+
})
|
|
53038
|
+
})).filter((g) => g.indices.length > 0);
|
|
53039
|
+
};
|
|
53040
|
+
}, [getToolGroupKey]);
|
|
53041
|
+
const messageContent = useAuiState((s) => s.message.content);
|
|
53042
|
+
const toolStatuses = useMemo(() => {
|
|
53043
|
+
if (!messageContent) return EMPTY_STATUSES;
|
|
53044
|
+
const statuses = [];
|
|
53045
|
+
for (const part of messageContent) {
|
|
53046
|
+
if (part.type === "tool-call") {
|
|
53047
|
+
const isToolComplete = part.result !== void 0;
|
|
53048
|
+
statuses.push({
|
|
53049
|
+
toolName: part.toolName,
|
|
53050
|
+
label: getToolStatusLabel(part.toolName, isToolComplete ? "complete" : "running"),
|
|
53051
|
+
isComplete: isToolComplete
|
|
53052
|
+
});
|
|
53053
|
+
}
|
|
53054
|
+
}
|
|
53055
|
+
return statuses.length > 0 ? statuses : EMPTY_STATUSES;
|
|
53056
|
+
}, [messageContent]);
|
|
53057
|
+
const hasToolCalls = toolStatuses.length > 0;
|
|
53058
|
+
const visibleStatuses = useMemo(
|
|
53059
|
+
() => toolStatuses.length <= MAX_VISIBLE_STATUSES ? toolStatuses : toolStatuses.slice(-MAX_VISIBLE_STATUSES),
|
|
53060
|
+
[toolStatuses]
|
|
53061
|
+
);
|
|
53062
|
+
const hiddenCount = toolStatuses.length - visibleStatuses.length;
|
|
53063
|
+
const latestStatusLine = useMemo(() => {
|
|
53064
|
+
var _a2;
|
|
53065
|
+
if (!hasToolCalls) return "Planning approach";
|
|
53066
|
+
return ((_a2 = toolStatuses[toolStatuses.length - 1]) == null ? void 0 : _a2.label) ?? "Working";
|
|
53067
|
+
}, [toolStatuses, hasToolCalls]);
|
|
53068
|
+
const detailsPanel = /* @__PURE__ */ jsxs("div", { className: "space-y-2 border-t border-border/60 bg-background/80 px-4 py-4", children: [
|
|
53069
|
+
/* @__PURE__ */ jsx(
|
|
53070
|
+
MessagePrimitive.Unstable_PartsGrouped,
|
|
53071
|
+
{
|
|
53072
|
+
groupingFunction,
|
|
53073
|
+
components: {
|
|
53074
|
+
tools: { by_name: toolUIs, Fallback: ToolFallback },
|
|
53075
|
+
Text: TextComponent,
|
|
53076
|
+
...ReasoningComponent ? { Reasoning: ReasoningComponent } : {},
|
|
53077
|
+
Group: CollapsibleGroup
|
|
53078
|
+
}
|
|
53079
|
+
}
|
|
53080
|
+
),
|
|
53081
|
+
/* @__PURE__ */ jsxs(
|
|
53082
|
+
"button",
|
|
53083
|
+
{
|
|
53084
|
+
type: "button",
|
|
53085
|
+
onClick: handleHideDetails,
|
|
53086
|
+
className: "mx-auto mt-3 flex items-center gap-1 rounded-md px-3 py-1.5 text-[11px] font-medium text-muted-foreground transition-colors hover:bg-muted/40 hover:text-foreground",
|
|
53087
|
+
children: [
|
|
53088
|
+
/* @__PURE__ */ jsx(ChevronUp, { className: "size-3" }),
|
|
53089
|
+
"Hide details"
|
|
53090
|
+
]
|
|
53091
|
+
}
|
|
53092
|
+
)
|
|
53093
|
+
] });
|
|
53094
|
+
if (isComplete && hasToolCalls) {
|
|
53095
|
+
return /* @__PURE__ */ jsxs("section", { className: "my-3 overflow-hidden rounded-2xl border border-border/60 bg-muted/10", children: [
|
|
53096
|
+
/* @__PURE__ */ jsxs(
|
|
53097
|
+
"button",
|
|
53098
|
+
{
|
|
53099
|
+
type: "button",
|
|
53100
|
+
onClick: handleToggleDetails,
|
|
53101
|
+
"aria-expanded": showDetails,
|
|
53102
|
+
className: "flex w-full items-center justify-between px-4 py-3 text-left transition-colors hover:bg-muted/30",
|
|
53103
|
+
children: [
|
|
53104
|
+
/* @__PURE__ */ jsxs("div", { className: "flex items-center gap-2", children: [
|
|
53105
|
+
/* @__PURE__ */ jsx("span", { className: "flex size-4 items-center justify-center text-emerald-500", "aria-hidden": "true", children: /* @__PURE__ */ jsx("svg", { width: "10", height: "10", viewBox: "0 0 12 12", fill: "none", children: /* @__PURE__ */ jsx("path", { d: "M10 3L4.5 8.5L2 6", stroke: "currentColor", strokeWidth: "1.5", strokeLinecap: "round", strokeLinejoin: "round" }) }) }),
|
|
53106
|
+
/* @__PURE__ */ jsxs("span", { className: "text-[12px] text-muted-foreground", children: [
|
|
53107
|
+
"Used ",
|
|
53108
|
+
toolStatuses.length,
|
|
53109
|
+
" ",
|
|
53110
|
+
toolStatuses.length === 1 ? "tool" : "tools"
|
|
53111
|
+
] })
|
|
53112
|
+
] }),
|
|
53113
|
+
showDetails ? /* @__PURE__ */ jsx(ChevronDown, { className: "size-3.5 text-muted-foreground/70" }) : /* @__PURE__ */ jsx(ChevronRight, { className: "size-3.5 text-muted-foreground/70" })
|
|
53114
|
+
]
|
|
53115
|
+
}
|
|
53116
|
+
),
|
|
53117
|
+
showDetails && detailsPanel
|
|
53118
|
+
] });
|
|
53119
|
+
}
|
|
53120
|
+
if (isComplete) return null;
|
|
53121
|
+
return /* @__PURE__ */ jsxs(
|
|
53122
|
+
"section",
|
|
53123
|
+
{
|
|
53124
|
+
"aria-busy": isRunning ? "true" : "false",
|
|
53125
|
+
"aria-describedby": "aui-sg-status",
|
|
53126
|
+
className: cn(
|
|
53127
|
+
"my-3 overflow-hidden rounded-2xl border transition-colors duration-200",
|
|
53128
|
+
isError ? "border-destructive/30 bg-destructive/5" : "border-border/70 bg-muted/10"
|
|
53129
|
+
),
|
|
53130
|
+
children: [
|
|
53131
|
+
/* @__PURE__ */ jsx("div", { className: "px-4 pt-4 pb-2", children: /* @__PURE__ */ jsx("div", { className: "flex items-center justify-between", children: /* @__PURE__ */ jsxs("div", { className: "flex items-center gap-2", children: [
|
|
53132
|
+
/* @__PURE__ */ jsx("h3", { className: "text-[13px] font-semibold text-foreground", children: isError ? "Something went wrong" : "Athena is working" }),
|
|
53133
|
+
isRunning && !isError && /* @__PURE__ */ jsx(PulsingDots, {})
|
|
53134
|
+
] }) }) }),
|
|
53135
|
+
isRunning && /* @__PURE__ */ jsx("div", { className: "px-4 pb-1", children: /* @__PURE__ */ jsx("div", { className: "h-[2px] w-full overflow-hidden rounded-full bg-muted/40", children: /* @__PURE__ */ jsx("div", { className: "h-full w-1/3 rounded-full bg-gradient-to-r from-blue-400 to-indigo-400 animate-[aui-sg-shimmer-bar_1.5s_ease-in-out_infinite]" }) }) }),
|
|
53136
|
+
/* @__PURE__ */ jsx("output", { id: "aui-sg-status", "aria-live": "polite", "aria-atomic": "true", className: "sr-only", children: latestStatusLine }),
|
|
53137
|
+
hasToolCalls && /* @__PURE__ */ jsxs("ul", { className: "space-y-1 px-4 pt-1.5 pb-1", "aria-label": "Work status updates", children: [
|
|
53138
|
+
hiddenCount > 0 && /* @__PURE__ */ jsxs("li", { className: "pl-[22px] text-[11px] text-muted-foreground/70", children: [
|
|
53139
|
+
hiddenCount,
|
|
53140
|
+
" earlier ",
|
|
53141
|
+
hiddenCount === 1 ? "step" : "steps"
|
|
53142
|
+
] }),
|
|
53143
|
+
visibleStatuses.map((s, i) => /* @__PURE__ */ jsxs("li", { className: "flex items-center gap-2 text-[12px]", children: [
|
|
53144
|
+
s.isComplete ? /* @__PURE__ */ jsx("span", { className: "flex size-3.5 items-center justify-center text-emerald-500", "aria-hidden": "true", children: /* @__PURE__ */ jsx("svg", { width: "10", height: "10", viewBox: "0 0 12 12", fill: "none", children: /* @__PURE__ */ jsx("path", { d: "M10 3L4.5 8.5L2 6", stroke: "currentColor", strokeWidth: "1.5", strokeLinecap: "round", strokeLinejoin: "round" }) }) }) : /* @__PURE__ */ jsx("span", { className: "flex size-3.5 items-center justify-center", "aria-hidden": "true", children: /* @__PURE__ */ jsx("span", { className: "size-1.5 animate-pulse rounded-full bg-blue-500" }) }),
|
|
53145
|
+
/* @__PURE__ */ jsx("span", { className: cn("leading-relaxed", s.isComplete ? "text-muted-foreground/70" : "text-foreground/80"), children: s.label })
|
|
53146
|
+
] }, `${s.toolName}-${i}`))
|
|
53147
|
+
] }),
|
|
53148
|
+
!hasToolCalls && /* @__PURE__ */ jsx("div", { className: "px-4 pt-1 pb-2", children: /* @__PURE__ */ jsx("span", { className: "shimmer text-[12px] text-muted-foreground", children: "Planning approach..." }) }),
|
|
53149
|
+
/* @__PURE__ */ jsx("div", { className: "px-4 pb-3 pt-0.5", children: /* @__PURE__ */ jsxs(
|
|
53150
|
+
"button",
|
|
53151
|
+
{
|
|
53152
|
+
type: "button",
|
|
53153
|
+
onClick: handleToggleDetails,
|
|
53154
|
+
"aria-expanded": showDetails,
|
|
53155
|
+
className: "flex items-center gap-1 text-[11px] font-medium text-muted-foreground transition-colors hover:text-foreground",
|
|
53156
|
+
children: [
|
|
53157
|
+
showDetails ? /* @__PURE__ */ jsx(ChevronDown, { className: "size-3" }) : /* @__PURE__ */ jsx(ChevronRight, { className: "size-3" }),
|
|
53158
|
+
showDetails ? "Hide details" : "Show details"
|
|
53159
|
+
]
|
|
53160
|
+
}
|
|
53161
|
+
) }),
|
|
53162
|
+
showDetails && detailsPanel
|
|
53163
|
+
]
|
|
53164
|
+
}
|
|
53165
|
+
);
|
|
53166
|
+
});
|
|
52685
53167
|
const falsyToString = (value) => typeof value === "boolean" ? `${value}` : value === 0 ? "0" : value;
|
|
52686
53168
|
const cx = clsx;
|
|
52687
53169
|
const cva = (base2, config2) => (props) => {
|
|
@@ -53608,6 +54090,17 @@ const AthenaAssistantMessageEmpty = ({ status }) => {
|
|
|
53608
54090
|
if ((status == null ? void 0 : status.type) !== "running") return null;
|
|
53609
54091
|
return /* @__PURE__ */ jsx("span", { className: "shimmer text-[13px] text-muted-foreground", children: "Thinking..." });
|
|
53610
54092
|
};
|
|
54093
|
+
const AthenaMessageEmptyIndicator = ({
|
|
54094
|
+
EmptyComponent: EmptyComponent2
|
|
54095
|
+
}) => {
|
|
54096
|
+
const hasParts = useAuiState((s) => s.message.parts.length > 0);
|
|
54097
|
+
const isRunning = useAuiState((s) => {
|
|
54098
|
+
var _a2;
|
|
54099
|
+
return ((_a2 = s.message.status) == null ? void 0 : _a2.type) === "running";
|
|
54100
|
+
});
|
|
54101
|
+
if (hasParts || !isRunning) return null;
|
|
54102
|
+
return /* @__PURE__ */ jsx(EmptyComponent2, { status: { type: "running" } });
|
|
54103
|
+
};
|
|
53611
54104
|
const AthenaReasoningPart = ({
|
|
53612
54105
|
text: text2,
|
|
53613
54106
|
status,
|
|
@@ -53683,7 +54176,6 @@ const AthenaReasoningPart = ({
|
|
|
53683
54176
|
}
|
|
53684
54177
|
);
|
|
53685
54178
|
};
|
|
53686
|
-
const groupAdjacentToolCalls = (part) => part.type === "tool-call" ? ["group-tool"] : null;
|
|
53687
54179
|
const noToolGrouping = () => null;
|
|
53688
54180
|
const AthenaAssistantMessage = ({
|
|
53689
54181
|
toolUIs,
|
|
@@ -53720,31 +54212,42 @@ const AthenaAssistantMessage = ({
|
|
|
53720
54212
|
"data-role": "assistant",
|
|
53721
54213
|
children: [
|
|
53722
54214
|
/* @__PURE__ */ jsx(AthenaReasoningTextComponentContext.Provider, { value: TextComponent, children: /* @__PURE__ */ jsxs("div", { className: "aui-assistant-message-content wrap-break-word px-2 text-foreground leading-relaxed", children: [
|
|
53723
|
-
/* @__PURE__ */ jsx(NestedPtcComponentsProvider, { components: nestedPtcComponents, children: /* @__PURE__ */
|
|
53724
|
-
|
|
53725
|
-
|
|
53726
|
-
|
|
53727
|
-
|
|
53728
|
-
|
|
53729
|
-
|
|
53730
|
-
const toolProps = part;
|
|
53731
|
-
return ToolUI ? /* @__PURE__ */ jsx(ToolUI, { ...toolProps }) : /* @__PURE__ */ jsx(ToolFallback, { ...toolProps });
|
|
53732
|
-
}
|
|
53733
|
-
case "reasoning": {
|
|
53734
|
-
const ReasoningRenderer = effectiveReasoningComponent;
|
|
53735
|
-
return /* @__PURE__ */ jsx(ReasoningRenderer, { ...part });
|
|
54215
|
+
/* @__PURE__ */ jsx(NestedPtcComponentsProvider, { components: nestedPtcComponents, children: groupToolCalls ? /* @__PURE__ */ jsxs("div", { className: "flex flex-col space-y-2", children: [
|
|
54216
|
+
/* @__PURE__ */ jsx(
|
|
54217
|
+
SuperGroupingCard,
|
|
54218
|
+
{
|
|
54219
|
+
toolUIs: toolUIsWithNestedMessages,
|
|
54220
|
+
TextComponent,
|
|
54221
|
+
ReasoningComponent: effectiveReasoningComponent
|
|
53736
54222
|
}
|
|
53737
|
-
|
|
53738
|
-
|
|
53739
|
-
|
|
53740
|
-
|
|
54223
|
+
),
|
|
54224
|
+
/* @__PURE__ */ jsx(SuperGroupingFinalText, { TextComponent })
|
|
54225
|
+
] }) : /* @__PURE__ */ jsxs(Fragment$1, { children: [
|
|
54226
|
+
/* @__PURE__ */ jsx(AthenaMessageEmptyIndicator, { EmptyComponent: EmptyComponent2 }),
|
|
54227
|
+
/* @__PURE__ */ jsx(MessagePrimitive.GroupedParts, { groupBy: noToolGrouping, children: ({ part }) => {
|
|
54228
|
+
var _a2;
|
|
54229
|
+
switch (part.type) {
|
|
54230
|
+
case "tool-call": {
|
|
54231
|
+
const ToolUI = toolUIsWithNestedMessages[part.toolName];
|
|
54232
|
+
const toolProps = part;
|
|
54233
|
+
return ToolUI ? /* @__PURE__ */ jsx(ToolUI, { ...toolProps }) : /* @__PURE__ */ jsx(ToolFallback, { ...toolProps });
|
|
53741
54234
|
}
|
|
53742
|
-
|
|
54235
|
+
case "reasoning": {
|
|
54236
|
+
const ReasoningRenderer = effectiveReasoningComponent;
|
|
54237
|
+
return /* @__PURE__ */ jsx(ReasoningRenderer, { ...part });
|
|
54238
|
+
}
|
|
54239
|
+
case "text": {
|
|
54240
|
+
const textPart = part;
|
|
54241
|
+
if (textPart.text === "" && ((_a2 = textPart.status) == null ? void 0 : _a2.type) === "running") {
|
|
54242
|
+
return /* @__PURE__ */ jsx(EmptyComponent2, { status: textPart.status });
|
|
54243
|
+
}
|
|
54244
|
+
return /* @__PURE__ */ jsx(TextComponent, { ...textPart });
|
|
54245
|
+
}
|
|
54246
|
+
default:
|
|
54247
|
+
return null;
|
|
53743
54248
|
}
|
|
53744
|
-
|
|
53745
|
-
|
|
53746
|
-
}
|
|
53747
|
-
} }) }),
|
|
54249
|
+
} })
|
|
54250
|
+
] }) }),
|
|
53748
54251
|
/* @__PURE__ */ jsx(MessageError, {})
|
|
53749
54252
|
] }) }),
|
|
53750
54253
|
/* @__PURE__ */ jsx("div", { className: "aui-assistant-message-footer mt-1 ml-2 flex", children: /* @__PURE__ */ jsx(ActionBarComponent, {}) })
|
|
@@ -53752,38 +54255,6 @@ const AthenaAssistantMessage = ({
|
|
|
53752
54255
|
}
|
|
53753
54256
|
);
|
|
53754
54257
|
};
|
|
53755
|
-
const AthenaToolGroup = ({ children, count: count2 }) => {
|
|
53756
|
-
const [expanded, setExpanded] = useState(false);
|
|
53757
|
-
return /* @__PURE__ */ jsxs("div", { className: "my-3 w-full overflow-hidden rounded-xl border border-border/60 bg-background shadow-sm", children: [
|
|
53758
|
-
/* @__PURE__ */ jsxs(
|
|
53759
|
-
"button",
|
|
53760
|
-
{
|
|
53761
|
-
type: "button",
|
|
53762
|
-
onClick: () => setExpanded((v) => !v),
|
|
53763
|
-
className: "flex w-full items-center gap-3 px-4 py-3 text-left transition-colors hover:bg-muted/20",
|
|
53764
|
-
"aria-expanded": expanded,
|
|
53765
|
-
children: [
|
|
53766
|
-
/* @__PURE__ */ jsx("div", { className: "flex size-8 shrink-0 items-center justify-center rounded-lg bg-muted/60 text-muted-foreground", children: /* @__PURE__ */ jsx(Layers, { className: "size-4" }) }),
|
|
53767
|
-
/* @__PURE__ */ jsx("div", { className: "min-w-0 flex-1", children: /* @__PURE__ */ jsxs("span", { className: "text-[13px] font-medium text-foreground", children: [
|
|
53768
|
-
count2,
|
|
53769
|
-
" tool ",
|
|
53770
|
-
count2 === 1 ? "call" : "calls"
|
|
53771
|
-
] }) }),
|
|
53772
|
-
/* @__PURE__ */ jsx(
|
|
53773
|
-
ChevronDown,
|
|
53774
|
-
{
|
|
53775
|
-
className: cn(
|
|
53776
|
-
"size-4 shrink-0 text-muted-foreground transition-transform duration-200",
|
|
53777
|
-
!expanded && "-rotate-90"
|
|
53778
|
-
)
|
|
53779
|
-
}
|
|
53780
|
-
)
|
|
53781
|
-
]
|
|
53782
|
-
}
|
|
53783
|
-
),
|
|
53784
|
-
expanded && /* @__PURE__ */ jsx("div", { className: "border-t border-border/40 bg-muted/5 px-3 pt-1 pb-2 [&>*]:my-2", children })
|
|
53785
|
-
] });
|
|
53786
|
-
};
|
|
53787
54258
|
const AthenaAssistantActionBar = ({ className }) => {
|
|
53788
54259
|
const threadId = useAthenaThreadId();
|
|
53789
54260
|
const { appUrl } = useAthenaConfig();
|