mirror of
https://github.com/danny-avila/LibreChat.git
synced 2026-08-04 06:52:47 +00:00
🧱 fix: Add explicit types for isolatedDeclarations build
The production build (tsdown + rolldown-plugin-dts) compiles with --isolatedDeclarations, which requires explicit type annotations on exported bindings whose initializers it can't infer syntactically. `CHECKPOINT_HARD_LIMIT_BYTES` (arithmetic over two consts) tripped TS9010; annotate it and `CHECKPOINT_WARN_BYTES` as `number`. Verified with `tsc --isolatedDeclarations` over the package.
This commit is contained in:
parent
e5fa0395b6
commit
fdad5c02a6
1 changed files with 3 additions and 2 deletions
|
|
@ -143,13 +143,14 @@ const CHECKPOINT_SIZE_HEADROOM_BYTES = 1024 * 1024;
|
|||
* way (the document can't be written), so failing here as a typed {@link CheckpointTooLargeError}
|
||||
* turns an opaque `BSONObjectTooLarge` crash into an actionable one.
|
||||
*/
|
||||
export const CHECKPOINT_HARD_LIMIT_BYTES = MAX_BSON_DOCUMENT_BYTES - CHECKPOINT_SIZE_HEADROOM_BYTES;
|
||||
export const CHECKPOINT_HARD_LIMIT_BYTES: number =
|
||||
MAX_BSON_DOCUMENT_BYTES - CHECKPOINT_SIZE_HEADROOM_BYTES;
|
||||
|
||||
/**
|
||||
* Warn once a persisted checkpoint crosses this soft threshold (~50% of the ceiling), so a
|
||||
* conversation's checkpoint growth is visible in logs well before it reaches the hard limit.
|
||||
*/
|
||||
export const CHECKPOINT_WARN_BYTES = 8 * 1024 * 1024;
|
||||
export const CHECKPOINT_WARN_BYTES: number = 8 * 1024 * 1024;
|
||||
|
||||
/**
|
||||
* A HITL checkpoint whose serialized state exceeds {@link CHECKPOINT_HARD_LIMIT_BYTES} — more
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue