Member Junction
    Preparing search index...

    Interface CompactIfNeededInput

    interface CompactIfNeededInput {
        Agent: MJAIAgentEntityExtended;
        AgentRunId?: string;
        AgentType: MJAIAgentTypeEntity;
        Budget: EffectiveContextBudget;
        ContextUser: UserInfo;
        ConversationId: string;
        EstimateTokens: (messages: ConversationContextMessage[]) => number;
        ExcludeDetailIds?: string[];
        OnPromptRunCreated?: (promptRunId: string) => void | Promise<void>;
        Provider?: IMetadataProvider;
        Verbose?: boolean;
    }
    Index

    Properties

    The executing agent (per-agent compaction knobs + summary prompt override)

    AgentRunId?: string

    The executing agent run's ID — stamped onto the summary AIPromptRun (AgentRunID) so per-run cost rollups include the summary sub-call this feature generates.

    The agent's type (type-level defaults) — null only for typeless programmatic runs

    ContextUser: UserInfo
    ConversationId: string

    The conversation whose window may need compacting

    EstimateTokens: (messages: ConversationContextMessage[]) => number

    Token estimator for context messages — supplied by the caller so trigger math uses the SAME heuristic BaseAgent uses for in-turn context management (no drift).

    ExcludeDetailIds?: string[]

    Detail rows to omit from the assembled window — e.g. the in-flight agent-response placeholder row, whose Message the resolver may still be writing concurrently with a post-turn pass. Without this, the boundary could land on that row and the summary write's Load→Save (generated spUpdate writes all columns) could clobber it.

    OnPromptRunCreated?: (promptRunId: string) => void | Promise<void>

    Fires with the summary AIPromptRun ID as soon as the run record exists (step TargetLogID wiring)

    Provider for the boundary-row entity write (falls back to the global provider)

    Verbose?: boolean

    Verbose diagnostics (LogStatusEx verboseOnly)