@athenaintel/react 0.10.18 → 0.10.20
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 +9228 -21484
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.ts +75 -3
- package/dist/index.js +9209 -21466
- 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,11 @@ 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
|
+
}): Promise<ThreadCreateResponse>;
|
|
642
|
+
|
|
602
643
|
export declare const DEFAULT_API_URL: string;
|
|
603
644
|
|
|
604
645
|
export declare const DEFAULT_APP_URL: string;
|
|
@@ -649,6 +690,9 @@ export declare const GetDatabaseTableSchemaToolUI: ToolCallMessagePartComponent;
|
|
|
649
690
|
|
|
650
691
|
export declare function getPostHogInstance<TClient = unknown>(): TClient | null;
|
|
651
692
|
|
|
693
|
+
/** Fetch thread state (messages) from the LangGraph-compatible endpoint. */
|
|
694
|
+
export declare function getThreadState(backendUrl: string, auth: AuthConfig, threadId: string): Promise<ThreadStateResponse>;
|
|
695
|
+
|
|
652
696
|
export declare const isAthenaCitationUrl: ({ href, appUrl, }: {
|
|
653
697
|
href: string;
|
|
654
698
|
appUrl?: string | null;
|
|
@@ -661,6 +705,13 @@ declare interface ItemCache {
|
|
|
661
705
|
|
|
662
706
|
export declare const ListDatabaseTablesToolUI: ToolCallMessagePartComponent;
|
|
663
707
|
|
|
708
|
+
export declare function listThreads(backendUrl: string, auth: AuthConfig, opts?: {
|
|
709
|
+
limit?: number;
|
|
710
|
+
offset?: number;
|
|
711
|
+
exclude_triggered?: boolean;
|
|
712
|
+
app_id?: string;
|
|
713
|
+
}): Promise<ThreadListResponse>;
|
|
714
|
+
|
|
664
715
|
declare interface MentionSuggestionsState {
|
|
665
716
|
registry: ScopeRegistry;
|
|
666
717
|
cache: ItemCache;
|
|
@@ -943,12 +994,26 @@ declare interface ThreadAssetState {
|
|
|
943
994
|
isOpen: boolean;
|
|
944
995
|
}
|
|
945
996
|
|
|
997
|
+
declare interface ThreadCreateResponse {
|
|
998
|
+
thread_id: string;
|
|
999
|
+
}
|
|
1000
|
+
|
|
946
1001
|
export declare function ThreadList({ className }: ThreadListProps): JSX.Element;
|
|
947
1002
|
|
|
948
1003
|
export declare interface ThreadListProps {
|
|
949
1004
|
className?: string;
|
|
950
1005
|
}
|
|
951
1006
|
|
|
1007
|
+
declare interface ThreadListResponse {
|
|
1008
|
+
threads: ThreadSummary[];
|
|
1009
|
+
}
|
|
1010
|
+
|
|
1011
|
+
declare interface ThreadStateResponse {
|
|
1012
|
+
thread_id: string;
|
|
1013
|
+
messages: unknown[];
|
|
1014
|
+
status?: string;
|
|
1015
|
+
}
|
|
1016
|
+
|
|
952
1017
|
/**
|
|
953
1018
|
* Athena thread API client.
|
|
954
1019
|
* Calls existing REST endpoints for thread CRUD.
|
|
@@ -1048,8 +1113,6 @@ export declare const Toolkits: {
|
|
|
1048
1113
|
readonly WEB_SEARCH: "web_search_browse_toolkit";
|
|
1049
1114
|
/** SQL query execution. */
|
|
1050
1115
|
readonly SQL: "sql_toolkit";
|
|
1051
|
-
/** Athena Code development environment. */
|
|
1052
|
-
readonly ATHENA_CODE: "athena_code_toolkit";
|
|
1053
1116
|
/** Document comments and collaboration. */
|
|
1054
1117
|
readonly COMMENTS: "comments_toolkit";
|
|
1055
1118
|
/** Visual canvas creation. */
|
|
@@ -1214,6 +1277,15 @@ export declare const useAthenaLinkClickHandler: () => AthenaLinkClickHandler;
|
|
|
1214
1277
|
|
|
1215
1278
|
export declare const useAthenaRuntime: (config: AthenaRuntimeConfig) => AssistantRuntime;
|
|
1216
1279
|
|
|
1280
|
+
/** Read the current thread's remote ID (set by the adapter's unstable_Provider). */
|
|
1281
|
+
export declare function useAthenaThreadId(): string | undefined;
|
|
1282
|
+
|
|
1283
|
+
/**
|
|
1284
|
+
* Hook that returns a RemoteThreadListAdapter for the Athena platform.
|
|
1285
|
+
* Integrates with our Agora REST API for thread CRUD.
|
|
1286
|
+
*/
|
|
1287
|
+
export declare function useAthenaThreadListAdapter(config: AthenaThreadListAdapterConfig): unstable_RemoteThreadListAdapter;
|
|
1288
|
+
|
|
1217
1289
|
export declare function useAthenaThreadManager(): AthenaThreadManagerState | null;
|
|
1218
1290
|
|
|
1219
1291
|
/**
|