@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.js CHANGED
@@ -17,8 +17,8 @@ var __privateWrapper = (obj, member, setter, getter) => ({
17
17
  }
18
18
  });
19
19
  var _mutations, _scopes, _mutationId, _a2, _queries, _b, _queryCache, _mutationCache, _defaultOptions, _queryDefaults, _mutationDefaults, _mountCount, _unsubscribeFocus, _unsubscribeOnline, _c;
20
- import { a as athenaDiagnostics, D as DEFAULT_API_URL, b as DEFAULT_BACKEND_URL, g as getThreadState, C as CLIENT_TOOL_INTERRUPT_SOURCE, c as CLIENT_TOOL_RESULT_STATUS_ERROR, d as CLIENT_TOOL_RESULT_STATUS_SUCCESS, S as StatewireSuspended, e as Subscribable, M as Mutation, n as notifyManager, m as matchMutation, f as noop$1, h as hashQueryKeyByOptions, Q as Query, i as matchQuery, j as focusManager, o as onlineManager, r as resolveStaleTime, k as functionalUpdate, l as infiniteQueryBehavior, p as hashKey, q as partialMatchKey, s as skipToken, t as readDeepAgentStreamValues, u as isDeepAgentStateHydrated, v as DEEP_AGENT_PROTOCOL_VERSION, w as DEEP_AGENT_PROTOCOL_STATE_KEY, x as DEEP_AGENT_PROTOCOL_VERSION_HEADER, y as convertDeepAgentState, z as deepAgentMaterialize, A as readPersistedFailedSendStamps, B as QuotaSafeLocalStorageSession, E as useFloating, F as offset, G as shift, H as limitShift, I as flip, J as size, K as arrow$1, L as hide, N as autoUpdate, O as cn, P as archiveThread, R as listThreads, T as QueryClientProvider, U as createRestConversationListFetcher, V as useConversationList, W as installAthenaDiagnosticsGlobal, X as debugPropToDiagnosticsConfig, Y as getAthenaEnvironmentUrls, Z as deriveAthenaAppUrl, _ as resolveStatewireSyncUrl, $ as PostHogProvider, a0 as Mark, a1 as markPasteRule, a2 as mergeAttributes, a3 as Plugin, a4 as PluginKey, a5 as combineTransactionSteps, a6 as getChangedRanges, a7 as findChildrenInRange, a8 as getMarksBetween, a9 as getAttributes, aa as Selection, ab as SelectionRange, ac as TextSelection, ad as Fragment, ae as Slice, af as DecorationSet, ag as Decoration, ah as keydownHandler, ai as NodeSelection, aj as Transform, ak as Node$1, al as callOrReturn, am as getExtensionField, an as findParentNodeClosestToPos, ao as Schema, ap as Mark$1, aq as Extension, ar as index, as as DOMParser, at as getHTMLFromFragment, au as createLucideIcon, av as Wrench, aw as Workflow, ax as Users, ay as Package, az as Monitor, aA as MessageSquare, aB as Mail, aC as LayoutGrid, aD as HardDrive, aE as Globe, aF as FolderKanban, aG as Folder, aH as FileText, aI as Database, aJ as Calendar, aK as BookOpen, aL as NodeViewWrapper, aM as nodePasteRule, aN as ReactNodeViewRenderer, aO as useEditor, aP as EditorContent, aQ as StarterKit, aR as useStore$1, aS as getFilteredItems, aT as ChevronRight, aU as useFloating$1, aV as FloatingPortal, aW as Suggestion, aX as ReactRenderer, aY as Store, aZ as registerSource, a_ as addItems, a$ as createItemCache, b0 as createScopeRegistry, b1 as createAthenaSpacesUrl, b2 as DEFAULT_APP_URL, b3 as Placeholder, b4 as RefreshCw, b5 as Check, b6 as ChevronDown, b7 as Archive, b8 as Code$2, b9 as Search, ba as Table$3, bb as Image$2, bc as Sheet, bd as Camera, be as LoaderCircle, bf as Copy, bg as ChatThreadShell, bh as ChatComposerDock, bi as ComposerSendOrStop, bj as ArrowUp, bk as ListPlus, bl as File$1, bm as Plus, bn as useRestConversationHistory, bo as useMutation, bp as setThreadReadState } from "./use-rest-conversation-history-DYvfgoBF.js";
21
- import { bq, br, bs, bt, bu, bv, bw, bx, by, bz, bA, bB, bC, bD, bE, bF, bG, bH, bI } from "./use-rest-conversation-history-DYvfgoBF.js";
20
+ import { a as athenaDiagnostics, D as DEFAULT_API_URL, b as DEFAULT_BACKEND_URL, g as getThreadState, C as CLIENT_TOOL_INTERRUPT_SOURCE, c as CLIENT_TOOL_RESULT_STATUS_ERROR, d as CLIENT_TOOL_RESULT_STATUS_SUCCESS, S as StatewireSuspended, e as Subscribable, M as Mutation, n as notifyManager, m as matchMutation, f as noop$1, h as hashQueryKeyByOptions, Q as Query, i as matchQuery, j as focusManager, o as onlineManager, r as resolveStaleTime, k as functionalUpdate, l as infiniteQueryBehavior, p as hashKey, q as partialMatchKey, s as skipToken, t as readDeepAgentStreamValues, u as isDeepAgentStateHydrated, v as DEEP_AGENT_PROTOCOL_VERSION, w as DEEP_AGENT_PROTOCOL_STATE_KEY, x as DEEP_AGENT_PROTOCOL_VERSION_HEADER, y as convertDeepAgentState, z as deepAgentMaterialize, A as readPersistedFailedSendStamps, B as QuotaSafeLocalStorageSession, E as useFloating, F as offset, G as shift, H as limitShift, I as flip, J as size, K as arrow$1, L as hide, N as autoUpdate, O as cn, P as archiveThread, R as listThreads, T as QueryClientProvider, U as createRestConversationListFetcher, V as useConversationList, W as installAthenaDiagnosticsGlobal, X as debugPropToDiagnosticsConfig, Y as getAthenaEnvironmentUrls, Z as deriveAthenaAppUrl, _ as resolveStatewireSyncUrl, $ as PostHogProvider, a0 as Mark, a1 as markPasteRule, a2 as mergeAttributes, a3 as Plugin, a4 as PluginKey, a5 as combineTransactionSteps, a6 as getChangedRanges, a7 as findChildrenInRange, a8 as getMarksBetween, a9 as getAttributes, aa as Selection, ab as SelectionRange, ac as TextSelection, ad as Fragment, ae as Slice, af as DecorationSet, ag as Decoration, ah as keydownHandler, ai as NodeSelection, aj as Transform, ak as Node$1, al as callOrReturn, am as getExtensionField, an as findParentNodeClosestToPos, ao as Schema, ap as Mark$1, aq as Extension, ar as index, as as DOMParser, at as getHTMLFromFragment, au as createLucideIcon, av as Wrench, aw as Workflow, ax as Users, ay as Package, az as Monitor, aA as MessageSquare, aB as Mail, aC as LayoutGrid, aD as HardDrive, aE as Globe, aF as FolderKanban, aG as Folder, aH as FileText, aI as Database, aJ as Calendar, aK as BookOpen, aL as NodeViewWrapper, aM as nodePasteRule, aN as ReactNodeViewRenderer, aO as useEditor, aP as EditorContent, aQ as StarterKit, aR as useStore$1, aS as getFilteredItems, aT as ChevronRight, aU as useFloating$1, aV as FloatingPortal, aW as Suggestion, aX as ReactRenderer, aY as Store, aZ as registerSource, a_ as addItems, a$ as createItemCache, b0 as createScopeRegistry, b1 as createAthenaSpacesUrl, b2 as DEFAULT_APP_URL, b3 as Placeholder, b4 as RefreshCw, b5 as Check, b6 as ChevronDown, b7 as Archive, b8 as Code$2, b9 as Search, ba as Table$3, bb as Image$2, bc as Sheet, bd as Camera, be as LoaderCircle, bf as Copy, bg as ChatThreadShell, bh as ChatComposerDock, bi as ComposerSendOrStop, bj as ArrowUp, bk as ListPlus, bl as File$1, bm as Plus, bn as useRestConversationHistory, bo as useMutation, bp as setThreadReadState } from "./use-rest-conversation-history-CV7HyHGr.js";
21
+ import { bq, br, bs, bt, bu, bv, bw, bx, by, bz, bA, bB, bC, bD, bE, bF, bG, bH, bI } from "./use-rest-conversation-history-CV7HyHGr.js";
22
22
  import * as React from "react";
23
23
  import React__default, { useSyncExternalStore, useCallback, useMemo, useState, useRef, useEffect, useContext, createContext, useReducer, forwardRef, useImperativeHandle, Component, Fragment as Fragment$1, memo } from "react";
24
24
  import { jsx, jsxs, Fragment as Fragment$2 } from "react/jsx-runtime";
@@ -2210,7 +2210,7 @@ class Doc {
2210
2210
  return new F(...args, lines.join("\n"));
2211
2211
  }
2212
2212
  }
2213
- const version = {
2213
+ const version$1 = {
2214
2214
  major: 4,
2215
2215
  minor: 4,
2216
2216
  patch: 3
@@ -2221,7 +2221,7 @@ const $ZodType = /* @__PURE__ */ $constructor("$ZodType", (inst, def) => {
2221
2221
  inst ?? (inst = {});
2222
2222
  inst._zod.def = def;
2223
2223
  inst._zod.bag = inst._zod.bag || {};
2224
- inst._zod.version = version;
2224
+ inst._zod.version = version$1;
2225
2225
  const checks = [...inst._zod.def.checks ?? []];
2226
2226
  if (inst._zod.traits.has("$ZodCheck")) {
2227
2227
  checks.unshift(inst);
@@ -7974,6 +7974,7 @@ function useDeepAgentThread({
7974
7974
  const lastLegacyRunActiveRef = useRef(null);
7975
7975
  const lastProtocolRef = useRef(null);
7976
7976
  const appliedStateRunConfigThreadRef = useRef(null);
7977
+ const absentStateRunConfigAttachRef = useRef(null);
7977
7978
  const notifiedLegacyReadOnlyThreadRef = useRef(null);
7978
7979
  const lastLegacyObservedThreadRef = useRef(null);
7979
7980
  const threadIdRef = useRef(threadId);
@@ -7999,6 +8000,12 @@ function useDeepAgentThread({
7999
8000
  if (notifyRunConfig) {
8000
8001
  queueMicrotask(() => notifyRunConfig(stateRunConfig));
8001
8002
  }
8003
+ } else if (!stateRunConfig && appliedStateRunConfigThreadRef.current !== attachIdRef.current && absentStateRunConfigAttachRef.current !== attachIdRef.current && projectDeepAgentProtocol(state) !== null) {
8004
+ absentStateRunConfigAttachRef.current = attachIdRef.current;
8005
+ const notifyRunConfig = onServerRunConfigRef.current;
8006
+ if (notifyRunConfig) {
8007
+ queueMicrotask(() => notifyRunConfig(null));
8008
+ }
8002
8009
  }
8003
8010
  const stateLegacyReadOnly = state == null ? void 0 : state.legacyReadOnly;
8004
8011
  if (lastLegacyObservedThreadRef.current !== attachIdRef.current) {
@@ -8964,11 +8971,11 @@ function createContextScope(scopeName, createContextScopeDeps = []) {
8964
8971
  return [createContext3, composeContextScopes(createScope, ...createContextScopeDeps)];
8965
8972
  }
8966
8973
  __name$d(createContextScope, "createContextScope");
8967
- function composeContextScopes(...scopes) {
8968
- const baseScope = scopes[0];
8969
- if (scopes.length === 1) return baseScope;
8974
+ function composeContextScopes(...scopes2) {
8975
+ const baseScope = scopes2[0];
8976
+ if (scopes2.length === 1) return baseScope;
8970
8977
  const createScope = /* @__PURE__ */ __name$d(() => {
8971
- const scopeHooks = scopes.map((createScope2) => ({
8978
+ const scopeHooks = scopes2.map((createScope2) => ({
8972
8979
  useScope: createScope2(),
8973
8980
  scopeName: createScope2.scopeName
8974
8981
  }));
@@ -10754,22 +10761,22 @@ function TooltipContent({
10754
10761
  }
10755
10762
  const createStoreImpl = (createState) => {
10756
10763
  let state;
10757
- const listeners = /* @__PURE__ */ new Set();
10764
+ const listeners2 = /* @__PURE__ */ new Set();
10758
10765
  const setState = (partial2, replace2) => {
10759
10766
  const nextState = typeof partial2 === "function" ? partial2(state) : partial2;
10760
10767
  if (!Object.is(nextState, state)) {
10761
10768
  const previousState = state;
10762
10769
  state = (replace2 != null ? replace2 : typeof nextState !== "object" || nextState === null) ? nextState : Object.assign({}, state, nextState);
10763
- listeners.forEach((listener) => listener(state, previousState));
10770
+ listeners2.forEach((listener) => listener(state, previousState));
10764
10771
  }
10765
10772
  };
10766
10773
  const getState2 = () => state;
10767
10774
  const getInitialState = () => initialState;
10768
- const subscribe = (listener) => {
10769
- listeners.add(listener);
10770
- return () => listeners.delete(listener);
10775
+ const subscribe2 = (listener) => {
10776
+ listeners2.add(listener);
10777
+ return () => listeners2.delete(listener);
10771
10778
  };
10772
- const api = { setState, getState: getState2, getInitialState, subscribe };
10779
+ const api = { setState, getState: getState2, getInitialState, subscribe: subscribe2 };
10773
10780
  const initialState = state = createState(setState, getState2, api);
10774
10781
  return api;
10775
10782
  };
@@ -11012,7 +11019,10 @@ const useAssetPanelStore = create()(
11012
11019
  ...t,
11013
11020
  name: meta.name ?? t.name,
11014
11021
  type: meta.type ?? t.type,
11015
- slideNumber: "slideNumber" in meta ? meta.slideNumber : t.slideNumber
11022
+ slideNumber: "slideNumber" in meta ? meta.slideNumber : t.slideNumber,
11023
+ // A repeat citation click re-targets the open tab: the new
11024
+ // reference reaches the iframe (src change -> navigation).
11025
+ reference: "reference" in meta ? meta.reference : t.reference
11016
11026
  } : t
11017
11027
  ) : s.tabs;
11018
11028
  return { isOpen: true, tabs, activeTabId: assetId };
@@ -11021,7 +11031,8 @@ const useAssetPanelStore = create()(
11021
11031
  id: assetId,
11022
11032
  name: (meta == null ? void 0 : meta.name) ?? null,
11023
11033
  type: (meta == null ? void 0 : meta.type) ?? "unknown",
11024
- slideNumber: meta == null ? void 0 : meta.slideNumber
11034
+ slideNumber: meta == null ? void 0 : meta.slideNumber,
11035
+ reference: meta == null ? void 0 : meta.reference
11025
11036
  };
11026
11037
  return { isOpen: true, tabs: [...s.tabs, newTab], activeTabId: assetId };
11027
11038
  }),
@@ -23462,40 +23473,40 @@ function detectMentionTypeFromUrl(url) {
23462
23473
  * This source code is licensed under the ISC license.
23463
23474
  * See the LICENSE file in the root directory of this source tree.
23464
23475
  */
23465
- const __iconNode$K = [
23476
+ const __iconNode$L = [
23466
23477
  ["path", { d: "M12 5v14", key: "s699le" }],
23467
23478
  ["path", { d: "m19 12-7 7-7-7", key: "1idqje" }]
23468
23479
  ];
23469
- const ArrowDown = createLucideIcon("arrow-down", __iconNode$K);
23480
+ const ArrowDown = createLucideIcon("arrow-down", __iconNode$L);
23470
23481
  /**
23471
23482
  * @license lucide-react v0.575.0 - ISC
23472
23483
  *
23473
23484
  * This source code is licensed under the ISC license.
23474
23485
  * See the LICENSE file in the root directory of this source tree.
23475
23486
  */
23476
- const __iconNode$J = [
23487
+ const __iconNode$K = [
23477
23488
  ["path", { d: "m12 19-7-7 7-7", key: "1l729n" }],
23478
23489
  ["path", { d: "M19 12H5", key: "x3x0zl" }]
23479
23490
  ];
23480
- const ArrowLeft = createLucideIcon("arrow-left", __iconNode$J);
23491
+ const ArrowLeft = createLucideIcon("arrow-left", __iconNode$K);
23481
23492
  /**
23482
23493
  * @license lucide-react v0.575.0 - ISC
23483
23494
  *
23484
23495
  * This source code is licensed under the ISC license.
23485
23496
  * See the LICENSE file in the root directory of this source tree.
23486
23497
  */
23487
- const __iconNode$I = [
23498
+ const __iconNode$J = [
23488
23499
  ["path", { d: "M5 12h14", key: "1ays0h" }],
23489
23500
  ["path", { d: "m12 5 7 7-7 7", key: "xquz4c" }]
23490
23501
  ];
23491
- const ArrowRight = createLucideIcon("arrow-right", __iconNode$I);
23502
+ const ArrowRight = createLucideIcon("arrow-right", __iconNode$J);
23492
23503
  /**
23493
23504
  * @license lucide-react v0.575.0 - ISC
23494
23505
  *
23495
23506
  * This source code is licensed under the ISC license.
23496
23507
  * See the LICENSE file in the root directory of this source tree.
23497
23508
  */
23498
- const __iconNode$H = [
23509
+ const __iconNode$I = [
23499
23510
  [
23500
23511
  "path",
23501
23512
  {
@@ -23527,14 +23538,14 @@ const __iconNode$H = [
23527
23538
  ["path", { d: "m12 8 4.74-2.85", key: "3rx089" }],
23528
23539
  ["path", { d: "M12 13.5V8", key: "1io7kd" }]
23529
23540
  ];
23530
- const Boxes = createLucideIcon("boxes", __iconNode$H);
23541
+ const Boxes = createLucideIcon("boxes", __iconNode$I);
23531
23542
  /**
23532
23543
  * @license lucide-react v0.575.0 - ISC
23533
23544
  *
23534
23545
  * This source code is licensed under the ISC license.
23535
23546
  * See the LICENSE file in the root directory of this source tree.
23536
23547
  */
23537
- const __iconNode$G = [
23548
+ const __iconNode$H = [
23538
23549
  ["path", { d: "M12 18V5", key: "adv99a" }],
23539
23550
  ["path", { d: "M15 13a4.17 4.17 0 0 1-3-4 4.17 4.17 0 0 1-3 4", key: "1e3is1" }],
23540
23551
  ["path", { d: "M17.598 6.5A3 3 0 1 0 12 5a3 3 0 1 0-5.598 1.5", key: "1gqd8o" }],
@@ -23544,27 +23555,27 @@ const __iconNode$G = [
23544
23555
  ["path", { d: "M6 18a4 4 0 0 1-2-7.464", key: "k1g0md" }],
23545
23556
  ["path", { d: "M6.003 5.125a4 4 0 0 0-2.526 5.77", key: "q97ue3" }]
23546
23557
  ];
23547
- const Brain = createLucideIcon("brain", __iconNode$G);
23558
+ const Brain = createLucideIcon("brain", __iconNode$H);
23548
23559
  /**
23549
23560
  * @license lucide-react v0.575.0 - ISC
23550
23561
  *
23551
23562
  * This source code is licensed under the ISC license.
23552
23563
  * See the LICENSE file in the root directory of this source tree.
23553
23564
  */
23554
- const __iconNode$F = [
23565
+ const __iconNode$G = [
23555
23566
  ["path", { d: "M12 12h.01", key: "1mp3jc" }],
23556
23567
  ["path", { d: "M16 6V4a2 2 0 0 0-2-2h-4a2 2 0 0 0-2 2v2", key: "1ksdt3" }],
23557
23568
  ["path", { d: "M22 13a18.15 18.15 0 0 1-20 0", key: "12hx5q" }],
23558
23569
  ["rect", { width: "20", height: "14", x: "2", y: "6", rx: "2", key: "i6l2r4" }]
23559
23570
  ];
23560
- const BriefcaseBusiness = createLucideIcon("briefcase-business", __iconNode$F);
23571
+ const BriefcaseBusiness = createLucideIcon("briefcase-business", __iconNode$G);
23561
23572
  /**
23562
23573
  * @license lucide-react v0.575.0 - ISC
23563
23574
  *
23564
23575
  * This source code is licensed under the ISC license.
23565
23576
  * See the LICENSE file in the root directory of this source tree.
23566
23577
  */
23567
- const __iconNode$E = [
23578
+ const __iconNode$F = [
23568
23579
  [
23569
23580
  "path",
23570
23581
  { 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" }
@@ -23579,153 +23590,153 @@ const __iconNode$E = [
23579
23590
  ],
23580
23591
  ["path", { d: "M7 5V3", key: "1t1388" }]
23581
23592
  ];
23582
- const Cable = createLucideIcon("cable", __iconNode$E);
23593
+ const Cable = createLucideIcon("cable", __iconNode$F);
23583
23594
  /**
23584
23595
  * @license lucide-react v0.575.0 - ISC
23585
23596
  *
23586
23597
  * This source code is licensed under the ISC license.
23587
23598
  * See the LICENSE file in the root directory of this source tree.
23588
23599
  */
23589
- const __iconNode$D = [
23600
+ const __iconNode$E = [
23590
23601
  ["path", { d: "M3 3v16a2 2 0 0 0 2 2h16", key: "c24i48" }],
23591
23602
  ["path", { d: "M7 16h8", key: "srdodz" }],
23592
23603
  ["path", { d: "M7 11h12", key: "127s9w" }],
23593
23604
  ["path", { d: "M7 6h3", key: "w9rmul" }]
23594
23605
  ];
23595
- const ChartBar = createLucideIcon("chart-bar", __iconNode$D);
23606
+ const ChartBar = createLucideIcon("chart-bar", __iconNode$E);
23596
23607
  /**
23597
23608
  * @license lucide-react v0.575.0 - ISC
23598
23609
  *
23599
23610
  * This source code is licensed under the ISC license.
23600
23611
  * See the LICENSE file in the root directory of this source tree.
23601
23612
  */
23602
- const __iconNode$C = [
23613
+ const __iconNode$D = [
23603
23614
  ["path", { d: "M3 3v16a2 2 0 0 0 2 2h16", key: "c24i48" }],
23604
23615
  ["path", { d: "M18 17V9", key: "2bz60n" }],
23605
23616
  ["path", { d: "M13 17V5", key: "1frdt8" }],
23606
23617
  ["path", { d: "M8 17v-3", key: "17ska0" }]
23607
23618
  ];
23608
- const ChartColumn = createLucideIcon("chart-column", __iconNode$C);
23619
+ const ChartColumn = createLucideIcon("chart-column", __iconNode$D);
23609
23620
  /**
23610
23621
  * @license lucide-react v0.575.0 - ISC
23611
23622
  *
23612
23623
  * This source code is licensed under the ISC license.
23613
23624
  * See the LICENSE file in the root directory of this source tree.
23614
23625
  */
23615
- const __iconNode$B = [["path", { d: "m18 15-6-6-6 6", key: "153udz" }]];
23616
- const ChevronUp = createLucideIcon("chevron-up", __iconNode$B);
23626
+ const __iconNode$C = [["path", { d: "m18 15-6-6-6 6", key: "153udz" }]];
23627
+ const ChevronUp = createLucideIcon("chevron-up", __iconNode$C);
23617
23628
  /**
23618
23629
  * @license lucide-react v0.575.0 - ISC
23619
23630
  *
23620
23631
  * This source code is licensed under the ISC license.
23621
23632
  * See the LICENSE file in the root directory of this source tree.
23622
23633
  */
23623
- const __iconNode$A = [
23634
+ const __iconNode$B = [
23624
23635
  ["circle", { cx: "12", cy: "12", r: "10", key: "1mglay" }],
23625
23636
  ["line", { x1: "12", x2: "12", y1: "8", y2: "12", key: "1pkeuh" }],
23626
23637
  ["line", { x1: "12", x2: "12.01", y1: "16", y2: "16", key: "4dfq90" }]
23627
23638
  ];
23628
- const CircleAlert = createLucideIcon("circle-alert", __iconNode$A);
23639
+ const CircleAlert = createLucideIcon("circle-alert", __iconNode$B);
23629
23640
  /**
23630
23641
  * @license lucide-react v0.575.0 - ISC
23631
23642
  *
23632
23643
  * This source code is licensed under the ISC license.
23633
23644
  * See the LICENSE file in the root directory of this source tree.
23634
23645
  */
23635
- const __iconNode$z = [
23646
+ const __iconNode$A = [
23636
23647
  ["circle", { cx: "12", cy: "12", r: "10", key: "1mglay" }],
23637
23648
  ["path", { d: "m9 12 2 2 4-4", key: "dzmm74" }]
23638
23649
  ];
23639
- const CircleCheck = createLucideIcon("circle-check", __iconNode$z);
23650
+ const CircleCheck = createLucideIcon("circle-check", __iconNode$A);
23640
23651
  /**
23641
23652
  * @license lucide-react v0.575.0 - ISC
23642
23653
  *
23643
23654
  * This source code is licensed under the ISC license.
23644
23655
  * See the LICENSE file in the root directory of this source tree.
23645
23656
  */
23646
- const __iconNode$y = [
23657
+ const __iconNode$z = [
23647
23658
  ["circle", { cx: "12", cy: "12", r: "10", key: "1mglay" }],
23648
23659
  ["path", { d: "m15 9-6 6", key: "1uzhvr" }],
23649
23660
  ["path", { d: "m9 9 6 6", key: "z0biqf" }]
23650
23661
  ];
23651
- const CircleX = createLucideIcon("circle-x", __iconNode$y);
23662
+ const CircleX = createLucideIcon("circle-x", __iconNode$z);
23652
23663
  /**
23653
23664
  * @license lucide-react v0.575.0 - ISC
23654
23665
  *
23655
23666
  * This source code is licensed under the ISC license.
23656
23667
  * See the LICENSE file in the root directory of this source tree.
23657
23668
  */
23658
- const __iconNode$x = [["circle", { cx: "12", cy: "12", r: "10", key: "1mglay" }]];
23659
- const Circle = createLucideIcon("circle", __iconNode$x);
23669
+ const __iconNode$y = [["circle", { cx: "12", cy: "12", r: "10", key: "1mglay" }]];
23670
+ const Circle = createLucideIcon("circle", __iconNode$y);
23660
23671
  /**
23661
23672
  * @license lucide-react v0.575.0 - ISC
23662
23673
  *
23663
23674
  * This source code is licensed under the ISC license.
23664
23675
  * See the LICENSE file in the root directory of this source tree.
23665
23676
  */
23666
- const __iconNode$w = [
23677
+ const __iconNode$x = [
23667
23678
  ["rect", { width: "8", height: "4", x: "8", y: "2", rx: "1", ry: "1", key: "tgr4d6" }],
23668
23679
  ["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" }],
23669
23680
  ["path", { d: "M16 4h2a2 2 0 0 1 2 2v4", key: "3hqy98" }],
23670
23681
  ["path", { d: "M21 14H11", key: "1bme5i" }],
23671
23682
  ["path", { d: "m15 10-4 4 4 4", key: "5dvupr" }]
23672
23683
  ];
23673
- const ClipboardCopy = createLucideIcon("clipboard-copy", __iconNode$w);
23684
+ const ClipboardCopy = createLucideIcon("clipboard-copy", __iconNode$x);
23674
23685
  /**
23675
23686
  * @license lucide-react v0.575.0 - ISC
23676
23687
  *
23677
23688
  * This source code is licensed under the ISC license.
23678
23689
  * See the LICENSE file in the root directory of this source tree.
23679
23690
  */
23680
- const __iconNode$v = [
23691
+ const __iconNode$w = [
23681
23692
  ["path", { d: "m18 16 4-4-4-4", key: "1inbqp" }],
23682
23693
  ["path", { d: "m6 8-4 4 4 4", key: "15zrgr" }],
23683
23694
  ["path", { d: "m14.5 4-5 16", key: "e7oirm" }]
23684
23695
  ];
23685
- const CodeXml = createLucideIcon("code-xml", __iconNode$v);
23696
+ const CodeXml = createLucideIcon("code-xml", __iconNode$w);
23686
23697
  /**
23687
23698
  * @license lucide-react v0.575.0 - ISC
23688
23699
  *
23689
23700
  * This source code is licensed under the ISC license.
23690
23701
  * See the LICENSE file in the root directory of this source tree.
23691
23702
  */
23692
- const __iconNode$u = [
23703
+ const __iconNode$v = [
23693
23704
  ["path", { d: "M12 15V3", key: "m9g1x1" }],
23694
23705
  ["path", { d: "M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4", key: "ih7n3h" }],
23695
23706
  ["path", { d: "m7 10 5 5 5-5", key: "brsn70" }]
23696
23707
  ];
23697
- const Download = createLucideIcon("download", __iconNode$u);
23708
+ const Download = createLucideIcon("download", __iconNode$v);
23698
23709
  /**
23699
23710
  * @license lucide-react v0.575.0 - ISC
23700
23711
  *
23701
23712
  * This source code is licensed under the ISC license.
23702
23713
  * See the LICENSE file in the root directory of this source tree.
23703
23714
  */
23704
- const __iconNode$t = [
23715
+ const __iconNode$u = [
23705
23716
  ["circle", { cx: "12", cy: "12", r: "1", key: "41hilf" }],
23706
23717
  ["circle", { cx: "19", cy: "12", r: "1", key: "1wjl8i" }],
23707
23718
  ["circle", { cx: "5", cy: "12", r: "1", key: "1pcz8c" }]
23708
23719
  ];
23709
- const Ellipsis = createLucideIcon("ellipsis", __iconNode$t);
23720
+ const Ellipsis = createLucideIcon("ellipsis", __iconNode$u);
23710
23721
  /**
23711
23722
  * @license lucide-react v0.575.0 - ISC
23712
23723
  *
23713
23724
  * This source code is licensed under the ISC license.
23714
23725
  * See the LICENSE file in the root directory of this source tree.
23715
23726
  */
23716
- const __iconNode$s = [
23727
+ const __iconNode$t = [
23717
23728
  ["path", { d: "M15 3h6v6", key: "1q9fwt" }],
23718
23729
  ["path", { d: "M10 14 21 3", key: "gplh6r" }],
23719
23730
  ["path", { d: "M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6", key: "a6xqqp" }]
23720
23731
  ];
23721
- const ExternalLink = createLucideIcon("external-link", __iconNode$s);
23732
+ const ExternalLink = createLucideIcon("external-link", __iconNode$t);
23722
23733
  /**
23723
23734
  * @license lucide-react v0.575.0 - ISC
23724
23735
  *
23725
23736
  * This source code is licensed under the ISC license.
23726
23737
  * See the LICENSE file in the root directory of this source tree.
23727
23738
  */
23728
- const __iconNode$r = [
23739
+ const __iconNode$s = [
23729
23740
  [
23730
23741
  "path",
23731
23742
  {
@@ -23737,14 +23748,14 @@ const __iconNode$r = [
23737
23748
  ["path", { d: "M9 15h6", key: "cctwl0" }],
23738
23749
  ["path", { d: "M12 18v-6", key: "17g6i2" }]
23739
23750
  ];
23740
- const FilePlus = createLucideIcon("file-plus", __iconNode$r);
23751
+ const FilePlus = createLucideIcon("file-plus", __iconNode$s);
23741
23752
  /**
23742
23753
  * @license lucide-react v0.575.0 - ISC
23743
23754
  *
23744
23755
  * This source code is licensed under the ISC license.
23745
23756
  * See the LICENSE file in the root directory of this source tree.
23746
23757
  */
23747
- const __iconNode$q = [
23758
+ const __iconNode$r = [
23748
23759
  [
23749
23760
  "path",
23750
23761
  {
@@ -23758,14 +23769,14 @@ const __iconNode$q = [
23758
23769
  ["path", { d: "M8 17h2", key: "2yhykz" }],
23759
23770
  ["path", { d: "M14 17h2", key: "10kma7" }]
23760
23771
  ];
23761
- const FileSpreadsheet = createLucideIcon("file-spreadsheet", __iconNode$q);
23772
+ const FileSpreadsheet = createLucideIcon("file-spreadsheet", __iconNode$r);
23762
23773
  /**
23763
23774
  * @license lucide-react v0.575.0 - ISC
23764
23775
  *
23765
23776
  * This source code is licensed under the ISC license.
23766
23777
  * See the LICENSE file in the root directory of this source tree.
23767
23778
  */
23768
- const __iconNode$p = [
23779
+ const __iconNode$q = [
23769
23780
  [
23770
23781
  "path",
23771
23782
  {
@@ -23774,14 +23785,14 @@ const __iconNode$p = [
23774
23785
  }
23775
23786
  ]
23776
23787
  ];
23777
- const FolderOpen = createLucideIcon("folder-open", __iconNode$p);
23788
+ const FolderOpen = createLucideIcon("folder-open", __iconNode$q);
23778
23789
  /**
23779
23790
  * @license lucide-react v0.575.0 - ISC
23780
23791
  *
23781
23792
  * This source code is licensed under the ISC license.
23782
23793
  * See the LICENSE file in the root directory of this source tree.
23783
23794
  */
23784
- const __iconNode$o = [
23795
+ const __iconNode$p = [
23785
23796
  [
23786
23797
  "path",
23787
23798
  {
@@ -23804,39 +23815,39 @@ const __iconNode$o = [
23804
23815
  }
23805
23816
  ]
23806
23817
  ];
23807
- const Layers = createLucideIcon("layers", __iconNode$o);
23818
+ const Layers = createLucideIcon("layers", __iconNode$p);
23808
23819
  /**
23809
23820
  * @license lucide-react v0.575.0 - ISC
23810
23821
  *
23811
23822
  * This source code is licensed under the ISC license.
23812
23823
  * See the LICENSE file in the root directory of this source tree.
23813
23824
  */
23814
- const __iconNode$n = [
23825
+ const __iconNode$o = [
23815
23826
  ["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" }],
23816
23827
  ["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" }]
23817
23828
  ];
23818
- const Link = createLucideIcon("link", __iconNode$n);
23829
+ const Link = createLucideIcon("link", __iconNode$o);
23819
23830
  /**
23820
23831
  * @license lucide-react v0.575.0 - ISC
23821
23832
  *
23822
23833
  * This source code is licensed under the ISC license.
23823
23834
  * See the LICENSE file in the root directory of this source tree.
23824
23835
  */
23825
- const __iconNode$m = [
23836
+ const __iconNode$n = [
23826
23837
  ["path", { d: "M13 5h8", key: "a7qcls" }],
23827
23838
  ["path", { d: "M13 12h8", key: "h98zly" }],
23828
23839
  ["path", { d: "M13 19h8", key: "c3s6r1" }],
23829
23840
  ["path", { d: "m3 17 2 2 4-4", key: "1jhpwq" }],
23830
23841
  ["path", { d: "m3 7 2 2 4-4", key: "1obspn" }]
23831
23842
  ];
23832
- const ListChecks = createLucideIcon("list-checks", __iconNode$m);
23843
+ const ListChecks = createLucideIcon("list-checks", __iconNode$n);
23833
23844
  /**
23834
23845
  * @license lucide-react v0.575.0 - ISC
23835
23846
  *
23836
23847
  * This source code is licensed under the ISC license.
23837
23848
  * See the LICENSE file in the root directory of this source tree.
23838
23849
  */
23839
- const __iconNode$l = [
23850
+ const __iconNode$m = [
23840
23851
  ["path", { d: "M12 2v4", key: "3427ic" }],
23841
23852
  ["path", { d: "m16.2 7.8 2.9-2.9", key: "r700ao" }],
23842
23853
  ["path", { d: "M18 12h4", key: "wj9ykh" }],
@@ -23846,27 +23857,27 @@ const __iconNode$l = [
23846
23857
  ["path", { d: "M2 12h4", key: "j09sii" }],
23847
23858
  ["path", { d: "m4.9 4.9 2.9 2.9", key: "giyufr" }]
23848
23859
  ];
23849
- const Loader = createLucideIcon("loader", __iconNode$l);
23860
+ const Loader = createLucideIcon("loader", __iconNode$m);
23850
23861
  /**
23851
23862
  * @license lucide-react v0.575.0 - ISC
23852
23863
  *
23853
23864
  * This source code is licensed under the ISC license.
23854
23865
  * See the LICENSE file in the root directory of this source tree.
23855
23866
  */
23856
- const __iconNode$k = [
23867
+ const __iconNode$l = [
23857
23868
  ["path", { d: "M15 3h6v6", key: "1q9fwt" }],
23858
23869
  ["path", { d: "m21 3-7 7", key: "1l2asr" }],
23859
23870
  ["path", { d: "m3 21 7-7", key: "tjx5ai" }],
23860
23871
  ["path", { d: "M9 21H3v-6", key: "wtvkvv" }]
23861
23872
  ];
23862
- const Maximize2 = createLucideIcon("maximize-2", __iconNode$k);
23873
+ const Maximize2 = createLucideIcon("maximize-2", __iconNode$l);
23863
23874
  /**
23864
23875
  * @license lucide-react v0.575.0 - ISC
23865
23876
  *
23866
23877
  * This source code is licensed under the ISC license.
23867
23878
  * See the LICENSE file in the root directory of this source tree.
23868
23879
  */
23869
- const __iconNode$j = [
23880
+ const __iconNode$k = [
23870
23881
  [
23871
23882
  "path",
23872
23883
  {
@@ -23877,27 +23888,27 @@ const __iconNode$j = [
23877
23888
  ["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" }],
23878
23889
  ["path", { d: "M8 6v8", key: "15ugcq" }]
23879
23890
  ];
23880
- const Megaphone = createLucideIcon("megaphone", __iconNode$j);
23891
+ const Megaphone = createLucideIcon("megaphone", __iconNode$k);
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$i = [
23898
+ const __iconNode$j = [
23888
23899
  ["path", { d: "m14 10 7-7", key: "oa77jy" }],
23889
23900
  ["path", { d: "M20 10h-6V4", key: "mjg0md" }],
23890
23901
  ["path", { d: "m3 21 7-7", key: "tjx5ai" }],
23891
23902
  ["path", { d: "M4 14h6v6", key: "rmj7iw" }]
23892
23903
  ];
23893
- const Minimize2 = createLucideIcon("minimize-2", __iconNode$i);
23904
+ const Minimize2 = createLucideIcon("minimize-2", __iconNode$j);
23894
23905
  /**
23895
23906
  * @license lucide-react v0.575.0 - ISC
23896
23907
  *
23897
23908
  * This source code is licensed under the ISC license.
23898
23909
  * See the LICENSE file in the root directory of this source tree.
23899
23910
  */
23900
- const __iconNode$h = [
23911
+ const __iconNode$i = [
23901
23912
  ["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" }],
23902
23913
  ["path", { d: "M2 6h4", key: "aawbzj" }],
23903
23914
  ["path", { d: "M2 10h4", key: "l0bgd4" }],
@@ -23911,25 +23922,25 @@ const __iconNode$h = [
23911
23922
  }
23912
23923
  ]
23913
23924
  ];
23914
- const NotebookPen = createLucideIcon("notebook-pen", __iconNode$h);
23925
+ const NotebookPen = createLucideIcon("notebook-pen", __iconNode$i);
23915
23926
  /**
23916
23927
  * @license lucide-react v0.575.0 - ISC
23917
23928
  *
23918
23929
  * This source code is licensed under the ISC license.
23919
23930
  * See the LICENSE file in the root directory of this source tree.
23920
23931
  */
23921
- const __iconNode$g = [
23932
+ const __iconNode$h = [
23922
23933
  ["rect", { width: "18", height: "18", x: "3", y: "3", rx: "2", key: "afitv7" }],
23923
23934
  ["path", { d: "M3 9h18", key: "1pudct" }]
23924
23935
  ];
23925
- const PanelTop = createLucideIcon("panel-top", __iconNode$g);
23936
+ const PanelTop = createLucideIcon("panel-top", __iconNode$h);
23926
23937
  /**
23927
23938
  * @license lucide-react v0.575.0 - ISC
23928
23939
  *
23929
23940
  * This source code is licensed under the ISC license.
23930
23941
  * See the LICENSE file in the root directory of this source tree.
23931
23942
  */
23932
- const __iconNode$f = [
23943
+ const __iconNode$g = [
23933
23944
  [
23934
23945
  "path",
23935
23946
  {
@@ -23938,14 +23949,14 @@ const __iconNode$f = [
23938
23949
  }
23939
23950
  ]
23940
23951
  ];
23941
- const Paperclip = createLucideIcon("paperclip", __iconNode$f);
23952
+ const Paperclip = createLucideIcon("paperclip", __iconNode$g);
23942
23953
  /**
23943
23954
  * @license lucide-react v0.575.0 - ISC
23944
23955
  *
23945
23956
  * This source code is licensed under the ISC license.
23946
23957
  * See the LICENSE file in the root directory of this source tree.
23947
23958
  */
23948
- const __iconNode$e = [
23959
+ const __iconNode$f = [
23949
23960
  ["path", { d: "M13 21h8", key: "1jsn5i" }],
23950
23961
  [
23951
23962
  "path",
@@ -23955,14 +23966,14 @@ const __iconNode$e = [
23955
23966
  }
23956
23967
  ]
23957
23968
  ];
23958
- const PenLine = createLucideIcon("pen-line", __iconNode$e);
23969
+ const PenLine = createLucideIcon("pen-line", __iconNode$f);
23959
23970
  /**
23960
23971
  * @license lucide-react v0.575.0 - ISC
23961
23972
  *
23962
23973
  * This source code is licensed under the ISC license.
23963
23974
  * See the LICENSE file in the root directory of this source tree.
23964
23975
  */
23965
- const __iconNode$d = [
23976
+ const __iconNode$e = [
23966
23977
  [
23967
23978
  "path",
23968
23979
  {
@@ -23971,26 +23982,26 @@ const __iconNode$d = [
23971
23982
  }
23972
23983
  ]
23973
23984
  ];
23974
- const Play = createLucideIcon("play", __iconNode$d);
23985
+ const Play = createLucideIcon("play", __iconNode$e);
23975
23986
  /**
23976
23987
  * @license lucide-react v0.575.0 - ISC
23977
23988
  *
23978
23989
  * This source code is licensed under the ISC license.
23979
23990
  * See the LICENSE file in the root directory of this source tree.
23980
23991
  */
23981
- const __iconNode$c = [
23992
+ const __iconNode$d = [
23982
23993
  ["path", { d: "M2 3h20", key: "91anmk" }],
23983
23994
  ["path", { d: "M21 3v11a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V3", key: "2k9sn8" }],
23984
23995
  ["path", { d: "m7 21 5-5 5 5", key: "bip4we" }]
23985
23996
  ];
23986
- const Presentation = createLucideIcon("presentation", __iconNode$c);
23997
+ const Presentation = createLucideIcon("presentation", __iconNode$d);
23987
23998
  /**
23988
23999
  * @license lucide-react v0.575.0 - ISC
23989
24000
  *
23990
24001
  * This source code is licensed under the ISC license.
23991
24002
  * See the LICENSE file in the root directory of this source tree.
23992
24003
  */
23993
- const __iconNode$b = [
24004
+ const __iconNode$c = [
23994
24005
  [
23995
24006
  "path",
23996
24007
  {
@@ -24006,7 +24017,22 @@ const __iconNode$b = [
24006
24017
  }
24007
24018
  ]
24008
24019
  ];
24009
- const Quote = createLucideIcon("quote", __iconNode$b);
24020
+ const Quote = createLucideIcon("quote", __iconNode$c);
24021
+ /**
24022
+ * @license lucide-react v0.575.0 - ISC
24023
+ *
24024
+ * This source code is licensed under the ISC license.
24025
+ * See the LICENSE file in the root directory of this source tree.
24026
+ */
24027
+ const __iconNode$b = [
24028
+ ["path", { d: "M3 7V5a2 2 0 0 1 2-2h2", key: "aa7l1z" }],
24029
+ ["path", { d: "M17 3h2a2 2 0 0 1 2 2v2", key: "4qcy5o" }],
24030
+ ["path", { d: "M21 17v2a2 2 0 0 1-2 2h-2", key: "6vwrx8" }],
24031
+ ["path", { d: "M7 21H5a2 2 0 0 1-2-2v-2", key: "ioqczr" }],
24032
+ ["circle", { cx: "12", cy: "12", r: "3", key: "1v7zrd" }],
24033
+ ["path", { d: "m16 16-1.9-1.9", key: "1dq9hf" }]
24034
+ ];
24035
+ const ScanSearch = createLucideIcon("scan-search", __iconNode$b);
24010
24036
  /**
24011
24037
  * @license lucide-react v0.575.0 - ISC
24012
24038
  *
@@ -24627,7 +24653,10 @@ const useAthenaLinkClickHandler = () => {
24627
24653
  const openInAssetPanel = citationLink ? () => {
24628
24654
  openAsset(citationLink.assetId, {
24629
24655
  name: trimmedLinkText ?? void 0,
24630
- type: citationLink.assetType ?? void 0
24656
+ type: citationLink.assetType ?? void 0,
24657
+ // Carry the citation target so the panel's iframe navigates to
24658
+ // the cited range/page instead of opening at the top.
24659
+ reference: citationLink.reference
24631
24660
  });
24632
24661
  } : void 0;
24633
24662
  const context = {
@@ -27114,7 +27143,14 @@ const ReadAssetToolUIImpl = ({
27114
27143
  const resolvedAssetCount = Math.max(assetCount, new Set(resultAssetIds).size);
27115
27144
  const primaryAsset = getAssetInfo(firstAssetId || resultAssetIds[0] || "");
27116
27145
  const resultTitle = (_a3 = resultItems.find((item) => item.title)) == null ? void 0 : _a3.title;
27117
- const assetLabel = resolvedAssetCount > 1 ? `${primaryAsset.name} + ${resolvedAssetCount - 1} more` : resultTitle ?? primaryAsset.name;
27146
+ const isOpaqueId = (label) => /^asset_[0-9a-f-]{8,}/i.test(label);
27147
+ const primaryLabel = resultTitle ?? (isOpaqueId(primaryAsset.name) ? "1 document" : primaryAsset.name);
27148
+ const sourceList = resolvedAssetCount > 1 ? resultItems.filter((item) => typeof item.title === "string" && item.title !== "").map((item, index2) => ({
27149
+ key: item.asset_id ?? `${index2}-${item.title}`,
27150
+ label: item.title,
27151
+ failed: item.success === false
27152
+ })) : [];
27153
+ const assetLabel = resolvedAssetCount > 1 ? `${resolvedAssetCount} documents` : primaryLabel;
27118
27154
  const statusTitle = isRunning ? "Reviewing asset content" : hasError ? "Asset content review failed" : hasPartialIssues ? "Asset content reviewed with issues" : "Asset content review complete";
27119
27155
  const badge = hasPartialIssues ? `${failedItems.length} ${failedItems.length === 1 ? "issue" : "issues"}` : resolvedAssetCount > 1 ? `${resolvedAssetCount} sources` : workbookData ? "Workbook review" : "Content review";
27120
27156
  const hasContent = (isComplete || isIncomplete) && (resultText || workbookData);
@@ -27154,6 +27190,24 @@ const ReadAssetToolUIImpl = ({
27154
27190
  /* @__PURE__ */ jsx("div", { className: "h-1.5 w-8 animate-pulse rounded-full bg-blue-100" })
27155
27191
  ] })
27156
27192
  ] }),
27193
+ sourceList.length > 1 && /* @__PURE__ */ jsxs("ul", { className: "border-t px-4 py-2", children: [
27194
+ sourceList.slice(0, 8).map((source) => /* @__PURE__ */ jsxs(
27195
+ "li",
27196
+ {
27197
+ className: "flex items-center gap-2 py-0.5 text-[12px] text-muted-foreground",
27198
+ children: [
27199
+ source.failed ? /* @__PURE__ */ jsx(CircleAlert, { className: "size-3.5 shrink-0 text-red-400" }) : /* @__PURE__ */ jsx(CircleCheck, { className: "size-3.5 shrink-0 text-emerald-500" }),
27200
+ /* @__PURE__ */ jsx("span", { className: "min-w-0 truncate", children: source.label })
27201
+ ]
27202
+ },
27203
+ source.key
27204
+ )),
27205
+ sourceList.length > 8 && /* @__PURE__ */ jsxs("li", { className: "py-0.5 text-[11px] text-muted-foreground/70", children: [
27206
+ "and ",
27207
+ sourceList.length - 8,
27208
+ " more"
27209
+ ] })
27210
+ ] }),
27157
27211
  hasError && errorMessage && /* @__PURE__ */ jsx("div", { className: "border-t bg-red-50/50 px-4 py-2.5", children: /* @__PURE__ */ jsx("p", { className: "text-[12px] leading-relaxed text-red-600", children: errorMessage }) }),
27158
27212
  hasContent && !hasError && /* @__PURE__ */ jsxs("div", { className: "border-t", children: [
27159
27213
  /* @__PURE__ */ jsxs(
@@ -27187,6 +27241,176 @@ const ReadAssetToolUI = memo(
27187
27241
  ReadAssetToolUIImpl
27188
27242
  );
27189
27243
  ReadAssetToolUI.displayName = "ReadAssetToolUI";
27244
+ function friendlyWorkspacePath(value) {
27245
+ if (typeof value !== "string" || value.trim() === "") return void 0;
27246
+ const path = value.trim();
27247
+ if (path.includes("large_tool_results")) {
27248
+ return "detailed results from an earlier step";
27249
+ }
27250
+ if (path.includes("/memory/")) return "session memory";
27251
+ if (path.includes("/skills/")) return "a skill reference";
27252
+ const base2 = path.split("/").filter(Boolean).pop();
27253
+ return base2 ?? path;
27254
+ }
27255
+ function rawDetails(result) {
27256
+ if (result === null || result === void 0) return null;
27257
+ if (typeof result === "string") {
27258
+ return result.trim() !== "" ? result : null;
27259
+ }
27260
+ if (typeof result === "object") {
27261
+ const inner = result.result;
27262
+ if (typeof inner === "string") {
27263
+ return inner.trim() !== "" ? inner : null;
27264
+ }
27265
+ }
27266
+ const data = normalizeResult(result);
27267
+ if (data === null) return null;
27268
+ const text2 = JSON.stringify(data, null, 2);
27269
+ return text2.trim() !== "" ? text2 : null;
27270
+ }
27271
+ function makeQuietFileToolUI(spec) {
27272
+ const Impl = ({ args, result, status }) => {
27273
+ const typedArgs = args;
27274
+ let subtitle;
27275
+ for (const key of spec.subtitleArgs) {
27276
+ subtitle = friendlyWorkspacePath(typedArgs == null ? void 0 : typedArgs[key]);
27277
+ if (subtitle) break;
27278
+ }
27279
+ const isRunning = (status == null ? void 0 : status.type) === "running";
27280
+ const isFailed = (status == null ? void 0 : status.type) === "incomplete";
27281
+ const errorMsg = isFailed ? String(status.error ?? "") : null;
27282
+ const details = (status == null ? void 0 : status.type) === "complete" ? rawDetails(result) : null;
27283
+ return /* @__PURE__ */ jsx(
27284
+ ToolCard,
27285
+ {
27286
+ icon: spec.icon,
27287
+ status: (status == null ? void 0 : status.type) ?? "complete",
27288
+ title: isRunning ? spec.runningTitle : isFailed ? spec.failedTitle : spec.doneTitle,
27289
+ subtitle: subtitle ? truncate(subtitle, 70) : void 0,
27290
+ error: errorMsg || void 0,
27291
+ children: details && /* @__PURE__ */ jsx(ExpandableSection, { label: spec.detailsLabel, children: /* @__PURE__ */ jsx("pre", { className: "max-h-64 overflow-auto whitespace-pre-wrap break-all text-[11px] leading-snug text-muted-foreground", children: truncate(details, 6e3) }) })
27292
+ }
27293
+ );
27294
+ };
27295
+ const Quiet = memo(Impl);
27296
+ Quiet.displayName = `QuietFileToolUI(${spec.doneTitle})`;
27297
+ return Quiet;
27298
+ }
27299
+ const ReadFileToolUI = makeQuietFileToolUI({
27300
+ icon: ScanSearch,
27301
+ runningTitle: "Reviewing working files…",
27302
+ doneTitle: "Reviewed working files",
27303
+ failedTitle: "Couldn't review working files",
27304
+ subtitleArgs: ["file_path", "path"],
27305
+ detailsLabel: "Show details"
27306
+ });
27307
+ const ListFilesToolUI = makeQuietFileToolUI({
27308
+ icon: FolderOpen,
27309
+ runningTitle: "Checking the workspace…",
27310
+ doneTitle: "Checked the workspace",
27311
+ failedTitle: "Couldn't check the workspace",
27312
+ subtitleArgs: ["path"],
27313
+ detailsLabel: "Show files"
27314
+ });
27315
+ const WriteFileToolUI = makeQuietFileToolUI({
27316
+ icon: FileText,
27317
+ runningTitle: "Saving working files…",
27318
+ doneTitle: "Saved working files",
27319
+ failedTitle: "Couldn't save working files",
27320
+ subtitleArgs: ["file_path", "path"],
27321
+ detailsLabel: "Show details"
27322
+ });
27323
+ const EditFileToolUI = makeQuietFileToolUI({
27324
+ icon: PenLine,
27325
+ runningTitle: "Updating working files…",
27326
+ doneTitle: "Updated working files",
27327
+ failedTitle: "Couldn't update working files",
27328
+ subtitleArgs: ["file_path", "path"],
27329
+ detailsLabel: "Show details"
27330
+ });
27331
+ const SearchFilesToolUI = makeQuietFileToolUI({
27332
+ icon: Search,
27333
+ runningTitle: "Searching working files…",
27334
+ doneTitle: "Searched working files",
27335
+ failedTitle: "Couldn't search working files",
27336
+ subtitleArgs: ["pattern", "query", "path"],
27337
+ detailsLabel: "Show matches"
27338
+ });
27339
+ const DEFAULT_SCOPE = "default";
27340
+ let nextSeq = 1;
27341
+ const scopes = /* @__PURE__ */ new Map();
27342
+ const listeners = /* @__PURE__ */ new Set();
27343
+ let version = 0;
27344
+ function emit() {
27345
+ version++;
27346
+ for (const listener of listeners) listener();
27347
+ }
27348
+ function scopeEntries(scope) {
27349
+ let entries = scopes.get(scope);
27350
+ if (!entries) {
27351
+ entries = /* @__PURE__ */ new Map();
27352
+ scopes.set(scope, entries);
27353
+ }
27354
+ return entries;
27355
+ }
27356
+ function allocatePlanSeq() {
27357
+ return nextSeq++;
27358
+ }
27359
+ function registerPlanCard(scope, seq, plan, isWriting) {
27360
+ scopeEntries(scope).set(seq, { seq, plan, isWriting });
27361
+ emit();
27362
+ }
27363
+ function updatePlanCard(scope, seq, plan, isWriting) {
27364
+ var _a3;
27365
+ const entry = (_a3 = scopes.get(scope)) == null ? void 0 : _a3.get(seq);
27366
+ if (!entry) return;
27367
+ entry.plan = plan;
27368
+ entry.isWriting = isWriting;
27369
+ emit();
27370
+ }
27371
+ function unregisterPlanCard(scope, seq) {
27372
+ const entries = scopes.get(scope);
27373
+ if (!entries) return;
27374
+ if (entries.delete(seq)) {
27375
+ if (entries.size === 0) scopes.delete(scope);
27376
+ emit();
27377
+ }
27378
+ }
27379
+ function latestPlanSeq(scope) {
27380
+ const entries = scopes.get(scope);
27381
+ if (!entries) return null;
27382
+ let latest = null;
27383
+ for (const seq of entries.keys()) {
27384
+ if (latest === null || seq > latest) latest = seq;
27385
+ }
27386
+ return latest;
27387
+ }
27388
+ function latestPlanEntry(scope) {
27389
+ var _a3;
27390
+ const seq = latestPlanSeq(scope);
27391
+ return seq === null ? null : ((_a3 = scopes.get(scope)) == null ? void 0 : _a3.get(seq)) ?? null;
27392
+ }
27393
+ function subscribe(listener) {
27394
+ listeners.add(listener);
27395
+ return () => {
27396
+ listeners.delete(listener);
27397
+ };
27398
+ }
27399
+ const getVersion = () => version;
27400
+ function usePlanScope() {
27401
+ return useContext(AthenaThreadIdContext) ?? DEFAULT_SCOPE;
27402
+ }
27403
+ function useIsLatestPlanCard(scope, seq) {
27404
+ useSyncExternalStore(subscribe, getVersion, getVersion);
27405
+ const latest = latestPlanSeq(scope);
27406
+ return latest === null || latest === seq;
27407
+ }
27408
+ function useLatestTodoPlan() {
27409
+ const scope = usePlanScope();
27410
+ useSyncExternalStore(subscribe, getVersion, getVersion);
27411
+ const entry = latestPlanEntry(scope);
27412
+ return entry ? { plan: entry.plan, isWriting: entry.isWriting } : null;
27413
+ }
27190
27414
  const STEP_STATUSES = [
27191
27415
  "pending",
27192
27416
  "in_progress",
@@ -27300,17 +27524,50 @@ function PlanBadge({
27300
27524
  }
27301
27525
  );
27302
27526
  }
27527
+ function usePlanCardRegistration(plan, isWriting) {
27528
+ const scope = usePlanScope();
27529
+ const [seq] = useState(allocatePlanSeq);
27530
+ useEffect(() => {
27531
+ registerPlanCard(scope, seq, plan, isWriting);
27532
+ return () => unregisterPlanCard(scope, seq);
27533
+ }, [scope, seq]);
27534
+ useEffect(() => {
27535
+ updatePlanCard(scope, seq, plan, isWriting);
27536
+ }, [scope, seq, plan, isWriting]);
27537
+ return useIsLatestPlanCard(scope, seq);
27538
+ }
27539
+ const HiddenWriteTodosToolUIImpl = ({
27540
+ args,
27541
+ argsText,
27542
+ result,
27543
+ status
27544
+ }) => {
27545
+ const plan = useMemo(
27546
+ () => parseTodoPlan({ args, argsText, result }),
27547
+ [args, argsText, result]
27548
+ );
27549
+ usePlanCardRegistration(plan, (status == null ? void 0 : status.type) === "running");
27550
+ return null;
27551
+ };
27552
+ const HiddenWriteTodosToolUI = memo(
27553
+ HiddenWriteTodosToolUIImpl
27554
+ );
27555
+ HiddenWriteTodosToolUI.displayName = "HiddenWriteTodosToolUI";
27303
27556
  const WriteTodosToolUIImpl = ({
27304
27557
  args,
27305
27558
  argsText,
27306
27559
  result,
27307
27560
  status
27308
27561
  }) => {
27309
- const { steps, changeDescription } = useMemo(
27562
+ const plan = useMemo(
27310
27563
  () => parseTodoPlan({ args, argsText, result }),
27311
27564
  [args, argsText, result]
27312
27565
  );
27566
+ const { steps, changeDescription } = plan;
27313
27567
  const [collapsed, setCollapsed] = useState(false);
27568
+ const isWriting = (status == null ? void 0 : status.type) === "running";
27569
+ const isLatest = usePlanCardRegistration(plan, isWriting);
27570
+ if (!isLatest) return null;
27314
27571
  const completed = steps.filter((s) => s.status === "completed").length;
27315
27572
  const stopped = steps.filter(
27316
27573
  (s) => s.status === "cancelled" || s.status === "failed"
@@ -27318,7 +27575,6 @@ const WriteTodosToolUIImpl = ({
27318
27575
  const current = steps.find((s) => s.status === "in_progress");
27319
27576
  const total = steps.length;
27320
27577
  const resolved = completed + stopped;
27321
- const isWriting = (status == null ? void 0 : status.type) === "running";
27322
27578
  const isDone = total > 0 && resolved === total;
27323
27579
  if (total === 0) {
27324
27580
  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: [
@@ -30531,7 +30787,15 @@ const TOOL_UI_REGISTRY = {
30531
30787
  run_sql: RunSqlToolUI,
30532
30788
  run_database_sql: RunSqlToolUI,
30533
30789
  run_sql_query_tool: RunSqlToolUI,
30534
- write_todos: WriteTodosToolUI
30790
+ write_todos: WriteTodosToolUI,
30791
+ // Deep-agent workspace-file tools — quiet plain-English cards; the generic
30792
+ // fallback dumped raw scratch-space JSON (see file-tool-uis.tsx).
30793
+ read_file: ReadFileToolUI,
30794
+ ls: ListFilesToolUI,
30795
+ write_file: WriteFileToolUI,
30796
+ edit_file: EditFileToolUI,
30797
+ glob: SearchFilesToolUI,
30798
+ grep: SearchFilesToolUI
30535
30799
  };
30536
30800
  const TOOLKIT_THEMES = {
30537
30801
  Web: { color: "#7BCCFA" },
@@ -32768,12 +33032,15 @@ const AssetIframe = memo(
32768
33032
  }
32769
33033
  const initialSlideNumber = initialSlideRef.current.slideNumber;
32770
33034
  const iframeSrc = useMemo(
32771
- () => embedUrl ? buildAssetIframeSrc({
32772
- embedUrl,
32773
- assetType: tab.type,
32774
- slideNumber: initialSlideNumber
32775
- }) : null,
32776
- [embedUrl, initialSlideNumber, tab.type]
33035
+ () => embedUrl ? buildSdkAssetEmbedUrl(
33036
+ buildAssetIframeSrc({
33037
+ embedUrl,
33038
+ assetType: tab.type,
33039
+ slideNumber: initialSlideNumber
33040
+ }),
33041
+ tab.reference
33042
+ ) : null,
33043
+ [embedUrl, initialSlideNumber, tab.type, tab.reference]
32777
33044
  );
32778
33045
  const navigationMessage = useMemo(
32779
33046
  () => buildPresentationNavigationMessage({
@@ -33444,18 +33711,23 @@ export {
33444
33711
  DEFAULT_STATEWIRE_MODEL,
33445
33712
  bt as DEFAULT_STATEWIRE_SYNC_URL,
33446
33713
  DescribeDatabaseToolUI,
33714
+ EditFileToolUI,
33447
33715
  EmailSearchToolUI,
33448
33716
  ExpandableSection,
33449
33717
  FileUploadButton,
33450
33718
  GetDatabaseTableSchemaToolUI,
33719
+ HiddenWriteTodosToolUI,
33451
33720
  ListDatabaseTablesToolUI,
33721
+ ListFilesToolUI,
33452
33722
  NestedPtcMessages,
33453
33723
  OpenAssetToolUI,
33454
33724
  OpenBrowserToolUI,
33455
33725
  PTC_SUBCALL_DID_NOT_COMPLETE_MESSAGE,
33456
33726
  ReadAssetToolUI,
33727
+ ReadFileToolUI,
33457
33728
  RunPythonCodeToolUI,
33458
33729
  RunSqlToolUI,
33730
+ SearchFilesToolUI,
33459
33731
  StatewireApprovalCard,
33460
33732
  StatewireClientToolBridge,
33461
33733
  StatewireConnectionBanner,
@@ -33482,6 +33754,7 @@ export {
33482
33754
  TooltipTrigger,
33483
33755
  UpdateSheetRangeToolUI,
33484
33756
  WebSearchToolUI,
33757
+ WriteFileToolUI,
33485
33758
  WriteTodosToolUI,
33486
33759
  allowsMidRunSend,
33487
33760
  archiveThread,
@@ -33507,6 +33780,7 @@ export {
33507
33780
  deriveAthenaAppUrl,
33508
33781
  bA as deriveStatewireSyncUrl,
33509
33782
  formatToolName,
33783
+ friendlyWorkspacePath,
33510
33784
  getAssetInfo,
33511
33785
  bB as getPostHogInstance,
33512
33786
  bC as getPosthogCaptureGate,
@@ -33550,6 +33824,7 @@ export {
33550
33824
  useAthenaThreadManager,
33551
33825
  useComposerAttachment,
33552
33826
  useFileUpload,
33827
+ useLatestTodoPlan,
33553
33828
  useMentionSuggestions,
33554
33829
  useParentAuth,
33555
33830
  useParentBridge,