harnesstap 1.3.2 → 1.6.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (245) hide show
  1. package/README.md +4 -0
  2. package/dist/apply-FTAIL3X3.js +50 -0
  3. package/dist/{approve-L7IFSYBO.js → approve-R6AWQB3I.js} +12 -16
  4. package/dist/{approve-L7IFSYBO.js.map → approve-R6AWQB3I.js.map} +1 -1
  5. package/dist/{audit-PBJDK7A4.js → audit-2HNKFPSU.js} +26 -39
  6. package/dist/{audit-PBJDK7A4.js.map → audit-2HNKFPSU.js.map} +1 -1
  7. package/dist/{auth-OM73RLNS.js → auth-C54KRLNF.js} +17 -21
  8. package/dist/{auth-OM73RLNS.js.map → auth-C54KRLNF.js.map} +1 -1
  9. package/dist/bin.js +13 -34
  10. package/dist/bin.js.map +1 -1
  11. package/dist/{chunk-R4PTE774.js → chunk-2XDYQXP2.js} +34 -41
  12. package/dist/chunk-2XDYQXP2.js.map +1 -0
  13. package/dist/{chunk-G5RWVZZ7.js → chunk-3277RVZT.js} +5 -7
  14. package/dist/{chunk-G5RWVZZ7.js.map → chunk-3277RVZT.js.map} +1 -1
  15. package/dist/{chunk-6JMVGKMD.js → chunk-3Q72LZPJ.js} +936 -528
  16. package/dist/chunk-3Q72LZPJ.js.map +1 -0
  17. package/dist/{chunk-U472S6IB.js → chunk-42E2MPES.js} +19 -27
  18. package/dist/chunk-42E2MPES.js.map +1 -0
  19. package/dist/{chunk-CZ4T75PP.js → chunk-5HACBPK2.js} +622 -252
  20. package/dist/chunk-5HACBPK2.js.map +1 -0
  21. package/dist/{chunk-IHW4PCDT.js → chunk-6FXJIKEG.js} +6 -6
  22. package/dist/{chunk-OPVIX7E4.js → chunk-A3TZT4WT.js} +6 -2
  23. package/dist/chunk-A3TZT4WT.js.map +1 -0
  24. package/dist/chunk-BUA7WFI4.js +39327 -0
  25. package/dist/chunk-BUA7WFI4.js.map +1 -0
  26. package/dist/{chunk-IAZNF35S.js → chunk-CBSDMRMY.js} +2 -2
  27. package/dist/{chunk-YVJQ2QDG.js → chunk-CR2TYMKC.js} +65 -55
  28. package/dist/chunk-CR2TYMKC.js.map +1 -0
  29. package/dist/{chunk-VQVUJYYY.js → chunk-CWXCZBJR.js} +76 -6
  30. package/dist/chunk-CWXCZBJR.js.map +1 -0
  31. package/dist/{chunk-AVZOFMJX.js → chunk-D7R577XZ.js} +381 -138
  32. package/dist/chunk-D7R577XZ.js.map +1 -0
  33. package/dist/{chunk-3EGM4IUI.js → chunk-EPXAOEBB.js} +6 -6
  34. package/dist/{chunk-64R32MG2.js → chunk-GZU4LVFF.js} +179 -26
  35. package/dist/chunk-GZU4LVFF.js.map +1 -0
  36. package/dist/chunk-HV3ENT2F.js +61 -0
  37. package/dist/chunk-HV3ENT2F.js.map +1 -0
  38. package/dist/{chunk-XCPWLGPB.js → chunk-K4UDZUJ2.js} +2 -2
  39. package/dist/{chunk-OQ4KBUN2.js → chunk-L6BJCRBU.js} +13 -16
  40. package/dist/chunk-L6BJCRBU.js.map +1 -0
  41. package/dist/{chunk-AFKCNFPP.js → chunk-M6FEDSHY.js} +16 -15
  42. package/dist/chunk-M6FEDSHY.js.map +1 -0
  43. package/dist/chunk-M7PHQ3UC.js +31491 -0
  44. package/dist/chunk-M7PHQ3UC.js.map +1 -0
  45. package/dist/{chunk-FBYAIBHP.js → chunk-MHLAIGIM.js} +2 -2
  46. package/dist/{chunk-ENHDEB7Z.js → chunk-MHMFF6A5.js} +5 -7
  47. package/dist/{chunk-ENHDEB7Z.js.map → chunk-MHMFF6A5.js.map} +1 -1
  48. package/dist/chunk-MKLJBW5N.js +14 -0
  49. package/dist/{chunk-XRXFJTAT.js → chunk-MQCAPCAF.js} +17 -26
  50. package/dist/chunk-MQCAPCAF.js.map +1 -0
  51. package/dist/{chunk-UEHDEADL.js → chunk-MQCH3YZ5.js} +15 -13
  52. package/dist/chunk-MQCH3YZ5.js.map +1 -0
  53. package/dist/chunk-OHZNDV4A.js +1707 -0
  54. package/dist/chunk-OHZNDV4A.js.map +1 -0
  55. package/dist/{chunk-LGWUTV5Q.js → chunk-OWE3OSX6.js} +11 -13
  56. package/dist/{chunk-LGWUTV5Q.js.map → chunk-OWE3OSX6.js.map} +1 -1
  57. package/dist/{chunk-EY4ES5MG.js → chunk-PCNHBMBU.js} +3 -5
  58. package/dist/{chunk-EY4ES5MG.js.map → chunk-PCNHBMBU.js.map} +1 -1
  59. package/dist/{chunk-YRGM7RAD.js → chunk-QGTDQNVV.js} +7 -11
  60. package/dist/{chunk-YRGM7RAD.js.map → chunk-QGTDQNVV.js.map} +1 -1
  61. package/dist/{chunk-BXSS2S4W.js → chunk-R27VZIF6.js} +2 -2
  62. package/dist/{chunk-TQ2NA4Z4.js → chunk-R4NV3Q7G.js} +8 -2
  63. package/dist/chunk-R4NV3Q7G.js.map +1 -0
  64. package/dist/{chunk-FUV7QYBS.js → chunk-R6VFJKZB.js} +86 -319
  65. package/dist/chunk-R6VFJKZB.js.map +1 -0
  66. package/dist/{chunk-QNAIDM6W.js → chunk-RQLVXJH2.js} +132 -4
  67. package/dist/chunk-RQLVXJH2.js.map +1 -0
  68. package/dist/{chunk-JQOKQKQT.js → chunk-S2D5PWAO.js} +2 -2
  69. package/dist/{chunk-JJJJ2RAD.js → chunk-T4EKNX2Q.js} +71 -11
  70. package/dist/chunk-T4EKNX2Q.js.map +1 -0
  71. package/dist/{chunk-GWQVYGRD.js → chunk-TERYL7JH.js} +118 -78
  72. package/dist/chunk-TERYL7JH.js.map +1 -0
  73. package/dist/chunk-UC27MQ3T.js +1920 -0
  74. package/dist/chunk-UC27MQ3T.js.map +1 -0
  75. package/dist/chunk-UEA4NCY2.js +106 -0
  76. package/dist/chunk-UEA4NCY2.js.map +1 -0
  77. package/dist/{chunk-WXRPQICX.js → chunk-UK2IV2ZQ.js} +2 -2
  78. package/dist/{chunk-MFCZN253.js → chunk-UZCAYOIQ.js} +8 -10
  79. package/dist/{chunk-MFCZN253.js.map → chunk-UZCAYOIQ.js.map} +1 -1
  80. package/dist/{chunk-IKAGGJEO.js → chunk-V4UNYSZO.js} +558 -18
  81. package/dist/chunk-V4UNYSZO.js.map +1 -0
  82. package/dist/chunk-VAPCU2FX.js +70 -0
  83. package/dist/chunk-VAPCU2FX.js.map +1 -0
  84. package/dist/{chunk-Y2JGMICO.js → chunk-WGVU3LA5.js} +25 -33
  85. package/dist/chunk-WGVU3LA5.js.map +1 -0
  86. package/dist/{chunk-UNRR4KH5.js → chunk-WQ3F4O7U.js} +20 -14
  87. package/dist/chunk-WQ3F4O7U.js.map +1 -0
  88. package/dist/chunk-XNS4I3W6.js +102 -0
  89. package/dist/chunk-XNS4I3W6.js.map +1 -0
  90. package/dist/{chunk-LDVXYN6F.js → chunk-Y4I7ZCAE.js} +178 -135
  91. package/dist/chunk-Y4I7ZCAE.js.map +1 -0
  92. package/dist/{chunk-6I3RY6R5.js → chunk-ZKMSHLXP.js} +11 -15
  93. package/dist/{chunk-6I3RY6R5.js.map → chunk-ZKMSHLXP.js.map} +1 -1
  94. package/dist/{compile-SDOASKGL.js → compile-B2QG6BAQ.js} +37 -54
  95. package/dist/{compile-SDOASKGL.js.map → compile-B2QG6BAQ.js.map} +1 -1
  96. package/dist/{config-4VZTVZKF.js → config-D3F6ICZ2.js} +21 -39
  97. package/dist/{config-4VZTVZKF.js.map → config-D3F6ICZ2.js.map} +1 -1
  98. package/dist/cursor-local-install-4HDIBX22.js +94 -0
  99. package/dist/cursor-local-install-4HDIBX22.js.map +1 -0
  100. package/dist/cursor-local-install-LL367GZY.js +94 -0
  101. package/dist/cursor-local-install-LL367GZY.js.map +1 -0
  102. package/dist/{doctor-HH6CFBRQ.js → doctor-QSGETVDE.js} +19 -23
  103. package/dist/doctor-QSGETVDE.js.map +1 -0
  104. package/dist/{environment-K7YMJJYN.js → environment-2JS4RWQA.js} +69 -88
  105. package/dist/environment-2JS4RWQA.js.map +1 -0
  106. package/dist/{github-A6TYG7WS.js → github-JXSTHLY2.js} +14 -15
  107. package/dist/{github-A6TYG7WS.js.map → github-JXSTHLY2.js.map} +1 -1
  108. package/dist/{harness-772XBFZQ.js → harness-GBI3AMLH.js} +48 -65
  109. package/dist/{harness-772XBFZQ.js.map → harness-GBI3AMLH.js.map} +1 -1
  110. package/dist/{help-QR4VTJZU.js → help-EC52ERIE.js} +43 -52
  111. package/dist/help-EC52ERIE.js.map +1 -0
  112. package/dist/{help-TLHNRJJ6.js → help-VIRMBOPJ.js} +73 -551
  113. package/dist/help-VIRMBOPJ.js.map +1 -0
  114. package/dist/host-plugin-view-kept-XKHD6NGU.js +139 -0
  115. package/dist/host-plugin-view-kept-XKHD6NGU.js.map +1 -0
  116. package/dist/index.d.ts +7 -0
  117. package/dist/index.js +10 -22
  118. package/dist/{init-AOKFPZHG.js → init-OK3K6ILG.js} +49 -70
  119. package/dist/init-OK3K6ILG.js.map +1 -0
  120. package/dist/live-read-cache-ESQQJBNS.js +13 -0
  121. package/dist/live-read-cache-WPUFHVMZ.js +12 -0
  122. package/dist/{lock-INAXNLMC.js → lock-AA2F4I3K.js} +13 -16
  123. package/dist/{lock-INAXNLMC.js.map → lock-AA2F4I3K.js.map} +1 -1
  124. package/dist/{marketplace-TUVLLPBG.js → marketplace-QUYCV23F.js} +75 -94
  125. package/dist/marketplace-QUYCV23F.js.map +1 -0
  126. package/dist/{mcp-MMWGRASN.js → mcp-CIHSR4DD.js} +35 -52
  127. package/dist/{mcp-MMWGRASN.js.map → mcp-CIHSR4DD.js.map} +1 -1
  128. package/dist/{migrate-55S4XODX.js → migrate-TQPEZYS5.js} +148 -74
  129. package/dist/migrate-TQPEZYS5.js.map +1 -0
  130. package/dist/notifications-TAELTPDW.js +154 -0
  131. package/dist/notifications-TAELTPDW.js.map +1 -0
  132. package/dist/open-D3GWGDSQ.js +20 -0
  133. package/dist/{pack-VZIBS42E.js → pack-VUO4UBWL.js} +12 -22
  134. package/dist/{pack-VZIBS42E.js.map → pack-VUO4UBWL.js.map} +1 -1
  135. package/dist/plugin-L3466DHK.js +47 -0
  136. package/dist/plugin-from-project-U5UGKTJH.js +15 -0
  137. package/dist/plugin-from-project-U5UGKTJH.js.map +1 -0
  138. package/dist/{policy-P3HGLEZS.js → policy-Z5TL4N3V.js} +11 -15
  139. package/dist/{policy-P3HGLEZS.js.map → policy-Z5TL4N3V.js.map} +1 -1
  140. package/dist/{profile-STS3CZUK.js → profile-QFI7SL3S.js} +167 -143
  141. package/dist/profile-QFI7SL3S.js.map +1 -0
  142. package/dist/{project-R4DGM3ZG.js → project-3KR3EPYR.js} +506 -94
  143. package/dist/project-3KR3EPYR.js.map +1 -0
  144. package/dist/{resource-GJVEDXVZ.js → resource-45BPRQ7V.js} +66 -63
  145. package/dist/resource-45BPRQ7V.js.map +1 -0
  146. package/dist/status-refresh-worker.js +1155 -0
  147. package/dist/status-refresh-worker.js.map +1 -0
  148. package/dist/{version-FUHV4O6U.js → version-QUJZGTZ5.js} +3 -3
  149. package/dist/version-QUJZGTZ5.js.map +1 -0
  150. package/package.json +17 -11
  151. package/dist/apply-Q5SFF3FY.js +0 -67
  152. package/dist/chunk-24V5ZSIF.js +0 -658
  153. package/dist/chunk-24V5ZSIF.js.map +0 -1
  154. package/dist/chunk-2H7UOFLK.js +0 -11
  155. package/dist/chunk-3JOPDYQD.js +0 -730
  156. package/dist/chunk-3JOPDYQD.js.map +0 -1
  157. package/dist/chunk-555XE3NJ.js +0 -60
  158. package/dist/chunk-555XE3NJ.js.map +0 -1
  159. package/dist/chunk-64R32MG2.js.map +0 -1
  160. package/dist/chunk-6JMVGKMD.js.map +0 -1
  161. package/dist/chunk-6ZWKF3YZ.js +0 -7795
  162. package/dist/chunk-6ZWKF3YZ.js.map +0 -1
  163. package/dist/chunk-AFKCNFPP.js.map +0 -1
  164. package/dist/chunk-AUWWL6KX.js +0 -296
  165. package/dist/chunk-AUWWL6KX.js.map +0 -1
  166. package/dist/chunk-AVZOFMJX.js.map +0 -1
  167. package/dist/chunk-CZ4T75PP.js.map +0 -1
  168. package/dist/chunk-FUV7QYBS.js.map +0 -1
  169. package/dist/chunk-GWQVYGRD.js.map +0 -1
  170. package/dist/chunk-HENOKIBB.js +0 -346
  171. package/dist/chunk-HENOKIBB.js.map +0 -1
  172. package/dist/chunk-HWL67OCJ.js +0 -238
  173. package/dist/chunk-HWL67OCJ.js.map +0 -1
  174. package/dist/chunk-IKAGGJEO.js.map +0 -1
  175. package/dist/chunk-JJJJ2RAD.js.map +0 -1
  176. package/dist/chunk-JRFUTIEH.js +0 -426
  177. package/dist/chunk-JRFUTIEH.js.map +0 -1
  178. package/dist/chunk-KJIFZLHN.js +0 -11066
  179. package/dist/chunk-KJIFZLHN.js.map +0 -1
  180. package/dist/chunk-LDVXYN6F.js.map +0 -1
  181. package/dist/chunk-MHOTXMD2.js +0 -430
  182. package/dist/chunk-MHOTXMD2.js.map +0 -1
  183. package/dist/chunk-NAGAJ5UM.js +0 -145
  184. package/dist/chunk-NAGAJ5UM.js.map +0 -1
  185. package/dist/chunk-NEPUP33Q.js +0 -35
  186. package/dist/chunk-NEPUP33Q.js.map +0 -1
  187. package/dist/chunk-OPVIX7E4.js.map +0 -1
  188. package/dist/chunk-OQ4KBUN2.js.map +0 -1
  189. package/dist/chunk-OXVCYRZB.js +0 -491
  190. package/dist/chunk-OXVCYRZB.js.map +0 -1
  191. package/dist/chunk-PJQAMC6L.js +0 -183
  192. package/dist/chunk-PJQAMC6L.js.map +0 -1
  193. package/dist/chunk-PW5QXRBA.js +0 -1173
  194. package/dist/chunk-PW5QXRBA.js.map +0 -1
  195. package/dist/chunk-QNAIDM6W.js.map +0 -1
  196. package/dist/chunk-R4PTE774.js.map +0 -1
  197. package/dist/chunk-S2E4KSYW.js +0 -610
  198. package/dist/chunk-S2E4KSYW.js.map +0 -1
  199. package/dist/chunk-SNVAMWB7.js +0 -40
  200. package/dist/chunk-SNVAMWB7.js.map +0 -1
  201. package/dist/chunk-TQ2NA4Z4.js.map +0 -1
  202. package/dist/chunk-U472S6IB.js.map +0 -1
  203. package/dist/chunk-UEHDEADL.js.map +0 -1
  204. package/dist/chunk-UNRR4KH5.js.map +0 -1
  205. package/dist/chunk-VQVUJYYY.js.map +0 -1
  206. package/dist/chunk-XGTTOO4R.js +0 -84
  207. package/dist/chunk-XGTTOO4R.js.map +0 -1
  208. package/dist/chunk-XRXFJTAT.js.map +0 -1
  209. package/dist/chunk-Y2JGMICO.js.map +0 -1
  210. package/dist/chunk-YVJQ2QDG.js.map +0 -1
  211. package/dist/chunk-YX7MVSDA.js +0 -235
  212. package/dist/chunk-YX7MVSDA.js.map +0 -1
  213. package/dist/chunk-ZGRBIBO7.js +0 -681
  214. package/dist/chunk-ZGRBIBO7.js.map +0 -1
  215. package/dist/chunk-ZTBAMBAI.js +0 -6448
  216. package/dist/chunk-ZTBAMBAI.js.map +0 -1
  217. package/dist/chunk-ZVANUFPF.js +0 -1035
  218. package/dist/chunk-ZVANUFPF.js.map +0 -1
  219. package/dist/doctor-HH6CFBRQ.js.map +0 -1
  220. package/dist/environment-K7YMJJYN.js.map +0 -1
  221. package/dist/help-QR4VTJZU.js.map +0 -1
  222. package/dist/help-TLHNRJJ6.js.map +0 -1
  223. package/dist/init-AOKFPZHG.js.map +0 -1
  224. package/dist/marketplace-TUVLLPBG.js.map +0 -1
  225. package/dist/migrate-55S4XODX.js.map +0 -1
  226. package/dist/open-SLFQV45J.js +0 -32
  227. package/dist/plugin-WLEFFBRY.js +0 -64
  228. package/dist/plugin-from-project-UV2O364T.js +0 -16
  229. package/dist/profile-STS3CZUK.js.map +0 -1
  230. package/dist/project-R4DGM3ZG.js.map +0 -1
  231. package/dist/resource-GJVEDXVZ.js.map +0 -1
  232. /package/dist/{apply-Q5SFF3FY.js.map → apply-FTAIL3X3.js.map} +0 -0
  233. /package/dist/{chunk-IHW4PCDT.js.map → chunk-6FXJIKEG.js.map} +0 -0
  234. /package/dist/{chunk-IAZNF35S.js.map → chunk-CBSDMRMY.js.map} +0 -0
  235. /package/dist/{chunk-3EGM4IUI.js.map → chunk-EPXAOEBB.js.map} +0 -0
  236. /package/dist/{chunk-XCPWLGPB.js.map → chunk-K4UDZUJ2.js.map} +0 -0
  237. /package/dist/{chunk-FBYAIBHP.js.map → chunk-MHLAIGIM.js.map} +0 -0
  238. /package/dist/{chunk-2H7UOFLK.js.map → chunk-MKLJBW5N.js.map} +0 -0
  239. /package/dist/{chunk-BXSS2S4W.js.map → chunk-R27VZIF6.js.map} +0 -0
  240. /package/dist/{chunk-JQOKQKQT.js.map → chunk-S2D5PWAO.js.map} +0 -0
  241. /package/dist/{chunk-WXRPQICX.js.map → chunk-UK2IV2ZQ.js.map} +0 -0
  242. /package/dist/{open-SLFQV45J.js.map → live-read-cache-ESQQJBNS.js.map} +0 -0
  243. /package/dist/{plugin-WLEFFBRY.js.map → live-read-cache-WPUFHVMZ.js.map} +0 -0
  244. /package/dist/{plugin-from-project-UV2O364T.js.map → open-D3GWGDSQ.js.map} +0 -0
  245. /package/dist/{version-FUHV4O6U.js.map → plugin-L3466DHK.js.map} +0 -0
@@ -1,128 +1,327 @@
1
- import {
2
- makeIdColumn
3
- } from "./chunk-IAZNF35S.js";
4
1
  import {
5
2
  handleUseCommand
6
- } from "./chunk-AFKCNFPP.js";
3
+ } from "./chunk-M6FEDSHY.js";
4
+ import {
5
+ makeIdColumn
6
+ } from "./chunk-CBSDMRMY.js";
7
7
  import {
8
8
  resolveUserPath
9
- } from "./chunk-AVZOFMJX.js";
10
- import "./chunk-FUV7QYBS.js";
11
- import "./chunk-WXRPQICX.js";
9
+ } from "./chunk-D7R577XZ.js";
10
+ import "./chunk-R6VFJKZB.js";
11
+ import "./chunk-UK2IV2ZQ.js";
12
12
  import "./chunk-VZQG2JDV.js";
13
+ import {
14
+ initializeSchema
15
+ } from "./chunk-RQLVXJH2.js";
16
+ import "./chunk-I6XFZLTJ.js";
17
+ import {
18
+ parseOutputFormat,
19
+ printJson
20
+ } from "./chunk-R4NV3Q7G.js";
21
+ import {
22
+ ON_CONFLICT_APPLY_HELP,
23
+ fail,
24
+ formatCommand,
25
+ reportNoGitOrigin
26
+ } from "./chunk-WGVU3LA5.js";
13
27
  import {
14
28
  applyImportedSnapshotToGlobal,
29
+ applyScanConflicts,
30
+ asRestoreFile,
15
31
  backupAndRewriteFile,
16
32
  buildProjectStatusPayload,
17
33
  captureManagedSnapshotState,
18
34
  classifyManagedPathOwnership,
35
+ createSnapshot,
36
+ detectPlatforms,
19
37
  detectProjectDriftFromLatest,
38
+ dropHarnessSkillsDuplicatingPluginSource,
20
39
  executeSafeFileRemovals,
40
+ findSnapshotById,
21
41
  flattenLiveRestoreFiles,
22
42
  formatDriftStatusLabel,
23
43
  formatResourceTypeSummary,
44
+ formatUpdatesLine,
24
45
  generateFiles,
25
46
  getGitOrigin,
26
47
  getGlobalApplySnapshot,
27
- hashGeneratedContent,
28
- hashOnDiskFile,
29
- listGlobalApplySnapshots,
30
- materializeFiles,
31
- normalizeGitUrl,
32
- projectNameFromUrl,
33
- restoreSafeRemovalBackup,
34
- snapshotAbsentPaths,
35
- writeFiles
36
- } from "./chunk-6ZWKF3YZ.js";
37
- import "./chunk-HWL67OCJ.js";
38
- import {
39
- promptForChoice
40
- } from "./chunk-NAGAJ5UM.js";
41
- import {
42
- initializeSchema
43
- } from "./chunk-QNAIDM6W.js";
44
- import "./chunk-NEPUP33Q.js";
45
- import {
46
- createSnapshot,
47
- findSnapshotById,
48
- listSnapshots
49
- } from "./chunk-555XE3NJ.js";
50
- import "./chunk-HENOKIBB.js";
51
- import "./chunk-I6XFZLTJ.js";
52
- import "./chunk-S2E4KSYW.js";
53
- import "./chunk-JRFUTIEH.js";
54
- import {
55
48
  getHarnessPreference,
56
49
  getProject,
57
50
  getProjectByOrigin,
58
51
  getProjectHarnessConfig,
59
- resolveScanGlobalHarnessTargets,
60
- setProjectHarnessConfig,
61
- uniqueHarnessTargets,
62
- upsertProject
63
- } from "./chunk-AUWWL6KX.js";
64
- import {
65
- applyScanConflicts,
66
- detectPlatforms,
67
- dropHarnessSkillsDuplicatingPluginSource,
52
+ hasClaudeWrittenRecordShape,
68
53
  hasPluginSourceLayout,
69
54
  hasSharedProjectResourceFiles,
55
+ hashFileOrLink,
56
+ hashGeneratedContent,
57
+ hashOnDiskFile,
58
+ isClaudeSettingsPath2 as isClaudeSettingsPath,
59
+ isHostPluginViewBackupId,
70
60
  isPluginSourcePath,
61
+ isSharedMergedConfigPath,
62
+ listGlobalApplySnapshots,
71
63
  listImportedSnapshots,
64
+ listSnapshots,
72
65
  mainScanLacksPluginSkills,
66
+ materializeFiles,
73
67
  mergeReferenceResourceInputs,
68
+ normalizeGitUrl,
74
69
  persistMergedProjectScan,
70
+ projectNameFromUrl,
71
+ reconcileMarketplacePluginTrees,
72
+ resolveScanGlobalHarnessTargets,
73
+ restoreBlockedGroupMessage,
74
+ restoreBlockedMessage,
75
+ restoreBlocker,
76
+ restoreForgottenEnabledKeys,
77
+ restoreForgottenSettingsMarketplaces,
78
+ restoreHostPluginViewBackup,
79
+ restoreRemovedHostPluginViews,
80
+ restoreRemovedOwnership,
81
+ restoreSafeRemovalBackup,
75
82
  scanAndPersistPluginSource,
76
83
  scanPlatform,
77
- scanProjectWithPluginSource
78
- } from "./chunk-ZTBAMBAI.js";
79
- import "./chunk-PW5QXRBA.js";
80
- import "./chunk-MHOTXMD2.js";
81
- import "./chunk-ZGRBIBO7.js";
82
- import {
83
- resolveHomeRoot,
84
84
  scanPluginSource,
85
- scanPluginSourceForMerge
86
- } from "./chunk-KJIFZLHN.js";
87
- import "./chunk-ZVANUFPF.js";
88
- import "./chunk-OPVIX7E4.js";
89
- import "./chunk-OXVCYRZB.js";
90
- import {
91
- parseOutputFormat,
92
- printJson
93
- } from "./chunk-TQ2NA4Z4.js";
85
+ scanPluginSourceForMerge,
86
+ scanProjectWithPluginSource,
87
+ setProjectHarnessConfig,
88
+ shortenHomePath,
89
+ snapshotAbsentPaths,
90
+ snapshotLinks,
91
+ uniqueHarnessTargets,
92
+ upsertProject,
93
+ writeFiles
94
+ } from "./chunk-BUA7WFI4.js";
94
95
  import {
95
- ON_CONFLICT_APPLY_HELP,
96
- fail,
97
- formatCommand,
98
- reportNoGitOrigin
99
- } from "./chunk-Y2JGMICO.js";
96
+ promptForChoice,
97
+ resolveHomeRoot
98
+ } from "./chunk-UC27MQ3T.js";
99
+ import "./chunk-V4UNYSZO.js";
100
+ import "./chunk-CWXCZBJR.js";
101
+ import "./chunk-A3TZT4WT.js";
100
102
  import {
103
+ CLI_COPY,
101
104
  createProgress,
102
105
  formatCount,
103
106
  formatRelativeTime,
107
+ getDb,
104
108
  kvBlock,
105
109
  panel,
110
+ restoredRemovedLine,
106
111
  status,
107
112
  subheader,
108
113
  table,
109
114
  theme,
110
115
  ui
111
- } from "./chunk-LDVXYN6F.js";
112
- import "./chunk-IKAGGJEO.js";
113
- import "./chunk-VQVUJYYY.js";
114
- import {
115
- CLI_COPY,
116
- getDb,
117
- restoredRemovedLine
118
- } from "./chunk-24V5ZSIF.js";
116
+ } from "./chunk-OHZNDV4A.js";
119
117
 
120
118
  // src/cli/commands/project.ts
121
119
  import { resolve as resolve2 } from "path";
122
120
 
123
121
  // src/services/snapshot-revert.ts
124
- import { existsSync, readFileSync } from "fs";
125
- import { resolve } from "path";
122
+ import { existsSync, lstatSync, mkdirSync, readFileSync, readlinkSync, symlinkSync } from "fs";
123
+ import { dirname, resolve } from "path";
124
+
125
+ // src/services/revert-plugin-registry.ts
126
+ var REGISTRY_RE = /^(.*)\/plugins\/(installed_plugins|known_marketplaces)\.json$/;
127
+ function jsonKeys(content, field) {
128
+ if (content === void 0) return [];
129
+ try {
130
+ const parsed = JSON.parse(content);
131
+ const value = field ? parsed[field] : parsed;
132
+ return typeof value === "object" && value !== null ? Object.keys(value) : [];
133
+ } catch {
134
+ return [];
135
+ }
136
+ }
137
+ function harnessTapRegistered(content) {
138
+ if (content === void 0) return [];
139
+ try {
140
+ const plugins = JSON.parse(content).plugins;
141
+ if (typeof plugins !== "object" || plugins === null) return [];
142
+ return Object.entries(plugins).filter(([, rows]) => !(Array.isArray(rows) && rows.length > 0 && rows.every(hasClaudeWrittenRecordShape))).map(([ref]) => ref);
143
+ } catch {
144
+ return [];
145
+ }
146
+ }
147
+ function listed(names, noun) {
148
+ const shown = names.slice(0, 3).join(", ");
149
+ const more = names.length > 3 ? ` and ${names.length - 3} more` : "";
150
+ return `${noun}${names.length === 1 ? "" : "s"} ${shown}${more}`;
151
+ }
152
+ function pluginsInCache(files, cache) {
153
+ const found = /* @__PURE__ */ new Set();
154
+ for (const file of files) {
155
+ if (!file.path.startsWith(cache)) continue;
156
+ const [marketplace, name] = file.path.slice(cache.length).split("/");
157
+ if (marketplace && name) found.add(`${name}@${marketplace}`);
158
+ }
159
+ return [...found];
160
+ }
161
+ function heldBackByRegistry(files, keptPaths) {
162
+ const held = { prefixes: [], enabledKeys: [], recordKeys: [], skips: [] };
163
+ const content = new Map(files.map((file) => [file.path, file.content]));
164
+ for (const registry of keptPaths) {
165
+ const match = REGISTRY_RE.exec(registry);
166
+ if (!match) continue;
167
+ const root = match[1] ?? "";
168
+ const pluginsDir = `${root}/plugins`;
169
+ const cache = `${pluginsDir}/cache/`;
170
+ const installed = `${pluginsDir}/installed_plugins.json`;
171
+ const file = registry.slice(pluginsDir.length + 1);
172
+ const registered = harnessTapRegistered(content.get(installed));
173
+ if (match[2] === "installed_plugins") {
174
+ const names = [];
175
+ for (const key of registered) {
176
+ const [name, marketplace] = key.split("@");
177
+ if (!name || !marketplace) continue;
178
+ held.prefixes.push(`${cache}${marketplace}/${name}/`);
179
+ held.enabledKeys.push(key);
180
+ names.push(key);
181
+ }
182
+ if (names.length > 0) {
183
+ held.skips.push({
184
+ path: registry,
185
+ reason: "unmanaged",
186
+ message: `Skipped restoring ${listed(names, "plugin")} (${file} was kept as it is, so ${names.length === 1 ? "it is" : "they are"} not registered there).`
187
+ });
188
+ }
189
+ } else {
190
+ const marketplaces = jsonKeys(content.get(registry));
191
+ for (const marketplace of marketplaces) {
192
+ held.prefixes.push(`${cache}${marketplace}/`, `${pluginsDir}/marketplaces/${marketplace}/`);
193
+ for (const key of [...registered, ...pluginsInCache(files, cache)]) {
194
+ if (key.endsWith(`@${marketplace}`)) held.enabledKeys.push(key);
195
+ }
196
+ }
197
+ if (marketplaces.length > 0) {
198
+ held.skips.push({
199
+ path: registry,
200
+ reason: "unmanaged",
201
+ message: `Skipped restoring ${listed(marketplaces, "marketplace")} and ${marketplaces.length === 1 ? "its" : "their"} plugins (${file} was kept as it is, so ${marketplaces.length === 1 ? "it is" : "they are"} not registered there).`
202
+ });
203
+ }
204
+ }
205
+ }
206
+ holdBackBlockedPlugins(keptPaths, content, held);
207
+ const touched = held.prefixes.some((prefix) => files.some((file) => file.path.startsWith(prefix)));
208
+ const keys = held.enabledKeys.length > 0;
209
+ if (!touched && !keys) return void 0;
210
+ held.enabledKeys = [...new Set(held.enabledKeys)];
211
+ held.recordKeys = [...new Set(held.recordKeys)];
212
+ return held;
213
+ }
214
+ var CACHE_FILE_RE = /^(.*)\/plugins\/cache\/([^/]+)\/([^/]+)\//;
215
+ function holdBackBlockedPlugins(keptPaths, content, held) {
216
+ const done = /* @__PURE__ */ new Set();
217
+ for (const path of keptPaths) {
218
+ const match = CACHE_FILE_RE.exec(path);
219
+ if (!match) continue;
220
+ const [, root = "", marketplace = "", name = ""] = match;
221
+ const key = `${name}@${marketplace}`;
222
+ if (done.has(`${root}/${key}`)) continue;
223
+ const registered = harnessTapRegistered(content.get(`${root}/plugins/installed_plugins.json`));
224
+ if (!registered.includes(key)) continue;
225
+ done.add(`${root}/${key}`);
226
+ held.prefixes.push(`${root}/plugins/cache/${marketplace}/${name}/`);
227
+ held.enabledKeys.push(key);
228
+ held.recordKeys.push(key);
229
+ held.skips.push({
230
+ path,
231
+ reason: "unmanaged",
232
+ message: `Skipped restoring plugin ${key} as a whole: some of its files cannot be put back, so it is not registered or enabled either.`
233
+ });
234
+ }
235
+ }
236
+ function enabledPluginsOf(raw) {
237
+ if (raw === void 0) return {};
238
+ try {
239
+ const enabled = JSON.parse(raw).enabledPlugins;
240
+ return typeof enabled === "object" && enabled !== null && !Array.isArray(enabled) ? enabled : {};
241
+ } catch {
242
+ return {};
243
+ }
244
+ }
245
+ function withoutEnabledKeys(content, keys, live) {
246
+ if (keys.length === 0) return content;
247
+ try {
248
+ const parsed = JSON.parse(content);
249
+ const enabled = parsed.enabledPlugins;
250
+ if (typeof enabled !== "object" || enabled === null) return content;
251
+ const next = { ...enabled };
252
+ const onDisk = enabledPluginsOf(live);
253
+ for (const key of keys) {
254
+ if (key in onDisk) next[key] = onDisk[key];
255
+ else delete next[key];
256
+ }
257
+ const indent = /^\{\n( +)"/.exec(content)?.[1]?.length ?? 2;
258
+ const tail = content.endsWith("\n") ? "\n" : "";
259
+ return `${JSON.stringify({ ...parsed, enabledPlugins: next }, null, indent)}${tail}`;
260
+ } catch {
261
+ return content;
262
+ }
263
+ }
264
+ var MERGED_SETTINGS_FIELDS = ["enabledPlugins", "extraKnownMarketplaces"];
265
+ function objectOf(value) {
266
+ return typeof value === "object" && value !== null && !Array.isArray(value) ? value : void 0;
267
+ }
268
+ function withSnapshotSettingsKeys(snapshot, live) {
269
+ try {
270
+ const wanted = objectOf(JSON.parse(snapshot));
271
+ const current = objectOf(JSON.parse(live));
272
+ if (!wanted || !current) return void 0;
273
+ const next = { ...current };
274
+ let added = false;
275
+ for (const field of MERGED_SETTINGS_FIELDS) {
276
+ const from = objectOf(wanted[field]);
277
+ if (!from) continue;
278
+ const have = current[field] === void 0 ? {} : objectOf(current[field]);
279
+ if (!have) continue;
280
+ const merged = { ...have };
281
+ for (const [key, value] of Object.entries(from)) {
282
+ if (key in merged) continue;
283
+ merged[key] = value;
284
+ added = true;
285
+ }
286
+ next[field] = merged;
287
+ }
288
+ if (!added) return live;
289
+ const indent = /^\{\n( +)"/.exec(live)?.[1]?.length ?? 2;
290
+ const tail = live.endsWith("\n") ? "\n" : "";
291
+ return `${JSON.stringify(next, null, indent)}${tail}`;
292
+ } catch {
293
+ return void 0;
294
+ }
295
+ }
296
+ function withoutInstalledRecords(content, refs, live) {
297
+ if (refs.length === 0) return content;
298
+ try {
299
+ const parsed = JSON.parse(content);
300
+ const plugins = objectOf(parsed.plugins);
301
+ if (!plugins) return content;
302
+ const next = { ...plugins };
303
+ const onDisk = live === void 0 ? void 0 : objectOf(JSON.parse(live).plugins);
304
+ for (const ref of refs) {
305
+ if (onDisk && ref in onDisk) next[ref] = onDisk[ref];
306
+ else delete next[ref];
307
+ }
308
+ const indent = /^\{\n( +)"/.exec(content)?.[1]?.length ?? 2;
309
+ const tail = content.endsWith("\n") ? "\n" : "";
310
+ return `${JSON.stringify({ ...parsed, plugins: next }, null, indent)}${tail}`;
311
+ } catch {
312
+ return content;
313
+ }
314
+ }
315
+ function registersNoPlugin(content) {
316
+ try {
317
+ const plugins = objectOf(JSON.parse(content).plugins);
318
+ return plugins !== void 0 && Object.keys(plugins).length === 0;
319
+ } catch {
320
+ return false;
321
+ }
322
+ }
323
+
324
+ // src/services/snapshot-revert.ts
126
325
  var PREFIX_MIN = 8;
127
326
  function parseStoredState(raw) {
128
327
  if (typeof raw !== "object" || raw === null) {
@@ -138,7 +337,7 @@ function capturedStateUseful(state) {
138
337
  if (!state) {
139
338
  return false;
140
339
  }
141
- return Object.keys(state.platform_files).length > 0 || Object.keys(state.disk_files ?? {}).length > 0 || (state.absent_paths?.length ?? 0) > 0 || Object.keys(state.harness_files ?? {}).length > 0;
340
+ return Object.keys(state.platform_files).length > 0 || Object.keys(state.disk_files ?? {}).length > 0 || Object.keys(state.disk_files_base64 ?? {}).length > 0 || (state.absent_paths?.length ?? 0) > 0 || Object.keys(state.harness_files ?? {}).length > 0 || Object.keys(state.disk_links ?? {}).length > 0 || (state.trashed_files?.length ?? 0) > 0;
142
341
  }
143
342
  function findGlobalByPrefix(prefix) {
144
343
  const matches = listGlobalApplySnapshots().filter((row) => row.id.startsWith(prefix));
@@ -162,6 +361,7 @@ function resolveRevertPlan(snapshotId) {
162
361
  label: projectSnap.label,
163
362
  createdAt: projectSnap.created_at,
164
363
  restoreFiles: flattenLiveRestoreFiles(projectSnap.state),
364
+ restoreLinks: snapshotLinks(projectSnap.state),
165
365
  absentPaths: snapshotAbsentPaths(projectSnap.state),
166
366
  hasCapturedState: capturedStateUseful(projectSnap.state)
167
367
  };
@@ -177,18 +377,29 @@ function resolveRevertPlan(snapshotId) {
177
377
  rootPath: resolveHomeRoot(),
178
378
  label: globalSnap.profile_name,
179
379
  createdAt: globalSnap.created_at,
180
- restoreFiles: state ? flattenLiveRestoreFiles(state) : [],
380
+ restoreFiles: state ? flattenLiveRestoreFiles(state, globalSnap.id) : [],
381
+ restoreLinks: state ? snapshotLinks(state) : [],
181
382
  absentPaths: state ? snapshotAbsentPaths(state) : [],
182
383
  hasCapturedState: capturedStateUseful(state)
183
384
  };
184
385
  }
386
+ function readLive(rootPath, path) {
387
+ try {
388
+ return readFileSync(resolve(rootPath, path), "utf-8");
389
+ } catch {
390
+ return void 0;
391
+ }
392
+ }
185
393
  function shouldRestorePath(rootPath, file) {
186
394
  const fullPath = resolve(rootPath, file.path);
395
+ if (restoreBlocker(rootPath, file.path) !== void 0) {
396
+ return "skip-blocked";
397
+ }
187
398
  if (!existsSync(fullPath)) {
188
399
  return "write";
189
400
  }
190
- const onDisk = readFileSync(fullPath, "utf-8");
191
- if (onDisk === file.content) {
401
+ const wanted = file.bytes;
402
+ if (readFileSync(fullPath).equals(wanted)) {
192
403
  return "unchanged";
193
404
  }
194
405
  const ownership = classifyManagedPathOwnership(rootPath, file.path);
@@ -198,11 +409,35 @@ function shouldRestorePath(rootPath, file) {
198
409
  if (ownership === "owned") {
199
410
  return "write";
200
411
  }
201
- if (hashOnDiskFile(fullPath) === hashGeneratedContent(file.content)) {
412
+ if (hashOnDiskFile(fullPath) === hashGeneratedContent(wanted.toString("utf-8"))) {
202
413
  return "unchanged";
203
414
  }
204
415
  return "skip-modified";
205
416
  }
417
+ function textRestoreFile(path, text, mode) {
418
+ return { path, content: text, bytes: Buffer.from(text, "utf-8"), ...mode === void 0 ? {} : { mode } };
419
+ }
420
+ function skippedWarnings(skipped) {
421
+ const byBlocker = /* @__PURE__ */ new Map();
422
+ const warnings = [];
423
+ for (const entry of skipped) {
424
+ if (entry.reason === "missing") continue;
425
+ if (entry.blockedBy === void 0) {
426
+ warnings.push(entry.message);
427
+ continue;
428
+ }
429
+ byBlocker.set(entry.blockedBy, [...byBlocker.get(entry.blockedBy) ?? [], entry]);
430
+ }
431
+ for (const [blocker, entries] of byBlocker) {
432
+ const [first] = entries;
433
+ if (entries.length === 1 && first) {
434
+ warnings.push(first.message);
435
+ continue;
436
+ }
437
+ warnings.push(restoreBlockedGroupMessage(blocker, entries.map((entry) => entry.path)));
438
+ }
439
+ return warnings;
440
+ }
206
441
  function executeRevert(plan, options = {}) {
207
442
  const restored = [];
208
443
  const skipped = [];
@@ -210,13 +445,72 @@ function executeRevert(plan, options = {}) {
210
445
  restored.push(
211
446
  ...restoreSafeRemovalBackup({
212
447
  snapshotId: plan.id,
213
- rootPath: plan.rootPath
448
+ rootPath: plan.rootPath,
449
+ onSkip: (skip) => skipped.push(skip)
214
450
  })
215
451
  );
216
452
  }
453
+ const planFiles = plan.restoreFiles.map(asRestoreFile);
454
+ const decisions = planFiles.map((file) => ({
455
+ file,
456
+ decision: shouldRestorePath(plan.rootPath, file)
457
+ }));
458
+ const kept = new Set(
459
+ decisions.filter((entry) => entry.decision.startsWith("skip")).map((entry) => entry.file.path)
460
+ );
461
+ const linkOutcomes = (plan.restoreLinks ?? []).map((link) => {
462
+ const fullPath = resolve(plan.rootPath, link.path);
463
+ const blocker = restoreBlocker(plan.rootPath, link.path);
464
+ if (blocker !== void 0) {
465
+ return {
466
+ kind: "skip",
467
+ link,
468
+ skip: {
469
+ path: link.path,
470
+ reason: "unmanaged",
471
+ blockedBy: blocker,
472
+ message: restoreBlockedMessage(link.path, blocker, "link")
473
+ }
474
+ };
475
+ }
476
+ let current;
477
+ try {
478
+ current = lstatSync(fullPath).isSymbolicLink() ? readlinkSync(fullPath) : null;
479
+ } catch {
480
+ current = void 0;
481
+ }
482
+ if (current === link.target) return { kind: "present", link };
483
+ if (current === void 0) return { kind: "make", link };
484
+ return {
485
+ kind: "skip",
486
+ link,
487
+ skip: {
488
+ path: link.path,
489
+ reason: "modified",
490
+ message: `Skipped restoring the link ${link.path} (something else is at that path now).`
491
+ }
492
+ };
493
+ });
494
+ for (const entry of linkOutcomes) if (entry.kind === "skip") kept.add(entry.link.path);
495
+ const heldBack = heldBackByRegistry(planFiles, kept);
496
+ if (heldBack) skipped.push(...heldBack.skips);
497
+ const isHeldBack = (path) => heldBack?.prefixes.some((prefix) => path.startsWith(prefix)) === true;
217
498
  const toWrite = [];
218
- for (const file of plan.restoreFiles) {
219
- const decision = shouldRestorePath(plan.rootPath, file);
499
+ for (const { file: planned, decision } of decisions) {
500
+ if (isHeldBack(planned.path) && !(heldBack?.recordKeys.length && decision.startsWith("skip"))) continue;
501
+ let file = planned;
502
+ if (heldBack && heldBack.enabledKeys.length > 0 && planned.path.endsWith("/settings.json")) {
503
+ file = textRestoreFile(
504
+ planned.path,
505
+ withoutEnabledKeys(planned.content, heldBack.enabledKeys, readLive(plan.rootPath, planned.path)),
506
+ planned.mode
507
+ );
508
+ } else if (heldBack && heldBack.recordKeys.length > 0 && planned.path.endsWith("/plugins/installed_plugins.json")) {
509
+ const live = readLive(plan.rootPath, planned.path);
510
+ const text = withoutInstalledRecords(planned.content, heldBack.recordKeys, live);
511
+ if (live === void 0 && registersNoPlugin(text)) continue;
512
+ file = textRestoreFile(planned.path, text, planned.mode);
513
+ }
220
514
  switch (decision) {
221
515
  case "write":
222
516
  toWrite.push(file);
@@ -225,13 +519,31 @@ function executeRevert(plan, options = {}) {
225
519
  case "unchanged":
226
520
  restored.push(file.path);
227
521
  break;
228
- case "skip-modified":
522
+ case "skip-modified": {
523
+ const live = isClaudeSettingsPath(file.path) ? readLive(plan.rootPath, file.path) : void 0;
524
+ const merged = live === void 0 ? void 0 : withSnapshotSettingsKeys(file.content, live);
525
+ if (merged !== void 0) {
526
+ if (merged !== live) toWrite.push(textRestoreFile(file.path, merged));
527
+ restored.push(file.path);
528
+ break;
529
+ }
229
530
  skipped.push({
230
531
  path: file.path,
231
532
  reason: "modified",
232
533
  message: `Skipped restoring ${file.path} (modified since HarnessTap wrote it).`
233
534
  });
234
535
  break;
536
+ }
537
+ case "skip-blocked": {
538
+ const blocker = restoreBlocker(plan.rootPath, file.path) ?? file.path;
539
+ skipped.push({
540
+ path: file.path,
541
+ reason: "unmanaged",
542
+ blockedBy: blocker,
543
+ message: restoreBlockedMessage(file.path, blocker)
544
+ });
545
+ break;
546
+ }
235
547
  case "skip-unmanaged":
236
548
  skipped.push({
237
549
  path: file.path,
@@ -245,12 +557,28 @@ function executeRevert(plan, options = {}) {
245
557
  }
246
558
  }
247
559
  }
560
+ const linksToMake = [];
561
+ for (const entry of linkOutcomes) {
562
+ if (isHeldBack(entry.link.path) && entry.kind !== "skip") continue;
563
+ if (entry.kind === "skip") {
564
+ skipped.push(entry.skip);
565
+ continue;
566
+ }
567
+ if (entry.kind === "make") linksToMake.push(entry.link);
568
+ restored.push(entry.link.path);
569
+ }
248
570
  if (!options.dryRun) {
571
+ for (const link of linksToMake) {
572
+ const fullPath = resolve(plan.rootPath, link.path);
573
+ mkdirSync(dirname(fullPath), { recursive: true });
574
+ symlinkSync(link.target, fullPath);
575
+ }
249
576
  for (const file of toWrite) {
250
577
  backupAndRewriteFile({
251
578
  rootPath: plan.rootPath,
252
579
  relativePath: file.path,
253
- nextContent: file.content,
580
+ nextContent: file.bytes,
581
+ mode: file.mode,
254
582
  applyId: options.applyId ?? plan.id,
255
583
  snapshotId: plan.id
256
584
  });
@@ -262,8 +590,29 @@ function executeRevert(plan, options = {}) {
262
590
  applyId: options.applyId ?? plan.id,
263
591
  snapshotId: plan.id
264
592
  });
593
+ if (!options.dryRun) {
594
+ restoreRemovedOwnership({
595
+ snapshotId: plan.id,
596
+ rootPath: plan.rootPath,
597
+ restoredPaths: restored,
598
+ hashOf: hashFileOrLink,
599
+ isMergedConfig: isSharedMergedConfigPath
600
+ });
601
+ restoreRemovedHostPluginViews({
602
+ snapshotId: plan.id,
603
+ rootPath: plan.rootPath,
604
+ restoredPaths: restored,
605
+ hashOf: hashFileOrLink
606
+ });
607
+ for (const path of new Set(restored)) {
608
+ if (!isClaudeSettingsPath(path)) continue;
609
+ restoreForgottenEnabledKeys(resolve(plan.rootPath, path), plan.id);
610
+ restoreForgottenSettingsMarketplaces(resolve(plan.rootPath, path), plan.id);
611
+ }
612
+ }
613
+ if (!options.dryRun) reconcileMarketplacePluginTrees(plan.rootPath);
265
614
  const warnings = [
266
- ...skipped.filter((entry) => entry.reason !== "missing").map((entry) => entry.message),
615
+ ...skippedWarnings(skipped),
267
616
  ...removal.warnings
268
617
  ];
269
618
  return {
@@ -275,8 +624,8 @@ function executeRevert(plan, options = {}) {
275
624
  }
276
625
 
277
626
  // src/services/project-sync.ts
278
- import { existsSync as existsSync3, mkdirSync, symlinkSync, unlinkSync } from "fs";
279
- import { dirname, join as join2, relative } from "path";
627
+ import { existsSync as existsSync3, mkdirSync as mkdirSync2, symlinkSync as symlinkSync2, unlinkSync } from "fs";
628
+ import { dirname as dirname2, join as join2, relative } from "path";
280
629
 
281
630
  // src/services/harness-surface-gaps.ts
282
631
  import { existsSync as existsSync2, readdirSync, readFileSync as readFileSync2 } from "fs";
@@ -407,9 +756,9 @@ function writeAliasFiles(files, projectRoot, strategy, mainFiles) {
407
756
  let written = 0;
408
757
  for (const file of files) {
409
758
  const fullPath = join2(projectRoot, file.path);
410
- const parent = dirname(fullPath);
759
+ const parent = dirname2(fullPath);
411
760
  if (!existsSync3(parent)) {
412
- mkdirSync(parent, { recursive: true });
761
+ mkdirSync2(parent, { recursive: true });
413
762
  }
414
763
  const mainPathForContent = mainByContent.get(file.content);
415
764
  const useSymlink = strategy === "symlink-preferred" && mainPathForContent !== void 0 && mainPathForContent !== file.path;
@@ -421,8 +770,8 @@ function writeAliasFiles(files, projectRoot, strategy, mainFiles) {
421
770
  } catch {
422
771
  }
423
772
  }
424
- const relTarget = relative(dirname(fullPath), target);
425
- symlinkSync(relTarget, fullPath);
773
+ const relTarget = relative(dirname2(fullPath), target);
774
+ symlinkSync2(relTarget, fullPath);
426
775
  written++;
427
776
  continue;
428
777
  }
@@ -699,6 +1048,10 @@ function renderProjectStatusHuman(payload) {
699
1048
  )
700
1049
  ]);
701
1050
  }
1051
+ const updatesLine = formatUpdatesLine(payload.updates);
1052
+ if (updatesLine) {
1053
+ profileRows.push(["Updates", updatesLine]);
1054
+ }
702
1055
  panel({ title: ["PROFILE"], rows: profileRows });
703
1056
  subheader("APPLIED PLUGINS");
704
1057
  if (payload.applied_plugins.length === 0) {
@@ -816,6 +1169,7 @@ function projectStatusPayloadToJson(payload) {
816
1169
  },
817
1170
  project_resources: payload.project_resources,
818
1171
  ...payload.lock ? { lock: payload.lock } : {},
1172
+ updates: payload.updates,
819
1173
  ...payload.project ? {
820
1174
  applied_plugins_count: payload.applied_plugins.length,
821
1175
  snapshots: payload.snapshots_count
@@ -1160,9 +1514,60 @@ function handleHistoryCommand(path, opts) {
1160
1514
  { key: "label", header: "LABEL", width: showId ? 36 : 50 }
1161
1515
  ],
1162
1516
  rows,
1163
- summary: `${rows.length} snapshots`
1517
+ summary: formatCount(rows.length, "snapshot")
1164
1518
  });
1165
1519
  }
1520
+ function revertHostPluginViewBackup(backupId, opts, format) {
1521
+ const result = restoreHostPluginViewBackup(backupId, {
1522
+ dryRun: opts.dryRun,
1523
+ forceRemove: opts.forceRemove
1524
+ });
1525
+ if (!result) return;
1526
+ const changed = result.skipped.filter((file) => file.reason === "changed").map((file) => file.path);
1527
+ const blocked = result.skipped.filter((file) => file.reason === "blocked");
1528
+ if (format === "json") {
1529
+ printJson({
1530
+ dry_run: Boolean(opts.dryRun),
1531
+ backup_id: backupId,
1532
+ kind: "plugin-folder-backup",
1533
+ folder: result.hostView,
1534
+ restored: result.restored,
1535
+ kept: changed,
1536
+ blocked: blocked.map((file) => ({ path: file.path, blocked_by: file.blockedBy ?? null })),
1537
+ replaced_backup_id: result.replacedBackupId ?? null
1538
+ });
1539
+ return;
1540
+ }
1541
+ const where = shortenHomePath(result.hostView);
1542
+ if (opts.dryRun) {
1543
+ console.log(CLI_COPY.dryRunNothingChanged);
1544
+ }
1545
+ if (changed.length > 0) {
1546
+ ui.warn(
1547
+ `Kept ${formatCount(changed.length, "file")} in ${where} that changed since the backup: ${changed.join(", ")}. To back up the current copies and put the old ones back, run the command again with --force-remove.`
1548
+ );
1549
+ }
1550
+ const describeBlocked = (files) => files.map((file) => `${file.path} (${file.blockedBy} is in the way)`).join(", ");
1551
+ const forceable = opts.forceRemove ? [] : blocked.filter((file) => file.canForce);
1552
+ const notForceable = blocked.filter((file) => !forceable.includes(file));
1553
+ if (forceable.length > 0) {
1554
+ ui.warn(
1555
+ `Could not restore ${formatCount(forceable.length, "file")} in ${where}: ${describeBlocked(forceable)}. To back up what is in the way and put the old ones back, run the command again with --force-remove.`
1556
+ );
1557
+ }
1558
+ if (notForceable.length > 0) {
1559
+ ui.warn(
1560
+ `Could not restore ${formatCount(notForceable.length, "file")} in ${where}: ${describeBlocked(notForceable)}. HarnessTap never removes files it did not write. Move them away, then run the command again.`
1561
+ );
1562
+ }
1563
+ if (result.replacedBackupId) {
1564
+ ui.info(
1565
+ `Backed up the files it replaced first. To undo, run \`${formatCommand(["revert", result.replacedBackupId])}\`.`
1566
+ );
1567
+ }
1568
+ const verb = opts.dryRun ? "Would restore" : "Restored";
1569
+ ui.success(`${verb} ${formatCount(result.restored.length, "file")} in ${where}.`);
1570
+ }
1166
1571
  function handleRevertCommand(snapshotId, opts) {
1167
1572
  const db = getDb();
1168
1573
  initializeSchema(db);
@@ -1173,6 +1578,10 @@ function handleRevertCommand(snapshotId, opts) {
1173
1578
  });
1174
1579
  return;
1175
1580
  }
1581
+ if (isHostPluginViewBackupId(snapshotId)) {
1582
+ revertHostPluginViewBackup(snapshotId, opts, format);
1583
+ return;
1584
+ }
1176
1585
  const plan = resolveRevertPlan(snapshotId);
1177
1586
  if ("error" in plan) {
1178
1587
  fail(plan.error, {
@@ -1197,6 +1606,9 @@ function handleRevertCommand(snapshotId, opts) {
1197
1606
  }
1198
1607
  if (opts.dryRun) {
1199
1608
  console.log(CLI_COPY.dryRunNothingChanged);
1609
+ for (const warning of result.warnings) {
1610
+ ui.warn(warning);
1611
+ }
1200
1612
  console.log(
1201
1613
  restoredRemovedLine(result.restored.length, result.removed.length, {
1202
1614
  dryRun: true
@@ -1389,4 +1801,4 @@ export {
1389
1801
  registerProjectCommandsAfterConfig,
1390
1802
  registerProjectCommandsBeforeConfig
1391
1803
  };
1392
- //# sourceMappingURL=project-R4DGM3ZG.js.map
1804
+ //# sourceMappingURL=project-3KR3EPYR.js.map