@barivia/barmesh-mcp 0.7.0 → 0.8.0
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/audit.js +3 -1
- package/dist/deferred_feedback.js +88 -0
- package/dist/index.js +1 -1
- package/dist/inventory_format.js +69 -0
- package/dist/job_monitor.js +38 -2
- package/dist/logger.js +3 -0
- package/dist/richardson_results.js +35 -0
- package/dist/shared.js +347 -45
- package/dist/tools/barmesh_results_explorer.js +44 -33
- package/dist/tools/cfd.js +20 -8
- package/dist/tools/datasets.js +61 -27
- package/dist/tools/feedback.js +71 -6
- package/dist/tools/guide.js +41 -7
- package/dist/tools/jobs.js +117 -11
- package/dist/tools/results.js +11 -5
- package/dist/tools/training_monitor.js +25 -20
- package/dist/training_monitor_curve.js +1 -1
- package/dist/ui-delivery.js +155 -0
- package/dist/views/src/views/barmesh-results-explorer/index.html +18 -16
- package/dist/views/src/views/barmesh-training-monitor/index.html +40 -28
- package/dist/viz_links.js +55 -0
- package/package.json +1 -1
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
import { getVizPort } from "./shared.js";
|
|
2
|
+
export function buildBarmeshVizStandaloneUrl(view, jobId) {
|
|
3
|
+
const port = getVizPort();
|
|
4
|
+
if (!port)
|
|
5
|
+
return undefined;
|
|
6
|
+
return `http://localhost:${port}/viz/${view}?mode=standalone&job_id=${encodeURIComponent(jobId)}`;
|
|
7
|
+
}
|
|
8
|
+
export function isTerminalJobStatus(status) {
|
|
9
|
+
return status === "completed" || status === "failed" || status === "cancelled";
|
|
10
|
+
}
|
|
11
|
+
/** True when compute + cfd_finalize (if any) are done — safe to open results_explorer. */
|
|
12
|
+
export function isFullyComplete(data) {
|
|
13
|
+
const status = String(data.status ?? "");
|
|
14
|
+
if (status !== "completed")
|
|
15
|
+
return isTerminalJobStatus(status);
|
|
16
|
+
const finalizeId = data.finalize_job_id != null && String(data.finalize_job_id) !== ""
|
|
17
|
+
? String(data.finalize_job_id)
|
|
18
|
+
: null;
|
|
19
|
+
if (!finalizeId)
|
|
20
|
+
return true;
|
|
21
|
+
return String(data.finalize_status ?? "") === "completed";
|
|
22
|
+
}
|
|
23
|
+
/** Keep polling while finalize is still running after parent compute completed. */
|
|
24
|
+
export function shouldKeepPollingJob(data) {
|
|
25
|
+
const status = String(data.status ?? "");
|
|
26
|
+
if (!isTerminalJobStatus(status))
|
|
27
|
+
return true;
|
|
28
|
+
if (status !== "completed")
|
|
29
|
+
return false;
|
|
30
|
+
if (data.finalize_failed === true)
|
|
31
|
+
return false;
|
|
32
|
+
const finalizeId = data.finalize_job_id != null && String(data.finalize_job_id) !== ""
|
|
33
|
+
? String(data.finalize_job_id)
|
|
34
|
+
: null;
|
|
35
|
+
const finalizeStatus = data.finalize_status != null && String(data.finalize_status) !== ""
|
|
36
|
+
? String(data.finalize_status)
|
|
37
|
+
: null;
|
|
38
|
+
return finalizeId != null && finalizeStatus !== "completed";
|
|
39
|
+
}
|
|
40
|
+
export function monitorStandaloneLinkText(jobId) {
|
|
41
|
+
const url = buildBarmeshVizStandaloneUrl("barmesh-training-monitor", jobId);
|
|
42
|
+
if (!url)
|
|
43
|
+
return undefined;
|
|
44
|
+
return (`Live training monitor: [Open training monitor](${url})\n` +
|
|
45
|
+
`AGENT: surface this to the user as a clickable markdown link in your reply — do not leave it buried in tool output.\n` +
|
|
46
|
+
`This localhost port is per MCP session and goes stale if the proxy restarts — re-run barmesh_training_monitor for a fresh URL, or set BARIVIA_VIZ_PORT for a persistent port. Health check: http://localhost:${getVizPort()}/api/health?job_id=${encodeURIComponent(jobId)}`);
|
|
47
|
+
}
|
|
48
|
+
export function resultsExplorerStandaloneLinkText(jobId) {
|
|
49
|
+
const url = buildBarmeshVizStandaloneUrl("barmesh-results-explorer", jobId);
|
|
50
|
+
if (!url)
|
|
51
|
+
return undefined;
|
|
52
|
+
return (`Interactive results explorer: [Open results explorer](${url})\n` +
|
|
53
|
+
`AGENT: surface this to the user as a clickable markdown link in your reply — do not leave it buried in tool output.\n` +
|
|
54
|
+
`This localhost port is per MCP session and goes stale if the proxy restarts — re-run barmesh_results_explorer for a fresh URL, or set BARIVIA_VIZ_PORT for a persistent port.`);
|
|
55
|
+
}
|