@iliasalmerekov/aegis 0.5.6 → 0.5.9
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/README.md +27 -4
- package/checksums.json +6 -6
- package/package.json +43 -43
- package/scripts/install.js +64 -0
package/README.md
CHANGED
|
@@ -10,9 +10,32 @@ The package downloads the correct Aegis GitHub Release binary for the current
|
|
|
10
10
|
Linux/macOS x64/arm64 host during `postinstall`, verifies SHA256, and exposes
|
|
11
11
|
the `aegis` command.
|
|
12
12
|
|
|
13
|
-
NPM installs the binary
|
|
14
|
-
|
|
15
|
-
`
|
|
16
|
-
`
|
|
13
|
+
NPM installs the binary and never edits `.bashrc` or `.zshrc`. As a
|
|
14
|
+
convenience, `postinstall` performs **best-effort** agent-hook setup: if a
|
|
15
|
+
`~/.claude` or `~/.codex` directory already exists, it runs
|
|
16
|
+
`aegis install-hooks --all`. It never creates those directories, and a hook-setup
|
|
17
|
+
failure never fails the npm install. Set `AEGIS_NPM_SKIP_HOOKS=1` to opt out.
|
|
18
|
+
|
|
19
|
+
If no agent directory exists yet, install one of the agents and then run:
|
|
20
|
+
|
|
21
|
+
```bash
|
|
22
|
+
aegis install-hooks --all
|
|
23
|
+
```
|
|
24
|
+
|
|
25
|
+
Claude Code and Codex command execution is protected through these `PreToolUse`
|
|
26
|
+
hooks, not through `setup-shell` — those agents ignore a non-bash/zsh `$SHELL`
|
|
27
|
+
in their Bash tool, so only the hook intercepts their commands.
|
|
28
|
+
|
|
29
|
+
To opt in to shell-proxy mode for tools that launch commands through `$SHELL -c`:
|
|
30
|
+
|
|
31
|
+
```bash
|
|
32
|
+
aegis setup-shell
|
|
33
|
+
```
|
|
34
|
+
|
|
35
|
+
To undo shell-proxy setup later:
|
|
36
|
+
|
|
37
|
+
```bash
|
|
38
|
+
aegis setup-shell --remove
|
|
39
|
+
```
|
|
17
40
|
|
|
18
41
|
Native Windows shells are not supported; use Aegis from WSL2 on Windows.
|
package/checksums.json
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
{
|
|
2
|
-
"release": "v0.5.
|
|
2
|
+
"release": "v0.5.9",
|
|
3
3
|
"repo": "IliasAlmerekov/aegis",
|
|
4
4
|
"assets": {
|
|
5
|
-
"aegis-linux-x86_64": "
|
|
6
|
-
"aegis-linux-aarch64": "
|
|
7
|
-
"aegis-macos-x86_64": "
|
|
8
|
-
"aegis-macos-aarch64": "
|
|
5
|
+
"aegis-linux-x86_64": "088cb3c1c927e69b9fdcda852677f08d1e620e87e3e8fa8f7f6019e0d26d8d39",
|
|
6
|
+
"aegis-linux-aarch64": "2c96a5c880101e046e307a0a83a2d24f1fdc438dbe547cfb43df84eecf8b823b",
|
|
7
|
+
"aegis-macos-x86_64": "ef64b9af6067ee0343153d87fcf2f210f48219d139d3ad846c139615772a7485",
|
|
8
|
+
"aegis-macos-aarch64": "c8337ead145038ef25ccbcfa53fbc57cfe841cfed6322de31c77efd8a33576a1"
|
|
9
9
|
}
|
|
10
|
-
}
|
|
10
|
+
}
|
package/package.json
CHANGED
|
@@ -1,43 +1,43 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "@iliasalmerekov/aegis",
|
|
3
|
-
"version": "0.5.
|
|
4
|
-
"description": "Terminal proxy that intercepts AI agent shell commands and requires human confirmation before destructive operations",
|
|
5
|
-
"license": "MIT",
|
|
6
|
-
"homepage": "https://github.com/IliasAlmerekov/aegis",
|
|
7
|
-
"repository": {
|
|
8
|
-
"type": "git",
|
|
9
|
-
"url": "git+https://github.com/IliasAlmerekov/aegis.git"
|
|
10
|
-
},
|
|
11
|
-
"bugs": {
|
|
12
|
-
"url": "https://github.com/IliasAlmerekov/aegis/issues"
|
|
13
|
-
},
|
|
14
|
-
"bin": {
|
|
15
|
-
"aegis": "bin/aegis.js"
|
|
16
|
-
},
|
|
17
|
-
"scripts": {
|
|
18
|
-
"postinstall": "node scripts/install.js",
|
|
19
|
-
"smoke": "node scripts/smoke.js"
|
|
20
|
-
},
|
|
21
|
-
"os": [
|
|
22
|
-
"darwin",
|
|
23
|
-
"linux"
|
|
24
|
-
],
|
|
25
|
-
"cpu": [
|
|
26
|
-
"x64",
|
|
27
|
-
"arm64"
|
|
28
|
-
],
|
|
29
|
-
"files": [
|
|
30
|
-
"bin/",
|
|
31
|
-
"scripts/",
|
|
32
|
-
"checksums.json",
|
|
33
|
-
"README.md"
|
|
34
|
-
],
|
|
35
|
-
"keywords": [
|
|
36
|
-
"aegis",
|
|
37
|
-
"security",
|
|
38
|
-
"ai",
|
|
39
|
-
"shell",
|
|
40
|
-
"cli",
|
|
41
|
-
"safety"
|
|
42
|
-
]
|
|
43
|
-
}
|
|
1
|
+
{
|
|
2
|
+
"name": "@iliasalmerekov/aegis",
|
|
3
|
+
"version": "0.5.9",
|
|
4
|
+
"description": "Terminal proxy that intercepts AI agent shell commands and requires human confirmation before destructive operations",
|
|
5
|
+
"license": "MIT",
|
|
6
|
+
"homepage": "https://github.com/IliasAlmerekov/aegis",
|
|
7
|
+
"repository": {
|
|
8
|
+
"type": "git",
|
|
9
|
+
"url": "git+https://github.com/IliasAlmerekov/aegis.git"
|
|
10
|
+
},
|
|
11
|
+
"bugs": {
|
|
12
|
+
"url": "https://github.com/IliasAlmerekov/aegis/issues"
|
|
13
|
+
},
|
|
14
|
+
"bin": {
|
|
15
|
+
"aegis": "bin/aegis.js"
|
|
16
|
+
},
|
|
17
|
+
"scripts": {
|
|
18
|
+
"postinstall": "node scripts/install.js",
|
|
19
|
+
"smoke": "node scripts/smoke.js"
|
|
20
|
+
},
|
|
21
|
+
"os": [
|
|
22
|
+
"darwin",
|
|
23
|
+
"linux"
|
|
24
|
+
],
|
|
25
|
+
"cpu": [
|
|
26
|
+
"x64",
|
|
27
|
+
"arm64"
|
|
28
|
+
],
|
|
29
|
+
"files": [
|
|
30
|
+
"bin/",
|
|
31
|
+
"scripts/",
|
|
32
|
+
"checksums.json",
|
|
33
|
+
"README.md"
|
|
34
|
+
],
|
|
35
|
+
"keywords": [
|
|
36
|
+
"aegis",
|
|
37
|
+
"security",
|
|
38
|
+
"ai",
|
|
39
|
+
"shell",
|
|
40
|
+
"cli",
|
|
41
|
+
"safety"
|
|
42
|
+
]
|
|
43
|
+
}
|
package/scripts/install.js
CHANGED
|
@@ -3,7 +3,9 @@
|
|
|
3
3
|
const crypto = require("node:crypto");
|
|
4
4
|
const fs = require("node:fs");
|
|
5
5
|
const https = require("node:https");
|
|
6
|
+
const os = require("node:os");
|
|
6
7
|
const path = require("node:path");
|
|
8
|
+
const { spawnSync } = require("node:child_process");
|
|
7
9
|
|
|
8
10
|
const packageRoot = path.join(__dirname, "..");
|
|
9
11
|
const vendorDir = path.join(packageRoot, "vendor");
|
|
@@ -25,6 +27,64 @@ function fail(message) {
|
|
|
25
27
|
process.exit(1);
|
|
26
28
|
}
|
|
27
29
|
|
|
30
|
+
// Binary-only install: never edit shell startup files here. Point users at the
|
|
31
|
+
// explicit opt-in `aegis setup-shell` command so enabling the shell proxy is a
|
|
32
|
+
// deliberate user action, not a side effect of `npm i -g`.
|
|
33
|
+
function printNextSteps() {
|
|
34
|
+
console.log("Aegis installed.");
|
|
35
|
+
console.log("");
|
|
36
|
+
console.log("Test:");
|
|
37
|
+
console.log(" aegis -c 'echo hello'");
|
|
38
|
+
console.log("");
|
|
39
|
+
console.log("Enable shell-proxy mode for tools that launch commands via $SHELL -c:");
|
|
40
|
+
console.log(" aegis setup-shell");
|
|
41
|
+
console.log("");
|
|
42
|
+
console.log("Undo shell-proxy setup:");
|
|
43
|
+
console.log(" aegis setup-shell --remove");
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
// Best-effort agent hook setup. Only runs `aegis install-hooks --all` when a
|
|
47
|
+
// supported agent config directory already exists; never creates one. Failures
|
|
48
|
+
// here must not fail the npm install — the binary is already in place and the
|
|
49
|
+
// user can run `aegis install-hooks --all` manually. Set AEGIS_NPM_SKIP_HOOKS=1
|
|
50
|
+
// to opt out (used by deterministic packaging tests).
|
|
51
|
+
function maybeInstallAgentHooks() {
|
|
52
|
+
if (process.env.AEGIS_NPM_SKIP_HOOKS === "1") {
|
|
53
|
+
return;
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
const home = os.homedir();
|
|
57
|
+
if (!home) {
|
|
58
|
+
return;
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
const claudeDir = path.join(home, ".claude");
|
|
62
|
+
const codexDir = path.join(home, ".codex");
|
|
63
|
+
const hasAgentDir = fs.existsSync(claudeDir) || fs.existsSync(codexDir);
|
|
64
|
+
|
|
65
|
+
if (!hasAgentDir) {
|
|
66
|
+
console.log("");
|
|
67
|
+
console.log("If you install Claude Code or Codex later, run:");
|
|
68
|
+
console.log(" aegis install-hooks --all");
|
|
69
|
+
return;
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
try {
|
|
73
|
+
const result = spawnSync(binaryPath, ["install-hooks", "--all"], {
|
|
74
|
+
stdio: "inherit"
|
|
75
|
+
});
|
|
76
|
+
if (result.error) {
|
|
77
|
+
console.log("");
|
|
78
|
+
console.log("Could not auto-install agent hooks; run manually with:");
|
|
79
|
+
console.log(" aegis install-hooks --all");
|
|
80
|
+
}
|
|
81
|
+
} catch (_error) {
|
|
82
|
+
console.log("");
|
|
83
|
+
console.log("Could not auto-install agent hooks; run manually with:");
|
|
84
|
+
console.log(" aegis install-hooks --all");
|
|
85
|
+
}
|
|
86
|
+
}
|
|
87
|
+
|
|
28
88
|
function readChecksums() {
|
|
29
89
|
const raw = fs.readFileSync(checksumsPath, "utf8");
|
|
30
90
|
return JSON.parse(raw);
|
|
@@ -111,6 +171,8 @@ async function main() {
|
|
|
111
171
|
|
|
112
172
|
if (process.env.AEGIS_NPM_SKIP_DOWNLOAD === "1") {
|
|
113
173
|
fs.writeFileSync(binaryPath, "#!/bin/sh\nprintf 'aegis test binary\\n'\n", { mode: 0o755 });
|
|
174
|
+
printNextSteps();
|
|
175
|
+
maybeInstallAgentHooks();
|
|
114
176
|
return;
|
|
115
177
|
}
|
|
116
178
|
|
|
@@ -125,6 +187,8 @@ async function main() {
|
|
|
125
187
|
|
|
126
188
|
fs.renameSync(tmpPath, binaryPath);
|
|
127
189
|
fs.chmodSync(binaryPath, 0o755);
|
|
190
|
+
printNextSteps();
|
|
191
|
+
maybeInstallAgentHooks();
|
|
128
192
|
}
|
|
129
193
|
|
|
130
194
|
main().catch(error => {
|