s9n-devops-agent 1.4.9 → 1.5.1

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
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "s9n-devops-agent",
3
- "version": "1.4.9",
3
+ "version": "1.5.1",
4
4
  "description": "CS_DevOpsAgent - Intelligent Git Automation System with multi-agent support and session management",
5
5
  "type": "module",
6
6
  "main": "src/cs-devops-agent-worker.js",
@@ -879,7 +879,7 @@ class SessionCoordinator {
879
879
  // Check for Docker configuration and ask about restart preference
880
880
  let dockerConfig = null;
881
881
 
882
- // Check if user has already set "Never ask" preference
882
+ // Check if user has already set "Never ask" preference (ONCE, at the top)
883
883
  const projectSettings = this.loadProjectSettings();
884
884
  if (projectSettings.dockerConfig && projectSettings.dockerConfig.neverAsk === true) {
885
885
  // User selected 'Never' - skip Docker configuration entirely
@@ -888,6 +888,7 @@ class SessionCoordinator {
888
888
  const dockerInfo = hasDockerConfiguration(process.cwd());
889
889
 
890
890
  if (dockerInfo.hasCompose || dockerInfo.hasDockerfile) {
891
+ // Docker detected - show what we found and ask about restart preferences
891
892
  console.log(`\n${CONFIG.colors.yellow}Docker Configuration Detected${CONFIG.colors.reset}`);
892
893
 
893
894
  if (dockerInfo.hasCompose) {
@@ -901,36 +902,49 @@ class SessionCoordinator {
901
902
  console.log(`${CONFIG.colors.dim}Found Dockerfile${CONFIG.colors.reset}`);
902
903
  }
903
904
 
905
+ // promptForDockerConfig already handles Y/N/A/Never options
904
906
  dockerConfig = await this.promptForDockerConfig();
907
+ } else if (projectSettings.dockerConfig && projectSettings.dockerConfig.alwaysEnabled) {
908
+ // Use saved configuration even if Docker not auto-detected
909
+ console.log(`\n${CONFIG.colors.dim}Using saved Docker configuration${CONFIG.colors.reset}`);
910
+ dockerConfig = projectSettings.dockerConfig;
905
911
  } else {
906
- // No Docker configuration found - check saved preference first
907
- // CRITICAL: Check neverAsk before any prompting
908
- if (projectSettings.dockerConfig && projectSettings.dockerConfig.neverAsk === true) {
909
- // User selected 'Never' - skip Docker configuration entirely
912
+ // No Docker detected and no saved preference - ask user
913
+ const rl = readline.createInterface({
914
+ input: process.stdin,
915
+ output: process.stdout
916
+ });
917
+
918
+ console.log(`\n${CONFIG.colors.yellow}No Docker Configuration Found${CONFIG.colors.reset}`);
919
+ console.log(`${CONFIG.colors.dim}I couldn't find any docker-compose files in:${CONFIG.colors.reset}`);
920
+ console.log(`${CONFIG.colors.dim} • Project directory${CONFIG.colors.reset}`);
921
+ console.log(`${CONFIG.colors.dim} • Parent directory${CONFIG.colors.reset}`);
922
+ console.log(`${CONFIG.colors.dim} • Parent/Infrastructure or parent/infrastructure${CONFIG.colors.reset}`);
923
+ console.log();
924
+ console.log(`${CONFIG.colors.bright}Options:${CONFIG.colors.reset}`);
925
+ console.log(` ${CONFIG.colors.green}Y${CONFIG.colors.reset}) Yes - I have a Docker setup to configure`);
926
+ console.log(` ${CONFIG.colors.red}N${CONFIG.colors.reset}) No - Skip for this session`);
927
+ console.log(` ${CONFIG.colors.magenta}Never${CONFIG.colors.reset}) Never ask again (permanently disable)`);
928
+
929
+ const answer = await new Promise((resolve) => {
930
+ rl.question(`\nDo you have a Docker setup? (Y/N/Never) [N]: `, (ans) => {
931
+ resolve(ans.trim().toLowerCase());
932
+ });
933
+ });
934
+
935
+ // Handle 'Never' option
936
+ if (answer === 'never' || answer === 'nev') {
937
+ rl.close();
938
+ projectSettings.dockerConfig = {
939
+ enabled: false,
940
+ neverAsk: true
941
+ };
942
+ this.saveProjectSettings(projectSettings);
943
+ console.log(`${CONFIG.colors.dim}Docker configuration disabled permanently. Edit local_deploy/project-settings.json to change.${CONFIG.colors.reset}`);
910
944
  dockerConfig = { enabled: false, neverAsk: true };
911
- } else if (projectSettings.dockerConfig && projectSettings.dockerConfig.alwaysEnabled) {
912
- // Use saved configuration even if Docker not auto-detected
913
- console.log(`\n${CONFIG.colors.dim}Using saved Docker configuration${CONFIG.colors.reset}`);
914
- dockerConfig = projectSettings.dockerConfig;
915
945
  } else {
916
- // Prompt user
917
- const rl = readline.createInterface({
918
- input: process.stdin,
919
- output: process.stdout
920
- });
921
-
922
- console.log(`\n${CONFIG.colors.yellow}No Docker Configuration Found${CONFIG.colors.reset}`);
923
- console.log(`${CONFIG.colors.dim}I couldn't find any docker-compose files in:${CONFIG.colors.reset}`);
924
- console.log(`${CONFIG.colors.dim} • Project directory${CONFIG.colors.reset}`);
925
- console.log(`${CONFIG.colors.dim} • Parent directory${CONFIG.colors.reset}`);
926
- console.log(`${CONFIG.colors.dim} • Parent/Infrastructure or parent/infrastructure${CONFIG.colors.reset}`);
927
-
928
- const hasDocker = await new Promise((resolve) => {
929
- rl.question(`\nDo you have a Docker setup you'd like to configure? (y/N): `, (answer) => {
930
- resolve(answer.toLowerCase() === 'y' || answer.toLowerCase() === 'yes');
931
- });
932
- });
933
-
946
+ const hasDocker = answer === 'y' || answer === 'yes';
947
+
934
948
  if (hasDocker) {
935
949
  const dockerPath = await new Promise((resolve) => {
936
950
  rl.question(`\nEnter the full path to your docker-compose file: `, (answer) => {
@@ -1551,20 +1565,14 @@ The DevOps agent is monitoring this worktree for changes.
1551
1565
 
1552
1566
  console.log(`\n${CONFIG.colors.yellow}Starting agent for session ${session.sessionId}...${CONFIG.colors.reset}`);
1553
1567
 
1554
- // Start the agent first
1568
+ // Start the agent
1555
1569
  await this.startAgent(session.sessionId);
1556
1570
 
1557
1571
  // Wait for agent to initialize and show its interactive commands
1558
1572
  await new Promise(resolve => setTimeout(resolve, 3000));
1559
1573
 
1560
- // Now display the instructions AFTER the agent is running
1561
- console.log('\n'.repeat(2)); // Add some spacing
1562
- // Create instructions object with worktreePath for display
1563
- const instructionsForDisplay = {
1564
- worktreePath: session.worktreePath,
1565
- sessionId: session.sessionId
1566
- };
1567
- this.displayInstructions(instructionsForDisplay, session.sessionId, options.task || 'development');
1574
+ // Instructions were already displayed by createSession() - no need to display again
1575
+ // This prevents duplicate copy-paste instructions
1568
1576
 
1569
1577
  return session;
1570
1578
  }
@@ -41,7 +41,7 @@ show_copyright() {
41
41
  echo "======================================================================"
42
42
  echo
43
43
  echo " CS_DevOpsAgent - Intelligent Git Automation System"
44
- echo " Version 1.4.9 | Build 20251009.1"
44
+ echo " Version 1.5.1 | Build 20251009.3"
45
45
  echo " "
46
46
  echo " Copyright (c) 2024 SecondBrain Labs"
47
47
  echo " Author: Sachin Dev Duggal"
@@ -62,36 +62,8 @@ show_header() {
62
62
  echo
63
63
  }
64
64
 
65
- # Function to display session instructions
66
- display_instructions() {
67
- local session_id="$1"
68
- local worktree_path="$2"
69
- local branch_name="$3"
70
- local task="$4"
71
-
72
- echo
73
- echo -e "${BG_GREEN}${BOLD} Instructions for Your Coding Agent ${NC}"
74
- echo
75
- echo -e "${YELLOW}══════════════════════════════════════════════════════════════${NC}"
76
- echo -e "${BOLD}COPY AND PASTE THIS ENTIRE BLOCK INTO YOUR CODING AGENT BEFORE YOUR PROMPT:${NC}"
77
- echo -e "${YELLOW}──────────────────────────────────────────────────────────────${NC}"
78
- echo
79
- echo "I'm working in a DevOps-managed session with the following setup:"
80
- echo "- Session ID: ${session_id}"
81
- echo "- Working Directory: ${worktree_path}"
82
- echo "- Task: ${task}"
83
- echo ""
84
- echo "Please switch to this directory before making any changes:"
85
- echo "cd \"${worktree_path}\""
86
- echo ""
87
- echo "Write commit messages to: .devops-commit-${session_id}.msg"
88
- echo "The DevOps agent will automatically commit and push changes."
89
- echo
90
- echo -e "${YELLOW}══════════════════════════════════════════════════════════════${NC}"
91
- echo
92
- echo -e "${GREEN}✓ DevOps agent will monitor for changes${NC}"
93
- echo
94
- }
65
+ # NOTE: display_instructions function removed - session coordinator handles this now
66
+ # to prevent duplicate copy-paste instructions
95
67
 
96
68
  # Function to list existing sessions
97
69
  list_sessions() {