@kya-os/mcp-i-core 1.2.2-canary.3 → 1.2.2-canary.30

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