(state: SessionState)
| 5 | export const COMPRESSED_BLOCK_HEADER = "[Compressed conversation section]" |
| 6 | |
| 7 | export function allocateBlockId(state: SessionState): number { |
| 8 | const next = state.prune.messages.nextBlockId |
| 9 | if (!Number.isInteger(next) || next < 1) { |
| 10 | state.prune.messages.nextBlockId = 2 |
| 11 | return 1 |
| 12 | } |
| 13 | |
| 14 | state.prune.messages.nextBlockId = next + 1 |
| 15 | return next |
| 16 | } |
| 17 | |
| 18 | export function allocateRunId(state: SessionState): number { |
| 19 | const next = state.prune.messages.nextRunId |