( trigger: 'manual' | 'auto', preTokens: number, lastPreCompactMessageUuid?: UUID, userContext?: string, messagesSummarized?: number, )
| 4530 | } |
| 4531 | |
| 4532 | export function createCompactBoundaryMessage( |
| 4533 | trigger: 'manual' | 'auto', |
| 4534 | preTokens: number, |
| 4535 | lastPreCompactMessageUuid?: UUID, |
| 4536 | userContext?: string, |
| 4537 | messagesSummarized?: number, |
| 4538 | ): SystemCompactBoundaryMessage { |
| 4539 | return { |
| 4540 | type: 'system', |
| 4541 | subtype: 'compact_boundary', |
| 4542 | content: `Conversation compacted`, |
| 4543 | isMeta: false, |
| 4544 | timestamp: new Date().toISOString(), |
| 4545 | uuid: randomUUID(), |
| 4546 | level: 'info', |
| 4547 | compactMetadata: { |
| 4548 | trigger, |
| 4549 | preTokens, |
| 4550 | userContext, |
| 4551 | messagesSummarized, |
| 4552 | }, |
| 4553 | ...(lastPreCompactMessageUuid && { |
| 4554 | logicalParentUuid: lastPreCompactMessageUuid, |
| 4555 | }), |
| 4556 | } |
| 4557 | } |
| 4558 | |
| 4559 | export function createMicrocompactBoundaryMessage( |
| 4560 | trigger: 'auto', |
no outgoing calls
no test coverage detected