milaidy 1.0.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 (253) hide show
  1. package/LICENSE +8 -0
  2. package/README.md +538 -0
  3. package/dist/argv-CfSowvEA.js +63 -0
  4. package/dist/config-B-mboG4v.js +4 -0
  5. package/dist/eliza-CPJjgw-e.js +1491 -0
  6. package/dist/eliza.js +2192 -0
  7. package/dist/entry.js +232 -0
  8. package/dist/index.js +209 -0
  9. package/dist/links-BFKlWqSe.js +15 -0
  10. package/dist/paths-D_yh1DEJ.js +69 -0
  11. package/dist/plugins-cli-B7kSre2c.js +134 -0
  12. package/dist/program-6KwWwKKh.js +510 -0
  13. package/dist/register.agents-CPVmSjMG.js +17 -0
  14. package/dist/register.browser-B2ooXxNx.js +15 -0
  15. package/dist/register.channels-CMYQ6K6Y.js +42 -0
  16. package/dist/register.cron-D91lY1_Y.js +9 -0
  17. package/dist/register.devices-rU5I5L_y.js +13 -0
  18. package/dist/register.gateway-82SLAvw3.js +22 -0
  19. package/dist/register.hooks-B_XTBEkt.js +9 -0
  20. package/dist/register.logs-BgEGcPd8.js +10 -0
  21. package/dist/register.models-BJt9eVgZ.js +26 -0
  22. package/dist/register.nodes-B5xY1s8a.js +9 -0
  23. package/dist/register.skills-SFQqYIhg.js +10 -0
  24. package/dist/register.subclis-uF_AsbWR.js +187 -0
  25. package/dist/run-main-XODklzS-.js +56 -0
  26. package/dist/theme-DBvtuGeq.js +36 -0
  27. package/dist/utils-C1AUpp_V.js +42 -0
  28. package/dist/version-Cpn3yr5D.js +26 -0
  29. package/dist/workspace-Co3Wul2D.js +206 -0
  30. package/dist/workspace-DCA6MNVK.js +350 -0
  31. package/docs/.i18n/README.md +31 -0
  32. package/docs/.i18n/glossary.zh-CN.json +210 -0
  33. package/docs/.i18n/zh-CN.tm.jsonl +1329 -0
  34. package/docs/CNAME +1 -0
  35. package/docs/automation/cron-jobs.md +468 -0
  36. package/docs/automation/cron-vs-heartbeat.md +254 -0
  37. package/docs/automation/gmail-pubsub.md +256 -0
  38. package/docs/automation/poll.md +69 -0
  39. package/docs/automation/webhook.md +163 -0
  40. package/docs/bedrock.md +176 -0
  41. package/docs/brave-search.md +41 -0
  42. package/docs/broadcast-groups.md +442 -0
  43. package/docs/cli/acp.md +170 -0
  44. package/docs/cli/agent.md +24 -0
  45. package/docs/cli/agents.md +75 -0
  46. package/docs/cli/approvals.md +50 -0
  47. package/docs/cli/browser.md +107 -0
  48. package/docs/cli/channels.md +79 -0
  49. package/docs/cli/config.md +50 -0
  50. package/docs/cli/configure.md +33 -0
  51. package/docs/cli/cron.md +42 -0
  52. package/docs/cli/dashboard.md +16 -0
  53. package/docs/cli/devices.md +67 -0
  54. package/docs/cli/directory.md +63 -0
  55. package/docs/cli/dns.md +23 -0
  56. package/docs/cli/docs.md +15 -0
  57. package/docs/cli/doctor.md +41 -0
  58. package/docs/cli/gateway.md +199 -0
  59. package/docs/cli/health.md +21 -0
  60. package/docs/cli/hooks.md +291 -0
  61. package/docs/cli/index.md +1029 -0
  62. package/docs/cli/logs.md +24 -0
  63. package/docs/cli/memory.md +45 -0
  64. package/docs/cli/message.md +239 -0
  65. package/docs/cli/models.md +79 -0
  66. package/docs/cli/node.md +112 -0
  67. package/docs/cli/nodes.md +73 -0
  68. package/docs/cli/onboard.md +29 -0
  69. package/docs/cli/pairing.md +21 -0
  70. package/docs/cli/plugins.md +62 -0
  71. package/docs/cli/reset.md +17 -0
  72. package/docs/cli/sandbox.md +152 -0
  73. package/docs/cli/security.md +26 -0
  74. package/docs/cli/sessions.md +16 -0
  75. package/docs/cli/setup.md +29 -0
  76. package/docs/cli/skills.md +26 -0
  77. package/docs/cli/status.md +26 -0
  78. package/docs/cli/system.md +60 -0
  79. package/docs/cli/tui.md +23 -0
  80. package/docs/cli/uninstall.md +17 -0
  81. package/docs/cli/update.md +98 -0
  82. package/docs/cli/voicecall.md +34 -0
  83. package/docs/cli/webhooks.md +25 -0
  84. package/docs/concepts/agent-loop.md +146 -0
  85. package/docs/concepts/agent-workspace.md +229 -0
  86. package/docs/concepts/agent.md +122 -0
  87. package/docs/concepts/architecture.md +129 -0
  88. package/docs/concepts/channel-routing.md +114 -0
  89. package/docs/concepts/compaction.md +61 -0
  90. package/docs/concepts/context.md +159 -0
  91. package/docs/concepts/features.md +53 -0
  92. package/docs/concepts/group-messages.md +84 -0
  93. package/docs/concepts/groups.md +373 -0
  94. package/docs/concepts/markdown-formatting.md +130 -0
  95. package/docs/concepts/memory.md +546 -0
  96. package/docs/concepts/messages.md +154 -0
  97. package/docs/concepts/model-failover.md +149 -0
  98. package/docs/concepts/model-providers.md +315 -0
  99. package/docs/concepts/models.md +208 -0
  100. package/docs/concepts/multi-agent.md +376 -0
  101. package/docs/concepts/oauth.md +145 -0
  102. package/docs/concepts/plugins.md +454 -0
  103. package/docs/concepts/presence.md +102 -0
  104. package/docs/concepts/queue.md +89 -0
  105. package/docs/concepts/retry.md +69 -0
  106. package/docs/concepts/secrets.md +300 -0
  107. package/docs/concepts/session-pruning.md +122 -0
  108. package/docs/concepts/session-tool.md +193 -0
  109. package/docs/concepts/session.md +188 -0
  110. package/docs/concepts/sessions.md +10 -0
  111. package/docs/concepts/skills.md +392 -0
  112. package/docs/concepts/streaming.md +135 -0
  113. package/docs/concepts/system-prompt.md +114 -0
  114. package/docs/concepts/timezone.md +91 -0
  115. package/docs/concepts/typebox.md +289 -0
  116. package/docs/concepts/typing-indicators.md +68 -0
  117. package/docs/concepts/usage-tracking.md +35 -0
  118. package/docs/custom.css +4 -0
  119. package/docs/date-time.md +128 -0
  120. package/docs/debugging.md +162 -0
  121. package/docs/docs.json +1599 -0
  122. package/docs/environment.md +81 -0
  123. package/docs/hooks.md +876 -0
  124. package/docs/index.md +179 -0
  125. package/docs/install/ansible.md +208 -0
  126. package/docs/install/bun.md +59 -0
  127. package/docs/install/development-channels.md +75 -0
  128. package/docs/install/docker.md +567 -0
  129. package/docs/install/index.md +185 -0
  130. package/docs/install/installer.md +123 -0
  131. package/docs/install/migrating.md +192 -0
  132. package/docs/install/nix.md +96 -0
  133. package/docs/install/node.md +78 -0
  134. package/docs/install/uninstall.md +128 -0
  135. package/docs/install/updating.md +228 -0
  136. package/docs/logging.md +350 -0
  137. package/docs/multi-agent-sandbox-tools.md +395 -0
  138. package/docs/network.md +54 -0
  139. package/docs/nodes/audio.md +114 -0
  140. package/docs/nodes/camera.md +156 -0
  141. package/docs/nodes/images.md +72 -0
  142. package/docs/nodes/index.md +341 -0
  143. package/docs/nodes/location-command.md +113 -0
  144. package/docs/nodes/media-understanding.md +379 -0
  145. package/docs/nodes/talk.md +90 -0
  146. package/docs/nodes/voicewake.md +65 -0
  147. package/docs/northflank.mdx +53 -0
  148. package/docs/perplexity.md +80 -0
  149. package/docs/platforms/android.md +129 -0
  150. package/docs/platforms/digitalocean.md +262 -0
  151. package/docs/platforms/exe-dev.md +125 -0
  152. package/docs/platforms/fly.md +486 -0
  153. package/docs/platforms/gcp.md +503 -0
  154. package/docs/platforms/hetzner.md +330 -0
  155. package/docs/platforms/index.md +53 -0
  156. package/docs/platforms/ios.md +106 -0
  157. package/docs/platforms/linux.md +94 -0
  158. package/docs/platforms/mac/bundled-gateway.md +73 -0
  159. package/docs/platforms/mac/canvas.md +125 -0
  160. package/docs/platforms/mac/child-process.md +69 -0
  161. package/docs/platforms/mac/dev-setup.md +102 -0
  162. package/docs/platforms/mac/health.md +34 -0
  163. package/docs/platforms/mac/icon.md +31 -0
  164. package/docs/platforms/mac/logging.md +57 -0
  165. package/docs/platforms/mac/menu-bar.md +81 -0
  166. package/docs/platforms/mac/peekaboo.md +65 -0
  167. package/docs/platforms/mac/permissions.md +44 -0
  168. package/docs/platforms/mac/release.md +85 -0
  169. package/docs/platforms/mac/remote.md +83 -0
  170. package/docs/platforms/mac/signing.md +47 -0
  171. package/docs/platforms/mac/skills.md +33 -0
  172. package/docs/platforms/mac/voice-overlay.md +60 -0
  173. package/docs/platforms/mac/voicewake.md +67 -0
  174. package/docs/platforms/mac/webchat.md +41 -0
  175. package/docs/platforms/mac/xpc.md +61 -0
  176. package/docs/platforms/macos-vm.md +281 -0
  177. package/docs/platforms/macos.md +203 -0
  178. package/docs/platforms/oracle.md +303 -0
  179. package/docs/platforms/raspberry-pi.md +358 -0
  180. package/docs/platforms/windows.md +159 -0
  181. package/docs/plugin.md +651 -0
  182. package/docs/plugins/agent-tools.md +99 -0
  183. package/docs/plugins/manifest.md +71 -0
  184. package/docs/plugins/voice-call.md +273 -0
  185. package/docs/plugins/zalouser.md +70 -0
  186. package/docs/providers/anthropic.md +152 -0
  187. package/docs/providers/claude-max-api-proxy.md +148 -0
  188. package/docs/providers/cloudflare-ai-gateway.md +71 -0
  189. package/docs/providers/deepgram.md +93 -0
  190. package/docs/providers/glm.md +33 -0
  191. package/docs/providers/index.md +63 -0
  192. package/docs/providers/minimax.md +208 -0
  193. package/docs/providers/models.md +51 -0
  194. package/docs/providers/moonshot.md +142 -0
  195. package/docs/providers/ollama.md +223 -0
  196. package/docs/providers/openai.md +62 -0
  197. package/docs/providers/opencode.md +36 -0
  198. package/docs/providers/openrouter.md +37 -0
  199. package/docs/providers/qwen.md +53 -0
  200. package/docs/providers/synthetic.md +99 -0
  201. package/docs/providers/venice.md +267 -0
  202. package/docs/providers/vercel-ai-gateway.md +50 -0
  203. package/docs/providers/xiaomi.md +64 -0
  204. package/docs/providers/zai.md +36 -0
  205. package/docs/railway.mdx +99 -0
  206. package/docs/reference/templates/AGENTS.md +9 -0
  207. package/docs/reference/templates/BOOTSTRAP.md +3 -0
  208. package/docs/reference/templates/HEARTBEAT.md +3 -0
  209. package/docs/reference/templates/IDENTITY.md +3 -0
  210. package/docs/reference/templates/TOOLS.md +3 -0
  211. package/docs/reference/templates/USER.md +3 -0
  212. package/docs/render.mdx +165 -0
  213. package/docs/start/docs-directory.md +63 -0
  214. package/docs/start/getting-started.md +212 -0
  215. package/docs/start/milaidy.md +247 -0
  216. package/docs/start/onboarding.md +258 -0
  217. package/docs/start/pairing.md +86 -0
  218. package/docs/start/quickstart.md +81 -0
  219. package/docs/start/setup.md +149 -0
  220. package/docs/start/showcase.md +416 -0
  221. package/docs/start/wizard.md +418 -0
  222. package/docs/testing.md +368 -0
  223. package/docs/token-use.md +112 -0
  224. package/docs/tools/agent-send.md +53 -0
  225. package/docs/tools/apply-patch.md +50 -0
  226. package/docs/tools/browser-linux-troubleshooting.md +139 -0
  227. package/docs/tools/browser-login.md +68 -0
  228. package/docs/tools/browser.md +576 -0
  229. package/docs/tools/chrome-extension.md +178 -0
  230. package/docs/tools/clawhub.md +257 -0
  231. package/docs/tools/creating-skills.md +54 -0
  232. package/docs/tools/elevated.md +57 -0
  233. package/docs/tools/exec-approvals.md +246 -0
  234. package/docs/tools/exec.md +179 -0
  235. package/docs/tools/firecrawl.md +61 -0
  236. package/docs/tools/index.md +508 -0
  237. package/docs/tools/llm-task.md +115 -0
  238. package/docs/tools/reactions.md +22 -0
  239. package/docs/tools/skills-config.md +76 -0
  240. package/docs/tools/skills.md +300 -0
  241. package/docs/tools/slash-commands.md +196 -0
  242. package/docs/tools/subagents.md +151 -0
  243. package/docs/tools/thinking.md +73 -0
  244. package/docs/tools/web.md +261 -0
  245. package/docs/tui.md +159 -0
  246. package/docs/vps.md +43 -0
  247. package/docs/web/control-ui.md +221 -0
  248. package/docs/web/dashboard.md +46 -0
  249. package/docs/web/index.md +116 -0
  250. package/docs/web/webchat.md +49 -0
  251. package/milaidy.mjs +14 -0
  252. package/package.json +271 -0
  253. package/skills/.cache/catalog.json +88519 -0
@@ -0,0 +1,163 @@
1
+ ---
2
+ summary: "Webhook ingress for wake and isolated agent runs"
3
+ read_when:
4
+ - Adding or changing webhook endpoints
5
+ - Wiring external systems into Milaidy
6
+ title: "Webhooks"
7
+ ---
8
+
9
+ # Webhooks
10
+
11
+ Gateway can expose a small HTTP webhook endpoint for external triggers.
12
+
13
+ ## Enable
14
+
15
+ ```json5
16
+ {
17
+ hooks: {
18
+ enabled: true,
19
+ token: "shared-secret",
20
+ path: "/hooks",
21
+ },
22
+ }
23
+ ```
24
+
25
+ Notes:
26
+
27
+ - `hooks.token` is required when `hooks.enabled=true`.
28
+ - `hooks.path` defaults to `/hooks`.
29
+
30
+ ## Auth
31
+
32
+ Every request must include the hook token. Prefer headers:
33
+
34
+ - `Authorization: Bearer <token>` (recommended)
35
+ - `x-milaidy-token: <token>`
36
+ - `?token=<token>` (deprecated; logs a warning and will be removed in a future major release)
37
+
38
+ ## Endpoints
39
+
40
+ ### `POST /hooks/wake`
41
+
42
+ Payload:
43
+
44
+ ```json
45
+ { "text": "System line", "mode": "now" }
46
+ ```
47
+
48
+ - `text` **required** (string): The description of the event (e.g., "New email received").
49
+ - `mode` optional (`now` | `next-heartbeat`): Whether to trigger an immediate heartbeat (default `now`) or wait for the next periodic check.
50
+
51
+ Effect:
52
+
53
+ - Enqueues a system event for the **main** session
54
+ - If `mode=now`, triggers an immediate heartbeat
55
+
56
+ ### `POST /hooks/agent`
57
+
58
+ Payload:
59
+
60
+ ```json
61
+ {
62
+ "message": "Run this",
63
+ "name": "Email",
64
+ "sessionKey": "hook:email:msg-123",
65
+ "wakeMode": "now",
66
+ "deliver": true,
67
+ "channel": "last",
68
+ "to": "+15551234567",
69
+ "model": "openai/gpt-5.2-mini",
70
+ "thinking": "low",
71
+ "timeoutSeconds": 120
72
+ }
73
+ ```
74
+
75
+ - `message` **required** (string): The prompt or message for the agent to process.
76
+ - `name` optional (string): Human-readable name for the hook (e.g., "GitHub"), used as a prefix in session summaries.
77
+ - `sessionKey` optional (string): The key used to identify the agent's session. Defaults to a random `hook:<uuid>`. Using a consistent key allows for a multi-turn conversation within the hook context.
78
+ - `wakeMode` optional (`now` | `next-heartbeat`): Whether to trigger an immediate heartbeat (default `now`) or wait for the next periodic check.
79
+ - `deliver` optional (boolean): If `true`, the agent's response will be sent to the messaging channel. Defaults to `true`. Responses that are only heartbeat acknowledgments are automatically skipped.
80
+ - `channel` optional (string): The messaging channel for delivery. One of: `last`, `whatsapp`, `telegram`, `discord`, `slack`, `mattermost` (plugin), `signal`, `imessage`, `msteams`. Defaults to `last`.
81
+ - `to` optional (string): The recipient identifier for the channel (e.g., phone number for WhatsApp/Signal, chat ID for Telegram, channel ID for Discord/Slack/Mattermost (plugin), conversation ID for MS Teams). Defaults to the last recipient in the main session.
82
+ - `model` optional (string): Model override (e.g., `anthropic/claude-3-5-sonnet` or an alias). Must be in the allowed model list if restricted.
83
+ - `thinking` optional (string): Thinking level override (e.g., `low`, `medium`, `high`).
84
+ - `timeoutSeconds` optional (number): Maximum duration for the agent run in seconds.
85
+
86
+ Effect:
87
+
88
+ - Runs an **isolated** agent turn (own session key)
89
+ - Always posts a summary into the **main** session
90
+ - If `wakeMode=now`, triggers an immediate heartbeat
91
+
92
+ ### `POST /hooks/<name>` (mapped)
93
+
94
+ Custom hook names are resolved via `hooks.mappings` (see configuration). A mapping can
95
+ turn arbitrary payloads into `wake` or `agent` actions, with optional templates or
96
+ code transforms.
97
+
98
+ Mapping options (summary):
99
+
100
+ - `hooks.presets: ["gmail"]` enables the built-in Gmail mapping.
101
+ - `hooks.mappings` lets you define `match`, `action`, and templates in config.
102
+ - `hooks.transformsDir` + `transform.module` loads a JS/TS module for custom logic.
103
+ - Use `match.source` to keep a generic ingest endpoint (payload-driven routing).
104
+ - TS transforms require a TS loader (e.g. `bun` or `tsx`) or precompiled `.js` at runtime.
105
+ - Set `deliver: true` + `channel`/`to` on mappings to route replies to a chat surface
106
+ (`channel` defaults to `last` and falls back to WhatsApp).
107
+ - `allowUnsafeExternalContent: true` disables the external content safety wrapper for that hook
108
+ (dangerous; only for trusted internal sources).
109
+ - `milaidy webhooks gmail setup` writes `hooks.gmail` config for `milaidy webhooks gmail run`.
110
+ See [Gmail Pub/Sub](/automation/gmail-pubsub) for the full Gmail watch flow.
111
+
112
+ ## Responses
113
+
114
+ - `200` for `/hooks/wake`
115
+ - `202` for `/hooks/agent` (async run started)
116
+ - `401` on auth failure
117
+ - `400` on invalid payload
118
+ - `413` on oversized payloads
119
+
120
+ ## Examples
121
+
122
+ ```bash
123
+ curl -X POST http://127.0.0.1:18789/hooks/wake \
124
+ -H 'Authorization: Bearer SECRET' \
125
+ -H 'Content-Type: application/json' \
126
+ -d '{"text":"New email received","mode":"now"}'
127
+ ```
128
+
129
+ ```bash
130
+ curl -X POST http://127.0.0.1:18789/hooks/agent \
131
+ -H 'x-milaidy-token: SECRET' \
132
+ -H 'Content-Type: application/json' \
133
+ -d '{"message":"Summarize inbox","name":"Email","wakeMode":"next-heartbeat"}'
134
+ ```
135
+
136
+ ### Use a different model
137
+
138
+ Add `model` to the agent payload (or mapping) to override the model for that run:
139
+
140
+ ```bash
141
+ curl -X POST http://127.0.0.1:18789/hooks/agent \
142
+ -H 'x-milaidy-token: SECRET' \
143
+ -H 'Content-Type: application/json' \
144
+ -d '{"message":"Summarize inbox","name":"Email","model":"openai/gpt-5.2-mini"}'
145
+ ```
146
+
147
+ If you enforce `agents.defaults.models`, make sure the override model is included there.
148
+
149
+ ```bash
150
+ curl -X POST http://127.0.0.1:18789/hooks/gmail \
151
+ -H 'Authorization: Bearer SECRET' \
152
+ -H 'Content-Type: application/json' \
153
+ -d '{"source":"gmail","messages":[{"from":"Ada","subject":"Hello","snippet":"Hi"}]}'
154
+ ```
155
+
156
+ ## Security
157
+
158
+ - Keep hook endpoints behind loopback, tailnet, or trusted reverse proxy.
159
+ - Use a dedicated hook token; do not reuse gateway auth tokens.
160
+ - Avoid including sensitive raw payloads in webhook logs.
161
+ - Hook payloads are treated as untrusted and wrapped with safety boundaries by default.
162
+ If you must disable this for a specific hook, set `allowUnsafeExternalContent: true`
163
+ in that hook's mapping (dangerous).
@@ -0,0 +1,176 @@
1
+ ---
2
+ summary: "Use Amazon Bedrock (Converse API) models with Milaidy"
3
+ read_when:
4
+ - You want to use Amazon Bedrock models with Milaidy
5
+ - You need AWS credential/region setup for model calls
6
+ title: "Amazon Bedrock"
7
+ ---
8
+
9
+ # Amazon Bedrock
10
+
11
+ Milaidy can use **Amazon Bedrock** models via pi‑ai’s **Bedrock Converse**
12
+ streaming provider. Bedrock auth uses the **AWS SDK default credential chain**,
13
+ not an API key.
14
+
15
+ ## What pi‑ai supports
16
+
17
+ - Provider: `amazon-bedrock`
18
+ - API: `bedrock-converse-stream`
19
+ - Auth: AWS credentials (env vars, shared config, or instance role)
20
+ - Region: `AWS_REGION` or `AWS_DEFAULT_REGION` (default: `us-east-1`)
21
+
22
+ ## Automatic model discovery
23
+
24
+ If AWS credentials are detected, Milaidy can automatically discover Bedrock
25
+ models that support **streaming** and **text output**. Discovery uses
26
+ `bedrock:ListFoundationModels` and is cached (default: 1 hour).
27
+
28
+ Config options live under `models.bedrockDiscovery`:
29
+
30
+ ```json5
31
+ {
32
+ models: {
33
+ bedrockDiscovery: {
34
+ enabled: true,
35
+ region: "us-east-1",
36
+ providerFilter: ["anthropic", "amazon"],
37
+ refreshInterval: 3600,
38
+ defaultContextWindow: 32000,
39
+ defaultMaxTokens: 4096,
40
+ },
41
+ },
42
+ }
43
+ ```
44
+
45
+ Notes:
46
+
47
+ - `enabled` defaults to `true` when AWS credentials are present.
48
+ - `region` defaults to `AWS_REGION` or `AWS_DEFAULT_REGION`, then `us-east-1`.
49
+ - `providerFilter` matches Bedrock provider names (for example `anthropic`).
50
+ - `refreshInterval` is seconds; set to `0` to disable caching.
51
+ - `defaultContextWindow` (default: `32000`) and `defaultMaxTokens` (default: `4096`)
52
+ are used for discovered models (override if you know your model limits).
53
+
54
+ ## Setup (manual)
55
+
56
+ 1. Ensure AWS credentials are available on the **gateway host**:
57
+
58
+ ```bash
59
+ export AWS_ACCESS_KEY_ID="AKIA..."
60
+ export AWS_SECRET_ACCESS_KEY="..."
61
+ export AWS_REGION="us-east-1"
62
+ # Optional:
63
+ export AWS_SESSION_TOKEN="..."
64
+ export AWS_PROFILE="your-profile"
65
+ # Optional (Bedrock API key/bearer token):
66
+ export AWS_BEARER_TOKEN_BEDROCK="..."
67
+ ```
68
+
69
+ 2. Add a Bedrock provider and model to your config (no `apiKey` required):
70
+
71
+ ```json5
72
+ {
73
+ models: {
74
+ providers: {
75
+ "amazon-bedrock": {
76
+ baseUrl: "https://bedrock-runtime.us-east-1.amazonaws.com",
77
+ api: "bedrock-converse-stream",
78
+ auth: "aws-sdk",
79
+ models: [
80
+ {
81
+ id: "anthropic.claude-opus-4-5-20251101-v1:0",
82
+ name: "Claude Opus 4.5 (Bedrock)",
83
+ reasoning: true,
84
+ input: ["text", "image"],
85
+ cost: { input: 0, output: 0, cacheRead: 0, cacheWrite: 0 },
86
+ contextWindow: 200000,
87
+ maxTokens: 8192,
88
+ },
89
+ ],
90
+ },
91
+ },
92
+ },
93
+ agents: {
94
+ defaults: {
95
+ model: { primary: "amazon-bedrock/anthropic.claude-opus-4-5-20251101-v1:0" },
96
+ },
97
+ },
98
+ }
99
+ ```
100
+
101
+ ## EC2 Instance Roles
102
+
103
+ When running Milaidy on an EC2 instance with an IAM role attached, the AWS SDK
104
+ will automatically use the instance metadata service (IMDS) for authentication.
105
+ However, Milaidy's credential detection currently only checks for environment
106
+ variables, not IMDS credentials.
107
+
108
+ **Workaround:** Set `AWS_PROFILE=default` to signal that AWS credentials are
109
+ available. The actual authentication still uses the instance role via IMDS.
110
+
111
+ ```bash
112
+ # Add to ~/.bashrc or your shell profile
113
+ export AWS_PROFILE=default
114
+ export AWS_REGION=us-east-1
115
+ ```
116
+
117
+ **Required IAM permissions** for the EC2 instance role:
118
+
119
+ - `bedrock:InvokeModel`
120
+ - `bedrock:InvokeModelWithResponseStream`
121
+ - `bedrock:ListFoundationModels` (for automatic discovery)
122
+
123
+ Or attach the managed policy `AmazonBedrockFullAccess`.
124
+
125
+ **Quick setup:**
126
+
127
+ ```bash
128
+ # 1. Create IAM role and instance profile
129
+ aws iam create-role --role-name EC2-Bedrock-Access \
130
+ --assume-role-policy-document '{
131
+ "Version": "2012-10-17",
132
+ "Statement": [{
133
+ "Effect": "Allow",
134
+ "Principal": {"Service": "ec2.amazonaws.com"},
135
+ "Action": "sts:AssumeRole"
136
+ }]
137
+ }'
138
+
139
+ aws iam attach-role-policy --role-name EC2-Bedrock-Access \
140
+ --policy-arn arn:aws:iam::aws:policy/AmazonBedrockFullAccess
141
+
142
+ aws iam create-instance-profile --instance-profile-name EC2-Bedrock-Access
143
+ aws iam add-role-to-instance-profile \
144
+ --instance-profile-name EC2-Bedrock-Access \
145
+ --role-name EC2-Bedrock-Access
146
+
147
+ # 2. Attach to your EC2 instance
148
+ aws ec2 associate-iam-instance-profile \
149
+ --instance-id i-xxxxx \
150
+ --iam-instance-profile Name=EC2-Bedrock-Access
151
+
152
+ # 3. On the EC2 instance, enable discovery
153
+ milaidy config set models.bedrockDiscovery.enabled true
154
+ milaidy config set models.bedrockDiscovery.region us-east-1
155
+
156
+ # 4. Set the workaround env vars
157
+ echo 'export AWS_PROFILE=default' >> ~/.bashrc
158
+ echo 'export AWS_REGION=us-east-1' >> ~/.bashrc
159
+ source ~/.bashrc
160
+
161
+ # 5. Verify models are discovered
162
+ milaidy models list
163
+ ```
164
+
165
+ ## Notes
166
+
167
+ - Bedrock requires **model access** enabled in your AWS account/region.
168
+ - Automatic discovery needs the `bedrock:ListFoundationModels` permission.
169
+ - If you use profiles, set `AWS_PROFILE` on the gateway host.
170
+ - Milaidy surfaces the credential source in this order: `AWS_BEARER_TOKEN_BEDROCK`,
171
+ then `AWS_ACCESS_KEY_ID` + `AWS_SECRET_ACCESS_KEY`, then `AWS_PROFILE`, then the
172
+ default AWS SDK chain.
173
+ - Reasoning support depends on the model; check the Bedrock model card for
174
+ current capabilities.
175
+ - If you prefer a managed key flow, you can also place an OpenAI‑compatible
176
+ proxy in front of Bedrock and configure it as an OpenAI provider instead.
@@ -0,0 +1,41 @@
1
+ ---
2
+ summary: "Brave Search API setup for web_search"
3
+ read_when:
4
+ - You want to use Brave Search for web_search
5
+ - You need a BRAVE_API_KEY or plan details
6
+ title: "Brave Search"
7
+ ---
8
+
9
+ # Brave Search API
10
+
11
+ Milaidy uses Brave Search as the default provider for `web_search`.
12
+
13
+ ## Get an API key
14
+
15
+ 1. Create a Brave Search API account at https://brave.com/search/api/
16
+ 2. In the dashboard, choose the **Data for Search** plan and generate an API key.
17
+ 3. Store the key in config (recommended) or set `BRAVE_API_KEY` in the Gateway environment.
18
+
19
+ ## Config example
20
+
21
+ ```json5
22
+ {
23
+ tools: {
24
+ web: {
25
+ search: {
26
+ provider: "brave",
27
+ apiKey: "BRAVE_API_KEY_HERE",
28
+ maxResults: 5,
29
+ timeoutSeconds: 30,
30
+ },
31
+ },
32
+ },
33
+ }
34
+ ```
35
+
36
+ ## Notes
37
+
38
+ - The Data for AI plan is **not** compatible with `web_search`.
39
+ - Brave provides a free tier plus paid plans; check the Brave API portal for current limits.
40
+
41
+ See [Web tools](/tools/web) for the full web_search configuration.