@athenaintel/react 0.26.3 → 0.26.5
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/README.md +18 -0
- package/dist/auth/AthenaAuthProvider.d.ts +1 -1
- package/dist/auth/AthenaSSOProvider.d.ts +1 -1
- package/dist/chat/StatewireApprovalCard.cjs +68 -9
- package/dist/chat/StatewireApprovalCard.cjs.map +1 -1
- package/dist/chat/StatewireApprovalCard.d.ts +0 -31
- package/dist/chat/StatewireApprovalCard.js +70 -11
- package/dist/chat/StatewireApprovalCard.js.map +1 -1
- package/dist/chat/super-grouping/CollapsibleGroup.d.ts +1 -1
- package/dist/chat/super-grouping/SuperGroupingCard.d.ts +2 -2
- package/dist/chat/super-grouping/ToolTimeline.d.ts +1 -1
- package/dist/chat/use-statewire-approval-request.cjs +6 -1
- package/dist/chat/use-statewire-approval-request.cjs.map +1 -1
- package/dist/chat/use-statewire-approval-request.d.ts +20 -0
- package/dist/chat/use-statewire-approval-request.js +6 -1
- package/dist/chat/use-statewire-approval-request.js.map +1 -1
- package/dist/chat-ui/header/chat-header.cjs +4 -4
- package/dist/chat-ui/header/chat-header.cjs.map +1 -1
- package/dist/chat-ui/header/chat-header.d.ts +3 -3
- package/dist/chat-ui/header/chat-header.js +1 -1
- package/dist/chat-ui/header/chat-header.js.map +1 -1
- package/dist/chat-ui/header/conversation-history-panel.d.ts +1 -1
- package/dist/chat-ui/index.cjs +8 -7
- package/dist/chat-ui/index.cjs.map +1 -1
- package/dist/chat-ui/index.d.ts +2 -1
- package/dist/chat-ui/index.js +2 -1
- package/dist/chat-ui/index.js.map +1 -1
- package/dist/chat-ui/markdown-storage.cjs +2 -1
- package/dist/chat-ui/markdown-storage.cjs.map +1 -1
- package/dist/chat-ui/markdown-storage.d.ts +3 -0
- package/dist/chat-ui/markdown-storage.js +2 -1
- package/dist/chat-ui/markdown-storage.js.map +1 -1
- package/dist/chat-ui/mentions/suggestions/components/mention-icon.d.ts +1 -1
- package/dist/chat-ui/mentions/suggestions/components/menu-breadcrumbs.d.ts +1 -1
- package/dist/chat-ui/mentions/suggestions/components/menu-item.d.ts +1 -1
- package/dist/chat-ui/mentions/suggestions/components/menu-list.d.ts +1 -1
- package/dist/chat-ui/mentions/suggestions/components/menu-skeleton.d.ts +1 -1
- package/dist/chat-ui/mentions/suggestions/components/menu-summary.d.ts +1 -1
- package/dist/chat-ui/mentions/suggestions/shims.d.ts +1 -1
- package/dist/chat-ui/messages/message-components.cjs +13 -59
- package/dist/chat-ui/messages/message-components.cjs.map +1 -1
- package/dist/chat-ui/messages/message-components.d.ts +2 -14
- package/dist/chat-ui/messages/message-components.js +2 -47
- package/dist/chat-ui/messages/message-components.js.map +1 -1
- package/dist/chat-ui/messages/runtime-message.cjs +1 -1
- package/dist/chat-ui/messages/runtime-message.cjs.map +1 -1
- package/dist/chat-ui/messages/runtime-message.js +1 -1
- package/dist/chat-ui/messages/runtime-message.js.map +1 -1
- package/dist/chat-ui/messages/thread-chrome.cjs +59 -0
- package/dist/chat-ui/messages/thread-chrome.cjs.map +1 -0
- package/dist/chat-ui/messages/thread-chrome.d.ts +14 -0
- package/dist/chat-ui/messages/thread-chrome.js +59 -0
- package/dist/chat-ui/messages/thread-chrome.js.map +1 -0
- package/dist/chat-ui/messages/wake-marker.cjs +1 -1
- package/dist/chat-ui/messages/wake-marker.cjs.map +1 -1
- package/dist/chat-ui/messages/wake-marker.js +1 -1
- package/dist/chat-ui/messages/wake-marker.js.map +1 -1
- package/dist/chat-ui/rich-text/chat-link.d.ts +2 -2
- package/dist/chat-ui/rich-text/chat-message-body.d.ts +1 -1
- package/dist/chat-ui/rich-text/chat-node-views.d.ts +5 -5
- package/dist/chat-ui/rich-text/chat-text-schema.cjs +9 -1
- package/dist/chat-ui/rich-text/chat-text-schema.cjs.map +1 -1
- package/dist/chat-ui/rich-text/chat-text-schema.d.ts +7 -0
- package/dist/chat-ui/rich-text/chat-text-schema.js +9 -1
- package/dist/chat-ui/rich-text/chat-text-schema.js.map +1 -1
- package/dist/chat-ui/thread/chat-composer-dock.d.ts +1 -1
- package/dist/chat-ui/thread/chat-thread-shell.cjs +4 -3
- package/dist/chat-ui/thread/chat-thread-shell.cjs.map +1 -1
- package/dist/chat-ui/thread/chat-thread-shell.d.ts +1 -1
- package/dist/chat-ui/thread/chat-thread-shell.js +2 -1
- package/dist/chat-ui/thread/chat-thread-shell.js.map +1 -1
- package/dist/composer/AttachmentContext.d.ts +1 -1
- package/dist/composer/QuoteContext.d.ts +1 -1
- package/dist/lib/posthog/before-send.cjs +12 -0
- package/dist/lib/posthog/before-send.cjs.map +1 -1
- package/dist/lib/posthog/before-send.js +12 -0
- package/dist/lib/posthog/before-send.js.map +1 -1
- package/dist/packages/agent-runtime/src/generated/runconfig-contract.cjs +2 -0
- package/dist/packages/agent-runtime/src/generated/runconfig-contract.cjs.map +1 -1
- package/dist/packages/agent-runtime/src/generated/runconfig-contract.js +2 -0
- package/dist/packages/agent-runtime/src/generated/runconfig-contract.js.map +1 -1
- package/dist/packages/agent-runtime/src/messages.cjs +15 -1
- package/dist/packages/agent-runtime/src/messages.cjs.map +1 -1
- package/dist/packages/agent-runtime/src/messages.js +15 -1
- package/dist/packages/agent-runtime/src/messages.js.map +1 -1
- package/dist/packages/react/package.json.cjs +1 -1
- package/dist/packages/react/package.json.js +1 -1
- package/dist/packages/tiptap-markdown-table/src/markdown-table-serializer.cjs +114 -0
- package/dist/packages/tiptap-markdown-table/src/markdown-table-serializer.cjs.map +1 -0
- package/dist/packages/tiptap-markdown-table/src/markdown-table-serializer.js +114 -0
- package/dist/packages/tiptap-markdown-table/src/markdown-table-serializer.js.map +1 -0
- package/dist/provider/AthenaProvider.d.ts +1 -1
- package/dist/provider/PostHogProvider.d.ts +1 -1
- package/dist/threads/SessionList.d.ts +1 -1
- package/dist/threads/ThreadList.d.ts +1 -1
- package/dist/threads/statewire-thread-list.d.ts +1 -1
- package/dist/tools/primitives.d.ts +3 -3
- package/dist/tools/tool-fallback.d.ts +8 -8
- package/dist/ui/button.d.ts +1 -1
- package/dist/ui/collapsible.d.ts +3 -3
- package/dist/ui/popover.d.ts +3 -3
- package/dist/ui/tooltip.d.ts +4 -4
- package/dist/voice/use-athena-voice-session.cjs.map +1 -1
- package/dist/voice/use-athena-voice-session.d.ts +5 -0
- package/dist/voice/use-athena-voice-session.js.map +1 -1
- package/package.json +3 -2
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"markdown-storage.js","sources":["../../src/chat-ui/markdown-storage.ts"],"sourcesContent":["import type { Editor } from \"@tiptap/core\";\nimport type { Node as ProseMirrorNode } from \"@tiptap/pm/model\";\n\n/**\n * What tiptap-markdown keeps in `editor.storage.markdown`. Its own typings only\n * declare `getMarkdown()`, and Tiptap 3 types `editor.storage` as an interface\n * that extensions must augment; the SDK reads the storage through this guard\n * instead of augmenting `@tiptap/core` for every consumer of the package.\n */\nexport interface MarkdownStorage {\n getMarkdown(): string;\n parser: { parse(markdown: string, options?: { inline?: boolean }): string };\n serializer: { serialize(content: ProseMirrorNode): string };\n}\n\nfunction isMarkdownStorage(value: unknown): value is MarkdownStorage {\n if (typeof value !== \"object\" || value === null) return false;\n const parser: unknown = Reflect.get(value, \"parser\");\n return (\n typeof Reflect.get(value, \"getMarkdown\") === \"function\" &&\n typeof parser === \"object\" &&\n parser !== null &&\n typeof Reflect.get(parser, \"parse\") === \"function\"\n );\n}\n\n/** The editor's tiptap-markdown storage; throws when the Markdown extension is not registered. */\nexport function getMarkdownStorage(editor: Editor): MarkdownStorage {\n const storage: unknown = Reflect.get(editor.storage, \"markdown\");\n if (!isMarkdownStorage(storage)) {\n throw new Error(\"tiptap-markdown is not registered on this editor\");\n }\n return storage;\n}\n"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"markdown-storage.js","sources":["../../src/chat-ui/markdown-storage.ts"],"sourcesContent":["import type { Editor } from \"@tiptap/core\";\nimport type { Node as ProseMirrorNode } from \"@tiptap/pm/model\";\n\n/**\n * What tiptap-markdown keeps in `editor.storage.markdown`. Its own typings only\n * declare `getMarkdown()`, and Tiptap 3 types `editor.storage` as an interface\n * that extensions must augment; the SDK reads the storage through this guard\n * instead of augmenting `@tiptap/core` for every consumer of the package.\n */\nexport interface MarkdownStorage {\n options: { html: boolean };\n getMarkdown(): string;\n parser: { parse(markdown: string, options?: { inline?: boolean }): string };\n serializer: { serialize(content: ProseMirrorNode): string };\n}\n\nfunction isMarkdownStorage(value: unknown): value is MarkdownStorage {\n if (typeof value !== \"object\" || value === null) return false;\n const options: unknown = Reflect.get(value, \"options\");\n const parser: unknown = Reflect.get(value, \"parser\");\n return (\n typeof options === \"object\" &&\n options !== null &&\n typeof Reflect.get(options, \"html\") === \"boolean\" &&\n typeof Reflect.get(value, \"getMarkdown\") === \"function\" &&\n typeof parser === \"object\" &&\n parser !== null &&\n typeof Reflect.get(parser, \"parse\") === \"function\"\n );\n}\n\n/** The editor's tiptap-markdown storage; throws when the Markdown extension is not registered. */\nexport function getMarkdownStorage(editor: Editor): MarkdownStorage {\n const storage: unknown = Reflect.get(editor.storage, \"markdown\");\n if (!isMarkdownStorage(storage)) {\n throw new Error(\"tiptap-markdown is not registered on this editor\");\n }\n return storage;\n}\n"],"names":[],"mappings":"AAgBA,SAAS,kBAAkB,OAA0C;AACnE,MAAI,OAAO,UAAU,YAAY,UAAU,KAAM,QAAO;AACxD,QAAM,UAAmB,QAAQ,IAAI,OAAO,SAAS;AACrD,QAAM,SAAkB,QAAQ,IAAI,OAAO,QAAQ;AACnD,SACE,OAAO,YAAY,YACnB,YAAY,QACZ,OAAO,QAAQ,IAAI,SAAS,MAAM,MAAM,aACxC,OAAO,QAAQ,IAAI,OAAO,aAAa,MAAM,cAC7C,OAAO,WAAW,YAClB,WAAW,QACX,OAAO,QAAQ,IAAI,QAAQ,OAAO,MAAM;AAE5C;AAGO,SAAS,mBAAmB,QAAiC;AAClE,QAAM,UAAmB,QAAQ,IAAI,OAAO,SAAS,UAAU;AAC/D,MAAI,CAAC,kBAAkB,OAAO,GAAG;AAC/B,UAAM,IAAI,MAAM,kDAAkD;AAAA,EACpE;AACA,SAAO;AACT;"}
|
|
@@ -10,4 +10,4 @@ export declare function MenuList({ items, selectedIndex, isLoading, hasMore, onS
|
|
|
10
10
|
onSelect: (item: MenuItem) => void;
|
|
11
11
|
onMouseMove: (index: number) => void;
|
|
12
12
|
onLoadMore?: () => void;
|
|
13
|
-
}): import("react
|
|
13
|
+
}): import("react").JSX.Element;
|
|
@@ -10,4 +10,4 @@ export declare function MenuSummary({ scopePath, onNavigate, onBackClick, isFetc
|
|
|
10
10
|
onNavigate: (scopeId: string) => void;
|
|
11
11
|
onBackClick?: () => void;
|
|
12
12
|
isFetching?: boolean;
|
|
13
|
-
}): import("react
|
|
13
|
+
}): import("react").JSX.Element | null;
|
|
@@ -12,53 +12,12 @@ const runtimeMessage = require("./runtime-message.cjs");
|
|
|
12
12
|
const runningIndicator = require("./running-indicator.cjs");
|
|
13
13
|
const voiceDelegationCard = require("./voice-delegation-card.cjs");
|
|
14
14
|
const wakeMarker = require("./wake-marker.cjs");
|
|
15
|
+
const threadChrome = require("./thread-chrome.cjs");
|
|
15
16
|
const streamingMarkdown = require("../../packages/agent-runtime/src/streaming-markdown.cjs");
|
|
16
17
|
const githubWakeEvent = require("../../packages/agent-runtime/src/github-wake-event.cjs");
|
|
17
18
|
const voicePresentation = require("../../packages/agent-runtime/src/voice-presentation.cjs");
|
|
18
19
|
const runtimeMessages = require("../../packages/agent-runtime/src/runtime-messages.cjs");
|
|
19
20
|
const cnfast = require("cnfast");
|
|
20
|
-
function IconButton({
|
|
21
|
-
children,
|
|
22
|
-
tooltip,
|
|
23
|
-
className,
|
|
24
|
-
...props
|
|
25
|
-
}) {
|
|
26
|
-
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
27
|
-
"button",
|
|
28
|
-
{
|
|
29
|
-
type: "button",
|
|
30
|
-
title: tooltip,
|
|
31
|
-
"aria-label": tooltip,
|
|
32
|
-
className: cnfast.cn(
|
|
33
|
-
"inline-flex size-9 items-center justify-center rounded-lg text-muted-foreground transition-colors hover:bg-accent hover:text-foreground",
|
|
34
|
-
className
|
|
35
|
-
),
|
|
36
|
-
...props,
|
|
37
|
-
children
|
|
38
|
-
}
|
|
39
|
-
);
|
|
40
|
-
}
|
|
41
|
-
function SmallIconButton({
|
|
42
|
-
children,
|
|
43
|
-
tooltip,
|
|
44
|
-
className,
|
|
45
|
-
...props
|
|
46
|
-
}) {
|
|
47
|
-
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
48
|
-
"button",
|
|
49
|
-
{
|
|
50
|
-
type: "button",
|
|
51
|
-
title: tooltip,
|
|
52
|
-
"aria-label": tooltip,
|
|
53
|
-
className: cnfast.cn(
|
|
54
|
-
"inline-flex size-6 items-center justify-center rounded text-muted-foreground transition-colors hover:bg-accent hover:text-accent-foreground",
|
|
55
|
-
className
|
|
56
|
-
),
|
|
57
|
-
...props,
|
|
58
|
-
children
|
|
59
|
-
}
|
|
60
|
-
);
|
|
61
|
-
}
|
|
62
21
|
const BranchPicker = () => /* @__PURE__ */ jsxRuntime.jsxs(
|
|
63
22
|
react.BranchPickerPrimitive.Root,
|
|
64
23
|
{
|
|
@@ -67,7 +26,7 @@ const BranchPicker = () => /* @__PURE__ */ jsxRuntime.jsxs(
|
|
|
67
26
|
"data-testid": "chat-branch-picker",
|
|
68
27
|
children: [
|
|
69
28
|
/* @__PURE__ */ jsxRuntime.jsx(react.BranchPickerPrimitive.Previous, { asChild: true, children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
70
|
-
SmallIconButton,
|
|
29
|
+
threadChrome.SmallIconButton,
|
|
71
30
|
{
|
|
72
31
|
tooltip: "Previous branch",
|
|
73
32
|
"data-testid": "chat-branch-previous",
|
|
@@ -79,11 +38,11 @@ const BranchPicker = () => /* @__PURE__ */ jsxRuntime.jsxs(
|
|
|
79
38
|
" / ",
|
|
80
39
|
/* @__PURE__ */ jsxRuntime.jsx(react.BranchPickerPrimitive.Count, {})
|
|
81
40
|
] }),
|
|
82
|
-
/* @__PURE__ */ jsxRuntime.jsx(react.BranchPickerPrimitive.Next, { asChild: true, children: /* @__PURE__ */ jsxRuntime.jsx(SmallIconButton, { tooltip: "Next branch", "data-testid": "chat-branch-next", children: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.ChevronRightIcon, { className: "size-3" }) }) })
|
|
41
|
+
/* @__PURE__ */ jsxRuntime.jsx(react.BranchPickerPrimitive.Next, { asChild: true, children: /* @__PURE__ */ jsxRuntime.jsx(threadChrome.SmallIconButton, { tooltip: "Next branch", "data-testid": "chat-branch-next", children: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.ChevronRightIcon, { className: "size-3" }) }) })
|
|
83
42
|
]
|
|
84
43
|
}
|
|
85
44
|
);
|
|
86
|
-
const CopyActionButton = () => /* @__PURE__ */ jsxRuntime.jsx(react.ActionBarPrimitive.Copy, { asChild: true, children: /* @__PURE__ */ jsxRuntime.jsxs(SmallIconButton, { tooltip: "Copy", children: [
|
|
45
|
+
const CopyActionButton = () => /* @__PURE__ */ jsxRuntime.jsx(react.ActionBarPrimitive.Copy, { asChild: true, children: /* @__PURE__ */ jsxRuntime.jsxs(threadChrome.SmallIconButton, { tooltip: "Copy", children: [
|
|
87
46
|
/* @__PURE__ */ jsxRuntime.jsx(react.AuiIf, { condition: (state) => state.message.isCopied, children: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.CheckIcon, { className: "size-3" }) }),
|
|
88
47
|
/* @__PURE__ */ jsxRuntime.jsx(react.AuiIf, { condition: (state) => !state.message.isCopied, children: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.CopyIcon, { className: "size-3" }) })
|
|
89
48
|
] }) });
|
|
@@ -92,12 +51,12 @@ const EditActionButton = () => {
|
|
|
92
51
|
const isRunning = useAthenaRunLive.useAthenaRunLive();
|
|
93
52
|
const readOnly = messageActionsConfig.useMessageActionsReadOnly();
|
|
94
53
|
if (!allowEdit || isRunning || readOnly) return null;
|
|
95
|
-
return /* @__PURE__ */ jsxRuntime.jsx(react.ActionBarPrimitive.Edit, { asChild: true, children: /* @__PURE__ */ jsxRuntime.jsx(SmallIconButton, { tooltip: "Edit", "data-testid": "chat-message-edit", children: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.PencilIcon, { className: "size-3" }) }) });
|
|
54
|
+
return /* @__PURE__ */ jsxRuntime.jsx(react.ActionBarPrimitive.Edit, { asChild: true, children: /* @__PURE__ */ jsxRuntime.jsx(threadChrome.SmallIconButton, { tooltip: "Edit", "data-testid": "chat-message-edit", children: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.PencilIcon, { className: "size-3" }) }) });
|
|
96
55
|
};
|
|
97
56
|
const RegenerateActionButton = () => {
|
|
98
57
|
const readOnly = messageActionsConfig.useMessageActionsReadOnly();
|
|
99
58
|
if (readOnly) return null;
|
|
100
|
-
return /* @__PURE__ */ jsxRuntime.jsx(react.ActionBarPrimitive.Reload, { asChild: true, children: /* @__PURE__ */ jsxRuntime.jsx(SmallIconButton, { tooltip: "Regenerate", children: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.RefreshCwIcon, { className: "size-3" }) }) });
|
|
59
|
+
return /* @__PURE__ */ jsxRuntime.jsx(react.ActionBarPrimitive.Reload, { asChild: true, children: /* @__PURE__ */ jsxRuntime.jsx(threadChrome.SmallIconButton, { tooltip: "Regenerate", children: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.RefreshCwIcon, { className: "size-3" }) }) });
|
|
101
60
|
};
|
|
102
61
|
const ACTION_BAR_REVEAL_CLASS = "pointer-events-none opacity-0 transition-opacity focus-within:pointer-events-auto focus-within:opacity-100";
|
|
103
62
|
const MarkdownText = () => {
|
|
@@ -238,11 +197,6 @@ function createAssistantMessage({
|
|
|
238
197
|
};
|
|
239
198
|
return AssistantMessage;
|
|
240
199
|
}
|
|
241
|
-
const THREAD_PANEL_CLASS = "m-1 flex min-h-0 flex-1 flex-col overflow-hidden rounded-[18px] border border-dashed border-amber-500 bg-background shadow-[0_1px_10px_rgba(54,45,33,0.08)]";
|
|
242
|
-
const THREAD_HEADER_CLASS = "flex items-center justify-between gap-2 px-3 py-2";
|
|
243
|
-
const THREAD_HEADER_ACTIONS_CLASS = "flex min-w-0 items-center justify-end gap-1.5";
|
|
244
|
-
const THREAD_HEADER_PILL_CLASS = "inline-flex h-7 max-w-[170px] items-center gap-1.5 rounded-md border border-neutral-200 bg-white px-2 text-xs font-medium text-neutral-800 shadow-sm";
|
|
245
|
-
const THREAD_HEADER_ICON_CLASS = "size-[18px]";
|
|
246
200
|
const COMPOSER_DOCK_CLASS = "bg-background px-2.5 pb-2 pt-1.5";
|
|
247
201
|
const COMPOSER_SURFACE_CLASS = "relative flex flex-col gap-1 rounded-xl border border-neutral-200 bg-white shadow-[0_2px_10px_rgba(54,45,33,0.08)]";
|
|
248
202
|
const COMPOSER_EDITOR_ROW_CLASS = "px-2.5 pt-1";
|
|
@@ -299,6 +253,13 @@ const ComposerSendButton = ({
|
|
|
299
253
|
children: action === "queue" ? /* @__PURE__ */ jsxRuntime.jsx(lucideReact.ListPlusIcon, { className: "size-4" }) : /* @__PURE__ */ jsxRuntime.jsx(lucideReact.ArrowUpIcon, { className: "size-4" })
|
|
300
254
|
}
|
|
301
255
|
);
|
|
256
|
+
exports.IconButton = threadChrome.IconButton;
|
|
257
|
+
exports.SmallIconButton = threadChrome.SmallIconButton;
|
|
258
|
+
exports.THREAD_HEADER_ACTIONS_CLASS = threadChrome.THREAD_HEADER_ACTIONS_CLASS;
|
|
259
|
+
exports.THREAD_HEADER_CLASS = threadChrome.THREAD_HEADER_CLASS;
|
|
260
|
+
exports.THREAD_HEADER_ICON_CLASS = threadChrome.THREAD_HEADER_ICON_CLASS;
|
|
261
|
+
exports.THREAD_HEADER_PILL_CLASS = threadChrome.THREAD_HEADER_PILL_CLASS;
|
|
262
|
+
exports.THREAD_PANEL_CLASS = threadChrome.THREAD_PANEL_CLASS;
|
|
302
263
|
exports.ACTION_BAR_REVEAL_CLASS = ACTION_BAR_REVEAL_CLASS;
|
|
303
264
|
exports.BranchPicker = BranchPicker;
|
|
304
265
|
exports.COMPOSER_DOCK_CLASS = COMPOSER_DOCK_CLASS;
|
|
@@ -311,14 +272,7 @@ exports.COMPOSER_SURFACE_CLASS = COMPOSER_SURFACE_CLASS;
|
|
|
311
272
|
exports.COMPOSER_TOOLBAR_CLASS = COMPOSER_TOOLBAR_CLASS;
|
|
312
273
|
exports.ComposerSendButton = ComposerSendButton;
|
|
313
274
|
exports.ComposerStopButton = ComposerStopButton;
|
|
314
|
-
exports.IconButton = IconButton;
|
|
315
275
|
exports.MarkdownText = MarkdownText;
|
|
316
|
-
exports.SmallIconButton = SmallIconButton;
|
|
317
|
-
exports.THREAD_HEADER_ACTIONS_CLASS = THREAD_HEADER_ACTIONS_CLASS;
|
|
318
|
-
exports.THREAD_HEADER_CLASS = THREAD_HEADER_CLASS;
|
|
319
|
-
exports.THREAD_HEADER_ICON_CLASS = THREAD_HEADER_ICON_CLASS;
|
|
320
|
-
exports.THREAD_HEADER_PILL_CLASS = THREAD_HEADER_PILL_CLASS;
|
|
321
|
-
exports.THREAD_PANEL_CLASS = THREAD_PANEL_CLASS;
|
|
322
276
|
exports.THREAD_SCROLL_TO_BOTTOM_CLASS = THREAD_SCROLL_TO_BOTTOM_CLASS;
|
|
323
277
|
exports.UserMessage = UserMessage;
|
|
324
278
|
exports.createAssistantMessage = createAssistantMessage;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"message-components.cjs","sources":["../../../src/chat-ui/messages/message-components.tsx"],"sourcesContent":["import {\n ActionBarPrimitive,\n AuiIf,\n BranchPickerPrimitive,\n MessagePrimitive,\n useAuiState,\n useMessagePartText,\n useSmooth,\n type ToolCallMessagePartComponent,\n} from \"@assistant-ui/react\";\nimport {\n hideUnterminatedMarkdownLink,\n isGithubWakeMessage,\n isVoiceDelegationMessage,\n readRuntimeMessageFromSourceMessages,\n readSoleRuntimeMessageKind,\n} from \"@athenaintel/agent-runtime\";\nimport \"@assistant-ui/react-markdown/styles/dot.css\";\nimport {\n ArrowUpIcon,\n CheckIcon,\n ChevronLeftIcon,\n ChevronRightIcon,\n CopyIcon,\n ListPlusIcon,\n PencilIcon,\n RefreshCwIcon,\n} from \"lucide-react\";\nimport {\n type ButtonHTMLAttributes,\n type FC,\n type ReactNode,\n useMemo,\n} from \"react\";\nimport { useAthenaRunLive } from \"../../chat/use-athena-run-live\";\nimport type { ComposerAction } from \"../composer/composer-action\";\nimport { cn } from \"../../lib/utils\";\nimport { ChatMessageBody } from \"../rich-text/chat-message-body\";\nimport { useMessageActionsReadOnly } from \"./message-actions-config\";\nimport { RuntimeMessageCard } from \"./runtime-message\";\nimport { hasVisibleContent } from \"./running-indicator\";\nimport { VoiceDelegationMessage } from \"./voice-delegation-card\";\nimport { WakeMarkerMessage } from \"./wake-marker\";\n\nexport function IconButton({\n children,\n tooltip,\n className,\n ...props\n}: ButtonHTMLAttributes<HTMLButtonElement> & { tooltip: string }) {\n return (\n <button\n type=\"button\"\n title={tooltip}\n aria-label={tooltip}\n className={cn(\n \"inline-flex size-9 items-center justify-center rounded-lg text-muted-foreground transition-colors hover:bg-accent hover:text-foreground\",\n className,\n )}\n {...props}\n >\n {children}\n </button>\n );\n}\n\nexport function SmallIconButton({\n children,\n tooltip,\n className,\n ...props\n}: ButtonHTMLAttributes<HTMLButtonElement> & { tooltip: string }) {\n return (\n <button\n type=\"button\"\n title={tooltip}\n aria-label={tooltip}\n className={cn(\n \"inline-flex size-6 items-center justify-center rounded text-muted-foreground transition-colors hover:bg-accent hover:text-accent-foreground\",\n className,\n )}\n {...props}\n >\n {children}\n </button>\n );\n}\n\nexport const BranchPicker: FC = () => (\n <BranchPickerPrimitive.Root\n hideWhenSingleBranch\n className=\"inline-flex items-center gap-0.5 text-xs text-muted-foreground\"\n data-testid=\"chat-branch-picker\"\n >\n <BranchPickerPrimitive.Previous asChild>\n <SmallIconButton\n tooltip=\"Previous branch\"\n data-testid=\"chat-branch-previous\"\n >\n <ChevronLeftIcon className=\"size-3\" />\n </SmallIconButton>\n </BranchPickerPrimitive.Previous>\n <span className=\"font-medium\" data-testid=\"chat-branch-count\">\n <BranchPickerPrimitive.Number /> / <BranchPickerPrimitive.Count />\n </span>\n <BranchPickerPrimitive.Next asChild>\n <SmallIconButton tooltip=\"Next branch\" data-testid=\"chat-branch-next\">\n <ChevronRightIcon className=\"size-3\" />\n </SmallIconButton>\n </BranchPickerPrimitive.Next>\n </BranchPickerPrimitive.Root>\n);\n\nconst CopyActionButton: FC = () => (\n <ActionBarPrimitive.Copy asChild>\n <SmallIconButton tooltip=\"Copy\">\n <AuiIf condition={(state) => state.message.isCopied}>\n <CheckIcon className=\"size-3\" />\n </AuiIf>\n <AuiIf condition={(state) => !state.message.isCopied}>\n <CopyIcon className=\"size-3\" />\n </AuiIf>\n </SmallIconButton>\n </ActionBarPrimitive.Copy>\n);\n\n/**\n * The edit primitive does not check the runtime's edit capability itself —\n * clicking it on a runtime without one throws inside onPress, where no error\n * boundary can catch it — so the button must gate on the capability and, to\n * match the rewind semantics of `run/edit`, stay hidden while a run is live.\n * The read-only context covers threads the capability flags cannot: a host's\n * static `edit: true` still applies to fenced legacy conversations.\n */\nconst EditActionButton: FC = () => {\n const allowEdit = useAuiState((s) => s.thread.capabilities.edit);\n const isRunning = useAthenaRunLive();\n const readOnly = useMessageActionsReadOnly();\n if (!allowEdit || isRunning || readOnly) return null;\n return (\n <ActionBarPrimitive.Edit asChild>\n <SmallIconButton tooltip=\"Edit\" data-testid=\"chat-message-edit\">\n <PencilIcon className=\"size-3\" />\n </SmallIconButton>\n </ActionBarPrimitive.Edit>\n );\n};\n\n/** Regenerate dispatches `run/reload`, so it hides on read-only threads too. */\nconst RegenerateActionButton: FC = () => {\n const readOnly = useMessageActionsReadOnly();\n if (readOnly) return null;\n return (\n <ActionBarPrimitive.Reload asChild>\n <SmallIconButton tooltip=\"Regenerate\">\n <RefreshCwIcon className=\"size-3\" />\n </SmallIconButton>\n </ActionBarPrimitive.Reload>\n );\n};\n\n/**\n * Reveal-on-demand treatment for action bars: invisible and click-through\n * until the surrounding named group is hovered or a control inside receives\n * keyboard focus. The `focus-within` escape hatch is what keeps the hidden\n * controls reachable for keyboard users.\n */\nexport const ACTION_BAR_REVEAL_CLASS =\n \"pointer-events-none opacity-0 transition-opacity focus-within:pointer-events-auto focus-within:opacity-100\";\n\n/** Shared chat body; the reveal holds incomplete links until their URL is complete. */\nexport const MarkdownText: FC = () => {\n const revealed = useSmooth(useMessagePartText(), true);\n const isRunning = revealed.status.type === \"running\";\n const text = isRunning ? hideUnterminatedMarkdownLink(revealed.text) : revealed.text;\n return <ChatMessageBody text={text} isRunning={isRunning} />;\n};\n\nconst UserActionBar: FC = () => (\n <ActionBarPrimitive.Root\n autohide=\"never\"\n className={cn(\n \"flex min-h-6 items-center gap-0.5\",\n ACTION_BAR_REVEAL_CLASS,\n \"group-hover/user-message:pointer-events-auto group-hover/user-message:opacity-100\",\n )}\n >\n <CopyActionButton />\n <EditActionButton />\n </ActionBarPrimitive.Root>\n);\n\nexport const UserMessage: FC = () => {\n // A GitHub wake turn is an event, not words the user typed: it renders as\n // the compact wake marker instead of a bubble quoting the injected text.\n const isWake = useAuiState((s) => isGithubWakeMessage(s.message.metadata?.custom));\n // A voice delegation's anchor is the ask the live voice model handed to the\n // thread, not words the user typed: it renders as the shared voice-task\n // card on every host instead of a second user bubble under the spoken turn.\n const isVoiceDelegation = useAuiState((s) =>\n isVoiceDelegationMessage({ messageId: s.message.id, custom: s.message.metadata?.custom }),\n );\n if (isWake) {\n return (\n <MessagePrimitive.Root data-message-role=\"user\" className=\"mb-3\">\n <WakeMarkerMessage />\n </MessagePrimitive.Root>\n );\n }\n if (isVoiceDelegation) {\n return (\n <MessagePrimitive.Root data-message-role=\"user\" className=\"mb-3\">\n <VoiceDelegationMessage />\n </MessagePrimitive.Root>\n );\n }\n return (\n <MessagePrimitive.Root\n data-message-role=\"user\"\n className=\"group/user-message mb-3 flex justify-end\"\n >\n <div className=\"flex min-w-0 max-w-[85%] flex-col items-end gap-1\">\n <div className=\"min-w-0 max-w-full rounded-2xl rounded-br-md bg-muted px-3.5 py-2 text-sm text-foreground\">\n <MessagePrimitive.Content components={{ Text: MarkdownText }} />\n </div>\n <div className=\"flex min-h-6 items-center gap-1\">\n <BranchPicker />\n <UserActionBar />\n </div>\n </div>\n </MessagePrimitive.Root>\n );\n};\n\nexport interface CreateAssistantMessageOptions {\n /** Host-registered card for tools without a dedicated UI. */\n toolFallback: ToolCallMessagePartComponent;\n /** Extra action-bar controls appended after copy/regenerate. */\n extraActions?: ReactNode;\n /**\n * Renders the message body. Hosts that group content into activity\n * timelines supply their own; the default renders markdown and tool cards.\n */\n content?: FC;\n /**\n * Inline affordance rendered inside a runtime-ending card (e.g. a Continue\n * button). Hosts without one leave it unset.\n */\n runtimeMessageAction?: ReactNode;\n}\n\n/**\n * Builds the assistant bubble. Call this once per host (memoized on its\n * inputs) so the returned component identity stays stable across renders.\n */\nexport function createAssistantMessage({\n toolFallback,\n extraActions,\n content: Content,\n runtimeMessageAction,\n}: CreateAssistantMessageOptions): FC {\n const AssistantActionBar: FC = () => {\n // The latest reply keeps its actions visible; older replies reveal them\n // on hover so a long transcript is not a wall of icon rows.\n const isLast = useAuiState((s) => s.message.isLast);\n return (\n <ActionBarPrimitive.Root\n autohide=\"never\"\n className={cn(\n \"mt-1 flex min-h-6 items-center gap-0.5\",\n !isLast && [\n ACTION_BAR_REVEAL_CLASS,\n \"group-hover/assistant-message:pointer-events-auto group-hover/assistant-message:opacity-100\",\n ],\n )}\n >\n <CopyActionButton />\n <RegenerateActionButton />\n {extraActions}\n </ActionBarPrimitive.Root>\n );\n };\n\n // A run-lifecycle marker or handoff summary is a system event, not\n // assistant speech. When it owns the whole row, render the status card in\n // place of the bubble; when it is chunked in with the assistant's own work\n // (or is a handoff whose text IS the closing summary), keep the body and\n // frame it with the card above.\n const RuntimeEnding: FC<{ placement: \"row\" | \"banner\" }> = ({ placement }) => {\n // Select the message (a stable store reference) and derive from it: the\n // reader allocates a fresh object per call, and `useAuiState` compares\n // snapshots with `Object.is`, so selecting the reader's result directly\n // would re-render on every store update and trip React's update-depth\n // guard.\n const message = useAuiState((s) => s.message);\n const runtime = useMemo(() => readRuntimeMessageFromSourceMessages(message), [message]);\n if (!runtime || runtime.silent) return null;\n if (placement === \"row\" && !runtime.isSoleSourceMessage) return null;\n if (placement === \"banner\" && runtime.isSoleSourceMessage && runtime.kind !== \"handoff\") {\n return null;\n }\n return <RuntimeMessageCard message={runtime} action={runtimeMessageAction} />;\n };\n\n const AssistantMessage: FC = () => {\n // An assistant row exists before its first token streams; showing\n // copy/regenerate against nothing looks broken, so wait for content.\n const showActions = useAuiState((state) =>\n hasVisibleContent(state.message.content),\n );\n // Primitive selector: the reader builds a fresh object per call.\n const soleRuntimeKind = useAuiState((s) => readSoleRuntimeMessageKind(s.message));\n const soleRuntimeSilent = useAuiState(\n (s) => readRuntimeMessageFromSourceMessages(s.message)?.silent === true,\n );\n\n if (soleRuntimeKind && soleRuntimeKind !== \"handoff\") {\n if (soleRuntimeSilent) return null;\n return (\n <MessagePrimitive.Root\n data-message-role=\"assistant\"\n className=\"group group/assistant-message mb-3\"\n >\n <div className=\"max-w-[95%]\">\n <RuntimeEnding placement=\"row\" />\n </div>\n </MessagePrimitive.Root>\n );\n }\n\n return (\n <MessagePrimitive.Root\n data-message-role=\"assistant\"\n className=\"group group/assistant-message mb-3\"\n >\n <div className=\"max-w-[95%]\">\n <RuntimeEnding placement=\"banner\" />\n {Content ? (\n <Content />\n ) : (\n <MessagePrimitive.Content\n components={{\n Text: MarkdownText,\n tools: { Fallback: toolFallback },\n }}\n />\n )}\n {showActions ? (\n <div className=\"flex min-h-6 items-center gap-1\">\n <BranchPicker />\n <AssistantActionBar />\n </div>\n ) : null}\n </div>\n </MessagePrimitive.Root>\n );\n };\n\n return AssistantMessage;\n}\n\n/** Panel chrome: the thread card and the header row that sits inside it. */\nexport const THREAD_PANEL_CLASS =\n \"m-1 flex min-h-0 flex-1 flex-col overflow-hidden rounded-[18px] border border-dashed border-amber-500 bg-background shadow-[0_1px_10px_rgba(54,45,33,0.08)]\";\nexport const THREAD_HEADER_CLASS =\n \"flex items-center justify-between gap-2 px-3 py-2\";\nexport const THREAD_HEADER_ACTIONS_CLASS =\n \"flex min-w-0 items-center justify-end gap-1.5\";\n/** Pill used for the header's leading control (agent picker, host label). */\nexport const THREAD_HEADER_PILL_CLASS =\n \"inline-flex h-7 max-w-[170px] items-center gap-1.5 rounded-md border border-neutral-200 bg-white px-2 text-xs font-medium text-neutral-800 shadow-sm\";\nexport const THREAD_HEADER_ICON_CLASS = \"size-[18px]\";\n\n/** Composer chrome: the dock around the composer, its surface and its rows. */\nexport const COMPOSER_DOCK_CLASS = \"bg-background px-2.5 pb-2 pt-1.5\";\nexport const COMPOSER_SURFACE_CLASS =\n \"relative flex flex-col gap-1 rounded-xl border border-neutral-200 bg-white shadow-[0_2px_10px_rgba(54,45,33,0.08)]\";\nexport const COMPOSER_EDITOR_ROW_CLASS = \"px-2.5 pt-1\";\nexport const COMPOSER_TOOLBAR_CLASS =\n \"flex items-center gap-1 border-t border-neutral-100 px-2 py-1.5\";\n/**\n * Paper composer chrome (`ChatComposerDock appearance=\"paper\"`): a card-toned\n * surface with a larger radius, a focus-within ring, a drag-over tint keyed\n * off `data-drag-active`, and a bottom rail — the chrome the SDK's\n * `AthenaChat` thread renders. Hosts on the default chrome above are\n * untouched. The dock carries no padding of its own; the paper host's footer\n * spaces it. The radius and border colour also bind to the `--composer-radius`\n * / `--composer-border` theme variables in `styles.css`.\n */\nexport const COMPOSER_PAPER_DOCK_CLASS = \"aui-composer-dock\";\nexport const COMPOSER_PAPER_SURFACE_CLASS =\n \"aui-composer-root relative flex w-full flex-col rounded-[1.375rem] border border-border bg-card p-2.5 text-card-foreground shadow-[0_1px_2px_rgba(0,0,0,0.04)] outline-none transition-shadow duration-150 focus-within:shadow-[0_8px_24px_-14px_rgba(0,0,0,0.25)] focus-within:ring-2 focus-within:ring-ring/40 data-[drag-active=true]:bg-primary/5 data-[drag-active=true]:ring-2 data-[drag-active=true]:ring-primary/40\";\nexport const COMPOSER_PAPER_EDITOR_ROW_CLASS = \"px-0.5\";\nexport const COMPOSER_PAPER_TOOLBAR_CLASS =\n \"aui-composer-action-wrapper relative flex items-center justify-between gap-1 pt-1\";\nexport const THREAD_SCROLL_TO_BOTTOM_CLASS =\n \"inline-flex items-center justify-center rounded-full border bg-background/80 p-1 shadow-sm backdrop-blur transition-opacity hover:bg-accent disabled:invisible\";\n\nconst ComposerStopIcon: FC = () => (\n <svg\n aria-hidden=\"true\"\n className=\"size-4\"\n viewBox=\"0 0 16 16\"\n fill=\"currentColor\"\n >\n <rect width=\"10\" height=\"10\" x=\"3\" y=\"3\" rx=\"2\" />\n </svg>\n);\n\nexport interface ComposerStopButtonProps {\n onStop: () => void;\n disabled?: boolean;\n title?: string;\n}\n\nexport interface ComposerSendButtonProps {\n action: Extract<ComposerAction, \"send\" | \"queue\">;\n onSend: () => void;\n disabled?: boolean;\n title?: string;\n}\n\n/** Stop control shown while a run is in flight and there is nothing queued. */\nexport const ComposerStopButton: FC<ComposerStopButtonProps> = ({\n onStop,\n disabled = false,\n title = \"Stop generation\",\n}) => (\n <button\n type=\"button\"\n onClick={onStop}\n disabled={disabled}\n title={title}\n className={cn(\n \"inline-flex size-8 shrink-0 items-center justify-center rounded-lg bg-foreground text-background shadow-sm transition-colors hover:bg-foreground/80\",\n disabled && \"cursor-not-allowed opacity-60\",\n )}\n >\n <ComposerStopIcon />\n </button>\n);\n/** Send control, which becomes a queue control while a run is in flight. */\nexport const ComposerSendButton: FC<ComposerSendButtonProps> = ({\n action,\n onSend,\n disabled = false,\n title,\n}) => (\n <button\n type=\"button\"\n onClick={onSend}\n disabled={disabled}\n title={title ?? (action === \"queue\" ? \"Queue message\" : \"Send\")}\n className={cn(\n \"inline-flex size-8 shrink-0 items-center justify-center rounded-full shadow-sm transition-colors\",\n disabled\n ? \"cursor-not-allowed bg-muted text-muted-foreground opacity-60\"\n : \"bg-foreground text-background hover:bg-foreground/80\",\n )}\n >\n {action === \"queue\" ? (\n <ListPlusIcon className=\"size-4\" />\n ) : (\n <ArrowUpIcon className=\"size-4\" />\n )}\n </button>\n);\n"],"names":["jsx","cn","jsxs","BranchPickerPrimitive","ChevronLeftIcon","ChevronRightIcon","ActionBarPrimitive","AuiIf","CheckIcon","CopyIcon","useAuiState","useAthenaRunLive","useMessageActionsReadOnly","PencilIcon","RefreshCwIcon","useSmooth","useMessagePartText","hideUnterminatedMarkdownLink","ChatMessageBody","isGithubWakeMessage","isVoiceDelegationMessage","MessagePrimitive","WakeMarkerMessage","VoiceDelegationMessage","useMemo","readRuntimeMessageFromSourceMessages","RuntimeMessageCard","hasVisibleContent","readSoleRuntimeMessageKind","ListPlusIcon","ArrowUpIcon"],"mappings":";;;;;;;;;;;;;;;;;;;AA4CO,SAAS,WAAW;AAAA,EACzB;AAAA,EACA;AAAA,EACA;AAAA,EACA,GAAG;AACL,GAAkE;AAChE,SACEA,2BAAAA;AAAAA,IAAC;AAAA,IAAA;AAAA,MACC,MAAK;AAAA,MACL,OAAO;AAAA,MACP,cAAY;AAAA,MACZ,WAAWC,OAAAA;AAAAA,QACT;AAAA,QACA;AAAA,MAAA;AAAA,MAED,GAAG;AAAA,MAEH;AAAA,IAAA;AAAA,EAAA;AAGP;AAEO,SAAS,gBAAgB;AAAA,EAC9B;AAAA,EACA;AAAA,EACA;AAAA,EACA,GAAG;AACL,GAAkE;AAChE,SACED,2BAAAA;AAAAA,IAAC;AAAA,IAAA;AAAA,MACC,MAAK;AAAA,MACL,OAAO;AAAA,MACP,cAAY;AAAA,MACZ,WAAWC,OAAAA;AAAAA,QACT;AAAA,QACA;AAAA,MAAA;AAAA,MAED,GAAG;AAAA,MAEH;AAAA,IAAA;AAAA,EAAA;AAGP;AAEO,MAAM,eAAmB,MAC9BC,2B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AUK,MAAM,4BAA4B;AAClC,MAAM,+BACX;AACK,MAAM,kCAAkC;AACxC,MAAM,+BACX;AACK,MAAM,gCACX;AAEF,MAAM,mBAAuB,MAC3BA,2BAAAA;AAAAA,EAAC;AAAA,EAAA;AAAA,IACC,eAAY;AAAA,IACZ,WAAU;AAAA,IACV,SAAQ;AAAA,IACR,MAAK;AAAA,IAEL,UAAAA,2BAAAA,IAAC,QAAA,EAAK,OAAM,MAAK,QAAO,MAAK,GAAE,KAAI,GAAE,KAAI,IAAG,IAAA,CAAI;AAAA,EAAA;AAClD;AAiBK,MAAM,qBAAkD,CAAC;AAAA,EAC9D;AAAA,EACA,WAAW;AAAA,EACX,QAAQ;AACV,MACEA,2BAAAA;AAAAA,EAAC;AAAA,EAAA;AAAA,IACC,MAAK;AAAA,IACL,SAAS;AAAA,IACT;AAAA,IACA;AAAA,IACA,WAAWC,OAAAA;AAAAA,MACT;AAAA,MACA,YAAY;AAAA,IAAA;AAAA,IAGd,yCAAC,kBAAA,CAAA,CAAiB;AAAA,EAAA;AACpB;AAGK,MAAM,qBAAkD,CAAC;AAAA,EAC9D;AAAA,EACA;AAAA,EACA,WAAW;AAAA,EACX;AACF,MACED,2BAAAA;AAAAA,EAAC;AAAA,EAAA;AAAA,IACC,MAAK;AAAA,IACL,SAAS;AAAA,IACT;AAAA,IACA,OAAO,UAAU,WAAW,UAAU,kBAAkB;AAAA,IACxD,WAAWC,OAAAA;AAAAA,MACT;AAAA,MACA,WACI,iEACA;AAAA,IAAA;AAAA,IAGL,UAAA,WAAW,UACVD,2BAAAA,IAAC6B,YAAAA,cAAA,EAAa,WAAU,UAAS,IAEjC7B,2BAAAA,IAAC8B,YAAAA,aAAA,EAAY,WAAU,SAAA,CAAS;AAAA,EAAA;AAEpC;;;;;;;;;;;;;;;;;;;;;;;;"}
|
|
1
|
+
{"version":3,"file":"message-components.cjs","sources":["../../../src/chat-ui/messages/message-components.tsx"],"sourcesContent":["import {\n ActionBarPrimitive,\n AuiIf,\n BranchPickerPrimitive,\n MessagePrimitive,\n useAuiState,\n useMessagePartText,\n useSmooth,\n type ToolCallMessagePartComponent,\n} from \"@assistant-ui/react\";\nimport {\n hideUnterminatedMarkdownLink,\n isGithubWakeMessage,\n isVoiceDelegationMessage,\n readRuntimeMessageFromSourceMessages,\n readSoleRuntimeMessageKind,\n} from \"@athenaintel/agent-runtime\";\nimport \"@assistant-ui/react-markdown/styles/dot.css\";\nimport {\n ArrowUpIcon,\n CheckIcon,\n ChevronLeftIcon,\n ChevronRightIcon,\n CopyIcon,\n ListPlusIcon,\n PencilIcon,\n RefreshCwIcon,\n} from \"lucide-react\";\nimport {\n type FC,\n type ReactNode,\n useMemo,\n} from \"react\";\nimport { useAthenaRunLive } from \"../../chat/use-athena-run-live\";\nimport type { ComposerAction } from \"../composer/composer-action\";\nimport { cn } from \"../../lib/utils\";\nimport { ChatMessageBody } from \"../rich-text/chat-message-body\";\nimport { useMessageActionsReadOnly } from \"./message-actions-config\";\nimport { RuntimeMessageCard } from \"./runtime-message\";\nimport { hasVisibleContent } from \"./running-indicator\";\nimport { VoiceDelegationMessage } from \"./voice-delegation-card\";\nimport { WakeMarkerMessage } from \"./wake-marker\";\nimport { SmallIconButton } from \"./thread-chrome\";\n\nexport {\n IconButton,\n SmallIconButton,\n THREAD_HEADER_ACTIONS_CLASS,\n THREAD_HEADER_CLASS,\n THREAD_HEADER_ICON_CLASS,\n THREAD_HEADER_PILL_CLASS,\n THREAD_PANEL_CLASS,\n} from \"./thread-chrome\";\n\nexport const BranchPicker: FC = () => (\n <BranchPickerPrimitive.Root\n hideWhenSingleBranch\n className=\"inline-flex items-center gap-0.5 text-xs text-muted-foreground\"\n data-testid=\"chat-branch-picker\"\n >\n <BranchPickerPrimitive.Previous asChild>\n <SmallIconButton\n tooltip=\"Previous branch\"\n data-testid=\"chat-branch-previous\"\n >\n <ChevronLeftIcon className=\"size-3\" />\n </SmallIconButton>\n </BranchPickerPrimitive.Previous>\n <span className=\"font-medium\" data-testid=\"chat-branch-count\">\n <BranchPickerPrimitive.Number /> / <BranchPickerPrimitive.Count />\n </span>\n <BranchPickerPrimitive.Next asChild>\n <SmallIconButton tooltip=\"Next branch\" data-testid=\"chat-branch-next\">\n <ChevronRightIcon className=\"size-3\" />\n </SmallIconButton>\n </BranchPickerPrimitive.Next>\n </BranchPickerPrimitive.Root>\n);\n\nconst CopyActionButton: FC = () => (\n <ActionBarPrimitive.Copy asChild>\n <SmallIconButton tooltip=\"Copy\">\n <AuiIf condition={(state) => state.message.isCopied}>\n <CheckIcon className=\"size-3\" />\n </AuiIf>\n <AuiIf condition={(state) => !state.message.isCopied}>\n <CopyIcon className=\"size-3\" />\n </AuiIf>\n </SmallIconButton>\n </ActionBarPrimitive.Copy>\n);\n\n/**\n * The edit primitive does not check the runtime's edit capability itself —\n * clicking it on a runtime without one throws inside onPress, where no error\n * boundary can catch it — so the button must gate on the capability and, to\n * match the rewind semantics of `run/edit`, stay hidden while a run is live.\n * The read-only context covers threads the capability flags cannot: a host's\n * static `edit: true` still applies to fenced legacy conversations.\n */\nconst EditActionButton: FC = () => {\n const allowEdit = useAuiState((s) => s.thread.capabilities.edit);\n const isRunning = useAthenaRunLive();\n const readOnly = useMessageActionsReadOnly();\n if (!allowEdit || isRunning || readOnly) return null;\n return (\n <ActionBarPrimitive.Edit asChild>\n <SmallIconButton tooltip=\"Edit\" data-testid=\"chat-message-edit\">\n <PencilIcon className=\"size-3\" />\n </SmallIconButton>\n </ActionBarPrimitive.Edit>\n );\n};\n\n/** Regenerate dispatches `run/reload`, so it hides on read-only threads too. */\nconst RegenerateActionButton: FC = () => {\n const readOnly = useMessageActionsReadOnly();\n if (readOnly) return null;\n return (\n <ActionBarPrimitive.Reload asChild>\n <SmallIconButton tooltip=\"Regenerate\">\n <RefreshCwIcon className=\"size-3\" />\n </SmallIconButton>\n </ActionBarPrimitive.Reload>\n );\n};\n\n/**\n * Reveal-on-demand treatment for action bars: invisible and click-through\n * until the surrounding named group is hovered or a control inside receives\n * keyboard focus. The `focus-within` escape hatch is what keeps the hidden\n * controls reachable for keyboard users.\n */\nexport const ACTION_BAR_REVEAL_CLASS =\n \"pointer-events-none opacity-0 transition-opacity focus-within:pointer-events-auto focus-within:opacity-100\";\n\n/** Shared chat body; the reveal holds incomplete links until their URL is complete. */\nexport const MarkdownText: FC = () => {\n const revealed = useSmooth(useMessagePartText(), true);\n const isRunning = revealed.status.type === \"running\";\n const text = isRunning ? hideUnterminatedMarkdownLink(revealed.text) : revealed.text;\n return <ChatMessageBody text={text} isRunning={isRunning} />;\n};\n\nconst UserActionBar: FC = () => (\n <ActionBarPrimitive.Root\n autohide=\"never\"\n className={cn(\n \"flex min-h-6 items-center gap-0.5\",\n ACTION_BAR_REVEAL_CLASS,\n \"group-hover/user-message:pointer-events-auto group-hover/user-message:opacity-100\",\n )}\n >\n <CopyActionButton />\n <EditActionButton />\n </ActionBarPrimitive.Root>\n);\n\nexport const UserMessage: FC = () => {\n // A GitHub wake turn is an event, not words the user typed: it renders as\n // the compact wake marker instead of a bubble quoting the injected text.\n const isWake = useAuiState((s) => isGithubWakeMessage(s.message.metadata?.custom));\n // A voice delegation's anchor is the ask the live voice model handed to the\n // thread, not words the user typed: it renders as the shared voice-task\n // card on every host instead of a second user bubble under the spoken turn.\n const isVoiceDelegation = useAuiState((s) =>\n isVoiceDelegationMessage({ messageId: s.message.id, custom: s.message.metadata?.custom }),\n );\n if (isWake) {\n return (\n <MessagePrimitive.Root data-message-role=\"user\" className=\"mb-3\">\n <WakeMarkerMessage />\n </MessagePrimitive.Root>\n );\n }\n if (isVoiceDelegation) {\n return (\n <MessagePrimitive.Root data-message-role=\"user\" className=\"mb-3\">\n <VoiceDelegationMessage />\n </MessagePrimitive.Root>\n );\n }\n return (\n <MessagePrimitive.Root\n data-message-role=\"user\"\n className=\"group/user-message mb-3 flex justify-end\"\n >\n <div className=\"flex min-w-0 max-w-[85%] flex-col items-end gap-1\">\n <div className=\"min-w-0 max-w-full rounded-2xl rounded-br-md bg-muted px-3.5 py-2 text-sm text-foreground\">\n <MessagePrimitive.Content components={{ Text: MarkdownText }} />\n </div>\n <div className=\"flex min-h-6 items-center gap-1\">\n <BranchPicker />\n <UserActionBar />\n </div>\n </div>\n </MessagePrimitive.Root>\n );\n};\n\nexport interface CreateAssistantMessageOptions {\n /** Host-registered card for tools without a dedicated UI. */\n toolFallback: ToolCallMessagePartComponent;\n /** Extra action-bar controls appended after copy/regenerate. */\n extraActions?: ReactNode;\n /**\n * Renders the message body. Hosts that group content into activity\n * timelines supply their own; the default renders markdown and tool cards.\n */\n content?: FC;\n /**\n * Inline affordance rendered inside a runtime-ending card (e.g. a Continue\n * button). Hosts without one leave it unset.\n */\n runtimeMessageAction?: ReactNode;\n}\n\n/**\n * Builds the assistant bubble. Call this once per host (memoized on its\n * inputs) so the returned component identity stays stable across renders.\n */\nexport function createAssistantMessage({\n toolFallback,\n extraActions,\n content: Content,\n runtimeMessageAction,\n}: CreateAssistantMessageOptions): FC {\n const AssistantActionBar: FC = () => {\n // The latest reply keeps its actions visible; older replies reveal them\n // on hover so a long transcript is not a wall of icon rows.\n const isLast = useAuiState((s) => s.message.isLast);\n return (\n <ActionBarPrimitive.Root\n autohide=\"never\"\n className={cn(\n \"mt-1 flex min-h-6 items-center gap-0.5\",\n !isLast && [\n ACTION_BAR_REVEAL_CLASS,\n \"group-hover/assistant-message:pointer-events-auto group-hover/assistant-message:opacity-100\",\n ],\n )}\n >\n <CopyActionButton />\n <RegenerateActionButton />\n {extraActions}\n </ActionBarPrimitive.Root>\n );\n };\n\n // A run-lifecycle marker or handoff summary is a system event, not\n // assistant speech. When it owns the whole row, render the status card in\n // place of the bubble; when it is chunked in with the assistant's own work\n // (or is a handoff whose text IS the closing summary), keep the body and\n // frame it with the card above.\n const RuntimeEnding: FC<{ placement: \"row\" | \"banner\" }> = ({ placement }) => {\n // Select the message (a stable store reference) and derive from it: the\n // reader allocates a fresh object per call, and `useAuiState` compares\n // snapshots with `Object.is`, so selecting the reader's result directly\n // would re-render on every store update and trip React's update-depth\n // guard.\n const message = useAuiState((s) => s.message);\n const runtime = useMemo(() => readRuntimeMessageFromSourceMessages(message), [message]);\n if (!runtime || runtime.silent) return null;\n if (placement === \"row\" && !runtime.isSoleSourceMessage) return null;\n if (placement === \"banner\" && runtime.isSoleSourceMessage && runtime.kind !== \"handoff\") {\n return null;\n }\n return <RuntimeMessageCard message={runtime} action={runtimeMessageAction} />;\n };\n\n const AssistantMessage: FC = () => {\n // An assistant row exists before its first token streams; showing\n // copy/regenerate against nothing looks broken, so wait for content.\n const showActions = useAuiState((state) =>\n hasVisibleContent(state.message.content),\n );\n // Primitive selector: the reader builds a fresh object per call.\n const soleRuntimeKind = useAuiState((s) => readSoleRuntimeMessageKind(s.message));\n const soleRuntimeSilent = useAuiState(\n (s) => readRuntimeMessageFromSourceMessages(s.message)?.silent === true,\n );\n\n if (soleRuntimeKind && soleRuntimeKind !== \"handoff\") {\n if (soleRuntimeSilent) return null;\n return (\n <MessagePrimitive.Root\n data-message-role=\"assistant\"\n className=\"group group/assistant-message mb-3\"\n >\n <div className=\"max-w-[95%]\">\n <RuntimeEnding placement=\"row\" />\n </div>\n </MessagePrimitive.Root>\n );\n }\n\n return (\n <MessagePrimitive.Root\n data-message-role=\"assistant\"\n className=\"group group/assistant-message mb-3\"\n >\n <div className=\"max-w-[95%]\">\n <RuntimeEnding placement=\"banner\" />\n {Content ? (\n <Content />\n ) : (\n <MessagePrimitive.Content\n components={{\n Text: MarkdownText,\n tools: { Fallback: toolFallback },\n }}\n />\n )}\n {showActions ? (\n <div className=\"flex min-h-6 items-center gap-1\">\n <BranchPicker />\n <AssistantActionBar />\n </div>\n ) : null}\n </div>\n </MessagePrimitive.Root>\n );\n };\n\n return AssistantMessage;\n}\n\n/** Composer chrome: the dock around the composer, its surface and its rows. */\nexport const COMPOSER_DOCK_CLASS = \"bg-background px-2.5 pb-2 pt-1.5\";\nexport const COMPOSER_SURFACE_CLASS =\n \"relative flex flex-col gap-1 rounded-xl border border-neutral-200 bg-white shadow-[0_2px_10px_rgba(54,45,33,0.08)]\";\nexport const COMPOSER_EDITOR_ROW_CLASS = \"px-2.5 pt-1\";\nexport const COMPOSER_TOOLBAR_CLASS =\n \"flex items-center gap-1 border-t border-neutral-100 px-2 py-1.5\";\n/**\n * Paper composer chrome (`ChatComposerDock appearance=\"paper\"`): a card-toned\n * surface with a larger radius, a focus-within ring, a drag-over tint keyed\n * off `data-drag-active`, and a bottom rail — the chrome the SDK's\n * `AthenaChat` thread renders. Hosts on the default chrome above are\n * untouched. The dock carries no padding of its own; the paper host's footer\n * spaces it. The radius and border colour also bind to the `--composer-radius`\n * / `--composer-border` theme variables in `styles.css`.\n */\nexport const COMPOSER_PAPER_DOCK_CLASS = \"aui-composer-dock\";\nexport const COMPOSER_PAPER_SURFACE_CLASS =\n \"aui-composer-root relative flex w-full flex-col rounded-[1.375rem] border border-border bg-card p-2.5 text-card-foreground shadow-[0_1px_2px_rgba(0,0,0,0.04)] outline-none transition-shadow duration-150 focus-within:shadow-[0_8px_24px_-14px_rgba(0,0,0,0.25)] focus-within:ring-2 focus-within:ring-ring/40 data-[drag-active=true]:bg-primary/5 data-[drag-active=true]:ring-2 data-[drag-active=true]:ring-primary/40\";\nexport const COMPOSER_PAPER_EDITOR_ROW_CLASS = \"px-0.5\";\nexport const COMPOSER_PAPER_TOOLBAR_CLASS =\n \"aui-composer-action-wrapper relative flex items-center justify-between gap-1 pt-1\";\nexport const THREAD_SCROLL_TO_BOTTOM_CLASS =\n \"inline-flex items-center justify-center rounded-full border bg-background/80 p-1 shadow-sm backdrop-blur transition-opacity hover:bg-accent disabled:invisible\";\n\nconst ComposerStopIcon: FC = () => (\n <svg\n aria-hidden=\"true\"\n className=\"size-4\"\n viewBox=\"0 0 16 16\"\n fill=\"currentColor\"\n >\n <rect width=\"10\" height=\"10\" x=\"3\" y=\"3\" rx=\"2\" />\n </svg>\n);\n\nexport interface ComposerStopButtonProps {\n onStop: () => void;\n disabled?: boolean;\n title?: string;\n}\n\nexport interface ComposerSendButtonProps {\n action: Extract<ComposerAction, \"send\" | \"queue\">;\n onSend: () => void;\n disabled?: boolean;\n title?: string;\n}\n\n/** Stop control shown while a run is in flight and there is nothing queued. */\nexport const ComposerStopButton: FC<ComposerStopButtonProps> = ({\n onStop,\n disabled = false,\n title = \"Stop generation\",\n}) => (\n <button\n type=\"button\"\n onClick={onStop}\n disabled={disabled}\n title={title}\n className={cn(\n \"inline-flex size-8 shrink-0 items-center justify-center rounded-lg bg-foreground text-background shadow-sm transition-colors hover:bg-foreground/80\",\n disabled && \"cursor-not-allowed opacity-60\",\n )}\n >\n <ComposerStopIcon />\n </button>\n);\n/** Send control, which becomes a queue control while a run is in flight. */\nexport const ComposerSendButton: FC<ComposerSendButtonProps> = ({\n action,\n onSend,\n disabled = false,\n title,\n}) => (\n <button\n type=\"button\"\n onClick={onSend}\n disabled={disabled}\n title={title ?? (action === \"queue\" ? \"Queue message\" : \"Send\")}\n className={cn(\n \"inline-flex size-8 shrink-0 items-center justify-center rounded-full shadow-sm transition-colors\",\n disabled\n ? \"cursor-not-allowed bg-muted text-muted-foreground opacity-60\"\n : \"bg-foreground text-background hover:bg-foreground/80\",\n )}\n >\n {action === \"queue\" ? (\n <ListPlusIcon className=\"size-4\" />\n ) : (\n <ArrowUpIcon className=\"size-4\" />\n )}\n </button>\n);\n"],"names":["jsxs","BranchPickerPrimitive","jsx","SmallIconButton","ChevronLeftIcon","ChevronRightIcon","ActionBarPrimitive","AuiIf","CheckIcon","CopyIcon","useAuiState","useAthenaRunLive","useMessageActionsReadOnly","PencilIcon","RefreshCwIcon","useSmooth","useMessagePartText","hideUnterminatedMarkdownLink","ChatMessageBody","cn","isGithubWakeMessage","isVoiceDelegationMessage","MessagePrimitive","WakeMarkerMessage","VoiceDelegationMessage","useMemo","readRuntimeMessageFromSourceMessages","RuntimeMessageCard","hasVisibleContent","readSoleRuntimeMessageKind","ListPlusIcon","ArrowUpIcon"],"mappings":";;;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down/styles/dot.css";
|
|
3
|
-
import { type
|
|
3
|
+
import { type FC, type ReactNode } from "react";
|
|
4
4
|
import type { ComposerAction } from "../composer/composer-action";
|
|
5
|
-
export
|
|
6
|
-
tooltip: string;
|
|
7
|
-
}): import("react/jsx-runtime").JSX.Element;
|
|
8
|
-
export declare function SmallIconButton({ children, tooltip, className, ...props }: ButtonHTMLAttributes<HTMLButtonElement> & {
|
|
9
|
-
tooltip: string;
|
|
10
|
-
}): import("react/jsx-runtime").JSX.Element;
|
|
5
|
+
export { IconButton, SmallIconButton, THREAD_HEADER_ACTIONS_CLASS, THREAD_HEADER_CLASS, THREAD_HEADER_ICON_CLASS, THREAD_HEADER_PILL_CLASS, THREAD_PANEL_CLASS, } from "./thread-chrome";
|
|
11
6
|
export declare const BranchPicker: FC;
|
|
12
7
|
/**
|
|
13
8
|
* Reveal-on-demand treatment for action bars: invisible and click-through
|
|
@@ -40,13 +35,6 @@ export interface CreateAssistantMessageOptions {
|
|
|
40
35
|
* inputs) so the returned component identity stays stable across renders.
|
|
41
36
|
*/
|
|
42
37
|
export declare function createAssistantMessage({ toolFallback, extraActions, content: Content, runtimeMessageAction, }: CreateAssistantMessageOptions): FC;
|
|
43
|
-
/** Panel chrome: the thread card and the header row that sits inside it. */
|
|
44
|
-
export declare const THREAD_PANEL_CLASS = "m-1 flex min-h-0 flex-1 flex-col overflow-hidden rounded-[18px] border border-dashed border-amber-500 bg-background shadow-[0_1px_10px_rgba(54,45,33,0.08)]";
|
|
45
|
-
export declare const THREAD_HEADER_CLASS = "flex items-center justify-between gap-2 px-3 py-2";
|
|
46
|
-
export declare const THREAD_HEADER_ACTIONS_CLASS = "flex min-w-0 items-center justify-end gap-1.5";
|
|
47
|
-
/** Pill used for the header's leading control (agent picker, host label). */
|
|
48
|
-
export declare const THREAD_HEADER_PILL_CLASS = "inline-flex h-7 max-w-[170px] items-center gap-1.5 rounded-md border border-neutral-200 bg-white px-2 text-xs font-medium text-neutral-800 shadow-sm";
|
|
49
|
-
export declare const THREAD_HEADER_ICON_CLASS = "size-[18px]";
|
|
50
38
|
/** Composer chrome: the dock around the composer, its surface and its rows. */
|
|
51
39
|
export declare const COMPOSER_DOCK_CLASS = "bg-background px-2.5 pb-2 pt-1.5";
|
|
52
40
|
export declare const COMPOSER_SURFACE_CLASS = "relative flex flex-col gap-1 rounded-xl border border-neutral-200 bg-white shadow-[0_2px_10px_rgba(54,45,33,0.08)]";
|
|
@@ -10,53 +10,13 @@ import { RuntimeMessageCard } from "./runtime-message.js";
|
|
|
10
10
|
import { hasVisibleContent } from "./running-indicator.js";
|
|
11
11
|
import { VoiceDelegationMessage } from "./voice-delegation-card.js";
|
|
12
12
|
import { WakeMarkerMessage } from "./wake-marker.js";
|
|
13
|
+
import { SmallIconButton } from "./thread-chrome.js";
|
|
14
|
+
import { IconButton, THREAD_HEADER_ACTIONS_CLASS, THREAD_HEADER_CLASS, THREAD_HEADER_ICON_CLASS, THREAD_HEADER_PILL_CLASS, THREAD_PANEL_CLASS } from "./thread-chrome.js";
|
|
13
15
|
import { hideUnterminatedMarkdownLink } from "../../packages/agent-runtime/src/streaming-markdown.js";
|
|
14
16
|
import { isGithubWakeMessage } from "../../packages/agent-runtime/src/github-wake-event.js";
|
|
15
17
|
import { isVoiceDelegationMessage } from "../../packages/agent-runtime/src/voice-presentation.js";
|
|
16
18
|
import { readSoleRuntimeMessageKind, readRuntimeMessageFromSourceMessages } from "../../packages/agent-runtime/src/runtime-messages.js";
|
|
17
19
|
import { cn } from "cnfast";
|
|
18
|
-
function IconButton({
|
|
19
|
-
children,
|
|
20
|
-
tooltip,
|
|
21
|
-
className,
|
|
22
|
-
...props
|
|
23
|
-
}) {
|
|
24
|
-
return /* @__PURE__ */ jsx(
|
|
25
|
-
"button",
|
|
26
|
-
{
|
|
27
|
-
type: "button",
|
|
28
|
-
title: tooltip,
|
|
29
|
-
"aria-label": tooltip,
|
|
30
|
-
className: cn(
|
|
31
|
-
"inline-flex size-9 items-center justify-center rounded-lg text-muted-foreground transition-colors hover:bg-accent hover:text-foreground",
|
|
32
|
-
className
|
|
33
|
-
),
|
|
34
|
-
...props,
|
|
35
|
-
children
|
|
36
|
-
}
|
|
37
|
-
);
|
|
38
|
-
}
|
|
39
|
-
function SmallIconButton({
|
|
40
|
-
children,
|
|
41
|
-
tooltip,
|
|
42
|
-
className,
|
|
43
|
-
...props
|
|
44
|
-
}) {
|
|
45
|
-
return /* @__PURE__ */ jsx(
|
|
46
|
-
"button",
|
|
47
|
-
{
|
|
48
|
-
type: "button",
|
|
49
|
-
title: tooltip,
|
|
50
|
-
"aria-label": tooltip,
|
|
51
|
-
className: cn(
|
|
52
|
-
"inline-flex size-6 items-center justify-center rounded text-muted-foreground transition-colors hover:bg-accent hover:text-accent-foreground",
|
|
53
|
-
className
|
|
54
|
-
),
|
|
55
|
-
...props,
|
|
56
|
-
children
|
|
57
|
-
}
|
|
58
|
-
);
|
|
59
|
-
}
|
|
60
20
|
const BranchPicker = () => /* @__PURE__ */ jsxs(
|
|
61
21
|
BranchPickerPrimitive.Root,
|
|
62
22
|
{
|
|
@@ -236,11 +196,6 @@ function createAssistantMessage({
|
|
|
236
196
|
};
|
|
237
197
|
return AssistantMessage;
|
|
238
198
|
}
|
|
239
|
-
const THREAD_PANEL_CLASS = "m-1 flex min-h-0 flex-1 flex-col overflow-hidden rounded-[18px] border border-dashed border-amber-500 bg-background shadow-[0_1px_10px_rgba(54,45,33,0.08)]";
|
|
240
|
-
const THREAD_HEADER_CLASS = "flex items-center justify-between gap-2 px-3 py-2";
|
|
241
|
-
const THREAD_HEADER_ACTIONS_CLASS = "flex min-w-0 items-center justify-end gap-1.5";
|
|
242
|
-
const THREAD_HEADER_PILL_CLASS = "inline-flex h-7 max-w-[170px] items-center gap-1.5 rounded-md border border-neutral-200 bg-white px-2 text-xs font-medium text-neutral-800 shadow-sm";
|
|
243
|
-
const THREAD_HEADER_ICON_CLASS = "size-[18px]";
|
|
244
199
|
const COMPOSER_DOCK_CLASS = "bg-background px-2.5 pb-2 pt-1.5";
|
|
245
200
|
const COMPOSER_SURFACE_CLASS = "relative flex flex-col gap-1 rounded-xl border border-neutral-200 bg-white shadow-[0_2px_10px_rgba(54,45,33,0.08)]";
|
|
246
201
|
const COMPOSER_EDITOR_ROW_CLASS = "px-2.5 pt-1";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"message-components.js","sources":["../../../src/chat-ui/messages/message-components.tsx"],"sourcesContent":["import {\n ActionBarPrimitive,\n AuiIf,\n BranchPickerPrimitive,\n MessagePrimitive,\n useAuiState,\n useMessagePartText,\n useSmooth,\n type ToolCallMessagePartComponent,\n} from \"@assistant-ui/react\";\nimport {\n hideUnterminatedMarkdownLink,\n isGithubWakeMessage,\n isVoiceDelegationMessage,\n readRuntimeMessageFromSourceMessages,\n readSoleRuntimeMessageKind,\n} from \"@athenaintel/agent-runtime\";\nimport \"@assistant-ui/react-markdown/styles/dot.css\";\nimport {\n ArrowUpIcon,\n CheckIcon,\n ChevronLeftIcon,\n ChevronRightIcon,\n CopyIcon,\n ListPlusIcon,\n PencilIcon,\n RefreshCwIcon,\n} from \"lucide-react\";\nimport {\n type ButtonHTMLAttributes,\n type FC,\n type ReactNode,\n useMemo,\n} from \"react\";\nimport { useAthenaRunLive } from \"../../chat/use-athena-run-live\";\nimport type { ComposerAction } from \"../composer/composer-action\";\nimport { cn } from \"../../lib/utils\";\nimport { ChatMessageBody } from \"../rich-text/chat-message-body\";\nimport { useMessageActionsReadOnly } from \"./message-actions-config\";\nimport { RuntimeMessageCard } from \"./runtime-message\";\nimport { hasVisibleContent } from \"./running-indicator\";\nimport { VoiceDelegationMessage } from \"./voice-delegation-card\";\nimport { WakeMarkerMessage } from \"./wake-marker\";\n\nexport function IconButton({\n children,\n tooltip,\n className,\n ...props\n}: ButtonHTMLAttributes<HTMLButtonElement> & { tooltip: string }) {\n return (\n <button\n type=\"button\"\n title={tooltip}\n aria-label={tooltip}\n className={cn(\n \"inline-flex size-9 items-center justify-center rounded-lg text-muted-foreground transition-colors hover:bg-accent hover:text-foreground\",\n className,\n )}\n {...props}\n >\n {children}\n </button>\n );\n}\n\nexport function SmallIconButton({\n children,\n tooltip,\n className,\n ...props\n}: ButtonHTMLAttributes<HTMLButtonElement> & { tooltip: string }) {\n return (\n <button\n type=\"button\"\n title={tooltip}\n aria-label={tooltip}\n className={cn(\n \"inline-flex size-6 items-center justify-center rounded text-muted-foreground transition-colors hover:bg-accent hover:text-accent-foreground\",\n className,\n )}\n {...props}\n >\n {children}\n </button>\n );\n}\n\nexport const BranchPicker: FC = () => (\n <BranchPickerPrimitive.Root\n hideWhenSingleBranch\n className=\"inline-flex items-center gap-0.5 text-xs text-muted-foreground\"\n data-testid=\"chat-branch-picker\"\n >\n <BranchPickerPrimitive.Previous asChild>\n <SmallIconButton\n tooltip=\"Previous branch\"\n data-testid=\"chat-branch-previous\"\n >\n <ChevronLeftIcon className=\"size-3\" />\n </SmallIconButton>\n </BranchPickerPrimitive.Previous>\n <span className=\"font-medium\" data-testid=\"chat-branch-count\">\n <BranchPickerPrimitive.Number /> / <BranchPickerPrimitive.Count />\n </span>\n <BranchPickerPrimitive.Next asChild>\n <SmallIconButton tooltip=\"Next branch\" data-testid=\"chat-branch-next\">\n <ChevronRightIcon className=\"size-3\" />\n </SmallIconButton>\n </BranchPickerPrimitive.Next>\n </BranchPickerPrimitive.Root>\n);\n\nconst CopyActionButton: FC = () => (\n <ActionBarPrimitive.Copy asChild>\n <SmallIconButton tooltip=\"Copy\">\n <AuiIf condition={(state) => state.message.isCopied}>\n <CheckIcon className=\"size-3\" />\n </AuiIf>\n <AuiIf condition={(state) => !state.message.isCopied}>\n <CopyIcon className=\"size-3\" />\n </AuiIf>\n </SmallIconButton>\n </ActionBarPrimitive.Copy>\n);\n\n/**\n * The edit primitive does not check the runtime's edit capability itself —\n * clicking it on a runtime without one throws inside onPress, where no error\n * boundary can catch it — so the button must gate on the capability and, to\n * match the rewind semantics of `run/edit`, stay hidden while a run is live.\n * The read-only context covers threads the capability flags cannot: a host's\n * static `edit: true` still applies to fenced legacy conversations.\n */\nconst EditActionButton: FC = () => {\n const allowEdit = useAuiState((s) => s.thread.capabilities.edit);\n const isRunning = useAthenaRunLive();\n const readOnly = useMessageActionsReadOnly();\n if (!allowEdit || isRunning || readOnly) return null;\n return (\n <ActionBarPrimitive.Edit asChild>\n <SmallIconButton tooltip=\"Edit\" data-testid=\"chat-message-edit\">\n <PencilIcon className=\"size-3\" />\n </SmallIconButton>\n </ActionBarPrimitive.Edit>\n );\n};\n\n/** Regenerate dispatches `run/reload`, so it hides on read-only threads too. */\nconst RegenerateActionButton: FC = () => {\n const readOnly = useMessageActionsReadOnly();\n if (readOnly) return null;\n return (\n <ActionBarPrimitive.Reload asChild>\n <SmallIconButton tooltip=\"Regenerate\">\n <RefreshCwIcon className=\"size-3\" />\n </SmallIconButton>\n </ActionBarPrimitive.Reload>\n );\n};\n\n/**\n * Reveal-on-demand treatment for action bars: invisible and click-through\n * until the surrounding named group is hovered or a control inside receives\n * keyboard focus. The `focus-within` escape hatch is what keeps the hidden\n * controls reachable for keyboard users.\n */\nexport const ACTION_BAR_REVEAL_CLASS =\n \"pointer-events-none opacity-0 transition-opacity focus-within:pointer-events-auto focus-within:opacity-100\";\n\n/** Shared chat body; the reveal holds incomplete links until their URL is complete. */\nexport const MarkdownText: FC = () => {\n const revealed = useSmooth(useMessagePartText(), true);\n const isRunning = revealed.status.type === \"running\";\n const text = isRunning ? hideUnterminatedMarkdownLink(revealed.text) : revealed.text;\n return <ChatMessageBody text={text} isRunning={isRunning} />;\n};\n\nconst UserActionBar: FC = () => (\n <ActionBarPrimitive.Root\n autohide=\"never\"\n className={cn(\n \"flex min-h-6 items-center gap-0.5\",\n ACTION_BAR_REVEAL_CLASS,\n \"group-hover/user-message:pointer-events-auto group-hover/user-message:opacity-100\",\n )}\n >\n <CopyActionButton />\n <EditActionButton />\n </ActionBarPrimitive.Root>\n);\n\nexport const UserMessage: FC = () => {\n // A GitHub wake turn is an event, not words the user typed: it renders as\n // the compact wake marker instead of a bubble quoting the injected text.\n const isWake = useAuiState((s) => isGithubWakeMessage(s.message.metadata?.custom));\n // A voice delegation's anchor is the ask the live voice model handed to the\n // thread, not words the user typed: it renders as the shared voice-task\n // card on every host instead of a second user bubble under the spoken turn.\n const isVoiceDelegation = useAuiState((s) =>\n isVoiceDelegationMessage({ messageId: s.message.id, custom: s.message.metadata?.custom }),\n );\n if (isWake) {\n return (\n <MessagePrimitive.Root data-message-role=\"user\" className=\"mb-3\">\n <WakeMarkerMessage />\n </MessagePrimitive.Root>\n );\n }\n if (isVoiceDelegation) {\n return (\n <MessagePrimitive.Root data-message-role=\"user\" className=\"mb-3\">\n <VoiceDelegationMessage />\n </MessagePrimitive.Root>\n );\n }\n return (\n <MessagePrimitive.Root\n data-message-role=\"user\"\n className=\"group/user-message mb-3 flex justify-end\"\n >\n <div className=\"flex min-w-0 max-w-[85%] flex-col items-end gap-1\">\n <div className=\"min-w-0 max-w-full rounded-2xl rounded-br-md bg-muted px-3.5 py-2 text-sm text-foreground\">\n <MessagePrimitive.Content components={{ Text: MarkdownText }} />\n </div>\n <div className=\"flex min-h-6 items-center gap-1\">\n <BranchPicker />\n <UserActionBar />\n </div>\n </div>\n </MessagePrimitive.Root>\n );\n};\n\nexport interface CreateAssistantMessageOptions {\n /** Host-registered card for tools without a dedicated UI. */\n toolFallback: ToolCallMessagePartComponent;\n /** Extra action-bar controls appended after copy/regenerate. */\n extraActions?: ReactNode;\n /**\n * Renders the message body. Hosts that group content into activity\n * timelines supply their own; the default renders markdown and tool cards.\n */\n content?: FC;\n /**\n * Inline affordance rendered inside a runtime-ending card (e.g. a Continue\n * button). Hosts without one leave it unset.\n */\n runtimeMessageAction?: ReactNode;\n}\n\n/**\n * Builds the assistant bubble. Call this once per host (memoized on its\n * inputs) so the returned component identity stays stable across renders.\n */\nexport function createAssistantMessage({\n toolFallback,\n extraActions,\n content: Content,\n runtimeMessageAction,\n}: CreateAssistantMessageOptions): FC {\n const AssistantActionBar: FC = () => {\n // The latest reply keeps its actions visible; older replies reveal them\n // on hover so a long transcript is not a wall of icon rows.\n const isLast = useAuiState((s) => s.message.isLast);\n return (\n <ActionBarPrimitive.Root\n autohide=\"never\"\n className={cn(\n \"mt-1 flex min-h-6 items-center gap-0.5\",\n !isLast && [\n ACTION_BAR_REVEAL_CLASS,\n \"group-hover/assistant-message:pointer-events-auto group-hover/assistant-message:opacity-100\",\n ],\n )}\n >\n <CopyActionButton />\n <RegenerateActionButton />\n {extraActions}\n </ActionBarPrimitive.Root>\n );\n };\n\n // A run-lifecycle marker or handoff summary is a system event, not\n // assistant speech. When it owns the whole row, render the status card in\n // place of the bubble; when it is chunked in with the assistant's own work\n // (or is a handoff whose text IS the closing summary), keep the body and\n // frame it with the card above.\n const RuntimeEnding: FC<{ placement: \"row\" | \"banner\" }> = ({ placement }) => {\n // Select the message (a stable store reference) and derive from it: the\n // reader allocates a fresh object per call, and `useAuiState` compares\n // snapshots with `Object.is`, so selecting the reader's result directly\n // would re-render on every store update and trip React's update-depth\n // guard.\n const message = useAuiState((s) => s.message);\n const runtime = useMemo(() => readRuntimeMessageFromSourceMessages(message), [message]);\n if (!runtime || runtime.silent) return null;\n if (placement === \"row\" && !runtime.isSoleSourceMessage) return null;\n if (placement === \"banner\" && runtime.isSoleSourceMessage && runtime.kind !== \"handoff\") {\n return null;\n }\n return <RuntimeMessageCard message={runtime} action={runtimeMessageAction} />;\n };\n\n const AssistantMessage: FC = () => {\n // An assistant row exists before its first token streams; showing\n // copy/regenerate against nothing looks broken, so wait for content.\n const showActions = useAuiState((state) =>\n hasVisibleContent(state.message.content),\n );\n // Primitive selector: the reader builds a fresh object per call.\n const soleRuntimeKind = useAuiState((s) => readSoleRuntimeMessageKind(s.message));\n const soleRuntimeSilent = useAuiState(\n (s) => readRuntimeMessageFromSourceMessages(s.message)?.silent === true,\n );\n\n if (soleRuntimeKind && soleRuntimeKind !== \"handoff\") {\n if (soleRuntimeSilent) return null;\n return (\n <MessagePrimitive.Root\n data-message-role=\"assistant\"\n className=\"group group/assistant-message mb-3\"\n >\n <div className=\"max-w-[95%]\">\n <RuntimeEnding placement=\"row\" />\n </div>\n </MessagePrimitive.Root>\n );\n }\n\n return (\n <MessagePrimitive.Root\n data-message-role=\"assistant\"\n className=\"group group/assistant-message mb-3\"\n >\n <div className=\"max-w-[95%]\">\n <RuntimeEnding placement=\"banner\" />\n {Content ? (\n <Content />\n ) : (\n <MessagePrimitive.Content\n components={{\n Text: MarkdownText,\n tools: { Fallback: toolFallback },\n }}\n />\n )}\n {showActions ? (\n <div className=\"flex min-h-6 items-center gap-1\">\n <BranchPicker />\n <AssistantActionBar />\n </div>\n ) : null}\n </div>\n </MessagePrimitive.Root>\n );\n };\n\n return AssistantMessage;\n}\n\n/** Panel chrome: the thread card and the header row that sits inside it. */\nexport const THREAD_PANEL_CLASS =\n \"m-1 flex min-h-0 flex-1 flex-col overflow-hidden rounded-[18px] border border-dashed border-amber-500 bg-background shadow-[0_1px_10px_rgba(54,45,33,0.08)]\";\nexport const THREAD_HEADER_CLASS =\n \"flex items-center justify-between gap-2 px-3 py-2\";\nexport const THREAD_HEADER_ACTIONS_CLASS =\n \"flex min-w-0 items-center justify-end gap-1.5\";\n/** Pill used for the header's leading control (agent picker, host label). */\nexport const THREAD_HEADER_PILL_CLASS =\n \"inline-flex h-7 max-w-[170px] items-center gap-1.5 rounded-md border border-neutral-200 bg-white px-2 text-xs font-medium text-neutral-800 shadow-sm\";\nexport const THREAD_HEADER_ICON_CLASS = \"size-[18px]\";\n\n/** Composer chrome: the dock around the composer, its surface and its rows. */\nexport const COMPOSER_DOCK_CLASS = \"bg-background px-2.5 pb-2 pt-1.5\";\nexport const COMPOSER_SURFACE_CLASS =\n \"relative flex flex-col gap-1 rounded-xl border border-neutral-200 bg-white shadow-[0_2px_10px_rgba(54,45,33,0.08)]\";\nexport const COMPOSER_EDITOR_ROW_CLASS = \"px-2.5 pt-1\";\nexport const COMPOSER_TOOLBAR_CLASS =\n \"flex items-center gap-1 border-t border-neutral-100 px-2 py-1.5\";\n/**\n * Paper composer chrome (`ChatComposerDock appearance=\"paper\"`): a card-toned\n * surface with a larger radius, a focus-within ring, a drag-over tint keyed\n * off `data-drag-active`, and a bottom rail — the chrome the SDK's\n * `AthenaChat` thread renders. Hosts on the default chrome above are\n * untouched. The dock carries no padding of its own; the paper host's footer\n * spaces it. The radius and border colour also bind to the `--composer-radius`\n * / `--composer-border` theme variables in `styles.css`.\n */\nexport const COMPOSER_PAPER_DOCK_CLASS = \"aui-composer-dock\";\nexport const COMPOSER_PAPER_SURFACE_CLASS =\n \"aui-composer-root relative flex w-full flex-col rounded-[1.375rem] border border-border bg-card p-2.5 text-card-foreground shadow-[0_1px_2px_rgba(0,0,0,0.04)] outline-none transition-shadow duration-150 focus-within:shadow-[0_8px_24px_-14px_rgba(0,0,0,0.25)] focus-within:ring-2 focus-within:ring-ring/40 data-[drag-active=true]:bg-primary/5 data-[drag-active=true]:ring-2 data-[drag-active=true]:ring-primary/40\";\nexport const COMPOSER_PAPER_EDITOR_ROW_CLASS = \"px-0.5\";\nexport const COMPOSER_PAPER_TOOLBAR_CLASS =\n \"aui-composer-action-wrapper relative flex items-center justify-between gap-1 pt-1\";\nexport const THREAD_SCROLL_TO_BOTTOM_CLASS =\n \"inline-flex items-center justify-center rounded-full border bg-background/80 p-1 shadow-sm backdrop-blur transition-opacity hover:bg-accent disabled:invisible\";\n\nconst ComposerStopIcon: FC = () => (\n <svg\n aria-hidden=\"true\"\n className=\"size-4\"\n viewBox=\"0 0 16 16\"\n fill=\"currentColor\"\n >\n <rect width=\"10\" height=\"10\" x=\"3\" y=\"3\" rx=\"2\" />\n </svg>\n);\n\nexport interface ComposerStopButtonProps {\n onStop: () => void;\n disabled?: boolean;\n title?: string;\n}\n\nexport interface ComposerSendButtonProps {\n action: Extract<ComposerAction, \"send\" | \"queue\">;\n onSend: () => void;\n disabled?: boolean;\n title?: string;\n}\n\n/** Stop control shown while a run is in flight and there is nothing queued. */\nexport const ComposerStopButton: FC<ComposerStopButtonProps> = ({\n onStop,\n disabled = false,\n title = \"Stop generation\",\n}) => (\n <button\n type=\"button\"\n onClick={onStop}\n disabled={disabled}\n title={title}\n className={cn(\n \"inline-flex size-8 shrink-0 items-center justify-center rounded-lg bg-foreground text-background shadow-sm transition-colors hover:bg-foreground/80\",\n disabled && \"cursor-not-allowed opacity-60\",\n )}\n >\n <ComposerStopIcon />\n </button>\n);\n/** Send control, which becomes a queue control while a run is in flight. */\nexport const ComposerSendButton: FC<ComposerSendButtonProps> = ({\n action,\n onSend,\n disabled = false,\n title,\n}) => (\n <button\n type=\"button\"\n onClick={onSend}\n disabled={disabled}\n title={title ?? (action === \"queue\" ? \"Queue message\" : \"Send\")}\n className={cn(\n \"inline-flex size-8 shrink-0 items-center justify-center rounded-full shadow-sm transition-colors\",\n disabled\n ? \"cursor-not-allowed bg-muted text-muted-foreground opacity-60\"\n : \"bg-foreground text-background hover:bg-foreground/80\",\n )}\n >\n {action === \"queue\" ? (\n <ListPlusIcon className=\"size-4\" />\n ) : (\n <ArrowUpIcon className=\"size-4\" />\n )}\n </button>\n);\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;;AA4CO,SAAS,WAAW;AAAA,EACzB;AAAA,EACA;AAAA,EACA;AAAA,EACA,GAAG;AACL,GAAkE;AAChE,SACE;AAAA,IAAC;AAAA,IAAA;AAAA,MACC,MAAK;AAAA,MACL,OAAO;AAAA,MACP,cAAY;AAAA,MACZ,WAAW;AAAA,QACT;AAAA,QACA;AAAA,MAAA;AAAA,MAED,GAAG;AAAA,MAEH;AAAA,IAAA;AAAA,EAAA;AAGP;AAEO,SAAS,gBAAgB;AAAA,EAC9B;AAAA,EACA;AAAA,EACA;AAAA,EACA,GAAG;AACL,GAAkE;AAChE,SACE;AAAA,IAAC;AAAA,IAAA;AAAA,MACC,MAAK;AAAA,MACL,OAAO;AAAA,MACP,cAAY;AAAA,MACZ,WAAW;A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F,MACE;AAAA,EAAC;AAAA,EAAA;AAAA,IACC,MAAK;AAAA,IACL,SAAS;AAAA,IACT;AAAA,IACA,OAAO,UAAU,WAAW,UAAU,kBAAkB;AAAA,IACxD,WAAW;AAAA,MACT;AAAA,MACA,WACI,iEACA;AAAA,IAAA;AAAA,IAGL,UAAA,WAAW,UACV,oBAAC,cAAA,EAAa,WAAU,UAAS,IAEjC,oBAAC,aAAA,EAAY,WAAU,SAAA,CAAS;AAAA,EAAA;AAEpC;"}
|
|
1
|
+
{"version":3,"file":"message-components.js","sources":["../../../src/chat-ui/messages/message-components.tsx"],"sourcesContent":["import {\n ActionBarPrimitive,\n AuiIf,\n BranchPickerPrimitive,\n MessagePrimitive,\n useAuiState,\n useMessagePartText,\n useSmooth,\n type ToolCallMessagePartComponent,\n} from \"@assistant-ui/react\";\nimport {\n hideUnterminatedMarkdownLink,\n isGithubWakeMessage,\n isVoiceDelegationMessage,\n readRuntimeMessageFromSourceMessages,\n readSoleRuntimeMessageKind,\n} from \"@athenaintel/agent-runtime\";\nimport \"@assistant-ui/react-markdown/styles/dot.css\";\nimport {\n ArrowUpIcon,\n CheckIcon,\n ChevronLeftIcon,\n ChevronRightIcon,\n CopyIcon,\n ListPlusIcon,\n PencilIcon,\n RefreshCwIcon,\n} from \"lucide-react\";\nimport {\n type FC,\n type ReactNode,\n useMemo,\n} from \"react\";\nimport { useAthenaRunLive } from \"../../chat/use-athena-run-live\";\nimport type { ComposerAction } from \"../composer/composer-action\";\nimport { cn } from \"../../lib/utils\";\nimport { ChatMessageBody } from \"../rich-text/chat-message-body\";\nimport { useMessageActionsReadOnly } from \"./message-actions-config\";\nimport { RuntimeMessageCard } from \"./runtime-message\";\nimport { hasVisibleContent } from \"./running-indicator\";\nimport { VoiceDelegationMessage } from \"./voice-delegation-card\";\nimport { WakeMarkerMessage } from \"./wake-marker\";\nimport { SmallIconButton } from \"./thread-chrome\";\n\nexport {\n IconButton,\n SmallIconButton,\n THREAD_HEADER_ACTIONS_CLASS,\n THREAD_HEADER_CLASS,\n THREAD_HEADER_ICON_CLASS,\n THREAD_HEADER_PILL_CLASS,\n THREAD_PANEL_CLASS,\n} from \"./thread-chrome\";\n\nexport const BranchPicker: FC = () => (\n <BranchPickerPrimitive.Root\n hideWhenSingleBranch\n className=\"inline-flex items-center gap-0.5 text-xs text-muted-foreground\"\n data-testid=\"chat-branch-picker\"\n >\n <BranchPickerPrimitive.Previous asChild>\n <SmallIconButton\n tooltip=\"Previous branch\"\n data-testid=\"chat-branch-previous\"\n >\n <ChevronLeftIcon className=\"size-3\" />\n </SmallIconButton>\n </BranchPickerPrimitive.Previous>\n <span className=\"font-medium\" data-testid=\"chat-branch-count\">\n <BranchPickerPrimitive.Number /> / <BranchPickerPrimitive.Count />\n </span>\n <BranchPickerPrimitive.Next asChild>\n <SmallIconButton tooltip=\"Next branch\" data-testid=\"chat-branch-next\">\n <ChevronRightIcon className=\"size-3\" />\n </SmallIconButton>\n </BranchPickerPrimitive.Next>\n </BranchPickerPrimitive.Root>\n);\n\nconst CopyActionButton: FC = () => (\n <ActionBarPrimitive.Copy asChild>\n <SmallIconButton tooltip=\"Copy\">\n <AuiIf condition={(state) => state.message.isCopied}>\n <CheckIcon className=\"size-3\" />\n </AuiIf>\n <AuiIf condition={(state) => !state.message.isCopied}>\n <CopyIcon className=\"size-3\" />\n </AuiIf>\n </SmallIconButton>\n </ActionBarPrimitive.Copy>\n);\n\n/**\n * The edit primitive does not check the runtime's edit capability itself —\n * clicking it on a runtime without one throws inside onPress, where no error\n * boundary can catch it — so the button must gate on the capability and, to\n * match the rewind semantics of `run/edit`, stay hidden while a run is live.\n * The read-only context covers threads the capability flags cannot: a host's\n * static `edit: true` still applies to fenced legacy conversations.\n */\nconst EditActionButton: FC = () => {\n const allowEdit = useAuiState((s) => s.thread.capabilities.edit);\n const isRunning = useAthenaRunLive();\n const readOnly = useMessageActionsReadOnly();\n if (!allowEdit || isRunning || readOnly) return null;\n return (\n <ActionBarPrimitive.Edit asChild>\n <SmallIconButton tooltip=\"Edit\" data-testid=\"chat-message-edit\">\n <PencilIcon className=\"size-3\" />\n </SmallIconButton>\n </ActionBarPrimitive.Edit>\n );\n};\n\n/** Regenerate dispatches `run/reload`, so it hides on read-only threads too. */\nconst RegenerateActionButton: FC = () => {\n const readOnly = useMessageActionsReadOnly();\n if (readOnly) return null;\n return (\n <ActionBarPrimitive.Reload asChild>\n <SmallIconButton tooltip=\"Regenerate\">\n <RefreshCwIcon className=\"size-3\" />\n </SmallIconButton>\n </ActionBarPrimitive.Reload>\n );\n};\n\n/**\n * Reveal-on-demand treatment for action bars: invisible and click-through\n * until the surrounding named group is hovered or a control inside receives\n * keyboard focus. The `focus-within` escape hatch is what keeps the hidden\n * controls reachable for keyboard users.\n */\nexport const ACTION_BAR_REVEAL_CLASS =\n \"pointer-events-none opacity-0 transition-opacity focus-within:pointer-events-auto focus-within:opacity-100\";\n\n/** Shared chat body; the reveal holds incomplete links until their URL is complete. */\nexport const MarkdownText: FC = () => {\n const revealed = useSmooth(useMessagePartText(), true);\n const isRunning = revealed.status.type === \"running\";\n const text = isRunning ? hideUnterminatedMarkdownLink(revealed.text) : revealed.text;\n return <ChatMessageBody text={text} isRunning={isRunning} />;\n};\n\nconst UserActionBar: FC = () => (\n <ActionBarPrimitive.Root\n autohide=\"never\"\n className={cn(\n \"flex min-h-6 items-center gap-0.5\",\n ACTION_BAR_REVEAL_CLASS,\n \"group-hover/user-message:pointer-events-auto group-hover/user-message:opacity-100\",\n )}\n >\n <CopyActionButton />\n <EditActionButton />\n </ActionBarPrimitive.Root>\n);\n\nexport const UserMessage: FC = () => {\n // A GitHub wake turn is an event, not words the user typed: it renders as\n // the compact wake marker instead of a bubble quoting the injected text.\n const isWake = useAuiState((s) => isGithubWakeMessage(s.message.metadata?.custom));\n // A voice delegation's anchor is the ask the live voice model handed to the\n // thread, not words the user typed: it renders as the shared voice-task\n // card on every host instead of a second user bubble under the spoken turn.\n const isVoiceDelegation = useAuiState((s) =>\n isVoiceDelegationMessage({ messageId: s.message.id, custom: s.message.metadata?.custom }),\n );\n if (isWake) {\n return (\n <MessagePrimitive.Root data-message-role=\"user\" className=\"mb-3\">\n <WakeMarkerMessage />\n </MessagePrimitive.Root>\n );\n }\n if (isVoiceDelegation) {\n return (\n <MessagePrimitive.Root data-message-role=\"user\" className=\"mb-3\">\n <VoiceDelegationMessage />\n </MessagePrimitive.Root>\n );\n }\n return (\n <MessagePrimitive.Root\n data-message-role=\"user\"\n className=\"group/user-message mb-3 flex justify-end\"\n >\n <div className=\"flex min-w-0 max-w-[85%] flex-col items-end gap-1\">\n <div className=\"min-w-0 max-w-full rounded-2xl rounded-br-md bg-muted px-3.5 py-2 text-sm text-foreground\">\n <MessagePrimitive.Content components={{ Text: MarkdownText }} />\n </div>\n <div className=\"flex min-h-6 items-center gap-1\">\n <BranchPicker />\n <UserActionBar />\n </div>\n </div>\n </MessagePrimitive.Root>\n );\n};\n\nexport interface CreateAssistantMessageOptions {\n /** Host-registered card for tools without a dedicated UI. */\n toolFallback: ToolCallMessagePartComponent;\n /** Extra action-bar controls appended after copy/regenerate. */\n extraActions?: ReactNode;\n /**\n * Renders the message body. Hosts that group content into activity\n * timelines supply their own; the default renders markdown and tool cards.\n */\n content?: FC;\n /**\n * Inline affordance rendered inside a runtime-ending card (e.g. a Continue\n * button). Hosts without one leave it unset.\n */\n runtimeMessageAction?: ReactNode;\n}\n\n/**\n * Builds the assistant bubble. Call this once per host (memoized on its\n * inputs) so the returned component identity stays stable across renders.\n */\nexport function createAssistantMessage({\n toolFallback,\n extraActions,\n content: Content,\n runtimeMessageAction,\n}: CreateAssistantMessageOptions): FC {\n const AssistantActionBar: FC = () => {\n // The latest reply keeps its actions visible; older replies reveal them\n // on hover so a long transcript is not a wall of icon rows.\n const isLast = useAuiState((s) => s.message.isLast);\n return (\n <ActionBarPrimitive.Root\n autohide=\"never\"\n className={cn(\n \"mt-1 flex min-h-6 items-center gap-0.5\",\n !isLast && [\n ACTION_BAR_REVEAL_CLASS,\n \"group-hover/assistant-message:pointer-events-auto group-hover/assistant-message:opacity-100\",\n ],\n )}\n >\n <CopyActionButton />\n <RegenerateActionButton />\n {extraActions}\n </ActionBarPrimitive.Root>\n );\n };\n\n // A run-lifecycle marker or handoff summary is a system event, not\n // assistant speech. When it owns the whole row, render the status card in\n // place of the bubble; when it is chunked in with the assistant's own work\n // (or is a handoff whose text IS the closing summary), keep the body and\n // frame it with the card above.\n const RuntimeEnding: FC<{ placement: \"row\" | \"banner\" }> = ({ placement }) => {\n // Select the message (a stable store reference) and derive from it: the\n // reader allocates a fresh object per call, and `useAuiState` compares\n // snapshots with `Object.is`, so selecting the reader's result directly\n // would re-render on every store update and trip React's update-depth\n // guard.\n const message = useAuiState((s) => s.message);\n const runtime = useMemo(() => readRuntimeMessageFromSourceMessages(message), [message]);\n if (!runtime || runtime.silent) return null;\n if (placement === \"row\" && !runtime.isSoleSourceMessage) return null;\n if (placement === \"banner\" && runtime.isSoleSourceMessage && runtime.kind !== \"handoff\") {\n return null;\n }\n return <RuntimeMessageCard message={runtime} action={runtimeMessageAction} />;\n };\n\n const AssistantMessage: FC = () => {\n // An assistant row exists before its first token streams; showing\n // copy/regenerate against nothing looks broken, so wait for content.\n const showActions = useAuiState((state) =>\n hasVisibleContent(state.message.content),\n );\n // Primitive selector: the reader builds a fresh object per call.\n const soleRuntimeKind = useAuiState((s) => readSoleRuntimeMessageKind(s.message));\n const soleRuntimeSilent = useAuiState(\n (s) => readRuntimeMessageFromSourceMessages(s.message)?.silent === true,\n );\n\n if (soleRuntimeKind && soleRuntimeKind !== \"handoff\") {\n if (soleRuntimeSilent) return null;\n return (\n <MessagePrimitive.Root\n data-message-role=\"assistant\"\n className=\"group group/assistant-message mb-3\"\n >\n <div className=\"max-w-[95%]\">\n <RuntimeEnding placement=\"row\" />\n </div>\n </MessagePrimitive.Root>\n );\n }\n\n return (\n <MessagePrimitive.Root\n data-message-role=\"assistant\"\n className=\"group group/assistant-message mb-3\"\n >\n <div className=\"max-w-[95%]\">\n <RuntimeEnding placement=\"banner\" />\n {Content ? (\n <Content />\n ) : (\n <MessagePrimitive.Content\n components={{\n Text: MarkdownText,\n tools: { Fallback: toolFallback },\n }}\n />\n )}\n {showActions ? (\n <div className=\"flex min-h-6 items-center gap-1\">\n <BranchPicker />\n <AssistantActionBar />\n </div>\n ) : null}\n </div>\n </MessagePrimitive.Root>\n );\n };\n\n return AssistantMessage;\n}\n\n/** Composer chrome: the dock around the composer, its surface and its rows. */\nexport const COMPOSER_DOCK_CLASS = \"bg-background px-2.5 pb-2 pt-1.5\";\nexport const COMPOSER_SURFACE_CLASS =\n \"relative flex flex-col gap-1 rounded-xl border border-neutral-200 bg-white shadow-[0_2px_10px_rgba(54,45,33,0.08)]\";\nexport const COMPOSER_EDITOR_ROW_CLASS = \"px-2.5 pt-1\";\nexport const COMPOSER_TOOLBAR_CLASS =\n \"flex items-center gap-1 border-t border-neutral-100 px-2 py-1.5\";\n/**\n * Paper composer chrome (`ChatComposerDock appearance=\"paper\"`): a card-toned\n * surface with a larger radius, a focus-within ring, a drag-over tint keyed\n * off `data-drag-active`, and a bottom rail — the chrome the SDK's\n * `AthenaChat` thread renders. Hosts on the default chrome above are\n * untouched. The dock carries no padding of its own; the paper host's footer\n * spaces it. The radius and border colour also bind to the `--composer-radius`\n * / `--composer-border` theme variables in `styles.css`.\n */\nexport const COMPOSER_PAPER_DOCK_CLASS = \"aui-composer-dock\";\nexport const COMPOSER_PAPER_SURFACE_CLASS =\n \"aui-composer-root relative flex w-full flex-col rounded-[1.375rem] border border-border bg-card p-2.5 text-card-foreground shadow-[0_1px_2px_rgba(0,0,0,0.04)] outline-none transition-shadow duration-150 focus-within:shadow-[0_8px_24px_-14px_rgba(0,0,0,0.25)] focus-within:ring-2 focus-within:ring-ring/40 data-[drag-active=true]:bg-primary/5 data-[drag-active=true]:ring-2 data-[drag-active=true]:ring-primary/40\";\nexport const COMPOSER_PAPER_EDITOR_ROW_CLASS = \"px-0.5\";\nexport const COMPOSER_PAPER_TOOLBAR_CLASS =\n \"aui-composer-action-wrapper relative flex items-center justify-between gap-1 pt-1\";\nexport const THREAD_SCROLL_TO_BOTTOM_CLASS =\n \"inline-flex items-center justify-center rounded-full border bg-background/80 p-1 shadow-sm backdrop-blur transition-opacity hover:bg-accent disabled:invisible\";\n\nconst ComposerStopIcon: FC = () => (\n <svg\n aria-hidden=\"true\"\n className=\"size-4\"\n viewBox=\"0 0 16 16\"\n fill=\"currentColor\"\n >\n <rect width=\"10\" height=\"10\" x=\"3\" y=\"3\" rx=\"2\" />\n </svg>\n);\n\nexport interface ComposerStopButtonProps {\n onStop: () => void;\n disabled?: boolean;\n title?: string;\n}\n\nexport interface ComposerSendButtonProps {\n action: Extract<ComposerAction, \"send\" | \"queue\">;\n onSend: () => void;\n disabled?: boolean;\n title?: string;\n}\n\n/** Stop control shown while a run is in flight and there is nothing queued. */\nexport const ComposerStopButton: FC<ComposerStopButtonProps> = ({\n onStop,\n disabled = false,\n title = \"Stop generation\",\n}) => (\n <button\n type=\"button\"\n onClick={onStop}\n disabled={disabled}\n title={title}\n className={cn(\n \"inline-flex size-8 shrink-0 items-center justify-center rounded-lg bg-foreground text-background shadow-sm transition-colors hover:bg-foreground/80\",\n disabled && \"cursor-not-allowed opacity-60\",\n )}\n >\n <ComposerStopIcon />\n </button>\n);\n/** Send control, which becomes a queue control while a run is in flight. */\nexport const ComposerSendButton: FC<ComposerSendButtonProps> = ({\n action,\n onSend,\n disabled = false,\n title,\n}) => (\n <button\n type=\"button\"\n onClick={onSend}\n disabled={disabled}\n title={title ?? (action === \"queue\" ? \"Queue message\" : \"Send\")}\n className={cn(\n \"inline-flex size-8 shrink-0 items-center justify-center rounded-full shadow-sm transition-colors\",\n disabled\n ? \"cursor-not-allowed bg-muted text-muted-foreground opacity-60\"\n : \"bg-foreground text-background hover:bg-foreground/80\",\n )}\n >\n {action === \"queue\" ? (\n <ListPlusIcon className=\"size-4\" />\n ) : (\n <ArrowUpIc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AAkB;AAAA,IACxD,WAAW;AAAA,MACT;AAAA,MACA,WACI,iEACA;AAAA,IAAA;AAAA,IAGL,UAAA,WAAW,UACV,oBAAC,cAAA,EAAa,WAAU,UAAS,IAEjC,oBAAC,aAAA,EAAY,WAAU,SAAA,CAAS;AAAA,EAAA;AAEpC;"}
|
|
@@ -38,7 +38,7 @@ const RuntimeMessageCard = ({
|
|
|
38
38
|
),
|
|
39
39
|
children: [
|
|
40
40
|
/* @__PURE__ */ jsxRuntime.jsx(Icon, { className: "mt-0.5 size-4 shrink-0", "aria-hidden": "true" }),
|
|
41
|
-
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex min-w-0 flex-1 flex-col gap-0.5
|
|
41
|
+
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex min-w-0 flex-1 flex-col gap-0.5 [overflow-wrap:anywhere]", children: [
|
|
42
42
|
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "font-medium", children: message.title }),
|
|
43
43
|
message.detail ? /* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-xs opacity-90", children: message.detail }) : null,
|
|
44
44
|
markerText ? /* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-xs opacity-90", children: markerText }) : null
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"runtime-message.cjs","sources":["../../../src/chat-ui/messages/runtime-message.tsx"],"sourcesContent":["/**\n * Shared DOM rendering for a runtime ending (see\n * `@athenaintel/agent-runtime`'s `runtime-messages.ts`): the status row for a\n * stop / pause / failure, and the banner that frames a handoff summary. Hosts\n * that build their assistant row with `createAssistantMessage` get these for\n * free; hosts with their own row (Olympus, mobile) render their own presenter\n * from the same {@link AthenaRuntimeMessage} so the taxonomy cannot drift.\n */\nimport {\n type AthenaRuntimeMessage,\n type AthenaRuntimeMessageSeverity,\n runtimeMessageMarkerText,\n} from \"@athenaintel/agent-runtime\";\nimport { AlertTriangleIcon, OctagonXIcon, PauseIcon, SquareIcon } from \"lucide-react\";\nimport type { ComponentPropsWithoutRef, FC, ReactNode } from \"react\";\nimport { cn } from \"../../lib/utils\";\n\nconst SEVERITY_CLASS: Record<AthenaRuntimeMessageSeverity, string> = {\n info: \"border-border bg-muted/40 text-muted-foreground\",\n warning: \"border-amber-200 bg-amber-50 text-amber-900\",\n error: \"border-red-200 bg-red-50 text-red-800\",\n};\n\nconst KIND_ICON: Record<AthenaRuntimeMessage[\"kind\"], FC<{ className?: string }>> = {\n stopped: SquareIcon,\n paused: PauseIcon,\n failed: OctagonXIcon,\n handoff: AlertTriangleIcon,\n};\n\nexport interface RuntimeMessageCardProps\n extends Omit<ComponentPropsWithoutRef<\"div\">, \"children\" | \"role\"> {\n message: AthenaRuntimeMessage;\n /** An inline affordance (e.g. a Continue button) rendered inside the card. */\n action?: ReactNode;\n}\n\n/**\n * The status row for a runtime ending. For `stopped` / `paused` / `failed` it\n * replaces the assistant bubble; for `handoff` it sits above the closing\n * summary, which keeps rendering as ordinary prose.\n */\nexport const RuntimeMessageCard: FC<RuntimeMessageCardProps> = ({\n message,\n action,\n className,\n ...rest\n}) => {\n if (message.silent) return null;\n const Icon = KIND_ICON[message.kind];\n const markerText = runtimeMessageMarkerText(message);\n return (\n <div\n {...rest}\n role=\"status\"\n data-runtime-message-kind={message.kind}\n data-runtime-message-reason={message.reason}\n className={cn(\n \"my-2 flex w-full items-start gap-2 rounded-lg border px-3 py-2 text-sm\",\n SEVERITY_CLASS[message.severity],\n className,\n )}\n >\n <Icon className=\"mt-0.5 size-4 shrink-0\" aria-hidden=\"true\" />\n <div className=\"flex min-w-0 flex-1 flex-col gap-0.5
|
|
1
|
+
{"version":3,"file":"runtime-message.cjs","sources":["../../../src/chat-ui/messages/runtime-message.tsx"],"sourcesContent":["/**\n * Shared DOM rendering for a runtime ending (see\n * `@athenaintel/agent-runtime`'s `runtime-messages.ts`): the status row for a\n * stop / pause / failure, and the banner that frames a handoff summary. Hosts\n * that build their assistant row with `createAssistantMessage` get these for\n * free; hosts with their own row (Olympus, mobile) render their own presenter\n * from the same {@link AthenaRuntimeMessage} so the taxonomy cannot drift.\n */\nimport {\n type AthenaRuntimeMessage,\n type AthenaRuntimeMessageSeverity,\n runtimeMessageMarkerText,\n} from \"@athenaintel/agent-runtime\";\nimport { AlertTriangleIcon, OctagonXIcon, PauseIcon, SquareIcon } from \"lucide-react\";\nimport type { ComponentPropsWithoutRef, FC, ReactNode } from \"react\";\nimport { cn } from \"../../lib/utils\";\n\nconst SEVERITY_CLASS: Record<AthenaRuntimeMessageSeverity, string> = {\n info: \"border-border bg-muted/40 text-muted-foreground\",\n warning: \"border-amber-200 bg-amber-50 text-amber-900\",\n error: \"border-red-200 bg-red-50 text-red-800\",\n};\n\nconst KIND_ICON: Record<AthenaRuntimeMessage[\"kind\"], FC<{ className?: string }>> = {\n stopped: SquareIcon,\n paused: PauseIcon,\n failed: OctagonXIcon,\n handoff: AlertTriangleIcon,\n};\n\nexport interface RuntimeMessageCardProps\n extends Omit<ComponentPropsWithoutRef<\"div\">, \"children\" | \"role\"> {\n message: AthenaRuntimeMessage;\n /** An inline affordance (e.g. a Continue button) rendered inside the card. */\n action?: ReactNode;\n}\n\n/**\n * The status row for a runtime ending. For `stopped` / `paused` / `failed` it\n * replaces the assistant bubble; for `handoff` it sits above the closing\n * summary, which keeps rendering as ordinary prose.\n */\nexport const RuntimeMessageCard: FC<RuntimeMessageCardProps> = ({\n message,\n action,\n className,\n ...rest\n}) => {\n if (message.silent) return null;\n const Icon = KIND_ICON[message.kind];\n const markerText = runtimeMessageMarkerText(message);\n return (\n <div\n {...rest}\n role=\"status\"\n data-runtime-message-kind={message.kind}\n data-runtime-message-reason={message.reason}\n className={cn(\n \"my-2 flex w-full items-start gap-2 rounded-lg border px-3 py-2 text-sm\",\n SEVERITY_CLASS[message.severity],\n className,\n )}\n >\n <Icon className=\"mt-0.5 size-4 shrink-0\" aria-hidden=\"true\" />\n <div className=\"flex min-w-0 flex-1 flex-col gap-0.5 [overflow-wrap:anywhere]\">\n <span className=\"font-medium\">{message.title}</span>\n {message.detail ? <span className=\"text-xs opacity-90\">{message.detail}</span> : null}\n {markerText ? <span className=\"text-xs opacity-90\">{markerText}</span> : null}\n </div>\n {action}\n </div>\n );\n};\n"],"names":["SquareIcon","PauseIcon","OctagonXIcon","AlertTriangleIcon","runtimeMessageMarkerText","jsxs","cn","jsx"],"mappings":";;;;;;AAiBA,MAAM,iBAA+D;AAAA,EACnE,MAAM;AAAA,EACN,SAAS;AAAA,EACT,OAAO;AACT;AAEA,MAAM,YAA8E;AAAA,EAClF,SAASA,YAAAA;AAAAA,EACT,QAAQC,YAAAA;AAAAA,EACR,QAAQC,YAAAA;AAAAA,EACR,SAASC,YAAAA;AACX;AAcO,MAAM,qBAAkD,CAAC;AAAA,EAC9D;AAAA,EACA;AAAA,EACA;AAAA,EACA,GAAG;AACL,MAAM;AACJ,MAAI,QAAQ,OAAQ,QAAO;AAC3B,QAAM,OAAO,UAAU,QAAQ,IAAI;AACnC,QAAM,aAAaC,gBAAAA,yBAAyB,OAAO;AACnD,SACEC,2BAAAA;AAAAA,IAAC;AAAA,IAAA;AAAA,MACE,GAAG;AAAA,MACJ,MAAK;AAAA,MACL,6BAA2B,QAAQ;AAAA,MACnC,+BAA6B,QAAQ;AAAA,MACrC,WAAWC,OAAAA;AAAAA,QACT;AAAA,QACA,eAAe,QAAQ,QAAQ;AAAA,QAC/B;AAAA,MAAA;AAAA,MAGF,UAAA;AAAA,QAAAC,2BAAAA,IAAC,MAAA,EAAK,WAAU,0BAAyB,eAAY,QAAO;AAAA,QAC5DF,2BAAAA,KAAC,OAAA,EAAI,WAAU,iEACb,UAAA;AAAA,UAAAE,2BAAAA,IAAC,QAAA,EAAK,WAAU,eAAe,UAAA,QAAQ,OAAM;AAAA,UAC5C,QAAQ,SAASA,+BAAC,QAAA,EAAK,WAAU,sBAAsB,UAAA,QAAQ,QAAO,IAAU;AAAA,UAChF,aAAaA,2BAAAA,IAAC,QAAA,EAAK,WAAU,sBAAsB,sBAAW,IAAU;AAAA,QAAA,GAC3E;AAAA,QACC;AAAA,MAAA;AAAA,IAAA;AAAA,EAAA;AAGP;;"}
|
|
@@ -36,7 +36,7 @@ const RuntimeMessageCard = ({
|
|
|
36
36
|
),
|
|
37
37
|
children: [
|
|
38
38
|
/* @__PURE__ */ jsx(Icon, { className: "mt-0.5 size-4 shrink-0", "aria-hidden": "true" }),
|
|
39
|
-
/* @__PURE__ */ jsxs("div", { className: "flex min-w-0 flex-1 flex-col gap-0.5
|
|
39
|
+
/* @__PURE__ */ jsxs("div", { className: "flex min-w-0 flex-1 flex-col gap-0.5 [overflow-wrap:anywhere]", children: [
|
|
40
40
|
/* @__PURE__ */ jsx("span", { className: "font-medium", children: message.title }),
|
|
41
41
|
message.detail ? /* @__PURE__ */ jsx("span", { className: "text-xs opacity-90", children: message.detail }) : null,
|
|
42
42
|
markerText ? /* @__PURE__ */ jsx("span", { className: "text-xs opacity-90", children: markerText }) : null
|