@farukada/aws-langgraph-dynamodb-ts 0.8.0 → 1.0.0-rc.1

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 (482) hide show
  1. package/README.md +282 -49
  2. package/dist/checkpointer/actions/delete-thread.d.ts +3 -2
  3. package/dist/checkpointer/actions/delete-thread.js +5 -2
  4. package/dist/checkpointer/actions/get-tuple.d.ts +3 -2
  5. package/dist/checkpointer/actions/get-tuple.js +10 -4
  6. package/dist/checkpointer/actions/list.d.ts +14 -4
  7. package/dist/checkpointer/actions/list.js +94 -61
  8. package/dist/checkpointer/actions/put-writes.d.ts +5 -5
  9. package/dist/checkpointer/actions/put-writes.js +12 -40
  10. package/dist/checkpointer/actions/put.d.ts +10 -3
  11. package/dist/checkpointer/actions/put.js +42 -12
  12. package/dist/checkpointer/internal/assemble.d.ts +10 -3
  13. package/dist/checkpointer/internal/assemble.js +7 -6
  14. package/dist/checkpointer/internal/checkpoint-write-verify.d.ts +24 -0
  15. package/dist/checkpointer/internal/checkpoint-write-verify.js +67 -0
  16. package/dist/checkpointer/internal/configurable.d.ts +0 -1
  17. package/dist/checkpointer/internal/configurable.js +10 -9
  18. package/dist/checkpointer/internal/fetch.d.ts +14 -5
  19. package/dist/checkpointer/internal/fetch.js +56 -14
  20. package/dist/checkpointer/internal/filter-match.d.ts +3 -2
  21. package/dist/checkpointer/internal/filter-match.js +4 -3
  22. package/dist/checkpointer/internal/item-reader.d.ts +31 -6
  23. package/dist/checkpointer/internal/item-reader.js +54 -15
  24. package/dist/checkpointer/internal/item-writer.d.ts +12 -3
  25. package/dist/checkpointer/internal/item-writer.js +26 -10
  26. package/dist/checkpointer/internal/keys.d.ts +11 -1
  27. package/dist/checkpointer/internal/keys.js +33 -3
  28. package/dist/checkpointer/internal/list-scope.d.ts +61 -0
  29. package/dist/checkpointer/internal/list-scope.js +108 -0
  30. package/dist/checkpointer/internal/pending-sends.d.ts +13 -0
  31. package/dist/checkpointer/internal/pending-sends.js +29 -0
  32. package/dist/checkpointer/internal/query.d.ts +2 -1
  33. package/dist/checkpointer/internal/query.js +9 -3
  34. package/dist/checkpointer/internal/regular-write.d.ts +28 -0
  35. package/dist/checkpointer/internal/regular-write.js +66 -0
  36. package/dist/checkpointer/internal/setup.d.ts +3 -1
  37. package/dist/checkpointer/internal/setup.js +10 -8
  38. package/dist/checkpointer/internal/special-write-cas.d.ts +29 -0
  39. package/dist/checkpointer/internal/special-write-cas.js +104 -0
  40. package/dist/checkpointer/internal/special-write-cleanup.d.ts +19 -14
  41. package/dist/checkpointer/internal/special-write-cleanup.js +35 -87
  42. package/dist/checkpointer/internal/special-write-verify.d.ts +53 -0
  43. package/dist/checkpointer/internal/special-write-verify.js +80 -0
  44. package/dist/checkpointer/internal/stored-channels.d.ts +31 -0
  45. package/dist/checkpointer/internal/stored-channels.js +70 -0
  46. package/dist/checkpointer/internal/validation.d.ts +11 -6
  47. package/dist/checkpointer/internal/validation.js +19 -9
  48. package/dist/checkpointer/internal/write-guard.d.ts +8 -9
  49. package/dist/checkpointer/internal/write-guard.js +16 -16
  50. package/dist/checkpointer/internal/write-index.d.ts +8 -1
  51. package/dist/checkpointer/internal/write-index.js +6 -3
  52. package/dist/checkpointer/saver.d.ts +50 -10
  53. package/dist/checkpointer/saver.js +59 -17
  54. package/dist/checkpointer/types.d.ts +14 -1
  55. package/dist/checkpointer/types.js +0 -1
  56. package/dist/factory/factory.d.ts +22 -25
  57. package/dist/factory/factory.js +58 -18
  58. package/dist/factory/types.d.ts +57 -0
  59. package/dist/factory/types.js +2 -0
  60. package/dist/history/actions/add-messages.d.ts +1 -2
  61. package/dist/history/actions/add-messages.js +4 -4
  62. package/dist/history/actions/clear.d.ts +3 -2
  63. package/dist/history/actions/clear.js +5 -2
  64. package/dist/history/actions/get-messages.d.ts +13 -6
  65. package/dist/history/actions/get-messages.js +63 -42
  66. package/dist/history/actions/list-sessions.d.ts +1 -1
  67. package/dist/history/actions/list-sessions.js +8 -12
  68. package/dist/history/actions/reconcile-count.d.ts +1 -2
  69. package/dist/history/actions/reconcile-count.js +20 -7
  70. package/dist/history/chat-message-history.d.ts +51 -26
  71. package/dist/history/chat-message-history.js +60 -30
  72. package/dist/history/internal/append-saga.d.ts +7 -2
  73. package/dist/history/internal/append-saga.js +58 -14
  74. package/dist/history/internal/compensation.d.ts +6 -2
  75. package/dist/history/internal/compensation.js +14 -6
  76. package/dist/history/internal/item-mapper.d.ts +0 -3
  77. package/dist/history/internal/item-mapper.js +2 -8
  78. package/dist/history/internal/keys.d.ts +0 -1
  79. package/dist/history/internal/keys.js +0 -1
  80. package/dist/history/internal/message-chunker.d.ts +0 -1
  81. package/dist/history/internal/message-chunker.js +0 -1
  82. package/dist/history/internal/message-transaction.d.ts +0 -1
  83. package/dist/history/internal/message-transaction.js +3 -2
  84. package/dist/history/internal/message-window.d.ts +17 -0
  85. package/dist/history/internal/message-window.js +49 -0
  86. package/dist/history/internal/query.d.ts +16 -3
  87. package/dist/history/internal/query.js +13 -5
  88. package/dist/history/internal/session-count.d.ts +8 -2
  89. package/dist/history/internal/session-count.js +14 -8
  90. package/dist/history/internal/session-title.d.ts +0 -1
  91. package/dist/history/internal/session-title.js +1 -2
  92. package/dist/history/internal/session-update.d.ts +0 -1
  93. package/dist/history/internal/session-update.js +0 -1
  94. package/dist/history/internal/setup.d.ts +3 -1
  95. package/dist/history/internal/setup.js +16 -8
  96. package/dist/history/internal/title-generator.d.ts +0 -1
  97. package/dist/history/internal/title-generator.js +19 -3
  98. package/dist/history/internal/ttl-anchor.d.ts +1 -2
  99. package/dist/history/internal/ttl-anchor.js +5 -5
  100. package/dist/history/internal/validation.d.ts +19 -3
  101. package/dist/history/internal/validation.js +41 -4
  102. package/dist/history/session-adapter.d.ts +9 -3
  103. package/dist/history/session-adapter.js +6 -3
  104. package/dist/history/types.d.ts +23 -2
  105. package/dist/history/types.js +0 -1
  106. package/dist/index.d.ts +12 -5
  107. package/dist/index.js +5 -3
  108. package/dist/shared/clock.d.ts +6 -1
  109. package/dist/shared/clock.js +9 -1
  110. package/dist/shared/codec/codec.d.ts +26 -17
  111. package/dist/shared/codec/codec.js +46 -24
  112. package/dist/shared/codec/compression.d.ts +1 -2
  113. package/dist/shared/codec/compression.js +2 -3
  114. package/dist/shared/codec/descriptor-keys.d.ts +11 -3
  115. package/dist/shared/codec/descriptor-keys.js +2 -2
  116. package/dist/shared/codec/encode.d.ts +13 -0
  117. package/dist/shared/codec/encode.js +43 -0
  118. package/dist/shared/codec/json-serde.d.ts +0 -1
  119. package/dist/shared/codec/json-serde.js +0 -1
  120. package/dist/shared/codec/payload-loss.d.ts +12 -0
  121. package/dist/shared/codec/payload-loss.js +38 -0
  122. package/dist/shared/codec/s3/adapter-config.d.ts +13 -0
  123. package/dist/shared/codec/s3/adapter-config.js +22 -0
  124. package/dist/shared/codec/s3/bounded-body.d.ts +14 -0
  125. package/dist/shared/codec/s3/bounded-body.js +47 -0
  126. package/dist/shared/codec/s3/client-types.d.ts +34 -0
  127. package/dist/shared/codec/s3/client-types.js +7 -0
  128. package/dist/shared/codec/s3/client.d.ts +11 -5
  129. package/dist/shared/codec/s3/client.js +25 -3
  130. package/dist/shared/codec/s3/config.d.ts +32 -5
  131. package/dist/shared/codec/s3/config.js +37 -5
  132. package/dist/shared/codec/s3/delete.d.ts +0 -1
  133. package/dist/shared/codec/s3/delete.js +0 -1
  134. package/dist/shared/codec/s3/key-scope.d.ts +23 -0
  135. package/dist/shared/codec/s3/key-scope.js +44 -0
  136. package/dist/shared/codec/s3/lifecycle.d.ts +11 -5
  137. package/dist/shared/codec/s3/lifecycle.js +32 -16
  138. package/dist/shared/codec/s3/offloader.d.ts +6 -2
  139. package/dist/shared/codec/s3/offloader.js +21 -3
  140. package/dist/shared/codec/s3/orphans.d.ts +6 -1
  141. package/dist/shared/codec/s3/orphans.js +15 -2
  142. package/dist/shared/codec/s3/read-write.d.ts +7 -3
  143. package/dist/shared/codec/s3/read-write.js +16 -8
  144. package/dist/shared/codec/s3/retry.d.ts +4 -4
  145. package/dist/shared/codec/s3/retry.js +13 -16
  146. package/dist/shared/concurrency.d.ts +6 -0
  147. package/dist/shared/concurrency.js +30 -0
  148. package/dist/shared/constants.d.ts +68 -5
  149. package/dist/shared/constants.js +70 -7
  150. package/dist/shared/dynamodb/abort.d.ts +9 -0
  151. package/dist/shared/dynamodb/abort.js +27 -0
  152. package/dist/shared/dynamodb/backoff.d.ts +4 -4
  153. package/dist/shared/dynamodb/backoff.js +7 -7
  154. package/dist/shared/dynamodb/batch-write.d.ts +0 -1
  155. package/dist/shared/dynamodb/batch-write.js +0 -1
  156. package/dist/shared/dynamodb/cancellation.d.ts +0 -1
  157. package/dist/shared/dynamodb/cancellation.js +0 -1
  158. package/dist/shared/dynamodb/client.d.ts +9 -2
  159. package/dist/shared/dynamodb/client.js +24 -1
  160. package/dist/shared/dynamodb/conditional-put.d.ts +67 -0
  161. package/dist/shared/dynamodb/conditional-put.js +76 -0
  162. package/dist/shared/dynamodb/drain-unprocessed.d.ts +3 -1
  163. package/dist/shared/dynamodb/drain-unprocessed.js +1 -2
  164. package/dist/shared/dynamodb/expiry.d.ts +16 -0
  165. package/dist/shared/dynamodb/expiry.js +29 -0
  166. package/dist/shared/dynamodb/paginate-core.d.ts +5 -3
  167. package/dist/shared/dynamodb/paginate-core.js +47 -17
  168. package/dist/shared/dynamodb/paginate.d.ts +0 -1
  169. package/dist/shared/dynamodb/paginate.js +1 -2
  170. package/dist/shared/dynamodb/partition-delete.d.ts +7 -1
  171. package/dist/shared/dynamodb/partition-delete.js +4 -3
  172. package/dist/shared/dynamodb/retry-classifier.d.ts +10 -2
  173. package/dist/shared/dynamodb/retry-classifier.js +42 -11
  174. package/dist/shared/dynamodb/retry-policy.d.ts +26 -0
  175. package/dist/shared/dynamodb/retry-policy.js +22 -0
  176. package/dist/shared/dynamodb/retry.d.ts +14 -1
  177. package/dist/shared/dynamodb/retry.js +11 -7
  178. package/dist/shared/dynamodb/scan.d.ts +0 -1
  179. package/dist/shared/dynamodb/scan.js +1 -2
  180. package/dist/shared/dynamodb/types.d.ts +1 -2
  181. package/dist/shared/dynamodb/types.js +0 -1
  182. package/dist/shared/errors/base-error.d.ts +14 -6
  183. package/dist/shared/errors/base-error.js +8 -9
  184. package/dist/shared/errors/boundary.d.ts +18 -0
  185. package/dist/shared/errors/boundary.js +46 -0
  186. package/dist/shared/errors/error-code.d.ts +2 -2
  187. package/dist/shared/errors/error-code.js +1 -1
  188. package/dist/shared/errors/errors.d.ts +13 -13
  189. package/dist/shared/errors/errors.js +18 -16
  190. package/dist/shared/errors/upstream-error.d.ts +16 -0
  191. package/dist/shared/errors/upstream-error.js +27 -0
  192. package/dist/shared/errors/wrap-error.d.ts +0 -9
  193. package/dist/shared/errors/wrap-error.js +0 -15
  194. package/dist/shared/logging/logger.d.ts +6 -2
  195. package/dist/shared/logging/logger.js +0 -1
  196. package/dist/shared/logging/redaction-walk.d.ts +2 -2
  197. package/dist/shared/logging/redaction-walk.js +38 -18
  198. package/dist/shared/logging/redaction.d.ts +14 -6
  199. package/dist/shared/logging/redaction.js +19 -4
  200. package/dist/shared/logging/secret-patterns.d.ts +54 -3
  201. package/dist/shared/logging/secret-patterns.js +67 -8
  202. package/dist/shared/options.d.ts +9 -4
  203. package/dist/shared/options.js +0 -1
  204. package/dist/shared/ulid.d.ts +15 -2
  205. package/dist/shared/ulid.js +35 -3
  206. package/dist/shared/validation/options.d.ts +8 -0
  207. package/dist/shared/validation/options.js +90 -0
  208. package/dist/shared/validation/primitives.d.ts +14 -10
  209. package/dist/shared/validation/primitives.js +23 -25
  210. package/dist/shared/validation/ttl.d.ts +14 -7
  211. package/dist/shared/validation/ttl.js +29 -11
  212. package/dist/store/actions/get.d.ts +11 -3
  213. package/dist/store/actions/get.js +52 -14
  214. package/dist/store/actions/list-namespaces.d.ts +0 -1
  215. package/dist/store/actions/list-namespaces.js +10 -6
  216. package/dist/store/actions/put.d.ts +0 -1
  217. package/dist/store/actions/put.js +27 -28
  218. package/dist/store/actions/reconcile-vector-index.d.ts +3 -2
  219. package/dist/store/actions/reconcile-vector-index.js +2 -3
  220. package/dist/store/actions/search.d.ts +1 -2
  221. package/dist/store/actions/search.js +11 -38
  222. package/dist/store/internal/backend-search.d.ts +1 -2
  223. package/dist/store/internal/backend-search.js +14 -7
  224. package/dist/store/internal/batch-plan.d.ts +11 -0
  225. package/dist/store/internal/batch-plan.js +52 -0
  226. package/dist/store/internal/candidates.d.ts +23 -0
  227. package/dist/store/internal/candidates.js +94 -0
  228. package/dist/store/internal/filter.d.ts +0 -1
  229. package/dist/store/internal/filter.js +25 -6
  230. package/dist/store/internal/index-reconcile.d.ts +5 -6
  231. package/dist/store/internal/index-reconcile.js +32 -13
  232. package/dist/store/internal/index-sync.d.ts +0 -1
  233. package/dist/store/internal/index-sync.js +0 -1
  234. package/dist/store/internal/item-mapper.d.ts +6 -3
  235. package/dist/store/internal/item-mapper.js +16 -6
  236. package/dist/store/internal/keys.d.ts +0 -1
  237. package/dist/store/internal/keys.js +0 -1
  238. package/dist/store/internal/namespace-match.d.ts +0 -1
  239. package/dist/store/internal/namespace-match.js +0 -1
  240. package/dist/store/internal/option-validation.d.ts +13 -0
  241. package/dist/store/internal/option-validation.js +77 -0
  242. package/dist/store/internal/overwrite-swap.d.ts +32 -0
  243. package/dist/store/internal/overwrite-swap.js +68 -0
  244. package/dist/store/internal/persist.d.ts +24 -7
  245. package/dist/store/internal/persist.js +49 -19
  246. package/dist/store/internal/query.d.ts +6 -1
  247. package/dist/store/internal/query.js +17 -1
  248. package/dist/store/internal/ranker.d.ts +7 -2
  249. package/dist/store/internal/ranker.js +10 -2
  250. package/dist/store/internal/read-existing.d.ts +23 -0
  251. package/dist/store/internal/read-existing.js +41 -0
  252. package/dist/store/internal/score-direction.d.ts +31 -0
  253. package/dist/store/internal/score-direction.js +38 -0
  254. package/dist/store/internal/search-filter.d.ts +0 -1
  255. package/dist/store/internal/search-filter.js +0 -1
  256. package/dist/store/internal/semantic-search.d.ts +26 -5
  257. package/dist/store/internal/semantic-search.js +59 -19
  258. package/dist/store/internal/setup.d.ts +6 -12
  259. package/dist/store/internal/setup.js +12 -24
  260. package/dist/store/internal/text-path.d.ts +17 -0
  261. package/dist/store/internal/text-path.js +147 -0
  262. package/dist/store/internal/validation.d.ts +8 -3
  263. package/dist/store/internal/validation.js +21 -5
  264. package/dist/store/internal/write-verify.d.ts +27 -9
  265. package/dist/store/internal/write-verify.js +35 -19
  266. package/dist/store/store.d.ts +37 -9
  267. package/dist/store/store.js +52 -17
  268. package/dist/store/types.d.ts +22 -2
  269. package/dist/store/types.js +0 -1
  270. package/dist/store/vector-backend.d.ts +6 -7
  271. package/dist/store/vector-backend.js +0 -1
  272. package/package.json +21 -15
  273. package/dist/checkpointer/actions/delete-thread.d.ts.map +0 -1
  274. package/dist/checkpointer/actions/delete-thread.js.map +0 -1
  275. package/dist/checkpointer/actions/get-tuple.d.ts.map +0 -1
  276. package/dist/checkpointer/actions/get-tuple.js.map +0 -1
  277. package/dist/checkpointer/actions/list.d.ts.map +0 -1
  278. package/dist/checkpointer/actions/list.js.map +0 -1
  279. package/dist/checkpointer/actions/put-writes.d.ts.map +0 -1
  280. package/dist/checkpointer/actions/put-writes.js.map +0 -1
  281. package/dist/checkpointer/actions/put.d.ts.map +0 -1
  282. package/dist/checkpointer/actions/put.js.map +0 -1
  283. package/dist/checkpointer/internal/assemble.d.ts.map +0 -1
  284. package/dist/checkpointer/internal/assemble.js.map +0 -1
  285. package/dist/checkpointer/internal/configurable.d.ts.map +0 -1
  286. package/dist/checkpointer/internal/configurable.js.map +0 -1
  287. package/dist/checkpointer/internal/fetch.d.ts.map +0 -1
  288. package/dist/checkpointer/internal/fetch.js.map +0 -1
  289. package/dist/checkpointer/internal/filter-match.d.ts.map +0 -1
  290. package/dist/checkpointer/internal/filter-match.js.map +0 -1
  291. package/dist/checkpointer/internal/item-reader.d.ts.map +0 -1
  292. package/dist/checkpointer/internal/item-reader.js.map +0 -1
  293. package/dist/checkpointer/internal/item-writer.d.ts.map +0 -1
  294. package/dist/checkpointer/internal/item-writer.js.map +0 -1
  295. package/dist/checkpointer/internal/keys.d.ts.map +0 -1
  296. package/dist/checkpointer/internal/keys.js.map +0 -1
  297. package/dist/checkpointer/internal/query.d.ts.map +0 -1
  298. package/dist/checkpointer/internal/query.js.map +0 -1
  299. package/dist/checkpointer/internal/setup.d.ts.map +0 -1
  300. package/dist/checkpointer/internal/setup.js.map +0 -1
  301. package/dist/checkpointer/internal/special-write-cleanup.d.ts.map +0 -1
  302. package/dist/checkpointer/internal/special-write-cleanup.js.map +0 -1
  303. package/dist/checkpointer/internal/validation.d.ts.map +0 -1
  304. package/dist/checkpointer/internal/validation.js.map +0 -1
  305. package/dist/checkpointer/internal/write-guard.d.ts.map +0 -1
  306. package/dist/checkpointer/internal/write-guard.js.map +0 -1
  307. package/dist/checkpointer/internal/write-index.d.ts.map +0 -1
  308. package/dist/checkpointer/internal/write-index.js.map +0 -1
  309. package/dist/checkpointer/saver.d.ts.map +0 -1
  310. package/dist/checkpointer/saver.js.map +0 -1
  311. package/dist/checkpointer/types.d.ts.map +0 -1
  312. package/dist/checkpointer/types.js.map +0 -1
  313. package/dist/factory/factory.d.ts.map +0 -1
  314. package/dist/factory/factory.js.map +0 -1
  315. package/dist/history/actions/add-messages.d.ts.map +0 -1
  316. package/dist/history/actions/add-messages.js.map +0 -1
  317. package/dist/history/actions/clear.d.ts.map +0 -1
  318. package/dist/history/actions/clear.js.map +0 -1
  319. package/dist/history/actions/get-messages.d.ts.map +0 -1
  320. package/dist/history/actions/get-messages.js.map +0 -1
  321. package/dist/history/actions/list-sessions.d.ts.map +0 -1
  322. package/dist/history/actions/list-sessions.js.map +0 -1
  323. package/dist/history/actions/reconcile-count.d.ts.map +0 -1
  324. package/dist/history/actions/reconcile-count.js.map +0 -1
  325. package/dist/history/chat-message-history.d.ts.map +0 -1
  326. package/dist/history/chat-message-history.js.map +0 -1
  327. package/dist/history/internal/append-saga.d.ts.map +0 -1
  328. package/dist/history/internal/append-saga.js.map +0 -1
  329. package/dist/history/internal/compensation.d.ts.map +0 -1
  330. package/dist/history/internal/compensation.js.map +0 -1
  331. package/dist/history/internal/item-mapper.d.ts.map +0 -1
  332. package/dist/history/internal/item-mapper.js.map +0 -1
  333. package/dist/history/internal/keys.d.ts.map +0 -1
  334. package/dist/history/internal/keys.js.map +0 -1
  335. package/dist/history/internal/message-chunker.d.ts.map +0 -1
  336. package/dist/history/internal/message-chunker.js.map +0 -1
  337. package/dist/history/internal/message-transaction.d.ts.map +0 -1
  338. package/dist/history/internal/message-transaction.js.map +0 -1
  339. package/dist/history/internal/query.d.ts.map +0 -1
  340. package/dist/history/internal/query.js.map +0 -1
  341. package/dist/history/internal/session-count.d.ts.map +0 -1
  342. package/dist/history/internal/session-count.js.map +0 -1
  343. package/dist/history/internal/session-title.d.ts.map +0 -1
  344. package/dist/history/internal/session-title.js.map +0 -1
  345. package/dist/history/internal/session-update.d.ts.map +0 -1
  346. package/dist/history/internal/session-update.js.map +0 -1
  347. package/dist/history/internal/setup.d.ts.map +0 -1
  348. package/dist/history/internal/setup.js.map +0 -1
  349. package/dist/history/internal/title-generator.d.ts.map +0 -1
  350. package/dist/history/internal/title-generator.js.map +0 -1
  351. package/dist/history/internal/ttl-anchor.d.ts.map +0 -1
  352. package/dist/history/internal/ttl-anchor.js.map +0 -1
  353. package/dist/history/internal/validation.d.ts.map +0 -1
  354. package/dist/history/internal/validation.js.map +0 -1
  355. package/dist/history/session-adapter.d.ts.map +0 -1
  356. package/dist/history/session-adapter.js.map +0 -1
  357. package/dist/history/types.d.ts.map +0 -1
  358. package/dist/history/types.js.map +0 -1
  359. package/dist/index.d.ts.map +0 -1
  360. package/dist/index.js.map +0 -1
  361. package/dist/shared/clock.d.ts.map +0 -1
  362. package/dist/shared/clock.js.map +0 -1
  363. package/dist/shared/codec/codec.d.ts.map +0 -1
  364. package/dist/shared/codec/codec.js.map +0 -1
  365. package/dist/shared/codec/compression.d.ts.map +0 -1
  366. package/dist/shared/codec/compression.js.map +0 -1
  367. package/dist/shared/codec/descriptor-keys.d.ts.map +0 -1
  368. package/dist/shared/codec/descriptor-keys.js.map +0 -1
  369. package/dist/shared/codec/json-serde.d.ts.map +0 -1
  370. package/dist/shared/codec/json-serde.js.map +0 -1
  371. package/dist/shared/codec/s3/client.d.ts.map +0 -1
  372. package/dist/shared/codec/s3/client.js.map +0 -1
  373. package/dist/shared/codec/s3/config.d.ts.map +0 -1
  374. package/dist/shared/codec/s3/config.js.map +0 -1
  375. package/dist/shared/codec/s3/delete.d.ts.map +0 -1
  376. package/dist/shared/codec/s3/delete.js.map +0 -1
  377. package/dist/shared/codec/s3/lifecycle.d.ts.map +0 -1
  378. package/dist/shared/codec/s3/lifecycle.js.map +0 -1
  379. package/dist/shared/codec/s3/offloader.d.ts.map +0 -1
  380. package/dist/shared/codec/s3/offloader.js.map +0 -1
  381. package/dist/shared/codec/s3/orphans.d.ts.map +0 -1
  382. package/dist/shared/codec/s3/orphans.js.map +0 -1
  383. package/dist/shared/codec/s3/read-write.d.ts.map +0 -1
  384. package/dist/shared/codec/s3/read-write.js.map +0 -1
  385. package/dist/shared/codec/s3/retry.d.ts.map +0 -1
  386. package/dist/shared/codec/s3/retry.js.map +0 -1
  387. package/dist/shared/constants.d.ts.map +0 -1
  388. package/dist/shared/constants.js.map +0 -1
  389. package/dist/shared/dynamodb/backoff.d.ts.map +0 -1
  390. package/dist/shared/dynamodb/backoff.js.map +0 -1
  391. package/dist/shared/dynamodb/batch-write.d.ts.map +0 -1
  392. package/dist/shared/dynamodb/batch-write.js.map +0 -1
  393. package/dist/shared/dynamodb/cancellation.d.ts.map +0 -1
  394. package/dist/shared/dynamodb/cancellation.js.map +0 -1
  395. package/dist/shared/dynamodb/client.d.ts.map +0 -1
  396. package/dist/shared/dynamodb/client.js.map +0 -1
  397. package/dist/shared/dynamodb/drain-unprocessed.d.ts.map +0 -1
  398. package/dist/shared/dynamodb/drain-unprocessed.js.map +0 -1
  399. package/dist/shared/dynamodb/paginate-core.d.ts.map +0 -1
  400. package/dist/shared/dynamodb/paginate-core.js.map +0 -1
  401. package/dist/shared/dynamodb/paginate.d.ts.map +0 -1
  402. package/dist/shared/dynamodb/paginate.js.map +0 -1
  403. package/dist/shared/dynamodb/partition-delete.d.ts.map +0 -1
  404. package/dist/shared/dynamodb/partition-delete.js.map +0 -1
  405. package/dist/shared/dynamodb/retry-classifier.d.ts.map +0 -1
  406. package/dist/shared/dynamodb/retry-classifier.js.map +0 -1
  407. package/dist/shared/dynamodb/retry.d.ts.map +0 -1
  408. package/dist/shared/dynamodb/retry.js.map +0 -1
  409. package/dist/shared/dynamodb/scan.d.ts.map +0 -1
  410. package/dist/shared/dynamodb/scan.js.map +0 -1
  411. package/dist/shared/dynamodb/types.d.ts.map +0 -1
  412. package/dist/shared/dynamodb/types.js.map +0 -1
  413. package/dist/shared/errors/base-error.d.ts.map +0 -1
  414. package/dist/shared/errors/base-error.js.map +0 -1
  415. package/dist/shared/errors/error-code.d.ts.map +0 -1
  416. package/dist/shared/errors/error-code.js.map +0 -1
  417. package/dist/shared/errors/errors.d.ts.map +0 -1
  418. package/dist/shared/errors/errors.js.map +0 -1
  419. package/dist/shared/errors/wrap-error.d.ts.map +0 -1
  420. package/dist/shared/errors/wrap-error.js.map +0 -1
  421. package/dist/shared/logging/logger.d.ts.map +0 -1
  422. package/dist/shared/logging/logger.js.map +0 -1
  423. package/dist/shared/logging/redaction-walk.d.ts.map +0 -1
  424. package/dist/shared/logging/redaction-walk.js.map +0 -1
  425. package/dist/shared/logging/redaction.d.ts.map +0 -1
  426. package/dist/shared/logging/redaction.js.map +0 -1
  427. package/dist/shared/logging/secret-patterns.d.ts.map +0 -1
  428. package/dist/shared/logging/secret-patterns.js.map +0 -1
  429. package/dist/shared/options.d.ts.map +0 -1
  430. package/dist/shared/options.js.map +0 -1
  431. package/dist/shared/ulid.d.ts.map +0 -1
  432. package/dist/shared/ulid.js.map +0 -1
  433. package/dist/shared/validation/primitives.d.ts.map +0 -1
  434. package/dist/shared/validation/primitives.js.map +0 -1
  435. package/dist/shared/validation/ttl.d.ts.map +0 -1
  436. package/dist/shared/validation/ttl.js.map +0 -1
  437. package/dist/store/actions/get.d.ts.map +0 -1
  438. package/dist/store/actions/get.js.map +0 -1
  439. package/dist/store/actions/list-namespaces.d.ts.map +0 -1
  440. package/dist/store/actions/list-namespaces.js.map +0 -1
  441. package/dist/store/actions/put.d.ts.map +0 -1
  442. package/dist/store/actions/put.js.map +0 -1
  443. package/dist/store/actions/reconcile-vector-index.d.ts.map +0 -1
  444. package/dist/store/actions/reconcile-vector-index.js.map +0 -1
  445. package/dist/store/actions/search.d.ts.map +0 -1
  446. package/dist/store/actions/search.js.map +0 -1
  447. package/dist/store/internal/backend-search.d.ts.map +0 -1
  448. package/dist/store/internal/backend-search.js.map +0 -1
  449. package/dist/store/internal/filter.d.ts.map +0 -1
  450. package/dist/store/internal/filter.js.map +0 -1
  451. package/dist/store/internal/index-reconcile.d.ts.map +0 -1
  452. package/dist/store/internal/index-reconcile.js.map +0 -1
  453. package/dist/store/internal/index-sync.d.ts.map +0 -1
  454. package/dist/store/internal/index-sync.js.map +0 -1
  455. package/dist/store/internal/item-mapper.d.ts.map +0 -1
  456. package/dist/store/internal/item-mapper.js.map +0 -1
  457. package/dist/store/internal/keys.d.ts.map +0 -1
  458. package/dist/store/internal/keys.js.map +0 -1
  459. package/dist/store/internal/namespace-match.d.ts.map +0 -1
  460. package/dist/store/internal/namespace-match.js.map +0 -1
  461. package/dist/store/internal/persist.d.ts.map +0 -1
  462. package/dist/store/internal/persist.js.map +0 -1
  463. package/dist/store/internal/query.d.ts.map +0 -1
  464. package/dist/store/internal/query.js.map +0 -1
  465. package/dist/store/internal/ranker.d.ts.map +0 -1
  466. package/dist/store/internal/ranker.js.map +0 -1
  467. package/dist/store/internal/search-filter.d.ts.map +0 -1
  468. package/dist/store/internal/search-filter.js.map +0 -1
  469. package/dist/store/internal/semantic-search.d.ts.map +0 -1
  470. package/dist/store/internal/semantic-search.js.map +0 -1
  471. package/dist/store/internal/setup.d.ts.map +0 -1
  472. package/dist/store/internal/setup.js.map +0 -1
  473. package/dist/store/internal/validation.d.ts.map +0 -1
  474. package/dist/store/internal/validation.js.map +0 -1
  475. package/dist/store/internal/write-verify.d.ts.map +0 -1
  476. package/dist/store/internal/write-verify.js.map +0 -1
  477. package/dist/store/store.d.ts.map +0 -1
  478. package/dist/store/store.js.map +0 -1
  479. package/dist/store/types.d.ts.map +0 -1
  480. package/dist/store/types.js.map +0 -1
  481. package/dist/store/vector-backend.d.ts.map +0 -1
  482. package/dist/store/vector-backend.js.map +0 -1
@@ -1,22 +1,30 @@
1
1
  import { ErrorCode } from './error-code';
2
- /** Structured, log-safe context attached to every library error. */
2
+ /**
3
+ * Structured, log-safe context attached to every library error. Identifiers
4
+ * and counts only — never a payload or a credential.
5
+ */
3
6
  export interface ErrorContext {
7
+ /** The DynamoDB table the operation targeted, when known. */
4
8
  tableName?: string;
9
+ /** The public operation (`saver.put`, `store.batch`, …) or internal step that failed. */
5
10
  operation?: string;
11
+ /** The option, argument or cap that failed validation or was exceeded. */
12
+ field?: string;
13
+ /** The S3 object key involved, for offload failures. */
6
14
  key?: string;
15
+ /** Attempts made before a retry budget was exhausted. */
7
16
  attempts?: number;
8
17
  }
9
18
  /**
10
19
  * Base class for every error this library throws. Carries a branchable
11
20
  * {@link ErrorCode}, structured {@link ErrorContext}, and a native `cause`
12
- * chain. Detected via {@link isDynamoDbLangGraphError} (a symbol brand) rather
21
+ * chain. Detected via {@link isDynamoDBLangGraphError} (a symbol brand) rather
13
22
  * than `instanceof`, which is banned repo-wide.
14
23
  */
15
- export declare class DynamoDbLangGraphError extends Error {
24
+ export declare class DynamoDBLangGraphError extends Error {
16
25
  readonly code: ErrorCode;
17
26
  readonly context: ErrorContext;
18
27
  constructor(message: string, code: ErrorCode, context?: ErrorContext, cause?: Error);
19
28
  }
20
- /** True when `value` is a {@link DynamoDbLangGraphError}, detected by brand. */
21
- export declare function isDynamoDbLangGraphError(value: Error): value is DynamoDbLangGraphError;
22
- //# sourceMappingURL=base-error.d.ts.map
29
+ /** True when `value` is a {@link DynamoDBLangGraphError}, detected by brand. */
30
+ export declare function isDynamoDBLangGraphError(value: Error): value is DynamoDBLangGraphError;
@@ -1,28 +1,27 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.DynamoDbLangGraphError = void 0;
4
- exports.isDynamoDbLangGraphError = isDynamoDbLangGraphError;
3
+ exports.DynamoDBLangGraphError = void 0;
4
+ exports.isDynamoDBLangGraphError = isDynamoDBLangGraphError;
5
5
  const ERROR_BRAND = Symbol.for('@farukada/aws-langgraph-dynamodb-ts/error');
6
6
  /**
7
7
  * Base class for every error this library throws. Carries a branchable
8
8
  * {@link ErrorCode}, structured {@link ErrorContext}, and a native `cause`
9
- * chain. Detected via {@link isDynamoDbLangGraphError} (a symbol brand) rather
9
+ * chain. Detected via {@link isDynamoDBLangGraphError} (a symbol brand) rather
10
10
  * than `instanceof`, which is banned repo-wide.
11
11
  */
12
- class DynamoDbLangGraphError extends Error {
12
+ class DynamoDBLangGraphError extends Error {
13
13
  code;
14
14
  context;
15
15
  constructor(message, code, context = {}, cause) {
16
16
  super(message, cause === undefined ? undefined : { cause });
17
- this.name = 'DynamoDbLangGraphError';
17
+ this.name = 'DynamoDBLangGraphError';
18
18
  this.code = code;
19
19
  this.context = context;
20
20
  Object.defineProperty(this, ERROR_BRAND, { value: true, enumerable: false });
21
21
  }
22
22
  }
23
- exports.DynamoDbLangGraphError = DynamoDbLangGraphError;
24
- /** True when `value` is a {@link DynamoDbLangGraphError}, detected by brand. */
25
- function isDynamoDbLangGraphError(value) {
23
+ exports.DynamoDBLangGraphError = DynamoDBLangGraphError;
24
+ /** True when `value` is a {@link DynamoDBLangGraphError}, detected by brand. */
25
+ function isDynamoDBLangGraphError(value) {
26
26
  return ERROR_BRAND in value;
27
27
  }
28
- //# sourceMappingURL=base-error.js.map
@@ -0,0 +1,18 @@
1
+ /**
2
+ * Normalise anything escaping a public method into the library's error model:
3
+ * a branded library error is returned unchanged (its code was assigned closer
4
+ * to the failure and wins), anything else becomes an {@link UpstreamError}.
5
+ */
6
+ export declare function toPublicError(error: Error, operation: string): Error;
7
+ /**
8
+ * Run a public operation so that every rejection is a library error. Applied
9
+ * once, at each adapter class method, so internal code can keep rethrowing SDK
10
+ * errors verbatim (the retry classifier depends on their shape).
11
+ */
12
+ export declare function guardPublic<T>(operation: string, fn: () => Promise<T>): Promise<T>;
13
+ /**
14
+ * The same guard for a streaming result: items pass through, a failure raised
15
+ * mid-iteration is wrapped, and a consumer that stops early still closes the
16
+ * source generator.
17
+ */
18
+ export declare function guardPublicIterable<T>(operation: string, source: AsyncGenerator<T>): AsyncGenerator<T>;
@@ -0,0 +1,46 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.toPublicError = toPublicError;
4
+ exports.guardPublic = guardPublic;
5
+ exports.guardPublicIterable = guardPublicIterable;
6
+ const base_error_1 = require("./base-error");
7
+ const upstream_error_1 = require("./upstream-error");
8
+ const wrap_error_1 = require("./wrap-error");
9
+ /**
10
+ * Normalise anything escaping a public method into the library's error model:
11
+ * a branded library error is returned unchanged (its code was assigned closer
12
+ * to the failure and wins), anything else becomes an {@link UpstreamError}.
13
+ */
14
+ function toPublicError(error, operation) {
15
+ const normalized = (0, wrap_error_1.toError)(error);
16
+ return (0, base_error_1.isDynamoDBLangGraphError)(normalized)
17
+ ? normalized
18
+ : new upstream_error_1.UpstreamError(normalized, operation);
19
+ }
20
+ /**
21
+ * Run a public operation so that every rejection is a library error. Applied
22
+ * once, at each adapter class method, so internal code can keep rethrowing SDK
23
+ * errors verbatim (the retry classifier depends on their shape).
24
+ */
25
+ async function guardPublic(operation, fn) {
26
+ try {
27
+ return await fn();
28
+ }
29
+ catch (error) {
30
+ throw toPublicError(error, operation);
31
+ }
32
+ }
33
+ /**
34
+ * The same guard for a streaming result: items pass through, a failure raised
35
+ * mid-iteration is wrapped, and a consumer that stops early still closes the
36
+ * source generator.
37
+ */
38
+ async function* guardPublicIterable(operation, source) {
39
+ try {
40
+ for await (const item of source)
41
+ yield item;
42
+ }
43
+ catch (error) {
44
+ throw toPublicError(error, operation);
45
+ }
46
+ }
@@ -8,6 +8,6 @@ export declare enum ErrorCode {
8
8
  S3_OFFLOAD_FAILED = "S3_OFFLOAD_FAILED",
9
9
  RESULT_TRUNCATED = "RESULT_TRUNCATED",
10
10
  ABORTED = "ABORTED",
11
- COMPENSATION_FAILED = "COMPENSATION_FAILED"
11
+ COMPENSATION_FAILED = "COMPENSATION_FAILED",
12
+ UPSTREAM = "UPSTREAM"
12
13
  }
13
- //# sourceMappingURL=error-code.d.ts.map
@@ -13,5 +13,5 @@ var ErrorCode;
13
13
  ErrorCode["RESULT_TRUNCATED"] = "RESULT_TRUNCATED";
14
14
  ErrorCode["ABORTED"] = "ABORTED";
15
15
  ErrorCode["COMPENSATION_FAILED"] = "COMPENSATION_FAILED";
16
+ ErrorCode["UPSTREAM"] = "UPSTREAM";
16
17
  })(ErrorCode || (exports.ErrorCode = ErrorCode = {}));
17
- //# sourceMappingURL=error-code.js.map
@@ -1,28 +1,29 @@
1
1
  import type { WriteRequest } from '../dynamodb/types';
2
- import { DynamoDbLangGraphError } from './base-error';
3
- /** Input failed a validation rule before any AWS call was made. */
4
- export declare class ValidationError extends DynamoDbLangGraphError {
5
- constructor(message: string, field?: string);
2
+ import { DynamoDBLangGraphError } from './base-error';
3
+ /** Input failed a validation rule before any AWS call was made; `context.field` names the input. */
4
+ export declare class ValidationError extends DynamoDBLangGraphError {
5
+ constructor(message: string, field?: string, cause?: Error);
6
6
  }
7
7
  /** A conditional write failed because the precondition no longer holds. */
8
- export declare class ConflictError extends DynamoDbLangGraphError {
8
+ export declare class ConflictError extends DynamoDBLangGraphError {
9
9
  constructor(message: string, cause?: Error);
10
10
  }
11
11
  /** A retried operation exhausted its attempt budget. */
12
- export declare class RetryExhaustedError extends DynamoDbLangGraphError {
12
+ export declare class RetryExhaustedError extends DynamoDBLangGraphError {
13
13
  constructor(message: string, attempts?: number, cause?: Error);
14
14
  }
15
15
  /**
16
16
  * A paginated read hit its runaway guard (item or iteration cap) while more
17
17
  * data remained, so the result would have been silently truncated. Narrow the
18
18
  * query (filter/prefix) or raise the cap rather than trusting a partial result.
19
+ * `context.field` names the cap that was hit.
19
20
  */
20
- export declare class ResultTruncatedError extends DynamoDbLangGraphError {
21
+ export declare class ResultTruncatedError extends DynamoDBLangGraphError {
21
22
  constructor(cap: string, limit: number);
22
23
  }
23
24
  /** An operation was cancelled via its AbortSignal. */
24
- export declare class AbortError extends DynamoDbLangGraphError {
25
- constructor(message?: string);
25
+ export declare class AbortError extends DynamoDBLangGraphError {
26
+ constructor(message?: string, cause?: Error);
26
27
  }
27
28
  /**
28
29
  * A BatchWriteItem sequence could not drain its UnprocessedItems. Items NOT
@@ -32,7 +33,7 @@ export declare class AbortError extends DynamoDbLangGraphError {
32
33
  * non-UnprocessedItems error from a retry round) rather than a clean exhaustion
33
34
  * of the UnprocessedItems retry budget.
34
35
  */
35
- export declare class BatchWriteIncompleteError extends DynamoDbLangGraphError {
36
+ export declare class BatchWriteIncompleteError extends DynamoDBLangGraphError {
36
37
  readonly succeededCount: number;
37
38
  readonly unprocessed: WriteRequest[];
38
39
  constructor(succeededCount: number, unprocessed: WriteRequest[], retries: number, cause?: Error);
@@ -48,7 +49,7 @@ export declare class BatchWriteIncompleteError extends DynamoDbLangGraphError {
48
49
  * chunk's own partial drain), more precise than `succeededChunks` alone
49
50
  * when a chunk partially drains before exhausting its retries.
50
51
  */
51
- export declare class BatchWriteAllIncompleteError extends DynamoDbLangGraphError {
52
+ export declare class BatchWriteAllIncompleteError extends DynamoDBLangGraphError {
52
53
  readonly succeededChunks: number;
53
54
  readonly totalChunks: number;
54
55
  readonly failedChunks: Error[];
@@ -61,8 +62,7 @@ export declare class BatchWriteAllIncompleteError extends DynamoDbLangGraphError
61
62
  * `cause` and the rollback failure as {@link rollbackError}; the session's
62
63
  * `messageCount` may have drifted — repair it with `reconcileMessageCount`.
63
64
  */
64
- export declare class CompensationFailedError extends DynamoDbLangGraphError {
65
+ export declare class CompensationFailedError extends DynamoDBLangGraphError {
65
66
  readonly rollbackError: Error;
66
67
  constructor(cause: Error, rollbackError: Error);
67
68
  }
68
- //# sourceMappingURL=errors.d.ts.map
@@ -1,18 +1,19 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.CompensationFailedError = exports.BatchWriteAllIncompleteError = exports.BatchWriteIncompleteError = exports.AbortError = exports.ResultTruncatedError = exports.RetryExhaustedError = exports.ConflictError = exports.ValidationError = void 0;
4
+ const secret_patterns_1 = require("../logging/secret-patterns");
4
5
  const base_error_1 = require("./base-error");
5
6
  const error_code_1 = require("./error-code");
6
- /** Input failed a validation rule before any AWS call was made. */
7
- class ValidationError extends base_error_1.DynamoDbLangGraphError {
8
- constructor(message, field) {
9
- super(message, error_code_1.ErrorCode.VALIDATION, field === undefined ? {} : { operation: field });
7
+ /** Input failed a validation rule before any AWS call was made; `context.field` names the input. */
8
+ class ValidationError extends base_error_1.DynamoDBLangGraphError {
9
+ constructor(message, field, cause) {
10
+ super(message, error_code_1.ErrorCode.VALIDATION, field === undefined ? {} : { field }, cause);
10
11
  this.name = 'ValidationError';
11
12
  }
12
13
  }
13
14
  exports.ValidationError = ValidationError;
14
15
  /** A conditional write failed because the precondition no longer holds. */
15
- class ConflictError extends base_error_1.DynamoDbLangGraphError {
16
+ class ConflictError extends base_error_1.DynamoDBLangGraphError {
16
17
  constructor(message, cause) {
17
18
  super(message, error_code_1.ErrorCode.CONDITION_CONFLICT, {}, cause);
18
19
  this.name = 'ConflictError';
@@ -20,7 +21,7 @@ class ConflictError extends base_error_1.DynamoDbLangGraphError {
20
21
  }
21
22
  exports.ConflictError = ConflictError;
22
23
  /** A retried operation exhausted its attempt budget. */
23
- class RetryExhaustedError extends base_error_1.DynamoDbLangGraphError {
24
+ class RetryExhaustedError extends base_error_1.DynamoDBLangGraphError {
24
25
  constructor(message, attempts, cause) {
25
26
  super(message, error_code_1.ErrorCode.RETRY_EXHAUSTED, attempts === undefined ? {} : { attempts }, cause);
26
27
  this.name = 'RetryExhaustedError';
@@ -31,18 +32,19 @@ exports.RetryExhaustedError = RetryExhaustedError;
31
32
  * A paginated read hit its runaway guard (item or iteration cap) while more
32
33
  * data remained, so the result would have been silently truncated. Narrow the
33
34
  * query (filter/prefix) or raise the cap rather than trusting a partial result.
35
+ * `context.field` names the cap that was hit.
34
36
  */
35
- class ResultTruncatedError extends base_error_1.DynamoDbLangGraphError {
37
+ class ResultTruncatedError extends base_error_1.DynamoDBLangGraphError {
36
38
  constructor(cap, limit) {
37
- super(`paginated read truncated at the ${cap} cap (${limit}) with more data remaining`, error_code_1.ErrorCode.RESULT_TRUNCATED, { operation: cap });
39
+ super(`paginated read truncated at the ${cap} cap (${limit}) with more data remaining`, error_code_1.ErrorCode.RESULT_TRUNCATED, { field: cap });
38
40
  this.name = 'ResultTruncatedError';
39
41
  }
40
42
  }
41
43
  exports.ResultTruncatedError = ResultTruncatedError;
42
44
  /** An operation was cancelled via its AbortSignal. */
43
- class AbortError extends base_error_1.DynamoDbLangGraphError {
44
- constructor(message = 'Operation aborted') {
45
- super(message, error_code_1.ErrorCode.ABORTED);
45
+ class AbortError extends base_error_1.DynamoDBLangGraphError {
46
+ constructor(message = 'Operation aborted', cause) {
47
+ super(message, error_code_1.ErrorCode.ABORTED, {}, cause);
46
48
  this.name = 'AbortError';
47
49
  }
48
50
  }
@@ -55,7 +57,7 @@ exports.AbortError = AbortError;
55
57
  * non-UnprocessedItems error from a retry round) rather than a clean exhaustion
56
58
  * of the UnprocessedItems retry budget.
57
59
  */
58
- class BatchWriteIncompleteError extends base_error_1.DynamoDbLangGraphError {
60
+ class BatchWriteIncompleteError extends base_error_1.DynamoDBLangGraphError {
59
61
  succeededCount;
60
62
  unprocessed;
61
63
  constructor(succeededCount, unprocessed, retries, cause) {
@@ -78,7 +80,7 @@ exports.BatchWriteIncompleteError = BatchWriteIncompleteError;
78
80
  * chunk's own partial drain), more precise than `succeededChunks` alone
79
81
  * when a chunk partially drains before exhausting its retries.
80
82
  */
81
- class BatchWriteAllIncompleteError extends base_error_1.DynamoDbLangGraphError {
83
+ class BatchWriteAllIncompleteError extends base_error_1.DynamoDBLangGraphError {
82
84
  succeededChunks;
83
85
  totalChunks;
84
86
  failedChunks;
@@ -100,13 +102,13 @@ exports.BatchWriteAllIncompleteError = BatchWriteAllIncompleteError;
100
102
  * `cause` and the rollback failure as {@link rollbackError}; the session's
101
103
  * `messageCount` may have drifted — repair it with `reconcileMessageCount`.
102
104
  */
103
- class CompensationFailedError extends base_error_1.DynamoDbLangGraphError {
105
+ class CompensationFailedError extends base_error_1.DynamoDBLangGraphError {
104
106
  rollbackError;
105
107
  constructor(cause, rollbackError) {
106
- super(`compensation failed after an append error: ${cause.message} (rollback: ${rollbackError.message})`, error_code_1.ErrorCode.COMPENSATION_FAILED, {}, cause);
108
+ super(`compensation failed after an append error: ${(0, secret_patterns_1.redactedMessage)(cause)} ` +
109
+ `(rollback: ${(0, secret_patterns_1.redactedMessage)(rollbackError)})`, error_code_1.ErrorCode.COMPENSATION_FAILED, {}, cause);
107
110
  this.name = 'CompensationFailedError';
108
111
  this.rollbackError = rollbackError;
109
112
  }
110
113
  }
111
114
  exports.CompensationFailedError = CompensationFailedError;
112
- //# sourceMappingURL=errors.js.map
@@ -0,0 +1,16 @@
1
+ import { DynamoDBLangGraphError } from './base-error';
2
+ /**
3
+ * A failure that originated below this library — the AWS SDK, the transport,
4
+ * a third-party `VectorBackend` or `Embeddings` — and surfaced through one of
5
+ * its public methods. Wrapping it keeps the promise that every rejection a
6
+ * caller sees is a {@link DynamoDBLangGraphError} with a branchable `code`,
7
+ * while losing nothing a support ticket needs: the SDK's own error name, the
8
+ * request id and HTTP status when present, and the original as `cause`.
9
+ */
10
+ export declare class UpstreamError extends DynamoDBLangGraphError {
11
+ readonly upstreamName: string;
12
+ /** Declared, not emitted: absent metadata leaves no `undefined`-valued own property behind. */
13
+ readonly requestId?: string;
14
+ readonly httpStatusCode?: number;
15
+ constructor(cause: Error, operation: string);
16
+ }
@@ -0,0 +1,27 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.UpstreamError = void 0;
4
+ const base_error_1 = require("./base-error");
5
+ const error_code_1 = require("./error-code");
6
+ /**
7
+ * A failure that originated below this library — the AWS SDK, the transport,
8
+ * a third-party `VectorBackend` or `Embeddings` — and surfaced through one of
9
+ * its public methods. Wrapping it keeps the promise that every rejection a
10
+ * caller sees is a {@link DynamoDBLangGraphError} with a branchable `code`,
11
+ * while losing nothing a support ticket needs: the SDK's own error name, the
12
+ * request id and HTTP status when present, and the original as `cause`.
13
+ */
14
+ class UpstreamError extends base_error_1.DynamoDBLangGraphError {
15
+ upstreamName;
16
+ constructor(cause, operation) {
17
+ super(`${operation}: ${cause.name}: ${cause.message}`, error_code_1.ErrorCode.UPSTREAM, { operation }, cause);
18
+ this.name = 'UpstreamError';
19
+ this.upstreamName = cause.name;
20
+ const metadata = cause.$metadata;
21
+ if (metadata?.requestId !== undefined)
22
+ this.requestId = metadata.requestId;
23
+ if (metadata?.httpStatusCode !== undefined)
24
+ this.httpStatusCode = metadata.httpStatusCode;
25
+ }
26
+ }
27
+ exports.UpstreamError = UpstreamError;
@@ -1,5 +1,3 @@
1
- import { DynamoDbLangGraphError, ErrorContext } from './base-error';
2
- import { ErrorCode } from './error-code';
3
1
  /**
4
2
  * Normalize a caught value (TypeScript types catch clauses as the implicit
5
3
  * unknown) into an `Error`. Error-shaped values pass through; anything else is
@@ -7,10 +5,3 @@ import { ErrorCode } from './error-code';
7
5
  * are narrowed — callers do `toError(error as Error)`.
8
6
  */
9
7
  export declare function toError(value: Error): Error;
10
- /**
11
- * Wrap a raw error in a coded {@link DynamoDbLangGraphError} with structured
12
- * context, preserving the original as `cause`. Already-coded errors are
13
- * returned unchanged so codes assigned closer to the failure win.
14
- */
15
- export declare function wrapError(cause: Error, code: ErrorCode, context?: ErrorContext): DynamoDbLangGraphError;
16
- //# sourceMappingURL=wrap-error.d.ts.map
@@ -1,8 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.toError = toError;
4
- exports.wrapError = wrapError;
5
- const base_error_1 = require("./base-error");
6
4
  /**
7
5
  * Normalize a caught value (TypeScript types catch clauses as the implicit
8
6
  * unknown) into an `Error`. Error-shaped values pass through; anything else is
@@ -15,16 +13,3 @@ function toError(value) {
15
13
  }
16
14
  return new Error(typeof value === 'string' ? value : JSON.stringify(value));
17
15
  }
18
- /**
19
- * Wrap a raw error in a coded {@link DynamoDbLangGraphError} with structured
20
- * context, preserving the original as `cause`. Already-coded errors are
21
- * returned unchanged so codes assigned closer to the failure win.
22
- */
23
- function wrapError(cause, code, context) {
24
- const normalized = toError(cause);
25
- if ((0, base_error_1.isDynamoDbLangGraphError)(normalized)) {
26
- return normalized;
27
- }
28
- return new base_error_1.DynamoDbLangGraphError(normalized.message, code, context ?? {}, normalized);
29
- }
30
- //# sourceMappingURL=wrap-error.js.map
@@ -1,6 +1,11 @@
1
1
  /** A value safe to pass as a structured log argument. */
2
2
  export type LogArgument = string | number | boolean | null | object;
3
- /** Pluggable logging interface — consumers supply their own implementation. */
3
+ /**
4
+ * Pluggable logging interface — consumers supply their own implementation.
5
+ * `args` are structured fields, at most one plain object per call, so an
6
+ * adapter for a structured logger (pino, winston) can merge them into one
7
+ * record; the message is a fixed string and never carries a value.
8
+ */
4
9
  export interface Logger {
5
10
  info(message: string, ...args: LogArgument[]): void;
6
11
  warn(message: string, ...args: LogArgument[]): void;
@@ -11,4 +16,3 @@ export interface Logger {
11
16
  export declare const SILENT_LOGGER: Logger;
12
17
  /** Return the injected logger, or {@link SILENT_LOGGER} when none is given. */
13
18
  export declare function resolveLogger(logger?: Logger): Logger;
14
- //# sourceMappingURL=logger.d.ts.map
@@ -13,4 +13,3 @@ exports.SILENT_LOGGER = {
13
13
  function resolveLogger(logger) {
14
14
  return logger ?? exports.SILENT_LOGGER;
15
15
  }
16
- //# sourceMappingURL=logger.js.map
@@ -7,7 +7,7 @@ export type RedactableObject = Redactable[] | {
7
7
  [key: string]: Redactable;
8
8
  };
9
9
  /** One step of the recursive walk, threaded into the entry helpers. */
10
- export type Walk = (value: Redactable) => Redactable;
10
+ type Walk = (value: Redactable) => Redactable;
11
11
  /** Collaborators threaded through the recursive walk. */
12
12
  export interface WalkDeps {
13
13
  keyPatterns: readonly string[];
@@ -20,4 +20,4 @@ export interface WalkDeps {
20
20
  * `Set`/`Map` render as their contents, and an Error takes the path above.
21
21
  */
22
22
  export declare function walkObject(current: RedactableObject, deps: WalkDeps): Redactable;
23
- //# sourceMappingURL=redaction-walk.d.ts.map
23
+ export {};
@@ -10,9 +10,14 @@ function isSetValue(value) {
10
10
  function isMapValue(value) {
11
11
  return Object.prototype.toString.call(value) === '[object Map]';
12
12
  }
13
- /** True when `value` is an Error (or subclass), tested by tag not `instanceof`. */
13
+ /**
14
+ * True when `value` is an Error (or subclass) or a `DOMException` — which has
15
+ * its own tag yet carries the same `name`/`message`/`stack` — tested by tag,
16
+ * not `instanceof`, so a cross-realm error still matches.
17
+ */
14
18
  function isErrorValue(value) {
15
- return Object.prototype.toString.call(value) === '[object Error]';
19
+ const tag = Object.prototype.toString.call(value);
20
+ return tag === '[object Error]' || tag === '[object DOMException]';
16
21
  }
17
22
  /**
18
23
  * True for a value whose identity matters more than its own properties.
@@ -22,11 +27,21 @@ function isOpaqueValue(value) {
22
27
  const tag = Object.prototype.toString.call(value);
23
28
  return tag === '[object Date]' || tag === '[object RegExp]';
24
29
  }
25
- /** Rebuild entries into a plain object, redacting values at secret-looking keys. */
30
+ /**
31
+ * Rebuild entries into a plain object, redacting values at secret-looking
32
+ * keys. Properties are defined, not assigned: `out['__proto__'] = …` would
33
+ * replace the result's prototype (and drop the entry) instead of recording the
34
+ * key as data.
35
+ */
26
36
  function redactEntries(entries, keyPatterns, walk) {
27
37
  const out = {};
28
38
  for (const [key, value] of entries) {
29
- out[key] = (0, secret_patterns_1.isSecretKey)(key, keyPatterns) ? secret_patterns_1.REDACTED : walk(value);
39
+ Object.defineProperty(out, key, {
40
+ value: (0, secret_patterns_1.isSecretKey)(key, keyPatterns) ? secret_patterns_1.REDACTED : walk(value),
41
+ enumerable: true,
42
+ writable: true,
43
+ configurable: true,
44
+ });
30
45
  }
31
46
  return out;
32
47
  }
@@ -42,23 +57,27 @@ function redactMap(value, deps) {
42
57
  /**
43
58
  * Rebuild an Error as a plain object carrying its redacted text alongside its
44
59
  * redacted own properties. The one exception is an Error with no own
45
- * enumerable data whose text holds no secret: it is returned by reference so
46
- * its identity and stack trace survive, which is what keeps a caught error
47
- * useful in a log.
60
+ * enumerable data, no `cause`, no aggregated `errors`, and no secret in its
61
+ * text: it is returned by reference so its identity and stack trace survive,
62
+ * which is what keeps a caught error useful in a log.
48
63
  *
49
- * `cause` is copied explicitly because `new Error(msg, { cause })` defines it
50
- * as *non-enumerable* per spec, so `Object.entries` never sees it. Without
51
- * this the whole chain vanished on every rebuild — and the rebuild always
52
- * fires for this library's own error types, since each attaches an enumerable
53
- * `code`/`context`. A redacted `RetryExhaustedError` would then no longer say
54
- * whether the underlying failure was a throttle, a validation error or a
55
- * network fault, which is the entire reason it carries a cause. Recursing it
56
- * through `walk` redacts the chain too, and the cycle guard handles a cause
57
- * that points back at its own wrapper.
64
+ * `cause` and `AggregateError.errors` are copied explicitly because both are
65
+ * defined *non-enumerable* per spec, so `Object.entries` never sees them.
66
+ * Without this the whole chain vanished on every rebuild — and the rebuild
67
+ * always fires for this library's own error types, since each attaches an
68
+ * enumerable `code`/`context`. A redacted `RetryExhaustedError` would then no
69
+ * longer say whether the underlying failure was a throttle, a validation error
70
+ * or a network fault, which is the entire reason it carries a cause. A bare
71
+ * Error *with* a cause is rebuilt for the same reason: passing it by reference
72
+ * would hand the caller whatever secret the cause carries. Recursing through
73
+ * `walk` redacts the chain too, and the cycle guard handles a cause that
74
+ * points back at its own wrapper.
58
75
  */
59
76
  function redactError(current, entries, deps) {
60
77
  const text = (0, secret_patterns_1.redactErrorText)(current, deps.valuePatterns);
61
- if (entries.length === 0 && !text.changed)
78
+ const aggregated = current.errors;
79
+ const bare = entries.length === 0 && current.cause === undefined && aggregated === undefined;
80
+ if (bare && !text.changed)
62
81
  return current;
63
82
  const out = redactEntries(entries, deps.keyPatterns, deps.walk);
64
83
  out.name = text.name;
@@ -66,6 +85,8 @@ function redactError(current, entries, deps) {
66
85
  out.stack = text.stack;
67
86
  if (current.cause !== undefined)
68
87
  out.cause = deps.walk(current.cause);
88
+ if (Array.isArray(aggregated))
89
+ out.errors = deps.walk(aggregated);
69
90
  return out;
70
91
  }
71
92
  /**
@@ -89,4 +110,3 @@ function walkObject(current, deps) {
89
110
  return redactError(current, entries, deps);
90
111
  return redactEntries(entries, deps.keyPatterns, deps.walk);
91
112
  }
92
- //# sourceMappingURL=redaction-walk.js.map
@@ -1,4 +1,4 @@
1
- import type { Logger } from './logger';
1
+ import type { LogArgument, Logger } from './logger';
2
2
  import { type Redactable } from './redaction-walk';
3
3
  /**
4
4
  * Recursively clone `value`, replacing any value at a secret-looking key with
@@ -13,14 +13,23 @@ import { type Redactable } from './redaction-walk';
13
13
  * `stack` redacted and every other own property recursed like a plain object.
14
14
  * `Date`/`RegExp` keep their identity rather than collapsing to `{}`,
15
15
  * `Set`/`Map` render as their contents, and binary views become a short label.
16
- * Does not mutate the input.
16
+ * Does not mutate the input. Accepts any log argument — a typed `Error`, a
17
+ * class instance, a `Record` — so callers never cast.
17
18
  */
18
- export declare function redactSecrets(value: Redactable, patterns?: readonly string[], valuePatterns?: readonly RegExp[]): Redactable;
19
+ export declare function redactSecrets(value: LogArgument | undefined, patterns?: readonly string[], valuePatterns?: readonly RegExp[]): Redactable;
19
20
  /** Options controlling {@link redactLogger}. */
20
21
  export interface RedactLoggerOptions {
21
- /** Additional key names (matched case-insensitively as substrings) to redact. */
22
+ /**
23
+ * Additional key names to redact. Matched like the defaults: a key is
24
+ * redacted when its normalised form (lower-case, punctuation removed) equals
25
+ * or ends with the normalised name, so `'ssn'` covers `SSN` and `user_ssn`.
26
+ */
22
27
  extraKeys?: readonly string[];
23
- /** Additional secret shapes to redact wherever they appear inside a string. */
28
+ /**
29
+ * Additional secret shapes to redact wherever they appear inside a string.
30
+ * A pattern's first capture group, if it has one, is preserved verbatim and
31
+ * only the remainder of the match is replaced.
32
+ */
24
33
  extraValuePatterns?: readonly RegExp[];
25
34
  }
26
35
  /**
@@ -28,4 +37,3 @@ export interface RedactLoggerOptions {
28
37
  * string is passed through unchanged (never interpolate secrets into it).
29
38
  */
30
39
  export declare function redactLogger(inner: Logger, options?: RedactLoggerOptions): Logger;
31
- //# sourceMappingURL=redaction.d.ts.map
@@ -4,6 +4,8 @@ exports.redactSecrets = redactSecrets;
4
4
  exports.redactLogger = redactLogger;
5
5
  const redaction_walk_1 = require("./redaction-walk");
6
6
  const secret_patterns_1 = require("./secret-patterns");
7
+ /** Substituted for a log argument whose redaction itself failed (a throwing getter, say). */
8
+ const UNREDACTABLE = '[UNREDACTABLE]';
7
9
  /**
8
10
  * Recursively clone `value`, replacing any value at a secret-looking key with
9
11
  * `[REDACTED]` and any recognised secret *shape* inside a string — including an
@@ -17,7 +19,8 @@ const secret_patterns_1 = require("./secret-patterns");
17
19
  * `stack` redacted and every other own property recursed like a plain object.
18
20
  * `Date`/`RegExp` keep their identity rather than collapsing to `{}`,
19
21
  * `Set`/`Map` render as their contents, and binary views become a short label.
20
- * Does not mutate the input.
22
+ * Does not mutate the input. Accepts any log argument — a typed `Error`, a
23
+ * class instance, a `Record` — so callers never cast.
21
24
  */
22
25
  function redactSecrets(value, patterns = secret_patterns_1.DEFAULT_SECRET_KEY_PATTERNS, valuePatterns = secret_patterns_1.DEFAULT_SECRET_VALUE_PATTERNS) {
23
26
  const seen = new WeakSet();
@@ -38,18 +41,31 @@ function redactSecrets(value, patterns = secret_patterns_1.DEFAULT_SECRET_KEY_PA
38
41
  };
39
42
  return walk(value);
40
43
  }
44
+ /**
45
+ * Redact one log argument, never throwing: an argument whose redaction fails
46
+ * (a getter that throws, an exotic object) is replaced by a fixed marker rather
47
+ * than either leaking unredacted or failing the library operation that logged.
48
+ */
49
+ function safeRedact(arg, patterns, valuePatterns) {
50
+ try {
51
+ return redactSecrets(arg, patterns, valuePatterns);
52
+ }
53
+ catch {
54
+ return UNREDACTABLE;
55
+ }
56
+ }
41
57
  /**
42
58
  * Wrap a logger so object args are redacted before delegation. The message
43
59
  * string is passed through unchanged (never interpolate secrets into it).
44
60
  */
45
61
  function redactLogger(inner, options = {}) {
46
62
  const patterns = options.extraKeys
47
- ? [...secret_patterns_1.DEFAULT_SECRET_KEY_PATTERNS, ...options.extraKeys.map((key) => key.toLowerCase())]
63
+ ? [...secret_patterns_1.DEFAULT_SECRET_KEY_PATTERNS, ...options.extraKeys.map(secret_patterns_1.normaliseKey)]
48
64
  : secret_patterns_1.DEFAULT_SECRET_KEY_PATTERNS;
49
65
  const valuePatterns = options.extraValuePatterns
50
66
  ? [...secret_patterns_1.DEFAULT_SECRET_VALUE_PATTERNS, ...options.extraValuePatterns]
51
67
  : secret_patterns_1.DEFAULT_SECRET_VALUE_PATTERNS;
52
- const wrap = (args) => args.map((arg) => redactSecrets(arg, patterns, valuePatterns));
68
+ const wrap = (args) => args.map((arg) => safeRedact(arg, patterns, valuePatterns));
53
69
  return {
54
70
  info: (message, ...args) => inner.info(message, ...wrap(args)),
55
71
  warn: (message, ...args) => inner.warn(message, ...wrap(args)),
@@ -57,4 +73,3 @@ function redactLogger(inner, options = {}) {
57
73
  debug: (message, ...args) => inner.debug(message, ...wrap(args)),
58
74
  };
59
75
  }
60
- //# sourceMappingURL=redaction.js.map