@sisense/mcp-server 0.2.6 → 0.2.8

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.
@@ -17,9 +17,9 @@ import {
17
17
  } from "./index-bgbnagw5.js";
18
18
  import"./index-6vz3bc2n.js";
19
19
  import {
20
- Ps
21
- } from "./sse-server-22mq7fhc.js";
22
- import"./sse-server-d3yx2z0r.js";
20
+ Kn
21
+ } from "./sse-server-tg36wntb.js";
22
+ import"./sse-server-xfrv5734.js";
23
23
  import"./sse-server-gcjj2741.js";
24
24
  import"./sse-server-wb2h6nz7.js";
25
25
  import"./sse-server-zmcz2c17.js";
@@ -11978,6 +11978,7 @@ var require_dist = __commonJS((exports, module) => {
11978
11978
  // src/sse-server.ts
11979
11979
  import { createServer } from "node:http";
11980
11980
  import { createHash, randomUUID } from "node:crypto";
11981
+ import { readFileSync } from "node:fs";
11981
11982
  import { readFile as readFile2 } from "node:fs/promises";
11982
11983
  import { resolve, sep } from "node:path";
11983
11984
 
@@ -29093,8 +29094,8 @@ async function buildChart(args, sessionState, requestId) {
29093
29094
  const { dataSourceTitle, userPrompt } = args;
29094
29095
  const toolCallId = String(requestId ? `chart-${requestId}` : `chart-${Date.now()}`);
29095
29096
  const result = await csdkBrowserMock.withBrowserEnvironment(async () => {
29096
- const { buildChartEngine } = await import("./index-mxkgxy04.js");
29097
- const { renderChartWidget } = await import("./widget-renderer-wjrpnwpy.js");
29097
+ const { buildChartEngine, runWithUserAction } = await import("./index-c0zk3ctc.js");
29098
+ const { renderChartWidget } = await import("./widget-renderer-56n3m26y.js");
29098
29099
  const buildChartContext = {
29099
29100
  toolCallId,
29100
29101
  dataSourceTitle,
@@ -29105,7 +29106,7 @@ async function buildChart(args, sessionState, requestId) {
29105
29106
  httpClient: sessionState?.get("httpClient"),
29106
29107
  openAIClient: sessionState?.get("openAIClient")
29107
29108
  };
29108
- const chartSummary2 = await buildChartEngine({ dataSourceTitle, userPrompt }, buildChartContext);
29109
+ const chartSummary2 = await runWithUserAction("MCP", "ASSISTANT", () => buildChartEngine({ dataSourceTitle, userPrompt }, buildChartContext));
29109
29110
  console.info(">>> CHART SUMMARY", chartSummary2);
29110
29111
  addChartSummary(sessionState, chartSummary2);
29111
29112
  const savedProps = sessionState?.get(chartSummary2.chartId);
@@ -29121,7 +29122,7 @@ async function buildChart(args, sessionState, requestId) {
29121
29122
  throw new Error("Base URL not found in session.");
29122
29123
  }
29123
29124
  const narrativeEnabled = isNarrativeEnabled();
29124
- const { getNlgInsightsFromWidget } = await import("./ai-qt2rw4p0.js");
29125
+ const { getNlgInsightsFromWidget } = await import("./ai-3wz11tv8.js");
29125
29126
  const insightsPromise = narrativeEnabled && httpClient ? getNlgInsightsFromWidget(savedProps, httpClient, { verbosity: "High" }) : Promise.resolve(undefined);
29126
29127
  const renderPromise = isMcpAppEnabled() ? Promise.resolve(null) : renderChartWidget({
29127
29128
  widgetProps: savedProps,
@@ -29153,7 +29154,7 @@ async function buildChart(args, sessionState, requestId) {
29153
29154
  insights: insights2,
29154
29155
  sisenseUrl: sisenseUrl2,
29155
29156
  sisenseToken: sisenseToken2,
29156
- serializedWidgetProps: Ps.serialize(savedProps)
29157
+ serializedWidgetProps: Kn.serialize(savedProps)
29157
29158
  };
29158
29159
  }
29159
29160
  console.warn("No saved props found for chartId:", chartSummary2.chartId);
@@ -29218,7 +29219,7 @@ var getDataSourcesOutputSchema = {
29218
29219
  };
29219
29220
  async function getDataSources(_args, sessionState) {
29220
29221
  try {
29221
- const { getDataSourcesEngine } = await import("./index-mxkgxy04.js");
29222
+ const { getDataSourcesEngine } = await import("./index-c0zk3ctc.js");
29222
29223
  const getDataSourcesContext = {
29223
29224
  toolCallId: "get-data-sources",
29224
29225
  httpClient: sessionState?.get("httpClient")
@@ -29261,7 +29262,7 @@ var getDataSourceFieldsOutputSchema = {
29261
29262
  async function getDataSourceFields(args, sessionState) {
29262
29263
  const { dataSourceTitle } = args;
29263
29264
  try {
29264
- const { getDataSourceFieldsEngine } = await import("./index-mxkgxy04.js");
29265
+ const { getDataSourceFieldsEngine } = await import("./index-c0zk3ctc.js");
29265
29266
  const getDataSourceFieldsContext = {
29266
29267
  toolCallId: "get-data-source-fields",
29267
29268
  httpClient: sessionState?.get("httpClient")
@@ -29558,7 +29559,7 @@ async function setupMcpServer(sessionState) {
29558
29559
  getDataSourcesSchema,
29559
29560
  getDataSourceFieldsSchema,
29560
29561
  buildChartSchema
29561
- } = await import("./index-mxkgxy04.js");
29562
+ } = await import("./index-c0zk3ctc.js");
29562
29563
  const server = new McpServer({
29563
29564
  name: "sisense-mcp-server",
29564
29565
  version: "1.0.0"
@@ -29625,6 +29626,7 @@ async function setupMcpServer(sessionState) {
29625
29626
  }
29626
29627
 
29627
29628
  // src/sse-server.ts
29629
+ var PACKAGE_VERSION = JSON.parse(readFileSync(new URL("../package.json", import.meta.url), "utf-8")).version;
29628
29630
  function createS3Client() {
29629
29631
  if (!process.env.SCREENSHOTS_BUCKET) {
29630
29632
  return null;
@@ -29648,6 +29650,7 @@ var server = createServer(async (req, res) => {
29648
29650
  res.writeHead(200, { "Content-Type": "application/json" });
29649
29651
  res.end(JSON.stringify({
29650
29652
  status: "ok",
29653
+ version: PACKAGE_VERSION,
29651
29654
  activeSessions: sessions.size
29652
29655
  }));
29653
29656
  return;
@@ -29655,6 +29658,11 @@ var server = createServer(async (req, res) => {
29655
29658
  if (url2.pathname.startsWith("/screenshots/") && req.method === "GET") {
29656
29659
  try {
29657
29660
  const filename = url2.pathname.replace("/screenshots/", "");
29661
+ if (!filename) {
29662
+ res.writeHead(404, { "Content-Type": "text/plain" });
29663
+ res.end("Screenshot not found");
29664
+ return;
29665
+ }
29658
29666
  if (filename.includes("/") || filename.includes("..")) {
29659
29667
  console.error("Invalid screenshot filename:", filename);
29660
29668
  res.writeHead(404, { "Content-Type": "text/plain" });
@@ -29751,11 +29759,11 @@ var server = createServer(async (req, res) => {
29751
29759
  createOpenAIClient,
29752
29760
  initializeHttpClient,
29753
29761
  initializeOpenAIClient
29754
- } = await import("./index-mxkgxy04.js");
29762
+ } = await import("./index-c0zk3ctc.js");
29755
29763
  const httpClient = createHttpClientFromConfig({
29756
29764
  url: validatedUrl,
29757
29765
  token: validatedToken
29758
- });
29766
+ }, { "x-sisense-origin": "mcp-server" });
29759
29767
  if (initializeHttpClient) {
29760
29768
  initializeHttpClient(httpClient);
29761
29769
  }