@athenaintel/react 0.6.6 → 0.7.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.cjs +716 -131
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.ts +127 -0
- package/dist/index.js +717 -132
- package/dist/index.js.map +1 -1
- package/dist/styles.css +11 -0
- package/package.json +9 -10
package/dist/index.d.ts
CHANGED
|
@@ -263,6 +263,32 @@ export declare function CollapsibleContent({ ...props }: React.ComponentProps<ty
|
|
|
263
263
|
|
|
264
264
|
export declare function CollapsibleTrigger({ ...props }: React.ComponentProps<typeof Collapsible_2.CollapsibleTrigger>): JSX.Element;
|
|
265
265
|
|
|
266
|
+
/**
|
|
267
|
+
* Wraps the composer area with drag-and-drop file upload support.
|
|
268
|
+
* Shows a visual drop indicator when files are dragged over.
|
|
269
|
+
*/
|
|
270
|
+
export declare const ComposerDropZone: FC<ComposerDropZoneProps>;
|
|
271
|
+
|
|
272
|
+
export declare interface ComposerDropZoneProps {
|
|
273
|
+
children: ReactNode;
|
|
274
|
+
className?: string;
|
|
275
|
+
/** Called after files are uploaded via drag-and-drop. */
|
|
276
|
+
onUpload?: (assets: UploadedAsset[]) => void;
|
|
277
|
+
}
|
|
278
|
+
|
|
279
|
+
/**
|
|
280
|
+
* Renders a quote preview pill above the composer when text has been quoted
|
|
281
|
+
* (via Cmd+L, text selection, or PostMessage from an iframe).
|
|
282
|
+
*
|
|
283
|
+
* Shows the quoted text with source attribution and a dismiss button.
|
|
284
|
+
* Clears automatically after message send (handled by ComposerWithQuote).
|
|
285
|
+
*/
|
|
286
|
+
export declare const ComposerQuotePreview: FC<ComposerQuotePreviewProps>;
|
|
287
|
+
|
|
288
|
+
export declare interface ComposerQuotePreviewProps {
|
|
289
|
+
className?: string;
|
|
290
|
+
}
|
|
291
|
+
|
|
266
292
|
export declare function createAssetToolUI(config: {
|
|
267
293
|
icon: React.ElementType;
|
|
268
294
|
assetType: AssetType;
|
|
@@ -284,6 +310,12 @@ export declare const DEFAULT_BACKEND_URL = "https://api.athenaintel.com/api/assi
|
|
|
284
310
|
|
|
285
311
|
export declare const EmailSearchToolUI: ToolCallMessagePartComponent;
|
|
286
312
|
|
|
313
|
+
export declare function ExpandableSection({ label, children, defaultOpen, }: {
|
|
314
|
+
label?: string;
|
|
315
|
+
children: React.ReactNode;
|
|
316
|
+
defaultOpen?: boolean;
|
|
317
|
+
}): JSX.Element;
|
|
318
|
+
|
|
287
319
|
declare interface FetchState {
|
|
288
320
|
isFetching: boolean;
|
|
289
321
|
hasNextPage: boolean;
|
|
@@ -291,6 +323,24 @@ declare interface FetchState {
|
|
|
291
323
|
meta: unknown;
|
|
292
324
|
}
|
|
293
325
|
|
|
326
|
+
/**
|
|
327
|
+
* Paperclip button that opens a file picker and uploads selected files to Athena.
|
|
328
|
+
* After upload, adds files to the attachment context so they appear as pills
|
|
329
|
+
* above the composer and get included when the message is sent.
|
|
330
|
+
*/
|
|
331
|
+
export declare const FileUploadButton: FC<FileUploadButtonProps>;
|
|
332
|
+
|
|
333
|
+
export declare interface FileUploadButtonProps {
|
|
334
|
+
className?: string;
|
|
335
|
+
/** Called after files are uploaded successfully. Receives the created assets. */
|
|
336
|
+
onUpload?: (assets: UploadedAsset[]) => void;
|
|
337
|
+
/** Accepted file types (MIME pattern). Defaults to all files. */
|
|
338
|
+
accept?: string;
|
|
339
|
+
}
|
|
340
|
+
|
|
341
|
+
/** Format a tool name like `create_new_sheet` → "Create New Sheet" */
|
|
342
|
+
export declare function formatToolName(name: string): string;
|
|
343
|
+
|
|
294
344
|
export declare function getAssetInfo(assetId: string): {
|
|
295
345
|
name: string;
|
|
296
346
|
icon: AssetIconType;
|
|
@@ -333,8 +383,29 @@ declare interface MenuItem {
|
|
|
333
383
|
*/
|
|
334
384
|
declare type MenuScope = string;
|
|
335
385
|
|
|
386
|
+
export declare function normalizeResult(result: unknown): Record<string, unknown> | null;
|
|
387
|
+
|
|
336
388
|
export declare const OpenAssetToolUI: ToolCallMessagePartComponent;
|
|
337
389
|
|
|
390
|
+
declare interface QuoteContextValue {
|
|
391
|
+
quote: QuoteData | null;
|
|
392
|
+
setQuote: (quote: QuoteData | null) => void;
|
|
393
|
+
clearQuote: () => void;
|
|
394
|
+
}
|
|
395
|
+
|
|
396
|
+
export declare interface QuoteData {
|
|
397
|
+
/** The selected/quoted text. */
|
|
398
|
+
text: string;
|
|
399
|
+
/** Title of the source (e.g., asset title, document name). */
|
|
400
|
+
sourceTitle?: string;
|
|
401
|
+
/** Asset ID of the source (for attribution). */
|
|
402
|
+
sourceAssetId?: string;
|
|
403
|
+
/** Message ID of the source message (when quoting from chat). */
|
|
404
|
+
sourceMessageId?: string;
|
|
405
|
+
/** Role of the source message ('assistant' | 'user'). */
|
|
406
|
+
sourceRole?: string;
|
|
407
|
+
}
|
|
408
|
+
|
|
338
409
|
export declare const ReadAssetToolUI: ToolCallMessagePartComponent;
|
|
339
410
|
|
|
340
411
|
export declare function resetAssetAutoOpen(): void;
|
|
@@ -538,6 +609,17 @@ export declare const TOOL_UI_REGISTRY: Record<string, ToolCallMessagePartCompone
|
|
|
538
609
|
|
|
539
610
|
export { ToolCallMessagePartComponent }
|
|
540
611
|
|
|
612
|
+
export declare function ToolCard({ icon: Icon, status, title, subtitle, toolName, badge, error, children, }: {
|
|
613
|
+
icon: React.ElementType;
|
|
614
|
+
status: ToolStatus;
|
|
615
|
+
title: string;
|
|
616
|
+
subtitle?: string;
|
|
617
|
+
toolName?: string;
|
|
618
|
+
badge?: string;
|
|
619
|
+
error?: string | null;
|
|
620
|
+
children?: React.ReactNode;
|
|
621
|
+
}): JSX.Element;
|
|
622
|
+
|
|
541
623
|
export declare const ToolFallback: ToolCallMessagePartComponent & {
|
|
542
624
|
Root: typeof ToolFallbackRoot;
|
|
543
625
|
Trigger: typeof ToolFallbackTrigger;
|
|
@@ -660,6 +742,8 @@ export declare const Toolkits: {
|
|
|
660
742
|
readonly PREFERENCES: "preferences_toolkit";
|
|
661
743
|
};
|
|
662
744
|
|
|
745
|
+
export declare type ToolStatus = "running" | "complete" | "incomplete" | "requires-action";
|
|
746
|
+
|
|
663
747
|
export declare function Tooltip({ ...props }: React_2.ComponentProps<typeof Tooltip_2.Root>): JSX.Element;
|
|
664
748
|
|
|
665
749
|
export declare function TooltipContent({ className, sideOffset, children, ...props }: React_2.ComponentProps<typeof Tooltip_2.Content>): JSX.Element;
|
|
@@ -675,8 +759,26 @@ export declare function TooltipProvider({ delayDuration, ...props }: React_2.Com
|
|
|
675
759
|
|
|
676
760
|
export declare function TooltipTrigger({ ...props }: React_2.ComponentProps<typeof Tooltip_2.Trigger>): JSX.Element;
|
|
677
761
|
|
|
762
|
+
export declare function truncate(text: string, max: number): string;
|
|
763
|
+
|
|
678
764
|
export declare function tryParseJson(text: string): Record<string, unknown> | null;
|
|
679
765
|
|
|
766
|
+
export declare interface UploadedAsset {
|
|
767
|
+
id: string;
|
|
768
|
+
title: string;
|
|
769
|
+
fileName: string;
|
|
770
|
+
fileSize: number;
|
|
771
|
+
mediaType: string;
|
|
772
|
+
}
|
|
773
|
+
|
|
774
|
+
export declare interface UploadProgress {
|
|
775
|
+
current: number;
|
|
776
|
+
total: number;
|
|
777
|
+
fileName: string;
|
|
778
|
+
/** 0–1 normalized progress for the current file */
|
|
779
|
+
percent: number;
|
|
780
|
+
}
|
|
781
|
+
|
|
680
782
|
/**
|
|
681
783
|
* Hook to programmatically append text to the composer.
|
|
682
784
|
*
|
|
@@ -731,6 +833,29 @@ export declare function useComposerAttachment(): {
|
|
|
731
833
|
clear: () => void;
|
|
732
834
|
};
|
|
733
835
|
|
|
836
|
+
/**
|
|
837
|
+
* Hook for uploading files to the Athena platform via Agora's `/api/upload/` endpoint.
|
|
838
|
+
* Files become Athena assets (documents, spreadsheets, PDFs, images, etc.).
|
|
839
|
+
*
|
|
840
|
+
* Usage:
|
|
841
|
+
* const { upload, isUploading, progress, error } = useFileUpload();
|
|
842
|
+
* const assets = await upload(fileList);
|
|
843
|
+
*/
|
|
844
|
+
export declare function useFileUpload(): UseFileUploadReturn;
|
|
845
|
+
|
|
846
|
+
export declare interface UseFileUploadReturn {
|
|
847
|
+
/** Upload one or more files to Athena. Returns the created asset(s). */
|
|
848
|
+
upload: (files: File[]) => Promise<UploadedAsset[]>;
|
|
849
|
+
/** Whether an upload is currently in progress. */
|
|
850
|
+
isUploading: boolean;
|
|
851
|
+
/** Upload progress info (null when idle). */
|
|
852
|
+
progress: UploadProgress | null;
|
|
853
|
+
/** Last upload error (null when no error). */
|
|
854
|
+
error: string | null;
|
|
855
|
+
/** Clear the error state. */
|
|
856
|
+
clearError: () => void;
|
|
857
|
+
}
|
|
858
|
+
|
|
734
859
|
export declare function useMentionSuggestions(tools: MentionTool[]): MentionSuggestionsStore;
|
|
735
860
|
|
|
736
861
|
/**
|
|
@@ -748,6 +873,8 @@ export declare function useMentionSuggestions(tools: MentionTool[]): MentionSugg
|
|
|
748
873
|
*/
|
|
749
874
|
export declare function useParentAuth(): string | null;
|
|
750
875
|
|
|
876
|
+
export declare function useQuote(): QuoteContextValue;
|
|
877
|
+
|
|
751
878
|
export declare type ViewMode = 'tabs' | 'tiled';
|
|
752
879
|
|
|
753
880
|
export declare const WebSearchToolUI: ToolCallMessagePartComponent;
|