@aegisagentics/agent 0.2.0 → 0.2.2
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/npm/install.js +24 -23
- package/npm/lib/bootstrap-runtime.js +23 -0
- package/npm/lib/codex-plugin.js +12 -0
- package/npm/release-manifest.json +11 -11
- package/package.json +1 -1
package/npm/install.js
CHANGED
|
@@ -8,15 +8,17 @@ import { aegisPaths } from "./lib/config.js";
|
|
|
8
8
|
import { parseBootstrapCommand } from "./lib/cli.js";
|
|
9
9
|
import {
|
|
10
10
|
hookFilesForCodexUninstall,
|
|
11
|
-
installAegisHooksFiles,
|
|
12
11
|
scrubAegisHooksFiles
|
|
13
12
|
} from "./lib/codex-hooks.js";
|
|
14
|
-
import {
|
|
13
|
+
import {
|
|
14
|
+
installCodexPluginAsSingleHookSource,
|
|
15
|
+
uninstallCodexPlugin
|
|
16
|
+
} from "./lib/codex-plugin.js";
|
|
15
17
|
import {
|
|
16
18
|
detectCodexHome,
|
|
17
19
|
prepareCodexPluginInstallTarget
|
|
18
20
|
} from "./lib/codex-runtime.js";
|
|
19
|
-
import {
|
|
21
|
+
import { ensureManagedRuntime } from "./lib/bootstrap-runtime.js";
|
|
20
22
|
|
|
21
23
|
async function main() {
|
|
22
24
|
const binaryPath = resolveBinaryPath();
|
|
@@ -38,7 +40,7 @@ async function main() {
|
|
|
38
40
|
|
|
39
41
|
if (command.kind === "codex-plugin") {
|
|
40
42
|
if (command.codexPluginAction === "install") {
|
|
41
|
-
const status = await ensureBootstrapBinary(binaryPath);
|
|
43
|
+
const status = await ensureBootstrapBinary(binaryPath, "install");
|
|
42
44
|
if (status !== 0) {
|
|
43
45
|
return status;
|
|
44
46
|
}
|
|
@@ -56,8 +58,8 @@ async function main() {
|
|
|
56
58
|
codexPluginFailed = status !== 0;
|
|
57
59
|
}
|
|
58
60
|
|
|
59
|
-
if (
|
|
60
|
-
const status = await ensureBootstrapBinary(binaryPath);
|
|
61
|
+
if (command.nativeArgs[0] !== "uninstall") {
|
|
62
|
+
const status = await ensureBootstrapBinary(binaryPath, command.nativeArgs[0]);
|
|
61
63
|
if (status !== 0) {
|
|
62
64
|
return status;
|
|
63
65
|
}
|
|
@@ -95,15 +97,14 @@ async function main() {
|
|
|
95
97
|
return codexPluginFailed ? 1 : 0;
|
|
96
98
|
}
|
|
97
99
|
|
|
98
|
-
async function ensureBootstrapBinary(binaryPath) {
|
|
99
|
-
if (process.env.AEGIS_AGENT_BINARY_PATH) {
|
|
100
|
-
return 0;
|
|
101
|
-
}
|
|
102
|
-
if (fs.existsSync(binaryPath) && process.env.AEGIS_AGENT_FORCE_BINARY_DOWNLOAD !== "1") {
|
|
103
|
-
return 0;
|
|
104
|
-
}
|
|
100
|
+
async function ensureBootstrapBinary(binaryPath, commandName) {
|
|
105
101
|
try {
|
|
106
|
-
const result = await
|
|
102
|
+
const result = await ensureManagedRuntime({
|
|
103
|
+
binaryPath,
|
|
104
|
+
commandName,
|
|
105
|
+
binaryOverride: Boolean(process.env.AEGIS_AGENT_BINARY_PATH),
|
|
106
|
+
forceDownload: process.env.AEGIS_AGENT_FORCE_BINARY_DOWNLOAD === "1"
|
|
107
|
+
});
|
|
107
108
|
if (result.downloaded) {
|
|
108
109
|
console.log(`Downloaded Aegis Agent runtime: ${binaryPath}`);
|
|
109
110
|
}
|
|
@@ -160,22 +161,22 @@ async function runCodexPluginAction(action, paths, { softFail }) {
|
|
|
160
161
|
`Codex marketplace file not found at ${target.marketplaceFile}. Run the Aegis install command first.`
|
|
161
162
|
);
|
|
162
163
|
}
|
|
163
|
-
const
|
|
164
|
-
|
|
165
|
-
|
|
164
|
+
const scrubResults = await installCodexPluginAsSingleHookSource({
|
|
165
|
+
marketplaceFile: target.marketplaceFile,
|
|
166
|
+
legacyHookFiles: hookFilesForCodexUninstall({
|
|
166
167
|
codexHome: target.codexHome,
|
|
167
168
|
userPaths: paths
|
|
168
169
|
})
|
|
169
170
|
});
|
|
170
|
-
const
|
|
171
|
-
const replacedHooks = hookInstallResults.reduce((sum, result) => sum + result.replaced, 0);
|
|
172
|
-
await installCodexPlugin({ marketplaceFile: target.marketplaceFile });
|
|
171
|
+
const removedHooks = scrubResults.reduce((sum, result) => sum + result.removed, 0);
|
|
173
172
|
if (target.mirrored) {
|
|
174
173
|
console.log(`Prepared Codex-isolated Aegis runtime: ${target.codexHome}`);
|
|
175
174
|
}
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
175
|
+
if (removedHooks > 0) {
|
|
176
|
+
console.log(
|
|
177
|
+
`Removed ${removedHooks} legacy Aegis hook entr${removedHooks === 1 ? "y" : "ies"} from Codex hooks.json`
|
|
178
|
+
);
|
|
179
|
+
}
|
|
179
180
|
console.log("Codex plugin installed: aegis@aegis");
|
|
180
181
|
return 0;
|
|
181
182
|
}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import fs from "node:fs";
|
|
2
|
+
|
|
3
|
+
import { ensureNativeBinary } from "./release-download.js";
|
|
4
|
+
|
|
5
|
+
export async function ensureManagedRuntime({
|
|
6
|
+
binaryPath,
|
|
7
|
+
commandName,
|
|
8
|
+
binaryOverride = false,
|
|
9
|
+
forceDownload = false,
|
|
10
|
+
download = ensureNativeBinary
|
|
11
|
+
}) {
|
|
12
|
+
if (binaryOverride || commandName === "uninstall") {
|
|
13
|
+
return { binaryPath, downloaded: false };
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
const refreshForInstall = commandName === "install";
|
|
17
|
+
const force = refreshForInstall || forceDownload;
|
|
18
|
+
if (fs.existsSync(binaryPath) && !force) {
|
|
19
|
+
return { binaryPath, downloaded: false };
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
return await download({ binaryPath, force });
|
|
23
|
+
}
|
package/npm/lib/codex-plugin.js
CHANGED
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
import { spawn } from "node:child_process";
|
|
2
2
|
import path from "node:path";
|
|
3
3
|
|
|
4
|
+
import { scrubAegisHooksFiles } from "./codex-hooks.js";
|
|
5
|
+
|
|
4
6
|
export const DEFAULT_CODEX_PLUGIN_ID = "aegis@aegis";
|
|
5
7
|
export const DEFAULT_CODEX_PLUGIN_NAME = "aegis";
|
|
6
8
|
|
|
@@ -55,6 +57,16 @@ export async function installCodexPlugin({
|
|
|
55
57
|
});
|
|
56
58
|
}
|
|
57
59
|
|
|
60
|
+
export async function installCodexPluginAsSingleHookSource({
|
|
61
|
+
legacyHookFiles,
|
|
62
|
+
marketplaceFile,
|
|
63
|
+
installPlugin = installCodexPlugin,
|
|
64
|
+
scrubHooks = scrubAegisHooksFiles
|
|
65
|
+
}) {
|
|
66
|
+
await installPlugin({ marketplaceFile });
|
|
67
|
+
return await scrubHooks(legacyHookFiles);
|
|
68
|
+
}
|
|
69
|
+
|
|
58
70
|
export async function uninstallCodexPlugin({
|
|
59
71
|
codexCommand = "codex",
|
|
60
72
|
pluginId = DEFAULT_CODEX_PLUGIN_ID,
|
|
@@ -1,23 +1,23 @@
|
|
|
1
1
|
{
|
|
2
2
|
"schemaVersion": "aegis.agent_release_manifest.v1",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.2",
|
|
4
4
|
"releaseBaseUrl": "https://aegisagentics.com/releases/aegis-agent",
|
|
5
|
-
"createdAt": "2026-10-
|
|
5
|
+
"createdAt": "2026-10-01T11:25:46.176Z",
|
|
6
6
|
"artifacts": {
|
|
7
7
|
"darwin-arm64": {
|
|
8
|
-
"path": "versions/0.2.
|
|
9
|
-
"sha256": "
|
|
10
|
-
"sizeBytes":
|
|
8
|
+
"path": "versions/0.2.2/darwin-arm64/aegis-agent.tar.gz",
|
|
9
|
+
"sha256": "ef213b6832ae5d30285f80f14813f8c7967be056469d0f04c49128d02e64d69e",
|
|
10
|
+
"sizeBytes": 2299577
|
|
11
11
|
},
|
|
12
12
|
"darwin-x64": {
|
|
13
|
-
"path": "versions/0.2.
|
|
14
|
-
"sha256": "
|
|
15
|
-
"sizeBytes":
|
|
13
|
+
"path": "versions/0.2.2/darwin-x64/aegis-agent.tar.gz",
|
|
14
|
+
"sha256": "e97dbf98313870ae05a363c1af6b92c400347e864172a6c96e9e6462a7d909ea",
|
|
15
|
+
"sizeBytes": 2395922
|
|
16
16
|
},
|
|
17
17
|
"linux-x64": {
|
|
18
|
-
"path": "versions/0.2.
|
|
19
|
-
"sha256": "
|
|
20
|
-
"sizeBytes":
|
|
18
|
+
"path": "versions/0.2.2/linux-x64/aegis-agent.tar.gz",
|
|
19
|
+
"sha256": "7053709ce3cae3980c50719bad48ab93676fbdf4d05be38039753478ecf1e967",
|
|
20
|
+
"sizeBytes": 2528068
|
|
21
21
|
}
|
|
22
22
|
}
|
|
23
23
|
}
|