@vellumai/vellum-gateway 0.4.32 → 0.4.33
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/.env.example +0 -3
- package/README.md +32 -33
- package/package.json +1 -1
- package/src/__tests__/config.test.ts +0 -1
- package/src/feature-flag-registry.json +4 -4
package/.env.example
CHANGED
|
@@ -31,9 +31,6 @@ ASSISTANT_RUNTIME_BASE_URL=http://localhost:7821
|
|
|
31
31
|
# Only relevant when proxy mode is enabled.
|
|
32
32
|
# GATEWAY_RUNTIME_PROXY_REQUIRE_AUTH=true
|
|
33
33
|
|
|
34
|
-
# Required when proxy is enabled with auth required: Bearer token for proxy auth
|
|
35
|
-
# RUNTIME_PROXY_BEARER_TOKEN=
|
|
36
|
-
|
|
37
34
|
# Optional: Graceful shutdown drain window in milliseconds (default: 5000)
|
|
38
35
|
# GATEWAY_SHUTDOWN_DRAIN_MS=5000
|
|
39
36
|
|
package/README.md
CHANGED
|
@@ -26,35 +26,34 @@ bun run dev
|
|
|
26
26
|
|
|
27
27
|
## Configuration
|
|
28
28
|
|
|
29
|
-
| Variable | Required
|
|
30
|
-
| -------------------------------------- |
|
|
31
|
-
| `TELEGRAM_BOT_TOKEN` | No
|
|
32
|
-
| `TELEGRAM_WEBHOOK_SECRET` | No
|
|
33
|
-
| `TELEGRAM_API_BASE_URL` | No
|
|
34
|
-
| `ASSISTANT_RUNTIME_BASE_URL` | Yes
|
|
35
|
-
| `GATEWAY_ASSISTANT_ROUTING_JSON` | No
|
|
36
|
-
| `GATEWAY_DEFAULT_ASSISTANT_ID` | No
|
|
37
|
-
| `GATEWAY_UNMAPPED_POLICY` | No
|
|
38
|
-
| `GATEWAY_PORT` | No
|
|
39
|
-
| `GATEWAY_INTERNAL_BASE_URL` | No
|
|
40
|
-
| `INGRESS_PUBLIC_BASE_URL` | No
|
|
41
|
-
| `GATEWAY_RUNTIME_PROXY_ENABLED` | No
|
|
42
|
-
| `GATEWAY_RUNTIME_PROXY_REQUIRE_AUTH` | No
|
|
43
|
-
| `RUNTIME_BEARER_TOKEN` | No
|
|
44
|
-
| `
|
|
45
|
-
| `
|
|
46
|
-
| `
|
|
47
|
-
| `
|
|
48
|
-
| `
|
|
49
|
-
| `
|
|
50
|
-
| `
|
|
51
|
-
| `
|
|
52
|
-
| `
|
|
53
|
-
| `
|
|
54
|
-
| `
|
|
55
|
-
| `
|
|
56
|
-
| `
|
|
57
|
-
| `GATEWAY_SMS_DELIVER_AUTH_BYPASS` | No | `false` | Dev-only: skip bearer auth on `/deliver/sms` when no token is configured |
|
|
29
|
+
| Variable | Required | Default | Description |
|
|
30
|
+
| -------------------------------------- | -------- | ---------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
31
|
+
| `TELEGRAM_BOT_TOKEN` | No | — | Bot token from @BotFather (Telegram disabled when unset). When not set as an env var, the gateway reads from the assistant's secure credential store via the credential reader fallback chain: macOS Keychain first (via `security` CLI), then encrypted file store (`~/.vellum/protected/keys.enc`). The keychain reader discriminates exit code 44 (`errSecItemNotFound` — credential genuinely missing) from other non-zero exit codes (transient errors), logging the latter as warnings. On non-macOS platforms, only the encrypted store is used. |
|
|
32
|
+
| `TELEGRAM_WEBHOOK_SECRET` | No | — | Secret for verifying webhook requests (Telegram disabled when unset). Same credential reader fallback behavior as `TELEGRAM_BOT_TOKEN`. |
|
|
33
|
+
| `TELEGRAM_API_BASE_URL` | No | `https://api.telegram.org` | Override Telegram API base URL |
|
|
34
|
+
| `ASSISTANT_RUNTIME_BASE_URL` | Yes | — | Base URL of the assistant runtime HTTP server |
|
|
35
|
+
| `GATEWAY_ASSISTANT_ROUTING_JSON` | No | `{}` | JSON mapping of Telegram identities to assistant IDs |
|
|
36
|
+
| `GATEWAY_DEFAULT_ASSISTANT_ID` | No | — | Default assistant ID for unmapped users |
|
|
37
|
+
| `GATEWAY_UNMAPPED_POLICY` | No | `reject` | Policy for unmapped users: `reject` or `default` |
|
|
38
|
+
| `GATEWAY_PORT` | No | `7830` | Port for the gateway HTTP server |
|
|
39
|
+
| `GATEWAY_INTERNAL_BASE_URL` | No | `http://127.0.0.1:${GATEWAY_PORT}` | Base URL for runtime→gateway callbacks (e.g., the `replyCallbackUrl` sent to the assistant runtime for Telegram reply delivery). Defaults to `http://127.0.0.1:${GATEWAY_PORT}`. Override when the gateway and runtime are not co-located (e.g., separate containers, hosts, or behind a service mesh). |
|
|
40
|
+
| `INGRESS_PUBLIC_BASE_URL` | No | — | Public URL where the gateway is reachable (e.g. `https://abc123.ngrok-free.app`). Used by the assistant runtime to construct webhook and OAuth callback URLs. Set this to your tunnel's public URL. |
|
|
41
|
+
| `GATEWAY_RUNTIME_PROXY_ENABLED` | No | `false` | Enable runtime proxy for non-Telegram requests |
|
|
42
|
+
| `GATEWAY_RUNTIME_PROXY_REQUIRE_AUTH` | No | `true` | Require bearer auth for proxied requests |
|
|
43
|
+
| `RUNTIME_BEARER_TOKEN` | No | — | Bearer token (JWT) used by gateway when forwarding requests to assistant runtime internal endpoints (Twilio/OAuth/proxy upstream). |
|
|
44
|
+
| `GATEWAY_SHUTDOWN_DRAIN_MS` | No | `5000` | Graceful shutdown drain window in milliseconds |
|
|
45
|
+
| `GATEWAY_RUNTIME_TIMEOUT_MS` | No | `30000` | Timeout for runtime HTTP calls (ms) |
|
|
46
|
+
| `GATEWAY_RUNTIME_MAX_RETRIES` | No | `2` | Max retries for runtime forward on 5xx/network errors |
|
|
47
|
+
| `GATEWAY_RUNTIME_INITIAL_BACKOFF_MS` | No | `500` | Initial backoff between retries (doubles each attempt) |
|
|
48
|
+
| `GATEWAY_TELEGRAM_TIMEOUT_MS` | No | `15000` | Timeout for Telegram API/download calls (ms) |
|
|
49
|
+
| `GATEWAY_MAX_WEBHOOK_PAYLOAD_BYTES` | No | `1048576` | Max inbound webhook payload size (rejects with 413) |
|
|
50
|
+
| `GATEWAY_MAX_ATTACHMENT_BYTES` | No | `20971520` | Max single attachment size (oversized are skipped) |
|
|
51
|
+
| `GATEWAY_MAX_ATTACHMENT_CONCURRENCY` | No | `3` | Max concurrent attachment download/upload operations |
|
|
52
|
+
| `GATEWAY_TELEGRAM_DELIVER_AUTH_BYPASS` | No | `false` | Dev-only: skip bearer auth on `/deliver/telegram` when no token is configured |
|
|
53
|
+
| `TWILIO_ACCOUNT_SID` | No | — | Twilio Account SID for sending outbound SMS via the Messages API |
|
|
54
|
+
| `TWILIO_AUTH_TOKEN` | No | — | Twilio Auth Token for HMAC-SHA1 webhook signature validation and outbound SMS |
|
|
55
|
+
| `TWILIO_PHONE_NUMBER` | No | — | Twilio phone number (E.164) used as the `From` for outbound SMS |
|
|
56
|
+
| `GATEWAY_SMS_DELIVER_AUTH_BYPASS` | No | `false` | Dev-only: skip bearer auth on `/deliver/sms` when no token is configured |
|
|
58
57
|
|
|
59
58
|
## Routing
|
|
60
59
|
|
|
@@ -97,7 +96,7 @@ The `/deliver/telegram` endpoint requires bearer auth by default (fail-closed).
|
|
|
97
96
|
| No bearer token configured + `GATEWAY_TELEGRAM_DELIVER_AUTH_BYPASS=true` | Request allowed (dev-only) |
|
|
98
97
|
| No bearer token configured + bypass not set | 503 Service Not Configured |
|
|
99
98
|
|
|
100
|
-
This ensures that misconfiguration cannot expose an unauthenticated public message-send surface. In production,
|
|
99
|
+
This ensures that misconfiguration cannot expose an unauthenticated public message-send surface. In production, ensure JWT authentication is properly configured. The `GATEWAY_TELEGRAM_DELIVER_AUTH_BYPASS` flag is intended for local development only.
|
|
101
100
|
|
|
102
101
|
## Voice Ingress — Inbound Calls (Twilio)
|
|
103
102
|
|
|
@@ -308,7 +307,7 @@ When `GATEWAY_RUNTIME_PROXY_ENABLED=true`, the gateway forwards all non-Telegram
|
|
|
308
307
|
|
|
309
308
|
### Auth behavior
|
|
310
309
|
|
|
311
|
-
By default (`GATEWAY_RUNTIME_PROXY_REQUIRE_AUTH=true`), proxied requests must include a valid `Authorization: Bearer <
|
|
310
|
+
By default (`GATEWAY_RUNTIME_PROXY_REQUIRE_AUTH=true`), proxied requests must include a valid `Authorization: Bearer <jwt>` header with a JWT signed by the shared signing key. Set `GATEWAY_RUNTIME_PROXY_REQUIRE_AUTH=false` to disable auth.
|
|
312
311
|
|
|
313
312
|
`OPTIONS` requests are always allowed without auth (CORS preflight). Telegram webhook requests use their own secret-based verification and are not affected by proxy auth.
|
|
314
313
|
|
|
@@ -318,9 +317,9 @@ By default (`GATEWAY_RUNTIME_PROXY_REQUIRE_AUTH=true`), proxied requests must in
|
|
|
318
317
|
# Unauthorized (expect 401 when auth required)
|
|
319
318
|
curl -i http://localhost:7830/v1/assistants/test/health
|
|
320
319
|
|
|
321
|
-
# Authorized (expect 200)
|
|
320
|
+
# Authorized with JWT (expect 200)
|
|
322
321
|
curl -i \
|
|
323
|
-
-H "Authorization: Bearer
|
|
322
|
+
-H "Authorization: Bearer <jwt>" \
|
|
324
323
|
http://localhost:7830/v1/assistants/test/health
|
|
325
324
|
|
|
326
325
|
# Telegram still uses webhook secret flow, not bearer auth
|
package/package.json
CHANGED
|
@@ -82,10 +82,10 @@
|
|
|
82
82
|
"defaultEnabled": false
|
|
83
83
|
},
|
|
84
84
|
{
|
|
85
|
-
"id": "contacts
|
|
86
|
-
"scope": "
|
|
87
|
-
"key": "
|
|
88
|
-
"label": "Contacts
|
|
85
|
+
"id": "contacts",
|
|
86
|
+
"scope": "assistant",
|
|
87
|
+
"key": "feature_flags.contacts.enabled",
|
|
88
|
+
"label": "Contacts",
|
|
89
89
|
"description": "Show the Contacts tab in Settings for viewing and managing contacts",
|
|
90
90
|
"defaultEnabled": false
|
|
91
91
|
},
|