@athenaintel/react 0.10.19 → 0.10.21
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 +9263 -21511
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.ts +76 -3
- package/dist/index.js +9225 -21474
- package/dist/index.js.map +1 -1
- package/package.json +9 -10
package/dist/index.d.ts
CHANGED
|
@@ -3,6 +3,7 @@ import { ClassProp } from 'class-variance-authority/types';
|
|
|
3
3
|
import { ClassValue } from 'clsx';
|
|
4
4
|
import { Collapsible as Collapsible_2 } from 'radix-ui';
|
|
5
5
|
import { ComponentPropsWithRef } from 'react';
|
|
6
|
+
import { Context } from 'react';
|
|
6
7
|
import { EmptyMessagePartComponent } from '@assistant-ui/react';
|
|
7
8
|
import { FC } from 'react';
|
|
8
9
|
import { ForwardRefExoticComponent } from 'react';
|
|
@@ -22,11 +23,14 @@ import { ToolCallMessagePartComponent } from '@assistant-ui/react';
|
|
|
22
23
|
import { ToolCallMessagePartStatus } from '@assistant-ui/react';
|
|
23
24
|
import { Toolkit } from '@assistant-ui/react';
|
|
24
25
|
import { Tooltip as Tooltip_2 } from 'radix-ui';
|
|
26
|
+
import { unstable_RemoteThreadListAdapter } from '@assistant-ui/react';
|
|
25
27
|
import { UseBoundStore } from 'zustand';
|
|
26
28
|
import { VariantProps } from 'class-variance-authority';
|
|
27
29
|
|
|
28
30
|
export declare const AppendDocumentToolUI: ToolCallMessagePartComponent;
|
|
29
31
|
|
|
32
|
+
export declare function archiveThread(backendUrl: string, auth: AuthConfig, threadId: string): Promise<void>;
|
|
33
|
+
|
|
30
34
|
declare type AssetIconType = "doc" | "pdf" | "sheet";
|
|
31
35
|
|
|
32
36
|
export declare const AssetPanel: FC<AssetPanelProps>;
|
|
@@ -254,7 +258,7 @@ export declare interface AthenaOrg {
|
|
|
254
258
|
urlSafeOrgName: string;
|
|
255
259
|
}
|
|
256
260
|
|
|
257
|
-
export declare function AthenaProvider({ children, config, apiKey, token: tokenProp, agent, model, tools, frontendTools, apiUrl, backendUrl, appUrl, environment, workbench, knowledgeBase, systemPrompt, customToolConfigs, threadId: threadIdProp, enableThreadList, theme, linkClicks, citationLinks, posthog: posthogProp, }: AthenaProviderProps): ReactElement<unknown, string | JSXElementConstructor<any>> | null;
|
|
261
|
+
export declare function AthenaProvider({ children, config, apiKey, token: tokenProp, agent, model, tools, frontendTools, apiUrl, backendUrl, appUrl, environment, workbench, knowledgeBase, systemPrompt, customToolConfigs, appId, threadId: threadIdProp, enableThreadList, theme, linkClicks, citationLinks, posthog: posthogProp, }: AthenaProviderProps): ReactElement<unknown, string | JSXElementConstructor<any>> | null;
|
|
258
262
|
|
|
259
263
|
export declare interface AthenaProviderConfig {
|
|
260
264
|
/** API key for standalone authentication when no token is provided. */
|
|
@@ -319,6 +323,10 @@ export declare interface AthenaProviderProps {
|
|
|
319
323
|
* }}>
|
|
320
324
|
*/
|
|
321
325
|
customToolConfigs?: Record<string, unknown>;
|
|
326
|
+
/** Client app identifier for session filtering.
|
|
327
|
+
* Sessions created with this ID can be filtered in the thread list.
|
|
328
|
+
* E.g. "olympus", "athena-app", or a computer asset ID like "asset_<uuid>". */
|
|
329
|
+
appId?: string;
|
|
322
330
|
/** Thread ID override. Auto-generated if not provided. */
|
|
323
331
|
threadId?: string;
|
|
324
332
|
/** Enable thread list management (sidebar thread switching). */
|
|
@@ -379,8 +387,18 @@ export declare interface AthenaRuntimeConfig {
|
|
|
379
387
|
systemPrompt?: string;
|
|
380
388
|
/** Custom tool configurations (e.g. MCP servers). Passed as custom_tool_configs in runConfig. */
|
|
381
389
|
customToolConfigs?: Record<string, unknown>;
|
|
390
|
+
/** Client app identifier for session filtering. Sent as app_id in runConfig.custom. */
|
|
391
|
+
appId?: string;
|
|
382
392
|
/** Thread ID override. Auto-generated if not provided. */
|
|
383
393
|
threadId?: string;
|
|
394
|
+
/** Request channel. Defaults to "web". Use "chrome_extension" for the browser extension. */
|
|
395
|
+
channel?: string;
|
|
396
|
+
/** Device ID for device tunnel routing (chrome extension). */
|
|
397
|
+
deviceId?: string;
|
|
398
|
+
/** Additional fields merged into the request body. */
|
|
399
|
+
extraBody?: Record<string, unknown>;
|
|
400
|
+
/** Additional fields merged into runConfig.custom. */
|
|
401
|
+
extraRunConfig?: Record<string, unknown>;
|
|
384
402
|
}
|
|
385
403
|
|
|
386
404
|
/**
|
|
@@ -495,6 +513,19 @@ export declare interface AthenaTheme {
|
|
|
495
513
|
threadMaxWidth?: string;
|
|
496
514
|
}
|
|
497
515
|
|
|
516
|
+
/**
|
|
517
|
+
* Context for passing the current thread's remoteId from the unstable_Provider
|
|
518
|
+
* down to the runtimeHook, without requiring useAui() in the hook.
|
|
519
|
+
*/
|
|
520
|
+
export declare const AthenaThreadIdContext: Context<string | undefined>;
|
|
521
|
+
|
|
522
|
+
declare interface AthenaThreadListAdapterConfig {
|
|
523
|
+
backendUrl: string;
|
|
524
|
+
apiKey?: string;
|
|
525
|
+
token?: string | null;
|
|
526
|
+
appId?: string;
|
|
527
|
+
}
|
|
528
|
+
|
|
498
529
|
/**
|
|
499
530
|
* Public hook for managing thread state and navigation.
|
|
500
531
|
*
|
|
@@ -535,6 +566,11 @@ export declare interface AthenaUserMessageProps {
|
|
|
535
566
|
TextComponent?: TextMessagePartComponent;
|
|
536
567
|
}
|
|
537
568
|
|
|
569
|
+
declare interface AuthConfig {
|
|
570
|
+
apiKey?: string;
|
|
571
|
+
token?: string | null;
|
|
572
|
+
}
|
|
573
|
+
|
|
538
574
|
export declare const BrowseToolUI: ToolCallMessagePartComponent;
|
|
539
575
|
|
|
540
576
|
export declare function Button({ className, variant, size, asChild, ...props }: React_2.ComponentProps<"button"> & VariantProps<typeof buttonVariants> & {
|
|
@@ -599,6 +635,12 @@ export declare const CreatePresentationToolUI: ToolCallMessagePartComponent;
|
|
|
599
635
|
|
|
600
636
|
export declare const CreateSheetToolUI: ToolCallMessagePartComponent;
|
|
601
637
|
|
|
638
|
+
export declare function createThread(backendUrl: string, auth: AuthConfig, opts?: {
|
|
639
|
+
systemPrompt?: string;
|
|
640
|
+
enabledTools?: string[];
|
|
641
|
+
appId?: string;
|
|
642
|
+
}): Promise<ThreadCreateResponse>;
|
|
643
|
+
|
|
602
644
|
export declare const DEFAULT_API_URL: string;
|
|
603
645
|
|
|
604
646
|
export declare const DEFAULT_APP_URL: string;
|
|
@@ -649,6 +691,9 @@ export declare const GetDatabaseTableSchemaToolUI: ToolCallMessagePartComponent;
|
|
|
649
691
|
|
|
650
692
|
export declare function getPostHogInstance<TClient = unknown>(): TClient | null;
|
|
651
693
|
|
|
694
|
+
/** Fetch thread state (messages) from the LangGraph-compatible endpoint. */
|
|
695
|
+
export declare function getThreadState(backendUrl: string, auth: AuthConfig, threadId: string): Promise<ThreadStateResponse>;
|
|
696
|
+
|
|
652
697
|
export declare const isAthenaCitationUrl: ({ href, appUrl, }: {
|
|
653
698
|
href: string;
|
|
654
699
|
appUrl?: string | null;
|
|
@@ -661,6 +706,13 @@ declare interface ItemCache {
|
|
|
661
706
|
|
|
662
707
|
export declare const ListDatabaseTablesToolUI: ToolCallMessagePartComponent;
|
|
663
708
|
|
|
709
|
+
export declare function listThreads(backendUrl: string, auth: AuthConfig, opts?: {
|
|
710
|
+
limit?: number;
|
|
711
|
+
offset?: number;
|
|
712
|
+
exclude_triggered?: boolean;
|
|
713
|
+
app_id?: string;
|
|
714
|
+
}): Promise<ThreadListResponse>;
|
|
715
|
+
|
|
664
716
|
declare interface MentionSuggestionsState {
|
|
665
717
|
registry: ScopeRegistry;
|
|
666
718
|
cache: ItemCache;
|
|
@@ -943,12 +995,26 @@ declare interface ThreadAssetState {
|
|
|
943
995
|
isOpen: boolean;
|
|
944
996
|
}
|
|
945
997
|
|
|
998
|
+
declare interface ThreadCreateResponse {
|
|
999
|
+
thread_id: string;
|
|
1000
|
+
}
|
|
1001
|
+
|
|
946
1002
|
export declare function ThreadList({ className }: ThreadListProps): JSX.Element;
|
|
947
1003
|
|
|
948
1004
|
export declare interface ThreadListProps {
|
|
949
1005
|
className?: string;
|
|
950
1006
|
}
|
|
951
1007
|
|
|
1008
|
+
declare interface ThreadListResponse {
|
|
1009
|
+
threads: ThreadSummary[];
|
|
1010
|
+
}
|
|
1011
|
+
|
|
1012
|
+
declare interface ThreadStateResponse {
|
|
1013
|
+
thread_id: string;
|
|
1014
|
+
messages: unknown[];
|
|
1015
|
+
status?: string;
|
|
1016
|
+
}
|
|
1017
|
+
|
|
952
1018
|
/**
|
|
953
1019
|
* Athena thread API client.
|
|
954
1020
|
* Calls existing REST endpoints for thread CRUD.
|
|
@@ -1048,8 +1114,6 @@ export declare const Toolkits: {
|
|
|
1048
1114
|
readonly WEB_SEARCH: "web_search_browse_toolkit";
|
|
1049
1115
|
/** SQL query execution. */
|
|
1050
1116
|
readonly SQL: "sql_toolkit";
|
|
1051
|
-
/** Athena Code development environment. */
|
|
1052
|
-
readonly ATHENA_CODE: "athena_code_toolkit";
|
|
1053
1117
|
/** Document comments and collaboration. */
|
|
1054
1118
|
readonly COMMENTS: "comments_toolkit";
|
|
1055
1119
|
/** Visual canvas creation. */
|
|
@@ -1214,6 +1278,15 @@ export declare const useAthenaLinkClickHandler: () => AthenaLinkClickHandler;
|
|
|
1214
1278
|
|
|
1215
1279
|
export declare const useAthenaRuntime: (config: AthenaRuntimeConfig) => AssistantRuntime;
|
|
1216
1280
|
|
|
1281
|
+
/** Read the current thread's remote ID (set by the adapter's unstable_Provider). */
|
|
1282
|
+
export declare function useAthenaThreadId(): string | undefined;
|
|
1283
|
+
|
|
1284
|
+
/**
|
|
1285
|
+
* Hook that returns a RemoteThreadListAdapter for the Athena platform.
|
|
1286
|
+
* Integrates with our Agora REST API for thread CRUD.
|
|
1287
|
+
*/
|
|
1288
|
+
export declare function useAthenaThreadListAdapter(config: AthenaThreadListAdapterConfig): unstable_RemoteThreadListAdapter;
|
|
1289
|
+
|
|
1217
1290
|
export declare function useAthenaThreadManager(): AthenaThreadManagerState | null;
|
|
1218
1291
|
|
|
1219
1292
|
/**
|