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.
- package/README.md +4 -0
- package/dist/apply-FTAIL3X3.js +50 -0
- package/dist/{approve-L7IFSYBO.js → approve-R6AWQB3I.js} +12 -16
- package/dist/{approve-L7IFSYBO.js.map → approve-R6AWQB3I.js.map} +1 -1
- package/dist/{audit-PBJDK7A4.js → audit-2HNKFPSU.js} +26 -39
- package/dist/{audit-PBJDK7A4.js.map → audit-2HNKFPSU.js.map} +1 -1
- package/dist/{auth-OM73RLNS.js → auth-C54KRLNF.js} +17 -21
- package/dist/{auth-OM73RLNS.js.map → auth-C54KRLNF.js.map} +1 -1
- package/dist/bin.js +13 -34
- package/dist/bin.js.map +1 -1
- package/dist/{chunk-R4PTE774.js → chunk-2XDYQXP2.js} +34 -41
- package/dist/chunk-2XDYQXP2.js.map +1 -0
- package/dist/{chunk-G5RWVZZ7.js → chunk-3277RVZT.js} +5 -7
- package/dist/{chunk-G5RWVZZ7.js.map → chunk-3277RVZT.js.map} +1 -1
- package/dist/{chunk-6JMVGKMD.js → chunk-3Q72LZPJ.js} +936 -528
- package/dist/chunk-3Q72LZPJ.js.map +1 -0
- package/dist/{chunk-U472S6IB.js → chunk-42E2MPES.js} +19 -27
- package/dist/chunk-42E2MPES.js.map +1 -0
- package/dist/{chunk-CZ4T75PP.js → chunk-5HACBPK2.js} +622 -252
- package/dist/chunk-5HACBPK2.js.map +1 -0
- package/dist/{chunk-IHW4PCDT.js → chunk-6FXJIKEG.js} +6 -6
- package/dist/{chunk-OPVIX7E4.js → chunk-A3TZT4WT.js} +6 -2
- package/dist/chunk-A3TZT4WT.js.map +1 -0
- package/dist/chunk-BUA7WFI4.js +39327 -0
- package/dist/chunk-BUA7WFI4.js.map +1 -0
- package/dist/{chunk-IAZNF35S.js → chunk-CBSDMRMY.js} +2 -2
- package/dist/{chunk-YVJQ2QDG.js → chunk-CR2TYMKC.js} +65 -55
- package/dist/chunk-CR2TYMKC.js.map +1 -0
- package/dist/{chunk-VQVUJYYY.js → chunk-CWXCZBJR.js} +76 -6
- package/dist/chunk-CWXCZBJR.js.map +1 -0
- package/dist/{chunk-AVZOFMJX.js → chunk-D7R577XZ.js} +381 -138
- package/dist/chunk-D7R577XZ.js.map +1 -0
- package/dist/{chunk-3EGM4IUI.js → chunk-EPXAOEBB.js} +6 -6
- package/dist/{chunk-64R32MG2.js → chunk-GZU4LVFF.js} +179 -26
- 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-XCPWLGPB.js → chunk-K4UDZUJ2.js} +2 -2
- package/dist/{chunk-OQ4KBUN2.js → chunk-L6BJCRBU.js} +13 -16
- package/dist/chunk-L6BJCRBU.js.map +1 -0
- package/dist/{chunk-AFKCNFPP.js → chunk-M6FEDSHY.js} +16 -15
- package/dist/chunk-M6FEDSHY.js.map +1 -0
- package/dist/chunk-M7PHQ3UC.js +31491 -0
- package/dist/chunk-M7PHQ3UC.js.map +1 -0
- package/dist/{chunk-FBYAIBHP.js → chunk-MHLAIGIM.js} +2 -2
- package/dist/{chunk-ENHDEB7Z.js → chunk-MHMFF6A5.js} +5 -7
- package/dist/{chunk-ENHDEB7Z.js.map → chunk-MHMFF6A5.js.map} +1 -1
- package/dist/chunk-MKLJBW5N.js +14 -0
- package/dist/{chunk-XRXFJTAT.js → chunk-MQCAPCAF.js} +17 -26
- package/dist/chunk-MQCAPCAF.js.map +1 -0
- package/dist/{chunk-UEHDEADL.js → chunk-MQCH3YZ5.js} +15 -13
- package/dist/chunk-MQCH3YZ5.js.map +1 -0
- package/dist/chunk-OHZNDV4A.js +1707 -0
- package/dist/chunk-OHZNDV4A.js.map +1 -0
- package/dist/{chunk-LGWUTV5Q.js → chunk-OWE3OSX6.js} +11 -13
- package/dist/{chunk-LGWUTV5Q.js.map → chunk-OWE3OSX6.js.map} +1 -1
- package/dist/{chunk-EY4ES5MG.js → chunk-PCNHBMBU.js} +3 -5
- package/dist/{chunk-EY4ES5MG.js.map → chunk-PCNHBMBU.js.map} +1 -1
- package/dist/{chunk-YRGM7RAD.js → chunk-QGTDQNVV.js} +7 -11
- package/dist/{chunk-YRGM7RAD.js.map → chunk-QGTDQNVV.js.map} +1 -1
- package/dist/{chunk-BXSS2S4W.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-FUV7QYBS.js → chunk-R6VFJKZB.js} +86 -319
- package/dist/chunk-R6VFJKZB.js.map +1 -0
- package/dist/{chunk-QNAIDM6W.js → chunk-RQLVXJH2.js} +132 -4
- package/dist/chunk-RQLVXJH2.js.map +1 -0
- package/dist/{chunk-JQOKQKQT.js → chunk-S2D5PWAO.js} +2 -2
- package/dist/{chunk-JJJJ2RAD.js → chunk-T4EKNX2Q.js} +71 -11
- package/dist/chunk-T4EKNX2Q.js.map +1 -0
- package/dist/{chunk-GWQVYGRD.js → chunk-TERYL7JH.js} +118 -78
- package/dist/chunk-TERYL7JH.js.map +1 -0
- package/dist/chunk-UC27MQ3T.js +1920 -0
- 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-WXRPQICX.js → chunk-UK2IV2ZQ.js} +2 -2
- package/dist/{chunk-MFCZN253.js → chunk-UZCAYOIQ.js} +8 -10
- package/dist/{chunk-MFCZN253.js.map → chunk-UZCAYOIQ.js.map} +1 -1
- package/dist/{chunk-IKAGGJEO.js → chunk-V4UNYSZO.js} +558 -18
- 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-Y2JGMICO.js → chunk-WGVU3LA5.js} +25 -33
- package/dist/chunk-WGVU3LA5.js.map +1 -0
- package/dist/{chunk-UNRR4KH5.js → chunk-WQ3F4O7U.js} +20 -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-LDVXYN6F.js → chunk-Y4I7ZCAE.js} +178 -135
- package/dist/chunk-Y4I7ZCAE.js.map +1 -0
- package/dist/{chunk-6I3RY6R5.js → chunk-ZKMSHLXP.js} +11 -15
- package/dist/{chunk-6I3RY6R5.js.map → chunk-ZKMSHLXP.js.map} +1 -1
- package/dist/{compile-SDOASKGL.js → compile-B2QG6BAQ.js} +37 -54
- package/dist/{compile-SDOASKGL.js.map → compile-B2QG6BAQ.js.map} +1 -1
- package/dist/{config-4VZTVZKF.js → config-D3F6ICZ2.js} +21 -39
- package/dist/{config-4VZTVZKF.js.map → config-D3F6ICZ2.js.map} +1 -1
- package/dist/cursor-local-install-4HDIBX22.js +94 -0
- package/dist/cursor-local-install-4HDIBX22.js.map +1 -0
- package/dist/cursor-local-install-LL367GZY.js +94 -0
- package/dist/cursor-local-install-LL367GZY.js.map +1 -0
- package/dist/{doctor-HH6CFBRQ.js → doctor-QSGETVDE.js} +19 -23
- package/dist/doctor-QSGETVDE.js.map +1 -0
- package/dist/{environment-K7YMJJYN.js → environment-2JS4RWQA.js} +69 -88
- package/dist/environment-2JS4RWQA.js.map +1 -0
- package/dist/{github-A6TYG7WS.js → github-JXSTHLY2.js} +14 -15
- package/dist/{github-A6TYG7WS.js.map → github-JXSTHLY2.js.map} +1 -1
- package/dist/{harness-772XBFZQ.js → harness-GBI3AMLH.js} +48 -65
- package/dist/{harness-772XBFZQ.js.map → harness-GBI3AMLH.js.map} +1 -1
- package/dist/{help-QR4VTJZU.js → help-EC52ERIE.js} +43 -52
- package/dist/help-EC52ERIE.js.map +1 -0
- package/dist/{help-TLHNRJJ6.js → help-VIRMBOPJ.js} +73 -551
- 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.d.ts +7 -0
- package/dist/index.js +10 -22
- package/dist/{init-AOKFPZHG.js → init-OK3K6ILG.js} +49 -70
- package/dist/init-OK3K6ILG.js.map +1 -0
- package/dist/live-read-cache-ESQQJBNS.js +13 -0
- package/dist/live-read-cache-WPUFHVMZ.js +12 -0
- package/dist/{lock-INAXNLMC.js → lock-AA2F4I3K.js} +13 -16
- package/dist/{lock-INAXNLMC.js.map → lock-AA2F4I3K.js.map} +1 -1
- package/dist/{marketplace-TUVLLPBG.js → marketplace-QUYCV23F.js} +75 -94
- package/dist/marketplace-QUYCV23F.js.map +1 -0
- package/dist/{mcp-MMWGRASN.js → mcp-CIHSR4DD.js} +35 -52
- package/dist/{mcp-MMWGRASN.js.map → mcp-CIHSR4DD.js.map} +1 -1
- package/dist/{migrate-55S4XODX.js → migrate-TQPEZYS5.js} +148 -74
- 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-VZIBS42E.js → pack-VUO4UBWL.js} +12 -22
- package/dist/{pack-VZIBS42E.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/plugin-from-project-U5UGKTJH.js.map +1 -0
- package/dist/{policy-P3HGLEZS.js → policy-Z5TL4N3V.js} +11 -15
- package/dist/{policy-P3HGLEZS.js.map → policy-Z5TL4N3V.js.map} +1 -1
- package/dist/{profile-STS3CZUK.js → profile-QFI7SL3S.js} +167 -143
- package/dist/profile-QFI7SL3S.js.map +1 -0
- package/dist/{project-R4DGM3ZG.js → project-3KR3EPYR.js} +506 -94
- package/dist/project-3KR3EPYR.js.map +1 -0
- package/dist/{resource-GJVEDXVZ.js → resource-45BPRQ7V.js} +66 -63
- 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-FUHV4O6U.js → version-QUJZGTZ5.js} +3 -3
- package/dist/version-QUJZGTZ5.js.map +1 -0
- package/package.json +17 -11
- package/dist/apply-Q5SFF3FY.js +0 -67
- package/dist/chunk-24V5ZSIF.js +0 -658
- package/dist/chunk-24V5ZSIF.js.map +0 -1
- package/dist/chunk-2H7UOFLK.js +0 -11
- package/dist/chunk-3JOPDYQD.js +0 -730
- package/dist/chunk-3JOPDYQD.js.map +0 -1
- package/dist/chunk-555XE3NJ.js +0 -60
- package/dist/chunk-555XE3NJ.js.map +0 -1
- package/dist/chunk-64R32MG2.js.map +0 -1
- package/dist/chunk-6JMVGKMD.js.map +0 -1
- package/dist/chunk-6ZWKF3YZ.js +0 -7795
- package/dist/chunk-6ZWKF3YZ.js.map +0 -1
- package/dist/chunk-AFKCNFPP.js.map +0 -1
- package/dist/chunk-AUWWL6KX.js +0 -296
- package/dist/chunk-AUWWL6KX.js.map +0 -1
- package/dist/chunk-AVZOFMJX.js.map +0 -1
- package/dist/chunk-CZ4T75PP.js.map +0 -1
- package/dist/chunk-FUV7QYBS.js.map +0 -1
- package/dist/chunk-GWQVYGRD.js.map +0 -1
- package/dist/chunk-HENOKIBB.js +0 -346
- package/dist/chunk-HENOKIBB.js.map +0 -1
- package/dist/chunk-HWL67OCJ.js +0 -238
- package/dist/chunk-HWL67OCJ.js.map +0 -1
- package/dist/chunk-IKAGGJEO.js.map +0 -1
- package/dist/chunk-JJJJ2RAD.js.map +0 -1
- package/dist/chunk-JRFUTIEH.js +0 -426
- package/dist/chunk-JRFUTIEH.js.map +0 -1
- package/dist/chunk-KJIFZLHN.js +0 -11066
- package/dist/chunk-KJIFZLHN.js.map +0 -1
- package/dist/chunk-LDVXYN6F.js.map +0 -1
- package/dist/chunk-MHOTXMD2.js +0 -430
- package/dist/chunk-MHOTXMD2.js.map +0 -1
- package/dist/chunk-NAGAJ5UM.js +0 -145
- package/dist/chunk-NAGAJ5UM.js.map +0 -1
- package/dist/chunk-NEPUP33Q.js +0 -35
- package/dist/chunk-NEPUP33Q.js.map +0 -1
- package/dist/chunk-OPVIX7E4.js.map +0 -1
- package/dist/chunk-OQ4KBUN2.js.map +0 -1
- package/dist/chunk-OXVCYRZB.js +0 -491
- package/dist/chunk-OXVCYRZB.js.map +0 -1
- package/dist/chunk-PJQAMC6L.js +0 -183
- package/dist/chunk-PJQAMC6L.js.map +0 -1
- package/dist/chunk-PW5QXRBA.js +0 -1173
- package/dist/chunk-PW5QXRBA.js.map +0 -1
- package/dist/chunk-QNAIDM6W.js.map +0 -1
- package/dist/chunk-R4PTE774.js.map +0 -1
- package/dist/chunk-S2E4KSYW.js +0 -610
- package/dist/chunk-S2E4KSYW.js.map +0 -1
- package/dist/chunk-SNVAMWB7.js +0 -40
- package/dist/chunk-SNVAMWB7.js.map +0 -1
- package/dist/chunk-TQ2NA4Z4.js.map +0 -1
- package/dist/chunk-U472S6IB.js.map +0 -1
- package/dist/chunk-UEHDEADL.js.map +0 -1
- package/dist/chunk-UNRR4KH5.js.map +0 -1
- package/dist/chunk-VQVUJYYY.js.map +0 -1
- package/dist/chunk-XGTTOO4R.js +0 -84
- package/dist/chunk-XGTTOO4R.js.map +0 -1
- package/dist/chunk-XRXFJTAT.js.map +0 -1
- package/dist/chunk-Y2JGMICO.js.map +0 -1
- package/dist/chunk-YVJQ2QDG.js.map +0 -1
- package/dist/chunk-YX7MVSDA.js +0 -235
- package/dist/chunk-YX7MVSDA.js.map +0 -1
- package/dist/chunk-ZGRBIBO7.js +0 -681
- package/dist/chunk-ZGRBIBO7.js.map +0 -1
- package/dist/chunk-ZTBAMBAI.js +0 -6448
- package/dist/chunk-ZTBAMBAI.js.map +0 -1
- package/dist/chunk-ZVANUFPF.js +0 -1035
- package/dist/chunk-ZVANUFPF.js.map +0 -1
- package/dist/doctor-HH6CFBRQ.js.map +0 -1
- package/dist/environment-K7YMJJYN.js.map +0 -1
- package/dist/help-QR4VTJZU.js.map +0 -1
- package/dist/help-TLHNRJJ6.js.map +0 -1
- package/dist/init-AOKFPZHG.js.map +0 -1
- package/dist/marketplace-TUVLLPBG.js.map +0 -1
- package/dist/migrate-55S4XODX.js.map +0 -1
- package/dist/open-SLFQV45J.js +0 -32
- package/dist/plugin-WLEFFBRY.js +0 -64
- package/dist/plugin-from-project-UV2O364T.js +0 -16
- package/dist/profile-STS3CZUK.js.map +0 -1
- package/dist/project-R4DGM3ZG.js.map +0 -1
- package/dist/resource-GJVEDXVZ.js.map +0 -1
- /package/dist/{apply-Q5SFF3FY.js.map → apply-FTAIL3X3.js.map} +0 -0
- /package/dist/{chunk-IHW4PCDT.js.map → chunk-6FXJIKEG.js.map} +0 -0
- /package/dist/{chunk-IAZNF35S.js.map → chunk-CBSDMRMY.js.map} +0 -0
- /package/dist/{chunk-3EGM4IUI.js.map → chunk-EPXAOEBB.js.map} +0 -0
- /package/dist/{chunk-XCPWLGPB.js.map → chunk-K4UDZUJ2.js.map} +0 -0
- /package/dist/{chunk-FBYAIBHP.js.map → chunk-MHLAIGIM.js.map} +0 -0
- /package/dist/{chunk-2H7UOFLK.js.map → chunk-MKLJBW5N.js.map} +0 -0
- /package/dist/{chunk-BXSS2S4W.js.map → chunk-R27VZIF6.js.map} +0 -0
- /package/dist/{chunk-JQOKQKQT.js.map → chunk-S2D5PWAO.js.map} +0 -0
- /package/dist/{chunk-WXRPQICX.js.map → chunk-UK2IV2ZQ.js.map} +0 -0
- /package/dist/{open-SLFQV45J.js.map → live-read-cache-ESQQJBNS.js.map} +0 -0
- /package/dist/{plugin-WLEFFBRY.js.map → live-read-cache-WPUFHVMZ.js.map} +0 -0
- /package/dist/{plugin-from-project-UV2O364T.js.map → open-D3GWGDSQ.js.map} +0 -0
- /package/dist/{version-FUHV4O6U.js.map → plugin-L3466DHK.js.map} +0 -0
|
@@ -1,3 +1,7 @@
|
|
|
1
|
+
import {
|
|
2
|
+
promptMaterializationConflict,
|
|
3
|
+
resolveApplyConflictPolicy
|
|
4
|
+
} from "./chunk-D7R577XZ.js";
|
|
1
5
|
import {
|
|
2
6
|
filterLocalBrowseRows,
|
|
3
7
|
formatLocalPluginListName,
|
|
@@ -5,21 +9,7 @@ import {
|
|
|
5
9
|
listNavigablePluginListBrowseRows,
|
|
6
10
|
renderGroupedPluginListBrowseViewport,
|
|
7
11
|
toRemoteBrowseRows
|
|
8
|
-
} from "./chunk-
|
|
9
|
-
import {
|
|
10
|
-
isPluginPackageDirectory,
|
|
11
|
-
isZipBundlePath,
|
|
12
|
-
looksLikeFilesystemPath
|
|
13
|
-
} from "./chunk-PJQAMC6L.js";
|
|
14
|
-
import {
|
|
15
|
-
promptMaterializationConflict,
|
|
16
|
-
resolveApplyConflictPolicy
|
|
17
|
-
} from "./chunk-AVZOFMJX.js";
|
|
18
|
-
import {
|
|
19
|
-
computeShowViewportBounds,
|
|
20
|
-
createPromptScreen,
|
|
21
|
-
renderScrollableShowContent
|
|
22
|
-
} from "./chunk-3EGM4IUI.js";
|
|
12
|
+
} from "./chunk-MQCAPCAF.js";
|
|
23
13
|
import {
|
|
24
14
|
DEFAULT_EXCLUDED_SKILL_CATEGORIES,
|
|
25
15
|
createRemoteCatalogListPrompt,
|
|
@@ -30,22 +20,18 @@ import {
|
|
|
30
20
|
resolveSelectedSkills,
|
|
31
21
|
resolveSkillPackageCheckout,
|
|
32
22
|
useDebouncedRemoteSearch
|
|
33
|
-
} from "./chunk-
|
|
23
|
+
} from "./chunk-42E2MPES.js";
|
|
34
24
|
import {
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
} from "./chunk-
|
|
25
|
+
computeShowViewportBounds,
|
|
26
|
+
createPromptScreen,
|
|
27
|
+
renderScrollableShowContent
|
|
28
|
+
} from "./chunk-EPXAOEBB.js";
|
|
39
29
|
import {
|
|
40
30
|
useTerminalSize
|
|
41
|
-
} from "./chunk-
|
|
42
|
-
import {
|
|
43
|
-
VIEWPORT_CHROME_LINES,
|
|
44
|
-
computeRemoteListFetchLimit
|
|
45
|
-
} from "./chunk-XGTTOO4R.js";
|
|
31
|
+
} from "./chunk-R27VZIF6.js";
|
|
46
32
|
import {
|
|
47
33
|
promptForSearchableMultiSelect
|
|
48
|
-
} from "./chunk-
|
|
34
|
+
} from "./chunk-S2D5PWAO.js";
|
|
49
35
|
import {
|
|
50
36
|
buildHelpLine,
|
|
51
37
|
clampActiveIndex,
|
|
@@ -55,49 +41,57 @@ import {
|
|
|
55
41
|
isLetterKey,
|
|
56
42
|
isSearchCharacter
|
|
57
43
|
} from "./chunk-3FIWOI3H.js";
|
|
58
|
-
import {
|
|
59
|
-
applyToGlobal,
|
|
60
|
-
collectPluginPinsForPrepare,
|
|
61
|
-
getActiveProfileName,
|
|
62
|
-
installPluginFromCatalog,
|
|
63
|
-
preparePluginPinsForApply,
|
|
64
|
-
resolveEnvironmentCascadeForApply
|
|
65
|
-
} from "./chunk-6ZWKF3YZ.js";
|
|
66
|
-
import {
|
|
67
|
-
isPromptCancellationError,
|
|
68
|
-
promptForChoice,
|
|
69
|
-
promptForConfirmation,
|
|
70
|
-
shouldUseWizard
|
|
71
|
-
} from "./chunk-NAGAJ5UM.js";
|
|
72
44
|
import {
|
|
73
45
|
initializeSchema
|
|
74
|
-
} from "./chunk-
|
|
46
|
+
} from "./chunk-RQLVXJH2.js";
|
|
75
47
|
import {
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
resolveScanGlobalHarnessTargets
|
|
80
|
-
} from "./chunk-AUWWL6KX.js";
|
|
48
|
+
parseOutputFormat,
|
|
49
|
+
printJson
|
|
50
|
+
} from "./chunk-R4NV3Q7G.js";
|
|
81
51
|
import {
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
} from "./chunk-
|
|
52
|
+
fail,
|
|
53
|
+
formatCommand
|
|
54
|
+
} from "./chunk-WGVU3LA5.js";
|
|
85
55
|
import {
|
|
56
|
+
ExtendsError,
|
|
57
|
+
LocalPluginSelectorError,
|
|
58
|
+
PluginAmbiguityError,
|
|
59
|
+
PluginForkError,
|
|
86
60
|
PluginProvenanceError,
|
|
61
|
+
PluginResolveError,
|
|
87
62
|
PluginVersionError,
|
|
88
63
|
RESOURCE_TYPES,
|
|
64
|
+
UpstreamUnpublishedError,
|
|
65
|
+
VIEWPORT_CHROME_LINES,
|
|
89
66
|
addPluginAttachment,
|
|
67
|
+
addResourceToPlugin,
|
|
68
|
+
applyToGlobal,
|
|
90
69
|
assertAuthored,
|
|
70
|
+
assertNoExtendsCycle,
|
|
71
|
+
assertParentPublished,
|
|
91
72
|
assertPluginsCleanForShare,
|
|
92
73
|
buildApPackageFiles,
|
|
74
|
+
buildUpstream,
|
|
75
|
+
catalogUpstreamBase,
|
|
76
|
+
cloudPublishErrorMessage,
|
|
77
|
+
collectPluginPinsForPrepare,
|
|
78
|
+
computeRemoteListFetchLimit,
|
|
93
79
|
createPlugin,
|
|
94
80
|
cutPluginVersion,
|
|
95
81
|
deletePlugin,
|
|
82
|
+
diagnoseApManifest,
|
|
96
83
|
downloadCatalogPackage,
|
|
97
84
|
envelopeFromFiles,
|
|
85
|
+
fetchPluginExportToTempFile,
|
|
86
|
+
findLocalPluginBySelector,
|
|
87
|
+
forkPlugin,
|
|
88
|
+
formatCatalogSelectionLabel,
|
|
98
89
|
formatPluginVersionLabel,
|
|
99
90
|
formatPublishedPluginSelector,
|
|
91
|
+
formatUpstreamLabel,
|
|
92
|
+
getActiveProfileName,
|
|
100
93
|
getEnvironment,
|
|
94
|
+
getImportedSnapshot,
|
|
101
95
|
getPlugin,
|
|
102
96
|
getPluginByCatalogVersion,
|
|
103
97
|
getPluginById,
|
|
@@ -105,46 +99,50 @@ import {
|
|
|
105
99
|
getPluginByPublishedIdentity,
|
|
106
100
|
getPluginResources,
|
|
107
101
|
importApPackageFiles,
|
|
108
|
-
|
|
102
|
+
installPluginFromCatalog,
|
|
103
|
+
isPluginExportFilePath,
|
|
104
|
+
isPluginUrl,
|
|
105
|
+
isProfilePlugin,
|
|
109
106
|
listAttachedPluginPins,
|
|
110
107
|
listCatalogPluginsPage,
|
|
108
|
+
listComposedItems,
|
|
111
109
|
listDependencies,
|
|
112
110
|
listLatestPublishedPluginsBySlug,
|
|
113
111
|
listPluginDependencies,
|
|
112
|
+
listPluginExcludes,
|
|
114
113
|
listPlugins,
|
|
115
114
|
listPluginsInScope,
|
|
115
|
+
markPluginDirty,
|
|
116
116
|
mergePluginsById,
|
|
117
|
+
parseSpecMcpJson,
|
|
118
|
+
preparePluginPinsForApply,
|
|
117
119
|
rankCatalogSearchResults,
|
|
120
|
+
recordImportedSnapshotInstall,
|
|
121
|
+
renderCatalogListChunk,
|
|
122
|
+
resolveBareNameFromCatalog,
|
|
118
123
|
resolveClaudeEnabledPluginRef,
|
|
119
124
|
resolveComposition,
|
|
120
|
-
|
|
125
|
+
resolveEnvironmentCascadeForApply,
|
|
126
|
+
resolveInstallSelector,
|
|
121
127
|
resolvePluginSelector,
|
|
128
|
+
resolveScanGlobalHarnessTargets,
|
|
122
129
|
satisfiesConstraint,
|
|
130
|
+
setPluginExcludes,
|
|
131
|
+
setPluginResourceOrder,
|
|
132
|
+
setPluginUpstream,
|
|
123
133
|
substituteResourcesForApply,
|
|
124
|
-
updatePluginPublishedIdentity
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
trackPluginUsed
|
|
128
|
-
} from "./chunk-OXVCYRZB.js";
|
|
129
|
-
import {
|
|
130
|
-
parseOutputFormat,
|
|
131
|
-
printJson
|
|
132
|
-
} from "./chunk-TQ2NA4Z4.js";
|
|
133
|
-
import {
|
|
134
|
-
fail,
|
|
135
|
-
formatCommand
|
|
136
|
-
} from "./chunk-Y2JGMICO.js";
|
|
134
|
+
updatePluginPublishedIdentity,
|
|
135
|
+
writePluginExcludes
|
|
136
|
+
} from "./chunk-BUA7WFI4.js";
|
|
137
137
|
import {
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
theme,
|
|
145
|
-
ui
|
|
146
|
-
} from "./chunk-LDVXYN6F.js";
|
|
138
|
+
isPromptCancellationError,
|
|
139
|
+
promptForChoice,
|
|
140
|
+
promptForConfirmation,
|
|
141
|
+
resolveHomeRoot,
|
|
142
|
+
shouldUseWizard
|
|
143
|
+
} from "./chunk-UC27MQ3T.js";
|
|
147
144
|
import {
|
|
145
|
+
cloudErrorDetail,
|
|
148
146
|
createPersistingCloudClient,
|
|
149
147
|
ensureRegisteredPublishCatalog,
|
|
150
148
|
formatCanonicalPublishedSelector,
|
|
@@ -153,194 +151,370 @@ import {
|
|
|
153
151
|
formatPublishCatalogSelector,
|
|
154
152
|
formatPublishedSelector,
|
|
155
153
|
getCloudAccount,
|
|
156
|
-
isPublicCatalogEnabled,
|
|
157
154
|
loadRegisteredCatalogs,
|
|
158
155
|
parsePluginSelector,
|
|
159
156
|
parsePublishCatalogSelector,
|
|
160
157
|
publishCatalogKey,
|
|
161
158
|
registerPublishCatalog,
|
|
159
|
+
requestIdSuffix,
|
|
162
160
|
resolveCatalogScope,
|
|
163
161
|
resolveRemotePluginSelector,
|
|
164
162
|
resolvedRemotePluginFromCatalog,
|
|
163
|
+
trackPluginUsed,
|
|
165
164
|
unregisterPublishCatalog
|
|
166
|
-
} from "./chunk-
|
|
165
|
+
} from "./chunk-V4UNYSZO.js";
|
|
167
166
|
import {
|
|
168
167
|
CLI_ERRORS,
|
|
169
168
|
CLI_HINTS,
|
|
170
|
-
|
|
169
|
+
applyCancelledMessage,
|
|
171
170
|
formatCatalogRequestError,
|
|
172
|
-
|
|
173
|
-
|
|
171
|
+
formatCount,
|
|
172
|
+
formatRelativeTimeWithAbsolute,
|
|
173
|
+
getDb,
|
|
174
|
+
renderPanel,
|
|
175
|
+
renderSubheader,
|
|
176
|
+
renderTable,
|
|
177
|
+
shortenId,
|
|
178
|
+
theme,
|
|
179
|
+
ui
|
|
180
|
+
} from "./chunk-OHZNDV4A.js";
|
|
174
181
|
|
|
175
|
-
// src/services/plugin-
|
|
176
|
-
import {
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
}
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
const
|
|
201
|
-
|
|
182
|
+
// src/services/plugin-duplicate.ts
|
|
183
|
+
import { randomUUID } from "crypto";
|
|
184
|
+
function duplicatePlugin(selector, opts = {}) {
|
|
185
|
+
const mode = opts.mode ?? "inherit";
|
|
186
|
+
if (mode === "copy") {
|
|
187
|
+
const fork = forkPlugin(selector, opts.name, { allowAuthored: true, defaultSuffix: "-copy" });
|
|
188
|
+
return {
|
|
189
|
+
plugin: fork.plugin,
|
|
190
|
+
source: fork.source,
|
|
191
|
+
mode,
|
|
192
|
+
upstream: fork.upstream,
|
|
193
|
+
linked_to: fork.forked_from
|
|
194
|
+
};
|
|
195
|
+
}
|
|
196
|
+
const source = resolvePluginSelector(selector);
|
|
197
|
+
if (!source) {
|
|
198
|
+
throw new PluginForkError("not_found", `Plugin not found: ${selector}`);
|
|
199
|
+
}
|
|
200
|
+
const name = opts.name?.trim() || `${source.name}-copy`;
|
|
201
|
+
if (getPluginByName(name)) {
|
|
202
|
+
throw new PluginForkError("plugin_exists", `Plugin ${name} already exists.`, source.name);
|
|
203
|
+
}
|
|
204
|
+
const upstream = buildUpstream("extends", catalogUpstreamBase(source) ?? source.name, source.version);
|
|
205
|
+
assertNoExtendsCycle({ ...source, id: "", name, upstream: void 0 }, upstream, source.id);
|
|
206
|
+
const db = getDb();
|
|
207
|
+
const id = db.transaction(() => {
|
|
208
|
+
const created = createPlugin({
|
|
209
|
+
name,
|
|
210
|
+
version: "1.0.0",
|
|
211
|
+
description: source.description,
|
|
212
|
+
tags: source.tags,
|
|
213
|
+
...source.needs ? { needs: source.needs } : {},
|
|
214
|
+
origin: "authored"
|
|
215
|
+
});
|
|
216
|
+
setPluginUpstream(created.id, upstream, source.id);
|
|
217
|
+
return created.id;
|
|
218
|
+
})();
|
|
219
|
+
const plugin = getPluginById(id);
|
|
220
|
+
if (!plugin) {
|
|
221
|
+
throw new PluginForkError("not_found", `Plugin not found after duplicate: ${name}`);
|
|
222
|
+
}
|
|
223
|
+
return { plugin, source, mode, upstream, linked_to: formatUpstreamLabel(upstream) };
|
|
202
224
|
}
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
this.name = "PluginResolveError";
|
|
210
|
-
this.hints = hints;
|
|
225
|
+
var DETACH_UNDO_TTL_MS = 10 * 60 * 1e3;
|
|
226
|
+
var detachUndoSnapshots = /* @__PURE__ */ new Map();
|
|
227
|
+
function detachPlugin(selector) {
|
|
228
|
+
const plugin = resolvePluginSelector(selector);
|
|
229
|
+
if (!plugin) {
|
|
230
|
+
throw new PluginForkError("not_found", `Plugin not found: ${selector}`);
|
|
211
231
|
}
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
candidates;
|
|
215
|
-
constructor(selector, candidates) {
|
|
216
|
-
const lines = candidates.map(
|
|
217
|
-
(plugin) => formatCatalogSelector(plugin, plugin.latestVersion ?? void 0)
|
|
218
|
-
);
|
|
219
|
-
super(
|
|
220
|
-
`Ambiguous plugin name: ${selector}
|
|
221
|
-
${lines.map((line) => ` ${line}`).join("\n")}`,
|
|
222
|
-
["Use a fully qualified selector: org/catalog/slug@version"]
|
|
223
|
-
);
|
|
224
|
-
this.candidates = candidates;
|
|
232
|
+
if (plugin.upstream?.kind !== "extends") {
|
|
233
|
+
throw new ExtendsError("not_extends", `${plugin.name} does not keep in sync with a parent; there is nothing to detach.`);
|
|
225
234
|
}
|
|
235
|
+
const upstream = plugin.upstream;
|
|
236
|
+
const items = listComposedItems(plugin.id);
|
|
237
|
+
const hidden = listPluginExcludes(plugin.id);
|
|
238
|
+
const ownIds = new Set(getPluginResources(plugin.id).map((resource) => resource.id));
|
|
239
|
+
const db = getDb();
|
|
240
|
+
const ownOrder = getPluginResources(plugin.id).map((resource) => resource.id);
|
|
241
|
+
const workingSnapshot = db.prepare(
|
|
242
|
+
"SELECT source_version, payload, created_at FROM plugin_working_snapshots WHERE plugin_id = ?"
|
|
243
|
+
).get(plugin.id) ?? null;
|
|
244
|
+
const added = [];
|
|
245
|
+
let materialized = 0;
|
|
246
|
+
db.transaction(() => {
|
|
247
|
+
markPluginDirty(plugin.id);
|
|
248
|
+
for (const item of items) {
|
|
249
|
+
if (item.source !== "parent" || ownIds.has(item.resource.id)) continue;
|
|
250
|
+
addResourceToPlugin(plugin.id, item.resource.id, item.resource.harness_scope);
|
|
251
|
+
added.push(item.resource.id);
|
|
252
|
+
materialized += 1;
|
|
253
|
+
}
|
|
254
|
+
setPluginResourceOrder(
|
|
255
|
+
plugin.id,
|
|
256
|
+
items.map((item) => item.resource.id)
|
|
257
|
+
);
|
|
258
|
+
setPluginUpstream(plugin.id, { ...upstream, kind: "fork" }, plugin.upstream_plugin_id ?? "");
|
|
259
|
+
writePluginExcludes(plugin.id, []);
|
|
260
|
+
})();
|
|
261
|
+
const updated = getPluginById(plugin.id);
|
|
262
|
+
if (!updated) {
|
|
263
|
+
throw new PluginForkError("not_found", `Plugin not found after detach: ${plugin.name}`);
|
|
264
|
+
}
|
|
265
|
+
const token = randomUUID();
|
|
266
|
+
detachUndoSnapshots.set(plugin.id, {
|
|
267
|
+
token,
|
|
268
|
+
pluginId: plugin.id,
|
|
269
|
+
upstream,
|
|
270
|
+
upstreamPluginId: plugin.upstream_plugin_id ?? "",
|
|
271
|
+
excludes: hidden,
|
|
272
|
+
ownOrder,
|
|
273
|
+
added,
|
|
274
|
+
wasDirty: plugin.dirty === true,
|
|
275
|
+
workingSnapshot,
|
|
276
|
+
expiresAt: Date.now() + DETACH_UNDO_TTL_MS
|
|
277
|
+
});
|
|
278
|
+
return { plugin: updated, materialized, hidden, undo_token: token };
|
|
279
|
+
}
|
|
280
|
+
|
|
281
|
+
// src/services/plugin-duplicate-cloud.ts
|
|
282
|
+
var defaultDeps = {
|
|
283
|
+
createClient: async (account) => (await createPersistingCloudClient(account))?.client ?? null
|
|
226
284
|
};
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
285
|
+
var CLOUD_SLUG_PATTERN = /^[a-z0-9](?:[a-z0-9.-]{0,62}[a-z0-9])?$/;
|
|
286
|
+
function cloudSlugFromName(name) {
|
|
287
|
+
const slug = name.trim().toLowerCase().replace(/[^a-z0-9]+/g, "-").replace(/^-+|-+$/g, "").replace(/-{2,}/g, "-").slice(0, 64);
|
|
288
|
+
return CLOUD_SLUG_PATTERN.test(slug) ? slug : void 0;
|
|
289
|
+
}
|
|
290
|
+
function invalidNameMessage(name) {
|
|
291
|
+
return `"${name}" cannot be used as a Cloud profile name: it needs letters or digits, and its slug must be at most 64 characters without a hyphen at either end. Try a name such as planner-copy.`;
|
|
292
|
+
}
|
|
293
|
+
function parseTarget(to) {
|
|
294
|
+
const [org, catalog, ...rest] = to.split("/").map((part) => part.trim());
|
|
295
|
+
if (!org || rest.length > 0) {
|
|
296
|
+
throw new PluginForkError("not_found", `Invalid --to "${to}". Use <org>/<catalog>, e.g. my-org/default.`);
|
|
230
297
|
}
|
|
231
|
-
return
|
|
298
|
+
return { org, catalog: catalog || "default" };
|
|
232
299
|
}
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
300
|
+
function catalogSource(selector) {
|
|
301
|
+
const parsed = parsePluginSelector(selector);
|
|
302
|
+
if (parsed.scope === "published") {
|
|
303
|
+
return { org: parsed.org, catalog: parsed.catalog, slug: parsed.name };
|
|
304
|
+
}
|
|
305
|
+
const local = resolvePluginSelector(selector);
|
|
306
|
+
const base = local ? catalogUpstreamBase(local) : void 0;
|
|
307
|
+
if (!base) return void 0;
|
|
308
|
+
const [org, catalog, slug] = base.split("/");
|
|
309
|
+
return org && catalog && slug ? { org, catalog, slug } : void 0;
|
|
310
|
+
}
|
|
311
|
+
async function duplicateInCloud(selector, opts, deps = defaultDeps) {
|
|
312
|
+
const target = parseTarget(opts.to);
|
|
313
|
+
const source = catalogSource(selector);
|
|
314
|
+
if (!source) {
|
|
315
|
+
throw new PluginForkError(
|
|
316
|
+
"not_found",
|
|
317
|
+
`${selector} is not in a catalog, so Cloud cannot duplicate it. Drop --to to duplicate it in your Library.`
|
|
237
318
|
);
|
|
238
|
-
if (hasRemoteHelpers || !isPublicCatalogEnabled()) {
|
|
239
|
-
return resolveRemotePluginSelector(selector, {
|
|
240
|
-
org: options.org,
|
|
241
|
-
catalog: options.catalog,
|
|
242
|
-
version: options.version
|
|
243
|
-
});
|
|
244
|
-
}
|
|
245
|
-
return resolveBareNameFromCatalog(selector, options);
|
|
246
319
|
}
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
}
|
|
320
|
+
const name = opts.name?.trim() || `${source.slug}-copy`;
|
|
321
|
+
const slug = cloudSlugFromName(name);
|
|
322
|
+
if (!slug) {
|
|
323
|
+
throw new PluginForkError("not_found", invalidNameMessage(name));
|
|
324
|
+
}
|
|
325
|
+
const client = await deps.createClient(opts.account);
|
|
326
|
+
if (!client) {
|
|
327
|
+
throw new PluginForkError("not_found", "Not signed in to HarnessTap Cloud. Run `ht auth login` first.");
|
|
328
|
+
}
|
|
329
|
+
let response;
|
|
330
|
+
try {
|
|
331
|
+
response = await client.duplicateCatalogPlugin({
|
|
332
|
+
source,
|
|
333
|
+
mode: opts.mode === "copy" ? "copy" : "extends",
|
|
334
|
+
name,
|
|
335
|
+
targetOrg: target.org,
|
|
336
|
+
targetCatalog: target.catalog
|
|
337
|
+
});
|
|
338
|
+
} catch (error) {
|
|
339
|
+
throw new PluginForkError(
|
|
340
|
+
"not_found",
|
|
341
|
+
cloudDuplicateErrorMessage(error, { selector, source, target, name, slug }) ?? (error instanceof Error ? error.message : String(error))
|
|
342
|
+
);
|
|
343
|
+
}
|
|
344
|
+
if (response) return { kind: "cloud", response };
|
|
345
|
+
if (!resolvePluginSelector(selector)) {
|
|
346
|
+
throw new PluginForkError(
|
|
347
|
+
"not_found",
|
|
348
|
+
`Cloud cannot duplicate profiles yet and ${selector} is not in your Library. Run \`ht profile pull ${selector}\`, then duplicate without --to.`
|
|
349
|
+
);
|
|
350
|
+
}
|
|
351
|
+
return { kind: "local", result: duplicatePlugin(selector, { name, mode: opts.mode }) };
|
|
352
|
+
}
|
|
353
|
+
function cloudDuplicateErrorMessage(error, ctx) {
|
|
354
|
+
const detail = cloudErrorDetail(error);
|
|
355
|
+
const request = requestIdSuffix(detail);
|
|
356
|
+
const sourceLabel = `${ctx.source.org}/${ctx.source.catalog}/${ctx.source.slug}`;
|
|
357
|
+
const to = `${ctx.target.org}/${ctx.target.catalog}`;
|
|
358
|
+
switch (detail.code) {
|
|
359
|
+
case "invalid_input":
|
|
360
|
+
return `${invalidNameMessage(ctx.name)}${request}`;
|
|
361
|
+
case "duplicate_slug":
|
|
362
|
+
return `${to} already has a profile with the slug ${ctx.slug}. Pick another name, e.g. \`ht profile duplicate ${sourceLabel} ${ctx.slug}-2 --to ${to}\`.${request}`;
|
|
363
|
+
case "not_found":
|
|
364
|
+
return `Cloud cannot find ${sourceLabel}: it is hidden, private, or does not exist. Check the selector, or sign in with an account that can see it.${request}`;
|
|
365
|
+
case "forbidden":
|
|
366
|
+
return `Cloud does not know the organization ${ctx.target.org}, or this account cannot publish there. Check --to ${to}.${request}`;
|
|
367
|
+
case "catalog_not_found":
|
|
368
|
+
return `Cloud cannot find the catalog in ${to}${detail.message ? ` (${detail.message.replace(/\.$/, "")})` : ""}. Check --to <org>/<catalog>.${request}`;
|
|
369
|
+
case "upstream_unpublished":
|
|
370
|
+
return `${detail.ref ?? sourceLabel} is not published, so it cannot be duplicated.${request}`;
|
|
371
|
+
default:
|
|
372
|
+
return detail.message ? `Cloud could not duplicate ${sourceLabel}: ${detail.message}${request}` : void 0;
|
|
373
|
+
}
|
|
252
374
|
}
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
)
|
|
375
|
+
|
|
376
|
+
// src/cli/handlers/profile-duplicate.ts
|
|
377
|
+
function reportError(error, hints = []) {
|
|
378
|
+
process.exitCode = 1;
|
|
379
|
+
if (error instanceof ExtendsError && error.hint) {
|
|
380
|
+
ui.danger(error.message, { hints: [error.hint, ...hints] });
|
|
381
|
+
return;
|
|
382
|
+
}
|
|
383
|
+
if (error instanceof PluginForkError && error.code === "plugin_exists") {
|
|
384
|
+
ui.danger(error.message, { hints: [`${formatCommand(["profile", "duplicate", error.sourceName ?? "<source>"])} <name>`] });
|
|
385
|
+
return;
|
|
386
|
+
}
|
|
387
|
+
if (error instanceof ExtendsError || error instanceof PluginForkError || error instanceof PluginVersionError) {
|
|
388
|
+
ui.danger(error.message, hints.length > 0 ? { hints } : void 0);
|
|
389
|
+
return;
|
|
390
|
+
}
|
|
391
|
+
ui.danger(error instanceof Error ? error.message : String(error));
|
|
258
392
|
}
|
|
259
|
-
function
|
|
260
|
-
const
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
return [...byKey.values()];
|
|
265
|
-
}
|
|
266
|
-
function formatCatalogSelector(plugin, version) {
|
|
267
|
-
const base = `${plugin.orgSlug}/${plugin.catalogSlug}/${plugin.slug}`;
|
|
268
|
-
const resolvedVersion = version ?? plugin.latestVersion ?? void 0;
|
|
269
|
-
return resolvedVersion ? `${base}@${resolvedVersion}` : base;
|
|
270
|
-
}
|
|
271
|
-
function formatCatalogPluginChoiceLabel(plugin) {
|
|
272
|
-
const selector = formatCatalogSelector(plugin, plugin.latestVersion ?? void 0);
|
|
273
|
-
const summary = plugin.summary?.trim() || plugin.name;
|
|
274
|
-
return `${selector}: ${summary}`;
|
|
275
|
-
}
|
|
276
|
-
async function promptCatalogPluginAmbiguity(selector, candidates) {
|
|
277
|
-
const selectedKey = await promptForChoice({
|
|
278
|
-
message: `Multiple catalog plugins match "${selector}". Which one?`,
|
|
279
|
-
choices: candidates.map((plugin) => ({
|
|
280
|
-
name: formatCatalogPluginChoiceLabel(plugin),
|
|
281
|
-
value: catalogPluginKey(plugin)
|
|
282
|
-
}))
|
|
283
|
-
});
|
|
284
|
-
const match = candidates.find((plugin) => catalogPluginKey(plugin) === selectedKey);
|
|
285
|
-
if (!match) {
|
|
286
|
-
throw new PluginResolveError(`Plugin not found: ${selector}`);
|
|
393
|
+
function renderLocalDuplicate(result, format) {
|
|
394
|
+
const { plugin, upstream, linked_to, mode } = result;
|
|
395
|
+
if (format === "json") {
|
|
396
|
+
printJson({ name: plugin.name, version: plugin.version, mode, linked_to, upstream });
|
|
397
|
+
return;
|
|
287
398
|
}
|
|
288
|
-
|
|
399
|
+
if (mode === "inherit") {
|
|
400
|
+
ui.success(`Created ${ui.theme.accent(plugin.name)}, kept in sync with ${linked_to}`);
|
|
401
|
+
ui.hint(`Parent updates show up here. Hide an item: ${formatCommand(["plugin", "edit", plugin.name])} --hide skill:<name>`);
|
|
402
|
+
return;
|
|
403
|
+
}
|
|
404
|
+
ui.success(`Created ${ui.theme.accent(plugin.name)}, a separate copy of ${linked_to}`);
|
|
405
|
+
ui.hint(formatCommand(["plugin", "edit", plugin.name]));
|
|
289
406
|
}
|
|
290
|
-
async function
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
return only;
|
|
407
|
+
async function handleProfileDuplicateCommand(source, name, opts = {}) {
|
|
408
|
+
initializeSchema(getDb());
|
|
409
|
+
const format = parseOutputFormat(opts.format);
|
|
410
|
+
if (opts.copy && opts.inherit) {
|
|
411
|
+
process.exitCode = 1;
|
|
412
|
+
ui.danger("Choose one of --inherit (include as a resource of a new profile) or --copy (separate copy).");
|
|
413
|
+
return;
|
|
298
414
|
}
|
|
299
|
-
|
|
300
|
-
|
|
415
|
+
const mode = opts.copy ? "copy" : "inherit";
|
|
416
|
+
if (opts.to) {
|
|
417
|
+
try {
|
|
418
|
+
const outcome = await duplicateInCloud(source, {
|
|
419
|
+
...name ? { name } : {},
|
|
420
|
+
mode,
|
|
421
|
+
to: opts.to,
|
|
422
|
+
...opts.account ? { account: opts.account } : {}
|
|
423
|
+
});
|
|
424
|
+
if (outcome.kind === "local") {
|
|
425
|
+
if (format !== "json") ui.info("Cloud cannot duplicate profiles yet, so the copy was made in your Library.");
|
|
426
|
+
renderLocalDuplicate(outcome.result, format);
|
|
427
|
+
if (format !== "json") {
|
|
428
|
+
const [org, catalog] = opts.to.split("/");
|
|
429
|
+
ui.hint(`Publish it: ${formatCommand(["plugin", "publish", outcome.result.plugin.name, "--org", org ?? "", "--catalog", catalog || "default"])}`);
|
|
430
|
+
}
|
|
431
|
+
return;
|
|
432
|
+
}
|
|
433
|
+
const { response } = outcome;
|
|
434
|
+
const upstream = response.publishedVersion?.upstream;
|
|
435
|
+
if (format === "json") {
|
|
436
|
+
printJson({ selector: response.selector, version: response.version, mode: response.mode, upstream: upstream ?? null, cloud: true });
|
|
437
|
+
return;
|
|
438
|
+
}
|
|
439
|
+
const link = upstream?.ref ?? source;
|
|
440
|
+
ui.success(
|
|
441
|
+
response.mode === "copy" ? `Published ${ui.theme.accent(response.selector)} ${response.version}, a separate copy of ${link}` : `Published ${ui.theme.accent(response.selector)} ${response.version}, kept in sync with ${link}`
|
|
442
|
+
);
|
|
443
|
+
ui.hint(`Get it locally: ${formatCommand(["profile", "pull", response.selector])}`);
|
|
444
|
+
} catch (error) {
|
|
445
|
+
reportError(error);
|
|
446
|
+
}
|
|
447
|
+
return;
|
|
301
448
|
}
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
if (!canPrompt) {
|
|
309
|
-
throw new PluginAmbiguityError(selector, unique);
|
|
449
|
+
let result;
|
|
450
|
+
try {
|
|
451
|
+
result = duplicatePlugin(source, { ...name ? { name } : {}, mode });
|
|
452
|
+
} catch (error) {
|
|
453
|
+
reportError(error);
|
|
454
|
+
return;
|
|
310
455
|
}
|
|
311
|
-
|
|
456
|
+
renderLocalDuplicate(result, format);
|
|
312
457
|
}
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
458
|
+
function handleProfileDetachCommand(name, opts = {}) {
|
|
459
|
+
initializeSchema(getDb());
|
|
460
|
+
const format = parseOutputFormat(opts.format);
|
|
461
|
+
let result;
|
|
462
|
+
try {
|
|
463
|
+
result = detachPlugin(name);
|
|
464
|
+
} catch (error) {
|
|
465
|
+
reportError(error);
|
|
466
|
+
return;
|
|
322
467
|
}
|
|
323
|
-
const
|
|
324
|
-
if (
|
|
325
|
-
|
|
468
|
+
const { plugin, materialized, hidden } = result;
|
|
469
|
+
if (format === "json") {
|
|
470
|
+
printJson({ name: plugin.name, upstream: plugin.upstream ?? null, materialized, hidden_cleared: hidden });
|
|
471
|
+
return;
|
|
326
472
|
}
|
|
327
|
-
|
|
328
|
-
{
|
|
329
|
-
{ account: options.account, baseUrl: options.baseUrl }
|
|
473
|
+
ui.success(
|
|
474
|
+
`Detached ${ui.theme.accent(plugin.name)}: ${materialized} inherited ${materialized === 1 ? "item is" : "items are"} now its own. Nothing was deleted.`
|
|
330
475
|
);
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
476
|
+
if (hidden.length > 0) {
|
|
477
|
+
ui.info(`Hidden items no longer apply and stay out of the copy: ${hidden.join(", ")}`);
|
|
478
|
+
}
|
|
479
|
+
ui.hint(`Not applied yet. Run ${formatCommand(["profile", "use", plugin.name])} to apply it.`);
|
|
480
|
+
}
|
|
481
|
+
function handlePluginHideOptions(name, opts) {
|
|
482
|
+
const hide = opts.hide ?? [];
|
|
483
|
+
const unhide = opts.unhide ?? [];
|
|
484
|
+
if (hide.length === 0 && unhide.length === 0) return false;
|
|
485
|
+
initializeSchema(getDb());
|
|
486
|
+
const plugin = name ? getPlugin(name) : void 0;
|
|
487
|
+
if (!plugin) {
|
|
488
|
+
process.exitCode = 1;
|
|
489
|
+
ui.danger(name ? `Plugin not found: ${name}` : "Name the profile to edit.");
|
|
490
|
+
return true;
|
|
338
491
|
}
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
492
|
+
try {
|
|
493
|
+
const next = new Set(listPluginExcludes(plugin.id));
|
|
494
|
+
for (const entry of hide) next.add(entry.trim());
|
|
495
|
+
for (const entry of unhide) next.delete(entry.trim());
|
|
496
|
+
const entries = setPluginExcludes(plugin.id, [...next]);
|
|
497
|
+
if (parseOutputFormat(opts.format) === "json") {
|
|
498
|
+
printJson({ name: plugin.name, hidden: entries });
|
|
499
|
+
return true;
|
|
500
|
+
}
|
|
501
|
+
ui.success(
|
|
502
|
+
entries.length > 0 ? `${plugin.name} hides ${entries.join(", ")}` : `${plugin.name} shows every item from its parent`
|
|
503
|
+
);
|
|
504
|
+
} catch (error) {
|
|
505
|
+
reportError(error);
|
|
506
|
+
}
|
|
507
|
+
return true;
|
|
508
|
+
}
|
|
509
|
+
function registerProfileDuplicateCommands(profileCmd) {
|
|
510
|
+
profileCmd.command("duplicate").argument("<source>", "Profile or plugin to duplicate").argument("[name]", "Name for the new profile (default: <source>-copy)").option("--inherit", "Include as a resource of a new profile: it contains the parent and gets its updates; only your changes are stored (default)").option("--copy", "Separate copy: copy the items now; later parent changes do not apply").option("--to <org/catalog>", "Duplicate in Cloud and publish to this catalog (source must be in a catalog)").option("--account <name>", "Cloud account to use with --to").option("--format <mode>", "Output format: human or json", "human").description("Duplicate a profile, kept in sync with it or as a separate copy").action(
|
|
511
|
+
async (source, name, opts) => {
|
|
512
|
+
await handleProfileDuplicateCommand(source, name, opts);
|
|
513
|
+
}
|
|
343
514
|
);
|
|
515
|
+
profileCmd.command("detach").argument("<name>", "Profile that keeps in sync with a parent").option("--format <mode>", "Output format: human or json", "human").description("Stop keeping a profile in sync: its current items become its own (Library only)").action((name, opts) => {
|
|
516
|
+
handleProfileDetachCommand(name, opts);
|
|
517
|
+
});
|
|
344
518
|
}
|
|
345
519
|
|
|
346
520
|
// src/cli/handlers/plugin-install.ts
|
|
@@ -371,6 +545,7 @@ async function handlePluginInstallCommand(selector, opts) {
|
|
|
371
545
|
try {
|
|
372
546
|
const installed = await installPluginFromCatalog(parsed, {
|
|
373
547
|
as: opts.as,
|
|
548
|
+
...opts.profile ? { profile: true } : {},
|
|
374
549
|
account: opts.account,
|
|
375
550
|
baseUrl: opts.baseUrl
|
|
376
551
|
});
|
|
@@ -769,6 +944,104 @@ function resolveOneOffPublishTarget(input) {
|
|
|
769
944
|
return [];
|
|
770
945
|
}
|
|
771
946
|
|
|
947
|
+
// src/services/agent-plugins/publish-gate.ts
|
|
948
|
+
var SpecPublishError = class extends Error {
|
|
949
|
+
problems;
|
|
950
|
+
constructor(problems) {
|
|
951
|
+
super(problems.join("\n"));
|
|
952
|
+
this.name = "SpecPublishError";
|
|
953
|
+
this.problems = problems;
|
|
954
|
+
}
|
|
955
|
+
};
|
|
956
|
+
function fileText(entry) {
|
|
957
|
+
return entry.encoding === "base64" ? Buffer.from(entry.content, "base64").toString("utf8") : entry.content;
|
|
958
|
+
}
|
|
959
|
+
function assertAgentPluginsPublishable(files, opts) {
|
|
960
|
+
const warnings = opts?.warnings ?? [];
|
|
961
|
+
const pluginFile = files["plugin.json"];
|
|
962
|
+
if (!pluginFile) {
|
|
963
|
+
throw new SpecPublishError(["plugin.json is required"]);
|
|
964
|
+
}
|
|
965
|
+
let manifest;
|
|
966
|
+
try {
|
|
967
|
+
manifest = JSON.parse(fileText(pluginFile));
|
|
968
|
+
} catch {
|
|
969
|
+
throw new SpecPublishError(["plugin.json is not valid JSON"]);
|
|
970
|
+
}
|
|
971
|
+
const diagnosis = diagnoseApManifest(manifest, "strict");
|
|
972
|
+
if (diagnosis.fatal.length > 0 || diagnosis.manifest === null) {
|
|
973
|
+
throw new SpecPublishError(
|
|
974
|
+
diagnosis.fatal.length > 0 ? diagnosis.fatal : ["plugin.json is not a valid Agent Plugins manifest"]
|
|
975
|
+
);
|
|
976
|
+
}
|
|
977
|
+
const mcpFile = files["mcp.json"];
|
|
978
|
+
if (mcpFile) {
|
|
979
|
+
let document;
|
|
980
|
+
try {
|
|
981
|
+
document = JSON.parse(fileText(mcpFile));
|
|
982
|
+
} catch {
|
|
983
|
+
throw new SpecPublishError(["mcp.json is not valid JSON"]);
|
|
984
|
+
}
|
|
985
|
+
const parsed = parseSpecMcpJson(document);
|
|
986
|
+
if (parsed.disabled) {
|
|
987
|
+
throw new SpecPublishError([`mcp.json is invalid: ${parsed.disabled}`]);
|
|
988
|
+
}
|
|
989
|
+
for (const skipped of parsed.skipped) {
|
|
990
|
+
warnings.push(`mcp.json server "${skipped.name}" was skipped: ${skipped.reason}`);
|
|
991
|
+
}
|
|
992
|
+
}
|
|
993
|
+
if (opts?.strict === true && warnings.length > 0) {
|
|
994
|
+
throw new SpecPublishError(warnings);
|
|
995
|
+
}
|
|
996
|
+
return warnings;
|
|
997
|
+
}
|
|
998
|
+
|
|
999
|
+
// src/services/plugin-publish-dependencies.ts
|
|
1000
|
+
function findUnpublishedDependencies(refs, resolve3 = resolvePluginSelector) {
|
|
1001
|
+
const unpublished = [];
|
|
1002
|
+
for (const ref of refs) {
|
|
1003
|
+
if (ref.embed_on_export || ref.source_kind !== "local") {
|
|
1004
|
+
continue;
|
|
1005
|
+
}
|
|
1006
|
+
const selector = ref.version_constraint && ref.version_constraint !== "*" ? `${ref.name}@${ref.version_constraint}` : ref.name;
|
|
1007
|
+
const local = resolve3(selector);
|
|
1008
|
+
if (local && (!local.org_slug || !local.catalog_slug)) {
|
|
1009
|
+
if (!unpublished.includes(ref.name)) {
|
|
1010
|
+
unpublished.push(ref.name);
|
|
1011
|
+
}
|
|
1012
|
+
}
|
|
1013
|
+
}
|
|
1014
|
+
return unpublished;
|
|
1015
|
+
}
|
|
1016
|
+
function unpublishedDependenciesMessage(pluginName, dependencies, opts) {
|
|
1017
|
+
const lead = `Cannot publish ${pluginName}: it depends on local plugins that are not in a catalog: ${dependencies.join(", ")}. Publish them first, or remove them`;
|
|
1018
|
+
if (opts?.cliHint === false) {
|
|
1019
|
+
return `${lead} from ${pluginName}.`;
|
|
1020
|
+
}
|
|
1021
|
+
const removeArgs = dependencies.flatMap((name) => ["--remove", `plugin:${name}`]);
|
|
1022
|
+
return `${lead} with ${formatCommand(["plugin", "edit", pluginName, ...removeArgs])}`;
|
|
1023
|
+
}
|
|
1024
|
+
var UnpublishedDependenciesError = class extends Error {
|
|
1025
|
+
code = "unpublished_dependencies";
|
|
1026
|
+
pluginName;
|
|
1027
|
+
dependencies;
|
|
1028
|
+
constructor(pluginName, dependencies) {
|
|
1029
|
+
super(unpublishedDependenciesMessage(pluginName, dependencies));
|
|
1030
|
+
this.name = "UnpublishedDependenciesError";
|
|
1031
|
+
this.pluginName = pluginName;
|
|
1032
|
+
this.dependencies = dependencies;
|
|
1033
|
+
}
|
|
1034
|
+
};
|
|
1035
|
+
function listUnpublishedDependencies(pluginId) {
|
|
1036
|
+
return findUnpublishedDependencies(listDependencies(pluginId));
|
|
1037
|
+
}
|
|
1038
|
+
function assertDependenciesPublished(plugin) {
|
|
1039
|
+
const unpublished = listUnpublishedDependencies(plugin.id);
|
|
1040
|
+
if (unpublished.length > 0) {
|
|
1041
|
+
throw new UnpublishedDependenciesError(plugin.name, unpublished);
|
|
1042
|
+
}
|
|
1043
|
+
}
|
|
1044
|
+
|
|
772
1045
|
// src/services/plugin-publish.ts
|
|
773
1046
|
async function createCloudClientForTarget(target, accountOverride) {
|
|
774
1047
|
const accountName = accountOverride ?? target.account;
|
|
@@ -777,7 +1050,24 @@ async function createCloudClientForTarget(target, accountOverride) {
|
|
|
777
1050
|
}
|
|
778
1051
|
async function publishPluginToCatalogs(plugin, targets, opts) {
|
|
779
1052
|
assertPluginsCleanForShare([plugin]);
|
|
780
|
-
|
|
1053
|
+
assertParentPublished(plugin);
|
|
1054
|
+
assertDependenciesPublished(plugin);
|
|
1055
|
+
const warnings = [];
|
|
1056
|
+
const packageFiles = buildApPackageFiles(plugin.id, {
|
|
1057
|
+
warnings,
|
|
1058
|
+
vendorExtensions: opts?.vendorExtensions === true
|
|
1059
|
+
});
|
|
1060
|
+
const buildWarnings = [...warnings];
|
|
1061
|
+
const reported = assertAgentPluginsPublishable(packageFiles, {
|
|
1062
|
+
strict: opts?.strict === true,
|
|
1063
|
+
warnings
|
|
1064
|
+
});
|
|
1065
|
+
for (const warning of reported) {
|
|
1066
|
+
if (!buildWarnings.includes(warning)) {
|
|
1067
|
+
console.error(`warning: ${warning}`);
|
|
1068
|
+
}
|
|
1069
|
+
}
|
|
1070
|
+
const apPackage = envelopeFromFiles(packageFiles);
|
|
781
1071
|
const results = [];
|
|
782
1072
|
let firstSuccess;
|
|
783
1073
|
for (const target of targets) {
|
|
@@ -810,7 +1100,8 @@ async function publishPluginToCatalogs(plugin, targets, opts) {
|
|
|
810
1100
|
};
|
|
811
1101
|
}
|
|
812
1102
|
} catch (error) {
|
|
813
|
-
const
|
|
1103
|
+
const raw = error instanceof Error ? error.message : String(error);
|
|
1104
|
+
const message = cloudPublishErrorMessage(plugin, error) ?? raw;
|
|
814
1105
|
results.push({ target, ok: false, error: message });
|
|
815
1106
|
}
|
|
816
1107
|
}
|
|
@@ -909,6 +1200,8 @@ async function handlePluginPublishCommand(pluginName, catalogSelector, opts) {
|
|
|
909
1200
|
}
|
|
910
1201
|
try {
|
|
911
1202
|
assertAuthored(plugin.id, "publish");
|
|
1203
|
+
assertParentPublished(plugin);
|
|
1204
|
+
assertDependenciesPublished(plugin);
|
|
912
1205
|
if (opts.version) {
|
|
913
1206
|
plugin = cutPluginVersion({ pluginId: plugin.id, newVersion: opts.version });
|
|
914
1207
|
} else if (plugin.dirty) {
|
|
@@ -931,7 +1224,9 @@ async function handlePluginPublishCommand(pluginName, catalogSelector, opts) {
|
|
|
931
1224
|
});
|
|
932
1225
|
const targets = oneOffTargets.length > 0 ? oneOffTargets : resolvePublishTargetsForPlugin(plugin.id);
|
|
933
1226
|
const results = await publishPluginToCatalogs(plugin, targets, {
|
|
934
|
-
account: opts.account
|
|
1227
|
+
account: opts.account,
|
|
1228
|
+
strict: opts.strict === true,
|
|
1229
|
+
vendorExtensions: opts.vendorExtensions === true
|
|
935
1230
|
});
|
|
936
1231
|
const format = parseOutputFormat(opts.format);
|
|
937
1232
|
if (format === "json") {
|
|
@@ -962,9 +1257,24 @@ async function handlePluginPublishCommand(pluginName, catalogSelector, opts) {
|
|
|
962
1257
|
ui.danger(err.message);
|
|
963
1258
|
return;
|
|
964
1259
|
}
|
|
1260
|
+
if (err instanceof UpstreamUnpublishedError) {
|
|
1261
|
+
ui.danger(err.message, { hints: [formatCommand(["profile", "detach", err.pluginName])] });
|
|
1262
|
+
return;
|
|
1263
|
+
}
|
|
965
1264
|
ui.danger(err instanceof Error ? err.message : String(err));
|
|
966
1265
|
}
|
|
967
1266
|
}
|
|
1267
|
+
function publishBlockers(plugin) {
|
|
1268
|
+
try {
|
|
1269
|
+
assertParentPublished(plugin);
|
|
1270
|
+
return [];
|
|
1271
|
+
} catch (error) {
|
|
1272
|
+
if (error instanceof UpstreamUnpublishedError) {
|
|
1273
|
+
return [{ code: error.code, ref: error.ref, message: error.message }];
|
|
1274
|
+
}
|
|
1275
|
+
throw error;
|
|
1276
|
+
}
|
|
1277
|
+
}
|
|
968
1278
|
async function handlePluginPublishPlanCommand(pluginName, opts) {
|
|
969
1279
|
const db = getDb();
|
|
970
1280
|
initializeSchema(db);
|
|
@@ -978,11 +1288,31 @@ async function handlePluginPublishPlanCommand(pluginName, opts) {
|
|
|
978
1288
|
assertAuthored(plugin.id, "publish");
|
|
979
1289
|
const targets = resolvePublishTargetsForPlugin(plugin.id);
|
|
980
1290
|
const plans = await planPluginPublish(plugin, targets, { account: opts.account });
|
|
1291
|
+
const blockers = publishBlockers(plugin);
|
|
1292
|
+
const unpublished = listUnpublishedDependencies(plugin.id);
|
|
1293
|
+
const blocker = unpublished.length > 0 ? unpublishedDependenciesMessage(plugin.name, unpublished) : void 0;
|
|
1294
|
+
if (blocker) {
|
|
1295
|
+
process.exitCode = 1;
|
|
1296
|
+
}
|
|
981
1297
|
const format = parseOutputFormat(opts.format);
|
|
982
1298
|
if (format === "json") {
|
|
983
|
-
|
|
1299
|
+
const all = [
|
|
1300
|
+
...blockers,
|
|
1301
|
+
...blocker ? [{ code: "unpublished_dependencies", message: blocker, dependencies: unpublished }] : []
|
|
1302
|
+
];
|
|
1303
|
+
printJson({
|
|
1304
|
+
plugin: plugin.name,
|
|
1305
|
+
...all.length > 0 ? { blockers: all } : {},
|
|
1306
|
+
plans
|
|
1307
|
+
});
|
|
984
1308
|
return;
|
|
985
1309
|
}
|
|
1310
|
+
for (const blocker2 of blockers) {
|
|
1311
|
+
ui.danger(blocker2.message, { hints: [formatCommand(["profile", "detach", plugin.name])] });
|
|
1312
|
+
}
|
|
1313
|
+
if (blocker) {
|
|
1314
|
+
ui.danger(blocker);
|
|
1315
|
+
}
|
|
986
1316
|
for (const plan of plans) {
|
|
987
1317
|
const label = formatPublishedSelector({
|
|
988
1318
|
org: plan.target.org,
|
|
@@ -1074,9 +1404,10 @@ function renderPluginShow(plugin, selector, opts) {
|
|
|
1074
1404
|
renderPanel({
|
|
1075
1405
|
title: ["PLUGIN", pluginLabel],
|
|
1076
1406
|
rows: [
|
|
1077
|
-
["Description", plugin.description || "
|
|
1078
|
-
["Tags", plugin.tags.length > 0 ? plugin.tags.join(", ") : "
|
|
1407
|
+
["Description", plugin.description || "none"],
|
|
1408
|
+
["Tags", plugin.tags.length > 0 ? plugin.tags.join(", ") : "none"],
|
|
1079
1409
|
["Origin", formatOriginLabel(plugin.origin, plugin.origin_locator)],
|
|
1410
|
+
...upstreamShowRows(plugin),
|
|
1080
1411
|
...opts?.profileExtras ? [["Active", opts.profileExtras.active ? "yes" : "no"]] : [],
|
|
1081
1412
|
["Resources", `${resources.length} (${summarizeResourceTypes(resources) || "none"})`],
|
|
1082
1413
|
[
|
|
@@ -1085,7 +1416,7 @@ function renderPluginShow(plugin, selector, opts) {
|
|
|
1085
1416
|
],
|
|
1086
1417
|
...configuredPlugin ? [[
|
|
1087
1418
|
"Default environment",
|
|
1088
|
-
configuredPluginDefaultEnvironment?.name ?? configuredPlugin.default_environment_id ?? "
|
|
1419
|
+
configuredPluginDefaultEnvironment?.name ?? configuredPlugin.default_environment_id ?? "none"
|
|
1089
1420
|
]] : [],
|
|
1090
1421
|
["Updated", formatRelativeTimeWithAbsolute(plugin.updated_at)]
|
|
1091
1422
|
]
|
|
@@ -1123,17 +1454,48 @@ function renderPluginShow(plugin, selector, opts) {
|
|
|
1123
1454
|
function renderPluginShowForPlugin(plugin, opts) {
|
|
1124
1455
|
return renderPluginShow(plugin, `${plugin.name}@${plugin.version}`, opts);
|
|
1125
1456
|
}
|
|
1457
|
+
function upstreamShowRows(plugin) {
|
|
1458
|
+
if (!plugin.upstream) {
|
|
1459
|
+
return [];
|
|
1460
|
+
}
|
|
1461
|
+
if (plugin.upstream.kind === "fork") {
|
|
1462
|
+
return [["Forked from", formatUpstreamLabel(plugin.upstream)]];
|
|
1463
|
+
}
|
|
1464
|
+
const hidden = listPluginExcludes(plugin.id);
|
|
1465
|
+
let inherited;
|
|
1466
|
+
try {
|
|
1467
|
+
const count = listComposedItems(plugin.id).filter((item) => item.source === "parent").length;
|
|
1468
|
+
inherited = `${count} ${count === 1 ? "item" : "items"} from the parent`;
|
|
1469
|
+
} catch {
|
|
1470
|
+
inherited = "parent not installed";
|
|
1471
|
+
}
|
|
1472
|
+
return [
|
|
1473
|
+
["Extends", formatUpstreamLabel(plugin.upstream)],
|
|
1474
|
+
["Inherited", inherited],
|
|
1475
|
+
...hidden.length > 0 ? [["Hidden", hidden.join(", ")]] : []
|
|
1476
|
+
];
|
|
1477
|
+
}
|
|
1126
1478
|
|
|
1127
1479
|
// src/cli/handlers/plugin-show-command.ts
|
|
1128
1480
|
function handlePluginShowCommand(name, opts, profileExtras) {
|
|
1129
1481
|
const db = getDb();
|
|
1130
1482
|
initializeSchema(db);
|
|
1131
1483
|
const format = parseOutputFormat(opts.format);
|
|
1132
|
-
|
|
1484
|
+
let plugin;
|
|
1485
|
+
try {
|
|
1486
|
+
plugin = getPlugin(name) ?? findLocalPluginBySelector(name, { command: "ht plugin show" });
|
|
1487
|
+
} catch (error) {
|
|
1488
|
+
if (error instanceof LocalPluginSelectorError) {
|
|
1489
|
+
fail(error.message, { hints: error.hints });
|
|
1490
|
+
return;
|
|
1491
|
+
}
|
|
1492
|
+
throw error;
|
|
1493
|
+
}
|
|
1133
1494
|
if (!plugin) {
|
|
1134
1495
|
fail(CLI_ERRORS.pluginNotFound(name), { hint: CLI_HINTS.pluginList });
|
|
1135
1496
|
return;
|
|
1136
1497
|
}
|
|
1498
|
+
const exactMatch = plugin.name === name || plugin.id === name || name.startsWith(`${plugin.name}@`);
|
|
1137
1499
|
trackPluginUsed({
|
|
1138
1500
|
pluginSlug: plugin.name
|
|
1139
1501
|
});
|
|
@@ -1151,6 +1513,7 @@ function handlePluginShowCommand(name, opts, profileExtras) {
|
|
|
1151
1513
|
}));
|
|
1152
1514
|
const dependencies = listPluginDependencies(plugin.id);
|
|
1153
1515
|
const configuredPlugin = (() => {
|
|
1516
|
+
if (!exactMatch) return plugin;
|
|
1154
1517
|
if (/^[0-9A-Z]{26}$/.test(name)) {
|
|
1155
1518
|
return getPluginById(name);
|
|
1156
1519
|
}
|
|
@@ -1170,6 +1533,8 @@ function handlePluginShowCommand(name, opts, profileExtras) {
|
|
|
1170
1533
|
description: plugin.description,
|
|
1171
1534
|
tags: plugin.tags,
|
|
1172
1535
|
...plugin.claude ? { claude: plugin.claude } : {},
|
|
1536
|
+
...plugin.upstream ? { upstream: plugin.upstream } : {},
|
|
1537
|
+
...plugin.upstream?.kind === "extends" ? { excludes: listPluginExcludes(plugin.id) } : {},
|
|
1173
1538
|
created_at: plugin.created_at,
|
|
1174
1539
|
updated_at: plugin.updated_at,
|
|
1175
1540
|
resources,
|
|
@@ -1187,7 +1552,7 @@ function handlePluginShowCommand(name, opts, profileExtras) {
|
|
|
1187
1552
|
});
|
|
1188
1553
|
return;
|
|
1189
1554
|
}
|
|
1190
|
-
console.log(renderPluginShow(plugin, name, {
|
|
1555
|
+
console.log(renderPluginShow(plugin, exactMatch ? name : plugin.id, {
|
|
1191
1556
|
showId: opts.showId,
|
|
1192
1557
|
profileExtras
|
|
1193
1558
|
}));
|
|
@@ -1461,12 +1826,15 @@ async function applyPluginsGlobally(selectors, options) {
|
|
|
1461
1826
|
claudeConfig: resolvedClaude
|
|
1462
1827
|
});
|
|
1463
1828
|
if (applied.cancelled) {
|
|
1464
|
-
return {
|
|
1829
|
+
return {
|
|
1830
|
+
cancelled: true,
|
|
1831
|
+
conflicts: applied.conflicts.map((conflict) => conflict.path)
|
|
1832
|
+
};
|
|
1465
1833
|
}
|
|
1466
1834
|
ui.success(
|
|
1467
1835
|
`Applied ${selectors.join(" + ")} globally (${formatCount(applied.writtenFiles.length, "file")})`
|
|
1468
1836
|
);
|
|
1469
|
-
return { cancelled: false };
|
|
1837
|
+
return { cancelled: false, conflicts: [] };
|
|
1470
1838
|
}
|
|
1471
1839
|
function resolveCatalogSearchProjectRoot(cwd = process.cwd()) {
|
|
1472
1840
|
return resolve(cwd);
|
|
@@ -1557,13 +1925,13 @@ async function editCatalogPluginComposition(plugin, selection, opts) {
|
|
|
1557
1925
|
|
|
1558
1926
|
// src/services/catalog-list-stream.ts
|
|
1559
1927
|
var visibilityRank = { organization: 3, shared: 2, public: 1 };
|
|
1560
|
-
function
|
|
1928
|
+
function catalogPluginKey(plugin) {
|
|
1561
1929
|
return `${plugin.orgSlug}/${plugin.catalogSlug}/${plugin.slug}`;
|
|
1562
1930
|
}
|
|
1563
1931
|
function dedupePagePlugins(plugins, seen) {
|
|
1564
1932
|
const result = [];
|
|
1565
1933
|
for (const plugin of plugins) {
|
|
1566
|
-
const key =
|
|
1934
|
+
const key = catalogPluginKey(plugin);
|
|
1567
1935
|
const existing = seen.get(key);
|
|
1568
1936
|
if (!existing) {
|
|
1569
1937
|
seen.set(key, plugin);
|
|
@@ -1685,7 +2053,7 @@ async function listCatalogPluginsFromSources(sources, opts) {
|
|
|
1685
2053
|
switch (event.type) {
|
|
1686
2054
|
case "chunk": {
|
|
1687
2055
|
for (const plugin of event.chunk.plugins) {
|
|
1688
|
-
const key =
|
|
2056
|
+
const key = catalogPluginKey(plugin);
|
|
1689
2057
|
if (seen.has(key)) {
|
|
1690
2058
|
continue;
|
|
1691
2059
|
}
|
|
@@ -1751,7 +2119,8 @@ async function renderCatalogPluginPreviewShow(catalogPlugin, opts = {}) {
|
|
|
1751
2119
|
const previewPluginName = `__hd-preview-${ulid().toLowerCase()}__`;
|
|
1752
2120
|
const imported = importApPackageFiles(downloaded.files, {
|
|
1753
2121
|
as: previewPluginName,
|
|
1754
|
-
origin: "catalog"
|
|
2122
|
+
origin: "catalog",
|
|
2123
|
+
installPackage: false
|
|
1755
2124
|
});
|
|
1756
2125
|
try {
|
|
1757
2126
|
const pluginLabel = formatCanonicalPublishedSelectorWithVersion({
|
|
@@ -2209,8 +2578,7 @@ function renderLocalPluginListTable(plugins, opts) {
|
|
|
2209
2578
|
key: "description",
|
|
2210
2579
|
header: "DESCRIPTION",
|
|
2211
2580
|
width: 44,
|
|
2212
|
-
truncate: true
|
|
2213
|
-
transform: (value) => value || ": "
|
|
2581
|
+
truncate: true
|
|
2214
2582
|
}
|
|
2215
2583
|
],
|
|
2216
2584
|
rows: plugins.map((plugin) => ({
|
|
@@ -2239,8 +2607,7 @@ function renderProfileLocalPluginListTable(plugins) {
|
|
|
2239
2607
|
key: "description",
|
|
2240
2608
|
header: "DESCRIPTION",
|
|
2241
2609
|
width: 50,
|
|
2242
|
-
truncate: true
|
|
2243
|
-
transform: (value) => value || ": "
|
|
2610
|
+
truncate: true
|
|
2244
2611
|
}
|
|
2245
2612
|
],
|
|
2246
2613
|
rows: plugins.map((plugin) => ({
|
|
@@ -2354,7 +2721,9 @@ async function runInteractivePluginListBrowse2(opts) {
|
|
|
2354
2721
|
});
|
|
2355
2722
|
if (applied.cancelled) {
|
|
2356
2723
|
process.exitCode = 1;
|
|
2357
|
-
ui.danger(
|
|
2724
|
+
ui.danger(applyCancelledMessage(applied.conflicts, "apply"), {
|
|
2725
|
+
hint: CLI_HINTS.onConflictReplace
|
|
2726
|
+
});
|
|
2358
2727
|
}
|
|
2359
2728
|
return;
|
|
2360
2729
|
}
|
|
@@ -2452,7 +2821,9 @@ async function runInteractiveRemotePluginSearch(opts) {
|
|
|
2452
2821
|
});
|
|
2453
2822
|
if (applied.cancelled) {
|
|
2454
2823
|
process.exitCode = 1;
|
|
2455
|
-
ui.danger(
|
|
2824
|
+
ui.danger(applyCancelledMessage(applied.conflicts, "apply"), {
|
|
2825
|
+
hint: CLI_HINTS.onConflictReplace
|
|
2826
|
+
});
|
|
2456
2827
|
}
|
|
2457
2828
|
}
|
|
2458
2829
|
async function collectRemotePlugins(opts) {
|
|
@@ -2723,7 +3094,7 @@ async function createPluginFromSource(options) {
|
|
|
2723
3094
|
const version = options.version ?? "1.0.0";
|
|
2724
3095
|
const onConflict = options.onConflict ?? "cancel";
|
|
2725
3096
|
const method = options.method ?? "symlink";
|
|
2726
|
-
const resolved = resolveSkillPackageCheckout(
|
|
3097
|
+
const resolved = await resolveSkillPackageCheckout(
|
|
2727
3098
|
options.source,
|
|
2728
3099
|
options.harnesstapDir
|
|
2729
3100
|
);
|
|
@@ -2935,9 +3306,8 @@ async function runPluginCreateFromSourceWizard(input) {
|
|
|
2935
3306
|
}
|
|
2936
3307
|
|
|
2937
3308
|
export {
|
|
2938
|
-
|
|
2939
|
-
|
|
2940
|
-
PluginAmbiguityError,
|
|
3309
|
+
handlePluginHideOptions,
|
|
3310
|
+
registerProfileDuplicateCommands,
|
|
2941
3311
|
handlePluginInstallCommand,
|
|
2942
3312
|
handlePluginCatalogRegisterCommand,
|
|
2943
3313
|
handlePluginCatalogUnregisterCommand,
|
|
@@ -2956,4 +3326,4 @@ export {
|
|
|
2956
3326
|
createPluginFromSource,
|
|
2957
3327
|
runPluginCreateFromSourceWizard
|
|
2958
3328
|
};
|
|
2959
|
-
//# sourceMappingURL=chunk-
|
|
3329
|
+
//# sourceMappingURL=chunk-5HACBPK2.js.map
|