/** * GitHub Sync Service - Bidirectional sync between Lisa tasks and GitHub Issues. * * Supports: * - Import: Pull GitHub issues -> create Lisa tasks with externalLink * - Export: Push unlinked Lisa tasks -> create GitHub issues, add link * - Bidirectional: Full two-way sync with conflict detection * * Status mapping: * - ready <-> open (no status labels) * - in-progress <-> open + in-progress label * - blocked <-> open + blocked label * - done <-> closed * * Note: Group IDs are no longer used - the git repo itself provides scoping * via git-mem (git notes in refs/notes/mem). The groupId in ISyncOptions is * kept for interface compatibility but ignored. */ import type { IGitHubClient, IGitHubIssue } from './GitHubService'; import type { ITaskService } from './interfaces'; /** * Task status values supported by Lisa. */ export type LisaTaskStatus = 'ready' | 'todo' | 'in-progress' | 'blocked' | 'done'; /** * Sync direction options. */ export type SyncDirection = 'import' | 'export' | 'bidirectional'; /** * Options for sync operations. */ export interface ISyncOptions { /** Repository in owner/repo format */ repo: string; /** Preview changes without applying */ dryRun?: boolean; /** Filter GitHub issues by labels */ labels?: string[]; /** Sync direction */ direction: SyncDirection; /** Group ID for Lisa tasks */ groupId: string; /** Default repo for tasks */ defaultRepo?: string; /** Default assignee for tasks */ defaultAssignee?: string; } /** * Conflict information when both sides have changes. */ export interface ISyncConflict { taskUuid: string; taskTitle: string; issueNumber: number; reason: string; resolution: 'local' | 'remote'; localUpdatedAt?: string; remoteUpdatedAt?: string; } /** * Detailed item info for sync results. */ export interface ISyncItem { title: string; taskUuid?: string; issueNumber?: number; issueUrl?: string; } /** * Result of a sync operation. */ export interface ISyncResult { /** Number of items imported (GitHub -> Lisa) */ imported: number; /** Items that were imported */ importedItems: ISyncItem[]; /** Number of items exported (Lisa -> GitHub) */ exported: number; /** Items that were exported */ exportedItems: ISyncItem[]; /** Number of items with status synced */ updated: number; /** Items that were updated */ updatedItems: ISyncItem[]; /** Number of items already in sync */ skipped: number; /** Conflicts detected (with resolutions applied) */ conflicts: ISyncConflict[]; /** Whether this was a dry run */ dryRun: boolean; } /** * GitHub sync service interface. */ export interface IGitHubSyncService { /** * Sync tasks between Lisa and GitHub. */ sync(options: ISyncOptions): Promise; /** * Preview sync changes without applying (same as sync with dryRun=true). */ previewSync(options: ISyncOptions): Promise; } /** * Map Lisa task status to GitHub issue state and labels. */ export declare function lisaStatusToGitHub(status: string): { state: 'open' | 'closed'; addLabels: string[]; removeLabels: string[]; }; /** * Map GitHub issue state and labels to Lisa task status. */ export declare function gitHubStatusToLisa(issue: IGitHubIssue): LisaTaskStatus; /** * Dependencies for creating a GitHub sync service. */ export interface IGitHubSyncServiceDependencies { github: IGitHubClient; tasks: ITaskService; } /** * Creates a GitHub sync service instance. */ export declare function createGitHubSyncService(deps: IGitHubSyncServiceDependencies): IGitHubSyncService; //# sourceMappingURL=GitHubSyncService.d.ts.map