import type { ProjectReadBoundary } from "../io/bootstrap-write-boundary.js"; import type { ProjectReadSnapshot } from "../io/project-read-snapshot.js"; import type { FileRole } from "../runtime/types.js"; import { type RuleDeliveryStage } from "./rule-delivery-context.js"; import type { RuleDeliveryRole } from "./rule-frontmatter.js"; import type { RuleFrontmatterDiagnostic } from "./rule-frontmatter-diagnostics.js"; export { RULE_DELIVERY_STAGE_RELEVANCE, ruleDeliveryStageForBlocker } from "./rule-delivery-context.js"; export type DeliveredRule = { readonly id: string; readonly path: string; readonly policies: readonly string[]; }; export type RuleDeliverySummary = { readonly budget: number; readonly diagnostics: readonly RuleFrontmatterDiagnostic[]; readonly estimatedTokens: number; readonly policyCount: number; readonly role: RuleDeliveryRole; readonly ruleCount: number; readonly rulePackHash: string; readonly rules: readonly DeliveredRule[]; readonly stage?: RuleDeliveryStage; }; export type RederivedRuleDelivery = { readonly kind: "hash-mismatch"; readonly actualRulePackHash: string; readonly expectedRulePackHash: string; readonly role: RuleDeliveryRole; readonly stage?: RuleDeliveryStage; } | { readonly kind: "matched"; readonly role: RuleDeliveryRole; readonly rulePackHash: string; readonly rulePaths: readonly string[]; readonly stage?: RuleDeliveryStage; }; export declare function takePoliciesForDelivery(rulePath: string, policies: readonly string[], maxBullets?: number): string[]; export declare function rulePackContentHash(projectDir: string, boundary?: ProjectReadBoundary, snapshot?: ProjectReadSnapshot): string; export declare function selectRulesForDelivery(projectDir: string, role: RuleDeliveryRole, options?: { readonly fileRole?: FileRole; readonly stage?: RuleDeliveryStage; readonly targetFile?: string; }): RuleDeliverySummary; export declare function formatRuleDeliveryPromptLines(delivery: RuleDeliverySummary): readonly string[]; export declare function rederiveDeliveredRulePaths(projectDir: string, role: RuleDeliveryRole, expectedRulePackHash: string, options?: { readonly stage?: RuleDeliveryStage; }): RederivedRuleDelivery; export declare function ruleDeliveryRoleForBlocker(blockerId: string): RuleDeliveryRole; export declare function ruleDeliveryRoleForWorkText(text: string): RuleDeliveryRole;