@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,63 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.ensureLifecycleRule = ensureLifecycleRule;
|
|
4
|
-
const client_1 = require("./client");
|
|
5
|
-
const config_1 = require("./config");
|
|
6
|
-
async function readState(client, bucket) {
|
|
7
|
-
const { GetBucketLifecycleConfigurationCommand } = await (0, client_1.loadS3Sdk)();
|
|
8
|
-
try {
|
|
9
|
-
const existing = await client.send(new GetBucketLifecycleConfigurationCommand({ Bucket: bucket }));
|
|
10
|
-
return {
|
|
11
|
-
rules: existing.Rules ?? [],
|
|
12
|
-
transitionDefaultMinimumObjectSize: existing.TransitionDefaultMinimumObjectSize,
|
|
13
|
-
};
|
|
14
|
-
}
|
|
15
|
-
catch (error) {
|
|
16
|
-
if (error.name === 'NoSuchLifecycleConfiguration')
|
|
17
|
-
return { rules: [] };
|
|
18
|
-
throw error;
|
|
19
|
-
}
|
|
20
|
-
}
|
|
21
|
-
function alreadyCorrect(rule, days) {
|
|
22
|
-
return (rule?.Status === 'Enabled' &&
|
|
23
|
-
rule.Expiration?.Days === days &&
|
|
24
|
-
rule.NoncurrentVersionExpiration?.NoncurrentDays === days);
|
|
25
|
-
}
|
|
26
|
-
/**
|
|
27
|
-
* Idempotently ensure a `days`-day expiration lifecycle rule exists for
|
|
28
|
-
* `prefix`. Reads existing rules, preserves user-defined ones and the
|
|
29
|
-
* bucket-level `TransitionDefaultMinimumObjectSize` (a Put replaces the whole
|
|
30
|
-
* configuration, so dropping it would reset the bucket to the default), and
|
|
31
|
-
* only adds/updates the library's prefix-scoped rule.
|
|
32
|
-
*
|
|
33
|
-
* Noncurrent versions expire after the same number of days, so a versioned
|
|
34
|
-
* bucket does not retain every superseded payload forever; the field is inert
|
|
35
|
-
* on an unversioned bucket. The prefix is re-checked here because this rule is
|
|
36
|
-
* the one place an unscoped prefix would destroy data outside this library's.
|
|
37
|
-
*/
|
|
38
|
-
async function ensureLifecycleRule(client, bucket, prefix, days) {
|
|
39
|
-
(0, config_1.assertScopedKeyPrefix)(prefix);
|
|
40
|
-
const ruleId = (0, config_1.buildLifecycleRuleId)(prefix);
|
|
41
|
-
const state = await readState(client, bucket);
|
|
42
|
-
const existing = state.rules.find((rule) => rule.ID === ruleId);
|
|
43
|
-
if (alreadyCorrect(existing, days))
|
|
44
|
-
return;
|
|
45
|
-
const newRule = {
|
|
46
|
-
ID: ruleId,
|
|
47
|
-
Filter: { Prefix: prefix },
|
|
48
|
-
Status: 'Enabled',
|
|
49
|
-
Expiration: { Days: days },
|
|
50
|
-
NoncurrentVersionExpiration: { NoncurrentDays: days },
|
|
51
|
-
};
|
|
52
|
-
const merged = existing
|
|
53
|
-
? state.rules.map((rule) => (rule.ID === ruleId ? newRule : rule))
|
|
54
|
-
: [...state.rules, newRule];
|
|
55
|
-
const { PutBucketLifecycleConfigurationCommand } = await (0, client_1.loadS3Sdk)();
|
|
56
|
-
await client.send(new PutBucketLifecycleConfigurationCommand({
|
|
57
|
-
Bucket: bucket,
|
|
58
|
-
LifecycleConfiguration: { Rules: merged },
|
|
59
|
-
...(state.transitionDefaultMinimumObjectSize === undefined
|
|
60
|
-
? {}
|
|
61
|
-
: { TransitionDefaultMinimumObjectSize: state.transitionDefaultMinimumObjectSize }),
|
|
62
|
-
}));
|
|
63
|
-
}
|
|
@@ -1,44 +0,0 @@
|
|
|
1
|
-
import { S3OffloadConfig } from './config';
|
|
2
|
-
/**
|
|
3
|
-
* Thin holder composing the pure S3 functions. Owns config + the lazily-built
|
|
4
|
-
* S3 client and delegates all real work; every method is a small delegation.
|
|
5
|
-
*/
|
|
6
|
-
export declare class S3Offloader {
|
|
7
|
-
private clientPromise;
|
|
8
|
-
private resolvedClient;
|
|
9
|
-
private destroyed;
|
|
10
|
-
private readonly bucketName;
|
|
11
|
-
private readonly keyPrefix;
|
|
12
|
-
private readonly thresholdBytes;
|
|
13
|
-
private readonly sse;
|
|
14
|
-
private readonly sseKmsKeyId?;
|
|
15
|
-
private readonly maxDownloadBytes;
|
|
16
|
-
private readonly config;
|
|
17
|
-
constructor(config: S3OffloadConfig);
|
|
18
|
-
private getClient;
|
|
19
|
-
/** True when `data` is large enough to warrant S3 offload. */
|
|
20
|
-
shouldOffload(data: Uint8Array): boolean;
|
|
21
|
-
/** Build the S3 key for the given key parts. */
|
|
22
|
-
buildKey(parts: readonly string[]): string;
|
|
23
|
-
/** The configured key prefix. */
|
|
24
|
-
getKeyPrefix(): string;
|
|
25
|
-
/** True when `key` lies under this offloader's prefix and the `scope` parts' path. */
|
|
26
|
-
ownsKey(key: string, scope: readonly string[]): boolean;
|
|
27
|
-
/** Refuse a row-sourced key outside the row's own path (see {@link assertKeyInScope}). */
|
|
28
|
-
assertOwnedKey(key: string, scope: readonly string[]): void;
|
|
29
|
-
/** Upload `data` under `key`, returning the key. */
|
|
30
|
-
upload(key: string, data: Uint8Array): Promise<string>;
|
|
31
|
-
/** Download the bytes stored under `key`, refusing objects over `maxDownloadBytes`. */
|
|
32
|
-
download(key: string): Promise<Uint8Array>;
|
|
33
|
-
/** Delete `keys`, returning the keys S3 reported as failed. */
|
|
34
|
-
deleteBatch(keys: string[]): Promise<string[]>;
|
|
35
|
-
/** Ensure a `${ttlDays}`-day expiration lifecycle rule exists for the prefix. */
|
|
36
|
-
ensureLifecycleRule(ttlDays: number): Promise<void>;
|
|
37
|
-
/**
|
|
38
|
-
* Release the underlying S3 client. Safe at any point in the client's
|
|
39
|
-
* lifecycle: called before construction starts it does nothing, called
|
|
40
|
-
* mid-construction it marks the offloader destroyed so the client is
|
|
41
|
-
* released the moment it resolves, and called after it releases it directly.
|
|
42
|
-
*/
|
|
43
|
-
destroy(): void;
|
|
44
|
-
}
|
|
@@ -1,118 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.S3Offloader = void 0;
|
|
4
|
-
const constants_1 = require("../../constants");
|
|
5
|
-
const client_1 = require("./client");
|
|
6
|
-
const config_1 = require("./config");
|
|
7
|
-
const delete_1 = require("./delete");
|
|
8
|
-
const key_scope_1 = require("./key-scope");
|
|
9
|
-
const lifecycle_1 = require("./lifecycle");
|
|
10
|
-
const read_write_1 = require("./read-write");
|
|
11
|
-
/**
|
|
12
|
-
* Thin holder composing the pure S3 functions. Owns config + the lazily-built
|
|
13
|
-
* S3 client and delegates all real work; every method is a small delegation.
|
|
14
|
-
*/
|
|
15
|
-
class S3Offloader {
|
|
16
|
-
clientPromise;
|
|
17
|
-
resolvedClient;
|
|
18
|
-
destroyed = false;
|
|
19
|
-
bucketName;
|
|
20
|
-
keyPrefix;
|
|
21
|
-
thresholdBytes;
|
|
22
|
-
sse;
|
|
23
|
-
sseKmsKeyId;
|
|
24
|
-
maxDownloadBytes;
|
|
25
|
-
config;
|
|
26
|
-
constructor(config) {
|
|
27
|
-
this.config = config;
|
|
28
|
-
this.bucketName = config.bucketName;
|
|
29
|
-
this.keyPrefix = config.keyPrefix ?? constants_1.DEFAULT_S3_KEY_PREFIX;
|
|
30
|
-
this.thresholdBytes = config.thresholdBytes ?? constants_1.DEFAULT_S3_THRESHOLD_BYTES;
|
|
31
|
-
this.sse = config.serverSideEncryption ?? constants_1.DEFAULT_S3_SSE;
|
|
32
|
-
this.sseKmsKeyId = config.sseKmsKeyId;
|
|
33
|
-
this.maxDownloadBytes = config.maxDownloadBytes ?? constants_1.DEFAULT_MAX_S3_DOWNLOAD_BYTES;
|
|
34
|
-
/**
|
|
35
|
-
* Warm the optional peer's import so a missing `@aws-sdk/client-s3`
|
|
36
|
-
* surfaces on the very first S3 operation, typed, rather than on the first
|
|
37
|
-
* oversize payload days later. The rejection is handled here; whichever
|
|
38
|
-
* operation runs first re-raises it through its own `loadS3Sdk()` call.
|
|
39
|
-
*/
|
|
40
|
-
void (0, client_1.loadS3Sdk)().catch(() => undefined);
|
|
41
|
-
}
|
|
42
|
-
getClient() {
|
|
43
|
-
if (!this.clientPromise) {
|
|
44
|
-
const cfg = this.config.clientConfig ?? {};
|
|
45
|
-
/** The hook is typed structurally for consumers; the runtime modules use the real SDK client. */
|
|
46
|
-
this.clientPromise = (this.config.createS3Client
|
|
47
|
-
? Promise.resolve(this.config.createS3Client({ maxAttempts: 1, ...cfg }))
|
|
48
|
-
: (0, client_1.createDefaultS3Client)(cfg)).then((client) => {
|
|
49
|
-
this.resolvedClient = client;
|
|
50
|
-
/**
|
|
51
|
-
* `destroy()` may have run during this construction, when there was
|
|
52
|
-
* no client yet to release. Release it now instead of leaking it.
|
|
53
|
-
*/
|
|
54
|
-
if (this.destroyed)
|
|
55
|
-
client.destroy();
|
|
56
|
-
return client;
|
|
57
|
-
}, (error) => {
|
|
58
|
-
this.clientPromise = undefined;
|
|
59
|
-
throw error;
|
|
60
|
-
});
|
|
61
|
-
}
|
|
62
|
-
return this.clientPromise;
|
|
63
|
-
}
|
|
64
|
-
/** True when `data` is large enough to warrant S3 offload. */
|
|
65
|
-
shouldOffload(data) {
|
|
66
|
-
return data.length >= this.thresholdBytes;
|
|
67
|
-
}
|
|
68
|
-
/** Build the S3 key for the given key parts. */
|
|
69
|
-
buildKey(parts) {
|
|
70
|
-
return (0, config_1.buildS3Key)(this.keyPrefix, parts);
|
|
71
|
-
}
|
|
72
|
-
/** The configured key prefix. */
|
|
73
|
-
getKeyPrefix() {
|
|
74
|
-
return this.keyPrefix;
|
|
75
|
-
}
|
|
76
|
-
/** True when `key` lies under this offloader's prefix and the `scope` parts' path. */
|
|
77
|
-
ownsKey(key, scope) {
|
|
78
|
-
return (0, key_scope_1.isKeyInScope)(key, this.keyPrefix, scope);
|
|
79
|
-
}
|
|
80
|
-
/** Refuse a row-sourced key outside the row's own path (see {@link assertKeyInScope}). */
|
|
81
|
-
assertOwnedKey(key, scope) {
|
|
82
|
-
(0, key_scope_1.assertKeyInScope)(key, this.keyPrefix, scope);
|
|
83
|
-
}
|
|
84
|
-
/** Upload `data` under `key`, returning the key. */
|
|
85
|
-
async upload(key, data) {
|
|
86
|
-
await (0, read_write_1.uploadObject)(await this.getClient(), {
|
|
87
|
-
bucket: this.bucketName,
|
|
88
|
-
key,
|
|
89
|
-
data,
|
|
90
|
-
serverSideEncryption: this.sse,
|
|
91
|
-
sseKmsKeyId: this.sseKmsKeyId,
|
|
92
|
-
});
|
|
93
|
-
return key;
|
|
94
|
-
}
|
|
95
|
-
/** Download the bytes stored under `key`, refusing objects over `maxDownloadBytes`. */
|
|
96
|
-
async download(key) {
|
|
97
|
-
return (0, read_write_1.downloadObject)(await this.getClient(), this.bucketName, key, this.maxDownloadBytes);
|
|
98
|
-
}
|
|
99
|
-
/** Delete `keys`, returning the keys S3 reported as failed. */
|
|
100
|
-
async deleteBatch(keys) {
|
|
101
|
-
return (0, delete_1.deleteObjects)(await this.getClient(), this.bucketName, keys);
|
|
102
|
-
}
|
|
103
|
-
/** Ensure a `${ttlDays}`-day expiration lifecycle rule exists for the prefix. */
|
|
104
|
-
async ensureLifecycleRule(ttlDays) {
|
|
105
|
-
return (0, lifecycle_1.ensureLifecycleRule)(await this.getClient(), this.bucketName, this.keyPrefix, ttlDays);
|
|
106
|
-
}
|
|
107
|
-
/**
|
|
108
|
-
* Release the underlying S3 client. Safe at any point in the client's
|
|
109
|
-
* lifecycle: called before construction starts it does nothing, called
|
|
110
|
-
* mid-construction it marks the offloader destroyed so the client is
|
|
111
|
-
* released the moment it resolves, and called after it releases it directly.
|
|
112
|
-
*/
|
|
113
|
-
destroy() {
|
|
114
|
-
this.destroyed = true;
|
|
115
|
-
this.resolvedClient?.destroy();
|
|
116
|
-
}
|
|
117
|
-
}
|
|
118
|
-
exports.S3Offloader = S3Offloader;
|
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
import type { Logger } from '../../logging/logger';
|
|
2
|
-
import type { S3Offloader } from './offloader';
|
|
3
|
-
/** Options for {@link cleanUpS3Orphans}. */
|
|
4
|
-
export interface OrphanCleanupOptions {
|
|
5
|
-
rng?: () => number;
|
|
6
|
-
maxAttempts?: number;
|
|
7
|
-
signal?: AbortSignal;
|
|
8
|
-
/**
|
|
9
|
-
* The row's own leading key parts when `keys` were read back from a row.
|
|
10
|
-
* A key outside the path they produce is never deleted, only reported; own
|
|
11
|
-
* uploads (built by this call) pass no scope.
|
|
12
|
-
*/
|
|
13
|
-
scope?: readonly string[];
|
|
14
|
-
}
|
|
15
|
-
/**
|
|
16
|
-
* Best-effort delete of S3 objects orphaned by a failed DynamoDB write. Retries
|
|
17
|
-
* transient errors with full-jitter backoff; on persistent failure or when S3
|
|
18
|
-
* reports keys it could not delete, it logs at `warn` and never throws — the
|
|
19
|
-
* sole non-throwing path in the library. There is no automatic backstop: an
|
|
20
|
-
* S3 lifecycle rule sweeps the leftovers only if one was provisioned via
|
|
21
|
-
* `ensureS3LifecycleRule()`, which is opt-in.
|
|
22
|
-
*/
|
|
23
|
-
export declare function cleanUpS3Orphans(offloader: S3Offloader, keys: ReadonlyArray<string | undefined>, context: string, logger: Logger, options?: OrphanCleanupOptions): Promise<void>;
|
|
@@ -1,71 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.cleanUpS3Orphans = cleanUpS3Orphans;
|
|
4
|
-
const backoff_1 = require("../../dynamodb/backoff");
|
|
5
|
-
const retry_1 = require("./retry");
|
|
6
|
-
const DEFAULT_MAX_ATTEMPTS = 3;
|
|
7
|
-
const BASE_DELAY_MS = 100;
|
|
8
|
-
/**
|
|
9
|
-
* Wait out one backoff window, cancellable via `options.signal`. Resolves `true`
|
|
10
|
-
* when the signal aborts the wait (so the caller stops retrying) and `false`
|
|
11
|
-
* otherwise — never rejects, preserving the best-effort, non-throwing contract.
|
|
12
|
-
*/
|
|
13
|
-
async function backoffSleep(delayMs, options) {
|
|
14
|
-
try {
|
|
15
|
-
await (0, backoff_1.sleep)((0, backoff_1.fullJitter)(delayMs, options.rng), options.signal);
|
|
16
|
-
return false;
|
|
17
|
-
}
|
|
18
|
-
catch {
|
|
19
|
-
return true;
|
|
20
|
-
}
|
|
21
|
-
}
|
|
22
|
-
/** Drop every key outside the row's scope, reporting each one. */
|
|
23
|
-
function ownedOnly(offloader, keys, scope, context, logger) {
|
|
24
|
-
return keys.filter((key) => {
|
|
25
|
-
if (offloader.ownsKey(key, scope))
|
|
26
|
-
return true;
|
|
27
|
-
logger.warn(`${context}: refusing to delete an S3 object outside this row's scope`, { key });
|
|
28
|
-
return false;
|
|
29
|
-
});
|
|
30
|
-
}
|
|
31
|
-
/** The non-empty keys, restricted to the row's scope when one is given. */
|
|
32
|
-
function selectOrphans(offloader, keys, context, logger, options) {
|
|
33
|
-
const present = keys.filter((key) => typeof key === 'string' && key.length > 0);
|
|
34
|
-
return options.scope ? ownedOnly(offloader, present, options.scope, context, logger) : present;
|
|
35
|
-
}
|
|
36
|
-
/**
|
|
37
|
-
* Best-effort delete of S3 objects orphaned by a failed DynamoDB write. Retries
|
|
38
|
-
* transient errors with full-jitter backoff; on persistent failure or when S3
|
|
39
|
-
* reports keys it could not delete, it logs at `warn` and never throws — the
|
|
40
|
-
* sole non-throwing path in the library. There is no automatic backstop: an
|
|
41
|
-
* S3 lifecycle rule sweeps the leftovers only if one was provisioned via
|
|
42
|
-
* `ensureS3LifecycleRule()`, which is opt-in.
|
|
43
|
-
*/
|
|
44
|
-
async function cleanUpS3Orphans(offloader, keys, context, logger, options = {}) {
|
|
45
|
-
const orphans = selectOrphans(offloader, keys, context, logger, options);
|
|
46
|
-
if (orphans.length === 0)
|
|
47
|
-
return;
|
|
48
|
-
const maxAttempts = options.maxAttempts ?? DEFAULT_MAX_ATTEMPTS;
|
|
49
|
-
let delay = BASE_DELAY_MS;
|
|
50
|
-
let lastError = new Error('S3 orphan cleanup did not run');
|
|
51
|
-
for (let attempt = 1; attempt <= maxAttempts; attempt++) {
|
|
52
|
-
try {
|
|
53
|
-
const failed = await offloader.deleteBatch(orphans);
|
|
54
|
-
if (failed.length === 0)
|
|
55
|
-
return;
|
|
56
|
-
logger.warn(`Some orphaned S3 objects could not be deleted after ${context}; a lifecycle rule from ensureS3LifecycleRule() would sweep them, otherwise clean up manually`, { failedCount: failed.length });
|
|
57
|
-
return;
|
|
58
|
-
}
|
|
59
|
-
catch (error) {
|
|
60
|
-
lastError = error;
|
|
61
|
-
if (attempt >= maxAttempts || !(0, retry_1.isTransientS3Error)(lastError))
|
|
62
|
-
break;
|
|
63
|
-
if (await backoffSleep(delay, options))
|
|
64
|
-
break;
|
|
65
|
-
delay = (0, backoff_1.nextBackoffDelay)(delay);
|
|
66
|
-
}
|
|
67
|
-
}
|
|
68
|
-
logger.warn(`Failed to clean up orphaned S3 objects after ${context}; a lifecycle rule from ensureS3LifecycleRule() would sweep them, otherwise clean up manually`, {
|
|
69
|
-
message: lastError.message,
|
|
70
|
-
});
|
|
71
|
-
}
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
import type { S3Client } from '@aws-sdk/client-s3';
|
|
2
|
-
/** Parameters for {@link uploadObject}. */
|
|
3
|
-
export interface UploadParams {
|
|
4
|
-
bucket: string;
|
|
5
|
-
key: string;
|
|
6
|
-
data: Uint8Array;
|
|
7
|
-
serverSideEncryption?: string;
|
|
8
|
-
sseKmsKeyId?: string;
|
|
9
|
-
}
|
|
10
|
-
/** Upload `data` to S3, wrapping failures as `S3_OFFLOAD_FAILED`. */
|
|
11
|
-
export declare function uploadObject(client: S3Client, params: UploadParams): Promise<void>;
|
|
12
|
-
/**
|
|
13
|
-
* Download an object's bytes, wrapping failures/empty bodies as
|
|
14
|
-
* `S3_OFFLOAD_FAILED`. An object over `maxBytes` is refused from its declared
|
|
15
|
-
* `ContentLength` before the body is touched, or while streaming when the
|
|
16
|
-
* length is unknown, so a replaced or hostile object can never exhaust memory.
|
|
17
|
-
*/
|
|
18
|
-
export declare function downloadObject(client: S3Client, bucket: string, key: string, maxBytes: number): Promise<Uint8Array>;
|
|
@@ -1,51 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.uploadObject = uploadObject;
|
|
4
|
-
exports.downloadObject = downloadObject;
|
|
5
|
-
const retry_1 = require("../../dynamodb/retry");
|
|
6
|
-
const base_error_1 = require("../../errors/base-error");
|
|
7
|
-
const error_code_1 = require("../../errors/error-code");
|
|
8
|
-
const bounded_body_1 = require("./bounded-body");
|
|
9
|
-
const client_1 = require("./client");
|
|
10
|
-
const retry_2 = require("./retry");
|
|
11
|
-
/** Upload `data` to S3, wrapping failures as `S3_OFFLOAD_FAILED`. */
|
|
12
|
-
async function uploadObject(client, params) {
|
|
13
|
-
const { PutObjectCommand } = await (0, client_1.loadS3Sdk)();
|
|
14
|
-
try {
|
|
15
|
-
await (0, retry_1.withRetry)(() => client.send(new PutObjectCommand({
|
|
16
|
-
Bucket: params.bucket,
|
|
17
|
-
Key: params.key,
|
|
18
|
-
Body: params.data,
|
|
19
|
-
ContentType: 'application/octet-stream',
|
|
20
|
-
ServerSideEncryption: params.serverSideEncryption,
|
|
21
|
-
...(params.sseKmsKeyId ? { SSEKMSKeyId: params.sseKmsKeyId } : {}),
|
|
22
|
-
})), { maxAttempts: 3, isRetryable: retry_2.isTransientS3Error });
|
|
23
|
-
}
|
|
24
|
-
catch (error) {
|
|
25
|
-
throw new base_error_1.DynamoDBLangGraphError(error.message, error_code_1.ErrorCode.S3_OFFLOAD_FAILED, { operation: 'upload', key: params.key }, error);
|
|
26
|
-
}
|
|
27
|
-
}
|
|
28
|
-
/**
|
|
29
|
-
* Download an object's bytes, wrapping failures/empty bodies as
|
|
30
|
-
* `S3_OFFLOAD_FAILED`. An object over `maxBytes` is refused from its declared
|
|
31
|
-
* `ContentLength` before the body is touched, or while streaming when the
|
|
32
|
-
* length is unknown, so a replaced or hostile object can never exhaust memory.
|
|
33
|
-
*/
|
|
34
|
-
async function downloadObject(client, bucket, key, maxBytes) {
|
|
35
|
-
const { GetObjectCommand } = await (0, client_1.loadS3Sdk)();
|
|
36
|
-
try {
|
|
37
|
-
return await (0, retry_1.withRetry)(async () => {
|
|
38
|
-
const response = await client.send(new GetObjectCommand({ Bucket: bucket, Key: key }));
|
|
39
|
-
if (typeof response.ContentLength === 'number' && response.ContentLength > maxBytes) {
|
|
40
|
-
throw (0, bounded_body_1.oversizedObjectError)(key, response.ContentLength, maxBytes);
|
|
41
|
-
}
|
|
42
|
-
if (!response.Body) {
|
|
43
|
-
throw new Error(`S3 object body is empty for key: ${key}`);
|
|
44
|
-
}
|
|
45
|
-
return (0, bounded_body_1.readBodyBounded)(response.Body, key, maxBytes);
|
|
46
|
-
}, { maxAttempts: 3, isRetryable: retry_2.isTransientS3Error });
|
|
47
|
-
}
|
|
48
|
-
catch (error) {
|
|
49
|
-
throw new base_error_1.DynamoDBLangGraphError(error.message, error_code_1.ErrorCode.S3_OFFLOAD_FAILED, { operation: 'download', key }, error);
|
|
50
|
-
}
|
|
51
|
-
}
|
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.isTransientS3Error = isTransientS3Error;
|
|
4
|
-
const retry_classifier_1 = require("../../dynamodb/retry-classifier");
|
|
5
|
-
/**
|
|
6
|
-
* Transient S3 signals: everything the DynamoDB classifier already treats as
|
|
7
|
-
* transient (the SDK transport `TimeoutError`, socket errors, `RequestTimeout`,
|
|
8
|
-
* `ServiceUnavailable`, …) plus the two names only S3 uses. HTTP 429/5xx and
|
|
9
|
-
* the `$retryable` trait are recognised by the shared classifier itself.
|
|
10
|
-
*/
|
|
11
|
-
const RETRYABLE_S3_SIGNALS = [
|
|
12
|
-
...retry_classifier_1.DEFAULT_RETRYABLE_ERRORS,
|
|
13
|
-
'SlowDown',
|
|
14
|
-
'InternalError',
|
|
15
|
-
];
|
|
16
|
-
/**
|
|
17
|
-
* True when `error` looks like a transient S3 failure worth retrying — the one
|
|
18
|
-
* classifier for uploads, downloads and orphan cleanup.
|
|
19
|
-
*/
|
|
20
|
-
function isTransientS3Error(error) {
|
|
21
|
-
return (0, retry_classifier_1.isRetryableError)(error, RETRYABLE_S3_SIGNALS);
|
|
22
|
-
}
|
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Map `items` through `fn` with at most `limit` calls in flight, preserving
|
|
3
|
-
* input order in the result. The first rejection wins: no further item is
|
|
4
|
-
* started, the calls already in flight settle, and that error propagates.
|
|
5
|
-
*/
|
|
6
|
-
export declare function mapWithConcurrency<T, R>(items: readonly T[], limit: number, fn: (item: T, index: number) => Promise<R>): Promise<R[]>;
|
|
@@ -1,112 +0,0 @@
|
|
|
1
|
-
/** Maximum TTL expressed in days (5 years). */
|
|
2
|
-
export declare const MAX_TTL_DAYS: number;
|
|
3
|
-
/** Maximum TTL expressed in seconds: the same five years as {@link MAX_TTL_DAYS}. */
|
|
4
|
-
export declare const MAX_TTL_SECONDS: number;
|
|
5
|
-
/** Hard cap on query-pagination loop iterations (runaway-loop guard). */
|
|
6
|
-
export declare const MAX_LOOP_ITERATIONS = 1000;
|
|
7
|
-
/** Hard cap on items collected into memory across a paginated query. */
|
|
8
|
-
export declare const MAX_TOTAL_ITEMS_IN_MEMORY = 10000;
|
|
9
|
-
/** DynamoDB BatchWriteItem maximum requests per call. */
|
|
10
|
-
export declare const BATCH_WRITE_MAX = 25;
|
|
11
|
-
/** DynamoDB BatchGetItem maximum keys per call. */
|
|
12
|
-
export declare const BATCH_GET_MAX = 100;
|
|
13
|
-
/** Maximum retries draining UnprocessedItems / UnprocessedKeys. */
|
|
14
|
-
export declare const MAX_UNPROCESSED_RETRIES = 10;
|
|
15
|
-
/** Starting delay for UnprocessedItems / UnprocessedKeys backoff loops. */
|
|
16
|
-
export declare const INITIAL_BACKOFF_DELAY_MS = 100;
|
|
17
|
-
/** Maximum backoff delay for retry loops. */
|
|
18
|
-
export declare const MAX_BACKOFF_DELAY_MS = 5000;
|
|
19
|
-
/** S3 DeleteObjects maximum keys per request. */
|
|
20
|
-
export declare const S3_DELETE_BATCH_MAX = 1000;
|
|
21
|
-
/** Default payload size that triggers S3 offload (350 KB; 50 KB under the DDB 400 KB cap). */
|
|
22
|
-
export declare const DEFAULT_S3_THRESHOLD_BYTES: number;
|
|
23
|
-
/**
|
|
24
|
-
* Largest serialized payload stored inline when no S3 offloader is configured:
|
|
25
|
-
* DynamoDB's 400 KB item cap less 8 KB of headroom for the item's keys,
|
|
26
|
-
* attribute names and descriptor fields. Exceeding it fails before the write
|
|
27
|
-
* with a typed error instead of a raw `ValidationException` after it.
|
|
28
|
-
*/
|
|
29
|
-
export declare const MAX_INLINE_PAYLOAD_BYTES: number;
|
|
30
|
-
/** Default S3 key prefix for offloaded payloads. */
|
|
31
|
-
export declare const DEFAULT_S3_KEY_PREFIX = "langgraph-checkpoints/";
|
|
32
|
-
/** Default S3 server-side encryption algorithm. */
|
|
33
|
-
export declare const DEFAULT_S3_SSE = "AES256";
|
|
34
|
-
/** Default minimum payload size before gzip compression is attempted. */
|
|
35
|
-
export declare const DEFAULT_COMPRESSION_MIN_BYTES = 1024;
|
|
36
|
-
/** Default gzip compression level (balanced speed/ratio). */
|
|
37
|
-
export declare const DEFAULT_COMPRESSION_LEVEL = 6;
|
|
38
|
-
/** Default gzip-bomb guard: maximum decompressed output (50 MiB). */
|
|
39
|
-
export declare const DEFAULT_MAX_DECOMPRESSED_BYTES: number;
|
|
40
|
-
/**
|
|
41
|
-
* Default cap on an offloaded object buffered from S3 (50 MiB), checked against
|
|
42
|
-
* `ContentLength` before the body is read and enforced while streaming when
|
|
43
|
-
* the length is unknown. Together with {@link DEFAULT_MAX_DECOMPRESSED_BYTES}
|
|
44
|
-
* it bounds the memory any single payload can claim.
|
|
45
|
-
*/
|
|
46
|
-
export declare const DEFAULT_MAX_S3_DOWNLOAD_BYTES: number;
|
|
47
|
-
/** Default maximum attempts for transient-error retries. */
|
|
48
|
-
export declare const DEFAULT_RETRY_MAX_ATTEMPTS = 5;
|
|
49
|
-
/** Largest `retry.maxAttempts` an adapter accepts; beyond it a retry loop is a hang, not a policy. */
|
|
50
|
-
export declare const MAX_RETRY_ATTEMPTS = 100;
|
|
51
|
-
/**
|
|
52
|
-
* Max attempts for the message-append transaction. It shares one session's
|
|
53
|
-
* metadata row across every concurrent `addMessages` caller on that session,
|
|
54
|
-
* so a burst of concurrent appends can collide repeatedly; combined with the
|
|
55
|
-
* existing 100ms base / 5000ms cap backoff, this keeps worst-case retrying
|
|
56
|
-
* within AWS's documented guidance to bound conflict retries to "around one
|
|
57
|
-
* minute" (see DynamoDB's "Error retries and exponential backoff" guide).
|
|
58
|
-
* This bound is exact for clients this library constructs, which disable the
|
|
59
|
-
* AWS SDK's own internal retries (`maxAttempts: 1`, see
|
|
60
|
-
* `resolveDynamoDBClient`). An injected client that keeps SDK retries stacks
|
|
61
|
-
* them inside each attempt; construction warns about that.
|
|
62
|
-
*/
|
|
63
|
-
export declare const MESSAGE_APPEND_RETRY_MAX_ATTEMPTS = 18;
|
|
64
|
-
/**
|
|
65
|
-
* Offloaded payloads decoded at once by one read (`getTuple` pending writes,
|
|
66
|
-
* `search` candidates, `getMessages`). Each offloaded row costs one S3 GET, so
|
|
67
|
-
* a serial loop scaled latency linearly with the row count; eight in flight
|
|
68
|
-
* keeps the win without bursting a bucket.
|
|
69
|
-
*/
|
|
70
|
-
export declare const DEFAULT_READ_CONCURRENCY = 8;
|
|
71
|
-
/** Default cap on candidates the in-DB semantic ranker will score. */
|
|
72
|
-
export declare const DEFAULT_MAX_SEARCH_CANDIDATES = 1000;
|
|
73
|
-
/**
|
|
74
|
-
* Raw rows a single `listCheckpoints` call may pull before it warns. The read
|
|
75
|
-
* itself is deliberately unbounded — capping it counted raw rows rather than
|
|
76
|
-
* filter-matched ones, which turned a caller asking for a handful of rare
|
|
77
|
-
* matches over a large thread into a hard error instead of the true answer.
|
|
78
|
-
* The warning restores the operational signal without restoring the wrong
|
|
79
|
-
* error.
|
|
80
|
-
*
|
|
81
|
-
* Its own literal, deliberately: this is the point at which a scan is worth
|
|
82
|
-
* telling an operator about, which is independent of
|
|
83
|
-
* {@link MAX_TOTAL_ITEMS_IN_MEMORY}'s hard collection cap. Aliasing the two
|
|
84
|
-
* meant retuning the memory cap silently moved the warning as well, and it
|
|
85
|
-
* left the pair reported as a duplicate export.
|
|
86
|
-
*/
|
|
87
|
-
export declare const LIST_SCAN_WARN_THRESHOLD = 10000;
|
|
88
|
-
/**
|
|
89
|
-
* Byte caps on caller-supplied identifiers, measured as UTF-8. DynamoDB caps a
|
|
90
|
-
* partition key at 2048 bytes and a sort key at 1024; S3 caps an object key at
|
|
91
|
-
* 1024. These leave room for the adapter prefixes and separators that compose
|
|
92
|
-
* the stored keys, so a value that passes validation fails as a typed error
|
|
93
|
-
* here rather than as a raw AWS ValidationException on the write.
|
|
94
|
-
*
|
|
95
|
-
* Partition-key identifiers: `thread_id` and `sessionId`.
|
|
96
|
-
*/
|
|
97
|
-
export declare const MAX_PARTITION_ID_BYTES = 1024;
|
|
98
|
-
/**
|
|
99
|
-
* Sort-key segments: `checkpoint_ns`, `checkpoint_id`, `taskId`, a pending-write
|
|
100
|
-
* channel, a store namespace element and a store `key`.
|
|
101
|
-
*/
|
|
102
|
-
export declare const MAX_KEY_SEGMENT_BYTES = 256;
|
|
103
|
-
/** DynamoDB cap on a whole sort key; composed keys are checked against it too. */
|
|
104
|
-
export declare const MAX_SORT_KEY_BYTES = 1024;
|
|
105
|
-
/** S3 cap on an object key, applied to the produced offload key. */
|
|
106
|
-
export declare const MAX_S3_KEY_BYTES = 1024;
|
|
107
|
-
/**
|
|
108
|
-
* Extra days an S3 lifecycle rule adds over the TTL it backs. DynamoDB's TTL
|
|
109
|
-
* sweep can lag up to ~48 h past the `ttl` timestamp; the offloaded object
|
|
110
|
-
* must outlive its row, never the other way round.
|
|
111
|
-
*/
|
|
112
|
-
export declare const S3_LIFECYCLE_SWEEP_MARGIN_DAYS = 2;
|
package/dist/shared/constants.js
DELETED
|
@@ -1,115 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.S3_LIFECYCLE_SWEEP_MARGIN_DAYS = exports.MAX_S3_KEY_BYTES = exports.MAX_SORT_KEY_BYTES = exports.MAX_KEY_SEGMENT_BYTES = exports.MAX_PARTITION_ID_BYTES = exports.LIST_SCAN_WARN_THRESHOLD = exports.DEFAULT_MAX_SEARCH_CANDIDATES = exports.DEFAULT_READ_CONCURRENCY = exports.MESSAGE_APPEND_RETRY_MAX_ATTEMPTS = exports.MAX_RETRY_ATTEMPTS = exports.DEFAULT_RETRY_MAX_ATTEMPTS = exports.DEFAULT_MAX_S3_DOWNLOAD_BYTES = exports.DEFAULT_MAX_DECOMPRESSED_BYTES = exports.DEFAULT_COMPRESSION_LEVEL = exports.DEFAULT_COMPRESSION_MIN_BYTES = exports.DEFAULT_S3_SSE = exports.DEFAULT_S3_KEY_PREFIX = exports.MAX_INLINE_PAYLOAD_BYTES = exports.DEFAULT_S3_THRESHOLD_BYTES = exports.S3_DELETE_BATCH_MAX = exports.MAX_BACKOFF_DELAY_MS = exports.INITIAL_BACKOFF_DELAY_MS = exports.MAX_UNPROCESSED_RETRIES = exports.BATCH_GET_MAX = exports.BATCH_WRITE_MAX = exports.MAX_TOTAL_ITEMS_IN_MEMORY = exports.MAX_LOOP_ITERATIONS = exports.MAX_TTL_SECONDS = exports.MAX_TTL_DAYS = void 0;
|
|
4
|
-
/** Maximum TTL expressed in days (5 years). */
|
|
5
|
-
exports.MAX_TTL_DAYS = 365 * 5;
|
|
6
|
-
/** Maximum TTL expressed in seconds: the same five years as {@link MAX_TTL_DAYS}. */
|
|
7
|
-
exports.MAX_TTL_SECONDS = exports.MAX_TTL_DAYS * 24 * 60 * 60;
|
|
8
|
-
/** Hard cap on query-pagination loop iterations (runaway-loop guard). */
|
|
9
|
-
exports.MAX_LOOP_ITERATIONS = 1000;
|
|
10
|
-
/** Hard cap on items collected into memory across a paginated query. */
|
|
11
|
-
exports.MAX_TOTAL_ITEMS_IN_MEMORY = 10000;
|
|
12
|
-
/** DynamoDB BatchWriteItem maximum requests per call. */
|
|
13
|
-
exports.BATCH_WRITE_MAX = 25;
|
|
14
|
-
/** DynamoDB BatchGetItem maximum keys per call. */
|
|
15
|
-
exports.BATCH_GET_MAX = 100;
|
|
16
|
-
/** Maximum retries draining UnprocessedItems / UnprocessedKeys. */
|
|
17
|
-
exports.MAX_UNPROCESSED_RETRIES = 10;
|
|
18
|
-
/** Starting delay for UnprocessedItems / UnprocessedKeys backoff loops. */
|
|
19
|
-
exports.INITIAL_BACKOFF_DELAY_MS = 100;
|
|
20
|
-
/** Maximum backoff delay for retry loops. */
|
|
21
|
-
exports.MAX_BACKOFF_DELAY_MS = 5000;
|
|
22
|
-
/** S3 DeleteObjects maximum keys per request. */
|
|
23
|
-
exports.S3_DELETE_BATCH_MAX = 1000;
|
|
24
|
-
/** Default payload size that triggers S3 offload (350 KB; 50 KB under the DDB 400 KB cap). */
|
|
25
|
-
exports.DEFAULT_S3_THRESHOLD_BYTES = 350 * 1024;
|
|
26
|
-
/**
|
|
27
|
-
* Largest serialized payload stored inline when no S3 offloader is configured:
|
|
28
|
-
* DynamoDB's 400 KB item cap less 8 KB of headroom for the item's keys,
|
|
29
|
-
* attribute names and descriptor fields. Exceeding it fails before the write
|
|
30
|
-
* with a typed error instead of a raw `ValidationException` after it.
|
|
31
|
-
*/
|
|
32
|
-
exports.MAX_INLINE_PAYLOAD_BYTES = 400 * 1024 - 8 * 1024;
|
|
33
|
-
/** Default S3 key prefix for offloaded payloads. */
|
|
34
|
-
exports.DEFAULT_S3_KEY_PREFIX = 'langgraph-checkpoints/';
|
|
35
|
-
/** Default S3 server-side encryption algorithm. */
|
|
36
|
-
exports.DEFAULT_S3_SSE = 'AES256';
|
|
37
|
-
/** Default minimum payload size before gzip compression is attempted. */
|
|
38
|
-
exports.DEFAULT_COMPRESSION_MIN_BYTES = 1024;
|
|
39
|
-
/** Default gzip compression level (balanced speed/ratio). */
|
|
40
|
-
exports.DEFAULT_COMPRESSION_LEVEL = 6;
|
|
41
|
-
/** Default gzip-bomb guard: maximum decompressed output (50 MiB). */
|
|
42
|
-
exports.DEFAULT_MAX_DECOMPRESSED_BYTES = 50 * 1024 * 1024;
|
|
43
|
-
/**
|
|
44
|
-
* Default cap on an offloaded object buffered from S3 (50 MiB), checked against
|
|
45
|
-
* `ContentLength` before the body is read and enforced while streaming when
|
|
46
|
-
* the length is unknown. Together with {@link DEFAULT_MAX_DECOMPRESSED_BYTES}
|
|
47
|
-
* it bounds the memory any single payload can claim.
|
|
48
|
-
*/
|
|
49
|
-
exports.DEFAULT_MAX_S3_DOWNLOAD_BYTES = 50 * 1024 * 1024;
|
|
50
|
-
/** Default maximum attempts for transient-error retries. */
|
|
51
|
-
exports.DEFAULT_RETRY_MAX_ATTEMPTS = 5;
|
|
52
|
-
/** Largest `retry.maxAttempts` an adapter accepts; beyond it a retry loop is a hang, not a policy. */
|
|
53
|
-
exports.MAX_RETRY_ATTEMPTS = 100;
|
|
54
|
-
/**
|
|
55
|
-
* Max attempts for the message-append transaction. It shares one session's
|
|
56
|
-
* metadata row across every concurrent `addMessages` caller on that session,
|
|
57
|
-
* so a burst of concurrent appends can collide repeatedly; combined with the
|
|
58
|
-
* existing 100ms base / 5000ms cap backoff, this keeps worst-case retrying
|
|
59
|
-
* within AWS's documented guidance to bound conflict retries to "around one
|
|
60
|
-
* minute" (see DynamoDB's "Error retries and exponential backoff" guide).
|
|
61
|
-
* This bound is exact for clients this library constructs, which disable the
|
|
62
|
-
* AWS SDK's own internal retries (`maxAttempts: 1`, see
|
|
63
|
-
* `resolveDynamoDBClient`). An injected client that keeps SDK retries stacks
|
|
64
|
-
* them inside each attempt; construction warns about that.
|
|
65
|
-
*/
|
|
66
|
-
exports.MESSAGE_APPEND_RETRY_MAX_ATTEMPTS = 18;
|
|
67
|
-
/**
|
|
68
|
-
* Offloaded payloads decoded at once by one read (`getTuple` pending writes,
|
|
69
|
-
* `search` candidates, `getMessages`). Each offloaded row costs one S3 GET, so
|
|
70
|
-
* a serial loop scaled latency linearly with the row count; eight in flight
|
|
71
|
-
* keeps the win without bursting a bucket.
|
|
72
|
-
*/
|
|
73
|
-
exports.DEFAULT_READ_CONCURRENCY = 8;
|
|
74
|
-
/** Default cap on candidates the in-DB semantic ranker will score. */
|
|
75
|
-
exports.DEFAULT_MAX_SEARCH_CANDIDATES = 1000;
|
|
76
|
-
/**
|
|
77
|
-
* Raw rows a single `listCheckpoints` call may pull before it warns. The read
|
|
78
|
-
* itself is deliberately unbounded — capping it counted raw rows rather than
|
|
79
|
-
* filter-matched ones, which turned a caller asking for a handful of rare
|
|
80
|
-
* matches over a large thread into a hard error instead of the true answer.
|
|
81
|
-
* The warning restores the operational signal without restoring the wrong
|
|
82
|
-
* error.
|
|
83
|
-
*
|
|
84
|
-
* Its own literal, deliberately: this is the point at which a scan is worth
|
|
85
|
-
* telling an operator about, which is independent of
|
|
86
|
-
* {@link MAX_TOTAL_ITEMS_IN_MEMORY}'s hard collection cap. Aliasing the two
|
|
87
|
-
* meant retuning the memory cap silently moved the warning as well, and it
|
|
88
|
-
* left the pair reported as a duplicate export.
|
|
89
|
-
*/
|
|
90
|
-
exports.LIST_SCAN_WARN_THRESHOLD = 10000;
|
|
91
|
-
/**
|
|
92
|
-
* Byte caps on caller-supplied identifiers, measured as UTF-8. DynamoDB caps a
|
|
93
|
-
* partition key at 2048 bytes and a sort key at 1024; S3 caps an object key at
|
|
94
|
-
* 1024. These leave room for the adapter prefixes and separators that compose
|
|
95
|
-
* the stored keys, so a value that passes validation fails as a typed error
|
|
96
|
-
* here rather than as a raw AWS ValidationException on the write.
|
|
97
|
-
*
|
|
98
|
-
* Partition-key identifiers: `thread_id` and `sessionId`.
|
|
99
|
-
*/
|
|
100
|
-
exports.MAX_PARTITION_ID_BYTES = 1024;
|
|
101
|
-
/**
|
|
102
|
-
* Sort-key segments: `checkpoint_ns`, `checkpoint_id`, `taskId`, a pending-write
|
|
103
|
-
* channel, a store namespace element and a store `key`.
|
|
104
|
-
*/
|
|
105
|
-
exports.MAX_KEY_SEGMENT_BYTES = 256;
|
|
106
|
-
/** DynamoDB cap on a whole sort key; composed keys are checked against it too. */
|
|
107
|
-
exports.MAX_SORT_KEY_BYTES = 1024;
|
|
108
|
-
/** S3 cap on an object key, applied to the produced offload key. */
|
|
109
|
-
exports.MAX_S3_KEY_BYTES = 1024;
|
|
110
|
-
/**
|
|
111
|
-
* Extra days an S3 lifecycle rule adds over the TTL it backs. DynamoDB's TTL
|
|
112
|
-
* sweep can lag up to ~48 h past the `ttl` timestamp; the offloaded object
|
|
113
|
-
* must outlive its row, never the other way round.
|
|
114
|
-
*/
|
|
115
|
-
exports.S3_LIFECYCLE_SWEEP_MARGIN_DAYS = 2;
|