@athenaintel/react 0.2.0 → 0.4.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.d.ts CHANGED
@@ -30,6 +30,10 @@ export declare interface AssetPanelState {
30
30
  activeTabId: string | null;
31
31
  viewMode: ViewMode;
32
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>;
33
37
  openAsset: (assetId: string, meta?: {
34
38
  name?: string;
35
39
  type?: AssetType;
@@ -39,6 +43,10 @@ export declare interface AssetPanelState {
39
43
  setViewMode: (mode: ViewMode) => void;
40
44
  closePanel: () => void;
41
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;
42
50
  }
43
51
 
44
52
  export declare interface AssetTab {
@@ -86,7 +94,7 @@ export declare interface AthenaLayoutProps {
86
94
  minPercent?: number;
87
95
  }
88
96
 
89
- export declare function AthenaProvider({ children, apiKey, token: tokenProp, agent, model, tools, frontendTools, apiUrl, backendUrl, workbench, knowledgeBase, systemPrompt, threadId, }: AthenaProviderProps): JSX.Element;
97
+ export declare function AthenaProvider({ children, apiKey, token: tokenProp, agent, model, tools, frontendTools, apiUrl, backendUrl, workbench, knowledgeBase, systemPrompt, threadId: threadIdProp, enableThreadList, }: AthenaProviderProps): JSX.Element;
90
98
 
91
99
  export declare interface AthenaProviderProps {
92
100
  children: ReactNode;
@@ -115,6 +123,8 @@ export declare interface AthenaProviderProps {
115
123
  systemPrompt?: string;
116
124
  /** Thread ID override. Auto-generated if not provided. */
117
125
  threadId?: string;
126
+ /** Enable thread list management (list, switch, create threads). Defaults to false. */
127
+ enableThreadList?: boolean;
118
128
  }
119
129
 
120
130
  export declare interface AthenaRuntimeConfig {
@@ -173,6 +183,8 @@ export declare const CreatePresentationToolUI: ToolCallMessagePartComponent;
173
183
 
174
184
  export declare const CreateSheetToolUI: ToolCallMessagePartComponent;
175
185
 
186
+ export declare function createThreadListStore(config: StoreConfig): UseBoundStore<StoreApi<ThreadListStore>>;
187
+
176
188
  export declare const DEFAULT_BACKEND_URL = "https://api.athenaintel.com/api/assistant-ui";
177
189
 
178
190
  export declare const EmailSearchToolUI: ToolCallMessagePartComponent;
@@ -255,6 +267,52 @@ declare interface SourceResult {
255
267
  };
256
268
  }
257
269
 
270
+ declare interface StoreConfig {
271
+ backendUrl: string;
272
+ apiKey?: string;
273
+ token?: string | null;
274
+ }
275
+
276
+ export declare function ThreadList({ className }: ThreadListProps): JSX.Element;
277
+
278
+ export declare interface ThreadListActions {
279
+ /** Fetch threads from Agora. */
280
+ fetchThreads: () => Promise<void>;
281
+ /** Switch to an existing thread. */
282
+ switchThread: (threadId: string) => void;
283
+ /** Create a new thread and switch to it. */
284
+ newThread: () => Promise<string>;
285
+ /** Archive a thread. If it's active, switch to the most recent thread. */
286
+ archiveThread: (threadId: string) => Promise<void>;
287
+ }
288
+
289
+ export declare interface ThreadListProps {
290
+ className?: string;
291
+ }
292
+
293
+ export declare interface ThreadListState {
294
+ threads: ThreadSummary[];
295
+ activeThreadId: string | null;
296
+ isLoading: boolean;
297
+ error: string | null;
298
+ }
299
+
300
+ export declare type ThreadListStore = ThreadListState & ThreadListActions;
301
+
302
+ /**
303
+ * Agora thread API client.
304
+ * Calls existing REST endpoints for thread CRUD.
305
+ */
306
+ export declare interface ThreadSummary {
307
+ thread_id: string;
308
+ title: string;
309
+ created_at: string;
310
+ updated_at: string;
311
+ last_message: string | null;
312
+ message_count: number;
313
+ state: string | null;
314
+ }
315
+
258
316
  export declare const TiptapComposer: FC<TiptapComposerProps>;
259
317
 
260
318
  export declare interface TiptapComposerProps {
@@ -326,6 +384,21 @@ export declare function TooltipTrigger({ ...props }: React_2.ComponentProps<type
326
384
 
327
385
  export declare function tryParseJson(text: string): Record<string, unknown> | null;
328
386
 
387
+ /** Hook to get just the active thread ID. */
388
+ export declare function useActiveThreadId(): string | null;
389
+
390
+ /**
391
+ * Hook to programmatically append text to the composer.
392
+ *
393
+ * Usage:
394
+ * const append = useAppendToComposer();
395
+ * append("some text to add");
396
+ * append("quoted text", { replace: true }); // replaces existing text
397
+ */
398
+ export declare function useAppendToComposer(): (text: string, opts?: {
399
+ replace?: boolean;
400
+ }) => void;
401
+
329
402
  /**
330
403
  * Hook to generate an embed URL for rendering an asset in an iframe.
331
404
  * Calls the Agora `/api/embed/generate-token` endpoint.
@@ -353,6 +426,21 @@ export declare function useAthenaConfig(): AthenaConfig;
353
426
 
354
427
  export declare const useAthenaRuntime: (config: AthenaRuntimeConfig) => AssistantRuntime;
355
428
 
429
+ /**
430
+ * Hook for programmatic composer file attachment control.
431
+ *
432
+ * Usage:
433
+ * const { addFile, addContent, clear } = useComposerAttachment();
434
+ * addFile(fileObject);
435
+ * addContent("data.csv", "col1,col2\n1,2");
436
+ * clear();
437
+ */
438
+ export declare function useComposerAttachment(): {
439
+ addFile: (file: File) => void;
440
+ addContent: (name: string, content: string) => void;
441
+ clear: () => void;
442
+ };
443
+
356
444
  export declare function useMentionSuggestions(tools: MentionTool[]): MentionSuggestionsStore;
357
445
 
358
446
  /**
@@ -370,6 +458,9 @@ export declare function useMentionSuggestions(tools: MentionTool[]): MentionSugg
370
458
  */
371
459
  export declare function useParentAuth(): string | null;
372
460
 
461
+ /** Hook to access thread list state and actions. */
462
+ export declare function useThreadList(): ThreadListState & ThreadListActions;
463
+
373
464
  export declare type ViewMode = 'tabs' | 'tiled';
374
465
 
375
466
  export declare const WebSearchToolUI: ToolCallMessagePartComponent;