@farukada/aws-langgraph-dynamodb-ts 1.0.0-rc.1 → 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 +1820 -290
- package/dist/cjs/backfill/backfill.d.ts +171 -0
- package/dist/cjs/backfill/backfill.js +177 -0
- package/dist/cjs/checkpointer/actions/delete-thread.d.ts +50 -0
- package/dist/cjs/checkpointer/actions/delete-thread.js +26 -0
- package/dist/cjs/checkpointer/actions/get-tuple.d.ts +36 -0
- package/dist/cjs/checkpointer/actions/get-tuple.js +22 -0
- package/dist/cjs/checkpointer/actions/list.d.ts +55 -0
- package/dist/cjs/checkpointer/actions/list.js +70 -0
- package/dist/cjs/checkpointer/actions/put-writes.d.ts +49 -0
- package/dist/cjs/checkpointer/actions/put-writes.js +21 -0
- package/dist/cjs/checkpointer/actions/put.d.ts +95 -0
- package/dist/cjs/checkpointer/actions/put.js +79 -0
- package/dist/cjs/checkpointer/internal/delta-history.d.ts +124 -0
- package/dist/cjs/checkpointer/internal/delta-history.js +131 -0
- package/dist/cjs/checkpointer/internal/listing.d.ts +149 -0
- package/dist/cjs/checkpointer/internal/listing.js +104 -0
- package/dist/cjs/checkpointer/internal/parse.d.ts +298 -0
- package/dist/cjs/checkpointer/internal/parse.js +184 -0
- package/dist/cjs/checkpointer/internal/pending-writes.d.ts +314 -0
- package/dist/cjs/checkpointer/internal/pending-writes.js +241 -0
- package/dist/cjs/checkpointer/internal/read.d.ts +135 -0
- package/dist/cjs/checkpointer/internal/read.js +132 -0
- package/dist/cjs/checkpointer/internal/rows.d.ts +644 -0
- package/dist/cjs/checkpointer/internal/rows.js +356 -0
- package/dist/cjs/checkpointer/internal/setup.d.ts +47 -0
- package/dist/cjs/checkpointer/internal/setup.js +25 -0
- package/dist/cjs/checkpointer/saver.d.ts +306 -0
- package/dist/cjs/checkpointer/saver.js +56 -0
- package/dist/cjs/checkpointer/types.d.ts +51 -0
- package/dist/cjs/factory/factory.d.ts +154 -0
- package/dist/cjs/factory/factory.js +137 -0
- package/dist/{factory → cjs/factory}/types.d.ts +33 -14
- package/dist/cjs/history/actions/add-messages.d.ts +51 -0
- package/dist/cjs/history/actions/add-messages.js +17 -0
- package/dist/cjs/history/actions/clear.d.ts +52 -0
- package/dist/cjs/history/actions/clear.js +29 -0
- package/dist/cjs/history/actions/get-messages.d.ts +60 -0
- package/dist/cjs/history/actions/get-messages.js +58 -0
- package/dist/cjs/history/actions/list-sessions.d.ts +55 -0
- package/dist/cjs/history/actions/list-sessions.js +67 -0
- package/dist/cjs/history/actions/reconcile-count.d.ts +49 -0
- package/dist/cjs/history/actions/reconcile-count.js +8 -0
- package/dist/cjs/history/chat-message-history.d.ts +267 -0
- package/dist/cjs/history/chat-message-history.js +61 -0
- package/dist/cjs/history/internal/append.d.ts +244 -0
- package/dist/cjs/history/internal/append.js +267 -0
- package/dist/cjs/history/internal/message-read.d.ts +84 -0
- package/dist/cjs/history/internal/message-read.js +93 -0
- package/dist/cjs/history/internal/parse.d.ts +153 -0
- package/dist/cjs/history/internal/parse.js +113 -0
- package/dist/cjs/history/internal/rows.d.ts +196 -0
- package/dist/cjs/history/internal/rows.js +96 -0
- package/dist/cjs/history/internal/session.d.ts +350 -0
- package/dist/cjs/history/internal/session.js +296 -0
- package/dist/cjs/history/internal/setup.d.ts +64 -0
- package/dist/cjs/history/internal/setup.js +60 -0
- package/dist/cjs/history/session-adapter.d.ts +112 -0
- package/dist/cjs/history/session-adapter.js +38 -0
- package/dist/cjs/history/types.d.ts +102 -0
- package/dist/cjs/index.d.ts +53 -0
- package/dist/cjs/index.js +25 -0
- package/dist/cjs/package.json +1 -0
- package/dist/cjs/shared/adapter.d.ts +146 -0
- package/dist/cjs/shared/adapter.js +70 -0
- package/dist/cjs/shared/clock.d.ts +52 -0
- package/dist/cjs/shared/clock.js +14 -0
- package/dist/cjs/shared/codec/codec.d.ts +336 -0
- package/dist/cjs/shared/codec/codec.js +162 -0
- package/dist/cjs/shared/codec/compression.d.ts +66 -0
- package/dist/cjs/shared/codec/compression.js +45 -0
- package/dist/cjs/shared/codec/json-serde.d.ts +80 -0
- package/dist/cjs/shared/codec/json-serde.js +58 -0
- package/dist/{shared → cjs/shared}/codec/s3/client-types.d.ts +22 -2
- package/dist/{shared → cjs/shared}/codec/s3/client-types.js +0 -1
- package/dist/cjs/shared/codec/s3/client.d.ts +63 -0
- package/dist/cjs/shared/codec/s3/client.js +78 -0
- package/dist/cjs/shared/codec/s3/config.d.ts +260 -0
- package/dist/cjs/shared/codec/s3/config.js +92 -0
- package/dist/cjs/shared/codec/s3/lifecycle.d.ts +220 -0
- package/dist/cjs/shared/codec/s3/lifecycle.js +223 -0
- package/dist/cjs/shared/codec/s3/offloader.d.ts +428 -0
- package/dist/cjs/shared/codec/s3/offloader.js +289 -0
- package/dist/cjs/shared/concurrency.d.ts +43 -0
- package/dist/{shared → cjs/shared}/concurrency.js +10 -9
- package/dist/cjs/shared/dynamodb/abort.d.ts +47 -0
- package/dist/cjs/shared/dynamodb/abort.js +16 -0
- package/dist/cjs/shared/dynamodb/batch-write.d.ts +86 -0
- package/dist/cjs/shared/dynamodb/batch-write.js +79 -0
- package/dist/cjs/shared/dynamodb/cancellation.d.ts +124 -0
- package/dist/cjs/shared/dynamodb/cancellation.js +37 -0
- package/dist/cjs/shared/dynamodb/client.d.ts +177 -0
- package/dist/{shared → cjs/shared}/dynamodb/client.js +12 -14
- package/dist/cjs/shared/dynamodb/idempotent-write.d.ts +596 -0
- package/dist/cjs/shared/dynamodb/idempotent-write.js +173 -0
- package/dist/cjs/shared/dynamodb/paginate.d.ts +111 -0
- package/dist/cjs/shared/dynamodb/paginate.js +90 -0
- package/dist/cjs/shared/dynamodb/partition-delete.d.ts +204 -0
- package/dist/cjs/shared/dynamodb/partition-delete.js +177 -0
- package/dist/cjs/shared/dynamodb/recency-index.d.ts +243 -0
- package/dist/cjs/shared/dynamodb/recency-index.js +146 -0
- package/dist/cjs/shared/dynamodb/retry.d.ts +317 -0
- 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/cjs/shared/dynamodb/table-schema.d.ts +199 -0
- package/dist/cjs/shared/dynamodb/table-schema.js +52 -0
- package/dist/cjs/shared/errors/base-error.d.ts +231 -0
- package/dist/cjs/shared/errors/base-error.js +73 -0
- package/dist/cjs/shared/errors/boundary.d.ts +86 -0
- 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/cjs/shared/errors/error-code.d.ts +95 -0
- package/dist/{shared → cjs/shared}/errors/error-code.js +12 -2
- package/dist/cjs/shared/errors/errors.d.ts +233 -0
- package/dist/cjs/shared/errors/errors.js +123 -0
- package/dist/cjs/shared/logging/logger.d.ts +80 -0
- package/dist/cjs/shared/logging/logger.js +30 -0
- package/dist/cjs/shared/logging/redaction.d.ts +123 -0
- package/dist/cjs/shared/logging/redaction.js +145 -0
- package/dist/cjs/shared/logging/secret-patterns.d.ts +227 -0
- package/dist/cjs/shared/logging/secret-patterns.js +93 -0
- package/dist/cjs/shared/logging/truncate.d.ts +197 -0
- package/dist/cjs/shared/logging/truncate.js +31 -0
- package/dist/cjs/shared/options.d.ts +100 -0
- package/dist/cjs/shared/ulid.d.ts +80 -0
- package/dist/{shared → cjs/shared}/ulid.js +7 -21
- package/dist/cjs/shared/validation/collaborators.d.ts +160 -0
- package/dist/cjs/shared/validation/collaborators.js +79 -0
- package/dist/cjs/shared/validation/option-shape.d.ts +91 -0
- package/dist/cjs/shared/validation/option-shape.js +31 -0
- package/dist/cjs/shared/validation/options.d.ts +145 -0
- package/dist/cjs/shared/validation/options.js +166 -0
- package/dist/cjs/shared/validation/primitives.d.ts +292 -0
- package/dist/cjs/shared/validation/primitives.js +114 -0
- package/dist/cjs/shared/validation/ttl.d.ts +94 -0
- package/dist/cjs/shared/validation/ttl.js +52 -0
- package/dist/cjs/store/actions/list-namespaces.d.ts +79 -0
- package/dist/cjs/store/actions/list-namespaces.js +92 -0
- package/dist/cjs/store/actions/put.d.ts +43 -0
- package/dist/cjs/store/actions/put.js +49 -0
- package/dist/cjs/store/actions/reconcile-vector-index.d.ts +38 -0
- package/dist/cjs/store/actions/reconcile-vector-index.js +13 -0
- package/dist/cjs/store/actions/search.d.ts +38 -0
- 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/cjs/store/internal/filter.d.ts +43 -0
- 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/cjs/store/internal/item-write.d.ts +270 -0
- package/dist/cjs/store/internal/item-write.js +181 -0
- package/dist/cjs/store/internal/parse.d.ts +230 -0
- package/dist/cjs/store/internal/parse.js +180 -0
- package/dist/cjs/store/internal/rows.d.ts +359 -0
- package/dist/cjs/store/internal/rows.js +166 -0
- package/dist/cjs/store/internal/semantic-search.d.ts +168 -0
- package/dist/{store/internal/text-path.js → cjs/store/internal/semantic-search.js} +92 -28
- package/dist/cjs/store/internal/setup.d.ts +96 -0
- package/dist/cjs/store/internal/setup.js +103 -0
- package/dist/cjs/store/internal/table-search.d.ts +100 -0
- package/dist/cjs/store/internal/table-search.js +123 -0
- package/dist/cjs/store/internal/vector-index.d.ts +258 -0
- package/dist/cjs/store/internal/vector-index.js +269 -0
- package/dist/cjs/store/store.d.ts +329 -0
- package/dist/cjs/store/store.js +97 -0
- package/dist/cjs/store/types.d.ts +111 -0
- package/dist/cjs/store/vector-backend.d.ts +104 -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/esm/checkpointer/actions/delete-thread.d.ts +50 -0
- package/dist/esm/checkpointer/actions/delete-thread.js +23 -0
- package/dist/esm/checkpointer/actions/get-tuple.d.ts +36 -0
- 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/esm/checkpointer/actions/put-writes.d.ts +49 -0
- 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/esm/checkpointer/internal/listing.d.ts +149 -0
- 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/esm/checkpointer/saver.d.ts +306 -0
- 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/esm/history/actions/add-messages.d.ts +51 -0
- package/dist/esm/history/actions/add-messages.js +14 -0
- package/dist/esm/history/actions/clear.d.ts +52 -0
- 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/esm/history/actions/reconcile-count.d.ts +49 -0
- package/dist/esm/history/actions/reconcile-count.js +5 -0
- package/dist/esm/history/chat-message-history.d.ts +267 -0
- 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/esm/history/internal/rows.d.ts +196 -0
- 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/esm/history/session-adapter.d.ts +112 -0
- 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/esm/shared/clock.d.ts +52 -0
- 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/esm/shared/codec/s3/config.d.ts +260 -0
- 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/esm/shared/concurrency.d.ts +43 -0
- package/dist/esm/shared/concurrency.js +27 -0
- package/dist/esm/shared/dynamodb/abort.d.ts +47 -0
- 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/esm/shared/dynamodb/cancellation.d.ts +124 -0
- package/dist/esm/shared/dynamodb/cancellation.js +30 -0
- package/dist/esm/shared/dynamodb/client.d.ts +177 -0
- package/dist/esm/shared/dynamodb/client.js +35 -0
- package/dist/esm/shared/dynamodb/idempotent-write.d.ts +596 -0
- 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/esm/shared/dynamodb/table-schema.d.ts +199 -0
- 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/esm/shared/errors/error-code.d.ts +95 -0
- package/dist/esm/shared/errors/error-code.js +24 -0
- package/dist/esm/shared/errors/errors.d.ts +233 -0
- package/dist/esm/shared/errors/errors.js +110 -0
- package/dist/esm/shared/logging/logger.d.ts +80 -0
- 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/esm/shared/logging/secret-patterns.d.ts +227 -0
- package/dist/esm/shared/logging/secret-patterns.js +83 -0
- package/dist/esm/shared/logging/truncate.d.ts +197 -0
- 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/esm/shared/ulid.d.ts +80 -0
- package/dist/esm/shared/ulid.js +77 -0
- package/dist/esm/shared/validation/collaborators.d.ts +160 -0
- package/dist/esm/shared/validation/collaborators.js +70 -0
- package/dist/esm/shared/validation/option-shape.d.ts +91 -0
- 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/esm/shared/validation/primitives.d.ts +292 -0
- 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/esm/store/actions/reconcile-vector-index.d.ts +38 -0
- 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/esm/store/internal/rows.d.ts +359 -0
- 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/esm/store/store.d.ts +329 -0
- 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 +68 -46
- package/dist/checkpointer/actions/delete-thread.d.ts +0 -10
- package/dist/checkpointer/actions/delete-thread.js +0 -38
- package/dist/checkpointer/actions/get-tuple.d.ts +0 -11
- package/dist/checkpointer/actions/get-tuple.js +0 -25
- package/dist/checkpointer/actions/list.d.ts +0 -20
- package/dist/checkpointer/actions/list.js +0 -113
- package/dist/checkpointer/actions/put-writes.d.ts +0 -15
- package/dist/checkpointer/actions/put-writes.js +0 -62
- package/dist/checkpointer/actions/put.d.ts +0 -17
- package/dist/checkpointer/actions/put.js +0 -73
- package/dist/checkpointer/internal/assemble.d.ts +0 -17
- package/dist/checkpointer/internal/assemble.js +0 -38
- package/dist/checkpointer/internal/checkpoint-write-verify.d.ts +0 -24
- package/dist/checkpointer/internal/checkpoint-write-verify.js +0 -67
- package/dist/checkpointer/internal/configurable.d.ts +0 -12
- package/dist/checkpointer/internal/configurable.js +0 -24
- package/dist/checkpointer/internal/fetch.d.ts +0 -19
- package/dist/checkpointer/internal/fetch.js +0 -88
- package/dist/checkpointer/internal/filter-match.d.ts +0 -13
- package/dist/checkpointer/internal/filter-match.js +0 -15
- package/dist/checkpointer/internal/item-reader.d.ts +0 -66
- package/dist/checkpointer/internal/item-reader.js +0 -113
- package/dist/checkpointer/internal/item-writer.d.ts +0 -35
- package/dist/checkpointer/internal/item-writer.js +0 -107
- package/dist/checkpointer/internal/keys.d.ts +0 -41
- package/dist/checkpointer/internal/keys.js +0 -117
- package/dist/checkpointer/internal/list-scope.d.ts +0 -61
- package/dist/checkpointer/internal/list-scope.js +0 -108
- package/dist/checkpointer/internal/pending-sends.d.ts +0 -13
- package/dist/checkpointer/internal/pending-sends.js +0 -29
- package/dist/checkpointer/internal/query.d.ts +0 -21
- package/dist/checkpointer/internal/query.js +0 -42
- package/dist/checkpointer/internal/regular-write.d.ts +0 -28
- package/dist/checkpointer/internal/regular-write.js +0 -66
- package/dist/checkpointer/internal/setup.d.ts +0 -33
- package/dist/checkpointer/internal/setup.js +0 -38
- package/dist/checkpointer/internal/special-write-cas.d.ts +0 -29
- package/dist/checkpointer/internal/special-write-cas.js +0 -104
- package/dist/checkpointer/internal/special-write-cleanup.d.ts +0 -23
- package/dist/checkpointer/internal/special-write-cleanup.js +0 -50
- package/dist/checkpointer/internal/special-write-verify.d.ts +0 -53
- package/dist/checkpointer/internal/special-write-verify.js +0 -80
- package/dist/checkpointer/internal/stored-channels.d.ts +0 -31
- package/dist/checkpointer/internal/stored-channels.js +0 -70
- package/dist/checkpointer/internal/validation.d.ts +0 -18
- package/dist/checkpointer/internal/validation.js +0 -40
- package/dist/checkpointer/internal/write-guard.d.ts +0 -20
- package/dist/checkpointer/internal/write-guard.js +0 -48
- package/dist/checkpointer/internal/write-index.d.ts +0 -36
- package/dist/checkpointer/internal/write-index.js +0 -41
- package/dist/checkpointer/saver.d.ts +0 -70
- package/dist/checkpointer/saver.js +0 -105
- package/dist/checkpointer/types.d.ts +0 -58
- package/dist/factory/factory.d.ts +0 -40
- package/dist/factory/factory.js +0 -87
- package/dist/history/actions/add-messages.d.ts +0 -15
- package/dist/history/actions/add-messages.js +0 -77
- package/dist/history/actions/clear.d.ts +0 -10
- package/dist/history/actions/clear.js +0 -34
- package/dist/history/actions/get-messages.d.ts +0 -17
- package/dist/history/actions/get-messages.js +0 -79
- package/dist/history/actions/list-sessions.d.ts +0 -13
- package/dist/history/actions/list-sessions.js +0 -53
- package/dist/history/actions/reconcile-count.d.ts +0 -12
- package/dist/history/actions/reconcile-count.js +0 -64
- package/dist/history/chat-message-history.d.ts +0 -73
- package/dist/history/chat-message-history.js +0 -111
- package/dist/history/internal/append-saga.d.ts +0 -25
- package/dist/history/internal/append-saga.js +0 -79
- package/dist/history/internal/compensation.d.ts +0 -25
- package/dist/history/internal/compensation.js +0 -92
- package/dist/history/internal/item-mapper.d.ts +0 -9
- package/dist/history/internal/item-mapper.js +0 -27
- package/dist/history/internal/keys.d.ts +0 -16
- package/dist/history/internal/keys.js +0 -48
- package/dist/history/internal/message-chunker.d.ts +0 -13
- package/dist/history/internal/message-chunker.js +0 -67
- package/dist/history/internal/message-transaction.d.ts +0 -25
- package/dist/history/internal/message-transaction.js +0 -61
- package/dist/history/internal/message-window.d.ts +0 -17
- package/dist/history/internal/message-window.js +0 -49
- package/dist/history/internal/query.d.ts +0 -23
- package/dist/history/internal/query.js +0 -39
- package/dist/history/internal/session-count.d.ts +0 -47
- package/dist/history/internal/session-count.js +0 -115
- package/dist/history/internal/session-title.d.ts +0 -19
- package/dist/history/internal/session-title.js +0 -43
- package/dist/history/internal/session-update.d.ts +0 -27
- package/dist/history/internal/session-update.js +0 -69
- package/dist/history/internal/setup.d.ts +0 -31
- package/dist/history/internal/setup.js +0 -43
- package/dist/history/internal/title-generator.d.ts +0 -12
- package/dist/history/internal/title-generator.js +0 -41
- package/dist/history/internal/ttl-anchor.d.ts +0 -24
- package/dist/history/internal/ttl-anchor.js +0 -38
- package/dist/history/internal/validation.d.ts +0 -25
- package/dist/history/internal/validation.js +0 -53
- package/dist/history/session-adapter.d.ts +0 -29
- package/dist/history/session-adapter.js +0 -35
- package/dist/history/types.d.ts +0 -69
- package/dist/index.d.ts +0 -29
- package/dist/index.js +0 -32
- package/dist/shared/clock.d.ts +0 -8
- package/dist/shared/clock.js +0 -16
- package/dist/shared/codec/codec.d.ts +0 -53
- package/dist/shared/codec/codec.js +0 -66
- package/dist/shared/codec/compression.d.ts +0 -24
- package/dist/shared/codec/compression.js +0 -48
- package/dist/shared/codec/descriptor-keys.d.ts +0 -12
- package/dist/shared/codec/descriptor-keys.js +0 -14
- package/dist/shared/codec/encode.d.ts +0 -13
- package/dist/shared/codec/encode.js +0 -43
- package/dist/shared/codec/json-serde.d.ts +0 -7
- package/dist/shared/codec/json-serde.js +0 -17
- package/dist/shared/codec/payload-loss.d.ts +0 -12
- package/dist/shared/codec/payload-loss.js +0 -38
- package/dist/shared/codec/s3/adapter-config.d.ts +0 -13
- package/dist/shared/codec/s3/adapter-config.js +0 -22
- package/dist/shared/codec/s3/bounded-body.d.ts +0 -14
- package/dist/shared/codec/s3/bounded-body.js +0 -47
- package/dist/shared/codec/s3/client.d.ts +0 -18
- package/dist/shared/codec/s3/client.js +0 -46
- package/dist/shared/codec/s3/config.d.ts +0 -51
- package/dist/shared/codec/s3/config.js +0 -58
- package/dist/shared/codec/s3/delete.d.ts +0 -7
- package/dist/shared/codec/s3/delete.js +0 -28
- package/dist/shared/codec/s3/key-scope.d.ts +0 -23
- package/dist/shared/codec/s3/key-scope.js +0 -44
- package/dist/shared/codec/s3/lifecycle.d.ts +0 -14
- package/dist/shared/codec/s3/lifecycle.js +0 -63
- package/dist/shared/codec/s3/offloader.d.ts +0 -44
- package/dist/shared/codec/s3/offloader.js +0 -118
- package/dist/shared/codec/s3/orphans.d.ts +0 -23
- package/dist/shared/codec/s3/orphans.js +0 -71
- package/dist/shared/codec/s3/read-write.d.ts +0 -18
- package/dist/shared/codec/s3/read-write.js +0 -51
- package/dist/shared/codec/s3/retry.d.ts +0 -5
- package/dist/shared/codec/s3/retry.js +0 -22
- package/dist/shared/concurrency.d.ts +0 -6
- package/dist/shared/constants.d.ts +0 -112
- package/dist/shared/constants.js +0 -115
- package/dist/shared/dynamodb/abort.d.ts +0 -9
- package/dist/shared/dynamodb/abort.js +0 -27
- package/dist/shared/dynamodb/backoff.d.ts +0 -15
- package/dist/shared/dynamodb/backoff.js +0 -48
- package/dist/shared/dynamodb/batch-write.d.ts +0 -22
- package/dist/shared/dynamodb/batch-write.js +0 -53
- package/dist/shared/dynamodb/cancellation.d.ts +0 -6
- package/dist/shared/dynamodb/cancellation.js +0 -7
- package/dist/shared/dynamodb/client.d.ts +0 -28
- package/dist/shared/dynamodb/conditional-put.d.ts +0 -67
- package/dist/shared/dynamodb/conditional-put.js +0 -76
- package/dist/shared/dynamodb/drain-unprocessed.d.ts +0 -21
- package/dist/shared/dynamodb/drain-unprocessed.js +0 -43
- package/dist/shared/dynamodb/expiry.d.ts +0 -16
- package/dist/shared/dynamodb/expiry.js +0 -29
- package/dist/shared/dynamodb/paginate-core.d.ts +0 -24
- package/dist/shared/dynamodb/paginate-core.js +0 -82
- package/dist/shared/dynamodb/paginate.d.ts +0 -14
- package/dist/shared/dynamodb/paginate.js +0 -19
- package/dist/shared/dynamodb/partition-delete.d.ts +0 -39
- package/dist/shared/dynamodb/partition-delete.js +0 -71
- package/dist/shared/dynamodb/retry-classifier.d.ts +0 -17
- package/dist/shared/dynamodb/retry-classifier.js +0 -118
- package/dist/shared/dynamodb/retry-policy.d.ts +0 -26
- package/dist/shared/dynamodb/retry-policy.js +0 -22
- package/dist/shared/dynamodb/retry.d.ts +0 -31
- package/dist/shared/dynamodb/retry.js +0 -57
- package/dist/shared/dynamodb/scan.d.ts +0 -14
- package/dist/shared/dynamodb/scan.js +0 -19
- package/dist/shared/dynamodb/types.d.ts +0 -23
- package/dist/shared/errors/base-error.d.ts +0 -30
- package/dist/shared/errors/base-error.js +0 -27
- package/dist/shared/errors/boundary.d.ts +0 -18
- package/dist/shared/errors/boundary.js +0 -46
- package/dist/shared/errors/error-code.d.ts +0 -13
- package/dist/shared/errors/errors.d.ts +0 -68
- package/dist/shared/errors/errors.js +0 -114
- package/dist/shared/errors/upstream-error.d.ts +0 -16
- package/dist/shared/errors/upstream-error.js +0 -27
- package/dist/shared/errors/wrap-error.d.ts +0 -7
- package/dist/shared/errors/wrap-error.js +0 -15
- package/dist/shared/logging/logger.d.ts +0 -18
- package/dist/shared/logging/logger.js +0 -15
- package/dist/shared/logging/redaction-walk.d.ts +0 -23
- package/dist/shared/logging/redaction-walk.js +0 -112
- package/dist/shared/logging/redaction.d.ts +0 -39
- package/dist/shared/logging/redaction.js +0 -75
- package/dist/shared/logging/secret-patterns.d.ts +0 -92
- package/dist/shared/logging/secret-patterns.js +0 -133
- package/dist/shared/options.d.ts +0 -37
- package/dist/shared/ulid.d.ts +0 -23
- package/dist/shared/validation/options.d.ts +0 -8
- package/dist/shared/validation/options.js +0 -90
- package/dist/shared/validation/primitives.d.ts +0 -29
- package/dist/shared/validation/primitives.js +0 -82
- package/dist/shared/validation/ttl.d.ts +0 -28
- package/dist/shared/validation/ttl.js +0 -52
- package/dist/store/actions/get.d.ts +0 -13
- package/dist/store/actions/get.js +0 -73
- package/dist/store/actions/list-namespaces.d.ts +0 -8
- package/dist/store/actions/list-namespaces.js +0 -59
- package/dist/store/actions/put.d.ts +0 -10
- package/dist/store/actions/put.js +0 -96
- package/dist/store/actions/reconcile-vector-index.d.ts +0 -18
- package/dist/store/actions/reconcile-vector-index.js +0 -26
- package/dist/store/actions/search.d.ts +0 -9
- package/dist/store/actions/search.js +0 -34
- package/dist/store/internal/backend-search.d.ts +0 -4
- package/dist/store/internal/backend-search.js +0 -74
- package/dist/store/internal/batch-plan.d.ts +0 -11
- package/dist/store/internal/batch-plan.js +0 -52
- package/dist/store/internal/candidates.d.ts +0 -23
- package/dist/store/internal/candidates.js +0 -94
- package/dist/store/internal/filter.d.ts +0 -9
- package/dist/store/internal/filter.js +0 -85
- package/dist/store/internal/index-reconcile.d.ts +0 -21
- package/dist/store/internal/index-reconcile.js +0 -118
- package/dist/store/internal/index-sync.d.ts +0 -10
- package/dist/store/internal/index-sync.js +0 -25
- package/dist/store/internal/item-mapper.d.ts +0 -27
- package/dist/store/internal/item-mapper.js +0 -61
- package/dist/store/internal/keys.d.ts +0 -17
- package/dist/store/internal/keys.js +0 -41
- package/dist/store/internal/namespace-match.d.ts +0 -11
- package/dist/store/internal/namespace-match.js +0 -40
- package/dist/store/internal/option-validation.d.ts +0 -13
- package/dist/store/internal/option-validation.js +0 -77
- package/dist/store/internal/overwrite-swap.d.ts +0 -32
- package/dist/store/internal/overwrite-swap.js +0 -68
- package/dist/store/internal/persist.d.ts +0 -28
- package/dist/store/internal/persist.js +0 -64
- package/dist/store/internal/query.d.ts +0 -11
- package/dist/store/internal/query.js +0 -48
- package/dist/store/internal/ranker.d.ts +0 -18
- package/dist/store/internal/ranker.js +0 -39
- package/dist/store/internal/read-existing.d.ts +0 -23
- package/dist/store/internal/read-existing.js +0 -41
- package/dist/store/internal/score-direction.d.ts +0 -31
- package/dist/store/internal/score-direction.js +0 -38
- package/dist/store/internal/search-filter.d.ts +0 -3
- package/dist/store/internal/search-filter.js +0 -10
- package/dist/store/internal/semantic-search.d.ts +0 -34
- package/dist/store/internal/semantic-search.js +0 -87
- package/dist/store/internal/setup.d.ts +0 -36
- package/dist/store/internal/setup.js +0 -40
- package/dist/store/internal/text-path.d.ts +0 -17
- package/dist/store/internal/validation.d.ts +0 -18
- package/dist/store/internal/validation.js +0 -51
- package/dist/store/internal/write-verify.d.ts +0 -42
- package/dist/store/internal/write-verify.js +0 -71
- package/dist/store/store.d.ts +0 -61
- package/dist/store/store.js +0 -107
- package/dist/store/types.d.ts +0 -50
- package/dist/store/types.js +0 -2
- package/dist/store/vector-backend.d.ts +0 -43
- package/dist/store/vector-backend.js +0 -2
- /package/dist/{checkpointer → cjs/checkpointer}/types.js +0 -0
- /package/dist/{factory → cjs/factory}/types.js +0 -0
- /package/dist/{history → cjs/history}/types.js +0 -0
- /package/dist/{shared → cjs/shared}/options.js +0 -0
- /package/dist/{shared/dynamodb → cjs/store}/types.js +0 -0
package/package.json
CHANGED
|
@@ -1,76 +1,98 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@farukada/aws-langgraph-dynamodb-ts",
|
|
3
|
-
"version": "1.0.0
|
|
3
|
+
"version": "1.0.0",
|
|
4
4
|
"license": "MIT",
|
|
5
|
-
"description": "
|
|
5
|
+
"description": "DynamoDB persistence for LangGraph.js: checkpoint saver, long-term memory store with semantic search, and chat message history, with optional S3 offload, compression and TTL",
|
|
6
6
|
"keywords": [
|
|
7
7
|
"aws",
|
|
8
8
|
"dynamodb",
|
|
9
9
|
"langchain",
|
|
10
10
|
"langgraph",
|
|
11
11
|
"checkpointer",
|
|
12
|
-
"
|
|
12
|
+
"checkpoint-saver",
|
|
13
|
+
"memory-store",
|
|
14
|
+
"long-term-memory",
|
|
15
|
+
"chat-history",
|
|
16
|
+
"semantic-search",
|
|
17
|
+
"s3",
|
|
18
|
+
"typescript"
|
|
13
19
|
],
|
|
14
20
|
"author": "Faruk Ada <info@farukada.com>",
|
|
15
21
|
"homepage": "https://github.com/FarukAda/aws-langgraph-dynamodb-ts",
|
|
16
22
|
"repository": {
|
|
17
23
|
"type": "git",
|
|
18
|
-
"url": "https://github.com/FarukAda/aws-langgraph-dynamodb-ts"
|
|
24
|
+
"url": "git+https://github.com/FarukAda/aws-langgraph-dynamodb-ts.git"
|
|
19
25
|
},
|
|
20
26
|
"bugs": {
|
|
21
27
|
"url": "https://github.com/FarukAda/aws-langgraph-dynamodb-ts/issues"
|
|
22
28
|
},
|
|
23
|
-
"
|
|
24
|
-
"
|
|
29
|
+
"type": "module",
|
|
30
|
+
"main": "./dist/cjs/index.js",
|
|
31
|
+
"types": "./dist/cjs/index.d.ts",
|
|
25
32
|
"exports": {
|
|
26
33
|
".": {
|
|
27
|
-
"
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
34
|
+
"import": {
|
|
35
|
+
"types": "./dist/esm/index.d.ts",
|
|
36
|
+
"default": "./dist/esm/index.js"
|
|
37
|
+
},
|
|
38
|
+
"require": {
|
|
39
|
+
"types": "./dist/cjs/index.d.ts",
|
|
40
|
+
"default": "./dist/cjs/index.js"
|
|
41
|
+
}
|
|
31
42
|
},
|
|
32
43
|
"./package.json": "./package.json"
|
|
33
44
|
},
|
|
34
45
|
"engines": {
|
|
35
|
-
"node": ">=22.0.0"
|
|
36
|
-
"npm": ">=10.0.0"
|
|
46
|
+
"node": ">=22.0.0"
|
|
37
47
|
},
|
|
38
48
|
"scripts": {
|
|
39
|
-
"build": "
|
|
49
|
+
"build": "node scripts/clean.mjs && npm run build:esm && npm run build:cjs",
|
|
50
|
+
"build:esm": "tsc -p tsconfig.build.json --removeComments --declaration false && tsc -p tsconfig.build.json --emitDeclarationOnly",
|
|
51
|
+
"build:cjs": "tsc -p tsconfig.build.cjs.json --removeComments --declaration false && tsc -p tsconfig.build.cjs.json --emitDeclarationOnly && node scripts/mark-cjs.mjs",
|
|
40
52
|
"typecheck": "tsc -p tsconfig.build.json --noEmit",
|
|
41
53
|
"typecheck:all": "tsc --noEmit",
|
|
42
54
|
"lint": "eslint \"src/**/*.ts\" \"test/**/*.ts\" \"*.config.ts\" \"**/*.mjs\" --no-error-on-unmatched-pattern",
|
|
43
55
|
"lint:fix": "eslint \"src/**/*.ts\" \"test/**/*.ts\" \"*.config.ts\" \"**/*.mjs\" --fix --no-error-on-unmatched-pattern",
|
|
44
56
|
"test": "jest --coverage",
|
|
45
|
-
"test:integration": "jest --config jest.integration.config.
|
|
57
|
+
"test:integration": "jest --config jest.integration.config.mjs",
|
|
46
58
|
"test:integration:up": "docker compose up -d",
|
|
47
59
|
"test:integration:down": "docker compose down",
|
|
48
|
-
"test:conformance": "jest --config jest.conformance.config.
|
|
49
|
-
"test:aws": "jest --config jest.aws.config.
|
|
60
|
+
"test:conformance": "jest --config jest.conformance.config.mjs",
|
|
61
|
+
"test:aws": "jest --config jest.aws.config.mjs",
|
|
50
62
|
"test:static": "jest test/static",
|
|
63
|
+
"test:scripts": "node --test \"test/scripts/**/*.test.mjs\"",
|
|
51
64
|
"test:package-smoke": "node --test test/package-smoke/smoke.test.mjs",
|
|
65
|
+
"test:consumer-types": "node --test test/package-smoke/consumer-types.test.mjs",
|
|
66
|
+
"test:surface": "node scripts/run-with-timeout.mjs 150 -- node --test --test-force-exit --test-timeout=120000 test/surface/surface.test.mjs",
|
|
67
|
+
"test:surface:update": "node scripts/update-surface-baseline.mjs",
|
|
52
68
|
"prepublishOnly": "npm run typecheck && npm run typecheck:all && npm run lint && npm run build && npm test",
|
|
53
69
|
"docs": "typedoc",
|
|
54
70
|
"docs:watch": "typedoc --watch",
|
|
71
|
+
"check:docs": "node scripts/check-doc-samples.mjs",
|
|
72
|
+
"check:links": "node scripts/check-doc-links.mjs",
|
|
55
73
|
"unused": "knip",
|
|
56
|
-
"
|
|
74
|
+
"peer-floors": "node scripts/peer-floors.mjs",
|
|
75
|
+
"ci:require-green": "node scripts/require-green-ci.mjs",
|
|
76
|
+
"changelog-section": "node scripts/changelog-section.mjs",
|
|
77
|
+
"sbom": "node scripts/generate-sbom.mjs",
|
|
57
78
|
"cpd": "jscpd ./src --threshold 2 --min-lines 3 --reporters console --silent --format typescript,javascript",
|
|
58
79
|
"cpd:full": "jscpd ./src --threshold 2 --min-lines 3 --reporters console-full --format typescript,javascript",
|
|
59
80
|
"cpd:test": "jscpd ./test --threshold 2 --min-lines 3 --reporters console-full --format typescript,javascript",
|
|
60
|
-
"
|
|
81
|
+
"example:checkpointer": "npm run build && node examples/live-checkpointer.mjs",
|
|
82
|
+
"example:persist": "npm run build && node examples/live-persist.mjs",
|
|
83
|
+
"example:store": "npm run build && node examples/live-store.mjs",
|
|
84
|
+
"example:agent": "npm run build && node examples/live-agent.mjs",
|
|
85
|
+
"pack:check": "node scripts/pack-check.mjs && publint && attw --pack ."
|
|
61
86
|
},
|
|
62
87
|
"dependencies": {
|
|
63
|
-
"@aws-sdk/client-dynamodb": "^3.
|
|
64
|
-
"@aws-sdk/lib-dynamodb": "^3.
|
|
88
|
+
"@aws-sdk/client-dynamodb": "^3.1151.0",
|
|
89
|
+
"@aws-sdk/lib-dynamodb": "^3.1151.0",
|
|
65
90
|
"@aws-sdk/util-dynamodb": "^3.996.9"
|
|
66
91
|
},
|
|
67
92
|
"peerDependencies": {
|
|
68
|
-
"@aws-sdk/client-s3": "^3.
|
|
69
|
-
"@langchain/core": "^1.2.
|
|
70
|
-
"@langchain/langgraph-checkpoint": "^1.
|
|
71
|
-
},
|
|
72
|
-
"overrides": {
|
|
73
|
-
"uuid": ">=11.1.1"
|
|
93
|
+
"@aws-sdk/client-s3": "^3.1151.0",
|
|
94
|
+
"@langchain/core": "^1.2.17",
|
|
95
|
+
"@langchain/langgraph-checkpoint": "^1.2.0"
|
|
74
96
|
},
|
|
75
97
|
"peerDependenciesMeta": {
|
|
76
98
|
"@aws-sdk/client-s3": {
|
|
@@ -79,37 +101,37 @@
|
|
|
79
101
|
},
|
|
80
102
|
"devDependencies": {
|
|
81
103
|
"@arethetypeswrong/cli": "^0.18.5",
|
|
82
|
-
"@aws-sdk/client-s3": "^3.
|
|
104
|
+
"@aws-sdk/client-s3": "^3.1151.0",
|
|
83
105
|
"@eslint/js": "^10.0.1",
|
|
84
|
-
"@langchain/aws": "^1.4.
|
|
85
|
-
"@langchain/langgraph": "^1.
|
|
86
|
-
"@langchain/langgraph-checkpoint-validation": "^1.
|
|
106
|
+
"@langchain/aws": "^1.4.6",
|
|
107
|
+
"@langchain/langgraph": "^1.5.0",
|
|
108
|
+
"@langchain/langgraph-checkpoint-validation": "^1.2.0",
|
|
87
109
|
"@types/jest": "^30.0.0",
|
|
88
|
-
"@types/node": "^26.
|
|
110
|
+
"@types/node": "^26.6.5",
|
|
89
111
|
"@typescript/native": "npm:typescript@^7.0.2",
|
|
90
112
|
"aws-sdk-client-mock": "^4.1.0",
|
|
91
|
-
"
|
|
92
|
-
"eslint": "^10.9.0",
|
|
113
|
+
"eslint": "^10.12.0",
|
|
93
114
|
"eslint-config-prettier": "^10.1.8",
|
|
94
115
|
"eslint-plugin-no-instanceof": "^1.0.1",
|
|
95
|
-
"eslint-plugin-perfectionist": "^5.
|
|
96
|
-
"eslint-plugin-prettier": "^5.5.
|
|
116
|
+
"eslint-plugin-perfectionist": "^5.12.1",
|
|
117
|
+
"eslint-plugin-prettier": "^5.5.7",
|
|
97
118
|
"eslint-plugin-unused-imports": "^4.4.1",
|
|
98
119
|
"expect-type": "^1.4.0",
|
|
99
|
-
"fast-check": "^4.
|
|
100
|
-
"jest": "^30.
|
|
120
|
+
"fast-check": "^4.10.2",
|
|
121
|
+
"jest": "^30.5.2",
|
|
122
|
+
"jest-environment-node": "^30.5.2",
|
|
101
123
|
"jiti": "^2.7.0",
|
|
102
|
-
"jscpd": "^5.
|
|
103
|
-
"knip": "^6.
|
|
104
|
-
"
|
|
105
|
-
"
|
|
106
|
-
"
|
|
107
|
-
"ts-
|
|
124
|
+
"jscpd": "^5.4.1",
|
|
125
|
+
"knip": "^6.41.0",
|
|
126
|
+
"langchain": "^1.5.16",
|
|
127
|
+
"prettier": "^3.9.10",
|
|
128
|
+
"publint": "^0.3.25",
|
|
129
|
+
"ts-jest": "^29.4.14",
|
|
108
130
|
"typedoc": "^0.28.20",
|
|
109
|
-
"typedoc-plugin-markdown": "^4.
|
|
131
|
+
"typedoc-plugin-markdown": "^4.14.0",
|
|
110
132
|
"typescript": "npm:@typescript/typescript6@^6.0.2",
|
|
111
|
-
"typescript-eslint": "^8.
|
|
112
|
-
"zod": "^4.
|
|
133
|
+
"typescript-eslint": "^8.71.2",
|
|
134
|
+
"zod": "^4.6.7"
|
|
113
135
|
},
|
|
114
136
|
"prettier": {
|
|
115
137
|
"semi": true,
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import type { CheckpointerContext } from '../internal/setup';
|
|
2
|
-
/**
|
|
3
|
-
* Delete every checkpoint, payload, and write for a thread (all share the
|
|
4
|
-
* thread's partition), best-effort deleting any offloaded S3 objects. Rows
|
|
5
|
-
* this adapter does not own are left in place and logged, so a shared-table
|
|
6
|
-
* partition holding a foreign row is never collaterally wiped.
|
|
7
|
-
*/
|
|
8
|
-
export declare function deleteThread(context: CheckpointerContext, threadId: string, options?: {
|
|
9
|
-
signal?: AbortSignal;
|
|
10
|
-
}): Promise<void>;
|
|
@@ -1,38 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.deleteThread = deleteThread;
|
|
4
|
-
const partition_delete_1 = require("../../shared/dynamodb/partition-delete");
|
|
5
|
-
const retry_policy_1 = require("../../shared/dynamodb/retry-policy");
|
|
6
|
-
const keys_1 = require("../internal/keys");
|
|
7
|
-
const query_1 = require("../internal/query");
|
|
8
|
-
const validation_1 = require("../internal/validation");
|
|
9
|
-
/** The offloaded payloads a checkpointer row can reference. */
|
|
10
|
-
function descriptorsOf(row) {
|
|
11
|
-
return [
|
|
12
|
-
row.metadata,
|
|
13
|
-
row.checkpoint,
|
|
14
|
-
row.value,
|
|
15
|
-
];
|
|
16
|
-
}
|
|
17
|
-
/**
|
|
18
|
-
* Delete every checkpoint, payload, and write for a thread (all share the
|
|
19
|
-
* thread's partition), best-effort deleting any offloaded S3 objects. Rows
|
|
20
|
-
* this adapter does not own are left in place and logged, so a shared-table
|
|
21
|
-
* partition holding a foreign row is never collaterally wiped.
|
|
22
|
-
*/
|
|
23
|
-
async function deleteThread(context, threadId, options = {}) {
|
|
24
|
-
(0, validation_1.validateThreadId)(threadId);
|
|
25
|
-
await (0, partition_delete_1.deletePartitionRows)({
|
|
26
|
-
client: context.client,
|
|
27
|
-
tableName: context.tableName,
|
|
28
|
-
params: (0, query_1.partitionQuery)(context.tableName, (0, keys_1.partitionKey)(threadId), { consistent: true }),
|
|
29
|
-
logger: context.logger,
|
|
30
|
-
retry: (0, retry_policy_1.retryFor)(context, options.signal),
|
|
31
|
-
signal: options.signal,
|
|
32
|
-
offloader: context.offloader,
|
|
33
|
-
operation: 'deleteThread',
|
|
34
|
-
ownsSortKey: keys_1.isCheckpointerSortKey,
|
|
35
|
-
descriptorsOf,
|
|
36
|
-
scope: [threadId],
|
|
37
|
-
});
|
|
38
|
-
}
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import type { RunnableConfig } from '@langchain/core/runnables';
|
|
2
|
-
import type { CheckpointTuple } from '@langchain/langgraph-checkpoint';
|
|
3
|
-
import type { CheckpointerContext } from '../internal/setup';
|
|
4
|
-
/**
|
|
5
|
-
* Load a checkpoint tuple: the target checkpoint (by id, or the newest in the
|
|
6
|
-
* namespace), its metadata, its pending writes, and a parent config when the
|
|
7
|
-
* checkpoint has a parent. Returns undefined when no matching checkpoint
|
|
8
|
-
* exists — including for a config that names no thread at all, which the
|
|
9
|
-
* reference savers answer with "nothing" rather than an error.
|
|
10
|
-
*/
|
|
11
|
-
export declare function getCheckpointTuple(context: CheckpointerContext, config: RunnableConfig): Promise<CheckpointTuple | undefined>;
|
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.getCheckpointTuple = getCheckpointTuple;
|
|
4
|
-
const assemble_1 = require("../internal/assemble");
|
|
5
|
-
const configurable_1 = require("../internal/configurable");
|
|
6
|
-
const fetch_1 = require("../internal/fetch");
|
|
7
|
-
/**
|
|
8
|
-
* Load a checkpoint tuple: the target checkpoint (by id, or the newest in the
|
|
9
|
-
* namespace), its metadata, its pending writes, and a parent config when the
|
|
10
|
-
* checkpoint has a parent. Returns undefined when no matching checkpoint
|
|
11
|
-
* exists — including for a config that names no thread at all, which the
|
|
12
|
-
* reference savers answer with "nothing" rather than an error.
|
|
13
|
-
*/
|
|
14
|
-
async function getCheckpointTuple(context, config) {
|
|
15
|
-
if (config.configurable?.thread_id === undefined)
|
|
16
|
-
return undefined;
|
|
17
|
-
const { threadId, checkpointNs, checkpointId } = (0, configurable_1.readConfigurable)(config);
|
|
18
|
-
const meta = await (0, fetch_1.fetchTargetMeta)(context, threadId, checkpointNs, checkpointId, config.signal);
|
|
19
|
-
if (!meta)
|
|
20
|
-
return undefined;
|
|
21
|
-
return (0, assemble_1.assembleTuple)(context, threadId, checkpointNs, meta, {
|
|
22
|
-
signal: config.signal,
|
|
23
|
-
consistent: true,
|
|
24
|
-
});
|
|
25
|
-
}
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
import type { RunnableConfig } from '@langchain/core/runnables';
|
|
2
|
-
import type { CheckpointListOptions, CheckpointTuple } from '@langchain/langgraph-checkpoint';
|
|
3
|
-
import type { CheckpointerContext } from '../internal/setup';
|
|
4
|
-
/**
|
|
5
|
-
* Yield checkpoint tuples for a thread, newest first: every namespace when the
|
|
6
|
-
* config names none (grouped by namespace, newest first within each), else the
|
|
7
|
-
* one namespace given. Without a `thread_id` every thread in the table is
|
|
8
|
-
* listed through a table scan, as the reference savers do; that read is
|
|
9
|
-
* unordered across threads and cross-tenant by construction. Honors
|
|
10
|
-
* `options.before` (only checkpoints older than the given id),
|
|
11
|
-
* `options.filter` (metadata equality), and `options.limit` (max tuples
|
|
12
|
-
* yielded; the read stops right after the yield that reaches it).
|
|
13
|
-
*
|
|
14
|
-
* The scan is deliberately unbounded: this generator streams and never
|
|
15
|
-
* accumulates, `limit` returns early, and a raw-row cap would turn a caller
|
|
16
|
-
* asking for a handful of rare matches over a large thread into a hard error
|
|
17
|
-
* instead of the true (possibly empty) answer. Past the warning threshold an
|
|
18
|
-
* operator is told to narrow the filter or pass a limit.
|
|
19
|
-
*/
|
|
20
|
-
export declare function listCheckpoints(context: CheckpointerContext, config: RunnableConfig, options?: CheckpointListOptions): AsyncGenerator<CheckpointTuple>;
|
|
@@ -1,113 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.listCheckpoints = listCheckpoints;
|
|
4
|
-
const clock_1 = require("../../shared/clock");
|
|
5
|
-
const constants_1 = require("../../shared/constants");
|
|
6
|
-
const expiry_1 = require("../../shared/dynamodb/expiry");
|
|
7
|
-
const paginate_1 = require("../../shared/dynamodb/paginate");
|
|
8
|
-
const retry_policy_1 = require("../../shared/dynamodb/retry-policy");
|
|
9
|
-
const scan_1 = require("../../shared/dynamodb/scan");
|
|
10
|
-
const assemble_1 = require("../internal/assemble");
|
|
11
|
-
const fetch_1 = require("../internal/fetch");
|
|
12
|
-
const item_reader_1 = require("../internal/item-reader");
|
|
13
|
-
const list_scope_1 = require("../internal/list-scope");
|
|
14
|
-
/**
|
|
15
|
-
* The tuple for one META item that passes every filter, assembled eventually
|
|
16
|
-
* consistently (a history listing tolerates a replica lag `getTuple` does not)
|
|
17
|
-
* and reusing the metadata the filter already decoded. Undefined when the row
|
|
18
|
-
* is filtered out or its payload is missing.
|
|
19
|
-
*/
|
|
20
|
-
async function tupleFor(context, meta, scope) {
|
|
21
|
-
if (!(0, list_scope_1.passesKeyFilters)(meta, scope))
|
|
22
|
-
return undefined;
|
|
23
|
-
const verdict = await (0, list_scope_1.passesMetadataFilter)(context, meta, scope);
|
|
24
|
-
if (!verdict.pass)
|
|
25
|
-
return undefined;
|
|
26
|
-
return (0, assemble_1.assembleTuple)(context, meta.threadId, meta.checkpointNs, meta, {
|
|
27
|
-
signal: scope.signal,
|
|
28
|
-
consistent: false,
|
|
29
|
-
metadata: verdict.metadata,
|
|
30
|
-
});
|
|
31
|
-
}
|
|
32
|
-
/** A `checkpoint_id` addresses one row: read it directly instead of scanning the namespace for it. */
|
|
33
|
-
async function* listOne(context, scope) {
|
|
34
|
-
const meta = await (0, fetch_1.fetchTargetMeta)(context, scope.threadId, scope.checkpointNs ?? '', scope.checkpointId, scope.signal);
|
|
35
|
-
if (!meta)
|
|
36
|
-
return;
|
|
37
|
-
const tuple = await tupleFor(context, meta, scope);
|
|
38
|
-
if (tuple)
|
|
39
|
-
yield tuple;
|
|
40
|
-
}
|
|
41
|
-
/** Narrow a scanned row, warning about (and skipping) one that is not a checkpoint meta item. */
|
|
42
|
-
function narrowOrWarn(context, raw) {
|
|
43
|
-
const meta = (0, item_reader_1.narrowMetaItem)(raw);
|
|
44
|
-
if (!meta) {
|
|
45
|
-
context.logger.warn('list: skipped a row that is not a checkpoint meta item', {
|
|
46
|
-
sortKey: raw.SK,
|
|
47
|
-
});
|
|
48
|
-
}
|
|
49
|
-
return meta;
|
|
50
|
-
}
|
|
51
|
-
/** The META rows a scope covers: a partition query for a thread, a table scan without one. */
|
|
52
|
-
function metaRows(context, scope, now) {
|
|
53
|
-
const retry = (0, retry_policy_1.retryFor)(context, scope.signal);
|
|
54
|
-
const bounds = { maxItems: Number.POSITIVE_INFINITY, maxIterations: Number.POSITIVE_INFINITY };
|
|
55
|
-
return scope.threadId === undefined
|
|
56
|
-
? (0, scan_1.paginateScan)({
|
|
57
|
-
retry,
|
|
58
|
-
signal: scope.signal,
|
|
59
|
-
client: context.client,
|
|
60
|
-
params: (0, expiry_1.withoutExpired)((0, list_scope_1.listScan)(context, scope), now),
|
|
61
|
-
...bounds,
|
|
62
|
-
})
|
|
63
|
-
: (0, paginate_1.paginateQuery)({
|
|
64
|
-
retry,
|
|
65
|
-
signal: scope.signal,
|
|
66
|
-
client: context.client,
|
|
67
|
-
params: (0, expiry_1.withoutExpired)((0, list_scope_1.listQuery)(context, { ...scope, threadId: scope.threadId }), now),
|
|
68
|
-
...bounds,
|
|
69
|
-
});
|
|
70
|
-
}
|
|
71
|
-
/**
|
|
72
|
-
* Yield checkpoint tuples for a thread, newest first: every namespace when the
|
|
73
|
-
* config names none (grouped by namespace, newest first within each), else the
|
|
74
|
-
* one namespace given. Without a `thread_id` every thread in the table is
|
|
75
|
-
* listed through a table scan, as the reference savers do; that read is
|
|
76
|
-
* unordered across threads and cross-tenant by construction. Honors
|
|
77
|
-
* `options.before` (only checkpoints older than the given id),
|
|
78
|
-
* `options.filter` (metadata equality), and `options.limit` (max tuples
|
|
79
|
-
* yielded; the read stops right after the yield that reaches it).
|
|
80
|
-
*
|
|
81
|
-
* The scan is deliberately unbounded: this generator streams and never
|
|
82
|
-
* accumulates, `limit` returns early, and a raw-row cap would turn a caller
|
|
83
|
-
* asking for a handful of rare matches over a large thread into a hard error
|
|
84
|
-
* instead of the true (possibly empty) answer. Past the warning threshold an
|
|
85
|
-
* operator is told to narrow the filter or pass a limit.
|
|
86
|
-
*/
|
|
87
|
-
async function* listCheckpoints(context, config, options) {
|
|
88
|
-
const scope = (0, list_scope_1.readListScope)(config, options);
|
|
89
|
-
if (scope.threadId !== undefined && scope.checkpointId !== undefined) {
|
|
90
|
-
yield* listOne(context, { ...scope, threadId: scope.threadId });
|
|
91
|
-
return;
|
|
92
|
-
}
|
|
93
|
-
const now = (0, clock_1.nowSeconds)();
|
|
94
|
-
let yielded = 0;
|
|
95
|
-
let scanned = 0;
|
|
96
|
-
for await (const raw of metaRows(context, scope, now)) {
|
|
97
|
-
scanned += 1;
|
|
98
|
-
if (scanned === constants_1.LIST_SCAN_WARN_THRESHOLD) {
|
|
99
|
-
context.logger.warn('list: scanned a large number of rows without the caller stopping; this read is ' +
|
|
100
|
-
'deliberately unbounded, so narrow the filter or pass options.limit', { threadId: scope.threadId, checkpointNs: scope.checkpointNs, scanned });
|
|
101
|
-
}
|
|
102
|
-
const meta = narrowOrWarn(context, raw);
|
|
103
|
-
if (!meta || (0, expiry_1.isExpiredRow)(meta, now))
|
|
104
|
-
continue;
|
|
105
|
-
const tuple = await tupleFor(context, meta, scope);
|
|
106
|
-
if (!tuple)
|
|
107
|
-
continue;
|
|
108
|
-
yield tuple;
|
|
109
|
-
yielded += 1;
|
|
110
|
-
if (scope.limit !== undefined && yielded >= scope.limit)
|
|
111
|
-
return;
|
|
112
|
-
}
|
|
113
|
-
}
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
import type { RunnableConfig } from '@langchain/core/runnables';
|
|
2
|
-
import type { PendingWrite } from '@langchain/langgraph-checkpoint';
|
|
3
|
-
import type { CheckpointerContext } from '../internal/setup';
|
|
4
|
-
/**
|
|
5
|
-
* Persist a task's intermediate writes for a checkpoint as one item per write.
|
|
6
|
-
* Requires `checkpoint_id` in the config — writes always attach to a checkpoint.
|
|
7
|
-
* Regular writes are first-write-wins (matching the reference checkpointer
|
|
8
|
-
* contract); special negative-index writes always overwrite (see
|
|
9
|
-
* {@link writeSpecialItemsWithCleanup}). Regular-write cleanup only ever
|
|
10
|
-
* targets uploads confirmed unreferenced (see {@link writeRegularItems}): a
|
|
11
|
-
* verified non-commit, or a guard rejection whose returned row provably
|
|
12
|
-
* belongs to another call. An upload can leak but a live row can never be
|
|
13
|
-
* stranded pointing at a deleted object.
|
|
14
|
-
*/
|
|
15
|
-
export declare function putWrites(context: CheckpointerContext, config: RunnableConfig, writes: PendingWrite[], taskId: string): Promise<void>;
|
|
@@ -1,62 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.putWrites = putWrites;
|
|
4
|
-
const descriptor_keys_1 = require("../../shared/codec/descriptor-keys");
|
|
5
|
-
const orphans_1 = require("../../shared/codec/s3/orphans");
|
|
6
|
-
const errors_1 = require("../../shared/errors/errors");
|
|
7
|
-
const ulid_1 = require("../../shared/ulid");
|
|
8
|
-
const ttl_1 = require("../../shared/validation/ttl");
|
|
9
|
-
const configurable_1 = require("../internal/configurable");
|
|
10
|
-
const item_writer_1 = require("../internal/item-writer");
|
|
11
|
-
const regular_write_1 = require("../internal/regular-write");
|
|
12
|
-
const special_write_cleanup_1 = require("../internal/special-write-cleanup");
|
|
13
|
-
const validation_1 = require("../internal/validation");
|
|
14
|
-
/**
|
|
15
|
-
* Stamps each `putWrites` call, serving two purposes at once. It nonces every
|
|
16
|
-
* S3 upload, so a repeated write never shares an object with an earlier
|
|
17
|
-
* attempt. And because ULIDs are lexicographically time-ordered — and this
|
|
18
|
-
* factory is strictly monotonic even within a single millisecond — it lets the
|
|
19
|
-
* read side identify the *earliest* call that wrote a given channel (see
|
|
20
|
-
* `dropSupersededWrites`). A random UUID nonces just as well but carries no
|
|
21
|
-
* ordering, which would leave that choice arbitrary.
|
|
22
|
-
*/
|
|
23
|
-
const nextWriteGroup = (0, ulid_1.createUlidFactory)();
|
|
24
|
-
/** Best-effort delete `items`' offloaded S3 objects, if an offloader is configured. */
|
|
25
|
-
async function cleanUpItems(context, items) {
|
|
26
|
-
if (!context.offloader)
|
|
27
|
-
return;
|
|
28
|
-
await (0, orphans_1.cleanUpS3Orphans)(context.offloader, (0, descriptor_keys_1.collectS3Keys)(items.map((item) => item.value)), 'putWrites', context.logger);
|
|
29
|
-
}
|
|
30
|
-
/**
|
|
31
|
-
* Persist a task's intermediate writes for a checkpoint as one item per write.
|
|
32
|
-
* Requires `checkpoint_id` in the config — writes always attach to a checkpoint.
|
|
33
|
-
* Regular writes are first-write-wins (matching the reference checkpointer
|
|
34
|
-
* contract); special negative-index writes always overwrite (see
|
|
35
|
-
* {@link writeSpecialItemsWithCleanup}). Regular-write cleanup only ever
|
|
36
|
-
* targets uploads confirmed unreferenced (see {@link writeRegularItems}): a
|
|
37
|
-
* verified non-commit, or a guard rejection whose returned row provably
|
|
38
|
-
* belongs to another call. An upload can leak but a live row can never be
|
|
39
|
-
* stranded pointing at a deleted object.
|
|
40
|
-
*/
|
|
41
|
-
async function putWrites(context, config, writes, taskId) {
|
|
42
|
-
(0, validation_1.validateTaskId)(taskId);
|
|
43
|
-
const { threadId, checkpointNs, checkpointId } = (0, configurable_1.readConfigurable)(config);
|
|
44
|
-
const signal = config.signal;
|
|
45
|
-
if (checkpointId === undefined) {
|
|
46
|
-
throw new errors_1.ValidationError('checkpoint_id is required to store writes', 'checkpoint_id');
|
|
47
|
-
}
|
|
48
|
-
if (writes.length === 0)
|
|
49
|
-
return;
|
|
50
|
-
const ttlTimestamp = context.ttl ? (0, ttl_1.calculateTtlTimestamp)(context.ttl) : undefined;
|
|
51
|
-
const items = await (0, item_writer_1.buildWriteItems)(context, threadId, checkpointNs, checkpointId, taskId, writes, nextWriteGroup(), ttlTimestamp);
|
|
52
|
-
const special = items.filter((item) => item.index < 0);
|
|
53
|
-
const regular = items.filter((item) => item.index >= 0);
|
|
54
|
-
const [specialError, regularOutcome] = await Promise.all([
|
|
55
|
-
(0, special_write_cleanup_1.writeSpecialItemsWithCleanup)(context, threadId, special, signal),
|
|
56
|
-
(0, regular_write_1.writeRegularItems)(context, regular, signal),
|
|
57
|
-
]);
|
|
58
|
-
await cleanUpItems(context, regularOutcome.deadUploads);
|
|
59
|
-
const firstError = specialError ?? regularOutcome.error;
|
|
60
|
-
if (firstError)
|
|
61
|
-
throw firstError;
|
|
62
|
-
}
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
import type { RunnableConfig } from '@langchain/core/runnables';
|
|
2
|
-
import type { ChannelVersions, Checkpoint, CheckpointMetadata } from '@langchain/langgraph-checkpoint';
|
|
3
|
-
import type { CheckpointerContext } from '../internal/setup';
|
|
4
|
-
/**
|
|
5
|
-
* Persist a checkpoint and its metadata as a transactional pair of META and
|
|
6
|
-
* PAYLOAD items, returning the config that addresses the stored checkpoint. The
|
|
7
|
-
* incoming `checkpoint_id` (if any) becomes the new checkpoint's parent.
|
|
8
|
-
* `newVersions` names the channels that changed in this step: only those and
|
|
9
|
-
* the ones the parent stored are persisted (see `storedChannelsFor`).
|
|
10
|
-
*
|
|
11
|
-
* On failure with S3 offload configured, the rows are read back before any
|
|
12
|
-
* upload is deleted (see {@link verifyCheckpointLanded}): a transaction that
|
|
13
|
-
* committed and lost its response is reported as success, a confirmed
|
|
14
|
-
* non-commit cleans up this call's own nonced uploads, and an unverifiable
|
|
15
|
-
* outcome leaks them rather than risk stranding a live row.
|
|
16
|
-
*/
|
|
17
|
-
export declare function putCheckpoint(context: CheckpointerContext, config: RunnableConfig, checkpoint: Checkpoint, metadata: CheckpointMetadata, newVersions?: ChannelVersions): Promise<RunnableConfig>;
|
|
@@ -1,73 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.putCheckpoint = putCheckpoint;
|
|
4
|
-
const descriptor_keys_1 = require("../../shared/codec/descriptor-keys");
|
|
5
|
-
const orphans_1 = require("../../shared/codec/s3/orphans");
|
|
6
|
-
const retry_1 = require("../../shared/dynamodb/retry");
|
|
7
|
-
const retry_policy_1 = require("../../shared/dynamodb/retry-policy");
|
|
8
|
-
const ulid_1 = require("../../shared/ulid");
|
|
9
|
-
const ttl_1 = require("../../shared/validation/ttl");
|
|
10
|
-
const checkpoint_write_verify_1 = require("../internal/checkpoint-write-verify");
|
|
11
|
-
const configurable_1 = require("../internal/configurable");
|
|
12
|
-
const item_writer_1 = require("../internal/item-writer");
|
|
13
|
-
const stored_channels_1 = require("../internal/stored-channels");
|
|
14
|
-
const validation_1 = require("../internal/validation");
|
|
15
|
-
/**
|
|
16
|
-
* Nonces every put's S3 uploads (see {@link buildCheckpointItems}). A ULID
|
|
17
|
-
* rather than a UUID because it sorts by time, which keeps a bucket listing of
|
|
18
|
-
* one checkpoint's objects readable.
|
|
19
|
-
*/
|
|
20
|
-
const nextPutNonce = (0, ulid_1.createUlidFactory)();
|
|
21
|
-
/**
|
|
22
|
-
* Persist a checkpoint and its metadata as a transactional pair of META and
|
|
23
|
-
* PAYLOAD items, returning the config that addresses the stored checkpoint. The
|
|
24
|
-
* incoming `checkpoint_id` (if any) becomes the new checkpoint's parent.
|
|
25
|
-
* `newVersions` names the channels that changed in this step: only those and
|
|
26
|
-
* the ones the parent stored are persisted (see `storedChannelsFor`).
|
|
27
|
-
*
|
|
28
|
-
* On failure with S3 offload configured, the rows are read back before any
|
|
29
|
-
* upload is deleted (see {@link verifyCheckpointLanded}): a transaction that
|
|
30
|
-
* committed and lost its response is reported as success, a confirmed
|
|
31
|
-
* non-commit cleans up this call's own nonced uploads, and an unverifiable
|
|
32
|
-
* outcome leaks them rather than risk stranding a live row.
|
|
33
|
-
*/
|
|
34
|
-
async function putCheckpoint(context, config, checkpoint, metadata, newVersions) {
|
|
35
|
-
const { threadId, checkpointNs, checkpointId: parentCheckpointId } = (0, configurable_1.readConfigurable)(config);
|
|
36
|
-
const signal = config.signal;
|
|
37
|
-
(0, validation_1.validateCheckpointId)(checkpoint.id);
|
|
38
|
-
const ttlTimestamp = context.ttl ? (0, ttl_1.calculateTtlTimestamp)(context.ttl) : undefined;
|
|
39
|
-
const storedChannels = await (0, stored_channels_1.storedChannelsFor)(context, threadId, checkpointNs, checkpoint, newVersions, parentCheckpointId, signal);
|
|
40
|
-
const { meta, payload } = await (0, item_writer_1.buildCheckpointItems)(context, threadId, checkpointNs, checkpoint, metadata, nextPutNonce(), parentCheckpointId, ttlTimestamp, storedChannels);
|
|
41
|
-
const stored = {
|
|
42
|
-
configurable: {
|
|
43
|
-
thread_id: threadId,
|
|
44
|
-
checkpoint_ns: checkpointNs,
|
|
45
|
-
checkpoint_id: checkpoint.id,
|
|
46
|
-
},
|
|
47
|
-
};
|
|
48
|
-
try {
|
|
49
|
-
await (0, retry_1.withDynamoDBRetry)(() => context.client.transactWrite({
|
|
50
|
-
TransactItems: [
|
|
51
|
-
{ Put: { TableName: context.tableName, Item: meta } },
|
|
52
|
-
{ Put: { TableName: context.tableName, Item: payload } },
|
|
53
|
-
],
|
|
54
|
-
}), (0, retry_policy_1.retryFor)(context, signal));
|
|
55
|
-
}
|
|
56
|
-
catch (error) {
|
|
57
|
-
if (!context.offloader)
|
|
58
|
-
throw error;
|
|
59
|
-
const verdict = await (0, checkpoint_write_verify_1.verifyCheckpointLanded)(context, meta, payload);
|
|
60
|
-
if (verdict === 'landed') {
|
|
61
|
-
context.logger.debug('put: transaction committed although its response was lost', {
|
|
62
|
-
threadId,
|
|
63
|
-
checkpointId: checkpoint.id,
|
|
64
|
-
});
|
|
65
|
-
return stored;
|
|
66
|
-
}
|
|
67
|
-
if (verdict === 'not-landed') {
|
|
68
|
-
await (0, orphans_1.cleanUpS3Orphans)(context.offloader, (0, descriptor_keys_1.collectS3Keys)([meta.metadata, payload.checkpoint]), 'put', context.logger);
|
|
69
|
-
}
|
|
70
|
-
throw error;
|
|
71
|
-
}
|
|
72
|
-
return stored;
|
|
73
|
-
}
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
import type { CheckpointMetadata, CheckpointTuple } from '@langchain/langgraph-checkpoint';
|
|
2
|
-
import type { CheckpointMetaItem } from '../types';
|
|
3
|
-
import type { CheckpointerContext } from './setup';
|
|
4
|
-
/** How a tuple is assembled: cancellation, read consistency, and metadata already decoded by the caller. */
|
|
5
|
-
export interface AssembleOptions {
|
|
6
|
-
signal?: AbortSignal;
|
|
7
|
-
/** `true` for `getTuple` (read-your-writes), `false` for the eventually-consistent `list` path. */
|
|
8
|
-
consistent: boolean;
|
|
9
|
-
/** Metadata the caller decoded to apply a filter, so it is not decoded (or downloaded) twice. */
|
|
10
|
-
metadata?: CheckpointMetadata;
|
|
11
|
-
}
|
|
12
|
-
/**
|
|
13
|
-
* Assemble a full {@link CheckpointTuple} from a META item: fetch and decode its
|
|
14
|
-
* payload, metadata, and pending writes, attaching a parent config when present.
|
|
15
|
-
* Returns undefined when the payload item is missing (inconsistent state).
|
|
16
|
-
*/
|
|
17
|
-
export declare function assembleTuple(context: CheckpointerContext, threadId: string, checkpointNs: string, meta: CheckpointMetaItem, options: AssembleOptions): Promise<CheckpointTuple | undefined>;
|
|
@@ -1,38 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.assembleTuple = assembleTuple;
|
|
4
|
-
const fetch_1 = require("./fetch");
|
|
5
|
-
const item_reader_1 = require("./item-reader");
|
|
6
|
-
const pending_sends_1 = require("./pending-sends");
|
|
7
|
-
/** Build a config that addresses a specific checkpoint. */
|
|
8
|
-
function configFor(threadId, checkpointNs, checkpointId) {
|
|
9
|
-
return {
|
|
10
|
-
configurable: { thread_id: threadId, checkpoint_ns: checkpointNs, checkpoint_id: checkpointId },
|
|
11
|
-
};
|
|
12
|
-
}
|
|
13
|
-
/**
|
|
14
|
-
* Assemble a full {@link CheckpointTuple} from a META item: fetch and decode its
|
|
15
|
-
* payload, metadata, and pending writes, attaching a parent config when present.
|
|
16
|
-
* Returns undefined when the payload item is missing (inconsistent state).
|
|
17
|
-
*/
|
|
18
|
-
async function assembleTuple(context, threadId, checkpointNs, meta, options) {
|
|
19
|
-
const read = { signal: options.signal, consistent: options.consistent };
|
|
20
|
-
const payload = await (0, fetch_1.fetchPayload)(context, threadId, checkpointNs, meta.checkpointId, read);
|
|
21
|
-
if (!payload)
|
|
22
|
-
return undefined;
|
|
23
|
-
const [checkpoint, metadata, pendingWrites] = await Promise.all([
|
|
24
|
-
(0, item_reader_1.readCheckpoint)(context, payload, threadId).then((stored) => (0, pending_sends_1.migratePendingSends)(context, stored, threadId, checkpointNs, meta.parentCheckpointId, read)),
|
|
25
|
-
options.metadata ?? (0, item_reader_1.readMetadata)(context, meta, threadId),
|
|
26
|
-
(0, fetch_1.fetchPendingWrites)(context, threadId, checkpointNs, meta.checkpointId, read),
|
|
27
|
-
]);
|
|
28
|
-
const tuple = {
|
|
29
|
-
config: configFor(threadId, checkpointNs, meta.checkpointId),
|
|
30
|
-
checkpoint,
|
|
31
|
-
metadata,
|
|
32
|
-
pendingWrites,
|
|
33
|
-
};
|
|
34
|
-
if (meta.parentCheckpointId !== undefined) {
|
|
35
|
-
tuple.parentConfig = configFor(threadId, checkpointNs, meta.parentCheckpointId);
|
|
36
|
-
}
|
|
37
|
-
return tuple;
|
|
38
|
-
}
|