@athenaintel/react 0.11.1 → 0.11.3

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 CHANGED
@@ -72,7 +72,7 @@ function _interopNamespaceDefault(e) {
72
72
  }
73
73
  const React__namespace = /* @__PURE__ */ _interopNamespaceDefault(React);
74
74
  const ReactDOM__namespace = /* @__PURE__ */ _interopNamespaceDefault(ReactDOM);
75
- const version$1 = "0.11.1";
75
+ const version$1 = "0.11.3";
76
76
  const packageJson = {
77
77
  version: version$1
78
78
  };
@@ -11588,7 +11588,7 @@ const sanitizeConnectionMessage = (message) => {
11588
11588
  }).join("").replace(/\s+/g, " ").trim();
11589
11589
  return printable ? printable.slice(0, 200) : void 0;
11590
11590
  };
11591
- function projectDeepAgentConnection(connection) {
11591
+ function projectDeepAgentConnection(connection, { awaitingFirstSend = false } = {}) {
11592
11592
  if (connection.status === "reconnecting") {
11593
11593
  const message = connection.message === void 0 ? void 0 : sanitizeConnectionMessage(connection.message);
11594
11594
  return {
@@ -11605,6 +11605,7 @@ function projectDeepAgentConnection(connection) {
11605
11605
  ...message !== void 0 && { message }
11606
11606
  };
11607
11607
  }
11608
+ if (connection.status === "connecting" && awaitingFirstSend) return { status: "ready" };
11608
11609
  return { status: connection.status };
11609
11610
  }
11610
11611
  const buildOptimisticHumanContent = (parts) => {
@@ -12029,6 +12030,9 @@ function useDeepAgentThread({
12029
12030
  const preloadRef = React.useRef({ threadId, preload: isNewChat });
12030
12031
  if (preloadRef.current.threadId !== threadId)
12031
12032
  preloadRef.current = { threadId, preload: isNewChat };
12033
+ const awaitingFirstSendRef = React.useRef({ threadId, awaiting: isNewChat });
12034
+ if (awaitingFirstSendRef.current.threadId !== threadId)
12035
+ awaitingFirstSendRef.current = { threadId, awaiting: isNewChat };
12032
12036
  return reactStatewire.StatewireThread({
12033
12037
  // New threads preload an empty runs mount and project "ready" — the
12034
12038
  // composer is interactive before the stream attaches and pre-attach sends
@@ -12088,7 +12092,7 @@ function useDeepAgentThread({
12088
12092
  // former `runs: true` opt-in is gone) — the converter only maps app-owned
12089
12093
  // keys, including the `run/stop` runId stamp the lib projects itself.
12090
12094
  converter: (state, meta) => {
12091
- var _a3, _b2;
12095
+ var _a3, _b2, _c2, _d2;
12092
12096
  if (authDenialRef.current.attachId !== attachIdRef.current) {
12093
12097
  authDenialRef.current = {
12094
12098
  attachId: attachIdRef.current,
@@ -12107,7 +12111,15 @@ function useDeepAgentThread({
12107
12111
  );
12108
12112
  });
12109
12113
  }
12110
- const connection = projectDeepAgentConnection(meta.connection);
12114
+ if (awaitingFirstSendRef.current.awaiting && ((((_a3 = state == null ? void 0 : state.runs) == null ? void 0 : _a3.length) ?? 0) > 0 || (((_b2 = state == null ? void 0 : state.messages) == null ? void 0 : _b2.length) ?? 0) > 0)) {
12115
+ awaitingFirstSendRef.current = {
12116
+ threadId: awaitingFirstSendRef.current.threadId,
12117
+ awaiting: false
12118
+ };
12119
+ }
12120
+ const connection = projectDeepAgentConnection(meta.connection, {
12121
+ awaitingFirstSend: awaitingFirstSendRef.current.awaiting
12122
+ });
12111
12123
  const previous = lastConnectionRef.current;
12112
12124
  if ((previous == null ? void 0 : previous.threadId) !== attachId || previous.connection.status !== connection.status || previous.connection.cause !== connection.cause || previous.connection.message !== connection.message || previous.connection.attempt !== connection.attempt) {
12113
12125
  const update = { threadId: attachId, connection };
@@ -12118,7 +12130,7 @@ function useDeepAgentThread({
12118
12130
  (_a4 = onConnectionChangeRef.current) == null ? void 0 : _a4.call(onConnectionChangeRef, connection);
12119
12131
  });
12120
12132
  }
12121
- return converter(state, ((_b2 = (_a3 = state == null ? void 0 : state.runs) == null ? void 0 : _a3[0]) == null ? void 0 : _b2.status) === "running");
12133
+ return converter(state, ((_d2 = (_c2 = state == null ? void 0 : state.runs) == null ? void 0 : _c2[0]) == null ? void 0 : _d2.status) === "running");
12122
12134
  },
12123
12135
  // Makes the server's dispatch record concrete in state (after the
12124
12136
  // optimistic folds); the lib's post-converter dispatch merge turns off.
@@ -16562,6 +16574,9 @@ function TooltipContent({
16562
16574
  "data-slot": "tooltip-content",
16563
16575
  sideOffset,
16564
16576
  className: cn(
16577
+ // Portaled outside the provider wrapper — carries the SDK scope
16578
+ // classes itself so tokens and the scoped reset still apply.
16579
+ "athena-sdk athena-sdk-chrome",
16565
16580
  "bg-foreground text-background animate-in fade-in-0 zoom-in-95 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 z-50 w-fit origin-(--radix-tooltip-content-transform-origin) rounded-md px-3 py-1.5 text-xs text-balance",
16566
16581
  className
16567
16582
  ),
@@ -21021,10 +21036,14 @@ function AthenaProvider({
21021
21036
  );
21022
21037
  }
21023
21038
  let result = /* @__PURE__ */ jsxRuntime.jsx(PostHogProvider, { config: posthogConfig, children: inner });
21024
- if (themeStyleVars) {
21025
- result = /* @__PURE__ */ jsxRuntime.jsx("div", { className: "athena-themed", style: themeStyleVars, children: result });
21026
- }
21027
- return result;
21039
+ return /* @__PURE__ */ jsxRuntime.jsx(
21040
+ "div",
21041
+ {
21042
+ className: themeStyleVars ? "athena-sdk athena-themed" : "athena-sdk",
21043
+ style: themeStyleVars,
21044
+ children: result
21045
+ }
21046
+ );
21028
21047
  }
21029
21048
  function OrderedMap(content) {
21030
21049
  this.content = content;
@@ -51634,63 +51653,63 @@ const createLucideIcon = (iconName, iconNode) => {
51634
51653
  * This source code is licensed under the ISC license.
51635
51654
  * See the LICENSE file in the root directory of this source tree.
51636
51655
  */
51637
- const __iconNode$1d = [
51656
+ const __iconNode$1e = [
51638
51657
  ["rect", { width: "20", height: "5", x: "2", y: "3", rx: "1", key: "1wp1u1" }],
51639
51658
  ["path", { d: "M4 8v11a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8", key: "1s80jp" }],
51640
51659
  ["path", { d: "M10 12h4", key: "a56b0p" }]
51641
51660
  ];
51642
- const Archive = createLucideIcon("archive", __iconNode$1d);
51661
+ const Archive = createLucideIcon("archive", __iconNode$1e);
51643
51662
  /**
51644
51663
  * @license lucide-react v0.575.0 - ISC
51645
51664
  *
51646
51665
  * This source code is licensed under the ISC license.
51647
51666
  * See the LICENSE file in the root directory of this source tree.
51648
51667
  */
51649
- const __iconNode$1c = [
51668
+ const __iconNode$1d = [
51650
51669
  ["path", { d: "M12 5v14", key: "s699le" }],
51651
51670
  ["path", { d: "m19 12-7 7-7-7", key: "1idqje" }]
51652
51671
  ];
51653
- const ArrowDown = createLucideIcon("arrow-down", __iconNode$1c);
51672
+ const ArrowDown = createLucideIcon("arrow-down", __iconNode$1d);
51654
51673
  /**
51655
51674
  * @license lucide-react v0.575.0 - ISC
51656
51675
  *
51657
51676
  * This source code is licensed under the ISC license.
51658
51677
  * See the LICENSE file in the root directory of this source tree.
51659
51678
  */
51660
- const __iconNode$1b = [
51679
+ const __iconNode$1c = [
51661
51680
  ["path", { d: "m12 19-7-7 7-7", key: "1l729n" }],
51662
51681
  ["path", { d: "M19 12H5", key: "x3x0zl" }]
51663
51682
  ];
51664
- const ArrowLeft = createLucideIcon("arrow-left", __iconNode$1b);
51683
+ const ArrowLeft = createLucideIcon("arrow-left", __iconNode$1c);
51665
51684
  /**
51666
51685
  * @license lucide-react v0.575.0 - ISC
51667
51686
  *
51668
51687
  * This source code is licensed under the ISC license.
51669
51688
  * See the LICENSE file in the root directory of this source tree.
51670
51689
  */
51671
- const __iconNode$1a = [
51690
+ const __iconNode$1b = [
51672
51691
  ["path", { d: "M5 12h14", key: "1ays0h" }],
51673
51692
  ["path", { d: "m12 5 7 7-7 7", key: "xquz4c" }]
51674
51693
  ];
51675
- const ArrowRight = createLucideIcon("arrow-right", __iconNode$1a);
51694
+ const ArrowRight = createLucideIcon("arrow-right", __iconNode$1b);
51676
51695
  /**
51677
51696
  * @license lucide-react v0.575.0 - ISC
51678
51697
  *
51679
51698
  * This source code is licensed under the ISC license.
51680
51699
  * See the LICENSE file in the root directory of this source tree.
51681
51700
  */
51682
- const __iconNode$19 = [
51701
+ const __iconNode$1a = [
51683
51702
  ["path", { d: "m5 12 7-7 7 7", key: "hav0vg" }],
51684
51703
  ["path", { d: "M12 19V5", key: "x0mq9r" }]
51685
51704
  ];
51686
- const ArrowUp = createLucideIcon("arrow-up", __iconNode$19);
51705
+ const ArrowUp = createLucideIcon("arrow-up", __iconNode$1a);
51687
51706
  /**
51688
51707
  * @license lucide-react v0.575.0 - ISC
51689
51708
  *
51690
51709
  * This source code is licensed under the ISC license.
51691
51710
  * See the LICENSE file in the root directory of this source tree.
51692
51711
  */
51693
- const __iconNode$18 = [
51712
+ const __iconNode$19 = [
51694
51713
  ["path", { d: "M12 7v14", key: "1akyts" }],
51695
51714
  [
51696
51715
  "path",
@@ -51700,14 +51719,14 @@ const __iconNode$18 = [
51700
51719
  }
51701
51720
  ]
51702
51721
  ];
51703
- const BookOpen = createLucideIcon("book-open", __iconNode$18);
51722
+ const BookOpen = createLucideIcon("book-open", __iconNode$19);
51704
51723
  /**
51705
51724
  * @license lucide-react v0.575.0 - ISC
51706
51725
  *
51707
51726
  * This source code is licensed under the ISC license.
51708
51727
  * See the LICENSE file in the root directory of this source tree.
51709
51728
  */
51710
- const __iconNode$17 = [
51729
+ const __iconNode$18 = [
51711
51730
  [
51712
51731
  "path",
51713
51732
  {
@@ -51739,14 +51758,14 @@ const __iconNode$17 = [
51739
51758
  ["path", { d: "m12 8 4.74-2.85", key: "3rx089" }],
51740
51759
  ["path", { d: "M12 13.5V8", key: "1io7kd" }]
51741
51760
  ];
51742
- const Boxes = createLucideIcon("boxes", __iconNode$17);
51761
+ const Boxes = createLucideIcon("boxes", __iconNode$18);
51743
51762
  /**
51744
51763
  * @license lucide-react v0.575.0 - ISC
51745
51764
  *
51746
51765
  * This source code is licensed under the ISC license.
51747
51766
  * See the LICENSE file in the root directory of this source tree.
51748
51767
  */
51749
- const __iconNode$16 = [
51768
+ const __iconNode$17 = [
51750
51769
  ["path", { d: "M12 18V5", key: "adv99a" }],
51751
51770
  ["path", { d: "M15 13a4.17 4.17 0 0 1-3-4 4.17 4.17 0 0 1-3 4", key: "1e3is1" }],
51752
51771
  ["path", { d: "M17.598 6.5A3 3 0 1 0 12 5a3 3 0 1 0-5.598 1.5", key: "1gqd8o" }],
@@ -51756,27 +51775,27 @@ const __iconNode$16 = [
51756
51775
  ["path", { d: "M6 18a4 4 0 0 1-2-7.464", key: "k1g0md" }],
51757
51776
  ["path", { d: "M6.003 5.125a4 4 0 0 0-2.526 5.77", key: "q97ue3" }]
51758
51777
  ];
51759
- const Brain = createLucideIcon("brain", __iconNode$16);
51778
+ const Brain = createLucideIcon("brain", __iconNode$17);
51760
51779
  /**
51761
51780
  * @license lucide-react v0.575.0 - ISC
51762
51781
  *
51763
51782
  * This source code is licensed under the ISC license.
51764
51783
  * See the LICENSE file in the root directory of this source tree.
51765
51784
  */
51766
- const __iconNode$15 = [
51785
+ const __iconNode$16 = [
51767
51786
  ["path", { d: "M12 12h.01", key: "1mp3jc" }],
51768
51787
  ["path", { d: "M16 6V4a2 2 0 0 0-2-2h-4a2 2 0 0 0-2 2v2", key: "1ksdt3" }],
51769
51788
  ["path", { d: "M22 13a18.15 18.15 0 0 1-20 0", key: "12hx5q" }],
51770
51789
  ["rect", { width: "20", height: "14", x: "2", y: "6", rx: "2", key: "i6l2r4" }]
51771
51790
  ];
51772
- const BriefcaseBusiness = createLucideIcon("briefcase-business", __iconNode$15);
51791
+ const BriefcaseBusiness = createLucideIcon("briefcase-business", __iconNode$16);
51773
51792
  /**
51774
51793
  * @license lucide-react v0.575.0 - ISC
51775
51794
  *
51776
51795
  * This source code is licensed under the ISC license.
51777
51796
  * See the LICENSE file in the root directory of this source tree.
51778
51797
  */
51779
- const __iconNode$14 = [
51798
+ const __iconNode$15 = [
51780
51799
  [
51781
51800
  "path",
51782
51801
  { 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" }
@@ -51791,27 +51810,27 @@ const __iconNode$14 = [
51791
51810
  ],
51792
51811
  ["path", { d: "M7 5V3", key: "1t1388" }]
51793
51812
  ];
51794
- const Cable = createLucideIcon("cable", __iconNode$14);
51813
+ const Cable = createLucideIcon("cable", __iconNode$15);
51795
51814
  /**
51796
51815
  * @license lucide-react v0.575.0 - ISC
51797
51816
  *
51798
51817
  * This source code is licensed under the ISC license.
51799
51818
  * See the LICENSE file in the root directory of this source tree.
51800
51819
  */
51801
- const __iconNode$13 = [
51820
+ const __iconNode$14 = [
51802
51821
  ["path", { d: "M8 2v4", key: "1cmpym" }],
51803
51822
  ["path", { d: "M16 2v4", key: "4m81vk" }],
51804
51823
  ["rect", { width: "18", height: "18", x: "3", y: "4", rx: "2", key: "1hopcy" }],
51805
51824
  ["path", { d: "M3 10h18", key: "8toen8" }]
51806
51825
  ];
51807
- const Calendar = createLucideIcon("calendar", __iconNode$13);
51826
+ const Calendar = createLucideIcon("calendar", __iconNode$14);
51808
51827
  /**
51809
51828
  * @license lucide-react v0.575.0 - ISC
51810
51829
  *
51811
51830
  * This source code is licensed under the ISC license.
51812
51831
  * See the LICENSE file in the root directory of this source tree.
51813
51832
  */
51814
- const __iconNode$12 = [
51833
+ const __iconNode$13 = [
51815
51834
  [
51816
51835
  "path",
51817
51836
  {
@@ -51821,211 +51840,211 @@ const __iconNode$12 = [
51821
51840
  ],
51822
51841
  ["circle", { cx: "12", cy: "13", r: "3", key: "1vg3eu" }]
51823
51842
  ];
51824
- const Camera = createLucideIcon("camera", __iconNode$12);
51843
+ const Camera = createLucideIcon("camera", __iconNode$13);
51825
51844
  /**
51826
51845
  * @license lucide-react v0.575.0 - ISC
51827
51846
  *
51828
51847
  * This source code is licensed under the ISC license.
51829
51848
  * See the LICENSE file in the root directory of this source tree.
51830
51849
  */
51831
- const __iconNode$11 = [
51850
+ const __iconNode$12 = [
51832
51851
  ["path", { d: "M3 3v16a2 2 0 0 0 2 2h16", key: "c24i48" }],
51833
51852
  ["path", { d: "M7 16h8", key: "srdodz" }],
51834
51853
  ["path", { d: "M7 11h12", key: "127s9w" }],
51835
51854
  ["path", { d: "M7 6h3", key: "w9rmul" }]
51836
51855
  ];
51837
- const ChartBar = createLucideIcon("chart-bar", __iconNode$11);
51856
+ const ChartBar = createLucideIcon("chart-bar", __iconNode$12);
51838
51857
  /**
51839
51858
  * @license lucide-react v0.575.0 - ISC
51840
51859
  *
51841
51860
  * This source code is licensed under the ISC license.
51842
51861
  * See the LICENSE file in the root directory of this source tree.
51843
51862
  */
51844
- const __iconNode$10 = [
51863
+ const __iconNode$11 = [
51845
51864
  ["path", { d: "M3 3v16a2 2 0 0 0 2 2h16", key: "c24i48" }],
51846
51865
  ["path", { d: "M18 17V9", key: "2bz60n" }],
51847
51866
  ["path", { d: "M13 17V5", key: "1frdt8" }],
51848
51867
  ["path", { d: "M8 17v-3", key: "17ska0" }]
51849
51868
  ];
51850
- const ChartColumn = createLucideIcon("chart-column", __iconNode$10);
51869
+ const ChartColumn = createLucideIcon("chart-column", __iconNode$11);
51851
51870
  /**
51852
51871
  * @license lucide-react v0.575.0 - ISC
51853
51872
  *
51854
51873
  * This source code is licensed under the ISC license.
51855
51874
  * See the LICENSE file in the root directory of this source tree.
51856
51875
  */
51857
- const __iconNode$$ = [["path", { d: "M20 6 9 17l-5-5", key: "1gmf2c" }]];
51858
- const Check = createLucideIcon("check", __iconNode$$);
51876
+ const __iconNode$10 = [["path", { d: "M20 6 9 17l-5-5", key: "1gmf2c" }]];
51877
+ const Check = createLucideIcon("check", __iconNode$10);
51859
51878
  /**
51860
51879
  * @license lucide-react v0.575.0 - ISC
51861
51880
  *
51862
51881
  * This source code is licensed under the ISC license.
51863
51882
  * See the LICENSE file in the root directory of this source tree.
51864
51883
  */
51865
- const __iconNode$_ = [["path", { d: "m6 9 6 6 6-6", key: "qrunsl" }]];
51866
- const ChevronDown = createLucideIcon("chevron-down", __iconNode$_);
51884
+ const __iconNode$$ = [["path", { d: "m6 9 6 6 6-6", key: "qrunsl" }]];
51885
+ const ChevronDown = createLucideIcon("chevron-down", __iconNode$$);
51867
51886
  /**
51868
51887
  * @license lucide-react v0.575.0 - ISC
51869
51888
  *
51870
51889
  * This source code is licensed under the ISC license.
51871
51890
  * See the LICENSE file in the root directory of this source tree.
51872
51891
  */
51873
- const __iconNode$Z = [["path", { d: "m9 18 6-6-6-6", key: "mthhwq" }]];
51874
- const ChevronRight = createLucideIcon("chevron-right", __iconNode$Z);
51892
+ const __iconNode$_ = [["path", { d: "m9 18 6-6-6-6", key: "mthhwq" }]];
51893
+ const ChevronRight = createLucideIcon("chevron-right", __iconNode$_);
51875
51894
  /**
51876
51895
  * @license lucide-react v0.575.0 - ISC
51877
51896
  *
51878
51897
  * This source code is licensed under the ISC license.
51879
51898
  * See the LICENSE file in the root directory of this source tree.
51880
51899
  */
51881
- const __iconNode$Y = [["path", { d: "m18 15-6-6-6 6", key: "153udz" }]];
51882
- const ChevronUp = createLucideIcon("chevron-up", __iconNode$Y);
51900
+ const __iconNode$Z = [["path", { d: "m18 15-6-6-6 6", key: "153udz" }]];
51901
+ const ChevronUp = createLucideIcon("chevron-up", __iconNode$Z);
51883
51902
  /**
51884
51903
  * @license lucide-react v0.575.0 - ISC
51885
51904
  *
51886
51905
  * This source code is licensed under the ISC license.
51887
51906
  * See the LICENSE file in the root directory of this source tree.
51888
51907
  */
51889
- const __iconNode$X = [
51908
+ const __iconNode$Y = [
51890
51909
  ["circle", { cx: "12", cy: "12", r: "10", key: "1mglay" }],
51891
51910
  ["line", { x1: "12", x2: "12", y1: "8", y2: "12", key: "1pkeuh" }],
51892
51911
  ["line", { x1: "12", x2: "12.01", y1: "16", y2: "16", key: "4dfq90" }]
51893
51912
  ];
51894
- const CircleAlert = createLucideIcon("circle-alert", __iconNode$X);
51913
+ const CircleAlert = createLucideIcon("circle-alert", __iconNode$Y);
51895
51914
  /**
51896
51915
  * @license lucide-react v0.575.0 - ISC
51897
51916
  *
51898
51917
  * This source code is licensed under the ISC license.
51899
51918
  * See the LICENSE file in the root directory of this source tree.
51900
51919
  */
51901
- const __iconNode$W = [
51920
+ const __iconNode$X = [
51902
51921
  ["circle", { cx: "12", cy: "12", r: "10", key: "1mglay" }],
51903
51922
  ["path", { d: "m9 12 2 2 4-4", key: "dzmm74" }]
51904
51923
  ];
51905
- const CircleCheck = createLucideIcon("circle-check", __iconNode$W);
51924
+ const CircleCheck = createLucideIcon("circle-check", __iconNode$X);
51906
51925
  /**
51907
51926
  * @license lucide-react v0.575.0 - ISC
51908
51927
  *
51909
51928
  * This source code is licensed under the ISC license.
51910
51929
  * See the LICENSE file in the root directory of this source tree.
51911
51930
  */
51912
- const __iconNode$V = [
51931
+ const __iconNode$W = [
51913
51932
  ["circle", { cx: "12", cy: "12", r: "10", key: "1mglay" }],
51914
51933
  ["path", { d: "m15 9-6 6", key: "1uzhvr" }],
51915
51934
  ["path", { d: "m9 9 6 6", key: "z0biqf" }]
51916
51935
  ];
51917
- const CircleX = createLucideIcon("circle-x", __iconNode$V);
51936
+ const CircleX = createLucideIcon("circle-x", __iconNode$W);
51918
51937
  /**
51919
51938
  * @license lucide-react v0.575.0 - ISC
51920
51939
  *
51921
51940
  * This source code is licensed under the ISC license.
51922
51941
  * See the LICENSE file in the root directory of this source tree.
51923
51942
  */
51924
- const __iconNode$U = [["circle", { cx: "12", cy: "12", r: "10", key: "1mglay" }]];
51925
- const Circle = createLucideIcon("circle", __iconNode$U);
51943
+ const __iconNode$V = [["circle", { cx: "12", cy: "12", r: "10", key: "1mglay" }]];
51944
+ const Circle = createLucideIcon("circle", __iconNode$V);
51926
51945
  /**
51927
51946
  * @license lucide-react v0.575.0 - ISC
51928
51947
  *
51929
51948
  * This source code is licensed under the ISC license.
51930
51949
  * See the LICENSE file in the root directory of this source tree.
51931
51950
  */
51932
- const __iconNode$T = [
51951
+ const __iconNode$U = [
51933
51952
  ["rect", { width: "8", height: "4", x: "8", y: "2", rx: "1", ry: "1", key: "tgr4d6" }],
51934
51953
  ["path", { d: "M8 4H6a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2v-2", key: "4jdomd" }],
51935
51954
  ["path", { d: "M16 4h2a2 2 0 0 1 2 2v4", key: "3hqy98" }],
51936
51955
  ["path", { d: "M21 14H11", key: "1bme5i" }],
51937
51956
  ["path", { d: "m15 10-4 4 4 4", key: "5dvupr" }]
51938
51957
  ];
51939
- const ClipboardCopy = createLucideIcon("clipboard-copy", __iconNode$T);
51958
+ const ClipboardCopy = createLucideIcon("clipboard-copy", __iconNode$U);
51940
51959
  /**
51941
51960
  * @license lucide-react v0.575.0 - ISC
51942
51961
  *
51943
51962
  * This source code is licensed under the ISC license.
51944
51963
  * See the LICENSE file in the root directory of this source tree.
51945
51964
  */
51946
- const __iconNode$S = [
51965
+ const __iconNode$T = [
51947
51966
  ["path", { d: "m18 16 4-4-4-4", key: "1inbqp" }],
51948
51967
  ["path", { d: "m6 8-4 4 4 4", key: "15zrgr" }],
51949
51968
  ["path", { d: "m14.5 4-5 16", key: "e7oirm" }]
51950
51969
  ];
51951
- const CodeXml = createLucideIcon("code-xml", __iconNode$S);
51970
+ const CodeXml = createLucideIcon("code-xml", __iconNode$T);
51952
51971
  /**
51953
51972
  * @license lucide-react v0.575.0 - ISC
51954
51973
  *
51955
51974
  * This source code is licensed under the ISC license.
51956
51975
  * See the LICENSE file in the root directory of this source tree.
51957
51976
  */
51958
- const __iconNode$R = [
51977
+ const __iconNode$S = [
51959
51978
  ["path", { d: "m16 18 6-6-6-6", key: "eg8j8" }],
51960
51979
  ["path", { d: "m8 6-6 6 6 6", key: "ppft3o" }]
51961
51980
  ];
51962
- const Code = createLucideIcon("code", __iconNode$R);
51981
+ const Code = createLucideIcon("code", __iconNode$S);
51963
51982
  /**
51964
51983
  * @license lucide-react v0.575.0 - ISC
51965
51984
  *
51966
51985
  * This source code is licensed under the ISC license.
51967
51986
  * See the LICENSE file in the root directory of this source tree.
51968
51987
  */
51969
- const __iconNode$Q = [
51988
+ const __iconNode$R = [
51970
51989
  ["rect", { width: "14", height: "14", x: "8", y: "8", rx: "2", ry: "2", key: "17jyea" }],
51971
51990
  ["path", { d: "M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2", key: "zix9uf" }]
51972
51991
  ];
51973
- const Copy = createLucideIcon("copy", __iconNode$Q);
51992
+ const Copy = createLucideIcon("copy", __iconNode$R);
51974
51993
  /**
51975
51994
  * @license lucide-react v0.575.0 - ISC
51976
51995
  *
51977
51996
  * This source code is licensed under the ISC license.
51978
51997
  * See the LICENSE file in the root directory of this source tree.
51979
51998
  */
51980
- const __iconNode$P = [
51999
+ const __iconNode$Q = [
51981
52000
  ["ellipse", { cx: "12", cy: "5", rx: "9", ry: "3", key: "msslwz" }],
51982
52001
  ["path", { d: "M3 5V19A9 3 0 0 0 21 19V5", key: "1wlel7" }],
51983
52002
  ["path", { d: "M3 12A9 3 0 0 0 21 12", key: "mv7ke4" }]
51984
52003
  ];
51985
- const Database = createLucideIcon("database", __iconNode$P);
52004
+ const Database = createLucideIcon("database", __iconNode$Q);
51986
52005
  /**
51987
52006
  * @license lucide-react v0.575.0 - ISC
51988
52007
  *
51989
52008
  * This source code is licensed under the ISC license.
51990
52009
  * See the LICENSE file in the root directory of this source tree.
51991
52010
  */
51992
- const __iconNode$O = [
52011
+ const __iconNode$P = [
51993
52012
  ["path", { d: "M12 15V3", key: "m9g1x1" }],
51994
52013
  ["path", { d: "M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4", key: "ih7n3h" }],
51995
52014
  ["path", { d: "m7 10 5 5 5-5", key: "brsn70" }]
51996
52015
  ];
51997
- const Download = createLucideIcon("download", __iconNode$O);
52016
+ const Download = createLucideIcon("download", __iconNode$P);
51998
52017
  /**
51999
52018
  * @license lucide-react v0.575.0 - ISC
52000
52019
  *
52001
52020
  * This source code is licensed under the ISC license.
52002
52021
  * See the LICENSE file in the root directory of this source tree.
52003
52022
  */
52004
- const __iconNode$N = [
52023
+ const __iconNode$O = [
52005
52024
  ["circle", { cx: "12", cy: "12", r: "1", key: "41hilf" }],
52006
52025
  ["circle", { cx: "19", cy: "12", r: "1", key: "1wjl8i" }],
52007
52026
  ["circle", { cx: "5", cy: "12", r: "1", key: "1pcz8c" }]
52008
52027
  ];
52009
- const Ellipsis = createLucideIcon("ellipsis", __iconNode$N);
52028
+ const Ellipsis = createLucideIcon("ellipsis", __iconNode$O);
52010
52029
  /**
52011
52030
  * @license lucide-react v0.575.0 - ISC
52012
52031
  *
52013
52032
  * This source code is licensed under the ISC license.
52014
52033
  * See the LICENSE file in the root directory of this source tree.
52015
52034
  */
52016
- const __iconNode$M = [
52035
+ const __iconNode$N = [
52017
52036
  ["path", { d: "M15 3h6v6", key: "1q9fwt" }],
52018
52037
  ["path", { d: "M10 14 21 3", key: "gplh6r" }],
52019
52038
  ["path", { d: "M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6", key: "a6xqqp" }]
52020
52039
  ];
52021
- const ExternalLink = createLucideIcon("external-link", __iconNode$M);
52040
+ const ExternalLink = createLucideIcon("external-link", __iconNode$N);
52022
52041
  /**
52023
52042
  * @license lucide-react v0.575.0 - ISC
52024
52043
  *
52025
52044
  * This source code is licensed under the ISC license.
52026
52045
  * See the LICENSE file in the root directory of this source tree.
52027
52046
  */
52028
- const __iconNode$L = [
52047
+ const __iconNode$M = [
52029
52048
  [
52030
52049
  "path",
52031
52050
  {
@@ -52037,14 +52056,14 @@ const __iconNode$L = [
52037
52056
  ["path", { d: "M9 15h6", key: "cctwl0" }],
52038
52057
  ["path", { d: "M12 18v-6", key: "17g6i2" }]
52039
52058
  ];
52040
- const FilePlus = createLucideIcon("file-plus", __iconNode$L);
52059
+ const FilePlus = createLucideIcon("file-plus", __iconNode$M);
52041
52060
  /**
52042
52061
  * @license lucide-react v0.575.0 - ISC
52043
52062
  *
52044
52063
  * This source code is licensed under the ISC license.
52045
52064
  * See the LICENSE file in the root directory of this source tree.
52046
52065
  */
52047
- const __iconNode$K = [
52066
+ const __iconNode$L = [
52048
52067
  [
52049
52068
  "path",
52050
52069
  {
@@ -52058,14 +52077,14 @@ const __iconNode$K = [
52058
52077
  ["path", { d: "M8 17h2", key: "2yhykz" }],
52059
52078
  ["path", { d: "M14 17h2", key: "10kma7" }]
52060
52079
  ];
52061
- const FileSpreadsheet = createLucideIcon("file-spreadsheet", __iconNode$K);
52080
+ const FileSpreadsheet = createLucideIcon("file-spreadsheet", __iconNode$L);
52062
52081
  /**
52063
52082
  * @license lucide-react v0.575.0 - ISC
52064
52083
  *
52065
52084
  * This source code is licensed under the ISC license.
52066
52085
  * See the LICENSE file in the root directory of this source tree.
52067
52086
  */
52068
- const __iconNode$J = [
52087
+ const __iconNode$K = [
52069
52088
  [
52070
52089
  "path",
52071
52090
  {
@@ -52078,14 +52097,14 @@ const __iconNode$J = [
52078
52097
  ["path", { d: "M16 13H8", key: "t4e002" }],
52079
52098
  ["path", { d: "M16 17H8", key: "z1uh3a" }]
52080
52099
  ];
52081
- const FileText = createLucideIcon("file-text", __iconNode$J);
52100
+ const FileText = createLucideIcon("file-text", __iconNode$K);
52082
52101
  /**
52083
52102
  * @license lucide-react v0.575.0 - ISC
52084
52103
  *
52085
52104
  * This source code is licensed under the ISC license.
52086
52105
  * See the LICENSE file in the root directory of this source tree.
52087
52106
  */
52088
- const __iconNode$I = [
52107
+ const __iconNode$J = [
52089
52108
  [
52090
52109
  "path",
52091
52110
  {
@@ -52095,14 +52114,14 @@ const __iconNode$I = [
52095
52114
  ],
52096
52115
  ["path", { d: "M14 2v5a1 1 0 0 0 1 1h5", key: "wfsgrz" }]
52097
52116
  ];
52098
- const File$1 = createLucideIcon("file", __iconNode$I);
52117
+ const File$1 = createLucideIcon("file", __iconNode$J);
52099
52118
  /**
52100
52119
  * @license lucide-react v0.575.0 - ISC
52101
52120
  *
52102
52121
  * This source code is licensed under the ISC license.
52103
52122
  * See the LICENSE file in the root directory of this source tree.
52104
52123
  */
52105
- const __iconNode$H = [
52124
+ const __iconNode$I = [
52106
52125
  [
52107
52126
  "path",
52108
52127
  {
@@ -52114,14 +52133,14 @@ const __iconNode$H = [
52114
52133
  ["path", { d: "M12 10v2", key: "hh53o1" }],
52115
52134
  ["path", { d: "M16 10v6", key: "1d6xys" }]
52116
52135
  ];
52117
- const FolderKanban = createLucideIcon("folder-kanban", __iconNode$H);
52136
+ const FolderKanban = createLucideIcon("folder-kanban", __iconNode$I);
52118
52137
  /**
52119
52138
  * @license lucide-react v0.575.0 - ISC
52120
52139
  *
52121
52140
  * This source code is licensed under the ISC license.
52122
52141
  * See the LICENSE file in the root directory of this source tree.
52123
52142
  */
52124
- const __iconNode$G = [
52143
+ const __iconNode$H = [
52125
52144
  [
52126
52145
  "path",
52127
52146
  {
@@ -52130,14 +52149,14 @@ const __iconNode$G = [
52130
52149
  }
52131
52150
  ]
52132
52151
  ];
52133
- const FolderOpen = createLucideIcon("folder-open", __iconNode$G);
52152
+ const FolderOpen = createLucideIcon("folder-open", __iconNode$H);
52134
52153
  /**
52135
52154
  * @license lucide-react v0.575.0 - ISC
52136
52155
  *
52137
52156
  * This source code is licensed under the ISC license.
52138
52157
  * See the LICENSE file in the root directory of this source tree.
52139
52158
  */
52140
- const __iconNode$F = [
52159
+ const __iconNode$G = [
52141
52160
  [
52142
52161
  "path",
52143
52162
  {
@@ -52146,26 +52165,26 @@ const __iconNode$F = [
52146
52165
  }
52147
52166
  ]
52148
52167
  ];
52149
- const Folder = createLucideIcon("folder", __iconNode$F);
52168
+ const Folder = createLucideIcon("folder", __iconNode$G);
52150
52169
  /**
52151
52170
  * @license lucide-react v0.575.0 - ISC
52152
52171
  *
52153
52172
  * This source code is licensed under the ISC license.
52154
52173
  * See the LICENSE file in the root directory of this source tree.
52155
52174
  */
52156
- const __iconNode$E = [
52175
+ const __iconNode$F = [
52157
52176
  ["circle", { cx: "12", cy: "12", r: "10", key: "1mglay" }],
52158
52177
  ["path", { d: "M12 2a14.5 14.5 0 0 0 0 20 14.5 14.5 0 0 0 0-20", key: "13o1zl" }],
52159
52178
  ["path", { d: "M2 12h20", key: "9i4pu4" }]
52160
52179
  ];
52161
- const Globe = createLucideIcon("globe", __iconNode$E);
52180
+ const Globe = createLucideIcon("globe", __iconNode$F);
52162
52181
  /**
52163
52182
  * @license lucide-react v0.575.0 - ISC
52164
52183
  *
52165
52184
  * This source code is licensed under the ISC license.
52166
52185
  * See the LICENSE file in the root directory of this source tree.
52167
52186
  */
52168
- const __iconNode$D = [
52187
+ const __iconNode$E = [
52169
52188
  ["path", { d: "M10 16h.01", key: "1bzywj" }],
52170
52189
  [
52171
52190
  "path",
@@ -52177,26 +52196,26 @@ const __iconNode$D = [
52177
52196
  ["path", { d: "M21.946 12.013H2.054", key: "zqlbp7" }],
52178
52197
  ["path", { d: "M6 16h.01", key: "1pmjb7" }]
52179
52198
  ];
52180
- const HardDrive = createLucideIcon("hard-drive", __iconNode$D);
52199
+ const HardDrive = createLucideIcon("hard-drive", __iconNode$E);
52181
52200
  /**
52182
52201
  * @license lucide-react v0.575.0 - ISC
52183
52202
  *
52184
52203
  * This source code is licensed under the ISC license.
52185
52204
  * See the LICENSE file in the root directory of this source tree.
52186
52205
  */
52187
- const __iconNode$C = [
52206
+ const __iconNode$D = [
52188
52207
  ["rect", { width: "18", height: "18", x: "3", y: "3", rx: "2", ry: "2", key: "1m3agn" }],
52189
52208
  ["circle", { cx: "9", cy: "9", r: "2", key: "af1f0g" }],
52190
52209
  ["path", { d: "m21 15-3.086-3.086a2 2 0 0 0-2.828 0L6 21", key: "1xmnt7" }]
52191
52210
  ];
52192
- const Image = createLucideIcon("image", __iconNode$C);
52211
+ const Image = createLucideIcon("image", __iconNode$D);
52193
52212
  /**
52194
52213
  * @license lucide-react v0.575.0 - ISC
52195
52214
  *
52196
52215
  * This source code is licensed under the ISC license.
52197
52216
  * See the LICENSE file in the root directory of this source tree.
52198
52217
  */
52199
- const __iconNode$B = [
52218
+ const __iconNode$C = [
52200
52219
  [
52201
52220
  "path",
52202
52221
  {
@@ -52219,31 +52238,45 @@ const __iconNode$B = [
52219
52238
  }
52220
52239
  ]
52221
52240
  ];
52222
- const Layers = createLucideIcon("layers", __iconNode$B);
52241
+ const Layers = createLucideIcon("layers", __iconNode$C);
52223
52242
  /**
52224
52243
  * @license lucide-react v0.575.0 - ISC
52225
52244
  *
52226
52245
  * This source code is licensed under the ISC license.
52227
52246
  * See the LICENSE file in the root directory of this source tree.
52228
52247
  */
52229
- const __iconNode$A = [
52248
+ const __iconNode$B = [
52230
52249
  ["rect", { width: "7", height: "7", x: "3", y: "3", rx: "1", key: "1g98yp" }],
52231
52250
  ["rect", { width: "7", height: "7", x: "14", y: "3", rx: "1", key: "6d4xhi" }],
52232
52251
  ["rect", { width: "7", height: "7", x: "14", y: "14", rx: "1", key: "nxv5o0" }],
52233
52252
  ["rect", { width: "7", height: "7", x: "3", y: "14", rx: "1", key: "1bb6yr" }]
52234
52253
  ];
52235
- const LayoutGrid = createLucideIcon("layout-grid", __iconNode$A);
52254
+ const LayoutGrid = createLucideIcon("layout-grid", __iconNode$B);
52236
52255
  /**
52237
52256
  * @license lucide-react v0.575.0 - ISC
52238
52257
  *
52239
52258
  * This source code is licensed under the ISC license.
52240
52259
  * See the LICENSE file in the root directory of this source tree.
52241
52260
  */
52242
- const __iconNode$z = [
52261
+ const __iconNode$A = [
52243
52262
  ["path", { d: "M10 13a5 5 0 0 0 7.54.54l3-3a5 5 0 0 0-7.07-7.07l-1.72 1.71", key: "1cjeqo" }],
52244
52263
  ["path", { d: "M14 11a5 5 0 0 0-7.54-.54l-3 3a5 5 0 0 0 7.07 7.07l1.71-1.71", key: "19qd67" }]
52245
52264
  ];
52246
- const Link = createLucideIcon("link", __iconNode$z);
52265
+ const Link = createLucideIcon("link", __iconNode$A);
52266
+ /**
52267
+ * @license lucide-react v0.575.0 - ISC
52268
+ *
52269
+ * This source code is licensed under the ISC license.
52270
+ * See the LICENSE file in the root directory of this source tree.
52271
+ */
52272
+ const __iconNode$z = [
52273
+ ["path", { d: "M13 5h8", key: "a7qcls" }],
52274
+ ["path", { d: "M13 12h8", key: "h98zly" }],
52275
+ ["path", { d: "M13 19h8", key: "c3s6r1" }],
52276
+ ["path", { d: "m3 17 2 2 4-4", key: "1jhpwq" }],
52277
+ ["path", { d: "m3 7 2 2 4-4", key: "1obspn" }]
52278
+ ];
52279
+ const ListChecks = createLucideIcon("list-checks", __iconNode$z);
52247
52280
  /**
52248
52281
  * @license lucide-react v0.575.0 - ISC
52249
52282
  *
@@ -55474,7 +55507,7 @@ const MentionSuggestionPopup = React.forwardRef(({ store: store2, query, command
55474
55507
  {
55475
55508
  ref: refs.setFloating,
55476
55509
  style: floatingStyles,
55477
- className: "z-[9999]",
55510
+ className: "athena-sdk athena-sdk-chrome z-[9999]",
55478
55511
  onMouseDown: (e) => e.preventDefault(),
55479
55512
  children: /* @__PURE__ */ jsxRuntime.jsx(
55480
55513
  MentionSuggestionList,
@@ -57622,6 +57655,233 @@ const ReadAssetToolUI = React.memo(
57622
57655
  ReadAssetToolUIImpl
57623
57656
  );
57624
57657
  ReadAssetToolUI.displayName = "ReadAssetToolUI";
57658
+ const STEP_STATUSES = [
57659
+ "pending",
57660
+ "in_progress",
57661
+ "completed",
57662
+ "cancelled",
57663
+ "failed"
57664
+ ];
57665
+ function asRecord$1(value) {
57666
+ return typeof value === "object" && value !== null ? value : null;
57667
+ }
57668
+ function asStatus(value) {
57669
+ return typeof value === "string" && STEP_STATUSES.includes(value) ? value : "pending";
57670
+ }
57671
+ function parseSteps(value) {
57672
+ if (!Array.isArray(value)) return [];
57673
+ const steps = [];
57674
+ for (const raw of value) {
57675
+ const record2 = asRecord$1(raw);
57676
+ if (!record2) continue;
57677
+ const content = record2.content ?? record2.task ?? record2.title;
57678
+ if (typeof content !== "string" || content.trim() === "") continue;
57679
+ steps.push({
57680
+ id: typeof record2.id === "string" ? record2.id : void 0,
57681
+ content: content.trim(),
57682
+ status: asStatus(record2.status)
57683
+ });
57684
+ }
57685
+ return steps;
57686
+ }
57687
+ function asDescription(value) {
57688
+ return typeof value === "string" && value.trim() !== "" ? value.trim() : void 0;
57689
+ }
57690
+ function parsePartialSteps(argsText) {
57691
+ if (!argsText) return [];
57692
+ const steps = [];
57693
+ const objectPattern = /\{(?:[^{}\\"]|"(?:[^"\\]|\\.)*")*\}?/g;
57694
+ for (const [chunk] of argsText.matchAll(objectPattern)) {
57695
+ const contentMatch = /"(?:content|task|title)"\s*:\s*"((?:[^"\\]|\\.)*)"/.exec(
57696
+ chunk
57697
+ );
57698
+ if (!contentMatch) continue;
57699
+ let content;
57700
+ try {
57701
+ content = JSON.parse(`"${contentMatch[1]}"`);
57702
+ } catch {
57703
+ content = contentMatch[1];
57704
+ }
57705
+ if (content.trim() === "") continue;
57706
+ const statusMatch = /"status"\s*:\s*"([a-z_]+)"/.exec(chunk);
57707
+ steps.push({
57708
+ content: content.trim(),
57709
+ status: asStatus(statusMatch == null ? void 0 : statusMatch[1])
57710
+ });
57711
+ }
57712
+ return steps;
57713
+ }
57714
+ function parseTodoPlan({
57715
+ args,
57716
+ argsText,
57717
+ result
57718
+ }) {
57719
+ const argsRecord = asRecord$1(args);
57720
+ const argSteps = parseSteps(argsRecord == null ? void 0 : argsRecord.todos);
57721
+ let resultRecord = asRecord$1(result);
57722
+ if (!resultRecord && typeof result === "string") {
57723
+ try {
57724
+ resultRecord = asRecord$1(JSON.parse(result));
57725
+ } catch {
57726
+ resultRecord = null;
57727
+ }
57728
+ }
57729
+ const hasResultTodos = Array.isArray(resultRecord == null ? void 0 : resultRecord.todos);
57730
+ const steps = hasResultTodos ? parseSteps(resultRecord == null ? void 0 : resultRecord.todos) : argSteps.length > 0 ? argSteps : parsePartialSteps(argsText);
57731
+ return {
57732
+ steps,
57733
+ changeDescription: asDescription(resultRecord == null ? void 0 : resultRecord.description) ?? asDescription(resultRecord == null ? void 0 : resultRecord.todoChangeDescription)
57734
+ };
57735
+ }
57736
+ function StepMarker({
57737
+ status,
57738
+ index: index2
57739
+ }) {
57740
+ if (status === "completed") {
57741
+ return /* @__PURE__ */ jsxRuntime.jsx("span", { className: "flex size-[18px] shrink-0 items-center justify-center rounded-full bg-emerald-500 text-white", children: /* @__PURE__ */ jsxRuntime.jsx(Check, { className: "size-3", strokeWidth: 3 }) });
57742
+ }
57743
+ if (status === "in_progress") {
57744
+ return /* @__PURE__ */ jsxRuntime.jsx("span", { className: "flex size-[18px] shrink-0 items-center justify-center rounded-full bg-primary/10 text-primary", children: /* @__PURE__ */ jsxRuntime.jsx(Loader, { className: "size-3 animate-spin", strokeWidth: 3 }) });
57745
+ }
57746
+ if (status === "failed") {
57747
+ return /* @__PURE__ */ jsxRuntime.jsx("span", { className: "flex size-[18px] shrink-0 items-center justify-center rounded-full bg-destructive/10 text-destructive", children: /* @__PURE__ */ jsxRuntime.jsx(X, { className: "size-3", strokeWidth: 3 }) });
57748
+ }
57749
+ if (status === "cancelled") {
57750
+ return /* @__PURE__ */ jsxRuntime.jsx("span", { className: "flex size-[18px] shrink-0 items-center justify-center rounded-full border border-border text-muted-foreground", children: /* @__PURE__ */ jsxRuntime.jsx(X, { className: "size-3", strokeWidth: 3 }) });
57751
+ }
57752
+ return /* @__PURE__ */ jsxRuntime.jsx("span", { className: "flex size-[18px] shrink-0 items-center justify-center rounded-full border border-dashed border-border text-[9px] font-medium text-muted-foreground", children: index2 + 1 });
57753
+ }
57754
+ function PlanBadge({
57755
+ resolved,
57756
+ total
57757
+ }) {
57758
+ const isDone = total > 0 && resolved === total;
57759
+ return /* @__PURE__ */ jsxRuntime.jsx(
57760
+ "span",
57761
+ {
57762
+ className: cn(
57763
+ "flex size-8 shrink-0 items-center justify-center rounded-lg",
57764
+ isDone && "bg-emerald-50 text-emerald-600",
57765
+ !isDone && "bg-primary/10 text-primary"
57766
+ ),
57767
+ children: isDone ? /* @__PURE__ */ jsxRuntime.jsx(Check, { className: "size-4", strokeWidth: 3 }) : /* @__PURE__ */ jsxRuntime.jsx(ListChecks, { className: "size-4" })
57768
+ }
57769
+ );
57770
+ }
57771
+ const WriteTodosToolUIImpl = ({
57772
+ args,
57773
+ argsText,
57774
+ result,
57775
+ status
57776
+ }) => {
57777
+ const { steps, changeDescription } = React.useMemo(
57778
+ () => parseTodoPlan({ args, argsText, result }),
57779
+ [args, argsText, result]
57780
+ );
57781
+ const [collapsed, setCollapsed] = React.useState(false);
57782
+ const completed = steps.filter((s) => s.status === "completed").length;
57783
+ const stopped = steps.filter(
57784
+ (s) => s.status === "cancelled" || s.status === "failed"
57785
+ ).length;
57786
+ const current = steps.find((s) => s.status === "in_progress");
57787
+ const total = steps.length;
57788
+ const resolved = completed + stopped;
57789
+ const isWriting = (status == null ? void 0 : status.type) === "running";
57790
+ const isDone = total > 0 && resolved === total;
57791
+ if (total === 0) {
57792
+ return isWriting ? /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "my-3 flex w-full items-center gap-2 rounded-xl border border-border/60 bg-background px-4 py-3 shadow-sm", children: [
57793
+ /* @__PURE__ */ jsxRuntime.jsx(Loader, { className: "size-3.5 animate-spin text-primary" }),
57794
+ /* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-[13px] font-medium text-foreground", children: "Planning..." })
57795
+ ] }) : null;
57796
+ }
57797
+ const heading2 = isWriting ? "Updating plan" : isDone ? "Plan complete" : completed === 0 && !current ? "Plan" : "Plan in progress";
57798
+ const subtitle = changeDescription ?? (current ? current.content : void 0);
57799
+ return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "my-3 w-full rounded-xl border border-border/60 bg-background shadow-sm", children: [
57800
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "sticky top-0 z-20 overflow-hidden rounded-t-xl bg-background", children: [
57801
+ /* @__PURE__ */ jsxRuntime.jsxs(
57802
+ "button",
57803
+ {
57804
+ type: "button",
57805
+ onClick: () => setCollapsed((prev) => !prev),
57806
+ className: "flex w-full items-center gap-3 px-4 py-3 text-left transition-colors hover:bg-muted/30",
57807
+ "aria-expanded": !collapsed,
57808
+ children: [
57809
+ /* @__PURE__ */ jsxRuntime.jsx(PlanBadge, { resolved, total }),
57810
+ /* @__PURE__ */ jsxRuntime.jsxs("span", { className: "min-w-0 flex-1", children: [
57811
+ /* @__PURE__ */ jsxRuntime.jsxs("span", { className: "flex items-baseline gap-2", children: [
57812
+ /* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-[13px] font-medium text-foreground", children: heading2 }),
57813
+ /* @__PURE__ */ jsxRuntime.jsxs("span", { className: "text-[11px] tabular-nums text-muted-foreground", children: [
57814
+ resolved,
57815
+ "/",
57816
+ total,
57817
+ " steps"
57818
+ ] })
57819
+ ] }),
57820
+ subtitle && /* @__PURE__ */ jsxRuntime.jsx("span", { className: "block truncate text-[12px] text-muted-foreground", children: subtitle })
57821
+ ] }),
57822
+ /* @__PURE__ */ jsxRuntime.jsx(
57823
+ ChevronDown,
57824
+ {
57825
+ className: cn(
57826
+ "size-4 shrink-0 text-muted-foreground transition-transform duration-200",
57827
+ collapsed && "-rotate-90"
57828
+ )
57829
+ }
57830
+ )
57831
+ ]
57832
+ }
57833
+ ),
57834
+ /* @__PURE__ */ jsxRuntime.jsx("div", { className: "h-0.5 w-full bg-muted", children: /* @__PURE__ */ jsxRuntime.jsx(
57835
+ "div",
57836
+ {
57837
+ className: cn(
57838
+ "h-full transition-all duration-500",
57839
+ isDone ? "bg-emerald-500" : "bg-primary"
57840
+ ),
57841
+ style: { width: `${total > 0 ? resolved / total * 100 : 0}%` }
57842
+ }
57843
+ ) })
57844
+ ] }),
57845
+ !collapsed && /* @__PURE__ */ jsxRuntime.jsx("ol", { className: "flex max-h-72 flex-col overflow-y-auto rounded-b-xl border-t border-border/40 py-1", children: steps.map((step, index2) => /* @__PURE__ */ jsxRuntime.jsxs(
57846
+ "li",
57847
+ {
57848
+ className: cn(
57849
+ "relative flex items-start gap-2.5 px-4 py-1.5",
57850
+ step.status === "in_progress" && "bg-primary/5"
57851
+ ),
57852
+ children: [
57853
+ index2 < steps.length - 1 && /* @__PURE__ */ jsxRuntime.jsx(
57854
+ "span",
57855
+ {
57856
+ "aria-hidden": true,
57857
+ className: "absolute left-[calc(1rem+8px)] top-[26px] h-[calc(100%-18px)] w-px bg-border/60"
57858
+ }
57859
+ ),
57860
+ /* @__PURE__ */ jsxRuntime.jsx("span", { className: "relative z-10 mt-[3px]", children: /* @__PURE__ */ jsxRuntime.jsx(StepMarker, { status: step.status, index: index2 }) }),
57861
+ /* @__PURE__ */ jsxRuntime.jsx(
57862
+ "span",
57863
+ {
57864
+ className: cn(
57865
+ "text-[12.5px] leading-relaxed text-foreground",
57866
+ step.status === "completed" && "text-muted-foreground line-through decoration-muted-foreground/40",
57867
+ step.status === "cancelled" && "text-muted-foreground/70 line-through decoration-muted-foreground/40",
57868
+ step.status === "failed" && "text-destructive",
57869
+ step.status === "in_progress" && "font-medium text-primary",
57870
+ step.status === "pending" && "text-muted-foreground"
57871
+ ),
57872
+ children: step.content
57873
+ }
57874
+ )
57875
+ ]
57876
+ },
57877
+ step.id ?? `${index2}-${step.content}`
57878
+ )) })
57879
+ ] });
57880
+ };
57881
+ const WriteTodosToolUI = React.memo(
57882
+ WriteTodosToolUIImpl
57883
+ );
57884
+ WriteTodosToolUI.displayName = "WriteTodosToolUI";
57625
57885
  function tryParseJson(text2) {
57626
57886
  try {
57627
57887
  const p = JSON.parse(text2);
@@ -60738,7 +60998,8 @@ const TOOL_UI_REGISTRY = {
60738
60998
  get_database_table_schema: GetDatabaseTableSchemaToolUI,
60739
60999
  run_sql: RunSqlToolUI,
60740
61000
  run_database_sql: RunSqlToolUI,
60741
- run_sql_query_tool: RunSqlToolUI
61001
+ run_sql_query_tool: RunSqlToolUI,
61002
+ write_todos: WriteTodosToolUI
60742
61003
  };
60743
61004
  const TOOLKIT_THEMES = {
60744
61005
  Web: { color: "#7BCCFA" },
@@ -62781,7 +63042,7 @@ const AthenaAssetEmbed = ({
62781
63042
  if (error2) onError == null ? void 0 : onError(new Error(error2));
62782
63043
  }, [error2, onError]);
62783
63044
  if (isLoading) {
62784
- return loadingFallback ?? /* @__PURE__ */ jsxRuntime.jsxs("output", { className: "flex h-full w-full items-center justify-center", children: [
63045
+ return loadingFallback ?? /* @__PURE__ */ jsxRuntime.jsxs("output", { className: "athena-sdk-chrome flex h-full w-full items-center justify-center", children: [
62785
63046
  /* @__PURE__ */ jsxRuntime.jsx(LoaderCircle, { className: "size-6 animate-spin text-muted-foreground" }),
62786
63047
  /* @__PURE__ */ jsxRuntime.jsx("span", { className: "sr-only", children: "Loading asset" })
62787
63048
  ] });
@@ -62792,7 +63053,7 @@ const AthenaAssetEmbed = ({
62792
63053
  return errorFallback ?? /* @__PURE__ */ jsxRuntime.jsxs(
62793
63054
  "div",
62794
63055
  {
62795
- className: "flex h-full w-full items-center justify-center gap-2 p-4 text-sm text-muted-foreground",
63056
+ className: "athena-sdk-chrome flex h-full w-full items-center justify-center gap-2 p-4 text-sm text-muted-foreground",
62796
63057
  role: "alert",
62797
63058
  children: [
62798
63059
  /* @__PURE__ */ jsxRuntime.jsx(CircleAlert, { className: "size-4 text-destructive" }),
@@ -63165,21 +63426,27 @@ const AthenaLayout = ({
63165
63426
  /* @__PURE__ */ jsxRuntime.jsx(
63166
63427
  "div",
63167
63428
  {
63168
- className: "flex h-full w-1 shrink-0 cursor-col-resize items-center bg-border/40 transition-colors hover:bg-border active:bg-primary/30",
63429
+ className: "athena-sdk-chrome flex h-full w-1 shrink-0 cursor-col-resize items-center bg-border/40 transition-colors hover:bg-border active:bg-primary/30",
63169
63430
  onPointerDown,
63170
63431
  onPointerMove,
63171
63432
  onPointerUp
63172
63433
  }
63173
63434
  ),
63174
- /* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex h-full flex-1 flex-col overflow-hidden", children: /* @__PURE__ */ jsxRuntime.jsx(AssetPanel, { manageAssetPanelHostRegistration: false }) })
63435
+ /* @__PURE__ */ jsxRuntime.jsx("div", { className: "athena-sdk-chrome flex h-full flex-1 flex-col overflow-hidden", children: /* @__PURE__ */ jsxRuntime.jsx(AssetPanel, { manageAssetPanelHostRegistration: false }) })
63175
63436
  ] });
63176
63437
  };
63177
63438
  function ThreadList({ className }) {
63178
63439
  const statewireList = useAthenaStatewireThreadList();
63179
63440
  if (statewireList) {
63180
- return /* @__PURE__ */ jsxRuntime.jsx(StatewireThreadList, { list: statewireList, className });
63441
+ return /* @__PURE__ */ jsxRuntime.jsx(
63442
+ StatewireThreadList,
63443
+ {
63444
+ list: statewireList,
63445
+ className: cn("athena-sdk-chrome", className)
63446
+ }
63447
+ );
63181
63448
  }
63182
- return /* @__PURE__ */ jsxRuntime.jsx(LegacyThreadList, { className });
63449
+ return /* @__PURE__ */ jsxRuntime.jsx(LegacyThreadList, { className: cn("athena-sdk-chrome", className) });
63183
63450
  }
63184
63451
  function LegacyThreadList({ className }) {
63185
63452
  const refresh = useRefreshThreadList();
@@ -63372,6 +63639,7 @@ exports.TooltipProvider = TooltipProvider;
63372
63639
  exports.TooltipTrigger = TooltipTrigger;
63373
63640
  exports.UpdateSheetRangeToolUI = UpdateSheetRangeToolUI;
63374
63641
  exports.WebSearchToolUI = WebSearchToolUI;
63642
+ exports.WriteTodosToolUI = WriteTodosToolUI;
63375
63643
  exports.allowsMidRunSend = allowsMidRunSend;
63376
63644
  exports.archiveThread = archiveThread;
63377
63645
  exports.asHitlApproval = asHitlApproval;
@@ -63408,6 +63676,7 @@ exports.listThreads = listThreads;
63408
63676
  exports.normalizeResult = normalizeResult;
63409
63677
  exports.parseAthenaCitationLink = parseAthenaCitationLink;
63410
63678
  exports.parseCollabAgentRef = parseCollabAgentRef;
63679
+ exports.parseTodoPlan = parseTodoPlan;
63411
63680
  exports.readInterruptMessage = readInterruptMessage;
63412
63681
  exports.readRejectionDetail = readRejectionDetail;
63413
63682
  exports.resetAssetAutoOpen = resetAssetAutoOpen;