@vellumai/assistant 0.4.33 → 0.4.35
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/package.json +1 -1
- package/src/__tests__/access-request-decision.test.ts +2 -3
- package/src/__tests__/actor-token-service.test.ts +4 -11
- package/src/__tests__/approval-primitive.test.ts +0 -45
- package/src/__tests__/assistant-id-boundary-guard.test.ts +169 -0
- package/src/__tests__/callback-handoff-copy.test.ts +0 -1
- package/src/__tests__/channel-approval-routes.test.ts +5 -45
- package/src/__tests__/channel-guardian.test.ts +122 -345
- package/src/__tests__/confirmation-request-guardian-bridge.test.ts +4 -3
- package/src/__tests__/contacts-tools.test.ts +4 -5
- package/src/__tests__/conversation-attention-store.test.ts +2 -65
- package/src/__tests__/conversation-attention-telegram.test.ts +0 -2
- package/src/__tests__/conversation-pairing.test.ts +0 -1
- package/src/__tests__/deterministic-verification-control-plane.test.ts +0 -2
- package/src/__tests__/guardian-action-conversation-turn.test.ts +1 -7
- package/src/__tests__/guardian-action-grant-mint-consume.test.ts +0 -74
- package/src/__tests__/guardian-action-late-reply.test.ts +1 -8
- package/src/__tests__/guardian-grant-minting.test.ts +0 -1
- package/src/__tests__/guardian-routing-state.test.ts +0 -3
- package/src/__tests__/inbound-invite-redemption.test.ts +0 -3
- package/src/__tests__/non-member-access-request.test.ts +0 -7
- package/src/__tests__/notification-broadcaster.test.ts +1 -2
- package/src/__tests__/notification-decision-fallback.test.ts +0 -2
- package/src/__tests__/notification-decision-strategy.test.ts +0 -1
- package/src/__tests__/relay-server.test.ts +11 -83
- package/src/__tests__/scoped-approval-grants.test.ts +9 -40
- package/src/__tests__/scoped-grant-security-matrix.test.ts +0 -36
- package/src/__tests__/send-endpoint-busy.test.ts +0 -1
- package/src/__tests__/send-notification-tool.test.ts +0 -1
- package/src/__tests__/slack-inbound-verification.test.ts +2 -4
- package/src/__tests__/thread-seed-composer.test.ts +0 -1
- package/src/__tests__/tool-approval-handler.test.ts +0 -1
- package/src/__tests__/tool-grant-request-escalation.test.ts +0 -4
- package/src/__tests__/trusted-contact-approval-notifier.test.ts +1 -5
- package/src/__tests__/trusted-contact-lifecycle-notifications.test.ts +1 -17
- package/src/__tests__/trusted-contact-multichannel.test.ts +0 -13
- package/src/__tests__/trusted-contact-verification.test.ts +3 -15
- package/src/__tests__/twilio-routes.test.ts +2 -2
- package/src/__tests__/voice-invite-redemption.test.ts +0 -1
- package/src/__tests__/voice-scoped-grant-consumer.test.ts +0 -37
- package/src/approvals/approval-primitive.ts +0 -15
- package/src/approvals/guardian-decision-primitive.ts +0 -3
- package/src/approvals/guardian-request-resolvers.ts +0 -5
- package/src/calls/call-domain.ts +0 -3
- package/src/calls/call-store.ts +0 -3
- package/src/calls/guardian-action-sweep.ts +2 -1
- package/src/calls/guardian-dispatch.ts +1 -2
- package/src/calls/relay-access-wait.ts +0 -4
- package/src/calls/relay-server.ts +3 -11
- package/src/calls/relay-setup-router.ts +1 -2
- package/src/calls/relay-verification.ts +0 -1
- package/src/calls/twilio-routes.ts +0 -3
- package/src/calls/types.ts +0 -1
- package/src/calls/voice-session-bridge.ts +0 -1
- package/src/config/bundled-skills/google-oauth-setup/SKILL.md +100 -171
- package/src/config/bundled-skills/notifications/tools/send-notification.ts +0 -1
- package/src/contacts/contact-store.ts +13 -88
- package/src/contacts/contacts-write.ts +3 -11
- package/src/contacts/types.ts +0 -1
- package/src/daemon/handlers/config-channels.ts +16 -42
- package/src/daemon/handlers/config-inbox.ts +6 -6
- package/src/daemon/handlers/contacts.ts +3 -11
- package/src/daemon/handlers/index.ts +0 -2
- package/src/daemon/session-process.ts +0 -4
- package/src/memory/conversation-attention-store.ts +4 -19
- package/src/memory/conversation-crud.ts +0 -2
- package/src/memory/db-init.ts +4 -0
- package/src/memory/guardian-action-store.ts +0 -12
- package/src/memory/guardian-approvals.ts +35 -80
- package/src/memory/guardian-rate-limits.ts +1 -14
- package/src/memory/guardian-verification.ts +6 -34
- package/src/memory/invite-store.ts +5 -14
- package/src/memory/migrations/026-guardian-verification-sessions.ts +28 -9
- package/src/memory/migrations/027a-guardian-bootstrap-token.ts +16 -3
- package/src/memory/migrations/038-actor-token-records.ts +8 -1
- package/src/memory/migrations/039-actor-refresh-token-records.ts +11 -2
- package/src/memory/migrations/110-channel-guardian.ts +27 -6
- package/src/memory/migrations/112-assistant-inbox.ts +39 -15
- package/src/memory/migrations/114-notifications.ts +37 -15
- package/src/memory/migrations/117-conversation-attention.ts +33 -9
- package/src/memory/migrations/134-contacts-notes-column.ts +64 -45
- package/src/memory/migrations/136-drop-assistant-id-columns.ts +263 -0
- package/src/memory/migrations/index.ts +1 -0
- package/src/memory/migrations/registry.ts +14 -1
- package/src/memory/migrations/schema-introspection.ts +18 -0
- package/src/memory/schema/calls.ts +0 -7
- package/src/memory/schema/contacts.ts +0 -8
- package/src/memory/schema/guardian.ts +0 -5
- package/src/memory/schema/infrastructure.ts +0 -2
- package/src/memory/schema/notifications.ts +3 -17
- package/src/memory/scoped-approval-grants.ts +2 -24
- package/src/notifications/adapters/sms.ts +2 -1
- package/src/notifications/broadcaster.ts +1 -6
- package/src/notifications/decision-engine.ts +3 -4
- package/src/notifications/deliveries-store.ts +0 -4
- package/src/notifications/destination-resolver.ts +4 -6
- package/src/notifications/deterministic-checks.ts +1 -6
- package/src/notifications/emit-signal.ts +4 -11
- package/src/notifications/events-store.ts +7 -17
- package/src/notifications/preference-summary.ts +2 -2
- package/src/notifications/preferences-store.ts +2 -9
- package/src/notifications/signal.ts +0 -1
- package/src/notifications/thread-candidates.ts +1 -11
- package/src/notifications/types.ts +0 -3
- package/src/runtime/access-request-helper.ts +3 -10
- package/src/runtime/actor-refresh-token-store.ts +0 -6
- package/src/runtime/actor-token-store.ts +3 -16
- package/src/runtime/actor-trust-resolver.ts +1 -4
- package/src/runtime/auth/__tests__/credential-service.test.ts +0 -9
- package/src/runtime/auth/credential-service.ts +1 -15
- package/src/runtime/auth/require-bound-guardian.ts +1 -4
- package/src/runtime/channel-guardian-service.ts +15 -46
- package/src/runtime/channel-invite-transport.ts +8 -0
- package/src/runtime/channel-invite-transports/email.ts +4 -0
- package/src/runtime/channel-invite-transports/slack.ts +6 -0
- package/src/runtime/channel-invite-transports/sms.ts +4 -0
- package/src/runtime/channel-invite-transports/telegram.ts +6 -0
- package/src/runtime/confirmation-request-guardian-bridge.ts +0 -1
- package/src/runtime/guardian-action-followup-executor.ts +3 -2
- package/src/runtime/guardian-action-grant-minter.ts +0 -1
- package/src/runtime/guardian-outbound-actions.ts +2 -12
- package/src/runtime/guardian-vellum-migration.ts +2 -3
- package/src/runtime/http-server.ts +3 -10
- package/src/runtime/http-types.ts +13 -1
- package/src/runtime/invite-redemption-service.ts +1 -14
- package/src/runtime/local-actor-identity.ts +2 -5
- package/src/runtime/routes/access-request-decision.ts +0 -1
- package/src/runtime/routes/approval-strategies/guardian-callback-strategy.ts +0 -9
- package/src/runtime/routes/channel-readiness-routes.ts +29 -18
- package/src/runtime/routes/contact-routes.ts +15 -40
- package/src/runtime/routes/conversation-attention-routes.ts +0 -2
- package/src/runtime/routes/global-search-routes.ts +0 -2
- package/src/runtime/routes/guardian-bootstrap-routes.ts +6 -7
- package/src/runtime/routes/guardian-expiry-sweep.ts +3 -2
- package/src/runtime/routes/inbound-message-handler.ts +0 -3
- package/src/runtime/routes/inbound-stages/acl-enforcement.ts +7 -43
- package/src/runtime/routes/inbound-stages/background-dispatch.ts +1 -4
- package/src/runtime/routes/inbound-stages/bootstrap-intercept.ts +1 -6
- package/src/runtime/routes/inbound-stages/escalation-intercept.ts +0 -1
- package/src/runtime/routes/inbound-stages/secret-ingress-check.ts +0 -1
- package/src/runtime/routes/inbound-stages/verification-intercept.ts +3 -7
- package/src/runtime/routes/pairing-routes.ts +4 -4
- package/src/runtime/routes/surface-content-routes.ts +104 -0
- package/src/runtime/tool-grant-request-helper.ts +0 -1
- package/src/tools/browser/browser-manager.ts +22 -21
- package/src/tools/browser/runtime-check.ts +111 -6
- package/src/tools/calls/call-start.ts +1 -3
- package/src/tools/followups/followup_create.ts +1 -2
- package/src/tools/tool-approval-handler.ts +0 -2
|
@@ -351,11 +351,12 @@ describe("bridgeConfirmationRequestToGuardian", () => {
|
|
|
351
351
|
expect(emittedSignals).toHaveLength(0);
|
|
352
352
|
});
|
|
353
353
|
|
|
354
|
-
test("
|
|
354
|
+
test("does not pass assistantId to notification signal", () => {
|
|
355
355
|
const canonicalRequest = makeCanonicalRequest();
|
|
356
356
|
const trustContext = makeTrustedContactContext();
|
|
357
357
|
|
|
358
|
-
//
|
|
358
|
+
// assistantId is used internally for guardian binding lookup but is no
|
|
359
|
+
// longer forwarded to the notification signal after the assistantId removal refactor.
|
|
359
360
|
bridgeConfirmationRequestToGuardian({
|
|
360
361
|
canonicalRequest,
|
|
361
362
|
trustContext,
|
|
@@ -363,7 +364,7 @@ describe("bridgeConfirmationRequestToGuardian", () => {
|
|
|
363
364
|
toolName: "bash",
|
|
364
365
|
});
|
|
365
366
|
|
|
366
|
-
expect(emittedSignals[0].assistantId).
|
|
367
|
+
expect(emittedSignals[0].assistantId).toBeUndefined();
|
|
367
368
|
});
|
|
368
369
|
|
|
369
370
|
test("includes requesterChatId as null when not provided", () => {
|
|
@@ -74,7 +74,6 @@ initializeDb();
|
|
|
74
74
|
|
|
75
75
|
// ── Lightweight gateway stub ─────────────────────────────────────────────────
|
|
76
76
|
|
|
77
|
-
const TEST_ASSISTANT_ID = "test-assistant";
|
|
78
77
|
let testServer: ReturnType<typeof Bun.serve>;
|
|
79
78
|
|
|
80
79
|
beforeAll(() => {
|
|
@@ -85,17 +84,17 @@ beforeAll(() => {
|
|
|
85
84
|
const path = url.pathname;
|
|
86
85
|
|
|
87
86
|
if (path === "/v1/contacts/merge" && req.method === "POST") {
|
|
88
|
-
return handleMergeContacts(req
|
|
87
|
+
return handleMergeContacts(req);
|
|
89
88
|
}
|
|
90
89
|
if (path === "/v1/contacts" && req.method === "GET") {
|
|
91
|
-
return handleListContacts(url
|
|
90
|
+
return handleListContacts(url);
|
|
92
91
|
}
|
|
93
92
|
if (path === "/v1/contacts" && req.method === "POST") {
|
|
94
|
-
return handleUpsertContact(req
|
|
93
|
+
return handleUpsertContact(req);
|
|
95
94
|
}
|
|
96
95
|
const idMatch = path.match(/^\/v1\/contacts\/([^/]+)$/);
|
|
97
96
|
if (idMatch && req.method === "GET") {
|
|
98
|
-
return handleGetContact(idMatch[1]
|
|
97
|
+
return handleGetContact(idMatch[1]);
|
|
99
98
|
}
|
|
100
99
|
return new Response("Not found", { status: 404 });
|
|
101
100
|
},
|
|
@@ -86,7 +86,6 @@ describe("conversation-attention-store", () => {
|
|
|
86
86
|
ensureConversation("conv-1");
|
|
87
87
|
projectAssistantMessage({
|
|
88
88
|
conversationId: "conv-1",
|
|
89
|
-
assistantId: "self",
|
|
90
89
|
messageId: "msg-1",
|
|
91
90
|
messageAt: 1000,
|
|
92
91
|
});
|
|
@@ -104,13 +103,11 @@ describe("conversation-attention-store", () => {
|
|
|
104
103
|
ensureConversation("conv-1");
|
|
105
104
|
projectAssistantMessage({
|
|
106
105
|
conversationId: "conv-1",
|
|
107
|
-
assistantId: "self",
|
|
108
106
|
messageId: "msg-1",
|
|
109
107
|
messageAt: 1000,
|
|
110
108
|
});
|
|
111
109
|
projectAssistantMessage({
|
|
112
110
|
conversationId: "conv-1",
|
|
113
|
-
assistantId: "self",
|
|
114
111
|
messageId: "msg-2",
|
|
115
112
|
messageAt: 2000,
|
|
116
113
|
});
|
|
@@ -125,13 +122,11 @@ describe("conversation-attention-store", () => {
|
|
|
125
122
|
ensureConversation("conv-1");
|
|
126
123
|
projectAssistantMessage({
|
|
127
124
|
conversationId: "conv-1",
|
|
128
|
-
assistantId: "self",
|
|
129
125
|
messageId: "msg-2",
|
|
130
126
|
messageAt: 2000,
|
|
131
127
|
});
|
|
132
128
|
projectAssistantMessage({
|
|
133
129
|
conversationId: "conv-1",
|
|
134
|
-
assistantId: "self",
|
|
135
130
|
messageId: "msg-1",
|
|
136
131
|
messageAt: 1000,
|
|
137
132
|
});
|
|
@@ -146,13 +141,11 @@ describe("conversation-attention-store", () => {
|
|
|
146
141
|
ensureConversation("conv-1");
|
|
147
142
|
projectAssistantMessage({
|
|
148
143
|
conversationId: "conv-1",
|
|
149
|
-
assistantId: "self",
|
|
150
144
|
messageId: "msg-1",
|
|
151
145
|
messageAt: 1000,
|
|
152
146
|
});
|
|
153
147
|
projectAssistantMessage({
|
|
154
148
|
conversationId: "conv-1",
|
|
155
|
-
assistantId: "self",
|
|
156
149
|
messageId: "msg-1-dup",
|
|
157
150
|
messageAt: 1000,
|
|
158
151
|
});
|
|
@@ -170,7 +163,6 @@ describe("conversation-attention-store", () => {
|
|
|
170
163
|
ensureConversation("conv-1");
|
|
171
164
|
const event = recordConversationSeenSignal({
|
|
172
165
|
conversationId: "conv-1",
|
|
173
|
-
assistantId: "self",
|
|
174
166
|
sourceChannel: "vellum",
|
|
175
167
|
signalType: "macos_conversation_opened",
|
|
176
168
|
confidence: "explicit",
|
|
@@ -189,7 +181,6 @@ describe("conversation-attention-store", () => {
|
|
|
189
181
|
// Project an assistant message first
|
|
190
182
|
projectAssistantMessage({
|
|
191
183
|
conversationId: "conv-1",
|
|
192
|
-
assistantId: "self",
|
|
193
184
|
messageId: "msg-1",
|
|
194
185
|
messageAt: 1000,
|
|
195
186
|
});
|
|
@@ -197,7 +188,6 @@ describe("conversation-attention-store", () => {
|
|
|
197
188
|
// Now record a seen signal
|
|
198
189
|
recordConversationSeenSignal({
|
|
199
190
|
conversationId: "conv-1",
|
|
200
|
-
assistantId: "self",
|
|
201
191
|
sourceChannel: "vellum",
|
|
202
192
|
signalType: "macos_conversation_opened",
|
|
203
193
|
confidence: "explicit",
|
|
@@ -215,7 +205,6 @@ describe("conversation-attention-store", () => {
|
|
|
215
205
|
|
|
216
206
|
recordConversationSeenSignal({
|
|
217
207
|
conversationId: "conv-1",
|
|
218
|
-
assistantId: "self",
|
|
219
208
|
sourceChannel: "telegram",
|
|
220
209
|
signalType: "telegram_inbound_message",
|
|
221
210
|
confidence: "inferred",
|
|
@@ -236,7 +225,6 @@ describe("conversation-attention-store", () => {
|
|
|
236
225
|
// Project two assistant messages
|
|
237
226
|
projectAssistantMessage({
|
|
238
227
|
conversationId: "conv-1",
|
|
239
|
-
assistantId: "self",
|
|
240
228
|
messageId: "msg-1",
|
|
241
229
|
messageAt: 1000,
|
|
242
230
|
});
|
|
@@ -244,7 +232,6 @@ describe("conversation-attention-store", () => {
|
|
|
244
232
|
// Mark as seen at msg-1
|
|
245
233
|
recordConversationSeenSignal({
|
|
246
234
|
conversationId: "conv-1",
|
|
247
|
-
assistantId: "self",
|
|
248
235
|
sourceChannel: "vellum",
|
|
249
236
|
signalType: "macos_conversation_opened",
|
|
250
237
|
confidence: "explicit",
|
|
@@ -254,7 +241,6 @@ describe("conversation-attention-store", () => {
|
|
|
254
241
|
// Project a second message
|
|
255
242
|
projectAssistantMessage({
|
|
256
243
|
conversationId: "conv-1",
|
|
257
|
-
assistantId: "self",
|
|
258
244
|
messageId: "msg-2",
|
|
259
245
|
messageAt: 2000,
|
|
260
246
|
});
|
|
@@ -262,7 +248,6 @@ describe("conversation-attention-store", () => {
|
|
|
262
248
|
// Mark as seen at msg-2
|
|
263
249
|
recordConversationSeenSignal({
|
|
264
250
|
conversationId: "conv-1",
|
|
265
|
-
assistantId: "self",
|
|
266
251
|
sourceChannel: "vellum",
|
|
267
252
|
signalType: "macos_conversation_opened",
|
|
268
253
|
confidence: "explicit",
|
|
@@ -280,7 +265,6 @@ describe("conversation-attention-store", () => {
|
|
|
280
265
|
|
|
281
266
|
const event = recordConversationSeenSignal({
|
|
282
267
|
conversationId: "conv-1",
|
|
283
|
-
assistantId: "self",
|
|
284
268
|
sourceChannel: "telegram",
|
|
285
269
|
signalType: "telegram_callback",
|
|
286
270
|
confidence: "explicit",
|
|
@@ -301,7 +285,6 @@ describe("conversation-attention-store", () => {
|
|
|
301
285
|
// Record seen signal without any assistant message
|
|
302
286
|
recordConversationSeenSignal({
|
|
303
287
|
conversationId: "conv-1",
|
|
304
|
-
assistantId: "self",
|
|
305
288
|
sourceChannel: "vellum",
|
|
306
289
|
signalType: "macos_notification_view",
|
|
307
290
|
confidence: "inferred",
|
|
@@ -320,7 +303,6 @@ describe("conversation-attention-store", () => {
|
|
|
320
303
|
|
|
321
304
|
projectAssistantMessage({
|
|
322
305
|
conversationId: "conv-1",
|
|
323
|
-
assistantId: "self",
|
|
324
306
|
messageId: "msg-1",
|
|
325
307
|
messageAt: 1000,
|
|
326
308
|
});
|
|
@@ -328,7 +310,6 @@ describe("conversation-attention-store", () => {
|
|
|
328
310
|
// Mark as seen
|
|
329
311
|
recordConversationSeenSignal({
|
|
330
312
|
conversationId: "conv-1",
|
|
331
|
-
assistantId: "self",
|
|
332
313
|
sourceChannel: "vellum",
|
|
333
314
|
signalType: "macos_conversation_opened",
|
|
334
315
|
confidence: "explicit",
|
|
@@ -338,7 +319,6 @@ describe("conversation-attention-store", () => {
|
|
|
338
319
|
// Record another seen signal (should not regress)
|
|
339
320
|
recordConversationSeenSignal({
|
|
340
321
|
conversationId: "conv-1",
|
|
341
|
-
assistantId: "self",
|
|
342
322
|
sourceChannel: "telegram",
|
|
343
323
|
signalType: "telegram_inbound_message",
|
|
344
324
|
confidence: "inferred",
|
|
@@ -369,13 +349,11 @@ describe("conversation-attention-store", () => {
|
|
|
369
349
|
|
|
370
350
|
projectAssistantMessage({
|
|
371
351
|
conversationId: "conv-1",
|
|
372
|
-
assistantId: "self",
|
|
373
352
|
messageId: "msg-1",
|
|
374
353
|
messageAt: 1000,
|
|
375
354
|
});
|
|
376
355
|
projectAssistantMessage({
|
|
377
356
|
conversationId: "conv-2",
|
|
378
|
-
assistantId: "self",
|
|
379
357
|
messageId: "msg-2",
|
|
380
358
|
messageAt: 2000,
|
|
381
359
|
});
|
|
@@ -392,7 +370,6 @@ describe("conversation-attention-store", () => {
|
|
|
392
370
|
|
|
393
371
|
projectAssistantMessage({
|
|
394
372
|
conversationId: "conv-1",
|
|
395
|
-
assistantId: "self",
|
|
396
373
|
messageId: "msg-1",
|
|
397
374
|
messageAt: 1000,
|
|
398
375
|
});
|
|
@@ -413,18 +390,16 @@ describe("conversation-attention-store", () => {
|
|
|
413
390
|
|
|
414
391
|
projectAssistantMessage({
|
|
415
392
|
conversationId: "conv-1",
|
|
416
|
-
assistantId: "self",
|
|
417
393
|
messageId: "msg-1",
|
|
418
394
|
messageAt: 1000,
|
|
419
395
|
});
|
|
420
396
|
projectAssistantMessage({
|
|
421
397
|
conversationId: "conv-2",
|
|
422
|
-
assistantId: "self",
|
|
423
398
|
messageId: "msg-2",
|
|
424
399
|
messageAt: 2000,
|
|
425
400
|
});
|
|
426
401
|
|
|
427
|
-
const result = listConversationAttention({
|
|
402
|
+
const result = listConversationAttention({});
|
|
428
403
|
expect(result).toHaveLength(2);
|
|
429
404
|
});
|
|
430
405
|
|
|
@@ -435,7 +410,6 @@ describe("conversation-attention-store", () => {
|
|
|
435
410
|
// conv-1: has assistant message, not seen
|
|
436
411
|
projectAssistantMessage({
|
|
437
412
|
conversationId: "conv-1",
|
|
438
|
-
assistantId: "self",
|
|
439
413
|
messageId: "msg-1",
|
|
440
414
|
messageAt: 1000,
|
|
441
415
|
});
|
|
@@ -443,13 +417,11 @@ describe("conversation-attention-store", () => {
|
|
|
443
417
|
// conv-2: has assistant message, seen
|
|
444
418
|
projectAssistantMessage({
|
|
445
419
|
conversationId: "conv-2",
|
|
446
|
-
assistantId: "self",
|
|
447
420
|
messageId: "msg-2",
|
|
448
421
|
messageAt: 2000,
|
|
449
422
|
});
|
|
450
423
|
recordConversationSeenSignal({
|
|
451
424
|
conversationId: "conv-2",
|
|
452
|
-
assistantId: "self",
|
|
453
425
|
sourceChannel: "vellum",
|
|
454
426
|
signalType: "macos_conversation_opened",
|
|
455
427
|
confidence: "explicit",
|
|
@@ -457,7 +429,6 @@ describe("conversation-attention-store", () => {
|
|
|
457
429
|
});
|
|
458
430
|
|
|
459
431
|
const unseen = listConversationAttention({
|
|
460
|
-
assistantId: "self",
|
|
461
432
|
state: "unseen",
|
|
462
433
|
});
|
|
463
434
|
expect(unseen).toHaveLength(1);
|
|
@@ -470,20 +441,17 @@ describe("conversation-attention-store", () => {
|
|
|
470
441
|
|
|
471
442
|
projectAssistantMessage({
|
|
472
443
|
conversationId: "conv-1",
|
|
473
|
-
assistantId: "self",
|
|
474
444
|
messageId: "msg-1",
|
|
475
445
|
messageAt: 1000,
|
|
476
446
|
});
|
|
477
447
|
|
|
478
448
|
projectAssistantMessage({
|
|
479
449
|
conversationId: "conv-2",
|
|
480
|
-
assistantId: "self",
|
|
481
450
|
messageId: "msg-2",
|
|
482
451
|
messageAt: 2000,
|
|
483
452
|
});
|
|
484
453
|
recordConversationSeenSignal({
|
|
485
454
|
conversationId: "conv-2",
|
|
486
|
-
assistantId: "self",
|
|
487
455
|
sourceChannel: "vellum",
|
|
488
456
|
signalType: "macos_conversation_opened",
|
|
489
457
|
confidence: "explicit",
|
|
@@ -491,7 +459,6 @@ describe("conversation-attention-store", () => {
|
|
|
491
459
|
});
|
|
492
460
|
|
|
493
461
|
const seen = listConversationAttention({
|
|
494
|
-
assistantId: "self",
|
|
495
462
|
state: "seen",
|
|
496
463
|
});
|
|
497
464
|
expect(seen).toHaveLength(1);
|
|
@@ -505,25 +472,21 @@ describe("conversation-attention-store", () => {
|
|
|
505
472
|
|
|
506
473
|
projectAssistantMessage({
|
|
507
474
|
conversationId: "conv-1",
|
|
508
|
-
assistantId: "self",
|
|
509
475
|
messageId: "msg-1",
|
|
510
476
|
messageAt: 1000,
|
|
511
477
|
});
|
|
512
478
|
projectAssistantMessage({
|
|
513
479
|
conversationId: "conv-2",
|
|
514
|
-
assistantId: "self",
|
|
515
480
|
messageId: "msg-2",
|
|
516
481
|
messageAt: 2000,
|
|
517
482
|
});
|
|
518
483
|
projectAssistantMessage({
|
|
519
484
|
conversationId: "conv-3",
|
|
520
|
-
assistantId: "self",
|
|
521
485
|
messageId: "msg-3",
|
|
522
486
|
messageAt: 3000,
|
|
523
487
|
});
|
|
524
488
|
|
|
525
489
|
const result = listConversationAttention({
|
|
526
|
-
assistantId: "self",
|
|
527
490
|
limit: 2,
|
|
528
491
|
});
|
|
529
492
|
expect(result).toHaveLength(2);
|
|
@@ -536,24 +499,21 @@ describe("conversation-attention-store", () => {
|
|
|
536
499
|
|
|
537
500
|
projectAssistantMessage({
|
|
538
501
|
conversationId: "conv-1",
|
|
539
|
-
assistantId: "self",
|
|
540
502
|
messageId: "msg-1",
|
|
541
503
|
messageAt: 1000,
|
|
542
504
|
});
|
|
543
505
|
projectAssistantMessage({
|
|
544
506
|
conversationId: "conv-2",
|
|
545
|
-
assistantId: "self",
|
|
546
507
|
messageId: "msg-2",
|
|
547
508
|
messageAt: 3000,
|
|
548
509
|
});
|
|
549
510
|
projectAssistantMessage({
|
|
550
511
|
conversationId: "conv-3",
|
|
551
|
-
assistantId: "self",
|
|
552
512
|
messageId: "msg-3",
|
|
553
513
|
messageAt: 2000,
|
|
554
514
|
});
|
|
555
515
|
|
|
556
|
-
const result = listConversationAttention({
|
|
516
|
+
const result = listConversationAttention({});
|
|
557
517
|
expect(result[0].conversationId).toBe("conv-2");
|
|
558
518
|
expect(result[1].conversationId).toBe("conv-3");
|
|
559
519
|
expect(result[2].conversationId).toBe("conv-1");
|
|
@@ -566,47 +526,27 @@ describe("conversation-attention-store", () => {
|
|
|
566
526
|
|
|
567
527
|
projectAssistantMessage({
|
|
568
528
|
conversationId: "conv-1",
|
|
569
|
-
assistantId: "self",
|
|
570
529
|
messageId: "msg-1",
|
|
571
530
|
messageAt: 1000,
|
|
572
531
|
});
|
|
573
532
|
projectAssistantMessage({
|
|
574
533
|
conversationId: "conv-2",
|
|
575
|
-
assistantId: "self",
|
|
576
534
|
messageId: "msg-2",
|
|
577
535
|
messageAt: 2000,
|
|
578
536
|
});
|
|
579
537
|
projectAssistantMessage({
|
|
580
538
|
conversationId: "conv-3",
|
|
581
|
-
assistantId: "self",
|
|
582
539
|
messageId: "msg-3",
|
|
583
540
|
messageAt: 3000,
|
|
584
541
|
});
|
|
585
542
|
|
|
586
543
|
const result = listConversationAttention({
|
|
587
|
-
assistantId: "self",
|
|
588
544
|
before: 2500,
|
|
589
545
|
});
|
|
590
546
|
expect(result).toHaveLength(2);
|
|
591
547
|
expect(result[0].conversationId).toBe("conv-2");
|
|
592
548
|
expect(result[1].conversationId).toBe("conv-1");
|
|
593
549
|
});
|
|
594
|
-
|
|
595
|
-
test("filters by different assistant ID", () => {
|
|
596
|
-
ensureConversation("conv-1");
|
|
597
|
-
|
|
598
|
-
projectAssistantMessage({
|
|
599
|
-
conversationId: "conv-1",
|
|
600
|
-
assistantId: "self",
|
|
601
|
-
messageId: "msg-1",
|
|
602
|
-
messageAt: 1000,
|
|
603
|
-
});
|
|
604
|
-
|
|
605
|
-
const result = listConversationAttention({
|
|
606
|
-
assistantId: "other-assistant",
|
|
607
|
-
});
|
|
608
|
-
expect(result).toHaveLength(0);
|
|
609
|
-
});
|
|
610
550
|
});
|
|
611
551
|
|
|
612
552
|
// ── Evidence immutability ───────────────────────────────────────
|
|
@@ -617,14 +557,12 @@ describe("conversation-attention-store", () => {
|
|
|
617
557
|
|
|
618
558
|
projectAssistantMessage({
|
|
619
559
|
conversationId: "conv-1",
|
|
620
|
-
assistantId: "self",
|
|
621
560
|
messageId: "msg-1",
|
|
622
561
|
messageAt: 1000,
|
|
623
562
|
});
|
|
624
563
|
|
|
625
564
|
recordConversationSeenSignal({
|
|
626
565
|
conversationId: "conv-1",
|
|
627
|
-
assistantId: "self",
|
|
628
566
|
sourceChannel: "vellum",
|
|
629
567
|
signalType: "macos_notification_view",
|
|
630
568
|
confidence: "inferred",
|
|
@@ -633,7 +571,6 @@ describe("conversation-attention-store", () => {
|
|
|
633
571
|
|
|
634
572
|
recordConversationSeenSignal({
|
|
635
573
|
conversationId: "conv-1",
|
|
636
|
-
assistantId: "self",
|
|
637
574
|
sourceChannel: "vellum",
|
|
638
575
|
signalType: "macos_conversation_opened",
|
|
639
576
|
confidence: "explicit",
|
|
@@ -92,7 +92,6 @@ function resetTables(): void {
|
|
|
92
92
|
function ensureTestContact(): void {
|
|
93
93
|
upsertContact({
|
|
94
94
|
displayName: "Test User",
|
|
95
|
-
assistantId: "self",
|
|
96
95
|
channels: [
|
|
97
96
|
{
|
|
98
97
|
type: "telegram",
|
|
@@ -297,7 +296,6 @@ describe("Telegram callback seen signals", () => {
|
|
|
297
296
|
const { createGuardianBinding } =
|
|
298
297
|
await import("../contacts/contacts-write.js");
|
|
299
298
|
createGuardianBinding({
|
|
300
|
-
assistantId: "self",
|
|
301
299
|
channel: "telegram",
|
|
302
300
|
guardianExternalUserId: "telegram-user-default",
|
|
303
301
|
guardianDeliveryChatId: "chat-123",
|
|
@@ -243,7 +243,6 @@ describe("Verification control messages are deterministic (guard)", () => {
|
|
|
243
243
|
const challengeHash = createHash("sha256").update(secret).digest("hex");
|
|
244
244
|
createChallenge({
|
|
245
245
|
id: "challenge-guard-test",
|
|
246
|
-
assistantId: "self",
|
|
247
246
|
channel: "telegram",
|
|
248
247
|
challengeHash,
|
|
249
248
|
expiresAt: Date.now() + 600_000,
|
|
@@ -329,7 +328,6 @@ describe("Verification control messages are deterministic (guard)", () => {
|
|
|
329
328
|
.digest("hex");
|
|
330
329
|
|
|
331
330
|
createOutboundSession({
|
|
332
|
-
assistantId: "self",
|
|
333
331
|
channel: "telegram",
|
|
334
332
|
identityBindingStatus: "pending_bootstrap",
|
|
335
333
|
destinationAddress: "test_user",
|
|
@@ -359,7 +359,6 @@ describe("guardian-action-conversation-turn", () => {
|
|
|
359
359
|
});
|
|
360
360
|
|
|
361
361
|
const deliveries = getFollowupDeliveriesByDestination(
|
|
362
|
-
"self",
|
|
363
362
|
"telegram",
|
|
364
363
|
"chat-abc",
|
|
365
364
|
);
|
|
@@ -370,11 +369,7 @@ describe("guardian-action-conversation-turn", () => {
|
|
|
370
369
|
test("getFollowupDeliveriesByDestination returns empty for non-matching channel", () => {
|
|
371
370
|
createAwaitingChoiceRequest("conv-turn-2", { chatId: "chat-abc" });
|
|
372
371
|
|
|
373
|
-
const deliveries = getFollowupDeliveriesByDestination(
|
|
374
|
-
"self",
|
|
375
|
-
"sms",
|
|
376
|
-
"chat-abc",
|
|
377
|
-
);
|
|
372
|
+
const deliveries = getFollowupDeliveriesByDestination("sms", "chat-abc");
|
|
378
373
|
expect(deliveries).toHaveLength(0);
|
|
379
374
|
});
|
|
380
375
|
|
|
@@ -410,7 +405,6 @@ describe("guardian-action-conversation-turn", () => {
|
|
|
410
405
|
|
|
411
406
|
// followup_state is 'none' — should not appear
|
|
412
407
|
const deliveries = getFollowupDeliveriesByDestination(
|
|
413
|
-
"self",
|
|
414
408
|
"telegram",
|
|
415
409
|
"chat-none",
|
|
416
410
|
);
|