@sisense/mcp-server 0.2.1 → 0.2.3

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.
Files changed (26) hide show
  1. package/dist/{ai-hspmgr2c.js → ai-qt2rw4p0.js} +999 -959
  2. package/dist/{index-29n08mw7.js → index-0rmh0qta.js} +5 -5
  3. package/dist/{index-er0yspcy.js → index-6vz3bc2n.js} +552 -385
  4. package/dist/{index-vx54d05h.js → index-7ztxzw1b.js} +9 -9
  5. package/dist/{index-tqba2rwh.js → index-86j7fyp7.js} +406 -245
  6. package/dist/{index-p1pxtmwn.js → index-bgbnagw5.js} +18 -20
  7. package/dist/{index-d6843g0v.js → index-jatbeegy.js} +9 -7
  8. package/dist/{index-dxfb3krz.js → index-jgdfekw7.js} +375 -539
  9. package/dist/{index-qdth51hx.js → index-k71wsmah.js} +8 -1
  10. package/dist/{index-atgbxy7h.js → index-mxkgxy04.js} +28981 -27209
  11. package/dist/{index-vrapm0b4.js → index-p5hr1cfd.js} +458 -331
  12. package/dist/{index-dcrjg3fk.js → index-z44fq2x1.js} +3 -2
  13. package/dist/sse-server-0d83pnkk.js +54 -0
  14. package/dist/{sse-server-brx9qtyd.js → sse-server-22mq7fhc.js} +880 -757
  15. package/dist/{sse-server-3e0efmg2.js → sse-server-d3yx2z0r.js} +1845 -1825
  16. package/dist/{sse-server-4jjec4fz.js → sse-server-gcjj2741.js} +2081 -1695
  17. package/dist/{sse-server-rr3dp62e.js → sse-server-kpkj0hbc.js} +22749 -22399
  18. package/dist/{sse-server-36t17nga.js → sse-server-qhqncg7f.js} +3555 -3657
  19. package/dist/{sse-server-txz5g5t0.js → sse-server-rrtgkg21.js} +414 -177
  20. package/dist/{sse-server-nwjjjz6x.js → sse-server-wb2h6nz7.js} +3 -52
  21. package/dist/{sse-server-qj4zxq0f.js → sse-server-zmcz2c17.js} +12 -24
  22. package/dist/sse-server.js +69 -35
  23. package/dist/view.html +609 -544
  24. package/dist/{widget-renderer-66ws3xtk.js → widget-renderer-wjrpnwpy.js} +12 -12
  25. package/package.json +4 -4
  26. 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-qj4zxq0f.js";
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 require_dist_cjs5 = __commonJS((exports) => {
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 { require_dist_cjs4 as require_dist_cjs, require_dist_cjs5 as require_dist_cjs1 };
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
- Object.defineProperty(exports, "getSSOTokenFromFile", {
228
- enumerable: true,
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
- Object.defineProperty(exports, k, {
250
- enumerable: true,
251
- get: function() {
252
- return getHomeDir[k];
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
- Object.defineProperty(exports, k, {
259
- enumerable: true,
260
- get: function() {
261
- return getSSOTokenFilepath[k];
262
- }
263
- });
251
+ exports[k] = getSSOTokenFilepath[k];
264
252
  });
265
253
  });
266
254
 
@@ -11,22 +11,22 @@ import {
11
11
  sanitizeForText,
12
12
  validateToken,
13
13
  validateUrl
14
- } from "./sse-server-36t17nga.js";
14
+ } from "./sse-server-qhqncg7f.js";
15
15
  import {
16
16
  require_dist_cjs
17
- } from "./index-p1pxtmwn.js";
18
- import"./index-er0yspcy.js";
17
+ } from "./index-bgbnagw5.js";
18
+ import"./index-6vz3bc2n.js";
19
19
  import {
20
- Fs
21
- } from "./sse-server-brx9qtyd.js";
22
- import"./sse-server-3e0efmg2.js";
23
- import"./sse-server-4b60tg0c.js";
24
- import"./sse-server-4jjec4fz.js";
25
- import"./sse-server-nwjjjz6x.js";
26
- import"./sse-server-qj4zxq0f.js";
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
- const regExp = $data ? (0, codegen_1._)`(new RegExp(${schemaCode}, ${u}))` : (0, code_1.usePattern)(cxt, schema);
4598
- cxt.fail$data((0, codegen_1._)`!${regExp}.test(${data})`);
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
- const regExp = $data ? (0, codegen_1._)`(new RegExp(${schemaCode}, ${u}))` : (0, code_1.usePattern)(cxt, schema);
10231
- cxt.fail$data((0, codegen_1._)`!${regExp}.test(${data})`);
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
- headers ||= init?.headers || { "content-type": "text/plain; charset=UTF-8" };
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
- if (header instanceof Headers) {
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 (typeof body === "string") {
12308
- header["Content-Length"] = Buffer.byteLength(body);
12309
- } else if (body instanceof Uint8Array) {
12310
- header["Content-Length"] = body.byteLength;
12311
- } else if (body instanceof Blob) {
12312
- header["Content-Length"] = body.size;
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) {
@@ -29673,8 +29707,8 @@ async function buildChart(args, sessionState, requestId) {
29673
29707
  const { dataSourceTitle, userPrompt } = args;
29674
29708
  const toolCallId = String(requestId ? `chart-${requestId}` : `chart-${Date.now()}`);
29675
29709
  const result = await csdkBrowserMock.withBrowserEnvironment(async () => {
29676
- const { buildChartEngine } = await import("./index-atgbxy7h.js");
29677
- const { renderChartWidget } = await import("./widget-renderer-66ws3xtk.js");
29710
+ const { buildChartEngine } = await import("./index-mxkgxy04.js");
29711
+ const { renderChartWidget } = await import("./widget-renderer-wjrpnwpy.js");
29678
29712
  const buildChartContext = {
29679
29713
  toolCallId,
29680
29714
  dataSourceTitle,
@@ -29700,7 +29734,7 @@ async function buildChart(args, sessionState, requestId) {
29700
29734
  if (!baseUrl) {
29701
29735
  throw new Error("Base URL not found in session.");
29702
29736
  }
29703
- const { getNlgInsightsFromWidget } = await import("./ai-hspmgr2c.js");
29737
+ const { getNlgInsightsFromWidget } = await import("./ai-qt2rw4p0.js");
29704
29738
  const insightsPromise = httpClient ? getNlgInsightsFromWidget(savedProps, httpClient, { verbosity: "High" }) : Promise.reject(new Error("HttpClient not available for insights generation"));
29705
29739
  const renderPromise = MCP_APP_BUILD_CHART_ENABLED ? Promise.resolve(null) : renderChartWidget({
29706
29740
  widgetProps: savedProps,
@@ -29732,7 +29766,7 @@ async function buildChart(args, sessionState, requestId) {
29732
29766
  insights: insights2,
29733
29767
  sisenseUrl: sisenseUrl2,
29734
29768
  sisenseToken: sisenseToken2,
29735
- serializedWidgetProps: Fs.serialize(savedProps)
29769
+ serializedWidgetProps: Ps.serialize(savedProps)
29736
29770
  };
29737
29771
  }
29738
29772
  console.warn("No saved props found for chartId:", chartSummary2.chartId);
@@ -29795,7 +29829,7 @@ var getDataSourcesOutputSchema = {
29795
29829
  };
29796
29830
  async function getDataSources(_args, sessionState) {
29797
29831
  try {
29798
- const { getDataSourcesEngine } = await import("./index-atgbxy7h.js");
29832
+ const { getDataSourcesEngine } = await import("./index-mxkgxy04.js");
29799
29833
  const getDataSourcesContext = {
29800
29834
  toolCallId: "get-data-sources",
29801
29835
  httpClient: sessionState?.get("httpClient")
@@ -29838,7 +29872,7 @@ var getDataSourceFieldsOutputSchema = {
29838
29872
  async function getDataSourceFields(args, sessionState) {
29839
29873
  const { dataSourceTitle } = args;
29840
29874
  try {
29841
- const { getDataSourceFieldsEngine } = await import("./index-atgbxy7h.js");
29875
+ const { getDataSourceFieldsEngine } = await import("./index-mxkgxy04.js");
29842
29876
  const getDataSourceFieldsContext = {
29843
29877
  toolCallId: "get-data-source-fields",
29844
29878
  httpClient: sessionState?.get("httpClient")
@@ -30133,7 +30167,7 @@ async function setupMcpServer(sessionState) {
30133
30167
  getDataSourcesSchema,
30134
30168
  getDataSourceFieldsSchema,
30135
30169
  buildChartSchema
30136
- } = await import("./index-atgbxy7h.js");
30170
+ } = await import("./index-mxkgxy04.js");
30137
30171
  const server = new McpServer({
30138
30172
  name: "sisense-mcp-server",
30139
30173
  version: "1.0.0"
@@ -30326,7 +30360,7 @@ var server = createServer(async (req, res) => {
30326
30360
  createOpenAIClient,
30327
30361
  initializeHttpClient,
30328
30362
  initializeOpenAIClient
30329
- } = await import("./index-atgbxy7h.js");
30363
+ } = await import("./index-mxkgxy04.js");
30330
30364
  const httpClient = createHttpClientFromConfig({
30331
30365
  url: validatedUrl,
30332
30366
  token: validatedToken