@athenaintel/react 0.13.0 → 0.15.0
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/chat/ComposerEditorContext.d.ts +6 -0
- package/dist/chat-ui/auth/sign-in-card.d.ts +57 -0
- package/dist/chat-ui/composer/composer-action.d.ts +12 -0
- package/dist/chat-ui/composer/pending-attachment-uploads.d.ts +5 -0
- package/dist/chat-ui/composer/tiptap-composer.d.ts +35 -0
- package/dist/chat-ui/index.d.ts +34 -0
- package/dist/chat-ui/lib/asset-urls.d.ts +6 -0
- package/dist/chat-ui/mentions/mention-chip.d.ts +38 -0
- package/dist/chat-ui/mentions/mention-extension.d.ts +35 -0
- package/dist/chat-ui/mentions/suggestions/components/get-scope-name.d.ts +15 -0
- package/dist/chat-ui/mentions/suggestions/components/mention-icon.d.ts +10 -0
- package/dist/chat-ui/mentions/suggestions/components/mention-suggestion-list.d.ts +22 -0
- package/dist/chat-ui/mentions/suggestions/components/mention-suggestion-popup.d.ts +9 -0
- package/dist/chat-ui/mentions/suggestions/components/menu-breadcrumbs.d.ts +10 -0
- package/dist/chat-ui/mentions/suggestions/components/menu-item.d.ts +12 -0
- package/dist/chat-ui/mentions/suggestions/components/menu-list.d.ts +13 -0
- package/dist/chat-ui/mentions/suggestions/components/menu-skeleton.d.ts +4 -0
- package/dist/chat-ui/mentions/suggestions/components/menu-summary.d.ts +13 -0
- package/dist/chat-ui/mentions/suggestions/components/use-keyboard-navigation.d.ts +19 -0
- package/dist/chat-ui/mentions/suggestions/components/use-menu-navigation.d.ts +64 -0
- package/dist/chat-ui/mentions/suggestions/components/utils.d.ts +8 -0
- package/dist/chat-ui/mentions/suggestions/data/api-client.d.ts +41 -0
- package/dist/chat-ui/mentions/suggestions/data/item-cache.d.ts +76 -0
- package/dist/chat-ui/mentions/suggestions/data/orchestrator.d.ts +29 -0
- package/dist/chat-ui/mentions/suggestions/data/scope-registry.d.ts +105 -0
- package/dist/chat-ui/mentions/suggestions/data/sources/asset-type-icons.d.ts +25 -0
- package/dist/chat-ui/mentions/suggestions/data/sources/index.d.ts +59 -0
- package/dist/chat-ui/mentions/suggestions/data/types.d.ts +156 -0
- package/dist/chat-ui/mentions/suggestions/data/use-mention-suggestions.d.ts +37 -0
- package/dist/chat-ui/mentions/suggestions/data/use-menu-items.d.ts +34 -0
- package/dist/chat-ui/mentions/suggestions/data/utils/filter-items.d.ts +13 -0
- package/dist/chat-ui/mentions/suggestions/data/utils/match-query.d.ts +5 -0
- package/dist/chat-ui/mentions/suggestions/data/utils/score-match.d.ts +5 -0
- package/dist/chat-ui/mentions/suggestions/mention-suggestions.extension.d.ts +25 -0
- package/dist/chat-ui/mentions/suggestions/shims.d.ts +19 -0
- package/dist/chat-ui/messages/message-components.d.ts +58 -0
- package/dist/chat-ui/messages/running-indicator.d.ts +10 -0
- package/dist/chat-ui/thread/chat-composer-dock.d.ts +34 -0
- package/dist/chat-ui/thread/chat-thread-shell.d.ts +97 -0
- package/dist/chat-ui/thread/composer-send-or-stop.d.ts +67 -0
- package/dist/chat-ui.cjs +2084 -0
- package/dist/chat-ui.cjs.map +1 -0
- package/dist/chat-ui.js +2085 -0
- package/dist/chat-ui.js.map +1 -0
- package/dist/composer-send-or-stop-C5AVmcwO.js +32733 -0
- package/dist/composer-send-or-stop-C5AVmcwO.js.map +1 -0
- package/dist/composer-send-or-stop-RPudYkWR.cjs +32748 -0
- package/dist/composer-send-or-stop-RPudYkWR.cjs.map +1 -0
- package/dist/index.cjs +8968 -36580
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +8485 -36097
- package/dist/index.js.map +1 -1
- package/dist/mentions/mention-suggestion-list.d.ts +1 -1
- package/dist/mentions/use-mention-suggestions.d.ts +3 -2
- package/dist/styles.css +1 -1
- package/dist/threads/api.d.ts +1 -0
- package/dist/threads/conversation-list-fetcher.d.ts +40 -0
- package/package.json +17 -5
- package/src/chat-ui/styles/theme.css +30 -0
- package/src/chat-ui/tailwind-preset.js +57 -0
- package/dist/mentions/scope-registry.d.ts +0 -21
- package/dist/mentions/types.d.ts +0 -39
|
@@ -0,0 +1,97 @@
|
|
|
1
|
+
import type { FC, ReactNode } from "react";
|
|
2
|
+
export interface ChatThreadMessageComponents {
|
|
3
|
+
UserMessage: FC;
|
|
4
|
+
AssistantMessage: FC;
|
|
5
|
+
}
|
|
6
|
+
export interface ChatThreadShellProps {
|
|
7
|
+
/**
|
|
8
|
+
* Rendered as the first child of the panel — for absolutely-positioned
|
|
9
|
+
* scrims that must cover the whole panel (AthenaChat's thread-loading
|
|
10
|
+
* overlay). The shell does not force a positioning context; hosts include
|
|
11
|
+
* `relative` in `panelClassName` when the scrim anchors to the panel.
|
|
12
|
+
*/
|
|
13
|
+
overlay?: ReactNode;
|
|
14
|
+
/**
|
|
15
|
+
* Rendered above the viewport, inside the panel: header rows, slide-over
|
|
16
|
+
* panels, and anything else the host docks at the top.
|
|
17
|
+
*/
|
|
18
|
+
header?: ReactNode;
|
|
19
|
+
/** Status/approval banners rendered between the header and the viewport. */
|
|
20
|
+
banners?: ReactNode;
|
|
21
|
+
/**
|
|
22
|
+
* Nodes rendered inside the scroll viewport before the message column —
|
|
23
|
+
* absolutely/sticky-positioned overlays (thread-switch skeletons,
|
|
24
|
+
* scroll-to-top controls) and invisible observers (read receipts).
|
|
25
|
+
*/
|
|
26
|
+
viewportOverlay?: ReactNode;
|
|
27
|
+
/** Empty-thread state, rendered via ThreadPrimitive.Empty when provided. */
|
|
28
|
+
welcome?: ReactNode;
|
|
29
|
+
/** Message renderers for ThreadPrimitive.Messages. */
|
|
30
|
+
components: ChatThreadMessageComponents;
|
|
31
|
+
/**
|
|
32
|
+
* Wraps the messages element — for hosts that provide message-scoped
|
|
33
|
+
* context (e.g. activity-grouping providers). Must render its argument.
|
|
34
|
+
*/
|
|
35
|
+
renderMessages?: (messages: ReactNode) => ReactNode;
|
|
36
|
+
/**
|
|
37
|
+
* Rendered between the viewport and the composer: connection banners,
|
|
38
|
+
* queued-message trays.
|
|
39
|
+
*/
|
|
40
|
+
belowViewport?: ReactNode;
|
|
41
|
+
/** The composer dock (or a read-only notice replacing it). */
|
|
42
|
+
composer?: ReactNode;
|
|
43
|
+
/**
|
|
44
|
+
* Replaces the docked-panel card chrome — for hosts that render a
|
|
45
|
+
* full-page column (AthenaChat's `aui-*` surface) instead of the
|
|
46
|
+
* side-panel/task-pane card.
|
|
47
|
+
*/
|
|
48
|
+
panelClassName?: string;
|
|
49
|
+
/**
|
|
50
|
+
* Value of the `--thread-max-width` variable read by width-capped
|
|
51
|
+
* message/welcome/footer columns. Panels fill their width (the default,
|
|
52
|
+
* "100%"); full-page hosts cap the column (AthenaChat defaults to 44rem).
|
|
53
|
+
*/
|
|
54
|
+
maxWidth?: string;
|
|
55
|
+
/**
|
|
56
|
+
* Anchors the latest turn to the top of the viewport instead of pinning
|
|
57
|
+
* scroll to the bottom (AthenaChat). Omitted = the primitive's default.
|
|
58
|
+
*/
|
|
59
|
+
turnAnchor?: "top" | "bottom";
|
|
60
|
+
/** Replaces the scroll-viewport chrome (padding, overflow tuning). */
|
|
61
|
+
viewportClassName?: string;
|
|
62
|
+
/**
|
|
63
|
+
* Replaces the message-column chrome. Hosts whose welcome screen centers
|
|
64
|
+
* vertically make this a flex column so the welcome node can grow.
|
|
65
|
+
*/
|
|
66
|
+
contentClassName?: string;
|
|
67
|
+
/**
|
|
68
|
+
* Thread-level "Thinking..." indicator rendered after the messages. Hosts
|
|
69
|
+
* whose message components render their own per-message indicators pass
|
|
70
|
+
* null so the two never double up.
|
|
71
|
+
*/
|
|
72
|
+
runningIndicator?: ReactNode;
|
|
73
|
+
/**
|
|
74
|
+
* Replaces the default centered scroll-to-bottom pill inside the sticky
|
|
75
|
+
* viewport footer (AthenaChat floats a circular button above its composer).
|
|
76
|
+
*/
|
|
77
|
+
scrollToBottom?: ReactNode;
|
|
78
|
+
/**
|
|
79
|
+
* Content docked inside the sticky viewport footer, after the
|
|
80
|
+
* scroll-to-bottom control — for hosts whose banners + composer float over
|
|
81
|
+
* the scrolling messages (AthenaChat) instead of sitting below the
|
|
82
|
+
* viewport via `belowViewport`/`composer`.
|
|
83
|
+
*/
|
|
84
|
+
viewportFooter?: ReactNode;
|
|
85
|
+
/** Replaces the sticky viewport-footer chrome. */
|
|
86
|
+
viewportFooterClassName?: string;
|
|
87
|
+
}
|
|
88
|
+
/**
|
|
89
|
+
* The shared thread layout: panel chrome, scroll viewport with welcome +
|
|
90
|
+
* messages + running indicator, the sticky scroll-to-bottom control, and the
|
|
91
|
+
* host-supplied composer dock.
|
|
92
|
+
*
|
|
93
|
+
* Hosts express their genuine divergences through the slots above; the
|
|
94
|
+
* layout, scroll behaviour, and empty/running states stay identical across
|
|
95
|
+
* surfaces so fixes land once.
|
|
96
|
+
*/
|
|
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;
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
import type { FC, RefObject } from "react";
|
|
2
|
+
import { type ComposerAction } from "../composer/composer-action";
|
|
3
|
+
import { type ComposerSendButtonProps, type ComposerStopButtonProps } from "../messages/message-components";
|
|
4
|
+
/**
|
|
5
|
+
* The slice of a composer handle this control needs: something whose draft
|
|
6
|
+
* can be submitted. `TiptapComposerHandle` satisfies it; hosts with their own
|
|
7
|
+
* editor plumbing (the SDK's AthenaChat) expose a compatible handle.
|
|
8
|
+
*/
|
|
9
|
+
export interface ComposerSubmitHandle {
|
|
10
|
+
submit: () => void | Promise<void>;
|
|
11
|
+
}
|
|
12
|
+
export interface ComposerStopControls {
|
|
13
|
+
/**
|
|
14
|
+
* Cancels the active run via the runtime. Returns false when cancellation
|
|
15
|
+
* threw (e.g. the run already settled), so hosts can report whether their
|
|
16
|
+
* own teardown still needs to stop backend work.
|
|
17
|
+
*/
|
|
18
|
+
cancelRun: () => boolean;
|
|
19
|
+
}
|
|
20
|
+
/**
|
|
21
|
+
* Control renderers, for hosts with their own published theming contract
|
|
22
|
+
* (AthenaChat's `aui-*` class system). Defaults render the shared buttons.
|
|
23
|
+
*/
|
|
24
|
+
export interface ComposerSendOrStopComponents {
|
|
25
|
+
SendButton?: FC<ComposerSendButtonProps>;
|
|
26
|
+
StopButton?: FC<ComposerStopButtonProps>;
|
|
27
|
+
}
|
|
28
|
+
export interface ComposerSendOrStopProps {
|
|
29
|
+
composerRef: RefObject<ComposerSubmitHandle | null>;
|
|
30
|
+
hasDraft: boolean;
|
|
31
|
+
/**
|
|
32
|
+
* Whether a draft may queue behind an active run (server-owned queue).
|
|
33
|
+
* Hosts on transports without a queue pass false so an active run always
|
|
34
|
+
* resolves to stop. Defaults to true.
|
|
35
|
+
*/
|
|
36
|
+
canQueue?: boolean;
|
|
37
|
+
/** Disables both send and stop (e.g. while a conversation restores). */
|
|
38
|
+
disabled?: boolean;
|
|
39
|
+
/**
|
|
40
|
+
* Blocks sending (not stopping) with this reason as the tooltip — e.g. a
|
|
41
|
+
* broken host tunnel that would make tool calls silently fail.
|
|
42
|
+
*/
|
|
43
|
+
sendBlockedReason?: string | null;
|
|
44
|
+
/** Tooltip for the send/queue control while `disabled`. */
|
|
45
|
+
sendDisabledTitle?: string;
|
|
46
|
+
/** Tooltip for the stop control while `disabled`. */
|
|
47
|
+
stopDisabledTitle?: string;
|
|
48
|
+
/**
|
|
49
|
+
* Host work to run before the draft submits (per-turn bookkeeping).
|
|
50
|
+
* `action` distinguishes a fresh send from queueing into an active run.
|
|
51
|
+
*/
|
|
52
|
+
onBeforeSend?: (context: {
|
|
53
|
+
action: Extract<ComposerAction, "send" | "queue">;
|
|
54
|
+
}) => void | Promise<void>;
|
|
55
|
+
/**
|
|
56
|
+
* Full custom stop sequence. Hosts that must tear down in-flight host-side
|
|
57
|
+
* work sequence it around `controls.cancelRun()`. Default: cancel the run.
|
|
58
|
+
*/
|
|
59
|
+
onStop?: (controls: ComposerStopControls) => void;
|
|
60
|
+
components?: ComposerSendOrStopComponents;
|
|
61
|
+
}
|
|
62
|
+
/**
|
|
63
|
+
* The shared send/queue/stop control: sends the composer draft, queues it as
|
|
64
|
+
* a follow-up while a run is in flight, or stops the run when there is
|
|
65
|
+
* nothing to queue.
|
|
66
|
+
*/
|
|
67
|
+
export declare const ComposerSendOrStop: FC<ComposerSendOrStopProps>;
|