@athenaintel/react 0.16.0 → 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-BZ9Pl9kF.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-BZ9Pl9kF.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";
@@ -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) {
@@ -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
  }),
@@ -24642,7 +24653,10 @@ const useAthenaLinkClickHandler = () => {
24642
24653
  const openInAssetPanel = citationLink ? () => {
24643
24654
  openAsset(citationLink.assetId, {
24644
24655
  name: trimmedLinkText ?? void 0,
24645
- 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
24646
24660
  });
24647
24661
  } : void 0;
24648
24662
  const context = {
@@ -33018,12 +33032,15 @@ const AssetIframe = memo(
33018
33032
  }
33019
33033
  const initialSlideNumber = initialSlideRef.current.slideNumber;
33020
33034
  const iframeSrc = useMemo(
33021
- () => embedUrl ? buildAssetIframeSrc({
33022
- embedUrl,
33023
- assetType: tab.type,
33024
- slideNumber: initialSlideNumber
33025
- }) : null,
33026
- [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]
33027
33044
  );
33028
33045
  const navigationMessage = useMemo(
33029
33046
  () => buildPresentationNavigationMessage({