import type { CompactionResult, ExtensionContext, SessionBeforeCompactEvent } from "@earendil-works/pi-coding-agent"; import type { CompactionEnricher } from "./enrichers.js"; import { type FabricCompactionDetailsV2 } from "./hook.js"; import type { FabricCompactionFallbackOptionsV1, FabricCompactionOwnerActionsV1, FabricCompactionOwnerClaimResultV1, FabricCompactionOwnerClaimV1, FabricCompactionOwnerCarryFieldV1, FabricCompactionOwnerIdentityV1, FabricCompactionOwnerMessageV1, FabricCompactionOwnerRequestFieldV1 } from "../protocol.js"; export declare const COMPACTION_OWNER_REQUEST_FIELDS: readonly FabricCompactionOwnerRequestFieldV1[]; /** Upper bound on one owner handler call; past it Fabric aborts the call's signal and fails the program call. */ export declare const COMPACTION_OWNER_HANDLER_TIMEOUT_MS = 30000; export declare const COMPACTION_OWNER_CARRY_FIELDS: readonly FabricCompactionOwnerCarryFieldV1[]; export interface ActiveCompactionOwner { readonly owner: Readonly; readonly actions: Readonly; readonly branchSummary: boolean; } export declare const compactionOwnerLabel: (owner: FabricCompactionOwnerIdentityV1) => string; export type CompactionFallback = (event: SessionBeforeCompactEvent, context: ExtensionContext | undefined, options: FabricCompactionFallbackOptionsV1 | undefined) => { ok: true; compaction: CompactionResult; } | { ok: false; reason: string; }; export interface CompactionOwnerRegistryOptions { /** Shown when a claim is refused because another owner holds it. */ warn: (message: string) => void; /** Fabric's deterministic summary, offered to the holder only. */ fallback: CompactionFallback; /** Called once each time a held claim ends, before Fabric resumes. */ onRelease?: () => void; /** Fabric's current carry-forward items; undefined before Fabric knows the session. */ carry?: () => readonly string[] | undefined; } /** * The owner's fallback: Fabric's deterministic summary for the event, with * the same budget and enrichers as Fabric's own hook. Owner-supplied carry * items must fit the `compact.carry` limits and replace the stored list. */ export declare const deterministicCompactionFallback: (targetContextRatio: () => number | undefined, enrichers?: readonly CompactionEnricher[]) => CompactionFallback; export declare class CompactionOwnerRegistry { #private; private readonly options; constructor(options: CompactionOwnerRegistryOptions); get active(): ActiveCompactionOwner | undefined; /** Answers one validated protocol message. */ handle(message: FabricCompactionOwnerMessageV1): void; claim(message: FabricCompactionOwnerClaimV1): FabricCompactionOwnerClaimResultV1; /** Only the holder's token releases the claim. */ withdraw(token: string): boolean; /** Drops any claim; Fabric's engine is back in charge. */ clear(): void; } //# sourceMappingURL=claim.d.ts.map