( trigger: 'auto' | 'manual', preTokens: number, sessionId: string, parentUuid: string | null, )
| 183 | |
| 184 | /** Create a compact_boundary system entry. */ |
| 185 | export function createCompactBoundary( |
| 186 | trigger: 'auto' | 'manual', |
| 187 | preTokens: number, |
| 188 | sessionId: string, |
| 189 | parentUuid: string | null, |
| 190 | ): SessionEntry { |
| 191 | return { |
| 192 | type: 'system', |
| 193 | subtype: 'compact_boundary', |
| 194 | message: { role: 'system', content: 'Conversation compacted' }, |
| 195 | compactMetadata: { trigger, preTokens }, |
| 196 | uuid: randomUUID(), |
| 197 | parentUuid, |
| 198 | sessionId, |
| 199 | timestamp: new Date().toISOString(), |
| 200 | provider: 'compaction', |
| 201 | } |
| 202 | } |
| 203 | |
| 204 | /** Create the summary user entry that follows a compact_boundary. */ |
| 205 | export function createSummaryEntry( |
no outgoing calls
no test coverage detected