harnesstap 1.4.0 → 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.
- package/README.md +2 -0
- package/dist/apply-FTAIL3X3.js +50 -0
- package/dist/{approve-FBGYQGWN.js → approve-R6AWQB3I.js} +10 -13
- package/dist/{approve-FBGYQGWN.js.map → approve-R6AWQB3I.js.map} +1 -1
- package/dist/{audit-VI4QZ6X2.js → audit-2HNKFPSU.js} +11 -15
- package/dist/{audit-VI4QZ6X2.js.map → audit-2HNKFPSU.js.map} +1 -1
- package/dist/{auth-4CQCDS2W.js → auth-C54KRLNF.js} +10 -12
- package/dist/{auth-4CQCDS2W.js.map → auth-C54KRLNF.js.map} +1 -1
- package/dist/bin.js +13 -34
- package/dist/bin.js.map +1 -1
- package/dist/{chunk-IE7B6Q5K.js → chunk-2XDYQXP2.js} +17 -18
- package/dist/chunk-2XDYQXP2.js.map +1 -0
- package/dist/{chunk-L6YZE5MY.js → chunk-3277RVZT.js} +5 -7
- package/dist/{chunk-L6YZE5MY.js.map → chunk-3277RVZT.js.map} +1 -1
- package/dist/{chunk-QA5U36JN.js → chunk-3Q72LZPJ.js} +764 -340
- package/dist/chunk-3Q72LZPJ.js.map +1 -0
- package/dist/{chunk-OML4HXKT.js → chunk-42E2MPES.js} +16 -22
- package/dist/chunk-42E2MPES.js.map +1 -0
- package/dist/{chunk-4ZQ2SCGY.js → chunk-5HACBPK2.js} +509 -207
- package/dist/chunk-5HACBPK2.js.map +1 -0
- package/dist/{chunk-GRASK6M6.js → chunk-6FXJIKEG.js} +5 -5
- package/dist/{chunk-73OJQTBW.js → chunk-A3TZT4WT.js} +2 -2
- package/dist/{chunk-ZUASVASP.js → chunk-BUA7WFI4.js} +27034 -18024
- package/dist/chunk-BUA7WFI4.js.map +1 -0
- package/dist/{chunk-U6DXASQP.js → chunk-CBSDMRMY.js} +2 -2
- package/dist/{chunk-RDG5DT7S.js → chunk-CR2TYMKC.js} +54 -40
- package/dist/chunk-CR2TYMKC.js.map +1 -0
- package/dist/{chunk-REHRUNBB.js → chunk-CWXCZBJR.js} +70 -5
- package/dist/chunk-CWXCZBJR.js.map +1 -0
- package/dist/{chunk-R7ZOYVN3.js → chunk-D7R577XZ.js} +187 -59
- package/dist/chunk-D7R577XZ.js.map +1 -0
- package/dist/{chunk-P2C7JPLD.js → chunk-EPXAOEBB.js} +6 -6
- package/dist/{chunk-D432JAXV.js → chunk-GZU4LVFF.js} +153 -25
- package/dist/chunk-GZU4LVFF.js.map +1 -0
- package/dist/chunk-HV3ENT2F.js +61 -0
- package/dist/chunk-HV3ENT2F.js.map +1 -0
- package/dist/{chunk-3P6BWL5F.js → chunk-K4UDZUJ2.js} +2 -2
- package/dist/{chunk-ULCD6DJE.js → chunk-L6BJCRBU.js} +14 -39
- package/dist/chunk-L6BJCRBU.js.map +1 -0
- package/dist/{chunk-M4KLHJ6U.js → chunk-M6FEDSHY.js} +8 -10
- package/dist/{chunk-M4KLHJ6U.js.map → chunk-M6FEDSHY.js.map} +1 -1
- package/dist/chunk-M7PHQ3UC.js +31491 -0
- package/dist/chunk-M7PHQ3UC.js.map +1 -0
- package/dist/{chunk-PNGF5EV2.js → chunk-MHLAIGIM.js} +2 -2
- package/dist/{chunk-BPWFQKI5.js → chunk-MHMFF6A5.js} +2 -2
- package/dist/chunk-MKLJBW5N.js +14 -0
- package/dist/{chunk-MR7IOHSX.js → chunk-MQCAPCAF.js} +16 -22
- package/dist/{chunk-MR7IOHSX.js.map → chunk-MQCAPCAF.js.map} +1 -1
- package/dist/{chunk-N3VGY3T3.js → chunk-MQCH3YZ5.js} +7 -5
- package/dist/{chunk-N3VGY3T3.js.map → chunk-MQCH3YZ5.js.map} +1 -1
- package/dist/{chunk-WG5A6EAU.js → chunk-OHZNDV4A.js} +821 -28
- package/dist/chunk-OHZNDV4A.js.map +1 -0
- package/dist/{chunk-WGP4GUYZ.js → chunk-OWE3OSX6.js} +9 -11
- package/dist/{chunk-WGP4GUYZ.js.map → chunk-OWE3OSX6.js.map} +1 -1
- package/dist/{chunk-RVEXPMM3.js → chunk-PCNHBMBU.js} +3 -5
- package/dist/{chunk-RVEXPMM3.js.map → chunk-PCNHBMBU.js.map} +1 -1
- package/dist/{chunk-23XSG7LI.js → chunk-QGTDQNVV.js} +4 -4
- package/dist/{chunk-UVVZHWD2.js → chunk-R27VZIF6.js} +2 -2
- package/dist/{chunk-TQ2NA4Z4.js → chunk-R4NV3Q7G.js} +8 -2
- package/dist/chunk-R4NV3Q7G.js.map +1 -0
- package/dist/{chunk-EOPFER6N.js → chunk-R6VFJKZB.js} +19 -5
- package/dist/chunk-R6VFJKZB.js.map +1 -0
- package/dist/{chunk-3FS775NP.js → chunk-RQLVXJH2.js} +85 -4
- package/dist/chunk-RQLVXJH2.js.map +1 -0
- package/dist/{chunk-JQOKQKQT.js → chunk-S2D5PWAO.js} +2 -2
- package/dist/{chunk-43BDGVN3.js → chunk-T4EKNX2Q.js} +56 -9
- package/dist/chunk-T4EKNX2Q.js.map +1 -0
- package/dist/{chunk-XTVGCVU4.js → chunk-TERYL7JH.js} +36 -37
- package/dist/chunk-TERYL7JH.js.map +1 -0
- package/dist/{chunk-6LTLYV5D.js → chunk-UC27MQ3T.js} +1064 -265
- package/dist/chunk-UC27MQ3T.js.map +1 -0
- package/dist/chunk-UEA4NCY2.js +106 -0
- package/dist/chunk-UEA4NCY2.js.map +1 -0
- package/dist/{chunk-7HP6AAI3.js → chunk-UK2IV2ZQ.js} +2 -2
- package/dist/{chunk-PCMON7Y2.js → chunk-UZCAYOIQ.js} +8 -10
- package/dist/{chunk-PCMON7Y2.js.map → chunk-UZCAYOIQ.js.map} +1 -1
- package/dist/{chunk-N3ZCH64F.js → chunk-V4UNYSZO.js} +86 -32
- package/dist/chunk-V4UNYSZO.js.map +1 -0
- package/dist/chunk-VAPCU2FX.js +70 -0
- package/dist/chunk-VAPCU2FX.js.map +1 -0
- package/dist/{chunk-RFQ3N7FB.js → chunk-WGVU3LA5.js} +11 -9
- package/dist/chunk-WGVU3LA5.js.map +1 -0
- package/dist/{chunk-IMROMZ2K.js → chunk-WQ3F4O7U.js} +19 -14
- package/dist/chunk-WQ3F4O7U.js.map +1 -0
- package/dist/chunk-XNS4I3W6.js +102 -0
- package/dist/chunk-XNS4I3W6.js.map +1 -0
- package/dist/{chunk-2A36HWDE.js → chunk-Y4I7ZCAE.js} +129 -136
- package/dist/chunk-Y4I7ZCAE.js.map +1 -0
- package/dist/{chunk-TPEJFLV7.js → chunk-ZKMSHLXP.js} +4 -6
- package/dist/{chunk-TPEJFLV7.js.map → chunk-ZKMSHLXP.js.map} +1 -1
- package/dist/{compile-GXADKGH5.js → compile-B2QG6BAQ.js} +33 -37
- package/dist/{compile-GXADKGH5.js.map → compile-B2QG6BAQ.js.map} +1 -1
- package/dist/{config-JMHNA2U5.js → config-D3F6ICZ2.js} +16 -21
- package/dist/{config-JMHNA2U5.js.map → config-D3F6ICZ2.js.map} +1 -1
- package/dist/{cursor-local-install-46RWRBDT.js → cursor-local-install-4HDIBX22.js} +8 -12
- package/dist/{cursor-local-install-46RWRBDT.js.map → cursor-local-install-4HDIBX22.js.map} +1 -1
- package/dist/cursor-local-install-LL367GZY.js +94 -0
- package/dist/cursor-local-install-LL367GZY.js.map +1 -0
- package/dist/{doctor-N7ZULPOL.js → doctor-QSGETVDE.js} +14 -17
- package/dist/doctor-QSGETVDE.js.map +1 -0
- package/dist/{environment-OBB3WU5B.js → environment-2JS4RWQA.js} +42 -50
- package/dist/environment-2JS4RWQA.js.map +1 -0
- package/dist/{github-PBYBGOLH.js → github-JXSTHLY2.js} +9 -10
- package/dist/{github-PBYBGOLH.js.map → github-JXSTHLY2.js.map} +1 -1
- package/dist/{harness-7KYATIV6.js → harness-GBI3AMLH.js} +25 -31
- package/dist/{harness-7KYATIV6.js.map → harness-GBI3AMLH.js.map} +1 -1
- package/dist/{help-EE3AJQD4.js → help-EC52ERIE.js} +15 -20
- package/dist/{help-EE3AJQD4.js.map → help-EC52ERIE.js.map} +1 -1
- package/dist/{help-VXWKLQ6A.js → help-VIRMBOPJ.js} +57 -575
- package/dist/help-VIRMBOPJ.js.map +1 -0
- package/dist/host-plugin-view-kept-XKHD6NGU.js +139 -0
- package/dist/host-plugin-view-kept-XKHD6NGU.js.map +1 -0
- package/dist/index.js +12 -16
- package/dist/{init-LBTMPDVJ.js → init-OK3K6ILG.js} +33 -41
- package/dist/{init-LBTMPDVJ.js.map → init-OK3K6ILG.js.map} +1 -1
- package/dist/live-read-cache-ESQQJBNS.js +13 -0
- package/dist/live-read-cache-WPUFHVMZ.js +12 -0
- package/dist/{lock-WLJRXRVK.js → lock-AA2F4I3K.js} +9 -12
- package/dist/{lock-WLJRXRVK.js.map → lock-AA2F4I3K.js.map} +1 -1
- package/dist/{marketplace-GXSV6QIY.js → marketplace-QUYCV23F.js} +26 -79
- package/dist/marketplace-QUYCV23F.js.map +1 -0
- package/dist/{mcp-XPDWWU75.js → mcp-CIHSR4DD.js} +33 -37
- package/dist/{mcp-XPDWWU75.js.map → mcp-CIHSR4DD.js.map} +1 -1
- package/dist/{migrate-SBUIWN3U.js → migrate-TQPEZYS5.js} +93 -34
- package/dist/migrate-TQPEZYS5.js.map +1 -0
- package/dist/notifications-TAELTPDW.js +154 -0
- package/dist/notifications-TAELTPDW.js.map +1 -0
- package/dist/open-D3GWGDSQ.js +20 -0
- package/dist/{pack-A73LDVOX.js → pack-VUO4UBWL.js} +10 -14
- package/dist/{pack-A73LDVOX.js.map → pack-VUO4UBWL.js.map} +1 -1
- package/dist/plugin-L3466DHK.js +47 -0
- package/dist/plugin-from-project-U5UGKTJH.js +15 -0
- package/dist/{policy-6VY3CMSU.js → policy-Z5TL4N3V.js} +9 -12
- package/dist/{policy-6VY3CMSU.js.map → policy-Z5TL4N3V.js.map} +1 -1
- package/dist/{profile-YCKPMRRU.js → profile-QFI7SL3S.js} +108 -78
- package/dist/profile-QFI7SL3S.js.map +1 -0
- package/dist/{project-KHPPBKPN.js → project-3KR3EPYR.js} +486 -60
- package/dist/project-3KR3EPYR.js.map +1 -0
- package/dist/{resource-IJU3FAN5.js → resource-45BPRQ7V.js} +55 -45
- package/dist/resource-45BPRQ7V.js.map +1 -0
- package/dist/status-refresh-worker.js +1155 -0
- package/dist/status-refresh-worker.js.map +1 -0
- package/dist/{version-Z66FWWMQ.js → version-QUJZGTZ5.js} +3 -3
- package/dist/version-QUJZGTZ5.js.map +1 -0
- package/package.json +16 -11
- package/dist/apply-SUNDXRJ3.js +0 -54
- package/dist/chunk-2A36HWDE.js.map +0 -1
- package/dist/chunk-2H7UOFLK.js +0 -11
- package/dist/chunk-3FS775NP.js.map +0 -1
- package/dist/chunk-43BDGVN3.js.map +0 -1
- package/dist/chunk-4ZQ2SCGY.js.map +0 -1
- package/dist/chunk-6LTLYV5D.js.map +0 -1
- package/dist/chunk-D432JAXV.js.map +0 -1
- package/dist/chunk-DF4Z7LAD.js +0 -3463
- package/dist/chunk-DF4Z7LAD.js.map +0 -1
- package/dist/chunk-EOPFER6N.js.map +0 -1
- package/dist/chunk-G6WKY2W4.js +0 -389
- package/dist/chunk-G6WKY2W4.js.map +0 -1
- package/dist/chunk-IE7B6Q5K.js.map +0 -1
- package/dist/chunk-IMROMZ2K.js.map +0 -1
- package/dist/chunk-M2U3J7UX.js +0 -46
- package/dist/chunk-M2U3J7UX.js.map +0 -1
- package/dist/chunk-N3ZCH64F.js.map +0 -1
- package/dist/chunk-NAGAJ5UM.js +0 -145
- package/dist/chunk-NAGAJ5UM.js.map +0 -1
- package/dist/chunk-OML4HXKT.js.map +0 -1
- package/dist/chunk-QA5U36JN.js.map +0 -1
- package/dist/chunk-R7ZOYVN3.js.map +0 -1
- package/dist/chunk-RDG5DT7S.js.map +0 -1
- package/dist/chunk-REHRUNBB.js.map +0 -1
- package/dist/chunk-RFQ3N7FB.js.map +0 -1
- package/dist/chunk-TQ2NA4Z4.js.map +0 -1
- package/dist/chunk-ULCD6DJE.js.map +0 -1
- package/dist/chunk-WG5A6EAU.js.map +0 -1
- package/dist/chunk-XGTTOO4R.js +0 -84
- package/dist/chunk-XGTTOO4R.js.map +0 -1
- package/dist/chunk-XTVGCVU4.js.map +0 -1
- package/dist/chunk-XUJKZQZA.js +0 -235
- package/dist/chunk-XUJKZQZA.js.map +0 -1
- package/dist/chunk-ZUASVASP.js.map +0 -1
- package/dist/doctor-N7ZULPOL.js.map +0 -1
- package/dist/environment-OBB3WU5B.js.map +0 -1
- package/dist/help-VXWKLQ6A.js.map +0 -1
- package/dist/live-read-cache-TUSP7U3D.js +0 -10
- package/dist/marketplace-GXSV6QIY.js.map +0 -1
- package/dist/migrate-SBUIWN3U.js.map +0 -1
- package/dist/open-HDGLYYVU.js +0 -24
- package/dist/plugin-CEO6ZJM5.js +0 -51
- package/dist/plugin-from-project-UK7VJVUP.js +0 -18
- package/dist/profile-YCKPMRRU.js.map +0 -1
- package/dist/project-KHPPBKPN.js.map +0 -1
- package/dist/resource-IJU3FAN5.js.map +0 -1
- /package/dist/{apply-SUNDXRJ3.js.map → apply-FTAIL3X3.js.map} +0 -0
- /package/dist/{chunk-GRASK6M6.js.map → chunk-6FXJIKEG.js.map} +0 -0
- /package/dist/{chunk-73OJQTBW.js.map → chunk-A3TZT4WT.js.map} +0 -0
- /package/dist/{chunk-U6DXASQP.js.map → chunk-CBSDMRMY.js.map} +0 -0
- /package/dist/{chunk-P2C7JPLD.js.map → chunk-EPXAOEBB.js.map} +0 -0
- /package/dist/{chunk-3P6BWL5F.js.map → chunk-K4UDZUJ2.js.map} +0 -0
- /package/dist/{chunk-PNGF5EV2.js.map → chunk-MHLAIGIM.js.map} +0 -0
- /package/dist/{chunk-BPWFQKI5.js.map → chunk-MHMFF6A5.js.map} +0 -0
- /package/dist/{chunk-2H7UOFLK.js.map → chunk-MKLJBW5N.js.map} +0 -0
- /package/dist/{chunk-23XSG7LI.js.map → chunk-QGTDQNVV.js.map} +0 -0
- /package/dist/{chunk-UVVZHWD2.js.map → chunk-R27VZIF6.js.map} +0 -0
- /package/dist/{chunk-JQOKQKQT.js.map → chunk-S2D5PWAO.js.map} +0 -0
- /package/dist/{chunk-7HP6AAI3.js.map → chunk-UK2IV2ZQ.js.map} +0 -0
- /package/dist/{live-read-cache-TUSP7U3D.js.map → live-read-cache-ESQQJBNS.js.map} +0 -0
- /package/dist/{open-HDGLYYVU.js.map → live-read-cache-WPUFHVMZ.js.map} +0 -0
- /package/dist/{plugin-CEO6ZJM5.js.map → open-D3GWGDSQ.js.map} +0 -0
- /package/dist/{plugin-from-project-UK7VJVUP.js.map → plugin-L3466DHK.js.map} +0 -0
- /package/dist/{version-Z66FWWMQ.js.map → plugin-from-project-U5UGKTJH.js.map} +0 -0
|
@@ -1,59 +1,83 @@
|
|
|
1
1
|
import {
|
|
2
2
|
handleUseCommand
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-M6FEDSHY.js";
|
|
4
4
|
import {
|
|
5
5
|
makeIdColumn
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-CBSDMRMY.js";
|
|
7
7
|
import {
|
|
8
8
|
resolveUserPath
|
|
9
|
-
} from "./chunk-
|
|
10
|
-
import "./chunk-
|
|
11
|
-
import "./chunk-
|
|
9
|
+
} from "./chunk-D7R577XZ.js";
|
|
10
|
+
import "./chunk-R6VFJKZB.js";
|
|
11
|
+
import "./chunk-UK2IV2ZQ.js";
|
|
12
12
|
import "./chunk-VZQG2JDV.js";
|
|
13
|
-
import {
|
|
14
|
-
promptForChoice
|
|
15
|
-
} from "./chunk-NAGAJ5UM.js";
|
|
16
13
|
import {
|
|
17
14
|
initializeSchema
|
|
18
|
-
} from "./chunk-
|
|
15
|
+
} from "./chunk-RQLVXJH2.js";
|
|
19
16
|
import "./chunk-I6XFZLTJ.js";
|
|
20
17
|
import {
|
|
21
18
|
parseOutputFormat,
|
|
22
19
|
printJson
|
|
23
|
-
} from "./chunk-
|
|
20
|
+
} from "./chunk-R4NV3Q7G.js";
|
|
24
21
|
import {
|
|
25
22
|
ON_CONFLICT_APPLY_HELP,
|
|
26
23
|
fail,
|
|
27
24
|
formatCommand,
|
|
28
25
|
reportNoGitOrigin
|
|
29
|
-
} from "./chunk-
|
|
26
|
+
} from "./chunk-WGVU3LA5.js";
|
|
30
27
|
import {
|
|
31
28
|
applyImportedSnapshotToGlobal,
|
|
32
29
|
applyScanConflicts,
|
|
30
|
+
asRestoreFile,
|
|
33
31
|
backupAndRewriteFile,
|
|
34
32
|
buildProjectStatusPayload,
|
|
35
33
|
captureManagedSnapshotState,
|
|
36
34
|
classifyManagedPathOwnership,
|
|
35
|
+
createSnapshot,
|
|
37
36
|
detectPlatforms,
|
|
37
|
+
detectProjectDriftFromLatest,
|
|
38
38
|
dropHarnessSkillsDuplicatingPluginSource,
|
|
39
39
|
executeSafeFileRemovals,
|
|
40
|
+
findSnapshotById,
|
|
40
41
|
flattenLiveRestoreFiles,
|
|
41
42
|
formatDriftStatusLabel,
|
|
42
43
|
formatResourceTypeSummary,
|
|
44
|
+
formatUpdatesLine,
|
|
43
45
|
generateFiles,
|
|
46
|
+
getGitOrigin,
|
|
47
|
+
getGlobalApplySnapshot,
|
|
44
48
|
getHarnessPreference,
|
|
49
|
+
getProject,
|
|
50
|
+
getProjectByOrigin,
|
|
45
51
|
getProjectHarnessConfig,
|
|
52
|
+
hasClaudeWrittenRecordShape,
|
|
46
53
|
hasPluginSourceLayout,
|
|
47
54
|
hasSharedProjectResourceFiles,
|
|
55
|
+
hashFileOrLink,
|
|
48
56
|
hashGeneratedContent,
|
|
49
57
|
hashOnDiskFile,
|
|
58
|
+
isClaudeSettingsPath2 as isClaudeSettingsPath,
|
|
59
|
+
isHostPluginViewBackupId,
|
|
50
60
|
isPluginSourcePath,
|
|
61
|
+
isSharedMergedConfigPath,
|
|
62
|
+
listGlobalApplySnapshots,
|
|
51
63
|
listImportedSnapshots,
|
|
64
|
+
listSnapshots,
|
|
52
65
|
mainScanLacksPluginSkills,
|
|
53
66
|
materializeFiles,
|
|
54
67
|
mergeReferenceResourceInputs,
|
|
68
|
+
normalizeGitUrl,
|
|
55
69
|
persistMergedProjectScan,
|
|
70
|
+
projectNameFromUrl,
|
|
71
|
+
reconcileMarketplacePluginTrees,
|
|
56
72
|
resolveScanGlobalHarnessTargets,
|
|
73
|
+
restoreBlockedGroupMessage,
|
|
74
|
+
restoreBlockedMessage,
|
|
75
|
+
restoreBlocker,
|
|
76
|
+
restoreForgottenEnabledKeys,
|
|
77
|
+
restoreForgottenSettingsMarketplaces,
|
|
78
|
+
restoreHostPluginViewBackup,
|
|
79
|
+
restoreRemovedHostPluginViews,
|
|
80
|
+
restoreRemovedOwnership,
|
|
57
81
|
restoreSafeRemovalBackup,
|
|
58
82
|
scanAndPersistPluginSource,
|
|
59
83
|
scanPlatform,
|
|
@@ -61,54 +85,243 @@ import {
|
|
|
61
85
|
scanPluginSourceForMerge,
|
|
62
86
|
scanProjectWithPluginSource,
|
|
63
87
|
setProjectHarnessConfig,
|
|
88
|
+
shortenHomePath,
|
|
64
89
|
snapshotAbsentPaths,
|
|
90
|
+
snapshotLinks,
|
|
65
91
|
uniqueHarnessTargets,
|
|
92
|
+
upsertProject,
|
|
66
93
|
writeFiles
|
|
67
|
-
} from "./chunk-
|
|
68
|
-
import
|
|
69
|
-
|
|
70
|
-
|
|
94
|
+
} from "./chunk-BUA7WFI4.js";
|
|
95
|
+
import {
|
|
96
|
+
promptForChoice,
|
|
97
|
+
resolveHomeRoot
|
|
98
|
+
} from "./chunk-UC27MQ3T.js";
|
|
99
|
+
import "./chunk-V4UNYSZO.js";
|
|
100
|
+
import "./chunk-CWXCZBJR.js";
|
|
101
|
+
import "./chunk-A3TZT4WT.js";
|
|
71
102
|
import {
|
|
103
|
+
CLI_COPY,
|
|
72
104
|
createProgress,
|
|
105
|
+
formatCount,
|
|
73
106
|
formatRelativeTime,
|
|
107
|
+
getDb,
|
|
74
108
|
kvBlock,
|
|
75
109
|
panel,
|
|
110
|
+
restoredRemovedLine,
|
|
76
111
|
status,
|
|
77
112
|
subheader,
|
|
78
113
|
table,
|
|
79
114
|
theme,
|
|
80
115
|
ui
|
|
81
|
-
} from "./chunk-
|
|
82
|
-
import {
|
|
83
|
-
createSnapshot,
|
|
84
|
-
detectProjectDriftFromLatest,
|
|
85
|
-
findSnapshotById,
|
|
86
|
-
getGitOrigin,
|
|
87
|
-
getGlobalApplySnapshot,
|
|
88
|
-
getProject,
|
|
89
|
-
getProjectByOrigin,
|
|
90
|
-
listGlobalApplySnapshots,
|
|
91
|
-
listSnapshots,
|
|
92
|
-
normalizeGitUrl,
|
|
93
|
-
projectNameFromUrl,
|
|
94
|
-
resolveHomeRoot,
|
|
95
|
-
upsertProject
|
|
96
|
-
} from "./chunk-DF4Z7LAD.js";
|
|
97
|
-
import "./chunk-G6WKY2W4.js";
|
|
98
|
-
import "./chunk-73OJQTBW.js";
|
|
99
|
-
import {
|
|
100
|
-
CLI_COPY,
|
|
101
|
-
formatCount,
|
|
102
|
-
getDb,
|
|
103
|
-
restoredRemovedLine
|
|
104
|
-
} from "./chunk-WG5A6EAU.js";
|
|
116
|
+
} from "./chunk-OHZNDV4A.js";
|
|
105
117
|
|
|
106
118
|
// src/cli/commands/project.ts
|
|
107
119
|
import { resolve as resolve2 } from "path";
|
|
108
120
|
|
|
109
121
|
// src/services/snapshot-revert.ts
|
|
110
|
-
import { existsSync, readFileSync } from "fs";
|
|
111
|
-
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
|
|
112
325
|
var PREFIX_MIN = 8;
|
|
113
326
|
function parseStoredState(raw) {
|
|
114
327
|
if (typeof raw !== "object" || raw === null) {
|
|
@@ -124,7 +337,7 @@ function capturedStateUseful(state) {
|
|
|
124
337
|
if (!state) {
|
|
125
338
|
return false;
|
|
126
339
|
}
|
|
127
|
-
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;
|
|
128
341
|
}
|
|
129
342
|
function findGlobalByPrefix(prefix) {
|
|
130
343
|
const matches = listGlobalApplySnapshots().filter((row) => row.id.startsWith(prefix));
|
|
@@ -148,6 +361,7 @@ function resolveRevertPlan(snapshotId) {
|
|
|
148
361
|
label: projectSnap.label,
|
|
149
362
|
createdAt: projectSnap.created_at,
|
|
150
363
|
restoreFiles: flattenLiveRestoreFiles(projectSnap.state),
|
|
364
|
+
restoreLinks: snapshotLinks(projectSnap.state),
|
|
151
365
|
absentPaths: snapshotAbsentPaths(projectSnap.state),
|
|
152
366
|
hasCapturedState: capturedStateUseful(projectSnap.state)
|
|
153
367
|
};
|
|
@@ -163,18 +377,29 @@ function resolveRevertPlan(snapshotId) {
|
|
|
163
377
|
rootPath: resolveHomeRoot(),
|
|
164
378
|
label: globalSnap.profile_name,
|
|
165
379
|
createdAt: globalSnap.created_at,
|
|
166
|
-
restoreFiles: state ? flattenLiveRestoreFiles(state) : [],
|
|
380
|
+
restoreFiles: state ? flattenLiveRestoreFiles(state, globalSnap.id) : [],
|
|
381
|
+
restoreLinks: state ? snapshotLinks(state) : [],
|
|
167
382
|
absentPaths: state ? snapshotAbsentPaths(state) : [],
|
|
168
383
|
hasCapturedState: capturedStateUseful(state)
|
|
169
384
|
};
|
|
170
385
|
}
|
|
386
|
+
function readLive(rootPath, path) {
|
|
387
|
+
try {
|
|
388
|
+
return readFileSync(resolve(rootPath, path), "utf-8");
|
|
389
|
+
} catch {
|
|
390
|
+
return void 0;
|
|
391
|
+
}
|
|
392
|
+
}
|
|
171
393
|
function shouldRestorePath(rootPath, file) {
|
|
172
394
|
const fullPath = resolve(rootPath, file.path);
|
|
395
|
+
if (restoreBlocker(rootPath, file.path) !== void 0) {
|
|
396
|
+
return "skip-blocked";
|
|
397
|
+
}
|
|
173
398
|
if (!existsSync(fullPath)) {
|
|
174
399
|
return "write";
|
|
175
400
|
}
|
|
176
|
-
const
|
|
177
|
-
if (
|
|
401
|
+
const wanted = file.bytes;
|
|
402
|
+
if (readFileSync(fullPath).equals(wanted)) {
|
|
178
403
|
return "unchanged";
|
|
179
404
|
}
|
|
180
405
|
const ownership = classifyManagedPathOwnership(rootPath, file.path);
|
|
@@ -184,11 +409,35 @@ function shouldRestorePath(rootPath, file) {
|
|
|
184
409
|
if (ownership === "owned") {
|
|
185
410
|
return "write";
|
|
186
411
|
}
|
|
187
|
-
if (hashOnDiskFile(fullPath) === hashGeneratedContent(
|
|
412
|
+
if (hashOnDiskFile(fullPath) === hashGeneratedContent(wanted.toString("utf-8"))) {
|
|
188
413
|
return "unchanged";
|
|
189
414
|
}
|
|
190
415
|
return "skip-modified";
|
|
191
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
|
+
}
|
|
192
441
|
function executeRevert(plan, options = {}) {
|
|
193
442
|
const restored = [];
|
|
194
443
|
const skipped = [];
|
|
@@ -196,13 +445,72 @@ function executeRevert(plan, options = {}) {
|
|
|
196
445
|
restored.push(
|
|
197
446
|
...restoreSafeRemovalBackup({
|
|
198
447
|
snapshotId: plan.id,
|
|
199
|
-
rootPath: plan.rootPath
|
|
448
|
+
rootPath: plan.rootPath,
|
|
449
|
+
onSkip: (skip) => skipped.push(skip)
|
|
200
450
|
})
|
|
201
451
|
);
|
|
202
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;
|
|
203
498
|
const toWrite = [];
|
|
204
|
-
for (const file of
|
|
205
|
-
|
|
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
|
+
}
|
|
206
514
|
switch (decision) {
|
|
207
515
|
case "write":
|
|
208
516
|
toWrite.push(file);
|
|
@@ -211,13 +519,31 @@ function executeRevert(plan, options = {}) {
|
|
|
211
519
|
case "unchanged":
|
|
212
520
|
restored.push(file.path);
|
|
213
521
|
break;
|
|
214
|
-
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
|
+
}
|
|
215
530
|
skipped.push({
|
|
216
531
|
path: file.path,
|
|
217
532
|
reason: "modified",
|
|
218
533
|
message: `Skipped restoring ${file.path} (modified since HarnessTap wrote it).`
|
|
219
534
|
});
|
|
220
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
|
+
}
|
|
221
547
|
case "skip-unmanaged":
|
|
222
548
|
skipped.push({
|
|
223
549
|
path: file.path,
|
|
@@ -231,12 +557,28 @@ function executeRevert(plan, options = {}) {
|
|
|
231
557
|
}
|
|
232
558
|
}
|
|
233
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
|
+
}
|
|
234
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
|
+
}
|
|
235
576
|
for (const file of toWrite) {
|
|
236
577
|
backupAndRewriteFile({
|
|
237
578
|
rootPath: plan.rootPath,
|
|
238
579
|
relativePath: file.path,
|
|
239
|
-
nextContent: file.
|
|
580
|
+
nextContent: file.bytes,
|
|
581
|
+
mode: file.mode,
|
|
240
582
|
applyId: options.applyId ?? plan.id,
|
|
241
583
|
snapshotId: plan.id
|
|
242
584
|
});
|
|
@@ -248,8 +590,29 @@ function executeRevert(plan, options = {}) {
|
|
|
248
590
|
applyId: options.applyId ?? plan.id,
|
|
249
591
|
snapshotId: plan.id
|
|
250
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);
|
|
251
614
|
const warnings = [
|
|
252
|
-
...skipped
|
|
615
|
+
...skippedWarnings(skipped),
|
|
253
616
|
...removal.warnings
|
|
254
617
|
];
|
|
255
618
|
return {
|
|
@@ -261,8 +624,8 @@ function executeRevert(plan, options = {}) {
|
|
|
261
624
|
}
|
|
262
625
|
|
|
263
626
|
// src/services/project-sync.ts
|
|
264
|
-
import { existsSync as existsSync3, mkdirSync, symlinkSync, unlinkSync } from "fs";
|
|
265
|
-
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";
|
|
266
629
|
|
|
267
630
|
// src/services/harness-surface-gaps.ts
|
|
268
631
|
import { existsSync as existsSync2, readdirSync, readFileSync as readFileSync2 } from "fs";
|
|
@@ -393,9 +756,9 @@ function writeAliasFiles(files, projectRoot, strategy, mainFiles) {
|
|
|
393
756
|
let written = 0;
|
|
394
757
|
for (const file of files) {
|
|
395
758
|
const fullPath = join2(projectRoot, file.path);
|
|
396
|
-
const parent =
|
|
759
|
+
const parent = dirname2(fullPath);
|
|
397
760
|
if (!existsSync3(parent)) {
|
|
398
|
-
|
|
761
|
+
mkdirSync2(parent, { recursive: true });
|
|
399
762
|
}
|
|
400
763
|
const mainPathForContent = mainByContent.get(file.content);
|
|
401
764
|
const useSymlink = strategy === "symlink-preferred" && mainPathForContent !== void 0 && mainPathForContent !== file.path;
|
|
@@ -407,8 +770,8 @@ function writeAliasFiles(files, projectRoot, strategy, mainFiles) {
|
|
|
407
770
|
} catch {
|
|
408
771
|
}
|
|
409
772
|
}
|
|
410
|
-
const relTarget = relative(
|
|
411
|
-
|
|
773
|
+
const relTarget = relative(dirname2(fullPath), target);
|
|
774
|
+
symlinkSync2(relTarget, fullPath);
|
|
412
775
|
written++;
|
|
413
776
|
continue;
|
|
414
777
|
}
|
|
@@ -685,6 +1048,10 @@ function renderProjectStatusHuman(payload) {
|
|
|
685
1048
|
)
|
|
686
1049
|
]);
|
|
687
1050
|
}
|
|
1051
|
+
const updatesLine = formatUpdatesLine(payload.updates);
|
|
1052
|
+
if (updatesLine) {
|
|
1053
|
+
profileRows.push(["Updates", updatesLine]);
|
|
1054
|
+
}
|
|
688
1055
|
panel({ title: ["PROFILE"], rows: profileRows });
|
|
689
1056
|
subheader("APPLIED PLUGINS");
|
|
690
1057
|
if (payload.applied_plugins.length === 0) {
|
|
@@ -802,6 +1169,7 @@ function projectStatusPayloadToJson(payload) {
|
|
|
802
1169
|
},
|
|
803
1170
|
project_resources: payload.project_resources,
|
|
804
1171
|
...payload.lock ? { lock: payload.lock } : {},
|
|
1172
|
+
updates: payload.updates,
|
|
805
1173
|
...payload.project ? {
|
|
806
1174
|
applied_plugins_count: payload.applied_plugins.length,
|
|
807
1175
|
snapshots: payload.snapshots_count
|
|
@@ -1146,9 +1514,60 @@ function handleHistoryCommand(path, opts) {
|
|
|
1146
1514
|
{ key: "label", header: "LABEL", width: showId ? 36 : 50 }
|
|
1147
1515
|
],
|
|
1148
1516
|
rows,
|
|
1149
|
-
summary:
|
|
1517
|
+
summary: formatCount(rows.length, "snapshot")
|
|
1150
1518
|
});
|
|
1151
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
|
+
}
|
|
1152
1571
|
function handleRevertCommand(snapshotId, opts) {
|
|
1153
1572
|
const db = getDb();
|
|
1154
1573
|
initializeSchema(db);
|
|
@@ -1159,6 +1578,10 @@ function handleRevertCommand(snapshotId, opts) {
|
|
|
1159
1578
|
});
|
|
1160
1579
|
return;
|
|
1161
1580
|
}
|
|
1581
|
+
if (isHostPluginViewBackupId(snapshotId)) {
|
|
1582
|
+
revertHostPluginViewBackup(snapshotId, opts, format);
|
|
1583
|
+
return;
|
|
1584
|
+
}
|
|
1162
1585
|
const plan = resolveRevertPlan(snapshotId);
|
|
1163
1586
|
if ("error" in plan) {
|
|
1164
1587
|
fail(plan.error, {
|
|
@@ -1183,6 +1606,9 @@ function handleRevertCommand(snapshotId, opts) {
|
|
|
1183
1606
|
}
|
|
1184
1607
|
if (opts.dryRun) {
|
|
1185
1608
|
console.log(CLI_COPY.dryRunNothingChanged);
|
|
1609
|
+
for (const warning of result.warnings) {
|
|
1610
|
+
ui.warn(warning);
|
|
1611
|
+
}
|
|
1186
1612
|
console.log(
|
|
1187
1613
|
restoredRemovedLine(result.restored.length, result.removed.length, {
|
|
1188
1614
|
dryRun: true
|
|
@@ -1375,4 +1801,4 @@ export {
|
|
|
1375
1801
|
registerProjectCommandsAfterConfig,
|
|
1376
1802
|
registerProjectCommandsBeforeConfig
|
|
1377
1803
|
};
|
|
1378
|
-
//# sourceMappingURL=project-
|
|
1804
|
+
//# sourceMappingURL=project-3KR3EPYR.js.map
|