@action-llama/action-llama 0.1.2 → 0.1.4
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 +122 -339
- package/dist/agents/container-entry.js +2 -2
- package/dist/agents/container-entry.js.map +1 -1
- package/dist/agents/container-runner.d.ts +2 -2
- package/dist/agents/container-runner.d.ts.map +1 -1
- package/dist/agents/container-runner.js +4 -4
- package/dist/agents/container-runner.js.map +1 -1
- package/dist/agents/prompt.js +1 -1
- package/dist/agents/prompt.js.map +1 -1
- package/dist/agents/runner.js +2 -2
- package/dist/agents/runner.js.map +1 -1
- package/dist/cli/commands/agent/add.js +2 -2
- package/dist/cli/commands/agent/add.js.map +1 -1
- package/dist/cli/commands/{init.d.ts → new.d.ts} +1 -1
- package/dist/cli/commands/new.d.ts.map +1 -0
- package/dist/cli/commands/{init.js → new.js} +1 -1
- package/dist/cli/commands/new.js.map +1 -0
- package/dist/cli/commands/start.js +3 -3
- package/dist/cli/commands/start.js.map +1 -1
- package/dist/cli/main.js +2 -2
- package/dist/cli/main.js.map +1 -1
- package/dist/docker/container.d.ts +1 -1
- package/dist/docker/container.d.ts.map +1 -1
- package/dist/docker/container.js +1 -1
- package/dist/docker/container.js.map +1 -1
- package/dist/docker/network.js +1 -1
- package/dist/docker/network.js.map +1 -1
- package/dist/{broker → gateway}/index.d.ts +3 -3
- package/dist/gateway/index.d.ts.map +1 -0
- package/dist/{broker → gateway}/index.js +5 -5
- package/dist/gateway/index.js.map +1 -0
- package/dist/gateway/router.d.ts.map +1 -0
- package/dist/gateway/router.js.map +1 -0
- package/dist/gateway/routes/shutdown.d.ts.map +1 -0
- package/dist/gateway/routes/shutdown.js.map +1 -0
- package/dist/gateway/routes/webhooks.d.ts.map +1 -0
- package/dist/gateway/routes/webhooks.js.map +1 -0
- package/dist/scheduler/index.d.ts +2 -2
- package/dist/scheduler/index.d.ts.map +1 -1
- package/dist/scheduler/index.js +26 -26
- package/dist/scheduler/index.js.map +1 -1
- package/dist/setup/prompts.js +1 -1
- package/dist/setup/prompts.js.map +1 -1
- package/dist/shared/config.d.ts +2 -2
- package/dist/shared/config.d.ts.map +1 -1
- package/dist/shared/config.js +7 -1
- package/dist/shared/config.js.map +1 -1
- package/dist/shared/credentials.js +1 -1
- package/dist/shared/credentials.js.map +1 -1
- package/dist/tui/App.js +1 -1
- package/dist/tui/App.js.map +1 -1
- package/dist/tui/status-tracker.d.ts +1 -1
- package/dist/tui/status-tracker.d.ts.map +1 -1
- package/package.json +1 -1
- package/dist/broker/index.d.ts.map +0 -1
- package/dist/broker/index.js.map +0 -1
- package/dist/broker/router.d.ts.map +0 -1
- package/dist/broker/router.js.map +0 -1
- package/dist/broker/routes/shutdown.d.ts.map +0 -1
- package/dist/broker/routes/shutdown.js.map +0 -1
- package/dist/broker/routes/webhooks.d.ts.map +0 -1
- package/dist/broker/routes/webhooks.js.map +0 -1
- package/dist/cli/commands/init.d.ts.map +0 -1
- package/dist/cli/commands/init.js.map +0 -1
- /package/dist/{broker → gateway}/router.d.ts +0 -0
- /package/dist/{broker → gateway}/router.js +0 -0
- /package/dist/{broker → gateway}/routes/shutdown.d.ts +0 -0
- /package/dist/{broker → gateway}/routes/shutdown.js +0 -0
- /package/dist/{broker → gateway}/routes/webhooks.d.ts +0 -0
- /package/dist/{broker → gateway}/routes/webhooks.js +0 -0
package/README.md
CHANGED
|
@@ -4,251 +4,134 @@
|
|
|
4
4
|
|
|
5
5
|
# Action Llama
|
|
6
6
|
|
|
7
|
-
|
|
7
|
+
Run agents like scripts: triggered by cron or webhooks.
|
|
8
8
|
|
|
9
|
-
|
|
9
|
+
Dev Experience:
|
|
10
10
|
|
|
11
11
|
1. Either a webhook or cron wakes up the agent
|
|
12
12
|
2. The agent runs according the instructions in AGENTS.md you define
|
|
13
13
|
3. The agent shuts down
|
|
14
14
|
|
|
15
|
-
|
|
15
|
+
Key features:
|
|
16
16
|
|
|
17
|
-
-
|
|
18
|
-
-
|
|
17
|
+
- Agent runs are contained in a Docker container using only the credentials they need. Credentials are stored separately.
|
|
18
|
+
- Define your agents in a git repo, add custom ones, and share them.
|
|
19
|
+
- BYOM: bring your own model.
|
|
19
20
|
|
|
20
|
-
|
|
21
|
+
Philosophy:
|
|
21
22
|
|
|
22
|
-
|
|
23
|
+
- AL is a thin wrapper around Claude or GPT. The models move so quickly, it's important to minimize the harness.
|
|
23
24
|
|
|
24
|
-
|
|
25
|
-
# 1. Create a new Action Llama project
|
|
26
|
-
npx create-action-llama my-project
|
|
25
|
+
Use cases:
|
|
27
26
|
|
|
28
|
-
|
|
29
|
-
|
|
27
|
+
- A developer agent that watches for new Github issues and reacts
|
|
28
|
+
- A reviewer agent that watches for new Github Pull Requests and reviews them then merges if all ok
|
|
30
29
|
|
|
31
|
-
|
|
32
|
-
cd my-project
|
|
33
|
-
al start
|
|
34
|
-
```
|
|
30
|
+
Have as many agents as you like. Customize the behaviour as you wish. The system is MIT licensed and fully extensible.
|
|
35
31
|
|
|
36
32
|
Built on [pi.dev](https://github.com/badlogic/pi-mono) as the agent harness.
|
|
37
33
|
|
|
38
|
-
##
|
|
39
|
-
|
|
40
|
-
The project includes a few default agents to get you started
|
|
34
|
+
## How to get started
|
|
41
35
|
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
| **PR Reviewer** | Webhook: PR opened/updated; or poll for open PRs | Reviews code for correctness, style, security; approves+merges or requests changes |
|
|
46
|
-
| **DevOps** | Poll for CI failures/Sentry errors | Creates Github issues describing problem and potential fix |
|
|
36
|
+
```bash
|
|
37
|
+
npx @action-llama/action-llama@latest new my-project
|
|
38
|
+
```
|
|
47
39
|
|
|
48
|
-
|
|
40
|
+
The setup wizard walks you through everything:
|
|
49
41
|
|
|
50
|
-
|
|
51
|
-
- Git
|
|
52
|
-
- Docker
|
|
53
|
-
- A GitHub Personal Access Token with `repo` and `workflow` scopes
|
|
54
|
-
- Anthropic auth — one of:
|
|
55
|
-
- Existing pi auth (`pi /login`) or Claude Code auth (`claude setup-token`)
|
|
56
|
-
- An Anthropic API key (`sk-ant-api...`)
|
|
57
|
-
- An OAuth token (`sk-ant-oat...`)
|
|
58
|
-
- (Optional) A Sentry auth token
|
|
59
|
-
- (Optional) A GitHub webhook secret (for webhook-triggered agents)
|
|
42
|
+
**Step 1 — Agents:** Select which agents to create. Pick **dev** to start — this is the developer agent that implements issues and opens PRs.
|
|
60
43
|
|
|
61
|
-
|
|
44
|
+
**Step 2 — Credentials:** Paste your GitHub PAT (needs `repo` + `workflow` scopes) and choose how to authenticate with Anthropic (existing pi auth, API key, or OAuth token). Tokens are validated against their APIs before continuing.
|
|
62
45
|
|
|
63
|
-
|
|
64
|
-
npx @action-llama/action-llama init my-project
|
|
65
|
-
cd my-project
|
|
66
|
-
```
|
|
46
|
+
**Step 3 — LLM Defaults:** Pick a model and thinking level. The defaults (`claude-sonnet-4-20250514`, `medium` thinking) are a good starting point.
|
|
67
47
|
|
|
68
|
-
|
|
48
|
+
**Step 4 — Configure each agent:** For the dev agent you'll be asked:
|
|
49
|
+
- **Repos** — which GitHub repos to monitor (fetched from your token)
|
|
50
|
+
- **Trigger label** — the issue label that activates the agent (default: `agent`)
|
|
51
|
+
- **Assignee** — only trigger on issues assigned to this user (default: your GitHub username)
|
|
52
|
+
- **Webhooks** — say **no** for now (requires setting up a GitHub webhook endpoint)
|
|
53
|
+
- **Schedule** — say **yes**, and accept the default `*/5 * * * *` (poll every 5 minutes)
|
|
69
54
|
|
|
70
|
-
|
|
55
|
+
Once setup finishes:
|
|
71
56
|
|
|
72
57
|
```bash
|
|
73
|
-
# 1. Initialize a project (interactive setup)
|
|
74
|
-
npx @action-llama/action-llama init my-project
|
|
75
|
-
|
|
76
|
-
# 2. Start the agents
|
|
77
58
|
cd my-project
|
|
78
59
|
al start
|
|
79
60
|
```
|
|
80
61
|
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
Action Llama separates three concerns:
|
|
62
|
+
The dev agent will poll every 5 minutes looking for issues that match its filter: the issue must have the trigger label (default: `agent`) **and** be assigned to the configured user. When it finds a match, it clones the repo, creates a branch, implements the changes described in the issue, runs tests, and opens a PR.
|
|
84
63
|
|
|
85
|
-
|
|
86
|
-
|-----------|---------|------------|
|
|
87
|
-
| `~/.action-llama-credentials/` | Secrets (shared across projects) | `al init` |
|
|
88
|
-
| `./<project-name>/` | Per-project config, agent instructions, scratch space | `al init` |
|
|
64
|
+
Edit `dev/AGENTS.md` to customize how the agent works — changes take effect on the next run.
|
|
89
65
|
|
|
90
|
-
|
|
66
|
+
### Project structure
|
|
91
67
|
|
|
92
|
-
|
|
68
|
+
The setup creates:
|
|
93
69
|
|
|
94
|
-
The setup CLI (`al init <name>`) walks through three steps:
|
|
95
|
-
|
|
96
|
-
### Step 1: Credentials
|
|
97
|
-
- Paste your GitHub PAT
|
|
98
|
-
- (Optional) Paste your Sentry auth token
|
|
99
|
-
- Choose your Anthropic authentication method:
|
|
100
|
-
- **Use existing pi auth** — if you already ran `pi /login` or `claude setup-token`
|
|
101
|
-
- **Enter an API key** — a standard `sk-ant-api...` key, validated against the API
|
|
102
|
-
- **Enter an OAuth token** — a `sk-ant-oat...` token from `claude setup-token`, format-checked
|
|
103
|
-
|
|
104
|
-
### Step 2: LLM defaults
|
|
105
|
-
- Select a model (default: `claude-sonnet-4-20250514`)
|
|
106
|
-
- Select thinking level (default: `medium`)
|
|
107
|
-
|
|
108
|
-
### Step 3: Agents
|
|
109
|
-
- Select which built-in agents to enable (dev, reviewer, devops) and/or add custom agents
|
|
110
|
-
- For each agent, configure:
|
|
111
|
-
- **Name** (allows multiple instances, e.g., `dev-frontend`, `dev-backend`)
|
|
112
|
-
- **Repos** to monitor
|
|
113
|
-
- Type-specific options: trigger label / assignee (dev), Sentry org / projects (devops)
|
|
114
|
-
- **Webhooks** — listen for GitHub events (default webhook filter per agent type)
|
|
115
|
-
- **Schedule** — poll on a cron interval (optional if webhooks are enabled)
|
|
116
|
-
- If any agent uses webhooks, you'll be asked for a **GitHub webhook secret** (used to verify `x-hub-signature-256` on incoming payloads)
|
|
117
|
-
|
|
118
|
-
## Running
|
|
119
|
-
|
|
120
|
-
```bash
|
|
121
|
-
# Start all agents (host mode, default)
|
|
122
|
-
al start
|
|
123
|
-
|
|
124
|
-
# Check agent status
|
|
125
|
-
al status
|
|
126
70
|
```
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
```bash
|
|
135
|
-
# Requires Docker installed and running
|
|
136
|
-
# Enable in config.json: "docker": { "enabled": true }
|
|
137
|
-
al start
|
|
71
|
+
my-project/
|
|
72
|
+
package.json # Includes @action-llama/action-llama as a dependency
|
|
73
|
+
config.json # Global config: docker, gateway, webhooks (no secrets)
|
|
74
|
+
dev/ # One directory per agent
|
|
75
|
+
config.json # Agent config: repos, schedule, model, webhooks, etc.
|
|
76
|
+
AGENTS.md # Agent instructions — edit this to customize behavior
|
|
138
77
|
```
|
|
139
78
|
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
### Logs
|
|
143
|
-
|
|
144
|
-
Structured JSON logs are written to daily files at `<project>/.al/logs/<agent>-<YYYY-MM-DD>.log` and also printed to stdout. In Docker mode, container logs are forwarded through the same pino logger — tool events and errors all appear in the standard log files.
|
|
79
|
+
Credentials are stored separately in `~/.action-llama-credentials/` (shared across projects, not committed to git).
|
|
145
80
|
|
|
146
81
|
## CLI commands
|
|
147
82
|
|
|
148
83
|
| Command | Description |
|
|
149
84
|
|---------|-------------|
|
|
150
|
-
| `
|
|
151
|
-
| `al start` | Start scheduler
|
|
152
|
-
| `al status` | Show
|
|
153
|
-
| `al logs
|
|
154
|
-
| `al agent add` | Add a new agent to an existing project |
|
|
155
|
-
|
|
156
|
-
## Using the developer agent
|
|
157
|
-
|
|
158
|
-
1. Create an issue in one of your monitored repos
|
|
159
|
-
2. Add the trigger label (default: `agent`) and assign it to the configured user
|
|
160
|
-
3. The developer agent wakes (immediately via webhook, or on the next poll) and will:
|
|
161
|
-
- Find the issue via `gh issue list`
|
|
162
|
-
- Clone the repo and create a branch
|
|
163
|
-
- Read `AGENTS.md`/`CLAUDE.md` for project conventions
|
|
164
|
-
- Implement the changes, run tests
|
|
165
|
-
- Push and open a PR via `gh pr create`
|
|
166
|
-
|
|
167
|
-
## Using the PR reviewer agent
|
|
168
|
-
|
|
169
|
-
The reviewer automatically picks up open PRs on each poll. It:
|
|
170
|
-
- Gets the diff via `gh pr diff`, checks CI status
|
|
171
|
-
- Reviews for correctness, style, tests, and security
|
|
172
|
-
- Approves and squash-merges clean PRs with green CI
|
|
173
|
-
- Requests changes with specific feedback on problematic PRs
|
|
174
|
-
- Skips PRs it has already reviewed at the same commit SHA
|
|
85
|
+
| `al new <name>` | Create a new project (interactive setup for credentials, model, and agents) |
|
|
86
|
+
| `al start` | Start the scheduler — runs agents on their cron schedule and/or webhook triggers |
|
|
87
|
+
| `al status` | Show the current status of all agents |
|
|
88
|
+
| `al logs <agent>` | View log entries for an agent |
|
|
89
|
+
| `al agent add [definition]` | Add a new agent to an existing project (built-in name or custom definition path) |
|
|
175
90
|
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
The DevOps agent monitors for failures:
|
|
179
|
-
- **GitHub Actions**: finds failed workflow runs via `gh run list`
|
|
180
|
-
- **Sentry**: finds new unresolved error groups via `curl` to the Sentry API (if configured)
|
|
181
|
-
|
|
182
|
-
For each new error, it creates a GitHub issue with the error details and a link to the source. Errors are deduplicated by fingerprint so the same failure is never filed twice.
|
|
183
|
-
|
|
184
|
-
## Project structure
|
|
185
|
-
|
|
186
|
-
```
|
|
187
|
-
~/.action-llama-credentials/ # Secrets (shared across projects)
|
|
188
|
-
github-token
|
|
189
|
-
sentry-token # (optional)
|
|
190
|
-
anthropic-key # (optional, if not using pi_auth)
|
|
191
|
-
github-webhook-secret # (optional, for webhook-triggered agents)
|
|
192
|
-
|
|
193
|
-
./<project-name>/ # Per-project (created by npx @action-llama/action-llama init)
|
|
194
|
-
package.json # Includes @action-llama/action-llama as a dependency
|
|
195
|
-
config.json # Global config: docker, broker, webhooks (no secrets)
|
|
196
|
-
dev/ # Agent directory (CWD for agent sessions)
|
|
197
|
-
config.json # Agent config: repos, webhooks, schedule, prompt, etc.
|
|
198
|
-
AGENTS.md # Instructions (written during init, edit to customize)
|
|
199
|
-
dev-backend/ # Multiple instances are supported
|
|
200
|
-
config.json
|
|
201
|
-
AGENTS.md
|
|
202
|
-
reviewer/
|
|
203
|
-
config.json
|
|
204
|
-
AGENTS.md
|
|
205
|
-
devops/
|
|
206
|
-
config.json
|
|
207
|
-
AGENTS.md
|
|
208
|
-
node_modules/ # Dependencies (after npm install)
|
|
209
|
-
.workspace/ # Git clones and worktrees (gitignored)
|
|
210
|
-
.al/
|
|
211
|
-
state/{dev,dev-backend,...}/ # Dedup/tracking state per agent
|
|
212
|
-
logs/ # Structured logs
|
|
213
|
-
```
|
|
91
|
+
### Common options
|
|
214
92
|
|
|
215
|
-
|
|
93
|
+
- `-p, --project <dir>` — specify the project directory (defaults to `.`)
|
|
216
94
|
|
|
217
|
-
###
|
|
95
|
+
### `al logs` options
|
|
218
96
|
|
|
219
|
-
|
|
97
|
+
- `-n, --lines <N>` — number of log entries to show (default: 50)
|
|
98
|
+
- `-f, --follow` — tail mode, watch for new log entries
|
|
99
|
+
- `-d, --date <YYYY-MM-DD>` — view a specific date's log file
|
|
220
100
|
|
|
221
|
-
|
|
222
|
-
2. The runner injects credentials as environment variables (`GITHUB_TOKEN`, etc.) — agents never see raw credential files
|
|
223
|
-
3. Agents use standard tools (`gh` CLI, `git`, `curl`) which read credentials from env vars
|
|
224
|
-
4. Agents have no extensions loaded (`noExtensions: true`) — only bash, read, edit, write tools for working in worktrees
|
|
225
|
-
5. Anti-exfiltration policy is injected into agent prompts — agents are instructed to never output credentials in logs, comments, or PRs
|
|
101
|
+
### `al start` options
|
|
226
102
|
|
|
227
|
-
|
|
103
|
+
- `--dangerous-no-docker` — disable Docker container isolation and run agents directly on the host
|
|
228
104
|
|
|
229
|
-
|
|
105
|
+
## Built-in Agents
|
|
230
106
|
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
107
|
+
| Agent | Trigger | Action |
|
|
108
|
+
|-------|---------|--------|
|
|
109
|
+
| **Developer** | Webhook: issue labeled; or poll for labeled issues | Checks out a worktree, implements the fix/feature, runs tests, opens a PR |
|
|
110
|
+
| **PR Reviewer** | Webhook: PR opened/updated; or poll for open PRs | Reviews code for correctness, style, security; approves+merges or requests changes |
|
|
111
|
+
| **DevOps** | Poll for CI failures/Sentry errors | Creates Github issues describing problem and potential fix |
|
|
236
112
|
|
|
237
113
|
## Configuration
|
|
238
114
|
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
**`<project>/config.json`** — global settings (Docker, broker, webhooks):
|
|
115
|
+
### Global config (`config.json`)
|
|
242
116
|
|
|
243
117
|
```json
|
|
244
118
|
{
|
|
245
119
|
"docker": { "enabled": false },
|
|
246
|
-
"
|
|
120
|
+
"gateway": { "port": 8080 },
|
|
247
121
|
"webhooks": { "githubSecretCredential": "github-webhook-secret" }
|
|
248
122
|
}
|
|
249
123
|
```
|
|
250
124
|
|
|
251
|
-
|
|
125
|
+
| Key | Default | Description |
|
|
126
|
+
|-----|---------|-------------|
|
|
127
|
+
| `docker.enabled` | `false` | Run agents in isolated Docker containers |
|
|
128
|
+
| `docker.image` | `"al-agent:latest"` | Docker image for containers |
|
|
129
|
+
| `docker.memory` | `"4g"` | Memory limit per container |
|
|
130
|
+
| `docker.cpus` | `2` | CPU limit per container |
|
|
131
|
+
| `docker.timeout` | `3600` | Max container runtime (seconds) |
|
|
132
|
+
| `gateway.port` | `8080` | Gateway server listen port |
|
|
133
|
+
|
|
134
|
+
### Agent config (`<agent>/config.json`)
|
|
252
135
|
|
|
253
136
|
```json
|
|
254
137
|
{
|
|
@@ -256,12 +139,10 @@ Config is split between a global `config.json` and per-agent `config.json` files
|
|
|
256
139
|
"model": { "provider": "anthropic", "model": "claude-sonnet-4-20250514", "thinkingLevel": "medium", "authType": "pi_auth" },
|
|
257
140
|
"prompt": "An issue was just assigned to you. Implement the changes described in the issue.",
|
|
258
141
|
"repos": ["acme/frontend"],
|
|
259
|
-
"
|
|
260
|
-
"assignee": "bot-user",
|
|
142
|
+
"schedule": "*/5 * * * *",
|
|
261
143
|
"webhooks": {
|
|
262
144
|
"filters": [{
|
|
263
145
|
"source": "github",
|
|
264
|
-
"repos": ["acme/frontend"],
|
|
265
146
|
"events": ["issues"],
|
|
266
147
|
"actions": ["labeled"],
|
|
267
148
|
"labels": ["agent"],
|
|
@@ -271,189 +152,91 @@ Config is split between a global `config.json` and per-agent `config.json` files
|
|
|
271
152
|
}
|
|
272
153
|
```
|
|
273
154
|
|
|
274
|
-
Agents can use webhooks, a cron schedule, or both.
|
|
155
|
+
Agents can use webhooks, a cron schedule, or both. Each agent carries its own model config, so you can run different models per agent (e.g., Opus for dev, Haiku for devops). Edit these files directly or re-run `al new` for guided reconfiguration.
|
|
275
156
|
|
|
276
|
-
|
|
157
|
+
### Webhooks
|
|
277
158
|
|
|
278
|
-
|
|
159
|
+
To use webhooks instead of polling, enable them during `al new` and add a webhook in your GitHub repo settings:
|
|
279
160
|
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
| `docker.image` | `"al-agent:latest"` | Docker image for agent containers |
|
|
284
|
-
| `docker.memory` | `"4g"` | Memory limit per container |
|
|
285
|
-
| `docker.cpus` | `2` | CPU limit per container |
|
|
286
|
-
| `docker.timeout` | `3600` | Max container runtime in seconds |
|
|
287
|
-
| `broker.port` | `8080` | Broker server listen port |
|
|
288
|
-
| `webhooks.githubSecretCredential` | `"github-webhook-secret"` | Credential name for the GitHub webhook HMAC secret |
|
|
289
|
-
|
|
290
|
-
## Webhooks
|
|
291
|
-
|
|
292
|
-
Agents can be triggered by GitHub webhooks for real-time responses instead of (or in addition to) polling. The setup wizard configures default webhook filters per agent type:
|
|
293
|
-
|
|
294
|
-
| Agent | Default filter |
|
|
295
|
-
|-------|---------------|
|
|
296
|
-
| **Developer** | `issues` event, `labeled` action, matching trigger label + assignee |
|
|
297
|
-
| **PR Reviewer** | `pull_request` event, `opened` / `synchronize` actions |
|
|
298
|
-
| **DevOps** | `workflow_run` event, `completed` action |
|
|
161
|
+
- **Payload URL**: `http://<your-host>:8080/webhooks/github`
|
|
162
|
+
- **Content type**: `application/json`
|
|
163
|
+
- **Secret**: the same secret you entered during setup
|
|
299
164
|
|
|
300
|
-
|
|
165
|
+
Payloads are validated with HMAC-SHA256 (`x-hub-signature-256`). Webhook filters in `webhooks.filters` support matching on `source`, `repos`, `events`, `actions`, `labels`, `assignee`, `author`, and `branches` (AND logic; omitted fields are not checked).
|
|
301
166
|
|
|
302
|
-
|
|
303
|
-
2. In your GitHub repo (or org) settings, add a webhook:
|
|
304
|
-
- **Payload URL**: `http://<your-host>:8080/webhooks/github`
|
|
305
|
-
- **Content type**: `application/json`
|
|
306
|
-
- **Secret**: the same secret you entered during `al init`
|
|
307
|
-
- **Events**: select the events your agents listen for (or "Send me everything")
|
|
308
|
-
3. Start AL — the broker server listens for incoming webhooks automatically
|
|
309
|
-
|
|
310
|
-
Webhook payloads are validated using HMAC-SHA256 (`x-hub-signature-256`). If the signature doesn't match, the request is rejected with 401.
|
|
311
|
-
|
|
312
|
-
### Webhook filter options
|
|
313
|
-
|
|
314
|
-
Filters are configured in `<agent>/config.json` under `webhooks.filters`. Each filter can match on:
|
|
315
|
-
|
|
316
|
-
| Field | Type | Description |
|
|
317
|
-
|-------|------|-------------|
|
|
318
|
-
| `source` | `"github"` | Required — the webhook source |
|
|
319
|
-
| `repos` | `string[]` | Only match events from these repos |
|
|
320
|
-
| `events` | `string[]` | GitHub event types (`issues`, `pull_request`, `push`, etc.) |
|
|
321
|
-
| `actions` | `string[]` | Event actions (`opened`, `labeled`, `synchronize`, etc.) |
|
|
322
|
-
| `labels` | `string[]` | Match if the issue/PR has any of these labels |
|
|
323
|
-
| `assignee` | `string` | Match if assigned to this user |
|
|
324
|
-
| `author` | `string` | Match if authored by this user |
|
|
325
|
-
| `branches` | `string[]` | Match if targeting one of these branches |
|
|
326
|
-
|
|
327
|
-
All specified fields must match (AND logic). Omitted fields are not checked.
|
|
167
|
+
### Docker mode
|
|
328
168
|
|
|
329
|
-
|
|
169
|
+
Set `"docker": { "enabled": true }` in `config.json`. Agents run in isolated containers with credentials mounted read-only at `/credentials/`, a read-only root FS, dropped capabilities, non-root user, and PID/memory/CPU limits. Each container gets a unique shutdown secret for the anti-exfiltration kill switch. The Docker image is built automatically on first run from `docker/Dockerfile`.
|
|
330
170
|
|
|
331
|
-
|
|
171
|
+
## Developing
|
|
332
172
|
|
|
333
|
-
|
|
173
|
+
### Prerequisites
|
|
334
174
|
|
|
335
|
-
|
|
175
|
+
- Node.js >= 20, Git, Docker
|
|
176
|
+
- GitHub PAT with `repo` + `workflow` scopes
|
|
177
|
+
- Anthropic auth (pi auth, API key, or OAuth token)
|
|
336
178
|
|
|
337
|
-
|
|
179
|
+
### Setup
|
|
338
180
|
|
|
339
181
|
```bash
|
|
340
|
-
|
|
182
|
+
git clone <repo>
|
|
183
|
+
cd action-llama
|
|
184
|
+
npm install
|
|
185
|
+
npm run build
|
|
341
186
|
npm test
|
|
342
|
-
|
|
343
|
-
# Watch mode (re-runs on file changes)
|
|
344
|
-
npm run test:watch
|
|
345
|
-
|
|
346
|
-
# Run with coverage report
|
|
347
|
-
npm run test:coverage
|
|
348
187
|
```
|
|
349
188
|
|
|
350
|
-
|
|
189
|
+
### How it works
|
|
351
190
|
|
|
352
|
-
|
|
353
|
-
test/
|
|
354
|
-
helpers.ts # Shared test utilities
|
|
355
|
-
shared/ # Unit tests for shared modules
|
|
356
|
-
agents/ # Agent runner, prompt builder, default agent tests
|
|
357
|
-
setup/ # Setup validators + scaffolding tests
|
|
358
|
-
scheduler/ # Scheduler, webhook integration tests
|
|
359
|
-
webhooks/ # Webhook registry + GitHub provider tests
|
|
360
|
-
```
|
|
361
|
-
|
|
362
|
-
Coverage is collected for all `src/**/*.ts` files, excluding entry points (`cli/main.ts`), interactive prompts (`setup/prompts.ts`), and pure type definitions (`scheduler/types.ts`).
|
|
191
|
+
`al start` runs a single Node.js process (the **scheduler**) that:
|
|
363
192
|
|
|
364
|
-
|
|
193
|
+
1. Discovers agents in the project directory (each subdirectory with a `config.json`)
|
|
194
|
+
2. Starts a **gateway** HTTP server if webhooks or Docker mode are enabled (health check, webhook receiver, shutdown kill switch)
|
|
195
|
+
3. Creates a **runner** per agent — either `AgentRunner` (host mode) or `ContainerAgentRunner` (Docker mode)
|
|
196
|
+
4. Wires up **cron jobs** and/or **webhook bindings** to trigger each runner
|
|
197
|
+
5. On trigger, the runner builds a prompt (injecting `<agent-config>` and optionally `<webhook-trigger>` blocks), starts a [pi-coding-agent](https://github.com/badlogic/pi-mono) session, and streams output to the logger
|
|
365
198
|
|
|
366
|
-
|
|
199
|
+
### Source layout
|
|
367
200
|
|
|
368
201
|
```
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
│ ● Shutdown kill switch │ │ sentry-token (optional) │
|
|
380
|
-
│ ● Webhook receiver │ │ │
|
|
381
|
-
│ │ │ /workspace/ (tmpfs) │
|
|
382
|
-
│ Credentials (~/.al-creds/) │ │ Internet access: yes │
|
|
383
|
-
│ Workspace (project/.workspace/)│ └──────────────────────────────┘
|
|
384
|
-
└──────────────────────────────────┘
|
|
202
|
+
src/
|
|
203
|
+
cli/ # Command definitions (new, start, status, logs, agent add)
|
|
204
|
+
setup/ # Interactive setup wizard (prompts, validators, scaffolding)
|
|
205
|
+
scheduler/ # Scheduler: discovers agents, starts gateway, wires cron + webhooks
|
|
206
|
+
agents/ # Agent runners (host + Docker), prompt builder, built-in definitions
|
|
207
|
+
gateway/ # HTTP server: router, health, shutdown, webhook routes
|
|
208
|
+
docker/ # Container lifecycle (launch, wait, logs, remove), image + network
|
|
209
|
+
webhooks/ # Webhook registry, provider interface, GitHub provider
|
|
210
|
+
tui/ # Ink-based terminal UI (App.tsx, status tracker)
|
|
211
|
+
shared/ # Config loader, credentials, logger, paths, git helpers
|
|
385
212
|
```
|
|
386
213
|
|
|
387
|
-
###
|
|
388
|
-
|
|
389
|
-
- Docker installed and running
|
|
390
|
-
- Set `"docker": { "enabled": true }` in `config.json`
|
|
391
|
-
|
|
392
|
-
The agent Docker image is built automatically on first run from `docker/Dockerfile`.
|
|
393
|
-
|
|
394
|
-
## Publishing to npm
|
|
395
|
-
|
|
396
|
-
The package is configured for standard npm publishing under the `@action-llama` scope.
|
|
397
|
-
|
|
398
|
-
### Prerequisites
|
|
399
|
-
|
|
400
|
-
1. An [npm account](https://www.npmjs.com/signup) with access to the `@action-llama` org
|
|
401
|
-
2. Login to npm:
|
|
402
|
-
```bash
|
|
403
|
-
npm login
|
|
404
|
-
```
|
|
405
|
-
|
|
406
|
-
### Version and publish
|
|
214
|
+
### Extension points
|
|
407
215
|
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
npm version patch
|
|
413
|
-
|
|
414
|
-
# Minor release (0.1.0 → 0.2.0)
|
|
415
|
-
npm version minor
|
|
416
|
-
|
|
417
|
-
# Major release (0.1.0 → 1.0.0)
|
|
418
|
-
npm version major
|
|
419
|
-
```
|
|
216
|
+
- **New agent type** — add a definition under `src/agents/definitions/<name>/` with a `config-definition.json` (schema for params, default schedule, webhook filters) and an `AGENTS.md` template. It will appear in `al new` and `al agent add` automatically.
|
|
217
|
+
- **New webhook provider** — implement the `WebhookProvider` interface in `src/webhooks/providers/` and register it in `src/scheduler/index.ts`. The registry handles routing by `source` field.
|
|
218
|
+
- **Custom runner** — subclass or replace `AgentRunner` in `src/agents/runner.ts` to change how agent sessions are created (different model providers, tool sets, etc.).
|
|
219
|
+
- **Gateway routes** — add routes in `src/gateway/routes/` and register them in `src/gateway/index.ts`.
|
|
420
220
|
|
|
421
|
-
|
|
221
|
+
### Tests
|
|
422
222
|
|
|
423
223
|
```bash
|
|
424
|
-
npm
|
|
224
|
+
npm test # run all 175 tests
|
|
225
|
+
npm run test:watch # watch mode
|
|
226
|
+
npm run test:coverage # V8 coverage report
|
|
425
227
|
```
|
|
426
228
|
|
|
427
|
-
|
|
229
|
+
Tests live in `test/` mirroring `src/`. Coverage excludes entry points (`cli/main.ts`), interactive prompts (`setup/prompts.ts`), and type-only files.
|
|
428
230
|
|
|
429
|
-
###
|
|
430
|
-
|
|
431
|
-
For the very first publish of a scoped package:
|
|
231
|
+
### Publishing
|
|
432
232
|
|
|
433
233
|
```bash
|
|
434
|
-
npm
|
|
234
|
+
npm login # need @action-llama org access
|
|
235
|
+
npm version patch # or minor / major — bumps, tags, pushes
|
|
236
|
+
npm publish --access public # build + tests run automatically via prepublishOnly
|
|
435
237
|
```
|
|
436
238
|
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
### What gets published
|
|
440
|
-
|
|
441
|
-
Only these files are included in the npm tarball (controlled by the `files` field in `package.json`):
|
|
442
|
-
|
|
443
|
-
- `dist/` — compiled JavaScript, source maps, and type declarations
|
|
444
|
-
- `docker/` — Dockerfile for container mode
|
|
445
|
-
- `README.md`
|
|
446
|
-
- `LICENSE`
|
|
447
|
-
- `package.json` (always included by npm)
|
|
448
|
-
|
|
449
|
-
### Build scripts
|
|
450
|
-
|
|
451
|
-
| Script | Description |
|
|
452
|
-
|--------|-------------|
|
|
453
|
-
| `npm run build` | Compile TypeScript to `dist/` and copy agent definition assets |
|
|
454
|
-
| `npm run clean` | Remove the `dist/` directory |
|
|
455
|
-
| `npm test` | Run all tests |
|
|
456
|
-
| `npm version <patch\|minor\|major>` | Bump version, tag, and push |
|
|
239
|
+
Published tarball includes `dist/`, `docker/`, `README.md`, `LICENSE`, and `package.json`.
|
|
457
240
|
|
|
458
241
|
## License
|
|
459
242
|
|
|
@@ -15,7 +15,7 @@ async function main() {
|
|
|
15
15
|
// Switch CWD to /workspace so child processes (git, bash, etc.) default to it.
|
|
16
16
|
// Node must resolve from /app (WORKDIR at build time), so we chdir after startup.
|
|
17
17
|
process.chdir("/workspace");
|
|
18
|
-
const
|
|
18
|
+
const gatewayUrl = process.env.GATEWAY_URL;
|
|
19
19
|
const shutdownSecret = process.env.SHUTDOWN_SECRET;
|
|
20
20
|
// Parse agent config from env var
|
|
21
21
|
const agentConfigStr = process.env.AGENT_CONFIG;
|
|
@@ -29,7 +29,7 @@ async function main() {
|
|
|
29
29
|
const agentConfig = parsed;
|
|
30
30
|
const modelId = agentConfig.model.model;
|
|
31
31
|
const modelThinking = agentConfig.model.thinkingLevel;
|
|
32
|
-
emitLog("info", "container starting", { agentName: agentConfig.name, modelId,
|
|
32
|
+
emitLog("info", "container starting", { agentName: agentConfig.name, modelId, gatewayUrl });
|
|
33
33
|
// Read Anthropic API key from credentials volume
|
|
34
34
|
const anthropicKey = readCredential("anthropic-key");
|
|
35
35
|
if (!anthropicKey) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"container-entry.js","sourceRoot":"","sources":["../../src/agents/container-entry.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,UAAU,EAAE,MAAM,IAAI,CAAC;AAC9C,OAAO,EAAE,QAAQ,EAAE,MAAM,qBAAqB,CAAC;AAC/C,OAAO,EACL,WAAW,EACX,kBAAkB,EAClB,qBAAqB,EACrB,cAAc,EACd,eAAe,EACf,iBAAiB,GAClB,MAAM,+BAA+B,CAAC;AAGvC,sFAAsF;AACtF,SAAS,OAAO,CAAC,KAAa,EAAE,GAAW,EAAE,IAA0B;IACrE,OAAO,CAAC,GAAG,CAAC,IAAI,CAAC,SAAS,CAAC,EAAE,IAAI,EAAE,IAAI,EAAE,KAAK,EAAE,GAAG,EAAE,GAAG,IAAI,EAAE,EAAE,EAAE,IAAI,CAAC,GAAG,EAAE,EAAE,CAAC,CAAC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