@misterhuydo/sentinel 1.2.8 → 1.3.0
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/minify-map.json +8 -1
- package/.cairn/session.json +2 -2
- package/.cairn/views/a348d8_sentinel.js +79 -0
- package/lib/add.js +470 -415
- package/package.json +1 -1
- package/python/scripts/gen_deploy_keys.sh +94 -0
- package/python/scripts/setup_deploy_keys.sh +63 -0
- package/python/sentinel/fix_engine.py +1 -0
- package/python/sentinel/main.py +39 -29
package/.cairn/minify-map.json
CHANGED
package/.cairn/session.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
|
-
"message": "Auto-checkpoint at 2026-03-
|
|
3
|
-
"checkpoint_at": "2026-03-
|
|
2
|
+
"message": "Auto-checkpoint at 2026-03-23T12:04:39.918Z",
|
|
3
|
+
"checkpoint_at": "2026-03-23T12:04:39.919Z",
|
|
4
4
|
"active_files": [],
|
|
5
5
|
"notes": [],
|
|
6
6
|
"mtime_snapshot": {}
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
'use strict';
|
|
3
|
+
const chalk = require('chalk');
|
|
4
|
+
const [,, command = 'help', ...args] = process.argv;
|
|
5
|
+
if (command === '--version' || command === '-v') {
|
|
6
|
+
const { version } = require('../package.json');
|
|
7
|
+
console.log(version);
|
|
8
|
+
process.exit(0);
|
|
9
|
+
}
|
|
10
|
+
if (command === '--help' || command === '-h') {
|
|
11
|
+
printUsage();
|
|
12
|
+
process.exit(0);
|
|
13
|
+
}
|
|
14
|
+
const BANNER = `
|
|
15
|
+
${chalk.cyan('███████╗███████╗███╗ ██╗████████╗██╗███╗ ██╗███████╗██╗')}
|
|
16
|
+
${chalk.cyan('██╔════╝██╔════╝████╗ ██║╚══██╔══╝██║████╗ ██║██╔════╝██║')}
|
|
17
|
+
${chalk.cyan('███████╗█████╗ ██╔██╗ ██║ ██║ ██║██╔██╗ ██║█████╗ ██║')}
|
|
18
|
+
${chalk.cyan('╚════██║██╔══╝ ██║╚██╗██║ ██║ ██║██║╚██╗██║██╔══╝ ██║')}
|
|
19
|
+
${chalk.cyan('███████║███████╗██║ ╚████║ ██║ ██║██║ ╚████║███████╗███████╗')}
|
|
20
|
+
${chalk.cyan('╚══════╝╚══════╝╚═╝ ╚═══╝ ╚═╝ ╚═╝╚═╝ ╚═══╝╚══════╝╚══════╝')}
|
|
21
|
+
${chalk.gray(' Autonomous DevOps Agent')}
|
|
22
|
+
`;
|
|
23
|
+
async function main() {
|
|
24
|
+
console.log(BANNER);
|
|
25
|
+
switch (command) {
|
|
26
|
+
case 'init':
|
|
27
|
+
await require('../lib/init')();
|
|
28
|
+
break;
|
|
29
|
+
case 'add':
|
|
30
|
+
await require('../lib/add')(args[0]);
|
|
31
|
+
break;
|
|
32
|
+
case 'test':
|
|
33
|
+
await require('../lib/test')(args[0]);
|
|
34
|
+
break;
|
|
35
|
+
case 'upgrade': {
|
|
36
|
+
let upgradeCmd;
|
|
37
|
+
try {
|
|
38
|
+
upgradeCmd = require('../lib/upgrade');
|
|
39
|
+
} catch (loadErr) {
|
|
40
|
+
console.log(chalk.yellow(' ⚠'), 'upgrade module failed to load (' + loadErr.message + ')');
|
|
41
|
+
console.log(chalk.cyan(' →'), 'Running bare npm install to self-heal...');
|
|
42
|
+
const { spawnSync } = require('child_process');
|
|
43
|
+
const r = spawnSync('npm', ['install', '-g', '@misterhuydo/sentinel@latest'],
|
|
44
|
+
{ stdio: 'inherit' });
|
|
45
|
+
if (r.status === 0) {
|
|
46
|
+
console.log(chalk.green(' ✔'), 'Self-healed — run `sentinel upgrade` again to finish');
|
|
47
|
+
} else {
|
|
48
|
+
console.error(chalk.red(' ✖'), 'npm install failed — try: npm install -g @misterhuydo/sentinel');
|
|
49
|
+
}
|
|
50
|
+
process.exit(r.status || 0);
|
|
51
|
+
}
|
|
52
|
+
await upgradeCmd();
|
|
53
|
+
break;
|
|
54
|
+
}
|
|
55
|
+
case 'help':
|
|
56
|
+
default:
|
|
57
|
+
printUsage();
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
function printUsage() {
|
|
61
|
+
const { version } = require('../package.json');
|
|
62
|
+
console.log(`${chalk.bold('sentinel')} v${version} — Autonomous DevOps Agent
|
|
63
|
+
${chalk.bold('Usage:')}
|
|
64
|
+
sentinel init Interactive setup — install everything and create workspace
|
|
65
|
+
sentinel add <name> Add a blank project (fill config manually)
|
|
66
|
+
sentinel add <git-url> Add a project pre-configured for a GitHub repo
|
|
67
|
+
sentinel add <project.json> Add a project from a local JSON config file
|
|
68
|
+
sentinel add <https://host/cfg.json> Add a project from a remote JSON config URL
|
|
69
|
+
sentinel test [project] Validate installation and config before going live
|
|
70
|
+
sentinel upgrade Pull latest version and hot-deploy Python source
|
|
71
|
+
${chalk.bold('Options:')}
|
|
72
|
+
--version, -v Print version
|
|
73
|
+
--help, -h Print this help
|
|
74
|
+
`);
|
|
75
|
+
}
|
|
76
|
+
main().catch(err => {
|
|
77
|
+
console.error(chalk.red('Error:'), err.message);
|
|
78
|
+
process.exit(1);
|
|
79
|
+
});
|