snow-flow 1.3.9 ā 1.3.11
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/cli.js +47 -21
- package/dist/mcp/servicenow-xml-flow-mcp.js +935 -23
- package/dist/utils/improved-flow-xml-generator.js +762 -0
- package/dist/version.js +15 -1
- package/package.json +1 -1
package/dist/cli.js
CHANGED
|
@@ -159,8 +159,8 @@ program
|
|
|
159
159
|
cliLogger.info('š Creating production-ready ServiceNow flow XML...');
|
|
160
160
|
cliLogger.info('š” Reason: Flow Designer flows are most reliable with XML-first approach\n');
|
|
161
161
|
try {
|
|
162
|
-
// Import XML flow generator
|
|
163
|
-
const {
|
|
162
|
+
// Import IMPROVED XML flow generator (fixes "too small to work" issue!)
|
|
163
|
+
const { generateImprovedFlowXML } = await Promise.resolve().then(() => __importStar(require('./utils/improved-flow-xml-generator.js')));
|
|
164
164
|
// Parse instruction to determine activities
|
|
165
165
|
const activities = [];
|
|
166
166
|
const objectiveLower = objective.toLowerCase();
|
|
@@ -236,12 +236,25 @@ program
|
|
|
236
236
|
outputs: { started: 'boolean' }
|
|
237
237
|
}]
|
|
238
238
|
};
|
|
239
|
-
// Generate XML
|
|
240
|
-
cliLogger.info('šļø Generating production XML...');
|
|
241
|
-
|
|
239
|
+
// Generate IMPROVED XML with enhanced structure
|
|
240
|
+
cliLogger.info('šļø Generating IMPROVED production XML...');
|
|
241
|
+
// Convert to improved flow definition
|
|
242
|
+
const improvedFlowDef = {
|
|
243
|
+
...flowDef,
|
|
244
|
+
run_as: 'user',
|
|
245
|
+
accessible_from: 'package_private',
|
|
246
|
+
category: 'custom',
|
|
247
|
+
tags: ['auto-generated'],
|
|
248
|
+
activities: flowDef.activities.map((act) => ({
|
|
249
|
+
...act,
|
|
250
|
+
description: act.description || act.name
|
|
251
|
+
}))
|
|
252
|
+
};
|
|
253
|
+
const result = generateImprovedFlowXML(improvedFlowDef);
|
|
242
254
|
xmlFlowResult = { ...result, flowDefinition: flowDef };
|
|
243
|
-
cliLogger.info(`\nā
XML Generated Successfully!`);
|
|
255
|
+
cliLogger.info(`\nā
IMPROVED XML Generated Successfully!`);
|
|
244
256
|
cliLogger.info(`š File saved to: ${result.filePath}`);
|
|
257
|
+
cliLogger.info(`š„ IMPROVEMENTS: Uses v2 tables, Base64+gzip encoding, complete label_cache!`);
|
|
245
258
|
cliLogger.info(`š Flow structure:`);
|
|
246
259
|
cliLogger.info(` - Name: ${flowDef.name}`);
|
|
247
260
|
cliLogger.info(` - Table: ${flowDef.table}`);
|
|
@@ -399,29 +412,29 @@ async function executeClaudeCode(prompt) {
|
|
|
399
412
|
// Check for MCP config
|
|
400
413
|
const mcpConfigPath = (0, path_1.join)(process.cwd(), '.mcp.json');
|
|
401
414
|
const hasMcpConfig = (0, fs_2.existsSync)(mcpConfigPath);
|
|
402
|
-
// Launch Claude Code with MCP config
|
|
415
|
+
// Launch Claude Code with MCP config and skip permissions to avoid raw mode issues
|
|
403
416
|
const claudeArgs = hasMcpConfig
|
|
404
|
-
? ['--mcp-config', '.mcp.json', '.']
|
|
405
|
-
: ['
|
|
417
|
+
? ['--mcp-config', '.mcp.json', '.', '--dangerously-skip-permissions']
|
|
418
|
+
: ['--dangerously-skip-permissions'];
|
|
406
419
|
cliLogger.info('š Launching Claude Code automatically...');
|
|
407
420
|
if (hasMcpConfig) {
|
|
408
421
|
cliLogger.info('š§ Starting Claude Code with ServiceNow MCP servers...');
|
|
409
422
|
}
|
|
410
|
-
// Start Claude Code process in interactive mode
|
|
423
|
+
// Start Claude Code process in interactive mode with stdin piping
|
|
411
424
|
const claudeProcess = (0, child_process_1.spawn)('claude', claudeArgs, {
|
|
412
|
-
stdio: ['pipe', 'inherit', 'inherit'],
|
|
413
|
-
|
|
425
|
+
stdio: ['pipe', 'inherit', 'inherit'], // pipe stdin, inherit stdout/stderr
|
|
426
|
+
cwd: process.cwd(),
|
|
414
427
|
env: { ...process.env }
|
|
415
428
|
});
|
|
416
|
-
// Send the prompt
|
|
429
|
+
// Send the prompt via stdin
|
|
417
430
|
cliLogger.info('š Sending orchestration prompt to Claude Code...');
|
|
418
431
|
cliLogger.info('š Claude Code interface opening...\n');
|
|
419
|
-
// Write prompt
|
|
432
|
+
// Write prompt to stdin
|
|
420
433
|
claudeProcess.stdin.write(prompt);
|
|
421
434
|
claudeProcess.stdin.end();
|
|
422
435
|
// Set up process monitoring
|
|
423
436
|
return new Promise((resolve) => {
|
|
424
|
-
claudeProcess.on('close', (code) => {
|
|
437
|
+
claudeProcess.on('close', async (code) => {
|
|
425
438
|
if (code === 0) {
|
|
426
439
|
cliLogger.info('\nā
Claude Code session completed successfully!');
|
|
427
440
|
resolve(true);
|
|
@@ -4324,8 +4337,8 @@ program
|
|
|
4324
4337
|
console.log(`\nš§ XML-First Flow Generator v${version_js_1.VERSION}`);
|
|
4325
4338
|
console.log('š Creating production-ready ServiceNow flow XML...\n');
|
|
4326
4339
|
try {
|
|
4327
|
-
// Import XML flow generator
|
|
4328
|
-
const {
|
|
4340
|
+
// Import IMPROVED XML flow generator (fixes "too small to work" issue!)
|
|
4341
|
+
const { generateImprovedFlowXML } = await Promise.resolve().then(() => __importStar(require('./utils/improved-flow-xml-generator.js')));
|
|
4329
4342
|
// Parse instruction to determine activities
|
|
4330
4343
|
const activities = [];
|
|
4331
4344
|
// Check for common patterns in instruction
|
|
@@ -4403,11 +4416,24 @@ return { started: true };`
|
|
|
4403
4416
|
}
|
|
4404
4417
|
];
|
|
4405
4418
|
}
|
|
4406
|
-
// Generate XML
|
|
4407
|
-
console.log('\nšļø Generating production XML...');
|
|
4408
|
-
|
|
4409
|
-
|
|
4419
|
+
// Generate IMPROVED XML with enhanced structure
|
|
4420
|
+
console.log('\nšļø Generating IMPROVED production XML...');
|
|
4421
|
+
// Convert to improved flow definition
|
|
4422
|
+
const improvedFlowDef = {
|
|
4423
|
+
...flowDef,
|
|
4424
|
+
run_as: 'user',
|
|
4425
|
+
accessible_from: 'package_private',
|
|
4426
|
+
category: 'custom',
|
|
4427
|
+
tags: ['cli-generated'],
|
|
4428
|
+
activities: flowDef.activities.map((act) => ({
|
|
4429
|
+
...act,
|
|
4430
|
+
description: act.description || act.name
|
|
4431
|
+
}))
|
|
4432
|
+
};
|
|
4433
|
+
const result = generateImprovedFlowXML(improvedFlowDef);
|
|
4434
|
+
console.log(`\nā
IMPROVED XML Generated Successfully!`);
|
|
4410
4435
|
console.log(`š File saved to: ${result.filePath}`);
|
|
4436
|
+
console.log(`š„ IMPROVEMENTS: Uses v2 tables, Base64+gzip encoding, complete label_cache!`);
|
|
4411
4437
|
console.log(`š Flow structure:`);
|
|
4412
4438
|
console.log(` - Name: ${flowDef.name}`);
|
|
4413
4439
|
console.log(` - Table: ${flowDef.table}`);
|