/** * `specweave sync` — the ONE external-tracker sync surface. * * sync push [incrementId] [--reconcile] [--dry-run] [--no-create] [--provider] [--force] * sync pull [--create-increments] [--provider] [--since] * sync status [--json] [--provider] [--quick] * sync setup [--validate] [--provider] [--quick] * * Every verb delegates to the code path that already works: * push → sync-progress (tasks → ACs → living docs → GitHub/Jira/ADO) + retry-queue drain * pull → external-change-puller (report) / importers (--create-increments) * status → token source + account, provider health, resilience state, sync gaps * setup → sync-setup wizard (or health validation with --validate) * * @module cli/commands/sync */ import { type Logger } from '../../utils/logger.js'; import { type GitHubAuth } from '../../utils/auth-helpers.js'; import { syncProgress } from './sync-progress.js'; import { syncRetryCommand } from './sync-retry.js'; import { syncStatusCommand, type SyncStatusResult } from './sync-status.js'; import { detectSyncGaps, type SyncGapItem } from './sync-gaps.js'; import { syncSetupCommand } from './sync-setup.js'; import { syncHealthCommand, runHealthChecksForConfig } from './sync-health.js'; import type { HealthCheckResult } from '../../sync/integration-health-check.js'; export type SyncProvider = 'github' | 'jira' | 'ado'; export interface SyncPushOptions { incrementId?: string; reconcile?: boolean; dryRun?: boolean; /** Auto-create missing external issues (default true; `--no-create` disables). */ create?: boolean; provider?: SyncProvider; force?: boolean; } export interface SyncPullOptions { /** Create SpecWeave increments from external issues (delegates to the importers). */ createIncrements?: boolean; provider?: SyncProvider; /** ISO date or number of days to look back (default 7). */ since?: string; } export interface SyncStatusOptions { json?: boolean; provider?: SyncProvider; /** Skip network probes (account lookup, provider health). */ quick?: boolean; } export interface SyncSetupOptions { provider?: SyncProvider; quick?: boolean; /** Validate the existing configuration instead of running the wizard. */ validate?: boolean; } export interface GitHubTokenStatus { source: GitHubAuth['source']; origin: GitHubAuth['origin']; isOAuthToken: boolean; login: string | null; repo: string | null; canPush: boolean | null; description: string; } export interface SyncStatusReport { providers: SyncProvider[]; github?: GitHubTokenStatus; health: HealthCheckResult[]; resilience?: SyncStatusResult; gaps: SyncGapItem[]; hasIssues: boolean; exitCode: number; } export interface SyncDeps { logger?: Logger; projectRoot?: string; syncProgress?: typeof syncProgress; syncRetry?: typeof syncRetryCommand; resolveLogin?: (token: string) => string | null; /** Probe `owner/repo` push permission for the active token (null = unknown). */ probeCanPush?: (token: string, owner: string, repo: string) => Promise; runHealthChecks?: typeof runHealthChecksForConfig; syncStatus?: typeof syncStatusCommand; detectGaps?: typeof detectSyncGaps; syncSetup?: typeof syncSetupCommand; syncHealth?: typeof syncHealthCommand; runImport?: (projectRoot: string) => Promise; } declare function parseProvider(value: string | undefined): SyncProvider | undefined; /** Explicit token + owner/repo from config.json (legacy sync.github block or a github profile). */ export declare function readGitHubConfig(config: Record | null): { token?: string; owner?: string; repo?: string; }; /** Build the argv that sync-progress understands from typed push options. */ export declare function buildPushArgs(options: SyncPushOptions): string[]; /** * `specweave sync push` — push local progress to the configured tracker(s). * Body = sync-progress phases 1-4; afterwards the retry queue is drained by * re-pushing the increments it holds (one entry point, one throttle). */ export declare function syncPush(options?: SyncPushOptions, deps?: SyncDeps): Promise; /** * `specweave sync pull` — report what changed on the tracker side, or create * increments from external issues (`--create-increments`, the old sw:import). */ export declare function syncPull(options?: SyncPullOptions, deps?: SyncDeps): Promise; /** * `specweave sync status` — one report: which token/account is active and * whether it can push, provider health, retry queue / circuit breakers, and * increments with partial sync coverage (absorbs sync-status, sync-health, * sync-gaps and validate-jira). */ export declare function syncStatus(options?: SyncStatusOptions, deps?: SyncDeps): Promise; /** * `specweave sync setup` — interactive wizard (GitHub / Jira / ADO), or * `--validate` to check the existing configuration and credentials. */ export declare function syncSetup(options?: SyncSetupOptions, deps?: SyncDeps): Promise; /** Shared by bin/specweave.js: parse `--provider` consistently for every verb. */ export { parseProvider }; /** Old verb → new verb map, used for the hidden deprecation aliases. */ export declare const DEPRECATED_SYNC_VERBS: Record; export declare function deprecationNotice(oldVerb: string): string; //# sourceMappingURL=sync.d.ts.map