@misterhuydo/sentinel 1.0.34 → 1.0.36

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/.cairn/.hint-lock CHANGED
@@ -1 +1 @@
1
- 2026-03-21T20:51:14.848Z
1
+ 2026-03-21T21:21:51.189Z
@@ -1,6 +1,6 @@
1
1
  {
2
- "message": "Auto-checkpoint at 2026-03-21T21:16:28.480Z",
3
- "checkpoint_at": "2026-03-21T21:16:28.481Z",
2
+ "message": "Auto-checkpoint at 2026-03-21T21:41:56.832Z",
3
+ "checkpoint_at": "2026-03-21T21:41:56.833Z",
4
4
  "active_files": [],
5
5
  "notes": [],
6
6
  "mtime_snapshot": {}
package/bin/sentinel.js CHANGED
@@ -35,6 +35,9 @@ async function main() {
35
35
  case 'add':
36
36
  await require('../lib/add')(args[0]);
37
37
  break;
38
+ case 'upgrade':
39
+ await require('../lib/upgrade')();
40
+ break;
38
41
  case 'help':
39
42
  default:
40
43
  printUsage();
@@ -51,6 +54,7 @@ ${chalk.bold('Usage:')}
51
54
  sentinel add <git-url> Add a project pre-configured for a GitHub repo
52
55
  sentinel add <project.json> Add a project from a local JSON config file
53
56
  sentinel add <https://host/cfg.json> Add a project from a remote JSON config URL
57
+ sentinel upgrade Pull latest version and hot-deploy Python source
54
58
 
55
59
  ${chalk.bold('Options:')}
56
60
  --version, -v Print version
package/lib/upgrade.js ADDED
@@ -0,0 +1,73 @@
1
+ 'use strict';
2
+
3
+ const fs = require('fs-extra');
4
+ const path = require('path');
5
+ const os = require('os');
6
+ const { execSync, spawnSync } = require('child_process');
7
+ const chalk = require('chalk');
8
+
9
+ const ok = msg => console.log(chalk.green(' ✔'), msg);
10
+ const info = msg => console.log(chalk.cyan(' →'), msg);
11
+ const warn = msg => console.log(chalk.yellow(' ⚠'), msg);
12
+
13
+ module.exports = async function upgrade() {
14
+ const { version: current } = require('../package.json');
15
+
16
+ // Find the workspace code dir
17
+ const defaultWorkspace = path.join(os.homedir(), 'sentinel');
18
+ const codeDir = path.join(defaultWorkspace, 'code');
19
+ if (!fs.existsSync(codeDir)) {
20
+ console.error(chalk.red(' ✖ Sentinel code directory not found at ' + codeDir));
21
+ console.error(' Run: sentinel init');
22
+ process.exit(1);
23
+ }
24
+
25
+ // Install latest from npm
26
+ info(`Current version: ${current}`);
27
+ info('Installing latest @misterhuydo/sentinel...');
28
+ const install = spawnSync('npm', ['install', '-g', '@misterhuydo/sentinel@latest'], { stdio: 'inherit' });
29
+ if (install.status !== 0) {
30
+ console.error(chalk.red(' ✖ npm install failed'));
31
+ process.exit(1);
32
+ }
33
+
34
+ // Find where npm installed it
35
+ const npmRoot = execSync('npm root -g', { encoding: 'utf8' }).trim();
36
+ const pkgDir = path.join(npmRoot, '@misterhuydo', 'sentinel');
37
+ const src = path.join(pkgDir, 'python');
38
+
39
+ if (!fs.existsSync(src)) {
40
+ console.error(chalk.red(' ✖ Bundled Python source not found in installed package'));
41
+ process.exit(1);
42
+ }
43
+
44
+ // Hot-deploy: copy Python source to code dir
45
+ info('Deploying Python source...');
46
+ fs.copySync(src, codeDir, { overwrite: true });
47
+
48
+ // Restore executable bit on shell scripts (npm strips it)
49
+ const scriptsDir = path.join(codeDir, 'scripts');
50
+ if (fs.existsSync(scriptsDir)) {
51
+ const shFiles = fs.readdirSync(scriptsDir)
52
+ .filter(f => f.endsWith('.sh'))
53
+ .map(f => path.join(scriptsDir, f));
54
+ if (shFiles.length) spawnSync('chmod', ['+x', ...shFiles], { stdio: 'inherit' });
55
+ }
56
+ ok('Python source updated');
57
+
58
+ // Print new version
59
+ const { version: latest } = require(path.join(pkgDir, 'package.json'));
60
+ ok(`Upgraded: ${current} → ${latest}`);
61
+
62
+ // Restart running projects
63
+ const startAll = path.join(defaultWorkspace, 'startAll.sh');
64
+ const stopAll = path.join(defaultWorkspace, 'stopAll.sh');
65
+ if (fs.existsSync(stopAll) && fs.existsSync(startAll)) {
66
+ info('Restarting Sentinel...');
67
+ spawnSync('bash', [stopAll], { stdio: 'inherit' });
68
+ spawnSync('bash', [startAll], { stdio: 'inherit' });
69
+ ok('Sentinel restarted');
70
+ } else {
71
+ warn('No startAll.sh found — restart manually');
72
+ }
73
+ };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@misterhuydo/sentinel",
3
- "version": "1.0.34",
3
+ "version": "1.0.36",
4
4
  "description": "Sentinel — Autonomous DevOps Agent installer and manager",
5
5
  "bin": {
6
6
  "sentinel": "./bin/sentinel.js"
@@ -33,6 +33,42 @@ Your job:
33
33
  - Control Sentinel (pause/resume) when asked
34
34
  - Give honest, concise answers — you know this system inside out
35
35
 
36
+ What you can do (tools available):
37
+
38
+ 1. get_status — Show recent errors detected, fixes applied/pending, open PRs.
39
+ e.g. "what happened today?", "any issues?", "show open PRs"
40
+
41
+ 2. create_issue — Queue a manual fix request for Sentinel to investigate next poll.
42
+ e.g. "look into this bug: ...", "investigate order creation failures"
43
+
44
+ 3. pause_sentinel — Create SENTINEL_PAUSE file to halt all auto-fix activity.
45
+ e.g. "pause sentinel", "stop auto-fixing"
46
+
47
+ 4. resume_sentinel — Remove SENTINEL_PAUSE file to resume normal operation.
48
+ e.g. "resume sentinel", "unpause"
49
+
50
+ 5. list_projects — List all configured repos and log sources in this Sentinel instance.
51
+ e.g. "what projects are you watching?", "list all repos"
52
+
53
+ 6. search_logs — Search fetched log files for a pattern or keyword.
54
+ e.g. "search logs for X", "find entries for user Y", "grep logs for Z"
55
+
56
+ 7. trigger_poll — Trigger an immediate poll cycle without waiting for the schedule.
57
+ e.g. "check now", "poll immediately", "don't wait, run now"
58
+
59
+ 8. get_repo_status — Show the current git branch, last commit, and recent fix branches
60
+ for a specific repository.
61
+ e.g. "status of repo X", "what branch is cairn on?"
62
+
63
+ 9. list_recent_commits — List the most recent commits in a repo (including Sentinel's auto-fixes).
64
+ e.g. "show me recent commits in elprint-sales", "what did sentinel commit?"
65
+
66
+ 10. get_fix_detail — Get full details of a specific fix: error, patch path, PR URL, status.
67
+ e.g. "show fix abc123", "details on that fix"
68
+
69
+ 11. list_errors — List recent errors from the state store, optionally filtered by repo or source.
70
+ e.g. "show all errors today", "what errors hit elprint this week?"
71
+
36
72
  Tone: direct, professional, like a senior engineer who owns the system.
37
73
  Don't pad responses. Don't say "Great question!" or "Certainly!".
38
74
  If you don't know something, use a tool to find out before saying you don't know.