@vellumai/vellum-gateway 0.4.41 → 0.4.43
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 +5 -14
- package/AGENTS.md +2 -3
- package/ARCHITECTURE.md +110 -119
- package/README.md +74 -87
- package/package.json +2 -2
- package/src/__tests__/browser-relay-websocket.test.ts +35 -23
- package/src/__tests__/{guardian-control-plane-proxy.test.ts → channel-verification-session-proxy.test.ts} +49 -80
- package/src/__tests__/config-file-cache.test.ts +435 -0
- package/src/__tests__/config.test.ts +1 -36
- package/src/__tests__/contacts-control-plane-proxy.test.ts +0 -23
- package/src/__tests__/contacts-control-plane-route-match.test.ts +3 -20
- package/src/__tests__/credential-cache.test.ts +488 -0
- package/src/__tests__/feature-flags-route.test.ts +5 -5
- package/src/__tests__/load-guards.test.ts +21 -25
- package/src/__tests__/oauth-callback.test.ts +0 -23
- package/src/__tests__/resolve-assistant.test.ts +0 -23
- package/src/__tests__/route-schema-guard.test.ts +10 -10
- package/src/__tests__/runtime-client.test.ts +0 -23
- package/src/__tests__/runtime-health-proxy.test.ts +0 -23
- package/src/__tests__/runtime-proxy-auth.test.ts +0 -23
- package/src/__tests__/runtime-proxy.test.ts +0 -23
- package/src/__tests__/schema.test.ts +4 -5
- package/src/__tests__/slack-config.test.ts +12 -78
- package/src/__tests__/slack-control-plane-proxy.test.ts +0 -23
- package/src/__tests__/slack-deliver-ratelimit.test.ts +66 -31
- package/src/__tests__/slack-deliver.test.ts +250 -58
- package/src/__tests__/slack-display-name.test.ts +28 -31
- package/src/__tests__/slack-normalize.test.ts +0 -23
- package/src/__tests__/slack-reaction-normalize.test.ts +0 -23
- package/src/__tests__/telegram-api-redaction.test.ts +50 -73
- package/src/__tests__/telegram-control-plane-proxy.test.ts +0 -23
- package/src/__tests__/telegram-deliver-auth.test.ts +74 -35
- package/src/__tests__/telegram-send-attachments.test.ts +33 -33
- package/src/__tests__/telegram-webhook-handler.test.ts +28 -37
- package/src/__tests__/telegram-webhook-manager.test.ts +54 -64
- package/src/__tests__/twilio-relay-websocket.test.ts +19 -56
- package/src/__tests__/twilio-webhooks.test.ts +374 -59
- package/src/__tests__/whatsapp-download.test.ts +103 -52
- package/src/__tests__/whatsapp-webhook.test.ts +172 -0
- package/src/auth/subject.ts +9 -0
- package/src/auth/types.ts +1 -1
- package/src/channels/inbound-event.ts +1 -3
- package/src/channels/transport-hints.ts +0 -19
- package/src/channels/types.ts +2 -4
- package/src/config-file-cache.ts +146 -0
- package/src/config.ts +1 -331
- package/src/credential-cache.ts +120 -0
- package/src/credential-watcher.ts +2 -2
- package/src/dedup-cache.ts +1 -1
- package/src/feature-flag-registry.json +0 -16
- package/src/http/middleware/deliver-auth.ts +4 -6
- package/src/http/middleware/rate-limit.ts +1 -6
- package/src/http/routes/browser-relay-websocket.ts +13 -3
- package/src/http/routes/{guardian-control-plane-proxy.ts → channel-verification-session-proxy.ts} +25 -39
- package/src/http/routes/contacts-control-plane-proxy.ts +0 -11
- package/src/http/routes/contacts-control-plane-route-match.ts +1 -13
- package/src/http/routes/slack-deliver.ts +42 -16
- package/src/http/routes/telegram-deliver.test.ts +30 -51
- package/src/http/routes/telegram-deliver.ts +63 -10
- package/src/http/routes/telegram-webhook.test.ts +84 -103
- package/src/http/routes/telegram-webhook.ts +108 -34
- package/src/http/routes/twilio-connect-action-webhook.ts +9 -3
- package/src/http/routes/twilio-control-plane-proxy.ts +0 -42
- package/src/http/routes/twilio-relay-websocket.ts +22 -11
- package/src/http/routes/twilio-status-webhook.ts +9 -3
- package/src/http/routes/twilio-voice-webhook.test.ts +45 -36
- package/src/http/routes/twilio-voice-webhook.ts +12 -6
- package/src/http/routes/whatsapp-deliver.test.ts +30 -74
- package/src/http/routes/whatsapp-deliver.ts +25 -16
- package/src/http/routes/whatsapp-webhook.test.ts +113 -46
- package/src/http/routes/whatsapp-webhook.ts +110 -37
- package/src/index.ts +218 -192
- package/src/routing/resolve-assistant.ts +6 -2
- package/src/schema.ts +66 -458
- package/src/slack/normalize.ts +9 -6
- package/src/slack/socket-mode.ts +3 -0
- package/src/telegram/api.ts +58 -29
- package/src/telegram/download.ts +22 -7
- package/src/telegram/send.test.ts +38 -26
- package/src/telegram/send.ts +68 -9
- package/src/telegram/webhook-manager.ts +46 -11
- package/src/twilio/validate-webhook.ts +225 -43
- package/src/types.ts +0 -1
- package/src/whatsapp/api.ts +170 -124
- package/src/whatsapp/download.ts +4 -2
- package/src/whatsapp/send.ts +13 -9
- package/workspace/config.json +8 -0
- package/docs/sms-twilio-parity-checklist.md +0 -49
- package/src/__tests__/sms-ingress-guard.test.ts +0 -283
- package/src/__tests__/telegram-reconcile-route.test.ts +0 -314
- package/src/config-file-mappings.ts +0 -107
- package/src/credential-mappings.ts +0 -102
- package/src/http/routes/sms-deliver.test.ts +0 -510
- package/src/http/routes/sms-deliver.ts +0 -195
- package/src/http/routes/telegram-reconcile.ts +0 -88
- package/src/http/routes/twilio-sms-webhook.test.ts +0 -817
- package/src/http/routes/twilio-sms-webhook.ts +0 -255
- package/src/twilio/send-sms.ts +0 -61
package/.env.example
CHANGED
|
@@ -4,9 +4,6 @@ TELEGRAM_BOT_TOKEN=
|
|
|
4
4
|
# Required: Secret token for verifying Telegram webhook requests
|
|
5
5
|
TELEGRAM_WEBHOOK_SECRET=
|
|
6
6
|
|
|
7
|
-
# Optional: Override Telegram API base URL (default: https://api.telegram.org)
|
|
8
|
-
# TELEGRAM_API_BASE_URL=https://api.telegram.org
|
|
9
|
-
|
|
10
7
|
# Required: Base URL of the assistant runtime HTTP server
|
|
11
8
|
ASSISTANT_RUNTIME_BASE_URL=http://localhost:7821
|
|
12
9
|
|
|
@@ -43,9 +40,6 @@ ASSISTANT_RUNTIME_BASE_URL=http://localhost:7821
|
|
|
43
40
|
# Optional: Initial backoff between retries in milliseconds (default: 500)
|
|
44
41
|
# GATEWAY_RUNTIME_INITIAL_BACKOFF_MS=500
|
|
45
42
|
|
|
46
|
-
# Optional: Timeout for Telegram API/download calls in milliseconds (default: 15000)
|
|
47
|
-
# GATEWAY_TELEGRAM_TIMEOUT_MS=15000
|
|
48
|
-
|
|
49
43
|
# Optional: Max inbound webhook payload size in bytes (default: 1048576 = 1 MB)
|
|
50
44
|
# GATEWAY_MAX_WEBHOOK_PAYLOAD_BYTES=1048576
|
|
51
45
|
|
|
@@ -57,20 +51,17 @@ ASSISTANT_RUNTIME_BASE_URL=http://localhost:7821
|
|
|
57
51
|
|
|
58
52
|
# Optional: Canonical public base URL where the gateway is reachable externally.
|
|
59
53
|
# Used by the assistant runtime to construct webhook and OAuth callback URLs.
|
|
60
|
-
# Required for Twilio
|
|
54
|
+
# Required for Twilio webhook signature validation when behind a tunnel.
|
|
61
55
|
# Set this to your tunnel's public URL during local development.
|
|
62
56
|
# INGRESS_PUBLIC_BASE_URL=https://your-public-domain.com
|
|
63
57
|
|
|
64
|
-
# ---
|
|
58
|
+
# --- Twilio ---
|
|
65
59
|
|
|
66
|
-
# Optional: Twilio Account SID for
|
|
60
|
+
# Optional: Twilio Account SID for voice calls via the API
|
|
67
61
|
# TWILIO_ACCOUNT_SID=
|
|
68
62
|
|
|
69
|
-
# Optional: Twilio Auth Token for webhook signature validation
|
|
63
|
+
# Optional: Twilio Auth Token for webhook signature validation
|
|
70
64
|
# TWILIO_AUTH_TOKEN=
|
|
71
65
|
|
|
72
|
-
# Optional: Twilio phone number (E.164) used as the From number for
|
|
66
|
+
# Optional: Twilio phone number (E.164) used as the From number for voice calls
|
|
73
67
|
# TWILIO_PHONE_NUMBER=
|
|
74
|
-
|
|
75
|
-
# Optional: Dev-only bypass for bearer auth on /deliver/sms (default: false)
|
|
76
|
-
# GATEWAY_SMS_DELIVER_AUTH_BYPASS=false
|
package/AGENTS.md
CHANGED
|
@@ -19,18 +19,17 @@ All assistant API requests from clients, CLI, skills, and user-facing tooling **
|
|
|
19
19
|
**Exception boundary:** The gateway service itself may call the runtime internally. Tests may use direct runtime URLs for isolated unit/integration scenarios. Intentional local daemon-control paths are exempt:
|
|
20
20
|
|
|
21
21
|
- `clients/shared/IPC/DaemonClient.swift`
|
|
22
|
-
- `clients/macos/vellum-assistant/App/AppDelegate.swift` (`localHttpEnabled`)
|
|
23
22
|
- `clients/macos/vellum-assistant/Features/Settings/SettingsConnectTab.swift` (health probe)
|
|
24
23
|
|
|
25
24
|
**Migration rule:** If a needed endpoint is not available at the gateway, add a gateway route/proxy first, then consume it. Do not work around a missing gateway endpoint by hitting the runtime directly.
|
|
26
25
|
|
|
27
26
|
**Ban on hardcoded runtime hosts/ports:** Do not embed `localhost:7821`, `127.0.0.1:7821`, or runtime-port-derived URLs in docs, skills, or user-facing guidance. Always reference gateway URLs instead. A CI guard test (`gateway-only-guard.test.ts`) enforces this — any new direct runtime URL reference in production code or skills will fail CI.
|
|
28
27
|
|
|
29
|
-
**SKILL.md retrieval contract:** For config/status retrieval in bundled skills, use `bash` + canonical CLI surfaces. Start with `assistant config get` for generic config keys and secure credential surfaces (`credential_store`, `assistant keys`) for secrets.
|
|
28
|
+
**SKILL.md retrieval contract:** For config/status retrieval in bundled skills, use `bash` + canonical CLI surfaces. Start with `assistant config get` for generic config keys and secure credential surfaces (`credential_store`, `assistant keys`) for secrets. Do not use direct gateway `curl` for read-only retrieval paths. Do not use keychain lookup commands (`security find-generic-password`, `secret-tool`) in SKILL.md. `host_bash` is not allowed for Vellum CLI retrieval commands unless a documented exception is intentionally allowlisted.
|
|
30
29
|
|
|
31
30
|
**SKILL.md proxied outbound pattern:** For outbound third-party API calls from skills that require stored credentials, default to `bash` with `network_mode: "proxied"` and `credential_ids` instead of manual token/keychain plumbing. This keeps credentials out of chat and enforces credential policies consistently.
|
|
32
31
|
|
|
33
|
-
**SKILL.md gateway URL pattern:** For gateway control-plane writes/actions that are not exposed through a CLI read command, use `$INTERNAL_GATEWAY_BASE_URL` (injected by `bash` and `host_bash`).
|
|
32
|
+
**SKILL.md gateway URL pattern:** For gateway control-plane writes/actions that are not exposed through a CLI read command, use `$INTERNAL_GATEWAY_BASE_URL` (injected by `bash` and `host_bash`). Do not hardcode `localhost`/ports in skill examples, and do not instruct users/agents to manually export the variable from Settings. For public ingress URLs (e.g. OAuth redirect URIs, webhook registration), use `assistant config get ingress.publicBaseUrl` or load the `public-ingress` skill — do not inject public URLs as environment variables.
|
|
34
33
|
|
|
35
34
|
### Channel Identity Vocabulary
|
|
36
35
|
|