🧱 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:
Danny Avila 2026-07-07 16:06:51 -04:00
parent e5fa0395b6
commit fdad5c02a6
No known key found for this signature in database
GPG key ID: BF31EEB2C5CA0956

View file

@ -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