agentcontroll 0.0.0-stage → 1.0.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/LICENSE +21 -0
- package/README.md +51 -2
- package/bin/ac.js +5 -0
- package/bin/agent-control.js +5 -0
- package/bin/agentcontrold.js +5 -0
- package/bin/agentcontroll.js +5 -0
- package/bin/agy.js +5 -0
- package/lib/downloader.js +164 -0
- package/lib/index.js +11 -0
- package/lib/platform.js +57 -0
- package/lib/runner.js +61 -0
- package/package.json +44 -4
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Agent Control contributors
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
CHANGED
|
@@ -1,3 +1,52 @@
|
|
|
1
|
-
#
|
|
1
|
+
# agentcontroll
|
|
2
|
+
|
|
3
|
+
**Local-first control plane for coding agents (Antigravity, Claude Code, Codex, Devin CLI)**
|
|
4
|
+
|
|
5
|
+
`agentcontroll` manages, sandboxes, switches between, and monitors autonomous coding agents inside full-fidelity terminal sessions with hardware-isolated account profiles and zero-configuration launch flows.
|
|
6
|
+
|
|
7
|
+
## Quick Start
|
|
8
|
+
|
|
9
|
+
You can run AgentControll without manual compilation using `npx`:
|
|
10
|
+
|
|
11
|
+
```bash
|
|
12
|
+
npx agentcontroll
|
|
13
|
+
```
|
|
14
|
+
|
|
15
|
+
Or install it globally:
|
|
16
|
+
|
|
17
|
+
```bash
|
|
18
|
+
npm install -g agentcontroll
|
|
19
|
+
agentcontroll
|
|
20
|
+
```
|
|
21
|
+
|
|
22
|
+
On first execution, the runner detects your host operating system and CPU architecture, downloads the matching prebuilt release binary, and invokes the terminal interface with transparent signal and stdio forwarding.
|
|
23
|
+
|
|
24
|
+
## Commands
|
|
25
|
+
|
|
26
|
+
The package includes the standard suite of commands:
|
|
27
|
+
|
|
28
|
+
```bash
|
|
29
|
+
# Launch the interactive terminal UI
|
|
30
|
+
agentcontroll
|
|
31
|
+
|
|
32
|
+
# Shorthand alias
|
|
33
|
+
ac
|
|
34
|
+
|
|
35
|
+
# Launch or switch Antigravity (agy) agent sessions directly
|
|
36
|
+
agy
|
|
37
|
+
|
|
38
|
+
# Inspect daemon state or start the background control daemon
|
|
39
|
+
agentcontrold --help
|
|
40
|
+
```
|
|
41
|
+
|
|
42
|
+
## Supported Systems
|
|
43
|
+
|
|
44
|
+
- **Linux x86_64** (glibc 2.31+)
|
|
45
|
+
- **macOS x86_64** (Intel)
|
|
46
|
+
- **macOS aarch64** (Apple Silicon)
|
|
47
|
+
- **Windows**: Run natively inside [WSL2](https://learn.microsoft.com/en-us/windows/wsl/install) (`npx agentcontroll`)
|
|
48
|
+
|
|
49
|
+
## License
|
|
50
|
+
|
|
51
|
+
MIT © AgentControll contributors. See [LICENSE](https://github.com/vijaygovindBiju/AgentControll/blob/main/LICENSE) for details.
|
|
2
52
|
|
|
3
|
-
This version is a temporary placeholder for this package. An operational version to replace this has been submitted for review and is awaiting a staged release.
|
package/bin/ac.js
ADDED
package/bin/agy.js
ADDED
|
@@ -0,0 +1,164 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
const fs = require('fs');
|
|
4
|
+
const path = require('path');
|
|
5
|
+
const os = require('os');
|
|
6
|
+
const https = require('https');
|
|
7
|
+
const http = require('http');
|
|
8
|
+
const crypto = require('crypto');
|
|
9
|
+
const { execFileSync } = require('child_process');
|
|
10
|
+
const { getTargetTriple, getArchiveName } = require('./platform');
|
|
11
|
+
|
|
12
|
+
const VERSION = require('../package.json').version;
|
|
13
|
+
const GITHUB_REPO = 'vijaygovindBiju/AgentControll';
|
|
14
|
+
|
|
15
|
+
/**
|
|
16
|
+
* Returns the directory where AgentControll binaries are cached.
|
|
17
|
+
*/
|
|
18
|
+
function getCacheDir(version = VERSION) {
|
|
19
|
+
const baseCache = process.env.XDG_CACHE_HOME || path.join(os.homedir(), '.cache');
|
|
20
|
+
return path.join(baseCache, 'agentcontrol', 'bin', `v${version}`);
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
/**
|
|
24
|
+
* HTTP GET request helper that follows redirects.
|
|
25
|
+
*/
|
|
26
|
+
function downloadFile(url, destPath, maxRedirects = 5) {
|
|
27
|
+
return new Promise((resolve, reject) => {
|
|
28
|
+
if (maxRedirects < 0) {
|
|
29
|
+
return reject(new Error(`Too many redirects when downloading ${url}`));
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
const client = url.startsWith('https:') ? https : http;
|
|
33
|
+
const req = client.get(url, (res) => {
|
|
34
|
+
if (res.statusCode >= 300 && res.statusCode < 400 && res.headers.location) {
|
|
35
|
+
const redirectUrl = new URL(res.headers.location, url).toString();
|
|
36
|
+
res.resume(); // Drain stream
|
|
37
|
+
return resolve(downloadFile(redirectUrl, destPath, maxRedirects - 1));
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
if (res.statusCode !== 200) {
|
|
41
|
+
res.resume();
|
|
42
|
+
return reject(new Error(`Download failed with HTTP status ${res.statusCode} from ${url}`));
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
const fileStream = fs.createWriteStream(destPath);
|
|
46
|
+
res.pipe(fileStream);
|
|
47
|
+
|
|
48
|
+
fileStream.on('finish', () => {
|
|
49
|
+
fileStream.close(resolve);
|
|
50
|
+
});
|
|
51
|
+
|
|
52
|
+
fileStream.on('error', (err) => {
|
|
53
|
+
fs.unlink(destPath, () => {});
|
|
54
|
+
reject(err);
|
|
55
|
+
});
|
|
56
|
+
});
|
|
57
|
+
|
|
58
|
+
req.on('error', (err) => {
|
|
59
|
+
fs.unlink(destPath, () => {});
|
|
60
|
+
reject(err);
|
|
61
|
+
});
|
|
62
|
+
});
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
/**
|
|
66
|
+
* Calculates SHA256 checksum of a file.
|
|
67
|
+
*/
|
|
68
|
+
function getFileSha256(filePath) {
|
|
69
|
+
return new Promise((resolve, reject) => {
|
|
70
|
+
const hash = crypto.createHash('sha256');
|
|
71
|
+
const stream = fs.createReadStream(filePath);
|
|
72
|
+
stream.on('data', (data) => hash.update(data));
|
|
73
|
+
stream.on('end', () => resolve(hash.digest('hex')));
|
|
74
|
+
stream.on('error', reject);
|
|
75
|
+
});
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
/**
|
|
79
|
+
* Ensures the binary exists and is executable.
|
|
80
|
+
* Downloads from GitHub releases if not already cached.
|
|
81
|
+
*
|
|
82
|
+
* @param {string} binaryName Name of the binary (e.g. 'agentcontroll', 'agent-control', 'agentcontrold', 'agy', 'ac')
|
|
83
|
+
* @returns {Promise<string>} Absolute path to the executable binary
|
|
84
|
+
*/
|
|
85
|
+
async function ensureBinary(binaryName = 'agentcontroll') {
|
|
86
|
+
// 1. Check AGENTCONTROL_BIN_DIR override (useful for dev or custom installations)
|
|
87
|
+
if (process.env.AGENTCONTROL_BIN_DIR) {
|
|
88
|
+
const overridePath = path.join(process.env.AGENTCONTROL_BIN_DIR, binaryName);
|
|
89
|
+
if (fs.existsSync(overridePath)) {
|
|
90
|
+
return overridePath;
|
|
91
|
+
}
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
// 2. Check local cache directory
|
|
95
|
+
const cacheDir = getCacheDir(VERSION);
|
|
96
|
+
const binaryPath = path.join(cacheDir, binaryName);
|
|
97
|
+
|
|
98
|
+
if (fs.existsSync(binaryPath)) {
|
|
99
|
+
try {
|
|
100
|
+
fs.accessSync(binaryPath, fs.constants.X_OK);
|
|
101
|
+
return binaryPath;
|
|
102
|
+
} catch {
|
|
103
|
+
// If not executable, make it executable
|
|
104
|
+
fs.chmodSync(binaryPath, 0o755);
|
|
105
|
+
return binaryPath;
|
|
106
|
+
}
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
// 3. Need to download archive
|
|
110
|
+
const targetTriple = getTargetTriple();
|
|
111
|
+
const archiveName = getArchiveName(VERSION, targetTriple);
|
|
112
|
+
const baseUrl = process.env.AGENTCONTROL_DOWNLOAD_URL_BASE ||
|
|
113
|
+
`https://github.com/${GITHUB_REPO}/releases/download/v${VERSION}`;
|
|
114
|
+
const archiveUrl = `${baseUrl}/${archiveName}`;
|
|
115
|
+
|
|
116
|
+
fs.mkdirSync(cacheDir, { recursive: true });
|
|
117
|
+
const tempArchive = path.join(cacheDir, `${archiveName}.tmp`);
|
|
118
|
+
|
|
119
|
+
process.stderr.write(`[agentcontroll] Downloading AgentControll v${VERSION} for ${targetTriple}...\n`);
|
|
120
|
+
|
|
121
|
+
try {
|
|
122
|
+
await downloadFile(archiveUrl, tempArchive);
|
|
123
|
+
|
|
124
|
+
// Extract using system tar
|
|
125
|
+
process.stderr.write(`[agentcontroll] Extracting binary archive...\n`);
|
|
126
|
+
execFileSync('tar', ['-xzf', tempArchive, '-C', cacheDir]);
|
|
127
|
+
|
|
128
|
+
// Ensure permissions
|
|
129
|
+
const binaries = ['agentcontroll', 'agent-control', 'agentcontrold', 'agy', 'ac'];
|
|
130
|
+
for (const bin of binaries) {
|
|
131
|
+
const p = path.join(cacheDir, bin);
|
|
132
|
+
if (fs.existsSync(p)) {
|
|
133
|
+
fs.chmodSync(p, 0o755);
|
|
134
|
+
}
|
|
135
|
+
}
|
|
136
|
+
|
|
137
|
+
// Clean up temporary archive
|
|
138
|
+
try {
|
|
139
|
+
fs.unlinkSync(tempArchive);
|
|
140
|
+
} catch {}
|
|
141
|
+
|
|
142
|
+
if (!fs.existsSync(binaryPath)) {
|
|
143
|
+
throw new Error(`Expected binary '${binaryName}' was not found in downloaded release archive.`);
|
|
144
|
+
}
|
|
145
|
+
|
|
146
|
+
process.stderr.write(`[agentcontroll] Ready.\n`);
|
|
147
|
+
return binaryPath;
|
|
148
|
+
} catch (err) {
|
|
149
|
+
try {
|
|
150
|
+
if (fs.existsSync(tempArchive)) fs.unlinkSync(tempArchive);
|
|
151
|
+
} catch {}
|
|
152
|
+
throw new Error(
|
|
153
|
+
`Failed to download prebuilt AgentControll binary from ${archiveUrl}:\n${err.message}\n` +
|
|
154
|
+
`You can build from source using 'cargo build --release' or set AGENTCONTROL_BIN_DIR.`
|
|
155
|
+
);
|
|
156
|
+
}
|
|
157
|
+
}
|
|
158
|
+
|
|
159
|
+
module.exports = {
|
|
160
|
+
getCacheDir,
|
|
161
|
+
downloadFile,
|
|
162
|
+
getFileSha256,
|
|
163
|
+
ensureBinary,
|
|
164
|
+
};
|
package/lib/index.js
ADDED
package/lib/platform.js
ADDED
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
const os = require('os');
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* Supported release targets and their mapping to GitHub Release archives.
|
|
7
|
+
*/
|
|
8
|
+
const SUPPORTED_TARGETS = {
|
|
9
|
+
'linux-x64': 'x86_64-unknown-linux-gnu',
|
|
10
|
+
'darwin-x64': 'x86_64-apple-darwin',
|
|
11
|
+
'darwin-arm64': 'aarch64-apple-darwin',
|
|
12
|
+
};
|
|
13
|
+
|
|
14
|
+
/**
|
|
15
|
+
* Returns the target triple for the current system, or throws a helpful error.
|
|
16
|
+
*/
|
|
17
|
+
function getTargetTriple() {
|
|
18
|
+
const platform = process.env.AGENTCONTROL_PLATFORM || os.platform();
|
|
19
|
+
const arch = process.env.AGENTCONTROL_ARCH || os.arch();
|
|
20
|
+
|
|
21
|
+
if (platform === 'win32') {
|
|
22
|
+
throw new Error(
|
|
23
|
+
'AgentControll requires POSIX Unix domain sockets (mode 0600) and native terminal signals.\n' +
|
|
24
|
+
'Windows users should run AgentControll inside WSL2 (Windows Subsystem for Linux):\n' +
|
|
25
|
+
' wsl --install\n' +
|
|
26
|
+
'Inside WSL2, run: npx agentcontroll'
|
|
27
|
+
);
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
const key = `${platform}-${arch}`;
|
|
31
|
+
const target = SUPPORTED_TARGETS[key];
|
|
32
|
+
|
|
33
|
+
if (!target) {
|
|
34
|
+
throw new Error(
|
|
35
|
+
`Unsupported platform/architecture: ${platform}-${arch}.\n` +
|
|
36
|
+
`AgentControll currently provides prebuilt binaries for:\n` +
|
|
37
|
+
Object.keys(SUPPORTED_TARGETS).map(k => ` - ${k}`).join('\n') +
|
|
38
|
+
`\nTo build from source on your platform, run: cargo build --release`
|
|
39
|
+
);
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
return target;
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
/**
|
|
46
|
+
* Returns the release archive name for a given version and target triple.
|
|
47
|
+
*/
|
|
48
|
+
function getArchiveName(version, target) {
|
|
49
|
+
return `agentcontroll-v${version}-${target}.tar.gz`;
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
|
|
53
|
+
module.exports = {
|
|
54
|
+
SUPPORTED_TARGETS,
|
|
55
|
+
getTargetTriple,
|
|
56
|
+
getArchiveName,
|
|
57
|
+
};
|
package/lib/runner.js
ADDED
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
const { spawn } = require('child_process');
|
|
4
|
+
const { ensureBinary } = require('./downloader');
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* Executes a target AgentControll binary, forwarding arguments, stdio, and signals.
|
|
8
|
+
*
|
|
9
|
+
* @param {string} binaryName Name of the binary to run ('agentcontroll', 'agy', etc.)
|
|
10
|
+
*/
|
|
11
|
+
async function runBinary(binaryName) {
|
|
12
|
+
try {
|
|
13
|
+
const binaryPath = await ensureBinary(binaryName);
|
|
14
|
+
|
|
15
|
+
const child = spawn(binaryPath, process.argv.slice(2), {
|
|
16
|
+
stdio: 'inherit',
|
|
17
|
+
});
|
|
18
|
+
|
|
19
|
+
// Forward terminal resize signal (vital for TUI layout updates)
|
|
20
|
+
const onResize = () => {
|
|
21
|
+
if (child.pid && !child.killed) {
|
|
22
|
+
try {
|
|
23
|
+
child.kill('SIGWINCH');
|
|
24
|
+
} catch {}
|
|
25
|
+
}
|
|
26
|
+
};
|
|
27
|
+
process.on('SIGWINCH', onResize);
|
|
28
|
+
|
|
29
|
+
// Forward termination signals
|
|
30
|
+
const onSignal = (sig) => {
|
|
31
|
+
if (child.pid && !child.killed) {
|
|
32
|
+
try {
|
|
33
|
+
child.kill(sig);
|
|
34
|
+
} catch {}
|
|
35
|
+
}
|
|
36
|
+
};
|
|
37
|
+
process.on('SIGINT', () => onSignal('SIGINT'));
|
|
38
|
+
process.on('SIGTERM', () => onSignal('SIGTERM'));
|
|
39
|
+
|
|
40
|
+
child.on('close', (code, signal) => {
|
|
41
|
+
process.removeListener('SIGWINCH', onResize);
|
|
42
|
+
if (signal) {
|
|
43
|
+
process.kill(process.pid, signal);
|
|
44
|
+
} else {
|
|
45
|
+
process.exit(code !== null ? code : 0);
|
|
46
|
+
}
|
|
47
|
+
});
|
|
48
|
+
|
|
49
|
+
child.on('error', (err) => {
|
|
50
|
+
console.error(`[agentcontroll] Failed to execute ${binaryName}: ${err.message}`);
|
|
51
|
+
process.exit(1);
|
|
52
|
+
});
|
|
53
|
+
} catch (err) {
|
|
54
|
+
console.error(`[agentcontroll] Error: ${err.message}`);
|
|
55
|
+
process.exit(1);
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
module.exports = {
|
|
60
|
+
runBinary,
|
|
61
|
+
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,46 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "agentcontroll",
|
|
3
|
-
"version": "
|
|
4
|
-
"
|
|
5
|
-
"
|
|
6
|
-
|
|
3
|
+
"version": "1.0.0",
|
|
4
|
+
"description": "Local-first control plane for coding agents (Antigravity, Claude Code, Codex, Devin CLI)",
|
|
5
|
+
"bin": {
|
|
6
|
+
"agentcontroll": "bin/agentcontroll.js",
|
|
7
|
+
"agent-control": "bin/agent-control.js",
|
|
8
|
+
"agy": "bin/agy.js",
|
|
9
|
+
"ac": "bin/ac.js",
|
|
10
|
+
"agentcontrold": "bin/agentcontrold.js"
|
|
11
|
+
},
|
|
12
|
+
"main": "./lib/index.js",
|
|
13
|
+
"scripts": {
|
|
14
|
+
"test": "node test/platform.test.js"
|
|
15
|
+
},
|
|
16
|
+
"files": [
|
|
17
|
+
"bin/",
|
|
18
|
+
"lib/",
|
|
19
|
+
"README.md",
|
|
20
|
+
"LICENSE"
|
|
21
|
+
],
|
|
22
|
+
"keywords": [
|
|
23
|
+
"coding-agent",
|
|
24
|
+
"antigravity",
|
|
25
|
+
"claude-code",
|
|
26
|
+
"pty",
|
|
27
|
+
"terminal",
|
|
28
|
+
"tui",
|
|
29
|
+
"ai-agents",
|
|
30
|
+
"developer-tools"
|
|
31
|
+
],
|
|
32
|
+
"author": "AgentControll contributors",
|
|
33
|
+
"license": "MIT",
|
|
34
|
+
"repository": {
|
|
35
|
+
"type": "git",
|
|
36
|
+
"url": "https://github.com/vijaygovindBiju/AgentControll"
|
|
37
|
+
},
|
|
38
|
+
"bugs": {
|
|
39
|
+
"url": "https://github.com/vijaygovindBiju/AgentControll/issues"
|
|
40
|
+
},
|
|
41
|
+
"homepage": "https://github.com/vijaygovindBiju/AgentControll#readme",
|
|
42
|
+
"engines": {
|
|
43
|
+
"node": ">=18.0.0"
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
|