s9n-devops-agent 2.0.4 → 2.0.6
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/bin/cs-devops-agent +11 -19
- package/package.json +1 -1
- package/src/session-coordinator.js +38 -3
package/bin/cs-devops-agent
CHANGED
|
@@ -51,27 +51,19 @@ switch(command) {
|
|
|
51
51
|
case 'start':
|
|
52
52
|
case 'session':
|
|
53
53
|
// Start interactive session manager
|
|
54
|
-
//
|
|
55
|
-
const sessionScript = join(rootDir, 'start-devops-session.sh');
|
|
56
|
-
|
|
54
|
+
// On Windows, always use Node.js coordinator (bash may not be available)
|
|
57
55
|
if (process.platform === 'win32') {
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
try {
|
|
61
|
-
execSync('bash --version', { stdio: 'ignore' });
|
|
62
|
-
// Bash is available, use the shell script
|
|
63
|
-
runShellScript(sessionScript, args.slice(1));
|
|
64
|
-
} catch (e) {
|
|
65
|
-
// Bash not available, use Node.js session coordinator directly
|
|
66
|
-
console.log('Starting DevOps Agent session manager...\n');
|
|
67
|
-
runScript(join(rootDir, 'src', 'session-coordinator.js'), ['start', ...args.slice(1)]);
|
|
68
|
-
}
|
|
69
|
-
});
|
|
70
|
-
} else if (fs.existsSync(sessionScript)) {
|
|
71
|
-
runShellScript(sessionScript, args.slice(1));
|
|
56
|
+
console.log('Starting DevOps Agent session manager...\n');
|
|
57
|
+
runScript(join(rootDir, 'src', 'session-coordinator.js'), ['start', ...args.slice(1)]);
|
|
72
58
|
} else {
|
|
73
|
-
|
|
74
|
-
|
|
59
|
+
// Unix/Mac: use bash script
|
|
60
|
+
const sessionScript = join(rootDir, 'start-devops-session.sh');
|
|
61
|
+
if (fs.existsSync(sessionScript)) {
|
|
62
|
+
runShellScript(sessionScript, args.slice(1));
|
|
63
|
+
} else {
|
|
64
|
+
console.error('Session script not found. Please ensure the package is properly installed.');
|
|
65
|
+
process.exit(1);
|
|
66
|
+
}
|
|
75
67
|
}
|
|
76
68
|
break;
|
|
77
69
|
|
package/package.json
CHANGED
|
@@ -1960,11 +1960,12 @@ The DevOps agent is monitoring this worktree for changes.
|
|
|
1960
1960
|
|
|
1961
1961
|
async function main() {
|
|
1962
1962
|
// Display copyright and license information immediately
|
|
1963
|
+
const packageJson = JSON.parse(fs.readFileSync(path.join(__dirname, '..', 'package.json'), 'utf8'));
|
|
1963
1964
|
console.log();
|
|
1964
1965
|
console.log("=".repeat(70));
|
|
1965
1966
|
console.log();
|
|
1966
1967
|
console.log(" CS_DevOpsAgent - Intelligent Git Automation System");
|
|
1967
|
-
console.log(
|
|
1968
|
+
console.log(` Version ${packageJson.version} | Build ${new Date().toISOString().split('T')[0].replace(/-/g, '')}`);
|
|
1968
1969
|
console.log(" ");
|
|
1969
1970
|
console.log(" Copyright (c) 2024 SecondBrain Labs");
|
|
1970
1971
|
console.log(" Author: Sachin Dev Duggal");
|
|
@@ -1999,8 +2000,42 @@ async function main() {
|
|
|
1999
2000
|
// Start agent for a session
|
|
2000
2001
|
const sessionId = args[1];
|
|
2001
2002
|
if (!sessionId) {
|
|
2002
|
-
|
|
2003
|
-
|
|
2003
|
+
// No session ID provided - show interactive menu
|
|
2004
|
+
console.log(`${CONFIG.colors.bright}DevOps Agent Session Manager${CONFIG.colors.reset}\n`);
|
|
2005
|
+
console.log('What would you like to do?\n');
|
|
2006
|
+
console.log(` ${CONFIG.colors.green}1${CONFIG.colors.reset} - Create a new session`);
|
|
2007
|
+
console.log(` ${CONFIG.colors.green}2${CONFIG.colors.reset} - List existing sessions`);
|
|
2008
|
+
console.log(` ${CONFIG.colors.green}3${CONFIG.colors.reset} - Close a session`);
|
|
2009
|
+
console.log(` ${CONFIG.colors.green}q${CONFIG.colors.reset} - Quit\n`);
|
|
2010
|
+
|
|
2011
|
+
const rl = readline.createInterface({
|
|
2012
|
+
input: process.stdin,
|
|
2013
|
+
output: process.stdout
|
|
2014
|
+
});
|
|
2015
|
+
|
|
2016
|
+
const choice = await new Promise(resolve => {
|
|
2017
|
+
rl.question('Enter your choice: ', resolve);
|
|
2018
|
+
});
|
|
2019
|
+
rl.close();
|
|
2020
|
+
|
|
2021
|
+
switch(choice) {
|
|
2022
|
+
case '1':
|
|
2023
|
+
await coordinator.createAndStart({});
|
|
2024
|
+
break;
|
|
2025
|
+
case '2':
|
|
2026
|
+
coordinator.listSessions();
|
|
2027
|
+
break;
|
|
2028
|
+
case '3':
|
|
2029
|
+
await coordinator.selectAndCloseSession();
|
|
2030
|
+
break;
|
|
2031
|
+
case 'q':
|
|
2032
|
+
case 'Q':
|
|
2033
|
+
console.log('Goodbye!');
|
|
2034
|
+
break;
|
|
2035
|
+
default:
|
|
2036
|
+
console.log(`${CONFIG.colors.red}Invalid choice${CONFIG.colors.reset}`);
|
|
2037
|
+
}
|
|
2038
|
+
break;
|
|
2004
2039
|
}
|
|
2005
2040
|
await coordinator.startAgent(sessionId);
|
|
2006
2041
|
break;
|