snow-flow 10.0.1-dev.485 → 10.0.1-dev.486
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/package.json
CHANGED
|
@@ -2505,9 +2505,10 @@ export const toolDefinition: MCPToolDefinition = {
|
|
|
2505
2505
|
'add_trigger', 'update_trigger', 'delete_trigger',
|
|
2506
2506
|
'add_action', 'update_action', 'delete_action',
|
|
2507
2507
|
'add_flow_logic', 'update_flow_logic', 'delete_flow_logic',
|
|
2508
|
-
'add_subflow', 'update_subflow', 'delete_subflow'
|
|
2508
|
+
'add_subflow', 'update_subflow', 'delete_subflow',
|
|
2509
|
+
'close_flow'
|
|
2509
2510
|
],
|
|
2510
|
-
description: 'Action to perform. add_*/update_*/delete_* for triggers, actions, flow_logic, subflows. update_trigger replaces the trigger type. update_action/update_flow_logic/update_subflow change input values. delete_* removes elements by element_id.'
|
|
2511
|
+
description: 'Action to perform. add_*/update_*/delete_* for triggers, actions, flow_logic, subflows. update_trigger replaces the trigger type. update_action/update_flow_logic/update_subflow change input values. delete_* removes elements by element_id. IMPORTANT: When making multiple edits to a flow (add_action, add_flow_logic, etc.), call close_flow as the LAST step to release the editing lock. Without close_flow, the flow stays locked and cannot be edited in the UI. create_flow auto-releases the lock.'
|
|
2511
2512
|
},
|
|
2512
2513
|
|
|
2513
2514
|
flow_id: {
|
|
@@ -3480,7 +3481,6 @@ export async function execute(args: any, context: ServiceNowContext): Promise<To
|
|
|
3480
3481
|
addTrigSummary.error('Failed to add trigger: ' + (addTrigResult.error || 'unknown'));
|
|
3481
3482
|
}
|
|
3482
3483
|
|
|
3483
|
-
await releaseFlowEditingLock(client, addTrigFlowId);
|
|
3484
3484
|
return addTrigResult.success
|
|
3485
3485
|
? createSuccessResult({ action: 'add_trigger', ...addTrigResult }, {}, addTrigSummary.build())
|
|
3486
3486
|
: createErrorResult(addTrigResult.error || 'Failed to add trigger');
|
|
@@ -3544,7 +3544,6 @@ export async function execute(args: any, context: ServiceNowContext): Promise<To
|
|
|
3544
3544
|
updTrigSummary.error('Failed to update trigger: ' + (updTrigResult.error || 'unknown'));
|
|
3545
3545
|
}
|
|
3546
3546
|
|
|
3547
|
-
await releaseFlowEditingLock(client, updTrigFlowId);
|
|
3548
3547
|
return updTrigResult.success
|
|
3549
3548
|
? createSuccessResult({ action: 'update_trigger', steps: updTrigSteps }, {}, updTrigSummary.build())
|
|
3550
3549
|
: createErrorResult(updTrigResult.error || 'Failed to update trigger');
|
|
@@ -3576,7 +3575,6 @@ export async function execute(args: any, context: ServiceNowContext): Promise<To
|
|
|
3576
3575
|
addActSummary.error('Failed to add action: ' + (addActResult.error || 'unknown'));
|
|
3577
3576
|
}
|
|
3578
3577
|
|
|
3579
|
-
await releaseFlowEditingLock(client, addActFlowId);
|
|
3580
3578
|
return addActResult.success
|
|
3581
3579
|
? createSuccessResult({ action: 'add_action', ...addActResult }, {}, addActSummary.build())
|
|
3582
3580
|
: createErrorResult(addActResult.error || 'Failed to add action');
|
|
@@ -3613,7 +3611,6 @@ export async function execute(args: any, context: ServiceNowContext): Promise<To
|
|
|
3613
3611
|
addLogicSummary.error('Failed to add flow logic: ' + (addLogicResult.error || 'unknown'));
|
|
3614
3612
|
}
|
|
3615
3613
|
|
|
3616
|
-
await releaseFlowEditingLock(client, addLogicFlowId);
|
|
3617
3614
|
return addLogicResult.success
|
|
3618
3615
|
? createSuccessResult({ action: 'add_flow_logic', ...addLogicResult }, {}, addLogicSummary.build())
|
|
3619
3616
|
: createErrorResult(addLogicResult.error || 'Failed to add flow logic');
|
|
@@ -3648,7 +3645,6 @@ export async function execute(args: any, context: ServiceNowContext): Promise<To
|
|
|
3648
3645
|
addSubSummary.error('Failed to add subflow call: ' + (addSubResult.error || 'unknown'));
|
|
3649
3646
|
}
|
|
3650
3647
|
|
|
3651
|
-
await releaseFlowEditingLock(client, addSubFlowId);
|
|
3652
3648
|
return addSubResult.success
|
|
3653
3649
|
? createSuccessResult({ action: 'add_subflow', ...addSubResult }, {}, addSubSummary.build())
|
|
3654
3650
|
: createErrorResult(addSubResult.error || 'Failed to add subflow call');
|
|
@@ -3674,7 +3670,6 @@ export async function execute(args: any, context: ServiceNowContext): Promise<To
|
|
|
3674
3670
|
} else {
|
|
3675
3671
|
updElemSummary.error('Failed to update element: ' + (updElemResult.error || 'unknown'));
|
|
3676
3672
|
}
|
|
3677
|
-
await releaseFlowEditingLock(client, updElemFlowId);
|
|
3678
3673
|
return updElemResult.success
|
|
3679
3674
|
? createSuccessResult({ action, ...updElemResult }, {}, updElemSummary.build())
|
|
3680
3675
|
: createErrorResult(updElemResult.error || 'Failed to update element');
|
|
@@ -3706,12 +3701,27 @@ export async function execute(args: any, context: ServiceNowContext): Promise<To
|
|
|
3706
3701
|
} else {
|
|
3707
3702
|
delSummary.error('Failed to delete element: ' + (delResult.error || 'unknown'));
|
|
3708
3703
|
}
|
|
3709
|
-
await releaseFlowEditingLock(client, delElemFlowId);
|
|
3710
3704
|
return delResult.success
|
|
3711
3705
|
? createSuccessResult({ action, ...delResult }, {}, delSummary.build())
|
|
3712
3706
|
: createErrorResult(delResult.error || 'Failed to delete element');
|
|
3713
3707
|
}
|
|
3714
3708
|
|
|
3709
|
+
// ────────────────────────────────────────────────────────────────
|
|
3710
|
+
// CLOSE_FLOW — release Flow Designer editing lock (safeEdit)
|
|
3711
|
+
// ────────────────────────────────────────────────────────────────
|
|
3712
|
+
case 'close_flow': {
|
|
3713
|
+
if (!args.flow_id) throw new SnowFlowError(ErrorType.VALIDATION_ERROR, 'flow_id is required for close_flow');
|
|
3714
|
+
var closeFlowId = await resolveFlowId(client, args.flow_id);
|
|
3715
|
+
var closed = await releaseFlowEditingLock(client, closeFlowId);
|
|
3716
|
+
var closeSummary = summary();
|
|
3717
|
+
if (closed) {
|
|
3718
|
+
closeSummary.success('Flow editing lock released').field('Flow', closeFlowId);
|
|
3719
|
+
} else {
|
|
3720
|
+
closeSummary.warning('Lock release returned false (flow may not have been locked)').field('Flow', closeFlowId);
|
|
3721
|
+
}
|
|
3722
|
+
return createSuccessResult({ action: 'close_flow', flow_id: closeFlowId, lock_released: closed }, {}, closeSummary.build());
|
|
3723
|
+
}
|
|
3724
|
+
|
|
3715
3725
|
default:
|
|
3716
3726
|
throw new SnowFlowError(ErrorType.VALIDATION_ERROR, 'Unknown action: ' + action);
|
|
3717
3727
|
}
|