@vellumai/assistant 0.4.2 → 0.4.4
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 +3 -0
- package/ARCHITECTURE.md +124 -10
- package/README.md +43 -35
- package/docs/trusted-contact-access.md +20 -0
- package/package.json +1 -1
- package/scripts/ipc/generate-swift.ts +1 -0
- package/src/__tests__/__snapshots__/ipc-snapshot.test.ts.snap +58 -120
- package/src/__tests__/access-request-decision.test.ts +0 -1
- package/src/__tests__/actor-token-service.test.ts +1099 -0
- package/src/__tests__/agent-loop.test.ts +51 -0
- package/src/__tests__/approval-routes-http.test.ts +2 -0
- package/src/__tests__/assistant-events-sse-hardening.test.ts +7 -5
- package/src/__tests__/assistant-id-boundary-guard.test.ts +415 -0
- package/src/__tests__/call-controller.test.ts +49 -0
- package/src/__tests__/call-pointer-message-composer.test.ts +171 -0
- package/src/__tests__/call-pointer-messages.test.ts +93 -3
- package/src/__tests__/call-pointer-no-hardcoded-copy.guard.test.ts +42 -0
- package/src/__tests__/call-routes-http.test.ts +0 -25
- package/src/__tests__/callback-handoff-copy.test.ts +186 -0
- package/src/__tests__/channel-approval-routes.test.ts +133 -12
- package/src/__tests__/channel-guardian.test.ts +0 -86
- package/src/__tests__/channel-readiness-service.test.ts +10 -16
- package/src/__tests__/checker.test.ts +33 -12
- package/src/__tests__/config-schema.test.ts +6 -0
- package/src/__tests__/confirmation-request-guardian-bridge.test.ts +410 -0
- package/src/__tests__/conversation-routes-guardian-reply.test.ts +256 -0
- package/src/__tests__/conversation-routes.test.ts +12 -3
- package/src/__tests__/credential-security-invariants.test.ts +1 -1
- package/src/__tests__/daemon-server-session-init.test.ts +4 -0
- package/src/__tests__/deterministic-verification-control-plane.test.ts +0 -1
- package/src/__tests__/guardian-actions-endpoint.test.ts +39 -13
- package/src/__tests__/guardian-dispatch.test.ts +8 -0
- package/src/__tests__/guardian-outbound-http.test.ts +4 -5
- package/src/__tests__/guardian-question-mode.test.ts +200 -0
- package/src/__tests__/guardian-routing-invariants.test.ts +178 -0
- package/src/__tests__/guardian-routing-state.test.ts +525 -0
- package/src/__tests__/handle-user-message-secret-resume.test.ts +2 -0
- package/src/__tests__/handlers-telegram-config.test.ts +0 -83
- package/src/__tests__/handlers-user-message-approval-consumption.test.ts +55 -0
- package/src/__tests__/headless-browser-navigate.test.ts +2 -0
- package/src/__tests__/inbound-invite-redemption.test.ts +0 -1
- package/src/__tests__/ingress-routes-http.test.ts +55 -0
- package/src/__tests__/ipc-snapshot.test.ts +18 -51
- package/src/__tests__/non-member-access-request.test.ts +159 -9
- package/src/__tests__/notification-decision-fallback.test.ts +129 -4
- package/src/__tests__/notification-decision-strategy.test.ts +106 -2
- package/src/__tests__/notification-guardian-path.test.ts +3 -0
- package/src/__tests__/recording-intent-handler.test.ts +1 -0
- package/src/__tests__/relay-server.test.ts +1475 -33
- package/src/__tests__/send-endpoint-busy.test.ts +5 -0
- package/src/__tests__/session-agent-loop.test.ts +1 -0
- package/src/__tests__/session-confirmation-signals.test.ts +523 -0
- package/src/__tests__/session-init.benchmark.test.ts +0 -2
- package/src/__tests__/session-runtime-assembly.test.ts +4 -1
- package/src/__tests__/session-surfaces-task-progress.test.ts +44 -1
- package/src/__tests__/session-tool-setup-app-refresh.test.ts +81 -2
- package/src/__tests__/session-tool-setup-memory-scope.test.ts +1 -1
- package/src/__tests__/session-tool-setup-side-effect-flag.test.ts +1 -1
- package/src/__tests__/tool-executor.test.ts +21 -2
- package/src/__tests__/tool-grant-request-escalation.test.ts +333 -27
- package/src/__tests__/trusted-contact-approval-notifier.test.ts +678 -0
- package/src/__tests__/trusted-contact-inline-approval-integration.test.ts +1064 -0
- package/src/__tests__/trusted-contact-lifecycle-notifications.test.ts +11 -1
- package/src/__tests__/trusted-contact-multichannel.test.ts +0 -1
- package/src/__tests__/trusted-contact-verification.test.ts +0 -1
- package/src/__tests__/twilio-config.test.ts +2 -13
- package/src/__tests__/twilio-routes.test.ts +4 -3
- package/src/__tests__/update-bulletin.test.ts +0 -1
- package/src/agent/loop.ts +1 -1
- package/src/approvals/guardian-decision-primitive.ts +12 -3
- package/src/approvals/guardian-request-resolvers.ts +169 -11
- package/src/calls/call-constants.ts +29 -0
- package/src/calls/call-controller.ts +11 -3
- package/src/calls/call-domain.ts +33 -11
- package/src/calls/call-pointer-message-composer.ts +154 -0
- package/src/calls/call-pointer-messages.ts +106 -27
- package/src/calls/guardian-dispatch.ts +4 -2
- package/src/calls/relay-server.ts +921 -112
- package/src/calls/twilio-config.ts +4 -11
- package/src/calls/twilio-routes.ts +4 -6
- package/src/calls/types.ts +3 -1
- package/src/calls/voice-session-bridge.ts +4 -3
- package/src/cli/core-commands.ts +7 -4
- package/src/cli.ts +5 -4
- package/src/config/bundled-skills/agentmail/SKILL.md +4 -0
- package/src/config/bundled-skills/app-builder/SKILL.md +309 -10
- package/src/config/bundled-skills/app-builder/TOOLS.json +1 -1
- package/src/config/bundled-skills/email-setup/SKILL.md +1 -1
- package/src/config/bundled-skills/google-oauth-setup/SKILL.md +105 -81
- package/src/config/bundled-skills/messaging/SKILL.md +61 -12
- package/src/config/bundled-skills/messaging/TOOLS.json +58 -0
- package/src/config/bundled-skills/messaging/tools/gmail-sender-digest.ts +6 -1
- package/src/config/bundled-skills/messaging/tools/messaging-archive-by-sender.ts +35 -0
- package/src/config/bundled-skills/messaging/tools/messaging-sender-digest.ts +52 -0
- package/src/config/bundled-skills/phone-calls/SKILL.md +30 -39
- package/src/config/bundled-skills/twitter/SKILL.md +3 -3
- package/src/config/bundled-skills/vercel-token-setup/SKILL.md +215 -0
- package/src/config/calls-schema.ts +36 -0
- package/src/config/env.ts +22 -0
- package/src/config/feature-flag-registry.json +8 -8
- package/src/config/schema.ts +2 -2
- package/src/config/skills.ts +11 -0
- package/src/config/system-prompt.ts +11 -1
- package/src/config/templates/SOUL.md +2 -0
- package/src/config/vellum-skills/sms-setup/SKILL.md +71 -82
- package/src/config/vellum-skills/trusted-contacts/SKILL.md +8 -1
- package/src/config/vellum-skills/twilio-setup/SKILL.md +88 -73
- package/src/daemon/call-pointer-generators.ts +59 -0
- package/src/daemon/computer-use-session.ts +2 -5
- package/src/daemon/handlers/apps.ts +76 -20
- package/src/daemon/handlers/config-channels.ts +9 -61
- package/src/daemon/handlers/config-inbox.ts +11 -3
- package/src/daemon/handlers/config-ingress.ts +28 -3
- package/src/daemon/handlers/config-telegram.ts +12 -0
- package/src/daemon/handlers/config.ts +2 -6
- package/src/daemon/handlers/index.ts +2 -1
- package/src/daemon/handlers/pairing.ts +2 -0
- package/src/daemon/handlers/publish.ts +11 -46
- package/src/daemon/handlers/sessions.ts +59 -5
- package/src/daemon/handlers/shared.ts +17 -2
- package/src/daemon/ipc-contract/apps.ts +1 -0
- package/src/daemon/ipc-contract/inbox.ts +4 -0
- package/src/daemon/ipc-contract/integrations.ts +1 -97
- package/src/daemon/ipc-contract/messages.ts +47 -1
- package/src/daemon/ipc-contract/notifications.ts +11 -0
- package/src/daemon/ipc-contract-inventory.json +2 -4
- package/src/daemon/lifecycle.ts +17 -0
- package/src/daemon/server.ts +16 -2
- package/src/daemon/session-agent-loop-handlers.ts +20 -0
- package/src/daemon/session-agent-loop.ts +24 -12
- package/src/daemon/session-lifecycle.ts +1 -1
- package/src/daemon/session-process.ts +11 -1
- package/src/daemon/session-runtime-assembly.ts +6 -1
- package/src/daemon/session-surfaces.ts +32 -3
- package/src/daemon/session.ts +88 -1
- package/src/daemon/tool-side-effects.ts +22 -0
- package/src/home-base/prebuilt/brain-graph.html +1483 -0
- package/src/home-base/prebuilt/index.html +40 -0
- package/src/inbound/platform-callback-registration.ts +157 -0
- package/src/memory/canonical-guardian-store.ts +1 -1
- package/src/memory/conversation-crud.ts +2 -1
- package/src/memory/conversation-title-service.ts +16 -2
- package/src/memory/db-init.ts +8 -0
- package/src/memory/delivery-crud.ts +2 -1
- package/src/memory/guardian-action-store.ts +2 -1
- package/src/memory/guardian-approvals.ts +3 -2
- package/src/memory/ingress-invite-store.ts +12 -2
- package/src/memory/ingress-member-store.ts +4 -3
- package/src/memory/migrations/038-actor-token-records.ts +39 -0
- package/src/memory/migrations/124-voice-invite-display-metadata.ts +14 -0
- package/src/memory/migrations/index.ts +2 -0
- package/src/memory/schema.ts +26 -5
- package/src/messaging/provider-types.ts +24 -0
- package/src/messaging/provider.ts +7 -0
- package/src/messaging/providers/gmail/adapter.ts +127 -0
- package/src/messaging/providers/sms/adapter.ts +40 -37
- package/src/notifications/adapters/macos.ts +45 -2
- package/src/notifications/broadcaster.ts +16 -0
- package/src/notifications/copy-composer.ts +50 -2
- package/src/notifications/decision-engine.ts +22 -9
- package/src/notifications/destination-resolver.ts +16 -2
- package/src/notifications/emit-signal.ts +18 -9
- package/src/notifications/guardian-question-mode.ts +419 -0
- package/src/notifications/signal.ts +14 -3
- package/src/permissions/checker.ts +13 -1
- package/src/permissions/prompter.ts +14 -0
- package/src/providers/anthropic/client.ts +20 -0
- package/src/providers/provider-send-message.ts +15 -3
- package/src/runtime/access-request-helper.ts +82 -4
- package/src/runtime/actor-token-service.ts +234 -0
- package/src/runtime/actor-token-store.ts +236 -0
- package/src/runtime/actor-trust-resolver.ts +2 -2
- package/src/runtime/assistant-scope.ts +10 -0
- package/src/runtime/channel-approvals.ts +5 -3
- package/src/runtime/channel-readiness-service.ts +23 -64
- package/src/runtime/channel-readiness-types.ts +3 -4
- package/src/runtime/channel-retry-sweep.ts +4 -1
- package/src/runtime/confirmation-request-guardian-bridge.ts +197 -0
- package/src/runtime/guardian-action-followup-executor.ts +1 -1
- package/src/runtime/guardian-context-resolver.ts +82 -0
- package/src/runtime/guardian-outbound-actions.ts +5 -7
- package/src/runtime/guardian-reply-router.ts +67 -30
- package/src/runtime/guardian-vellum-migration.ts +57 -0
- package/src/runtime/http-server.ts +75 -31
- package/src/runtime/http-types.ts +13 -0
- package/src/runtime/ingress-service.ts +14 -0
- package/src/runtime/invite-redemption-service.ts +10 -1
- package/src/runtime/local-actor-identity.ts +76 -0
- package/src/runtime/middleware/actor-token.ts +271 -0
- package/src/runtime/middleware/twilio-validation.ts +2 -4
- package/src/runtime/routes/approval-routes.ts +82 -7
- package/src/runtime/routes/brain-graph-routes.ts +222 -0
- package/src/runtime/routes/call-routes.ts +2 -1
- package/src/runtime/routes/channel-readiness-routes.ts +71 -0
- package/src/runtime/routes/channel-route-shared.ts +3 -3
- package/src/runtime/routes/conversation-attention-routes.ts +2 -1
- package/src/runtime/routes/conversation-routes.ts +142 -53
- package/src/runtime/routes/events-routes.ts +22 -8
- package/src/runtime/routes/guardian-action-routes.ts +45 -3
- package/src/runtime/routes/guardian-approval-interception.ts +29 -0
- package/src/runtime/routes/guardian-bootstrap-routes.ts +145 -0
- package/src/runtime/routes/inbound-conversation.ts +4 -3
- package/src/runtime/routes/inbound-message-handler.ts +147 -5
- package/src/runtime/routes/ingress-routes.ts +2 -0
- package/src/runtime/routes/integration-routes.ts +7 -15
- package/src/runtime/routes/pairing-routes.ts +163 -0
- package/src/runtime/routes/twilio-routes.ts +934 -0
- package/src/runtime/tool-grant-request-helper.ts +3 -1
- package/src/security/oauth2.ts +27 -2
- package/src/security/token-manager.ts +46 -10
- package/src/tools/browser/browser-execution.ts +4 -3
- package/src/tools/browser/browser-handoff.ts +10 -18
- package/src/tools/browser/browser-manager.ts +80 -25
- package/src/tools/browser/browser-screencast.ts +35 -119
- package/src/tools/calls/call-start.ts +2 -1
- package/src/tools/permission-checker.ts +15 -4
- package/src/tools/terminal/parser.ts +12 -0
- package/src/tools/tool-approval-handler.ts +244 -19
- package/src/workspace/git-service.ts +19 -0
- package/src/__tests__/handlers-twilio-config.test.ts +0 -1928
- package/src/daemon/handlers/config-twilio.ts +0 -1082
|
@@ -55,21 +55,67 @@ describe('notification decision strategy', () => {
|
|
|
55
55
|
expect(copy.vellum!.body).toContain('What is the gate code?');
|
|
56
56
|
});
|
|
57
57
|
|
|
58
|
-
test('guardian.question template includes
|
|
58
|
+
test('guardian.question template includes free-text answer instructions when requestCode is present', () => {
|
|
59
59
|
const signal = makeSignal({
|
|
60
60
|
sourceEventName: 'guardian.question',
|
|
61
61
|
contextPayload: {
|
|
62
|
+
requestId: 'req-pending-1',
|
|
62
63
|
questionText: 'What is the gate code?',
|
|
63
64
|
requestCode: 'A1B2C3',
|
|
65
|
+
requestKind: 'pending_question',
|
|
66
|
+
callSessionId: 'call-1',
|
|
67
|
+
activeGuardianRequestCount: 1,
|
|
64
68
|
},
|
|
65
69
|
});
|
|
66
70
|
|
|
67
71
|
const copy = composeFallbackCopy(signal, channels);
|
|
68
72
|
expect(copy.vellum).toBeDefined();
|
|
69
73
|
expect(copy.vellum!.body).toContain('A1B2C3');
|
|
74
|
+
expect(copy.vellum!.body).toContain('<your answer>');
|
|
75
|
+
expect(copy.vellum!.body).not.toContain('approve');
|
|
76
|
+
expect(copy.vellum!.body).not.toContain('reject');
|
|
77
|
+
expect(copy.telegram!.deliveryText).toContain('A1B2C3');
|
|
78
|
+
});
|
|
79
|
+
|
|
80
|
+
test('guardian.question template uses approve/reject instructions for approval-kind request', () => {
|
|
81
|
+
const signal = makeSignal({
|
|
82
|
+
sourceEventName: 'guardian.question',
|
|
83
|
+
contextPayload: {
|
|
84
|
+
requestId: 'req-grant-1',
|
|
85
|
+
questionText: 'Allow running host_bash?',
|
|
86
|
+
requestCode: 'D4E5F6',
|
|
87
|
+
requestKind: 'tool_grant_request',
|
|
88
|
+
toolName: 'host_bash',
|
|
89
|
+
},
|
|
90
|
+
});
|
|
91
|
+
|
|
92
|
+
const copy = composeFallbackCopy(signal, channels);
|
|
93
|
+
expect(copy.vellum).toBeDefined();
|
|
94
|
+
expect(copy.vellum!.body).toContain('D4E5F6');
|
|
70
95
|
expect(copy.vellum!.body).toContain('approve');
|
|
71
96
|
expect(copy.vellum!.body).toContain('reject');
|
|
72
|
-
|
|
97
|
+
});
|
|
98
|
+
|
|
99
|
+
test('guardian.question template uses approve/reject for tool-backed pending_question payloads', () => {
|
|
100
|
+
const signal = makeSignal({
|
|
101
|
+
sourceEventName: 'guardian.question',
|
|
102
|
+
contextPayload: {
|
|
103
|
+
requestId: 'req-voice-tool-1',
|
|
104
|
+
questionText: 'Allow send_email to bob@example.com?',
|
|
105
|
+
requestCode: 'A1B2C3',
|
|
106
|
+
requestKind: 'pending_question',
|
|
107
|
+
callSessionId: 'call-1',
|
|
108
|
+
activeGuardianRequestCount: 1,
|
|
109
|
+
toolName: 'send_email',
|
|
110
|
+
},
|
|
111
|
+
});
|
|
112
|
+
|
|
113
|
+
const copy = composeFallbackCopy(signal, channels);
|
|
114
|
+
expect(copy.vellum).toBeDefined();
|
|
115
|
+
expect(copy.vellum!.body).toContain('A1B2C3');
|
|
116
|
+
expect(copy.vellum!.body).toContain('approve');
|
|
117
|
+
expect(copy.vellum!.body).toContain('reject');
|
|
118
|
+
expect(copy.vellum!.body).not.toContain('<your answer>');
|
|
73
119
|
});
|
|
74
120
|
|
|
75
121
|
test('reminder.fired template uses message from payload', () => {
|
|
@@ -196,6 +242,64 @@ describe('notification decision strategy', () => {
|
|
|
196
242
|
expect(copy.vellum!.body).toContain('open invite flow');
|
|
197
243
|
});
|
|
198
244
|
|
|
245
|
+
test('ingress.access_request template includes revoked-member context when provided', () => {
|
|
246
|
+
const signal = makeSignal({
|
|
247
|
+
sourceEventName: 'ingress.access_request',
|
|
248
|
+
contextPayload: {
|
|
249
|
+
senderIdentifier: 'Charlie',
|
|
250
|
+
previousMemberStatus: 'revoked',
|
|
251
|
+
},
|
|
252
|
+
});
|
|
253
|
+
|
|
254
|
+
const copy = composeFallbackCopy(signal, channels);
|
|
255
|
+
expect(copy.vellum).toBeDefined();
|
|
256
|
+
expect(copy.vellum!.body).toContain('previously revoked');
|
|
257
|
+
});
|
|
258
|
+
|
|
259
|
+
test('ingress.access_request template includes caller name for voice-originated requests', () => {
|
|
260
|
+
// In production, senderIdentifier resolves to senderName for voice
|
|
261
|
+
// calls (senderName || senderUsername || senderExternalUserId), so
|
|
262
|
+
// both values are the caller's name. The phone number arrives via
|
|
263
|
+
// senderExternalUserId and should appear in the parenthetical.
|
|
264
|
+
const signal = makeSignal({
|
|
265
|
+
sourceEventName: 'ingress.access_request',
|
|
266
|
+
contextPayload: {
|
|
267
|
+
senderIdentifier: 'Alice Smith',
|
|
268
|
+
senderName: 'Alice Smith',
|
|
269
|
+
senderExternalUserId: '+15559998888',
|
|
270
|
+
sourceChannel: 'voice',
|
|
271
|
+
requestCode: 'V1C2E3',
|
|
272
|
+
},
|
|
273
|
+
});
|
|
274
|
+
|
|
275
|
+
const copy = composeFallbackCopy(signal, channels);
|
|
276
|
+
expect(copy.vellum).toBeDefined();
|
|
277
|
+
expect(copy.vellum!.title).toBe('Access Request');
|
|
278
|
+
// Voice-originated requests should include the caller name and phone number in parentheses
|
|
279
|
+
expect(copy.vellum!.body).toContain('Alice Smith');
|
|
280
|
+
expect(copy.vellum!.body).toContain('(+15559998888)');
|
|
281
|
+
expect(copy.vellum!.body).toContain('calling');
|
|
282
|
+
});
|
|
283
|
+
|
|
284
|
+
test('ingress.access_request template falls back to non-voice copy when sourceChannel is not voice', () => {
|
|
285
|
+
const signal = makeSignal({
|
|
286
|
+
sourceEventName: 'ingress.access_request',
|
|
287
|
+
contextPayload: {
|
|
288
|
+
senderIdentifier: 'user-123',
|
|
289
|
+
senderName: 'Bob Jones',
|
|
290
|
+
sourceChannel: 'telegram',
|
|
291
|
+
requestCode: 'T1G2M3',
|
|
292
|
+
},
|
|
293
|
+
});
|
|
294
|
+
|
|
295
|
+
const copy = composeFallbackCopy(signal, channels);
|
|
296
|
+
expect(copy.vellum).toBeDefined();
|
|
297
|
+
// Non-voice should use the standard "requesting access" text, not "calling"
|
|
298
|
+
expect(copy.vellum!.body).toContain('user-123');
|
|
299
|
+
expect(copy.vellum!.body).toContain('requesting access');
|
|
300
|
+
expect(copy.vellum!.body).not.toContain('calling');
|
|
301
|
+
});
|
|
302
|
+
|
|
199
303
|
test('ingress.access_request Telegram deliveryText is concise', () => {
|
|
200
304
|
const signal = makeSignal({
|
|
201
305
|
sourceEventName: 'ingress.access_request',
|
|
@@ -181,6 +181,9 @@ describe('ASK_GUARDIAN canonical notification path', () => {
|
|
|
181
181
|
const payload = signalParams.contextPayload as Record<string, unknown>;
|
|
182
182
|
expect(payload.questionText).toBe('What is the gate code?');
|
|
183
183
|
expect(payload.callSessionId).toBe(session.id);
|
|
184
|
+
expect(payload.requestKind).toBe('pending_question');
|
|
185
|
+
expect(payload.toolName).toBeUndefined();
|
|
186
|
+
expect(payload.pendingQuestionId).toBeUndefined();
|
|
184
187
|
expect(payload.requestId).toBeDefined();
|
|
185
188
|
expect(payload.requestCode).toBeDefined();
|
|
186
189
|
});
|
|
@@ -391,6 +391,7 @@ function createCtx(overrides?: Partial<HandlerContext>): {
|
|
|
391
391
|
setChannelCapabilities: noop,
|
|
392
392
|
setGuardianContext: noop,
|
|
393
393
|
setCommandIntent: noop,
|
|
394
|
+
updateClient: noop,
|
|
394
395
|
processMessage: async () => {},
|
|
395
396
|
getQueueDepth: () => 0,
|
|
396
397
|
setPreactivatedSkillIds: noop,
|