import { IObservable } from "../../../../../base/common/observable.js"; import { URI } from "../../../../../base/common/uri.js"; import { type DefaultChangesetKind } from "../../../../../platform/agentHost/common/changesetUri.js"; import { Changeset, StateComponents, type SessionState } from "../../../../../platform/agentHost/common/state/sessionState.js"; import { ISessionChangeset, ISessionFileChange, ISessionTurnFileChange } from "../../../../services/sessions/common/session.js"; import { IAgentHostAdapterOptions } from "./baseAgentHostSessionsProvider.js"; export interface IAgentHostChangeset extends Changeset { /** Provider-neutral identity when it differs from the protocol change kind. */ readonly id?: string; /** * Optional authoritative changes. `undefined` falls back to the changeset * channel; an array, including an empty one, is used as-is. */ readonly changes?: IObservable; /** Live changes layered over the authoritative changeset until its next cached `Recomputing` or `Ready` snapshot. */ readonly streamingChanges?: IObservable; } /** File changes published by one active turn. */ export interface IAgentHostCurrentTurnChanges { readonly id: string; readonly changes: readonly ISessionTurnFileChange[]; } /** * For multi-root sessions, keeps only changes under the primary working * directory (`workingDirectories[0]`); single-root/empty/`undefined` inputs are * returned unchanged. Paths are compared on the primary's `file:` scheme so * `agent-host:`-wrapped changes still match and OS path-casing is respected. */ export declare function filterChangesToPrimaryWorkingDirectory(changes: readonly ISessionFileChange[], workingDirectories: readonly string[] | undefined): readonly ISessionFileChange[]; export declare function createChangesets(sessionUri: URI, options: IAgentHostAdapterOptions, isActiveSessionObs: IObservable, changesets: readonly IAgentHostChangeset[] | undefined, chatUri?: URI, defaultChangesetKind?: DefaultChangesetKind | undefined): readonly ISessionChangeset[]; export declare function createChatChangesets(sessionUri: URI, chatUriObs: IObservable, options: IAgentHostAdapterOptions, isActiveSessionObs: IObservable, currentTurnChanges?: IObservable, defaultChangesetKind?: DefaultChangesetKind | undefined): IObservable; export declare function createActiveSessionSubscriptionObs(options: IAgentHostAdapterOptions, isActiveSessionObs: IObservable, component: StateComponents, resourceObs: IObservable): IObservable>; /** * Selects the URI of the session's most recently modified chat — the one that * holds the session's "last turn". Falls back to the session's advertised * default chat (`defaultChat`) when the * state is absent/errored or lists no chat. * * Shared by {@link AgentHostLastTurnChangeset} and the output-stream-derived * last-turn changes so the "Last Turn Changes" changeset and the chat input * status pills always resolve the same chat. */ export declare function selectMostRecentChatUri(sessionState: SessionState | Error | undefined | null, defaultChat: string | undefined): URI | undefined;