/**
 * Auto-Link Utility
 *
 * Creates an external issue on a configured provider and links it back to
 * a Stoneforge task via `externalRef` and `_externalSync` metadata.
 *
 * Designed to be called after task creation in a fire-and-forget pattern.
 * Never throws — all errors are caught and returned as `{ success: false, error }`.
 */
import type { Task, ExternalProvider, ExternalSyncState, SyncDirection } from '@stoneforge/core';
import type { QuarryAPI } from '../api/types.js';
/**
 * Parameters for autoLinkTask()
 */
export interface AutoLinkTaskParams {
    /** The newly created task to auto-link */
    task: Task;
    /** QuarryAPI instance for updating the task */
    api: QuarryAPI;
    /** Configured external provider instance (e.g., GitHub, Linear) */
    provider: ExternalProvider;
    /** Project identifier (e.g., 'owner/repo' for GitHub, team key for Linear) */
    project: string;
    /** Sync direction to set on the link */
    direction: SyncDirection;
}
/**
 * Result of autoLinkTask()
 */
export interface AutoLinkTaskResult {
    /** Whether the auto-link succeeded */
    success: boolean;
    /** The ExternalSyncState set on the task (only on success) */
    syncState?: ExternalSyncState;
    /** Error message (only on failure) */
    error?: string;
}
/**
 * Auto-link a newly created task to an external issue.
 *
 * Creates an issue on the configured provider and updates the Stoneforge task
 * with `externalRef` and `_externalSync` metadata.
 *
 * **Never throws** — catches all errors and returns `{ success: false, error }`.
 * Auto-link failure must not prevent task creation.
 *
 * @param params - The auto-link parameters
 * @returns Result indicating success or failure with details
 *
 * @example
 * ```typescript
 * const result = await autoLinkTask({
 *   task,
 *   api,
 *   provider: githubProvider,
 *   project: 'owner/repo',
 *   direction: 'bidirectional',
 * });
 *
 * if (!result.success) {
 *   console.warn('Auto-link failed:', result.error);
 * }
 * ```
 */
export declare function autoLinkTask(params: AutoLinkTaskParams): Promise<AutoLinkTaskResult>;
//# sourceMappingURL=auto-link.d.ts.map