/**
 * GitHub Task Sync Adapter
 *
 * Implements TaskSyncAdapter for GitHub Issues.
 * Uses GitHubApiClient internally for all API operations and maps between
 * the normalized ExternalTask format and GitHub's issue representation.
 *
 * Project format: 'owner/repo' (e.g., 'stoneforge-ai/stoneforge')
 * External ID format: issue number as string (e.g., '42')
 */
import type { TaskSyncAdapter, ExternalTask, ExternalTaskInput, TaskFieldMapConfig } from '@stoneforge/core';
import type { Timestamp } from '@stoneforge/core';
import type { GitHubApiClientOptions } from './github-api.js';
/**
 * Returns the default color for a given sf:* label name.
 * Falls back to a neutral gray if no specific color is defined.
 */
export declare function getDefaultLabelColor(labelName: string): string;
/**
 * TaskSyncAdapter implementation for GitHub Issues.
 *
 * Maps between Stoneforge's normalized ExternalTask format and GitHub's
 * issue API. Uses GitHubApiClient for all HTTP operations.
 *
 * Auto-creates sf:* labels on the target repository before assigning them
 * to issues, preventing GitHub 422 "Validation Failed" errors.
 *
 * Usage:
 * ```typescript
 * const adapter = new GitHubTaskAdapter({
 *   token: 'ghp_...',
 *   apiBaseUrl: 'https://api.github.com', // optional
 * });
 *
 * const issue = await adapter.getIssue('owner/repo', '42');
 * const issues = await adapter.listIssuesSince('owner/repo', Date.now());
 * ```
 */
export declare class GitHubTaskAdapter implements TaskSyncAdapter {
    private readonly client;
    /**
     * Per-repo cache of known label names.
     * Key is 'owner/repo', value is a Set of label names that exist on the repo.
     * Populated once per repo per session to avoid redundant API calls.
     */
    private readonly labelCache;
    constructor(options: GitHubApiClientOptions);
    /**
     * Fetch a single issue by its number.
     *
     * @param project - Repository in 'owner/repo' format
     * @param externalId - GitHub issue number as a string
     * @returns The normalized ExternalTask, or null if not found
     */
    getIssue(project: string, externalId: string): Promise<ExternalTask | null>;
    /**
     * List all issues updated since the given timestamp.
     *
     * Fetches all issues (open and closed) that have been updated since
     * the provided timestamp. Uses auto-pagination to retrieve all matching
     * issues across multiple pages.
     *
     * @param project - Repository in 'owner/repo' format
     * @param since - Timestamp (milliseconds since epoch) to filter by
     * @returns Array of normalized ExternalTask objects
     */
    listIssuesSince(project: string, since: Timestamp): Promise<ExternalTask[]>;
    /**
     * Create a new issue in the specified repository.
     *
     * Maps ExternalTaskInput fields to GitHub's create issue payload:
     * - title -> title
     * - body -> body
     * - labels -> labels (as label names)
     *
     * Note: Assignees are intentionally NOT set on created issues. Stoneforge
     * assignees are ephemeral agents that don't correspond to GitHub users.
     *
     * Note: The 'state' field from ExternalTaskInput is ignored for creation
     * since GitHub issues are always created in the 'open' state.
     *
     * @param project - Repository in 'owner/repo' format
     * @param issue - The issue data to create
     * @returns The created ExternalTask with its new external ID and URL
     */
    createIssue(project: string, issue: ExternalTaskInput): Promise<ExternalTask>;
    /**
     * Update an existing issue in the specified repository.
     *
     * Maps partial ExternalTaskInput fields to GitHub's update issue payload.
     * Only fields present in the updates object are sent to GitHub —
     * undefined fields are left unchanged.
     *
     * @param project - Repository in 'owner/repo' format
     * @param externalId - GitHub issue number as a string
     * @param updates - Partial issue data to update
     * @returns The updated ExternalTask
     */
    updateIssue(project: string, externalId: string, updates: Partial<ExternalTaskInput>): Promise<ExternalTask>;
    /**
     * Ensures that all sf:* labels in the given list exist on the target repository.
     *
     * For each label with the sync prefix (sf:), checks the per-repo cache first.
     * If the cache hasn't been populated yet, fetches all labels from the repo once.
     * Any missing sf:* labels are created with sensible default colors.
     *
     * Non-sf:* labels (user-managed) are not checked or created — those are the
     * user's responsibility.
     *
     * @param project - Repository in 'owner/repo' format
     * @param labels - Array of label names that will be assigned to an issue
     */
    ensureLabelsExist(project: string, labels: string[]): Promise<void>;
    /**
     * Returns the GitHub-specific field mapping configuration.
     *
     * This configuration is used by the shared task sync adapter utilities
     * to map between Stoneforge task fields and GitHub issue fields.
     *
     * The returned TaskFieldMapConfig describes individual field mappings
     * with their directions and transform function names.
     *
     * @returns TaskFieldMapConfig for GitHub
     */
    getFieldMapConfig(): TaskFieldMapConfig;
}
/**
 * Returns the GitHub-specific TaskSyncFieldMapConfig for use with
 * the shared task sync adapter utilities.
 *
 * This is a convenience export for code that needs the config directly
 * without going through the adapter's getFieldMapConfig() method.
 */
export { GITHUB_FIELD_MAP_CONFIG } from './github-field-map.js';
//# sourceMappingURL=github-task-adapter.d.ts.map