@vellumai/assistant 0.4.37 → 0.4.41
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/ARCHITECTURE.md +3 -3
- package/README.md +13 -13
- package/bun.lock +80 -24
- package/docs/architecture/integrations.md +126 -128
- package/docs/runbook-trusted-contacts.md +1 -1
- package/docs/trusted-contact-access.md +12 -12
- package/package.json +3 -1
- package/src/__tests__/__snapshots__/ipc-snapshot.test.ts.snap +0 -14
- package/src/__tests__/app-bundler.test.ts +209 -0
- package/src/__tests__/app-compiler.test.ts +279 -0
- package/src/__tests__/app-executors.test.ts +293 -483
- package/src/__tests__/app-migration.test.ts +148 -0
- package/src/__tests__/app-routes-csp.test.ts +202 -0
- package/src/__tests__/avatar-e2e.test.ts +452 -0
- package/src/__tests__/avatar-generator.test.ts +193 -0
- package/src/__tests__/avatar-router.test.ts +186 -0
- package/src/__tests__/browser-download-timeout.test.ts +28 -0
- package/src/__tests__/bundled-skill-retrieval-guard.test.ts +9 -9
- package/src/__tests__/call-domain.test.ts +3 -7
- package/src/__tests__/credential-security-e2e.test.ts +19 -12
- package/src/__tests__/credentials-cli.test.ts +30 -4
- package/src/__tests__/guardian-verify-setup-skill-regression.test.ts +1 -1
- package/src/__tests__/handlers-slack-config.test.ts +0 -72
- package/src/__tests__/handlers-telegram-config.test.ts +19 -12
- package/src/__tests__/handlers-twitter-config.test.ts +105 -48
- package/src/__tests__/inbound-invite-redemption.test.ts +4 -4
- package/src/__tests__/integration-status.test.ts +15 -5
- package/src/__tests__/integrations-cli.test.ts +1 -1
- package/src/__tests__/invite-redemption-service.test.ts +62 -7
- package/src/__tests__/ipc-snapshot.test.ts +0 -8
- package/src/__tests__/managed-avatar-client.test.ts +280 -0
- package/src/__tests__/mcp-cli.test.ts +3 -3
- package/src/__tests__/oauth-cli.test.ts +203 -0
- package/src/__tests__/relay-server.test.ts +3 -3
- package/src/__tests__/secret-onetime-send.test.ts +19 -12
- package/src/__tests__/secure-keys.test.ts +78 -0
- package/src/__tests__/session-messaging-secret-redirect.test.ts +3 -0
- package/src/__tests__/slack-channel-config.test.ts +23 -16
- package/src/__tests__/slack-share-routes.test.ts +263 -0
- package/src/__tests__/sms-messaging-provider.test.ts +3 -1
- package/src/__tests__/trusted-contact-lifecycle-notifications.test.ts +7 -7
- package/src/__tests__/trusted-contact-multichannel.test.ts +3 -3
- package/src/__tests__/trusted-contact-verification.test.ts +10 -10
- package/src/__tests__/twilio-config.test.ts +15 -36
- package/src/__tests__/twilio-provider.test.ts +4 -0
- package/src/__tests__/twitter-auth-handler.test.ts +27 -14
- package/src/__tests__/twitter-cli-error-shaping.test.ts +1 -1
- package/src/__tests__/twitter-cli-routing.test.ts +38 -53
- package/src/__tests__/twitter-oauth-client.test.ts +18 -47
- package/src/__tests__/voice-invite-redemption.test.ts +27 -3
- package/src/amazon/cart.ts +1 -1
- package/src/amazon/client.ts +89 -7
- package/src/approvals/guardian-request-resolvers.ts +2 -2
- package/src/bundler/app-bundler.ts +77 -32
- package/src/bundler/app-compiler.ts +195 -0
- package/src/bundler/manifest.ts +1 -1
- package/src/bundler/package-resolver.ts +185 -0
- package/src/calls/call-domain.ts +4 -14
- package/src/calls/relay-server.ts +2 -2
- package/src/calls/twilio-config.ts +5 -24
- package/src/calls/twilio-rest.ts +19 -5
- package/src/cli/amazon.ts +74 -249
- package/src/cli/audit.ts +2 -2
- package/src/cli/autonomy.ts +9 -9
- package/src/cli/channels.ts +5 -5
- package/src/cli/completions.ts +27 -27
- package/src/cli/config.ts +14 -14
- package/src/cli/contacts.ts +27 -27
- package/src/cli/credentials.ts +28 -28
- package/src/cli/dev.ts +2 -2
- package/src/cli/doctor.ts +2 -2
- package/src/cli/email.ts +82 -82
- package/src/cli/influencer.ts +13 -13
- package/src/cli/integrations.ts +19 -144
- package/src/cli/keys.ts +10 -10
- package/src/cli/map.ts +4 -4
- package/src/cli/mcp.ts +17 -17
- package/src/cli/memory.ts +18 -18
- package/src/cli/notifications.ts +13 -13
- package/src/cli/oauth.ts +77 -0
- package/src/cli/program.ts +2 -0
- package/src/cli/sequence.ts +27 -27
- package/src/cli/sessions.ts +12 -12
- package/src/cli/trust.ts +8 -8
- package/src/cli/twitter.ts +124 -70
- package/src/config/bundled-skills/_shared/CLI_RETRIEVAL_PATTERN.md +1 -1
- package/src/config/bundled-skills/agentmail/SKILL.md +34 -34
- package/src/config/bundled-skills/amazon/SKILL.md +54 -54
- package/src/config/bundled-skills/app-builder/SKILL.md +137 -3
- package/src/config/bundled-skills/app-builder/tools/app-create.ts +10 -4
- package/src/config/bundled-skills/configure-settings/SKILL.md +18 -18
- package/src/config/bundled-skills/contacts/SKILL.md +12 -12
- package/src/config/bundled-skills/doordash/lib/client.ts +7 -9
- package/src/config/bundled-skills/email-setup/SKILL.md +4 -4
- package/src/config/bundled-skills/frontend-design/icon.svg +16 -0
- package/src/config/bundled-skills/google-oauth-setup/SKILL.md +143 -162
- package/src/config/bundled-skills/guardian-verify-setup/SKILL.md +4 -4
- package/src/config/bundled-skills/influencer/SKILL.md +13 -13
- package/src/config/bundled-skills/mcp-setup/SKILL.md +11 -11
- package/src/config/bundled-skills/phone-calls/SKILL.md +48 -54
- package/src/config/bundled-skills/public-ingress/SKILL.md +6 -6
- package/src/config/bundled-skills/slack-app-setup/SKILL.md +1 -1
- package/src/config/bundled-skills/sms-setup/SKILL.md +3 -3
- package/src/config/bundled-skills/telegram-setup/SKILL.md +2 -2
- package/src/config/bundled-skills/twilio-setup/SKILL.md +136 -225
- package/src/config/bundled-skills/twitter/SKILL.md +68 -44
- package/src/config/bundled-skills/voice-setup/SKILL.md +2 -2
- package/src/config/core-schema.ts +26 -0
- package/src/config/env.ts +4 -0
- package/src/config/feature-flag-registry.json +9 -1
- package/src/config/schema.ts +8 -0
- package/src/config/system-prompt.ts +6 -3
- package/src/config/templates/BOOTSTRAP.md +7 -5
- package/src/contacts/contacts-write.ts +5 -1
- package/src/daemon/handlers/apps.ts +31 -4
- package/src/daemon/handlers/config-ingress.ts +3 -3
- package/src/daemon/handlers/config-integrations.ts +120 -49
- package/src/daemon/handlers/config-slack-channel.ts +26 -7
- package/src/daemon/handlers/config-slack.ts +1 -54
- package/src/daemon/handlers/config-telegram.ts +28 -10
- package/src/daemon/handlers/config.ts +1 -4
- package/src/daemon/handlers/twitter-auth.ts +11 -4
- package/src/daemon/ipc-contract/apps.ts +0 -13
- package/src/daemon/ipc-contract-inventory.json +0 -2
- package/src/daemon/lifecycle.ts +8 -1
- package/src/daemon/session-messaging.ts +2 -2
- package/src/daemon/tool-side-effects.ts +30 -0
- package/src/email/providers/agentmail.ts +1 -1
- package/src/email/providers/index.ts +1 -1
- package/src/email/service.ts +1 -1
- package/src/gallery/default-gallery.ts +538 -0
- package/src/gallery/gallery-manifest.ts +5 -1
- package/src/influencer/client.ts +8 -6
- package/src/mcp/client.ts +1 -1
- package/src/media/avatar-router.ts +99 -0
- package/src/media/avatar-types.ts +60 -0
- package/src/media/managed-avatar-client.ts +189 -0
- package/src/memory/app-migration.ts +114 -0
- package/src/memory/app-store.ts +11 -0
- package/src/memory/qdrant-client.ts +1 -1
- package/src/messaging/providers/slack/client.ts +12 -2
- package/src/messaging/providers/sms/adapter.ts +6 -10
- package/src/migrations/data-layout.ts +8 -1
- package/src/oauth/token-persistence.ts +9 -6
- package/src/runtime/assistant-scope.ts +5 -0
- package/src/runtime/auth/route-policy.ts +4 -0
- package/src/runtime/channel-readiness-service.ts +9 -4
- package/src/runtime/gateway-internal-client.ts +11 -3
- package/src/runtime/http-server.ts +2 -0
- package/src/runtime/invite-redemption-service.ts +23 -13
- package/src/runtime/middleware/twilio-validation.ts +2 -2
- package/src/runtime/routes/app-routes.ts +131 -3
- package/src/runtime/routes/inbound-stages/verification-intercept.ts +3 -3
- package/src/runtime/routes/integration-routes.ts +2 -2
- package/src/runtime/routes/slack-share-routes.ts +235 -0
- package/src/runtime/routes/twilio-routes.ts +47 -34
- package/src/schedule/integration-status.ts +2 -3
- package/src/security/token-manager.ts +11 -3
- package/src/tools/apps/executors.ts +116 -8
- package/src/tools/browser/browser-manager.ts +30 -2
- package/src/tools/browser/chrome-cdp.ts +31 -3
- package/src/tools/credentials/vault.ts +9 -7
- package/src/tools/executor.ts +4 -0
- package/src/tools/system/avatar-generator.ts +55 -34
- package/src/twitter/client.ts +1 -1
- package/src/twitter/oauth-client.ts +31 -43
- package/src/twitter/router.ts +25 -23
- package/src/util/platform.ts +5 -0
- package/src/slack/slack-webhook.ts +0 -66
package/src/calls/call-domain.ts
CHANGED
|
@@ -123,7 +123,6 @@ export type CallerIdentityResult =
|
|
|
123
123
|
export async function resolveCallerIdentity(
|
|
124
124
|
config: AssistantConfig,
|
|
125
125
|
requestedMode?: "assistant_number" | "user_number",
|
|
126
|
-
assistantId?: string,
|
|
127
126
|
): Promise<CallerIdentityResult> {
|
|
128
127
|
const identityConfig = config.calls.callerIdentity;
|
|
129
128
|
let mode: "assistant_number" | "user_number";
|
|
@@ -161,7 +160,7 @@ export async function resolveCallerIdentity(
|
|
|
161
160
|
}
|
|
162
161
|
|
|
163
162
|
if (mode === "assistant_number") {
|
|
164
|
-
const twilioConfig = getTwilioConfig(
|
|
163
|
+
const twilioConfig = getTwilioConfig();
|
|
165
164
|
log.info(
|
|
166
165
|
{ mode, source, fromNumber: twilioConfig.phoneNumber },
|
|
167
166
|
"Resolved caller identity",
|
|
@@ -395,7 +394,6 @@ export async function startCall(
|
|
|
395
394
|
const identityResult = await resolveCallerIdentity(
|
|
396
395
|
ingressConfig,
|
|
397
396
|
callerIdentityMode,
|
|
398
|
-
assistantId,
|
|
399
397
|
);
|
|
400
398
|
if (!identityResult.ok) {
|
|
401
399
|
return { ok: false, error: identityResult.error, status: 400 };
|
|
@@ -883,12 +881,8 @@ export type StartGuardianVerificationCallResult =
|
|
|
883
881
|
export async function startGuardianVerificationCall(
|
|
884
882
|
input: StartGuardianVerificationCallInput,
|
|
885
883
|
): Promise<StartGuardianVerificationCallResult> {
|
|
886
|
-
const {
|
|
887
|
-
|
|
888
|
-
guardianVerificationSessionId,
|
|
889
|
-
assistantId = DAEMON_INTERNAL_ASSISTANT_ID,
|
|
890
|
-
originConversationId,
|
|
891
|
-
} = input;
|
|
884
|
+
const { phoneNumber, guardianVerificationSessionId, originConversationId } =
|
|
885
|
+
input;
|
|
892
886
|
|
|
893
887
|
if (!phoneNumber || !E164_REGEX.test(phoneNumber)) {
|
|
894
888
|
return {
|
|
@@ -905,11 +899,7 @@ export async function startGuardianVerificationCall(
|
|
|
905
899
|
const provider = new TwilioConversationRelayProvider();
|
|
906
900
|
|
|
907
901
|
// Resolve the assistant's Twilio number as the caller ID
|
|
908
|
-
const identityResult = await resolveCallerIdentity(
|
|
909
|
-
config,
|
|
910
|
-
undefined,
|
|
911
|
-
assistantId,
|
|
912
|
-
);
|
|
902
|
+
const identityResult = await resolveCallerIdentity(config);
|
|
913
903
|
if (!identityResult.ok) {
|
|
914
904
|
return { ok: false, error: identityResult.error, status: 400 };
|
|
915
905
|
}
|
|
@@ -19,7 +19,7 @@ import {
|
|
|
19
19
|
createGuardianBinding,
|
|
20
20
|
revokeGuardianBinding,
|
|
21
21
|
touchContactInteraction,
|
|
22
|
-
|
|
22
|
+
upsertContactChannel,
|
|
23
23
|
} from "../contacts/contacts-write.js";
|
|
24
24
|
import { getAssistantName } from "../daemon/identity-helpers.js";
|
|
25
25
|
import { getCanonicalGuardianRequest } from "../memory/canonical-guardian-store.js";
|
|
@@ -785,7 +785,7 @@ export class RelayConnection {
|
|
|
785
785
|
|
|
786
786
|
if (!params.skipMemberActivation) {
|
|
787
787
|
try {
|
|
788
|
-
|
|
788
|
+
upsertContactChannel({
|
|
789
789
|
sourceChannel: "voice",
|
|
790
790
|
externalUserId: fromNumber,
|
|
791
791
|
externalChatId: fromNumber,
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import { getTwilioPhoneNumberEnv } from "../config/env.js";
|
|
2
1
|
import { loadConfig } from "../config/loader.js";
|
|
3
2
|
import {
|
|
4
3
|
getPublicBaseUrl,
|
|
@@ -18,29 +17,11 @@ export interface TwilioConfig {
|
|
|
18
17
|
wssBaseUrl: string;
|
|
19
18
|
}
|
|
20
19
|
|
|
21
|
-
function
|
|
22
|
-
config: ReturnType<typeof loadConfig>,
|
|
23
|
-
assistantId?: string,
|
|
24
|
-
): string {
|
|
25
|
-
if (assistantId) {
|
|
26
|
-
const scoped = (
|
|
27
|
-
config.sms?.assistantPhoneNumbers as Record<string, string> | undefined
|
|
28
|
-
)?.[assistantId];
|
|
29
|
-
if (scoped) return scoped;
|
|
30
|
-
}
|
|
31
|
-
return (
|
|
32
|
-
getTwilioPhoneNumberEnv() ||
|
|
33
|
-
config.sms?.phoneNumber ||
|
|
34
|
-
getSecureKey("credential:twilio:phone_number") ||
|
|
35
|
-
""
|
|
36
|
-
);
|
|
37
|
-
}
|
|
38
|
-
|
|
39
|
-
export function getTwilioConfig(assistantId?: string): TwilioConfig {
|
|
40
|
-
const accountSid = getSecureKey("credential:twilio:account_sid");
|
|
41
|
-
const authToken = getSecureKey("credential:twilio:auth_token");
|
|
20
|
+
export function getTwilioConfig(): TwilioConfig {
|
|
42
21
|
const config = loadConfig();
|
|
43
|
-
const
|
|
22
|
+
const accountSid = config.twilio?.accountSid || "";
|
|
23
|
+
const authToken = getSecureKey("credential:twilio:auth_token");
|
|
24
|
+
const phoneNumber = config.twilio?.phoneNumber || "";
|
|
44
25
|
const webhookBaseUrl = getPublicBaseUrl(config);
|
|
45
26
|
|
|
46
27
|
let wssBaseUrl: string;
|
|
@@ -52,7 +33,7 @@ export function getTwilioConfig(assistantId?: string): TwilioConfig {
|
|
|
52
33
|
|
|
53
34
|
if (!accountSid || !authToken) {
|
|
54
35
|
throw new ConfigError(
|
|
55
|
-
"Twilio credentials not configured. Set
|
|
36
|
+
"Twilio credentials not configured. Set twilio.accountSid via config and twilio:auth_token via the credential_store tool.",
|
|
56
37
|
);
|
|
57
38
|
}
|
|
58
39
|
if (!phoneNumber) {
|
package/src/calls/twilio-rest.ts
CHANGED
|
@@ -6,6 +6,7 @@
|
|
|
6
6
|
* config handler. Uses fetch() directly — no twilio npm package.
|
|
7
7
|
*/
|
|
8
8
|
|
|
9
|
+
import { loadConfig } from "../config/loader.js";
|
|
9
10
|
import { getSecureKey } from "../security/secure-keys.js";
|
|
10
11
|
import { ConfigError, ProviderError } from "../util/errors.js";
|
|
11
12
|
|
|
@@ -14,13 +15,27 @@ export interface TwilioCredentials {
|
|
|
14
15
|
authToken: string;
|
|
15
16
|
}
|
|
16
17
|
|
|
17
|
-
/**
|
|
18
|
+
/**
|
|
19
|
+
* Resolve the Twilio Account SID from config.
|
|
20
|
+
* Returns undefined if not found.
|
|
21
|
+
*/
|
|
22
|
+
function resolveAccountSid(): string | undefined {
|
|
23
|
+
try {
|
|
24
|
+
const config = loadConfig();
|
|
25
|
+
if (config.twilio?.accountSid) return config.twilio.accountSid;
|
|
26
|
+
} catch {
|
|
27
|
+
// Config may not be available during early startup
|
|
28
|
+
}
|
|
29
|
+
return undefined;
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
/** Resolve Twilio credentials from config and secure key store. Throws if not configured. */
|
|
18
33
|
export function getTwilioCredentials(): TwilioCredentials {
|
|
19
|
-
const accountSid =
|
|
34
|
+
const accountSid = resolveAccountSid();
|
|
20
35
|
const authToken = getSecureKey("credential:twilio:auth_token");
|
|
21
36
|
if (!accountSid || !authToken) {
|
|
22
37
|
throw new ConfigError(
|
|
23
|
-
"Twilio credentials not configured. Set
|
|
38
|
+
"Twilio credentials not configured. Set twilio.accountSid via config and credential:twilio:auth_token via the credential_store tool.",
|
|
24
39
|
);
|
|
25
40
|
}
|
|
26
41
|
return { accountSid, authToken };
|
|
@@ -29,8 +44,7 @@ export function getTwilioCredentials(): TwilioCredentials {
|
|
|
29
44
|
/** Check whether Twilio credentials are present (non-throwing). */
|
|
30
45
|
export function hasTwilioCredentials(): boolean {
|
|
31
46
|
return (
|
|
32
|
-
!!getSecureKey("credential:twilio:
|
|
33
|
-
!!getSecureKey("credential:twilio:auth_token")
|
|
47
|
+
!!resolveAccountSid() && !!getSecureKey("credential:twilio:auth_token")
|
|
34
48
|
);
|
|
35
49
|
}
|
|
36
50
|
|