@action-llama/action-llama 0.12.2 → 0.13.1

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.
Files changed (168) hide show
  1. package/{docs/agent-reference → agent-docs}/AGENTS.md +31 -15
  2. package/{docs/agent-reference → agent-docs}/skills/README.md +1 -0
  3. package/agent-docs/skills/calls.md +82 -0
  4. package/{docs/agent-reference → agent-docs}/skills/resource-locks.md +13 -7
  5. package/{docs/agent-reference → agent-docs}/skills/signals.md +1 -1
  6. package/dist/agents/container-runner.d.ts +3 -2
  7. package/dist/agents/container-runner.d.ts.map +1 -1
  8. package/dist/agents/container-runner.js +12 -12
  9. package/dist/agents/container-runner.js.map +1 -1
  10. package/dist/agents/prompt.d.ts.map +1 -1
  11. package/dist/agents/prompt.js +3 -2
  12. package/dist/agents/prompt.js.map +1 -1
  13. package/dist/agents/runner.d.ts +3 -2
  14. package/dist/agents/runner.d.ts.map +1 -1
  15. package/dist/agents/runner.js +14 -14
  16. package/dist/agents/runner.js.map +1 -1
  17. package/dist/build-info.json +1 -1
  18. package/dist/cli/commands/doctor.d.ts +1 -0
  19. package/dist/cli/commands/doctor.d.ts.map +1 -1
  20. package/dist/cli/commands/doctor.js +53 -15
  21. package/dist/cli/commands/doctor.js.map +1 -1
  22. package/dist/cli/commands/env.d.ts +4 -0
  23. package/dist/cli/commands/env.d.ts.map +1 -1
  24. package/dist/cli/commands/env.js +41 -0
  25. package/dist/cli/commands/env.js.map +1 -1
  26. package/dist/cli/commands/kill.js +2 -2
  27. package/dist/cli/commands/kill.js.map +1 -1
  28. package/dist/cli/commands/logs.d.ts.map +1 -1
  29. package/dist/cli/commands/logs.js +25 -20
  30. package/dist/cli/commands/logs.js.map +1 -1
  31. package/dist/cli/commands/pause.js +2 -2
  32. package/dist/cli/commands/pause.js.map +1 -1
  33. package/dist/cli/commands/push.d.ts +1 -0
  34. package/dist/cli/commands/push.d.ts.map +1 -1
  35. package/dist/cli/commands/push.js +2 -1
  36. package/dist/cli/commands/push.js.map +1 -1
  37. package/dist/cli/commands/resume.js +2 -2
  38. package/dist/cli/commands/resume.js.map +1 -1
  39. package/dist/cli/commands/run.d.ts.map +1 -1
  40. package/dist/cli/commands/run.js +21 -46
  41. package/dist/cli/commands/run.js.map +1 -1
  42. package/dist/cli/commands/start.d.ts.map +1 -1
  43. package/dist/cli/commands/start.js +62 -2
  44. package/dist/cli/commands/start.js.map +1 -1
  45. package/dist/cli/commands/status.d.ts.map +1 -1
  46. package/dist/cli/commands/status.js +23 -7
  47. package/dist/cli/commands/status.js.map +1 -1
  48. package/dist/cli/commands/stop.d.ts +1 -0
  49. package/dist/cli/commands/stop.d.ts.map +1 -1
  50. package/dist/cli/commands/stop.js +3 -2
  51. package/dist/cli/commands/stop.js.map +1 -1
  52. package/dist/cli/gateway-client.d.ts +6 -0
  53. package/dist/cli/gateway-client.d.ts.map +1 -1
  54. package/dist/cli/gateway-client.js +19 -0
  55. package/dist/cli/gateway-client.js.map +1 -1
  56. package/dist/cli/main.js +12 -0
  57. package/dist/cli/main.js.map +1 -1
  58. package/dist/cloud/vps/constants.d.ts +1 -1
  59. package/dist/cloud/vps/constants.d.ts.map +1 -1
  60. package/dist/cloud/vps/constants.js +9 -0
  61. package/dist/cloud/vps/constants.js.map +1 -1
  62. package/dist/cloud/vps/hetzner-api.d.ts +14 -3
  63. package/dist/cloud/vps/hetzner-api.d.ts.map +1 -1
  64. package/dist/cloud/vps/hetzner-api.js +24 -11
  65. package/dist/cloud/vps/hetzner-api.js.map +1 -1
  66. package/dist/cloud/vps/provision.js +29 -6
  67. package/dist/cloud/vps/provision.js.map +1 -1
  68. package/dist/cloud/vps/ssh.d.ts +7 -0
  69. package/dist/cloud/vps/ssh.d.ts.map +1 -1
  70. package/dist/cloud/vps/ssh.js +15 -1
  71. package/dist/cloud/vps/ssh.js.map +1 -1
  72. package/dist/credentials/builtins/index.d.ts.map +1 -1
  73. package/dist/credentials/builtins/index.js +2 -0
  74. package/dist/credentials/builtins/index.js.map +1 -1
  75. package/dist/credentials/builtins/reddit-oauth.d.ts +4 -0
  76. package/dist/credentials/builtins/reddit-oauth.d.ts.map +1 -0
  77. package/dist/credentials/builtins/reddit-oauth.js +71 -0
  78. package/dist/credentials/builtins/reddit-oauth.js.map +1 -0
  79. package/dist/docker/local-runtime.d.ts +1 -0
  80. package/dist/docker/local-runtime.d.ts.map +1 -1
  81. package/dist/docker/local-runtime.js +9 -6
  82. package/dist/docker/local-runtime.js.map +1 -1
  83. package/dist/gateway/index.d.ts.map +1 -1
  84. package/dist/gateway/index.js +5 -4
  85. package/dist/gateway/index.js.map +1 -1
  86. package/dist/gateway/routes/logs.d.ts.map +1 -1
  87. package/dist/gateway/routes/logs.js +29 -111
  88. package/dist/gateway/routes/logs.js.map +1 -1
  89. package/dist/remote/bootstrap.d.ts +2 -0
  90. package/dist/remote/bootstrap.d.ts.map +1 -1
  91. package/dist/remote/bootstrap.js +7 -11
  92. package/dist/remote/bootstrap.js.map +1 -1
  93. package/dist/remote/push.d.ts +6 -0
  94. package/dist/remote/push.d.ts.map +1 -1
  95. package/dist/remote/push.js +172 -91
  96. package/dist/remote/push.js.map +1 -1
  97. package/dist/remote/ssh.d.ts +1 -0
  98. package/dist/remote/ssh.d.ts.map +1 -1
  99. package/dist/remote/ssh.js +8 -0
  100. package/dist/remote/ssh.js.map +1 -1
  101. package/dist/scheduler/index.d.ts.map +1 -1
  102. package/dist/scheduler/index.js +56 -7
  103. package/dist/scheduler/index.js.map +1 -1
  104. package/dist/scheduler/watcher.d.ts +1 -1
  105. package/dist/scheduler/watcher.d.ts.map +1 -1
  106. package/dist/scheduler/watcher.js +5 -6
  107. package/dist/scheduler/watcher.js.map +1 -1
  108. package/dist/setup/scaffold.js +2 -2
  109. package/dist/setup/scaffold.js.map +1 -1
  110. package/dist/shared/config.d.ts +1 -0
  111. package/dist/shared/config.d.ts.map +1 -1
  112. package/dist/shared/config.js.map +1 -1
  113. package/dist/shared/credentials.d.ts +8 -18
  114. package/dist/shared/credentials.d.ts.map +1 -1
  115. package/dist/shared/credentials.js +8 -62
  116. package/dist/shared/credentials.js.map +1 -1
  117. package/dist/shared/server.d.ts +2 -0
  118. package/dist/shared/server.d.ts.map +1 -1
  119. package/dist/shared/server.js.map +1 -1
  120. package/dist/tui/App.d.ts.map +1 -1
  121. package/dist/tui/App.js +1 -1
  122. package/dist/tui/App.js.map +1 -1
  123. package/dist/webhooks/definitions/github.d.ts.map +1 -1
  124. package/dist/webhooks/definitions/github.js +13 -0
  125. package/dist/webhooks/definitions/github.js.map +1 -1
  126. package/dist/webhooks/providers/github.d.ts.map +1 -1
  127. package/dist/webhooks/providers/github.js +6 -0
  128. package/dist/webhooks/providers/github.js.map +1 -1
  129. package/dist/webhooks/registry.d.ts.map +1 -1
  130. package/dist/webhooks/registry.js +9 -3
  131. package/dist/webhooks/registry.js.map +1 -1
  132. package/dist/webhooks/types.d.ts +3 -1
  133. package/dist/webhooks/types.d.ts.map +1 -1
  134. package/docker/bin/_http-exit +17 -0
  135. package/docker/bin/al-call +10 -4
  136. package/docker/bin/al-check +9 -3
  137. package/docker/bin/al-status +1 -1
  138. package/docker/bin/al-wait +11 -3
  139. package/docker/bin/rlock +9 -2
  140. package/docker/bin/rlock-heartbeat +9 -2
  141. package/docker/bin/runlock +9 -2
  142. package/package.json +2 -2
  143. package/docs/agent-config-reference.md +0 -313
  144. package/docs/agents.md +0 -256
  145. package/docs/cloud-run.md +0 -173
  146. package/docs/cloud.md +0 -98
  147. package/docs/commands.md +0 -286
  148. package/docs/config-reference.md +0 -241
  149. package/docs/creating-agents.md +0 -147
  150. package/docs/credentials.md +0 -167
  151. package/docs/docker.md +0 -323
  152. package/docs/ecs.md +0 -795
  153. package/docs/examples/dev/ACTIONS.md +0 -75
  154. package/docs/examples/dev/README.md +0 -28
  155. package/docs/examples/dev/agent-config.toml +0 -18
  156. package/docs/examples/devops/ACTIONS.md +0 -33
  157. package/docs/examples/devops/README.md +0 -23
  158. package/docs/examples/devops/agent-config.toml +0 -13
  159. package/docs/examples/index.md +0 -15
  160. package/docs/examples/reviewer/ACTIONS.md +0 -37
  161. package/docs/examples/reviewer/README.md +0 -22
  162. package/docs/examples/reviewer/agent-config.toml +0 -11
  163. package/docs/models.md +0 -191
  164. package/docs/vps-deployment.md +0 -285
  165. package/docs/web-dashboard.md +0 -113
  166. package/docs/webhooks.md +0 -152
  167. /package/{docs/agent-reference → agent-docs}/skills/credentials.md +0 -0
  168. /package/{docs/agent-reference → agent-docs}/skills/environment.md +0 -0
@@ -1,285 +0,0 @@
1
- # VPS Deployment
2
-
3
- Deploy Action Llama on any VPS (DigitalOcean, Vultr, Hetzner, etc.) for cost-effective remote hosting.
4
-
5
- There are two approaches:
6
-
7
- 1. **VPS cloud provider** (`provider: "vps"`) — manage the VPS from your local machine via SSH. Images are built on the VPS, credentials pushed over SSH, scheduler deployed as a Docker container. Set up with `al setup cloud`.
8
- 2. **Manual deployment** — install Action Llama directly on the VPS and run `al start` with the `--expose` flag. Simpler, but requires SSH'ing into the server to manage.
9
-
10
- ## Approach 1: VPS Cloud Provider (Recommended)
11
-
12
- The VPS cloud provider lets you manage your VPS deployment from your local machine, just like AWS or GCP.
13
-
14
- ### Quick Start
15
-
16
- ```bash
17
- # From your local machine:
18
- al setup cloud -p . # Select "VPS (Vultr, etc.)" → connect or provision
19
- al doctor -c -p . # Push credentials to VPS via SSH
20
- al cloud deploy -p . # Deploy scheduler to VPS
21
- ```
22
-
23
- ### Setup Options
24
-
25
- The `al setup cloud` wizard offers two paths:
26
-
27
- #### Connect to an existing server
28
-
29
- Works with any VPS provider (DigitalOcean, Hetzner, Linode, etc.) or any server you can SSH into:
30
-
31
- 1. Enter the server IP, SSH user, port, and key path
32
- 2. Action Llama validates SSH connectivity and checks Docker is installed
33
- 3. Configuration is written to your environment file
34
-
35
- Requirements:
36
- - SSH access to the server
37
- - Docker installed on the server (`curl -fsSL https://get.docker.com | sh`)
38
-
39
- #### Provision a new Vultr VPS
40
-
41
- Automated provisioning with Vultr as a supported backend:
42
-
43
- 1. Configure `vultr_api_key` credential first: `al creds add vultr_api_key`
44
- 2. Run `al setup cloud` and select "Provision a new Vultr VPS"
45
- 3. Pick region, plan (minimum 2 vCPU / 2GB RAM), and SSH key
46
- 4. Instance is created with cloud-init that installs Docker automatically
47
- 5. Action Llama waits for the instance to become ready
48
-
49
- #### Provision a new Hetzner VPS
50
-
51
- Automated provisioning with Hetzner Cloud:
52
-
53
- 1. Configure `hetzner_api_key` credential first: `al creds add hetzner_api_key`
54
- 2. Run `al setup cloud` and select "Provision a new Hetzner VPS"
55
- 3. Pick server type, location, OS image, and SSH key
56
- 4. Server is created with cloud-init that installs Docker automatically
57
- 5. Action Llama waits for the server to become ready
58
-
59
- ### How It Works
60
-
61
- | Operation | Implementation |
62
- |-----------|---------------|
63
- | Image builds | `tar -c . \| ssh docker build -t <tag> -` (built on VPS, no registry) |
64
- | Credential storage | Filesystem on VPS (`~/.action-llama/credentials/`) via SSH |
65
- | Credential push | `al doctor -c` copies credentials over SSH |
66
- | Scheduler deploy | `docker run -d --restart unless-stopped` on VPS |
67
- | IAM reconciliation | No-op (SSH access = full access) |
68
- | Log streaming | Real-time via SSH (`docker logs -f`) |
69
-
70
- ### Configuration
71
-
72
- In your environment file (`~/.action-llama/environments/<name>.toml`):
73
-
74
- ```toml
75
- [cloud]
76
- provider = "vps"
77
- host = "5.6.7.8"
78
- sshUser = "root" # default: "root"
79
- sshPort = 22 # default: 22
80
- sshKeyPath = "~/.ssh/id_rsa" # default: "~/.ssh/id_rsa"
81
-
82
- # Set automatically if provisioned via Vultr:
83
- # vultrInstanceId = "abc123"
84
- # vultrRegion = "ewr"
85
- ```
86
-
87
- ### Teardown
88
-
89
- ```bash
90
- al teardown cloud -p .
91
- ```
92
-
93
- This stops all Action Llama containers and cleans up remote credentials. If the instance was provisioned via Vultr, you'll be offered the option to delete it.
94
-
95
- ## Approach 2: Manual Deployment
96
-
97
- Install Action Llama directly on your VPS and run it there. Simpler but requires managing the server directly.
98
-
99
- ### Quick Start
100
-
101
- On your VPS:
102
-
103
- ```bash
104
- # Install Action Llama
105
- npm install -g @action-llama/action-llama
106
-
107
- # Set up your project (or clone from git)
108
- al new my-project
109
- cd my-project
110
-
111
- # Configure credentials and check setup
112
- al doctor
113
-
114
- # Start with public gateway binding
115
- al start -w --expose --headless
116
- ```
117
-
118
- ### Key Features
119
-
120
- The `--expose` flag enables VPS deployment by:
121
-
122
- - **Binding gateway to `0.0.0.0`** — makes webhooks accessible from external services
123
- - **Preserving local-mode features** — web UI, control routes, filesystem credentials, SQLite state
124
- - **No cloud infrastructure required** — works on any Linux VPS
125
-
126
- ## TLS Setup with Caddy
127
-
128
- For production, put a reverse proxy in front with TLS termination:
129
-
130
- ### 1. Install Caddy
131
-
132
- ```bash
133
- # Ubuntu/Debian
134
- sudo apt install -y debian-keyring debian-archive-keyring apt-transport-https
135
- curl -1sLf 'https://dl.cloudsmith.io/public/caddy/stable/gpg.key' | sudo gpg --dearmor -o /usr/share/keyrings/caddy-stable-archive-keyring.gpg
136
- curl -1sLf 'https://dl.cloudsmith.io/public/caddy/stable/debian.deb.txt' | sudo tee /etc/apt/sources.list.d/caddy-stable.list
137
- sudo apt update && sudo apt install caddy
138
- ```
139
-
140
- ### 2. Configure Caddy
141
-
142
- Edit `/etc/caddy/Caddyfile`:
143
-
144
- ```
145
- your-domain.com {
146
- reverse_proxy localhost:8080
147
- }
148
- ```
149
-
150
- ### 3. Start Caddy
151
-
152
- ```bash
153
- sudo systemctl enable caddy
154
- sudo systemctl start caddy
155
- ```
156
-
157
- ## Process Management with systemd
158
-
159
- For the manual deployment approach, create `/etc/systemd/system/action-llama.service`:
160
-
161
- ```ini
162
- [Unit]
163
- Description=Action Llama Scheduler
164
- After=network.target
165
-
166
- [Service]
167
- Type=simple
168
- User=action-llama
169
- WorkingDirectory=/home/action-llama/my-project
170
- Environment=NODE_ENV=production
171
- ExecStart=/usr/local/bin/al start -w --expose --headless
172
- Restart=always
173
- RestartSec=10
174
-
175
- [Install]
176
- WantedBy=multi-user.target
177
- ```
178
-
179
- Start the service:
180
-
181
- ```bash
182
- sudo systemctl enable action-llama
183
- sudo systemctl start action-llama
184
- ```
185
-
186
- ## Alternative: nohup
187
-
188
- For simpler setups, use `nohup`:
189
-
190
- ```bash
191
- nohup al start -w --expose --headless > action-llama.log 2>&1 &
192
- ```
193
-
194
- ## Firewall Configuration
195
-
196
- Ensure your VPS firewall allows:
197
-
198
- - Port 22 (SSH)
199
- - Port 80 (HTTP, for Caddy)
200
- - Port 443 (HTTPS, for Caddy)
201
- - Port 8080 only if not using a reverse proxy
202
-
203
- Example with `ufw`:
204
-
205
- ```bash
206
- sudo ufw allow ssh
207
- sudo ufw allow http
208
- sudo ufw allow https
209
- sudo ufw enable
210
- ```
211
-
212
- ## Security Considerations
213
-
214
- - **Use TLS in production** — Don't expose port 8080 directly without HTTPS
215
- - **Gateway API key** — Action Llama generates an API key for dashboard access (run `al doctor` to view it)
216
- - **Credentials isolation** — Each agent runs in a Docker container with only its required credentials
217
- - **User separation** — Run Action Llama as a non-root user
218
- - **SSH key security** — The VPS cloud provider uses your SSH key for all operations. Protect it with a passphrase and restrict access.
219
-
220
- ## Monitoring
221
-
222
- Check service status:
223
-
224
- ```bash
225
- # systemd (manual deployment)
226
- sudo systemctl status action-llama
227
-
228
- # Cloud provider deployment
229
- al stat -c
230
-
231
- # Logs
232
- al logs scheduler
233
- al logs dev -c # Cloud provider: view agent logs via SSH
234
- journalctl -u action-llama -f
235
- ```
236
-
237
- ## Cost Comparison
238
-
239
- | Provider | vCPU | RAM | Storage | Price/month |
240
- |----------|------|-----|---------|-------------|
241
- | DigitalOcean | 1 | 1GB | 25GB SSD | $6 |
242
- | Vultr | 1 | 1GB | 25GB SSD | $6 |
243
- | Hetzner | 1 | 2GB | 20GB SSD | €4.15 |
244
- | Linode | 1 | 1GB | 25GB SSD | $5 |
245
-
246
- Compare to managed cloud solutions that may cost $50+ per month for similar agent workloads.
247
-
248
- ## Troubleshooting
249
-
250
- ### Gateway not accessible externally
251
-
252
- - Check firewall settings
253
- - Verify `--expose` flag is used (manual deployment)
254
-
255
- ### Docker issues
256
-
257
- ```bash
258
- # Check Docker daemon
259
- sudo systemctl status docker
260
-
261
- # Test Docker access
262
- docker ps
263
- ```
264
-
265
- ### SSH connection issues (cloud provider)
266
-
267
- ```bash
268
- # Test SSH manually
269
- ssh -o ConnectTimeout=10 root@your-vps-ip echo ok
270
-
271
- # Check SSH key permissions
272
- chmod 600 ~/.ssh/id_rsa
273
- ```
274
-
275
- ### Webhook delivery failures
276
-
277
- - Check reverse proxy configuration
278
- - Verify TLS certificate is valid
279
- - Test webhook URL accessibility from external services
280
-
281
- ### Out of disk space
282
-
283
- - Clean up old Docker images: `docker system prune -a`
284
- - Rotate logs: configure systemd journal limits
285
- - Monitor disk usage: `df -h`
@@ -1,113 +0,0 @@
1
- # Web Dashboard
2
-
3
- Action Llama includes an optional web-based dashboard for monitoring agents in your browser. It provides a live view of agent statuses and streaming logs — similar to the terminal TUI, but accessible from any browser.
4
-
5
- ## Enabling the Dashboard
6
-
7
- Pass `-w` or `--web-ui` to `al start`:
8
-
9
- ```bash
10
- al start -w
11
- al start -w -p ./my-project
12
- ```
13
-
14
- The dashboard URL is shown in the TUI header and in headless log output once the scheduler starts:
15
-
16
- ```
17
- Dashboard: http://localhost:8080/dashboard
18
- ```
19
-
20
- The port is controlled by the `[gateway].port` setting in `config.toml` (default: `8080`).
21
-
22
- ## Authentication
23
-
24
- The dashboard is protected by a gateway API key. The same key is used for both browser sessions and CLI access.
25
-
26
- **Key location:** `~/.action-llama/credentials/gateway_api_key/default/key`
27
-
28
- The key is generated automatically by `al doctor` or on first `al start`. To view or regenerate it, run `al doctor`.
29
-
30
- ### Browser login
31
-
32
- Navigate to `http://localhost:8080/dashboard`. You'll be redirected to a login page where you paste your API key. On success, an `al_session` cookie is set (HttpOnly, SameSite=Strict) so all subsequent requests — including SSE streams — are authenticated automatically.
33
-
34
- A **Logout** link is available in the dashboard header.
35
-
36
- ### CLI access
37
-
38
- CLI commands (`al stat`, `al pause`, `al resume`, `al kill`) automatically read the API key from the credential store and send it as a `Bearer` token in the `Authorization` header.
39
-
40
- ### What's protected
41
-
42
- The following routes require authentication:
43
-
44
- - `/dashboard` and `/dashboard/*` — all dashboard pages and SSE streams
45
- - `/control/*` — scheduler and agent control endpoints (pause, resume, kill, trigger, enable/disable)
46
- - `/locks/status` — active lock information
47
-
48
- Health checks (`/health`), webhook endpoints (`/webhooks/*`), and container management routes are **not** protected.
49
-
50
- ### Migrating from `AL_DASHBOARD_SECRET`
51
-
52
- The old `AL_DASHBOARD_SECRET` environment variable (HTTP Basic Auth) is no longer used. If it's still set, a deprecation warning is logged. Remove it from your environment and run `al doctor` to set up the new API key.
53
-
54
- ## Dashboard Pages
55
-
56
- ### Main Page — `/dashboard`
57
-
58
- Displays a live overview of all agents:
59
-
60
- | Column | Description |
61
- |--------|-------------|
62
- | Agent | Agent name (click to view logs) |
63
- | State | Current state: idle, running, building, or error |
64
- | Status | Latest status text or error message |
65
- | Last Run | Timestamp of the most recent run |
66
- | Duration | How long the last run took |
67
- | Next Run | When the next scheduled run will happen |
68
- | Actions | **Run** (trigger an immediate run) and **Enable/Disable** (toggle the agent) |
69
-
70
- The header also includes:
71
-
72
- - **Pause/Resume** button — pauses or resumes the scheduler (all cron jobs)
73
- - **Logout** link — clears the session cookie and redirects to the login page
74
-
75
- Below the table, a **Recent Activity** section shows the last 20 log lines across all agents.
76
-
77
- All data updates in real time via Server-Sent Events (SSE) — no manual refresh needed.
78
-
79
- ### Agent Logs — `/dashboard/agents/<name>/logs`
80
-
81
- Displays a live-streaming log view for a single agent. Logs follow automatically by default (new entries scroll into view as they arrive).
82
-
83
- Features:
84
- - **Follow mode** — enabled by default, auto-scrolls to the latest log entry. Scrolling up pauses follow; scrolling back to the bottom re-enables it.
85
- - **Clear** — clears the log display (does not delete log files).
86
- - **Connection status** — shows whether the SSE connection is active.
87
- - **Log levels** — color-coded: green for INFO, yellow for WARN, red for ERROR.
88
-
89
- On initial load, the last 100 log entries from the agent's log file are displayed, then new entries stream in as they are written.
90
-
91
- ## How It Works
92
-
93
- The dashboard is served by the same gateway that handles webhooks and container communication. When `--web-ui` is enabled, the gateway starts even if Docker and webhooks are not configured.
94
-
95
- Live updates use **Server-Sent Events (SSE)** on two endpoints:
96
-
97
- - `GET /dashboard/api/status-stream` — pushes agent status and scheduler info whenever state changes
98
- - `GET /dashboard/api/logs/<agent>/stream` — streams log lines for a specific agent by tailing its log file (500ms poll interval)
99
-
100
- Dashboard actions (Run, Enable/Disable, Pause/Resume) call the control API endpoints:
101
-
102
- - `POST /control/trigger/<name>` — trigger an immediate agent run
103
- - `POST /control/agents/<name>/enable` — enable a disabled agent
104
- - `POST /control/agents/<name>/disable` — disable an agent (pauses its cron job)
105
- - `POST /control/agents/<name>/pause` — pause an agent (alias for disable)
106
- - `POST /control/agents/<name>/resume` — resume an agent (alias for enable)
107
- - `POST /control/agents/<name>/kill` — kill all running instances of an agent
108
- - `POST /control/pause` — pause the scheduler
109
- - `POST /control/resume` — resume the scheduler
110
-
111
- All control requests use `credentials: 'same-origin'` to carry the session cookie.
112
-
113
- No additional dependencies or frontend build steps are required. The dashboard is rendered as plain HTML with inline CSS and JavaScript.
package/docs/webhooks.md DELETED
@@ -1,152 +0,0 @@
1
- # Webhooks
2
-
3
- Action Llama agents can be triggered by webhooks in addition to (or instead of) cron schedules.
4
-
5
- ## Defining Webhook Sources
6
-
7
- Webhook sources are defined once in the project's `config.toml`. Each source has a name, a provider type, and an optional credential for signature validation:
8
-
9
- ```toml
10
- [webhooks.my-github]
11
- type = "github"
12
- credential = "MyOrg" # credential instance name (github_webhook_secret:MyOrg)
13
-
14
- [webhooks.my-sentry]
15
- type = "sentry"
16
- credential = "SentryProd" # credential instance name (sentry_client_secret:SentryProd)
17
-
18
- [webhooks.my-linear]
19
- type = "linear"
20
- credential = "LinearMain" # credential instance name (linear_webhook_secret:LinearMain)
21
- ```
22
-
23
- | Field | Type | Required | Description |
24
- |-------|------|----------|-------------|
25
- | `type` | string | Yes | Provider type: `"github"`, `"sentry"`, or `"linear"` |
26
- | `credential` | string | No | Credential instance name for HMAC signature validation. Omit for unsigned webhooks. |
27
-
28
- ## Agent Webhook Triggers
29
-
30
- Agents reference a webhook source by name and add filters in their `agent-config.toml`:
31
-
32
- ```toml
33
- [[webhooks]]
34
- source = "my-github"
35
- repos = ["acme/app"]
36
- events = ["issues"]
37
- actions = ["labeled"]
38
- labels = ["agent"]
39
-
40
- # Filter by organization
41
- [[webhooks]]
42
- source = "my-github"
43
- orgs = ["acme", "example-org"]
44
- events = ["issues"]
45
-
46
- # Or using the singular form
47
- [[webhooks]]
48
- source = "my-github"
49
- org = "acme"
50
- events = ["pull_request"]
51
- ```
52
-
53
- Each `[[webhooks]]` entry is a trigger. The `source` field (referencing a name from `config.toml`) is required. All filter fields (`repos`, `events`, `actions`, `labels`, etc.) are optional — omit all of them to trigger on everything from that source.
54
-
55
- An agent must have at least one of `schedule` or `webhooks` (or both).
56
-
57
- ## GitHub Webhooks
58
-
59
- ### Filter Fields (all optional)
60
-
61
- | Field | Type | Description |
62
- |-------|------|-------------|
63
- | `repos` | string[] | Only trigger for these repos |
64
- | `orgs` | string[] | Only trigger for these organizations |
65
- | `org` | string | Only trigger for this organization (singular form) |
66
- | `events` | string[] | GitHub event types (issues, pull_request, push, etc.) |
67
- | `actions` | string[] | Event actions (opened, labeled, closed, etc.) |
68
- | `labels` | string[] | Only when issue/PR has these labels |
69
- | `assignee` | string | Only when assigned to this user |
70
- | `author` | string | Only for this author |
71
- | `branches` | string[] | Only for these branches |
72
-
73
- ### Setup
74
-
75
- 1. In your GitHub repo, go to **Settings > Webhooks > Add webhook**
76
- 2. Set the payload URL to your Action Llama gateway (e.g. `https://your-server:8080/webhooks/github`)
77
- 3. Set content type to `application/json`
78
- 4. Set the secret to match the `github_webhook_secret` credential instance referenced by the webhook source in `config.toml`
79
- 5. Select the events you want to receive
80
-
81
- ### Using ngrok for Local Development
82
-
83
- ```bash
84
- ngrok http 8080
85
- ```
86
-
87
- Use the ngrok URL as your webhook payload URL in GitHub.
88
-
89
- ## Sentry Webhooks
90
-
91
- ### Filter Fields
92
-
93
- | Field | Type | Description |
94
- |-------|------|-------------|
95
- | `resources` | string[] | Resource types: event_alert, metric_alert, issue, error, comment |
96
-
97
- ### Setup
98
-
99
- 1. In Sentry, go to **Settings > Developer Settings > New Internal Integration**
100
- 2. Set the webhook URL to your gateway (e.g. `https://your-server:8080/webhooks/sentry`)
101
- 3. Copy the client secret to `~/.action-llama/credentials/sentry_client_secret/<instance>/secret`
102
- 4. Select the resource types you want to receive
103
-
104
- ## How Webhooks Work at Runtime
105
-
106
- 1. The gateway receives a webhook POST request at `/webhooks/<type>` (e.g. `/webhooks/github`)
107
- 2. It verifies the payload signature using secrets loaded from the credential instances defined in `config.toml` webhook sources
108
- 3. It parses the event into a `WebhookContext` (source, event, action, repo, etc.)
109
- 4. It matches the context against each agent's webhook triggers
110
- 5. Matching agents are triggered with the webhook context injected into their prompt
111
-
112
- ## Linear Webhooks
113
-
114
- ### Filter Fields (all optional)
115
-
116
- | Field | Type | Description |
117
- |-------|------|-------------|
118
- | `organizations` | string[] | Only trigger for these Linear organizations |
119
- | `events` | string[] | Linear event types (issues, issue_comment, etc.) |
120
- | `actions` | string[] | Event actions (create, update, delete, etc.) |
121
- | `labels` | string[] | Only when issue has these labels |
122
- | `assignee` | string | Only when assigned to this user (email) |
123
- | `author` | string | Only for this author (email) |
124
-
125
- ### Setup
126
-
127
- 1. In Linear, go to **Settings > Workspace > Webhooks**
128
- 2. Click **Create webhook**
129
- 3. Set the URL to your Action Llama gateway (e.g. `https://your-server:8080/webhooks/linear`)
130
- 4. Set the secret to match the `linear_webhook_secret` credential instance referenced by the webhook source in `config.toml`
131
- 5. Select the resource types you want to receive (Issues, Comments, etc.)
132
-
133
- ### Example Configuration
134
-
135
- ```toml
136
- # In config.toml
137
- [webhooks.linear-main]
138
- type = "linear"
139
- credential = "main-workspace"
140
-
141
- # In agent-config.toml
142
- [[webhooks]]
143
- source = "linear-main"
144
- events = ["issues", "issue_comment"]
145
- actions = ["create", "update"]
146
- organizations = ["your-org-id"]
147
- labels = ["bug", "ready-for-dev"]
148
- ```
149
-
150
- ## Hybrid Agents
151
-
152
- Agents can have both `schedule` and `webhooks`. Scheduled runs poll for work; webhook runs respond to events immediately.