@baldaworks/acprun 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 +136 -0
- package/acprun.js +49 -0
- package/package.json +23 -0
package/README.md
ADDED
|
@@ -0,0 +1,136 @@
|
|
|
1
|
+
# acprun
|
|
2
|
+
|
|
3
|
+
`acprun` is a CLI tool, runner, and Go library for discovering, resolving, and running agents published in the [Agent Client Protocol (ACP) Registry](https://agentclientprotocol.com).
|
|
4
|
+
|
|
5
|
+
It transparently handles distribution resolution across:
|
|
6
|
+
- **Binary Archives**: Detects host OS and CPU architecture (`linux-x86_64`, `linux-aarch64`, `darwin-aarch64`, `darwin-x86_64`, `windows-x86_64`, `windows-aarch64`), downloads `.zip` or `.tar.gz` archives, validates optional SHA256 integrity checksums, safely extracts to local user cache (with strict Zip Slip protection), sets `0755` executable permissions, and builds the command vector.
|
|
7
|
+
- **NPX Packages**: Formats `["npx", "-y", <package>, <args...>]` and sets environment variables.
|
|
8
|
+
- **UVX Packages**: Formats `["uvx", <package>, <args...>]` and sets environment variables.
|
|
9
|
+
- **Offline Resilient Caching**: Caches registry manifests and downloaded binaries under `os.UserCacheDir()/acprun/` for fast, offline reuse.
|
|
10
|
+
|
|
11
|
+
---
|
|
12
|
+
|
|
13
|
+
## Installation
|
|
14
|
+
|
|
15
|
+
### Via Go
|
|
16
|
+
```bash
|
|
17
|
+
go install github.com/baldaworks/acprun/cmd/acprun@latest
|
|
18
|
+
```
|
|
19
|
+
|
|
20
|
+
### Via NPX (Omnidist)
|
|
21
|
+
```bash
|
|
22
|
+
npx -y @baldaworks/acprun list
|
|
23
|
+
```
|
|
24
|
+
|
|
25
|
+
---
|
|
26
|
+
|
|
27
|
+
## Quick Start & One-Shot Mode
|
|
28
|
+
|
|
29
|
+
`acprun` supports **one-shot execution** directly without needing explicit subcommands (similar to `npx` or `uvx`):
|
|
30
|
+
|
|
31
|
+
```bash
|
|
32
|
+
# Run a binary agent
|
|
33
|
+
acprun goose
|
|
34
|
+
|
|
35
|
+
# Run an NPX agent with arguments
|
|
36
|
+
acprun cline --acp
|
|
37
|
+
|
|
38
|
+
# Run a UVX agent
|
|
39
|
+
acprun fast-agent -x
|
|
40
|
+
|
|
41
|
+
# Pass arbitrary flags directly to the agent
|
|
42
|
+
acprun amp-acp --verbose
|
|
43
|
+
```
|
|
44
|
+
|
|
45
|
+
---
|
|
46
|
+
|
|
47
|
+
## CLI Reference
|
|
48
|
+
|
|
49
|
+
### Global Flags
|
|
50
|
+
```text
|
|
51
|
+
-r, --registry string ACP Registry URL (default: official CDN, env: ACP_REGISTRY_URL)
|
|
52
|
+
--cache-dir string Custom cache directory (default: $USER_CACHE_DIR/acprun, env: ACP_CACHE_DIR)
|
|
53
|
+
--offline Offline mode: use cached manifests and binaries only
|
|
54
|
+
-v, --verbose Enable verbose output
|
|
55
|
+
-h, --help Help for acprun
|
|
56
|
+
```
|
|
57
|
+
|
|
58
|
+
### Commands
|
|
59
|
+
|
|
60
|
+
#### `acprun list`
|
|
61
|
+
List all agents available in the ACP registry.
|
|
62
|
+
```bash
|
|
63
|
+
# Formatted table
|
|
64
|
+
acprun list
|
|
65
|
+
|
|
66
|
+
# Filter by distribution format
|
|
67
|
+
acprun list --distribution binary
|
|
68
|
+
|
|
69
|
+
# JSON output
|
|
70
|
+
acprun list --format json
|
|
71
|
+
```
|
|
72
|
+
|
|
73
|
+
#### `acprun info <agent-id>` (alias: `show`)
|
|
74
|
+
Display detailed agent metadata, license, authors, repository, and platform distribution specs.
|
|
75
|
+
```bash
|
|
76
|
+
acprun info devin
|
|
77
|
+
acprun info gemini --json
|
|
78
|
+
```
|
|
79
|
+
|
|
80
|
+
#### `acprun resolve <agent-id>`
|
|
81
|
+
Dry-run resolution: downloads and extracts binary archives to local cache if needed, and prints the resolved command vector without running the process.
|
|
82
|
+
```bash
|
|
83
|
+
acprun resolve antigravity-acp --json
|
|
84
|
+
acprun resolve goose --platform linux-x86_64
|
|
85
|
+
```
|
|
86
|
+
|
|
87
|
+
#### `acprun run <agent-id> [-- extra-args...]` (aliases: `serve`, `exec`, `start`)
|
|
88
|
+
Explicit execution form to run any agent without potential name collision (e.g. running an agent named `list` or `cache`).
|
|
89
|
+
```bash
|
|
90
|
+
# Explicit run
|
|
91
|
+
acprun run cursor -- acp
|
|
92
|
+
|
|
93
|
+
# Using serve alias
|
|
94
|
+
acprun serve devin
|
|
95
|
+
|
|
96
|
+
# Pass extra environment variables
|
|
97
|
+
acprun run fast-agent -e FAST_AGENT_MODEL=custom -- -x
|
|
98
|
+
```
|
|
99
|
+
|
|
100
|
+
#### `acprun cache`
|
|
101
|
+
Manage local ACP cache directory.
|
|
102
|
+
```bash
|
|
103
|
+
# Print cache directory path
|
|
104
|
+
acprun cache path
|
|
105
|
+
|
|
106
|
+
# Purge cache
|
|
107
|
+
acprun cache clean --all
|
|
108
|
+
acprun cache clean --manifests-only
|
|
109
|
+
```
|
|
110
|
+
|
|
111
|
+
#### `acprun version`
|
|
112
|
+
Print version and build information.
|
|
113
|
+
```bash
|
|
114
|
+
acprun version
|
|
115
|
+
```
|
|
116
|
+
|
|
117
|
+
---
|
|
118
|
+
|
|
119
|
+
## Architecture & Security
|
|
120
|
+
|
|
121
|
+
- **Targeted Internal Package Layout**:
|
|
122
|
+
- `cmd/acprun/`: Binary entrypoint.
|
|
123
|
+
- `internal/cli/`: Cobra CLI commands with one-shot dispatch.
|
|
124
|
+
- `internal/registry/`: ACP v1 models, HTTP client, and manifest caching.
|
|
125
|
+
- `internal/resolver/`: Host platform detection, safe archive extraction (`.zip`, `.tar.gz`, `.tar.bz2`), and Binary/NPX/UVX distribution resolvers.
|
|
126
|
+
- `internal/runner/`: Process execution, stdio binding, and signal forwarding (`SIGINT`, `SIGTERM`).
|
|
127
|
+
- **Security & Integrity**:
|
|
128
|
+
- **Zip Slip Prevention**: Validates all archive entry paths stay within the target destination directory before extraction.
|
|
129
|
+
- **SHA256 Verification**: Verifies SHA256 integrity checksums against registry manifests.
|
|
130
|
+
- **Static Binaries**: Built with `CGO_ENABLED=0` for pure Go cross-platform portability.
|
|
131
|
+
|
|
132
|
+
---
|
|
133
|
+
|
|
134
|
+
## License
|
|
135
|
+
|
|
136
|
+
Apache-2.0 / MIT
|
package/acprun.js
ADDED
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
const path = require('path');
|
|
3
|
+
const os = require('os');
|
|
4
|
+
|
|
5
|
+
const platform = os.platform();
|
|
6
|
+
const arch = os.arch();
|
|
7
|
+
|
|
8
|
+
const platformMap = {
|
|
9
|
+
'darwin': { x64: 'darwin-x64', arm64: 'darwin-arm64' },
|
|
10
|
+
'linux': { x64: 'linux-x64', arm64: 'linux-arm64' },
|
|
11
|
+
'win32': { x64: 'win32-x64' }
|
|
12
|
+
};
|
|
13
|
+
|
|
14
|
+
const archMap = { x64: 'x64', arm64: 'arm64', ia32: 'x86' };
|
|
15
|
+
const cpu = archMap[arch] || arch;
|
|
16
|
+
|
|
17
|
+
const osKey = platform === 'win32' ? 'win32' : platform;
|
|
18
|
+
const platformKey = platformMap[osKey]?.[cpu];
|
|
19
|
+
|
|
20
|
+
if (!platformKey) {
|
|
21
|
+
console.error('Unsupported platform: ' + platform + '/' + cpu);
|
|
22
|
+
console.error('Expected package: acprun-<os>-<cpu>');
|
|
23
|
+
process.exit(1);
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
const platformPkgName = '@baldaworks/acprun-' + platformKey;
|
|
27
|
+
const binaryName = platform === 'win32' ? 'acprun.exe' : 'acprun';
|
|
28
|
+
|
|
29
|
+
try {
|
|
30
|
+
const { execFileSync } = require('child_process');
|
|
31
|
+
const platformPkgJSON = require.resolve(platformPkgName + '/package.json', { paths: [__dirname] });
|
|
32
|
+
const platformPkgDir = path.dirname(platformPkgJSON);
|
|
33
|
+
const binaryPath = path.join(platformPkgDir, 'bin', binaryName);
|
|
34
|
+
process.exit(execFileSync(binaryPath, process.argv.slice(2), { stdio: 'inherit' }));
|
|
35
|
+
} catch (e) {
|
|
36
|
+
if (e.code === 'ENOENT') {
|
|
37
|
+
console.error('Binary not found in package: ' + platformPkgName);
|
|
38
|
+
console.error('Expected platform package: ' + '@baldaworks/acprun-' + platformKey);
|
|
39
|
+
console.error('This may be an unsupported platform or installation issue.');
|
|
40
|
+
process.exit(1);
|
|
41
|
+
}
|
|
42
|
+
if (e.code === 'MODULE_NOT_FOUND') {
|
|
43
|
+
console.error('Platform package not installed: ' + platformPkgName);
|
|
44
|
+
console.error('Expected platform package: ' + '@baldaworks/acprun-' + platformKey);
|
|
45
|
+
console.error('Try reinstalling the package, and ensure optional dependencies are enabled.');
|
|
46
|
+
process.exit(1);
|
|
47
|
+
}
|
|
48
|
+
process.exit(e.status || 1);
|
|
49
|
+
}
|
package/package.json
ADDED
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
{
|
|
2
|
+
"bin": {
|
|
3
|
+
"acprun": "acprun.js"
|
|
4
|
+
},
|
|
5
|
+
"description": "Meta package for acprun",
|
|
6
|
+
"engines": {
|
|
7
|
+
"node": "\u003e=16"
|
|
8
|
+
},
|
|
9
|
+
"files": [
|
|
10
|
+
"acprun.js",
|
|
11
|
+
"README.md"
|
|
12
|
+
],
|
|
13
|
+
"name": "@baldaworks/acprun",
|
|
14
|
+
"optionalDependencies": {
|
|
15
|
+
"@baldaworks/acprun-darwin-arm64": "0.1.0",
|
|
16
|
+
"@baldaworks/acprun-darwin-x64": "0.1.0",
|
|
17
|
+
"@baldaworks/acprun-linux-arm64": "0.1.0",
|
|
18
|
+
"@baldaworks/acprun-linux-x64": "0.1.0",
|
|
19
|
+
"@baldaworks/acprun-win32-arm64": "0.1.0",
|
|
20
|
+
"@baldaworks/acprun-win32-x64": "0.1.0"
|
|
21
|
+
},
|
|
22
|
+
"version": "0.1.0"
|
|
23
|
+
}
|