@action-llama/action-llama 0.2.0 → 0.4.0

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 (235) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +61 -90
  3. package/dist/agents/container-entry.js +183 -43
  4. package/dist/agents/container-entry.js.map +1 -1
  5. package/dist/agents/container-runner.d.ts +11 -4
  6. package/dist/agents/container-runner.d.ts.map +1 -1
  7. package/dist/agents/container-runner.js +107 -99
  8. package/dist/agents/container-runner.js.map +1 -1
  9. package/dist/agents/prompt.d.ts +2 -0
  10. package/dist/agents/prompt.d.ts.map +1 -1
  11. package/dist/agents/prompt.js +18 -10
  12. package/dist/agents/prompt.js.map +1 -1
  13. package/dist/agents/runner.d.ts +10 -1
  14. package/dist/agents/runner.d.ts.map +1 -1
  15. package/dist/agents/runner.js +95 -9
  16. package/dist/agents/runner.js.map +1 -1
  17. package/dist/cli/commands/cloud-setup.d.ts +4 -0
  18. package/dist/cli/commands/cloud-setup.d.ts.map +1 -0
  19. package/dist/cli/commands/cloud-setup.js +565 -0
  20. package/dist/cli/commands/cloud-setup.js.map +1 -0
  21. package/dist/cli/commands/cloud-teardown.d.ts +6 -0
  22. package/dist/cli/commands/cloud-teardown.d.ts.map +1 -0
  23. package/dist/cli/commands/cloud-teardown.js +152 -0
  24. package/dist/cli/commands/cloud-teardown.js.map +1 -0
  25. package/dist/cli/commands/{setup.d.ts → console.d.ts} +1 -1
  26. package/dist/cli/commands/console.d.ts.map +1 -0
  27. package/dist/cli/commands/console.js +273 -0
  28. package/dist/cli/commands/console.js.map +1 -0
  29. package/dist/cli/commands/creds.d.ts +2 -0
  30. package/dist/cli/commands/creds.d.ts.map +1 -0
  31. package/dist/cli/commands/creds.js +62 -0
  32. package/dist/cli/commands/creds.js.map +1 -0
  33. package/dist/cli/commands/doctor.d.ts +7 -0
  34. package/dist/cli/commands/doctor.d.ts.map +1 -0
  35. package/dist/cli/commands/doctor.js +405 -0
  36. package/dist/cli/commands/doctor.js.map +1 -0
  37. package/dist/cli/commands/logs.d.ts +1 -0
  38. package/dist/cli/commands/logs.d.ts.map +1 -1
  39. package/dist/cli/commands/logs.js +67 -0
  40. package/dist/cli/commands/logs.js.map +1 -1
  41. package/dist/cli/commands/new.d.ts.map +1 -1
  42. package/dist/cli/commands/new.js +30 -28
  43. package/dist/cli/commands/new.js.map +1 -1
  44. package/dist/cli/commands/run.d.ts +6 -0
  45. package/dist/cli/commands/run.d.ts.map +1 -0
  46. package/dist/cli/commands/run.js +121 -0
  47. package/dist/cli/commands/run.js.map +1 -0
  48. package/dist/cli/commands/start.d.ts +2 -1
  49. package/dist/cli/commands/start.d.ts.map +1 -1
  50. package/dist/cli/commands/start.js +41 -14
  51. package/dist/cli/commands/start.js.map +1 -1
  52. package/dist/cli/commands/status.d.ts +1 -0
  53. package/dist/cli/commands/status.d.ts.map +1 -1
  54. package/dist/cli/commands/status.js +39 -2
  55. package/dist/cli/commands/status.js.map +1 -1
  56. package/dist/cli/main.js +61 -12
  57. package/dist/cli/main.js.map +1 -1
  58. package/dist/credentials/builtins/anthropic-key.d.ts.map +1 -1
  59. package/dist/credentials/builtins/anthropic-key.js +3 -4
  60. package/dist/credentials/builtins/anthropic-key.js.map +1 -1
  61. package/dist/credentials/builtins/aws.d.ts +4 -0
  62. package/dist/credentials/builtins/aws.d.ts.map +1 -0
  63. package/dist/credentials/builtins/aws.js +33 -0
  64. package/dist/credentials/builtins/aws.js.map +1 -0
  65. package/dist/credentials/builtins/bugsnag-token.d.ts +4 -0
  66. package/dist/credentials/builtins/bugsnag-token.d.ts.map +1 -0
  67. package/dist/credentials/builtins/bugsnag-token.js +18 -0
  68. package/dist/credentials/builtins/bugsnag-token.js.map +1 -0
  69. package/dist/credentials/builtins/github-token.d.ts.map +1 -1
  70. package/dist/credentials/builtins/github-token.js +1 -2
  71. package/dist/credentials/builtins/github-token.js.map +1 -1
  72. package/dist/credentials/builtins/github-webhook-secret.js +3 -3
  73. package/dist/credentials/builtins/github-webhook-secret.js.map +1 -1
  74. package/dist/credentials/builtins/id-rsa.d.ts +2 -2
  75. package/dist/credentials/builtins/id-rsa.d.ts.map +1 -1
  76. package/dist/credentials/builtins/id-rsa.js +75 -47
  77. package/dist/credentials/builtins/id-rsa.js.map +1 -1
  78. package/dist/credentials/builtins/index.d.ts.map +1 -1
  79. package/dist/credentials/builtins/index.js +17 -7
  80. package/dist/credentials/builtins/index.js.map +1 -1
  81. package/dist/credentials/builtins/netlify-token.d.ts +4 -0
  82. package/dist/credentials/builtins/netlify-token.d.ts.map +1 -0
  83. package/dist/credentials/builtins/netlify-token.js +18 -0
  84. package/dist/credentials/builtins/netlify-token.js.map +1 -0
  85. package/dist/credentials/builtins/openai-key.d.ts +4 -0
  86. package/dist/credentials/builtins/openai-key.d.ts.map +1 -0
  87. package/dist/credentials/builtins/openai-key.js +38 -0
  88. package/dist/credentials/builtins/openai-key.js.map +1 -0
  89. package/dist/credentials/builtins/sentry-client-secret.d.ts.map +1 -1
  90. package/dist/credentials/builtins/sentry-client-secret.js +1 -2
  91. package/dist/credentials/builtins/sentry-client-secret.js.map +1 -1
  92. package/dist/credentials/builtins/sentry-token.d.ts.map +1 -1
  93. package/dist/credentials/builtins/sentry-token.js +2 -3
  94. package/dist/credentials/builtins/sentry-token.js.map +1 -1
  95. package/dist/credentials/builtins/x-twitter-api.d.ts +4 -0
  96. package/dist/credentials/builtins/x-twitter-api.d.ts.map +1 -0
  97. package/dist/credentials/builtins/x-twitter-api.js +28 -0
  98. package/dist/credentials/builtins/x-twitter-api.js.map +1 -0
  99. package/dist/credentials/prompter.d.ts +1 -1
  100. package/dist/credentials/prompter.d.ts.map +1 -1
  101. package/dist/credentials/prompter.js +14 -21
  102. package/dist/credentials/prompter.js.map +1 -1
  103. package/dist/credentials/schema.d.ts +0 -1
  104. package/dist/credentials/schema.d.ts.map +1 -1
  105. package/dist/credentials/schema.js +2 -3
  106. package/dist/credentials/schema.js.map +1 -1
  107. package/dist/docker/cloud-run-runtime.d.ts +61 -0
  108. package/dist/docker/cloud-run-runtime.d.ts.map +1 -0
  109. package/dist/docker/cloud-run-runtime.js +510 -0
  110. package/dist/docker/cloud-run-runtime.js.map +1 -0
  111. package/dist/docker/ecs-runtime.d.ts +73 -0
  112. package/dist/docker/ecs-runtime.d.ts.map +1 -0
  113. package/dist/docker/ecs-runtime.js +596 -0
  114. package/dist/docker/ecs-runtime.js.map +1 -0
  115. package/dist/docker/image.d.ts +8 -0
  116. package/dist/docker/image.d.ts.map +1 -1
  117. package/dist/docker/image.js +28 -3
  118. package/dist/docker/image.js.map +1 -1
  119. package/dist/docker/local-runtime.d.ts +19 -0
  120. package/dist/docker/local-runtime.d.ts.map +1 -0
  121. package/dist/docker/local-runtime.js +209 -0
  122. package/dist/docker/local-runtime.js.map +1 -0
  123. package/dist/docker/network.d.ts +1 -1
  124. package/dist/docker/network.d.ts.map +1 -1
  125. package/dist/docker/network.js +2 -1
  126. package/dist/docker/network.js.map +1 -1
  127. package/dist/docker/runtime.d.ts +90 -0
  128. package/dist/docker/runtime.d.ts.map +1 -0
  129. package/dist/docker/runtime.js +2 -0
  130. package/dist/docker/runtime.js.map +1 -0
  131. package/dist/gateway/index.d.ts +8 -2
  132. package/dist/gateway/index.d.ts.map +1 -1
  133. package/dist/gateway/index.js +16 -8
  134. package/dist/gateway/index.js.map +1 -1
  135. package/dist/gateway/routes/credentials.d.ts +5 -0
  136. package/dist/gateway/routes/credentials.d.ts.map +1 -0
  137. package/dist/gateway/routes/credentials.js +17 -0
  138. package/dist/gateway/routes/credentials.js.map +1 -0
  139. package/dist/gateway/routes/logs.d.ts +5 -0
  140. package/dist/gateway/routes/logs.d.ts.map +1 -0
  141. package/dist/gateway/routes/logs.js +31 -0
  142. package/dist/gateway/routes/logs.js.map +1 -0
  143. package/dist/gateway/routes/shutdown.d.ts +2 -1
  144. package/dist/gateway/routes/shutdown.d.ts.map +1 -1
  145. package/dist/gateway/routes/shutdown.js +7 -16
  146. package/dist/gateway/routes/shutdown.js.map +1 -1
  147. package/dist/gateway/routes/webhooks.d.ts +2 -1
  148. package/dist/gateway/routes/webhooks.d.ts.map +1 -1
  149. package/dist/gateway/routes/webhooks.js +11 -4
  150. package/dist/gateway/routes/webhooks.js.map +1 -1
  151. package/dist/gateway/types.d.ts +6 -0
  152. package/dist/gateway/types.d.ts.map +1 -0
  153. package/dist/gateway/types.js +2 -0
  154. package/dist/gateway/types.js.map +1 -0
  155. package/dist/scheduler/index.d.ts +3 -2
  156. package/dist/scheduler/index.d.ts.map +1 -1
  157. package/dist/scheduler/index.js +299 -59
  158. package/dist/scheduler/index.js.map +1 -1
  159. package/dist/setup/prompts.d.ts.map +1 -1
  160. package/dist/setup/prompts.js +14 -21
  161. package/dist/setup/prompts.js.map +1 -1
  162. package/dist/setup/scaffold.d.ts +2 -2
  163. package/dist/setup/scaffold.d.ts.map +1 -1
  164. package/dist/setup/scaffold.js +369 -27
  165. package/dist/setup/scaffold.js.map +1 -1
  166. package/dist/setup/validators.d.ts +14 -0
  167. package/dist/setup/validators.d.ts.map +1 -1
  168. package/dist/setup/validators.js +53 -0
  169. package/dist/setup/validators.js.map +1 -1
  170. package/dist/shared/asm-backend.d.ts +25 -0
  171. package/dist/shared/asm-backend.d.ts.map +1 -0
  172. package/dist/shared/asm-backend.js +107 -0
  173. package/dist/shared/asm-backend.js.map +1 -0
  174. package/dist/shared/aws-constants.d.ts +55 -0
  175. package/dist/shared/aws-constants.d.ts.map +1 -0
  176. package/dist/shared/aws-constants.js +55 -0
  177. package/dist/shared/aws-constants.js.map +1 -0
  178. package/dist/shared/config.d.ts +25 -5
  179. package/dist/shared/config.d.ts.map +1 -1
  180. package/dist/shared/config.js +15 -22
  181. package/dist/shared/config.js.map +1 -1
  182. package/dist/shared/credential-backend.d.ts +28 -0
  183. package/dist/shared/credential-backend.d.ts.map +1 -0
  184. package/dist/shared/credential-backend.js +2 -0
  185. package/dist/shared/credential-backend.js.map +1 -0
  186. package/dist/shared/credentials.d.ts +75 -5
  187. package/dist/shared/credentials.d.ts.map +1 -1
  188. package/dist/shared/credentials.js +141 -24
  189. package/dist/shared/credentials.js.map +1 -1
  190. package/dist/shared/filesystem-backend.d.ts +18 -0
  191. package/dist/shared/filesystem-backend.d.ts.map +1 -0
  192. package/dist/shared/filesystem-backend.js +86 -0
  193. package/dist/shared/filesystem-backend.js.map +1 -0
  194. package/dist/shared/git.js +1 -1
  195. package/dist/shared/git.js.map +1 -1
  196. package/dist/shared/gsm-backend.d.ts +35 -0
  197. package/dist/shared/gsm-backend.d.ts.map +1 -0
  198. package/dist/shared/gsm-backend.js +208 -0
  199. package/dist/shared/gsm-backend.js.map +1 -0
  200. package/dist/shared/remote.d.ts +11 -0
  201. package/dist/shared/remote.d.ts.map +1 -0
  202. package/dist/shared/remote.js +29 -0
  203. package/dist/shared/remote.js.map +1 -0
  204. package/dist/tui/App.d.ts.map +1 -1
  205. package/dist/tui/App.js +22 -7
  206. package/dist/tui/App.js.map +1 -1
  207. package/dist/tui/status-tracker.d.ts +6 -3
  208. package/dist/tui/status-tracker.d.ts.map +1 -1
  209. package/dist/tui/status-tracker.js +14 -2
  210. package/dist/tui/status-tracker.js.map +1 -1
  211. package/dist/webhooks/definitions/github.js +1 -1
  212. package/dist/webhooks/definitions/sentry.js +1 -1
  213. package/dist/webhooks/providers/github.d.ts +1 -1
  214. package/dist/webhooks/providers/github.d.ts.map +1 -1
  215. package/dist/webhooks/providers/github.js +13 -9
  216. package/dist/webhooks/providers/github.js.map +1 -1
  217. package/dist/webhooks/providers/sentry.d.ts +1 -1
  218. package/dist/webhooks/providers/sentry.d.ts.map +1 -1
  219. package/dist/webhooks/providers/sentry.js +12 -9
  220. package/dist/webhooks/providers/sentry.js.map +1 -1
  221. package/dist/webhooks/registry.d.ts +1 -1
  222. package/dist/webhooks/registry.d.ts.map +1 -1
  223. package/dist/webhooks/registry.js +20 -13
  224. package/dist/webhooks/registry.js.map +1 -1
  225. package/dist/webhooks/types.d.ts +16 -6
  226. package/dist/webhooks/types.d.ts.map +1 -1
  227. package/docker/Dockerfile +4 -11
  228. package/package.json +12 -3
  229. package/dist/cli/commands/setup.d.ts.map +0 -1
  230. package/dist/cli/commands/setup.js +0 -60
  231. package/dist/cli/commands/setup.js.map +0 -1
  232. package/dist/docker/container.d.ts +0 -19
  233. package/dist/docker/container.d.ts.map +0 -1
  234. package/dist/docker/container.js +0 -73
  235. package/dist/docker/container.js.map +0 -1
@@ -1,8 +1,8 @@
1
1
  import { mkdirSync, writeFileSync, existsSync } from "fs";
2
2
  import { resolve } from "path";
3
3
  import { stringify as stringifyTOML } from "smol-toml";
4
- import { writeCredential } from "../shared/credentials.js";
5
- export { writeCredential };
4
+ import { writeCredentialField, writeCredentialFields } from "../shared/credentials.js";
5
+ export { writeCredentialField, writeCredentialFields };
6
6
  const PROJECT_AGENTS_MD = `# Action Llama Project
7
7
 
8
8
  This is an Action Llama project. It runs automated development agents triggered by cron schedules or webhooks.
@@ -11,47 +11,382 @@ This is an Action Llama project. It runs automated development agents triggered
11
11
 
12
12
  Each agent is a directory containing:
13
13
 
14
- - \`agent-config.toml\` — credentials, repos, model, schedule, webhooks, params
15
- - \`AGENTS.md\` — the system prompt that defines what the agent does
14
+ - \`agent-config.toml\` — credentials, model, schedule, webhooks, params
15
+ - \`PLAYBOOK.md\` — the system prompt (playbook) that defines what the agent does
16
+ - \`Dockerfile\` (optional) — custom Docker image extending the base \`al-agent:latest\` (e.g. to install extra tools like \`gh\`)
16
17
 
17
18
  ## Creating an Agent
18
19
 
19
20
  1. Create a directory for your agent (e.g. \`my-agent/\`)
20
- 2. Add \`agent-config.toml\` with credentials, repos, model config, and a schedule or webhook trigger
21
- 3. Add \`AGENTS.md\` with the system prompt — instructions the LLM follows each run
22
- 4. Verify with \`npx al status\`
23
- 5. Run with \`npx al start\`
21
+ 2. Add \`agent-config.toml\` with credentials, model config, and a schedule or webhook trigger
22
+ 3. Add \`PLAYBOOK.md\` with the playbookstep-by-step instructions the LLM follows each run
23
+ 4. If running in Docker mode and your agent needs tools beyond what the base image provides (git, curl, openssh-client, node), add a \`Dockerfile\` see Docker Mode section below
24
+ 5. Verify with \`npx al status\`
25
+ 6. Run with \`npx al start\`
24
26
 
25
- ## Example \`agent-config.toml\`
27
+ ## Credential Reference
28
+
29
+ Credentials are managed by the user via \`al doctor\` and stored in \`~/.action-llama-credentials/<type>/<instance>/<field>\`. Reference them in \`credentials\` arrays as \`"type:instance"\` (e.g. \`"github_token:default"\`). The \`:default\` instance suffix can be omitted.
30
+
31
+ | Type | What it is | Fields | Runtime injection | What it enables |
32
+ |------|-----------|--------|-------------------|----------------|
33
+ | \`anthropic_key\` | Anthropic API key or OAuth token | \`token\` | Read directly by the agent SDK (not an env var) | LLM access — required for all agents |
34
+ | \`github_token\` | GitHub PAT (repo + workflow scopes) | \`token\` | \`GITHUB_TOKEN\` and \`GH_TOKEN\` env vars | \`gh\` CLI, \`git\` over HTTPS, GitHub API |
35
+ | \`git_ssh\` | SSH private key + git identity | \`id_rsa\`, \`username\`, \`email\` | SSH key mounted as file; \`GIT_SSH_COMMAND\` configured automatically; \`GIT_AUTHOR_NAME\`/\`GIT_AUTHOR_EMAIL\`/\`GIT_COMMITTER_NAME\`/\`GIT_COMMITTER_EMAIL\` set from \`username\`/\`email\` | \`git clone\`/\`push\` over SSH — **required for pushing to repos** |
36
+ | \`sentry_token\` | Sentry auth token | \`token\` | \`SENTRY_AUTH_TOKEN\` env var | Sentry API via \`curl\` |
37
+ | \`github_webhook_secret\` | Shared HMAC secret | \`secret\` | Used by gateway only (not injected into agents) | Validates GitHub webhook payloads |
38
+ | \`sentry_client_secret\` | Sentry client secret | \`secret\` | Used by gateway only (not injected into agents) | Validates Sentry webhook payloads |
39
+
40
+ **IMPORTANT:** Agents MUST NEVER ask users for credentials directly (API keys, tokens, passwords, etc.). Agents MUST NEVER run \`al doctor\` or interact with the credential system on behalf of the user. If a credential is missing at runtime, the agent should report the error and stop — the user will run \`al doctor\` and \`al start\` themselves.
41
+
42
+ ## Runtime Context
43
+
44
+ Every agent prompt has these XML blocks injected automatically at runtime:
45
+
46
+ ### \`<agent-config>\`
47
+
48
+ JSON object containing the agent's custom \`[params]\` from \`agent-config.toml\`. Example:
49
+
50
+ \`\`\`json
51
+ {"repos":["acme/app"],"triggerLabel":"agent","assignee":"bot-user"}
52
+ \`\`\`
53
+
54
+ (In this example, \`repos\` is a custom param defined in \`[params]\` — not a built-in field.)
55
+
56
+ ### \`<credential-context>\`
57
+
58
+ Lists which env vars and tools are available based on the agent's \`credentials\` array. Includes anti-exfiltration policy. The agent can rely on env vars like \`GITHUB_TOKEN\`, \`GH_TOKEN\`, \`SENTRY_AUTH_TOKEN\` being already set — it does NOT need to set them.
59
+
60
+ ### \`<webhook-trigger>\` (webhook runs only)
61
+
62
+ JSON object with the webhook event details. Only present when the agent is triggered by a webhook (not on scheduled runs). Schema:
63
+
64
+ \`\`\`json
65
+ {
66
+ "source": "github",
67
+ "event": "issues",
68
+ "action": "labeled",
69
+ "repo": "acme/app",
70
+ "number": 42,
71
+ "title": "Add dark mode",
72
+ "body": "Issue description...",
73
+ "url": "https://github.com/acme/app/issues/42",
74
+ "author": "user",
75
+ "assignee": "bot-user",
76
+ "labels": ["agent"],
77
+ "branch": null,
78
+ "comment": null,
79
+ "sender": "user",
80
+ "timestamp": "2025-01-15T10:30:00Z"
81
+ }
82
+ \`\`\`
83
+
84
+ ### \`<agent-trigger>\` (agent-triggered runs only)
85
+
86
+ JSON object with the source agent name and context. Only present when the agent was triggered by another agent via a \`[TRIGGER]\` signal. Schema:
87
+
88
+ \`\`\`json
89
+ {
90
+ "source": "dev",
91
+ "context": "I just opened PR #42 on acme/app. Please review it."
92
+ }
93
+ \`\`\`
94
+
95
+ ### Triggering other agents
96
+
97
+ An agent can trigger another agent by including a \`[TRIGGER]\` block in its output:
98
+
99
+ \`\`\`
100
+ [TRIGGER: reviewer]
101
+ I just opened PR #42. Please review it.
102
+ URL: https://github.com/acme/app/pull/42
103
+ [/TRIGGER]
104
+ \`\`\`
105
+
106
+ The scheduler will run the target agent with the context injected as an \`<agent-trigger>\` block. Rules:
107
+ - An agent cannot trigger itself
108
+ - If the target is busy or does not exist, the trigger is skipped
109
+ - Trigger chains are limited by \`maxTriggerDepth\` in \`config.toml\` (default: 3)
110
+
111
+ ## Webhook Reference
112
+
113
+ ### How webhooks work
114
+
115
+ 1. The gateway receives an HTTP POST from GitHub or Sentry at \`/webhooks/github\` or \`/webhooks/sentry\`
116
+ 2. The payload is validated using secrets loaded from the named credential instance (e.g. HMAC-SHA256 for GitHub using \`github_webhook_secret\`, client secret for Sentry using \`sentry_client_secret\`)
117
+ 3. The gateway matches the event against all agents' \`[[webhooks]]\` entries (AND logic — all specified fields must match; omitted fields are not checked)
118
+ 4. Matching agents are triggered with a \`<webhook-trigger>\` block injected into their prompt
119
+
120
+ ### GitHub webhook fields
121
+
122
+ | Field | Type | Description |
123
+ |-------|------|-------------|
124
+ | \`type\` | string | Provider type — must be \`"github"\` (required) |
125
+ | \`source\` | string | Credential instance name (optional, e.g. \`"MyOrg"\`) |
126
+ | \`repos\` | string[] | Filter to specific repos (owner/repo format) |
127
+ | \`events\` | string[] | Event types: \`issues\`, \`pull_request\`, \`push\`, \`issue_comment\`, etc. |
128
+ | \`actions\` | string[] | Event actions: \`opened\`, \`labeled\`, \`closed\`, \`synchronize\`, etc. |
129
+ | \`labels\` | string[] | Only trigger when the issue/PR has ALL of these labels |
130
+ | \`assignee\` | string | Only trigger when assigned to this user |
131
+ | \`author\` | string | Only trigger for events by this author |
132
+ | \`branches\` | string[] | Only trigger for pushes/PRs on these branches |
133
+
134
+ ### Sentry webhook fields
135
+
136
+ | Field | Type | Description |
137
+ |-------|------|-------------|
138
+ | \`type\` | string | Provider type — must be \`"sentry"\` (required) |
139
+ | \`source\` | string | Credential instance name (optional) |
140
+ | \`resources\` | string[] | Resource types: \`error\`, \`event_alert\`, \`metric_alert\`, \`issue\`, \`comment\` |
141
+
142
+ ### GitHub webhook setup
143
+
144
+ In your GitHub repo settings, add a webhook:
145
+ - **Payload URL:** \`http://<your-host>:8080/webhooks/github\`
146
+ - **Content type:** \`application/json\`
147
+ - **Secret:** the same secret stored as the \`github_webhook_secret\` credential
148
+
149
+ ### TOML syntax for webhooks
150
+
151
+ Each webhook is a separate \`[[webhooks]]\` block (double brackets = array of tables):
152
+
153
+ \`\`\`toml
154
+ # Each [[webhooks]] is a separate array entry
155
+ [[webhooks]]
156
+ type = "github"
157
+ repos = ["acme/app"]
158
+ events = ["issues"]
159
+ actions = ["labeled"]
160
+ labels = ["agent"]
161
+
162
+ [[webhooks]]
163
+ type = "github"
164
+ source = "MyOrg" # optional — credential instance name
165
+ repos = ["my-org/other-repo"]
166
+ events = ["pull_request"]
167
+
168
+ [[webhooks]]
169
+ type = "sentry"
170
+ resources = ["error", "event_alert"]
171
+ \`\`\`
172
+
173
+ \`type\` is the provider type (required). \`source\` is the credential instance name (optional — defaults to \`"default"\`).
174
+
175
+ ## \`agent-config.toml\` Complete Reference
176
+
177
+ The config file uses TOML syntax. The agent name is derived from the directory name — do not include it in the config.
178
+
179
+ ### Minimal example (schedule only)
26
180
 
27
181
  \`\`\`toml
28
- credentials = ["anthropic-key", "github-token"]
182
+ credentials = ["github_token:default", "git_ssh:default"]
183
+ schedule = "*/5 * * * *"
184
+
185
+ [params]
29
186
  repos = ["your-org/your-repo"]
187
+ \`\`\`
188
+
189
+ 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 (e.g. use a different model or thinking level for that specific agent).
190
+
191
+ ### Full example (schedule + webhooks + params + model override)
192
+
193
+ \`\`\`toml
194
+ credentials = ["github_token:default", "git_ssh:default", "sentry_token:default"]
30
195
  schedule = "*/5 * * * *"
31
196
 
197
+ # Optional: override the project default model for this agent
32
198
  [model]
33
199
  provider = "anthropic"
34
200
  model = "claude-sonnet-4-20250514"
35
201
  thinkingLevel = "medium"
36
202
  authType = "api_key"
203
+
204
+ [[webhooks]]
205
+ type = "github"
206
+ repos = ["acme/app"]
207
+ events = ["issues"]
208
+ actions = ["labeled"]
209
+ labels = ["agent"]
210
+
211
+ [[webhooks]]
212
+ type = "sentry"
213
+ resources = ["error", "event_alert"]
214
+
215
+ [params]
216
+ repos = ["acme/app", "acme/api"]
217
+ triggerLabel = "agent"
218
+ assignee = "bot-user"
219
+ sentryOrg = "acme"
220
+ sentryProjects = ["web-app", "api"]
221
+ \`\`\`
222
+
223
+ ### Field reference
224
+
225
+ | Field | Type | Required | Description |
226
+ |-------|------|----------|-------------|
227
+ | \`credentials\` | string[] | Yes | Credential refs as \`"type:instance"\` (see Credential Reference above) |
228
+ | \`schedule\` | string | No* | Cron expression (e.g. "*/5 * * * *") |
229
+ | \`model\` | table | No | LLM model config — omit to inherit from project \`config.toml\` |
230
+ | \`model.provider\` | string | Yes* | "anthropic" or "openai" |
231
+ | \`model.model\` | string | Yes* | Model ID (e.g. "claude-sonnet-4-20250514") |
232
+ | \`model.thinkingLevel\` | string | Yes* | off \\| minimal \\| low \\| medium \\| high \\| xhigh |
233
+ | \`model.authType\` | string | Yes* | api_key \\| oauth_token \\| pi_auth |
234
+ | \`webhooks[].type\` | string | Yes | Provider type: "github" or "sentry" |
235
+ | \`webhooks[].source\` | string | No | Credential instance name (defaults to "default") |
236
+ | \`webhooks[].repos\` | string[] | No | Filter to specific repos |
237
+ | \`webhooks[].events\` | string[] | No | GitHub event types: issues, pull_request, push |
238
+ | \`webhooks[].actions\` | string[] | No | GitHub actions: opened, labeled, closed |
239
+ | \`webhooks[].labels\` | string[] | No | Only trigger for issues/PRs with these labels |
240
+ | \`webhooks[].resources\` | string[] | No | Sentry resources: error, event_alert, metric_alert, issue, comment |
241
+ | \`params.*\` | any | No | Custom key-value pairs injected into the prompt |
242
+
243
+ *At least one of \`schedule\` or \`webhooks\` is required. *Required within \`[model]\` if the agent defines its own model block.
244
+
245
+ ### TOML syntax reminders
246
+
247
+ - Strings: \`key = "value"\`
248
+ - Arrays: \`key = ["a", "b"]\`
249
+ - Tables (objects): \`[tableName]\` on its own line, followed by key-value pairs
250
+ - Array of tables: \`[[arrayName]]\` on its own line — each block is one entry in the array
251
+ - Comments: \`# comment\`
252
+
253
+ ## Example Playbook
254
+
255
+ **Agent playbooks must be detailed and prescriptive with step-by-step commands. Copy this example and customize rather than writing from scratch.**
256
+
257
+ The following is a complete, working PLAYBOOK.md for a developer agent. Use it as a template for all new agents:
258
+
259
+ \`\`\`markdown
260
+ # Developer Agent
261
+
262
+ You are a developer agent. Your job is to pick up GitHub issues and implement the requested changes.
263
+
264
+ Your configuration is in the \\\`<agent-config>\\\` block at the start of your prompt.
265
+ Use those values for repos, triggerLabel, and assignee.
266
+
267
+ \\\`GITHUB_TOKEN\\\` is already set in your environment. Use \\\`gh\\\` CLI and \\\`git\\\` directly.
268
+ (Note: \\\`gh\\\` is not in the base Docker image — this agent needs a custom Dockerfile that installs it. See Docker Mode section.)
269
+
270
+ **You MUST complete ALL steps below.** Do not stop after reading the issue — you must implement, commit, push, and open a PR.
271
+
272
+ ## Setup — ensure labels exist
273
+
274
+ Before looking for work, ensure the required labels exist on each repo. Run the following for each repo (these are idempotent — they succeed silently if the label already exists):
275
+
276
+ \\\`\\\`\\\`
277
+ gh label create "<triggerLabel>" --repo <repo> --color 0E8A16 --description "Trigger label for dev agent" --force
278
+ gh label create "in-progress" --repo <repo> --color FBCA04 --description "Agent is working on this" --force
279
+ gh label create "agent-completed" --repo <repo> --color 1D76DB --description "Agent has opened a PR" --force
280
+ \\\`\\\`\\\`
281
+
282
+ ## Finding work
283
+
284
+ **Webhook trigger:** When you receive a \\\`<webhook-trigger>\\\` block, the issue details are already in the trigger context. Check the issue's labels and assignee against your \\\`triggerLabel\\\` and \\\`assignee\\\` params. If the issue matches (has your trigger label and is assigned to your assignee), proceed with implementation. If it does not match, respond \\\`[SILENT]\\\` and stop.
285
+
286
+ **Scheduled trigger:** Run \\\`gh issue list --repo <repo> --label <triggerLabel> --assignee <assignee> --state open --json number,title,body,comments,labels --limit 1\\\`. If empty, respond \\\`[SILENT]\\\` and stop.
287
+
288
+ ## Workflow
289
+
290
+ 1. **Claim the issue** — run \\\`gh issue edit <number> --repo <repo> --add-label in-progress\\\` to mark it as claimed.
291
+
292
+ 2. **Clone and branch** — run \\\`git clone git@github.com:<repo>.git /workspace/repo && cd /workspace/repo && git checkout -b agent/<number>\\\`.
293
+
294
+ 3. **Understand the issue** — read the title, body, and comments. Note file paths, acceptance criteria, and linked issues.
295
+
296
+ 4. **Read project conventions** — in the repo, read \\\`PLAYBOOK.md\\\`, \\\`CLAUDE.md\\\`, \\\`CONTRIBUTING.md\\\`, and \\\`README.md\\\` if they exist. Follow any conventions found there.
297
+
298
+ 5. **Implement changes** — work in the repo. Make the minimum necessary changes, follow existing patterns, and write or update tests if the project has a test suite.
299
+
300
+ 6. **Validate** — run the project's test suite and linters (e.g., \\\`npm test\\\`). Fix failures before proceeding.
301
+
302
+ 7. **Commit** — \\\`git add -A && git commit -m "fix: <description> (closes #<number>)"\\\`
303
+
304
+ 8. **Push** — \\\`git push -u origin agent/<number>\\\`
305
+
306
+ 9. **Create a PR** — run \\\`gh pr create --repo <repo> --head agent/<number> --base main --title "<title>" --body "Closes #<number>\\\\n\\\\n<description>"\\\`.
307
+
308
+ 10. **Comment on the issue** — run \\\`gh issue comment <number> --repo <repo> --body "PR created: <pr_url>"\\\`.
309
+
310
+ 11. **Mark done** — run \\\`gh issue edit <number> --repo <repo> --remove-label in-progress --add-label agent-completed\\\`.
311
+
312
+ ## Rules
313
+
314
+ - Work on exactly ONE issue per run
315
+ - Never modify files outside the repo directory
316
+ - **You MUST complete steps 7-11.** Do not stop early.
317
+ - If tests fail after 2 attempts, create the PR anyway with a note about failing tests
318
+ - If the issue is unclear, comment asking for clarification and stop
319
+ \`\`\`
320
+
321
+ ## Docker Mode
322
+
323
+ Docker container isolation is enabled by default. Each agent run launches an isolated container with a read-only root filesystem, dropped capabilities, non-root user, and resource limits. Use \`--no-docker\` to disable it for development.
324
+
325
+ ### Base image
326
+
327
+ The base image (\`al-agent:latest\`) is built automatically on first run. It includes Node.js, git, curl, openssh-client, and ca-certificates — the minimum needed for any agent.
328
+
329
+ ### Custom agent images
330
+
331
+ If your agent needs extra tools (e.g. \`gh\` CLI, Python, \`jq\`), add a \`Dockerfile\` to the agent directory that extends the base image:
332
+
333
+ \`\`\`dockerfile
334
+ FROM al-agent:latest
335
+ USER root
336
+ RUN apt-get update && apt-get install -y --no-install-recommends gh && rm -rf /var/lib/apt/lists/*
337
+ USER node
37
338
  \`\`\`
38
339
 
39
- ## Credentials
340
+ Agent images are built automatically on startup. If no \`Dockerfile\` is present, the agent uses the base image.
341
+
342
+ ### Container filesystem
343
+
344
+ | Path | Mode | Contents |
345
+ |------|------|----------|
346
+ | \`/app\` | read-only | Action Llama application + node_modules |
347
+ | \`/credentials\` | read-only | Mounted credential files (\`/<type>/<instance>/<field>\`) |
348
+ | \`/workspace\` | read-write (tmpfs, 2GB) | Working directory — repos are cloned here |
349
+ | \`/tmp\` | read-write (tmpfs, 512MB) | Temporary files |
350
+ | \`/home/node\` | read-write (tmpfs, 64MB) | User home — \`.ssh/\` for SSH keys |
351
+
352
+ ### Docker config options
353
+
354
+ | Key | Default | Description |
355
+ |-----|---------|-------------|
356
+ | \`local.enabled\` | \`true\` | Enable Docker container isolation |
357
+ | \`local.image\` | \`"al-agent:latest"\` | Base Docker image name |
358
+ | \`local.memory\` | \`"4g"\` | Memory limit per container |
359
+ | \`local.cpus\` | \`2\` | CPU limit per container |
360
+ | \`local.timeout\` | \`3600\` | Max container runtime in seconds |
361
+
362
+ ## Running Agents
40
363
 
41
- Credentials are managed by the user via \`al setup\` and stored in \`~/.action-llama-credentials/\`.
364
+ Start all agents with \`al start\` (or \`npx al start\`). This starts the scheduler which runs all discovered agents on their configured schedules/webhooks. There is no per-agent start command — \`al start\` always starts the entire project.
42
365
 
43
- **IMPORTANT:** Agents MUST NEVER ask users for credentials directly (API keys, tokens, passwords, etc.). Agents MUST NEVER run \`al setup\` or interact with the credential system on behalf of the user. If a credential is missing at runtime, the agent should report the error and stop — the user will run \`al setup\` and \`al start\` themselves.
366
+ ### Automatic re-runs
44
367
 
45
- ## Documentation
368
+ When a scheduled agent completes productive work (i.e. it does not respond with \`[SILENT]\`), the scheduler immediately re-runs it. This continues until the agent reports \`[SILENT]\` (no more work), hits an error, or reaches the \`maxReruns\` limit. This way an agent drains its work queue without waiting for the next cron tick.
46
369
 
47
- Full docs: https://github.com/action-llama/action-llama/tree/main/docs
370
+ Set \`maxReruns\` in \`config.toml\` to control the limit (default: 10):
48
371
 
49
- - [Creating Agents](https://github.com/action-llama/action-llama/blob/main/docs/creating-agents.md)
50
- - [agent-config.toml Reference](https://github.com/action-llama/action-llama/blob/main/docs/agent-config-reference.md)
51
- - [CLI Commands](https://github.com/action-llama/action-llama/blob/main/docs/commands.md)
52
- - [Credentials](https://github.com/action-llama/action-llama/blob/main/docs/credentials.md)
53
- - [Webhooks](https://github.com/action-llama/action-llama/blob/main/docs/webhooks.md)
54
- - [Examples](https://github.com/action-llama/action-llama/tree/main/docs/examples)
372
+ \`\`\`toml
373
+ maxReruns = 5
374
+ maxTriggerDepth = 3 # max depth for agent-to-agent trigger chains (default: 3)
375
+ \`\`\`
376
+
377
+ Webhook-triggered and agent-triggered runs do not re-run — they respond to a single event.
378
+
379
+ ## Further Documentation
380
+
381
+ Full documentation is available on GitHub:
382
+
383
+ - [Creating Agents](https://github.com/Action-Llama/action-llama/blob/main/docs/creating-agents.md)
384
+ - [agent-config.toml Reference](https://github.com/Action-Llama/action-llama/blob/main/docs/agent-config-reference.md)
385
+ - [Credentials](https://github.com/Action-Llama/action-llama/blob/main/docs/credentials.md)
386
+ - [Webhooks](https://github.com/Action-Llama/action-llama/blob/main/docs/webhooks.md)
387
+ - [Docker](https://github.com/Action-Llama/action-llama/blob/main/docs/docker.md) — custom Dockerfiles, standalone images, troubleshooting
388
+ - [CLI Commands](https://github.com/Action-Llama/action-llama/blob/main/docs/commands.md)
389
+ - [Example Agents](https://github.com/Action-Llama/action-llama/blob/main/docs/examples/dev-agent.md) — dev, reviewer, devops
55
390
  `;
56
391
  export function scaffoldAgent(projectPath, agent) {
57
392
  const agentPath = resolve(projectPath, agent.name);
@@ -59,10 +394,10 @@ export function scaffoldAgent(projectPath, agent) {
59
394
  // Strip `name` before serializing — it's derived from the directory name
60
395
  const { name: _, ...configToWrite } = agent.config;
61
396
  writeFileSync(resolve(agentPath, "agent-config.toml"), stringifyTOML(configToWrite) + "\n");
62
- // Write a stub AGENTS.md if none exists
63
- const agentsMdPath = resolve(agentPath, "AGENTS.md");
64
- if (!existsSync(agentsMdPath)) {
65
- writeFileSync(agentsMdPath, `# ${agent.name} Agent\n\nCustom agent.\n`);
397
+ // Write a stub PLAYBOOK.md if none exists
398
+ const playbookPath = resolve(agentPath, "PLAYBOOK.md");
399
+ if (!existsSync(playbookPath)) {
400
+ writeFileSync(playbookPath, `# ${agent.name} Agent\n\nCustom agent.\n`);
66
401
  }
67
402
  }
68
403
  export function scaffoldProject(projectPath, globalConfig, agents = [], projectName) {
@@ -82,7 +417,7 @@ export function scaffoldProject(projectPath, globalConfig, agents = [], projectN
82
417
  }
83
418
  // Write global config only if non-empty
84
419
  if (Object.keys(globalConfig).length > 0) {
85
- writeFileSync(resolve(projectPath, "config.json"), JSON.stringify(globalConfig, null, 2) + "\n");
420
+ writeFileSync(resolve(projectPath, "config.toml"), stringifyTOML(globalConfig) + "\n");
86
421
  }
87
422
  for (const agent of agents) {
88
423
  scaffoldAgent(projectPath, agent);
@@ -97,7 +432,14 @@ export function scaffoldProject(projectPath, globalConfig, agents = [], projectN
97
432
  // Create .gitignore
98
433
  const gitignorePath = resolve(projectPath, ".gitignore");
99
434
  if (!existsSync(gitignorePath)) {
100
- writeFileSync(gitignorePath, ".workspace/\nnode_modules/\n");
435
+ writeFileSync(gitignorePath, [
436
+ "node_modules/",
437
+ ".workspace/",
438
+ ".al/",
439
+ "*.log",
440
+ ".DS_Store",
441
+ "",
442
+ ].join("\n"));
101
443
  }
102
444
  }
103
445
  //# sourceMappingURL=scaffold.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"scaffold.js","sourceRoot":"","sources":["../../src/setup/scaffold.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,aAAa,EAAE,UAAU,EAAE,MAAM,IAAI,CAAC;AAC1D,OAAO,EAAE,OAAO,EAAE,MAAM,MAAM,CAAC;AAC/B,OAAO,EAAE,SAAS,IAAI,aAAa,EAAE,MAAM,WAAW,CAAC;AAEvD,OAAO,EAAE,eAAe,EAAE,MAAM,0BAA0B,CAAC;AAE3D,OAAO,EAAE,eAAe,EAAE,CAAC;AAE3B,MAAM,iBAAiB,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAiDzB,CAAC;AAOF,MAAM,UAAU,aAAa,CAAC,WAAmB,EAAE,KAAoB;IACrE,MAAM,SAAS,GAAG,OAAO,CAAC,WAAW,EAAE,KAAK,CAAC,IAAI,CAAC,CAAC;IACnD,SAAS,CAAC,SAAS,EAAE,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC,CAAC;IAE1C,yEAAyE;IACzE,MAAM,EAAE,IAAI,EAAE,CAAC,EAAE,GAAG,aAAa,EAAE,GAAG,KAAK,CAAC,MAAM,CAAC;IACnD,aAAa,CACX,OAAO,CAAC,SAAS,EAAE,mBAAmB,CAAC,EACvC,aAAa,CAAC,aAAwC,CAAC,GAAG,IAAI,CAC/D,CAAC;IAEF,wCAAwC;IACxC,MAAM,YAAY,GAAG,OAAO,CAAC,SAAS,EAAE,WAAW,CAAC,CAAC;IACrD,IAAI,CAAC,UAAU,CAAC,YAAY,CAAC,EAAE,CAAC;QAC9B,aAAa,CAAC,YAAY,EAAE,KAAK,KAAK,CAAC,IAAI,2BAA2B,CAAC,CAAC;IAC1E,CAAC;AACH,CAAC;AAED,MAAM,UAAU,eAAe,CAC7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AAO,CAAC,WAAW,EAAE,aAAa,CAAC,EACnC,aAAa,CAAC,YAAuC,CAAC,GAAG,IAAI,CAC9D,CAAC;IACJ,CAAC;IAED,KAAK,MAAM,KAAK,IAAI,MAAM,EAAE,CAAC;QAC3B,aAAa,CAAC,WAAW,EAAE,KAAK,CAAC,CAAC;IACpC,CAAC;IAED,kDAAkD;IAClD,MAAM,YAAY,GAAG,OAAO,CAAC,WAAW,EAAE,WAAW,CAAC,CAAC;IACvD,IAAI,CAAC,UAAU,CAAC,YAAY,CAAC,EAAE,CAAC;QAC9B,aAAa,CAAC,YAAY,EAAE,iBAAiB,CAAC,CAAC;IACjD,CAAC;IAED,6BAA6B;IAC7B,SAAS,CAAC,OAAO,CAAC,WAAW,EAAE,YAAY,CAAC,EAAE,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC,CAAC;IAEnE,oBAAoB;IACpB,MAAM,aAAa,GAAG,OAAO,CAAC,WAAW,EAAE,YAAY,CAAC,CAAC;IACzD,IAAI,CAAC,UAAU,CAAC,aAAa,CAAC,EAAE,CAAC;QAC/B,aAAa,CAAC,aAAa,EAAE;YAC3B,eAAe;YACf,aAAa;YACb,MAAM;YACN,OAAO;YACP,WAAW;YACX,EAAE;SACH,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC;IAChB,CAAC;AACH,CAAC"}
@@ -20,4 +20,18 @@ export declare function validateSentryProjects(token: string, org: string): Prom
20
20
  }>;
21
21
  export declare function validateAnthropicApiKey(key: string): Promise<boolean>;
22
22
  export declare function validateOAuthTokenFormat(token: string): boolean;
23
+ export declare function validateNetlifyToken(token: string): Promise<{
24
+ user: string;
25
+ fullName: string | undefined;
26
+ }>;
27
+ export declare function validateXTwitterToken(bearerToken: string): Promise<{
28
+ user: string;
29
+ name: string;
30
+ id: string;
31
+ }>;
32
+ export declare function validateBugsnagToken(token: string): Promise<{
33
+ user: string;
34
+ name: string;
35
+ id: string;
36
+ }>;
23
37
  //# sourceMappingURL=validators.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"validators.d.ts","sourceRoot":"","sources":["../../src/setup/validators.ts"],"names":[],"mappings":"AAAA,wBAAsB,mBAAmB,CAAC,KAAK,EAAE,MAAM;;;;;;;GAetD;AAED,wBAAsB,mBAAmB,CAAC,KAAK,EAAE,MAAM;;cAKJ,MAAM;cAAQ,MAAM;;GAEtE;AAED,wBAAsB,sBAAsB,CAAC,KAAK,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM;;cAKhB,MAAM;cAAQ,MAAM;;GAE1E;AAED,wBAAsB,uBAAuB,CAAC,GAAG,EAAE,MAAM,oBAmBxD;AAED,wBAAgB,wBAAwB,CAAC,KAAK,EAAE,MAAM,WAQrD"}
1
+ {"version":3,"file":"validators.d.ts","sourceRoot":"","sources":["../../src/setup/validators.ts"],"names":[],"mappings":"AAAA,wBAAsB,mBAAmB,CAAC,KAAK,EAAE,MAAM;;;;;;;GAetD;AAED,wBAAsB,mBAAmB,CAAC,KAAK,EAAE,MAAM;;cAKJ,MAAM;cAAQ,MAAM;;GAEtE;AAED,wBAAsB,sBAAsB,CAAC,KAAK,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM;;cAKhB,MAAM;cAAQ,MAAM;;GAE1E;AAED,wBAAsB,uBAAuB,CAAC,GAAG,EAAE,MAAM,oBAmBxD;AAED,wBAAgB,wBAAwB,CAAC,KAAK,EAAE,MAAM,WAQrD;AAED,wBAAsB,oBAAoB,CAAC,KAAK,EAAE,MAAM;;;GAmBvD;AAED,wBAAsB,qBAAqB,CAAC,WAAW,EAAE,MAAM;;;;GAiB9D;AAED,wBAAsB,oBAAoB,CAAC,KAAK,EAAE,MAAM;;;;GAoBvD"}
@@ -58,4 +58,57 @@ export function validateOAuthTokenFormat(token) {
58
58
  }
59
59
  return true;
60
60
  }
61
+ export async function validateNetlifyToken(token) {
62
+ const res = await fetch("https://api.netlify.com/api/v1/user", {
63
+ headers: {
64
+ Authorization: `Bearer ${token}`,
65
+ "Content-Type": "application/json"
66
+ },
67
+ });
68
+ if (!res.ok) {
69
+ const body = await res.text();
70
+ throw new Error(`Netlify auth failed (${res.status}): ${body}`);
71
+ }
72
+ const user = (await res.json());
73
+ return {
74
+ user: user.email,
75
+ fullName: user.full_name,
76
+ };
77
+ }
78
+ export async function validateXTwitterToken(bearerToken) {
79
+ const res = await fetch("https://api.x.com/2/users/me", {
80
+ headers: {
81
+ Authorization: `Bearer ${bearerToken}`,
82
+ "Content-Type": "application/json"
83
+ },
84
+ });
85
+ if (!res.ok) {
86
+ const body = await res.text();
87
+ throw new Error(`X (Twitter) API token validation failed (${res.status}): ${body}`);
88
+ }
89
+ const user = (await res.json());
90
+ return {
91
+ user: user.data.username,
92
+ name: user.data.name,
93
+ id: user.data.id,
94
+ };
95
+ }
96
+ export async function validateBugsnagToken(token) {
97
+ const res = await fetch("https://api.bugsnag.com/user", {
98
+ headers: {
99
+ Authorization: `token ${token}`,
100
+ "Content-Type": "application/json"
101
+ },
102
+ });
103
+ if (!res.ok) {
104
+ const body = await res.text();
105
+ throw new Error(`Bugsnag auth failed (${res.status}): ${body}`);
106
+ }
107
+ const user = (await res.json());
108
+ return {
109
+ user: user.email,
110
+ name: user.name,
111
+ id: user.id,
112
+ };
113
+ }
61
114
  //# sourceMappingURL=validators.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"validators.js","sourceRoot":"","sources":["../../src/setup/validators.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,KAAK,UAAU,mBAAmB,CAAC,KAAa;IACrD,MAAM,OAAO,GAAG,EAAE,aAAa,EAAE,UAAU,KAAK,EAAE,EAAE,MAAM,EAAE,6BAA6B,EAAE,CAAC;IAE5F,MAAM,OAAO,GAAG,MAAM,KAAK,CAAC,6BAA6B,EAAE,EAAE,OAAO,EAAE,CAAC,CAAC;IACxE,IAAI,CAAC,OAAO,CAAC,EAAE;QAAE,MAAM,IAAI,KAAK,CAAC,uBAAuB,OAAO,CAAC,MAAM,EAAE,CAAC,CAAC;IAC1E,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KAAK,CAAC,4CAA4C,GAAG,CAAC,MAAM,MAAM,IAAI,EAAE,CAAC,CAAC;IACtF,CAAC;IACD,MAAM,IAAI,GAAG,CAAC,MAAM,GAAG,CAAC,IAAI,EAAE,CAA6D,CAAC;IAC5F,OAAO;QACL,IAAI,EAAE,IAAI,CAAC,IAAI,CAAC,QAAQ;QACxB,IAAI,EAAE,IAAI,CAAC,IAAI,CAAC,IAAI;QACpB,EAAE,EAAE,IAAI,CAAC,IAAI,CAAC,EAAE;KACjB,CAAC;AACJ,CAAC;AAED,MAAM,CAAC,KAAK,UAAU,oBAAoB,CAAC,KAAa;IACtD,MAAM,GAAG,GAAG,MAAM,KAAK,CAAC,8BAA8B,EAAE;QACtD,OAAO,EAAE;YACP,aAAa,EAAE,SAAS,KAAK,EAAE;YAC/B,cAAc,EAAE,kBAAkB;SACnC;KACF,CAAC,CAAC;IAEH,IAAI,CAAC,GAAG,CAAC,EAAE,EAAE,CAAC;QACZ,MAAM,IAAI,GAAG,MAAM,GAAG,CAAC,IAAI,EAAE,CAAC;QAC9B,MAAM,IAAI,KAAK,CAAC,wBAAwB,GAAG,CAAC,MAAM,MAAM,IAAI,EAAE,CAAC,CAAC;IAClE,CAAC;IAED,MAAM,IAAI,GAAG,CAAC,MAAM,GAAG,CAAC,IAAI,EAAE,CAAgD,CAAC;IAE/E,OAAO;QACL,IAAI,EAAE,IAAI,CAAC,KAAK;QAChB,IAAI,EAAE,IAAI,CAAC,IAAI;QACf,EAAE,EAAE,IAAI,CAAC,EAAE;KACZ,CAAC;AACJ,CAAC"}
@@ -0,0 +1,25 @@
1
+ import type { CredentialBackend, CredentialEntry } from "./credential-backend.js";
2
+ /**
3
+ * AWS Secrets Manager credential backend.
4
+ * Maps type/instance/field -> secret name: <prefix>/<type>/<instance>/<field>
5
+ *
6
+ * Uses the AWS SDK v3 with the default credential provider chain:
7
+ * 1. Environment variables (AWS_ACCESS_KEY_ID / AWS_SECRET_ACCESS_KEY)
8
+ * 2. Shared credentials file (~/.aws/credentials)
9
+ * 3. SSO / IAM instance roles
10
+ */
11
+ export declare class AwsSecretsManagerBackend implements CredentialBackend {
12
+ private client;
13
+ private prefix;
14
+ constructor(awsRegion: string, secretPrefix?: string);
15
+ private secretName;
16
+ private parseSecretName;
17
+ read(type: string, instance: string, field: string): Promise<string | undefined>;
18
+ write(type: string, instance: string, field: string, value: string): Promise<void>;
19
+ list(): Promise<CredentialEntry[]>;
20
+ exists(type: string, instance: string): Promise<boolean>;
21
+ readAll(type: string, instance: string): Promise<Record<string, string> | undefined>;
22
+ writeAll(type: string, instance: string, fields: Record<string, string>): Promise<void>;
23
+ listInstances(type: string): Promise<string[]>;
24
+ }
25
+ //# sourceMappingURL=asm-backend.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"asm-backend.d.ts","sourceRoot":"","sources":["../../src/shared/asm-backend.ts"],"names":[],"mappings":"AAOA,OAAO,KAAK,EAAE,iBAAiB,EAAE,eAAe,EAAE,MAAM,yBAAyB,CAAC;AAGlF;;;;;;;;GAQG;AACH,qBAAa,wBAAyB,YAAW,iBAAiB;IAChE,OAAO,CAAC,MAAM,CAAuB;IACrC,OAAO,CAAC,MAAM,CAAS;gBAEX,SAAS,EAAE,MAAM,EAAE,YAAY,SAAsC;IAKjF,OAAO,CAAC,UAAU;IAIlB,OAAO,CAAC,eAAe;IAMjB,IAAI,CAAC,IAAI,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,GAAG,SAAS,CAAC;IAYhF,KAAK,CAAC,IAAI,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;IAalF,IAAI,IAAI,OAAO,CAAC,eAAe,EAAE,CAAC;IAwBlC,MAAM,CAAC,IAAI,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC;IAKxD,OAAO,CAAC,IAAI,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,GAAG,SAAS,CAAC;IAapF,QAAQ,CAAC,IAAI,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,GAAG,OAAO,CAAC,IAAI,CAAC;IAMvF,aAAa,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,EAAE,CAAC;CAQrD"}