s9n-devops-agent 2.0.5 → 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/package.json +1 -1
- package/src/session-coordinator.js +38 -3
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;
|