@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
|
@@ -1,117 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.MIN_ENCODABLE_WRITE_INDEX = exports.SORT_KEY_SEPARATOR = void 0;
|
|
4
|
-
exports.checkpointerPartitionPrefix = checkpointerPartitionPrefix;
|
|
5
|
-
exports.partitionKey = partitionKey;
|
|
6
|
-
exports.metaSortKey = metaSortKey;
|
|
7
|
-
exports.metaSortKeyPrefix = metaSortKeyPrefix;
|
|
8
|
-
exports.metaAnyNamespacePrefix = metaAnyNamespacePrefix;
|
|
9
|
-
exports.payloadSortKey = payloadSortKey;
|
|
10
|
-
exports.writeSortKey = writeSortKey;
|
|
11
|
-
exports.isCheckpointerSortKey = isCheckpointerSortKey;
|
|
12
|
-
exports.writeSortKeyPrefix = writeSortKeyPrefix;
|
|
13
|
-
const constants_1 = require("../../shared/constants");
|
|
14
|
-
const errors_1 = require("../../shared/errors/errors");
|
|
15
|
-
/** Reserved separator joining sort-key segments; forbidden inside any segment. */
|
|
16
|
-
exports.SORT_KEY_SEPARATOR = '#';
|
|
17
|
-
/** Fixed digit width for the WRITE index so sort keys order numerically. */
|
|
18
|
-
const WRITE_INDEX_PAD_WIDTH = 10;
|
|
19
|
-
/**
|
|
20
|
-
* Added to every write index before padding so the special negative slots from
|
|
21
|
-
* `WRITES_IDX_MAP` (-1 ERROR .. -4 RESUME) encode as non-negative, sortable
|
|
22
|
-
* integers that order below positional (0+) writes.
|
|
23
|
-
*/
|
|
24
|
-
const WRITE_INDEX_OFFSET = 8;
|
|
25
|
-
/**
|
|
26
|
-
* The most negative write index the sort key can encode, `-WRITE_INDEX_OFFSET`.
|
|
27
|
-
* A static test pins it against the peer's `WRITES_IDX_MAP`, so a peer bump
|
|
28
|
-
* that adds a more negative special slot fails loudly instead of producing
|
|
29
|
-
* unsortable keys.
|
|
30
|
-
*/
|
|
31
|
-
exports.MIN_ENCODABLE_WRITE_INDEX = -WRITE_INDEX_OFFSET;
|
|
32
|
-
/** Sort-key kinds for the checkpoints table (the approved SK separation). */
|
|
33
|
-
var CheckpointItemKind;
|
|
34
|
-
(function (CheckpointItemKind) {
|
|
35
|
-
CheckpointItemKind["META"] = "META";
|
|
36
|
-
CheckpointItemKind["PAYLOAD"] = "PAYLOAD";
|
|
37
|
-
CheckpointItemKind["WRITE"] = "WRITE";
|
|
38
|
-
})(CheckpointItemKind || (CheckpointItemKind = {}));
|
|
39
|
-
/**
|
|
40
|
-
* Adapter tag prefixed to every checkpointer partition key. Without it a
|
|
41
|
-
* `thread_id` reused as a `sessionId` or a store namespace root — an ordinary
|
|
42
|
-
* design choice — put all three adapters' rows in one partition on a table
|
|
43
|
-
* shared via `DynamoDBFactory.createAll()`, where a partition-wide delete
|
|
44
|
-
* reached another adapter's data and composed sort keys could collide
|
|
45
|
-
* byte-for-byte. The three tags differ in their first character, so the key
|
|
46
|
-
* spaces are disjoint by construction.
|
|
47
|
-
*/
|
|
48
|
-
const ADAPTER_PARTITION_PREFIX = `CHKPT${exports.SORT_KEY_SEPARATOR}`;
|
|
49
|
-
/** The tag every checkpointer partition key starts with, for a table-wide `begins_with`. */
|
|
50
|
-
function checkpointerPartitionPrefix() {
|
|
51
|
-
return ADAPTER_PARTITION_PREFIX;
|
|
52
|
-
}
|
|
53
|
-
/** Partition key for a thread: the adapter tag plus the thread id. */
|
|
54
|
-
function partitionKey(threadId) {
|
|
55
|
-
return `${ADAPTER_PARTITION_PREFIX}${threadId}`;
|
|
56
|
-
}
|
|
57
|
-
/** Sort key for a checkpoint's lightweight metadata item. */
|
|
58
|
-
function metaSortKey(checkpointNs, checkpointId) {
|
|
59
|
-
return `${CheckpointItemKind.META}${exports.SORT_KEY_SEPARATOR}${checkpointNs}${exports.SORT_KEY_SEPARATOR}${checkpointId}`;
|
|
60
|
-
}
|
|
61
|
-
/** `begins_with` prefix selecting every META item in a namespace (for list). */
|
|
62
|
-
function metaSortKeyPrefix(checkpointNs) {
|
|
63
|
-
return `${CheckpointItemKind.META}${exports.SORT_KEY_SEPARATOR}${checkpointNs}${exports.SORT_KEY_SEPARATOR}`;
|
|
64
|
-
}
|
|
65
|
-
/** `begins_with` prefix selecting every META item of a thread, whatever its namespace. */
|
|
66
|
-
function metaAnyNamespacePrefix() {
|
|
67
|
-
return `${CheckpointItemKind.META}${exports.SORT_KEY_SEPARATOR}`;
|
|
68
|
-
}
|
|
69
|
-
/** Sort key for a checkpoint's heavy payload item. */
|
|
70
|
-
function payloadSortKey(checkpointNs, checkpointId) {
|
|
71
|
-
return `${CheckpointItemKind.PAYLOAD}${exports.SORT_KEY_SEPARATOR}${checkpointNs}${exports.SORT_KEY_SEPARATOR}${checkpointId}`;
|
|
72
|
-
}
|
|
73
|
-
/**
|
|
74
|
-
* Sort key for a single pending write. The trailing `channel` segment is what
|
|
75
|
-
* keeps two *different* channels from ever occupying one row: without it, a
|
|
76
|
-
* retried task whose write mix changed could compute an index another
|
|
77
|
-
* channel already holds, and the first-write-wins guard — which cannot tell a
|
|
78
|
-
* genuine retry from an unrelated write — would silently discard it. The
|
|
79
|
-
* channel is appended verbatim as the final segment, so two sort keys collide
|
|
80
|
-
* only when their channels are byte-identical; `writeSortKeyPrefix` stops at
|
|
81
|
-
* the checkpoint id, ahead of this segment, so `begins_with` reads are
|
|
82
|
-
* unaffected.
|
|
83
|
-
*/
|
|
84
|
-
function writeSortKey(checkpointNs, checkpointId, taskId, index, channel) {
|
|
85
|
-
const offsetIndex = index + WRITE_INDEX_OFFSET;
|
|
86
|
-
if (offsetIndex < 0 || offsetIndex.toString().length > WRITE_INDEX_PAD_WIDTH) {
|
|
87
|
-
throw new errors_1.ValidationError(`write index ${index} is outside the range encodable at offset ${WRITE_INDEX_OFFSET} ` +
|
|
88
|
-
`with ${WRITE_INDEX_PAD_WIDTH} digits`, 'index');
|
|
89
|
-
}
|
|
90
|
-
const paddedIndex = offsetIndex.toString().padStart(WRITE_INDEX_PAD_WIDTH, '0');
|
|
91
|
-
const sortKey = [
|
|
92
|
-
CheckpointItemKind.WRITE,
|
|
93
|
-
checkpointNs,
|
|
94
|
-
checkpointId,
|
|
95
|
-
taskId,
|
|
96
|
-
paddedIndex,
|
|
97
|
-
channel,
|
|
98
|
-
].join(exports.SORT_KEY_SEPARATOR);
|
|
99
|
-
const bytes = Buffer.byteLength(sortKey, 'utf8');
|
|
100
|
-
if (bytes > constants_1.MAX_SORT_KEY_BYTES) {
|
|
101
|
-
throw new errors_1.ValidationError(`checkpoint_ns, checkpoint_id, taskId and channel compose a ${bytes}-byte sort key; ` +
|
|
102
|
-
`DynamoDB caps sort keys at ${constants_1.MAX_SORT_KEY_BYTES} bytes`, 'sortKey');
|
|
103
|
-
}
|
|
104
|
-
return sortKey;
|
|
105
|
-
}
|
|
106
|
-
/**
|
|
107
|
-
* True when `sortKey` is one this adapter writes. A partition query carries no
|
|
108
|
-
* sort-key condition, so a partition-wide delete uses this to leave any row it
|
|
109
|
-
* does not own in place rather than deleting the whole partition blindly.
|
|
110
|
-
*/
|
|
111
|
-
function isCheckpointerSortKey(sortKey) {
|
|
112
|
-
return Object.values(CheckpointItemKind).some((kind) => sortKey.startsWith(`${kind}${exports.SORT_KEY_SEPARATOR}`));
|
|
113
|
-
}
|
|
114
|
-
/** `begins_with` prefix selecting every WRITE item for one checkpoint. */
|
|
115
|
-
function writeSortKeyPrefix(checkpointNs, checkpointId) {
|
|
116
|
-
return `${CheckpointItemKind.WRITE}${exports.SORT_KEY_SEPARATOR}${checkpointNs}${exports.SORT_KEY_SEPARATOR}${checkpointId}${exports.SORT_KEY_SEPARATOR}`;
|
|
117
|
-
}
|
|
@@ -1,61 +0,0 @@
|
|
|
1
|
-
import type { QueryCommandInput, ScanCommandInput } from '@aws-sdk/lib-dynamodb';
|
|
2
|
-
import type { RunnableConfig } from '@langchain/core/runnables';
|
|
3
|
-
import type { CheckpointListOptions, CheckpointMetadata } from '@langchain/langgraph-checkpoint';
|
|
4
|
-
import type { CheckpointMetaItem } from '../types';
|
|
5
|
-
import { type FilterValue } from './filter-match';
|
|
6
|
-
import type { CheckpointerContext } from './setup';
|
|
7
|
-
/** What one `list()` call covers, read once from its config and options. */
|
|
8
|
-
export interface ListScope {
|
|
9
|
-
/** Undefined when the caller gave no `thread_id`: every thread in the table is listed. */
|
|
10
|
-
threadId: string | undefined;
|
|
11
|
-
/** Undefined when the caller gave no `checkpoint_ns`: every namespace of the thread is listed. */
|
|
12
|
-
checkpointNs: string | undefined;
|
|
13
|
-
checkpointId: string | undefined;
|
|
14
|
-
before: string | undefined;
|
|
15
|
-
filter: Record<string, FilterValue> | undefined;
|
|
16
|
-
limit: number | undefined;
|
|
17
|
-
signal: AbortSignal | undefined;
|
|
18
|
-
}
|
|
19
|
-
/**
|
|
20
|
-
* Read the scope. Unlike `getTuple`, which addresses the root namespace when
|
|
21
|
-
* none is given, `list()` without a `checkpoint_ns` covers every namespace,
|
|
22
|
-
* and without a `thread_id` every thread, as the reference savers do; the
|
|
23
|
-
* identifiers that are given are validated either way.
|
|
24
|
-
*/
|
|
25
|
-
export declare function readListScope(config: RunnableConfig, options?: CheckpointListOptions): ListScope;
|
|
26
|
-
/**
|
|
27
|
-
* The META query for a scope. A metadata filter means rows may be dropped
|
|
28
|
-
* client-side, so only an unfiltered list passes the caller's limit through as
|
|
29
|
-
* the page size. With an explicit namespace `before` bounds the key range so
|
|
30
|
-
* rows newer than it are never read; across namespaces ids do not share one
|
|
31
|
-
* order and `before` is applied in-process.
|
|
32
|
-
*/
|
|
33
|
-
export declare function listQuery(context: CheckpointerContext, scope: ListScope & {
|
|
34
|
-
threadId: string;
|
|
35
|
-
}): QueryCommandInput;
|
|
36
|
-
/**
|
|
37
|
-
* The table `Scan` a thread-less `list()` runs: every checkpointer META row,
|
|
38
|
-
* narrowed to one namespace when the caller gave one. It is what the
|
|
39
|
-
* reference savers do for a config without a thread, and on DynamoDB it costs
|
|
40
|
-
* a read of the whole table.
|
|
41
|
-
*/
|
|
42
|
-
export declare function listScan(context: CheckpointerContext, scope: ListScope): ScanCommandInput;
|
|
43
|
-
/**
|
|
44
|
-
* True when `meta` passes the key-level filters: strictly older than `before`,
|
|
45
|
-
* and — on a table scan, where the key condition cannot narrow them — in the
|
|
46
|
-
* requested namespace and, when one is given, the requested checkpoint.
|
|
47
|
-
*/
|
|
48
|
-
export declare function passesKeyFilters(meta: CheckpointMetaItem, scope: ListScope): boolean;
|
|
49
|
-
/** Outcome of the metadata filter: rejected, or accepted with any metadata decoded on the way. */
|
|
50
|
-
export type MetadataVerdict = {
|
|
51
|
-
pass: false;
|
|
52
|
-
} | {
|
|
53
|
-
pass: true;
|
|
54
|
-
metadata?: CheckpointMetadata;
|
|
55
|
-
};
|
|
56
|
-
/**
|
|
57
|
-
* Apply the optional metadata-equality filter. The metadata decoded here is
|
|
58
|
-
* handed to the tuple assembly, so a filtered list decodes (and, when offloaded,
|
|
59
|
-
* downloads) each metadata blob once instead of twice.
|
|
60
|
-
*/
|
|
61
|
-
export declare function passesMetadataFilter(context: CheckpointerContext, meta: CheckpointMetaItem, scope: ListScope): Promise<MetadataVerdict>;
|
|
@@ -1,108 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.readListScope = readListScope;
|
|
4
|
-
exports.listQuery = listQuery;
|
|
5
|
-
exports.listScan = listScan;
|
|
6
|
-
exports.passesKeyFilters = passesKeyFilters;
|
|
7
|
-
exports.passesMetadataFilter = passesMetadataFilter;
|
|
8
|
-
const configurable_1 = require("./configurable");
|
|
9
|
-
const filter_match_1 = require("./filter-match");
|
|
10
|
-
const item_reader_1 = require("./item-reader");
|
|
11
|
-
const keys_1 = require("./keys");
|
|
12
|
-
const query_1 = require("./query");
|
|
13
|
-
const validation_1 = require("./validation");
|
|
14
|
-
/** The identifiers of a config that names no thread, validated the same way. */
|
|
15
|
-
function readThreadless(config) {
|
|
16
|
-
const checkpointNs = config.configurable?.checkpoint_ns ?? '';
|
|
17
|
-
(0, validation_1.validateCheckpointNs)(checkpointNs);
|
|
18
|
-
const rawId = config.configurable?.checkpoint_id;
|
|
19
|
-
const checkpointId = rawId ? rawId : undefined;
|
|
20
|
-
if (checkpointId !== undefined)
|
|
21
|
-
(0, validation_1.validateCheckpointId)(checkpointId);
|
|
22
|
-
return { threadId: '', checkpointNs, checkpointId };
|
|
23
|
-
}
|
|
24
|
-
/** The identifiers a list config names; a config without a thread is still validated for the ids it gives. */
|
|
25
|
-
function resolveListIds(config) {
|
|
26
|
-
if (config.configurable?.thread_id === undefined) {
|
|
27
|
-
return { ...readThreadless(config), threadId: undefined };
|
|
28
|
-
}
|
|
29
|
-
return (0, configurable_1.readConfigurable)(config);
|
|
30
|
-
}
|
|
31
|
-
/**
|
|
32
|
-
* Read the scope. Unlike `getTuple`, which addresses the root namespace when
|
|
33
|
-
* none is given, `list()` without a `checkpoint_ns` covers every namespace,
|
|
34
|
-
* and without a `thread_id` every thread, as the reference savers do; the
|
|
35
|
-
* identifiers that are given are validated either way.
|
|
36
|
-
*/
|
|
37
|
-
function readListScope(config, options) {
|
|
38
|
-
const { threadId, checkpointNs, checkpointId } = resolveListIds(config);
|
|
39
|
-
return {
|
|
40
|
-
threadId,
|
|
41
|
-
checkpointNs: config.configurable?.checkpoint_ns === undefined ? undefined : checkpointNs,
|
|
42
|
-
checkpointId,
|
|
43
|
-
before: options?.before?.configurable?.checkpoint_id,
|
|
44
|
-
filter: options?.filter,
|
|
45
|
-
limit: options?.limit,
|
|
46
|
-
signal: config.signal,
|
|
47
|
-
};
|
|
48
|
-
}
|
|
49
|
-
/**
|
|
50
|
-
* The META query for a scope. A metadata filter means rows may be dropped
|
|
51
|
-
* client-side, so only an unfiltered list passes the caller's limit through as
|
|
52
|
-
* the page size. With an explicit namespace `before` bounds the key range so
|
|
53
|
-
* rows newer than it are never read; across namespaces ids do not share one
|
|
54
|
-
* order and `before` is applied in-process.
|
|
55
|
-
*/
|
|
56
|
-
function listQuery(context, scope) {
|
|
57
|
-
const partition = (0, keys_1.partitionKey)(scope.threadId);
|
|
58
|
-
const limit = scope.filter === undefined ? scope.limit : undefined;
|
|
59
|
-
if (scope.checkpointNs === undefined) {
|
|
60
|
-
return (0, query_1.beginsWithQuery)(context.tableName, partition, (0, keys_1.metaAnyNamespacePrefix)(), { limit });
|
|
61
|
-
}
|
|
62
|
-
return (0, query_1.beginsWithQuery)(context.tableName, partition, (0, keys_1.metaSortKeyPrefix)(scope.checkpointNs), {
|
|
63
|
-
limit,
|
|
64
|
-
beforeSortKey: scope.before === undefined ? undefined : (0, keys_1.metaSortKey)(scope.checkpointNs, scope.before),
|
|
65
|
-
});
|
|
66
|
-
}
|
|
67
|
-
/**
|
|
68
|
-
* The table `Scan` a thread-less `list()` runs: every checkpointer META row,
|
|
69
|
-
* narrowed to one namespace when the caller gave one. It is what the
|
|
70
|
-
* reference savers do for a config without a thread, and on DynamoDB it costs
|
|
71
|
-
* a read of the whole table.
|
|
72
|
-
*/
|
|
73
|
-
function listScan(context, scope) {
|
|
74
|
-
return {
|
|
75
|
-
TableName: context.tableName,
|
|
76
|
-
FilterExpression: 'begins_with(#pk, :pk) AND begins_with(#sk, :sk)',
|
|
77
|
-
ExpressionAttributeNames: { '#pk': 'PK', '#sk': 'SK' },
|
|
78
|
-
ExpressionAttributeValues: {
|
|
79
|
-
':pk': (0, keys_1.checkpointerPartitionPrefix)(),
|
|
80
|
-
':sk': scope.checkpointNs === undefined
|
|
81
|
-
? (0, keys_1.metaAnyNamespacePrefix)()
|
|
82
|
-
: (0, keys_1.metaSortKeyPrefix)(scope.checkpointNs),
|
|
83
|
-
},
|
|
84
|
-
};
|
|
85
|
-
}
|
|
86
|
-
/**
|
|
87
|
-
* True when `meta` passes the key-level filters: strictly older than `before`,
|
|
88
|
-
* and — on a table scan, where the key condition cannot narrow them — in the
|
|
89
|
-
* requested namespace and, when one is given, the requested checkpoint.
|
|
90
|
-
*/
|
|
91
|
-
function passesKeyFilters(meta, scope) {
|
|
92
|
-
return ((scope.before === undefined || meta.checkpointId < scope.before) &&
|
|
93
|
-
(scope.checkpointNs === undefined || meta.checkpointNs === scope.checkpointNs) &&
|
|
94
|
-
(scope.checkpointId === undefined || meta.checkpointId === scope.checkpointId));
|
|
95
|
-
}
|
|
96
|
-
/**
|
|
97
|
-
* Apply the optional metadata-equality filter. The metadata decoded here is
|
|
98
|
-
* handed to the tuple assembly, so a filtered list decodes (and, when offloaded,
|
|
99
|
-
* downloads) each metadata blob once instead of twice.
|
|
100
|
-
*/
|
|
101
|
-
async function passesMetadataFilter(context, meta, scope) {
|
|
102
|
-
if (!scope.filter)
|
|
103
|
-
return { pass: true };
|
|
104
|
-
const metadata = await (0, item_reader_1.readMetadata)(context, meta, meta.threadId);
|
|
105
|
-
return (0, filter_match_1.matchesFilter)(metadata, scope.filter)
|
|
106
|
-
? { pass: true, metadata }
|
|
107
|
-
: { pass: false };
|
|
108
|
-
}
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import { type Checkpoint } from '@langchain/langgraph-checkpoint';
|
|
2
|
-
import { type ReadOptions } from './fetch';
|
|
3
|
-
import type { CheckpointerContext } from './setup';
|
|
4
|
-
/**
|
|
5
|
-
* Pre-v4 checkpoints kept a task's `Send`s as `__pregel_tasks` pending writes
|
|
6
|
-
* on the parent rather than in the checkpoint itself. Reading such a
|
|
7
|
-
* checkpoint rebuilds `channel_values[TASKS]` from those writes and stamps
|
|
8
|
-
* the channel with the highest version the checkpoint already carries (or
|
|
9
|
-
* the first version when it carries none), exactly as the reference savers
|
|
10
|
-
* do, so a thread written before LangGraph 0.2 still resumes. A v4 checkpoint,
|
|
11
|
-
* or one without a parent, is returned untouched.
|
|
12
|
-
*/
|
|
13
|
-
export declare function migratePendingSends(context: CheckpointerContext, checkpoint: Checkpoint, threadId: string, checkpointNs: string, parentCheckpointId: string | undefined, read: ReadOptions): Promise<Checkpoint>;
|
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.migratePendingSends = migratePendingSends;
|
|
4
|
-
const langgraph_checkpoint_1 = require("@langchain/langgraph-checkpoint");
|
|
5
|
-
const fetch_1 = require("./fetch");
|
|
6
|
-
/**
|
|
7
|
-
* Pre-v4 checkpoints kept a task's `Send`s as `__pregel_tasks` pending writes
|
|
8
|
-
* on the parent rather than in the checkpoint itself. Reading such a
|
|
9
|
-
* checkpoint rebuilds `channel_values[TASKS]` from those writes and stamps
|
|
10
|
-
* the channel with the highest version the checkpoint already carries (or
|
|
11
|
-
* the first version when it carries none), exactly as the reference savers
|
|
12
|
-
* do, so a thread written before LangGraph 0.2 still resumes. A v4 checkpoint,
|
|
13
|
-
* or one without a parent, is returned untouched.
|
|
14
|
-
*/
|
|
15
|
-
async function migratePendingSends(context, checkpoint, threadId, checkpointNs, parentCheckpointId, read) {
|
|
16
|
-
if (checkpoint.v >= 4 || parentCheckpointId === undefined)
|
|
17
|
-
return checkpoint;
|
|
18
|
-
const writes = await (0, fetch_1.fetchPendingWrites)(context, threadId, checkpointNs, parentCheckpointId, read);
|
|
19
|
-
const sends = writes.filter(([, channel]) => channel === langgraph_checkpoint_1.TASKS).map(([, , value]) => value);
|
|
20
|
-
const versions = Object.values(checkpoint.channel_versions);
|
|
21
|
-
return {
|
|
22
|
-
...checkpoint,
|
|
23
|
-
channel_values: { ...checkpoint.channel_values, [langgraph_checkpoint_1.TASKS]: sends },
|
|
24
|
-
channel_versions: {
|
|
25
|
-
...checkpoint.channel_versions,
|
|
26
|
-
[langgraph_checkpoint_1.TASKS]: versions.length > 0 ? (0, langgraph_checkpoint_1.maxChannelVersion)(...versions) : 1,
|
|
27
|
-
},
|
|
28
|
-
};
|
|
29
|
-
}
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
import type { QueryCommandInput } from '@aws-sdk/lib-dynamodb';
|
|
2
|
-
/** Options for {@link partitionQuery}. */
|
|
3
|
-
export interface PartitionQueryOptions {
|
|
4
|
-
consistent?: boolean;
|
|
5
|
-
}
|
|
6
|
-
/** Options for {@link beginsWithQuery}. */
|
|
7
|
-
export interface BeginsWithQueryOptions {
|
|
8
|
-
limit?: number;
|
|
9
|
-
/** Inclusive upper bound on the sort key; turns the prefix match into a `BETWEEN`. */
|
|
10
|
-
beforeSortKey?: string;
|
|
11
|
-
ascending?: boolean;
|
|
12
|
-
consistent?: boolean;
|
|
13
|
-
}
|
|
14
|
-
/** Build a Query input selecting every item in a partition (all sort keys). */
|
|
15
|
-
export declare function partitionQuery(tableName: string, partition: string, options?: PartitionQueryOptions): QueryCommandInput;
|
|
16
|
-
/**
|
|
17
|
-
* Build a Query input selecting items whose partition equals `partition` and
|
|
18
|
-
* whose sort key begins with `skPrefix`. Names are aliased so reserved words
|
|
19
|
-
* never appear bare. Defaults to newest-first ordering.
|
|
20
|
-
*/
|
|
21
|
-
export declare function beginsWithQuery(tableName: string, partition: string, skPrefix: string, options?: BeginsWithQueryOptions): QueryCommandInput;
|
|
@@ -1,42 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.partitionQuery = partitionQuery;
|
|
4
|
-
exports.beginsWithQuery = beginsWithQuery;
|
|
5
|
-
/** Build a Query input selecting every item in a partition (all sort keys). */
|
|
6
|
-
function partitionQuery(tableName, partition, options = {}) {
|
|
7
|
-
const params = {
|
|
8
|
-
TableName: tableName,
|
|
9
|
-
KeyConditionExpression: '#pk = :pk',
|
|
10
|
-
ExpressionAttributeNames: { '#pk': 'PK' },
|
|
11
|
-
ExpressionAttributeValues: { ':pk': partition },
|
|
12
|
-
};
|
|
13
|
-
if (options.consistent)
|
|
14
|
-
params.ConsistentRead = true;
|
|
15
|
-
return params;
|
|
16
|
-
}
|
|
17
|
-
/**
|
|
18
|
-
* Build a Query input selecting items whose partition equals `partition` and
|
|
19
|
-
* whose sort key begins with `skPrefix`. Names are aliased so reserved words
|
|
20
|
-
* never appear bare. Defaults to newest-first ordering.
|
|
21
|
-
*/
|
|
22
|
-
function beginsWithQuery(tableName, partition, skPrefix, options = {}) {
|
|
23
|
-
const bounded = options.beforeSortKey !== undefined;
|
|
24
|
-
const params = {
|
|
25
|
-
TableName: tableName,
|
|
26
|
-
KeyConditionExpression: bounded
|
|
27
|
-
? '#pk = :pk AND #sk BETWEEN :skPrefix AND :before'
|
|
28
|
-
: '#pk = :pk AND begins_with(#sk, :skPrefix)',
|
|
29
|
-
ExpressionAttributeNames: { '#pk': 'PK', '#sk': 'SK' },
|
|
30
|
-
ExpressionAttributeValues: {
|
|
31
|
-
':pk': partition,
|
|
32
|
-
':skPrefix': skPrefix,
|
|
33
|
-
...(bounded ? { ':before': options.beforeSortKey } : {}),
|
|
34
|
-
},
|
|
35
|
-
ScanIndexForward: options.ascending ?? false,
|
|
36
|
-
};
|
|
37
|
-
if (options.limit !== undefined)
|
|
38
|
-
params.Limit = options.limit;
|
|
39
|
-
if (options.consistent)
|
|
40
|
-
params.ConsistentRead = true;
|
|
41
|
-
return params;
|
|
42
|
-
}
|
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
import type { CheckpointWriteItem } from '../types';
|
|
2
|
-
import type { CheckpointerContext } from './setup';
|
|
3
|
-
/**
|
|
4
|
-
* Outcome of {@link writeRegularItems}: never rejects. `deadUploads` holds
|
|
5
|
-
* exactly the items whose own S3 upload is confirmed unreferenced — a
|
|
6
|
-
* verified non-commit, or a guard rejection whose returned row provably
|
|
7
|
-
* belongs to another call — and is therefore safe to delete. Everything else
|
|
8
|
-
* either committed, was turned away by a row this call may have written
|
|
9
|
-
* itself, or could not be verified; none of those may be cleaned up.
|
|
10
|
-
*/
|
|
11
|
-
export interface RegularWriteOutcome {
|
|
12
|
-
deadUploads: CheckpointWriteItem[];
|
|
13
|
-
error?: Error;
|
|
14
|
-
}
|
|
15
|
-
/**
|
|
16
|
-
* Write regular items with a first-write-wins guard. Every `PutCommand` fully
|
|
17
|
-
* settles (`Promise.allSettled`) before this resolves and never rejects; a
|
|
18
|
-
* genuine failure is reported via `error`, not thrown.
|
|
19
|
-
*
|
|
20
|
-
* A failure is not proof of a non-commit: `withDynamoDBRetry` re-issues a put
|
|
21
|
-
* whose response was lost, and the re-issues can time out at the transport, so
|
|
22
|
-
* the budget is spent on a `RetryExhaustedError` while the row is live.
|
|
23
|
-
* Treating that as "never reached DynamoDB" deleted the object the live row
|
|
24
|
-
* pointed at, making the checkpoint's pending writes unreadable forever. Each
|
|
25
|
-
* such failure is therefore verified against the row before it is classified,
|
|
26
|
-
* and a committed one is not an error at all.
|
|
27
|
-
*/
|
|
28
|
-
export declare function writeRegularItems(context: CheckpointerContext, items: CheckpointWriteItem[], signal?: AbortSignal): Promise<RegularWriteOutcome>;
|
|
@@ -1,66 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.writeRegularItems = writeRegularItems;
|
|
4
|
-
const conditional_put_1 = require("../../shared/dynamodb/conditional-put");
|
|
5
|
-
const retry_1 = require("../../shared/dynamodb/retry");
|
|
6
|
-
const retry_policy_1 = require("../../shared/dynamodb/retry-policy");
|
|
7
|
-
const special_write_verify_1 = require("./special-write-verify");
|
|
8
|
-
const write_guard_1 = require("./write-guard");
|
|
9
|
-
/**
|
|
10
|
-
* Resolve a non-guard failure by reading the row back. Without an offloader
|
|
11
|
-
* there is no object to protect, so the write is simply reported as not
|
|
12
|
-
* committed and the caller's cleanup is a no-op. The row holding this call's
|
|
13
|
-
* own `writeGroup` means the put landed and only its response was lost.
|
|
14
|
-
*/
|
|
15
|
-
async function verifyFailure(context, item) {
|
|
16
|
-
if (!context.offloader)
|
|
17
|
-
return 'not-committed';
|
|
18
|
-
try {
|
|
19
|
-
const observed = await (0, special_write_verify_1.readSpecialRow)(context, item);
|
|
20
|
-
return observed.revision === item.writeGroup ? 'committed' : 'not-committed';
|
|
21
|
-
}
|
|
22
|
-
catch {
|
|
23
|
-
return 'unverified';
|
|
24
|
-
}
|
|
25
|
-
}
|
|
26
|
-
/**
|
|
27
|
-
* Write regular items with a first-write-wins guard. Every `PutCommand` fully
|
|
28
|
-
* settles (`Promise.allSettled`) before this resolves and never rejects; a
|
|
29
|
-
* genuine failure is reported via `error`, not thrown.
|
|
30
|
-
*
|
|
31
|
-
* A failure is not proof of a non-commit: `withDynamoDBRetry` re-issues a put
|
|
32
|
-
* whose response was lost, and the re-issues can time out at the transport, so
|
|
33
|
-
* the budget is spent on a `RetryExhaustedError` while the row is live.
|
|
34
|
-
* Treating that as "never reached DynamoDB" deleted the object the live row
|
|
35
|
-
* pointed at, making the checkpoint's pending writes unreadable forever. Each
|
|
36
|
-
* such failure is therefore verified against the row before it is classified,
|
|
37
|
-
* and a committed one is not an error at all.
|
|
38
|
-
*/
|
|
39
|
-
async function writeRegularItems(context, items, signal) {
|
|
40
|
-
const results = await Promise.allSettled(items.map((item) => (0, retry_1.withDynamoDBRetry)(() => context.client.put({
|
|
41
|
-
TableName: context.tableName,
|
|
42
|
-
Item: item,
|
|
43
|
-
ConditionExpression: 'attribute_not_exists(PK)',
|
|
44
|
-
ReturnValuesOnConditionCheckFailure: 'ALL_OLD',
|
|
45
|
-
}), (0, retry_policy_1.retryFor)(context, signal))));
|
|
46
|
-
const outcome = { deadUploads: [] };
|
|
47
|
-
for (const [index, result] of results.entries()) {
|
|
48
|
-
if (result.status === 'fulfilled')
|
|
49
|
-
continue;
|
|
50
|
-
const item = items[index];
|
|
51
|
-
const reason = result.reason;
|
|
52
|
-
if ((0, conditional_put_1.isConditionalCheckFailed)(reason)) {
|
|
53
|
-
(0, write_guard_1.reportGuardRejection)(context, item, reason);
|
|
54
|
-
if ((0, write_guard_1.rejectionProvesForeignRow)(item, reason))
|
|
55
|
-
outcome.deadUploads.push(item);
|
|
56
|
-
continue;
|
|
57
|
-
}
|
|
58
|
-
const verdict = await verifyFailure(context, item);
|
|
59
|
-
if (verdict === 'committed')
|
|
60
|
-
continue;
|
|
61
|
-
if (verdict === 'not-committed')
|
|
62
|
-
outcome.deadUploads.push(item);
|
|
63
|
-
outcome.error = outcome.error ?? reason;
|
|
64
|
-
}
|
|
65
|
-
return outcome;
|
|
66
|
-
}
|
|
@@ -1,33 +0,0 @@
|
|
|
1
|
-
import type { DynamoDBClient } from '@aws-sdk/client-dynamodb';
|
|
2
|
-
import type { DynamoDBDocument } from '@aws-sdk/lib-dynamodb';
|
|
3
|
-
import type { SerializerProtocol } from '@langchain/langgraph-checkpoint';
|
|
4
|
-
import type { CompressionConfig } from '../../shared/codec/compression';
|
|
5
|
-
import { S3Offloader } from '../../shared/codec/s3/offloader';
|
|
6
|
-
import type { RetryOptions } from '../../shared/dynamodb/retry';
|
|
7
|
-
import { type Logger } from '../../shared/logging/logger';
|
|
8
|
-
import type { TtlOption } from '../../shared/validation/ttl';
|
|
9
|
-
import type { DynamoDBSaverOptions } from '../types';
|
|
10
|
-
/** Resolved collaborators shared by every checkpointer action. */
|
|
11
|
-
export interface CheckpointerContext {
|
|
12
|
-
client: DynamoDBDocument;
|
|
13
|
-
tableName: string;
|
|
14
|
-
serde: SerializerProtocol;
|
|
15
|
-
compression?: CompressionConfig;
|
|
16
|
-
offloader?: S3Offloader;
|
|
17
|
-
ttl?: TtlOption;
|
|
18
|
-
logger: Logger;
|
|
19
|
-
/** Retry budget and backoff for every DynamoDB call, with the retry debug log attached. */
|
|
20
|
-
retry?: RetryOptions;
|
|
21
|
-
}
|
|
22
|
-
/** Result of wiring up a checkpointer from its options. */
|
|
23
|
-
export interface CheckpointerSetup {
|
|
24
|
-
context: CheckpointerContext;
|
|
25
|
-
ddbClient: DynamoDBClient | undefined;
|
|
26
|
-
ownsClient: boolean;
|
|
27
|
-
}
|
|
28
|
-
/**
|
|
29
|
-
* Resolve the DynamoDB client, optional S3 offloader, and logging into the
|
|
30
|
-
* context every action receives, plus the ownership info the class needs to
|
|
31
|
-
* tear resources down.
|
|
32
|
-
*/
|
|
33
|
-
export declare function setUpCheckpointer(options: DynamoDBSaverOptions, serde: SerializerProtocol): CheckpointerSetup;
|
|
@@ -1,38 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.setUpCheckpointer = setUpCheckpointer;
|
|
4
|
-
const adapter_config_1 = require("../../shared/codec/s3/adapter-config");
|
|
5
|
-
const offloader_1 = require("../../shared/codec/s3/offloader");
|
|
6
|
-
const client_1 = require("../../shared/dynamodb/client");
|
|
7
|
-
const retry_policy_1 = require("../../shared/dynamodb/retry-policy");
|
|
8
|
-
const logger_1 = require("../../shared/logging/logger");
|
|
9
|
-
const options_1 = require("../../shared/validation/options");
|
|
10
|
-
/**
|
|
11
|
-
* Resolve the DynamoDB client, optional S3 offloader, and logging into the
|
|
12
|
-
* context every action receives, plus the ownership info the class needs to
|
|
13
|
-
* tear resources down.
|
|
14
|
-
*/
|
|
15
|
-
function setUpCheckpointer(options, serde) {
|
|
16
|
-
(0, options_1.validateBaseAdapterOptions)(options);
|
|
17
|
-
const logger = (0, logger_1.resolveLogger)(options.logger);
|
|
18
|
-
const resolved = (0, client_1.resolveDynamoDBClient)(options);
|
|
19
|
-
if (!resolved.ownsClient)
|
|
20
|
-
void (0, client_1.warnOnStackedRetries)(resolved.client, logger);
|
|
21
|
-
const offloader = options.s3
|
|
22
|
-
? new offloader_1.S3Offloader((0, adapter_config_1.offloaderConfigFor)(options.s3, 'checkpointer', options.clientConfig))
|
|
23
|
-
: undefined;
|
|
24
|
-
return {
|
|
25
|
-
context: {
|
|
26
|
-
client: resolved.client,
|
|
27
|
-
tableName: options.tableName,
|
|
28
|
-
serde,
|
|
29
|
-
compression: options.compression,
|
|
30
|
-
offloader,
|
|
31
|
-
ttl: options.ttl,
|
|
32
|
-
logger,
|
|
33
|
-
retry: (0, retry_policy_1.resolveRetryPolicy)(options.retry, logger),
|
|
34
|
-
},
|
|
35
|
-
ddbClient: resolved.ddbClient,
|
|
36
|
-
ownsClient: resolved.ownsClient,
|
|
37
|
-
};
|
|
38
|
-
}
|
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
import type { CheckpointWriteItem } from '../types';
|
|
2
|
-
import type { CheckpointerContext } from './setup';
|
|
3
|
-
import { type SpecialWriteOutcome } from './special-write-verify';
|
|
4
|
-
/**
|
|
5
|
-
* Overwrite one special row, pinned to the `writeGroup` this call observed, and
|
|
6
|
-
* report the descriptor it superseded.
|
|
7
|
-
*
|
|
8
|
-
* Overwriting is correct for special channels — every reference implementation
|
|
9
|
-
* does it — but two concurrent calls to the same channel both read the same
|
|
10
|
-
* previous descriptor and both delete it, orphaning the loser's upload. Pinning
|
|
11
|
-
* the observed `writeGroup` and re-reading on rejection makes each call
|
|
12
|
-
* supersede exactly one payload.
|
|
13
|
-
*
|
|
14
|
-
* `BatchWriteItem` cannot carry conditions, which is why this path issues
|
|
15
|
-
* individual puts; a call holds at most one row per special channel, so that is
|
|
16
|
-
* four writes at worst.
|
|
17
|
-
*
|
|
18
|
-
* The compare-and-swap runs only when an offloader is configured — matching
|
|
19
|
-
* `store/internal/persist.ts` — because without one there is no S3 object to
|
|
20
|
-
* orphan, so a plain unconditional put stays correct and costs no extra
|
|
21
|
-
* ConsistentRead or write capacity. That shortcut is also why the surviving
|
|
22
|
-
* `catch` may report `committed: false` without verifying: with no offloader
|
|
23
|
-
* there is no object for the caller to delete on the strength of it.
|
|
24
|
-
*
|
|
25
|
-
* Never rejects: the caller runs this concurrently with the regular writes
|
|
26
|
-
* under `Promise.all`, whose own cleanup depends on every branch resolving
|
|
27
|
-
* rather than short-circuiting.
|
|
28
|
-
*/
|
|
29
|
-
export declare function writeSpecialItem(context: CheckpointerContext, item: CheckpointWriteItem, signal?: AbortSignal): Promise<SpecialWriteOutcome>;
|