@misterhuydo/sentinel 1.4.72 → 1.4.73

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.
@@ -1,6 +1,6 @@
1
1
  {
2
- "message": "Auto-checkpoint at 2026-03-26T18:49:49.152Z",
3
- "checkpoint_at": "2026-03-26T18:49:49.153Z",
2
+ "message": "Auto-checkpoint at 2026-03-26T19:12:24.024Z",
3
+ "checkpoint_at": "2026-03-26T19:12:24.038Z",
4
4
  "active_files": [],
5
5
  "notes": [],
6
6
  "mtime_snapshot": {}
package/lib/add.js CHANGED
@@ -289,24 +289,46 @@ async function addFromGit(gitUrl, workspace) {
289
289
  if (existingAccess.ok) {
290
290
  ok(`${repoSlug}: reachable via existing SSH key — skipping deploy key generation`);
291
291
  } else {
292
+ const keyAlreadyExisted = fs.existsSync(path.join(os.homedir(), '.ssh', `${repoSlug}.key`));
292
293
  const { keyFile: generatedKey } = generateDeployKey(repoSlug);
293
294
  keyFile = generatedKey;
294
- printDeployKeyInstructions(orgRepo, keyFile);
295
-
296
- await prompts({
297
- type: 'text', name: '_', format: () => '',
298
- message: chalk.bold(`Press Enter once you've added the deploy key to GitHub…`),
299
- }, { onCancel: () => process.exit(0) });
300
-
301
- // Validate primary repo with deploy key
302
- const primary = validateAccess(gitUrl, keyFile);
303
- if (!primary.ok) {
304
- console.error(chalk.red(' Cannot reach ' + gitUrl));
305
- if (primary.stderr) console.error(chalk.red(' ' + primary.stderr));
306
- console.error(chalk.yellow(' Check the deploy key has write access, then re-run.'));
307
- process.exit(1);
295
+
296
+ // If key already existed, try it immediately — skip prompt if it works
297
+ if (keyAlreadyExisted) {
298
+ const primary = validateAccess(gitUrl, keyFile);
299
+ if (primary.ok) {
300
+ ok(`${repoSlug}: reachable (reusing existing deploy key)`);
301
+ } else {
302
+ // Key exists but doesn't work (e.g. not yet added to GitHub) — show instructions
303
+ printDeployKeyInstructions(orgRepo, keyFile);
304
+ await prompts({
305
+ type: 'text', name: '_', format: () => '',
306
+ message: chalk.bold(`Press Enter once you've added the deploy key to GitHub…`),
307
+ }, { onCancel: () => process.exit(0) });
308
+ const retry = validateAccess(gitUrl, keyFile);
309
+ if (!retry.ok) {
310
+ console.error(chalk.red(' ✖ Cannot reach ' + gitUrl));
311
+ if (retry.stderr) console.error(chalk.red(' ' + retry.stderr));
312
+ console.error(chalk.yellow(' Check the deploy key has write access, then re-run.'));
313
+ process.exit(1);
314
+ }
315
+ ok(`${repoSlug}: reachable`);
316
+ }
317
+ } else {
318
+ printDeployKeyInstructions(orgRepo, keyFile);
319
+ await prompts({
320
+ type: 'text', name: '_', format: () => '',
321
+ message: chalk.bold(`Press Enter once you've added the deploy key to GitHub…`),
322
+ }, { onCancel: () => process.exit(0) });
323
+ const primary = validateAccess(gitUrl, keyFile);
324
+ if (!primary.ok) {
325
+ console.error(chalk.red(' ✖ Cannot reach ' + gitUrl));
326
+ if (primary.stderr) console.error(chalk.red(' ' + primary.stderr));
327
+ console.error(chalk.yellow(' Check the deploy key has write access, then re-run.'));
328
+ process.exit(1);
329
+ }
330
+ ok(`${repoSlug}: reachable`);
308
331
  }
309
- ok(`${repoSlug}: reachable`);
310
332
  }
311
333
 
312
334
  // ── 2. Clone primary repo and discover additional repos ────────────────────
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@misterhuydo/sentinel",
3
- "version": "1.4.72",
3
+ "version": "1.4.73",
4
4
  "description": "Sentinel — Autonomous DevOps Agent installer and manager",
5
5
  "bin": {
6
6
  "sentinel": "./bin/sentinel.js"