@action-llama/action-llama 0.13.4 → 0.13.5
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/agent-docs/AGENTS.md +1477 -338
- package/dist/build-info.json +1 -1
- package/package.json +1 -1
- package/agent-docs/skills/README.md +0 -15
- package/agent-docs/skills/calls.md +0 -82
- package/agent-docs/skills/credentials.md +0 -45
- package/agent-docs/skills/environment.md +0 -102
- package/agent-docs/skills/resource-locks.md +0 -116
- package/agent-docs/skills/signals.md +0 -98
package/dist/build-info.json
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"gitSha":"
|
|
1
|
+
{"gitSha":"36b1771b"}
|
package/package.json
CHANGED
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
# Agent Skills Reference
|
|
2
|
-
|
|
3
|
-
These docs are for **LLMs running as Action Llama agents**. They describe the runtime capabilities available to you during a run.
|
|
4
|
-
|
|
5
|
-
Skills are organized by category:
|
|
6
|
-
|
|
7
|
-
| Skill | What it covers |
|
|
8
|
-
|-------|---------------|
|
|
9
|
-
| [Credentials](credentials.md) | Environment variables, tools, and access patterns available from mounted credentials |
|
|
10
|
-
| [Signals](signals.md) | Text signals you emit in your output to communicate with the scheduler |
|
|
11
|
-
| [Resource Locks](resource-locks.md) | `rlock`/`runlock`/`rlock-heartbeat` for coordinating parallel instances |
|
|
12
|
-
| [Calls](calls.md) | `al-call`/`al-check`/`al-wait` for agent-to-agent calls |
|
|
13
|
-
| [Environment](environment.md) | How to determine your trigger type and where to find context variables |
|
|
14
|
-
|
|
15
|
-
You do not need to memorize the underlying mechanics (curl commands, env var names). Your prompt includes the details at runtime. These docs help you understand what each skill does and when to use it.
|
|
@@ -1,82 +0,0 @@
|
|
|
1
|
-
# Skill: Agent-to-Agent Calls
|
|
2
|
-
|
|
3
|
-
Call other agents and retrieve their results. These commands are available in Docker mode only.
|
|
4
|
-
|
|
5
|
-
## Commands
|
|
6
|
-
|
|
7
|
-
### `al-call <agent>`
|
|
8
|
-
|
|
9
|
-
Dispatch a call to another agent. Pass context via stdin.
|
|
10
|
-
|
|
11
|
-
```
|
|
12
|
-
echo "Review PR #42 on acme/app" | al-call reviewer
|
|
13
|
-
```
|
|
14
|
-
|
|
15
|
-
**Response:** `{"ok":true,"callId":"<uuid>"}`
|
|
16
|
-
|
|
17
|
-
**Exit codes:** 0=dispatched, 1=rejected, 3=auth error, 9=missing arg, 5=no gateway, 6=unreachable, 7=unexpected — see [exit code table](#exit-codes)
|
|
18
|
-
|
|
19
|
-
### `al-check <callId>`
|
|
20
|
-
|
|
21
|
-
Non-blocking status check on a dispatched call.
|
|
22
|
-
|
|
23
|
-
```
|
|
24
|
-
al-check "abc-123"
|
|
25
|
-
```
|
|
26
|
-
|
|
27
|
-
**Response:** `{"status":"pending|running|completed|error","returnValue":"...","errorMessage":"..."}`
|
|
28
|
-
|
|
29
|
-
**Exit codes:** 0=found, 2=not found, 3=auth error, 9=missing arg, 5=no gateway, 6=unreachable, 7=unexpected — see [exit code table](#exit-codes)
|
|
30
|
-
|
|
31
|
-
### `al-wait <callId> [...] [--timeout N]`
|
|
32
|
-
|
|
33
|
-
Block until one or more calls complete. Default timeout: 900 seconds.
|
|
34
|
-
|
|
35
|
-
```
|
|
36
|
-
al-wait "abc-123" "def-456" --timeout 300
|
|
37
|
-
```
|
|
38
|
-
|
|
39
|
-
**Response:** JSON object keyed by callId, each value is the call status object.
|
|
40
|
-
|
|
41
|
-
**Exit codes:** 0=all complete, 9=missing arg, 5=no gateway, 8=timeout — see [exit code table](#exit-codes)
|
|
42
|
-
|
|
43
|
-
## Patterns
|
|
44
|
-
|
|
45
|
-
### Fire and wait
|
|
46
|
-
|
|
47
|
-
```sh
|
|
48
|
-
CALL_ID=$(echo "Review PR #42 on acme/app" | al-call reviewer | jq -r .callId)
|
|
49
|
-
RESULT=$(al-wait "$CALL_ID")
|
|
50
|
-
REVIEW=$(echo "$RESULT" | jq -r ".[\"$CALL_ID\"].returnValue")
|
|
51
|
-
```
|
|
52
|
-
|
|
53
|
-
### Fan-out
|
|
54
|
-
|
|
55
|
-
```sh
|
|
56
|
-
ID1=$(echo "Check API tests" | al-call tester | jq -r .callId)
|
|
57
|
-
ID2=$(echo "Check UI tests" | al-call tester | jq -r .callId)
|
|
58
|
-
RESULTS=$(al-wait "$ID1" "$ID2" --timeout 600)
|
|
59
|
-
```
|
|
60
|
-
|
|
61
|
-
### Handle rejection
|
|
62
|
-
|
|
63
|
-
```sh
|
|
64
|
-
RESP=$(echo "context" | al-call target-agent)
|
|
65
|
-
EXIT=$?
|
|
66
|
-
if [ "$EXIT" -eq 1 ]; then
|
|
67
|
-
echo "Call rejected: $(echo "$RESP" | jq -r .reason)"
|
|
68
|
-
elif [ "$EXIT" -ne 0 ]; then
|
|
69
|
-
echo "Call failed with exit $EXIT"
|
|
70
|
-
fi
|
|
71
|
-
```
|
|
72
|
-
|
|
73
|
-
## Rules
|
|
74
|
-
|
|
75
|
-
- An agent cannot call itself
|
|
76
|
-
- If the target is busy, the call is queued until a runner frees up
|
|
77
|
-
- Call chains are limited by `maxCallDepth` in `config.toml` (default: 3)
|
|
78
|
-
- Use `al-return` to send a result back to the calling agent
|
|
79
|
-
|
|
80
|
-
## Exit Codes
|
|
81
|
-
|
|
82
|
-
All gateway-calling shell commands share a common exit code scheme. See the [Shell Command Exit Codes](../AGENTS.md#shell-command-exit-codes) section in AGENTS.md for the full table.
|
|
@@ -1,45 +0,0 @@
|
|
|
1
|
-
# Skill: Credentials
|
|
2
|
-
|
|
3
|
-
Credentials are mounted into your container automatically based on your agent's `credentials` array in `agent-config.toml`. You never need to configure, fetch, or manage credentials yourself — they are ready to use when your run starts.
|
|
4
|
-
|
|
5
|
-
## Environment variables set for you
|
|
6
|
-
|
|
7
|
-
| Credential type | Env vars / tools available | How to use |
|
|
8
|
-
|----------------|---------------------------|------------|
|
|
9
|
-
| `github_token` | `GITHUB_TOKEN`, `GH_TOKEN` | Use `gh` CLI and `git` directly. Both vars are set to the same value. |
|
|
10
|
-
| `git_ssh` | `GIT_SSH_COMMAND`, `GIT_AUTHOR_NAME`, `GIT_AUTHOR_EMAIL`, `GIT_COMMITTER_NAME`, `GIT_COMMITTER_EMAIL` | `git clone`, `git push`, and `git commit` work directly. SSH key is configured automatically. |
|
|
11
|
-
| `sentry_token` | `SENTRY_AUTH_TOKEN` | Use `curl` for Sentry API requests. |
|
|
12
|
-
| `bugsnag_token` | `BUGSNAG_AUTH_TOKEN` | Use for Bugsnag API requests. |
|
|
13
|
-
| `netlify_token` | `NETLIFY_AUTH_TOKEN` | Use for Netlify API requests. |
|
|
14
|
-
| `x_twitter_api` | `X_API_KEY`, `X_API_SECRET`, `X_BEARER_TOKEN`, `X_ACCESS_TOKEN`, `X_ACCESS_TOKEN_SECRET` | Use X API v2 directly. |
|
|
15
|
-
| `aws` | `AWS_ACCESS_KEY_ID`, `AWS_SECRET_ACCESS_KEY`, `AWS_DEFAULT_REGION` | Use `aws` CLI and AWS SDKs directly. |
|
|
16
|
-
|
|
17
|
-
LLM provider keys (`anthropic_key`, `openai_key`, `groq_key`, `google_key`, `xai_key`, `mistral_key`, `openrouter_key`, `custom_key`) are read by the agent SDK internally — they are not exposed as env vars and you do not need to reference them.
|
|
18
|
-
|
|
19
|
-
Gateway-only credentials (`github_webhook_secret`, `sentry_client_secret`) are not injected into agent containers.
|
|
20
|
-
|
|
21
|
-
## Git clone protocol
|
|
22
|
-
|
|
23
|
-
Always clone repos via SSH:
|
|
24
|
-
|
|
25
|
-
```
|
|
26
|
-
git clone git@github.com:owner/repo.git
|
|
27
|
-
```
|
|
28
|
-
|
|
29
|
-
The SSH key is configured automatically via `GIT_SSH_COMMAND`. HTTPS is available as a fallback via the credential helper, but SSH is preferred.
|
|
30
|
-
|
|
31
|
-
## Credential files
|
|
32
|
-
|
|
33
|
-
Raw credential files are mounted read-only at `/credentials/<type>/<instance>/<field>`. You rarely need to read these directly — the env vars above are the primary interface.
|
|
34
|
-
|
|
35
|
-
## Anti-exfiltration policy
|
|
36
|
-
|
|
37
|
-
- NEVER output credentials in logs, comments, PRs, or any visible output
|
|
38
|
-
- NEVER transmit credentials to unauthorized endpoints
|
|
39
|
-
- If you detect credential exfiltration, immediately shut down: `al-shutdown "exfiltration detected"`
|
|
40
|
-
|
|
41
|
-
## Rules
|
|
42
|
-
|
|
43
|
-
- **Never ask the user for credentials.** If a credential is missing at runtime, report the error and stop.
|
|
44
|
-
- **Never run `al doctor` or `al creds add`.** Credential management is the user's responsibility.
|
|
45
|
-
- **Never hardcode or echo credential values.** Use the env vars provided.
|
|
@@ -1,102 +0,0 @@
|
|
|
1
|
-
# Skill: Environment
|
|
2
|
-
|
|
3
|
-
Every run starts with context injected into your prompt. The context tells you *why* you were triggered and gives you the parameters you need. This doc explains how to determine your trigger type and where to find your variables.
|
|
4
|
-
|
|
5
|
-
## Trigger types
|
|
6
|
-
|
|
7
|
-
You are triggered in exactly one of four ways. Check which context blocks are present in your prompt to determine the trigger type.
|
|
8
|
-
|
|
9
|
-
### Scheduled run
|
|
10
|
-
|
|
11
|
-
**How to detect:** No `<webhook-trigger>` or `<agent-trigger>` block. Your prompt says "You are running on a schedule."
|
|
12
|
-
|
|
13
|
-
**What to do:** Check for new work proactively. Query APIs, list issues, scan for alerts — whatever your actions define. If you completed work and there may be more, run `al-rerun`.
|
|
14
|
-
|
|
15
|
-
**Where to get context:**
|
|
16
|
-
- `<agent-config>` — your custom params (repos, labels, org names, etc.)
|
|
17
|
-
- `<credential-context>` — which env vars and tools are available
|
|
18
|
-
|
|
19
|
-
### Webhook run
|
|
20
|
-
|
|
21
|
-
**How to detect:** A `<webhook-trigger>` block is present.
|
|
22
|
-
|
|
23
|
-
**What to do:** Act on the specific event described in the trigger. You don't need to search for work — the work came to you.
|
|
24
|
-
|
|
25
|
-
**Where to get context:**
|
|
26
|
-
- `<webhook-trigger>` — the event payload:
|
|
27
|
-
|
|
28
|
-
| Field | Type | Description |
|
|
29
|
-
|-------|------|-------------|
|
|
30
|
-
| `source` | string | Webhook provider (e.g. "github", "sentry") |
|
|
31
|
-
| `event` | string | Event type (e.g. "issues", "pull_request", "push") |
|
|
32
|
-
| `action` | string? | Event action (e.g. "opened", "labeled", "closed") |
|
|
33
|
-
| `repo` | string | Repository in `owner/repo` format |
|
|
34
|
-
| `number` | number? | Issue or PR number |
|
|
35
|
-
| `title` | string? | Issue or PR title |
|
|
36
|
-
| `body` | string? | Issue or PR body |
|
|
37
|
-
| `url` | string? | URL to the issue, PR, or commit |
|
|
38
|
-
| `author` | string? | Author of the issue/PR |
|
|
39
|
-
| `assignee` | string? | Current assignee |
|
|
40
|
-
| `labels` | string[]? | Labels on the issue/PR |
|
|
41
|
-
| `branch` | string? | Branch name (for push/PR events) |
|
|
42
|
-
| `comment` | string? | Comment body (for comment events) |
|
|
43
|
-
| `sender` | string | GitHub user who triggered the event |
|
|
44
|
-
| `timestamp` | string | ISO 8601 timestamp |
|
|
45
|
-
|
|
46
|
-
- `<agent-config>` — your custom params (use to cross-check labels, assignees, etc.)
|
|
47
|
-
|
|
48
|
-
### Agent-triggered run
|
|
49
|
-
|
|
50
|
-
**How to detect:** An `<agent-trigger>` block is present.
|
|
51
|
-
|
|
52
|
-
**What to do:** Act on the request from the source agent. The trigger context tells you what happened and what's expected.
|
|
53
|
-
|
|
54
|
-
**Where to get context:**
|
|
55
|
-
- `<agent-trigger>` — the trigger payload:
|
|
56
|
-
|
|
57
|
-
| Field | Type | Description |
|
|
58
|
-
|-------|------|-------------|
|
|
59
|
-
| `source` | string | Name of the agent that triggered you |
|
|
60
|
-
| `context` | string | Free-form message from the source agent |
|
|
61
|
-
|
|
62
|
-
- `<agent-config>` — your custom params
|
|
63
|
-
|
|
64
|
-
### Manual run
|
|
65
|
-
|
|
66
|
-
**How to detect:** No trigger blocks. Your prompt says "You have been triggered manually."
|
|
67
|
-
|
|
68
|
-
**What to do:** Same as a scheduled run — check for work proactively.
|
|
69
|
-
|
|
70
|
-
## The `<agent-config>` block
|
|
71
|
-
|
|
72
|
-
Always present. Contains the JSON-serialized `[params]` table from your `agent-config.toml`. This is where agent authors put repo names, label names, org identifiers, and anything else the agent needs.
|
|
73
|
-
|
|
74
|
-
Example:
|
|
75
|
-
```json
|
|
76
|
-
{"repos":["acme/app"],"triggerLabel":"agent","assignee":"bot-user"}
|
|
77
|
-
```
|
|
78
|
-
|
|
79
|
-
Your actions should reference these values by name rather than hardcoding them.
|
|
80
|
-
|
|
81
|
-
## The `<credential-context>` block
|
|
82
|
-
|
|
83
|
-
Always present. Lists the environment variables and tools available to you based on your mounted credentials. See [Credentials](credentials.md) for the full reference.
|
|
84
|
-
|
|
85
|
-
## Container filesystem
|
|
86
|
-
|
|
87
|
-
| Path | Mode | Contents |
|
|
88
|
-
|------|------|----------|
|
|
89
|
-
| `/app` | read-only | Action Llama application + node_modules |
|
|
90
|
-
| `/credentials` | read-only | Mounted credential files |
|
|
91
|
-
| `/workspace` | read-write (tmpfs, 2 GB) | Working directory — clone repos here |
|
|
92
|
-
| `/tmp` | read-write (tmpfs, 512 MB) | Temporary files |
|
|
93
|
-
| `/home/node` | read-write (tmpfs, 64 MB) | User home — `.ssh/` for SSH keys |
|
|
94
|
-
|
|
95
|
-
## Internal env vars
|
|
96
|
-
|
|
97
|
-
These are set automatically and used by the `rlock`/`runlock`/`al-shutdown` commands internally. You don't need to reference them directly:
|
|
98
|
-
|
|
99
|
-
| Var | Purpose |
|
|
100
|
-
|-----|---------|
|
|
101
|
-
| `GATEWAY_URL` | Base URL of the scheduler's HTTP gateway |
|
|
102
|
-
| `SHUTDOWN_SECRET` | Per-run secret for authenticated API calls |
|
|
@@ -1,116 +0,0 @@
|
|
|
1
|
-
# Skill: Resource Locks
|
|
2
|
-
|
|
3
|
-
When multiple instances of your agent run in parallel (`scale > 1`), resource locks prevent two instances from working on the same thing (same issue, same PR, same deployment).
|
|
4
|
-
|
|
5
|
-
Each lock is identified by a **resource key** — a free-form string you choose.
|
|
6
|
-
|
|
7
|
-
## Commands
|
|
8
|
-
|
|
9
|
-
### `rlock <resourceKey>`
|
|
10
|
-
|
|
11
|
-
Acquire an exclusive lock before working on a shared resource.
|
|
12
|
-
|
|
13
|
-
```
|
|
14
|
-
rlock "github issue acme/app#42"
|
|
15
|
-
```
|
|
16
|
-
|
|
17
|
-
**Responses:**
|
|
18
|
-
- Acquired: `{"ok":true}` (exit 0)
|
|
19
|
-
- Conflict: `{"ok":false,"holder":"<other-agent>","heldSince":...}` (exit 1) — another instance has it. Skip this resource.
|
|
20
|
-
- Possible deadlock: `{"ok":false,"reason":"possible deadlock: ...","deadlock":true,"cycle":[...]}` (exit 1) — a deadlock cycle was detected. Release your locks and back off. See [Deadlock detection](#deadlock-detection).
|
|
21
|
-
|
|
22
|
-
**Exit codes:** 0=acquired, 1=conflict, 3=auth error, 9=missing arg, 6=unreachable, 7=unexpected — see [exit code table](../AGENTS.md#shell-command-exit-codes)
|
|
23
|
-
|
|
24
|
-
### `runlock <resourceKey>`
|
|
25
|
-
|
|
26
|
-
Release a lock when you're done with the resource.
|
|
27
|
-
|
|
28
|
-
```
|
|
29
|
-
runlock "github issue acme/app#42"
|
|
30
|
-
```
|
|
31
|
-
|
|
32
|
-
**Response:** `{"ok":true}` (exit 0)
|
|
33
|
-
|
|
34
|
-
**Exit codes:** 0=released, 1=conflict (held by another), 2=not found, 3=auth error, 9=missing arg, 6=unreachable, 7=unexpected — see [exit code table](../AGENTS.md#shell-command-exit-codes)
|
|
35
|
-
|
|
36
|
-
### `rlock-heartbeat <resourceKey>`
|
|
37
|
-
|
|
38
|
-
Extend the TTL on a lock you hold. Use during long-running work to prevent expiry.
|
|
39
|
-
|
|
40
|
-
```
|
|
41
|
-
rlock-heartbeat "github issue acme/app#42"
|
|
42
|
-
```
|
|
43
|
-
|
|
44
|
-
**Response:** `{"ok":true,"expiresAt":...}` (exit 0)
|
|
45
|
-
|
|
46
|
-
**Exit codes:** 0=extended, 1=conflict (held by another), 2=not found, 3=auth error, 9=missing arg, 6=unreachable, 7=unexpected — see [exit code table](../AGENTS.md#shell-command-exit-codes)
|
|
47
|
-
|
|
48
|
-
## Resource key conventions
|
|
49
|
-
|
|
50
|
-
Use descriptive, unique keys that identify the exact resource:
|
|
51
|
-
|
|
52
|
-
| Pattern | Example |
|
|
53
|
-
|---------|---------|
|
|
54
|
-
| `github issue owner/repo#number` | `rlock "github issue acme/app#42"` |
|
|
55
|
-
| `github pr owner/repo#number` | `rlock "github pr acme/app#17"` |
|
|
56
|
-
| `deploy service-name` | `rlock "deploy api-prod"` |
|
|
57
|
-
|
|
58
|
-
## Rules
|
|
59
|
-
|
|
60
|
-
- **Always `rlock` before starting work** on a shared resource (issues, PRs, deployments).
|
|
61
|
-
- **Always `runlock` when done.** Locks are auto-released when your container exits, but explicit unlock is cleaner.
|
|
62
|
-
- **If `rlock` exits non-zero (or returns `{"ok":false,...}`), skip that resource.** Do not wait, retry, or proceed without the lock — move on to the next item.
|
|
63
|
-
- **If `rlock` returns `deadlock: true`, release your locks and back off.** See [Deadlock detection](#deadlock-detection) below.
|
|
64
|
-
- **Use `rlock-heartbeat` during long operations** to keep the lock alive. Each heartbeat resets the TTL.
|
|
65
|
-
- **Locks expire after 30 minutes** by default (configurable via `gateway.lockTimeout` in `config.toml`). If you don't heartbeat and the lock expires, another instance can claim it.
|
|
66
|
-
- When `GATEWAY_URL` is not set (single-instance mode), lock commands return `{"ok":true}` as a no-op (exit 0). When `GATEWAY_URL` is set but the gateway is unreachable, lock commands exit 6 — you must not proceed.
|
|
67
|
-
|
|
68
|
-
## Multiple locks
|
|
69
|
-
|
|
70
|
-
You can hold multiple locks simultaneously. This is useful when your workflow requires coordinating across several resources:
|
|
71
|
-
|
|
72
|
-
```
|
|
73
|
-
rlock "github issue acme/app#42"
|
|
74
|
-
rlock "deploy api-prod"
|
|
75
|
-
# ... work that needs both the issue and the deployment slot ...
|
|
76
|
-
runlock "deploy api-prod"
|
|
77
|
-
runlock "github issue acme/app#42"
|
|
78
|
-
```
|
|
79
|
-
|
|
80
|
-
Release each lock as soon as you no longer need it. Holding locks longer than necessary increases the chance of contention and deadlocks.
|
|
81
|
-
|
|
82
|
-
## Deadlock detection
|
|
83
|
-
|
|
84
|
-
When multiple agents each hold a lock the other needs, a **deadlock** can occur. The scheduler detects these cycles automatically.
|
|
85
|
-
|
|
86
|
-
**Example:**
|
|
87
|
-
- Agent A holds lock on `issue #1`, tries to acquire `issue #2` (held by Agent B)
|
|
88
|
-
- Agent B holds lock on `issue #2`, tries to acquire `issue #1` (held by Agent A)
|
|
89
|
-
- Neither can proceed — deadlock
|
|
90
|
-
|
|
91
|
-
When a cycle is detected, `rlock` returns exit 1 with:
|
|
92
|
-
|
|
93
|
-
```json
|
|
94
|
-
{"ok":false,"reason":"possible deadlock: agent-a → issue #2 → agent-b → issue #1 → agent-a","deadlock":true,"cycle":["agent-a","issue #2","agent-b","issue #1"]}
|
|
95
|
-
```
|
|
96
|
-
|
|
97
|
-
**What to do when you see `deadlock: true`:**
|
|
98
|
-
|
|
99
|
-
1. Release one or more of your currently held locks (`runlock`)
|
|
100
|
-
2. Move on to other work, or wait briefly before retrying
|
|
101
|
-
3. The other agent(s) will be able to proceed once you release
|
|
102
|
-
|
|
103
|
-
The `cycle` array describes the chain: `[holderA, resourceX, holderB, resourceY, ...]`. Check the JSON output for the `deadlock` field to distinguish deadlocks from regular contention.
|
|
104
|
-
|
|
105
|
-
## Example workflow
|
|
106
|
-
|
|
107
|
-
```
|
|
108
|
-
1. List open issues labeled "agent"
|
|
109
|
-
2. For each issue:
|
|
110
|
-
- rlock "github issue acme/app#42"
|
|
111
|
-
- If ok is false and deadlock is true, runlock any held locks and retry later
|
|
112
|
-
- If ok is false, skip — another instance is handling it
|
|
113
|
-
- Clone, branch, implement, push, open PR
|
|
114
|
-
- runlock "github issue acme/app#42"
|
|
115
|
-
3. If you completed work and there may be more issues, run `al-rerun`
|
|
116
|
-
```
|
|
@@ -1,98 +0,0 @@
|
|
|
1
|
-
# Skill: Signals
|
|
2
|
-
|
|
3
|
-
Use signal commands to communicate with the scheduler and trigger actions. These commands write signal files to `$AL_SIGNAL_DIR` and optionally POST to the gateway for real-time TUI updates.
|
|
4
|
-
|
|
5
|
-
## Commands
|
|
6
|
-
|
|
7
|
-
**`al-rerun`** — Request an immediate rerun after completing work.
|
|
8
|
-
|
|
9
|
-
```
|
|
10
|
-
al-rerun
|
|
11
|
-
```
|
|
12
|
-
|
|
13
|
-
**When to use:** When you completed work (e.g. processed an issue, merged a PR) and there may be additional items in the backlog. The scheduler will immediately re-run you (up to `maxReruns` times) to drain remaining work.
|
|
14
|
-
|
|
15
|
-
**When NOT to use:** If you found no work to do, or if you completed work but the backlog is empty. Simply end without calling `al-rerun` and the scheduler will wait for the next scheduled run.
|
|
16
|
-
|
|
17
|
-
**Default behavior:** Without `al-rerun`, the scheduler treats your run as complete and does not rerun. This is the safe default — errors, rate limits, and empty runs won't trigger unwanted reruns.
|
|
18
|
-
|
|
19
|
-
## `al-status "<text>"`
|
|
20
|
-
|
|
21
|
-
Updates your status displayed in the TUI and logs. Exits 4 if no text argument is provided.
|
|
22
|
-
|
|
23
|
-
```
|
|
24
|
-
al-status "reviewing PR #42"
|
|
25
|
-
al-status "deploying api-prod"
|
|
26
|
-
al-status "waiting for CI checks"
|
|
27
|
-
```
|
|
28
|
-
|
|
29
|
-
**When to use:** At natural milestones during your work — starting a new phase, switching tasks, or waiting on something. Helps the operator see what you're doing in real time.
|
|
30
|
-
|
|
31
|
-
**Format:** Provide the status text as a quoted argument. Keep it short and descriptive.
|
|
32
|
-
|
|
33
|
-
## `al-return`
|
|
34
|
-
|
|
35
|
-
Returns a value to the calling agent when you were invoked via `al-call`.
|
|
36
|
-
|
|
37
|
-
```
|
|
38
|
-
al-return "PR looks good. Approved with minor suggestions."
|
|
39
|
-
```
|
|
40
|
-
|
|
41
|
-
For multiline results, pipe via stdin:
|
|
42
|
-
|
|
43
|
-
```
|
|
44
|
-
cat <<'EOF' | al-return
|
|
45
|
-
PR looks good. Approved with minor suggestions:
|
|
46
|
-
- Line 42: consider using a const instead of let
|
|
47
|
-
- Line 89: missing error handling for the API call
|
|
48
|
-
EOF
|
|
49
|
-
```
|
|
50
|
-
|
|
51
|
-
**When to use:** When you were called by another agent (you'll see an `<agent-call>` block in your prompt) and need to send back a result. Pass your return value as an argument or pipe it via stdin.
|
|
52
|
-
|
|
53
|
-
**Rules:**
|
|
54
|
-
- If you call `al-return` multiple times, the last value wins
|
|
55
|
-
- If you were not called by another agent, `al-return` is a no-op
|
|
56
|
-
- Call chains are bounded by `maxCallDepth` (default: 3) to prevent infinite loops
|
|
57
|
-
|
|
58
|
-
## `al-exit [code]`
|
|
59
|
-
|
|
60
|
-
Terminates the agent with an optional exit code, indicating an unrecoverable error or intentional abort.
|
|
61
|
-
|
|
62
|
-
```
|
|
63
|
-
al-exit 10 # GitHub token is invalid or expired
|
|
64
|
-
al-exit 11 # Permission denied accessing repository
|
|
65
|
-
al-exit 15 # Unrecoverable error in build system
|
|
66
|
-
al-exit # Defaults to 15 (unrecoverable error)
|
|
67
|
-
```
|
|
68
|
-
|
|
69
|
-
**When to use:** When encountering errors that cannot be resolved by retrying — authentication failures, permission issues, invalid configuration, or when you need to abort due to user request or safety concerns.
|
|
70
|
-
|
|
71
|
-
**Format:** Pass the exit code as an argument, or omit for code 15 (unrecoverable error).
|
|
72
|
-
|
|
73
|
-
**Standard exit codes:**
|
|
74
|
-
- `10` — Authentication/credentials failure
|
|
75
|
-
- `11` — Permission/access denied
|
|
76
|
-
- `12` — Rate limit exceeded
|
|
77
|
-
- `13` — Configuration error
|
|
78
|
-
- `14` — Missing dependency or service error
|
|
79
|
-
- `15` — Generic unrecoverable error (default)
|
|
80
|
-
- `16` — User-requested abort
|
|
81
|
-
|
|
82
|
-
**Behavior:** The agent terminates with the specified exit code. The scheduler will not retry automatically.
|
|
83
|
-
|
|
84
|
-
**When NOT to use:** For transient errors (network timeouts, temporary rate limits) or normal completion. Use normal error handling or simply complete the run instead.
|
|
85
|
-
|
|
86
|
-
## Responses
|
|
87
|
-
|
|
88
|
-
All signal commands return JSON responses:
|
|
89
|
-
- Success: `{"ok":true}`
|
|
90
|
-
- Error: `{"ok":false,"error":"<message>"}`
|
|
91
|
-
|
|
92
|
-
## Multiple signals
|
|
93
|
-
|
|
94
|
-
You can use multiple signal commands in one run. For example, you might run several `al-status` updates as you work, then `al-return` with your result, and `al-rerun` if there's more work to do.
|
|
95
|
-
|
|
96
|
-
## Graceful degradation
|
|
97
|
-
|
|
98
|
-
Commands gracefully degrade when `GATEWAY_URL` is not set — signal files are always written, but real-time TUI updates only work when a gateway is available. This allows agents to work in both containerized and host environments.
|