@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.js CHANGED
@@ -33,7 +33,7 @@ import { runsMaterialize, StatewireThread, useStatewireSendCommand, useStatewire
33
33
  import { useAuiState } from "@assistant-ui/store";
34
34
  import * as ReactDOM from "react-dom";
35
35
  import ReactDOM__default, { flushSync } from "react-dom";
36
- const version$1 = "0.11.1";
36
+ const version$1 = "0.11.3";
37
37
  const packageJson = {
38
38
  version: version$1
39
39
  };
@@ -11549,7 +11549,7 @@ const sanitizeConnectionMessage = (message) => {
11549
11549
  }).join("").replace(/\s+/g, " ").trim();
11550
11550
  return printable ? printable.slice(0, 200) : void 0;
11551
11551
  };
11552
- function projectDeepAgentConnection(connection) {
11552
+ function projectDeepAgentConnection(connection, { awaitingFirstSend = false } = {}) {
11553
11553
  if (connection.status === "reconnecting") {
11554
11554
  const message = connection.message === void 0 ? void 0 : sanitizeConnectionMessage(connection.message);
11555
11555
  return {
@@ -11566,6 +11566,7 @@ function projectDeepAgentConnection(connection) {
11566
11566
  ...message !== void 0 && { message }
11567
11567
  };
11568
11568
  }
11569
+ if (connection.status === "connecting" && awaitingFirstSend) return { status: "ready" };
11569
11570
  return { status: connection.status };
11570
11571
  }
11571
11572
  const buildOptimisticHumanContent = (parts) => {
@@ -11990,6 +11991,9 @@ function useDeepAgentThread({
11990
11991
  const preloadRef = useRef({ threadId, preload: isNewChat });
11991
11992
  if (preloadRef.current.threadId !== threadId)
11992
11993
  preloadRef.current = { threadId, preload: isNewChat };
11994
+ const awaitingFirstSendRef = useRef({ threadId, awaiting: isNewChat });
11995
+ if (awaitingFirstSendRef.current.threadId !== threadId)
11996
+ awaitingFirstSendRef.current = { threadId, awaiting: isNewChat };
11993
11997
  return StatewireThread({
11994
11998
  // New threads preload an empty runs mount and project "ready" — the
11995
11999
  // composer is interactive before the stream attaches and pre-attach sends
@@ -12049,7 +12053,7 @@ function useDeepAgentThread({
12049
12053
  // former `runs: true` opt-in is gone) — the converter only maps app-owned
12050
12054
  // keys, including the `run/stop` runId stamp the lib projects itself.
12051
12055
  converter: (state, meta) => {
12052
- var _a3, _b2;
12056
+ var _a3, _b2, _c2, _d2;
12053
12057
  if (authDenialRef.current.attachId !== attachIdRef.current) {
12054
12058
  authDenialRef.current = {
12055
12059
  attachId: attachIdRef.current,
@@ -12068,7 +12072,15 @@ function useDeepAgentThread({
12068
12072
  );
12069
12073
  });
12070
12074
  }
12071
- const connection = projectDeepAgentConnection(meta.connection);
12075
+ 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)) {
12076
+ awaitingFirstSendRef.current = {
12077
+ threadId: awaitingFirstSendRef.current.threadId,
12078
+ awaiting: false
12079
+ };
12080
+ }
12081
+ const connection = projectDeepAgentConnection(meta.connection, {
12082
+ awaitingFirstSend: awaitingFirstSendRef.current.awaiting
12083
+ });
12072
12084
  const previous = lastConnectionRef.current;
12073
12085
  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) {
12074
12086
  const update = { threadId: attachId, connection };
@@ -12079,7 +12091,7 @@ function useDeepAgentThread({
12079
12091
  (_a4 = onConnectionChangeRef.current) == null ? void 0 : _a4.call(onConnectionChangeRef, connection);
12080
12092
  });
12081
12093
  }
12082
- return converter(state, ((_b2 = (_a3 = state == null ? void 0 : state.runs) == null ? void 0 : _a3[0]) == null ? void 0 : _b2.status) === "running");
12094
+ return converter(state, ((_d2 = (_c2 = state == null ? void 0 : state.runs) == null ? void 0 : _c2[0]) == null ? void 0 : _d2.status) === "running");
12083
12095
  },
12084
12096
  // Makes the server's dispatch record concrete in state (after the
12085
12097
  // optimistic folds); the lib's post-converter dispatch merge turns off.
@@ -16523,6 +16535,9 @@ function TooltipContent({
16523
16535
  "data-slot": "tooltip-content",
16524
16536
  sideOffset,
16525
16537
  className: cn(
16538
+ // Portaled outside the provider wrapper — carries the SDK scope
16539
+ // classes itself so tokens and the scoped reset still apply.
16540
+ "athena-sdk athena-sdk-chrome",
16526
16541
  "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",
16527
16542
  className
16528
16543
  ),
@@ -20982,10 +20997,14 @@ function AthenaProvider({
20982
20997
  );
20983
20998
  }
20984
20999
  let result = /* @__PURE__ */ jsx(PostHogProvider, { config: posthogConfig, children: inner });
20985
- if (themeStyleVars) {
20986
- result = /* @__PURE__ */ jsx("div", { className: "athena-themed", style: themeStyleVars, children: result });
20987
- }
20988
- return result;
21000
+ return /* @__PURE__ */ jsx(
21001
+ "div",
21002
+ {
21003
+ className: themeStyleVars ? "athena-sdk athena-themed" : "athena-sdk",
21004
+ style: themeStyleVars,
21005
+ children: result
21006
+ }
21007
+ );
20989
21008
  }
20990
21009
  function OrderedMap(content) {
20991
21010
  this.content = content;
@@ -51595,63 +51614,63 @@ const createLucideIcon = (iconName, iconNode) => {
51595
51614
  * This source code is licensed under the ISC license.
51596
51615
  * See the LICENSE file in the root directory of this source tree.
51597
51616
  */
51598
- const __iconNode$1d = [
51617
+ const __iconNode$1e = [
51599
51618
  ["rect", { width: "20", height: "5", x: "2", y: "3", rx: "1", key: "1wp1u1" }],
51600
51619
  ["path", { d: "M4 8v11a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8", key: "1s80jp" }],
51601
51620
  ["path", { d: "M10 12h4", key: "a56b0p" }]
51602
51621
  ];
51603
- const Archive = createLucideIcon("archive", __iconNode$1d);
51622
+ const Archive = createLucideIcon("archive", __iconNode$1e);
51604
51623
  /**
51605
51624
  * @license lucide-react v0.575.0 - ISC
51606
51625
  *
51607
51626
  * This source code is licensed under the ISC license.
51608
51627
  * See the LICENSE file in the root directory of this source tree.
51609
51628
  */
51610
- const __iconNode$1c = [
51629
+ const __iconNode$1d = [
51611
51630
  ["path", { d: "M12 5v14", key: "s699le" }],
51612
51631
  ["path", { d: "m19 12-7 7-7-7", key: "1idqje" }]
51613
51632
  ];
51614
- const ArrowDown = createLucideIcon("arrow-down", __iconNode$1c);
51633
+ const ArrowDown = createLucideIcon("arrow-down", __iconNode$1d);
51615
51634
  /**
51616
51635
  * @license lucide-react v0.575.0 - ISC
51617
51636
  *
51618
51637
  * This source code is licensed under the ISC license.
51619
51638
  * See the LICENSE file in the root directory of this source tree.
51620
51639
  */
51621
- const __iconNode$1b = [
51640
+ const __iconNode$1c = [
51622
51641
  ["path", { d: "m12 19-7-7 7-7", key: "1l729n" }],
51623
51642
  ["path", { d: "M19 12H5", key: "x3x0zl" }]
51624
51643
  ];
51625
- const ArrowLeft = createLucideIcon("arrow-left", __iconNode$1b);
51644
+ const ArrowLeft = createLucideIcon("arrow-left", __iconNode$1c);
51626
51645
  /**
51627
51646
  * @license lucide-react v0.575.0 - ISC
51628
51647
  *
51629
51648
  * This source code is licensed under the ISC license.
51630
51649
  * See the LICENSE file in the root directory of this source tree.
51631
51650
  */
51632
- const __iconNode$1a = [
51651
+ const __iconNode$1b = [
51633
51652
  ["path", { d: "M5 12h14", key: "1ays0h" }],
51634
51653
  ["path", { d: "m12 5 7 7-7 7", key: "xquz4c" }]
51635
51654
  ];
51636
- const ArrowRight = createLucideIcon("arrow-right", __iconNode$1a);
51655
+ const ArrowRight = createLucideIcon("arrow-right", __iconNode$1b);
51637
51656
  /**
51638
51657
  * @license lucide-react v0.575.0 - ISC
51639
51658
  *
51640
51659
  * This source code is licensed under the ISC license.
51641
51660
  * See the LICENSE file in the root directory of this source tree.
51642
51661
  */
51643
- const __iconNode$19 = [
51662
+ const __iconNode$1a = [
51644
51663
  ["path", { d: "m5 12 7-7 7 7", key: "hav0vg" }],
51645
51664
  ["path", { d: "M12 19V5", key: "x0mq9r" }]
51646
51665
  ];
51647
- const ArrowUp = createLucideIcon("arrow-up", __iconNode$19);
51666
+ const ArrowUp = createLucideIcon("arrow-up", __iconNode$1a);
51648
51667
  /**
51649
51668
  * @license lucide-react v0.575.0 - ISC
51650
51669
  *
51651
51670
  * This source code is licensed under the ISC license.
51652
51671
  * See the LICENSE file in the root directory of this source tree.
51653
51672
  */
51654
- const __iconNode$18 = [
51673
+ const __iconNode$19 = [
51655
51674
  ["path", { d: "M12 7v14", key: "1akyts" }],
51656
51675
  [
51657
51676
  "path",
@@ -51661,14 +51680,14 @@ const __iconNode$18 = [
51661
51680
  }
51662
51681
  ]
51663
51682
  ];
51664
- const BookOpen = createLucideIcon("book-open", __iconNode$18);
51683
+ const BookOpen = createLucideIcon("book-open", __iconNode$19);
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$17 = [
51690
+ const __iconNode$18 = [
51672
51691
  [
51673
51692
  "path",
51674
51693
  {
@@ -51700,14 +51719,14 @@ const __iconNode$17 = [
51700
51719
  ["path", { d: "m12 8 4.74-2.85", key: "3rx089" }],
51701
51720
  ["path", { d: "M12 13.5V8", key: "1io7kd" }]
51702
51721
  ];
51703
- const Boxes = createLucideIcon("boxes", __iconNode$17);
51722
+ const Boxes = createLucideIcon("boxes", __iconNode$18);
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$16 = [
51729
+ const __iconNode$17 = [
51711
51730
  ["path", { d: "M12 18V5", key: "adv99a" }],
51712
51731
  ["path", { d: "M15 13a4.17 4.17 0 0 1-3-4 4.17 4.17 0 0 1-3 4", key: "1e3is1" }],
51713
51732
  ["path", { d: "M17.598 6.5A3 3 0 1 0 12 5a3 3 0 1 0-5.598 1.5", key: "1gqd8o" }],
@@ -51717,27 +51736,27 @@ const __iconNode$16 = [
51717
51736
  ["path", { d: "M6 18a4 4 0 0 1-2-7.464", key: "k1g0md" }],
51718
51737
  ["path", { d: "M6.003 5.125a4 4 0 0 0-2.526 5.77", key: "q97ue3" }]
51719
51738
  ];
51720
- const Brain = createLucideIcon("brain", __iconNode$16);
51739
+ const Brain = createLucideIcon("brain", __iconNode$17);
51721
51740
  /**
51722
51741
  * @license lucide-react v0.575.0 - ISC
51723
51742
  *
51724
51743
  * This source code is licensed under the ISC license.
51725
51744
  * See the LICENSE file in the root directory of this source tree.
51726
51745
  */
51727
- const __iconNode$15 = [
51746
+ const __iconNode$16 = [
51728
51747
  ["path", { d: "M12 12h.01", key: "1mp3jc" }],
51729
51748
  ["path", { d: "M16 6V4a2 2 0 0 0-2-2h-4a2 2 0 0 0-2 2v2", key: "1ksdt3" }],
51730
51749
  ["path", { d: "M22 13a18.15 18.15 0 0 1-20 0", key: "12hx5q" }],
51731
51750
  ["rect", { width: "20", height: "14", x: "2", y: "6", rx: "2", key: "i6l2r4" }]
51732
51751
  ];
51733
- const BriefcaseBusiness = createLucideIcon("briefcase-business", __iconNode$15);
51752
+ const BriefcaseBusiness = createLucideIcon("briefcase-business", __iconNode$16);
51734
51753
  /**
51735
51754
  * @license lucide-react v0.575.0 - ISC
51736
51755
  *
51737
51756
  * This source code is licensed under the ISC license.
51738
51757
  * See the LICENSE file in the root directory of this source tree.
51739
51758
  */
51740
- const __iconNode$14 = [
51759
+ const __iconNode$15 = [
51741
51760
  [
51742
51761
  "path",
51743
51762
  { 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" }
@@ -51752,27 +51771,27 @@ const __iconNode$14 = [
51752
51771
  ],
51753
51772
  ["path", { d: "M7 5V3", key: "1t1388" }]
51754
51773
  ];
51755
- const Cable = createLucideIcon("cable", __iconNode$14);
51774
+ const Cable = createLucideIcon("cable", __iconNode$15);
51756
51775
  /**
51757
51776
  * @license lucide-react v0.575.0 - ISC
51758
51777
  *
51759
51778
  * This source code is licensed under the ISC license.
51760
51779
  * See the LICENSE file in the root directory of this source tree.
51761
51780
  */
51762
- const __iconNode$13 = [
51781
+ const __iconNode$14 = [
51763
51782
  ["path", { d: "M8 2v4", key: "1cmpym" }],
51764
51783
  ["path", { d: "M16 2v4", key: "4m81vk" }],
51765
51784
  ["rect", { width: "18", height: "18", x: "3", y: "4", rx: "2", key: "1hopcy" }],
51766
51785
  ["path", { d: "M3 10h18", key: "8toen8" }]
51767
51786
  ];
51768
- const Calendar = createLucideIcon("calendar", __iconNode$13);
51787
+ const Calendar = createLucideIcon("calendar", __iconNode$14);
51769
51788
  /**
51770
51789
  * @license lucide-react v0.575.0 - ISC
51771
51790
  *
51772
51791
  * This source code is licensed under the ISC license.
51773
51792
  * See the LICENSE file in the root directory of this source tree.
51774
51793
  */
51775
- const __iconNode$12 = [
51794
+ const __iconNode$13 = [
51776
51795
  [
51777
51796
  "path",
51778
51797
  {
@@ -51782,211 +51801,211 @@ const __iconNode$12 = [
51782
51801
  ],
51783
51802
  ["circle", { cx: "12", cy: "13", r: "3", key: "1vg3eu" }]
51784
51803
  ];
51785
- const Camera = createLucideIcon("camera", __iconNode$12);
51804
+ const Camera = createLucideIcon("camera", __iconNode$13);
51786
51805
  /**
51787
51806
  * @license lucide-react v0.575.0 - ISC
51788
51807
  *
51789
51808
  * This source code is licensed under the ISC license.
51790
51809
  * See the LICENSE file in the root directory of this source tree.
51791
51810
  */
51792
- const __iconNode$11 = [
51811
+ const __iconNode$12 = [
51793
51812
  ["path", { d: "M3 3v16a2 2 0 0 0 2 2h16", key: "c24i48" }],
51794
51813
  ["path", { d: "M7 16h8", key: "srdodz" }],
51795
51814
  ["path", { d: "M7 11h12", key: "127s9w" }],
51796
51815
  ["path", { d: "M7 6h3", key: "w9rmul" }]
51797
51816
  ];
51798
- const ChartBar = createLucideIcon("chart-bar", __iconNode$11);
51817
+ const ChartBar = createLucideIcon("chart-bar", __iconNode$12);
51799
51818
  /**
51800
51819
  * @license lucide-react v0.575.0 - ISC
51801
51820
  *
51802
51821
  * This source code is licensed under the ISC license.
51803
51822
  * See the LICENSE file in the root directory of this source tree.
51804
51823
  */
51805
- const __iconNode$10 = [
51824
+ const __iconNode$11 = [
51806
51825
  ["path", { d: "M3 3v16a2 2 0 0 0 2 2h16", key: "c24i48" }],
51807
51826
  ["path", { d: "M18 17V9", key: "2bz60n" }],
51808
51827
  ["path", { d: "M13 17V5", key: "1frdt8" }],
51809
51828
  ["path", { d: "M8 17v-3", key: "17ska0" }]
51810
51829
  ];
51811
- const ChartColumn = createLucideIcon("chart-column", __iconNode$10);
51830
+ const ChartColumn = createLucideIcon("chart-column", __iconNode$11);
51812
51831
  /**
51813
51832
  * @license lucide-react v0.575.0 - ISC
51814
51833
  *
51815
51834
  * This source code is licensed under the ISC license.
51816
51835
  * See the LICENSE file in the root directory of this source tree.
51817
51836
  */
51818
- const __iconNode$$ = [["path", { d: "M20 6 9 17l-5-5", key: "1gmf2c" }]];
51819
- const Check = createLucideIcon("check", __iconNode$$);
51837
+ const __iconNode$10 = [["path", { d: "M20 6 9 17l-5-5", key: "1gmf2c" }]];
51838
+ const Check = createLucideIcon("check", __iconNode$10);
51820
51839
  /**
51821
51840
  * @license lucide-react v0.575.0 - ISC
51822
51841
  *
51823
51842
  * This source code is licensed under the ISC license.
51824
51843
  * See the LICENSE file in the root directory of this source tree.
51825
51844
  */
51826
- const __iconNode$_ = [["path", { d: "m6 9 6 6 6-6", key: "qrunsl" }]];
51827
- const ChevronDown = createLucideIcon("chevron-down", __iconNode$_);
51845
+ const __iconNode$$ = [["path", { d: "m6 9 6 6 6-6", key: "qrunsl" }]];
51846
+ const ChevronDown = createLucideIcon("chevron-down", __iconNode$$);
51828
51847
  /**
51829
51848
  * @license lucide-react v0.575.0 - ISC
51830
51849
  *
51831
51850
  * This source code is licensed under the ISC license.
51832
51851
  * See the LICENSE file in the root directory of this source tree.
51833
51852
  */
51834
- const __iconNode$Z = [["path", { d: "m9 18 6-6-6-6", key: "mthhwq" }]];
51835
- const ChevronRight = createLucideIcon("chevron-right", __iconNode$Z);
51853
+ const __iconNode$_ = [["path", { d: "m9 18 6-6-6-6", key: "mthhwq" }]];
51854
+ const ChevronRight = createLucideIcon("chevron-right", __iconNode$_);
51836
51855
  /**
51837
51856
  * @license lucide-react v0.575.0 - ISC
51838
51857
  *
51839
51858
  * This source code is licensed under the ISC license.
51840
51859
  * See the LICENSE file in the root directory of this source tree.
51841
51860
  */
51842
- const __iconNode$Y = [["path", { d: "m18 15-6-6-6 6", key: "153udz" }]];
51843
- const ChevronUp = createLucideIcon("chevron-up", __iconNode$Y);
51861
+ const __iconNode$Z = [["path", { d: "m18 15-6-6-6 6", key: "153udz" }]];
51862
+ const ChevronUp = createLucideIcon("chevron-up", __iconNode$Z);
51844
51863
  /**
51845
51864
  * @license lucide-react v0.575.0 - ISC
51846
51865
  *
51847
51866
  * This source code is licensed under the ISC license.
51848
51867
  * See the LICENSE file in the root directory of this source tree.
51849
51868
  */
51850
- const __iconNode$X = [
51869
+ const __iconNode$Y = [
51851
51870
  ["circle", { cx: "12", cy: "12", r: "10", key: "1mglay" }],
51852
51871
  ["line", { x1: "12", x2: "12", y1: "8", y2: "12", key: "1pkeuh" }],
51853
51872
  ["line", { x1: "12", x2: "12.01", y1: "16", y2: "16", key: "4dfq90" }]
51854
51873
  ];
51855
- const CircleAlert = createLucideIcon("circle-alert", __iconNode$X);
51874
+ const CircleAlert = createLucideIcon("circle-alert", __iconNode$Y);
51856
51875
  /**
51857
51876
  * @license lucide-react v0.575.0 - ISC
51858
51877
  *
51859
51878
  * This source code is licensed under the ISC license.
51860
51879
  * See the LICENSE file in the root directory of this source tree.
51861
51880
  */
51862
- const __iconNode$W = [
51881
+ const __iconNode$X = [
51863
51882
  ["circle", { cx: "12", cy: "12", r: "10", key: "1mglay" }],
51864
51883
  ["path", { d: "m9 12 2 2 4-4", key: "dzmm74" }]
51865
51884
  ];
51866
- const CircleCheck = createLucideIcon("circle-check", __iconNode$W);
51885
+ const CircleCheck = createLucideIcon("circle-check", __iconNode$X);
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$V = [
51892
+ const __iconNode$W = [
51874
51893
  ["circle", { cx: "12", cy: "12", r: "10", key: "1mglay" }],
51875
51894
  ["path", { d: "m15 9-6 6", key: "1uzhvr" }],
51876
51895
  ["path", { d: "m9 9 6 6", key: "z0biqf" }]
51877
51896
  ];
51878
- const CircleX = createLucideIcon("circle-x", __iconNode$V);
51897
+ const CircleX = createLucideIcon("circle-x", __iconNode$W);
51879
51898
  /**
51880
51899
  * @license lucide-react v0.575.0 - ISC
51881
51900
  *
51882
51901
  * This source code is licensed under the ISC license.
51883
51902
  * See the LICENSE file in the root directory of this source tree.
51884
51903
  */
51885
- const __iconNode$U = [["circle", { cx: "12", cy: "12", r: "10", key: "1mglay" }]];
51886
- const Circle = createLucideIcon("circle", __iconNode$U);
51904
+ const __iconNode$V = [["circle", { cx: "12", cy: "12", r: "10", key: "1mglay" }]];
51905
+ const Circle = createLucideIcon("circle", __iconNode$V);
51887
51906
  /**
51888
51907
  * @license lucide-react v0.575.0 - ISC
51889
51908
  *
51890
51909
  * This source code is licensed under the ISC license.
51891
51910
  * See the LICENSE file in the root directory of this source tree.
51892
51911
  */
51893
- const __iconNode$T = [
51912
+ const __iconNode$U = [
51894
51913
  ["rect", { width: "8", height: "4", x: "8", y: "2", rx: "1", ry: "1", key: "tgr4d6" }],
51895
51914
  ["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" }],
51896
51915
  ["path", { d: "M16 4h2a2 2 0 0 1 2 2v4", key: "3hqy98" }],
51897
51916
  ["path", { d: "M21 14H11", key: "1bme5i" }],
51898
51917
  ["path", { d: "m15 10-4 4 4 4", key: "5dvupr" }]
51899
51918
  ];
51900
- const ClipboardCopy = createLucideIcon("clipboard-copy", __iconNode$T);
51919
+ const ClipboardCopy = createLucideIcon("clipboard-copy", __iconNode$U);
51901
51920
  /**
51902
51921
  * @license lucide-react v0.575.0 - ISC
51903
51922
  *
51904
51923
  * This source code is licensed under the ISC license.
51905
51924
  * See the LICENSE file in the root directory of this source tree.
51906
51925
  */
51907
- const __iconNode$S = [
51926
+ const __iconNode$T = [
51908
51927
  ["path", { d: "m18 16 4-4-4-4", key: "1inbqp" }],
51909
51928
  ["path", { d: "m6 8-4 4 4 4", key: "15zrgr" }],
51910
51929
  ["path", { d: "m14.5 4-5 16", key: "e7oirm" }]
51911
51930
  ];
51912
- const CodeXml = createLucideIcon("code-xml", __iconNode$S);
51931
+ const CodeXml = createLucideIcon("code-xml", __iconNode$T);
51913
51932
  /**
51914
51933
  * @license lucide-react v0.575.0 - ISC
51915
51934
  *
51916
51935
  * This source code is licensed under the ISC license.
51917
51936
  * See the LICENSE file in the root directory of this source tree.
51918
51937
  */
51919
- const __iconNode$R = [
51938
+ const __iconNode$S = [
51920
51939
  ["path", { d: "m16 18 6-6-6-6", key: "eg8j8" }],
51921
51940
  ["path", { d: "m8 6-6 6 6 6", key: "ppft3o" }]
51922
51941
  ];
51923
- const Code = createLucideIcon("code", __iconNode$R);
51942
+ const Code = createLucideIcon("code", __iconNode$S);
51924
51943
  /**
51925
51944
  * @license lucide-react v0.575.0 - ISC
51926
51945
  *
51927
51946
  * This source code is licensed under the ISC license.
51928
51947
  * See the LICENSE file in the root directory of this source tree.
51929
51948
  */
51930
- const __iconNode$Q = [
51949
+ const __iconNode$R = [
51931
51950
  ["rect", { width: "14", height: "14", x: "8", y: "8", rx: "2", ry: "2", key: "17jyea" }],
51932
51951
  ["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" }]
51933
51952
  ];
51934
- const Copy = createLucideIcon("copy", __iconNode$Q);
51953
+ const Copy = createLucideIcon("copy", __iconNode$R);
51935
51954
  /**
51936
51955
  * @license lucide-react v0.575.0 - ISC
51937
51956
  *
51938
51957
  * This source code is licensed under the ISC license.
51939
51958
  * See the LICENSE file in the root directory of this source tree.
51940
51959
  */
51941
- const __iconNode$P = [
51960
+ const __iconNode$Q = [
51942
51961
  ["ellipse", { cx: "12", cy: "5", rx: "9", ry: "3", key: "msslwz" }],
51943
51962
  ["path", { d: "M3 5V19A9 3 0 0 0 21 19V5", key: "1wlel7" }],
51944
51963
  ["path", { d: "M3 12A9 3 0 0 0 21 12", key: "mv7ke4" }]
51945
51964
  ];
51946
- const Database = createLucideIcon("database", __iconNode$P);
51965
+ const Database = createLucideIcon("database", __iconNode$Q);
51947
51966
  /**
51948
51967
  * @license lucide-react v0.575.0 - ISC
51949
51968
  *
51950
51969
  * This source code is licensed under the ISC license.
51951
51970
  * See the LICENSE file in the root directory of this source tree.
51952
51971
  */
51953
- const __iconNode$O = [
51972
+ const __iconNode$P = [
51954
51973
  ["path", { d: "M12 15V3", key: "m9g1x1" }],
51955
51974
  ["path", { d: "M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4", key: "ih7n3h" }],
51956
51975
  ["path", { d: "m7 10 5 5 5-5", key: "brsn70" }]
51957
51976
  ];
51958
- const Download = createLucideIcon("download", __iconNode$O);
51977
+ const Download = createLucideIcon("download", __iconNode$P);
51959
51978
  /**
51960
51979
  * @license lucide-react v0.575.0 - ISC
51961
51980
  *
51962
51981
  * This source code is licensed under the ISC license.
51963
51982
  * See the LICENSE file in the root directory of this source tree.
51964
51983
  */
51965
- const __iconNode$N = [
51984
+ const __iconNode$O = [
51966
51985
  ["circle", { cx: "12", cy: "12", r: "1", key: "41hilf" }],
51967
51986
  ["circle", { cx: "19", cy: "12", r: "1", key: "1wjl8i" }],
51968
51987
  ["circle", { cx: "5", cy: "12", r: "1", key: "1pcz8c" }]
51969
51988
  ];
51970
- const Ellipsis = createLucideIcon("ellipsis", __iconNode$N);
51989
+ const Ellipsis = createLucideIcon("ellipsis", __iconNode$O);
51971
51990
  /**
51972
51991
  * @license lucide-react v0.575.0 - ISC
51973
51992
  *
51974
51993
  * This source code is licensed under the ISC license.
51975
51994
  * See the LICENSE file in the root directory of this source tree.
51976
51995
  */
51977
- const __iconNode$M = [
51996
+ const __iconNode$N = [
51978
51997
  ["path", { d: "M15 3h6v6", key: "1q9fwt" }],
51979
51998
  ["path", { d: "M10 14 21 3", key: "gplh6r" }],
51980
51999
  ["path", { d: "M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6", key: "a6xqqp" }]
51981
52000
  ];
51982
- const ExternalLink = createLucideIcon("external-link", __iconNode$M);
52001
+ const ExternalLink = createLucideIcon("external-link", __iconNode$N);
51983
52002
  /**
51984
52003
  * @license lucide-react v0.575.0 - ISC
51985
52004
  *
51986
52005
  * This source code is licensed under the ISC license.
51987
52006
  * See the LICENSE file in the root directory of this source tree.
51988
52007
  */
51989
- const __iconNode$L = [
52008
+ const __iconNode$M = [
51990
52009
  [
51991
52010
  "path",
51992
52011
  {
@@ -51998,14 +52017,14 @@ const __iconNode$L = [
51998
52017
  ["path", { d: "M9 15h6", key: "cctwl0" }],
51999
52018
  ["path", { d: "M12 18v-6", key: "17g6i2" }]
52000
52019
  ];
52001
- const FilePlus = createLucideIcon("file-plus", __iconNode$L);
52020
+ const FilePlus = createLucideIcon("file-plus", __iconNode$M);
52002
52021
  /**
52003
52022
  * @license lucide-react v0.575.0 - ISC
52004
52023
  *
52005
52024
  * This source code is licensed under the ISC license.
52006
52025
  * See the LICENSE file in the root directory of this source tree.
52007
52026
  */
52008
- const __iconNode$K = [
52027
+ const __iconNode$L = [
52009
52028
  [
52010
52029
  "path",
52011
52030
  {
@@ -52019,14 +52038,14 @@ const __iconNode$K = [
52019
52038
  ["path", { d: "M8 17h2", key: "2yhykz" }],
52020
52039
  ["path", { d: "M14 17h2", key: "10kma7" }]
52021
52040
  ];
52022
- const FileSpreadsheet = createLucideIcon("file-spreadsheet", __iconNode$K);
52041
+ const FileSpreadsheet = createLucideIcon("file-spreadsheet", __iconNode$L);
52023
52042
  /**
52024
52043
  * @license lucide-react v0.575.0 - ISC
52025
52044
  *
52026
52045
  * This source code is licensed under the ISC license.
52027
52046
  * See the LICENSE file in the root directory of this source tree.
52028
52047
  */
52029
- const __iconNode$J = [
52048
+ const __iconNode$K = [
52030
52049
  [
52031
52050
  "path",
52032
52051
  {
@@ -52039,14 +52058,14 @@ const __iconNode$J = [
52039
52058
  ["path", { d: "M16 13H8", key: "t4e002" }],
52040
52059
  ["path", { d: "M16 17H8", key: "z1uh3a" }]
52041
52060
  ];
52042
- const FileText = createLucideIcon("file-text", __iconNode$J);
52061
+ const FileText = createLucideIcon("file-text", __iconNode$K);
52043
52062
  /**
52044
52063
  * @license lucide-react v0.575.0 - ISC
52045
52064
  *
52046
52065
  * This source code is licensed under the ISC license.
52047
52066
  * See the LICENSE file in the root directory of this source tree.
52048
52067
  */
52049
- const __iconNode$I = [
52068
+ const __iconNode$J = [
52050
52069
  [
52051
52070
  "path",
52052
52071
  {
@@ -52056,14 +52075,14 @@ const __iconNode$I = [
52056
52075
  ],
52057
52076
  ["path", { d: "M14 2v5a1 1 0 0 0 1 1h5", key: "wfsgrz" }]
52058
52077
  ];
52059
- const File$1 = createLucideIcon("file", __iconNode$I);
52078
+ const File$1 = createLucideIcon("file", __iconNode$J);
52060
52079
  /**
52061
52080
  * @license lucide-react v0.575.0 - ISC
52062
52081
  *
52063
52082
  * This source code is licensed under the ISC license.
52064
52083
  * See the LICENSE file in the root directory of this source tree.
52065
52084
  */
52066
- const __iconNode$H = [
52085
+ const __iconNode$I = [
52067
52086
  [
52068
52087
  "path",
52069
52088
  {
@@ -52075,14 +52094,14 @@ const __iconNode$H = [
52075
52094
  ["path", { d: "M12 10v2", key: "hh53o1" }],
52076
52095
  ["path", { d: "M16 10v6", key: "1d6xys" }]
52077
52096
  ];
52078
- const FolderKanban = createLucideIcon("folder-kanban", __iconNode$H);
52097
+ const FolderKanban = createLucideIcon("folder-kanban", __iconNode$I);
52079
52098
  /**
52080
52099
  * @license lucide-react v0.575.0 - ISC
52081
52100
  *
52082
52101
  * This source code is licensed under the ISC license.
52083
52102
  * See the LICENSE file in the root directory of this source tree.
52084
52103
  */
52085
- const __iconNode$G = [
52104
+ const __iconNode$H = [
52086
52105
  [
52087
52106
  "path",
52088
52107
  {
@@ -52091,14 +52110,14 @@ const __iconNode$G = [
52091
52110
  }
52092
52111
  ]
52093
52112
  ];
52094
- const FolderOpen = createLucideIcon("folder-open", __iconNode$G);
52113
+ const FolderOpen = createLucideIcon("folder-open", __iconNode$H);
52095
52114
  /**
52096
52115
  * @license lucide-react v0.575.0 - ISC
52097
52116
  *
52098
52117
  * This source code is licensed under the ISC license.
52099
52118
  * See the LICENSE file in the root directory of this source tree.
52100
52119
  */
52101
- const __iconNode$F = [
52120
+ const __iconNode$G = [
52102
52121
  [
52103
52122
  "path",
52104
52123
  {
@@ -52107,26 +52126,26 @@ const __iconNode$F = [
52107
52126
  }
52108
52127
  ]
52109
52128
  ];
52110
- const Folder = createLucideIcon("folder", __iconNode$F);
52129
+ const Folder = createLucideIcon("folder", __iconNode$G);
52111
52130
  /**
52112
52131
  * @license lucide-react v0.575.0 - ISC
52113
52132
  *
52114
52133
  * This source code is licensed under the ISC license.
52115
52134
  * See the LICENSE file in the root directory of this source tree.
52116
52135
  */
52117
- const __iconNode$E = [
52136
+ const __iconNode$F = [
52118
52137
  ["circle", { cx: "12", cy: "12", r: "10", key: "1mglay" }],
52119
52138
  ["path", { d: "M12 2a14.5 14.5 0 0 0 0 20 14.5 14.5 0 0 0 0-20", key: "13o1zl" }],
52120
52139
  ["path", { d: "M2 12h20", key: "9i4pu4" }]
52121
52140
  ];
52122
- const Globe = createLucideIcon("globe", __iconNode$E);
52141
+ const Globe = createLucideIcon("globe", __iconNode$F);
52123
52142
  /**
52124
52143
  * @license lucide-react v0.575.0 - ISC
52125
52144
  *
52126
52145
  * This source code is licensed under the ISC license.
52127
52146
  * See the LICENSE file in the root directory of this source tree.
52128
52147
  */
52129
- const __iconNode$D = [
52148
+ const __iconNode$E = [
52130
52149
  ["path", { d: "M10 16h.01", key: "1bzywj" }],
52131
52150
  [
52132
52151
  "path",
@@ -52138,26 +52157,26 @@ const __iconNode$D = [
52138
52157
  ["path", { d: "M21.946 12.013H2.054", key: "zqlbp7" }],
52139
52158
  ["path", { d: "M6 16h.01", key: "1pmjb7" }]
52140
52159
  ];
52141
- const HardDrive = createLucideIcon("hard-drive", __iconNode$D);
52160
+ const HardDrive = createLucideIcon("hard-drive", __iconNode$E);
52142
52161
  /**
52143
52162
  * @license lucide-react v0.575.0 - ISC
52144
52163
  *
52145
52164
  * This source code is licensed under the ISC license.
52146
52165
  * See the LICENSE file in the root directory of this source tree.
52147
52166
  */
52148
- const __iconNode$C = [
52167
+ const __iconNode$D = [
52149
52168
  ["rect", { width: "18", height: "18", x: "3", y: "3", rx: "2", ry: "2", key: "1m3agn" }],
52150
52169
  ["circle", { cx: "9", cy: "9", r: "2", key: "af1f0g" }],
52151
52170
  ["path", { d: "m21 15-3.086-3.086a2 2 0 0 0-2.828 0L6 21", key: "1xmnt7" }]
52152
52171
  ];
52153
- const Image = createLucideIcon("image", __iconNode$C);
52172
+ const Image = createLucideIcon("image", __iconNode$D);
52154
52173
  /**
52155
52174
  * @license lucide-react v0.575.0 - ISC
52156
52175
  *
52157
52176
  * This source code is licensed under the ISC license.
52158
52177
  * See the LICENSE file in the root directory of this source tree.
52159
52178
  */
52160
- const __iconNode$B = [
52179
+ const __iconNode$C = [
52161
52180
  [
52162
52181
  "path",
52163
52182
  {
@@ -52180,31 +52199,45 @@ const __iconNode$B = [
52180
52199
  }
52181
52200
  ]
52182
52201
  ];
52183
- const Layers = createLucideIcon("layers", __iconNode$B);
52202
+ const Layers = createLucideIcon("layers", __iconNode$C);
52184
52203
  /**
52185
52204
  * @license lucide-react v0.575.0 - ISC
52186
52205
  *
52187
52206
  * This source code is licensed under the ISC license.
52188
52207
  * See the LICENSE file in the root directory of this source tree.
52189
52208
  */
52190
- const __iconNode$A = [
52209
+ const __iconNode$B = [
52191
52210
  ["rect", { width: "7", height: "7", x: "3", y: "3", rx: "1", key: "1g98yp" }],
52192
52211
  ["rect", { width: "7", height: "7", x: "14", y: "3", rx: "1", key: "6d4xhi" }],
52193
52212
  ["rect", { width: "7", height: "7", x: "14", y: "14", rx: "1", key: "nxv5o0" }],
52194
52213
  ["rect", { width: "7", height: "7", x: "3", y: "14", rx: "1", key: "1bb6yr" }]
52195
52214
  ];
52196
- const LayoutGrid = createLucideIcon("layout-grid", __iconNode$A);
52215
+ const LayoutGrid = createLucideIcon("layout-grid", __iconNode$B);
52197
52216
  /**
52198
52217
  * @license lucide-react v0.575.0 - ISC
52199
52218
  *
52200
52219
  * This source code is licensed under the ISC license.
52201
52220
  * See the LICENSE file in the root directory of this source tree.
52202
52221
  */
52203
- const __iconNode$z = [
52222
+ const __iconNode$A = [
52204
52223
  ["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" }],
52205
52224
  ["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" }]
52206
52225
  ];
52207
- const Link = createLucideIcon("link", __iconNode$z);
52226
+ const Link = createLucideIcon("link", __iconNode$A);
52227
+ /**
52228
+ * @license lucide-react v0.575.0 - ISC
52229
+ *
52230
+ * This source code is licensed under the ISC license.
52231
+ * See the LICENSE file in the root directory of this source tree.
52232
+ */
52233
+ const __iconNode$z = [
52234
+ ["path", { d: "M13 5h8", key: "a7qcls" }],
52235
+ ["path", { d: "M13 12h8", key: "h98zly" }],
52236
+ ["path", { d: "M13 19h8", key: "c3s6r1" }],
52237
+ ["path", { d: "m3 17 2 2 4-4", key: "1jhpwq" }],
52238
+ ["path", { d: "m3 7 2 2 4-4", key: "1obspn" }]
52239
+ ];
52240
+ const ListChecks = createLucideIcon("list-checks", __iconNode$z);
52208
52241
  /**
52209
52242
  * @license lucide-react v0.575.0 - ISC
52210
52243
  *
@@ -55435,7 +55468,7 @@ const MentionSuggestionPopup = forwardRef(({ store, query, command: command2, cl
55435
55468
  {
55436
55469
  ref: refs.setFloating,
55437
55470
  style: floatingStyles,
55438
- className: "z-[9999]",
55471
+ className: "athena-sdk athena-sdk-chrome z-[9999]",
55439
55472
  onMouseDown: (e) => e.preventDefault(),
55440
55473
  children: /* @__PURE__ */ jsx(
55441
55474
  MentionSuggestionList,
@@ -57583,6 +57616,233 @@ const ReadAssetToolUI = memo(
57583
57616
  ReadAssetToolUIImpl
57584
57617
  );
57585
57618
  ReadAssetToolUI.displayName = "ReadAssetToolUI";
57619
+ const STEP_STATUSES = [
57620
+ "pending",
57621
+ "in_progress",
57622
+ "completed",
57623
+ "cancelled",
57624
+ "failed"
57625
+ ];
57626
+ function asRecord$1(value) {
57627
+ return typeof value === "object" && value !== null ? value : null;
57628
+ }
57629
+ function asStatus(value) {
57630
+ return typeof value === "string" && STEP_STATUSES.includes(value) ? value : "pending";
57631
+ }
57632
+ function parseSteps(value) {
57633
+ if (!Array.isArray(value)) return [];
57634
+ const steps = [];
57635
+ for (const raw of value) {
57636
+ const record2 = asRecord$1(raw);
57637
+ if (!record2) continue;
57638
+ const content = record2.content ?? record2.task ?? record2.title;
57639
+ if (typeof content !== "string" || content.trim() === "") continue;
57640
+ steps.push({
57641
+ id: typeof record2.id === "string" ? record2.id : void 0,
57642
+ content: content.trim(),
57643
+ status: asStatus(record2.status)
57644
+ });
57645
+ }
57646
+ return steps;
57647
+ }
57648
+ function asDescription(value) {
57649
+ return typeof value === "string" && value.trim() !== "" ? value.trim() : void 0;
57650
+ }
57651
+ function parsePartialSteps(argsText) {
57652
+ if (!argsText) return [];
57653
+ const steps = [];
57654
+ const objectPattern = /\{(?:[^{}\\"]|"(?:[^"\\]|\\.)*")*\}?/g;
57655
+ for (const [chunk] of argsText.matchAll(objectPattern)) {
57656
+ const contentMatch = /"(?:content|task|title)"\s*:\s*"((?:[^"\\]|\\.)*)"/.exec(
57657
+ chunk
57658
+ );
57659
+ if (!contentMatch) continue;
57660
+ let content;
57661
+ try {
57662
+ content = JSON.parse(`"${contentMatch[1]}"`);
57663
+ } catch {
57664
+ content = contentMatch[1];
57665
+ }
57666
+ if (content.trim() === "") continue;
57667
+ const statusMatch = /"status"\s*:\s*"([a-z_]+)"/.exec(chunk);
57668
+ steps.push({
57669
+ content: content.trim(),
57670
+ status: asStatus(statusMatch == null ? void 0 : statusMatch[1])
57671
+ });
57672
+ }
57673
+ return steps;
57674
+ }
57675
+ function parseTodoPlan({
57676
+ args,
57677
+ argsText,
57678
+ result
57679
+ }) {
57680
+ const argsRecord = asRecord$1(args);
57681
+ const argSteps = parseSteps(argsRecord == null ? void 0 : argsRecord.todos);
57682
+ let resultRecord = asRecord$1(result);
57683
+ if (!resultRecord && typeof result === "string") {
57684
+ try {
57685
+ resultRecord = asRecord$1(JSON.parse(result));
57686
+ } catch {
57687
+ resultRecord = null;
57688
+ }
57689
+ }
57690
+ const hasResultTodos = Array.isArray(resultRecord == null ? void 0 : resultRecord.todos);
57691
+ const steps = hasResultTodos ? parseSteps(resultRecord == null ? void 0 : resultRecord.todos) : argSteps.length > 0 ? argSteps : parsePartialSteps(argsText);
57692
+ return {
57693
+ steps,
57694
+ changeDescription: asDescription(resultRecord == null ? void 0 : resultRecord.description) ?? asDescription(resultRecord == null ? void 0 : resultRecord.todoChangeDescription)
57695
+ };
57696
+ }
57697
+ function StepMarker({
57698
+ status,
57699
+ index: index2
57700
+ }) {
57701
+ if (status === "completed") {
57702
+ return /* @__PURE__ */ jsx("span", { className: "flex size-[18px] shrink-0 items-center justify-center rounded-full bg-emerald-500 text-white", children: /* @__PURE__ */ jsx(Check, { className: "size-3", strokeWidth: 3 }) });
57703
+ }
57704
+ if (status === "in_progress") {
57705
+ return /* @__PURE__ */ jsx("span", { className: "flex size-[18px] shrink-0 items-center justify-center rounded-full bg-primary/10 text-primary", children: /* @__PURE__ */ jsx(Loader, { className: "size-3 animate-spin", strokeWidth: 3 }) });
57706
+ }
57707
+ if (status === "failed") {
57708
+ return /* @__PURE__ */ jsx("span", { className: "flex size-[18px] shrink-0 items-center justify-center rounded-full bg-destructive/10 text-destructive", children: /* @__PURE__ */ jsx(X, { className: "size-3", strokeWidth: 3 }) });
57709
+ }
57710
+ if (status === "cancelled") {
57711
+ return /* @__PURE__ */ jsx("span", { className: "flex size-[18px] shrink-0 items-center justify-center rounded-full border border-border text-muted-foreground", children: /* @__PURE__ */ jsx(X, { className: "size-3", strokeWidth: 3 }) });
57712
+ }
57713
+ return /* @__PURE__ */ 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 });
57714
+ }
57715
+ function PlanBadge({
57716
+ resolved,
57717
+ total
57718
+ }) {
57719
+ const isDone = total > 0 && resolved === total;
57720
+ return /* @__PURE__ */ jsx(
57721
+ "span",
57722
+ {
57723
+ className: cn(
57724
+ "flex size-8 shrink-0 items-center justify-center rounded-lg",
57725
+ isDone && "bg-emerald-50 text-emerald-600",
57726
+ !isDone && "bg-primary/10 text-primary"
57727
+ ),
57728
+ children: isDone ? /* @__PURE__ */ jsx(Check, { className: "size-4", strokeWidth: 3 }) : /* @__PURE__ */ jsx(ListChecks, { className: "size-4" })
57729
+ }
57730
+ );
57731
+ }
57732
+ const WriteTodosToolUIImpl = ({
57733
+ args,
57734
+ argsText,
57735
+ result,
57736
+ status
57737
+ }) => {
57738
+ const { steps, changeDescription } = useMemo(
57739
+ () => parseTodoPlan({ args, argsText, result }),
57740
+ [args, argsText, result]
57741
+ );
57742
+ const [collapsed, setCollapsed] = useState(false);
57743
+ const completed = steps.filter((s) => s.status === "completed").length;
57744
+ const stopped = steps.filter(
57745
+ (s) => s.status === "cancelled" || s.status === "failed"
57746
+ ).length;
57747
+ const current = steps.find((s) => s.status === "in_progress");
57748
+ const total = steps.length;
57749
+ const resolved = completed + stopped;
57750
+ const isWriting = (status == null ? void 0 : status.type) === "running";
57751
+ const isDone = total > 0 && resolved === total;
57752
+ if (total === 0) {
57753
+ return isWriting ? /* @__PURE__ */ 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: [
57754
+ /* @__PURE__ */ jsx(Loader, { className: "size-3.5 animate-spin text-primary" }),
57755
+ /* @__PURE__ */ jsx("span", { className: "text-[13px] font-medium text-foreground", children: "Planning..." })
57756
+ ] }) : null;
57757
+ }
57758
+ const heading2 = isWriting ? "Updating plan" : isDone ? "Plan complete" : completed === 0 && !current ? "Plan" : "Plan in progress";
57759
+ const subtitle = changeDescription ?? (current ? current.content : void 0);
57760
+ return /* @__PURE__ */ jsxs("div", { className: "my-3 w-full rounded-xl border border-border/60 bg-background shadow-sm", children: [
57761
+ /* @__PURE__ */ jsxs("div", { className: "sticky top-0 z-20 overflow-hidden rounded-t-xl bg-background", children: [
57762
+ /* @__PURE__ */ jsxs(
57763
+ "button",
57764
+ {
57765
+ type: "button",
57766
+ onClick: () => setCollapsed((prev) => !prev),
57767
+ className: "flex w-full items-center gap-3 px-4 py-3 text-left transition-colors hover:bg-muted/30",
57768
+ "aria-expanded": !collapsed,
57769
+ children: [
57770
+ /* @__PURE__ */ jsx(PlanBadge, { resolved, total }),
57771
+ /* @__PURE__ */ jsxs("span", { className: "min-w-0 flex-1", children: [
57772
+ /* @__PURE__ */ jsxs("span", { className: "flex items-baseline gap-2", children: [
57773
+ /* @__PURE__ */ jsx("span", { className: "text-[13px] font-medium text-foreground", children: heading2 }),
57774
+ /* @__PURE__ */ jsxs("span", { className: "text-[11px] tabular-nums text-muted-foreground", children: [
57775
+ resolved,
57776
+ "/",
57777
+ total,
57778
+ " steps"
57779
+ ] })
57780
+ ] }),
57781
+ subtitle && /* @__PURE__ */ jsx("span", { className: "block truncate text-[12px] text-muted-foreground", children: subtitle })
57782
+ ] }),
57783
+ /* @__PURE__ */ jsx(
57784
+ ChevronDown,
57785
+ {
57786
+ className: cn(
57787
+ "size-4 shrink-0 text-muted-foreground transition-transform duration-200",
57788
+ collapsed && "-rotate-90"
57789
+ )
57790
+ }
57791
+ )
57792
+ ]
57793
+ }
57794
+ ),
57795
+ /* @__PURE__ */ jsx("div", { className: "h-0.5 w-full bg-muted", children: /* @__PURE__ */ jsx(
57796
+ "div",
57797
+ {
57798
+ className: cn(
57799
+ "h-full transition-all duration-500",
57800
+ isDone ? "bg-emerald-500" : "bg-primary"
57801
+ ),
57802
+ style: { width: `${total > 0 ? resolved / total * 100 : 0}%` }
57803
+ }
57804
+ ) })
57805
+ ] }),
57806
+ !collapsed && /* @__PURE__ */ 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__ */ jsxs(
57807
+ "li",
57808
+ {
57809
+ className: cn(
57810
+ "relative flex items-start gap-2.5 px-4 py-1.5",
57811
+ step.status === "in_progress" && "bg-primary/5"
57812
+ ),
57813
+ children: [
57814
+ index2 < steps.length - 1 && /* @__PURE__ */ jsx(
57815
+ "span",
57816
+ {
57817
+ "aria-hidden": true,
57818
+ className: "absolute left-[calc(1rem+8px)] top-[26px] h-[calc(100%-18px)] w-px bg-border/60"
57819
+ }
57820
+ ),
57821
+ /* @__PURE__ */ jsx("span", { className: "relative z-10 mt-[3px]", children: /* @__PURE__ */ jsx(StepMarker, { status: step.status, index: index2 }) }),
57822
+ /* @__PURE__ */ jsx(
57823
+ "span",
57824
+ {
57825
+ className: cn(
57826
+ "text-[12.5px] leading-relaxed text-foreground",
57827
+ step.status === "completed" && "text-muted-foreground line-through decoration-muted-foreground/40",
57828
+ step.status === "cancelled" && "text-muted-foreground/70 line-through decoration-muted-foreground/40",
57829
+ step.status === "failed" && "text-destructive",
57830
+ step.status === "in_progress" && "font-medium text-primary",
57831
+ step.status === "pending" && "text-muted-foreground"
57832
+ ),
57833
+ children: step.content
57834
+ }
57835
+ )
57836
+ ]
57837
+ },
57838
+ step.id ?? `${index2}-${step.content}`
57839
+ )) })
57840
+ ] });
57841
+ };
57842
+ const WriteTodosToolUI = memo(
57843
+ WriteTodosToolUIImpl
57844
+ );
57845
+ WriteTodosToolUI.displayName = "WriteTodosToolUI";
57586
57846
  function tryParseJson(text2) {
57587
57847
  try {
57588
57848
  const p = JSON.parse(text2);
@@ -60699,7 +60959,8 @@ const TOOL_UI_REGISTRY = {
60699
60959
  get_database_table_schema: GetDatabaseTableSchemaToolUI,
60700
60960
  run_sql: RunSqlToolUI,
60701
60961
  run_database_sql: RunSqlToolUI,
60702
- run_sql_query_tool: RunSqlToolUI
60962
+ run_sql_query_tool: RunSqlToolUI,
60963
+ write_todos: WriteTodosToolUI
60703
60964
  };
60704
60965
  const TOOLKIT_THEMES = {
60705
60966
  Web: { color: "#7BCCFA" },
@@ -62742,7 +63003,7 @@ const AthenaAssetEmbed = ({
62742
63003
  if (error2) onError == null ? void 0 : onError(new Error(error2));
62743
63004
  }, [error2, onError]);
62744
63005
  if (isLoading) {
62745
- return loadingFallback ?? /* @__PURE__ */ jsxs("output", { className: "flex h-full w-full items-center justify-center", children: [
63006
+ return loadingFallback ?? /* @__PURE__ */ jsxs("output", { className: "athena-sdk-chrome flex h-full w-full items-center justify-center", children: [
62746
63007
  /* @__PURE__ */ jsx(LoaderCircle, { className: "size-6 animate-spin text-muted-foreground" }),
62747
63008
  /* @__PURE__ */ jsx("span", { className: "sr-only", children: "Loading asset" })
62748
63009
  ] });
@@ -62753,7 +63014,7 @@ const AthenaAssetEmbed = ({
62753
63014
  return errorFallback ?? /* @__PURE__ */ jsxs(
62754
63015
  "div",
62755
63016
  {
62756
- className: "flex h-full w-full items-center justify-center gap-2 p-4 text-sm text-muted-foreground",
63017
+ className: "athena-sdk-chrome flex h-full w-full items-center justify-center gap-2 p-4 text-sm text-muted-foreground",
62757
63018
  role: "alert",
62758
63019
  children: [
62759
63020
  /* @__PURE__ */ jsx(CircleAlert, { className: "size-4 text-destructive" }),
@@ -63126,21 +63387,27 @@ const AthenaLayout = ({
63126
63387
  /* @__PURE__ */ jsx(
63127
63388
  "div",
63128
63389
  {
63129
- 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",
63390
+ 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",
63130
63391
  onPointerDown,
63131
63392
  onPointerMove,
63132
63393
  onPointerUp
63133
63394
  }
63134
63395
  ),
63135
- /* @__PURE__ */ jsx("div", { className: "flex h-full flex-1 flex-col overflow-hidden", children: /* @__PURE__ */ jsx(AssetPanel, { manageAssetPanelHostRegistration: false }) })
63396
+ /* @__PURE__ */ jsx("div", { className: "athena-sdk-chrome flex h-full flex-1 flex-col overflow-hidden", children: /* @__PURE__ */ jsx(AssetPanel, { manageAssetPanelHostRegistration: false }) })
63136
63397
  ] });
63137
63398
  };
63138
63399
  function ThreadList({ className }) {
63139
63400
  const statewireList = useAthenaStatewireThreadList();
63140
63401
  if (statewireList) {
63141
- return /* @__PURE__ */ jsx(StatewireThreadList, { list: statewireList, className });
63402
+ return /* @__PURE__ */ jsx(
63403
+ StatewireThreadList,
63404
+ {
63405
+ list: statewireList,
63406
+ className: cn("athena-sdk-chrome", className)
63407
+ }
63408
+ );
63142
63409
  }
63143
- return /* @__PURE__ */ jsx(LegacyThreadList, { className });
63410
+ return /* @__PURE__ */ jsx(LegacyThreadList, { className: cn("athena-sdk-chrome", className) });
63144
63411
  }
63145
63412
  function LegacyThreadList({ className }) {
63146
63413
  const refresh = useRefreshThreadList();
@@ -63334,6 +63601,7 @@ export {
63334
63601
  TooltipTrigger,
63335
63602
  UpdateSheetRangeToolUI,
63336
63603
  WebSearchToolUI,
63604
+ WriteTodosToolUI,
63337
63605
  allowsMidRunSend,
63338
63606
  archiveThread,
63339
63607
  asHitlApproval,
@@ -63370,6 +63638,7 @@ export {
63370
63638
  normalizeResult,
63371
63639
  parseAthenaCitationLink,
63372
63640
  parseCollabAgentRef,
63641
+ parseTodoPlan,
63373
63642
  readInterruptMessage,
63374
63643
  readRejectionDetail,
63375
63644
  resetAssetAutoOpen,