snow-flow 1.3.7 → 1.3.8

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 CHANGED
@@ -153,6 +153,7 @@ program
153
153
  (objective.toLowerCase().includes('flow') &&
154
154
  !objective.toLowerCase().includes('workflow') &&
155
155
  !objective.toLowerCase().includes('data flow'));
156
+ let xmlFlowResult = null;
156
157
  if (isFlowDesignerTask) {
157
158
  cliLogger.info('\nšŸ”§ Flow Designer Detected - Using XML-First Approach!');
158
159
  cliLogger.info('šŸ“‹ Creating production-ready ServiceNow flow XML...');
@@ -238,6 +239,7 @@ program
238
239
  // Generate XML
239
240
  cliLogger.info('šŸ—ļø Generating production XML...');
240
241
  const result = generateProductionFlowXML(flowDef);
242
+ xmlFlowResult = { ...result, flowDefinition: flowDef };
241
243
  cliLogger.info(`\nāœ… XML Generated Successfully!`);
242
244
  cliLogger.info(`šŸ“ File saved to: ${result.filePath}`);
243
245
  cliLogger.info(`šŸ“Š Flow structure:`);
@@ -267,8 +269,8 @@ program
267
269
  else {
268
270
  cliLogger.info('šŸ“‹ Use the import instructions above to deploy to ServiceNow');
269
271
  }
270
- cliLogger.info('\nšŸ’” Tip: For additional ServiceNow features beyond flows, run swarm again for widgets/scripts/etc.');
271
- return; // Exit early for Flow Designer flows
272
+ cliLogger.info('\nšŸ’” XML template generated. Now launching Queen Agent for intelligent flow development...');
273
+ // DO NOT RETURN HERE - Continue to Queen Agent orchestration!
272
274
  }
273
275
  catch (error) {
274
276
  cliLogger.error('āŒ XML flow generation failed:', error instanceof Error ? error.message : String(error));
@@ -278,7 +280,7 @@ program
278
280
  // Start real Claude Code orchestration
279
281
  try {
280
282
  // Generate the Queen Agent orchestration prompt
281
- const orchestrationPrompt = buildQueenAgentPrompt(objective, taskAnalysis, options, isAuthenticated, sessionId);
283
+ const orchestrationPrompt = buildQueenAgentPrompt(objective, taskAnalysis, options, isAuthenticated, sessionId, xmlFlowResult);
282
284
  cliLogger.info('\nšŸ‘‘ Initializing Queen Agent orchestration...');
283
285
  cliLogger.info('šŸŽÆ Queen Agent will coordinate the following:');
284
286
  cliLogger.info(` - Analyze objective: "${objective}"`);
@@ -342,22 +344,31 @@ program
342
344
  });
343
345
  }
344
346
  else {
345
- cliLogger.info('\nšŸ“‹ Claude Code manual execution required');
346
- cliLogger.info('\nšŸ‘‘ QUEEN AGENT ORCHESTRATION PROMPT:');
347
+ cliLogger.info('\nšŸš€ SNOW-FLOW ORCHESTRATION COMPLETE!');
348
+ cliLogger.info('šŸ¤– Now it\'s time for Claude Code agents to do the work...\n');
349
+ cliLogger.info('šŸ‘‘ QUEEN AGENT ORCHESTRATION PROMPT FOR CLAUDE CODE:');
347
350
  cliLogger.info('='.repeat(80));
348
351
  cliLogger.info(orchestrationPrompt);
349
352
  cliLogger.info('='.repeat(80));
350
- cliLogger.info('\nāœ… Queen Agent orchestration prompt generated!');
351
- cliLogger.info('šŸ“Š Next Steps:');
352
- cliLogger.info(' 1. Copy the above prompt and paste it into Claude Code');
353
- cliLogger.info(' 2. Queen Agent will analyze and spawn specialized agents');
354
- cliLogger.info(' 3. Agents will coordinate through shared memory');
355
- cliLogger.info(' 4. Monitor progress through TodoRead and Memory tools');
353
+ cliLogger.info('\nāœ… Snow-Flow has prepared the orchestration!');
354
+ cliLogger.info('šŸ“Š CRITICAL NEXT STEPS:');
355
+ cliLogger.info(' 1. Copy the ENTIRE prompt above');
356
+ cliLogger.info(' 2. Paste it into Claude Code (the AI assistant)');
357
+ cliLogger.info(' 3. Claude Code will spawn multiple specialized agents as workhorses');
358
+ cliLogger.info(' 4. These agents will implement your flow with all required logic');
359
+ cliLogger.info(' 5. Agents will enhance the basic XML template with real functionality');
360
+ cliLogger.info('\nšŸŽÆ Remember:');
361
+ cliLogger.info(' - Snow-Flow = Orchestrator (coordinates the work)');
362
+ cliLogger.info(' - Claude Code = Workhorses (implement the solution)');
363
+ if (xmlFlowResult) {
364
+ cliLogger.info(`\nšŸ“ XML template saved at: ${xmlFlowResult.filePath}`);
365
+ cliLogger.info(' āš ļø This is just a BASIC template - agents must enhance it!');
366
+ }
356
367
  if (isAuthenticated && options.autoDeploy) {
357
- cliLogger.info(' 5. Real artifacts will be created in ServiceNow');
368
+ cliLogger.info('\nšŸš€ Deployment Mode: Agents will create REAL artifacts in ServiceNow');
358
369
  }
359
370
  else {
360
- cliLogger.info(' 5. Planning mode - no real artifacts created');
371
+ cliLogger.info('\nšŸ“‹ Planning Mode: Analysis and recommendations only');
361
372
  }
362
373
  cliLogger.info(`\nšŸ’¾ Session ID for monitoring: ${sessionId}`);
363
374
  }
@@ -373,43 +384,13 @@ program
373
384
  });
374
385
  // Helper function to execute Claude Code directly (FALLBACK ONLY)
375
386
  async function executeClaudeCode(prompt) {
376
- return new Promise((resolve) => {
377
- cliLogger.info('šŸ” Checking for Claude Code availability...');
378
- // Try to find Claude Code binary
379
- const claudeCommands = ['claude', 'claude-code', 'npx claude-code'];
380
- let currentCommand = 0;
381
- const tryNextCommand = () => {
382
- if (currentCommand >= claudeCommands.length) {
383
- cliLogger.warn('āŒ Claude Code not found in PATH');
384
- resolve(false);
385
- return;
386
- }
387
- const command = claudeCommands[currentCommand];
388
- cliLogger.debug(`šŸ” Trying: ${command}`);
389
- const claudeArgs = [
390
- '--version'
391
- ];
392
- // Test if Claude Code is available
393
- const testProcess = (0, child_process_1.spawn)(command, claudeArgs, {
394
- stdio: ['ignore', 'pipe', 'pipe']
395
- });
396
- testProcess.on('close', (code) => {
397
- if (code === 0) {
398
- cliLogger.info(`āœ… Found Claude Code: ${command}`);
399
- executeWithClaude(command, prompt, resolve);
400
- }
401
- else {
402
- currentCommand++;
403
- tryNextCommand();
404
- }
405
- });
406
- testProcess.on('error', () => {
407
- currentCommand++;
408
- tryNextCommand();
409
- });
410
- };
411
- tryNextCommand();
412
- });
387
+ cliLogger.info('šŸ¤– Preparing Claude Code agent orchestration...');
388
+ // Claude Code is not a CLI tool - it requires manual interaction
389
+ // Snow-flow is the orchestrator, Claude Code agents are the workhorses
390
+ cliLogger.info('šŸ“‹ Claude Code prompt generated successfully!');
391
+ cliLogger.info('šŸš€ Snow-flow orchestration ready for Claude Code execution');
392
+ // Always return false to show the prompt to the user
393
+ return false;
413
394
  }
414
395
  // Real-time monitoring dashboard for Claude Code process
415
396
  function startMonitoringDashboard(claudeProcess) {
@@ -519,7 +500,7 @@ async function executeWithClaude(claudeCommand, prompt, resolve) {
519
500
  });
520
501
  }
521
502
  // Helper function to build Queen Agent orchestration prompt
522
- function buildQueenAgentPrompt(objective, taskAnalysis, options, isAuthenticated = false, sessionId) {
503
+ function buildQueenAgentPrompt(objective, taskAnalysis, options, isAuthenticated = false, sessionId, xmlFlowResult = null) {
523
504
  // Check if intelligent features are enabled
524
505
  const hasIntelligentFeatures = options.autoPermissions || options.smartDiscovery ||
525
506
  options.liveTesting || options.autoDeploy || options.autoRollback ||
@@ -539,6 +520,23 @@ You are the Queen Agent, master coordinator of the Snow-Flow hive-mind. Your mis
539
520
  - **Supporting Agents**: ${taskAnalysis.supportingAgents.join(', ')}
540
521
  - **Estimated Total Agents**: ${taskAnalysis.estimatedAgentCount}
541
522
  - **ServiceNow Artifacts**: ${taskAnalysis.serviceNowArtifacts.join(', ')}
523
+
524
+ ${xmlFlowResult ? `## šŸ”§ Flow Designer XML Template Generated
525
+ An initial XML template has been created as a starting point:
526
+ - **File Path**: ${xmlFlowResult.filePath}
527
+ - **Flow Name**: ${xmlFlowResult.flowDefinition.name}
528
+ - **Table**: ${xmlFlowResult.flowDefinition.table}
529
+ - **Activities**: ${xmlFlowResult.flowDefinition.activities.length}
530
+
531
+ **IMPORTANT**: This is just a basic template! You must spawn Claude Code agents to:
532
+ 1. Analyze the detailed requirements from the objective
533
+ 2. Design the complete flow logic with all activities
534
+ 3. Add approval steps, notifications, conditions, etc.
535
+ 4. Test the flow implementation
536
+ 5. Deploy to ServiceNow
537
+
538
+ The XML template is saved but needs significant enhancement by your agents!
539
+ ` : ''}
542
540
  - **Recommended Team**: ${getTeamRecommendation(taskAnalysis.taskType)}
543
541
 
544
542
  ## šŸ“Š Table Discovery Intelligence
package/dist/version.js CHANGED
@@ -7,12 +7,18 @@ exports.VERSION_INFO = exports.VERSION = void 0;
7
7
  exports.getVersionString = getVersionString;
8
8
  exports.getLatestFeatures = getLatestFeatures;
9
9
  exports.isLatestVersion = isLatestVersion;
10
- exports.VERSION = '1.3.7';
10
+ exports.VERSION = '1.3.8';
11
11
  exports.VERSION_INFO = {
12
12
  version: exports.VERSION,
13
13
  name: 'Snow-Flow',
14
14
  description: 'ServiceNow Queen Agent - Hive-Mind Intelligence for ServiceNow Development',
15
15
  features: {
16
+ '1.3.8': [
17
+ 'šŸ¤– CLAUDE CODE FIX: Restored proper Claude Code agent spawning',
18
+ 'šŸš€ SWARM ORCHESTRATION: Snow-flow is orchestrator, Claude Code agents are workhorses',
19
+ 'šŸ”§ NO EARLY EXIT: Flow Designer tasks now continue to full agent orchestration',
20
+ 'šŸ“‹ CLEAR INSTRUCTIONS: Better messaging about Snow-flow vs Claude Code roles'
21
+ ],
16
22
  '1.3.7': [
17
23
  'šŸš€ RELEASE VERSION: Combined all fixes from 1.3.2-1.3.6 into stable release',
18
24
  'āœ… ZOD VALIDATION: Completely fixed all configuration schema issues',
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "snow-flow",
3
- "version": "1.3.7",
3
+ "version": "1.3.8",
4
4
  "description": "ServiceNow Queen Agent - Hive-Mind Intelligence for ServiceNow Development inspired by claude-flow. Transform complex workflows into elegant one-command orchestration.",
5
5
  "main": "dist/index.js",
6
6
  "type": "commonjs",