@mndrk/agx 1.4.4 → 1.4.9
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 +128 -118
- package/index.js +2082 -325
- package/package.json +1 -1
- package/skills/agx/SKILL.md +89 -77
- package/todo-api/package-lock.json +841 -0
- package/todo-api/package.json +15 -0
- package/todo-api/server.js +327 -0
package/README.md
CHANGED
|
@@ -1,174 +1,184 @@
|
|
|
1
1
|
# agx
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
Task orchestrator for autonomous AI agents. Uses `mem` for persistent memory across sessions.
|
|
4
4
|
|
|
5
5
|
```bash
|
|
6
6
|
npm install -g @mndrk/agx
|
|
7
7
|
```
|
|
8
8
|
|
|
9
|
-
##
|
|
10
|
-
|
|
11
|
-
```bash
|
|
12
|
-
# Simple prompt
|
|
13
|
-
agx claude -p "explain this code"
|
|
9
|
+
## Core Concept: Wake-Work-Sleep Cycle
|
|
14
10
|
|
|
15
|
-
|
|
16
|
-
agx -p "what does this function do?"
|
|
11
|
+
Agents have **no memory** between sessions. All continuity comes from `mem`:
|
|
17
12
|
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
# Autonomous mode - creates task and works until done
|
|
22
|
-
agx claude --autonomous -p "Build a todo app with React"
|
|
13
|
+
```
|
|
14
|
+
WAKE → Load state → WORK → Save state → SLEEP → repeat
|
|
23
15
|
```
|
|
24
16
|
|
|
25
|
-
|
|
17
|
+
This enables truly autonomous operation across multiple sessions.
|
|
26
18
|
|
|
27
|
-
|
|
19
|
+
## Quick Start
|
|
28
20
|
|
|
29
21
|
```bash
|
|
30
|
-
#
|
|
31
|
-
|
|
32
|
-
agx
|
|
22
|
+
# Create and run a task
|
|
23
|
+
agx new "Build a REST API with auth"
|
|
24
|
+
agx run build-rest-api
|
|
25
|
+
|
|
26
|
+
# Or one command for full autonomous mode
|
|
27
|
+
agx -a -p "Build a REST API with auth"
|
|
28
|
+
# ✓ Created task: build-rest-api
|
|
29
|
+
# ✓ Daemon started
|
|
30
|
+
# ✓ Working...
|
|
31
|
+
```
|
|
32
|
+
|
|
33
|
+
## Task Management
|
|
33
34
|
|
|
34
|
-
|
|
35
|
-
agx
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
35
|
+
```bash
|
|
36
|
+
agx new "<goal>" # Create task
|
|
37
|
+
agx run [task] # Run task (loads context, wakes agent)
|
|
38
|
+
agx tasks # Interactive TUI - browse all tasks
|
|
39
|
+
agx status # Current task status
|
|
40
|
+
agx context [task] # View task context
|
|
41
|
+
agx pause [task] # Pause task
|
|
42
|
+
agx remove [task] # Delete task (alias: rm, delete)
|
|
43
|
+
agx tail [task] # Live tail logs
|
|
40
44
|
```
|
|
41
45
|
|
|
42
|
-
|
|
46
|
+
### Interactive Tasks Browser
|
|
43
47
|
|
|
44
|
-
|
|
48
|
+
`agx tasks` opens a TUI showing all tasks with status, progress, and last run time.
|
|
45
49
|
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
[done] # Task complete
|
|
56
|
-
[split: auth "Handle authentication"] # Create subtask
|
|
50
|
+
Keys: `↑/↓` select, `enter` details, `r` run, `p` pause, `d` done, `x` remove
|
|
51
|
+
|
|
52
|
+
## Steering: Nudge a Task
|
|
53
|
+
|
|
54
|
+
Send guidance to an agent for its next wake cycle:
|
|
55
|
+
|
|
56
|
+
```bash
|
|
57
|
+
agx nudge <task> "focus on auth first" # Add nudge
|
|
58
|
+
agx nudge <task> # View pending nudges
|
|
57
59
|
```
|
|
58
60
|
|
|
59
|
-
|
|
61
|
+
Nudges are shown to the agent on wake and then cleared.
|
|
60
62
|
|
|
61
|
-
|
|
62
|
-
|----------|---------|-------------|
|
|
63
|
-
| claude | c, cl | Anthropic Claude Code |
|
|
64
|
-
| gemini | g, gem | Google Gemini CLI |
|
|
65
|
-
| ollama | o, ol | Local Ollama models |
|
|
63
|
+
## Memory Commands (via mem)
|
|
66
64
|
|
|
67
|
-
|
|
65
|
+
Agents persist state using these commands:
|
|
68
66
|
|
|
67
|
+
### Define Objective
|
|
68
|
+
```bash
|
|
69
|
+
mem goal "<objective>" # Set/update goal
|
|
70
|
+
mem criteria add "<text>" # Add success criterion
|
|
71
|
+
mem constraint add "<rule>" # Add boundary/constraint
|
|
69
72
|
```
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
73
|
+
|
|
74
|
+
### Track Progress
|
|
75
|
+
```bash
|
|
76
|
+
mem next "<step>" # Set what you're working on
|
|
77
|
+
mem checkpoint "<msg>" # Save progress point
|
|
78
|
+
mem criteria <n> # Mark criterion #n complete
|
|
79
|
+
mem progress # Check progress %
|
|
80
|
+
```
|
|
81
|
+
|
|
82
|
+
### Learn & Adapt
|
|
83
|
+
```bash
|
|
84
|
+
mem learn "<insight>" # Task-specific learning
|
|
85
|
+
mem learn -g "<insight>" # Global learning (all tasks)
|
|
86
|
+
mem stuck "<reason>" # Mark blocker
|
|
87
|
+
mem stuck clear # Clear blocker
|
|
80
88
|
```
|
|
81
89
|
|
|
82
|
-
|
|
90
|
+
### Build Playbook
|
|
91
|
+
```bash
|
|
92
|
+
mem learnings -g # List global learnings
|
|
93
|
+
mem promote <n> # Promote learning to playbook
|
|
94
|
+
mem playbook # View global playbook
|
|
95
|
+
```
|
|
83
96
|
|
|
84
|
-
|
|
97
|
+
### Query
|
|
98
|
+
```bash
|
|
99
|
+
mem context # Full context for agent
|
|
100
|
+
mem history # Task progression
|
|
101
|
+
mem query "<search>" # Search all memory
|
|
102
|
+
```
|
|
85
103
|
|
|
104
|
+
### Complete
|
|
86
105
|
```bash
|
|
87
|
-
|
|
106
|
+
mem done # Mark task complete
|
|
88
107
|
```
|
|
89
108
|
|
|
90
|
-
|
|
91
|
-
- **Skill**: Claude learns how to spawn background agents
|
|
92
|
-
- **Commands**: `/agx:spawn <goal>`, `/agx:continue`
|
|
109
|
+
## Agent Workflow
|
|
93
110
|
|
|
94
|
-
|
|
111
|
+
When an agent wakes, it should:
|
|
95
112
|
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
113
|
+
1. **Orient** - Read state (goal, criteria, progress, next step, nudges)
|
|
114
|
+
2. **Plan** - Define criteria if missing, set intent with `mem next`
|
|
115
|
+
3. **Execute** - Work toward criteria, save learnings
|
|
116
|
+
4. **Checkpoint** - Save progress with `mem checkpoint`
|
|
117
|
+
5. **Adapt** - Handle blockers or ask user for nudge
|
|
118
|
+
|
|
119
|
+
## Daemon Mode
|
|
120
|
+
|
|
121
|
+
Run tasks automatically on a schedule:
|
|
102
122
|
|
|
103
|
-
|
|
123
|
+
```bash
|
|
104
124
|
agx daemon start # Start background daemon
|
|
105
125
|
agx daemon stop # Stop daemon
|
|
106
126
|
agx daemon status # Check if running
|
|
107
|
-
agx daemon logs #
|
|
127
|
+
agx daemon logs # View logs
|
|
108
128
|
```
|
|
109
129
|
|
|
110
|
-
|
|
130
|
+
The daemon:
|
|
131
|
+
- Polls continuously for active tasks
|
|
132
|
+
- Runs up to 5 tasks in parallel
|
|
133
|
+
- Logs to `~/.agx/logs/<taskname>.log`
|
|
134
|
+
|
|
135
|
+
## One-Shot Mode
|
|
111
136
|
|
|
112
|
-
|
|
137
|
+
For quick questions without task creation:
|
|
113
138
|
|
|
114
139
|
```bash
|
|
115
|
-
agx
|
|
116
|
-
|
|
117
|
-
# ✓ Mapped: ~/Projects/app → task/build-react-todo
|
|
118
|
-
# ✓ Daemon started (pid 12345)
|
|
119
|
-
# ✓ Autonomous mode: daemon will continue work every 15m
|
|
140
|
+
agx -p "explain this error"
|
|
141
|
+
agx claude -p "refactor this function"
|
|
120
142
|
```
|
|
121
143
|
|
|
122
|
-
|
|
123
|
-
- Runs in background (survives terminal close)
|
|
124
|
-
- Wakes every 15 minutes
|
|
125
|
-
- Continues work on active tasks
|
|
126
|
-
- Stops when task is `[done]` or `[blocked]`
|
|
127
|
-
|
|
128
|
-
## Loop Control
|
|
129
|
-
|
|
130
|
-
The agent controls execution flow via markers:
|
|
131
|
-
|
|
132
|
-
- `[done]` → Task complete, exit
|
|
133
|
-
- `[pause]` → Save state, exit (resume later with same command)
|
|
134
|
-
- `[blocked: reason]` → Mark stuck, notify human, exit
|
|
135
|
-
- `[continue]` → Keep going (daemon mode loops)
|
|
136
|
-
- `[approve: question]` → Halt until human approves
|
|
144
|
+
## Providers
|
|
137
145
|
|
|
138
|
-
|
|
146
|
+
| Provider | Alias | Description |
|
|
147
|
+
|----------|-------|-------------|
|
|
148
|
+
| claude | c | Anthropic Claude Code |
|
|
149
|
+
| gemini | g | Google Gemini |
|
|
150
|
+
| ollama | o | Local Ollama |
|
|
139
151
|
|
|
140
|
-
|
|
152
|
+
## Key Flags
|
|
141
153
|
|
|
154
|
+
```bash
|
|
155
|
+
-a, --autonomous # Full auto: create task + daemon + work until done
|
|
156
|
+
-p, --prompt # The prompt/goal
|
|
157
|
+
-y, --yolo # Skip confirmations
|
|
158
|
+
--continue <task> # Continue specific task
|
|
142
159
|
```
|
|
143
|
-
Agent output:
|
|
144
|
-
This is too big. Breaking it down.
|
|
145
160
|
|
|
146
|
-
|
|
147
|
-
[split: auth "Authentication system"]
|
|
148
|
-
[split: crud "CRUD operations"]
|
|
149
|
-
[next: Start with setup subtask]
|
|
150
|
-
[pause]
|
|
151
|
-
```
|
|
161
|
+
## Key Principles
|
|
152
162
|
|
|
153
|
-
|
|
163
|
+
- **Memory is everything** - Agents forget between sessions. Save state.
|
|
164
|
+
- **Criteria drive completion** - No criteria = no way to know when done.
|
|
165
|
+
- **Checkpoint often** - Sessions can die anytime.
|
|
166
|
+
- **Ask when stuck** - Get a nudge from the user vs. spinning.
|
|
167
|
+
- **Learn & promote** - Build the playbook for future tasks.
|
|
154
168
|
|
|
155
|
-
##
|
|
169
|
+
## Architecture
|
|
156
170
|
|
|
157
|
-
```
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
# Day 2: Continue
|
|
169
|
-
cd ~/Projects/my-app
|
|
170
|
-
agx claude -p "continue"
|
|
171
|
-
# Context auto-loaded, agent picks up where it left off
|
|
171
|
+
```
|
|
172
|
+
agx (agent execution)
|
|
173
|
+
├── Uses mem CLI for all state operations
|
|
174
|
+
├── Nudges via: mem set/get/pop
|
|
175
|
+
├── Tasks via: mem tasks --json
|
|
176
|
+
└── Context via: mem context --json
|
|
177
|
+
|
|
178
|
+
mem (storage layer)
|
|
179
|
+
├── Git-backed state in ~/.mem
|
|
180
|
+
├── Branch per task
|
|
181
|
+
└── KV primitives (set/get/pop)
|
|
172
182
|
```
|
|
173
183
|
|
|
174
184
|
## License
|