/** * FieldFlags — serializable replacement for `Set` used in per-record * dirty/loaded tracking across the agent-definition and agent-shortcuts slices. * * `Set` is not JSON-serializable, which blocks: * - Redux state persistence (localStorage, AsyncStorage) * - Extracting the agent Redux stack into a framework-agnostic shared package * - DevTools time-travel (Sets render as opaque placeholders) * * Replacement shape: `Partial>`. The presence of a key means * the flag is set; `true` is the canonical marker. `delete record[key]` clears. * * Use the helpers below instead of raw object access so the intent at each * callsite remains readable (`hasField(flags, "messages")` vs `!!flags.messages`). */ type FieldFlags = Partial>; declare function createFieldFlags(): FieldFlags; declare function hasField(flags: FieldFlags, field: K): boolean; declare function addField(flags: FieldFlags, field: K): void; declare function removeField(flags: FieldFlags, field: K): void; declare function fieldFlagsSize(flags: FieldFlags): number; declare function fieldFlagsKeys(flags: FieldFlags): K[]; declare function forEachField(flags: FieldFlags, fn: (field: K) => void): void; /** * Assign a single dynamically-keyed field on a record without an `as any` * escape hatch. The generic binds `K extends keyof T` and `value: T[K]` * together at the call site, so the write stays type-sound — TypeScript * just can't prove `record[field] = value` is safe at a *computed* index * without this indirection (a known inference gap for mapped-object writes, * not an unsoundness). */ declare function assignField(record: T, field: K, value: T[K]): void; /** * Read a single dynamically-keyed field off a record without an * `as unknown as Record` whole-row cast. Same generic * bridging as `assignField`, for the read direction. */ declare function readField(record: T, field: K): T[K]; export { addField, assignField, createFieldFlags, fieldFlagsKeys, fieldFlagsSize, forEachField, hasField, readField, removeField }; export type { FieldFlags };