@barivia/barsom-mcp 0.20.2 → 0.20.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/README.md
CHANGED
|
@@ -29,7 +29,7 @@ MCP clients typically run it with **`npx`** (downloads on first use):
|
|
|
29
29
|
|
|
30
30
|
**Audit logging (0.10.3+):** Each tool invocation emits a structured **`mcp_tool_call`** line on stderr for support correlation — not sent to the Barivia API. Fields: `tool`, `action`, `duration_ms`, `outcome`, **`rid`** (matches API `X-Request-ID`), **`job_id`** / **`dataset_id`** when the action returns or accepts them, scale hints **`grid_x`** / **`grid_y`** on training submits, and **`timeout_hit`** / **`output_truncated`** when proxy fetch/output limits apply. No API keys or file paths. Grep client stderr alongside API/worker logs by `rid`; see `docs/OPERATIONS_MANUAL.md` §5b.
|
|
31
31
|
|
|
32
|
-
**
|
|
32
|
+
**Hosted HTTP MCP paused (2026-06):** `https://mcp.barivia.se/mcp` returns **503** (`hosted_mcp_paused`). Use this npm package only.
|
|
33
33
|
|
|
34
34
|
**Cursor / multi-account note:** Cursor's tool dispatcher resolves tools under a `serverIdentifier` (e.g. `user-barivia-bbb-maps`), which can differ from the key you wrote in `mcp.json` (e.g. `barivia-bbb-maps`). If a tool call fails with **"server does not exist"** or similar, list the resolved identifier with your client's tool inspector (`mcp.list-tools` or equivalent) and use that identifier — not the `mcp.json` key.
|
|
35
35
|
|
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.20.
|
|
29
|
+
export const CLIENT_VERSION = "0.20.3";
|
|
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). */
|
|
@@ -78,6 +78,8 @@ export const TRAINING_INPUT_SCHEMA = {
|
|
|
78
78
|
convergence: z.tuple([z.number(), z.number()]),
|
|
79
79
|
})]).optional()),
|
|
80
80
|
batch_size: z.number().int().optional(),
|
|
81
|
+
te_panel_size: z.number().int().optional()
|
|
82
|
+
.describe("Fixed evaluation-panel size for live topographic error during training (default clamp(grid_nodes*6, 500, 10000))"),
|
|
81
83
|
quality_metrics: z.union([z.enum(["fast", "standard", "full"]), z.array(z.string())]).optional(),
|
|
82
84
|
backend: z.enum(["auto", "cpu", "gpu", "gpu_graphs"]).optional().default("auto"),
|
|
83
85
|
output_format: z.enum(["png", "pdf", "svg"]).optional().default("png"),
|
|
@@ -9,13 +9,21 @@ export function combinedBatchAxis(nOrd, nConv) {
|
|
|
9
9
|
return [];
|
|
10
10
|
return [...batchSampleAxis(nOrd, 0), ...batchSampleAxis(nConv, nOrd)];
|
|
11
11
|
}
|
|
12
|
+
export function isKernelTrainingComplete(data, status) {
|
|
13
|
+
if (status === "failed" || status === "cancelled")
|
|
14
|
+
return true;
|
|
15
|
+
if (data.kernel_complete === true)
|
|
16
|
+
return true;
|
|
17
|
+
return status === "completed";
|
|
18
|
+
}
|
|
19
|
+
export function teCurveLabel(base, _kernelComplete = false) {
|
|
20
|
+
return `${base} (panel)`;
|
|
21
|
+
}
|
|
12
22
|
export function formatCurveSourceNote(data) {
|
|
13
23
|
const src = data.training_curve_source_batches;
|
|
14
|
-
if (!src)
|
|
15
|
-
return null;
|
|
16
24
|
const parts = [];
|
|
17
|
-
const ordTotal = typeof src.ordering === "number" ? src.ordering : null;
|
|
18
|
-
const convTotal = typeof src.convergence === "number" ? src.convergence : null;
|
|
25
|
+
const ordTotal = src && typeof src.ordering === "number" ? src.ordering : null;
|
|
26
|
+
const convTotal = src && typeof src.convergence === "number" ? src.convergence : null;
|
|
19
27
|
const ordShown = Array.isArray(data.ordering_errors) ? data.ordering_errors.length : 0;
|
|
20
28
|
const convShown = Array.isArray(data.convergence_errors) ? data.convergence_errors.length : 0;
|
|
21
29
|
if (ordTotal != null && ordTotal > ordShown) {
|
|
@@ -24,9 +32,27 @@ export function formatCurveSourceNote(data) {
|
|
|
24
32
|
if (convTotal != null && convTotal > convShown) {
|
|
25
33
|
parts.push(`${convShown} of ${convTotal.toLocaleString()} convergence batch samples`);
|
|
26
34
|
}
|
|
35
|
+
const teEval = data.te_evaluation;
|
|
36
|
+
const panelM = teEval?.te_panel_size;
|
|
37
|
+
const panelN = teEval?.te_panel_n_train;
|
|
38
|
+
if (typeof panelM === "number" && typeof panelN === "number" && panelN > 0) {
|
|
39
|
+
const strat = teEval?.te_panel_stratified === true ? ", stratified by mesh" : "";
|
|
40
|
+
parts.push(`TE curve uses a fixed panel of ${panelM.toLocaleString()} of ${panelN.toLocaleString()} training rows${strat}`);
|
|
41
|
+
}
|
|
42
|
+
const panelTe = data.panel_topographic_error;
|
|
43
|
+
const mapTe = data.map_topographic_error;
|
|
44
|
+
if (panelTe != null &&
|
|
45
|
+
mapTe != null &&
|
|
46
|
+
Number.isFinite(Number(panelTe)) &&
|
|
47
|
+
Number.isFinite(Number(mapTe))) {
|
|
48
|
+
parts.push(`Panel TE ${Number(panelTe).toFixed(4)} · Map TE ${Number(mapTe).toFixed(4)} (full training set)`);
|
|
49
|
+
}
|
|
27
50
|
if (parts.length === 0)
|
|
28
51
|
return null;
|
|
29
|
-
|
|
52
|
+
const subsample = ordTotal != null || convTotal != null
|
|
53
|
+
? "Displaying uniformly subsampled QE+TE curves (≤1000 points/phase, joint indices): "
|
|
54
|
+
: "";
|
|
55
|
+
return `${subsample}${parts.join("; ")}.`.replace(/: ;/, ":");
|
|
30
56
|
}
|
|
31
57
|
/** Map TE onto QE batch axis; when batch-aligned (same length), use values directly. */
|
|
32
58
|
export function alignTeToQeAxis(te, qeLen) {
|
|
@@ -42,8 +68,7 @@ export function alignTeToQeAxis(te, qeLen) {
|
|
|
42
68
|
return [...Array(pad).fill(null), ...te];
|
|
43
69
|
}
|
|
44
70
|
/**
|
|
45
|
-
* Last
|
|
46
|
-
* recent per-epoch TE estimate, distinct from the final trained-map TE in the summary.
|
|
71
|
+
* Last panel TE point from the (batch-aligned) live TE curve.
|
|
47
72
|
*/
|
|
48
73
|
export function lastEpochTeFromCurves(data) {
|
|
49
74
|
const conv = data.convergence_topographic_errors;
|