@actioneer/ads 0.5.6 → 0.5.8
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/bin/ads-init.mjs +6 -0
- package/components/accordion.js +50 -48
- package/components/agent-icon.d.ts +12 -0
- package/components/agent-icon.js +135 -121
- package/components/ai-elements/chain-of-thought-icon.d.ts +10 -12
- package/components/ai-elements/chain-of-thought-icon.js +341 -201
- package/components/ai-elements/chain-of-thought.d.ts +2 -2
- package/components/ai-elements/chain-of-thought.js +108 -108
- package/components/ai-elements/chart.js +16 -14
- package/components/ai-elements/inline-citation.js +41 -41
- package/components/ai-elements/message.js +4 -4
- package/components/ai-elements/queue.js +7 -7
- package/components/ai-elements/research-activity.js +114 -114
- package/components/ai-elements/shimmer.d.ts +2 -2
- package/components/ai-elements/speech-input.js +28 -28
- package/components/ai-elements/task-progress.js +26 -16
- package/components/ai-elements/task.js +17 -17
- package/components/ai-elements/tool.js +6 -6
- package/components/ai-elements/transcript.js +6 -5
- package/components/ai-elements/voice.js +1 -1
- package/components/alert.js +10 -10
- package/components/answer-sources.d.ts +42 -0
- package/components/answer-sources.js +111 -0
- package/components/answer.js +115 -114
- package/components/assistant-ui/action-bar.js +94 -48
- package/components/assistant-ui/attachment.js +131 -103
- package/components/assistant-ui/badge.d.ts +1 -1
- package/components/assistant-ui/badge.js +17 -17
- package/components/assistant-ui/chain-of-thought.d.ts +1 -1
- package/components/assistant-ui/composer-add-context.js +9 -9
- package/components/assistant-ui/composer-deep-research.js +5 -5
- package/components/assistant-ui/composer-harness.js +12 -9
- package/components/assistant-ui/composer-trigger-popover.js +45 -34
- package/components/assistant-ui/composer.js +59 -59
- package/components/assistant-ui/error.js +14 -14
- package/components/assistant-ui/file.d.ts +1 -1
- package/components/assistant-ui/image.d.ts +1 -1
- package/components/assistant-ui/image.js +113 -103
- package/components/assistant-ui/markdown-text.js +18 -18
- package/components/assistant-ui/message.js +46 -45
- package/components/assistant-ui/quote.js +1 -1
- package/components/assistant-ui/reasoning.d.ts +1 -1
- package/components/assistant-ui/reasoning.js +66 -77
- package/components/assistant-ui/suggestions.js +4 -4
- package/components/assistant-ui/thread-context.d.ts +2 -0
- package/components/assistant-ui/thread.js +41 -40
- package/components/assistant-ui/tool-fallback.js +60 -63
- package/components/assistant-ui/tool-group.d.ts +1 -1
- package/components/assistant-ui/tool-group.js +36 -42
- package/components/audio-waveform.js +25 -24
- package/components/autocomplete.d.ts +1 -0
- package/components/autocomplete.js +45 -43
- package/components/avatar.js +30 -30
- package/components/badge.d.ts +1 -1
- package/components/breadcrumbs.js +2 -2
- package/components/button.d.ts +2 -2
- package/components/button.js +22 -20
- package/components/card.js +8 -8
- package/components/carousel.js +105 -104
- package/components/chart.js +9 -7
- package/components/checkbox.js +74 -38
- package/components/chip.d.ts +1 -1
- package/components/code-block.js +3 -3
- package/components/collapsible.js +67 -23
- package/components/connector-card.js +6 -6
- package/components/drawer.d.ts +15 -10
- package/components/drawer.js +78 -77
- package/components/dropdown.d.ts +3 -1
- package/components/dropdown.js +88 -79
- package/components/empty-state.d.ts +4 -4
- package/components/empty-state.js +7 -7
- package/components/field.d.ts +4 -0
- package/components/field.js +45 -34
- package/components/file-dropzone.js +12 -12
- package/components/index.d.ts +4 -0
- package/components/index.js +584 -553
- package/components/infinite-canvas.js +1 -1
- package/components/input-field.js +51 -46
- package/components/input.js +20 -20
- package/components/link.js +9 -9
- package/components/modal.js +105 -73
- package/components/navbar.d.ts +1 -1
- package/components/navbar.js +1 -1
- package/components/number-field.js +38 -29
- package/components/page-header.js +12 -12
- package/components/pagination.js +19 -19
- package/components/panel.js +2 -2
- package/components/pixel-blast-svg.js +3 -3
- package/components/pixel-icon.d.ts +3 -1
- package/components/pixel-icon.js +294 -215
- package/components/popover.d.ts +1 -1
- package/components/popover.js +66 -64
- package/components/progress-circle.js +36 -32
- package/components/progress.js +28 -24
- package/components/radio.js +59 -49
- package/components/resizable-panel.js +1 -1
- package/components/reveal.d.ts +2 -2
- package/components/ripple.d.ts +3 -3
- package/components/scroll-area.js +17 -16
- package/components/segmented.d.ts +4 -1
- package/components/segmented.js +26 -25
- package/components/select.d.ts +2 -0
- package/components/select.js +61 -57
- package/components/setting-row.js +45 -42
- package/components/sidebar.d.ts +2 -2
- package/components/sidebar.js +131 -127
- package/components/skeleton.js +5 -5
- package/components/spinner.d.ts +13 -4
- package/components/spinner.js +42 -42
- package/components/stepper.js +21 -21
- package/components/switch.js +52 -32
- package/components/table.d.ts +24 -7
- package/components/table.js +457 -220
- package/components/tabs.js +149 -137
- package/components/textarea.js +1 -2
- package/components/toast.js +66 -66
- package/components/tooltip.js +2 -2
- package/components/tree.js +62 -51
- package/components/typography.d.ts +2 -1
- package/components/typography.js +33 -32
- package/components/ui/button.d.ts +2 -2
- package/components/ui/button.js +19 -19
- package/components/ui/collapsible.d.ts +1 -5
- package/components/ui/dialog.d.ts +3 -3
- package/components/ui/dialog.js +95 -58
- package/components/ui/tooltip.d.ts +2 -2
- package/components/ui/tooltip.js +67 -33
- package/components/viz-charts.js +95 -95
- package/demo/components/add-to-artifact.js +341 -0
- package/demo/lib/artifact-library.js +134 -0
- package/fonts/aribau-grotesk-medium.woff2 +0 -0
- package/fonts/aribau-grotesk-regular.woff2 +0 -0
- package/fonts.css +11 -11
- package/hooks/agents-ui/use-agent-audio-visualizer-aura.js +17 -16
- package/hooks/agents-ui/use-agent-audio-visualizer-wave.js +21 -20
- package/lib/icons.d.ts +12 -0
- package/lib/icons.js +107 -104
- package/lib/motion.d.ts +42 -39
- package/lib/motion.js +112 -52
- package/lib/spinner-mark.d.ts +9 -0
- package/lib/spinner-mark.js +98 -0
- package/llms.txt +69 -26
- package/manifest.json +344 -42
- package/package.json +1 -1
- package/styles.css +175 -161
- package/theme.css +104 -128
- package/components/ui/collapsible.js +0 -35
- package/fonts/aribau-grotesk-500.otf +0 -0
- package/fonts/aribau-grotesk-600.woff2 +0 -0
|
@@ -1,30 +1,31 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import { jsxs as
|
|
2
|
+
import { jsxs as r, jsx as t } from "react/jsx-runtime";
|
|
3
3
|
import { UserMessageAttachments as h } from "./attachment.js";
|
|
4
4
|
import { AssistantActionBar as T, UserActionBar as x } from "./action-bar.js";
|
|
5
|
-
import { BranchPicker as
|
|
5
|
+
import { BranchPicker as p } from "./branch-picker.js";
|
|
6
6
|
import { EditComposer as v } from "./composer.js";
|
|
7
7
|
import { MessageError as b } from "./error.js";
|
|
8
8
|
import { QuoteBlock as A } from "./quote.js";
|
|
9
|
-
import { Reasoning as _, ReasoningRoot as y, ReasoningTrigger as w, ReasoningContent as R, ReasoningText as
|
|
10
|
-
import { MarkdownText as
|
|
11
|
-
import { ThreadComponentsContext as
|
|
9
|
+
import { Reasoning as _, ReasoningRoot as y, ReasoningTrigger as w, ReasoningContent as R, ReasoningText as C } from "./reasoning.js";
|
|
10
|
+
import { MarkdownText as N } from "./markdown-text.js";
|
|
11
|
+
import { ThreadComponentsContext as d } from "./thread-context.js";
|
|
12
12
|
import { ToolFallback as k } from "./tool-fallback.js";
|
|
13
13
|
import { ToolGroupRoot as B, ToolGroupTrigger as M, ToolGroupContent as G } from "./tool-group.js";
|
|
14
14
|
import { createDirectiveText as I } from "./directive-text.js";
|
|
15
|
-
import {
|
|
16
|
-
import {
|
|
17
|
-
import {
|
|
15
|
+
import { Spinner as O } from "../spinner.js";
|
|
16
|
+
import { cn as l } from "../../lib/cn.js";
|
|
17
|
+
import { At as E, FileText as P, Bolt as U, Table as F } from "../../lib/icons.js";
|
|
18
|
+
import { unstable_defaultDirectiveFormatter as j, MessagePrimitive as i, groupPartByType as z, useAuiState as g } from "@assistant-ui/react";
|
|
18
19
|
import { useContext as f } from "react";
|
|
19
20
|
const H = I(
|
|
20
|
-
|
|
21
|
+
j,
|
|
21
22
|
{
|
|
22
|
-
iconMap: { table:
|
|
23
|
-
fallbackIcon:
|
|
23
|
+
iconMap: { table: F, skill: U, file: P },
|
|
24
|
+
fallbackIcon: E
|
|
24
25
|
}
|
|
25
|
-
),
|
|
26
|
-
const { AssistantMessage: o = q } = f(
|
|
27
|
-
return g((s) => s.message.composer.isEditing) ? /* @__PURE__ */ t(v, {}) : n === "user" ? /* @__PURE__ */ t(
|
|
26
|
+
), ct = () => {
|
|
27
|
+
const { AssistantMessage: o = q } = f(d), n = g((s) => s.message.role);
|
|
28
|
+
return g((s) => s.message.composer.isEditing) ? /* @__PURE__ */ t(v, {}) : n === "user" ? /* @__PURE__ */ t(D, {}) : /* @__PURE__ */ t(o, {});
|
|
28
29
|
}, q = () => {
|
|
29
30
|
const {
|
|
30
31
|
AssistantAvatar: o,
|
|
@@ -32,14 +33,14 @@ const H = I(
|
|
|
32
33
|
ToolGroup: u,
|
|
33
34
|
ReasoningGroup: s,
|
|
34
35
|
ChainOfThoughtGroup: m
|
|
35
|
-
} = f(
|
|
36
|
-
return /* @__PURE__ */
|
|
36
|
+
} = f(d);
|
|
37
|
+
return /* @__PURE__ */ r(
|
|
37
38
|
i.Root,
|
|
38
39
|
{
|
|
39
40
|
"data-slot": "aui_assistant-message-root",
|
|
40
41
|
"data-role": "assistant",
|
|
41
|
-
className:
|
|
42
|
-
"fade-in slide-in-from-bottom-1 animate-in relative -mb-7.5 pb-7.5 duration-
|
|
42
|
+
className: l(
|
|
43
|
+
"fade-in slide-in-from-bottom-1 animate-in relative -mb-7.5 pb-7.5 duration-150 [contain-intrinsic-size:auto_200px] [content-visibility:auto]",
|
|
43
44
|
o && "grid grid-cols-[2rem_minmax(0,1fr)] items-start gap-x-2"
|
|
44
45
|
),
|
|
45
46
|
children: [
|
|
@@ -51,11 +52,11 @@ const H = I(
|
|
|
51
52
|
children: /* @__PURE__ */ t(o, {})
|
|
52
53
|
}
|
|
53
54
|
),
|
|
54
|
-
/* @__PURE__ */
|
|
55
|
+
/* @__PURE__ */ r(
|
|
55
56
|
"div",
|
|
56
57
|
{
|
|
57
58
|
"data-slot": "aui_assistant-message-content",
|
|
58
|
-
className:
|
|
59
|
+
className: l(
|
|
59
60
|
"text-foreground px-2 leading-relaxed wrap-break-word",
|
|
60
61
|
o && "col-start-2 row-start-1"
|
|
61
62
|
),
|
|
@@ -63,17 +64,17 @@ const H = I(
|
|
|
63
64
|
/* @__PURE__ */ t(
|
|
64
65
|
i.GroupedParts,
|
|
65
66
|
{
|
|
66
|
-
groupBy:
|
|
67
|
+
groupBy: z({
|
|
67
68
|
reasoning: ["group-chainOfThought", "group-reasoning"],
|
|
68
69
|
"tool-call": ["group-chainOfThought", "group-tool"],
|
|
69
70
|
"standalone-tool-call": []
|
|
70
71
|
}),
|
|
71
|
-
children: ({ part: e, children:
|
|
72
|
+
children: ({ part: e, children: a }) => {
|
|
72
73
|
switch (e.type) {
|
|
73
74
|
case "group-chainOfThought":
|
|
74
|
-
return m ? /* @__PURE__ */ t(m, { group: e, children:
|
|
75
|
+
return m ? /* @__PURE__ */ t(m, { group: e, children: a }) : /* @__PURE__ */ t("div", { "data-slot": "aui_chain-of-thought", children: a });
|
|
75
76
|
case "group-tool":
|
|
76
|
-
return u ? /* @__PURE__ */ t(u, { group: e, children:
|
|
77
|
+
return u ? /* @__PURE__ */ t(u, { group: e, children: a }) : /* @__PURE__ */ r(B, { variant: "ghost", children: [
|
|
77
78
|
/* @__PURE__ */ t(
|
|
78
79
|
M,
|
|
79
80
|
{
|
|
@@ -81,19 +82,19 @@ const H = I(
|
|
|
81
82
|
active: e.status.type === "running"
|
|
82
83
|
}
|
|
83
84
|
),
|
|
84
|
-
/* @__PURE__ */ t(G, { children:
|
|
85
|
+
/* @__PURE__ */ t(G, { children: a })
|
|
85
86
|
] });
|
|
86
87
|
case "group-reasoning": {
|
|
87
88
|
if (s)
|
|
88
|
-
return /* @__PURE__ */ t(s, { group: e, children:
|
|
89
|
-
const
|
|
90
|
-
return /* @__PURE__ */
|
|
91
|
-
/* @__PURE__ */ t(w, { active:
|
|
92
|
-
/* @__PURE__ */ t(R, { "aria-busy":
|
|
89
|
+
return /* @__PURE__ */ t(s, { group: e, children: a });
|
|
90
|
+
const c = e.status.type === "running";
|
|
91
|
+
return /* @__PURE__ */ r(y, { streaming: c, children: [
|
|
92
|
+
/* @__PURE__ */ t(w, { active: c }),
|
|
93
|
+
/* @__PURE__ */ t(R, { "aria-busy": c, children: /* @__PURE__ */ t(C, { children: a }) })
|
|
93
94
|
] });
|
|
94
95
|
}
|
|
95
96
|
case "text":
|
|
96
|
-
return /* @__PURE__ */ t(
|
|
97
|
+
return /* @__PURE__ */ t(N, {});
|
|
97
98
|
case "reasoning":
|
|
98
99
|
return /* @__PURE__ */ t(_, { ...e });
|
|
99
100
|
case "tool-call":
|
|
@@ -102,12 +103,12 @@ const H = I(
|
|
|
102
103
|
return e.dataRendererUI;
|
|
103
104
|
case "indicator":
|
|
104
105
|
return /* @__PURE__ */ t(
|
|
105
|
-
|
|
106
|
+
O,
|
|
106
107
|
{
|
|
107
108
|
"data-slot": "aui_assistant-message-indicator",
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
109
|
+
variant: "action",
|
|
110
|
+
size: "sm",
|
|
111
|
+
label: "Assistant is working"
|
|
111
112
|
}
|
|
112
113
|
);
|
|
113
114
|
default:
|
|
@@ -120,17 +121,17 @@ const H = I(
|
|
|
120
121
|
]
|
|
121
122
|
}
|
|
122
123
|
),
|
|
123
|
-
/* @__PURE__ */
|
|
124
|
+
/* @__PURE__ */ r(
|
|
124
125
|
"div",
|
|
125
126
|
{
|
|
126
127
|
"data-slot": "aui_assistant-message-footer",
|
|
127
|
-
className:
|
|
128
|
+
className: l(
|
|
128
129
|
"ms-2 flex items-center",
|
|
129
130
|
"min-h-7.5 pt-1.5",
|
|
130
131
|
o && "col-start-2 row-start-2"
|
|
131
132
|
),
|
|
132
133
|
children: [
|
|
133
|
-
/* @__PURE__ */ t(
|
|
134
|
+
/* @__PURE__ */ t(p, {}),
|
|
134
135
|
/* @__PURE__ */ t(T, {})
|
|
135
136
|
]
|
|
136
137
|
}
|
|
@@ -138,14 +139,14 @@ const H = I(
|
|
|
138
139
|
]
|
|
139
140
|
}
|
|
140
141
|
);
|
|
141
|
-
},
|
|
142
|
+
}, D = () => /* @__PURE__ */ r(
|
|
142
143
|
i.Root,
|
|
143
144
|
{
|
|
144
145
|
"data-slot": "aui_user-message-root",
|
|
145
|
-
className: "fade-in slide-in-from-bottom-1 animate-in flex w-full flex-col gap-2 px-2 duration-
|
|
146
|
+
className: "fade-in slide-in-from-bottom-1 animate-in flex w-full flex-col gap-2 px-2 duration-150 [contain-intrinsic-size:auto_200px] [content-visibility:auto]",
|
|
146
147
|
"data-role": "user",
|
|
147
148
|
children: [
|
|
148
|
-
/* @__PURE__ */
|
|
149
|
+
/* @__PURE__ */ r("div", { className: "aui-user-message-content-wrapper group/user-request relative min-w-0", children: [
|
|
149
150
|
/* @__PURE__ */ t("div", { className: "aui-user-message-content peer text-foreground text-xl leading-snug wrap-break-word empty:hidden", children: /* @__PURE__ */ t(
|
|
150
151
|
i.Parts,
|
|
151
152
|
{
|
|
@@ -153,10 +154,10 @@ const H = I(
|
|
|
153
154
|
}
|
|
154
155
|
) }),
|
|
155
156
|
/* @__PURE__ */ t(h, {}),
|
|
156
|
-
/* @__PURE__ */ t("div", { className: "aui-user-action-bar-wrapper absolute end-0 top-0 opacity-0 transition-opacity duration-
|
|
157
|
+
/* @__PURE__ */ t("div", { className: "aui-user-action-bar-wrapper absolute end-0 top-0 opacity-0 transition-opacity duration-150 ease-out peer-empty:hidden group-hover/user-request:opacity-100 group-focus-within/user-request:opacity-100 motion-reduce:transition-none", children: /* @__PURE__ */ t(x, {}) })
|
|
157
158
|
] }),
|
|
158
159
|
/* @__PURE__ */ t(
|
|
159
|
-
|
|
160
|
+
p,
|
|
160
161
|
{
|
|
161
162
|
"data-slot": "aui_user-branch-picker",
|
|
162
163
|
className: "-ms-1 justify-start"
|
|
@@ -167,6 +168,6 @@ const H = I(
|
|
|
167
168
|
);
|
|
168
169
|
export {
|
|
169
170
|
q as AssistantMessage,
|
|
170
|
-
|
|
171
|
-
|
|
171
|
+
ct as ThreadMessage,
|
|
172
|
+
D as UserMessage
|
|
172
173
|
};
|
|
@@ -2,7 +2,7 @@ import { VariantProps } from 'class-variance-authority';
|
|
|
2
2
|
import { ReasoningMessagePartComponent } from '@assistant-ui/react';
|
|
3
3
|
import { Collapsible, CollapsibleContent, CollapsibleTrigger } from '../ui/collapsible';
|
|
4
4
|
declare const reasoningVariants: (props?: ({
|
|
5
|
-
variant?: "
|
|
5
|
+
variant?: "outline" | "muted" | "ghost" | null | undefined;
|
|
6
6
|
} & import('class-variance-authority/types').ClassProp) | undefined) => string;
|
|
7
7
|
export type ReasoningRootProps = Omit<React.ComponentProps<typeof Collapsible>, "open" | "onOpenChange"> & VariantProps<typeof reasoningVariants> & {
|
|
8
8
|
open?: boolean;
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import { jsx as
|
|
2
|
+
import { jsx as r, jsxs as d } from "react/jsx-runtime";
|
|
3
3
|
import { createContext as _, memo as T, useRef as m, useState as E, useLayoutEffect as M, useCallback as G, useContext as w, useEffect as j } from "react";
|
|
4
4
|
import { cva as D } from "class-variance-authority";
|
|
5
5
|
import { ChevronDown as F } from "../../lib/icons.js";
|
|
6
6
|
import { useScrollLock as L, useAuiState as U } from "@assistant-ui/react";
|
|
7
7
|
import { MarkdownText as V } from "./markdown-text.js";
|
|
8
|
-
import { Collapsible as H, CollapsibleTrigger as $, CollapsibleContent as q } from "../
|
|
8
|
+
import { Collapsible as H, CollapsibleTrigger as $, CollapsibleContent as q } from "../collapsible.js";
|
|
9
9
|
import { cn as u } from "../../lib/cn.js";
|
|
10
10
|
import { TraceStateIcon as B } from "../ai-elements/chain-of-thought-icon.js";
|
|
11
11
|
const J = 200, h = _(!1), K = D("aui-reasoning-root mb-4 w-full", {
|
|
@@ -21,48 +21,48 @@ const J = 200, h = _(!1), K = D("aui-reasoning-root mb-4 w-full", {
|
|
|
21
21
|
}
|
|
22
22
|
});
|
|
23
23
|
function k({
|
|
24
|
-
className:
|
|
25
|
-
variant:
|
|
26
|
-
open:
|
|
24
|
+
className: a,
|
|
25
|
+
variant: n,
|
|
26
|
+
open: o,
|
|
27
27
|
onOpenChange: e,
|
|
28
28
|
defaultOpen: i = !1,
|
|
29
|
-
streaming:
|
|
30
|
-
children:
|
|
29
|
+
streaming: t,
|
|
30
|
+
children: g,
|
|
31
31
|
...l
|
|
32
32
|
}) {
|
|
33
|
-
const s = m(null), f = m(i), [
|
|
33
|
+
const s = m(null), f = m(i), [v, z] = E(null), b = L(s, J), c = o !== void 0, R = c ? o : v ?? t ?? f.current, A = t === !0 && R && (c || v === null), N = m(t);
|
|
34
34
|
M(() => {
|
|
35
|
-
|
|
36
|
-
}, [
|
|
35
|
+
N.current !== t && (N.current = t, !c && v === null && b());
|
|
36
|
+
}, [t, c, v, b]);
|
|
37
37
|
const P = G(
|
|
38
|
-
(
|
|
39
|
-
|
|
38
|
+
(y) => {
|
|
39
|
+
b(), c || z(y), e == null || e(y);
|
|
40
40
|
},
|
|
41
|
-
[
|
|
41
|
+
[b, c, e]
|
|
42
42
|
);
|
|
43
|
-
return /* @__PURE__ */
|
|
43
|
+
return /* @__PURE__ */ r(
|
|
44
44
|
H,
|
|
45
45
|
{
|
|
46
46
|
ref: s,
|
|
47
47
|
"data-slot": "reasoning-root",
|
|
48
|
-
"data-variant":
|
|
48
|
+
"data-variant": n,
|
|
49
49
|
open: R,
|
|
50
50
|
onOpenChange: P,
|
|
51
51
|
className: u(
|
|
52
52
|
"group/reasoning-root",
|
|
53
|
-
K({ variant:
|
|
53
|
+
K({ variant: n, className: a })
|
|
54
54
|
),
|
|
55
55
|
...l,
|
|
56
|
-
children: /* @__PURE__ */
|
|
56
|
+
children: /* @__PURE__ */ r(h.Provider, { value: A, children: g })
|
|
57
57
|
}
|
|
58
58
|
);
|
|
59
59
|
}
|
|
60
60
|
function x({
|
|
61
|
-
side:
|
|
62
|
-
className:
|
|
63
|
-
...
|
|
61
|
+
side: a = "bottom",
|
|
62
|
+
className: n,
|
|
63
|
+
...o
|
|
64
64
|
}) {
|
|
65
|
-
return
|
|
65
|
+
return a === "top" ? /* @__PURE__ */ r(
|
|
66
66
|
"div",
|
|
67
67
|
{
|
|
68
68
|
"data-slot": "reasoning-fade",
|
|
@@ -71,12 +71,12 @@ function x({
|
|
|
71
71
|
"bg-[linear-gradient(to_bottom,var(--color-background),transparent)]",
|
|
72
72
|
"group-data-[variant=muted]/reasoning-root:bg-[linear-gradient(to_bottom,hsl(var(--muted)/0.5),transparent)]",
|
|
73
73
|
"fade-in-0 animate-in",
|
|
74
|
-
"duration-
|
|
75
|
-
|
|
74
|
+
"duration-200",
|
|
75
|
+
n
|
|
76
76
|
),
|
|
77
|
-
...
|
|
77
|
+
...o
|
|
78
78
|
}
|
|
79
|
-
) : /* @__PURE__ */
|
|
79
|
+
) : /* @__PURE__ */ r(
|
|
80
80
|
"div",
|
|
81
81
|
{
|
|
82
82
|
"data-slot": "reasoning-fade",
|
|
@@ -85,36 +85,36 @@ function x({
|
|
|
85
85
|
"bg-[linear-gradient(to_top,var(--color-background),transparent)]",
|
|
86
86
|
"group-data-[variant=muted]/reasoning-root:bg-[linear-gradient(to_top,hsl(var(--muted)/0.5),transparent)]",
|
|
87
87
|
"fade-in-0 animate-in",
|
|
88
|
-
"duration-
|
|
89
|
-
|
|
88
|
+
"duration-200",
|
|
89
|
+
n
|
|
90
90
|
),
|
|
91
|
-
...
|
|
91
|
+
...o
|
|
92
92
|
}
|
|
93
93
|
);
|
|
94
94
|
}
|
|
95
95
|
function C({
|
|
96
|
-
active:
|
|
97
|
-
duration:
|
|
98
|
-
className:
|
|
96
|
+
active: a,
|
|
97
|
+
duration: n,
|
|
98
|
+
className: o,
|
|
99
99
|
...e
|
|
100
100
|
}) {
|
|
101
|
-
const i =
|
|
101
|
+
const i = n ? ` (${n}s)` : "";
|
|
102
102
|
return /* @__PURE__ */ d(
|
|
103
103
|
$,
|
|
104
104
|
{
|
|
105
105
|
"data-slot": "reasoning-trigger",
|
|
106
106
|
className: u(
|
|
107
107
|
"aui-reasoning-trigger group/trigger text-muted-foreground hover:text-foreground flex max-w-[75%] origin-left items-center gap-2 py-1.5 text-xs transition-[color,scale] active:scale-[0.98]",
|
|
108
|
-
|
|
108
|
+
o
|
|
109
109
|
),
|
|
110
110
|
...e,
|
|
111
111
|
children: [
|
|
112
|
-
/* @__PURE__ */
|
|
112
|
+
/* @__PURE__ */ r(
|
|
113
113
|
B,
|
|
114
114
|
{
|
|
115
115
|
"data-slot": "reasoning-trigger-icon",
|
|
116
116
|
stage: "thinking",
|
|
117
|
-
status:
|
|
117
|
+
status: a ? "active" : "complete",
|
|
118
118
|
className: "aui-reasoning-trigger-icon size-4 shrink-0",
|
|
119
119
|
"aria-hidden": !0
|
|
120
120
|
}
|
|
@@ -129,7 +129,7 @@ function C({
|
|
|
129
129
|
"Reasoning",
|
|
130
130
|
i
|
|
131
131
|
] }),
|
|
132
|
-
|
|
132
|
+
a ? /* @__PURE__ */ d(
|
|
133
133
|
"span",
|
|
134
134
|
{
|
|
135
135
|
"aria-hidden": !0,
|
|
@@ -144,13 +144,13 @@ function C({
|
|
|
144
144
|
]
|
|
145
145
|
}
|
|
146
146
|
),
|
|
147
|
-
/* @__PURE__ */
|
|
147
|
+
/* @__PURE__ */ r(
|
|
148
148
|
F,
|
|
149
149
|
{
|
|
150
150
|
"data-slot": "reasoning-trigger-chevron",
|
|
151
151
|
className: u(
|
|
152
152
|
"aui-reasoning-trigger-chevron mt-0.5 size-4 shrink-0",
|
|
153
|
-
"transition-transform duration-
|
|
153
|
+
"transition-transform duration-200 ease-out motion-reduce:transition-none",
|
|
154
154
|
"group-data-[state=closed]/trigger:-rotate-90",
|
|
155
155
|
"group-data-[state=open]/trigger:rotate-0"
|
|
156
156
|
)
|
|
@@ -161,9 +161,9 @@ function C({
|
|
|
161
161
|
);
|
|
162
162
|
}
|
|
163
163
|
function I({
|
|
164
|
-
className:
|
|
165
|
-
children:
|
|
166
|
-
...
|
|
164
|
+
className: a,
|
|
165
|
+
children: n,
|
|
166
|
+
...o
|
|
167
167
|
}) {
|
|
168
168
|
const e = w(h);
|
|
169
169
|
return /* @__PURE__ */ d(
|
|
@@ -174,73 +174,62 @@ function I({
|
|
|
174
174
|
"aui-reasoning-content text-muted-foreground relative overflow-hidden text-xs outline-none",
|
|
175
175
|
"group/collapsible-content",
|
|
176
176
|
"data-[state=closed]:pointer-events-none",
|
|
177
|
-
|
|
177
|
+
a
|
|
178
178
|
),
|
|
179
|
-
...
|
|
179
|
+
...o,
|
|
180
180
|
children: [
|
|
181
|
-
/* @__PURE__ */
|
|
182
|
-
|
|
183
|
-
e ? /* @__PURE__ */
|
|
181
|
+
/* @__PURE__ */ r(x, { side: "top" }),
|
|
182
|
+
n,
|
|
183
|
+
e ? /* @__PURE__ */ r(x, {}) : null
|
|
184
184
|
]
|
|
185
185
|
}
|
|
186
186
|
);
|
|
187
187
|
}
|
|
188
188
|
function S({
|
|
189
|
-
className:
|
|
190
|
-
children:
|
|
191
|
-
...
|
|
189
|
+
className: a,
|
|
190
|
+
children: n,
|
|
191
|
+
...o
|
|
192
192
|
}) {
|
|
193
|
-
const e = w(h), i = m(null),
|
|
193
|
+
const e = w(h), i = m(null), t = m(null);
|
|
194
194
|
return j(() => {
|
|
195
195
|
if (!e) return;
|
|
196
|
-
const
|
|
197
|
-
if (!
|
|
196
|
+
const g = i.current, l = t.current;
|
|
197
|
+
if (!g || !l) return;
|
|
198
198
|
const s = () => {
|
|
199
|
-
|
|
199
|
+
g.scrollTop = g.scrollHeight;
|
|
200
200
|
};
|
|
201
201
|
s();
|
|
202
202
|
const f = new ResizeObserver(s);
|
|
203
203
|
return f.observe(l), () => f.disconnect();
|
|
204
|
-
}, [e]), /* @__PURE__ */
|
|
204
|
+
}, [e]), /* @__PURE__ */ r(
|
|
205
205
|
"div",
|
|
206
206
|
{
|
|
207
207
|
ref: i,
|
|
208
208
|
"data-slot": "reasoning-text",
|
|
209
209
|
className: u(
|
|
210
210
|
"aui-reasoning-text relative z-0 max-h-64 overflow-y-auto ps-6 pt-2 pb-2 leading-relaxed text-pretty",
|
|
211
|
-
"transform-gpu
|
|
212
|
-
|
|
213
|
-
"group-data-[state=open]/collapsible-content:animate-in",
|
|
214
|
-
"group-data-[state=closed]/collapsible-content:animate-out",
|
|
215
|
-
"group-data-[state=open]/collapsible-content:fade-in-0",
|
|
216
|
-
"group-data-[state=closed]/collapsible-content:fade-out-0",
|
|
217
|
-
"group-data-[state=open]/collapsible-content:slide-in-from-top-4",
|
|
218
|
-
"group-data-[state=closed]/collapsible-content:slide-out-to-top-4",
|
|
219
|
-
"group-data-[state=open]/collapsible-content:blur-in-[2px]",
|
|
220
|
-
"group-data-[state=closed]/collapsible-content:blur-out-[2px]",
|
|
221
|
-
"group-data-[state=open]/collapsible-content:duration-(--duration-normal)",
|
|
222
|
-
"group-data-[state=closed]/collapsible-content:duration-(--duration-normal)",
|
|
223
|
-
r
|
|
211
|
+
"transform-gpu",
|
|
212
|
+
a
|
|
224
213
|
),
|
|
225
|
-
...
|
|
226
|
-
children: /* @__PURE__ */
|
|
214
|
+
...o,
|
|
215
|
+
children: /* @__PURE__ */ r("div", { ref: t, className: "aui-reasoning-text-content space-y-4", children: n })
|
|
227
216
|
}
|
|
228
217
|
);
|
|
229
218
|
}
|
|
230
|
-
const Q = () => /* @__PURE__ */
|
|
231
|
-
children:
|
|
232
|
-
startIndex:
|
|
233
|
-
endIndex:
|
|
219
|
+
const Q = () => /* @__PURE__ */ r(V, {}), W = ({
|
|
220
|
+
children: a,
|
|
221
|
+
startIndex: n,
|
|
222
|
+
endIndex: o
|
|
234
223
|
}) => {
|
|
235
224
|
const e = U((i) => {
|
|
236
225
|
var l, s;
|
|
237
226
|
if (((l = i.message.status) == null ? void 0 : l.type) !== "running") return !1;
|
|
238
|
-
const
|
|
239
|
-
return
|
|
227
|
+
const t = i.message.parts.length - 1;
|
|
228
|
+
return t < 0 || ((s = i.message.parts[t]) == null ? void 0 : s.type) !== "reasoning" ? !1 : t >= n && t <= o;
|
|
240
229
|
});
|
|
241
230
|
return /* @__PURE__ */ d(k, { streaming: e, children: [
|
|
242
|
-
/* @__PURE__ */
|
|
243
|
-
/* @__PURE__ */
|
|
231
|
+
/* @__PURE__ */ r(C, { active: e }),
|
|
232
|
+
/* @__PURE__ */ r(I, { "aria-busy": e, children: /* @__PURE__ */ r(S, { children: a }) })
|
|
244
233
|
] });
|
|
245
234
|
}, p = T(
|
|
246
235
|
Q
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import { jsx as e, jsxs as
|
|
3
|
-
import { Button as
|
|
2
|
+
import { jsx as e, jsxs as i } from "react/jsx-runtime";
|
|
3
|
+
import { Button as r } from "../ui/button.js";
|
|
4
4
|
import { SuggestionPrimitive as t, ThreadPrimitive as o } from "@assistant-ui/react";
|
|
5
|
-
const l = () => /* @__PURE__ */ e("div", { className: "aui-thread-welcome-suggestions flex w-full flex-wrap items-center justify-center gap-2 px-4", children: /* @__PURE__ */ e(o.Suggestions, { children: () => /* @__PURE__ */ e(s, {}) }) }), s = () => /* @__PURE__ */ e("div", { className: "aui-thread-welcome-suggestion-display fade-in slide-in-from-bottom-2 animate-in fill-mode-both duration-
|
|
6
|
-
|
|
5
|
+
const l = () => /* @__PURE__ */ e("div", { className: "aui-thread-welcome-suggestions flex w-full flex-wrap items-center justify-center gap-2 px-4", children: /* @__PURE__ */ e(o.Suggestions, { children: () => /* @__PURE__ */ e(s, {}) }) }), s = () => /* @__PURE__ */ e("div", { className: "aui-thread-welcome-suggestion-display fade-in slide-in-from-bottom-2 animate-in fill-mode-both duration-200", children: /* @__PURE__ */ e(t.Trigger, { send: !0, asChild: !0, children: /* @__PURE__ */ i(
|
|
6
|
+
r,
|
|
7
7
|
{
|
|
8
8
|
variant: "ghost",
|
|
9
9
|
className: "aui-thread-welcome-suggestion text-foreground hover:bg-muted border-border/60 h-auto gap-1.5 rounded-full border px-3.5 py-1.5 text-xs font-normal whitespace-nowrap transition-colors",
|
|
@@ -33,6 +33,8 @@ export type ThreadProps = {
|
|
|
33
33
|
components?: ThreadComponents | undefined;
|
|
34
34
|
/** Registers ADS's typed `render_answer` Tool UI. Enabled by default. */
|
|
35
35
|
isAnswerToolEnabled?: boolean | undefined;
|
|
36
|
+
/** Keep the composer docked to the bottom even before the first message. */
|
|
37
|
+
composerPlacement?: "adaptive" | "bottom" | undefined;
|
|
36
38
|
};
|
|
37
39
|
export declare const EMPTY_COMPONENTS: ThreadComponents;
|
|
38
40
|
export declare const ThreadComponentsContext: import('react').Context<ThreadComponents>;
|