@athenaintel/react 0.11.2 → 0.12.0

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.2";
36
+ const version$1 = "0.12.0";
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.
@@ -12513,7 +12525,7 @@ const ATHENA_TRANSPORTS = {
12513
12525
  legacy: "legacy",
12514
12526
  statewire: "statewire"
12515
12527
  };
12516
- const DEFAULT_ATHENA_TRANSPORT = ATHENA_TRANSPORTS.legacy;
12528
+ const DEFAULT_ATHENA_TRANSPORT = ATHENA_TRANSPORTS.statewire;
12517
12529
  function resolveAthenaTransport({
12518
12530
  transport
12519
12531
  }) {
@@ -51602,63 +51614,63 @@ const createLucideIcon = (iconName, iconNode) => {
51602
51614
  * This source code is licensed under the ISC license.
51603
51615
  * See the LICENSE file in the root directory of this source tree.
51604
51616
  */
51605
- const __iconNode$1d = [
51617
+ const __iconNode$1e = [
51606
51618
  ["rect", { width: "20", height: "5", x: "2", y: "3", rx: "1", key: "1wp1u1" }],
51607
51619
  ["path", { d: "M4 8v11a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8", key: "1s80jp" }],
51608
51620
  ["path", { d: "M10 12h4", key: "a56b0p" }]
51609
51621
  ];
51610
- const Archive = createLucideIcon("archive", __iconNode$1d);
51622
+ const Archive = createLucideIcon("archive", __iconNode$1e);
51611
51623
  /**
51612
51624
  * @license lucide-react v0.575.0 - ISC
51613
51625
  *
51614
51626
  * This source code is licensed under the ISC license.
51615
51627
  * See the LICENSE file in the root directory of this source tree.
51616
51628
  */
51617
- const __iconNode$1c = [
51629
+ const __iconNode$1d = [
51618
51630
  ["path", { d: "M12 5v14", key: "s699le" }],
51619
51631
  ["path", { d: "m19 12-7 7-7-7", key: "1idqje" }]
51620
51632
  ];
51621
- const ArrowDown = createLucideIcon("arrow-down", __iconNode$1c);
51633
+ const ArrowDown = createLucideIcon("arrow-down", __iconNode$1d);
51622
51634
  /**
51623
51635
  * @license lucide-react v0.575.0 - ISC
51624
51636
  *
51625
51637
  * This source code is licensed under the ISC license.
51626
51638
  * See the LICENSE file in the root directory of this source tree.
51627
51639
  */
51628
- const __iconNode$1b = [
51640
+ const __iconNode$1c = [
51629
51641
  ["path", { d: "m12 19-7-7 7-7", key: "1l729n" }],
51630
51642
  ["path", { d: "M19 12H5", key: "x3x0zl" }]
51631
51643
  ];
51632
- const ArrowLeft = createLucideIcon("arrow-left", __iconNode$1b);
51644
+ const ArrowLeft = createLucideIcon("arrow-left", __iconNode$1c);
51633
51645
  /**
51634
51646
  * @license lucide-react v0.575.0 - ISC
51635
51647
  *
51636
51648
  * This source code is licensed under the ISC license.
51637
51649
  * See the LICENSE file in the root directory of this source tree.
51638
51650
  */
51639
- const __iconNode$1a = [
51651
+ const __iconNode$1b = [
51640
51652
  ["path", { d: "M5 12h14", key: "1ays0h" }],
51641
51653
  ["path", { d: "m12 5 7 7-7 7", key: "xquz4c" }]
51642
51654
  ];
51643
- const ArrowRight = createLucideIcon("arrow-right", __iconNode$1a);
51655
+ const ArrowRight = createLucideIcon("arrow-right", __iconNode$1b);
51644
51656
  /**
51645
51657
  * @license lucide-react v0.575.0 - ISC
51646
51658
  *
51647
51659
  * This source code is licensed under the ISC license.
51648
51660
  * See the LICENSE file in the root directory of this source tree.
51649
51661
  */
51650
- const __iconNode$19 = [
51662
+ const __iconNode$1a = [
51651
51663
  ["path", { d: "m5 12 7-7 7 7", key: "hav0vg" }],
51652
51664
  ["path", { d: "M12 19V5", key: "x0mq9r" }]
51653
51665
  ];
51654
- const ArrowUp = createLucideIcon("arrow-up", __iconNode$19);
51666
+ const ArrowUp = createLucideIcon("arrow-up", __iconNode$1a);
51655
51667
  /**
51656
51668
  * @license lucide-react v0.575.0 - ISC
51657
51669
  *
51658
51670
  * This source code is licensed under the ISC license.
51659
51671
  * See the LICENSE file in the root directory of this source tree.
51660
51672
  */
51661
- const __iconNode$18 = [
51673
+ const __iconNode$19 = [
51662
51674
  ["path", { d: "M12 7v14", key: "1akyts" }],
51663
51675
  [
51664
51676
  "path",
@@ -51668,14 +51680,14 @@ const __iconNode$18 = [
51668
51680
  }
51669
51681
  ]
51670
51682
  ];
51671
- const BookOpen = createLucideIcon("book-open", __iconNode$18);
51683
+ const BookOpen = createLucideIcon("book-open", __iconNode$19);
51672
51684
  /**
51673
51685
  * @license lucide-react v0.575.0 - ISC
51674
51686
  *
51675
51687
  * This source code is licensed under the ISC license.
51676
51688
  * See the LICENSE file in the root directory of this source tree.
51677
51689
  */
51678
- const __iconNode$17 = [
51690
+ const __iconNode$18 = [
51679
51691
  [
51680
51692
  "path",
51681
51693
  {
@@ -51707,14 +51719,14 @@ const __iconNode$17 = [
51707
51719
  ["path", { d: "m12 8 4.74-2.85", key: "3rx089" }],
51708
51720
  ["path", { d: "M12 13.5V8", key: "1io7kd" }]
51709
51721
  ];
51710
- const Boxes = createLucideIcon("boxes", __iconNode$17);
51722
+ const Boxes = createLucideIcon("boxes", __iconNode$18);
51711
51723
  /**
51712
51724
  * @license lucide-react v0.575.0 - ISC
51713
51725
  *
51714
51726
  * This source code is licensed under the ISC license.
51715
51727
  * See the LICENSE file in the root directory of this source tree.
51716
51728
  */
51717
- const __iconNode$16 = [
51729
+ const __iconNode$17 = [
51718
51730
  ["path", { d: "M12 18V5", key: "adv99a" }],
51719
51731
  ["path", { d: "M15 13a4.17 4.17 0 0 1-3-4 4.17 4.17 0 0 1-3 4", key: "1e3is1" }],
51720
51732
  ["path", { d: "M17.598 6.5A3 3 0 1 0 12 5a3 3 0 1 0-5.598 1.5", key: "1gqd8o" }],
@@ -51724,27 +51736,27 @@ const __iconNode$16 = [
51724
51736
  ["path", { d: "M6 18a4 4 0 0 1-2-7.464", key: "k1g0md" }],
51725
51737
  ["path", { d: "M6.003 5.125a4 4 0 0 0-2.526 5.77", key: "q97ue3" }]
51726
51738
  ];
51727
- const Brain = createLucideIcon("brain", __iconNode$16);
51739
+ const Brain = createLucideIcon("brain", __iconNode$17);
51728
51740
  /**
51729
51741
  * @license lucide-react v0.575.0 - ISC
51730
51742
  *
51731
51743
  * This source code is licensed under the ISC license.
51732
51744
  * See the LICENSE file in the root directory of this source tree.
51733
51745
  */
51734
- const __iconNode$15 = [
51746
+ const __iconNode$16 = [
51735
51747
  ["path", { d: "M12 12h.01", key: "1mp3jc" }],
51736
51748
  ["path", { d: "M16 6V4a2 2 0 0 0-2-2h-4a2 2 0 0 0-2 2v2", key: "1ksdt3" }],
51737
51749
  ["path", { d: "M22 13a18.15 18.15 0 0 1-20 0", key: "12hx5q" }],
51738
51750
  ["rect", { width: "20", height: "14", x: "2", y: "6", rx: "2", key: "i6l2r4" }]
51739
51751
  ];
51740
- const BriefcaseBusiness = createLucideIcon("briefcase-business", __iconNode$15);
51752
+ const BriefcaseBusiness = createLucideIcon("briefcase-business", __iconNode$16);
51741
51753
  /**
51742
51754
  * @license lucide-react v0.575.0 - ISC
51743
51755
  *
51744
51756
  * This source code is licensed under the ISC license.
51745
51757
  * See the LICENSE file in the root directory of this source tree.
51746
51758
  */
51747
- const __iconNode$14 = [
51759
+ const __iconNode$15 = [
51748
51760
  [
51749
51761
  "path",
51750
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" }
@@ -51759,27 +51771,27 @@ const __iconNode$14 = [
51759
51771
  ],
51760
51772
  ["path", { d: "M7 5V3", key: "1t1388" }]
51761
51773
  ];
51762
- const Cable = createLucideIcon("cable", __iconNode$14);
51774
+ const Cable = createLucideIcon("cable", __iconNode$15);
51763
51775
  /**
51764
51776
  * @license lucide-react v0.575.0 - ISC
51765
51777
  *
51766
51778
  * This source code is licensed under the ISC license.
51767
51779
  * See the LICENSE file in the root directory of this source tree.
51768
51780
  */
51769
- const __iconNode$13 = [
51781
+ const __iconNode$14 = [
51770
51782
  ["path", { d: "M8 2v4", key: "1cmpym" }],
51771
51783
  ["path", { d: "M16 2v4", key: "4m81vk" }],
51772
51784
  ["rect", { width: "18", height: "18", x: "3", y: "4", rx: "2", key: "1hopcy" }],
51773
51785
  ["path", { d: "M3 10h18", key: "8toen8" }]
51774
51786
  ];
51775
- const Calendar = createLucideIcon("calendar", __iconNode$13);
51787
+ const Calendar = createLucideIcon("calendar", __iconNode$14);
51776
51788
  /**
51777
51789
  * @license lucide-react v0.575.0 - ISC
51778
51790
  *
51779
51791
  * This source code is licensed under the ISC license.
51780
51792
  * See the LICENSE file in the root directory of this source tree.
51781
51793
  */
51782
- const __iconNode$12 = [
51794
+ const __iconNode$13 = [
51783
51795
  [
51784
51796
  "path",
51785
51797
  {
@@ -51789,211 +51801,211 @@ const __iconNode$12 = [
51789
51801
  ],
51790
51802
  ["circle", { cx: "12", cy: "13", r: "3", key: "1vg3eu" }]
51791
51803
  ];
51792
- const Camera = createLucideIcon("camera", __iconNode$12);
51804
+ const Camera = createLucideIcon("camera", __iconNode$13);
51793
51805
  /**
51794
51806
  * @license lucide-react v0.575.0 - ISC
51795
51807
  *
51796
51808
  * This source code is licensed under the ISC license.
51797
51809
  * See the LICENSE file in the root directory of this source tree.
51798
51810
  */
51799
- const __iconNode$11 = [
51811
+ const __iconNode$12 = [
51800
51812
  ["path", { d: "M3 3v16a2 2 0 0 0 2 2h16", key: "c24i48" }],
51801
51813
  ["path", { d: "M7 16h8", key: "srdodz" }],
51802
51814
  ["path", { d: "M7 11h12", key: "127s9w" }],
51803
51815
  ["path", { d: "M7 6h3", key: "w9rmul" }]
51804
51816
  ];
51805
- const ChartBar = createLucideIcon("chart-bar", __iconNode$11);
51817
+ const ChartBar = createLucideIcon("chart-bar", __iconNode$12);
51806
51818
  /**
51807
51819
  * @license lucide-react v0.575.0 - ISC
51808
51820
  *
51809
51821
  * This source code is licensed under the ISC license.
51810
51822
  * See the LICENSE file in the root directory of this source tree.
51811
51823
  */
51812
- const __iconNode$10 = [
51824
+ const __iconNode$11 = [
51813
51825
  ["path", { d: "M3 3v16a2 2 0 0 0 2 2h16", key: "c24i48" }],
51814
51826
  ["path", { d: "M18 17V9", key: "2bz60n" }],
51815
51827
  ["path", { d: "M13 17V5", key: "1frdt8" }],
51816
51828
  ["path", { d: "M8 17v-3", key: "17ska0" }]
51817
51829
  ];
51818
- const ChartColumn = createLucideIcon("chart-column", __iconNode$10);
51830
+ const ChartColumn = createLucideIcon("chart-column", __iconNode$11);
51819
51831
  /**
51820
51832
  * @license lucide-react v0.575.0 - ISC
51821
51833
  *
51822
51834
  * This source code is licensed under the ISC license.
51823
51835
  * See the LICENSE file in the root directory of this source tree.
51824
51836
  */
51825
- const __iconNode$$ = [["path", { d: "M20 6 9 17l-5-5", key: "1gmf2c" }]];
51826
- 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);
51827
51839
  /**
51828
51840
  * @license lucide-react v0.575.0 - ISC
51829
51841
  *
51830
51842
  * This source code is licensed under the ISC license.
51831
51843
  * See the LICENSE file in the root directory of this source tree.
51832
51844
  */
51833
- const __iconNode$_ = [["path", { d: "m6 9 6 6 6-6", key: "qrunsl" }]];
51834
- 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$$);
51835
51847
  /**
51836
51848
  * @license lucide-react v0.575.0 - ISC
51837
51849
  *
51838
51850
  * This source code is licensed under the ISC license.
51839
51851
  * See the LICENSE file in the root directory of this source tree.
51840
51852
  */
51841
- const __iconNode$Z = [["path", { d: "m9 18 6-6-6-6", key: "mthhwq" }]];
51842
- 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$_);
51843
51855
  /**
51844
51856
  * @license lucide-react v0.575.0 - ISC
51845
51857
  *
51846
51858
  * This source code is licensed under the ISC license.
51847
51859
  * See the LICENSE file in the root directory of this source tree.
51848
51860
  */
51849
- const __iconNode$Y = [["path", { d: "m18 15-6-6-6 6", key: "153udz" }]];
51850
- 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);
51851
51863
  /**
51852
51864
  * @license lucide-react v0.575.0 - ISC
51853
51865
  *
51854
51866
  * This source code is licensed under the ISC license.
51855
51867
  * See the LICENSE file in the root directory of this source tree.
51856
51868
  */
51857
- const __iconNode$X = [
51869
+ const __iconNode$Y = [
51858
51870
  ["circle", { cx: "12", cy: "12", r: "10", key: "1mglay" }],
51859
51871
  ["line", { x1: "12", x2: "12", y1: "8", y2: "12", key: "1pkeuh" }],
51860
51872
  ["line", { x1: "12", x2: "12.01", y1: "16", y2: "16", key: "4dfq90" }]
51861
51873
  ];
51862
- const CircleAlert = createLucideIcon("circle-alert", __iconNode$X);
51874
+ const CircleAlert = createLucideIcon("circle-alert", __iconNode$Y);
51863
51875
  /**
51864
51876
  * @license lucide-react v0.575.0 - ISC
51865
51877
  *
51866
51878
  * This source code is licensed under the ISC license.
51867
51879
  * See the LICENSE file in the root directory of this source tree.
51868
51880
  */
51869
- const __iconNode$W = [
51881
+ const __iconNode$X = [
51870
51882
  ["circle", { cx: "12", cy: "12", r: "10", key: "1mglay" }],
51871
51883
  ["path", { d: "m9 12 2 2 4-4", key: "dzmm74" }]
51872
51884
  ];
51873
- const CircleCheck = createLucideIcon("circle-check", __iconNode$W);
51885
+ const CircleCheck = createLucideIcon("circle-check", __iconNode$X);
51874
51886
  /**
51875
51887
  * @license lucide-react v0.575.0 - ISC
51876
51888
  *
51877
51889
  * This source code is licensed under the ISC license.
51878
51890
  * See the LICENSE file in the root directory of this source tree.
51879
51891
  */
51880
- const __iconNode$V = [
51892
+ const __iconNode$W = [
51881
51893
  ["circle", { cx: "12", cy: "12", r: "10", key: "1mglay" }],
51882
51894
  ["path", { d: "m15 9-6 6", key: "1uzhvr" }],
51883
51895
  ["path", { d: "m9 9 6 6", key: "z0biqf" }]
51884
51896
  ];
51885
- const CircleX = createLucideIcon("circle-x", __iconNode$V);
51897
+ const CircleX = createLucideIcon("circle-x", __iconNode$W);
51886
51898
  /**
51887
51899
  * @license lucide-react v0.575.0 - ISC
51888
51900
  *
51889
51901
  * This source code is licensed under the ISC license.
51890
51902
  * See the LICENSE file in the root directory of this source tree.
51891
51903
  */
51892
- const __iconNode$U = [["circle", { cx: "12", cy: "12", r: "10", key: "1mglay" }]];
51893
- 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);
51894
51906
  /**
51895
51907
  * @license lucide-react v0.575.0 - ISC
51896
51908
  *
51897
51909
  * This source code is licensed under the ISC license.
51898
51910
  * See the LICENSE file in the root directory of this source tree.
51899
51911
  */
51900
- const __iconNode$T = [
51912
+ const __iconNode$U = [
51901
51913
  ["rect", { width: "8", height: "4", x: "8", y: "2", rx: "1", ry: "1", key: "tgr4d6" }],
51902
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" }],
51903
51915
  ["path", { d: "M16 4h2a2 2 0 0 1 2 2v4", key: "3hqy98" }],
51904
51916
  ["path", { d: "M21 14H11", key: "1bme5i" }],
51905
51917
  ["path", { d: "m15 10-4 4 4 4", key: "5dvupr" }]
51906
51918
  ];
51907
- const ClipboardCopy = createLucideIcon("clipboard-copy", __iconNode$T);
51919
+ const ClipboardCopy = createLucideIcon("clipboard-copy", __iconNode$U);
51908
51920
  /**
51909
51921
  * @license lucide-react v0.575.0 - ISC
51910
51922
  *
51911
51923
  * This source code is licensed under the ISC license.
51912
51924
  * See the LICENSE file in the root directory of this source tree.
51913
51925
  */
51914
- const __iconNode$S = [
51926
+ const __iconNode$T = [
51915
51927
  ["path", { d: "m18 16 4-4-4-4", key: "1inbqp" }],
51916
51928
  ["path", { d: "m6 8-4 4 4 4", key: "15zrgr" }],
51917
51929
  ["path", { d: "m14.5 4-5 16", key: "e7oirm" }]
51918
51930
  ];
51919
- const CodeXml = createLucideIcon("code-xml", __iconNode$S);
51931
+ const CodeXml = createLucideIcon("code-xml", __iconNode$T);
51920
51932
  /**
51921
51933
  * @license lucide-react v0.575.0 - ISC
51922
51934
  *
51923
51935
  * This source code is licensed under the ISC license.
51924
51936
  * See the LICENSE file in the root directory of this source tree.
51925
51937
  */
51926
- const __iconNode$R = [
51938
+ const __iconNode$S = [
51927
51939
  ["path", { d: "m16 18 6-6-6-6", key: "eg8j8" }],
51928
51940
  ["path", { d: "m8 6-6 6 6 6", key: "ppft3o" }]
51929
51941
  ];
51930
- const Code = createLucideIcon("code", __iconNode$R);
51942
+ const Code = createLucideIcon("code", __iconNode$S);
51931
51943
  /**
51932
51944
  * @license lucide-react v0.575.0 - ISC
51933
51945
  *
51934
51946
  * This source code is licensed under the ISC license.
51935
51947
  * See the LICENSE file in the root directory of this source tree.
51936
51948
  */
51937
- const __iconNode$Q = [
51949
+ const __iconNode$R = [
51938
51950
  ["rect", { width: "14", height: "14", x: "8", y: "8", rx: "2", ry: "2", key: "17jyea" }],
51939
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" }]
51940
51952
  ];
51941
- const Copy = createLucideIcon("copy", __iconNode$Q);
51953
+ const Copy = createLucideIcon("copy", __iconNode$R);
51942
51954
  /**
51943
51955
  * @license lucide-react v0.575.0 - ISC
51944
51956
  *
51945
51957
  * This source code is licensed under the ISC license.
51946
51958
  * See the LICENSE file in the root directory of this source tree.
51947
51959
  */
51948
- const __iconNode$P = [
51960
+ const __iconNode$Q = [
51949
51961
  ["ellipse", { cx: "12", cy: "5", rx: "9", ry: "3", key: "msslwz" }],
51950
51962
  ["path", { d: "M3 5V19A9 3 0 0 0 21 19V5", key: "1wlel7" }],
51951
51963
  ["path", { d: "M3 12A9 3 0 0 0 21 12", key: "mv7ke4" }]
51952
51964
  ];
51953
- const Database = createLucideIcon("database", __iconNode$P);
51965
+ const Database = createLucideIcon("database", __iconNode$Q);
51954
51966
  /**
51955
51967
  * @license lucide-react v0.575.0 - ISC
51956
51968
  *
51957
51969
  * This source code is licensed under the ISC license.
51958
51970
  * See the LICENSE file in the root directory of this source tree.
51959
51971
  */
51960
- const __iconNode$O = [
51972
+ const __iconNode$P = [
51961
51973
  ["path", { d: "M12 15V3", key: "m9g1x1" }],
51962
51974
  ["path", { d: "M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4", key: "ih7n3h" }],
51963
51975
  ["path", { d: "m7 10 5 5 5-5", key: "brsn70" }]
51964
51976
  ];
51965
- const Download = createLucideIcon("download", __iconNode$O);
51977
+ const Download = createLucideIcon("download", __iconNode$P);
51966
51978
  /**
51967
51979
  * @license lucide-react v0.575.0 - ISC
51968
51980
  *
51969
51981
  * This source code is licensed under the ISC license.
51970
51982
  * See the LICENSE file in the root directory of this source tree.
51971
51983
  */
51972
- const __iconNode$N = [
51984
+ const __iconNode$O = [
51973
51985
  ["circle", { cx: "12", cy: "12", r: "1", key: "41hilf" }],
51974
51986
  ["circle", { cx: "19", cy: "12", r: "1", key: "1wjl8i" }],
51975
51987
  ["circle", { cx: "5", cy: "12", r: "1", key: "1pcz8c" }]
51976
51988
  ];
51977
- const Ellipsis = createLucideIcon("ellipsis", __iconNode$N);
51989
+ const Ellipsis = createLucideIcon("ellipsis", __iconNode$O);
51978
51990
  /**
51979
51991
  * @license lucide-react v0.575.0 - ISC
51980
51992
  *
51981
51993
  * This source code is licensed under the ISC license.
51982
51994
  * See the LICENSE file in the root directory of this source tree.
51983
51995
  */
51984
- const __iconNode$M = [
51996
+ const __iconNode$N = [
51985
51997
  ["path", { d: "M15 3h6v6", key: "1q9fwt" }],
51986
51998
  ["path", { d: "M10 14 21 3", key: "gplh6r" }],
51987
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" }]
51988
52000
  ];
51989
- const ExternalLink = createLucideIcon("external-link", __iconNode$M);
52001
+ const ExternalLink = createLucideIcon("external-link", __iconNode$N);
51990
52002
  /**
51991
52003
  * @license lucide-react v0.575.0 - ISC
51992
52004
  *
51993
52005
  * This source code is licensed under the ISC license.
51994
52006
  * See the LICENSE file in the root directory of this source tree.
51995
52007
  */
51996
- const __iconNode$L = [
52008
+ const __iconNode$M = [
51997
52009
  [
51998
52010
  "path",
51999
52011
  {
@@ -52005,14 +52017,14 @@ const __iconNode$L = [
52005
52017
  ["path", { d: "M9 15h6", key: "cctwl0" }],
52006
52018
  ["path", { d: "M12 18v-6", key: "17g6i2" }]
52007
52019
  ];
52008
- const FilePlus = createLucideIcon("file-plus", __iconNode$L);
52020
+ const FilePlus = createLucideIcon("file-plus", __iconNode$M);
52009
52021
  /**
52010
52022
  * @license lucide-react v0.575.0 - ISC
52011
52023
  *
52012
52024
  * This source code is licensed under the ISC license.
52013
52025
  * See the LICENSE file in the root directory of this source tree.
52014
52026
  */
52015
- const __iconNode$K = [
52027
+ const __iconNode$L = [
52016
52028
  [
52017
52029
  "path",
52018
52030
  {
@@ -52026,14 +52038,14 @@ const __iconNode$K = [
52026
52038
  ["path", { d: "M8 17h2", key: "2yhykz" }],
52027
52039
  ["path", { d: "M14 17h2", key: "10kma7" }]
52028
52040
  ];
52029
- const FileSpreadsheet = createLucideIcon("file-spreadsheet", __iconNode$K);
52041
+ const FileSpreadsheet = createLucideIcon("file-spreadsheet", __iconNode$L);
52030
52042
  /**
52031
52043
  * @license lucide-react v0.575.0 - ISC
52032
52044
  *
52033
52045
  * This source code is licensed under the ISC license.
52034
52046
  * See the LICENSE file in the root directory of this source tree.
52035
52047
  */
52036
- const __iconNode$J = [
52048
+ const __iconNode$K = [
52037
52049
  [
52038
52050
  "path",
52039
52051
  {
@@ -52046,14 +52058,14 @@ const __iconNode$J = [
52046
52058
  ["path", { d: "M16 13H8", key: "t4e002" }],
52047
52059
  ["path", { d: "M16 17H8", key: "z1uh3a" }]
52048
52060
  ];
52049
- const FileText = createLucideIcon("file-text", __iconNode$J);
52061
+ const FileText = createLucideIcon("file-text", __iconNode$K);
52050
52062
  /**
52051
52063
  * @license lucide-react v0.575.0 - ISC
52052
52064
  *
52053
52065
  * This source code is licensed under the ISC license.
52054
52066
  * See the LICENSE file in the root directory of this source tree.
52055
52067
  */
52056
- const __iconNode$I = [
52068
+ const __iconNode$J = [
52057
52069
  [
52058
52070
  "path",
52059
52071
  {
@@ -52063,14 +52075,14 @@ const __iconNode$I = [
52063
52075
  ],
52064
52076
  ["path", { d: "M14 2v5a1 1 0 0 0 1 1h5", key: "wfsgrz" }]
52065
52077
  ];
52066
- const File$1 = createLucideIcon("file", __iconNode$I);
52078
+ const File$1 = createLucideIcon("file", __iconNode$J);
52067
52079
  /**
52068
52080
  * @license lucide-react v0.575.0 - ISC
52069
52081
  *
52070
52082
  * This source code is licensed under the ISC license.
52071
52083
  * See the LICENSE file in the root directory of this source tree.
52072
52084
  */
52073
- const __iconNode$H = [
52085
+ const __iconNode$I = [
52074
52086
  [
52075
52087
  "path",
52076
52088
  {
@@ -52082,14 +52094,14 @@ const __iconNode$H = [
52082
52094
  ["path", { d: "M12 10v2", key: "hh53o1" }],
52083
52095
  ["path", { d: "M16 10v6", key: "1d6xys" }]
52084
52096
  ];
52085
- const FolderKanban = createLucideIcon("folder-kanban", __iconNode$H);
52097
+ const FolderKanban = createLucideIcon("folder-kanban", __iconNode$I);
52086
52098
  /**
52087
52099
  * @license lucide-react v0.575.0 - ISC
52088
52100
  *
52089
52101
  * This source code is licensed under the ISC license.
52090
52102
  * See the LICENSE file in the root directory of this source tree.
52091
52103
  */
52092
- const __iconNode$G = [
52104
+ const __iconNode$H = [
52093
52105
  [
52094
52106
  "path",
52095
52107
  {
@@ -52098,14 +52110,14 @@ const __iconNode$G = [
52098
52110
  }
52099
52111
  ]
52100
52112
  ];
52101
- const FolderOpen = createLucideIcon("folder-open", __iconNode$G);
52113
+ const FolderOpen = createLucideIcon("folder-open", __iconNode$H);
52102
52114
  /**
52103
52115
  * @license lucide-react v0.575.0 - ISC
52104
52116
  *
52105
52117
  * This source code is licensed under the ISC license.
52106
52118
  * See the LICENSE file in the root directory of this source tree.
52107
52119
  */
52108
- const __iconNode$F = [
52120
+ const __iconNode$G = [
52109
52121
  [
52110
52122
  "path",
52111
52123
  {
@@ -52114,26 +52126,26 @@ const __iconNode$F = [
52114
52126
  }
52115
52127
  ]
52116
52128
  ];
52117
- const Folder = createLucideIcon("folder", __iconNode$F);
52129
+ const Folder = createLucideIcon("folder", __iconNode$G);
52118
52130
  /**
52119
52131
  * @license lucide-react v0.575.0 - ISC
52120
52132
  *
52121
52133
  * This source code is licensed under the ISC license.
52122
52134
  * See the LICENSE file in the root directory of this source tree.
52123
52135
  */
52124
- const __iconNode$E = [
52136
+ const __iconNode$F = [
52125
52137
  ["circle", { cx: "12", cy: "12", r: "10", key: "1mglay" }],
52126
52138
  ["path", { d: "M12 2a14.5 14.5 0 0 0 0 20 14.5 14.5 0 0 0 0-20", key: "13o1zl" }],
52127
52139
  ["path", { d: "M2 12h20", key: "9i4pu4" }]
52128
52140
  ];
52129
- const Globe = createLucideIcon("globe", __iconNode$E);
52141
+ const Globe = createLucideIcon("globe", __iconNode$F);
52130
52142
  /**
52131
52143
  * @license lucide-react v0.575.0 - ISC
52132
52144
  *
52133
52145
  * This source code is licensed under the ISC license.
52134
52146
  * See the LICENSE file in the root directory of this source tree.
52135
52147
  */
52136
- const __iconNode$D = [
52148
+ const __iconNode$E = [
52137
52149
  ["path", { d: "M10 16h.01", key: "1bzywj" }],
52138
52150
  [
52139
52151
  "path",
@@ -52145,26 +52157,26 @@ const __iconNode$D = [
52145
52157
  ["path", { d: "M21.946 12.013H2.054", key: "zqlbp7" }],
52146
52158
  ["path", { d: "M6 16h.01", key: "1pmjb7" }]
52147
52159
  ];
52148
- const HardDrive = createLucideIcon("hard-drive", __iconNode$D);
52160
+ const HardDrive = createLucideIcon("hard-drive", __iconNode$E);
52149
52161
  /**
52150
52162
  * @license lucide-react v0.575.0 - ISC
52151
52163
  *
52152
52164
  * This source code is licensed under the ISC license.
52153
52165
  * See the LICENSE file in the root directory of this source tree.
52154
52166
  */
52155
- const __iconNode$C = [
52167
+ const __iconNode$D = [
52156
52168
  ["rect", { width: "18", height: "18", x: "3", y: "3", rx: "2", ry: "2", key: "1m3agn" }],
52157
52169
  ["circle", { cx: "9", cy: "9", r: "2", key: "af1f0g" }],
52158
52170
  ["path", { d: "m21 15-3.086-3.086a2 2 0 0 0-2.828 0L6 21", key: "1xmnt7" }]
52159
52171
  ];
52160
- const Image = createLucideIcon("image", __iconNode$C);
52172
+ const Image = createLucideIcon("image", __iconNode$D);
52161
52173
  /**
52162
52174
  * @license lucide-react v0.575.0 - ISC
52163
52175
  *
52164
52176
  * This source code is licensed under the ISC license.
52165
52177
  * See the LICENSE file in the root directory of this source tree.
52166
52178
  */
52167
- const __iconNode$B = [
52179
+ const __iconNode$C = [
52168
52180
  [
52169
52181
  "path",
52170
52182
  {
@@ -52187,31 +52199,45 @@ const __iconNode$B = [
52187
52199
  }
52188
52200
  ]
52189
52201
  ];
52190
- const Layers = createLucideIcon("layers", __iconNode$B);
52202
+ const Layers = createLucideIcon("layers", __iconNode$C);
52191
52203
  /**
52192
52204
  * @license lucide-react v0.575.0 - ISC
52193
52205
  *
52194
52206
  * This source code is licensed under the ISC license.
52195
52207
  * See the LICENSE file in the root directory of this source tree.
52196
52208
  */
52197
- const __iconNode$A = [
52209
+ const __iconNode$B = [
52198
52210
  ["rect", { width: "7", height: "7", x: "3", y: "3", rx: "1", key: "1g98yp" }],
52199
52211
  ["rect", { width: "7", height: "7", x: "14", y: "3", rx: "1", key: "6d4xhi" }],
52200
52212
  ["rect", { width: "7", height: "7", x: "14", y: "14", rx: "1", key: "nxv5o0" }],
52201
52213
  ["rect", { width: "7", height: "7", x: "3", y: "14", rx: "1", key: "1bb6yr" }]
52202
52214
  ];
52203
- const LayoutGrid = createLucideIcon("layout-grid", __iconNode$A);
52215
+ const LayoutGrid = createLucideIcon("layout-grid", __iconNode$B);
52204
52216
  /**
52205
52217
  * @license lucide-react v0.575.0 - ISC
52206
52218
  *
52207
52219
  * This source code is licensed under the ISC license.
52208
52220
  * See the LICENSE file in the root directory of this source tree.
52209
52221
  */
52210
- const __iconNode$z = [
52222
+ const __iconNode$A = [
52211
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" }],
52212
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" }]
52213
52225
  ];
52214
- 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);
52215
52241
  /**
52216
52242
  * @license lucide-react v0.575.0 - ISC
52217
52243
  *
@@ -57590,6 +57616,233 @@ const ReadAssetToolUI = memo(
57590
57616
  ReadAssetToolUIImpl
57591
57617
  );
57592
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";
57593
57846
  function tryParseJson(text2) {
57594
57847
  try {
57595
57848
  const p = JSON.parse(text2);
@@ -60706,7 +60959,8 @@ const TOOL_UI_REGISTRY = {
60706
60959
  get_database_table_schema: GetDatabaseTableSchemaToolUI,
60707
60960
  run_sql: RunSqlToolUI,
60708
60961
  run_database_sql: RunSqlToolUI,
60709
- run_sql_query_tool: RunSqlToolUI
60962
+ run_sql_query_tool: RunSqlToolUI,
60963
+ write_todos: WriteTodosToolUI
60710
60964
  };
60711
60965
  const TOOLKIT_THEMES = {
60712
60966
  Web: { color: "#7BCCFA" },
@@ -63347,6 +63601,7 @@ export {
63347
63601
  TooltipTrigger,
63348
63602
  UpdateSheetRangeToolUI,
63349
63603
  WebSearchToolUI,
63604
+ WriteTodosToolUI,
63350
63605
  allowsMidRunSend,
63351
63606
  archiveThread,
63352
63607
  asHitlApproval,
@@ -63383,6 +63638,7 @@ export {
63383
63638
  normalizeResult,
63384
63639
  parseAthenaCitationLink,
63385
63640
  parseCollabAgentRef,
63641
+ parseTodoPlan,
63386
63642
  readInterruptMessage,
63387
63643
  readRejectionDetail,
63388
63644
  resetAssetAutoOpen,