@actioneer/ads 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -0
- package/bin/ads-init.mjs +314 -0
- package/components/accordion.d.ts +13 -0
- package/components/accordion.js +91 -0
- package/components/agents-ui/agent-audio-visualizer-aura.d.ts +11 -0
- package/components/agents-ui/agent-audio-visualizer-aura.js +277 -0
- package/components/agents-ui/agent-audio-visualizer-wave.d.ts +12 -0
- package/components/agents-ui/agent-audio-visualizer-wave.js +203 -0
- package/components/agents-ui/react-shader-toy.d.ts +87 -0
- package/components/agents-ui/react-shader-toy.js +531 -0
- package/components/ai-elements/chain-of-thought.d.ts +30 -0
- package/components/ai-elements/chain-of-thought.js +182 -0
- package/components/ai-elements/index.d.ts +11 -0
- package/components/ai-elements/inline-citation.d.ts +44 -0
- package/components/ai-elements/inline-citation.js +314 -0
- package/components/ai-elements/message.d.ts +96 -0
- package/components/ai-elements/message.js +308 -0
- package/components/ai-elements/queue.d.ts +60 -0
- package/components/ai-elements/queue.js +193 -0
- package/components/ai-elements/reasoning.d.ts +26 -0
- package/components/ai-elements/reasoning.js +131 -0
- package/components/ai-elements/shimmer.d.ts +25 -0
- package/components/ai-elements/shimmer.js +44 -0
- package/components/ai-elements/speech-input.d.ts +16 -0
- package/components/ai-elements/speech-input.js +151 -0
- package/components/ai-elements/task-progress.d.ts +41 -0
- package/components/ai-elements/task-progress.js +211 -0
- package/components/ai-elements/task.d.ts +35 -0
- package/components/ai-elements/task.js +73 -0
- package/components/ai-elements/tool.d.ts +53 -0
- package/components/ai-elements/tool.js +116 -0
- package/components/ai-elements/voice.d.ts +74 -0
- package/components/ai-elements/voice.js +875 -0
- package/components/alert.d.ts +21 -0
- package/components/alert.js +76 -0
- package/components/answer.d.ts +984 -0
- package/components/answer.js +543 -0
- package/components/assistant-ui/action-bar.d.ts +3 -0
- package/components/assistant-ui/action-bar.js +57 -0
- package/components/assistant-ui/answer-tool-ui.d.ts +5 -0
- package/components/assistant-ui/answer-tool-ui.js +42 -0
- package/components/assistant-ui/attachment.d.ts +50 -0
- package/components/assistant-ui/attachment.js +353 -0
- package/components/assistant-ui/badge.d.ts +11 -0
- package/components/assistant-ui/badge.js +54 -0
- package/components/assistant-ui/branch-picker.d.ts +3 -0
- package/components/assistant-ui/branch-picker.js +36 -0
- package/components/assistant-ui/chain-of-thought.d.ts +46 -0
- package/components/assistant-ui/composer-add-context.d.ts +50 -0
- package/components/assistant-ui/composer-add-context.js +209 -0
- package/components/assistant-ui/composer-deep-research.d.ts +16 -0
- package/components/assistant-ui/composer-deep-research.js +38 -0
- package/components/assistant-ui/composer-harness.d.ts +18 -0
- package/components/assistant-ui/composer-harness.js +186 -0
- package/components/assistant-ui/composer-trigger-popover.d.ts +47 -0
- package/components/assistant-ui/composer-trigger-popover.js +147 -0
- package/components/assistant-ui/composer.d.ts +8 -0
- package/components/assistant-ui/composer.js +276 -0
- package/components/assistant-ui/directive-text.d.ts +16 -0
- package/components/assistant-ui/directive-text.js +40 -0
- package/components/assistant-ui/error.d.ts +6 -0
- package/components/assistant-ui/error.js +39 -0
- package/components/assistant-ui/file.d.ts +37 -0
- package/components/assistant-ui/file.js +159 -0
- package/components/assistant-ui/follow-up-suggestions.d.ts +7 -0
- package/components/assistant-ui/follow-up-suggestions.js +44 -0
- package/components/assistant-ui/image.d.ts +46 -0
- package/components/assistant-ui/image.js +351 -0
- package/components/assistant-ui/index.d.ts +28 -0
- package/components/assistant-ui/markdown-text.d.ts +1 -0
- package/components/assistant-ui/markdown-text.js +242 -0
- package/components/assistant-ui/message-timing.d.ts +25 -0
- package/components/assistant-ui/message-timing.js +56 -0
- package/components/assistant-ui/message.d.ts +4 -0
- package/components/assistant-ui/message.js +159 -0
- package/components/assistant-ui/primitives.d.ts +2 -0
- package/components/assistant-ui/quote.d.ts +37 -0
- package/components/assistant-ui/quote.js +150 -0
- package/components/assistant-ui/reasoning.d.ts +44 -0
- package/components/assistant-ui/reasoning.js +261 -0
- package/components/assistant-ui/selection-toolbar.d.ts +29 -0
- package/components/assistant-ui/selection-toolbar.js +91 -0
- package/components/assistant-ui/smart-message-text.d.ts +15 -0
- package/components/assistant-ui/smart-message-text.js +29 -0
- package/components/assistant-ui/sources.d.ts +17 -0
- package/components/assistant-ui/sources.js +121 -0
- package/components/assistant-ui/suggestions.d.ts +7 -0
- package/components/assistant-ui/suggestions.js +19 -0
- package/components/assistant-ui/thread-context.d.ts +37 -0
- package/components/assistant-ui/thread-context.js +8 -0
- package/components/assistant-ui/thread.d.ts +5 -0
- package/components/assistant-ui/thread.js +77 -0
- package/components/assistant-ui/tool-fallback.d.ts +36 -0
- package/components/assistant-ui/tool-fallback.js +428 -0
- package/components/assistant-ui/tool-group.d.ts +33 -0
- package/components/assistant-ui/tool-group.js +173 -0
- package/components/assistant-ui/tooltip-icon-button.d.ts +7 -0
- package/components/assistant-ui/tooltip-icon-button.js +31 -0
- package/components/assistant-ui/voice.d.ts +18 -0
- package/components/autocomplete.d.ts +18 -0
- package/components/autocomplete.js +162 -0
- package/components/avatar.d.ts +26 -0
- package/components/avatar.js +92 -0
- package/components/badge.d.ts +10 -0
- package/components/badge.js +83 -0
- package/components/brand-loader.d.ts +16 -0
- package/components/brand-loader.js +64 -0
- package/components/breadcrumbs.d.ts +8 -0
- package/components/breadcrumbs.js +58 -0
- package/components/button.d.ts +13 -0
- package/components/button.js +100 -0
- package/components/card.d.ts +19 -0
- package/components/card.js +82 -0
- package/components/carousel.d.ts +31 -0
- package/components/carousel.js +351 -0
- package/components/chart.d.ts +165 -0
- package/components/chart.js +841 -0
- package/components/checkbox.d.ts +13 -0
- package/components/checkbox.js +84 -0
- package/components/chip.d.ts +13 -0
- package/components/chip.js +112 -0
- package/components/collapsible.d.ts +5 -0
- package/components/collapsible.js +31 -0
- package/components/connector-card.d.ts +62 -0
- package/components/connector-card.js +154 -0
- package/components/divider.d.ts +23 -0
- package/components/divider.js +69 -0
- package/components/drawer.d.ts +45 -0
- package/components/drawer.js +234 -0
- package/components/dropdown.d.ts +33 -0
- package/components/dropdown.js +198 -0
- package/components/empty-state.d.ts +8 -0
- package/components/empty-state.js +30 -0
- package/components/field.d.ts +20 -0
- package/components/field.js +74 -0
- package/components/index.d.ts +56 -0
- package/components/index.js +444 -0
- package/components/input-field.d.ts +22 -0
- package/components/input-field.js +91 -0
- package/components/input.d.ts +8 -0
- package/components/input.js +61 -0
- package/components/kbd.d.ts +6 -0
- package/components/kbd.js +26 -0
- package/components/link.d.ts +14 -0
- package/components/link.js +72 -0
- package/components/modal.d.ts +18 -0
- package/components/modal.js +156 -0
- package/components/navbar.d.ts +15 -0
- package/components/navbar.js +68 -0
- package/components/number-field.d.ts +11 -0
- package/components/number-field.js +89 -0
- package/components/pagination.d.ts +28 -0
- package/components/pagination.js +179 -0
- package/components/panel.d.ts +14 -0
- package/components/panel.js +71 -0
- package/components/pixel-blast-svg.d.ts +22 -0
- package/components/pixel-blast-svg.js +154 -0
- package/components/popover.d.ts +20 -0
- package/components/popover.js +101 -0
- package/components/progress-circle.d.ts +11 -0
- package/components/progress-circle.js +75 -0
- package/components/progress.d.ts +22 -0
- package/components/progress.js +66 -0
- package/components/radio.d.ts +16 -0
- package/components/radio.js +101 -0
- package/components/segmented.d.ts +16 -0
- package/components/segmented.js +103 -0
- package/components/select.d.ts +28 -0
- package/components/select.js +180 -0
- package/components/selection-action-bar.d.ts +11 -0
- package/components/selection-action-bar.js +59 -0
- package/components/sidebar.d.ts +118 -0
- package/components/sidebar.js +375 -0
- package/components/skeleton.d.ts +6 -0
- package/components/skeleton.js +26 -0
- package/components/slider.d.ts +11 -0
- package/components/slider.js +62 -0
- package/components/spinner.d.ts +11 -0
- package/components/spinner.js +62 -0
- package/components/switch.d.ts +7 -0
- package/components/switch.js +61 -0
- package/components/table.d.ts +59 -0
- package/components/table.js +254 -0
- package/components/tabs.d.ts +29 -0
- package/components/tabs.js +371 -0
- package/components/textarea.d.ts +5 -0
- package/components/textarea.js +24 -0
- package/components/timeline.d.ts +7 -0
- package/components/timeline.js +47 -0
- package/components/toast.d.ts +74 -0
- package/components/toast.js +211 -0
- package/components/tooltip.d.ts +11 -0
- package/components/tooltip.js +143 -0
- package/components/tree.d.ts +42 -0
- package/components/tree.js +86 -0
- package/components/typography.d.ts +33 -0
- package/components/typography.js +65 -0
- package/components/ui/avatar.d.ts +11 -0
- package/components/ui/avatar.js +56 -0
- package/components/ui/button.d.ts +10 -0
- package/components/ui/button.js +57 -0
- package/components/ui/collapsible.d.ts +5 -0
- package/components/ui/collapsible.js +35 -0
- package/components/ui/dialog.d.ts +17 -0
- package/components/ui/dialog.js +93 -0
- package/components/ui/tabs.d.ts +22 -0
- package/components/ui/tooltip.d.ts +7 -0
- package/components/ui/tooltip.js +56 -0
- package/fonts/aribau-grotesk-400.otf +0 -0
- package/fonts/aribau-grotesk-700.otf +0 -0
- package/fonts.css +21 -0
- package/hooks/agents-ui/use-agent-audio-visualizer-aura.d.ts +8 -0
- package/hooks/agents-ui/use-agent-audio-visualizer-aura.js +62 -0
- package/hooks/agents-ui/use-agent-audio-visualizer-wave.d.ts +7 -0
- package/hooks/agents-ui/use-agent-audio-visualizer-wave.js +60 -0
- package/hooks/agents-ui/voice-visualizer-types.d.ts +9 -0
- package/lib/cn.d.ts +3 -0
- package/lib/cn.js +9 -0
- package/lib/icons.d.ts +378 -0
- package/lib/icons.js +119 -0
- package/lib/interactive.d.ts +24 -0
- package/lib/interactive.js +36 -0
- package/lib/motion.d.ts +58 -0
- package/lib/motion.js +70 -0
- package/lib/router.d.ts +3 -0
- package/lib/utils.d.ts +6 -0
- package/llms.txt +537 -0
- package/manifest.json +5085 -0
- package/package.json +60 -0
- package/styles.css +653 -0
- package/theme.css +273 -0
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
import { FC } from 'react';
|
|
2
|
+
import { AttachmentAdapter } from '@assistant-ui/react';
|
|
3
|
+
export declare const UserMessageAttachments: FC;
|
|
4
|
+
export declare const ComposerAttachments: FC;
|
|
5
|
+
export declare const ComposerAddAttachment: FC;
|
|
6
|
+
/** File types the Responses API can accept as input_file. Keep this list
|
|
7
|
+
* explicit so a user is never invited to upload an archive or executable the
|
|
8
|
+
* model cannot read. Extensions cover browsers that leave File.type empty. */
|
|
9
|
+
export declare const ACTIONEER_FILE_ACCEPT: string;
|
|
10
|
+
/**
|
|
11
|
+
* Keeps a chosen document as a real file attachment, so the chat adapter can
|
|
12
|
+
* forward its bytes to the Responses API as an input_file part.
|
|
13
|
+
*/
|
|
14
|
+
export declare class ActioneerFileAttachmentAdapter implements AttachmentAdapter {
|
|
15
|
+
accept: string;
|
|
16
|
+
add({ file }: {
|
|
17
|
+
file: File;
|
|
18
|
+
}): Promise<{
|
|
19
|
+
id: string;
|
|
20
|
+
type: "document";
|
|
21
|
+
name: string;
|
|
22
|
+
contentType: string;
|
|
23
|
+
file: File;
|
|
24
|
+
status: {
|
|
25
|
+
type: "requires-action";
|
|
26
|
+
reason: "composer-send";
|
|
27
|
+
};
|
|
28
|
+
}>;
|
|
29
|
+
send(attachment: Parameters<AttachmentAdapter["send"]>[0]): Promise<{
|
|
30
|
+
status: {
|
|
31
|
+
type: "complete";
|
|
32
|
+
};
|
|
33
|
+
content: {
|
|
34
|
+
type: "file";
|
|
35
|
+
filename: string;
|
|
36
|
+
data: string;
|
|
37
|
+
mimeType: string;
|
|
38
|
+
}[];
|
|
39
|
+
id: string;
|
|
40
|
+
type: "image" | "document" | "file" | (string & {});
|
|
41
|
+
name: string;
|
|
42
|
+
contentType?: string | undefined;
|
|
43
|
+
file: File;
|
|
44
|
+
}>;
|
|
45
|
+
remove(): Promise<void>;
|
|
46
|
+
}
|
|
47
|
+
export declare const ComposerAddImage: FC;
|
|
48
|
+
/** Document-only picker used by onboarding, where business files can be
|
|
49
|
+
* shared as context but image analysis and product harnesses are irrelevant. */
|
|
50
|
+
export declare const ComposerAddDocument: FC;
|
|
@@ -0,0 +1,353 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
var E = Object.defineProperty;
|
|
3
|
+
var P = (a, t, n) => t in a ? E(a, t, { enumerable: !0, configurable: !0, writable: !0, value: n }) : a[t] = n;
|
|
4
|
+
var y = (a, t, n) => P(a, typeof t != "symbol" ? t + "" : t, n);
|
|
5
|
+
import { jsx as e, jsxs as o, Fragment as A } from "react/jsx-runtime";
|
|
6
|
+
import { useRef as N, useState as w, useEffect as U } from "react";
|
|
7
|
+
import { Plus as _, FileText as h, Loader as C, WarningCircle as k, At as L, Bolt as S, Close as R } from "../../lib/icons.js";
|
|
8
|
+
import { CONTEXT_MIME as D } from "./composer-add-context.js";
|
|
9
|
+
import { HARNESS_MIME as F } from "./composer-harness.js";
|
|
10
|
+
import { ComposerPrimitive as T, useComposerRuntime as z, MessagePrimitive as M, useAui as O, useAuiState as l, AttachmentPrimitive as s } from "@assistant-ui/react";
|
|
11
|
+
import { useShallow as H } from "zustand/shallow";
|
|
12
|
+
import { Tooltip as $, TooltipTrigger as q, TooltipContent as B } from "../ui/tooltip.js";
|
|
13
|
+
import { Dialog as G, DialogTrigger as W, DialogContent as X, DialogTitle as Y } from "../ui/dialog.js";
|
|
14
|
+
import { Avatar as J, AvatarImage as K, AvatarFallback as Q } from "../ui/avatar.js";
|
|
15
|
+
import { TooltipIconButton as g } from "./tooltip-icon-button.js";
|
|
16
|
+
import { cn as p } from "../../lib/cn.js";
|
|
17
|
+
const V = (a) => {
|
|
18
|
+
const [t, n] = w(void 0);
|
|
19
|
+
return U(() => {
|
|
20
|
+
if (!a) {
|
|
21
|
+
n(void 0);
|
|
22
|
+
return;
|
|
23
|
+
}
|
|
24
|
+
const r = URL.createObjectURL(a);
|
|
25
|
+
return n(r), () => {
|
|
26
|
+
URL.revokeObjectURL(r);
|
|
27
|
+
};
|
|
28
|
+
}, [a]), t;
|
|
29
|
+
}, j = () => {
|
|
30
|
+
const { file: a, src: t } = l(
|
|
31
|
+
H((n) => {
|
|
32
|
+
var c, m;
|
|
33
|
+
if (n.attachment.type !== "image") return {};
|
|
34
|
+
if (n.attachment.file) return { file: n.attachment.file };
|
|
35
|
+
const r = (m = (c = n.attachment.content) == null ? void 0 : c.filter((d) => d.type === "image")[0]) == null ? void 0 : m.image;
|
|
36
|
+
return r ? { src: r } : {};
|
|
37
|
+
})
|
|
38
|
+
);
|
|
39
|
+
return V(a) ?? t;
|
|
40
|
+
}, Z = ({ src: a }) => {
|
|
41
|
+
const [t, n] = w(!1);
|
|
42
|
+
return /* @__PURE__ */ e(
|
|
43
|
+
"img",
|
|
44
|
+
{
|
|
45
|
+
src: a,
|
|
46
|
+
alt: "Attachment preview",
|
|
47
|
+
className: p(
|
|
48
|
+
"block h-auto max-h-[80vh] w-auto max-w-full object-contain",
|
|
49
|
+
t ? "aui-attachment-preview-image-loaded" : "aui-attachment-preview-image-loading invisible"
|
|
50
|
+
),
|
|
51
|
+
onLoad: () => n(!0)
|
|
52
|
+
}
|
|
53
|
+
);
|
|
54
|
+
}, ee = ({ children: a }) => {
|
|
55
|
+
const t = j();
|
|
56
|
+
return t ? /* @__PURE__ */ o(G, { children: [
|
|
57
|
+
/* @__PURE__ */ e(
|
|
58
|
+
W,
|
|
59
|
+
{
|
|
60
|
+
className: "aui-attachment-preview-trigger hover:bg-accent/50 cursor-pointer transition-colors",
|
|
61
|
+
asChild: !0,
|
|
62
|
+
children: a
|
|
63
|
+
}
|
|
64
|
+
),
|
|
65
|
+
/* @__PURE__ */ o(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
|
+
/* @__PURE__ */ e(Y, { className: "aui-sr-only sr-only", children: "Image Attachment Preview" }),
|
|
67
|
+
/* @__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
|
+
] })
|
|
69
|
+
] }) : a;
|
|
70
|
+
}, te = () => {
|
|
71
|
+
const a = j();
|
|
72
|
+
return /* @__PURE__ */ o(J, { className: "aui-attachment-tile-avatar h-full w-full rounded-none", children: [
|
|
73
|
+
/* @__PURE__ */ e(
|
|
74
|
+
K,
|
|
75
|
+
{
|
|
76
|
+
src: a,
|
|
77
|
+
alt: "Attachment preview",
|
|
78
|
+
className: "aui-attachment-tile-image object-cover"
|
|
79
|
+
}
|
|
80
|
+
),
|
|
81
|
+
/* @__PURE__ */ e(Q, { children: /* @__PURE__ */ e(h, { className: "aui-attachment-tile-fallback-icon text-muted-foreground size-8" }) })
|
|
82
|
+
] });
|
|
83
|
+
}, I = () => {
|
|
84
|
+
const t = O().attachment.source !== "message", n = l((i) => i.attachment.contentType === D), r = l((i) => i.attachment.contentType === F), c = l((i) => i.attachment.type === "image"), m = l((i) => {
|
|
85
|
+
const b = i.attachment.type;
|
|
86
|
+
switch (b) {
|
|
87
|
+
case "image":
|
|
88
|
+
return "Image";
|
|
89
|
+
case "document":
|
|
90
|
+
return "Document";
|
|
91
|
+
case "file":
|
|
92
|
+
return "File";
|
|
93
|
+
default:
|
|
94
|
+
return b;
|
|
95
|
+
}
|
|
96
|
+
}), d = l(
|
|
97
|
+
(i) => i.attachment.status.type === "running" ? "uploading" : i.attachment.status.type === "incomplete" && i.attachment.status.reason === "error" ? "error" : void 0
|
|
98
|
+
), f = d === "uploading", u = d === "error";
|
|
99
|
+
return n ? /* @__PURE__ */ e(ae, { isComposer: t }) : r ? /* @__PURE__ */ e(re, { isComposer: t }) : c ? /* @__PURE__ */ o($, { children: [
|
|
100
|
+
/* @__PURE__ */ o(
|
|
101
|
+
s.Root,
|
|
102
|
+
{
|
|
103
|
+
className: p(
|
|
104
|
+
"aui-attachment-root relative",
|
|
105
|
+
c && !t && "aui-attachment-root-message only:*:first:size-24"
|
|
106
|
+
),
|
|
107
|
+
children: [
|
|
108
|
+
/* @__PURE__ */ e(ee, { children: /* @__PURE__ */ e(q, { asChild: !0, children: /* @__PURE__ */ o(
|
|
109
|
+
"div",
|
|
110
|
+
{
|
|
111
|
+
className: p(
|
|
112
|
+
"aui-attachment-tile bg-muted relative size-14 cursor-pointer overflow-hidden rounded-[calc(var(--composer-radius)-var(--composer-padding))] border transition-opacity hover:opacity-75",
|
|
113
|
+
u && "border-destructive"
|
|
114
|
+
),
|
|
115
|
+
role: "button",
|
|
116
|
+
tabIndex: 0,
|
|
117
|
+
"aria-label": `${m} attachment${u ? ", upload failed" : f ? ", uploading" : ""}`,
|
|
118
|
+
children: [
|
|
119
|
+
/* @__PURE__ */ e(te, {}),
|
|
120
|
+
f && /* @__PURE__ */ e(
|
|
121
|
+
"div",
|
|
122
|
+
{
|
|
123
|
+
"aria-hidden": "true",
|
|
124
|
+
className: "aui-attachment-tile-uploading bg-background/60 absolute inset-0 flex items-center justify-center backdrop-blur-[1px]",
|
|
125
|
+
children: /* @__PURE__ */ e(C, { className: "text-muted-foreground size-5 animate-spin" })
|
|
126
|
+
}
|
|
127
|
+
),
|
|
128
|
+
u && /* @__PURE__ */ e(
|
|
129
|
+
"div",
|
|
130
|
+
{
|
|
131
|
+
"aria-hidden": "true",
|
|
132
|
+
className: "aui-attachment-tile-error bg-destructive/10 absolute inset-0 flex items-center justify-center",
|
|
133
|
+
children: /* @__PURE__ */ e(k, { className: "text-destructive size-5" })
|
|
134
|
+
}
|
|
135
|
+
)
|
|
136
|
+
]
|
|
137
|
+
}
|
|
138
|
+
) }) }),
|
|
139
|
+
t && /* @__PURE__ */ e(oe, {})
|
|
140
|
+
]
|
|
141
|
+
}
|
|
142
|
+
),
|
|
143
|
+
/* @__PURE__ */ e(B, { side: "top", children: /* @__PURE__ */ e(s.Name, {}) })
|
|
144
|
+
] }) : /* @__PURE__ */ e(
|
|
145
|
+
ne,
|
|
146
|
+
{
|
|
147
|
+
isComposer: t,
|
|
148
|
+
typeLabel: m,
|
|
149
|
+
isUploading: f,
|
|
150
|
+
isError: u
|
|
151
|
+
}
|
|
152
|
+
);
|
|
153
|
+
}, v = ({
|
|
154
|
+
label: a = "Remove attachment"
|
|
155
|
+
}) => /* @__PURE__ */ e(s.Remove, { asChild: !0, children: /* @__PURE__ */ e(
|
|
156
|
+
"button",
|
|
157
|
+
{
|
|
158
|
+
type: "button",
|
|
159
|
+
"aria-label": a,
|
|
160
|
+
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(R, {})
|
|
162
|
+
}
|
|
163
|
+
) }), ae = ({ isComposer: a }) => /* @__PURE__ */ e(s.Root, { className: "aui-attachment-root", children: /* @__PURE__ */ o("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
|
+
/* @__PURE__ */ e(L, { className: "size-3.5 shrink-0 text-muted-foreground" }),
|
|
165
|
+
/* @__PURE__ */ e("span", { className: "truncate", children: /* @__PURE__ */ e(s.Name, {}) }),
|
|
166
|
+
a && /* @__PURE__ */ e(v, { label: "Remove context" })
|
|
167
|
+
] }) }), re = ({ isComposer: a }) => /* @__PURE__ */ e(s.Root, { className: "aui-attachment-root", children: /* @__PURE__ */ o("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
|
+
/* @__PURE__ */ e(S, { className: "size-3.5 shrink-0" }),
|
|
169
|
+
/* @__PURE__ */ o("span", { className: "truncate", children: [
|
|
170
|
+
"Harness · ",
|
|
171
|
+
/* @__PURE__ */ e(s.Name, {})
|
|
172
|
+
] }),
|
|
173
|
+
a && /* @__PURE__ */ e(v, { label: "Remove harness" })
|
|
174
|
+
] }) }), ne = ({ isComposer: a, typeLabel: t, isUploading: n, isError: r }) => /* @__PURE__ */ e(s.Root, { className: "aui-attachment-root", children: /* @__PURE__ */ o("div", { className: "flex w-56 max-w-full items-center gap-2.5 rounded-lg bg-muted p-1.5", children: [
|
|
175
|
+
/* @__PURE__ */ e(
|
|
176
|
+
"div",
|
|
177
|
+
{
|
|
178
|
+
className: p(
|
|
179
|
+
"flex size-9 shrink-0 items-center justify-center rounded-md bg-background text-muted-foreground [&_svg]:size-4.5",
|
|
180
|
+
r && "text-destructive"
|
|
181
|
+
),
|
|
182
|
+
children: n ? /* @__PURE__ */ e(C, { className: "size-4 animate-spin" }) : r ? /* @__PURE__ */ e(k, {}) : /* @__PURE__ */ e(h, {})
|
|
183
|
+
}
|
|
184
|
+
),
|
|
185
|
+
/* @__PURE__ */ o("div", { className: "min-w-0 flex-1", children: [
|
|
186
|
+
/* @__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: r ? "Upload failed" : n ? "Uploading…" : t })
|
|
188
|
+
] }),
|
|
189
|
+
a && /* @__PURE__ */ e(v, { label: "Remove file" })
|
|
190
|
+
] }) }), oe = () => /* @__PURE__ */ e(s.Remove, { asChild: !0, children: /* @__PURE__ */ e(
|
|
191
|
+
g,
|
|
192
|
+
{
|
|
193
|
+
tooltip: "Remove file",
|
|
194
|
+
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
|
+
side: "top",
|
|
196
|
+
children: /* @__PURE__ */ e(R, { className: "aui-attachment-remove-icon size-3 dark:stroke-[2.5px]" })
|
|
197
|
+
}
|
|
198
|
+
) }), we = () => /* @__PURE__ */ e("div", { className: "aui-user-message-attachments-end col-span-full col-start-1 row-start-1 flex w-full flex-row justify-end gap-2", children: /* @__PURE__ */ e(M.Attachments, { children: () => /* @__PURE__ */ e(I, {}) }) }), Ce = () => /* @__PURE__ */ e("div", { className: "aui-composer-attachments flex w-full flex-row items-center gap-2 overflow-x-auto empty:hidden", children: /* @__PURE__ */ e(T.Attachments, { children: () => /* @__PURE__ */ e(I, {}) }) }), ke = () => /* @__PURE__ */ e(T.AddAttachment, { asChild: !0, children: /* @__PURE__ */ e(
|
|
199
|
+
g,
|
|
200
|
+
{
|
|
201
|
+
tooltip: "Add Attachment",
|
|
202
|
+
side: "bottom",
|
|
203
|
+
variant: "ghost",
|
|
204
|
+
size: "icon",
|
|
205
|
+
className: "aui-composer-add-attachment hover:bg-muted-foreground/15 dark:border-muted-foreground/15 dark:hover:bg-muted-foreground/30 size-7 rounded-full p-1 text-xs font-semibold",
|
|
206
|
+
"aria-label": "Add Attachment",
|
|
207
|
+
children: /* @__PURE__ */ e(_, { className: "aui-attachment-add-icon size-4.5 stroke-[1.5px]" })
|
|
208
|
+
}
|
|
209
|
+
) }), ie = "image/png,image/jpeg,image/webp,image/gif", se = /* @__PURE__ */ new Set([
|
|
210
|
+
"image/png",
|
|
211
|
+
"image/jpeg",
|
|
212
|
+
"image/webp",
|
|
213
|
+
"image/gif"
|
|
214
|
+
]), x = [
|
|
215
|
+
"application/pdf",
|
|
216
|
+
"application/msword",
|
|
217
|
+
"application/vnd.openxmlformats-officedocument.wordprocessingml.document",
|
|
218
|
+
"application/rtf",
|
|
219
|
+
"application/vnd.oasis.opendocument.text",
|
|
220
|
+
"application/vnd.ms-powerpoint",
|
|
221
|
+
"application/vnd.openxmlformats-officedocument.presentationml.presentation",
|
|
222
|
+
"application/vnd.ms-excel",
|
|
223
|
+
"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet",
|
|
224
|
+
"text/plain",
|
|
225
|
+
"text/markdown",
|
|
226
|
+
"text/csv",
|
|
227
|
+
"text/tab-separated-values",
|
|
228
|
+
"text/html",
|
|
229
|
+
"text/xml",
|
|
230
|
+
"text/css",
|
|
231
|
+
"application/json",
|
|
232
|
+
"application/javascript",
|
|
233
|
+
"application/typescript",
|
|
234
|
+
".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"
|
|
235
|
+
].join(","), ce = `${ie},${x}`, le = (a) => new Promise((t, n) => {
|
|
236
|
+
const r = new FileReader();
|
|
237
|
+
r.onload = () => t(r.result), r.onerror = () => n(r.error), r.readAsDataURL(a);
|
|
238
|
+
});
|
|
239
|
+
class Re {
|
|
240
|
+
constructor() {
|
|
241
|
+
y(this, "accept", x);
|
|
242
|
+
}
|
|
243
|
+
async add({ file: t }) {
|
|
244
|
+
return {
|
|
245
|
+
id: t.name,
|
|
246
|
+
type: "document",
|
|
247
|
+
name: t.name,
|
|
248
|
+
contentType: t.type || "application/octet-stream",
|
|
249
|
+
file: t,
|
|
250
|
+
status: { type: "requires-action", reason: "composer-send" }
|
|
251
|
+
};
|
|
252
|
+
}
|
|
253
|
+
async send(t) {
|
|
254
|
+
return {
|
|
255
|
+
...t,
|
|
256
|
+
status: { type: "complete" },
|
|
257
|
+
content: [
|
|
258
|
+
{
|
|
259
|
+
type: "file",
|
|
260
|
+
filename: t.name,
|
|
261
|
+
data: await le(t.file),
|
|
262
|
+
mimeType: t.contentType || "application/octet-stream"
|
|
263
|
+
}
|
|
264
|
+
]
|
|
265
|
+
};
|
|
266
|
+
}
|
|
267
|
+
async remove() {
|
|
268
|
+
}
|
|
269
|
+
}
|
|
270
|
+
const Te = () => {
|
|
271
|
+
const a = z(), t = N(null), n = (r) => {
|
|
272
|
+
if (r != null && r.length)
|
|
273
|
+
for (const c of Array.from(r))
|
|
274
|
+
c.type.startsWith("image/") && !se.has(c.type) || a.addAttachment(c);
|
|
275
|
+
};
|
|
276
|
+
return /* @__PURE__ */ o(A, { children: [
|
|
277
|
+
/* @__PURE__ */ e(
|
|
278
|
+
"input",
|
|
279
|
+
{
|
|
280
|
+
ref: t,
|
|
281
|
+
hidden: !0,
|
|
282
|
+
type: "file",
|
|
283
|
+
accept: ce,
|
|
284
|
+
multiple: !0,
|
|
285
|
+
onChange: (r) => {
|
|
286
|
+
n(r.currentTarget.files), r.currentTarget.value = "";
|
|
287
|
+
}
|
|
288
|
+
}
|
|
289
|
+
),
|
|
290
|
+
/* @__PURE__ */ e(
|
|
291
|
+
g,
|
|
292
|
+
{
|
|
293
|
+
tooltip: "Upload image or file",
|
|
294
|
+
side: "top",
|
|
295
|
+
type: "button",
|
|
296
|
+
variant: "ghost",
|
|
297
|
+
size: "icon",
|
|
298
|
+
className: "aui-composer-add-image hover:bg-muted-foreground/15 dark:border-muted-foreground/15 dark:hover:bg-muted-foreground/30 size-7 rounded-full p-1",
|
|
299
|
+
"aria-label": "Upload image or file",
|
|
300
|
+
onClick: () => {
|
|
301
|
+
var r;
|
|
302
|
+
return (r = t.current) == null ? void 0 : r.click();
|
|
303
|
+
},
|
|
304
|
+
children: /* @__PURE__ */ e(h, { className: "aui-attachment-add-file-icon size-4.5 stroke-[1.5px]" })
|
|
305
|
+
}
|
|
306
|
+
)
|
|
307
|
+
] });
|
|
308
|
+
}, ze = () => {
|
|
309
|
+
const a = z(), t = N(null);
|
|
310
|
+
return /* @__PURE__ */ o(A, { children: [
|
|
311
|
+
/* @__PURE__ */ e(
|
|
312
|
+
"input",
|
|
313
|
+
{
|
|
314
|
+
ref: t,
|
|
315
|
+
hidden: !0,
|
|
316
|
+
type: "file",
|
|
317
|
+
accept: x,
|
|
318
|
+
multiple: !0,
|
|
319
|
+
onChange: (n) => {
|
|
320
|
+
for (const r of Array.from(n.currentTarget.files ?? []))
|
|
321
|
+
a.addAttachment(r);
|
|
322
|
+
n.currentTarget.value = "";
|
|
323
|
+
}
|
|
324
|
+
}
|
|
325
|
+
),
|
|
326
|
+
/* @__PURE__ */ e(
|
|
327
|
+
g,
|
|
328
|
+
{
|
|
329
|
+
tooltip: "Attach business documents",
|
|
330
|
+
side: "top",
|
|
331
|
+
type: "button",
|
|
332
|
+
variant: "ghost",
|
|
333
|
+
size: "icon",
|
|
334
|
+
className: "aui-composer-add-document hover:bg-muted-foreground/15 size-7 rounded-full p-1",
|
|
335
|
+
"aria-label": "Attach business documents",
|
|
336
|
+
onClick: () => {
|
|
337
|
+
var n;
|
|
338
|
+
return (n = t.current) == null ? void 0 : n.click();
|
|
339
|
+
},
|
|
340
|
+
children: /* @__PURE__ */ e(h, { className: "size-4.5 stroke-[1.5px]" })
|
|
341
|
+
}
|
|
342
|
+
)
|
|
343
|
+
] });
|
|
344
|
+
};
|
|
345
|
+
export {
|
|
346
|
+
x as ACTIONEER_FILE_ACCEPT,
|
|
347
|
+
Re as ActioneerFileAttachmentAdapter,
|
|
348
|
+
ke as ComposerAddAttachment,
|
|
349
|
+
ze as ComposerAddDocument,
|
|
350
|
+
Te as ComposerAddImage,
|
|
351
|
+
Ce as ComposerAttachments,
|
|
352
|
+
we as UserMessageAttachments
|
|
353
|
+
};
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { ComponentProps } from 'react';
|
|
2
|
+
import { VariantProps } from 'class-variance-authority';
|
|
3
|
+
declare const badgeVariants: (props?: ({
|
|
4
|
+
variant?: "success" | "warning" | "info" | "muted" | "secondary" | "outline" | "ghost" | "destructive" | null | undefined;
|
|
5
|
+
size?: "default" | "sm" | "lg" | null | undefined;
|
|
6
|
+
} & import('class-variance-authority/types').ClassProp) | undefined) => string;
|
|
7
|
+
export type BadgeProps = ComponentProps<"span"> & VariantProps<typeof badgeVariants> & {
|
|
8
|
+
asChild?: boolean;
|
|
9
|
+
};
|
|
10
|
+
declare function Badge({ className, variant, size, asChild, ...props }: BadgeProps): import("react").JSX.Element;
|
|
11
|
+
export { Badge, badgeVariants };
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsx as n } from "react/jsx-runtime";
|
|
3
|
+
import { Slot as g } from "radix-ui";
|
|
4
|
+
import { cva as s } from "class-variance-authority";
|
|
5
|
+
import { cn as b } from "../../lib/cn.js";
|
|
6
|
+
const m = s(
|
|
7
|
+
"inline-flex items-center justify-center gap-1 rounded-md text-xs font-medium transition-colors [&_svg]:size-3 [&_svg]:shrink-0",
|
|
8
|
+
{
|
|
9
|
+
variants: {
|
|
10
|
+
variant: {
|
|
11
|
+
outline: "border-input text-muted-foreground [a&]:hover:bg-accent [a&]:hover:text-accent-foreground border bg-transparent",
|
|
12
|
+
secondary: "bg-secondary text-secondary-foreground [a&]:hover:bg-secondary/80",
|
|
13
|
+
muted: "bg-muted text-muted-foreground [a&]:hover:bg-muted/80 [a&]:hover:text-foreground",
|
|
14
|
+
ghost: "text-muted-foreground [a&]:hover:bg-accent [a&]:hover:text-accent-foreground bg-transparent",
|
|
15
|
+
info: "bg-blue-100 text-blue-700 dark:bg-blue-900/50 dark:text-blue-300 [a&]:hover:bg-blue-100/80",
|
|
16
|
+
warning: "bg-amber-100 text-amber-700 dark:bg-amber-900/50 dark:text-amber-300 [a&]:hover:bg-amber-100/80",
|
|
17
|
+
success: "bg-emerald-100 text-emerald-700 dark:bg-emerald-900/50 dark:text-emerald-300 [a&]:hover:bg-emerald-100/80",
|
|
18
|
+
destructive: "bg-red-100 text-red-700 dark:bg-red-900/50 dark:text-red-300 [a&]:hover:bg-red-100/80"
|
|
19
|
+
},
|
|
20
|
+
size: {
|
|
21
|
+
sm: "px-1.5 py-0.5",
|
|
22
|
+
default: "px-2 py-1",
|
|
23
|
+
lg: "px-2.5 py-1.5 text-sm"
|
|
24
|
+
}
|
|
25
|
+
},
|
|
26
|
+
defaultVariants: {
|
|
27
|
+
variant: "outline",
|
|
28
|
+
size: "default"
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
);
|
|
32
|
+
function x({
|
|
33
|
+
className: r,
|
|
34
|
+
variant: e,
|
|
35
|
+
size: t,
|
|
36
|
+
asChild: a = !1,
|
|
37
|
+
...o
|
|
38
|
+
}) {
|
|
39
|
+
const d = a ? g.Root : "span";
|
|
40
|
+
return /* @__PURE__ */ n(
|
|
41
|
+
d,
|
|
42
|
+
{
|
|
43
|
+
"data-slot": "badge",
|
|
44
|
+
"data-variant": e,
|
|
45
|
+
"data-size": t,
|
|
46
|
+
className: b(m({ variant: e, size: t }), r),
|
|
47
|
+
...o
|
|
48
|
+
}
|
|
49
|
+
);
|
|
50
|
+
}
|
|
51
|
+
export {
|
|
52
|
+
x as Badge,
|
|
53
|
+
m as badgeVariants
|
|
54
|
+
};
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsxs as t, jsx as e } from "react/jsx-runtime";
|
|
3
|
+
import { TooltipIconButton as i } from "./tooltip-icon-button.js";
|
|
4
|
+
import { cn as m } from "../../lib/cn.js";
|
|
5
|
+
import { BranchPickerPrimitive as r } from "@assistant-ui/react";
|
|
6
|
+
import { ChevronLeft as s, ChevronRight as l } from "../../lib/icons.js";
|
|
7
|
+
const f = ({
|
|
8
|
+
className: o,
|
|
9
|
+
// Default matches production usage — the picker hides on messages with
|
|
10
|
+
// only one branch. Showcase demos pass `hideWhenSingleBranch={false}` to
|
|
11
|
+
// keep it visible without seeding a real branch history.
|
|
12
|
+
hideWhenSingleBranch: n = !0,
|
|
13
|
+
...c
|
|
14
|
+
}) => /* @__PURE__ */ t(
|
|
15
|
+
r.Root,
|
|
16
|
+
{
|
|
17
|
+
hideWhenSingleBranch: n,
|
|
18
|
+
className: m(
|
|
19
|
+
"aui-branch-picker-root text-muted-foreground -ms-2 me-2 inline-flex items-center text-xs",
|
|
20
|
+
o
|
|
21
|
+
),
|
|
22
|
+
...c,
|
|
23
|
+
children: [
|
|
24
|
+
/* @__PURE__ */ e(r.Previous, { asChild: !0, children: /* @__PURE__ */ e(i, { tooltip: "Previous", children: /* @__PURE__ */ e(s, {}) }) }),
|
|
25
|
+
/* @__PURE__ */ t("span", { className: "aui-branch-picker-state font-medium", children: [
|
|
26
|
+
/* @__PURE__ */ e(r.Number, {}),
|
|
27
|
+
" / ",
|
|
28
|
+
/* @__PURE__ */ e(r.Count, {})
|
|
29
|
+
] }),
|
|
30
|
+
/* @__PURE__ */ e(r.Next, { asChild: !0, children: /* @__PURE__ */ e(i, { tooltip: "Next", children: /* @__PURE__ */ e(l, {}) }) })
|
|
31
|
+
]
|
|
32
|
+
}
|
|
33
|
+
);
|
|
34
|
+
export {
|
|
35
|
+
f as BranchPicker
|
|
36
|
+
};
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import { FC, PropsWithChildren } from 'react';
|
|
2
|
+
import { VariantProps } from 'class-variance-authority';
|
|
3
|
+
import { Collapsible, CollapsibleContent, CollapsibleTrigger } from '../ui/collapsible';
|
|
4
|
+
declare const chainOfThoughtVariants: (props?: ({
|
|
5
|
+
variant?: "muted" | "outline" | "ghost" | null | undefined;
|
|
6
|
+
} & import('class-variance-authority/types').ClassProp) | undefined) => string;
|
|
7
|
+
export type ChainOfThoughtRootProps = Omit<React.ComponentProps<typeof Collapsible>, "open" | "onOpenChange"> & VariantProps<typeof chainOfThoughtVariants>;
|
|
8
|
+
/**
|
|
9
|
+
* Collapsible wrapper for a message's chain of thought (reasoning +
|
|
10
|
+
* tool-call parts). Open state is the assistant-ui `chainOfThought` scope's
|
|
11
|
+
* `collapsed` flag, so `ChainOfThoughtPrimitive.AccordionTrigger` elsewhere
|
|
12
|
+
* stays in sync. Must render inside a message scope.
|
|
13
|
+
*/
|
|
14
|
+
declare function ChainOfThoughtRoot({ className, variant, children, ...props }: ChainOfThoughtRootProps): import("react").JSX.Element;
|
|
15
|
+
declare function ChainOfThoughtTrigger({ active, className, children, ...props }: React.ComponentProps<typeof CollapsibleTrigger> & {
|
|
16
|
+
/** Shimmer + spinner while the chain is streaming. Defaults to the scope's running status. */
|
|
17
|
+
active?: boolean;
|
|
18
|
+
}): import("react").JSX.Element;
|
|
19
|
+
declare function ChainOfThoughtContent({ className, children, ...props }: React.ComponentProps<typeof CollapsibleContent>): import("react").JSX.Element;
|
|
20
|
+
type ChainOfThoughtProps = PropsWithChildren<{
|
|
21
|
+
/**
|
|
22
|
+
* The `"group-chainOfThought"` group part from
|
|
23
|
+
* `MessagePrimitive.GroupedParts`. REQUIRED there: `GroupedParts` does not
|
|
24
|
+
* provide the `chainOfThought` scope itself (only `MessagePrimitive.Parts`'
|
|
25
|
+
* components path does), so the indices are used to mount
|
|
26
|
+
* `ChainOfThoughtByIndicesProvider` — without it the scope selectors throw.
|
|
27
|
+
*/
|
|
28
|
+
group?: {
|
|
29
|
+
indices: readonly number[];
|
|
30
|
+
} | undefined;
|
|
31
|
+
}>;
|
|
32
|
+
type ChainOfThoughtComponent = FC<ChainOfThoughtProps> & {
|
|
33
|
+
Root: typeof ChainOfThoughtRoot;
|
|
34
|
+
Trigger: typeof ChainOfThoughtTrigger;
|
|
35
|
+
Content: typeof ChainOfThoughtContent;
|
|
36
|
+
};
|
|
37
|
+
/**
|
|
38
|
+
* Assembled chain-of-thought accordion. Two integration paths:
|
|
39
|
+
* - `MessagePrimitive.Parts` `components={{ ChainOfThought }}` — the scope is
|
|
40
|
+
* auto-mounted; `ChainOfThought` renders its own parts. (Preferred.)
|
|
41
|
+
* - Thread's `ChainOfThoughtGroup` override — pass the group + children so the
|
|
42
|
+
* scope mounts: `({ group, children }) => <ChainOfThought group={group}>
|
|
43
|
+
* {children}</ChainOfThought>`.
|
|
44
|
+
*/
|
|
45
|
+
declare const ChainOfThought: ChainOfThoughtComponent;
|
|
46
|
+
export { ChainOfThought, ChainOfThoughtRoot, ChainOfThoughtTrigger, ChainOfThoughtContent, chainOfThoughtVariants, };
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
import { ReactNode } from 'react';
|
|
2
|
+
import { AttachmentAdapter, Attachment, CompleteAttachment, PendingAttachment } from '@assistant-ui/react';
|
|
3
|
+
/**
|
|
4
|
+
* "@" context linking for the chat composer — replaces the stock
|
|
5
|
+
* add-attachment "+" with a cascading picker over the agent's context. It
|
|
6
|
+
* drills into a tree (e.g. Data Integrations → connection → table → columns,
|
|
7
|
+
* or Studio → Skills / Memory) and attaches the chosen node as a composer
|
|
8
|
+
* attachment chip via `ContextAttachmentAdapter`, so removal + per-message
|
|
9
|
+
* chips come from assistant-ui's own plumbing.
|
|
10
|
+
*
|
|
11
|
+
* The tree comes from `ComposerContextProvider` (supplied by the product
|
|
12
|
+
* screen), keeping this component product-agnostic.
|
|
13
|
+
*/
|
|
14
|
+
export declare const CONTEXT_MIME = "application/x-actioneer-context";
|
|
15
|
+
export interface ContextNode {
|
|
16
|
+
id: string;
|
|
17
|
+
label: string;
|
|
18
|
+
/** Leading icon (ReactNode) — an ADS icon or an <img> logo. */
|
|
19
|
+
icon?: ReactNode;
|
|
20
|
+
/** Trailing meta shown muted (e.g. a column type). */
|
|
21
|
+
hint?: string;
|
|
22
|
+
/** A branch that can ALSO be attached wholesale ("Add all of …"). */
|
|
23
|
+
addable?: boolean;
|
|
24
|
+
children?: ContextNode[];
|
|
25
|
+
}
|
|
26
|
+
/** Called when a Studio context node is attached, so the host can record file
|
|
27
|
+
* usage. `name` is the attachment name; `keys` are the Studio file keys it
|
|
28
|
+
* covers. Injected by the host — ADS ships no telemetry, so the default is a
|
|
29
|
+
* no-op. */
|
|
30
|
+
export type StageUsageHandler = (name: string, keys: string[]) => void;
|
|
31
|
+
export declare function ComposerContextProvider({ tree, onStageUsage, children, }: {
|
|
32
|
+
tree: ContextNode[];
|
|
33
|
+
/** Optional usage-recording hook; see {@link StageUsageHandler}. */
|
|
34
|
+
onStageUsage?: StageUsageHandler;
|
|
35
|
+
children: ReactNode;
|
|
36
|
+
}): import("react").JSX.Element;
|
|
37
|
+
export declare function ComposerAddContext(): import("react").JSX.Element | null;
|
|
38
|
+
/**
|
|
39
|
+
* Turns a picked context node (a synthetic `.context` File) into a document
|
|
40
|
+
* attachment chip; on send it becomes a file part the model adapter can read
|
|
41
|
+
* from `message.attachments` — nothing leaks into the visible message text.
|
|
42
|
+
*/
|
|
43
|
+
export declare class ContextAttachmentAdapter implements AttachmentAdapter {
|
|
44
|
+
accept: string;
|
|
45
|
+
add(state: {
|
|
46
|
+
file: File;
|
|
47
|
+
}): Promise<PendingAttachment>;
|
|
48
|
+
send(attachment: PendingAttachment): Promise<CompleteAttachment>;
|
|
49
|
+
remove(_attachment: Attachment): Promise<void>;
|
|
50
|
+
}
|