s9n-devops-agent 1.5.4 → 1.5.5

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.5.4",
3
+ "version": "1.5.5",
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",
@@ -194,6 +194,8 @@ class FileCoordinator {
194
194
 
195
195
  /**
196
196
  * Find our current declaration file
197
+ * Matches files like: warp-8sf9-c9ea.json or claude-8sf9-c9ea.json
198
+ * where sessionId is 8sf9-c9ea
197
199
  */
198
200
  findOurDeclaration() {
199
201
  if (!fs.existsSync(this.activeEditsDir)) {
@@ -202,13 +204,27 @@ class FileCoordinator {
202
204
 
203
205
  const files = fs.readdirSync(this.activeEditsDir);
204
206
 
207
+ // First try: Look for session ID in filename (with or without agent prefix)
208
+ // Handles: warp-8sf9-c9ea.json, claude-8sf9-c9ea.json, 8sf9-c9ea.json
205
209
  for (const file of files) {
206
- if (file.includes(this.sessionId) && file.endsWith('.json')) {
207
- return path.join(this.activeEditsDir, file);
210
+ if (file.endsWith('.json')) {
211
+ // Extract potential session ID from filename
212
+ // Remove .json extension
213
+ const baseName = file.replace('.json', '');
214
+
215
+ // Check if filename ends with our session ID (handles agent-sessionId format)
216
+ if (baseName.endsWith(this.sessionId) || baseName === this.sessionId) {
217
+ return path.join(this.activeEditsDir, file);
218
+ }
219
+
220
+ // Also check if session ID appears anywhere in the filename
221
+ if (file.includes(this.sessionId)) {
222
+ return path.join(this.activeEditsDir, file);
223
+ }
208
224
  }
209
225
  }
210
226
 
211
- // Try to find by session ID in content
227
+ // Second try: Look for session ID in file content
212
228
  for (const file of files) {
213
229
  if (file.endsWith('.json')) {
214
230
  try {
@@ -174,8 +174,37 @@ class SessionCoordinator {
174
174
  console.log(`\n${CONFIG.colors.yellow}▲ Update Available!${CONFIG.colors.reset}`);
175
175
  console.log(`${CONFIG.colors.dim}Current version: ${this.currentVersion}${CONFIG.colors.reset}`);
176
176
  console.log(`${CONFIG.colors.bright}Latest version: ${result}${CONFIG.colors.reset}`);
177
- console.log(`\n${CONFIG.colors.green}To update, run:${CONFIG.colors.reset}`);
178
- console.log(` ${CONFIG.colors.bright}npm install -g s9n-devops-agent@latest${CONFIG.colors.reset}`);
177
+ console.log();
178
+
179
+ // Ask if user wants to update now
180
+ const rl = readline.createInterface({
181
+ input: process.stdin,
182
+ output: process.stdout
183
+ });
184
+
185
+ const updateNow = await new Promise((resolve) => {
186
+ rl.question(`${CONFIG.colors.green}Would you like to update now? (Y/n):${CONFIG.colors.reset} `, (answer) => {
187
+ rl.close();
188
+ resolve(answer.toLowerCase() !== 'n');
189
+ });
190
+ });
191
+
192
+ if (updateNow) {
193
+ console.log(`\n${CONFIG.colors.blue}Updating s9n-devops-agent...${CONFIG.colors.reset}`);
194
+ try {
195
+ execSync('npm install -g s9n-devops-agent@latest', {
196
+ stdio: 'inherit',
197
+ cwd: process.cwd()
198
+ });
199
+ console.log(`\n${CONFIG.colors.green}✓ Update complete! Please restart the agent.${CONFIG.colors.reset}`);
200
+ process.exit(0);
201
+ } catch (err) {
202
+ console.log(`\n${CONFIG.colors.red}✗ Update failed: ${err.message}${CONFIG.colors.reset}`);
203
+ console.log(`${CONFIG.colors.dim}You can manually update with: npm install -g s9n-devops-agent@latest${CONFIG.colors.reset}`);
204
+ }
205
+ } else {
206
+ console.log(`${CONFIG.colors.dim}You can update later with: npm install -g s9n-devops-agent@latest${CONFIG.colors.reset}`);
207
+ }
179
208
  console.log();
180
209
  }
181
210
  } catch (err) {
@@ -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.5.4 | Build 20251009.6"
44
+ echo " Version 1.5.5 | Build 20251009.7"
45
45
  echo " "
46
46
  echo " Copyright (c) 2024 SecondBrain Labs"
47
47
  echo " Author: Sachin Dev Duggal"