@kya-os/mcp-i-core 1.2.3-canary.6 → 1.3.0-canary.clientinfo.20251126003544

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