/** * Shared types, config helpers, and formatting utilities for the ADO plugin. * * Used by both the server module (index.ts) and the TUI module (tui.tsx). * Import from here instead of duplicating definitions. * */ export interface AdoProfile { org: string; project: string; patEnvVar: string; /** Direct PAT value (takes priority over patEnvVar when both present). */ pat?: string; repos: string[]; default?: boolean; capabilities?: { workItems?: boolean; }; } /** Default work item states to fetch in queries.*/ export declare const IMPORTANT_WORK_ITEM_STATES: readonly ["New", "In Dev", "Ready for QA", "Accepted in QA", "In QA"]; export interface AdoConfig { defaultProfile?: string; profiles: Record; } export interface PRSummary { id: number; title: string; repo: string; source: string; target: string; author: string; isDraft: boolean; /** Vote status if the current user is a reviewer: 0=none, 10=approved, 5=suggestions, -5=waiting, -10=rejected. undefined if not a reviewer. */ myVote?: number; } export interface WorkItemSummary { id: number; title: string; state: string; type: string; assignedTo: string; priority: number; changedDate?: string; /** Reproduction steps for QA-related work items (Microsoft.VSTS.TCM.ReproSteps). */ reproSteps?: string; } /** Coerce an unknown plugin config value into an AdoConfig, or return undefined. */ export declare function asAdoConfig(value: unknown): AdoConfig | undefined; /** Resolve the active profile from config using defaultProfile > default:true > first. */ export declare function resolveActiveProfile(config: AdoConfig): { name: string; profile: AdoProfile; }; /** Build the organisation URL from a short name or full URL. */ export declare function resolveOrgUrl(org: string): string; /** Validate Azure DevOps PAT format and length. Azure DevOps PATs are typically 52 characters. */ export declare function validatePAT(pat: string): void; /** * Get the PAT for the given env var name. Throws if not found or invalid. * Used by the server module which requires a PAT to function. */ export declare function getPAT(envVarName: string, directPat?: string): string; /** * Get the PAT for the given env var name. Returns undefined if not found or invalid. * Used by the TUI module which handles missing PATs gracefully. */ export declare function getPATOptional(envVarName: string, directPat?: string): string | undefined; /** Strip refs/heads/ or refs/tags/ prefix from a ref string. */ export declare function shortBranch(ref?: string): string; /** Check if a reviewer object matches the given user ID. Handles undefined userId gracefully. */ export declare function reviewerMatchesUser(reviewer: any, userId: string | undefined): boolean; /** Format a PR as a single-line list entry. */ export declare function fmtPR(pr: any): string; /** Format a PR as a detailed multi-line block. */ export declare function fmtPRDetail(pr: any): string; /** Format a thread as a concise summary line. */ export declare function fmtThread(t: any): string; /** Abbreviate work item type. */ export declare function abbrevType(type: string): string; /** Format date as MM-DD. */ export declare function shortDate(iso: string): string; /** Format a work item as a single-line list entry. */ export declare function fmtWorkItem(wi: any): string; /** Format a work item as a detailed multi-line block. */ export declare function fmtWorkItemDetail(wi: any): string; /** * Return a human-readable relative time string for a date. * Handles invalid/missing dates defensively. */ export declare function relativeTime(date: Date | string | undefined): string; import { z } from "zod/v4"; /** Shared Zod schemas to avoid repeating descriptions across tools. */ export declare const adoSchemas: { repo: z.ZodOptional; prId: z.ZodOptional; profile: z.ZodOptional; filePath: z.ZodOptional; line: z.ZodOptional; vote: z.ZodEnum<{ approve: "approve"; reject: "reject"; wait: "wait"; suggestions: "suggestions"; }>; comment: z.ZodString; wiId: z.ZodNumber; wiState: z.ZodOptional; wiAssignedTo: z.ZodOptional; wiTag: z.ZodOptional; wiType: z.ZodOptional; }; //# sourceMappingURL=shared.d.ts.map