@sisense/mcp-server 0.2.2 → 0.2.4
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/{ai-hspmgr2c.js → ai-qt2rw4p0.js} +999 -959
- package/dist/{index-29n08mw7.js → index-0rmh0qta.js} +5 -5
- package/dist/{index-er0yspcy.js → index-6vz3bc2n.js} +552 -385
- package/dist/{index-vx54d05h.js → index-7ztxzw1b.js} +9 -9
- package/dist/{index-tqba2rwh.js → index-86j7fyp7.js} +406 -245
- package/dist/{index-p1pxtmwn.js → index-bgbnagw5.js} +18 -20
- package/dist/{index-d6843g0v.js → index-jatbeegy.js} +9 -7
- package/dist/{index-dxfb3krz.js → index-jgdfekw7.js} +375 -539
- package/dist/{index-qdth51hx.js → index-k71wsmah.js} +8 -1
- package/dist/{index-atgbxy7h.js → index-mxkgxy04.js} +28981 -27209
- package/dist/{index-vrapm0b4.js → index-p5hr1cfd.js} +458 -331
- package/dist/{index-dcrjg3fk.js → index-z44fq2x1.js} +3 -2
- package/dist/sse-server-0d83pnkk.js +54 -0
- package/dist/{sse-server-brx9qtyd.js → sse-server-22mq7fhc.js} +880 -757
- package/dist/{sse-server-3e0efmg2.js → sse-server-d3yx2z0r.js} +1845 -1825
- package/dist/{sse-server-4jjec4fz.js → sse-server-gcjj2741.js} +2081 -1695
- package/dist/{sse-server-rr3dp62e.js → sse-server-kpkj0hbc.js} +22749 -22399
- package/dist/{sse-server-36t17nga.js → sse-server-qhqncg7f.js} +3555 -3657
- package/dist/{sse-server-txz5g5t0.js → sse-server-rrtgkg21.js} +414 -177
- package/dist/{sse-server-nwjjjz6x.js → sse-server-wb2h6nz7.js} +3 -52
- package/dist/{sse-server-qj4zxq0f.js → sse-server-zmcz2c17.js} +12 -24
- package/dist/sse-server.js +96 -52
- package/dist/view.html +609 -544
- package/dist/{widget-renderer-66ws3xtk.js → widget-renderer-wjrpnwpy.js} +12 -12
- package/package.json +4 -4
- package/dist/sse-server-4b60tg0c.js +0 -136
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import {
|
|
2
2
|
require_dist_cjs as require_dist_cjs2
|
|
3
|
-
} from "./sse-server-
|
|
3
|
+
} from "./sse-server-zmcz2c17.js";
|
|
4
4
|
import {
|
|
5
5
|
require_dist_cjs
|
|
6
6
|
} from "./sse-server-3343e7xh.js";
|
|
@@ -8,57 +8,8 @@ import {
|
|
|
8
8
|
__commonJS
|
|
9
9
|
} from "./sse-server-7wcvyxyj.js";
|
|
10
10
|
|
|
11
|
-
// node_modules/@smithy/querystring-parser/dist-cjs/index.js
|
|
12
|
-
var require_dist_cjs3 = __commonJS((exports) => {
|
|
13
|
-
function parseQueryString(querystring) {
|
|
14
|
-
const query = {};
|
|
15
|
-
querystring = querystring.replace(/^\?/, "");
|
|
16
|
-
if (querystring) {
|
|
17
|
-
for (const pair of querystring.split("&")) {
|
|
18
|
-
let [key, value = null] = pair.split("=");
|
|
19
|
-
key = decodeURIComponent(key);
|
|
20
|
-
if (value) {
|
|
21
|
-
value = decodeURIComponent(value);
|
|
22
|
-
}
|
|
23
|
-
if (!(key in query)) {
|
|
24
|
-
query[key] = value;
|
|
25
|
-
} else if (Array.isArray(query[key])) {
|
|
26
|
-
query[key].push(value);
|
|
27
|
-
} else {
|
|
28
|
-
query[key] = [query[key], value];
|
|
29
|
-
}
|
|
30
|
-
}
|
|
31
|
-
}
|
|
32
|
-
return query;
|
|
33
|
-
}
|
|
34
|
-
exports.parseQueryString = parseQueryString;
|
|
35
|
-
});
|
|
36
|
-
|
|
37
|
-
// node_modules/@smithy/url-parser/dist-cjs/index.js
|
|
38
|
-
var require_dist_cjs4 = __commonJS((exports) => {
|
|
39
|
-
var querystringParser = require_dist_cjs3();
|
|
40
|
-
var parseUrl = (url) => {
|
|
41
|
-
if (typeof url === "string") {
|
|
42
|
-
return parseUrl(new URL(url));
|
|
43
|
-
}
|
|
44
|
-
const { hostname, pathname, port, protocol, search } = url;
|
|
45
|
-
let query;
|
|
46
|
-
if (search) {
|
|
47
|
-
query = querystringParser.parseQueryString(search);
|
|
48
|
-
}
|
|
49
|
-
return {
|
|
50
|
-
hostname,
|
|
51
|
-
port: port ? parseInt(port) : undefined,
|
|
52
|
-
protocol,
|
|
53
|
-
path: pathname,
|
|
54
|
-
query
|
|
55
|
-
};
|
|
56
|
-
};
|
|
57
|
-
exports.parseUrl = parseUrl;
|
|
58
|
-
});
|
|
59
|
-
|
|
60
11
|
// node_modules/@smithy/node-config-provider/dist-cjs/index.js
|
|
61
|
-
var
|
|
12
|
+
var require_dist_cjs3 = __commonJS((exports) => {
|
|
62
13
|
var propertyProvider = require_dist_cjs();
|
|
63
14
|
var sharedIniFileLoader = require_dist_cjs2();
|
|
64
15
|
function getSelectorName(functionString) {
|
|
@@ -110,4 +61,4 @@ var require_dist_cjs5 = __commonJS((exports) => {
|
|
|
110
61
|
exports.loadConfig = loadConfig;
|
|
111
62
|
});
|
|
112
63
|
|
|
113
|
-
export {
|
|
64
|
+
export { require_dist_cjs3 as require_dist_cjs };
|
|
@@ -224,18 +224,8 @@ var require_dist_cjs2 = __commonJS((exports) => {
|
|
|
224
224
|
getSSOTokenFromFile.tokenIntercept[id] = contents;
|
|
225
225
|
}
|
|
226
226
|
};
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
get: function() {
|
|
230
|
-
return getSSOTokenFromFile.getSSOTokenFromFile;
|
|
231
|
-
}
|
|
232
|
-
});
|
|
233
|
-
Object.defineProperty(exports, "readFile", {
|
|
234
|
-
enumerable: true,
|
|
235
|
-
get: function() {
|
|
236
|
-
return readFile.readFile;
|
|
237
|
-
}
|
|
238
|
-
});
|
|
227
|
+
exports.getSSOTokenFromFile = getSSOTokenFromFile.getSSOTokenFromFile;
|
|
228
|
+
exports.readFile = readFile.readFile;
|
|
239
229
|
exports.CONFIG_PREFIX_SEPARATOR = CONFIG_PREFIX_SEPARATOR;
|
|
240
230
|
exports.DEFAULT_PROFILE = DEFAULT_PROFILE;
|
|
241
231
|
exports.ENV_PROFILE = ENV_PROFILE;
|
|
@@ -244,23 +234,21 @@ var require_dist_cjs2 = __commonJS((exports) => {
|
|
|
244
234
|
exports.loadSharedConfigFiles = loadSharedConfigFiles;
|
|
245
235
|
exports.loadSsoSessionData = loadSsoSessionData;
|
|
246
236
|
exports.parseKnownFiles = parseKnownFiles;
|
|
237
|
+
Object.prototype.hasOwnProperty.call(getHomeDir, "__proto__") && !Object.prototype.hasOwnProperty.call(exports, "__proto__") && Object.defineProperty(exports, "__proto__", {
|
|
238
|
+
enumerable: true,
|
|
239
|
+
value: getHomeDir["__proto__"]
|
|
240
|
+
});
|
|
247
241
|
Object.keys(getHomeDir).forEach(function(k) {
|
|
248
242
|
if (k !== "default" && !Object.prototype.hasOwnProperty.call(exports, k))
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
});
|
|
243
|
+
exports[k] = getHomeDir[k];
|
|
244
|
+
});
|
|
245
|
+
Object.prototype.hasOwnProperty.call(getSSOTokenFilepath, "__proto__") && !Object.prototype.hasOwnProperty.call(exports, "__proto__") && Object.defineProperty(exports, "__proto__", {
|
|
246
|
+
enumerable: true,
|
|
247
|
+
value: getSSOTokenFilepath["__proto__"]
|
|
255
248
|
});
|
|
256
249
|
Object.keys(getSSOTokenFilepath).forEach(function(k) {
|
|
257
250
|
if (k !== "default" && !Object.prototype.hasOwnProperty.call(exports, k))
|
|
258
|
-
|
|
259
|
-
enumerable: true,
|
|
260
|
-
get: function() {
|
|
261
|
-
return getSSOTokenFilepath[k];
|
|
262
|
-
}
|
|
263
|
-
});
|
|
251
|
+
exports[k] = getSSOTokenFilepath[k];
|
|
264
252
|
});
|
|
265
253
|
});
|
|
266
254
|
|
package/dist/sse-server.js
CHANGED
|
@@ -11,22 +11,22 @@ import {
|
|
|
11
11
|
sanitizeForText,
|
|
12
12
|
validateToken,
|
|
13
13
|
validateUrl
|
|
14
|
-
} from "./sse-server-
|
|
14
|
+
} from "./sse-server-qhqncg7f.js";
|
|
15
15
|
import {
|
|
16
16
|
require_dist_cjs
|
|
17
|
-
} from "./index-
|
|
18
|
-
import"./index-
|
|
17
|
+
} from "./index-bgbnagw5.js";
|
|
18
|
+
import"./index-6vz3bc2n.js";
|
|
19
19
|
import {
|
|
20
|
-
|
|
21
|
-
} from "./sse-server-
|
|
22
|
-
import"./sse-server-
|
|
23
|
-
import"./sse-server-
|
|
24
|
-
import"./sse-server-
|
|
25
|
-
import"./sse-server-
|
|
26
|
-
import"./sse-server-
|
|
27
|
-
import"./sse-server-txz5g5t0.js";
|
|
20
|
+
Ps
|
|
21
|
+
} from "./sse-server-22mq7fhc.js";
|
|
22
|
+
import"./sse-server-d3yx2z0r.js";
|
|
23
|
+
import"./sse-server-gcjj2741.js";
|
|
24
|
+
import"./sse-server-wb2h6nz7.js";
|
|
25
|
+
import"./sse-server-zmcz2c17.js";
|
|
26
|
+
import"./sse-server-rrtgkg21.js";
|
|
28
27
|
import"./sse-server-epd916s3.js";
|
|
29
28
|
import"./sse-server-5tmgacdx.js";
|
|
29
|
+
import"./sse-server-0d83pnkk.js";
|
|
30
30
|
import"./sse-server-4g9za0qq.js";
|
|
31
31
|
import"./index-g8bgq79c.js";
|
|
32
32
|
import"./sse-server-mkesh468.js";
|
|
@@ -4580,6 +4580,7 @@ var require_limitLength = __commonJS((exports) => {
|
|
|
4580
4580
|
var require_pattern = __commonJS((exports) => {
|
|
4581
4581
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4582
4582
|
var code_1 = require_code2();
|
|
4583
|
+
var util_1 = require_util();
|
|
4583
4584
|
var codegen_1 = require_codegen();
|
|
4584
4585
|
var error2 = {
|
|
4585
4586
|
message: ({ schemaCode }) => (0, codegen_1.str)`must match pattern "${schemaCode}"`,
|
|
@@ -4592,10 +4593,18 @@ var require_pattern = __commonJS((exports) => {
|
|
|
4592
4593
|
$data: true,
|
|
4593
4594
|
error: error2,
|
|
4594
4595
|
code(cxt) {
|
|
4595
|
-
const { data, $data, schema, schemaCode, it: it2 } = cxt;
|
|
4596
|
+
const { gen, data, $data, schema, schemaCode, it: it2 } = cxt;
|
|
4596
4597
|
const u = it2.opts.unicodeRegExp ? "u" : "";
|
|
4597
|
-
|
|
4598
|
-
|
|
4598
|
+
if ($data) {
|
|
4599
|
+
const { regExp } = it2.opts.code;
|
|
4600
|
+
const regExpCode = regExp.code === "new RegExp" ? (0, codegen_1._)`new RegExp` : (0, util_1.useFunc)(gen, regExp);
|
|
4601
|
+
const valid = gen.let("valid");
|
|
4602
|
+
gen.try(() => gen.assign(valid, (0, codegen_1._)`${regExpCode}(${schemaCode}, ${u}).test(${data})`), () => gen.assign(valid, false));
|
|
4603
|
+
cxt.fail$data((0, codegen_1._)`!${valid}`);
|
|
4604
|
+
} else {
|
|
4605
|
+
const regExp = (0, code_1.usePattern)(cxt, schema);
|
|
4606
|
+
cxt.fail$data((0, codegen_1._)`!${regExp}.test(${data})`);
|
|
4607
|
+
}
|
|
4599
4608
|
}
|
|
4600
4609
|
};
|
|
4601
4610
|
exports.default = def;
|
|
@@ -10213,6 +10222,7 @@ var require_limitLength2 = __commonJS((exports) => {
|
|
|
10213
10222
|
var require_pattern2 = __commonJS((exports) => {
|
|
10214
10223
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
10215
10224
|
var code_1 = require_code4();
|
|
10225
|
+
var util_1 = require_util2();
|
|
10216
10226
|
var codegen_1 = require_codegen2();
|
|
10217
10227
|
var error2 = {
|
|
10218
10228
|
message: ({ schemaCode }) => (0, codegen_1.str)`must match pattern "${schemaCode}"`,
|
|
@@ -10225,10 +10235,18 @@ var require_pattern2 = __commonJS((exports) => {
|
|
|
10225
10235
|
$data: true,
|
|
10226
10236
|
error: error2,
|
|
10227
10237
|
code(cxt) {
|
|
10228
|
-
const { data, $data, schema, schemaCode, it: it2 } = cxt;
|
|
10238
|
+
const { gen, data, $data, schema, schemaCode, it: it2 } = cxt;
|
|
10229
10239
|
const u = it2.opts.unicodeRegExp ? "u" : "";
|
|
10230
|
-
|
|
10231
|
-
|
|
10240
|
+
if ($data) {
|
|
10241
|
+
const { regExp } = it2.opts.code;
|
|
10242
|
+
const regExpCode = regExp.code === "new RegExp" ? (0, codegen_1._)`new RegExp` : (0, util_1.useFunc)(gen, regExp);
|
|
10243
|
+
const valid = gen.let("valid");
|
|
10244
|
+
gen.try(() => gen.assign(valid, (0, codegen_1._)`${regExpCode}(${schemaCode}, ${u}).test(${data})`), () => gen.assign(valid, false));
|
|
10245
|
+
cxt.fail$data((0, codegen_1._)`!${valid}`);
|
|
10246
|
+
} else {
|
|
10247
|
+
const regExp = (0, code_1.usePattern)(cxt, schema);
|
|
10248
|
+
cxt.fail$data((0, codegen_1._)`!${regExp}.test(${data})`);
|
|
10249
|
+
}
|
|
10232
10250
|
}
|
|
10233
10251
|
};
|
|
10234
10252
|
exports.default = def;
|
|
@@ -12169,15 +12187,14 @@ var Response2 = class _Response {
|
|
|
12169
12187
|
this.#init = init;
|
|
12170
12188
|
}
|
|
12171
12189
|
if (typeof body === "string" || typeof body?.getReader !== "undefined" || body instanceof Blob || body instanceof Uint8Array) {
|
|
12172
|
-
|
|
12173
|
-
this[cacheKey] = [init?.status || 200, body, headers];
|
|
12190
|
+
this[cacheKey] = [init?.status || 200, body, headers || init?.headers];
|
|
12174
12191
|
}
|
|
12175
12192
|
}
|
|
12176
12193
|
get headers() {
|
|
12177
12194
|
const cache = this[cacheKey];
|
|
12178
12195
|
if (cache) {
|
|
12179
12196
|
if (!(cache[2] instanceof Headers)) {
|
|
12180
|
-
cache[2] = new Headers(cache[2]);
|
|
12197
|
+
cache[2] = new Headers(cache[2] || { "content-type": "text/plain; charset=UTF-8" });
|
|
12181
12198
|
}
|
|
12182
12199
|
return cache[2];
|
|
12183
12200
|
}
|
|
@@ -12301,15 +12318,32 @@ var flushHeaders = (outgoing) => {
|
|
|
12301
12318
|
};
|
|
12302
12319
|
var responseViaCache = async (res, outgoing) => {
|
|
12303
12320
|
let [status, body, header] = res[cacheKey];
|
|
12304
|
-
|
|
12321
|
+
let hasContentLength = false;
|
|
12322
|
+
if (!header) {
|
|
12323
|
+
header = { "content-type": "text/plain; charset=UTF-8" };
|
|
12324
|
+
} else if (header instanceof Headers) {
|
|
12325
|
+
hasContentLength = header.has("content-length");
|
|
12305
12326
|
header = buildOutgoingHttpHeaders(header);
|
|
12327
|
+
} else if (Array.isArray(header)) {
|
|
12328
|
+
const headerObj = new Headers(header);
|
|
12329
|
+
hasContentLength = headerObj.has("content-length");
|
|
12330
|
+
header = buildOutgoingHttpHeaders(headerObj);
|
|
12331
|
+
} else {
|
|
12332
|
+
for (const key in header) {
|
|
12333
|
+
if (key.length === 14 && key.toLowerCase() === "content-length") {
|
|
12334
|
+
hasContentLength = true;
|
|
12335
|
+
break;
|
|
12336
|
+
}
|
|
12337
|
+
}
|
|
12306
12338
|
}
|
|
12307
|
-
if (
|
|
12308
|
-
|
|
12309
|
-
|
|
12310
|
-
|
|
12311
|
-
|
|
12312
|
-
|
|
12339
|
+
if (!hasContentLength) {
|
|
12340
|
+
if (typeof body === "string") {
|
|
12341
|
+
header["Content-Length"] = Buffer.byteLength(body);
|
|
12342
|
+
} else if (body instanceof Uint8Array) {
|
|
12343
|
+
header["Content-Length"] = body.byteLength;
|
|
12344
|
+
} else if (body instanceof Blob) {
|
|
12345
|
+
header["Content-Length"] = body.size;
|
|
12346
|
+
}
|
|
12313
12347
|
}
|
|
12314
12348
|
outgoing.writeHead(status, header);
|
|
12315
12349
|
if (typeof body === "string" || body instanceof Uint8Array) {
|
|
@@ -29646,7 +29680,12 @@ import path from "node:path";
|
|
|
29646
29680
|
import { fileURLToPath } from "node:url";
|
|
29647
29681
|
|
|
29648
29682
|
// src/tools/build-chart.ts
|
|
29649
|
-
|
|
29683
|
+
function isMcpAppEnabled() {
|
|
29684
|
+
return process.env.TOOL_CHART_BUILDER_MCP_APP_ENABLED !== "false" && process.env.TOOL_CHART_BUILDER_MCP_APP_ENABLED !== "0";
|
|
29685
|
+
}
|
|
29686
|
+
function isNarrativeEnabled() {
|
|
29687
|
+
return process.env.TOOL_CHART_BUILDER_NARRATIVE_ENABLED !== "false" && process.env.TOOL_CHART_BUILDER_NARRATIVE_ENABLED !== "0";
|
|
29688
|
+
}
|
|
29650
29689
|
var baseOutputSchema = exports_external.object({
|
|
29651
29690
|
success: exports_external.boolean(),
|
|
29652
29691
|
chartId: exports_external.string().optional(),
|
|
@@ -29658,7 +29697,7 @@ var buildChartOutputSchemaToolMode = baseOutputSchema.extend({
|
|
|
29658
29697
|
imageUrl: exports_external.string().optional()
|
|
29659
29698
|
});
|
|
29660
29699
|
function getBuildChartOutputSchema() {
|
|
29661
|
-
return
|
|
29700
|
+
return isMcpAppEnabled() ? buildChartOutputSchemaAppMode : buildChartOutputSchemaToolMode;
|
|
29662
29701
|
}
|
|
29663
29702
|
function getChartSummaries(sessionState) {
|
|
29664
29703
|
return sessionState?.get("chart:summaries") ?? [];
|
|
@@ -29673,8 +29712,8 @@ async function buildChart(args, sessionState, requestId) {
|
|
|
29673
29712
|
const { dataSourceTitle, userPrompt } = args;
|
|
29674
29713
|
const toolCallId = String(requestId ? `chart-${requestId}` : `chart-${Date.now()}`);
|
|
29675
29714
|
const result = await csdkBrowserMock.withBrowserEnvironment(async () => {
|
|
29676
|
-
const { buildChartEngine } = await import("./index-
|
|
29677
|
-
const { renderChartWidget } = await import("./widget-renderer-
|
|
29715
|
+
const { buildChartEngine } = await import("./index-mxkgxy04.js");
|
|
29716
|
+
const { renderChartWidget } = await import("./widget-renderer-wjrpnwpy.js");
|
|
29678
29717
|
const buildChartContext = {
|
|
29679
29718
|
toolCallId,
|
|
29680
29719
|
dataSourceTitle,
|
|
@@ -29700,9 +29739,10 @@ async function buildChart(args, sessionState, requestId) {
|
|
|
29700
29739
|
if (!baseUrl) {
|
|
29701
29740
|
throw new Error("Base URL not found in session.");
|
|
29702
29741
|
}
|
|
29703
|
-
const
|
|
29704
|
-
const
|
|
29705
|
-
const
|
|
29742
|
+
const narrativeEnabled = isNarrativeEnabled();
|
|
29743
|
+
const { getNlgInsightsFromWidget } = await import("./ai-qt2rw4p0.js");
|
|
29744
|
+
const insightsPromise = narrativeEnabled && httpClient ? getNlgInsightsFromWidget(savedProps, httpClient, { verbosity: "High" }) : Promise.resolve(undefined);
|
|
29745
|
+
const renderPromise = isMcpAppEnabled() ? Promise.resolve(null) : renderChartWidget({
|
|
29706
29746
|
widgetProps: savedProps,
|
|
29707
29747
|
sisenseUrl: sisenseUrl2,
|
|
29708
29748
|
sisenseToken: sisenseToken2,
|
|
@@ -29720,9 +29760,9 @@ async function buildChart(args, sessionState, requestId) {
|
|
|
29720
29760
|
console.warn("Failed to generate NLG insights:", sanitized.message);
|
|
29721
29761
|
}
|
|
29722
29762
|
let imageUrl2;
|
|
29723
|
-
if (!
|
|
29763
|
+
if (!isMcpAppEnabled() && renderResult.status === "fulfilled" && renderResult.value) {
|
|
29724
29764
|
imageUrl2 = renderResult.value.content[0]?.text;
|
|
29725
|
-
} else if (!
|
|
29765
|
+
} else if (!isMcpAppEnabled() && renderResult.status === "rejected") {
|
|
29726
29766
|
const sanitized = sanitizeError(renderResult.reason);
|
|
29727
29767
|
console.warn("Failed to render chart widget:", sanitized.message);
|
|
29728
29768
|
}
|
|
@@ -29732,7 +29772,7 @@ async function buildChart(args, sessionState, requestId) {
|
|
|
29732
29772
|
insights: insights2,
|
|
29733
29773
|
sisenseUrl: sisenseUrl2,
|
|
29734
29774
|
sisenseToken: sisenseToken2,
|
|
29735
|
-
serializedWidgetProps:
|
|
29775
|
+
serializedWidgetProps: Ps.serialize(savedProps)
|
|
29736
29776
|
};
|
|
29737
29777
|
}
|
|
29738
29778
|
console.warn("No saved props found for chartId:", chartSummary2.chartId);
|
|
@@ -29749,8 +29789,8 @@ async function buildChart(args, sessionState, requestId) {
|
|
|
29749
29789
|
success: true,
|
|
29750
29790
|
chartId: chartSummary.chartId,
|
|
29751
29791
|
message: chartSummary.message || `Chart created successfully for query: "${userPrompt}"`,
|
|
29752
|
-
insights,
|
|
29753
|
-
...
|
|
29792
|
+
...isNarrativeEnabled() && insights != null ? { insights } : {},
|
|
29793
|
+
...isMcpAppEnabled() ? {} : { imageUrl }
|
|
29754
29794
|
};
|
|
29755
29795
|
const finalOutput = {
|
|
29756
29796
|
content: [
|
|
@@ -29760,11 +29800,13 @@ async function buildChart(args, sessionState, requestId) {
|
|
|
29760
29800
|
}
|
|
29761
29801
|
],
|
|
29762
29802
|
structuredContent: output,
|
|
29763
|
-
|
|
29764
|
-
|
|
29765
|
-
|
|
29766
|
-
|
|
29767
|
-
|
|
29803
|
+
...isMcpAppEnabled() ? {
|
|
29804
|
+
_meta: {
|
|
29805
|
+
sisenseUrl,
|
|
29806
|
+
sisenseToken,
|
|
29807
|
+
serializedWidgetProps
|
|
29808
|
+
}
|
|
29809
|
+
} : {}
|
|
29768
29810
|
};
|
|
29769
29811
|
return finalOutput;
|
|
29770
29812
|
} catch (error2) {
|
|
@@ -29773,8 +29815,8 @@ async function buildChart(args, sessionState, requestId) {
|
|
|
29773
29815
|
success: false,
|
|
29774
29816
|
chartId: undefined,
|
|
29775
29817
|
message: `Failed to create chart: ${errorMessage}`,
|
|
29776
|
-
insights: undefined,
|
|
29777
|
-
...
|
|
29818
|
+
...isNarrativeEnabled() ? { insights: undefined } : {},
|
|
29819
|
+
...isMcpAppEnabled() ? {} : { imageUrl: undefined }
|
|
29778
29820
|
};
|
|
29779
29821
|
return {
|
|
29780
29822
|
content: [
|
|
@@ -29795,7 +29837,7 @@ var getDataSourcesOutputSchema = {
|
|
|
29795
29837
|
};
|
|
29796
29838
|
async function getDataSources(_args, sessionState) {
|
|
29797
29839
|
try {
|
|
29798
|
-
const { getDataSourcesEngine } = await import("./index-
|
|
29840
|
+
const { getDataSourcesEngine } = await import("./index-mxkgxy04.js");
|
|
29799
29841
|
const getDataSourcesContext = {
|
|
29800
29842
|
toolCallId: "get-data-sources",
|
|
29801
29843
|
httpClient: sessionState?.get("httpClient")
|
|
@@ -29838,7 +29880,7 @@ var getDataSourceFieldsOutputSchema = {
|
|
|
29838
29880
|
async function getDataSourceFields(args, sessionState) {
|
|
29839
29881
|
const { dataSourceTitle } = args;
|
|
29840
29882
|
try {
|
|
29841
|
-
const { getDataSourceFieldsEngine } = await import("./index-
|
|
29883
|
+
const { getDataSourceFieldsEngine } = await import("./index-mxkgxy04.js");
|
|
29842
29884
|
const getDataSourceFieldsContext = {
|
|
29843
29885
|
toolCallId: "get-data-source-fields",
|
|
29844
29886
|
httpClient: sessionState?.get("httpClient")
|
|
@@ -30107,7 +30149,9 @@ var __dirname2 = path.dirname(fileURLToPath(import.meta.url));
|
|
|
30107
30149
|
var isSource = import.meta.url.endsWith(".ts");
|
|
30108
30150
|
var DIST_DIR = isSource ? path.join(__dirname2, "..", "dist") : __dirname2;
|
|
30109
30151
|
var ANALYTICS_RESOURCE_URI = "ui://sisense-analytics/view.html";
|
|
30110
|
-
|
|
30152
|
+
function isMcpAppEnabled2() {
|
|
30153
|
+
return process.env.TOOL_CHART_BUILDER_MCP_APP_ENABLED !== "false" && process.env.TOOL_CHART_BUILDER_MCP_APP_ENABLED !== "0";
|
|
30154
|
+
}
|
|
30111
30155
|
function getCspMeta(sessionState) {
|
|
30112
30156
|
const sisenseUrl = sessionState?.get("sisenseUrl")?.trim() ?? process.env.SISENSE_URL?.trim();
|
|
30113
30157
|
const connectDomains = sisenseUrl ? [sisenseUrl] : [];
|
|
@@ -30133,7 +30177,7 @@ async function setupMcpServer(sessionState) {
|
|
|
30133
30177
|
getDataSourcesSchema,
|
|
30134
30178
|
getDataSourceFieldsSchema,
|
|
30135
30179
|
buildChartSchema
|
|
30136
|
-
} = await import("./index-
|
|
30180
|
+
} = await import("./index-mxkgxy04.js");
|
|
30137
30181
|
const server = new McpServer({
|
|
30138
30182
|
name: "sisense-mcp-server",
|
|
30139
30183
|
version: "1.0.0"
|
|
@@ -30157,7 +30201,7 @@ async function setupMcpServer(sessionState) {
|
|
|
30157
30201
|
return await getDataSourceFields(args, sessionState);
|
|
30158
30202
|
});
|
|
30159
30203
|
const buildChartOutputSchema = getBuildChartOutputSchema();
|
|
30160
|
-
if (
|
|
30204
|
+
if (isMcpAppEnabled2()) {
|
|
30161
30205
|
hk(server, TOOL_NAME_CHART_BUILDER, {
|
|
30162
30206
|
title: "Build Sisense Chart from User Prompt",
|
|
30163
30207
|
description: "Build a chart from a Sisense data source using natural language user prompt. Chart type will be automatically determined by Sisense AI based on the user prompt.",
|
|
@@ -30326,7 +30370,7 @@ var server = createServer(async (req, res) => {
|
|
|
30326
30370
|
createOpenAIClient,
|
|
30327
30371
|
initializeHttpClient,
|
|
30328
30372
|
initializeOpenAIClient
|
|
30329
|
-
} = await import("./index-
|
|
30373
|
+
} = await import("./index-mxkgxy04.js");
|
|
30330
30374
|
const httpClient = createHttpClientFromConfig({
|
|
30331
30375
|
url: validatedUrl,
|
|
30332
30376
|
token: validatedToken
|