@athenaintel/react 0.9.12 → 0.9.14
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/README.md +38 -0
- package/dist/index.cjs +536 -71
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.ts +108 -2
- package/dist/index.js +536 -71
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -26,7 +26,12 @@ export declare const AppendDocumentToolUI: ToolCallMessagePartComponent;
|
|
|
26
26
|
|
|
27
27
|
declare type AssetIconType = "doc" | "pdf" | "sheet";
|
|
28
28
|
|
|
29
|
-
export declare const AssetPanel: FC
|
|
29
|
+
export declare const AssetPanel: FC<AssetPanelProps>;
|
|
30
|
+
|
|
31
|
+
export declare interface AssetPanelProps {
|
|
32
|
+
/** Register this panel as an asset-panel host when used outside AthenaLayout. */
|
|
33
|
+
manageAssetPanelHostRegistration?: boolean;
|
|
34
|
+
}
|
|
30
35
|
|
|
31
36
|
export declare interface AssetPanelState {
|
|
32
37
|
isOpen: boolean;
|
|
@@ -34,10 +39,14 @@ export declare interface AssetPanelState {
|
|
|
34
39
|
activeTabId: string | null;
|
|
35
40
|
viewMode: ViewMode;
|
|
36
41
|
isFullscreen: boolean;
|
|
42
|
+
/** Number of registered hosts that can reveal the asset panel. */
|
|
43
|
+
assetPanelHostCount: number;
|
|
37
44
|
/** Generation counter for auto-open tracking — incremented on reset */
|
|
38
45
|
autoOpenGeneration: number;
|
|
39
46
|
/** Tracks which assets have been auto-opened in the current generation */
|
|
40
47
|
autoOpenedAssets: Map<string, number>;
|
|
48
|
+
registerAssetPanelHost: () => void;
|
|
49
|
+
unregisterAssetPanelHost: () => void;
|
|
41
50
|
openAsset: (assetId: string, meta?: {
|
|
42
51
|
name?: string;
|
|
43
52
|
type?: AssetType;
|
|
@@ -113,9 +122,44 @@ export declare interface AthenaChatProps {
|
|
|
113
122
|
components?: AthenaChatComponents;
|
|
114
123
|
}
|
|
115
124
|
|
|
125
|
+
export declare interface AthenaCitationLinkClickContext extends AthenaLinkClickContext {
|
|
126
|
+
kind: 'athena-citation';
|
|
127
|
+
citation: AthenaCitationLinkMetadata;
|
|
128
|
+
assetId: string;
|
|
129
|
+
assetIds: string[];
|
|
130
|
+
assetType: AssetType | null;
|
|
131
|
+
openInAssetPanel: () => void;
|
|
132
|
+
}
|
|
133
|
+
|
|
134
|
+
/**
|
|
135
|
+
* @deprecated Prefer `AthenaLinkClickHandleInput`.
|
|
136
|
+
*/
|
|
137
|
+
export declare type AthenaCitationLinkHandleInput = AthenaLinkClickHandleInput;
|
|
138
|
+
|
|
139
|
+
/**
|
|
140
|
+
* @deprecated Prefer `AthenaLinkClickHandler`.
|
|
141
|
+
*/
|
|
142
|
+
export declare type AthenaCitationLinkHandler = AthenaLinkClickHandler;
|
|
143
|
+
|
|
144
|
+
export declare interface AthenaCitationLinkMetadata {
|
|
145
|
+
assetId: string;
|
|
146
|
+
assetIds: string[];
|
|
147
|
+
assetType: AssetType | null;
|
|
148
|
+
}
|
|
149
|
+
|
|
150
|
+
/**
|
|
151
|
+
* @deprecated Prefer `AthenaLinkClickOptions`. This remains supported as a citation-only alias.
|
|
152
|
+
*/
|
|
153
|
+
export declare interface AthenaCitationLinkOptions {
|
|
154
|
+
interceptAthenaCitations?: boolean;
|
|
155
|
+
onClick?: (context: AthenaCitationLinkClickContext) => boolean | void;
|
|
156
|
+
}
|
|
157
|
+
|
|
116
158
|
export declare interface AthenaConfig extends Pick<AthenaProviderConfig, 'apiKey' | 'token'> {
|
|
117
159
|
backendUrl: string;
|
|
118
160
|
appUrl: string;
|
|
161
|
+
linkClicks?: AthenaLinkClickOptions;
|
|
162
|
+
citationLinks?: AthenaCitationLinkOptions;
|
|
119
163
|
}
|
|
120
164
|
|
|
121
165
|
export declare type AthenaEnvironment = 'production' | 'staging';
|
|
@@ -134,7 +178,44 @@ export declare interface AthenaLayoutProps {
|
|
|
134
178
|
minPercent?: number;
|
|
135
179
|
}
|
|
136
180
|
|
|
137
|
-
export declare
|
|
181
|
+
export declare interface AthenaLinkClickContext {
|
|
182
|
+
href: string;
|
|
183
|
+
url: URL;
|
|
184
|
+
target: string | null;
|
|
185
|
+
linkText: string | null;
|
|
186
|
+
isAssetPanelAvailable: boolean;
|
|
187
|
+
kind: AthenaLinkKind;
|
|
188
|
+
citation: AthenaCitationLinkMetadata | null;
|
|
189
|
+
nativeEvent: MouseEvent | null;
|
|
190
|
+
openInAssetPanel?: () => void;
|
|
191
|
+
openInBrowser: (target?: string | null) => void;
|
|
192
|
+
}
|
|
193
|
+
|
|
194
|
+
export declare interface AthenaLinkClickHandleInput {
|
|
195
|
+
href: string;
|
|
196
|
+
linkText?: string | null;
|
|
197
|
+
target?: string | null;
|
|
198
|
+
nativeEvent?: MouseEvent | null;
|
|
199
|
+
}
|
|
200
|
+
|
|
201
|
+
export declare type AthenaLinkClickHandler = (input: AthenaLinkClickHandleInput) => boolean;
|
|
202
|
+
|
|
203
|
+
export declare interface AthenaLinkClickOptions {
|
|
204
|
+
/**
|
|
205
|
+
* Whether Athena citation links should be intercepted by the SDK.
|
|
206
|
+
* Defaults to `true`.
|
|
207
|
+
*/
|
|
208
|
+
interceptAthenaCitations?: boolean;
|
|
209
|
+
/**
|
|
210
|
+
* Optional override invoked when any rendered chat link is clicked.
|
|
211
|
+
* Return `true` to mark the click as handled and skip the default SDK behavior.
|
|
212
|
+
*/
|
|
213
|
+
onClick?: (context: AthenaLinkClickContext) => boolean | void;
|
|
214
|
+
}
|
|
215
|
+
|
|
216
|
+
export declare type AthenaLinkKind = 'athena-citation' | 'athena-app' | 'external';
|
|
217
|
+
|
|
218
|
+
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;
|
|
138
219
|
|
|
139
220
|
export declare interface AthenaProviderConfig {
|
|
140
221
|
/** API key for standalone authentication when no token is provided. */
|
|
@@ -200,6 +281,10 @@ export declare interface AthenaProviderProps {
|
|
|
200
281
|
* <AthenaProvider theme={{ ...themes.dark, primary: '#22c55e' }}>
|
|
201
282
|
*/
|
|
202
283
|
theme?: AthenaTheme;
|
|
284
|
+
/** Customize how rendered chat links behave. */
|
|
285
|
+
linkClicks?: AthenaLinkClickOptions;
|
|
286
|
+
/** @deprecated Prefer `linkClicks`. Customize how Athena citation links rendered in chat messages behave. */
|
|
287
|
+
citationLinks?: AthenaCitationLinkOptions;
|
|
203
288
|
}
|
|
204
289
|
|
|
205
290
|
export declare const AthenaReasoningPart: FC<AthenaReasoningPartProps>;
|
|
@@ -431,6 +516,11 @@ export declare function getAssetInfo(assetId: string): {
|
|
|
431
516
|
icon: AssetIconType;
|
|
432
517
|
};
|
|
433
518
|
|
|
519
|
+
export declare const isAthenaCitationUrl: ({ href, appUrl, }: {
|
|
520
|
+
href: string;
|
|
521
|
+
appUrl?: string | null;
|
|
522
|
+
}) => boolean;
|
|
523
|
+
|
|
434
524
|
/** Item cache: deduplicates items by ID, tracks scope membership */
|
|
435
525
|
declare interface ItemCache {
|
|
436
526
|
items: Map<string, MenuItem>;
|
|
@@ -485,6 +575,18 @@ export declare interface ParentBridgeState {
|
|
|
485
575
|
ready: boolean;
|
|
486
576
|
}
|
|
487
577
|
|
|
578
|
+
export declare const parseAthenaCitationLink: ({ href, appUrl, }: {
|
|
579
|
+
href: string;
|
|
580
|
+
appUrl?: string | null;
|
|
581
|
+
}) => ParsedAthenaCitationLink | null;
|
|
582
|
+
|
|
583
|
+
export declare interface ParsedAthenaCitationLink {
|
|
584
|
+
url: URL;
|
|
585
|
+
assetId: string;
|
|
586
|
+
assetIds: string[];
|
|
587
|
+
assetType: AssetType | null;
|
|
588
|
+
}
|
|
589
|
+
|
|
488
590
|
declare interface QuoteContextValue {
|
|
489
591
|
quote: QuoteData | null;
|
|
490
592
|
setQuote: (quote: QuoteData | null) => void;
|
|
@@ -925,8 +1027,12 @@ export declare interface UseAssetEmbedResult {
|
|
|
925
1027
|
|
|
926
1028
|
export declare const useAssetPanelStore: UseBoundStore<StoreApi<AssetPanelState>>;
|
|
927
1029
|
|
|
1030
|
+
export declare const useAthenaCitationLinkHandler: () => AthenaCitationLinkHandler;
|
|
1031
|
+
|
|
928
1032
|
export declare function useAthenaConfig(): AthenaConfig;
|
|
929
1033
|
|
|
1034
|
+
export declare const useAthenaLinkClickHandler: () => AthenaLinkClickHandler;
|
|
1035
|
+
|
|
930
1036
|
export declare const useAthenaRuntime: (config: AthenaRuntimeConfig) => AssistantRuntime;
|
|
931
1037
|
|
|
932
1038
|
/**
|