drizzle-cube 0.4.13 → 0.4.14
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/README.md +1 -0
- package/dist/adapters/express/index.cjs +6 -6
- package/dist/adapters/express/index.js +73 -72
- package/dist/adapters/fastify/index.cjs +5 -5
- package/dist/adapters/fastify/index.js +110 -109
- package/dist/adapters/{handler-CQkIwtxp.js → handler-DZnCbydH.js} +719 -272
- package/dist/adapters/handler-ZDYlokiM.cjs +25 -0
- package/dist/adapters/hono/index.cjs +6 -6
- package/dist/adapters/hono/index.js +121 -120
- package/dist/adapters/nextjs/index.cjs +5 -5
- package/dist/adapters/nextjs/index.js +92 -91
- package/dist/client/charts.js +67 -59
- package/dist/client/charts.js.map +1 -1
- package/dist/client/chunks/{RetentionCombinedChart-CEI8KQ3t.js → RetentionCombinedChart-CLq89aOJ.js} +2 -2
- package/dist/client/chunks/{RetentionCombinedChart-CEI8KQ3t.js.map → RetentionCombinedChart-CLq89aOJ.js.map} +1 -1
- package/dist/client/chunks/{analysis-builder-BMmWeFPr.js → analysis-builder-C5e52Z3p.js} +419 -411
- package/dist/client/chunks/analysis-builder-C5e52Z3p.js.map +1 -0
- package/dist/client/chunks/{analysis-builder-shared-D56zYeV0.js → analysis-builder-shared-EnM-8plh.js} +2 -2
- package/dist/client/chunks/{analysis-builder-shared-D56zYeV0.js.map → analysis-builder-shared-EnM-8plh.js.map} +1 -1
- package/dist/client/chunks/{chart-activity-grid-CE7xGFQo.js → chart-activity-grid-CPGcTSuh.js} +2 -2
- package/dist/client/chunks/{chart-activity-grid-CE7xGFQo.js.map → chart-activity-grid-CPGcTSuh.js.map} +1 -1
- package/dist/client/chunks/{chart-area-BJAgusst.js → chart-area-ByJQ7NZd.js} +3 -3
- package/dist/client/chunks/{chart-area-BJAgusst.js.map → chart-area-ByJQ7NZd.js.map} +1 -1
- package/dist/client/chunks/{chart-bar-Blypx8O4.js → chart-bar-dj14frMt.js} +2 -2
- package/dist/client/chunks/{chart-bar-Blypx8O4.js.map → chart-bar-dj14frMt.js.map} +1 -1
- package/dist/client/chunks/chart-box-plot-ZatBpatq.js +322 -0
- package/dist/client/chunks/chart-box-plot-ZatBpatq.js.map +1 -0
- package/dist/client/chunks/{chart-bubble-Bf42A1-B.js → chart-bubble-CemotLx-.js} +2 -2
- package/dist/client/chunks/{chart-bubble-Bf42A1-B.js.map → chart-bubble-CemotLx-.js.map} +1 -1
- package/dist/client/chunks/chart-candlestick-BIR4uGGt.js +269 -0
- package/dist/client/chunks/chart-candlestick-BIR4uGGt.js.map +1 -0
- package/dist/client/chunks/chart-config-box-plot-D_E_SSc2.js +38 -0
- package/dist/client/chunks/chart-config-box-plot-D_E_SSc2.js.map +1 -0
- package/dist/client/chunks/chart-config-candlestick-CRCpD43-.js +70 -0
- package/dist/client/chunks/chart-config-candlestick-CRCpD43-.js.map +1 -0
- package/dist/client/chunks/chart-config-gauge-CQx9w3d4.js +64 -0
- package/dist/client/chunks/chart-config-gauge-CQx9w3d4.js.map +1 -0
- package/dist/client/chunks/chart-config-measure-profile-ZYaMrtws.js +70 -0
- package/dist/client/chunks/chart-config-measure-profile-ZYaMrtws.js.map +1 -0
- package/dist/client/chunks/chart-config-waterfall-DTyXV_fo.js +60 -0
- package/dist/client/chunks/chart-config-waterfall-DTyXV_fo.js.map +1 -0
- package/dist/client/chunks/{chart-data-table-Ba_6tuJw.js → chart-data-table-D5G8nMnb.js} +2 -2
- package/dist/client/chunks/{chart-data-table-Ba_6tuJw.js.map → chart-data-table-D5G8nMnb.js.map} +1 -1
- package/dist/client/chunks/{chart-funnel-C9kenCpp.js → chart-funnel-dofnhD24.js} +2 -2
- package/dist/client/chunks/{chart-funnel-C9kenCpp.js.map → chart-funnel-dofnhD24.js.map} +1 -1
- package/dist/client/chunks/chart-gauge-CKJJ8m3b.js +374 -0
- package/dist/client/chunks/chart-gauge-CKJJ8m3b.js.map +1 -0
- package/dist/client/chunks/{chart-heat-map-CYGemyPB.js → chart-heat-map-BVuPUKHT.js} +2 -2
- package/dist/client/chunks/{chart-heat-map-CYGemyPB.js.map → chart-heat-map-BVuPUKHT.js.map} +1 -1
- package/dist/client/chunks/{chart-kpi-delta-D9XJoKuA.js → chart-kpi-delta-Dgg2eYRl.js} +3 -3
- package/dist/client/chunks/{chart-kpi-delta-D9XJoKuA.js.map → chart-kpi-delta-Dgg2eYRl.js.map} +1 -1
- package/dist/client/chunks/{chart-kpi-number-C29Vj2g8.js → chart-kpi-number-DkoO99c1.js} +2 -2
- package/dist/client/chunks/{chart-kpi-number-C29Vj2g8.js.map → chart-kpi-number-DkoO99c1.js.map} +1 -1
- package/dist/client/chunks/{chart-kpi-text-CgjjrurK.js → chart-kpi-text-1O6_lmz7.js} +3 -3
- package/dist/client/chunks/{chart-kpi-text-CgjjrurK.js.map → chart-kpi-text-1O6_lmz7.js.map} +1 -1
- package/dist/client/chunks/{chart-line-zi6olZet.js → chart-line-DzyZkugh.js} +3 -3
- package/dist/client/chunks/{chart-line-zi6olZet.js.map → chart-line-DzyZkugh.js.map} +1 -1
- package/dist/client/chunks/chart-measure-profile-C2IkBG3V.js +114 -0
- package/dist/client/chunks/chart-measure-profile-C2IkBG3V.js.map +1 -0
- package/dist/client/chunks/{chart-pie-C4SuxKSN.js → chart-pie-akbfRfb9.js} +2 -2
- package/dist/client/chunks/{chart-pie-C4SuxKSN.js.map → chart-pie-akbfRfb9.js.map} +1 -1
- package/dist/client/chunks/{chart-radar-BW3Z_-Ly.js → chart-radar-BaN-Kjww.js} +2 -2
- package/dist/client/chunks/{chart-radar-BW3Z_-Ly.js.map → chart-radar-BaN-Kjww.js.map} +1 -1
- package/dist/client/chunks/{chart-radial-bar-0Fa3aeP5.js → chart-radial-bar-DpptEL3s.js} +2 -2
- package/dist/client/chunks/{chart-radial-bar-0Fa3aeP5.js.map → chart-radial-bar-DpptEL3s.js.map} +1 -1
- package/dist/client/chunks/{chart-sankey-DBghfbg1.js → chart-sankey-CG-3hHmX.js} +2 -2
- package/dist/client/chunks/{chart-sankey-DBghfbg1.js.map → chart-sankey-CG-3hHmX.js.map} +1 -1
- package/dist/client/chunks/{chart-scatter-DOVu1TNq.js → chart-scatter-l_yTVxF3.js} +2 -2
- package/dist/client/chunks/{chart-scatter-DOVu1TNq.js.map → chart-scatter-l_yTVxF3.js.map} +1 -1
- package/dist/client/chunks/{chart-sunburst-LfNthFlZ.js → chart-sunburst-KhDcKhmZ.js} +2 -2
- package/dist/client/chunks/{chart-sunburst-LfNthFlZ.js.map → chart-sunburst-KhDcKhmZ.js.map} +1 -1
- package/dist/client/chunks/{chart-tree-map-DZtQPyWX.js → chart-tree-map-CBbiaBXV.js} +2 -2
- package/dist/client/chunks/{chart-tree-map-DZtQPyWX.js.map → chart-tree-map-CBbiaBXV.js.map} +1 -1
- package/dist/client/chunks/chart-waterfall-CX3vx_lI.js +191 -0
- package/dist/client/chunks/chart-waterfall-CX3vx_lI.js.map +1 -0
- package/dist/client/chunks/{charts-core-DmGfleFz.js → charts-core-CU9u_HtL.js} +2 -1
- package/dist/client/chunks/charts-core-CU9u_HtL.js.map +1 -0
- package/dist/client/chunks/{charts-loader-CH0_S06T.js → charts-loader-AW3T1nv5.js} +58 -42
- package/dist/client/chunks/charts-loader-AW3T1nv5.js.map +1 -0
- package/dist/client/chunks/{components-ClQziOcT.js → components-BkeSy9xv.js} +4 -4
- package/dist/client/chunks/components-BkeSy9xv.js.map +1 -0
- package/dist/client/components/AgenticNotebook/AgentChatPanel.d.ts +10 -0
- package/dist/client/components/AgenticNotebook/ChatMessage.d.ts +2 -0
- package/dist/client/components/AgenticNotebook/index.d.ts +11 -1
- package/dist/client/components/LoadingIndicator.d.ts +2 -2
- package/dist/client/components/charts/BoxPlotChart.config.d.ts +1 -7
- package/dist/client/components/charts/CandlestickChart.config.d.ts +5 -0
- package/dist/client/components/charts/CandlestickChart.d.ts +4 -0
- package/dist/client/components/charts/GaugeChart.config.d.ts +5 -0
- package/dist/client/components/charts/GaugeChart.d.ts +4 -0
- package/dist/client/components/charts/MeasureProfileChart.config.d.ts +5 -0
- package/dist/client/components/charts/MeasureProfileChart.d.ts +4 -0
- package/dist/client/components/charts/WaterfallChart.config.d.ts +5 -0
- package/dist/client/components/charts/WaterfallChart.d.ts +4 -0
- package/dist/client/components/charts/index.d.ts +4 -0
- package/dist/client/components.js +1 -1
- package/dist/client/hooks/useAgentChat.d.ts +20 -2
- package/dist/client/index.js +583 -522
- package/dist/client/index.js.map +1 -1
- package/dist/client/styles.css +1 -1
- package/dist/client/types.d.ts +19 -1
- package/dist/client/utils.js +4 -4
- package/dist/client-bundle-stats.html +1 -1
- package/dist/server/index.cjs +47 -45
- package/dist/server/index.d.ts +37 -0
- package/dist/server/index.js +1745 -1298
- package/package.json +4 -1
- package/dist/adapters/handler-dnkqpznh.cjs +0 -23
- package/dist/client/chunks/analysis-builder-BMmWeFPr.js.map +0 -1
- package/dist/client/chunks/chart-box-plot-Dja4LS3O.js +0 -313
- package/dist/client/chunks/chart-box-plot-Dja4LS3O.js.map +0 -1
- package/dist/client/chunks/chart-config-box-plot-D3DA7_pr.js +0 -85
- package/dist/client/chunks/chart-config-box-plot-D3DA7_pr.js.map +0 -1
- package/dist/client/chunks/charts-core-DmGfleFz.js.map +0 -1
- package/dist/client/chunks/charts-loader-CH0_S06T.js.map +0 -1
- package/dist/client/chunks/components-ClQziOcT.js.map +0 -1
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { NextResponse as t } from "next/server";
|
|
2
2
|
import { e as T, s as A, v as D, b as P, a as _, n as Q, p as V, w as I, d as J, i as M, M as k, c as $, S as K } from "../mcp-transport-m1X1GtwG.js";
|
|
3
3
|
import { formatErrorResponse as i, formatCubeResponse as z, formatMetaResponse as G, formatSqlResponse as U, handleDryRun as q, handleBatchRequest as B, handleDiscover as F, handleSuggest as X, handleValidate as W, handleLoad as Y } from "../utils.js";
|
|
4
|
-
function
|
|
4
|
+
function E(n) {
|
|
5
5
|
const { cubes: a, drizzle: s, schema: c, engineType: d, cache: o } = n;
|
|
6
6
|
if (!a || a.length === 0)
|
|
7
7
|
throw new Error("At least one cube must be provided in the cubes array");
|
|
@@ -29,22 +29,22 @@ function ue(n) {
|
|
|
29
29
|
};
|
|
30
30
|
}
|
|
31
31
|
function Z(n) {
|
|
32
|
-
const { extractSecurityContext: a, cors: s } = n, c =
|
|
32
|
+
const { extractSecurityContext: a, cors: s } = n, c = E(n);
|
|
33
33
|
return async function(o, r) {
|
|
34
34
|
try {
|
|
35
35
|
let e;
|
|
36
36
|
if (o.method === "POST") {
|
|
37
|
-
const
|
|
38
|
-
e =
|
|
37
|
+
const p = await o.json();
|
|
38
|
+
e = p.query || p;
|
|
39
39
|
} else if (o.method === "GET") {
|
|
40
|
-
const
|
|
41
|
-
if (!
|
|
40
|
+
const p = o.nextUrl.searchParams.get("query");
|
|
41
|
+
if (!p)
|
|
42
42
|
return t.json(
|
|
43
43
|
i("Query parameter is required", 400),
|
|
44
44
|
{ status: 400 }
|
|
45
45
|
);
|
|
46
46
|
try {
|
|
47
|
-
e = JSON.parse(
|
|
47
|
+
e = JSON.parse(p);
|
|
48
48
|
} catch {
|
|
49
49
|
return t.json(
|
|
50
50
|
i("Invalid JSON in query parameter", 400),
|
|
@@ -62,8 +62,8 @@ function Z(n) {
|
|
|
62
62
|
i(`Query validation failed: ${y.errors.join(", ")}`, 400),
|
|
63
63
|
{ status: 400 }
|
|
64
64
|
);
|
|
65
|
-
const l = o.headers.get("x-cache-control") === "no-cache", f = await c.executeMultiCubeQuery(e, u, { skipCache: l }),
|
|
66
|
-
return t.json(
|
|
65
|
+
const l = o.headers.get("x-cache-control") === "no-cache", f = await c.executeMultiCubeQuery(e, u, { skipCache: l }), v = z(e, f, c);
|
|
66
|
+
return t.json(v, {
|
|
67
67
|
headers: s ? g(o, s) : {}
|
|
68
68
|
});
|
|
69
69
|
} catch (e) {
|
|
@@ -78,7 +78,7 @@ function Z(n) {
|
|
|
78
78
|
};
|
|
79
79
|
}
|
|
80
80
|
function ee(n) {
|
|
81
|
-
const { cors: a } = n, s =
|
|
81
|
+
const { cors: a } = n, s = E(n);
|
|
82
82
|
return async function(d, o) {
|
|
83
83
|
try {
|
|
84
84
|
const r = s.getMetadata(), e = G(r);
|
|
@@ -97,22 +97,22 @@ function ee(n) {
|
|
|
97
97
|
};
|
|
98
98
|
}
|
|
99
99
|
function te(n) {
|
|
100
|
-
const { extractSecurityContext: a, cors: s } = n, c =
|
|
100
|
+
const { extractSecurityContext: a, cors: s } = n, c = E(n);
|
|
101
101
|
return async function(o, r) {
|
|
102
102
|
try {
|
|
103
103
|
let e;
|
|
104
104
|
if (o.method === "POST") {
|
|
105
|
-
const
|
|
106
|
-
e =
|
|
105
|
+
const C = await o.json();
|
|
106
|
+
e = C.query || C;
|
|
107
107
|
} else if (o.method === "GET") {
|
|
108
|
-
const
|
|
109
|
-
if (!
|
|
108
|
+
const C = o.nextUrl.searchParams.get("query");
|
|
109
|
+
if (!C)
|
|
110
110
|
return t.json(
|
|
111
111
|
i("Query parameter is required", 400),
|
|
112
112
|
{ status: 400 }
|
|
113
113
|
);
|
|
114
114
|
try {
|
|
115
|
-
e = JSON.parse(
|
|
115
|
+
e = JSON.parse(C);
|
|
116
116
|
} catch {
|
|
117
117
|
return t.json(
|
|
118
118
|
i("Invalid JSON in query parameter", 400),
|
|
@@ -136,8 +136,8 @@ function te(n) {
|
|
|
136
136
|
i("No measures or dimensions specified", 400),
|
|
137
137
|
{ status: 400 }
|
|
138
138
|
);
|
|
139
|
-
const f = l.split(".")[0],
|
|
140
|
-
return t.json(
|
|
139
|
+
const f = l.split(".")[0], v = await c.generateSQL(f, e, u), p = U(e, v);
|
|
140
|
+
return t.json(p, {
|
|
141
141
|
headers: s ? g(o, s) : {}
|
|
142
142
|
});
|
|
143
143
|
} catch (e) {
|
|
@@ -152,7 +152,7 @@ function te(n) {
|
|
|
152
152
|
};
|
|
153
153
|
}
|
|
154
154
|
function re(n) {
|
|
155
|
-
const { extractSecurityContext: a, cors: s } = n, c =
|
|
155
|
+
const { extractSecurityContext: a, cors: s } = n, c = E(n);
|
|
156
156
|
return async function(o, r) {
|
|
157
157
|
try {
|
|
158
158
|
let e;
|
|
@@ -195,7 +195,7 @@ function re(n) {
|
|
|
195
195
|
};
|
|
196
196
|
}
|
|
197
197
|
function ne(n) {
|
|
198
|
-
const { extractSecurityContext: a, cors: s } = n, c =
|
|
198
|
+
const { extractSecurityContext: a, cors: s } = n, c = E(n);
|
|
199
199
|
return async function(o, r) {
|
|
200
200
|
try {
|
|
201
201
|
if (o.method !== "POST")
|
|
@@ -230,7 +230,7 @@ function ne(n) {
|
|
|
230
230
|
};
|
|
231
231
|
}
|
|
232
232
|
function se(n) {
|
|
233
|
-
const { extractSecurityContext: a, cors: s } = n, c =
|
|
233
|
+
const { extractSecurityContext: a, cors: s } = n, c = E(n);
|
|
234
234
|
return async function(o, r) {
|
|
235
235
|
try {
|
|
236
236
|
if (o.method !== "POST")
|
|
@@ -244,12 +244,12 @@ function se(n) {
|
|
|
244
244
|
{ error: `Query validation failed: ${f.errors.join(", ")}` },
|
|
245
245
|
{ status: 400 }
|
|
246
246
|
);
|
|
247
|
-
const
|
|
247
|
+
const v = await c.explainQuery(
|
|
248
248
|
u,
|
|
249
249
|
l,
|
|
250
250
|
y
|
|
251
251
|
);
|
|
252
|
-
return t.json(
|
|
252
|
+
return t.json(v, {
|
|
253
253
|
headers: s ? g(o, s) : {}
|
|
254
254
|
});
|
|
255
255
|
} catch (e) {
|
|
@@ -261,7 +261,7 @@ function se(n) {
|
|
|
261
261
|
};
|
|
262
262
|
}
|
|
263
263
|
function le(n) {
|
|
264
|
-
const { cors: a } = n, s =
|
|
264
|
+
const { cors: a } = n, s = E(n);
|
|
265
265
|
return async function(d, o) {
|
|
266
266
|
try {
|
|
267
267
|
if (d.method !== "POST")
|
|
@@ -285,7 +285,7 @@ function le(n) {
|
|
|
285
285
|
};
|
|
286
286
|
}
|
|
287
287
|
function fe(n) {
|
|
288
|
-
const { cors: a } = n, s =
|
|
288
|
+
const { cors: a } = n, s = E(n);
|
|
289
289
|
return async function(d, o) {
|
|
290
290
|
try {
|
|
291
291
|
if (d.method !== "POST")
|
|
@@ -315,7 +315,7 @@ function fe(n) {
|
|
|
315
315
|
};
|
|
316
316
|
}
|
|
317
317
|
function ye(n) {
|
|
318
|
-
const { cors: a } = n, s =
|
|
318
|
+
const { cors: a } = n, s = E(n);
|
|
319
319
|
return async function(d, o) {
|
|
320
320
|
try {
|
|
321
321
|
if (d.method !== "POST")
|
|
@@ -345,7 +345,7 @@ function ye(n) {
|
|
|
345
345
|
};
|
|
346
346
|
}
|
|
347
347
|
function he(n) {
|
|
348
|
-
const { extractSecurityContext: a, cors: s } = n, c =
|
|
348
|
+
const { extractSecurityContext: a, cors: s } = n, c = E(n);
|
|
349
349
|
return async function(o, r) {
|
|
350
350
|
try {
|
|
351
351
|
if (o.method !== "POST")
|
|
@@ -375,7 +375,7 @@ function he(n) {
|
|
|
375
375
|
};
|
|
376
376
|
}
|
|
377
377
|
function ae(n) {
|
|
378
|
-
const { extractSecurityContext: a, cors: s, mcp: c = { enabled: !0 } } = n, d =
|
|
378
|
+
const { extractSecurityContext: a, cors: s, mcp: c = { enabled: !0 } } = n, d = E(n);
|
|
379
379
|
return async function(r) {
|
|
380
380
|
if (r.method === "DELETE")
|
|
381
381
|
return t.json(
|
|
@@ -383,24 +383,24 @@ function ae(n) {
|
|
|
383
383
|
{ status: 405 }
|
|
384
384
|
);
|
|
385
385
|
if (r.method === "GET") {
|
|
386
|
-
const
|
|
387
|
-
start(
|
|
388
|
-
|
|
386
|
+
const h = new TextEncoder(), S = T(), x = new ReadableStream({
|
|
387
|
+
start(m) {
|
|
388
|
+
m.enqueue(h.encode(A({
|
|
389
389
|
jsonrpc: "2.0",
|
|
390
390
|
method: "mcp/ready",
|
|
391
391
|
params: { protocol: "streamable-http" }
|
|
392
|
-
},
|
|
392
|
+
}, S, 15e3)));
|
|
393
393
|
}
|
|
394
|
-
}),
|
|
394
|
+
}), j = new Headers({
|
|
395
395
|
"Content-Type": "text/event-stream",
|
|
396
396
|
"Cache-Control": "no-cache",
|
|
397
397
|
Connection: "keep-alive"
|
|
398
398
|
});
|
|
399
399
|
if (s) {
|
|
400
|
-
const
|
|
401
|
-
Object.entries(
|
|
400
|
+
const m = g(r, s);
|
|
401
|
+
Object.entries(m).forEach(([w, N]) => j.set(w, N));
|
|
402
402
|
}
|
|
403
|
-
return new t(
|
|
403
|
+
return new t(x, { status: 200, headers: j });
|
|
404
404
|
}
|
|
405
405
|
if (r.method !== "POST")
|
|
406
406
|
return t.json(
|
|
@@ -440,70 +440,70 @@ function ae(n) {
|
|
|
440
440
|
P(null, -32600, "Invalid JSON-RPC 2.0 request"),
|
|
441
441
|
{ status: 400 }
|
|
442
442
|
);
|
|
443
|
-
const
|
|
444
|
-
status:
|
|
445
|
-
headers: { ...s ? g(r, s) : {}, ...
|
|
443
|
+
const v = I(u), p = f.method === "initialize", C = (h, S = 200, x = {}) => t.json(h, {
|
|
444
|
+
status: S,
|
|
445
|
+
headers: { ...s ? g(r, s) : {}, ...x }
|
|
446
446
|
});
|
|
447
447
|
try {
|
|
448
|
-
const
|
|
448
|
+
const h = await J(
|
|
449
449
|
f.method,
|
|
450
450
|
f.params,
|
|
451
451
|
{
|
|
452
452
|
semanticLayer: d,
|
|
453
|
-
extractSecurityContext: (
|
|
453
|
+
extractSecurityContext: (m) => a(m),
|
|
454
454
|
rawRequest: r,
|
|
455
455
|
rawResponse: null
|
|
456
456
|
}
|
|
457
457
|
);
|
|
458
458
|
if (M(f))
|
|
459
459
|
return new t(null, { status: 202 });
|
|
460
|
-
const
|
|
461
|
-
|
|
462
|
-
const
|
|
463
|
-
if (
|
|
464
|
-
const
|
|
465
|
-
start(
|
|
466
|
-
|
|
460
|
+
const S = p && h && typeof h == "object" && "sessionId" in h ? h.sessionId : void 0, x = {};
|
|
461
|
+
S && (x[k] = S);
|
|
462
|
+
const j = $(f.id ?? null, h);
|
|
463
|
+
if (v) {
|
|
464
|
+
const m = new TextEncoder(), w = T(), N = new ReadableStream({
|
|
465
|
+
start(b) {
|
|
466
|
+
b.enqueue(m.encode(`id: ${w}
|
|
467
467
|
|
|
468
|
-
`)),
|
|
468
|
+
`)), b.enqueue(m.encode(A(j, w))), b.close();
|
|
469
469
|
}
|
|
470
470
|
}), O = new Headers({
|
|
471
471
|
"Content-Type": "text/event-stream",
|
|
472
472
|
"Cache-Control": "no-cache",
|
|
473
473
|
Connection: "keep-alive",
|
|
474
|
-
...
|
|
474
|
+
...x
|
|
475
475
|
});
|
|
476
476
|
if (s) {
|
|
477
|
-
const
|
|
478
|
-
Object.entries(
|
|
477
|
+
const b = g(r, s);
|
|
478
|
+
Object.entries(b).forEach(([H, R]) => O.set(H, R));
|
|
479
479
|
}
|
|
480
|
-
return new t(
|
|
480
|
+
return new t(N, { status: 200, headers: O });
|
|
481
481
|
}
|
|
482
|
-
return
|
|
483
|
-
} catch (
|
|
482
|
+
return C(j, 200, x);
|
|
483
|
+
} catch (h) {
|
|
484
484
|
if (M(f))
|
|
485
|
-
return process.env.NODE_ENV !== "test" && console.error("Next.js MCP notification processing error:",
|
|
486
|
-
process.env.NODE_ENV !== "test" && console.error("Next.js MCP RPC handler error:",
|
|
487
|
-
const
|
|
488
|
-
if (
|
|
489
|
-
const
|
|
490
|
-
start(
|
|
491
|
-
|
|
485
|
+
return process.env.NODE_ENV !== "test" && console.error("Next.js MCP notification processing error:", h), new t(null, { status: 202 });
|
|
486
|
+
process.env.NODE_ENV !== "test" && console.error("Next.js MCP RPC handler error:", h);
|
|
487
|
+
const S = h?.code ?? -32603, x = h?.data, j = h.message || "MCP request failed", m = P(f.id ?? null, S, j, x);
|
|
488
|
+
if (v) {
|
|
489
|
+
const w = new TextEncoder(), N = T(), O = new ReadableStream({
|
|
490
|
+
start(H) {
|
|
491
|
+
H.enqueue(w.encode(`id: ${N}
|
|
492
492
|
|
|
493
|
-
`)),
|
|
493
|
+
`)), H.enqueue(w.encode(A(m, N))), H.close();
|
|
494
494
|
}
|
|
495
|
-
}),
|
|
495
|
+
}), b = new Headers({
|
|
496
496
|
"Content-Type": "text/event-stream",
|
|
497
497
|
"Cache-Control": "no-cache",
|
|
498
498
|
Connection: "keep-alive"
|
|
499
499
|
});
|
|
500
500
|
if (s) {
|
|
501
|
-
const
|
|
502
|
-
Object.entries(
|
|
501
|
+
const H = g(r, s);
|
|
502
|
+
Object.entries(H).forEach(([R, L]) => b.set(R, L));
|
|
503
503
|
}
|
|
504
|
-
return new t(O, { status: 200, headers:
|
|
504
|
+
return new t(O, { status: 200, headers: b });
|
|
505
505
|
}
|
|
506
|
-
return
|
|
506
|
+
return C(m, 200);
|
|
507
507
|
}
|
|
508
508
|
};
|
|
509
509
|
}
|
|
@@ -511,7 +511,7 @@ function oe(n) {
|
|
|
511
511
|
const { extractSecurityContext: a, cors: s, agent: c } = n;
|
|
512
512
|
if (!c)
|
|
513
513
|
throw new Error("agent config is required for createAgentChatHandler");
|
|
514
|
-
const d =
|
|
514
|
+
const d = E(n);
|
|
515
515
|
return async function(r, e) {
|
|
516
516
|
try {
|
|
517
517
|
if (r.method !== "POST")
|
|
@@ -519,61 +519,62 @@ function oe(n) {
|
|
|
519
519
|
{ error: "Method not allowed - use POST" },
|
|
520
520
|
{ status: 405 }
|
|
521
521
|
);
|
|
522
|
-
const { handleAgentChat: u } = await import("../handler-
|
|
522
|
+
const { handleAgentChat: u } = await import("../handler-DZnCbydH.js"), y = await r.json(), { message: l, sessionId: f, history: v } = y;
|
|
523
523
|
if (!l || typeof l != "string")
|
|
524
524
|
return t.json(
|
|
525
525
|
{ error: "message is required and must be a string" },
|
|
526
526
|
{ status: 400 }
|
|
527
527
|
);
|
|
528
|
-
let
|
|
528
|
+
let p = (c.apiKey || "").trim();
|
|
529
529
|
if (c.allowClientApiKey) {
|
|
530
|
-
const
|
|
531
|
-
|
|
530
|
+
const j = r.headers.get("x-agent-api-key");
|
|
531
|
+
j && (p = j.trim());
|
|
532
532
|
}
|
|
533
|
-
if (!
|
|
533
|
+
if (!p)
|
|
534
534
|
return t.json(
|
|
535
535
|
{ error: "No API key configured. Set agent.apiKey in server config or send X-Agent-Api-Key header." },
|
|
536
536
|
{ status: 401 }
|
|
537
537
|
);
|
|
538
|
-
const
|
|
539
|
-
async start(
|
|
538
|
+
const C = await a(r, e), h = new TextEncoder(), S = new ReadableStream({
|
|
539
|
+
async start(j) {
|
|
540
540
|
try {
|
|
541
|
-
const
|
|
541
|
+
const m = u({
|
|
542
542
|
message: l,
|
|
543
543
|
sessionId: f,
|
|
544
|
+
history: v,
|
|
544
545
|
semanticLayer: d,
|
|
545
|
-
securityContext:
|
|
546
|
+
securityContext: C,
|
|
546
547
|
agentConfig: c,
|
|
547
|
-
apiKey:
|
|
548
|
+
apiKey: p
|
|
548
549
|
});
|
|
549
|
-
for await (const
|
|
550
|
-
const
|
|
550
|
+
for await (const w of m) {
|
|
551
|
+
const N = `data: ${JSON.stringify(w)}
|
|
551
552
|
|
|
552
553
|
`;
|
|
553
|
-
|
|
554
|
+
j.enqueue(h.encode(N));
|
|
554
555
|
}
|
|
555
|
-
} catch (
|
|
556
|
-
const
|
|
556
|
+
} catch (m) {
|
|
557
|
+
const w = {
|
|
557
558
|
type: "error",
|
|
558
|
-
data: { message:
|
|
559
|
+
data: { message: m instanceof Error ? m.message : "Stream failed" }
|
|
559
560
|
};
|
|
560
|
-
|
|
561
|
+
j.enqueue(h.encode(`data: ${JSON.stringify(w)}
|
|
561
562
|
|
|
562
563
|
`));
|
|
563
564
|
} finally {
|
|
564
|
-
|
|
565
|
+
j.close();
|
|
565
566
|
}
|
|
566
567
|
}
|
|
567
|
-
}),
|
|
568
|
+
}), x = new Headers({
|
|
568
569
|
"Content-Type": "text/event-stream",
|
|
569
570
|
"Cache-Control": "no-cache",
|
|
570
571
|
Connection: "keep-alive"
|
|
571
572
|
});
|
|
572
573
|
if (s) {
|
|
573
|
-
const
|
|
574
|
-
Object.entries(
|
|
574
|
+
const j = g(r, s);
|
|
575
|
+
Object.entries(j).forEach(([m, w]) => x.set(m, w));
|
|
575
576
|
}
|
|
576
|
-
return new Response(
|
|
577
|
+
return new Response(S, { status: 200, headers: x });
|
|
577
578
|
} catch (u) {
|
|
578
579
|
return process.env.NODE_ENV !== "test" && console.error("Next.js agent chat handler error:", u), t.json(
|
|
579
580
|
{ error: u instanceof Error ? u.message : "Agent chat failed" },
|
package/dist/client/charts.js
CHANGED
|
@@ -1,17 +1,17 @@
|
|
|
1
|
-
import { L as
|
|
1
|
+
import { L as D, g as L, c as P, b as T, i as O, p as S, a as N } from "./chunks/charts-loader-AW3T1nv5.js";
|
|
2
2
|
import { useState as f, useEffect as c } from "react";
|
|
3
3
|
import { f as B } from "./chunks/index-CApFCBF9.js";
|
|
4
|
-
import { c as M, C as E, N as H, P as I } from "./chunks/charts-core-
|
|
5
|
-
import { B as _ } from "./chunks/chart-bar-
|
|
6
|
-
import { L as j } from "./chunks/chart-line-
|
|
7
|
-
import { default as U } from "./chunks/chart-area-
|
|
8
|
-
import { default as Y } from "./chunks/chart-pie-
|
|
9
|
-
import { default as $ } from "./chunks/chart-scatter-
|
|
10
|
-
import { default as J } from "./chunks/chart-radar-
|
|
11
|
-
import { default as Q } from "./chunks/chart-radial-bar-
|
|
12
|
-
import { default as
|
|
13
|
-
import { default as
|
|
14
|
-
import { D as
|
|
4
|
+
import { c as M, C as E, N as H, P as I } from "./chunks/charts-core-CU9u_HtL.js";
|
|
5
|
+
import { B as _ } from "./chunks/chart-bar-dj14frMt.js";
|
|
6
|
+
import { L as j } from "./chunks/chart-line-DzyZkugh.js";
|
|
7
|
+
import { default as U } from "./chunks/chart-area-ByJQ7NZd.js";
|
|
8
|
+
import { default as Y } from "./chunks/chart-pie-akbfRfb9.js";
|
|
9
|
+
import { default as $ } from "./chunks/chart-scatter-l_yTVxF3.js";
|
|
10
|
+
import { default as J } from "./chunks/chart-radar-BaN-Kjww.js";
|
|
11
|
+
import { default as Q } from "./chunks/chart-radial-bar-DpptEL3s.js";
|
|
12
|
+
import { default as ee } from "./chunks/chart-tree-map-CBbiaBXV.js";
|
|
13
|
+
import { default as ae } from "./chunks/chart-funnel-dofnhD24.js";
|
|
14
|
+
import { D as oe } from "./chunks/chart-data-table-D5G8nMnb.js";
|
|
15
15
|
const s = {
|
|
16
16
|
dropZones: [
|
|
17
17
|
{
|
|
@@ -40,7 +40,7 @@ const s = {
|
|
|
40
40
|
}
|
|
41
41
|
],
|
|
42
42
|
displayOptions: ["showLegend", "showGrid", "showTooltip"]
|
|
43
|
-
},
|
|
43
|
+
}, p = {
|
|
44
44
|
bar: () => import("./chunks/chart-config-bar-C8uzktxl.js"),
|
|
45
45
|
line: () => import("./chunks/chart-config-line-JNagi9tf.js"),
|
|
46
46
|
area: () => import("./chunks/chart-config-area-CK_GVApT.js"),
|
|
@@ -62,8 +62,12 @@ const s = {
|
|
|
62
62
|
heatmap: () => import("./chunks/chart-config-heat-map-_wEnTnRA.js"),
|
|
63
63
|
retentionHeatmap: () => import("./chunks/RetentionHeatmap.config-BWf_-vdj.js"),
|
|
64
64
|
retentionCombined: () => import("./chunks/RetentionCombinedChart.config-Bbp2ghim.js"),
|
|
65
|
-
boxPlot: () => import("./chunks/chart-config-box-plot-
|
|
66
|
-
|
|
65
|
+
boxPlot: () => import("./chunks/chart-config-box-plot-D_E_SSc2.js"),
|
|
66
|
+
waterfall: () => import("./chunks/chart-config-waterfall-DTyXV_fo.js"),
|
|
67
|
+
candlestick: () => import("./chunks/chart-config-candlestick-CRCpD43-.js"),
|
|
68
|
+
measureProfile: () => import("./chunks/chart-config-measure-profile-ZYaMrtws.js"),
|
|
69
|
+
gauge: () => import("./chunks/chart-config-gauge-CQx9w3d4.js")
|
|
70
|
+
}, u = {
|
|
67
71
|
bar: "barChartConfig",
|
|
68
72
|
line: "lineChartConfig",
|
|
69
73
|
area: "areaChartConfig",
|
|
@@ -85,58 +89,62 @@ const s = {
|
|
|
85
89
|
heatmap: "heatmapChartConfig",
|
|
86
90
|
retentionHeatmap: "retentionHeatmapConfig",
|
|
87
91
|
retentionCombined: "retentionCombinedConfig",
|
|
88
|
-
boxPlot: "boxPlotChartConfig"
|
|
92
|
+
boxPlot: "boxPlotChartConfig",
|
|
93
|
+
waterfall: "waterfallChartConfig",
|
|
94
|
+
candlestick: "candlestickChartConfig",
|
|
95
|
+
measureProfile: "measureProfileChartConfig",
|
|
96
|
+
gauge: "gaugeChartConfig"
|
|
89
97
|
}, a = /* @__PURE__ */ new Map();
|
|
90
|
-
async function
|
|
91
|
-
if (a.has(
|
|
92
|
-
return a.get(
|
|
93
|
-
const r =
|
|
98
|
+
async function l(e) {
|
|
99
|
+
if (a.has(e))
|
|
100
|
+
return a.get(e);
|
|
101
|
+
const r = p[e];
|
|
94
102
|
if (!r)
|
|
95
103
|
return null;
|
|
96
104
|
try {
|
|
97
|
-
const
|
|
98
|
-
return i ? (a.set(
|
|
99
|
-
} catch (
|
|
100
|
-
return console.error(`Failed to load config for chart type: ${
|
|
105
|
+
const t = await r(), o = u[e], i = t[o];
|
|
106
|
+
return i ? (a.set(e, i), i) : null;
|
|
107
|
+
} catch (t) {
|
|
108
|
+
return console.error(`Failed to load config for chart type: ${e}`, t), null;
|
|
101
109
|
}
|
|
102
110
|
}
|
|
103
|
-
function
|
|
104
|
-
return a.get(
|
|
111
|
+
function d(e) {
|
|
112
|
+
return a.get(e) || s;
|
|
105
113
|
}
|
|
106
|
-
function b(
|
|
107
|
-
return a.has(
|
|
114
|
+
function b(e) {
|
|
115
|
+
return a.has(e);
|
|
108
116
|
}
|
|
109
|
-
function x(
|
|
110
|
-
const [r,
|
|
111
|
-
|
|
117
|
+
function x(e) {
|
|
118
|
+
const [r, t] = f(
|
|
119
|
+
e ? d(e) : s
|
|
112
120
|
), [o, i] = f(!1), [C, n] = f(!1);
|
|
113
121
|
return c(() => {
|
|
114
|
-
if (!
|
|
115
|
-
|
|
122
|
+
if (!e) {
|
|
123
|
+
t(s), n(!1);
|
|
116
124
|
return;
|
|
117
125
|
}
|
|
118
|
-
if (a.has(
|
|
119
|
-
|
|
126
|
+
if (a.has(e)) {
|
|
127
|
+
t(a.get(e)), n(!0);
|
|
120
128
|
return;
|
|
121
129
|
}
|
|
122
|
-
i(!0),
|
|
123
|
-
m ? (
|
|
130
|
+
i(!0), l(e).then((m) => {
|
|
131
|
+
m ? (t(m), n(!0)) : (t(s), n(!0));
|
|
124
132
|
}).finally(() => i(!1));
|
|
125
|
-
}, [
|
|
133
|
+
}, [e]), { config: r, loading: o, loaded: C };
|
|
126
134
|
}
|
|
127
|
-
async function
|
|
128
|
-
a.has(
|
|
135
|
+
async function g(e) {
|
|
136
|
+
a.has(e) || await l(e);
|
|
129
137
|
}
|
|
130
|
-
async function y(
|
|
131
|
-
await Promise.all(
|
|
138
|
+
async function y(e) {
|
|
139
|
+
await Promise.all(e.map(g));
|
|
132
140
|
}
|
|
133
141
|
async function k() {
|
|
134
|
-
const
|
|
135
|
-
await Promise.all(
|
|
142
|
+
const e = Object.keys(p);
|
|
143
|
+
await Promise.all(e.map(l));
|
|
136
144
|
const r = {};
|
|
137
|
-
for (const
|
|
138
|
-
const o = a.get(
|
|
139
|
-
o && (r[
|
|
145
|
+
for (const t of e) {
|
|
146
|
+
const o = a.get(t);
|
|
147
|
+
o && (r[t] = o);
|
|
140
148
|
}
|
|
141
149
|
return r;
|
|
142
150
|
}
|
|
@@ -146,9 +154,9 @@ function R() {
|
|
|
146
154
|
export {
|
|
147
155
|
M as CHART_COLORS,
|
|
148
156
|
E as CHART_MARGINS,
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
157
|
+
oe as DataTable,
|
|
158
|
+
ae as FunnelChart,
|
|
159
|
+
D as LazyChart,
|
|
152
160
|
H as NEGATIVE_COLOR,
|
|
153
161
|
I as POSITIVE_COLOR,
|
|
154
162
|
U as RechartsAreaChart,
|
|
@@ -158,21 +166,21 @@ export {
|
|
|
158
166
|
J as RechartsRadarChart,
|
|
159
167
|
Q as RechartsRadialBarChart,
|
|
160
168
|
$ as RechartsScatterChart,
|
|
161
|
-
|
|
169
|
+
ee as RechartsTreeMapChart,
|
|
162
170
|
R as clearChartConfigCache,
|
|
163
171
|
B as formatChartData,
|
|
164
172
|
L as getAvailableChartTypes,
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
173
|
+
l as getChartConfigAsync,
|
|
174
|
+
d as getChartConfigSync,
|
|
175
|
+
P as getUnavailableChartTypes,
|
|
168
176
|
b as isChartConfigLoaded,
|
|
169
|
-
|
|
170
|
-
|
|
177
|
+
T as isChartTypeAvailable,
|
|
178
|
+
O as isValidChartType,
|
|
171
179
|
k as loadAllChartConfigs,
|
|
172
|
-
|
|
173
|
-
|
|
180
|
+
S as preloadChart,
|
|
181
|
+
g as preloadChartConfig,
|
|
174
182
|
y as preloadChartConfigs,
|
|
175
|
-
|
|
183
|
+
N as preloadCharts,
|
|
176
184
|
x as useChartConfig
|
|
177
185
|
};
|
|
178
186
|
//# sourceMappingURL=charts.js.map
|