@kya-os/mcp-i-core 1.3.12 → 1.3.14

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 (254) hide show
  1. package/dist/config/remote-config.js +9 -12
  2. package/dist/runtime/base.js +11 -0
  3. package/dist/services/access-control.service.js +5 -0
  4. package/dist/services/tool-protection.service.js +17 -8
  5. package/package.json +2 -2
  6. package/.turbo/turbo-build.log +0 -4
  7. package/.turbo/turbo-test$colon$coverage.log +0 -4586
  8. package/.turbo/turbo-test.log +0 -3169
  9. package/COMPLIANCE_IMPROVEMENT_REPORT.md +0 -483
  10. package/Composer 3.md +0 -615
  11. package/GPT-5.md +0 -1169
  12. package/OPUS-plan.md +0 -352
  13. package/PHASE_3_AND_4.1_SUMMARY.md +0 -585
  14. package/PHASE_3_SUMMARY.md +0 -317
  15. package/PHASE_4.1.3_SUMMARY.md +0 -428
  16. package/PHASE_4.1_COMPLETE.md +0 -525
  17. package/PHASE_4_USER_DID_IDENTITY_LINKING_PLAN.md +0 -1240
  18. package/SCHEMA_COMPLIANCE_REPORT.md +0 -275
  19. package/TEST_PLAN.md +0 -571
  20. package/coverage/coverage-final.json +0 -60
  21. package/dist/cache/oauth-config-cache.d.ts.map +0 -1
  22. package/dist/cache/oauth-config-cache.js.map +0 -1
  23. package/dist/cache/tool-protection-cache.d.ts.map +0 -1
  24. package/dist/cache/tool-protection-cache.js.map +0 -1
  25. package/dist/compliance/index.d.ts.map +0 -1
  26. package/dist/compliance/index.js.map +0 -1
  27. package/dist/compliance/schema-registry.d.ts.map +0 -1
  28. package/dist/compliance/schema-registry.js.map +0 -1
  29. package/dist/compliance/schema-verifier.d.ts.map +0 -1
  30. package/dist/compliance/schema-verifier.js.map +0 -1
  31. package/dist/config/remote-config.d.ts.map +0 -1
  32. package/dist/config/remote-config.js.map +0 -1
  33. package/dist/config.d.ts.map +0 -1
  34. package/dist/config.js.map +0 -1
  35. package/dist/delegation/audience-validator.d.ts.map +0 -1
  36. package/dist/delegation/audience-validator.js.map +0 -1
  37. package/dist/delegation/bitstring.d.ts.map +0 -1
  38. package/dist/delegation/bitstring.js.map +0 -1
  39. package/dist/delegation/cascading-revocation.d.ts.map +0 -1
  40. package/dist/delegation/cascading-revocation.js.map +0 -1
  41. package/dist/delegation/delegation-graph.d.ts.map +0 -1
  42. package/dist/delegation/delegation-graph.js.map +0 -1
  43. package/dist/delegation/did-key-resolver.d.ts.map +0 -1
  44. package/dist/delegation/did-key-resolver.js.map +0 -1
  45. package/dist/delegation/index.d.ts.map +0 -1
  46. package/dist/delegation/index.js.map +0 -1
  47. package/dist/delegation/statuslist-manager.d.ts.map +0 -1
  48. package/dist/delegation/statuslist-manager.js.map +0 -1
  49. package/dist/delegation/storage/index.d.ts.map +0 -1
  50. package/dist/delegation/storage/index.js.map +0 -1
  51. package/dist/delegation/storage/memory-graph-storage.d.ts.map +0 -1
  52. package/dist/delegation/storage/memory-graph-storage.js.map +0 -1
  53. package/dist/delegation/storage/memory-statuslist-storage.d.ts.map +0 -1
  54. package/dist/delegation/storage/memory-statuslist-storage.js.map +0 -1
  55. package/dist/delegation/utils.d.ts.map +0 -1
  56. package/dist/delegation/utils.js.map +0 -1
  57. package/dist/delegation/vc-issuer.d.ts.map +0 -1
  58. package/dist/delegation/vc-issuer.js.map +0 -1
  59. package/dist/delegation/vc-verifier.d.ts.map +0 -1
  60. package/dist/delegation/vc-verifier.js.map +0 -1
  61. package/dist/identity/idp-token-resolver.d.ts.map +0 -1
  62. package/dist/identity/idp-token-resolver.js.map +0 -1
  63. package/dist/identity/idp-token-storage.interface.d.ts.map +0 -1
  64. package/dist/identity/idp-token-storage.interface.js.map +0 -1
  65. package/dist/identity/user-did-manager.d.ts.map +0 -1
  66. package/dist/identity/user-did-manager.js.map +0 -1
  67. package/dist/index.d.ts.map +0 -1
  68. package/dist/index.js.map +0 -1
  69. package/dist/providers/base.d.ts.map +0 -1
  70. package/dist/providers/base.js.map +0 -1
  71. package/dist/providers/memory.d.ts.map +0 -1
  72. package/dist/providers/memory.js.map +0 -1
  73. package/dist/runtime/audit-logger.d.ts.map +0 -1
  74. package/dist/runtime/audit-logger.js.map +0 -1
  75. package/dist/runtime/base.d.ts.map +0 -1
  76. package/dist/runtime/base.js.map +0 -1
  77. package/dist/services/access-control.service.d.ts.map +0 -1
  78. package/dist/services/access-control.service.js.map +0 -1
  79. package/dist/services/authorization/authorization-registry.d.ts.map +0 -1
  80. package/dist/services/authorization/authorization-registry.js.map +0 -1
  81. package/dist/services/authorization/types.d.ts.map +0 -1
  82. package/dist/services/authorization/types.js.map +0 -1
  83. package/dist/services/batch-delegation.service.d.ts.map +0 -1
  84. package/dist/services/batch-delegation.service.js.map +0 -1
  85. package/dist/services/crypto.service.d.ts.map +0 -1
  86. package/dist/services/crypto.service.js.map +0 -1
  87. package/dist/services/errors.d.ts.map +0 -1
  88. package/dist/services/errors.js.map +0 -1
  89. package/dist/services/index.d.ts.map +0 -1
  90. package/dist/services/index.js.map +0 -1
  91. package/dist/services/oauth-config.service.d.ts.map +0 -1
  92. package/dist/services/oauth-config.service.js.map +0 -1
  93. package/dist/services/oauth-provider-registry.d.ts.map +0 -1
  94. package/dist/services/oauth-provider-registry.js.map +0 -1
  95. package/dist/services/oauth-service.d.ts.map +0 -1
  96. package/dist/services/oauth-service.js.map +0 -1
  97. package/dist/services/oauth-token-retrieval.service.d.ts.map +0 -1
  98. package/dist/services/oauth-token-retrieval.service.js.map +0 -1
  99. package/dist/services/proof-verifier.d.ts.map +0 -1
  100. package/dist/services/proof-verifier.js.map +0 -1
  101. package/dist/services/provider-resolver.d.ts.map +0 -1
  102. package/dist/services/provider-resolver.js.map +0 -1
  103. package/dist/services/provider-validator.d.ts.map +0 -1
  104. package/dist/services/provider-validator.js.map +0 -1
  105. package/dist/services/session-registration.service.d.ts.map +0 -1
  106. package/dist/services/session-registration.service.js.map +0 -1
  107. package/dist/services/storage.service.d.ts.map +0 -1
  108. package/dist/services/storage.service.js.map +0 -1
  109. package/dist/services/tool-context-builder.d.ts.map +0 -1
  110. package/dist/services/tool-context-builder.js.map +0 -1
  111. package/dist/services/tool-protection.service.d.ts.map +0 -1
  112. package/dist/services/tool-protection.service.js.map +0 -1
  113. package/dist/types/oauth-required-error.d.ts.map +0 -1
  114. package/dist/types/oauth-required-error.js.map +0 -1
  115. package/dist/types/tool-protection.d.ts.map +0 -1
  116. package/dist/types/tool-protection.js.map +0 -1
  117. package/dist/utils/base58.d.ts.map +0 -1
  118. package/dist/utils/base58.js.map +0 -1
  119. package/dist/utils/base64.d.ts.map +0 -1
  120. package/dist/utils/base64.js.map +0 -1
  121. package/dist/utils/cors.d.ts.map +0 -1
  122. package/dist/utils/cors.js.map +0 -1
  123. package/dist/utils/did-helpers.d.ts.map +0 -1
  124. package/dist/utils/did-helpers.js.map +0 -1
  125. package/dist/utils/index.d.ts.map +0 -1
  126. package/dist/utils/index.js.map +0 -1
  127. package/dist/utils/storage-keys.d.ts.map +0 -1
  128. package/dist/utils/storage-keys.js.map +0 -1
  129. package/docs/API_REFERENCE.md +0 -1362
  130. package/docs/COMPLIANCE_MATRIX.md +0 -691
  131. package/docs/STATUSLIST2021_GUIDE.md +0 -696
  132. package/docs/W3C_VC_DELEGATION_GUIDE.md +0 -710
  133. package/src/__tests__/cache/tool-protection-cache.test.ts +0 -640
  134. package/src/__tests__/config/provider-runtime-config.test.ts +0 -309
  135. package/src/__tests__/delegation-e2e.test.ts +0 -690
  136. package/src/__tests__/identity/user-did-manager.test.ts +0 -232
  137. package/src/__tests__/index.test.ts +0 -56
  138. package/src/__tests__/integration/full-flow.test.ts +0 -789
  139. package/src/__tests__/integration.test.ts +0 -281
  140. package/src/__tests__/providers/base.test.ts +0 -173
  141. package/src/__tests__/providers/memory.test.ts +0 -319
  142. package/src/__tests__/regression/phase2-regression.test.ts +0 -429
  143. package/src/__tests__/runtime/audit-logger.test.ts +0 -154
  144. package/src/__tests__/runtime/base-extensions.test.ts +0 -595
  145. package/src/__tests__/runtime/base.test.ts +0 -869
  146. package/src/__tests__/runtime/delegation-flow.test.ts +0 -164
  147. package/src/__tests__/runtime/proof-client-did.test.ts +0 -376
  148. package/src/__tests__/runtime/route-interception.test.ts +0 -686
  149. package/src/__tests__/runtime/tool-protection-enforcement.test.ts +0 -908
  150. package/src/__tests__/services/agentshield-integration.test.ts +0 -791
  151. package/src/__tests__/services/cache-busting.test.ts +0 -125
  152. package/src/__tests__/services/oauth-service-pkce.test.ts +0 -556
  153. package/src/__tests__/services/provider-resolver-edge-cases.test.ts +0 -591
  154. package/src/__tests__/services/tool-protection-merged-config.test.ts +0 -485
  155. package/src/__tests__/services/tool-protection-oauth-provider.test.ts +0 -480
  156. package/src/__tests__/services/tool-protection.service.test.ts +0 -1373
  157. package/src/__tests__/utils/mock-providers.ts +0 -340
  158. package/src/cache/oauth-config-cache.d.ts +0 -69
  159. package/src/cache/oauth-config-cache.d.ts.map +0 -1
  160. package/src/cache/oauth-config-cache.js.map +0 -1
  161. package/src/cache/oauth-config-cache.ts +0 -123
  162. package/src/cache/tool-protection-cache.ts +0 -171
  163. package/src/compliance/EXAMPLE.md +0 -412
  164. package/src/compliance/__tests__/schema-verifier.test.ts +0 -797
  165. package/src/compliance/index.ts +0 -8
  166. package/src/compliance/schema-registry.ts +0 -460
  167. package/src/compliance/schema-verifier.ts +0 -708
  168. package/src/config/__tests__/merged-config.spec.ts +0 -445
  169. package/src/config/__tests__/remote-config.spec.ts +0 -268
  170. package/src/config/remote-config.ts +0 -264
  171. package/src/config.ts +0 -312
  172. package/src/delegation/__tests__/audience-validator.test.ts +0 -112
  173. package/src/delegation/__tests__/bitstring.test.ts +0 -346
  174. package/src/delegation/__tests__/cascading-revocation.test.ts +0 -628
  175. package/src/delegation/__tests__/delegation-graph.test.ts +0 -584
  176. package/src/delegation/__tests__/did-key-resolver.test.ts +0 -265
  177. package/src/delegation/__tests__/utils.test.ts +0 -152
  178. package/src/delegation/__tests__/vc-issuer.test.ts +0 -442
  179. package/src/delegation/__tests__/vc-verifier.test.ts +0 -922
  180. package/src/delegation/audience-validator.ts +0 -52
  181. package/src/delegation/bitstring.ts +0 -278
  182. package/src/delegation/cascading-revocation.ts +0 -370
  183. package/src/delegation/delegation-graph.ts +0 -299
  184. package/src/delegation/did-key-resolver.ts +0 -179
  185. package/src/delegation/index.ts +0 -14
  186. package/src/delegation/statuslist-manager.ts +0 -353
  187. package/src/delegation/storage/__tests__/memory-graph-storage.test.ts +0 -366
  188. package/src/delegation/storage/__tests__/memory-statuslist-storage.test.ts +0 -228
  189. package/src/delegation/storage/index.ts +0 -9
  190. package/src/delegation/storage/memory-graph-storage.ts +0 -178
  191. package/src/delegation/storage/memory-statuslist-storage.ts +0 -77
  192. package/src/delegation/utils.ts +0 -221
  193. package/src/delegation/vc-issuer.ts +0 -232
  194. package/src/delegation/vc-verifier.ts +0 -568
  195. package/src/identity/idp-token-resolver.ts +0 -181
  196. package/src/identity/idp-token-storage.interface.ts +0 -94
  197. package/src/identity/user-did-manager.ts +0 -526
  198. package/src/index.ts +0 -310
  199. package/src/providers/base.d.ts +0 -91
  200. package/src/providers/base.d.ts.map +0 -1
  201. package/src/providers/base.js.map +0 -1
  202. package/src/providers/base.ts +0 -96
  203. package/src/providers/memory.ts +0 -142
  204. package/src/runtime/audit-logger.ts +0 -39
  205. package/src/runtime/base.ts +0 -1392
  206. package/src/services/__tests__/access-control.integration.test.ts +0 -443
  207. package/src/services/__tests__/access-control.proof-response-validation.test.ts +0 -578
  208. package/src/services/__tests__/access-control.service.test.ts +0 -970
  209. package/src/services/__tests__/batch-delegation.service.test.ts +0 -351
  210. package/src/services/__tests__/crypto.service.test.ts +0 -531
  211. package/src/services/__tests__/oauth-provider-registry.test.ts +0 -142
  212. package/src/services/__tests__/proof-verifier.integration.test.ts +0 -485
  213. package/src/services/__tests__/proof-verifier.test.ts +0 -489
  214. package/src/services/__tests__/provider-resolution.integration.test.ts +0 -202
  215. package/src/services/__tests__/provider-resolver.test.ts +0 -213
  216. package/src/services/__tests__/storage.service.test.ts +0 -358
  217. package/src/services/access-control.service.ts +0 -990
  218. package/src/services/authorization/authorization-registry.ts +0 -66
  219. package/src/services/authorization/types.ts +0 -71
  220. package/src/services/batch-delegation.service.ts +0 -137
  221. package/src/services/crypto.service.ts +0 -302
  222. package/src/services/errors.ts +0 -76
  223. package/src/services/index.ts +0 -18
  224. package/src/services/oauth-config.service.d.ts +0 -53
  225. package/src/services/oauth-config.service.d.ts.map +0 -1
  226. package/src/services/oauth-config.service.js.map +0 -1
  227. package/src/services/oauth-config.service.ts +0 -192
  228. package/src/services/oauth-provider-registry.d.ts +0 -57
  229. package/src/services/oauth-provider-registry.d.ts.map +0 -1
  230. package/src/services/oauth-provider-registry.js.map +0 -1
  231. package/src/services/oauth-provider-registry.ts +0 -141
  232. package/src/services/oauth-service.ts +0 -544
  233. package/src/services/oauth-token-retrieval.service.ts +0 -245
  234. package/src/services/proof-verifier.ts +0 -478
  235. package/src/services/provider-resolver.d.ts +0 -48
  236. package/src/services/provider-resolver.d.ts.map +0 -1
  237. package/src/services/provider-resolver.js.map +0 -1
  238. package/src/services/provider-resolver.ts +0 -146
  239. package/src/services/provider-validator.ts +0 -170
  240. package/src/services/session-registration.service.ts +0 -251
  241. package/src/services/storage.service.ts +0 -566
  242. package/src/services/tool-context-builder.ts +0 -237
  243. package/src/services/tool-protection.service.ts +0 -1070
  244. package/src/types/oauth-required-error.ts +0 -63
  245. package/src/types/tool-protection.ts +0 -155
  246. package/src/utils/__tests__/did-helpers.test.ts +0 -156
  247. package/src/utils/base58.ts +0 -109
  248. package/src/utils/base64.ts +0 -148
  249. package/src/utils/cors.ts +0 -83
  250. package/src/utils/did-helpers.ts +0 -210
  251. package/src/utils/index.ts +0 -8
  252. package/src/utils/storage-keys.ts +0 -278
  253. package/tsconfig.json +0 -21
  254. package/vitest.config.ts +0 -56
@@ -1,3169 +0,0 @@
1
-
2
- > @kya-os/mcp-i-core@1.3.12 test /Users/dylanhobbs/Documents/@kya-os/xmcp-i/packages/mcp-i-core
3
- > vitest run
4
-
5
-
6
- RUN v4.0.14 /Users/dylanhobbs/Documents/@kya-os/xmcp-i/packages/mcp-i-core
7
-
8
- stdout | src/__tests__/services/agentshield-integration.test.ts > AgentShield Integration > API Authentication > should use X-API-Key header for new endpoint
9
- [ToolProtectionService] Config loaded from API {
10
- source: 'api',
11
- toolCount: 0,
12
- protectedTools: [],
13
- agentDid: 'did:key:z6MkhaXgBZDv...',
14
- projectId: 'test-project-123',
15
- cacheTtlMs: 300000,
16
- cacheExpiresAt: '2025-12-04T01:20:15.470Z'
17
- }
18
-
19
- stdout | src/__tests__/services/agentshield-integration.test.ts > AgentShield Integration > API Authentication > should use Authorization Bearer header for old endpoint
20
- [ToolProtectionService] Config loaded from API {
21
- source: 'api',
22
- toolCount: 0,
23
- protectedTools: [],
24
- agentDid: 'did:key:z6MkhaXgBZDv...',
25
- projectId: 'none',
26
- cacheTtlMs: 300000,
27
- cacheExpiresAt: '2025-12-04T01:20:15.473Z'
28
- }
29
-
30
- stdout | src/__tests__/services/tool-protection-merged-config.test.ts > ToolProtectionService - Merged Config API > Fetching from /config endpoint with embedded tools > should fetch from /config endpoint and extract toolProtection.tools
31
- [ToolProtectionService] Config loaded from API {
32
- source: 'api',
33
- toolCount: 2,
34
- protectedTools: [ 'checkout' ],
35
- agentDid: 'did:key:z6MkhaXgBZDv...',
36
- projectId: 'test-project-123',
37
- cacheTtlMs: 300000,
38
- cacheExpiresAt: '2025-12-04T01:20:15.475Z'
39
- }
40
-
41
- stdout | src/__tests__/services/agentshield-integration.test.ts > AgentShield Integration > Endpoint Selection > should use project-scoped /config endpoint when projectId is available
42
- [ToolProtectionService] Config loaded from API {
43
- source: 'api',
44
- toolCount: 0,
45
- protectedTools: [],
46
- agentDid: 'did:key:z6MkhaXgBZDv...',
47
- projectId: 'test-project-123',
48
- cacheTtlMs: 300000,
49
- cacheExpiresAt: '2025-12-04T01:20:15.477Z'
50
- }
51
-
52
- stdout | src/__tests__/services/agentshield-integration.test.ts > AgentShield Integration > Endpoint Selection > should use agent-scoped endpoint when projectId is not available
53
- [ToolProtectionService] Config loaded from API {
54
- source: 'api',
55
- toolCount: 0,
56
- protectedTools: [],
57
- agentDid: 'did:key:z6MkhaXgBZDv...',
58
- projectId: 'none',
59
- cacheTtlMs: 300000,
60
- cacheExpiresAt: '2025-12-04T01:20:15.478Z'
61
- }
62
-
63
- stdout | src/__tests__/services/agentshield-integration.test.ts > AgentShield Integration > Endpoint Selection > should encode projectId in URL
64
- [ToolProtectionService] Config loaded from API {
65
- source: 'api',
66
- toolCount: 0,
67
- protectedTools: [],
68
- agentDid: 'did:key:z6MkhaXgBZDv...',
69
- projectId: 'project/with/special-chars',
70
- cacheTtlMs: 300000,
71
- cacheExpiresAt: '2025-12-04T01:20:15.479Z'
72
- }
73
-
74
- stdout | src/__tests__/services/tool-protection-merged-config.test.ts > ToolProtectionService - Merged Config API > Fetching from /config endpoint with embedded tools > should use projectId-based /config endpoint when projectId is set
75
- [ToolProtectionService] Config loaded from API {
76
- source: 'api',
77
- toolCount: 1,
78
- protectedTools: [ 'greet' ],
79
- agentDid: 'did:key:z6MkhaXgBZDv...',
80
- projectId: 'my-project-id',
81
- cacheTtlMs: 300000,
82
- cacheExpiresAt: '2025-12-04T01:20:15.479Z'
83
- }
84
-
85
- stdout | src/__tests__/services/agentshield-integration.test.ts > AgentShield Integration > Endpoint Selection > should encode agent DID in URL
86
- [ToolProtectionService] Config loaded from API {
87
- source: 'api',
88
- toolCount: 0,
89
- protectedTools: [],
90
- agentDid: 'did:key:z6MkhaXgBZDv...',
91
- projectId: 'none',
92
- cacheTtlMs: 300000,
93
- cacheExpiresAt: '2025-12-04T01:20:15.480Z'
94
- }
95
-
96
- stdout | src/__tests__/services/agentshield-integration.test.ts > AgentShield Integration > Response Format Compatibility > should handle new endpoint format (toolProtections object)
97
- [ToolProtectionService] Config loaded from API {
98
- source: 'api',
99
- toolCount: 2,
100
- protectedTools: [ 'checkout' ],
101
- agentDid: 'did:key:z6MkhaXgBZDv...',
102
- projectId: 'test-project-123',
103
- cacheTtlMs: 300000,
104
- cacheExpiresAt: '2025-12-04T01:20:15.480Z'
105
- }
106
-
107
- stdout | src/__tests__/services/agentshield-integration.test.ts > AgentShield Integration > Response Format Compatibility > should handle old endpoint format (tools array)
108
- [ToolProtectionService] Config loaded from API {
109
- source: 'api',
110
- toolCount: 2,
111
- protectedTools: [ 'checkout' ],
112
- agentDid: 'did:key:z6MkhaXgBZDv...',
113
- projectId: 'none',
114
- cacheTtlMs: 300000,
115
- cacheExpiresAt: '2025-12-04T01:20:15.481Z'
116
- }
117
-
118
- stdout | src/__tests__/services/agentshield-integration.test.ts > AgentShield Integration > Response Format Compatibility > should handle old endpoint format (tools object)
119
- [ToolProtectionService] Config loaded from API {
120
- source: 'api',
121
- toolCount: 2,
122
- protectedTools: [ 'checkout' ],
123
- agentDid: 'did:key:z6MkhaXgBZDv...',
124
- projectId: 'none',
125
- cacheTtlMs: 300000,
126
- cacheExpiresAt: '2025-12-04T01:20:15.481Z'
127
- }
128
-
129
- stdout | src/__tests__/services/agentshield-integration.test.ts > AgentShield Integration > Response Format Compatibility > should handle snake_case field names
130
- [ToolProtectionService] Config loaded from API {
131
- source: 'api',
132
- toolCount: 1,
133
- protectedTools: [ 'tool1' ],
134
- agentDid: 'did:key:z6MkhaXgBZDv...',
135
- projectId: 'test-project-123',
136
- cacheTtlMs: 300000,
137
- cacheExpiresAt: '2025-12-04T01:20:15.481Z'
138
- }
139
-
140
- stderr | src/__tests__/services/agentshield-integration.test.ts > AgentShield Integration > Error Handling > should handle network timeout
141
- stdout | src/__tests__/services/agentshield-integration.test.ts > AgentShield Integration > Response Format Compatibility > should handle camelCase field names
142
- [ToolProtectionService] API fetch failed, using fallback config { agentDid: 'did:key:z6MkhaXgBZDv...', error: 'Network timeout' }
143
-
144
- [ToolProtectionService] Config loaded from API {
145
- source: 'api',
146
- toolCount: 1,
147
- protectedTools: [ 'tool1' ],
148
- agentDid: 'did:key:z6MkhaXgBZDv...',
149
- projectId: 'test-project-123',
150
- cacheTtlMs: 300000,
151
- cacheExpiresAt: '2025-12-04T01:20:15.482Z'
152
- stderr | src/__tests__/services/agentshield-integration.test.ts > AgentShield Integration > Fallback Behavior > should cache fallback config
153
- [ToolProtectionService] API fetch failed, using fallback config { agentDid: 'did:key:z6MkhaXgBZDv...', error: 'Network error' }
154
- }
155
-
156
-
157
- stdout | src/__tests__/services/agentshield-integration.test.ts > AgentShield Integration > Response Format Compatibility > should prefer camelCase over snake_case when both present
158
- [ToolProtectionService] Config loaded from API {
159
- source: 'api',
160
- toolCount: 1,
161
- protectedTools: [ 'tool1' ],
162
- agentDid: 'did:key:z6MkhaXgBZDv...',
163
- projectId: 'test-project-123',
164
- cacheTtlMs: 300000,
165
- cacheExpiresAt: '2025-12-04T01:20:15.482Z'
166
- }
167
-
168
- stdout | src/__tests__/services/agentshield-integration.test.ts > AgentShield Integration > Caching Integration > should cache successful API responses
169
- [ToolProtectionService] Config loaded from API {
170
- source: 'api',
171
- toolCount: 1,
172
- protectedTools: [ 'tool1' ],
173
- agentDid: 'did:key:z6MkhaXgBZDv...',
174
- projectId: 'test-project-123',
175
- cacheTtlMs: 300000,
176
- cacheExpiresAt: '2025-12-04T01:20:15.485Z'
177
- }
178
-
179
- stdout | src/__tests__/services/agentshield-integration.test.ts > AgentShield Integration > Caching Integration > should respect cache TTL
180
- [ToolProtectionService] Config loaded from API {
181
- source: 'api',
182
- toolCount: 0,
183
- protectedTools: [],
184
- agentDid: 'did:key:z6MkhaXgBZDv...',
185
- projectId: 'test-project-123',
186
- cacheTtlMs: 1000,
187
- cacheExpiresAt: '2025-12-04T01:15:16.485Z'
188
- }
189
-
190
- stdout | src/__tests__/services/tool-protection-merged-config.test.ts > ToolProtectionService - Merged Config API > Fetching from /config endpoint with embedded tools > should handle empty tools object from merged config
191
- [ToolProtectionService] Config loaded from API {
192
- source: 'api',
193
- toolCount: 0,
194
- protectedTools: [],
195
- agentDid: 'did:key:z6MkhaXgBZDv...',
196
- projectId: 'test-project-123',
197
- cacheTtlMs: 300000,
198
- cacheExpiresAt: '2025-12-04T01:20:15.480Z'
199
- }
200
-
201
- stdout | src/__tests__/services/tool-protection-merged-config.test.ts > ToolProtectionService - Merged Config API > checkToolProtection with merged config > should correctly identify protected tool from merged config
202
- [ToolProtectionService] Config loaded from API {
203
- source: 'api',
204
- toolCount: 2,
205
- protectedTools: [ 'checkout' ],
206
- agentDid: 'did:key:z6MkhaXgBZDv...',
207
- projectId: 'test-project-123',
208
- cacheTtlMs: 300000,
209
- cacheExpiresAt: '2025-12-04T01:20:15.481Z'
210
- }
211
-
212
- stdout | src/__tests__/services/tool-protection-merged-config.test.ts > ToolProtectionService - Merged Config API > checkToolProtection with merged config > should correctly identify protected tool from merged config
213
- [ToolProtectionService] Protection check {
214
- tool: 'checkout',
215
- agentDid: 'did:key:z6MkhaXgBZDv...',
216
- found: true,
217
- isWildcard: false,
218
- requiresDelegation: true,
219
- availableTools: [ 'checkout', 'greet' ]
220
- }
221
-
222
- stdout | src/__tests__/services/tool-protection-merged-config.test.ts > ToolProtectionService - Merged Config API > checkToolProtection with merged config > should return null for unknown tool
223
- [ToolProtectionService] Config loaded from API {
224
- source: 'api',
225
- toolCount: 1,
226
- protectedTools: [],
227
- agentDid: 'did:key:z6MkhaXgBZDv...',
228
- projectId: 'test-project-123',
229
- cacheTtlMs: 300000,
230
- cacheExpiresAt: '2025-12-04T01:20:15.481Z'
231
- }
232
-
233
- stdout | src/__tests__/services/tool-protection-merged-config.test.ts > ToolProtectionService - Merged Config API > checkToolProtection with merged config > should return null for unknown tool
234
- [ToolProtectionService] Protection check {
235
- tool: 'unknown-tool',
236
- agentDid: 'did:key:z6MkhaXgBZDv...',
237
- found: false,
238
- isWildcard: true,
239
- requiresDelegation: false,
240
- availableTools: [ 'greet' ]
241
- }
242
-
243
- stdout | src/__tests__/services/tool-protection-merged-config.test.ts > ToolProtectionService - Merged Config API > Fallback behavior with merged config > should handle API returning config without tools field
244
- [ToolProtectionService] Config loaded from API {
245
- source: 'api',
246
- stderr | src/__tests__/services/tool-protection-merged-config.test.ts > ToolProtectionService - Merged Config API > Fallback behavior with merged config > should use fallback config when network error occurs
247
- toolCount: 1,
248
- protectedTools: [ 'greet' ],
249
- [ToolProtectionService] API fetch failed, using fallback config { agentDid: 'did:key:z6MkhaXgBZDv...', error: 'Network error' }
250
- agentDid: 'did:key:z6MkhaXgBZDv...',
251
- projectId: 'test-project-123',
252
- cacheTtlMs: 300000,
253
- cacheExpiresAt: '2025-12-04T01:20:15.486Z'
254
-
255
- }
256
-
257
- stdout | src/__tests__/services/tool-protection-merged-config.test.ts > ToolProtectionService - Merged Config API > Caching with merged config > should cache tool protections extracted from merged config
258
- [ToolProtectionService] Config loaded from API {
259
- source: 'api',
260
- toolCount: 1,
261
- protectedTools: [ 'greet' ],
262
- agentDid: 'did:key:z6MkhaXgBZDv...',
263
- projectId: 'test-project-123',
264
- cacheTtlMs: 300000,
265
- cacheExpiresAt: '2025-12-04T01:20:15.486Z'
266
- }
267
-
268
- stdout | src/__tests__/services/tool-protection-merged-config.test.ts > ToolProtectionService - Merged Config API > Caching with merged config > should respect cache TTL for merged config
269
- [ToolProtectionService] Config loaded from API {
270
- source: 'api',
271
- toolCount: 1,
272
- protectedTools: [ 'greet' ],
273
- agentDid: 'did:key:z6MkhaXgBZDv...',
274
- projectId: 'test-project-123',
275
- cacheTtlMs: 100,
276
- cacheExpiresAt: '2025-12-04T01:15:15.586Z'
277
- }
278
-
279
- ✓ src/__tests__/providers/base.test.ts (14 tests) 42ms
280
- stderr | src/services/__tests__/storage.service.test.ts > StorageService > createStorageProviders > should prefer Redis over KV when both are configured
281
- [StorageService] Failed to connect to Redis, falling back to memory: Redis package not available
282
-
283
- ✓ src/__tests__/cache/tool-protection-cache.test.ts (49 tests) 159ms
284
- stderr | src/services/__tests__/storage.service.test.ts > StorageService > createStorageProviders > should prefer Redis over KV when both are configured
285
- [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'
286
-
287
- stderr | src/services/__tests__/storage.service.test.ts > StorageService > createStorageProviders > should fall back to memory when Redis connection fails
288
- [StorageService] Failed to connect to Redis, falling back to memory: Redis package not available
289
-
290
- stderr | src/services/__tests__/storage.service.test.ts > StorageService > createStorageProviders > should use KV namespace when provided
291
- [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'
292
-
293
- stdout | src/__tests__/services/tool-protection-merged-config.test.ts > ToolProtectionService - Merged Config API > Caching with merged config > should respect cache TTL for merged config
294
- [ToolProtectionService] Config loaded from API {
295
- source: 'api',
296
- toolCount: 1,
297
- protectedTools: [ 'greet' ],
298
- agentDid: 'did:key:z6MkhaXgBZDv...',
299
- projectId: 'test-project-123',
300
- cacheTtlMs: 100,
301
- cacheExpiresAt: '2025-12-04T01:15:15.737Z'
302
- }
303
-
304
- stdout | src/__tests__/services/tool-protection-merged-config.test.ts > ToolProtectionService - Merged Config API > Backward compatibility - /tool-protections response format > should still handle legacy /tool-protections response format if encountered
305
- [ToolProtectionService] Config loaded from API {
306
- source: 'api',
307
- toolCount: 1,
308
- protectedTools: [ 'greet' ],
309
- agentDid: 'did:key:z6MkhaXgBZDv...',
310
- projectId: 'test-project-123',
311
- cacheTtlMs: 300000,
312
- cacheExpiresAt: '2025-12-04T01:20:15.637Z'
313
- }
314
-
315
- ✓ src/__tests__/services/tool-protection-merged-config.test.ts (11 tests) 166ms
316
- ✓ src/services/__tests__/storage.service.test.ts (17 tests) 21ms
317
- stderr | src/services/__tests__/access-control.proof-response-validation.test.ts > Proof Submission Response Validation > Wrapped Response Format (AgentShield API) > should validate wrapped response with success field in data
318
- [AccessControl] 🔍 RAW API RESPONSE (before parsing): {
319
- correlationId: '44b856b6-1731-42fd-8975-6af554f5e6eb',
320
- status: 200,
321
- statusText: undefined,
322
- headers: {},
323
- responseTextLength: 191,
324
- responseTextPreview: '{"success":true,"data":{"accepted":1,"rejected":0,"outcomes":{"success":1,"failed":0,"blocked":0,"error":0}},"metadata":{"requestId":"test-request-id","timestamp":"2025-12-04T01:15:15.628Z"}}',
325
- fullResponseText: '{"success":true,"data":{"accepted":1,"rejected":0,"outcomes":{"success":1,"failed":0,"blocked":0,"error":0}},"metadata":{"requestId":"test-request-id","timestamp":"2025-12-04T01:15:15.628Z"}}'
326
- }
327
- [AccessControl] 🔍 PARSED RESPONSE DATA: {
328
- correlationId: '44b856b6-1731-42fd-8975-6af554f5e6eb',
329
- status: 200,
330
- responseDataType: 'object',
331
- responseDataKeys: [ 'success', 'data', 'metadata' ],
332
- responseData: '{\n' +
333
- ' "success": true,\n' +
334
- ' "data": {\n' +
335
- ' "accepted": 1,\n' +
336
- ' "rejected": 0,\n' +
337
- ' "outcomes": {\n' +
338
- ' "success": 1,\n' +
339
- ' "failed": 0,\n' +
340
- ' "blocked": 0,\n' +
341
- ' "error": 0\n' +
342
- ' }\n' +
343
- ' },\n' +
344
- ' "metadata": {\n' +
345
- ' "requestId": "test-request-id",\n' +
346
- ' "timestamp": "2025-12-04T01:15:15.628Z"\n' +
347
- ' }\n' +
348
- '}'
349
- }
350
- [AccessControl] Raw response received: {
351
- "success": true,
352
- "data": {
353
- "accepted": 1,
354
- "rejected": 0,
355
- "outcomes": {
356
- "success": 1,
357
- "failed": 0,
358
- "blocked": 0,
359
- "error": 0
360
- }
361
- },
362
- "metadata": {
363
- "requestId": "test-request-id",
364
- "timestamp": "2025-12-04T01:15:15.628Z"
365
- }
366
- }
367
- [AccessControl] 🔍 DATA OBJECT STRUCTURE (after deep clone): {
368
- correlationId: '44b856b6-1731-42fd-8975-6af554f5e6eb',
369
- dataKeys: [ 'accepted', 'rejected', 'outcomes' ],
370
- hasAccepted: true,
371
- hasRejected: true,
372
- hasOutcomes: true,
373
- hasErrors: false,
374
- acceptedType: 'number',
375
- acceptedValue: 1,
376
- rejectedType: 'number',
377
- rejectedValue: 0,
378
- outcomesType: 'object',
379
- outcomesValue: { success: 1, failed: 0, blocked: 0, error: 0 },
380
- errorsType: 'undefined',
381
- errorsIsArray: false,
382
- fullData: '{\n' +
383
- ' "accepted": 1,\n' +
384
- ' "rejected": 0,\n' +
385
- ' "outcomes": {\n' +
386
- ' "success": 1,\n' +
387
- ' "failed": 0,\n' +
388
- ' "blocked": 0,\n' +
389
- ' "error": 0\n' +
390
- ' }\n' +
391
- '}'
392
- }
393
- [AccessControl] 🔍 VALIDATING DATA WITH SUCCESS: {
394
- correlationId: '44b856b6-1731-42fd-8975-6af554f5e6eb',
395
- dataWithSuccessKeys: [ 'success', 'accepted', 'rejected', 'outcomes' ],
396
- hasSuccess: true,
397
- successValue: true,
398
- hasAccepted: true,
399
- acceptedValue: 1,
400
- hasRejected: true,
401
- rejectedValue: 0,
402
- hasOutcomes: true,
403
- outcomesValue: { success: 1, failed: 0, blocked: 0, error: 0 },
404
- fullDataWithSuccess: '{\n' +
405
- ' "success": true,\n' +
406
- ' "accepted": 1,\n' +
407
- ' "rejected": 0,\n' +
408
- ' "outcomes": {\n' +
409
- ' "success": 1,\n' +
410
- ' "failed": 0,\n' +
411
- ' "blocked": 0,\n' +
412
- ' "error": 0\n' +
413
- ' }\n' +
414
- '}'
415
- }
416
-
417
- stderr | src/services/__tests__/access-control.proof-response-validation.test.ts > Proof Submission Response Validation > Wrapped Response Format (AgentShield API) > should validate wrapped response with errors array
418
- [AccessControl] 🔍 RAW API RESPONSE (before parsing): {
419
- correlationId: '3378ac8e-ca4f-4498-9896-3d5ae565f647',
420
- status: 200,
421
- statusText: undefined,
422
- headers: {},
423
- responseTextLength: 333,
424
- responseTextPreview: '{"success":true,"data":{"accepted":0,"rejected":1,"outcomes":{"success":0,"failed":1,"blocked":0,"error":0},"errors":[{"proof_index":0,"error":{"code":"validation_error","message":"Proof validation failed","details":{"reason":"invalid_signature"}}}]},"metadata":{"requestId":"test-request-id","timestamp":"2025-12-04T01:15:15.675Z"}}',
425
- fullResponseText: '{"success":true,"data":{"accepted":0,"rejected":1,"outcomes":{"success":0,"failed":1,"blocked":0,"error":0},"errors":[{"proof_index":0,"error":{"code":"validation_error","message":"Proof validation failed","details":{"reason":"invalid_signature"}}}]},"metadata":{"requestId":"test-request-id","timestamp":"2025-12-04T01:15:15.675Z"}}'
426
- }
427
- [AccessControl] 🔍 PARSED RESPONSE DATA: {
428
- correlationId: '3378ac8e-ca4f-4498-9896-3d5ae565f647',
429
- status: 200,
430
- responseDataType: 'object',
431
- responseDataKeys: [ 'success', 'data', 'metadata' ],
432
- responseData: '{\n' +
433
- ' "success": true,\n' +
434
- ' "data": {\n' +
435
- ' "accepted": 0,\n' +
436
- ' "rejected": 1,\n' +
437
- ' "outcomes": {\n' +
438
- ' "success": 0,\n' +
439
- ' "failed": 1,\n' +
440
- ' "blocked": 0,\n' +
441
- ' "error": 0\n' +
442
- ' },\n' +
443
- ' "errors": [\n' +
444
- ' {\n' +
445
- ' "proof_index": 0,\n' +
446
- ' "error": {\n' +
447
- ' "code": "validation_error",\n' +
448
- ' "message": "Proof validation failed",\n' +
449
- ' "details": {\n' +
450
- ' "reason": "invalid_signature"\n' +
451
- ' }\n' +
452
- ' }\n' +
453
- ' }\n' +
454
- ' ]\n' +
455
- ' },\n' +
456
- ' "metadata": {\n' +
457
- ' "requestId": "test-request-id",\n' +
458
- ' "timestamp": "2025-12-04T01:15:15.675Z"\n' +
459
- ' }\n' +
460
- '}'
461
- }
462
- [AccessControl] Raw response received: {
463
- "success": true,
464
- "data": {
465
- "accepted": 0,
466
- "rejected": 1,
467
- "outcomes": {
468
- "success": 0,
469
- "failed": 1,
470
- "blocked": 0,
471
- "error": 0
472
- },
473
- "errors": [
474
- {
475
- "proof_index": 0,
476
- "error": {
477
- "code": "validation_error",
478
- "message": "Proof validation failed",
479
- "details": {
480
- "reason": "invalid_signature"
481
- }
482
- }
483
- }
484
- ]
485
- },
486
- "metadata": {
487
- "requestId": "test-request-id",
488
- "timestamp": "2025-12-04T01:15:15.675Z"
489
- }
490
- }
491
- [AccessControl] 🔍 DATA OBJECT STRUCTURE (after deep clone): {
492
- correlationId: '3378ac8e-ca4f-4498-9896-3d5ae565f647',
493
- dataKeys: [ 'accepted', 'rejected', 'outcomes', 'errors' ],
494
- hasAccepted: true,
495
- hasRejected: true,
496
- hasOutcomes: true,
497
- hasErrors: true,
498
- acceptedType: 'number',
499
- acceptedValue: 0,
500
- rejectedType: 'number',
501
- rejectedValue: 1,
502
- outcomesType: 'object',
503
- outcomesValue: { success: 0, failed: 1, blocked: 0, error: 0 },
504
- errorsType: 'object',
505
- errorsIsArray: true,
506
- fullData: '{\n' +
507
- ' "accepted": 0,\n' +
508
- ' "rejected": 1,\n' +
509
- ' "outcomes": {\n' +
510
- ' "success": 0,\n' +
511
- ' "failed": 1,\n' +
512
- ' "blocked": 0,\n' +
513
- ' "error": 0\n' +
514
- ' },\n' +
515
- ' "errors": [\n' +
516
- ' {\n' +
517
- ' "proof_index": 0,\n' +
518
- ' "error": {\n' +
519
- ' "code": "validation_error",\n' +
520
- ' "message": "Proof validation failed",\n' +
521
- ' "details": {\n' +
522
- ' "reason": "invalid_signature"\n' +
523
- ' }\n' +
524
- ' }\n' +
525
- ' }\n' +
526
- ' ]\n' +
527
- '}'
528
- }
529
- [AccessControl] 🔍 VALIDATING DATA WITH SUCCESS: {
530
- correlationId: '3378ac8e-ca4f-4498-9896-3d5ae565f647',
531
- dataWithSuccessKeys: [ 'success', 'accepted', 'rejected', 'outcomes', 'errors' ],
532
- hasSuccess: true,
533
- successValue: true,
534
- hasAccepted: true,
535
- acceptedValue: 0,
536
- hasRejected: true,
537
- rejectedValue: 1,
538
- hasOutcomes: true,
539
- outcomesValue: { success: 0, failed: 1, blocked: 0, error: 0 },
540
- fullDataWithSuccess: '{\n' +
541
- ' "success": true,\n' +
542
- ' "accepted": 0,\n' +
543
- ' "rejected": 1,\n' +
544
- ' "outcomes": {\n' +
545
- ' "success": 0,\n' +
546
- ' "failed": 1,\n' +
547
- ' "blocked": 0,\n' +
548
- ' "error": 0\n' +
549
- ' },\n' +
550
- ' "errors": [\n' +
551
- ' {\n' +
552
- ' "proof_index": 0,\n' +
553
- ' "error": {\n' +
554
- ' "code": "validation_error",\n' +
555
- ' "message": "Proof validation failed",\n' +
556
- ' "details": {\n' +
557
- ' "reason": "invalid_signature"\n' +
558
- ' }\n' +
559
- ' }\n' +
560
- ' }\n' +
561
- ' ]\n' +
562
- '}'
563
- }
564
-
565
- stderr | src/services/__tests__/access-control.proof-response-validation.test.ts > Proof Submission Response Validation > Wrapped Response Format (AgentShield API) > should validate wrapped response without outcomes (optional field)
566
- [AccessControl] 🔍 RAW API RESPONSE (before parsing): {
567
- correlationId: '64a8619d-c455-4f7b-a5d9-152e2ed596b0',
568
- status: 200,
569
- statusText: undefined,
570
- headers: {},
571
- responseTextLength: 133,
572
- responseTextPreview: '{"success":true,"data":{"accepted":1,"rejected":0},"metadata":{"requestId":"test-request-id","timestamp":"2025-12-04T01:15:15.676Z"}}',
573
- fullResponseText: '{"success":true,"data":{"accepted":1,"rejected":0},"metadata":{"requestId":"test-request-id","timestamp":"2025-12-04T01:15:15.676Z"}}'
574
- }
575
- [AccessControl] 🔍 PARSED RESPONSE DATA: {
576
- correlationId: '64a8619d-c455-4f7b-a5d9-152e2ed596b0',
577
- status: 200,
578
- responseDataType: 'object',
579
- responseDataKeys: [ 'success', 'data', 'metadata' ],
580
- responseData: '{\n' +
581
- ' "success": true,\n' +
582
- ' "data": {\n' +
583
- ' "accepted": 1,\n' +
584
- ' "rejected": 0\n' +
585
- ' },\n' +
586
- ' "metadata": {\n' +
587
- ' "requestId": "test-request-id",\n' +
588
- ' "timestamp": "2025-12-04T01:15:15.676Z"\n' +
589
- ' }\n' +
590
- '}'
591
- }
592
- [AccessControl] Raw response received: {
593
- "success": true,
594
- "data": {
595
- "accepted": 1,
596
- "rejected": 0
597
- },
598
- "metadata": {
599
- "requestId": "test-request-id",
600
- "timestamp": "2025-12-04T01:15:15.676Z"
601
- }
602
- }
603
- [AccessControl] 🔍 DATA OBJECT STRUCTURE (after deep clone): {
604
- correlationId: '64a8619d-c455-4f7b-a5d9-152e2ed596b0',
605
- dataKeys: [ 'accepted', 'rejected' ],
606
- hasAccepted: true,
607
- hasRejected: true,
608
- hasOutcomes: false,
609
- hasErrors: false,
610
- acceptedType: 'number',
611
- acceptedValue: 1,
612
- rejectedType: 'number',
613
- rejectedValue: 0,
614
- outcomesType: 'undefined',
615
- outcomesValue: undefined,
616
- errorsType: 'undefined',
617
- errorsIsArray: false,
618
- fullData: '{\n "accepted": 1,\n "rejected": 0\n}'
619
- }
620
- [AccessControl] 🔍 VALIDATING DATA WITH SUCCESS: {
621
- correlationId: '64a8619d-c455-4f7b-a5d9-152e2ed596b0',
622
- dataWithSuccessKeys: [ 'success', 'accepted', 'rejected' ],
623
- hasSuccess: true,
624
- successValue: true,
625
- hasAccepted: true,
626
- acceptedValue: 1,
627
- hasRejected: true,
628
- rejectedValue: 0,
629
- hasOutcomes: false,
630
- outcomesValue: undefined,
631
- fullDataWithSuccess: '{\n "success": true,\n "accepted": 1,\n "rejected": 0\n}'
632
- }
633
-
634
- stderr | src/services/__tests__/access-control.proof-response-validation.test.ts > Proof Submission Response Validation > Wrapped Response Format (AgentShield API) > should throw validation error if data object missing success field
635
- [AccessControl] 🔍 RAW API RESPONSE (before parsing): {
636
- correlationId: 'b45811d4-482a-41c8-9a2f-e2d9dc92705e',
637
- status: 200,
638
- statusText: undefined,
639
- headers: {},
640
- responseTextLength: 191,
641
- responseTextPreview: '{"success":true,"data":{"accepted":1,"rejected":0,"outcomes":{"success":1,"failed":0,"blocked":0,"error":0}},"metadata":{"requestId":"test-request-id","timestamp":"2025-12-04T01:15:15.676Z"}}',
642
- fullResponseText: '{"success":true,"data":{"accepted":1,"rejected":0,"outcomes":{"success":1,"failed":0,"blocked":0,"error":0}},"metadata":{"requestId":"test-request-id","timestamp":"2025-12-04T01:15:15.676Z"}}'
643
- }
644
- [AccessControl] 🔍 PARSED RESPONSE DATA: {
645
- correlationId: 'b45811d4-482a-41c8-9a2f-e2d9dc92705e',
646
- status: 200,
647
- responseDataType: 'object',
648
- responseDataKeys: [ 'success', 'data', 'metadata' ],
649
- responseData: '{\n' +
650
- ' "success": true,\n' +
651
- ' "data": {\n' +
652
- ' "accepted": 1,\n' +
653
- ' "rejected": 0,\n' +
654
- ' "outcomes": {\n' +
655
- ' "success": 1,\n' +
656
- ' "failed": 0,\n' +
657
- ' "blocked": 0,\n' +
658
- ' "error": 0\n' +
659
- ' }\n' +
660
- ' },\n' +
661
- ' "metadata": {\n' +
662
- ' "requestId": "test-request-id",\n' +
663
- ' "timestamp": "2025-12-04T01:15:15.676Z"\n' +
664
- ' }\n' +
665
- '}'
666
- }
667
- [AccessControl] Raw response received: {
668
- "success": true,
669
- "data": {
670
- "accepted": 1,
671
- "rejected": 0,
672
- "outcomes": {
673
- "success": 1,
674
- "failed": 0,
675
- "blocked": 0,
676
- "error": 0
677
- }
678
- },
679
- "metadata": {
680
- "requestId": "test-request-id",
681
- "timestamp": "2025-12-04T01:15:15.676Z"
682
- }
683
- }
684
- [AccessControl] 🔍 DATA OBJECT STRUCTURE (after deep clone): {
685
- correlationId: 'b45811d4-482a-41c8-9a2f-e2d9dc92705e',
686
- dataKeys: [ 'accepted', 'rejected', 'outcomes' ],
687
- hasAccepted: true,
688
- hasRejected: true,
689
- hasOutcomes: true,
690
- hasErrors: false,
691
- acceptedType: 'number',
692
- acceptedValue: 1,
693
- rejectedType: 'number',
694
- rejectedValue: 0,
695
- outcomesType: 'object',
696
- outcomesValue: { success: 1, failed: 0, blocked: 0, error: 0 },
697
- errorsType: 'undefined',
698
- errorsIsArray: false,
699
- fullData: '{\n' +
700
- ' "accepted": 1,\n' +
701
- ' "rejected": 0,\n' +
702
- ' "outcomes": {\n' +
703
- ' "success": 1,\n' +
704
- ' "failed": 0,\n' +
705
- ' "blocked": 0,\n' +
706
- ' "error": 0\n' +
707
- ' }\n' +
708
- '}'
709
- }
710
- [AccessControl] 🔍 VALIDATING DATA WITH SUCCESS: {
711
- correlationId: 'b45811d4-482a-41c8-9a2f-e2d9dc92705e',
712
- dataWithSuccessKeys: [ 'success', 'accepted', 'rejected', 'outcomes' ],
713
- hasSuccess: true,
714
- successValue: true,
715
- hasAccepted: true,
716
- acceptedValue: 1,
717
- hasRejected: true,
718
- rejectedValue: 0,
719
- hasOutcomes: true,
720
- outcomesValue: { success: 1, failed: 0, blocked: 0, error: 0 },
721
- fullDataWithSuccess: '{\n' +
722
- ' "success": true,\n' +
723
- ' "accepted": 1,\n' +
724
- ' "rejected": 0,\n' +
725
- ' "outcomes": {\n' +
726
- ' "success": 1,\n' +
727
- ' "failed": 0,\n' +
728
- ' "blocked": 0,\n' +
729
- ' "error": 0\n' +
730
- ' }\n' +
731
- '}'
732
- }
733
-
734
- stderr | src/services/__tests__/access-control.proof-response-validation.test.ts > Proof Submission Response Validation > JSON Deep Clone Fix (Cloudflare Workers Edge Case) > should correctly extract data from wrapped response after JSON deep clone
735
- [AccessControl] 🔍 RAW API RESPONSE (before parsing): {
736
- correlationId: '4b706886-8d05-4976-953d-9fabf77135ff',
737
- status: 200,
738
- statusText: undefined,
739
- headers: {},
740
- responseTextLength: 191,
741
- responseTextPreview: '{"success":true,"data":{"accepted":1,"rejected":0,"outcomes":{"success":1},"errors":[]},"metadata":{"requestId":"fc1fa88f-9b22-4161-b4fd-17d8215098ee","timestamp":"2025-11-24T21:36:33.029Z"}}',
742
- fullResponseText: '{"success":true,"data":{"accepted":1,"rejected":0,"outcomes":{"success":1},"errors":[]},"metadata":{"requestId":"fc1fa88f-9b22-4161-b4fd-17d8215098ee","timestamp":"2025-11-24T21:36:33.029Z"}}'
743
- }
744
- [AccessControl] 🔍 PARSED RESPONSE DATA: {
745
- correlationId: '4b706886-8d05-4976-953d-9fabf77135ff',
746
- status: 200,
747
- responseDataType: 'object',
748
- responseDataKeys: [ 'success', 'data', 'metadata' ],
749
- responseData: '{\n' +
750
- ' "success": true,\n' +
751
- ' "data": {\n' +
752
- ' "accepted": 1,\n' +
753
- ' "rejected": 0,\n' +
754
- ' "outcomes": {\n' +
755
- ' "success": 1\n' +
756
- ' },\n' +
757
- ' "errors": []\n' +
758
- ' },\n' +
759
- ' "metadata": {\n' +
760
- ' "requestId": "fc1fa88f-9b22-4161-b4fd-17d8215098ee",\n' +
761
- ' "timestamp": "2025-11-24T21:36:33.029Z"\n' +
762
- ' }\n' +
763
- '}'
764
- }
765
- [AccessControl] Raw response received: {
766
- "success": true,
767
- "data": {
768
- "accepted": 1,
769
- "rejected": 0,
770
- "outcomes": {
771
- "success": 1
772
- },
773
- "errors": []
774
- },
775
- "metadata": {
776
- "requestId": "fc1fa88f-9b22-4161-b4fd-17d8215098ee",
777
- "timestamp": "2025-11-24T21:36:33.029Z"
778
- }
779
- }
780
- [AccessControl] 🔍 DATA OBJECT STRUCTURE (after deep clone): {
781
- correlationId: '4b706886-8d05-4976-953d-9fabf77135ff',
782
- dataKeys: [ 'accepted', 'rejected', 'outcomes', 'errors' ],
783
- hasAccepted: true,
784
- hasRejected: true,
785
- hasOutcomes: true,
786
- hasErrors: true,
787
- acceptedType: 'number',
788
- acceptedValue: 1,
789
- rejectedType: 'number',
790
- rejectedValue: 0,
791
- outcomesType: 'object',
792
- outcomesValue: { success: 1 },
793
- errorsType: 'object',
794
- errorsIsArray: true,
795
- fullData: '{\n' +
796
- ' "accepted": 1,\n' +
797
- ' "rejected": 0,\n' +
798
- ' "outcomes": {\n' +
799
- ' "success": 1\n' +
800
- ' },\n' +
801
- ' "errors": []\n' +
802
- '}'
803
- }
804
- [AccessControl] 🔍 VALIDATING DATA WITH SUCCESS: {
805
- correlationId: '4b706886-8d05-4976-953d-9fabf77135ff',
806
- dataWithSuccessKeys: [ 'success', 'accepted', 'rejected', 'outcomes', 'errors' ],
807
- hasSuccess: true,
808
- successValue: true,
809
- hasAccepted: true,
810
- acceptedValue: 1,
811
- hasRejected: true,
812
- rejectedValue: 0,
813
- hasOutcomes: true,
814
- outcomesValue: { success: 1 },
815
- fullDataWithSuccess: '{\n' +
816
- ' "success": true,\n' +
817
- ' "accepted": 1,\n' +
818
- ' "rejected": 0,\n' +
819
- ' "outcomes": {\n' +
820
- ' "success": 1\n' +
821
- ' },\n' +
822
- ' "errors": []\n' +
823
- '}'
824
- }
825
-
826
- stderr | src/services/__tests__/access-control.proof-response-validation.test.ts > Proof Submission Response Validation > JSON Deep Clone Fix (Cloudflare Workers Edge Case) > should handle response where data fields are numeric values (not undefined)
827
- [AccessControl] 🔍 RAW API RESPONSE (before parsing): {
828
- correlationId: '3f8f79eb-d89f-4249-ba4c-770a006bc1be',
829
- status: 200,
830
- statusText: undefined,
831
- headers: {},
832
- responseTextLength: 151,
833
- responseTextPreview: '{"success":true,"data":{"accepted":0,"rejected":0,"outcomes":{},"errors":[]},"metadata":{"requestId":"test-id","timestamp":"2025-12-04T01:15:15.678Z"}}',
834
- fullResponseText: '{"success":true,"data":{"accepted":0,"rejected":0,"outcomes":{},"errors":[]},"metadata":{"requestId":"test-id","timestamp":"2025-12-04T01:15:15.678Z"}}'
835
- }
836
- [AccessControl] 🔍 PARSED RESPONSE DATA: {
837
- correlationId: '3f8f79eb-d89f-4249-ba4c-770a006bc1be',
838
- status: 200,
839
- responseDataType: 'object',
840
- responseDataKeys: [ 'success', 'data', 'metadata' ],
841
- responseData: '{\n' +
842
- ' "success": true,\n' +
843
- ' "data": {\n' +
844
- ' "accepted": 0,\n' +
845
- ' "rejected": 0,\n' +
846
- ' "outcomes": {},\n' +
847
- ' "errors": []\n' +
848
- ' },\n' +
849
- ' "metadata": {\n' +
850
- ' "requestId": "test-id",\n' +
851
- ' "timestamp": "2025-12-04T01:15:15.678Z"\n' +
852
- ' }\n' +
853
- '}'
854
- }
855
- [AccessControl] Raw response received: {
856
- "success": true,
857
- "data": {
858
- "accepted": 0,
859
- "rejected": 0,
860
- "outcomes": {},
861
- "errors": []
862
- },
863
- "metadata": {
864
- "requestId": "test-id",
865
- "timestamp": "2025-12-04T01:15:15.678Z"
866
- }
867
- }
868
- [AccessControl] 🔍 DATA OBJECT STRUCTURE (after deep clone): {
869
- correlationId: '3f8f79eb-d89f-4249-ba4c-770a006bc1be',
870
- dataKeys: [ 'accepted', 'rejected', 'outcomes', 'errors' ],
871
- hasAccepted: true,
872
- hasRejected: true,
873
- hasOutcomes: true,
874
- hasErrors: true,
875
- acceptedType: 'number',
876
- acceptedValue: 0,
877
- rejectedType: 'number',
878
- rejectedValue: 0,
879
- outcomesType: 'object',
880
- outcomesValue: {},
881
- errorsType: 'object',
882
- errorsIsArray: true,
883
- fullData: '{\n "accepted": 0,\n "rejected": 0,\n "outcomes": {},\n "errors": []\n}'
884
- }
885
- [AccessControl] 🔍 VALIDATING DATA WITH SUCCESS: {
886
- correlationId: '3f8f79eb-d89f-4249-ba4c-770a006bc1be',
887
- dataWithSuccessKeys: [ 'success', 'accepted', 'rejected', 'outcomes', 'errors' ],
888
- hasSuccess: true,
889
- successValue: true,
890
- hasAccepted: true,
891
- acceptedValue: 0,
892
- hasRejected: true,
893
- rejectedValue: 0,
894
- hasOutcomes: true,
895
- outcomesValue: {},
896
- fullDataWithSuccess: '{\n' +
897
- ' "success": true,\n' +
898
- ' "accepted": 0,\n' +
899
- ' "rejected": 0,\n' +
900
- ' "outcomes": {},\n' +
901
- ' "errors": []\n' +
902
- '}'
903
- }
904
-
905
- stderr | src/services/__tests__/access-control.proof-response-validation.test.ts > Proof Submission Response Validation > JSON Deep Clone Fix (Cloudflare Workers Edge Case) > should handle response with nested outcomes object
906
- [AccessControl] 🔍 RAW API RESPONSE (before parsing): {
907
- correlationId: '662ba42a-700b-4338-88bc-5f11d41d121e',
908
- status: 200,
909
- statusText: undefined,
910
- headers: {},
911
- responseTextLength: 278,
912
- responseTextPreview: '{"success":true,"data":{"accepted":3,"rejected":2,"outcomes":{"success":1,"failed":1,"blocked":1,"error":2},"errors":[{"proof_index":0,"error":{"code":"validation_error","message":"Invalid signature"}}]},"metadata":{"requestId":"test-id","timestamp":"2025-12-04T01:15:15.678Z"}}',
913
- fullResponseText: '{"success":true,"data":{"accepted":3,"rejected":2,"outcomes":{"success":1,"failed":1,"blocked":1,"error":2},"errors":[{"proof_index":0,"error":{"code":"validation_error","message":"Invalid signature"}}]},"metadata":{"requestId":"test-id","timestamp":"2025-12-04T01:15:15.678Z"}}'
914
- }
915
- [AccessControl] 🔍 PARSED RESPONSE DATA: {
916
- correlationId: '662ba42a-700b-4338-88bc-5f11d41d121e',
917
- status: 200,
918
- responseDataType: 'object',
919
- responseDataKeys: [ 'success', 'data', 'metadata' ],
920
- responseData: '{\n' +
921
- ' "success": true,\n' +
922
- ' "data": {\n' +
923
- ' "accepted": 3,\n' +
924
- ' "rejected": 2,\n' +
925
- ' "outcomes": {\n' +
926
- ' "success": 1,\n' +
927
- ' "failed": 1,\n' +
928
- ' "blocked": 1,\n' +
929
- ' "error": 2\n' +
930
- ' },\n' +
931
- ' "errors": [\n' +
932
- ' {\n' +
933
- ' "proof_index": 0,\n' +
934
- ' "error": {\n' +
935
- ' "code": "validation_error",\n' +
936
- ' "message": "Invalid signature"\n' +
937
- ' }\n' +
938
- ' }\n' +
939
- ' ]\n' +
940
- ' },\n' +
941
- ' "metadata": {\n' +
942
- ' "requestId": "test-id",\n' +
943
- ' "timestamp": "2025-12-04T01:15:15.678Z"\n' +
944
- ' }\n' +
945
- '}'
946
- }
947
- [AccessControl] Raw response received: {
948
- "success": true,
949
- "data": {
950
- "accepted": 3,
951
- "rejected": 2,
952
- "outcomes": {
953
- "success": 1,
954
- "failed": 1,
955
- "blocked": 1,
956
- "error": 2
957
- },
958
- "errors": [
959
- {
960
- "proof_index": 0,
961
- "error": {
962
- "code": "validation_error",
963
- "message": "Invalid signature"
964
- }
965
- }
966
- ]
967
- },
968
- "metadata": {
969
- "requestId": "test-id",
970
- "timestamp": "2025-12-04T01:15:15.678Z"
971
- }
972
- }
973
- [AccessControl] 🔍 DATA OBJECT STRUCTURE (after deep clone): {
974
- correlationId: '662ba42a-700b-4338-88bc-5f11d41d121e',
975
- dataKeys: [ 'accepted', 'rejected', 'outcomes', 'errors' ],
976
- hasAccepted: true,
977
- hasRejected: true,
978
- hasOutcomes: true,
979
- hasErrors: true,
980
- acceptedType: 'number',
981
- acceptedValue: 3,
982
- rejectedType: 'number',
983
- rejectedValue: 2,
984
- outcomesType: 'object',
985
- outcomesValue: { success: 1, failed: 1, blocked: 1, error: 2 },
986
- errorsType: 'object',
987
- errorsIsArray: true,
988
- fullData: '{\n' +
989
- ' "accepted": 3,\n' +
990
- ' "rejected": 2,\n' +
991
- ' "outcomes": {\n' +
992
- ' "success": 1,\n' +
993
- ' "failed": 1,\n' +
994
- ' "blocked": 1,\n' +
995
- ' "error": 2\n' +
996
- ' },\n' +
997
- ' "errors": [\n' +
998
- ' {\n' +
999
- ' "proof_index": 0,\n' +
1000
- ' "error": {\n' +
1001
- ' "code": "validation_error",\n' +
1002
- ' "message": "Invalid signature"\n' +
1003
- ' }\n' +
1004
- ' }\n' +
1005
- ' ]\n' +
1006
- '}'
1007
- }
1008
- [AccessControl] 🔍 VALIDATING DATA WITH SUCCESS: {
1009
- correlationId: '662ba42a-700b-4338-88bc-5f11d41d121e',
1010
- dataWithSuccessKeys: [ 'success', 'accepted', 'rejected', 'outcomes', 'errors' ],
1011
- hasSuccess: true,
1012
- successValue: true,
1013
- hasAccepted: true,
1014
- acceptedValue: 3,
1015
- hasRejected: true,
1016
- rejectedValue: 2,
1017
- hasOutcomes: true,
1018
- outcomesValue: { success: 1, failed: 1, blocked: 1, error: 2 },
1019
- fullDataWithSuccess: '{\n' +
1020
- ' "success": true,\n' +
1021
- ' "accepted": 3,\n' +
1022
- ' "rejected": 2,\n' +
1023
- ' "outcomes": {\n' +
1024
- ' "success": 1,\n' +
1025
- ' "failed": 1,\n' +
1026
- ' "blocked": 1,\n' +
1027
- ' "error": 2\n' +
1028
- ' },\n' +
1029
- ' "errors": [\n' +
1030
- ' {\n' +
1031
- ' "proof_index": 0,\n' +
1032
- ' "error": {\n' +
1033
- ' "code": "validation_error",\n' +
1034
- ' "message": "Invalid signature"\n' +
1035
- ' }\n' +
1036
- ' }\n' +
1037
- ' ]\n' +
1038
- '}'
1039
- }
1040
-
1041
- ✓ src/services/__tests__/access-control.proof-response-validation.test.ts (12 tests) 54ms
1042
- ✓ src/__tests__/runtime/proof-client-did.test.ts (17 tests) 9ms
1043
- ✓ src/__tests__/runtime/base-extensions.test.ts (38 tests) 11ms
1044
- ✓ src/__tests__/runtime/base.test.ts (55 tests) 15ms
1045
- 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
1046
- stderr | src/__tests__/runtime/tool-protection-enforcement.test.ts > MCPIRuntimeBase - Tool Protection Enforcement > processToolCall with tool protection > should block tool execution when protection required and no delegation
1047
- [MCP-I] BLOCKED: Tool requires delegation but none provided {
1048
- [MCP-I] Checking tool protection: {
1049
- tool: 'unprotectedTool',
1050
- agentDid: 'did:key:zmock123...',
1051
- tool: 'protectedTool',
1052
- hasDelegation: false
1053
- }
1054
-
1055
- 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
1056
- [MCP-I] Tool protection check passed (no delegation required) {
1057
- requiredScopes: [ 'files:write' ],
1058
- tool: 'unprotectedTool',
1059
- agentDid: 'did:key:zmock123...',
1060
- reason: 'Tool not configured to require delegation'
1061
- }
1062
- agentDid: 'did:key:zmock123...',
1063
- resumeToken: 'resume_bx55kc_miqquppj',
1064
- consentUrl: 'https://kya.vouched.id/bouncer/consent?tool=protectedTool&scopes=files%3Awrite&session_id=session123&agent_did=&resume_token=resume_bx55kc_miqquppj'
1065
- }
1066
-
1067
-
1068
- stderr | src/__tests__/runtime/tool-protection-enforcement.test.ts > MCPIRuntimeBase - Tool Protection Enforcement > processToolCall with tool protection > should block tool execution when delegation verification fails
1069
- 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
1070
- [MCP-I] Checking tool protection: {
1071
- [MCP-I] ❌ Delegation verification FAILED {
1072
- tool: 'protectedTool',
1073
- tool: 'protectedTool',
1074
- agentDid: 'did:key:zmock123...',
1075
- hasDelegation: false
1076
- }
1077
- agentDid: 'did:key:zmock123...',
1078
-
1079
- stdout | src/__tests__/runtime/tool-protection-enforcement.test.ts > MCPIRuntimeBase - Tool Protection Enforcement > processToolCall with tool protection > should allow tool execution when protection required and delegation provided
1080
- [MCP-I] Checking tool protection: {
1081
- reason: 'Delegation token expired',
1082
- tool: 'protectedTool',
1083
- agentDid: 'did:key:zmock123...',
1084
- errorCode: undefined,
1085
- errorMessage: undefined,
1086
- requiredScopes: [ 'files:write' ]
1087
- hasDelegation: true
1088
- }
1089
-
1090
- }
1091
-
1092
- 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
1093
- [MCP-I] 🔐 Verifying delegation token with AccessControlApiService {
1094
- tool: 'protectedTool',
1095
- stderr | src/__tests__/runtime/tool-protection-enforcement.test.ts > MCPIRuntimeBase - Tool Protection Enforcement > processToolCall with tool protection > should block tool execution when delegation has wrong scopes
1096
- agentDid: 'did:key:zmock123...',
1097
- hasDelegationToken: true,
1098
- [MCP-I] ❌ Delegation verification FAILED {
1099
- hasConsentProof: false,
1100
- requiredScopes: [ 'files:write' ]
1101
- }
1102
-
1103
- 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
1104
- tool: 'protectedTool',
1105
- [MCP-I] ✅ Delegation verification SUCCEEDED {
1106
- tool: 'protectedTool',
1107
- agentDid: 'did:key:zmock123...',
1108
- delegationId: 'test-delegation-id',
1109
- agentDid: 'did:key:zmock123...',
1110
- reason: 'Insufficient scopes',
1111
- credentialScopes: [ 'files:write' ],
1112
- requiredScopes: [ 'files:write' ]
1113
- }
1114
-
1115
- errorCode: undefined,
1116
- 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
1117
- errorMessage: undefined,
1118
- requiredScopes: [ 'files:write' ]
1119
- [MCP-I] Checking tool protection: {
1120
- tool: 'protectedTool',
1121
- }
1122
-
1123
- agentDid: 'did:key:zmock123...',
1124
- hasDelegation: true
1125
- }
1126
- stderr | src/__tests__/runtime/tool-protection-enforcement.test.ts > MCPIRuntimeBase - Tool Protection Enforcement > processToolCall with tool protection > should handle API errors during verification gracefully
1127
-
1128
- [MCP-I] ❌ Delegation verification error (API failure) {
1129
- 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
1130
- [MCP-I] 🔐 Verifying delegation token with AccessControlApiService {
1131
- tool: 'protectedTool',
1132
- tool: 'protectedTool',
1133
- agentDid: 'did:key:zmock123...',
1134
- hasDelegationToken: false,
1135
- hasConsentProof: true,
1136
- requiredScopes: [ 'files:write' ]
1137
- }
1138
-
1139
- agentDid: 'did:key:zmock123...',
1140
- 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
1141
- [MCP-I] ✅ Delegation verification SUCCEEDED {
1142
- tool: 'protectedTool',
1143
- agentDid: 'did:key:zmock123...',
1144
- delegationId: 'test-delegation-id',
1145
- credentialScopes: [ 'files:write' ],
1146
- requiredScopes: [ 'files:write' ]
1147
- errorCode: 'network_error',
1148
- }
1149
-
1150
- 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
1151
- [MCP-I] Checking tool protection: {
1152
- tool: 'protectedTool',
1153
- agentDid: 'did:key:zmock123...',
1154
- hasDelegation: true
1155
- }
1156
-
1157
- 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
1158
- errorMessage: 'API unavailable',
1159
- [MCP-I] 🔐 Verifying delegation token with AccessControlApiService {
1160
- errorDetails: {}
1161
- tool: 'protectedTool',
1162
- agentDid: 'did:key:zmock123...',
1163
- hasDelegationToken: true,
1164
- hasConsentProof: false,
1165
- requiredScopes: [ 'files:write' ]
1166
- }
1167
-
1168
- }
1169
- stderr | src/__tests__/runtime/tool-protection-enforcement.test.ts > MCPIRuntimeBase - Tool Protection Enforcement > processToolCall with tool protection > should allow tool execution when access control service not configured (graceful degradation)
1170
-
1171
- [MCP-I] ⚠️ Delegation token provided but AccessControlApiService not configured - skipping verification {
1172
- tool: 'protectedTool',
1173
- 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
1174
- agentDid: 'did:key:zmock123...',
1175
- [MCP-I] Checking tool protection: {
1176
- tool: 'protectedTool',
1177
- hasDelegationToken: true,
1178
- agentDid: 'did:key:zmock123...',
1179
- hasDelegation: true
1180
- }
1181
- hasConsentProof: false
1182
-
1183
- 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
1184
- [MCP-I] 🔐 Verifying delegation token with AccessControlApiService {
1185
- }
1186
- tool: 'protectedTool',
1187
- agentDid: 'did:key:zmock123...',
1188
- hasDelegationToken: true,
1189
-
1190
- stderr | src/__tests__/runtime/tool-protection-enforcement.test.ts > MCPIRuntimeBase - Tool Protection Enforcement > processToolCall with tool protection > user_identifier validation > should reject delegation when user_identifier does not match session userDid
1191
- hasConsentProof: false,
1192
- requiredScopes: [ 'files:write' ]
1193
- [MCP-I] 🔒 SECURITY: User identifier validation FAILED {
1194
- }
1195
- tool: 'protectedTool',
1196
- agentDid: 'did:key:zmock123...',
1197
-
1198
- stdout | src/__tests__/runtime/tool-protection-enforcement.test.ts > MCPIRuntimeBase - Tool Protection Enforcement > processToolCall with tool protection > should handle API errors during verification gracefully
1199
- delegationUserIdentifier: 'did:key:zUserB987654...',
1200
- [MCP-I] Checking tool protection: {
1201
- tool: 'protectedTool',
1202
- agentDid: 'did:key:zmock123...',
1203
- sessionUserDid: 'did:key:zUserA123456...',
1204
- hasDelegation: true
1205
- }
1206
- sessionId: 'session123...',
1207
-
1208
- stdout | src/__tests__/runtime/tool-protection-enforcement.test.ts > MCPIRuntimeBase - Tool Protection Enforcement > processToolCall with tool protection > should handle API errors during verification gracefully
1209
- reason: 'user_identifier_mismatch',
1210
- severity: 'high'
1211
- }
1212
- [MCP-I] 🔐 Verifying delegation token with AccessControlApiService {
1213
- tool: 'protectedTool',
1214
- agentDid: 'did:key:zmock123...',
1215
-
1216
- hasDelegationToken: true,
1217
- stderr | src/__tests__/runtime/tool-protection-enforcement.test.ts > MCPIRuntimeBase - Tool Protection Enforcement > processToolCall with tool protection > user_identifier validation > should handle missing session userDid gracefully
1218
- hasConsentProof: false,
1219
- requiredScopes: [ 'files:write' ]
1220
- }
1221
-
1222
- [MCP-I] ⚠️ Delegation has user_identifier but session missing userDid {
1223
- stdout | src/__tests__/runtime/tool-protection-enforcement.test.ts > MCPIRuntimeBase - Tool Protection Enforcement > processToolCall with tool protection > should allow tool execution when access control service not configured (graceful degradation)
1224
- [MCP-I] Checking tool protection: {
1225
- tool: 'protectedTool',
1226
- agentDid: 'did:key:zmock123...',
1227
- tool: 'protectedTool',
1228
- hasDelegation: true
1229
- }
1230
- agentDid: 'did:key:zmock123...',
1231
- delegationUserIdentifier: 'did:key:zUserA123456...',
1232
-
1233
- 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
1234
- sessionId: 'session123...'
1235
- [MCP-I] Checking tool protection: {
1236
- tool: 'protectedTool',
1237
- agentDid: 'did:key:zmock123...',
1238
- }
1239
-
1240
- hasDelegation: true
1241
- }
1242
-
1243
- stderr | src/__tests__/runtime/tool-protection-enforcement.test.ts > MCPIRuntimeBase - Tool Protection Enforcement > processToolCall with tool protection > should not create proof when tool execution is blocked
1244
- 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
1245
- [MCP-I] 🔐 Verifying delegation token with AccessControlApiService {
1246
- [MCP-I] BLOCKED: Tool requires delegation but none provided {
1247
- tool: 'protectedTool',
1248
- agentDid: 'did:key:zmock123...',
1249
- hasDelegationToken: true,
1250
- hasConsentProof: false,
1251
- requiredScopes: [ 'files:write' ]
1252
- tool: 'protectedTool',
1253
- requiredScopes: [ 'files:write' ],
1254
- agentDid: 'did:key:zmock123...',
1255
- }
1256
-
1257
- resumeToken: 'resume_bx55g1_miqquppo',
1258
- 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
1259
- [MCP-I] Checking tool protection: {
1260
- tool: 'protectedTool',
1261
- agentDid: 'did:key:zmock123...',
1262
- consentUrl: 'https://kya.vouched.id/bouncer/consent?tool=protectedTool&scopes=files%3Awrite&session_id=session123&agent_did=&resume_token=resume_bx55g1_miqquppo'
1263
- hasDelegation: true
1264
- }
1265
-
1266
- }
1267
- 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
1268
- [MCP-I] 🔐 Verifying delegation token with AccessControlApiService {
1269
- tool: 'protectedTool',
1270
- agentDid: 'did:key:zmock123...',
1271
-
1272
- hasDelegationToken: true,
1273
- hasConsentProof: false,
1274
- requiredScopes: [ 'files:write' ]
1275
- }
1276
-
1277
- 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
1278
- stderr | src/__tests__/runtime/tool-protection-enforcement.test.ts > MCPIRuntimeBase - Tool Protection Enforcement > DelegationRequiredError details > should include tool name in error
1279
- [MCP-I] BLOCKED: Tool requires delegation but none provided {
1280
- tool: 'protectedTool',
1281
- [MCP-I] ✅ User identifier validation PASSED {
1282
- tool: 'protectedTool',
1283
- agentDid: 'did:key:zmock123...',
1284
- requiredScopes: [ 'files:write' ],
1285
- agentDid: 'did:key:zmock123...',
1286
- userDid: 'did:key:zUserA123456...',
1287
- sessionId: 'session123...'
1288
- }
1289
- [MCP-I] ✅ Delegation verification SUCCEEDED {
1290
- tool: 'protectedTool',
1291
- resumeToken: 'resume_bx55g1_miqquppo',
1292
- consentUrl: 'https://kya.vouched.id/bouncer/consent?tool=protectedTool&scopes=files%3Awrite&session_id=session123&agent_did=&resume_token=resume_bx55g1_miqquppo'
1293
- }
1294
-
1295
- agentDid: 'did:key:zmock123...',
1296
- delegationId: 'test-delegation-id',
1297
- stderr | src/__tests__/runtime/tool-protection-enforcement.test.ts > MCPIRuntimeBase - Tool Protection Enforcement > DelegationRequiredError details > should include required scopes in error
1298
- [MCP-I] BLOCKED: Tool requires delegation but none provided {
1299
- credentialScopes: [ 'files:write' ],
1300
- requiredScopes: [ 'files:write' ]
1301
- tool: 'protectedTool',
1302
- }
1303
- requiredScopes: [ 'files:write', 'files:read' ],
1304
- agentDid: 'did:key:zmock123...',
1305
- resumeToken: 'resume_bx55g1_miqquppo',
1306
- consentUrl: 'https://kya.vouched.id/bouncer/consent?tool=protectedTool&scopes=files%3Awrite%2Cfiles%3Aread&session_id=session123&agent_did=&resume_token=resume_bx55g1_miqquppo'
1307
-
1308
- 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)
1309
- [MCP-I] Checking tool protection: {
1310
- }
1311
- tool: 'protectedTool',
1312
- agentDid: 'did:key:zmock123...',
1313
-
1314
- stderr | src/__tests__/runtime/tool-protection-enforcement.test.ts > MCPIRuntimeBase - Tool Protection Enforcement > DelegationRequiredError details > should include consent URL in error
1315
- hasDelegation: true
1316
- [MCP-I] BLOCKED: Tool requires delegation but none provided {
1317
- tool: 'protectedTool',
1318
- }
1319
-
1320
- 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)
1321
- requiredScopes: [ 'files:write' ],
1322
- [MCP-I] 🔐 Verifying delegation token with AccessControlApiService {
1323
- tool: 'protectedTool',
1324
- agentDid: 'did:key:zmock123...',
1325
- agentDid: 'did:key:zmock123...',
1326
- hasDelegationToken: true,
1327
- hasConsentProof: false,
1328
- requiredScopes: [ 'files:write' ]
1329
- resumeToken: 'resume_bx55g1_miqquppo',
1330
- }
1331
- consentUrl: 'https://kya.vouched.id/bouncer/consent?tool=protectedTool&scopes=files%3Awrite&session_id=session123&agent_did=&resume_token=resume_bx55g1_miqquppo'
1332
- }
1333
-
1334
-
1335
- stderr | src/__tests__/runtime/tool-protection-enforcement.test.ts > MCPIRuntimeBase - Tool Protection Enforcement > DelegationRequiredError details > should include resume token in error
1336
- 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)
1337
- [MCP-I] ✅ Delegation verification SUCCEEDED {
1338
- [MCP-I] BLOCKED: Tool requires delegation but none provided {
1339
- tool: 'protectedTool',
1340
- tool: 'protectedTool',
1341
- agentDid: 'did:key:zmock123...',
1342
- requiredScopes: [ 'files:write' ],
1343
- delegationId: 'test-delegation-id',
1344
- credentialScopes: [ 'files:write' ],
1345
- agentDid: 'did:key:zmock123...',
1346
- resumeToken: 'resume_bx55g1_miqquppp',
1347
- consentUrl: 'https://kya.vouched.id/bouncer/consent?tool=protectedTool&scopes=files%3Awrite&session_id=session123&agent_did=&resume_token=resume_bx55g1_miqquppp'
1348
- }
1349
- requiredScopes: [ 'files:write' ]
1350
- }
1351
-
1352
-
1353
- stderr | src/__tests__/runtime/tool-protection-enforcement.test.ts > MCPIRuntimeBase - Tool Protection Enforcement > DelegationRequiredError details > should include intercepted call context in error
1354
- 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
1355
- [MCP-I] BLOCKED: Tool requires delegation but none provided {
1356
- [MCP-I] Checking tool protection: {
1357
- tool: 'protectedTool',
1358
- agentDid: 'did:key:zmock123...',
1359
- hasDelegation: true
1360
- }
1361
- tool: 'protectedTool',
1362
-
1363
- 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
1364
- requiredScopes: [ 'files:write' ],
1365
- [MCP-I] 🔐 Verifying delegation token with AccessControlApiService {
1366
- agentDid: 'did:key:zmock123...',
1367
- tool: 'protectedTool',
1368
- agentDid: 'did:key:zmock123...',
1369
- hasDelegationToken: true,
1370
- hasConsentProof: false,
1371
- requiredScopes: [ 'files:write' ]
1372
- }
1373
-
1374
- 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
1375
- [MCP-I] ✅ Delegation verification SUCCEEDED {
1376
- tool: 'protectedTool',
1377
- agentDid: 'did:key:zmock123...',
1378
- delegationId: 'test-delegation-id',
1379
- credentialScopes: [ 'files:write' ],
1380
- requiredScopes: [ 'files:write' ]
1381
- resumeToken: 'resume_49l1t5_miqquppp',
1382
- }
1383
-
1384
- stdout | src/__tests__/runtime/tool-protection-enforcement.test.ts > MCPIRuntimeBase - Tool Protection Enforcement > processToolCall with tool protection > should create proof after successful tool execution
1385
- [MCP-I] Checking tool protection: {
1386
- tool: 'unprotectedTool',
1387
- consentUrl: 'https://kya.vouched.id/bouncer/consent?tool=protectedTool&scopes=files%3Awrite&session_id=session123&agent_did=&resume_token=resume_49l1t5_miqquppp'
1388
- agentDid: 'did:key:zmock123...',
1389
- hasDelegation: false
1390
- }
1391
-
1392
- stdout | src/__tests__/runtime/tool-protection-enforcement.test.ts > MCPIRuntimeBase - Tool Protection Enforcement > processToolCall with tool protection > should create proof after successful tool execution
1393
- }
1394
- [MCP-I] Tool protection check passed (no delegation required) {
1395
- tool: 'unprotectedTool',
1396
- agentDid: 'did:key:zmock123...',
1397
- reason: 'Tool not configured to require delegation'
1398
- }
1399
-
1400
-
1401
- stderr | src/__tests__/runtime/tool-protection-enforcement.test.ts > MCPIRuntimeBase - Tool Protection Enforcement > edge cases > should handle empty required scopes array
1402
- 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
1403
- [MCP-I] Checking tool protection: {
1404
- tool: 'protectedTool',
1405
- [MCP-I] BLOCKED: Tool requires delegation but none provided {
1406
- agentDid: 'did:key:zmock123...',
1407
- hasDelegation: false
1408
- tool: 'protectedTool',
1409
- }
1410
- requiredScopes: [],
1411
- agentDid: 'did:key:zmock123...',
1412
-
1413
- stdout | src/__tests__/runtime/tool-protection-enforcement.test.ts > MCPIRuntimeBase - Tool Protection Enforcement > DelegationRequiredError details > should include tool name in error
1414
- resumeToken: 'resume_bx55eb_miqquppq',
1415
- [MCP-I] Checking tool protection: {
1416
- tool: 'protectedTool',
1417
- agentDid: 'did:key:zmock123...',
1418
- consentUrl: 'https://kya.vouched.id/bouncer/consent?tool=protectedTool&scopes=&session_id=session123&agent_did=&resume_token=resume_bx55eb_miqquppq'
1419
- }
1420
- hasDelegation: false
1421
-
1422
- }
1423
-
1424
- stderr | src/__tests__/runtime/tool-protection-enforcement.test.ts > MCPIRuntimeBase - Tool Protection Enforcement > edge cases > should handle multiple required scopes
1425
- stdout | src/__tests__/runtime/tool-protection-enforcement.test.ts > MCPIRuntimeBase - Tool Protection Enforcement > DelegationRequiredError details > should include required scopes in error
1426
- [MCP-I] Checking tool protection: {
1427
- tool: 'protectedTool',
1428
- agentDid: 'did:key:zmock123...',
1429
- hasDelegation: false
1430
- }
1431
- [MCP-I] BLOCKED: Tool requires delegation but none provided {
1432
- tool: 'protectedTool',
1433
-
1434
- stdout | src/__tests__/runtime/tool-protection-enforcement.test.ts > MCPIRuntimeBase - Tool Protection Enforcement > DelegationRequiredError details > should include consent URL in error
1435
- [MCP-I] Checking tool protection: {
1436
- tool: 'protectedTool',
1437
- agentDid: 'did:key:zmock123...',
1438
- hasDelegation: false
1439
- }
1440
-
1441
- requiredScopes: [ 'scope1', 'scope2', 'scope3' ],
1442
- stdout | src/__tests__/runtime/tool-protection-enforcement.test.ts > MCPIRuntimeBase - Tool Protection Enforcement > DelegationRequiredError details > should include resume token in error
1443
- [MCP-I] Checking tool protection: {
1444
- tool: 'protectedTool',
1445
- agentDid: 'did:key:zmock123...',
1446
- resumeToken: 'resume_bx55eb_miqquppq',
1447
- consentUrl: 'https://kya.vouched.id/bouncer/consent?tool=protectedTool&scopes=scope1%2Cscope2%2Cscope3&session_id=session123&agent_did=&resume_token=resume_bx55eb_miqquppq'
1448
- agentDid: 'did:key:zmock123...',
1449
- hasDelegation: false
1450
- }
1451
- }
1452
-
1453
- stderr | src/__tests__/runtime/tool-protection-enforcement.test.ts > MCPIRuntimeBase - Tool Protection Enforcement > edge cases > should handle session without id
1454
-
1455
- stdout | src/__tests__/runtime/tool-protection-enforcement.test.ts > MCPIRuntimeBase - Tool Protection Enforcement > DelegationRequiredError details > should include intercepted call context in error
1456
- [MCP-I] Checking tool protection: {
1457
- tool: 'protectedTool',
1458
- [MCP-I] BLOCKED: Tool requires delegation but none provided {
1459
- agentDid: 'did:key:zmock123...',
1460
- hasDelegation: false
1461
- }
1462
-
1463
- tool: 'protectedTool',
1464
- stdout | src/__tests__/runtime/tool-protection-enforcement.test.ts > MCPIRuntimeBase - Tool Protection Enforcement > audit logging > should log tool protection check when audit enabled
1465
- requiredScopes: [ 'files:write' ],
1466
- [MCP-I] Checking tool protection: {
1467
- agentDid: 'did:key:zmock123...',
1468
- tool: 'testTool',
1469
- agentDid: 'did:key:zmock123...',
1470
- resumeToken: 'resume_14wv0f_miqquppq',
1471
- hasDelegation: false
1472
- consentUrl: 'https://kya.vouched.id/bouncer/consent?tool=protectedTool&scopes=files%3Awrite&session_id=&agent_did=&resume_token=resume_14wv0f_miqquppq'
1473
- }
1474
- }
1475
-
1476
- stdout | src/__tests__/runtime/tool-protection-enforcement.test.ts > MCPIRuntimeBase - Tool Protection Enforcement > audit logging > should log tool protection check when audit enabled
1477
- [MCP-I] Tool protection check passed (no delegation required) {
1478
- tool: 'testTool',
1479
- agentDid: 'did:key:zmock123...',
1480
- reason: 'Tool not configured to require delegation'
1481
-
1482
- }
1483
- stderr | src/__tests__/integration/full-flow.test.ts > Full Flow Integration > AgentShield integration flow > should use fallback config when API fails
1484
- [ToolProtectionService] API fetch failed, using fallback config { agentDid: 'did:key:z6MkhaXgBZDv...', error: 'Network error' }
1485
-
1486
- stdout | src/__tests__/runtime/tool-protection-enforcement.test.ts > MCPIRuntimeBase - Tool Protection Enforcement > audit logging > should log blocked tool call when audit enabled
1487
- [MCP-I] Checking tool protection: {
1488
- tool: 'protectedTool',
1489
-
1490
- agentDid: 'did:key:zmock123...',
1491
- hasDelegation: false
1492
- }
1493
-
1494
- stderr | src/__tests__/integration/full-flow.test.ts > Full Flow Integration > Error handling in full flow > should handle tool protection service errors gracefully
1495
- 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
1496
- [MCP-I] Checking tool protection: {
1497
- tool: 'testTool',
1498
- agentDid: 'did:key:zmock123...',
1499
- [ToolProtectionService] API fetch failed, no fallback, failing closed (deny-all) {
1500
- hasDelegation: false
1501
- agentDid: 'did:key:z6MkhaXgBZDv...',
1502
- }
1503
- error: 'Network error',
1504
- cacheKey: 'config:tool-protections:test-project'
1505
-
1506
- 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
1507
- [MCP-I] Tool protection check passed (no delegation required) {
1508
- tool: 'testTool',
1509
- agentDid: 'did:key:zmock123...',
1510
- reason: 'Tool not configured to require delegation'
1511
- }
1512
-
1513
- stdout | src/__tests__/runtime/tool-protection-enforcement.test.ts > MCPIRuntimeBase - Tool Protection Enforcement > tool protection service integration > should handle tool protection service errors gracefully
1514
- [MCP-I] Checking tool protection: {
1515
- tool: 'testTool',
1516
- }
1517
-
1518
- stderr | src/__tests__/integration/full-flow.test.ts > Full Flow Integration > Error handling in full flow > should handle network timeouts
1519
- [ToolProtectionService] API fetch failed, using fallback config { agentDid: 'did:key:z6MkhaXgBZDv...', error: 'Network timeout' }
1520
-
1521
- agentDid: 'did:key:zmock123...',
1522
- hasDelegation: false
1523
- stderr | src/services/__tests__/access-control.integration.test.ts > AccessControlApiService Integration > Proof Submission Flow > should submit proof end-to-end
1524
- }
1525
-
1526
- stdout | src/__tests__/runtime/tool-protection-enforcement.test.ts > MCPIRuntimeBase - Tool Protection Enforcement > edge cases > should handle empty required scopes array
1527
- [MCP-I] Checking tool protection: {
1528
- tool: 'protectedTool',
1529
- [AccessControl] 🔍 RAW API RESPONSE (before parsing): {
1530
- correlationId: '00db17b8-fc23-47b8-9e6c-109b226b7a8e',
1531
- agentDid: 'did:key:zmock123...',
1532
- hasDelegation: false
1533
- }
1534
-
1535
- stdout | src/__tests__/runtime/tool-protection-enforcement.test.ts > MCPIRuntimeBase - Tool Protection Enforcement > edge cases > should handle multiple required scopes
1536
- [MCP-I] Checking tool protection: {
1537
- tool: 'protectedTool',
1538
- status: 200,
1539
- statusText: '',
1540
- agentDid: 'did:key:zmock123...',
1541
- hasDelegation: false
1542
- }
1543
-
1544
- headers: { 'content-type': 'application/json' },
1545
- stdout | src/__tests__/runtime/tool-protection-enforcement.test.ts > MCPIRuntimeBase - Tool Protection Enforcement > edge cases > should handle session without id
1546
- [MCP-I] Checking tool protection: {
1547
- tool: 'protectedTool',
1548
- responseTextLength: 100,
1549
- responseTextPreview: '{"success":true,"accepted":1,"rejected":0,"outcomes":{"success":1,"failed":0,"blocked":0,"error":0}}',
1550
- fullResponseText: '{"success":true,"accepted":1,"rejected":0,"outcomes":{"success":1,"failed":0,"blocked":0,"error":0}}'
1551
- agentDid: 'did:key:zmock123...',
1552
- hasDelegation: false
1553
- }
1554
- }
1555
-
1556
- [AccessControl] 🔍 PARSED RESPONSE DATA: {
1557
- correlationId: '00db17b8-fc23-47b8-9e6c-109b226b7a8e',
1558
- stdout | src/__tests__/runtime/tool-protection-enforcement.test.ts > MCPIRuntimeBase - Tool Protection Enforcement > edge cases > should handle handler errors independently of protection
1559
- [MCP-I] Checking tool protection: {
1560
- tool: 'errorTool',
1561
- agentDid: 'did:key:zmock123...',
1562
- hasDelegation: false
1563
- status: 200,
1564
- }
1565
- responseDataType: 'object',
1566
-
1567
- stdout | src/__tests__/runtime/tool-protection-enforcement.test.ts > MCPIRuntimeBase - Tool Protection Enforcement > edge cases > should handle handler errors independently of protection
1568
- [MCP-I] Tool protection check passed (no delegation required) {
1569
- tool: 'errorTool',
1570
- responseDataKeys: [ 'success', 'accepted', 'rejected', 'outcomes' ],
1571
- agentDid: 'did:key:zmock123...',
1572
- reason: 'Tool not configured to require delegation'
1573
- responseData: '{\n' +
1574
- }
1575
-
1576
- ' "success": true,\n' +
1577
- stdout | src/__tests__/integration/full-flow.test.ts > Full Flow Integration > Tool protection enforcement flow > should allow unprotected tool calls
1578
- [ToolProtectionService] Config loaded from API {
1579
- source: 'api',
1580
- ' "accepted": 1,\n' +
1581
- ' "rejected": 0,\n' +
1582
- toolCount: 1,
1583
- protectedTools: [],
1584
- agentDid: 'did:key:z6MkhaXgBZDv...',
1585
- projectId: 'test-project',
1586
- cacheTtlMs: 300000,
1587
- cacheExpiresAt: '2025-12-04T01:20:15.764Z'
1588
- }
1589
- ' "outcomes": {\n' +
1590
- ' "success": 1,\n' +
1591
-
1592
- ' "failed": 0,\n' +
1593
- stdout | src/__tests__/integration/full-flow.test.ts > Full Flow Integration > Tool protection enforcement flow > should intercept protected tool calls without delegation
1594
- [ToolProtectionService] Config loaded from API {
1595
- ' "blocked": 0,\n' +
1596
- source: 'api',
1597
- toolCount: 1,
1598
- protectedTools: [ 'checkout' ],
1599
- ' "error": 0\n' +
1600
- agentDid: 'did:key:z6MkhaXgBZDv...',
1601
- ' }\n' +
1602
- projectId: 'test-project',
1603
- '}'
1604
- cacheTtlMs: 300000,
1605
- cacheExpiresAt: '2025-12-04T01:20:15.764Z'
1606
- }
1607
-
1608
- stdout | src/__tests__/integration/full-flow.test.ts > Full Flow Integration > Tool protection enforcement flow > should intercept protected tool calls without delegation
1609
- [ToolProtectionService] Protection check {
1610
- tool: 'checkout',
1611
- agentDid: 'did:key:z6MkhaXgBZDv...',
1612
- }
1613
- found: true,
1614
- isWildcard: false,
1615
- [AccessControl] Raw response received: {
1616
- requiresDelegation: true,
1617
- "success": true,
1618
- availableTools: [ 'checkout' ]
1619
- "accepted": 1,
1620
- "rejected": 0,
1621
- "outcomes": {
1622
- "success": 1,
1623
- "failed": 0,
1624
- }
1625
-
1626
- stdout | src/__tests__/integration/full-flow.test.ts > Full Flow Integration > AgentShield integration flow > should fetch tool protection config from AgentShield merged config
1627
- [ToolProtectionService] Config loaded from API {
1628
- source: 'api',
1629
- toolCount: 1,
1630
- protectedTools: [ 'protected_tool' ],
1631
- agentDid: 'did:key:z6MkhaXgBZDv...',
1632
- projectId: 'test-project',
1633
- cacheTtlMs: 300000,
1634
- cacheExpiresAt: '2025-12-04T01:20:15.765Z'
1635
- }
1636
-
1637
- stdout | src/__tests__/integration/full-flow.test.ts > Full Flow Integration > AgentShield integration flow > should cache tool protection config
1638
- [ToolProtectionService] Config loaded from API {
1639
- source: 'api',
1640
- "blocked": 0,
1641
- "error": 0
1642
- }
1643
- toolCount: 1,
1644
- }
1645
- protectedTools: [ 'tool1' ],
1646
- agentDid: 'did:key:z6MkhaXgBZDv...',
1647
- projectId: 'test-project',
1648
-
1649
- cacheTtlMs: 300000,
1650
- cacheExpiresAt: '2025-12-04T01:20:15.766Z'
1651
- }
1652
-
1653
- stdout | src/__tests__/integration/full-flow.test.ts > Full Flow Integration > Cache integration in full flow > should share cache across multiple service instances
1654
- stderr | src/services/__tests__/access-control.integration.test.ts > AccessControlApiService Integration > Proof Submission Flow > should handle proof submission with errors
1655
- [ToolProtectionService] Config loaded from API {
1656
- [AccessControl] 🔍 RAW API RESPONSE (before parsing): {
1657
- source: 'api',
1658
- correlationId: '7d4ba585-b06f-4d8e-ab41-6a4bd33bc598',
1659
- toolCount: 1,
1660
- protectedTools: [ 'tool1' ],
1661
- status: 200,
1662
- agentDid: 'did:key:z6MkhaXgBZDv...',
1663
- projectId: 'test-project',
1664
- cacheTtlMs: 300000,
1665
- cacheExpiresAt: '2025-12-04T01:20:15.768Z'
1666
- }
1667
- statusText: '',
1668
- headers: { 'content-type': 'application/json' },
1669
- responseTextLength: 200,
1670
-
1671
- 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"}}]}',
1672
- stdout | src/__tests__/integration/full-flow.test.ts > Full Flow Integration > Cache integration in full flow > should clear cache when needed
1673
- [ToolProtectionService] Config loaded from API {
1674
- 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"}}]}'
1675
- source: 'api',
1676
- toolCount: 1,
1677
- protectedTools: [ 'tool1' ],
1678
- agentDid: 'did:key:z6MkhaXgBZDv...',
1679
- projectId: 'test-project',
1680
- }
1681
- cacheTtlMs: 300000,
1682
- cacheExpiresAt: '2025-12-04T01:20:15.768Z'
1683
- }
1684
- [AccessControl] 🔍 PARSED RESPONSE DATA: {
1685
-
1686
- stdout | src/__tests__/integration/full-flow.test.ts > Full Flow Integration > Cache integration in full flow > should clear cache when needed
1687
- [ToolProtectionService] Config loaded from API {
1688
- source: 'api',
1689
- correlationId: '7d4ba585-b06f-4d8e-ab41-6a4bd33bc598',
1690
- toolCount: 1,
1691
- protectedTools: [ 'tool1' ],
1692
- agentDid: 'did:key:z6MkhaXgBZDv...',
1693
- projectId: 'test-project',
1694
- cacheTtlMs: 300000,
1695
- cacheExpiresAt: '2025-12-04T01:20:15.768Z'
1696
- status: 200,
1697
- responseDataType: 'object',
1698
- }
1699
-
1700
- 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
1701
- responseDataKeys: [ 'success', 'accepted', 'rejected', 'outcomes', 'errors' ],
1702
- [ToolProtectionService] Config loaded from API {
1703
- responseData: '{\n' +
1704
- ' "success": true,\n' +
1705
- source: 'api',
1706
- toolCount: 3,
1707
- ' "accepted": 0,\n' +
1708
- protectedTools: [ 'add_to_cart', 'checkout' ],
1709
- ' "rejected": 1,\n' +
1710
- agentDid: 'did:key:z6MkhaXgBZDv...',
1711
- ' "outcomes": {\n' +
1712
- ' "success": 0,\n' +
1713
- ' "failed": 1,\n' +
1714
- projectId: 'test-project',
1715
- cacheTtlMs: 300000,
1716
- cacheExpiresAt: '2025-12-04T01:20:15.769Z'
1717
- ' "blocked": 0,\n' +
1718
- }
1719
-
1720
- 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
1721
- [ToolProtectionService] Protection check {
1722
- ' "error": 0\n' +
1723
- tool: 'add_to_cart',
1724
- ' },\n' +
1725
- agentDid: 'did:key:z6MkhaXgBZDv...',
1726
- found: true,
1727
- ' "errors": [\n' +
1728
- ' {\n' +
1729
- isWildcard: false,
1730
- requiresDelegation: true,
1731
- availableTools: [ 'search_products', 'add_to_cart', 'checkout' ]
1732
- ' "proof_index": 0,\n' +
1733
- ' "error": {\n' +
1734
- }
1735
- ' "code": "invalid_signature",\n' +
1736
-
1737
- stdout | src/__tests__/integration/full-flow.test.ts > Full Flow Integration > Concurrent operations > should handle concurrent cache operations
1738
- [ToolProtectionService] Config loaded from API {
1739
- ' "message": "Invalid JWS signature"\n' +
1740
- ' }\n' +
1741
- ' }\n' +
1742
- source: 'api',
1743
- ' ]\n' +
1744
- toolCount: 1,
1745
- protectedTools: [ 'tool1' ],
1746
- agentDid: 'did:key:z6MkhaXgBZDv...',
1747
- projectId: 'test-project',
1748
- '}'
1749
- }
1750
- cacheTtlMs: 300000,
1751
- cacheExpiresAt: '2025-12-04T01:20:15.769Z'
1752
- }
1753
- [ToolProtectionService] Config loaded from API {
1754
- [AccessControl] Raw response received: {
1755
- source: 'api',
1756
- toolCount: 1,
1757
- protectedTools: [ 'tool1' ],
1758
- agentDid: 'did:key:z6MkhaXgBZDv...',
1759
- projectId: 'test-project',
1760
- "success": true,
1761
- cacheTtlMs: 300000,
1762
- "accepted": 0,
1763
- cacheExpiresAt: '2025-12-04T01:20:15.769Z'
1764
- }
1765
- [ToolProtectionService] Config loaded from API {
1766
- source: 'api',
1767
- toolCount: 1,
1768
- "rejected": 1,
1769
- protectedTools: [ 'tool1' ],
1770
- agentDid: 'did:key:z6MkhaXgBZDv...',
1771
- "outcomes": {
1772
- projectId: 'test-project',
1773
- "success": 0,
1774
- cacheTtlMs: 300000,
1775
- cacheExpiresAt: '2025-12-04T01:20:15.769Z'
1776
- }
1777
- "failed": 1,
1778
- "blocked": 0,
1779
- "error": 0
1780
- },
1781
- "errors": [
1782
-
1783
- {
1784
- "proof_index": 0,
1785
- "error": {
1786
- "code": "invalid_signature",
1787
- "message": "Invalid JWS signature"
1788
- }
1789
- }
1790
- ]
1791
- }
1792
-
1793
- stderr | src/services/__tests__/access-control.integration.test.ts > AccessControlApiService Integration > Proof Verification Flow > should verify proof using ProofVerifier
1794
- [CryptoService] Key ID mismatch
1795
-
1796
- ✓ src/__tests__/integration/full-flow.test.ts (21 tests) 23ms
1797
- ✓ src/__tests__/runtime/tool-protection-enforcement.test.ts (29 tests) 13ms
1798
- stderr | src/services/__tests__/proof-verifier.integration.test.ts > ProofVerifier Integration - Real DID Resolution > did:web Resolution (HTTP) > should handle HTTP errors gracefully
1799
- [ProofVerifier] Failed to fetch public key from DID: Error: Failed to resolve did:web:nonexistent-domain-that-does-not-exist-12345.com: fetch failed
1800
- at Object.resolveDID (/Users/dylanhobbs/Documents/@kya-os/xmcp-i/packages/mcp-i-core/src/services/__tests__/proof-verifier.integration.test.ts:143:19)
1801
- at processTicksAndRejections (node:internal/process/task_queues:103:5)
1802
- at ProofVerifier.fetchPublicKeyFromDID (/Users/dylanhobbs/Documents/@kya-os/xmcp-i/packages/mcp-i-core/src/services/proof-verifier.ts:348:22)
1803
- at /Users/dylanhobbs/Documents/@kya-os/xmcp-i/packages/mcp-i-core/src/services/__tests__/proof-verifier.integration.test.ts:252:7
1804
- at file:///Users/dylanhobbs/Documents/@kya-os/xmcp-i/node_modules/.pnpm/@vitest+runner@4.0.14/node_modules/@vitest/runner/dist/index.js:919:20
1805
-
1806
- stderr | src/services/__tests__/proof-verifier.integration.test.ts > ProofVerifier Integration - Real DID Resolution > did:web Resolution (HTTP) > should handle HTTP errors gracefully
1807
- [ProofVerifier] Failed to fetch public key from DID: Error: Failed to resolve did:web:nonexistent-domain-that-does-not-exist-12345.com: fetch failed
1808
- at Object.resolveDID (/Users/dylanhobbs/Documents/@kya-os/xmcp-i/packages/mcp-i-core/src/services/__tests__/proof-verifier.integration.test.ts:143:19)
1809
- at processTicksAndRejections (node:internal/process/task_queues:103:5)
1810
- at ProofVerifier.fetchPublicKeyFromDID (/Users/dylanhobbs/Documents/@kya-os/xmcp-i/packages/mcp-i-core/src/services/proof-verifier.ts:348:22)
1811
- at /Users/dylanhobbs/Documents/@kya-os/xmcp-i/packages/mcp-i-core/src/services/__tests__/proof-verifier.integration.test.ts:257:9
1812
- at file:///Users/dylanhobbs/Documents/@kya-os/xmcp-i/node_modules/.pnpm/@vitest+runner@4.0.14/node_modules/@vitest/runner/dist/index.js:919:20
1813
-
1814
- ✓ src/services/__tests__/proof-verifier.integration.test.ts (13 tests | 1 skipped) 147ms
1815
- ✓ src/services/__tests__/access-control.integration.test.ts (9 tests) 160ms
1816
- stderr | src/services/__tests__/crypto.service.test.ts > CryptoService > verifyEd25519 > should return false on verification error
1817
- [CryptoService] Ed25519 verification error: Error: Verification failed
1818
- at /Users/dylanhobbs/Documents/@kya-os/xmcp-i/packages/mcp-i-core/src/services/__tests__/crypto.service.test.ts:62:9
1819
- at file:///Users/dylanhobbs/Documents/@kya-os/xmcp-i/node_modules/.pnpm/@vitest+runner@4.0.14/node_modules/@vitest/runner/dist/index.js:145:11
1820
- at file:///Users/dylanhobbs/Documents/@kya-os/xmcp-i/node_modules/.pnpm/@vitest+runner@4.0.14/node_modules/@vitest/runner/dist/index.js:919:26
1821
- at file:///Users/dylanhobbs/Documents/@kya-os/xmcp-i/node_modules/.pnpm/@vitest+runner@4.0.14/node_modules/@vitest/runner/dist/index.js:1244:20
1822
- at new Promise (<anonymous>)
1823
- at runWithTimeout (file:///Users/dylanhobbs/Documents/@kya-os/xmcp-i/node_modules/.pnpm/@vitest+runner@4.0.14/node_modules/@vitest/runner/dist/index.js:1210:10)
1824
- at file:///Users/dylanhobbs/Documents/@kya-os/xmcp-i/node_modules/.pnpm/@vitest+runner@4.0.14/node_modules/@vitest/runner/dist/index.js:1654:37
1825
- at Traces.$ (file:///Users/dylanhobbs/Documents/@kya-os/xmcp-i/node_modules/.pnpm/vitest@4.0.14_@opentelemetry+api@1.9.0_@types+node@20.19.25_jiti@2.6.1_lightningcss@1.3_3f67c307998c5928f2f2aae3bf45ed95/node_modules/vitest/dist/chunks/traces.U4xDYhzZ.js:115:27)
1826
- at trace (file:///Users/dylanhobbs/Documents/@kya-os/xmcp-i/node_modules/.pnpm/vitest@4.0.14_@opentelemetry+api@1.9.0_@types+node@20.19.25_jiti@2.6.1_lightningcss@1.3_3f67c307998c5928f2f2aae3bf45ed95/node_modules/vitest/dist/chunks/test.DqQZzsWf.js:234:21)
1827
- at runTest (file:///Users/dylanhobbs/Documents/@kya-os/xmcp-i/node_modules/.pnpm/@vitest+runner@4.0.14/node_modules/@vitest/runner/dist/index.js:1654:12)
1828
-
1829
- stderr | src/services/__tests__/crypto.service.test.ts > CryptoService > verifyJWS > should reject invalid JWK format
1830
- [CryptoService] Invalid Ed25519 JWK format
1831
-
1832
- stderr | src/services/__tests__/crypto.service.test.ts > CryptoService > verifyJWS > should reject JWK with wrong kty
1833
- [CryptoService] Invalid Ed25519 JWK format
1834
-
1835
- stderr | src/services/__tests__/crypto.service.test.ts > CryptoService > verifyJWS > should reject JWK with wrong crv
1836
- [CryptoService] Invalid Ed25519 JWK format
1837
-
1838
- stderr | src/services/__tests__/crypto.service.test.ts > CryptoService > verifyJWS > should reject JWK with missing x field
1839
- [CryptoService] Invalid Ed25519 JWK format
1840
-
1841
- stderr | src/services/__tests__/crypto.service.test.ts > CryptoService > verifyJWS > should reject JWK with empty x field
1842
- [CryptoService] Invalid Ed25519 JWK format
1843
-
1844
- stderr | src/services/__tests__/crypto.service.test.ts > CryptoService > verifyJWS > should reject malformed JWS
1845
- [CryptoService] Invalid JWS format: Error: Invalid header base64: Unexpected token 'ž', "ž‹" is not valid JSON
1846
- at CryptoService.parseJWS (/Users/dylanhobbs/Documents/@kya-os/xmcp-i/packages/mcp-i-core/src/services/crypto.service.ts:91:13)
1847
- at CryptoService.verifyJWS (/Users/dylanhobbs/Documents/@kya-os/xmcp-i/packages/mcp-i-core/src/services/crypto.service.ts:169:23)
1848
- at /Users/dylanhobbs/Documents/@kya-os/xmcp-i/packages/mcp-i-core/src/services/__tests__/crypto.service.test.ts:230:42
1849
- at file:///Users/dylanhobbs/Documents/@kya-os/xmcp-i/node_modules/.pnpm/@vitest+runner@4.0.14/node_modules/@vitest/runner/dist/index.js:145:11
1850
- at file:///Users/dylanhobbs/Documents/@kya-os/xmcp-i/node_modules/.pnpm/@vitest+runner@4.0.14/node_modules/@vitest/runner/dist/index.js:919:26
1851
- at file:///Users/dylanhobbs/Documents/@kya-os/xmcp-i/node_modules/.pnpm/@vitest+runner@4.0.14/node_modules/@vitest/runner/dist/index.js:1244:20
1852
- at new Promise (<anonymous>)
1853
- at runWithTimeout (file:///Users/dylanhobbs/Documents/@kya-os/xmcp-i/node_modules/.pnpm/@vitest+runner@4.0.14/node_modules/@vitest/runner/dist/index.js:1210:10)
1854
- at file:///Users/dylanhobbs/Documents/@kya-os/xmcp-i/node_modules/.pnpm/@vitest+runner@4.0.14/node_modules/@vitest/runner/dist/index.js:1654:37
1855
- at Traces.$ (file:///Users/dylanhobbs/Documents/@kya-os/xmcp-i/node_modules/.pnpm/vitest@4.0.14_@opentelemetry+api@1.9.0_@types+node@20.19.25_jiti@2.6.1_lightningcss@1.3_3f67c307998c5928f2f2aae3bf45ed95/node_modules/vitest/dist/chunks/traces.U4xDYhzZ.js:115:27)
1856
-
1857
- stderr | src/services/__tests__/crypto.service.test.ts > CryptoService > verifyJWS > should reject non-EdDSA algorithms
1858
- [CryptoService] Unsupported algorithm: RS256, expected EdDSA
1859
-
1860
- stderr | src/services/__tests__/crypto.service.test.ts > CryptoService > verifyJWS > should reject HS256 algorithm
1861
- [CryptoService] Unsupported algorithm: HS256, expected EdDSA
1862
-
1863
- stderr | src/services/__tests__/crypto.service.test.ts > CryptoService > verifyJWS > should handle empty JWS components
1864
- [CryptoService] Invalid JWS format: Error: Invalid header base64: Unexpected end of JSON input
1865
- at CryptoService.parseJWS (/Users/dylanhobbs/Documents/@kya-os/xmcp-i/packages/mcp-i-core/src/services/crypto.service.ts:91:13)
1866
- at CryptoService.verifyJWS (/Users/dylanhobbs/Documents/@kya-os/xmcp-i/packages/mcp-i-core/src/services/crypto.service.ts:169:23)
1867
- at /Users/dylanhobbs/Documents/@kya-os/xmcp-i/packages/mcp-i-core/src/services/__tests__/crypto.service.test.ts:271:42
1868
- at file:///Users/dylanhobbs/Documents/@kya-os/xmcp-i/node_modules/.pnpm/@vitest+runner@4.0.14/node_modules/@vitest/runner/dist/index.js:145:11
1869
- at file:///Users/dylanhobbs/Documents/@kya-os/xmcp-i/node_modules/.pnpm/@vitest+runner@4.0.14/node_modules/@vitest/runner/dist/index.js:919:26
1870
- at file:///Users/dylanhobbs/Documents/@kya-os/xmcp-i/node_modules/.pnpm/@vitest+runner@4.0.14/node_modules/@vitest/runner/dist/index.js:1244:20
1871
- at new Promise (<anonymous>)
1872
- at runWithTimeout (file:///Users/dylanhobbs/Documents/@kya-os/xmcp-i/node_modules/.pnpm/@vitest+runner@4.0.14/node_modules/@vitest/runner/dist/index.js:1210:10)
1873
- at file:///Users/dylanhobbs/Documents/@kya-os/xmcp-i/node_modules/.pnpm/@vitest+runner@4.0.14/node_modules/@vitest/runner/dist/index.js:1654:37
1874
- at Traces.$ (file:///Users/dylanhobbs/Documents/@kya-os/xmcp-i/node_modules/.pnpm/vitest@4.0.14_@opentelemetry+api@1.9.0_@types+node@20.19.25_jiti@2.6.1_lightningcss@1.3_3f67c307998c5928f2f2aae3bf45ed95/node_modules/vitest/dist/chunks/traces.U4xDYhzZ.js:115:27)
1875
-
1876
- stderr | src/services/__tests__/crypto.service.test.ts > CryptoService > verifyJWS > should handle malformed JWS - single part
1877
- [CryptoService] Invalid JWS format: Error: Invalid JWS format: expected header.payload.signature
1878
- at CryptoService.parseJWS (/Users/dylanhobbs/Documents/@kya-os/xmcp-i/packages/mcp-i-core/src/services/crypto.service.ts:78:13)
1879
- at CryptoService.verifyJWS (/Users/dylanhobbs/Documents/@kya-os/xmcp-i/packages/mcp-i-core/src/services/crypto.service.ts:169:23)
1880
- at /Users/dylanhobbs/Documents/@kya-os/xmcp-i/packages/mcp-i-core/src/services/__tests__/crypto.service.test.ts:279:42
1881
- at file:///Users/dylanhobbs/Documents/@kya-os/xmcp-i/node_modules/.pnpm/@vitest+runner@4.0.14/node_modules/@vitest/runner/dist/index.js:145:11
1882
- at file:///Users/dylanhobbs/Documents/@kya-os/xmcp-i/node_modules/.pnpm/@vitest+runner@4.0.14/node_modules/@vitest/runner/dist/index.js:919:26
1883
- at file:///Users/dylanhobbs/Documents/@kya-os/xmcp-i/node_modules/.pnpm/@vitest+runner@4.0.14/node_modules/@vitest/runner/dist/index.js:1244:20
1884
- at new Promise (<anonymous>)
1885
- at runWithTimeout (file:///Users/dylanhobbs/Documents/@kya-os/xmcp-i/node_modules/.pnpm/@vitest+runner@4.0.14/node_modules/@vitest/runner/dist/index.js:1210:10)
1886
- at file:///Users/dylanhobbs/Documents/@kya-os/xmcp-i/node_modules/.pnpm/@vitest+runner@4.0.14/node_modules/@vitest/runner/dist/index.js:1654:37
1887
- at Traces.$ (file:///Users/dylanhobbs/Documents/@kya-os/xmcp-i/node_modules/.pnpm/vitest@4.0.14_@opentelemetry+api@1.9.0_@types+node@20.19.25_jiti@2.6.1_lightningcss@1.3_3f67c307998c5928f2f2aae3bf45ed95/node_modules/vitest/dist/chunks/traces.U4xDYhzZ.js:115:27)
1888
-
1889
- stderr | src/services/__tests__/crypto.service.test.ts > CryptoService > verifyJWS > should handle malformed JWS - two parts
1890
- [CryptoService] Invalid JWS format: Error: Invalid JWS format: expected header.payload.signature
1891
- at CryptoService.parseJWS (/Users/dylanhobbs/Documents/@kya-os/xmcp-i/packages/mcp-i-core/src/services/crypto.service.ts:78:13)
1892
- at CryptoService.verifyJWS (/Users/dylanhobbs/Documents/@kya-os/xmcp-i/packages/mcp-i-core/src/services/crypto.service.ts:169:23)
1893
- at /Users/dylanhobbs/Documents/@kya-os/xmcp-i/packages/mcp-i-core/src/services/__tests__/crypto.service.test.ts:287:42
1894
- at file:///Users/dylanhobbs/Documents/@kya-os/xmcp-i/node_modules/.pnpm/@vitest+runner@4.0.14/node_modules/@vitest/runner/dist/index.js:145:11
1895
- at file:///Users/dylanhobbs/Documents/@kya-os/xmcp-i/node_modules/.pnpm/@vitest+runner@4.0.14/node_modules/@vitest/runner/dist/index.js:919:26
1896
- at file:///Users/dylanhobbs/Documents/@kya-os/xmcp-i/node_modules/.pnpm/@vitest+runner@4.0.14/node_modules/@vitest/runner/dist/index.js:1244:20
1897
- at new Promise (<anonymous>)
1898
- at runWithTimeout (file:///Users/dylanhobbs/Documents/@kya-os/xmcp-i/node_modules/.pnpm/@vitest+runner@4.0.14/node_modules/@vitest/runner/dist/index.js:1210:10)
1899
- at file:///Users/dylanhobbs/Documents/@kya-os/xmcp-i/node_modules/.pnpm/@vitest+runner@4.0.14/node_modules/@vitest/runner/dist/index.js:1654:37
1900
- at Traces.$ (file:///Users/dylanhobbs/Documents/@kya-os/xmcp-i/node_modules/.pnpm/vitest@4.0.14_@opentelemetry+api@1.9.0_@types+node@20.19.25_jiti@2.6.1_lightningcss@1.3_3f67c307998c5928f2f2aae3bf45ed95/node_modules/vitest/dist/chunks/traces.U4xDYhzZ.js:115:27)
1901
-
1902
- stderr | src/services/__tests__/crypto.service.test.ts > CryptoService > verifyJWS > should handle malformed JWS - four parts
1903
- [CryptoService] Invalid JWS format: Error: Invalid JWS format: expected header.payload.signature
1904
- at CryptoService.parseJWS (/Users/dylanhobbs/Documents/@kya-os/xmcp-i/packages/mcp-i-core/src/services/crypto.service.ts:78:13)
1905
- at CryptoService.verifyJWS (/Users/dylanhobbs/Documents/@kya-os/xmcp-i/packages/mcp-i-core/src/services/crypto.service.ts:169:23)
1906
- at /Users/dylanhobbs/Documents/@kya-os/xmcp-i/packages/mcp-i-core/src/services/__tests__/crypto.service.test.ts:302:42
1907
- at file:///Users/dylanhobbs/Documents/@kya-os/xmcp-i/node_modules/.pnpm/@vitest+runner@4.0.14/node_modules/@vitest/runner/dist/index.js:145:11
1908
- at file:///Users/dylanhobbs/Documents/@kya-os/xmcp-i/node_modules/.pnpm/@vitest+runner@4.0.14/node_modules/@vitest/runner/dist/index.js:919:26
1909
- at file:///Users/dylanhobbs/Documents/@kya-os/xmcp-i/node_modules/.pnpm/@vitest+runner@4.0.14/node_modules/@vitest/runner/dist/index.js:1244:20
1910
- at new Promise (<anonymous>)
1911
- at runWithTimeout (file:///Users/dylanhobbs/Documents/@kya-os/xmcp-i/node_modules/.pnpm/@vitest+runner@4.0.14/node_modules/@vitest/runner/dist/index.js:1210:10)
1912
- at file:///Users/dylanhobbs/Documents/@kya-os/xmcp-i/node_modules/.pnpm/@vitest+runner@4.0.14/node_modules/@vitest/runner/dist/index.js:1654:37
1913
- at Traces.$ (file:///Users/dylanhobbs/Documents/@kya-os/xmcp-i/node_modules/.pnpm/vitest@4.0.14_@opentelemetry+api@1.9.0_@types+node@20.19.25_jiti@2.6.1_lightningcss@1.3_3f67c307998c5928f2f2aae3bf45ed95/node_modules/vitest/dist/chunks/traces.U4xDYhzZ.js:115:27)
1914
-
1915
- stderr | src/services/__tests__/crypto.service.test.ts > CryptoService > verifyJWS > should handle malformed JWS - invalid JSON header
1916
- [CryptoService] Invalid JWS format: Error: Invalid header base64: Unexpected token 'o', "notjson" is not valid JSON
1917
- at CryptoService.parseJWS (/Users/dylanhobbs/Documents/@kya-os/xmcp-i/packages/mcp-i-core/src/services/crypto.service.ts:91:13)
1918
- at CryptoService.verifyJWS (/Users/dylanhobbs/Documents/@kya-os/xmcp-i/packages/mcp-i-core/src/services/crypto.service.ts:169:23)
1919
- at /Users/dylanhobbs/Documents/@kya-os/xmcp-i/packages/mcp-i-core/src/services/__tests__/crypto.service.test.ts:316:42
1920
- at file:///Users/dylanhobbs/Documents/@kya-os/xmcp-i/node_modules/.pnpm/@vitest+runner@4.0.14/node_modules/@vitest/runner/dist/index.js:145:11
1921
- at file:///Users/dylanhobbs/Documents/@kya-os/xmcp-i/node_modules/.pnpm/@vitest+runner@4.0.14/node_modules/@vitest/runner/dist/index.js:919:26
1922
- at file:///Users/dylanhobbs/Documents/@kya-os/xmcp-i/node_modules/.pnpm/@vitest+runner@4.0.14/node_modules/@vitest/runner/dist/index.js:1244:20
1923
- at new Promise (<anonymous>)
1924
- at runWithTimeout (file:///Users/dylanhobbs/Documents/@kya-os/xmcp-i/node_modules/.pnpm/@vitest+runner@4.0.14/node_modules/@vitest/runner/dist/index.js:1210:10)
1925
- at file:///Users/dylanhobbs/Documents/@kya-os/xmcp-i/node_modules/.pnpm/@vitest+runner@4.0.14/node_modules/@vitest/runner/dist/index.js:1654:37
1926
- at Traces.$ (file:///Users/dylanhobbs/Documents/@kya-os/xmcp-i/node_modules/.pnpm/vitest@4.0.14_@opentelemetry+api@1.9.0_@types+node@20.19.25_jiti@2.6.1_lightningcss@1.3_3f67c307998c5928f2f2aae3bf45ed95/node_modules/vitest/dist/chunks/traces.U4xDYhzZ.js:115:27)
1927
-
1928
- stderr | src/services/__tests__/crypto.service.test.ts > CryptoService > verifyJWS > should handle malformed JWS - invalid base64
1929
- [CryptoService] Invalid JWS format: Error: Invalid payload base64: Invalid base64url string: Invalid character
1930
- at CryptoService.parseJWS (/Users/dylanhobbs/Documents/@kya-os/xmcp-i/packages/mcp-i-core/src/services/crypto.service.ts:107:15)
1931
- at CryptoService.verifyJWS (/Users/dylanhobbs/Documents/@kya-os/xmcp-i/packages/mcp-i-core/src/services/crypto.service.ts:169:23)
1932
- at /Users/dylanhobbs/Documents/@kya-os/xmcp-i/packages/mcp-i-core/src/services/__tests__/crypto.service.test.ts:334:42
1933
- at file:///Users/dylanhobbs/Documents/@kya-os/xmcp-i/node_modules/.pnpm/@vitest+runner@4.0.14/node_modules/@vitest/runner/dist/index.js:145:11
1934
- at file:///Users/dylanhobbs/Documents/@kya-os/xmcp-i/node_modules/.pnpm/@vitest+runner@4.0.14/node_modules/@vitest/runner/dist/index.js:919:26
1935
- at file:///Users/dylanhobbs/Documents/@kya-os/xmcp-i/node_modules/.pnpm/@vitest+runner@4.0.14/node_modules/@vitest/runner/dist/index.js:1244:20
1936
- at new Promise (<anonymous>)
1937
- at runWithTimeout (file:///Users/dylanhobbs/Documents/@kya-os/xmcp-i/node_modules/.pnpm/@vitest+runner@4.0.14/node_modules/@vitest/runner/dist/index.js:1210:10)
1938
- at file:///Users/dylanhobbs/Documents/@kya-os/xmcp-i/node_modules/.pnpm/@vitest+runner@4.0.14/node_modules/@vitest/runner/dist/index.js:1654:37
1939
- at Traces.$ (file:///Users/dylanhobbs/Documents/@kya-os/xmcp-i/node_modules/.pnpm/vitest@4.0.14_@opentelemetry+api@1.9.0_@types+node@20.19.25_jiti@2.6.1_lightningcss@1.3_3f67c307998c5928f2f2aae3bf45ed95/node_modules/vitest/dist/chunks/traces.U4xDYhzZ.js:115:27)
1940
-
1941
- stderr | src/services/__tests__/crypto.service.test.ts > CryptoService > verifyJWS > should validate expectedKid option
1942
- [CryptoService] Key ID mismatch
1943
-
1944
- stderr | src/services/__tests__/crypto.service.test.ts > CryptoService > verifyJWS > should validate alg option
1945
- [CryptoService] Unsupported algorithm: EdDSA, expected RS256
1946
-
1947
- stderr | src/services/__tests__/crypto.service.test.ts > CryptoService > verifyJWS > should validate Ed25519 key length
1948
- [CryptoService] Failed to extract public key: Error: Invalid Ed25519 public key length: 5
1949
- at CryptoService.jwkToBase64PublicKey (/Users/dylanhobbs/Documents/@kya-os/xmcp-i/packages/mcp-i-core/src/services/crypto.service.ts:295:13)
1950
- at CryptoService.verifyJWS (/Users/dylanhobbs/Documents/@kya-os/xmcp-i/packages/mcp-i-core/src/services/crypto.service.ts:249:32)
1951
- at /Users/dylanhobbs/Documents/@kya-os/xmcp-i/packages/mcp-i-core/src/services/__tests__/crypto.service.test.ts:398:42
1952
- at file:///Users/dylanhobbs/Documents/@kya-os/xmcp-i/node_modules/.pnpm/@vitest+runner@4.0.14/node_modules/@vitest/runner/dist/index.js:145:11
1953
- at file:///Users/dylanhobbs/Documents/@kya-os/xmcp-i/node_modules/.pnpm/@vitest+runner@4.0.14/node_modules/@vitest/runner/dist/index.js:919:26
1954
- at file:///Users/dylanhobbs/Documents/@kya-os/xmcp-i/node_modules/.pnpm/@vitest+runner@4.0.14/node_modules/@vitest/runner/dist/index.js:1244:20
1955
- at new Promise (<anonymous>)
1956
- at runWithTimeout (file:///Users/dylanhobbs/Documents/@kya-os/xmcp-i/node_modules/.pnpm/@vitest+runner@4.0.14/node_modules/@vitest/runner/dist/index.js:1210:10)
1957
- at file:///Users/dylanhobbs/Documents/@kya-os/xmcp-i/node_modules/.pnpm/@vitest+runner@4.0.14/node_modules/@vitest/runner/dist/index.js:1654:37
1958
- at Traces.$ (file:///Users/dylanhobbs/Documents/@kya-os/xmcp-i/node_modules/.pnpm/vitest@4.0.14_@opentelemetry+api@1.9.0_@types+node@20.19.25_jiti@2.6.1_lightningcss@1.3_3f67c307998c5928f2f2aae3bf45ed95/node_modules/vitest/dist/chunks/traces.U4xDYhzZ.js:115:27)
1959
-
1960
- stderr | src/services/__tests__/crypto.service.test.ts > CryptoService > verifyJWS > should handle signature verification error
1961
- [CryptoService] Ed25519 verification error: Error: Crypto error
1962
- at /Users/dylanhobbs/Documents/@kya-os/xmcp-i/packages/mcp-i-core/src/services/__tests__/crypto.service.test.ts:449:61
1963
- at file:///Users/dylanhobbs/Documents/@kya-os/xmcp-i/node_modules/.pnpm/@vitest+runner@4.0.14/node_modules/@vitest/runner/dist/index.js:145:11
1964
- at file:///Users/dylanhobbs/Documents/@kya-os/xmcp-i/node_modules/.pnpm/@vitest+runner@4.0.14/node_modules/@vitest/runner/dist/index.js:919:26
1965
- at file:///Users/dylanhobbs/Documents/@kya-os/xmcp-i/node_modules/.pnpm/@vitest+runner@4.0.14/node_modules/@vitest/runner/dist/index.js:1244:20
1966
- at new Promise (<anonymous>)
1967
- at runWithTimeout (file:///Users/dylanhobbs/Documents/@kya-os/xmcp-i/node_modules/.pnpm/@vitest+runner@4.0.14/node_modules/@vitest/runner/dist/index.js:1210:10)
1968
- at file:///Users/dylanhobbs/Documents/@kya-os/xmcp-i/node_modules/.pnpm/@vitest+runner@4.0.14/node_modules/@vitest/runner/dist/index.js:1654:37
1969
- at Traces.$ (file:///Users/dylanhobbs/Documents/@kya-os/xmcp-i/node_modules/.pnpm/vitest@4.0.14_@opentelemetry+api@1.9.0_@types+node@20.19.25_jiti@2.6.1_lightningcss@1.3_3f67c307998c5928f2f2aae3bf45ed95/node_modules/vitest/dist/chunks/traces.U4xDYhzZ.js:115:27)
1970
- at trace (file:///Users/dylanhobbs/Documents/@kya-os/xmcp-i/node_modules/.pnpm/vitest@4.0.14_@opentelemetry+api@1.9.0_@types+node@20.19.25_jiti@2.6.1_lightningcss@1.3_3f67c307998c5928f2f2aae3bf45ed95/node_modules/vitest/dist/chunks/test.DqQZzsWf.js:234:21)
1971
- at runTest (file:///Users/dylanhobbs/Documents/@kya-os/xmcp-i/node_modules/.pnpm/@vitest+runner@4.0.14/node_modules/@vitest/runner/dist/index.js:1654:12)
1972
-
1973
- ✓ src/services/__tests__/crypto.service.test.ts (34 tests) 14ms
1974
- stderr | src/services/__tests__/access-control.service.test.ts > AccessControlApiService > submitProofs > should submit proofs successfully
1975
- [AccessControl] 🔍 RAW API RESPONSE (before parsing): {
1976
- correlationId: '3e2a5e0f-9dc2-4f4b-87c9-04bff331d934',
1977
- status: 200,
1978
- statusText: '',
1979
- headers: { 'content-type': 'application/json' },
1980
- responseTextLength: 100,
1981
- responseTextPreview: '{"success":true,"accepted":1,"rejected":0,"outcomes":{"success":1,"failed":0,"blocked":0,"error":0}}',
1982
- fullResponseText: '{"success":true,"accepted":1,"rejected":0,"outcomes":{"success":1,"failed":0,"blocked":0,"error":0}}'
1983
- }
1984
- [AccessControl] 🔍 PARSED RESPONSE DATA: {
1985
- correlationId: '3e2a5e0f-9dc2-4f4b-87c9-04bff331d934',
1986
- status: 200,
1987
- responseDataType: 'object',
1988
- responseDataKeys: [ 'success', 'accepted', 'rejected', 'outcomes' ],
1989
- responseData: '{\n' +
1990
- ' "success": true,\n' +
1991
- ' "accepted": 1,\n' +
1992
- ' "rejected": 0,\n' +
1993
- ' "outcomes": {\n' +
1994
- ' "success": 1,\n' +
1995
- ' "failed": 0,\n' +
1996
- ' "blocked": 0,\n' +
1997
- ' "error": 0\n' +
1998
- ' }\n' +
1999
- '}'
2000
- }
2001
- [AccessControl] Raw response received: {
2002
- "success": true,
2003
- "accepted": 1,
2004
- "rejected": 0,
2005
- "outcomes": {
2006
- "success": 1,
2007
- "failed": 0,
2008
- "blocked": 0,
2009
- "error": 0
2010
- }
2011
- }
2012
-
2013
- stderr | src/services/__tests__/access-control.service.test.ts > AccessControlApiService > submitProofs > should handle all_proofs_rejected error gracefully
2014
- [AccessControl] 🔍 RAW API RESPONSE (before parsing): {
2015
- correlationId: '9fb2e02d-cf02-43ab-a38d-9332bf1fce27',
2016
- status: 400,
2017
- statusText: '',
2018
- headers: { 'content-type': 'application/json' },
2019
- responseTextLength: 209,
2020
- 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"}}]}}}',
2021
- 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"}}]}}}'
2022
- }
2023
- [AccessControl] 🔍 PARSED RESPONSE DATA: {
2024
- correlationId: '9fb2e02d-cf02-43ab-a38d-9332bf1fce27',
2025
- status: 400,
2026
- responseDataType: 'object',
2027
- responseDataKeys: [ 'success', 'error' ],
2028
- responseData: '{\n' +
2029
- ' "success": false,\n' +
2030
- ' "error": {\n' +
2031
- ' "code": "all_proofs_rejected",\n' +
2032
- ' "message": "All proofs rejected",\n' +
2033
- ' "details": {\n' +
2034
- ' "rejected": 1,\n' +
2035
- ' "errors": [\n' +
2036
- ' {\n' +
2037
- ' "proof_index": 0,\n' +
2038
- ' "error": {\n' +
2039
- ' "code": "invalid_signature",\n' +
2040
- ' "message": "Invalid signature"\n' +
2041
- ' }\n' +
2042
- ' }\n' +
2043
- ' ]\n' +
2044
- ' }\n' +
2045
- ' }\n' +
2046
- '}'
2047
- }
2048
-
2049
- stderr | src/services/__tests__/access-control.service.test.ts > AccessControlApiService > submitProofs > should handle wrapped response format
2050
- [AccessControl] 🔍 RAW API RESPONSE (before parsing): {
2051
- correlationId: '0da4cd48-1bda-409d-8c94-07c72bfd9e7d',
2052
- status: 200,
2053
- statusText: '',
2054
- headers: { 'content-type': 'application/json' },
2055
- responseTextLength: 206,
2056
- 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-12-04T01:15:16.588Z"}}',
2057
- 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-12-04T01:15:16.588Z"}}'
2058
- }
2059
- [AccessControl] 🔍 PARSED RESPONSE DATA: {
2060
- correlationId: '0da4cd48-1bda-409d-8c94-07c72bfd9e7d',
2061
- status: 200,
2062
- responseDataType: 'object',
2063
- responseDataKeys: [ 'success', 'data', 'metadata' ],
2064
- responseData: '{\n' +
2065
- ' "success": true,\n' +
2066
- ' "data": {\n' +
2067
- ' "success": true,\n' +
2068
- ' "accepted": 1,\n' +
2069
- ' "rejected": 0,\n' +
2070
- ' "outcomes": {\n' +
2071
- ' "success": 1,\n' +
2072
- ' "failed": 0,\n' +
2073
- ' "blocked": 0,\n' +
2074
- ' "error": 0\n' +
2075
- ' }\n' +
2076
- ' },\n' +
2077
- ' "metadata": {\n' +
2078
- ' "requestId": "test-request-id",\n' +
2079
- ' "timestamp": "2025-12-04T01:15:16.588Z"\n' +
2080
- ' }\n' +
2081
- '}'
2082
- }
2083
- [AccessControl] Raw response received: {
2084
- "success": true,
2085
- "data": {
2086
- "success": true,
2087
- "accepted": 1,
2088
- "rejected": 0,
2089
- "outcomes": {
2090
- "success": 1,
2091
- "failed": 0,
2092
- "blocked": 0,
2093
- "error": 0
2094
- }
2095
- },
2096
- "metadata": {
2097
- "requestId": "test-request-id",
2098
- "timestamp": "2025-12-04T01:15:16.588Z"
2099
- }
2100
- }
2101
- [AccessControl] 🔍 DATA OBJECT STRUCTURE (after deep clone): {
2102
- correlationId: '0da4cd48-1bda-409d-8c94-07c72bfd9e7d',
2103
- dataKeys: [ 'success', 'accepted', 'rejected', 'outcomes' ],
2104
- hasAccepted: true,
2105
- hasRejected: true,
2106
- hasOutcomes: true,
2107
- hasErrors: false,
2108
- acceptedType: 'number',
2109
- acceptedValue: 1,
2110
- rejectedType: 'number',
2111
- rejectedValue: 0,
2112
- outcomesType: 'object',
2113
- outcomesValue: { success: 1, failed: 0, blocked: 0, error: 0 },
2114
- errorsType: 'undefined',
2115
- errorsIsArray: false,
2116
- fullData: '{\n' +
2117
- ' "success": true,\n' +
2118
- ' "accepted": 1,\n' +
2119
- ' "rejected": 0,\n' +
2120
- ' "outcomes": {\n' +
2121
- ' "success": 1,\n' +
2122
- ' "failed": 0,\n' +
2123
- ' "blocked": 0,\n' +
2124
- ' "error": 0\n' +
2125
- ' }\n' +
2126
- '}'
2127
- }
2128
- [AccessControl] 🔍 VALIDATING DATA WITH SUCCESS: {
2129
- correlationId: '0da4cd48-1bda-409d-8c94-07c72bfd9e7d',
2130
- dataWithSuccessKeys: [ 'success', 'accepted', 'rejected', 'outcomes' ],
2131
- hasSuccess: true,
2132
- successValue: true,
2133
- hasAccepted: true,
2134
- acceptedValue: 1,
2135
- hasRejected: true,
2136
- rejectedValue: 0,
2137
- hasOutcomes: true,
2138
- outcomesValue: { success: 1, failed: 0, blocked: 0, error: 0 },
2139
- fullDataWithSuccess: '{\n' +
2140
- ' "success": true,\n' +
2141
- ' "accepted": 1,\n' +
2142
- ' "rejected": 0,\n' +
2143
- ' "outcomes": {\n' +
2144
- ' "success": 1,\n' +
2145
- ' "failed": 0,\n' +
2146
- ' "blocked": 0,\n' +
2147
- ' "error": 0\n' +
2148
- ' }\n' +
2149
- '}'
2150
- }
2151
-
2152
- stderr | src/services/__tests__/access-control.service.test.ts > AccessControlApiService > submitProofs > should handle response with missing outcomes field (outcomes is optional)
2153
- [AccessControl] 🔍 RAW API RESPONSE (before parsing): {
2154
- correlationId: 'd107eb6d-cd2e-40d1-a87a-77bbb9a2c248',
2155
- status: 200,
2156
- statusText: '',
2157
- headers: { 'content-type': 'application/json' },
2158
- responseTextLength: 42,
2159
- responseTextPreview: '{"success":true,"accepted":1,"rejected":0}',
2160
- fullResponseText: '{"success":true,"accepted":1,"rejected":0}'
2161
- }
2162
- [AccessControl] 🔍 PARSED RESPONSE DATA: {
2163
- correlationId: 'd107eb6d-cd2e-40d1-a87a-77bbb9a2c248',
2164
- status: 200,
2165
- responseDataType: 'object',
2166
- responseDataKeys: [ 'success', 'accepted', 'rejected' ],
2167
- responseData: '{\n "success": true,\n "accepted": 1,\n "rejected": 0\n}'
2168
- }
2169
- [AccessControl] Raw response received: {
2170
- "success": true,
2171
- "accepted": 1,
2172
- "rejected": 0
2173
- }
2174
-
2175
- stderr | src/services/__tests__/access-control.service.test.ts > AccessControlApiService > submitProofs > should handle response with missing outcomes field (outcomes is optional)
2176
- [AccessControl] 🔍 RAW API RESPONSE (before parsing): {
2177
- correlationId: 'c8298b4e-ee49-4f03-9078-03e559397d8d',
2178
- status: 200,
2179
- statusText: '',
2180
- headers: { 'content-type': 'application/json' },
2181
- responseTextLength: 100,
2182
- responseTextPreview: '{"success":true,"accepted":1,"rejected":0,"outcomes":{"success":1,"failed":0,"blocked":0,"error":0}}',
2183
- fullResponseText: '{"success":true,"accepted":1,"rejected":0,"outcomes":{"success":1,"failed":0,"blocked":0,"error":0}}'
2184
- }
2185
- [AccessControl] 🔍 PARSED RESPONSE DATA: {
2186
- correlationId: 'c8298b4e-ee49-4f03-9078-03e559397d8d',
2187
- status: 200,
2188
- responseDataType: 'object',
2189
- responseDataKeys: [ 'success', 'accepted', 'rejected', 'outcomes' ],
2190
- responseData: '{\n' +
2191
- ' "success": true,\n' +
2192
- ' "accepted": 1,\n' +
2193
- ' "rejected": 0,\n' +
2194
- ' "outcomes": {\n' +
2195
- ' "success": 1,\n' +
2196
- ' "failed": 0,\n' +
2197
- ' "blocked": 0,\n' +
2198
- ' "error": 0\n' +
2199
- ' }\n' +
2200
- '}'
2201
- }
2202
- [AccessControl] Raw response received: {
2203
- "success": true,
2204
- "accepted": 1,
2205
- "rejected": 0,
2206
- "outcomes": {
2207
- "success": 1,
2208
- "failed": 0,
2209
- "blocked": 0,
2210
- "error": 0
2211
- }
2212
- }
2213
-
2214
- stderr | src/services/__tests__/access-control.service.test.ts > AccessControlApiService > submitProofs > should handle response with missing outcomes field (outcomes is optional)
2215
- [AccessControl] 🔍 RAW API RESPONSE (before parsing): {
2216
- correlationId: '5924cc97-b045-4a96-a234-31252848bc09',
2217
- status: 200,
2218
- statusText: '',
2219
- headers: { 'content-type': 'application/json' },
2220
- responseTextLength: 56,
2221
- responseTextPreview: '{"success":true,"accepted":1,"rejected":0,"outcomes":{}}',
2222
- fullResponseText: '{"success":true,"accepted":1,"rejected":0,"outcomes":{}}'
2223
- }
2224
- [AccessControl] 🔍 PARSED RESPONSE DATA: {
2225
- correlationId: '5924cc97-b045-4a96-a234-31252848bc09',
2226
- status: 200,
2227
- responseDataType: 'object',
2228
- responseDataKeys: [ 'success', 'accepted', 'rejected', 'outcomes' ],
2229
- responseData: '{\n "success": true,\n "accepted": 1,\n "rejected": 0,\n "outcomes": {}\n}'
2230
- }
2231
- [AccessControl] Raw response received: {
2232
- "success": true,
2233
- "accepted": 1,
2234
- "rejected": 0,
2235
- "outcomes": {}
2236
- }
2237
-
2238
- stderr | src/services/__tests__/access-control.service.test.ts > AccessControlApiService > submitProofs > should handle wrapped response with invalid data structure
2239
- [AccessControl] 🔍 RAW API RESPONSE (before parsing): {
2240
- correlationId: '2ecd5f26-1003-4bb2-9949-15d7a0e9ddc7',
2241
- status: 200,
2242
- statusText: '',
2243
- headers: { 'content-type': 'application/json' },
2244
- responseTextLength: 52,
2245
- responseTextPreview: '{"success":true,"data":{"message":"Invalid format"}}',
2246
- fullResponseText: '{"success":true,"data":{"message":"Invalid format"}}'
2247
- }
2248
- [AccessControl] 🔍 PARSED RESPONSE DATA: {
2249
- correlationId: '2ecd5f26-1003-4bb2-9949-15d7a0e9ddc7',
2250
- status: 200,
2251
- responseDataType: 'object',
2252
- responseDataKeys: [ 'success', 'data' ],
2253
- responseData: '{\n "success": true,\n "data": {\n "message": "Invalid format"\n }\n}'
2254
- }
2255
- [AccessControl] Raw response received: {
2256
- "success": true,
2257
- "data": {
2258
- "message": "Invalid format"
2259
- }
2260
- }
2261
- [AccessControl] 🔍 DATA OBJECT STRUCTURE (after deep clone): {
2262
- correlationId: '2ecd5f26-1003-4bb2-9949-15d7a0e9ddc7',
2263
- dataKeys: [ 'message' ],
2264
- hasAccepted: false,
2265
- hasRejected: false,
2266
- hasOutcomes: false,
2267
- hasErrors: false,
2268
- acceptedType: 'undefined',
2269
- acceptedValue: undefined,
2270
- rejectedType: 'undefined',
2271
- rejectedValue: undefined,
2272
- outcomesType: 'undefined',
2273
- outcomesValue: undefined,
2274
- errorsType: 'undefined',
2275
- errorsIsArray: false,
2276
- fullData: '{\n "message": "Invalid format"\n}'
2277
- }
2278
- [AccessControl] 🔍 VALIDATING DATA WITH SUCCESS: {
2279
- correlationId: '2ecd5f26-1003-4bb2-9949-15d7a0e9ddc7',
2280
- dataWithSuccessKeys: [ 'success', 'accepted', 'rejected' ],
2281
- hasSuccess: true,
2282
- successValue: true,
2283
- hasAccepted: true,
2284
- acceptedValue: undefined,
2285
- hasRejected: true,
2286
- rejectedValue: undefined,
2287
- hasOutcomes: false,
2288
- outcomesValue: undefined,
2289
- fullDataWithSuccess: '{\n "success": true\n}'
2290
- }
2291
- [AccessControl] ❌ MISSING REQUIRED FIELDS AFTER CONSTRUCTION: {
2292
- correlationId: '2ecd5f26-1003-4bb2-9949-15d7a0e9ddc7',
2293
- hasAccepted: true,
2294
- acceptedType: 'undefined',
2295
- acceptedValue: undefined,
2296
- hasRejected: true,
2297
- rejectedType: 'undefined',
2298
- rejectedValue: undefined,
2299
- dataWithSuccessKeys: [ 'success', 'accepted', 'rejected' ],
2300
- fullDataWithSuccess: '{\n "success": true\n}',
2301
- dataToValidateKeys: [ 'message' ],
2302
- fullDataToValidate: '{\n "message": "Invalid format"\n}',
2303
- originalResponseData: '{\n "success": true,\n "data": {\n "message": "Invalid format"\n }\n}'
2304
- }
2305
-
2306
- stdout | src/__tests__/services/agentshield-integration.test.ts > AgentShield Integration > Caching Integration > should respect cache TTL
2307
- stderr | src/__tests__/services/agentshield-integration.test.ts > AgentShield Integration > Real-world Scenarios > should handle API rate limiting gracefully
2308
- [ToolProtectionService] Config loaded from API {
2309
- source: 'api',
2310
- toolCount: 0,
2311
- [ToolProtectionService] API fetch failed, using fallback config {
2312
- protectedTools: [],
2313
- agentDid: 'did:key:z6MkhaXgBZDv...',
2314
- agentDid: 'did:key:z6MkhaXgBZDv...',
2315
- projectId: 'test-project-123',
2316
- cacheTtlMs: 1000,
2317
- cacheExpiresAt: '2025-12-04T01:15:17.587Z'
2318
- }
2319
-
2320
- stdout | src/__tests__/services/agentshield-integration.test.ts > AgentShield Integration > Real-world Scenarios > should handle typical e-commerce tool protection config
2321
- [ToolProtectionService] Config loaded from API {
2322
- error: 'Failed to fetch bouncer config: 429 Too Many Requests - Rate limit exceeded'
2323
- source: 'api',
2324
- toolCount: 4,
2325
- protectedTools: [ 'add_to_cart', 'checkout' ],
2326
- agentDid: 'did:key:z6MkhaXgBZDv...',
2327
- }
2328
-
2329
- projectId: 'test-project-123',
2330
- cacheTtlMs: 300000,
2331
- cacheExpiresAt: '2025-12-04T01:20:16.588Z'
2332
- }
2333
-
2334
- stdout | src/__tests__/services/agentshield-integration.test.ts > AgentShield Integration > Real-world Scenarios > should handle concurrent requests
2335
- [ToolProtectionService] Config loaded from API {
2336
- source: 'api',
2337
- toolCount: 1,
2338
- protectedTools: [ 'tool1' ],
2339
- agentDid: 'did:key:z6MkhaXgBZDv...',
2340
- projectId: 'test-project-123',
2341
- cacheTtlMs: 300000,
2342
- cacheExpiresAt: '2025-12-04T01:20:16.589Z'
2343
- }
2344
- [ToolProtectionService] Config loaded from API {
2345
- source: 'api',
2346
- toolCount: 1,
2347
- protectedTools: [ 'tool1' ],
2348
- agentDid: 'did:key:z6MkhaXgBZDv...',
2349
- projectId: 'test-project-123',
2350
- cacheTtlMs: 300000,
2351
- cacheExpiresAt: '2025-12-04T01:20:16.589Z'
2352
- }
2353
- [ToolProtectionService] Config loaded from API {
2354
- source: 'api',
2355
- toolCount: 1,
2356
- protectedTools: [ 'tool1' ],
2357
- agentDid: 'did:key:z6MkhaXgBZDv...',
2358
- projectId: 'test-project-123',
2359
- cacheTtlMs: 300000,
2360
- cacheExpiresAt: '2025-12-04T01:20:16.589Z'
2361
- }
2362
-
2363
- ✓ src/__tests__/services/agentshield-integration.test.ts (30 tests) 1121ms
2364
- ✓ should respect cache TTL 1102ms
2365
- ✓ src/delegation/storage/__tests__/memory-graph-storage.test.ts (27 tests) 4ms
2366
- ✓ src/services/__tests__/access-control.service.test.ts (23 tests) 93ms
2367
- ✓ src/__tests__/services/oauth-service-pkce.test.ts (18 tests) 53ms
2368
- ✓ src/__tests__/providers/memory.test.ts (34 tests) 11ms
2369
- stderr | src/services/__tests__/proof-verifier.test.ts > ProofVerifier Security > Signature Verification > should handle signature verification errors gracefully
2370
- [CryptoService] Ed25519 verification error: Error: Crypto error
2371
- at /Users/dylanhobbs/Documents/@kya-os/xmcp-i/packages/mcp-i-core/src/services/__tests__/proof-verifier.test.ts:328:9
2372
- at file:///Users/dylanhobbs/Documents/@kya-os/xmcp-i/node_modules/.pnpm/@vitest+runner@4.0.14/node_modules/@vitest/runner/dist/index.js:145:11
2373
- at file:///Users/dylanhobbs/Documents/@kya-os/xmcp-i/node_modules/.pnpm/@vitest+runner@4.0.14/node_modules/@vitest/runner/dist/index.js:919:26
2374
- at file:///Users/dylanhobbs/Documents/@kya-os/xmcp-i/node_modules/.pnpm/@vitest+runner@4.0.14/node_modules/@vitest/runner/dist/index.js:1244:20
2375
- at new Promise (<anonymous>)
2376
- at runWithTimeout (file:///Users/dylanhobbs/Documents/@kya-os/xmcp-i/node_modules/.pnpm/@vitest+runner@4.0.14/node_modules/@vitest/runner/dist/index.js:1210:10)
2377
- at file:///Users/dylanhobbs/Documents/@kya-os/xmcp-i/node_modules/.pnpm/@vitest+runner@4.0.14/node_modules/@vitest/runner/dist/index.js:1654:37
2378
- at Traces.$ (file:///Users/dylanhobbs/Documents/@kya-os/xmcp-i/node_modules/.pnpm/vitest@4.0.14_@opentelemetry+api@1.9.0_@types+node@20.19.25_jiti@2.6.1_lightningcss@1.3_3f67c307998c5928f2f2aae3bf45ed95/node_modules/vitest/dist/chunks/traces.U4xDYhzZ.js:115:27)
2379
- at trace (file:///Users/dylanhobbs/Documents/@kya-os/xmcp-i/node_modules/.pnpm/vitest@4.0.14_@opentelemetry+api@1.9.0_@types+node@20.19.25_jiti@2.6.1_lightningcss@1.3_3f67c307998c5928f2f2aae3bf45ed95/node_modules/vitest/dist/chunks/test.DqQZzsWf.js:234:21)
2380
- at runTest (file:///Users/dylanhobbs/Documents/@kya-os/xmcp-i/node_modules/.pnpm/@vitest+runner@4.0.14/node_modules/@vitest/runner/dist/index.js:1654:12)
2381
-
2382
- stdout | src/__tests__/integration.test.ts > Integration Tests > Full handshake and tool execution flow > should complete full authentication and tool execution cycle
2383
- [AUDIT] {"event":"runtime_initialized","data":{"did":"did:key:zq5-ev5Y5xitwortZn_hNu31JcIkMy6WR","environment":"development","userDidGeneration":"disabled"},"timestamp":1764810916633,"timestampFormatted":"2025-12-04T01:15:16.633Z"}
2384
-
2385
- stdout | src/__tests__/integration.test.ts > Integration Tests > Full handshake and tool execution flow > should complete full authentication and tool execution cycle
2386
- [AUDIT] {"event":"tool_executed","data":{"tool":"greetingTool","sessionId":"6a8538c35483912e6fa59b9d80a234a6","timestamp":1764810916633},"timestamp":1764810916633,"timestampFormatted":"2025-12-04T01:15:16.633Z"}
2387
-
2388
- stdout | src/__tests__/integration.test.ts > Integration Tests > Session expiry handling > should handle expired sessions correctly
2389
- [AUDIT] {"event":"runtime_initialized","data":{"did":"did:key:zrZDbmNhqf3BMOEmdMS43AbAXoxxOZOpR","environment":"development","userDidGeneration":"disabled"},"timestamp":1764810916653,"timestampFormatted":"2025-12-04T01:15:16.653Z"}
2390
-
2391
- stdout | src/__tests__/integration.test.ts > Integration Tests > Key rotation flow > should handle key rotation and maintain functionality
2392
- [AUDIT] {"event":"runtime_initialized","data":{"did":"did:key:zgy6dSCtf7RFVDeck5OhoQdmlj_ikCGVy","environment":"development","userDidGeneration":"disabled"},"timestamp":1764810916653,"timestampFormatted":"2025-12-04T01:15:16.653Z"}
2393
-
2394
- stdout | src/__tests__/integration.test.ts > Integration Tests > Key rotation flow > should handle key rotation and maintain functionality
2395
- [AUDIT] {"event":"keys_rotated","data":{"oldDid":"did:key:zgy6dSCtf7RFVDeck5OhoQdmlj_ikCGVy","newDid":"did:key:zX01Vl7wEhhblqby8hUZw7ym8HPzGkCYk","timestamp":1764810916653},"timestamp":1764810916653,"timestampFormatted":"2025-12-04T01:15:16.653Z"}
2396
-
2397
- stdout | src/__tests__/integration.test.ts > Integration Tests > Well-known endpoints > should provide identity discovery endpoints
2398
- [AUDIT] {"event":"runtime_initialized","data":{"did":"did:key:zrh6BVDG-vvjr3kRBldFSu7ZjJU0CI6_8","environment":"development","userDidGeneration":"disabled"},"timestamp":1764810916654,"timestampFormatted":"2025-12-04T01:15:16.654Z"}
2399
-
2400
- stdout | src/__tests__/integration.test.ts > Integration Tests > Nonce replay protection > should prevent nonce reuse
2401
- [AUDIT] {"event":"runtime_initialized","data":{"did":"did:key:z-bMdycC8zJjTaoBLp9NJvCZNWmY7RoHU","environment":"development","userDidGeneration":"disabled"},"timestamp":1764810916654,"timestampFormatted":"2025-12-04T01:15:16.654Z"}
2402
-
2403
- stdout | src/__tests__/integration.test.ts > Integration Tests > Error handling > should handle network errors gracefully
2404
- [AUDIT] {"event":"runtime_initialized","data":{"did":"did:key:zvjDTDtmeSU_LyKrdgPpebIMABTtLusYo","environment":"development","userDidGeneration":"disabled"},"timestamp":1764810916655,"timestampFormatted":"2025-12-04T01:15:16.655Z"}
2405
-
2406
- stdout | src/__tests__/integration.test.ts > Integration Tests > Error handling > should handle malformed DID documents
2407
- [AUDIT] {"event":"runtime_initialized","data":{"did":"did:key:zM1uMfox_m4C1uLwchCsq_5RlBIwedwHi","environment":"development","userDidGeneration":"disabled"},"timestamp":1764810916655,"timestampFormatted":"2025-12-04T01:15:16.655Z"}
2408
-
2409
- stdout | src/__tests__/integration.test.ts > Integration Tests > Debug endpoint > should provide debug information in development
2410
- [AUDIT] {"event":"runtime_initialized","data":{"did":"did:key:zuUj7R0sDPxGWTIxawj6KwOPRikFwJzeW","environment":"development","userDidGeneration":"disabled"},"timestamp":1764810916655,"timestampFormatted":"2025-12-04T01:15:16.655Z"}
2411
-
2412
- stdout | src/__tests__/integration.test.ts > Integration Tests > Debug endpoint > should be disabled in production
2413
- [AUDIT] {"event":"runtime_initialized","data":{"did":"did:key:z4w9GuVqb6B_X5NrINMq5kdtplydG9yFa","environment":"development","userDidGeneration":"disabled"},"timestamp":1764810916656,"timestampFormatted":"2025-12-04T01:15:16.656Z"}
2414
-
2415
- ✓ src/services/__tests__/proof-verifier.test.ts (21 tests) 14ms
2416
- ✓ src/__tests__/integration.test.ts (9 tests) 24ms
2417
- stdout | src/__tests__/services/tool-protection.service.test.ts > ToolProtectionService > getToolProtectionConfig > API fetch - merged config format > should fetch from project-scoped /config endpoint when projectId is available
2418
- [ToolProtectionService] Config loaded from API {
2419
- source: 'api',
2420
- toolCount: 2,
2421
- protectedTools: [ 'checkout' ],
2422
- agentDid: 'did:key:z6MkhaXgBZDv...',
2423
- projectId: 'test-project-123',
2424
- cacheTtlMs: 300000,
2425
- cacheExpiresAt: '2025-12-04T01:20:16.668Z'
2426
- }
2427
-
2428
- ✓ src/__tests__/runtime/delegation-flow.test.ts (4 tests) 6ms
2429
- stdout | src/__tests__/services/tool-protection.service.test.ts > ToolProtectionService > getToolProtectionConfig > API fetch - merged config format > should handle new endpoint format with toolProtections object
2430
- [ToolProtectionService] Config loaded from API {
2431
- source: 'api',
2432
- toolCount: 2,
2433
- protectedTools: [ 'protected_tool' ],
2434
- agentDid: 'did:key:z6MkhaXgBZDv...',
2435
- projectId: 'test-project-123',
2436
- cacheTtlMs: 300000,
2437
- cacheExpiresAt: '2025-12-04T01:20:16.732Z'
2438
- }
2439
-
2440
- stdout | src/__tests__/services/tool-protection.service.test.ts > ToolProtectionService > getToolProtectionConfig > API fetch - merged config format > should parse oauthProvider from new endpoint format (Phase 2)
2441
- [ToolProtectionService] Config loaded from API {
2442
- source: 'api',
2443
- toolCount: 2,
2444
- protectedTools: [ 'read_repos', 'send_email' ],
2445
- agentDid: 'did:key:z6MkhaXgBZDv...',
2446
- projectId: 'test-project-123',
2447
- cacheTtlMs: 300000,
2448
- cacheExpiresAt: '2025-12-04T01:20:16.732Z'
2449
- }
2450
-
2451
- stdout | src/__tests__/services/tool-protection.service.test.ts > ToolProtectionService > getToolProtectionConfig > API fetch - merged config format > should preserve oauthProvider through cache operations
2452
- [ToolProtectionService] Config loaded from API {
2453
- source: 'api',
2454
- toolCount: 1,
2455
- protectedTools: [ 'read_repos' ],
2456
- agentDid: 'did:key:z6MkhaXgBZDv...',
2457
- projectId: 'test-project-123',
2458
- cacheTtlMs: 300000,
2459
- cacheExpiresAt: '2025-12-04T01:20:16.861Z'
2460
- }
2461
-
2462
- 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
2463
- [ToolProtectionService] Config loaded from API {
2464
- source: 'api',
2465
- toolCount: 2,
2466
- protectedTools: [ 'checkout' ],
2467
- agentDid: 'did:key:z6MkhaXgBZDv...',
2468
- projectId: 'none',
2469
- cacheTtlMs: 300000,
2470
- cacheExpiresAt: '2025-12-04T01:20:16.869Z'
2471
- }
2472
-
2473
- stdout | src/__tests__/services/tool-protection.service.test.ts > ToolProtectionService > getToolProtectionConfig > API fetch - old endpoint format > should handle old endpoint format with tools array
2474
- [ToolProtectionService] Config loaded from API {
2475
- source: 'api',
2476
- toolCount: 2,
2477
- protectedTools: [ 'tool1' ],
2478
- agentDid: 'did:key:z6MkhaXgBZDv...',
2479
- projectId: 'none',
2480
- cacheTtlMs: 300000,
2481
- cacheExpiresAt: '2025-12-04T01:20:16.870Z'
2482
- }
2483
-
2484
- 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)
2485
- [ToolProtectionService] Config loaded from API {
2486
- source: 'api',
2487
- toolCount: 2,
2488
- protectedTools: [ 'read_repos', 'send_email' ],
2489
- agentDid: 'did:key:z6MkhaXgBZDv...',
2490
- projectId: 'none',
2491
- cacheTtlMs: 300000,
2492
- cacheExpiresAt: '2025-12-04T01:20:16.870Z'
2493
- }
2494
-
2495
- stdout | src/__tests__/services/tool-protection.service.test.ts > ToolProtectionService > getToolProtectionConfig > API fetch - old endpoint format > should handle old endpoint format with tools object
2496
- [ToolProtectionService] Config loaded from API {
2497
- source: 'api',
2498
- toolCount: 2,
2499
- protectedTools: [ 'tool1' ],
2500
- agentDid: 'did:key:z6MkhaXgBZDv...',
2501
- projectId: 'none',
2502
- cacheTtlMs: 300000,
2503
- cacheExpiresAt: '2025-12-04T01:20:16.870Z'
2504
- }
2505
-
2506
- 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)
2507
- [ToolProtectionService] Config loaded from API {
2508
- source: 'api',
2509
- toolCount: 2,
2510
- protectedTools: [ 'read_repos', 'send_email' ],
2511
- agentDid: 'did:key:z6MkhaXgBZDv...',
2512
- projectId: 'none',
2513
- cacheTtlMs: 300000,
2514
- cacheExpiresAt: '2025-12-04T01:20:16.870Z'
2515
- }
2516
-
2517
- stdout | src/__tests__/services/tool-protection.service.test.ts > ToolProtectionService > getToolProtectionConfig > API fetch - old endpoint format > should skip tools without name in array format
2518
- [ToolProtectionService] Cache miss, fetching from API {
2519
- source: 'api-fetch-start',
2520
- cacheKey: 'agent:did:key:z6MkhaXgBZDvotDkL5257faiztiGiC2QtKLGpbnnEGta2doK',
2521
- agentDid: 'did:key:z6MkhaXgBZDv...',
2522
- projectId: 'none',
2523
- apiUrl: 'https://kya.vouched.id',
2524
- endpoint: '/api/v1/bouncer/config?agent_did=did:key:z6MkhaXgBZDvotDkL5257faiztiGiC2QtKLGpbnnEGta2doK'
2525
- }
2526
- [ToolProtectionService] Fetching from API: https://kya.vouched.id/api/v1/bouncer/config?agent_did=did%3Akey%3Az6MkhaXgBZDvotDkL5257faiztiGiC2QtKLGpbnnEGta2doK {
2527
- method: 'config?agent_did (legacy)',
2528
- projectId: 'none',
2529
- apiKeyPresent: true,
2530
- apiKeyLength: 18,
2531
- apiKeyMasked: 'test-api...'
2532
- }
2533
-
2534
- stdout | src/__tests__/services/tool-protection.service.test.ts > ToolProtectionService > getToolProtectionConfig > API fetch - old endpoint format > should skip tools without name in array format
2535
- [ToolProtectionService] API response received {
2536
- source: 'api-fetch-complete',
2537
- agentDid: 'did:key:z6MkhaXgBZDv...',
2538
- projectId: 'none',
2539
- responseKeys: [ 'success', 'data', 'metadata' ],
2540
- dataKeys: [ 'tools' ],
2541
- rawConfig: null,
2542
- rawConfigToolProtection: null,
2543
- rawToolProtections: null,
2544
- rawTools: [
2545
- { name: 'valid_tool', requiresDelegation: true },
2546
- { requiresDelegation: false }
2547
- ],
2548
- responseMetadata: {}
2549
- }
2550
-
2551
- stdout | src/__tests__/services/tool-protection.service.test.ts > ToolProtectionService > getToolProtectionConfig > API fetch - old endpoint format > should skip tools without name in array format
2552
- [ToolProtectionService] Config loaded from API {
2553
- source: 'api',
2554
- toolCount: 1,
2555
- protectedTools: [ 'valid_tool' ],
2556
- agentDid: 'did:key:z6MkhaXgBZDv...',
2557
- projectId: 'none',
2558
- cacheTtlMs: 300000,
2559
- cacheExpiresAt: '2025-12-04T01:20:16.873Z'
2560
- }
2561
- [ToolProtectionService] API fetch successful, config cached {
2562
- source: 'cache-write',
2563
- agentDid: 'did:key:z6MkhaXgBZDv...',
2564
- cacheKey: 'agent:did:key:z6MkhaXgBZDvotDkL5257faiztiGiC2QtKLGpbnnEGta2doK',
2565
- toolCount: 1,
2566
- tools: [ { name: 'valid_tool', requiresDelegation: true, scopeCount: 0 } ],
2567
- ttlMs: 300000,
2568
- ttlMinutes: 5,
2569
- expiresAt: '2025-12-04T01:20:16.873Z',
2570
- expiresIn: '300s'
2571
- }
2572
-
2573
- stderr | src/__tests__/services/tool-protection.service.test.ts > ToolProtectionService > getToolProtectionConfig > API fetch error handling > should handle network errors gracefully
2574
- [ToolProtectionService] API fetch failed, no fallback, failing closed (deny-all) {
2575
- agentDid: 'did:key:z6MkhaXgBZDv...',
2576
- error: 'ECONNREFUSED',
2577
- cacheKey: 'agent:did:key:z6MkhaXgBZDvotDkL5257faiztiGiC2QtKLGpbnnEGta2doK'
2578
- }
2579
-
2580
- stdout | src/__tests__/services/tool-protection.service.test.ts > ToolProtectionService > getToolProtectionConfig > caching behavior > should cache successful API responses
2581
- [ToolProtectionService] Config loaded from API {
2582
- source: 'api',
2583
- toolCount: 1,
2584
- protectedTools: [ 'tool1' ],
2585
- agentDid: 'did:key:z6MkhaXgBZDv...',
2586
- projectId: 'none',
2587
- cacheTtlMs: 300000,
2588
- cacheExpiresAt: '2025-12-04T01:20:16.929Z'
2589
- }
2590
-
2591
- stdout | src/__tests__/services/tool-protection.service.test.ts > ToolProtectionService > getToolProtectionConfig > caching behavior > should use default cache TTL when not specified
2592
- [ToolProtectionService] Config loaded from API {
2593
- source: 'api',
2594
- toolCount: 0,
2595
- protectedTools: [],
2596
- agentDid: 'did:key:z6MkhaXgBZDv...',
2597
- projectId: 'none',
2598
- cacheTtlMs: 300000,
2599
- cacheExpiresAt: '2025-12-04T01:20:16.929Z'
2600
- }
2601
-
2602
- stdout | src/__tests__/services/tool-protection.service.test.ts > ToolProtectionService > getToolProtectionConfig > caching behavior > should use custom cache TTL when specified
2603
- [ToolProtectionService] Config loaded from API {
2604
- source: 'api',
2605
- toolCount: 0,
2606
- protectedTools: [],
2607
- agentDid: 'did:key:z6MkhaXgBZDv...',
2608
- projectId: 'none',
2609
- cacheTtlMs: 600000,
2610
- cacheExpiresAt: '2025-12-04T01:25:16.930Z'
2611
- }
2612
-
2613
- stdout | src/__tests__/services/tool-protection.service.test.ts > ToolProtectionService > getToolProtectionConfig > edge cases > should handle empty toolProtections object
2614
- [ToolProtectionService] Config loaded from API {
2615
- source: 'api',
2616
- toolCount: 0,
2617
- protectedTools: [],
2618
- agentDid: 'did:key:z6MkhaXgBZDv...',
2619
- projectId: 'none',
2620
- cacheTtlMs: 300000,
2621
- cacheExpiresAt: '2025-12-04T01:20:16.931Z'
2622
- }
2623
-
2624
- stdout | src/__tests__/services/tool-protection.service.test.ts > ToolProtectionService > getToolProtectionConfig > edge cases > should handle null requiredScopes
2625
- [ToolProtectionService] Config loaded from API {
2626
- source: 'api',
2627
- toolCount: 1,
2628
- protectedTools: [ 'tool1' ],
2629
- agentDid: 'did:key:z6MkhaXgBZDv...',
2630
- projectId: 'none',
2631
- cacheTtlMs: 300000,
2632
- cacheExpiresAt: '2025-12-04T01:20:16.936Z'
2633
- }
2634
-
2635
- stdout | src/__tests__/services/tool-protection.service.test.ts > ToolProtectionService > getToolProtectionConfig > edge cases > should handle mixed camelCase and snake_case in response
2636
- stderr | src/__tests__/services/tool-protection.service.test.ts > ToolProtectionService > checkToolProtection > should use wildcard protection in fail-safe deny-all mode
2637
- [ToolProtectionService] Config loaded from API {
2638
- source: 'api',
2639
- [ToolProtectionService] API fetch failed, no fallback, failing closed (deny-all) {
2640
- toolCount: 2,
2641
- protectedTools: [ 'tool1' ],
2642
- agentDid: 'did:key:z6MkhaXgBZDv...',
2643
- projectId: 'none',
2644
- cacheTtlMs: 300000,
2645
- agentDid: 'did:key:z6MkhaXgBZDv...',
2646
- cacheExpiresAt: '2025-12-04T01:20:16.936Z'
2647
- error: 'Network error',
2648
- }
2649
-
2650
- stdout | src/__tests__/services/tool-protection.service.test.ts > ToolProtectionService > checkToolProtection > should return null when tool has no protection
2651
- [ToolProtectionService] Config loaded from API {
2652
- cacheKey: 'agent:did:key:z6MkhaXgBZDvotDkL5257faiztiGiC2QtKLGpbnnEGta2doK'
2653
- source: 'api',
2654
- toolCount: 1,
2655
- protectedTools: [],
2656
- agentDid: 'did:key:z6MkhaXgBZDv...',
2657
- }
2658
- projectId: 'none',
2659
-
2660
- cacheTtlMs: 300000,
2661
- cacheExpiresAt: '2025-12-04T01:20:16.937Z'
2662
- }
2663
-
2664
- stdout | src/__tests__/services/tool-protection.service.test.ts > ToolProtectionService > checkToolProtection > should return null when tool is not in config
2665
- [ToolProtectionService] Config loaded from API {
2666
- source: 'api',
2667
- toolCount: 1,
2668
- protectedTools: [ 'other_tool' ],
2669
- agentDid: 'did:key:z6MkhaXgBZDv...',
2670
- projectId: 'none',
2671
- cacheTtlMs: 300000,
2672
- cacheExpiresAt: '2025-12-04T01:20:16.937Z'
2673
- }
2674
-
2675
- stdout | src/__tests__/services/tool-protection.service.test.ts > ToolProtectionService > checkToolProtection > should return null when tool is not in config
2676
- [ToolProtectionService] Protection check {
2677
- tool: 'unknown_tool',
2678
- agentDid: 'did:key:z6MkhaXgBZDv...',
2679
- found: false,
2680
- isWildcard: true,
2681
- requiresDelegation: false,
2682
- availableTools: [ 'other_tool' ]
2683
- }
2684
-
2685
- stdout | src/__tests__/services/tool-protection.service.test.ts > ToolProtectionService > checkToolProtection > should return wildcard protection when tool not found and wildcard exists
2686
- [ToolProtectionService] Config loaded from API {
2687
- source: 'api',
2688
- toolCount: 2,
2689
- protectedTools: [ '*' ],
2690
- agentDid: 'did:key:z6MkhaXgBZDv...',
2691
- projectId: 'none',
2692
- cacheTtlMs: 300000,
2693
- cacheExpiresAt: '2025-12-04T01:20:16.937Z'
2694
- }
2695
-
2696
- stdout | src/__tests__/services/tool-protection.service.test.ts > ToolProtectionService > checkToolProtection > should return wildcard protection when tool not found and wildcard exists
2697
- [ToolProtectionService] Protection check {
2698
- tool: 'unknown_tool',
2699
- agentDid: 'did:key:z6MkhaXgBZDv...',
2700
- found: true,
2701
- isWildcard: true,
2702
- requiresDelegation: true,
2703
- availableTools: [ '*', 'specific_tool' ]
2704
- }
2705
-
2706
- stdout | src/__tests__/services/tool-protection.service.test.ts > ToolProtectionService > checkToolProtection > should prioritize specific tool protection over wildcard
2707
- [ToolProtectionService] Config loaded from API {
2708
- source: 'api',
2709
- toolCount: 2,
2710
- protectedTools: [ '*' ],
2711
- agentDid: 'did:key:z6MkhaXgBZDv...',
2712
- projectId: 'none',
2713
- cacheTtlMs: 300000,
2714
- cacheExpiresAt: '2025-12-04T01:20:16.937Z'
2715
- }
2716
-
2717
- stdout | src/__tests__/services/tool-protection.service.test.ts > ToolProtectionService > checkToolProtection > should use wildcard protection in fail-safe deny-all mode
2718
- [ToolProtectionService] Protection check {
2719
- tool: 'any_tool',
2720
- agentDid: 'did:key:z6MkhaXgBZDv...',
2721
- found: true,
2722
- isWildcard: true,
2723
- requiresDelegation: true,
2724
- availableTools: [ '*' ]
2725
- }
2726
-
2727
- stdout | src/__tests__/services/tool-protection.service.test.ts > ToolProtectionService > checkToolProtection > should return protection config when tool requires delegation
2728
- [ToolProtectionService] Config loaded from API {
2729
- source: 'api',
2730
- toolCount: 1,
2731
- protectedTools: [ 'protected_tool' ],
2732
- agentDid: 'did:key:z6MkhaXgBZDv...',
2733
- projectId: 'none',
2734
- cacheTtlMs: 300000,
2735
- cacheExpiresAt: '2025-12-04T01:20:16.937Z'
2736
- }
2737
-
2738
- stdout | src/__tests__/services/tool-protection.service.test.ts > ToolProtectionService > checkToolProtection > should return protection config when tool requires delegation
2739
- [ToolProtectionService] Protection check {
2740
- tool: 'protected_tool',
2741
- agentDid: 'did:key:z6MkhaXgBZDv...',
2742
- found: true,
2743
- isWildcard: false,
2744
- requiresDelegation: true,
2745
- availableTools: [ 'protected_tool' ]
2746
- }
2747
-
2748
- stdout | src/__tests__/services/tool-protection.service.test.ts > ToolProtectionService > integration with NoOpToolProtectionCache > should work with NoOpToolProtectionCache
2749
- [ToolProtectionService] Config loaded from API {
2750
- source: 'api',
2751
- toolCount: 1,
2752
- protectedTools: [ 'tool1' ],
2753
- agentDid: 'did:key:z6MkhaXgBZDv...',
2754
- projectId: 'none',
2755
- cacheTtlMs: 300000,
2756
- cacheExpiresAt: '2025-12-04T01:20:16.938Z'
2757
- }
2758
-
2759
- stdout | src/__tests__/services/tool-protection.service.test.ts > ToolProtectionService > integration with NoOpToolProtectionCache > should work with NoOpToolProtectionCache
2760
- [ToolProtectionService] Config loaded from API {
2761
- source: 'api',
2762
- toolCount: 1,
2763
- protectedTools: [ 'tool1' ],
2764
- agentDid: 'did:key:z6MkhaXgBZDv...',
2765
- projectId: 'none',
2766
- cacheTtlMs: 300000,
2767
- cacheExpiresAt: '2025-12-04T01:20:16.938Z'
2768
- }
2769
-
2770
- ✓ src/__tests__/runtime/route-interception.test.ts (21 tests) 274ms
2771
- ✓ src/__tests__/services/tool-protection.service.test.ts (49 tests) 307ms
2772
- ✓ src/services/__tests__/oauth-provider-registry.test.ts (9 tests) 19ms
2773
- stderr | src/config/__tests__/remote-config.spec.ts > fetchRemoteConfig > Error handling > should return null if API request fails
2774
- [RemoteConfig] API returned 404: Not Found
2775
-
2776
- stderr | src/config/__tests__/remote-config.spec.ts > fetchRemoteConfig > Error handling > should return null if API throws error
2777
- [RemoteConfig] Failed to fetch config: Error: Network error
2778
- at /Users/dylanhobbs/Documents/@kya-os/xmcp-i/packages/mcp-i-core/src/config/__tests__/remote-config.spec.ts:170:35
2779
- at file:///Users/dylanhobbs/Documents/@kya-os/xmcp-i/node_modules/.pnpm/@vitest+runner@4.0.14/node_modules/@vitest/runner/dist/index.js:145:11
2780
- at file:///Users/dylanhobbs/Documents/@kya-os/xmcp-i/node_modules/.pnpm/@vitest+runner@4.0.14/node_modules/@vitest/runner/dist/index.js:919:26
2781
- at file:///Users/dylanhobbs/Documents/@kya-os/xmcp-i/node_modules/.pnpm/@vitest+runner@4.0.14/node_modules/@vitest/runner/dist/index.js:1244:20
2782
- at new Promise (<anonymous>)
2783
- at runWithTimeout (file:///Users/dylanhobbs/Documents/@kya-os/xmcp-i/node_modules/.pnpm/@vitest+runner@4.0.14/node_modules/@vitest/runner/dist/index.js:1210:10)
2784
- at file:///Users/dylanhobbs/Documents/@kya-os/xmcp-i/node_modules/.pnpm/@vitest+runner@4.0.14/node_modules/@vitest/runner/dist/index.js:1654:37
2785
- at Traces.$ (file:///Users/dylanhobbs/Documents/@kya-os/xmcp-i/node_modules/.pnpm/vitest@4.0.14_@opentelemetry+api@1.9.0_@types+node@20.19.25_jiti@2.6.1_lightningcss@1.3_3f67c307998c5928f2f2aae3bf45ed95/node_modules/vitest/dist/chunks/traces.U4xDYhzZ.js:115:27)
2786
- at trace (file:///Users/dylanhobbs/Documents/@kya-os/xmcp-i/node_modules/.pnpm/vitest@4.0.14_@opentelemetry+api@1.9.0_@types+node@20.19.25_jiti@2.6.1_lightningcss@1.3_3f67c307998c5928f2f2aae3bf45ed95/node_modules/vitest/dist/chunks/test.DqQZzsWf.js:234:21)
2787
- at runTest (file:///Users/dylanhobbs/Documents/@kya-os/xmcp-i/node_modules/.pnpm/@vitest+runner@4.0.14/node_modules/@vitest/runner/dist/index.js:1654:12)
2788
-
2789
- stderr | src/config/__tests__/remote-config.spec.ts > fetchRemoteConfig > Error handling > should return null if neither projectId nor agentDid provided
2790
- [RemoteConfig] Neither projectId nor agentDid provided
2791
-
2792
- stderr | src/config/__tests__/remote-config.spec.ts > fetchRemoteConfig > Error handling > should handle cache read errors gracefully
2793
- [RemoteConfig] Cache read failed: Error: Cache error
2794
- at /Users/dylanhobbs/Documents/@kya-os/xmcp-i/packages/mcp-i-core/src/config/__tests__/remote-config.spec.ts:198:50
2795
- at file:///Users/dylanhobbs/Documents/@kya-os/xmcp-i/node_modules/.pnpm/@vitest+runner@4.0.14/node_modules/@vitest/runner/dist/index.js:145:11
2796
- at file:///Users/dylanhobbs/Documents/@kya-os/xmcp-i/node_modules/.pnpm/@vitest+runner@4.0.14/node_modules/@vitest/runner/dist/index.js:919:26
2797
- at file:///Users/dylanhobbs/Documents/@kya-os/xmcp-i/node_modules/.pnpm/@vitest+runner@4.0.14/node_modules/@vitest/runner/dist/index.js:1244:20
2798
- at new Promise (<anonymous>)
2799
- at runWithTimeout (file:///Users/dylanhobbs/Documents/@kya-os/xmcp-i/node_modules/.pnpm/@vitest+runner@4.0.14/node_modules/@vitest/runner/dist/index.js:1210:10)
2800
- at file:///Users/dylanhobbs/Documents/@kya-os/xmcp-i/node_modules/.pnpm/@vitest+runner@4.0.14/node_modules/@vitest/runner/dist/index.js:1654:37
2801
- at Traces.$ (file:///Users/dylanhobbs/Documents/@kya-os/xmcp-i/node_modules/.pnpm/vitest@4.0.14_@opentelemetry+api@1.9.0_@types+node@20.19.25_jiti@2.6.1_lightningcss@1.3_3f67c307998c5928f2f2aae3bf45ed95/node_modules/vitest/dist/chunks/traces.U4xDYhzZ.js:115:27)
2802
- at trace (file:///Users/dylanhobbs/Documents/@kya-os/xmcp-i/node_modules/.pnpm/vitest@4.0.14_@opentelemetry+api@1.9.0_@types+node@20.19.25_jiti@2.6.1_lightningcss@1.3_3f67c307998c5928f2f2aae3bf45ed95/node_modules/vitest/dist/chunks/test.DqQZzsWf.js:234:21)
2803
- at runTest (file:///Users/dylanhobbs/Documents/@kya-os/xmcp-i/node_modules/.pnpm/@vitest+runner@4.0.14/node_modules/@vitest/runner/dist/index.js:1654:12)
2804
-
2805
- ✓ src/config/__tests__/remote-config.spec.ts (9 tests) 5ms
2806
- ✓ src/delegation/__tests__/cascading-revocation.test.ts (23 tests) 10ms
2807
- ✓ src/delegation/__tests__/vc-verifier.test.ts (35 tests) 12ms
2808
- stdout | src/__tests__/services/cache-busting.test.ts > Cache Busting in clearAndRefresh > clearAndRefresh should call fetchFromApi with bypassCDNCache: true
2809
- [ToolProtectionService] clearAndRefresh starting {
2810
- cacheKey: 'config:tool-protections:test-project-123',
2811
- projectId: 'test-project-123',
2812
- agentDid: 'did:key:test-agent...'
2813
- }
2814
-
2815
- stdout | src/__tests__/services/cache-busting.test.ts > Cache Busting in clearAndRefresh > clearAndRefresh should call fetchFromApi with bypassCDNCache: true
2816
- [ToolProtectionService] Cache entry deleted { cacheKey: 'config:tool-protections:test-project-123' }
2817
-
2818
- stdout | src/__tests__/services/cache-busting.test.ts > Cache Busting in clearAndRefresh > clearAndRefresh should call fetchFromApi with bypassCDNCache: true
2819
- [ToolProtectionService] Fresh config fetched and cached {
2820
- cacheKey: 'config:tool-protections:test-project-123',
2821
- toolCount: 1,
2822
- protectedTools: [ 'greet' ],
2823
- source: 'api'
2824
- }
2825
-
2826
- stdout | src/__tests__/services/cache-busting.test.ts > Cache Busting in clearAndRefresh > fetchFromApi should add cache-busting query param when bypassCDNCache is true
2827
- [ToolProtectionService] Fetching from API: https://test.agentshield.com/api/v1/bouncer/projects/test-project-123/config?_t=1764810917475 {
2828
- method: 'projects/{projectId}/config (merged)',
2829
- projectId: 'test-project-123',
2830
- apiKeyPresent: true,
2831
- apiKeyLength: 12,
2832
- apiKeyMasked: 'test-api...'
2833
- }
2834
-
2835
- stdout | src/__tests__/services/cache-busting.test.ts > Cache Busting in clearAndRefresh > fetchFromApi should add Cache-Control headers when bypassCDNCache is true
2836
- [ToolProtectionService] Fetching from API: https://test.agentshield.com/api/v1/bouncer/projects/test-project-123/config?_t=1764810917475 {
2837
- method: 'projects/{projectId}/config (merged)',
2838
- projectId: 'test-project-123',
2839
- apiKeyPresent: true,
2840
- apiKeyLength: 12,
2841
- apiKeyMasked: 'test-api...'
2842
- }
2843
-
2844
- stdout | src/__tests__/services/cache-busting.test.ts > Cache Busting in clearAndRefresh > fetchFromApi should NOT add cache-busting when bypassCDNCache is false/undefined
2845
- [ToolProtectionService] Fetching from API: https://test.agentshield.com/api/v1/bouncer/projects/test-project-123/config {
2846
- method: 'projects/{projectId}/config (merged)',
2847
- projectId: 'test-project-123',
2848
- apiKeyPresent: true,
2849
- apiKeyLength: 12,
2850
- apiKeyMasked: 'test-api...'
2851
- }
2852
-
2853
- stdout | src/__tests__/services/cache-busting.test.ts > Cache Busting in clearAndRefresh > cache should be empty after clearAndRefresh deletes it
2854
- [ToolProtectionService] clearAndRefresh starting {
2855
- cacheKey: 'config:tool-protections:test-project-123',
2856
- projectId: 'test-project-123',
2857
- agentDid: 'did:key:test-agent...'
2858
- }
2859
-
2860
- stdout | src/__tests__/services/cache-busting.test.ts > Cache Busting in clearAndRefresh > cache should be empty after clearAndRefresh deletes it
2861
- [ToolProtectionService] Cache entry deleted { cacheKey: 'config:tool-protections:test-project-123' }
2862
-
2863
- stdout | src/__tests__/services/cache-busting.test.ts > Cache Busting in clearAndRefresh > cache should be empty after clearAndRefresh deletes it
2864
- [ToolProtectionService] Fresh config fetched and cached {
2865
- cacheKey: 'config:tool-protections:test-project-123',
2866
- toolCount: 0,
2867
- protectedTools: [],
2868
- source: 'api'
2869
- }
2870
-
2871
- ✓ src/__tests__/services/cache-busting.test.ts (5 tests) 4ms
2872
- stderr | src/__tests__/identity/user-did-manager.test.ts > UserDidManager > error handling > should handle storage.get errors gracefully (Phase 5)
2873
- [UserDidManager] Storage.get failed: Error: Storage error
2874
- at /Users/dylanhobbs/Documents/@kya-os/xmcp-i/packages/mcp-i-core/src/__tests__/identity/user-did-manager.test.ts:206:67
2875
- at file:///Users/dylanhobbs/Documents/@kya-os/xmcp-i/node_modules/.pnpm/@vitest+runner@4.0.14/node_modules/@vitest/runner/dist/index.js:145:11
2876
- at file:///Users/dylanhobbs/Documents/@kya-os/xmcp-i/node_modules/.pnpm/@vitest+runner@4.0.14/node_modules/@vitest/runner/dist/index.js:919:26
2877
- at file:///Users/dylanhobbs/Documents/@kya-os/xmcp-i/node_modules/.pnpm/@vitest+runner@4.0.14/node_modules/@vitest/runner/dist/index.js:1244:20
2878
- at new Promise (<anonymous>)
2879
- at runWithTimeout (file:///Users/dylanhobbs/Documents/@kya-os/xmcp-i/node_modules/.pnpm/@vitest+runner@4.0.14/node_modules/@vitest/runner/dist/index.js:1210:10)
2880
- at file:///Users/dylanhobbs/Documents/@kya-os/xmcp-i/node_modules/.pnpm/@vitest+runner@4.0.14/node_modules/@vitest/runner/dist/index.js:1654:37
2881
- at Traces.$ (file:///Users/dylanhobbs/Documents/@kya-os/xmcp-i/node_modules/.pnpm/vitest@4.0.14_@opentelemetry+api@1.9.0_@types+node@20.19.25_jiti@2.6.1_lightningcss@1.3_3f67c307998c5928f2f2aae3bf45ed95/node_modules/vitest/dist/chunks/traces.U4xDYhzZ.js:115:27)
2882
- at trace (file:///Users/dylanhobbs/Documents/@kya-os/xmcp-i/node_modules/.pnpm/vitest@4.0.14_@opentelemetry+api@1.9.0_@types+node@20.19.25_jiti@2.6.1_lightningcss@1.3_3f67c307998c5928f2f2aae3bf45ed95/node_modules/vitest/dist/chunks/test.DqQZzsWf.js:234:21)
2883
- at runTest (file:///Users/dylanhobbs/Documents/@kya-os/xmcp-i/node_modules/.pnpm/@vitest+runner@4.0.14/node_modules/@vitest/runner/dist/index.js:1654:12)
2884
-
2885
- stderr | src/__tests__/identity/user-did-manager.test.ts > UserDidManager > error handling > should handle storage.delete errors gracefully
2886
- [UserDidManager] Storage.delete failed, continuing: Error: Storage error
2887
- at /Users/dylanhobbs/Documents/@kya-os/xmcp-i/packages/mcp-i-core/src/__tests__/identity/user-did-manager.test.ts:225:70
2888
- at processTicksAndRejections (node:internal/process/task_queues:103:5)
2889
- at file:///Users/dylanhobbs/Documents/@kya-os/xmcp-i/node_modules/.pnpm/@vitest+runner@4.0.14/node_modules/@vitest/runner/dist/index.js:919:20
2890
-
2891
- stdout | src/__tests__/regression/phase2-regression.test.ts > Phase 2 Regression Tests > Backward Compatibility > Phase 1 tools (no oauthProvider) > should work with Phase 1 tools that don't specify oauthProvider
2892
- [ToolProtectionService] Config loaded from API {
2893
- source: 'api',
2894
- toolCount: 1,
2895
- protectedTools: [ 'phase1_tool' ],
2896
- agentDid: 'did:key:z6MkhaXgBZDv...',
2897
- projectId: 'none',
2898
- cacheTtlMs: 300000,
2899
- cacheExpiresAt: '2025-12-04T01:20:17.480Z'
2900
- }
2901
-
2902
- ✓ src/delegation/__tests__/delegation-graph.test.ts (28 tests) 11ms
2903
- ✓ src/__tests__/identity/user-did-manager.test.ts (17 tests) 7ms
2904
- 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)
2905
- [ToolProtectionService] Config loaded from API {
2906
- source: 'api',
2907
- stderr | src/__tests__/regression/phase2-regression.test.ts > Phase 2 Regression Tests > No Regressions > Phase 1 OAuth flow > should still work with Phase 1 OAuth flow (no oauthProvider)
2908
- toolCount: 1,
2909
- protectedTools: [ 'old_tool' ],
2910
- agentDid: 'did:key:z6MkhaXgBZDv...',
2911
- projectId: 'none',
2912
- [ProviderResolver] Tool does not specify oauthProvider. Using project-configured provider "github" as fallback. Consider explicitly setting oauthProvider in tool protection config.
2913
- cacheTtlMs: 300000,
2914
- cacheExpiresAt: '2025-12-04T01:20:17.484Z'
2915
- }
2916
-
2917
-
2918
- 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)
2919
- [ToolProtectionService] Config loaded from API {
2920
- source: 'api',
2921
- toolCount: 1,
2922
- protectedTools: [ 'old_tool' ],
2923
- agentDid: 'did:key:z6MkhaXgBZDv...',
2924
- projectId: 'none',
2925
- cacheTtlMs: 300000,
2926
- cacheExpiresAt: '2025-12-04T01:20:17.484Z'
2927
- }
2928
-
2929
- 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
2930
- [ToolProtectionService] Config loaded from API {
2931
- source: 'api',
2932
- toolCount: 1,
2933
- protectedTools: [ 'tool_with_snake_case' ],
2934
- agentDid: 'did:key:z6MkhaXgBZDv...',
2935
- projectId: 'test-project-123',
2936
- cacheTtlMs: 300000,
2937
- cacheExpiresAt: '2025-12-04T01:20:17.485Z'
2938
- }
2939
-
2940
- stdout | src/__tests__/regression/phase2-regression.test.ts > Phase 2 Regression Tests > Mixed Phase 1 and Phase 2 tools > should handle mix of Phase 1 and Phase 2 tools in same project
2941
- [ToolProtectionService] Config loaded from API {
2942
- source: 'api',
2943
- toolCount: 2,
2944
- protectedTools: [ 'phase1_tool', 'phase2_tool' ],
2945
- agentDid: 'did:key:z6MkhaXgBZDv...',
2946
- projectId: 'test-project-123',
2947
- cacheTtlMs: 300000,
2948
- cacheExpiresAt: '2025-12-04T01:20:17.486Z'
2949
- }
2950
-
2951
- stdout | src/__tests__/services/tool-protection-oauth-provider.test.ts > ToolProtectionService - oauthProvider Parsing > New endpoint format (toolProtections object) > should parse oauthProvider from camelCase field
2952
- [ToolProtectionService] Config loaded from API {
2953
- source: 'api',
2954
- toolCount: 2,
2955
- protectedTools: [ 'read_repos', 'send_email' ],
2956
- agentDid: 'did:key:z6MkhaXgBZDv...',
2957
- projectId: 'test-project-123',
2958
- cacheTtlMs: 300000,
2959
- cacheExpiresAt: '2025-12-04T01:20:17.483Z'
2960
- }
2961
-
2962
- 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
2963
- [ToolProtectionService] Config loaded from API {
2964
- source: 'api',
2965
- toolCount: 1,
2966
- protectedTools: [ 'read_repos' ],
2967
- agentDid: 'did:key:z6MkhaXgBZDv...',
2968
- projectId: 'test-project-123',
2969
- cacheTtlMs: 300000,
2970
- cacheExpiresAt: '2025-12-04T01:20:17.485Z'
2971
- }
2972
-
2973
- 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
2974
- [ToolProtectionService] Config loaded from API {
2975
- source: 'api',
2976
- toolCount: 1,
2977
- protectedTools: [ 'read_repos' ],
2978
- agentDid: 'did:key:z6MkhaXgBZDv...',
2979
- projectId: 'test-project-123',
2980
- cacheTtlMs: 300000,
2981
- cacheExpiresAt: '2025-12-04T01:20:17.485Z'
2982
- }
2983
-
2984
- 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)
2985
- [ToolProtectionService] Config loaded from API {
2986
- source: 'api',
2987
- toolCount: 1,
2988
- protectedTools: [ 'read_repos' ],
2989
- agentDid: 'did:key:z6MkhaXgBZDv...',
2990
- projectId: 'test-project-123',
2991
- cacheTtlMs: 300000,
2992
- cacheExpiresAt: '2025-12-04T01:20:17.486Z'
2993
- }
2994
-
2995
- 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
2996
- [ToolProtectionService] Config loaded from API {
2997
- source: 'api',
2998
- toolCount: 2,
2999
- protectedTools: [ 'read_repos', 'send_email' ],
3000
- agentDid: 'did:key:z6MkhaXgBZDv...',
3001
- projectId: 'none',
3002
- cacheTtlMs: 300000,
3003
- cacheExpiresAt: '2025-12-04T01:20:17.486Z'
3004
- }
3005
-
3006
- 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
3007
- [ToolProtectionService] Config loaded from API {
3008
- source: 'api',
3009
- toolCount: 1,
3010
- protectedTools: [ 'read_repos' ],
3011
- agentDid: 'did:key:z6MkhaXgBZDv...',
3012
- projectId: 'none',
3013
- cacheTtlMs: 300000,
3014
- cacheExpiresAt: '2025-12-04T01:20:17.487Z'
3015
- }
3016
-
3017
- 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
3018
- [ToolProtectionService] Config loaded from API {
3019
- source: 'api',
3020
- toolCount: 1,
3021
- protectedTools: [ 'read_repos' ],
3022
- agentDid: 'did:key:z6MkhaXgBZDv...',
3023
- projectId: 'none',
3024
- cacheTtlMs: 300000,
3025
- cacheExpiresAt: '2025-12-04T01:20:17.487Z'
3026
- }
3027
-
3028
- ✓ src/__tests__/regression/phase2-regression.test.ts (12 tests) 7ms
3029
- 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
3030
- [ToolProtectionService] Config loaded from API {
3031
- source: 'api',
3032
- toolCount: 2,
3033
- protectedTools: [ 'read_repos', 'send_email' ],
3034
- agentDid: 'did:key:z6MkhaXgBZDv...',
3035
- projectId: 'none',
3036
- cacheTtlMs: 300000,
3037
- cacheExpiresAt: '2025-12-04T01:20:17.487Z'
3038
- }
3039
-
3040
- 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
3041
- [ToolProtectionService] Config loaded from API {
3042
- source: 'api',
3043
- toolCount: 1,
3044
- protectedTools: [ 'read_repos' ],
3045
- agentDid: 'did:key:z6MkhaXgBZDv...',
3046
- projectId: 'none',
3047
- cacheTtlMs: 300000,
3048
- cacheExpiresAt: '2025-12-04T01:20:17.487Z'
3049
- }
3050
-
3051
- 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
3052
- [ToolProtectionService] Config loaded from API {
3053
- source: 'api',
3054
- toolCount: 1,
3055
- protectedTools: [ 'read_repos' ],
3056
- agentDid: 'did:key:z6MkhaXgBZDv...',
3057
- projectId: 'none',
3058
- cacheTtlMs: 300000,
3059
- cacheExpiresAt: '2025-12-04T01:20:17.487Z'
3060
- }
3061
-
3062
- stdout | src/__tests__/services/tool-protection-oauth-provider.test.ts > ToolProtectionService - oauthProvider Parsing > Caching > should cache oauthProvider field correctly
3063
- [ToolProtectionService] Config loaded from API {
3064
- source: 'api',
3065
- toolCount: 1,
3066
- protectedTools: [ 'read_repos' ],
3067
- agentDid: 'did:key:z6MkhaXgBZDv...',
3068
- projectId: 'test-project-123',
3069
- cacheTtlMs: 300000,
3070
- cacheExpiresAt: '2025-12-04T01:20:17.487Z'
3071
- }
3072
-
3073
- 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
3074
- [ToolProtectionService] Config loaded from API {
3075
- source: 'api',
3076
- toolCount: 2,
3077
- protectedTools: [ 'tool_with_provider', 'tool_without_provider' ],
3078
- agentDid: 'did:key:z6MkhaXgBZDv...',
3079
- projectId: 'test-project-123',
3080
- cacheTtlMs: 300000,
3081
- cacheExpiresAt: '2025-12-04T01:20:17.488Z'
3082
- }
3083
-
3084
- stdout | src/__tests__/services/tool-protection-oauth-provider.test.ts > ToolProtectionService - oauthProvider Parsing > oauthProvider field inclusion > should handle empty string oauthProvider gracefully
3085
- [ToolProtectionService] Config loaded from API {
3086
- source: 'api',
3087
- toolCount: 1,
3088
- protectedTools: [ 'tool_with_empty_provider' ],
3089
- agentDid: 'did:key:z6MkhaXgBZDv...',
3090
- projectId: 'test-project-123',
3091
- cacheTtlMs: 300000,
3092
- cacheExpiresAt: '2025-12-04T01:20:17.488Z'
3093
- }
3094
-
3095
- ✓ src/__tests__/services/tool-protection-oauth-provider.test.ts (14 tests) 6ms
3096
- stderr | src/__tests__/services/provider-resolver-edge-cases.test.ts > ProviderResolver - Edge Cases > Scope inference edge cases (Priority 2) > should handle empty scopes array
3097
- stdout | src/__tests__/services/provider-resolver-edge-cases.test.ts > ProviderResolver - Edge Cases > Scope inference edge cases (Priority 2) > should verify gmail → google mapping works
3098
- [ProviderResolver] Inferred provider "google" from scopes
3099
-
3100
- 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
3101
- [ProviderResolver] Inferred provider "google" from scopes
3102
- [ProviderResolver] Tool does not specify oauthProvider. Using project-configured provider "github" as fallback. Consider explicitly setting oauthProvider in tool protection config.
3103
-
3104
- 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
3105
- [ProviderResolver] Inferred provider "microsoft" from scopes
3106
-
3107
- 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)
3108
-
3109
- stdout | src/__tests__/services/provider-resolver-edge-cases.test.ts > ProviderResolver - Edge Cases > Provider name case sensitivity > should handle provider names case-insensitively in inference
3110
- [ProviderResolver] Tool does not specify oauthProvider. Using project-configured provider "github" as fallback. Consider explicitly setting oauthProvider in tool protection config.
3111
- [ProviderResolver] Inferred provider "github" from scopes
3112
-
3113
-
3114
- 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
3115
- [ProviderResolver] Inferred provider "github" from scopes
3116
-
3117
- stderr | src/__tests__/services/provider-resolver-edge-cases.test.ts > ProviderResolver - Edge Cases > Scope inference edge cases (Priority 2) > should handle unknown scope prefixes
3118
- stdout | src/__tests__/services/provider-resolver-edge-cases.test.ts > ProviderResolver - Edge Cases > configuredProvider behavior (Priority 3) > should prefer scope-inferred provider over configuredProvider
3119
- [ProviderResolver] Inferred provider "google" from scopes
3120
-
3121
- stdout | src/services/__tests__/provider-resolver.test.ts > ProviderResolver > resolveProvider - Priority 2: Scope inference > should infer provider from github scope prefix
3122
- [ProviderResolver] Inferred provider "github" from scopes
3123
- [ProviderResolver] Tool does not specify oauthProvider. Using project-configured provider "github" as fallback. Consider explicitly setting oauthProvider in tool protection config.
3124
-
3125
-
3126
- stderr | src/__tests__/services/provider-resolver-edge-cases.test.ts > ProviderResolver - Edge Cases > Scope inference edge cases (Priority 2) > should handle scopes without colons
3127
- [ProviderResolver] Tool does not specify oauthProvider. Using project-configured provider "github" as fallback. Consider explicitly setting oauthProvider in tool protection config.
3128
-
3129
- 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
3130
- [ProviderResolver] Tool does not specify oauthProvider. Using project-configured provider "google" as fallback. Consider explicitly setting oauthProvider in tool protection config.
3131
-
3132
- stderr | src/__tests__/services/provider-resolver-edge-cases.test.ts > ProviderResolver - Edge Cases > Fallback behavior (Priority 3 - configuredProvider) > should use configuredProvider when oauthProvider not specified
3133
- [ProviderResolver] Tool does not specify oauthProvider. Using project-configured provider "google" as fallback. Consider explicitly setting oauthProvider in tool protection config.
3134
-
3135
- stderr | src/__tests__/services/provider-resolver-edge-cases.test.ts > ProviderResolver - Edge Cases > configuredProvider behavior (Priority 3) > should use configuredProvider when tool has no oauthProvider
3136
- [ProviderResolver] Tool does not specify oauthProvider. Using project-configured provider "github" as fallback. Consider explicitly setting oauthProvider in tool protection config.
3137
-
3138
- stdout | src/services/__tests__/provider-resolver.test.ts > ProviderResolver > resolveProvider - Priority 2: Scope inference > should infer provider from gmail scope prefix (maps to google)
3139
- [ProviderResolver] Inferred provider "google" from scopes
3140
-
3141
- ✓ src/__tests__/services/provider-resolver-edge-cases.test.ts (25 tests | 1 skipped) 29ms
3142
- stderr | src/services/__tests__/provider-resolver.test.ts > ProviderResolver > resolveProvider - Priority 2: Scope inference > should fall back to configuredProvider for ambiguous scopes
3143
- [ProviderResolver] Tool does not specify oauthProvider. Using project-configured provider "github" as fallback. Consider explicitly setting oauthProvider in tool protection config.
3144
-
3145
- ✓ src/services/__tests__/provider-resolver.test.ts (8 tests) 48ms
3146
- stderr | src/services/__tests__/provider-resolution.integration.test.ts > Provider Resolution Integration > Backward compatibility > should work with Phase 1 tools (no oauthProvider field)
3147
- [ProviderResolver] Tool does not specify oauthProvider. Using project-configured provider "github" as fallback. Consider explicitly setting oauthProvider in tool protection config.
3148
-
3149
- ✓ src/services/__tests__/provider-resolution.integration.test.ts (6 tests) 3ms
3150
- ✓ src/delegation/__tests__/did-key-resolver.test.ts (28 tests) 8ms
3151
- ✓ src/delegation/__tests__/vc-issuer.test.ts (21 tests) 8ms
3152
- ✓ src/compliance/__tests__/schema-verifier.test.ts (30 tests) 8ms
3153
- ✓ src/config/__tests__/merged-config.spec.ts (6 tests) 44ms
3154
- ✓ src/services/__tests__/batch-delegation.service.test.ts (11 tests) 80ms
3155
- ✓ src/delegation/__tests__/audience-validator.test.ts (5 tests) 2ms
3156
- ✓ src/delegation/storage/__tests__/memory-statuslist-storage.test.ts (14 tests) 3ms
3157
- ✓ src/delegation/__tests__/utils.test.ts (28 tests) 6ms
3158
- ✓ src/__tests__/runtime/audit-logger.test.ts (9 tests) 3ms
3159
- ✓ src/utils/__tests__/did-helpers.test.ts (16 tests) 7ms
3160
- ✓ src/delegation/__tests__/bitstring.test.ts (30 tests) 6ms
3161
- ✓ src/__tests__/config/provider-runtime-config.test.ts (9 tests) 2ms
3162
- ↓ src/__tests__/delegation-e2e.test.ts (14 tests | 14 skipped)
3163
- ✓ src/__tests__/index.test.ts (4 tests) 3ms
3164
-
3165
- Test Files 48 passed | 1 skipped (49)
3166
- Tests 955 passed | 16 skipped (971)
3167
- Start at 19:15:13
3168
- Duration 5.16s (transform 8.92s, setup 0ms, import 17.14s, tests 3.08s, environment 3ms)
3169
-