vellum 0.2.7 → 0.2.9
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/bun.lock +4 -4
- package/package.json +4 -3
- package/src/__tests__/asset-materialize-tool.test.ts +2 -2
- package/src/__tests__/checker.test.ts +104 -0
- package/src/__tests__/config-schema.test.ts +0 -6
- package/src/__tests__/forbidden-legacy-symbols.test.ts +69 -0
- package/src/__tests__/gateway-only-enforcement.test.ts +538 -0
- package/src/__tests__/ingress-url-consistency.test.ts +214 -0
- package/src/__tests__/ipc-snapshot.test.ts +17 -5
- package/src/__tests__/oauth-callback-registry.test.ts +85 -0
- package/src/__tests__/oauth2-gateway-transport.test.ts +304 -0
- package/src/__tests__/provider-commit-message-generator.test.ts +51 -12
- package/src/__tests__/public-ingress-urls.test.ts +222 -0
- package/src/__tests__/runtime-events-sse-parity.test.ts +343 -0
- package/src/__tests__/runtime-events-sse.test.ts +162 -0
- package/src/__tests__/tool-executor.test.ts +88 -0
- package/src/__tests__/turn-commit.test.ts +64 -0
- package/src/__tests__/twilio-provider.test.ts +1 -1
- package/src/__tests__/twilio-routes.test.ts +4 -4
- package/src/__tests__/twitter-auth-handler.test.ts +87 -2
- package/src/calls/call-domain.ts +8 -6
- package/src/calls/twilio-config.ts +18 -3
- package/src/calls/twilio-routes.ts +10 -2
- package/src/config/bundled-skills/tasks/TOOLS.json +25 -0
- package/src/config/bundled-skills/tasks/tools/task-queue-run.ts +9 -0
- package/src/config/bundled-skills/transcribe/SKILL.md +25 -0
- package/src/config/bundled-skills/transcribe/TOOLS.json +32 -0
- package/src/config/bundled-skills/transcribe/tools/transcribe-media.ts +370 -0
- package/src/config/defaults.ts +4 -1
- package/src/config/schema.ts +30 -6
- package/src/config/system-prompt.ts +1 -1
- package/src/config/types.ts +1 -0
- package/src/config/vellum-skills/google-oauth-setup/SKILL.md +5 -4
- package/src/config/vellum-skills/slack-oauth-setup/SKILL.md +4 -2
- package/src/config/vellum-skills/telegram-setup/SKILL.md +3 -3
- package/src/daemon/computer-use-session.ts +2 -1
- package/src/daemon/handlers/config.ts +49 -17
- package/src/daemon/handlers/sessions.ts +2 -2
- package/src/daemon/handlers/shared.ts +1 -0
- package/src/daemon/handlers/subagents.ts +85 -2
- package/src/daemon/handlers/twitter-auth.ts +31 -2
- package/src/daemon/handlers/work-items.ts +1 -1
- package/src/daemon/ipc-contract-inventory.json +8 -4
- package/src/daemon/ipc-contract.ts +34 -15
- package/src/daemon/lifecycle.ts +9 -4
- package/src/daemon/server.ts +7 -0
- package/src/daemon/session-tool-setup.ts +8 -1
- package/src/inbound/public-ingress-urls.ts +112 -0
- package/src/memory/attachments-store.ts +0 -1
- package/src/memory/channel-delivery-store.ts +0 -1
- package/src/memory/conversation-key-store.ts +0 -1
- package/src/memory/db.ts +472 -148
- package/src/memory/llm-usage-store.ts +0 -1
- package/src/memory/runs-store.ts +51 -6
- package/src/memory/schema.ts +2 -6
- package/src/runtime/gateway-client.ts +7 -1
- package/src/runtime/http-server.ts +174 -7
- package/src/runtime/routes/channel-routes.ts +7 -2
- package/src/runtime/routes/events-routes.ts +79 -0
- package/src/runtime/routes/run-routes.ts +43 -0
- package/src/runtime/run-orchestrator.ts +64 -7
- package/src/security/oauth-callback-registry.ts +66 -0
- package/src/security/oauth2.ts +208 -58
- package/src/subagent/manager.ts +3 -1
- package/src/swarm/backend-claude-code.ts +1 -1
- package/src/tools/assets/search.ts +1 -36
- package/src/tools/claude-code/claude-code.ts +3 -3
- package/src/tools/tasks/work-item-list.ts +16 -2
- package/src/tools/tasks/work-item-run.ts +78 -0
- package/src/util/platform.ts +1 -1
- package/src/work-items/work-item-runner.ts +171 -0
- package/src/workspace/provider-commit-message-generator.ts +39 -23
- package/src/workspace/turn-commit.ts +6 -2
- package/src/__tests__/handlers-twilio-config.test.ts +0 -221
- package/src/calls/__tests__/twilio-webhook-urls.test.ts +0 -162
- package/src/calls/twilio-webhook-urls.ts +0 -50
|
@@ -0,0 +1,112 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Centralized URL builders for all public-facing ingress endpoints.
|
|
3
|
+
*
|
|
4
|
+
* ## Source-of-truth precedence
|
|
5
|
+
*
|
|
6
|
+
* The canonical public base URL is resolved through a two-level chain:
|
|
7
|
+
*
|
|
8
|
+
* 1. **User Settings** (`config.ingress.publicBaseUrl`) — set via the
|
|
9
|
+
* Settings UI or `config set ingress.publicBaseUrl`. This is the
|
|
10
|
+
* primary source of truth. When the assistant spawns or restarts
|
|
11
|
+
* the gateway, this value is forwarded as the `INGRESS_PUBLIC_BASE_URL`
|
|
12
|
+
* environment variable so both processes agree on the same URL.
|
|
13
|
+
*
|
|
14
|
+
* 2. **Environment variable** (`INGRESS_PUBLIC_BASE_URL`) — serves as a
|
|
15
|
+
* fallback for operational use (e.g. direct gateway-only deployments
|
|
16
|
+
* without the assistant, or CI overrides). When the assistant is
|
|
17
|
+
* managing the gateway, the env var is set automatically from (1).
|
|
18
|
+
*
|
|
19
|
+
* This chain ensures that:
|
|
20
|
+
* - The assistant's outbound callback URLs (Twilio webhooks, OAuth
|
|
21
|
+
* redirect URIs, etc.) match the gateway's inbound signature
|
|
22
|
+
* reconstruction URL.
|
|
23
|
+
* - Changing the URL in Settings propagates to the gateway on restart,
|
|
24
|
+
* eliminating Twilio signature mismatch risk.
|
|
25
|
+
*
|
|
26
|
+
* All public-facing ingress URL construction is centralized here.
|
|
27
|
+
*/
|
|
28
|
+
|
|
29
|
+
export interface IngressConfig {
|
|
30
|
+
ingress?: { publicBaseUrl?: string };
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
/**
|
|
34
|
+
* Trim whitespace and strip trailing slashes from a URL string.
|
|
35
|
+
*/
|
|
36
|
+
function normalizeUrl(url: string): string {
|
|
37
|
+
return url.trim().replace(/\/+$/, '');
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
/**
|
|
41
|
+
* Resolve the canonical public base URL using the precedence chain
|
|
42
|
+
* documented at the top of this module.
|
|
43
|
+
*
|
|
44
|
+
* Throws if no source provides a non-empty value.
|
|
45
|
+
*/
|
|
46
|
+
export function getPublicBaseUrl(config: IngressConfig): string {
|
|
47
|
+
const ingressValue = config.ingress?.publicBaseUrl;
|
|
48
|
+
if (ingressValue) {
|
|
49
|
+
const normalized = normalizeUrl(ingressValue);
|
|
50
|
+
if (normalized) return normalized;
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
const ingressEnvValue = process.env.INGRESS_PUBLIC_BASE_URL;
|
|
54
|
+
if (ingressEnvValue) {
|
|
55
|
+
const normalized = normalizeUrl(ingressEnvValue);
|
|
56
|
+
if (normalized) return normalized;
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
throw new Error(
|
|
60
|
+
'No public base URL configured. Set ingress.publicBaseUrl in config or INGRESS_PUBLIC_BASE_URL env var.',
|
|
61
|
+
);
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
/**
|
|
65
|
+
* Build the Twilio voice webhook URL for a given call session.
|
|
66
|
+
*/
|
|
67
|
+
export function getTwilioVoiceWebhookUrl(config: IngressConfig, callSessionId: string): string {
|
|
68
|
+
const base = getPublicBaseUrl(config);
|
|
69
|
+
return `${base}/webhooks/twilio/voice?callSessionId=${callSessionId}`;
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
/**
|
|
73
|
+
* Build the Twilio status callback URL.
|
|
74
|
+
*/
|
|
75
|
+
export function getTwilioStatusCallbackUrl(config: IngressConfig): string {
|
|
76
|
+
const base = getPublicBaseUrl(config);
|
|
77
|
+
return `${base}/webhooks/twilio/status`;
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
/**
|
|
81
|
+
* Build the Twilio connect-action callback URL.
|
|
82
|
+
*/
|
|
83
|
+
export function getTwilioConnectActionUrl(config: IngressConfig): string {
|
|
84
|
+
const base = getPublicBaseUrl(config);
|
|
85
|
+
return `${base}/webhooks/twilio/connect-action`;
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
/**
|
|
89
|
+
* Build the Twilio ConversationRelay WebSocket URL.
|
|
90
|
+
* Converts http:// → ws:// and https:// → wss://.
|
|
91
|
+
*/
|
|
92
|
+
export function getTwilioRelayUrl(config: IngressConfig): string {
|
|
93
|
+
const base = getPublicBaseUrl(config);
|
|
94
|
+
const wsBase = base.replace(/^http(s?)/, 'ws$1');
|
|
95
|
+
return `${wsBase}/webhooks/twilio/relay`;
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
/**
|
|
99
|
+
* Build the OAuth callback URL.
|
|
100
|
+
*/
|
|
101
|
+
export function getOAuthCallbackUrl(config: IngressConfig): string {
|
|
102
|
+
const base = getPublicBaseUrl(config);
|
|
103
|
+
return `${base}/webhooks/oauth/callback`;
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
/**
|
|
107
|
+
* Build the Telegram webhook URL.
|
|
108
|
+
*/
|
|
109
|
+
export function getTelegramWebhookUrl(config: IngressConfig): string {
|
|
110
|
+
const base = getPublicBaseUrl(config);
|
|
111
|
+
return `${base}/webhooks/telegram`;
|
|
112
|
+
}
|