@kadoa/mcp 0.3.5-rc.1 → 0.3.5-rc.2
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 +8 -4
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -49167,6 +49167,9 @@ var init_client2 = __esm(() => {
|
|
|
49167
49167
|
});
|
|
49168
49168
|
|
|
49169
49169
|
// src/tools.ts
|
|
49170
|
+
function isRealTimeInterval(interval) {
|
|
49171
|
+
return interval?.toUpperCase().replace("-", "_") === "REAL_TIME";
|
|
49172
|
+
}
|
|
49170
49173
|
function jsonResult(data) {
|
|
49171
49174
|
return { content: [{ type: "text", text: JSON.stringify(data, null, 2) }] };
|
|
49172
49175
|
}
|
|
@@ -49333,10 +49336,11 @@ function registerTools(server, ctx) {
|
|
|
49333
49336
|
}
|
|
49334
49337
|
return entity;
|
|
49335
49338
|
} : undefined;
|
|
49339
|
+
const isRealTime = args.interval === "REAL_TIME";
|
|
49336
49340
|
let builder = ctx.client.extract({
|
|
49337
49341
|
urls: args.urls,
|
|
49338
49342
|
name: args.name || "Untitled Workflow",
|
|
49339
|
-
navigationMode: "agentic-navigation",
|
|
49343
|
+
...isRealTime ? {} : { navigationMode: "agentic-navigation" },
|
|
49340
49344
|
userPrompt: args.prompt,
|
|
49341
49345
|
extraction,
|
|
49342
49346
|
interval: args.interval
|
|
@@ -49460,7 +49464,7 @@ function registerTools(server, ctx) {
|
|
|
49460
49464
|
annotations: { readOnlyHint: false, destructiveHint: false, idempotentHint: false }
|
|
49461
49465
|
}, withErrorHandling("run_workflow", async (args) => {
|
|
49462
49466
|
const workflow = await ctx.client.workflow.get(args.workflowId);
|
|
49463
|
-
if (workflow.updateInterval
|
|
49467
|
+
if (isRealTimeInterval(workflow.updateInterval)) {
|
|
49464
49468
|
return errorResult("Real-time workflows run continuously and cannot be triggered manually. " + "Use fetch_data to retrieve the latest extracted results.");
|
|
49465
49469
|
}
|
|
49466
49470
|
const result = await ctx.client.workflow.runWorkflow(args.workflowId, {
|
|
@@ -49559,8 +49563,8 @@ function registerTools(server, ctx) {
|
|
|
49559
49563
|
const { workflowId, ...updates } = args;
|
|
49560
49564
|
if (updates.updateInterval) {
|
|
49561
49565
|
const workflow = await ctx.client.workflow.get(workflowId);
|
|
49562
|
-
const isCurrentlyRealTime = workflow.updateInterval
|
|
49563
|
-
const isRequestingRealTime = updates.updateInterval
|
|
49566
|
+
const isCurrentlyRealTime = isRealTimeInterval(workflow.updateInterval);
|
|
49567
|
+
const isRequestingRealTime = isRealTimeInterval(updates.updateInterval);
|
|
49564
49568
|
if (isRequestingRealTime && !isCurrentlyRealTime) {
|
|
49565
49569
|
return errorResult("Cannot change a regular workflow's interval to REAL_TIME. " + "Real-time workflows use a different service (Observer) and must be created as real-time from the start. " + "Delete this workflow and create a new one with interval='REAL_TIME' using create_workflow.");
|
|
49566
49570
|
}
|