@actioneer/ads 0.2.4 → 0.3.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/components/ai-elements/chain-of-thought.d.ts +64 -2
- package/components/ai-elements/chain-of-thought.js +319 -100
- package/components/ai-elements/chart.d.ts +30 -0
- package/components/ai-elements/chart.js +303 -0
- package/components/ai-elements/index.d.ts +2 -0
- package/components/ai-elements/message.d.ts +12 -2
- package/components/ai-elements/message.js +133 -100
- package/components/ai-elements/research-activity.d.ts +45 -0
- package/components/ai-elements/research-activity.js +260 -0
- package/components/ai-elements/tool.js +42 -38
- package/components/answer.d.ts +16 -0
- package/components/answer.js +273 -249
- package/components/assistant-ui/attachment.js +5 -1
- package/components/assistant-ui/composer-deep-research.js +44 -29
- package/components/assistant-ui/composer-harness.js +45 -27
- package/components/assistant-ui/composer.js +16 -16
- package/components/assistant-ui/index.d.ts +0 -1
- package/components/assistant-ui/message.d.ts +7 -0
- package/components/assistant-ui/message.js +36 -36
- package/components/assistant-ui/thread.js +1 -1
- package/components/brand-texture.d.ts +37 -0
- package/components/brand-texture.js +54 -0
- package/components/code-block.d.ts +36 -0
- package/components/code-block.js +136 -0
- package/components/drawer.d.ts +1 -1
- package/components/file-dropzone.d.ts +32 -0
- package/components/file-dropzone.js +134 -0
- package/components/index.d.ts +10 -0
- package/components/index.js +482 -433
- package/components/infinite-canvas.d.ts +50 -0
- package/components/infinite-canvas.js +215 -0
- package/components/page-header.d.ts +22 -0
- package/components/page-header.js +52 -0
- package/components/resizable-panel.d.ts +29 -0
- package/components/resizable-panel.js +102 -0
- package/components/reveal.d.ts +36 -0
- package/components/reveal.js +35 -0
- package/components/scroll-area.d.ts +19 -0
- package/components/scroll-area.js +57 -0
- package/components/setting-row.d.ts +35 -0
- package/components/setting-row.js +86 -0
- package/components/sidebar.js +131 -131
- package/components/stepper.d.ts +32 -0
- package/components/stepper.js +113 -0
- package/components/table.js +16 -15
- package/components/tabs.js +1 -1
- package/lib/icons.d.ts +12 -0
- package/lib/icons.js +98 -95
- package/lib/motion.d.ts +5 -3
- package/lib/motion.js +28 -27
- package/llms.txt +122 -28
- package/manifest.json +871 -73
- package/package.json +2 -2
- package/styles.css +71 -28
- package/theme.css +19 -15
- package/components/assistant-ui/smart-message-text.d.ts +0 -15
- package/components/assistant-ui/smart-message-text.js +0 -29
|
@@ -8,11 +8,16 @@ import { ComponentProps, ReactNode } from 'react';
|
|
|
8
8
|
*/
|
|
9
9
|
export type ChainOfThoughtProps = ComponentProps<"div">;
|
|
10
10
|
export declare const ChainOfThought: import('react').MemoExoticComponent<({ className, role, ...props }: ChainOfThoughtProps) => import("react").JSX.Element>;
|
|
11
|
-
|
|
11
|
+
/**
|
|
12
|
+
* Step lifecycle mirrors the production work-trace statuses: steps stream in
|
|
13
|
+
* as `active`, settle to `complete`, and surface failures as `error` — an
|
|
14
|
+
* error is an execution fact shown in place, not a hidden retry.
|
|
15
|
+
*/
|
|
16
|
+
export type ChainOfThoughtStatus = "complete" | "active" | "pending" | "error";
|
|
12
17
|
export type ChainOfThoughtStepProps = ComponentProps<typeof Collapsible> & {
|
|
13
18
|
status?: ChainOfThoughtStatus;
|
|
14
19
|
};
|
|
15
|
-
export declare const ChainOfThoughtStep: import('react').MemoExoticComponent<({ className, defaultOpen, status, role, ...props }: ChainOfThoughtStepProps) => import("react").JSX.Element>;
|
|
20
|
+
export declare const ChainOfThoughtStep: import('react').MemoExoticComponent<({ className, defaultOpen, open: controlledOpen, onOpenChange, status, role, "aria-busy": ariaBusy, ...props }: ChainOfThoughtStepProps) => import("react").JSX.Element>;
|
|
16
21
|
export type ChainOfThoughtTriggerProps = Omit<ComponentProps<typeof CollapsibleTrigger>, "asChild" | "children"> & {
|
|
17
22
|
children: ReactNode;
|
|
18
23
|
/** Semantic icon rendered on the reasoning rail. */
|
|
@@ -31,6 +36,63 @@ export type ChainOfThoughtSearchResultsProps = ComponentProps<"div">;
|
|
|
31
36
|
export declare const ChainOfThoughtSearchResults: import('react').MemoExoticComponent<({ className, ...props }: ChainOfThoughtSearchResultsProps) => import("react").JSX.Element>;
|
|
32
37
|
export type ChainOfThoughtSearchResultProps = ComponentProps<typeof Badge>;
|
|
33
38
|
export declare const ChainOfThoughtSearchResult: import('react').MemoExoticComponent<({ className, children, ...props }: ChainOfThoughtSearchResultProps) => import("react").JSX.Element>;
|
|
39
|
+
export type ChainOfThoughtEvidenceProps = Omit<ComponentProps<typeof Collapsible>, "title"> & {
|
|
40
|
+
/** Short artifact name, e.g. "NPA movement — last 4 quarters". */
|
|
41
|
+
title: ReactNode;
|
|
42
|
+
/** Stable result tag badge, e.g. "E1". */
|
|
43
|
+
tag?: ReactNode;
|
|
44
|
+
/** Trailing scale hint on the closed chip, e.g. "128 rows" or "chart". */
|
|
45
|
+
meta?: ReactNode;
|
|
46
|
+
/** Provenance footer under the preview, e.g. "core_banking.npa_movement". */
|
|
47
|
+
source?: ReactNode;
|
|
48
|
+
/** Execution failure shown in place of (or alongside) the preview. */
|
|
49
|
+
error?: ReactNode;
|
|
50
|
+
/** Swap the leading Database glyph. Errors default to a warning glyph. */
|
|
51
|
+
icon?: ReactNode;
|
|
52
|
+
};
|
|
53
|
+
/**
|
|
54
|
+
* A bounded evidence preview riding inside a step: collapsed to a one-line
|
|
55
|
+
* chip by default, expanding to a capped artifact preview (table, chart) with
|
|
56
|
+
* its provenance. Evidence stays visually secondary to the step's finding —
|
|
57
|
+
* supporting detail on demand, never competing with the answer. Errors render
|
|
58
|
+
* in place as facts.
|
|
59
|
+
*/
|
|
60
|
+
export declare const ChainOfThoughtEvidence: import('react').MemoExoticComponent<({ className, title, tag, meta, source, error, icon, defaultOpen, children, ...props }: ChainOfThoughtEvidenceProps) => import("react").JSX.Element>;
|
|
61
|
+
export interface ChainOfThoughtEvidenceColumn {
|
|
62
|
+
key: string;
|
|
63
|
+
label: ReactNode;
|
|
64
|
+
align?: "start" | "end";
|
|
65
|
+
}
|
|
66
|
+
export type ChainOfThoughtEvidenceTableProps = Omit<ComponentProps<"div">, "children"> & {
|
|
67
|
+
columns: ChainOfThoughtEvidenceColumn[];
|
|
68
|
+
/** Bounded preview rows — the deterministic capped preview, never the full artifact. */
|
|
69
|
+
rows: Record<string, ReactNode>[];
|
|
70
|
+
/** True row count in the committed artifact; a truncation footer appears when larger. */
|
|
71
|
+
totalRows?: number;
|
|
72
|
+
/** Flags the matching row for emphasis, e.g. the risk outlier. */
|
|
73
|
+
flag?: {
|
|
74
|
+
key: string;
|
|
75
|
+
value: string | number;
|
|
76
|
+
color?: "default" | "danger" | "warning";
|
|
77
|
+
};
|
|
78
|
+
};
|
|
79
|
+
/**
|
|
80
|
+
* The capped tabular preview inside {@link ChainOfThoughtEvidence}: sticky
|
|
81
|
+
* header, quiet surface fill, optional flagged-row emphasis, and an explicit
|
|
82
|
+
* "N of M rows" footer whenever the preview is truncated.
|
|
83
|
+
*/
|
|
84
|
+
export declare const ChainOfThoughtEvidenceTable: import('react').MemoExoticComponent<({ className, columns, rows, totalRows, flag, ...props }: ChainOfThoughtEvidenceTableProps) => import("react").JSX.Element>;
|
|
85
|
+
export type ChainOfThoughtMetricsProps = ComponentProps<"div">;
|
|
86
|
+
/** A quiet inline stat row — no fills, separated by spacing alone. */
|
|
87
|
+
export declare const ChainOfThoughtMetrics: import('react').MemoExoticComponent<({ className, role, ...props }: ChainOfThoughtMetricsProps) => import("react").JSX.Element>;
|
|
88
|
+
export type ChainOfThoughtMetricProps = Omit<ComponentProps<"div">, "children" | "color"> & {
|
|
89
|
+
label: ReactNode;
|
|
90
|
+
value: ReactNode;
|
|
91
|
+
/** Qualifier under the value, e.g. "of ₹8,400 Cr book". */
|
|
92
|
+
sub?: ReactNode;
|
|
93
|
+
color?: "default" | "danger" | "warning" | "success" | "info";
|
|
94
|
+
};
|
|
95
|
+
export declare const ChainOfThoughtMetric: import('react').MemoExoticComponent<({ className, label, value, sub, color, role, ...props }: ChainOfThoughtMetricProps) => import("react").JSX.Element>;
|
|
34
96
|
export type ChainOfThoughtImageProps = ComponentProps<"div"> & {
|
|
35
97
|
caption?: string;
|
|
36
98
|
};
|
|
@@ -1,172 +1,391 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import { jsx as
|
|
3
|
-
import { Badge as
|
|
4
|
-
import { Collapsible as
|
|
5
|
-
import { ChevronRight as
|
|
6
|
-
import { cn as
|
|
7
|
-
import { memo as
|
|
8
|
-
const
|
|
9
|
-
({ className:
|
|
2
|
+
import { jsx as t, jsxs as d, Fragment as C } from "react/jsx-runtime";
|
|
3
|
+
import { Badge as b } from "../badge.js";
|
|
4
|
+
import { Collapsible as v, CollapsibleTrigger as y, CollapsibleContent as N } from "../collapsible.js";
|
|
5
|
+
import { ChevronRight as w, WarningCircle as O, Database as k, ChevronDown as S } from "../../lib/icons.js";
|
|
6
|
+
import { cn as r } from "../../lib/cn.js";
|
|
7
|
+
import { memo as c, useState as z, useRef as E, useEffect as R } from "react";
|
|
8
|
+
const j = c(
|
|
9
|
+
({ className: o, role: i = "list", ...a }) => /* @__PURE__ */ t(
|
|
10
10
|
"div",
|
|
11
11
|
{
|
|
12
12
|
"data-slot": "chain-of-thought",
|
|
13
|
-
role:
|
|
14
|
-
className:
|
|
13
|
+
role: i,
|
|
14
|
+
className: r(
|
|
15
15
|
"w-full",
|
|
16
16
|
"[&>[data-slot=chain-of-thought-step]:not(:has(~_[data-slot=chain-of-thought-step]))]:pb-0",
|
|
17
17
|
"[&>[data-slot=chain-of-thought-step]:not(:has(~_[data-slot=chain-of-thought-step]))]:before:hidden",
|
|
18
|
-
|
|
18
|
+
o
|
|
19
19
|
),
|
|
20
|
-
...
|
|
20
|
+
...a
|
|
21
21
|
}
|
|
22
22
|
)
|
|
23
|
-
),
|
|
23
|
+
), M = c(
|
|
24
24
|
({
|
|
25
|
-
className:
|
|
26
|
-
defaultOpen:
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
e
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
25
|
+
className: o,
|
|
26
|
+
defaultOpen: i,
|
|
27
|
+
open: a,
|
|
28
|
+
onOpenChange: n,
|
|
29
|
+
status: e = "complete",
|
|
30
|
+
role: s = "listitem",
|
|
31
|
+
"aria-busy": h,
|
|
32
|
+
...m
|
|
33
|
+
}) => {
|
|
34
|
+
const l = a !== void 0, [g, u] = z(
|
|
35
|
+
i ?? e === "active"
|
|
36
|
+
), f = E(e), p = f.current !== "active" && e === "active", T = l ? a : p || g;
|
|
37
|
+
return R(() => {
|
|
38
|
+
const x = f.current;
|
|
39
|
+
f.current = e, !(x === "active" || e !== "active") && (l || u(!0), n == null || n(!0));
|
|
40
|
+
}, [l, n, e]), /* @__PURE__ */ t(
|
|
41
|
+
v,
|
|
42
|
+
{
|
|
43
|
+
"data-slot": "chain-of-thought-step",
|
|
44
|
+
"data-status": e,
|
|
45
|
+
open: T,
|
|
46
|
+
onOpenChange: (x) => {
|
|
47
|
+
l || u(x), n == null || n(x);
|
|
48
|
+
},
|
|
49
|
+
role: s,
|
|
50
|
+
"aria-current": e === "active" ? "step" : void 0,
|
|
51
|
+
"aria-busy": h ?? (e === "active" || void 0),
|
|
52
|
+
className: r(
|
|
53
|
+
"group/cot-step relative pb-2",
|
|
54
|
+
// Connector rail: a 16px segment centred in the 28px gap between a
|
|
55
|
+
// collapsed step's icon and the next one (top-8 = 32px from the step
|
|
56
|
+
// top, ending 4px past its box). It stretches with an open step.
|
|
57
|
+
"before:absolute before:top-8 before:-bottom-1 before:left-2 before:w-px before:bg-border before:content-['']",
|
|
58
|
+
e === "complete" && "text-secondary",
|
|
59
|
+
e === "active" && "text-primary",
|
|
60
|
+
e === "pending" && "text-tertiary/60",
|
|
61
|
+
e === "error" && "text-danger",
|
|
62
|
+
o
|
|
63
|
+
),
|
|
64
|
+
...m
|
|
65
|
+
}
|
|
66
|
+
);
|
|
67
|
+
}
|
|
68
|
+
), _ = c(
|
|
50
69
|
({
|
|
51
|
-
className:
|
|
52
|
-
children:
|
|
53
|
-
leftIcon:
|
|
70
|
+
className: o,
|
|
71
|
+
children: i,
|
|
72
|
+
leftIcon: a,
|
|
54
73
|
endContent: n,
|
|
55
|
-
swapIconOnHover:
|
|
56
|
-
...
|
|
57
|
-
}) => /* @__PURE__ */
|
|
74
|
+
swapIconOnHover: e = !0,
|
|
75
|
+
...s
|
|
76
|
+
}) => /* @__PURE__ */ t(y, { asChild: !0, ...s, children: /* @__PURE__ */ d(
|
|
58
77
|
"button",
|
|
59
78
|
{
|
|
60
79
|
type: "button",
|
|
61
80
|
"data-slot": "chain-of-thought-trigger",
|
|
62
|
-
className:
|
|
81
|
+
className: r(
|
|
63
82
|
"group/cot-trigger flex min-h-9 w-full cursor-pointer items-center gap-3 rounded-sm text-left text-base text-current outline-none",
|
|
64
83
|
"transition-colors duration-(--duration-fast) ease-out hover:text-primary",
|
|
65
84
|
"focus-visible:ring-3 focus-visible:ring-ring motion-reduce:transition-none",
|
|
66
|
-
|
|
85
|
+
o
|
|
67
86
|
),
|
|
68
87
|
children: [
|
|
69
|
-
/* @__PURE__ */
|
|
88
|
+
/* @__PURE__ */ t(
|
|
70
89
|
"span",
|
|
71
90
|
{
|
|
72
91
|
"aria-hidden": !0,
|
|
73
92
|
className: "relative z-10 block size-4 shrink-0",
|
|
74
|
-
children:
|
|
75
|
-
/* @__PURE__ */
|
|
93
|
+
children: a ? /* @__PURE__ */ d(C, { children: [
|
|
94
|
+
/* @__PURE__ */ t(
|
|
76
95
|
"span",
|
|
77
96
|
{
|
|
78
|
-
className:
|
|
97
|
+
className: r(
|
|
79
98
|
"absolute inset-0 flex items-center justify-center transition-opacity duration-(--duration-fast) ease-out [&>svg]:size-4 motion-reduce:transition-none",
|
|
80
|
-
|
|
99
|
+
e && "group-hover/cot-trigger:opacity-0 group-data-[state=open]/cot-trigger:opacity-0"
|
|
81
100
|
),
|
|
82
|
-
children:
|
|
101
|
+
children: a
|
|
83
102
|
}
|
|
84
103
|
),
|
|
85
|
-
|
|
86
|
-
|
|
104
|
+
e && /* @__PURE__ */ t(
|
|
105
|
+
w,
|
|
87
106
|
{
|
|
88
|
-
className:
|
|
107
|
+
className: r(
|
|
89
108
|
"absolute inset-0 size-4 opacity-0 transition-[opacity,transform] duration-(--duration-fast) ease-out motion-reduce:transition-none",
|
|
90
109
|
"group-hover/cot-trigger:opacity-100 group-data-[state=open]/cot-trigger:opacity-100",
|
|
91
110
|
"group-data-[state=open]/cot-trigger:rotate-90"
|
|
92
111
|
)
|
|
93
112
|
}
|
|
94
113
|
)
|
|
95
|
-
] }) : /* @__PURE__ */
|
|
114
|
+
] }) : /* @__PURE__ */ t("span", { className: "absolute top-1/2 left-1/2 size-1.5 -translate-x-1/2 -translate-y-1/2 rounded-dot bg-current" })
|
|
96
115
|
}
|
|
97
116
|
),
|
|
98
|
-
/* @__PURE__ */
|
|
99
|
-
n != null && /* @__PURE__ */
|
|
117
|
+
/* @__PURE__ */ t("span", { className: "min-w-0 flex-1", children: i }),
|
|
118
|
+
n != null && /* @__PURE__ */ t("span", { className: "shrink-0 text-xs text-tertiary tabular-nums", children: n })
|
|
100
119
|
]
|
|
101
120
|
}
|
|
102
121
|
) })
|
|
103
|
-
),
|
|
104
|
-
({ className:
|
|
105
|
-
|
|
122
|
+
), D = c(
|
|
123
|
+
({ className: o, children: i, ...a }) => /* @__PURE__ */ t(
|
|
124
|
+
N,
|
|
106
125
|
{
|
|
107
126
|
"data-slot": "chain-of-thought-content",
|
|
108
|
-
className:
|
|
127
|
+
className: r(
|
|
109
128
|
"overflow-hidden pl-7 pt-2 pb-1 text-foreground outline-none",
|
|
110
129
|
"data-[state=closed]:pointer-events-none data-[state=closed]:fade-out-0 data-[state=closed]:slide-out-to-top-2 data-[state=open]:slide-in-from-top-2 data-[state=closed]:animate-out data-[state=open]:animate-in motion-reduce:animate-none",
|
|
111
|
-
|
|
130
|
+
o
|
|
112
131
|
),
|
|
113
|
-
...
|
|
114
|
-
children:
|
|
132
|
+
...a,
|
|
133
|
+
children: i
|
|
115
134
|
}
|
|
116
135
|
)
|
|
117
|
-
),
|
|
118
|
-
({ className:
|
|
136
|
+
), A = c(
|
|
137
|
+
({ className: o, ...i }) => /* @__PURE__ */ t(
|
|
119
138
|
"div",
|
|
120
139
|
{
|
|
121
140
|
"data-slot": "chain-of-thought-item",
|
|
122
|
-
className:
|
|
141
|
+
className: r(
|
|
123
142
|
"relative pl-4 text-base text-secondary",
|
|
124
143
|
"before:absolute before:top-2 before:left-0 before:size-1.5 before:rounded-dot before:bg-current before:content-['']",
|
|
125
|
-
|
|
144
|
+
o
|
|
126
145
|
),
|
|
127
|
-
...
|
|
146
|
+
...i
|
|
128
147
|
}
|
|
129
148
|
)
|
|
130
|
-
),
|
|
131
|
-
({ className:
|
|
149
|
+
), B = c(
|
|
150
|
+
({ className: o, ...i }) => /* @__PURE__ */ t(
|
|
132
151
|
"div",
|
|
133
152
|
{
|
|
134
|
-
className:
|
|
135
|
-
...
|
|
153
|
+
className: r("flex flex-wrap items-center gap-2", o),
|
|
154
|
+
...i
|
|
136
155
|
}
|
|
137
156
|
)
|
|
138
|
-
),
|
|
139
|
-
({ className:
|
|
140
|
-
|
|
157
|
+
), F = c(
|
|
158
|
+
({ className: o, children: i, ...a }) => /* @__PURE__ */ t(
|
|
159
|
+
b,
|
|
141
160
|
{
|
|
142
|
-
className:
|
|
161
|
+
className: r("gap-1 font-normal", o),
|
|
143
162
|
color: "default",
|
|
144
163
|
variant: "soft",
|
|
145
|
-
...
|
|
146
|
-
children:
|
|
164
|
+
...a,
|
|
165
|
+
children: i
|
|
166
|
+
}
|
|
167
|
+
)
|
|
168
|
+
), I = c(
|
|
169
|
+
({
|
|
170
|
+
className: o,
|
|
171
|
+
title: i,
|
|
172
|
+
tag: a,
|
|
173
|
+
meta: n,
|
|
174
|
+
source: e,
|
|
175
|
+
error: s,
|
|
176
|
+
icon: h,
|
|
177
|
+
defaultOpen: m = !1,
|
|
178
|
+
children: l,
|
|
179
|
+
...g
|
|
180
|
+
}) => /* @__PURE__ */ d(
|
|
181
|
+
v,
|
|
182
|
+
{
|
|
183
|
+
"data-slot": "chain-of-thought-evidence",
|
|
184
|
+
"data-error": s != null || void 0,
|
|
185
|
+
defaultOpen: m,
|
|
186
|
+
className: r("w-full", o),
|
|
187
|
+
...g,
|
|
188
|
+
children: [
|
|
189
|
+
/* @__PURE__ */ t(y, { asChild: !0, children: /* @__PURE__ */ d(
|
|
190
|
+
"button",
|
|
191
|
+
{
|
|
192
|
+
type: "button",
|
|
193
|
+
"data-slot": "chain-of-thought-evidence-trigger",
|
|
194
|
+
className: r(
|
|
195
|
+
"group/cot-evidence flex min-h-8 w-full cursor-pointer items-center gap-2 rounded-md text-left outline-none",
|
|
196
|
+
"transition-colors duration-(--duration-fast) ease-out hover:text-primary",
|
|
197
|
+
"focus-visible:ring-3 focus-visible:ring-ring motion-reduce:transition-none"
|
|
198
|
+
),
|
|
199
|
+
children: [
|
|
200
|
+
/* @__PURE__ */ t(
|
|
201
|
+
"span",
|
|
202
|
+
{
|
|
203
|
+
"aria-hidden": !0,
|
|
204
|
+
className: r(
|
|
205
|
+
"shrink-0 [&>svg]:size-3.5",
|
|
206
|
+
s != null ? "text-danger" : "text-tertiary"
|
|
207
|
+
),
|
|
208
|
+
children: h ?? (s != null ? /* @__PURE__ */ t(O, {}) : /* @__PURE__ */ t(k, {}))
|
|
209
|
+
}
|
|
210
|
+
),
|
|
211
|
+
/* @__PURE__ */ t("span", { className: "min-w-0 flex-1 truncate text-sm font-medium text-secondary", children: i }),
|
|
212
|
+
a != null && /* @__PURE__ */ t(
|
|
213
|
+
b,
|
|
214
|
+
{
|
|
215
|
+
color: "default",
|
|
216
|
+
variant: "soft",
|
|
217
|
+
className: "shrink-0 font-normal tabular-nums",
|
|
218
|
+
children: a
|
|
219
|
+
}
|
|
220
|
+
),
|
|
221
|
+
n != null && /* @__PURE__ */ t("span", { className: "shrink-0 text-xs text-tertiary tabular-nums", children: n }),
|
|
222
|
+
/* @__PURE__ */ t(
|
|
223
|
+
S,
|
|
224
|
+
{
|
|
225
|
+
"aria-hidden": !0,
|
|
226
|
+
className: r(
|
|
227
|
+
"size-3.5 shrink-0 text-tertiary transition-transform duration-(--duration-fast) ease-out motion-reduce:transition-none",
|
|
228
|
+
"group-data-[state=open]/cot-evidence:rotate-180"
|
|
229
|
+
)
|
|
230
|
+
}
|
|
231
|
+
)
|
|
232
|
+
]
|
|
233
|
+
}
|
|
234
|
+
) }),
|
|
235
|
+
/* @__PURE__ */ t(
|
|
236
|
+
N,
|
|
237
|
+
{
|
|
238
|
+
"data-slot": "chain-of-thought-evidence-content",
|
|
239
|
+
className: r(
|
|
240
|
+
"overflow-hidden outline-none",
|
|
241
|
+
"data-[state=closed]:pointer-events-none data-[state=closed]:fade-out-0 data-[state=closed]:slide-out-to-top-2 data-[state=open]:slide-in-from-top-2 data-[state=closed]:animate-out data-[state=open]:animate-in motion-reduce:animate-none"
|
|
242
|
+
),
|
|
243
|
+
children: /* @__PURE__ */ d("div", { className: "flex flex-col gap-1.5 pt-1.5", children: [
|
|
244
|
+
s != null && /* @__PURE__ */ t("p", { className: "text-xs text-danger", children: s }),
|
|
245
|
+
l,
|
|
246
|
+
e != null && /* @__PURE__ */ t("p", { className: "text-xs text-tertiary", children: e })
|
|
247
|
+
] })
|
|
248
|
+
}
|
|
249
|
+
)
|
|
250
|
+
]
|
|
251
|
+
}
|
|
252
|
+
)
|
|
253
|
+
), L = c(
|
|
254
|
+
({
|
|
255
|
+
className: o,
|
|
256
|
+
columns: i,
|
|
257
|
+
rows: a,
|
|
258
|
+
totalRows: n,
|
|
259
|
+
flag: e,
|
|
260
|
+
...s
|
|
261
|
+
}) => {
|
|
262
|
+
const h = n != null && n > a.length, m = (e == null ? void 0 : e.color) ?? "default";
|
|
263
|
+
return /* @__PURE__ */ d(
|
|
264
|
+
"div",
|
|
265
|
+
{
|
|
266
|
+
"data-slot": "chain-of-thought-evidence-table",
|
|
267
|
+
className: r("overflow-hidden rounded-lg bg-surface", o),
|
|
268
|
+
...s,
|
|
269
|
+
children: [
|
|
270
|
+
/* @__PURE__ */ t("div", { className: "max-h-56 overflow-auto", children: /* @__PURE__ */ d("table", { className: "w-full border-collapse text-xs tabular-nums", children: [
|
|
271
|
+
/* @__PURE__ */ t("thead", { children: /* @__PURE__ */ t("tr", { className: "text-tertiary", children: i.map((l) => /* @__PURE__ */ t(
|
|
272
|
+
"th",
|
|
273
|
+
{
|
|
274
|
+
className: r(
|
|
275
|
+
"sticky top-0 bg-surface px-2.5 py-1.5 font-medium whitespace-nowrap",
|
|
276
|
+
l.align === "end" ? "text-right" : "text-left"
|
|
277
|
+
),
|
|
278
|
+
children: l.label
|
|
279
|
+
},
|
|
280
|
+
l.key
|
|
281
|
+
)) }) }),
|
|
282
|
+
/* @__PURE__ */ t("tbody", { children: a.map((l, g) => {
|
|
283
|
+
const u = e != null && String(l[e.key]) === String(e.value);
|
|
284
|
+
return /* @__PURE__ */ t("tr", { className: r(u && "bg-muted"), children: i.map((f, p) => /* @__PURE__ */ t(
|
|
285
|
+
"td",
|
|
286
|
+
{
|
|
287
|
+
className: r(
|
|
288
|
+
"px-2.5 py-1 whitespace-nowrap",
|
|
289
|
+
f.align === "end" ? "text-right" : "text-left",
|
|
290
|
+
p === 0 ? "text-foreground" : "text-secondary",
|
|
291
|
+
u && p === 0 && "font-semibold",
|
|
292
|
+
u && p === 0 && m === "danger" && "text-danger",
|
|
293
|
+
u && p === 0 && m === "warning" && "text-warning"
|
|
294
|
+
),
|
|
295
|
+
children: l[f.key]
|
|
296
|
+
},
|
|
297
|
+
f.key
|
|
298
|
+
)) }, g);
|
|
299
|
+
}) })
|
|
300
|
+
] }) }),
|
|
301
|
+
h && /* @__PURE__ */ d("p", { className: "px-2.5 py-1.5 text-xs text-tertiary tabular-nums", children: [
|
|
302
|
+
a.length,
|
|
303
|
+
" of ",
|
|
304
|
+
n,
|
|
305
|
+
" rows"
|
|
306
|
+
] })
|
|
307
|
+
]
|
|
308
|
+
}
|
|
309
|
+
);
|
|
310
|
+
}
|
|
311
|
+
), W = c(
|
|
312
|
+
({ className: o, role: i = "list", ...a }) => /* @__PURE__ */ t(
|
|
313
|
+
"div",
|
|
314
|
+
{
|
|
315
|
+
"data-slot": "chain-of-thought-metrics",
|
|
316
|
+
role: i,
|
|
317
|
+
className: r("flex flex-wrap items-stretch gap-x-6 gap-y-2", o),
|
|
318
|
+
...a
|
|
319
|
+
}
|
|
320
|
+
)
|
|
321
|
+
), X = {
|
|
322
|
+
default: "text-foreground",
|
|
323
|
+
danger: "text-danger",
|
|
324
|
+
warning: "text-warning",
|
|
325
|
+
success: "text-success",
|
|
326
|
+
info: "text-info"
|
|
327
|
+
}, q = c(
|
|
328
|
+
({
|
|
329
|
+
className: o,
|
|
330
|
+
label: i,
|
|
331
|
+
value: a,
|
|
332
|
+
sub: n,
|
|
333
|
+
color: e = "default",
|
|
334
|
+
role: s = "listitem",
|
|
335
|
+
...h
|
|
336
|
+
}) => /* @__PURE__ */ d(
|
|
337
|
+
"div",
|
|
338
|
+
{
|
|
339
|
+
"data-slot": "chain-of-thought-metric",
|
|
340
|
+
"data-color": e,
|
|
341
|
+
role: s,
|
|
342
|
+
className: r("min-w-0", o),
|
|
343
|
+
...h,
|
|
344
|
+
children: [
|
|
345
|
+
/* @__PURE__ */ t("div", { className: "text-xs text-tertiary", children: i }),
|
|
346
|
+
/* @__PURE__ */ t(
|
|
347
|
+
"div",
|
|
348
|
+
{
|
|
349
|
+
className: r(
|
|
350
|
+
"text-base font-semibold tabular-nums",
|
|
351
|
+
X[e]
|
|
352
|
+
),
|
|
353
|
+
children: a
|
|
354
|
+
}
|
|
355
|
+
),
|
|
356
|
+
n != null && /* @__PURE__ */ t("div", { className: "text-xs text-tertiary", children: n })
|
|
357
|
+
]
|
|
147
358
|
}
|
|
148
359
|
)
|
|
149
|
-
),
|
|
150
|
-
({ className:
|
|
151
|
-
/* @__PURE__ */
|
|
152
|
-
|
|
360
|
+
), G = c(
|
|
361
|
+
({ className: o, children: i, caption: a, ...n }) => /* @__PURE__ */ d("div", { className: r("space-y-2", o), ...n, children: [
|
|
362
|
+
/* @__PURE__ */ t("div", { className: "relative flex max-h-88 items-center justify-center overflow-hidden rounded-lg bg-muted p-3", children: i }),
|
|
363
|
+
a && /* @__PURE__ */ t("p", { className: "text-xs text-tertiary", children: a })
|
|
153
364
|
] })
|
|
154
365
|
);
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
366
|
+
j.displayName = "ChainOfThought";
|
|
367
|
+
M.displayName = "ChainOfThoughtStep";
|
|
368
|
+
_.displayName = "ChainOfThoughtTrigger";
|
|
369
|
+
D.displayName = "ChainOfThoughtContent";
|
|
370
|
+
A.displayName = "ChainOfThoughtItem";
|
|
371
|
+
B.displayName = "ChainOfThoughtSearchResults";
|
|
372
|
+
F.displayName = "ChainOfThoughtSearchResult";
|
|
373
|
+
I.displayName = "ChainOfThoughtEvidence";
|
|
374
|
+
L.displayName = "ChainOfThoughtEvidenceTable";
|
|
375
|
+
W.displayName = "ChainOfThoughtMetrics";
|
|
376
|
+
q.displayName = "ChainOfThoughtMetric";
|
|
377
|
+
G.displayName = "ChainOfThoughtImage";
|
|
163
378
|
export {
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
379
|
+
j as ChainOfThought,
|
|
380
|
+
D as ChainOfThoughtContent,
|
|
381
|
+
I as ChainOfThoughtEvidence,
|
|
382
|
+
L as ChainOfThoughtEvidenceTable,
|
|
383
|
+
G as ChainOfThoughtImage,
|
|
384
|
+
A as ChainOfThoughtItem,
|
|
385
|
+
q as ChainOfThoughtMetric,
|
|
386
|
+
W as ChainOfThoughtMetrics,
|
|
387
|
+
F as ChainOfThoughtSearchResult,
|
|
388
|
+
B as ChainOfThoughtSearchResults,
|
|
389
|
+
M as ChainOfThoughtStep,
|
|
390
|
+
_ as ChainOfThoughtTrigger
|
|
172
391
|
};
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { VariantProps } from 'class-variance-authority';
|
|
2
|
+
import * as React from "react";
|
|
3
|
+
export declare const aiChartVariants: (props?: ({
|
|
4
|
+
status?: "error" | "pending" | "querying" | "partial" | "rendering" | "ready" | "cancelled" | null | undefined;
|
|
5
|
+
} & import('class-variance-authority/types').ClassProp) | undefined) => string;
|
|
6
|
+
export type AIChartStatus = NonNullable<VariantProps<typeof aiChartVariants>["status"]>;
|
|
7
|
+
export interface AIChartProgress {
|
|
8
|
+
received: number;
|
|
9
|
+
total?: number;
|
|
10
|
+
}
|
|
11
|
+
export interface AIChartProps extends Omit<React.HTMLAttributes<HTMLDivElement>, "children" | "title">, VariantProps<typeof aiChartVariants> {
|
|
12
|
+
title: React.ReactNode;
|
|
13
|
+
tag?: React.ReactNode;
|
|
14
|
+
source?: string;
|
|
15
|
+
progress?: AIChartProgress;
|
|
16
|
+
/** Consumer-formatted elapsed time, for example `0:36` or `3:42`. */
|
|
17
|
+
elapsed?: string;
|
|
18
|
+
/** Replaces the status/progress metadata at the end of the trigger row. */
|
|
19
|
+
meta?: React.ReactNode;
|
|
20
|
+
/** Concise nonvisual summary of the chart's result and important values. */
|
|
21
|
+
accessibleSummary?: React.ReactNode;
|
|
22
|
+
open?: boolean;
|
|
23
|
+
defaultOpen?: boolean;
|
|
24
|
+
onOpenChange?: (open: boolean) => void;
|
|
25
|
+
onSourceSelect?: (source: string) => void;
|
|
26
|
+
errorContent?: React.ReactNode;
|
|
27
|
+
onRetry?: () => void;
|
|
28
|
+
children?: React.ReactNode;
|
|
29
|
+
}
|
|
30
|
+
export declare const AIChart: React.ForwardRefExoticComponent<AIChartProps & React.RefAttributes<HTMLDivElement>>;
|