@kya-os/mcp-i-core 1.3.1 → 1.3.2

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,4424 @@
1
+
2
+ 
3
+ > @kya-os/mcp-i-core@1.3.1 test:coverage /Users/dylanhobbs/Documents/@kya-os/xmcp-i/packages/mcp-i-core
4
+ > vitest run --coverage
5
+
6
+ [?25l
7
+  RUN  v4.0.5 /Users/dylanhobbs/Documents/@kya-os/xmcp-i/packages/mcp-i-core
8
+ Coverage enabled with v8
9
+
10
+ [?2026h
11
+  ❯ src/services/__tests__/access-control.service.test.ts [queued]
12
+
13
+  Test Files 0 passed (44)
14
+  Tests 0 passed (0)
15
+  Start at 01:06:38
16
+  Duration 208ms
17
+ [?2026l[?2026h
18
+  ❯ src/__tests__/cache/tool-protection-cache.test.ts [queued]
19
+  ❯ src/__tests__/runtime/base.test.ts [queued]
20
+  ❯ src/__tests__/services/agentshield-integration.test.ts [queued]
21
+  ❯ src/__tests__/services/tool-protection.service.test.ts [queued]
22
+  ❯ src/delegation/__tests__/vc-issuer.test.ts [queued]
23
+  ❯ src/services/__tests__/access-control.integration.test.ts [queued]
24
+  ❯ src/services/__tests__/access-control.proof-response-validation.test.ts [queued]
25
+  ❯ src/services/__tests__/access-control.service.test.ts [queued]
26
+  ❯ src/services/__tests__/proof-verifier.integration.test.ts [queued]
27
+  ❯ src/services/__tests__/storage.service.test.ts [queued]
28
+
29
+  Test Files 0 passed (44)
30
+  Tests 0 passed (0)
31
+  Start at 01:06:38
32
+  Duration 315ms
33
+ [?2026l[?2026h
34
+  ❯ src/__tests__/cache/tool-protection-cache.test.ts 0/49
35
+  ❯ src/__tests__/runtime/base.test.ts [queued]
36
+  ❯ src/__tests__/runtime/route-interception.test.ts [queued]
37
+  ❯ src/__tests__/runtime/tool-protection-enforcement.test.ts [queued]
38
+  ❯ src/__tests__/services/agentshield-integration.test.ts [queued]
39
+  ❯ src/__tests__/services/tool-protection.service.test.ts 0/49
40
+  ❯ src/delegation/__tests__/vc-issuer.test.ts [queued]
41
+  ❯ src/delegation/__tests__/vc-verifier.test.ts [queued]
42
+  ❯ src/services/__tests__/access-control.integration.test.ts [queued]
43
+  ❯ src/services/__tests__/access-control.proof-response-validation.test.ts [queued]
44
+  ❯ src/services/__tests__/access-control.service.test.ts 0/23
45
+  ❯ src/services/__tests__/proof-verifier.integration.test.ts [queued]
46
+  ❯ src/services/__tests__/storage.service.test.ts [queued]
47
+
48
+  Test Files 0 passed (44)
49
+  Tests 0 passed (121)
50
+  Start at 01:06:38
51
+  Duration 426ms
52
+ [?2026l[?2026hstdout | 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
53
+ [ToolProtectionService] Config loaded from API {
54
+ source: 'api',
55
+ toolCount: 2,
56
+ protectedTools: [ 'checkout' ],
57
+ agentDid: 'did:key:z6MkhaXgBZDv...',
58
+ projectId: 'test-project-123',
59
+ cacheTtlMs: 300000,
60
+ cacheExpiresAt: '2025-11-25T07:11:38.913Z'
61
+ }
62
+
63
+ stdout | src/__tests__/services/tool-protection.service.test.ts > ToolProtectionService > getToolProtectionConfig > API fetch - new endpoint format > should handle new endpoint format with toolProtections object
64
+ [ToolProtectionService] Config loaded from API {
65
+ source: 'api',
66
+ toolCount: 2,
67
+ protectedTools: [ 'protected_tool' ],
68
+ agentDid: 'did:key:z6MkhaXgBZDv...',
69
+ projectId: 'test-project-123',
70
+ cacheTtlMs: 300000,
71
+ cacheExpiresAt: '2025-11-25T07:11:38.915Z'
72
+ }
73
+
74
+ 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)
75
+ [ToolProtectionService] Config loaded from API {
76
+ source: 'api',
77
+ toolCount: 2,
78
+ protectedTools: [ 'read_repos', 'send_email' ],
79
+ agentDid: 'did:key:z6MkhaXgBZDv...',
80
+ projectId: 'test-project-123',
81
+ cacheTtlMs: 300000,
82
+ cacheExpiresAt: '2025-11-25T07:11:38.915Z'
83
+ }
84
+
85
+ stdout | src/__tests__/services/tool-protection.service.test.ts > ToolProtectionService > getToolProtectionConfig > API fetch - new endpoint format > should preserve oauthProvider through cache operations
86
+ [ToolProtectionService] Config loaded from API {
87
+ source: 'api',
88
+ toolCount: 1,
89
+ protectedTools: [ 'read_repos' ],
90
+ agentDid: 'did:key:z6MkhaXgBZDv...',
91
+ projectId: 'test-project-123',
92
+ cacheTtlMs: 300000,
93
+ cacheExpiresAt: '2025-11-25T07:11:38.915Z'
94
+ }
95
+
96
+ stdout | src/__tests__/services/agentshield-integration.test.ts > AgentShield Integration > API Authentication > should use X-API-Key header for new endpoint
97
+ [ToolProtectionService] Config loaded from API {
98
+ source: 'api',
99
+ toolCount: 0,
100
+ protectedTools: [],
101
+ agentDid: 'did:key:z6MkhaXgBZDv...',
102
+ projectId: 'test-project-123',
103
+ cacheTtlMs: 300000,
104
+ cacheExpiresAt: '2025-11-25T07:11:38.908Z'
105
+ }
106
+
107
+ stdout | src/__tests__/services/agentshield-integration.test.ts > AgentShield Integration > API Authentication > should use Authorization Bearer header for old endpoint
108
+ [ToolProtectionService] Config loaded from API {
109
+ source: 'api',
110
+ toolCount: 0,
111
+ protectedTools: [],
112
+ agentDid: 'did:key:z6MkhaXgBZDv...',
113
+ projectId: 'none',
114
+ cacheTtlMs: 300000,
115
+ cacheExpiresAt: '2025-11-25T07:11:38.916Z'
116
+ }
117
+
118
+ stdout | src/__tests__/services/agentshield-integration.test.ts > AgentShield Integration > Endpoint Selection > should use project-scoped endpoint when projectId is available
119
+ [ToolProtectionService] Config loaded from API {
120
+ source: 'api',
121
+ toolCount: 0,
122
+ protectedTools: [],
123
+ agentDid: 'did:key:z6MkhaXgBZDv...',
124
+ projectId: 'test-project-123',
125
+ cacheTtlMs: 300000,
126
+ cacheExpiresAt: '2025-11-25T07:11:38.917Z'
127
+ }
128
+
129
+ stdout | src/__tests__/services/agentshield-integration.test.ts > AgentShield Integration > Endpoint Selection > should use agent-scoped endpoint when projectId is not available
130
+ [ToolProtectionService] Config loaded from API {
131
+ source: 'api',
132
+ toolCount: 0,
133
+ protectedTools: [],
134
+ agentDid: 'did:key:z6MkhaXgBZDv...',
135
+ projectId: 'none',
136
+ cacheTtlMs: 300000,
137
+ cacheExpiresAt: '2025-11-25T07:11:38.917Z'
138
+ }
139
+
140
+ 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
141
+ [ToolProtectionService] Config loaded from API {
142
+ source: 'api',
143
+ toolCount: 2,
144
+ protectedTools: [ 'checkout' ],
145
+ agentDid: 'did:key:z6MkhaXgBZDv...',
146
+ projectId: 'none',
147
+ cacheTtlMs: 300000,
148
+ cacheExpiresAt: '2025-11-25T07:11:38.916Z'
149
+ }
150
+
151
+ stdout | src/__tests__/services/agentshield-integration.test.ts > AgentShield Integration > Endpoint Selection > should encode projectId in URL
152
+ [ToolProtectionService] Config loaded from API {
153
+ source: 'api',
154
+ toolCount: 0,
155
+ protectedTools: [],
156
+ agentDid: 'did:key:z6MkhaXgBZDv...',
157
+ projectId: 'project/with/special-chars',
158
+ cacheTtlMs: 300000,
159
+ cacheExpiresAt: '2025-11-25T07:11:38.917Z'
160
+ }
161
+
162
+ stdout | src/__tests__/services/agentshield-integration.test.ts > AgentShield Integration > Endpoint Selection > should encode agent DID in URL
163
+ [ToolProtectionService] Config loaded from API {
164
+ source: 'api',
165
+ toolCount: 0,
166
+ protectedTools: [],
167
+ agentDid: 'did:key:z6MkhaXgBZDv...',
168
+ projectId: 'none',
169
+ cacheTtlMs: 300000,
170
+ cacheExpiresAt: '2025-11-25T07:11:38.918Z'
171
+ }
172
+
173
+ stdout | src/__tests__/services/agentshield-integration.test.ts > AgentShield Integration > Response Format Compatibility > should handle new endpoint format (toolProtections object)
174
+ [ToolProtectionService] Config loaded from API {
175
+ source: 'api',
176
+ toolCount: 2,
177
+ protectedTools: [ 'checkout' ],
178
+ agentDid: 'did:key:z6MkhaXgBZDv...',
179
+ projectId: 'test-project-123',
180
+ cacheTtlMs: 300000,
181
+ cacheExpiresAt: '2025-11-25T07:11:38.918Z'
182
+ }
183
+
184
+ stdout | src/__tests__/services/agentshield-integration.test.ts > AgentShield Integration > Response Format Compatibility > should handle old endpoint format (tools array)
185
+ [ToolProtectionService] Config loaded from API {
186
+ source: 'api',
187
+ toolCount: 2,
188
+ protectedTools: [ 'checkout' ],
189
+ agentDid: 'did:key:z6MkhaXgBZDv...',
190
+ projectId: 'none',
191
+ cacheTtlMs: 300000,
192
+ cacheExpiresAt: '2025-11-25T07:11:38.918Z'
193
+ }
194
+
195
+ stdout | src/__tests__/services/agentshield-integration.test.ts > AgentShield Integration > Response Format Compatibility > should handle old endpoint format (tools object)
196
+ [ToolProtectionService] Config loaded from API {
197
+ source: 'api',
198
+ toolCount: 2,
199
+ protectedTools: [ 'checkout' ],
200
+ agentDid: 'did:key:z6MkhaXgBZDv...',
201
+ projectId: 'none',
202
+ cacheTtlMs: 300000,
203
+ cacheExpiresAt: '2025-11-25T07:11:38.918Z'
204
+ }
205
+
206
+ stdout | src/__tests__/services/agentshield-integration.test.ts > AgentShield Integration > Response Format Compatibility > should handle snake_case field names
207
+ [ToolProtectionService] Config loaded from API {
208
+ source: 'api',
209
+ toolCount: 1,
210
+ protectedTools: [ 'tool1' ],
211
+ agentDid: 'did:key:z6MkhaXgBZDv...',
212
+ projectId: 'test-project-123',
213
+ cacheTtlMs: 300000,
214
+ cacheExpiresAt: '2025-11-25T07:11:38.918Z'
215
+ }
216
+
217
+ stdout | src/__tests__/services/agentshield-integration.test.ts > AgentShield Integration > Response Format Compatibility > should handle camelCase field names
218
+ [ToolProtectionService] Config loaded from API {
219
+ source: 'api',
220
+ toolCount: 1,
221
+ protectedTools: [ 'tool1' ],
222
+ agentDid: 'did:key:z6MkhaXgBZDv...',
223
+ projectId: 'test-project-123',
224
+ cacheTtlMs: 300000,
225
+ cacheExpiresAt: '2025-11-25T07:11:38.919Z'
226
+ }
227
+
228
+ stdout | src/__tests__/services/agentshield-integration.test.ts > AgentShield Integration > Response Format Compatibility > should prefer camelCase over snake_case when both present
229
+ [ToolProtectionService] Config loaded from API {
230
+ source: 'api',
231
+ toolCount: 1,
232
+ protectedTools: [ 'tool1' ],
233
+ agentDid: 'did:key:z6MkhaXgBZDv...',
234
+ projectId: 'test-project-123',
235
+ cacheTtlMs: 300000,
236
+ cacheExpiresAt: '2025-11-25T07:11:38.919Z'
237
+ }
238
+
239
+ stdout | src/__tests__/services/tool-protection.service.test.ts > ToolProtectionService > getToolProtectionConfig > API fetch - old endpoint format > should handle old endpoint format with tools array
240
+ [ToolProtectionService] Config loaded from API {
241
+ source: 'api',
242
+ toolCount: 2,
243
+ protectedTools: [ 'tool1' ],
244
+ agentDid: 'did:key:z6MkhaXgBZDv...',
245
+ projectId: 'none',
246
+ cacheTtlMs: 300000,
247
+ cacheExpiresAt: '2025-11-25T07:11:38.918Z'
248
+ }
249
+
250
+ 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)
251
+ [ToolProtectionService] Config loaded from API {
252
+ source: 'api',
253
+ toolCount: 2,
254
+ protectedTools: [ 'read_repos', 'send_email' ],
255
+ agentDid: 'did:key:z6MkhaXgBZDv...',
256
+ projectId: 'none',
257
+ cacheTtlMs: 300000,
258
+ cacheExpiresAt: '2025-11-25T07:11:38.919Z'
259
+ }
260
+
261
+ stdout | src/__tests__/services/tool-protection.service.test.ts > ToolProtectionService > getToolProtectionConfig > API fetch - old endpoint format > should handle old endpoint format with tools object
262
+ [ToolProtectionService] Config loaded from API {
263
+ source: 'api',
264
+ toolCount: 2,
265
+ protectedTools: [ 'tool1' ],
266
+ agentDid: 'did:key:z6MkhaXgBZDv...',
267
+ projectId: 'none',
268
+ cacheTtlMs: 300000,
269
+ cacheExpiresAt: '2025-11-25T07:11:38.919Z'
270
+ }
271
+
272
+ 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)
273
+ [ToolProtectionService] Config loaded from API {
274
+ source: 'api',
275
+ toolCount: 2,
276
+ protectedTools: [ 'read_repos', 'send_email' ],
277
+ agentDid: 'did:key:z6MkhaXgBZDv...',
278
+ projectId: 'none',
279
+ cacheTtlMs: 300000,
280
+ cacheExpiresAt: '2025-11-25T07:11:38.920Z'
281
+ }
282
+
283
+ stdout | src/__tests__/services/tool-protection.service.test.ts > ToolProtectionService > getToolProtectionConfig > API fetch - old endpoint format > should skip tools without name in array format
284
+ [ToolProtectionService] Cache miss, fetching from API {
285
+ source: 'api-fetch-start',
286
+ cacheKey: 'agent:did:key:z6MkhaXgBZDvotDkL5257faiztiGiC2QtKLGpbnnEGta2doK',
287
+ agentDid: 'did:key:z6MkhaXgBZDv...',
288
+ projectId: 'none',
289
+ apiUrl: 'https://kya.vouched.id',
290
+ endpoint: '/api/v1/bouncer/config?agent_did=did:key:z6MkhaXgBZDvotDkL5257faiztiGiC2QtKLGpbnnEGta2doK'
291
+ }
292
+ [ToolProtectionService] Fetching from API: https://kya.vouched.id/api/v1/bouncer/config?agent_did=did%3Akey%3Az6MkhaXgBZDvotDkL5257faiztiGiC2QtKLGpbnnEGta2doK {
293
+ method: 'config?agent_did (old)',
294
+ projectId: 'none',
295
+ apiKeyPresent: true,
296
+ apiKeyLength: 18,
297
+ apiKeyMasked: 'test-api...'
298
+ }
299
+
300
+ stdout | src/__tests__/services/tool-protection.service.test.ts > ToolProtectionService > getToolProtectionConfig > API fetch - old endpoint format > should skip tools without name in array format
301
+ [ToolProtectionService] API response received {
302
+ source: 'api-fetch-complete',
303
+ agentDid: 'did:key:z6MkhaXgBZDv...',
304
+ projectId: 'none',
305
+ responseKeys: [ 'success', 'data', 'metadata' ],
306
+ dataKeys: [ 'tools' ],
307
+ rawToolProtections: null,
308
+ rawTools: [
309
+ { name: 'valid_tool', requiresDelegation: true },
310
+ { requiresDelegation: false }
311
+ ],
312
+ responseMetadata: {}
313
+ }
314
+
315
+ stdout | src/__tests__/services/tool-protection.service.test.ts > ToolProtectionService > getToolProtectionConfig > API fetch - old endpoint format > should skip tools without name in array format
316
+ [ToolProtectionService] Config loaded from API {
317
+ source: 'api',
318
+ toolCount: 1,
319
+ protectedTools: [ 'valid_tool' ],
320
+ agentDid: 'did:key:z6MkhaXgBZDv...',
321
+ projectId: 'none',
322
+ cacheTtlMs: 300000,
323
+ cacheExpiresAt: '2025-11-25T07:11:38.921Z'
324
+ }
325
+ [ToolProtectionService] API fetch successful, config cached {
326
+ source: 'cache-write',
327
+ agentDid: 'did:key:z6MkhaXgBZDv...',
328
+ cacheKey: 'agent:did:key:z6MkhaXgBZDvotDkL5257faiztiGiC2QtKLGpbnnEGta2doK',
329
+ toolCount: 1,
330
+ tools: [ { name: 'valid_tool', requiresDelegation: true, scopeCount: 0 } ],
331
+ ttlMs: 300000,
332
+ ttlMinutes: 5,
333
+ expiresAt: '2025-11-25T07:11:38.921Z',
334
+ expiresIn: '300s'
335
+ }
336
+
337
+
338
+  ❯ src/__tests__/cache/tool-protection-cache.test.ts 2/49
339
+  ❯ src/__tests__/runtime/base.test.ts [queued]
340
+  ❯ src/__tests__/runtime/route-interception.test.ts [queued]
341
+  ❯ src/__tests__/runtime/tool-protection-enforcement.test.ts [queued]
342
+  ❯ src/__tests__/services/agentshield-integration.test.ts 0/30
343
+  ❯ src/__tests__/services/tool-protection.service.test.ts 49/49
344
+  ❯ src/delegation/__tests__/vc-issuer.test.ts 0/21
345
+  ❯ src/delegation/__tests__/vc-verifier.test.ts 0/35
346
+  ❯ src/services/__tests__/access-control.integration.test.ts [queued]
347
+  ❯ src/services/__tests__/access-control.proof-response-validation.test.ts 1/12
348
+  ❯ src/services/__tests__/access-control.service.test.ts 23/23
349
+  ❯ src/services/__tests__/proof-verifier.integration.test.ts [queued]
350
+  ❯ src/services/__tests__/storage.service.test.ts 0/17
351
+
352
+  Test Files 2 passed (44)
353
+  Tests 75 passed (236)
354
+  Start at 01:06:38
355
+  Duration 530ms
356
+ [?2026l[?2026hstderr | src/__tests__/services/agentshield-integration.test.ts > AgentShield Integration > Error Handling > should handle network timeout
357
+ [ToolProtectionService] API fetch failed, using fallback config { agentDid: 'did:key:z6MkhaXgBZDv...', error: 'Network timeout' }
358
+
359
+ stderr | src/__tests__/services/agentshield-integration.test.ts > AgentShield Integration > Fallback Behavior > should cache fallback config
360
+ [ToolProtectionService] API fetch failed, using fallback config { agentDid: 'did:key:z6MkhaXgBZDv...', error: 'Network error' }
361
+
362
+
363
+  ❯ src/__tests__/cache/tool-protection-cache.test.ts 2/49
364
+  ❯ src/__tests__/runtime/base.test.ts [queued]
365
+  ❯ src/__tests__/runtime/route-interception.test.ts [queued]
366
+  ❯ src/__tests__/runtime/tool-protection-enforcement.test.ts [queued]
367
+  ❯ src/__tests__/services/agentshield-integration.test.ts 0/30
368
+  ❯ src/__tests__/services/tool-protection.service.test.ts 49/49
369
+  ❯ src/delegation/__tests__/vc-issuer.test.ts 0/21
370
+  ❯ src/delegation/__tests__/vc-verifier.test.ts 0/35
371
+  ❯ src/services/__tests__/access-control.integration.test.ts [queued]
372
+  ❯ src/services/__tests__/access-control.proof-response-validation.test.ts 1/12
373
+  ❯ src/services/__tests__/access-control.service.test.ts 23/23
374
+  ❯ src/services/__tests__/proof-verifier.integration.test.ts [queued]
375
+  ❯ src/services/__tests__/storage.service.test.ts 0/17
376
+
377
+  Test Files 2 passed (44)
378
+  Tests 75 passed (236)
379
+  Start at 01:06:38
380
+  Duration 530ms
381
+ [?2026l[?2026hstdout | src/__tests__/services/agentshield-integration.test.ts > AgentShield Integration > Caching Integration > should cache successful API responses
382
+ [ToolProtectionService] Config loaded from API {
383
+ source: 'api',
384
+ toolCount: 1,
385
+ protectedTools: [ 'tool1' ],
386
+ agentDid: 'did:key:z6MkhaXgBZDv...',
387
+ projectId: 'test-project-123',
388
+ cacheTtlMs: 300000,
389
+ cacheExpiresAt: '2025-11-25T07:11:38.925Z'
390
+ }
391
+
392
+ stdout | src/__tests__/services/agentshield-integration.test.ts > AgentShield Integration > Caching Integration > should respect cache TTL
393
+ [ToolProtectionService] Config loaded from API {
394
+ source: 'api',
395
+ toolCount: 0,
396
+ protectedTools: [],
397
+ agentDid: 'did:key:z6MkhaXgBZDv...',
398
+ projectId: 'test-project-123',
399
+ cacheTtlMs: 1000,
400
+ cacheExpiresAt: '2025-11-25T07:06:39.925Z'
401
+ }
402
+
403
+
404
+  ❯ src/__tests__/cache/tool-protection-cache.test.ts 2/49
405
+  ❯ src/__tests__/runtime/base.test.ts [queued]
406
+  ❯ src/__tests__/runtime/route-interception.test.ts [queued]
407
+  ❯ src/__tests__/runtime/tool-protection-enforcement.test.ts [queued]
408
+  ❯ src/__tests__/services/agentshield-integration.test.ts 0/30
409
+  ❯ src/__tests__/services/tool-protection.service.test.ts 49/49
410
+  ❯ src/delegation/__tests__/vc-issuer.test.ts 0/21
411
+  ❯ src/delegation/__tests__/vc-verifier.test.ts 0/35
412
+  ❯ src/services/__tests__/access-control.integration.test.ts [queued]
413
+  ❯ src/services/__tests__/access-control.proof-response-validation.test.ts 1/12
414
+  ❯ src/services/__tests__/access-control.service.test.ts 23/23
415
+  ❯ src/services/__tests__/proof-verifier.integration.test.ts [queued]
416
+  ❯ src/services/__tests__/storage.service.test.ts 0/17
417
+
418
+  Test Files 2 passed (44)
419
+  Tests 75 passed (236)
420
+  Start at 01:06:38
421
+  Duration 530ms
422
+ [?2026l[?2026hstderr | src/__tests__/services/tool-protection.service.test.ts > ToolProtectionService > getToolProtectionConfig > API fetch error handling > should handle network errors gracefully
423
+ [ToolProtectionService] API fetch failed, no fallback, failing closed (deny-all) {
424
+ agentDid: 'did:key:z6MkhaXgBZDv...',
425
+ error: 'ECONNREFUSED',
426
+ cacheKey: 'agent:did:key:z6MkhaXgBZDvotDkL5257faiztiGiC2QtKLGpbnnEGta2doK'
427
+ }
428
+
429
+
430
+  ❯ src/__tests__/cache/tool-protection-cache.test.ts 2/49
431
+  ❯ src/__tests__/runtime/base.test.ts [queued]
432
+  ❯ src/__tests__/runtime/route-interception.test.ts [queued]
433
+  ❯ src/__tests__/runtime/tool-protection-enforcement.test.ts [queued]
434
+  ❯ src/__tests__/services/agentshield-integration.test.ts 0/30
435
+  ❯ src/__tests__/services/tool-protection.service.test.ts 49/49
436
+  ❯ src/delegation/__tests__/vc-issuer.test.ts 0/21
437
+  ❯ src/delegation/__tests__/vc-verifier.test.ts 0/35
438
+  ❯ src/services/__tests__/access-control.integration.test.ts [queued]
439
+  ❯ src/services/__tests__/access-control.proof-response-validation.test.ts 1/12
440
+  ❯ src/services/__tests__/access-control.service.test.ts 23/23
441
+  ❯ src/services/__tests__/proof-verifier.integration.test.ts [queued]
442
+  ❯ src/services/__tests__/storage.service.test.ts 0/17
443
+
444
+  Test Files 2 passed (44)
445
+  Tests 75 passed (236)
446
+  Start at 01:06:38
447
+  Duration 530ms
448
+ [?2026l[?2026hstdout | src/__tests__/services/tool-protection.service.test.ts > ToolProtectionService > getToolProtectionConfig > caching behavior > should cache successful API responses
449
+ [ToolProtectionService] Config loaded from API {
450
+ source: 'api',
451
+ toolCount: 1,
452
+ protectedTools: [ 'tool1' ],
453
+ agentDid: 'did:key:z6MkhaXgBZDv...',
454
+ projectId: 'none',
455
+ cacheTtlMs: 300000,
456
+ cacheExpiresAt: '2025-11-25T07:11:38.925Z'
457
+ }
458
+
459
+ stdout | src/__tests__/services/tool-protection.service.test.ts > ToolProtectionService > getToolProtectionConfig > caching behavior > should use default cache TTL when not specified
460
+ [ToolProtectionService] Config loaded from API {
461
+ source: 'api',
462
+ toolCount: 0,
463
+ protectedTools: [],
464
+ agentDid: 'did:key:z6MkhaXgBZDv...',
465
+ projectId: 'none',
466
+ cacheTtlMs: 300000,
467
+ cacheExpiresAt: '2025-11-25T07:11:38.925Z'
468
+ }
469
+
470
+ stdout | src/__tests__/services/tool-protection.service.test.ts > ToolProtectionService > getToolProtectionConfig > caching behavior > should use custom cache TTL when specified
471
+ [ToolProtectionService] Config loaded from API {
472
+ source: 'api',
473
+ toolCount: 0,
474
+ protectedTools: [],
475
+ agentDid: 'did:key:z6MkhaXgBZDv...',
476
+ projectId: 'none',
477
+ cacheTtlMs: 600000,
478
+ cacheExpiresAt: '2025-11-25T07:16:38.925Z'
479
+ }
480
+
481
+ stdout | src/__tests__/services/tool-protection.service.test.ts > ToolProtectionService > getToolProtectionConfig > edge cases > should handle empty toolProtections object
482
+ [ToolProtectionService] Config loaded from API {
483
+ source: 'api',
484
+ toolCount: 0,
485
+ protectedTools: [],
486
+ agentDid: 'did:key:z6MkhaXgBZDv...',
487
+ projectId: 'none',
488
+ cacheTtlMs: 300000,
489
+ cacheExpiresAt: '2025-11-25T07:11:38.925Z'
490
+ }
491
+
492
+ stdout | src/__tests__/services/tool-protection.service.test.ts > ToolProtectionService > getToolProtectionConfig > edge cases > should handle null requiredScopes
493
+ [ToolProtectionService] Config loaded from API {
494
+ source: 'api',
495
+ toolCount: 1,
496
+ protectedTools: [ 'tool1' ],
497
+ agentDid: 'did:key:z6MkhaXgBZDv...',
498
+ projectId: 'none',
499
+ cacheTtlMs: 300000,
500
+ cacheExpiresAt: '2025-11-25T07:11:38.925Z'
501
+ }
502
+
503
+ stdout | src/__tests__/services/tool-protection.service.test.ts > ToolProtectionService > getToolProtectionConfig > edge cases > should handle mixed camelCase and snake_case in response
504
+ [ToolProtectionService] Config loaded from API {
505
+ source: 'api',
506
+ toolCount: 2,
507
+ protectedTools: [ 'tool1' ],
508
+ agentDid: 'did:key:z6MkhaXgBZDv...',
509
+ projectId: 'none',
510
+ cacheTtlMs: 300000,
511
+ cacheExpiresAt: '2025-11-25T07:11:38.925Z'
512
+ }
513
+
514
+ stdout | src/__tests__/services/tool-protection.service.test.ts > ToolProtectionService > checkToolProtection > should return null when tool has no protection
515
+ [ToolProtectionService] Config loaded from API {
516
+ source: 'api',
517
+ toolCount: 1,
518
+ protectedTools: [],
519
+ agentDid: 'did:key:z6MkhaXgBZDv...',
520
+ projectId: 'none',
521
+ cacheTtlMs: 300000,
522
+ cacheExpiresAt: '2025-11-25T07:11:38.929Z'
523
+ }
524
+
525
+ stdout | src/__tests__/services/tool-protection.service.test.ts > ToolProtectionService > checkToolProtection > should return null when tool is not in config
526
+ [ToolProtectionService] Config loaded from API {
527
+ source: 'api',
528
+ toolCount: 1,
529
+ protectedTools: [ 'other_tool' ],
530
+ agentDid: 'did:key:z6MkhaXgBZDv...',
531
+ projectId: 'none',
532
+ cacheTtlMs: 300000,
533
+ cacheExpiresAt: '2025-11-25T07:11:38.929Z'
534
+ }
535
+
536
+ stdout | src/__tests__/services/tool-protection.service.test.ts > ToolProtectionService > checkToolProtection > should return null when tool is not in config
537
+ [ToolProtectionService] Protection check {
538
+ tool: 'unknown_tool',
539
+ agentDid: 'did:key:z6MkhaXgBZDv...',
540
+ found: false,
541
+ isWildcard: true,
542
+ requiresDelegation: false,
543
+ availableTools: [ 'other_tool' ]
544
+ }
545
+
546
+ stdout | src/__tests__/services/tool-protection.service.test.ts > ToolProtectionService > checkToolProtection > should return wildcard protection when tool not found and wildcard exists
547
+ [ToolProtectionService] Config loaded from API {
548
+ source: 'api',
549
+ toolCount: 2,
550
+ protectedTools: [ '*' ],
551
+ agentDid: 'did:key:z6MkhaXgBZDv...',
552
+ projectId: 'none',
553
+ cacheTtlMs: 300000,
554
+ cacheExpiresAt: '2025-11-25T07:11:38.930Z'
555
+ }
556
+
557
+ stdout | src/__tests__/services/tool-protection.service.test.ts > ToolProtectionService > checkToolProtection > should return wildcard protection when tool not found and wildcard exists
558
+ [ToolProtectionService] Protection check {
559
+ tool: 'unknown_tool',
560
+ agentDid: 'did:key:z6MkhaXgBZDv...',
561
+ found: true,
562
+ isWildcard: true,
563
+ requiresDelegation: true,
564
+ availableTools: [ '*', 'specific_tool' ]
565
+ }
566
+
567
+ stdout | src/__tests__/services/tool-protection.service.test.ts > ToolProtectionService > checkToolProtection > should prioritize specific tool protection over wildcard
568
+ [ToolProtectionService] Config loaded from API {
569
+ source: 'api',
570
+ toolCount: 2,
571
+ protectedTools: [ '*' ],
572
+ agentDid: 'did:key:z6MkhaXgBZDv...',
573
+ projectId: 'none',
574
+ cacheTtlMs: 300000,
575
+ cacheExpiresAt: '2025-11-25T07:11:38.930Z'
576
+ }
577
+
578
+
579
+  ❯ src/__tests__/cache/tool-protection-cache.test.ts 2/49
580
+  ❯ src/__tests__/runtime/base.test.ts [queued]
581
+  ❯ src/__tests__/runtime/route-interception.test.ts [queued]
582
+  ❯ src/__tests__/runtime/tool-protection-enforcement.test.ts [queued]
583
+  ❯ src/__tests__/services/agentshield-integration.test.ts 0/30
584
+  ❯ src/__tests__/services/tool-protection.service.test.ts 49/49
585
+  ❯ src/delegation/__tests__/vc-issuer.test.ts 0/21
586
+  ❯ src/delegation/__tests__/vc-verifier.test.ts 0/35
587
+  ❯ src/services/__tests__/access-control.integration.test.ts [queued]
588
+  ❯ src/services/__tests__/access-control.proof-response-validation.test.ts 1/12
589
+  ❯ src/services/__tests__/access-control.service.test.ts 23/23
590
+  ❯ src/services/__tests__/proof-verifier.integration.test.ts [queued]
591
+  ❯ src/services/__tests__/storage.service.test.ts 0/17
592
+
593
+  Test Files 2 passed (44)
594
+  Tests 75 passed (236)
595
+  Start at 01:06:38
596
+  Duration 530ms
597
+ [?2026l[?2026hstderr | src/__tests__/services/tool-protection.service.test.ts > ToolProtectionService > checkToolProtection > should use wildcard protection in fail-safe deny-all mode
598
+ [ToolProtectionService] API fetch failed, no fallback, failing closed (deny-all) {
599
+ agentDid: 'did:key:z6MkhaXgBZDv...',
600
+ error: 'Network error',
601
+ cacheKey: 'agent:did:key:z6MkhaXgBZDvotDkL5257faiztiGiC2QtKLGpbnnEGta2doK'
602
+ }
603
+
604
+
605
+  ❯ src/__tests__/cache/tool-protection-cache.test.ts 2/49
606
+  ❯ src/__tests__/runtime/base.test.ts [queued]
607
+  ❯ src/__tests__/runtime/route-interception.test.ts [queued]
608
+  ❯ src/__tests__/runtime/tool-protection-enforcement.test.ts [queued]
609
+  ❯ src/__tests__/services/agentshield-integration.test.ts 0/30
610
+  ❯ src/__tests__/services/tool-protection.service.test.ts 49/49
611
+  ❯ src/delegation/__tests__/vc-issuer.test.ts 0/21
612
+  ❯ src/delegation/__tests__/vc-verifier.test.ts 0/35
613
+  ❯ src/services/__tests__/access-control.integration.test.ts [queued]
614
+  ❯ src/services/__tests__/access-control.proof-response-validation.test.ts 1/12
615
+  ❯ src/services/__tests__/access-control.service.test.ts 23/23
616
+  ❯ src/services/__tests__/proof-verifier.integration.test.ts [queued]
617
+  ❯ src/services/__tests__/storage.service.test.ts 0/17
618
+
619
+  Test Files 2 passed (44)
620
+  Tests 75 passed (236)
621
+  Start at 01:06:38
622
+  Duration 530ms
623
+ [?2026l[?2026hstdout | src/__tests__/services/tool-protection.service.test.ts > ToolProtectionService > checkToolProtection > should use wildcard protection in fail-safe deny-all mode
624
+ [ToolProtectionService] Protection check {
625
+ tool: 'any_tool',
626
+ agentDid: 'did:key:z6MkhaXgBZDv...',
627
+ found: true,
628
+ isWildcard: true,
629
+ requiresDelegation: true,
630
+ availableTools: [ '*' ]
631
+ }
632
+
633
+ stdout | src/__tests__/services/tool-protection.service.test.ts > ToolProtectionService > checkToolProtection > should return protection config when tool requires delegation
634
+ [ToolProtectionService] Config loaded from API {
635
+ source: 'api',
636
+ toolCount: 1,
637
+ protectedTools: [ 'protected_tool' ],
638
+ agentDid: 'did:key:z6MkhaXgBZDv...',
639
+ projectId: 'none',
640
+ cacheTtlMs: 300000,
641
+ cacheExpiresAt: '2025-11-25T07:11:38.930Z'
642
+ }
643
+
644
+ stdout | src/__tests__/services/tool-protection.service.test.ts > ToolProtectionService > checkToolProtection > should return protection config when tool requires delegation
645
+ [ToolProtectionService] Protection check {
646
+ tool: 'protected_tool',
647
+ agentDid: 'did:key:z6MkhaXgBZDv...',
648
+ found: true,
649
+ isWildcard: false,
650
+ requiresDelegation: true,
651
+ availableTools: [ 'protected_tool' ]
652
+ }
653
+
654
+ stdout | src/__tests__/services/tool-protection.service.test.ts > ToolProtectionService > integration with NoOpToolProtectionCache > should work with NoOpToolProtectionCache
655
+ [ToolProtectionService] Config loaded from API {
656
+ source: 'api',
657
+ toolCount: 1,
658
+ protectedTools: [ 'tool1' ],
659
+ agentDid: 'did:key:z6MkhaXgBZDv...',
660
+ projectId: 'none',
661
+ cacheTtlMs: 300000,
662
+ cacheExpiresAt: '2025-11-25T07:11:38.931Z'
663
+ }
664
+
665
+ stdout | src/__tests__/services/tool-protection.service.test.ts > ToolProtectionService > integration with NoOpToolProtectionCache > should work with NoOpToolProtectionCache
666
+ [ToolProtectionService] Config loaded from API {
667
+ source: 'api',
668
+ toolCount: 1,
669
+ protectedTools: [ 'tool1' ],
670
+ agentDid: 'did:key:z6MkhaXgBZDv...',
671
+ projectId: 'none',
672
+ cacheTtlMs: 300000,
673
+ cacheExpiresAt: '2025-11-25T07:11:38.931Z'
674
+ }
675
+
676
+
677
+  ❯ src/__tests__/cache/tool-protection-cache.test.ts 2/49
678
+  ❯ src/__tests__/runtime/base.test.ts [queued]
679
+  ❯ src/__tests__/runtime/route-interception.test.ts [queued]
680
+  ❯ src/__tests__/runtime/tool-protection-enforcement.test.ts [queued]
681
+  ❯ src/__tests__/services/agentshield-integration.test.ts 0/30
682
+  ❯ src/__tests__/services/tool-protection.service.test.ts 49/49
683
+  ❯ src/delegation/__tests__/vc-issuer.test.ts 0/21
684
+  ❯ src/delegation/__tests__/vc-verifier.test.ts 0/35
685
+  ❯ src/services/__tests__/access-control.integration.test.ts [queued]
686
+  ❯ src/services/__tests__/access-control.proof-response-validation.test.ts 1/12
687
+  ❯ src/services/__tests__/access-control.service.test.ts 23/23
688
+  ❯ src/services/__tests__/proof-verifier.integration.test.ts [queued]
689
+  ❯ src/services/__tests__/storage.service.test.ts 0/17
690
+
691
+  Test Files 2 passed (44)
692
+  Tests 75 passed (236)
693
+  Start at 01:06:38
694
+  Duration 530ms
695
+ [?2026l[?2026hstderr | src/services/__tests__/access-control.service.test.ts > AccessControlApiService > submitProofs > should submit proofs successfully
696
+ [AccessControl] 🔍 RAW API RESPONSE (before parsing): {
697
+ correlationId: '1f3824df-b8b0-4dd4-b72c-dc64be03f626',
698
+ status: 200,
699
+ statusText: '',
700
+ headers: { 'content-type': 'application/json' },
701
+ responseTextLength: 100,
702
+ responseTextPreview: '{"success":true,"accepted":1,"rejected":0,"outcomes":{"success":1,"failed":0,"blocked":0,"error":0}}',
703
+ fullResponseText: '{"success":true,"accepted":1,"rejected":0,"outcomes":{"success":1,"failed":0,"blocked":0,"error":0}}'
704
+ }
705
+ [AccessControl] 🔍 PARSED RESPONSE DATA: {
706
+ correlationId: '1f3824df-b8b0-4dd4-b72c-dc64be03f626',
707
+ status: 200,
708
+ responseDataType: 'object',
709
+ responseDataKeys: [ 'success', 'accepted', 'rejected', 'outcomes' ],
710
+ responseData: '{\n' +
711
+ ' "success": true,\n' +
712
+ ' "accepted": 1,\n' +
713
+ ' "rejected": 0,\n' +
714
+ ' "outcomes": {\n' +
715
+ ' "success": 1,\n' +
716
+ ' "failed": 0,\n' +
717
+ ' "blocked": 0,\n' +
718
+ ' "error": 0\n' +
719
+ ' }\n' +
720
+ '}'
721
+ }
722
+ [AccessControl] Raw response received: {
723
+ "success": true,
724
+ "accepted": 1,
725
+ "rejected": 0,
726
+ "outcomes": {
727
+ "success": 1,
728
+ "failed": 0,
729
+ "blocked": 0,
730
+ "error": 0
731
+ }
732
+ }
733
+
734
+ stderr | src/services/__tests__/access-control.service.test.ts > AccessControlApiService > submitProofs > should handle all_proofs_rejected error gracefully
735
+ [AccessControl] 🔍 RAW API RESPONSE (before parsing): {
736
+ correlationId: 'c266d84a-aca7-4503-ba92-aafcef512da7',
737
+ status: 400,
738
+ statusText: '',
739
+ headers: { 'content-type': 'application/json' },
740
+ responseTextLength: 209,
741
+ 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"}}]}}}',
742
+ 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"}}]}}}'
743
+ }
744
+ [AccessControl] 🔍 PARSED RESPONSE DATA: {
745
+ correlationId: 'c266d84a-aca7-4503-ba92-aafcef512da7',
746
+ status: 400,
747
+ responseDataType: 'object',
748
+ responseDataKeys: [ 'success', 'error' ],
749
+ responseData: '{\n' +
750
+ ' "success": false,\n' +
751
+ ' "error": {\n' +
752
+ ' "code": "all_proofs_rejected",\n' +
753
+ ' "message": "All proofs rejected",\n' +
754
+ ' "details": {\n' +
755
+ ' "rejected": 1,\n' +
756
+ ' "errors": [\n' +
757
+ ' {\n' +
758
+ ' "proof_index": 0,\n' +
759
+ ' "error": {\n' +
760
+ ' "code": "invalid_signature",\n' +
761
+ ' "message": "Invalid signature"\n' +
762
+ ' }\n' +
763
+ ' }\n' +
764
+ ' ]\n' +
765
+ ' }\n' +
766
+ ' }\n' +
767
+ '}'
768
+ }
769
+
770
+ stderr | src/services/__tests__/access-control.service.test.ts > AccessControlApiService > submitProofs > should handle wrapped response format
771
+ [AccessControl] 🔍 RAW API RESPONSE (before parsing): {
772
+ correlationId: 'ef86469f-27ec-4fa3-9c49-020e7e5f5062',
773
+ status: 200,
774
+ statusText: '',
775
+ headers: { 'content-type': 'application/json' },
776
+ responseTextLength: 206,
777
+ 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-25T07:06:38.928Z"}}',
778
+ 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-25T07:06:38.928Z"}}'
779
+ }
780
+ [AccessControl] 🔍 PARSED RESPONSE DATA: {
781
+ correlationId: 'ef86469f-27ec-4fa3-9c49-020e7e5f5062',
782
+ status: 200,
783
+ responseDataType: 'object',
784
+ responseDataKeys: [ 'success', 'data', 'metadata' ],
785
+ responseData: '{\n' +
786
+ ' "success": true,\n' +
787
+ ' "data": {\n' +
788
+ ' "success": true,\n' +
789
+ ' "accepted": 1,\n' +
790
+ ' "rejected": 0,\n' +
791
+ ' "outcomes": {\n' +
792
+ ' "success": 1,\n' +
793
+ ' "failed": 0,\n' +
794
+ ' "blocked": 0,\n' +
795
+ ' "error": 0\n' +
796
+ ' }\n' +
797
+ ' },\n' +
798
+ ' "metadata": {\n' +
799
+ ' "requestId": "test-request-id",\n' +
800
+ ' "timestamp": "2025-11-25T07:06:38.928Z"\n' +
801
+ ' }\n' +
802
+ '}'
803
+ }
804
+ [AccessControl] Raw response received: {
805
+ "success": true,
806
+ "data": {
807
+ "success": true,
808
+ "accepted": 1,
809
+ "rejected": 0,
810
+ "outcomes": {
811
+ "success": 1,
812
+ "failed": 0,
813
+ "blocked": 0,
814
+ "error": 0
815
+ }
816
+ },
817
+ "metadata": {
818
+ "requestId": "test-request-id",
819
+ "timestamp": "2025-11-25T07:06:38.928Z"
820
+ }
821
+ }
822
+ [AccessControl] 🔍 DATA OBJECT STRUCTURE (after deep clone): {
823
+ correlationId: 'ef86469f-27ec-4fa3-9c49-020e7e5f5062',
824
+ dataKeys: [ 'success', 'accepted', 'rejected', 'outcomes' ],
825
+ hasAccepted: true,
826
+ hasRejected: true,
827
+ hasOutcomes: true,
828
+ hasErrors: false,
829
+ acceptedType: 'number',
830
+ acceptedValue: 1,
831
+ rejectedType: 'number',
832
+ rejectedValue: 0,
833
+ outcomesType: 'object',
834
+ outcomesValue: { success: 1, failed: 0, blocked: 0, error: 0 },
835
+ errorsType: 'undefined',
836
+ errorsIsArray: false,
837
+ fullData: '{\n' +
838
+ ' "success": true,\n' +
839
+ ' "accepted": 1,\n' +
840
+ ' "rejected": 0,\n' +
841
+ ' "outcomes": {\n' +
842
+ ' "success": 1,\n' +
843
+ ' "failed": 0,\n' +
844
+ ' "blocked": 0,\n' +
845
+ ' "error": 0\n' +
846
+ ' }\n' +
847
+ '}'
848
+ }
849
+ [AccessControl] 🔍 VALIDATING DATA WITH SUCCESS: {
850
+ correlationId: 'ef86469f-27ec-4fa3-9c49-020e7e5f5062',
851
+ dataWithSuccessKeys: [ 'success', 'accepted', 'rejected', 'outcomes' ],
852
+ hasSuccess: true,
853
+ successValue: true,
854
+ hasAccepted: true,
855
+ acceptedValue: 1,
856
+ hasRejected: true,
857
+ rejectedValue: 0,
858
+ hasOutcomes: true,
859
+ outcomesValue: { success: 1, failed: 0, blocked: 0, error: 0 },
860
+ fullDataWithSuccess: '{\n' +
861
+ ' "success": true,\n' +
862
+ ' "accepted": 1,\n' +
863
+ ' "rejected": 0,\n' +
864
+ ' "outcomes": {\n' +
865
+ ' "success": 1,\n' +
866
+ ' "failed": 0,\n' +
867
+ ' "blocked": 0,\n' +
868
+ ' "error": 0\n' +
869
+ ' }\n' +
870
+ '}'
871
+ }
872
+
873
+ stderr | src/services/__tests__/access-control.service.test.ts > AccessControlApiService > submitProofs > should handle response with missing outcomes field (outcomes is optional)
874
+ [AccessControl] 🔍 RAW API RESPONSE (before parsing): {
875
+ correlationId: '1e8fc168-26dd-488f-8522-f0ccc29a8d5f',
876
+ status: 200,
877
+ statusText: '',
878
+ headers: { 'content-type': 'application/json' },
879
+ responseTextLength: 42,
880
+ responseTextPreview: '{"success":true,"accepted":1,"rejected":0}',
881
+ fullResponseText: '{"success":true,"accepted":1,"rejected":0}'
882
+ }
883
+ [AccessControl] 🔍 PARSED RESPONSE DATA: {
884
+ correlationId: '1e8fc168-26dd-488f-8522-f0ccc29a8d5f',
885
+ status: 200,
886
+ responseDataType: 'object',
887
+ responseDataKeys: [ 'success', 'accepted', 'rejected' ],
888
+ responseData: '{\n "success": true,\n "accepted": 1,\n "rejected": 0\n}'
889
+ }
890
+ [AccessControl] Raw response received: {
891
+ "success": true,
892
+ "accepted": 1,
893
+ "rejected": 0
894
+ }
895
+
896
+ stderr | src/services/__tests__/access-control.service.test.ts > AccessControlApiService > submitProofs > should handle response with missing outcomes field (outcomes is optional)
897
+ [AccessControl] 🔍 RAW API RESPONSE (before parsing): {
898
+ correlationId: 'bbb932c4-61a1-4777-a51c-461b01cbf650',
899
+ status: 200,
900
+ statusText: '',
901
+ headers: { 'content-type': 'application/json' },
902
+ responseTextLength: 100,
903
+ responseTextPreview: '{"success":true,"accepted":1,"rejected":0,"outcomes":{"success":1,"failed":0,"blocked":0,"error":0}}',
904
+ fullResponseText: '{"success":true,"accepted":1,"rejected":0,"outcomes":{"success":1,"failed":0,"blocked":0,"error":0}}'
905
+ }
906
+ [AccessControl] 🔍 PARSED RESPONSE DATA: {
907
+ correlationId: 'bbb932c4-61a1-4777-a51c-461b01cbf650',
908
+ status: 200,
909
+ responseDataType: 'object',
910
+ responseDataKeys: [ 'success', 'accepted', 'rejected', 'outcomes' ],
911
+ responseData: '{\n' +
912
+ ' "success": true,\n' +
913
+ ' "accepted": 1,\n' +
914
+ ' "rejected": 0,\n' +
915
+ ' "outcomes": {\n' +
916
+ ' "success": 1,\n' +
917
+ ' "failed": 0,\n' +
918
+ ' "blocked": 0,\n' +
919
+ ' "error": 0\n' +
920
+ ' }\n' +
921
+ '}'
922
+ }
923
+ [AccessControl] Raw response received: {
924
+ "success": true,
925
+ "accepted": 1,
926
+ "rejected": 0,
927
+ "outcomes": {
928
+ "success": 1,
929
+ "failed": 0,
930
+ "blocked": 0,
931
+ "error": 0
932
+ }
933
+ }
934
+
935
+ stderr | src/services/__tests__/access-control.service.test.ts > AccessControlApiService > submitProofs > should handle response with missing outcomes field (outcomes is optional)
936
+ [AccessControl] 🔍 RAW API RESPONSE (before parsing): {
937
+ correlationId: 'fc4a91ea-dc5c-4a8c-8637-0bd0baddbfe2',
938
+ status: 200,
939
+ statusText: '',
940
+ headers: { 'content-type': 'application/json' },
941
+ responseTextLength: 56,
942
+ responseTextPreview: '{"success":true,"accepted":1,"rejected":0,"outcomes":{}}',
943
+ fullResponseText: '{"success":true,"accepted":1,"rejected":0,"outcomes":{}}'
944
+ }
945
+ [AccessControl] 🔍 PARSED RESPONSE DATA: {
946
+ correlationId: 'fc4a91ea-dc5c-4a8c-8637-0bd0baddbfe2',
947
+ status: 200,
948
+ responseDataType: 'object',
949
+ responseDataKeys: [ 'success', 'accepted', 'rejected', 'outcomes' ],
950
+ responseData: '{\n "success": true,\n "accepted": 1,\n "rejected": 0,\n "outcomes": {}\n}'
951
+ }
952
+ [AccessControl] Raw response received: {
953
+ "success": true,
954
+ "accepted": 1,
955
+ "rejected": 0,
956
+ "outcomes": {}
957
+ }
958
+
959
+ stderr | src/services/__tests__/access-control.service.test.ts > AccessControlApiService > submitProofs > should handle wrapped response with invalid data structure
960
+ [AccessControl] 🔍 RAW API RESPONSE (before parsing): {
961
+ correlationId: '349702f9-d6c6-4e34-b3ab-557933c40fa0',
962
+ status: 200,
963
+ statusText: '',
964
+ headers: { 'content-type': 'application/json' },
965
+ responseTextLength: 52,
966
+ responseTextPreview: '{"success":true,"data":{"message":"Invalid format"}}',
967
+ fullResponseText: '{"success":true,"data":{"message":"Invalid format"}}'
968
+ }
969
+ [AccessControl] 🔍 PARSED RESPONSE DATA: {
970
+ correlationId: '349702f9-d6c6-4e34-b3ab-557933c40fa0',
971
+ status: 200,
972
+ responseDataType: 'object',
973
+ responseDataKeys: [ 'success', 'data' ],
974
+ responseData: '{\n "success": true,\n "data": {\n "message": "Invalid format"\n }\n}'
975
+ }
976
+ [AccessControl] Raw response received: {
977
+ "success": true,
978
+ "data": {
979
+ "message": "Invalid format"
980
+ }
981
+ }
982
+ [AccessControl] 🔍 DATA OBJECT STRUCTURE (after deep clone): {
983
+ correlationId: '349702f9-d6c6-4e34-b3ab-557933c40fa0',
984
+ dataKeys: [ 'message' ],
985
+ hasAccepted: false,
986
+ hasRejected: false,
987
+ hasOutcomes: false,
988
+ hasErrors: false,
989
+ acceptedType: 'undefined',
990
+ acceptedValue: undefined,
991
+ rejectedType: 'undefined',
992
+ rejectedValue: undefined,
993
+ outcomesType: 'undefined',
994
+ outcomesValue: undefined,
995
+ errorsType: 'undefined',
996
+ errorsIsArray: false,
997
+ fullData: '{\n "message": "Invalid format"\n}'
998
+ }
999
+ [AccessControl] 🔍 VALIDATING DATA WITH SUCCESS: {
1000
+ correlationId: '349702f9-d6c6-4e34-b3ab-557933c40fa0',
1001
+ dataWithSuccessKeys: [ 'success', 'accepted', 'rejected' ],
1002
+ hasSuccess: true,
1003
+ successValue: true,
1004
+ hasAccepted: true,
1005
+ acceptedValue: undefined,
1006
+ hasRejected: true,
1007
+ rejectedValue: undefined,
1008
+ hasOutcomes: false,
1009
+ outcomesValue: undefined,
1010
+ fullDataWithSuccess: '{\n "success": true\n}'
1011
+ }
1012
+ [AccessControl] ❌ MISSING REQUIRED FIELDS AFTER CONSTRUCTION: {
1013
+ correlationId: '349702f9-d6c6-4e34-b3ab-557933c40fa0',
1014
+ hasAccepted: true,
1015
+ acceptedType: 'undefined',
1016
+ acceptedValue: undefined,
1017
+ hasRejected: true,
1018
+ rejectedType: 'undefined',
1019
+ rejectedValue: undefined,
1020
+ dataWithSuccessKeys: [ 'success', 'accepted', 'rejected' ],
1021
+ fullDataWithSuccess: '{\n "success": true\n}',
1022
+ dataToValidateKeys: [ 'message' ],
1023
+ fullDataToValidate: '{\n "message": "Invalid format"\n}',
1024
+ originalResponseData: '{\n "success": true,\n "data": {\n "message": "Invalid format"\n }\n}'
1025
+ }
1026
+
1027
+ 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
1028
+ [AccessControl] 🔍 RAW API RESPONSE (before parsing): {
1029
+ correlationId: '02bbd300-e173-41aa-86a8-c4f29a3c56b4',
1030
+ status: 200,
1031
+ statusText: undefined,
1032
+ headers: {},
1033
+ responseTextLength: 191,
1034
+ 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-25T07:06:38.943Z"}}',
1035
+ 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-25T07:06:38.943Z"}}'
1036
+ }
1037
+ [AccessControl] 🔍 PARSED RESPONSE DATA: {
1038
+ correlationId: '02bbd300-e173-41aa-86a8-c4f29a3c56b4',
1039
+ status: 200,
1040
+ responseDataType: 'object',
1041
+ responseDataKeys: [ 'success', 'data', 'metadata' ],
1042
+ responseData: '{\n' +
1043
+ ' "success": true,\n' +
1044
+ ' "data": {\n' +
1045
+ ' "accepted": 1,\n' +
1046
+ ' "rejected": 0,\n' +
1047
+ ' "outcomes": {\n' +
1048
+ ' "success": 1,\n' +
1049
+ ' "failed": 0,\n' +
1050
+ ' "blocked": 0,\n' +
1051
+ ' "error": 0\n' +
1052
+ ' }\n' +
1053
+ ' },\n' +
1054
+ ' "metadata": {\n' +
1055
+ ' "requestId": "test-request-id",\n' +
1056
+ ' "timestamp": "2025-11-25T07:06:38.943Z"\n' +
1057
+ ' }\n' +
1058
+ '}'
1059
+ }
1060
+ [AccessControl] Raw response received: {
1061
+ "success": true,
1062
+ "data": {
1063
+ "accepted": 1,
1064
+ "rejected": 0,
1065
+ "outcomes": {
1066
+ "success": 1,
1067
+ "failed": 0,
1068
+ "blocked": 0,
1069
+ "error": 0
1070
+ }
1071
+ },
1072
+ "metadata": {
1073
+ "requestId": "test-request-id",
1074
+ "timestamp": "2025-11-25T07:06:38.943Z"
1075
+ }
1076
+ }
1077
+ [AccessControl] 🔍 DATA OBJECT STRUCTURE (after deep clone): {
1078
+ correlationId: '02bbd300-e173-41aa-86a8-c4f29a3c56b4',
1079
+ dataKeys: [ 'accepted', 'rejected', 'outcomes' ],
1080
+ hasAccepted: true,
1081
+ hasRejected: true,
1082
+ hasOutcomes: true,
1083
+ hasErrors: false,
1084
+ acceptedType: 'number',
1085
+ acceptedValue: 1,
1086
+ rejectedType: 'number',
1087
+ rejectedValue: 0,
1088
+ outcomesType: 'object',
1089
+ outcomesValue: { success: 1, failed: 0, blocked: 0, error: 0 },
1090
+ errorsType: 'undefined',
1091
+ errorsIsArray: false,
1092
+ fullData: '{\n' +
1093
+ ' "accepted": 1,\n' +
1094
+ ' "rejected": 0,\n' +
1095
+ ' "outcomes": {\n' +
1096
+ ' "success": 1,\n' +
1097
+ ' "failed": 0,\n' +
1098
+ ' "blocked": 0,\n' +
1099
+ ' "error": 0\n' +
1100
+ ' }\n' +
1101
+ '}'
1102
+ }
1103
+ [AccessControl] 🔍 VALIDATING DATA WITH SUCCESS: {
1104
+ correlationId: '02bbd300-e173-41aa-86a8-c4f29a3c56b4',
1105
+ dataWithSuccessKeys: [ 'success', 'accepted', 'rejected', 'outcomes' ],
1106
+ hasSuccess: true,
1107
+ successValue: true,
1108
+ hasAccepted: true,
1109
+ acceptedValue: 1,
1110
+ hasRejected: true,
1111
+ rejectedValue: 0,
1112
+ hasOutcomes: true,
1113
+ outcomesValue: { success: 1, failed: 0, blocked: 0, error: 0 },
1114
+ fullDataWithSuccess: '{\n' +
1115
+ ' "success": true,\n' +
1116
+ ' "accepted": 1,\n' +
1117
+ ' "rejected": 0,\n' +
1118
+ ' "outcomes": {\n' +
1119
+ ' "success": 1,\n' +
1120
+ ' "failed": 0,\n' +
1121
+ ' "blocked": 0,\n' +
1122
+ ' "error": 0\n' +
1123
+ ' }\n' +
1124
+ '}'
1125
+ }
1126
+
1127
+ 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
1128
+ [AccessControl] 🔍 RAW API RESPONSE (before parsing): {
1129
+ correlationId: 'c767aad0-4c12-4586-8025-0617fb71d28a',
1130
+ status: 200,
1131
+ statusText: undefined,
1132
+ headers: {},
1133
+ responseTextLength: 333,
1134
+ 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-25T07:06:38.965Z"}}',
1135
+ 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-25T07:06:38.965Z"}}'
1136
+ }
1137
+ [AccessControl] 🔍 PARSED RESPONSE DATA: {
1138
+ correlationId: 'c767aad0-4c12-4586-8025-0617fb71d28a',
1139
+ status: 200,
1140
+ responseDataType: 'object',
1141
+ responseDataKeys: [ 'success', 'data', 'metadata' ],
1142
+ responseData: '{\n' +
1143
+ ' "success": true,\n' +
1144
+ ' "data": {\n' +
1145
+ ' "accepted": 0,\n' +
1146
+ ' "rejected": 1,\n' +
1147
+ ' "outcomes": {\n' +
1148
+ ' "success": 0,\n' +
1149
+ ' "failed": 1,\n' +
1150
+ ' "blocked": 0,\n' +
1151
+ ' "error": 0\n' +
1152
+ ' },\n' +
1153
+ ' "errors": [\n' +
1154
+ ' {\n' +
1155
+ ' "proof_index": 0,\n' +
1156
+ ' "error": {\n' +
1157
+ ' "code": "validation_error",\n' +
1158
+ ' "message": "Proof validation failed",\n' +
1159
+ ' "details": {\n' +
1160
+ ' "reason": "invalid_signature"\n' +
1161
+ ' }\n' +
1162
+ ' }\n' +
1163
+ ' }\n' +
1164
+ ' ]\n' +
1165
+ ' },\n' +
1166
+ ' "metadata": {\n' +
1167
+ ' "requestId": "test-request-id",\n' +
1168
+ ' "timestamp": "2025-11-25T07:06:38.965Z"\n' +
1169
+ ' }\n' +
1170
+ '}'
1171
+ }
1172
+ [AccessControl] Raw response received: {
1173
+ "success": true,
1174
+ "data": {
1175
+ "accepted": 0,
1176
+ "rejected": 1,
1177
+ "outcomes": {
1178
+ "success": 0,
1179
+ "failed": 1,
1180
+ "blocked": 0,
1181
+ "error": 0
1182
+ },
1183
+ "errors": [
1184
+ {
1185
+ "proof_index": 0,
1186
+ "error": {
1187
+ "code": "validation_error",
1188
+ "message": "Proof validation failed",
1189
+ "details": {
1190
+ "reason": "invalid_signature"
1191
+ }
1192
+ }
1193
+ }
1194
+ ]
1195
+ },
1196
+ "metadata": {
1197
+ "requestId": "test-request-id",
1198
+ "timestamp": "2025-11-25T07:06:38.965Z"
1199
+ }
1200
+ }
1201
+ [AccessControl] 🔍 DATA OBJECT STRUCTURE (after deep clone): {
1202
+ correlationId: 'c767aad0-4c12-4586-8025-0617fb71d28a',
1203
+ dataKeys: [ 'accepted', 'rejected', 'outcomes', 'errors' ],
1204
+ hasAccepted: true,
1205
+ hasRejected: true,
1206
+ hasOutcomes: true,
1207
+ hasErrors: true,
1208
+ acceptedType: 'number',
1209
+ acceptedValue: 0,
1210
+ rejectedType: 'number',
1211
+ rejectedValue: 1,
1212
+ outcomesType: 'object',
1213
+ outcomesValue: { success: 0, failed: 1, blocked: 0, error: 0 },
1214
+ errorsType: 'object',
1215
+ errorsIsArray: true,
1216
+ fullData: '{\n' +
1217
+ ' "accepted": 0,\n' +
1218
+ ' "rejected": 1,\n' +
1219
+ ' "outcomes": {\n' +
1220
+ ' "success": 0,\n' +
1221
+ ' "failed": 1,\n' +
1222
+ ' "blocked": 0,\n' +
1223
+ ' "error": 0\n' +
1224
+ ' },\n' +
1225
+ ' "errors": [\n' +
1226
+ ' {\n' +
1227
+ ' "proof_index": 0,\n' +
1228
+ ' "error": {\n' +
1229
+ ' "code": "validation_error",\n' +
1230
+ ' "message": "Proof validation failed",\n' +
1231
+ ' "details": {\n' +
1232
+ ' "reason": "invalid_signature"\n' +
1233
+ ' }\n' +
1234
+ ' }\n' +
1235
+ ' }\n' +
1236
+ ' ]\n' +
1237
+ '}'
1238
+ }
1239
+ [AccessControl] 🔍 VALIDATING DATA WITH SUCCESS: {
1240
+ correlationId: 'c767aad0-4c12-4586-8025-0617fb71d28a',
1241
+ dataWithSuccessKeys: [ 'success', 'accepted', 'rejected', 'outcomes', 'errors' ],
1242
+ hasSuccess: true,
1243
+ successValue: true,
1244
+ hasAccepted: true,
1245
+ acceptedValue: 0,
1246
+ hasRejected: true,
1247
+ rejectedValue: 1,
1248
+ hasOutcomes: true,
1249
+ outcomesValue: { success: 0, failed: 1, blocked: 0, error: 0 },
1250
+ fullDataWithSuccess: '{\n' +
1251
+ ' "success": true,\n' +
1252
+ ' "accepted": 0,\n' +
1253
+ ' "rejected": 1,\n' +
1254
+ ' "outcomes": {\n' +
1255
+ ' "success": 0,\n' +
1256
+ ' "failed": 1,\n' +
1257
+ ' "blocked": 0,\n' +
1258
+ ' "error": 0\n' +
1259
+ ' },\n' +
1260
+ ' "errors": [\n' +
1261
+ ' {\n' +
1262
+ ' "proof_index": 0,\n' +
1263
+ ' "error": {\n' +
1264
+ ' "code": "validation_error",\n' +
1265
+ ' "message": "Proof validation failed",\n' +
1266
+ ' "details": {\n' +
1267
+ ' "reason": "invalid_signature"\n' +
1268
+ ' }\n' +
1269
+ ' }\n' +
1270
+ ' }\n' +
1271
+ ' ]\n' +
1272
+ '}'
1273
+ }
1274
+
1275
+
1276
+  ❯ src/__tests__/cache/tool-protection-cache.test.ts 2/49
1277
+  ❯ src/__tests__/runtime/base.test.ts [queued]
1278
+  ❯ src/__tests__/runtime/route-interception.test.ts [queued]
1279
+  ❯ src/__tests__/runtime/tool-protection-enforcement.test.ts [queued]
1280
+  ❯ src/__tests__/services/agentshield-integration.test.ts 0/30
1281
+  ❯ src/__tests__/services/tool-protection.service.test.ts 49/49
1282
+  ❯ src/delegation/__tests__/vc-issuer.test.ts 0/21
1283
+  ❯ src/delegation/__tests__/vc-verifier.test.ts 0/35
1284
+  ❯ src/services/__tests__/access-control.integration.test.ts [queued]
1285
+  ❯ src/services/__tests__/access-control.proof-response-validation.test.ts 1/12
1286
+  ❯ src/services/__tests__/access-control.service.test.ts 23/23
1287
+  ❯ src/services/__tests__/proof-verifier.integration.test.ts [queued]
1288
+  ❯ src/services/__tests__/storage.service.test.ts 0/17
1289
+
1290
+  Test Files 2 passed (44)
1291
+  Tests 75 passed (236)
1292
+  Start at 01:06:38
1293
+  Duration 530ms
1294
+ [?2026l[?2026h ✓ src/services/__tests__/access-control.service.test.ts (23 tests) 48ms
1295
+ ✓ src/__tests__/services/tool-protection.service.test.ts (49 tests) 29ms
1296
+
1297
+  ❯ src/__tests__/cache/tool-protection-cache.test.ts 2/49
1298
+  ❯ src/__tests__/runtime/base.test.ts [queued]
1299
+  ❯ src/__tests__/runtime/route-interception.test.ts [queued]
1300
+  ❯ src/__tests__/runtime/tool-protection-enforcement.test.ts [queued]
1301
+  ❯ src/__tests__/services/agentshield-integration.test.ts 0/30
1302
+  ❯ src/__tests__/services/tool-protection.service.test.ts 49/49
1303
+  ❯ src/delegation/__tests__/vc-issuer.test.ts 0/21
1304
+  ❯ src/delegation/__tests__/vc-verifier.test.ts 0/35
1305
+  ❯ src/services/__tests__/access-control.integration.test.ts [queued]
1306
+  ❯ src/services/__tests__/access-control.proof-response-validation.test.ts 1/12
1307
+  ❯ src/services/__tests__/access-control.service.test.ts 23/23
1308
+  ❯ src/services/__tests__/proof-verifier.integration.test.ts [queued]
1309
+  ❯ src/services/__tests__/storage.service.test.ts 0/17
1310
+
1311
+  Test Files 2 passed (44)
1312
+  Tests 75 passed (236)
1313
+  Start at 01:06:38
1314
+  Duration 530ms
1315
+ [?2026l[?2026hstderr | 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)
1316
+ [AccessControl] 🔍 RAW API RESPONSE (before parsing): {
1317
+ correlationId: '3c3bdff1-ed1c-4a27-8892-28aa58dbf3a9',
1318
+ status: 200,
1319
+ statusText: undefined,
1320
+ headers: {},
1321
+ responseTextLength: 133,
1322
+ responseTextPreview: '{"success":true,"data":{"accepted":1,"rejected":0},"metadata":{"requestId":"test-request-id","timestamp":"2025-11-25T07:06:38.966Z"}}',
1323
+ fullResponseText: '{"success":true,"data":{"accepted":1,"rejected":0},"metadata":{"requestId":"test-request-id","timestamp":"2025-11-25T07:06:38.966Z"}}'
1324
+ }
1325
+ [AccessControl] 🔍 PARSED RESPONSE DATA: {
1326
+ correlationId: '3c3bdff1-ed1c-4a27-8892-28aa58dbf3a9',
1327
+ status: 200,
1328
+ responseDataType: 'object',
1329
+ responseDataKeys: [ 'success', 'data', 'metadata' ],
1330
+ responseData: '{\n' +
1331
+ ' "success": true,\n' +
1332
+ ' "data": {\n' +
1333
+ ' "accepted": 1,\n' +
1334
+ ' "rejected": 0\n' +
1335
+ ' },\n' +
1336
+ ' "metadata": {\n' +
1337
+ ' "requestId": "test-request-id",\n' +
1338
+ ' "timestamp": "2025-11-25T07:06:38.966Z"\n' +
1339
+ ' }\n' +
1340
+ '}'
1341
+ }
1342
+ [AccessControl] Raw response received: {
1343
+ "success": true,
1344
+ "data": {
1345
+ "accepted": 1,
1346
+ "rejected": 0
1347
+ },
1348
+ "metadata": {
1349
+ "requestId": "test-request-id",
1350
+ "timestamp": "2025-11-25T07:06:38.966Z"
1351
+ }
1352
+ }
1353
+ [AccessControl] 🔍 DATA OBJECT STRUCTURE (after deep clone): {
1354
+ correlationId: '3c3bdff1-ed1c-4a27-8892-28aa58dbf3a9',
1355
+ dataKeys: [ 'accepted', 'rejected' ],
1356
+ hasAccepted: true,
1357
+ hasRejected: true,
1358
+ hasOutcomes: false,
1359
+ hasErrors: false,
1360
+ acceptedType: 'number',
1361
+ acceptedValue: 1,
1362
+ rejectedType: 'number',
1363
+ rejectedValue: 0,
1364
+ outcomesType: 'undefined',
1365
+ outcomesValue: undefined,
1366
+ errorsType: 'undefined',
1367
+ errorsIsArray: false,
1368
+ fullData: '{\n "accepted": 1,\n "rejected": 0\n}'
1369
+ }
1370
+ [AccessControl] 🔍 VALIDATING DATA WITH SUCCESS: {
1371
+ correlationId: '3c3bdff1-ed1c-4a27-8892-28aa58dbf3a9',
1372
+ dataWithSuccessKeys: [ 'success', 'accepted', 'rejected' ],
1373
+ hasSuccess: true,
1374
+ successValue: true,
1375
+ hasAccepted: true,
1376
+ acceptedValue: 1,
1377
+ hasRejected: true,
1378
+ rejectedValue: 0,
1379
+ hasOutcomes: false,
1380
+ outcomesValue: undefined,
1381
+ fullDataWithSuccess: '{\n "success": true,\n "accepted": 1,\n "rejected": 0\n}'
1382
+ }
1383
+
1384
+ 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
1385
+ [AccessControl] 🔍 RAW API RESPONSE (before parsing): {
1386
+ correlationId: '11f8c0d3-850b-4ec5-a094-f54907a62637',
1387
+ status: 200,
1388
+ statusText: undefined,
1389
+ headers: {},
1390
+ responseTextLength: 191,
1391
+ 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-25T07:06:38.967Z"}}',
1392
+ 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-25T07:06:38.967Z"}}'
1393
+ }
1394
+ [AccessControl] 🔍 PARSED RESPONSE DATA: {
1395
+ correlationId: '11f8c0d3-850b-4ec5-a094-f54907a62637',
1396
+ status: 200,
1397
+ responseDataType: 'object',
1398
+ responseDataKeys: [ 'success', 'data', 'metadata' ],
1399
+ responseData: '{\n' +
1400
+ ' "success": true,\n' +
1401
+ ' "data": {\n' +
1402
+ ' "accepted": 1,\n' +
1403
+ ' "rejected": 0,\n' +
1404
+ ' "outcomes": {\n' +
1405
+ ' "success": 1,\n' +
1406
+ ' "failed": 0,\n' +
1407
+ ' "blocked": 0,\n' +
1408
+ ' "error": 0\n' +
1409
+ ' }\n' +
1410
+ ' },\n' +
1411
+ ' "metadata": {\n' +
1412
+ ' "requestId": "test-request-id",\n' +
1413
+ ' "timestamp": "2025-11-25T07:06:38.967Z"\n' +
1414
+ ' }\n' +
1415
+ '}'
1416
+ }
1417
+ [AccessControl] Raw response received: {
1418
+ "success": true,
1419
+ "data": {
1420
+ "accepted": 1,
1421
+ "rejected": 0,
1422
+ "outcomes": {
1423
+ "success": 1,
1424
+ "failed": 0,
1425
+ "blocked": 0,
1426
+ "error": 0
1427
+ }
1428
+ },
1429
+ "metadata": {
1430
+ "requestId": "test-request-id",
1431
+ "timestamp": "2025-11-25T07:06:38.967Z"
1432
+ }
1433
+ }
1434
+ [AccessControl] 🔍 DATA OBJECT STRUCTURE (after deep clone): {
1435
+ correlationId: '11f8c0d3-850b-4ec5-a094-f54907a62637',
1436
+ dataKeys: [ 'accepted', 'rejected', 'outcomes' ],
1437
+ hasAccepted: true,
1438
+ hasRejected: true,
1439
+ hasOutcomes: true,
1440
+ hasErrors: false,
1441
+ acceptedType: 'number',
1442
+ acceptedValue: 1,
1443
+ rejectedType: 'number',
1444
+ rejectedValue: 0,
1445
+ outcomesType: 'object',
1446
+ outcomesValue: { success: 1, failed: 0, blocked: 0, error: 0 },
1447
+ errorsType: 'undefined',
1448
+ errorsIsArray: false,
1449
+ fullData: '{\n' +
1450
+ ' "accepted": 1,\n' +
1451
+ ' "rejected": 0,\n' +
1452
+ ' "outcomes": {\n' +
1453
+ ' "success": 1,\n' +
1454
+ ' "failed": 0,\n' +
1455
+ ' "blocked": 0,\n' +
1456
+ ' "error": 0\n' +
1457
+ ' }\n' +
1458
+ '}'
1459
+ }
1460
+ [AccessControl] 🔍 VALIDATING DATA WITH SUCCESS: {
1461
+ correlationId: '11f8c0d3-850b-4ec5-a094-f54907a62637',
1462
+ dataWithSuccessKeys: [ 'success', 'accepted', 'rejected', 'outcomes' ],
1463
+ hasSuccess: true,
1464
+ successValue: true,
1465
+ hasAccepted: true,
1466
+ acceptedValue: 1,
1467
+ hasRejected: true,
1468
+ rejectedValue: 0,
1469
+ hasOutcomes: true,
1470
+ outcomesValue: { success: 1, failed: 0, blocked: 0, error: 0 },
1471
+ fullDataWithSuccess: '{\n' +
1472
+ ' "success": true,\n' +
1473
+ ' "accepted": 1,\n' +
1474
+ ' "rejected": 0,\n' +
1475
+ ' "outcomes": {\n' +
1476
+ ' "success": 1,\n' +
1477
+ ' "failed": 0,\n' +
1478
+ ' "blocked": 0,\n' +
1479
+ ' "error": 0\n' +
1480
+ ' }\n' +
1481
+ '}'
1482
+ }
1483
+
1484
+ stderr | src/services/__tests__/access-control.proof-response-validation.test.ts > Proof Submission Response Validation > JSON Deep Clone Fix (Cloudflare Workers Edge Case) > should correctly extract data from wrapped response after JSON deep clone
1485
+ [AccessControl] 🔍 RAW API RESPONSE (before parsing): {
1486
+ correlationId: '191579b0-41a5-487a-a393-e17c65ff2a3f',
1487
+ status: 200,
1488
+ statusText: undefined,
1489
+ headers: {},
1490
+ responseTextLength: 191,
1491
+ responseTextPreview: '{"success":true,"data":{"accepted":1,"rejected":0,"outcomes":{"success":1},"errors":[]},"metadata":{"requestId":"fc1fa88f-9b22-4161-b4fd-17d8215098ee","timestamp":"2025-11-24T21:36:33.029Z"}}',
1492
+ fullResponseText: '{"success":true,"data":{"accepted":1,"rejected":0,"outcomes":{"success":1},"errors":[]},"metadata":{"requestId":"fc1fa88f-9b22-4161-b4fd-17d8215098ee","timestamp":"2025-11-24T21:36:33.029Z"}}'
1493
+ }
1494
+ [AccessControl] 🔍 PARSED RESPONSE DATA: {
1495
+ correlationId: '191579b0-41a5-487a-a393-e17c65ff2a3f',
1496
+ status: 200,
1497
+ responseDataType: 'object',
1498
+ responseDataKeys: [ 'success', 'data', 'metadata' ],
1499
+ responseData: '{\n' +
1500
+ ' "success": true,\n' +
1501
+ ' "data": {\n' +
1502
+ ' "accepted": 1,\n' +
1503
+ ' "rejected": 0,\n' +
1504
+ ' "outcomes": {\n' +
1505
+ ' "success": 1\n' +
1506
+ ' },\n' +
1507
+ ' "errors": []\n' +
1508
+ ' },\n' +
1509
+ ' "metadata": {\n' +
1510
+ ' "requestId": "fc1fa88f-9b22-4161-b4fd-17d8215098ee",\n' +
1511
+ ' "timestamp": "2025-11-24T21:36:33.029Z"\n' +
1512
+ ' }\n' +
1513
+ '}'
1514
+ }
1515
+ [AccessControl] Raw response received: {
1516
+ "success": true,
1517
+ "data": {
1518
+ "accepted": 1,
1519
+ "rejected": 0,
1520
+ "outcomes": {
1521
+ "success": 1
1522
+ },
1523
+ "errors": []
1524
+ },
1525
+ "metadata": {
1526
+ "requestId": "fc1fa88f-9b22-4161-b4fd-17d8215098ee",
1527
+ "timestamp": "2025-11-24T21:36:33.029Z"
1528
+ }
1529
+ }
1530
+ [AccessControl] 🔍 DATA OBJECT STRUCTURE (after deep clone): {
1531
+ correlationId: '191579b0-41a5-487a-a393-e17c65ff2a3f',
1532
+ dataKeys: [ 'accepted', 'rejected', 'outcomes', 'errors' ],
1533
+ hasAccepted: true,
1534
+ hasRejected: true,
1535
+ hasOutcomes: true,
1536
+ hasErrors: true,
1537
+ acceptedType: 'number',
1538
+ acceptedValue: 1,
1539
+ rejectedType: 'number',
1540
+ rejectedValue: 0,
1541
+ outcomesType: 'object',
1542
+ outcomesValue: { success: 1 },
1543
+ errorsType: 'object',
1544
+ errorsIsArray: true,
1545
+ fullData: '{\n' +
1546
+ ' "accepted": 1,\n' +
1547
+ ' "rejected": 0,\n' +
1548
+ ' "outcomes": {\n' +
1549
+ ' "success": 1\n' +
1550
+ ' },\n' +
1551
+ ' "errors": []\n' +
1552
+ '}'
1553
+ }
1554
+ [AccessControl] 🔍 VALIDATING DATA WITH SUCCESS: {
1555
+ correlationId: '191579b0-41a5-487a-a393-e17c65ff2a3f',
1556
+ dataWithSuccessKeys: [ 'success', 'accepted', 'rejected', 'outcomes', 'errors' ],
1557
+ hasSuccess: true,
1558
+ successValue: true,
1559
+ hasAccepted: true,
1560
+ acceptedValue: 1,
1561
+ hasRejected: true,
1562
+ rejectedValue: 0,
1563
+ hasOutcomes: true,
1564
+ outcomesValue: { success: 1 },
1565
+ fullDataWithSuccess: '{\n' +
1566
+ ' "success": true,\n' +
1567
+ ' "accepted": 1,\n' +
1568
+ ' "rejected": 0,\n' +
1569
+ ' "outcomes": {\n' +
1570
+ ' "success": 1\n' +
1571
+ ' },\n' +
1572
+ ' "errors": []\n' +
1573
+ '}'
1574
+ }
1575
+
1576
+ stderr | src/services/__tests__/access-control.proof-response-validation.test.ts > Proof Submission Response Validation > JSON Deep Clone Fix (Cloudflare Workers Edge Case) > should handle response where data fields are numeric values (not undefined)
1577
+ [AccessControl] 🔍 RAW API RESPONSE (before parsing): {
1578
+ correlationId: '328fcc77-3532-43c2-8118-dffff23ce9e1',
1579
+ status: 200,
1580
+ statusText: undefined,
1581
+ headers: {},
1582
+ responseTextLength: 151,
1583
+ responseTextPreview: '{"success":true,"data":{"accepted":0,"rejected":0,"outcomes":{},"errors":[]},"metadata":{"requestId":"test-id","timestamp":"2025-11-25T07:06:38.971Z"}}',
1584
+ fullResponseText: '{"success":true,"data":{"accepted":0,"rejected":0,"outcomes":{},"errors":[]},"metadata":{"requestId":"test-id","timestamp":"2025-11-25T07:06:38.971Z"}}'
1585
+ }
1586
+ [AccessControl] 🔍 PARSED RESPONSE DATA: {
1587
+ correlationId: '328fcc77-3532-43c2-8118-dffff23ce9e1',
1588
+ status: 200,
1589
+ responseDataType: 'object',
1590
+ responseDataKeys: [ 'success', 'data', 'metadata' ],
1591
+ responseData: '{\n' +
1592
+ ' "success": true,\n' +
1593
+ ' "data": {\n' +
1594
+ ' "accepted": 0,\n' +
1595
+ ' "rejected": 0,\n' +
1596
+ ' "outcomes": {},\n' +
1597
+ ' "errors": []\n' +
1598
+ ' },\n' +
1599
+ ' "metadata": {\n' +
1600
+ ' "requestId": "test-id",\n' +
1601
+ ' "timestamp": "2025-11-25T07:06:38.971Z"\n' +
1602
+ ' }\n' +
1603
+ '}'
1604
+ }
1605
+ [AccessControl] Raw response received: {
1606
+ "success": true,
1607
+ "data": {
1608
+ "accepted": 0,
1609
+ "rejected": 0,
1610
+ "outcomes": {},
1611
+ "errors": []
1612
+ },
1613
+ "metadata": {
1614
+ "requestId": "test-id",
1615
+ "timestamp": "2025-11-25T07:06:38.971Z"
1616
+ }
1617
+ }
1618
+ [AccessControl] 🔍 DATA OBJECT STRUCTURE (after deep clone): {
1619
+ correlationId: '328fcc77-3532-43c2-8118-dffff23ce9e1',
1620
+ dataKeys: [ 'accepted', 'rejected', 'outcomes', 'errors' ],
1621
+ hasAccepted: true,
1622
+ hasRejected: true,
1623
+ hasOutcomes: true,
1624
+ hasErrors: true,
1625
+ acceptedType: 'number',
1626
+ acceptedValue: 0,
1627
+ rejectedType: 'number',
1628
+ rejectedValue: 0,
1629
+ outcomesType: 'object',
1630
+ outcomesValue: {},
1631
+ errorsType: 'object',
1632
+ errorsIsArray: true,
1633
+ fullData: '{\n "accepted": 0,\n "rejected": 0,\n "outcomes": {},\n "errors": []\n}'
1634
+ }
1635
+ [AccessControl] 🔍 VALIDATING DATA WITH SUCCESS: {
1636
+ correlationId: '328fcc77-3532-43c2-8118-dffff23ce9e1',
1637
+ dataWithSuccessKeys: [ 'success', 'accepted', 'rejected', 'outcomes', 'errors' ],
1638
+ hasSuccess: true,
1639
+ successValue: true,
1640
+ hasAccepted: true,
1641
+ acceptedValue: 0,
1642
+ hasRejected: true,
1643
+ rejectedValue: 0,
1644
+ hasOutcomes: true,
1645
+ outcomesValue: {},
1646
+ fullDataWithSuccess: '{\n' +
1647
+ ' "success": true,\n' +
1648
+ ' "accepted": 0,\n' +
1649
+ ' "rejected": 0,\n' +
1650
+ ' "outcomes": {},\n' +
1651
+ ' "errors": []\n' +
1652
+ '}'
1653
+ }
1654
+
1655
+ stderr | src/services/__tests__/access-control.proof-response-validation.test.ts > Proof Submission Response Validation > JSON Deep Clone Fix (Cloudflare Workers Edge Case) > should handle response with nested outcomes object
1656
+ [AccessControl] 🔍 RAW API RESPONSE (before parsing): {
1657
+ correlationId: '41740bb6-ab5d-4ce6-b491-0d64d84fdea4',
1658
+ status: 200,
1659
+ statusText: undefined,
1660
+ headers: {},
1661
+ responseTextLength: 278,
1662
+ responseTextPreview: '{"success":true,"data":{"accepted":3,"rejected":2,"outcomes":{"success":1,"failed":1,"blocked":1,"error":2},"errors":[{"proof_index":0,"error":{"code":"validation_error","message":"Invalid signature"}}]},"metadata":{"requestId":"test-id","timestamp":"2025-11-25T07:06:38.974Z"}}',
1663
+ fullResponseText: '{"success":true,"data":{"accepted":3,"rejected":2,"outcomes":{"success":1,"failed":1,"blocked":1,"error":2},"errors":[{"proof_index":0,"error":{"code":"validation_error","message":"Invalid signature"}}]},"metadata":{"requestId":"test-id","timestamp":"2025-11-25T07:06:38.974Z"}}'
1664
+ }
1665
+ [AccessControl] 🔍 PARSED RESPONSE DATA: {
1666
+ correlationId: '41740bb6-ab5d-4ce6-b491-0d64d84fdea4',
1667
+ status: 200,
1668
+ responseDataType: 'object',
1669
+ responseDataKeys: [ 'success', 'data', 'metadata' ],
1670
+ responseData: '{\n' +
1671
+ ' "success": true,\n' +
1672
+ ' "data": {\n' +
1673
+ ' "accepted": 3,\n' +
1674
+ ' "rejected": 2,\n' +
1675
+ ' "outcomes": {\n' +
1676
+ ' "success": 1,\n' +
1677
+ ' "failed": 1,\n' +
1678
+ ' "blocked": 1,\n' +
1679
+ ' "error": 2\n' +
1680
+ ' },\n' +
1681
+ ' "errors": [\n' +
1682
+ ' {\n' +
1683
+ ' "proof_index": 0,\n' +
1684
+ ' "error": {\n' +
1685
+ ' "code": "validation_error",\n' +
1686
+ ' "message": "Invalid signature"\n' +
1687
+ ' }\n' +
1688
+ ' }\n' +
1689
+ ' ]\n' +
1690
+ ' },\n' +
1691
+ ' "metadata": {\n' +
1692
+ ' "requestId": "test-id",\n' +
1693
+ ' "timestamp": "2025-11-25T07:06:38.974Z"\n' +
1694
+ ' }\n' +
1695
+ '}'
1696
+ }
1697
+ [AccessControl] Raw response received: {
1698
+ "success": true,
1699
+ "data": {
1700
+ "accepted": 3,
1701
+ "rejected": 2,
1702
+ "outcomes": {
1703
+ "success": 1,
1704
+ "failed": 1,
1705
+ "blocked": 1,
1706
+ "error": 2
1707
+ },
1708
+ "errors": [
1709
+ {
1710
+ "proof_index": 0,
1711
+ "error": {
1712
+ "code": "validation_error",
1713
+ "message": "Invalid signature"
1714
+ }
1715
+ }
1716
+ ]
1717
+ },
1718
+ "metadata": {
1719
+ "requestId": "test-id",
1720
+ "timestamp": "2025-11-25T07:06:38.974Z"
1721
+ }
1722
+ }
1723
+ [AccessControl] 🔍 DATA OBJECT STRUCTURE (after deep clone): {
1724
+ correlationId: '41740bb6-ab5d-4ce6-b491-0d64d84fdea4',
1725
+ dataKeys: [ 'accepted', 'rejected', 'outcomes', 'errors' ],
1726
+ hasAccepted: true,
1727
+ hasRejected: true,
1728
+ hasOutcomes: true,
1729
+ hasErrors: true,
1730
+ acceptedType: 'number',
1731
+ acceptedValue: 3,
1732
+ rejectedType: 'number',
1733
+ rejectedValue: 2,
1734
+ outcomesType: 'object',
1735
+ outcomesValue: { success: 1, failed: 1, blocked: 1, error: 2 },
1736
+ errorsType: 'object',
1737
+ errorsIsArray: true,
1738
+ fullData: '{\n' +
1739
+ ' "accepted": 3,\n' +
1740
+ ' "rejected": 2,\n' +
1741
+ ' "outcomes": {\n' +
1742
+ ' "success": 1,\n' +
1743
+ ' "failed": 1,\n' +
1744
+ ' "blocked": 1,\n' +
1745
+ ' "error": 2\n' +
1746
+ ' },\n' +
1747
+ ' "errors": [\n' +
1748
+ ' {\n' +
1749
+ ' "proof_index": 0,\n' +
1750
+ ' "error": {\n' +
1751
+ ' "code": "validation_error",\n' +
1752
+ ' "message": "Invalid signature"\n' +
1753
+ ' }\n' +
1754
+ ' }\n' +
1755
+ ' ]\n' +
1756
+ '}'
1757
+ }
1758
+ [AccessControl] 🔍 VALIDATING DATA WITH SUCCESS: {
1759
+ correlationId: '41740bb6-ab5d-4ce6-b491-0d64d84fdea4',
1760
+ dataWithSuccessKeys: [ 'success', 'accepted', 'rejected', 'outcomes', 'errors' ],
1761
+ hasSuccess: true,
1762
+ successValue: true,
1763
+ hasAccepted: true,
1764
+ acceptedValue: 3,
1765
+ hasRejected: true,
1766
+ rejectedValue: 2,
1767
+ hasOutcomes: true,
1768
+ outcomesValue: { success: 1, failed: 1, blocked: 1, error: 2 },
1769
+ fullDataWithSuccess: '{\n' +
1770
+ ' "success": true,\n' +
1771
+ ' "accepted": 3,\n' +
1772
+ ' "rejected": 2,\n' +
1773
+ ' "outcomes": {\n' +
1774
+ ' "success": 1,\n' +
1775
+ ' "failed": 1,\n' +
1776
+ ' "blocked": 1,\n' +
1777
+ ' "error": 2\n' +
1778
+ ' },\n' +
1779
+ ' "errors": [\n' +
1780
+ ' {\n' +
1781
+ ' "proof_index": 0,\n' +
1782
+ ' "error": {\n' +
1783
+ ' "code": "validation_error",\n' +
1784
+ ' "message": "Invalid signature"\n' +
1785
+ ' }\n' +
1786
+ ' }\n' +
1787
+ ' ]\n' +
1788
+ '}'
1789
+ }
1790
+
1791
+ stderr | src/services/__tests__/storage.service.test.ts > StorageService > createStorageProviders > should prefer Redis over KV when both are configured
1792
+ [StorageService] Failed to connect to Redis, falling back to memory: Redis package not available
1793
+
1794
+ stderr | src/services/__tests__/storage.service.test.ts > StorageService > createStorageProviders > should prefer Redis over KV when both are configured
1795
+ [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'
1796
+
1797
+ stderr | src/services/__tests__/storage.service.test.ts > StorageService > createStorageProviders > should fall back to memory when Redis connection fails
1798
+ [StorageService] Failed to connect to Redis, falling back to memory: Redis package not available
1799
+
1800
+ stderr | src/services/__tests__/storage.service.test.ts > StorageService > createStorageProviders > should use KV namespace when provided
1801
+ [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'
1802
+
1803
+
1804
+  ❯ src/__tests__/cache/tool-protection-cache.test.ts 2/49
1805
+  ❯ src/__tests__/runtime/base.test.ts [queued]
1806
+  ❯ src/__tests__/runtime/route-interception.test.ts [queued]
1807
+  ❯ src/__tests__/runtime/tool-protection-enforcement.test.ts [queued]
1808
+  ❯ src/__tests__/services/agentshield-integration.test.ts 0/30
1809
+  ❯ src/__tests__/services/tool-protection.service.test.ts 49/49
1810
+  ❯ src/delegation/__tests__/vc-issuer.test.ts 0/21
1811
+  ❯ src/delegation/__tests__/vc-verifier.test.ts 0/35
1812
+  ❯ src/services/__tests__/access-control.integration.test.ts [queued]
1813
+  ❯ src/services/__tests__/access-control.proof-response-validation.test.ts 1/12
1814
+  ❯ src/services/__tests__/access-control.service.test.ts 23/23
1815
+  ❯ src/services/__tests__/proof-verifier.integration.test.ts [queued]
1816
+  ❯ src/services/__tests__/storage.service.test.ts 0/17
1817
+
1818
+  Test Files 2 passed (44)
1819
+  Tests 75 passed (236)
1820
+  Start at 01:06:38
1821
+  Duration 530ms
1822
+ [?2026l[?2026h ✓ src/services/__tests__/access-control.proof-response-validation.test.ts (12 tests) 33ms
1823
+ ✓ src/services/__tests__/storage.service.test.ts (17 tests) 42ms
1824
+ ✓ src/__tests__/cache/tool-protection-cache.test.ts (49 tests) 163ms
1825
+ 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
1826
+ [MCP-I] Checking tool protection: {
1827
+ tool: 'unprotectedTool',
1828
+ agentDid: 'did:key:zmock123...',
1829
+ hasDelegation: false
1830
+ }
1831
+
1832
+ 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
1833
+ [MCP-I] Tool protection check passed (no delegation required) {
1834
+ tool: 'unprotectedTool',
1835
+ agentDid: 'did:key:zmock123...',
1836
+ reason: 'Tool not configured to require delegation'
1837
+ }
1838
+
1839
+ 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
1840
+ [MCP-I] Checking tool protection: {
1841
+ tool: 'protectedTool',
1842
+ agentDid: 'did:key:zmock123...',
1843
+ hasDelegation: false
1844
+ }
1845
+
1846
+
1847
+  ❯ src/__tests__/cache/tool-protection-cache.test.ts 49/49
1848
+  ❯ src/__tests__/runtime/base-extensions.test.ts [queued]
1849
+  ❯ src/__tests__/runtime/base.test.ts 55/55
1850
+  ❯ src/__tests__/runtime/route-interception.test.ts 0/21
1851
+  ❯ src/__tests__/runtime/tool-protection-enforcement.test.ts 0/29
1852
+  ❯ src/__tests__/services/agentshield-integration.test.ts 26/30
1853
+  ❯ src/__tests__/services/tool-protection.service.test.ts 49/49
1854
+  ❯ src/delegation/__tests__/vc-issuer.test.ts 10/21
1855
+  ❯ src/delegation/__tests__/vc-verifier.test.ts 24/35
1856
+  ❯ src/services/__tests__/access-control.integration.test.ts 0/9
1857
+  ❯ src/services/__tests__/access-control.proof-response-validation.test.ts 12/12
1858
+  ❯ src/services/__tests__/proof-verifier.integration.test.ts 0/13
1859
+  ❯ src/services/__tests__/storage.service.test.ts 17/17
1860
+
1861
+  Test Files 6 passed (44)
1862
+  Tests 265 passed (363)
1863
+  Start at 01:06:38
1864
+  Duration 630ms
1865
+ [?2026l[?2026hstderr | 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
1866
+ [MCP-I] BLOCKED: Tool requires delegation but none provided {
1867
+ tool: 'protectedTool',
1868
+ requiredScopes: [ 'files:write' ],
1869
+ agentDid: 'did:key:zmock123...',
1870
+ resumeToken: 'resume_3dxhya_mie8fxpu',
1871
+ consentUrl: 'https://kya.vouched.id/bouncer/consent?tool=protectedTool&scopes=files%3Awrite&session_id=session123&agent_did=&resume_token=resume_3dxhya_mie8fxpu'
1872
+ }
1873
+
1874
+
1875
+  ❯ src/__tests__/cache/tool-protection-cache.test.ts 49/49
1876
+  ❯ src/__tests__/runtime/base-extensions.test.ts [queued]
1877
+  ❯ src/__tests__/runtime/base.test.ts 55/55
1878
+  ❯ src/__tests__/runtime/route-interception.test.ts 0/21
1879
+  ❯ src/__tests__/runtime/tool-protection-enforcement.test.ts 0/29
1880
+  ❯ src/__tests__/services/agentshield-integration.test.ts 26/30
1881
+  ❯ src/__tests__/services/tool-protection.service.test.ts 49/49
1882
+  ❯ src/delegation/__tests__/vc-issuer.test.ts 10/21
1883
+  ❯ src/delegation/__tests__/vc-verifier.test.ts 24/35
1884
+  ❯ src/services/__tests__/access-control.integration.test.ts 0/9
1885
+  ❯ src/services/__tests__/access-control.proof-response-validation.test.ts 12/12
1886
+  ❯ src/services/__tests__/proof-verifier.integration.test.ts 0/13
1887
+  ❯ src/services/__tests__/storage.service.test.ts 17/17
1888
+
1889
+  Test Files 6 passed (44)
1890
+  Tests 265 passed (363)
1891
+  Start at 01:06:38
1892
+  Duration 630ms
1893
+ [?2026l[?2026hstdout | 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
1894
+ [MCP-I] Checking tool protection: {
1895
+ tool: 'protectedTool',
1896
+ agentDid: 'did:key:zmock123...',
1897
+ hasDelegation: true
1898
+ }
1899
+
1900
+ 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
1901
+ [MCP-I] 🔐 Verifying delegation token with AccessControlApiService {
1902
+ tool: 'protectedTool',
1903
+ agentDid: 'did:key:zmock123...',
1904
+ hasDelegationToken: true,
1905
+ hasConsentProof: false,
1906
+ requiredScopes: [ 'files:write' ]
1907
+ }
1908
+
1909
+ 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
1910
+ [MCP-I] ✅ Delegation verification SUCCEEDED {
1911
+ tool: 'protectedTool',
1912
+ agentDid: 'did:key:zmock123...',
1913
+ delegationId: 'test-delegation-id',
1914
+ credentialScopes: [ 'files:write' ],
1915
+ requiredScopes: [ 'files:write' ]
1916
+ }
1917
+
1918
+ 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
1919
+ [MCP-I] Checking tool protection: {
1920
+ tool: 'protectedTool',
1921
+ agentDid: 'did:key:zmock123...',
1922
+ hasDelegation: true
1923
+ }
1924
+
1925
+ 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
1926
+ [MCP-I] 🔐 Verifying delegation token with AccessControlApiService {
1927
+ tool: 'protectedTool',
1928
+ agentDid: 'did:key:zmock123...',
1929
+ hasDelegationToken: false,
1930
+ hasConsentProof: true,
1931
+ requiredScopes: [ 'files:write' ]
1932
+ }
1933
+
1934
+ 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
1935
+ [MCP-I] ✅ Delegation verification SUCCEEDED {
1936
+ tool: 'protectedTool',
1937
+ agentDid: 'did:key:zmock123...',
1938
+ delegationId: 'test-delegation-id',
1939
+ credentialScopes: [ 'files:write' ],
1940
+ requiredScopes: [ 'files:write' ]
1941
+ }
1942
+
1943
+ 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
1944
+ [MCP-I] Checking tool protection: {
1945
+ tool: 'protectedTool',
1946
+ agentDid: 'did:key:zmock123...',
1947
+ hasDelegation: true
1948
+ }
1949
+
1950
+ 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
1951
+ [MCP-I] 🔐 Verifying delegation token with AccessControlApiService {
1952
+ tool: 'protectedTool',
1953
+ agentDid: 'did:key:zmock123...',
1954
+ hasDelegationToken: true,
1955
+ hasConsentProof: false,
1956
+ requiredScopes: [ 'files:write' ]
1957
+ }
1958
+
1959
+
1960
+  ❯ src/__tests__/cache/tool-protection-cache.test.ts 49/49
1961
+  ❯ src/__tests__/runtime/base-extensions.test.ts [queued]
1962
+  ❯ src/__tests__/runtime/base.test.ts 55/55
1963
+  ❯ src/__tests__/runtime/route-interception.test.ts 0/21
1964
+  ❯ src/__tests__/runtime/tool-protection-enforcement.test.ts 0/29
1965
+  ❯ src/__tests__/services/agentshield-integration.test.ts 26/30
1966
+  ❯ src/__tests__/services/tool-protection.service.test.ts 49/49
1967
+  ❯ src/delegation/__tests__/vc-issuer.test.ts 10/21
1968
+  ❯ src/delegation/__tests__/vc-verifier.test.ts 24/35
1969
+  ❯ src/services/__tests__/access-control.integration.test.ts 0/9
1970
+  ❯ src/services/__tests__/access-control.proof-response-validation.test.ts 12/12
1971
+  ❯ src/services/__tests__/proof-verifier.integration.test.ts 0/13
1972
+  ❯ src/services/__tests__/storage.service.test.ts 17/17
1973
+
1974
+  Test Files 6 passed (44)
1975
+  Tests 265 passed (363)
1976
+  Start at 01:06:38
1977
+  Duration 630ms
1978
+ [?2026l[?2026hstderr | src/__tests__/runtime/tool-protection-enforcement.test.ts > MCPIRuntimeBase - Tool Protection Enforcement > processToolCall with tool protection > should block tool execution when delegation verification fails
1979
+ [MCP-I] ❌ Delegation verification FAILED {
1980
+ tool: 'protectedTool',
1981
+ agentDid: 'did:key:zmock123...',
1982
+ reason: 'Delegation token expired',
1983
+ errorCode: undefined,
1984
+ errorMessage: undefined,
1985
+ requiredScopes: [ 'files:write' ]
1986
+ }
1987
+
1988
+
1989
+  ❯ src/__tests__/cache/tool-protection-cache.test.ts 49/49
1990
+  ❯ src/__tests__/runtime/base-extensions.test.ts [queued]
1991
+  ❯ src/__tests__/runtime/base.test.ts 55/55
1992
+  ❯ src/__tests__/runtime/route-interception.test.ts 0/21
1993
+  ❯ src/__tests__/runtime/tool-protection-enforcement.test.ts 0/29
1994
+  ❯ src/__tests__/services/agentshield-integration.test.ts 26/30
1995
+  ❯ src/__tests__/services/tool-protection.service.test.ts 49/49
1996
+  ❯ src/delegation/__tests__/vc-issuer.test.ts 10/21
1997
+  ❯ src/delegation/__tests__/vc-verifier.test.ts 24/35
1998
+  ❯ src/services/__tests__/access-control.integration.test.ts 0/9
1999
+  ❯ src/services/__tests__/access-control.proof-response-validation.test.ts 12/12
2000
+  ❯ src/services/__tests__/proof-verifier.integration.test.ts 0/13
2001
+  ❯ src/services/__tests__/storage.service.test.ts 17/17
2002
+
2003
+  Test Files 6 passed (44)
2004
+  Tests 265 passed (363)
2005
+  Start at 01:06:38
2006
+  Duration 630ms
2007
+ [?2026l[?2026hstdout | 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
2008
+ [MCP-I] Checking tool protection: {
2009
+ tool: 'protectedTool',
2010
+ agentDid: 'did:key:zmock123...',
2011
+ hasDelegation: true
2012
+ }
2013
+
2014
+ 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
2015
+ [MCP-I] 🔐 Verifying delegation token with AccessControlApiService {
2016
+ tool: 'protectedTool',
2017
+ agentDid: 'did:key:zmock123...',
2018
+ hasDelegationToken: true,
2019
+ hasConsentProof: false,
2020
+ requiredScopes: [ 'files:write' ]
2021
+ }
2022
+
2023
+
2024
+  ❯ src/__tests__/cache/tool-protection-cache.test.ts 49/49
2025
+  ❯ src/__tests__/runtime/base-extensions.test.ts [queued]
2026
+  ❯ src/__tests__/runtime/base.test.ts 55/55
2027
+  ❯ src/__tests__/runtime/route-interception.test.ts 0/21
2028
+  ❯ src/__tests__/runtime/tool-protection-enforcement.test.ts 0/29
2029
+  ❯ src/__tests__/services/agentshield-integration.test.ts 26/30
2030
+  ❯ src/__tests__/services/tool-protection.service.test.ts 49/49
2031
+  ❯ src/delegation/__tests__/vc-issuer.test.ts 10/21
2032
+  ❯ src/delegation/__tests__/vc-verifier.test.ts 24/35
2033
+  ❯ src/services/__tests__/access-control.integration.test.ts 0/9
2034
+  ❯ src/services/__tests__/access-control.proof-response-validation.test.ts 12/12
2035
+  ❯ src/services/__tests__/proof-verifier.integration.test.ts 0/13
2036
+  ❯ src/services/__tests__/storage.service.test.ts 17/17
2037
+
2038
+  Test Files 6 passed (44)
2039
+  Tests 265 passed (363)
2040
+  Start at 01:06:38
2041
+  Duration 630ms
2042
+ [?2026l[?2026hstderr | 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
2043
+ [MCP-I] ❌ Delegation verification FAILED {
2044
+ tool: 'protectedTool',
2045
+ agentDid: 'did:key:zmock123...',
2046
+ reason: 'Insufficient scopes',
2047
+ errorCode: undefined,
2048
+ errorMessage: undefined,
2049
+ requiredScopes: [ 'files:write' ]
2050
+ }
2051
+
2052
+
2053
+  ❯ src/__tests__/cache/tool-protection-cache.test.ts 49/49
2054
+  ❯ src/__tests__/runtime/base-extensions.test.ts [queued]
2055
+  ❯ src/__tests__/runtime/base.test.ts 55/55
2056
+  ❯ src/__tests__/runtime/route-interception.test.ts 0/21
2057
+  ❯ src/__tests__/runtime/tool-protection-enforcement.test.ts 0/29
2058
+  ❯ src/__tests__/services/agentshield-integration.test.ts 26/30
2059
+  ❯ src/__tests__/services/tool-protection.service.test.ts 49/49
2060
+  ❯ src/delegation/__tests__/vc-issuer.test.ts 10/21
2061
+  ❯ src/delegation/__tests__/vc-verifier.test.ts 24/35
2062
+  ❯ src/services/__tests__/access-control.integration.test.ts 0/9
2063
+  ❯ src/services/__tests__/access-control.proof-response-validation.test.ts 12/12
2064
+  ❯ src/services/__tests__/proof-verifier.integration.test.ts 0/13
2065
+  ❯ src/services/__tests__/storage.service.test.ts 17/17
2066
+
2067
+  Test Files 6 passed (44)
2068
+  Tests 265 passed (363)
2069
+  Start at 01:06:38
2070
+  Duration 630ms
2071
+ [?2026l[?2026hstdout | src/__tests__/runtime/tool-protection-enforcement.test.ts > MCPIRuntimeBase - Tool Protection Enforcement > processToolCall with tool protection > should handle API errors during verification gracefully
2072
+ [MCP-I] Checking tool protection: {
2073
+ tool: 'protectedTool',
2074
+ agentDid: 'did:key:zmock123...',
2075
+ hasDelegation: true
2076
+ }
2077
+
2078
+ stdout | src/__tests__/runtime/tool-protection-enforcement.test.ts > MCPIRuntimeBase - Tool Protection Enforcement > processToolCall with tool protection > should handle API errors during verification gracefully
2079
+ [MCP-I] 🔐 Verifying delegation token with AccessControlApiService {
2080
+ tool: 'protectedTool',
2081
+ agentDid: 'did:key:zmock123...',
2082
+ hasDelegationToken: true,
2083
+ hasConsentProof: false,
2084
+ requiredScopes: [ 'files:write' ]
2085
+ }
2086
+
2087
+
2088
+  ❯ src/__tests__/cache/tool-protection-cache.test.ts 49/49
2089
+  ❯ src/__tests__/runtime/base-extensions.test.ts [queued]
2090
+  ❯ src/__tests__/runtime/base.test.ts 55/55
2091
+  ❯ src/__tests__/runtime/route-interception.test.ts 0/21
2092
+  ❯ src/__tests__/runtime/tool-protection-enforcement.test.ts 0/29
2093
+  ❯ src/__tests__/services/agentshield-integration.test.ts 26/30
2094
+  ❯ src/__tests__/services/tool-protection.service.test.ts 49/49
2095
+  ❯ src/delegation/__tests__/vc-issuer.test.ts 10/21
2096
+  ❯ src/delegation/__tests__/vc-verifier.test.ts 24/35
2097
+  ❯ src/services/__tests__/access-control.integration.test.ts 0/9
2098
+  ❯ src/services/__tests__/access-control.proof-response-validation.test.ts 12/12
2099
+  ❯ src/services/__tests__/proof-verifier.integration.test.ts 0/13
2100
+  ❯ src/services/__tests__/storage.service.test.ts 17/17
2101
+
2102
+  Test Files 6 passed (44)
2103
+  Tests 265 passed (363)
2104
+  Start at 01:06:38
2105
+  Duration 630ms
2106
+ [?2026l[?2026hstderr | src/__tests__/runtime/tool-protection-enforcement.test.ts > MCPIRuntimeBase - Tool Protection Enforcement > processToolCall with tool protection > should handle API errors during verification gracefully
2107
+ [MCP-I] ❌ Delegation verification error (API failure) {
2108
+ tool: 'protectedTool',
2109
+ agentDid: 'did:key:zmock123...',
2110
+ errorCode: 'network_error',
2111
+ errorMessage: 'API unavailable',
2112
+ errorDetails: {}
2113
+ }
2114
+
2115
+
2116
+  ❯ src/__tests__/cache/tool-protection-cache.test.ts 49/49
2117
+  ❯ src/__tests__/runtime/base-extensions.test.ts [queued]
2118
+  ❯ src/__tests__/runtime/base.test.ts 55/55
2119
+  ❯ src/__tests__/runtime/route-interception.test.ts 0/21
2120
+  ❯ src/__tests__/runtime/tool-protection-enforcement.test.ts 0/29
2121
+  ❯ src/__tests__/services/agentshield-integration.test.ts 26/30
2122
+  ❯ src/__tests__/services/tool-protection.service.test.ts 49/49
2123
+  ❯ src/delegation/__tests__/vc-issuer.test.ts 10/21
2124
+  ❯ src/delegation/__tests__/vc-verifier.test.ts 24/35
2125
+  ❯ src/services/__tests__/access-control.integration.test.ts 0/9
2126
+  ❯ src/services/__tests__/access-control.proof-response-validation.test.ts 12/12
2127
+  ❯ src/services/__tests__/proof-verifier.integration.test.ts 0/13
2128
+  ❯ src/services/__tests__/storage.service.test.ts 17/17
2129
+
2130
+  Test Files 6 passed (44)
2131
+  Tests 265 passed (363)
2132
+  Start at 01:06:38
2133
+  Duration 630ms
2134
+ [?2026l[?2026hstdout | 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)
2135
+ [MCP-I] Checking tool protection: {
2136
+ tool: 'protectedTool',
2137
+ agentDid: 'did:key:zmock123...',
2138
+ hasDelegation: true
2139
+ }
2140
+
2141
+
2142
+  ❯ src/__tests__/cache/tool-protection-cache.test.ts 49/49
2143
+  ❯ src/__tests__/runtime/base-extensions.test.ts [queued]
2144
+  ❯ src/__tests__/runtime/base.test.ts 55/55
2145
+  ❯ src/__tests__/runtime/route-interception.test.ts 0/21
2146
+  ❯ src/__tests__/runtime/tool-protection-enforcement.test.ts 0/29
2147
+  ❯ src/__tests__/services/agentshield-integration.test.ts 26/30
2148
+  ❯ src/__tests__/services/tool-protection.service.test.ts 49/49
2149
+  ❯ src/delegation/__tests__/vc-issuer.test.ts 10/21
2150
+  ❯ src/delegation/__tests__/vc-verifier.test.ts 24/35
2151
+  ❯ src/services/__tests__/access-control.integration.test.ts 0/9
2152
+  ❯ src/services/__tests__/access-control.proof-response-validation.test.ts 12/12
2153
+  ❯ src/services/__tests__/proof-verifier.integration.test.ts 0/13
2154
+  ❯ src/services/__tests__/storage.service.test.ts 17/17
2155
+
2156
+  Test Files 6 passed (44)
2157
+  Tests 265 passed (363)
2158
+  Start at 01:06:38
2159
+  Duration 630ms
2160
+ [?2026l[?2026hstderr | 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)
2161
+ [MCP-I] ⚠️ Delegation token provided but AccessControlApiService not configured - skipping verification {
2162
+ tool: 'protectedTool',
2163
+ agentDid: 'did:key:zmock123...',
2164
+ hasDelegationToken: true,
2165
+ hasConsentProof: false
2166
+ }
2167
+
2168
+
2169
+  ❯ src/__tests__/cache/tool-protection-cache.test.ts 49/49
2170
+  ❯ src/__tests__/runtime/base-extensions.test.ts [queued]
2171
+  ❯ src/__tests__/runtime/base.test.ts 55/55
2172
+  ❯ src/__tests__/runtime/route-interception.test.ts 0/21
2173
+  ❯ src/__tests__/runtime/tool-protection-enforcement.test.ts 0/29
2174
+  ❯ src/__tests__/services/agentshield-integration.test.ts 26/30
2175
+  ❯ src/__tests__/services/tool-protection.service.test.ts 49/49
2176
+  ❯ src/delegation/__tests__/vc-issuer.test.ts 10/21
2177
+  ❯ src/delegation/__tests__/vc-verifier.test.ts 24/35
2178
+  ❯ src/services/__tests__/access-control.integration.test.ts 0/9
2179
+  ❯ src/services/__tests__/access-control.proof-response-validation.test.ts 12/12
2180
+  ❯ src/services/__tests__/proof-verifier.integration.test.ts 0/13
2181
+  ❯ src/services/__tests__/storage.service.test.ts 17/17
2182
+
2183
+  Test Files 6 passed (44)
2184
+  Tests 265 passed (363)
2185
+  Start at 01:06:38
2186
+  Duration 630ms
2187
+ [?2026l[?2026hstdout | 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
2188
+ [MCP-I] Checking tool protection: {
2189
+ tool: 'protectedTool',
2190
+ agentDid: 'did:key:zmock123...',
2191
+ hasDelegation: true
2192
+ }
2193
+
2194
+ 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
2195
+ [MCP-I] 🔐 Verifying delegation token with AccessControlApiService {
2196
+ tool: 'protectedTool',
2197
+ agentDid: 'did:key:zmock123...',
2198
+ hasDelegationToken: true,
2199
+ hasConsentProof: false,
2200
+ requiredScopes: [ 'files:write' ]
2201
+ }
2202
+
2203
+
2204
+  ❯ src/__tests__/cache/tool-protection-cache.test.ts 49/49
2205
+  ❯ src/__tests__/runtime/base-extensions.test.ts [queued]
2206
+  ❯ src/__tests__/runtime/base.test.ts 55/55
2207
+  ❯ src/__tests__/runtime/route-interception.test.ts 0/21
2208
+  ❯ src/__tests__/runtime/tool-protection-enforcement.test.ts 0/29
2209
+  ❯ src/__tests__/services/agentshield-integration.test.ts 26/30
2210
+  ❯ src/__tests__/services/tool-protection.service.test.ts 49/49
2211
+  ❯ src/delegation/__tests__/vc-issuer.test.ts 10/21
2212
+  ❯ src/delegation/__tests__/vc-verifier.test.ts 24/35
2213
+  ❯ src/services/__tests__/access-control.integration.test.ts 0/9
2214
+  ❯ src/services/__tests__/access-control.proof-response-validation.test.ts 12/12
2215
+  ❯ src/services/__tests__/proof-verifier.integration.test.ts 0/13
2216
+  ❯ src/services/__tests__/storage.service.test.ts 17/17
2217
+
2218
+  Test Files 6 passed (44)
2219
+  Tests 265 passed (363)
2220
+  Start at 01:06:38
2221
+  Duration 630ms
2222
+ [?2026l[?2026hstderr | 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
2223
+ [MCP-I] 🔒 SECURITY: User identifier validation FAILED {
2224
+ tool: 'protectedTool',
2225
+ agentDid: 'did:key:zmock123...',
2226
+ delegationUserIdentifier: 'did:key:zUserB987654...',
2227
+ sessionUserDid: 'did:key:zUserA123456...',
2228
+ sessionId: 'session123...',
2229
+ reason: 'user_identifier_mismatch',
2230
+ severity: 'high'
2231
+ }
2232
+
2233
+
2234
+  ❯ src/__tests__/cache/tool-protection-cache.test.ts 49/49
2235
+  ❯ src/__tests__/runtime/base-extensions.test.ts [queued]
2236
+  ❯ src/__tests__/runtime/base.test.ts 55/55
2237
+  ❯ src/__tests__/runtime/route-interception.test.ts 0/21
2238
+  ❯ src/__tests__/runtime/tool-protection-enforcement.test.ts 0/29
2239
+  ❯ src/__tests__/services/agentshield-integration.test.ts 26/30
2240
+  ❯ src/__tests__/services/tool-protection.service.test.ts 49/49
2241
+  ❯ src/delegation/__tests__/vc-issuer.test.ts 10/21
2242
+  ❯ src/delegation/__tests__/vc-verifier.test.ts 24/35
2243
+  ❯ src/services/__tests__/access-control.integration.test.ts 0/9
2244
+  ❯ src/services/__tests__/access-control.proof-response-validation.test.ts 12/12
2245
+  ❯ src/services/__tests__/proof-verifier.integration.test.ts 0/13
2246
+  ❯ src/services/__tests__/storage.service.test.ts 17/17
2247
+
2248
+  Test Files 6 passed (44)
2249
+  Tests 265 passed (363)
2250
+  Start at 01:06:38
2251
+  Duration 630ms
2252
+ [?2026l[?2026hstdout | 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
2253
+ [MCP-I] Checking tool protection: {
2254
+ tool: 'protectedTool',
2255
+ agentDid: 'did:key:zmock123...',
2256
+ hasDelegation: true
2257
+ }
2258
+
2259
+ 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
2260
+ [MCP-I] 🔐 Verifying delegation token with AccessControlApiService {
2261
+ tool: 'protectedTool',
2262
+ agentDid: 'did:key:zmock123...',
2263
+ hasDelegationToken: true,
2264
+ hasConsentProof: false,
2265
+ requiredScopes: [ 'files:write' ]
2266
+ }
2267
+
2268
+ 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
2269
+ [MCP-I] ✅ User identifier validation PASSED {
2270
+ tool: 'protectedTool',
2271
+ agentDid: 'did:key:zmock123...',
2272
+ userDid: 'did:key:zUserA123456...',
2273
+ sessionId: 'session123...'
2274
+ }
2275
+ [MCP-I] ✅ Delegation verification SUCCEEDED {
2276
+ tool: 'protectedTool',
2277
+ agentDid: 'did:key:zmock123...',
2278
+ delegationId: 'test-delegation-id',
2279
+ credentialScopes: [ 'files:write' ],
2280
+ requiredScopes: [ 'files:write' ]
2281
+ }
2282
+
2283
+ 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)
2284
+ [MCP-I] Checking tool protection: {
2285
+ tool: 'protectedTool',
2286
+ agentDid: 'did:key:zmock123...',
2287
+ hasDelegation: true
2288
+ }
2289
+
2290
+ 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)
2291
+ [MCP-I] 🔐 Verifying delegation token with AccessControlApiService {
2292
+ tool: 'protectedTool',
2293
+ agentDid: 'did:key:zmock123...',
2294
+ hasDelegationToken: true,
2295
+ hasConsentProof: false,
2296
+ requiredScopes: [ 'files:write' ]
2297
+ }
2298
+
2299
+ 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)
2300
+ [MCP-I] ✅ Delegation verification SUCCEEDED {
2301
+ tool: 'protectedTool',
2302
+ agentDid: 'did:key:zmock123...',
2303
+ delegationId: 'test-delegation-id',
2304
+ credentialScopes: [ 'files:write' ],
2305
+ requiredScopes: [ 'files:write' ]
2306
+ }
2307
+
2308
+ 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
2309
+ [MCP-I] Checking tool protection: {
2310
+ tool: 'protectedTool',
2311
+ agentDid: 'did:key:zmock123...',
2312
+ hasDelegation: true
2313
+ }
2314
+
2315
+ 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
2316
+ [MCP-I] 🔐 Verifying delegation token with AccessControlApiService {
2317
+ tool: 'protectedTool',
2318
+ agentDid: 'did:key:zmock123...',
2319
+ hasDelegationToken: true,
2320
+ hasConsentProof: false,
2321
+ requiredScopes: [ 'files:write' ]
2322
+ }
2323
+
2324
+ 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
2325
+ [MCP-I] ✅ Delegation verification SUCCEEDED {
2326
+ tool: 'protectedTool',
2327
+ agentDid: 'did:key:zmock123...',
2328
+ delegationId: 'test-delegation-id',
2329
+ credentialScopes: [ 'files:write' ],
2330
+ requiredScopes: [ 'files:write' ]
2331
+ }
2332
+
2333
+
2334
+  ❯ src/__tests__/cache/tool-protection-cache.test.ts 49/49
2335
+  ❯ src/__tests__/runtime/base-extensions.test.ts [queued]
2336
+  ❯ src/__tests__/runtime/base.test.ts 55/55
2337
+  ❯ src/__tests__/runtime/route-interception.test.ts 0/21
2338
+  ❯ src/__tests__/runtime/tool-protection-enforcement.test.ts 0/29
2339
+  ❯ src/__tests__/services/agentshield-integration.test.ts 26/30
2340
+  ❯ src/__tests__/services/tool-protection.service.test.ts 49/49
2341
+  ❯ src/delegation/__tests__/vc-issuer.test.ts 10/21
2342
+  ❯ src/delegation/__tests__/vc-verifier.test.ts 24/35
2343
+  ❯ src/services/__tests__/access-control.integration.test.ts 0/9
2344
+  ❯ src/services/__tests__/access-control.proof-response-validation.test.ts 12/12
2345
+  ❯ src/services/__tests__/proof-verifier.integration.test.ts 0/13
2346
+  ❯ src/services/__tests__/storage.service.test.ts 17/17
2347
+
2348
+  Test Files 6 passed (44)
2349
+  Tests 265 passed (363)
2350
+  Start at 01:06:38
2351
+  Duration 630ms
2352
+ [?2026l[?2026hstderr | 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
2353
+ [MCP-I] ⚠️ Delegation has user_identifier but session missing userDid {
2354
+ tool: 'protectedTool',
2355
+ agentDid: 'did:key:zmock123...',
2356
+ delegationUserIdentifier: 'did:key:zUserA123456...',
2357
+ sessionId: 'session123...'
2358
+ }
2359
+
2360
+
2361
+  ❯ src/__tests__/cache/tool-protection-cache.test.ts 49/49
2362
+  ❯ src/__tests__/runtime/base-extensions.test.ts [queued]
2363
+  ❯ src/__tests__/runtime/base.test.ts 55/55
2364
+  ❯ src/__tests__/runtime/route-interception.test.ts 0/21
2365
+  ❯ src/__tests__/runtime/tool-protection-enforcement.test.ts 0/29
2366
+  ❯ src/__tests__/services/agentshield-integration.test.ts 26/30
2367
+  ❯ src/__tests__/services/tool-protection.service.test.ts 49/49
2368
+  ❯ src/delegation/__tests__/vc-issuer.test.ts 10/21
2369
+  ❯ src/delegation/__tests__/vc-verifier.test.ts 24/35
2370
+  ❯ src/services/__tests__/access-control.integration.test.ts 0/9
2371
+  ❯ src/services/__tests__/access-control.proof-response-validation.test.ts 12/12
2372
+  ❯ src/services/__tests__/proof-verifier.integration.test.ts 0/13
2373
+  ❯ src/services/__tests__/storage.service.test.ts 17/17
2374
+
2375
+  Test Files 6 passed (44)
2376
+  Tests 265 passed (363)
2377
+  Start at 01:06:38
2378
+  Duration 630ms
2379
+ [?2026l[?2026hstdout | src/__tests__/runtime/tool-protection-enforcement.test.ts > MCPIRuntimeBase - Tool Protection Enforcement > processToolCall with tool protection > should create proof after successful tool execution
2380
+ [MCP-I] Checking tool protection: {
2381
+ tool: 'unprotectedTool',
2382
+ agentDid: 'did:key:zmock123...',
2383
+ hasDelegation: false
2384
+ }
2385
+
2386
+ stdout | src/__tests__/runtime/tool-protection-enforcement.test.ts > MCPIRuntimeBase - Tool Protection Enforcement > processToolCall with tool protection > should create proof after successful tool execution
2387
+ [MCP-I] Tool protection check passed (no delegation required) {
2388
+ tool: 'unprotectedTool',
2389
+ agentDid: 'did:key:zmock123...',
2390
+ reason: 'Tool not configured to require delegation'
2391
+ }
2392
+
2393
+ 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
2394
+ [MCP-I] Checking tool protection: {
2395
+ tool: 'protectedTool',
2396
+ agentDid: 'did:key:zmock123...',
2397
+ hasDelegation: false
2398
+ }
2399
+
2400
+
2401
+  ❯ src/__tests__/cache/tool-protection-cache.test.ts 49/49
2402
+  ❯ src/__tests__/runtime/base-extensions.test.ts [queued]
2403
+  ❯ src/__tests__/runtime/base.test.ts 55/55
2404
+  ❯ src/__tests__/runtime/route-interception.test.ts 0/21
2405
+  ❯ src/__tests__/runtime/tool-protection-enforcement.test.ts 0/29
2406
+  ❯ src/__tests__/services/agentshield-integration.test.ts 26/30
2407
+  ❯ src/__tests__/services/tool-protection.service.test.ts 49/49
2408
+  ❯ src/delegation/__tests__/vc-issuer.test.ts 10/21
2409
+  ❯ src/delegation/__tests__/vc-verifier.test.ts 24/35
2410
+  ❯ src/services/__tests__/access-control.integration.test.ts 0/9
2411
+  ❯ src/services/__tests__/access-control.proof-response-validation.test.ts 12/12
2412
+  ❯ src/services/__tests__/proof-verifier.integration.test.ts 0/13
2413
+  ❯ src/services/__tests__/storage.service.test.ts 17/17
2414
+
2415
+  Test Files 6 passed (44)
2416
+  Tests 265 passed (363)
2417
+  Start at 01:06:38
2418
+  Duration 630ms
2419
+ [?2026l[?2026hstderr | 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
2420
+ [MCP-I] BLOCKED: Tool requires delegation but none provided {
2421
+ tool: 'protectedTool',
2422
+ requiredScopes: [ 'files:write' ],
2423
+ agentDid: 'did:key:zmock123...',
2424
+ resumeToken: 'resume_3dx1la_mie8fxq6',
2425
+ consentUrl: 'https://kya.vouched.id/bouncer/consent?tool=protectedTool&scopes=files%3Awrite&session_id=session123&agent_did=&resume_token=resume_3dx1la_mie8fxq6'
2426
+ }
2427
+
2428
+
2429
+  ❯ src/__tests__/cache/tool-protection-cache.test.ts 49/49
2430
+  ❯ src/__tests__/runtime/base-extensions.test.ts [queued]
2431
+  ❯ src/__tests__/runtime/base.test.ts 55/55
2432
+  ❯ src/__tests__/runtime/route-interception.test.ts 0/21
2433
+  ❯ src/__tests__/runtime/tool-protection-enforcement.test.ts 0/29
2434
+  ❯ src/__tests__/services/agentshield-integration.test.ts 26/30
2435
+  ❯ src/__tests__/services/tool-protection.service.test.ts 49/49
2436
+  ❯ src/delegation/__tests__/vc-issuer.test.ts 10/21
2437
+  ❯ src/delegation/__tests__/vc-verifier.test.ts 24/35
2438
+  ❯ src/services/__tests__/access-control.integration.test.ts 0/9
2439
+  ❯ src/services/__tests__/access-control.proof-response-validation.test.ts 12/12
2440
+  ❯ src/services/__tests__/proof-verifier.integration.test.ts 0/13
2441
+  ❯ src/services/__tests__/storage.service.test.ts 17/17
2442
+
2443
+  Test Files 6 passed (44)
2444
+  Tests 265 passed (363)
2445
+  Start at 01:06:38
2446
+  Duration 630ms
2447
+ [?2026l[?2026hstdout | src/__tests__/runtime/tool-protection-enforcement.test.ts > MCPIRuntimeBase - Tool Protection Enforcement > DelegationRequiredError details > should include tool name in error
2448
+ [MCP-I] Checking tool protection: {
2449
+ tool: 'protectedTool',
2450
+ agentDid: 'did:key:zmock123...',
2451
+ hasDelegation: false
2452
+ }
2453
+
2454
+
2455
+  ❯ src/__tests__/cache/tool-protection-cache.test.ts 49/49
2456
+  ❯ src/__tests__/runtime/base-extensions.test.ts [queued]
2457
+  ❯ src/__tests__/runtime/base.test.ts 55/55
2458
+  ❯ src/__tests__/runtime/route-interception.test.ts 0/21
2459
+  ❯ src/__tests__/runtime/tool-protection-enforcement.test.ts 0/29
2460
+  ❯ src/__tests__/services/agentshield-integration.test.ts 26/30
2461
+  ❯ src/__tests__/services/tool-protection.service.test.ts 49/49
2462
+  ❯ src/delegation/__tests__/vc-issuer.test.ts 10/21
2463
+  ❯ src/delegation/__tests__/vc-verifier.test.ts 24/35
2464
+  ❯ src/services/__tests__/access-control.integration.test.ts 0/9
2465
+  ❯ src/services/__tests__/access-control.proof-response-validation.test.ts 12/12
2466
+  ❯ src/services/__tests__/proof-verifier.integration.test.ts 0/13
2467
+  ❯ src/services/__tests__/storage.service.test.ts 17/17
2468
+
2469
+  Test Files 6 passed (44)
2470
+  Tests 265 passed (363)
2471
+  Start at 01:06:38
2472
+  Duration 630ms
2473
+ [?2026l[?2026hstderr | src/__tests__/runtime/tool-protection-enforcement.test.ts > MCPIRuntimeBase - Tool Protection Enforcement > DelegationRequiredError details > should include tool name in error
2474
+ [MCP-I] BLOCKED: Tool requires delegation but none provided {
2475
+ tool: 'protectedTool',
2476
+ requiredScopes: [ 'files:write' ],
2477
+ agentDid: 'did:key:zmock123...',
2478
+ resumeToken: 'resume_3dx1la_mie8fxq7',
2479
+ consentUrl: 'https://kya.vouched.id/bouncer/consent?tool=protectedTool&scopes=files%3Awrite&session_id=session123&agent_did=&resume_token=resume_3dx1la_mie8fxq7'
2480
+ }
2481
+
2482
+
2483
+  ❯ src/__tests__/cache/tool-protection-cache.test.ts 49/49
2484
+  ❯ src/__tests__/runtime/base-extensions.test.ts [queued]
2485
+  ❯ src/__tests__/runtime/base.test.ts 55/55
2486
+  ❯ src/__tests__/runtime/route-interception.test.ts 0/21
2487
+  ❯ src/__tests__/runtime/tool-protection-enforcement.test.ts 0/29
2488
+  ❯ src/__tests__/services/agentshield-integration.test.ts 26/30
2489
+  ❯ src/__tests__/services/tool-protection.service.test.ts 49/49
2490
+  ❯ src/delegation/__tests__/vc-issuer.test.ts 10/21
2491
+  ❯ src/delegation/__tests__/vc-verifier.test.ts 24/35
2492
+  ❯ src/services/__tests__/access-control.integration.test.ts 0/9
2493
+  ❯ src/services/__tests__/access-control.proof-response-validation.test.ts 12/12
2494
+  ❯ src/services/__tests__/proof-verifier.integration.test.ts 0/13
2495
+  ❯ src/services/__tests__/storage.service.test.ts 17/17
2496
+
2497
+  Test Files 6 passed (44)
2498
+  Tests 265 passed (363)
2499
+  Start at 01:06:38
2500
+  Duration 630ms
2501
+ [?2026l[?2026hstdout | src/__tests__/runtime/tool-protection-enforcement.test.ts > MCPIRuntimeBase - Tool Protection Enforcement > DelegationRequiredError details > should include required scopes in error
2502
+ [MCP-I] Checking tool protection: {
2503
+ tool: 'protectedTool',
2504
+ agentDid: 'did:key:zmock123...',
2505
+ hasDelegation: false
2506
+ }
2507
+
2508
+
2509
+  ❯ src/__tests__/cache/tool-protection-cache.test.ts 49/49
2510
+  ❯ src/__tests__/runtime/base-extensions.test.ts [queued]
2511
+  ❯ src/__tests__/runtime/base.test.ts 55/55
2512
+  ❯ src/__tests__/runtime/route-interception.test.ts 0/21
2513
+  ❯ src/__tests__/runtime/tool-protection-enforcement.test.ts 0/29
2514
+  ❯ src/__tests__/services/agentshield-integration.test.ts 26/30
2515
+  ❯ src/__tests__/services/tool-protection.service.test.ts 49/49
2516
+  ❯ src/delegation/__tests__/vc-issuer.test.ts 10/21
2517
+  ❯ src/delegation/__tests__/vc-verifier.test.ts 24/35
2518
+  ❯ src/services/__tests__/access-control.integration.test.ts 0/9
2519
+  ❯ src/services/__tests__/access-control.proof-response-validation.test.ts 12/12
2520
+  ❯ src/services/__tests__/proof-verifier.integration.test.ts 0/13
2521
+  ❯ src/services/__tests__/storage.service.test.ts 17/17
2522
+
2523
+  Test Files 6 passed (44)
2524
+  Tests 265 passed (363)
2525
+  Start at 01:06:38
2526
+  Duration 630ms
2527
+ [?2026l[?2026hstderr | src/__tests__/runtime/tool-protection-enforcement.test.ts > MCPIRuntimeBase - Tool Protection Enforcement > DelegationRequiredError details > should include required scopes in error
2528
+ [MCP-I] BLOCKED: Tool requires delegation but none provided {
2529
+ tool: 'protectedTool',
2530
+ requiredScopes: [ 'files:write', 'files:read' ],
2531
+ agentDid: 'did:key:zmock123...',
2532
+ resumeToken: 'resume_3dx1kf_mie8fxq7',
2533
+ consentUrl: 'https://kya.vouched.id/bouncer/consent?tool=protectedTool&scopes=files%3Awrite%2Cfiles%3Aread&session_id=session123&agent_did=&resume_token=resume_3dx1kf_mie8fxq7'
2534
+ }
2535
+
2536
+
2537
+  ❯ src/__tests__/cache/tool-protection-cache.test.ts 49/49
2538
+  ❯ src/__tests__/runtime/base-extensions.test.ts [queued]
2539
+  ❯ src/__tests__/runtime/base.test.ts 55/55
2540
+  ❯ src/__tests__/runtime/route-interception.test.ts 0/21
2541
+  ❯ src/__tests__/runtime/tool-protection-enforcement.test.ts 0/29
2542
+  ❯ src/__tests__/services/agentshield-integration.test.ts 26/30
2543
+  ❯ src/__tests__/services/tool-protection.service.test.ts 49/49
2544
+  ❯ src/delegation/__tests__/vc-issuer.test.ts 10/21
2545
+  ❯ src/delegation/__tests__/vc-verifier.test.ts 24/35
2546
+  ❯ src/services/__tests__/access-control.integration.test.ts 0/9
2547
+  ❯ src/services/__tests__/access-control.proof-response-validation.test.ts 12/12
2548
+  ❯ src/services/__tests__/proof-verifier.integration.test.ts 0/13
2549
+  ❯ src/services/__tests__/storage.service.test.ts 17/17
2550
+
2551
+  Test Files 6 passed (44)
2552
+  Tests 265 passed (363)
2553
+  Start at 01:06:38
2554
+  Duration 630ms
2555
+ [?2026l[?2026hstdout | src/__tests__/runtime/tool-protection-enforcement.test.ts > MCPIRuntimeBase - Tool Protection Enforcement > DelegationRequiredError details > should include consent URL in error
2556
+ [MCP-I] Checking tool protection: {
2557
+ tool: 'protectedTool',
2558
+ agentDid: 'did:key:zmock123...',
2559
+ hasDelegation: false
2560
+ }
2561
+
2562
+
2563
+  ❯ src/__tests__/cache/tool-protection-cache.test.ts 49/49
2564
+  ❯ src/__tests__/runtime/base-extensions.test.ts [queued]
2565
+  ❯ src/__tests__/runtime/base.test.ts 55/55
2566
+  ❯ src/__tests__/runtime/route-interception.test.ts 0/21
2567
+  ❯ src/__tests__/runtime/tool-protection-enforcement.test.ts 0/29
2568
+  ❯ src/__tests__/services/agentshield-integration.test.ts 26/30
2569
+  ❯ src/__tests__/services/tool-protection.service.test.ts 49/49
2570
+  ❯ src/delegation/__tests__/vc-issuer.test.ts 10/21
2571
+  ❯ src/delegation/__tests__/vc-verifier.test.ts 24/35
2572
+  ❯ src/services/__tests__/access-control.integration.test.ts 0/9
2573
+  ❯ src/services/__tests__/access-control.proof-response-validation.test.ts 12/12
2574
+  ❯ src/services/__tests__/proof-verifier.integration.test.ts 0/13
2575
+  ❯ src/services/__tests__/storage.service.test.ts 17/17
2576
+
2577
+  Test Files 6 passed (44)
2578
+  Tests 265 passed (363)
2579
+  Start at 01:06:38
2580
+  Duration 630ms
2581
+ [?2026l[?2026hstderr | src/__tests__/runtime/tool-protection-enforcement.test.ts > MCPIRuntimeBase - Tool Protection Enforcement > DelegationRequiredError details > should include consent URL in error
2582
+ [MCP-I] BLOCKED: Tool requires delegation but none provided {
2583
+ tool: 'protectedTool',
2584
+ requiredScopes: [ 'files:write' ],
2585
+ agentDid: 'did:key:zmock123...',
2586
+ resumeToken: 'resume_3dx1kf_mie8fxq7',
2587
+ consentUrl: 'https://kya.vouched.id/bouncer/consent?tool=protectedTool&scopes=files%3Awrite&session_id=session123&agent_did=&resume_token=resume_3dx1kf_mie8fxq7'
2588
+ }
2589
+
2590
+
2591
+  ❯ src/__tests__/cache/tool-protection-cache.test.ts 49/49
2592
+  ❯ src/__tests__/runtime/base-extensions.test.ts [queued]
2593
+  ❯ src/__tests__/runtime/base.test.ts 55/55
2594
+  ❯ src/__tests__/runtime/route-interception.test.ts 0/21
2595
+  ❯ src/__tests__/runtime/tool-protection-enforcement.test.ts 0/29
2596
+  ❯ src/__tests__/services/agentshield-integration.test.ts 26/30
2597
+  ❯ src/__tests__/services/tool-protection.service.test.ts 49/49
2598
+  ❯ src/delegation/__tests__/vc-issuer.test.ts 10/21
2599
+  ❯ src/delegation/__tests__/vc-verifier.test.ts 24/35
2600
+  ❯ src/services/__tests__/access-control.integration.test.ts 0/9
2601
+  ❯ src/services/__tests__/access-control.proof-response-validation.test.ts 12/12
2602
+  ❯ src/services/__tests__/proof-verifier.integration.test.ts 0/13
2603
+  ❯ src/services/__tests__/storage.service.test.ts 17/17
2604
+
2605
+  Test Files 6 passed (44)
2606
+  Tests 265 passed (363)
2607
+  Start at 01:06:38
2608
+  Duration 630ms
2609
+ [?2026l[?2026hstdout | src/__tests__/runtime/tool-protection-enforcement.test.ts > MCPIRuntimeBase - Tool Protection Enforcement > DelegationRequiredError details > should include resume token in error
2610
+ [MCP-I] Checking tool protection: {
2611
+ tool: 'protectedTool',
2612
+ agentDid: 'did:key:zmock123...',
2613
+ hasDelegation: false
2614
+ }
2615
+
2616
+
2617
+  ❯ src/__tests__/cache/tool-protection-cache.test.ts 49/49
2618
+  ❯ src/__tests__/runtime/base-extensions.test.ts [queued]
2619
+  ❯ src/__tests__/runtime/base.test.ts 55/55
2620
+  ❯ src/__tests__/runtime/route-interception.test.ts 0/21
2621
+  ❯ src/__tests__/runtime/tool-protection-enforcement.test.ts 0/29
2622
+  ❯ src/__tests__/services/agentshield-integration.test.ts 26/30
2623
+  ❯ src/__tests__/services/tool-protection.service.test.ts 49/49
2624
+  ❯ src/delegation/__tests__/vc-issuer.test.ts 10/21
2625
+  ❯ src/delegation/__tests__/vc-verifier.test.ts 24/35
2626
+  ❯ src/services/__tests__/access-control.integration.test.ts 0/9
2627
+  ❯ src/services/__tests__/access-control.proof-response-validation.test.ts 12/12
2628
+  ❯ src/services/__tests__/proof-verifier.integration.test.ts 0/13
2629
+  ❯ src/services/__tests__/storage.service.test.ts 17/17
2630
+
2631
+  Test Files 6 passed (44)
2632
+  Tests 265 passed (363)
2633
+  Start at 01:06:38
2634
+  Duration 630ms
2635
+ [?2026l[?2026hstderr | src/__tests__/runtime/tool-protection-enforcement.test.ts > MCPIRuntimeBase - Tool Protection Enforcement > DelegationRequiredError details > should include resume token in error
2636
+ [MCP-I] BLOCKED: Tool requires delegation but none provided {
2637
+ tool: 'protectedTool',
2638
+ requiredScopes: [ 'files:write' ],
2639
+ agentDid: 'did:key:zmock123...',
2640
+ resumeToken: 'resume_3dx1kf_mie8fxq7',
2641
+ consentUrl: 'https://kya.vouched.id/bouncer/consent?tool=protectedTool&scopes=files%3Awrite&session_id=session123&agent_did=&resume_token=resume_3dx1kf_mie8fxq7'
2642
+ }
2643
+
2644
+
2645
+  ❯ src/__tests__/cache/tool-protection-cache.test.ts 49/49
2646
+  ❯ src/__tests__/runtime/base-extensions.test.ts [queued]
2647
+  ❯ src/__tests__/runtime/base.test.ts 55/55
2648
+  ❯ src/__tests__/runtime/route-interception.test.ts 0/21
2649
+  ❯ src/__tests__/runtime/tool-protection-enforcement.test.ts 0/29
2650
+  ❯ src/__tests__/services/agentshield-integration.test.ts 26/30
2651
+  ❯ src/__tests__/services/tool-protection.service.test.ts 49/49
2652
+  ❯ src/delegation/__tests__/vc-issuer.test.ts 10/21
2653
+  ❯ src/delegation/__tests__/vc-verifier.test.ts 24/35
2654
+  ❯ src/services/__tests__/access-control.integration.test.ts 0/9
2655
+  ❯ src/services/__tests__/access-control.proof-response-validation.test.ts 12/12
2656
+  ❯ src/services/__tests__/proof-verifier.integration.test.ts 0/13
2657
+  ❯ src/services/__tests__/storage.service.test.ts 17/17
2658
+
2659
+  Test Files 6 passed (44)
2660
+  Tests 265 passed (363)
2661
+  Start at 01:06:38
2662
+  Duration 630ms
2663
+ [?2026l[?2026hstdout | src/__tests__/runtime/tool-protection-enforcement.test.ts > MCPIRuntimeBase - Tool Protection Enforcement > DelegationRequiredError details > should include intercepted call context in error
2664
+ [MCP-I] Checking tool protection: {
2665
+ tool: 'protectedTool',
2666
+ agentDid: 'did:key:zmock123...',
2667
+ hasDelegation: false
2668
+ }
2669
+
2670
+
2671
+  ❯ src/__tests__/cache/tool-protection-cache.test.ts 49/49
2672
+  ❯ src/__tests__/runtime/base-extensions.test.ts [queued]
2673
+  ❯ src/__tests__/runtime/base.test.ts 55/55
2674
+  ❯ src/__tests__/runtime/route-interception.test.ts 0/21
2675
+  ❯ src/__tests__/runtime/tool-protection-enforcement.test.ts 0/29
2676
+  ❯ src/__tests__/services/agentshield-integration.test.ts 26/30
2677
+  ❯ src/__tests__/services/tool-protection.service.test.ts 49/49
2678
+  ❯ src/delegation/__tests__/vc-issuer.test.ts 10/21
2679
+  ❯ src/delegation/__tests__/vc-verifier.test.ts 24/35
2680
+  ❯ src/services/__tests__/access-control.integration.test.ts 0/9
2681
+  ❯ src/services/__tests__/access-control.proof-response-validation.test.ts 12/12
2682
+  ❯ src/services/__tests__/proof-verifier.integration.test.ts 0/13
2683
+  ❯ src/services/__tests__/storage.service.test.ts 17/17
2684
+
2685
+  Test Files 6 passed (44)
2686
+  Tests 265 passed (363)
2687
+  Start at 01:06:38
2688
+  Duration 630ms
2689
+ [?2026l[?2026hstderr | src/__tests__/runtime/tool-protection-enforcement.test.ts > MCPIRuntimeBase - Tool Protection Enforcement > DelegationRequiredError details > should include intercepted call context in error
2690
+ [MCP-I] BLOCKED: Tool requires delegation but none provided {
2691
+ tool: 'protectedTool',
2692
+ requiredScopes: [ 'files:write' ],
2693
+ agentDid: 'did:key:zmock123...',
2694
+ resumeToken: 'resume_cst5nw_mie8fxq7',
2695
+ consentUrl: 'https://kya.vouched.id/bouncer/consent?tool=protectedTool&scopes=files%3Awrite&session_id=session123&agent_did=&resume_token=resume_cst5nw_mie8fxq7'
2696
+ }
2697
+
2698
+
2699
+  ❯ src/__tests__/cache/tool-protection-cache.test.ts 49/49
2700
+  ❯ src/__tests__/runtime/base-extensions.test.ts [queued]
2701
+  ❯ src/__tests__/runtime/base.test.ts 55/55
2702
+  ❯ src/__tests__/runtime/route-interception.test.ts 0/21
2703
+  ❯ src/__tests__/runtime/tool-protection-enforcement.test.ts 0/29
2704
+  ❯ src/__tests__/services/agentshield-integration.test.ts 26/30
2705
+  ❯ src/__tests__/services/tool-protection.service.test.ts 49/49
2706
+  ❯ src/delegation/__tests__/vc-issuer.test.ts 10/21
2707
+  ❯ src/delegation/__tests__/vc-verifier.test.ts 24/35
2708
+  ❯ src/services/__tests__/access-control.integration.test.ts 0/9
2709
+  ❯ src/services/__tests__/access-control.proof-response-validation.test.ts 12/12
2710
+  ❯ src/services/__tests__/proof-verifier.integration.test.ts 0/13
2711
+  ❯ src/services/__tests__/storage.service.test.ts 17/17
2712
+
2713
+  Test Files 6 passed (44)
2714
+  Tests 265 passed (363)
2715
+  Start at 01:06:38
2716
+  Duration 630ms
2717
+ [?2026l[?2026hstdout | src/__tests__/runtime/tool-protection-enforcement.test.ts > MCPIRuntimeBase - Tool Protection Enforcement > audit logging > should log tool protection check when audit enabled
2718
+ [MCP-I] Checking tool protection: {
2719
+ tool: 'testTool',
2720
+ agentDid: 'did:key:zmock123...',
2721
+ hasDelegation: false
2722
+ }
2723
+
2724
+ stdout | src/__tests__/runtime/tool-protection-enforcement.test.ts > MCPIRuntimeBase - Tool Protection Enforcement > audit logging > should log tool protection check when audit enabled
2725
+ [MCP-I] Tool protection check passed (no delegation required) {
2726
+ tool: 'testTool',
2727
+ agentDid: 'did:key:zmock123...',
2728
+ reason: 'Tool not configured to require delegation'
2729
+ }
2730
+
2731
+ stdout | src/__tests__/runtime/tool-protection-enforcement.test.ts > MCPIRuntimeBase - Tool Protection Enforcement > audit logging > should log blocked tool call when audit enabled
2732
+ [MCP-I] Checking tool protection: {
2733
+ tool: 'protectedTool',
2734
+ agentDid: 'did:key:zmock123...',
2735
+ hasDelegation: false
2736
+ }
2737
+
2738
+ 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
2739
+ [MCP-I] Checking tool protection: {
2740
+ tool: 'testTool',
2741
+ agentDid: 'did:key:zmock123...',
2742
+ hasDelegation: false
2743
+ }
2744
+
2745
+ 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
2746
+ [MCP-I] Tool protection check passed (no delegation required) {
2747
+ tool: 'testTool',
2748
+ agentDid: 'did:key:zmock123...',
2749
+ reason: 'Tool not configured to require delegation'
2750
+ }
2751
+
2752
+ stdout | src/__tests__/runtime/tool-protection-enforcement.test.ts > MCPIRuntimeBase - Tool Protection Enforcement > tool protection service integration > should handle tool protection service errors gracefully
2753
+ [MCP-I] Checking tool protection: {
2754
+ tool: 'testTool',
2755
+ agentDid: 'did:key:zmock123...',
2756
+ hasDelegation: false
2757
+ }
2758
+
2759
+ stdout | src/__tests__/runtime/tool-protection-enforcement.test.ts > MCPIRuntimeBase - Tool Protection Enforcement > edge cases > should handle empty required scopes array
2760
+ [MCP-I] Checking tool protection: {
2761
+ tool: 'protectedTool',
2762
+ agentDid: 'did:key:zmock123...',
2763
+ hasDelegation: false
2764
+ }
2765
+
2766
+
2767
+  ❯ src/__tests__/cache/tool-protection-cache.test.ts 49/49
2768
+  ❯ src/__tests__/runtime/base-extensions.test.ts [queued]
2769
+  ❯ src/__tests__/runtime/base.test.ts 55/55
2770
+  ❯ src/__tests__/runtime/route-interception.test.ts 0/21
2771
+  ❯ src/__tests__/runtime/tool-protection-enforcement.test.ts 0/29
2772
+  ❯ src/__tests__/services/agentshield-integration.test.ts 26/30
2773
+  ❯ src/__tests__/services/tool-protection.service.test.ts 49/49
2774
+  ❯ src/delegation/__tests__/vc-issuer.test.ts 10/21
2775
+  ❯ src/delegation/__tests__/vc-verifier.test.ts 24/35
2776
+  ❯ src/services/__tests__/access-control.integration.test.ts 0/9
2777
+  ❯ src/services/__tests__/access-control.proof-response-validation.test.ts 12/12
2778
+  ❯ src/services/__tests__/proof-verifier.integration.test.ts 0/13
2779
+  ❯ src/services/__tests__/storage.service.test.ts 17/17
2780
+
2781
+  Test Files 6 passed (44)
2782
+  Tests 265 passed (363)
2783
+  Start at 01:06:38
2784
+  Duration 630ms
2785
+ [?2026l[?2026hstderr | src/__tests__/runtime/tool-protection-enforcement.test.ts > MCPIRuntimeBase - Tool Protection Enforcement > edge cases > should handle empty required scopes array
2786
+ [MCP-I] BLOCKED: Tool requires delegation but none provided {
2787
+ tool: 'protectedTool',
2788
+ requiredScopes: [],
2789
+ agentDid: 'did:key:zmock123...',
2790
+ resumeToken: 'resume_3dx1ip_mie8fxq9',
2791
+ consentUrl: 'https://kya.vouched.id/bouncer/consent?tool=protectedTool&scopes=&session_id=session123&agent_did=&resume_token=resume_3dx1ip_mie8fxq9'
2792
+ }
2793
+
2794
+
2795
+  ❯ src/__tests__/cache/tool-protection-cache.test.ts 49/49
2796
+  ❯ src/__tests__/runtime/base-extensions.test.ts [queued]
2797
+  ❯ src/__tests__/runtime/base.test.ts 55/55
2798
+  ❯ src/__tests__/runtime/route-interception.test.ts 0/21
2799
+  ❯ src/__tests__/runtime/tool-protection-enforcement.test.ts 0/29
2800
+  ❯ src/__tests__/services/agentshield-integration.test.ts 26/30
2801
+  ❯ src/__tests__/services/tool-protection.service.test.ts 49/49
2802
+  ❯ src/delegation/__tests__/vc-issuer.test.ts 10/21
2803
+  ❯ src/delegation/__tests__/vc-verifier.test.ts 24/35
2804
+  ❯ src/services/__tests__/access-control.integration.test.ts 0/9
2805
+  ❯ src/services/__tests__/access-control.proof-response-validation.test.ts 12/12
2806
+  ❯ src/services/__tests__/proof-verifier.integration.test.ts 0/13
2807
+  ❯ src/services/__tests__/storage.service.test.ts 17/17
2808
+
2809
+  Test Files 6 passed (44)
2810
+  Tests 265 passed (363)
2811
+  Start at 01:06:38
2812
+  Duration 630ms
2813
+ [?2026l[?2026hstdout | src/__tests__/runtime/tool-protection-enforcement.test.ts > MCPIRuntimeBase - Tool Protection Enforcement > edge cases > should handle multiple required scopes
2814
+ [MCP-I] Checking tool protection: {
2815
+ tool: 'protectedTool',
2816
+ agentDid: 'did:key:zmock123...',
2817
+ hasDelegation: false
2818
+ }
2819
+
2820
+
2821
+  ❯ src/__tests__/cache/tool-protection-cache.test.ts 49/49
2822
+  ❯ src/__tests__/runtime/base-extensions.test.ts [queued]
2823
+  ❯ src/__tests__/runtime/base.test.ts 55/55
2824
+  ❯ src/__tests__/runtime/route-interception.test.ts 0/21
2825
+  ❯ src/__tests__/runtime/tool-protection-enforcement.test.ts 0/29
2826
+  ❯ src/__tests__/services/agentshield-integration.test.ts 26/30
2827
+  ❯ src/__tests__/services/tool-protection.service.test.ts 49/49
2828
+  ❯ src/delegation/__tests__/vc-issuer.test.ts 10/21
2829
+  ❯ src/delegation/__tests__/vc-verifier.test.ts 24/35
2830
+  ❯ src/services/__tests__/access-control.integration.test.ts 0/9
2831
+  ❯ src/services/__tests__/access-control.proof-response-validation.test.ts 12/12
2832
+  ❯ src/services/__tests__/proof-verifier.integration.test.ts 0/13
2833
+  ❯ src/services/__tests__/storage.service.test.ts 17/17
2834
+
2835
+  Test Files 6 passed (44)
2836
+  Tests 265 passed (363)
2837
+  Start at 01:06:38
2838
+  Duration 630ms
2839
+ [?2026l[?2026hstderr | src/__tests__/runtime/tool-protection-enforcement.test.ts > MCPIRuntimeBase - Tool Protection Enforcement > edge cases > should handle multiple required scopes
2840
+ [MCP-I] BLOCKED: Tool requires delegation but none provided {
2841
+ tool: 'protectedTool',
2842
+ requiredScopes: [ 'scope1', 'scope2', 'scope3' ],
2843
+ agentDid: 'did:key:zmock123...',
2844
+ resumeToken: 'resume_3dx1ip_mie8fxq9',
2845
+ consentUrl: 'https://kya.vouched.id/bouncer/consent?tool=protectedTool&scopes=scope1%2Cscope2%2Cscope3&session_id=session123&agent_did=&resume_token=resume_3dx1ip_mie8fxq9'
2846
+ }
2847
+
2848
+
2849
+  ❯ src/__tests__/cache/tool-protection-cache.test.ts 49/49
2850
+  ❯ src/__tests__/runtime/base-extensions.test.ts [queued]
2851
+  ❯ src/__tests__/runtime/base.test.ts 55/55
2852
+  ❯ src/__tests__/runtime/route-interception.test.ts 0/21
2853
+  ❯ src/__tests__/runtime/tool-protection-enforcement.test.ts 0/29
2854
+  ❯ src/__tests__/services/agentshield-integration.test.ts 26/30
2855
+  ❯ src/__tests__/services/tool-protection.service.test.ts 49/49
2856
+  ❯ src/delegation/__tests__/vc-issuer.test.ts 10/21
2857
+  ❯ src/delegation/__tests__/vc-verifier.test.ts 24/35
2858
+  ❯ src/services/__tests__/access-control.integration.test.ts 0/9
2859
+  ❯ src/services/__tests__/access-control.proof-response-validation.test.ts 12/12
2860
+  ❯ src/services/__tests__/proof-verifier.integration.test.ts 0/13
2861
+  ❯ src/services/__tests__/storage.service.test.ts 17/17
2862
+
2863
+  Test Files 6 passed (44)
2864
+  Tests 265 passed (363)
2865
+  Start at 01:06:38
2866
+  Duration 630ms
2867
+ [?2026l[?2026hstdout | src/__tests__/runtime/tool-protection-enforcement.test.ts > MCPIRuntimeBase - Tool Protection Enforcement > edge cases > should handle session without id
2868
+ [MCP-I] Checking tool protection: {
2869
+ tool: 'protectedTool',
2870
+ agentDid: 'did:key:zmock123...',
2871
+ hasDelegation: false
2872
+ }
2873
+
2874
+
2875
+  ❯ src/__tests__/cache/tool-protection-cache.test.ts 49/49
2876
+  ❯ src/__tests__/runtime/base-extensions.test.ts [queued]
2877
+  ❯ src/__tests__/runtime/base.test.ts 55/55
2878
+  ❯ src/__tests__/runtime/route-interception.test.ts 0/21
2879
+  ❯ src/__tests__/runtime/tool-protection-enforcement.test.ts 0/29
2880
+  ❯ src/__tests__/services/agentshield-integration.test.ts 26/30
2881
+  ❯ src/__tests__/services/tool-protection.service.test.ts 49/49
2882
+  ❯ src/delegation/__tests__/vc-issuer.test.ts 10/21
2883
+  ❯ src/delegation/__tests__/vc-verifier.test.ts 24/35
2884
+  ❯ src/services/__tests__/access-control.integration.test.ts 0/9
2885
+  ❯ src/services/__tests__/access-control.proof-response-validation.test.ts 12/12
2886
+  ❯ src/services/__tests__/proof-verifier.integration.test.ts 0/13
2887
+  ❯ src/services/__tests__/storage.service.test.ts 17/17
2888
+
2889
+  Test Files 6 passed (44)
2890
+  Tests 265 passed (363)
2891
+  Start at 01:06:38
2892
+  Duration 630ms
2893
+ [?2026l[?2026hstderr | src/__tests__/runtime/tool-protection-enforcement.test.ts > MCPIRuntimeBase - Tool Protection Enforcement > edge cases > should handle session without id
2894
+ [MCP-I] BLOCKED: Tool requires delegation but none provided {
2895
+ tool: 'protectedTool',
2896
+ requiredScopes: [ 'files:write' ],
2897
+ agentDid: 'did:key:zmock123...',
2898
+ resumeToken: 'resume_9o4yw1_mie8fxq9',
2899
+ consentUrl: 'https://kya.vouched.id/bouncer/consent?tool=protectedTool&scopes=files%3Awrite&session_id=&agent_did=&resume_token=resume_9o4yw1_mie8fxq9'
2900
+ }
2901
+
2902
+
2903
+  ❯ src/__tests__/cache/tool-protection-cache.test.ts 49/49
2904
+  ❯ src/__tests__/runtime/base-extensions.test.ts [queued]
2905
+  ❯ src/__tests__/runtime/base.test.ts 55/55
2906
+  ❯ src/__tests__/runtime/route-interception.test.ts 0/21
2907
+  ❯ src/__tests__/runtime/tool-protection-enforcement.test.ts 0/29
2908
+  ❯ src/__tests__/services/agentshield-integration.test.ts 26/30
2909
+  ❯ src/__tests__/services/tool-protection.service.test.ts 49/49
2910
+  ❯ src/delegation/__tests__/vc-issuer.test.ts 10/21
2911
+  ❯ src/delegation/__tests__/vc-verifier.test.ts 24/35
2912
+  ❯ src/services/__tests__/access-control.integration.test.ts 0/9
2913
+  ❯ src/services/__tests__/access-control.proof-response-validation.test.ts 12/12
2914
+  ❯ src/services/__tests__/proof-verifier.integration.test.ts 0/13
2915
+  ❯ src/services/__tests__/storage.service.test.ts 17/17
2916
+
2917
+  Test Files 6 passed (44)
2918
+  Tests 265 passed (363)
2919
+  Start at 01:06:38
2920
+  Duration 630ms
2921
+ [?2026l[?2026hstdout | src/__tests__/runtime/tool-protection-enforcement.test.ts > MCPIRuntimeBase - Tool Protection Enforcement > edge cases > should handle handler errors independently of protection
2922
+ [MCP-I] Checking tool protection: {
2923
+ tool: 'errorTool',
2924
+ agentDid: 'did:key:zmock123...',
2925
+ hasDelegation: false
2926
+ }
2927
+
2928
+ stdout | src/__tests__/runtime/tool-protection-enforcement.test.ts > MCPIRuntimeBase - Tool Protection Enforcement > edge cases > should handle handler errors independently of protection
2929
+ [MCP-I] Tool protection check passed (no delegation required) {
2930
+ tool: 'errorTool',
2931
+ agentDid: 'did:key:zmock123...',
2932
+ reason: 'Tool not configured to require delegation'
2933
+ }
2934
+
2935
+ ✓ src/__tests__/runtime/base.test.ts (55 tests) 25ms
2936
+
2937
+  ❯ src/__tests__/cache/tool-protection-cache.test.ts 49/49
2938
+  ❯ src/__tests__/runtime/base-extensions.test.ts [queued]
2939
+  ❯ src/__tests__/runtime/base.test.ts 55/55
2940
+  ❯ src/__tests__/runtime/route-interception.test.ts 0/21
2941
+  ❯ src/__tests__/runtime/tool-protection-enforcement.test.ts 0/29
2942
+  ❯ src/__tests__/services/agentshield-integration.test.ts 26/30
2943
+  ❯ src/__tests__/services/tool-protection.service.test.ts 49/49
2944
+  ❯ src/delegation/__tests__/vc-issuer.test.ts 10/21
2945
+  ❯ src/delegation/__tests__/vc-verifier.test.ts 24/35
2946
+  ❯ src/services/__tests__/access-control.integration.test.ts 0/9
2947
+  ❯ src/services/__tests__/access-control.proof-response-validation.test.ts 12/12
2948
+  ❯ src/services/__tests__/proof-verifier.integration.test.ts 0/13
2949
+  ❯ src/services/__tests__/storage.service.test.ts 17/17
2950
+
2951
+  Test Files 6 passed (44)
2952
+  Tests 265 passed (363)
2953
+  Start at 01:06:38
2954
+  Duration 630ms
2955
+ [?2026l[?2026hstderr | src/services/__tests__/access-control.integration.test.ts > AccessControlApiService Integration > Proof Submission Flow > should submit proof end-to-end
2956
+ [AccessControl] 🔍 RAW API RESPONSE (before parsing): {
2957
+ correlationId: 'f00d6bbf-782d-46be-84a5-233b9da98e7e',
2958
+ status: 200,
2959
+ statusText: '',
2960
+ headers: { 'content-type': 'application/json' },
2961
+ responseTextLength: 100,
2962
+ responseTextPreview: '{"success":true,"accepted":1,"rejected":0,"outcomes":{"success":1,"failed":0,"blocked":0,"error":0}}',
2963
+ fullResponseText: '{"success":true,"accepted":1,"rejected":0,"outcomes":{"success":1,"failed":0,"blocked":0,"error":0}}'
2964
+ }
2965
+ [AccessControl] 🔍 PARSED RESPONSE DATA: {
2966
+ correlationId: 'f00d6bbf-782d-46be-84a5-233b9da98e7e',
2967
+ status: 200,
2968
+ responseDataType: 'object',
2969
+ responseDataKeys: [ 'success', 'accepted', 'rejected', 'outcomes' ],
2970
+ responseData: '{\n' +
2971
+ ' "success": true,\n' +
2972
+ ' "accepted": 1,\n' +
2973
+ ' "rejected": 0,\n' +
2974
+ ' "outcomes": {\n' +
2975
+ ' "success": 1,\n' +
2976
+ ' "failed": 0,\n' +
2977
+ ' "blocked": 0,\n' +
2978
+ ' "error": 0\n' +
2979
+ ' }\n' +
2980
+ '}'
2981
+ }
2982
+ [AccessControl] Raw response received: {
2983
+ "success": true,
2984
+ "accepted": 1,
2985
+ "rejected": 0,
2986
+ "outcomes": {
2987
+ "success": 1,
2988
+ "failed": 0,
2989
+ "blocked": 0,
2990
+ "error": 0
2991
+ }
2992
+ }
2993
+
2994
+ stderr | src/services/__tests__/access-control.integration.test.ts > AccessControlApiService Integration > Proof Submission Flow > should handle proof submission with errors
2995
+ [AccessControl] 🔍 RAW API RESPONSE (before parsing): {
2996
+ correlationId: 'f2190937-8716-43a7-a3cd-e61fac57a507',
2997
+ status: 200,
2998
+ statusText: '',
2999
+ headers: { 'content-type': 'application/json' },
3000
+ responseTextLength: 200,
3001
+ 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"}}]}',
3002
+ 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"}}]}'
3003
+ }
3004
+ [AccessControl] 🔍 PARSED RESPONSE DATA: {
3005
+ correlationId: 'f2190937-8716-43a7-a3cd-e61fac57a507',
3006
+ status: 200,
3007
+ responseDataType: 'object',
3008
+ responseDataKeys: [ 'success', 'accepted', 'rejected', 'outcomes', 'errors' ],
3009
+ responseData: '{\n' +
3010
+ ' "success": true,\n' +
3011
+ ' "accepted": 0,\n' +
3012
+ ' "rejected": 1,\n' +
3013
+ ' "outcomes": {\n' +
3014
+ ' "success": 0,\n' +
3015
+ ' "failed": 1,\n' +
3016
+ ' "blocked": 0,\n' +
3017
+ ' "error": 0\n' +
3018
+ ' },\n' +
3019
+ ' "errors": [\n' +
3020
+ ' {\n' +
3021
+ ' "proof_index": 0,\n' +
3022
+ ' "error": {\n' +
3023
+ ' "code": "invalid_signature",\n' +
3024
+ ' "message": "Invalid JWS signature"\n' +
3025
+ ' }\n' +
3026
+ ' }\n' +
3027
+ ' ]\n' +
3028
+ '}'
3029
+ }
3030
+ [AccessControl] Raw response received: {
3031
+ "success": true,
3032
+ "accepted": 0,
3033
+ "rejected": 1,
3034
+ "outcomes": {
3035
+ "success": 0,
3036
+ "failed": 1,
3037
+ "blocked": 0,
3038
+ "error": 0
3039
+ },
3040
+ "errors": [
3041
+ {
3042
+ "proof_index": 0,
3043
+ "error": {
3044
+ "code": "invalid_signature",
3045
+ "message": "Invalid JWS signature"
3046
+ }
3047
+ }
3048
+ ]
3049
+ }
3050
+
3051
+ stderr | src/services/__tests__/access-control.integration.test.ts > AccessControlApiService Integration > Proof Verification Flow > should verify proof using ProofVerifier
3052
+ [CryptoService] Key ID mismatch
3053
+
3054
+
3055
+  ❯ src/__tests__/integration/full-flow.test.ts [queued]
3056
+  ❯ src/__tests__/providers/memory.test.ts [queued]
3057
+  ❯ src/__tests__/runtime/base-extensions.test.ts [queued]
3058
+  ❯ src/__tests__/runtime/base.test.ts 55/55
3059
+  ❯ src/__tests__/runtime/route-interception.test.ts 21/21
3060
+  ❯ src/__tests__/runtime/tool-protection-enforcement.test.ts 29/29
3061
+  ❯ src/__tests__/services/agentshield-integration.test.ts 26/30
3062
+  ❯ src/delegation/__tests__/vc-issuer.test.ts 21/21
3063
+  ❯ src/delegation/__tests__/vc-verifier.test.ts 35/35
3064
+  ❯ src/services/__tests__/access-control.integration.test.ts 7/9
3065
+  ❯ src/services/__tests__/crypto.service.test.ts 0/34
3066
+  ❯ src/services/__tests__/proof-verifier.integration.test.ts 13/13
3067
+  ❯ src/services/__tests__/proof-verifier.test.ts [queued]
3068
+
3069
+  Test Files 11 passed (44)
3070
+  Tests 356 passed | 1 skipped (397)
3071
+  Start at 01:06:38
3072
+  Duration 844ms
3073
+ [?2026l[?2026h ✓ src/__tests__/runtime/tool-protection-enforcement.test.ts (29 tests) 30ms
3074
+ ✓ src/__tests__/runtime/route-interception.test.ts (21 tests) 50ms
3075
+
3076
+  ❯ src/__tests__/integration/full-flow.test.ts [queued]
3077
+  ❯ src/__tests__/providers/memory.test.ts [queued]
3078
+  ❯ src/__tests__/runtime/base-extensions.test.ts [queued]
3079
+  ❯ src/__tests__/runtime/base.test.ts 55/55
3080
+  ❯ src/__tests__/runtime/route-interception.test.ts 21/21
3081
+  ❯ src/__tests__/runtime/tool-protection-enforcement.test.ts 29/29
3082
+  ❯ src/__tests__/services/agentshield-integration.test.ts 26/30
3083
+  ❯ src/delegation/__tests__/vc-issuer.test.ts 21/21
3084
+  ❯ src/delegation/__tests__/vc-verifier.test.ts 35/35
3085
+  ❯ src/services/__tests__/access-control.integration.test.ts 7/9
3086
+  ❯ src/services/__tests__/crypto.service.test.ts 0/34
3087
+  ❯ src/services/__tests__/proof-verifier.integration.test.ts 13/13
3088
+  ❯ src/services/__tests__/proof-verifier.test.ts [queued]
3089
+
3090
+  Test Files 11 passed (44)
3091
+  Tests 356 passed | 1 skipped (397)
3092
+  Start at 01:06:38
3093
+  Duration 844ms
3094
+ [?2026l[?2026hstderr | src/services/__tests__/proof-verifier.integration.test.ts > ProofVerifier Integration - Real DID Resolution > did:web Resolution (HTTP) > should handle HTTP errors gracefully
3095
+ [ProofVerifier] Failed to fetch public key from DID: Error: Failed to resolve did:web:nonexistent-domain-that-does-not-exist-12345.com: fetch failed
3096
+ at Object.resolveDID (/Users/dylanhobbs/Documents/@kya-os/xmcp-i/packages/mcp-i-core/src/services/__tests__/proof-verifier.integration.test.ts:143:19)
3097
+  at processTicksAndRejections (node:internal/process/task_queues:103:5)
3098
+ at ProofVerifier.fetchPublicKeyFromDID (/Users/dylanhobbs/Documents/@kya-os/xmcp-i/packages/mcp-i-core/src/services/proof-verifier.ts:348:22)
3099
+ at /Users/dylanhobbs/Documents/@kya-os/xmcp-i/packages/mcp-i-core/src/services/__tests__/proof-verifier.integration.test.ts:252:7
3100
+ 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
3101
+
3102
+ stderr | src/services/__tests__/proof-verifier.integration.test.ts > ProofVerifier Integration - Real DID Resolution > did:web Resolution (HTTP) > should handle HTTP errors gracefully
3103
+ [ProofVerifier] Failed to fetch public key from DID: Error: Failed to resolve did:web:nonexistent-domain-that-does-not-exist-12345.com: fetch failed
3104
+ at Object.resolveDID (/Users/dylanhobbs/Documents/@kya-os/xmcp-i/packages/mcp-i-core/src/services/__tests__/proof-verifier.integration.test.ts:143:19)
3105
+  at processTicksAndRejections (node:internal/process/task_queues:103:5)
3106
+ at ProofVerifier.fetchPublicKeyFromDID (/Users/dylanhobbs/Documents/@kya-os/xmcp-i/packages/mcp-i-core/src/services/proof-verifier.ts:348:22)
3107
+ at /Users/dylanhobbs/Documents/@kya-os/xmcp-i/packages/mcp-i-core/src/services/__tests__/proof-verifier.integration.test.ts:257:9
3108
+ 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
3109
+
3110
+
3111
+  ❯ src/__tests__/integration/full-flow.test.ts [queued]
3112
+  ❯ src/__tests__/providers/memory.test.ts [queued]
3113
+  ❯ src/__tests__/runtime/base-extensions.test.ts [queued]
3114
+  ❯ src/__tests__/runtime/base.test.ts 55/55
3115
+  ❯ src/__tests__/runtime/route-interception.test.ts 21/21
3116
+  ❯ src/__tests__/runtime/tool-protection-enforcement.test.ts 29/29
3117
+  ❯ src/__tests__/services/agentshield-integration.test.ts 26/30
3118
+  ❯ src/delegation/__tests__/vc-issuer.test.ts 21/21
3119
+  ❯ src/delegation/__tests__/vc-verifier.test.ts 35/35
3120
+  ❯ src/services/__tests__/access-control.integration.test.ts 7/9
3121
+  ❯ src/services/__tests__/crypto.service.test.ts 0/34
3122
+  ❯ src/services/__tests__/proof-verifier.integration.test.ts 13/13
3123
+  ❯ src/services/__tests__/proof-verifier.test.ts [queued]
3124
+
3125
+  Test Files 11 passed (44)
3126
+  Tests 356 passed | 1 skipped (397)
3127
+  Start at 01:06:38
3128
+  Duration 844ms
3129
+ [?2026l[?2026h ✓ src/delegation/__tests__/vc-verifier.test.ts (35 tests) 206ms
3130
+ ✓ src/delegation/__tests__/vc-issuer.test.ts (21 tests) 268ms
3131
+ ✓ src/services/__tests__/proof-verifier.integration.test.ts (13 tests | 1 skipped) 164ms
3132
+
3133
+  ❯ src/__tests__/integration/full-flow.test.ts [queued]
3134
+  ❯ src/__tests__/providers/memory.test.ts [queued]
3135
+  ❯ src/__tests__/runtime/base-extensions.test.ts [queued]
3136
+  ❯ src/__tests__/runtime/base.test.ts 55/55
3137
+  ❯ src/__tests__/runtime/route-interception.test.ts 21/21
3138
+  ❯ src/__tests__/runtime/tool-protection-enforcement.test.ts 29/29
3139
+  ❯ src/__tests__/services/agentshield-integration.test.ts 26/30
3140
+  ❯ src/delegation/__tests__/vc-issuer.test.ts 21/21
3141
+  ❯ src/delegation/__tests__/vc-verifier.test.ts 35/35
3142
+  ❯ src/services/__tests__/access-control.integration.test.ts 7/9
3143
+  ❯ src/services/__tests__/crypto.service.test.ts 0/34
3144
+  ❯ src/services/__tests__/proof-verifier.integration.test.ts 13/13
3145
+  ❯ src/services/__tests__/proof-verifier.test.ts [queued]
3146
+
3147
+  Test Files 11 passed (44)
3148
+  Tests 356 passed | 1 skipped (397)
3149
+  Start at 01:06:38
3150
+  Duration 844ms
3151
+ [?2026l[?2026hstderr | src/services/__tests__/crypto.service.test.ts > CryptoService > verifyEd25519 > should return false on verification error
3152
+ [CryptoService] Ed25519 verification error: Error: Verification failed
3153
+ at /Users/dylanhobbs/Documents/@kya-os/xmcp-i/packages/mcp-i-core/src/services/__tests__/crypto.service.test.ts:62:9
3154
+ 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
3155
+ 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
3156
+ 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
3157
+ at new Promise (<anonymous>)
3158
+ 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)
3159
+ 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)
3160
+  at processTicksAndRejections (node:internal/process/task_queues:103:5)
3161
+ 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)
3162
+ 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)
3163
+
3164
+ stderr | src/services/__tests__/crypto.service.test.ts > CryptoService > verifyJWS > should reject invalid JWK format
3165
+ [CryptoService] Invalid Ed25519 JWK format
3166
+
3167
+ stderr | src/services/__tests__/crypto.service.test.ts > CryptoService > verifyJWS > should reject JWK with wrong kty
3168
+ [CryptoService] Invalid Ed25519 JWK format
3169
+
3170
+ stderr | src/services/__tests__/crypto.service.test.ts > CryptoService > verifyJWS > should reject JWK with wrong crv
3171
+ [CryptoService] Invalid Ed25519 JWK format
3172
+
3173
+ stderr | src/services/__tests__/crypto.service.test.ts > CryptoService > verifyJWS > should reject JWK with missing x field
3174
+ [CryptoService] Invalid Ed25519 JWK format
3175
+
3176
+ stderr | src/services/__tests__/crypto.service.test.ts > CryptoService > verifyJWS > should reject JWK with empty x field
3177
+ [CryptoService] Invalid Ed25519 JWK format
3178
+
3179
+ stderr | src/services/__tests__/crypto.service.test.ts > CryptoService > verifyJWS > should reject malformed JWS
3180
+ [CryptoService] Invalid JWS format: Error: Invalid header base64: Unexpected token 'ž', "ž‹" is not valid JSON
3181
+ at CryptoService.parseJWS (/Users/dylanhobbs/Documents/@kya-os/xmcp-i/packages/mcp-i-core/src/services/crypto.service.ts:91:13)
3182
+ at CryptoService.verifyJWS (/Users/dylanhobbs/Documents/@kya-os/xmcp-i/packages/mcp-i-core/src/services/crypto.service.ts:169:23)
3183
+ at /Users/dylanhobbs/Documents/@kya-os/xmcp-i/packages/mcp-i-core/src/services/__tests__/crypto.service.test.ts:230:42
3184
+ 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
3185
+ 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
3186
+ 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
3187
+ at new Promise (<anonymous>)
3188
+ 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)
3189
+ 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)
3190
+  at processTicksAndRejections (node:internal/process/task_queues:103:5)
3191
+
3192
+ stderr | src/services/__tests__/crypto.service.test.ts > CryptoService > verifyJWS > should reject non-EdDSA algorithms
3193
+ [CryptoService] Unsupported algorithm: RS256, expected EdDSA
3194
+
3195
+ stderr | src/services/__tests__/crypto.service.test.ts > CryptoService > verifyJWS > should reject HS256 algorithm
3196
+ [CryptoService] Unsupported algorithm: HS256, expected EdDSA
3197
+
3198
+ stderr | src/services/__tests__/crypto.service.test.ts > CryptoService > verifyJWS > should handle empty JWS components
3199
+ [CryptoService] Invalid JWS format: Error: Invalid header base64: Unexpected end of JSON input
3200
+ at CryptoService.parseJWS (/Users/dylanhobbs/Documents/@kya-os/xmcp-i/packages/mcp-i-core/src/services/crypto.service.ts:91:13)
3201
+ at CryptoService.verifyJWS (/Users/dylanhobbs/Documents/@kya-os/xmcp-i/packages/mcp-i-core/src/services/crypto.service.ts:169:23)
3202
+ at /Users/dylanhobbs/Documents/@kya-os/xmcp-i/packages/mcp-i-core/src/services/__tests__/crypto.service.test.ts:271:42
3203
+ 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
3204
+ 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
3205
+ 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
3206
+ at new Promise (<anonymous>)
3207
+ 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)
3208
+ 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)
3209
+  at processTicksAndRejections (node:internal/process/task_queues:103:5)
3210
+
3211
+ stderr | src/services/__tests__/crypto.service.test.ts > CryptoService > verifyJWS > should handle malformed JWS - single part
3212
+ [CryptoService] Invalid JWS format: Error: Invalid JWS format: expected header.payload.signature
3213
+ at CryptoService.parseJWS (/Users/dylanhobbs/Documents/@kya-os/xmcp-i/packages/mcp-i-core/src/services/crypto.service.ts:78:13)
3214
+ at CryptoService.verifyJWS (/Users/dylanhobbs/Documents/@kya-os/xmcp-i/packages/mcp-i-core/src/services/crypto.service.ts:169:23)
3215
+ at /Users/dylanhobbs/Documents/@kya-os/xmcp-i/packages/mcp-i-core/src/services/__tests__/crypto.service.test.ts:279:42
3216
+ 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
3217
+ 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
3218
+ 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
3219
+ at new Promise (<anonymous>)
3220
+ 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)
3221
+ 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)
3222
+  at processTicksAndRejections (node:internal/process/task_queues:103:5)
3223
+
3224
+ stderr | src/services/__tests__/crypto.service.test.ts > CryptoService > verifyJWS > should handle malformed JWS - two parts
3225
+ [CryptoService] Invalid JWS format: Error: Invalid JWS format: expected header.payload.signature
3226
+ at CryptoService.parseJWS (/Users/dylanhobbs/Documents/@kya-os/xmcp-i/packages/mcp-i-core/src/services/crypto.service.ts:78:13)
3227
+ at CryptoService.verifyJWS (/Users/dylanhobbs/Documents/@kya-os/xmcp-i/packages/mcp-i-core/src/services/crypto.service.ts:169:23)
3228
+ at /Users/dylanhobbs/Documents/@kya-os/xmcp-i/packages/mcp-i-core/src/services/__tests__/crypto.service.test.ts:287:42
3229
+ 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
3230
+ 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
3231
+ 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
3232
+ at new Promise (<anonymous>)
3233
+ 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)
3234
+ 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)
3235
+  at processTicksAndRejections (node:internal/process/task_queues:103:5)
3236
+
3237
+ stderr | src/services/__tests__/crypto.service.test.ts > CryptoService > verifyJWS > should handle malformed JWS - four parts
3238
+ [CryptoService] Invalid JWS format: Error: Invalid JWS format: expected header.payload.signature
3239
+ at CryptoService.parseJWS (/Users/dylanhobbs/Documents/@kya-os/xmcp-i/packages/mcp-i-core/src/services/crypto.service.ts:78:13)
3240
+ at CryptoService.verifyJWS (/Users/dylanhobbs/Documents/@kya-os/xmcp-i/packages/mcp-i-core/src/services/crypto.service.ts:169:23)
3241
+ at /Users/dylanhobbs/Documents/@kya-os/xmcp-i/packages/mcp-i-core/src/services/__tests__/crypto.service.test.ts:302:42
3242
+ 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
3243
+ 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
3244
+ 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
3245
+ at new Promise (<anonymous>)
3246
+ 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)
3247
+ 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)
3248
+  at processTicksAndRejections (node:internal/process/task_queues:103:5)
3249
+
3250
+ stderr | src/services/__tests__/crypto.service.test.ts > CryptoService > verifyJWS > should handle malformed JWS - invalid JSON header
3251
+ [CryptoService] Invalid JWS format: Error: Invalid header base64: Unexpected token 'o', "notjson" is not valid JSON
3252
+ at CryptoService.parseJWS (/Users/dylanhobbs/Documents/@kya-os/xmcp-i/packages/mcp-i-core/src/services/crypto.service.ts:91:13)
3253
+ at CryptoService.verifyJWS (/Users/dylanhobbs/Documents/@kya-os/xmcp-i/packages/mcp-i-core/src/services/crypto.service.ts:169:23)
3254
+ at /Users/dylanhobbs/Documents/@kya-os/xmcp-i/packages/mcp-i-core/src/services/__tests__/crypto.service.test.ts:316:42
3255
+ 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
3256
+ 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
3257
+ 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
3258
+ at new Promise (<anonymous>)
3259
+ 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)
3260
+ 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)
3261
+  at processTicksAndRejections (node:internal/process/task_queues:103:5)
3262
+
3263
+ stderr | src/services/__tests__/crypto.service.test.ts > CryptoService > verifyJWS > should handle malformed JWS - invalid base64
3264
+ [CryptoService] Invalid JWS format: Error: Invalid payload base64: Invalid base64url string: Invalid character
3265
+ at CryptoService.parseJWS (/Users/dylanhobbs/Documents/@kya-os/xmcp-i/packages/mcp-i-core/src/services/crypto.service.ts:107:15)
3266
+ at CryptoService.verifyJWS (/Users/dylanhobbs/Documents/@kya-os/xmcp-i/packages/mcp-i-core/src/services/crypto.service.ts:169:23)
3267
+ at /Users/dylanhobbs/Documents/@kya-os/xmcp-i/packages/mcp-i-core/src/services/__tests__/crypto.service.test.ts:334:42
3268
+ 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
3269
+ 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
3270
+ 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
3271
+ at new Promise (<anonymous>)
3272
+ 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)
3273
+ 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)
3274
+  at processTicksAndRejections (node:internal/process/task_queues:103:5)
3275
+
3276
+ stderr | src/services/__tests__/crypto.service.test.ts > CryptoService > verifyJWS > should validate expectedKid option
3277
+ [CryptoService] Key ID mismatch
3278
+
3279
+ stderr | src/services/__tests__/crypto.service.test.ts > CryptoService > verifyJWS > should validate alg option
3280
+ [CryptoService] Unsupported algorithm: EdDSA, expected RS256
3281
+
3282
+ stderr | src/services/__tests__/crypto.service.test.ts > CryptoService > verifyJWS > should validate Ed25519 key length
3283
+ [CryptoService] Failed to extract public key: Error: Invalid Ed25519 public key length: 5
3284
+ at CryptoService.jwkToBase64PublicKey (/Users/dylanhobbs/Documents/@kya-os/xmcp-i/packages/mcp-i-core/src/services/crypto.service.ts:295:13)
3285
+ at CryptoService.verifyJWS (/Users/dylanhobbs/Documents/@kya-os/xmcp-i/packages/mcp-i-core/src/services/crypto.service.ts:249:32)
3286
+ at /Users/dylanhobbs/Documents/@kya-os/xmcp-i/packages/mcp-i-core/src/services/__tests__/crypto.service.test.ts:398:42
3287
+ 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
3288
+ 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
3289
+ 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
3290
+ at new Promise (<anonymous>)
3291
+ 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)
3292
+ 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)
3293
+  at processTicksAndRejections (node:internal/process/task_queues:103:5)
3294
+
3295
+ stderr | src/services/__tests__/crypto.service.test.ts > CryptoService > verifyJWS > should handle signature verification error
3296
+ [CryptoService] Ed25519 verification error: Error: Crypto error
3297
+ at /Users/dylanhobbs/Documents/@kya-os/xmcp-i/packages/mcp-i-core/src/services/__tests__/crypto.service.test.ts:449:61
3298
+ 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
3299
+ 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
3300
+ 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
3301
+ at new Promise (<anonymous>)
3302
+ 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)
3303
+ 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)
3304
+  at processTicksAndRejections (node:internal/process/task_queues:103:5)
3305
+ 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)
3306
+ 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)
3307
+
3308
+
3309
+  ❯ src/__tests__/identity/user-did-manager.test.ts [queued]
3310
+  ❯ src/__tests__/integration.test.ts [queued]
3311
+  ❯ src/__tests__/integration/full-flow.test.ts [queued]
3312
+  ❯ src/__tests__/providers/base.test.ts [queued]
3313
+  ❯ src/__tests__/providers/memory.test.ts 0/34
3314
+  ❯ src/__tests__/runtime/base-extensions.test.ts [queued]
3315
+  ❯ src/__tests__/services/agentshield-integration.test.ts 26/30
3316
+  ❯ src/config/__tests__/remote-config.spec.ts [queued]
3317
+  ❯ src/delegation/__tests__/vc-issuer.test.ts 21/21
3318
+  ❯ src/services/__tests__/access-control.integration.test.ts 9/9
3319
+  ❯ src/services/__tests__/crypto.service.test.ts 34/34
3320
+  ❯ src/services/__tests__/proof-verifier.integration.test.ts 13/13
3321
+  ❯ src/services/__tests__/proof-verifier.test.ts [queued]
3322
+
3323
+  Test Files 13 passed (44)
3324
+  Tests 392 passed | 1 skipped (431)
3325
+  Start at 01:06:38
3326
+  Duration 946ms
3327
+ [?2026l[?2026h ✓ src/services/__tests__/access-control.integration.test.ts (9 tests) 144ms
3328
+ ✓ src/services/__tests__/crypto.service.test.ts (34 tests) 78ms
3329
+
3330
+  ❯ src/__tests__/identity/user-did-manager.test.ts [queued]
3331
+  ❯ src/__tests__/integration.test.ts [queued]
3332
+  ❯ src/__tests__/integration/full-flow.test.ts [queued]
3333
+  ❯ src/__tests__/providers/base.test.ts [queued]
3334
+  ❯ src/__tests__/providers/memory.test.ts 0/34
3335
+  ❯ src/__tests__/runtime/base-extensions.test.ts [queued]
3336
+  ❯ src/__tests__/services/agentshield-integration.test.ts 26/30
3337
+  ❯ src/config/__tests__/remote-config.spec.ts [queued]
3338
+  ❯ src/delegation/__tests__/vc-issuer.test.ts 21/21
3339
+  ❯ src/services/__tests__/access-control.integration.test.ts 9/9
3340
+  ❯ src/services/__tests__/crypto.service.test.ts 34/34
3341
+  ❯ src/services/__tests__/proof-verifier.integration.test.ts 13/13
3342
+  ❯ src/services/__tests__/proof-verifier.test.ts [queued]
3343
+
3344
+  Test Files 13 passed (44)
3345
+  Tests 392 passed | 1 skipped (431)
3346
+  Start at 01:06:38
3347
+  Duration 946ms
3348
+ [?2026l[?2026h ✓ src/__tests__/providers/memory.test.ts (34 tests) 10ms
3349
+
3350
+  ❯ src/__tests__/identity/user-did-manager.test.ts [queued]
3351
+  ❯ src/__tests__/integration.test.ts [queued]
3352
+  ❯ src/__tests__/integration/full-flow.test.ts 21/21
3353
+  ❯ src/__tests__/providers/base.test.ts 14/14
3354
+  ❯ src/__tests__/providers/memory.test.ts 34/34
3355
+  ❯ src/__tests__/regression/phase2-regression.test.ts [queued]
3356
+  ❯ src/__tests__/runtime/base-extensions.test.ts 38/38
3357
+  ❯ src/__tests__/services/agentshield-integration.test.ts 26/30
3358
+  ❯ src/__tests__/services/provider-resolver-edge-cases.test.ts [queued]
3359
+  ❯ src/config/__tests__/remote-config.spec.ts 9/9
3360
+  ❯ src/delegation/__tests__/cascading-revocation.test.ts [queued]
3361
+  ❯ src/services/__tests__/proof-verifier.test.ts 21/21
3362
+  ❯ src/services/__tests__/provider-resolver.test.ts [queued]
3363
+
3364
+  Test Files 19 passed (44)
3365
+  Tests 529 passed | 1 skipped (534)
3366
+  Start at 01:06:38
3367
+  Duration 1.18s
3368
+ [?2026l[?2026hstderr | src/services/__tests__/proof-verifier.test.ts > ProofVerifier Security > Signature Verification > should handle signature verification errors gracefully
3369
+ [CryptoService] Ed25519 verification error: Error: Crypto error
3370
+ at /Users/dylanhobbs/Documents/@kya-os/xmcp-i/packages/mcp-i-core/src/services/__tests__/proof-verifier.test.ts:328:9
3371
+ 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
3372
+ 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
3373
+ 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
3374
+ at new Promise (<anonymous>)
3375
+ 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)
3376
+ 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)
3377
+  at processTicksAndRejections (node:internal/process/task_queues:103:5)
3378
+ 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)
3379
+ 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)
3380
+
3381
+
3382
+  ❯ src/__tests__/identity/user-did-manager.test.ts [queued]
3383
+  ❯ src/__tests__/integration.test.ts [queued]
3384
+  ❯ src/__tests__/integration/full-flow.test.ts 21/21
3385
+  ❯ src/__tests__/providers/base.test.ts 14/14
3386
+  ❯ src/__tests__/providers/memory.test.ts 34/34
3387
+  ❯ src/__tests__/regression/phase2-regression.test.ts [queued]
3388
+  ❯ src/__tests__/runtime/base-extensions.test.ts 38/38
3389
+  ❯ src/__tests__/services/agentshield-integration.test.ts 26/30
3390
+  ❯ src/__tests__/services/provider-resolver-edge-cases.test.ts [queued]
3391
+  ❯ src/config/__tests__/remote-config.spec.ts 9/9
3392
+  ❯ src/delegation/__tests__/cascading-revocation.test.ts [queued]
3393
+  ❯ src/services/__tests__/proof-verifier.test.ts 21/21
3394
+  ❯ src/services/__tests__/provider-resolver.test.ts [queued]
3395
+
3396
+  Test Files 19 passed (44)
3397
+  Tests 529 passed | 1 skipped (534)
3398
+  Start at 01:06:38
3399
+  Duration 1.18s
3400
+ [?2026l[?2026h ✓ src/__tests__/runtime/base-extensions.test.ts (38 tests) 12ms
3401
+ stdout | src/__tests__/integration/full-flow.test.ts > Full Flow Integration > Tool protection enforcement flow > should allow unprotected tool calls
3402
+ [ToolProtectionService] Config loaded from API {
3403
+ source: 'api',
3404
+ toolCount: 1,
3405
+ protectedTools: [],
3406
+ agentDid: 'did:key:z6MkhaXgBZDv...',
3407
+ projectId: 'test-project',
3408
+ cacheTtlMs: 300000,
3409
+ cacheExpiresAt: '2025-11-25T07:11:39.485Z'
3410
+ }
3411
+
3412
+ stdout | src/__tests__/integration/full-flow.test.ts > Full Flow Integration > Tool protection enforcement flow > should intercept protected tool calls without delegation
3413
+ [ToolProtectionService] Config loaded from API {
3414
+ source: 'api',
3415
+ toolCount: 1,
3416
+ protectedTools: [ 'checkout' ],
3417
+ agentDid: 'did:key:z6MkhaXgBZDv...',
3418
+ projectId: 'test-project',
3419
+ cacheTtlMs: 300000,
3420
+ cacheExpiresAt: '2025-11-25T07:11:39.485Z'
3421
+ }
3422
+
3423
+ stdout | src/__tests__/integration/full-flow.test.ts > Full Flow Integration > Tool protection enforcement flow > should intercept protected tool calls without delegation
3424
+ [ToolProtectionService] Protection check {
3425
+ tool: 'checkout',
3426
+ agentDid: 'did:key:z6MkhaXgBZDv...',
3427
+ found: true,
3428
+ isWildcard: false,
3429
+ requiresDelegation: true,
3430
+ availableTools: [ 'checkout' ]
3431
+ }
3432
+
3433
+ stdout | src/__tests__/integration/full-flow.test.ts > Full Flow Integration > AgentShield integration flow > should fetch tool protection config from AgentShield
3434
+ [ToolProtectionService] Config loaded from API {
3435
+ source: 'api',
3436
+ toolCount: 1,
3437
+ protectedTools: [ 'protected_tool' ],
3438
+ agentDid: 'did:key:z6MkhaXgBZDv...',
3439
+ projectId: 'test-project',
3440
+ cacheTtlMs: 300000,
3441
+ cacheExpiresAt: '2025-11-25T07:11:39.486Z'
3442
+ }
3443
+
3444
+ stdout | src/__tests__/integration/full-flow.test.ts > Full Flow Integration > AgentShield integration flow > should cache tool protection config
3445
+ [ToolProtectionService] Config loaded from API {
3446
+ source: 'api',
3447
+ toolCount: 1,
3448
+ protectedTools: [ 'tool1' ],
3449
+ agentDid: 'did:key:z6MkhaXgBZDv...',
3450
+ projectId: 'test-project',
3451
+ cacheTtlMs: 300000,
3452
+ cacheExpiresAt: '2025-11-25T07:11:39.487Z'
3453
+ }
3454
+
3455
+
3456
+  ❯ src/__tests__/identity/user-did-manager.test.ts [queued]
3457
+  ❯ src/__tests__/integration.test.ts [queued]
3458
+  ❯ src/__tests__/integration/full-flow.test.ts 21/21
3459
+  ❯ src/__tests__/providers/base.test.ts 14/14
3460
+  ❯ src/__tests__/providers/memory.test.ts 34/34
3461
+  ❯ src/__tests__/regression/phase2-regression.test.ts [queued]
3462
+  ❯ src/__tests__/runtime/base-extensions.test.ts 38/38
3463
+  ❯ src/__tests__/services/agentshield-integration.test.ts 26/30
3464
+  ❯ src/__tests__/services/provider-resolver-edge-cases.test.ts [queued]
3465
+  ❯ src/config/__tests__/remote-config.spec.ts 9/9
3466
+  ❯ src/delegation/__tests__/cascading-revocation.test.ts [queued]
3467
+  ❯ src/services/__tests__/proof-verifier.test.ts 21/21
3468
+  ❯ src/services/__tests__/provider-resolver.test.ts [queued]
3469
+
3470
+  Test Files 19 passed (44)
3471
+  Tests 529 passed | 1 skipped (534)
3472
+  Start at 01:06:38
3473
+  Duration 1.18s
3474
+ [?2026l[?2026hstderr | src/__tests__/integration/full-flow.test.ts > Full Flow Integration > AgentShield integration flow > should use fallback config when API fails
3475
+ [ToolProtectionService] API fetch failed, using fallback config { agentDid: 'did:key:z6MkhaXgBZDv...', error: 'Network error' }
3476
+
3477
+ stderr | src/__tests__/integration/full-flow.test.ts > Full Flow Integration > Error handling in full flow > should handle tool protection service errors gracefully
3478
+ [ToolProtectionService] API fetch failed, no fallback, failing closed (deny-all) {
3479
+ agentDid: 'did:key:z6MkhaXgBZDv...',
3480
+ error: 'Network error',
3481
+ cacheKey: 'config:tool-protections:test-project'
3482
+ }
3483
+
3484
+ stderr | src/__tests__/integration/full-flow.test.ts > Full Flow Integration > Error handling in full flow > should handle network timeouts
3485
+ [ToolProtectionService] API fetch failed, using fallback config { agentDid: 'did:key:z6MkhaXgBZDv...', error: 'Network timeout' }
3486
+
3487
+
3488
+  ❯ src/__tests__/identity/user-did-manager.test.ts [queued]
3489
+  ❯ src/__tests__/integration.test.ts [queued]
3490
+  ❯ src/__tests__/integration/full-flow.test.ts 21/21
3491
+  ❯ src/__tests__/providers/base.test.ts 14/14
3492
+  ❯ src/__tests__/providers/memory.test.ts 34/34
3493
+  ❯ src/__tests__/regression/phase2-regression.test.ts [queued]
3494
+  ❯ src/__tests__/runtime/base-extensions.test.ts 38/38
3495
+  ❯ src/__tests__/services/agentshield-integration.test.ts 26/30
3496
+  ❯ src/__tests__/services/provider-resolver-edge-cases.test.ts [queued]
3497
+  ❯ src/config/__tests__/remote-config.spec.ts 9/9
3498
+  ❯ src/delegation/__tests__/cascading-revocation.test.ts [queued]
3499
+  ❯ src/services/__tests__/proof-verifier.test.ts 21/21
3500
+  ❯ src/services/__tests__/provider-resolver.test.ts [queued]
3501
+
3502
+  Test Files 19 passed (44)
3503
+  Tests 529 passed | 1 skipped (534)
3504
+  Start at 01:06:38
3505
+  Duration 1.18s
3506
+ [?2026l[?2026hstdout | src/__tests__/integration/full-flow.test.ts > Full Flow Integration > Cache integration in full flow > should share cache across multiple service instances
3507
+ [ToolProtectionService] Config loaded from API {
3508
+ source: 'api',
3509
+ toolCount: 1,
3510
+ protectedTools: [ 'tool1' ],
3511
+ agentDid: 'did:key:z6MkhaXgBZDv...',
3512
+ projectId: 'test-project',
3513
+ cacheTtlMs: 300000,
3514
+ cacheExpiresAt: '2025-11-25T07:11:39.489Z'
3515
+ }
3516
+
3517
+ stdout | src/__tests__/integration/full-flow.test.ts > Full Flow Integration > Cache integration in full flow > should clear cache when needed
3518
+ [ToolProtectionService] Config loaded from API {
3519
+ source: 'api',
3520
+ toolCount: 1,
3521
+ protectedTools: [ 'tool1' ],
3522
+ agentDid: 'did:key:z6MkhaXgBZDv...',
3523
+ projectId: 'test-project',
3524
+ cacheTtlMs: 300000,
3525
+ cacheExpiresAt: '2025-11-25T07:11:39.489Z'
3526
+ }
3527
+
3528
+ stdout | src/__tests__/integration/full-flow.test.ts > Full Flow Integration > Cache integration in full flow > should clear cache when needed
3529
+ [ToolProtectionService] Config loaded from API {
3530
+ source: 'api',
3531
+ toolCount: 1,
3532
+ protectedTools: [ 'tool1' ],
3533
+ agentDid: 'did:key:z6MkhaXgBZDv...',
3534
+ projectId: 'test-project',
3535
+ cacheTtlMs: 300000,
3536
+ cacheExpiresAt: '2025-11-25T07:11:39.489Z'
3537
+ }
3538
+
3539
+ 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
3540
+ [ToolProtectionService] Config loaded from API {
3541
+ source: 'api',
3542
+ toolCount: 3,
3543
+ protectedTools: [ 'add_to_cart', 'checkout' ],
3544
+ agentDid: 'did:key:z6MkhaXgBZDv...',
3545
+ projectId: 'test-project',
3546
+ cacheTtlMs: 300000,
3547
+ cacheExpiresAt: '2025-11-25T07:11:39.489Z'
3548
+ }
3549
+
3550
+ 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
3551
+ [ToolProtectionService] Protection check {
3552
+ tool: 'add_to_cart',
3553
+ agentDid: 'did:key:z6MkhaXgBZDv...',
3554
+ found: true,
3555
+ isWildcard: false,
3556
+ requiresDelegation: true,
3557
+ availableTools: [ 'search_products', 'add_to_cart', 'checkout' ]
3558
+ }
3559
+
3560
+ stdout | src/__tests__/integration/full-flow.test.ts > Full Flow Integration > Concurrent operations > should handle concurrent cache operations
3561
+ [ToolProtectionService] Config loaded from API {
3562
+ source: 'api',
3563
+ toolCount: 1,
3564
+ protectedTools: [ 'tool1' ],
3565
+ agentDid: 'did:key:z6MkhaXgBZDv...',
3566
+ projectId: 'test-project',
3567
+ cacheTtlMs: 300000,
3568
+ cacheExpiresAt: '2025-11-25T07:11:39.490Z'
3569
+ }
3570
+ [ToolProtectionService] Config loaded from API {
3571
+ source: 'api',
3572
+ toolCount: 1,
3573
+ protectedTools: [ 'tool1' ],
3574
+ agentDid: 'did:key:z6MkhaXgBZDv...',
3575
+ projectId: 'test-project',
3576
+ cacheTtlMs: 300000,
3577
+ cacheExpiresAt: '2025-11-25T07:11:39.490Z'
3578
+ }
3579
+ [ToolProtectionService] Config loaded from API {
3580
+ source: 'api',
3581
+ toolCount: 1,
3582
+ protectedTools: [ 'tool1' ],
3583
+ agentDid: 'did:key:z6MkhaXgBZDv...',
3584
+ projectId: 'test-project',
3585
+ cacheTtlMs: 300000,
3586
+ cacheExpiresAt: '2025-11-25T07:11:39.490Z'
3587
+ }
3588
+
3589
+ ✓ src/services/__tests__/proof-verifier.test.ts (21 tests) 14ms
3590
+
3591
+  ❯ src/__tests__/identity/user-did-manager.test.ts [queued]
3592
+  ❯ src/__tests__/integration.test.ts [queued]
3593
+  ❯ src/__tests__/integration/full-flow.test.ts 21/21
3594
+  ❯ src/__tests__/providers/base.test.ts 14/14
3595
+  ❯ src/__tests__/providers/memory.test.ts 34/34
3596
+  ❯ src/__tests__/regression/phase2-regression.test.ts [queued]
3597
+  ❯ src/__tests__/runtime/base-extensions.test.ts 38/38
3598
+  ❯ src/__tests__/services/agentshield-integration.test.ts 26/30
3599
+  ❯ src/__tests__/services/provider-resolver-edge-cases.test.ts [queued]
3600
+  ❯ src/config/__tests__/remote-config.spec.ts 9/9
3601
+  ❯ src/delegation/__tests__/cascading-revocation.test.ts [queued]
3602
+  ❯ src/services/__tests__/proof-verifier.test.ts 21/21
3603
+  ❯ src/services/__tests__/provider-resolver.test.ts [queued]
3604
+
3605
+  Test Files 19 passed (44)
3606
+  Tests 529 passed | 1 skipped (534)
3607
+  Start at 01:06:38
3608
+  Duration 1.18s
3609
+ [?2026l[?2026hstderr | src/config/__tests__/remote-config.spec.ts > fetchRemoteConfig > Error handling > should return null if API request fails
3610
+ [RemoteConfig] API returned 404: Not Found
3611
+
3612
+ stderr | src/config/__tests__/remote-config.spec.ts > fetchRemoteConfig > Error handling > should return null if API throws error
3613
+ [RemoteConfig] Failed to fetch config: Error: Network error
3614
+ at /Users/dylanhobbs/Documents/@kya-os/xmcp-i/packages/mcp-i-core/src/config/__tests__/remote-config.spec.ts:170:35
3615
+ 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
3616
+ 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
3617
+ 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
3618
+ at new Promise (<anonymous>)
3619
+ 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)
3620
+ 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)
3621
+  at processTicksAndRejections (node:internal/process/task_queues:103:5)
3622
+ 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)
3623
+ 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)
3624
+
3625
+ stderr | src/config/__tests__/remote-config.spec.ts > fetchRemoteConfig > Error handling > should return null if neither projectId nor agentDid provided
3626
+ [RemoteConfig] Neither projectId nor agentDid provided
3627
+
3628
+ stderr | src/config/__tests__/remote-config.spec.ts > fetchRemoteConfig > Error handling > should handle cache read errors gracefully
3629
+ [RemoteConfig] Cache read failed: Error: Cache error
3630
+ at /Users/dylanhobbs/Documents/@kya-os/xmcp-i/packages/mcp-i-core/src/config/__tests__/remote-config.spec.ts:198:50
3631
+ 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
3632
+ 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
3633
+ 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
3634
+ at new Promise (<anonymous>)
3635
+ 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)
3636
+ 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)
3637
+  at processTicksAndRejections (node:internal/process/task_queues:103:5)
3638
+ 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)
3639
+ 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)
3640
+
3641
+
3642
+  ❯ src/__tests__/identity/user-did-manager.test.ts [queued]
3643
+  ❯ src/__tests__/integration.test.ts [queued]
3644
+  ❯ src/__tests__/integration/full-flow.test.ts 21/21
3645
+  ❯ src/__tests__/providers/base.test.ts 14/14
3646
+  ❯ src/__tests__/providers/memory.test.ts 34/34
3647
+  ❯ src/__tests__/regression/phase2-regression.test.ts [queued]
3648
+  ❯ src/__tests__/runtime/base-extensions.test.ts 38/38
3649
+  ❯ src/__tests__/services/agentshield-integration.test.ts 26/30
3650
+  ❯ src/__tests__/services/provider-resolver-edge-cases.test.ts [queued]
3651
+  ❯ src/config/__tests__/remote-config.spec.ts 9/9
3652
+  ❯ src/delegation/__tests__/cascading-revocation.test.ts [queued]
3653
+  ❯ src/services/__tests__/proof-verifier.test.ts 21/21
3654
+  ❯ src/services/__tests__/provider-resolver.test.ts [queued]
3655
+
3656
+  Test Files 19 passed (44)
3657
+  Tests 529 passed | 1 skipped (534)
3658
+  Start at 01:06:38
3659
+  Duration 1.18s
3660
+ [?2026l[?2026h ✓ src/__tests__/providers/base.test.ts (14 tests) 5ms
3661
+ ✓ src/config/__tests__/remote-config.spec.ts (9 tests) 10ms
3662
+ ✓ src/__tests__/integration/full-flow.test.ts (21 tests) 15ms
3663
+
3664
+  ❯ src/__tests__/identity/user-did-manager.test.ts [queued]
3665
+  ❯ src/__tests__/integration.test.ts [queued]
3666
+  ❯ src/__tests__/integration/full-flow.test.ts 21/21
3667
+  ❯ src/__tests__/providers/base.test.ts 14/14
3668
+  ❯ src/__tests__/providers/memory.test.ts 34/34
3669
+  ❯ src/__tests__/regression/phase2-regression.test.ts [queued]
3670
+  ❯ src/__tests__/runtime/base-extensions.test.ts 38/38
3671
+  ❯ src/__tests__/services/agentshield-integration.test.ts 26/30
3672
+  ❯ src/__tests__/services/provider-resolver-edge-cases.test.ts [queued]
3673
+  ❯ src/config/__tests__/remote-config.spec.ts 9/9
3674
+  ❯ src/delegation/__tests__/cascading-revocation.test.ts [queued]
3675
+  ❯ src/services/__tests__/proof-verifier.test.ts 21/21
3676
+  ❯ src/services/__tests__/provider-resolver.test.ts [queued]
3677
+
3678
+  Test Files 19 passed (44)
3679
+  Tests 529 passed | 1 skipped (534)
3680
+  Start at 01:06:38
3681
+  Duration 1.18s
3682
+ [?2026l[?2026hstdout | src/__tests__/integration.test.ts > Integration Tests > Full handshake and tool execution flow > should complete full authentication and tool execution cycle
3683
+ [AUDIT] {"event":"runtime_initialized","data":{"did":"did:key:zqOzzkIALhk-_RTB5UPLgb0-yy3LIUw2V","environment":"development","userDidGeneration":"disabled"},"timestamp":1764054399701,"timestampFormatted":"2025-11-25T07:06:39.701Z"}
3684
+
3685
+ stdout | src/__tests__/integration.test.ts > Integration Tests > Full handshake and tool execution flow > should complete full authentication and tool execution cycle
3686
+ [AUDIT] {"event":"tool_executed","data":{"tool":"greetingTool","sessionId":"89e5bb20677624b03210f79d4e9edd14","timestamp":1764054399701},"timestamp":1764054399701,"timestampFormatted":"2025-11-25T07:06:39.701Z"}
3687
+
3688
+ stdout | src/__tests__/integration.test.ts > Integration Tests > Session expiry handling > should handle expired sessions correctly
3689
+ [AUDIT] {"event":"runtime_initialized","data":{"did":"did:key:zVfSmusJvK9igylqSoES3YAjEkvBbORE5","environment":"development","userDidGeneration":"disabled"},"timestamp":1764054399707,"timestampFormatted":"2025-11-25T07:06:39.707Z"}
3690
+
3691
+ stdout | src/__tests__/integration.test.ts > Integration Tests > Key rotation flow > should handle key rotation and maintain functionality
3692
+ [AUDIT] {"event":"runtime_initialized","data":{"did":"did:key:zACmONplPFniTRjssN-8Y4MU1PHhE7AzY","environment":"development","userDidGeneration":"disabled"},"timestamp":1764054399708,"timestampFormatted":"2025-11-25T07:06:39.708Z"}
3693
+
3694
+ stdout | src/__tests__/integration.test.ts > Integration Tests > Key rotation flow > should handle key rotation and maintain functionality
3695
+ [AUDIT] {"event":"keys_rotated","data":{"oldDid":"did:key:zACmONplPFniTRjssN-8Y4MU1PHhE7AzY","newDid":"did:key:zlGgImf7O75-tk5FalCdDRgil3sn-SSBs","timestamp":1764054399708},"timestamp":1764054399708,"timestampFormatted":"2025-11-25T07:06:39.708Z"}
3696
+
3697
+ stdout | src/__tests__/integration.test.ts > Integration Tests > Well-known endpoints > should provide identity discovery endpoints
3698
+ [AUDIT] {"event":"runtime_initialized","data":{"did":"did:key:zW-Q2Ws28I1FtwXmrOnWFN2Duo5eHWykG","environment":"development","userDidGeneration":"disabled"},"timestamp":1764054399708,"timestampFormatted":"2025-11-25T07:06:39.708Z"}
3699
+
3700
+ stdout | src/__tests__/integration.test.ts > Integration Tests > Nonce replay protection > should prevent nonce reuse
3701
+ [AUDIT] {"event":"runtime_initialized","data":{"did":"did:key:zQoj50x_zuZlkMeyK-4tj1K6BIq_G9JOt","environment":"development","userDidGeneration":"disabled"},"timestamp":1764054399709,"timestampFormatted":"2025-11-25T07:06:39.709Z"}
3702
+
3703
+ stdout | src/__tests__/integration.test.ts > Integration Tests > Error handling > should handle network errors gracefully
3704
+ [AUDIT] {"event":"runtime_initialized","data":{"did":"did:key:zeLTFuDtHsF4u34Q9yDZCzD8vM-sVwHX5","environment":"development","userDidGeneration":"disabled"},"timestamp":1764054399709,"timestampFormatted":"2025-11-25T07:06:39.709Z"}
3705
+
3706
+ stdout | src/__tests__/integration.test.ts > Integration Tests > Error handling > should handle malformed DID documents
3707
+ [AUDIT] {"event":"runtime_initialized","data":{"did":"did:key:z9EtraFALke-Cj0pB7QGItf0CiOOZVT8h","environment":"development","userDidGeneration":"disabled"},"timestamp":1764054399709,"timestampFormatted":"2025-11-25T07:06:39.709Z"}
3708
+
3709
+ stdout | src/__tests__/integration.test.ts > Integration Tests > Debug endpoint > should provide debug information in development
3710
+ [AUDIT] {"event":"runtime_initialized","data":{"did":"did:key:zSpxypbJmnozF_wq7hZ9xitkOSBvDyZaj","environment":"development","userDidGeneration":"disabled"},"timestamp":1764054399709,"timestampFormatted":"2025-11-25T07:06:39.709Z"}
3711
+
3712
+ stdout | src/__tests__/integration.test.ts > Integration Tests > Debug endpoint > should be disabled in production
3713
+ [AUDIT] {"event":"runtime_initialized","data":{"did":"did:key:z1-7njXcjiKEvP-OvcKG9mBv442vuO8mN","environment":"development","userDidGeneration":"disabled"},"timestamp":1764054399709,"timestampFormatted":"2025-11-25T07:06:39.709Z"}
3714
+
3715
+
3716
+  ❯ src/__tests__/identity/user-did-manager.test.ts 17/17
3717
+  ❯ src/__tests__/integration.test.ts 9/9
3718
+  ❯ src/__tests__/integration/full-flow.test.ts 21/21
3719
+  ❯ src/__tests__/regression/phase2-regression.test.ts 12/12
3720
+  ❯ src/__tests__/services/agentshield-integration.test.ts 26/30
3721
+  ❯ src/__tests__/services/provider-resolver-edge-cases.test.ts 25/25
3722
+  ❯ src/__tests__/services/tool-protection-oauth-provider.test.ts [queued]
3723
+  ❯ src/compliance/__tests__/schema-verifier.test.ts [queued]
3724
+  ❯ src/delegation/__tests__/bitstring.test.ts 0/30
3725
+  ❯ src/delegation/__tests__/cascading-revocation.test.ts 23/23
3726
+  ❯ src/delegation/__tests__/delegation-graph.test.ts 0/28
3727
+  ❯ src/services/__tests__/oauth-provider-registry.test.ts [queued]
3728
+  ❯ src/services/__tests__/provider-resolver.test.ts 8/8
3729
+
3730
+  Test Files 25 passed (44)
3731
+  Tests 622 passed | 2 skipped (686)
3732
+  Start at 01:06:38
3733
+  Duration 1.28s
3734
+ [?2026l[?2026hstderr | src/__tests__/services/provider-resolver-edge-cases.test.ts > ProviderResolver - Edge Cases > Scope inference edge cases (Priority 2) > should handle empty scopes array
3735
+ [ProviderResolver] Tool does not specify oauthProvider. Using project-configured provider "github" as fallback. Consider explicitly setting oauthProvider in tool protection config.
3736
+
3737
+ 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)
3738
+ [ProviderResolver] Tool does not specify oauthProvider. Using project-configured provider "github" as fallback. Consider explicitly setting oauthProvider in tool protection config.
3739
+
3740
+ stderr | src/__tests__/services/provider-resolver-edge-cases.test.ts > ProviderResolver - Edge Cases > Scope inference edge cases (Priority 2) > should handle unknown scope prefixes
3741
+ [ProviderResolver] Tool does not specify oauthProvider. Using project-configured provider "github" as fallback. Consider explicitly setting oauthProvider in tool protection config.
3742
+
3743
+
3744
+  ❯ src/__tests__/identity/user-did-manager.test.ts 17/17
3745
+  ❯ src/__tests__/integration.test.ts 9/9
3746
+  ❯ src/__tests__/integration/full-flow.test.ts 21/21
3747
+  ❯ src/__tests__/regression/phase2-regression.test.ts 12/12
3748
+  ❯ src/__tests__/services/agentshield-integration.test.ts 26/30
3749
+  ❯ src/__tests__/services/provider-resolver-edge-cases.test.ts 25/25
3750
+  ❯ src/__tests__/services/tool-protection-oauth-provider.test.ts [queued]
3751
+  ❯ src/compliance/__tests__/schema-verifier.test.ts [queued]
3752
+  ❯ src/delegation/__tests__/bitstring.test.ts 0/30
3753
+  ❯ src/delegation/__tests__/cascading-revocation.test.ts 23/23
3754
+  ❯ src/delegation/__tests__/delegation-graph.test.ts 0/28
3755
+  ❯ src/services/__tests__/oauth-provider-registry.test.ts [queued]
3756
+  ❯ src/services/__tests__/provider-resolver.test.ts 8/8
3757
+
3758
+  Test Files 25 passed (44)
3759
+  Tests 622 passed | 2 skipped (686)
3760
+  Start at 01:06:38
3761
+  Duration 1.28s
3762
+ [?2026l[?2026hstdout | src/__tests__/services/provider-resolver-edge-cases.test.ts > ProviderResolver - Edge Cases > Scope inference edge cases (Priority 2) > should verify gmail → google mapping works
3763
+ [ProviderResolver] Inferred provider "google" from scopes
3764
+
3765
+ 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
3766
+ [ProviderResolver] Inferred provider "google" from scopes
3767
+
3768
+ 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
3769
+ [ProviderResolver] Inferred provider "microsoft" from scopes
3770
+
3771
+
3772
+  ❯ src/__tests__/identity/user-did-manager.test.ts 17/17
3773
+  ❯ src/__tests__/integration.test.ts 9/9
3774
+  ❯ src/__tests__/integration/full-flow.test.ts 21/21
3775
+  ❯ src/__tests__/regression/phase2-regression.test.ts 12/12
3776
+  ❯ src/__tests__/services/agentshield-integration.test.ts 26/30
3777
+  ❯ src/__tests__/services/provider-resolver-edge-cases.test.ts 25/25
3778
+  ❯ src/__tests__/services/tool-protection-oauth-provider.test.ts [queued]
3779
+  ❯ src/compliance/__tests__/schema-verifier.test.ts [queued]
3780
+  ❯ src/delegation/__tests__/bitstring.test.ts 0/30
3781
+  ❯ src/delegation/__tests__/cascading-revocation.test.ts 23/23
3782
+  ❯ src/delegation/__tests__/delegation-graph.test.ts 0/28
3783
+  ❯ src/services/__tests__/oauth-provider-registry.test.ts [queued]
3784
+  ❯ src/services/__tests__/provider-resolver.test.ts 8/8
3785
+
3786
+  Test Files 25 passed (44)
3787
+  Tests 622 passed | 2 skipped (686)
3788
+  Start at 01:06:38
3789
+  Duration 1.28s
3790
+ [?2026l[?2026hstderr | src/__tests__/services/provider-resolver-edge-cases.test.ts > ProviderResolver - Edge Cases > Scope inference edge cases (Priority 2) > should handle scopes without colons
3791
+ [ProviderResolver] Tool does not specify oauthProvider. Using project-configured provider "github" as fallback. Consider explicitly setting oauthProvider in tool protection config.
3792
+
3793
+ 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
3794
+ [ProviderResolver] Tool does not specify oauthProvider. Using project-configured provider "google" as fallback. Consider explicitly setting oauthProvider in tool protection config.
3795
+
3796
+ stderr | src/__tests__/identity/user-did-manager.test.ts > UserDidManager > error handling > should handle storage.get errors gracefully
3797
+ [UserDidManager] Storage.get failed, generating new DID: Error: Storage error
3798
+ at /Users/dylanhobbs/Documents/@kya-os/xmcp-i/packages/mcp-i-core/src/__tests__/identity/user-did-manager.test.ts:187:67
3799
+ 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
3800
+ 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
3801
+ 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
3802
+ at new Promise (<anonymous>)
3803
+ 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)
3804
+ 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)
3805
+  at processTicksAndRejections (node:internal/process/task_queues:103:5)
3806
+ 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)
3807
+ 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)
3808
+
3809
+ stderr | src/__tests__/identity/user-did-manager.test.ts > UserDidManager > error handling > should handle storage.set errors gracefully
3810
+ [UserDidManager] Storage.set failed, continuing with cached DID: Error: Storage error
3811
+ at /Users/dylanhobbs/Documents/@kya-os/xmcp-i/packages/mcp-i-core/src/__tests__/identity/user-did-manager.test.ts:196:67
3812
+ 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
3813
+ 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
3814
+ 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
3815
+ at new Promise (<anonymous>)
3816
+ 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)
3817
+ 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)
3818
+  at processTicksAndRejections (node:internal/process/task_queues:103:5)
3819
+ 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)
3820
+ 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)
3821
+
3822
+ stderr | src/__tests__/identity/user-did-manager.test.ts > UserDidManager > error handling > should handle storage.delete errors gracefully
3823
+ [UserDidManager] Storage.delete failed, continuing: Error: Storage error
3824
+ at /Users/dylanhobbs/Documents/@kya-os/xmcp-i/packages/mcp-i-core/src/__tests__/identity/user-did-manager.test.ts:206:70
3825
+  at processTicksAndRejections (node:internal/process/task_queues:103:5)
3826
+ 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
3827
+
3828
+ stderr | src/__tests__/services/provider-resolver-edge-cases.test.ts > ProviderResolver - Edge Cases > Fallback behavior (Priority 3 - configuredProvider) > should use configuredProvider when oauthProvider not specified
3829
+ [ProviderResolver] Tool does not specify oauthProvider. Using project-configured provider "google" as fallback. Consider explicitly setting oauthProvider in tool protection config.
3830
+
3831
+
3832
+  ❯ src/__tests__/identity/user-did-manager.test.ts 17/17
3833
+  ❯ src/__tests__/integration.test.ts 9/9
3834
+  ❯ src/__tests__/integration/full-flow.test.ts 21/21
3835
+  ❯ src/__tests__/regression/phase2-regression.test.ts 12/12
3836
+  ❯ src/__tests__/services/agentshield-integration.test.ts 26/30
3837
+  ❯ src/__tests__/services/provider-resolver-edge-cases.test.ts 25/25
3838
+  ❯ src/__tests__/services/tool-protection-oauth-provider.test.ts [queued]
3839
+  ❯ src/compliance/__tests__/schema-verifier.test.ts [queued]
3840
+  ❯ src/delegation/__tests__/bitstring.test.ts 0/30
3841
+  ❯ src/delegation/__tests__/cascading-revocation.test.ts 23/23
3842
+  ❯ src/delegation/__tests__/delegation-graph.test.ts 0/28
3843
+  ❯ src/services/__tests__/oauth-provider-registry.test.ts [queued]
3844
+  ❯ src/services/__tests__/provider-resolver.test.ts 8/8
3845
+
3846
+  Test Files 25 passed (44)
3847
+  Tests 622 passed | 2 skipped (686)
3848
+  Start at 01:06:38
3849
+  Duration 1.28s
3850
+ [?2026l[?2026hstdout | src/__tests__/services/provider-resolver-edge-cases.test.ts > ProviderResolver - Edge Cases > Provider name case sensitivity > should handle provider names case-insensitively in inference
3851
+ [ProviderResolver] Inferred provider "github" from scopes
3852
+
3853
+ 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
3854
+ [ProviderResolver] Inferred provider "github" from scopes
3855
+
3856
+
3857
+  ❯ src/__tests__/identity/user-did-manager.test.ts 17/17
3858
+  ❯ src/__tests__/integration.test.ts 9/9
3859
+  ❯ src/__tests__/integration/full-flow.test.ts 21/21
3860
+  ❯ src/__tests__/regression/phase2-regression.test.ts 12/12
3861
+  ❯ src/__tests__/services/agentshield-integration.test.ts 26/30
3862
+  ❯ src/__tests__/services/provider-resolver-edge-cases.test.ts 25/25
3863
+  ❯ src/__tests__/services/tool-protection-oauth-provider.test.ts [queued]
3864
+  ❯ src/compliance/__tests__/schema-verifier.test.ts [queued]
3865
+  ❯ src/delegation/__tests__/bitstring.test.ts 0/30
3866
+  ❯ src/delegation/__tests__/cascading-revocation.test.ts 23/23
3867
+  ❯ src/delegation/__tests__/delegation-graph.test.ts 0/28
3868
+  ❯ src/services/__tests__/oauth-provider-registry.test.ts [queued]
3869
+  ❯ src/services/__tests__/provider-resolver.test.ts 8/8
3870
+
3871
+  Test Files 25 passed (44)
3872
+  Tests 622 passed | 2 skipped (686)
3873
+  Start at 01:06:38
3874
+  Duration 1.28s
3875
+ [?2026l[?2026hstderr | src/__tests__/services/provider-resolver-edge-cases.test.ts > ProviderResolver - Edge Cases > configuredProvider behavior (Priority 3) > should use configuredProvider when tool has no oauthProvider
3876
+ [ProviderResolver] Tool does not specify oauthProvider. Using project-configured provider "github" as fallback. Consider explicitly setting oauthProvider in tool protection config.
3877
+
3878
+
3879
+  ❯ src/__tests__/identity/user-did-manager.test.ts 17/17
3880
+  ❯ src/__tests__/integration.test.ts 9/9
3881
+  ❯ src/__tests__/integration/full-flow.test.ts 21/21
3882
+  ❯ src/__tests__/regression/phase2-regression.test.ts 12/12
3883
+  ❯ src/__tests__/services/agentshield-integration.test.ts 26/30
3884
+  ❯ src/__tests__/services/provider-resolver-edge-cases.test.ts 25/25
3885
+  ❯ src/__tests__/services/tool-protection-oauth-provider.test.ts [queued]
3886
+  ❯ src/compliance/__tests__/schema-verifier.test.ts [queued]
3887
+  ❯ src/delegation/__tests__/bitstring.test.ts 0/30
3888
+  ❯ src/delegation/__tests__/cascading-revocation.test.ts 23/23
3889
+  ❯ src/delegation/__tests__/delegation-graph.test.ts 0/28
3890
+  ❯ src/services/__tests__/oauth-provider-registry.test.ts [queued]
3891
+  ❯ src/services/__tests__/provider-resolver.test.ts 8/8
3892
+
3893
+  Test Files 25 passed (44)
3894
+  Tests 622 passed | 2 skipped (686)
3895
+  Start at 01:06:38
3896
+  Duration 1.28s
3897
+ [?2026l[?2026hstdout | src/__tests__/services/provider-resolver-edge-cases.test.ts > ProviderResolver - Edge Cases > configuredProvider behavior (Priority 3) > should prefer scope-inferred provider over configuredProvider
3898
+ [ProviderResolver] Inferred provider "google" from scopes
3899
+
3900
+ ✓ src/__tests__/integration.test.ts (9 tests) 9ms
3901
+ 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
3902
+ [ToolProtectionService] Config loaded from API {
3903
+ source: 'api',
3904
+ toolCount: 1,
3905
+ protectedTools: [ 'phase1_tool' ],
3906
+ agentDid: 'did:key:z6MkhaXgBZDv...',
3907
+ projectId: 'none',
3908
+ cacheTtlMs: 300000,
3909
+ cacheExpiresAt: '2025-11-25T07:11:39.720Z'
3910
+ }
3911
+
3912
+ stdout | src/services/__tests__/provider-resolver.test.ts > ProviderResolver > resolveProvider - Priority 2: Scope inference > should infer provider from github scope prefix
3913
+ [ProviderResolver] Inferred provider "github" from scopes
3914
+
3915
+ stdout | src/services/__tests__/provider-resolver.test.ts > ProviderResolver > resolveProvider - Priority 2: Scope inference > should infer provider from gmail scope prefix (maps to google)
3916
+ [ProviderResolver] Inferred provider "google" from scopes
3917
+
3918
+
3919
+  ❯ src/__tests__/identity/user-did-manager.test.ts 17/17
3920
+  ❯ src/__tests__/integration.test.ts 9/9
3921
+  ❯ src/__tests__/integration/full-flow.test.ts 21/21
3922
+  ❯ src/__tests__/regression/phase2-regression.test.ts 12/12
3923
+  ❯ src/__tests__/services/agentshield-integration.test.ts 26/30
3924
+  ❯ src/__tests__/services/provider-resolver-edge-cases.test.ts 25/25
3925
+  ❯ src/__tests__/services/tool-protection-oauth-provider.test.ts [queued]
3926
+  ❯ src/compliance/__tests__/schema-verifier.test.ts [queued]
3927
+  ❯ src/delegation/__tests__/bitstring.test.ts 0/30
3928
+  ❯ src/delegation/__tests__/cascading-revocation.test.ts 23/23
3929
+  ❯ src/delegation/__tests__/delegation-graph.test.ts 0/28
3930
+  ❯ src/services/__tests__/oauth-provider-registry.test.ts [queued]
3931
+  ❯ src/services/__tests__/provider-resolver.test.ts 8/8
3932
+
3933
+  Test Files 25 passed (44)
3934
+  Tests 622 passed | 2 skipped (686)
3935
+  Start at 01:06:38
3936
+  Duration 1.28s
3937
+ [?2026l[?2026hstderr | src/services/__tests__/provider-resolver.test.ts > ProviderResolver > resolveProvider - Priority 2: Scope inference > should fall back to configuredProvider for ambiguous scopes
3938
+ [ProviderResolver] Tool does not specify oauthProvider. Using project-configured provider "github" as fallback. Consider explicitly setting oauthProvider in tool protection config.
3939
+
3940
+
3941
+  ❯ src/__tests__/identity/user-did-manager.test.ts 17/17
3942
+  ❯ src/__tests__/integration.test.ts 9/9
3943
+  ❯ src/__tests__/integration/full-flow.test.ts 21/21
3944
+  ❯ src/__tests__/regression/phase2-regression.test.ts 12/12
3945
+  ❯ src/__tests__/services/agentshield-integration.test.ts 26/30
3946
+  ❯ src/__tests__/services/provider-resolver-edge-cases.test.ts 25/25
3947
+  ❯ src/__tests__/services/tool-protection-oauth-provider.test.ts [queued]
3948
+  ❯ src/compliance/__tests__/schema-verifier.test.ts [queued]
3949
+  ❯ src/delegation/__tests__/bitstring.test.ts 0/30
3950
+  ❯ src/delegation/__tests__/cascading-revocation.test.ts 23/23
3951
+  ❯ src/delegation/__tests__/delegation-graph.test.ts 0/28
3952
+  ❯ src/services/__tests__/oauth-provider-registry.test.ts [queued]
3953
+  ❯ src/services/__tests__/provider-resolver.test.ts 8/8
3954
+
3955
+  Test Files 25 passed (44)
3956
+  Tests 622 passed | 2 skipped (686)
3957
+  Start at 01:06:38
3958
+  Duration 1.28s
3959
+ [?2026l[?2026hstdout | 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)
3960
+ [ToolProtectionService] Config loaded from API {
3961
+ source: 'api',
3962
+ toolCount: 1,
3963
+ protectedTools: [ 'old_tool' ],
3964
+ agentDid: 'did:key:z6MkhaXgBZDv...',
3965
+ projectId: 'none',
3966
+ cacheTtlMs: 300000,
3967
+ cacheExpiresAt: '2025-11-25T07:11:39.725Z'
3968
+ }
3969
+
3970
+ 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)
3971
+ [ToolProtectionService] Config loaded from API {
3972
+ source: 'api',
3973
+ toolCount: 1,
3974
+ protectedTools: [ 'old_tool' ],
3975
+ agentDid: 'did:key:z6MkhaXgBZDv...',
3976
+ projectId: 'none',
3977
+ cacheTtlMs: 300000,
3978
+ cacheExpiresAt: '2025-11-25T07:11:39.725Z'
3979
+ }
3980
+
3981
+ 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
3982
+ [ToolProtectionService] Config loaded from API {
3983
+ source: 'api',
3984
+ toolCount: 1,
3985
+ protectedTools: [ 'tool_with_snake_case' ],
3986
+ agentDid: 'did:key:z6MkhaXgBZDv...',
3987
+ projectId: 'test-project-123',
3988
+ cacheTtlMs: 300000,
3989
+ cacheExpiresAt: '2025-11-25T07:11:39.726Z'
3990
+ }
3991
+
3992
+
3993
+  ❯ src/__tests__/identity/user-did-manager.test.ts 17/17
3994
+  ❯ src/__tests__/integration.test.ts 9/9
3995
+  ❯ src/__tests__/integration/full-flow.test.ts 21/21
3996
+  ❯ src/__tests__/regression/phase2-regression.test.ts 12/12
3997
+  ❯ src/__tests__/services/agentshield-integration.test.ts 26/30
3998
+  ❯ src/__tests__/services/provider-resolver-edge-cases.test.ts 25/25
3999
+  ❯ src/__tests__/services/tool-protection-oauth-provider.test.ts [queued]
4000
+  ❯ src/compliance/__tests__/schema-verifier.test.ts [queued]
4001
+  ❯ src/delegation/__tests__/bitstring.test.ts 0/30
4002
+  ❯ src/delegation/__tests__/cascading-revocation.test.ts 23/23
4003
+  ❯ src/delegation/__tests__/delegation-graph.test.ts 0/28
4004
+  ❯ src/services/__tests__/oauth-provider-registry.test.ts [queued]
4005
+  ❯ src/services/__tests__/provider-resolver.test.ts 8/8
4006
+
4007
+  Test Files 25 passed (44)
4008
+  Tests 622 passed | 2 skipped (686)
4009
+  Start at 01:06:38
4010
+  Duration 1.28s
4011
+ [?2026l[?2026hstderr | 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)
4012
+ [ProviderResolver] Tool does not specify oauthProvider. Using project-configured provider "github" as fallback. Consider explicitly setting oauthProvider in tool protection config.
4013
+
4014
+
4015
+  ❯ src/__tests__/identity/user-did-manager.test.ts 17/17
4016
+  ❯ src/__tests__/integration.test.ts 9/9
4017
+  ❯ src/__tests__/integration/full-flow.test.ts 21/21
4018
+  ❯ src/__tests__/regression/phase2-regression.test.ts 12/12
4019
+  ❯ src/__tests__/services/agentshield-integration.test.ts 26/30
4020
+  ❯ src/__tests__/services/provider-resolver-edge-cases.test.ts 25/25
4021
+  ❯ src/__tests__/services/tool-protection-oauth-provider.test.ts [queued]
4022
+  ❯ src/compliance/__tests__/schema-verifier.test.ts [queued]
4023
+  ❯ src/delegation/__tests__/bitstring.test.ts 0/30
4024
+  ❯ src/delegation/__tests__/cascading-revocation.test.ts 23/23
4025
+  ❯ src/delegation/__tests__/delegation-graph.test.ts 0/28
4026
+  ❯ src/services/__tests__/oauth-provider-registry.test.ts [queued]
4027
+  ❯ src/services/__tests__/provider-resolver.test.ts 8/8
4028
+
4029
+  Test Files 25 passed (44)
4030
+  Tests 622 passed | 2 skipped (686)
4031
+  Start at 01:06:38
4032
+  Duration 1.28s
4033
+ [?2026l[?2026hstdout | 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
4034
+ [ToolProtectionService] Config loaded from API {
4035
+ source: 'api',
4036
+ toolCount: 2,
4037
+ protectedTools: [ 'phase1_tool', 'phase2_tool' ],
4038
+ agentDid: 'did:key:z6MkhaXgBZDv...',
4039
+ projectId: 'test-project-123',
4040
+ cacheTtlMs: 300000,
4041
+ cacheExpiresAt: '2025-11-25T07:11:39.726Z'
4042
+ }
4043
+
4044
+ ✓ src/__tests__/identity/user-did-manager.test.ts (17 tests) 13ms
4045
+ ✓ src/services/__tests__/provider-resolver.test.ts (8 tests) 5ms
4046
+ ✓ src/__tests__/regression/phase2-regression.test.ts (12 tests) 10ms
4047
+ ✓ src/delegation/__tests__/cascading-revocation.test.ts (23 tests) 8ms
4048
+ ✓ src/__tests__/services/provider-resolver-edge-cases.test.ts (25 tests | 1 skipped) 11ms
4049
+
4050
+  ❯ src/__tests__/identity/user-did-manager.test.ts 17/17
4051
+  ❯ src/__tests__/integration.test.ts 9/9
4052
+  ❯ src/__tests__/integration/full-flow.test.ts 21/21
4053
+  ❯ src/__tests__/regression/phase2-regression.test.ts 12/12
4054
+  ❯ src/__tests__/services/agentshield-integration.test.ts 26/30
4055
+  ❯ src/__tests__/services/provider-resolver-edge-cases.test.ts 25/25
4056
+  ❯ src/__tests__/services/tool-protection-oauth-provider.test.ts [queued]
4057
+  ❯ src/compliance/__tests__/schema-verifier.test.ts [queued]
4058
+  ❯ src/delegation/__tests__/bitstring.test.ts 0/30
4059
+  ❯ src/delegation/__tests__/cascading-revocation.test.ts 23/23
4060
+  ❯ src/delegation/__tests__/delegation-graph.test.ts 0/28
4061
+  ❯ src/services/__tests__/oauth-provider-registry.test.ts [queued]
4062
+  ❯ src/services/__tests__/provider-resolver.test.ts 8/8
4063
+
4064
+  Test Files 25 passed (44)
4065
+  Tests 622 passed | 2 skipped (686)
4066
+  Start at 01:06:38
4067
+  Duration 1.28s
4068
+ [?2026l[?2026h ✓ src/delegation/__tests__/delegation-graph.test.ts (28 tests) 6ms
4069
+ ✓ src/delegation/__tests__/bitstring.test.ts (30 tests) 35ms
4070
+ ✓ src/services/__tests__/oauth-provider-registry.test.ts (9 tests) 3ms
4071
+ stdout | src/__tests__/services/tool-protection-oauth-provider.test.ts > ToolProtectionService - oauthProvider Parsing > New endpoint format (toolProtections object) > should parse oauthProvider from camelCase field
4072
+ [ToolProtectionService] Config loaded from API {
4073
+ source: 'api',
4074
+ toolCount: 2,
4075
+ protectedTools: [ 'read_repos', 'send_email' ],
4076
+ agentDid: 'did:key:z6MkhaXgBZDv...',
4077
+ projectId: 'test-project-123',
4078
+ cacheTtlMs: 300000,
4079
+ cacheExpiresAt: '2025-11-25T07:11:39.983Z'
4080
+ }
4081
+
4082
+ 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
4083
+ [ToolProtectionService] Config loaded from API {
4084
+ source: 'api',
4085
+ toolCount: 1,
4086
+ protectedTools: [ 'read_repos' ],
4087
+ agentDid: 'did:key:z6MkhaXgBZDv...',
4088
+ projectId: 'test-project-123',
4089
+ cacheTtlMs: 300000,
4090
+ cacheExpiresAt: '2025-11-25T07:11:39.989Z'
4091
+ }
4092
+
4093
+ 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
4094
+ [ToolProtectionService] Config loaded from API {
4095
+ source: 'api',
4096
+ toolCount: 1,
4097
+ protectedTools: [ 'read_repos' ],
4098
+ agentDid: 'did:key:z6MkhaXgBZDv...',
4099
+ projectId: 'test-project-123',
4100
+ cacheTtlMs: 300000,
4101
+ cacheExpiresAt: '2025-11-25T07:11:39.989Z'
4102
+ }
4103
+
4104
+ 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)
4105
+ [ToolProtectionService] Config loaded from API {
4106
+ source: 'api',
4107
+ toolCount: 1,
4108
+ protectedTools: [ 'read_repos' ],
4109
+ agentDid: 'did:key:z6MkhaXgBZDv...',
4110
+ projectId: 'test-project-123',
4111
+ cacheTtlMs: 300000,
4112
+ cacheExpiresAt: '2025-11-25T07:11:39.990Z'
4113
+ }
4114
+
4115
+ 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
4116
+ [ToolProtectionService] Config loaded from API {
4117
+ source: 'api',
4118
+ toolCount: 2,
4119
+ protectedTools: [ 'read_repos', 'send_email' ],
4120
+ agentDid: 'did:key:z6MkhaXgBZDv...',
4121
+ projectId: 'none',
4122
+ cacheTtlMs: 300000,
4123
+ cacheExpiresAt: '2025-11-25T07:11:39.990Z'
4124
+ }
4125
+
4126
+ 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
4127
+ [ToolProtectionService] Config loaded from API {
4128
+ source: 'api',
4129
+ toolCount: 1,
4130
+ protectedTools: [ 'read_repos' ],
4131
+ agentDid: 'did:key:z6MkhaXgBZDv...',
4132
+ projectId: 'none',
4133
+ cacheTtlMs: 300000,
4134
+ cacheExpiresAt: '2025-11-25T07:11:39.991Z'
4135
+ }
4136
+
4137
+ 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
4138
+ [ToolProtectionService] Config loaded from API {
4139
+ source: 'api',
4140
+ toolCount: 1,
4141
+ protectedTools: [ 'read_repos' ],
4142
+ agentDid: 'did:key:z6MkhaXgBZDv...',
4143
+ projectId: 'none',
4144
+ cacheTtlMs: 300000,
4145
+ cacheExpiresAt: '2025-11-25T07:11:39.991Z'
4146
+ }
4147
+
4148
+ 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
4149
+ [ToolProtectionService] Config loaded from API {
4150
+ source: 'api',
4151
+ toolCount: 2,
4152
+ protectedTools: [ 'read_repos', 'send_email' ],
4153
+ agentDid: 'did:key:z6MkhaXgBZDv...',
4154
+ projectId: 'none',
4155
+ cacheTtlMs: 300000,
4156
+ cacheExpiresAt: '2025-11-25T07:11:39.991Z'
4157
+ }
4158
+
4159
+ 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
4160
+ [ToolProtectionService] Config loaded from API {
4161
+ source: 'api',
4162
+ toolCount: 1,
4163
+ protectedTools: [ 'read_repos' ],
4164
+ agentDid: 'did:key:z6MkhaXgBZDv...',
4165
+ projectId: 'none',
4166
+ cacheTtlMs: 300000,
4167
+ cacheExpiresAt: '2025-11-25T07:11:39.991Z'
4168
+ }
4169
+
4170
+ 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
4171
+ [ToolProtectionService] Config loaded from API {
4172
+ source: 'api',
4173
+ toolCount: 1,
4174
+ protectedTools: [ 'read_repos' ],
4175
+ agentDid: 'did:key:z6MkhaXgBZDv...',
4176
+ projectId: 'none',
4177
+ cacheTtlMs: 300000,
4178
+ cacheExpiresAt: '2025-11-25T07:11:39.991Z'
4179
+ }
4180
+
4181
+ stdout | src/__tests__/services/tool-protection-oauth-provider.test.ts > ToolProtectionService - oauthProvider Parsing > Caching > should cache oauthProvider field correctly
4182
+ [ToolProtectionService] Config loaded from API {
4183
+ source: 'api',
4184
+ toolCount: 1,
4185
+ protectedTools: [ 'read_repos' ],
4186
+ agentDid: 'did:key:z6MkhaXgBZDv...',
4187
+ projectId: 'test-project-123',
4188
+ cacheTtlMs: 300000,
4189
+ cacheExpiresAt: '2025-11-25T07:11:39.991Z'
4190
+ }
4191
+
4192
+ 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
4193
+ [ToolProtectionService] Config loaded from API {
4194
+ source: 'api',
4195
+ toolCount: 2,
4196
+ protectedTools: [ 'tool_with_provider', 'tool_without_provider' ],
4197
+ agentDid: 'did:key:z6MkhaXgBZDv...',
4198
+ projectId: 'test-project-123',
4199
+ cacheTtlMs: 300000,
4200
+ cacheExpiresAt: '2025-11-25T07:11:39.992Z'
4201
+ }
4202
+
4203
+ stdout | src/__tests__/services/tool-protection-oauth-provider.test.ts > ToolProtectionService - oauthProvider Parsing > oauthProvider field inclusion > should handle empty string oauthProvider gracefully
4204
+ [ToolProtectionService] Config loaded from API {
4205
+ source: 'api',
4206
+ toolCount: 1,
4207
+ protectedTools: [ 'tool_with_empty_provider' ],
4208
+ agentDid: 'did:key:z6MkhaXgBZDv...',
4209
+ projectId: 'test-project-123',
4210
+ cacheTtlMs: 300000,
4211
+ cacheExpiresAt: '2025-11-25T07:11:39.992Z'
4212
+ }
4213
+
4214
+ ✓ src/__tests__/services/tool-protection-oauth-provider.test.ts (14 tests) 11ms
4215
+
4216
+  ❯ src/__tests__/runtime/delegation-flow.test.ts [queued]
4217
+  ❯ src/__tests__/runtime/proof-client-did.test.ts 0/17
4218
+  ❯ src/__tests__/services/agentshield-integration.test.ts 26/30
4219
+  ❯ src/__tests__/services/provider-resolver-edge-cases.test.ts 25/25
4220
+  ❯ src/__tests__/services/tool-protection-oauth-provider.test.ts 14/14
4221
+  ❯ src/compliance/__tests__/schema-verifier.test.ts 0/30
4222
+  ❯ src/delegation/__tests__/bitstring.test.ts 30/30
4223
+  ❯ src/delegation/__tests__/delegation-graph.test.ts 28/28
4224
+  ❯ src/delegation/__tests__/utils.test.ts 1/28
4225
+  ❯ src/delegation/storage/__tests__/memory-graph-storage.test.ts [queued]
4226
+  ❯ src/services/__tests__/batch-delegation.service.test.ts [queued]
4227
+  ❯ src/services/__tests__/oauth-provider-registry.test.ts 9/9
4228
+  ❯ src/services/__tests__/provider-resolution.integration.test.ts 0/6
4229
+
4230
+  Test Files 29 passed (44)
4231
+  Tests 704 passed | 2 skipped (790)
4232
+  Start at 01:06:38
4233
+  Duration 1.58s
4234
+ [?2026l[?2026hstderr | src/services/__tests__/provider-resolution.integration.test.ts > Provider Resolution Integration > Backward compatibility > should work with Phase 1 tools (no oauthProvider field)
4235
+ [ProviderResolver] Tool does not specify oauthProvider. Using project-configured provider "github" as fallback. Consider explicitly setting oauthProvider in tool protection config.
4236
+
4237
+
4238
+  ❯ src/__tests__/runtime/delegation-flow.test.ts [queued]
4239
+  ❯ src/__tests__/runtime/proof-client-did.test.ts 0/17
4240
+  ❯ src/__tests__/services/agentshield-integration.test.ts 26/30
4241
+  ❯ src/__tests__/services/provider-resolver-edge-cases.test.ts 25/25
4242
+  ❯ src/__tests__/services/tool-protection-oauth-provider.test.ts 14/14
4243
+  ❯ src/compliance/__tests__/schema-verifier.test.ts 0/30
4244
+  ❯ src/delegation/__tests__/bitstring.test.ts 30/30
4245
+  ❯ src/delegation/__tests__/delegation-graph.test.ts 28/28
4246
+  ❯ src/delegation/__tests__/utils.test.ts 1/28
4247
+  ❯ src/delegation/storage/__tests__/memory-graph-storage.test.ts [queued]
4248
+  ❯ src/services/__tests__/batch-delegation.service.test.ts [queued]
4249
+  ❯ src/services/__tests__/oauth-provider-registry.test.ts 9/9
4250
+  ❯ src/services/__tests__/provider-resolution.integration.test.ts 0/6
4251
+
4252
+  Test Files 29 passed (44)
4253
+  Tests 704 passed | 2 skipped (790)
4254
+  Start at 01:06:38
4255
+  Duration 1.58s
4256
+ [?2026l[?2026hstdout | src/__tests__/services/agentshield-integration.test.ts > AgentShield Integration > Caching Integration > should respect cache TTL
4257
+ [ToolProtectionService] Config loaded from API {
4258
+ source: 'api',
4259
+ toolCount: 0,
4260
+ protectedTools: [],
4261
+ agentDid: 'did:key:z6MkhaXgBZDv...',
4262
+ projectId: 'test-project-123',
4263
+ cacheTtlMs: 1000,
4264
+ cacheExpiresAt: '2025-11-25T07:06:41.030Z'
4265
+ }
4266
+
4267
+ stdout | src/__tests__/services/agentshield-integration.test.ts > AgentShield Integration > Real-world Scenarios > should handle typical e-commerce tool protection config
4268
+ [ToolProtectionService] Config loaded from API {
4269
+ source: 'api',
4270
+ toolCount: 4,
4271
+ protectedTools: [ 'add_to_cart', 'checkout' ],
4272
+ agentDid: 'did:key:z6MkhaXgBZDv...',
4273
+ projectId: 'test-project-123',
4274
+ cacheTtlMs: 300000,
4275
+ cacheExpiresAt: '2025-11-25T07:11:40.030Z'
4276
+ }
4277
+
4278
+
4279
+  ❯ src/__tests__/runtime/delegation-flow.test.ts [queued]
4280
+  ❯ src/__tests__/runtime/proof-client-did.test.ts 0/17
4281
+  ❯ src/__tests__/services/agentshield-integration.test.ts 26/30
4282
+  ❯ src/__tests__/services/provider-resolver-edge-cases.test.ts 25/25
4283
+  ❯ src/__tests__/services/tool-protection-oauth-provider.test.ts 14/14
4284
+  ❯ src/compliance/__tests__/schema-verifier.test.ts 0/30
4285
+  ❯ src/delegation/__tests__/bitstring.test.ts 30/30
4286
+  ❯ src/delegation/__tests__/delegation-graph.test.ts 28/28
4287
+  ❯ src/delegation/__tests__/utils.test.ts 1/28
4288
+  ❯ src/delegation/storage/__tests__/memory-graph-storage.test.ts [queued]
4289
+  ❯ src/services/__tests__/batch-delegation.service.test.ts [queued]
4290
+  ❯ src/services/__tests__/oauth-provider-registry.test.ts 9/9
4291
+  ❯ src/services/__tests__/provider-resolution.integration.test.ts 0/6
4292
+
4293
+  Test Files 29 passed (44)
4294
+  Tests 704 passed | 2 skipped (790)
4295
+  Start at 01:06:38
4296
+  Duration 1.58s
4297
+ [?2026l[?2026hstderr | src/__tests__/services/agentshield-integration.test.ts > AgentShield Integration > Real-world Scenarios > should handle API rate limiting gracefully
4298
+ [ToolProtectionService] API fetch failed, using fallback config {
4299
+ agentDid: 'did:key:z6MkhaXgBZDv...',
4300
+ error: 'Failed to fetch bouncer config: 429 Too Many Requests - Rate limit exceeded'
4301
+ }
4302
+
4303
+
4304
+  ❯ src/__tests__/runtime/delegation-flow.test.ts [queued]
4305
+  ❯ src/__tests__/runtime/proof-client-did.test.ts 0/17
4306
+  ❯ src/__tests__/services/agentshield-integration.test.ts 26/30
4307
+  ❯ src/__tests__/services/provider-resolver-edge-cases.test.ts 25/25
4308
+  ❯ src/__tests__/services/tool-protection-oauth-provider.test.ts 14/14
4309
+  ❯ src/compliance/__tests__/schema-verifier.test.ts 0/30
4310
+  ❯ src/delegation/__tests__/bitstring.test.ts 30/30
4311
+  ❯ src/delegation/__tests__/delegation-graph.test.ts 28/28
4312
+  ❯ src/delegation/__tests__/utils.test.ts 1/28
4313
+  ❯ src/delegation/storage/__tests__/memory-graph-storage.test.ts [queued]
4314
+  ❯ src/services/__tests__/batch-delegation.service.test.ts [queued]
4315
+  ❯ src/services/__tests__/oauth-provider-registry.test.ts 9/9
4316
+  ❯ src/services/__tests__/provider-resolution.integration.test.ts 0/6
4317
+
4318
+  Test Files 29 passed (44)
4319
+  Tests 704 passed | 2 skipped (790)
4320
+  Start at 01:06:38
4321
+  Duration 1.58s
4322
+ [?2026l[?2026hstdout | src/__tests__/services/agentshield-integration.test.ts > AgentShield Integration > Real-world Scenarios > should handle concurrent requests
4323
+ [ToolProtectionService] Config loaded from API {
4324
+ source: 'api',
4325
+ toolCount: 1,
4326
+ protectedTools: [ 'tool1' ],
4327
+ agentDid: 'did:key:z6MkhaXgBZDv...',
4328
+ projectId: 'test-project-123',
4329
+ cacheTtlMs: 300000,
4330
+ cacheExpiresAt: '2025-11-25T07:11:40.031Z'
4331
+ }
4332
+ [ToolProtectionService] Config loaded from API {
4333
+ source: 'api',
4334
+ toolCount: 1,
4335
+ protectedTools: [ 'tool1' ],
4336
+ agentDid: 'did:key:z6MkhaXgBZDv...',
4337
+ projectId: 'test-project-123',
4338
+ cacheTtlMs: 300000,
4339
+ cacheExpiresAt: '2025-11-25T07:11:40.031Z'
4340
+ }
4341
+ [ToolProtectionService] Config loaded from API {
4342
+ source: 'api',
4343
+ toolCount: 1,
4344
+ protectedTools: [ 'tool1' ],
4345
+ agentDid: 'did:key:z6MkhaXgBZDv...',
4346
+ projectId: 'test-project-123',
4347
+ cacheTtlMs: 300000,
4348
+ cacheExpiresAt: '2025-11-25T07:11:40.031Z'
4349
+ }
4350
+
4351
+
4352
+  ❯ src/__tests__/runtime/delegation-flow.test.ts [queued]
4353
+  ❯ src/__tests__/runtime/proof-client-did.test.ts 0/17
4354
+  ❯ src/__tests__/services/agentshield-integration.test.ts 26/30
4355
+  ❯ src/__tests__/services/provider-resolver-edge-cases.test.ts 25/25
4356
+  ❯ src/__tests__/services/tool-protection-oauth-provider.test.ts 14/14
4357
+  ❯ src/compliance/__tests__/schema-verifier.test.ts 0/30
4358
+  ❯ src/delegation/__tests__/bitstring.test.ts 30/30
4359
+  ❯ src/delegation/__tests__/delegation-graph.test.ts 28/28
4360
+  ❯ src/delegation/__tests__/utils.test.ts 1/28
4361
+  ❯ src/delegation/storage/__tests__/memory-graph-storage.test.ts [queued]
4362
+  ❯ src/services/__tests__/batch-delegation.service.test.ts [queued]
4363
+  ❯ src/services/__tests__/oauth-provider-registry.test.ts 9/9
4364
+  ❯ src/services/__tests__/provider-resolution.integration.test.ts 0/6
4365
+
4366
+  Test Files 29 passed (44)
4367
+  Tests 704 passed | 2 skipped (790)
4368
+  Start at 01:06:38
4369
+  Duration 1.58s
4370
+ [?2026l[?2026h ✓ src/delegation/__tests__/utils.test.ts (28 tests) 3ms
4371
+ ✓ src/services/__tests__/provider-resolution.integration.test.ts (6 tests) 4ms
4372
+ ✓ src/__tests__/services/agentshield-integration.test.ts (30 tests) 1125ms
4373
+ ✓ should respect cache TTL  1105ms
4374
+ ✓ src/__tests__/runtime/proof-client-did.test.ts (17 tests) 17ms
4375
+ ✓ src/compliance/__tests__/schema-verifier.test.ts (30 tests) 5ms
4376
+ ✓ src/services/__tests__/batch-delegation.service.test.ts (11 tests) 11ms
4377
+ ✓ src/__tests__/runtime/audit-logger.test.ts (9 tests) 3ms
4378
+ ✓ src/__tests__/config/provider-runtime-config.test.ts (9 tests) 2ms
4379
+ ✓ src/utils/__tests__/did-helpers.test.ts (11 tests) 2ms
4380
+ ✓ src/delegation/storage/__tests__/memory-graph-storage.test.ts (27 tests) 68ms
4381
+
4382
+  ❯ src/__tests__/index.test.ts [queued]
4383
+  ❯ src/__tests__/runtime/delegation-flow.test.ts 0/4
4384
+  ❯ src/delegation/__tests__/utils.test.ts 28/28
4385
+  ❯ src/delegation/storage/__tests__/memory-statuslist-storage.test.ts 1/14
4386
+
4387
+  Test Files 39 passed (44)
4388
+  Tests 856 passed | 2 skipped (875)
4389
+  Start at 01:06:38
4390
+  Duration 1.68s
4391
+ [?2026l[?2026h ✓ src/delegation/storage/__tests__/memory-statuslist-storage.test.ts (14 tests) 3ms
4392
+ ✓ src/__tests__/runtime/delegation-flow.test.ts (4 tests) 7ms
4393
+ ✓ src/delegation/__tests__/audience-validator.test.ts (5 tests) 5ms
4394
+
4395
+  ❯ src/__tests__/delegation-e2e.test.ts [queued]
4396
+  ❯ src/__tests__/index.test.ts 0/4
4397
+
4398
+  Test Files 42 passed (44)
4399
+  Tests 878 passed | 2 skipped (884)
4400
+  Start at 01:06:38
4401
+  Duration 1.78s
4402
+ [?2026l[?2026h ✓ src/__tests__/index.test.ts (4 tests) 2ms
4403
+ ↓ src/__tests__/delegation-e2e.test.ts (14 tests | 14 skipped)
4404
+
4405
+
4406
+  Test Files 43 passed | 1 skipped (44)
4407
+  Tests 882 passed | 16 skipped (898)
4408
+  Start at 01:06:38
4409
+  Duration 1.99s
4410
+ [?2026l
4411
+  Test Files  43 passed | 1 skipped (44)
4412
+  Tests  882 passed | 16 skipped (898)
4413
+  Start at  01:06:38
4414
+  Duration  2.01s (transform 4.08s, setup 0ms, collect 7.26s, tests 2.72s, environment 16ms, prepare 1.69s)
4415
+
4416
+  % Coverage report from v8
4417
+
4418
+ =============================== Coverage summary ===============================
4419
+ Statements : 65.61% ( 1597/2434 )
4420
+ Branches : 58.79% ( 996/1694 )
4421
+ Functions : 66.16% ( 262/396 )
4422
+ Lines : 65.64% ( 1559/2375 )
4423
+ ================================================================================
4424
+ [?25h