@compozy/agh 0.0.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/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 NauckGroup LTDA
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 ADDED
@@ -0,0 +1,108 @@
1
+ <div align="center">
2
+ <img src="packages/site/public/icon-512.png" alt="AGH" width="96" height="96">
3
+ <h1>AGH</h1>
4
+ <p><strong>An open workplace for AI agents.</strong></p>
5
+ <p>
6
+ <a href="https://github.com/compozy/agh/actions/workflows/ci.yml">
7
+ <img src="https://github.com/compozy/agh/actions/workflows/ci.yml/badge.svg" alt="CI">
8
+ </a>
9
+ <a href="https://github.com/compozy/agh/releases">
10
+ <img src="https://img.shields.io/github/v/release/compozy/agh?include_prereleases" alt="Release">
11
+ </a>
12
+ <a href="https://goreportcard.com/report/github.com/compozy/agh">
13
+ <img src="https://goreportcard.com/badge/github.com/compozy/agh" alt="Go Report Card">
14
+ </a>
15
+ <a href="LICENSE">
16
+ <img src="https://img.shields.io/badge/License-MIT-blue.svg" alt="License: MIT">
17
+ </a>
18
+ </p>
19
+ </div>
20
+
21
+ AGH is a local-first agent operating system. It runs the agent CLIs you already use — Claude Code, OpenClaw, Hermes, and others — as durable, inspectable sessions managed by a single background daemon, and connects them on the open `agh-network/v0` so sessions can discover peers, share capabilities, and close work with receipts.
22
+
23
+ The complete documentation lives at [agh.network](https://agh.network).
24
+
25
+ <div align="center">
26
+ <img src="docs/design/screen.png" alt="AGH" width="100%">
27
+ </div>
28
+
29
+ ## Highlights
30
+
31
+ - **AGH Network.** Active sessions become peers — they discover each other, exchange typed envelopes on `agh-network/v0` channels, and close work with receipts.
32
+ - **Local-first durable runtime.** One Go binary and a background daemon keep sessions, events, and state in local SQLite — durable, resumable, and inspectable long after the terminal closes.
33
+ - **Agent-manageable surfaces.** The same runtime state is exposed through CLI, HTTP/SSE, UDS, and a web UI, so agents operate AGH through structured controls instead of UI-only paths.
34
+ - **Autonomy kernel.** Task runs, claim tokens, leases, and safe spawn keep multi-agent work observable and bounded.
35
+ - **Extensible runtime.** Native Go tools, MCP, extensions, hooks, skills, and bridges plug into one daemon-owned tool registry.
36
+
37
+ ## Install
38
+
39
+ ```bash
40
+ curl -fsSL https://agh.network/install.sh | sh
41
+ ```
42
+
43
+ Homebrew:
44
+
45
+ ```bash
46
+ brew install compozy/compozy/agh
47
+ ```
48
+
49
+ npm:
50
+
51
+ ```bash
52
+ npm install -g @compozy/agh
53
+ ```
54
+
55
+ Go:
56
+
57
+ ```bash
58
+ go install github.com/compozy/agh@latest
59
+ ```
60
+
61
+ The full [Installation guide](https://agh.network/runtime/core/getting-started/installation) covers the verified binary installer, Linux packages, and source builds.
62
+
63
+ ## Quick start
64
+
65
+ ```bash
66
+ agh install
67
+ agh daemon start
68
+ agh workspace add "$PWD" --name current
69
+ agh session new --workspace current --agent general
70
+ ```
71
+
72
+ See the [Quick Start](https://agh.network/runtime/core/getting-started/quick-start) for the full walkthrough.
73
+
74
+ ## Documentation
75
+
76
+ - [Runtime overview](https://agh.network/runtime)
77
+ - [Installation](https://agh.network/runtime/core/getting-started/installation)
78
+ - [Quick Start](https://agh.network/runtime/core/getting-started/quick-start)
79
+ - [CLI reference](https://agh.network/runtime/cli-reference)
80
+ - [Extensions](https://agh.network/runtime/core/extensions)
81
+ - [AGH Network protocol](https://agh.network/protocol)
82
+ - [GitHub releases](https://github.com/compozy/agh/releases)
83
+
84
+ ## Development
85
+
86
+ AGH is a Go and Bun monorepo. Install the toolchains declared by the repo and run the full verification gate before sending changes:
87
+
88
+ ```bash
89
+ make verify
90
+ ```
91
+
92
+ ## Contributing
93
+
94
+ Contributions are welcome. Open an issue or pull request, and run `make verify` before sending changes.
95
+
96
+ ## License
97
+
98
+ AGH is released under the [MIT License](LICENSE).
99
+
100
+ ## Star history
101
+
102
+ <a href="https://www.star-history.com/?repos=compozy%2Fagh&type=date&legend=top-left">
103
+ <picture>
104
+ <source media="(prefers-color-scheme: dark)" srcset="https://api.star-history.com/chart?repos=compozy/agh&type=date&theme=dark&legend=top-left" />
105
+ <source media="(prefers-color-scheme: light)" srcset="https://api.star-history.com/chart?repos=compozy/agh&type=date&legend=top-left" />
106
+ <img alt="Star History Chart" src="https://api.star-history.com/chart?repos=compozy/agh&type=date&legend=top-left" />
107
+ </picture>
108
+ </a>
package/install.js ADDED
@@ -0,0 +1,6 @@
1
+ #!/usr/bin/env node
2
+
3
+ // This file was generated by GoReleaser. DO NOT EDIT.
4
+
5
+ import { install } from "./lib.js";
6
+ install();
package/lib.js ADDED
@@ -0,0 +1,259 @@
1
+ // This file was generated by GoReleaser. DO NOT EDIT.
2
+ import fs from "fs";
3
+ import crypto from "crypto";
4
+ import http from "http";
5
+ import https from "https";
6
+ import path from "path";
7
+ import JSZip from "jszip";
8
+ import { x as tarExtract } from "tar";
9
+ import { ProxyAgent } from "proxy-agent";
10
+ import { spawnSync } from "child_process";
11
+ import { fileURLToPath } from "url";
12
+
13
+ const { archives, name, version } = JSON.parse(
14
+ fs.readFileSync(new URL("./package.json", import.meta.url), "utf8"),
15
+ );
16
+
17
+ const agent = new ProxyAgent();
18
+ const __dirname = path.dirname(fileURLToPath(import.meta.url));
19
+
20
+ const getArchive = () => {
21
+ let target = `${process.platform}-${process.arch}`;
22
+ const archive = archives[target];
23
+ if (!archive) {
24
+ throw new Error(`No archive available for ${target}`);
25
+ }
26
+ return archive;
27
+ };
28
+
29
+ const binDir = path.join(__dirname, "bin");
30
+
31
+ async function extractTar(tarPath, binaries, dir, wrappedIn) {
32
+ try {
33
+ const filesToExtract = wrappedIn
34
+ ? binaries.map((bin) =>
35
+ path.join(wrappedIn, bin).replace(/\\/g, "/"),
36
+ )
37
+ : binaries;
38
+
39
+ await tarExtract({
40
+ file: tarPath,
41
+ cwd: dir,
42
+ filter: (path) => filesToExtract.includes(path),
43
+ });
44
+
45
+ // If wrapped, move files from wrapped directory to bin directory
46
+ if (wrappedIn) {
47
+ const wrappedDir = path.join(dir, wrappedIn);
48
+ for (const binary of binaries) {
49
+ const srcPath = path.join(wrappedDir, binary);
50
+ const destPath = path.join(dir, binary);
51
+ if (fs.existsSync(srcPath)) {
52
+ fs.renameSync(srcPath, destPath);
53
+ }
54
+ }
55
+ // Clean up empty wrapped directory
56
+ try {
57
+ fs.rmSync(wrappedDir, { recursive: true, force: true });
58
+ } catch (err) {
59
+ // Ignore cleanup errors
60
+ }
61
+ }
62
+
63
+ console.log(`Successfully extracted ${binaries} to "${dir}"`);
64
+ } catch (err) {
65
+ throw new Error(`Extraction failed: ${err.message}`);
66
+ }
67
+ }
68
+
69
+ async function extractZip(zipPath, binaries, dir, wrappedIn) {
70
+ try {
71
+ const zipData = fs.readFileSync(zipPath);
72
+ const zip = await JSZip.loadAsync(zipData);
73
+
74
+ for (const binary of binaries) {
75
+ const binaryPath = wrappedIn
76
+ ? path.join(wrappedIn, binary).replace(/\\/g, "/")
77
+ : binary;
78
+
79
+ if (!zip.files[binaryPath]) {
80
+ throw new Error(
81
+ `Error: ${binaryPath} does not exist in ${zipPath}`,
82
+ );
83
+ }
84
+
85
+ const content = await zip.files[binaryPath].async("nodebuffer");
86
+ if (!fs.existsSync(dir)) {
87
+ fs.mkdirSync(dir, { recursive: true });
88
+ }
89
+ const file = path.join(dir, binary);
90
+ fs.writeFileSync(file, content);
91
+ fs.chmodSync(file, "755");
92
+ console.log(`Successfully extracted "${binary}" to "${dir}"`);
93
+ }
94
+ } catch (err) {
95
+ throw new Error(`Extraction failed: ${err.message}`);
96
+ }
97
+ }
98
+
99
+ const run = async (bin) => {
100
+ await install();
101
+ if (process.platform === "win32") {
102
+ bin += ".exe";
103
+ }
104
+ const [, , ...args] = process.argv;
105
+ let result = spawnSync(path.join(binDir, bin), args, {
106
+ cwd: process.cwd(),
107
+ stdio: "inherit",
108
+ });
109
+ if (result.error) {
110
+ console.error(result.error);
111
+ }
112
+ return result.status;
113
+ };
114
+
115
+ const install = async () => {
116
+ try {
117
+ let archive = getArchive();
118
+ if (await exists(archive)) {
119
+ return;
120
+ }
121
+ let tmp = fs.mkdtempSync("archive-");
122
+ let archivePath = path.join(tmp, archive.name);
123
+ await download(archive.url, archivePath);
124
+ verify(archivePath, archive.checksum);
125
+
126
+ if (!fs.existsSync(binDir)) {
127
+ fs.mkdirSync(binDir);
128
+ }
129
+ switch (archive.format) {
130
+ case "binary":
131
+ const bin = path.join(binDir, archive.bins[0]);
132
+ fs.copyFileSync(archivePath, bin);
133
+ fs.chmodSync(bin, 0o755);
134
+ break;
135
+ case "zip":
136
+ await extractZip(
137
+ archivePath,
138
+ archive.bins,
139
+ binDir,
140
+ archive.wrappedIn,
141
+ );
142
+ break;
143
+ case "tar":
144
+ case "tar.gz":
145
+ case "tgz":
146
+ await extractTar(
147
+ archivePath,
148
+ archive.bins,
149
+ binDir,
150
+ archive.wrappedIn,
151
+ );
152
+ break;
153
+ case "tar.zst":
154
+ case "tzst":
155
+ case "tar.xz":
156
+ case "txz":
157
+ default:
158
+ throw new Error(`unsupported format: ${archive.format}`);
159
+ }
160
+ console.log(`Installed ${name} ${version} to ${binDir}`);
161
+ } catch (err) {
162
+ throw new Error(`Installation failed: ${err.message}`);
163
+ }
164
+ };
165
+
166
+ const verify = (filename, checksum) => {
167
+ if (checksum.algorithm == "" || checksum.digest == "") {
168
+ console.warn("Warning: No checksum provided for verification");
169
+ return;
170
+ }
171
+ let digest = crypto
172
+ .createHash(checksum.algorithm)
173
+ .update(fs.readFileSync(filename))
174
+ .digest("hex");
175
+ if (digest != checksum.digest) {
176
+ throw new Error(
177
+ `${filename}: ${checksum.algorithm} does not match, expected ${checksum.digest}, got ${digest}`,
178
+ );
179
+ }
180
+ };
181
+
182
+ const download = async (url, filename, maxRedirects = 10) => {
183
+ try {
184
+ console.log(`Downloading ${url} to ${filename}...`);
185
+ const dir = path.dirname(filename);
186
+ if (!fs.existsSync(dir)) {
187
+ fs.mkdirSync(dir, { recursive: true });
188
+ }
189
+
190
+ return new Promise((resolve, reject) => {
191
+ const parsedUrl = new URL(url);
192
+ const mod = parsedUrl.protocol === "https:" ? https : http;
193
+
194
+ const request = mod.get(url, { agent }, (response) => {
195
+ if (
196
+ response.statusCode >= 300 &&
197
+ response.statusCode < 400 &&
198
+ response.headers.location
199
+ ) {
200
+ if (maxRedirects <= 0) {
201
+ reject(new Error("Too many redirects"));
202
+ return;
203
+ }
204
+ download(response.headers.location, filename, maxRedirects - 1)
205
+ .then(resolve)
206
+ .catch(reject);
207
+ return;
208
+ }
209
+
210
+ if (response.statusCode !== 200) {
211
+ reject(
212
+ new Error(
213
+ `HTTP ${response.statusCode}: ${response.statusMessage}`,
214
+ ),
215
+ );
216
+ return;
217
+ }
218
+
219
+ const writer = fs.createWriteStream(filename);
220
+ response.pipe(writer);
221
+
222
+ writer.on("finish", () => {
223
+ console.log(`Download complete: ${filename}`);
224
+ resolve(dir);
225
+ });
226
+
227
+ writer.on("error", (err) => {
228
+ console.error(`Error writing file: ${err.message}`);
229
+ reject(err);
230
+ });
231
+ });
232
+
233
+ request.on("error", (err) => {
234
+ reject(new Error(`Request failed: ${err.message}`));
235
+ });
236
+
237
+ request.setTimeout(300000, () => {
238
+ request.destroy();
239
+ reject(new Error("Request timed out"));
240
+ });
241
+ });
242
+ } catch (err) {
243
+ throw new Error(`Download failed: ${err.message}`);
244
+ }
245
+ };
246
+
247
+ function exists(archive) {
248
+ if (!fs.existsSync(binDir)) {
249
+ return false;
250
+ }
251
+ return archive.bins.every((bin) => fs.existsSync(path.join(binDir, bin)));
252
+ }
253
+
254
+ export {
255
+ install,
256
+ run,
257
+ getArchive,
258
+ download,
259
+ };
package/package.json ADDED
@@ -0,0 +1,78 @@
1
+ {
2
+ "name": "@compozy/agh",
3
+ "type": "module",
4
+ "version": "0.0.2",
5
+ "description": "AGH — Artificial General Hivemind",
6
+ "scripts": {
7
+ "postinstall": "node install.js",
8
+ "run": "node run-agh.js"
9
+ },
10
+ "repository": {
11
+ "type": "git",
12
+ "url": "git+https://github.com/compozy/agh.git"
13
+ },
14
+ "author": "AGH Team",
15
+ "license": "MIT",
16
+ "bugs": {
17
+ "url": "https://github.com/compozy/agh/issues"
18
+ },
19
+ "homepage": "https://agh.network",
20
+ "bin": {
21
+ "agh": "run-agh.js"
22
+ },
23
+ "dependencies": {
24
+ "jszip": "3.10.1",
25
+ "proxy-agent": "8.0.1",
26
+ "tar": "7.5.15"
27
+ },
28
+ "archives": {
29
+ "darwin-arm64": {
30
+ "name": "agh_darwin_arm64.tar.gz",
31
+ "url": "https://github.com/compozy/agh/releases/download/v0.0.2/agh_darwin_arm64.tar.gz",
32
+ "bins": [
33
+ "agh"
34
+ ],
35
+ "format": "tar.gz",
36
+ "checksum": {
37
+ "algorithm": "sha256",
38
+ "digest": "59ab94fb921808c76306cab91774c807dfdb4a9f5671ccbd7cc2c8a7205eece7"
39
+ }
40
+ },
41
+ "darwin-x64": {
42
+ "name": "agh_darwin_x86_64.tar.gz",
43
+ "url": "https://github.com/compozy/agh/releases/download/v0.0.2/agh_darwin_x86_64.tar.gz",
44
+ "bins": [
45
+ "agh"
46
+ ],
47
+ "format": "tar.gz",
48
+ "checksum": {
49
+ "algorithm": "sha256",
50
+ "digest": "f2dfe64754234bc95e008ace5c39e9f0f6fa517e4b63d11bcc9bfb7e4fd55397"
51
+ }
52
+ },
53
+ "linux-arm64": {
54
+ "name": "agh_linux_arm64.tar.gz",
55
+ "url": "https://github.com/compozy/agh/releases/download/v0.0.2/agh_linux_arm64.tar.gz",
56
+ "bins": [
57
+ "agh"
58
+ ],
59
+ "format": "tar.gz",
60
+ "checksum": {
61
+ "algorithm": "sha256",
62
+ "digest": "5ed4f624eafaa9834288dab6218e3a8f1ff9ec6e0f70d1702476d6598189a45b"
63
+ }
64
+ },
65
+ "linux-x64": {
66
+ "name": "agh_linux_x86_64.tar.gz",
67
+ "url": "https://github.com/compozy/agh/releases/download/v0.0.2/agh_linux_x86_64.tar.gz",
68
+ "bins": [
69
+ "agh"
70
+ ],
71
+ "format": "tar.gz",
72
+ "checksum": {
73
+ "algorithm": "sha256",
74
+ "digest": "6745cd37374be157c35216120e84d22932a7507ccdab4fa12ec84763c1f7ef0d"
75
+ }
76
+ }
77
+ }
78
+ }
package/run-agh.js ADDED
@@ -0,0 +1,6 @@
1
+ #!/usr/bin/env node
2
+
3
+ // This file was generated by GoReleaser. DO NOT EDIT.
4
+
5
+ import { run } from "./lib.js";
6
+ run("agh").then((code) => process.exit(code));