@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,57 +1,103 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import { jsxs as
|
|
3
|
-
import { MessageTiming as
|
|
4
|
-
import { TooltipIconButton as
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
2
|
+
import { jsxs as t, Fragment as p, jsx as e } from "react/jsx-runtime";
|
|
3
|
+
import { MessageTiming as f } from "./message-timing.js";
|
|
4
|
+
import { TooltipIconButton as r } from "./tooltip-icon-button.js";
|
|
5
|
+
import { AddToArtifact as h } from "../../demo/components/add-to-artifact.js";
|
|
6
|
+
import { assistantPartsToMarkdown as g } from "../../demo/lib/artifact-library.js";
|
|
7
|
+
import { ActionBarPrimitive as o, AuiIf as u, ActionBarMorePrimitive as n, useAuiState as x } from "@assistant-ui/react";
|
|
8
|
+
import { Check as b, Copy as A, Refresh as C, MoreHorizontal as w, LayoutGrid as N, Download as k, Pencil as v } from "../../lib/icons.js";
|
|
9
|
+
import { useState as M } from "react";
|
|
10
|
+
const z = ({ open: s, onOpenChange: i }) => {
|
|
11
|
+
var m;
|
|
12
|
+
const a = x((c) => c.message.parts), l = g(a), d = (m = l.split(`
|
|
13
|
+
`).find((c) => c.trim().length > 0)) == null ? void 0 : m.replace(/^#+\s*/, "");
|
|
14
|
+
return /* @__PURE__ */ e(
|
|
15
|
+
h,
|
|
16
|
+
{
|
|
17
|
+
trigger: "none",
|
|
18
|
+
open: s,
|
|
19
|
+
onOpenChange: i,
|
|
20
|
+
block: {
|
|
21
|
+
kind: "markdown",
|
|
22
|
+
title: (d == null ? void 0 : d.slice(0, 72)) || "Saved answer",
|
|
23
|
+
source: "Ask AI",
|
|
24
|
+
markdown: l
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
);
|
|
28
|
+
}, S = () => {
|
|
29
|
+
const [s, i] = M(!1);
|
|
30
|
+
return /* @__PURE__ */ t(p, { children: [
|
|
31
|
+
/* @__PURE__ */ t(
|
|
32
|
+
o.Root,
|
|
33
|
+
{
|
|
34
|
+
hideWhenRunning: !0,
|
|
35
|
+
autohide: "not-last",
|
|
36
|
+
className: "aui-assistant-action-bar-root text-muted-foreground animate-in fade-in col-start-3 row-start-2 -ms-1 flex gap-1 duration-200",
|
|
37
|
+
children: [
|
|
38
|
+
/* @__PURE__ */ e(o.Copy, { asChild: !0, children: /* @__PURE__ */ t(r, { tooltip: "Copy", children: [
|
|
39
|
+
/* @__PURE__ */ e(u, { condition: (a) => a.message.isCopied, children: /* @__PURE__ */ e(b, { className: "animate-in zoom-in-95 fade-in duration-200 ease-out motion-reduce:animate-none" }) }),
|
|
40
|
+
/* @__PURE__ */ e(u, { condition: (a) => !a.message.isCopied, children: /* @__PURE__ */ e(A, { className: "animate-in zoom-in-95 fade-in duration-150 ease-out motion-reduce:animate-none" }) })
|
|
41
|
+
] }) }),
|
|
42
|
+
/* @__PURE__ */ e(o.Reload, { asChild: !0, children: /* @__PURE__ */ e(r, { tooltip: "Refresh", children: /* @__PURE__ */ e(C, {}) }) }),
|
|
43
|
+
/* @__PURE__ */ e(f, {}),
|
|
44
|
+
/* @__PURE__ */ t(n.Root, { children: [
|
|
45
|
+
/* @__PURE__ */ e(n.Trigger, { asChild: !0, children: /* @__PURE__ */ e(
|
|
46
|
+
r,
|
|
47
|
+
{
|
|
48
|
+
tooltip: "More",
|
|
49
|
+
className: "data-[state=open]:bg-accent",
|
|
50
|
+
children: /* @__PURE__ */ e(w, {})
|
|
51
|
+
}
|
|
52
|
+
) }),
|
|
53
|
+
/* @__PURE__ */ t(
|
|
54
|
+
n.Content,
|
|
55
|
+
{
|
|
56
|
+
side: "bottom",
|
|
57
|
+
align: "start",
|
|
58
|
+
sideOffset: 6,
|
|
59
|
+
className: "aui-action-bar-more-content bg-popover/95 text-popover-foreground data-[state=open]:fade-in-0 data-[state=open]:zoom-in-95 data-[state=open]:animate-in data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[state=closed]:animate-out data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 z-50 min-w-[8rem] overflow-hidden rounded-xl border p-1.5 shadow-lg backdrop-blur-sm",
|
|
60
|
+
children: [
|
|
61
|
+
/* @__PURE__ */ t(
|
|
62
|
+
n.Item,
|
|
63
|
+
{
|
|
64
|
+
onSelect: () => i(!0),
|
|
65
|
+
className: "aui-action-bar-more-item hover:bg-accent hover:text-accent-foreground focus:bg-accent focus:text-accent-foreground flex cursor-pointer items-center gap-2 rounded-lg px-2.5 py-1.5 text-xs outline-none select-none",
|
|
66
|
+
children: [
|
|
67
|
+
/* @__PURE__ */ e(N, { className: "size-4" }),
|
|
68
|
+
"Add to Artifact"
|
|
69
|
+
]
|
|
70
|
+
}
|
|
71
|
+
),
|
|
72
|
+
/* @__PURE__ */ e(o.ExportMarkdown, { asChild: !0, children: /* @__PURE__ */ t(n.Item, { className: "aui-action-bar-more-item hover:bg-accent hover:text-accent-foreground focus:bg-accent focus:text-accent-foreground flex cursor-pointer items-center gap-2 rounded-lg px-2.5 py-1.5 text-xs outline-none select-none", children: [
|
|
73
|
+
/* @__PURE__ */ e(k, { className: "size-4" }),
|
|
74
|
+
"Export as Markdown"
|
|
75
|
+
] }) })
|
|
76
|
+
]
|
|
77
|
+
}
|
|
78
|
+
)
|
|
79
|
+
] })
|
|
80
|
+
]
|
|
81
|
+
}
|
|
82
|
+
),
|
|
83
|
+
/* @__PURE__ */ e(
|
|
84
|
+
z,
|
|
85
|
+
{
|
|
86
|
+
open: s,
|
|
87
|
+
onOpenChange: i
|
|
88
|
+
}
|
|
89
|
+
)
|
|
90
|
+
] });
|
|
91
|
+
}, j = () => /* @__PURE__ */ e(
|
|
92
|
+
o.Root,
|
|
47
93
|
{
|
|
48
94
|
hideWhenRunning: !0,
|
|
49
95
|
autohide: "not-last",
|
|
50
96
|
className: "aui-user-action-bar-root flex flex-col items-end",
|
|
51
|
-
children: /* @__PURE__ */ e(
|
|
97
|
+
children: /* @__PURE__ */ e(o.Edit, { asChild: !0, children: /* @__PURE__ */ e(r, { tooltip: "Edit", className: "aui-user-action-edit", children: /* @__PURE__ */ e(v, {}) }) })
|
|
52
98
|
}
|
|
53
99
|
);
|
|
54
100
|
export {
|
|
55
|
-
|
|
56
|
-
|
|
101
|
+
S as AssistantActionBar,
|
|
102
|
+
j as UserActionBar
|
|
57
103
|
};
|
|
@@ -1,59 +1,78 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
var E = Object.defineProperty;
|
|
3
|
-
var P = (a, t,
|
|
4
|
-
var
|
|
5
|
-
import { jsx as e, jsxs as
|
|
6
|
-
import { useRef as
|
|
7
|
-
import { Plus as _, FileText as h,
|
|
3
|
+
var P = (a, t, r) => t in a ? E(a, t, { enumerable: !0, configurable: !0, writable: !0, value: r }) : a[t] = r;
|
|
4
|
+
var A = (a, t, r) => P(a, typeof t != "symbol" ? t + "" : t, r);
|
|
5
|
+
import { jsx as e, jsxs as i, Fragment as N } from "react/jsx-runtime";
|
|
6
|
+
import { useRef as w, useState as C, useEffect as U } from "react";
|
|
7
|
+
import { Plus as _, FileText as h, WarningCircle as R, At as L, Bolt as S, Close as T } from "../../lib/icons.js";
|
|
8
|
+
import { Spinner as v } from "../spinner.js";
|
|
8
9
|
import { CONTEXT_MIME as D } from "./composer-add-context.js";
|
|
9
10
|
import { HARNESS_MIME as F } from "./composer-harness.js";
|
|
10
|
-
import { ComposerPrimitive as
|
|
11
|
+
import { ComposerPrimitive as z, useComposerRuntime as k, MessagePrimitive as M, useAui as O, useAuiState as l, AttachmentPrimitive as s } from "@assistant-ui/react";
|
|
11
12
|
import { useShallow as H } from "zustand/shallow";
|
|
12
13
|
import { Tooltip as $, TooltipTrigger as q, TooltipContent as B } from "../ui/tooltip.js";
|
|
13
14
|
import { Dialog as G, DialogTrigger as W, DialogContent as X, DialogTitle as Y } from "../ui/dialog.js";
|
|
14
15
|
import { Avatar as J, AvatarImage as K, AvatarFallback as Q } from "../ui/avatar.js";
|
|
15
|
-
import { TooltipIconButton as
|
|
16
|
+
import { TooltipIconButton as f } from "./tooltip-icon-button.js";
|
|
16
17
|
import { cn as p } from "../../lib/cn.js";
|
|
17
18
|
const V = (a) => {
|
|
18
|
-
const [t,
|
|
19
|
+
const [t, r] = C(void 0);
|
|
19
20
|
return U(() => {
|
|
20
21
|
if (!a) {
|
|
21
|
-
|
|
22
|
+
r(void 0);
|
|
22
23
|
return;
|
|
23
24
|
}
|
|
24
|
-
const
|
|
25
|
-
return n
|
|
26
|
-
URL.revokeObjectURL(
|
|
25
|
+
const n = URL.createObjectURL(a);
|
|
26
|
+
return r(n), () => {
|
|
27
|
+
URL.revokeObjectURL(n);
|
|
27
28
|
};
|
|
28
29
|
}, [a]), t;
|
|
29
30
|
}, j = () => {
|
|
30
31
|
const { file: a, src: t } = l(
|
|
31
|
-
H((
|
|
32
|
+
H((r) => {
|
|
32
33
|
var c, m;
|
|
33
|
-
if (
|
|
34
|
-
if (
|
|
35
|
-
const
|
|
36
|
-
return
|
|
34
|
+
if (r.attachment.type !== "image") return {};
|
|
35
|
+
if (r.attachment.file) return { file: r.attachment.file };
|
|
36
|
+
const n = (m = (c = r.attachment.content) == null ? void 0 : c.filter((d) => d.type === "image")[0]) == null ? void 0 : m.image;
|
|
37
|
+
return n ? { src: n } : {};
|
|
37
38
|
})
|
|
38
39
|
);
|
|
39
40
|
return V(a) ?? t;
|
|
40
41
|
}, Z = ({ src: a }) => {
|
|
41
|
-
const [t,
|
|
42
|
-
return /* @__PURE__ */
|
|
43
|
-
"
|
|
42
|
+
const [t, r] = C(!1);
|
|
43
|
+
return /* @__PURE__ */ i(
|
|
44
|
+
"div",
|
|
44
45
|
{
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
46
|
+
className: "relative flex min-h-48 w-full items-center justify-center",
|
|
47
|
+
"aria-busy": !t || void 0,
|
|
48
|
+
children: [
|
|
49
|
+
!t && /* @__PURE__ */ e(
|
|
50
|
+
v,
|
|
51
|
+
{
|
|
52
|
+
variant: "content",
|
|
53
|
+
size: "md",
|
|
54
|
+
color: "muted",
|
|
55
|
+
label: "Loading attachment preview"
|
|
56
|
+
}
|
|
57
|
+
),
|
|
58
|
+
/* @__PURE__ */ e(
|
|
59
|
+
"img",
|
|
60
|
+
{
|
|
61
|
+
src: a,
|
|
62
|
+
alt: "Attachment preview",
|
|
63
|
+
className: p(
|
|
64
|
+
"block h-auto max-h-[80vh] w-auto max-w-full object-contain",
|
|
65
|
+
t ? "aui-attachment-preview-image-loaded" : "aui-attachment-preview-image-loading absolute invisible"
|
|
66
|
+
),
|
|
67
|
+
onLoad: () => r(!0)
|
|
68
|
+
}
|
|
69
|
+
)
|
|
70
|
+
]
|
|
52
71
|
}
|
|
53
72
|
);
|
|
54
73
|
}, ee = ({ children: a }) => {
|
|
55
74
|
const t = j();
|
|
56
|
-
return t ? /* @__PURE__ */
|
|
75
|
+
return t ? /* @__PURE__ */ i(G, { children: [
|
|
57
76
|
/* @__PURE__ */ e(
|
|
58
77
|
W,
|
|
59
78
|
{
|
|
@@ -62,14 +81,14 @@ const V = (a) => {
|
|
|
62
81
|
children: a
|
|
63
82
|
}
|
|
64
83
|
),
|
|
65
|
-
/* @__PURE__ */
|
|
84
|
+
/* @__PURE__ */ i(X, { className: "aui-attachment-preview-dialog-content [&>button]:bg-foreground/60 [&_svg]:text-background [&>button]:hover:[&_svg]:text-destructive p-2 sm:max-w-3xl [&>button]:rounded-full [&>button]:p-1 [&>button]:opacity-100 [&>button]:ring-0!", children: [
|
|
66
85
|
/* @__PURE__ */ e(Y, { className: "aui-sr-only sr-only", children: "Image Attachment Preview" }),
|
|
67
86
|
/* @__PURE__ */ e("div", { className: "aui-attachment-preview bg-background relative mx-auto flex max-h-[80dvh] w-full items-center justify-center overflow-hidden", children: /* @__PURE__ */ e(Z, { src: t }) })
|
|
68
87
|
] })
|
|
69
88
|
] }) : a;
|
|
70
89
|
}, te = () => {
|
|
71
90
|
const a = j();
|
|
72
|
-
return /* @__PURE__ */
|
|
91
|
+
return /* @__PURE__ */ i(J, { className: "aui-attachment-tile-avatar h-full w-full rounded-none", children: [
|
|
73
92
|
/* @__PURE__ */ e(
|
|
74
93
|
K,
|
|
75
94
|
{
|
|
@@ -81,9 +100,9 @@ const V = (a) => {
|
|
|
81
100
|
/* @__PURE__ */ e(Q, { children: /* @__PURE__ */ e(h, { className: "aui-attachment-tile-fallback-icon text-muted-foreground size-8" }) })
|
|
82
101
|
] });
|
|
83
102
|
}, I = () => {
|
|
84
|
-
const t = O().attachment.source !== "message",
|
|
85
|
-
const
|
|
86
|
-
switch (
|
|
103
|
+
const t = O().attachment.source !== "message", r = l((o) => o.attachment.contentType === D), n = l((o) => o.attachment.contentType === F), c = l((o) => o.attachment.type === "image"), m = l((o) => {
|
|
104
|
+
const y = o.attachment.type;
|
|
105
|
+
switch (y) {
|
|
87
106
|
case "image":
|
|
88
107
|
return "Image";
|
|
89
108
|
case "document":
|
|
@@ -91,13 +110,13 @@ const V = (a) => {
|
|
|
91
110
|
case "file":
|
|
92
111
|
return "File";
|
|
93
112
|
default:
|
|
94
|
-
return
|
|
113
|
+
return y;
|
|
95
114
|
}
|
|
96
115
|
}), d = l(
|
|
97
|
-
(
|
|
98
|
-
),
|
|
99
|
-
return
|
|
100
|
-
/* @__PURE__ */
|
|
116
|
+
(o) => o.attachment.status.type === "running" ? "uploading" : o.attachment.status.type === "incomplete" && o.attachment.status.reason === "error" ? "error" : void 0
|
|
117
|
+
), g = d === "uploading", u = d === "error";
|
|
118
|
+
return r ? /* @__PURE__ */ e(ae, { isComposer: t }) : n ? /* @__PURE__ */ e(ne, { isComposer: t }) : c ? /* @__PURE__ */ i($, { children: [
|
|
119
|
+
/* @__PURE__ */ i(
|
|
101
120
|
s.Root,
|
|
102
121
|
{
|
|
103
122
|
className: p(
|
|
@@ -105,24 +124,33 @@ const V = (a) => {
|
|
|
105
124
|
c && !t && "aui-attachment-root-message only:*:first:size-24"
|
|
106
125
|
),
|
|
107
126
|
children: [
|
|
108
|
-
/* @__PURE__ */ e(ee, { children: /* @__PURE__ */ e(q, { asChild: !0, children: /* @__PURE__ */
|
|
127
|
+
/* @__PURE__ */ e(ee, { children: /* @__PURE__ */ e(q, { asChild: !0, children: /* @__PURE__ */ i(
|
|
109
128
|
"div",
|
|
110
129
|
{
|
|
111
130
|
className: p(
|
|
112
|
-
"aui-attachment-tile bg-muted relative size-14 cursor-pointer overflow-hidden rounded-
|
|
131
|
+
"aui-attachment-tile bg-muted relative size-14 cursor-pointer overflow-hidden rounded-sm border transition-opacity hover:opacity-75",
|
|
113
132
|
u && "border-destructive"
|
|
114
133
|
),
|
|
115
134
|
role: "button",
|
|
116
135
|
tabIndex: 0,
|
|
117
|
-
"aria-label": `${m} attachment${u ? ", upload failed" :
|
|
136
|
+
"aria-label": `${m} attachment${u ? ", upload failed" : g ? ", uploading" : ""}`,
|
|
118
137
|
children: [
|
|
119
138
|
/* @__PURE__ */ e(te, {}),
|
|
120
|
-
|
|
139
|
+
g && /* @__PURE__ */ e(
|
|
121
140
|
"div",
|
|
122
141
|
{
|
|
123
142
|
"aria-hidden": "true",
|
|
124
143
|
className: "aui-attachment-tile-uploading bg-background/60 absolute inset-0 flex items-center justify-center backdrop-blur-[1px]",
|
|
125
|
-
children: /* @__PURE__ */ e(
|
|
144
|
+
children: /* @__PURE__ */ e(
|
|
145
|
+
v,
|
|
146
|
+
{
|
|
147
|
+
variant: "upload",
|
|
148
|
+
size: "sm",
|
|
149
|
+
color: "muted",
|
|
150
|
+
className: "size-5",
|
|
151
|
+
"aria-hidden": !0
|
|
152
|
+
}
|
|
153
|
+
)
|
|
126
154
|
}
|
|
127
155
|
),
|
|
128
156
|
u && /* @__PURE__ */ e(
|
|
@@ -130,27 +158,27 @@ const V = (a) => {
|
|
|
130
158
|
{
|
|
131
159
|
"aria-hidden": "true",
|
|
132
160
|
className: "aui-attachment-tile-error bg-destructive/10 absolute inset-0 flex items-center justify-center",
|
|
133
|
-
children: /* @__PURE__ */ e(
|
|
161
|
+
children: /* @__PURE__ */ e(R, { className: "text-destructive size-5" })
|
|
134
162
|
}
|
|
135
163
|
)
|
|
136
164
|
]
|
|
137
165
|
}
|
|
138
166
|
) }) }),
|
|
139
|
-
t && /* @__PURE__ */ e(
|
|
167
|
+
t && /* @__PURE__ */ e(ie, {})
|
|
140
168
|
]
|
|
141
169
|
}
|
|
142
170
|
),
|
|
143
171
|
/* @__PURE__ */ e(B, { side: "top", children: /* @__PURE__ */ e(s.Name, {}) })
|
|
144
172
|
] }) : /* @__PURE__ */ e(
|
|
145
|
-
|
|
173
|
+
re,
|
|
146
174
|
{
|
|
147
175
|
isComposer: t,
|
|
148
176
|
typeLabel: m,
|
|
149
|
-
isUploading:
|
|
177
|
+
isUploading: g,
|
|
150
178
|
isError: u
|
|
151
179
|
}
|
|
152
180
|
);
|
|
153
|
-
},
|
|
181
|
+
}, x = ({
|
|
154
182
|
label: a = "Remove attachment"
|
|
155
183
|
}) => /* @__PURE__ */ e(s.Remove, { asChild: !0, children: /* @__PURE__ */ e(
|
|
156
184
|
"button",
|
|
@@ -158,64 +186,64 @@ const V = (a) => {
|
|
|
158
186
|
type: "button",
|
|
159
187
|
"aria-label": a,
|
|
160
188
|
className: "flex size-5 shrink-0 items-center justify-center rounded text-muted-foreground outline-none transition-colors hover:bg-foreground/10 hover:text-foreground focus-visible:ring-2 focus-visible:ring-ring [&_svg]:size-3.5",
|
|
161
|
-
children: /* @__PURE__ */ e(
|
|
189
|
+
children: /* @__PURE__ */ e(T, {})
|
|
162
190
|
}
|
|
163
|
-
) }), ae = ({ isComposer: a }) => /* @__PURE__ */ e(s.Root, { className: "aui-attachment-root", children: /* @__PURE__ */
|
|
191
|
+
) }), ae = ({ isComposer: a }) => /* @__PURE__ */ e(s.Root, { className: "aui-attachment-root", children: /* @__PURE__ */ i("div", { className: "inline-flex max-w-[15rem] items-center gap-1.5 rounded-md bg-muted py-1 pe-1 ps-2 text-xs text-foreground", children: [
|
|
164
192
|
/* @__PURE__ */ e(L, { className: "size-3.5 shrink-0 text-muted-foreground" }),
|
|
165
193
|
/* @__PURE__ */ e("span", { className: "truncate", children: /* @__PURE__ */ e(s.Name, {}) }),
|
|
166
|
-
a && /* @__PURE__ */ e(
|
|
167
|
-
] }) }),
|
|
194
|
+
a && /* @__PURE__ */ e(x, { label: "Remove context" })
|
|
195
|
+
] }) }), ne = ({ isComposer: a }) => /* @__PURE__ */ e(s.Root, { className: "aui-attachment-root", children: /* @__PURE__ */ i("div", { className: "inline-flex max-w-[15rem] items-center gap-1.5 rounded-md bg-info-50 py-1 pe-1 ps-2 text-xs text-info-700", children: [
|
|
168
196
|
/* @__PURE__ */ e(S, { className: "size-3.5 shrink-0" }),
|
|
169
|
-
/* @__PURE__ */
|
|
197
|
+
/* @__PURE__ */ i("span", { className: "truncate", children: [
|
|
170
198
|
"Harness · ",
|
|
171
199
|
/* @__PURE__ */ e(s.Name, {})
|
|
172
200
|
] }),
|
|
173
|
-
a && /* @__PURE__ */ e(
|
|
174
|
-
] }) }),
|
|
201
|
+
a && /* @__PURE__ */ e(x, { label: "Remove harness" })
|
|
202
|
+
] }) }), re = ({ isComposer: a, typeLabel: t, isUploading: r, isError: n }) => /* @__PURE__ */ e(s.Root, { className: "aui-attachment-root", children: /* @__PURE__ */ i("div", { className: "flex w-56 max-w-full items-center gap-2.5 rounded-lg bg-muted p-1.5", children: [
|
|
175
203
|
/* @__PURE__ */ e(
|
|
176
204
|
"div",
|
|
177
205
|
{
|
|
178
206
|
className: p(
|
|
179
207
|
"flex size-9 shrink-0 items-center justify-center rounded-md bg-background text-muted-foreground [&_svg]:size-4.5",
|
|
180
|
-
|
|
208
|
+
n && "text-destructive"
|
|
181
209
|
),
|
|
182
|
-
children:
|
|
210
|
+
children: r ? /* @__PURE__ */ e(v, { variant: "upload", size: "sm", "aria-hidden": !0 }) : n ? /* @__PURE__ */ e(R, {}) : /* @__PURE__ */ e(h, {})
|
|
183
211
|
}
|
|
184
212
|
),
|
|
185
|
-
/* @__PURE__ */
|
|
213
|
+
/* @__PURE__ */ i("div", { className: "min-w-0 flex-1", children: [
|
|
186
214
|
/* @__PURE__ */ e("div", { className: "truncate text-xs font-medium leading-tight text-foreground", children: /* @__PURE__ */ e(s.Name, {}) }),
|
|
187
|
-
/* @__PURE__ */ e("div", { className: "truncate text-[11px] leading-tight text-muted-foreground", children:
|
|
215
|
+
/* @__PURE__ */ e("div", { className: "truncate text-[11px] leading-tight text-muted-foreground", children: n ? "Upload failed" : r ? "Uploading…" : t })
|
|
188
216
|
] }),
|
|
189
|
-
a && /* @__PURE__ */ e(
|
|
190
|
-
] }) }),
|
|
191
|
-
|
|
217
|
+
a && /* @__PURE__ */ e(x, { label: "Remove file" })
|
|
218
|
+
] }) }), ie = () => /* @__PURE__ */ e(s.Remove, { asChild: !0, children: /* @__PURE__ */ e(
|
|
219
|
+
f,
|
|
192
220
|
{
|
|
193
221
|
tooltip: "Remove file",
|
|
194
222
|
className: "aui-attachment-tile-remove text-muted-foreground hover:[&_svg]:text-destructive absolute end-1.5 top-1.5 size-3.5 rounded-full bg-white opacity-100 shadow-sm hover:bg-white! [&_svg]:text-black",
|
|
195
223
|
side: "top",
|
|
196
|
-
children: /* @__PURE__ */ e(
|
|
224
|
+
children: /* @__PURE__ */ e(T, { className: "aui-attachment-remove-icon size-3" })
|
|
197
225
|
}
|
|
198
|
-
) }),
|
|
226
|
+
) }), Ce = () => (
|
|
199
227
|
// Sits under the request as its parameters, so it reads left-to-right
|
|
200
228
|
// with the question rather than trailing off the right edge.
|
|
201
229
|
/* @__PURE__ */ e("div", { className: "aui-user-message-attachments-end mt-2.5 flex w-full flex-row flex-wrap justify-start gap-2 empty:hidden", children: /* @__PURE__ */ e(M.Attachments, { children: () => /* @__PURE__ */ e(I, {}) }) })
|
|
202
|
-
),
|
|
203
|
-
|
|
230
|
+
), Re = () => /* @__PURE__ */ e("div", { className: "aui-composer-attachments flex w-full flex-row items-center gap-2 overflow-x-auto empty:hidden", children: /* @__PURE__ */ e(z.Attachments, { children: () => /* @__PURE__ */ e(I, {}) }) }), Te = () => /* @__PURE__ */ e(z.AddAttachment, { asChild: !0, children: /* @__PURE__ */ e(
|
|
231
|
+
f,
|
|
204
232
|
{
|
|
205
233
|
tooltip: "Add Attachment",
|
|
206
234
|
side: "bottom",
|
|
207
235
|
variant: "ghost",
|
|
208
236
|
size: "icon",
|
|
209
|
-
className: "aui-composer-add-attachment hover:bg-muted-foreground/15
|
|
237
|
+
className: "aui-composer-add-attachment hover:bg-muted-foreground/15 size-7 rounded-full p-1 text-xs font-medium",
|
|
210
238
|
"aria-label": "Add Attachment",
|
|
211
239
|
children: /* @__PURE__ */ e(_, { className: "aui-attachment-add-icon size-4.5 stroke-[1.5px]" })
|
|
212
240
|
}
|
|
213
|
-
) }),
|
|
241
|
+
) }), oe = "image/png,image/jpeg,image/webp,image/gif", se = /* @__PURE__ */ new Set([
|
|
214
242
|
"image/png",
|
|
215
243
|
"image/jpeg",
|
|
216
244
|
"image/webp",
|
|
217
245
|
"image/gif"
|
|
218
|
-
]),
|
|
246
|
+
]), b = [
|
|
219
247
|
"application/pdf",
|
|
220
248
|
"application/msword",
|
|
221
249
|
"application/vnd.openxmlformats-officedocument.wordprocessingml.document",
|
|
@@ -236,13 +264,13 @@ const V = (a) => {
|
|
|
236
264
|
"application/javascript",
|
|
237
265
|
"application/typescript",
|
|
238
266
|
".pdf,.doc,.docx,.odt,.rtf,.ppt,.pptx,.xls,.xlsx,.csv,.tsv,.txt,.md,.markdown,.json,.html,.xml,.css,.js,.jsx,.ts,.tsx,.sql,.py,.yaml,.yml,.log"
|
|
239
|
-
].join(","), ce = `${
|
|
240
|
-
const
|
|
241
|
-
|
|
267
|
+
].join(","), ce = `${oe},${b}`, le = (a) => new Promise((t, r) => {
|
|
268
|
+
const n = new FileReader();
|
|
269
|
+
n.onload = () => t(n.result), n.onerror = () => r(n.error), n.readAsDataURL(a);
|
|
242
270
|
});
|
|
243
|
-
class
|
|
271
|
+
class ze {
|
|
244
272
|
constructor() {
|
|
245
|
-
|
|
273
|
+
A(this, "accept", b);
|
|
246
274
|
}
|
|
247
275
|
async add({ file: t }) {
|
|
248
276
|
return {
|
|
@@ -271,13 +299,13 @@ class Re {
|
|
|
271
299
|
async remove() {
|
|
272
300
|
}
|
|
273
301
|
}
|
|
274
|
-
const
|
|
275
|
-
const a =
|
|
276
|
-
if (
|
|
277
|
-
for (const c of Array.from(
|
|
302
|
+
const ke = () => {
|
|
303
|
+
const a = k(), t = w(null), r = (n) => {
|
|
304
|
+
if (n != null && n.length)
|
|
305
|
+
for (const c of Array.from(n))
|
|
278
306
|
c.type.startsWith("image/") && !se.has(c.type) || a.addAttachment(c);
|
|
279
307
|
};
|
|
280
|
-
return /* @__PURE__ */
|
|
308
|
+
return /* @__PURE__ */ i(N, { children: [
|
|
281
309
|
/* @__PURE__ */ e(
|
|
282
310
|
"input",
|
|
283
311
|
{
|
|
@@ -286,49 +314,49 @@ const Te = () => {
|
|
|
286
314
|
type: "file",
|
|
287
315
|
accept: ce,
|
|
288
316
|
multiple: !0,
|
|
289
|
-
onChange: (
|
|
290
|
-
n
|
|
317
|
+
onChange: (n) => {
|
|
318
|
+
r(n.currentTarget.files), n.currentTarget.value = "";
|
|
291
319
|
}
|
|
292
320
|
}
|
|
293
321
|
),
|
|
294
322
|
/* @__PURE__ */ e(
|
|
295
|
-
|
|
323
|
+
f,
|
|
296
324
|
{
|
|
297
325
|
tooltip: "Upload image or file",
|
|
298
326
|
side: "top",
|
|
299
327
|
type: "button",
|
|
300
328
|
variant: "ghost",
|
|
301
329
|
size: "icon",
|
|
302
|
-
className: "aui-composer-add-image hover:bg-muted-foreground/15
|
|
330
|
+
className: "aui-composer-add-image hover:bg-muted-foreground/15 size-7 rounded-full p-1",
|
|
303
331
|
"aria-label": "Upload image or file",
|
|
304
332
|
onClick: () => {
|
|
305
|
-
var
|
|
306
|
-
return (
|
|
333
|
+
var n;
|
|
334
|
+
return (n = t.current) == null ? void 0 : n.click();
|
|
307
335
|
},
|
|
308
336
|
children: /* @__PURE__ */ e(h, { className: "aui-attachment-add-file-icon size-4.5 stroke-[1.5px]" })
|
|
309
337
|
}
|
|
310
338
|
)
|
|
311
339
|
] });
|
|
312
|
-
},
|
|
313
|
-
const a =
|
|
314
|
-
return /* @__PURE__ */
|
|
340
|
+
}, je = () => {
|
|
341
|
+
const a = k(), t = w(null);
|
|
342
|
+
return /* @__PURE__ */ i(N, { children: [
|
|
315
343
|
/* @__PURE__ */ e(
|
|
316
344
|
"input",
|
|
317
345
|
{
|
|
318
346
|
ref: t,
|
|
319
347
|
hidden: !0,
|
|
320
348
|
type: "file",
|
|
321
|
-
accept:
|
|
349
|
+
accept: b,
|
|
322
350
|
multiple: !0,
|
|
323
|
-
onChange: (
|
|
324
|
-
for (const
|
|
325
|
-
a.addAttachment(
|
|
326
|
-
|
|
351
|
+
onChange: (r) => {
|
|
352
|
+
for (const n of Array.from(r.currentTarget.files ?? []))
|
|
353
|
+
a.addAttachment(n);
|
|
354
|
+
r.currentTarget.value = "";
|
|
327
355
|
}
|
|
328
356
|
}
|
|
329
357
|
),
|
|
330
358
|
/* @__PURE__ */ e(
|
|
331
|
-
|
|
359
|
+
f,
|
|
332
360
|
{
|
|
333
361
|
tooltip: "Attach business documents",
|
|
334
362
|
side: "top",
|
|
@@ -338,8 +366,8 @@ const Te = () => {
|
|
|
338
366
|
className: "aui-composer-add-document hover:bg-muted-foreground/15 size-7 rounded-full p-1",
|
|
339
367
|
"aria-label": "Attach business documents",
|
|
340
368
|
onClick: () => {
|
|
341
|
-
var
|
|
342
|
-
return (
|
|
369
|
+
var r;
|
|
370
|
+
return (r = t.current) == null ? void 0 : r.click();
|
|
343
371
|
},
|
|
344
372
|
children: /* @__PURE__ */ e(h, { className: "size-4.5 stroke-[1.5px]" })
|
|
345
373
|
}
|
|
@@ -347,11 +375,11 @@ const Te = () => {
|
|
|
347
375
|
] });
|
|
348
376
|
};
|
|
349
377
|
export {
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
378
|
+
b as ACTIONEER_FILE_ACCEPT,
|
|
379
|
+
ze as ActioneerFileAttachmentAdapter,
|
|
380
|
+
Te as ComposerAddAttachment,
|
|
381
|
+
je as ComposerAddDocument,
|
|
382
|
+
ke as ComposerAddImage,
|
|
383
|
+
Re as ComposerAttachments,
|
|
384
|
+
Ce as UserMessageAttachments
|
|
357
385
|
};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { ComponentProps } from 'react';
|
|
2
2
|
import { VariantProps } from 'class-variance-authority';
|
|
3
3
|
declare const badgeVariants: (props?: ({
|
|
4
|
-
variant?: "success" | "warning" | "info" | "
|
|
4
|
+
variant?: "success" | "warning" | "info" | "outline" | "muted" | "secondary" | "ghost" | "destructive" | null | undefined;
|
|
5
5
|
size?: "default" | "sm" | "lg" | null | undefined;
|
|
6
6
|
} & import('class-variance-authority/types').ClassProp) | undefined) => string;
|
|
7
7
|
export type BadgeProps = ComponentProps<"span"> & VariantProps<typeof badgeVariants> & {
|