@athenaintel/react 0.1.0 → 0.3.0
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.cjs +1028 -203
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.ts +94 -0
- package/dist/index.js +1028 -203
- package/dist/index.js.map +1 -1
- package/package.json +3 -5
package/dist/index.d.ts
CHANGED
|
@@ -10,16 +10,53 @@ import * as React_2 from 'react';
|
|
|
10
10
|
import { ReactNode } from 'react';
|
|
11
11
|
import { RefAttributes } from 'react';
|
|
12
12
|
import { Store } from '@tanstack/react-store';
|
|
13
|
+
import { StoreApi } from 'zustand';
|
|
13
14
|
import { ToolCallMessagePartComponent } from '@assistant-ui/react';
|
|
14
15
|
import { ToolCallMessagePartStatus } from '@assistant-ui/react';
|
|
15
16
|
import { Toolkit } from '@assistant-ui/react';
|
|
16
17
|
import { Tooltip as Tooltip_2 } from 'radix-ui';
|
|
18
|
+
import { UseBoundStore } from 'zustand';
|
|
17
19
|
import { VariantProps } from 'class-variance-authority';
|
|
18
20
|
|
|
19
21
|
export declare const AppendDocumentToolUI: ToolCallMessagePartComponent;
|
|
20
22
|
|
|
21
23
|
declare type AssetIconType = "doc" | "pdf" | "sheet";
|
|
22
24
|
|
|
25
|
+
export declare const AssetPanel: FC;
|
|
26
|
+
|
|
27
|
+
export declare interface AssetPanelState {
|
|
28
|
+
isOpen: boolean;
|
|
29
|
+
tabs: AssetTab[];
|
|
30
|
+
activeTabId: string | null;
|
|
31
|
+
viewMode: ViewMode;
|
|
32
|
+
isFullscreen: boolean;
|
|
33
|
+
/** Generation counter for auto-open tracking — incremented on reset */
|
|
34
|
+
autoOpenGeneration: number;
|
|
35
|
+
/** Tracks which assets have been auto-opened in the current generation */
|
|
36
|
+
autoOpenedAssets: Map<string, number>;
|
|
37
|
+
openAsset: (assetId: string, meta?: {
|
|
38
|
+
name?: string;
|
|
39
|
+
type?: AssetType;
|
|
40
|
+
}) => void;
|
|
41
|
+
closeTab: (assetId: string) => void;
|
|
42
|
+
setActiveTab: (assetId: string) => void;
|
|
43
|
+
setViewMode: (mode: ViewMode) => void;
|
|
44
|
+
closePanel: () => void;
|
|
45
|
+
toggleFullscreen: () => void;
|
|
46
|
+
/** Reset auto-open tracking (increments generation so new assets can auto-open) */
|
|
47
|
+
resetAutoOpen: () => void;
|
|
48
|
+
/** Check if an asset should auto-open, and mark it as opened if so */
|
|
49
|
+
markAutoOpened: (assetId: string) => boolean;
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
export declare interface AssetTab {
|
|
53
|
+
id: string;
|
|
54
|
+
name: string | null;
|
|
55
|
+
type: AssetType;
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
export declare type AssetType = 'presentation' | 'spreadsheet' | 'document' | 'unknown';
|
|
59
|
+
|
|
23
60
|
export declare const AthenaChat: FC<AthenaChatProps>;
|
|
24
61
|
|
|
25
62
|
export declare interface AthenaChatProps {
|
|
@@ -37,6 +74,26 @@ export declare interface AthenaChatProps {
|
|
|
37
74
|
mentionTools?: MentionTool[];
|
|
38
75
|
}
|
|
39
76
|
|
|
77
|
+
export declare interface AthenaConfig {
|
|
78
|
+
apiKey?: string;
|
|
79
|
+
token?: string | null;
|
|
80
|
+
backendUrl: string;
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
/**
|
|
84
|
+
* Layout that places the chat on the left and the asset panel on the right.
|
|
85
|
+
* When no assets are open, the chat takes full width. Includes a draggable resize handle.
|
|
86
|
+
*/
|
|
87
|
+
export declare const AthenaLayout: FC<AthenaLayoutProps>;
|
|
88
|
+
|
|
89
|
+
export declare interface AthenaLayoutProps {
|
|
90
|
+
children: ReactNode;
|
|
91
|
+
/** Default width (%) of the chat panel when assets are open. Defaults to 50. */
|
|
92
|
+
defaultChatPercent?: number;
|
|
93
|
+
/** Minimum width (%) of each panel. Defaults to 25. */
|
|
94
|
+
minPercent?: number;
|
|
95
|
+
}
|
|
96
|
+
|
|
40
97
|
export declare function AthenaProvider({ children, apiKey, token: tokenProp, agent, model, tools, frontendTools, apiUrl, backendUrl, workbench, knowledgeBase, systemPrompt, threadId, }: AthenaProviderProps): JSX.Element;
|
|
41
98
|
|
|
42
99
|
export declare interface AthenaProviderProps {
|
|
@@ -106,6 +163,8 @@ export declare const buttonVariants: (props?: ({
|
|
|
106
163
|
size?: "default" | "icon" | "xs" | "sm" | "lg" | "icon-xs" | "icon-sm" | "icon-lg" | null | undefined;
|
|
107
164
|
} & ClassProp) | undefined) => string;
|
|
108
165
|
|
|
166
|
+
export declare function clearAutoOpenedAssets(): void;
|
|
167
|
+
|
|
109
168
|
export declare function cn(...inputs: ClassValue[]): string;
|
|
110
169
|
|
|
111
170
|
export declare function Collapsible({ ...props }: React.ComponentProps<typeof Collapsible_2.Root>): JSX.Element;
|
|
@@ -118,6 +177,12 @@ export declare const CreateDocumentToolUI: ToolCallMessagePartComponent;
|
|
|
118
177
|
|
|
119
178
|
export declare const CreateEmailDraftToolUI: ToolCallMessagePartComponent;
|
|
120
179
|
|
|
180
|
+
export declare const CreatePresentationToolUI: ToolCallMessagePartComponent;
|
|
181
|
+
|
|
182
|
+
export declare const CreateSheetToolUI: ToolCallMessagePartComponent;
|
|
183
|
+
|
|
184
|
+
export declare const DEFAULT_BACKEND_URL = "https://api.athenaintel.com/api/assistant-ui";
|
|
185
|
+
|
|
121
186
|
export declare const EmailSearchToolUI: ToolCallMessagePartComponent;
|
|
122
187
|
|
|
123
188
|
declare interface FetchState {
|
|
@@ -171,6 +236,8 @@ declare type MenuScope = string;
|
|
|
171
236
|
|
|
172
237
|
export declare const ReadAssetToolUI: ToolCallMessagePartComponent;
|
|
173
238
|
|
|
239
|
+
export declare function resetAssetAutoOpen(): void;
|
|
240
|
+
|
|
174
241
|
declare interface ScopeRegistry {
|
|
175
242
|
entries: Map<MenuScope, ScopeRegistryEntry>;
|
|
176
243
|
}
|
|
@@ -267,6 +334,31 @@ export declare function TooltipTrigger({ ...props }: React_2.ComponentProps<type
|
|
|
267
334
|
|
|
268
335
|
export declare function tryParseJson(text: string): Record<string, unknown> | null;
|
|
269
336
|
|
|
337
|
+
/**
|
|
338
|
+
* Hook to generate an embed URL for rendering an asset in an iframe.
|
|
339
|
+
* Calls the Agora `/api/embed/generate-token` endpoint.
|
|
340
|
+
*/
|
|
341
|
+
export declare function useAssetEmbed(assetId: string | null, options?: UseAssetEmbedOptions & {
|
|
342
|
+
backendUrl: string;
|
|
343
|
+
apiKey?: string;
|
|
344
|
+
token?: string | null;
|
|
345
|
+
}): UseAssetEmbedResult;
|
|
346
|
+
|
|
347
|
+
export declare interface UseAssetEmbedOptions {
|
|
348
|
+
readOnly?: boolean;
|
|
349
|
+
expiresInSeconds?: number;
|
|
350
|
+
}
|
|
351
|
+
|
|
352
|
+
export declare interface UseAssetEmbedResult {
|
|
353
|
+
embedUrl: string | null;
|
|
354
|
+
isLoading: boolean;
|
|
355
|
+
error: string | null;
|
|
356
|
+
}
|
|
357
|
+
|
|
358
|
+
export declare const useAssetPanelStore: UseBoundStore<StoreApi<AssetPanelState>>;
|
|
359
|
+
|
|
360
|
+
export declare function useAthenaConfig(): AthenaConfig;
|
|
361
|
+
|
|
270
362
|
export declare const useAthenaRuntime: (config: AthenaRuntimeConfig) => AssistantRuntime;
|
|
271
363
|
|
|
272
364
|
export declare function useMentionSuggestions(tools: MentionTool[]): MentionSuggestionsStore;
|
|
@@ -286,6 +378,8 @@ export declare function useMentionSuggestions(tools: MentionTool[]): MentionSugg
|
|
|
286
378
|
*/
|
|
287
379
|
export declare function useParentAuth(): string | null;
|
|
288
380
|
|
|
381
|
+
export declare type ViewMode = 'tabs' | 'tiled';
|
|
382
|
+
|
|
289
383
|
export declare const WebSearchToolUI: ToolCallMessagePartComponent;
|
|
290
384
|
|
|
291
385
|
export { }
|