@athenaintel/react 0.9.18 → 0.9.20

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
@@ -48,8 +48,10 @@ export declare interface AssetPanelState {
48
48
  autoOpenedAssets: Map<string, number>;
49
49
  registerAssetPanelHost: () => void;
50
50
  unregisterAssetPanelHost: () => void;
51
- openAsset: (assetId: string, meta?: AssetTabMeta) => void;
52
- updateTabMeta: (assetId: string, meta: AssetTabMeta) => void;
51
+ openAsset: (assetId: string, meta?: {
52
+ name?: string;
53
+ type?: AssetType;
54
+ }) => void;
53
55
  closeTab: (assetId: string) => void;
54
56
  setActiveTab: (assetId: string) => void;
55
57
  setViewMode: (mode: ViewMode) => void;
@@ -65,13 +67,6 @@ export declare interface AssetTab {
65
67
  id: string;
66
68
  name: string | null;
67
69
  type: AssetType;
68
- embedSearchParams: Record<string, string> | null;
69
- }
70
-
71
- declare interface AssetTabMeta {
72
- name?: string | null;
73
- type?: AssetType;
74
- embedSearchParams?: Record<string, string> | null;
75
70
  }
76
71
 
77
72
  export declare type AssetType = 'presentation' | 'spreadsheet' | 'document' | 'notebook' | 'unknown';
@@ -92,6 +87,24 @@ export declare interface AthenaAssistantMessageProps {
92
87
  ActionBarComponent?: FC<AthenaAssistantActionBarProps>;
93
88
  }
94
89
 
90
+ /**
91
+ * Auth state exposed by `useAthenaAuth()`.
92
+ */
93
+ export declare interface AthenaAuthState {
94
+ /** Whether the user is currently logged in. */
95
+ isLoggedIn: boolean;
96
+ /** Whether the auth state is still loading. */
97
+ isLoading: boolean;
98
+ /** The authenticated user, or `null` when not logged in. */
99
+ user: AthenaUser | null;
100
+ /** The current access token, or `null` when not logged in. */
101
+ accessToken: string | null;
102
+ /** Organizations the user belongs to. */
103
+ orgs: AthenaOrg[];
104
+ /** Log the user out. Redirects to the login page by default. */
105
+ logout: (redirectOnLogout?: boolean) => Promise<void>;
106
+ }
107
+
95
108
  export declare const AthenaChat: FC<AthenaChatProps>;
96
109
 
97
110
  export declare interface AthenaChatComponents {
@@ -151,8 +164,6 @@ export declare interface AthenaCitationLinkMetadata {
151
164
  assetId: string;
152
165
  assetIds: string[];
153
166
  assetType: AssetType | null;
154
- assetName: string | null;
155
- embedSearchParams: Record<string, string>;
156
167
  }
157
168
 
158
169
  /**
@@ -223,6 +234,15 @@ export declare interface AthenaLinkClickOptions {
223
234
 
224
235
  export declare type AthenaLinkKind = 'athena-citation' | 'athena-app' | 'external';
225
236
 
237
+ /**
238
+ * Athena organization membership.
239
+ */
240
+ export declare interface AthenaOrg {
241
+ orgId: string;
242
+ orgName: string;
243
+ urlSafeOrgName: string;
244
+ }
245
+
226
246
  export declare function AthenaProvider({ children, config, apiKey, token: tokenProp, agent, model, tools, frontendTools, apiUrl, backendUrl, appUrl, environment, workbench, knowledgeBase, systemPrompt, threadId: threadIdProp, enableThreadList, theme, linkClicks, citationLinks, }: AthenaProviderProps): JSX.Element | null;
227
247
 
228
248
  export declare interface AthenaProviderConfig {
@@ -236,6 +256,8 @@ export declare interface AthenaProviderConfig {
236
256
  backendUrl?: string;
237
257
  /** URL for the Athena frontend app origin. Defaults to the matching Athena environment. */
238
258
  appUrl?: string;
259
+ /** Exact parent origins allowed to send embedded auth/config via postMessage. */
260
+ trustedParentOrigins?: string[];
239
261
  /** Athena environment preset used when URLs are not explicitly provided. */
240
262
  environment?: AthenaEnvironment;
241
263
  }
@@ -330,6 +352,38 @@ export declare interface AthenaRuntimeConfig {
330
352
  threadId?: string;
331
353
  }
332
354
 
355
+ /**
356
+ * Organization membership returned by the SSO endpoint.
357
+ */
358
+ export declare interface AthenaSSOOrgInfo {
359
+ orgId: string;
360
+ orgName: string;
361
+ urlSafeOrgName: string;
362
+ }
363
+
364
+ /**
365
+ * User data returned by the Athena SSO `/api/sso/userinfo` endpoint.
366
+ * Field names use snake_case to match the backend response format.
367
+ */
368
+ export declare interface AthenaSSOUserData {
369
+ user_id: string;
370
+ email: string;
371
+ first_name: string;
372
+ last_name: string;
373
+ username: string;
374
+ picture_url: string;
375
+ properties: Record<string, unknown>;
376
+ }
377
+
378
+ /**
379
+ * Full response from the Athena SSO `/api/sso/userinfo` endpoint.
380
+ */
381
+ export declare interface AthenaSSOUserInfo {
382
+ user: AthenaSSOUserData;
383
+ orgMemberInfos: AthenaSSOOrgInfo[];
384
+ accessToken: string;
385
+ }
386
+
333
387
  /**
334
388
  * Athena SDK Theming System
335
389
  *
@@ -410,6 +464,19 @@ export declare interface AthenaTheme {
410
464
  threadMaxWidth?: string;
411
465
  }
412
466
 
467
+ /**
468
+ * Athena user information — a simplified, PropelAuth-agnostic representation.
469
+ */
470
+ export declare interface AthenaUser {
471
+ userId: string;
472
+ email: string;
473
+ firstName?: string;
474
+ lastName?: string;
475
+ username?: string;
476
+ pictureUrl?: string;
477
+ properties?: Record<string, unknown>;
478
+ }
479
+
413
480
  export declare const AthenaUserMessage: FC<AthenaUserMessageProps>;
414
481
 
415
482
  export declare interface AthenaUserMessageProps {
@@ -570,6 +637,14 @@ export declare function normalizeResult(result: unknown): Record<string, unknown
570
637
 
571
638
  export declare const OpenAssetToolUI: ToolCallMessagePartComponent;
572
639
 
640
+ declare interface ParentBridgeOptions {
641
+ /**
642
+ * Exact parent origins that are allowed to send auth/config via postMessage.
643
+ * Useful for private-cloud or custom-domain deployments.
644
+ */
645
+ trustedOrigins?: string[];
646
+ }
647
+
573
648
  export declare interface ParentBridgeState {
574
649
  /** PropelAuth access token from the parent window. */
575
650
  token: string | null;
@@ -593,8 +668,6 @@ export declare interface ParsedAthenaCitationLink {
593
668
  assetId: string;
594
669
  assetIds: string[];
595
670
  assetType: AssetType | null;
596
- assetName: string | null;
597
- embedSearchParams: Record<string, string>;
598
671
  }
599
672
 
600
673
  declare interface QuoteContextValue {
@@ -1027,15 +1100,12 @@ export declare function useAssetEmbed(assetId: string | null, options?: UseAsset
1027
1100
  export declare interface UseAssetEmbedOptions {
1028
1101
  readOnly?: boolean;
1029
1102
  expiresInSeconds?: number;
1030
- embedSearchParams?: Record<string, string> | null;
1031
1103
  }
1032
1104
 
1033
1105
  export declare interface UseAssetEmbedResult {
1034
1106
  embedUrl: string | null;
1035
1107
  isLoading: boolean;
1036
1108
  error: string | null;
1037
- assetTitle: string | null;
1038
- assetType: AssetType | null;
1039
1109
  }
1040
1110
 
1041
1111
  export declare const useAssetPanelStore: UseBoundStore<Omit<StoreApi<AssetPanelState>, "setState" | "persist"> & {
@@ -1122,7 +1192,7 @@ export declare function useParentAuth(): string | null;
1122
1192
  * Parent -> iframe: { type: 'athena-auth', token: '<propel-access-token>' }
1123
1193
  * iframe -> Parent: { type: 'athena-auth-ready' }
1124
1194
  */
1125
- export declare function useParentBridge(): ParentBridgeState;
1195
+ export declare function useParentBridge({ trustedOrigins, }?: ParentBridgeOptions): ParentBridgeState;
1126
1196
 
1127
1197
  export declare function useQuote(): QuoteContextValue;
1128
1198