import type { AgentEndEvent, ExtensionContext } from "@earendil-works/pi-coding-agent"; import type { OrganizerResult } from "./commit-events.js"; import { type CompleteFn } from "./commit-prompt.js"; import type { PiAutocommitConfig } from "./config.js"; import type { ReorganiserStore } from "./reorganiser-store.js"; /** Marker used for checkpoint commits created at `turn_end`. */ export declare const CHECKPOINT_COMMIT_MARKER = "wip(checkpoint):"; /** * At `agent_end`, detect any checkpoint commits created during the agent * loop and reorganise them into logical Conventional Commits. * * The function uses the current model to analyse the combined diff and the * assistant's own explanations (from `event.messages`) to decide how to split * the changes. If the LLM call fails or the response cannot be parsed, it * falls back to a single Conventional Commit containing all changes. * * @param targetSessionId When provided, only reorganise checkpoint commits * whose `Checkpoint-Session` trailer matches. Scattered (non-consecutive) * matching commits from older sessions are NOT handled here — use * {@link reorganiseCheckpointsManual} for that. */ export declare function organizeCheckpointCommits(ctx: ExtensionContext, config: PiAutocommitConfig, event: AgentEndEvent, store: ReorganiserStore, complete?: CompleteFn, targetSessionId?: string): Promise; /** * Entry point for the manual `/autocommit-organise` command. * * When `targetSessionId` is omitted, reorganises ALL reachable checkpoint commits at * HEAD (same as the no-argument manual command). When provided, reorganises * only the commits that carry that session's `Checkpoint-Session` trailer, * handling both contiguous and scattered (interleaved) cases. * * @param complete Optional LLM adapter (injected in tests). */ export declare function reorganiseCheckpointsManual(ctx: ExtensionContext, config: PiAutocommitConfig, store: ReorganiserStore, targetSessionId?: string, complete?: CompleteFn): Promise; /** * Reorganise a user-selected range of commits into logical Conventional Commits. * * Called from the interactive commit picker popup at `agent_end`. When the * range starts at HEAD (startIndex=0), uses the fast path * (`resetSoft`). When the range starts after HEAD (startIndex>0), preserves * the above-range commits by extracting the range diff, resetting to before * the range, applying the range diff, reorganising, then cherry-picking the * above-range commits back on top. * * @param range 0-based indexes from HEAD (inclusive). `startIndex` ≤ `endIndex`. */ export declare function reorganiseSelectedRange(ctx: ExtensionContext, config: PiAutocommitConfig, event: AgentEndEvent, store: ReorganiserStore, range: { startIndex: number; endIndex: number; }, complete?: CompleteFn): Promise; //# sourceMappingURL=commit-organizer.d.ts.map