@athenaintel/react 0.15.1 → 0.16.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.cjs CHANGED
@@ -19,7 +19,7 @@ var __privateWrapper = (obj, member, setter, getter) => ({
19
19
  });
20
20
  var _mutations, _scopes, _mutationId, _a2, _queries, _b, _queryCache, _mutationCache, _defaultOptions, _queryDefaults, _mutationDefaults, _mountCount, _unsubscribeFocus, _unsubscribeOnline, _c;
21
21
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
22
- const useRestConversationHistory = require("./use-rest-conversation-history-CBPqoHoe.cjs");
22
+ const useRestConversationHistory = require("./use-rest-conversation-history-Hc03lxFv.cjs");
23
23
  const React = require("react");
24
24
  const jsxRuntime = require("react/jsx-runtime");
25
25
  const react = require("@assistant-ui/react");
@@ -2228,7 +2228,7 @@ class Doc {
2228
2228
  return new F(...args, lines.join("\n"));
2229
2229
  }
2230
2230
  }
2231
- const version = {
2231
+ const version$1 = {
2232
2232
  major: 4,
2233
2233
  minor: 4,
2234
2234
  patch: 3
@@ -2239,7 +2239,7 @@ const $ZodType = /* @__PURE__ */ $constructor("$ZodType", (inst, def) => {
2239
2239
  inst ?? (inst = {});
2240
2240
  inst._zod.def = def;
2241
2241
  inst._zod.bag = inst._zod.bag || {};
2242
- inst._zod.version = version;
2242
+ inst._zod.version = version$1;
2243
2243
  const checks = [...inst._zod.def.checks ?? []];
2244
2244
  if (inst._zod.traits.has("$ZodCheck")) {
2245
2245
  checks.unshift(inst);
@@ -7992,6 +7992,7 @@ function useDeepAgentThread({
7992
7992
  const lastLegacyRunActiveRef = React.useRef(null);
7993
7993
  const lastProtocolRef = React.useRef(null);
7994
7994
  const appliedStateRunConfigThreadRef = React.useRef(null);
7995
+ const absentStateRunConfigAttachRef = React.useRef(null);
7995
7996
  const notifiedLegacyReadOnlyThreadRef = React.useRef(null);
7996
7997
  const lastLegacyObservedThreadRef = React.useRef(null);
7997
7998
  const threadIdRef = React.useRef(threadId);
@@ -8017,6 +8018,12 @@ function useDeepAgentThread({
8017
8018
  if (notifyRunConfig) {
8018
8019
  queueMicrotask(() => notifyRunConfig(stateRunConfig));
8019
8020
  }
8021
+ } else if (!stateRunConfig && appliedStateRunConfigThreadRef.current !== attachIdRef.current && absentStateRunConfigAttachRef.current !== attachIdRef.current && projectDeepAgentProtocol(state) !== null) {
8022
+ absentStateRunConfigAttachRef.current = attachIdRef.current;
8023
+ const notifyRunConfig = onServerRunConfigRef.current;
8024
+ if (notifyRunConfig) {
8025
+ queueMicrotask(() => notifyRunConfig(null));
8026
+ }
8020
8027
  }
8021
8028
  const stateLegacyReadOnly = state == null ? void 0 : state.legacyReadOnly;
8022
8029
  if (lastLegacyObservedThreadRef.current !== attachIdRef.current) {
@@ -8982,11 +8989,11 @@ function createContextScope(scopeName, createContextScopeDeps = []) {
8982
8989
  return [createContext3, composeContextScopes(createScope, ...createContextScopeDeps)];
8983
8990
  }
8984
8991
  __name$d(createContextScope, "createContextScope");
8985
- function composeContextScopes(...scopes) {
8986
- const baseScope = scopes[0];
8987
- if (scopes.length === 1) return baseScope;
8992
+ function composeContextScopes(...scopes2) {
8993
+ const baseScope = scopes2[0];
8994
+ if (scopes2.length === 1) return baseScope;
8988
8995
  const createScope = /* @__PURE__ */ __name$d(() => {
8989
- const scopeHooks = scopes.map((createScope2) => ({
8996
+ const scopeHooks = scopes2.map((createScope2) => ({
8990
8997
  useScope: createScope2(),
8991
8998
  scopeName: createScope2.scopeName
8992
8999
  }));
@@ -10772,22 +10779,22 @@ function TooltipContent({
10772
10779
  }
10773
10780
  const createStoreImpl = (createState) => {
10774
10781
  let state;
10775
- const listeners = /* @__PURE__ */ new Set();
10782
+ const listeners2 = /* @__PURE__ */ new Set();
10776
10783
  const setState = (partial2, replace2) => {
10777
10784
  const nextState = typeof partial2 === "function" ? partial2(state) : partial2;
10778
10785
  if (!Object.is(nextState, state)) {
10779
10786
  const previousState = state;
10780
10787
  state = (replace2 != null ? replace2 : typeof nextState !== "object" || nextState === null) ? nextState : Object.assign({}, state, nextState);
10781
- listeners.forEach((listener) => listener(state, previousState));
10788
+ listeners2.forEach((listener) => listener(state, previousState));
10782
10789
  }
10783
10790
  };
10784
10791
  const getState2 = () => state;
10785
10792
  const getInitialState = () => initialState;
10786
- const subscribe = (listener) => {
10787
- listeners.add(listener);
10788
- return () => listeners.delete(listener);
10793
+ const subscribe2 = (listener) => {
10794
+ listeners2.add(listener);
10795
+ return () => listeners2.delete(listener);
10789
10796
  };
10790
- const api = { setState, getState: getState2, getInitialState, subscribe };
10797
+ const api = { setState, getState: getState2, getInitialState, subscribe: subscribe2 };
10791
10798
  const initialState = state = createState(setState, getState2, api);
10792
10799
  return api;
10793
10800
  };
@@ -11030,7 +11037,10 @@ const useAssetPanelStore = create()(
11030
11037
  ...t,
11031
11038
  name: meta.name ?? t.name,
11032
11039
  type: meta.type ?? t.type,
11033
- slideNumber: "slideNumber" in meta ? meta.slideNumber : t.slideNumber
11040
+ slideNumber: "slideNumber" in meta ? meta.slideNumber : t.slideNumber,
11041
+ // A repeat citation click re-targets the open tab: the new
11042
+ // reference reaches the iframe (src change -> navigation).
11043
+ reference: "reference" in meta ? meta.reference : t.reference
11034
11044
  } : t
11035
11045
  ) : s.tabs;
11036
11046
  return { isOpen: true, tabs, activeTabId: assetId };
@@ -11039,7 +11049,8 @@ const useAssetPanelStore = create()(
11039
11049
  id: assetId,
11040
11050
  name: (meta == null ? void 0 : meta.name) ?? null,
11041
11051
  type: (meta == null ? void 0 : meta.type) ?? "unknown",
11042
- slideNumber: meta == null ? void 0 : meta.slideNumber
11052
+ slideNumber: meta == null ? void 0 : meta.slideNumber,
11053
+ reference: meta == null ? void 0 : meta.reference
11043
11054
  };
11044
11055
  return { isOpen: true, tabs: [...s.tabs, newTab], activeTabId: assetId };
11045
11056
  }),
@@ -23480,40 +23491,40 @@ function detectMentionTypeFromUrl(url) {
23480
23491
  * This source code is licensed under the ISC license.
23481
23492
  * See the LICENSE file in the root directory of this source tree.
23482
23493
  */
23483
- const __iconNode$K = [
23494
+ const __iconNode$L = [
23484
23495
  ["path", { d: "M12 5v14", key: "s699le" }],
23485
23496
  ["path", { d: "m19 12-7 7-7-7", key: "1idqje" }]
23486
23497
  ];
23487
- const ArrowDown = useRestConversationHistory.createLucideIcon("arrow-down", __iconNode$K);
23498
+ const ArrowDown = useRestConversationHistory.createLucideIcon("arrow-down", __iconNode$L);
23488
23499
  /**
23489
23500
  * @license lucide-react v0.575.0 - ISC
23490
23501
  *
23491
23502
  * This source code is licensed under the ISC license.
23492
23503
  * See the LICENSE file in the root directory of this source tree.
23493
23504
  */
23494
- const __iconNode$J = [
23505
+ const __iconNode$K = [
23495
23506
  ["path", { d: "m12 19-7-7 7-7", key: "1l729n" }],
23496
23507
  ["path", { d: "M19 12H5", key: "x3x0zl" }]
23497
23508
  ];
23498
- const ArrowLeft = useRestConversationHistory.createLucideIcon("arrow-left", __iconNode$J);
23509
+ const ArrowLeft = useRestConversationHistory.createLucideIcon("arrow-left", __iconNode$K);
23499
23510
  /**
23500
23511
  * @license lucide-react v0.575.0 - ISC
23501
23512
  *
23502
23513
  * This source code is licensed under the ISC license.
23503
23514
  * See the LICENSE file in the root directory of this source tree.
23504
23515
  */
23505
- const __iconNode$I = [
23516
+ const __iconNode$J = [
23506
23517
  ["path", { d: "M5 12h14", key: "1ays0h" }],
23507
23518
  ["path", { d: "m12 5 7 7-7 7", key: "xquz4c" }]
23508
23519
  ];
23509
- const ArrowRight = useRestConversationHistory.createLucideIcon("arrow-right", __iconNode$I);
23520
+ const ArrowRight = useRestConversationHistory.createLucideIcon("arrow-right", __iconNode$J);
23510
23521
  /**
23511
23522
  * @license lucide-react v0.575.0 - ISC
23512
23523
  *
23513
23524
  * This source code is licensed under the ISC license.
23514
23525
  * See the LICENSE file in the root directory of this source tree.
23515
23526
  */
23516
- const __iconNode$H = [
23527
+ const __iconNode$I = [
23517
23528
  [
23518
23529
  "path",
23519
23530
  {
@@ -23545,14 +23556,14 @@ const __iconNode$H = [
23545
23556
  ["path", { d: "m12 8 4.74-2.85", key: "3rx089" }],
23546
23557
  ["path", { d: "M12 13.5V8", key: "1io7kd" }]
23547
23558
  ];
23548
- const Boxes = useRestConversationHistory.createLucideIcon("boxes", __iconNode$H);
23559
+ const Boxes = useRestConversationHistory.createLucideIcon("boxes", __iconNode$I);
23549
23560
  /**
23550
23561
  * @license lucide-react v0.575.0 - ISC
23551
23562
  *
23552
23563
  * This source code is licensed under the ISC license.
23553
23564
  * See the LICENSE file in the root directory of this source tree.
23554
23565
  */
23555
- const __iconNode$G = [
23566
+ const __iconNode$H = [
23556
23567
  ["path", { d: "M12 18V5", key: "adv99a" }],
23557
23568
  ["path", { d: "M15 13a4.17 4.17 0 0 1-3-4 4.17 4.17 0 0 1-3 4", key: "1e3is1" }],
23558
23569
  ["path", { d: "M17.598 6.5A3 3 0 1 0 12 5a3 3 0 1 0-5.598 1.5", key: "1gqd8o" }],
@@ -23562,27 +23573,27 @@ const __iconNode$G = [
23562
23573
  ["path", { d: "M6 18a4 4 0 0 1-2-7.464", key: "k1g0md" }],
23563
23574
  ["path", { d: "M6.003 5.125a4 4 0 0 0-2.526 5.77", key: "q97ue3" }]
23564
23575
  ];
23565
- const Brain = useRestConversationHistory.createLucideIcon("brain", __iconNode$G);
23576
+ const Brain = useRestConversationHistory.createLucideIcon("brain", __iconNode$H);
23566
23577
  /**
23567
23578
  * @license lucide-react v0.575.0 - ISC
23568
23579
  *
23569
23580
  * This source code is licensed under the ISC license.
23570
23581
  * See the LICENSE file in the root directory of this source tree.
23571
23582
  */
23572
- const __iconNode$F = [
23583
+ const __iconNode$G = [
23573
23584
  ["path", { d: "M12 12h.01", key: "1mp3jc" }],
23574
23585
  ["path", { d: "M16 6V4a2 2 0 0 0-2-2h-4a2 2 0 0 0-2 2v2", key: "1ksdt3" }],
23575
23586
  ["path", { d: "M22 13a18.15 18.15 0 0 1-20 0", key: "12hx5q" }],
23576
23587
  ["rect", { width: "20", height: "14", x: "2", y: "6", rx: "2", key: "i6l2r4" }]
23577
23588
  ];
23578
- const BriefcaseBusiness = useRestConversationHistory.createLucideIcon("briefcase-business", __iconNode$F);
23589
+ const BriefcaseBusiness = useRestConversationHistory.createLucideIcon("briefcase-business", __iconNode$G);
23579
23590
  /**
23580
23591
  * @license lucide-react v0.575.0 - ISC
23581
23592
  *
23582
23593
  * This source code is licensed under the ISC license.
23583
23594
  * See the LICENSE file in the root directory of this source tree.
23584
23595
  */
23585
- const __iconNode$E = [
23596
+ const __iconNode$F = [
23586
23597
  [
23587
23598
  "path",
23588
23599
  { 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" }
@@ -23597,153 +23608,153 @@ const __iconNode$E = [
23597
23608
  ],
23598
23609
  ["path", { d: "M7 5V3", key: "1t1388" }]
23599
23610
  ];
23600
- const Cable = useRestConversationHistory.createLucideIcon("cable", __iconNode$E);
23611
+ const Cable = useRestConversationHistory.createLucideIcon("cable", __iconNode$F);
23601
23612
  /**
23602
23613
  * @license lucide-react v0.575.0 - ISC
23603
23614
  *
23604
23615
  * This source code is licensed under the ISC license.
23605
23616
  * See the LICENSE file in the root directory of this source tree.
23606
23617
  */
23607
- const __iconNode$D = [
23618
+ const __iconNode$E = [
23608
23619
  ["path", { d: "M3 3v16a2 2 0 0 0 2 2h16", key: "c24i48" }],
23609
23620
  ["path", { d: "M7 16h8", key: "srdodz" }],
23610
23621
  ["path", { d: "M7 11h12", key: "127s9w" }],
23611
23622
  ["path", { d: "M7 6h3", key: "w9rmul" }]
23612
23623
  ];
23613
- const ChartBar = useRestConversationHistory.createLucideIcon("chart-bar", __iconNode$D);
23624
+ const ChartBar = useRestConversationHistory.createLucideIcon("chart-bar", __iconNode$E);
23614
23625
  /**
23615
23626
  * @license lucide-react v0.575.0 - ISC
23616
23627
  *
23617
23628
  * This source code is licensed under the ISC license.
23618
23629
  * See the LICENSE file in the root directory of this source tree.
23619
23630
  */
23620
- const __iconNode$C = [
23631
+ const __iconNode$D = [
23621
23632
  ["path", { d: "M3 3v16a2 2 0 0 0 2 2h16", key: "c24i48" }],
23622
23633
  ["path", { d: "M18 17V9", key: "2bz60n" }],
23623
23634
  ["path", { d: "M13 17V5", key: "1frdt8" }],
23624
23635
  ["path", { d: "M8 17v-3", key: "17ska0" }]
23625
23636
  ];
23626
- const ChartColumn = useRestConversationHistory.createLucideIcon("chart-column", __iconNode$C);
23637
+ const ChartColumn = useRestConversationHistory.createLucideIcon("chart-column", __iconNode$D);
23627
23638
  /**
23628
23639
  * @license lucide-react v0.575.0 - ISC
23629
23640
  *
23630
23641
  * This source code is licensed under the ISC license.
23631
23642
  * See the LICENSE file in the root directory of this source tree.
23632
23643
  */
23633
- const __iconNode$B = [["path", { d: "m18 15-6-6-6 6", key: "153udz" }]];
23634
- const ChevronUp = useRestConversationHistory.createLucideIcon("chevron-up", __iconNode$B);
23644
+ const __iconNode$C = [["path", { d: "m18 15-6-6-6 6", key: "153udz" }]];
23645
+ const ChevronUp = useRestConversationHistory.createLucideIcon("chevron-up", __iconNode$C);
23635
23646
  /**
23636
23647
  * @license lucide-react v0.575.0 - ISC
23637
23648
  *
23638
23649
  * This source code is licensed under the ISC license.
23639
23650
  * See the LICENSE file in the root directory of this source tree.
23640
23651
  */
23641
- const __iconNode$A = [
23652
+ const __iconNode$B = [
23642
23653
  ["circle", { cx: "12", cy: "12", r: "10", key: "1mglay" }],
23643
23654
  ["line", { x1: "12", x2: "12", y1: "8", y2: "12", key: "1pkeuh" }],
23644
23655
  ["line", { x1: "12", x2: "12.01", y1: "16", y2: "16", key: "4dfq90" }]
23645
23656
  ];
23646
- const CircleAlert = useRestConversationHistory.createLucideIcon("circle-alert", __iconNode$A);
23657
+ const CircleAlert = useRestConversationHistory.createLucideIcon("circle-alert", __iconNode$B);
23647
23658
  /**
23648
23659
  * @license lucide-react v0.575.0 - ISC
23649
23660
  *
23650
23661
  * This source code is licensed under the ISC license.
23651
23662
  * See the LICENSE file in the root directory of this source tree.
23652
23663
  */
23653
- const __iconNode$z = [
23664
+ const __iconNode$A = [
23654
23665
  ["circle", { cx: "12", cy: "12", r: "10", key: "1mglay" }],
23655
23666
  ["path", { d: "m9 12 2 2 4-4", key: "dzmm74" }]
23656
23667
  ];
23657
- const CircleCheck = useRestConversationHistory.createLucideIcon("circle-check", __iconNode$z);
23668
+ const CircleCheck = useRestConversationHistory.createLucideIcon("circle-check", __iconNode$A);
23658
23669
  /**
23659
23670
  * @license lucide-react v0.575.0 - ISC
23660
23671
  *
23661
23672
  * This source code is licensed under the ISC license.
23662
23673
  * See the LICENSE file in the root directory of this source tree.
23663
23674
  */
23664
- const __iconNode$y = [
23675
+ const __iconNode$z = [
23665
23676
  ["circle", { cx: "12", cy: "12", r: "10", key: "1mglay" }],
23666
23677
  ["path", { d: "m15 9-6 6", key: "1uzhvr" }],
23667
23678
  ["path", { d: "m9 9 6 6", key: "z0biqf" }]
23668
23679
  ];
23669
- const CircleX = useRestConversationHistory.createLucideIcon("circle-x", __iconNode$y);
23680
+ const CircleX = useRestConversationHistory.createLucideIcon("circle-x", __iconNode$z);
23670
23681
  /**
23671
23682
  * @license lucide-react v0.575.0 - ISC
23672
23683
  *
23673
23684
  * This source code is licensed under the ISC license.
23674
23685
  * See the LICENSE file in the root directory of this source tree.
23675
23686
  */
23676
- const __iconNode$x = [["circle", { cx: "12", cy: "12", r: "10", key: "1mglay" }]];
23677
- const Circle = useRestConversationHistory.createLucideIcon("circle", __iconNode$x);
23687
+ const __iconNode$y = [["circle", { cx: "12", cy: "12", r: "10", key: "1mglay" }]];
23688
+ const Circle = useRestConversationHistory.createLucideIcon("circle", __iconNode$y);
23678
23689
  /**
23679
23690
  * @license lucide-react v0.575.0 - ISC
23680
23691
  *
23681
23692
  * This source code is licensed under the ISC license.
23682
23693
  * See the LICENSE file in the root directory of this source tree.
23683
23694
  */
23684
- const __iconNode$w = [
23695
+ const __iconNode$x = [
23685
23696
  ["rect", { width: "8", height: "4", x: "8", y: "2", rx: "1", ry: "1", key: "tgr4d6" }],
23686
23697
  ["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" }],
23687
23698
  ["path", { d: "M16 4h2a2 2 0 0 1 2 2v4", key: "3hqy98" }],
23688
23699
  ["path", { d: "M21 14H11", key: "1bme5i" }],
23689
23700
  ["path", { d: "m15 10-4 4 4 4", key: "5dvupr" }]
23690
23701
  ];
23691
- const ClipboardCopy = useRestConversationHistory.createLucideIcon("clipboard-copy", __iconNode$w);
23702
+ const ClipboardCopy = useRestConversationHistory.createLucideIcon("clipboard-copy", __iconNode$x);
23692
23703
  /**
23693
23704
  * @license lucide-react v0.575.0 - ISC
23694
23705
  *
23695
23706
  * This source code is licensed under the ISC license.
23696
23707
  * See the LICENSE file in the root directory of this source tree.
23697
23708
  */
23698
- const __iconNode$v = [
23709
+ const __iconNode$w = [
23699
23710
  ["path", { d: "m18 16 4-4-4-4", key: "1inbqp" }],
23700
23711
  ["path", { d: "m6 8-4 4 4 4", key: "15zrgr" }],
23701
23712
  ["path", { d: "m14.5 4-5 16", key: "e7oirm" }]
23702
23713
  ];
23703
- const CodeXml = useRestConversationHistory.createLucideIcon("code-xml", __iconNode$v);
23714
+ const CodeXml = useRestConversationHistory.createLucideIcon("code-xml", __iconNode$w);
23704
23715
  /**
23705
23716
  * @license lucide-react v0.575.0 - ISC
23706
23717
  *
23707
23718
  * This source code is licensed under the ISC license.
23708
23719
  * See the LICENSE file in the root directory of this source tree.
23709
23720
  */
23710
- const __iconNode$u = [
23721
+ const __iconNode$v = [
23711
23722
  ["path", { d: "M12 15V3", key: "m9g1x1" }],
23712
23723
  ["path", { d: "M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4", key: "ih7n3h" }],
23713
23724
  ["path", { d: "m7 10 5 5 5-5", key: "brsn70" }]
23714
23725
  ];
23715
- const Download = useRestConversationHistory.createLucideIcon("download", __iconNode$u);
23726
+ const Download = useRestConversationHistory.createLucideIcon("download", __iconNode$v);
23716
23727
  /**
23717
23728
  * @license lucide-react v0.575.0 - ISC
23718
23729
  *
23719
23730
  * This source code is licensed under the ISC license.
23720
23731
  * See the LICENSE file in the root directory of this source tree.
23721
23732
  */
23722
- const __iconNode$t = [
23733
+ const __iconNode$u = [
23723
23734
  ["circle", { cx: "12", cy: "12", r: "1", key: "41hilf" }],
23724
23735
  ["circle", { cx: "19", cy: "12", r: "1", key: "1wjl8i" }],
23725
23736
  ["circle", { cx: "5", cy: "12", r: "1", key: "1pcz8c" }]
23726
23737
  ];
23727
- const Ellipsis = useRestConversationHistory.createLucideIcon("ellipsis", __iconNode$t);
23738
+ const Ellipsis = useRestConversationHistory.createLucideIcon("ellipsis", __iconNode$u);
23728
23739
  /**
23729
23740
  * @license lucide-react v0.575.0 - ISC
23730
23741
  *
23731
23742
  * This source code is licensed under the ISC license.
23732
23743
  * See the LICENSE file in the root directory of this source tree.
23733
23744
  */
23734
- const __iconNode$s = [
23745
+ const __iconNode$t = [
23735
23746
  ["path", { d: "M15 3h6v6", key: "1q9fwt" }],
23736
23747
  ["path", { d: "M10 14 21 3", key: "gplh6r" }],
23737
23748
  ["path", { d: "M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6", key: "a6xqqp" }]
23738
23749
  ];
23739
- const ExternalLink = useRestConversationHistory.createLucideIcon("external-link", __iconNode$s);
23750
+ const ExternalLink = useRestConversationHistory.createLucideIcon("external-link", __iconNode$t);
23740
23751
  /**
23741
23752
  * @license lucide-react v0.575.0 - ISC
23742
23753
  *
23743
23754
  * This source code is licensed under the ISC license.
23744
23755
  * See the LICENSE file in the root directory of this source tree.
23745
23756
  */
23746
- const __iconNode$r = [
23757
+ const __iconNode$s = [
23747
23758
  [
23748
23759
  "path",
23749
23760
  {
@@ -23755,14 +23766,14 @@ const __iconNode$r = [
23755
23766
  ["path", { d: "M9 15h6", key: "cctwl0" }],
23756
23767
  ["path", { d: "M12 18v-6", key: "17g6i2" }]
23757
23768
  ];
23758
- const FilePlus = useRestConversationHistory.createLucideIcon("file-plus", __iconNode$r);
23769
+ const FilePlus = useRestConversationHistory.createLucideIcon("file-plus", __iconNode$s);
23759
23770
  /**
23760
23771
  * @license lucide-react v0.575.0 - ISC
23761
23772
  *
23762
23773
  * This source code is licensed under the ISC license.
23763
23774
  * See the LICENSE file in the root directory of this source tree.
23764
23775
  */
23765
- const __iconNode$q = [
23776
+ const __iconNode$r = [
23766
23777
  [
23767
23778
  "path",
23768
23779
  {
@@ -23776,14 +23787,14 @@ const __iconNode$q = [
23776
23787
  ["path", { d: "M8 17h2", key: "2yhykz" }],
23777
23788
  ["path", { d: "M14 17h2", key: "10kma7" }]
23778
23789
  ];
23779
- const FileSpreadsheet = useRestConversationHistory.createLucideIcon("file-spreadsheet", __iconNode$q);
23790
+ const FileSpreadsheet = useRestConversationHistory.createLucideIcon("file-spreadsheet", __iconNode$r);
23780
23791
  /**
23781
23792
  * @license lucide-react v0.575.0 - ISC
23782
23793
  *
23783
23794
  * This source code is licensed under the ISC license.
23784
23795
  * See the LICENSE file in the root directory of this source tree.
23785
23796
  */
23786
- const __iconNode$p = [
23797
+ const __iconNode$q = [
23787
23798
  [
23788
23799
  "path",
23789
23800
  {
@@ -23792,14 +23803,14 @@ const __iconNode$p = [
23792
23803
  }
23793
23804
  ]
23794
23805
  ];
23795
- const FolderOpen = useRestConversationHistory.createLucideIcon("folder-open", __iconNode$p);
23806
+ const FolderOpen = useRestConversationHistory.createLucideIcon("folder-open", __iconNode$q);
23796
23807
  /**
23797
23808
  * @license lucide-react v0.575.0 - ISC
23798
23809
  *
23799
23810
  * This source code is licensed under the ISC license.
23800
23811
  * See the LICENSE file in the root directory of this source tree.
23801
23812
  */
23802
- const __iconNode$o = [
23813
+ const __iconNode$p = [
23803
23814
  [
23804
23815
  "path",
23805
23816
  {
@@ -23822,39 +23833,39 @@ const __iconNode$o = [
23822
23833
  }
23823
23834
  ]
23824
23835
  ];
23825
- const Layers = useRestConversationHistory.createLucideIcon("layers", __iconNode$o);
23836
+ const Layers = useRestConversationHistory.createLucideIcon("layers", __iconNode$p);
23826
23837
  /**
23827
23838
  * @license lucide-react v0.575.0 - ISC
23828
23839
  *
23829
23840
  * This source code is licensed under the ISC license.
23830
23841
  * See the LICENSE file in the root directory of this source tree.
23831
23842
  */
23832
- const __iconNode$n = [
23843
+ const __iconNode$o = [
23833
23844
  ["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" }],
23834
23845
  ["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" }]
23835
23846
  ];
23836
- const Link = useRestConversationHistory.createLucideIcon("link", __iconNode$n);
23847
+ const Link = useRestConversationHistory.createLucideIcon("link", __iconNode$o);
23837
23848
  /**
23838
23849
  * @license lucide-react v0.575.0 - ISC
23839
23850
  *
23840
23851
  * This source code is licensed under the ISC license.
23841
23852
  * See the LICENSE file in the root directory of this source tree.
23842
23853
  */
23843
- const __iconNode$m = [
23854
+ const __iconNode$n = [
23844
23855
  ["path", { d: "M13 5h8", key: "a7qcls" }],
23845
23856
  ["path", { d: "M13 12h8", key: "h98zly" }],
23846
23857
  ["path", { d: "M13 19h8", key: "c3s6r1" }],
23847
23858
  ["path", { d: "m3 17 2 2 4-4", key: "1jhpwq" }],
23848
23859
  ["path", { d: "m3 7 2 2 4-4", key: "1obspn" }]
23849
23860
  ];
23850
- const ListChecks = useRestConversationHistory.createLucideIcon("list-checks", __iconNode$m);
23861
+ const ListChecks = useRestConversationHistory.createLucideIcon("list-checks", __iconNode$n);
23851
23862
  /**
23852
23863
  * @license lucide-react v0.575.0 - ISC
23853
23864
  *
23854
23865
  * This source code is licensed under the ISC license.
23855
23866
  * See the LICENSE file in the root directory of this source tree.
23856
23867
  */
23857
- const __iconNode$l = [
23868
+ const __iconNode$m = [
23858
23869
  ["path", { d: "M12 2v4", key: "3427ic" }],
23859
23870
  ["path", { d: "m16.2 7.8 2.9-2.9", key: "r700ao" }],
23860
23871
  ["path", { d: "M18 12h4", key: "wj9ykh" }],
@@ -23864,27 +23875,27 @@ const __iconNode$l = [
23864
23875
  ["path", { d: "M2 12h4", key: "j09sii" }],
23865
23876
  ["path", { d: "m4.9 4.9 2.9 2.9", key: "giyufr" }]
23866
23877
  ];
23867
- const Loader = useRestConversationHistory.createLucideIcon("loader", __iconNode$l);
23878
+ const Loader = useRestConversationHistory.createLucideIcon("loader", __iconNode$m);
23868
23879
  /**
23869
23880
  * @license lucide-react v0.575.0 - ISC
23870
23881
  *
23871
23882
  * This source code is licensed under the ISC license.
23872
23883
  * See the LICENSE file in the root directory of this source tree.
23873
23884
  */
23874
- const __iconNode$k = [
23885
+ const __iconNode$l = [
23875
23886
  ["path", { d: "M15 3h6v6", key: "1q9fwt" }],
23876
23887
  ["path", { d: "m21 3-7 7", key: "1l2asr" }],
23877
23888
  ["path", { d: "m3 21 7-7", key: "tjx5ai" }],
23878
23889
  ["path", { d: "M9 21H3v-6", key: "wtvkvv" }]
23879
23890
  ];
23880
- const Maximize2 = useRestConversationHistory.createLucideIcon("maximize-2", __iconNode$k);
23891
+ const Maximize2 = useRestConversationHistory.createLucideIcon("maximize-2", __iconNode$l);
23881
23892
  /**
23882
23893
  * @license lucide-react v0.575.0 - ISC
23883
23894
  *
23884
23895
  * This source code is licensed under the ISC license.
23885
23896
  * See the LICENSE file in the root directory of this source tree.
23886
23897
  */
23887
- const __iconNode$j = [
23898
+ const __iconNode$k = [
23888
23899
  [
23889
23900
  "path",
23890
23901
  {
@@ -23895,27 +23906,27 @@ const __iconNode$j = [
23895
23906
  ["path", { d: "M6 14a12 12 0 0 0 2.4 7.2 2 2 0 0 0 3.2-2.4A8 8 0 0 1 10 14", key: "1853fq" }],
23896
23907
  ["path", { d: "M8 6v8", key: "15ugcq" }]
23897
23908
  ];
23898
- const Megaphone = useRestConversationHistory.createLucideIcon("megaphone", __iconNode$j);
23909
+ const Megaphone = useRestConversationHistory.createLucideIcon("megaphone", __iconNode$k);
23899
23910
  /**
23900
23911
  * @license lucide-react v0.575.0 - ISC
23901
23912
  *
23902
23913
  * This source code is licensed under the ISC license.
23903
23914
  * See the LICENSE file in the root directory of this source tree.
23904
23915
  */
23905
- const __iconNode$i = [
23916
+ const __iconNode$j = [
23906
23917
  ["path", { d: "m14 10 7-7", key: "oa77jy" }],
23907
23918
  ["path", { d: "M20 10h-6V4", key: "mjg0md" }],
23908
23919
  ["path", { d: "m3 21 7-7", key: "tjx5ai" }],
23909
23920
  ["path", { d: "M4 14h6v6", key: "rmj7iw" }]
23910
23921
  ];
23911
- const Minimize2 = useRestConversationHistory.createLucideIcon("minimize-2", __iconNode$i);
23922
+ const Minimize2 = useRestConversationHistory.createLucideIcon("minimize-2", __iconNode$j);
23912
23923
  /**
23913
23924
  * @license lucide-react v0.575.0 - ISC
23914
23925
  *
23915
23926
  * This source code is licensed under the ISC license.
23916
23927
  * See the LICENSE file in the root directory of this source tree.
23917
23928
  */
23918
- const __iconNode$h = [
23929
+ const __iconNode$i = [
23919
23930
  ["path", { d: "M13.4 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2v-7.4", key: "re6nr2" }],
23920
23931
  ["path", { d: "M2 6h4", key: "aawbzj" }],
23921
23932
  ["path", { d: "M2 10h4", key: "l0bgd4" }],
@@ -23929,25 +23940,25 @@ const __iconNode$h = [
23929
23940
  }
23930
23941
  ]
23931
23942
  ];
23932
- const NotebookPen = useRestConversationHistory.createLucideIcon("notebook-pen", __iconNode$h);
23943
+ const NotebookPen = useRestConversationHistory.createLucideIcon("notebook-pen", __iconNode$i);
23933
23944
  /**
23934
23945
  * @license lucide-react v0.575.0 - ISC
23935
23946
  *
23936
23947
  * This source code is licensed under the ISC license.
23937
23948
  * See the LICENSE file in the root directory of this source tree.
23938
23949
  */
23939
- const __iconNode$g = [
23950
+ const __iconNode$h = [
23940
23951
  ["rect", { width: "18", height: "18", x: "3", y: "3", rx: "2", key: "afitv7" }],
23941
23952
  ["path", { d: "M3 9h18", key: "1pudct" }]
23942
23953
  ];
23943
- const PanelTop = useRestConversationHistory.createLucideIcon("panel-top", __iconNode$g);
23954
+ const PanelTop = useRestConversationHistory.createLucideIcon("panel-top", __iconNode$h);
23944
23955
  /**
23945
23956
  * @license lucide-react v0.575.0 - ISC
23946
23957
  *
23947
23958
  * This source code is licensed under the ISC license.
23948
23959
  * See the LICENSE file in the root directory of this source tree.
23949
23960
  */
23950
- const __iconNode$f = [
23961
+ const __iconNode$g = [
23951
23962
  [
23952
23963
  "path",
23953
23964
  {
@@ -23956,14 +23967,14 @@ const __iconNode$f = [
23956
23967
  }
23957
23968
  ]
23958
23969
  ];
23959
- const Paperclip = useRestConversationHistory.createLucideIcon("paperclip", __iconNode$f);
23970
+ const Paperclip = useRestConversationHistory.createLucideIcon("paperclip", __iconNode$g);
23960
23971
  /**
23961
23972
  * @license lucide-react v0.575.0 - ISC
23962
23973
  *
23963
23974
  * This source code is licensed under the ISC license.
23964
23975
  * See the LICENSE file in the root directory of this source tree.
23965
23976
  */
23966
- const __iconNode$e = [
23977
+ const __iconNode$f = [
23967
23978
  ["path", { d: "M13 21h8", key: "1jsn5i" }],
23968
23979
  [
23969
23980
  "path",
@@ -23973,14 +23984,14 @@ const __iconNode$e = [
23973
23984
  }
23974
23985
  ]
23975
23986
  ];
23976
- const PenLine = useRestConversationHistory.createLucideIcon("pen-line", __iconNode$e);
23987
+ const PenLine = useRestConversationHistory.createLucideIcon("pen-line", __iconNode$f);
23977
23988
  /**
23978
23989
  * @license lucide-react v0.575.0 - ISC
23979
23990
  *
23980
23991
  * This source code is licensed under the ISC license.
23981
23992
  * See the LICENSE file in the root directory of this source tree.
23982
23993
  */
23983
- const __iconNode$d = [
23994
+ const __iconNode$e = [
23984
23995
  [
23985
23996
  "path",
23986
23997
  {
@@ -23989,26 +24000,26 @@ const __iconNode$d = [
23989
24000
  }
23990
24001
  ]
23991
24002
  ];
23992
- const Play = useRestConversationHistory.createLucideIcon("play", __iconNode$d);
24003
+ const Play = useRestConversationHistory.createLucideIcon("play", __iconNode$e);
23993
24004
  /**
23994
24005
  * @license lucide-react v0.575.0 - ISC
23995
24006
  *
23996
24007
  * This source code is licensed under the ISC license.
23997
24008
  * See the LICENSE file in the root directory of this source tree.
23998
24009
  */
23999
- const __iconNode$c = [
24010
+ const __iconNode$d = [
24000
24011
  ["path", { d: "M2 3h20", key: "91anmk" }],
24001
24012
  ["path", { d: "M21 3v11a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V3", key: "2k9sn8" }],
24002
24013
  ["path", { d: "m7 21 5-5 5 5", key: "bip4we" }]
24003
24014
  ];
24004
- const Presentation = useRestConversationHistory.createLucideIcon("presentation", __iconNode$c);
24015
+ const Presentation = useRestConversationHistory.createLucideIcon("presentation", __iconNode$d);
24005
24016
  /**
24006
24017
  * @license lucide-react v0.575.0 - ISC
24007
24018
  *
24008
24019
  * This source code is licensed under the ISC license.
24009
24020
  * See the LICENSE file in the root directory of this source tree.
24010
24021
  */
24011
- const __iconNode$b = [
24022
+ const __iconNode$c = [
24012
24023
  [
24013
24024
  "path",
24014
24025
  {
@@ -24024,7 +24035,22 @@ const __iconNode$b = [
24024
24035
  }
24025
24036
  ]
24026
24037
  ];
24027
- const Quote = useRestConversationHistory.createLucideIcon("quote", __iconNode$b);
24038
+ const Quote = useRestConversationHistory.createLucideIcon("quote", __iconNode$c);
24039
+ /**
24040
+ * @license lucide-react v0.575.0 - ISC
24041
+ *
24042
+ * This source code is licensed under the ISC license.
24043
+ * See the LICENSE file in the root directory of this source tree.
24044
+ */
24045
+ const __iconNode$b = [
24046
+ ["path", { d: "M3 7V5a2 2 0 0 1 2-2h2", key: "aa7l1z" }],
24047
+ ["path", { d: "M17 3h2a2 2 0 0 1 2 2v2", key: "4qcy5o" }],
24048
+ ["path", { d: "M21 17v2a2 2 0 0 1-2 2h-2", key: "6vwrx8" }],
24049
+ ["path", { d: "M7 21H5a2 2 0 0 1-2-2v-2", key: "ioqczr" }],
24050
+ ["circle", { cx: "12", cy: "12", r: "3", key: "1v7zrd" }],
24051
+ ["path", { d: "m16 16-1.9-1.9", key: "1dq9hf" }]
24052
+ ];
24053
+ const ScanSearch = useRestConversationHistory.createLucideIcon("scan-search", __iconNode$b);
24028
24054
  /**
24029
24055
  * @license lucide-react v0.575.0 - ISC
24030
24056
  *
@@ -24645,7 +24671,10 @@ const useAthenaLinkClickHandler = () => {
24645
24671
  const openInAssetPanel = citationLink ? () => {
24646
24672
  openAsset(citationLink.assetId, {
24647
24673
  name: trimmedLinkText ?? void 0,
24648
- type: citationLink.assetType ?? void 0
24674
+ type: citationLink.assetType ?? void 0,
24675
+ // Carry the citation target so the panel's iframe navigates to
24676
+ // the cited range/page instead of opening at the top.
24677
+ reference: citationLink.reference
24649
24678
  });
24650
24679
  } : void 0;
24651
24680
  const context = {
@@ -27132,7 +27161,14 @@ const ReadAssetToolUIImpl = ({
27132
27161
  const resolvedAssetCount = Math.max(assetCount, new Set(resultAssetIds).size);
27133
27162
  const primaryAsset = getAssetInfo(firstAssetId || resultAssetIds[0] || "");
27134
27163
  const resultTitle = (_a3 = resultItems.find((item) => item.title)) == null ? void 0 : _a3.title;
27135
- const assetLabel = resolvedAssetCount > 1 ? `${primaryAsset.name} + ${resolvedAssetCount - 1} more` : resultTitle ?? primaryAsset.name;
27164
+ const isOpaqueId = (label) => /^asset_[0-9a-f-]{8,}/i.test(label);
27165
+ const primaryLabel = resultTitle ?? (isOpaqueId(primaryAsset.name) ? "1 document" : primaryAsset.name);
27166
+ const sourceList = resolvedAssetCount > 1 ? resultItems.filter((item) => typeof item.title === "string" && item.title !== "").map((item, index) => ({
27167
+ key: item.asset_id ?? `${index}-${item.title}`,
27168
+ label: item.title,
27169
+ failed: item.success === false
27170
+ })) : [];
27171
+ const assetLabel = resolvedAssetCount > 1 ? `${resolvedAssetCount} documents` : primaryLabel;
27136
27172
  const statusTitle = isRunning ? "Reviewing asset content" : hasError ? "Asset content review failed" : hasPartialIssues ? "Asset content reviewed with issues" : "Asset content review complete";
27137
27173
  const badge = hasPartialIssues ? `${failedItems.length} ${failedItems.length === 1 ? "issue" : "issues"}` : resolvedAssetCount > 1 ? `${resolvedAssetCount} sources` : workbookData ? "Workbook review" : "Content review";
27138
27174
  const hasContent = (isComplete || isIncomplete) && (resultText || workbookData);
@@ -27172,6 +27208,24 @@ const ReadAssetToolUIImpl = ({
27172
27208
  /* @__PURE__ */ jsxRuntime.jsx("div", { className: "h-1.5 w-8 animate-pulse rounded-full bg-blue-100" })
27173
27209
  ] })
27174
27210
  ] }),
27211
+ sourceList.length > 1 && /* @__PURE__ */ jsxRuntime.jsxs("ul", { className: "border-t px-4 py-2", children: [
27212
+ sourceList.slice(0, 8).map((source) => /* @__PURE__ */ jsxRuntime.jsxs(
27213
+ "li",
27214
+ {
27215
+ className: "flex items-center gap-2 py-0.5 text-[12px] text-muted-foreground",
27216
+ children: [
27217
+ source.failed ? /* @__PURE__ */ jsxRuntime.jsx(CircleAlert, { className: "size-3.5 shrink-0 text-red-400" }) : /* @__PURE__ */ jsxRuntime.jsx(CircleCheck, { className: "size-3.5 shrink-0 text-emerald-500" }),
27218
+ /* @__PURE__ */ jsxRuntime.jsx("span", { className: "min-w-0 truncate", children: source.label })
27219
+ ]
27220
+ },
27221
+ source.key
27222
+ )),
27223
+ sourceList.length > 8 && /* @__PURE__ */ jsxRuntime.jsxs("li", { className: "py-0.5 text-[11px] text-muted-foreground/70", children: [
27224
+ "and ",
27225
+ sourceList.length - 8,
27226
+ " more"
27227
+ ] })
27228
+ ] }),
27175
27229
  hasError && errorMessage && /* @__PURE__ */ jsxRuntime.jsx("div", { className: "border-t bg-red-50/50 px-4 py-2.5", children: /* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-[12px] leading-relaxed text-red-600", children: errorMessage }) }),
27176
27230
  hasContent && !hasError && /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "border-t", children: [
27177
27231
  /* @__PURE__ */ jsxRuntime.jsxs(
@@ -27205,6 +27259,176 @@ const ReadAssetToolUI = React.memo(
27205
27259
  ReadAssetToolUIImpl
27206
27260
  );
27207
27261
  ReadAssetToolUI.displayName = "ReadAssetToolUI";
27262
+ function friendlyWorkspacePath(value) {
27263
+ if (typeof value !== "string" || value.trim() === "") return void 0;
27264
+ const path = value.trim();
27265
+ if (path.includes("large_tool_results")) {
27266
+ return "detailed results from an earlier step";
27267
+ }
27268
+ if (path.includes("/memory/")) return "session memory";
27269
+ if (path.includes("/skills/")) return "a skill reference";
27270
+ const base2 = path.split("/").filter(Boolean).pop();
27271
+ return base2 ?? path;
27272
+ }
27273
+ function rawDetails(result) {
27274
+ if (result === null || result === void 0) return null;
27275
+ if (typeof result === "string") {
27276
+ return result.trim() !== "" ? result : null;
27277
+ }
27278
+ if (typeof result === "object") {
27279
+ const inner = result.result;
27280
+ if (typeof inner === "string") {
27281
+ return inner.trim() !== "" ? inner : null;
27282
+ }
27283
+ }
27284
+ const data = normalizeResult(result);
27285
+ if (data === null) return null;
27286
+ const text2 = JSON.stringify(data, null, 2);
27287
+ return text2.trim() !== "" ? text2 : null;
27288
+ }
27289
+ function makeQuietFileToolUI(spec) {
27290
+ const Impl = ({ args, result, status }) => {
27291
+ const typedArgs = args;
27292
+ let subtitle;
27293
+ for (const key of spec.subtitleArgs) {
27294
+ subtitle = friendlyWorkspacePath(typedArgs == null ? void 0 : typedArgs[key]);
27295
+ if (subtitle) break;
27296
+ }
27297
+ const isRunning = (status == null ? void 0 : status.type) === "running";
27298
+ const isFailed = (status == null ? void 0 : status.type) === "incomplete";
27299
+ const errorMsg = isFailed ? String(status.error ?? "") : null;
27300
+ const details = (status == null ? void 0 : status.type) === "complete" ? rawDetails(result) : null;
27301
+ return /* @__PURE__ */ jsxRuntime.jsx(
27302
+ ToolCard,
27303
+ {
27304
+ icon: spec.icon,
27305
+ status: (status == null ? void 0 : status.type) ?? "complete",
27306
+ title: isRunning ? spec.runningTitle : isFailed ? spec.failedTitle : spec.doneTitle,
27307
+ subtitle: subtitle ? truncate(subtitle, 70) : void 0,
27308
+ error: errorMsg || void 0,
27309
+ children: details && /* @__PURE__ */ jsxRuntime.jsx(ExpandableSection, { label: spec.detailsLabel, children: /* @__PURE__ */ jsxRuntime.jsx("pre", { className: "max-h-64 overflow-auto whitespace-pre-wrap break-all text-[11px] leading-snug text-muted-foreground", children: truncate(details, 6e3) }) })
27310
+ }
27311
+ );
27312
+ };
27313
+ const Quiet = React.memo(Impl);
27314
+ Quiet.displayName = `QuietFileToolUI(${spec.doneTitle})`;
27315
+ return Quiet;
27316
+ }
27317
+ const ReadFileToolUI = makeQuietFileToolUI({
27318
+ icon: ScanSearch,
27319
+ runningTitle: "Reviewing working files…",
27320
+ doneTitle: "Reviewed working files",
27321
+ failedTitle: "Couldn't review working files",
27322
+ subtitleArgs: ["file_path", "path"],
27323
+ detailsLabel: "Show details"
27324
+ });
27325
+ const ListFilesToolUI = makeQuietFileToolUI({
27326
+ icon: FolderOpen,
27327
+ runningTitle: "Checking the workspace…",
27328
+ doneTitle: "Checked the workspace",
27329
+ failedTitle: "Couldn't check the workspace",
27330
+ subtitleArgs: ["path"],
27331
+ detailsLabel: "Show files"
27332
+ });
27333
+ const WriteFileToolUI = makeQuietFileToolUI({
27334
+ icon: useRestConversationHistory.FileText,
27335
+ runningTitle: "Saving working files…",
27336
+ doneTitle: "Saved working files",
27337
+ failedTitle: "Couldn't save working files",
27338
+ subtitleArgs: ["file_path", "path"],
27339
+ detailsLabel: "Show details"
27340
+ });
27341
+ const EditFileToolUI = makeQuietFileToolUI({
27342
+ icon: PenLine,
27343
+ runningTitle: "Updating working files…",
27344
+ doneTitle: "Updated working files",
27345
+ failedTitle: "Couldn't update working files",
27346
+ subtitleArgs: ["file_path", "path"],
27347
+ detailsLabel: "Show details"
27348
+ });
27349
+ const SearchFilesToolUI = makeQuietFileToolUI({
27350
+ icon: useRestConversationHistory.Search,
27351
+ runningTitle: "Searching working files…",
27352
+ doneTitle: "Searched working files",
27353
+ failedTitle: "Couldn't search working files",
27354
+ subtitleArgs: ["pattern", "query", "path"],
27355
+ detailsLabel: "Show matches"
27356
+ });
27357
+ const DEFAULT_SCOPE = "default";
27358
+ let nextSeq = 1;
27359
+ const scopes = /* @__PURE__ */ new Map();
27360
+ const listeners = /* @__PURE__ */ new Set();
27361
+ let version = 0;
27362
+ function emit() {
27363
+ version++;
27364
+ for (const listener of listeners) listener();
27365
+ }
27366
+ function scopeEntries(scope) {
27367
+ let entries = scopes.get(scope);
27368
+ if (!entries) {
27369
+ entries = /* @__PURE__ */ new Map();
27370
+ scopes.set(scope, entries);
27371
+ }
27372
+ return entries;
27373
+ }
27374
+ function allocatePlanSeq() {
27375
+ return nextSeq++;
27376
+ }
27377
+ function registerPlanCard(scope, seq, plan, isWriting) {
27378
+ scopeEntries(scope).set(seq, { seq, plan, isWriting });
27379
+ emit();
27380
+ }
27381
+ function updatePlanCard(scope, seq, plan, isWriting) {
27382
+ var _a3;
27383
+ const entry = (_a3 = scopes.get(scope)) == null ? void 0 : _a3.get(seq);
27384
+ if (!entry) return;
27385
+ entry.plan = plan;
27386
+ entry.isWriting = isWriting;
27387
+ emit();
27388
+ }
27389
+ function unregisterPlanCard(scope, seq) {
27390
+ const entries = scopes.get(scope);
27391
+ if (!entries) return;
27392
+ if (entries.delete(seq)) {
27393
+ if (entries.size === 0) scopes.delete(scope);
27394
+ emit();
27395
+ }
27396
+ }
27397
+ function latestPlanSeq(scope) {
27398
+ const entries = scopes.get(scope);
27399
+ if (!entries) return null;
27400
+ let latest = null;
27401
+ for (const seq of entries.keys()) {
27402
+ if (latest === null || seq > latest) latest = seq;
27403
+ }
27404
+ return latest;
27405
+ }
27406
+ function latestPlanEntry(scope) {
27407
+ var _a3;
27408
+ const seq = latestPlanSeq(scope);
27409
+ return seq === null ? null : ((_a3 = scopes.get(scope)) == null ? void 0 : _a3.get(seq)) ?? null;
27410
+ }
27411
+ function subscribe(listener) {
27412
+ listeners.add(listener);
27413
+ return () => {
27414
+ listeners.delete(listener);
27415
+ };
27416
+ }
27417
+ const getVersion = () => version;
27418
+ function usePlanScope() {
27419
+ return React.useContext(AthenaThreadIdContext) ?? DEFAULT_SCOPE;
27420
+ }
27421
+ function useIsLatestPlanCard(scope, seq) {
27422
+ React.useSyncExternalStore(subscribe, getVersion, getVersion);
27423
+ const latest = latestPlanSeq(scope);
27424
+ return latest === null || latest === seq;
27425
+ }
27426
+ function useLatestTodoPlan() {
27427
+ const scope = usePlanScope();
27428
+ React.useSyncExternalStore(subscribe, getVersion, getVersion);
27429
+ const entry = latestPlanEntry(scope);
27430
+ return entry ? { plan: entry.plan, isWriting: entry.isWriting } : null;
27431
+ }
27208
27432
  const STEP_STATUSES = [
27209
27433
  "pending",
27210
27434
  "in_progress",
@@ -27318,17 +27542,50 @@ function PlanBadge({
27318
27542
  }
27319
27543
  );
27320
27544
  }
27545
+ function usePlanCardRegistration(plan, isWriting) {
27546
+ const scope = usePlanScope();
27547
+ const [seq] = React.useState(allocatePlanSeq);
27548
+ React.useEffect(() => {
27549
+ registerPlanCard(scope, seq, plan, isWriting);
27550
+ return () => unregisterPlanCard(scope, seq);
27551
+ }, [scope, seq]);
27552
+ React.useEffect(() => {
27553
+ updatePlanCard(scope, seq, plan, isWriting);
27554
+ }, [scope, seq, plan, isWriting]);
27555
+ return useIsLatestPlanCard(scope, seq);
27556
+ }
27557
+ const HiddenWriteTodosToolUIImpl = ({
27558
+ args,
27559
+ argsText,
27560
+ result,
27561
+ status
27562
+ }) => {
27563
+ const plan = React.useMemo(
27564
+ () => parseTodoPlan({ args, argsText, result }),
27565
+ [args, argsText, result]
27566
+ );
27567
+ usePlanCardRegistration(plan, (status == null ? void 0 : status.type) === "running");
27568
+ return null;
27569
+ };
27570
+ const HiddenWriteTodosToolUI = React.memo(
27571
+ HiddenWriteTodosToolUIImpl
27572
+ );
27573
+ HiddenWriteTodosToolUI.displayName = "HiddenWriteTodosToolUI";
27321
27574
  const WriteTodosToolUIImpl = ({
27322
27575
  args,
27323
27576
  argsText,
27324
27577
  result,
27325
27578
  status
27326
27579
  }) => {
27327
- const { steps, changeDescription } = React.useMemo(
27580
+ const plan = React.useMemo(
27328
27581
  () => parseTodoPlan({ args, argsText, result }),
27329
27582
  [args, argsText, result]
27330
27583
  );
27584
+ const { steps, changeDescription } = plan;
27331
27585
  const [collapsed, setCollapsed] = React.useState(false);
27586
+ const isWriting = (status == null ? void 0 : status.type) === "running";
27587
+ const isLatest = usePlanCardRegistration(plan, isWriting);
27588
+ if (!isLatest) return null;
27332
27589
  const completed = steps.filter((s) => s.status === "completed").length;
27333
27590
  const stopped = steps.filter(
27334
27591
  (s) => s.status === "cancelled" || s.status === "failed"
@@ -27336,7 +27593,6 @@ const WriteTodosToolUIImpl = ({
27336
27593
  const current = steps.find((s) => s.status === "in_progress");
27337
27594
  const total = steps.length;
27338
27595
  const resolved = completed + stopped;
27339
- const isWriting = (status == null ? void 0 : status.type) === "running";
27340
27596
  const isDone = total > 0 && resolved === total;
27341
27597
  if (total === 0) {
27342
27598
  return isWriting ? /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "my-3 flex w-full items-center gap-2 rounded-xl border border-border/60 bg-background px-4 py-3 shadow-sm", children: [
@@ -30549,7 +30805,15 @@ const TOOL_UI_REGISTRY = {
30549
30805
  run_sql: RunSqlToolUI,
30550
30806
  run_database_sql: RunSqlToolUI,
30551
30807
  run_sql_query_tool: RunSqlToolUI,
30552
- write_todos: WriteTodosToolUI
30808
+ write_todos: WriteTodosToolUI,
30809
+ // Deep-agent workspace-file tools — quiet plain-English cards; the generic
30810
+ // fallback dumped raw scratch-space JSON (see file-tool-uis.tsx).
30811
+ read_file: ReadFileToolUI,
30812
+ ls: ListFilesToolUI,
30813
+ write_file: WriteFileToolUI,
30814
+ edit_file: EditFileToolUI,
30815
+ glob: SearchFilesToolUI,
30816
+ grep: SearchFilesToolUI
30553
30817
  };
30554
30818
  const TOOLKIT_THEMES = {
30555
30819
  Web: { color: "#7BCCFA" },
@@ -32786,12 +33050,15 @@ const AssetIframe = React.memo(
32786
33050
  }
32787
33051
  const initialSlideNumber = initialSlideRef.current.slideNumber;
32788
33052
  const iframeSrc = React.useMemo(
32789
- () => embedUrl ? buildAssetIframeSrc({
32790
- embedUrl,
32791
- assetType: tab.type,
32792
- slideNumber: initialSlideNumber
32793
- }) : null,
32794
- [embedUrl, initialSlideNumber, tab.type]
33053
+ () => embedUrl ? buildSdkAssetEmbedUrl(
33054
+ buildAssetIframeSrc({
33055
+ embedUrl,
33056
+ assetType: tab.type,
33057
+ slideNumber: initialSlideNumber
33058
+ }),
33059
+ tab.reference
33060
+ ) : null,
33061
+ [embedUrl, initialSlideNumber, tab.type, tab.reference]
32795
33062
  );
32796
33063
  const navigationMessage = React.useMemo(
32797
33064
  () => buildPresentationNavigationMessage({
@@ -33488,18 +33755,23 @@ exports.DEFAULT_ATHENA_TRANSPORT = DEFAULT_ATHENA_TRANSPORT;
33488
33755
  exports.DEFAULT_AUTO_OPEN_TOOLS = DEFAULT_AUTO_OPEN_TOOLS;
33489
33756
  exports.DEFAULT_STATEWIRE_MODEL = DEFAULT_STATEWIRE_MODEL;
33490
33757
  exports.DescribeDatabaseToolUI = DescribeDatabaseToolUI;
33758
+ exports.EditFileToolUI = EditFileToolUI;
33491
33759
  exports.EmailSearchToolUI = EmailSearchToolUI;
33492
33760
  exports.ExpandableSection = ExpandableSection;
33493
33761
  exports.FileUploadButton = FileUploadButton;
33494
33762
  exports.GetDatabaseTableSchemaToolUI = GetDatabaseTableSchemaToolUI;
33763
+ exports.HiddenWriteTodosToolUI = HiddenWriteTodosToolUI;
33495
33764
  exports.ListDatabaseTablesToolUI = ListDatabaseTablesToolUI;
33765
+ exports.ListFilesToolUI = ListFilesToolUI;
33496
33766
  exports.NestedPtcMessages = NestedPtcMessages;
33497
33767
  exports.OpenAssetToolUI = OpenAssetToolUI;
33498
33768
  exports.OpenBrowserToolUI = OpenBrowserToolUI;
33499
33769
  exports.PTC_SUBCALL_DID_NOT_COMPLETE_MESSAGE = PTC_SUBCALL_DID_NOT_COMPLETE_MESSAGE;
33500
33770
  exports.ReadAssetToolUI = ReadAssetToolUI;
33771
+ exports.ReadFileToolUI = ReadFileToolUI;
33501
33772
  exports.RunPythonCodeToolUI = RunPythonCodeToolUI;
33502
33773
  exports.RunSqlToolUI = RunSqlToolUI;
33774
+ exports.SearchFilesToolUI = SearchFilesToolUI;
33503
33775
  exports.StatewireApprovalCard = StatewireApprovalCard;
33504
33776
  exports.StatewireClientToolBridge = StatewireClientToolBridge;
33505
33777
  exports.StatewireConnectionBanner = StatewireConnectionBanner;
@@ -33526,6 +33798,7 @@ exports.TooltipProvider = TooltipProvider;
33526
33798
  exports.TooltipTrigger = TooltipTrigger;
33527
33799
  exports.UpdateSheetRangeToolUI = UpdateSheetRangeToolUI;
33528
33800
  exports.WebSearchToolUI = WebSearchToolUI;
33801
+ exports.WriteFileToolUI = WriteFileToolUI;
33529
33802
  exports.WriteTodosToolUI = WriteTodosToolUI;
33530
33803
  exports.allowsMidRunSend = allowsMidRunSend;
33531
33804
  exports.asHitlApproval = asHitlApproval;
@@ -33539,6 +33812,7 @@ exports.conversationSummaryFromIndexEntry = conversationSummaryFromIndexEntry;
33539
33812
  exports.convertLangChainToThreadMessages = convertLangChainToThreadMessages;
33540
33813
  exports.createAssetToolUI = createAssetToolUI;
33541
33814
  exports.formatToolName = formatToolName;
33815
+ exports.friendlyWorkspacePath = friendlyWorkspacePath;
33542
33816
  exports.getAssetInfo = getAssetInfo;
33543
33817
  exports.hasStatewireThreadExtras = hasStatewireThreadExtras;
33544
33818
  exports.isAthenaCitationUrl = isAthenaCitationUrl;
@@ -33570,6 +33844,7 @@ exports.useAthenaThreadListAdapter = useAthenaThreadListAdapter;
33570
33844
  exports.useAthenaThreadManager = useAthenaThreadManager;
33571
33845
  exports.useComposerAttachment = useComposerAttachment;
33572
33846
  exports.useFileUpload = useFileUpload;
33847
+ exports.useLatestTodoPlan = useLatestTodoPlan;
33573
33848
  exports.useMentionSuggestions = useMentionSuggestions;
33574
33849
  exports.useParentAuth = useParentAuth;
33575
33850
  exports.useParentBridge = useParentBridge;