@kadoa/mcp 0.4.3-rc.2 → 0.4.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.
- package/dist/index.js +48 -4
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -50244,6 +50244,41 @@ function coerceJson() {
|
|
|
50244
50244
|
function isRealTimeInterval(interval) {
|
|
50245
50245
|
return interval?.toUpperCase().replace("-", "_") === "REAL_TIME";
|
|
50246
50246
|
}
|
|
50247
|
+
function deriveStatusLabel(workflow) {
|
|
50248
|
+
const ds = workflow.displayState ?? workflow.state;
|
|
50249
|
+
switch (ds) {
|
|
50250
|
+
case "ACTIVE":
|
|
50251
|
+
if (isRealTimeInterval(workflow.updateInterval))
|
|
50252
|
+
return "Running";
|
|
50253
|
+
if (!workflow.updateInterval || workflow.updateInterval === "only once")
|
|
50254
|
+
return "Complete";
|
|
50255
|
+
return "Scheduled";
|
|
50256
|
+
case "RUNNING":
|
|
50257
|
+
return "Running";
|
|
50258
|
+
case "FAILED":
|
|
50259
|
+
return "Failed";
|
|
50260
|
+
case "PAUSED":
|
|
50261
|
+
return "Paused";
|
|
50262
|
+
case "SETUP":
|
|
50263
|
+
return "Sample Processing";
|
|
50264
|
+
case "QUEUED":
|
|
50265
|
+
return "Queued";
|
|
50266
|
+
case "PENDING_START":
|
|
50267
|
+
return "Not Started";
|
|
50268
|
+
case "PREVIEW":
|
|
50269
|
+
return "Pending Review";
|
|
50270
|
+
case "DEGRADED":
|
|
50271
|
+
return "Degraded";
|
|
50272
|
+
case "DELETED":
|
|
50273
|
+
return "Deleted";
|
|
50274
|
+
case "COMPLIANCE_REVIEW":
|
|
50275
|
+
return "Compliance Review";
|
|
50276
|
+
case "COMPLIANCE_REJECTED":
|
|
50277
|
+
return "Rejected";
|
|
50278
|
+
default:
|
|
50279
|
+
return ds ?? "Unknown";
|
|
50280
|
+
}
|
|
50281
|
+
}
|
|
50247
50282
|
function workflowDashboardUrl(workflowId) {
|
|
50248
50283
|
return `${DASHBOARD_BASE_URL}/workflow/${workflowId}`;
|
|
50249
50284
|
}
|
|
@@ -50267,6 +50302,15 @@ function extractApiMessage(responseBody) {
|
|
|
50267
50302
|
msg = msg ? `${msg} — Details: ${details}` : `Validation failed — Details: ${details}`;
|
|
50268
50303
|
}
|
|
50269
50304
|
}
|
|
50305
|
+
if (!msg && Array.isArray(body.issues)) {
|
|
50306
|
+
const details = body.issues.map((issue2) => {
|
|
50307
|
+
const path = Array.isArray(issue2.path) ? issue2.path.join(".") : "";
|
|
50308
|
+
const message = typeof issue2.message === "string" ? issue2.message : String(issue2.code ?? "invalid");
|
|
50309
|
+
return path ? `${path}: "${message}"` : `"${message}"`;
|
|
50310
|
+
}).join(", ");
|
|
50311
|
+
if (details)
|
|
50312
|
+
msg = `Validation failed — Details: ${details}`;
|
|
50313
|
+
}
|
|
50270
50314
|
return msg;
|
|
50271
50315
|
}
|
|
50272
50316
|
function inferResourceType(toolName) {
|
|
@@ -50657,7 +50701,7 @@ function registerTools(server, ctx) {
|
|
|
50657
50701
|
id: w.id,
|
|
50658
50702
|
name: w.name,
|
|
50659
50703
|
dashboardUrl: workflowDashboardUrl(w.id),
|
|
50660
|
-
status: w
|
|
50704
|
+
status: deriveStatusLabel(w),
|
|
50661
50705
|
urls: w.urls,
|
|
50662
50706
|
totalRecords: w.totalRecords,
|
|
50663
50707
|
startedAt: w.startedAt,
|
|
@@ -50681,7 +50725,7 @@ function registerTools(server, ctx) {
|
|
|
50681
50725
|
name: workflow.name,
|
|
50682
50726
|
dashboardUrl: workflowDashboardUrl(workflow.id),
|
|
50683
50727
|
description: workflow.description,
|
|
50684
|
-
status: workflow
|
|
50728
|
+
status: deriveStatusLabel(workflow),
|
|
50685
50729
|
urls: workflow.urls,
|
|
50686
50730
|
prompt: additionalData?.userPrompt,
|
|
50687
50731
|
entity: workflow.entity,
|
|
@@ -50804,7 +50848,7 @@ function registerTools(server, ctx) {
|
|
|
50804
50848
|
try {
|
|
50805
50849
|
const workflow = await ctx.client.workflow.get(args.workflowId);
|
|
50806
50850
|
workflowName = workflow.name || args.workflowId;
|
|
50807
|
-
workflowStatus = workflow
|
|
50851
|
+
workflowStatus = deriveStatusLabel(workflow);
|
|
50808
50852
|
} catch {}
|
|
50809
50853
|
if (!args.confirmed) {
|
|
50810
50854
|
return jsonResult({
|
|
@@ -51435,7 +51479,7 @@ var package_default;
|
|
|
51435
51479
|
var init_package = __esm(() => {
|
|
51436
51480
|
package_default = {
|
|
51437
51481
|
name: "@kadoa/mcp",
|
|
51438
|
-
version: "0.4.3
|
|
51482
|
+
version: "0.4.3",
|
|
51439
51483
|
description: "Kadoa MCP Server — manage workflows from Claude Desktop, Cursor, and other MCP clients",
|
|
51440
51484
|
type: "module",
|
|
51441
51485
|
main: "dist/index.js",
|