drizzle-cube 0.4.16 → 0.4.18
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/dist/adapters/express/index.cjs +1 -1
- package/dist/adapters/express/index.js +1 -1
- package/dist/adapters/fastify/index.cjs +1 -1
- package/dist/adapters/fastify/index.js +1 -1
- package/dist/adapters/{handler-BmTtVoRu.js → handler-DefTXJpi.js} +442 -309
- package/dist/adapters/handler-hwoGzGex.cjs +33 -0
- package/dist/adapters/hono/index.cjs +1 -1
- package/dist/adapters/hono/index.js +1 -1
- package/dist/adapters/nextjs/index.cjs +1 -1
- package/dist/adapters/nextjs/index.js +1 -1
- package/dist/client/charts.js +2 -2
- package/dist/client/chunks/{analysis-builder-C5e52Z3p.js → analysis-builder-3z9fHE2F.js} +5 -5
- package/dist/client/chunks/{analysis-builder-C5e52Z3p.js.map → analysis-builder-3z9fHE2F.js.map} +1 -1
- package/dist/client/chunks/{analysis-builder-shared-EnM-8plh.js → analysis-builder-shared-Da-vlQa_.js} +2 -2
- package/dist/client/chunks/{analysis-builder-shared-EnM-8plh.js.map → analysis-builder-shared-Da-vlQa_.js.map} +1 -1
- package/dist/client/chunks/{chart-data-table-D5G8nMnb.js → chart-data-table-BsAjHe7o.js} +2 -2
- package/dist/client/chunks/{chart-data-table-D5G8nMnb.js.map → chart-data-table-BsAjHe7o.js.map} +1 -1
- package/dist/client/chunks/{chart-kpi-delta-Dgg2eYRl.js → chart-kpi-delta-DUD3f8vL.js} +3 -3
- package/dist/client/chunks/{chart-kpi-delta-Dgg2eYRl.js.map → chart-kpi-delta-DUD3f8vL.js.map} +1 -1
- package/dist/client/chunks/{chart-kpi-number-DkoO99c1.js → chart-kpi-number-iJh-PzsM.js} +2 -2
- package/dist/client/chunks/{chart-kpi-number-DkoO99c1.js.map → chart-kpi-number-iJh-PzsM.js.map} +1 -1
- package/dist/client/chunks/{chart-kpi-text-1O6_lmz7.js → chart-kpi-text-x6pV9v9Q.js} +2 -2
- package/dist/client/chunks/{chart-kpi-text-1O6_lmz7.js.map → chart-kpi-text-x6pV9v9Q.js.map} +1 -1
- package/dist/client/chunks/{charts-loader-AW3T1nv5.js → charts-loader-B3tt5oKG.js} +5 -5
- package/dist/client/chunks/{charts-loader-AW3T1nv5.js.map → charts-loader-B3tt5oKG.js.map} +1 -1
- package/dist/client/chunks/{components-BkeSy9xv.js → components-CMGGxqOB.js} +4 -4
- package/dist/client/chunks/{components-BkeSy9xv.js.map → components-CMGGxqOB.js.map} +1 -1
- package/dist/client/chunks/{icons-DAeqv1iX.js → icons-M7shurcH.js} +172 -160
- package/dist/client/chunks/icons-M7shurcH.js.map +1 -0
- package/dist/client/components/AgenticNotebook/AgentChatPanel.d.ts +6 -0
- package/dist/client/components/AgenticNotebook/index.d.ts +6 -0
- package/dist/client/components.js +1 -1
- package/dist/client/hooks/useAgentChat.d.ts +2 -2
- package/dist/client/icons/types.d.ts +2 -0
- package/dist/client/icons.js +1 -1
- package/dist/client/index.js +707 -675
- package/dist/client/index.js.map +1 -1
- package/dist/client/utils.js +3 -3
- package/dist/client-bundle-stats.html +1 -1
- package/dist/server/index.cjs +49 -41
- package/dist/server/index.d.ts +45 -0
- package/dist/server/index.js +2795 -2662
- package/package.json +1 -1
- package/dist/adapters/handler-B6yAJw_O.cjs +0 -25
- package/dist/client/chunks/icons-DAeqv1iX.js.map +0 -1
package/dist/client/index.js
CHANGED
|
@@ -1,139 +1,139 @@
|
|
|
1
|
-
import { D as
|
|
2
|
-
import { i as
|
|
3
|
-
import { jsx as
|
|
4
|
-
import
|
|
5
|
-
import { c as
|
|
6
|
-
import { a as
|
|
7
|
-
import { D as
|
|
8
|
-
import { Q as
|
|
9
|
-
import { f as
|
|
10
|
-
import { h as
|
|
11
|
-
import { L as
|
|
12
|
-
import { u as
|
|
13
|
-
import { L as
|
|
14
|
-
import { E as
|
|
15
|
-
import { u as
|
|
16
|
-
import { c as
|
|
17
|
-
import { e as
|
|
18
|
-
import { c as
|
|
19
|
-
import { T as
|
|
20
|
-
import { createExplainQueryKey as
|
|
21
|
-
import { i as
|
|
22
|
-
import { h as
|
|
23
|
-
const
|
|
1
|
+
import { D as me, A as pe, e as he, P as fe } from "./chunks/components-CMGGxqOB.js";
|
|
2
|
+
import { i as bt, a as yt, C as xt, h as vt, g as Ct, b as Nt, j as kt, f as wt, d as St, M as Tt, c as Dt, n as At, T as Mt, R as It, Q as Et, O as Rt, S as Bt, V as Lt, I as Pt, H as Qt, K as Ft, W as _t, G as Vt, J as jt, X as Ut, L as qt, N as Kt, U as Ot, Y as $t, Z as zt, z as Wt, q as Jt, x as Gt, t as Ht, s as Yt, w as Xt, p as Zt, v as es, o as ts, r as ss, y as rs, u as cs, k as as, l as ns, m as os, F as ds, E as is, B as ls } from "./chunks/components-CMGGxqOB.js";
|
|
3
|
+
import { jsx as s, jsxs as f, Fragment as te } from "react/jsx-runtime";
|
|
4
|
+
import V, { useRef as v, createContext as ge, useContext as be, useState as _, useCallback as h, useEffect as F } from "react";
|
|
5
|
+
import { c as ye, d as xe, e as ve, s as Ce, f as z } from "./chunks/vendor-AVsJ2ni0.js";
|
|
6
|
+
import { a as j } from "./chunks/icons-M7shurcH.js";
|
|
7
|
+
import { D as ms, h as ps, i as hs, b as fs, e as gs, f as bs, g as ys, r as xs, c as vs, s as Cs } from "./chunks/icons-M7shurcH.js";
|
|
8
|
+
import { Q as Ne } from "./chunks/chart-markdown-Du4Z2iqK.js";
|
|
9
|
+
import { f as ke } from "./chunks/providers-CgxXm6Ll.js";
|
|
10
|
+
import { h as ks, a as ws, S as Ss, e as Ts, d as Ds, i as As, b as Ms, g as Is, u as Es, j as Rs, c as Bs, w as Ls } from "./chunks/providers-CgxXm6Ll.js";
|
|
11
|
+
import { L as we } from "./chunks/charts-core-CU9u_HtL.js";
|
|
12
|
+
import { u as Qs } from "./chunks/charts-core-CU9u_HtL.js";
|
|
13
|
+
import { L as _s, g as Vs, c as js, b as Us, i as qs, p as Ks, a as Os } from "./chunks/charts-loader-B3tt5oKG.js";
|
|
14
|
+
import { E as zs, a as Ws, p as Js, q as Gs, m as Hs, l as Ys, r as Xs, C as Zs, D as er, o as tr, B as sr, n as rr, w as cr, t as ar, d as nr, f as or, s as dr, e as ir, i as lr, c as ur, h as mr, g as pr, u as hr, b as fr, y as gr, A as br, x as yr, k as xr, v as vr, z as Cr, j as Nr } from "./chunks/analysis-builder-shared-Da-vlQa_.js";
|
|
15
|
+
import { u as wr } from "./chunks/chart-bubble-CemotLx-.js";
|
|
16
|
+
import { c as Tr, f as Dr } from "./chunks/index-CApFCBF9.js";
|
|
17
|
+
import { e as Mr, c as Ir, l as Er, h as Rr, k as Br, j as Lr, i as Pr, m as Qr, g as Fr, f as _r, u as Vr, u as jr, d as Ur, b as qr, a as Kr, v as Or } from "./chunks/useDirtyStateTracking-Cu1HSjmo.js";
|
|
18
|
+
import { c as zr, b as Wr, f as Jr, g as Gr, a as Hr, i as Yr, t as Xr } from "./chunks/funnel-utils-CyonoNeC.js";
|
|
19
|
+
import { T as ec, c as tc, g as sc, a as rc, i as cc, r as ac, s as nc, b as oc, w as dc } from "./chunks/theme-Dp3hFed1.js";
|
|
20
|
+
import { createExplainQueryKey as lc, useDryRunQueries as uc, useDryRunQuery as mc, useExplainAI as pc, useExplainQuery as hc, useMultiDryRunQueries as fc } from "./hooks.js";
|
|
21
|
+
import { i as bc, a as yc } from "./chunks/flow-utils-CjQZG5qq.js";
|
|
22
|
+
import { h as vc } from "./chunks/syntaxHighlighting-BQfjio-i.js";
|
|
23
|
+
const se = () => ({
|
|
24
24
|
blocks: [],
|
|
25
25
|
messages: [],
|
|
26
26
|
isStreaming: !1,
|
|
27
27
|
sessionId: null,
|
|
28
28
|
inputValue: ""
|
|
29
29
|
});
|
|
30
|
-
function
|
|
30
|
+
function Se(e, t) {
|
|
31
31
|
return {
|
|
32
32
|
// Block actions
|
|
33
|
-
addBlock: (
|
|
34
|
-
blocks: [...
|
|
33
|
+
addBlock: (r) => e((n) => ({
|
|
34
|
+
blocks: [...n.blocks, r]
|
|
35
35
|
})),
|
|
36
|
-
removeBlock: (
|
|
37
|
-
blocks:
|
|
36
|
+
removeBlock: (r) => e((n) => ({
|
|
37
|
+
blocks: n.blocks.filter((c) => c.id !== r)
|
|
38
38
|
})),
|
|
39
|
-
moveBlock: (
|
|
40
|
-
const
|
|
41
|
-
if (
|
|
42
|
-
if (
|
|
43
|
-
if (
|
|
44
|
-
const o = [...
|
|
45
|
-
return [o[
|
|
39
|
+
moveBlock: (r, n) => e((c) => {
|
|
40
|
+
const a = c.blocks.findIndex((u) => u.id === r);
|
|
41
|
+
if (a === -1) return {};
|
|
42
|
+
if (n === "up" && a === 0) return {};
|
|
43
|
+
if (n === "down" && a === c.blocks.length - 1) return {};
|
|
44
|
+
const o = [...c.blocks], p = n === "up" ? a - 1 : a + 1;
|
|
45
|
+
return [o[a], o[p]] = [o[p], o[a]], { blocks: o };
|
|
46
46
|
}),
|
|
47
|
-
updateBlock: (
|
|
48
|
-
blocks:
|
|
49
|
-
(
|
|
47
|
+
updateBlock: (r, n) => e((c) => ({
|
|
48
|
+
blocks: c.blocks.map(
|
|
49
|
+
(a) => a.id === r && a.type === "portlet" ? { ...a, ...n } : a
|
|
50
50
|
)
|
|
51
51
|
})),
|
|
52
52
|
// Chat actions
|
|
53
|
-
addMessage: (
|
|
54
|
-
messages: [...
|
|
53
|
+
addMessage: (r) => e((n) => ({
|
|
54
|
+
messages: [...n.messages, r]
|
|
55
55
|
})),
|
|
56
|
-
appendToLastAssistantMessage: (
|
|
57
|
-
const
|
|
58
|
-
return
|
|
59
|
-
...
|
|
60
|
-
content:
|
|
61
|
-
}), { messages:
|
|
56
|
+
appendToLastAssistantMessage: (r) => e((n) => {
|
|
57
|
+
const c = [...n.messages], a = c[c.length - 1];
|
|
58
|
+
return a && a.role === "assistant" && (c[c.length - 1] = {
|
|
59
|
+
...a,
|
|
60
|
+
content: a.content + r
|
|
61
|
+
}), { messages: c };
|
|
62
62
|
}),
|
|
63
|
-
setLastAssistantError: (
|
|
64
|
-
const
|
|
65
|
-
return
|
|
63
|
+
setLastAssistantError: (r) => e((n) => {
|
|
64
|
+
const c = [...n.messages], a = c[c.length - 1];
|
|
65
|
+
return a && a.role === "assistant" && (c[c.length - 1] = { ...a, error: r }), { messages: c };
|
|
66
66
|
}),
|
|
67
|
-
addToolCallToLastAssistant: (
|
|
68
|
-
const
|
|
69
|
-
return
|
|
70
|
-
...
|
|
71
|
-
toolCalls: [...
|
|
72
|
-
}), { messages:
|
|
67
|
+
addToolCallToLastAssistant: (r) => e((n) => {
|
|
68
|
+
const c = [...n.messages], a = c[c.length - 1];
|
|
69
|
+
return a && a.role === "assistant" && (c[c.length - 1] = {
|
|
70
|
+
...a,
|
|
71
|
+
toolCalls: [...a.toolCalls || [], r]
|
|
72
|
+
}), { messages: c };
|
|
73
73
|
}),
|
|
74
|
-
updateLastToolCall: (
|
|
75
|
-
const
|
|
76
|
-
if (
|
|
77
|
-
const o = [...
|
|
78
|
-
|
|
74
|
+
updateLastToolCall: (r) => e((n) => {
|
|
75
|
+
const c = [...n.messages], a = c[c.length - 1];
|
|
76
|
+
if (a?.role === "assistant" && a.toolCalls?.length) {
|
|
77
|
+
const o = [...a.toolCalls], p = r.id ? o.findIndex((u) => u.id === r.id) : o.length - 1;
|
|
78
|
+
p !== -1 && (o[p] = { ...o[p], ...r }, c[c.length - 1] = { ...a, toolCalls: o });
|
|
79
79
|
}
|
|
80
|
-
return { messages:
|
|
80
|
+
return { messages: c };
|
|
81
81
|
}),
|
|
82
82
|
// Session/UI actions
|
|
83
|
-
setIsStreaming: (
|
|
84
|
-
setSessionId: (
|
|
85
|
-
setInputValue: (
|
|
83
|
+
setIsStreaming: (r) => e({ isStreaming: r }),
|
|
84
|
+
setSessionId: (r) => e({ sessionId: r }),
|
|
85
|
+
setInputValue: (r) => e({ inputValue: r }),
|
|
86
86
|
// Persistence
|
|
87
87
|
save: () => {
|
|
88
|
-
const
|
|
88
|
+
const r = t();
|
|
89
89
|
return {
|
|
90
|
-
blocks:
|
|
91
|
-
messages:
|
|
90
|
+
blocks: r.blocks,
|
|
91
|
+
messages: r.messages
|
|
92
92
|
};
|
|
93
93
|
},
|
|
94
|
-
load: (
|
|
95
|
-
blocks:
|
|
96
|
-
messages:
|
|
94
|
+
load: (r) => e({
|
|
95
|
+
blocks: r.blocks || [],
|
|
96
|
+
messages: r.messages || []
|
|
97
97
|
}),
|
|
98
98
|
// Reset
|
|
99
|
-
reset: () => e(
|
|
99
|
+
reset: () => e(se())
|
|
100
100
|
};
|
|
101
101
|
}
|
|
102
|
-
function
|
|
103
|
-
const e =
|
|
104
|
-
return
|
|
105
|
-
|
|
106
|
-
|
|
102
|
+
function Te() {
|
|
103
|
+
const e = se();
|
|
104
|
+
return xe()(
|
|
105
|
+
ve(
|
|
106
|
+
Ce((t, r) => ({
|
|
107
107
|
...e,
|
|
108
|
-
...
|
|
108
|
+
...Se(t, r)
|
|
109
109
|
})),
|
|
110
110
|
{ name: "NotebookStore" }
|
|
111
111
|
)
|
|
112
112
|
);
|
|
113
113
|
}
|
|
114
|
-
const
|
|
115
|
-
function
|
|
114
|
+
const re = ge(null);
|
|
115
|
+
function De({
|
|
116
116
|
children: e,
|
|
117
117
|
initialConfig: t
|
|
118
118
|
}) {
|
|
119
|
-
const
|
|
120
|
-
if (!
|
|
121
|
-
const
|
|
122
|
-
t &&
|
|
119
|
+
const r = v(null);
|
|
120
|
+
if (!r.current) {
|
|
121
|
+
const n = Te();
|
|
122
|
+
t && n.getState().load(t), r.current = n;
|
|
123
123
|
}
|
|
124
|
-
return /* @__PURE__ */
|
|
124
|
+
return /* @__PURE__ */ s(re.Provider, { value: r.current, children: e });
|
|
125
125
|
}
|
|
126
126
|
function A(e) {
|
|
127
|
-
const t =
|
|
127
|
+
const t = be(re);
|
|
128
128
|
if (!t)
|
|
129
129
|
throw new Error("useNotebookStore must be used within NotebookStoreProvider");
|
|
130
|
-
return
|
|
130
|
+
return ye(t, e);
|
|
131
131
|
}
|
|
132
|
-
const
|
|
132
|
+
const Ae = (e) => e.blocks, dt = (e) => e.messages, it = (e) => e.isStreaming, lt = (e) => e.sessionId, ut = (e) => e.inputValue, Me = (e) => ({
|
|
133
133
|
messages: e.messages,
|
|
134
134
|
isStreaming: e.isStreaming,
|
|
135
135
|
inputValue: e.inputValue
|
|
136
|
-
}),
|
|
136
|
+
}), Ie = (e) => ({
|
|
137
137
|
addMessage: e.addMessage,
|
|
138
138
|
appendToLastAssistantMessage: e.appendToLastAssistantMessage,
|
|
139
139
|
setLastAssistantError: e.setLastAssistantError,
|
|
@@ -142,80 +142,80 @@ const ve = (e) => e.blocks, Ye = (e) => e.messages, Ze = (e) => e.isStreaming, e
|
|
|
142
142
|
setIsStreaming: e.setIsStreaming,
|
|
143
143
|
setInputValue: e.setInputValue,
|
|
144
144
|
setSessionId: e.setSessionId
|
|
145
|
-
}),
|
|
145
|
+
}), Ee = (e) => ({
|
|
146
146
|
addBlock: e.addBlock,
|
|
147
147
|
removeBlock: e.removeBlock,
|
|
148
148
|
moveBlock: e.moveBlock,
|
|
149
149
|
updateBlock: e.updateBlock
|
|
150
|
-
}),
|
|
150
|
+
}), O = { width: "16px", height: "16px", color: "currentColor" }, Re = j("chevronUp"), Be = j("chevronDown"), Le = j("edit"), Pe = j("delete"), Qe = V.memo(function({
|
|
151
151
|
block: t,
|
|
152
|
-
onRemove:
|
|
153
|
-
onMoveUp:
|
|
154
|
-
onMoveDown:
|
|
155
|
-
onEdit:
|
|
152
|
+
onRemove: r,
|
|
153
|
+
onMoveUp: n,
|
|
154
|
+
onMoveDown: c,
|
|
155
|
+
onEdit: a,
|
|
156
156
|
isFirst: o,
|
|
157
|
-
isLast:
|
|
157
|
+
isLast: p
|
|
158
158
|
}) {
|
|
159
|
-
const [
|
|
160
|
-
w(
|
|
159
|
+
const [u, w] = _(null), x = h((N) => {
|
|
160
|
+
w(N);
|
|
161
161
|
}, []);
|
|
162
|
-
return /* @__PURE__ */
|
|
163
|
-
/* @__PURE__ */
|
|
164
|
-
/* @__PURE__ */
|
|
165
|
-
/* @__PURE__ */
|
|
166
|
-
|
|
167
|
-
|
|
162
|
+
return /* @__PURE__ */ f("div", { className: "dc:relative dc:mb-4 bg-dc-surface dc:border border-dc-border dc:rounded-lg dc:flex dc:flex-col", children: [
|
|
163
|
+
/* @__PURE__ */ f("div", { className: "dc:flex dc:items-center dc:justify-between dc:px-3 dc:py-1.5 dc:border-b border-dc-border dc:shrink-0 bg-dc-surface-secondary dc:rounded-t-lg", children: [
|
|
164
|
+
/* @__PURE__ */ f("div", { className: "dc:flex dc:items-center dc:gap-2 dc:flex-1 dc:min-w-0", children: [
|
|
165
|
+
/* @__PURE__ */ s("h3", { className: "dc:font-semibold dc:text-sm text-dc-text dc:truncate", children: t.title || "Untitled" }),
|
|
166
|
+
u && /* @__PURE__ */ s(
|
|
167
|
+
me,
|
|
168
168
|
{
|
|
169
|
-
chartConfig:
|
|
170
|
-
displayConfig:
|
|
171
|
-
queryObject:
|
|
172
|
-
data:
|
|
173
|
-
chartType:
|
|
174
|
-
cacheInfo:
|
|
169
|
+
chartConfig: u.chartConfig,
|
|
170
|
+
displayConfig: u.displayConfig,
|
|
171
|
+
queryObject: u.queryObject,
|
|
172
|
+
data: u.data,
|
|
173
|
+
chartType: u.chartType,
|
|
174
|
+
cacheInfo: u.cacheInfo ?? void 0
|
|
175
175
|
}
|
|
176
176
|
)
|
|
177
177
|
] }),
|
|
178
|
-
/* @__PURE__ */
|
|
179
|
-
!o && /* @__PURE__ */
|
|
178
|
+
/* @__PURE__ */ f("div", { className: "dc:flex dc:items-center dc:gap-1 dc:shrink-0 dc:ml-4 dc:-mr-2", children: [
|
|
179
|
+
!o && /* @__PURE__ */ s(
|
|
180
180
|
"button",
|
|
181
181
|
{
|
|
182
|
-
onClick: () =>
|
|
182
|
+
onClick: () => n(t.id),
|
|
183
183
|
className: "dc:p-1 dc:bg-transparent dc:border-none dc:rounded-sm text-dc-text-secondary dc:cursor-pointer dc:hover:bg-dc-surface-hover dc:transition-colors",
|
|
184
184
|
title: "Move up",
|
|
185
|
-
children: /* @__PURE__ */
|
|
185
|
+
children: /* @__PURE__ */ s(Re, { style: O })
|
|
186
186
|
}
|
|
187
187
|
),
|
|
188
|
-
!
|
|
188
|
+
!p && /* @__PURE__ */ s(
|
|
189
189
|
"button",
|
|
190
190
|
{
|
|
191
|
-
onClick: () =>
|
|
191
|
+
onClick: () => c(t.id),
|
|
192
192
|
className: "dc:p-1 dc:bg-transparent dc:border-none dc:rounded-sm text-dc-text-secondary dc:cursor-pointer dc:hover:bg-dc-surface-hover dc:transition-colors",
|
|
193
193
|
title: "Move down",
|
|
194
|
-
children: /* @__PURE__ */
|
|
194
|
+
children: /* @__PURE__ */ s(Be, { style: O })
|
|
195
195
|
}
|
|
196
196
|
),
|
|
197
|
-
/* @__PURE__ */
|
|
197
|
+
/* @__PURE__ */ s(
|
|
198
198
|
"button",
|
|
199
199
|
{
|
|
200
|
-
onClick: () =>
|
|
200
|
+
onClick: () => a(t),
|
|
201
201
|
className: "dc:p-1 dc:bg-transparent dc:border-none dc:rounded-sm text-dc-text-secondary dc:cursor-pointer dc:hover:bg-dc-surface-hover dc:transition-colors",
|
|
202
202
|
title: "Edit visualization",
|
|
203
|
-
children: /* @__PURE__ */
|
|
203
|
+
children: /* @__PURE__ */ s(Le, { style: O })
|
|
204
204
|
}
|
|
205
205
|
),
|
|
206
|
-
/* @__PURE__ */
|
|
206
|
+
/* @__PURE__ */ s(
|
|
207
207
|
"button",
|
|
208
208
|
{
|
|
209
|
-
onClick: () =>
|
|
209
|
+
onClick: () => r(t.id),
|
|
210
210
|
className: "dc:p-1 dc:mr-0.5 dc:bg-transparent dc:border-none dc:rounded-sm dc:cursor-pointer dc:hover:bg-dc-danger-bg text-dc-danger dc:transition-colors",
|
|
211
211
|
title: "Remove",
|
|
212
|
-
children: /* @__PURE__ */
|
|
212
|
+
children: /* @__PURE__ */ s(Pe, { style: O })
|
|
213
213
|
}
|
|
214
214
|
)
|
|
215
215
|
] })
|
|
216
216
|
] }),
|
|
217
|
-
/* @__PURE__ */
|
|
218
|
-
|
|
217
|
+
/* @__PURE__ */ s("div", { className: "dc:flex-1 dc:min-h-0", children: /* @__PURE__ */ s(
|
|
218
|
+
pe,
|
|
219
219
|
{
|
|
220
220
|
query: t.query,
|
|
221
221
|
chartType: t.chartType,
|
|
@@ -223,11 +223,11 @@ const ve = (e) => e.blocks, Ye = (e) => e.messages, Ze = (e) => e.isStreaming, e
|
|
|
223
223
|
displayConfig: t.displayConfig,
|
|
224
224
|
height: 400,
|
|
225
225
|
eagerLoad: !0,
|
|
226
|
-
onDebugDataReady:
|
|
226
|
+
onDebugDataReady: x
|
|
227
227
|
}
|
|
228
228
|
) })
|
|
229
229
|
] });
|
|
230
|
-
}),
|
|
230
|
+
}), Fe = {
|
|
231
231
|
overrides: {
|
|
232
232
|
h1: { props: { className: "dc:text-lg dc:font-bold text-dc-text dc:mb-2 dc:mt-3" } },
|
|
233
233
|
h2: { props: { className: "dc:text-base dc:font-semibold text-dc-text dc:mb-2 dc:mt-3" } },
|
|
@@ -248,105 +248,105 @@ const ve = (e) => e.blocks, Ye = (e) => e.messages, Ze = (e) => e.isStreaming, e
|
|
|
248
248
|
td: { props: { className: "dc:px-3 dc:py-2 dc:text-sm text-dc-text border-dc-border dc:border-b" } },
|
|
249
249
|
tr: { props: { className: "dc:hover:opacity-80" } }
|
|
250
250
|
}
|
|
251
|
-
},
|
|
251
|
+
}, _e = V.memo(function({
|
|
252
252
|
block: t,
|
|
253
|
-
onRemove:
|
|
254
|
-
onMoveUp:
|
|
255
|
-
onMoveDown:
|
|
256
|
-
isFirst:
|
|
253
|
+
onRemove: r,
|
|
254
|
+
onMoveUp: n,
|
|
255
|
+
onMoveDown: c,
|
|
256
|
+
isFirst: a,
|
|
257
257
|
isLast: o
|
|
258
258
|
}) {
|
|
259
|
-
return /* @__PURE__ */
|
|
260
|
-
/* @__PURE__ */
|
|
261
|
-
!
|
|
259
|
+
return /* @__PURE__ */ f("div", { className: "dc:group dc:relative dc:mb-4", children: [
|
|
260
|
+
/* @__PURE__ */ f("div", { className: "dc:absolute dc:right-2 dc:top-2 dc:z-10 dc:flex dc:gap-1 dc:opacity-0 dc:group-hover:opacity-100 dc:transition-opacity", children: [
|
|
261
|
+
!a && /* @__PURE__ */ s(
|
|
262
262
|
"button",
|
|
263
263
|
{
|
|
264
|
-
onClick: () =>
|
|
264
|
+
onClick: () => n(t.id),
|
|
265
265
|
className: "dc:p-1 dc:rounded dc:text-xs bg-dc-surface text-dc-text-secondary dc:hover:opacity-80 border-dc-border dc:border",
|
|
266
266
|
title: "Move up",
|
|
267
267
|
children: "▲"
|
|
268
268
|
}
|
|
269
269
|
),
|
|
270
|
-
!o && /* @__PURE__ */
|
|
270
|
+
!o && /* @__PURE__ */ s(
|
|
271
271
|
"button",
|
|
272
272
|
{
|
|
273
|
-
onClick: () =>
|
|
273
|
+
onClick: () => c(t.id),
|
|
274
274
|
className: "dc:p-1 dc:rounded dc:text-xs bg-dc-surface text-dc-text-secondary dc:hover:opacity-80 border-dc-border dc:border",
|
|
275
275
|
title: "Move down",
|
|
276
276
|
children: "▼"
|
|
277
277
|
}
|
|
278
278
|
),
|
|
279
|
-
/* @__PURE__ */
|
|
279
|
+
/* @__PURE__ */ s(
|
|
280
280
|
"button",
|
|
281
281
|
{
|
|
282
|
-
onClick: () =>
|
|
282
|
+
onClick: () => r(t.id),
|
|
283
283
|
className: "dc:p-1 dc:rounded dc:text-xs text-dc-error dc:hover:opacity-80 bg-dc-surface border-dc-border dc:border",
|
|
284
284
|
title: "Remove",
|
|
285
285
|
children: "✕"
|
|
286
286
|
}
|
|
287
287
|
)
|
|
288
288
|
] }),
|
|
289
|
-
t.title && /* @__PURE__ */
|
|
290
|
-
/* @__PURE__ */
|
|
289
|
+
t.title && /* @__PURE__ */ s("h4", { className: "dc:text-sm dc:font-semibold text-dc-text dc:mb-2 dc:px-1", children: t.title }),
|
|
290
|
+
/* @__PURE__ */ s("div", { className: "dc:rounded-lg dc:p-4 bg-dc-surface border-dc-border dc:border", children: /* @__PURE__ */ s(Ne, { options: Fe, children: t.content }) })
|
|
291
291
|
] });
|
|
292
|
-
}),
|
|
293
|
-
const t = A(
|
|
294
|
-
|
|
295
|
-
t.length >
|
|
292
|
+
}), Ve = V.memo(function() {
|
|
293
|
+
const t = A(Ae), { removeBlock: r, moveBlock: n, updateBlock: c } = A(z(Ee)), a = v(null), [o, p] = _(null), u = v(t.length);
|
|
294
|
+
F(() => {
|
|
295
|
+
t.length > u.current && a.current?.scrollIntoView({ behavior: "smooth" }), u.current = t.length;
|
|
296
296
|
}, [t.length]);
|
|
297
|
-
const w =
|
|
297
|
+
const w = h((l) => r(l), [r]), x = h((l) => n(l, "up"), [n]), N = h((l) => n(l, "down"), [n]), y = h((l) => p(l), []), S = h((l) => {
|
|
298
298
|
if (!o) return;
|
|
299
|
-
const
|
|
300
|
-
if (
|
|
301
|
-
const
|
|
302
|
-
|
|
303
|
-
title:
|
|
304
|
-
query: JSON.stringify(
|
|
305
|
-
chartType:
|
|
306
|
-
chartConfig:
|
|
307
|
-
displayConfig:
|
|
299
|
+
const d = he(l), { analysisConfig: i } = d;
|
|
300
|
+
if (i) {
|
|
301
|
+
const k = i.charts[i.analysisType];
|
|
302
|
+
c(o.id, {
|
|
303
|
+
title: l.title,
|
|
304
|
+
query: JSON.stringify(i.query),
|
|
305
|
+
chartType: k?.chartType || "bar",
|
|
306
|
+
chartConfig: k?.chartConfig,
|
|
307
|
+
displayConfig: k?.displayConfig
|
|
308
308
|
});
|
|
309
309
|
}
|
|
310
|
-
|
|
311
|
-
}, [o,
|
|
312
|
-
return t.length === 0 ? /* @__PURE__ */
|
|
313
|
-
/* @__PURE__ */
|
|
314
|
-
/* @__PURE__ */
|
|
315
|
-
] }) }) : /* @__PURE__ */
|
|
316
|
-
t.map((
|
|
317
|
-
const
|
|
318
|
-
return
|
|
319
|
-
|
|
310
|
+
p(null);
|
|
311
|
+
}, [o, c]);
|
|
312
|
+
return t.length === 0 ? /* @__PURE__ */ s("div", { className: "dc:flex dc:items-center dc:justify-center dc:h-full", children: /* @__PURE__ */ f("div", { className: "dc:text-center dc:max-w-sm dc:px-6", children: [
|
|
313
|
+
/* @__PURE__ */ s("h3", { className: "dc:text-base dc:font-semibold text-dc-text dc:mb-2", children: "Your notebook is empty" }),
|
|
314
|
+
/* @__PURE__ */ s("p", { className: "dc:text-sm text-dc-text-secondary", children: "Ask the AI assistant a question about your data. Charts and insights will appear here as the assistant analyzes your data." })
|
|
315
|
+
] }) }) : /* @__PURE__ */ f("div", { className: "dc:h-full dc:overflow-y-auto dc:p-4", children: [
|
|
316
|
+
t.map((l, d) => {
|
|
317
|
+
const i = d === 0, k = d === t.length - 1;
|
|
318
|
+
return l.type === "portlet" ? /* @__PURE__ */ s(
|
|
319
|
+
Qe,
|
|
320
320
|
{
|
|
321
|
-
block:
|
|
321
|
+
block: l,
|
|
322
322
|
onRemove: w,
|
|
323
|
-
onMoveUp:
|
|
324
|
-
onMoveDown:
|
|
325
|
-
onEdit:
|
|
326
|
-
isFirst:
|
|
327
|
-
isLast:
|
|
323
|
+
onMoveUp: x,
|
|
324
|
+
onMoveDown: N,
|
|
325
|
+
onEdit: y,
|
|
326
|
+
isFirst: i,
|
|
327
|
+
isLast: k
|
|
328
328
|
},
|
|
329
|
-
|
|
330
|
-
) :
|
|
331
|
-
|
|
329
|
+
l.id
|
|
330
|
+
) : l.type === "markdown" ? /* @__PURE__ */ s(
|
|
331
|
+
_e,
|
|
332
332
|
{
|
|
333
|
-
block:
|
|
333
|
+
block: l,
|
|
334
334
|
onRemove: w,
|
|
335
|
-
onMoveUp:
|
|
336
|
-
onMoveDown:
|
|
337
|
-
isFirst:
|
|
338
|
-
isLast:
|
|
335
|
+
onMoveUp: x,
|
|
336
|
+
onMoveDown: N,
|
|
337
|
+
isFirst: i,
|
|
338
|
+
isLast: k
|
|
339
339
|
},
|
|
340
|
-
|
|
340
|
+
l.id
|
|
341
341
|
) : null;
|
|
342
342
|
}),
|
|
343
|
-
/* @__PURE__ */
|
|
344
|
-
/* @__PURE__ */
|
|
345
|
-
|
|
343
|
+
/* @__PURE__ */ s("div", { ref: a }),
|
|
344
|
+
/* @__PURE__ */ s(
|
|
345
|
+
fe,
|
|
346
346
|
{
|
|
347
347
|
isOpen: !!o,
|
|
348
|
-
onClose: () =>
|
|
349
|
-
onSave:
|
|
348
|
+
onClose: () => p(null),
|
|
349
|
+
onSave: S,
|
|
350
350
|
portlet: o ? {
|
|
351
351
|
id: o.id,
|
|
352
352
|
title: o.title,
|
|
@@ -365,16 +365,16 @@ const ve = (e) => e.blocks, Ye = (e) => e.messages, Ze = (e) => e.isStreaming, e
|
|
|
365
365
|
)
|
|
366
366
|
] });
|
|
367
367
|
});
|
|
368
|
-
function
|
|
368
|
+
function je(e) {
|
|
369
369
|
if (e.startsWith("{") || e.includes('"type":"error"'))
|
|
370
370
|
try {
|
|
371
|
-
const t = JSON.parse(e.replace(/^Error:\s*/, "")),
|
|
371
|
+
const t = JSON.parse(e.replace(/^Error:\s*/, "")), r = t.error?.type || t.type || "";
|
|
372
372
|
return {
|
|
373
373
|
overloaded_error: "The AI service is temporarily busy. Please try again in a moment.",
|
|
374
374
|
rate_limit_error: "Too many requests. Please wait a moment and try again.",
|
|
375
375
|
api_error: "The AI service encountered an error. Please try again.",
|
|
376
376
|
authentication_error: "Authentication failed. Please check your configuration."
|
|
377
|
-
}[
|
|
377
|
+
}[r] || "The AI service encountered an error. Please try again.";
|
|
378
378
|
} catch {
|
|
379
379
|
return "The AI service encountered an error. Please try again.";
|
|
380
380
|
}
|
|
@@ -384,391 +384,394 @@ function Re(e) {
|
|
|
384
384
|
}
|
|
385
385
|
return e;
|
|
386
386
|
}
|
|
387
|
-
function
|
|
388
|
-
const { agentEndpoint: t, agentApiKey:
|
|
389
|
-
|
|
390
|
-
const
|
|
391
|
-
function
|
|
392
|
-
const
|
|
393
|
-
switch (
|
|
387
|
+
function Ue(e) {
|
|
388
|
+
const { agentEndpoint: t, agentApiKey: r } = e, { cubeApi: n } = ke(), c = v(null), [a, o] = _(!1), p = v(e);
|
|
389
|
+
p.current = e;
|
|
390
|
+
const u = h(async (x, N, y) => {
|
|
391
|
+
function S(d) {
|
|
392
|
+
const i = p.current;
|
|
393
|
+
switch (d.type) {
|
|
394
394
|
case "text_delta":
|
|
395
|
-
|
|
395
|
+
i.onTextDelta(d.data);
|
|
396
396
|
break;
|
|
397
397
|
case "tool_use_start":
|
|
398
|
-
|
|
398
|
+
i.onToolStart(d.data.id, d.data.name, d.data.input);
|
|
399
399
|
break;
|
|
400
400
|
case "tool_use_result":
|
|
401
|
-
|
|
401
|
+
i.onToolResult(d.data.id, d.data.name, d.data.result, d.data.isError);
|
|
402
402
|
break;
|
|
403
403
|
case "add_portlet":
|
|
404
|
-
|
|
405
|
-
...
|
|
404
|
+
i.onAddPortlet({
|
|
405
|
+
...d.data,
|
|
406
406
|
type: "portlet"
|
|
407
407
|
});
|
|
408
408
|
break;
|
|
409
409
|
case "add_markdown":
|
|
410
|
-
|
|
411
|
-
...
|
|
410
|
+
i.onAddMarkdown({
|
|
411
|
+
...d.data,
|
|
412
412
|
type: "markdown"
|
|
413
413
|
});
|
|
414
414
|
break;
|
|
415
415
|
case "dashboard_saved":
|
|
416
|
-
|
|
416
|
+
i.onDashboardSaved?.(d.data);
|
|
417
417
|
break;
|
|
418
418
|
case "turn_complete":
|
|
419
|
-
|
|
419
|
+
i.onTurnComplete?.();
|
|
420
420
|
break;
|
|
421
421
|
case "done":
|
|
422
|
-
|
|
422
|
+
i.onDone(d.data.sessionId, d.data.traceId);
|
|
423
423
|
break;
|
|
424
424
|
case "error":
|
|
425
|
-
|
|
425
|
+
i.onError(d.data.message);
|
|
426
426
|
break;
|
|
427
427
|
}
|
|
428
428
|
}
|
|
429
|
-
|
|
430
|
-
const
|
|
431
|
-
|
|
429
|
+
c.current && c.current.abort();
|
|
430
|
+
const l = new AbortController();
|
|
431
|
+
c.current = l, o(!0);
|
|
432
432
|
try {
|
|
433
|
-
const
|
|
433
|
+
const d = n.apiUrl || "/cubejs-api/v1", i = t || `${d}/agent/chat`, k = {
|
|
434
434
|
"Content-Type": "application/json",
|
|
435
|
-
...
|
|
435
|
+
...n.headers
|
|
436
436
|
};
|
|
437
|
-
|
|
438
|
-
const
|
|
437
|
+
r && (k["X-Agent-Api-Key"] = r);
|
|
438
|
+
const b = await fetch(i, {
|
|
439
439
|
method: "POST",
|
|
440
|
-
headers:
|
|
441
|
-
credentials:
|
|
440
|
+
headers: k,
|
|
441
|
+
credentials: n.credentials ?? "include",
|
|
442
442
|
body: JSON.stringify({
|
|
443
|
-
message:
|
|
444
|
-
...
|
|
445
|
-
...
|
|
443
|
+
message: x,
|
|
444
|
+
...N ? { sessionId: N } : {},
|
|
445
|
+
...y && y.length > 0 ? { history: y } : {}
|
|
446
446
|
}),
|
|
447
|
-
signal:
|
|
447
|
+
signal: l.signal
|
|
448
448
|
});
|
|
449
|
-
if (!
|
|
450
|
-
const
|
|
451
|
-
throw new Error(
|
|
449
|
+
if (!b.ok) {
|
|
450
|
+
const I = await b.json().catch(() => ({}));
|
|
451
|
+
throw new Error(I.error || `Agent request failed: ${b.status}`);
|
|
452
452
|
}
|
|
453
|
-
if (!
|
|
453
|
+
if (!b.body)
|
|
454
454
|
throw new Error("No response body received");
|
|
455
|
-
const
|
|
456
|
-
let
|
|
455
|
+
const E = b.body.getReader(), T = new TextDecoder();
|
|
456
|
+
let D = "";
|
|
457
457
|
for (; ; ) {
|
|
458
|
-
const { done:
|
|
459
|
-
if (
|
|
460
|
-
|
|
461
|
-
const
|
|
458
|
+
const { done: I, value: C } = await E.read();
|
|
459
|
+
if (I) break;
|
|
460
|
+
D += T.decode(C, { stream: !0 });
|
|
461
|
+
const g = D.split(`
|
|
462
462
|
|
|
463
463
|
`);
|
|
464
|
-
|
|
465
|
-
for (const L of
|
|
466
|
-
const
|
|
464
|
+
D = g.pop() || "";
|
|
465
|
+
for (const L of g) {
|
|
466
|
+
const P = L.trim().split(`
|
|
467
467
|
`);
|
|
468
|
-
for (const
|
|
469
|
-
if (
|
|
468
|
+
for (const R of P)
|
|
469
|
+
if (R.startsWith("data: "))
|
|
470
470
|
try {
|
|
471
|
-
const
|
|
472
|
-
|
|
471
|
+
const Q = JSON.parse(R.slice(6));
|
|
472
|
+
S(Q);
|
|
473
473
|
} catch {
|
|
474
474
|
}
|
|
475
475
|
}
|
|
476
476
|
}
|
|
477
|
-
if (
|
|
478
|
-
const
|
|
477
|
+
if (D.trim()) {
|
|
478
|
+
const I = D.trim().split(`
|
|
479
479
|
`);
|
|
480
|
-
for (const
|
|
481
|
-
if (
|
|
480
|
+
for (const C of I)
|
|
481
|
+
if (C.startsWith("data: "))
|
|
482
482
|
try {
|
|
483
|
-
const
|
|
484
|
-
|
|
483
|
+
const g = JSON.parse(C.slice(6));
|
|
484
|
+
S(g);
|
|
485
485
|
} catch {
|
|
486
486
|
}
|
|
487
487
|
}
|
|
488
|
-
} catch (
|
|
489
|
-
if (
|
|
490
|
-
const
|
|
491
|
-
|
|
488
|
+
} catch (d) {
|
|
489
|
+
if (d.name !== "AbortError") {
|
|
490
|
+
const i = d instanceof Error ? d.message : "Stream failed";
|
|
491
|
+
p.current.onError(je(i));
|
|
492
492
|
}
|
|
493
493
|
} finally {
|
|
494
|
-
o(!1),
|
|
494
|
+
o(!1), c.current = null;
|
|
495
495
|
}
|
|
496
|
-
}, [
|
|
497
|
-
|
|
496
|
+
}, [n, t, r]), w = h(() => {
|
|
497
|
+
c.current && (c.current.abort(), c.current = null, o(!1));
|
|
498
498
|
}, []);
|
|
499
499
|
return {
|
|
500
|
-
sendMessage:
|
|
501
|
-
isStreaming:
|
|
500
|
+
sendMessage: u,
|
|
501
|
+
isStreaming: a,
|
|
502
502
|
abort: w
|
|
503
503
|
};
|
|
504
504
|
}
|
|
505
|
-
function
|
|
505
|
+
function qe(e) {
|
|
506
506
|
const t = [];
|
|
507
|
-
let
|
|
508
|
-
for (;
|
|
509
|
-
const
|
|
510
|
-
if (
|
|
511
|
-
const [, o,
|
|
512
|
-
o && t.push(/* @__PURE__ */
|
|
513
|
-
/* @__PURE__ */
|
|
514
|
-
),
|
|
507
|
+
let r = e, n = 0;
|
|
508
|
+
for (; r; ) {
|
|
509
|
+
const c = r.match(/^(.*?)`([^`]+)`(.*)$/);
|
|
510
|
+
if (c) {
|
|
511
|
+
const [, o, p, u] = c;
|
|
512
|
+
o && t.push(/* @__PURE__ */ s("span", { children: o }, n++)), t.push(
|
|
513
|
+
/* @__PURE__ */ s("code", { className: "dc:px-1 dc:py-0.5 dc:rounded dc:text-xs bg-dc-surface dc:font-mono", children: p }, n++)
|
|
514
|
+
), r = u;
|
|
515
515
|
continue;
|
|
516
516
|
}
|
|
517
|
-
const
|
|
518
|
-
if (
|
|
519
|
-
const [, o,
|
|
520
|
-
o && t.push(/* @__PURE__ */
|
|
517
|
+
const a = r.match(/^(.*?)\*\*([^*]+)\*\*(.*)$/);
|
|
518
|
+
if (a) {
|
|
519
|
+
const [, o, p, u] = a;
|
|
520
|
+
o && t.push(/* @__PURE__ */ s("span", { children: o }, n++)), t.push(/* @__PURE__ */ s("strong", { className: "dc:font-semibold", children: p }, n++)), r = u;
|
|
521
521
|
continue;
|
|
522
522
|
}
|
|
523
|
-
t.push(/* @__PURE__ */
|
|
523
|
+
t.push(/* @__PURE__ */ s("span", { children: r }, n));
|
|
524
524
|
break;
|
|
525
525
|
}
|
|
526
526
|
return t;
|
|
527
527
|
}
|
|
528
|
-
const
|
|
528
|
+
const Ke = {
|
|
529
529
|
discover_cubes: "Discovering cubes",
|
|
530
530
|
get_cube_metadata: "Reading metadata",
|
|
531
531
|
execute_query: "Executing query",
|
|
532
532
|
add_portlet: "Adding visualization",
|
|
533
533
|
add_markdown: "Adding explanation"
|
|
534
534
|
};
|
|
535
|
-
function
|
|
536
|
-
const [
|
|
537
|
-
return /* @__PURE__ */
|
|
538
|
-
/* @__PURE__ */
|
|
535
|
+
function Oe({ toolCall: e, loadingComponent: t }) {
|
|
536
|
+
const [r, n] = _(!1), c = Ke[e.name] || e.name, a = e.status === "running";
|
|
537
|
+
return /* @__PURE__ */ f("div", { className: "dc:my-1 dc:text-xs", children: [
|
|
538
|
+
/* @__PURE__ */ f(
|
|
539
539
|
"button",
|
|
540
540
|
{
|
|
541
|
-
onClick: () =>
|
|
541
|
+
onClick: () => n(!r),
|
|
542
542
|
className: "dc:flex dc:items-center dc:gap-1.5 text-dc-text-secondary dc:hover:opacity-80 dc:transition-opacity",
|
|
543
543
|
children: [
|
|
544
|
-
|
|
545
|
-
/* @__PURE__ */
|
|
546
|
-
|
|
547
|
-
|
|
544
|
+
a ? t ? /* @__PURE__ */ s("span", { className: "dc:inline-flex dc:items-center dc:justify-center dc:h-3 dc:w-3", children: t }) : /* @__PURE__ */ s(we, { size: "xs" }) : /* @__PURE__ */ s("span", { className: "dc:text-xs", children: e.status === "error" ? "✗" : "✓" }),
|
|
545
|
+
/* @__PURE__ */ f("span", { children: [
|
|
546
|
+
c,
|
|
547
|
+
a ? "..." : ""
|
|
548
548
|
] }),
|
|
549
|
-
!
|
|
549
|
+
!a && /* @__PURE__ */ s("span", { className: "dc:text-[10px] dc:opacity-60", children: r ? "▲" : "▼" })
|
|
550
550
|
]
|
|
551
551
|
}
|
|
552
552
|
),
|
|
553
|
-
|
|
553
|
+
r && e.result != null && /* @__PURE__ */ s("pre", { className: "dc:mt-1 dc:p-2 dc:rounded dc:text-[11px] dc:overflow-x-auto dc:max-h-32 dc:overflow-y-auto bg-dc-surface-secondary text-dc-text-secondary", children: typeof e.result == "string" ? e.result : JSON.stringify(e.result, null, 2) })
|
|
554
554
|
] });
|
|
555
555
|
}
|
|
556
|
-
const
|
|
556
|
+
const $e = {
|
|
557
557
|
animation: "dc-msg-in 100ms ease-out"
|
|
558
|
-
},
|
|
559
|
-
const
|
|
560
|
-
return !
|
|
558
|
+
}, ze = V.memo(function({ message: t, loadingComponent: r }) {
|
|
559
|
+
const n = t.role === "user", c = !!t.content?.trim(), a = !!t.error, o = t.toolCalls && t.toolCalls.length > 0;
|
|
560
|
+
return !n && !c && !a && !o ? null : /* @__PURE__ */ s(
|
|
561
561
|
"div",
|
|
562
562
|
{
|
|
563
|
-
className: `dc:flex dc:mb-3 ${
|
|
564
|
-
style:
|
|
565
|
-
children: /* @__PURE__ */
|
|
563
|
+
className: `dc:flex dc:mb-3 ${n ? "dc:justify-end" : "dc:justify-start"}`,
|
|
564
|
+
style: $e,
|
|
565
|
+
children: /* @__PURE__ */ f(
|
|
566
566
|
"div",
|
|
567
567
|
{
|
|
568
|
-
className: `dc:max-w-[85%] dc:rounded-lg dc:px-3 dc:py-2 dc:text-sm ${
|
|
568
|
+
className: `dc:max-w-[85%] dc:rounded-lg dc:px-3 dc:py-2 dc:text-sm ${n ? "bg-dc-accent text-dc-accent-text dc:rounded-br-sm" : a && !c ? "bg-dc-warning-bg text-dc-text dc:rounded-bl-sm" : "bg-dc-surface-secondary text-dc-text dc:rounded-bl-sm"}`,
|
|
569
569
|
children: [
|
|
570
|
-
|
|
571
|
-
|
|
572
|
-
/* @__PURE__ */
|
|
573
|
-
/* @__PURE__ */
|
|
570
|
+
c && /* @__PURE__ */ s("div", { className: "dc:whitespace-pre-wrap dc:break-words", children: n ? t.content : qe(t.content) }),
|
|
571
|
+
a && /* @__PURE__ */ f("div", { className: `dc:flex dc:items-start dc:gap-2 ${c ? "dc:mt-2 dc:pt-2 dc:border-t dc:border-current dc:border-opacity-10" : ""}`, children: [
|
|
572
|
+
/* @__PURE__ */ s("span", { className: "dc:text-base dc:leading-none dc:mt-0.5 text-dc-warning dc:flex-shrink-0", children: "⚠" }),
|
|
573
|
+
/* @__PURE__ */ s("span", { className: "text-dc-text-secondary", children: t.error })
|
|
574
574
|
] }),
|
|
575
|
-
o && /* @__PURE__ */
|
|
575
|
+
o && /* @__PURE__ */ s("div", { className: c || a ? "dc:mt-1 dc:border-t dc:border-current dc:border-opacity-10 dc:pt-1" : "", children: t.toolCalls.map((p, u) => /* @__PURE__ */ s(Oe, { toolCall: p, loadingComponent: r }, p.id || u)) })
|
|
576
576
|
]
|
|
577
577
|
}
|
|
578
578
|
)
|
|
579
579
|
}
|
|
580
580
|
);
|
|
581
|
-
}),
|
|
581
|
+
}), We = V.memo(function({
|
|
582
582
|
value: t,
|
|
583
|
-
onChange:
|
|
584
|
-
onSend:
|
|
585
|
-
onStop:
|
|
586
|
-
onContinue:
|
|
583
|
+
onChange: r,
|
|
584
|
+
onSend: n,
|
|
585
|
+
onStop: c,
|
|
586
|
+
onContinue: a,
|
|
587
587
|
isStreaming: o = !1,
|
|
588
|
-
showContinue:
|
|
589
|
-
disabled:
|
|
588
|
+
showContinue: p = !1,
|
|
589
|
+
disabled: u = !1,
|
|
590
590
|
placeholder: w = "Ask about your data..."
|
|
591
591
|
}) {
|
|
592
|
-
const
|
|
593
|
-
|
|
594
|
-
const
|
|
595
|
-
|
|
592
|
+
const x = v(null);
|
|
593
|
+
F(() => {
|
|
594
|
+
const y = x.current;
|
|
595
|
+
y && (y.style.height = "auto", y.style.height = `${Math.min(y.scrollHeight, 150)}px`);
|
|
596
596
|
}, [t]);
|
|
597
|
-
const
|
|
598
|
-
(
|
|
599
|
-
|
|
597
|
+
const N = h(
|
|
598
|
+
(y) => {
|
|
599
|
+
y.key === "Enter" && !y.shiftKey && (y.preventDefault(), !u && t.trim() && n());
|
|
600
600
|
},
|
|
601
|
-
[
|
|
601
|
+
[u, t, n]
|
|
602
602
|
);
|
|
603
|
-
return /* @__PURE__ */
|
|
604
|
-
/* @__PURE__ */
|
|
603
|
+
return /* @__PURE__ */ f("div", { className: "dc:flex dc:gap-2 dc:items-end dc:p-3 border-dc-border dc:border-t", children: [
|
|
604
|
+
/* @__PURE__ */ s(
|
|
605
605
|
"textarea",
|
|
606
606
|
{
|
|
607
|
-
ref:
|
|
607
|
+
ref: x,
|
|
608
608
|
value: t,
|
|
609
|
-
onChange: (
|
|
610
|
-
onKeyDown:
|
|
609
|
+
onChange: (y) => r(y.target.value),
|
|
610
|
+
onKeyDown: N,
|
|
611
611
|
placeholder: w,
|
|
612
|
-
disabled:
|
|
612
|
+
disabled: u,
|
|
613
613
|
rows: 1,
|
|
614
614
|
className: "dc:flex-1 dc:resize-none dc:rounded-lg dc:px-3 dc:py-2 dc:text-sm bg-dc-surface-secondary text-dc-text border-dc-border dc:border dc:outline-none dc:focus:ring-1 focus:ring-dc-accent dc:disabled:opacity-50"
|
|
615
615
|
}
|
|
616
616
|
),
|
|
617
|
-
o ? /* @__PURE__ */
|
|
617
|
+
o ? /* @__PURE__ */ s(
|
|
618
618
|
"button",
|
|
619
619
|
{
|
|
620
|
-
onClick:
|
|
620
|
+
onClick: c,
|
|
621
621
|
className: "dc:px-4 dc:py-2 dc:rounded-lg dc:text-sm dc:font-medium dc:transition-colors text-dc-error border-dc-border dc:border dc:hover:opacity-80 dc:shrink-0",
|
|
622
622
|
children: "Stop"
|
|
623
623
|
}
|
|
624
|
-
) : /* @__PURE__ */
|
|
625
|
-
|
|
624
|
+
) : /* @__PURE__ */ f(te, { children: [
|
|
625
|
+
p && !t.trim() && /* @__PURE__ */ s(
|
|
626
626
|
"button",
|
|
627
627
|
{
|
|
628
628
|
onClick: () => {
|
|
629
|
-
|
|
629
|
+
a?.(), x.current?.focus();
|
|
630
630
|
},
|
|
631
631
|
className: "dc:px-4 dc:py-2 dc:rounded-lg dc:text-sm dc:font-medium dc:transition-colors border-dc-border dc:border text-dc-text-secondary dc:hover:opacity-80 dc:shrink-0",
|
|
632
632
|
children: "Continue"
|
|
633
633
|
}
|
|
634
634
|
),
|
|
635
|
-
/* @__PURE__ */
|
|
635
|
+
/* @__PURE__ */ s(
|
|
636
636
|
"button",
|
|
637
637
|
{
|
|
638
|
-
onClick:
|
|
639
|
-
disabled:
|
|
638
|
+
onClick: n,
|
|
639
|
+
disabled: u || !t.trim(),
|
|
640
640
|
className: "dc:px-4 dc:py-2 dc:rounded-lg dc:text-sm dc:font-medium dc:transition-colors bg-dc-accent text-dc-accent-text dc:hover:opacity-90 dc:disabled:opacity-40 dc:disabled:cursor-not-allowed dc:shrink-0",
|
|
641
641
|
children: "Send"
|
|
642
642
|
}
|
|
643
643
|
)
|
|
644
644
|
] })
|
|
645
645
|
] });
|
|
646
|
-
}),
|
|
646
|
+
}), Je = j("thumbUp"), Ge = j("thumbDown"), He = V.memo(function({
|
|
647
647
|
agentEndpoint: t,
|
|
648
|
-
agentApiKey:
|
|
649
|
-
onClear:
|
|
650
|
-
onDashboardSaved:
|
|
651
|
-
|
|
652
|
-
|
|
648
|
+
agentApiKey: r,
|
|
649
|
+
onClear: n,
|
|
650
|
+
onDashboardSaved: c,
|
|
651
|
+
onScore: a,
|
|
652
|
+
loadingComponent: o,
|
|
653
|
+
initialPrompt: p
|
|
653
654
|
}) {
|
|
654
|
-
const
|
|
655
|
-
addMessage:
|
|
656
|
-
appendToLastAssistantMessage:
|
|
657
|
-
setLastAssistantError:
|
|
658
|
-
addToolCallToLastAssistant:
|
|
659
|
-
updateLastToolCall:
|
|
660
|
-
setIsStreaming:
|
|
661
|
-
setInputValue:
|
|
662
|
-
setSessionId:
|
|
663
|
-
} = A(
|
|
664
|
-
|
|
665
|
-
const
|
|
666
|
-
|
|
667
|
-
const
|
|
668
|
-
|
|
669
|
-
const
|
|
670
|
-
|
|
655
|
+
const u = v(null), w = v(!1), [x, N] = _(null), [y, S] = _(/* @__PURE__ */ new Set()), l = v(!1), { messages: d, isStreaming: i, inputValue: k } = A(z(Me)), {
|
|
656
|
+
addMessage: b,
|
|
657
|
+
appendToLastAssistantMessage: E,
|
|
658
|
+
setLastAssistantError: T,
|
|
659
|
+
addToolCallToLastAssistant: D,
|
|
660
|
+
updateLastToolCall: I,
|
|
661
|
+
setIsStreaming: C,
|
|
662
|
+
setInputValue: g,
|
|
663
|
+
setSessionId: L
|
|
664
|
+
} = A(z(Ie)), P = A((m) => m.sessionId), R = A((m) => m.addBlock), Q = A((m) => m.reset), $ = A((m) => m.blocks.filter((M) => M.type === "portlet").length), W = v(d);
|
|
665
|
+
W.current = d;
|
|
666
|
+
const J = v(i);
|
|
667
|
+
J.current = i;
|
|
668
|
+
const G = v(P);
|
|
669
|
+
G.current = P;
|
|
670
|
+
const U = h(() => {
|
|
671
|
+
l.current && (l.current = !1, b({
|
|
671
672
|
id: `msg-${Date.now()}`,
|
|
672
673
|
role: "assistant",
|
|
673
674
|
content: "",
|
|
674
675
|
toolCalls: [],
|
|
675
676
|
timestamp: Date.now()
|
|
676
677
|
}));
|
|
677
|
-
}, [
|
|
678
|
-
|
|
679
|
-
|
|
680
|
-
}, [
|
|
681
|
-
const { sendMessage:
|
|
678
|
+
}, [b]), H = v(d.length);
|
|
679
|
+
F(() => {
|
|
680
|
+
d.length > H.current && u.current?.scrollIntoView({ behavior: "smooth" }), H.current = d.length;
|
|
681
|
+
}, [d]);
|
|
682
|
+
const { sendMessage: Y, abort: K } = Ue({
|
|
682
683
|
agentEndpoint: t,
|
|
683
|
-
agentApiKey:
|
|
684
|
-
onTextDelta:
|
|
685
|
-
|
|
686
|
-
}, [
|
|
687
|
-
onToolStart:
|
|
688
|
-
|
|
689
|
-
}, [
|
|
690
|
-
onToolResult:
|
|
691
|
-
|
|
692
|
-
}, [
|
|
693
|
-
onAddPortlet:
|
|
694
|
-
|
|
695
|
-
}, [
|
|
696
|
-
onAddMarkdown:
|
|
697
|
-
|
|
698
|
-
}, [
|
|
699
|
-
onDashboardSaved:
|
|
700
|
-
onTurnComplete:
|
|
701
|
-
|
|
684
|
+
agentApiKey: r,
|
|
685
|
+
onTextDelta: h((m) => {
|
|
686
|
+
U(), E(m);
|
|
687
|
+
}, [U, E]),
|
|
688
|
+
onToolStart: h((m, M, B) => {
|
|
689
|
+
U(), D({ id: m, name: M, input: B, status: "running" });
|
|
690
|
+
}, [U, D]),
|
|
691
|
+
onToolResult: h((m, M, B, ue) => {
|
|
692
|
+
I({ id: m, status: ue ? "error" : "complete", result: B });
|
|
693
|
+
}, [I]),
|
|
694
|
+
onAddPortlet: h((m) => {
|
|
695
|
+
R(m);
|
|
696
|
+
}, [R]),
|
|
697
|
+
onAddMarkdown: h((m) => {
|
|
698
|
+
R(m);
|
|
699
|
+
}, [R]),
|
|
700
|
+
onDashboardSaved: c,
|
|
701
|
+
onTurnComplete: h(() => {
|
|
702
|
+
l.current = !0;
|
|
702
703
|
}, []),
|
|
703
|
-
onDone:
|
|
704
|
-
|
|
705
|
-
}, [
|
|
706
|
-
onError:
|
|
707
|
-
|
|
708
|
-
}, [
|
|
709
|
-
}),
|
|
710
|
-
if (!
|
|
711
|
-
|
|
712
|
-
const
|
|
713
|
-
role:
|
|
714
|
-
content:
|
|
715
|
-
...
|
|
704
|
+
onDone: h((m, M) => {
|
|
705
|
+
l.current = !1, L(m), C(!1), M && N(M);
|
|
706
|
+
}, [L, C]),
|
|
707
|
+
onError: h((m) => {
|
|
708
|
+
U(), T(m), C(!1);
|
|
709
|
+
}, [U, T, C])
|
|
710
|
+
}), q = h((m) => {
|
|
711
|
+
if (!m || J.current) return;
|
|
712
|
+
l.current = !1;
|
|
713
|
+
const M = W.current.map((B) => ({
|
|
714
|
+
role: B.role,
|
|
715
|
+
content: B.content,
|
|
716
|
+
...B.toolCalls && B.toolCalls.length > 0 ? { toolCalls: B.toolCalls } : {}
|
|
716
717
|
}));
|
|
717
|
-
|
|
718
|
+
b({
|
|
718
719
|
id: `msg-${Date.now()}`,
|
|
719
720
|
role: "user",
|
|
720
|
-
content:
|
|
721
|
+
content: m,
|
|
721
722
|
timestamp: Date.now()
|
|
722
|
-
}),
|
|
723
|
+
}), b({
|
|
723
724
|
id: `msg-${Date.now() + 1}`,
|
|
724
725
|
role: "assistant",
|
|
725
726
|
content: "",
|
|
726
727
|
toolCalls: [],
|
|
727
728
|
timestamp: Date.now()
|
|
728
|
-
}),
|
|
729
|
-
}, [
|
|
730
|
-
|
|
731
|
-
if (
|
|
732
|
-
|
|
733
|
-
const
|
|
729
|
+
}), g(""), C(!0), Y(m, G.current, M);
|
|
730
|
+
}, [b, g, C, Y]);
|
|
731
|
+
F(() => {
|
|
732
|
+
if (p && !w.current && d.length === 0) {
|
|
733
|
+
w.current = !0;
|
|
734
|
+
const m = setTimeout(() => q(p), 100);
|
|
734
735
|
return () => {
|
|
735
|
-
clearTimeout(
|
|
736
|
+
clearTimeout(m), w.current = !1;
|
|
736
737
|
};
|
|
737
738
|
}
|
|
738
|
-
}, [
|
|
739
|
-
const
|
|
740
|
-
|
|
741
|
-
const
|
|
742
|
-
|
|
743
|
-
}, [
|
|
744
|
-
|
|
745
|
-
}, [
|
|
746
|
-
|
|
747
|
-
}, [
|
|
748
|
-
|
|
749
|
-
}, [
|
|
750
|
-
|
|
739
|
+
}, [p, d.length, q]);
|
|
740
|
+
const X = v(k);
|
|
741
|
+
X.current = k;
|
|
742
|
+
const ce = h(() => {
|
|
743
|
+
q(X.current.trim());
|
|
744
|
+
}, [q]), ae = h(() => {
|
|
745
|
+
K(), C(!1);
|
|
746
|
+
}, [K, C]), ne = h(() => {
|
|
747
|
+
g("");
|
|
748
|
+
}, [g]), oe = h(() => {
|
|
749
|
+
K(), C(!1), Q(), N(null), S(/* @__PURE__ */ new Set()), n?.();
|
|
750
|
+
}, [K, C, Q, n]), de = h(() => {
|
|
751
|
+
q(
|
|
751
752
|
"Save the current notebook as a dashboard with a professional layout, section headers, and appropriate filters."
|
|
752
753
|
);
|
|
753
|
-
}, [
|
|
754
|
-
|
|
755
|
-
|
|
756
|
-
|
|
757
|
-
|
|
758
|
-
|
|
754
|
+
}, [q]), Z = h((m) => {
|
|
755
|
+
!x || !a || (a({ traceId: x, value: m }), S((M) => new Set(M).add(x)));
|
|
756
|
+
}, [x, a]), ie = !!c && !i && $ > 0 && d.length > 0, le = !!a && !i && x && d.length > 0 && !y.has(x), ee = x ? y.has(x) : !1;
|
|
757
|
+
return /* @__PURE__ */ f("div", { className: "dc:flex dc:flex-col dc:h-full bg-dc-surface", children: [
|
|
758
|
+
/* @__PURE__ */ f("div", { className: "dc:flex dc:items-center dc:justify-between dc:px-4 dc:py-3 border-dc-border dc:border-b", children: [
|
|
759
|
+
/* @__PURE__ */ s("h3", { className: "dc:text-sm dc:font-semibold text-dc-text", children: "AI Assistant" }),
|
|
760
|
+
/* @__PURE__ */ f("div", { className: "dc:flex dc:items-center dc:gap-1", children: [
|
|
761
|
+
ie && /* @__PURE__ */ s(
|
|
759
762
|
"button",
|
|
760
763
|
{
|
|
761
|
-
onClick:
|
|
764
|
+
onClick: de,
|
|
762
765
|
className: "dc:text-xs dc:px-2 dc:py-1 dc:rounded text-dc-accent dc:hover:opacity-80",
|
|
763
766
|
title: "Save notebook as a dashboard",
|
|
764
767
|
children: "Save as Dashboard"
|
|
765
768
|
}
|
|
766
769
|
),
|
|
767
|
-
|
|
770
|
+
d.length > 0 && /* @__PURE__ */ s(
|
|
768
771
|
"button",
|
|
769
772
|
{
|
|
770
|
-
onClick:
|
|
771
|
-
disabled:
|
|
773
|
+
onClick: oe,
|
|
774
|
+
disabled: i,
|
|
772
775
|
className: "dc:text-xs dc:px-2 dc:py-1 dc:rounded text-dc-text-secondary dc:hover:opacity-80 dc:disabled:opacity-40",
|
|
773
776
|
title: "Clear notebook and chat",
|
|
774
777
|
children: "Clear"
|
|
@@ -776,129 +779,158 @@ const Fe = {
|
|
|
776
779
|
)
|
|
777
780
|
] })
|
|
778
781
|
] }),
|
|
779
|
-
/* @__PURE__ */
|
|
780
|
-
|
|
781
|
-
|
|
782
|
+
/* @__PURE__ */ f("div", { className: "dc:flex-1 dc:overflow-y-auto dc:px-4 dc:py-3", children: [
|
|
783
|
+
d.length === 0 ? /* @__PURE__ */ s(Ye, {}) : d.map((m) => /* @__PURE__ */ s(
|
|
784
|
+
ze,
|
|
782
785
|
{
|
|
783
|
-
message:
|
|
784
|
-
loadingComponent:
|
|
786
|
+
message: m,
|
|
787
|
+
loadingComponent: o
|
|
785
788
|
},
|
|
786
|
-
|
|
789
|
+
m.id
|
|
787
790
|
)),
|
|
788
|
-
/* @__PURE__ */
|
|
791
|
+
(le || ee) && /* @__PURE__ */ s("div", { className: "dc:flex dc:items-center dc:justify-center dc:gap-3 dc:py-4 dc:mt-2", children: ee ? /* @__PURE__ */ s("span", { className: "dc:text-sm text-dc-text-secondary", children: "Thanks for your feedback!" }) : /* @__PURE__ */ f(te, { children: [
|
|
792
|
+
/* @__PURE__ */ s("span", { className: "dc:text-sm text-dc-text-secondary", children: "Was this helpful?" }),
|
|
793
|
+
/* @__PURE__ */ f("div", { className: "dc:flex dc:items-center dc:gap-2", children: [
|
|
794
|
+
/* @__PURE__ */ f(
|
|
795
|
+
"button",
|
|
796
|
+
{
|
|
797
|
+
onClick: () => Z(1),
|
|
798
|
+
className: "dc:flex dc:items-center dc:gap-1.5 dc:px-3 dc:py-1.5 dc:rounded-lg dc:text-sm dc:font-medium border-dc-border dc:border text-dc-success hover:bg-dc-success-bg dc:transition-colors bg-dc-surface dc:cursor-pointer",
|
|
799
|
+
children: [
|
|
800
|
+
/* @__PURE__ */ s(Je, { className: "dc:w-4 dc:h-4" }),
|
|
801
|
+
"Yes"
|
|
802
|
+
]
|
|
803
|
+
}
|
|
804
|
+
),
|
|
805
|
+
/* @__PURE__ */ f(
|
|
806
|
+
"button",
|
|
807
|
+
{
|
|
808
|
+
onClick: () => Z(0),
|
|
809
|
+
className: "dc:flex dc:items-center dc:gap-1.5 dc:px-3 dc:py-1.5 dc:rounded-lg dc:text-sm dc:font-medium border-dc-border dc:border text-dc-error hover:bg-dc-danger-bg dc:transition-colors bg-dc-surface dc:cursor-pointer",
|
|
810
|
+
children: [
|
|
811
|
+
/* @__PURE__ */ s(Ge, { className: "dc:w-4 dc:h-4" }),
|
|
812
|
+
"No"
|
|
813
|
+
]
|
|
814
|
+
}
|
|
815
|
+
)
|
|
816
|
+
] })
|
|
817
|
+
] }) }),
|
|
818
|
+
/* @__PURE__ */ s("div", { ref: u })
|
|
789
819
|
] }),
|
|
790
|
-
/* @__PURE__ */
|
|
791
|
-
|
|
820
|
+
/* @__PURE__ */ s(
|
|
821
|
+
We,
|
|
792
822
|
{
|
|
793
|
-
value:
|
|
794
|
-
onChange:
|
|
795
|
-
onSend:
|
|
796
|
-
onStop:
|
|
797
|
-
onContinue:
|
|
798
|
-
isStreaming:
|
|
799
|
-
showContinue: !
|
|
823
|
+
value: k,
|
|
824
|
+
onChange: g,
|
|
825
|
+
onSend: ce,
|
|
826
|
+
onStop: ae,
|
|
827
|
+
onContinue: ne,
|
|
828
|
+
isStreaming: i,
|
|
829
|
+
showContinue: !i && d.length > 0
|
|
800
830
|
}
|
|
801
831
|
)
|
|
802
832
|
] });
|
|
803
833
|
});
|
|
804
|
-
function
|
|
805
|
-
return /* @__PURE__ */
|
|
806
|
-
/* @__PURE__ */
|
|
807
|
-
/* @__PURE__ */
|
|
808
|
-
/* @__PURE__ */
|
|
809
|
-
/* @__PURE__ */
|
|
810
|
-
/* @__PURE__ */
|
|
811
|
-
/* @__PURE__ */
|
|
834
|
+
function Ye() {
|
|
835
|
+
return /* @__PURE__ */ s("div", { className: "dc:flex dc:items-center dc:justify-center dc:h-full", children: /* @__PURE__ */ f("div", { className: "dc:text-center dc:max-w-xs", children: [
|
|
836
|
+
/* @__PURE__ */ s("div", { className: "dc:text-lg dc:font-semibold text-dc-text dc:mb-2", children: "Data Analysis Assistant" }),
|
|
837
|
+
/* @__PURE__ */ s("p", { className: "dc:text-sm text-dc-text-secondary dc:mb-4", children: "Ask me about your data and I'll create visualizations and insights." }),
|
|
838
|
+
/* @__PURE__ */ f("div", { className: "dc:space-y-2 dc:text-xs text-dc-text-muted", children: [
|
|
839
|
+
/* @__PURE__ */ s("p", { children: '"Show me employee productivity trends"' }),
|
|
840
|
+
/* @__PURE__ */ s("p", { children: '"What are the top departments by headcount?"' }),
|
|
841
|
+
/* @__PURE__ */ s("p", { children: '"Compare revenue across product categories"' })
|
|
812
842
|
] })
|
|
813
843
|
] }) });
|
|
814
844
|
}
|
|
815
|
-
function
|
|
845
|
+
function Xe({
|
|
816
846
|
agentEndpoint: e,
|
|
817
847
|
agentApiKey: t,
|
|
818
|
-
onSave:
|
|
819
|
-
onDirtyStateChange:
|
|
820
|
-
onDashboardSaved:
|
|
821
|
-
|
|
822
|
-
|
|
823
|
-
|
|
848
|
+
onSave: r,
|
|
849
|
+
onDirtyStateChange: n,
|
|
850
|
+
onDashboardSaved: c,
|
|
851
|
+
onScore: a,
|
|
852
|
+
loadingComponent: o,
|
|
853
|
+
className: p,
|
|
854
|
+
initialPrompt: u
|
|
824
855
|
}) {
|
|
825
|
-
const [
|
|
826
|
-
|
|
827
|
-
const
|
|
828
|
-
|
|
829
|
-
}, [
|
|
830
|
-
const b =
|
|
831
|
-
|
|
832
|
-
const
|
|
833
|
-
|
|
834
|
-
if ((
|
|
835
|
-
if (
|
|
836
|
-
|
|
856
|
+
const [w, x] = _(60), N = v(null), y = v(!1), S = A((g) => g.blocks.length), l = A((g) => g.messages.length), d = A((g) => g.isStreaming), i = A((g) => g.save), k = v({ blockCount: S, msgCount: l });
|
|
857
|
+
F(() => {
|
|
858
|
+
const g = S !== k.current.blockCount || l !== k.current.msgCount;
|
|
859
|
+
n?.(g);
|
|
860
|
+
}, [S, l, n]);
|
|
861
|
+
const b = v(), E = v(!1), T = v(r);
|
|
862
|
+
T.current = r;
|
|
863
|
+
const D = v(S > 0 || l > 0);
|
|
864
|
+
F(() => {
|
|
865
|
+
if ((S > 0 || l > 0) && (D.current = !0), !(!T.current || !D.current)) {
|
|
866
|
+
if (d) {
|
|
867
|
+
E.current = !0, b.current && clearTimeout(b.current);
|
|
837
868
|
return;
|
|
838
869
|
}
|
|
839
870
|
return b.current && clearTimeout(b.current), b.current = setTimeout(() => {
|
|
840
|
-
|
|
841
|
-
const
|
|
842
|
-
|
|
871
|
+
E.current = !1;
|
|
872
|
+
const g = i();
|
|
873
|
+
T.current?.(g);
|
|
843
874
|
}, 1e3), () => {
|
|
844
875
|
b.current && clearTimeout(b.current);
|
|
845
876
|
};
|
|
846
877
|
}
|
|
847
|
-
}, [
|
|
848
|
-
!
|
|
849
|
-
|
|
850
|
-
const
|
|
851
|
-
|
|
878
|
+
}, [S, l, d, i]), F(() => {
|
|
879
|
+
!d && E.current && T.current && D.current && (b.current && clearTimeout(b.current), b.current = setTimeout(() => {
|
|
880
|
+
E.current = !1;
|
|
881
|
+
const g = i();
|
|
882
|
+
T.current?.(g);
|
|
852
883
|
}, 1e3));
|
|
853
|
-
}, [
|
|
854
|
-
const
|
|
855
|
-
|
|
856
|
-
}, []),
|
|
857
|
-
|
|
858
|
-
const
|
|
859
|
-
if (!
|
|
860
|
-
const
|
|
861
|
-
|
|
862
|
-
},
|
|
863
|
-
|
|
884
|
+
}, [d, i]);
|
|
885
|
+
const I = h(() => {
|
|
886
|
+
T.current && (b.current && clearTimeout(b.current), T.current({ blocks: [], messages: [] }));
|
|
887
|
+
}, []), C = h((g) => {
|
|
888
|
+
g.preventDefault(), y.current = !0;
|
|
889
|
+
const L = (R) => {
|
|
890
|
+
if (!y.current || !N.current) return;
|
|
891
|
+
const Q = N.current.getBoundingClientRect(), $ = (R.clientX - Q.left) / Q.width * 100;
|
|
892
|
+
x(Math.min(Math.max($, 30), 80));
|
|
893
|
+
}, P = () => {
|
|
894
|
+
y.current = !1, document.removeEventListener("mousemove", L), document.removeEventListener("mouseup", P);
|
|
864
895
|
};
|
|
865
|
-
document.addEventListener("mousemove",
|
|
896
|
+
document.addEventListener("mousemove", L), document.addEventListener("mouseup", P);
|
|
866
897
|
}, []);
|
|
867
|
-
return /* @__PURE__ */
|
|
898
|
+
return /* @__PURE__ */ f(
|
|
868
899
|
"div",
|
|
869
900
|
{
|
|
870
|
-
ref:
|
|
871
|
-
className: `dc:flex dc:h-full dc:w-full dc:overflow-hidden bg-dc-surface-secondary ${
|
|
901
|
+
ref: N,
|
|
902
|
+
className: `dc:flex dc:h-full dc:w-full dc:overflow-hidden bg-dc-surface-secondary ${p || ""}`,
|
|
872
903
|
children: [
|
|
873
|
-
/* @__PURE__ */
|
|
904
|
+
/* @__PURE__ */ s(
|
|
874
905
|
"div",
|
|
875
906
|
{
|
|
876
907
|
className: "dc:h-full dc:overflow-hidden",
|
|
877
|
-
style: { width: `${
|
|
878
|
-
children: /* @__PURE__ */
|
|
908
|
+
style: { width: `${w}%` },
|
|
909
|
+
children: /* @__PURE__ */ s(Ve, {})
|
|
879
910
|
}
|
|
880
911
|
),
|
|
881
|
-
/* @__PURE__ */
|
|
912
|
+
/* @__PURE__ */ s(
|
|
882
913
|
"div",
|
|
883
914
|
{
|
|
884
915
|
className: "dc:w-1 dc:h-full dc:cursor-col-resize dc:flex-shrink-0 dc:transition-colors bg-dc-border dc:hover:bg-dc-accent",
|
|
885
|
-
onMouseDown:
|
|
916
|
+
onMouseDown: C
|
|
886
917
|
}
|
|
887
918
|
),
|
|
888
|
-
/* @__PURE__ */
|
|
919
|
+
/* @__PURE__ */ s(
|
|
889
920
|
"div",
|
|
890
921
|
{
|
|
891
922
|
className: "dc:h-full dc:overflow-hidden",
|
|
892
|
-
style: { width: `${100 -
|
|
893
|
-
children: /* @__PURE__ */
|
|
894
|
-
|
|
923
|
+
style: { width: `${100 - w}%` },
|
|
924
|
+
children: /* @__PURE__ */ s(
|
|
925
|
+
He,
|
|
895
926
|
{
|
|
896
927
|
agentEndpoint: e,
|
|
897
928
|
agentApiKey: t,
|
|
898
|
-
onClear:
|
|
899
|
-
onDashboardSaved:
|
|
900
|
-
|
|
901
|
-
|
|
929
|
+
onClear: I,
|
|
930
|
+
onDashboardSaved: c,
|
|
931
|
+
onScore: a,
|
|
932
|
+
loadingComponent: o,
|
|
933
|
+
initialPrompt: u
|
|
902
934
|
}
|
|
903
935
|
)
|
|
904
936
|
}
|
|
@@ -907,208 +939,208 @@ function Ue({
|
|
|
907
939
|
}
|
|
908
940
|
);
|
|
909
941
|
}
|
|
910
|
-
const
|
|
942
|
+
const mt = V.memo(function({
|
|
911
943
|
config: t,
|
|
912
|
-
...
|
|
944
|
+
...r
|
|
913
945
|
}) {
|
|
914
|
-
return /* @__PURE__ */
|
|
946
|
+
return /* @__PURE__ */ s(De, { initialConfig: t, children: /* @__PURE__ */ s(Xe, { ...r }) });
|
|
915
947
|
});
|
|
916
|
-
function
|
|
917
|
-
return /* @__PURE__ */
|
|
948
|
+
function pt() {
|
|
949
|
+
return /* @__PURE__ */ s("div", { children: "Analytics Page - Coming in Phase 4" });
|
|
918
950
|
}
|
|
919
|
-
const
|
|
920
|
-
function
|
|
951
|
+
const Ze = j("segment");
|
|
952
|
+
function ht({
|
|
921
953
|
className: e = ""
|
|
922
954
|
}) {
|
|
923
|
-
return /* @__PURE__ */
|
|
955
|
+
return /* @__PURE__ */ s(
|
|
924
956
|
"div",
|
|
925
957
|
{
|
|
926
958
|
className: `dc:flex dc:items-center dc:justify-center bg-dc-bg-secondary ${e}`,
|
|
927
|
-
children: /* @__PURE__ */
|
|
928
|
-
/* @__PURE__ */
|
|
929
|
-
|
|
959
|
+
children: /* @__PURE__ */ f("div", { className: "dc:text-center", children: [
|
|
960
|
+
/* @__PURE__ */ s(
|
|
961
|
+
Ze,
|
|
930
962
|
{
|
|
931
963
|
className: "dc:w-8 dc:h-8 dc:mx-auto dc:mb-2 text-dc-text-muted dc:opacity-50"
|
|
932
964
|
}
|
|
933
965
|
),
|
|
934
|
-
/* @__PURE__ */
|
|
966
|
+
/* @__PURE__ */ s("span", { className: "dc:text-xs text-dc-text-muted", children: "No preview" })
|
|
935
967
|
] })
|
|
936
968
|
}
|
|
937
969
|
);
|
|
938
970
|
}
|
|
939
971
|
export {
|
|
940
|
-
|
|
941
|
-
|
|
942
|
-
|
|
943
|
-
|
|
944
|
-
|
|
945
|
-
|
|
946
|
-
|
|
947
|
-
|
|
948
|
-
|
|
949
|
-
|
|
950
|
-
|
|
951
|
-
|
|
952
|
-
|
|
953
|
-
|
|
954
|
-
|
|
955
|
-
|
|
956
|
-
|
|
957
|
-
|
|
958
|
-
|
|
959
|
-
|
|
960
|
-
|
|
961
|
-
|
|
962
|
-
|
|
963
|
-
|
|
964
|
-
|
|
965
|
-
|
|
966
|
-
|
|
967
|
-
|
|
968
|
-
|
|
969
|
-
|
|
970
|
-
|
|
971
|
-
|
|
972
|
-
|
|
973
|
-
|
|
974
|
-
|
|
975
|
-
|
|
976
|
-
|
|
977
|
-
|
|
978
|
-
|
|
979
|
-
|
|
980
|
-
|
|
981
|
-
|
|
982
|
-
|
|
983
|
-
|
|
984
|
-
|
|
985
|
-
|
|
986
|
-
|
|
987
|
-
|
|
988
|
-
|
|
989
|
-
|
|
990
|
-
|
|
991
|
-
|
|
992
|
-
|
|
993
|
-
|
|
994
|
-
|
|
995
|
-
|
|
996
|
-
|
|
997
|
-
|
|
998
|
-
|
|
999
|
-
|
|
1000
|
-
|
|
1001
|
-
|
|
1002
|
-
|
|
1003
|
-
|
|
1004
|
-
|
|
1005
|
-
|
|
1006
|
-
|
|
1007
|
-
|
|
1008
|
-
|
|
1009
|
-
|
|
1010
|
-
|
|
1011
|
-
|
|
1012
|
-
|
|
1013
|
-
|
|
1014
|
-
|
|
1015
|
-
|
|
1016
|
-
|
|
1017
|
-
|
|
1018
|
-
|
|
1019
|
-
|
|
1020
|
-
|
|
1021
|
-
|
|
1022
|
-
|
|
1023
|
-
|
|
1024
|
-
|
|
1025
|
-
|
|
1026
|
-
|
|
1027
|
-
|
|
1028
|
-
|
|
1029
|
-
|
|
1030
|
-
|
|
1031
|
-
|
|
1032
|
-
|
|
1033
|
-
|
|
1034
|
-
|
|
1035
|
-
|
|
1036
|
-
|
|
1037
|
-
|
|
1038
|
-
|
|
1039
|
-
|
|
1040
|
-
|
|
1041
|
-
|
|
1042
|
-
|
|
1043
|
-
|
|
1044
|
-
|
|
1045
|
-
|
|
1046
|
-
|
|
1047
|
-
|
|
1048
|
-
|
|
1049
|
-
|
|
1050
|
-
|
|
1051
|
-
|
|
1052
|
-
|
|
1053
|
-
|
|
1054
|
-
|
|
1055
|
-
|
|
1056
|
-
|
|
1057
|
-
|
|
1058
|
-
|
|
1059
|
-
|
|
1060
|
-
|
|
1061
|
-
|
|
1062
|
-
|
|
1063
|
-
|
|
1064
|
-
|
|
1065
|
-
|
|
1066
|
-
|
|
1067
|
-
|
|
1068
|
-
|
|
1069
|
-
|
|
1070
|
-
|
|
1071
|
-
|
|
1072
|
-
|
|
1073
|
-
|
|
1074
|
-
|
|
1075
|
-
|
|
1076
|
-
|
|
1077
|
-
|
|
1078
|
-
|
|
1079
|
-
|
|
1080
|
-
|
|
1081
|
-
|
|
1082
|
-
|
|
1083
|
-
|
|
1084
|
-
|
|
1085
|
-
|
|
1086
|
-
|
|
1087
|
-
|
|
1088
|
-
|
|
1089
|
-
|
|
1090
|
-
|
|
1091
|
-
|
|
1092
|
-
|
|
1093
|
-
|
|
1094
|
-
|
|
1095
|
-
|
|
1096
|
-
|
|
1097
|
-
|
|
1098
|
-
|
|
972
|
+
mt as AgenticNotebook,
|
|
973
|
+
bt as AnalysisBuilder,
|
|
974
|
+
yt as AnalyticsDashboard,
|
|
975
|
+
pt as AnalyticsPage,
|
|
976
|
+
pe as AnalyticsPortlet,
|
|
977
|
+
xt as ChartErrorBoundary,
|
|
978
|
+
vt as ConfirmModal,
|
|
979
|
+
ks as CubeClient,
|
|
980
|
+
ws as CubeProvider,
|
|
981
|
+
ms as DEFAULT_ICONS,
|
|
982
|
+
Ct as DashboardEditModal,
|
|
983
|
+
Nt as DashboardGrid,
|
|
984
|
+
kt as DashboardStoreProvider,
|
|
985
|
+
ht as DashboardThumbnailPlaceholder,
|
|
986
|
+
wt as DrillBreadcrumb,
|
|
987
|
+
St as DrillMenu,
|
|
988
|
+
zs as ExecutionPlanPanel,
|
|
989
|
+
Ws as ExplainAIPanel,
|
|
990
|
+
_s as LazyChart,
|
|
991
|
+
we as LoadingIndicator,
|
|
992
|
+
Tt as Modal,
|
|
993
|
+
De as NotebookStoreProvider,
|
|
994
|
+
fe as PortletAnalysisModal,
|
|
995
|
+
Dt as PortletContainer,
|
|
996
|
+
Ss as ScrollContainerProvider,
|
|
997
|
+
ec as THEME_PRESETS,
|
|
998
|
+
tc as applyTheme,
|
|
999
|
+
zr as buildFunnelConfigFromQueries,
|
|
1000
|
+
Wr as buildServerFunnelQuery,
|
|
1001
|
+
Ts as captureThumbnail,
|
|
1002
|
+
Js as compressAndEncode,
|
|
1003
|
+
Ds as createCubeClient,
|
|
1004
|
+
Tr as createDashboardLayout,
|
|
1005
|
+
At as createDashboardStore,
|
|
1006
|
+
Mt as createDefaultConfig,
|
|
1007
|
+
It as createDefaultFlowConfig,
|
|
1008
|
+
Et as createDefaultFunnelConfig,
|
|
1009
|
+
Rt as createDefaultQueryConfig,
|
|
1010
|
+
Bt as createDefaultRetentionConfig,
|
|
1011
|
+
Lt as createDefaultWorkspace,
|
|
1012
|
+
lc as createExplainQueryKey,
|
|
1013
|
+
Mr as createFlowQueryKey,
|
|
1014
|
+
Ir as createFunnelQueryKey,
|
|
1015
|
+
Te as createNotebookStore,
|
|
1016
|
+
Gs as decodeAndDecompress,
|
|
1017
|
+
Hs as detectAsymmetricDateRanges,
|
|
1018
|
+
Ys as detectMeasureCollisions,
|
|
1019
|
+
Dr as formatChartData,
|
|
1020
|
+
Jr as formatDuration,
|
|
1021
|
+
Er as generateQueryLabel,
|
|
1022
|
+
Xs as generateShareUrl,
|
|
1023
|
+
Zs as getAvailableBindingKeyDimensions,
|
|
1024
|
+
Vs as getAvailableChartTypes,
|
|
1025
|
+
Gr as getBindingKeyField,
|
|
1026
|
+
er as getBindingKeyLabel,
|
|
1027
|
+
ps as getChartTypeIcon,
|
|
1028
|
+
Rr as getCombinedFields,
|
|
1029
|
+
Hr as getCubeNameFromQuery,
|
|
1030
|
+
hs as getFieldTypeIcon,
|
|
1031
|
+
j as getIcon,
|
|
1032
|
+
fs as getIconData,
|
|
1033
|
+
gs as getIconRegistry,
|
|
1034
|
+
bs as getIconsByCategory,
|
|
1035
|
+
ys as getMeasureTypeIcon,
|
|
1036
|
+
Br as getQueryIndices,
|
|
1037
|
+
Lr as getQueryLabels,
|
|
1038
|
+
sc as getTheme,
|
|
1039
|
+
rc as getThemeVariable,
|
|
1040
|
+
js as getUnavailableChartTypes,
|
|
1041
|
+
tr as getValidationSummary,
|
|
1042
|
+
vc as highlightCodeBlocks,
|
|
1043
|
+
Us as isChartTypeAvailable,
|
|
1044
|
+
cc as isDarkMode,
|
|
1045
|
+
Pt as isFlowConfig,
|
|
1046
|
+
Qt as isFunnelConfig,
|
|
1047
|
+
Yr as isFunnelData,
|
|
1048
|
+
sr as isMinimumFunnelConfigValid,
|
|
1049
|
+
Ft as isMultiQuery,
|
|
1050
|
+
_t as isMultiQueryConfig,
|
|
1051
|
+
Pr as isMultiQueryData,
|
|
1052
|
+
rr as isMultiQueryValid,
|
|
1053
|
+
Vt as isQueryConfig,
|
|
1054
|
+
jt as isRetentionConfig,
|
|
1055
|
+
bc as isSankeyData,
|
|
1056
|
+
yc as isServerFlowQuery,
|
|
1057
|
+
Ut as isServerFunnelQuery,
|
|
1058
|
+
cr as isShareableSize,
|
|
1059
|
+
qt as isSingleQuery,
|
|
1060
|
+
As as isThumbnailCaptureAvailable,
|
|
1061
|
+
Kt as isValidAnalysisConfig,
|
|
1062
|
+
Ot as isValidAnalysisWorkspace,
|
|
1063
|
+
qs as isValidChartType,
|
|
1064
|
+
Qr as mergeQueryResults,
|
|
1065
|
+
Fr as mergeResultsByKey,
|
|
1066
|
+
_r as mergeResultsConcat,
|
|
1067
|
+
$t as migrateConfig,
|
|
1068
|
+
zt as migrateLegacyPortlet,
|
|
1069
|
+
ar as parseShareUrl,
|
|
1070
|
+
Ks as preloadChart,
|
|
1071
|
+
Os as preloadCharts,
|
|
1072
|
+
xs as registerIcons,
|
|
1073
|
+
vs as resetIcons,
|
|
1074
|
+
ac as resetTheme,
|
|
1075
|
+
Wt as selectAllActions,
|
|
1076
|
+
Ee as selectBlockActions,
|
|
1077
|
+
Ae as selectBlocks,
|
|
1078
|
+
nr as selectBreakdowns,
|
|
1079
|
+
or as selectChartConfig,
|
|
1080
|
+
Ie as selectChatActions,
|
|
1081
|
+
Me as selectChatState,
|
|
1082
|
+
dr as selectCurrentState,
|
|
1083
|
+
Jt as selectDebugData,
|
|
1084
|
+
Gt as selectDebugDataActions,
|
|
1085
|
+
Ht as selectEditModeActions,
|
|
1086
|
+
Yt as selectEditModeState,
|
|
1087
|
+
ir as selectFilters,
|
|
1088
|
+
lr as selectFunnelState,
|
|
1089
|
+
ut as selectInputValue,
|
|
1090
|
+
it as selectIsStreaming,
|
|
1091
|
+
Xt as selectLayoutActions,
|
|
1092
|
+
Zt as selectLayoutState,
|
|
1093
|
+
dt as selectMessages,
|
|
1094
|
+
ur as selectMetrics,
|
|
1095
|
+
es as selectModalActions,
|
|
1096
|
+
ts as selectModalState,
|
|
1097
|
+
mr as selectMultiQueryState,
|
|
1098
|
+
ss as selectPortletDebugData,
|
|
1099
|
+
lt as selectSessionId,
|
|
1100
|
+
rs as selectThumbnailDirty,
|
|
1101
|
+
pr as selectUIState,
|
|
1102
|
+
Cs as setIcon,
|
|
1103
|
+
nc as setTheme,
|
|
1104
|
+
oc as setThemeVariable,
|
|
1105
|
+
Xr as transformServerFunnelResult,
|
|
1106
|
+
Ue as useAgentChat,
|
|
1107
|
+
hr as useAnalysisBuilder,
|
|
1108
|
+
fr as useAnalysisBuilderStore,
|
|
1109
|
+
ke as useCubeApi,
|
|
1110
|
+
Ms as useCubeContext,
|
|
1111
|
+
Is as useCubeFeatures,
|
|
1112
|
+
Qs as useCubeFieldLabel,
|
|
1113
|
+
Vr as useCubeLoadQuery,
|
|
1114
|
+
Es as useCubeMeta,
|
|
1115
|
+
Rs as useCubeMetaQuery,
|
|
1116
|
+
jr as useCubeQuery,
|
|
1117
|
+
cs as useDashboard,
|
|
1118
|
+
as as useDashboardStore,
|
|
1119
|
+
ns as useDashboardStoreApi,
|
|
1120
|
+
os as useDashboardStoreOptional,
|
|
1121
|
+
ds as useDrillInteraction,
|
|
1122
|
+
uc as useDryRunQueries,
|
|
1123
|
+
mc as useDryRunQuery,
|
|
1124
|
+
is as useElementVisibility,
|
|
1125
|
+
pc as useExplainAI,
|
|
1126
|
+
hc as useExplainQuery,
|
|
1127
|
+
Ur as useFlowQuery,
|
|
1128
|
+
qr as useFunnelQuery,
|
|
1129
|
+
Kr as useMultiCubeLoadQuery,
|
|
1130
|
+
fc as useMultiDryRunQueries,
|
|
1099
1131
|
A as useNotebookStore,
|
|
1100
|
-
|
|
1101
|
-
|
|
1102
|
-
|
|
1103
|
-
|
|
1104
|
-
|
|
1105
|
-
|
|
1106
|
-
|
|
1107
|
-
|
|
1108
|
-
|
|
1109
|
-
|
|
1110
|
-
|
|
1111
|
-
|
|
1112
|
-
|
|
1132
|
+
Bs as useScrollContainer,
|
|
1133
|
+
ls as useScrollDetection,
|
|
1134
|
+
wr as useTheme,
|
|
1135
|
+
gr as validateBindingKeyExists,
|
|
1136
|
+
br as validateBindingKeyForSteps,
|
|
1137
|
+
yr as validateFunnelConfig,
|
|
1138
|
+
Or as validateMergeKey,
|
|
1139
|
+
xr as validateMergeKeys,
|
|
1140
|
+
vr as validateMultiQueryConfig,
|
|
1141
|
+
Cr as validateStepQueries,
|
|
1142
|
+
Nr as validateTimeDimensionAlignment,
|
|
1143
|
+
Ls as warnIfScreenshotLibMissing,
|
|
1144
|
+
dc as watchThemeChanges
|
|
1113
1145
|
};
|
|
1114
1146
|
//# sourceMappingURL=index.js.map
|