MCPcopy Create free account
hub / github.com/TraderAlice/OpenAlice / createCompactBoundary

Function createCompactBoundary

src/core/compaction.ts:185–202  ·  view source on GitHub ↗
(
  trigger: 'auto' | 'manual',
  preTokens: number,
  sessionId: string,
  parentUuid: string | null,
)

Source from the content-addressed store, hash-verified

183
184/** Create a compact_boundary system entry. */
185export 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. */
205export function createSummaryEntry(

Callers 3

compaction.spec.tsFile · 0.85
compactIfNeededFunction · 0.85
forceCompactFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected