@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.cjs
CHANGED
|
@@ -45056,51 +45056,51 @@ const createLucideIcon = (iconName, iconNode) => {
|
|
|
45056
45056
|
* This source code is licensed under the ISC license.
|
|
45057
45057
|
* See the LICENSE file in the root directory of this source tree.
|
|
45058
45058
|
*/
|
|
45059
|
-
const __iconNode$
|
|
45059
|
+
const __iconNode$19 = [
|
|
45060
45060
|
["path", { d: "M12 5v14", key: "s699le" }],
|
|
45061
45061
|
["path", { d: "m19 12-7 7-7-7", key: "1idqje" }]
|
|
45062
45062
|
];
|
|
45063
|
-
const ArrowDown = createLucideIcon("arrow-down", __iconNode$
|
|
45063
|
+
const ArrowDown = createLucideIcon("arrow-down", __iconNode$19);
|
|
45064
45064
|
/**
|
|
45065
45065
|
* @license lucide-react v0.575.0 - ISC
|
|
45066
45066
|
*
|
|
45067
45067
|
* This source code is licensed under the ISC license.
|
|
45068
45068
|
* See the LICENSE file in the root directory of this source tree.
|
|
45069
45069
|
*/
|
|
45070
|
-
const __iconNode$
|
|
45070
|
+
const __iconNode$18 = [
|
|
45071
45071
|
["path", { d: "m12 19-7-7 7-7", key: "1l729n" }],
|
|
45072
45072
|
["path", { d: "M19 12H5", key: "x3x0zl" }]
|
|
45073
45073
|
];
|
|
45074
|
-
const ArrowLeft = createLucideIcon("arrow-left", __iconNode$
|
|
45074
|
+
const ArrowLeft = createLucideIcon("arrow-left", __iconNode$18);
|
|
45075
45075
|
/**
|
|
45076
45076
|
* @license lucide-react v0.575.0 - ISC
|
|
45077
45077
|
*
|
|
45078
45078
|
* This source code is licensed under the ISC license.
|
|
45079
45079
|
* See the LICENSE file in the root directory of this source tree.
|
|
45080
45080
|
*/
|
|
45081
|
-
const __iconNode$
|
|
45081
|
+
const __iconNode$17 = [
|
|
45082
45082
|
["path", { d: "M5 12h14", key: "1ays0h" }],
|
|
45083
45083
|
["path", { d: "m12 5 7 7-7 7", key: "xquz4c" }]
|
|
45084
45084
|
];
|
|
45085
|
-
const ArrowRight = createLucideIcon("arrow-right", __iconNode$
|
|
45085
|
+
const ArrowRight = createLucideIcon("arrow-right", __iconNode$17);
|
|
45086
45086
|
/**
|
|
45087
45087
|
* @license lucide-react v0.575.0 - ISC
|
|
45088
45088
|
*
|
|
45089
45089
|
* This source code is licensed under the ISC license.
|
|
45090
45090
|
* See the LICENSE file in the root directory of this source tree.
|
|
45091
45091
|
*/
|
|
45092
|
-
const __iconNode$
|
|
45092
|
+
const __iconNode$16 = [
|
|
45093
45093
|
["path", { d: "m5 12 7-7 7 7", key: "hav0vg" }],
|
|
45094
45094
|
["path", { d: "M12 19V5", key: "x0mq9r" }]
|
|
45095
45095
|
];
|
|
45096
|
-
const ArrowUp = createLucideIcon("arrow-up", __iconNode$
|
|
45096
|
+
const ArrowUp = createLucideIcon("arrow-up", __iconNode$16);
|
|
45097
45097
|
/**
|
|
45098
45098
|
* @license lucide-react v0.575.0 - ISC
|
|
45099
45099
|
*
|
|
45100
45100
|
* This source code is licensed under the ISC license.
|
|
45101
45101
|
* See the LICENSE file in the root directory of this source tree.
|
|
45102
45102
|
*/
|
|
45103
|
-
const __iconNode$
|
|
45103
|
+
const __iconNode$15 = [
|
|
45104
45104
|
["path", { d: "M12 7v14", key: "1akyts" }],
|
|
45105
45105
|
[
|
|
45106
45106
|
"path",
|
|
@@ -45110,14 +45110,14 @@ const __iconNode$14 = [
|
|
|
45110
45110
|
}
|
|
45111
45111
|
]
|
|
45112
45112
|
];
|
|
45113
|
-
const BookOpen = createLucideIcon("book-open", __iconNode$
|
|
45113
|
+
const BookOpen = createLucideIcon("book-open", __iconNode$15);
|
|
45114
45114
|
/**
|
|
45115
45115
|
* @license lucide-react v0.575.0 - ISC
|
|
45116
45116
|
*
|
|
45117
45117
|
* This source code is licensed under the ISC license.
|
|
45118
45118
|
* See the LICENSE file in the root directory of this source tree.
|
|
45119
45119
|
*/
|
|
45120
|
-
const __iconNode$
|
|
45120
|
+
const __iconNode$14 = [
|
|
45121
45121
|
[
|
|
45122
45122
|
"path",
|
|
45123
45123
|
{
|
|
@@ -45149,14 +45149,14 @@ const __iconNode$13 = [
|
|
|
45149
45149
|
["path", { d: "m12 8 4.74-2.85", key: "3rx089" }],
|
|
45150
45150
|
["path", { d: "M12 13.5V8", key: "1io7kd" }]
|
|
45151
45151
|
];
|
|
45152
|
-
const Boxes = createLucideIcon("boxes", __iconNode$
|
|
45152
|
+
const Boxes = createLucideIcon("boxes", __iconNode$14);
|
|
45153
45153
|
/**
|
|
45154
45154
|
* @license lucide-react v0.575.0 - ISC
|
|
45155
45155
|
*
|
|
45156
45156
|
* This source code is licensed under the ISC license.
|
|
45157
45157
|
* See the LICENSE file in the root directory of this source tree.
|
|
45158
45158
|
*/
|
|
45159
|
-
const __iconNode$
|
|
45159
|
+
const __iconNode$13 = [
|
|
45160
45160
|
["path", { d: "M12 18V5", key: "adv99a" }],
|
|
45161
45161
|
["path", { d: "M15 13a4.17 4.17 0 0 1-3-4 4.17 4.17 0 0 1-3 4", key: "1e3is1" }],
|
|
45162
45162
|
["path", { d: "M17.598 6.5A3 3 0 1 0 12 5a3 3 0 1 0-5.598 1.5", key: "1gqd8o" }],
|
|
@@ -45166,27 +45166,27 @@ const __iconNode$12 = [
|
|
|
45166
45166
|
["path", { d: "M6 18a4 4 0 0 1-2-7.464", key: "k1g0md" }],
|
|
45167
45167
|
["path", { d: "M6.003 5.125a4 4 0 0 0-2.526 5.77", key: "q97ue3" }]
|
|
45168
45168
|
];
|
|
45169
|
-
const Brain = createLucideIcon("brain", __iconNode$
|
|
45169
|
+
const Brain = createLucideIcon("brain", __iconNode$13);
|
|
45170
45170
|
/**
|
|
45171
45171
|
* @license lucide-react v0.575.0 - ISC
|
|
45172
45172
|
*
|
|
45173
45173
|
* This source code is licensed under the ISC license.
|
|
45174
45174
|
* See the LICENSE file in the root directory of this source tree.
|
|
45175
45175
|
*/
|
|
45176
|
-
const __iconNode$
|
|
45176
|
+
const __iconNode$12 = [
|
|
45177
45177
|
["path", { d: "M12 12h.01", key: "1mp3jc" }],
|
|
45178
45178
|
["path", { d: "M16 6V4a2 2 0 0 0-2-2h-4a2 2 0 0 0-2 2v2", key: "1ksdt3" }],
|
|
45179
45179
|
["path", { d: "M22 13a18.15 18.15 0 0 1-20 0", key: "12hx5q" }],
|
|
45180
45180
|
["rect", { width: "20", height: "14", x: "2", y: "6", rx: "2", key: "i6l2r4" }]
|
|
45181
45181
|
];
|
|
45182
|
-
const BriefcaseBusiness = createLucideIcon("briefcase-business", __iconNode$
|
|
45182
|
+
const BriefcaseBusiness = createLucideIcon("briefcase-business", __iconNode$12);
|
|
45183
45183
|
/**
|
|
45184
45184
|
* @license lucide-react v0.575.0 - ISC
|
|
45185
45185
|
*
|
|
45186
45186
|
* This source code is licensed under the ISC license.
|
|
45187
45187
|
* See the LICENSE file in the root directory of this source tree.
|
|
45188
45188
|
*/
|
|
45189
|
-
const __iconNode$
|
|
45189
|
+
const __iconNode$11 = [
|
|
45190
45190
|
[
|
|
45191
45191
|
"path",
|
|
45192
45192
|
{ 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" }
|
|
@@ -45201,27 +45201,27 @@ const __iconNode$10 = [
|
|
|
45201
45201
|
],
|
|
45202
45202
|
["path", { d: "M7 5V3", key: "1t1388" }]
|
|
45203
45203
|
];
|
|
45204
|
-
const Cable = createLucideIcon("cable", __iconNode$
|
|
45204
|
+
const Cable = createLucideIcon("cable", __iconNode$11);
|
|
45205
45205
|
/**
|
|
45206
45206
|
* @license lucide-react v0.575.0 - ISC
|
|
45207
45207
|
*
|
|
45208
45208
|
* This source code is licensed under the ISC license.
|
|
45209
45209
|
* See the LICENSE file in the root directory of this source tree.
|
|
45210
45210
|
*/
|
|
45211
|
-
const __iconNode
|
|
45211
|
+
const __iconNode$10 = [
|
|
45212
45212
|
["path", { d: "M8 2v4", key: "1cmpym" }],
|
|
45213
45213
|
["path", { d: "M16 2v4", key: "4m81vk" }],
|
|
45214
45214
|
["rect", { width: "18", height: "18", x: "3", y: "4", rx: "2", key: "1hopcy" }],
|
|
45215
45215
|
["path", { d: "M3 10h18", key: "8toen8" }]
|
|
45216
45216
|
];
|
|
45217
|
-
const Calendar = createLucideIcon("calendar", __iconNode
|
|
45217
|
+
const Calendar = createLucideIcon("calendar", __iconNode$10);
|
|
45218
45218
|
/**
|
|
45219
45219
|
* @license lucide-react v0.575.0 - ISC
|
|
45220
45220
|
*
|
|
45221
45221
|
* This source code is licensed under the ISC license.
|
|
45222
45222
|
* See the LICENSE file in the root directory of this source tree.
|
|
45223
45223
|
*/
|
|
45224
|
-
const __iconNode
|
|
45224
|
+
const __iconNode$$ = [
|
|
45225
45225
|
[
|
|
45226
45226
|
"path",
|
|
45227
45227
|
{
|
|
@@ -45231,57 +45231,65 @@ const __iconNode$_ = [
|
|
|
45231
45231
|
],
|
|
45232
45232
|
["circle", { cx: "12", cy: "13", r: "3", key: "1vg3eu" }]
|
|
45233
45233
|
];
|
|
45234
|
-
const Camera = createLucideIcon("camera", __iconNode
|
|
45234
|
+
const Camera = createLucideIcon("camera", __iconNode$$);
|
|
45235
45235
|
/**
|
|
45236
45236
|
* @license lucide-react v0.575.0 - ISC
|
|
45237
45237
|
*
|
|
45238
45238
|
* This source code is licensed under the ISC license.
|
|
45239
45239
|
* See the LICENSE file in the root directory of this source tree.
|
|
45240
45240
|
*/
|
|
45241
|
-
const __iconNode$
|
|
45241
|
+
const __iconNode$_ = [
|
|
45242
45242
|
["path", { d: "M3 3v16a2 2 0 0 0 2 2h16", key: "c24i48" }],
|
|
45243
45243
|
["path", { d: "M7 16h8", key: "srdodz" }],
|
|
45244
45244
|
["path", { d: "M7 11h12", key: "127s9w" }],
|
|
45245
45245
|
["path", { d: "M7 6h3", key: "w9rmul" }]
|
|
45246
45246
|
];
|
|
45247
|
-
const ChartBar = createLucideIcon("chart-bar", __iconNode$
|
|
45247
|
+
const ChartBar = createLucideIcon("chart-bar", __iconNode$_);
|
|
45248
45248
|
/**
|
|
45249
45249
|
* @license lucide-react v0.575.0 - ISC
|
|
45250
45250
|
*
|
|
45251
45251
|
* This source code is licensed under the ISC license.
|
|
45252
45252
|
* See the LICENSE file in the root directory of this source tree.
|
|
45253
45253
|
*/
|
|
45254
|
-
const __iconNode$
|
|
45254
|
+
const __iconNode$Z = [
|
|
45255
45255
|
["path", { d: "M3 3v16a2 2 0 0 0 2 2h16", key: "c24i48" }],
|
|
45256
45256
|
["path", { d: "M18 17V9", key: "2bz60n" }],
|
|
45257
45257
|
["path", { d: "M13 17V5", key: "1frdt8" }],
|
|
45258
45258
|
["path", { d: "M8 17v-3", key: "17ska0" }]
|
|
45259
45259
|
];
|
|
45260
|
-
const ChartColumn = createLucideIcon("chart-column", __iconNode$
|
|
45260
|
+
const ChartColumn = createLucideIcon("chart-column", __iconNode$Z);
|
|
45261
|
+
/**
|
|
45262
|
+
* @license lucide-react v0.575.0 - ISC
|
|
45263
|
+
*
|
|
45264
|
+
* This source code is licensed under the ISC license.
|
|
45265
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
45266
|
+
*/
|
|
45267
|
+
const __iconNode$Y = [["path", { d: "M20 6 9 17l-5-5", key: "1gmf2c" }]];
|
|
45268
|
+
const Check = createLucideIcon("check", __iconNode$Y);
|
|
45261
45269
|
/**
|
|
45262
45270
|
* @license lucide-react v0.575.0 - ISC
|
|
45263
45271
|
*
|
|
45264
45272
|
* This source code is licensed under the ISC license.
|
|
45265
45273
|
* See the LICENSE file in the root directory of this source tree.
|
|
45266
45274
|
*/
|
|
45267
|
-
const __iconNode$X = [["path", { d: "
|
|
45268
|
-
const
|
|
45275
|
+
const __iconNode$X = [["path", { d: "m6 9 6 6 6-6", key: "qrunsl" }]];
|
|
45276
|
+
const ChevronDown = createLucideIcon("chevron-down", __iconNode$X);
|
|
45269
45277
|
/**
|
|
45270
45278
|
* @license lucide-react v0.575.0 - ISC
|
|
45271
45279
|
*
|
|
45272
45280
|
* This source code is licensed under the ISC license.
|
|
45273
45281
|
* See the LICENSE file in the root directory of this source tree.
|
|
45274
45282
|
*/
|
|
45275
|
-
const __iconNode$W = [["path", { d: "
|
|
45276
|
-
const
|
|
45283
|
+
const __iconNode$W = [["path", { d: "m9 18 6-6-6-6", key: "mthhwq" }]];
|
|
45284
|
+
const ChevronRight = createLucideIcon("chevron-right", __iconNode$W);
|
|
45277
45285
|
/**
|
|
45278
45286
|
* @license lucide-react v0.575.0 - ISC
|
|
45279
45287
|
*
|
|
45280
45288
|
* This source code is licensed under the ISC license.
|
|
45281
45289
|
* See the LICENSE file in the root directory of this source tree.
|
|
45282
45290
|
*/
|
|
45283
|
-
const __iconNode$V = [["path", { d: "
|
|
45284
|
-
const
|
|
45291
|
+
const __iconNode$V = [["path", { d: "m18 15-6-6-6 6", key: "153udz" }]];
|
|
45292
|
+
const ChevronUp = createLucideIcon("chevron-up", __iconNode$V);
|
|
45285
45293
|
/**
|
|
45286
45294
|
* @license lucide-react v0.575.0 - ISC
|
|
45287
45295
|
*
|
|
@@ -52722,6 +52730,480 @@ const TOOL_UI_REGISTRY = {
|
|
|
52722
52730
|
run_database_sql: RunSqlToolUI,
|
|
52723
52731
|
run_sql_query_tool: RunSqlToolUI
|
|
52724
52732
|
};
|
|
52733
|
+
const TOOLKIT_THEMES = {
|
|
52734
|
+
Web: { color: "#7BCCFA" },
|
|
52735
|
+
Document: { color: "#4586F9" },
|
|
52736
|
+
"Document (Word)": { color: "#4586F9" },
|
|
52737
|
+
Notebook: { color: "#FFAB00" },
|
|
52738
|
+
Python: { color: "#00A76F" },
|
|
52739
|
+
Spreadsheet: { color: "#00A76F" },
|
|
52740
|
+
Email: { color: "#B584FF" },
|
|
52741
|
+
AOP: { color: "#336DFF" },
|
|
52742
|
+
App: { color: "#7336F5" },
|
|
52743
|
+
"Presentation (PowerPoint)": { color: "#F56B36" },
|
|
52744
|
+
Presentation: { color: "#F56B36" },
|
|
52745
|
+
"User Interface": { color: "#7336F5" },
|
|
52746
|
+
Canvas: { color: "#002542" },
|
|
52747
|
+
Computer: { color: "#3E0042" },
|
|
52748
|
+
Database: { color: "#7336F5" }
|
|
52749
|
+
};
|
|
52750
|
+
const DEFAULT_THEME = { color: "#919EAB" };
|
|
52751
|
+
const CollapsibleGroup = ({ groupKey, indices, children }) => {
|
|
52752
|
+
const isMessageRunning = react$1.useAuiState((s) => {
|
|
52753
|
+
var _a2;
|
|
52754
|
+
return ((_a2 = s.message.status) == null ? void 0 : _a2.type) === "running";
|
|
52755
|
+
});
|
|
52756
|
+
const [userOpened, setOpen] = React.useState();
|
|
52757
|
+
const open = userOpened ?? isMessageRunning;
|
|
52758
|
+
const toolCallCount = react$1.useAuiState((s) => {
|
|
52759
|
+
if (s.message.role !== "assistant") return 0;
|
|
52760
|
+
const parts = s.message.content;
|
|
52761
|
+
if (!parts) return 0;
|
|
52762
|
+
return indices.reduce((acc, idx) => {
|
|
52763
|
+
const part = parts[idx];
|
|
52764
|
+
return (part == null ? void 0 : part.type) === "tool-call" ? acc + 1 : acc;
|
|
52765
|
+
}, 0);
|
|
52766
|
+
});
|
|
52767
|
+
const theme = React.useMemo(
|
|
52768
|
+
() => groupKey ? TOOLKIT_THEMES[groupKey] ?? DEFAULT_THEME : DEFAULT_THEME,
|
|
52769
|
+
[groupKey]
|
|
52770
|
+
);
|
|
52771
|
+
if (!groupKey || indices.length <= 1) return /* @__PURE__ */ jsxRuntime.jsx(jsxRuntime.Fragment, { children });
|
|
52772
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
52773
|
+
"div",
|
|
52774
|
+
{
|
|
52775
|
+
className: "my-4 rounded-2xl border shadow-sm",
|
|
52776
|
+
style: {
|
|
52777
|
+
borderColor: `${theme.color}33`,
|
|
52778
|
+
background: `linear-gradient(to right, ${theme.color}0d, transparent, ${theme.color}0d)`
|
|
52779
|
+
},
|
|
52780
|
+
children: [
|
|
52781
|
+
/* @__PURE__ */ jsxRuntime.jsxs(
|
|
52782
|
+
"button",
|
|
52783
|
+
{
|
|
52784
|
+
type: "button",
|
|
52785
|
+
onClick: () => setOpen(!open),
|
|
52786
|
+
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",
|
|
52787
|
+
"aria-expanded": open,
|
|
52788
|
+
children: [
|
|
52789
|
+
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center gap-3 text-foreground/90", children: [
|
|
52790
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
52791
|
+
"span",
|
|
52792
|
+
{
|
|
52793
|
+
className: "inline-block size-2 rounded-full",
|
|
52794
|
+
style: { backgroundColor: theme.color },
|
|
52795
|
+
"aria-hidden": "true"
|
|
52796
|
+
}
|
|
52797
|
+
),
|
|
52798
|
+
/* @__PURE__ */ jsxRuntime.jsxs("span", { className: "text-sm font-semibold", children: [
|
|
52799
|
+
isMessageRunning ? "Using " : "Used ",
|
|
52800
|
+
groupKey,
|
|
52801
|
+
" Toolkit"
|
|
52802
|
+
] })
|
|
52803
|
+
] }),
|
|
52804
|
+
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center gap-3", children: [
|
|
52805
|
+
/* @__PURE__ */ jsxRuntime.jsxs("span", { className: "text-xs font-medium text-muted-foreground", children: [
|
|
52806
|
+
toolCallCount,
|
|
52807
|
+
" tool ",
|
|
52808
|
+
toolCallCount === 1 ? "call" : "calls"
|
|
52809
|
+
] }),
|
|
52810
|
+
open ? /* @__PURE__ */ jsxRuntime.jsx(ChevronUp, { size: 16 }) : /* @__PURE__ */ jsxRuntime.jsx(ChevronDown, { size: 16 })
|
|
52811
|
+
] })
|
|
52812
|
+
]
|
|
52813
|
+
}
|
|
52814
|
+
),
|
|
52815
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
52816
|
+
"div",
|
|
52817
|
+
{
|
|
52818
|
+
className: cn(
|
|
52819
|
+
"grid overflow-hidden border-t transition-[grid-template-rows] duration-200 ease-in-out",
|
|
52820
|
+
open ? "grid-rows-[1fr]" : "grid-rows-[0fr]"
|
|
52821
|
+
),
|
|
52822
|
+
style: { borderColor: `${theme.color}33` },
|
|
52823
|
+
children: /* @__PURE__ */ jsxRuntime.jsx("div", { className: "overflow-hidden", children: /* @__PURE__ */ jsxRuntime.jsx("div", { className: "space-y-2 px-5 py-4", children }) })
|
|
52824
|
+
}
|
|
52825
|
+
)
|
|
52826
|
+
]
|
|
52827
|
+
}
|
|
52828
|
+
);
|
|
52829
|
+
};
|
|
52830
|
+
const createToolBasedGroupingFunction = (getToolGroupKey) => (parts) => {
|
|
52831
|
+
const groups = [];
|
|
52832
|
+
let currentGroup = null;
|
|
52833
|
+
for (let idx = 0; idx < parts.length; idx++) {
|
|
52834
|
+
const part = parts[idx];
|
|
52835
|
+
if ((part == null ? void 0 : part.type) === "reasoning") {
|
|
52836
|
+
if (currentGroup) {
|
|
52837
|
+
currentGroup.indices.push(idx);
|
|
52838
|
+
} else {
|
|
52839
|
+
groups.push({ groupKey: void 0, indices: [idx] });
|
|
52840
|
+
}
|
|
52841
|
+
continue;
|
|
52842
|
+
}
|
|
52843
|
+
let key;
|
|
52844
|
+
if ((part == null ? void 0 : part.type) === "tool-call" && part.toolName) {
|
|
52845
|
+
key = getToolGroupKey(part.toolName);
|
|
52846
|
+
} else if ((part == null ? void 0 : part.type) === "text") {
|
|
52847
|
+
const prevKey = currentGroup == null ? void 0 : currentGroup.groupKey;
|
|
52848
|
+
let nextKey;
|
|
52849
|
+
for (let lookIdx = idx + 1; lookIdx < parts.length; lookIdx++) {
|
|
52850
|
+
const lookPart = parts[lookIdx];
|
|
52851
|
+
if ((lookPart == null ? void 0 : lookPart.type) === "reasoning" || (lookPart == null ? void 0 : lookPart.type) === "text") continue;
|
|
52852
|
+
if ((lookPart == null ? void 0 : lookPart.type) === "tool-call" && lookPart.toolName) {
|
|
52853
|
+
nextKey = getToolGroupKey(lookPart.toolName);
|
|
52854
|
+
}
|
|
52855
|
+
break;
|
|
52856
|
+
}
|
|
52857
|
+
if (prevKey && nextKey && prevKey === nextKey) {
|
|
52858
|
+
key = prevKey;
|
|
52859
|
+
}
|
|
52860
|
+
}
|
|
52861
|
+
if (currentGroup && currentGroup.groupKey === key) {
|
|
52862
|
+
currentGroup.indices.push(idx);
|
|
52863
|
+
} else {
|
|
52864
|
+
if (currentGroup) groups.push(currentGroup);
|
|
52865
|
+
currentGroup = { groupKey: key, indices: [idx] };
|
|
52866
|
+
}
|
|
52867
|
+
}
|
|
52868
|
+
if (currentGroup) groups.push(currentGroup);
|
|
52869
|
+
return groups;
|
|
52870
|
+
};
|
|
52871
|
+
const TOOL_STATUS_LABELS = {
|
|
52872
|
+
// Document tools
|
|
52873
|
+
read_asset: { running: "Reviewing asset content", complete: "Asset content reviewed" },
|
|
52874
|
+
read_full_asset: { running: "Reviewing asset content", complete: "Asset content reviewed" },
|
|
52875
|
+
create_new_document: { running: "Creating document", complete: "Created document" },
|
|
52876
|
+
create_document_from_markdown: { running: "Creating document", complete: "Created document" },
|
|
52877
|
+
append_markdown_to_athena_document: { running: "Updating document", complete: "Updated document" },
|
|
52878
|
+
replace_markdown_in_athena_document: { running: "Updating document", complete: "Updated document" },
|
|
52879
|
+
convert_athena_doc_to_pdf: { running: "Converting to PDF", complete: "Converted to PDF" },
|
|
52880
|
+
convert_to_pdf: { running: "Converting to PDF", complete: "Converted to PDF" },
|
|
52881
|
+
// Spreadsheet tools
|
|
52882
|
+
create_new_sheet: { running: "Creating spreadsheet", complete: "Created spreadsheet" },
|
|
52883
|
+
update_sheet_range: { running: "Updating spreadsheet", complete: "Updated spreadsheet" },
|
|
52884
|
+
format_sheet_range: { running: "Formatting spreadsheet", complete: "Formatted spreadsheet" },
|
|
52885
|
+
bulk_format_sheet_range: { running: "Formatting spreadsheet ranges", complete: "Formatted spreadsheet ranges" },
|
|
52886
|
+
create_table: { running: "Creating table", complete: "Created table" },
|
|
52887
|
+
update_table: { running: "Updating table", complete: "Updated table" },
|
|
52888
|
+
create_chart: { running: "Creating chart", complete: "Created chart" },
|
|
52889
|
+
update_chart: { running: "Updating chart", complete: "Updated chart" },
|
|
52890
|
+
// Web / search
|
|
52891
|
+
search: { running: "Searching the web", complete: "Web search complete" },
|
|
52892
|
+
browse: { running: "Reading webpage", complete: "Read webpage" },
|
|
52893
|
+
web_search: { running: "Searching the web", complete: "Web search complete" },
|
|
52894
|
+
search_web: { running: "Searching the web", complete: "Web search complete" },
|
|
52895
|
+
web_scrape: { running: "Reading webpage", complete: "Read webpage" },
|
|
52896
|
+
scrape_web: { running: "Reading webpage", complete: "Read webpage" },
|
|
52897
|
+
open_asset_in_workspace: { running: "Opening in workspace", complete: "Opened in workspace" },
|
|
52898
|
+
// Email / calendar
|
|
52899
|
+
create_email_draft: { running: "Drafting email", complete: "Email drafted" },
|
|
52900
|
+
send_email: { running: "Sending email", complete: "Email sent" },
|
|
52901
|
+
unified_email_create_draft: { running: "Drafting email", complete: "Email drafted" },
|
|
52902
|
+
unified_email_send: { running: "Sending email", complete: "Email sent" },
|
|
52903
|
+
unified_email_edit_draft: { running: "Editing email draft", complete: "Draft updated" },
|
|
52904
|
+
search_email: { running: "Searching email", complete: "Email search complete" },
|
|
52905
|
+
unified_email_search: { running: "Searching email", complete: "Email search complete" },
|
|
52906
|
+
// Python / code execution
|
|
52907
|
+
run_python: { running: "Running Python code", complete: "Python execution complete" },
|
|
52908
|
+
run_python_code: { running: "Running Python code", complete: "Python execution complete" },
|
|
52909
|
+
run_sql: { running: "Running database query", complete: "Query complete" },
|
|
52910
|
+
execute_sql: { running: "Running database query", complete: "Query complete" },
|
|
52911
|
+
run_database_sql: { running: "Running database query", complete: "Query complete" },
|
|
52912
|
+
run_sql_query_tool: { running: "Running database query", complete: "Query complete" },
|
|
52913
|
+
// Presentation
|
|
52914
|
+
create_powerpoint_deck: { running: "Creating presentation", complete: "Created presentation" },
|
|
52915
|
+
execute_presentation_code: { running: "Updating presentation", complete: "Updated presentation" },
|
|
52916
|
+
capture_slide_screenshot: { running: "Capturing slide", complete: "Slide captured" },
|
|
52917
|
+
// Notebook
|
|
52918
|
+
create_new_notebook: { running: "Creating notebook", complete: "Created notebook" },
|
|
52919
|
+
run_notebook_cell: { running: "Running notebook cell", complete: "Cell execution complete" },
|
|
52920
|
+
// Media capture
|
|
52921
|
+
capture_moment: { running: "Capturing moment", complete: "Moment captured" }
|
|
52922
|
+
};
|
|
52923
|
+
function getToolStatusLabel(toolName, status) {
|
|
52924
|
+
const entry = TOOL_STATUS_LABELS[toolName];
|
|
52925
|
+
if (entry) return status === "complete" ? entry.complete : entry.running;
|
|
52926
|
+
const formatted = formatToolName(toolName);
|
|
52927
|
+
return status === "complete" ? formatted : `Running ${formatted.toLowerCase()}`;
|
|
52928
|
+
}
|
|
52929
|
+
const DEFAULT_TOOL_TO_TOOLKIT = {
|
|
52930
|
+
// Web
|
|
52931
|
+
search: "Web",
|
|
52932
|
+
browse: "Web",
|
|
52933
|
+
web_search: "Web",
|
|
52934
|
+
search_web: "Web",
|
|
52935
|
+
web_scrape: "Web",
|
|
52936
|
+
scrape_web: "Web",
|
|
52937
|
+
// Document
|
|
52938
|
+
create_new_document: "Document",
|
|
52939
|
+
create_document_from_markdown: "Document",
|
|
52940
|
+
append_markdown_to_athena_document: "Document",
|
|
52941
|
+
replace_markdown_in_athena_document: "Document",
|
|
52942
|
+
delete_blocks_from_athena_document: "Document",
|
|
52943
|
+
convert_athena_doc_to_pdf: "Document",
|
|
52944
|
+
convert_to_pdf: "Document",
|
|
52945
|
+
// Word document (Studio)
|
|
52946
|
+
CreateDocument: "Document (Word)",
|
|
52947
|
+
CreateParagraph: "Document (Word)",
|
|
52948
|
+
OpenDocument: "Document (Word)",
|
|
52949
|
+
execute_word_commands: "Document (Word)",
|
|
52950
|
+
create_new_word_document: "Document (Word)",
|
|
52951
|
+
// Spreadsheet
|
|
52952
|
+
create_new_sheet: "Spreadsheet",
|
|
52953
|
+
update_sheet_range: "Spreadsheet",
|
|
52954
|
+
format_sheet_range: "Spreadsheet",
|
|
52955
|
+
bulk_format_sheet_range: "Spreadsheet",
|
|
52956
|
+
create_table: "Spreadsheet",
|
|
52957
|
+
update_table: "Spreadsheet",
|
|
52958
|
+
create_chart: "Spreadsheet",
|
|
52959
|
+
update_chart: "Spreadsheet",
|
|
52960
|
+
// Studio sheet PTC
|
|
52961
|
+
CreateWorkbook: "Spreadsheet",
|
|
52962
|
+
AddSheet: "Spreadsheet",
|
|
52963
|
+
OpenWorkbook: "Spreadsheet",
|
|
52964
|
+
// Presentation
|
|
52965
|
+
create_powerpoint_deck: "Presentation (PowerPoint)",
|
|
52966
|
+
execute_presentation_code: "Presentation (PowerPoint)",
|
|
52967
|
+
capture_slide_screenshot: "Presentation (PowerPoint)",
|
|
52968
|
+
// Studio presentation PTC
|
|
52969
|
+
CreatePresentation: "Presentation (PowerPoint)",
|
|
52970
|
+
OpenPresentation: "Presentation (PowerPoint)",
|
|
52971
|
+
AddSlide: "Presentation (PowerPoint)",
|
|
52972
|
+
// Notebook
|
|
52973
|
+
create_new_notebook: "Notebook",
|
|
52974
|
+
run_notebook_cell: "Notebook",
|
|
52975
|
+
// Python / code execution
|
|
52976
|
+
run_python_code: "Python",
|
|
52977
|
+
run_python: "Python",
|
|
52978
|
+
// Database
|
|
52979
|
+
run_sql: "Database",
|
|
52980
|
+
run_database_sql: "Database",
|
|
52981
|
+
run_sql_query_tool: "Database",
|
|
52982
|
+
execute_sql: "Database",
|
|
52983
|
+
describe_database: "Database",
|
|
52984
|
+
list_database_tables: "Database",
|
|
52985
|
+
get_database_table_schema: "Database",
|
|
52986
|
+
// Email / calendar
|
|
52987
|
+
search_email: "Email",
|
|
52988
|
+
unified_email_search: "Email",
|
|
52989
|
+
// Media
|
|
52990
|
+
capture_moment: "Computer"
|
|
52991
|
+
};
|
|
52992
|
+
const UNGROUPED_TOOLS = [
|
|
52993
|
+
"read_asset",
|
|
52994
|
+
"read_full_asset",
|
|
52995
|
+
"open_asset_in_workspace",
|
|
52996
|
+
"create_email_draft",
|
|
52997
|
+
"unified_email_create_draft",
|
|
52998
|
+
"unified_email_send",
|
|
52999
|
+
"unified_email_edit_draft"
|
|
53000
|
+
];
|
|
53001
|
+
const defaultGetToolGroupKey = (toolName) => {
|
|
53002
|
+
if (UNGROUPED_TOOLS.includes(toolName)) return void 0;
|
|
53003
|
+
return DEFAULT_TOOL_TO_TOOLKIT[toolName];
|
|
53004
|
+
};
|
|
53005
|
+
const MAX_VISIBLE_STATUSES = 5;
|
|
53006
|
+
const EMPTY_STATUSES = [];
|
|
53007
|
+
function PulsingDots() {
|
|
53008
|
+
return /* @__PURE__ */ jsxRuntime.jsxs("span", { className: "inline-flex items-center gap-[3px]", "aria-hidden": "true", children: [
|
|
53009
|
+
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "h-[5px] w-[5px] rounded-full bg-gray-800 animate-[aui-sg-pulse-dot_1.4s_ease-in-out_infinite]" }),
|
|
53010
|
+
/* @__PURE__ */ jsxRuntime.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]" }),
|
|
53011
|
+
/* @__PURE__ */ jsxRuntime.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]" }),
|
|
53012
|
+
/* @__PURE__ */ jsxRuntime.jsx("style", { children: `
|
|
53013
|
+
@keyframes aui-sg-pulse-dot {
|
|
53014
|
+
0%, 80%, 100% { opacity: 0.2; transform: scale(0.8); }
|
|
53015
|
+
40% { opacity: 1; transform: scale(1); }
|
|
53016
|
+
}
|
|
53017
|
+
@keyframes aui-sg-shimmer-bar {
|
|
53018
|
+
0% { transform: translateX(-100%); }
|
|
53019
|
+
100% { transform: translateX(400%); }
|
|
53020
|
+
}
|
|
53021
|
+
` })
|
|
53022
|
+
] });
|
|
53023
|
+
}
|
|
53024
|
+
const SuperGroupingFinalText = React.memo(function SuperGroupingFinalText2({
|
|
53025
|
+
TextComponent
|
|
53026
|
+
}) {
|
|
53027
|
+
const messageContent = react$1.useAuiState((s) => s.message.content);
|
|
53028
|
+
const isRunning = react$1.useAuiState((s) => {
|
|
53029
|
+
var _a2;
|
|
53030
|
+
return ((_a2 = s.message.status) == null ? void 0 : _a2.type) === "running";
|
|
53031
|
+
});
|
|
53032
|
+
const finalText = React.useMemo(() => {
|
|
53033
|
+
if (!(messageContent == null ? void 0 : messageContent.length)) return null;
|
|
53034
|
+
let lastToolIdx = -1;
|
|
53035
|
+
for (let i = messageContent.length - 1; i >= 0; i--) {
|
|
53036
|
+
if (messageContent[i].type === "tool-call") {
|
|
53037
|
+
lastToolIdx = i;
|
|
53038
|
+
break;
|
|
53039
|
+
}
|
|
53040
|
+
}
|
|
53041
|
+
if (lastToolIdx === -1) return null;
|
|
53042
|
+
const texts = [];
|
|
53043
|
+
for (let i = lastToolIdx + 1; i < messageContent.length; i++) {
|
|
53044
|
+
const part = messageContent[i];
|
|
53045
|
+
if (part.type === "text" && part.text) texts.push(part.text);
|
|
53046
|
+
}
|
|
53047
|
+
return texts.length > 0 ? texts.join("\n\n") : null;
|
|
53048
|
+
}, [messageContent]);
|
|
53049
|
+
if (isRunning || !finalText) return null;
|
|
53050
|
+
return /* @__PURE__ */ jsxRuntime.jsx(TextComponent, { type: "text", text: finalText, status: { type: "complete" } });
|
|
53051
|
+
});
|
|
53052
|
+
const SuperGroupingCard = React.memo(function SuperGroupingCard2({
|
|
53053
|
+
toolUIs,
|
|
53054
|
+
TextComponent,
|
|
53055
|
+
ReasoningComponent,
|
|
53056
|
+
getToolGroupKey = defaultGetToolGroupKey
|
|
53057
|
+
}) {
|
|
53058
|
+
const [showDetails, setShowDetails] = React.useState(false);
|
|
53059
|
+
const handleToggleDetails = React.useCallback(() => setShowDetails((p) => !p), []);
|
|
53060
|
+
const handleHideDetails = React.useCallback(() => setShowDetails(false), []);
|
|
53061
|
+
const messageStatus = react$1.useAuiState((s) => {
|
|
53062
|
+
var _a2;
|
|
53063
|
+
return (_a2 = s.message.status) == null ? void 0 : _a2.type;
|
|
53064
|
+
});
|
|
53065
|
+
const isRunning = messageStatus === "running";
|
|
53066
|
+
const isError = messageStatus === "incomplete";
|
|
53067
|
+
const isComplete = !isRunning && !isError;
|
|
53068
|
+
const groupingFunction = React.useMemo(() => {
|
|
53069
|
+
const inner = createToolBasedGroupingFunction(getToolGroupKey);
|
|
53070
|
+
return (parts) => {
|
|
53071
|
+
const lastToolIdx = parts.findLastIndex((p) => (p == null ? void 0 : p.type) === "tool-call");
|
|
53072
|
+
return inner(parts).map((g) => ({
|
|
53073
|
+
...g,
|
|
53074
|
+
indices: g.indices.filter((i) => {
|
|
53075
|
+
var _a2;
|
|
53076
|
+
return ((_a2 = parts[i]) == null ? void 0 : _a2.type) !== "text" || i <= lastToolIdx;
|
|
53077
|
+
})
|
|
53078
|
+
})).filter((g) => g.indices.length > 0);
|
|
53079
|
+
};
|
|
53080
|
+
}, [getToolGroupKey]);
|
|
53081
|
+
const messageContent = react$1.useAuiState((s) => s.message.content);
|
|
53082
|
+
const toolStatuses = React.useMemo(() => {
|
|
53083
|
+
if (!messageContent) return EMPTY_STATUSES;
|
|
53084
|
+
const statuses = [];
|
|
53085
|
+
for (const part of messageContent) {
|
|
53086
|
+
if (part.type === "tool-call") {
|
|
53087
|
+
const isToolComplete = part.result !== void 0;
|
|
53088
|
+
statuses.push({
|
|
53089
|
+
toolName: part.toolName,
|
|
53090
|
+
label: getToolStatusLabel(part.toolName, isToolComplete ? "complete" : "running"),
|
|
53091
|
+
isComplete: isToolComplete
|
|
53092
|
+
});
|
|
53093
|
+
}
|
|
53094
|
+
}
|
|
53095
|
+
return statuses.length > 0 ? statuses : EMPTY_STATUSES;
|
|
53096
|
+
}, [messageContent]);
|
|
53097
|
+
const hasToolCalls = toolStatuses.length > 0;
|
|
53098
|
+
const visibleStatuses = React.useMemo(
|
|
53099
|
+
() => toolStatuses.length <= MAX_VISIBLE_STATUSES ? toolStatuses : toolStatuses.slice(-MAX_VISIBLE_STATUSES),
|
|
53100
|
+
[toolStatuses]
|
|
53101
|
+
);
|
|
53102
|
+
const hiddenCount = toolStatuses.length - visibleStatuses.length;
|
|
53103
|
+
const latestStatusLine = React.useMemo(() => {
|
|
53104
|
+
var _a2;
|
|
53105
|
+
if (!hasToolCalls) return "Planning approach";
|
|
53106
|
+
return ((_a2 = toolStatuses[toolStatuses.length - 1]) == null ? void 0 : _a2.label) ?? "Working";
|
|
53107
|
+
}, [toolStatuses, hasToolCalls]);
|
|
53108
|
+
const detailsPanel = /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "space-y-2 border-t border-border/60 bg-background/80 px-4 py-4", children: [
|
|
53109
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
53110
|
+
react$1.MessagePrimitive.Unstable_PartsGrouped,
|
|
53111
|
+
{
|
|
53112
|
+
groupingFunction,
|
|
53113
|
+
components: {
|
|
53114
|
+
tools: { by_name: toolUIs, Fallback: ToolFallback },
|
|
53115
|
+
Text: TextComponent,
|
|
53116
|
+
...ReasoningComponent ? { Reasoning: ReasoningComponent } : {},
|
|
53117
|
+
Group: CollapsibleGroup
|
|
53118
|
+
}
|
|
53119
|
+
}
|
|
53120
|
+
),
|
|
53121
|
+
/* @__PURE__ */ jsxRuntime.jsxs(
|
|
53122
|
+
"button",
|
|
53123
|
+
{
|
|
53124
|
+
type: "button",
|
|
53125
|
+
onClick: handleHideDetails,
|
|
53126
|
+
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",
|
|
53127
|
+
children: [
|
|
53128
|
+
/* @__PURE__ */ jsxRuntime.jsx(ChevronUp, { className: "size-3" }),
|
|
53129
|
+
"Hide details"
|
|
53130
|
+
]
|
|
53131
|
+
}
|
|
53132
|
+
)
|
|
53133
|
+
] });
|
|
53134
|
+
if (isComplete && hasToolCalls) {
|
|
53135
|
+
return /* @__PURE__ */ jsxRuntime.jsxs("section", { className: "my-3 overflow-hidden rounded-2xl border border-border/60 bg-muted/10", children: [
|
|
53136
|
+
/* @__PURE__ */ jsxRuntime.jsxs(
|
|
53137
|
+
"button",
|
|
53138
|
+
{
|
|
53139
|
+
type: "button",
|
|
53140
|
+
onClick: handleToggleDetails,
|
|
53141
|
+
"aria-expanded": showDetails,
|
|
53142
|
+
className: "flex w-full items-center justify-between px-4 py-3 text-left transition-colors hover:bg-muted/30",
|
|
53143
|
+
children: [
|
|
53144
|
+
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center gap-2", children: [
|
|
53145
|
+
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "flex size-4 items-center justify-center text-emerald-500", "aria-hidden": "true", children: /* @__PURE__ */ jsxRuntime.jsx("svg", { width: "10", height: "10", viewBox: "0 0 12 12", fill: "none", children: /* @__PURE__ */ jsxRuntime.jsx("path", { d: "M10 3L4.5 8.5L2 6", stroke: "currentColor", strokeWidth: "1.5", strokeLinecap: "round", strokeLinejoin: "round" }) }) }),
|
|
53146
|
+
/* @__PURE__ */ jsxRuntime.jsxs("span", { className: "text-[12px] text-muted-foreground", children: [
|
|
53147
|
+
"Used ",
|
|
53148
|
+
toolStatuses.length,
|
|
53149
|
+
" ",
|
|
53150
|
+
toolStatuses.length === 1 ? "tool" : "tools"
|
|
53151
|
+
] })
|
|
53152
|
+
] }),
|
|
53153
|
+
showDetails ? /* @__PURE__ */ jsxRuntime.jsx(ChevronDown, { className: "size-3.5 text-muted-foreground/70" }) : /* @__PURE__ */ jsxRuntime.jsx(ChevronRight, { className: "size-3.5 text-muted-foreground/70" })
|
|
53154
|
+
]
|
|
53155
|
+
}
|
|
53156
|
+
),
|
|
53157
|
+
showDetails && detailsPanel
|
|
53158
|
+
] });
|
|
53159
|
+
}
|
|
53160
|
+
if (isComplete) return null;
|
|
53161
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
53162
|
+
"section",
|
|
53163
|
+
{
|
|
53164
|
+
"aria-busy": isRunning ? "true" : "false",
|
|
53165
|
+
"aria-describedby": "aui-sg-status",
|
|
53166
|
+
className: cn(
|
|
53167
|
+
"my-3 overflow-hidden rounded-2xl border transition-colors duration-200",
|
|
53168
|
+
isError ? "border-destructive/30 bg-destructive/5" : "border-border/70 bg-muted/10"
|
|
53169
|
+
),
|
|
53170
|
+
children: [
|
|
53171
|
+
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "px-4 pt-4 pb-2", children: /* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex items-center justify-between", children: /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center gap-2", children: [
|
|
53172
|
+
/* @__PURE__ */ jsxRuntime.jsx("h3", { className: "text-[13px] font-semibold text-foreground", children: isError ? "Something went wrong" : "Athena is working" }),
|
|
53173
|
+
isRunning && !isError && /* @__PURE__ */ jsxRuntime.jsx(PulsingDots, {})
|
|
53174
|
+
] }) }) }),
|
|
53175
|
+
isRunning && /* @__PURE__ */ jsxRuntime.jsx("div", { className: "px-4 pb-1", children: /* @__PURE__ */ jsxRuntime.jsx("div", { className: "h-[2px] w-full overflow-hidden rounded-full bg-muted/40", children: /* @__PURE__ */ jsxRuntime.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]" }) }) }),
|
|
53176
|
+
/* @__PURE__ */ jsxRuntime.jsx("output", { id: "aui-sg-status", "aria-live": "polite", "aria-atomic": "true", className: "sr-only", children: latestStatusLine }),
|
|
53177
|
+
hasToolCalls && /* @__PURE__ */ jsxRuntime.jsxs("ul", { className: "space-y-1 px-4 pt-1.5 pb-1", "aria-label": "Work status updates", children: [
|
|
53178
|
+
hiddenCount > 0 && /* @__PURE__ */ jsxRuntime.jsxs("li", { className: "pl-[22px] text-[11px] text-muted-foreground/70", children: [
|
|
53179
|
+
hiddenCount,
|
|
53180
|
+
" earlier ",
|
|
53181
|
+
hiddenCount === 1 ? "step" : "steps"
|
|
53182
|
+
] }),
|
|
53183
|
+
visibleStatuses.map((s, i) => /* @__PURE__ */ jsxRuntime.jsxs("li", { className: "flex items-center gap-2 text-[12px]", children: [
|
|
53184
|
+
s.isComplete ? /* @__PURE__ */ jsxRuntime.jsx("span", { className: "flex size-3.5 items-center justify-center text-emerald-500", "aria-hidden": "true", children: /* @__PURE__ */ jsxRuntime.jsx("svg", { width: "10", height: "10", viewBox: "0 0 12 12", fill: "none", children: /* @__PURE__ */ jsxRuntime.jsx("path", { d: "M10 3L4.5 8.5L2 6", stroke: "currentColor", strokeWidth: "1.5", strokeLinecap: "round", strokeLinejoin: "round" }) }) }) : /* @__PURE__ */ jsxRuntime.jsx("span", { className: "flex size-3.5 items-center justify-center", "aria-hidden": "true", children: /* @__PURE__ */ jsxRuntime.jsx("span", { className: "size-1.5 animate-pulse rounded-full bg-blue-500" }) }),
|
|
53185
|
+
/* @__PURE__ */ jsxRuntime.jsx("span", { className: cn("leading-relaxed", s.isComplete ? "text-muted-foreground/70" : "text-foreground/80"), children: s.label })
|
|
53186
|
+
] }, `${s.toolName}-${i}`))
|
|
53187
|
+
] }),
|
|
53188
|
+
!hasToolCalls && /* @__PURE__ */ jsxRuntime.jsx("div", { className: "px-4 pt-1 pb-2", children: /* @__PURE__ */ jsxRuntime.jsx("span", { className: "shimmer text-[12px] text-muted-foreground", children: "Planning approach..." }) }),
|
|
53189
|
+
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "px-4 pb-3 pt-0.5", children: /* @__PURE__ */ jsxRuntime.jsxs(
|
|
53190
|
+
"button",
|
|
53191
|
+
{
|
|
53192
|
+
type: "button",
|
|
53193
|
+
onClick: handleToggleDetails,
|
|
53194
|
+
"aria-expanded": showDetails,
|
|
53195
|
+
className: "flex items-center gap-1 text-[11px] font-medium text-muted-foreground transition-colors hover:text-foreground",
|
|
53196
|
+
children: [
|
|
53197
|
+
showDetails ? /* @__PURE__ */ jsxRuntime.jsx(ChevronDown, { className: "size-3" }) : /* @__PURE__ */ jsxRuntime.jsx(ChevronRight, { className: "size-3" }),
|
|
53198
|
+
showDetails ? "Hide details" : "Show details"
|
|
53199
|
+
]
|
|
53200
|
+
}
|
|
53201
|
+
) }),
|
|
53202
|
+
showDetails && detailsPanel
|
|
53203
|
+
]
|
|
53204
|
+
}
|
|
53205
|
+
);
|
|
53206
|
+
});
|
|
52725
53207
|
const falsyToString = (value) => typeof value === "boolean" ? `${value}` : value === 0 ? "0" : value;
|
|
52726
53208
|
const cx = clsx;
|
|
52727
53209
|
const cva = (base2, config2) => (props) => {
|
|
@@ -53648,6 +54130,17 @@ const AthenaAssistantMessageEmpty = ({ status }) => {
|
|
|
53648
54130
|
if ((status == null ? void 0 : status.type) !== "running") return null;
|
|
53649
54131
|
return /* @__PURE__ */ jsxRuntime.jsx("span", { className: "shimmer text-[13px] text-muted-foreground", children: "Thinking..." });
|
|
53650
54132
|
};
|
|
54133
|
+
const AthenaMessageEmptyIndicator = ({
|
|
54134
|
+
EmptyComponent: EmptyComponent2
|
|
54135
|
+
}) => {
|
|
54136
|
+
const hasParts = react$1.useAuiState((s) => s.message.parts.length > 0);
|
|
54137
|
+
const isRunning = react$1.useAuiState((s) => {
|
|
54138
|
+
var _a2;
|
|
54139
|
+
return ((_a2 = s.message.status) == null ? void 0 : _a2.type) === "running";
|
|
54140
|
+
});
|
|
54141
|
+
if (hasParts || !isRunning) return null;
|
|
54142
|
+
return /* @__PURE__ */ jsxRuntime.jsx(EmptyComponent2, { status: { type: "running" } });
|
|
54143
|
+
};
|
|
53651
54144
|
const AthenaReasoningPart = ({
|
|
53652
54145
|
text: text2,
|
|
53653
54146
|
status,
|
|
@@ -53723,7 +54216,6 @@ const AthenaReasoningPart = ({
|
|
|
53723
54216
|
}
|
|
53724
54217
|
);
|
|
53725
54218
|
};
|
|
53726
|
-
const groupAdjacentToolCalls = (part) => part.type === "tool-call" ? ["group-tool"] : null;
|
|
53727
54219
|
const noToolGrouping = () => null;
|
|
53728
54220
|
const AthenaAssistantMessage = ({
|
|
53729
54221
|
toolUIs,
|
|
@@ -53760,31 +54252,42 @@ const AthenaAssistantMessage = ({
|
|
|
53760
54252
|
"data-role": "assistant",
|
|
53761
54253
|
children: [
|
|
53762
54254
|
/* @__PURE__ */ jsxRuntime.jsx(AthenaReasoningTextComponentContext.Provider, { value: TextComponent, children: /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "aui-assistant-message-content wrap-break-word px-2 text-foreground leading-relaxed", children: [
|
|
53763
|
-
/* @__PURE__ */ jsxRuntime.jsx(NestedPtcComponentsProvider, { components: nestedPtcComponents, children: /* @__PURE__ */ jsxRuntime.
|
|
53764
|
-
|
|
53765
|
-
|
|
53766
|
-
|
|
53767
|
-
|
|
53768
|
-
|
|
53769
|
-
|
|
53770
|
-
const toolProps = part;
|
|
53771
|
-
return ToolUI ? /* @__PURE__ */ jsxRuntime.jsx(ToolUI, { ...toolProps }) : /* @__PURE__ */ jsxRuntime.jsx(ToolFallback, { ...toolProps });
|
|
53772
|
-
}
|
|
53773
|
-
case "reasoning": {
|
|
53774
|
-
const ReasoningRenderer = effectiveReasoningComponent;
|
|
53775
|
-
return /* @__PURE__ */ jsxRuntime.jsx(ReasoningRenderer, { ...part });
|
|
54255
|
+
/* @__PURE__ */ jsxRuntime.jsx(NestedPtcComponentsProvider, { components: nestedPtcComponents, children: groupToolCalls ? /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex flex-col space-y-2", children: [
|
|
54256
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
54257
|
+
SuperGroupingCard,
|
|
54258
|
+
{
|
|
54259
|
+
toolUIs: toolUIsWithNestedMessages,
|
|
54260
|
+
TextComponent,
|
|
54261
|
+
ReasoningComponent: effectiveReasoningComponent
|
|
53776
54262
|
}
|
|
53777
|
-
|
|
53778
|
-
|
|
53779
|
-
|
|
53780
|
-
|
|
54263
|
+
),
|
|
54264
|
+
/* @__PURE__ */ jsxRuntime.jsx(SuperGroupingFinalText, { TextComponent })
|
|
54265
|
+
] }) : /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
|
|
54266
|
+
/* @__PURE__ */ jsxRuntime.jsx(AthenaMessageEmptyIndicator, { EmptyComponent: EmptyComponent2 }),
|
|
54267
|
+
/* @__PURE__ */ jsxRuntime.jsx(react$1.MessagePrimitive.GroupedParts, { groupBy: noToolGrouping, children: ({ part }) => {
|
|
54268
|
+
var _a2;
|
|
54269
|
+
switch (part.type) {
|
|
54270
|
+
case "tool-call": {
|
|
54271
|
+
const ToolUI = toolUIsWithNestedMessages[part.toolName];
|
|
54272
|
+
const toolProps = part;
|
|
54273
|
+
return ToolUI ? /* @__PURE__ */ jsxRuntime.jsx(ToolUI, { ...toolProps }) : /* @__PURE__ */ jsxRuntime.jsx(ToolFallback, { ...toolProps });
|
|
53781
54274
|
}
|
|
53782
|
-
|
|
54275
|
+
case "reasoning": {
|
|
54276
|
+
const ReasoningRenderer = effectiveReasoningComponent;
|
|
54277
|
+
return /* @__PURE__ */ jsxRuntime.jsx(ReasoningRenderer, { ...part });
|
|
54278
|
+
}
|
|
54279
|
+
case "text": {
|
|
54280
|
+
const textPart = part;
|
|
54281
|
+
if (textPart.text === "" && ((_a2 = textPart.status) == null ? void 0 : _a2.type) === "running") {
|
|
54282
|
+
return /* @__PURE__ */ jsxRuntime.jsx(EmptyComponent2, { status: textPart.status });
|
|
54283
|
+
}
|
|
54284
|
+
return /* @__PURE__ */ jsxRuntime.jsx(TextComponent, { ...textPart });
|
|
54285
|
+
}
|
|
54286
|
+
default:
|
|
54287
|
+
return null;
|
|
53783
54288
|
}
|
|
53784
|
-
|
|
53785
|
-
|
|
53786
|
-
}
|
|
53787
|
-
} }) }),
|
|
54289
|
+
} })
|
|
54290
|
+
] }) }),
|
|
53788
54291
|
/* @__PURE__ */ jsxRuntime.jsx(MessageError, {})
|
|
53789
54292
|
] }) }),
|
|
53790
54293
|
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "aui-assistant-message-footer mt-1 ml-2 flex", children: /* @__PURE__ */ jsxRuntime.jsx(ActionBarComponent, {}) })
|
|
@@ -53792,38 +54295,6 @@ const AthenaAssistantMessage = ({
|
|
|
53792
54295
|
}
|
|
53793
54296
|
);
|
|
53794
54297
|
};
|
|
53795
|
-
const AthenaToolGroup = ({ children, count: count2 }) => {
|
|
53796
|
-
const [expanded, setExpanded] = React.useState(false);
|
|
53797
|
-
return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "my-3 w-full overflow-hidden rounded-xl border border-border/60 bg-background shadow-sm", children: [
|
|
53798
|
-
/* @__PURE__ */ jsxRuntime.jsxs(
|
|
53799
|
-
"button",
|
|
53800
|
-
{
|
|
53801
|
-
type: "button",
|
|
53802
|
-
onClick: () => setExpanded((v) => !v),
|
|
53803
|
-
className: "flex w-full items-center gap-3 px-4 py-3 text-left transition-colors hover:bg-muted/20",
|
|
53804
|
-
"aria-expanded": expanded,
|
|
53805
|
-
children: [
|
|
53806
|
-
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex size-8 shrink-0 items-center justify-center rounded-lg bg-muted/60 text-muted-foreground", children: /* @__PURE__ */ jsxRuntime.jsx(Layers, { className: "size-4" }) }),
|
|
53807
|
-
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "min-w-0 flex-1", children: /* @__PURE__ */ jsxRuntime.jsxs("span", { className: "text-[13px] font-medium text-foreground", children: [
|
|
53808
|
-
count2,
|
|
53809
|
-
" tool ",
|
|
53810
|
-
count2 === 1 ? "call" : "calls"
|
|
53811
|
-
] }) }),
|
|
53812
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
53813
|
-
ChevronDown,
|
|
53814
|
-
{
|
|
53815
|
-
className: cn(
|
|
53816
|
-
"size-4 shrink-0 text-muted-foreground transition-transform duration-200",
|
|
53817
|
-
!expanded && "-rotate-90"
|
|
53818
|
-
)
|
|
53819
|
-
}
|
|
53820
|
-
)
|
|
53821
|
-
]
|
|
53822
|
-
}
|
|
53823
|
-
),
|
|
53824
|
-
expanded && /* @__PURE__ */ jsxRuntime.jsx("div", { className: "border-t border-border/40 bg-muted/5 px-3 pt-1 pb-2 [&>*]:my-2", children })
|
|
53825
|
-
] });
|
|
53826
|
-
};
|
|
53827
54298
|
const AthenaAssistantActionBar = ({ className }) => {
|
|
53828
54299
|
const threadId = useAthenaThreadId();
|
|
53829
54300
|
const { appUrl } = useAthenaConfig();
|