/**
 * Linear Field Mapping Configuration
 *
 * Defines how Stoneforge task fields map to Linear issue fields.
 *
 * Key differences from GitHub:
 * - Linear has native priority (0-4) — no label-based priority convention needed
 * - Linear has workflow state types — status mapping uses state types, not labels
 * - Task types use the same label convention as GitHub (type:bug, etc.)
 *
 * Priority mapping (Linear 0-4 ↔ Stoneforge 1-5):
 *   Linear 1 (Urgent)      ↔ Stoneforge 1 (critical)
 *   Linear 2 (High)        ↔ Stoneforge 2 (high)
 *   Linear 3 (Medium)      ↔ Stoneforge 3 (medium)
 *   Linear 4 (Low)         ↔ Stoneforge 4 (low)
 *   Linear 0 (No priority) ↔ Stoneforge 5 (minimal)
 *
 * Status mapping via workflow state TYPE (not name):
 *   Pull: triage/backlog → backlog, unstarted → open, started → in_progress,
 *         completed → closed, canceled → closed (closeReason: "canceled")
 *   Push: open → unstarted, in_progress/review → started,
 *         blocked → started (add "blocked" label), deferred/backlog → backlog,
 *         closed → completed
 */
import type { TaskStatus, Priority } from '@stoneforge/core';
import type { TaskFieldMapConfig } from '@stoneforge/core';
import type { TaskSyncFieldMapConfig } from '../../adapters/task-sync-adapter.js';
import type { LinearWorkflowState } from './linear-types.js';
/**
 * Maps Stoneforge TaskStatus values to label strings.
 * Linear doesn't natively use label-based status, but the adapter injects
 * sf:status:* labels into ExternalTask.labels to communicate granular workflow
 * state types through the generic field mapping system.
 *
 * This keeps the sync engine provider-agnostic — it reads status from labels
 * the same way for both GitHub (user-managed labels) and Linear (adapter-injected).
 */
export declare const LINEAR_STATUS_LABELS: Record<string, string>;
/**
 * Maps Stoneforge priority (1-5) to Linear priority (0-4).
 *
 * Stoneforge 1 (critical) → Linear 1 (Urgent)
 * Stoneforge 2 (high)     → Linear 2 (High)
 * Stoneforge 3 (medium)   → Linear 3 (Medium)
 * Stoneforge 4 (low)      → Linear 4 (Low)
 * Stoneforge 5 (minimal)  → Linear 0 (No priority)
 */
export declare function stoneforgePriorityToLinear(priority: Priority): number;
/**
 * Maps Linear priority (0-4) to Stoneforge priority (1-5).
 *
 * Linear 1 (Urgent)      → Stoneforge 1 (critical)
 * Linear 2 (High)        → Stoneforge 2 (high)
 * Linear 3 (Medium)      → Stoneforge 3 (medium)
 * Linear 4 (Low)         → Stoneforge 4 (low)
 * Linear 0 (No priority) → Stoneforge 5 (minimal)
 */
export declare function linearPriorityToStoneforge(priority: number): Priority;
/**
 * Linear workflow state type as used in the API.
 */
export type LinearStateType = LinearWorkflowState['type'];
/**
 * Maps a Linear workflow state type to a Stoneforge TaskStatus.
 *
 * Pull direction:
 *   triage    → backlog
 *   backlog   → backlog
 *   unstarted → open
 *   started   → in_progress
 *   completed → closed
 *   canceled  → closed
 */
export declare function linearStateTypeToStatus(stateType: LinearStateType): {
    status: TaskStatus;
    closeReason?: string;
};
/**
 * Maps a Stoneforge TaskStatus to a Linear workflow state type.
 *
 * Push direction:
 *   open        → unstarted
 *   in_progress → started
 *   review      → started
 *   blocked     → started (caller should add "blocked" label)
 *   deferred    → backlog
 *   backlog     → backlog
 *   closed      → completed
 *   tombstone   → completed (treat as done)
 */
export declare function statusToLinearStateType(status: TaskStatus): LinearStateType;
/**
 * Returns true if the given Stoneforge status should add a "blocked" label
 * in Linear (since Linear has no native blocked state).
 */
export declare function shouldAddBlockedLabel(status: TaskStatus): boolean;
/**
 * Maps a Linear workflow state type to a sync label string (sf:status:*).
 *
 * The Linear adapter injects this label into ExternalTask.labels so the
 * generic field mapping system (stateToStatus) can extract granular statuses
 * without the sync engine needing to know about Linear-specific state types.
 *
 * Mapping:
 *   triage    → sf:status:backlog
 *   backlog   → sf:status:backlog
 *   unstarted → sf:status:open
 *   started   → sf:status:in-progress
 *   completed → sf:status:closed
 *   canceled  → sf:status:closed
 */
export declare function linearStateTypeToStatusLabel(stateType: LinearStateType): string;
/**
 * Creates the Linear-specific TaskFieldMapConfig.
 *
 * This config describes the field mapping at the type level. The actual
 * runtime mapping logic lives in the adapter and the priority/status
 * functions above.
 */
export declare function createLinearFieldMapConfig(): TaskFieldMapConfig;
/**
 * Creates the Linear-specific TaskSyncFieldMapConfig used by the shared
 * task-sync-adapter utilities (taskToExternalTask, externalTaskToTaskUpdates).
 *
 * Priority labels are emitted alongside Linear's native priority field for
 * lossless round-tripping. This ensures the exact Stoneforge priority value
 * is preserved (e.g., P5 "minimal" is distinct from Linear's "No priority").
 *
 * Status mapping uses adapter-injected sf:status:* labels. The Linear adapter
 * injects these labels based on the workflow state type (e.g., started →
 * sf:status:in-progress), allowing the generic stateToStatus function to
 * extract granular statuses without coupling the sync engine to Linear.
 */
export declare function createLinearSyncFieldMapConfig(): TaskSyncFieldMapConfig;
//# sourceMappingURL=linear-field-map.d.ts.map