import { IRange } from "../../../../editor/common/core/range.js"; import { URI } from "../../../../base/common/uri.js"; import { AgentFeedbackKind, AgentFeedbackState, IAgentFeedback, IAgentFeedbackReply } from "./agentFeedbackModel.js"; import { ICodeReviewSuggestion, IPRReviewComment, IPRReviewState } from "../../codeReview/browser/codeReviewService.js"; import { IFeedbackPullRequest } from "../../../../platform/agentHost/common/meta/agentFeedbackAnnotations.js"; export declare enum SessionEditorCommentSource { AgentFeedback = "agentFeedback", PRReview = "prReview" } export interface ISessionEditorComment { readonly id: string; readonly sourceId: string; readonly source: SessionEditorCommentSource; /** Origin of this comment, used to render its type label. */ readonly kind: AgentFeedbackKind; readonly sessionResource: URI; readonly resourceUri: URI; readonly range: IRange; readonly text: string; readonly author?: string; readonly suggestion?: ICodeReviewSuggestion; readonly sourcePRReviewCommentId?: string; readonly sourcePullRequest?: IFeedbackPullRequest; readonly canConvertToAgentFeedback: boolean; /** * Replies that belong to the same comment thread as this comment. They * talk about the same code region as {@link text}. Only set for agent * feedback comments today. */ readonly replies?: readonly IAgentFeedbackReply[]; /** * Lifecycle state of this comment. Only set for agent feedback comments. */ readonly state?: AgentFeedbackState; } export declare function getPRReviewComments(prReviewState: IPRReviewState | undefined): readonly IPRReviewComment[]; export declare function getSessionEditorComments(sessionResource: URI, agentFeedbackItems: readonly IAgentFeedback[], prReviewState?: IPRReviewState, visibleResolvedFeedbackIds?: ReadonlySet, includeRawPRReviewComments?: boolean): readonly ISessionEditorComment[]; export declare function compareSessionEditorComments(a: ISessionEditorComment, b: ISessionEditorComment): number; export declare function groupNearbySessionEditorComments(items: readonly ISessionEditorComment[], lineThreshold?: number): ISessionEditorComment[][]; export declare function getResourceEditorComments(resourceUri: URI, comments: readonly ISessionEditorComment[]): readonly ISessionEditorComment[]; export declare function toSessionEditorCommentId(source: SessionEditorCommentSource, sourceId: string): string; /** * Inverse of {@link toSessionEditorCommentId}. Returns `undefined` when the id * does not match the `${source}:${sourceId}` shape produced above. */ export declare function fromSessionEditorCommentId(id: string): { readonly source: SessionEditorCommentSource; readonly sourceId: string; } | undefined; export declare function getAcceptedAgentFeedbackCommentCount(comments: readonly ISessionEditorComment[]): number; export declare function hasAcceptedAgentFeedbackComments(comments: readonly ISessionEditorComment[]): boolean;