aegiscode 3.4.3 → 3.4.4

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/package.json CHANGED
@@ -1,32 +1,87 @@
1
1
  {
2
2
  "name": "aegiscode",
3
- "version": "3.4.3",
4
- "description": "AEGIS \u2014 terminal AI coding agent CLI",
3
+ "version": "3.4.4",
4
+ "description": "AEGIS CLI AI-powered coding assistant",
5
+ "type": "module",
5
6
  "bin": {
6
- "aegis": "./bin/aegis.js",
7
- "aegis-cli": "./bin/aegis.js"
7
+ "aegis": "./bin/cli.js",
8
+ "aegis-cli": "./bin/cli.js"
8
9
  },
9
- "files": [
10
- "bin/aegis.js"
11
- ],
12
- "engines": {
13
- "node": ">=18.0.0"
10
+ "scripts": {
11
+ "build": "node esbuild.mjs",
12
+ "build:publish": "npm run build && node scripts/make-bin.mjs",
13
+ "build:standalone": "bash build-standalone.sh",
14
+ "dev": "NODE_NO_WARNINGS=1 tsx src/main.tsx",
15
+ "start": "node --no-deprecation dist/main.js",
16
+ "typecheck": "tsc --noEmit",
17
+ "test:prompts": "tsx src/prompts/test.ts",
18
+ "test:tools": "tsx src/tools/test.ts",
19
+ "test:pipeline": "tsx src/tools/execution/test.ts",
20
+ "test:context": "tsx src/context/test.ts",
21
+ "test:mcp": "tsx src/mcp/test.ts",
22
+ "test:store": "tsx src/store/test.ts"
14
23
  },
15
24
  "keywords": [
16
- "ai",
17
25
  "cli",
26
+ "ai",
18
27
  "coding-agent",
19
- "terminal",
28
+ "llm",
29
+ "openai",
30
+ "gpt",
20
31
  "claude",
21
- "aegis"
32
+ "copilot",
33
+ "assistant",
34
+ "terminal",
35
+ "developer-tools"
22
36
  ],
23
- "author": "aegisinfo",
37
+ "author": "Niklas Borneklint",
24
38
  "license": "MIT",
25
- "devDependencies": {
26
- "javascript-obfuscator": "^5.4.3"
39
+ "repository": {
40
+ "type": "git",
41
+ "url": "git+https://github.com/aegisinfo/aegiscode.git"
42
+ },
43
+ "homepage": "https://github.com/aegisinfo/aegiscode#readme",
44
+ "bugs": {
45
+ "url": "https://github.com/aegisinfo/aegiscode/issues"
46
+ },
47
+ "files": [
48
+ "bin/",
49
+ "scripts/",
50
+ "README.md",
51
+ "LICENSE"
52
+ ],
53
+ "engines": {
54
+ "node": ">=22.0.0"
27
55
  },
28
56
  "dependencies": {
29
- "sql.js": "^1.14.1"
57
+ "@modelcontextprotocol/sdk": "^1.25.3",
58
+ "@xenova/transformers": "^2.17.2",
59
+ "chalk": "^5.4.1",
60
+ "dotenv": "^17.4.2",
61
+ "fuse.js": "^7.4.1",
62
+ "glob": "^13.0.0",
63
+ "ink": "^7.0.5",
64
+ "ink-text-input": "^6.0.0",
65
+ "js-tiktoken": "^1.0.21",
66
+ "lowlight": "^3.3.0",
67
+ "minimatch": "^10.1.1",
68
+ "nanoid": "^5.1.6",
69
+ "openai": "^4.77.0",
70
+ "react": "^19.2.7",
71
+ "react-dom": "^19.2.7",
72
+ "sql.js": "^1.14.1",
73
+ "string-width": "^8.1.1",
74
+ "uuid": "^14.0.0",
75
+ "yaml": "^2.8.2",
76
+ "yargs": "^17.7.2",
77
+ "zod": "^3.24.2",
78
+ "zod-to-json-schema": "^3.25.1",
79
+ "zustand": "^5.0.14"
30
80
  },
31
- "type": "module"
32
- }
81
+ "devDependencies": {
82
+ "@types/node": "^22.19.19",
83
+ "esbuild": "^0.28.0",
84
+ "tsx": "^4.22.4",
85
+ "typescript": "^5.7.2"
86
+ }
87
+ }
@@ -0,0 +1,155 @@
1
+ #!/usr/bin/env node
2
+ /**
3
+ * postinstall script — downloads the prebuilt aegis-cli binary for the current platform.
4
+ * The binary is saved to <package>/bin/ and then spawned by bin/cli.js.
5
+ *
6
+ * Requires zero external dependencies (uses only Node.js built-ins).
7
+ *
8
+ * Binary source: GitHub releases
9
+ * https://github.com/aegisinfo/aegiscode/releases/latest/download/aegis-cli-{platform}-{arch}
10
+ */
11
+
12
+ import { createWriteStream, existsSync, chmodSync, mkdirSync } from 'fs';
13
+ import { get } from 'https';
14
+ import { join, dirname } from 'path';
15
+ import { fileURLToPath } from 'url';
16
+
17
+ const __dirname = dirname(fileURLToPath(import.meta.url));
18
+ const PACKAGE_ROOT = join(__dirname, '..');
19
+ const BIN_DIR = join(PACKAGE_ROOT, 'bin');
20
+
21
+ const BASE_URL =
22
+ 'https://github.com/aegisinfo/aegiscode/releases/latest/download';
23
+
24
+ // Maps Node.js process.platform + process.arch → GitHub release asset name
25
+ const PLATFORM_MAP = {
26
+ 'linux-x64': 'aegis-cli-linux-x64',
27
+ 'linux-arm64': 'aegis-cli-linux-arm64',
28
+ 'darwin-x64': 'aegis-cli-darwin-x64',
29
+ 'darwin-arm64': 'aegis-cli-darwin-arm64',
30
+ 'win32-x64': 'aegis-cli-win-x64.exe',
31
+ };
32
+
33
+ // Fallback URLs for platforms that don't have a dedicated binary yet
34
+ const FALLBACK_MAP = {
35
+ 'linux-arm': 'aegis-cli-linux-arm64',
36
+ 'darwin': 'aegis-cli-darwin-x64',
37
+ };
38
+
39
+ // ---------------------------------------------------------------------------
40
+ // Helpers
41
+ // ---------------------------------------------------------------------------
42
+
43
+ function detectBinaryName() {
44
+ const os = process.platform;
45
+ const arch = process.arch;
46
+ const key = `${os}-${arch}`;
47
+
48
+ if (PLATFORM_MAP[key]) return PLATFORM_MAP[key];
49
+
50
+ // Try fallback (e.g. linux-arm → linux-arm64 binary if close enough)
51
+ for (const [pattern, fallback] of Object.entries(FALLBACK_MAP)) {
52
+ if (key.startsWith(pattern)) return fallback;
53
+ }
54
+
55
+ throw new Error(
56
+ `Unsupported platform: ${key}\n` +
57
+ ` Supported: ${Object.keys(PLATFORM_MAP).join(', ')}\n` +
58
+ ` You can build from source: git clone https://github.com/aegisinfo/aegiscode && cd aegiscode && npm install && npm run build`
59
+ );
60
+ }
61
+
62
+ function downloadFile(url, dest) {
63
+ return new Promise((resolve, reject) => {
64
+ const file = createWriteStream(dest);
65
+ const req = get(url, (res) => {
66
+ // Follow redirect (GitHub releases redirect to S3)
67
+ if (res.statusCode >= 300 && res.statusCode < 400 && res.headers.location) {
68
+ file.close();
69
+ // Avoid file-exists check on redirect target — let the stream overwrite
70
+ downloadFile(res.headers.location, dest).then(resolve).catch(reject);
71
+ return;
72
+ }
73
+
74
+ if (res.statusCode !== 200) {
75
+ file.close();
76
+ // Try to collect error body
77
+ let body = '';
78
+ res.on('data', (chunk) => (body += chunk.toString()));
79
+ res.on('end', () => {
80
+ const detail = body.trim().slice(0, 200);
81
+ reject(
82
+ new Error(`HTTP ${res.statusCode} — ${detail || 'no body'}`)
83
+ );
84
+ });
85
+ return;
86
+ }
87
+
88
+ res.pipe(file);
89
+ file.on('finish', () => {
90
+ file.close();
91
+ resolve();
92
+ });
93
+ });
94
+
95
+ req.on('error', (err) => {
96
+ file.close();
97
+ // Attempt cleanup
98
+ try { file.close(); } catch { /* ignore */ }
99
+ reject(err);
100
+ });
101
+
102
+ req.setTimeout(60_000, () => {
103
+ req.destroy();
104
+ reject(new Error('Download timed out after 60s'));
105
+ });
106
+ });
107
+ }
108
+
109
+ // ---------------------------------------------------------------------------
110
+ // Main
111
+ // ---------------------------------------------------------------------------
112
+
113
+ async function main() {
114
+ const binaryName = detectBinaryName();
115
+ const url = `${BASE_URL}/${binaryName}`;
116
+ const dest = join(BIN_DIR, binaryName);
117
+
118
+ // Check if binary already exists (reinstall / postinstall after prepublish)
119
+ if (existsSync(dest)) {
120
+ console.log(`✓ aegis-cli already installed at ${dest}`);
121
+ chmodSync(dest, 0o755);
122
+ return;
123
+ }
124
+
125
+ console.log(`⬡ Downloading aegis-cli for ${process.platform}-${process.arch}...`);
126
+
127
+ mkdirSync(BIN_DIR, { recursive: true });
128
+
129
+ try {
130
+ await downloadFile(url, dest);
131
+ chmodSync(dest, 0o755);
132
+ console.log(`✓ aegis-cli installed to ${dest}`);
133
+ } catch (err) {
134
+ console.error('');
135
+ console.error(`⚠ Failed to download aegis-cli binary: ${err.message}`);
136
+ console.error('');
137
+ console.error(' Possible causes:');
138
+ console.error(' • No binary release for your platform yet');
139
+ console.error(' • No internet connectivity');
140
+ console.error(' • GitHub releases are unavailable');
141
+ console.error('');
142
+ console.error(' Options:');
143
+ console.error(' 1. Download manually from: https://github.com/aegisinfo/aegiscode/releases');
144
+ console.error(' and place the binary in: ' + BIN_DIR);
145
+ console.error(' 2. Build from source:');
146
+ console.error(' git clone https://github.com/aegisinfo/aegiscode');
147
+ console.error(' cd aegiscode && npm install && npm run build');
148
+ console.error(' 3. Install via installer script:');
149
+ console.error(' curl -fsSL https://dl.aegiscloud.org/install.sh | bash');
150
+ console.error('');
151
+ process.exit(1);
152
+ }
153
+ }
154
+
155
+ main();
@@ -0,0 +1 @@
1
+ export default {};
@@ -0,0 +1,17 @@
1
+ /**
2
+ * make-bin.mjs — copies the built dist/main.js to bin/cli.js as-is (no obfuscation).
3
+ */
4
+
5
+ import { readFileSync, writeFileSync, mkdirSync, chmodSync } from 'node:fs';
6
+ import { dirname, join } from 'node:path';
7
+ import { fileURLToPath } from 'node:url';
8
+
9
+ const __dirname = dirname(fileURLToPath(import.meta.url));
10
+ const src = join(__dirname, '..', 'dist', 'main.js');
11
+ const dest = join(__dirname, '..', 'bin', 'cli.js');
12
+
13
+ mkdirSync(join(__dirname, '..', 'bin'), { recursive: true });
14
+ writeFileSync(dest, readFileSync(src, 'utf-8'), 'utf-8');
15
+ chmodSync(dest, 0o755);
16
+
17
+ console.log(`✓ bin/cli.js written (unobfuscated)`);