aoaoe 0.5.0 → 0.6.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 +226 -156
- package/dist/chat.js +277 -159
- package/dist/chat.js.map +1 -1
- package/dist/config.d.ts +1 -0
- package/dist/config.d.ts.map +1 -1
- package/dist/config.js +2 -1
- package/dist/config.js.map +1 -1
- package/dist/config.test.d.ts +2 -0
- package/dist/config.test.d.ts.map +1 -0
- package/dist/config.test.js +116 -0
- package/dist/config.test.js.map +1 -0
- package/dist/daemon-state.d.ts.map +1 -1
- package/dist/daemon-state.js +6 -1
- package/dist/daemon-state.js.map +1 -1
- package/dist/executor.test.d.ts +2 -0
- package/dist/executor.test.d.ts.map +1 -0
- package/dist/executor.test.js +81 -0
- package/dist/executor.test.js.map +1 -0
- package/dist/index.js +46 -4
- package/dist/index.js.map +1 -1
- package/dist/poller.d.ts +4 -0
- package/dist/poller.d.ts.map +1 -1
- package/dist/poller.js +5 -4
- package/dist/poller.js.map +1 -1
- package/dist/poller.test.d.ts +2 -0
- package/dist/poller.test.d.ts.map +1 -0
- package/dist/poller.test.js +91 -0
- package/dist/poller.test.js.map +1 -0
- package/dist/reasoner/opencode.d.ts +2 -0
- package/dist/reasoner/opencode.d.ts.map +1 -1
- package/dist/reasoner/opencode.js +3 -2
- package/dist/reasoner/opencode.js.map +1 -1
- package/dist/reasoner/opencode.test.d.ts +2 -0
- package/dist/reasoner/opencode.test.d.ts.map +1 -0
- package/dist/reasoner/opencode.test.js +129 -0
- package/dist/reasoner/opencode.test.js.map +1 -0
- package/dist/reasoner/prompt.d.ts +7 -0
- package/dist/reasoner/prompt.d.ts.map +1 -1
- package/dist/reasoner/prompt.js +43 -1
- package/dist/reasoner/prompt.js.map +1 -1
- package/dist/reasoner/prompt.test.d.ts +2 -0
- package/dist/reasoner/prompt.test.d.ts.map +1 -0
- package/dist/reasoner/prompt.test.js +189 -0
- package/dist/reasoner/prompt.test.js.map +1 -0
- package/dist/task-parser.d.ts +22 -0
- package/dist/task-parser.d.ts.map +1 -0
- package/dist/task-parser.js +103 -0
- package/dist/task-parser.js.map +1 -0
- package/dist/task-parser.test.d.ts +2 -0
- package/dist/task-parser.test.d.ts.map +1 -0
- package/dist/task-parser.test.js +137 -0
- package/dist/task-parser.test.js.map +1 -0
- package/dist/types.d.ts +10 -0
- package/dist/types.d.ts.map +1 -1
- package/package.json +2 -1
package/README.md
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
<p align="center">
|
|
2
2
|
<h1 align="center">Agent of Agent of Empires (aoaoe)</h1>
|
|
3
3
|
<p align="center">
|
|
4
|
+
<a href="https://www.npmjs.com/package/aoaoe"><img src="https://img.shields.io/npm/v/aoaoe" alt="npm version"></a>
|
|
4
5
|
<a href="https://github.com/Talador12/agent-of-agent-of-empires/releases"><img src="https://img.shields.io/github/v/release/Talador12/agent-of-agent-of-empires" alt="GitHub release"></a>
|
|
5
6
|
<a href="LICENSE"><img src="https://img.shields.io/badge/License-MIT-yellow.svg" alt="License: MIT"></a>
|
|
6
7
|
</p>
|
|
@@ -18,64 +19,217 @@ An autonomous supervisor that manages [Agent of Empires](https://github.com/njbr
|
|
|
18
19
|
|
|
19
20
|
This is the conductor, not the orchestra. AoE manages the sessions. The agents inside do the coding. aoaoe watches everything and steps in when needed.
|
|
20
21
|
|
|
21
|
-
##
|
|
22
|
+
## Prerequisites
|
|
22
23
|
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
24
|
+
You need these installed first:
|
|
25
|
+
|
|
26
|
+
| Tool | What it does | Install |
|
|
27
|
+
|------|-------------|---------|
|
|
28
|
+
| [tmux](https://github.com/tmux/tmux/wiki) | Terminal multiplexer (AoE uses it) | `brew install tmux` |
|
|
29
|
+
| [Agent of Empires](https://github.com/njbrake/agent-of-empires) | Manages AI agent sessions | See AoE README |
|
|
30
|
+
| [OpenCode](https://github.com/anomalyco/opencode) **or** [Claude Code](https://docs.anthropic.com/en/docs/claude-code) | LLM reasoning backend | `npm i -g @anthropic-ai/claude-code` or see OpenCode docs |
|
|
31
|
+
|
|
32
|
+
Verify they're on your PATH:
|
|
29
33
|
|
|
30
34
|
```bash
|
|
31
|
-
#
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
+
aoe --version # agent-of-empires
|
|
36
|
+
tmux -V # tmux
|
|
37
|
+
opencode --version # if using OpenCode backend
|
|
38
|
+
claude --version # if using Claude Code backend
|
|
39
|
+
```
|
|
40
|
+
|
|
41
|
+
## Install
|
|
42
|
+
|
|
43
|
+
Pick one:
|
|
44
|
+
|
|
45
|
+
```bash
|
|
46
|
+
# npm (recommended)
|
|
47
|
+
npm install -g aoaoe
|
|
35
48
|
|
|
36
49
|
# Homebrew
|
|
37
50
|
brew install Talador12/tap/aoaoe
|
|
38
51
|
|
|
39
|
-
#
|
|
40
|
-
|
|
52
|
+
# curl
|
|
53
|
+
curl -fsSL https://raw.githubusercontent.com/Talador12/agent-of-agent-of-empires/main/scripts/install.sh | bash
|
|
41
54
|
|
|
42
|
-
#
|
|
55
|
+
# from source
|
|
43
56
|
git clone https://github.com/Talador12/agent-of-agent-of-empires
|
|
44
|
-
cd agent-of-agent-of-empires && npm install && npm run build
|
|
45
|
-
|
|
57
|
+
cd agent-of-agent-of-empires && npm install && npm run build && npm link
|
|
58
|
+
```
|
|
59
|
+
|
|
60
|
+
Verify:
|
|
61
|
+
|
|
62
|
+
```bash
|
|
63
|
+
aoaoe --version
|
|
46
64
|
```
|
|
47
65
|
|
|
48
66
|
## Quick Start
|
|
49
67
|
|
|
68
|
+
aoaoe has two parts: a **daemon** (the brain) and a **chat UI** (your window into it). Here's how to get both running.
|
|
69
|
+
|
|
70
|
+
### Step 1: Have AoE sessions running
|
|
71
|
+
|
|
72
|
+
You need at least one AoE session for aoaoe to supervise. If you don't have any yet:
|
|
73
|
+
|
|
50
74
|
```bash
|
|
51
|
-
|
|
52
|
-
aoe
|
|
75
|
+
aoe add ./my-project -t my-agent -c "opencode" # add an agent
|
|
76
|
+
aoe session start my-agent # start it
|
|
77
|
+
aoe # enter AoE TUI to verify
|
|
78
|
+
```
|
|
79
|
+
|
|
80
|
+
### Step 2: Register aoaoe as an AoE session (one-time)
|
|
81
|
+
|
|
82
|
+
This adds aoaoe's chat UI as a session inside AoE, so you can access it alongside your agents:
|
|
53
83
|
|
|
54
|
-
|
|
84
|
+
```bash
|
|
55
85
|
aoaoe register
|
|
86
|
+
```
|
|
56
87
|
|
|
57
|
-
|
|
88
|
+
This creates a session called "aoaoe" that runs the interactive chat UI. You only need to do this once.
|
|
89
|
+
|
|
90
|
+
### Step 3: Start the daemon
|
|
91
|
+
|
|
92
|
+
In a separate terminal (or tmux pane, or backgrounded):
|
|
93
|
+
|
|
94
|
+
```bash
|
|
58
95
|
aoaoe
|
|
96
|
+
```
|
|
97
|
+
|
|
98
|
+
The daemon starts polling your AoE sessions, reasoning about what it sees, and executing actions. It logs to stderr so you can watch it work.
|
|
99
|
+
|
|
100
|
+
### Step 4: Enter the chat UI
|
|
101
|
+
|
|
102
|
+
```bash
|
|
103
|
+
aoe session start aoaoe # start the aoaoe session (if not already running)
|
|
104
|
+
aoe # enter AoE TUI, then select "aoaoe"
|
|
105
|
+
```
|
|
106
|
+
|
|
107
|
+
You're now in the chat UI. Type messages to the reasoner, run `/overview` to see what all agents are doing, or press ESC ESC to interrupt the current reasoning cycle.
|
|
59
108
|
|
|
60
|
-
|
|
109
|
+
### Minimal example (all steps)
|
|
110
|
+
|
|
111
|
+
```bash
|
|
112
|
+
# Terminal 1: start the daemon
|
|
113
|
+
aoaoe
|
|
114
|
+
|
|
115
|
+
# Terminal 2: register + start + enter
|
|
116
|
+
aoaoe register
|
|
61
117
|
aoe session start aoaoe
|
|
62
|
-
aoe # select "aoaoe"
|
|
118
|
+
aoe # select "aoaoe" in the TUI
|
|
119
|
+
```
|
|
120
|
+
|
|
121
|
+
### Using a different reasoning backend
|
|
63
122
|
|
|
64
|
-
|
|
65
|
-
|
|
123
|
+
```bash
|
|
124
|
+
# Use Claude Code instead of OpenCode
|
|
66
125
|
aoaoe --reasoner claude-code
|
|
126
|
+
|
|
127
|
+
# Use a specific model
|
|
128
|
+
aoaoe --reasoner opencode --model anthropic/claude-sonnet-4-20250514
|
|
129
|
+
aoaoe --reasoner claude-code --model claude-sonnet-4-20250514
|
|
67
130
|
```
|
|
68
131
|
|
|
69
|
-
|
|
132
|
+
## Chat UI Commands
|
|
70
133
|
|
|
71
|
-
|
|
134
|
+
Once inside the chat UI (via `aoe` -> select "aoaoe"):
|
|
135
|
+
|
|
136
|
+
| Command | What it does |
|
|
137
|
+
|---------|-------------|
|
|
138
|
+
| `/overview` | Show all AoE sessions with tasks, model, tokens, cost. **Works without the daemon.** |
|
|
139
|
+
| `/tasks` | Alias for `/overview` |
|
|
140
|
+
| `/status` | Daemon connection status + countdown to next reasoning cycle |
|
|
141
|
+
| `/interrupt` | Interrupt the current reasoner call |
|
|
142
|
+
| `/dashboard` | Request full dashboard output from daemon |
|
|
143
|
+
| `/pause` | Pause the daemon (stops reasoning) |
|
|
144
|
+
| `/resume` | Resume after pause |
|
|
145
|
+
| `/verbose` | Toggle verbose logging |
|
|
146
|
+
| `/clear` | Clear the screen |
|
|
147
|
+
| `/help` | Show all commands |
|
|
148
|
+
| ESC ESC | Interrupt the reasoner (same as `/interrupt`) |
|
|
149
|
+
| _(any text)_ | Send a message to the reasoner -- included in the next reasoning cycle |
|
|
150
|
+
|
|
151
|
+
### How `/overview` works
|
|
152
|
+
|
|
153
|
+
`/overview` captures every AoE pane directly via tmux and parses:
|
|
154
|
+
- **Tasks**: OpenCode TODO items (`[*]` done, `[.]` in progress, `[o]` pending)
|
|
155
|
+
- **Model**: Which LLM the agent is using (e.g. "Claude Opus 4.6")
|
|
156
|
+
- **Context**: Token count and cost
|
|
157
|
+
- **Last line**: Most recent meaningful output
|
|
158
|
+
|
|
159
|
+
This works **standalone** -- you don't need the daemon running.
|
|
160
|
+
|
|
161
|
+
### How interrupt works
|
|
162
|
+
|
|
163
|
+
When the daemon is reasoning, press **ESC ESC** (or type `/interrupt`) to stop the current LLM call. The daemon will pause and wait for your input. Type a message and it will be included in the next reasoning cycle. This is useful when you want to redirect the supervisor's attention.
|
|
164
|
+
|
|
165
|
+
## Daemon CLI
|
|
72
166
|
|
|
73
|
-
```bash
|
|
74
|
-
aoaoe register # register with default title "aoaoe"
|
|
75
|
-
aoaoe register --title my-brain # custom title
|
|
76
167
|
```
|
|
168
|
+
aoaoe [command] [options]
|
|
77
169
|
|
|
78
|
-
|
|
170
|
+
commands:
|
|
171
|
+
(none) start the supervisor daemon
|
|
172
|
+
register register aoaoe as an AoE session (one-time setup)
|
|
173
|
+
attach enter the reasoner console (Ctrl+B D to detach)
|
|
174
|
+
|
|
175
|
+
daemon options:
|
|
176
|
+
--reasoner <opencode|claude-code> reasoning backend (default: opencode)
|
|
177
|
+
--poll-interval <ms> poll interval in ms (default: 10000)
|
|
178
|
+
--port <number> opencode server port (default: 4097)
|
|
179
|
+
--model <model> model to use
|
|
180
|
+
--profile <name> aoe profile (default: default)
|
|
181
|
+
--dry-run observe + reason but don't execute
|
|
182
|
+
--verbose, -v verbose logging
|
|
183
|
+
--help, -h show help
|
|
184
|
+
--version show version
|
|
185
|
+
|
|
186
|
+
register options:
|
|
187
|
+
--title, -t <name> session title in AoE (default: aoaoe)
|
|
188
|
+
```
|
|
189
|
+
|
|
190
|
+
## Configuration
|
|
191
|
+
|
|
192
|
+
Create `aoaoe.config.json` in the directory where you run the daemon (optional -- defaults work fine):
|
|
193
|
+
|
|
194
|
+
```json
|
|
195
|
+
{
|
|
196
|
+
"reasoner": "opencode",
|
|
197
|
+
"pollIntervalMs": 10000,
|
|
198
|
+
"opencode": {
|
|
199
|
+
"port": 4097,
|
|
200
|
+
"model": "anthropic/claude-sonnet-4-20250514"
|
|
201
|
+
},
|
|
202
|
+
"claudeCode": {
|
|
203
|
+
"model": "claude-sonnet-4-20250514",
|
|
204
|
+
"yolo": true,
|
|
205
|
+
"resume": true
|
|
206
|
+
},
|
|
207
|
+
"aoe": {
|
|
208
|
+
"profile": "default"
|
|
209
|
+
},
|
|
210
|
+
"policies": {
|
|
211
|
+
"maxIdleBeforeNudgeMs": 120000,
|
|
212
|
+
"maxErrorsBeforeRestart": 3,
|
|
213
|
+
"autoAnswerPermissions": true
|
|
214
|
+
}
|
|
215
|
+
}
|
|
216
|
+
```
|
|
217
|
+
|
|
218
|
+
| Field | Description | Default |
|
|
219
|
+
|-------|-------------|---------|
|
|
220
|
+
| `reasoner` | `"opencode"` or `"claude-code"` | `"opencode"` |
|
|
221
|
+
| `pollIntervalMs` | How often to check AoE sessions (ms) | `10000` |
|
|
222
|
+
| `opencode.port` | Port for `opencode serve` | `4097` |
|
|
223
|
+
| `opencode.model` | Model in `provider/model` format | (OpenCode default) |
|
|
224
|
+
| `claudeCode.model` | Anthropic model name | (Claude Code default) |
|
|
225
|
+
| `claudeCode.yolo` | Skip permissions in Claude Code | `true` |
|
|
226
|
+
| `claudeCode.resume` | Maintain session across calls | `true` |
|
|
227
|
+
| `aoe.profile` | AoE profile to monitor | `"default"` |
|
|
228
|
+
| `policies.maxIdleBeforeNudgeMs` | Nudge idle agents after this long | `120000` |
|
|
229
|
+
| `policies.maxErrorsBeforeRestart` | Restart after N consecutive errors | `3` |
|
|
230
|
+
| `policies.autoAnswerPermissions` | Auto-approve permission prompts | `true` |
|
|
231
|
+
|
|
232
|
+
Also reads `.aoaoe.json` as an alternative config filename.
|
|
79
233
|
|
|
80
234
|
## How It Works
|
|
81
235
|
|
|
@@ -83,7 +237,7 @@ The session runs an interactive chat (chat.ts) inside the AoE-managed tmux pane.
|
|
|
83
237
|
┌──────────────────────────────────────────────────────┐
|
|
84
238
|
│ aoaoe daemon │
|
|
85
239
|
│ │
|
|
86
|
-
│ ┌───────────┐
|
|
240
|
+
│ ┌───────────┐ ┌─────��────────┐ ┌───────────┐ │
|
|
87
241
|
│ │ Poller │──▶│ Reasoner │──▶│ Executor │ │
|
|
88
242
|
│ │ │ │ ┌──────────┐ │ │ │ │
|
|
89
243
|
│ │ aoe CLI + │ │ │ OpenCode │ │ │ tmux send │ │
|
|
@@ -92,11 +246,12 @@ The session runs an interactive chat (chat.ts) inside the AoE-managed tmux pane.
|
|
|
92
246
|
│ │ │ │ │ Claude │ │ │ │ │
|
|
93
247
|
│ │ │ │ │ Code │ │ │ │ │
|
|
94
248
|
│ │ │ │ └──────────┘ │ │ │ │
|
|
95
|
-
│
|
|
249
|
+
│ └───────────�� └──────────────┘ └───────────┘ │
|
|
96
250
|
│ │
|
|
97
251
|
│ ┌────────────────────────────────────────────────┐ │
|
|
98
|
-
│ │
|
|
99
|
-
│ │
|
|
252
|
+
│ │ Chat UI (aoaoe-chat) │ │
|
|
253
|
+
│ │ runs inside AoE tmux pane, reads state │ │
|
|
254
|
+
│ │ from ~/.aoaoe/ via file-based IPC │ │
|
|
100
255
|
│ └────────────────────────────────────────────────┘ │
|
|
101
256
|
└──────────────────────────────────────────────────────┘
|
|
102
257
|
│ │
|
|
@@ -105,27 +260,25 @@ The session runs an interactive chat (chat.ts) inside the AoE-managed tmux pane.
|
|
|
105
260
|
(tmux panes) (local or remote)
|
|
106
261
|
```
|
|
107
262
|
|
|
108
|
-
### Three
|
|
263
|
+
### Three loops
|
|
109
264
|
|
|
110
265
|
**Poller** (every N seconds, configurable):
|
|
111
|
-
- Calls `aoe
|
|
112
|
-
- For each active session: `tmux capture-pane -t
|
|
113
|
-
- Diffs against previous capture to detect new output
|
|
114
|
-
- Builds an observation payload
|
|
266
|
+
- Calls `aoe list --json` to get all session IDs, statuses, and tools
|
|
267
|
+
- For each active session: `tmux capture-pane -t <session> -p -S -100`
|
|
268
|
+
- Diffs against previous capture to detect new output
|
|
269
|
+
- Builds an observation payload
|
|
115
270
|
|
|
116
271
|
**Reasoner** (on new observations):
|
|
117
272
|
- Sends observation to the configured LLM backend
|
|
118
273
|
- System prompt defines the supervisor role, policies, and available actions
|
|
119
274
|
- Receives back a structured JSON action decision
|
|
120
|
-
- Backend-agnostic: same observation format and action schema regardless of backend
|
|
121
275
|
|
|
122
276
|
**Executor** (on decisions):
|
|
123
|
-
- `tmux send-keys
|
|
124
|
-
- `aoe session start/stop/restart
|
|
125
|
-
- `aoe add
|
|
126
|
-
- `aoe remove <id>` -- tear down agents
|
|
277
|
+
- `tmux send-keys` -- inject a prompt into an agent
|
|
278
|
+
- `aoe session start/stop/restart` -- lifecycle management
|
|
279
|
+
- `aoe add` / `aoe remove` -- spawn or tear down agents
|
|
127
280
|
|
|
128
|
-
### Supervisor
|
|
281
|
+
### Supervisor behavior
|
|
129
282
|
|
|
130
283
|
The LLM supervisor follows these policies:
|
|
131
284
|
- If an agent is stuck or idle too long, nudge it with context or a rephrased task
|
|
@@ -134,7 +287,7 @@ The LLM supervisor follows these policies:
|
|
|
134
287
|
- If a session crashes, restart it
|
|
135
288
|
- Do NOT micromanage -- only intervene when there is a clear problem or decision needed
|
|
136
289
|
|
|
137
|
-
### Available
|
|
290
|
+
### Available actions
|
|
138
291
|
|
|
139
292
|
The reasoner returns structured JSON decisions:
|
|
140
293
|
|
|
@@ -151,136 +304,53 @@ The reasoner returns structured JSON decisions:
|
|
|
151
304
|
|
|
152
305
|
| Backend | Interface | Stateful | Model Flexibility |
|
|
153
306
|
|---------|-----------|----------|-------------------|
|
|
154
|
-
| **OpenCode** | `opencode serve` +
|
|
155
|
-
| **Claude Code** | `claude --print` subprocess | Via `--resume` | Anthropic models
|
|
307
|
+
| **OpenCode** | `opencode serve` + SDK | Yes (long-running session) | Any provider via OpenCode config |
|
|
308
|
+
| **Claude Code** | `claude --print` subprocess | Via `--resume` | Anthropic models |
|
|
156
309
|
|
|
157
|
-
### OpenCode
|
|
158
|
-
|
|
159
|
-
Runs `opencode serve` as a headless HTTP server. Uses the [OpenCode JS SDK](https://opencode.ai/docs/sdk/) to maintain a long-running session with full context. Supports structured JSON output natively. Works with any model provider configured in OpenCode (remote APIs or local models).
|
|
160
|
-
|
|
161
|
-
### Claude Code Backend
|
|
162
|
-
|
|
163
|
-
Calls `claude --print --output-format json` as a subprocess. System prompt injected via `--append-system-prompt`. Session continuity via `--resume <session_id>`. Uses whatever model is configured in Claude Code (defaults to Anthropic models).
|
|
164
|
-
|
|
165
|
-
## Configuration
|
|
166
|
-
|
|
167
|
-
`aoaoe.config.json`:
|
|
168
|
-
```json
|
|
169
|
-
{
|
|
170
|
-
"reasoner": "opencode",
|
|
171
|
-
"pollIntervalMs": 10000,
|
|
172
|
-
"opencode": {
|
|
173
|
-
"port": 4097,
|
|
174
|
-
"model": "anthropic/claude-sonnet-4-20250514"
|
|
175
|
-
},
|
|
176
|
-
"claudeCode": {
|
|
177
|
-
"model": "claude-sonnet-4-20250514",
|
|
178
|
-
"yolo": true,
|
|
179
|
-
"resume": true
|
|
180
|
-
},
|
|
181
|
-
"aoe": {
|
|
182
|
-
"profile": "default"
|
|
183
|
-
},
|
|
184
|
-
"policies": {
|
|
185
|
-
"maxIdleBeforeNudgeMs": 120000,
|
|
186
|
-
"maxErrorsBeforeRestart": 3,
|
|
187
|
-
"autoAnswerPermissions": true
|
|
188
|
-
}
|
|
189
|
-
}
|
|
190
|
-
```
|
|
310
|
+
### OpenCode backend
|
|
191
311
|
|
|
192
|
-
|
|
193
|
-
|-------|-------------|---------|
|
|
194
|
-
| `reasoner` | `"opencode"` or `"claude-code"` | `"opencode"` |
|
|
195
|
-
| `pollIntervalMs` | How often to check AoE sessions (ms) | `10000` |
|
|
196
|
-
| `opencode.port` | Port for `opencode serve` | `4097` |
|
|
197
|
-
| `opencode.model` | Model in `provider/model` format | (uses OpenCode default) |
|
|
198
|
-
| `claudeCode.model` | Anthropic model name | (uses Claude Code default) |
|
|
199
|
-
| `claudeCode.yolo` | Skip permissions in Claude Code | `true` |
|
|
200
|
-
| `claudeCode.resume` | Maintain session across calls | `true` |
|
|
201
|
-
| `aoe.profile` | AoE profile to monitor | `"default"` |
|
|
202
|
-
| `policies.maxIdleBeforeNudgeMs` | Nudge idle agents after this long | `120000` |
|
|
203
|
-
| `policies.maxErrorsBeforeRestart` | Restart after N consecutive errors | `3` |
|
|
204
|
-
| `policies.autoAnswerPermissions` | Auto-approve permission prompts | `true` |
|
|
312
|
+
Runs `opencode serve` as a headless HTTP server. Uses the [OpenCode JS SDK](https://opencode.ai/docs/sdk/) to maintain a long-running session with full context. Works with any model provider configured in OpenCode (Anthropic, OpenAI, Ollama, etc.).
|
|
205
313
|
|
|
206
|
-
|
|
314
|
+
### Claude Code backend
|
|
207
315
|
|
|
208
|
-
|
|
209
|
-
|-----------|---------|------------|
|
|
210
|
-
| List sessions | `aoe list --json` | `cli/list.rs` |
|
|
211
|
-
| Session status | `aoe status --json` | `cli/status.rs` |
|
|
212
|
-
| Session details | `aoe session show <id> --json` | `cli/session.rs` |
|
|
213
|
-
| Capture output | `tmux capture-pane -t aoe_<title>_<id8> -p -S -N` | `tmux/session.rs` |
|
|
214
|
-
| Send input | `tmux send-keys -t aoe_<title>_<id8> "<text>" Enter` | standard tmux |
|
|
215
|
-
| Start/stop | `aoe session start/stop <id>` | `cli/session.rs` |
|
|
216
|
-
| Create agent | `aoe add <path> -t <title> -c <tool> [-w branch] -y` | `cli/add.rs` |
|
|
217
|
-
| Remove agent | `aoe remove <id>` | `cli/remove.rs` |
|
|
316
|
+
Calls `claude --print --output-format json` as a subprocess. System prompt injected via `--append-system-prompt`. Session continuity via `--resume <session_id>`.
|
|
218
317
|
|
|
219
|
-
|
|
318
|
+
## IPC and State Files
|
|
220
319
|
|
|
221
|
-
|
|
320
|
+
The daemon and chat UI communicate via files in `~/.aoaoe/`:
|
|
222
321
|
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
-
|
|
226
|
-
|
|
227
|
-
-
|
|
322
|
+
| File | Written by | Read by | Purpose |
|
|
323
|
+
|------|-----------|---------|---------|
|
|
324
|
+
| `daemon-state.json` | daemon | chat UI | Current phase, countdown, per-session state |
|
|
325
|
+
| `conversation.log` | daemon | chat UI | Observations, reasoning, actions log |
|
|
326
|
+
| `pending-input.txt` | chat UI | daemon | User messages queued for next reasoning cycle |
|
|
327
|
+
| `interrupt` | chat UI | daemon | Flag file -- presence triggers interrupt |
|
|
328
|
+
| `chat.pid` | chat UI | daemon | Chat process PID for detection |
|
|
329
|
+
| `actions.log` | daemon | -- | Persistent action history (JSONL) |
|
|
228
330
|
|
|
229
331
|
## Project Structure
|
|
230
332
|
|
|
231
333
|
```
|
|
232
334
|
src/
|
|
233
|
-
index.ts # entry point,
|
|
234
|
-
chat.ts # interactive chat
|
|
235
|
-
config.ts # config loader and
|
|
236
|
-
|
|
335
|
+
index.ts # daemon entry point, main loop, register/attach subcommands
|
|
336
|
+
chat.ts # interactive chat UI (aoaoe-chat binary)
|
|
337
|
+
config.ts # config loader and CLI arg parser
|
|
338
|
+
daemon-state.ts # shared IPC state file + interrupt flag
|
|
339
|
+
task-parser.ts # parse OpenCode TODO patterns, model, tokens, cost from tmux
|
|
340
|
+
console.ts # conversation log + file-based IPC
|
|
237
341
|
poller.ts # aoe CLI + tmux capture-pane wrapper
|
|
238
342
|
executor.ts # maps action decisions to shell commands
|
|
239
|
-
dashboard.ts # periodic CLI status table
|
|
240
|
-
input.ts # stdin readline listener
|
|
241
|
-
shell.ts # exec() wrappers
|
|
242
|
-
types.ts # shared types (SessionSnapshot, Action, etc.)
|
|
343
|
+
dashboard.ts # periodic CLI status table with task column
|
|
344
|
+
input.ts # stdin readline listener with inject() for post-interrupt
|
|
345
|
+
shell.ts # exec() wrappers with AbortSignal support
|
|
346
|
+
types.ts # shared types (SessionSnapshot, Action, DaemonState, etc.)
|
|
243
347
|
reasoner/
|
|
244
|
-
index.ts # common Reasoner interface
|
|
348
|
+
index.ts # common Reasoner interface + factory
|
|
245
349
|
prompt.ts # system prompt + observation formatting
|
|
246
350
|
opencode.ts # OpenCode SDK backend
|
|
247
351
|
claude-code.ts # Claude Code CLI backend
|
|
248
352
|
```
|
|
249
353
|
|
|
250
|
-
## CLI
|
|
251
|
-
|
|
252
|
-
```
|
|
253
|
-
aoaoe [command] [options]
|
|
254
|
-
|
|
255
|
-
commands:
|
|
256
|
-
(none) start the daemon
|
|
257
|
-
attach enter the reasoner console (Ctrl+B D to detach)
|
|
258
|
-
register register aoaoe as an AoE session (appears in aoe list)
|
|
259
|
-
|
|
260
|
-
options:
|
|
261
|
-
--reasoner <opencode|claude-code> reasoning backend (default: opencode)
|
|
262
|
-
--poll-interval <ms> poll interval in ms (default: 10000)
|
|
263
|
-
--port <number> opencode server port (default: 4097)
|
|
264
|
-
--model <model> model to use
|
|
265
|
-
--profile <name> aoe profile (default: default)
|
|
266
|
-
--dry-run observe + reason but don't execute
|
|
267
|
-
--verbose, -v verbose logging
|
|
268
|
-
|
|
269
|
-
register options:
|
|
270
|
-
--title, -t <name> session title in AoE (default: aoaoe)
|
|
271
|
-
|
|
272
|
-
chat commands (inside AoE session):
|
|
273
|
-
/help show available commands
|
|
274
|
-
/status request daemon status
|
|
275
|
-
/dashboard request dashboard output
|
|
276
|
-
/pause pause the daemon
|
|
277
|
-
/resume resume the daemon
|
|
278
|
-
/clear clear the screen
|
|
279
|
-
(anything) send a message to the reasoner
|
|
280
|
-
```
|
|
281
|
-
|
|
282
|
-
Action history is persisted to `~/.aoaoe/actions.log` (JSONL format).
|
|
283
|
-
|
|
284
354
|
## Related Projects
|
|
285
355
|
|
|
286
356
|
- [Agent of Empires](https://github.com/njbrake/agent-of-empires) -- the session manager this project controls
|