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.
- package/LICENSE +8 -0
- package/README.md +538 -0
- package/dist/argv-CfSowvEA.js +63 -0
- package/dist/config-B-mboG4v.js +4 -0
- package/dist/eliza-CPJjgw-e.js +1491 -0
- package/dist/eliza.js +2192 -0
- package/dist/entry.js +232 -0
- package/dist/index.js +209 -0
- package/dist/links-BFKlWqSe.js +15 -0
- package/dist/paths-D_yh1DEJ.js +69 -0
- package/dist/plugins-cli-B7kSre2c.js +134 -0
- package/dist/program-6KwWwKKh.js +510 -0
- package/dist/register.agents-CPVmSjMG.js +17 -0
- package/dist/register.browser-B2ooXxNx.js +15 -0
- package/dist/register.channels-CMYQ6K6Y.js +42 -0
- package/dist/register.cron-D91lY1_Y.js +9 -0
- package/dist/register.devices-rU5I5L_y.js +13 -0
- package/dist/register.gateway-82SLAvw3.js +22 -0
- package/dist/register.hooks-B_XTBEkt.js +9 -0
- package/dist/register.logs-BgEGcPd8.js +10 -0
- package/dist/register.models-BJt9eVgZ.js +26 -0
- package/dist/register.nodes-B5xY1s8a.js +9 -0
- package/dist/register.skills-SFQqYIhg.js +10 -0
- package/dist/register.subclis-uF_AsbWR.js +187 -0
- package/dist/run-main-XODklzS-.js +56 -0
- package/dist/theme-DBvtuGeq.js +36 -0
- package/dist/utils-C1AUpp_V.js +42 -0
- package/dist/version-Cpn3yr5D.js +26 -0
- package/dist/workspace-Co3Wul2D.js +206 -0
- package/dist/workspace-DCA6MNVK.js +350 -0
- package/docs/.i18n/README.md +31 -0
- package/docs/.i18n/glossary.zh-CN.json +210 -0
- package/docs/.i18n/zh-CN.tm.jsonl +1329 -0
- package/docs/CNAME +1 -0
- package/docs/automation/cron-jobs.md +468 -0
- package/docs/automation/cron-vs-heartbeat.md +254 -0
- package/docs/automation/gmail-pubsub.md +256 -0
- package/docs/automation/poll.md +69 -0
- package/docs/automation/webhook.md +163 -0
- package/docs/bedrock.md +176 -0
- package/docs/brave-search.md +41 -0
- package/docs/broadcast-groups.md +442 -0
- package/docs/cli/acp.md +170 -0
- package/docs/cli/agent.md +24 -0
- package/docs/cli/agents.md +75 -0
- package/docs/cli/approvals.md +50 -0
- package/docs/cli/browser.md +107 -0
- package/docs/cli/channels.md +79 -0
- package/docs/cli/config.md +50 -0
- package/docs/cli/configure.md +33 -0
- package/docs/cli/cron.md +42 -0
- package/docs/cli/dashboard.md +16 -0
- package/docs/cli/devices.md +67 -0
- package/docs/cli/directory.md +63 -0
- package/docs/cli/dns.md +23 -0
- package/docs/cli/docs.md +15 -0
- package/docs/cli/doctor.md +41 -0
- package/docs/cli/gateway.md +199 -0
- package/docs/cli/health.md +21 -0
- package/docs/cli/hooks.md +291 -0
- package/docs/cli/index.md +1029 -0
- package/docs/cli/logs.md +24 -0
- package/docs/cli/memory.md +45 -0
- package/docs/cli/message.md +239 -0
- package/docs/cli/models.md +79 -0
- package/docs/cli/node.md +112 -0
- package/docs/cli/nodes.md +73 -0
- package/docs/cli/onboard.md +29 -0
- package/docs/cli/pairing.md +21 -0
- package/docs/cli/plugins.md +62 -0
- package/docs/cli/reset.md +17 -0
- package/docs/cli/sandbox.md +152 -0
- package/docs/cli/security.md +26 -0
- package/docs/cli/sessions.md +16 -0
- package/docs/cli/setup.md +29 -0
- package/docs/cli/skills.md +26 -0
- package/docs/cli/status.md +26 -0
- package/docs/cli/system.md +60 -0
- package/docs/cli/tui.md +23 -0
- package/docs/cli/uninstall.md +17 -0
- package/docs/cli/update.md +98 -0
- package/docs/cli/voicecall.md +34 -0
- package/docs/cli/webhooks.md +25 -0
- package/docs/concepts/agent-loop.md +146 -0
- package/docs/concepts/agent-workspace.md +229 -0
- package/docs/concepts/agent.md +122 -0
- package/docs/concepts/architecture.md +129 -0
- package/docs/concepts/channel-routing.md +114 -0
- package/docs/concepts/compaction.md +61 -0
- package/docs/concepts/context.md +159 -0
- package/docs/concepts/features.md +53 -0
- package/docs/concepts/group-messages.md +84 -0
- package/docs/concepts/groups.md +373 -0
- package/docs/concepts/markdown-formatting.md +130 -0
- package/docs/concepts/memory.md +546 -0
- package/docs/concepts/messages.md +154 -0
- package/docs/concepts/model-failover.md +149 -0
- package/docs/concepts/model-providers.md +315 -0
- package/docs/concepts/models.md +208 -0
- package/docs/concepts/multi-agent.md +376 -0
- package/docs/concepts/oauth.md +145 -0
- package/docs/concepts/plugins.md +454 -0
- package/docs/concepts/presence.md +102 -0
- package/docs/concepts/queue.md +89 -0
- package/docs/concepts/retry.md +69 -0
- package/docs/concepts/secrets.md +300 -0
- package/docs/concepts/session-pruning.md +122 -0
- package/docs/concepts/session-tool.md +193 -0
- package/docs/concepts/session.md +188 -0
- package/docs/concepts/sessions.md +10 -0
- package/docs/concepts/skills.md +392 -0
- package/docs/concepts/streaming.md +135 -0
- package/docs/concepts/system-prompt.md +114 -0
- package/docs/concepts/timezone.md +91 -0
- package/docs/concepts/typebox.md +289 -0
- package/docs/concepts/typing-indicators.md +68 -0
- package/docs/concepts/usage-tracking.md +35 -0
- package/docs/custom.css +4 -0
- package/docs/date-time.md +128 -0
- package/docs/debugging.md +162 -0
- package/docs/docs.json +1599 -0
- package/docs/environment.md +81 -0
- package/docs/hooks.md +876 -0
- package/docs/index.md +179 -0
- package/docs/install/ansible.md +208 -0
- package/docs/install/bun.md +59 -0
- package/docs/install/development-channels.md +75 -0
- package/docs/install/docker.md +567 -0
- package/docs/install/index.md +185 -0
- package/docs/install/installer.md +123 -0
- package/docs/install/migrating.md +192 -0
- package/docs/install/nix.md +96 -0
- package/docs/install/node.md +78 -0
- package/docs/install/uninstall.md +128 -0
- package/docs/install/updating.md +228 -0
- package/docs/logging.md +350 -0
- package/docs/multi-agent-sandbox-tools.md +395 -0
- package/docs/network.md +54 -0
- package/docs/nodes/audio.md +114 -0
- package/docs/nodes/camera.md +156 -0
- package/docs/nodes/images.md +72 -0
- package/docs/nodes/index.md +341 -0
- package/docs/nodes/location-command.md +113 -0
- package/docs/nodes/media-understanding.md +379 -0
- package/docs/nodes/talk.md +90 -0
- package/docs/nodes/voicewake.md +65 -0
- package/docs/northflank.mdx +53 -0
- package/docs/perplexity.md +80 -0
- package/docs/platforms/android.md +129 -0
- package/docs/platforms/digitalocean.md +262 -0
- package/docs/platforms/exe-dev.md +125 -0
- package/docs/platforms/fly.md +486 -0
- package/docs/platforms/gcp.md +503 -0
- package/docs/platforms/hetzner.md +330 -0
- package/docs/platforms/index.md +53 -0
- package/docs/platforms/ios.md +106 -0
- package/docs/platforms/linux.md +94 -0
- package/docs/platforms/mac/bundled-gateway.md +73 -0
- package/docs/platforms/mac/canvas.md +125 -0
- package/docs/platforms/mac/child-process.md +69 -0
- package/docs/platforms/mac/dev-setup.md +102 -0
- package/docs/platforms/mac/health.md +34 -0
- package/docs/platforms/mac/icon.md +31 -0
- package/docs/platforms/mac/logging.md +57 -0
- package/docs/platforms/mac/menu-bar.md +81 -0
- package/docs/platforms/mac/peekaboo.md +65 -0
- package/docs/platforms/mac/permissions.md +44 -0
- package/docs/platforms/mac/release.md +85 -0
- package/docs/platforms/mac/remote.md +83 -0
- package/docs/platforms/mac/signing.md +47 -0
- package/docs/platforms/mac/skills.md +33 -0
- package/docs/platforms/mac/voice-overlay.md +60 -0
- package/docs/platforms/mac/voicewake.md +67 -0
- package/docs/platforms/mac/webchat.md +41 -0
- package/docs/platforms/mac/xpc.md +61 -0
- package/docs/platforms/macos-vm.md +281 -0
- package/docs/platforms/macos.md +203 -0
- package/docs/platforms/oracle.md +303 -0
- package/docs/platforms/raspberry-pi.md +358 -0
- package/docs/platforms/windows.md +159 -0
- package/docs/plugin.md +651 -0
- package/docs/plugins/agent-tools.md +99 -0
- package/docs/plugins/manifest.md +71 -0
- package/docs/plugins/voice-call.md +273 -0
- package/docs/plugins/zalouser.md +70 -0
- package/docs/providers/anthropic.md +152 -0
- package/docs/providers/claude-max-api-proxy.md +148 -0
- package/docs/providers/cloudflare-ai-gateway.md +71 -0
- package/docs/providers/deepgram.md +93 -0
- package/docs/providers/glm.md +33 -0
- package/docs/providers/index.md +63 -0
- package/docs/providers/minimax.md +208 -0
- package/docs/providers/models.md +51 -0
- package/docs/providers/moonshot.md +142 -0
- package/docs/providers/ollama.md +223 -0
- package/docs/providers/openai.md +62 -0
- package/docs/providers/opencode.md +36 -0
- package/docs/providers/openrouter.md +37 -0
- package/docs/providers/qwen.md +53 -0
- package/docs/providers/synthetic.md +99 -0
- package/docs/providers/venice.md +267 -0
- package/docs/providers/vercel-ai-gateway.md +50 -0
- package/docs/providers/xiaomi.md +64 -0
- package/docs/providers/zai.md +36 -0
- package/docs/railway.mdx +99 -0
- package/docs/reference/templates/AGENTS.md +9 -0
- package/docs/reference/templates/BOOTSTRAP.md +3 -0
- package/docs/reference/templates/HEARTBEAT.md +3 -0
- package/docs/reference/templates/IDENTITY.md +3 -0
- package/docs/reference/templates/TOOLS.md +3 -0
- package/docs/reference/templates/USER.md +3 -0
- package/docs/render.mdx +165 -0
- package/docs/start/docs-directory.md +63 -0
- package/docs/start/getting-started.md +212 -0
- package/docs/start/milaidy.md +247 -0
- package/docs/start/onboarding.md +258 -0
- package/docs/start/pairing.md +86 -0
- package/docs/start/quickstart.md +81 -0
- package/docs/start/setup.md +149 -0
- package/docs/start/showcase.md +416 -0
- package/docs/start/wizard.md +418 -0
- package/docs/testing.md +368 -0
- package/docs/token-use.md +112 -0
- package/docs/tools/agent-send.md +53 -0
- package/docs/tools/apply-patch.md +50 -0
- package/docs/tools/browser-linux-troubleshooting.md +139 -0
- package/docs/tools/browser-login.md +68 -0
- package/docs/tools/browser.md +576 -0
- package/docs/tools/chrome-extension.md +178 -0
- package/docs/tools/clawhub.md +257 -0
- package/docs/tools/creating-skills.md +54 -0
- package/docs/tools/elevated.md +57 -0
- package/docs/tools/exec-approvals.md +246 -0
- package/docs/tools/exec.md +179 -0
- package/docs/tools/firecrawl.md +61 -0
- package/docs/tools/index.md +508 -0
- package/docs/tools/llm-task.md +115 -0
- package/docs/tools/reactions.md +22 -0
- package/docs/tools/skills-config.md +76 -0
- package/docs/tools/skills.md +300 -0
- package/docs/tools/slash-commands.md +196 -0
- package/docs/tools/subagents.md +151 -0
- package/docs/tools/thinking.md +73 -0
- package/docs/tools/web.md +261 -0
- package/docs/tui.md +159 -0
- package/docs/vps.md +43 -0
- package/docs/web/control-ui.md +221 -0
- package/docs/web/dashboard.md +46 -0
- package/docs/web/index.md +116 -0
- package/docs/web/webchat.md +49 -0
- package/milaidy.mjs +14 -0
- package/package.json +271 -0
- 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).
|
package/docs/bedrock.md
ADDED
|
@@ -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.
|