@action-llama/action-llama 0.13.0 → 0.13.2

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 (161) hide show
  1. package/README.md +4 -17
  2. package/{docs/agent-reference → agent-docs}/AGENTS.md +27 -0
  3. package/{docs/agent-reference → agent-docs}/skills/README.md +1 -0
  4. package/agent-docs/skills/calls.md +82 -0
  5. package/{docs/agent-reference → agent-docs}/skills/resource-locks.md +13 -7
  6. package/{docs/agent-reference → agent-docs}/skills/signals.md +1 -1
  7. package/dist/agents/container-entry.d.ts.map +1 -1
  8. package/dist/agents/container-entry.js +15 -0
  9. package/dist/agents/container-entry.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/build-info.json +1 -1
  14. package/dist/cli/commands/doctor.d.ts.map +1 -1
  15. package/dist/cli/commands/doctor.js +15 -0
  16. package/dist/cli/commands/doctor.js.map +1 -1
  17. package/dist/cli/commands/env.d.ts.map +1 -1
  18. package/dist/cli/commands/env.js +4 -0
  19. package/dist/cli/commands/env.js.map +1 -1
  20. package/dist/cli/commands/kill.js +2 -2
  21. package/dist/cli/commands/kill.js.map +1 -1
  22. package/dist/cli/commands/pause.js +2 -2
  23. package/dist/cli/commands/pause.js.map +1 -1
  24. package/dist/cli/commands/push.js +1 -1
  25. package/dist/cli/commands/push.js.map +1 -1
  26. package/dist/cli/commands/resume.js +2 -2
  27. package/dist/cli/commands/resume.js.map +1 -1
  28. package/dist/cli/commands/run.js +2 -2
  29. package/dist/cli/commands/run.js.map +1 -1
  30. package/dist/cli/commands/status.js +5 -5
  31. package/dist/cli/commands/status.js.map +1 -1
  32. package/dist/cli/commands/stop.js +2 -2
  33. package/dist/cli/commands/stop.js.map +1 -1
  34. package/dist/cli/gateway-client.d.ts +6 -0
  35. package/dist/cli/gateway-client.d.ts.map +1 -1
  36. package/dist/cli/gateway-client.js +19 -0
  37. package/dist/cli/gateway-client.js.map +1 -1
  38. package/dist/cloud/vps/constants.d.ts +1 -1
  39. package/dist/cloud/vps/constants.d.ts.map +1 -1
  40. package/dist/cloud/vps/constants.js +9 -0
  41. package/dist/cloud/vps/constants.js.map +1 -1
  42. package/dist/cloud/vps/provision.js +11 -1
  43. package/dist/cloud/vps/provision.js.map +1 -1
  44. package/dist/cloud/vps/ssh.d.ts +7 -0
  45. package/dist/cloud/vps/ssh.d.ts.map +1 -1
  46. package/dist/cloud/vps/ssh.js +15 -1
  47. package/dist/cloud/vps/ssh.js.map +1 -1
  48. package/dist/credentials/builtins/index.d.ts.map +1 -1
  49. package/dist/credentials/builtins/index.js +6 -0
  50. package/dist/credentials/builtins/index.js.map +1 -1
  51. package/dist/credentials/builtins/mintlify-token.d.ts +4 -0
  52. package/dist/credentials/builtins/mintlify-token.d.ts.map +1 -0
  53. package/dist/credentials/builtins/mintlify-token.js +14 -0
  54. package/dist/credentials/builtins/mintlify-token.js.map +1 -0
  55. package/dist/credentials/builtins/mintlify-webhook-secret.d.ts +4 -0
  56. package/dist/credentials/builtins/mintlify-webhook-secret.d.ts.map +1 -0
  57. package/dist/credentials/builtins/mintlify-webhook-secret.js +12 -0
  58. package/dist/credentials/builtins/mintlify-webhook-secret.js.map +1 -0
  59. package/dist/credentials/builtins/reddit-oauth.d.ts +4 -0
  60. package/dist/credentials/builtins/reddit-oauth.d.ts.map +1 -0
  61. package/dist/credentials/builtins/reddit-oauth.js +71 -0
  62. package/dist/credentials/builtins/reddit-oauth.js.map +1 -0
  63. package/dist/docker/local-runtime.d.ts +0 -3
  64. package/dist/docker/local-runtime.d.ts.map +1 -1
  65. package/dist/docker/local-runtime.js +1 -34
  66. package/dist/docker/local-runtime.js.map +1 -1
  67. package/dist/docker/runtime.d.ts +0 -4
  68. package/dist/docker/runtime.d.ts.map +1 -1
  69. package/dist/gateway/index.d.ts +3 -0
  70. package/dist/gateway/index.d.ts.map +1 -1
  71. package/dist/gateway/index.js +23 -3
  72. package/dist/gateway/index.js.map +1 -1
  73. package/dist/gateway/routes/calls.d.ts +2 -1
  74. package/dist/gateway/routes/calls.d.ts.map +1 -1
  75. package/dist/gateway/routes/calls.js +12 -1
  76. package/dist/gateway/routes/calls.js.map +1 -1
  77. package/dist/gateway/routes/control.d.ts +2 -0
  78. package/dist/gateway/routes/control.d.ts.map +1 -1
  79. package/dist/gateway/routes/control.js +30 -2
  80. package/dist/gateway/routes/control.js.map +1 -1
  81. package/dist/gateway/routes/locks.d.ts +2 -0
  82. package/dist/gateway/routes/locks.d.ts.map +1 -1
  83. package/dist/gateway/routes/locks.js +20 -0
  84. package/dist/gateway/routes/locks.js.map +1 -1
  85. package/dist/gateway/routes/signals.d.ts +2 -1
  86. package/dist/gateway/routes/signals.d.ts.map +1 -1
  87. package/dist/gateway/routes/signals.js +21 -1
  88. package/dist/gateway/routes/signals.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 +5 -9
  92. package/dist/remote/bootstrap.js.map +1 -1
  93. package/dist/remote/push.js +85 -71
  94. package/dist/remote/push.js.map +1 -1
  95. package/dist/scheduler/events.d.ts +78 -0
  96. package/dist/scheduler/events.d.ts.map +1 -0
  97. package/dist/scheduler/events.js +65 -0
  98. package/dist/scheduler/events.js.map +1 -0
  99. package/dist/scheduler/execution.d.ts +15 -0
  100. package/dist/scheduler/execution.d.ts.map +1 -1
  101. package/dist/scheduler/execution.js +31 -2
  102. package/dist/scheduler/execution.js.map +1 -1
  103. package/dist/scheduler/index.d.ts +5 -0
  104. package/dist/scheduler/index.d.ts.map +1 -1
  105. package/dist/scheduler/index.js +61 -17
  106. package/dist/scheduler/index.js.map +1 -1
  107. package/dist/scheduler/webhook-setup.d.ts.map +1 -1
  108. package/dist/scheduler/webhook-setup.js +16 -0
  109. package/dist/scheduler/webhook-setup.js.map +1 -1
  110. package/dist/setup/scaffold.js +2 -2
  111. package/dist/setup/scaffold.js.map +1 -1
  112. package/dist/shared/config.d.ts +1 -0
  113. package/dist/shared/config.d.ts.map +1 -1
  114. package/dist/shared/config.js.map +1 -1
  115. package/dist/webhooks/definitions/github.d.ts.map +1 -1
  116. package/dist/webhooks/definitions/github.js +13 -0
  117. package/dist/webhooks/definitions/github.js.map +1 -1
  118. package/dist/webhooks/providers/github.d.ts.map +1 -1
  119. package/dist/webhooks/providers/github.js +6 -0
  120. package/dist/webhooks/providers/github.js.map +1 -1
  121. package/dist/webhooks/providers/mintlify.d.ts +9 -0
  122. package/dist/webhooks/providers/mintlify.d.ts.map +1 -0
  123. package/dist/webhooks/providers/mintlify.js +69 -0
  124. package/dist/webhooks/providers/mintlify.js.map +1 -0
  125. package/dist/webhooks/types.d.ts +9 -1
  126. package/dist/webhooks/types.d.ts.map +1 -1
  127. package/docker/bin/_http-exit +35 -0
  128. package/docker/bin/al-call +10 -4
  129. package/docker/bin/al-check +9 -3
  130. package/docker/bin/al-status +1 -1
  131. package/docker/bin/al-wait +11 -3
  132. package/docker/bin/rlock +9 -2
  133. package/docker/bin/rlock-heartbeat +9 -2
  134. package/docker/bin/runlock +9 -2
  135. package/package.json +2 -2
  136. package/docs/agent-config-reference.md +0 -313
  137. package/docs/agents.md +0 -256
  138. package/docs/cloud-run.md +0 -173
  139. package/docs/cloud.md +0 -98
  140. package/docs/commands.md +0 -286
  141. package/docs/config-reference.md +0 -241
  142. package/docs/creating-agents.md +0 -147
  143. package/docs/credentials.md +0 -167
  144. package/docs/docker.md +0 -323
  145. package/docs/ecs.md +0 -795
  146. package/docs/examples/dev/ACTIONS.md +0 -96
  147. package/docs/examples/dev/README.md +0 -42
  148. package/docs/examples/dev/agent-config.toml +0 -24
  149. package/docs/examples/index.md +0 -15
  150. package/docs/examples/planner/ACTIONS.md +0 -177
  151. package/docs/examples/planner/README.md +0 -39
  152. package/docs/examples/planner/agent-config.toml +0 -31
  153. package/docs/examples/reviewer/ACTIONS.md +0 -153
  154. package/docs/examples/reviewer/README.md +0 -39
  155. package/docs/examples/reviewer/agent-config.toml +0 -21
  156. package/docs/models.md +0 -191
  157. package/docs/vps-deployment.md +0 -285
  158. package/docs/web-dashboard.md +0 -113
  159. package/docs/webhooks.md +0 -152
  160. /package/{docs/agent-reference → agent-docs}/skills/credentials.md +0 -0
  161. /package/{docs/agent-reference → agent-docs}/skills/environment.md +0 -0
@@ -0,0 +1,69 @@
1
+ import { truncateEventText as truncate, validateHmacSignature } from "../validation.js";
2
+ export class MintlifyWebhookProvider {
3
+ source = "mintlify";
4
+ validateRequest(headers, rawBody, secrets) {
5
+ // Look for Mintlify signature header - common variations
6
+ const signature = headers["x-mintlify-signature"] || headers["mintlify-signature"];
7
+ return validateHmacSignature(rawBody, signature, secrets);
8
+ }
9
+ parseEvent(headers, body) {
10
+ // Handle potential missing or malformed payload
11
+ if (!body || typeof body !== "object")
12
+ return null;
13
+ const event = body.event || "build";
14
+ const action = body.action || body.status;
15
+ if (!action)
16
+ return null;
17
+ const base = {
18
+ source: "mintlify",
19
+ event,
20
+ action,
21
+ repo: body.project || body.organization || "unknown",
22
+ sender: body.user?.email || body.user?.name || "mintlify",
23
+ timestamp: body.timestamp || new Date().toISOString(),
24
+ };
25
+ return this.extractContext(body, base);
26
+ }
27
+ extractContext(body, base) {
28
+ // Extract build-specific information
29
+ const context = {
30
+ ...base,
31
+ title: body.title || `Build ${base.action}`,
32
+ body: truncate(body.message || body.error || body.description),
33
+ url: body.url || body.build_url || body.logs_url,
34
+ branch: body.branch || body.git?.branch || "main",
35
+ };
36
+ // Add additional context for failed builds
37
+ if (base.action === "failed" || base.action === "failure") {
38
+ context.conclusion = "failure";
39
+ if (body.error) {
40
+ context.body = truncate(`Build failed: ${body.error}`);
41
+ }
42
+ }
43
+ else if (base.action === "succeeded" || base.action === "success") {
44
+ context.conclusion = "success";
45
+ }
46
+ return context;
47
+ }
48
+ matchesFilter(context, filter) {
49
+ const f = filter;
50
+ if (f.events?.length && !f.events.includes(context.event)) {
51
+ return false;
52
+ }
53
+ if (f.actions?.length && context.action && !f.actions.includes(context.action)) {
54
+ return false;
55
+ }
56
+ // If filter specifies actions but event has no action, skip
57
+ if (f.actions?.length && !context.action) {
58
+ return false;
59
+ }
60
+ if (f.projects?.length && !f.projects.includes(context.repo)) {
61
+ return false;
62
+ }
63
+ if (f.branches?.length && context.branch && !f.branches.includes(context.branch)) {
64
+ return false;
65
+ }
66
+ return true;
67
+ }
68
+ }
69
+ //# sourceMappingURL=mintlify.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"mintlify.js","sourceRoot":"","sources":["../../../src/webhooks/providers/mintlify.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,iBAAiB,IAAI,QAAQ,EAAE,qBAAqB,EAAE,MAAM,kBAAkB,CAAC;AAExF,MAAM,OAAO,uBAAuB;IAClC,MAAM,GAAG,UAAU,CAAC;IAEpB,eAAe,CACb,OAA2C,EAC3C,OAAe,EACf,OAAgC;QAEhC,yDAAyD;QACzD,MAAM,SAAS,GAAG,OAAO,CAAC,sBAAsB,CAAC,IAAI,OAAO,CAAC,oBAAoB,CAAC,CAAC;QACnF,OAAO,qBAAqB,CAAC,OAAO,EAAE,SAAS,EAAE,OAAO,CAAC,CAAC;IAC5D,CAAC;IAED,UAAU,CAAC,OAA2C,EAAE,IAAS;QAC/D,gDAAgD;QAChD,IAAI,CAAC,IAAI,IAAI,OAAO,IAAI,KAAK,QAAQ;YAAE,OAAO,IAAI,CAAC;QAEnD,MAAM,KAAK,GAAG,IAAI,CAAC,KAAK,IAAI,OAAO,CAAC;QACpC,MAAM,MAAM,GAAG,IAAI,CAAC,MAAM,IAAI,IAAI,CAAC,MAAM,CAAC;QAE1C,IAAI,CAAC,MAAM;YAAE,OAAO,IAAI,CAAC;QAEzB,MAAM,IAAI,GAA4B;YACpC,MAAM,EAAE,UAAU;YAClB,KAAK;YACL,MAAM;YACN,IAAI,EAAE,IAAI,CAAC,OAAO,IAAI,IAAI,CA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AAa,CAAC,OAAuB,EAAE,MAAqB;QAC1D,MAAM,CAAC,GAAG,MAA+B,CAAC;QAE1C,IAAI,CAAC,CAAC,MAAM,EAAE,MAAM,IAAI,CAAC,CAAC,CAAC,MAAM,CAAC,QAAQ,CAAC,OAAO,CAAC,KAAK,CAAC,EAAE,CAAC;YAC1D,OAAO,KAAK,CAAC;QACf,CAAC;QAED,IAAI,CAAC,CAAC,OAAO,EAAE,MAAM,IAAI,OAAO,CAAC,MAAM,IAAI,CAAC,CAAC,CAAC,OAAO,CAAC,QAAQ,CAAC,OAAO,CAAC,MAAM,CAAC,EAAE,CAAC;YAC/E,OAAO,KAAK,CAAC;QACf,CAAC;QAED,4DAA4D;QAC5D,IAAI,CAAC,CAAC,OAAO,EAAE,MAAM,IAAI,CAAC,OAAO,CAAC,MAAM,EAAE,CAAC;YACzC,OAAO,KAAK,CAAC;QACf,CAAC;QAED,IAAI,CAAC,CAAC,QAAQ,EAAE,MAAM,IAAI,CAAC,CAAC,CAAC,QAAQ,CAAC,QAAQ,CAAC,OAAO,CAAC,IAAI,CAAC,EAAE,CAAC;YAC7D,OAAO,KAAK,CAAC;QACf,CAAC;QAED,IAAI,CAAC,CAAC,QAAQ,EAAE,MAAM,IAAI,OAAO,CAAC,MAAM,IAAI,CAAC,CAAC,CAAC,QAAQ,CAAC,QAAQ,CAAC,OAAO,CAAC,MAAM,CAAC,EAAE,CAAC;YACjF,OAAO,KAAK,CAAC;QACf,CAAC;QAED,OAAO,IAAI,CAAC;IACd,CAAC;CACF"}
@@ -11,6 +11,7 @@ export interface WebhookContext {
11
11
  assignee?: string;
12
12
  labels?: string[];
13
13
  branch?: string;
14
+ conclusion?: string;
14
15
  comment?: string;
15
16
  sender: string;
16
17
  timestamp: string;
@@ -25,6 +26,7 @@ export interface GitHubWebhookFilter {
25
26
  assignee?: string;
26
27
  author?: string;
27
28
  branches?: string[];
29
+ conclusions?: string[];
28
30
  }
29
31
  export interface SentryWebhookFilter {
30
32
  resources?: string[];
@@ -37,7 +39,13 @@ export interface LinearWebhookFilter {
37
39
  assignee?: string;
38
40
  author?: string;
39
41
  }
40
- export type WebhookFilter = GitHubWebhookFilter | SentryWebhookFilter | LinearWebhookFilter;
42
+ export interface MintlifyWebhookFilter {
43
+ projects?: string[];
44
+ events?: string[];
45
+ actions?: string[];
46
+ branches?: string[];
47
+ }
48
+ export type WebhookFilter = GitHubWebhookFilter | SentryWebhookFilter | LinearWebhookFilter | MintlifyWebhookFilter;
41
49
  export interface WebhookTrigger {
42
50
  source: string;
43
51
  events?: string[];
@@ -1 +1 @@
1
- {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/webhooks/types.ts"],"names":[],"mappings":"AAIA,MAAM,WAAW,cAAc;IAC7B,MAAM,EAAE,MAAM,CAAC;IACf,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,IAAI,EAAE,MAAM,CAAC;IACb,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,MAAM,CAAC,EAAE,MAAM,EAAE,CAAC;IAClB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,MAAM,EAAE,MAAM,CAAC;IACf,SAAS,EAAE,MAAM,CAAC;CACnB;AAID,MAAM,WAAW,mBAAmB;IAClC,KAAK,CAAC,EAAE,MAAM,EAAE,CAAC;IACjB,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,IAAI,CAAC,EAAE,MAAM,EAAE,CAAC;IAChB,MAAM,CAAC,EAAE,MAAM,EAAE,CAAC;IAClB,OAAO,CAAC,EAAE,MAAM,EAAE,CAAC;IACnB,MAAM,CAAC,EAAE,MAAM,E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,EAAE,MAAM,CAAC;IAChB,OAAO,EAAE,MAAM,CAAC;IAChB,MAAM,CAAC,EAAE,MAAM,EAAE,CAAC;IAClB,aAAa,CAAC,EAAE,MAAM,CAAC;CACxB"}
@@ -0,0 +1,35 @@
1
+ #!/bin/sh
2
+ # Shared HTTP status → exit code mapping for gateway-calling commands.
3
+ # Source this file: . "$(dirname "$0")/_http-exit"
4
+ # Then call: http_exit <http_code>
5
+ #
6
+ # Exit code table:
7
+ # 0 = success (HTTP 200)
8
+ # 1 = conflict (HTTP 409)
9
+ # 2 = not found (HTTP 404)
10
+ # 3 = auth error (HTTP 403)
11
+ # 4 = bad request (HTTP 400) — server rejected the request
12
+ # 5 = unavailable (HTTP 503) — gateway not ready
13
+ # 6 = unreachable (curl 000) — connection failed / DNS error
14
+ # 7 = unexpected (any other HTTP status)
15
+ # 8 = timeout (used by al-wait; not mapped here)
16
+ # 9 = usage error (missing argument — local check, never hit network)
17
+ # 10 = bad gateway (HTTP 502) — proxy could not reach the gateway
18
+ # 11 = gateway timeout (HTTP 504) — proxy timed out reaching the gateway
19
+ # 12 = server error (HTTP 500) — internal gateway error
20
+
21
+ http_exit() {
22
+ case "$1" in
23
+ 200) exit 0;;
24
+ 409) exit 1;;
25
+ 404) exit 2;;
26
+ 403) exit 3;;
27
+ 400) exit 4;;
28
+ 503) exit 5;;
29
+ 000) exit 6;;
30
+ 502) exit 10;;
31
+ 504) exit 11;;
32
+ 500) exit 12;;
33
+ *) exit 7;;
34
+ esac
35
+ }
@@ -1,8 +1,14 @@
1
1
  #!/bin/sh
2
- if [ -z "$GATEWAY_URL" ]; then echo '{"ok":false,"reason":"no gateway"}'; exit 1; fi
3
- if [ -z "$1" ]; then echo '{"ok":false,"reason":"usage: echo ctx | al-call <agent>"}'; exit 1; fi
2
+ # al-call dispatch a call to another agent
3
+ # Exit codes: 0=dispatched, 1=rejected, 3=auth, 4=bad request, 5=no gateway, 6=unreachable
4
+ . "$(dirname "$0")/_http-exit"
5
+ if [ -z "$GATEWAY_URL" ]; then echo '{"ok":false,"reason":"no gateway"}'; exit 5; fi
6
+ if [ -z "$1" ]; then echo '{"ok":false,"reason":"usage: echo ctx | al-call <agent>"}'; exit 9; fi
4
7
  CONTEXT=$(cat)
5
- curl -s -X POST "$GATEWAY_URL/calls" \
8
+ _raw=$(curl -s -w '\n%{http_code}' -X POST "$GATEWAY_URL/calls" \
6
9
  -H 'Content-Type: application/json' \
7
10
  -d "$(jq -n --arg s "$SHUTDOWN_SECRET" --arg t "$1" --arg c "$CONTEXT" \
8
- '{secret:$s,targetAgent:$t,context:$c}')"
11
+ '{secret:$s,targetAgent:$t,context:$c}')")
12
+ AL_HTTP_CODE=$(printf '%s' "$_raw" | tail -n1)
13
+ printf '%s' "$_raw" | sed '$d'
14
+ http_exit "$AL_HTTP_CODE"
@@ -1,4 +1,10 @@
1
1
  #!/bin/sh
2
- if [ -z "$GATEWAY_URL" ]; then echo '{"status":"error","errorMessage":"no gateway"}'; exit 1; fi
3
- if [ -z "$1" ]; then echo '{"status":"error","errorMessage":"usage: al-check <callId>"}'; exit 1; fi
4
- curl -s "$GATEWAY_URL/calls/$1?secret=$SHUTDOWN_SECRET"
2
+ # al-check check the status of a dispatched call
3
+ # Exit codes: 0=found, 2=not found, 3=auth, 4=bad request, 5=no gateway, 6=unreachable
4
+ . "$(dirname "$0")/_http-exit"
5
+ if [ -z "$GATEWAY_URL" ]; then echo '{"status":"error","errorMessage":"no gateway"}'; exit 5; fi
6
+ if [ -z "$1" ]; then echo '{"status":"error","errorMessage":"usage: al-check <callId>"}'; exit 9; fi
7
+ _raw=$(curl -s -w '\n%{http_code}' "$GATEWAY_URL/calls/$1?secret=$SHUTDOWN_SECRET")
8
+ AL_HTTP_CODE=$(printf '%s' "$_raw" | tail -n1)
9
+ printf '%s' "$_raw" | sed '$d'
10
+ http_exit "$AL_HTTP_CODE"
@@ -1,5 +1,5 @@
1
1
  #!/bin/sh
2
- if [ -z "$1" ]; then echo '{"ok":false,"error":"usage: al-status \"<text>\""}'; exit 1; fi
2
+ if [ -z "$1" ]; then echo '{"ok":false,"error":"usage: al-status \"<text>\""}'; exit 9; fi
3
3
  printf '%s' "$1" > "$AL_SIGNAL_DIR/status"
4
4
  if [ -n "$GATEWAY_URL" ] && [ -n "$SHUTDOWN_SECRET" ]; then
5
5
  curl -s -X POST "$GATEWAY_URL/signals/status" \
@@ -1,5 +1,8 @@
1
1
  #!/bin/sh
2
- if [ -z "$GATEWAY_URL" ]; then echo '{"error":"no gateway"}'; exit 1; fi
2
+ # al-wait wait for one or more calls to complete
3
+ # Exit codes: 0=all complete, 4=bad request, 5=no gateway, 6=unreachable, 8=timeout
4
+ . "$(dirname "$0")/_http-exit"
5
+ if [ -z "$GATEWAY_URL" ]; then echo '{"error":"no gateway"}'; exit 5; fi
3
6
  TIMEOUT=900
4
7
  IDS=""
5
8
  while [ $# -gt 0 ]; do
@@ -8,12 +11,16 @@ while [ $# -gt 0 ]; do
8
11
  *) IDS="$IDS $1"; shift;;
9
12
  esac
10
13
  done
11
- if [ -z "$IDS" ]; then echo '{"error":"usage: al-wait <callId> [callId...] [--timeout N]"}'; exit 1; fi
14
+ if [ -z "$IDS" ]; then echo '{"error":"usage: al-wait <callId> [callId...] [--timeout N]"}'; exit 9; fi
12
15
  ELAPSED=0
13
16
  while [ "$ELAPSED" -lt "$TIMEOUT" ]; do
14
17
  ALL_DONE=true
15
18
  for id in $IDS; do
16
- STATUS=$(curl -s "$GATEWAY_URL/calls/$id?secret=$SHUTDOWN_SECRET" | jq -r .status)
19
+ _raw=$(curl -s -w '\n%{http_code}' "$GATEWAY_URL/calls/$id?secret=$SHUTDOWN_SECRET")
20
+ _code=$(printf '%s' "$_raw" | tail -n1)
21
+ # On connection failure during polling, keep trying
22
+ case "$_code" in 000) ALL_DONE=false; continue;; esac
23
+ STATUS=$(printf '%s' "$_raw" | sed '$d' | jq -r .status 2>/dev/null)
17
24
  case "$STATUS" in running|pending) ALL_DONE=false;; esac
18
25
  done
19
26
  if $ALL_DONE; then break; fi
@@ -27,3 +34,4 @@ for id in $IDS; do
27
34
  RESULT="$RESULT\"$id\":$(curl -s "$GATEWAY_URL/calls/$id?secret=$SHUTDOWN_SECRET")"
28
35
  done
29
36
  echo "$RESULT}"
37
+ if [ "$ELAPSED" -ge "$TIMEOUT" ]; then exit 8; fi
package/docker/bin/rlock CHANGED
@@ -1,5 +1,12 @@
1
1
  #!/bin/sh
2
+ # rlock — acquire an exclusive resource lock
3
+ # Exit codes: 0=acquired, 1=conflict, 3=auth, 4=bad request, 6=unreachable, 9=usage, 10=bad gateway
4
+ . "$(dirname "$0")/_http-exit"
2
5
  if [ -z "$GATEWAY_URL" ]; then echo '{"ok":true}'; exit 0; fi
3
- curl -s -X POST "$GATEWAY_URL/locks/acquire" \
6
+ if [ -z "$1" ]; then echo '{"ok":false,"error":"usage: rlock <resourceKey>"}'; exit 9; fi
7
+ _raw=$(curl -s --connect-timeout 5 --max-time 10 -w '\n%{http_code}' -X POST "$GATEWAY_URL/locks/acquire" \
4
8
  -H 'Content-Type: application/json' \
5
- -d '{"secret":"'"$SHUTDOWN_SECRET"'","resourceKey":"'"$1"'"}'
9
+ -d '{"secret":"'"$SHUTDOWN_SECRET"'","resourceKey":"'"$1"'"}')
10
+ AL_HTTP_CODE=$(printf '%s' "$_raw" | tail -n1)
11
+ printf '%s' "$_raw" | sed '$d'
12
+ http_exit "$AL_HTTP_CODE"
@@ -1,5 +1,12 @@
1
1
  #!/bin/sh
2
+ # rlock-heartbeat — extend the TTL on a held lock
3
+ # Exit codes: 0=extended, 1=conflict, 2=not found, 3=auth, 4=bad request, 6=unreachable, 9=usage
4
+ . "$(dirname "$0")/_http-exit"
2
5
  if [ -z "$GATEWAY_URL" ]; then echo '{"ok":true}'; exit 0; fi
3
- curl -s -X POST "$GATEWAY_URL/locks/heartbeat" \
6
+ if [ -z "$1" ]; then echo '{"ok":false,"error":"usage: rlock-heartbeat <resourceKey>"}'; exit 9; fi
7
+ _raw=$(curl -s --connect-timeout 5 --max-time 10 -w '\n%{http_code}' -X POST "$GATEWAY_URL/locks/heartbeat" \
4
8
  -H 'Content-Type: application/json' \
5
- -d '{"secret":"'"$SHUTDOWN_SECRET"'","resourceKey":"'"$1"'"}' || echo '{"ok":true,"note":"gateway unreachable"}'
9
+ -d '{"secret":"'"$SHUTDOWN_SECRET"'","resourceKey":"'"$1"'"}')
10
+ AL_HTTP_CODE=$(printf '%s' "$_raw" | tail -n1)
11
+ printf '%s' "$_raw" | sed '$d'
12
+ http_exit "$AL_HTTP_CODE"
@@ -1,5 +1,12 @@
1
1
  #!/bin/sh
2
+ # runlock — release a resource lock
3
+ # Exit codes: 0=released, 1=conflict, 2=not found, 3=auth, 4=bad request, 6=unreachable, 9=usage
4
+ . "$(dirname "$0")/_http-exit"
2
5
  if [ -z "$GATEWAY_URL" ]; then echo '{"ok":true}'; exit 0; fi
3
- curl -s -X POST "$GATEWAY_URL/locks/release" \
6
+ if [ -z "$1" ]; then echo '{"ok":false,"error":"usage: runlock <resourceKey>"}'; exit 9; fi
7
+ _raw=$(curl -s --connect-timeout 5 --max-time 10 -w '\n%{http_code}' -X POST "$GATEWAY_URL/locks/release" \
4
8
  -H 'Content-Type: application/json' \
5
- -d '{"secret":"'"$SHUTDOWN_SECRET"'","resourceKey":"'"$1"'"}' || echo '{"ok":true,"note":"gateway unreachable, lock will expire"}'
9
+ -d '{"secret":"'"$SHUTDOWN_SECRET"'","resourceKey":"'"$1"'"}')
10
+ AL_HTTP_CODE=$(printf '%s' "$_raw" | tail -n1)
11
+ printf '%s' "$_raw" | sed '$d'
12
+ http_exit "$AL_HTTP_CODE"
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@action-llama/action-llama",
3
- "version": "0.13.0",
3
+ "version": "0.13.2",
4
4
  "description": "Automated development agents triggered by cron or webhooks. BYOM — bring your own model.",
5
5
  "type": "module",
6
6
  "license": "MIT",
@@ -31,7 +31,7 @@
31
31
  "files": [
32
32
  "dist",
33
33
  "docker",
34
- "docs",
34
+ "agent-docs",
35
35
  "README.md",
36
36
  "LICENSE"
37
37
  ],
@@ -1,313 +0,0 @@
1
- # agent-config.toml Reference
2
-
3
- Each agent has an `agent-config.toml` file in its directory. The agent name is derived from the directory name and should not be included in the config.
4
-
5
- ## Full Annotated Example
6
-
7
- ```toml
8
- # Required: credential types the agent needs at runtime
9
- # Use "type" for default instance, "type:instance" for named instance
10
- credentials = ["github_token", "git_ssh", "sentry_token"]
11
-
12
- # Optional: cron schedule (standard cron syntax)
13
- # Agent must have at least one of: schedule, webhooks
14
- schedule = "*/5 * * * *"
15
-
16
- # Optional: number of concurrent runs allowed (default: 1)
17
- # When scale > 1, use LOCK/UNLOCK in your actions to coordinate
18
- # and prevent instances from working on the same resource.
19
- scale = 2
20
-
21
- # Optional: max runtime in seconds (default: falls back to [local].timeout, then 900)
22
- # On AWS ECS, agents with timeout <= 900 automatically route to Lambda
23
- # for faster cold starts (~1-2s vs ~30-60s on Fargate). Agents with
24
- # timeout > 900 run on ECS Fargate.
25
- timeout = 600
26
-
27
- # Required: LLM model configuration
28
- [model]
29
- provider = "anthropic" # LLM provider: anthropic, openai, groq, google, xai, mistral, openrouter, or custom
30
- model = "claude-sonnet-4-20250514" # Model ID (e.g., claude-sonnet-4-20250514, gpt-4o, gemini-2.0-flash-exp)
31
- thinkingLevel = "medium" # Optional: off | minimal | low | medium | high | xhigh (for models with reasoning support)
32
- authType = "api_key" # api_key | oauth_token | pi_auth
33
-
34
- # Optional: webhook triggers (instead of or in addition to schedule)
35
- # Each source references a named webhook defined in the project's config.toml
36
- [[webhooks]]
37
- source = "my-github" # Required: references [webhooks.my-github] in config.toml
38
- repos = ["acme/app"] # Filter to specific repos (optional)
39
- events = ["issues"] # GitHub event types (optional)
40
- actions = ["labeled"] # GitHub event actions (optional)
41
- labels = ["agent"] # Only trigger on issues with these labels (optional)
42
-
43
- [[webhooks]]
44
- source = "my-sentry" # Required: references [webhooks.my-sentry] in config.toml
45
- resources = ["error", "event_alert"] # Sentry resource types (optional)
46
-
47
- # Optional: preflight steps — run before the LLM session starts
48
- # Each step runs a built-in provider to stage data the agent will reference
49
- [[preflight]]
50
- provider = "git-clone" # Clone a repo into the workspace
51
- required = true # If true (default), abort if this step fails
52
- [preflight.params]
53
- repo = "acme/app" # Short "owner/repo" or full URL
54
- dest = "/tmp/repo"
55
- depth = 1 # Optional: shallow clone
56
-
57
- [[preflight]]
58
- provider = "http" # Fetch a URL and write the response to a file
59
- required = false # Optional step — warn and continue on failure
60
- [preflight.params]
61
- url = "https://api.internal/v1/flags"
62
- output = "/tmp/context/flags.json"
63
- headers = { Authorization = "Bearer ${INTERNAL_TOKEN}" }
64
-
65
- [[preflight]]
66
- provider = "shell" # Run a shell command
67
- [preflight.params]
68
- command = "gh issue list --repo acme/app --label P1 --json number,title,body --limit 20"
69
- output = "/tmp/context/issues.json" # Optional: capture stdout to file
70
-
71
- # Optional: custom parameters injected into the agent prompt
72
- [params]
73
- repos = ["acme/app", "acme/api"]
74
- triggerLabel = "agent"
75
- assignee = "bot-user"
76
- sentryOrg = "acme"
77
- sentryProjects = ["web-app", "api"]
78
- ```
79
-
80
- ## Field Reference
81
-
82
- | Field | Type | Required | Description |
83
- |-------|------|----------|-------------|
84
- | `credentials` | string[] | Yes | Credential refs: `"type"` for default instance, `"type:instance"` for named instance |
85
- | `schedule` | string | No* | Cron expression for polling |
86
- | `scale` | number | No | Number of concurrent runs allowed (default: 1). Set to `0` to disable the agent. Use lock skills in your actions to coordinate instances. See [Resource Locks](agents.md#resource-locks). |
87
- | `timeout` | number | No | Max runtime in seconds. Falls back to `[local].timeout` in project config, then `900`. On AWS ECS, agents with timeout <= 900 auto-route to Lambda for faster startup. See [Timeout](#timeout). |
88
- | `model` | table | No | LLM model configuration (falls back to `[model]` in project `config.toml`) |
89
- | `model.provider` | string | Yes* | LLM provider ("anthropic", "openai", "groq", "google", "xai", "mistral", "openrouter", or "custom") |
90
- | `model.model` | string | Yes* | Model ID |
91
- | `model.thinkingLevel` | string | No | Thinking budget level: off, minimal, low, medium, high, xhigh. Only relevant for Claude Sonnet/Opus. Omit for other models. |
92
- | `model.authType` | string | Yes* | Auth method for the provider |
93
- | `webhooks` | array | No* | Array of webhook trigger objects |
94
- | `preflight` | array | No | Array of preflight steps that run before the LLM session. See [Preflight](#preflight). |
95
- | `params` | table | No | Custom key-value params for the agent prompt |
96
-
97
- *At least one of `schedule` or `webhooks` is required (unless `scale = 0`). *Required within `[model]` if the agent defines its own model block (otherwise inherits from project `config.toml`).
98
-
99
- ## Scale
100
-
101
- The `scale` field controls how many instances of an agent can run concurrently. This is useful for agents that handle high-volume workloads or when you want to process multiple tasks simultaneously.
102
-
103
- - **Default**: 1 (only one instance can run at a time)
104
- - **Minimum**: 0 (disables the agent — no runners, cron jobs, or webhook bindings are created)
105
- - **Maximum**: No hard limit, but consider system resources and model API rate limits
106
-
107
- ### How it works
108
-
109
- 1. **Scheduled runs**: If a cron trigger fires but all agent instances are busy, the scheduled run is skipped with a warning
110
- 2. **Webhook events**: If a webhook arrives but all instances are busy, the event is queued (up to `workQueueSize` limit in global config, default: 100)
111
- 3. **Agent calls**: If one agent calls another but all target instances are busy, the call is queued in the same work queue and processed when a runner frees up
112
-
113
- ### Example use cases
114
-
115
- - **Dev agent** with `scale = 3`: Handle multiple GitHub issues simultaneously
116
- - **Review agent** with `scale = 2`: Review multiple PRs in parallel
117
- - **Monitoring agent** with `scale = 1`: Ensure only one instance processes alerts at a time
118
- - **Disabled agent** with `scale = 0`: Keep the config in the project but don't run it
119
-
120
- ### Resource considerations
121
-
122
- Each parallel instance:
123
- - Uses separate Docker containers (in Docker mode)
124
- - Has independent logging streams
125
- - May consume LLM API quota concurrently
126
- - Uses system memory and CPU
127
-
128
- ## Timeout
129
-
130
- The `timeout` field controls the maximum runtime for an agent invocation. When the timeout expires, the container is terminated.
131
-
132
- **Resolution order:** `agent-config.toml timeout` -> `config.toml [local].timeout` -> `900` (default)
133
-
134
- This means you can set a project-wide default in `[local].timeout` and override it per-agent.
135
-
136
- ### Automatic Lambda routing (AWS ECS)
137
-
138
- When using `cloud.provider = "ecs"`, agents are automatically routed to the most efficient AWS compute service based on their effective timeout:
139
-
140
- | Effective timeout | Runtime | Cold start | Cost |
141
- |---|---|---|---|
142
- | **<= 900s** (15 min) | **AWS Lambda** | ~1-2s | Lower (pay per 100ms) |
143
- | **> 900s** | **ECS Fargate** | ~30-60s | Higher (pay per second, 1-min minimum) |
144
-
145
- This routing is automatic — you don't need to configure anything beyond setting the timeout. Both runtimes use the same ECR images (built via CodeBuild) and the same Secrets Manager credentials.
146
-
147
- **Why Lambda is faster:** Lambda keeps your container image warm in a pre-provisioned execution environment. When a function is invoked, Lambda can start executing in 1-2 seconds. ECS Fargate, by contrast, must provision a new VM, pull the container image, and start the container — which takes 30-60 seconds.
148
-
149
- **When to use a short timeout:** If your agent typically finishes in under 15 minutes (e.g., responding to a webhook, triaging an issue, reviewing a small PR), set `timeout = 600` or similar. The agent gets faster startup and lower cost on AWS. If an agent needs more than 15 minutes (e.g., large refactoring tasks, long-running monitoring loops), use a longer timeout and it will route to ECS Fargate automatically.
150
-
151
- ### Lambda IAM roles
152
-
153
- When `al doctor -c` runs, it automatically creates Lambda execution roles (`al-{agentName}-lambda-role`) for agents whose effective timeout is <= 900s. These roles include permissions for Secrets Manager access, CloudWatch Logs, and ECR image pull. You can override the role with `cloud.lambdaRoleArn` in `config.toml`.
154
-
155
- ### Examples
156
-
157
- ```toml
158
- # Fast webhook responder — routes to Lambda on AWS
159
- timeout = 300 # 5 minutes
160
-
161
- # Medium-length task — still fits Lambda
162
- timeout = 900 # 15 minutes (Lambda max)
163
-
164
- # Long-running agent — routes to ECS Fargate
165
- timeout = 3600 # 1 hour
166
-
167
- # Omit timeout — uses [local].timeout or defaults to 900s
168
- # (routes to Lambda on AWS since 900 <= 900)
169
- ```
170
-
171
- ## Preflight
172
-
173
- Preflight steps run mechanical data-staging tasks after credentials are loaded but before the LLM session starts. They fetch data, clone repos, or run commands to prepare the workspace so the agent starts with everything it needs — instead of spending tokens fetching context at runtime.
174
-
175
- ### How it works
176
-
177
- 1. Steps run **sequentially** in the order they appear in `agent-config.toml`
178
- 2. Steps run **inside the container** (or host process in `--no-docker` mode) after credential/env setup
179
- 3. Providers write files to disk — your ACTIONS.md references the staged files
180
- 4. Environment variable interpolation is supported: `${VAR_NAME}` in string params is resolved against `process.env` (which already has credentials injected)
181
-
182
- ### Step fields
183
-
184
- Each `[[preflight]]` entry has these fields:
185
-
186
- | Field | Type | Required | Description |
187
- |-------|------|----------|-------------|
188
- | `provider` | string | Yes | Provider name: `shell`, `http`, or `git-clone` |
189
- | `required` | boolean | No | If `true` (default), the agent aborts on failure. If `false`, logs a warning and continues. |
190
- | `params` | table | Yes | Provider-specific parameters (see below) |
191
-
192
- ### Built-in providers
193
-
194
- #### `shell`
195
-
196
- Runs a command via `/bin/sh`. Optionally captures stdout to a file.
197
-
198
- | Param | Type | Required | Description |
199
- |-------|------|----------|-------------|
200
- | `command` | string | Yes | Shell command to execute |
201
- | `output` | string | No | File path to write stdout to. Parent directories are created automatically. |
202
-
203
- ```toml
204
- [[preflight]]
205
- provider = "shell"
206
- [preflight.params]
207
- command = "gh issue list --repo acme/app --label P1 --json number,title,body --limit 20"
208
- output = "/tmp/context/issues.json"
209
- ```
210
-
211
- #### `http`
212
-
213
- Fetches a URL and writes the response body to a file.
214
-
215
- | Param | Type | Required | Description |
216
- |-------|------|----------|-------------|
217
- | `url` | string | Yes | URL to fetch |
218
- | `output` | string | Yes | File path to write the response body |
219
- | `method` | string | No | HTTP method (default: `GET`) |
220
- | `headers` | table | No | HTTP headers as key-value pairs |
221
- | `body` | string | No | Request body (for POST/PUT) |
222
-
223
- ```toml
224
- [[preflight]]
225
- provider = "http"
226
- required = false
227
- [preflight.params]
228
- url = "https://api.internal/v1/feature-flags"
229
- output = "/tmp/context/flags.json"
230
- headers = { Authorization = "Bearer ${INTERNAL_TOKEN}" }
231
- ```
232
-
233
- #### `git-clone`
234
-
235
- Clones a git repository. Short `"owner/repo"` names are expanded to `git@github.com:owner/repo.git`; full URLs are passed through. Git credentials (SSH key, HTTPS token) are already configured from the agent's credentials.
236
-
237
- | Param | Type | Required | Description |
238
- |-------|------|----------|-------------|
239
- | `repo` | string | Yes | Repository: `"owner/repo"` or full URL |
240
- | `dest` | string | Yes | Local path to clone into |
241
- | `branch` | string | No | Branch to check out |
242
- | `depth` | number | No | Shallow clone depth (e.g., `1`) |
243
-
244
- ```toml
245
- [[preflight]]
246
- provider = "git-clone"
247
- [preflight.params]
248
- repo = "acme/app"
249
- dest = "/tmp/repo"
250
- branch = "main"
251
- depth = 1
252
- ```
253
-
254
- ### Referencing staged files in ACTIONS.md
255
-
256
- Preflight writes files to disk — your ACTIONS.md tells the LLM what's there:
257
-
258
- ```markdown
259
- ## Context
260
- - The repo is cloned at `/tmp/repo`
261
- - Open P1 issues are at `/tmp/context/issues.json`
262
- - Feature flags (if available) are at `/tmp/context/flags.json`
263
- ```
264
-
265
- ### Notes
266
-
267
- - The `shell` provider is the escape hatch — anything a built-in provider doesn't cover can be expressed as a shell command
268
- - There is no per-step timeout — steps are bounded by the container-level timeout
269
- - Environment variables set inside `shell` child processes do not propagate back to the agent's `process.env`
270
-
271
- ## Webhook Trigger Fields
272
-
273
- Each `[[webhooks]]` entry has the following fields:
274
-
275
- | Field | Type | Required | Description |
276
- |-------|------|----------|-------------|
277
- | `source` | string | Yes | Name of a webhook source from the project's `config.toml` (e.g. `"my-github"`) |
278
-
279
- All filter fields below are optional. Omit all of them to trigger on everything from that source.
280
-
281
- ### GitHub filter fields
282
-
283
- | Field | Type | Description |
284
- |-------|------|-------------|
285
- | `repos` | string[] | Filter to specific repos |
286
- | `events` | string[] | Event types: issues, pull_request, push, etc. |
287
- | `actions` | string[] | Event actions: opened, labeled, closed, etc. |
288
- | `labels` | string[] | Only trigger when issue/PR has these labels |
289
- | `assignee` | string | Only trigger when assigned to this user |
290
- | `author` | string | Only trigger for this author |
291
- | `branches` | string[] | Only trigger for these branches |
292
-
293
- ### Sentry filter fields
294
-
295
- | Field | Type | Description |
296
- |-------|------|-------------|
297
- | `resources` | string[] | Resource types: event_alert, metric_alert, issue, error, comment |
298
-
299
- ## Model Configuration
300
-
301
- The `[model]` section is optional — agents inherit the default model from the project's `config.toml`. Only add `[model]` to an agent config if you want to override the default for that specific agent.
302
-
303
- See [Models](models.md) for all supported providers, model IDs, auth types, thinking levels, and credential setup.
304
-
305
- ## Cloud Runtimes
306
-
307
- ### Cloud Run (GCP)
308
-
309
- When using Cloud Run mode (`cloud.provider = "cloud-run"` in `config.toml`), each agent automatically gets a per-agent service account (`al-{agentName}@{gcpProject}.iam.gserviceaccount.com`) that only has access to the credentials listed in that agent's `credentials` array. Run `al doctor -c` to create the service accounts and IAM bindings. See [Cloud Run docs](cloud-run.md) for details.
310
-
311
- ### ECS Fargate (AWS)
312
-
313
- When using ECS mode (`cloud.provider = "ecs"` in `config.toml`), each agent automatically uses a per-agent IAM task role (`al-{agentName}-task-role`) that only has access to the credentials listed in that agent's `credentials` array. The task role ARN is derived from the ECR repository's account ID. See [ECS docs](ecs.md) for setup instructions including how to create the per-agent task roles.