@athenaintel/react 0.3.0 → 0.4.1

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
@@ -94,7 +94,7 @@ export declare interface AthenaLayoutProps {
94
94
  minPercent?: number;
95
95
  }
96
96
 
97
- 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;
98
98
 
99
99
  export declare interface AthenaProviderProps {
100
100
  children: ReactNode;
@@ -123,6 +123,8 @@ export declare interface AthenaProviderProps {
123
123
  systemPrompt?: string;
124
124
  /** Thread ID override. Auto-generated if not provided. */
125
125
  threadId?: string;
126
+ /** Enable thread list management (list, switch, create threads). Defaults to false. */
127
+ enableThreadList?: boolean;
126
128
  }
127
129
 
128
130
  export declare interface AthenaRuntimeConfig {
@@ -181,6 +183,8 @@ export declare const CreatePresentationToolUI: ToolCallMessagePartComponent;
181
183
 
182
184
  export declare const CreateSheetToolUI: ToolCallMessagePartComponent;
183
185
 
186
+ export declare function createThreadListStore(config: StoreConfig): UseBoundStore<StoreApi<ThreadListStore>>;
187
+
184
188
  export declare const DEFAULT_BACKEND_URL = "https://api.athenaintel.com/api/assistant-ui";
185
189
 
186
190
  export declare const EmailSearchToolUI: ToolCallMessagePartComponent;
@@ -263,6 +267,52 @@ declare interface SourceResult {
263
267
  };
264
268
  }
265
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
+
266
316
  export declare const TiptapComposer: FC<TiptapComposerProps>;
267
317
 
268
318
  export declare interface TiptapComposerProps {
@@ -334,6 +384,21 @@ export declare function TooltipTrigger({ ...props }: React_2.ComponentProps<type
334
384
 
335
385
  export declare function tryParseJson(text: string): Record<string, unknown> | null;
336
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
+
337
402
  /**
338
403
  * Hook to generate an embed URL for rendering an asset in an iframe.
339
404
  * Calls the Agora `/api/embed/generate-token` endpoint.
@@ -361,6 +426,21 @@ export declare function useAthenaConfig(): AthenaConfig;
361
426
 
362
427
  export declare const useAthenaRuntime: (config: AthenaRuntimeConfig) => AssistantRuntime;
363
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
+
364
444
  export declare function useMentionSuggestions(tools: MentionTool[]): MentionSuggestionsStore;
365
445
 
366
446
  /**
@@ -378,6 +458,9 @@ export declare function useMentionSuggestions(tools: MentionTool[]): MentionSugg
378
458
  */
379
459
  export declare function useParentAuth(): string | null;
380
460
 
461
+ /** Hook to access thread list state and actions. */
462
+ export declare function useThreadList(): ThreadListState & ThreadListActions;
463
+
381
464
  export declare type ViewMode = 'tabs' | 'tiled';
382
465
 
383
466
  export declare const WebSearchToolUI: ToolCallMessagePartComponent;