@private.me/xbind 1.3.5 → 3.0.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 (306) hide show
  1. package/LICENSES.md +212 -0
  2. package/README.md +388 -6
  3. package/dist-standalone/_deps/mldsa-wasm/dist/mldsa.js +1 -1920
  4. package/dist-standalone/_deps/shared/cjs/errors.js +1 -639
  5. package/dist-standalone/_deps/shared/cjs/index.js +1 -496
  6. package/dist-standalone/_deps/shared/cjs/types.js +1 -317
  7. package/dist-standalone/_deps/shared/errors.js +1 -255
  8. package/dist-standalone/_deps/shared/index.js +1 -74
  9. package/dist-standalone/_deps/shared/types.js +1 -90
  10. package/dist-standalone/_deps/ux-helpers/cjs/errors.js +1 -1
  11. package/dist-standalone/_deps/ux-helpers/cjs/index.js +1 -1
  12. package/dist-standalone/_deps/ux-helpers/cjs/pagination.js +1 -1
  13. package/dist-standalone/_deps/ux-helpers/cjs/progress.js +1 -1
  14. package/dist-standalone/_deps/ux-helpers/cjs/search.js +1 -1
  15. package/dist-standalone/_deps/ux-helpers/cjs/types.js +1 -1
  16. package/dist-standalone/_deps/ux-helpers/errors.js +1 -1
  17. package/dist-standalone/_deps/ux-helpers/index.js +1 -1
  18. package/dist-standalone/_deps/ux-helpers/pagination.js +1 -1
  19. package/dist-standalone/_deps/ux-helpers/progress.js +1 -1
  20. package/dist-standalone/_deps/ux-helpers/search.js +1 -1
  21. package/dist-standalone/_deps/xchange/auto-accept.js +1 -1
  22. package/dist-standalone/_deps/xchange/cjs/auto-accept.js +1 -1
  23. package/dist-standalone/_deps/xchange/cjs/errors.js +1 -1
  24. package/dist-standalone/_deps/xchange/cjs/index.js +1 -1
  25. package/dist-standalone/_deps/xchange/cjs/invite-client.js +1 -1
  26. package/dist-standalone/_deps/xchange/cjs/lazy-init.js +1 -1
  27. package/dist-standalone/_deps/xchange/cjs/trust-integration.js +1 -1
  28. package/dist-standalone/_deps/xchange/cjs/xchange.js +1 -1
  29. package/dist-standalone/_deps/xchange/errors.js +1 -1
  30. package/dist-standalone/_deps/xchange/index.js +1 -1
  31. package/dist-standalone/_deps/xchange/invite-client.js +1 -1
  32. package/dist-standalone/_deps/xchange/lazy-init.js +1 -1
  33. package/dist-standalone/_deps/xchange/trust-integration.js +1 -1
  34. package/dist-standalone/_deps/xchange/xchange.js +1 -1
  35. package/dist-standalone/_deps/xregistry/cjs/discovery.js +1 -1
  36. package/dist-standalone/_deps/xregistry/cjs/errors.js +1 -1
  37. package/dist-standalone/_deps/xregistry/cjs/index.js +1 -1
  38. package/dist-standalone/_deps/xregistry/cjs/registry.js +1 -1
  39. package/dist-standalone/_deps/xregistry/cjs/schema.js +1 -1
  40. package/dist-standalone/_deps/xregistry/cjs/types.js +1 -1
  41. package/dist-standalone/_deps/xregistry/discovery.js +1 -1
  42. package/dist-standalone/_deps/xregistry/errors.js +1 -1
  43. package/dist-standalone/_deps/xregistry/index.js +1 -1
  44. package/dist-standalone/_deps/xregistry/registry.js +1 -1
  45. package/dist-standalone/_deps/xregistry/schema.js +1 -1
  46. package/dist-standalone/_deps/xregistry/types.js +1 -1
  47. package/dist-standalone/agent-call.js +1 -642
  48. package/dist-standalone/agent-sdk.js +1 -328
  49. package/dist-standalone/agent.d.ts +95 -5
  50. package/dist-standalone/agent.js +1 -1545
  51. package/dist-standalone/approval.js +1 -193
  52. package/dist-standalone/async-iterators.d.ts +275 -0
  53. package/dist-standalone/async-iterators.js +1 -0
  54. package/dist-standalone/auth.js +1 -219
  55. package/dist-standalone/auto-accept.js +1 -229
  56. package/dist-standalone/backup-config.js +1 -201
  57. package/dist-standalone/backup.d.ts +114 -0
  58. package/dist-standalone/backup.js +1 -0
  59. package/dist-standalone/batch-operations.d.ts +297 -0
  60. package/dist-standalone/batch-operations.js +1 -0
  61. package/dist-standalone/cancellation.d.ts +301 -0
  62. package/dist-standalone/cancellation.js +1 -0
  63. package/dist-standalone/checkpoint.js +1 -186
  64. package/dist-standalone/circuit-breaker.d.ts +351 -0
  65. package/dist-standalone/circuit-breaker.js +1 -0
  66. package/dist-standalone/cjs/agent-call.js +1 -651
  67. package/dist-standalone/cjs/agent-sdk.js +1 -332
  68. package/dist-standalone/cjs/agent.js +1 -1582
  69. package/dist-standalone/cjs/approval.js +1 -199
  70. package/dist-standalone/cjs/async-iterators.js +1 -0
  71. package/dist-standalone/cjs/auth.js +1 -225
  72. package/dist-standalone/cjs/auto-accept.js +1 -233
  73. package/dist-standalone/cjs/backup-config.js +1 -207
  74. package/dist-standalone/cjs/backup.js +1 -0
  75. package/dist-standalone/cjs/batch-operations.js +1 -0
  76. package/dist-standalone/cjs/cancellation.js +1 -0
  77. package/dist-standalone/cjs/checkpoint.js +1 -193
  78. package/dist-standalone/cjs/circuit-breaker.js +1 -0
  79. package/dist-standalone/cjs/cli/init.js +1 -486
  80. package/dist-standalone/cjs/config-validation.js +1 -0
  81. package/dist-standalone/cjs/connect.js +1 -312
  82. package/dist-standalone/cjs/connection-pool.js +1 -0
  83. package/dist-standalone/cjs/correlation-id.js +1 -339
  84. package/dist-standalone/cjs/crypto-utils.js +1 -0
  85. package/dist-standalone/cjs/debug-mode.js +1 -0
  86. package/dist-standalone/cjs/did-document.js +1 -101
  87. package/dist-standalone/cjs/did-privateme.js +1 -130
  88. package/dist-standalone/cjs/did-web.js +1 -201
  89. package/dist-standalone/cjs/discovery.js +1 -462
  90. package/dist-standalone/cjs/dual-mode.js +1 -251
  91. package/dist-standalone/cjs/email-templates.js +1 -313
  92. package/dist-standalone/cjs/email-transport.js +1 -239
  93. package/dist-standalone/cjs/envelope.js +1 -510
  94. package/dist-standalone/cjs/errors.js +1 -826
  95. package/dist-standalone/cjs/event-emitter.js +1 -0
  96. package/dist-standalone/cjs/gateway-state.js +1 -55
  97. package/dist-standalone/cjs/gateway-transport.js +1 -120
  98. package/dist-standalone/cjs/graceful-degradation.js +1 -0
  99. package/dist-standalone/cjs/guardrails.js +1 -223
  100. package/dist-standalone/cjs/health-check.js +1 -0
  101. package/dist-standalone/cjs/http-compat.js +1 -272
  102. package/dist-standalone/cjs/http-status-map.js +1 -571
  103. package/dist-standalone/cjs/identity.js +1 -540
  104. package/dist-standalone/cjs/index.js +1 -237
  105. package/dist-standalone/cjs/invitation.js +1 -421
  106. package/dist-standalone/cjs/invite.js +1 -328
  107. package/dist-standalone/cjs/key-agreement.js +1 -246
  108. package/dist-standalone/cjs/lazy-init.js +1 -300
  109. package/dist-standalone/cjs/logger.js +1 -0
  110. package/dist-standalone/cjs/mdns-discovery.js +1 -202
  111. package/dist-standalone/cjs/nonce-store.js +1 -66
  112. package/dist-standalone/cjs/pairing-manager.js +1 -223
  113. package/dist-standalone/cjs/plugin-system.js +1 -0
  114. package/dist-standalone/cjs/plugins/logging.js +1 -0
  115. package/dist-standalone/cjs/plugins/metrics.js +1 -0
  116. package/dist-standalone/cjs/plugins/validation.js +1 -0
  117. package/dist-standalone/cjs/policy.js +1 -320
  118. package/dist-standalone/cjs/progress-callbacks.js +1 -0
  119. package/dist-standalone/cjs/redis-nonce-store.js +1 -76
  120. package/dist-standalone/cjs/registry-middleware.js +1 -50
  121. package/dist-standalone/cjs/retry-strategies.js +1 -0
  122. package/dist-standalone/cjs/retry-transport.js +1 -102
  123. package/dist-standalone/cjs/runtime/browser.js +1 -0
  124. package/dist-standalone/cjs/runtime/edge.js +1 -0
  125. package/dist-standalone/cjs/runtime/react-native.js +1 -0
  126. package/dist-standalone/cjs/security-policy.js +1 -245
  127. package/dist-standalone/cjs/serialization.js +1 -0
  128. package/dist-standalone/cjs/split-channel.js +1 -177
  129. package/dist-standalone/cjs/subscription-proof.js +1 -230
  130. package/dist-standalone/cjs/succession.js +1 -148
  131. package/dist-standalone/cjs/timeouts.js +1 -0
  132. package/dist-standalone/cjs/trace-context.js +1 -0
  133. package/dist-standalone/cjs/trace-spans.js +1 -0
  134. package/dist-standalone/cjs/transport.js +1 -63
  135. package/dist-standalone/cjs/trust-registry.js +1 -742
  136. package/dist-standalone/cjs/types/error-response.js +1 -56
  137. package/dist-standalone/cjs/vault-auth.js +1 -0
  138. package/dist-standalone/cjs/vault-store-loader.js +1 -0
  139. package/dist-standalone/cjs/verify.js +1 -25
  140. package/dist-standalone/cjs/version-info.js +1 -0
  141. package/dist-standalone/cjs/xfetch.js +1 -252
  142. package/dist-standalone/cli/init.js +1 -449
  143. package/dist-standalone/cli/setup.js +1 -514
  144. package/dist-standalone/cli/types.js +1 -27
  145. package/dist-standalone/cli/xbind.js +1 -148
  146. package/dist-standalone/config-validation.d.ts +185 -0
  147. package/dist-standalone/config-validation.js +1 -0
  148. package/dist-standalone/connect.js +1 -274
  149. package/dist-standalone/connection-pool.d.ts +251 -0
  150. package/dist-standalone/connection-pool.js +1 -0
  151. package/dist-standalone/correlation-id.js +1 -326
  152. package/dist-standalone/crypto-utils.d.ts +60 -0
  153. package/dist-standalone/crypto-utils.js +1 -0
  154. package/dist-standalone/debug-mode.d.ts +286 -0
  155. package/dist-standalone/debug-mode.js +1 -0
  156. package/dist-standalone/did-document.js +1 -96
  157. package/dist-standalone/did-privateme.js +1 -121
  158. package/dist-standalone/did-web.js +1 -196
  159. package/dist-standalone/discovery.js +1 -458
  160. package/dist-standalone/dual-mode.js +1 -247
  161. package/dist-standalone/email-templates.js +1 -309
  162. package/dist-standalone/email-transport.js +1 -232
  163. package/dist-standalone/envelope.d.ts +29 -1
  164. package/dist-standalone/envelope.js +1 -497
  165. package/dist-standalone/errors.d.ts +10 -0
  166. package/dist-standalone/errors.js +1 -811
  167. package/dist-standalone/event-emitter.d.ts +395 -0
  168. package/dist-standalone/event-emitter.js +1 -0
  169. package/dist-standalone/gateway-state.js +1 -51
  170. package/dist-standalone/gateway-transport.js +1 -116
  171. package/dist-standalone/graceful-degradation.d.ts +246 -0
  172. package/dist-standalone/graceful-degradation.js +1 -0
  173. package/dist-standalone/guardrails.js +1 -216
  174. package/dist-standalone/health-check.d.ts +150 -0
  175. package/dist-standalone/health-check.js +1 -0
  176. package/dist-standalone/http-compat.js +1 -267
  177. package/dist-standalone/http-status-map.js +1 -561
  178. package/dist-standalone/identity.d.ts +64 -1
  179. package/dist-standalone/identity.js +1 -515
  180. package/dist-standalone/index.d.ts +45 -3
  181. package/dist-standalone/index.js +1 -52
  182. package/dist-standalone/invitation.js +1 -415
  183. package/dist-standalone/invite.js +1 -324
  184. package/dist-standalone/key-agreement.d.ts +61 -13
  185. package/dist-standalone/key-agreement.js +1 -236
  186. package/dist-standalone/lazy-init.js +1 -295
  187. package/dist-standalone/logger.d.ts +77 -0
  188. package/dist-standalone/logger.js +1 -0
  189. package/dist-standalone/mdns-discovery.js +1 -195
  190. package/dist-standalone/nonce-store.d.ts +16 -3
  191. package/dist-standalone/nonce-store.js +1 -62
  192. package/dist-standalone/package.json +0 -1
  193. package/dist-standalone/pairing-manager.js +1 -219
  194. package/dist-standalone/plugin-system.d.ts +145 -0
  195. package/dist-standalone/plugin-system.js +1 -0
  196. package/dist-standalone/policy.js +1 -315
  197. package/dist-standalone/progress-callbacks.d.ts +394 -0
  198. package/dist-standalone/progress-callbacks.js +1 -0
  199. package/dist-standalone/redis-nonce-store.js +1 -72
  200. package/dist-standalone/registry-middleware.js +1 -47
  201. package/dist-standalone/retry-strategies.d.ts +382 -0
  202. package/dist-standalone/retry-strategies.js +1 -0
  203. package/dist-standalone/retry-transport.js +1 -98
  204. package/dist-standalone/security-policy.js +1 -239
  205. package/dist-standalone/serialization.d.ts +244 -0
  206. package/dist-standalone/serialization.js +1 -0
  207. package/dist-standalone/split-channel.d.ts +49 -1
  208. package/dist-standalone/split-channel.js +1 -171
  209. package/dist-standalone/subscription-proof.js +1 -224
  210. package/dist-standalone/succession.js +1 -142
  211. package/dist-standalone/timeouts.d.ts +275 -0
  212. package/dist-standalone/timeouts.js +1 -0
  213. package/dist-standalone/trace-context.d.ts +252 -0
  214. package/dist-standalone/trace-context.js +1 -0
  215. package/dist-standalone/trace-spans.d.ts +360 -0
  216. package/dist-standalone/trace-spans.js +1 -0
  217. package/dist-standalone/transport.js +1 -59
  218. package/dist-standalone/trust-registry.d.ts +106 -5
  219. package/dist-standalone/trust-registry.js +1 -702
  220. package/dist-standalone/vault-auth.d.ts +91 -0
  221. package/dist-standalone/vault-auth.js +1 -0
  222. package/dist-standalone/vault-store-loader.d.ts +110 -0
  223. package/dist-standalone/vault-store-loader.js +1 -0
  224. package/dist-standalone/verify.js +1 -16
  225. package/dist-standalone/version-info.d.ts +259 -0
  226. package/dist-standalone/version-info.js +1 -0
  227. package/dist-standalone/xfetch.js +1 -247
  228. package/llms.txt +1 -0
  229. package/package.json +65 -5
  230. package/share1.dat +0 -0
  231. package/dist-standalone/_deps/crypto/base64.d.ts +0 -29
  232. package/dist-standalone/_deps/crypto/base64.js +0 -222
  233. package/dist-standalone/_deps/crypto/cjs/base64.js +0 -665
  234. package/dist-standalone/_deps/crypto/cjs/errors.js +0 -675
  235. package/dist-standalone/_deps/crypto/cjs/hmac.js +0 -473
  236. package/dist-standalone/_deps/crypto/cjs/index.js +0 -852
  237. package/dist-standalone/_deps/crypto/cjs/package.json +0 -1
  238. package/dist-standalone/_deps/crypto/cjs/padding.js +0 -511
  239. package/dist-standalone/_deps/crypto/cjs/share-header.js +0 -372
  240. package/dist-standalone/_deps/crypto/cjs/shares.js +0 -874
  241. package/dist-standalone/_deps/crypto/cjs/tlv.js +0 -1021
  242. package/dist-standalone/_deps/crypto/cjs/uuid.js +0 -443
  243. package/dist-standalone/_deps/crypto/cjs/verify.js +0 -414
  244. package/dist-standalone/_deps/crypto/cjs/xorida.js +0 -923
  245. package/dist-standalone/_deps/crypto/errors.d.ts +0 -51
  246. package/dist-standalone/_deps/crypto/errors.js +0 -199
  247. package/dist-standalone/_deps/crypto/hmac.d.ts +0 -39
  248. package/dist-standalone/_deps/crypto/hmac.js +0 -134
  249. package/dist-standalone/_deps/crypto/index.d.ts +0 -20
  250. package/dist-standalone/_deps/crypto/index.js +0 -145
  251. package/dist-standalone/_deps/crypto/padding.d.ts +0 -19
  252. package/dist-standalone/_deps/crypto/padding.js +0 -159
  253. package/dist-standalone/_deps/crypto/share-header.d.ts +0 -44
  254. package/dist-standalone/_deps/crypto/share-header.js +0 -92
  255. package/dist-standalone/_deps/crypto/shares.d.ts +0 -27
  256. package/dist-standalone/_deps/crypto/shares.js +0 -295
  257. package/dist-standalone/_deps/crypto/tlv.d.ts +0 -26
  258. package/dist-standalone/_deps/crypto/tlv.js +0 -364
  259. package/dist-standalone/_deps/crypto/uuid.d.ts +0 -22
  260. package/dist-standalone/_deps/crypto/uuid.js +0 -136
  261. package/dist-standalone/_deps/crypto/verify.d.ts +0 -15
  262. package/dist-standalone/_deps/crypto/verify.js +0 -71
  263. package/dist-standalone/_deps/crypto/xorida.d.ts +0 -44
  264. package/dist-standalone/_deps/crypto/xorida.js +0 -366
  265. package/dist-standalone/_deps/shared/errors.d.ts.map +0 -1
  266. package/dist-standalone/_deps/shared/errors.js.map +0 -1
  267. package/dist-standalone/_deps/shared/index.d.ts.map +0 -1
  268. package/dist-standalone/_deps/shared/index.js.map +0 -1
  269. package/dist-standalone/_deps/shared/types.d.ts.map +0 -1
  270. package/dist-standalone/_deps/shared/types.js.map +0 -1
  271. package/dist-standalone/_deps/ux-helpers/cjs/errors.d.ts.map +0 -1
  272. package/dist-standalone/_deps/ux-helpers/cjs/errors.js.map +0 -1
  273. package/dist-standalone/_deps/ux-helpers/cjs/index.d.ts.map +0 -1
  274. package/dist-standalone/_deps/ux-helpers/cjs/index.js.map +0 -1
  275. package/dist-standalone/_deps/ux-helpers/cjs/pagination.d.ts.map +0 -1
  276. package/dist-standalone/_deps/ux-helpers/cjs/pagination.js.map +0 -1
  277. package/dist-standalone/_deps/ux-helpers/cjs/progress.d.ts.map +0 -1
  278. package/dist-standalone/_deps/ux-helpers/cjs/progress.js.map +0 -1
  279. package/dist-standalone/_deps/ux-helpers/cjs/search.d.ts.map +0 -1
  280. package/dist-standalone/_deps/ux-helpers/cjs/search.js.map +0 -1
  281. package/dist-standalone/_deps/ux-helpers/cjs/types.d.ts.map +0 -1
  282. package/dist-standalone/_deps/ux-helpers/cjs/types.js.map +0 -1
  283. package/dist-standalone/_deps/ux-helpers/errors.d.ts.map +0 -1
  284. package/dist-standalone/_deps/ux-helpers/errors.js.map +0 -1
  285. package/dist-standalone/_deps/ux-helpers/index.d.ts.map +0 -1
  286. package/dist-standalone/_deps/ux-helpers/index.js.map +0 -1
  287. package/dist-standalone/_deps/ux-helpers/pagination.d.ts.map +0 -1
  288. package/dist-standalone/_deps/ux-helpers/pagination.js.map +0 -1
  289. package/dist-standalone/_deps/ux-helpers/progress.d.ts.map +0 -1
  290. package/dist-standalone/_deps/ux-helpers/progress.js.map +0 -1
  291. package/dist-standalone/_deps/ux-helpers/search.d.ts.map +0 -1
  292. package/dist-standalone/_deps/ux-helpers/search.js.map +0 -1
  293. package/dist-standalone/_deps/ux-helpers/types.d.ts.map +0 -1
  294. package/dist-standalone/_deps/ux-helpers/types.js.map +0 -1
  295. package/dist-standalone/_deps/xregistry/discovery.d.ts.map +0 -1
  296. package/dist-standalone/_deps/xregistry/discovery.js.map +0 -1
  297. package/dist-standalone/_deps/xregistry/errors.d.ts.map +0 -1
  298. package/dist-standalone/_deps/xregistry/errors.js.map +0 -1
  299. package/dist-standalone/_deps/xregistry/index.d.ts.map +0 -1
  300. package/dist-standalone/_deps/xregistry/index.js.map +0 -1
  301. package/dist-standalone/_deps/xregistry/registry.d.ts.map +0 -1
  302. package/dist-standalone/_deps/xregistry/registry.js.map +0 -1
  303. package/dist-standalone/_deps/xregistry/schema.d.ts.map +0 -1
  304. package/dist-standalone/_deps/xregistry/schema.js.map +0 -1
  305. package/dist-standalone/_deps/xregistry/types.d.ts.map +0 -1
  306. package/dist-standalone/_deps/xregistry/types.js.map +0 -1
@@ -1,571 +1 @@
1
- "use strict";
2
- /**
3
- * @module http-status-map
4
- * Maps xBind error codes to HTTP status codes for REST API responses.
5
- *
6
- * This mapping provides:
7
- * - Consistent HTTP status codes for all 52 xBind error codes
8
- * - Retryability information for client retry logic
9
- * - Error categorization (client vs server errors)
10
- * - Human-readable status text
11
- *
12
- * Based on RFC 9110 HTTP Semantics and REST API best practices.
13
- *
14
- * @example
15
- * ```typescript
16
- * import { getHttpStatus, isRetryable } from '@private.me/xbind/http-status-map';
17
- *
18
- * const status = getHttpStatus('VERIFY_FAILED'); // 401
19
- * const canRetry = isRetryable('NETWORK_ERROR'); // true
20
- * ```
21
- */
22
- Object.defineProperty(exports, "__esModule", { value: true });
23
- exports.HTTP_STATUS_MAP = void 0;
24
- exports.getHttpStatus = getHttpStatus;
25
- exports.getStatusText = getStatusText;
26
- exports.isRetryable = isRetryable;
27
- exports.getMapping = getMapping;
28
- exports.getErrorCodesByCategory = getErrorCodesByCategory;
29
- exports.getRetryableErrorCodes = getRetryableErrorCodes;
30
- exports.validateCoverage = validateCoverage;
31
- /**
32
- * Complete mapping of xBind error codes to HTTP status codes.
33
- * All 52 error codes are mapped for 100% coverage.
34
- */
35
- exports.HTTP_STATUS_MAP = {
36
- // ============================================================================
37
- // IDENTITY (8 error codes)
38
- // ============================================================================
39
- KEYGEN_FAILED: {
40
- statusCode: 500,
41
- statusText: 'Internal Server Error',
42
- retryable: true,
43
- errorType: 'Server',
44
- category: 'Identity',
45
- rationale: 'Server crypto initialization failure - client should retry',
46
- },
47
- SIGN_FAILED: {
48
- statusCode: 500,
49
- statusText: 'Internal Server Error',
50
- retryable: false,
51
- errorType: 'Server',
52
- category: 'Identity',
53
- rationale: 'Server key corruption - requires admin intervention',
54
- },
55
- VERIFY_FAILED: {
56
- statusCode: 401,
57
- statusText: 'Unauthorized',
58
- retryable: false,
59
- errorType: 'Client',
60
- category: 'Identity',
61
- rationale: 'Invalid signature - authentication failure',
62
- },
63
- INVALID_DID: {
64
- statusCode: 400,
65
- statusText: 'Bad Request',
66
- retryable: false,
67
- errorType: 'Client',
68
- category: 'Identity',
69
- rationale: 'Malformed DID format - client validation error',
70
- },
71
- INVALID_KEY_LENGTH: {
72
- statusCode: 400,
73
- statusText: 'Bad Request',
74
- retryable: false,
75
- errorType: 'Client',
76
- category: 'Identity',
77
- rationale: 'Invalid key material size - client validation error',
78
- },
79
- EXPORT_FAILED: {
80
- statusCode: 500,
81
- statusText: 'Internal Server Error',
82
- retryable: true,
83
- errorType: 'Server',
84
- category: 'Identity',
85
- rationale: 'Crypto API failure - transient server issue',
86
- },
87
- IMPORT_FAILED: {
88
- statusCode: 400,
89
- statusText: 'Bad Request',
90
- retryable: false,
91
- errorType: 'Client',
92
- category: 'Identity',
93
- rationale: 'Invalid PKCS8 format - client validation error',
94
- },
95
- // ============================================================================
96
- // ENVELOPE (7 error codes)
97
- // ============================================================================
98
- INVALID_VERSION: {
99
- statusCode: 400,
100
- statusText: 'Bad Request',
101
- retryable: false,
102
- errorType: 'Client',
103
- category: 'Envelope',
104
- rationale: 'Unsupported protocol version - client must upgrade',
105
- },
106
- INVALID_ALG: {
107
- statusCode: 400,
108
- statusText: 'Bad Request',
109
- retryable: false,
110
- errorType: 'Client',
111
- category: 'Envelope',
112
- rationale: 'Unsupported algorithm - client must use AES-256-GCM',
113
- },
114
- INVALID_NONCE: {
115
- statusCode: 400,
116
- statusText: 'Bad Request',
117
- retryable: false,
118
- errorType: 'Client',
119
- category: 'Envelope',
120
- rationale: 'Missing or invalid nonce - client validation error',
121
- },
122
- INVALID_FIELDS: {
123
- statusCode: 400,
124
- statusText: 'Bad Request',
125
- retryable: false,
126
- errorType: 'Client',
127
- category: 'Envelope',
128
- rationale: 'Missing required envelope fields - client validation error',
129
- },
130
- ENCRYPT_FAILED: {
131
- statusCode: 500,
132
- statusText: 'Internal Server Error',
133
- retryable: true,
134
- errorType: 'Server',
135
- category: 'Envelope',
136
- rationale: 'Server encryption failure - transient issue',
137
- },
138
- DECRYPT_FAILED: {
139
- statusCode: 401,
140
- statusText: 'Unauthorized',
141
- retryable: false,
142
- errorType: 'Client',
143
- category: 'Envelope',
144
- rationale: 'Decryption failed - wrong key or corrupted data',
145
- },
146
- PARSE_FAILED: {
147
- statusCode: 400,
148
- statusText: 'Bad Request',
149
- retryable: false,
150
- errorType: 'Client',
151
- category: 'Envelope',
152
- rationale: 'Malformed JSON envelope - client validation error',
153
- },
154
- // ============================================================================
155
- // TRANSPORT (4 error codes)
156
- // ============================================================================
157
- SEND_FAILED: {
158
- statusCode: 503,
159
- statusText: 'Service Unavailable',
160
- retryable: true,
161
- errorType: 'Server',
162
- category: 'Transport',
163
- rationale: 'Network send failure - retry with backoff',
164
- },
165
- NETWORK_ERROR: {
166
- statusCode: 503,
167
- statusText: 'Service Unavailable',
168
- retryable: true,
169
- errorType: 'Server',
170
- category: 'Transport',
171
- rationale: 'Network connectivity issue - retry with backoff',
172
- },
173
- RECIPIENT_UNREACHABLE: {
174
- statusCode: 503,
175
- statusText: 'Service Unavailable',
176
- retryable: true,
177
- errorType: 'Server',
178
- category: 'Transport',
179
- rationale: 'Recipient offline or unreachable - retry later',
180
- },
181
- TIMEOUT: {
182
- statusCode: 504,
183
- statusText: 'Gateway Timeout',
184
- retryable: true,
185
- errorType: 'Server',
186
- category: 'Transport',
187
- rationale: 'Request timed out - increase timeout and retry',
188
- },
189
- // ============================================================================
190
- // REGISTRY (3 error codes)
191
- // ============================================================================
192
- NOT_FOUND: {
193
- statusCode: 404,
194
- statusText: 'Not Found',
195
- retryable: false,
196
- errorType: 'Client',
197
- category: 'Registry',
198
- rationale: 'Agent not in registry - recipient must register first',
199
- },
200
- ALREADY_REGISTERED: {
201
- statusCode: 409,
202
- statusText: 'Conflict',
203
- retryable: false,
204
- errorType: 'Client',
205
- category: 'Registry',
206
- rationale: 'DID already exists - use updateAgent instead',
207
- },
208
- REVOKED: {
209
- statusCode: 403,
210
- statusText: 'Forbidden',
211
- retryable: false,
212
- errorType: 'Client',
213
- category: 'Registry',
214
- rationale: 'Agent revoked - contact admin for re-registration',
215
- },
216
- // ============================================================================
217
- // KEY AGREEMENT (8 error codes)
218
- // ============================================================================
219
- DERIVE_FAILED: {
220
- statusCode: 500,
221
- statusText: 'Internal Server Error',
222
- retryable: true,
223
- errorType: 'Server',
224
- category: 'Key Agreement',
225
- rationale: 'ECDH derivation failure - transient crypto issue',
226
- },
227
- KEM_ENCAPSULATE_FAILED: {
228
- statusCode: 500,
229
- statusText: 'Internal Server Error',
230
- retryable: true,
231
- errorType: 'Server',
232
- category: 'Key Agreement',
233
- rationale: 'ML-KEM encapsulation failure - transient crypto issue',
234
- },
235
- KEM_DECAPSULATE_FAILED: {
236
- statusCode: 401,
237
- statusText: 'Unauthorized',
238
- retryable: false,
239
- errorType: 'Client',
240
- category: 'Key Agreement',
241
- rationale: 'ML-KEM decapsulation failed - wrong ciphertext',
242
- },
243
- HKDF_FAILED: {
244
- statusCode: 500,
245
- statusText: 'Internal Server Error',
246
- retryable: true,
247
- errorType: 'Server',
248
- category: 'Key Agreement',
249
- rationale: 'HKDF derivation failure - transient crypto issue',
250
- },
251
- MLKEM_NOT_AVAILABLE: {
252
- statusCode: 400,
253
- statusText: 'Bad Request',
254
- retryable: false,
255
- errorType: 'Client',
256
- category: 'Key Agreement',
257
- rationale: 'Post-quantum not enabled - client must configure',
258
- },
259
- PQ_SIGN_FAILED: {
260
- statusCode: 500,
261
- statusText: 'Internal Server Error',
262
- retryable: true,
263
- errorType: 'Server',
264
- category: 'Key Agreement',
265
- rationale: 'ML-DSA signing failure - transient crypto issue',
266
- },
267
- PQ_VERIFY_FAILED: {
268
- statusCode: 401,
269
- statusText: 'Unauthorized',
270
- retryable: false,
271
- errorType: 'Client',
272
- category: 'Key Agreement',
273
- rationale: 'ML-DSA verification failed - invalid signature',
274
- },
275
- // ============================================================================
276
- // SPLIT CHANNEL (6 error codes)
277
- // ============================================================================
278
- SPLIT_FAILED: {
279
- statusCode: 500,
280
- statusText: 'Internal Server Error',
281
- retryable: true,
282
- errorType: 'Server',
283
- category: 'Split Channel',
284
- rationale: 'XorIDA split failure - transient issue',
285
- },
286
- INSUFFICIENT_SHARES: {
287
- statusCode: 400,
288
- statusText: 'Bad Request',
289
- retryable: false,
290
- errorType: 'Client',
291
- category: 'Split Channel',
292
- rationale: 'Not enough shares - client must collect more',
293
- },
294
- INCONSISTENT_SHARES: {
295
- statusCode: 400,
296
- statusText: 'Bad Request',
297
- retryable: false,
298
- errorType: 'Client',
299
- category: 'Split Channel',
300
- rationale: 'Mismatched shares - client validation error',
301
- },
302
- HMAC_VERIFICATION_FAILED: {
303
- statusCode: 401,
304
- statusText: 'Unauthorized',
305
- retryable: false,
306
- errorType: 'Client',
307
- category: 'Split Channel',
308
- rationale: 'Share tampered with - security violation',
309
- },
310
- UNPAD_FAILED: {
311
- statusCode: 500,
312
- statusText: 'Internal Server Error',
313
- retryable: false,
314
- errorType: 'Server',
315
- category: 'Split Channel',
316
- rationale: 'Padding removal error - data corruption',
317
- },
318
- INVALID_SHARE_DATA: {
319
- statusCode: 400,
320
- statusText: 'Bad Request',
321
- retryable: false,
322
- errorType: 'Client',
323
- category: 'Split Channel',
324
- rationale: 'Malformed share format - client validation error',
325
- },
326
- // ============================================================================
327
- // XCHANGE (4 error codes)
328
- // ============================================================================
329
- XCHANGE_KEYGEN_FAILED: {
330
- statusCode: 500,
331
- statusText: 'Internal Server Error',
332
- retryable: true,
333
- errorType: 'Server',
334
- category: 'Xchange',
335
- rationale: 'Key generation failure - transient crypto issue',
336
- },
337
- XCHANGE_ENCRYPT_FAILED: {
338
- statusCode: 500,
339
- statusText: 'Internal Server Error',
340
- retryable: true,
341
- errorType: 'Server',
342
- category: 'Xchange',
343
- rationale: 'Bundle encryption failure - transient crypto issue',
344
- },
345
- XCHANGE_DECRYPT_FAILED: {
346
- statusCode: 401,
347
- statusText: 'Unauthorized',
348
- retryable: false,
349
- errorType: 'Client',
350
- category: 'Xchange',
351
- rationale: 'Bundle decryption failed - wrong key',
352
- },
353
- INVALID_BUNDLE: {
354
- statusCode: 400,
355
- statusText: 'Bad Request',
356
- retryable: false,
357
- errorType: 'Client',
358
- category: 'Xchange',
359
- rationale: 'Malformed bundle format - client validation error',
360
- },
361
- // ============================================================================
362
- // AGENT (12 error codes)
363
- // ============================================================================
364
- IDENTITY_FAILED: {
365
- statusCode: 500,
366
- statusText: 'Internal Server Error',
367
- retryable: true,
368
- errorType: 'Server',
369
- category: 'Agent',
370
- rationale: 'Agent identity creation failed - transient issue',
371
- },
372
- REGISTRATION_FAILED: {
373
- statusCode: 503,
374
- statusText: 'Service Unavailable',
375
- retryable: true,
376
- errorType: 'Server',
377
- category: 'Agent',
378
- rationale: 'Registry unavailable - retry with backoff',
379
- },
380
- RECIPIENT_NOT_FOUND: {
381
- statusCode: 404,
382
- statusText: 'Not Found',
383
- retryable: false,
384
- errorType: 'Client',
385
- category: 'Agent',
386
- rationale: 'Recipient not in registry - recipient must register',
387
- },
388
- RECIPIENT_REVOKED: {
389
- statusCode: 403,
390
- statusText: 'Forbidden',
391
- retryable: false,
392
- errorType: 'Client',
393
- category: 'Agent',
394
- rationale: 'Recipient revoked - contact admin',
395
- },
396
- KEY_AGREEMENT_FAILED: {
397
- statusCode: 500,
398
- statusText: 'Internal Server Error',
399
- retryable: true,
400
- errorType: 'Server',
401
- category: 'Agent',
402
- rationale: 'Key agreement failure - transient crypto issue',
403
- },
404
- ENVELOPE_FAILED: {
405
- statusCode: 500,
406
- statusText: 'Internal Server Error',
407
- retryable: true,
408
- errorType: 'Server',
409
- category: 'Agent',
410
- rationale: 'Envelope creation failed - transient issue',
411
- },
412
- VERIFICATION_FAILED: {
413
- statusCode: 401,
414
- statusText: 'Unauthorized',
415
- retryable: false,
416
- errorType: 'Client',
417
- category: 'Agent',
418
- rationale: 'Envelope verification failed - authentication error',
419
- },
420
- REPLAY_DETECTED: {
421
- statusCode: 403,
422
- statusText: 'Forbidden',
423
- retryable: false,
424
- errorType: 'Client',
425
- category: 'Agent',
426
- rationale: 'Replay attack detected - security violation',
427
- },
428
- SCOPE_DENIED: {
429
- statusCode: 403,
430
- statusText: 'Forbidden',
431
- retryable: false,
432
- errorType: 'Client',
433
- category: 'Agent',
434
- rationale: 'Sender lacks scope permission - authorization failure',
435
- },
436
- RECEIVER_SCOPE_DENIED: {
437
- statusCode: 403,
438
- statusText: 'Forbidden',
439
- retryable: false,
440
- errorType: 'Client',
441
- category: 'Agent',
442
- rationale: 'Recipient rejects scope - authorization failure',
443
- },
444
- TIMESTAMP_EXPIRED: {
445
- statusCode: 400,
446
- statusText: 'Bad Request',
447
- retryable: true,
448
- errorType: 'Client',
449
- category: 'Agent',
450
- rationale: 'Timestamp outside window - clock sync issue (retryable)',
451
- },
452
- };
453
- /**
454
- * Get HTTP status code for a given xBind error code.
455
- * Handles colon-separated sub-codes (e.g., 'DECRYPT_FAILED:KEY_AGREEMENT').
456
- *
457
- * @param errorCode - xBind error code (e.g., 'VERIFY_FAILED')
458
- * @returns HTTP status code (e.g., 401) or 500 if unknown
459
- *
460
- * @example
461
- * ```typescript
462
- * getHttpStatus('VERIFY_FAILED') // 401
463
- * getHttpStatus('DECRYPT_FAILED:NETWORK') // 401 (ignores sub-code)
464
- * getHttpStatus('UNKNOWN_ERROR') // 500 (fallback)
465
- * ```
466
- */
467
- function getHttpStatus(errorCode) {
468
- const baseCode = errorCode.split(':')[0] ?? errorCode;
469
- const mapping = exports.HTTP_STATUS_MAP[baseCode];
470
- return mapping?.statusCode ?? 500; // Default to 500 for unknown errors
471
- }
472
- /**
473
- * Get HTTP status text for a given xBind error code.
474
- *
475
- * @param errorCode - xBind error code (e.g., 'VERIFY_FAILED')
476
- * @returns HTTP status text (e.g., 'Unauthorized') or 'Internal Server Error' if unknown
477
- *
478
- * @example
479
- * ```typescript
480
- * getStatusText('VERIFY_FAILED') // 'Unauthorized'
481
- * getStatusText('NOT_FOUND') // 'Not Found'
482
- * ```
483
- */
484
- function getStatusText(errorCode) {
485
- const baseCode = errorCode.split(':')[0] ?? errorCode;
486
- const mapping = exports.HTTP_STATUS_MAP[baseCode];
487
- return mapping?.statusText ?? 'Internal Server Error';
488
- }
489
- /**
490
- * Check if an error is retryable by the client.
491
- *
492
- * @param errorCode - xBind error code (e.g., 'NETWORK_ERROR')
493
- * @returns True if the client should retry the operation
494
- *
495
- * @example
496
- * ```typescript
497
- * isRetryable('NETWORK_ERROR') // true (503 - retry with backoff)
498
- * isRetryable('VERIFY_FAILED') // false (401 - authentication failure)
499
- * isRetryable('KEYGEN_FAILED') // true (500 - transient server issue)
500
- * ```
501
- */
502
- function isRetryable(errorCode) {
503
- const baseCode = errorCode.split(':')[0] ?? errorCode;
504
- const mapping = exports.HTTP_STATUS_MAP[baseCode];
505
- return mapping?.retryable ?? false; // Default to non-retryable for unknown errors
506
- }
507
- /**
508
- * Get complete mapping information for an error code.
509
- *
510
- * @param errorCode - xBind error code (e.g., 'VERIFY_FAILED')
511
- * @returns Complete mapping information or null if not found
512
- *
513
- * @example
514
- * ```typescript
515
- * const mapping = getMapping('VERIFY_FAILED');
516
- * if (mapping) {
517
- * console.log(`${mapping.statusCode} ${mapping.statusText}`);
518
- * console.log(`Retryable: ${mapping.retryable}`);
519
- * console.log(`Rationale: ${mapping.rationale}`);
520
- * }
521
- * ```
522
- */
523
- function getMapping(errorCode) {
524
- const baseCode = errorCode.split(':')[0] ?? errorCode;
525
- return exports.HTTP_STATUS_MAP[baseCode] ?? null;
526
- }
527
- /**
528
- * Get all error codes in a specific category.
529
- *
530
- * @param category - Error category (e.g., 'Identity', 'Transport')
531
- * @returns Array of error codes in that category
532
- *
533
- * @example
534
- * ```typescript
535
- * const identityErrors = getErrorCodesByCategory('Identity');
536
- * // ['KEYGEN_FAILED', 'SIGN_FAILED', 'VERIFY_FAILED', ...]
537
- * ```
538
- */
539
- function getErrorCodesByCategory(category) {
540
- return Object.entries(exports.HTTP_STATUS_MAP)
541
- .filter(([_, mapping]) => mapping.category === category)
542
- .map(([code]) => code);
543
- }
544
- /**
545
- * Get all retryable error codes.
546
- *
547
- * @returns Array of error codes that are retryable
548
- *
549
- * @example
550
- * ```typescript
551
- * const retryableErrors = getRetryableErrorCodes();
552
- * // ['KEYGEN_FAILED', 'EXPORT_FAILED', 'ENCRYPT_FAILED', ...]
553
- * ```
554
- */
555
- function getRetryableErrorCodes() {
556
- return Object.entries(exports.HTTP_STATUS_MAP)
557
- .filter(([_, mapping]) => mapping.retryable)
558
- .map(([code]) => code);
559
- }
560
- /**
561
- * Validate that all error codes from the CSV are mapped.
562
- * This function is used for testing purposes to ensure 100% coverage.
563
- *
564
- * @param csvErrorCodes - Array of error codes from the CSV file
565
- * @returns Array of missing error codes (empty if all mapped)
566
- *
567
- * @internal
568
- */
569
- function validateCoverage(csvErrorCodes) {
570
- return csvErrorCodes.filter((code) => !exports.HTTP_STATUS_MAP[code]);
571
- }
1
+ "use strict";function getHttpStatus(e){const t=e.split(":")[0]??e,r=exports.HTTP_STATUS_MAP[t];return r?.statusCode??500}function getStatusText(e){const t=e.split(":")[0]??e,r=exports.HTTP_STATUS_MAP[t];return r?.statusText??"Internal Server Error"}function isRetryable(e){const t=e.split(":")[0]??e,r=exports.HTTP_STATUS_MAP[t];return r?.retryable??!1}function getMapping(e){const t=e.split(":")[0]??e;return exports.HTTP_STATUS_MAP[t]??null}function getErrorCodesByCategory(e){return Object.entries(exports.HTTP_STATUS_MAP).filter(([t,r])=>r.category===e).map(([e])=>e)}function getRetryableErrorCodes(){return Object.entries(exports.HTTP_STATUS_MAP).filter(([e,t])=>t.retryable).map(([e])=>e)}function validateCoverage(e){return e.filter(e=>!exports.HTTP_STATUS_MAP[e])}Object.defineProperty(exports,"__esModule",{value:!0}),exports.HTTP_STATUS_MAP=void 0,exports.getHttpStatus=getHttpStatus,exports.getStatusText=getStatusText,exports.isRetryable=isRetryable,exports.getMapping=getMapping,exports.getErrorCodesByCategory=getErrorCodesByCategory,exports.getRetryableErrorCodes=getRetryableErrorCodes,exports.validateCoverage=validateCoverage,exports.HTTP_STATUS_MAP={KEYGEN_FAILED:{statusCode:500,statusText:"Internal Server Error",retryable:!0,errorType:"Server",category:"Identity",rationale:"Server crypto initialization failure - client should retry"},SIGN_FAILED:{statusCode:500,statusText:"Internal Server Error",retryable:!1,errorType:"Server",category:"Identity",rationale:"Server key corruption - requires admin intervention"},VERIFY_FAILED:{statusCode:401,statusText:"Unauthorized",retryable:!1,errorType:"Client",category:"Identity",rationale:"Invalid signature - authentication failure"},INVALID_DID:{statusCode:400,statusText:"Bad Request",retryable:!1,errorType:"Client",category:"Identity",rationale:"Malformed DID format - client validation error"},INVALID_KEY_LENGTH:{statusCode:400,statusText:"Bad Request",retryable:!1,errorType:"Client",category:"Identity",rationale:"Invalid key material size - client validation error"},EXPORT_FAILED:{statusCode:500,statusText:"Internal Server Error",retryable:!0,errorType:"Server",category:"Identity",rationale:"Crypto API failure - transient server issue"},IMPORT_FAILED:{statusCode:400,statusText:"Bad Request",retryable:!1,errorType:"Client",category:"Identity",rationale:"Invalid PKCS8 format - client validation error"},INVALID_VERSION:{statusCode:400,statusText:"Bad Request",retryable:!1,errorType:"Client",category:"Envelope",rationale:"Unsupported protocol version - client must upgrade"},INVALID_ALG:{statusCode:400,statusText:"Bad Request",retryable:!1,errorType:"Client",category:"Envelope",rationale:"Unsupported algorithm - client must use AES-256-GCM"},INVALID_NONCE:{statusCode:400,statusText:"Bad Request",retryable:!1,errorType:"Client",category:"Envelope",rationale:"Missing or invalid nonce - client validation error"},INVALID_FIELDS:{statusCode:400,statusText:"Bad Request",retryable:!1,errorType:"Client",category:"Envelope",rationale:"Missing required envelope fields - client validation error"},ENCRYPT_FAILED:{statusCode:500,statusText:"Internal Server Error",retryable:!0,errorType:"Server",category:"Envelope",rationale:"Server encryption failure - transient issue"},DECRYPT_FAILED:{statusCode:401,statusText:"Unauthorized",retryable:!1,errorType:"Client",category:"Envelope",rationale:"Decryption failed - wrong key or corrupted data"},PARSE_FAILED:{statusCode:400,statusText:"Bad Request",retryable:!1,errorType:"Client",category:"Envelope",rationale:"Malformed JSON envelope - client validation error"},SEND_FAILED:{statusCode:503,statusText:"Service Unavailable",retryable:!0,errorType:"Server",category:"Transport",rationale:"Network send failure - retry with backoff"},NETWORK_ERROR:{statusCode:503,statusText:"Service Unavailable",retryable:!0,errorType:"Server",category:"Transport",rationale:"Network connectivity issue - retry with backoff"},RECIPIENT_UNREACHABLE:{statusCode:503,statusText:"Service Unavailable",retryable:!0,errorType:"Server",category:"Transport",rationale:"Recipient offline or unreachable - retry later"},TIMEOUT:{statusCode:504,statusText:"Gateway Timeout",retryable:!0,errorType:"Server",category:"Transport",rationale:"Request timed out - increase timeout and retry"},NOT_FOUND:{statusCode:404,statusText:"Not Found",retryable:!1,errorType:"Client",category:"Registry",rationale:"Agent not in registry - recipient must register first"},ALREADY_REGISTERED:{statusCode:409,statusText:"Conflict",retryable:!1,errorType:"Client",category:"Registry",rationale:"DID already exists - use updateAgent instead"},REVOKED:{statusCode:403,statusText:"Forbidden",retryable:!1,errorType:"Client",category:"Registry",rationale:"Agent revoked - contact admin for re-registration"},DERIVE_FAILED:{statusCode:500,statusText:"Internal Server Error",retryable:!0,errorType:"Server",category:"Key Agreement",rationale:"ECDH derivation failure - transient crypto issue"},KEM_ENCAPSULATE_FAILED:{statusCode:500,statusText:"Internal Server Error",retryable:!0,errorType:"Server",category:"Key Agreement",rationale:"ML-KEM encapsulation failure - transient crypto issue"},KEM_DECAPSULATE_FAILED:{statusCode:401,statusText:"Unauthorized",retryable:!1,errorType:"Client",category:"Key Agreement",rationale:"ML-KEM decapsulation failed - wrong ciphertext"},HKDF_FAILED:{statusCode:500,statusText:"Internal Server Error",retryable:!0,errorType:"Server",category:"Key Agreement",rationale:"HKDF derivation failure - transient crypto issue"},MLKEM_NOT_AVAILABLE:{statusCode:400,statusText:"Bad Request",retryable:!1,errorType:"Client",category:"Key Agreement",rationale:"Post-quantum not enabled - client must configure"},PQ_SIGN_FAILED:{statusCode:500,statusText:"Internal Server Error",retryable:!0,errorType:"Server",category:"Key Agreement",rationale:"ML-DSA signing failure - transient crypto issue"},PQ_VERIFY_FAILED:{statusCode:401,statusText:"Unauthorized",retryable:!1,errorType:"Client",category:"Key Agreement",rationale:"ML-DSA verification failed - invalid signature"},SPLIT_FAILED:{statusCode:500,statusText:"Internal Server Error",retryable:!0,errorType:"Server",category:"Split Channel",rationale:"XorIDA split failure - transient issue"},INSUFFICIENT_SHARES:{statusCode:400,statusText:"Bad Request",retryable:!1,errorType:"Client",category:"Split Channel",rationale:"Not enough shares - client must collect more"},INCONSISTENT_SHARES:{statusCode:400,statusText:"Bad Request",retryable:!1,errorType:"Client",category:"Split Channel",rationale:"Mismatched shares - client validation error"},HMAC_VERIFICATION_FAILED:{statusCode:401,statusText:"Unauthorized",retryable:!1,errorType:"Client",category:"Split Channel",rationale:"Share tampered with - security violation"},UNPAD_FAILED:{statusCode:500,statusText:"Internal Server Error",retryable:!1,errorType:"Server",category:"Split Channel",rationale:"Padding removal error - data corruption"},INVALID_SHARE_DATA:{statusCode:400,statusText:"Bad Request",retryable:!1,errorType:"Client",category:"Split Channel",rationale:"Malformed share format - client validation error"},XCHANGE_KEYGEN_FAILED:{statusCode:500,statusText:"Internal Server Error",retryable:!0,errorType:"Server",category:"Xchange",rationale:"Key generation failure - transient crypto issue"},XCHANGE_ENCRYPT_FAILED:{statusCode:500,statusText:"Internal Server Error",retryable:!0,errorType:"Server",category:"Xchange",rationale:"Bundle encryption failure - transient crypto issue"},XCHANGE_DECRYPT_FAILED:{statusCode:401,statusText:"Unauthorized",retryable:!1,errorType:"Client",category:"Xchange",rationale:"Bundle decryption failed - wrong key"},INVALID_BUNDLE:{statusCode:400,statusText:"Bad Request",retryable:!1,errorType:"Client",category:"Xchange",rationale:"Malformed bundle format - client validation error"},IDENTITY_FAILED:{statusCode:500,statusText:"Internal Server Error",retryable:!0,errorType:"Server",category:"Agent",rationale:"Agent identity creation failed - transient issue"},REGISTRATION_FAILED:{statusCode:503,statusText:"Service Unavailable",retryable:!0,errorType:"Server",category:"Agent",rationale:"Registry unavailable - retry with backoff"},RECIPIENT_NOT_FOUND:{statusCode:404,statusText:"Not Found",retryable:!1,errorType:"Client",category:"Agent",rationale:"Recipient not in registry - recipient must register"},RECIPIENT_REVOKED:{statusCode:403,statusText:"Forbidden",retryable:!1,errorType:"Client",category:"Agent",rationale:"Recipient revoked - contact admin"},KEY_AGREEMENT_FAILED:{statusCode:500,statusText:"Internal Server Error",retryable:!0,errorType:"Server",category:"Agent",rationale:"Key agreement failure - transient crypto issue"},ENVELOPE_FAILED:{statusCode:500,statusText:"Internal Server Error",retryable:!0,errorType:"Server",category:"Agent",rationale:"Envelope creation failed - transient issue"},VERIFICATION_FAILED:{statusCode:401,statusText:"Unauthorized",retryable:!1,errorType:"Client",category:"Agent",rationale:"Envelope verification failed - authentication error"},REPLAY_DETECTED:{statusCode:403,statusText:"Forbidden",retryable:!1,errorType:"Client",category:"Agent",rationale:"Replay attack detected - security violation"},SCOPE_DENIED:{statusCode:403,statusText:"Forbidden",retryable:!1,errorType:"Client",category:"Agent",rationale:"Sender lacks scope permission - authorization failure"},RECEIVER_SCOPE_DENIED:{statusCode:403,statusText:"Forbidden",retryable:!1,errorType:"Client",category:"Agent",rationale:"Recipient rejects scope - authorization failure"},TIMESTAMP_EXPIRED:{statusCode:400,statusText:"Bad Request",retryable:!0,errorType:"Client",category:"Agent",rationale:"Timestamp outside window - clock sync issue (retryable)"}};