import type { Discussion, GitLabClient } from './gitlab.js'; import type { GeneratedComment, SizeSkippedFile } from './types.js'; export declare const SUMMARY_MARKER = ""; export declare const SUMMARY_HISTORY_START = ""; export declare const SUMMARY_HISTORY_END = ""; export declare const SUMMARY_HISTORY_ENTRY_START = ""; export declare const SUMMARY_HISTORY_ENTRY_END = ""; export declare const SUMMARY_HISTORY_LIMIT = 10; /** * Matches the reviewed-commit footer on read. Both the scope and the repo URL * host path accept the current `weareikko` org and the legacy `ikko-dev` org, * and both the name segment and the repo name accept the current `code-review` * and the legacy `gitlab-review`. The GitHub repo was renamed * `weareikko/gitlab-review` → `weareikko/code-review`, so writers now emit the * `code-review` URL; matching both keeps the reviewed-commit skip working on * MRs/PRs already reviewed under any prior identity. */ export declare const REVIEWED_COMMIT_FOOTER_PATTERN: RegExp; export type SummaryAction = 'created' | 'updated'; export interface SummaryResult { action: SummaryAction; noteId?: number; } export interface SummaryNote { id: number; body: string; } /** * MR-level "this change is too big" signal. Surfaced as a prominent callout at * the top of the summary so a reviewer cannot miss that part of the change went * unreviewed or that the MR is past a human's reviewability threshold. */ export interface SizeNotice { /** Files dropped for exceeding the char budget. */ sizeSkippedFiles: SizeSkippedFile[]; /** Set when the reviewed diff's changed-line count crossed the configured threshold. */ decomposeHint?: { lines: number; threshold: number; }; /** Diff coverage when files were dropped: reviewed vs total changed lines. */ coverage?: { reviewedLines: number; totalLines: number; }; /** * True when the dropped diffs were staged on disk for on-demand retrieval, so * the callout frames them as staged-and-readable rather than lost outright. */ retrieved?: boolean; } export interface SummaryBodyOptions { historyEntries?: string[]; reviewedCommitSha?: string; skillsFooter?: string; mcpFooter?: string; runId?: string; /** Prominent size/decompose callout rendered above the reviewer's summary. */ sizeNotice?: SizeNotice; } export interface UpsertSummaryOptions extends SummaryBodyOptions { archivedAt?: Date; costFooter?: string; } /** * Render the prominent size/decompose callout that sits directly under the * "### Code Review" heading. Returns an empty string when there is nothing to * surface, so the summary body is byte-for-byte unchanged in the common case. */ export declare function buildSizeNoticeBlock(notice?: SizeNotice): string; export declare function buildSummaryBody(summary: string, costFooter?: string, options?: SummaryBodyOptions): string; export declare function buildReviewedCommitFooter(commitSha: string): string; export declare function extractReviewedCommitSha(body: string): string | null; export declare function findExistingReviewedCommitSha(discussions: Discussion[]): string | null; export declare function findExistingSummaryNote(discussions: Discussion[]): SummaryNote | null; export declare function findExistingSummaryNoteId(discussions: Discussion[]): number | null; export declare function buildArchivedSummaryEntry(body: string, archivedAt?: Date): string; export declare function extractSummaryHistoryEntries(body: string): string[]; export declare function stripSummaryHistory(body: string): string; export declare function stripSummaryMarker(body: string): string; export declare function buildSummaryHistoryEntries(existingBody: string, archivedAt?: Date): string[]; /** * Resolve the summary upsert into the note body to write plus the existing note * to update (or `null` to create). Platform-agnostic — it operates on the * normalized {@link Discussion}[] and returns strings/ids — so both the GitLab * and GitHub platforms share the exact same body-building and history-carryover * logic and only differ in which API call posts the result. */ export declare function buildUpsertSummary(summary: string, discussions: Discussion[], options: UpsertSummaryOptions): { body: string; existing: SummaryNote | null; }; export declare function upsertSummaryNote(gitlab: GitLabClient, project: string, mr: string, summary: string, discussions: Discussion[], costFooterOrOptions?: string | UpsertSummaryOptions): Promise; export type PostingMode = 'direct' | 'draft'; export declare const POSTING_MODES: readonly PostingMode[]; export declare const DRAFT_CONCURRENCY = 10; export interface PostResult { posted: number; drafts?: { abandoned: number; created: number; deletedPrePublish: number; published: number; /** * Drafts that survived the pre-publish race check but could not be * published, counted only on the per-draft fallback path (a `bulk_publish` * 500 forced individual publishes and some still failed). 0 on the normal * path. A non-zero value means inline comments were silently dropped. */ publishFailed: number; }; } export declare function postGeneratedComments(gitlab: GitLabClient, project: string, mr: string, generated: GeneratedComment[], mode?: PostingMode): Promise; //# sourceMappingURL=posting.d.ts.map