@kya-os/mcp-i-core 1.2.2-canary.35 → 1.2.2-canary.36

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.
@@ -0,0 +1,2666 @@
1
+
2
+ > @kya-os/mcp-i-core@1.2.2-canary.36 test /Users/dylanhobbs/Documents/@kya-os/xmcp-i/packages/mcp-i-core
3
+ > vitest run
4
+
5
+
6
+ RUN v4.0.5 /Users/dylanhobbs/Documents/@kya-os/xmcp-i/packages/mcp-i-core
7
+
8
+ ✓ src/__tests__/cache/tool-protection-cache.test.ts (49 tests) 194ms
9
+ stderr | src/services/__tests__/access-control.proof-response-validation.test.ts > Proof Submission Response Validation > Wrapped Response Format (AgentShield API) > should validate wrapped response with success field in data
10
+ [AccessControl] 🔍 RAW API RESPONSE (before parsing): {
11
+ correlationId: '8707998e-3593-4d2e-84da-3df4e845449e',
12
+ status: 200,
13
+ statusText: undefined,
14
+ headers: {},
15
+ responseTextLength: 191,
16
+ responseTextPreview: '{"success":true,"data":{"accepted":1,"rejected":0,"outcomes":{"success":1,"failed":0,"blocked":0,"error":0}},"metadata":{"requestId":"test-request-id","timestamp":"2025-11-24T21:27:09.241Z"}}',
17
+ fullResponseText: '{"success":true,"data":{"accepted":1,"rejected":0,"outcomes":{"success":1,"failed":0,"blocked":0,"error":0}},"metadata":{"requestId":"test-request-id","timestamp":"2025-11-24T21:27:09.241Z"}}'
18
+ }
19
+ [AccessControl] 🔍 PARSED RESPONSE DATA: {
20
+ correlationId: '8707998e-3593-4d2e-84da-3df4e845449e',
21
+ status: 200,
22
+ responseDataType: 'object',
23
+ responseDataKeys: [ 'success', 'data', 'metadata' ],
24
+ responseData: '{\n' +
25
+ ' "success": true,\n' +
26
+ ' "data": {\n' +
27
+ ' "accepted": 1,\n' +
28
+ ' "rejected": 0,\n' +
29
+ ' "outcomes": {\n' +
30
+ ' "success": 1,\n' +
31
+ ' "failed": 0,\n' +
32
+ ' "blocked": 0,\n' +
33
+ ' "error": 0\n' +
34
+ ' }\n' +
35
+ ' },\n' +
36
+ ' "metadata": {\n' +
37
+ ' "requestId": "test-request-id",\n' +
38
+ ' "timestamp": "2025-11-24T21:27:09.241Z"\n' +
39
+ ' }\n' +
40
+ '}'
41
+ }
42
+ [AccessControl] Raw response received: {
43
+ "success": true,
44
+ "data": {
45
+ "accepted": 1,
46
+ "rejected": 0,
47
+ "outcomes": {
48
+ "success": 1,
49
+ "failed": 0,
50
+ "blocked": 0,
51
+ "error": 0
52
+ }
53
+ },
54
+ "metadata": {
55
+ "requestId": "test-request-id",
56
+ "timestamp": "2025-11-24T21:27:09.241Z"
57
+ }
58
+ }
59
+ [AccessControl] 🔍 DATA OBJECT STRUCTURE: {
60
+ correlationId: '8707998e-3593-4d2e-84da-3df4e845449e',
61
+ dataKeys: [ 'accepted', 'rejected', 'outcomes' ],
62
+ hasAccepted: true,
63
+ hasRejected: true,
64
+ hasOutcomes: true,
65
+ hasErrors: false,
66
+ acceptedType: 'number',
67
+ acceptedValue: 1,
68
+ rejectedType: 'number',
69
+ rejectedValue: 0,
70
+ outcomesType: 'object',
71
+ outcomesValue: { success: 1, failed: 0, blocked: 0, error: 0 },
72
+ errorsType: 'undefined',
73
+ errorsIsArray: false,
74
+ fullData: '{\n' +
75
+ ' "accepted": 1,\n' +
76
+ ' "rejected": 0,\n' +
77
+ ' "outcomes": {\n' +
78
+ ' "success": 1,\n' +
79
+ ' "failed": 0,\n' +
80
+ ' "blocked": 0,\n' +
81
+ ' "error": 0\n' +
82
+ ' }\n' +
83
+ '}'
84
+ }
85
+ [AccessControl] 🔍 VALIDATING DATA WITH SUCCESS: {
86
+ correlationId: '8707998e-3593-4d2e-84da-3df4e845449e',
87
+ dataWithSuccessKeys: [ 'success', 'accepted', 'rejected', 'outcomes' ],
88
+ hasSuccess: true,
89
+ successValue: true,
90
+ hasAccepted: true,
91
+ acceptedValue: 1,
92
+ hasRejected: true,
93
+ rejectedValue: 0,
94
+ hasOutcomes: true,
95
+ outcomesValue: { success: 1, failed: 0, blocked: 0, error: 0 },
96
+ fullDataWithSuccess: '{\n' +
97
+ ' "success": true,\n' +
98
+ ' "accepted": 1,\n' +
99
+ ' "rejected": 0,\n' +
100
+ ' "outcomes": {\n' +
101
+ ' "success": 1,\n' +
102
+ ' "failed": 0,\n' +
103
+ ' "blocked": 0,\n' +
104
+ ' "error": 0\n' +
105
+ ' }\n' +
106
+ '}'
107
+ }
108
+
109
+ stderr | src/services/__tests__/access-control.proof-response-validation.test.ts > Proof Submission Response Validation > Wrapped Response Format (AgentShield API) > should validate wrapped response with errors array
110
+ [AccessControl] 🔍 RAW API RESPONSE (before parsing): {
111
+ correlationId: 'fe761a5f-5edf-4479-a037-def4f9d7fb3c',
112
+ status: 200,
113
+ statusText: undefined,
114
+ headers: {},
115
+ responseTextLength: 333,
116
+ responseTextPreview: '{"success":true,"data":{"accepted":0,"rejected":1,"outcomes":{"success":0,"failed":1,"blocked":0,"error":0},"errors":[{"proof_index":0,"error":{"code":"validation_error","message":"Proof validation failed","details":{"reason":"invalid_signature"}}}]},"metadata":{"requestId":"test-request-id","timestamp":"2025-11-24T21:27:09.258Z"}}',
117
+ fullResponseText: '{"success":true,"data":{"accepted":0,"rejected":1,"outcomes":{"success":0,"failed":1,"blocked":0,"error":0},"errors":[{"proof_index":0,"error":{"code":"validation_error","message":"Proof validation failed","details":{"reason":"invalid_signature"}}}]},"metadata":{"requestId":"test-request-id","timestamp":"2025-11-24T21:27:09.258Z"}}'
118
+ }
119
+ [AccessControl] 🔍 PARSED RESPONSE DATA: {
120
+ correlationId: 'fe761a5f-5edf-4479-a037-def4f9d7fb3c',
121
+ status: 200,
122
+ responseDataType: 'object',
123
+ responseDataKeys: [ 'success', 'data', 'metadata' ],
124
+ responseData: '{\n' +
125
+ ' "success": true,\n' +
126
+ ' "data": {\n' +
127
+ ' "accepted": 0,\n' +
128
+ ' "rejected": 1,\n' +
129
+ ' "outcomes": {\n' +
130
+ ' "success": 0,\n' +
131
+ ' "failed": 1,\n' +
132
+ ' "blocked": 0,\n' +
133
+ ' "error": 0\n' +
134
+ ' },\n' +
135
+ ' "errors": [\n' +
136
+ ' {\n' +
137
+ ' "proof_index": 0,\n' +
138
+ ' "error": {\n' +
139
+ ' "code": "validation_error",\n' +
140
+ ' "message": "Proof validation failed",\n' +
141
+ ' "details": {\n' +
142
+ ' "reason": "invalid_signature"\n' +
143
+ ' }\n' +
144
+ ' }\n' +
145
+ ' }\n' +
146
+ ' ]\n' +
147
+ ' },\n' +
148
+ ' "metadata": {\n' +
149
+ ' "requestId": "test-request-id",\n' +
150
+ ' "timestamp": "2025-11-24T21:27:09.258Z"\n' +
151
+ ' }\n' +
152
+ '}'
153
+ }
154
+ [AccessControl] Raw response received: {
155
+ "success": true,
156
+ "data": {
157
+ "accepted": 0,
158
+ "rejected": 1,
159
+ "outcomes": {
160
+ "success": 0,
161
+ "failed": 1,
162
+ "blocked": 0,
163
+ "error": 0
164
+ },
165
+ "errors": [
166
+ {
167
+ "proof_index": 0,
168
+ "error": {
169
+ "code": "validation_error",
170
+ "message": "Proof validation failed",
171
+ "details": {
172
+ "reason": "invalid_signature"
173
+ }
174
+ }
175
+ }
176
+ ]
177
+ },
178
+ "metadata": {
179
+ "requestId": "test-request-id",
180
+ "timestamp": "2025-11-24T21:27:09.258Z"
181
+ }
182
+ }
183
+ [AccessControl] 🔍 DATA OBJECT STRUCTURE: {
184
+ correlationId: 'fe761a5f-5edf-4479-a037-def4f9d7fb3c',
185
+ dataKeys: [ 'accepted', 'rejected', 'outcomes', 'errors' ],
186
+ hasAccepted: true,
187
+ hasRejected: true,
188
+ hasOutcomes: true,
189
+ hasErrors: true,
190
+ acceptedType: 'number',
191
+ acceptedValue: 0,
192
+ rejectedType: 'number',
193
+ rejectedValue: 1,
194
+ outcomesType: 'object',
195
+ outcomesValue: { success: 0, failed: 1, blocked: 0, error: 0 },
196
+ errorsType: 'object',
197
+ errorsIsArray: true,
198
+ fullData: '{\n' +
199
+ ' "accepted": 0,\n' +
200
+ ' "rejected": 1,\n' +
201
+ ' "outcomes": {\n' +
202
+ ' "success": 0,\n' +
203
+ ' "failed": 1,\n' +
204
+ ' "blocked": 0,\n' +
205
+ ' "error": 0\n' +
206
+ ' },\n' +
207
+ ' "errors": [\n' +
208
+ ' {\n' +
209
+ ' "proof_index": 0,\n' +
210
+ ' "error": {\n' +
211
+ ' "code": "validation_error",\n' +
212
+ ' "message": "Proof validation failed",\n' +
213
+ ' "details": {\n' +
214
+ ' "reason": "invalid_signature"\n' +
215
+ ' }\n' +
216
+ ' }\n' +
217
+ ' }\n' +
218
+ ' ]\n' +
219
+ '}'
220
+ }
221
+ [AccessControl] 🔍 VALIDATING DATA WITH SUCCESS: {
222
+ correlationId: 'fe761a5f-5edf-4479-a037-def4f9d7fb3c',
223
+ dataWithSuccessKeys: [ 'success', 'accepted', 'rejected', 'outcomes', 'errors' ],
224
+ hasSuccess: true,
225
+ successValue: true,
226
+ hasAccepted: true,
227
+ acceptedValue: 0,
228
+ hasRejected: true,
229
+ rejectedValue: 1,
230
+ hasOutcomes: true,
231
+ outcomesValue: { success: 0, failed: 1, blocked: 0, error: 0 },
232
+ fullDataWithSuccess: '{\n' +
233
+ ' "success": true,\n' +
234
+ ' "accepted": 0,\n' +
235
+ ' "rejected": 1,\n' +
236
+ ' "outcomes": {\n' +
237
+ ' "success": 0,\n' +
238
+ ' "failed": 1,\n' +
239
+ ' "blocked": 0,\n' +
240
+ ' "error": 0\n' +
241
+ ' },\n' +
242
+ ' "errors": [\n' +
243
+ ' {\n' +
244
+ ' "proof_index": 0,\n' +
245
+ ' "error": {\n' +
246
+ ' "code": "validation_error",\n' +
247
+ ' "message": "Proof validation failed",\n' +
248
+ ' "details": {\n' +
249
+ ' "reason": "invalid_signature"\n' +
250
+ ' }\n' +
251
+ ' }\n' +
252
+ ' }\n' +
253
+ ' ]\n' +
254
+ '}'
255
+ }
256
+
257
+ stderr | src/services/__tests__/access-control.proof-response-validation.test.ts > Proof Submission Response Validation > Wrapped Response Format (AgentShield API) > should validate wrapped response without outcomes (optional field)
258
+ [AccessControl] 🔍 RAW API RESPONSE (before parsing): {
259
+ correlationId: '28e2ed4d-794e-46d3-a8ed-a2afc5b6f5e2',
260
+ status: 200,
261
+ statusText: undefined,
262
+ headers: {},
263
+ responseTextLength: 133,
264
+ responseTextPreview: '{"success":true,"data":{"accepted":1,"rejected":0},"metadata":{"requestId":"test-request-id","timestamp":"2025-11-24T21:27:09.265Z"}}',
265
+ fullResponseText: '{"success":true,"data":{"accepted":1,"rejected":0},"metadata":{"requestId":"test-request-id","timestamp":"2025-11-24T21:27:09.265Z"}}'
266
+ }
267
+ [AccessControl] 🔍 PARSED RESPONSE DATA: {
268
+ correlationId: '28e2ed4d-794e-46d3-a8ed-a2afc5b6f5e2',
269
+ status: 200,
270
+ responseDataType: 'object',
271
+ responseDataKeys: [ 'success', 'data', 'metadata' ],
272
+ responseData: '{\n' +
273
+ ' "success": true,\n' +
274
+ ' "data": {\n' +
275
+ ' "accepted": 1,\n' +
276
+ ' "rejected": 0\n' +
277
+ ' },\n' +
278
+ ' "metadata": {\n' +
279
+ ' "requestId": "test-request-id",\n' +
280
+ ' "timestamp": "2025-11-24T21:27:09.265Z"\n' +
281
+ ' }\n' +
282
+ '}'
283
+ }
284
+ [AccessControl] Raw response received: {
285
+ "success": true,
286
+ "data": {
287
+ "accepted": 1,
288
+ "rejected": 0
289
+ },
290
+ "metadata": {
291
+ "requestId": "test-request-id",
292
+ "timestamp": "2025-11-24T21:27:09.265Z"
293
+ }
294
+ }
295
+ [AccessControl] 🔍 DATA OBJECT STRUCTURE: {
296
+ correlationId: '28e2ed4d-794e-46d3-a8ed-a2afc5b6f5e2',
297
+ dataKeys: [ 'accepted', 'rejected' ],
298
+ hasAccepted: true,
299
+ hasRejected: true,
300
+ hasOutcomes: false,
301
+ hasErrors: false,
302
+ acceptedType: 'number',
303
+ acceptedValue: 1,
304
+ rejectedType: 'number',
305
+ rejectedValue: 0,
306
+ outcomesType: 'undefined',
307
+ outcomesValue: undefined,
308
+ errorsType: 'undefined',
309
+ errorsIsArray: false,
310
+ fullData: '{\n "accepted": 1,\n "rejected": 0\n}'
311
+ }
312
+ [AccessControl] 🔍 VALIDATING DATA WITH SUCCESS: {
313
+ correlationId: '28e2ed4d-794e-46d3-a8ed-a2afc5b6f5e2',
314
+ dataWithSuccessKeys: [ 'success', 'accepted', 'rejected' ],
315
+ hasSuccess: true,
316
+ successValue: true,
317
+ hasAccepted: true,
318
+ acceptedValue: 1,
319
+ hasRejected: true,
320
+ rejectedValue: 0,
321
+ hasOutcomes: false,
322
+ outcomesValue: undefined,
323
+ fullDataWithSuccess: '{\n "success": true,\n "accepted": 1,\n "rejected": 0\n}'
324
+ }
325
+
326
+ stderr | src/__tests__/services/agentshield-integration.test.ts > AgentShield Integration > Error Handling > should handle network timeout
327
+ stdout | src/__tests__/services/agentshield-integration.test.ts > AgentShield Integration > API Authentication > should use X-API-Key header for new endpoint
328
+ [ToolProtectionService] Config loaded from API {
329
+ source: 'api',
330
+ toolCount: 0,
331
+ protectedTools: [],
332
+ agentDid: 'did:key:z6MkhaXgBZDv...',
333
+ projectId: 'test-project-123',
334
+ [ToolProtectionService] API fetch failed, using fallback config { agentDid: 'did:key:z6MkhaXgBZDv...', error: 'Network timeout' }
335
+ cacheTtlMs: 300000,
336
+ cacheExpiresAt: '2025-11-24T21:32:09.241Z'
337
+ }
338
+
339
+ stdout | src/__tests__/services/agentshield-integration.test.ts > AgentShield Integration > API Authentication > should use Authorization Bearer header for old endpoint
340
+ [ToolProtectionService] Config loaded from API {
341
+ source: 'api',
342
+ toolCount: 0,
343
+ protectedTools: [],
344
+ agentDid: 'did:key:z6MkhaXgBZDv...',
345
+ projectId: 'none',
346
+ cacheTtlMs: 300000,
347
+ cacheExpiresAt: '2025-11-24T21:32:09.244Z'
348
+ }
349
+
350
+ stdout | src/__tests__/services/agentshield-integration.test.ts > AgentShield Integration > Endpoint Selection > should use project-scoped endpoint when projectId is available
351
+ [ToolProtectionService] Config loaded from API {
352
+ source: 'api',
353
+ toolCount: 0,
354
+ protectedTools: [],
355
+
356
+ agentDid: 'did:key:z6MkhaXgBZDv...',
357
+ projectId: 'test-project-123',
358
+ stderr | src/__tests__/services/agentshield-integration.test.ts > AgentShield Integration > Fallback Behavior > should cache fallback config
359
+ cacheTtlMs: 300000,
360
+ cacheExpiresAt: '2025-11-24T21:32:09.245Z'
361
+ }
362
+
363
+ stdout | src/__tests__/services/agentshield-integration.test.ts > AgentShield Integration > Endpoint Selection > should use agent-scoped endpoint when projectId is not available
364
+ [ToolProtectionService] API fetch failed, using fallback config { agentDid: 'did:key:z6MkhaXgBZDv...', error: 'Network error' }
365
+ [ToolProtectionService] Config loaded from API {
366
+ source: 'api',
367
+ toolCount: 0,
368
+ protectedTools: [],
369
+ agentDid: 'did:key:z6MkhaXgBZDv...',
370
+ projectId: 'none',
371
+ cacheTtlMs: 300000,
372
+
373
+ cacheExpiresAt: '2025-11-24T21:32:09.245Z'
374
+ }
375
+
376
+ stdout | src/__tests__/services/agentshield-integration.test.ts > AgentShield Integration > Endpoint Selection > should encode projectId in URL
377
+ [ToolProtectionService] Config loaded from API {
378
+ source: 'api',
379
+ toolCount: 0,
380
+ protectedTools: [],
381
+ agentDid: 'did:key:z6MkhaXgBZDv...',
382
+ projectId: 'project/with/special-chars',
383
+ cacheTtlMs: 300000,
384
+ cacheExpiresAt: '2025-11-24T21:32:09.246Z'
385
+ }
386
+
387
+ stdout | src/__tests__/services/agentshield-integration.test.ts > AgentShield Integration > Endpoint Selection > should encode agent DID in URL
388
+ [ToolProtectionService] Config loaded from API {
389
+ source: 'api',
390
+ toolCount: 0,
391
+ protectedTools: [],
392
+ agentDid: 'did:key:z6MkhaXgBZDv...',
393
+ projectId: 'none',
394
+ cacheTtlMs: 300000,
395
+ cacheExpiresAt: '2025-11-24T21:32:09.246Z'
396
+ }
397
+
398
+ stdout | src/__tests__/services/agentshield-integration.test.ts > AgentShield Integration > Response Format Compatibility > should handle new endpoint format (toolProtections object)
399
+ [ToolProtectionService] Config loaded from API {
400
+ source: 'api',
401
+ toolCount: 2,
402
+ protectedTools: [ 'checkout' ],
403
+ agentDid: 'did:key:z6MkhaXgBZDv...',
404
+ projectId: 'test-project-123',
405
+ cacheTtlMs: 300000,
406
+ cacheExpiresAt: '2025-11-24T21:32:09.246Z'
407
+ }
408
+
409
+ stdout | src/__tests__/services/agentshield-integration.test.ts > AgentShield Integration > Response Format Compatibility > should handle old endpoint format (tools array)
410
+ [ToolProtectionService] Config loaded from API {
411
+ source: 'api',
412
+ toolCount: 2,
413
+ protectedTools: [ 'checkout' ],
414
+ agentDid: 'did:key:z6MkhaXgBZDv...',
415
+ projectId: 'none',
416
+ cacheTtlMs: 300000,
417
+ cacheExpiresAt: '2025-11-24T21:32:09.248Z'
418
+ }
419
+
420
+ stdout | src/__tests__/services/agentshield-integration.test.ts > AgentShield Integration > Response Format Compatibility > should handle old endpoint format (tools object)
421
+ [ToolProtectionService] Config loaded from API {
422
+ source: 'api',
423
+ toolCount: 2,
424
+ protectedTools: [ 'checkout' ],
425
+ agentDid: 'did:key:z6MkhaXgBZDv...',
426
+ projectId: 'none',
427
+ cacheTtlMs: 300000,
428
+ cacheExpiresAt: '2025-11-24T21:32:09.249Z'
429
+ }
430
+
431
+ stdout | src/__tests__/services/agentshield-integration.test.ts > AgentShield Integration > Response Format Compatibility > should handle snake_case field names
432
+ [ToolProtectionService] Config loaded from API {
433
+ source: 'api',
434
+ toolCount: 1,
435
+ protectedTools: [ 'tool1' ],
436
+ agentDid: 'did:key:z6MkhaXgBZDv...',
437
+ projectId: 'test-project-123',
438
+ cacheTtlMs: 300000,
439
+ cacheExpiresAt: '2025-11-24T21:32:09.249Z'
440
+ }
441
+
442
+ stdout | src/__tests__/services/agentshield-integration.test.ts > AgentShield Integration > Response Format Compatibility > should handle camelCase field names
443
+ [ToolProtectionService] Config loaded from API {
444
+ source: 'api',
445
+ toolCount: 1,
446
+ protectedTools: [ 'tool1' ],
447
+ agentDid: 'did:key:z6MkhaXgBZDv...',
448
+ projectId: 'test-project-123',
449
+ cacheTtlMs: 300000,
450
+ cacheExpiresAt: '2025-11-24T21:32:09.250Z'
451
+ }
452
+
453
+ stdout | src/__tests__/services/agentshield-integration.test.ts > AgentShield Integration > Response Format Compatibility > should prefer camelCase over snake_case when both present
454
+ [ToolProtectionService] Config loaded from API {
455
+ source: 'api',
456
+ toolCount: 1,
457
+ protectedTools: [ 'tool1' ],
458
+ agentDid: 'did:key:z6MkhaXgBZDv...',
459
+ projectId: 'test-project-123',
460
+ cacheTtlMs: 300000,
461
+ cacheExpiresAt: '2025-11-24T21:32:09.250Z'
462
+ }
463
+
464
+ stdout | src/__tests__/services/agentshield-integration.test.ts > AgentShield Integration > Caching Integration > should cache successful API responses
465
+ [ToolProtectionService] Config loaded from API {
466
+ source: 'api',
467
+ toolCount: 1,
468
+ protectedTools: [ 'tool1' ],
469
+ agentDid: 'did:key:z6MkhaXgBZDv...',
470
+ projectId: 'test-project-123',
471
+ cacheTtlMs: 300000,
472
+ cacheExpiresAt: '2025-11-24T21:32:09.253Z'
473
+ }
474
+
475
+ stdout | src/__tests__/services/agentshield-integration.test.ts > AgentShield Integration > Caching Integration > should respect cache TTL
476
+ [ToolProtectionService] Config loaded from API {
477
+ source: 'api',
478
+ toolCount: 0,
479
+ protectedTools: [],
480
+ agentDid: 'did:key:z6MkhaXgBZDv...',
481
+ projectId: 'test-project-123',
482
+ cacheTtlMs: 1000,
483
+ cacheExpiresAt: '2025-11-24T21:27:10.254Z'
484
+ }
485
+
486
+ stderr | src/services/__tests__/access-control.service.test.ts > AccessControlApiService > submitProofs > should submit proofs successfully
487
+ [AccessControl] 🔍 RAW API RESPONSE (before parsing): {
488
+ correlationId: '2741baf3-0d00-4d89-b75f-f7a965771a8a',
489
+ status: 200,
490
+ statusText: '',
491
+ headers: { 'content-type': 'application/json' },
492
+ responseTextLength: 100,
493
+ responseTextPreview: '{"success":true,"accepted":1,"rejected":0,"outcomes":{"success":1,"failed":0,"blocked":0,"error":0}}',
494
+ fullResponseText: '{"success":true,"accepted":1,"rejected":0,"outcomes":{"success":1,"failed":0,"blocked":0,"error":0}}'
495
+ }
496
+ [AccessControl] 🔍 PARSED RESPONSE DATA: {
497
+ correlationId: '2741baf3-0d00-4d89-b75f-f7a965771a8a',
498
+ status: 200,
499
+ responseDataType: 'object',
500
+ responseDataKeys: [ 'success', 'accepted', 'rejected', 'outcomes' ],
501
+ responseData: '{\n' +
502
+ ' "success": true,\n' +
503
+ ' "accepted": 1,\n' +
504
+ ' "rejected": 0,\n' +
505
+ ' "outcomes": {\n' +
506
+ ' "success": 1,\n' +
507
+ ' "failed": 0,\n' +
508
+ ' "blocked": 0,\n' +
509
+ ' "error": 0\n' +
510
+ ' }\n' +
511
+ '}'
512
+ }
513
+ [AccessControl] Raw response received: {
514
+ "success": true,
515
+ "accepted": 1,
516
+ "rejected": 0,
517
+ "outcomes": {
518
+ "success": 1,
519
+ "failed": 0,
520
+ "blocked": 0,
521
+ "error": 0
522
+ }
523
+ }
524
+
525
+ stderr | src/services/__tests__/access-control.service.test.ts > AccessControlApiService > submitProofs > should handle all_proofs_rejected error gracefully
526
+ [AccessControl] 🔍 RAW API RESPONSE (before parsing): {
527
+ correlationId: '7df25795-5744-4c07-a552-30e1ef3709de',
528
+ status: 400,
529
+ statusText: '',
530
+ headers: { 'content-type': 'application/json' },
531
+ responseTextLength: 209,
532
+ responseTextPreview: '{"success":false,"error":{"code":"all_proofs_rejected","message":"All proofs rejected","details":{"rejected":1,"errors":[{"proof_index":0,"error":{"code":"invalid_signature","message":"Invalid signature"}}]}}}',
533
+ fullResponseText: '{"success":false,"error":{"code":"all_proofs_rejected","message":"All proofs rejected","details":{"rejected":1,"errors":[{"proof_index":0,"error":{"code":"invalid_signature","message":"Invalid signature"}}]}}}'
534
+ }
535
+ [AccessControl] 🔍 PARSED RESPONSE DATA: {
536
+ correlationId: '7df25795-5744-4c07-a552-30e1ef3709de',
537
+ status: 400,
538
+ responseDataType: 'object',
539
+ responseDataKeys: [ 'success', 'error' ],
540
+ responseData: '{\n' +
541
+ ' "success": false,\n' +
542
+ ' "error": {\n' +
543
+ ' "code": "all_proofs_rejected",\n' +
544
+ ' "message": "All proofs rejected",\n' +
545
+ ' "details": {\n' +
546
+ ' "rejected": 1,\n' +
547
+ ' "errors": [\n' +
548
+ ' {\n' +
549
+ ' "proof_index": 0,\n' +
550
+ ' "error": {\n' +
551
+ ' "code": "invalid_signature",\n' +
552
+ ' "message": "Invalid signature"\n' +
553
+ ' }\n' +
554
+ ' }\n' +
555
+ ' ]\n' +
556
+ ' }\n' +
557
+ ' }\n' +
558
+ '}'
559
+ }
560
+
561
+ stderr | src/services/__tests__/access-control.service.test.ts > AccessControlApiService > submitProofs > should handle wrapped response format
562
+ [AccessControl] 🔍 RAW API RESPONSE (before parsing): {
563
+ correlationId: '5c904fce-908b-4c51-90e9-3b001a2a959f',
564
+ status: 200,
565
+ statusText: '',
566
+ headers: { 'content-type': 'application/json' },
567
+ responseTextLength: 206,
568
+ responseTextPreview: '{"success":true,"data":{"success":true,"accepted":1,"rejected":0,"outcomes":{"success":1,"failed":0,"blocked":0,"error":0}},"metadata":{"requestId":"test-request-id","timestamp":"2025-11-24T21:27:09.280Z"}}',
569
+ fullResponseText: '{"success":true,"data":{"success":true,"accepted":1,"rejected":0,"outcomes":{"success":1,"failed":0,"blocked":0,"error":0}},"metadata":{"requestId":"test-request-id","timestamp":"2025-11-24T21:27:09.280Z"}}'
570
+ }
571
+ [AccessControl] 🔍 PARSED RESPONSE DATA: {
572
+ correlationId: '5c904fce-908b-4c51-90e9-3b001a2a959f',
573
+ status: 200,
574
+ responseDataType: 'object',
575
+ responseDataKeys: [ 'success', 'data', 'metadata' ],
576
+ responseData: '{\n' +
577
+ ' "success": true,\n' +
578
+ ' "data": {\n' +
579
+ ' "success": true,\n' +
580
+ ' "accepted": 1,\n' +
581
+ ' "rejected": 0,\n' +
582
+ ' "outcomes": {\n' +
583
+ ' "success": 1,\n' +
584
+ ' "failed": 0,\n' +
585
+ ' "blocked": 0,\n' +
586
+ ' "error": 0\n' +
587
+ ' }\n' +
588
+ ' },\n' +
589
+ ' "metadata": {\n' +
590
+ ' "requestId": "test-request-id",\n' +
591
+ ' "timestamp": "2025-11-24T21:27:09.280Z"\n' +
592
+ ' }\n' +
593
+ '}'
594
+ }
595
+ [AccessControl] Raw response received: {
596
+ "success": true,
597
+ "data": {
598
+ "success": true,
599
+ "accepted": 1,
600
+ "rejected": 0,
601
+ "outcomes": {
602
+ "success": 1,
603
+ "failed": 0,
604
+ "blocked": 0,
605
+ "error": 0
606
+ }
607
+ },
608
+ "metadata": {
609
+ "requestId": "test-request-id",
610
+ "timestamp": "2025-11-24T21:27:09.280Z"
611
+ }
612
+ }
613
+ [AccessControl] 🔍 DATA OBJECT STRUCTURE: {
614
+ correlationId: '5c904fce-908b-4c51-90e9-3b001a2a959f',
615
+ dataKeys: [ 'success', 'accepted', 'rejected', 'outcomes' ],
616
+ hasAccepted: true,
617
+ hasRejected: true,
618
+ hasOutcomes: true,
619
+ hasErrors: false,
620
+ acceptedType: 'number',
621
+ acceptedValue: 1,
622
+ rejectedType: 'number',
623
+ rejectedValue: 0,
624
+ outcomesType: 'object',
625
+ outcomesValue: { success: 1, failed: 0, blocked: 0, error: 0 },
626
+ errorsType: 'undefined',
627
+ errorsIsArray: false,
628
+ fullData: '{\n' +
629
+ ' "success": true,\n' +
630
+ ' "accepted": 1,\n' +
631
+ ' "rejected": 0,\n' +
632
+ ' "outcomes": {\n' +
633
+ ' "success": 1,\n' +
634
+ ' "failed": 0,\n' +
635
+ ' "blocked": 0,\n' +
636
+ ' "error": 0\n' +
637
+ ' }\n' +
638
+ '}'
639
+ }
640
+ [AccessControl] 🔍 VALIDATING DATA WITH SUCCESS: {
641
+ correlationId: '5c904fce-908b-4c51-90e9-3b001a2a959f',
642
+ dataWithSuccessKeys: [ 'success', 'accepted', 'rejected', 'outcomes' ],
643
+ hasSuccess: true,
644
+ successValue: true,
645
+ hasAccepted: true,
646
+ acceptedValue: 1,
647
+ hasRejected: true,
648
+ rejectedValue: 0,
649
+ hasOutcomes: true,
650
+ outcomesValue: { success: 1, failed: 0, blocked: 0, error: 0 },
651
+ fullDataWithSuccess: '{\n' +
652
+ ' "success": true,\n' +
653
+ ' "accepted": 1,\n' +
654
+ ' "rejected": 0,\n' +
655
+ ' "outcomes": {\n' +
656
+ ' "success": 1,\n' +
657
+ ' "failed": 0,\n' +
658
+ ' "blocked": 0,\n' +
659
+ ' "error": 0\n' +
660
+ ' }\n' +
661
+ '}'
662
+ }
663
+
664
+ stderr | src/services/__tests__/access-control.service.test.ts > AccessControlApiService > submitProofs > should handle response with missing outcomes field (outcomes is optional)
665
+ [AccessControl] 🔍 RAW API RESPONSE (before parsing): {
666
+ correlationId: '244e4a95-b546-4c7f-be74-34889a648656',
667
+ status: 200,
668
+ statusText: '',
669
+ headers: { 'content-type': 'application/json' },
670
+ responseTextLength: 42,
671
+ responseTextPreview: '{"success":true,"accepted":1,"rejected":0}',
672
+ fullResponseText: '{"success":true,"accepted":1,"rejected":0}'
673
+ }
674
+ [AccessControl] 🔍 PARSED RESPONSE DATA: {
675
+ correlationId: '244e4a95-b546-4c7f-be74-34889a648656',
676
+ status: 200,
677
+ responseDataType: 'object',
678
+ responseDataKeys: [ 'success', 'accepted', 'rejected' ],
679
+ responseData: '{\n "success": true,\n "accepted": 1,\n "rejected": 0\n}'
680
+ }
681
+ [AccessControl] Raw response received: {
682
+ "success": true,
683
+ "accepted": 1,
684
+ "rejected": 0
685
+ }
686
+
687
+ stderr | src/services/__tests__/access-control.service.test.ts > AccessControlApiService > submitProofs > should handle response with missing outcomes field (outcomes is optional)
688
+ [AccessControl] 🔍 RAW API RESPONSE (before parsing): {
689
+ correlationId: '64dfd2fd-dbd4-4147-91ab-0c7d4de5c291',
690
+ status: 200,
691
+ statusText: '',
692
+ headers: { 'content-type': 'application/json' },
693
+ responseTextLength: 100,
694
+ responseTextPreview: '{"success":true,"accepted":1,"rejected":0,"outcomes":{"success":1,"failed":0,"blocked":0,"error":0}}',
695
+ fullResponseText: '{"success":true,"accepted":1,"rejected":0,"outcomes":{"success":1,"failed":0,"blocked":0,"error":0}}'
696
+ }
697
+ [AccessControl] 🔍 PARSED RESPONSE DATA: {
698
+ correlationId: '64dfd2fd-dbd4-4147-91ab-0c7d4de5c291',
699
+ status: 200,
700
+ responseDataType: 'object',
701
+ responseDataKeys: [ 'success', 'accepted', 'rejected', 'outcomes' ],
702
+ responseData: '{\n' +
703
+ ' "success": true,\n' +
704
+ ' "accepted": 1,\n' +
705
+ ' "rejected": 0,\n' +
706
+ ' "outcomes": {\n' +
707
+ ' "success": 1,\n' +
708
+ ' "failed": 0,\n' +
709
+ ' "blocked": 0,\n' +
710
+ ' "error": 0\n' +
711
+ ' }\n' +
712
+ '}'
713
+ }
714
+ [AccessControl] Raw response received: {
715
+ "success": true,
716
+ "accepted": 1,
717
+ "rejected": 0,
718
+ "outcomes": {
719
+ "success": 1,
720
+ "failed": 0,
721
+ "blocked": 0,
722
+ "error": 0
723
+ }
724
+ }
725
+
726
+ stderr | src/services/__tests__/access-control.service.test.ts > AccessControlApiService > submitProofs > should handle response with missing outcomes field (outcomes is optional)
727
+ [AccessControl] 🔍 RAW API RESPONSE (before parsing): {
728
+ correlationId: '8b2993e3-eede-4db1-a8a0-271240338bd5',
729
+ status: 200,
730
+ statusText: '',
731
+ headers: { 'content-type': 'application/json' },
732
+ responseTextLength: 56,
733
+ responseTextPreview: '{"success":true,"accepted":1,"rejected":0,"outcomes":{}}',
734
+ fullResponseText: '{"success":true,"accepted":1,"rejected":0,"outcomes":{}}'
735
+ }
736
+ [AccessControl] 🔍 PARSED RESPONSE DATA: {
737
+ correlationId: '8b2993e3-eede-4db1-a8a0-271240338bd5',
738
+ status: 200,
739
+ responseDataType: 'object',
740
+ responseDataKeys: [ 'success', 'accepted', 'rejected', 'outcomes' ],
741
+ responseData: '{\n "success": true,\n "accepted": 1,\n "rejected": 0,\n "outcomes": {}\n}'
742
+ }
743
+ [AccessControl] Raw response received: {
744
+ "success": true,
745
+ "accepted": 1,
746
+ "rejected": 0,
747
+ "outcomes": {}
748
+ }
749
+
750
+ stderr | src/services/__tests__/access-control.service.test.ts > AccessControlApiService > submitProofs > should handle wrapped response with invalid data structure
751
+ [AccessControl] 🔍 RAW API RESPONSE (before parsing): {
752
+ correlationId: '11f2d355-b2da-4bbe-8025-ef47207398f5',
753
+ status: 200,
754
+ statusText: '',
755
+ headers: { 'content-type': 'application/json' },
756
+ responseTextLength: 52,
757
+ responseTextPreview: '{"success":true,"data":{"message":"Invalid format"}}',
758
+ fullResponseText: '{"success":true,"data":{"message":"Invalid format"}}'
759
+ }
760
+ [AccessControl] 🔍 PARSED RESPONSE DATA: {
761
+ correlationId: '11f2d355-b2da-4bbe-8025-ef47207398f5',
762
+ status: 200,
763
+ responseDataType: 'object',
764
+ responseDataKeys: [ 'success', 'data' ],
765
+ responseData: '{\n "success": true,\n "data": {\n "message": "Invalid format"\n }\n}'
766
+ }
767
+ [AccessControl] Raw response received: {
768
+ "success": true,
769
+ "data": {
770
+ "message": "Invalid format"
771
+ }
772
+ }
773
+ [AccessControl] 🔍 DATA OBJECT STRUCTURE: {
774
+ correlationId: '11f2d355-b2da-4bbe-8025-ef47207398f5',
775
+ dataKeys: [ 'message' ],
776
+ hasAccepted: false,
777
+ hasRejected: false,
778
+ hasOutcomes: false,
779
+ hasErrors: false,
780
+ acceptedType: 'undefined',
781
+ acceptedValue: undefined,
782
+ rejectedType: 'undefined',
783
+ rejectedValue: undefined,
784
+ outcomesType: 'undefined',
785
+ outcomesValue: undefined,
786
+ errorsType: 'undefined',
787
+ errorsIsArray: false,
788
+ fullData: '{\n "message": "Invalid format"\n}'
789
+ }
790
+ [AccessControl] 🔍 VALIDATING DATA WITH SUCCESS: {
791
+ correlationId: '11f2d355-b2da-4bbe-8025-ef47207398f5',
792
+ dataWithSuccessKeys: [ 'success', 'accepted', 'rejected' ],
793
+ hasSuccess: true,
794
+ successValue: true,
795
+ hasAccepted: true,
796
+ acceptedValue: undefined,
797
+ hasRejected: true,
798
+ rejectedValue: undefined,
799
+ hasOutcomes: false,
800
+ outcomesValue: undefined,
801
+ fullDataWithSuccess: '{\n "success": true\n}'
802
+ }
803
+ [AccessControl] ❌ MISSING REQUIRED FIELDS AFTER CONSTRUCTION: {
804
+ correlationId: '11f2d355-b2da-4bbe-8025-ef47207398f5',
805
+ hasAccepted: true,
806
+ acceptedType: 'undefined',
807
+ acceptedValue: undefined,
808
+ hasRejected: true,
809
+ rejectedType: 'undefined',
810
+ rejectedValue: undefined,
811
+ dataWithSuccessKeys: [ 'success', 'accepted', 'rejected' ],
812
+ fullDataWithSuccess: '{\n "success": true\n}',
813
+ dataToValidateKeys: [ 'message' ],
814
+ fullDataToValidate: '{\n "message": "Invalid format"\n}',
815
+ originalResponseData: '{\n "success": true,\n "data": {\n "message": "Invalid format"\n }\n}'
816
+ }
817
+
818
+ stderr | src/services/__tests__/access-control.proof-response-validation.test.ts > Proof Submission Response Validation > Wrapped Response Format (AgentShield API) > should throw validation error if data object missing success field
819
+ [AccessControl] 🔍 RAW API RESPONSE (before parsing): {
820
+ correlationId: 'e1b45b6c-b040-4768-8549-68cd87c7d71a',
821
+ status: 200,
822
+ statusText: undefined,
823
+ headers: {},
824
+ responseTextLength: 191,
825
+ responseTextPreview: '{"success":true,"data":{"accepted":1,"rejected":0,"outcomes":{"success":1,"failed":0,"blocked":0,"error":0}},"metadata":{"requestId":"test-request-id","timestamp":"2025-11-24T21:27:09.266Z"}}',
826
+ fullResponseText: '{"success":true,"data":{"accepted":1,"rejected":0,"outcomes":{"success":1,"failed":0,"blocked":0,"error":0}},"metadata":{"requestId":"test-request-id","timestamp":"2025-11-24T21:27:09.266Z"}}'
827
+ }
828
+ [AccessControl] 🔍 PARSED RESPONSE DATA: {
829
+ correlationId: 'e1b45b6c-b040-4768-8549-68cd87c7d71a',
830
+ status: 200,
831
+ responseDataType: 'object',
832
+ responseDataKeys: [ 'success', 'data', 'metadata' ],
833
+ responseData: '{\n' +
834
+ ' "success": true,\n' +
835
+ ' "data": {\n' +
836
+ ' "accepted": 1,\n' +
837
+ ' "rejected": 0,\n' +
838
+ ' "outcomes": {\n' +
839
+ ' "success": 1,\n' +
840
+ ' "failed": 0,\n' +
841
+ ' "blocked": 0,\n' +
842
+ ' "error": 0\n' +
843
+ ' }\n' +
844
+ ' },\n' +
845
+ ' "metadata": {\n' +
846
+ ' "requestId": "test-request-id",\n' +
847
+ ' "timestamp": "2025-11-24T21:27:09.266Z"\n' +
848
+ ' }\n' +
849
+ '}'
850
+ }
851
+ [AccessControl] Raw response received: {
852
+ "success": true,
853
+ "data": {
854
+ "accepted": 1,
855
+ "rejected": 0,
856
+ "outcomes": {
857
+ "success": 1,
858
+ "failed": 0,
859
+ "blocked": 0,
860
+ "error": 0
861
+ }
862
+ },
863
+ "metadata": {
864
+ "requestId": "test-request-id",
865
+ "timestamp": "2025-11-24T21:27:09.266Z"
866
+ }
867
+ }
868
+ [AccessControl] 🔍 DATA OBJECT STRUCTURE: {
869
+ correlationId: 'e1b45b6c-b040-4768-8549-68cd87c7d71a',
870
+ dataKeys: [ 'accepted', 'rejected', 'outcomes' ],
871
+ hasAccepted: true,
872
+ hasRejected: true,
873
+ hasOutcomes: true,
874
+ hasErrors: false,
875
+ acceptedType: 'number',
876
+ acceptedValue: 1,
877
+ rejectedType: 'number',
878
+ rejectedValue: 0,
879
+ outcomesType: 'object',
880
+ outcomesValue: { success: 1, failed: 0, blocked: 0, error: 0 },
881
+ errorsType: 'undefined',
882
+ errorsIsArray: false,
883
+ fullData: '{\n' +
884
+ ' "accepted": 1,\n' +
885
+ ' "rejected": 0,\n' +
886
+ ' "outcomes": {\n' +
887
+ ' "success": 1,\n' +
888
+ ' "failed": 0,\n' +
889
+ ' "blocked": 0,\n' +
890
+ ' "error": 0\n' +
891
+ ' }\n' +
892
+ '}'
893
+ }
894
+ [AccessControl] 🔍 VALIDATING DATA WITH SUCCESS: {
895
+ correlationId: 'e1b45b6c-b040-4768-8549-68cd87c7d71a',
896
+ dataWithSuccessKeys: [ 'success', 'accepted', 'rejected', 'outcomes' ],
897
+ hasSuccess: true,
898
+ successValue: true,
899
+ hasAccepted: true,
900
+ acceptedValue: 1,
901
+ hasRejected: true,
902
+ rejectedValue: 0,
903
+ hasOutcomes: true,
904
+ outcomesValue: { success: 1, failed: 0, blocked: 0, error: 0 },
905
+ fullDataWithSuccess: '{\n' +
906
+ ' "success": true,\n' +
907
+ ' "accepted": 1,\n' +
908
+ ' "rejected": 0,\n' +
909
+ ' "outcomes": {\n' +
910
+ ' "success": 1,\n' +
911
+ ' "failed": 0,\n' +
912
+ ' "blocked": 0,\n' +
913
+ ' "error": 0\n' +
914
+ ' }\n' +
915
+ '}'
916
+ }
917
+
918
+ ✓ src/services/__tests__/access-control.proof-response-validation.test.ts (9 tests) 28ms
919
+ ✓ src/delegation/__tests__/cascading-revocation.test.ts (23 tests) 9ms
920
+ ✓ src/__tests__/config/provider-runtime-config.test.ts (9 tests) 2ms
921
+ ✓ src/delegation/__tests__/vc-verifier.test.ts (35 tests) 356ms
922
+ ✓ src/services/__tests__/access-control.service.test.ts (23 tests) 260ms
923
+ ✓ src/delegation/__tests__/vc-issuer.test.ts (21 tests) 188ms
924
+ stderr | src/services/__tests__/access-control.integration.test.ts > AccessControlApiService Integration > Proof Submission Flow > should submit proof end-to-end
925
+ [AccessControl] 🔍 RAW API RESPONSE (before parsing): {
926
+ correlationId: 'd81452e3-6d9a-4015-9340-c92ec6d86643',
927
+ status: 200,
928
+ statusText: '',
929
+ headers: { 'content-type': 'application/json' },
930
+ responseTextLength: 100,
931
+ responseTextPreview: '{"success":true,"accepted":1,"rejected":0,"outcomes":{"success":1,"failed":0,"blocked":0,"error":0}}',
932
+ fullResponseText: '{"success":true,"accepted":1,"rejected":0,"outcomes":{"success":1,"failed":0,"blocked":0,"error":0}}'
933
+ }
934
+ [AccessControl] 🔍 PARSED RESPONSE DATA: {
935
+ correlationId: 'd81452e3-6d9a-4015-9340-c92ec6d86643',
936
+ status: 200,
937
+ responseDataType: 'object',
938
+ responseDataKeys: [ 'success', 'accepted', 'rejected', 'outcomes' ],
939
+ responseData: '{\n' +
940
+ ' "success": true,\n' +
941
+ ' "accepted": 1,\n' +
942
+ ' "rejected": 0,\n' +
943
+ ' "outcomes": {\n' +
944
+ ' "success": 1,\n' +
945
+ ' "failed": 0,\n' +
946
+ ' "blocked": 0,\n' +
947
+ ' "error": 0\n' +
948
+ ' }\n' +
949
+ '}'
950
+ }
951
+ [AccessControl] Raw response received: {
952
+ "success": true,
953
+ "accepted": 1,
954
+ "rejected": 0,
955
+ "outcomes": {
956
+ "success": 1,
957
+ "failed": 0,
958
+ "blocked": 0,
959
+ "error": 0
960
+ }
961
+ }
962
+
963
+ stderr | src/services/__tests__/access-control.integration.test.ts > AccessControlApiService Integration > Proof Submission Flow > should handle proof submission with errors
964
+ [AccessControl] 🔍 RAW API RESPONSE (before parsing): {
965
+ correlationId: 'ca388041-d0dc-4667-b6d7-2aeb05027351',
966
+ status: 200,
967
+ statusText: '',
968
+ headers: { 'content-type': 'application/json' },
969
+ responseTextLength: 200,
970
+ responseTextPreview: '{"success":true,"accepted":0,"rejected":1,"outcomes":{"success":0,"failed":1,"blocked":0,"error":0},"errors":[{"proof_index":0,"error":{"code":"invalid_signature","message":"Invalid JWS signature"}}]}',
971
+ fullResponseText: '{"success":true,"accepted":0,"rejected":1,"outcomes":{"success":0,"failed":1,"blocked":0,"error":0},"errors":[{"proof_index":0,"error":{"code":"invalid_signature","message":"Invalid JWS signature"}}]}'
972
+ }
973
+ [AccessControl] 🔍 PARSED RESPONSE DATA: {
974
+ correlationId: 'ca388041-d0dc-4667-b6d7-2aeb05027351',
975
+ status: 200,
976
+ responseDataType: 'object',
977
+ responseDataKeys: [ 'success', 'accepted', 'rejected', 'outcomes', 'errors' ],
978
+ responseData: '{\n' +
979
+ ' "success": true,\n' +
980
+ ' "accepted": 0,\n' +
981
+ ' "rejected": 1,\n' +
982
+ ' "outcomes": {\n' +
983
+ ' "success": 0,\n' +
984
+ ' "failed": 1,\n' +
985
+ ' "blocked": 0,\n' +
986
+ ' "error": 0\n' +
987
+ ' },\n' +
988
+ ' "errors": [\n' +
989
+ ' {\n' +
990
+ ' "proof_index": 0,\n' +
991
+ ' "error": {\n' +
992
+ ' "code": "invalid_signature",\n' +
993
+ ' "message": "Invalid JWS signature"\n' +
994
+ ' }\n' +
995
+ ' }\n' +
996
+ ' ]\n' +
997
+ '}'
998
+ }
999
+ [AccessControl] Raw response received: {
1000
+ "success": true,
1001
+ "accepted": 0,
1002
+ "rejected": 1,
1003
+ "outcomes": {
1004
+ "success": 0,
1005
+ "failed": 1,
1006
+ "blocked": 0,
1007
+ "error": 0
1008
+ },
1009
+ "errors": [
1010
+ {
1011
+ "proof_index": 0,
1012
+ "error": {
1013
+ "code": "invalid_signature",
1014
+ "message": "Invalid JWS signature"
1015
+ }
1016
+ }
1017
+ ]
1018
+ }
1019
+
1020
+ stderr | src/services/__tests__/access-control.integration.test.ts > AccessControlApiService Integration > Proof Verification Flow > should verify proof using ProofVerifier
1021
+ [CryptoService] Key ID mismatch
1022
+
1023
+ ✓ src/__tests__/runtime/route-interception.test.ts (21 tests) 28ms
1024
+ stderr | src/__tests__/runtime/tool-protection-enforcement.test.ts > MCPIRuntimeBase - Tool Protection Enforcement > processToolCall with tool protection > should block tool execution when protection required and no delegation
1025
+ [MCP-I] BLOCKED: Tool requires delegation but none provided {
1026
+ tool: 'protectedTool',
1027
+ stdout | src/__tests__/runtime/tool-protection-enforcement.test.ts > MCPIRuntimeBase - Tool Protection Enforcement > processToolCall with tool protection > should allow tool execution when no protection required
1028
+ [MCP-I] Checking tool protection: {
1029
+ tool: 'unprotectedTool',
1030
+ agentDid: 'did:key:zmock123...',
1031
+ hasDelegation: false
1032
+ }
1033
+ requiredScopes: [ 'files:write' ],
1034
+
1035
+ agentDid: 'did:key:zmock123...',
1036
+ resumeToken: 'resume_gw6kcs_midnqpi5',
1037
+ stdout | src/__tests__/runtime/tool-protection-enforcement.test.ts > MCPIRuntimeBase - Tool Protection Enforcement > processToolCall with tool protection > should allow tool execution when no protection required
1038
+ [MCP-I] Tool protection check passed (no delegation required) {
1039
+ consentUrl: 'https://kya.vouched.id/bouncer/consent?tool=protectedTool&scopes=files%3Awrite&session_id=session123&agent_did=&resume_token=resume_gw6kcs_midnqpi5'
1040
+ }
1041
+ tool: 'unprotectedTool',
1042
+ agentDid: 'did:key:zmock123...',
1043
+ reason: 'Tool not configured to require delegation'
1044
+ }
1045
+
1046
+ stdout | src/__tests__/runtime/tool-protection-enforcement.test.ts > MCPIRuntimeBase - Tool Protection Enforcement > processToolCall with tool protection > should block tool execution when protection required and no delegation
1047
+
1048
+ [MCP-I] Checking tool protection: {
1049
+ tool: 'protectedTool',
1050
+ agentDid: 'did:key:zmock123...',
1051
+ hasDelegation: false
1052
+ }
1053
+
1054
+ stdout | src/__tests__/runtime/tool-protection-enforcement.test.ts > MCPIRuntimeBase - Tool Protection Enforcement > processToolCall with tool protection > should allow tool execution when protection required and delegation provided
1055
+ [MCP-I] Checking tool protection: {
1056
+ tool: 'protectedTool',
1057
+ agentDid: 'did:key:zmock123...',
1058
+ hasDelegation: true
1059
+ }
1060
+
1061
+ stdout | src/__tests__/runtime/tool-protection-enforcement.test.ts > MCPIRuntimeBase - Tool Protection Enforcement > processToolCall with tool protection > should allow tool execution when protection required and delegation provided
1062
+ [MCP-I] 🔐 Verifying delegation token with AccessControlApiService {
1063
+ tool: 'protectedTool',
1064
+ agentDid: 'did:key:zmock123...',
1065
+ hasDelegationToken: true,
1066
+ hasConsentProof: false,
1067
+ requiredScopes: [ 'files:write' ]
1068
+ }
1069
+
1070
+ stdout | src/__tests__/runtime/tool-protection-enforcement.test.ts > MCPIRuntimeBase - Tool Protection Enforcement > processToolCall with tool protection > should allow tool execution when protection required and delegation provided
1071
+ [MCP-I] ✅ Delegation verification SUCCEEDED {
1072
+ tool: 'protectedTool',
1073
+ agentDid: 'did:key:zmock123...',
1074
+ delegationId: 'test-delegation-id',
1075
+ credentialScopes: [ 'files:write' ],
1076
+ requiredScopes: [ 'files:write' ]
1077
+ }
1078
+
1079
+ stdout | src/__tests__/runtime/tool-protection-enforcement.test.ts > MCPIRuntimeBase - Tool Protection Enforcement > processToolCall with tool protection > should allow tool execution when protection required and consentProof provided
1080
+ [MCP-I] Checking tool protection: {
1081
+ tool: 'protectedTool',
1082
+ agentDid: 'did:key:zmock123...',
1083
+ hasDelegation: true
1084
+ }
1085
+
1086
+ stdout | src/__tests__/runtime/tool-protection-enforcement.test.ts > MCPIRuntimeBase - Tool Protection Enforcement > processToolCall with tool protection > should allow tool execution when protection required and consentProof provided
1087
+ [MCP-I] 🔐 Verifying delegation token with AccessControlApiService {
1088
+ tool: 'protectedTool',
1089
+ agentDid: 'did:key:zmock123...',
1090
+ hasDelegationToken: false,
1091
+ hasConsentProof: true,
1092
+ requiredScopes: [ 'files:write' ]
1093
+ }
1094
+
1095
+ stdout | src/__tests__/runtime/tool-protection-enforcement.test.ts > MCPIRuntimeBase - Tool Protection Enforcement > processToolCall with tool protection > should allow tool execution when protection required and consentProof provided
1096
+ [MCP-I] ✅ Delegation verification SUCCEEDED {
1097
+ tool: 'protectedTool',
1098
+ agentDid: 'did:key:zmock123...',
1099
+ delegationId: 'test-delegation-id',
1100
+ credentialScopes: [ 'files:write' ],
1101
+ requiredScopes: [ 'files:write' ]
1102
+ }
1103
+
1104
+ stderr | src/__tests__/runtime/tool-protection-enforcement.test.ts > MCPIRuntimeBase - Tool Protection Enforcement > processToolCall with tool protection > should block tool execution when delegation verification fails
1105
+ stdout | src/__tests__/runtime/tool-protection-enforcement.test.ts > MCPIRuntimeBase - Tool Protection Enforcement > processToolCall with tool protection > should block tool execution when delegation verification fails
1106
+ [MCP-I] Checking tool protection: {
1107
+ tool: 'protectedTool',
1108
+ agentDid: 'did:key:zmock123...',
1109
+ [MCP-I] ❌ Delegation verification FAILED {
1110
+ hasDelegation: true
1111
+ }
1112
+ tool: 'protectedTool',
1113
+
1114
+ stdout | src/__tests__/runtime/tool-protection-enforcement.test.ts > MCPIRuntimeBase - Tool Protection Enforcement > processToolCall with tool protection > should block tool execution when delegation verification fails
1115
+ [MCP-I] 🔐 Verifying delegation token with AccessControlApiService {
1116
+ tool: 'protectedTool',
1117
+ agentDid: 'did:key:zmock123...',
1118
+ hasDelegationToken: true,
1119
+ hasConsentProof: false,
1120
+ requiredScopes: [ 'files:write' ]
1121
+ }
1122
+
1123
+ stdout | src/__tests__/runtime/tool-protection-enforcement.test.ts > MCPIRuntimeBase - Tool Protection Enforcement > processToolCall with tool protection > should block tool execution when delegation has wrong scopes
1124
+ [MCP-I] Checking tool protection: {
1125
+ tool: 'protectedTool',
1126
+ agentDid: 'did:key:zmock123...',
1127
+ hasDelegation: true
1128
+ }
1129
+
1130
+ agentDid: 'did:key:zmock123...',
1131
+ reason: 'Delegation token expired',
1132
+ errorCode: undefined,
1133
+ errorMessage: undefined,
1134
+ requiredScopes: [ 'files:write' ]
1135
+ }
1136
+
1137
+ stdout | src/__tests__/runtime/tool-protection-enforcement.test.ts > MCPIRuntimeBase - Tool Protection Enforcement > processToolCall with tool protection > should block tool execution when delegation has wrong scopes
1138
+ [MCP-I] 🔐 Verifying delegation token with AccessControlApiService {
1139
+ tool: 'protectedTool',
1140
+ stderr | src/__tests__/runtime/tool-protection-enforcement.test.ts > MCPIRuntimeBase - Tool Protection Enforcement > processToolCall with tool protection > should block tool execution when delegation has wrong scopes
1141
+ [MCP-I] ❌ Delegation verification FAILED {
1142
+ tool: 'protectedTool',
1143
+ agentDid: 'did:key:zmock123...',
1144
+ agentDid: 'did:key:zmock123...',
1145
+ hasDelegationToken: true,
1146
+ reason: 'Insufficient scopes',
1147
+ hasConsentProof: false,
1148
+ requiredScopes: [ 'files:write' ]
1149
+ }
1150
+
1151
+ errorCode: undefined,
1152
+ errorMessage: undefined,
1153
+ requiredScopes: [ 'files:write' ]
1154
+ }
1155
+
1156
+ stderr | src/services/__tests__/proof-verifier.integration.test.ts > ProofVerifier Integration - Real DID Resolution > did:web Resolution (HTTP) > should handle HTTP errors gracefully
1157
+ [ProofVerifier] Failed to fetch public key from DID: Error: Failed to resolve did:web:nonexistent-domain-that-does-not-exist-12345.com: fetch failed
1158
+ at Object.resolveDID (/Users/dylanhobbs/Documents/@kya-os/xmcp-i/packages/mcp-i-core/src/services/__tests__/proof-verifier.integration.test.ts:143:19)
1159
+ at processTicksAndRejections (node:internal/process/task_queues:103:5)
1160
+ at ProofVerifier.fetchPublicKeyFromDID (/Users/dylanhobbs/Documents/@kya-os/xmcp-i/packages/mcp-i-core/src/services/proof-verifier.ts:348:22)
1161
+ at /Users/dylanhobbs/Documents/@kya-os/xmcp-i/packages/mcp-i-core/src/services/__tests__/proof-verifier.integration.test.ts:252:7
1162
+ at file:///Users/dylanhobbs/Documents/@kya-os/xmcp-i/node_modules/.pnpm/@vitest+runner@4.0.5/node_modules/@vitest/runner/dist/index.js:753:20
1163
+
1164
+ stderr | src/__tests__/runtime/tool-protection-enforcement.test.ts > MCPIRuntimeBase - Tool Protection Enforcement > processToolCall with tool protection > should handle API errors during verification gracefully
1165
+ stdout | src/__tests__/runtime/tool-protection-enforcement.test.ts > MCPIRuntimeBase - Tool Protection Enforcement > processToolCall with tool protection > should handle API errors during verification gracefully
1166
+ [MCP-I] Checking tool protection: {
1167
+ [MCP-I] ❌ Delegation verification error (API failure) {
1168
+ tool: 'protectedTool',
1169
+ tool: 'protectedTool',
1170
+ agentDid: 'did:key:zmock123...',
1171
+ hasDelegation: true
1172
+ agentDid: 'did:key:zmock123...',
1173
+ }
1174
+
1175
+ stdout | src/__tests__/runtime/tool-protection-enforcement.test.ts > MCPIRuntimeBase - Tool Protection Enforcement > processToolCall with tool protection > should handle API errors during verification gracefully
1176
+ [MCP-I] 🔐 Verifying delegation token with AccessControlApiService {
1177
+ tool: 'protectedTool',
1178
+ agentDid: 'did:key:zmock123...',
1179
+ hasDelegationToken: true,
1180
+ errorCode: 'network_error',
1181
+ hasConsentProof: false,
1182
+ errorMessage: 'API unavailable',
1183
+ errorDetails: {}
1184
+ requiredScopes: [ 'files:write' ]
1185
+ }
1186
+
1187
+ stdout | src/__tests__/runtime/tool-protection-enforcement.test.ts > MCPIRuntimeBase - Tool Protection Enforcement > processToolCall with tool protection > should allow tool execution when access control service not configured (graceful degradation)
1188
+ }
1189
+ [MCP-I] Checking tool protection: {
1190
+ tool: 'protectedTool',
1191
+
1192
+ stderr | src/__tests__/runtime/tool-protection-enforcement.test.ts > MCPIRuntimeBase - Tool Protection Enforcement > processToolCall with tool protection > should allow tool execution when access control service not configured (graceful degradation)
1193
+ [MCP-I] ⚠️ Delegation token provided but AccessControlApiService not configured - skipping verification {
1194
+ agentDid: 'did:key:zmock123...',
1195
+ tool: 'protectedTool',
1196
+ hasDelegation: true
1197
+ }
1198
+
1199
+ agentDid: 'did:key:zmock123...',
1200
+ hasDelegationToken: true,
1201
+ hasConsentProof: false
1202
+ }
1203
+
1204
+ stderr | src/__tests__/runtime/tool-protection-enforcement.test.ts > MCPIRuntimeBase - Tool Protection Enforcement > processToolCall with tool protection > user_identifier validation > should reject delegation when user_identifier does not match session userDid
1205
+ stdout | src/__tests__/runtime/tool-protection-enforcement.test.ts > MCPIRuntimeBase - Tool Protection Enforcement > processToolCall with tool protection > user_identifier validation > should reject delegation when user_identifier does not match session userDid
1206
+ [MCP-I] 🔒 SECURITY: User identifier validation FAILED {
1207
+ [MCP-I] Checking tool protection: {
1208
+ tool: 'protectedTool',
1209
+ agentDid: 'did:key:zmock123...',
1210
+ hasDelegation: true
1211
+ tool: 'protectedTool',
1212
+ agentDid: 'did:key:zmock123...',
1213
+ }
1214
+
1215
+ delegationUserIdentifier: 'did:key:zUserB987654...',
1216
+ stdout | src/__tests__/runtime/tool-protection-enforcement.test.ts > MCPIRuntimeBase - Tool Protection Enforcement > processToolCall with tool protection > user_identifier validation > should reject delegation when user_identifier does not match session userDid
1217
+ [MCP-I] 🔐 Verifying delegation token with AccessControlApiService {
1218
+ sessionUserDid: 'did:key:zUserA123456...',
1219
+ sessionId: 'session123...',
1220
+ tool: 'protectedTool',
1221
+ agentDid: 'did:key:zmock123...',
1222
+ hasDelegationToken: true,
1223
+ reason: 'user_identifier_mismatch',
1224
+ hasConsentProof: false,
1225
+ severity: 'high'
1226
+ }
1227
+
1228
+ requiredScopes: [ 'files:write' ]
1229
+ }
1230
+
1231
+ stdout | src/__tests__/runtime/tool-protection-enforcement.test.ts > MCPIRuntimeBase - Tool Protection Enforcement > processToolCall with tool protection > user_identifier validation > should accept delegation when user_identifier matches session userDid
1232
+ [MCP-I] Checking tool protection: {
1233
+ tool: 'protectedTool',
1234
+ agentDid: 'did:key:zmock123...',
1235
+ hasDelegation: true
1236
+ }
1237
+
1238
+ stdout | src/__tests__/runtime/tool-protection-enforcement.test.ts > MCPIRuntimeBase - Tool Protection Enforcement > processToolCall with tool protection > user_identifier validation > should accept delegation when user_identifier matches session userDid
1239
+ [MCP-I] 🔐 Verifying delegation token with AccessControlApiService {
1240
+ tool: 'protectedTool',
1241
+ agentDid: 'did:key:zmock123...',
1242
+ hasDelegationToken: true,
1243
+ hasConsentProof: false,
1244
+ requiredScopes: [ 'files:write' ]
1245
+ }
1246
+
1247
+ stdout | src/__tests__/runtime/tool-protection-enforcement.test.ts > MCPIRuntimeBase - Tool Protection Enforcement > processToolCall with tool protection > user_identifier validation > should accept delegation when user_identifier matches session userDid
1248
+ [MCP-I] ✅ User identifier validation PASSED {
1249
+ tool: 'protectedTool',
1250
+ agentDid: 'did:key:zmock123...',
1251
+ userDid: 'did:key:zUserA123456...',
1252
+ sessionId: 'session123...'
1253
+ }
1254
+ [MCP-I] ✅ Delegation verification SUCCEEDED {
1255
+ tool: 'protectedTool',
1256
+ agentDid: 'did:key:zmock123...',
1257
+ delegationId: 'test-delegation-id',
1258
+ credentialScopes: [ 'files:write' ],
1259
+ requiredScopes: [ 'files:write' ]
1260
+ }
1261
+
1262
+ stdout | src/__tests__/runtime/tool-protection-enforcement.test.ts > MCPIRuntimeBase - Tool Protection Enforcement > processToolCall with tool protection > user_identifier validation > should handle missing user_identifier gracefully (backward compatibility)
1263
+ [MCP-I] Checking tool protection: {
1264
+ tool: 'protectedTool',
1265
+ stderr | src/__tests__/runtime/tool-protection-enforcement.test.ts > MCPIRuntimeBase - Tool Protection Enforcement > processToolCall with tool protection > user_identifier validation > should handle missing session userDid gracefully
1266
+ [MCP-I] ⚠️ Delegation has user_identifier but session missing userDid {
1267
+ tool: 'protectedTool',
1268
+ agentDid: 'did:key:zmock123...',
1269
+ agentDid: 'did:key:zmock123...',
1270
+ hasDelegation: true
1271
+ }
1272
+ delegationUserIdentifier: 'did:key:zUserA123456...',
1273
+ sessionId: 'session123...'
1274
+
1275
+ stdout | src/__tests__/runtime/tool-protection-enforcement.test.ts > MCPIRuntimeBase - Tool Protection Enforcement > processToolCall with tool protection > user_identifier validation > should handle missing user_identifier gracefully (backward compatibility)
1276
+ [MCP-I] 🔐 Verifying delegation token with AccessControlApiService {
1277
+ tool: 'protectedTool',
1278
+ agentDid: 'did:key:zmock123...',
1279
+ hasDelegationToken: true,
1280
+ hasConsentProof: false,
1281
+ requiredScopes: [ 'files:write' ]
1282
+ }
1283
+
1284
+ stdout | src/__tests__/runtime/tool-protection-enforcement.test.ts > MCPIRuntimeBase - Tool Protection Enforcement > processToolCall with tool protection > user_identifier validation > should handle missing user_identifier gracefully (backward compatibility)
1285
+ [MCP-I] ✅ Delegation verification SUCCEEDED {
1286
+ tool: 'protectedTool',
1287
+ agentDid: 'did:key:zmock123...',
1288
+ delegationId: 'test-delegation-id',
1289
+ credentialScopes: [ 'files:write' ],
1290
+ requiredScopes: [ 'files:write' ]
1291
+ }
1292
+
1293
+ stdout | src/__tests__/runtime/tool-protection-enforcement.test.ts > MCPIRuntimeBase - Tool Protection Enforcement > processToolCall with tool protection > user_identifier validation > should handle missing session userDid gracefully
1294
+ }
1295
+
1296
+ [MCP-I] Checking tool protection: {
1297
+ tool: 'protectedTool',
1298
+ agentDid: 'did:key:zmock123...',
1299
+ hasDelegation: true
1300
+ }
1301
+
1302
+ stdout | src/__tests__/runtime/tool-protection-enforcement.test.ts > MCPIRuntimeBase - Tool Protection Enforcement > processToolCall with tool protection > user_identifier validation > should handle missing session userDid gracefully
1303
+ [MCP-I] 🔐 Verifying delegation token with AccessControlApiService {
1304
+ tool: 'protectedTool',
1305
+ agentDid: 'did:key:zmock123...',
1306
+ hasDelegationToken: true,
1307
+ hasConsentProof: false,
1308
+ requiredScopes: [ 'files:write' ]
1309
+ }
1310
+
1311
+ stdout | src/__tests__/runtime/tool-protection-enforcement.test.ts > MCPIRuntimeBase - Tool Protection Enforcement > processToolCall with tool protection > user_identifier validation > should handle missing session userDid gracefully
1312
+ [MCP-I] ✅ Delegation verification SUCCEEDED {
1313
+ tool: 'protectedTool',
1314
+ agentDid: 'did:key:zmock123...',
1315
+ delegationId: 'test-delegation-id',
1316
+ credentialScopes: [ 'files:write' ],
1317
+ requiredScopes: [ 'files:write' ]
1318
+ }
1319
+
1320
+ stdout | src/__tests__/runtime/tool-protection-enforcement.test.ts > MCPIRuntimeBase - Tool Protection Enforcement > processToolCall with tool protection > should create proof after successful tool execution
1321
+ [MCP-I] Checking tool protection: {
1322
+ tool: 'unprotectedTool',
1323
+ agentDid: 'did:key:zmock123...',
1324
+ hasDelegation: false
1325
+ }
1326
+
1327
+ stdout | src/__tests__/runtime/tool-protection-enforcement.test.ts > MCPIRuntimeBase - Tool Protection Enforcement > processToolCall with tool protection > should create proof after successful tool execution
1328
+ [MCP-I] Tool protection check passed (no delegation required) {
1329
+ tool: 'unprotectedTool',
1330
+ agentDid: 'did:key:zmock123...',
1331
+ reason: 'Tool not configured to require delegation'
1332
+ }
1333
+
1334
+ stdout | src/__tests__/runtime/tool-protection-enforcement.test.ts > MCPIRuntimeBase - Tool Protection Enforcement > processToolCall with tool protection > should not create proof when tool execution is blocked
1335
+ [MCP-I] Checking tool protection: {
1336
+ tool: 'protectedTool',
1337
+ agentDid: 'did:key:zmock123...',
1338
+ hasDelegation: false
1339
+ }
1340
+
1341
+ stderr | src/__tests__/runtime/tool-protection-enforcement.test.ts > MCPIRuntimeBase - Tool Protection Enforcement > processToolCall with tool protection > should not create proof when tool execution is blocked
1342
+ [MCP-I] BLOCKED: Tool requires delegation but none provided {
1343
+ tool: 'protectedTool',
1344
+ requiredScopes: [ 'files:write' ],
1345
+ agentDid: 'did:key:zmock123...',
1346
+ resumeToken: 'resume_gw6or8_midnqpjr',
1347
+ consentUrl: 'https://kya.vouched.id/bouncer/consent?tool=protectedTool&scopes=files%3Awrite&session_id=session123&agent_did=&resume_token=resume_gw6or8_midnqpjr'
1348
+ }
1349
+
1350
+ stdout | src/__tests__/runtime/tool-protection-enforcement.test.ts > MCPIRuntimeBase - Tool Protection Enforcement > DelegationRequiredError details > should include tool name in error
1351
+ [MCP-I] Checking tool protection: {
1352
+ tool: 'protectedTool',
1353
+ agentDid: 'did:key:zmock123...',
1354
+ hasDelegation: false
1355
+ }
1356
+ stderr | src/__tests__/runtime/tool-protection-enforcement.test.ts > MCPIRuntimeBase - Tool Protection Enforcement > DelegationRequiredError details > should include tool name in error
1357
+
1358
+ stdout | src/__tests__/runtime/tool-protection-enforcement.test.ts > MCPIRuntimeBase - Tool Protection Enforcement > DelegationRequiredError details > should include required scopes in error
1359
+ [MCP-I] BLOCKED: Tool requires delegation but none provided {
1360
+ [MCP-I] Checking tool protection: {
1361
+ tool: 'protectedTool',
1362
+ requiredScopes: [ 'files:write' ],
1363
+ agentDid: 'did:key:zmock123...',
1364
+ resumeToken: 'resume_gw6or8_midnqpjr',
1365
+ tool: 'protectedTool',
1366
+ agentDid: 'did:key:zmock123...',
1367
+ hasDelegation: false
1368
+ }
1369
+
1370
+ consentUrl: 'https://kya.vouched.id/bouncer/consent?tool=protectedTool&scopes=files%3Awrite&session_id=session123&agent_did=&resume_token=resume_gw6or8_midnqpjr'
1371
+ }
1372
+
1373
+ stderr | src/__tests__/runtime/tool-protection-enforcement.test.ts > MCPIRuntimeBase - Tool Protection Enforcement > DelegationRequiredError details > should include required scopes in error
1374
+ [MCP-I] BLOCKED: Tool requires delegation but none provided {
1375
+ tool: 'protectedTool',
1376
+ requiredScopes: [ 'files:write', 'files:read' ],
1377
+ agentDid: 'did:key:zmock123...',
1378
+ resumeToken: 'resume_gw6os3_midnqpjs',
1379
+ consentUrl: 'https://kya.vouched.id/bouncer/consent?tool=protectedTool&scopes=files%3Awrite%2Cfiles%3Aread&session_id=session123&agent_did=&resume_token=resume_gw6os3_midnqpjs'
1380
+ }
1381
+
1382
+ stdout | src/__tests__/runtime/tool-protection-enforcement.test.ts > MCPIRuntimeBase - Tool Protection Enforcement > DelegationRequiredError details > should include consent URL in error
1383
+ stderr | src/__tests__/runtime/tool-protection-enforcement.test.ts > MCPIRuntimeBase - Tool Protection Enforcement > DelegationRequiredError details > should include consent URL in error
1384
+ [MCP-I] Checking tool protection: {
1385
+ tool: 'protectedTool',
1386
+ agentDid: 'did:key:zmock123...',
1387
+ hasDelegation: false
1388
+ }
1389
+ [MCP-I] BLOCKED: Tool requires delegation but none provided {
1390
+
1391
+ tool: 'protectedTool',
1392
+ requiredScopes: [ 'files:write' ],
1393
+ agentDid: 'did:key:zmock123...',
1394
+ resumeToken: 'resume_gw6os3_midnqpjs',
1395
+ consentUrl: 'https://kya.vouched.id/bouncer/consent?tool=protectedTool&scopes=files%3Awrite&session_id=session123&agent_did=&resume_token=resume_gw6os3_midnqpjs'
1396
+ }
1397
+
1398
+ stderr | src/__tests__/runtime/tool-protection-enforcement.test.ts > MCPIRuntimeBase - Tool Protection Enforcement > DelegationRequiredError details > should include resume token in error
1399
+ [MCP-I] BLOCKED: Tool requires delegation but none provided {
1400
+ tool: 'protectedTool',
1401
+ stdout | src/__tests__/runtime/tool-protection-enforcement.test.ts > MCPIRuntimeBase - Tool Protection Enforcement > DelegationRequiredError details > should include resume token in error
1402
+ [MCP-I] Checking tool protection: {
1403
+ tool: 'protectedTool',
1404
+ agentDid: 'did:key:zmock123...',
1405
+ hasDelegation: false
1406
+ }
1407
+
1408
+ stdout | src/__tests__/runtime/tool-protection-enforcement.test.ts > MCPIRuntimeBase - Tool Protection Enforcement > DelegationRequiredError details > should include intercepted call context in error
1409
+ [MCP-I] Checking tool protection: {
1410
+ requiredScopes: [ 'files:write' ],
1411
+ tool: 'protectedTool',
1412
+ agentDid: 'did:key:zmock123...',
1413
+ hasDelegation: false
1414
+ }
1415
+
1416
+ agentDid: 'did:key:zmock123...',
1417
+ resumeToken: 'resume_gw6os3_midnqpjs',
1418
+ consentUrl: 'https://kya.vouched.id/bouncer/consent?tool=protectedTool&scopes=files%3Awrite&session_id=session123&agent_did=&resume_token=resume_gw6os3_midnqpjs'
1419
+ }
1420
+
1421
+ stderr | src/__tests__/runtime/tool-protection-enforcement.test.ts > MCPIRuntimeBase - Tool Protection Enforcement > DelegationRequiredError details > should include intercepted call context in error
1422
+ [MCP-I] BLOCKED: Tool requires delegation but none provided {
1423
+ tool: 'protectedTool',
1424
+ requiredScopes: [ 'files:write' ],
1425
+ agentDid: 'did:key:zmock123...',
1426
+ resumeToken: 'resume_x2ww0e_midnqpjs',
1427
+ consentUrl: 'https://kya.vouched.id/bouncer/consent?tool=protectedTool&scopes=files%3Awrite&session_id=session123&agent_did=&resume_token=resume_x2ww0e_midnqpjs'
1428
+ }
1429
+
1430
+ stdout | src/__tests__/runtime/tool-protection-enforcement.test.ts > MCPIRuntimeBase - Tool Protection Enforcement > audit logging > should log tool protection check when audit enabled
1431
+ [MCP-I] Checking tool protection: {
1432
+ tool: 'testTool',
1433
+ agentDid: 'did:key:zmock123...',
1434
+ hasDelegation: false
1435
+ }
1436
+
1437
+ stdout | src/__tests__/runtime/tool-protection-enforcement.test.ts > MCPIRuntimeBase - Tool Protection Enforcement > audit logging > should log tool protection check when audit enabled
1438
+ [MCP-I] Tool protection check passed (no delegation required) {
1439
+ tool: 'testTool',
1440
+ agentDid: 'did:key:zmock123...',
1441
+ reason: 'Tool not configured to require delegation'
1442
+ }
1443
+
1444
+ stdout | src/__tests__/runtime/tool-protection-enforcement.test.ts > MCPIRuntimeBase - Tool Protection Enforcement > audit logging > should log blocked tool call when audit enabled
1445
+ [MCP-I] Checking tool protection: {
1446
+ tool: 'protectedTool',
1447
+ agentDid: 'did:key:zmock123...',
1448
+ hasDelegation: false
1449
+ }
1450
+
1451
+ stdout | src/__tests__/runtime/tool-protection-enforcement.test.ts > MCPIRuntimeBase - Tool Protection Enforcement > tool protection service integration > should use agent DID from identity for protection check
1452
+ [MCP-I] Checking tool protection: {
1453
+ tool: 'testTool',
1454
+ agentDid: 'did:key:zmock123...',
1455
+ hasDelegation: false
1456
+ }
1457
+
1458
+ stdout | src/__tests__/runtime/tool-protection-enforcement.test.ts > MCPIRuntimeBase - Tool Protection Enforcement > tool protection service integration > should use agent DID from identity for protection check
1459
+ [MCP-I] Tool protection check passed (no delegation required) {
1460
+ tool: 'testTool',
1461
+ agentDid: 'did:key:zmock123...',
1462
+ reason: 'Tool not configured to require delegation'
1463
+ }
1464
+
1465
+ stdout | src/__tests__/runtime/tool-protection-enforcement.test.ts > MCPIRuntimeBase - Tool Protection Enforcement > tool protection service integration > should handle tool protection service errors gracefully
1466
+ [MCP-I] Checking tool protection: {
1467
+ tool: 'testTool',
1468
+ agentDid: 'did:key:zmock123...',
1469
+ hasDelegation: false
1470
+ }
1471
+
1472
+ stdout | src/__tests__/runtime/tool-protection-enforcement.test.ts > MCPIRuntimeBase - Tool Protection Enforcement > edge cases > should handle empty required scopes array
1473
+ [MCP-I] Checking tool protection: {
1474
+ tool: 'protectedTool',
1475
+ agentDid: 'did:key:zmock123...',
1476
+ hasDelegation: false
1477
+ }
1478
+
1479
+ stderr | src/__tests__/runtime/tool-protection-enforcement.test.ts > MCPIRuntimeBase - Tool Protection Enforcement > edge cases > should handle empty required scopes array
1480
+ [MCP-I] BLOCKED: Tool requires delegation but none provided {
1481
+ tool: 'protectedTool',
1482
+ requiredScopes: [],
1483
+ agentDid: 'did:key:zmock123...',
1484
+ resumeToken: 'resume_gw6osy_midnqpjt',
1485
+ consentUrl: 'https://kya.vouched.id/bouncer/consent?tool=protectedTool&scopes=&session_id=session123&agent_did=&resume_token=resume_gw6osy_midnqpjt'
1486
+ }
1487
+
1488
+ stdout | src/__tests__/runtime/tool-protection-enforcement.test.ts > MCPIRuntimeBase - Tool Protection Enforcement > edge cases > should handle multiple required scopes
1489
+ [MCP-I] Checking tool protection: {
1490
+ tool: 'protectedTool',
1491
+ agentDid: 'did:key:zmock123...',
1492
+ stderr | src/__tests__/runtime/tool-protection-enforcement.test.ts > MCPIRuntimeBase - Tool Protection Enforcement > edge cases > should handle multiple required scopes
1493
+ hasDelegation: false
1494
+ [MCP-I] BLOCKED: Tool requires delegation but none provided {
1495
+ }
1496
+
1497
+ tool: 'protectedTool',
1498
+ requiredScopes: [ 'scope1', 'scope2', 'scope3' ],
1499
+ agentDid: 'did:key:zmock123...',
1500
+ resumeToken: 'resume_gw6ott_midnqpju',
1501
+ consentUrl: 'https://kya.vouched.id/bouncer/consent?tool=protectedTool&scopes=scope1%2Cscope2%2Cscope3&session_id=session123&agent_did=&resume_token=resume_gw6ott_midnqpju'
1502
+ }
1503
+
1504
+ stderr | src/__tests__/runtime/tool-protection-enforcement.test.ts > MCPIRuntimeBase - Tool Protection Enforcement > edge cases > should handle session without id
1505
+ [MCP-I] BLOCKED: Tool requires delegation but none provided {
1506
+ stdout | src/__tests__/runtime/tool-protection-enforcement.test.ts > MCPIRuntimeBase - Tool Protection Enforcement > edge cases > should handle session without id
1507
+ [MCP-I] Checking tool protection: {
1508
+ tool: 'protectedTool',
1509
+ agentDid: 'did:key:zmock123...',
1510
+ tool: 'protectedTool',
1511
+ hasDelegation: false
1512
+ }
1513
+
1514
+ requiredScopes: [ 'files:write' ],
1515
+ agentDid: 'did:key:zmock123...',
1516
+ resumeToken: 'resume_ty8p8j_midnqpju',
1517
+ consentUrl: 'https://kya.vouched.id/bouncer/consent?tool=protectedTool&scopes=files%3Awrite&session_id=&agent_did=&resume_token=resume_ty8p8j_midnqpju'
1518
+ }
1519
+
1520
+ stdout | src/__tests__/runtime/tool-protection-enforcement.test.ts > MCPIRuntimeBase - Tool Protection Enforcement > edge cases > should handle handler errors independently of protection
1521
+ [MCP-I] Checking tool protection: {
1522
+ tool: 'errorTool',
1523
+ agentDid: 'did:key:zmock123...',
1524
+ hasDelegation: false
1525
+ }
1526
+
1527
+ stdout | src/__tests__/runtime/tool-protection-enforcement.test.ts > MCPIRuntimeBase - Tool Protection Enforcement > edge cases > should handle handler errors independently of protection
1528
+ [MCP-I] Tool protection check passed (no delegation required) {
1529
+ tool: 'errorTool',
1530
+ agentDid: 'did:key:zmock123...',
1531
+ reason: 'Tool not configured to require delegation'
1532
+ }
1533
+
1534
+ stdout | src/__tests__/integration/full-flow.test.ts > Full Flow Integration > Tool protection enforcement flow > should allow unprotected tool calls
1535
+ [ToolProtectionService] Config loaded from API {
1536
+ source: 'api',
1537
+ toolCount: 1,
1538
+ protectedTools: [],
1539
+ agentDid: 'did:key:z6MkhaXgBZDv...',
1540
+ projectId: 'test-project',
1541
+ cacheTtlMs: 300000,
1542
+ cacheExpiresAt: '2025-11-24T21:32:09.791Z'
1543
+ }
1544
+
1545
+ stdout | src/__tests__/integration/full-flow.test.ts > Full Flow Integration > Tool protection enforcement flow > should intercept protected tool calls without delegation
1546
+ [ToolProtectionService] Config loaded from API {
1547
+ source: 'api',
1548
+ toolCount: 1,
1549
+ protectedTools: [ 'checkout' ],
1550
+ agentDid: 'did:key:z6MkhaXgBZDv...',
1551
+ projectId: 'test-project',
1552
+ cacheTtlMs: 300000,
1553
+ cacheExpiresAt: '2025-11-24T21:32:09.792Z'
1554
+ }
1555
+
1556
+ stdout | src/__tests__/integration/full-flow.test.ts > Full Flow Integration > Tool protection enforcement flow > should intercept protected tool calls without delegation
1557
+ [ToolProtectionService] Protection check {
1558
+ tool: 'checkout',
1559
+ agentDid: 'did:key:z6MkhaXgBZDv...',
1560
+ found: true,
1561
+ isWildcard: false,
1562
+ requiresDelegation: true,
1563
+ availableTools: [ 'checkout' ]
1564
+ }
1565
+
1566
+ stdout | src/__tests__/integration/full-flow.test.ts > Full Flow Integration > AgentShield integration flow > should fetch tool protection config from AgentShield
1567
+ [ToolProtectionService] Config loaded from API {
1568
+ source: 'api',
1569
+ toolCount: 1,
1570
+ protectedTools: [ 'protected_tool' ],
1571
+ agentDid: 'did:key:z6MkhaXgBZDv...',
1572
+ projectId: 'test-project',
1573
+ cacheTtlMs: 300000,
1574
+ cacheExpiresAt: '2025-11-24T21:32:09.793Z'
1575
+ }
1576
+
1577
+ stdout | src/__tests__/integration/full-flow.test.ts > Full Flow Integration > AgentShield integration flow > should cache tool protection config
1578
+ [ToolProtectionService] Config loaded from API {
1579
+ source: 'api',
1580
+ toolCount: 1,
1581
+ protectedTools: [ 'tool1' ],
1582
+ agentDid: 'did:key:z6MkhaXgBZDv...',
1583
+ projectId: 'test-project',
1584
+ cacheTtlMs: 300000,
1585
+ cacheExpiresAt: '2025-11-24T21:32:09.794Z'
1586
+ }
1587
+
1588
+ stderr | src/__tests__/integration/full-flow.test.ts > Full Flow Integration > AgentShield integration flow > should use fallback config when API fails
1589
+ [ToolProtectionService] API fetch failed, using fallback config { agentDid: 'did:key:z6MkhaXgBZDv...', error: 'Network error' }
1590
+
1591
+ ✓ src/__tests__/runtime/tool-protection-enforcement.test.ts (29 tests) 72ms
1592
+ stderr | src/__tests__/integration/full-flow.test.ts > Full Flow Integration > Error handling in full flow > should handle tool protection service errors gracefully
1593
+ [ToolProtectionService] API fetch failed, no fallback, failing closed (deny-all) {
1594
+ agentDid: 'did:key:z6MkhaXgBZDv...',
1595
+ error: 'Network error',
1596
+ cacheKey: 'config:tool-protections:test-project'
1597
+ }
1598
+
1599
+ stdout | src/__tests__/integration/full-flow.test.ts > Full Flow Integration > Cache integration in full flow > should share cache across multiple service instances
1600
+ stderr | src/__tests__/integration/full-flow.test.ts > Full Flow Integration > Error handling in full flow > should handle network timeouts
1601
+ [ToolProtectionService] Config loaded from API {
1602
+ source: 'api',
1603
+ [ToolProtectionService] API fetch failed, using fallback config { agentDid: 'did:key:z6MkhaXgBZDv...', error: 'Network timeout' }
1604
+ toolCount: 1,
1605
+
1606
+ protectedTools: [ 'tool1' ],
1607
+ agentDid: 'did:key:z6MkhaXgBZDv...',
1608
+ projectId: 'test-project',
1609
+ cacheTtlMs: 300000,
1610
+ cacheExpiresAt: '2025-11-24T21:32:09.796Z'
1611
+ }
1612
+
1613
+ stdout | src/__tests__/integration/full-flow.test.ts > Full Flow Integration > Cache integration in full flow > should clear cache when needed
1614
+ [ToolProtectionService] Config loaded from API {
1615
+ source: 'api',
1616
+ toolCount: 1,
1617
+ protectedTools: [ 'tool1' ],
1618
+ agentDid: 'did:key:z6MkhaXgBZDv...',
1619
+ projectId: 'test-project',
1620
+ cacheTtlMs: 300000,
1621
+ cacheExpiresAt: '2025-11-24T21:32:09.796Z'
1622
+ }
1623
+
1624
+ stdout | src/__tests__/integration/full-flow.test.ts > Full Flow Integration > Cache integration in full flow > should clear cache when needed
1625
+ [ToolProtectionService] Config loaded from API {
1626
+ source: 'api',
1627
+ toolCount: 1,
1628
+ protectedTools: [ 'tool1' ],
1629
+ agentDid: 'did:key:z6MkhaXgBZDv...',
1630
+ projectId: 'test-project',
1631
+ cacheTtlMs: 300000,
1632
+ cacheExpiresAt: '2025-11-24T21:32:09.796Z'
1633
+ }
1634
+
1635
+ stdout | src/__tests__/integration/full-flow.test.ts > Full Flow Integration > Real-world e-commerce scenario > should handle complete e-commerce flow with tool protection
1636
+ [ToolProtectionService] Config loaded from API {
1637
+ source: 'api',
1638
+ toolCount: 3,
1639
+ protectedTools: [ 'add_to_cart', 'checkout' ],
1640
+ agentDid: 'did:key:z6MkhaXgBZDv...',
1641
+ projectId: 'test-project',
1642
+ cacheTtlMs: 300000,
1643
+ cacheExpiresAt: '2025-11-24T21:32:09.797Z'
1644
+ }
1645
+
1646
+ stdout | src/__tests__/integration/full-flow.test.ts > Full Flow Integration > Real-world e-commerce scenario > should handle complete e-commerce flow with tool protection
1647
+ [ToolProtectionService] Protection check {
1648
+ tool: 'add_to_cart',
1649
+ agentDid: 'did:key:z6MkhaXgBZDv...',
1650
+ found: true,
1651
+ isWildcard: false,
1652
+ requiresDelegation: true,
1653
+ availableTools: [ 'search_products', 'add_to_cart', 'checkout' ]
1654
+ }
1655
+
1656
+ stdout | src/__tests__/integration/full-flow.test.ts > Full Flow Integration > Concurrent operations > should handle concurrent cache operations
1657
+ [ToolProtectionService] Config loaded from API {
1658
+ source: 'api',
1659
+ toolCount: 1,
1660
+ protectedTools: [ 'tool1' ],
1661
+ agentDid: 'did:key:z6MkhaXgBZDv...',
1662
+ projectId: 'test-project',
1663
+ cacheTtlMs: 300000,
1664
+ cacheExpiresAt: '2025-11-24T21:32:09.797Z'
1665
+ }
1666
+ [ToolProtectionService] Config loaded from API {
1667
+ source: 'api',
1668
+ toolCount: 1,
1669
+ protectedTools: [ 'tool1' ],
1670
+ agentDid: 'did:key:z6MkhaXgBZDv...',
1671
+ projectId: 'test-project',
1672
+ cacheTtlMs: 300000,
1673
+ cacheExpiresAt: '2025-11-24T21:32:09.797Z'
1674
+ }
1675
+ [ToolProtectionService] Config loaded from API {
1676
+ source: 'api',
1677
+ toolCount: 1,
1678
+ protectedTools: [ 'tool1' ],
1679
+ agentDid: 'did:key:z6MkhaXgBZDv...',
1680
+ projectId: 'test-project',
1681
+ cacheTtlMs: 300000,
1682
+ cacheExpiresAt: '2025-11-24T21:32:09.797Z'
1683
+ }
1684
+
1685
+ ✓ src/__tests__/integration/full-flow.test.ts (21 tests) 15ms
1686
+ stderr | src/services/__tests__/proof-verifier.integration.test.ts > ProofVerifier Integration - Real DID Resolution > did:web Resolution (HTTP) > should handle HTTP errors gracefully
1687
+ [ProofVerifier] Failed to fetch public key from DID: Error: Failed to resolve did:web:nonexistent-domain-that-does-not-exist-12345.com: fetch failed
1688
+ at Object.resolveDID (/Users/dylanhobbs/Documents/@kya-os/xmcp-i/packages/mcp-i-core/src/services/__tests__/proof-verifier.integration.test.ts:143:19)
1689
+ at processTicksAndRejections (node:internal/process/task_queues:103:5)
1690
+ at ProofVerifier.fetchPublicKeyFromDID (/Users/dylanhobbs/Documents/@kya-os/xmcp-i/packages/mcp-i-core/src/services/proof-verifier.ts:348:22)
1691
+ at /Users/dylanhobbs/Documents/@kya-os/xmcp-i/packages/mcp-i-core/src/services/__tests__/proof-verifier.integration.test.ts:257:9
1692
+ at file:///Users/dylanhobbs/Documents/@kya-os/xmcp-i/node_modules/.pnpm/@vitest+runner@4.0.5/node_modules/@vitest/runner/dist/index.js:753:20
1693
+
1694
+ ✓ src/__tests__/runtime/base.test.ts (55 tests) 24ms
1695
+ ✓ src/services/__tests__/proof-verifier.integration.test.ts (13 tests | 1 skipped) 165ms
1696
+ ✓ src/services/__tests__/access-control.integration.test.ts (9 tests) 200ms
1697
+ stdout | src/__tests__/services/tool-protection.service.test.ts > ToolProtectionService > getToolProtectionConfig > API fetch - new endpoint format > should fetch from project-scoped endpoint when projectId is available
1698
+ [ToolProtectionService] Config loaded from API {
1699
+ source: 'api',
1700
+ toolCount: 2,
1701
+ protectedTools: [ 'checkout' ],
1702
+ agentDid: 'did:key:z6MkhaXgBZDv...',
1703
+ projectId: 'test-project-123',
1704
+ cacheTtlMs: 300000,
1705
+ cacheExpiresAt: '2025-11-24T21:32:10.105Z'
1706
+ }
1707
+
1708
+ stdout | src/__tests__/services/tool-protection.service.test.ts > ToolProtectionService > getToolProtectionConfig > API fetch - new endpoint format > should handle new endpoint format with toolProtections object
1709
+ [ToolProtectionService] Config loaded from API {
1710
+ source: 'api',
1711
+ toolCount: 2,
1712
+ protectedTools: [ 'protected_tool' ],
1713
+ agentDid: 'did:key:z6MkhaXgBZDv...',
1714
+ projectId: 'test-project-123',
1715
+ cacheTtlMs: 300000,
1716
+ cacheExpiresAt: '2025-11-24T21:32:10.107Z'
1717
+ }
1718
+
1719
+ stdout | src/__tests__/services/tool-protection.service.test.ts > ToolProtectionService > getToolProtectionConfig > API fetch - new endpoint format > should parse oauthProvider from new endpoint format (Phase 2)
1720
+ [ToolProtectionService] Config loaded from API {
1721
+ source: 'api',
1722
+ toolCount: 2,
1723
+ protectedTools: [ 'read_repos', 'send_email' ],
1724
+ agentDid: 'did:key:z6MkhaXgBZDv...',
1725
+ projectId: 'test-project-123',
1726
+ cacheTtlMs: 300000,
1727
+ cacheExpiresAt: '2025-11-24T21:32:10.107Z'
1728
+ }
1729
+
1730
+ stdout | src/__tests__/services/tool-protection.service.test.ts > ToolProtectionService > getToolProtectionConfig > API fetch - new endpoint format > should preserve oauthProvider through cache operations
1731
+ [ToolProtectionService] Config loaded from API {
1732
+ source: 'api',
1733
+ toolCount: 1,
1734
+ protectedTools: [ 'read_repos' ],
1735
+ agentDid: 'did:key:z6MkhaXgBZDv...',
1736
+ projectId: 'test-project-123',
1737
+ cacheTtlMs: 300000,
1738
+ cacheExpiresAt: '2025-11-24T21:32:10.107Z'
1739
+ }
1740
+
1741
+ stdout | src/__tests__/services/tool-protection.service.test.ts > ToolProtectionService > getToolProtectionConfig > API fetch - old endpoint format > should fetch from agent-scoped endpoint when projectId is not available
1742
+ [ToolProtectionService] Config loaded from API {
1743
+ source: 'api',
1744
+ toolCount: 2,
1745
+ protectedTools: [ 'checkout' ],
1746
+ agentDid: 'did:key:z6MkhaXgBZDv...',
1747
+ projectId: 'none',
1748
+ cacheTtlMs: 300000,
1749
+ cacheExpiresAt: '2025-11-24T21:32:10.107Z'
1750
+ }
1751
+
1752
+ stdout | src/__tests__/services/tool-protection.service.test.ts > ToolProtectionService > getToolProtectionConfig > API fetch - old endpoint format > should handle old endpoint format with tools array
1753
+ [ToolProtectionService] Config loaded from API {
1754
+ source: 'api',
1755
+ toolCount: 2,
1756
+ protectedTools: [ 'tool1' ],
1757
+ agentDid: 'did:key:z6MkhaXgBZDv...',
1758
+ projectId: 'none',
1759
+ cacheTtlMs: 300000,
1760
+ cacheExpiresAt: '2025-11-24T21:32:10.108Z'
1761
+ }
1762
+
1763
+ stdout | src/__tests__/services/tool-protection.service.test.ts > ToolProtectionService > getToolProtectionConfig > API fetch - old endpoint format > should parse oauthProvider from old endpoint format (tools array)
1764
+ [ToolProtectionService] Config loaded from API {
1765
+ source: 'api',
1766
+ toolCount: 2,
1767
+ protectedTools: [ 'read_repos', 'send_email' ],
1768
+ agentDid: 'did:key:z6MkhaXgBZDv...',
1769
+ projectId: 'none',
1770
+ cacheTtlMs: 300000,
1771
+ cacheExpiresAt: '2025-11-24T21:32:10.108Z'
1772
+ }
1773
+
1774
+ stdout | src/__tests__/services/tool-protection.service.test.ts > ToolProtectionService > getToolProtectionConfig > API fetch - old endpoint format > should handle old endpoint format with tools object
1775
+ [ToolProtectionService] Config loaded from API {
1776
+ source: 'api',
1777
+ toolCount: 2,
1778
+ protectedTools: [ 'tool1' ],
1779
+ agentDid: 'did:key:z6MkhaXgBZDv...',
1780
+ projectId: 'none',
1781
+ cacheTtlMs: 300000,
1782
+ cacheExpiresAt: '2025-11-24T21:32:10.108Z'
1783
+ }
1784
+
1785
+ stdout | src/__tests__/services/tool-protection.service.test.ts > ToolProtectionService > getToolProtectionConfig > API fetch - old endpoint format > should parse oauthProvider from old endpoint format (tools object)
1786
+ [ToolProtectionService] Config loaded from API {
1787
+ source: 'api',
1788
+ toolCount: 2,
1789
+ protectedTools: [ 'read_repos', 'send_email' ],
1790
+ agentDid: 'did:key:z6MkhaXgBZDv...',
1791
+ projectId: 'none',
1792
+ cacheTtlMs: 300000,
1793
+ cacheExpiresAt: '2025-11-24T21:32:10.108Z'
1794
+ }
1795
+
1796
+ stdout | src/__tests__/services/tool-protection.service.test.ts > ToolProtectionService > getToolProtectionConfig > API fetch - old endpoint format > should skip tools without name in array format
1797
+ [ToolProtectionService] Cache miss, fetching from API {
1798
+ source: 'api-fetch-start',
1799
+ cacheKey: 'agent:did:key:z6MkhaXgBZDvotDkL5257faiztiGiC2QtKLGpbnnEGta2doK',
1800
+ agentDid: 'did:key:z6MkhaXgBZDv...',
1801
+ projectId: 'none',
1802
+ apiUrl: 'https://kya.vouched.id',
1803
+ endpoint: '/api/v1/bouncer/config?agent_did=did:key:z6MkhaXgBZDvotDkL5257faiztiGiC2QtKLGpbnnEGta2doK'
1804
+ }
1805
+ [ToolProtectionService] Fetching from API: https://kya.vouched.id/api/v1/bouncer/config?agent_did=did%3Akey%3Az6MkhaXgBZDvotDkL5257faiztiGiC2QtKLGpbnnEGta2doK {
1806
+ method: 'config?agent_did (old)',
1807
+ projectId: 'none',
1808
+ apiKeyPresent: true,
1809
+ apiKeyLength: 18,
1810
+ apiKeyMasked: 'test-api...'
1811
+ }
1812
+
1813
+ stdout | src/__tests__/services/tool-protection.service.test.ts > ToolProtectionService > getToolProtectionConfig > API fetch - old endpoint format > should skip tools without name in array format
1814
+ [ToolProtectionService] API response received {
1815
+ source: 'api-fetch-complete',
1816
+ agentDid: 'did:key:z6MkhaXgBZDv...',
1817
+ projectId: 'none',
1818
+ responseKeys: [ 'success', 'data', 'metadata' ],
1819
+ dataKeys: [ 'tools' ],
1820
+ rawToolProtections: null,
1821
+ rawTools: [
1822
+ { name: 'valid_tool', requiresDelegation: true },
1823
+ { requiresDelegation: false }
1824
+ ],
1825
+ responseMetadata: {}
1826
+ }
1827
+
1828
+ stdout | src/__tests__/services/tool-protection.service.test.ts > ToolProtectionService > getToolProtectionConfig > API fetch - old endpoint format > should skip tools without name in array format
1829
+ [ToolProtectionService] Config loaded from API {
1830
+ source: 'api',
1831
+ toolCount: 1,
1832
+ protectedTools: [ 'valid_tool' ],
1833
+ agentDid: 'did:key:z6MkhaXgBZDv...',
1834
+ projectId: 'none',
1835
+ cacheTtlMs: 300000,
1836
+ cacheExpiresAt: '2025-11-24T21:32:10.109Z'
1837
+ }
1838
+ [ToolProtectionService] API fetch successful, config cached {
1839
+ source: 'cache-write',
1840
+ agentDid: 'did:key:z6MkhaXgBZDv...',
1841
+ cacheKey: 'agent:did:key:z6MkhaXgBZDvotDkL5257faiztiGiC2QtKLGpbnnEGta2doK',
1842
+ toolCount: 1,
1843
+ tools: [ { name: 'valid_tool', requiresDelegation: true, scopeCount: 0 } ],
1844
+ ttlMs: 300000,
1845
+ ttlMinutes: 5,
1846
+ expiresAt: '2025-11-24T21:32:10.109Z',
1847
+ expiresIn: '300s'
1848
+ }
1849
+
1850
+ stdout | src/__tests__/services/tool-protection.service.test.ts > ToolProtectionService > getToolProtectionConfig > caching behavior > should cache successful API responses
1851
+ stderr | src/__tests__/services/tool-protection.service.test.ts > ToolProtectionService > getToolProtectionConfig > API fetch error handling > should handle network errors gracefully
1852
+ [ToolProtectionService] API fetch failed, no fallback, failing closed (deny-all) {
1853
+ [ToolProtectionService] Config loaded from API {
1854
+ agentDid: 'did:key:z6MkhaXgBZDv...',
1855
+ source: 'api',
1856
+ toolCount: 1,
1857
+ protectedTools: [ 'tool1' ],
1858
+ error: 'ECONNREFUSED',
1859
+ agentDid: 'did:key:z6MkhaXgBZDv...',
1860
+ projectId: 'none',
1861
+ cacheTtlMs: 300000,
1862
+ cacheExpiresAt: '2025-11-24T21:32:10.112Z'
1863
+ cacheKey: 'agent:did:key:z6MkhaXgBZDvotDkL5257faiztiGiC2QtKLGpbnnEGta2doK'
1864
+ }
1865
+ }
1866
+
1867
+ stdout | src/__tests__/services/tool-protection.service.test.ts > ToolProtectionService > getToolProtectionConfig > caching behavior > should use default cache TTL when not specified
1868
+ [ToolProtectionService] Config loaded from API {
1869
+ source: 'api',
1870
+ toolCount: 0,
1871
+
1872
+ protectedTools: [],
1873
+ agentDid: 'did:key:z6MkhaXgBZDv...',
1874
+ projectId: 'none',
1875
+ cacheTtlMs: 300000,
1876
+ cacheExpiresAt: '2025-11-24T21:32:10.112Z'
1877
+ }
1878
+
1879
+ stdout | src/__tests__/services/tool-protection.service.test.ts > ToolProtectionService > getToolProtectionConfig > caching behavior > should use custom cache TTL when specified
1880
+ [ToolProtectionService] Config loaded from API {
1881
+ source: 'api',
1882
+ toolCount: 0,
1883
+ protectedTools: [],
1884
+ agentDid: 'did:key:z6MkhaXgBZDv...',
1885
+ projectId: 'none',
1886
+ cacheTtlMs: 600000,
1887
+ cacheExpiresAt: '2025-11-24T21:37:10.112Z'
1888
+ }
1889
+
1890
+ stdout | src/__tests__/services/tool-protection.service.test.ts > ToolProtectionService > getToolProtectionConfig > edge cases > should handle empty toolProtections object
1891
+ [ToolProtectionService] Config loaded from API {
1892
+ source: 'api',
1893
+ toolCount: 0,
1894
+ protectedTools: [],
1895
+ agentDid: 'did:key:z6MkhaXgBZDv...',
1896
+ projectId: 'none',
1897
+ cacheTtlMs: 300000,
1898
+ cacheExpiresAt: '2025-11-24T21:32:10.112Z'
1899
+ }
1900
+
1901
+ stdout | src/__tests__/services/tool-protection.service.test.ts > ToolProtectionService > getToolProtectionConfig > edge cases > should handle null requiredScopes
1902
+ [ToolProtectionService] Config loaded from API {
1903
+ source: 'api',
1904
+ toolCount: 1,
1905
+ protectedTools: [ 'tool1' ],
1906
+ agentDid: 'did:key:z6MkhaXgBZDv...',
1907
+ projectId: 'none',
1908
+ cacheTtlMs: 300000,
1909
+ cacheExpiresAt: '2025-11-24T21:32:10.112Z'
1910
+ }
1911
+
1912
+ stdout | src/__tests__/services/tool-protection.service.test.ts > ToolProtectionService > getToolProtectionConfig > edge cases > should handle mixed camelCase and snake_case in response
1913
+ [ToolProtectionService] Config loaded from API {
1914
+ source: 'api',
1915
+ toolCount: 2,
1916
+ protectedTools: [ 'tool1' ],
1917
+ agentDid: 'did:key:z6MkhaXgBZDv...',
1918
+ projectId: 'none',
1919
+ cacheTtlMs: 300000,
1920
+ cacheExpiresAt: '2025-11-24T21:32:10.112Z'
1921
+ }
1922
+
1923
+ stdout | src/__tests__/services/tool-protection.service.test.ts > ToolProtectionService > checkToolProtection > should return null when tool has no protection
1924
+ [ToolProtectionService] Config loaded from API {
1925
+ source: 'api',
1926
+ toolCount: 1,
1927
+ protectedTools: [],
1928
+ agentDid: 'did:key:z6MkhaXgBZDv...',
1929
+ projectId: 'none',
1930
+ cacheTtlMs: 300000,
1931
+ cacheExpiresAt: '2025-11-24T21:32:10.112Z'
1932
+ }
1933
+
1934
+ stdout | src/__tests__/services/tool-protection.service.test.ts > ToolProtectionService > checkToolProtection > should return null when tool is not in config
1935
+ [ToolProtectionService] Config loaded from API {
1936
+ source: 'api',
1937
+ toolCount: 1,
1938
+ protectedTools: [ 'other_tool' ],
1939
+ agentDid: 'did:key:z6MkhaXgBZDv...',
1940
+ projectId: 'none',
1941
+ cacheTtlMs: 300000,
1942
+ cacheExpiresAt: '2025-11-24T21:32:10.112Z'
1943
+ }
1944
+
1945
+ stdout | src/__tests__/services/tool-protection.service.test.ts > ToolProtectionService > checkToolProtection > should return null when tool is not in config
1946
+ [ToolProtectionService] Protection check {
1947
+ tool: 'unknown_tool',
1948
+ agentDid: 'did:key:z6MkhaXgBZDv...',
1949
+ found: false,
1950
+ isWildcard: true,
1951
+ requiresDelegation: false,
1952
+ availableTools: [ 'other_tool' ]
1953
+ }
1954
+
1955
+ stdout | src/__tests__/services/tool-protection.service.test.ts > ToolProtectionService > checkToolProtection > should return wildcard protection when tool not found and wildcard exists
1956
+ stderr | src/__tests__/services/tool-protection.service.test.ts > ToolProtectionService > checkToolProtection > should use wildcard protection in fail-safe deny-all mode
1957
+ [ToolProtectionService] Config loaded from API {
1958
+ source: 'api',
1959
+ toolCount: 2,
1960
+ protectedTools: [ '*' ],
1961
+ agentDid: 'did:key:z6MkhaXgBZDv...',
1962
+ projectId: 'none',
1963
+ cacheTtlMs: 300000,
1964
+ cacheExpiresAt: '2025-11-24T21:32:10.113Z'
1965
+ }
1966
+
1967
+ stdout | src/__tests__/services/tool-protection.service.test.ts > ToolProtectionService > checkToolProtection > should return wildcard protection when tool not found and wildcard exists
1968
+ [ToolProtectionService] Protection check {
1969
+ tool: 'unknown_tool',
1970
+ agentDid: 'did:key:z6MkhaXgBZDv...',
1971
+ found: true,
1972
+ isWildcard: true,
1973
+ requiresDelegation: true,
1974
+ availableTools: [ '*', 'specific_tool' ]
1975
+ [ToolProtectionService] API fetch failed, no fallback, failing closed (deny-all) {
1976
+ }
1977
+
1978
+ stdout | src/__tests__/services/tool-protection.service.test.ts > ToolProtectionService > checkToolProtection > should prioritize specific tool protection over wildcard
1979
+ [ToolProtectionService] Config loaded from API {
1980
+ source: 'api',
1981
+ toolCount: 2,
1982
+ protectedTools: [ '*' ],
1983
+ agentDid: 'did:key:z6MkhaXgBZDv...',
1984
+ agentDid: 'did:key:z6MkhaXgBZDv...',
1985
+ error: 'Network error',
1986
+ cacheKey: 'agent:did:key:z6MkhaXgBZDvotDkL5257faiztiGiC2QtKLGpbnnEGta2doK'
1987
+ }
1988
+ projectId: 'none',
1989
+ cacheTtlMs: 300000,
1990
+ cacheExpiresAt: '2025-11-24T21:32:10.114Z'
1991
+ }
1992
+
1993
+ stdout | src/__tests__/services/tool-protection.service.test.ts > ToolProtectionService > checkToolProtection > should use wildcard protection in fail-safe deny-all mode
1994
+
1995
+ [ToolProtectionService] Protection check {
1996
+ tool: 'any_tool',
1997
+ agentDid: 'did:key:z6MkhaXgBZDv...',
1998
+ found: true,
1999
+ isWildcard: true,
2000
+ requiresDelegation: true,
2001
+ availableTools: [ '*' ]
2002
+ }
2003
+
2004
+ stdout | src/__tests__/services/tool-protection.service.test.ts > ToolProtectionService > checkToolProtection > should return protection config when tool requires delegation
2005
+ [ToolProtectionService] Config loaded from API {
2006
+ source: 'api',
2007
+ toolCount: 1,
2008
+ protectedTools: [ 'protected_tool' ],
2009
+ agentDid: 'did:key:z6MkhaXgBZDv...',
2010
+ projectId: 'none',
2011
+ cacheTtlMs: 300000,
2012
+ cacheExpiresAt: '2025-11-24T21:32:10.114Z'
2013
+ }
2014
+
2015
+ stdout | src/__tests__/services/tool-protection.service.test.ts > ToolProtectionService > checkToolProtection > should return protection config when tool requires delegation
2016
+ [ToolProtectionService] Protection check {
2017
+ tool: 'protected_tool',
2018
+ agentDid: 'did:key:z6MkhaXgBZDv...',
2019
+ found: true,
2020
+ isWildcard: false,
2021
+ requiresDelegation: true,
2022
+ availableTools: [ 'protected_tool' ]
2023
+ }
2024
+
2025
+ stdout | src/__tests__/services/tool-protection.service.test.ts > ToolProtectionService > integration with NoOpToolProtectionCache > should work with NoOpToolProtectionCache
2026
+ [ToolProtectionService] Config loaded from API {
2027
+ source: 'api',
2028
+ toolCount: 1,
2029
+ protectedTools: [ 'tool1' ],
2030
+ agentDid: 'did:key:z6MkhaXgBZDv...',
2031
+ projectId: 'none',
2032
+ cacheTtlMs: 300000,
2033
+ cacheExpiresAt: '2025-11-24T21:32:10.115Z'
2034
+ }
2035
+
2036
+ stdout | src/__tests__/services/tool-protection.service.test.ts > ToolProtectionService > integration with NoOpToolProtectionCache > should work with NoOpToolProtectionCache
2037
+ [ToolProtectionService] Config loaded from API {
2038
+ source: 'api',
2039
+ toolCount: 1,
2040
+ protectedTools: [ 'tool1' ],
2041
+ agentDid: 'did:key:z6MkhaXgBZDv...',
2042
+ projectId: 'none',
2043
+ cacheTtlMs: 300000,
2044
+ cacheExpiresAt: '2025-11-24T21:32:10.115Z'
2045
+ }
2046
+
2047
+ stderr | src/services/__tests__/crypto.service.test.ts > CryptoService > verifyEd25519 > should return false on verification error
2048
+ [CryptoService] Ed25519 verification error: Error: Verification failed
2049
+ at /Users/dylanhobbs/Documents/@kya-os/xmcp-i/packages/mcp-i-core/src/services/__tests__/crypto.service.test.ts:62:9
2050
+ at file:///Users/dylanhobbs/Documents/@kya-os/xmcp-i/node_modules/.pnpm/@vitest+runner@4.0.5/node_modules/@vitest/runner/dist/index.js:157:11
2051
+ at file:///Users/dylanhobbs/Documents/@kya-os/xmcp-i/node_modules/.pnpm/@vitest+runner@4.0.5/node_modules/@vitest/runner/dist/index.js:753:26
2052
+ at file:///Users/dylanhobbs/Documents/@kya-os/xmcp-i/node_modules/.pnpm/@vitest+runner@4.0.5/node_modules/@vitest/runner/dist/index.js:1636:20
2053
+ at new Promise (<anonymous>)
2054
+ at runWithTimeout (file:///Users/dylanhobbs/Documents/@kya-os/xmcp-i/node_modules/.pnpm/@vitest+runner@4.0.5/node_modules/@vitest/runner/dist/index.js:1602:10)
2055
+ at runTest (file:///Users/dylanhobbs/Documents/@kya-os/xmcp-i/node_modules/.pnpm/@vitest+runner@4.0.5/node_modules/@vitest/runner/dist/index.js:1309:12)
2056
+ at processTicksAndRejections (node:internal/process/task_queues:103:5)
2057
+ at runSuite (file:///Users/dylanhobbs/Documents/@kya-os/xmcp-i/node_modules/.pnpm/@vitest+runner@4.0.5/node_modules/@vitest/runner/dist/index.js:1468:8)
2058
+ at runSuite (file:///Users/dylanhobbs/Documents/@kya-os/xmcp-i/node_modules/.pnpm/@vitest+runner@4.0.5/node_modules/@vitest/runner/dist/index.js:1468:8)
2059
+
2060
+ stderr | src/services/__tests__/crypto.service.test.ts > CryptoService > verifyJWS > should reject invalid JWK format
2061
+ [CryptoService] Invalid Ed25519 JWK format
2062
+
2063
+ stderr | src/services/__tests__/crypto.service.test.ts > CryptoService > verifyJWS > should reject JWK with wrong kty
2064
+ [CryptoService] Invalid Ed25519 JWK format
2065
+
2066
+ stderr | src/services/__tests__/crypto.service.test.ts > CryptoService > verifyJWS > should reject JWK with wrong crv
2067
+ [CryptoService] Invalid Ed25519 JWK format
2068
+
2069
+ stderr | src/services/__tests__/crypto.service.test.ts > CryptoService > verifyJWS > should reject JWK with missing x field
2070
+ [CryptoService] Invalid Ed25519 JWK format
2071
+
2072
+ stderr | src/services/__tests__/crypto.service.test.ts > CryptoService > verifyJWS > should reject JWK with empty x field
2073
+ [CryptoService] Invalid Ed25519 JWK format
2074
+
2075
+ stderr | src/services/__tests__/crypto.service.test.ts > CryptoService > verifyJWS > should reject malformed JWS
2076
+ [CryptoService] Invalid JWS format: Error: Invalid header base64: Unexpected token 'ž', "ž‹" is not valid JSON
2077
+ at CryptoService.parseJWS (/Users/dylanhobbs/Documents/@kya-os/xmcp-i/packages/mcp-i-core/src/services/crypto.service.ts:91:13)
2078
+ at CryptoService.verifyJWS (/Users/dylanhobbs/Documents/@kya-os/xmcp-i/packages/mcp-i-core/src/services/crypto.service.ts:169:23)
2079
+ at /Users/dylanhobbs/Documents/@kya-os/xmcp-i/packages/mcp-i-core/src/services/__tests__/crypto.service.test.ts:230:42
2080
+ at file:///Users/dylanhobbs/Documents/@kya-os/xmcp-i/node_modules/.pnpm/@vitest+runner@4.0.5/node_modules/@vitest/runner/dist/index.js:157:11
2081
+ at file:///Users/dylanhobbs/Documents/@kya-os/xmcp-i/node_modules/.pnpm/@vitest+runner@4.0.5/node_modules/@vitest/runner/dist/index.js:753:26
2082
+ at file:///Users/dylanhobbs/Documents/@kya-os/xmcp-i/node_modules/.pnpm/@vitest+runner@4.0.5/node_modules/@vitest/runner/dist/index.js:1636:20
2083
+ at new Promise (<anonymous>)
2084
+ at runWithTimeout (file:///Users/dylanhobbs/Documents/@kya-os/xmcp-i/node_modules/.pnpm/@vitest+runner@4.0.5/node_modules/@vitest/runner/dist/index.js:1602:10)
2085
+ at runTest (file:///Users/dylanhobbs/Documents/@kya-os/xmcp-i/node_modules/.pnpm/@vitest+runner@4.0.5/node_modules/@vitest/runner/dist/index.js:1309:12)
2086
+ at processTicksAndRejections (node:internal/process/task_queues:103:5)
2087
+
2088
+ stderr | src/services/__tests__/crypto.service.test.ts > CryptoService > verifyJWS > should reject non-EdDSA algorithms
2089
+ [CryptoService] Unsupported algorithm: RS256, expected EdDSA
2090
+
2091
+ stderr | src/services/__tests__/crypto.service.test.ts > CryptoService > verifyJWS > should reject HS256 algorithm
2092
+ [CryptoService] Unsupported algorithm: HS256, expected EdDSA
2093
+
2094
+ stderr | src/services/__tests__/crypto.service.test.ts > CryptoService > verifyJWS > should handle empty JWS components
2095
+ [CryptoService] Invalid JWS format: Error: Invalid header base64: Unexpected end of JSON input
2096
+ at CryptoService.parseJWS (/Users/dylanhobbs/Documents/@kya-os/xmcp-i/packages/mcp-i-core/src/services/crypto.service.ts:91:13)
2097
+ at CryptoService.verifyJWS (/Users/dylanhobbs/Documents/@kya-os/xmcp-i/packages/mcp-i-core/src/services/crypto.service.ts:169:23)
2098
+ at /Users/dylanhobbs/Documents/@kya-os/xmcp-i/packages/mcp-i-core/src/services/__tests__/crypto.service.test.ts:271:42
2099
+ at file:///Users/dylanhobbs/Documents/@kya-os/xmcp-i/node_modules/.pnpm/@vitest+runner@4.0.5/node_modules/@vitest/runner/dist/index.js:157:11
2100
+ at file:///Users/dylanhobbs/Documents/@kya-os/xmcp-i/node_modules/.pnpm/@vitest+runner@4.0.5/node_modules/@vitest/runner/dist/index.js:753:26
2101
+ at file:///Users/dylanhobbs/Documents/@kya-os/xmcp-i/node_modules/.pnpm/@vitest+runner@4.0.5/node_modules/@vitest/runner/dist/index.js:1636:20
2102
+ at new Promise (<anonymous>)
2103
+ at runWithTimeout (file:///Users/dylanhobbs/Documents/@kya-os/xmcp-i/node_modules/.pnpm/@vitest+runner@4.0.5/node_modules/@vitest/runner/dist/index.js:1602:10)
2104
+ at runTest (file:///Users/dylanhobbs/Documents/@kya-os/xmcp-i/node_modules/.pnpm/@vitest+runner@4.0.5/node_modules/@vitest/runner/dist/index.js:1309:12)
2105
+ at processTicksAndRejections (node:internal/process/task_queues:103:5)
2106
+
2107
+ stderr | src/services/__tests__/crypto.service.test.ts > CryptoService > verifyJWS > should handle malformed JWS - single part
2108
+ [CryptoService] Invalid JWS format: Error: Invalid JWS format: expected header.payload.signature
2109
+ at CryptoService.parseJWS (/Users/dylanhobbs/Documents/@kya-os/xmcp-i/packages/mcp-i-core/src/services/crypto.service.ts:78:13)
2110
+ at CryptoService.verifyJWS (/Users/dylanhobbs/Documents/@kya-os/xmcp-i/packages/mcp-i-core/src/services/crypto.service.ts:169:23)
2111
+ at /Users/dylanhobbs/Documents/@kya-os/xmcp-i/packages/mcp-i-core/src/services/__tests__/crypto.service.test.ts:279:42
2112
+ at file:///Users/dylanhobbs/Documents/@kya-os/xmcp-i/node_modules/.pnpm/@vitest+runner@4.0.5/node_modules/@vitest/runner/dist/index.js:157:11
2113
+ at file:///Users/dylanhobbs/Documents/@kya-os/xmcp-i/node_modules/.pnpm/@vitest+runner@4.0.5/node_modules/@vitest/runner/dist/index.js:753:26
2114
+ at file:///Users/dylanhobbs/Documents/@kya-os/xmcp-i/node_modules/.pnpm/@vitest+runner@4.0.5/node_modules/@vitest/runner/dist/index.js:1636:20
2115
+ at new Promise (<anonymous>)
2116
+ at runWithTimeout (file:///Users/dylanhobbs/Documents/@kya-os/xmcp-i/node_modules/.pnpm/@vitest+runner@4.0.5/node_modules/@vitest/runner/dist/index.js:1602:10)
2117
+ at runTest (file:///Users/dylanhobbs/Documents/@kya-os/xmcp-i/node_modules/.pnpm/@vitest+runner@4.0.5/node_modules/@vitest/runner/dist/index.js:1309:12)
2118
+ at processTicksAndRejections (node:internal/process/task_queues:103:5)
2119
+
2120
+ stderr | src/services/__tests__/crypto.service.test.ts > CryptoService > verifyJWS > should handle malformed JWS - two parts
2121
+ [CryptoService] Invalid JWS format: Error: Invalid JWS format: expected header.payload.signature
2122
+ at CryptoService.parseJWS (/Users/dylanhobbs/Documents/@kya-os/xmcp-i/packages/mcp-i-core/src/services/crypto.service.ts:78:13)
2123
+ at CryptoService.verifyJWS (/Users/dylanhobbs/Documents/@kya-os/xmcp-i/packages/mcp-i-core/src/services/crypto.service.ts:169:23)
2124
+ at /Users/dylanhobbs/Documents/@kya-os/xmcp-i/packages/mcp-i-core/src/services/__tests__/crypto.service.test.ts:287:42
2125
+ at file:///Users/dylanhobbs/Documents/@kya-os/xmcp-i/node_modules/.pnpm/@vitest+runner@4.0.5/node_modules/@vitest/runner/dist/index.js:157:11
2126
+ at file:///Users/dylanhobbs/Documents/@kya-os/xmcp-i/node_modules/.pnpm/@vitest+runner@4.0.5/node_modules/@vitest/runner/dist/index.js:753:26
2127
+ at file:///Users/dylanhobbs/Documents/@kya-os/xmcp-i/node_modules/.pnpm/@vitest+runner@4.0.5/node_modules/@vitest/runner/dist/index.js:1636:20
2128
+ at new Promise (<anonymous>)
2129
+ at runWithTimeout (file:///Users/dylanhobbs/Documents/@kya-os/xmcp-i/node_modules/.pnpm/@vitest+runner@4.0.5/node_modules/@vitest/runner/dist/index.js:1602:10)
2130
+ at runTest (file:///Users/dylanhobbs/Documents/@kya-os/xmcp-i/node_modules/.pnpm/@vitest+runner@4.0.5/node_modules/@vitest/runner/dist/index.js:1309:12)
2131
+ at processTicksAndRejections (node:internal/process/task_queues:103:5)
2132
+
2133
+ stderr | src/services/__tests__/crypto.service.test.ts > CryptoService > verifyJWS > should handle malformed JWS - four parts
2134
+ [CryptoService] Invalid JWS format: Error: Invalid JWS format: expected header.payload.signature
2135
+ at CryptoService.parseJWS (/Users/dylanhobbs/Documents/@kya-os/xmcp-i/packages/mcp-i-core/src/services/crypto.service.ts:78:13)
2136
+ at CryptoService.verifyJWS (/Users/dylanhobbs/Documents/@kya-os/xmcp-i/packages/mcp-i-core/src/services/crypto.service.ts:169:23)
2137
+ at /Users/dylanhobbs/Documents/@kya-os/xmcp-i/packages/mcp-i-core/src/services/__tests__/crypto.service.test.ts:302:42
2138
+ at file:///Users/dylanhobbs/Documents/@kya-os/xmcp-i/node_modules/.pnpm/@vitest+runner@4.0.5/node_modules/@vitest/runner/dist/index.js:157:11
2139
+ at file:///Users/dylanhobbs/Documents/@kya-os/xmcp-i/node_modules/.pnpm/@vitest+runner@4.0.5/node_modules/@vitest/runner/dist/index.js:753:26
2140
+ at file:///Users/dylanhobbs/Documents/@kya-os/xmcp-i/node_modules/.pnpm/@vitest+runner@4.0.5/node_modules/@vitest/runner/dist/index.js:1636:20
2141
+ at new Promise (<anonymous>)
2142
+ at runWithTimeout (file:///Users/dylanhobbs/Documents/@kya-os/xmcp-i/node_modules/.pnpm/@vitest+runner@4.0.5/node_modules/@vitest/runner/dist/index.js:1602:10)
2143
+ at runTest (file:///Users/dylanhobbs/Documents/@kya-os/xmcp-i/node_modules/.pnpm/@vitest+runner@4.0.5/node_modules/@vitest/runner/dist/index.js:1309:12)
2144
+ at processTicksAndRejections (node:internal/process/task_queues:103:5)
2145
+
2146
+ stderr | src/services/__tests__/crypto.service.test.ts > CryptoService > verifyJWS > should handle malformed JWS - invalid JSON header
2147
+ [CryptoService] Invalid JWS format: Error: Invalid header base64: Unexpected token 'o', "notjson" is not valid JSON
2148
+ at CryptoService.parseJWS (/Users/dylanhobbs/Documents/@kya-os/xmcp-i/packages/mcp-i-core/src/services/crypto.service.ts:91:13)
2149
+ at CryptoService.verifyJWS (/Users/dylanhobbs/Documents/@kya-os/xmcp-i/packages/mcp-i-core/src/services/crypto.service.ts:169:23)
2150
+ at /Users/dylanhobbs/Documents/@kya-os/xmcp-i/packages/mcp-i-core/src/services/__tests__/crypto.service.test.ts:316:42
2151
+ at file:///Users/dylanhobbs/Documents/@kya-os/xmcp-i/node_modules/.pnpm/@vitest+runner@4.0.5/node_modules/@vitest/runner/dist/index.js:157:11
2152
+ at file:///Users/dylanhobbs/Documents/@kya-os/xmcp-i/node_modules/.pnpm/@vitest+runner@4.0.5/node_modules/@vitest/runner/dist/index.js:753:26
2153
+ at file:///Users/dylanhobbs/Documents/@kya-os/xmcp-i/node_modules/.pnpm/@vitest+runner@4.0.5/node_modules/@vitest/runner/dist/index.js:1636:20
2154
+ at new Promise (<anonymous>)
2155
+ at runWithTimeout (file:///Users/dylanhobbs/Documents/@kya-os/xmcp-i/node_modules/.pnpm/@vitest+runner@4.0.5/node_modules/@vitest/runner/dist/index.js:1602:10)
2156
+ at runTest (file:///Users/dylanhobbs/Documents/@kya-os/xmcp-i/node_modules/.pnpm/@vitest+runner@4.0.5/node_modules/@vitest/runner/dist/index.js:1309:12)
2157
+ at processTicksAndRejections (node:internal/process/task_queues:103:5)
2158
+
2159
+ stderr | src/services/__tests__/crypto.service.test.ts > CryptoService > verifyJWS > should handle malformed JWS - invalid base64
2160
+ [CryptoService] Invalid JWS format: Error: Invalid payload base64: Invalid base64url string: Invalid character
2161
+ at CryptoService.parseJWS (/Users/dylanhobbs/Documents/@kya-os/xmcp-i/packages/mcp-i-core/src/services/crypto.service.ts:107:15)
2162
+ at CryptoService.verifyJWS (/Users/dylanhobbs/Documents/@kya-os/xmcp-i/packages/mcp-i-core/src/services/crypto.service.ts:169:23)
2163
+ at /Users/dylanhobbs/Documents/@kya-os/xmcp-i/packages/mcp-i-core/src/services/__tests__/crypto.service.test.ts:334:42
2164
+ at file:///Users/dylanhobbs/Documents/@kya-os/xmcp-i/node_modules/.pnpm/@vitest+runner@4.0.5/node_modules/@vitest/runner/dist/index.js:157:11
2165
+ at file:///Users/dylanhobbs/Documents/@kya-os/xmcp-i/node_modules/.pnpm/@vitest+runner@4.0.5/node_modules/@vitest/runner/dist/index.js:753:26
2166
+ at file:///Users/dylanhobbs/Documents/@kya-os/xmcp-i/node_modules/.pnpm/@vitest+runner@4.0.5/node_modules/@vitest/runner/dist/index.js:1636:20
2167
+ at new Promise (<anonymous>)
2168
+ at runWithTimeout (file:///Users/dylanhobbs/Documents/@kya-os/xmcp-i/node_modules/.pnpm/@vitest+runner@4.0.5/node_modules/@vitest/runner/dist/index.js:1602:10)
2169
+ at runTest (file:///Users/dylanhobbs/Documents/@kya-os/xmcp-i/node_modules/.pnpm/@vitest+runner@4.0.5/node_modules/@vitest/runner/dist/index.js:1309:12)
2170
+ at processTicksAndRejections (node:internal/process/task_queues:103:5)
2171
+
2172
+ stderr | src/services/__tests__/crypto.service.test.ts > CryptoService > verifyJWS > should validate expectedKid option
2173
+ [CryptoService] Key ID mismatch
2174
+
2175
+ stderr | src/services/__tests__/crypto.service.test.ts > CryptoService > verifyJWS > should validate alg option
2176
+ [CryptoService] Unsupported algorithm: EdDSA, expected RS256
2177
+
2178
+ stderr | src/services/__tests__/crypto.service.test.ts > CryptoService > verifyJWS > should validate Ed25519 key length
2179
+ [CryptoService] Failed to extract public key: Error: Invalid Ed25519 public key length: 5
2180
+ at CryptoService.jwkToBase64PublicKey (/Users/dylanhobbs/Documents/@kya-os/xmcp-i/packages/mcp-i-core/src/services/crypto.service.ts:295:13)
2181
+ at CryptoService.verifyJWS (/Users/dylanhobbs/Documents/@kya-os/xmcp-i/packages/mcp-i-core/src/services/crypto.service.ts:249:32)
2182
+ at /Users/dylanhobbs/Documents/@kya-os/xmcp-i/packages/mcp-i-core/src/services/__tests__/crypto.service.test.ts:398:42
2183
+ at file:///Users/dylanhobbs/Documents/@kya-os/xmcp-i/node_modules/.pnpm/@vitest+runner@4.0.5/node_modules/@vitest/runner/dist/index.js:157:11
2184
+ at file:///Users/dylanhobbs/Documents/@kya-os/xmcp-i/node_modules/.pnpm/@vitest+runner@4.0.5/node_modules/@vitest/runner/dist/index.js:753:26
2185
+ at file:///Users/dylanhobbs/Documents/@kya-os/xmcp-i/node_modules/.pnpm/@vitest+runner@4.0.5/node_modules/@vitest/runner/dist/index.js:1636:20
2186
+ at new Promise (<anonymous>)
2187
+ at runWithTimeout (file:///Users/dylanhobbs/Documents/@kya-os/xmcp-i/node_modules/.pnpm/@vitest+runner@4.0.5/node_modules/@vitest/runner/dist/index.js:1602:10)
2188
+ at runTest (file:///Users/dylanhobbs/Documents/@kya-os/xmcp-i/node_modules/.pnpm/@vitest+runner@4.0.5/node_modules/@vitest/runner/dist/index.js:1309:12)
2189
+ at processTicksAndRejections (node:internal/process/task_queues:103:5)
2190
+
2191
+ stderr | src/services/__tests__/crypto.service.test.ts > CryptoService > verifyJWS > should handle signature verification error
2192
+ [CryptoService] Ed25519 verification error: Error: Crypto error
2193
+ at /Users/dylanhobbs/Documents/@kya-os/xmcp-i/packages/mcp-i-core/src/services/__tests__/crypto.service.test.ts:449:61
2194
+ at file:///Users/dylanhobbs/Documents/@kya-os/xmcp-i/node_modules/.pnpm/@vitest+runner@4.0.5/node_modules/@vitest/runner/dist/index.js:157:11
2195
+ at file:///Users/dylanhobbs/Documents/@kya-os/xmcp-i/node_modules/.pnpm/@vitest+runner@4.0.5/node_modules/@vitest/runner/dist/index.js:753:26
2196
+ at file:///Users/dylanhobbs/Documents/@kya-os/xmcp-i/node_modules/.pnpm/@vitest+runner@4.0.5/node_modules/@vitest/runner/dist/index.js:1636:20
2197
+ at new Promise (<anonymous>)
2198
+ at runWithTimeout (file:///Users/dylanhobbs/Documents/@kya-os/xmcp-i/node_modules/.pnpm/@vitest+runner@4.0.5/node_modules/@vitest/runner/dist/index.js:1602:10)
2199
+ at runTest (file:///Users/dylanhobbs/Documents/@kya-os/xmcp-i/node_modules/.pnpm/@vitest+runner@4.0.5/node_modules/@vitest/runner/dist/index.js:1309:12)
2200
+ at processTicksAndRejections (node:internal/process/task_queues:103:5)
2201
+ at runSuite (file:///Users/dylanhobbs/Documents/@kya-os/xmcp-i/node_modules/.pnpm/@vitest+runner@4.0.5/node_modules/@vitest/runner/dist/index.js:1468:8)
2202
+ at runSuite (file:///Users/dylanhobbs/Documents/@kya-os/xmcp-i/node_modules/.pnpm/@vitest+runner@4.0.5/node_modules/@vitest/runner/dist/index.js:1468:8)
2203
+
2204
+ ✓ src/services/__tests__/crypto.service.test.ts (34 tests) 25ms
2205
+ ✓ src/__tests__/services/tool-protection.service.test.ts (49 tests) 20ms
2206
+ stderr | src/services/__tests__/storage.service.test.ts > StorageService > createStorageProviders > should prefer Redis over KV when both are configured
2207
+ [StorageService] Failed to connect to Redis, falling back to memory: Redis package not available
2208
+
2209
+ stderr | src/services/__tests__/storage.service.test.ts > StorageService > createStorageProviders > should prefer Redis over KV when both are configured
2210
+ [StorageService] Failed to initialize KV, falling back to memory: Failed to import Cloudflare storage providers: Cannot find package '@kya-os/mcp-i-cloudflare/providers/storage' imported from '/Users/dylanhobbs/Documents/@kya-os/xmcp-i/packages/mcp-i-core/src/services/storage.service.ts'
2211
+
2212
+ stderr | src/services/__tests__/storage.service.test.ts > StorageService > createStorageProviders > should fall back to memory when Redis connection fails
2213
+ [StorageService] Failed to connect to Redis, falling back to memory: Redis package not available
2214
+
2215
+ stderr | src/services/__tests__/storage.service.test.ts > StorageService > createStorageProviders > should use KV namespace when provided
2216
+ [StorageService] Failed to initialize KV, falling back to memory: Failed to import Cloudflare storage providers: Cannot find package '@kya-os/mcp-i-cloudflare/providers/storage' imported from '/Users/dylanhobbs/Documents/@kya-os/xmcp-i/packages/mcp-i-core/src/services/storage.service.ts'
2217
+
2218
+ stderr | src/services/__tests__/proof-verifier.test.ts > ProofVerifier Security > Signature Verification > should handle signature verification errors gracefully
2219
+ stdout | src/__tests__/services/tool-protection-oauth-provider.test.ts > ToolProtectionService - oauthProvider Parsing > New endpoint format (toolProtections object) > should parse oauthProvider from camelCase field
2220
+ [CryptoService] Ed25519 verification error: Error: Crypto error
2221
+ [ToolProtectionService] Config loaded from API {
2222
+ source: 'api',
2223
+ toolCount: 2,
2224
+ at /Users/dylanhobbs/Documents/@kya-os/xmcp-i/packages/mcp-i-core/src/services/__tests__/proof-verifier.test.ts:328:9
2225
+ at file:///Users/dylanhobbs/Documents/@kya-os/xmcp-i/node_modules/.pnpm/@vitest+runner@4.0.5/node_modules/@vitest/runner/dist/index.js:157:11
2226
+ at file:///Users/dylanhobbs/Documents/@kya-os/xmcp-i/node_modules/.pnpm/@vitest+runner@4.0.5/node_modules/@vitest/runner/dist/index.js:753:26
2227
+ protectedTools: [ 'read_repos', 'send_email' ],
2228
+ agentDid: 'did:key:z6MkhaXgBZDv...',
2229
+ projectId: 'test-project-123',
2230
+ at file:///Users/dylanhobbs/Documents/@kya-os/xmcp-i/node_modules/.pnpm/@vitest+runner@4.0.5/node_modules/@vitest/runner/dist/index.js:1636:20
2231
+ at new Promise (<anonymous>)
2232
+ at runWithTimeout (file:///Users/dylanhobbs/Documents/@kya-os/xmcp-i/node_modules/.pnpm/@vitest+runner@4.0.5/node_modules/@vitest/runner/dist/index.js:1602:10)
2233
+ at runTest (file:///Users/dylanhobbs/Documents/@kya-os/xmcp-i/node_modules/.pnpm/@vitest+runner@4.0.5/node_modules/@vitest/runner/dist/index.js:1309:12)
2234
+ cacheTtlMs: 300000,
2235
+ cacheExpiresAt: '2025-11-24T21:32:10.294Z'
2236
+ }
2237
+
2238
+ at processTicksAndRejections (node:internal/process/task_queues:103:5)
2239
+ at runSuite (file:///Users/dylanhobbs/Documents/@kya-os/xmcp-i/node_modules/.pnpm/@vitest+runner@4.0.5/node_modules/@vitest/runner/dist/index.js:1468:8)
2240
+ at runSuite (file:///Users/dylanhobbs/Documents/@kya-os/xmcp-i/node_modules/.pnpm/@vitest+runner@4.0.5/node_modules/@vitest/runner/dist/index.js:1468:8)
2241
+
2242
+ stdout | src/__tests__/services/tool-protection-oauth-provider.test.ts > ToolProtectionService - oauthProvider Parsing > New endpoint format (toolProtections object) > should parse oauthProvider from snake_case field
2243
+ [ToolProtectionService] Config loaded from API {
2244
+ source: 'api',
2245
+ toolCount: 1,
2246
+ protectedTools: [ 'read_repos' ],
2247
+ agentDid: 'did:key:z6MkhaXgBZDv...',
2248
+ projectId: 'test-project-123',
2249
+ cacheTtlMs: 300000,
2250
+ cacheExpiresAt: '2025-11-24T21:32:10.297Z'
2251
+ }
2252
+
2253
+ stdout | src/__tests__/services/tool-protection-oauth-provider.test.ts > ToolProtectionService - oauthProvider Parsing > New endpoint format (toolProtections object) > should prefer camelCase over snake_case when both present
2254
+ [ToolProtectionService] Config loaded from API {
2255
+ source: 'api',
2256
+ toolCount: 1,
2257
+ protectedTools: [ 'read_repos' ],
2258
+ agentDid: 'did:key:z6MkhaXgBZDv...',
2259
+ projectId: 'test-project-123',
2260
+ cacheTtlMs: 300000,
2261
+ cacheExpiresAt: '2025-11-24T21:32:10.297Z'
2262
+ }
2263
+
2264
+ stdout | src/__tests__/services/tool-protection-oauth-provider.test.ts > ToolProtectionService - oauthProvider Parsing > New endpoint format (toolProtections object) > should handle missing oauthProvider field (backward compatible)
2265
+ [ToolProtectionService] Config loaded from API {
2266
+ source: 'api',
2267
+ toolCount: 1,
2268
+ protectedTools: [ 'read_repos' ],
2269
+ agentDid: 'did:key:z6MkhaXgBZDv...',
2270
+ projectId: 'test-project-123',
2271
+ cacheTtlMs: 300000,
2272
+ cacheExpiresAt: '2025-11-24T21:32:10.298Z'
2273
+ }
2274
+
2275
+ ✓ src/services/__tests__/proof-verifier.test.ts (21 tests) 11ms
2276
+ stdout | src/__tests__/services/tool-protection-oauth-provider.test.ts > ToolProtectionService - oauthProvider Parsing > Old endpoint format (tools array) > should parse oauthProvider from array format with camelCase
2277
+ [ToolProtectionService] Config loaded from API {
2278
+ source: 'api',
2279
+ toolCount: 2,
2280
+ protectedTools: [ 'read_repos', 'send_email' ],
2281
+ agentDid: 'did:key:z6MkhaXgBZDv...',
2282
+ projectId: 'none',
2283
+ cacheTtlMs: 300000,
2284
+ cacheExpiresAt: '2025-11-24T21:32:10.304Z'
2285
+ }
2286
+
2287
+ stdout | src/__tests__/services/tool-protection-oauth-provider.test.ts > ToolProtectionService - oauthProvider Parsing > Old endpoint format (tools array) > should parse oauthProvider from array format with snake_case
2288
+ [ToolProtectionService] Config loaded from API {
2289
+ source: 'api',
2290
+ toolCount: 1,
2291
+ protectedTools: [ 'read_repos' ],
2292
+ agentDid: 'did:key:z6MkhaXgBZDv...',
2293
+ projectId: 'none',
2294
+ cacheTtlMs: 300000,
2295
+ cacheExpiresAt: '2025-11-24T21:32:10.304Z'
2296
+ }
2297
+
2298
+ stdout | src/__tests__/services/tool-protection-oauth-provider.test.ts > ToolProtectionService - oauthProvider Parsing > Old endpoint format (tools array) > should prefer camelCase over snake_case in array format
2299
+ [ToolProtectionService] Config loaded from API {
2300
+ source: 'api',
2301
+ toolCount: 1,
2302
+ protectedTools: [ 'read_repos' ],
2303
+ agentDid: 'did:key:z6MkhaXgBZDv...',
2304
+ projectId: 'none',
2305
+ cacheTtlMs: 300000,
2306
+ cacheExpiresAt: '2025-11-24T21:32:10.304Z'
2307
+ }
2308
+
2309
+ stdout | src/__tests__/services/tool-protection-oauth-provider.test.ts > ToolProtectionService - oauthProvider Parsing > Old endpoint format (tools object) > should parse oauthProvider from object format with camelCase
2310
+ [ToolProtectionService] Config loaded from API {
2311
+ source: 'api',
2312
+ toolCount: 2,
2313
+ protectedTools: [ 'read_repos', 'send_email' ],
2314
+ agentDid: 'did:key:z6MkhaXgBZDv...',
2315
+ projectId: 'none',
2316
+ cacheTtlMs: 300000,
2317
+ cacheExpiresAt: '2025-11-24T21:32:10.304Z'
2318
+ }
2319
+
2320
+ stdout | src/__tests__/services/tool-protection-oauth-provider.test.ts > ToolProtectionService - oauthProvider Parsing > Old endpoint format (tools object) > should parse oauthProvider from object format with snake_case
2321
+ [ToolProtectionService] Config loaded from API {
2322
+ source: 'api',
2323
+ toolCount: 1,
2324
+ protectedTools: [ 'read_repos' ],
2325
+ agentDid: 'did:key:z6MkhaXgBZDv...',
2326
+ projectId: 'none',
2327
+ cacheTtlMs: 300000,
2328
+ cacheExpiresAt: '2025-11-24T21:32:10.305Z'
2329
+ }
2330
+
2331
+ stdout | src/__tests__/services/tool-protection-oauth-provider.test.ts > ToolProtectionService - oauthProvider Parsing > Old endpoint format (tools object) > should prefer camelCase over snake_case in object format
2332
+ [ToolProtectionService] Config loaded from API {
2333
+ source: 'api',
2334
+ toolCount: 1,
2335
+ protectedTools: [ 'read_repos' ],
2336
+ agentDid: 'did:key:z6MkhaXgBZDv...',
2337
+ projectId: 'none',
2338
+ cacheTtlMs: 300000,
2339
+ cacheExpiresAt: '2025-11-24T21:32:10.305Z'
2340
+ }
2341
+
2342
+ stdout | src/__tests__/services/tool-protection-oauth-provider.test.ts > ToolProtectionService - oauthProvider Parsing > Caching > should cache oauthProvider field correctly
2343
+ [ToolProtectionService] Config loaded from API {
2344
+ source: 'api',
2345
+ toolCount: 1,
2346
+ protectedTools: [ 'read_repos' ],
2347
+ agentDid: 'did:key:z6MkhaXgBZDv...',
2348
+ projectId: 'test-project-123',
2349
+ cacheTtlMs: 300000,
2350
+ cacheExpiresAt: '2025-11-24T21:32:10.305Z'
2351
+ }
2352
+
2353
+ stdout | src/__tests__/services/tool-protection-oauth-provider.test.ts > ToolProtectionService - oauthProvider Parsing > oauthProvider field inclusion > should include oauthProvider in returned ToolProtection objects when present
2354
+ [ToolProtectionService] Config loaded from API {
2355
+ source: 'api',
2356
+ toolCount: 2,
2357
+ protectedTools: [ 'tool_with_provider', 'tool_without_provider' ],
2358
+ agentDid: 'did:key:z6MkhaXgBZDv...',
2359
+ projectId: 'test-project-123',
2360
+ cacheTtlMs: 300000,
2361
+ cacheExpiresAt: '2025-11-24T21:32:10.305Z'
2362
+ }
2363
+
2364
+ stdout | src/__tests__/services/tool-protection-oauth-provider.test.ts > ToolProtectionService - oauthProvider Parsing > oauthProvider field inclusion > should handle empty string oauthProvider gracefully
2365
+ [ToolProtectionService] Config loaded from API {
2366
+ source: 'api',
2367
+ toolCount: 1,
2368
+ protectedTools: [ 'tool_with_empty_provider' ],
2369
+ agentDid: 'did:key:z6MkhaXgBZDv...',
2370
+ projectId: 'test-project-123',
2371
+ cacheTtlMs: 300000,
2372
+ cacheExpiresAt: '2025-11-24T21:32:10.307Z'
2373
+ }
2374
+
2375
+ ✓ src/__tests__/services/tool-protection-oauth-provider.test.ts (14 tests) 14ms
2376
+ ✓ src/services/__tests__/storage.service.test.ts (17 tests) 33ms
2377
+ stdout | src/__tests__/regression/phase2-regression.test.ts > Phase 2 Regression Tests > Backward Compatibility > Phase 1 tools (no oauthProvider) > should work with Phase 1 tools that don't specify oauthProvider
2378
+ [ToolProtectionService] Config loaded from API {
2379
+ source: 'api',
2380
+ toolCount: 1,
2381
+ protectedTools: [ 'phase1_tool' ],
2382
+ agentDid: 'did:key:z6MkhaXgBZDv...',
2383
+ projectId: 'none',
2384
+ cacheTtlMs: 300000,
2385
+ cacheExpiresAt: '2025-11-24T21:32:10.317Z'
2386
+ }
2387
+
2388
+ stdout | src/__tests__/regression/phase2-regression.test.ts > Phase 2 Regression Tests > Backward Compatibility > Old API endpoint format > should still support old endpoint format (tools array)
2389
+ [ToolProtectionService] Config loaded from API {
2390
+ source: 'api',
2391
+ toolCount: 1,
2392
+ protectedTools: [ 'old_tool' ],
2393
+ agentDid: 'did:key:z6MkhaXgBZDv...',
2394
+ projectId: 'none',
2395
+ cacheTtlMs: 300000,
2396
+ cacheExpiresAt: '2025-11-24T21:32:10.321Z'
2397
+ }
2398
+
2399
+ stderr | src/__tests__/regression/phase2-regression.test.ts > Phase 2 Regression Tests > No Regressions > Phase 1 OAuth flow > should still work with Phase 1 OAuth flow (no oauthProvider)
2400
+ stdout | src/__tests__/regression/phase2-regression.test.ts > Phase 2 Regression Tests > Backward Compatibility > Old API endpoint format > should still support old endpoint format (tools object)
2401
+ [ToolProtectionService] Config loaded from API {
2402
+ [ProviderResolver] Tool does not specify oauthProvider. Using first configured provider "github" as fallback. This is deprecated - configure oauthProvider in AgentShield dashboard for Phase 2+.
2403
+ source: 'api',
2404
+ toolCount: 1,
2405
+ protectedTools: [ 'old_tool' ],
2406
+ agentDid: 'did:key:z6MkhaXgBZDv...',
2407
+ projectId: 'none',
2408
+ cacheTtlMs: 300000,
2409
+ cacheExpiresAt: '2025-11-24T21:32:10.321Z'
2410
+
2411
+ }
2412
+
2413
+ stdout | src/__tests__/regression/phase2-regression.test.ts > Phase 2 Regression Tests > Backward Compatibility > snake_case field names > should still support snake_case field names
2414
+ [ToolProtectionService] Config loaded from API {
2415
+ source: 'api',
2416
+ toolCount: 1,
2417
+ protectedTools: [ 'tool_with_snake_case' ],
2418
+ agentDid: 'did:key:z6MkhaXgBZDv...',
2419
+ projectId: 'test-project-123',
2420
+ cacheTtlMs: 300000,
2421
+ cacheExpiresAt: '2025-11-24T21:32:10.321Z'
2422
+ }
2423
+
2424
+ stdout | src/__tests__/regression/phase2-regression.test.ts > Phase 2 Regression Tests > Mixed Phase 1 and Phase 2 tools > should handle mix of Phase 1 and Phase 2 tools in same project
2425
+ [ToolProtectionService] Config loaded from API {
2426
+ source: 'api',
2427
+ toolCount: 2,
2428
+ protectedTools: [ 'phase1_tool', 'phase2_tool' ],
2429
+ agentDid: 'did:key:z6MkhaXgBZDv...',
2430
+ projectId: 'test-project-123',
2431
+ cacheTtlMs: 300000,
2432
+ cacheExpiresAt: '2025-11-24T21:32:10.322Z'
2433
+ }
2434
+
2435
+ ✓ src/__tests__/regression/phase2-regression.test.ts (12 tests) 6ms
2436
+ stdout | src/__tests__/integration.test.ts > Integration Tests > Full handshake and tool execution flow > should complete full authentication and tool execution cycle
2437
+ [AUDIT] {"event":"runtime_initialized","data":{"did":"did:key:zHrIAXiPd82_S4D4jgQVnnrEpM9cytCcW","environment":"development","userDidGeneration":"disabled"},"timestamp":1764019630327,"timestampFormatted":"2025-11-24T21:27:10.327Z"}
2438
+
2439
+ stdout | src/__tests__/integration.test.ts > Integration Tests > Full handshake and tool execution flow > should complete full authentication and tool execution cycle
2440
+ [AUDIT] {"event":"tool_executed","data":{"tool":"greetingTool","sessionId":"087bdca49ced15c22721f1060a548c8e","timestamp":1764019630327},"timestamp":1764019630327,"timestampFormatted":"2025-11-24T21:27:10.327Z"}
2441
+
2442
+ stdout | src/__tests__/integration.test.ts > Integration Tests > Session expiry handling > should handle expired sessions correctly
2443
+ [AUDIT] {"event":"runtime_initialized","data":{"did":"did:key:zUTYHZ87G7YghsT2EBWJwJh17s2nUugJ5","environment":"development","userDidGeneration":"disabled"},"timestamp":1764019630342,"timestampFormatted":"2025-11-24T21:27:10.342Z"}
2444
+
2445
+ stdout | src/__tests__/integration.test.ts > Integration Tests > Key rotation flow > should handle key rotation and maintain functionality
2446
+ [AUDIT] {"event":"runtime_initialized","data":{"did":"did:key:zGCVcbJoakpFxOVCaDxZC3cl-BNu3dvtn","environment":"development","userDidGeneration":"disabled"},"timestamp":1764019630343,"timestampFormatted":"2025-11-24T21:27:10.343Z"}
2447
+
2448
+ stdout | src/__tests__/integration.test.ts > Integration Tests > Key rotation flow > should handle key rotation and maintain functionality
2449
+ [AUDIT] {"event":"keys_rotated","data":{"oldDid":"did:key:zGCVcbJoakpFxOVCaDxZC3cl-BNu3dvtn","newDid":"did:key:zvXEK_BBk1qAaau-LEv6gsbbBCXtoMuL7","timestamp":1764019630343},"timestamp":1764019630343,"timestampFormatted":"2025-11-24T21:27:10.343Z"}
2450
+
2451
+ ✓ src/__tests__/providers/memory.test.ts (34 tests) 15ms
2452
+ stdout | src/__tests__/integration.test.ts > Integration Tests > Well-known endpoints > should provide identity discovery endpoints
2453
+ [AUDIT] {"event":"runtime_initialized","data":{"did":"did:key:zKOWuYWu7A7ZfSQ1WZd0qCs14PWDWkxiF","environment":"development","userDidGeneration":"disabled"},"timestamp":1764019630343,"timestampFormatted":"2025-11-24T21:27:10.343Z"}
2454
+
2455
+ stdout | src/__tests__/integration.test.ts > Integration Tests > Nonce replay protection > should prevent nonce reuse
2456
+ [AUDIT] {"event":"runtime_initialized","data":{"did":"did:key:zHiFFzI1Uh2MZ7X32utWo4tgatqF4aRTp","environment":"development","userDidGeneration":"disabled"},"timestamp":1764019630343,"timestampFormatted":"2025-11-24T21:27:10.343Z"}
2457
+
2458
+ stdout | src/__tests__/integration.test.ts > Integration Tests > Error handling > should handle network errors gracefully
2459
+ [AUDIT] {"event":"runtime_initialized","data":{"did":"did:key:zFWe89pbeL-6G20NEqLQcPD-NlAKxz_WW","environment":"development","userDidGeneration":"disabled"},"timestamp":1764019630344,"timestampFormatted":"2025-11-24T21:27:10.344Z"}
2460
+
2461
+ stdout | src/__tests__/integration.test.ts > Integration Tests > Error handling > should handle malformed DID documents
2462
+ [AUDIT] {"event":"runtime_initialized","data":{"did":"did:key:z0B6tZqPGRmCXPWxrmhGe8F5R1X6ERiux","environment":"development","userDidGeneration":"disabled"},"timestamp":1764019630344,"timestampFormatted":"2025-11-24T21:27:10.344Z"}
2463
+
2464
+ stdout | src/__tests__/integration.test.ts > Integration Tests > Debug endpoint > should provide debug information in development
2465
+ [AUDIT] {"event":"runtime_initialized","data":{"did":"did:key:zwvaoj9oPq89uorHnMZsdmvqWDO-VK-Vw","environment":"development","userDidGeneration":"disabled"},"timestamp":1764019630344,"timestampFormatted":"2025-11-24T21:27:10.344Z"}
2466
+
2467
+ stdout | src/__tests__/integration.test.ts > Integration Tests > Debug endpoint > should be disabled in production
2468
+ [AUDIT] {"event":"runtime_initialized","data":{"did":"did:key:zCzYL45UA04Cx8blnD1nJ27feOqEHJkrv","environment":"development","userDidGeneration":"disabled"},"timestamp":1764019630344,"timestampFormatted":"2025-11-24T21:27:10.344Z"}
2469
+
2470
+ ✓ src/delegation/storage/__tests__/memory-statuslist-storage.test.ts (14 tests) 8ms
2471
+ ✓ src/__tests__/integration.test.ts (9 tests) 19ms
2472
+ stdout | src/__tests__/services/agentshield-integration.test.ts > AgentShield Integration > Caching Integration > should respect cache TTL
2473
+ [ToolProtectionService] Config loaded from API {
2474
+ source: 'api',
2475
+ toolCount: 0,
2476
+ protectedTools: [],
2477
+ agentDid: 'did:key:z6MkhaXgBZDv...',
2478
+ projectId: 'test-project-123',
2479
+ cacheTtlMs: 1000,
2480
+ cacheExpiresAt: '2025-11-24T21:27:11.354Z'
2481
+ }
2482
+
2483
+ stdout | src/__tests__/services/agentshield-integration.test.ts > AgentShield Integration > Real-world Scenarios > should handle typical e-commerce tool protection config
2484
+ [ToolProtectionService] Config loaded from API {
2485
+ source: 'api',
2486
+ toolCount: 4,
2487
+ protectedTools: [ 'add_to_cart', 'checkout' ],
2488
+ agentDid: 'did:key:z6MkhaXgBZDv...',
2489
+ projectId: 'test-project-123',
2490
+ cacheTtlMs: 300000,
2491
+ cacheExpiresAt: '2025-11-24T21:32:10.355Z'
2492
+ }
2493
+
2494
+ stderr | src/__tests__/services/agentshield-integration.test.ts > AgentShield Integration > Real-world Scenarios > should handle API rate limiting gracefully
2495
+ [ToolProtectionService] API fetch failed, using fallback config {
2496
+ agentDid: 'did:key:z6MkhaXgBZDv...',
2497
+ stdout | src/__tests__/services/agentshield-integration.test.ts > AgentShield Integration > Real-world Scenarios > should handle concurrent requests
2498
+ error: 'Failed to fetch bouncer config: 429 Too Many Requests - Rate limit exceeded'
2499
+ [ToolProtectionService] Config loaded from API {
2500
+ source: 'api',
2501
+ toolCount: 1,
2502
+ protectedTools: [ 'tool1' ],
2503
+ agentDid: 'did:key:z6MkhaXgBZDv...',
2504
+ projectId: 'test-project-123',
2505
+ cacheTtlMs: 300000,
2506
+ cacheExpiresAt: '2025-11-24T21:32:10.355Z'
2507
+ }
2508
+
2509
+ }
2510
+ [ToolProtectionService] Config loaded from API {
2511
+ source: 'api',
2512
+ toolCount: 1,
2513
+ protectedTools: [ 'tool1' ],
2514
+ agentDid: 'did:key:z6MkhaXgBZDv...',
2515
+ projectId: 'test-project-123',
2516
+ cacheTtlMs: 300000,
2517
+ cacheExpiresAt: '2025-11-24T21:32:10.355Z'
2518
+ }
2519
+ [ToolProtectionService] Config loaded from API {
2520
+ source: 'api',
2521
+ toolCount: 1,
2522
+ protectedTools: [ 'tool1' ],
2523
+ agentDid: 'did:key:z6MkhaXgBZDv...',
2524
+ projectId: 'test-project-123',
2525
+ cacheTtlMs: 300000,
2526
+ cacheExpiresAt: '2025-11-24T21:32:10.355Z'
2527
+ }
2528
+
2529
+ ✓ src/__tests__/services/agentshield-integration.test.ts (30 tests) 1115ms
2530
+ ✓ should respect cache TTL 1101ms
2531
+ stdout | src/__tests__/services/provider-resolver-edge-cases.test.ts > ProviderResolver - Edge Cases > Scope inference edge cases (Priority 2) > should verify gmail → google mapping works
2532
+ stderr | src/__tests__/services/provider-resolver-edge-cases.test.ts > ProviderResolver - Edge Cases > Scope inference edge cases (Priority 2) > should handle empty scopes array
2533
+ [ProviderResolver] Inferred provider "google" from scopes
2534
+ [ProviderResolver] Tool does not specify oauthProvider. Using first configured provider "github" as fallback. This is deprecated - configure oauthProvider in AgentShield dashboard for Phase 2+.
2535
+
2536
+
2537
+ stderr | src/__tests__/services/provider-resolver-edge-cases.test.ts > ProviderResolver - Edge Cases > Scope inference edge cases (Priority 2) > should handle ambiguous scopes (multiple providers inferred)
2538
+ stdout | src/__tests__/services/provider-resolver-edge-cases.test.ts > ProviderResolver - Edge Cases > Scope inference edge cases (Priority 2) > should verify calendar → google mapping works
2539
+ [ProviderResolver] Inferred provider "google" from scopes
2540
+ [ProviderResolver] Tool does not specify oauthProvider. Using first configured provider "github" as fallback. This is deprecated - configure oauthProvider in AgentShield dashboard for Phase 2+.
2541
+
2542
+
2543
+ stdout | src/__tests__/services/provider-resolver-edge-cases.test.ts > ProviderResolver - Edge Cases > Scope inference edge cases (Priority 2) > should verify outlook → microsoft mapping works
2544
+ stderr | src/__tests__/services/provider-resolver-edge-cases.test.ts > ProviderResolver - Edge Cases > Scope inference edge cases (Priority 2) > should handle unknown scope prefixes
2545
+ [ProviderResolver] Inferred provider "microsoft" from scopes
2546
+
2547
+ [ProviderResolver] Tool does not specify oauthProvider. Using first configured provider "github" as fallback. This is deprecated - configure oauthProvider in AgentShield dashboard for Phase 2+.
2548
+
2549
+ stderr | src/__tests__/services/provider-resolver-edge-cases.test.ts > ProviderResolver - Edge Cases > Scope inference edge cases (Priority 2) > should handle scopes without colons
2550
+ [ProviderResolver] Tool does not specify oauthProvider. Using first configured provider "github" as fallback. This is deprecated - configure oauthProvider in AgentShield dashboard for Phase 2+.
2551
+
2552
+ stderr | src/__tests__/services/provider-resolver-edge-cases.test.ts > ProviderResolver - Edge Cases > Scope inference edge cases (Priority 2) > should handle inferred provider not in registry
2553
+ [ProviderResolver] Tool does not specify oauthProvider. Using first configured provider "google" as fallback. This is deprecated - configure oauthProvider in AgentShield dashboard for Phase 2+.
2554
+
2555
+ stderr | src/__tests__/services/provider-resolver-edge-cases.test.ts > ProviderResolver - Edge Cases > Fallback behavior (Priority 3) > should use first configured provider when oauthProvider not specified
2556
+ [ProviderResolver] Tool does not specify oauthProvider. Using first configured provider "github" as fallback. This is deprecated - configure oauthProvider in AgentShield dashboard for Phase 2+.
2557
+ ✓ src/delegation/storage/__tests__/memory-graph-storage.test.ts (27 tests) 5ms
2558
+ stdout | src/__tests__/services/provider-resolver-edge-cases.test.ts > ProviderResolver - Edge Cases > Provider name case sensitivity > should handle provider names case-insensitively in inference
2559
+
2560
+ [ProviderResolver] Inferred provider "github" from scopes
2561
+
2562
+ stdout | src/__tests__/services/provider-resolver-edge-cases.test.ts > ProviderResolver - Edge Cases > Multiple scopes with same provider > should handle multiple scopes from same provider
2563
+ [ProviderResolver] Inferred provider "github" from scopes
2564
+
2565
+ ✓ src/__tests__/services/provider-resolver-edge-cases.test.ts (19 tests | 1 skipped) 111ms
2566
+ stderr | src/__tests__/identity/user-did-manager.test.ts > UserDidManager > error handling > should handle storage.get errors gracefully
2567
+ [UserDidManager] Storage.get failed, generating new DID: Error: Storage error
2568
+ at /Users/dylanhobbs/Documents/@kya-os/xmcp-i/packages/mcp-i-core/src/__tests__/identity/user-did-manager.test.ts:187:67
2569
+ at file:///Users/dylanhobbs/Documents/@kya-os/xmcp-i/node_modules/.pnpm/@vitest+runner@4.0.5/node_modules/@vitest/runner/dist/index.js:157:11
2570
+ at file:///Users/dylanhobbs/Documents/@kya-os/xmcp-i/node_modules/.pnpm/@vitest+runner@4.0.5/node_modules/@vitest/runner/dist/index.js:753:26
2571
+ at file:///Users/dylanhobbs/Documents/@kya-os/xmcp-i/node_modules/.pnpm/@vitest+runner@4.0.5/node_modules/@vitest/runner/dist/index.js:1636:20
2572
+ at new Promise (<anonymous>)
2573
+ at runWithTimeout (file:///Users/dylanhobbs/Documents/@kya-os/xmcp-i/node_modules/.pnpm/@vitest+runner@4.0.5/node_modules/@vitest/runner/dist/index.js:1602:10)
2574
+ at runTest (file:///Users/dylanhobbs/Documents/@kya-os/xmcp-i/node_modules/.pnpm/@vitest+runner@4.0.5/node_modules/@vitest/runner/dist/index.js:1309:12)
2575
+ at processTicksAndRejections (node:internal/process/task_queues:103:5)
2576
+ at runSuite (file:///Users/dylanhobbs/Documents/@kya-os/xmcp-i/node_modules/.pnpm/@vitest+runner@4.0.5/node_modules/@vitest/runner/dist/index.js:1468:8)
2577
+ at runSuite (file:///Users/dylanhobbs/Documents/@kya-os/xmcp-i/node_modules/.pnpm/@vitest+runner@4.0.5/node_modules/@vitest/runner/dist/index.js:1468:8)
2578
+
2579
+ stderr | src/__tests__/identity/user-did-manager.test.ts > UserDidManager > error handling > should handle storage.set errors gracefully
2580
+ [UserDidManager] Storage.set failed, continuing with cached DID: Error: Storage error
2581
+ at /Users/dylanhobbs/Documents/@kya-os/xmcp-i/packages/mcp-i-core/src/__tests__/identity/user-did-manager.test.ts:196:67
2582
+ at file:///Users/dylanhobbs/Documents/@kya-os/xmcp-i/node_modules/.pnpm/@vitest+runner@4.0.5/node_modules/@vitest/runner/dist/index.js:157:11
2583
+ at file:///Users/dylanhobbs/Documents/@kya-os/xmcp-i/node_modules/.pnpm/@vitest+runner@4.0.5/node_modules/@vitest/runner/dist/index.js:753:26
2584
+ at file:///Users/dylanhobbs/Documents/@kya-os/xmcp-i/node_modules/.pnpm/@vitest+runner@4.0.5/node_modules/@vitest/runner/dist/index.js:1636:20
2585
+ at new Promise (<anonymous>)
2586
+ at runWithTimeout (file:///Users/dylanhobbs/Documents/@kya-os/xmcp-i/node_modules/.pnpm/@vitest+runner@4.0.5/node_modules/@vitest/runner/dist/index.js:1602:10)
2587
+ at runTest (file:///Users/dylanhobbs/Documents/@kya-os/xmcp-i/node_modules/.pnpm/@vitest+runner@4.0.5/node_modules/@vitest/runner/dist/index.js:1309:12)
2588
+ at processTicksAndRejections (node:internal/process/task_queues:103:5)
2589
+ at runSuite (file:///Users/dylanhobbs/Documents/@kya-os/xmcp-i/node_modules/.pnpm/@vitest+runner@4.0.5/node_modules/@vitest/runner/dist/index.js:1468:8)
2590
+ at runSuite (file:///Users/dylanhobbs/Documents/@kya-os/xmcp-i/node_modules/.pnpm/@vitest+runner@4.0.5/node_modules/@vitest/runner/dist/index.js:1468:8)
2591
+
2592
+ stderr | src/__tests__/identity/user-did-manager.test.ts > UserDidManager > error handling > should handle storage.delete errors gracefully
2593
+ [UserDidManager] Storage.delete failed, continuing: Error: Storage error
2594
+ at /Users/dylanhobbs/Documents/@kya-os/xmcp-i/packages/mcp-i-core/src/__tests__/identity/user-did-manager.test.ts:206:70
2595
+ at processTicksAndRejections (node:internal/process/task_queues:103:5)
2596
+ at file:///Users/dylanhobbs/Documents/@kya-os/xmcp-i/node_modules/.pnpm/@vitest+runner@4.0.5/node_modules/@vitest/runner/dist/index.js:753:20
2597
+
2598
+ ✓ src/__tests__/identity/user-did-manager.test.ts (17 tests) 6ms
2599
+ ✓ src/__tests__/runtime/delegation-flow.test.ts (4 tests) 4ms
2600
+ ✓ src/__tests__/runtime/base-extensions.test.ts (38 tests) 14ms
2601
+ ✓ src/__tests__/runtime/proof-client-did.test.ts (17 tests) 7ms
2602
+ stderr | src/services/__tests__/provider-resolution.integration.test.ts > Provider Resolution Integration > Backward compatibility > should work with Phase 1 tools (no oauthProvider field)
2603
+ [ProviderResolver] Tool does not specify oauthProvider. Using first configured provider "github" as fallback. This is deprecated - configure oauthProvider in AgentShield dashboard for Phase 2+.
2604
+
2605
+ ✓ src/services/__tests__/provider-resolution.integration.test.ts (6 tests) 4ms
2606
+ ✓ src/services/__tests__/oauth-provider-registry.test.ts (9 tests) 3ms
2607
+ ✓ src/delegation/__tests__/delegation-graph.test.ts (28 tests) 173ms
2608
+ stderr | src/config/__tests__/remote-config.spec.ts > fetchRemoteConfig > Error handling > should return null if API request fails
2609
+ [RemoteConfig] API returned 404: Not Found
2610
+
2611
+ stderr | src/config/__tests__/remote-config.spec.ts > fetchRemoteConfig > Error handling > should return null if API throws error
2612
+ [RemoteConfig] Failed to fetch config: Error: Network error
2613
+ at /Users/dylanhobbs/Documents/@kya-os/xmcp-i/packages/mcp-i-core/src/config/__tests__/remote-config.spec.ts:170:35
2614
+ at file:///Users/dylanhobbs/Documents/@kya-os/xmcp-i/node_modules/.pnpm/@vitest+runner@4.0.5/node_modules/@vitest/runner/dist/index.js:157:11
2615
+ at file:///Users/dylanhobbs/Documents/@kya-os/xmcp-i/node_modules/.pnpm/@vitest+runner@4.0.5/node_modules/@vitest/runner/dist/index.js:753:26
2616
+ at file:///Users/dylanhobbs/Documents/@kya-os/xmcp-i/node_modules/.pnpm/@vitest+runner@4.0.5/node_modules/@vitest/runner/dist/index.js:1636:20
2617
+ at new Promise (<anonymous>)
2618
+ at runWithTimeout (file:///Users/dylanhobbs/Documents/@kya-os/xmcp-i/node_modules/.pnpm/@vitest+runner@4.0.5/node_modules/@vitest/runner/dist/index.js:1602:10)
2619
+ at runTest (file:///Users/dylanhobbs/Documents/@kya-os/xmcp-i/node_modules/.pnpm/@vitest+runner@4.0.5/node_modules/@vitest/runner/dist/index.js:1309:12)
2620
+ at processTicksAndRejections (node:internal/process/task_queues:103:5)
2621
+ at runSuite (file:///Users/dylanhobbs/Documents/@kya-os/xmcp-i/node_modules/.pnpm/@vitest+runner@4.0.5/node_modules/@vitest/runner/dist/index.js:1468:8)
2622
+ at runSuite (file:///Users/dylanhobbs/Documents/@kya-os/xmcp-i/node_modules/.pnpm/@vitest+runner@4.0.5/node_modules/@vitest/runner/dist/index.js:1468:8)
2623
+
2624
+ stderr | src/config/__tests__/remote-config.spec.ts > fetchRemoteConfig > Error handling > should return null if neither projectId nor agentDid provided
2625
+ [RemoteConfig] Neither projectId nor agentDid provided
2626
+
2627
+ stderr | src/config/__tests__/remote-config.spec.ts > fetchRemoteConfig > Error handling > should handle cache read errors gracefully
2628
+ [RemoteConfig] Cache read failed: Error: Cache error
2629
+ at /Users/dylanhobbs/Documents/@kya-os/xmcp-i/packages/mcp-i-core/src/config/__tests__/remote-config.spec.ts:198:50
2630
+ at file:///Users/dylanhobbs/Documents/@kya-os/xmcp-i/node_modules/.pnpm/@vitest+runner@4.0.5/node_modules/@vitest/runner/dist/index.js:157:11
2631
+ at file:///Users/dylanhobbs/Documents/@kya-os/xmcp-i/node_modules/.pnpm/@vitest+runner@4.0.5/node_modules/@vitest/runner/dist/index.js:753:26
2632
+ at file:///Users/dylanhobbs/Documents/@kya-os/xmcp-i/node_modules/.pnpm/@vitest+runner@4.0.5/node_modules/@vitest/runner/dist/index.js:1636:20
2633
+ at new Promise (<anonymous>)
2634
+ at runWithTimeout (file:///Users/dylanhobbs/Documents/@kya-os/xmcp-i/node_modules/.pnpm/@vitest+runner@4.0.5/node_modules/@vitest/runner/dist/index.js:1602:10)
2635
+ at runTest (file:///Users/dylanhobbs/Documents/@kya-os/xmcp-i/node_modules/.pnpm/@vitest+runner@4.0.5/node_modules/@vitest/runner/dist/index.js:1309:12)
2636
+ at processTicksAndRejections (node:internal/process/task_queues:103:5)
2637
+ at runSuite (file:///Users/dylanhobbs/Documents/@kya-os/xmcp-i/node_modules/.pnpm/@vitest+runner@4.0.5/node_modules/@vitest/runner/dist/index.js:1468:8)
2638
+ at runSuite (file:///Users/dylanhobbs/Documents/@kya-os/xmcp-i/node_modules/.pnpm/@vitest+runner@4.0.5/node_modules/@vitest/runner/dist/index.js:1468:8)
2639
+
2640
+ stdout | src/services/__tests__/provider-resolver.test.ts > ProviderResolver > resolveProvider - Priority 2: Scope inference > should infer provider from github scope prefix
2641
+ [ProviderResolver] Inferred provider "github" from scopes
2642
+
2643
+ stdout | src/services/__tests__/provider-resolver.test.ts > ProviderResolver > resolveProvider - Priority 2: Scope inference > should infer provider from gmail scope prefix (maps to google)
2644
+ [ProviderResolver] Inferred provider "google" from scopes
2645
+
2646
+ stderr | src/services/__tests__/provider-resolver.test.ts > ProviderResolver > resolveProvider - Priority 2: Scope inference > should return null for ambiguous scopes
2647
+ [ProviderResolver] Tool does not specify oauthProvider. Using first configured provider "github" as fallback. This is deprecated - configure oauthProvider in AgentShield dashboard for Phase 2+.
2648
+
2649
+ ✓ src/delegation/__tests__/bitstring.test.ts (30 tests) 5ms
2650
+ ✓ src/compliance/__tests__/schema-verifier.test.ts (30 tests) 5ms
2651
+ ✓ src/config/__tests__/remote-config.spec.ts (9 tests) 8ms
2652
+ ✓ src/services/__tests__/provider-resolver.test.ts (8 tests) 8ms
2653
+ ✓ src/utils/__tests__/did-helpers.test.ts (11 tests) 2ms
2654
+ ✓ src/delegation/__tests__/utils.test.ts (28 tests) 5ms
2655
+ ✓ src/services/__tests__/batch-delegation.service.test.ts (11 tests) 5ms
2656
+ ✓ src/__tests__/runtime/audit-logger.test.ts (9 tests) 5ms
2657
+ ✓ src/__tests__/providers/base.test.ts (14 tests) 5ms
2658
+ ✓ src/delegation/__tests__/audience-validator.test.ts (5 tests) 1ms
2659
+ ↓ src/__tests__/delegation-e2e.test.ts (14 tests | 14 skipped)
2660
+ ✓ src/__tests__/index.test.ts (4 tests) 2ms
2661
+
2662
+ Test Files 43 passed | 1 skipped (44)
2663
+ Tests 873 passed | 16 skipped (889)
2664
+ Start at 15:27:06
2665
+ Duration 5.26s (transform 11.76s, setup 0ms, collect 19.41s, tests 3.18s, environment 3ms, prepare 2.03s)
2666
+