@misterhuydo/sentinel 1.0.91 → 1.0.92

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,8 +1 @@
1
- {
2
- "J:\\Projects\\Sentinel\\cli\\lib\\upgrade.js": {
3
- "tempPath": "J:\\Projects\\Sentinel\\cli\\.cairn\\views\\fb78ac_upgrade.js",
4
- "state": "compressed",
5
- "minifiedAt": 1774243530779.686,
6
- "readCount": 1
7
- }
8
- }
1
+ {}
@@ -1,6 +1,6 @@
1
1
  {
2
- "message": "Auto-checkpoint at 2026-03-23T06:18:02.115Z",
3
- "checkpoint_at": "2026-03-23T06:18:02.116Z",
2
+ "message": "Auto-checkpoint at 2026-03-23T06:24:16.501Z",
3
+ "checkpoint_at": "2026-03-23T06:24:16.503Z",
4
4
  "active_files": [],
5
5
  "notes": [],
6
6
  "mtime_snapshot": {}
package/lib/upgrade.js CHANGED
@@ -1,4 +1,3 @@
1
-
2
1
  function ensureClaudePermissions() {
3
2
  const settingsPath = require('path').join(require('os').homedir(), '.claude', 'settings.json');
4
3
  const required = ['Read(**)', 'Write(**)', 'Edit(**)', 'Bash(**)'];
@@ -36,21 +35,17 @@ function ensureClaudePermissions() {
36
35
  }
37
36
 
38
37
  'use strict';
39
-
40
38
  const fs = require('fs-extra');
41
39
  const path = require('path');
42
40
  const os = require('os');
43
41
  const { execSync, spawnSync } = require('child_process');
44
42
  const chalk = require('chalk');
45
-
46
43
  const ok = msg => console.log(chalk.green(' ✔'), msg);
47
44
  const info = msg => console.log(chalk.cyan(' →'), msg);
48
45
  const warn = msg => console.log(chalk.yellow(' ⚠'), msg);
49
46
 
50
47
  module.exports = async function upgrade() {
51
48
  const { version: current } = require('../package.json');
52
-
53
- // Find the workspace code dir
54
49
  const defaultWorkspace = path.join(os.homedir(), 'sentinel');
55
50
  const codeDir = path.join(defaultWorkspace, 'code');
56
51
  if (!fs.existsSync(codeDir)) {
@@ -59,43 +54,34 @@ module.exports = async function upgrade() {
59
54
  process.exit(1);
60
55
  }
61
56
 
62
- // Install latest from npm
63
57
  info(`Current version: ${current}`);
64
58
  info('Installing latest @misterhuydo/sentinel...');
65
- const install = spawnSync('npm', ['install', '-g', '@misterhuydo/sentinel@latest'], { stdio: 'inherit' });
59
+ const install = spawnSync('npm', ['install', '-g', '@misterhuydo/sentinel@latest', '--prefer-online'], { stdio: 'inherit' });
66
60
  if (install.status !== 0) {
67
61
  console.error(chalk.red(' ✖ npm install failed'));
68
62
  process.exit(1);
69
63
  }
70
64
 
71
- // Upgrade dependencies
72
65
  info('Upgrading @misterhuydo/cairn-mcp...');
73
- spawnSync('npm', ['install', '-g', '@misterhuydo/cairn-mcp@latest'], { stdio: 'inherit' });
66
+ spawnSync('npm', ['install', '-g', '@misterhuydo/cairn-mcp@latest', '--prefer-online'], { stdio: 'inherit' });
74
67
  ok('@misterhuydo/cairn-mcp upgraded');
75
68
 
76
69
  info('Upgrading @anthropic-ai/claude-code...');
77
- spawnSync('npm', ['install', '-g', '@anthropic-ai/claude-code@latest'], { stdio: 'inherit' });
70
+ spawnSync('npm', ['install', '-g', '@anthropic-ai/claude-code@latest', '--prefer-online'], { stdio: 'inherit' });
78
71
  ok('@anthropic-ai/claude-code upgraded');
79
72
 
80
- // Find where npm installed it
81
73
  const npmRoot = execSync('npm root -g', { encoding: 'utf8' }).trim();
82
74
  const pkgDir = path.join(npmRoot, '@misterhuydo', 'sentinel');
83
75
  const src = path.join(pkgDir, 'python');
84
-
85
76
  if (!fs.existsSync(src)) {
86
77
  console.error(chalk.red(' ✖ Bundled Python source not found in installed package'));
87
78
  process.exit(1);
88
79
  }
89
80
 
90
- // Hot-deploy: copy Python source to code dir
91
81
  info('Deploying Python source...');
92
82
  fs.copySync(src, codeDir, { overwrite: true });
93
-
94
- // Remove stale .pyc caches so Python recompiles from the new source
95
83
  const { execSync: _exec } = require('child_process');
96
84
  try { _exec(`find "${codeDir}" -type d -name __pycache__ -exec rm -rf {} + 2>/dev/null || true`); } catch (_) {}
97
-
98
- // Restore executable bit on shell scripts (npm strips it)
99
85
  const scriptsDir = path.join(codeDir, 'scripts');
100
86
  if (fs.existsSync(scriptsDir)) {
101
87
  const shFiles = fs.readdirSync(scriptsDir)
@@ -104,14 +90,13 @@ module.exports = async function upgrade() {
104
90
  if (shFiles.length) spawnSync('chmod', ['+x', ...shFiles], { stdio: 'inherit' });
105
91
  }
106
92
  ok('Python source updated');
93
+
107
94
  info('Patching Claude Code permissions…');
108
95
  ensureClaudePermissions();
109
96
 
110
- // Print new version
111
97
  const { version: latest } = require(path.join(pkgDir, 'package.json'));
112
98
  ok(`Upgraded: ${current} → ${latest}`);
113
99
 
114
- // Restart running projects
115
100
  const startAll = path.join(defaultWorkspace, 'startAll.sh');
116
101
  const stopAll = path.join(defaultWorkspace, 'stopAll.sh');
117
102
  if (fs.existsSync(stopAll) && fs.existsSync(startAll)) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@misterhuydo/sentinel",
3
- "version": "1.0.91",
3
+ "version": "1.0.92",
4
4
  "description": "Sentinel — Autonomous DevOps Agent installer and manager",
5
5
  "bin": {
6
6
  "sentinel": "./bin/sentinel.js"
@@ -1,100 +0,0 @@
1
- function ensureClaudePermissions() {
2
- const settingsPath = require('path').join(require('os').homedir(), '.claude', 'settings.json');
3
- const required = ['Read(**)', 'Write(**)', 'Edit(**)', 'Bash(**)'];
4
- let settings = {};
5
- try {
6
- if (fs.existsSync(settingsPath)) {
7
- settings = JSON.parse(fs.readFileSync(settingsPath, 'utf8'));
8
- }
9
- } catch (e) {
10
- warn('Could not read ' + settingsPath + ': ' + e.message);
11
- return;
12
- }
13
- if (!settings.permissions) settings.permissions = {};
14
- if (!Array.isArray(settings.permissions.allow)) settings.permissions.allow = [];
15
- const existing = new Set(settings.permissions.allow);
16
- const added = [];
17
- for (const perm of required) {
18
- if (!existing.has(perm)) {
19
- settings.permissions.allow.push(perm);
20
- added.push(perm);
21
- }
22
- }
23
- if (added.length === 0) {
24
- ok('Claude Code permissions already configured');
25
- return;
26
- }
27
- try {
28
- const path = require('path');
29
- fs.ensureDirSync(path.dirname(settingsPath));
30
- fs.writeFileSync(settingsPath, JSON.stringify(settings, null, 2) + '\n');
31
- ok('Claude Code permissions patched: ' + added.join(', '));
32
- } catch (e) {
33
- warn('Could not write ' + settingsPath + ': ' + e.message);
34
- }
35
- }
36
- 'use strict';
37
- const fs = require('fs-extra');
38
- const path = require('path');
39
- const os = require('os');
40
- const { execSync, spawnSync } = require('child_process');
41
- const chalk = require('chalk');
42
- const ok = msg => console.log(chalk.green(' ✔'), msg);
43
- const info = msg => console.log(chalk.cyan(' →'), msg);
44
- const warn = msg => console.log(chalk.yellow(' ⚠'), msg);
45
- module.exports = async function upgrade() {
46
- const { version: current } = require('../package.json');
47
- const defaultWorkspace = path.join(os.homedir(), 'sentinel');
48
- const codeDir = path.join(defaultWorkspace, 'code');
49
- if (!fs.existsSync(codeDir)) {
50
- console.error(chalk.red(' ✖ Sentinel code directory not found at ' + codeDir));
51
- console.error(' Run: sentinel init');
52
- process.exit(1);
53
- }
54
- info(`Current version: ${current}`);
55
- info('Installing latest @misterhuydo/sentinel...');
56
- const install = spawnSync('npm', ['install', '-g', '@misterhuydo/sentinel@latest'], { stdio: 'inherit' });
57
- if (install.status !== 0) {
58
- console.error(chalk.red(' ✖ npm install failed'));
59
- process.exit(1);
60
- }
61
- info('Upgrading @misterhuydo/cairn-mcp...');
62
- spawnSync('npm', ['install', '-g', '@misterhuydo/cairn-mcp@latest'], { stdio: 'inherit' });
63
- ok('@misterhuydo/cairn-mcp upgraded');
64
- info('Upgrading @anthropic-ai/claude-code...');
65
- spawnSync('npm', ['install', '-g', '@anthropic-ai/claude-code@latest'], { stdio: 'inherit' });
66
- ok('@anthropic-ai/claude-code upgraded');
67
- const npmRoot = execSync('npm root -g', { encoding: 'utf8' }).trim();
68
- const pkgDir = path.join(npmRoot, '@misterhuydo', 'sentinel');
69
- const src = path.join(pkgDir, 'python');
70
- if (!fs.existsSync(src)) {
71
- console.error(chalk.red(' ✖ Bundled Python source not found in installed package'));
72
- process.exit(1);
73
- }
74
- info('Deploying Python source...');
75
- fs.copySync(src, codeDir, { overwrite: true });
76
- const { execSync: _exec } = require('child_process');
77
- try { _exec(`find "${codeDir}" -type d -name __pycache__ -exec rm -rf {} + 2>/dev/null || true`); } catch (_) {}
78
- const scriptsDir = path.join(codeDir, 'scripts');
79
- if (fs.existsSync(scriptsDir)) {
80
- const shFiles = fs.readdirSync(scriptsDir)
81
- .filter(f => f.endsWith('.sh'))
82
- .map(f => path.join(scriptsDir, f));
83
- if (shFiles.length) spawnSync('chmod', ['+x', ...shFiles], { stdio: 'inherit' });
84
- }
85
- ok('Python source updated');
86
- info('Patching Claude Code permissions…');
87
- ensureClaudePermissions();
88
- const { version: latest } = require(path.join(pkgDir, 'package.json'));
89
- ok(`Upgraded: ${current} → ${latest}`);
90
- const startAll = path.join(defaultWorkspace, 'startAll.sh');
91
- const stopAll = path.join(defaultWorkspace, 'stopAll.sh');
92
- if (fs.existsSync(stopAll) && fs.existsSync(startAll)) {
93
- info('Restarting Sentinel...');
94
- spawnSync('bash', [stopAll], { stdio: 'inherit' });
95
- spawnSync('bash', [startAll], { stdio: 'inherit' });
96
- ok('Sentinel restarted');
97
- } else {
98
- warn('No startAll.sh found — restart manually');
99
- }
100
- };