/** * Session-scoped injectedContext dedupe (B1). * * Agim Agent dumps system+ephemeral into every turn's activity for the * accordion viewer. The skills-heavy system prompt (~tens of KB) was being * persisted verbatim on every assistant message, blowing up session JSON. * * Persist the full text once; later identical turns store a short marker. * History / SPA expand the marker back to the prior full copy for display. */ /** Wire + disk stub when this turn's injection matches an earlier full copy. */ export declare const INJECTED_CONTEXT_UNCHANGED_MARKER = "\u00ABagim-ic-unchanged\u00BB"; export declare function isInjectedContextUnchangedMarker(text: string | undefined | null): boolean; /** Persist full text, or the unchanged marker when equal to a prior full copy. */ export declare function dedupeInjectedContextForPersist(text: string | undefined, priorFull: string | undefined): string | undefined; /** Resolve a stored value (full or marker) against the last known full text. */ export declare function resolveInjectedContextText(stored: string | undefined, priorResolved: string | undefined): string | undefined; type ActivityWithInjected = { injectedContext?: string; }; type MessageWithActivity = { activity?: ActivityWithInjected; }; /** * Walk messages oldest→newest and expand unchanged markers to the last full * injectedContext. Returns the same array reference when nothing changes. */ export declare function expandInjectedContextsInMessages(messages: T[]): T[]; /** Last full (non-marker) injectedContext in a message list, scanning newest first. */ export declare function findLastFullInjectedContext(messages: Array<{ activity?: { injectedContext?: string; }; }>): string | undefined; export {}; //# sourceMappingURL=injected-context-dedupe.d.ts.map