/** * Local backlog provider for offline/file-based ticket tracking. * * Enables spec-kit workflows without any external backlog system (GitHub, Jira, etc.). * Useful for offline work, personal projects, testing, and quick prototyping. * * Tickets are stored in a local JSON file (default: `.specify/local-tickets.json`) * with auto-generated IDs (`LOCAL-001`, `LOCAL-002`, etc.). */ import type { TicketRef } from '../types/ticket.js'; import type { BacklogProvider, BacklogProviderName, Ticket, TicketCreateParams, TicketUpdates, AuthCheckResult } from './types.js'; import type { SpecKitConfig } from '../config.js'; /** * Configuration options for LocalProvider. */ interface LocalProviderConfig { /** Path to the store file (relative to cwd or absolute) */ storePath?: string; /** Working directory for resolving relative paths */ cwd?: string; } /** * Local backlog provider for offline/file-based ticket tracking. * * Implements the BacklogProvider interface for local-only workflows. * No authentication required - always succeeds. */ export declare class LocalProvider implements BacklogProvider { readonly name: BacklogProviderName; private readonly storePath; private readonly cwd; /** * Creates a new LocalProvider instance. * * @param config - SpecKit configuration (for compatibility with registry) * @param options - Additional options for the local provider */ constructor(config: SpecKitConfig, options?: LocalProviderConfig); /** * Load the ticket store from disk. * Creates an empty store if the file doesn't exist. */ private loadStore; /** * Save the ticket store to disk using atomic write (temp file + rename). */ private saveStore; /** * Create an empty ticket store with default values. */ private createEmptyStore; /** * Generate a ticket ID from a number. * Format: LOCAL-NNN with minimum 3 digits, naturally extends beyond 999. */ private generateId; /** * Convert a LocalTicket to the provider-agnostic Ticket interface. */ private toTicket; /** * Normalize a parsed reference to the canonical ID format. * Handles various input formats and returns the LOCAL-NNN format. */ private normalizeRef; /** * Fetch a ticket by reference string. * * @param ref - Reference string (LOCAL-001, local-1, 001, 1) * @returns The ticket data * @throws {NotFoundError} If the ticket doesn't exist */ getTicket(ref: string): Promise; /** * Create a new ticket. * * @param params - Ticket creation parameters * @returns The created ticket */ createTicket(params: TicketCreateParams): Promise; /** * Update an existing ticket. * * @param ref - Reference string * @param updates - Fields to update * @returns The updated ticket * @throws {NotFoundError} If the ticket doesn't exist */ updateTicket(ref: string, updates: TicketUpdates): Promise; /** * Replace all labels on a ticket. * * @param ref - Reference string * @param labels - Labels to set (replaces all existing labels) * @throws {NotFoundError} If the ticket doesn't exist */ setLabels(ref: string, labels: string[]): Promise; /** * Get current labels on a ticket. * * @param ref - Reference string * @returns Array of label strings * @throws {NotFoundError} If the ticket doesn't exist */ getLabels(ref: string): Promise; /** * Check if authentication is valid. * Local provider always succeeds - no auth required. * * @returns Always returns { ok: true } */ checkAuth(): Promise; /** * Generate the URL for a ticket. * Returns a local:// pseudo-URL since there's no web interface. * * @param ref - Reference string * @returns Pseudo-URL in the format local://LOCAL-NNN */ getTicketUrl(ref: string): string; /** * Parse user input to a TicketRef. * * Handles various input formats: * - LOCAL-001, LOCAL-1 (full format, any case) * - local-001, local-1 (lowercase prefix) * - 001, 1 (bare numbers) * * @param input - User-provided reference string * @returns Parsed TicketRef or null if invalid for this provider */ parseRef(input: string): TicketRef | null; } export {}; //# sourceMappingURL=local.d.ts.map