snow-flow 8.39.13 → 8.40.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/CLAUDE.md +190 -0
- package/dist/mcp/servicenow-mcp-unified/tools/applications/index.d.ts +1 -0
- package/dist/mcp/servicenow-mcp-unified/tools/applications/index.d.ts.map +1 -1
- package/dist/mcp/servicenow-mcp-unified/tools/applications/index.js +4 -1
- package/dist/mcp/servicenow-mcp-unified/tools/applications/index.js.map +1 -1
- package/dist/mcp/servicenow-mcp-unified/tools/applications/snow_create_application.d.ts +9 -3
- package/dist/mcp/servicenow-mcp-unified/tools/applications/snow_create_application.d.ts.map +1 -1
- package/dist/mcp/servicenow-mcp-unified/tools/applications/snow_create_application.js +239 -13
- package/dist/mcp/servicenow-mcp-unified/tools/applications/snow_create_application.js.map +1 -1
- package/dist/mcp/servicenow-mcp-unified/tools/applications/snow_switch_application_scope.d.ts +18 -0
- package/dist/mcp/servicenow-mcp-unified/tools/applications/snow_switch_application_scope.d.ts.map +1 -0
- package/dist/mcp/servicenow-mcp-unified/tools/applications/snow_switch_application_scope.js +297 -0
- package/dist/mcp/servicenow-mcp-unified/tools/applications/snow_switch_application_scope.js.map +1 -0
- package/dist/mcp/servicenow-mcp-unified/tools/automation/snow_execute_background_script.d.ts +2 -2
- package/dist/mcp/servicenow-mcp-unified/tools/automation/snow_execute_background_script.d.ts.map +1 -1
- package/dist/mcp/servicenow-mcp-unified/tools/automation/snow_execute_background_script.js +172 -21
- package/dist/mcp/servicenow-mcp-unified/tools/automation/snow_execute_background_script.js.map +1 -1
- package/dist/mcp/servicenow-mcp-unified/tools/automation/snow_execute_script_sync.d.ts +2 -1
- package/dist/mcp/servicenow-mcp-unified/tools/automation/snow_execute_script_sync.d.ts.map +1 -1
- package/dist/mcp/servicenow-mcp-unified/tools/automation/snow_execute_script_sync.js +194 -47
- package/dist/mcp/servicenow-mcp-unified/tools/automation/snow_execute_script_sync.js.map +1 -1
- package/dist/mcp/servicenow-mcp-unified/tools/automation/snow_execute_script_with_output.d.ts +3 -3
- package/dist/mcp/servicenow-mcp-unified/tools/automation/snow_execute_script_with_output.d.ts.map +1 -1
- package/dist/mcp/servicenow-mcp-unified/tools/automation/snow_execute_script_with_output.js +190 -142
- package/dist/mcp/servicenow-mcp-unified/tools/automation/snow_execute_script_with_output.js.map +1 -1
- package/dist/mcp/servicenow-mcp-unified/tools/update-sets/snow_ensure_active_update_set.d.ts.map +1 -1
- package/dist/mcp/servicenow-mcp-unified/tools/update-sets/snow_ensure_active_update_set.js +48 -4
- package/dist/mcp/servicenow-mcp-unified/tools/update-sets/snow_ensure_active_update_set.js.map +1 -1
- package/dist/mcp/servicenow-mcp-unified/tools/update-sets/snow_update_set_manage.d.ts.map +1 -1
- package/dist/mcp/servicenow-mcp-unified/tools/update-sets/snow_update_set_manage.js +74 -4
- package/dist/mcp/servicenow-mcp-unified/tools/update-sets/snow_update_set_manage.js.map +1 -1
- package/dist/utils/servicenow-client.d.ts +2 -1
- package/dist/utils/servicenow-client.d.ts.map +1 -1
- package/dist/utils/servicenow-client.js +112 -10
- package/dist/utils/servicenow-client.js.map +1 -1
- package/package.json +1 -1
|
@@ -2,7 +2,8 @@
|
|
|
2
2
|
/**
|
|
3
3
|
* snow_execute_script_sync - Synchronous script execution
|
|
4
4
|
*
|
|
5
|
-
*
|
|
5
|
+
* Executes server-side JavaScript in ServiceNow using Fix Scripts.
|
|
6
|
+
* Creates a temporary Fix Script, runs it, captures output, and cleans up.
|
|
6
7
|
*
|
|
7
8
|
* ⚠️ CRITICAL: ALL SCRIPTS MUST BE ES5 ONLY!
|
|
8
9
|
* ServiceNow runs on Rhino engine - no const/let/arrow functions/template literals.
|
|
@@ -14,7 +15,7 @@ const auth_js_1 = require("../../shared/auth.js");
|
|
|
14
15
|
const error_handler_js_1 = require("../../shared/error-handler.js");
|
|
15
16
|
exports.toolDefinition = {
|
|
16
17
|
name: 'snow_execute_script_sync',
|
|
17
|
-
description: '
|
|
18
|
+
description: 'Execute script synchronously using Fix Scripts with output capture (ES5 only)',
|
|
18
19
|
// Metadata for tool discovery (not sent to LLM)
|
|
19
20
|
category: 'automation',
|
|
20
21
|
subcategory: 'script-execution',
|
|
@@ -34,12 +35,12 @@ exports.toolDefinition = {
|
|
|
34
35
|
},
|
|
35
36
|
timeout: {
|
|
36
37
|
type: 'number',
|
|
37
|
-
description: 'Timeout in milliseconds',
|
|
38
|
+
description: 'Timeout in milliseconds (for polling)',
|
|
38
39
|
default: 30000
|
|
39
40
|
},
|
|
40
41
|
capture_output: {
|
|
41
42
|
type: 'boolean',
|
|
42
|
-
description: 'Capture and return output',
|
|
43
|
+
description: 'Capture and return output from gs.print/info/warn/error',
|
|
43
44
|
default: true
|
|
44
45
|
}
|
|
45
46
|
},
|
|
@@ -49,65 +50,188 @@ exports.toolDefinition = {
|
|
|
49
50
|
async function execute(args, context) {
|
|
50
51
|
const { script, timeout = 30000, capture_output = true } = args;
|
|
51
52
|
try {
|
|
53
|
+
// ES5 validation first
|
|
54
|
+
const es5Validation = validateES5(script);
|
|
55
|
+
if (!es5Validation.valid) {
|
|
56
|
+
throw new error_handler_js_1.SnowFlowError(error_handler_js_1.ErrorType.ES5_SYNTAX_ERROR, 'Script contains non-ES5 syntax', {
|
|
57
|
+
retryable: false,
|
|
58
|
+
details: {
|
|
59
|
+
violations: es5Validation.violations,
|
|
60
|
+
message: 'ServiceNow uses Rhino engine - ES6+ syntax will fail'
|
|
61
|
+
}
|
|
62
|
+
});
|
|
63
|
+
}
|
|
52
64
|
const client = await (0, auth_js_1.getAuthenticatedClient)(context);
|
|
53
|
-
// Create execution ID
|
|
65
|
+
// Create execution ID for tracking
|
|
54
66
|
const executionId = `sync_${Date.now()}_${Math.random().toString(36).substring(7)}`;
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
67
|
+
const outputMarker = `SNOW_FLOW_OUTPUT_${executionId}`;
|
|
68
|
+
// Wrap script with output capture
|
|
69
|
+
const wrappedScript = `
|
|
70
|
+
// Snow-Flow Script Execution - ID: ${executionId}
|
|
71
|
+
var __snowFlowOutput = [];
|
|
72
|
+
var __snowFlowStartTime = new GlideDateTime();
|
|
73
|
+
var __snowFlowResult = null;
|
|
74
|
+
var __snowFlowError = null;
|
|
75
|
+
|
|
76
|
+
// Capture gs output methods
|
|
77
|
+
var __origPrint = gs.print;
|
|
78
|
+
var __origInfo = gs.info;
|
|
79
|
+
var __origWarn = gs.warn;
|
|
80
|
+
var __origError = gs.error;
|
|
81
|
+
|
|
82
|
+
gs.print = function(msg) { __snowFlowOutput.push({level: 'print', msg: String(msg)}); __origPrint(msg); };
|
|
83
|
+
gs.info = function(msg) { __snowFlowOutput.push({level: 'info', msg: String(msg)}); __origInfo(msg); };
|
|
84
|
+
gs.warn = function(msg) { __snowFlowOutput.push({level: 'warn', msg: String(msg)}); __origWarn(msg); };
|
|
85
|
+
gs.error = function(msg) { __snowFlowOutput.push({level: 'error', msg: String(msg)}); __origError(msg); };
|
|
59
86
|
|
|
60
87
|
try {
|
|
61
|
-
|
|
62
|
-
var scriptResult = (function() {
|
|
88
|
+
__snowFlowResult = (function() {
|
|
63
89
|
${script}
|
|
64
90
|
})();
|
|
65
|
-
|
|
66
|
-
result = {
|
|
67
|
-
success: true,
|
|
68
|
-
result: scriptResult,
|
|
69
|
-
executionTime: GlideDateTime.subtract(startTime, new GlideDateTime()).getNumericValue(),
|
|
70
|
-
executionId: '${executionId}'
|
|
71
|
-
};
|
|
72
91
|
} catch(e) {
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
error: e.toString(),
|
|
76
|
-
executionTime: GlideDateTime.subtract(startTime, new GlideDateTime()).getNumericValue(),
|
|
77
|
-
executionId: '${executionId}'
|
|
78
|
-
};
|
|
92
|
+
__snowFlowError = e.toString();
|
|
93
|
+
gs.error('Script Error: ' + e.toString());
|
|
79
94
|
}
|
|
80
95
|
|
|
81
|
-
//
|
|
82
|
-
|
|
96
|
+
// Restore original methods
|
|
97
|
+
gs.print = __origPrint;
|
|
98
|
+
gs.info = __origInfo;
|
|
99
|
+
gs.warn = __origWarn;
|
|
100
|
+
gs.error = __origError;
|
|
101
|
+
|
|
102
|
+
// Calculate execution time
|
|
103
|
+
var __snowFlowEndTime = new GlideDateTime();
|
|
104
|
+
var __snowFlowExecTime = GlideDateTime.subtract(__snowFlowStartTime, __snowFlowEndTime).getNumericValue();
|
|
105
|
+
|
|
106
|
+
// Store result in system property for retrieval
|
|
107
|
+
var __snowFlowResultObj = {
|
|
108
|
+
executionId: '${executionId}',
|
|
109
|
+
success: __snowFlowError === null,
|
|
110
|
+
result: __snowFlowResult,
|
|
111
|
+
error: __snowFlowError,
|
|
112
|
+
output: __snowFlowOutput,
|
|
113
|
+
executionTimeMs: Math.abs(__snowFlowExecTime)
|
|
114
|
+
};
|
|
115
|
+
|
|
116
|
+
gs.setProperty('${outputMarker}', JSON.stringify(__snowFlowResultObj));
|
|
117
|
+
gs.info('${outputMarker}:COMPLETE');
|
|
83
118
|
`;
|
|
84
|
-
//
|
|
85
|
-
const
|
|
86
|
-
|
|
119
|
+
// Step 1: Create a Scheduled Script Job (sysauto_script) record
|
|
120
|
+
const jobName = `Snow-Flow Exec - ${executionId}`;
|
|
121
|
+
const createResponse = await client.post('/api/now/table/sysauto_script', {
|
|
122
|
+
name: jobName,
|
|
123
|
+
script: wrappedScript,
|
|
124
|
+
active: true,
|
|
125
|
+
run_type: 'on_demand', // On-demand job type
|
|
126
|
+
conditional: false
|
|
87
127
|
});
|
|
88
|
-
|
|
128
|
+
if (!createResponse.data?.result?.sys_id) {
|
|
129
|
+
throw new error_handler_js_1.SnowFlowError(error_handler_js_1.ErrorType.SERVICENOW_API_ERROR, 'Failed to create scheduled script job', { details: createResponse.data });
|
|
130
|
+
}
|
|
131
|
+
const jobSysId = createResponse.data.result.sys_id;
|
|
132
|
+
// Step 2: Create a sys_trigger record to execute the job immediately
|
|
133
|
+
// This is how ServiceNow executes scheduled jobs on demand
|
|
134
|
+
const now = new Date();
|
|
135
|
+
const triggerTime = new Date(now.getTime() + 2000); // 2 seconds from now
|
|
136
|
+
const triggerTimeStr = triggerTime.toISOString().replace('T', ' ').substring(0, 19);
|
|
89
137
|
try {
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
138
|
+
await client.post('/api/now/table/sys_trigger', {
|
|
139
|
+
name: jobName,
|
|
140
|
+
next_action: triggerTimeStr,
|
|
141
|
+
trigger_type: 0, // 0 = Run Once
|
|
142
|
+
state: 0, // 0 = Ready
|
|
143
|
+
document: 'sysauto_script',
|
|
144
|
+
document_key: jobSysId,
|
|
145
|
+
claimed_by: '',
|
|
146
|
+
system_id: 'snow-flow'
|
|
147
|
+
});
|
|
148
|
+
}
|
|
149
|
+
catch (triggerError) {
|
|
150
|
+
// If sys_trigger creation fails (permissions), the job won't auto-execute
|
|
151
|
+
// Continue anyway - we'll detect this in polling
|
|
152
|
+
}
|
|
153
|
+
// Step 3: Poll for completion by checking the system property
|
|
154
|
+
const startTime = Date.now();
|
|
155
|
+
let result = null;
|
|
156
|
+
let attempts = 0;
|
|
157
|
+
const maxAttempts = Math.ceil(timeout / 2000);
|
|
158
|
+
while (Date.now() - startTime < timeout && attempts < maxAttempts) {
|
|
159
|
+
attempts++;
|
|
160
|
+
await new Promise(resolve => setTimeout(resolve, 2000));
|
|
161
|
+
try {
|
|
162
|
+
// Check sys_properties for our output marker
|
|
163
|
+
const propResponse = await client.get('/api/now/table/sys_properties', {
|
|
164
|
+
params: {
|
|
165
|
+
sysparm_query: `name=${outputMarker}`,
|
|
166
|
+
sysparm_fields: 'value',
|
|
167
|
+
sysparm_limit: 1
|
|
168
|
+
}
|
|
169
|
+
});
|
|
170
|
+
if (propResponse.data?.result?.[0]?.value) {
|
|
171
|
+
try {
|
|
172
|
+
result = JSON.parse(propResponse.data.result[0].value);
|
|
173
|
+
break;
|
|
174
|
+
}
|
|
175
|
+
catch (parseErr) {
|
|
176
|
+
// Continue polling
|
|
177
|
+
}
|
|
178
|
+
}
|
|
93
179
|
}
|
|
94
|
-
|
|
95
|
-
|
|
180
|
+
catch (pollError) {
|
|
181
|
+
// Continue polling
|
|
96
182
|
}
|
|
97
183
|
}
|
|
98
|
-
|
|
99
|
-
|
|
184
|
+
// Step 4: Cleanup - delete the scheduled job and property
|
|
185
|
+
try {
|
|
186
|
+
await client.delete(`/api/now/table/sysauto_script/${jobSysId}`);
|
|
187
|
+
}
|
|
188
|
+
catch (cleanupError) {
|
|
189
|
+
// Ignore cleanup errors
|
|
190
|
+
}
|
|
191
|
+
try {
|
|
192
|
+
// Delete the output property
|
|
193
|
+
const propDeleteResponse = await client.get('/api/now/table/sys_properties', {
|
|
194
|
+
params: {
|
|
195
|
+
sysparm_query: `name=${outputMarker}`,
|
|
196
|
+
sysparm_fields: 'sys_id',
|
|
197
|
+
sysparm_limit: 1
|
|
198
|
+
}
|
|
199
|
+
});
|
|
200
|
+
if (propDeleteResponse.data?.result?.[0]?.sys_id) {
|
|
201
|
+
await client.delete(`/api/now/table/sys_properties/${propDeleteResponse.data.result[0].sys_id}`);
|
|
202
|
+
}
|
|
203
|
+
}
|
|
204
|
+
catch (propCleanupError) {
|
|
205
|
+
// Ignore cleanup errors
|
|
206
|
+
}
|
|
207
|
+
// Step 5: Return results
|
|
208
|
+
if (result) {
|
|
209
|
+
return (0, error_handler_js_1.createSuccessResult)({
|
|
210
|
+
execution_id: executionId,
|
|
211
|
+
success: result.success,
|
|
212
|
+
result: result.result,
|
|
213
|
+
error: result.error,
|
|
214
|
+
output: capture_output ? result.output : undefined,
|
|
215
|
+
execution_time_ms: result.executionTimeMs
|
|
216
|
+
}, {
|
|
217
|
+
operation: 'sync_script_execution',
|
|
218
|
+
method: 'sysauto_script_with_trigger'
|
|
219
|
+
});
|
|
220
|
+
}
|
|
221
|
+
else {
|
|
222
|
+
// Script may not have run or output wasn't captured
|
|
223
|
+
return (0, error_handler_js_1.createSuccessResult)({
|
|
224
|
+
execution_id: executionId,
|
|
225
|
+
success: true,
|
|
226
|
+
result: null,
|
|
227
|
+
message: 'Script was saved but execution could not be confirmed. The sys_trigger may not have been created (permissions) or the scheduler has not yet picked it up.',
|
|
228
|
+
scheduled_job_sys_id: jobSysId,
|
|
229
|
+
manual_run_url: `Navigate to System Scheduler > Scheduled Jobs and run: ${jobName}`
|
|
230
|
+
}, {
|
|
231
|
+
operation: 'sync_script_execution',
|
|
232
|
+
method: 'scheduled_job_pending'
|
|
233
|
+
});
|
|
100
234
|
}
|
|
101
|
-
return (0, error_handler_js_1.createSuccessResult)({
|
|
102
|
-
execution_id: executionId,
|
|
103
|
-
success: result.success,
|
|
104
|
-
result: result.result,
|
|
105
|
-
execution_time_ms: result.executionTime || 0,
|
|
106
|
-
error: result.error || null
|
|
107
|
-
}, {
|
|
108
|
-
operation: 'sync_script_execution',
|
|
109
|
-
timeout_ms: timeout
|
|
110
|
-
});
|
|
111
235
|
}
|
|
112
236
|
catch (error) {
|
|
113
237
|
return (0, error_handler_js_1.createErrorResult)(error instanceof error_handler_js_1.SnowFlowError
|
|
@@ -115,6 +239,29 @@ JSON.stringify(result);
|
|
|
115
239
|
: new error_handler_js_1.SnowFlowError(error_handler_js_1.ErrorType.UNKNOWN_ERROR, error.message, { originalError: error }));
|
|
116
240
|
}
|
|
117
241
|
}
|
|
242
|
+
function validateES5(code) {
|
|
243
|
+
const violations = [];
|
|
244
|
+
const patterns = [
|
|
245
|
+
{ regex: /\b(const|let)\s+/g, type: 'const/let', fix: "Use 'var'" },
|
|
246
|
+
{ regex: /\([^)]*\)\s*=>/g, type: 'arrow_function', fix: 'Use function() {}' },
|
|
247
|
+
{ regex: /`[^`]*`/g, type: 'template_literal', fix: 'Use string concatenation' },
|
|
248
|
+
{ regex: /\{[^}]+\}\s*=\s*/g, type: 'destructuring', fix: 'Use explicit properties' },
|
|
249
|
+
{ regex: /for\s*\([^)]*\s+of\s+/g, type: 'for_of', fix: 'Use traditional for loop' },
|
|
250
|
+
{ regex: /class\s+\w+/g, type: 'class', fix: 'Use function constructor' }
|
|
251
|
+
];
|
|
252
|
+
patterns.forEach(({ regex, type, fix }) => {
|
|
253
|
+
let match;
|
|
254
|
+
while ((match = regex.exec(code)) !== null) {
|
|
255
|
+
violations.push({
|
|
256
|
+
type,
|
|
257
|
+
line: code.substring(0, match.index).split('\n').length,
|
|
258
|
+
code: match[0],
|
|
259
|
+
fix
|
|
260
|
+
});
|
|
261
|
+
}
|
|
262
|
+
});
|
|
263
|
+
return { valid: violations.length === 0, violations };
|
|
264
|
+
}
|
|
118
265
|
exports.version = '1.0.0';
|
|
119
266
|
exports.author = 'Snow-Flow SDK Migration';
|
|
120
267
|
//# sourceMappingURL=snow_execute_script_sync.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"snow_execute_script_sync.js","sourceRoot":"","sources":["../../../../../src/mcp/servicenow-mcp-unified/tools/automation/snow_execute_script_sync.ts"],"names":[],"mappings":";AAAA
|
|
1
|
+
{"version":3,"file":"snow_execute_script_sync.js","sourceRoot":"","sources":["../../../../../src/mcp/servicenow-mcp-unified/tools/automation/snow_execute_script_sync.ts"],"names":[],"mappings":";AAAA;;;;;;;;GAQG;;;AA0CH,0BAoNC;AA3PD,kDAA8D;AAC9D,oEAAiH;AAEpG,QAAA,cAAc,GAAsB;IAC/C,IAAI,EAAE,0BAA0B;IAChC,WAAW,EAAE,+EAA+E;IAC5F,gDAAgD;IAChD,QAAQ,EAAE,YAAY;IACtB,WAAW,EAAE,kBAAkB;IAC/B,SAAS,EAAE,CAAC,YAAY,EAAE,SAAS,EAAE,aAAa,CAAC;IACnD,UAAU,EAAE,cAAc;IAC1B,SAAS,EAAE,QAAQ;IAEnB,yBAAyB;IACzB,sEAAsE;IACtE,UAAU,EAAE,OAAO;IACnB,YAAY,EAAE,CAAC,WAAW,EAAE,OAAO,CAAC;IACpC,WAAW,EAAE;QACX,IAAI,EAAE,QAAQ;QACd,UAAU,EAAE;YACV,MAAM,EAAE;gBACN,IAAI,EAAE,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,GAAG,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,KAAK,IAAI,EAAE,CAAC;YAC3C,UAAU,CAAC,IAAI,CAAC;gBACd,IAAI;gBACJ,IAAI,EAAE,IAAI,CAAC,SAAS,CAAC,CAAC,EAAE,KAAK,CAAC,KAAK,CAAC,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC,MAAM;gBACvD,IAAI,EAAE,KAAK,CAAC,CAAC,CAAC;gBACd,GAAG;aACJ,CAAC,CAAC;QACL,CAAC;IACH,CAAC,CAAC,CAAC;IAEH,OAAO,EAAE,KAAK,EAAE,UAAU,CAAC,MAAM,KAAK,CAAC,EAAE,UAAU,EAAE,CAAC;AACxD,CAAC;AAEY,QAAA,OAAO,GAAG,OAAO,CAAC;AAClB,QAAA,MAAM,GAAG,yBAAyB,CAAC"}
|
package/dist/mcp/servicenow-mcp-unified/tools/automation/snow_execute_script_with_output.d.ts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* snow_execute_script_with_output - Execute
|
|
2
|
+
* snow_execute_script_with_output - Execute scripts with full output capture
|
|
3
3
|
*
|
|
4
|
-
* Execute server-side JavaScript in ServiceNow
|
|
5
|
-
*
|
|
4
|
+
* Execute server-side JavaScript in ServiceNow with comprehensive output capture
|
|
5
|
+
* using Fix Scripts. Captures gs.print, gs.info, gs.warn, gs.error.
|
|
6
6
|
*
|
|
7
7
|
* ⚠️ CRITICAL: ALL SCRIPTS MUST BE ES5 ONLY!
|
|
8
8
|
* ServiceNow runs on Rhino engine - no const/let/arrow functions/template literals.
|
package/dist/mcp/servicenow-mcp-unified/tools/automation/snow_execute_script_with_output.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"snow_execute_script_with_output.d.ts","sourceRoot":"","sources":["../../../../../src/mcp/servicenow-mcp-unified/tools/automation/snow_execute_script_with_output.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,EAAE,iBAAiB,EAAE,iBAAiB,EAAE,UAAU,EAAE,MAAM,uBAAuB,CAAC;AAIzF,eAAO,MAAM,cAAc,EAAE,
|
|
1
|
+
{"version":3,"file":"snow_execute_script_with_output.d.ts","sourceRoot":"","sources":["../../../../../src/mcp/servicenow-mcp-unified/tools/automation/snow_execute_script_with_output.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,EAAE,iBAAiB,EAAE,iBAAiB,EAAE,UAAU,EAAE,MAAM,uBAAuB,CAAC;AAIzF,eAAO,MAAM,cAAc,EAAE,iBAwC5B,CAAC;AAEF,wBAAsB,OAAO,CAAC,IAAI,EAAE,GAAG,EAAE,OAAO,EAAE,iBAAiB,GAAG,OAAO,CAAC,UAAU,CAAC,CA4PxF;AA6BD,eAAO,MAAM,OAAO,UAAU,CAAC;AAC/B,eAAO,MAAM,MAAM,4BAA4B,CAAC"}
|