@atlas-coder/atlas-agent 0.1.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/README.md ADDED
@@ -0,0 +1,36 @@
1
+ # @atlas-coder/atlas-agent
2
+
3
+ Atlas Agent — terminal-first AI coding assistant.
4
+
5
+ ## Install
6
+
7
+ ```bash
8
+ npm install -g @atlas-coder/atlas-agent
9
+ atlas-coder
10
+ ```
11
+
12
+ On install, the matching native binary for your OS/arch is downloaded from the
13
+ [GitHub release](https://github.com/Omerfaruk-aydn/Atlas-Agent/releases) that
14
+ matches this package version.
15
+
16
+ ## Usage
17
+
18
+ ```bash
19
+ atlas-coder # interactive mode
20
+ atlas-coder run "your task" # non-interactive
21
+ atlas-coder --help # CLI help
22
+ atlas-coder models # list models
23
+ atlas-coder dirs # show config paths
24
+ ```
25
+
26
+ ## Supported platforms
27
+
28
+ | OS | Architectures |
29
+ | ------- | --------------------- |
30
+ | Windows | x64 |
31
+ | macOS | x64 (Intel), arm64 (Apple Silicon) |
32
+ | Linux | x64 |
33
+
34
+ ## License
35
+
36
+ UNLICENSED — proprietary, all rights reserved.
@@ -0,0 +1,29 @@
1
+ #!/usr/bin/env node
2
+ // Launcher: exec the platform binary that was downloaded by postinstall.
3
+ const path = require('path');
4
+ const fs = require('fs');
5
+ const { spawn } = require('child_process');
6
+
7
+ const PLATFORM_MAP = { win32: 'windows', darwin: 'darwin', linux: 'linux' };
8
+
9
+ function binaryPath() {
10
+ const platform = PLATFORM_MAP[process.platform] || process.platform;
11
+ const arch = process.arch;
12
+ const ext = process.platform === 'win32' ? '.exe' : '';
13
+ const name = `atlas-coder-${platform}-${arch}${ext}`;
14
+ return path.join(__dirname, '..', 'bin', name);
15
+ }
16
+
17
+ const bin = binaryPath();
18
+ if (!fs.existsSync(bin)) {
19
+ console.error(`Atlas Agent: binary missing at ${bin}`);
20
+ console.error('Try reinstalling: npm install -g @atlas-coder/atlas-agent --force');
21
+ process.exit(1);
22
+ }
23
+
24
+ const child = spawn(bin, process.argv.slice(2), { stdio: 'inherit' });
25
+ child.on('exit', (code) => process.exit(code ?? 0));
26
+ child.on('error', (err) => {
27
+ console.error(`Atlas Agent: failed to launch: ${err.message}`);
28
+ process.exit(1);
29
+ });
package/package.json ADDED
@@ -0,0 +1,23 @@
1
+ {
2
+ "name": "@atlas-coder/atlas-agent",
3
+ "version": "0.1.0",
4
+ "description": "Atlas Agent — terminal-first AI coding assistant. Downloads the native binary on install.",
5
+ "license": "UNLICENSED",
6
+ "private": false,
7
+ "preferGlobal": true,
8
+ "bin": {
9
+ "atlas-coder": "bin/atlas-coder.js"
10
+ },
11
+ "files": [
12
+ "bin/",
13
+ "scripts/",
14
+ "package.json",
15
+ "README.md"
16
+ ],
17
+ "scripts": {
18
+ "postinstall": "node scripts/postinstall.js"
19
+ },
20
+ "engines": {
21
+ "node": ">=16"
22
+ }
23
+ }
@@ -0,0 +1,62 @@
1
+ #!/usr/bin/env node
2
+ // Postinstall: download the platform-specific binary from GitHub Releases.
3
+ const fs = require('fs');
4
+ const path = require('path');
5
+ const https = require('https');
6
+ const { URL } = require('url');
7
+
8
+ const PLATFORM_MAP = { win32: 'windows', darwin: 'darwin', linux: 'linux' };
9
+ const platform = PLATFORM_MAP[process.platform] || process.platform;
10
+ const arch = process.arch; // 'x64' | 'arm64'
11
+ const ext = process.platform === 'win32' ? '.exe' : '';
12
+ const assetName = `atlas-coder-${platform}-${arch}${ext}`;
13
+
14
+ const REPO = 'Omerfaruk-aydn/Atlas-Agent';
15
+ const VERSION = require('../package.json').version;
16
+ const TAG = `v${VERSION}`;
17
+
18
+ const binDir = path.join(__dirname, '..', 'bin');
19
+ fs.mkdirSync(binDir, { recursive: true });
20
+ const dest = path.join(binDir, assetName);
21
+
22
+ function follow(url, redirectsLeft = 5) {
23
+ return new Promise((resolve, reject) => {
24
+ https.get(url, (res) => {
25
+ if ([301, 302, 303, 307, 308].includes(res.statusCode)) {
26
+ if (redirectsLeft <= 0) return reject(new Error('too many redirects'));
27
+ return follow(new URL(res.headers.location).toString(), redirectsLeft - 1).then(resolve, reject);
28
+ }
29
+ resolve(res);
30
+ }).on('error', reject);
31
+ });
32
+ }
33
+
34
+ async function download() {
35
+ const url = `https://github.com/${REPO}/releases/download/${TAG}/${assetName}`;
36
+ console.log(`Atlas Agent postinstall: downloading ${assetName} ...`);
37
+ const res = await follow(url);
38
+ if (res.statusCode !== 200) {
39
+ throw new Error(`HTTP ${res.statusCode} for ${url}`);
40
+ }
41
+ const tmp = dest + '.part';
42
+ await new Promise((resolve, reject) => {
43
+ const f = fs.createWriteStream(tmp);
44
+ res.pipe(f);
45
+ f.on('finish', () => f.close(resolve));
46
+ f.on('error', reject);
47
+ });
48
+ fs.renameSync(tmp, dest);
49
+ if (process.platform !== 'win32') fs.chmodSync(dest, 0o755);
50
+ const size = (fs.statSync(dest).size / 1024 / 1024).toFixed(1);
51
+ console.log(`Atlas Agent postinstall: installed ${assetName} (${size} MB)`);
52
+ }
53
+
54
+ download().catch((err) => {
55
+ console.error(`Atlas Agent postinstall FAILED: ${err.message}`);
56
+ console.error('This is usually one of:');
57
+ console.error(' - No release yet for this version. Run:');
58
+ console.error(` gh release create ${TAG} --title "${TAG}" --notes "release"`);
59
+ console.error(' then upload the binary as ' + assetName);
60
+ console.error(' - Network/registry blocked. Try again later.');
61
+ // Don't fail install — the launcher will print a clear error if the binary is missing.
62
+ });