@athenaintel/react 0.15.0 → 0.15.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.
Files changed (32) hide show
  1. package/dist/chat/super-grouping/toolkit-map.d.ts +8 -3
  2. package/dist/chat-ui/composer/tiptap-composer.d.ts +7 -0
  3. package/dist/chat-ui/header/chat-header.d.ts +19 -0
  4. package/dist/chat-ui/header/conversation-history-panel.d.ts +27 -0
  5. package/dist/chat-ui/index.d.ts +4 -0
  6. package/dist/chat-ui/messages/message-actions-config.d.ts +12 -0
  7. package/dist/chat-ui/messages/user-edit-composer.d.ts +8 -0
  8. package/dist/chat-ui/thread/chat-thread-shell.d.ts +13 -1
  9. package/dist/chat-ui.cjs +504 -144
  10. package/dist/chat-ui.cjs.map +1 -1
  11. package/dist/chat-ui.js +398 -38
  12. package/dist/chat-ui.js.map +1 -1
  13. package/dist/index.cjs +1182 -4284
  14. package/dist/index.cjs.map +1 -1
  15. package/dist/index.d.ts +2 -0
  16. package/dist/index.js +750 -3831
  17. package/dist/index.js.map +1 -1
  18. package/dist/provider/AthenaProvider.d.ts +4 -1
  19. package/dist/runtime/statewire-run-config.d.ts +0 -2
  20. package/dist/runtime/useAthenaStatewireRuntime.d.ts +3 -1
  21. package/dist/styles.css +1 -1
  22. package/dist/threads/api.d.ts +7 -0
  23. package/dist/threads/conversation-list-fetcher.d.ts +5 -1
  24. package/dist/threads/use-rest-conversation-history.d.ts +43 -0
  25. package/dist/threads/use-statewire-conversation-history.d.ts +71 -0
  26. package/dist/{composer-send-or-stop-RPudYkWR.cjs → use-rest-conversation-history-CBPqoHoe.cjs} +4327 -271
  27. package/dist/use-rest-conversation-history-CBPqoHoe.cjs.map +1 -0
  28. package/dist/{composer-send-or-stop-C5AVmcwO.js → use-rest-conversation-history-DYvfgoBF.js} +4459 -424
  29. package/dist/use-rest-conversation-history-DYvfgoBF.js.map +1 -0
  30. package/package.json +1 -1
  31. package/dist/composer-send-or-stop-C5AVmcwO.js.map +0 -1
  32. package/dist/composer-send-or-stop-RPudYkWR.cjs.map +0 -1
@@ -1,9 +1,14 @@
1
+ export type ToolGroupKeyOptions = {
2
+ /** Display name of the surrounding group, when one is already open. */
3
+ preferredGroupKey?: string;
4
+ };
1
5
  /**
2
6
  * Default `getToolGroupKey` implementation used by the SDK's tool grouping.
3
7
  * Returns the toolkit display key for a tool name, or `undefined` if the tool
4
- * is ungrouped or unknown.
8
+ * is ungrouped or unknown. Context-only tools inherit the surrounding group
9
+ * and are otherwise ungrouped.
5
10
  *
6
11
  * Override per-app by passing `getToolGroupKey` to `<AthenaChat>`.
7
12
  */
8
- export declare const defaultGetToolGroupKey: (toolName: string) => string | undefined;
9
- export type GetToolGroupKey = (toolName: string) => string | undefined;
13
+ export declare const defaultGetToolGroupKey: (toolName: string, options?: ToolGroupKeyOptions) => string | undefined;
14
+ export type GetToolGroupKey = (toolName: string, options?: ToolGroupKeyOptions) => string | undefined;
@@ -31,5 +31,12 @@ export interface TiptapComposerProps {
31
31
  webpages?: readonly WebpageMention[];
32
32
  rootCategories?: readonly MentionRootCategory[];
33
33
  onDraftStateChange?: (hasDraft: boolean) => void;
34
+ /**
35
+ * Optional submit interception: called with the serialized draft before the
36
+ * composer-runtime send. Return `true` when the host consumed the draft
37
+ * through another lane (e.g. a live voice session) — the editor clears and
38
+ * the normal send is skipped. Return `false` to fall through unchanged.
39
+ */
40
+ interceptSubmit?: (text: string) => boolean | Promise<boolean>;
34
41
  }
35
42
  export declare const TiptapComposer: import("react").ForwardRefExoticComponent<TiptapComposerProps & import("react").RefAttributes<TiptapComposerHandle>>;
@@ -0,0 +1,19 @@
1
+ import type { ReactNode } from 'react';
2
+ export declare function ChatHeaderRoot({ children, className, }: {
3
+ children: ReactNode;
4
+ className?: string;
5
+ }): import("react/jsx-runtime").JSX.Element;
6
+ export declare function ChatHeaderIdentity({ children, className, }: {
7
+ children: ReactNode;
8
+ className?: string;
9
+ }): import("react/jsx-runtime").JSX.Element;
10
+ export declare function ChatHeaderActions({ children, className, }: {
11
+ children: ReactNode;
12
+ className?: string;
13
+ }): import("react/jsx-runtime").JSX.Element;
14
+ /** Composition API keeps each host's exact action order visible at call sites. */
15
+ export declare const ChatHeader: {
16
+ Root: typeof ChatHeaderRoot;
17
+ Identity: typeof ChatHeaderIdentity;
18
+ Actions: typeof ChatHeaderActions;
19
+ };
@@ -0,0 +1,27 @@
1
+ import type { ConversationSummary } from "@athenaintel/agent-runtime";
2
+ export type ConversationActivityFilter = "all" | "chat" | "automated";
3
+ export type ConversationTimeGroup = "Today" | "Yesterday" | "This Week" | "This Month" | "Older";
4
+ /** Mirrors Agora's persisted background-run classification for list metadata. */
5
+ export declare function isAutomatedConversation(conversation: Pick<ConversationSummary, "sourceChannel" | "triggerType">): boolean;
6
+ export declare function conversationTimeGroup(value: string, now?: Date): ConversationTimeGroup;
7
+ export interface ConversationHistoryPanelProps {
8
+ conversations: readonly ConversationSummary[];
9
+ activeThreadId: string;
10
+ search: string;
11
+ onSearchChange: (search: string) => void;
12
+ activityFilter: ConversationActivityFilter;
13
+ onActivityFilterChange: (filter: ConversationActivityFilter) => void;
14
+ originFilter: string;
15
+ onOriginFilterChange: (origin: string) => void;
16
+ onSelect: (threadId: string) => void;
17
+ onNewChat: () => void;
18
+ onRefresh: () => void;
19
+ onArchive: (threadId: string) => void;
20
+ onSetReadState: (threadId: string, isUnread: boolean) => void;
21
+ isLoading?: boolean;
22
+ isRefreshing?: boolean;
23
+ hasNextPage?: boolean;
24
+ isFetchingNextPage?: boolean;
25
+ onLoadMore?: () => void;
26
+ }
27
+ export declare function ConversationHistoryPanel({ conversations, activeThreadId, search, onSearchChange, activityFilter, onActivityFilterChange, originFilter, onOriginFilterChange, onSelect, onNewChat, onRefresh, onArchive, onSetReadState, isLoading, isRefreshing, hasNextPage, isFetchingNextPage, onLoadMore, }: ConversationHistoryPanelProps): import("react/jsx-runtime").JSX.Element;
@@ -13,6 +13,8 @@ export { ChatComposerDock } from "./thread/chat-composer-dock";
13
13
  export type { ChatComposerDockProps } from "./thread/chat-composer-dock";
14
14
  export { ComposerSendOrStop } from "./thread/composer-send-or-stop";
15
15
  export type { ComposerSendOrStopComponents, ComposerSendOrStopProps, ComposerStopControls, ComposerSubmitHandle, } from "./thread/composer-send-or-stop";
16
+ export { ChatHeader, ChatHeaderActions, ChatHeaderIdentity, ChatHeaderRoot, } from './header/chat-header';
17
+ export { ConversationHistoryPanel, type ConversationActivityFilter, type ConversationHistoryPanelProps, } from './header/conversation-history-panel';
16
18
  export { TiptapComposer, plainTextToTiptapContent, type TiptapComposerHandle, type TiptapComposerProps, } from "./composer/tiptap-composer";
17
19
  export { PendingAttachmentUploads } from "./composer/pending-attachment-uploads";
18
20
  export { resolveComposerAction, type ComposerAction, } from "./composer/composer-action";
@@ -30,5 +32,7 @@ export { assetTypeToIcon, assetTypeToThumb, configureAssetIconBasePath, } from "
30
32
  export { MentionMenuSection, type MenuItem, type MenuScope, type WebpageMention, type WebpageMentionScope, } from "./mentions/suggestions/data/types";
31
33
  export { createOlympusAssetUrl } from "./lib/asset-urls";
32
34
  export { COMPOSER_DOCK_CLASS, COMPOSER_EDITOR_ROW_CLASS, COMPOSER_SURFACE_CLASS, COMPOSER_TOOLBAR_CLASS, BranchPicker, ComposerSendButton, ComposerStopButton, type ComposerSendButtonProps, type ComposerStopButtonProps, IconButton, MarkdownText, SmallIconButton, THREAD_HEADER_ACTIONS_CLASS, THREAD_HEADER_CLASS, THREAD_HEADER_ICON_CLASS, THREAD_HEADER_PILL_CLASS, THREAD_PANEL_CLASS, THREAD_SCROLL_TO_BOTTOM_CLASS, UserMessage, createAssistantMessage, type CreateAssistantMessageOptions, } from "./messages/message-components";
35
+ export { UserEditComposer } from "./messages/user-edit-composer";
36
+ export { MessageActionsReadOnlyProvider, useMessageActionsReadOnly, } from "./messages/message-actions-config";
33
37
  export { TextShimmerLoader, ThreadRunningIndicator, } from "./messages/running-indicator";
34
38
  export { SignInCard, SignInConsent, SignInFallbackSection, SignInSecondaryButton, SignInSelect, SignInTextField, } from "./auth/sign-in-card";
@@ -0,0 +1,12 @@
1
+ import type { FC, PropsWithChildren } from "react";
2
+ /**
3
+ * Marks the surrounding transcript read-only: the mutating message actions
4
+ * (Edit, Regenerate) hide while Copy stays available. Hosts set this for
5
+ * conversations whose server rejects dispatch — e.g. the Chrome extension's
6
+ * legacy pre-cutover threads, where the runtime's static capability flags
7
+ * cannot know a given thread is fenced.
8
+ */
9
+ export declare const MessageActionsReadOnlyProvider: FC<PropsWithChildren<{
10
+ readOnly: boolean;
11
+ }>>;
12
+ export declare function useMessageActionsReadOnly(): boolean;
@@ -0,0 +1,8 @@
1
+ import type { FC } from "react";
2
+ /**
3
+ * Rendered in place of a user message while it is being edited (entered via
4
+ * the action bar's Edit control, which seeds this composer with the message
5
+ * text). Sending submits the message-scoped composer, which the Statewire
6
+ * runtime maps to a `run/edit` rewind; Escape/Cancel exits edit mode.
7
+ */
8
+ export declare const UserEditComposer: FC;
@@ -2,6 +2,11 @@ import type { FC, ReactNode } from "react";
2
2
  export interface ChatThreadMessageComponents {
3
3
  UserMessage: FC;
4
4
  AssistantMessage: FC;
5
+ /**
6
+ * Rendered in place of a user message while it is being edited (the action
7
+ * bar's Edit control). Defaults to the shared UserEditComposer.
8
+ */
9
+ UserEditComposer?: FC;
5
10
  }
6
11
  export interface ChatThreadShellProps {
7
12
  /**
@@ -84,6 +89,13 @@ export interface ChatThreadShellProps {
84
89
  viewportFooter?: ReactNode;
85
90
  /** Replaces the sticky viewport-footer chrome. */
86
91
  viewportFooterClassName?: string;
92
+ /**
93
+ * Marks the transcript read-only: mutating message actions (Edit,
94
+ * Regenerate) hide while Copy stays available. For threads whose server
95
+ * rejects dispatch (e.g. legacy pre-cutover conversations) — the runtime's
96
+ * static capability flags cannot express a per-thread fence.
97
+ */
98
+ readOnly?: boolean;
87
99
  }
88
100
  /**
89
101
  * The shared thread layout: panel chrome, scroll viewport with welcome +
@@ -94,4 +106,4 @@ export interface ChatThreadShellProps {
94
106
  * layout, scroll behaviour, and empty/running states stay identical across
95
107
  * surfaces so fixes land once.
96
108
  */
97
- export declare function ChatThreadShell({ overlay, header, banners, viewportOverlay, welcome, components, renderMessages, belowViewport, composer, panelClassName, maxWidth, turnAnchor, viewportClassName, contentClassName, runningIndicator, scrollToBottom, viewportFooter, viewportFooterClassName, }: ChatThreadShellProps): import("react/jsx-runtime").JSX.Element;
109
+ export declare function ChatThreadShell({ overlay, header, banners, viewportOverlay, welcome, components, renderMessages, belowViewport, composer, panelClassName, maxWidth, turnAnchor, viewportClassName, contentClassName, runningIndicator, scrollToBottom, viewportFooter, viewportFooterClassName, readOnly, }: ChatThreadShellProps): import("react/jsx-runtime").JSX.Element;