/** * codeprism sync — git-aware post-merge knowledge base updater. * * Called automatically by git hooks (post-merge, post-checkout, post-rewrite) * or manually. Detects what changed since the last git operation, classifies * the current branch, and tells the running codeprism server to invalidate * affected cards. * * Branch classification drives the level of invalidation: * * demo/* / *-demo / *_demo → skip — demo branches never touch the KB * main / master / develop / staging / epic/* → full — cross-repo propagation * feature/* / fix/* / hotfix/* / bugfix/* → lightweight — per-card staleness only * anything else → lightweight (safe default) * * If the codeprism server is not reachable the command exits 0 silently — git * workflows must never be blocked by codeprism. */ export type SyncLevel = "skip" | "lightweight" | "full"; export interface SyncOptions { /** Override the detected port. Defaults to CODEPRISM_PORT env or 4000. */ port?: number; /** Force a specific event type instead of the auto-detected one. */ eventType?: "save" | "merge" | "pull" | "rebase" | "checkout"; /** Previous HEAD sha (passed by post-checkout hook as $1) to detect parent branch. */ prevHead?: string; /** Explicitly name the repo (defaults to git remote inference). */ repo?: string; /** Print what would happen without sending to the server. */ dryRun?: boolean; } export interface BranchContext { branch: string; /** Jira/Linear ticket ID extracted from the branch name, e.g. "ENG-123". Null if absent. */ ticketId: string | null; /** * Human-readable context hint derived from the branch name. * Used as the MCP query when no ticket ID is available. * * Examples: * "feature/ENG-123-billing-filter" → "billing filter" (ticket ID is separate) * "add-some-weird-thing" → "add some weird thing" * "epic/orlando_demo" → "orlando demo" */ contextHint: string; /** Epic name inferred from the parent branch, e.g. "orlando demo". Null if not from an epic. */ epicBranch: string | null; syncLevel: SyncLevel; } /** * Extracts structured context from a branch name. * * When no ticket ID is present, the branch words themselves become the context * hint and drive MCP searches automatically. * * @param branch Current branch name (e.g. "add-some-weird-thing") * @param prevHead Previous HEAD sha OR branch name from git checkout $1 */ export declare function extractBranchContext(branch: string, prevHead?: string): BranchContext; /** * Classifies a branch name into the level of KB invalidation to perform. * * | Level | What it does | * |-------------|---------------------------------------------------------------| * | skip | No-op. Demo/experimental branches don't touch the KB. | * | lightweight | Mark affected cards stale only. No cross-repo propagation. | * | full | Full invalidation + cross-repo propagation + doc cascade. | */ export declare function classifyBranch(branch: string): SyncLevel; export interface CheckoutContextPayload { branch: string; repo: string; ticketId: string | null; contextHint: string; epicBranch: string | null; } export declare function runSync(cwd: string, opts?: SyncOptions): Promise; //# sourceMappingURL=sync.d.ts.map