harnesstap 1.3.1 → 1.4.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 (217) hide show
  1. package/README.md +2 -0
  2. package/dist/apply-SUNDXRJ3.js +54 -0
  3. package/dist/{approve-KQNCNH2R.js → approve-FBGYQGWN.js} +14 -15
  4. package/dist/{approve-KQNCNH2R.js.map → approve-FBGYQGWN.js.map} +1 -1
  5. package/dist/{audit-SLYOZCMI.js → audit-VI4QZ6X2.js} +30 -39
  6. package/dist/{audit-SLYOZCMI.js.map → audit-VI4QZ6X2.js.map} +1 -1
  7. package/dist/{auth-3IEVICFT.js → auth-4CQCDS2W.js} +17 -19
  8. package/dist/{auth-3IEVICFT.js.map → auth-4CQCDS2W.js.map} +1 -1
  9. package/dist/bin.js +3 -3
  10. package/dist/{chunk-KDDXZBMC.js → chunk-23XSG7LI.js} +7 -11
  11. package/dist/{chunk-KDDXZBMC.js.map → chunk-23XSG7LI.js.map} +1 -1
  12. package/dist/{chunk-YDD3ES2K.js → chunk-2A36HWDE.js} +63 -13
  13. package/dist/chunk-2A36HWDE.js.map +1 -0
  14. package/dist/{chunk-IK524ZDW.js → chunk-3FS775NP.js} +51 -4
  15. package/dist/chunk-3FS775NP.js.map +1 -0
  16. package/dist/{chunk-IBOABSIA.js → chunk-3P6BWL5F.js} +2 -2
  17. package/dist/{chunk-G26HZZDJ.js → chunk-43BDGVN3.js} +19 -6
  18. package/dist/chunk-43BDGVN3.js.map +1 -0
  19. package/dist/{chunk-TYULB6ZY.js → chunk-4ZQ2SCGY.js} +146 -78
  20. package/dist/chunk-4ZQ2SCGY.js.map +1 -0
  21. package/dist/{chunk-6BY4BV5G.js → chunk-6LTLYV5D.js} +353 -230
  22. package/dist/chunk-6LTLYV5D.js.map +1 -0
  23. package/dist/{chunk-GQKKX7OE.js → chunk-73OJQTBW.js} +6 -2
  24. package/dist/chunk-73OJQTBW.js.map +1 -0
  25. package/dist/{chunk-IRU7NBOT.js → chunk-7HP6AAI3.js} +2 -2
  26. package/dist/{chunk-MWXA4PFE.js → chunk-BPWFQKI5.js} +5 -7
  27. package/dist/{chunk-MWXA4PFE.js.map → chunk-BPWFQKI5.js.map} +1 -1
  28. package/dist/{chunk-3RBYT7QN.js → chunk-D432JAXV.js} +44 -19
  29. package/dist/chunk-D432JAXV.js.map +1 -0
  30. package/dist/chunk-DF4Z7LAD.js +3463 -0
  31. package/dist/chunk-DF4Z7LAD.js.map +1 -0
  32. package/dist/{chunk-J4CKQXQ6.js → chunk-EOPFER6N.js} +71 -318
  33. package/dist/chunk-EOPFER6N.js.map +1 -0
  34. package/dist/chunk-G6WKY2W4.js +389 -0
  35. package/dist/chunk-G6WKY2W4.js.map +1 -0
  36. package/dist/{chunk-JKGSJGCC.js → chunk-GRASK6M6.js} +5 -5
  37. package/dist/{chunk-63U7QWNY.js → chunk-IE7B6Q5K.js} +33 -39
  38. package/dist/chunk-IE7B6Q5K.js.map +1 -0
  39. package/dist/{chunk-VC6OKCJF.js → chunk-IMROMZ2K.js} +7 -4
  40. package/dist/{chunk-VC6OKCJF.js.map → chunk-IMROMZ2K.js.map} +1 -1
  41. package/dist/{chunk-DV74UZJI.js → chunk-L6YZE5MY.js} +3 -3
  42. package/dist/{chunk-SNVAMWB7.js → chunk-M2U3J7UX.js} +7 -1
  43. package/dist/chunk-M2U3J7UX.js.map +1 -0
  44. package/dist/{chunk-BSOBXLYI.js → chunk-M4KLHJ6U.js} +16 -13
  45. package/dist/chunk-M4KLHJ6U.js.map +1 -0
  46. package/dist/{chunk-VL7BGD47.js → chunk-MR7IOHSX.js} +16 -19
  47. package/dist/chunk-MR7IOHSX.js.map +1 -0
  48. package/dist/{chunk-4KNQZDZC.js → chunk-N3VGY3T3.js} +15 -15
  49. package/dist/chunk-N3VGY3T3.js.map +1 -0
  50. package/dist/{chunk-ZY2MZ2KQ.js → chunk-N3ZCH64F.js} +496 -10
  51. package/dist/chunk-N3ZCH64F.js.map +1 -0
  52. package/dist/{chunk-H6DVP2SI.js → chunk-OML4HXKT.js} +20 -22
  53. package/dist/chunk-OML4HXKT.js.map +1 -0
  54. package/dist/{chunk-NJ7WRKIQ.js → chunk-P2C7JPLD.js} +3 -3
  55. package/dist/{chunk-LNJ3WZZX.js → chunk-PCMON7Y2.js} +7 -7
  56. package/dist/{chunk-VL2NWCZV.js → chunk-PNGF5EV2.js} +2 -2
  57. package/dist/{chunk-SZNBUIDR.js → chunk-QA5U36JN.js} +199 -215
  58. package/dist/chunk-QA5U36JN.js.map +1 -0
  59. package/dist/{chunk-KDAV2GUT.js → chunk-R7ZOYVN3.js} +241 -126
  60. package/dist/chunk-R7ZOYVN3.js.map +1 -0
  61. package/dist/{chunk-QO4LBDVI.js → chunk-RDG5DT7S.js} +45 -49
  62. package/dist/{chunk-QO4LBDVI.js.map → chunk-RDG5DT7S.js.map} +1 -1
  63. package/dist/{chunk-VQVUJYYY.js → chunk-REHRUNBB.js} +8 -3
  64. package/dist/chunk-REHRUNBB.js.map +1 -0
  65. package/dist/{chunk-DXKAKKLP.js → chunk-RFQ3N7FB.js} +19 -29
  66. package/dist/chunk-RFQ3N7FB.js.map +1 -0
  67. package/dist/{chunk-C4QBVVEH.js → chunk-RVEXPMM3.js} +3 -3
  68. package/dist/{chunk-XFZQVYIN.js → chunk-TPEJFLV7.js} +13 -15
  69. package/dist/{chunk-XFZQVYIN.js.map → chunk-TPEJFLV7.js.map} +1 -1
  70. package/dist/{chunk-7LWH5SWH.js → chunk-U6DXASQP.js} +2 -2
  71. package/dist/{chunk-BIBUCC2E.js → chunk-ULCD6DJE.js} +30 -8
  72. package/dist/chunk-ULCD6DJE.js.map +1 -0
  73. package/dist/{chunk-KMWHZSEG.js → chunk-UVVZHWD2.js} +2 -2
  74. package/dist/{chunk-DWVAR4BP.js → chunk-WG5A6EAU.js} +270 -12
  75. package/dist/chunk-WG5A6EAU.js.map +1 -0
  76. package/dist/{chunk-QRZPQNLX.js → chunk-WGP4GUYZ.js} +10 -10
  77. package/dist/{chunk-F2L4VNQK.js → chunk-XTVGCVU4.js} +124 -83
  78. package/dist/chunk-XTVGCVU4.js.map +1 -0
  79. package/dist/{chunk-EIWXS4RM.js → chunk-XUJKZQZA.js} +8 -8
  80. package/dist/chunk-XUJKZQZA.js.map +1 -0
  81. package/dist/chunk-ZUASVASP.js +30317 -0
  82. package/dist/chunk-ZUASVASP.js.map +1 -0
  83. package/dist/{compile-57EEIUMB.js → compile-GXADKGH5.js} +37 -50
  84. package/dist/{compile-57EEIUMB.js.map → compile-GXADKGH5.js.map} +1 -1
  85. package/dist/{config-4EJ3D7QJ.js → config-JMHNA2U5.js} +22 -35
  86. package/dist/{config-4EJ3D7QJ.js.map → config-JMHNA2U5.js.map} +1 -1
  87. package/dist/cursor-local-install-46RWRBDT.js +98 -0
  88. package/dist/cursor-local-install-46RWRBDT.js.map +1 -0
  89. package/dist/{doctor-EEV6P5CH.js → doctor-N7ZULPOL.js} +18 -19
  90. package/dist/{doctor-EEV6P5CH.js.map → doctor-N7ZULPOL.js.map} +1 -1
  91. package/dist/{environment-WFEG4DAT.js → environment-OBB3WU5B.js} +60 -71
  92. package/dist/{environment-WFEG4DAT.js.map → environment-OBB3WU5B.js.map} +1 -1
  93. package/dist/{github-BSMQD72A.js → github-PBYBGOLH.js} +17 -17
  94. package/dist/{harness-VX3PNVQW.js → harness-7KYATIV6.js} +56 -67
  95. package/dist/{harness-VX3PNVQW.js.map → harness-7KYATIV6.js.map} +1 -1
  96. package/dist/{help-AW2HKX63.js → help-EE3AJQD4.js} +48 -52
  97. package/dist/help-EE3AJQD4.js.map +1 -0
  98. package/dist/{help-BVFOZD7E.js → help-VXWKLQ6A.js} +55 -15
  99. package/dist/help-VXWKLQ6A.js.map +1 -0
  100. package/dist/index.d.ts +7 -0
  101. package/dist/index.js +16 -24
  102. package/dist/{init-SPN2GEZ4.js → init-LBTMPDVJ.js} +43 -56
  103. package/dist/init-LBTMPDVJ.js.map +1 -0
  104. package/dist/live-read-cache-TUSP7U3D.js +10 -0
  105. package/dist/{lock-K2LLUU7H.js → lock-WLJRXRVK.js} +16 -16
  106. package/dist/{marketplace-VEKSWGX3.js → marketplace-GXSV6QIY.js} +62 -28
  107. package/dist/marketplace-GXSV6QIY.js.map +1 -0
  108. package/dist/{mcp-T6DKIKSF.js → mcp-XPDWWU75.js} +35 -48
  109. package/dist/{mcp-T6DKIKSF.js.map → mcp-XPDWWU75.js.map} +1 -1
  110. package/dist/{migrate-OO37WSB2.js → migrate-SBUIWN3U.js} +79 -64
  111. package/dist/migrate-SBUIWN3U.js.map +1 -0
  112. package/dist/open-HDGLYYVU.js +24 -0
  113. package/dist/{pack-V32UPC7W.js → pack-A73LDVOX.js} +16 -22
  114. package/dist/{pack-V32UPC7W.js.map → pack-A73LDVOX.js.map} +1 -1
  115. package/dist/plugin-CEO6ZJM5.js +51 -0
  116. package/dist/plugin-from-project-UK7VJVUP.js +18 -0
  117. package/dist/{policy-F5MKZNOC.js → policy-6VY3CMSU.js} +13 -14
  118. package/dist/{policy-F5MKZNOC.js.map → policy-6VY3CMSU.js.map} +1 -1
  119. package/dist/{profile-H4PMH4XT.js → profile-YCKPMRRU.js} +96 -102
  120. package/dist/profile-YCKPMRRU.js.map +1 -0
  121. package/dist/{project-QVNEJJGH.js → project-KHPPBKPN.js} +63 -77
  122. package/dist/{project-QVNEJJGH.js.map → project-KHPPBKPN.js.map} +1 -1
  123. package/dist/{resource-GL4RLSGI.js → resource-IJU3FAN5.js} +42 -49
  124. package/dist/{resource-GL4RLSGI.js.map → resource-IJU3FAN5.js.map} +1 -1
  125. package/dist/{version-PBHZK44K.js → version-Z66FWWMQ.js} +2 -2
  126. package/dist/version-Z66FWWMQ.js.map +1 -0
  127. package/package.json +4 -1
  128. package/schemas/fixtures/confidence.ap.json +1 -1
  129. package/schemas/fixtures/context7.ap.json +1 -1
  130. package/schemas/fixtures/legacy-schema-v1.ap.json +13 -0
  131. package/schemas/fixtures/legacy-schemas-v1.ap.json +13 -0
  132. package/schemas/fixtures/minimal-with-schema.ap.json +1 -1
  133. package/schemas/fixtures/superpowers.ap.json +1 -1
  134. package/schemas/fixtures/third-party-skills.ap.json +1 -1
  135. package/dist/apply-2GRNKR5H.js +0 -67
  136. package/dist/chunk-2EIJYDNI.js +0 -10945
  137. package/dist/chunk-2EIJYDNI.js.map +0 -1
  138. package/dist/chunk-3IWTJCPA.js +0 -6448
  139. package/dist/chunk-3IWTJCPA.js.map +0 -1
  140. package/dist/chunk-3IZ7SEGT.js +0 -346
  141. package/dist/chunk-3IZ7SEGT.js.map +0 -1
  142. package/dist/chunk-3RBYT7QN.js.map +0 -1
  143. package/dist/chunk-4KNQZDZC.js.map +0 -1
  144. package/dist/chunk-63U7QWNY.js.map +0 -1
  145. package/dist/chunk-6BY4BV5G.js.map +0 -1
  146. package/dist/chunk-7L2K4N25.js +0 -610
  147. package/dist/chunk-7L2K4N25.js.map +0 -1
  148. package/dist/chunk-BIBUCC2E.js.map +0 -1
  149. package/dist/chunk-BSOBXLYI.js.map +0 -1
  150. package/dist/chunk-DWVAR4BP.js.map +0 -1
  151. package/dist/chunk-DXKAKKLP.js.map +0 -1
  152. package/dist/chunk-EIWXS4RM.js.map +0 -1
  153. package/dist/chunk-EWBCFAF3.js +0 -681
  154. package/dist/chunk-EWBCFAF3.js.map +0 -1
  155. package/dist/chunk-F2L4VNQK.js.map +0 -1
  156. package/dist/chunk-G26HZZDJ.js.map +0 -1
  157. package/dist/chunk-GQKKX7OE.js.map +0 -1
  158. package/dist/chunk-GRJY22U6.js +0 -691
  159. package/dist/chunk-GRJY22U6.js.map +0 -1
  160. package/dist/chunk-H6DVP2SI.js.map +0 -1
  161. package/dist/chunk-HVVPTCKR.js +0 -1173
  162. package/dist/chunk-HVVPTCKR.js.map +0 -1
  163. package/dist/chunk-IK524ZDW.js.map +0 -1
  164. package/dist/chunk-J4CKQXQ6.js.map +0 -1
  165. package/dist/chunk-JRFUTIEH.js +0 -426
  166. package/dist/chunk-JRFUTIEH.js.map +0 -1
  167. package/dist/chunk-K2BPYEH5.js +0 -491
  168. package/dist/chunk-K2BPYEH5.js.map +0 -1
  169. package/dist/chunk-KCQC7YBK.js +0 -7795
  170. package/dist/chunk-KCQC7YBK.js.map +0 -1
  171. package/dist/chunk-KDAV2GUT.js.map +0 -1
  172. package/dist/chunk-MY62SSKC.js +0 -183
  173. package/dist/chunk-MY62SSKC.js.map +0 -1
  174. package/dist/chunk-PXU2OS26.js +0 -238
  175. package/dist/chunk-PXU2OS26.js.map +0 -1
  176. package/dist/chunk-SNVAMWB7.js.map +0 -1
  177. package/dist/chunk-SPRVUATR.js +0 -430
  178. package/dist/chunk-SPRVUATR.js.map +0 -1
  179. package/dist/chunk-SY7G5QEI.js +0 -35
  180. package/dist/chunk-SY7G5QEI.js.map +0 -1
  181. package/dist/chunk-SZNBUIDR.js.map +0 -1
  182. package/dist/chunk-TYULB6ZY.js.map +0 -1
  183. package/dist/chunk-UJYFTXHV.js +0 -296
  184. package/dist/chunk-UJYFTXHV.js.map +0 -1
  185. package/dist/chunk-VL7BGD47.js.map +0 -1
  186. package/dist/chunk-VQVUJYYY.js.map +0 -1
  187. package/dist/chunk-XQFT4PEP.js +0 -60
  188. package/dist/chunk-XQFT4PEP.js.map +0 -1
  189. package/dist/chunk-YDD3ES2K.js.map +0 -1
  190. package/dist/chunk-ZY2MZ2KQ.js.map +0 -1
  191. package/dist/help-AW2HKX63.js.map +0 -1
  192. package/dist/help-BVFOZD7E.js.map +0 -1
  193. package/dist/init-SPN2GEZ4.js.map +0 -1
  194. package/dist/marketplace-VEKSWGX3.js.map +0 -1
  195. package/dist/migrate-OO37WSB2.js.map +0 -1
  196. package/dist/open-3V3QK5RK.js +0 -32
  197. package/dist/plugin-KOBNQ7GT.js +0 -64
  198. package/dist/plugin-from-project-X3VO3MB6.js +0 -16
  199. package/dist/profile-H4PMH4XT.js.map +0 -1
  200. /package/dist/{apply-2GRNKR5H.js.map → apply-SUNDXRJ3.js.map} +0 -0
  201. /package/dist/{chunk-IBOABSIA.js.map → chunk-3P6BWL5F.js.map} +0 -0
  202. /package/dist/{chunk-IRU7NBOT.js.map → chunk-7HP6AAI3.js.map} +0 -0
  203. /package/dist/{chunk-JKGSJGCC.js.map → chunk-GRASK6M6.js.map} +0 -0
  204. /package/dist/{chunk-DV74UZJI.js.map → chunk-L6YZE5MY.js.map} +0 -0
  205. /package/dist/{chunk-NJ7WRKIQ.js.map → chunk-P2C7JPLD.js.map} +0 -0
  206. /package/dist/{chunk-LNJ3WZZX.js.map → chunk-PCMON7Y2.js.map} +0 -0
  207. /package/dist/{chunk-VL2NWCZV.js.map → chunk-PNGF5EV2.js.map} +0 -0
  208. /package/dist/{chunk-C4QBVVEH.js.map → chunk-RVEXPMM3.js.map} +0 -0
  209. /package/dist/{chunk-7LWH5SWH.js.map → chunk-U6DXASQP.js.map} +0 -0
  210. /package/dist/{chunk-KMWHZSEG.js.map → chunk-UVVZHWD2.js.map} +0 -0
  211. /package/dist/{chunk-QRZPQNLX.js.map → chunk-WGP4GUYZ.js.map} +0 -0
  212. /package/dist/{github-BSMQD72A.js.map → github-PBYBGOLH.js.map} +0 -0
  213. /package/dist/{open-3V3QK5RK.js.map → live-read-cache-TUSP7U3D.js.map} +0 -0
  214. /package/dist/{lock-K2LLUU7H.js.map → lock-WLJRXRVK.js.map} +0 -0
  215. /package/dist/{plugin-KOBNQ7GT.js.map → open-HDGLYYVU.js.map} +0 -0
  216. /package/dist/{plugin-from-project-X3VO3MB6.js.map → plugin-CEO6ZJM5.js.map} +0 -0
  217. /package/dist/{version-PBHZK44K.js.map → plugin-from-project-UK7VJVUP.js.map} +0 -0
@@ -1,86 +1,94 @@
1
1
  import {
2
- buildHarnessLiveStatusMap,
3
- classifyGlobalDriftChanges,
4
- collectOwnedGlobalProfileFiles,
5
- computeGlobalProfilePanelStatus,
6
- countMissingHarnessRows,
7
- declaredMcpFromExpectedFiles,
8
- resolveProjectDriftSummary,
2
+ isTransparentCrossHarnessGap,
3
+ resourceScopesForPlugins,
9
4
  withAffectedResources
10
- } from "./chunk-J4CKQXQ6.js";
5
+ } from "./chunk-EOPFER6N.js";
11
6
  import {
12
7
  formatEnvironmentToml,
13
8
  importEnvironmentToml
14
- } from "./chunk-IRU7NBOT.js";
9
+ } from "./chunk-7HP6AAI3.js";
15
10
  import {
16
11
  MISSING_PROJECT_CONFIG_MESSAGE
17
12
  } from "./chunk-VZQG2JDV.js";
18
13
  import {
14
+ promptForChoice,
15
+ promptForConfirmation,
16
+ promptForSearchableChoice,
17
+ shouldUseBrowsePicker,
18
+ shouldUseWizard
19
+ } from "./chunk-NAGAJ5UM.js";
20
+ import {
21
+ ON_CONFLICT_VALUE_HELP,
22
+ parseOnConflict
23
+ } from "./chunk-RFQ3N7FB.js";
24
+ import {
25
+ addResourceToPlugin,
19
26
  applyProfilePlugin,
20
27
  buildContentsFromResources,
21
28
  buildHostManagedStatus,
22
29
  buildProfileContents,
23
30
  captureUntrackedResourcesForStash,
24
- clearActiveProfileName,
25
31
  clearGlobalProfileApply,
26
32
  collectProfilePluginIds,
27
33
  commitManagedPathFromLive,
34
+ createPlugin,
28
35
  detectNotStagedProfileResources,
29
36
  fileContentsEquivalentForDrift,
37
+ findProjectConfig,
30
38
  flattenLiveRestoreFiles,
31
- getActiveProfileName,
32
39
  getGlobalActiveEnvironmentName,
33
- getLatestGlobalApplySnapshotForProfile,
40
+ getProfileEntry,
34
41
  hashOnDiskFile,
35
42
  installPluginFromCatalog,
43
+ isEmptyBuiltinProfile,
44
+ isNativeAgentPluginCachePath,
45
+ isProfilePlugin,
36
46
  listMaterializationsForRootPath,
37
47
  mergePluginsForApply,
48
+ normalizeResourceInput,
38
49
  profileSkillNameMap,
50
+ readDiskTextOnce,
39
51
  removeUntrackedStashFiles,
52
+ resolvePluginSelector,
53
+ resolveProfileEnvironment,
54
+ resourceKeyFromManagedPath,
40
55
  restoreUntrackedStashFiles,
41
56
  stashedFilesToDriftChanges,
57
+ upsertResource,
42
58
  useEnvironmentCommand,
43
59
  useProfileCommand,
44
60
  withProfileApplyLock
45
- } from "./chunk-KCQC7YBK.js";
46
- import {
47
- promptForChoice,
48
- promptForConfirmation,
49
- promptForSearchableChoice,
50
- shouldUseBrowsePicker,
51
- shouldUseWizard
52
- } from "./chunk-NAGAJ5UM.js";
61
+ } from "./chunk-ZUASVASP.js";
53
62
  import {
54
- isEmptyBuiltinProfile,
55
- isProfilePlugin
56
- } from "./chunk-SY7G5QEI.js";
63
+ parsePluginSelector,
64
+ resolveRemotePluginSelector
65
+ } from "./chunk-N3ZCH64F.js";
57
66
  import {
58
- findProjectConfig,
59
- getProfileEntry,
60
- resolveProfileEnvironment
61
- } from "./chunk-3IZ7SEGT.js";
67
+ ui
68
+ } from "./chunk-2A36HWDE.js";
62
69
  import {
63
- addResourceToPlugin,
64
- createPlugin,
65
- normalizeResourceInput,
70
+ buildHarnessLiveStatusMap,
71
+ classifyGlobalDriftChanges,
72
+ clearActiveProfileName,
73
+ collectOwnedGlobalProfileFiles,
74
+ computeGlobalProfilePanelStatus,
75
+ countMissingHarnessRows,
76
+ declaredMcpFromExpectedFiles,
77
+ driftChangeIsKept,
78
+ getActiveProfileName,
79
+ getLatestGlobalApplySnapshotForProfile,
66
80
  resolveHomeRoot,
67
- resolvePluginSelector,
68
- upsertResource
69
- } from "./chunk-2EIJYDNI.js";
70
- import {
71
- ON_CONFLICT_VALUE_HELP,
72
- parseOnConflict
73
- } from "./chunk-DXKAKKLP.js";
74
- import {
75
- ui
76
- } from "./chunk-YDD3ES2K.js";
81
+ resolveProjectDriftSummary,
82
+ withStatusReadCache
83
+ } from "./chunk-DF4Z7LAD.js";
77
84
  import {
78
- parsePluginSelector,
79
- resolveRemotePluginSelector
80
- } from "./chunk-ZY2MZ2KQ.js";
85
+ inStatusComputation,
86
+ runInStatusComputation
87
+ } from "./chunk-G6WKY2W4.js";
81
88
  import {
82
89
  CLI_COPY,
83
90
  SWITCH_CHANGES_VALUES,
91
+ applyCancelledMessage,
84
92
  applyHeaderLine,
85
93
  applyWroteLine,
86
94
  discardConfirm,
@@ -90,12 +98,15 @@ import {
90
98
  getHarnesstapDir,
91
99
  keptFilesHeader,
92
100
  keptReasonLabel,
101
+ onConflictReplaceHint,
93
102
  savedChangesLine,
94
103
  snapshotSavedUndoLine,
95
104
  stashedChangesLine,
105
+ traceCount,
106
+ traceSpan,
96
107
  unsavedChangesFlagHint,
97
108
  unsavedChangesLine
98
- } from "./chunk-DWVAR4BP.js";
109
+ } from "./chunk-WG5A6EAU.js";
99
110
 
100
111
  // src/utils/user-path.ts
101
112
  import { existsSync } from "fs";
@@ -139,6 +150,12 @@ function resolveApplyConflictPolicy(opts) {
139
150
  }
140
151
  return "prompt";
141
152
  }
153
+ function reportApplyCancelled(conflicts, scope = "apply") {
154
+ process.exitCode = 1;
155
+ ui.warn(applyCancelledMessage(conflicts, scope), {
156
+ hint: onConflictReplaceHint(conflicts)
157
+ });
158
+ }
142
159
  async function promptMaterializationConflict(conflict) {
143
160
  const ownerSummary = conflict.owners.length > 0 ? conflict.owners.map((owner) => `${owner.plugin_name}@${owner.plugin_version ?? "?"}`).join(", ") : "another plugin or manual edit";
144
161
  ui.warn(`File already exists: ${conflict.path}`);
@@ -181,10 +198,14 @@ function printApplyPayload(payload) {
181
198
  snapshotId: payload.snapshot_id
182
199
  });
183
200
  }
201
+ const listedKept = kept.length > 0;
184
202
  for (const skipped of payload.skipped_removals ?? []) {
185
203
  if (skipped.reason === "missing") {
186
204
  continue;
187
205
  }
206
+ if (listedKept && removalSkipReason(skipped.reason)) {
207
+ continue;
208
+ }
188
209
  if (skipped.message) {
189
210
  ui.warn(skipped.message);
190
211
  }
@@ -246,7 +267,7 @@ function printApplySuccess(input) {
246
267
  unchanged: input.unchanged
247
268
  })
248
269
  );
249
- if (input.wrote > 0 || input.removed > 0) {
270
+ if (input.kept.length > 0) {
250
271
  printKeptFiles(input.kept);
251
272
  }
252
273
  if (input.snapshotId) {
@@ -266,8 +287,45 @@ function removalSkipReason(reason) {
266
287
  // src/services/global-profile-drift.ts
267
288
  import { existsSync as existsSync2, readFileSync } from "fs";
268
289
  import { join as join2 } from "path";
290
+ var driftCoreComputes = 0;
291
+ function driftCore(fields, harness, homeRoot) {
292
+ const watchedPaths = (fields.expectedApply?.expected_files ?? []).map(
293
+ (file) => join2(homeRoot, file.path)
294
+ );
295
+ return { fields, harness, watchedPaths };
296
+ }
297
+ function keptContentDiff(path, keptModified, keptUnmanaged) {
298
+ if (keptModified.has(path)) {
299
+ return { path, type: "modified", removal_group: "owned_modified" };
300
+ }
301
+ if (keptUnmanaged.has(path)) {
302
+ return { path, type: "modified", removal_group: "unmanaged" };
303
+ }
304
+ return { path, type: "modified" };
305
+ }
306
+ function isMissingExpectedFileTransparent(homeRoot, path, expectedPathsByResource, scopeByResource) {
307
+ const mapped = resourceKeyFromManagedPath(path);
308
+ if (!mapped) {
309
+ return true;
310
+ }
311
+ const key = `${mapped.type}:${mapped.name}`;
312
+ const siblings = expectedPathsByResource.get(key) ?? [];
313
+ const onDiskSiblingPaths = siblings.filter(
314
+ (sibling) => sibling !== path && readGlobalFile(homeRoot, sibling) !== null
315
+ );
316
+ return isTransparentCrossHarnessGap({
317
+ path,
318
+ onDiskSiblingPaths,
319
+ scope: scopeByResource.get(key)
320
+ });
321
+ }
269
322
  function readGlobalFile(homeRoot, relativePath) {
270
323
  const fullPath = join2(homeRoot, relativePath);
324
+ if (!inStatusComputation()) return readGlobalFileUncached(fullPath);
325
+ if (!existsSync2(fullPath)) return null;
326
+ return readDiskTextOnce(fullPath);
327
+ }
328
+ function readGlobalFileUncached(fullPath) {
271
329
  if (!existsSync2(fullPath)) {
272
330
  return null;
273
331
  }
@@ -300,25 +358,29 @@ function declaredMcpNamesFromMergedPlugins(pluginIds) {
300
358
  function buildBaseStatusFields(input) {
301
359
  const asOf = (/* @__PURE__ */ new Date()).toISOString();
302
360
  const homeRoot = resolveHomeRoot();
303
- const ownedFiles = collectOwnedGlobalProfileFiles(input.snapshotId);
304
- const { owned, nonOwned } = classifyGlobalDriftChanges(input.changes, ownedFiles);
305
- const declaredPins = input.pluginIds && input.pluginIds.length > 0 ? mergePluginsForApply(input.pluginIds).pluginPins : [];
361
+ const ownedFiles = traceSpan("db.owned-files", () => collectOwnedGlobalProfileFiles(input.snapshotId));
362
+ const blockingChanges = input.changes.filter((change) => !driftChangeIsKept(change));
363
+ const { owned, nonOwned } = classifyGlobalDriftChanges(blockingChanges, ownedFiles);
364
+ const declaredPins = input.pluginIds && input.pluginIds.length > 0 ? traceSpan("base.merge-plugins", () => mergePluginsForApply(input.pluginIds ?? []).pluginPins) : [];
306
365
  const declaredFromExpected = input.expectedApply ? declaredMcpFromExpectedApply(input.expectedApply) : null;
307
366
  const declaredMcpByHarness = declaredFromExpected?.namesByHarness ?? (input.pluginIds ? declaredMcpNamesFromMergedPlugins(input.pluginIds) : { "claude-code": [], cursor: [] });
308
- const harnesses = buildHarnessLiveStatusMap({
367
+ const harnesses = traceSpan("base.harness-live-status", () => buildHarnessLiveStatusMap({
309
368
  depth: input.depth,
310
369
  homeRoot,
311
370
  declaredPins,
312
371
  declaredMcpByHarness,
313
372
  ...declaredFromExpected ? { expectedMcpConfigsByHarness: declaredFromExpected.configsByHarness } : {}
314
- });
373
+ }));
315
374
  const { missingPlugins, missingMcp } = input.depth === "full" ? countMissingHarnessRows(harnesses) : { missingPlugins: 0, missingMcp: 0 };
316
- const contents = input.activeProfile ? buildProfileContents(input.activeProfile) : null;
317
- const hostManaged = input.depth === "full" ? buildHostManagedStatus({
318
- homeRoot,
319
- profileSkills: profileSkillNameMap(contents?.resources ?? [])
320
- }) : void 0;
321
- const projectDrift = resolveProjectDriftSummary(input.projectPath);
375
+ const contents = input.activeProfile ? traceSpan("base.profile-contents", () => buildProfileContents(input.activeProfile ?? "")) : null;
376
+ const hostManaged = input.depth === "full" ? traceSpan(
377
+ "base.host-managed",
378
+ () => buildHostManagedStatus({
379
+ homeRoot,
380
+ profileSkills: profileSkillNameMap(contents?.resources ?? [])
381
+ })
382
+ ) : void 0;
383
+ const projectDrift = traceSpan("base.project-drift", () => resolveProjectDriftSummary(input.projectPath));
322
384
  const panel = computeGlobalProfilePanelStatus({
323
385
  depth: input.depth,
324
386
  applied: input.applied,
@@ -360,16 +422,19 @@ function buildBaseStatusFields(input) {
360
422
  };
361
423
  }
362
424
  async function finalizeGlobalProfileStatus(fields, harness) {
363
- const status = buildBaseStatusFields(fields);
425
+ const status = traceSpan("base", () => buildBaseStatusFields(fields));
364
426
  if (fields.depth !== "full" || !status.active_profile || isEmptyBuiltinProfile(status.active_profile)) {
365
427
  return status;
366
428
  }
367
429
  try {
368
- const notStaged = await detectNotStagedProfileResources({
369
- profileSelector: status.active_profile,
370
- scope: "home",
371
- ...harness ? { harness } : {}
372
- });
430
+ const notStaged = await traceSpan(
431
+ "not-staged",
432
+ () => detectNotStagedProfileResources({
433
+ profileSelector: status.active_profile ?? "",
434
+ scope: "home",
435
+ ...harness ? { harness } : {}
436
+ })
437
+ );
373
438
  return {
374
439
  ...status,
375
440
  untracked_resource_count: notStaged.length,
@@ -381,11 +446,38 @@ async function finalizeGlobalProfileStatus(fields, harness) {
381
446
  }
382
447
  async function detectGlobalProfileStatus(input = {}) {
383
448
  const depth = input.depth ?? "full";
449
+ const request = {
450
+ depth,
451
+ harness: input.harness,
452
+ projectPath: input.projectPath
453
+ };
454
+ const status = await withStatusReadCache(request, () => runInStatusComputation(async () => {
455
+ const core = await withStatusReadCache(
456
+ { ...request, includeDepth: false },
457
+ async () => {
458
+ const loaded = await loadDriftCore(input);
459
+ return { value: loaded, watchedPaths: loaded.watchedPaths };
460
+ }
461
+ );
462
+ const projected = await finalizeGlobalProfileStatus(
463
+ { ...core.fields, depth },
464
+ core.harness
465
+ );
466
+ return { value: projected, watchedPaths: core.watchedPaths };
467
+ }), { staleWhileRefresh: true });
468
+ return {
469
+ ...status,
470
+ as_of: (/* @__PURE__ */ new Date()).toISOString(),
471
+ refreshing: status.refreshing === true
472
+ };
473
+ }
474
+ async function loadDriftCore(input) {
475
+ driftCoreComputes += 1;
476
+ const homeRoot = resolveHomeRoot();
384
477
  const activeProfile = getActiveProfileName() ?? null;
385
478
  if (!activeProfile) {
386
- return finalizeGlobalProfileStatus(
479
+ return driftCore(
387
480
  {
388
- depth,
389
481
  activeProfile: null,
390
482
  profileExists: false,
391
483
  applied: false,
@@ -396,10 +488,11 @@ async function detectGlobalProfileStatus(input = {}) {
396
488
  changes: [],
397
489
  projectPath: input.projectPath
398
490
  },
399
- input.harness
491
+ input.harness,
492
+ homeRoot
400
493
  );
401
494
  }
402
- const plugin = resolvePluginSelector(activeProfile);
495
+ const plugin = traceSpan("db.resolve-profile", () => resolvePluginSelector(activeProfile));
403
496
  if (!plugin) {
404
497
  if (isEmptyBuiltinProfile(activeProfile)) {
405
498
  const latestSnapshot2 = getLatestGlobalApplySnapshotForProfile(activeProfile);
@@ -412,8 +505,7 @@ async function detectGlobalProfileStatus(input = {}) {
412
505
  pull: false
413
506
  });
414
507
  } catch (error) {
415
- return finalizeGlobalProfileStatus({
416
- depth,
508
+ return driftCore({
417
509
  activeProfile,
418
510
  profileExists: true,
419
511
  applied: Boolean(latestSnapshot2),
@@ -425,13 +517,12 @@ async function detectGlobalProfileStatus(input = {}) {
425
517
  warning: error instanceof Error ? error.message : String(error),
426
518
  projectPath: input.projectPath,
427
519
  pluginIds: []
428
- });
520
+ }, input.harness, homeRoot);
429
521
  }
430
522
  const stackInSync2 = latestSnapshot2 ? pluginIdsMatch(latestSnapshot2.plugin_ids, expectedApply2.configured_plugin_ids) : false;
431
523
  const applied2 = Boolean(latestSnapshot2);
432
524
  const hasDrift2 = !applied2 || !stackInSync2;
433
- return finalizeGlobalProfileStatus({
434
- depth,
525
+ return driftCore({
435
526
  activeProfile,
436
527
  profileExists: true,
437
528
  applied: applied2,
@@ -443,10 +534,9 @@ async function detectGlobalProfileStatus(input = {}) {
443
534
  projectPath: input.projectPath,
444
535
  expectedApply: expectedApply2,
445
536
  pluginIds: []
446
- });
537
+ }, input.harness, homeRoot);
447
538
  }
448
- return finalizeGlobalProfileStatus({
449
- depth,
539
+ return driftCore({
450
540
  activeProfile,
451
541
  profileExists: false,
452
542
  applied: false,
@@ -457,11 +547,10 @@ async function detectGlobalProfileStatus(input = {}) {
457
547
  changes: [],
458
548
  warning: `missing plugin "${activeProfile}"`,
459
549
  projectPath: input.projectPath
460
- });
550
+ }, input.harness, homeRoot);
461
551
  }
462
552
  if (!isProfilePlugin(plugin)) {
463
- return finalizeGlobalProfileStatus({
464
- depth,
553
+ return driftCore({
465
554
  activeProfile,
466
555
  profileExists: true,
467
556
  applied: false,
@@ -472,24 +561,26 @@ async function detectGlobalProfileStatus(input = {}) {
472
561
  changes: [],
473
562
  warning: `plugin "${plugin.name}" is not tagged as a profile`,
474
563
  projectPath: input.projectPath
475
- });
564
+ }, input.harness, homeRoot);
476
565
  }
477
566
  const latestSnapshot = getLatestGlobalApplySnapshotForProfile(activeProfile);
478
- const homeRoot = resolveHomeRoot();
479
567
  const pluginIds = collectProfilePluginIds(plugin);
480
568
  let expectedApply;
481
569
  try {
482
- expectedApply = await applyProfilePlugin(activeProfile, {
483
- dryRun: true,
484
- harness: input.harness,
485
- conflictPolicy: "replace",
486
- pull: false,
487
- pinSkillEmits: false,
488
- mergeLiveSkillMarkdown: false
489
- });
570
+ expectedApply = await traceSpan(
571
+ "dry-run",
572
+ () => applyProfilePlugin(activeProfile, {
573
+ dryRun: true,
574
+ harness: input.harness,
575
+ conflictPolicy: "replace",
576
+ pull: false,
577
+ pinSkillEmits: false,
578
+ mergeLiveSkillMarkdown: false
579
+ })
580
+ );
581
+ traceCount("dry-run", "expected_files", expectedApply.expected_files?.length ?? 0);
490
582
  } catch (error) {
491
- return finalizeGlobalProfileStatus({
492
- depth,
583
+ return driftCore({
493
584
  activeProfile,
494
585
  profileExists: true,
495
586
  applied: Boolean(latestSnapshot),
@@ -501,54 +592,76 @@ async function detectGlobalProfileStatus(input = {}) {
501
592
  warning: error instanceof Error ? error.message : String(error),
502
593
  projectPath: input.projectPath,
503
594
  pluginIds
504
- });
595
+ }, input.harness, homeRoot);
505
596
  }
506
597
  const stackInSync = latestSnapshot ? pluginIdsMatch(latestSnapshot.plugin_ids, expectedApply.configured_plugin_ids) : false;
507
598
  const changes = [];
599
+ const keptModified = new Set(expectedApply.removals?.owned_modified ?? []);
600
+ const keptUnmanaged = new Set(expectedApply.removals?.unmanaged ?? []);
601
+ const scopeByResource = resourceScopesForPlugins(pluginIds);
602
+ const expectedPathsByResource = /* @__PURE__ */ new Map();
508
603
  for (const file of expectedApply.expected_files ?? []) {
509
- const current = readGlobalFile(homeRoot, file.path);
510
- const owned = listMaterializationsForRootPath(homeRoot, file.path);
511
- if (current === null) {
512
- if (owned.length === 0) {
513
- continue;
514
- }
515
- changes.push(
516
- withAffectedResources({ path: file.path, type: "deleted" }, file.content, null)
517
- );
604
+ const mapped = resourceKeyFromManagedPath(file.path);
605
+ if (!mapped) {
518
606
  continue;
519
607
  }
520
- if (owned.length > 0) {
521
- const diskHash = hashOnDiskFile(join2(homeRoot, file.path));
522
- if (owned.some((row) => row.generated_hash === diskHash)) {
608
+ const key = `${mapped.type}:${mapped.name}`;
609
+ const paths = expectedPathsByResource.get(key) ?? [];
610
+ paths.push(file.path);
611
+ expectedPathsByResource.set(key, paths);
612
+ }
613
+ traceSpan("drift.compare-files", () => {
614
+ for (const file of expectedApply.expected_files ?? []) {
615
+ if (isNativeAgentPluginCachePath(file.path)) continue;
616
+ const current = readGlobalFile(homeRoot, file.path);
617
+ const owned = listMaterializationsForRootPath(homeRoot, file.path);
618
+ if (current === null) {
619
+ if (owned.length === 0 && isMissingExpectedFileTransparent(
620
+ homeRoot,
621
+ file.path,
622
+ expectedPathsByResource,
623
+ scopeByResource
624
+ )) {
625
+ continue;
626
+ }
627
+ changes.push(
628
+ withAffectedResources({ path: file.path, type: "deleted" }, file.content, null)
629
+ );
523
630
  continue;
524
631
  }
525
- if (fileContentsEquivalentForDrift(file.path, current, file.content)) {
632
+ if (owned.length > 0) {
633
+ const diskHash = hashOnDiskFile(join2(homeRoot, file.path));
634
+ if (owned.some((row) => row.generated_hash === diskHash)) {
635
+ continue;
636
+ }
637
+ if (fileContentsEquivalentForDrift(file.path, current, file.content)) {
638
+ continue;
639
+ }
640
+ changes.push(
641
+ withAffectedResources(
642
+ keptContentDiff(file.path, keptModified, keptUnmanaged),
643
+ file.content,
644
+ current
645
+ )
646
+ );
526
647
  continue;
527
648
  }
528
- changes.push(
529
- withAffectedResources(
530
- { path: file.path, type: "modified" },
531
- file.content,
532
- current
533
- )
534
- );
535
- continue;
536
- }
537
- if (!fileContentsEquivalentForDrift(file.path, current, file.content)) {
538
- changes.push(
539
- withAffectedResources(
540
- { path: file.path, type: "modified" },
541
- file.content,
542
- current
543
- )
544
- );
649
+ if (!fileContentsEquivalentForDrift(file.path, current, file.content)) {
650
+ changes.push(
651
+ withAffectedResources(
652
+ keptContentDiff(file.path, keptModified, keptUnmanaged),
653
+ file.content,
654
+ current
655
+ )
656
+ );
657
+ }
545
658
  }
546
- }
659
+ });
547
660
  const applied = Boolean(latestSnapshot);
548
- const hasDrift = !applied || !stackInSync || changes.length > 0;
549
- return finalizeGlobalProfileStatus(
661
+ const blockingChanges = changes.filter((change) => !driftChangeIsKept(change));
662
+ const hasDrift = !applied || !stackInSync || blockingChanges.length > 0;
663
+ return driftCore(
550
664
  {
551
- depth,
552
665
  activeProfile,
553
666
  profileExists: true,
554
667
  applied,
@@ -561,7 +674,8 @@ async function detectGlobalProfileStatus(input = {}) {
561
674
  expectedApply,
562
675
  pluginIds
563
676
  },
564
- input.harness
677
+ input.harness,
678
+ homeRoot
565
679
  );
566
680
  }
567
681
 
@@ -1337,6 +1451,7 @@ async function executeProjectUse(options = {}) {
1337
1451
  export {
1338
1452
  resolveUserPath,
1339
1453
  resolveApplyConflictPolicy,
1454
+ reportApplyCancelled,
1340
1455
  promptMaterializationConflict,
1341
1456
  printApplyPayload,
1342
1457
  printApplyDryRun,
@@ -1354,4 +1469,4 @@ export {
1354
1469
  importProjectConfigEnvironments,
1355
1470
  executeProjectUse
1356
1471
  };
1357
- //# sourceMappingURL=chunk-KDAV2GUT.js.map
1472
+ //# sourceMappingURL=chunk-R7ZOYVN3.js.map