@suveren/gateway 0.7.4 → 0.8.0

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 (264) hide show
  1. package/content/integrations/mollie.json +103 -28
  2. package/dist/control-plane/index.mjs +248 -58
  3. package/dist/mcp-server/http.mjs +577 -124
  4. package/dist/ui/assets/index-BFnSVa9N.js +110 -0
  5. package/dist/ui/assets/{index-CkWaRck1.css → index-BYVb_0oG.css} +1 -1
  6. package/dist/ui/index.html +2 -2
  7. package/node_modules/@hap/core/dist/index.d.mts +285 -13
  8. package/node_modules/@hap/core/dist/index.d.ts +285 -13
  9. package/node_modules/@hap/core/dist/index.js +281 -13
  10. package/node_modules/@hap/core/dist/index.mjs +266 -12
  11. package/node_modules/@hap/core/package.json +4 -2
  12. package/node_modules/@hap/core/src/did-key.ts +126 -0
  13. package/node_modules/@hap/core/src/frame.ts +115 -14
  14. package/node_modules/@hap/core/src/gatekeeper.ts +26 -0
  15. package/node_modules/@hap/core/src/identity.ts +21 -5
  16. package/node_modules/@hap/core/src/index.ts +3 -0
  17. package/node_modules/@hap/core/src/mandate.ts +207 -0
  18. package/node_modules/@hap/core/src/receipt.ts +74 -0
  19. package/node_modules/@hap/core/src/types.ts +87 -5
  20. package/node_modules/@modelcontextprotocol/sdk/node_modules/negotiator/lib/accept.js +54 -0
  21. package/node_modules/@modelcontextprotocol/sdk/node_modules/negotiator/lib/charset.js +10 -34
  22. package/node_modules/@modelcontextprotocol/sdk/node_modules/negotiator/lib/encoding.js +9 -30
  23. package/node_modules/@modelcontextprotocol/sdk/node_modules/negotiator/lib/language.js +15 -36
  24. package/node_modules/@modelcontextprotocol/sdk/node_modules/negotiator/lib/mediaType.js +16 -134
  25. package/node_modules/@modelcontextprotocol/sdk/node_modules/negotiator/node_modules/content-type/LICENSE +22 -0
  26. package/node_modules/@modelcontextprotocol/sdk/node_modules/negotiator/node_modules/content-type/README.md +71 -0
  27. package/node_modules/@modelcontextprotocol/sdk/node_modules/negotiator/node_modules/content-type/dist/index.d.ts +46 -0
  28. package/node_modules/@modelcontextprotocol/sdk/node_modules/negotiator/node_modules/content-type/dist/index.js +176 -0
  29. package/node_modules/@modelcontextprotocol/sdk/node_modules/negotiator/node_modules/content-type/dist/index.js.map +1 -0
  30. package/node_modules/@modelcontextprotocol/sdk/node_modules/negotiator/node_modules/content-type/package.json +52 -0
  31. package/node_modules/@modelcontextprotocol/sdk/node_modules/negotiator/package.json +16 -10
  32. package/node_modules/@types/node/README.md +1 -1
  33. package/node_modules/@types/node/buffer.buffer.d.ts +10 -5
  34. package/node_modules/@types/node/crypto.d.ts +2 -4
  35. package/node_modules/@types/node/dgram.d.ts +119 -4
  36. package/node_modules/@types/node/ffi.d.ts +1 -1
  37. package/node_modules/@types/node/fs/promises.d.ts +61 -65
  38. package/node_modules/@types/node/fs.d.ts +86 -76
  39. package/node_modules/@types/node/http.d.ts +17 -1
  40. package/node_modules/@types/node/http2.d.ts +12 -4
  41. package/node_modules/@types/node/index.d.ts +1 -0
  42. package/node_modules/@types/node/inspector.d.ts +2 -1
  43. package/node_modules/@types/node/net.d.ts +108 -16
  44. package/node_modules/@types/node/package.json +2 -2
  45. package/node_modules/@types/node/process.d.ts +52 -0
  46. package/node_modules/@types/node/quic.d.ts +246 -38
  47. package/node_modules/@types/node/sqlite.d.ts +6 -2
  48. package/node_modules/@types/node/stream/iter.d.ts +4 -4
  49. package/node_modules/@types/node/test.d.ts +36 -0
  50. package/node_modules/@types/node/tls.d.ts +24 -0
  51. package/node_modules/@types/node/ts5.6/buffer.buffer.d.ts +5 -0
  52. package/node_modules/@types/node/ts5.6/index.d.ts +1 -0
  53. package/node_modules/@types/node/ts5.7/index.d.ts +1 -0
  54. package/node_modules/@types/node/tty.d.ts +4 -3
  55. package/node_modules/@types/node/vfs.d.ts +210 -0
  56. package/node_modules/@types/node/vm.d.ts +1 -1
  57. package/node_modules/express-rate-limit/dist/index.cjs +6 -3
  58. package/node_modules/express-rate-limit/dist/index.d.cts +11 -0
  59. package/node_modules/express-rate-limit/dist/index.d.mts +11 -0
  60. package/node_modules/express-rate-limit/dist/index.d.ts +11 -0
  61. package/node_modules/express-rate-limit/dist/index.mjs +6 -3
  62. package/node_modules/express-rate-limit/{license.md → license} +7 -6
  63. package/node_modules/express-rate-limit/package.json +5 -5
  64. package/node_modules/express-rate-limit/readme.md +1 -0
  65. package/node_modules/fast-uri/index.js +215 -47
  66. package/node_modules/fast-uri/lib/schemes.js +9 -4
  67. package/node_modules/fast-uri/lib/utils.js +396 -92
  68. package/node_modules/fast-uri/package.json +1 -1
  69. package/node_modules/fast-uri/test/component-safe-serialization.test.js +163 -0
  70. package/node_modules/fast-uri/test/equal.test.js +31 -3
  71. package/node_modules/fast-uri/test/fixtures/uri-js-parse.json +2 -0
  72. package/node_modules/fast-uri/test/ipv6-canonical.test.js +34 -0
  73. package/node_modules/fast-uri/test/ipv6-validation.test.js +124 -0
  74. package/node_modules/fast-uri/test/malformed-percent.test.js +77 -0
  75. package/node_modules/fast-uri/test/malformed-urn.test.js +61 -0
  76. package/node_modules/fast-uri/test/parse.test.js +7 -3
  77. package/node_modules/fast-uri/test/query-fragment-normalization.test.js +33 -0
  78. package/node_modules/fast-uri/test/reserved-path-normalization.test.js +109 -0
  79. package/node_modules/fast-uri/test/scheme-validation.test.js +124 -0
  80. package/node_modules/fast-uri/test/security-normalization.test.js +101 -0
  81. package/node_modules/fast-uri/test/security.test.js +75 -3
  82. package/node_modules/fast-uri/test/urn-full-input.test.js +29 -0
  83. package/node_modules/fast-uri/test/websocket-query-preservation.test.js +24 -0
  84. package/node_modules/hono/dist/cjs/client/client.js +25 -11
  85. package/node_modules/hono/dist/cjs/client/utils.js +4 -1
  86. package/node_modules/hono/dist/cjs/context.js +4 -0
  87. package/node_modules/hono/dist/cjs/helper/accepts/accepts.js +36 -2
  88. package/node_modules/hono/dist/cjs/helper/ssg/ssg.js +1 -1
  89. package/node_modules/hono/dist/cjs/helper/ssg/utils.js +30 -10
  90. package/node_modules/hono/dist/cjs/jsx/dom/render.js +2 -0
  91. package/node_modules/hono/dist/cjs/middleware/cache/index.js +1 -1
  92. package/node_modules/hono/dist/cjs/middleware/cors/index.js +1 -1
  93. package/node_modules/hono/dist/cjs/middleware/csrf/index.js +1 -1
  94. package/node_modules/hono/dist/cjs/middleware/etag/digest.js +1 -1
  95. package/node_modules/hono/dist/cjs/middleware/etag/index.js +3 -3
  96. package/node_modules/hono/dist/cjs/middleware/pretty-json/index.js +3 -1
  97. package/node_modules/hono/dist/cjs/request.js +8 -4
  98. package/node_modules/hono/dist/cjs/router/linear-router/router.js +7 -2
  99. package/node_modules/hono/dist/cjs/router/pattern-router/router.js +3 -9
  100. package/node_modules/hono/dist/cjs/router/reg-exp-router/node.js +10 -3
  101. package/node_modules/hono/dist/cjs/router/reg-exp-router/router.js +47 -83
  102. package/node_modules/hono/dist/cjs/router/reg-exp-router/trie.js +2 -1
  103. package/node_modules/hono/dist/cjs/router/trie-router/node.js +46 -69
  104. package/node_modules/hono/dist/cjs/router/trie-router/router.js +3 -11
  105. package/node_modules/hono/dist/cjs/router/utils.js +27 -0
  106. package/node_modules/hono/dist/cjs/utils/body.js +15 -3
  107. package/node_modules/hono/dist/cjs/utils/cookie.js +1 -1
  108. package/node_modules/hono/dist/cjs/utils/ipaddr.js +5 -3
  109. package/node_modules/hono/dist/cjs/utils/stream.js +7 -1
  110. package/node_modules/hono/dist/cjs/utils/url.js +9 -1
  111. package/node_modules/hono/dist/client/client.js +25 -11
  112. package/node_modules/hono/dist/client/utils.js +4 -1
  113. package/node_modules/hono/dist/context.js +4 -0
  114. package/node_modules/hono/dist/helper/accepts/accepts.js +36 -2
  115. package/node_modules/hono/dist/helper/ssg/ssg.js +1 -1
  116. package/node_modules/hono/dist/helper/ssg/utils.js +30 -10
  117. package/node_modules/hono/dist/jsx/dom/render.js +2 -0
  118. package/node_modules/hono/dist/middleware/cache/index.js +1 -1
  119. package/node_modules/hono/dist/middleware/cors/index.js +1 -1
  120. package/node_modules/hono/dist/middleware/csrf/index.js +1 -1
  121. package/node_modules/hono/dist/middleware/etag/digest.js +1 -1
  122. package/node_modules/hono/dist/middleware/etag/index.js +3 -3
  123. package/node_modules/hono/dist/middleware/pretty-json/index.js +3 -1
  124. package/node_modules/hono/dist/request.js +8 -4
  125. package/node_modules/hono/dist/router/linear-router/router.js +7 -2
  126. package/node_modules/hono/dist/router/pattern-router/router.js +3 -9
  127. package/node_modules/hono/dist/router/reg-exp-router/node.js +6 -2
  128. package/node_modules/hono/dist/router/reg-exp-router/router.js +53 -84
  129. package/node_modules/hono/dist/router/reg-exp-router/trie.js +2 -1
  130. package/node_modules/hono/dist/router/trie-router/node.js +46 -69
  131. package/node_modules/hono/dist/router/trie-router/router.js +3 -11
  132. package/node_modules/hono/dist/router/utils.js +5 -0
  133. package/node_modules/hono/dist/types/context.d.ts +4 -0
  134. package/node_modules/hono/dist/types/router/reg-exp-router/node.d.ts +3 -0
  135. package/node_modules/hono/dist/types/router/trie-router/node.d.ts +1 -2
  136. package/node_modules/hono/dist/types/router/trie-router/router.d.ts +0 -1
  137. package/node_modules/hono/dist/types/router/utils.d.ts +1 -0
  138. package/node_modules/hono/dist/types/utils/url.d.ts +4 -0
  139. package/node_modules/hono/dist/utils/body.js +15 -3
  140. package/node_modules/hono/dist/utils/cookie.js +1 -1
  141. package/node_modules/hono/dist/utils/ipaddr.js +5 -3
  142. package/node_modules/hono/dist/utils/stream.js +7 -1
  143. package/node_modules/hono/dist/utils/url.js +9 -1
  144. package/node_modules/hono/package.json +1 -1
  145. package/node_modules/ip-address/README.md +92 -82
  146. package/node_modules/ip-address/dist/common.d.ts +20 -0
  147. package/node_modules/ip-address/dist/common.js +36 -0
  148. package/node_modules/ip-address/dist/common.js.map +1 -1
  149. package/node_modules/ip-address/dist/ipv4.d.ts +50 -0
  150. package/node_modules/ip-address/dist/ipv4.js +75 -0
  151. package/node_modules/ip-address/dist/ipv4.js.map +1 -1
  152. package/node_modules/ip-address/dist/ipv6.d.ts +79 -10
  153. package/node_modules/ip-address/dist/ipv6.js +120 -30
  154. package/node_modules/ip-address/dist/ipv6.js.map +1 -1
  155. package/node_modules/ip-address/dist/v4/constants.d.ts +12 -0
  156. package/node_modules/ip-address/dist/v4/constants.js +40 -1
  157. package/node_modules/ip-address/dist/v4/constants.js.map +1 -1
  158. package/node_modules/ip-address/dist/v6/constants.d.ts +14 -0
  159. package/node_modules/ip-address/dist/v6/constants.js +47 -1
  160. package/node_modules/ip-address/dist/v6/constants.js.map +1 -1
  161. package/node_modules/ip-address/package.json +1 -1
  162. package/node_modules/is-plain-object/README.md +39 -95
  163. package/node_modules/is-plain-object/dist/is-plain-object.js +0 -2
  164. package/node_modules/is-plain-object/is-plain-object.d.ts +6 -1
  165. package/node_modules/is-plain-object/package.json +8 -34
  166. package/node_modules/jose/dist/types/jwe/compact/decrypt.d.ts +7 -16
  167. package/node_modules/jose/dist/types/jwe/compact/encrypt.d.ts +10 -20
  168. package/node_modules/jose/dist/types/jwe/flattened/decrypt.d.ts +7 -16
  169. package/node_modules/jose/dist/types/jwe/flattened/encrypt.d.ts +16 -38
  170. package/node_modules/jose/dist/types/jwe/general/decrypt.d.ts +7 -16
  171. package/node_modules/jose/dist/types/jwe/general/encrypt.d.ts +19 -38
  172. package/node_modules/jose/dist/types/jwk/embedded.d.ts +3 -8
  173. package/node_modules/jose/dist/types/jwk/thumbprint.d.ts +5 -5
  174. package/node_modules/jose/dist/types/jwks/local.d.ts +6 -10
  175. package/node_modules/jose/dist/types/jwks/remote.d.ts +17 -28
  176. package/node_modules/jose/dist/types/jws/compact/sign.d.ts +5 -10
  177. package/node_modules/jose/dist/types/jws/compact/verify.d.ts +9 -18
  178. package/node_modules/jose/dist/types/jws/flattened/sign.d.ts +7 -16
  179. package/node_modules/jose/dist/types/jws/flattened/verify.d.ts +9 -18
  180. package/node_modules/jose/dist/types/jws/general/sign.d.ts +11 -21
  181. package/node_modules/jose/dist/types/jws/general/verify.d.ts +12 -21
  182. package/node_modules/jose/dist/types/jwt/decrypt.d.ts +10 -20
  183. package/node_modules/jose/dist/types/jwt/encrypt.d.ts +17 -29
  184. package/node_modules/jose/dist/types/jwt/sign.d.ts +12 -19
  185. package/node_modules/jose/dist/types/jwt/unsecured.d.ts +17 -28
  186. package/node_modules/jose/dist/types/jwt/verify.d.ts +9 -19
  187. package/node_modules/jose/dist/types/key/export.d.ts +4 -4
  188. package/node_modules/jose/dist/types/key/generate_key_pair.d.ts +6 -8
  189. package/node_modules/jose/dist/types/key/generate_secret.d.ts +4 -11
  190. package/node_modules/jose/dist/types/key/import.d.ts +10 -17
  191. package/node_modules/jose/dist/types/types.d.ts +48 -86
  192. package/node_modules/jose/dist/types/util/base64url.d.ts +2 -2
  193. package/node_modules/jose/dist/types/util/decode_jwt.d.ts +3 -10
  194. package/node_modules/jose/dist/types/util/decode_protected_header.d.ts +4 -4
  195. package/node_modules/jose/dist/types/util/errors.d.ts +26 -53
  196. package/node_modules/jose/dist/webapi/index.js +70 -32
  197. package/node_modules/jose/dist/webapi/jwe/compact/decrypt.js +7 -8
  198. package/node_modules/jose/dist/webapi/jwe/compact/encrypt.js +42 -26
  199. package/node_modules/jose/dist/webapi/jwe/flattened/decrypt.js +14 -10
  200. package/node_modules/jose/dist/webapi/jwe/flattened/encrypt.js +53 -71
  201. package/node_modules/jose/dist/webapi/jwe/general/decrypt.js +38 -49
  202. package/node_modules/jose/dist/webapi/jwe/general/encrypt.js +121 -158
  203. package/node_modules/jose/dist/webapi/jwk/embedded.js +30 -18
  204. package/node_modules/jose/dist/webapi/jwk/thumbprint.js +54 -64
  205. package/node_modules/jose/dist/webapi/jwks/local.js +49 -74
  206. package/node_modules/jose/dist/webapi/jwks/remote.js +91 -160
  207. package/node_modules/jose/dist/webapi/jws/compact/sign.js +21 -20
  208. package/node_modules/jose/dist/webapi/jws/compact/verify.js +7 -8
  209. package/node_modules/jose/dist/webapi/jws/flattened/sign.js +29 -30
  210. package/node_modules/jose/dist/webapi/jws/flattened/verify.js +21 -23
  211. package/node_modules/jose/dist/webapi/jws/general/sign.js +61 -70
  212. package/node_modules/jose/dist/webapi/jws/general/verify.js +47 -41
  213. package/node_modules/jose/dist/webapi/jwt/decrypt.js +13 -22
  214. package/node_modules/jose/dist/webapi/jwt/encrypt.js +58 -100
  215. package/node_modules/jose/dist/webapi/jwt/sign.js +18 -50
  216. package/node_modules/jose/dist/webapi/jwt/unsecured.js +34 -63
  217. package/node_modules/jose/dist/webapi/jwt/verify.js +12 -14
  218. package/node_modules/jose/dist/webapi/key/export.js +32 -37
  219. package/node_modules/jose/dist/webapi/key/generate_key_pair.js +40 -44
  220. package/node_modules/jose/dist/webapi/key/generate_secret.js +35 -39
  221. package/node_modules/jose/dist/webapi/key/import.js +52 -52
  222. package/node_modules/jose/dist/webapi/lib/asn1.js +130 -164
  223. package/node_modules/jose/dist/webapi/lib/base64.js +18 -20
  224. package/node_modules/jose/dist/webapi/lib/buffer_utils.js +34 -38
  225. package/node_modules/jose/dist/webapi/lib/content_encryption.js +79 -123
  226. package/node_modules/jose/dist/webapi/lib/crypto_key.js +24 -25
  227. package/node_modules/jose/dist/webapi/lib/deflate.js +46 -40
  228. package/node_modules/jose/dist/webapi/lib/helpers.js +40 -37
  229. package/node_modules/jose/dist/webapi/lib/invalid_key_input.js +10 -24
  230. package/node_modules/jose/dist/webapi/lib/is_key_like.js +17 -15
  231. package/node_modules/jose/dist/webapi/lib/jwe_algorithms.js +106 -93
  232. package/node_modules/jose/dist/webapi/lib/jwe_decrypt.js +210 -176
  233. package/node_modules/jose/dist/webapi/lib/jwe_encrypt.js +105 -107
  234. package/node_modules/jose/dist/webapi/lib/jwk_metadata.js +19 -0
  235. package/node_modules/jose/dist/webapi/lib/jwk_to_key.js +9 -16
  236. package/node_modules/jose/dist/webapi/lib/jws_algorithms.js +62 -61
  237. package/node_modules/jose/dist/webapi/lib/jws_sign.js +58 -72
  238. package/node_modules/jose/dist/webapi/lib/jws_verify.js +90 -103
  239. package/node_modules/jose/dist/webapi/lib/jwt_claims_set.js +134 -185
  240. package/node_modules/jose/dist/webapi/lib/key.js +84 -121
  241. package/node_modules/jose/dist/webapi/lib/key_algorithm.js +13 -8
  242. package/node_modules/jose/dist/webapi/lib/key_descriptor.js +8 -6
  243. package/node_modules/jose/dist/webapi/lib/key_management.js +200 -225
  244. package/node_modules/jose/dist/webapi/lib/key_options.js +8 -0
  245. package/node_modules/jose/dist/webapi/lib/options.js +57 -44
  246. package/node_modules/jose/dist/webapi/lib/signing.js +18 -22
  247. package/node_modules/jose/dist/webapi/lib/type_checks.js +28 -33
  248. package/node_modules/jose/dist/webapi/util/base64url.js +26 -35
  249. package/node_modules/jose/dist/webapi/util/decode_jwt.js +32 -31
  250. package/node_modules/jose/dist/webapi/util/decode_protected_header.js +18 -23
  251. package/node_modules/jose/dist/webapi/util/errors.js +94 -84
  252. package/node_modules/jose/package.json +17 -81
  253. package/package.json +2 -2
  254. package/profiles/calendar/0.5.profile.json +190 -0
  255. package/profiles/charge/0.5.profile.json +210 -0
  256. package/profiles/customers/0.7.profile.json +157 -0
  257. package/profiles/deploy/0.9.profile.json +176 -0
  258. package/profiles/email/0.6.profile.json +208 -0
  259. package/profiles/index.json +9 -1
  260. package/profiles/publish/0.5.profile.json +186 -0
  261. package/profiles/purchase/0.5.profile.json +231 -0
  262. package/profiles/records/0.5.profile.json +117 -0
  263. package/dist/ui/assets/index-0Q2eNytX.js +0 -110
  264. package/node_modules/@modelcontextprotocol/sdk/node_modules/negotiator/HISTORY.md +0 -114
@@ -8,19 +8,32 @@
8
8
  "npmPackage": "mcp-remote",
9
9
  "mcp": {
10
10
  "command": "mcp-remote",
11
- "args": ["https://mcp.mollie.com/mcp", "--header", "Authorization: Bearer ${MOLLIE_ACCESS_TOKEN}"]
11
+ "args": [
12
+ "https://mcp.mollie.com/mcp",
13
+ "--header",
14
+ "Authorization: Bearer ${MOLLIE_ACCESS_TOKEN}"
15
+ ]
12
16
  },
13
17
  "credentials": {
14
18
  "fields": [
15
- { "key": "accessToken", "label": "Access Token", "type": "password", "placeholder": "access_org_..." }
19
+ {
20
+ "key": "accessToken",
21
+ "label": "Access Token",
22
+ "type": "password",
23
+ "placeholder": "access_org_..."
24
+ }
16
25
  ],
17
- "envMapping": { "MOLLIE_ACCESS_TOKEN": "accessToken" }
26
+ "envMapping": {
27
+ "MOLLIE_ACCESS_TOKEN": "accessToken"
28
+ }
18
29
  },
19
30
  "oauth": null,
20
31
  "toolGating": {
21
32
  "default": {
22
33
  "executionMapping": {},
23
- "staticExecution": { "action_type": "read" }
34
+ "staticExecution": {
35
+ "action_type": "unclassified"
36
+ }
24
37
  },
25
38
  "overrides": {
26
39
  "CreatePayment": {
@@ -28,67 +41,93 @@
28
41
  "amount": "amount",
29
42
  "currency": "currency"
30
43
  },
31
- "staticExecution": { "action_type": "charge" }
44
+ "staticExecution": {
45
+ "action_type": "charge"
46
+ }
32
47
  },
33
48
  "CreatePaymentForCustomer": {
34
49
  "executionMapping": {
35
50
  "amount": "amount",
36
51
  "currency": "currency"
37
52
  },
38
- "staticExecution": { "action_type": "charge" }
53
+ "staticExecution": {
54
+ "action_type": "charge"
55
+ }
39
56
  },
40
57
  "CreatePaymentLink": {
41
58
  "executionMapping": {
42
59
  "amount": "amount",
43
60
  "currency": "currency"
44
61
  },
45
- "staticExecution": { "action_type": "charge" }
62
+ "staticExecution": {
63
+ "action_type": "charge"
64
+ }
46
65
  },
47
66
  "CreateCapture": {
48
67
  "executionMapping": {
49
68
  "amount_value": "amount",
50
69
  "amount_currency": "currency"
51
70
  },
52
- "staticExecution": { "action_type": "charge" }
71
+ "staticExecution": {
72
+ "action_type": "charge"
73
+ }
53
74
  },
54
75
  "CreateSubscription": {
55
76
  "executionMapping": {
56
77
  "amount_value": "amount",
57
78
  "amount_currency": "currency"
58
79
  },
59
- "staticExecution": { "action_type": "subscribe" }
80
+ "staticExecution": {
81
+ "action_type": "subscribe"
82
+ }
60
83
  },
61
84
  "UpdateSubscription": {
62
85
  "executionMapping": {},
63
- "staticExecution": { "action_type": "subscribe" }
86
+ "staticExecution": {
87
+ "action_type": "subscribe"
88
+ }
64
89
  },
65
90
  "CancelSubscription": {
66
91
  "executionMapping": {},
67
- "staticExecution": { "action_type": "subscribe" }
92
+ "staticExecution": {
93
+ "action_type": "subscribe"
94
+ }
68
95
  },
69
96
  "CreateCustomer": {
70
97
  "executionMapping": {},
71
- "staticExecution": { "action_type": "charge" }
98
+ "staticExecution": {
99
+ "action_type": "charge"
100
+ }
72
101
  },
73
102
  "UpdateCustomer": {
74
103
  "executionMapping": {},
75
- "staticExecution": { "action_type": "charge" }
104
+ "staticExecution": {
105
+ "action_type": "charge"
106
+ }
76
107
  },
77
108
  "CreateMandate": {
78
109
  "executionMapping": {},
79
- "staticExecution": { "action_type": "charge" }
110
+ "staticExecution": {
111
+ "action_type": "charge"
112
+ }
80
113
  },
81
114
  "RevokeMandate": {
82
115
  "executionMapping": {},
83
- "staticExecution": { "action_type": "charge" }
116
+ "staticExecution": {
117
+ "action_type": "charge"
118
+ }
84
119
  },
85
120
  "CreateWebhook": {
86
121
  "executionMapping": {},
87
- "staticExecution": { "action_type": "charge" }
122
+ "staticExecution": {
123
+ "action_type": "charge"
124
+ }
88
125
  },
89
126
  "UpdateWebhook": {
90
127
  "executionMapping": {},
91
- "staticExecution": { "action_type": "charge" }
128
+ "staticExecution": {
129
+ "action_type": "charge"
130
+ }
92
131
  }
93
132
  }
94
133
  },
@@ -98,33 +137,69 @@
98
137
  "description": "Read-only. View payments, balances, invoices, and transaction history.",
99
138
  "risk": "low",
100
139
  "mode": "automatic",
101
- "bounds": { "amount_max": "0", "amount_daily_max": "0", "amount_monthly_max": "0", "transaction_count_daily_max": "100" },
102
- "context": { "currency": "EUR", "action_type": "charge" },
140
+ "bounds": {
141
+ "amount_max": "0",
142
+ "amount_daily_max": "0",
143
+ "amount_monthly_max": "0",
144
+ "transaction_count_daily_max": "100"
145
+ },
146
+ "context": {
147
+ "currency": "EUR",
148
+ "action_type": "charge"
149
+ },
103
150
  "intent": "Allow the agent to monitor payments and view transaction history. Read-only — no payments are created or modified.",
104
151
  "ttl": 2592000,
105
- "tags": ["read-only", "EUR", "100 ops/day"]
152
+ "tags": [
153
+ "read-only",
154
+ "EUR",
155
+ "100 ops/day"
156
+ ]
106
157
  },
107
158
  {
108
159
  "name": "Small Payments",
109
- "description": "Create payment links and process charges up to \u20ac50 per transaction.",
160
+ "description": "Create payment links and process charges up to €50 per transaction.",
110
161
  "risk": "medium",
111
162
  "mode": "automatic",
112
- "bounds": { "amount_max": "50", "amount_daily_max": "200", "amount_monthly_max": "2000", "transaction_count_daily_max": "20" },
113
- "context": { "currency": "EUR", "action_type": "charge" },
114
- "intent": "Allow the agent to create payment links and process small charges for routine invoicing. Max \u20ac50 per transaction, \u20ac200 per day.",
163
+ "bounds": {
164
+ "amount_max": "50",
165
+ "amount_daily_max": "200",
166
+ "amount_monthly_max": "2000",
167
+ "transaction_count_daily_max": "20"
168
+ },
169
+ "context": {
170
+ "currency": "EUR",
171
+ "action_type": "charge"
172
+ },
173
+ "intent": "Allow the agent to create payment links and process small charges for routine invoicing. Max €50 per transaction, €200 per day.",
115
174
  "ttl": 2592000,
116
- "tags": ["\u20ac50/tx", "\u20ac200/day", "20 ops/day"]
175
+ "tags": [
176
+ "€50/tx",
177
+ "€200/day",
178
+ "20 ops/day"
179
+ ]
117
180
  },
118
181
  {
119
182
  "name": "Full Payment Management",
120
183
  "description": "Payments, refunds, and subscriptions. Every action requires your approval.",
121
184
  "risk": "high",
122
185
  "mode": "review",
123
- "bounds": { "amount_max": "1000", "amount_daily_max": "5000", "amount_monthly_max": "20000", "transaction_count_daily_max": "50" },
124
- "context": { "currency": "EUR", "action_type": "charge,refund,subscribe" },
186
+ "bounds": {
187
+ "amount_max": "1000",
188
+ "amount_daily_max": "5000",
189
+ "amount_monthly_max": "20000",
190
+ "transaction_count_daily_max": "50"
191
+ },
192
+ "context": {
193
+ "currency": "EUR",
194
+ "action_type": "charge,refund,subscribe"
195
+ },
125
196
  "intent": "Full payment management — create payments, issue refunds, manage subscriptions. Every write action requires human review before execution.",
126
197
  "ttl": 2592000,
127
- "tags": ["\u20ac1,000/tx", "\u20ac5,000/day", "review mode"]
198
+ "tags": [
199
+ "€1,000/tx",
200
+ "€5,000/day",
201
+ "review mode"
202
+ ]
128
203
  }
129
204
  ],
130
205
  "setupHint": "Use a test token (test_...) for development.",
@@ -419,6 +419,13 @@ async function getEnrichedAuthorizations() {
419
419
  if (!res.ok) throw new Error("Failed to fetch authorizations");
420
420
  return res.json();
421
421
  }
422
+ async function getLocalEvidence() {
423
+ const res = await fetch(`${MCP_BASE}/internal/evidence`, {
424
+ headers: internalHeaders()
425
+ });
426
+ if (!res.ok) throw new Error(`Failed to fetch local evidence: ${res.status}`);
427
+ return res.json();
428
+ }
422
429
  async function getMcpHealth() {
423
430
  const res = await fetch(`${MCP_BASE}/health`);
424
431
  if (!res.ok) throw new Error("MCP server unreachable");
@@ -1935,49 +1942,11 @@ function createEncryptIntentRouter() {
1935
1942
  return router;
1936
1943
  }
1937
1944
 
1938
- // src/routes/decrypt-intent.ts
1939
- import { Router as Router8 } from "express";
1940
- function createDecryptIntentRouter(vault2) {
1941
- const router = Router8();
1942
- router.post("/", async (req, res) => {
1943
- const { intentCiphertext, encryptedKey, approverId } = req.body;
1944
- if (typeof intentCiphertext !== "string" || intentCiphertext.length === 0) {
1945
- res.status(400).json({ error: "Missing or invalid field: intentCiphertext (base64 string)" });
1946
- return;
1947
- }
1948
- if (typeof encryptedKey !== "object" || encryptedKey === null || typeof encryptedKey.ct !== "string" || typeof encryptedKey.enc !== "string") {
1949
- res.status(400).json({ error: "Missing or invalid field: encryptedKey ({ ct: string; enc: string })" });
1950
- return;
1951
- }
1952
- if (typeof approverId !== "string" || approverId.length === 0) {
1953
- res.status(400).json({ error: "Missing or invalid field: approverId (string)" });
1954
- return;
1955
- }
1956
- try {
1957
- const kp = await loadOrGenerateKeyPair(vault2);
1958
- const { ct, enc } = encryptedKey;
1959
- const encrypted = {
1960
- intentCiphertext: new Uint8Array(Buffer.from(intentCiphertext, "base64")),
1961
- encryptedKeys: {
1962
- [approverId]: {
1963
- ct: new Uint8Array(Buffer.from(ct, "base64")),
1964
- enc: new Uint8Array(Buffer.from(enc, "base64"))
1965
- }
1966
- }
1967
- };
1968
- const intent = await decryptIntent(encrypted, approverId, kp.privateKey);
1969
- res.json({ intent });
1970
- } catch (err) {
1971
- console.error("[Control Plane] decrypt-intent error:", err);
1972
- const msg = err instanceof Error ? err.message : "Decryption failed";
1973
- res.status(500).json({ error: msg });
1974
- }
1975
- });
1976
- return router;
1977
- }
1945
+ // src/routes/evidence-export.ts
1946
+ import { Router as Router9 } from "express";
1978
1947
 
1979
1948
  // src/routes/approved-intents.ts
1980
- import { Router as Router9 } from "express";
1949
+ import { Router as Router8 } from "express";
1981
1950
  import { readFileSync as readFileSync2, writeFileSync as writeFileSync3, existsSync as existsSync4, mkdirSync as mkdirSync3 } from "fs";
1982
1951
  import { homedir as homedir3 } from "os";
1983
1952
  import { join as join3 } from "path";
@@ -1997,19 +1966,22 @@ function writeFile(data) {
1997
1966
  mkdirSync3(SUVEREN_DATA_DIR, { recursive: true });
1998
1967
  writeFileSync3(FILE_PATH, JSON.stringify(data, null, 2), "utf-8");
1999
1968
  }
1969
+ function readApprovedIntents(vault2) {
1970
+ const file = readFile();
1971
+ const result = {};
1972
+ for (const [authorityId, blob] of Object.entries(file.entries)) {
1973
+ try {
1974
+ result[authorityId] = vault2.decrypt(blob);
1975
+ } catch {
1976
+ }
1977
+ }
1978
+ return result;
1979
+ }
2000
1980
  function createApprovedIntentsRouter(vault2) {
2001
- const router = Router9();
1981
+ const router = Router8();
2002
1982
  router.get("/", (req, res) => {
2003
1983
  try {
2004
- const file = readFile();
2005
- const result = {};
2006
- for (const [authorityId, blob] of Object.entries(file.entries)) {
2007
- try {
2008
- result[authorityId] = vault2.decrypt(blob);
2009
- } catch {
2010
- }
2011
- }
2012
- res.json({ intents: result });
1984
+ res.json({ intents: readApprovedIntents(vault2) });
2013
1985
  } catch (err) {
2014
1986
  console.error("[Control Plane] approved-intents GET error:", err);
2015
1987
  res.status(500).json({ error: "Failed to read approved intents" });
@@ -2039,6 +2011,222 @@ function createApprovedIntentsRouter(vault2) {
2039
2011
  return router;
2040
2012
  }
2041
2013
 
2014
+ // src/routes/evidence-export.ts
2015
+ var AS_FETCH_TIMEOUT_MS = 2e4;
2016
+ function createEvidenceExportRouter(spUrl, vault2) {
2017
+ const router = Router9();
2018
+ const getSpCookie = () => vault2.getSpCookie();
2019
+ router.get("/", async (_req, res) => {
2020
+ let local = null;
2021
+ let localError;
2022
+ try {
2023
+ local = await getLocalEvidence();
2024
+ } catch (err) {
2025
+ localError = err instanceof Error ? err.message : String(err);
2026
+ }
2027
+ let authorityServer = null;
2028
+ let asError;
2029
+ const cookie = getSpCookie();
2030
+ if (!cookie) {
2031
+ asError = "No Authority Server session \u2014 sign in to include the full account history.";
2032
+ } else {
2033
+ const controller = new AbortController();
2034
+ const timeout = setTimeout(() => controller.abort(), AS_FETCH_TIMEOUT_MS);
2035
+ try {
2036
+ const asRes = await fetch(`${spUrl}/api/receipts/export`, {
2037
+ headers: { Cookie: cookie },
2038
+ signal: controller.signal
2039
+ });
2040
+ if (asRes.ok) {
2041
+ authorityServer = await asRes.json();
2042
+ } else {
2043
+ asError = `Authority Server export failed: ${asRes.status}`;
2044
+ }
2045
+ } catch (err) {
2046
+ asError = `Authority Server unreachable: ${err instanceof Error ? err.message : String(err)}`;
2047
+ } finally {
2048
+ clearTimeout(timeout);
2049
+ }
2050
+ }
2051
+ if (!local && !authorityServer) {
2052
+ res.status(502).json({
2053
+ error: "No evidence source available.",
2054
+ localError,
2055
+ asError
2056
+ });
2057
+ return;
2058
+ }
2059
+ let approvedIntents = {};
2060
+ try {
2061
+ approvedIntents = readApprovedIntents(vault2);
2062
+ } catch {
2063
+ }
2064
+ const exportedAt = Math.floor(Date.now() / 1e3);
2065
+ const date = new Date(exportedAt * 1e3).toISOString().slice(0, 10);
2066
+ res.setHeader("Content-Disposition", `attachment; filename="suveren-evidence-${date}.json"`).setHeader("Cache-Control", "no-store").json({
2067
+ format: "suveren-evidence-bundle/1",
2068
+ exportedAt,
2069
+ sources: {
2070
+ local: local !== null,
2071
+ authorityServer: authorityServer !== null,
2072
+ ...localError ? { localError } : {},
2073
+ ...asError ? { asError } : {}
2074
+ },
2075
+ local,
2076
+ approvedIntents,
2077
+ authorityServer
2078
+ });
2079
+ });
2080
+ return router;
2081
+ }
2082
+
2083
+ // src/routes/evidence.ts
2084
+ import { Router as Router10 } from "express";
2085
+ import { verifyReceiptSignature } from "@hap/core";
2086
+ async function verifyAll(receipts) {
2087
+ const out = {};
2088
+ for (const raw of receipts) {
2089
+ const e = raw;
2090
+ const id = typeof e.receipt?.id === "string" ? e.receipt.id : void 0;
2091
+ if (!id) continue;
2092
+ if (!e.asPublicKey) {
2093
+ out[id] = "unverifiable";
2094
+ continue;
2095
+ }
2096
+ try {
2097
+ await verifyReceiptSignature(e.receipt, e.asPublicKey);
2098
+ out[id] = "valid";
2099
+ } catch {
2100
+ out[id] = "invalid";
2101
+ }
2102
+ }
2103
+ return out;
2104
+ }
2105
+ function mergeAuthorizations(evidence) {
2106
+ const out = {};
2107
+ for (const raw of evidence.authorizations ?? []) {
2108
+ const a = raw;
2109
+ const id = a.authorizationId;
2110
+ if (!id) continue;
2111
+ out[id] = {
2112
+ authorizationId: id,
2113
+ profileId: a.profileId,
2114
+ boundsHash: a.boundsHash,
2115
+ contextHash: a.contextHash,
2116
+ bounds: a.bounds,
2117
+ context: a.context,
2118
+ intent: a.intent,
2119
+ archived: true
2120
+ };
2121
+ }
2122
+ for (const raw of evidence.gates ?? []) {
2123
+ const g = raw;
2124
+ const id = g.authorizationId;
2125
+ if (!id) continue;
2126
+ const gateContent = g.gateContent ?? {};
2127
+ const existing = out[id];
2128
+ if (!existing) {
2129
+ out[id] = {
2130
+ authorizationId: id,
2131
+ profileId: g.profileId,
2132
+ boundsHash: g.boundsHash,
2133
+ contextHash: g.contextHash,
2134
+ context: g.context,
2135
+ intent: gateContent.intent,
2136
+ archived: false
2137
+ };
2138
+ continue;
2139
+ }
2140
+ existing.intent ??= gateContent.intent;
2141
+ existing.context ??= g.context;
2142
+ existing.contextHash ??= g.contextHash;
2143
+ }
2144
+ return out;
2145
+ }
2146
+ function createEvidenceRouter() {
2147
+ const router = Router10();
2148
+ router.get("/authorizations", async (_req, res) => {
2149
+ try {
2150
+ const evidence = await getLocalEvidence();
2151
+ res.json({
2152
+ authorizations: mergeAuthorizations(evidence),
2153
+ // Verified here, on this machine, so the card's badge reports a check
2154
+ // that actually ran rather than the issuer vouching for itself.
2155
+ signatures: await verifyAll(evidence.receipts ?? [])
2156
+ });
2157
+ } catch (err) {
2158
+ res.status(503).json({
2159
+ error: "Local evidence unavailable",
2160
+ detail: err instanceof Error ? err.message : String(err)
2161
+ });
2162
+ }
2163
+ });
2164
+ router.get("/receipt/:id", async (req, res) => {
2165
+ const id = String(req.params.id);
2166
+ try {
2167
+ const evidence = await getLocalEvidence();
2168
+ const entry = (evidence.receipts ?? []).find(
2169
+ (r) => r.receipt?.id === id
2170
+ );
2171
+ if (!entry) {
2172
+ res.status(404).json({ error: "No local copy of this receipt" });
2173
+ return;
2174
+ }
2175
+ const authorizationId = entry.authorizationId;
2176
+ const authorization = authorizationId ? mergeAuthorizations(evidence)[authorizationId] ?? null : null;
2177
+ const signature = (await verifyAll([entry]))[id] ?? "unverifiable";
2178
+ res.json({ entry, authorization, signature });
2179
+ } catch (err) {
2180
+ res.status(503).json({
2181
+ error: "Local evidence unavailable",
2182
+ detail: err instanceof Error ? err.message : String(err)
2183
+ });
2184
+ }
2185
+ });
2186
+ return router;
2187
+ }
2188
+
2189
+ // src/routes/decrypt-intent.ts
2190
+ import { Router as Router11 } from "express";
2191
+ function createDecryptIntentRouter(vault2) {
2192
+ const router = Router11();
2193
+ router.post("/", async (req, res) => {
2194
+ const { intentCiphertext, encryptedKey, approverId } = req.body;
2195
+ if (typeof intentCiphertext !== "string" || intentCiphertext.length === 0) {
2196
+ res.status(400).json({ error: "Missing or invalid field: intentCiphertext (base64 string)" });
2197
+ return;
2198
+ }
2199
+ if (typeof encryptedKey !== "object" || encryptedKey === null || typeof encryptedKey.ct !== "string" || typeof encryptedKey.enc !== "string") {
2200
+ res.status(400).json({ error: "Missing or invalid field: encryptedKey ({ ct: string; enc: string })" });
2201
+ return;
2202
+ }
2203
+ if (typeof approverId !== "string" || approverId.length === 0) {
2204
+ res.status(400).json({ error: "Missing or invalid field: approverId (string)" });
2205
+ return;
2206
+ }
2207
+ try {
2208
+ const kp = await loadOrGenerateKeyPair(vault2);
2209
+ const { ct, enc } = encryptedKey;
2210
+ const encrypted = {
2211
+ intentCiphertext: new Uint8Array(Buffer.from(intentCiphertext, "base64")),
2212
+ encryptedKeys: {
2213
+ [approverId]: {
2214
+ ct: new Uint8Array(Buffer.from(ct, "base64")),
2215
+ enc: new Uint8Array(Buffer.from(enc, "base64"))
2216
+ }
2217
+ }
2218
+ };
2219
+ const intent = await decryptIntent(encrypted, approverId, kp.privateKey);
2220
+ res.json({ intent });
2221
+ } catch (err) {
2222
+ console.error("[Control Plane] decrypt-intent error:", err);
2223
+ const msg = err instanceof Error ? err.message : "Decryption failed";
2224
+ res.status(500).json({ error: msg });
2225
+ }
2226
+ });
2227
+ return router;
2228
+ }
2229
+
2042
2230
  // src/lib/update-checker.ts
2043
2231
  import { execSync } from "child_process";
2044
2232
  import { dirname as dirname3 } from "path";
@@ -2175,7 +2363,7 @@ data: null
2175
2363
  }
2176
2364
 
2177
2365
  // src/routes/gateway-settings.ts
2178
- import { Router as Router10 } from "express";
2366
+ import { Router as Router12 } from "express";
2179
2367
 
2180
2368
  // src/lib/gateway-settings.ts
2181
2369
  import { readFileSync as readFileSync3, writeFileSync as writeFileSync4, mkdirSync as mkdirSync4 } from "fs";
@@ -2211,7 +2399,7 @@ function writeSettings(patch, dataDir) {
2211
2399
 
2212
2400
  // src/routes/gateway-settings.ts
2213
2401
  function createGatewaySettingsRouter() {
2214
- const router = Router10();
2402
+ const router = Router12();
2215
2403
  router.get("/", (_req, res) => {
2216
2404
  res.json(readSettings());
2217
2405
  });
@@ -2234,7 +2422,7 @@ function createGatewaySettingsRouter() {
2234
2422
  }
2235
2423
 
2236
2424
  // src/routes/internal-events.ts
2237
- import { Router as Router11 } from "express";
2425
+ import { Router as Router13 } from "express";
2238
2426
  import { timingSafeEqual as timingSafeEqual2 } from "crypto";
2239
2427
  var ALLOWED = ["proposal-added", "action-approval-needed"];
2240
2428
  function secretMatches(provided, expected) {
@@ -2246,7 +2434,7 @@ function secretMatches(provided, expected) {
2246
2434
  return timingSafeEqual2(a, b);
2247
2435
  }
2248
2436
  function createInternalEventsRouter(getSecret) {
2249
- const router = Router11();
2437
+ const router = Router13();
2250
2438
  router.post("/event", (req, res) => {
2251
2439
  if (!secretMatches(req.headers["x-internal-secret"], getSecret())) {
2252
2440
  res.status(401).json({ error: "Unauthorized" });
@@ -2628,6 +2816,8 @@ app.use("/mcp", jsonParser, authGuard, createMCPRouter());
2628
2816
  app.use("/autostart", jsonParser, authGuard, createAutostartRouter());
2629
2817
  app.use("/api/gateway-settings", jsonParser, authGuard, createGatewaySettingsRouter());
2630
2818
  app.use("/api/encrypt-intent", jsonParser, authGuard, createEncryptIntentRouter());
2819
+ app.use("/api/evidence-export", authGuard, createEvidenceExportRouter(SP_URL2, vault));
2820
+ app.use("/api/evidence", authGuard, createEvidenceRouter());
2631
2821
  app.use("/api/decrypt-intent", jsonParser, authGuard, createDecryptIntentRouter(vault));
2632
2822
  app.use("/api/approved-intents", jsonParser, authGuard, createApprovedIntentsRouter(vault));
2633
2823
  app.put("/integrations/:id/read-policy", jsonParser, authGuard, async (req, res) => {
@@ -2850,10 +3040,10 @@ app.use(
2850
3040
  const url = req.url ?? "";
2851
3041
  if (method !== "POST" && method !== "DELETE") return;
2852
3042
  const path = url.split("?")[0];
2853
- if (method === "POST" && path === "/api/as/attest") {
2854
- eventBus.emit("attestation-changed");
2855
- } else if (method === "POST" && /^\/api\/attestations\/[^/]+\/revoke$/.test(path)) {
3043
+ if (method === "POST" && path === "/api/as/attest" || method === "POST" && /^\/api\/attestations\/[^/]+\/revoke$/.test(path) || method === "POST" && /^\/api\/authorizations\/[^/]+\/delete$/.test(path)) {
2856
3044
  eventBus.emit("attestation-changed");
3045
+ void resyncGates().catch(() => {
3046
+ });
2857
3047
  } else if (method === "POST" && path === "/api/proposals") {
2858
3048
  eventBus.emit("proposal-added");
2859
3049
  } else if (method === "POST" && /^\/api\/proposals\/[^/]+\/resolve$/.test(path)) {