eve
Version:
Filesystem-first framework for durable backend AI agents that run anywhere.
35 lines (34 loc) • 1.54 kB
TypeScript
import type { ModelMessage } from "ai";
export declare const COMPACTION_CHECKPOINT_MARKER = "Summary of our conversation so far:";
/** Synthetic resumption prompt used when no real user message can be replayed. */
export declare const COMPACTION_RESUMPTION_MESSAGE = "Continue.";
/**
* Label line of the framework-injected todo preservation message. Owned here
* so compaction can recognize the message as synthetic when picking a user
* message to replay after compaction.
*/
export declare const TODO_COMPACTION_PRESERVATION_LABEL = "[Your task list was preserved across context compaction]";
export interface CompactionPrompt {
readonly prompt: string;
readonly system: string;
}
/** Static prompt text added around checkpoint and conversation content. */
export declare const COMPACTION_PROMPT_ENVELOPE: {
prompt: string;
system: string;
};
/**
* Builds the compaction model input from framework-owned checkpoint state and
* older messages.
*
* Conversational text is rendered verbatim. When `transcriptBudgetTokens` is
* set and the rendered prompt exceeds it, conversational text is capped at
* {@link DEGRADED_TEXT_LIMIT} starting from the oldest entries until the
* prompt fits; the previous checkpoint is never truncated.
*/
export declare function createCompactionPrompt(input: {
readonly messages: readonly ModelMessage[];
readonly previousCheckpoint: string | undefined;
readonly transcriptBudgetTokens?: number;
}): CompactionPrompt;
export declare const TRANSCRIPT_PAYLOAD_LIMIT = 2000;