Member Junction
    Preparing search index...

    Interface CompactIfNeededInput

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

    Properties

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

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

    BranchID?: string

    The branch whose path is compacted; null or omitted is the trunk.

    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.

    ExecutionScope?: AIPromptExecutionScope

    The run's execution scope (configuration, runtime keys, credential scope) for the summary prompt, so it runs on the same credentials as the run that triggered it. ContextUser still names the user.

    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)