Improve CustomEntry docs and make it generic

- Add detailed doc comment explaining purpose (hook state persistence)
- Make CustomEntry<T = unknown> generic
- Clarify difference from CustomMessageEntry in plan
- Update changelog
This commit is contained in:
Mario Zechner 2025-12-26 21:40:09 +01:00
parent e841942377
commit efb1036d8e
3 changed files with 17 additions and 6 deletions

View file

@ -61,11 +61,20 @@ export interface BranchSummaryEntry extends SessionEntryBase {
summary: string;
}
/** Custom entry for hooks. Use customType to identify your hook's entries. */
export interface CustomEntry extends SessionEntryBase {
/**
* Custom entry for hooks to store hook-specific data in the session.
* Use customType to identify your hook's entries.
*
* Purpose: Persist hook state across session reloads. On reload, hooks can
* scan entries for their customType and reconstruct internal state.
*
* Does NOT participate in LLM context (ignored by buildSessionContext).
* For injecting content into context, see CustomMessageEntry.
*/
export interface CustomEntry<T = unknown> extends SessionEntryBase {
type: "custom";
customType: string;
data?: unknown;
data?: T;
}
/** Label entry for user-defined bookmarks/markers on entries. */