@farukada/aws-langgraph-dynamodb-ts 1.0.0-rc.2 → 1.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +390 -193
- package/dist/{backfill → cjs/backfill}/backfill.d.ts +15 -12
- package/dist/cjs/backfill/backfill.js +177 -0
- package/dist/{checkpointer → cjs/checkpointer}/actions/delete-thread.d.ts +1 -1
- package/dist/cjs/checkpointer/actions/delete-thread.js +26 -0
- package/dist/{checkpointer → cjs/checkpointer}/actions/get-tuple.d.ts +4 -3
- package/dist/cjs/checkpointer/actions/get-tuple.js +22 -0
- package/dist/{checkpointer → cjs/checkpointer}/actions/list.d.ts +7 -4
- package/dist/cjs/checkpointer/actions/list.js +70 -0
- package/dist/{checkpointer → cjs/checkpointer}/actions/put-writes.d.ts +8 -6
- package/dist/cjs/checkpointer/actions/put-writes.js +21 -0
- package/dist/{checkpointer → cjs/checkpointer}/actions/put.d.ts +21 -15
- package/dist/cjs/checkpointer/actions/put.js +79 -0
- package/dist/{checkpointer → cjs/checkpointer}/internal/delta-history.d.ts +38 -26
- package/dist/cjs/checkpointer/internal/delta-history.js +131 -0
- package/dist/{checkpointer → cjs/checkpointer}/internal/listing.d.ts +4 -4
- package/dist/cjs/checkpointer/internal/listing.js +104 -0
- package/dist/{checkpointer → cjs/checkpointer}/internal/parse.d.ts +51 -15
- package/dist/cjs/checkpointer/internal/parse.js +184 -0
- package/dist/{checkpointer → cjs/checkpointer}/internal/pending-writes.d.ts +64 -25
- package/dist/cjs/checkpointer/internal/pending-writes.js +241 -0
- package/dist/{checkpointer → cjs/checkpointer}/internal/read.d.ts +15 -10
- package/dist/cjs/checkpointer/internal/read.js +132 -0
- package/dist/{checkpointer → cjs/checkpointer}/internal/rows.d.ts +94 -21
- package/dist/cjs/checkpointer/internal/rows.js +356 -0
- package/dist/{checkpointer → cjs/checkpointer}/internal/setup.d.ts +13 -20
- package/dist/cjs/checkpointer/internal/setup.js +25 -0
- package/dist/{checkpointer → cjs/checkpointer}/saver.d.ts +72 -36
- package/dist/cjs/checkpointer/saver.js +56 -0
- package/dist/{checkpointer → cjs/checkpointer}/types.d.ts +1 -1
- package/dist/cjs/checkpointer/types.js +2 -0
- package/dist/{factory → cjs/factory}/factory.d.ts +25 -20
- package/dist/cjs/factory/factory.js +137 -0
- package/dist/{factory → cjs/factory}/types.d.ts +12 -12
- package/dist/cjs/factory/types.js +2 -0
- package/dist/{history → cjs/history}/actions/add-messages.d.ts +18 -10
- package/dist/cjs/history/actions/add-messages.js +17 -0
- package/dist/{history → cjs/history}/actions/clear.d.ts +1 -1
- package/dist/cjs/history/actions/clear.js +29 -0
- package/dist/{history → cjs/history}/actions/get-messages.d.ts +11 -9
- package/dist/cjs/history/actions/get-messages.js +58 -0
- package/dist/{history → cjs/history}/actions/list-sessions.d.ts +3 -3
- package/dist/cjs/history/actions/list-sessions.js +67 -0
- package/dist/{history → cjs/history}/actions/reconcile-count.d.ts +13 -9
- package/dist/cjs/history/actions/reconcile-count.js +8 -0
- package/dist/{history → cjs/history}/chat-message-history.d.ts +62 -30
- package/dist/cjs/history/chat-message-history.js +61 -0
- package/dist/{history → cjs/history}/internal/append.d.ts +64 -32
- package/dist/cjs/history/internal/append.js +267 -0
- package/dist/{history → cjs/history}/internal/message-read.d.ts +3 -3
- package/dist/cjs/history/internal/message-read.js +93 -0
- package/dist/{history → cjs/history}/internal/parse.d.ts +2 -2
- package/dist/cjs/history/internal/parse.js +113 -0
- package/dist/{history → cjs/history}/internal/rows.d.ts +11 -10
- package/dist/cjs/history/internal/rows.js +96 -0
- package/dist/{history → cjs/history}/internal/session.d.ts +41 -22
- package/dist/cjs/history/internal/session.js +296 -0
- package/dist/{history → cjs/history}/internal/setup.d.ts +2 -2
- package/dist/cjs/history/internal/setup.js +60 -0
- package/dist/{history → cjs/history}/session-adapter.d.ts +0 -6
- package/dist/cjs/history/session-adapter.js +38 -0
- package/dist/{history → cjs/history}/types.d.ts +18 -15
- package/dist/cjs/history/types.js +2 -0
- package/dist/{index.d.ts → cjs/index.d.ts} +27 -27
- package/dist/cjs/index.js +25 -0
- package/dist/cjs/package.json +1 -0
- package/dist/{shared → cjs/shared}/adapter.d.ts +27 -16
- package/dist/cjs/shared/adapter.js +70 -0
- package/dist/cjs/shared/clock.js +14 -0
- package/dist/{shared → cjs/shared}/codec/codec.d.ts +37 -20
- package/dist/cjs/shared/codec/codec.js +162 -0
- package/dist/{shared → cjs/shared}/codec/compression.d.ts +9 -4
- package/dist/cjs/shared/codec/compression.js +45 -0
- package/dist/cjs/shared/codec/json-serde.js +58 -0
- package/dist/{shared → cjs/shared}/codec/s3/client-types.d.ts +2 -1
- package/dist/cjs/shared/codec/s3/client-types.js +6 -0
- package/dist/{shared → cjs/shared}/codec/s3/client.d.ts +25 -7
- package/dist/cjs/shared/codec/s3/client.js +78 -0
- package/dist/{shared → cjs/shared}/codec/s3/config.d.ts +12 -7
- package/dist/cjs/shared/codec/s3/config.js +92 -0
- package/dist/{shared → cjs/shared}/codec/s3/lifecycle.d.ts +71 -17
- package/dist/cjs/shared/codec/s3/lifecycle.js +223 -0
- package/dist/{shared → cjs/shared}/codec/s3/offloader.d.ts +42 -29
- package/dist/cjs/shared/codec/s3/offloader.js +289 -0
- package/dist/cjs/shared/concurrency.js +31 -0
- package/dist/{shared → cjs/shared}/dynamodb/abort.d.ts +2 -2
- package/dist/cjs/shared/dynamodb/abort.js +16 -0
- package/dist/{shared → cjs/shared}/dynamodb/batch-write.d.ts +2 -2
- package/dist/cjs/shared/dynamodb/batch-write.js +79 -0
- package/dist/cjs/shared/dynamodb/cancellation.js +37 -0
- package/dist/{shared → cjs/shared}/dynamodb/client.d.ts +24 -22
- package/dist/cjs/shared/dynamodb/client.js +40 -0
- package/dist/{shared → cjs/shared}/dynamodb/idempotent-write.d.ts +64 -19
- package/dist/cjs/shared/dynamodb/idempotent-write.js +173 -0
- package/dist/{shared → cjs/shared}/dynamodb/paginate.d.ts +2 -2
- package/dist/cjs/shared/dynamodb/paginate.js +90 -0
- package/dist/{shared → cjs/shared}/dynamodb/partition-delete.d.ts +6 -6
- package/dist/cjs/shared/dynamodb/partition-delete.js +177 -0
- package/dist/{shared → cjs/shared}/dynamodb/recency-index.d.ts +27 -15
- package/dist/cjs/shared/dynamodb/recency-index.js +146 -0
- package/dist/{shared → cjs/shared}/dynamodb/retry.d.ts +37 -6
- package/dist/cjs/shared/dynamodb/retry.js +193 -0
- package/dist/cjs/shared/dynamodb/row-size.d.ts +33 -0
- package/dist/cjs/shared/dynamodb/row-size.js +30 -0
- package/dist/{shared → cjs/shared}/dynamodb/table-schema.d.ts +27 -18
- package/dist/cjs/shared/dynamodb/table-schema.js +52 -0
- package/dist/{shared → cjs/shared}/errors/base-error.d.ts +42 -7
- package/dist/cjs/shared/errors/base-error.js +73 -0
- package/dist/{shared → cjs/shared}/errors/boundary.d.ts +29 -14
- package/dist/cjs/shared/errors/boundary.js +61 -0
- package/dist/cjs/shared/errors/classify.d.ts +206 -0
- package/dist/cjs/shared/errors/classify.js +232 -0
- package/dist/{shared → cjs/shared}/errors/error-code.d.ts +17 -10
- package/dist/cjs/shared/errors/error-code.js +27 -0
- package/dist/{shared → cjs/shared}/errors/errors.d.ts +75 -9
- package/dist/cjs/shared/errors/errors.js +123 -0
- package/dist/cjs/shared/logging/logger.js +30 -0
- package/dist/{shared → cjs/shared}/logging/redaction.d.ts +8 -4
- package/dist/cjs/shared/logging/redaction.js +145 -0
- package/dist/{shared → cjs/shared}/logging/secret-patterns.d.ts +30 -7
- package/dist/cjs/shared/logging/secret-patterns.js +93 -0
- package/dist/cjs/shared/logging/truncate.js +31 -0
- package/dist/{shared → cjs/shared}/options.d.ts +27 -11
- package/dist/cjs/shared/options.js +2 -0
- package/dist/cjs/shared/ulid.js +83 -0
- package/dist/{shared → cjs/shared}/validation/collaborators.d.ts +21 -2
- package/dist/cjs/shared/validation/collaborators.js +79 -0
- package/dist/{shared → cjs/shared}/validation/option-shape.d.ts +7 -5
- package/dist/cjs/shared/validation/option-shape.js +31 -0
- package/dist/{shared → cjs/shared}/validation/options.d.ts +4 -4
- package/dist/cjs/shared/validation/options.js +166 -0
- package/dist/cjs/shared/validation/primitives.js +114 -0
- package/dist/{shared → cjs/shared}/validation/ttl.d.ts +26 -9
- package/dist/cjs/shared/validation/ttl.js +52 -0
- package/dist/{store → cjs/store}/actions/list-namespaces.d.ts +5 -5
- package/dist/cjs/store/actions/list-namespaces.js +92 -0
- package/dist/{store → cjs/store}/actions/put.d.ts +11 -4
- package/dist/cjs/store/actions/put.js +49 -0
- package/dist/{store → cjs/store}/actions/reconcile-vector-index.d.ts +5 -5
- package/dist/cjs/store/actions/reconcile-vector-index.js +13 -0
- package/dist/{store → cjs/store}/actions/search.d.ts +2 -2
- package/dist/cjs/store/actions/search.js +26 -0
- package/dist/cjs/store/internal/batch-plan.d.ts +56 -0
- package/dist/cjs/store/internal/batch-plan.js +32 -0
- package/dist/{store → cjs/store}/internal/filter.d.ts +3 -3
- package/dist/cjs/store/internal/filter.js +64 -0
- package/dist/cjs/store/internal/get-item.d.ts +77 -0
- package/dist/cjs/store/internal/get-item.js +58 -0
- package/dist/{store → cjs/store}/internal/item-write.d.ts +72 -32
- package/dist/cjs/store/internal/item-write.js +181 -0
- package/dist/{store → cjs/store}/internal/parse.d.ts +15 -10
- package/dist/cjs/store/internal/parse.js +180 -0
- package/dist/{store → cjs/store}/internal/rows.d.ts +38 -34
- package/dist/cjs/store/internal/rows.js +166 -0
- package/dist/{store → cjs/store}/internal/semantic-search.d.ts +2 -2
- package/dist/cjs/store/internal/semantic-search.js +211 -0
- package/dist/{store → cjs/store}/internal/setup.d.ts +10 -15
- package/dist/cjs/store/internal/setup.js +103 -0
- package/dist/{store → cjs/store}/internal/table-search.d.ts +5 -5
- package/dist/cjs/store/internal/table-search.js +123 -0
- package/dist/{store → cjs/store}/internal/vector-index.d.ts +26 -15
- package/dist/cjs/store/internal/vector-index.js +269 -0
- package/dist/{store → cjs/store}/store.d.ts +82 -39
- package/dist/cjs/store/store.js +97 -0
- package/dist/{store → cjs/store}/types.d.ts +25 -10
- package/dist/cjs/store/types.js +2 -0
- package/dist/cjs/store/vector-backend.js +4 -0
- package/dist/esm/backfill/backfill.d.ts +171 -0
- package/dist/esm/backfill/backfill.js +170 -0
- package/dist/{checkpointer/actions/delete-thread.js → esm/checkpointer/actions/delete-thread.d.ts} +4 -26
- package/dist/esm/checkpointer/actions/delete-thread.js +23 -0
- package/dist/{checkpointer/actions/get-tuple.js → esm/checkpointer/actions/get-tuple.d.ts} +7 -24
- package/dist/esm/checkpointer/actions/get-tuple.js +19 -0
- package/dist/esm/checkpointer/actions/list.d.ts +55 -0
- package/dist/esm/checkpointer/actions/list.js +67 -0
- package/dist/{checkpointer/actions/put-writes.js → esm/checkpointer/actions/put-writes.d.ts} +10 -37
- package/dist/esm/checkpointer/actions/put-writes.js +18 -0
- package/dist/esm/checkpointer/actions/put.d.ts +95 -0
- package/dist/esm/checkpointer/actions/put.js +75 -0
- package/dist/esm/checkpointer/internal/delta-history.d.ts +124 -0
- package/dist/esm/checkpointer/internal/delta-history.js +126 -0
- package/dist/{checkpointer/internal/listing.js → esm/checkpointer/internal/listing.d.ts} +22 -118
- package/dist/esm/checkpointer/internal/listing.js +95 -0
- package/dist/esm/checkpointer/internal/parse.d.ts +298 -0
- package/dist/esm/checkpointer/internal/parse.js +169 -0
- package/dist/esm/checkpointer/internal/pending-writes.d.ts +314 -0
- package/dist/esm/checkpointer/internal/pending-writes.js +229 -0
- package/dist/esm/checkpointer/internal/read.d.ts +135 -0
- package/dist/esm/checkpointer/internal/read.js +125 -0
- package/dist/esm/checkpointer/internal/rows.d.ts +644 -0
- package/dist/esm/checkpointer/internal/rows.js +323 -0
- package/dist/esm/checkpointer/internal/setup.d.ts +47 -0
- package/dist/esm/checkpointer/internal/setup.js +21 -0
- package/dist/{checkpointer/saver.js → esm/checkpointer/saver.d.ts} +84 -87
- package/dist/esm/checkpointer/saver.js +52 -0
- package/dist/esm/checkpointer/types.d.ts +51 -0
- package/dist/esm/checkpointer/types.js +1 -0
- package/dist/esm/factory/factory.d.ts +154 -0
- package/dist/esm/factory/factory.js +133 -0
- package/dist/esm/factory/types.d.ts +76 -0
- package/dist/esm/factory/types.js +1 -0
- package/dist/{history/actions/add-messages.js → esm/history/actions/add-messages.d.ts} +20 -26
- package/dist/esm/history/actions/add-messages.js +14 -0
- package/dist/{history/actions/clear.js → esm/history/actions/clear.d.ts} +4 -35
- package/dist/esm/history/actions/clear.js +26 -0
- package/dist/esm/history/actions/get-messages.d.ts +60 -0
- package/dist/esm/history/actions/get-messages.js +55 -0
- package/dist/esm/history/actions/list-sessions.d.ts +55 -0
- package/dist/esm/history/actions/list-sessions.js +64 -0
- package/dist/{history/actions/reconcile-count.js → esm/history/actions/reconcile-count.d.ts} +14 -16
- package/dist/esm/history/actions/reconcile-count.js +5 -0
- package/dist/{history/chat-message-history.js → esm/history/chat-message-history.d.ts} +76 -87
- package/dist/esm/history/chat-message-history.js +57 -0
- package/dist/esm/history/internal/append.d.ts +244 -0
- package/dist/esm/history/internal/append.js +259 -0
- package/dist/esm/history/internal/message-read.d.ts +84 -0
- package/dist/esm/history/internal/message-read.js +89 -0
- package/dist/esm/history/internal/parse.d.ts +153 -0
- package/dist/esm/history/internal/parse.js +105 -0
- package/dist/{history/internal/rows.js → esm/history/internal/rows.d.ts} +58 -112
- package/dist/esm/history/internal/rows.js +83 -0
- package/dist/esm/history/internal/session.d.ts +350 -0
- package/dist/esm/history/internal/session.js +285 -0
- package/dist/esm/history/internal/setup.d.ts +64 -0
- package/dist/esm/history/internal/setup.js +56 -0
- package/dist/{history/session-adapter.js → esm/history/session-adapter.d.ts} +25 -39
- package/dist/esm/history/session-adapter.js +34 -0
- package/dist/esm/history/types.d.ts +102 -0
- package/dist/esm/history/types.js +1 -0
- package/dist/esm/index.d.ts +53 -0
- package/dist/esm/index.js +10 -0
- package/dist/esm/shared/adapter.d.ts +146 -0
- package/dist/esm/shared/adapter.js +65 -0
- package/dist/{shared/clock.js → esm/shared/clock.d.ts} +3 -14
- package/dist/esm/shared/clock.js +9 -0
- package/dist/esm/shared/codec/codec.d.ts +336 -0
- package/dist/esm/shared/codec/codec.js +150 -0
- package/dist/esm/shared/codec/compression.d.ts +66 -0
- package/dist/esm/shared/codec/compression.js +40 -0
- package/dist/esm/shared/codec/json-serde.d.ts +80 -0
- package/dist/esm/shared/codec/json-serde.js +54 -0
- package/dist/esm/shared/codec/s3/client-types.d.ts +54 -0
- package/dist/esm/shared/codec/s3/client-types.js +3 -0
- package/dist/esm/shared/codec/s3/client.d.ts +63 -0
- package/dist/esm/shared/codec/s3/client.js +40 -0
- package/dist/{shared/codec/s3/config.js → esm/shared/codec/s3/config.d.ts} +45 -93
- package/dist/esm/shared/codec/s3/config.js +79 -0
- package/dist/esm/shared/codec/s3/lifecycle.d.ts +220 -0
- package/dist/esm/shared/codec/s3/lifecycle.js +214 -0
- package/dist/esm/shared/codec/s3/offloader.d.ts +428 -0
- package/dist/esm/shared/codec/s3/offloader.js +278 -0
- package/dist/{shared/concurrency.js → esm/shared/concurrency.d.ts} +2 -37
- package/dist/esm/shared/concurrency.js +27 -0
- package/dist/{shared/dynamodb/abort.js → esm/shared/dynamodb/abort.d.ts} +4 -16
- package/dist/esm/shared/dynamodb/abort.js +12 -0
- package/dist/esm/shared/dynamodb/batch-write.d.ts +86 -0
- package/dist/esm/shared/dynamodb/batch-write.js +74 -0
- package/dist/{shared/dynamodb/cancellation.js → esm/shared/dynamodb/cancellation.d.ts} +25 -53
- package/dist/esm/shared/dynamodb/cancellation.js +30 -0
- package/dist/{shared/dynamodb/client.js → esm/shared/dynamodb/client.d.ts} +74 -64
- package/dist/esm/shared/dynamodb/client.js +35 -0
- package/dist/{shared/dynamodb/idempotent-write.js → esm/shared/dynamodb/idempotent-write.d.ts} +172 -169
- package/dist/esm/shared/dynamodb/idempotent-write.js +153 -0
- package/dist/esm/shared/dynamodb/paginate.d.ts +111 -0
- package/dist/esm/shared/dynamodb/paginate.js +84 -0
- package/dist/esm/shared/dynamodb/partition-delete.d.ts +204 -0
- package/dist/esm/shared/dynamodb/partition-delete.js +171 -0
- package/dist/esm/shared/dynamodb/recency-index.d.ts +243 -0
- package/dist/esm/shared/dynamodb/recency-index.js +136 -0
- package/dist/esm/shared/dynamodb/retry.d.ts +317 -0
- package/dist/esm/shared/dynamodb/retry.js +180 -0
- package/dist/esm/shared/dynamodb/row-size.d.ts +33 -0
- package/dist/esm/shared/dynamodb/row-size.js +26 -0
- package/dist/{shared/dynamodb/table-schema.js → esm/shared/dynamodb/table-schema.d.ts} +57 -67
- package/dist/esm/shared/dynamodb/table-schema.js +43 -0
- package/dist/esm/shared/errors/base-error.d.ts +231 -0
- package/dist/esm/shared/errors/base-error.js +64 -0
- package/dist/esm/shared/errors/boundary.d.ts +86 -0
- package/dist/esm/shared/errors/boundary.js +54 -0
- package/dist/esm/shared/errors/classify.d.ts +206 -0
- package/dist/esm/shared/errors/classify.js +220 -0
- package/dist/{shared/errors/error-code.js → esm/shared/errors/error-code.d.ts} +39 -43
- package/dist/esm/shared/errors/error-code.js +24 -0
- package/dist/{shared/errors/errors.js → esm/shared/errors/errors.d.ts} +92 -98
- package/dist/esm/shared/errors/errors.js +110 -0
- package/dist/{shared/logging/logger.js → esm/shared/logging/logger.d.ts} +22 -52
- package/dist/esm/shared/logging/logger.js +25 -0
- package/dist/esm/shared/logging/redaction.d.ts +123 -0
- package/dist/esm/shared/logging/redaction.js +140 -0
- package/dist/{shared/logging/secret-patterns.js → esm/shared/logging/secret-patterns.d.ts} +46 -87
- package/dist/esm/shared/logging/secret-patterns.js +83 -0
- package/dist/{shared/logging/truncate.js → esm/shared/logging/truncate.d.ts} +6 -40
- package/dist/esm/shared/logging/truncate.js +25 -0
- package/dist/esm/shared/options.d.ts +100 -0
- package/dist/esm/shared/options.js +1 -0
- package/dist/{shared/ulid.js → esm/shared/ulid.d.ts} +4 -84
- package/dist/esm/shared/ulid.js +77 -0
- package/dist/{shared/validation/collaborators.js → esm/shared/validation/collaborators.d.ts} +37 -65
- package/dist/esm/shared/validation/collaborators.js +70 -0
- package/dist/{shared/validation/option-shape.js → esm/shared/validation/option-shape.d.ts} +14 -36
- package/dist/esm/shared/validation/option-shape.js +24 -0
- package/dist/esm/shared/validation/options.d.ts +145 -0
- package/dist/esm/shared/validation/options.js +156 -0
- package/dist/{shared/validation/primitives.js → esm/shared/validation/primitives.d.ts} +30 -125
- package/dist/esm/shared/validation/primitives.js +100 -0
- package/dist/esm/shared/validation/ttl.d.ts +94 -0
- package/dist/esm/shared/validation/ttl.js +46 -0
- package/dist/esm/store/actions/list-namespaces.d.ts +79 -0
- package/dist/esm/store/actions/list-namespaces.js +86 -0
- package/dist/esm/store/actions/put.d.ts +43 -0
- package/dist/esm/store/actions/put.js +46 -0
- package/dist/{store/actions/reconcile-vector-index.js → esm/store/actions/reconcile-vector-index.d.ts} +8 -16
- package/dist/esm/store/actions/reconcile-vector-index.js +10 -0
- package/dist/esm/store/actions/search.d.ts +38 -0
- package/dist/esm/store/actions/search.js +23 -0
- package/dist/esm/store/internal/batch-plan.d.ts +56 -0
- package/dist/esm/store/internal/batch-plan.js +28 -0
- package/dist/esm/store/internal/filter.d.ts +43 -0
- package/dist/esm/store/internal/filter.js +60 -0
- package/dist/esm/store/internal/get-item.d.ts +77 -0
- package/dist/esm/store/internal/get-item.js +54 -0
- package/dist/esm/store/internal/item-write.d.ts +270 -0
- package/dist/esm/store/internal/item-write.js +173 -0
- package/dist/esm/store/internal/parse.d.ts +230 -0
- package/dist/esm/store/internal/parse.js +169 -0
- package/dist/{store/internal/rows.js → esm/store/internal/rows.d.ts} +111 -199
- package/dist/esm/store/internal/rows.js +147 -0
- package/dist/esm/store/internal/semantic-search.d.ts +168 -0
- package/dist/esm/store/internal/semantic-search.js +200 -0
- package/dist/esm/store/internal/setup.d.ts +96 -0
- package/dist/esm/store/internal/setup.js +98 -0
- package/dist/esm/store/internal/table-search.d.ts +100 -0
- package/dist/esm/store/internal/table-search.js +119 -0
- package/dist/esm/store/internal/vector-index.d.ts +258 -0
- package/dist/esm/store/internal/vector-index.js +256 -0
- package/dist/{store/store.js → esm/store/store.d.ts} +99 -133
- package/dist/esm/store/store.js +93 -0
- package/dist/esm/store/types.d.ts +111 -0
- package/dist/esm/store/types.js +1 -0
- package/dist/esm/store/vector-backend.d.ts +104 -0
- package/dist/esm/store/vector-backend.js +1 -0
- package/package.json +50 -44
- package/dist/backfill/backfill.js +0 -393
- package/dist/checkpointer/actions/list.js +0 -142
- package/dist/checkpointer/actions/put.js +0 -195
- package/dist/checkpointer/internal/delta-history.js +0 -252
- package/dist/checkpointer/internal/parse.js +0 -372
- package/dist/checkpointer/internal/pending-writes.js +0 -588
- package/dist/checkpointer/internal/read.js +0 -264
- package/dist/checkpointer/internal/rows.js +0 -834
- package/dist/checkpointer/internal/setup.js +0 -72
- package/dist/checkpointer/types.js +0 -12
- package/dist/factory/factory.js +0 -266
- package/dist/factory/types.js +0 -10
- package/dist/history/actions/get-messages.js +0 -141
- package/dist/history/actions/list-sessions.js +0 -156
- package/dist/history/internal/append.js +0 -500
- package/dist/history/internal/message-read.js +0 -204
- package/dist/history/internal/parse.js +0 -252
- package/dist/history/internal/session.js +0 -628
- package/dist/history/internal/setup.js +0 -106
- package/dist/history/types.js +0 -12
- package/dist/index.js +0 -51
- package/dist/shared/adapter.js +0 -143
- package/dist/shared/codec/codec.js +0 -441
- package/dist/shared/codec/compression.js +0 -89
- package/dist/shared/codec/json-serde.js +0 -191
- package/dist/shared/codec/s3/client-types.js +0 -26
- package/dist/shared/codec/s3/client.js +0 -97
- package/dist/shared/codec/s3/lifecycle.js +0 -355
- package/dist/shared/codec/s3/offloader.js +0 -658
- package/dist/shared/dynamodb/batch-write.js +0 -173
- package/dist/shared/dynamodb/paginate.js +0 -188
- package/dist/shared/dynamodb/partition-delete.js +0 -340
- package/dist/shared/dynamodb/recency-index.js +0 -377
- package/dist/shared/dynamodb/retry.js +0 -463
- package/dist/shared/errors/base-error.js +0 -174
- package/dist/shared/errors/boundary.js +0 -143
- package/dist/shared/errors/classify.d.ts +0 -97
- package/dist/shared/errors/classify.js +0 -257
- package/dist/shared/logging/redaction.js +0 -316
- package/dist/shared/options.js +0 -11
- package/dist/shared/validation/options.js +0 -328
- package/dist/shared/validation/ttl.js +0 -132
- package/dist/store/actions/list-namespaces.js +0 -197
- package/dist/store/actions/put.js +0 -78
- package/dist/store/actions/search.js +0 -66
- package/dist/store/internal/batch-plan.d.ts +0 -26
- package/dist/store/internal/batch-plan.js +0 -109
- package/dist/store/internal/filter.js +0 -137
- package/dist/store/internal/get-item.d.ts +0 -45
- package/dist/store/internal/get-item.js +0 -115
- package/dist/store/internal/item-write.js +0 -463
- package/dist/store/internal/parse.js +0 -350
- package/dist/store/internal/semantic-search.js +0 -389
- package/dist/store/internal/setup.js +0 -223
- package/dist/store/internal/table-search.js +0 -213
- package/dist/store/internal/vector-index.js +0 -546
- package/dist/store/types.js +0 -15
- package/dist/store/vector-backend.js +0 -17
- /package/dist/{shared → cjs/shared}/clock.d.ts +0 -0
- /package/dist/{shared → cjs/shared}/codec/json-serde.d.ts +0 -0
- /package/dist/{shared → cjs/shared}/concurrency.d.ts +0 -0
- /package/dist/{shared → cjs/shared}/dynamodb/cancellation.d.ts +0 -0
- /package/dist/{shared → cjs/shared}/logging/logger.d.ts +0 -0
- /package/dist/{shared → cjs/shared}/logging/truncate.d.ts +0 -0
- /package/dist/{shared → cjs/shared}/ulid.d.ts +0 -0
- /package/dist/{shared → cjs/shared}/validation/primitives.d.ts +0 -0
- /package/dist/{store → cjs/store}/vector-backend.d.ts +0 -0
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.LIST_SESSIONS_KEYS = exports.GET_MESSAGES_KEYS = exports.HISTORY_KEYS = exports.MESSAGE_APPEND_RETRY_MAX_ATTEMPTS = void 0;
|
|
4
|
+
exports.setUpHistory = setUpHistory;
|
|
5
|
+
const adapter_js_1 = require("../../shared/adapter.js");
|
|
6
|
+
const json_serde_js_1 = require("../../shared/codec/json-serde.js");
|
|
7
|
+
const errors_js_1 = require("../../shared/errors/errors.js");
|
|
8
|
+
const ulid_js_1 = require("../../shared/ulid.js");
|
|
9
|
+
const option_shape_js_1 = require("../../shared/validation/option-shape.js");
|
|
10
|
+
exports.MESSAGE_APPEND_RETRY_MAX_ATTEMPTS = 18;
|
|
11
|
+
exports.HISTORY_KEYS = (0, option_shape_js_1.allKeysOf)({
|
|
12
|
+
tableName: 'tableName',
|
|
13
|
+
client: 'client',
|
|
14
|
+
clientConfig: 'clientConfig',
|
|
15
|
+
createClient: 'createClient',
|
|
16
|
+
ttl: 'ttl',
|
|
17
|
+
logger: 'logger',
|
|
18
|
+
retry: 'retry',
|
|
19
|
+
indexShards: 'indexShards',
|
|
20
|
+
indexName: 'indexName',
|
|
21
|
+
readConcurrency: 'readConcurrency',
|
|
22
|
+
compression: 'compression',
|
|
23
|
+
s3: 's3',
|
|
24
|
+
serde: 'serde',
|
|
25
|
+
onCorruptMessage: 'onCorruptMessage',
|
|
26
|
+
});
|
|
27
|
+
exports.GET_MESSAGES_KEYS = (0, option_shape_js_1.allKeysOf)({
|
|
28
|
+
limit: 'limit',
|
|
29
|
+
before: 'before',
|
|
30
|
+
signal: 'signal',
|
|
31
|
+
});
|
|
32
|
+
exports.LIST_SESSIONS_KEYS = (0, option_shape_js_1.allKeysOf)({
|
|
33
|
+
limit: 'limit',
|
|
34
|
+
cursor: 'cursor',
|
|
35
|
+
maxIterations: 'maxIterations',
|
|
36
|
+
maxItems: 'maxItems',
|
|
37
|
+
signal: 'signal',
|
|
38
|
+
});
|
|
39
|
+
const CORRUPT_MESSAGE_POLICIES = ['skip', 'throw'];
|
|
40
|
+
function assertCorruptMessagePolicy(policy) {
|
|
41
|
+
if (policy !== undefined && !CORRUPT_MESSAGE_POLICIES.includes(policy)) {
|
|
42
|
+
throw (0, errors_js_1.validationError)(`onCorruptMessage must be one of ${CORRUPT_MESSAGE_POLICIES.join(' | ')}`, 'onCorruptMessage');
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
function setUpHistory(options) {
|
|
46
|
+
(0, option_shape_js_1.assertShape)(options, exports.HISTORY_KEYS, 'options');
|
|
47
|
+
const shell = (0, adapter_js_1.openAdapter)(options, 'history', {
|
|
48
|
+
options: () => assertCorruptMessagePolicy(options.onCorruptMessage),
|
|
49
|
+
attemptFloor: exports.MESSAGE_APPEND_RETRY_MAX_ATTEMPTS,
|
|
50
|
+
});
|
|
51
|
+
return {
|
|
52
|
+
shell,
|
|
53
|
+
context: {
|
|
54
|
+
...shell.core,
|
|
55
|
+
serde: options.serde ?? json_serde_js_1.JSON_SERDE,
|
|
56
|
+
ulid: (0, ulid_js_1.createUlidFactory)(),
|
|
57
|
+
onCorruptMessage: options.onCorruptMessage ?? 'skip',
|
|
58
|
+
},
|
|
59
|
+
};
|
|
60
|
+
}
|
|
@@ -22,12 +22,6 @@ export interface MultiSessionHistory {
|
|
|
22
22
|
addMessages(sessionId: string, messages: BaseMessage[]): Promise<void>;
|
|
23
23
|
clear(sessionId: string): Promise<void>;
|
|
24
24
|
}
|
|
25
|
-
/**
|
|
26
|
-
* The earlier name of {@link MultiSessionHistory}, the same type.
|
|
27
|
-
*
|
|
28
|
-
* @deprecated Use `MultiSessionHistory`. This alias is removed in the next major release.
|
|
29
|
-
*/
|
|
30
|
-
export type SessionBackend = MultiSessionHistory;
|
|
31
25
|
/**
|
|
32
26
|
* Single-session view over a {@link MultiSessionHistory}, implementing LangChain's
|
|
33
27
|
* `BaseListChatMessageHistory` so it can drive `RunnableWithMessageHistory`.
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.DynamoDBSessionChatMessageHistory = void 0;
|
|
4
|
+
const chat_history_1 = require("@langchain/core/chat_history");
|
|
5
|
+
const boundary_js_1 = require("../shared/errors/boundary.js");
|
|
6
|
+
const collaborators_js_1 = require("../shared/validation/collaborators.js");
|
|
7
|
+
const option_shape_js_1 = require("../shared/validation/option-shape.js");
|
|
8
|
+
const parse_js_1 = require("./internal/parse.js");
|
|
9
|
+
const ADAPTER_WINDOW_KEYS = (0, option_shape_js_1.allKeysOf)({ limit: 'limit' });
|
|
10
|
+
const MULTI_SESSION_HISTORY_MEMBERS = ['getMessages', 'addMessages', 'clear'];
|
|
11
|
+
class DynamoDBSessionChatMessageHistory extends chat_history_1.BaseListChatMessageHistory {
|
|
12
|
+
backend;
|
|
13
|
+
lc_namespace = ['langchain', 'stores', 'message', 'dynamodb'];
|
|
14
|
+
sessionId;
|
|
15
|
+
window;
|
|
16
|
+
constructor(backend, sessionId, window) {
|
|
17
|
+
super();
|
|
18
|
+
this.backend = backend;
|
|
19
|
+
(0, collaborators_js_1.assertMembers)(backend, MULTI_SESSION_HISTORY_MEMBERS, 'backend');
|
|
20
|
+
this.sessionId = (0, parse_js_1.parseSessionId)(sessionId);
|
|
21
|
+
if (window !== undefined)
|
|
22
|
+
(0, option_shape_js_1.assertShape)(window, ADAPTER_WINDOW_KEYS, 'window');
|
|
23
|
+
this.window = window === undefined ? undefined : (0, parse_js_1.parseMessageWindow)(window);
|
|
24
|
+
}
|
|
25
|
+
getMessages() {
|
|
26
|
+
return (0, boundary_js_1.guardPublic)('session.getMessages', () => this.backend.getMessages(this.sessionId, this.window));
|
|
27
|
+
}
|
|
28
|
+
addMessage(message) {
|
|
29
|
+
return (0, boundary_js_1.guardPublic)('session.addMessage', () => this.backend.addMessages(this.sessionId, [message]));
|
|
30
|
+
}
|
|
31
|
+
addMessages(messages) {
|
|
32
|
+
return (0, boundary_js_1.guardPublic)('session.addMessages', () => this.backend.addMessages(this.sessionId, messages));
|
|
33
|
+
}
|
|
34
|
+
clear() {
|
|
35
|
+
return (0, boundary_js_1.guardPublic)('session.clear', () => this.backend.clear(this.sessionId));
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
exports.DynamoDBSessionChatMessageHistory = DynamoDBSessionChatMessageHistory;
|
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
* a published type.
|
|
10
10
|
*/
|
|
11
11
|
import type { SerializerProtocol } from '@langchain/langgraph-checkpoint';
|
|
12
|
-
import type { BaseAdapterOptions, CancelOptions, CodecOptions } from '../shared/options';
|
|
12
|
+
import type { BaseAdapterOptions, CancelOptions, CodecOptions } from '../shared/options.js';
|
|
13
13
|
/** Options for {@link DynamoDBChatMessageHistory}. */
|
|
14
14
|
export type DynamoDBChatMessageHistoryOptions = BaseAdapterOptions & CodecOptions & {
|
|
15
15
|
/**
|
|
@@ -20,18 +20,21 @@ export type DynamoDBChatMessageHistoryOptions = BaseAdapterOptions & CodecOption
|
|
|
20
20
|
*/
|
|
21
21
|
serde?: SerializerProtocol;
|
|
22
22
|
/**
|
|
23
|
-
* What `getMessages` does when a stored message cannot be decoded
|
|
24
|
-
*
|
|
25
|
-
* declares,
|
|
26
|
-
*
|
|
27
|
-
*
|
|
28
|
-
*
|
|
29
|
-
*
|
|
30
|
-
*
|
|
31
|
-
*
|
|
32
|
-
*
|
|
33
|
-
*
|
|
34
|
-
* the
|
|
23
|
+
* What `getMessages` does when a stored message cannot be decoded. It
|
|
24
|
+
* covers a payload nobody can read — bytes that are no longer the form
|
|
25
|
+
* the row declares, a gone S3 object, a descriptor that is not one — and
|
|
26
|
+
* a stored message LangChain cannot rebuild. It does not govern a
|
|
27
|
+
* payload larger than this reader's `compression.maxDecompressedBytes`
|
|
28
|
+
* or `s3.maxDownloadBytes` (a limit of this reader's, not a lost
|
|
29
|
+
* payload), nor a serializer declining intact bytes: a `serdeType` the
|
|
30
|
+
* configured serializer has no grammar for after a config change, like
|
|
31
|
+
* an `lc` record naming a class outside its allow-list, is reported
|
|
32
|
+
* under **both** policies, because a payload this reader merely may not
|
|
33
|
+
* rebuild is not a payload that is gone. `'skip'` (the default) drops
|
|
34
|
+
* the item, logs it at `error` with its sort key so an operator can
|
|
35
|
+
* locate it, and returns the rest; `'throw'` fails the whole read, which
|
|
36
|
+
* is all-or-nothing but leaves the session unreadable until the bad row
|
|
37
|
+
* is removed out of band.
|
|
35
38
|
*/
|
|
36
39
|
onCorruptMessage?: CorruptMessagePolicy;
|
|
37
40
|
};
|
|
@@ -45,7 +48,7 @@ export type CorruptMessagePolicy = 'skip' | 'throw';
|
|
|
45
48
|
export interface MessageWindow {
|
|
46
49
|
/**
|
|
47
50
|
* Return only the newest `limit` messages — still in chronological order. An
|
|
48
|
-
* integer from 1 to
|
|
51
|
+
* integer from 1 to 10,000: the page rule every `limit` in
|
|
49
52
|
* this package follows, with the one floor of 1 it has. `0` is refused rather
|
|
50
53
|
* than answered with nothing, since for a window into a conversation it is
|
|
51
54
|
* far more likely a bug than a request — and the empty window it would
|
|
@@ -61,7 +64,7 @@ export type GetMessagesOptions = MessageWindow & CancelOptions;
|
|
|
61
64
|
export interface ListSessionsOptions extends CancelOptions {
|
|
62
65
|
/**
|
|
63
66
|
* How many sessions to return, newest-updated first; an integer from 0 to
|
|
64
|
-
*
|
|
67
|
+
* 10,000.
|
|
65
68
|
*
|
|
66
69
|
* With a configured `indexName` it is the page size and defaults to 100.
|
|
67
70
|
* Without one the read is a table scan that cannot be paged: an explicit
|
|
@@ -12,24 +12,24 @@
|
|
|
12
12
|
*
|
|
13
13
|
* @packageDocumentation
|
|
14
14
|
*/
|
|
15
|
-
export { DynamoDBSaver } from './checkpointer/saver';
|
|
16
|
-
export type { DeltaChannelHistoryOptions, DynamoDBSaverOptions } from './checkpointer/types';
|
|
17
|
-
export { DynamoDBStore } from './store/store';
|
|
18
|
-
export type { DynamoDBStoreOptions, ListNamespacesOptions, SearchOptions, VectorReconcileResult, } from './store/types';
|
|
19
|
-
export type { VectorBackend, VectorMatch, VectorRef, VectorScoreDirection, } from './store/vector-backend';
|
|
20
|
-
export { DynamoDBChatMessageHistory } from './history/chat-message-history';
|
|
21
|
-
export { DynamoDBSessionChatMessageHistory } from './history/session-adapter';
|
|
22
|
-
export type { AdapterWindow, MultiSessionHistory
|
|
23
|
-
export type { CorruptMessagePolicy, DynamoDBChatMessageHistoryOptions, GetMessagesOptions, ListSessionsOptions, SessionPage, MessageWindow, SessionMetadata, } from './history/types';
|
|
15
|
+
export { DynamoDBSaver } from './checkpointer/saver.js';
|
|
16
|
+
export type { DeltaChannelHistoryOptions, DynamoDBSaverOptions } from './checkpointer/types.js';
|
|
17
|
+
export { DynamoDBStore } from './store/store.js';
|
|
18
|
+
export type { DynamoDBStoreOptions, ListNamespacesOptions, SearchOptions, VectorReconcileResult, } from './store/types.js';
|
|
19
|
+
export type { VectorBackend, VectorMatch, VectorRef, VectorScoreDirection, } from './store/vector-backend.js';
|
|
20
|
+
export { DynamoDBChatMessageHistory } from './history/chat-message-history.js';
|
|
21
|
+
export { DynamoDBSessionChatMessageHistory } from './history/session-adapter.js';
|
|
22
|
+
export type { AdapterWindow, MultiSessionHistory } from './history/session-adapter.js';
|
|
23
|
+
export type { CorruptMessagePolicy, DynamoDBChatMessageHistoryOptions, GetMessagesOptions, ListSessionsOptions, SessionPage, MessageWindow, SessionMetadata, } from './history/types.js';
|
|
24
24
|
/**
|
|
25
25
|
* Operator tool: give rows written before the recency index their index keys.
|
|
26
26
|
* Run it before setting `indexName` on any adapter — see its own documentation
|
|
27
27
|
* for why enabling the index first hides pre-existing rows from the listings.
|
|
28
28
|
*/
|
|
29
|
-
export { backfillRecencyIndex } from './backfill/backfill';
|
|
30
|
-
export type { BackfillOptions, BackfillResult } from './backfill/backfill';
|
|
31
|
-
export { DynamoDBFactory } from './factory/factory';
|
|
32
|
-
export type { AdapterSection, CreateAllOptions, CreatedAdapters, FactoryBaseOptions, } from './factory/types';
|
|
29
|
+
export { backfillRecencyIndex } from './backfill/backfill.js';
|
|
30
|
+
export type { BackfillOptions, BackfillResult } from './backfill/backfill.js';
|
|
31
|
+
export { DynamoDBFactory } from './factory/factory.js';
|
|
32
|
+
export type { AdapterSection, CreateAllOptions, CreatedAdapters, FactoryBaseOptions, } from './factory/types.js';
|
|
33
33
|
/**
|
|
34
34
|
* The plain JSON serializer the store and chat-history adapters use by
|
|
35
35
|
* default, exported so a checkpointer can be given it in place of LangGraph's
|
|
@@ -37,17 +37,17 @@ export type { AdapterSection, CreateAllOptions, CreatedAdapters, FactoryBaseOpti
|
|
|
37
37
|
* `{"lc": …}` record names. See the README's *Trust boundary* note and
|
|
38
38
|
* `SECURITY.md`.
|
|
39
39
|
*/
|
|
40
|
-
export { JSON_SERDE } from './shared/codec/json-serde';
|
|
41
|
-
export { DynamoDBLangGraphError, isDynamoDBLangGraphError } from './shared/errors/base-error';
|
|
42
|
-
export type { AnyDynamoDBLangGraphError, BatchDrainDetails, BatchPassDetails, BatchWriteIncompleteDetails, CompensationFailedDetails, ErrorContext, ErrorDetailsByCode, ErrorDetailsFor, } from './shared/errors/base-error';
|
|
43
|
-
export { ErrorCode } from './shared/errors/error-code';
|
|
44
|
-
export type { Logger, LogArgument } from './shared/logging/logger';
|
|
45
|
-
export { redactLogger, redactSecrets } from './shared/logging/redaction';
|
|
46
|
-
export type { Redactable, RedactLoggerOptions } from './shared/logging/redaction';
|
|
47
|
-
export type { CancelOptions, BaseAdapterOptions, CodecOptions } from './shared/options';
|
|
48
|
-
export type { DynamoDBDocumentLike } from './shared/dynamodb/client';
|
|
49
|
-
export type { RetryAttemptInfo, RetryOptions, RetryPolicy } from './shared/dynamodb/retry';
|
|
50
|
-
export type { TtlOption } from './shared/validation/ttl';
|
|
51
|
-
export type { CompressionConfig } from './shared/codec/compression';
|
|
52
|
-
export type { S3OffloadConfig } from './shared/codec/s3/config';
|
|
53
|
-
export type { S3ClientConfigLike,
|
|
40
|
+
export { JSON_SERDE } from './shared/codec/json-serde.js';
|
|
41
|
+
export { DynamoDBLangGraphError, isDynamoDBLangGraphError } from './shared/errors/base-error.js';
|
|
42
|
+
export type { AnyDynamoDBLangGraphError, BatchDrainDetails, BatchPassDetails, BatchWriteIncompleteDetails, CompensationFailedDetails, ErrorContext, ErrorDetailsByCode, ErrorDetailsFor, } from './shared/errors/base-error.js';
|
|
43
|
+
export { ErrorCode } from './shared/errors/error-code.js';
|
|
44
|
+
export type { Logger, LogArgument } from './shared/logging/logger.js';
|
|
45
|
+
export { redactLogger, redactSecrets } from './shared/logging/redaction.js';
|
|
46
|
+
export type { Redactable, RedactLoggerOptions } from './shared/logging/redaction.js';
|
|
47
|
+
export type { CancelOptions, BaseAdapterOptions, CodecOptions } from './shared/options.js';
|
|
48
|
+
export type { DynamoDBDocumentLike, WriteRequest } from './shared/dynamodb/client.js';
|
|
49
|
+
export type { RetryAttemptInfo, RetryOptions, RetryPolicy } from './shared/dynamodb/retry.js';
|
|
50
|
+
export type { TtlOption } from './shared/validation/ttl.js';
|
|
51
|
+
export type { CompressionConfig } from './shared/codec/compression.js';
|
|
52
|
+
export type { S3OffloadConfig } from './shared/codec/s3/config.js';
|
|
53
|
+
export type { S3ClientConfigLike, S3ClientOption, S3ClientOptions, S3RegionLike, } from './shared/codec/s3/client-types.js';
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.redactSecrets = exports.redactLogger = exports.ErrorCode = exports.isDynamoDBLangGraphError = exports.DynamoDBLangGraphError = exports.JSON_SERDE = exports.DynamoDBFactory = exports.backfillRecencyIndex = exports.DynamoDBSessionChatMessageHistory = exports.DynamoDBChatMessageHistory = exports.DynamoDBStore = exports.DynamoDBSaver = void 0;
|
|
4
|
+
var saver_js_1 = require("./checkpointer/saver.js");
|
|
5
|
+
Object.defineProperty(exports, "DynamoDBSaver", { enumerable: true, get: function () { return saver_js_1.DynamoDBSaver; } });
|
|
6
|
+
var store_js_1 = require("./store/store.js");
|
|
7
|
+
Object.defineProperty(exports, "DynamoDBStore", { enumerable: true, get: function () { return store_js_1.DynamoDBStore; } });
|
|
8
|
+
var chat_message_history_js_1 = require("./history/chat-message-history.js");
|
|
9
|
+
Object.defineProperty(exports, "DynamoDBChatMessageHistory", { enumerable: true, get: function () { return chat_message_history_js_1.DynamoDBChatMessageHistory; } });
|
|
10
|
+
var session_adapter_js_1 = require("./history/session-adapter.js");
|
|
11
|
+
Object.defineProperty(exports, "DynamoDBSessionChatMessageHistory", { enumerable: true, get: function () { return session_adapter_js_1.DynamoDBSessionChatMessageHistory; } });
|
|
12
|
+
var backfill_js_1 = require("./backfill/backfill.js");
|
|
13
|
+
Object.defineProperty(exports, "backfillRecencyIndex", { enumerable: true, get: function () { return backfill_js_1.backfillRecencyIndex; } });
|
|
14
|
+
var factory_js_1 = require("./factory/factory.js");
|
|
15
|
+
Object.defineProperty(exports, "DynamoDBFactory", { enumerable: true, get: function () { return factory_js_1.DynamoDBFactory; } });
|
|
16
|
+
var json_serde_js_1 = require("./shared/codec/json-serde.js");
|
|
17
|
+
Object.defineProperty(exports, "JSON_SERDE", { enumerable: true, get: function () { return json_serde_js_1.JSON_SERDE; } });
|
|
18
|
+
var base_error_js_1 = require("./shared/errors/base-error.js");
|
|
19
|
+
Object.defineProperty(exports, "DynamoDBLangGraphError", { enumerable: true, get: function () { return base_error_js_1.DynamoDBLangGraphError; } });
|
|
20
|
+
Object.defineProperty(exports, "isDynamoDBLangGraphError", { enumerable: true, get: function () { return base_error_js_1.isDynamoDBLangGraphError; } });
|
|
21
|
+
var error_code_js_1 = require("./shared/errors/error-code.js");
|
|
22
|
+
Object.defineProperty(exports, "ErrorCode", { enumerable: true, get: function () { return error_code_js_1.ErrorCode; } });
|
|
23
|
+
var redaction_js_1 = require("./shared/logging/redaction.js");
|
|
24
|
+
Object.defineProperty(exports, "redactLogger", { enumerable: true, get: function () { return redaction_js_1.redactLogger; } });
|
|
25
|
+
Object.defineProperty(exports, "redactSecrets", { enumerable: true, get: function () { return redaction_js_1.redactSecrets; } });
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"type":"commonjs"}
|
|
@@ -9,14 +9,14 @@
|
|
|
9
9
|
* `dynamodb/client.ts`; this module only reads that decision, to release a
|
|
10
10
|
* client it built and leave an injected one alone.
|
|
11
11
|
*/
|
|
12
|
-
import type { CompressionConfig } from './codec/compression';
|
|
13
|
-
import { type AdapterName } from './codec/s3/config';
|
|
14
|
-
import { S3Offloader } from './codec/s3/offloader';
|
|
15
|
-
import { type DynamoDBDocumentLike } from './dynamodb/client';
|
|
16
|
-
import { type RetryOptions } from './dynamodb/retry';
|
|
17
|
-
import { type Logger } from './logging/logger';
|
|
18
|
-
import type { BaseAdapterOptions, CodecOptions } from './options';
|
|
19
|
-
import { type TtlOption } from './validation/ttl';
|
|
12
|
+
import type { CompressionConfig } from './codec/compression.js';
|
|
13
|
+
import { type AdapterName } from './codec/s3/config.js';
|
|
14
|
+
import { S3Offloader } from './codec/s3/offloader.js';
|
|
15
|
+
import { type DynamoDBDocumentLike } from './dynamodb/client.js';
|
|
16
|
+
import { type RetryOptions } from './dynamodb/retry.js';
|
|
17
|
+
import { type Logger } from './logging/logger.js';
|
|
18
|
+
import type { BaseAdapterOptions, CodecOptions } from './options.js';
|
|
19
|
+
import { type TtlOption } from './validation/ttl.js';
|
|
20
20
|
/** Anything an adapter holds open and must hand back when it is torn down. */
|
|
21
21
|
export interface Releasable {
|
|
22
22
|
destroy(): void;
|
|
@@ -26,10 +26,12 @@ export interface Releasable {
|
|
|
26
26
|
*
|
|
27
27
|
* The hazard is the one `DynamoDBFactory`'s own `release` names: a teardown
|
|
28
28
|
* written as a sequence of statements stops at the first throw, so everything
|
|
29
|
-
* after it is stranded with no reference left to reach it by.
|
|
30
|
-
*
|
|
31
|
-
*
|
|
32
|
-
*
|
|
29
|
+
* after it is stranded with no reference left to reach it by. An adapter's
|
|
30
|
+
* teardown is such a sequence — the S3 offloader, then the DynamoDB client it
|
|
31
|
+
* built — and an S3 client whose sockets are already gone throws from its own
|
|
32
|
+
* `destroy`, which would leave the DynamoDB client open for the life of the
|
|
33
|
+
* process. Each resource is therefore released whatever the ones before it
|
|
34
|
+
* threw.
|
|
33
35
|
*
|
|
34
36
|
* Accepts: `resources` — in the order they should be released; an absent one
|
|
35
37
|
* (an adapter with no offloader, a client the caller injected and therefore
|
|
@@ -72,7 +74,10 @@ export interface AdapterShell {
|
|
|
72
74
|
readonly core: AdapterCore;
|
|
73
75
|
/** Provision the S3 lifecycle rule for the configured ttl; see {@link ensureLifecycleFor}. */
|
|
74
76
|
ensureLifecycleRule(): Promise<void>;
|
|
75
|
-
/**
|
|
77
|
+
/**
|
|
78
|
+
* Release the offloader, and the DynamoDB client when the adapter built it;
|
|
79
|
+
* see {@link releaseOwned}. `release` runs once; a later call does nothing.
|
|
80
|
+
*/
|
|
76
81
|
release(): void;
|
|
77
82
|
}
|
|
78
83
|
/** The checks an adapter adds to the shared ones, and where they run. */
|
|
@@ -102,11 +107,17 @@ export type AdapterOptions = BaseAdapterOptions & CodecOptions & {
|
|
|
102
107
|
* Returns: nothing. Without an offloader there is nothing to rule over, and
|
|
103
108
|
* without a ttl no item expires, so any rule would delete a payload a live row
|
|
104
109
|
* still needs: either absence does nothing. Installing a rule that is already
|
|
105
|
-
* there is a no-op too, so calling this on every deploy is safe.
|
|
110
|
+
* there is a no-op too, so calling this on every deploy is safe. When it
|
|
111
|
+
* writes the rules but cannot confirm within its polling window that a
|
|
112
|
+
* re-read shows them — S3 documents that a lifecycle configuration can take
|
|
113
|
+
* minutes to propagate — it logs a `warn` and returns rather than throwing:
|
|
114
|
+
* the rules were written, and a later call can confirm them.
|
|
106
115
|
*
|
|
107
116
|
* Throws: whatever reading or writing the bucket's lifecycle configuration
|
|
108
|
-
* throws,
|
|
109
|
-
*
|
|
117
|
+
* throws, `VALIDATION` naming `s3.keyPrefix` when the rule id this prefix
|
|
118
|
+
* would take is already held by a different prefix, and `CONTENTION` when
|
|
119
|
+
* every one of the five rounds this call polls needs a write — a competing
|
|
120
|
+
* writer replacing the configuration on every single re-read.
|
|
110
121
|
*
|
|
111
122
|
* Guarantees: needs the bucket-level `s3:GetLifecycleConfiguration` /
|
|
112
123
|
* `s3:PutLifecycleConfiguration` permissions, which are broader than the
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.releaseOwned = releaseOwned;
|
|
4
|
+
exports.ensureLifecycleFor = ensureLifecycleFor;
|
|
5
|
+
exports.openAdapter = openAdapter;
|
|
6
|
+
const config_js_1 = require("./codec/s3/config.js");
|
|
7
|
+
const offloader_js_1 = require("./codec/s3/offloader.js");
|
|
8
|
+
const concurrency_js_1 = require("./concurrency.js");
|
|
9
|
+
const client_js_1 = require("./dynamodb/client.js");
|
|
10
|
+
const recency_index_js_1 = require("./dynamodb/recency-index.js");
|
|
11
|
+
const retry_js_1 = require("./dynamodb/retry.js");
|
|
12
|
+
const base_error_js_1 = require("./errors/base-error.js");
|
|
13
|
+
const logger_js_1 = require("./logging/logger.js");
|
|
14
|
+
const collaborators_js_1 = require("./validation/collaborators.js");
|
|
15
|
+
const options_js_1 = require("./validation/options.js");
|
|
16
|
+
const ttl_js_1 = require("./validation/ttl.js");
|
|
17
|
+
function releaseOwned(resources) {
|
|
18
|
+
let first;
|
|
19
|
+
for (const resource of resources) {
|
|
20
|
+
try {
|
|
21
|
+
resource?.destroy();
|
|
22
|
+
}
|
|
23
|
+
catch (error) {
|
|
24
|
+
first ??= (0, base_error_js_1.toError)(error);
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
if (first !== undefined)
|
|
28
|
+
throw first;
|
|
29
|
+
}
|
|
30
|
+
async function ensureLifecycleFor(core) {
|
|
31
|
+
if (!core.offloader || !core.ttl)
|
|
32
|
+
return;
|
|
33
|
+
await core.offloader.ensureLifecycleRule((0, ttl_js_1.lifecycleExpirationDays)(core.ttl), core.logger);
|
|
34
|
+
}
|
|
35
|
+
function openAdapter(options, adapter, checks = {}) {
|
|
36
|
+
(0, options_js_1.assertBaseAdapterOptions)(options);
|
|
37
|
+
checks.options?.();
|
|
38
|
+
(0, collaborators_js_1.assertBaseCollaborators)(options);
|
|
39
|
+
checks.collaborators?.();
|
|
40
|
+
const logger = (0, logger_js_1.resolveLogger)(options.logger);
|
|
41
|
+
const resolved = (0, client_js_1.resolveDynamoDBClient)(options);
|
|
42
|
+
if (!resolved.ownsClient)
|
|
43
|
+
void (0, client_js_1.warnOnStackedRetries)(resolved.client, logger);
|
|
44
|
+
const offloader = options.s3
|
|
45
|
+
? new offloader_js_1.S3Offloader((0, config_js_1.offloaderConfigFor)(options.s3, adapter, options.clientConfig), logger)
|
|
46
|
+
: undefined;
|
|
47
|
+
const core = {
|
|
48
|
+
client: resolved.client,
|
|
49
|
+
tableName: options.tableName,
|
|
50
|
+
compression: options.compression,
|
|
51
|
+
offloader,
|
|
52
|
+
ttl: options.ttl,
|
|
53
|
+
logger,
|
|
54
|
+
retry: (0, retry_js_1.resolveRetryPolicy)(options.retry, logger, checks.attemptFloor),
|
|
55
|
+
indexShards: options.indexShards ?? recency_index_js_1.DEFAULT_INDEX_SHARDS,
|
|
56
|
+
readConcurrency: options.readConcurrency ?? concurrency_js_1.DEFAULT_READ_CONCURRENCY,
|
|
57
|
+
indexName: options.indexName,
|
|
58
|
+
};
|
|
59
|
+
let released = false;
|
|
60
|
+
return {
|
|
61
|
+
core,
|
|
62
|
+
ensureLifecycleRule: () => ensureLifecycleFor(core),
|
|
63
|
+
release: () => {
|
|
64
|
+
if (released)
|
|
65
|
+
return;
|
|
66
|
+
released = true;
|
|
67
|
+
releaseOwned([offloader, resolved.ownsClient ? resolved.ddbClient : undefined]);
|
|
68
|
+
},
|
|
69
|
+
};
|
|
70
|
+
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.nowIso = nowIso;
|
|
4
|
+
exports.nowMs = nowMs;
|
|
5
|
+
exports.nowSeconds = nowSeconds;
|
|
6
|
+
function nowIso() {
|
|
7
|
+
return new Date(Date.now()).toISOString();
|
|
8
|
+
}
|
|
9
|
+
function nowMs() {
|
|
10
|
+
return Date.now();
|
|
11
|
+
}
|
|
12
|
+
function nowSeconds() {
|
|
13
|
+
return Math.floor(Date.now() / 1000);
|
|
14
|
+
}
|
|
@@ -9,8 +9,8 @@
|
|
|
9
9
|
* here from one a retry might cure.
|
|
10
10
|
*/
|
|
11
11
|
import type { SerializerProtocol } from '@langchain/langgraph-checkpoint';
|
|
12
|
-
import { type CompressionConfig } from './compression';
|
|
13
|
-
import type { S3Offloader } from './s3/offloader';
|
|
12
|
+
import { type CompressionConfig } from './compression.js';
|
|
13
|
+
import type { S3Offloader } from './s3/offloader.js';
|
|
14
14
|
/**
|
|
15
15
|
* Largest serialized payload stored inline when no S3 offloader is configured:
|
|
16
16
|
* DynamoDB's 400 KB item cap less 8 KB of headroom for the item's keys,
|
|
@@ -234,13 +234,14 @@ export interface EncodeOptions {
|
|
|
234
234
|
*
|
|
235
235
|
* Throws: whatever `serde.dumpsTyped` throws; `ABORTED` when the signal
|
|
236
236
|
* fires during the upload; `S3_OFFLOAD_FAILED` from the upload; and two
|
|
237
|
-
* distinguishable `VALIDATION` errors. One names `payload
|
|
238
|
-
*
|
|
239
|
-
*
|
|
240
|
-
*
|
|
241
|
-
*
|
|
242
|
-
*
|
|
243
|
-
*
|
|
237
|
+
* distinguishable `VALIDATION` errors. One names `payload`, raised either
|
|
238
|
+
* way a payload can turn out unstorable: with **no** offloader, the bytes
|
|
239
|
+
* exceed `MAX_INLINE_PAYLOAD_BYTES`; with one, `s3.thresholdBytes` is itself
|
|
240
|
+
* capped at that limit (`src/shared/validation/options.ts`, `assertS3`), so
|
|
241
|
+
* bytes too large to store inline are always at or above the threshold and
|
|
242
|
+
* offload instead — where they are refused if they exceed
|
|
243
|
+
* `s3.maxDownloadBytes`, before the upload ({@link S3Offloader.upload}). The
|
|
244
|
+
* other names `value` — it serialises to nothing (see
|
|
244
245
|
* {@link assertSerialisedToBytes}) — and is raised for an offloaded payload
|
|
245
246
|
* and an inline one alike, before either is stored.
|
|
246
247
|
*/
|
|
@@ -290,6 +291,21 @@ export declare function collectS3Keys(descriptors: readonly (DescriptorRef | nul
|
|
|
290
291
|
* failure this test exists to classify.
|
|
291
292
|
*/
|
|
292
293
|
export declare function isMissingObjectError(error: Error): boolean;
|
|
294
|
+
/**
|
|
295
|
+
* True when S3 refused to answer a download rather than answering it.
|
|
296
|
+
*
|
|
297
|
+
* Accepts: `error` — any error; only `S3_OFFLOAD_FAILED` whose cause the
|
|
298
|
+
* classifier codes `ACCESS_DENIED` matches.
|
|
299
|
+
*
|
|
300
|
+
* Returns: whether S3 declined to say anything about the object. Without
|
|
301
|
+
* `s3:ListBucket` on the bucket, S3 answers a GET of a key that does not exist
|
|
302
|
+
* with 403 rather than 404, so this is what a released object looks like to
|
|
303
|
+
* such a role — and equally what a missing `s3:GetObject` looks like. A caller
|
|
304
|
+
* settles which by other means before treating it as either.
|
|
305
|
+
*
|
|
306
|
+
* Throws: **nothing**, for any value.
|
|
307
|
+
*/
|
|
308
|
+
export declare function isRefusedObjectError(error: Error): boolean;
|
|
293
309
|
/**
|
|
294
310
|
* True when a payload can never be read again, as opposed to a failure that may
|
|
295
311
|
* succeed on retry or after a configuration fix (throttling, network,
|
|
@@ -297,17 +313,18 @@ export declare function isMissingObjectError(error: Error): boolean;
|
|
|
297
313
|
*
|
|
298
314
|
* Accepts: `error` — any error. Permanent are: its object is gone
|
|
299
315
|
* ({@link isMissingObjectError}), its bytes are not the form the row declares
|
|
300
|
-
* (`PAYLOAD_CORRUPT`),
|
|
301
|
-
*
|
|
302
|
-
*
|
|
303
|
-
*
|
|
304
|
-
*
|
|
305
|
-
*
|
|
306
|
-
*
|
|
307
|
-
*
|
|
308
|
-
*
|
|
309
|
-
*
|
|
310
|
-
*
|
|
316
|
+
* (`PAYLOAD_CORRUPT`), or the row's own descriptor is unreadable
|
|
317
|
+
* ({@link isUnreadableDescriptor}). Everything else is false, including an
|
|
318
|
+
* error that carries no code at all, and including four refusals that look
|
|
319
|
+
* like loss and are not. The `s3Key` scope refusal: a row pointing outside
|
|
320
|
+
* its own path is a configuration or tenancy fault to report, not a payload
|
|
321
|
+
* to write off. The `serde` refusal, on the same reasoning (see
|
|
322
|
+
* `loadPayloadValue`). `FORMAT_UNSUPPORTED`, on a row or on a payload: newer
|
|
323
|
+
* is not lost. And `COMPRESSION_LIMIT`: a payload larger than this reader
|
|
324
|
+
* inflates is intact, and a reader with a larger cap reads it. From this
|
|
325
|
+
* release on, this package never compresses a payload past its writer's own
|
|
326
|
+
* cap; a payload an earlier release compressed — which did not check it —
|
|
327
|
+
* can still trip a smaller one here.
|
|
311
328
|
*
|
|
312
329
|
* Returns: whether a caller should report rather than retry.
|
|
313
330
|
*
|