{"version":3,"file":"sync.cjs","names":["colors"],"sources":["../../../src/cli/render/sync.ts"],"sourcesContent":["import { colors } from \"../../utils/theme\";\n\n/**\n * The protocol for local edits to framework-owned files (ADR 0032): editing is\n * allowed, sync backs the divergent copy up, and an upstream issue makes the\n * change permanent.\n */\nexport const UPSTREAM_ISSUE_URL = \"https://github.com/NEARBuilders/everything-dev/issues\";\n\nexport function printUpstreamIssueProtocol(backupDir?: string | null) {\n  console.log(\n    colors.dim(\n      `  Framework-owned files: local edits are allowed — template versions were applied; backups at ${backupDir || \".bos/sync-backup/\"}.`,\n    ),\n  );\n  console.log(\n    colors.dim(\n      `  To make a local change permanent, file an issue: ${UPSTREAM_ISSUE_URL} (or open a PR).`,\n    ),\n  );\n}\n\ninterface SyncOutcomeShape {\n  updated: string[];\n  added: string[];\n  conflicted: string[];\n  backupDir?: string | null;\n}\n\n/**\n * The sync-outcome block shared by the `bos upgrade` renderer: counts,\n * per-file listings, and the upstream-issue protocol line.\n */\nexport function printSyncOutcome(sync: SyncOutcomeShape) {\n  if (sync.updated.length > 0 || sync.added.length > 0 || sync.conflicted.length > 0) {\n    console.log(\n      `  ${sync.updated.length} updated, ${sync.added.length} added, ${sync.conflicted.length} conflicted`,\n    );\n    for (const f of sync.updated) console.log(`    ${colors.dim(f)}`);\n    for (const f of sync.added) console.log(`    ${colors.dim(f)}`);\n    if (sync.conflicted.length > 0) {\n      console.log(`  ${colors.yellow(\"Conflicted\")} (template applied, your changes backed up):`);\n      if (sync.backupDir) console.log(`    ${colors.dim(sync.backupDir)}`);\n      for (const f of sync.conflicted) console.log(`    ${colors.dim(f)}`);\n      printUpstreamIssueProtocol(sync.backupDir);\n    }\n  } else {\n    console.log(`  ${colors.dim(\"Already up to date\")}`);\n  }\n}\n"],"mappings":";;;;;;;;AAOA,MAAa,qBAAqB;AAElC,SAAgB,2BAA2B,WAA2B;CACpE,QAAQ,IACNA,qBAAO,IACL,iGAAiG,aAAa,oBAAoB,EACpI,CACF;CACA,QAAQ,IACNA,qBAAO,IACL,sDAAsD,mBAAmB,iBAC3E,CACF;AACF;;;;;AAaA,SAAgB,iBAAiB,MAAwB;CACvD,IAAI,KAAK,QAAQ,SAAS,KAAK,KAAK,MAAM,SAAS,KAAK,KAAK,WAAW,SAAS,GAAG;EAClF,QAAQ,IACN,KAAK,KAAK,QAAQ,OAAO,YAAY,KAAK,MAAM,OAAO,UAAU,KAAK,WAAW,OAAO,YAC1F;EACA,KAAK,MAAM,KAAK,KAAK,SAAS,QAAQ,IAAI,OAAOA,qBAAO,IAAI,CAAC,GAAG;EAChE,KAAK,MAAM,KAAK,KAAK,OAAO,QAAQ,IAAI,OAAOA,qBAAO,IAAI,CAAC,GAAG;EAC9D,IAAI,KAAK,WAAW,SAAS,GAAG;GAC9B,QAAQ,IAAI,KAAKA,qBAAO,OAAO,YAAY,EAAE,6CAA6C;GAC1F,IAAI,KAAK,WAAW,QAAQ,IAAI,OAAOA,qBAAO,IAAI,KAAK,SAAS,GAAG;GACnE,KAAK,MAAM,KAAK,KAAK,YAAY,QAAQ,IAAI,OAAOA,qBAAO,IAAI,CAAC,GAAG;GACnE,2BAA2B,KAAK,SAAS;EAC3C;CACF,OACE,QAAQ,IAAI,KAAKA,qBAAO,IAAI,oBAAoB,GAAG;AAEvD"}