@barivia/barsom-mcp 0.17.0 → 0.17.1

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 CHANGED
@@ -182,6 +182,10 @@ The right viewer depends on **(MCP App support)** **and** **(can the human reach
182
182
 
183
183
  ### Migration notes
184
184
 
185
+ - **Fixes (0.17.1, non-breaking):**
186
+ - `datasets(action=list/get)` no longer prints `ingest_error=missing` for healthy datasets (a SQL `NULL` was serialized as the literal `"missing"`; fixed server-side, and the proxy now also ignores the `missing`/`null` sentinels).
187
+ - `file_path` upload help now states that **relative** paths resolve against the MCP **workspace root** — in Cursor/IDE clients that root is often the MCP install dir, so set `BARIVIA_WORKSPACE_ROOT` (or pass an absolute path) if a relative path is "not accessible".
188
+ - Preprocessing failures now name the **offending column(s)** (e.g. missing cells in a `train(action=map)` column) instead of a generic error.
185
189
  - **Surface cleanup (0.17.0, breaking):**
186
190
  - `train(action=baseline_study)` **removed** — use `train(action=map, preset=quick)` (the `baseline_explore` preset in `training_guidance`).
187
191
  - `results(action=transition_flow)` **removed** — it is now **`inference(action=transition_flow)`** (a frozen-map operation). Read the resulting figure with `results(action=get/download)` on the returned job_id.
package/dist/shared.js CHANGED
@@ -26,7 +26,7 @@ export const RETRYABLE_STATUS = new Set([502, 503, 504]);
26
26
  * X-Barsom-Client-Version so the server can annotate tool guidance with the
27
27
  * wrapper version each action requires. Keep in sync with package.json on bump.
28
28
  */
29
- export const CLIENT_VERSION = "0.17.0";
29
+ export const CLIENT_VERSION = "0.17.1";
30
30
  /** User-facing links; keep aligned with barivia.se / api.barivia.se. */
31
31
  export const PUBLIC_SITE_ORIGIN = "https://barivia.se";
32
32
  /** Self-serve account dashboard (manage plan, billing, and API keys). */
@@ -6,6 +6,17 @@ import { z } from "zod";
6
6
  import { registerAuditedTool } from "../audit.js";
7
7
  import { apiCall, getWorkspaceRootAsync, resolveFilePathForUpload, textResult, pollUntilComplete, POLL_DERIVE_MAX_MS, UPLOAD_DATASET_TIMEOUT_MS, LARGE_UPLOAD_BYTES, PRESIGNED_PUT_TIMEOUT_MS, POLL_STAGE_MAX_MS, streamFileSha256, putPresignedStream, } from "../shared.js";
8
8
  import { GZIP_UPLOAD_HINT } from "../job_status_format.js";
9
+ /**
10
+ * Normalize a nullable string field from the API. Returns "" for absent values,
11
+ * empty strings, and the literal SQL/serialization sentinels "missing"/"null"
12
+ * (older backends serialized a NULL ingest_error as the string "missing").
13
+ */
14
+ function cleanNullable(v) {
15
+ if (v == null)
16
+ return "";
17
+ const s = String(v).trim();
18
+ return s === "" || s.toLowerCase() === "missing" || s.toLowerCase() === "null" ? "" : s;
19
+ }
9
20
  /**
10
21
  * Format a dataset analyze result (from either the async job summary or the
11
22
  * legacy sync GET response) into the human-readable text block.
@@ -165,7 +176,7 @@ ESCALATION: If upload fails with column errors, open the file locally and verify
165
176
  .enum(["upload", "preview", "analyze", "list", "get", "subset", "delete", "add_expression", "reduce_spectral"])
166
177
  .describe("upload: add CSV or .csv.gz; preview: inspect columns/stats; analyze: pre-training correlation and periodicity; list: see all datasets; get: fetch one dataset metadata (status/staging); subset: create filtered subset; delete: remove dataset; add_expression: add derived column from expression (or, with project_onto_job, project the expression onto a trained map as a component plane); reduce_spectral: collapse a long ordered numeric block (e.g. spectrum, time series) into a small per-row feature set via PCA / log_sample / uniform_sample / stats"),
167
178
  name: z.string().optional().describe("Dataset name (required for action=upload and subset)"),
168
- file_path: z.string().optional().describe("Path to local CSV or .csv.gz (PREFERRED): absolute path, file:// URI, or relative to workspace root. Token-efficient; server reads file. Use .csv.gz for large scientific tables."),
179
+ file_path: z.string().optional().describe("Path to local CSV or .csv.gz (PREFERRED): absolute path, file:// URI, or path relative to the workspace root. Token-efficient; server reads file. NOTE: relative paths resolve against the MCP workspace root — in Cursor/IDE clients that root is often the MCP install dir, not your project, so set BARIVIA_WORKSPACE_ROOT in the MCP config env (or just pass an absolute path) if a relative path is 'not accessible'. Use .csv.gz for large scientific tables."),
169
180
  csv_data: z.string().optional().describe("Inline CSV string for small pastes only (<10KB). Avoid for large files — use file_path instead to avoid token explosion."),
170
181
  dataset_id: z.string().optional().describe("Dataset ID (required for preview, get, subset, and delete)"),
171
182
  n_rows: z.number().int().optional().default(5).describe("Sample rows to return (preview only)"),
@@ -632,9 +643,8 @@ ESCALATION: If upload fails with column errors, open the file locally and verify
632
643
  const cols = ds.cols != null ? Number(ds.cols) : "?";
633
644
  const st = ds.status != null ? String(ds.status) : "ready";
634
645
  const statusBit = st !== "ready" ? ` | status=${st}` : "";
635
- const err = ds.ingest_error != null && String(ds.ingest_error) !== ""
636
- ? ` | ingest_error=${String(ds.ingest_error)}`
637
- : "";
646
+ const ingestErr = cleanNullable(ds.ingest_error);
647
+ const err = ingestErr ? ` | ingest_error=${ingestErr}` : "";
638
648
  return `${name} (${id}) — ${rows}×${cols}${statusBit}${err}`;
639
649
  });
640
650
  return { content: [{ type: "text", text: lines.length > 0 ? lines.join("\n") : "No datasets." }] };
@@ -653,9 +663,7 @@ ESCALATION: If upload fails with column errors, open the file locally and verify
653
663
  ds.staged_prefix != null ? `Staged prefix: ${String(ds.staged_prefix)}` : "",
654
664
  ds.staged_version != null ? `Staged version: ${String(ds.staged_version)}` : "",
655
665
  ds.stage_job_id != null ? `Stage job: ${String(ds.stage_job_id)} (poll jobs(action=status))` : "",
656
- ds.ingest_error != null && String(ds.ingest_error) !== ""
657
- ? `Ingest error: ${String(ds.ingest_error)}`
658
- : "",
666
+ cleanNullable(ds.ingest_error) ? `Ingest error: ${cleanNullable(ds.ingest_error)}` : "",
659
667
  ds.created_at != null ? `Created: ${String(ds.created_at)}` : "",
660
668
  ].filter(Boolean);
661
669
  return { content: [{ type: "text", text: lines.join("\n") }] };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@barivia/barsom-mcp",
3
- "version": "0.17.0",
3
+ "version": "0.17.1",
4
4
  "description": "barSOM MCP proxy — connect any MCP client to the barSOM cloud API for Self-Organizing Map analytics",
5
5
  "keywords": [
6
6
  "mcp",