@vellumai/assistant 0.4.15 → 0.4.17

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.
Files changed (73) hide show
  1. package/Dockerfile +6 -6
  2. package/README.md +1 -2
  3. package/package.json +1 -1
  4. package/src/__tests__/approval-routes-http.test.ts +383 -254
  5. package/src/__tests__/call-controller.test.ts +1074 -751
  6. package/src/__tests__/call-routes-http.test.ts +329 -279
  7. package/src/__tests__/channel-approval-routes.test.ts +2 -13
  8. package/src/__tests__/channel-approvals.test.ts +227 -182
  9. package/src/__tests__/channel-guardian.test.ts +1 -0
  10. package/src/__tests__/conversation-attention-telegram.test.ts +157 -114
  11. package/src/__tests__/conversation-routes-guardian-reply.test.ts +164 -104
  12. package/src/__tests__/conversation-routes.test.ts +71 -41
  13. package/src/__tests__/daemon-server-session-init.test.ts +258 -191
  14. package/src/__tests__/deterministic-verification-control-plane.test.ts +183 -134
  15. package/src/__tests__/extract-email.test.ts +42 -0
  16. package/src/__tests__/gateway-only-enforcement.test.ts +467 -368
  17. package/src/__tests__/gateway-only-guard.test.ts +54 -55
  18. package/src/__tests__/gmail-integration.test.ts +48 -46
  19. package/src/__tests__/guardian-action-followup-executor.test.ts +215 -150
  20. package/src/__tests__/guardian-outbound-http.test.ts +334 -208
  21. package/src/__tests__/guardian-routing-invariants.test.ts +680 -613
  22. package/src/__tests__/guardian-routing-state.test.ts +257 -209
  23. package/src/__tests__/guardian-verification-voice-binding.test.ts +47 -40
  24. package/src/__tests__/handle-user-message-secret-resume.test.ts +44 -21
  25. package/src/__tests__/handlers-user-message-approval-consumption.test.ts +269 -195
  26. package/src/__tests__/inbound-invite-redemption.test.ts +194 -151
  27. package/src/__tests__/ingress-reconcile.test.ts +184 -142
  28. package/src/__tests__/non-member-access-request.test.ts +291 -247
  29. package/src/__tests__/notification-telegram-adapter.test.ts +60 -46
  30. package/src/__tests__/pairing-concurrent.test.ts +78 -0
  31. package/src/__tests__/recording-intent-handler.test.ts +422 -291
  32. package/src/__tests__/runtime-attachment-metadata.test.ts +107 -69
  33. package/src/__tests__/runtime-events-sse.test.ts +67 -50
  34. package/src/__tests__/send-endpoint-busy.test.ts +314 -232
  35. package/src/__tests__/session-approval-overrides.test.ts +93 -91
  36. package/src/__tests__/sms-messaging-provider.test.ts +74 -47
  37. package/src/__tests__/trusted-contact-approval-notifier.test.ts +339 -274
  38. package/src/__tests__/trusted-contact-inline-approval-integration.test.ts +484 -372
  39. package/src/__tests__/trusted-contact-lifecycle-notifications.test.ts +261 -239
  40. package/src/__tests__/trusted-contact-multichannel.test.ts +179 -140
  41. package/src/__tests__/twilio-config.test.ts +49 -41
  42. package/src/__tests__/twilio-routes-elevenlabs.test.ts +189 -162
  43. package/src/__tests__/twilio-routes.test.ts +389 -280
  44. package/src/calls/call-controller.ts +1 -1
  45. package/src/calls/guardian-action-sweep.ts +6 -6
  46. package/src/calls/twilio-routes.ts +2 -4
  47. package/src/config/bundled-skills/chatgpt-import/tools/chatgpt-import.ts +29 -4
  48. package/src/config/bundled-skills/messaging/SKILL.md +5 -4
  49. package/src/config/bundled-skills/messaging/tools/messaging-reply.ts +69 -4
  50. package/src/config/env.ts +39 -29
  51. package/src/daemon/handlers/config-inbox.ts +5 -5
  52. package/src/daemon/handlers/skills.ts +18 -10
  53. package/src/daemon/ipc-contract/messages.ts +1 -0
  54. package/src/daemon/ipc-contract/surfaces.ts +7 -1
  55. package/src/daemon/pairing-store.ts +15 -2
  56. package/src/daemon/session-agent-loop-handlers.ts +5 -0
  57. package/src/daemon/session-agent-loop.ts +1 -1
  58. package/src/daemon/session-process.ts +1 -1
  59. package/src/daemon/session-slash.ts +4 -4
  60. package/src/daemon/session-surfaces.ts +42 -2
  61. package/src/runtime/auth/token-service.ts +95 -45
  62. package/src/runtime/channel-retry-sweep.ts +2 -2
  63. package/src/runtime/http-server.ts +8 -7
  64. package/src/runtime/http-types.ts +1 -1
  65. package/src/runtime/routes/conversation-routes.ts +1 -1
  66. package/src/runtime/routes/guardian-bootstrap-routes.ts +3 -2
  67. package/src/runtime/routes/guardian-expiry-sweep.ts +5 -5
  68. package/src/runtime/routes/pairing-routes.ts +4 -1
  69. package/src/sequence/reply-matcher.ts +14 -4
  70. package/src/skills/frontmatter.ts +9 -6
  71. package/src/tools/ui-surface/definitions.ts +3 -1
  72. package/src/util/platform.ts +0 -12
  73. package/docs/architecture/http-token-refresh.md +0 -274
@@ -1,4 +1,4 @@
1
- import { beforeEach,describe, expect, mock, test } from 'bun:test';
1
+ import { beforeEach, describe, expect, mock, test } from "bun:test";
2
2
 
3
3
  // ── Mocks (must come before source imports) ──────────────────────────
4
4
 
@@ -7,93 +7,101 @@ let mockPhoneNumberEnv: string | undefined;
7
7
  let mockWssBaseUrl: string | undefined;
8
8
  let mockLoadConfigResult: Record<string, unknown> = {};
9
9
 
10
- mock.module('../util/logger.js', () => ({
11
- getLogger: () => new Proxy({} as Record<string, unknown>, {
12
- get: () => () => {},
13
- }),
10
+ mock.module("../util/logger.js", () => ({
11
+ getLogger: () =>
12
+ new Proxy({} as Record<string, unknown>, {
13
+ get: () => () => {},
14
+ }),
14
15
  }));
15
16
 
16
- mock.module('../security/secure-keys.js', () => ({
17
+ mock.module("../security/secure-keys.js", () => ({
17
18
  getSecureKey: (key: string) => mockSecureKeys[key] ?? null,
18
19
  }));
19
20
 
20
- mock.module('../config/env.js', () => ({
21
+ mock.module("../config/env.js", () => ({
22
+ isHttpAuthDisabled: () => true,
21
23
  getTwilioPhoneNumberEnv: () => mockPhoneNumberEnv,
22
24
  getTwilioWssBaseUrl: () => mockWssBaseUrl,
23
25
  }));
24
26
 
25
- mock.module('../config/loader.js', () => ({
27
+ mock.module("../config/loader.js", () => ({
26
28
  loadConfig: () => mockLoadConfigResult,
27
29
  }));
28
30
 
29
- mock.module('../inbound/public-ingress-urls.js', () => ({
30
- getPublicBaseUrl: () => 'https://test.example.com',
31
- getTwilioRelayUrl: () => 'wss://test.example.com/twilio/relay',
31
+ mock.module("../inbound/public-ingress-urls.js", () => ({
32
+ getPublicBaseUrl: () => "https://test.example.com",
33
+ getTwilioRelayUrl: () => "wss://test.example.com/twilio/relay",
32
34
  }));
33
35
 
34
- import { getTwilioConfig } from '../calls/twilio-config.js';
36
+ import { getTwilioConfig } from "../calls/twilio-config.js";
35
37
 
36
- describe('twilio-config', () => {
38
+ describe("twilio-config", () => {
37
39
  beforeEach(() => {
38
40
  mockSecureKeys = {
39
- 'credential:twilio:account_sid': 'AC_test_sid',
40
- 'credential:twilio:auth_token': 'test_auth_token',
41
+ "credential:twilio:account_sid": "AC_test_sid",
42
+ "credential:twilio:auth_token": "test_auth_token",
41
43
  };
42
44
  mockPhoneNumberEnv = undefined;
43
45
  mockWssBaseUrl = undefined;
44
46
  mockLoadConfigResult = {
45
- sms: { phoneNumber: '+15551234567' },
47
+ sms: { phoneNumber: "+15551234567" },
46
48
  };
47
49
  });
48
50
 
49
- test('returns config when credentials and phone number are set', () => {
51
+ test("returns config when credentials and phone number are set", () => {
50
52
  const config = getTwilioConfig();
51
- expect(config.accountSid).toBe('AC_test_sid');
52
- expect(config.authToken).toBe('test_auth_token');
53
- expect(config.phoneNumber).toBe('+15551234567');
54
- expect(config.webhookBaseUrl).toBe('https://test.example.com');
55
- expect(config.wssBaseUrl).toBe('wss://test.example.com/twilio/relay');
53
+ expect(config.accountSid).toBe("AC_test_sid");
54
+ expect(config.authToken).toBe("test_auth_token");
55
+ expect(config.phoneNumber).toBe("+15551234567");
56
+ expect(config.webhookBaseUrl).toBe("https://test.example.com");
57
+ expect(config.wssBaseUrl).toBe("wss://test.example.com/twilio/relay");
56
58
  });
57
59
 
58
- test('throws ConfigError when account SID is missing', () => {
59
- mockSecureKeys['credential:twilio:account_sid'] = null;
60
- expect(() => getTwilioConfig()).toThrow(/Twilio credentials not configured/);
60
+ test("throws ConfigError when account SID is missing", () => {
61
+ mockSecureKeys["credential:twilio:account_sid"] = null;
62
+ expect(() => getTwilioConfig()).toThrow(
63
+ /Twilio credentials not configured/,
64
+ );
61
65
  });
62
66
 
63
- test('throws ConfigError when auth token is missing', () => {
64
- mockSecureKeys['credential:twilio:auth_token'] = null;
65
- expect(() => getTwilioConfig()).toThrow(/Twilio credentials not configured/);
67
+ test("throws ConfigError when auth token is missing", () => {
68
+ mockSecureKeys["credential:twilio:auth_token"] = null;
69
+ expect(() => getTwilioConfig()).toThrow(
70
+ /Twilio credentials not configured/,
71
+ );
66
72
  });
67
73
 
68
- test('throws ConfigError when phone number is missing', () => {
74
+ test("throws ConfigError when phone number is missing", () => {
69
75
  mockLoadConfigResult = { sms: {} };
70
76
  mockPhoneNumberEnv = undefined;
71
- mockSecureKeys['credential:twilio:phone_number'] = null;
72
- expect(() => getTwilioConfig()).toThrow(/Twilio phone number not configured/);
77
+ mockSecureKeys["credential:twilio:phone_number"] = null;
78
+ expect(() => getTwilioConfig()).toThrow(
79
+ /Twilio phone number not configured/,
80
+ );
73
81
  });
74
82
 
75
- test('prefers TWILIO_PHONE_NUMBER env var over config phone number', () => {
76
- mockPhoneNumberEnv = '+15559999999';
83
+ test("prefers TWILIO_PHONE_NUMBER env var over config phone number", () => {
84
+ mockPhoneNumberEnv = "+15559999999";
77
85
  const config = getTwilioConfig();
78
- expect(config.phoneNumber).toBe('+15559999999');
86
+ expect(config.phoneNumber).toBe("+15559999999");
79
87
  });
80
88
 
81
- test('falls back to secure key for phone number', () => {
89
+ test("falls back to secure key for phone number", () => {
82
90
  mockLoadConfigResult = { sms: {} };
83
91
  mockPhoneNumberEnv = undefined;
84
- mockSecureKeys['credential:twilio:phone_number'] = '+15558888888';
92
+ mockSecureKeys["credential:twilio:phone_number"] = "+15558888888";
85
93
  const config = getTwilioConfig();
86
- expect(config.phoneNumber).toBe('+15558888888');
94
+ expect(config.phoneNumber).toBe("+15558888888");
87
95
  });
88
96
 
89
- test('returns global phone number when assistantPhoneNumbers mapping exists', () => {
97
+ test("returns global phone number when assistantPhoneNumbers mapping exists", () => {
90
98
  mockLoadConfigResult = {
91
99
  sms: {
92
- phoneNumber: '+15551234567',
93
- assistantPhoneNumbers: { 'ast-1': '+15557777777' },
100
+ phoneNumber: "+15551234567",
101
+ assistantPhoneNumbers: { "ast-1": "+15557777777" },
94
102
  },
95
103
  };
96
104
  const config = getTwilioConfig();
97
- expect(config.phoneNumber).toBe('+15551234567');
105
+ expect(config.phoneNumber).toBe("+15551234567");
98
106
  });
99
107
  });