@made-by-moonlight/athene 0.9.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,22 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2025 Composio, Inc.
4
+ Copyright (c) 2026 slievr (Athene fork)
5
+
6
+ Permission is hereby granted, free of charge, to any person obtaining a copy
7
+ of this software and associated documentation files (the "Software"), to deal
8
+ in the Software without restriction, including without limitation the rights
9
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
10
+ copies of the Software, and to permit persons to whom the Software is
11
+ furnished to do so, subject to the following conditions:
12
+
13
+ The above copyright notice and this permission notice shall be included in all
14
+ copies or substantial portions of the Software.
15
+
16
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
21
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
22
+ SOFTWARE.
package/README.md ADDED
@@ -0,0 +1,93 @@
1
+ <div align="center">
2
+
3
+ # Athene (`ao`)
4
+
5
+ **The orchestration layer for parallel AI coding agents.**
6
+
7
+ [![npm version](https://img.shields.io/npm/v/%40aoagents%2Fao?style=flat-square)](https://www.npmjs.com/package/@made-by-moonlight/athene)
8
+ [![License: MIT](https://img.shields.io/badge/license-MIT-blue?style=flat-square)](https://github.com/slievr/Athene/blob/main/LICENSE)
9
+ [![GitHub stars](https://img.shields.io/github/stars/slievr/Athene?style=flat-square)](https://github.com/slievr/Athene)
10
+ [![Discord](https://img.shields.io/badge/Discord-Join%20Community-5865F2?style=flat-square&logo=discord&logoColor=white)](https://discord.gg/UZv7JjxbwG)
11
+
12
+ <img width="800" alt="Athene" src="https://raw.githubusercontent.com/slievr/Athene/main/docs/assets/agent_orchestrator_banner.png">
13
+
14
+ </div>
15
+
16
+ Spawn parallel AI coding agents, each in its own git worktree, on a single machine. Agents autonomously fix CI failures, address review comments, and open PRs — you supervise the whole fleet from one dashboard.
17
+
18
+ **Agent-agnostic** (Claude Code, Codex, Aider, Cursor, OpenCode) · **Runtime-agnostic** (tmux, ConPTY/process, Docker) · **Tracker-agnostic** (GitHub, Linear, GitLab)
19
+
20
+ ## Install
21
+
22
+ ```bash
23
+ npm install -g @made-by-moonlight/athene
24
+ ```
25
+
26
+ > **Nightly builds** (latest `main`): `npm install -g @made-by-moonlight/athene@nightly` — back to stable with `@latest`.
27
+
28
+ **Prerequisites:** [Node.js 20.18.3+](https://nodejs.org), [Git 2.25+](https://git-scm.com), the [`gh` CLI](https://cli.github.com), and at least one coding-agent CLI (e.g. [Claude Code](https://www.anthropic.com/claude-code)).
29
+
30
+ - **macOS / Linux:** [tmux](https://github.com/tmux/tmux/wiki/Installing) — `brew install tmux` or `sudo apt install tmux`.
31
+ - **Windows:** PowerShell 7+ recommended; tmux is **not** required (AO uses native ConPTY via the `process` runtime).
32
+
33
+ ## Quick start
34
+
35
+ Point it at any repo — it clones, configures, and launches the dashboard in one command:
36
+
37
+ ```bash
38
+ athene start https://github.com/your-org/your-repo
39
+ ```
40
+
41
+ Or from inside an existing local repo:
42
+
43
+ ```bash
44
+ cd ~/your-project && athene start
45
+ ```
46
+
47
+ The dashboard opens at `http://localhost:3000` and an orchestrator agent starts managing your project. Add more repos any time:
48
+
49
+ ```bash
50
+ athene start ~/path/to/another-repo
51
+ ```
52
+
53
+ You don't need to learn the CLI — the dashboard and the orchestrator agent drive everything. (Individual `ao` commands are documented in the [CLI Reference](https://github.com/slievr/Athene/blob/main/docs/CLI.md) and used internally by the orchestrator.)
54
+
55
+ ## How it works
56
+
57
+ 1. **You start** — `athene start` launches the dashboard and an orchestrator agent.
58
+ 2. **Orchestrator spawns workers** — each issue gets its own agent in an isolated git worktree and branch.
59
+ 3. **Agents work autonomously** — they read code, write tests, and open PRs.
60
+ 4. **Reactions handle feedback** — CI failures and review comments are routed back to the responsible agent automatically.
61
+ 5. **You review and merge** — you're pulled in only when human judgment is needed.
62
+
63
+ ## Pluggable by design
64
+
65
+ Seven plugin slots; the lifecycle state machine stays in core:
66
+
67
+ | Slot | Default | Alternatives |
68
+ | --- | --- | --- |
69
+ | Runtime | tmux (macOS/Linux) / process (Windows) | process, docker |
70
+ | Agent | claude-code | codex, aider, cursor, opencode, kimicode |
71
+ | Workspace | worktree | clone |
72
+ | Tracker | github | linear, gitlab |
73
+ | SCM | github | gitlab |
74
+ | Notifier | desktop | slack, discord, composio, webhook, openclaw |
75
+ | Terminal | iterm2 | web |
76
+
77
+ ## Why Athene?
78
+
79
+ Running one AI agent in a terminal is easy. Running 30 across different issues, branches, and PRs is a coordination problem: creating branches, detecting stuck agents, reading CI failures, forwarding review comments, tracking which PRs are ready, and cleaning up afterward.
80
+
81
+ Athene handles the isolation, feedback routing, and status tracking. You `athene start` and walk away — then review PRs and make decisions. The rest is automated.
82
+
83
+ ## Documentation
84
+
85
+ - 📖 [Project README & overview](https://github.com/slievr/Athene)
86
+ - 🛠️ [Setup guide](https://github.com/slievr/Athene/blob/main/SETUP.md) — install, configuration, troubleshooting
87
+ - ⌨️ [CLI reference](https://github.com/slievr/Athene/blob/main/docs/CLI.md)
88
+ - 🧩 [Development & plugin guide](https://github.com/slievr/Athene/blob/main/docs/DEVELOPMENT.md)
89
+ - 💬 [Discord community](https://discord.gg/UZv7JjxbwG)
90
+
91
+ ## License
92
+
93
+ MIT © [slievr](https://github.com/slievr/Athene)
package/bin/athene.js ADDED
@@ -0,0 +1,2 @@
1
+ #!/usr/bin/env node
2
+ import "@made-by-moonlight/athene-cli";
@@ -0,0 +1,259 @@
1
+ #!/usr/bin/env node
2
+ /**
3
+ * Postinstall script for @made-by-moonlight/athene (npm/yarn global installs).
4
+ *
5
+ * 1. Fixes node-pty's spawn-helper binary missing the execute bit.
6
+ * node-pty@1.1.0 ships spawn-helper without +x; the monorepo works around
7
+ * this via scripts/rebuild-node-pty.js, but that never runs for global installs.
8
+ * Upstream fix: microsoft/node-pty#866 (only in 1.2.0-beta, not stable yet).
9
+ *
10
+ * 2. Verifies the prebuilt binary is compatible with the current Node.js version.
11
+ * If not (common with nvm/fnm/volta), rebuilds from source via npx node-gyp.
12
+ * See: https://github.com/slievr/Athene/issues/987
13
+ *
14
+ * 3. Verifies better-sqlite3 has a native binding for this Node ABI.
15
+ * Node majors can ship new NODE_MODULE_VERSION values before better-sqlite3
16
+ * publishes matching prebuilds; global installs must rebuild from source.
17
+ * See: https://github.com/slievr/Athene/issues/1822
18
+ *
19
+ * 4. Clears stale Next.js runtime cache (.next/cache) from @composio/ao-web
20
+ * after a version upgrade, so `athene start` serves fresh dashboard assets.
21
+ * Writes a version stamp (.next/AO_VERSION) to skip cleanup on subsequent runs.
22
+ */
23
+
24
+ import { chmodSync, existsSync, readFileSync, rmSync, writeFileSync } from "node:fs";
25
+ import { execFileSync, execSync } from "node:child_process";
26
+ import { resolve, dirname } from "node:path";
27
+ import { fileURLToPath } from "node:url";
28
+
29
+ const __dirname = dirname(fileURLToPath(import.meta.url));
30
+
31
+ function isWindows() {
32
+ return process.platform === "win32";
33
+ }
34
+
35
+ export function findPackageUp(startDir, ...segments) {
36
+ let dir = resolve(startDir);
37
+ while (true) {
38
+ const candidate = resolve(dir, "node_modules", ...segments);
39
+ if (existsSync(candidate)) return candidate;
40
+ const parent = dirname(dir);
41
+ if (parent === dir) break;
42
+ dir = parent;
43
+ }
44
+ return null;
45
+ }
46
+
47
+ export function resolveNodeModulesPackage(fromDir, ...segments) {
48
+ const packageDir = resolve(fromDir, "node_modules", ...segments);
49
+ return existsSync(resolve(packageDir, "package.json")) ? packageDir : null;
50
+ }
51
+
52
+ export function findWebDir() {
53
+ const directWebDir = findPackageUp(__dirname, "@made-by-moonlight", "web");
54
+ if (directWebDir) return directWebDir;
55
+
56
+ const cliDir = findPackageUp(__dirname, "@made-by-moonlight", "cli");
57
+ if (!cliDir) return null;
58
+
59
+ return resolveNodeModulesPackage(cliDir, "@made-by-moonlight", "web");
60
+ }
61
+
62
+ export function findBetterSqlite3Dir() {
63
+ const directBetterSqlite3Dir = findPackageUp(__dirname, "better-sqlite3");
64
+ if (directBetterSqlite3Dir) return directBetterSqlite3Dir;
65
+
66
+ const cliDir = findPackageUp(__dirname, "@made-by-moonlight", "cli");
67
+ if (!cliDir) return null;
68
+
69
+ const coreDir = resolveNodeModulesPackage(cliDir, "@made-by-moonlight", "core");
70
+ if (!coreDir) return null;
71
+
72
+ return (
73
+ resolveNodeModulesPackage(coreDir, "better-sqlite3") ?? findPackageUp(coreDir, "better-sqlite3")
74
+ );
75
+ }
76
+
77
+ export function betterSqlite3BindingCandidates(
78
+ packageDir,
79
+ {
80
+ platform = process.platform,
81
+ arch = process.arch,
82
+ modules = process.versions.modules,
83
+ nodeVersion = process.versions.node,
84
+ } = {},
85
+ ) {
86
+ return [
87
+ resolve(packageDir, "build", "better_sqlite3.node"),
88
+ resolve(packageDir, "build", "Debug", "better_sqlite3.node"),
89
+ resolve(packageDir, "build", "Release", "better_sqlite3.node"),
90
+ resolve(packageDir, "out", "Debug", "better_sqlite3.node"),
91
+ resolve(packageDir, "Debug", "better_sqlite3.node"),
92
+ resolve(packageDir, "out", "Release", "better_sqlite3.node"),
93
+ resolve(packageDir, "Release", "better_sqlite3.node"),
94
+ resolve(packageDir, "build", "default", "better_sqlite3.node"),
95
+ resolve(packageDir, "compiled", nodeVersion, platform, arch, "better_sqlite3.node"),
96
+ resolve(packageDir, "addon-build", "release", "install-root", "better_sqlite3.node"),
97
+ resolve(packageDir, "addon-build", "debug", "install-root", "better_sqlite3.node"),
98
+ resolve(packageDir, "addon-build", "default", "install-root", "better_sqlite3.node"),
99
+ resolve(
100
+ packageDir,
101
+ "lib",
102
+ "binding",
103
+ `node-v${modules}-${platform}-${arch}`,
104
+ "better_sqlite3.node",
105
+ ),
106
+ ];
107
+ }
108
+
109
+ export function hasBetterSqlite3Binding(packageDir, options = {}) {
110
+ const fileExists = options.existsSync ?? existsSync;
111
+ return betterSqlite3BindingCandidates(packageDir, options).some((candidate) =>
112
+ fileExists(candidate),
113
+ );
114
+ }
115
+
116
+ export function betterSqlite3RebuildCommand(packageDir, env = process.env) {
117
+ const packageManager =
118
+ `${env.npm_config_user_agent ?? ""} ${env.npm_execpath ?? ""}`.toLowerCase();
119
+ if (packageManager.includes("npm") && !packageManager.includes("pnpm")) {
120
+ return { command: "npm", args: ["rebuild"], display: `cd ${packageDir} && npm rebuild` };
121
+ }
122
+ return {
123
+ command: "pnpm",
124
+ args: ["--dir", packageDir, "rebuild"],
125
+ display: `pnpm --dir ${packageDir} rebuild`,
126
+ };
127
+ }
128
+
129
+ function checkBetterSqlite3Binding() {
130
+ const betterSqlite3Dir = findBetterSqlite3Dir();
131
+ if (!betterSqlite3Dir) {
132
+ console.warn(
133
+ "⚠️ better-sqlite3 package not found; skipping activity-events native binding check",
134
+ );
135
+ return;
136
+ }
137
+
138
+ const abi = process.versions.modules;
139
+ if (hasBetterSqlite3Binding(betterSqlite3Dir)) {
140
+ console.log(
141
+ `✓ better-sqlite3 native binding present for Node ${process.version} (ABI v${abi})`,
142
+ );
143
+ return;
144
+ }
145
+
146
+ const { command, args, display } = betterSqlite3RebuildCommand(betterSqlite3Dir);
147
+ try {
148
+ execFileSync(command, args, {
149
+ cwd: betterSqlite3Dir,
150
+ stdio: "ignore",
151
+ timeout: 120000,
152
+ shell: isWindows(),
153
+ windowsHide: true,
154
+ });
155
+ console.log(
156
+ `✓ better-sqlite3 native binding rebuilt for Node ${process.version} (ABI v${abi})`,
157
+ );
158
+ } catch {
159
+ console.warn(
160
+ `⚠️ better-sqlite3 rebuild failed for Node ${process.version} (ABI v${abi}) — activity events may be unavailable. Manual fix: ${display}`,
161
+ );
162
+ }
163
+ }
164
+
165
+ function fixNodePty() {
166
+ if (isWindows()) return;
167
+
168
+ const nodePtyDir = findPackageUp(__dirname, "node-pty");
169
+ if (nodePtyDir) {
170
+ const spawnHelper = resolve(
171
+ nodePtyDir,
172
+ "prebuilds",
173
+ `${process.platform}-${process.arch}`,
174
+ "spawn-helper",
175
+ );
176
+
177
+ if (existsSync(spawnHelper)) {
178
+ try {
179
+ chmodSync(spawnHelper, 0o755);
180
+ console.log("✓ node-pty spawn-helper permissions set");
181
+ } catch {
182
+ console.warn("⚠️ Could not set spawn-helper permissions (non-critical)");
183
+ }
184
+ }
185
+
186
+ // Verify the prebuilt binary actually works with this Node.js version.
187
+ // If it doesn't (ABI mismatch from nvm/fnm/volta version switching), rebuild.
188
+ // We exercise pty.spawn() — not just require() — because the posix_spawnp
189
+ // failure only surfaces when the helper binary is actually executed.
190
+ try {
191
+ execSync(
192
+ "node -e \"var p=require('node-pty');var t=p.spawn('/bin/sh',['-c','exit 0'],{});t.kill();process.exit(0);\"",
193
+ {
194
+ cwd: resolve(nodePtyDir, ".."),
195
+ stdio: "ignore",
196
+ timeout: 10000,
197
+ },
198
+ );
199
+ } catch {
200
+ console.log(
201
+ "⚠️ node-pty prebuilt binary incompatible with Node.js " +
202
+ process.version +
203
+ ", rebuilding...",
204
+ );
205
+ try {
206
+ execSync("npx --yes node-gyp rebuild", {
207
+ cwd: nodePtyDir,
208
+ stdio: "inherit",
209
+ timeout: 120000,
210
+ });
211
+ console.log("✓ node-pty rebuilt successfully");
212
+ } catch {
213
+ console.warn("⚠️ node-pty rebuild failed — web terminal may not work");
214
+ console.warn(" Manual fix: cd " + nodePtyDir + " && npx node-gyp rebuild");
215
+ }
216
+ }
217
+ }
218
+ }
219
+
220
+ function clearDashboardCache() {
221
+ try {
222
+ const webDir = findWebDir();
223
+ if (webDir) {
224
+ const pkgPath = resolve(webDir, "package.json");
225
+ if (existsSync(pkgPath)) {
226
+ const pkg = JSON.parse(readFileSync(pkgPath, "utf8"));
227
+ const version = pkg.version;
228
+ const cacheDir = resolve(webDir, ".next", "cache");
229
+ const stampPath = resolve(webDir, ".next", "AO_VERSION");
230
+
231
+ if (existsSync(cacheDir)) {
232
+ rmSync(cacheDir, { recursive: true, force: true });
233
+ console.log("✓ Cleared stale .next/cache");
234
+ }
235
+ if (existsSync(resolve(webDir, ".next"))) {
236
+ writeFileSync(stampPath, version, "utf8");
237
+ console.log(`✓ Dashboard version stamp set to ${version}`);
238
+ }
239
+ }
240
+ }
241
+ } catch (err) {
242
+ console.warn(`⚠️ Could not clear dashboard cache (non-critical): ${err.message}`);
243
+ }
244
+ }
245
+
246
+ export function runPostinstall() {
247
+ // --- 1 & 2. Fix node-pty spawn-helper permissions and verify ABI (non-Windows only) ---
248
+ fixNodePty();
249
+
250
+ // --- 3. Ensure better-sqlite3 has a native binding for this Node ABI ---
251
+ checkBetterSqlite3Binding();
252
+
253
+ // --- 4. Clear stale Next.js runtime cache after version upgrade ---
254
+ clearDashboardCache();
255
+ }
256
+
257
+ if (process.argv[1] && resolve(process.argv[1]) === fileURLToPath(import.meta.url)) {
258
+ runPostinstall();
259
+ }
package/package.json ADDED
@@ -0,0 +1,50 @@
1
+ {
2
+ "name": "@made-by-moonlight/athene",
3
+ "version": "0.9.2",
4
+ "description": "Orchestrate parallel AI coding agents — global CLI wrapper",
5
+ "keywords": [
6
+ "ai",
7
+ "ai-agents",
8
+ "coding-agent",
9
+ "agent-orchestration",
10
+ "orchestrator",
11
+ "claude-code",
12
+ "codex",
13
+ "aider",
14
+ "cli",
15
+ "automation",
16
+ "devtools",
17
+ "parallel-agents",
18
+ "git-worktree"
19
+ ],
20
+ "license": "MIT",
21
+ "type": "module",
22
+ "bin": {
23
+ "athene": "bin/athene.js"
24
+ },
25
+ "files": [
26
+ "bin",
27
+ "README.md"
28
+ ],
29
+ "repository": {
30
+ "type": "git",
31
+ "url": "https://github.com/slievr/Athene.git",
32
+ "directory": "packages/athene"
33
+ },
34
+ "homepage": "https://github.com/slievr/Athene",
35
+ "bugs": {
36
+ "url": "https://github.com/slievr/Athene/issues"
37
+ },
38
+ "engines": {
39
+ "node": ">=20.18.3"
40
+ },
41
+ "dependencies": {
42
+ "@made-by-moonlight/athene-cli": "0.9.2"
43
+ },
44
+ "publishConfig": {
45
+ "access": "public"
46
+ },
47
+ "scripts": {
48
+ "postinstall": "node bin/postinstall.js"
49
+ }
50
+ }