@farukada/aws-langgraph-dynamodb-ts 0.2.2 → 0.3.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 (517) hide show
  1. package/README.md +226 -510
  2. package/dist/checkpointer/actions/delete-thread.d.ts +7 -6
  3. package/dist/checkpointer/actions/delete-thread.d.ts.map +1 -1
  4. package/dist/checkpointer/actions/delete-thread.js +47 -152
  5. package/dist/checkpointer/actions/delete-thread.js.map +1 -1
  6. package/dist/checkpointer/actions/get-tuple.d.ts +6 -14
  7. package/dist/checkpointer/actions/get-tuple.d.ts.map +1 -1
  8. package/dist/checkpointer/actions/get-tuple.js +13 -166
  9. package/dist/checkpointer/actions/get-tuple.js.map +1 -1
  10. package/dist/checkpointer/actions/list.d.ts +10 -0
  11. package/dist/checkpointer/actions/list.d.ts.map +1 -0
  12. package/dist/checkpointer/actions/list.js +51 -0
  13. package/dist/checkpointer/actions/list.js.map +1 -0
  14. package/dist/checkpointer/actions/put-writes.d.ts +6 -6
  15. package/dist/checkpointer/actions/put-writes.d.ts.map +1 -1
  16. package/dist/checkpointer/actions/put-writes.js +26 -75
  17. package/dist/checkpointer/actions/put-writes.js.map +1 -1
  18. package/dist/checkpointer/actions/put.d.ts +6 -11
  19. package/dist/checkpointer/actions/put.d.ts.map +1 -1
  20. package/dist/checkpointer/actions/put.js +29 -161
  21. package/dist/checkpointer/actions/put.js.map +1 -1
  22. package/dist/checkpointer/internal/assemble.d.ts +10 -0
  23. package/dist/checkpointer/internal/assemble.d.ts.map +1 -0
  24. package/dist/checkpointer/internal/assemble.js +37 -0
  25. package/dist/checkpointer/internal/assemble.js.map +1 -0
  26. package/dist/checkpointer/internal/configurable.d.ts +13 -0
  27. package/dist/checkpointer/internal/configurable.d.ts.map +1 -0
  28. package/dist/checkpointer/internal/configurable.js +23 -0
  29. package/dist/checkpointer/internal/configurable.js.map +1 -0
  30. package/dist/checkpointer/internal/fetch.d.ts +10 -0
  31. package/dist/checkpointer/internal/fetch.d.ts.map +1 -0
  32. package/dist/checkpointer/internal/fetch.js +46 -0
  33. package/dist/checkpointer/internal/fetch.js.map +1 -0
  34. package/dist/checkpointer/internal/filter-match.d.ts +12 -0
  35. package/dist/checkpointer/internal/filter-match.d.ts.map +1 -0
  36. package/dist/checkpointer/internal/filter-match.js +14 -0
  37. package/dist/checkpointer/internal/filter-match.js.map +1 -0
  38. package/dist/checkpointer/internal/item-reader.d.ts +10 -0
  39. package/dist/checkpointer/internal/item-reader.d.ts.map +1 -0
  40. package/dist/checkpointer/internal/item-reader.js +26 -0
  41. package/dist/checkpointer/internal/item-reader.js.map +1 -0
  42. package/dist/checkpointer/internal/item-writer.d.ts +14 -0
  43. package/dist/checkpointer/internal/item-writer.d.ts.map +1 -0
  44. package/dist/checkpointer/internal/item-writer.js +68 -0
  45. package/dist/checkpointer/internal/item-writer.js.map +1 -0
  46. package/dist/checkpointer/internal/keys.d.ts +15 -0
  47. package/dist/checkpointer/internal/keys.d.ts.map +1 -0
  48. package/dist/checkpointer/internal/keys.js +52 -0
  49. package/dist/checkpointer/internal/keys.js.map +1 -0
  50. package/dist/checkpointer/internal/query.d.ts +16 -0
  51. package/dist/checkpointer/internal/query.d.ts.map +1 -0
  52. package/dist/checkpointer/internal/query.js +33 -0
  53. package/dist/checkpointer/internal/query.js.map +1 -0
  54. package/dist/checkpointer/internal/setup.d.ts +31 -0
  55. package/dist/checkpointer/internal/setup.d.ts.map +1 -0
  56. package/dist/checkpointer/internal/setup.js +29 -0
  57. package/dist/checkpointer/internal/setup.js.map +1 -0
  58. package/dist/checkpointer/internal/validation.d.ts +9 -0
  59. package/dist/checkpointer/internal/validation.d.ts.map +1 -0
  60. package/dist/checkpointer/internal/validation.js +28 -0
  61. package/dist/checkpointer/internal/validation.js.map +1 -0
  62. package/dist/checkpointer/saver.d.ts +21 -0
  63. package/dist/checkpointer/saver.d.ts.map +1 -0
  64. package/dist/checkpointer/saver.js +49 -0
  65. package/dist/checkpointer/saver.js.map +1 -0
  66. package/dist/checkpointer/types.d.ts +43 -0
  67. package/dist/checkpointer/types.d.ts.map +1 -0
  68. package/dist/{store/types/index.js → checkpointer/types.js} +1 -1
  69. package/dist/checkpointer/types.js.map +1 -0
  70. package/dist/factory/factory.d.ts +41 -0
  71. package/dist/factory/factory.d.ts.map +1 -0
  72. package/dist/factory/factory.js +49 -0
  73. package/dist/factory/factory.js.map +1 -0
  74. package/dist/history/actions/add-messages.d.ts +12 -7
  75. package/dist/history/actions/add-messages.d.ts.map +1 -1
  76. package/dist/history/actions/add-messages.js +50 -48
  77. package/dist/history/actions/add-messages.js.map +1 -1
  78. package/dist/history/actions/clear.d.ts +5 -11
  79. package/dist/history/actions/clear.d.ts.map +1 -1
  80. package/dist/history/actions/clear.js +28 -62
  81. package/dist/history/actions/clear.js.map +1 -1
  82. package/dist/history/actions/get-messages.d.ts +6 -13
  83. package/dist/history/actions/get-messages.d.ts.map +1 -1
  84. package/dist/history/actions/get-messages.js +23 -59
  85. package/dist/history/actions/get-messages.js.map +1 -1
  86. package/dist/history/actions/list-sessions.d.ts +6 -22
  87. package/dist/history/actions/list-sessions.d.ts.map +1 -1
  88. package/dist/history/actions/list-sessions.js +26 -69
  89. package/dist/history/actions/list-sessions.js.map +1 -1
  90. package/dist/history/actions/reconcile-count.d.ts +10 -0
  91. package/dist/history/actions/reconcile-count.d.ts.map +1 -0
  92. package/dist/history/actions/reconcile-count.js +39 -0
  93. package/dist/history/actions/reconcile-count.js.map +1 -0
  94. package/dist/history/chat-message-history.d.ts +36 -0
  95. package/dist/history/chat-message-history.d.ts.map +1 -0
  96. package/dist/history/chat-message-history.js +67 -0
  97. package/dist/history/chat-message-history.js.map +1 -0
  98. package/dist/history/internal/append-saga.d.ts +17 -0
  99. package/dist/history/internal/append-saga.d.ts.map +1 -0
  100. package/dist/history/internal/append-saga.js +94 -0
  101. package/dist/history/internal/append-saga.js.map +1 -0
  102. package/dist/history/internal/item-mapper.d.ts +12 -0
  103. package/dist/history/internal/item-mapper.d.ts.map +1 -0
  104. package/dist/history/internal/item-mapper.js +33 -0
  105. package/dist/history/internal/item-mapper.js.map +1 -0
  106. package/dist/history/internal/keys.d.ts +9 -0
  107. package/dist/history/internal/keys.d.ts.map +1 -0
  108. package/dist/history/internal/keys.js +22 -0
  109. package/dist/history/internal/keys.js.map +1 -0
  110. package/dist/history/internal/message-chunker.d.ts +14 -0
  111. package/dist/history/internal/message-chunker.d.ts.map +1 -0
  112. package/dist/history/internal/message-chunker.js +60 -0
  113. package/dist/history/internal/message-chunker.js.map +1 -0
  114. package/dist/history/internal/message-transaction.d.ts +17 -0
  115. package/dist/history/internal/message-transaction.d.ts.map +1 -0
  116. package/dist/history/internal/message-transaction.js +27 -0
  117. package/dist/history/internal/message-transaction.js.map +1 -0
  118. package/dist/history/internal/query.d.ts +6 -0
  119. package/dist/history/internal/query.d.ts.map +1 -0
  120. package/dist/history/internal/query.js +28 -0
  121. package/dist/history/internal/query.js.map +1 -0
  122. package/dist/history/internal/session-update.d.ts +20 -0
  123. package/dist/history/internal/session-update.d.ts.map +1 -0
  124. package/dist/history/internal/session-update.js +46 -0
  125. package/dist/history/internal/session-update.js.map +1 -0
  126. package/dist/history/internal/setup.d.ts +28 -0
  127. package/dist/history/internal/setup.d.ts.map +1 -0
  128. package/dist/history/internal/setup.js +27 -0
  129. package/dist/history/internal/setup.js.map +1 -0
  130. package/dist/history/internal/title-generator.d.ts +7 -0
  131. package/dist/history/internal/title-generator.d.ts.map +1 -0
  132. package/dist/history/internal/title-generator.js +16 -0
  133. package/dist/history/internal/title-generator.js.map +1 -0
  134. package/dist/history/internal/ttl-anchor.d.ts +12 -0
  135. package/dist/history/internal/ttl-anchor.d.ts.map +1 -0
  136. package/dist/history/internal/ttl-anchor.js +26 -0
  137. package/dist/history/internal/ttl-anchor.js.map +1 -0
  138. package/dist/history/session-adapter.d.ts +10 -26
  139. package/dist/history/session-adapter.d.ts.map +1 -1
  140. package/dist/history/session-adapter.js +15 -57
  141. package/dist/history/session-adapter.js.map +1 -1
  142. package/dist/history/types.d.ts +36 -0
  143. package/dist/history/types.d.ts.map +1 -0
  144. package/dist/history/types.js +3 -0
  145. package/dist/history/types.js.map +1 -0
  146. package/dist/index.d.ts +18 -10
  147. package/dist/index.d.ts.map +1 -1
  148. package/dist/index.js +24 -16
  149. package/dist/index.js.map +1 -1
  150. package/dist/shared/clock.d.ts +3 -0
  151. package/dist/shared/clock.d.ts.map +1 -0
  152. package/dist/shared/clock.js +8 -0
  153. package/dist/shared/clock.js.map +1 -0
  154. package/dist/shared/codec/codec.d.ts +44 -0
  155. package/dist/shared/codec/codec.d.ts.map +1 -0
  156. package/dist/shared/codec/codec.js +44 -0
  157. package/dist/shared/codec/codec.js.map +1 -0
  158. package/dist/shared/codec/compression.d.ts +25 -0
  159. package/dist/shared/codec/compression.d.ts.map +1 -0
  160. package/dist/shared/codec/compression.js +49 -0
  161. package/dist/shared/codec/compression.js.map +1 -0
  162. package/dist/shared/codec/descriptor-keys.d.ts +4 -0
  163. package/dist/shared/codec/descriptor-keys.d.ts.map +1 -0
  164. package/dist/shared/codec/descriptor-keys.js +14 -0
  165. package/dist/shared/codec/descriptor-keys.js.map +1 -0
  166. package/dist/shared/codec/json-serde.d.ts +8 -0
  167. package/dist/shared/codec/json-serde.d.ts.map +1 -0
  168. package/dist/shared/codec/json-serde.js +18 -0
  169. package/dist/shared/codec/json-serde.js.map +1 -0
  170. package/dist/shared/codec/s3/client.d.ts +6 -0
  171. package/dist/shared/codec/s3/client.d.ts.map +1 -0
  172. package/dist/shared/codec/s3/client.js +18 -0
  173. package/dist/shared/codec/s3/client.js.map +1 -0
  174. package/dist/shared/codec/s3/config.d.ts +16 -0
  175. package/dist/shared/codec/s3/config.d.ts.map +1 -0
  176. package/dist/shared/codec/s3/config.js +14 -0
  177. package/dist/shared/codec/s3/config.js.map +1 -0
  178. package/dist/shared/codec/s3/delete.d.ts +8 -0
  179. package/dist/shared/codec/s3/delete.d.ts.map +1 -0
  180. package/dist/shared/codec/s3/delete.js +29 -0
  181. package/dist/shared/codec/s3/delete.js.map +1 -0
  182. package/dist/shared/codec/s3/lifecycle.d.ts +8 -0
  183. package/dist/shared/codec/s3/lifecycle.d.ts.map +1 -0
  184. package/dist/shared/codec/s3/lifecycle.js +47 -0
  185. package/dist/shared/codec/s3/lifecycle.js.map +1 -0
  186. package/dist/shared/codec/s3/offloader.d.ts +33 -0
  187. package/dist/shared/codec/s3/offloader.d.ts.map +1 -0
  188. package/dist/shared/codec/s3/offloader.js +80 -0
  189. package/dist/shared/codec/s3/offloader.js.map +1 -0
  190. package/dist/shared/codec/s3/orphans.d.ts +16 -0
  191. package/dist/shared/codec/s3/orphans.d.ts.map +1 -0
  192. package/dist/shared/codec/s3/orphans.js +73 -0
  193. package/dist/shared/codec/s3/orphans.js.map +1 -0
  194. package/dist/shared/codec/s3/read-write.d.ts +14 -0
  195. package/dist/shared/codec/s3/read-write.d.ts.map +1 -0
  196. package/dist/shared/codec/s3/read-write.js +42 -0
  197. package/dist/shared/codec/s3/read-write.js.map +1 -0
  198. package/dist/shared/constants.d.ts +37 -0
  199. package/dist/shared/constants.d.ts.map +1 -0
  200. package/dist/shared/constants.js +40 -0
  201. package/dist/shared/constants.js.map +1 -0
  202. package/dist/shared/dynamodb/backoff.d.ts +15 -0
  203. package/dist/shared/dynamodb/backoff.d.ts.map +1 -0
  204. package/dist/shared/dynamodb/backoff.js +48 -0
  205. package/dist/shared/dynamodb/backoff.js.map +1 -0
  206. package/dist/shared/dynamodb/batch-write.d.ts +10 -0
  207. package/dist/shared/dynamodb/batch-write.d.ts.map +1 -0
  208. package/dist/shared/dynamodb/batch-write.js +17 -0
  209. package/dist/shared/dynamodb/batch-write.js.map +1 -0
  210. package/dist/shared/dynamodb/client.d.ts +21 -0
  211. package/dist/shared/dynamodb/client.d.ts.map +1 -0
  212. package/dist/shared/dynamodb/client.js +19 -0
  213. package/dist/shared/dynamodb/client.js.map +1 -0
  214. package/dist/shared/dynamodb/drain-unprocessed.d.ts +15 -0
  215. package/dist/shared/dynamodb/drain-unprocessed.d.ts.map +1 -0
  216. package/dist/shared/dynamodb/drain-unprocessed.js +35 -0
  217. package/dist/shared/dynamodb/drain-unprocessed.js.map +1 -0
  218. package/dist/shared/dynamodb/paginate-core.d.ts +22 -0
  219. package/dist/shared/dynamodb/paginate-core.d.ts.map +1 -0
  220. package/dist/shared/dynamodb/paginate-core.js +52 -0
  221. package/dist/shared/dynamodb/paginate-core.js.map +1 -0
  222. package/dist/shared/dynamodb/paginate.d.ts +15 -0
  223. package/dist/shared/dynamodb/paginate.d.ts.map +1 -0
  224. package/dist/shared/dynamodb/paginate.js +20 -0
  225. package/dist/shared/dynamodb/paginate.js.map +1 -0
  226. package/dist/shared/dynamodb/retry-classifier.d.ts +9 -0
  227. package/dist/shared/dynamodb/retry-classifier.d.ts.map +1 -0
  228. package/dist/shared/dynamodb/retry-classifier.js +75 -0
  229. package/dist/shared/dynamodb/retry-classifier.js.map +1 -0
  230. package/dist/shared/dynamodb/retry.d.ts +18 -0
  231. package/dist/shared/dynamodb/retry.d.ts.map +1 -0
  232. package/dist/shared/dynamodb/retry.js +53 -0
  233. package/dist/shared/dynamodb/retry.js.map +1 -0
  234. package/dist/shared/dynamodb/scan.d.ts +15 -0
  235. package/dist/shared/dynamodb/scan.d.ts.map +1 -0
  236. package/dist/shared/dynamodb/scan.js +20 -0
  237. package/dist/shared/dynamodb/scan.js.map +1 -0
  238. package/dist/shared/dynamodb/types.d.ts +24 -0
  239. package/dist/shared/dynamodb/types.d.ts.map +1 -0
  240. package/dist/shared/dynamodb/types.js +3 -0
  241. package/dist/shared/dynamodb/types.js.map +1 -0
  242. package/dist/shared/errors/base-error.d.ts +22 -0
  243. package/dist/shared/errors/base-error.d.ts.map +1 -0
  244. package/dist/shared/errors/base-error.js +28 -0
  245. package/dist/shared/errors/base-error.js.map +1 -0
  246. package/dist/shared/errors/error-code.d.ts +13 -0
  247. package/dist/shared/errors/error-code.d.ts.map +1 -0
  248. package/dist/shared/errors/error-code.js +17 -0
  249. package/dist/shared/errors/error-code.js.map +1 -0
  250. package/dist/shared/errors/errors.d.ts +47 -0
  251. package/dist/shared/errors/errors.d.ts.map +1 -0
  252. package/dist/shared/errors/errors.js +82 -0
  253. package/dist/shared/errors/errors.js.map +1 -0
  254. package/dist/shared/errors/wrap-error.d.ts +16 -0
  255. package/dist/shared/errors/wrap-error.d.ts.map +1 -0
  256. package/dist/shared/errors/wrap-error.js +30 -0
  257. package/dist/shared/errors/wrap-error.js.map +1 -0
  258. package/dist/shared/logging/logger.d.ts +14 -0
  259. package/dist/shared/logging/logger.d.ts.map +1 -0
  260. package/dist/shared/logging/logger.js +16 -0
  261. package/dist/shared/logging/logger.js.map +1 -0
  262. package/dist/shared/logging/redaction.d.ts +19 -0
  263. package/dist/shared/logging/redaction.d.ts.map +1 -0
  264. package/dist/shared/logging/redaction.js +67 -0
  265. package/dist/shared/logging/redaction.js.map +1 -0
  266. package/dist/shared/options.d.ts +32 -0
  267. package/dist/shared/options.d.ts.map +1 -0
  268. package/dist/shared/options.js +3 -0
  269. package/dist/shared/options.js.map +1 -0
  270. package/dist/shared/ulid.d.ts +10 -0
  271. package/dist/shared/ulid.d.ts.map +1 -0
  272. package/dist/shared/ulid.js +65 -0
  273. package/dist/shared/ulid.js.map +1 -0
  274. package/dist/shared/validation/primitives.d.ts +17 -0
  275. package/dist/shared/validation/primitives.d.ts.map +1 -0
  276. package/dist/shared/validation/primitives.js +71 -0
  277. package/dist/shared/validation/primitives.js.map +1 -0
  278. package/dist/shared/validation/ttl.d.ts +16 -0
  279. package/dist/shared/validation/ttl.d.ts.map +1 -0
  280. package/dist/shared/validation/ttl.js +26 -0
  281. package/dist/shared/validation/ttl.js.map +1 -0
  282. package/dist/store/actions/get.d.ts +5 -0
  283. package/dist/store/actions/get.d.ts.map +1 -0
  284. package/dist/store/actions/get.js +21 -0
  285. package/dist/store/actions/get.js.map +1 -0
  286. package/dist/store/actions/list-namespaces.d.ts +9 -0
  287. package/dist/store/actions/list-namespaces.d.ts.map +1 -0
  288. package/dist/store/actions/list-namespaces.js +46 -0
  289. package/dist/store/actions/list-namespaces.js.map +1 -0
  290. package/dist/store/actions/put.d.ts +11 -0
  291. package/dist/store/actions/put.d.ts.map +1 -0
  292. package/dist/store/actions/put.js +81 -0
  293. package/dist/store/actions/put.js.map +1 -0
  294. package/dist/store/actions/reconcile-vector-index.d.ts +17 -0
  295. package/dist/store/actions/reconcile-vector-index.d.ts.map +1 -0
  296. package/dist/store/actions/reconcile-vector-index.js +27 -0
  297. package/dist/store/actions/reconcile-vector-index.js.map +1 -0
  298. package/dist/store/actions/search.d.ts +10 -0
  299. package/dist/store/actions/search.d.ts.map +1 -0
  300. package/dist/store/actions/search.js +72 -0
  301. package/dist/store/actions/search.js.map +1 -0
  302. package/dist/store/internal/filter.d.ts +10 -0
  303. package/dist/store/internal/filter.d.ts.map +1 -0
  304. package/dist/store/internal/filter.js +37 -0
  305. package/dist/store/internal/filter.js.map +1 -0
  306. package/dist/store/internal/index-reconcile.d.ts +22 -0
  307. package/dist/store/internal/index-reconcile.d.ts.map +1 -0
  308. package/dist/store/internal/index-reconcile.js +68 -0
  309. package/dist/store/internal/index-reconcile.js.map +1 -0
  310. package/dist/store/internal/index-sync.d.ts +11 -0
  311. package/dist/store/internal/index-sync.d.ts.map +1 -0
  312. package/dist/store/internal/index-sync.js +26 -0
  313. package/dist/store/internal/index-sync.js.map +1 -0
  314. package/dist/store/internal/item-mapper.d.ts +23 -0
  315. package/dist/store/internal/item-mapper.d.ts.map +1 -0
  316. package/dist/store/internal/item-mapper.js +51 -0
  317. package/dist/store/internal/item-mapper.js.map +1 -0
  318. package/dist/store/internal/keys.d.ts +18 -0
  319. package/dist/store/internal/keys.d.ts.map +1 -0
  320. package/dist/store/internal/keys.js +36 -0
  321. package/dist/store/internal/keys.js.map +1 -0
  322. package/dist/store/internal/namespace-match.d.ts +12 -0
  323. package/dist/store/internal/namespace-match.d.ts.map +1 -0
  324. package/dist/store/internal/namespace-match.js +41 -0
  325. package/dist/store/internal/namespace-match.js.map +1 -0
  326. package/dist/store/internal/query.d.ts +6 -0
  327. package/dist/store/internal/query.d.ts.map +1 -0
  328. package/dist/store/internal/query.js +32 -0
  329. package/dist/store/internal/query.js.map +1 -0
  330. package/dist/store/internal/ranker.d.ts +13 -0
  331. package/dist/store/internal/ranker.d.ts.map +1 -0
  332. package/dist/store/internal/ranker.js +29 -0
  333. package/dist/store/internal/ranker.js.map +1 -0
  334. package/dist/store/internal/semantic-search.d.ts +13 -0
  335. package/dist/store/internal/semantic-search.d.ts.map +1 -0
  336. package/dist/store/internal/semantic-search.js +47 -0
  337. package/dist/store/internal/semantic-search.js.map +1 -0
  338. package/dist/store/internal/setup.d.ts +31 -0
  339. package/dist/store/internal/setup.d.ts.map +1 -0
  340. package/dist/store/internal/setup.js +29 -0
  341. package/dist/store/internal/setup.js.map +1 -0
  342. package/dist/store/internal/validation.d.ts +7 -0
  343. package/dist/store/internal/validation.d.ts.map +1 -0
  344. package/dist/store/internal/validation.js +26 -0
  345. package/dist/store/internal/validation.js.map +1 -0
  346. package/dist/store/store.d.ts +24 -0
  347. package/dist/store/store.d.ts.map +1 -0
  348. package/dist/store/store.js +58 -0
  349. package/dist/store/store.js.map +1 -0
  350. package/dist/store/types.d.ts +28 -0
  351. package/dist/store/types.d.ts.map +1 -0
  352. package/dist/store/types.js +3 -0
  353. package/dist/store/types.js.map +1 -0
  354. package/dist/store/vector-backend.d.ts +27 -0
  355. package/dist/store/vector-backend.d.ts.map +1 -0
  356. package/dist/store/vector-backend.js +3 -0
  357. package/dist/store/vector-backend.js.map +1 -0
  358. package/package.json +21 -22
  359. package/dist/checkpointer/actions/index.d.ts +0 -5
  360. package/dist/checkpointer/actions/index.d.ts.map +0 -1
  361. package/dist/checkpointer/actions/index.js +0 -21
  362. package/dist/checkpointer/actions/index.js.map +0 -1
  363. package/dist/checkpointer/actions/validate-configurable.d.ts +0 -10
  364. package/dist/checkpointer/actions/validate-configurable.d.ts.map +0 -1
  365. package/dist/checkpointer/actions/validate-configurable.js +0 -39
  366. package/dist/checkpointer/actions/validate-configurable.js.map +0 -1
  367. package/dist/checkpointer/actions/writer.d.ts +0 -52
  368. package/dist/checkpointer/actions/writer.d.ts.map +0 -1
  369. package/dist/checkpointer/actions/writer.js +0 -109
  370. package/dist/checkpointer/actions/writer.js.map +0 -1
  371. package/dist/checkpointer/index.d.ts +0 -118
  372. package/dist/checkpointer/index.d.ts.map +0 -1
  373. package/dist/checkpointer/index.js +0 -393
  374. package/dist/checkpointer/index.js.map +0 -1
  375. package/dist/checkpointer/types/index.d.ts +0 -232
  376. package/dist/checkpointer/types/index.d.ts.map +0 -1
  377. package/dist/checkpointer/types/index.js +0 -13
  378. package/dist/checkpointer/types/index.js.map +0 -1
  379. package/dist/checkpointer/utils/deserialization.d.ts +0 -20
  380. package/dist/checkpointer/utils/deserialization.d.ts.map +0 -1
  381. package/dist/checkpointer/utils/deserialization.js +0 -81
  382. package/dist/checkpointer/utils/deserialization.js.map +0 -1
  383. package/dist/checkpointer/utils/index.d.ts +0 -7
  384. package/dist/checkpointer/utils/index.d.ts.map +0 -1
  385. package/dist/checkpointer/utils/index.js +0 -27
  386. package/dist/checkpointer/utils/index.js.map +0 -1
  387. package/dist/checkpointer/utils/validation.d.ts +0 -48
  388. package/dist/checkpointer/utils/validation.d.ts.map +0 -1
  389. package/dist/checkpointer/utils/validation.js +0 -235
  390. package/dist/checkpointer/utils/validation.js.map +0 -1
  391. package/dist/factory.d.ts +0 -153
  392. package/dist/factory.d.ts.map +0 -1
  393. package/dist/factory.js +0 -206
  394. package/dist/factory.js.map +0 -1
  395. package/dist/history/actions/add-message.d.ts +0 -10
  396. package/dist/history/actions/add-message.d.ts.map +0 -1
  397. package/dist/history/actions/add-message.js +0 -24
  398. package/dist/history/actions/add-message.js.map +0 -1
  399. package/dist/history/actions/index.d.ts +0 -9
  400. package/dist/history/actions/index.d.ts.map +0 -1
  401. package/dist/history/actions/index.js +0 -17
  402. package/dist/history/actions/index.js.map +0 -1
  403. package/dist/history/index.d.ts +0 -118
  404. package/dist/history/index.d.ts.map +0 -1
  405. package/dist/history/index.js +0 -179
  406. package/dist/history/index.js.map +0 -1
  407. package/dist/history/types/index.d.ts +0 -184
  408. package/dist/history/types/index.d.ts.map +0 -1
  409. package/dist/history/types/index.js +0 -7
  410. package/dist/history/types/index.js.map +0 -1
  411. package/dist/history/utils/index.d.ts +0 -9
  412. package/dist/history/utils/index.d.ts.map +0 -1
  413. package/dist/history/utils/index.js +0 -27
  414. package/dist/history/utils/index.js.map +0 -1
  415. package/dist/history/utils/optimistic-retry.d.ts +0 -31
  416. package/dist/history/utils/optimistic-retry.d.ts.map +0 -1
  417. package/dist/history/utils/optimistic-retry.js +0 -74
  418. package/dist/history/utils/optimistic-retry.js.map +0 -1
  419. package/dist/history/utils/title-generator.d.ts +0 -12
  420. package/dist/history/utils/title-generator.d.ts.map +0 -1
  421. package/dist/history/utils/title-generator.js +0 -57
  422. package/dist/history/utils/title-generator.js.map +0 -1
  423. package/dist/history/utils/update-expression-builder.d.ts +0 -55
  424. package/dist/history/utils/update-expression-builder.d.ts.map +0 -1
  425. package/dist/history/utils/update-expression-builder.js +0 -112
  426. package/dist/history/utils/update-expression-builder.js.map +0 -1
  427. package/dist/history/utils/validation.d.ts +0 -68
  428. package/dist/history/utils/validation.d.ts.map +0 -1
  429. package/dist/history/utils/validation.js +0 -213
  430. package/dist/history/utils/validation.js.map +0 -1
  431. package/dist/shared/index.d.ts +0 -5
  432. package/dist/shared/index.d.ts.map +0 -1
  433. package/dist/shared/index.js +0 -21
  434. package/dist/shared/index.js.map +0 -1
  435. package/dist/shared/utils/batch-write.d.ts +0 -74
  436. package/dist/shared/utils/batch-write.d.ts.map +0 -1
  437. package/dist/shared/utils/batch-write.js +0 -110
  438. package/dist/shared/utils/batch-write.js.map +0 -1
  439. package/dist/shared/utils/client-factory.d.ts +0 -25
  440. package/dist/shared/utils/client-factory.d.ts.map +0 -1
  441. package/dist/shared/utils/client-factory.js +0 -23
  442. package/dist/shared/utils/client-factory.js.map +0 -1
  443. package/dist/shared/utils/compressor.d.ts +0 -66
  444. package/dist/shared/utils/compressor.d.ts.map +0 -1
  445. package/dist/shared/utils/compressor.js +0 -133
  446. package/dist/shared/utils/compressor.js.map +0 -1
  447. package/dist/shared/utils/constants.d.ts +0 -13
  448. package/dist/shared/utils/constants.d.ts.map +0 -1
  449. package/dist/shared/utils/constants.js +0 -35
  450. package/dist/shared/utils/constants.js.map +0 -1
  451. package/dist/shared/utils/index.d.ts +0 -14
  452. package/dist/shared/utils/index.d.ts.map +0 -1
  453. package/dist/shared/utils/index.js +0 -30
  454. package/dist/shared/utils/index.js.map +0 -1
  455. package/dist/shared/utils/logger.d.ts +0 -75
  456. package/dist/shared/utils/logger.d.ts.map +0 -1
  457. package/dist/shared/utils/logger.js +0 -148
  458. package/dist/shared/utils/logger.js.map +0 -1
  459. package/dist/shared/utils/retry.d.ts +0 -26
  460. package/dist/shared/utils/retry.d.ts.map +0 -1
  461. package/dist/shared/utils/retry.js +0 -169
  462. package/dist/shared/utils/retry.js.map +0 -1
  463. package/dist/shared/utils/s3-offloader.d.ts +0 -153
  464. package/dist/shared/utils/s3-offloader.d.ts.map +0 -1
  465. package/dist/shared/utils/s3-offloader.js +0 -281
  466. package/dist/shared/utils/s3-offloader.js.map +0 -1
  467. package/dist/shared/utils/s3-orphans.d.ts +0 -16
  468. package/dist/shared/utils/s3-orphans.d.ts.map +0 -1
  469. package/dist/shared/utils/s3-orphans.js +0 -79
  470. package/dist/shared/utils/s3-orphans.js.map +0 -1
  471. package/dist/shared/utils/sleep.d.ts +0 -48
  472. package/dist/shared/utils/sleep.d.ts.map +0 -1
  473. package/dist/shared/utils/sleep.js +0 -82
  474. package/dist/shared/utils/sleep.js.map +0 -1
  475. package/dist/shared/utils/ttl.d.ts +0 -24
  476. package/dist/shared/utils/ttl.d.ts.map +0 -1
  477. package/dist/shared/utils/ttl.js +0 -43
  478. package/dist/shared/utils/ttl.js.map +0 -1
  479. package/dist/store/actions/get-operation.d.ts +0 -11
  480. package/dist/store/actions/get-operation.d.ts.map +0 -1
  481. package/dist/store/actions/get-operation.js +0 -42
  482. package/dist/store/actions/get-operation.js.map +0 -1
  483. package/dist/store/actions/index.d.ts +0 -5
  484. package/dist/store/actions/index.d.ts.map +0 -1
  485. package/dist/store/actions/index.js +0 -21
  486. package/dist/store/actions/index.js.map +0 -1
  487. package/dist/store/actions/list-namespaces-operation.d.ts +0 -10
  488. package/dist/store/actions/list-namespaces-operation.d.ts.map +0 -1
  489. package/dist/store/actions/list-namespaces-operation.js +0 -227
  490. package/dist/store/actions/list-namespaces-operation.js.map +0 -1
  491. package/dist/store/actions/put-operation.d.ts +0 -9
  492. package/dist/store/actions/put-operation.d.ts.map +0 -1
  493. package/dist/store/actions/put-operation.js +0 -107
  494. package/dist/store/actions/put-operation.js.map +0 -1
  495. package/dist/store/actions/search-operation.d.ts +0 -17
  496. package/dist/store/actions/search-operation.d.ts.map +0 -1
  497. package/dist/store/actions/search-operation.js +0 -203
  498. package/dist/store/actions/search-operation.js.map +0 -1
  499. package/dist/store/index.d.ts +0 -82
  500. package/dist/store/index.d.ts.map +0 -1
  501. package/dist/store/index.js +0 -172
  502. package/dist/store/index.js.map +0 -1
  503. package/dist/store/types/index.d.ts +0 -131
  504. package/dist/store/types/index.d.ts.map +0 -1
  505. package/dist/store/types/index.js.map +0 -1
  506. package/dist/store/utils/filter.d.ts +0 -16
  507. package/dist/store/utils/filter.d.ts.map +0 -1
  508. package/dist/store/utils/filter.js +0 -133
  509. package/dist/store/utils/filter.js.map +0 -1
  510. package/dist/store/utils/index.d.ts +0 -7
  511. package/dist/store/utils/index.d.ts.map +0 -1
  512. package/dist/store/utils/index.js +0 -27
  513. package/dist/store/utils/index.js.map +0 -1
  514. package/dist/store/utils/validation.d.ts +0 -61
  515. package/dist/store/utils/validation.d.ts.map +0 -1
  516. package/dist/store/utils/validation.js +0 -260
  517. package/dist/store/utils/validation.js.map +0 -1
@@ -1,235 +0,0 @@
1
- "use strict";
2
- /**
3
- * Validation utilities for checkpointer operations
4
- */
5
- Object.defineProperty(exports, "__esModule", { value: true });
6
- exports.CheckpointerValidationConstants = exports.CheckpointerValidationError = void 0;
7
- exports.validateThreadId = validateThreadId;
8
- exports.validateCheckpointId = validateCheckpointId;
9
- exports.validateCheckpointNs = validateCheckpointNs;
10
- exports.validateTaskId = validateTaskId;
11
- exports.validateChannel = validateChannel;
12
- exports.validateWritesCount = validateWritesCount;
13
- exports.validateListLimit = validateListLimit;
14
- exports.validateTTLDays = validateTTLDays;
15
- const utils_1 = require("../../shared/utils");
16
- const MAX_THREAD_ID_LENGTH = 256;
17
- const MAX_CHECKPOINT_ID_LENGTH = 256;
18
- const MAX_CHECKPOINT_NS_LENGTH = 256;
19
- const MAX_TASK_ID_LENGTH = 256;
20
- const MAX_CHANNEL_LENGTH = 256;
21
- const MAX_WRITES_PER_BATCH = 1000;
22
- const MAX_LIST_LIMIT = 1000;
23
- // `BaseCheckpointSaver.deleteThread` must actually delete the thread; a tight cap
24
- // makes older / larger threads un-deletable. The ceiling is only a memory guard
25
- // against runaway pagination — the batch-write machinery handles the volume.
26
- const MAX_DELETE_BATCH_SIZE = 100_000;
27
- const SEPARATOR = ':::';
28
- // Must match `PAYLOAD_SK_PREFIX` in types/index.ts. Duplicated here (rather than
29
- // imported) to keep this file free of circular dependencies between utils and
30
- // types/actions.
31
- const PAYLOAD_PREFIX_BOUND = 'PAYLOAD#';
32
- class CheckpointerValidationError extends Error {
33
- constructor(message) {
34
- super(message);
35
- this.name = 'CheckpointerValidationError';
36
- }
37
- }
38
- exports.CheckpointerValidationError = CheckpointerValidationError;
39
- /**
40
- * Validate thread ID
41
- */
42
- function validateThreadId(threadId) {
43
- if (typeof threadId !== 'string') {
44
- throw new CheckpointerValidationError('thread_id must be a string');
45
- }
46
- if (threadId.length === 0) {
47
- throw new CheckpointerValidationError('thread_id cannot be empty');
48
- }
49
- if (threadId.length > MAX_THREAD_ID_LENGTH) {
50
- throw new CheckpointerValidationError(`thread_id exceeds maximum length of ${MAX_THREAD_ID_LENGTH} characters`);
51
- }
52
- // Prevent separator injection
53
- if (threadId.includes(SEPARATOR)) {
54
- throw new CheckpointerValidationError(`thread_id cannot contain separator "${SEPARATOR}"`);
55
- }
56
- // Prevent control characters and null bytes
57
- // eslint-disable-next-line no-control-regex
58
- if (/[\x00-\x1F\x7F]/.test(threadId)) {
59
- throw new CheckpointerValidationError('thread_id cannot contain control characters');
60
- }
61
- }
62
- /**
63
- * Validate checkpoint ID
64
- */
65
- function validateCheckpointId(checkpointId, required = false) {
66
- if (checkpointId === undefined) {
67
- if (required) {
68
- throw new CheckpointerValidationError('checkpoint_id is required');
69
- }
70
- return;
71
- }
72
- if (typeof checkpointId !== 'string') {
73
- throw new CheckpointerValidationError('checkpoint_id must be a string');
74
- }
75
- if (checkpointId.length === 0) {
76
- throw new CheckpointerValidationError('checkpoint_id cannot be empty');
77
- }
78
- if (checkpointId.length > MAX_CHECKPOINT_ID_LENGTH) {
79
- throw new CheckpointerValidationError(`checkpoint_id exceeds maximum length of ${MAX_CHECKPOINT_ID_LENGTH} characters`);
80
- }
81
- // Prevent separator injection
82
- if (checkpointId.includes(SEPARATOR)) {
83
- throw new CheckpointerValidationError(`checkpoint_id cannot contain separator "${SEPARATOR}"`);
84
- }
85
- // Prevent control characters
86
- // eslint-disable-next-line no-control-regex
87
- if (/[\x00-\x1F\x7F]/.test(checkpointId)) {
88
- throw new CheckpointerValidationError('checkpoint_id cannot contain control characters');
89
- }
90
- // Reserved prefix collision — `PAYLOAD#` is used internally as a sort-key
91
- // prefix on payload items. A user-supplied ID starting with this exact prefix
92
- // would be mis-classified by `list()` / `getTuple()`.
93
- if (checkpointId.startsWith(PAYLOAD_PREFIX_BOUND)) {
94
- throw new CheckpointerValidationError(`checkpoint_id cannot begin with "${PAYLOAD_PREFIX_BOUND}" (internal SK reserved prefix)`);
95
- }
96
- // NOTE ON LEXICAL ORDERING
97
- //
98
- // `list()` and the "latest" branch of `getTuple()` use the KeyCondition
99
- // checkpoint_id < 'PAYLOAD#'
100
- // to bound the query to metadata items only (fast path). This relies on the
101
- // checkpoint_id sorting lexically below the ASCII string 'PAYLOAD#'.
102
- //
103
- // - LangGraph's own `uuid6` IDs always start with '1' (0x31) < 'P' (0x50), so
104
- // library-generated IDs are safe.
105
- // - User-supplied IDs whose first character sorts >= 'P' (uppercase 'P'-'Z',
106
- // all lowercase letters, `{`, `|`, `}`, `~`) would be silently excluded
107
- // from list/latest queries.
108
- //
109
- // We do NOT throw here because that would break common naming schemes like
110
- // `checkpoint-1` or `step-2` in user code and existing test fixtures. The
111
- // FilterExpression in those query paths is a defensive backstop that prevents
112
- // payload-as-metadata corruption; the worst case for a non-compliant ID is
113
- // "not visible via list()", not data corruption.
114
- //
115
- // Downstream: README documents this constraint; users needing arbitrary IDs
116
- // should stick to leading characters < 'P'.
117
- }
118
- /**
119
- * Validate checkpoint namespace
120
- */
121
- function validateCheckpointNs(checkpointNs) {
122
- if (checkpointNs === undefined || checkpointNs === '') {
123
- return; // Empty namespace is allowed
124
- }
125
- if (typeof checkpointNs !== 'string') {
126
- throw new CheckpointerValidationError('checkpoint_ns must be a string');
127
- }
128
- if (checkpointNs.length > MAX_CHECKPOINT_NS_LENGTH) {
129
- throw new CheckpointerValidationError(`checkpoint_ns exceeds maximum length of ${MAX_CHECKPOINT_NS_LENGTH} characters`);
130
- }
131
- // Prevent separator injection
132
- if (checkpointNs.includes(SEPARATOR)) {
133
- throw new CheckpointerValidationError(`checkpoint_ns cannot contain separator "${SEPARATOR}"`);
134
- }
135
- // Prevent control characters
136
- // eslint-disable-next-line no-control-regex
137
- if (/[\x00-\x1F\x7F]/.test(checkpointNs)) {
138
- throw new CheckpointerValidationError('checkpoint_ns cannot contain control characters');
139
- }
140
- }
141
- /**
142
- * Validate task ID
143
- */
144
- function validateTaskId(taskId) {
145
- if (typeof taskId !== 'string') {
146
- throw new CheckpointerValidationError('task_id must be a string');
147
- }
148
- if (taskId.length === 0) {
149
- throw new CheckpointerValidationError('task_id cannot be empty');
150
- }
151
- if (taskId.length > MAX_TASK_ID_LENGTH) {
152
- throw new CheckpointerValidationError(`task_id exceeds maximum length of ${MAX_TASK_ID_LENGTH} characters`);
153
- }
154
- // Prevent separator injection
155
- if (taskId.includes(SEPARATOR)) {
156
- throw new CheckpointerValidationError(`task_id cannot contain separator "${SEPARATOR}"`);
157
- }
158
- // Prevent control characters and null bytes — consistency with thread/checkpoint validation.
159
- // eslint-disable-next-line no-control-regex
160
- if (/[\x00-\x1F\x7F]/.test(taskId)) {
161
- throw new CheckpointerValidationError('task_id cannot contain control characters');
162
- }
163
- }
164
- /**
165
- * Validate channel name
166
- */
167
- function validateChannel(channel) {
168
- if (typeof channel !== 'string') {
169
- throw new CheckpointerValidationError('channel must be a string');
170
- }
171
- if (channel.length === 0) {
172
- throw new CheckpointerValidationError('channel cannot be empty');
173
- }
174
- if (channel.length > MAX_CHANNEL_LENGTH) {
175
- throw new CheckpointerValidationError(`channel exceeds maximum length of ${MAX_CHANNEL_LENGTH} characters`);
176
- }
177
- // Defense in depth: channel isn't used in composite keys today, but block the
178
- // separator anyway so future refactors can rely on the invariant.
179
- if (channel.includes(SEPARATOR)) {
180
- throw new CheckpointerValidationError(`channel cannot contain separator "${SEPARATOR}"`);
181
- }
182
- }
183
- /**
184
- * Validate writes array length
185
- */
186
- function validateWritesCount(writesCount) {
187
- if (typeof writesCount !== 'number' || !Number.isInteger(writesCount)) {
188
- throw new CheckpointerValidationError('Writes count must be an integer');
189
- }
190
- if (writesCount < 0) {
191
- throw new CheckpointerValidationError('Writes count cannot be negative');
192
- }
193
- if (writesCount > MAX_WRITES_PER_BATCH) {
194
- throw new CheckpointerValidationError(`Writes count (${writesCount}) exceeds maximum of ${MAX_WRITES_PER_BATCH}`);
195
- }
196
- }
197
- /**
198
- * Validate list limit parameter
199
- */
200
- function validateListLimit(limit) {
201
- if (limit === undefined) {
202
- return;
203
- }
204
- if (typeof limit !== 'number' || !Number.isInteger(limit)) {
205
- throw new CheckpointerValidationError('Limit must be an integer');
206
- }
207
- if (limit <= 0) {
208
- throw new CheckpointerValidationError('Limit must be positive');
209
- }
210
- if (limit > MAX_LIST_LIMIT) {
211
- throw new CheckpointerValidationError(`Limit cannot exceed ${MAX_LIST_LIMIT}`);
212
- }
213
- }
214
- /**
215
- * Validate TTL days (wraps shared validation with a checkpointer-specific error type)
216
- */
217
- function validateTTLDays(ttlDays) {
218
- try {
219
- (0, utils_1.validateTTLDays)(ttlDays);
220
- }
221
- catch (error) {
222
- // eslint-disable-next-line no-instanceof/no-instanceof
223
- throw new CheckpointerValidationError(error instanceof Error ? error.message : String(error));
224
- }
225
- }
226
- /**
227
- * Export constants for use in other modules
228
- */
229
- exports.CheckpointerValidationConstants = {
230
- MAX_DELETE_BATCH_SIZE,
231
- MAX_WRITES_PER_BATCH,
232
- MAX_LIST_LIMIT,
233
- SEPARATOR,
234
- };
235
- //# sourceMappingURL=validation.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"validation.js","sourceRoot":"","sources":["../../../src/checkpointer/utils/validation.ts"],"names":[],"mappings":";AAAA;;GAEG;;;AA+BH,4CAyBC;AAKD,oDA+DC;AAKD,oDAyBC;AAKD,wCAyBC;AAKD,0CAoBC;AAKD,kDAcC;AAKD,8CAgBC;AAKD,0CAOC;AAnQD,8CAA0E;AAE1E,MAAM,oBAAoB,GAAG,GAAG,CAAC;AACjC,MAAM,wBAAwB,GAAG,GAAG,CAAC;AACrC,MAAM,wBAAwB,GAAG,GAAG,CAAC;AACrC,MAAM,kBAAkB,GAAG,GAAG,CAAC;AAC/B,MAAM,kBAAkB,GAAG,GAAG,CAAC;AAC/B,MAAM,oBAAoB,GAAG,IAAI,CAAC;AAClC,MAAM,cAAc,GAAG,IAAI,CAAC;AAC5B,kFAAkF;AAClF,gFAAgF;AAChF,6EAA6E;AAC7E,MA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BAAoB,EAAE,CAC3E,CAAC;IACJ,CAAC;AACH,CAAC;AAED;;GAEG;AACH,SAAgB,iBAAiB,CAAC,KAAc;IAC9C,IAAI,KAAK,KAAK,SAAS,EAAE,CAAC;QACxB,OAAO;IACT,CAAC;IAED,IAAI,OAAO,KAAK,KAAK,QAAQ,IAAI,CAAC,MAAM,CAAC,SAAS,CAAC,KAAK,CAAC,EAAE,CAAC;QAC1D,MAAM,IAAI,2BAA2B,CAAC,0BAA0B,CAAC,CAAC;IACpE,CAAC;IAED,IAAI,KAAK,IAAI,CAAC,EAAE,CAAC;QACf,MAAM,IAAI,2BAA2B,CAAC,wBAAwB,CAAC,CAAC;IAClE,CAAC;IAED,IAAI,KAAK,GAAG,cAAc,EAAE,CAAC;QAC3B,MAAM,IAAI,2BAA2B,CAAC,uBAAuB,cAAc,EAAE,CAAC,CAAC;IACjF,CAAC;AACH,CAAC;AAED;;GAEG;AACH,SAAgB,eAAe,CAAC,OAA2B;IACzD,IAAI,CAAC;QACH,IAAA,uBAAiB,EAAC,OAAO,CAAC,CAAC;IAC7B,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QACf,uDAAuD;QACvD,MAAM,IAAI,2BAA2B,CAAC,KAAK,YAAY,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC,CAAC;IAChG,CAAC;AACH,CAAC;AAED;;GAEG;AACU,QAAA,+BAA+B,GAAG;IAC7C,qBAAqB;IACrB,oBAAoB;IACpB,cAAc;IACd,SAAS;CACD,CAAC"}
package/dist/factory.d.ts DELETED
@@ -1,153 +0,0 @@
1
- /**
2
- * Factory for creating DynamoDB persistence instances with sensible defaults
3
- * Provides convenient methods for instantiating checkpointer, store, and chat history
4
- */
5
- import { type DynamoDBClientConfig } from '@aws-sdk/client-dynamodb';
6
- import type { EmbeddingsInterface } from '@langchain/core/embeddings';
7
- import type { SerializerProtocol } from '@langchain/langgraph-checkpoint';
8
- import { DynamoDBSaver } from './checkpointer';
9
- import type { DynamoDBSaverOptions } from './checkpointer/types';
10
- import { DynamoDBChatMessageHistory } from './history';
11
- import type { DynamoDBChatMessageHistoryOptions } from './history/types';
12
- import type { CompressionConfig, S3OffloadConfig } from './shared';
13
- import { DynamoDBStore } from './store';
14
- import type { DynamoDBStoreOptions } from './store/types';
15
- /**
16
- * Factory class for creating DynamoDB persistence instances
17
- */
18
- export declare class DynamoDBFactory {
19
- /**
20
- * Create a DynamoDBSaver instance with sensible defaults
21
- *
22
- * @param options - Partial configuration options
23
- * @param options.checkpointsTableName - Optional checkpoints table name (default: 'langgraph-checkpoints')
24
- * @param options.writesTableName - Optional writes table name (default: 'langgraph-writes')
25
- * @param options.ttlDays - Optional TTL in days for automatic cleanup
26
- * @param options.serde - Optional custom serializer protocol
27
- * @param options.clientConfig - Optional DynamoDB client configuration
28
- * @returns Configured DynamoDBSaver instance
29
- *
30
- * @example
31
- * ```TypeScript
32
- * // Minimal configuration (uses defaults)
33
- * const checkpointer = DynamoDBFactory.createSaver({
34
- * clientConfig: { region: 'us-east-1' }
35
- * });
36
- *
37
- * // Custom table names and TTL
38
- * const checkpointer = DynamoDBFactory.createSaver({
39
- * checkpointsTableName: 'my-checkpoints',
40
- * writesTableName: 'my-writes',
41
- * ttlDays: 30,
42
- * });
43
- * ```
44
- */
45
- static createSaver(options?: Partial<DynamoDBSaverOptions>): DynamoDBSaver;
46
- /**
47
- * Create a DynamoDBStore instance with sensible defaults
48
- *
49
- * @param options - Partial configuration options
50
- * @param options.memoryTableName - Optional memory table name (default: 'langgraph-memory')
51
- * @param options.embedding - Optional Bedrock embeddings for semantic search
52
- * @param options.ttlDays - Optional TTL in days for automatic cleanup
53
- * @param options.clientConfig - Optional DynamoDB client configuration
54
- * @returns Configured DynamoDBStore instance
55
- *
56
- * @example
57
- * ```TypeScript
58
- * // Without a semantic search
59
- * const store = DynamoDBFactory.createStore({
60
- * clientConfig: { region: 'us-east-1' }
61
- * });
62
- *
63
- * // With semantic search
64
- * import { BedrockEmbeddings } from '@langchain/aws';
65
- *
66
- * const store = DynamoDBFactory.createStore({
67
- * embedding: new BedrockEmbeddings({
68
- * model: 'amazon.titan-embed-text-v1',
69
- * }),
70
- * ttlDays: 90,
71
- * });
72
- * ```
73
- */
74
- static createStore(options?: Partial<DynamoDBStoreOptions>): DynamoDBStore;
75
- /**
76
- * Create a DynamoDBChatMessageHistory instance with sensible defaults
77
- *
78
- * @param options - Partial configuration options
79
- * @param options.tableName - Optional chat history table name (default: 'langgraph-chat-history')
80
- * @param options.ttlDays - Optional TTL in days for automatic cleanup
81
- * @param options.clientConfig - Optional DynamoDB client configuration
82
- * @returns Configured DynamoDBChatMessageHistory instance
83
- *
84
- * @example
85
- * ```TypeScript
86
- * // Minimal configuration (uses defaults)
87
- * const history = DynamoDBFactory.createChatMessageHistory({
88
- * clientConfig: { region: 'us-east-1' }
89
- * });
90
- *
91
- * // Custom table name and TTL
92
- * const history = DynamoDBFactory.createChatMessageHistory({
93
- * tableName: 'my-chat-history',
94
- * ttlDays: 365,
95
- * });
96
- * ```
97
- */
98
- static createChatMessageHistory(options?: Partial<DynamoDBChatMessageHistoryOptions>): DynamoDBChatMessageHistory;
99
- /**
100
- * Create all DynamoDB persistence instances at once with a shared configuration
101
- *
102
- * @param options - Configuration options
103
- * @param options.tablePrefix - Optional prefix for all table names (default: 'langgraph')
104
- * @param options.ttlDays - Optional TTL in days for automatic cleanup (applies to all)
105
- * @param options.clientConfig - Optional DynamoDB client configuration (shared)
106
- * @param options.embedding - Optional Bedrock embeddings for semantic search in store
107
- * @param options.serde - Optional custom serializer protocol for checkpointer
108
- * @returns Object containing all three persistence instances
109
- *
110
- * @example
111
- * ```TypeScript
112
- * // Create all instances with shared configuration
113
- * const { checkpointer, store, chatHistory } = DynamoDBFactory.createAll({
114
- * tablePrefix: 'my-app',
115
- * ttlDays: 30,
116
- * clientConfig: { region: 'us-east-1' },
117
- * });
118
- *
119
- * // Use with LangGraph
120
- * const app = workflow.compile({
121
- * checkpointer,
122
- * store,
123
- * });
124
- * ```
125
- */
126
- static createAll(options?: {
127
- tablePrefix?: string;
128
- ttlDays?: number;
129
- /** TTL in seconds for the saver (overrides ttlDays if both set). */
130
- ttlSeconds?: number;
131
- clientConfig?: DynamoDBClientConfig;
132
- embedding?: EmbeddingsInterface;
133
- serde?: SerializerProtocol;
134
- /** Compression configuration forwarded to the saver. */
135
- compression?: CompressionConfig;
136
- /** S3 offloading configuration forwarded to the saver. */
137
- s3OffloadConfig?: S3OffloadConfig;
138
- /**
139
- * Forwarded to the store — if true, semantic-search calls that hit an
140
- * embedding failure log a warning and return unranked results instead of
141
- * throwing. Defaults to false (fail-closed). See
142
- * {@link DynamoDBStoreOptions.fallbackToLexicalOnEmbeddingFailure}.
143
- */
144
- fallbackToLexicalOnEmbeddingFailure?: boolean;
145
- }): {
146
- checkpointer: DynamoDBSaver;
147
- store: DynamoDBStore;
148
- chatHistory: DynamoDBChatMessageHistory;
149
- /** Destroy the shared DynamoDB client created by createAll(). Call when no longer needed. */
150
- destroy: () => void;
151
- };
152
- }
153
- //# sourceMappingURL=factory.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"factory.d.ts","sourceRoot":"","sources":["../src/factory.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAkB,KAAK,oBAAoB,EAAE,MAAM,0BAA0B,CAAC;AAErF,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,4BAA4B,CAAC;AACtE,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,iCAAiC,CAAC;AAE1E,OAAO,EAAE,aAAa,EAAE,MAAM,gBAAgB,CAAC;AAC/C,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,sBAAsB,CAAC;AACjE,OAAO,EAAE,0BAA0B,EAAE,MAAM,WAAW,CAAC;AACvD,OAAO,KAAK,EAAE,iCAAiC,EAAE,MAAM,iBAAiB,CAAC;AACzE,OAAO,KAAK,EAA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-1,206 +0,0 @@
1
- "use strict";
2
- /**
3
- * Factory for creating DynamoDB persistence instances with sensible defaults
4
- * Provides convenient methods for instantiating checkpointer, store, and chat history
5
- */
6
- Object.defineProperty(exports, "__esModule", { value: true });
7
- exports.DynamoDBFactory = void 0;
8
- const client_dynamodb_1 = require("@aws-sdk/client-dynamodb");
9
- const lib_dynamodb_1 = require("@aws-sdk/lib-dynamodb");
10
- const checkpointer_1 = require("./checkpointer");
11
- const history_1 = require("./history");
12
- const store_1 = require("./store");
13
- /**
14
- * Default table names with standard prefix
15
- */
16
- const DEFAULT_TABLE_PREFIX = 'langgraph';
17
- /**
18
- * Factory class for creating DynamoDB persistence instances
19
- */
20
- class DynamoDBFactory {
21
- /**
22
- * Create a DynamoDBSaver instance with sensible defaults
23
- *
24
- * @param options - Partial configuration options
25
- * @param options.checkpointsTableName - Optional checkpoints table name (default: 'langgraph-checkpoints')
26
- * @param options.writesTableName - Optional writes table name (default: 'langgraph-writes')
27
- * @param options.ttlDays - Optional TTL in days for automatic cleanup
28
- * @param options.serde - Optional custom serializer protocol
29
- * @param options.clientConfig - Optional DynamoDB client configuration
30
- * @returns Configured DynamoDBSaver instance
31
- *
32
- * @example
33
- * ```TypeScript
34
- * // Minimal configuration (uses defaults)
35
- * const checkpointer = DynamoDBFactory.createSaver({
36
- * clientConfig: { region: 'us-east-1' }
37
- * });
38
- *
39
- * // Custom table names and TTL
40
- * const checkpointer = DynamoDBFactory.createSaver({
41
- * checkpointsTableName: 'my-checkpoints',
42
- * writesTableName: 'my-writes',
43
- * ttlDays: 30,
44
- * });
45
- * ```
46
- */
47
- static createSaver(options = {}) {
48
- const config = {
49
- checkpointsTableName: options.checkpointsTableName ?? `${DEFAULT_TABLE_PREFIX}-checkpoints`,
50
- writesTableName: options.writesTableName ?? `${DEFAULT_TABLE_PREFIX}-writes`,
51
- ttlDays: options.ttlDays,
52
- ttlSeconds: options.ttlSeconds,
53
- compression: options.compression,
54
- s3OffloadConfig: options.s3OffloadConfig,
55
- serde: options.serde,
56
- clientConfig: options.clientConfig,
57
- client: options.client,
58
- };
59
- return new checkpointer_1.DynamoDBSaver(config);
60
- }
61
- /**
62
- * Create a DynamoDBStore instance with sensible defaults
63
- *
64
- * @param options - Partial configuration options
65
- * @param options.memoryTableName - Optional memory table name (default: 'langgraph-memory')
66
- * @param options.embedding - Optional Bedrock embeddings for semantic search
67
- * @param options.ttlDays - Optional TTL in days for automatic cleanup
68
- * @param options.clientConfig - Optional DynamoDB client configuration
69
- * @returns Configured DynamoDBStore instance
70
- *
71
- * @example
72
- * ```TypeScript
73
- * // Without a semantic search
74
- * const store = DynamoDBFactory.createStore({
75
- * clientConfig: { region: 'us-east-1' }
76
- * });
77
- *
78
- * // With semantic search
79
- * import { BedrockEmbeddings } from '@langchain/aws';
80
- *
81
- * const store = DynamoDBFactory.createStore({
82
- * embedding: new BedrockEmbeddings({
83
- * model: 'amazon.titan-embed-text-v1',
84
- * }),
85
- * ttlDays: 90,
86
- * });
87
- * ```
88
- */
89
- static createStore(options = {}) {
90
- const config = {
91
- memoryTableName: options.memoryTableName ?? `${DEFAULT_TABLE_PREFIX}-memory`,
92
- embedding: options.embedding,
93
- ttlDays: options.ttlDays,
94
- clientConfig: options.clientConfig,
95
- client: options.client,
96
- fallbackToLexicalOnEmbeddingFailure: options.fallbackToLexicalOnEmbeddingFailure,
97
- };
98
- return new store_1.DynamoDBStore(config);
99
- }
100
- /**
101
- * Create a DynamoDBChatMessageHistory instance with sensible defaults
102
- *
103
- * @param options - Partial configuration options
104
- * @param options.tableName - Optional chat history table name (default: 'langgraph-chat-history')
105
- * @param options.ttlDays - Optional TTL in days for automatic cleanup
106
- * @param options.clientConfig - Optional DynamoDB client configuration
107
- * @returns Configured DynamoDBChatMessageHistory instance
108
- *
109
- * @example
110
- * ```TypeScript
111
- * // Minimal configuration (uses defaults)
112
- * const history = DynamoDBFactory.createChatMessageHistory({
113
- * clientConfig: { region: 'us-east-1' }
114
- * });
115
- *
116
- * // Custom table name and TTL
117
- * const history = DynamoDBFactory.createChatMessageHistory({
118
- * tableName: 'my-chat-history',
119
- * ttlDays: 365,
120
- * });
121
- * ```
122
- */
123
- static createChatMessageHistory(options = {}) {
124
- const config = {
125
- tableName: options.tableName ?? `${DEFAULT_TABLE_PREFIX}-chat-history`,
126
- ttlDays: options.ttlDays,
127
- clientConfig: options.clientConfig,
128
- client: options.client,
129
- };
130
- return new history_1.DynamoDBChatMessageHistory(config);
131
- }
132
- /**
133
- * Create all DynamoDB persistence instances at once with a shared configuration
134
- *
135
- * @param options - Configuration options
136
- * @param options.tablePrefix - Optional prefix for all table names (default: 'langgraph')
137
- * @param options.ttlDays - Optional TTL in days for automatic cleanup (applies to all)
138
- * @param options.clientConfig - Optional DynamoDB client configuration (shared)
139
- * @param options.embedding - Optional Bedrock embeddings for semantic search in store
140
- * @param options.serde - Optional custom serializer protocol for checkpointer
141
- * @returns Object containing all three persistence instances
142
- *
143
- * @example
144
- * ```TypeScript
145
- * // Create all instances with shared configuration
146
- * const { checkpointer, store, chatHistory } = DynamoDBFactory.createAll({
147
- * tablePrefix: 'my-app',
148
- * ttlDays: 30,
149
- * clientConfig: { region: 'us-east-1' },
150
- * });
151
- *
152
- * // Use with LangGraph
153
- * const app = workflow.compile({
154
- * checkpointer,
155
- * store,
156
- * });
157
- * ```
158
- */
159
- static createAll(options = {}) {
160
- const prefix = options.tablePrefix ?? DEFAULT_TABLE_PREFIX;
161
- // Create a single shared DynamoDB client for all modules
162
- const ddbClient = new client_dynamodb_1.DynamoDBClient(options.clientConfig || {});
163
- const sharedClient = lib_dynamodb_1.DynamoDBDocument.from(ddbClient);
164
- const checkpointer = this.createSaver({
165
- checkpointsTableName: `${prefix}-checkpoints`,
166
- writesTableName: `${prefix}-writes`,
167
- ttlDays: options.ttlDays,
168
- ttlSeconds: options.ttlSeconds,
169
- compression: options.compression,
170
- s3OffloadConfig: options.s3OffloadConfig,
171
- serde: options.serde,
172
- client: sharedClient,
173
- });
174
- const store = this.createStore({
175
- memoryTableName: `${prefix}-memory`,
176
- embedding: options.embedding,
177
- ttlDays: options.ttlDays,
178
- client: sharedClient,
179
- fallbackToLexicalOnEmbeddingFailure: options.fallbackToLexicalOnEmbeddingFailure,
180
- });
181
- const chatHistory = this.createChatMessageHistory({
182
- tableName: `${prefix}-chat-history`,
183
- ttlDays: options.ttlDays,
184
- client: sharedClient,
185
- });
186
- let destroyed = false;
187
- const destroy = () => {
188
- // Idempotency: SDK v3 tolerates double-destroy today, but the contract is
189
- // not part of the public v3 API — guard so a double-call (e.g. finally +
190
- // on-exit hook) can never error or re-enter the shutdown path.
191
- if (destroyed)
192
- return;
193
- destroyed = true;
194
- // Dispose module-local resources first (S3Offloader inside the saver) before
195
- // tearing down the shared DDB client. Each sub-instance skips DDB teardown
196
- // because it didn't own the shared client (ownsClient=false when injected).
197
- checkpointer.destroy();
198
- store.destroy();
199
- chatHistory.destroy();
200
- ddbClient.destroy();
201
- };
202
- return { checkpointer, store, chatHistory, destroy };
203
- }
204
- }
205
- exports.DynamoDBFactory = DynamoDBFactory;
206
- //# sourceMappingURL=factory.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"factory.js","sourceRoot":"","sources":["../src/factory.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAEH,8DAAqF;AACrF,wDAAyD;AAIzD,iDAA+C;AAE/C,uCAAuD;AAGvD,mCAAwC;AAGxC;;GAEG;AACH,MAAM,oBAAoB,GAAG,WAAW,CAAC;AAEzC;;GAEG;AACH,MAAa,eAAe;IAC1B;;;;;;;;;;;;;;;;;;;;;;;;;OAyBG;IACH,MAAM,CAAC,WAAW,CAAC,UAAyC,EAAE;QAC5D,MAAM,MAAM,GAAyB;YACnC,oBAAoB,EAAE,OAAO,CAAC,oBAAoB,IAAI,GAAG,oBAAoB,cAAc;YAC3F,eAAe,EAAE,OAAO,CAAC,eAAe,IAAI,GAAG,oBAAoB,SAAS;YAC5E,OAAO,EAAE,OAAO,CAAC,OAAO;YACxB,UAAU,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,CAAC;YACtB,SAAS,CAAC,OAAO,EAAE,CAAC;QACtB,CAAC,CAAC;QAEF,OAAO,EAAE,YAAY,EAAE,KAAK,EAAE,WAAW,EAAE,OAAO,EAAE,CAAC;IACvD,CAAC;CACF;AA9ND,0CA8NC"}
@@ -1,10 +0,0 @@
1
- /**
2
- * Add a single message to a session.
3
- *
4
- * Thin wrapper around {@link addMessagesAction} with a 1-element array. Single-
5
- * and multi-message writes share the exact same optimistic-concurrency path;
6
- * keeping one implementation avoids behavioural drift (and removes duplication).
7
- */
8
- import type { AddMessageActionParams } from '../types';
9
- export declare const addMessageAction: (params: AddMessageActionParams) => Promise<void>;
10
- //# sourceMappingURL=add-message.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"add-message.d.ts","sourceRoot":"","sources":["../../../src/history/actions/add-message.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,UAAU,CAAC;AAGvD,eAAO,MAAM,gBAAgB,GAAU,QAAQ,sBAAsB,KAAG,OAAO,CAAC,IAAI,CAUnF,CAAC"}
@@ -1,24 +0,0 @@
1
- "use strict";
2
- /**
3
- * Add a single message to a session.
4
- *
5
- * Thin wrapper around {@link addMessagesAction} with a 1-element array. Single-
6
- * and multi-message writes share the exact same optimistic-concurrency path;
7
- * keeping one implementation avoids behavioural drift (and removes duplication).
8
- */
9
- Object.defineProperty(exports, "__esModule", { value: true });
10
- exports.addMessageAction = void 0;
11
- const add_messages_1 = require("./add-messages");
12
- const addMessageAction = async (params) => {
13
- await (0, add_messages_1.addMessagesAction)({
14
- client: params.client,
15
- tableName: params.tableName,
16
- userId: params.userId,
17
- sessionId: params.sessionId,
18
- messages: [params.message],
19
- title: params.title,
20
- ttlDays: params.ttlDays,
21
- });
22
- };
23
- exports.addMessageAction = addMessageAction;
24
- //# sourceMappingURL=add-message.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"add-message.js","sourceRoot":"","sources":["../../../src/history/actions/add-message.ts"],"names":[],"mappings":";AAAA;;;;;;GAMG;;;AAGH,iDAAmD;AAE5C,MAAM,gBAAgB,GAAG,KAAK,EAAE,MAA8B,EAAiB,EAAE;IACtF,MAAM,IAAA,gCAAiB,EAAC;QACtB,MAAM,EAAE,MAAM,CAAC,MAAM;QACrB,SAAS,EAAE,MAAM,CAAC,SAAS;QAC3B,MAAM,EAAE,MAAM,CAAC,MAAM;QACrB,SAAS,EAAE,MAAM,CAAC,SAAS;QAC3B,QAAQ,EAAE,CAAC,MAAM,CAAC,OAAO,CAAC;QAC1B,KAAK,EAAE,MAAM,CAAC,KAAK;QACnB,OAAO,EAAE,MAAM,CAAC,OAAO;KACxB,CAAC,CAAC;AACL,CAAC,CAAC;AAVW,QAAA,gBAAgB,oBAU3B"}