@athenaintel/react 0.10.28 → 0.10.31

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.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- import { AssistantRuntime } from '@assistant-ui/core';
1
+ import { AssistantRuntime } from '@assistant-ui/react';
2
2
  import { ClassProp } from 'class-variance-authority/types';
3
3
  import { ClassValue } from 'clsx';
4
4
  import { Collapsible as Collapsible_2 } from 'radix-ui';
@@ -19,6 +19,7 @@ import { ReactNode } from 'react';
19
19
  import { ReasoningMessagePartComponent } from '@assistant-ui/react';
20
20
  import { ReasoningMessagePartProps } from '@assistant-ui/react';
21
21
  import { RefAttributes } from 'react';
22
+ import { RemoteThreadListAdapter } from '@assistant-ui/react';
22
23
  import { Store } from '@tanstack/react-store';
23
24
  import { StoreApi } from 'zustand';
24
25
  import { TextMessagePartComponent } from '@assistant-ui/react';
@@ -27,7 +28,6 @@ import { ToolCallMessagePartComponent } from '@assistant-ui/react';
27
28
  import { ToolCallMessagePartStatus } from '@assistant-ui/react';
28
29
  import { Toolkit } from '@assistant-ui/react';
29
30
  import { Tooltip as Tooltip_2 } from 'radix-ui';
30
- import { unstable_RemoteThreadListAdapter } from '@assistant-ui/react';
31
31
  import { UseBoundStore } from 'zustand';
32
32
  import { VariantProps } from 'class-variance-authority';
33
33
 
@@ -113,6 +113,8 @@ export declare interface AthenaAssistantMessageProps {
113
113
  ReasoningComponent?: ReasoningMessagePartComponent;
114
114
  EmptyComponent?: EmptyMessagePartComponent;
115
115
  ActionBarComponent?: FC<AthenaAssistantActionBarProps>;
116
+ /** Collapse adjacent tool calls into a single expandable group. Defaults to `false`. */
117
+ groupToolCalls?: boolean;
116
118
  }
117
119
 
118
120
  /**
@@ -167,6 +169,8 @@ export declare interface AthenaChatProps {
167
169
  welcomeSuggestions?: WelcomeSuggestion[];
168
170
  /** Optional component overrides for message containers and key message parts. */
169
171
  components?: AthenaChatComponents;
172
+ /** Collapse adjacent tool calls into a single expandable group. Defaults to `false`. */
173
+ groupToolCalls?: boolean;
170
174
  }
171
175
 
172
176
  export declare interface AthenaCitationLinkClickContext extends AthenaLinkClickContext {
@@ -276,7 +280,7 @@ export declare interface AthenaOrg {
276
280
  urlSafeOrgName: string;
277
281
  }
278
282
 
279
- export declare function AthenaProvider({ children, config, apiKey, token: tokenProp, agent, model, tools, frontendTools, apiUrl, backendUrl, appUrl, environment, workbench, knowledgeBase, systemPrompt, customToolConfigs, appId, threadId: threadIdProp, enableThreadList, theme, linkClicks, citationLinks, posthog: posthogProp, }: AthenaProviderProps): ReactElement<unknown, string | JSXElementConstructor<any>> | null;
283
+ export declare function AthenaProvider({ children, config, apiKey, token: tokenProp, agent, model, tools, frontendTools, disableAutoOpen, apiUrl, backendUrl, appUrl, environment, workbench, knowledgeBase, systemPrompt, customToolConfigs, appId, threadId: threadIdProp, enableThreadList, theme, linkClicks, citationLinks, posthog: posthogProp, }: AthenaProviderProps): ReactElement<unknown, string | JSXElementConstructor<any>> | null;
280
284
 
281
285
  export declare interface AthenaProviderConfig {
282
286
  /** API key for standalone authentication when no token is provided. */
@@ -312,8 +316,12 @@ export declare interface AthenaProviderProps {
312
316
  model?: string;
313
317
  /** Backend toolkit IDs to enable (e.g. 'document_toolkit', 'web_search_browse_toolkit'). */
314
318
  tools?: string[];
315
- /** Frontend tools that execute in the browser. The agent can invoke these. */
319
+ /** Frontend tools that execute in the browser. The agent can invoke these.
320
+ * Merged on top of the SDK's default auto-open tools; entries here take
321
+ * precedence over defaults with the same name. */
316
322
  frontendTools?: Toolkit;
323
+ /** Disable the SDK's default auto-open behavior for created/touched assets. */
324
+ disableAutoOpen?: boolean;
317
325
  /** @deprecated Prefer `config.apiUrl`. URL for the chat streaming endpoint. */
318
326
  apiUrl?: string;
319
327
  /** @deprecated Prefer `config.backendUrl`. URL for the Athena backend API. */
@@ -544,14 +552,6 @@ declare interface AthenaThreadListAdapterConfig {
544
552
  appId?: string;
545
553
  }
546
554
 
547
- /**
548
- * Public hook for managing thread state and navigation.
549
- *
550
- * Wraps the underlying runtime to provide a clean, Athena-branded API
551
- * for reading the active thread, listing threads, and switching between them.
552
- *
553
- * Must be used inside `<AthenaProvider enableThreadList>`.
554
- */
555
555
  export declare interface AthenaThreadManagerState {
556
556
  /** The backend thread ID of the currently active thread, or null if not yet synced. */
557
557
  activeThreadId: string | null;
@@ -598,7 +598,7 @@ export declare function Button({ className, variant, size, asChild, ...props }:
598
598
  }): JSX.Element;
599
599
 
600
600
  export declare const buttonVariants: (props?: ({
601
- variant?: "link" | "default" | "secondary" | "destructive" | "outline" | "ghost" | null | undefined;
601
+ variant?: "default" | "link" | "secondary" | "destructive" | "outline" | "ghost" | null | undefined;
602
602
  size?: "default" | "icon" | "xs" | "sm" | "lg" | "icon-xs" | "icon-sm" | "icon-lg" | null | undefined;
603
603
  } & ClassProp) | undefined) => string;
604
604
 
@@ -667,6 +667,14 @@ export declare const DEFAULT_API_URL: string;
667
667
 
668
668
  export declare const DEFAULT_APP_URL: string;
669
669
 
670
+ /**
671
+ * Default frontend tools that auto-open the asset a tool just created or
672
+ * touched. Registered automatically by `AthenaProvider` / `AthenaChat`; pass
673
+ * `disableAutoOpen` to turn off, or override individual entries via
674
+ * `frontendTools`.
675
+ */
676
+ export declare const DEFAULT_AUTO_OPEN_TOOLS: Toolkit;
677
+
670
678
  export declare const DEFAULT_BACKEND_URL: string;
671
679
 
672
680
  export declare const DescribeDatabaseToolUI: ToolCallMessagePartComponent;
@@ -1328,7 +1336,7 @@ export declare function useAthenaThreadId(): string | undefined;
1328
1336
  * Hook that returns a RemoteThreadListAdapter for the Athena platform.
1329
1337
  * Integrates with our Agora REST API for thread CRUD.
1330
1338
  */
1331
- export declare function useAthenaThreadListAdapter(config: AthenaThreadListAdapterConfig): unstable_RemoteThreadListAdapter;
1339
+ export declare function useAthenaThreadListAdapter(config: AthenaThreadListAdapterConfig): RemoteThreadListAdapter;
1332
1340
 
1333
1341
  export declare function useAthenaThreadManager(): AthenaThreadManagerState | null;
1334
1342
 
@@ -1383,20 +1391,22 @@ declare interface UseMentionSuggestionsOptions {
1383
1391
  export declare function useParentAuth(): string | null;
1384
1392
 
1385
1393
  /**
1386
- * Listens for auth tokens AND environment config sent from a parent window
1387
- * via PostMessage.
1394
+ * Listens for auth tokens AND environment config from the host environment.
1395
+ *
1396
+ * Two transport modes, picked automatically:
1388
1397
  *
1389
- * When the app runs inside a Marathon wrapper, the wrapper sends:
1390
- * 1. { type: 'athena-config', apiUrl, backendUrl, appUrl } correct URLs for the environment
1391
- * 2. { type: 'athena-auth', token } relayed from the Olympus token-bridge iframe
1398
+ * 1. **Iframe (legacy / Olympus inline preview)**: a parent window posts
1399
+ * `athena-config` and `athena-auth` via PostMessage. The hook also posts
1400
+ * `athena-auth-ready` so the parent knows when to (re-)send.
1392
1401
  *
1393
- * When running inside an Olympus inline preview, only athena-auth is sent.
1394
- * When running standalone (no parent), returns defaults immediately.
1402
+ * 2. **Standalone (Marathon-served deploy URL)**: top-level navigation, no
1403
+ * parent. The hook fetches `/_athena/auth` on its own origin. Marathon
1404
+ * validates its session cookie (sent by the browser automatically) and
1405
+ * returns `{ token, apiUrl, backendUrl, appUrl }`. A 404 means we're not
1406
+ * on a Marathon origin — the hook falls through with empty state.
1395
1407
  *
1396
- * Protocol:
1397
- * Parent -> iframe: { type: 'athena-config', apiUrl: string, backendUrl: string, appUrl?: string }
1398
- * Parent -> iframe: { type: 'athena-auth', token: '<propel-access-token>' }
1399
- * iframe -> Parent: { type: 'athena-auth-ready' }
1408
+ * In both modes a timeout safety net flips `ready: true` so the app never
1409
+ * blocks indefinitely.
1400
1410
  */
1401
1411
  export declare function useParentBridge({ trustedOrigins, }?: ParentBridgeOptions): ParentBridgeState;
1402
1412