harnesstap 1.4.0 → 1.6.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +2 -0
- package/dist/apply-FTAIL3X3.js +50 -0
- package/dist/{approve-FBGYQGWN.js → approve-R6AWQB3I.js} +10 -13
- package/dist/{approve-FBGYQGWN.js.map → approve-R6AWQB3I.js.map} +1 -1
- package/dist/{audit-VI4QZ6X2.js → audit-2HNKFPSU.js} +11 -15
- package/dist/{audit-VI4QZ6X2.js.map → audit-2HNKFPSU.js.map} +1 -1
- package/dist/{auth-4CQCDS2W.js → auth-C54KRLNF.js} +10 -12
- package/dist/{auth-4CQCDS2W.js.map → auth-C54KRLNF.js.map} +1 -1
- package/dist/bin.js +13 -34
- package/dist/bin.js.map +1 -1
- package/dist/{chunk-IE7B6Q5K.js → chunk-2XDYQXP2.js} +17 -18
- package/dist/chunk-2XDYQXP2.js.map +1 -0
- package/dist/{chunk-L6YZE5MY.js → chunk-3277RVZT.js} +5 -7
- package/dist/{chunk-L6YZE5MY.js.map → chunk-3277RVZT.js.map} +1 -1
- package/dist/{chunk-QA5U36JN.js → chunk-3Q72LZPJ.js} +764 -340
- package/dist/chunk-3Q72LZPJ.js.map +1 -0
- package/dist/{chunk-OML4HXKT.js → chunk-42E2MPES.js} +16 -22
- package/dist/chunk-42E2MPES.js.map +1 -0
- package/dist/{chunk-4ZQ2SCGY.js → chunk-5HACBPK2.js} +509 -207
- package/dist/chunk-5HACBPK2.js.map +1 -0
- package/dist/{chunk-GRASK6M6.js → chunk-6FXJIKEG.js} +5 -5
- package/dist/{chunk-73OJQTBW.js → chunk-A3TZT4WT.js} +2 -2
- package/dist/{chunk-ZUASVASP.js → chunk-BUA7WFI4.js} +27034 -18024
- package/dist/chunk-BUA7WFI4.js.map +1 -0
- package/dist/{chunk-U6DXASQP.js → chunk-CBSDMRMY.js} +2 -2
- package/dist/{chunk-RDG5DT7S.js → chunk-CR2TYMKC.js} +54 -40
- package/dist/chunk-CR2TYMKC.js.map +1 -0
- package/dist/{chunk-REHRUNBB.js → chunk-CWXCZBJR.js} +70 -5
- package/dist/chunk-CWXCZBJR.js.map +1 -0
- package/dist/{chunk-R7ZOYVN3.js → chunk-D7R577XZ.js} +187 -59
- package/dist/chunk-D7R577XZ.js.map +1 -0
- package/dist/{chunk-P2C7JPLD.js → chunk-EPXAOEBB.js} +6 -6
- package/dist/{chunk-D432JAXV.js → chunk-GZU4LVFF.js} +153 -25
- package/dist/chunk-GZU4LVFF.js.map +1 -0
- package/dist/chunk-HV3ENT2F.js +61 -0
- package/dist/chunk-HV3ENT2F.js.map +1 -0
- package/dist/{chunk-3P6BWL5F.js → chunk-K4UDZUJ2.js} +2 -2
- package/dist/{chunk-ULCD6DJE.js → chunk-L6BJCRBU.js} +14 -39
- package/dist/chunk-L6BJCRBU.js.map +1 -0
- package/dist/{chunk-M4KLHJ6U.js → chunk-M6FEDSHY.js} +8 -10
- package/dist/{chunk-M4KLHJ6U.js.map → chunk-M6FEDSHY.js.map} +1 -1
- package/dist/chunk-M7PHQ3UC.js +31491 -0
- package/dist/chunk-M7PHQ3UC.js.map +1 -0
- package/dist/{chunk-PNGF5EV2.js → chunk-MHLAIGIM.js} +2 -2
- package/dist/{chunk-BPWFQKI5.js → chunk-MHMFF6A5.js} +2 -2
- package/dist/chunk-MKLJBW5N.js +14 -0
- package/dist/{chunk-MR7IOHSX.js → chunk-MQCAPCAF.js} +16 -22
- package/dist/{chunk-MR7IOHSX.js.map → chunk-MQCAPCAF.js.map} +1 -1
- package/dist/{chunk-N3VGY3T3.js → chunk-MQCH3YZ5.js} +7 -5
- package/dist/{chunk-N3VGY3T3.js.map → chunk-MQCH3YZ5.js.map} +1 -1
- package/dist/{chunk-WG5A6EAU.js → chunk-OHZNDV4A.js} +821 -28
- package/dist/chunk-OHZNDV4A.js.map +1 -0
- package/dist/{chunk-WGP4GUYZ.js → chunk-OWE3OSX6.js} +9 -11
- package/dist/{chunk-WGP4GUYZ.js.map → chunk-OWE3OSX6.js.map} +1 -1
- package/dist/{chunk-RVEXPMM3.js → chunk-PCNHBMBU.js} +3 -5
- package/dist/{chunk-RVEXPMM3.js.map → chunk-PCNHBMBU.js.map} +1 -1
- package/dist/{chunk-23XSG7LI.js → chunk-QGTDQNVV.js} +4 -4
- package/dist/{chunk-UVVZHWD2.js → chunk-R27VZIF6.js} +2 -2
- package/dist/{chunk-TQ2NA4Z4.js → chunk-R4NV3Q7G.js} +8 -2
- package/dist/chunk-R4NV3Q7G.js.map +1 -0
- package/dist/{chunk-EOPFER6N.js → chunk-R6VFJKZB.js} +19 -5
- package/dist/chunk-R6VFJKZB.js.map +1 -0
- package/dist/{chunk-3FS775NP.js → chunk-RQLVXJH2.js} +85 -4
- package/dist/chunk-RQLVXJH2.js.map +1 -0
- package/dist/{chunk-JQOKQKQT.js → chunk-S2D5PWAO.js} +2 -2
- package/dist/{chunk-43BDGVN3.js → chunk-T4EKNX2Q.js} +56 -9
- package/dist/chunk-T4EKNX2Q.js.map +1 -0
- package/dist/{chunk-XTVGCVU4.js → chunk-TERYL7JH.js} +36 -37
- package/dist/chunk-TERYL7JH.js.map +1 -0
- package/dist/{chunk-6LTLYV5D.js → chunk-UC27MQ3T.js} +1064 -265
- package/dist/chunk-UC27MQ3T.js.map +1 -0
- package/dist/chunk-UEA4NCY2.js +106 -0
- package/dist/chunk-UEA4NCY2.js.map +1 -0
- package/dist/{chunk-7HP6AAI3.js → chunk-UK2IV2ZQ.js} +2 -2
- package/dist/{chunk-PCMON7Y2.js → chunk-UZCAYOIQ.js} +8 -10
- package/dist/{chunk-PCMON7Y2.js.map → chunk-UZCAYOIQ.js.map} +1 -1
- package/dist/{chunk-N3ZCH64F.js → chunk-V4UNYSZO.js} +86 -32
- package/dist/chunk-V4UNYSZO.js.map +1 -0
- package/dist/chunk-VAPCU2FX.js +70 -0
- package/dist/chunk-VAPCU2FX.js.map +1 -0
- package/dist/{chunk-RFQ3N7FB.js → chunk-WGVU3LA5.js} +11 -9
- package/dist/chunk-WGVU3LA5.js.map +1 -0
- package/dist/{chunk-IMROMZ2K.js → chunk-WQ3F4O7U.js} +19 -14
- package/dist/chunk-WQ3F4O7U.js.map +1 -0
- package/dist/chunk-XNS4I3W6.js +102 -0
- package/dist/chunk-XNS4I3W6.js.map +1 -0
- package/dist/{chunk-2A36HWDE.js → chunk-Y4I7ZCAE.js} +129 -136
- package/dist/chunk-Y4I7ZCAE.js.map +1 -0
- package/dist/{chunk-TPEJFLV7.js → chunk-ZKMSHLXP.js} +4 -6
- package/dist/{chunk-TPEJFLV7.js.map → chunk-ZKMSHLXP.js.map} +1 -1
- package/dist/{compile-GXADKGH5.js → compile-B2QG6BAQ.js} +33 -37
- package/dist/{compile-GXADKGH5.js.map → compile-B2QG6BAQ.js.map} +1 -1
- package/dist/{config-JMHNA2U5.js → config-D3F6ICZ2.js} +16 -21
- package/dist/{config-JMHNA2U5.js.map → config-D3F6ICZ2.js.map} +1 -1
- package/dist/{cursor-local-install-46RWRBDT.js → cursor-local-install-4HDIBX22.js} +8 -12
- package/dist/{cursor-local-install-46RWRBDT.js.map → cursor-local-install-4HDIBX22.js.map} +1 -1
- package/dist/cursor-local-install-LL367GZY.js +94 -0
- package/dist/cursor-local-install-LL367GZY.js.map +1 -0
- package/dist/{doctor-N7ZULPOL.js → doctor-QSGETVDE.js} +14 -17
- package/dist/doctor-QSGETVDE.js.map +1 -0
- package/dist/{environment-OBB3WU5B.js → environment-2JS4RWQA.js} +42 -50
- package/dist/environment-2JS4RWQA.js.map +1 -0
- package/dist/{github-PBYBGOLH.js → github-JXSTHLY2.js} +9 -10
- package/dist/{github-PBYBGOLH.js.map → github-JXSTHLY2.js.map} +1 -1
- package/dist/{harness-7KYATIV6.js → harness-GBI3AMLH.js} +25 -31
- package/dist/{harness-7KYATIV6.js.map → harness-GBI3AMLH.js.map} +1 -1
- package/dist/{help-EE3AJQD4.js → help-EC52ERIE.js} +15 -20
- package/dist/{help-EE3AJQD4.js.map → help-EC52ERIE.js.map} +1 -1
- package/dist/{help-VXWKLQ6A.js → help-VIRMBOPJ.js} +57 -575
- package/dist/help-VIRMBOPJ.js.map +1 -0
- package/dist/host-plugin-view-kept-XKHD6NGU.js +139 -0
- package/dist/host-plugin-view-kept-XKHD6NGU.js.map +1 -0
- package/dist/index.js +12 -16
- package/dist/{init-LBTMPDVJ.js → init-OK3K6ILG.js} +33 -41
- package/dist/{init-LBTMPDVJ.js.map → init-OK3K6ILG.js.map} +1 -1
- package/dist/live-read-cache-ESQQJBNS.js +13 -0
- package/dist/live-read-cache-WPUFHVMZ.js +12 -0
- package/dist/{lock-WLJRXRVK.js → lock-AA2F4I3K.js} +9 -12
- package/dist/{lock-WLJRXRVK.js.map → lock-AA2F4I3K.js.map} +1 -1
- package/dist/{marketplace-GXSV6QIY.js → marketplace-QUYCV23F.js} +26 -79
- package/dist/marketplace-QUYCV23F.js.map +1 -0
- package/dist/{mcp-XPDWWU75.js → mcp-CIHSR4DD.js} +33 -37
- package/dist/{mcp-XPDWWU75.js.map → mcp-CIHSR4DD.js.map} +1 -1
- package/dist/{migrate-SBUIWN3U.js → migrate-TQPEZYS5.js} +93 -34
- package/dist/migrate-TQPEZYS5.js.map +1 -0
- package/dist/notifications-TAELTPDW.js +154 -0
- package/dist/notifications-TAELTPDW.js.map +1 -0
- package/dist/open-D3GWGDSQ.js +20 -0
- package/dist/{pack-A73LDVOX.js → pack-VUO4UBWL.js} +10 -14
- package/dist/{pack-A73LDVOX.js.map → pack-VUO4UBWL.js.map} +1 -1
- package/dist/plugin-L3466DHK.js +47 -0
- package/dist/plugin-from-project-U5UGKTJH.js +15 -0
- package/dist/{policy-6VY3CMSU.js → policy-Z5TL4N3V.js} +9 -12
- package/dist/{policy-6VY3CMSU.js.map → policy-Z5TL4N3V.js.map} +1 -1
- package/dist/{profile-YCKPMRRU.js → profile-QFI7SL3S.js} +108 -78
- package/dist/profile-QFI7SL3S.js.map +1 -0
- package/dist/{project-KHPPBKPN.js → project-3KR3EPYR.js} +486 -60
- package/dist/project-3KR3EPYR.js.map +1 -0
- package/dist/{resource-IJU3FAN5.js → resource-45BPRQ7V.js} +55 -45
- package/dist/resource-45BPRQ7V.js.map +1 -0
- package/dist/status-refresh-worker.js +1155 -0
- package/dist/status-refresh-worker.js.map +1 -0
- package/dist/{version-Z66FWWMQ.js → version-QUJZGTZ5.js} +3 -3
- package/dist/version-QUJZGTZ5.js.map +1 -0
- package/package.json +16 -11
- package/dist/apply-SUNDXRJ3.js +0 -54
- package/dist/chunk-2A36HWDE.js.map +0 -1
- package/dist/chunk-2H7UOFLK.js +0 -11
- package/dist/chunk-3FS775NP.js.map +0 -1
- package/dist/chunk-43BDGVN3.js.map +0 -1
- package/dist/chunk-4ZQ2SCGY.js.map +0 -1
- package/dist/chunk-6LTLYV5D.js.map +0 -1
- package/dist/chunk-D432JAXV.js.map +0 -1
- package/dist/chunk-DF4Z7LAD.js +0 -3463
- package/dist/chunk-DF4Z7LAD.js.map +0 -1
- package/dist/chunk-EOPFER6N.js.map +0 -1
- package/dist/chunk-G6WKY2W4.js +0 -389
- package/dist/chunk-G6WKY2W4.js.map +0 -1
- package/dist/chunk-IE7B6Q5K.js.map +0 -1
- package/dist/chunk-IMROMZ2K.js.map +0 -1
- package/dist/chunk-M2U3J7UX.js +0 -46
- package/dist/chunk-M2U3J7UX.js.map +0 -1
- package/dist/chunk-N3ZCH64F.js.map +0 -1
- package/dist/chunk-NAGAJ5UM.js +0 -145
- package/dist/chunk-NAGAJ5UM.js.map +0 -1
- package/dist/chunk-OML4HXKT.js.map +0 -1
- package/dist/chunk-QA5U36JN.js.map +0 -1
- package/dist/chunk-R7ZOYVN3.js.map +0 -1
- package/dist/chunk-RDG5DT7S.js.map +0 -1
- package/dist/chunk-REHRUNBB.js.map +0 -1
- package/dist/chunk-RFQ3N7FB.js.map +0 -1
- package/dist/chunk-TQ2NA4Z4.js.map +0 -1
- package/dist/chunk-ULCD6DJE.js.map +0 -1
- package/dist/chunk-WG5A6EAU.js.map +0 -1
- package/dist/chunk-XGTTOO4R.js +0 -84
- package/dist/chunk-XGTTOO4R.js.map +0 -1
- package/dist/chunk-XTVGCVU4.js.map +0 -1
- package/dist/chunk-XUJKZQZA.js +0 -235
- package/dist/chunk-XUJKZQZA.js.map +0 -1
- package/dist/chunk-ZUASVASP.js.map +0 -1
- package/dist/doctor-N7ZULPOL.js.map +0 -1
- package/dist/environment-OBB3WU5B.js.map +0 -1
- package/dist/help-VXWKLQ6A.js.map +0 -1
- package/dist/live-read-cache-TUSP7U3D.js +0 -10
- package/dist/marketplace-GXSV6QIY.js.map +0 -1
- package/dist/migrate-SBUIWN3U.js.map +0 -1
- package/dist/open-HDGLYYVU.js +0 -24
- package/dist/plugin-CEO6ZJM5.js +0 -51
- package/dist/plugin-from-project-UK7VJVUP.js +0 -18
- package/dist/profile-YCKPMRRU.js.map +0 -1
- package/dist/project-KHPPBKPN.js.map +0 -1
- package/dist/resource-IJU3FAN5.js.map +0 -1
- /package/dist/{apply-SUNDXRJ3.js.map → apply-FTAIL3X3.js.map} +0 -0
- /package/dist/{chunk-GRASK6M6.js.map → chunk-6FXJIKEG.js.map} +0 -0
- /package/dist/{chunk-73OJQTBW.js.map → chunk-A3TZT4WT.js.map} +0 -0
- /package/dist/{chunk-U6DXASQP.js.map → chunk-CBSDMRMY.js.map} +0 -0
- /package/dist/{chunk-P2C7JPLD.js.map → chunk-EPXAOEBB.js.map} +0 -0
- /package/dist/{chunk-3P6BWL5F.js.map → chunk-K4UDZUJ2.js.map} +0 -0
- /package/dist/{chunk-PNGF5EV2.js.map → chunk-MHLAIGIM.js.map} +0 -0
- /package/dist/{chunk-BPWFQKI5.js.map → chunk-MHMFF6A5.js.map} +0 -0
- /package/dist/{chunk-2H7UOFLK.js.map → chunk-MKLJBW5N.js.map} +0 -0
- /package/dist/{chunk-23XSG7LI.js.map → chunk-QGTDQNVV.js.map} +0 -0
- /package/dist/{chunk-UVVZHWD2.js.map → chunk-R27VZIF6.js.map} +0 -0
- /package/dist/{chunk-JQOKQKQT.js.map → chunk-S2D5PWAO.js.map} +0 -0
- /package/dist/{chunk-7HP6AAI3.js.map → chunk-UK2IV2ZQ.js.map} +0 -0
- /package/dist/{live-read-cache-TUSP7U3D.js.map → live-read-cache-ESQQJBNS.js.map} +0 -0
- /package/dist/{open-HDGLYYVU.js.map → live-read-cache-WPUFHVMZ.js.map} +0 -0
- /package/dist/{plugin-CEO6ZJM5.js.map → open-D3GWGDSQ.js.map} +0 -0
- /package/dist/{plugin-from-project-UK7VJVUP.js.map → plugin-L3466DHK.js.map} +0 -0
- /package/dist/{version-Z66FWWMQ.js.map → plugin-from-project-U5UGKTJH.js.map} +0 -0
|
@@ -1,6 +1,4 @@
|
|
|
1
1
|
import {
|
|
2
|
-
PluginAmbiguityError,
|
|
3
|
-
PluginResolveError,
|
|
4
2
|
configurePluginListInteractiveDeps,
|
|
5
3
|
createPluginFromSource,
|
|
6
4
|
deleteCatalogPlugin,
|
|
@@ -9,16 +7,16 @@ import {
|
|
|
9
7
|
handlePluginCatalogRegisterCommand,
|
|
10
8
|
handlePluginCatalogRegisteredCommand,
|
|
11
9
|
handlePluginCatalogUnregisterCommand,
|
|
10
|
+
handlePluginHideOptions,
|
|
12
11
|
handlePluginInstallCommand,
|
|
13
12
|
handlePluginListCommand,
|
|
14
13
|
handlePluginPublishCommand,
|
|
15
14
|
handlePluginPublishPlanCommand,
|
|
16
15
|
handlePluginShowCommand,
|
|
17
|
-
isPluginUrl,
|
|
18
16
|
resolveApplyPluginSource,
|
|
19
17
|
resolveCatalogSearchProjectRoot,
|
|
20
18
|
runPluginCreateFromSourceWizard
|
|
21
|
-
} from "./chunk-
|
|
19
|
+
} from "./chunk-5HACBPK2.js";
|
|
22
20
|
import {
|
|
23
21
|
importProjectConfigEnvironments,
|
|
24
22
|
printApplyDryRun,
|
|
@@ -29,22 +27,28 @@ import {
|
|
|
29
27
|
resolveExpectedPluginName,
|
|
30
28
|
resolveProjectProfilePluginName,
|
|
31
29
|
resolveUserPath
|
|
32
|
-
} from "./chunk-
|
|
30
|
+
} from "./chunk-D7R577XZ.js";
|
|
33
31
|
import {
|
|
34
32
|
isPluginAttachmentOnlyType,
|
|
33
|
+
marketplaceIsKnown,
|
|
35
34
|
renderResourceShow,
|
|
36
35
|
resolveResourceListType
|
|
37
|
-
} from "./chunk-
|
|
36
|
+
} from "./chunk-GZU4LVFF.js";
|
|
38
37
|
import {
|
|
39
38
|
createLocalPluginPickAdapter,
|
|
40
39
|
resolvePluginMutationTarget
|
|
41
|
-
} from "./chunk-
|
|
40
|
+
} from "./chunk-MQCAPCAF.js";
|
|
42
41
|
import {
|
|
43
42
|
resolveSkillPackageCheckout
|
|
44
|
-
} from "./chunk-
|
|
43
|
+
} from "./chunk-42E2MPES.js";
|
|
45
44
|
import {
|
|
46
45
|
readDeclaredLicense
|
|
47
46
|
} from "./chunk-CHQGE2HF.js";
|
|
47
|
+
import {
|
|
48
|
+
diagnoseParsedPackage,
|
|
49
|
+
formatResourceCounts,
|
|
50
|
+
formatSkippedEntry
|
|
51
|
+
} from "./chunk-HV3ENT2F.js";
|
|
48
52
|
import {
|
|
49
53
|
filterPluginEditRowsBySearch,
|
|
50
54
|
formatResourceSelectionLabel,
|
|
@@ -53,19 +57,19 @@ import {
|
|
|
53
57
|
renderGroupedPluginEditViewport,
|
|
54
58
|
sortResourcesByUpdatedAt,
|
|
55
59
|
toResourceListRows
|
|
56
|
-
} from "./chunk-
|
|
60
|
+
} from "./chunk-L6BJCRBU.js";
|
|
57
61
|
import {
|
|
58
62
|
openPathInSystemEditor
|
|
59
|
-
} from "./chunk-
|
|
63
|
+
} from "./chunk-MQCH3YZ5.js";
|
|
60
64
|
import {
|
|
61
65
|
validatePluginDependencyGraph
|
|
62
|
-
} from "./chunk-
|
|
66
|
+
} from "./chunk-MHLAIGIM.js";
|
|
63
67
|
import {
|
|
64
68
|
createTableBrowserPrompt
|
|
65
|
-
} from "./chunk-
|
|
69
|
+
} from "./chunk-EPXAOEBB.js";
|
|
66
70
|
import {
|
|
67
71
|
toPluginChoices
|
|
68
|
-
} from "./chunk-
|
|
72
|
+
} from "./chunk-K4UDZUJ2.js";
|
|
69
73
|
import {
|
|
70
74
|
matchesListSearchQuery,
|
|
71
75
|
parseListSearchQuery
|
|
@@ -78,37 +82,32 @@ import {
|
|
|
78
82
|
} from "./chunk-3FIWOI3H.js";
|
|
79
83
|
import {
|
|
80
84
|
renderCliError
|
|
81
|
-
} from "./chunk-
|
|
82
|
-
import {
|
|
83
|
-
isPromptCancellationError,
|
|
84
|
-
promptForChoice,
|
|
85
|
-
promptForConfirmation,
|
|
86
|
-
promptForSearchableChoice,
|
|
87
|
-
promptForValue,
|
|
88
|
-
shouldUseBrowsePicker,
|
|
89
|
-
shouldUseWizard
|
|
90
|
-
} from "./chunk-NAGAJ5UM.js";
|
|
85
|
+
} from "./chunk-CR2TYMKC.js";
|
|
91
86
|
import {
|
|
92
87
|
initializeSchema
|
|
93
|
-
} from "./chunk-
|
|
88
|
+
} from "./chunk-RQLVXJH2.js";
|
|
94
89
|
import {
|
|
95
90
|
configureCommandGroup
|
|
96
|
-
} from "./chunk-
|
|
91
|
+
} from "./chunk-T4EKNX2Q.js";
|
|
97
92
|
import {
|
|
98
|
-
|
|
99
|
-
|
|
93
|
+
handlePluginAutoUpdateCommand,
|
|
94
|
+
maybePromptKeepUpToDate
|
|
95
|
+
} from "./chunk-XNS4I3W6.js";
|
|
100
96
|
import {
|
|
101
97
|
formatPluginLabel
|
|
102
98
|
} from "./chunk-I6XFZLTJ.js";
|
|
99
|
+
import {
|
|
100
|
+
createPluginFromProject
|
|
101
|
+
} from "./chunk-MHMFF6A5.js";
|
|
103
102
|
import {
|
|
104
103
|
applyExecutableTrustGate,
|
|
105
104
|
formatApproveRemedy,
|
|
106
105
|
overlappingDeployedHashes
|
|
107
|
-
} from "./chunk-
|
|
106
|
+
} from "./chunk-QGTDQNVV.js";
|
|
108
107
|
import {
|
|
109
108
|
parseOutputFormat,
|
|
110
109
|
printJson
|
|
111
|
-
} from "./chunk-
|
|
110
|
+
} from "./chunk-R4NV3Q7G.js";
|
|
112
111
|
import {
|
|
113
112
|
ON_CONFLICT_APPLY_HELP,
|
|
114
113
|
ON_CONFLICT_PLUGIN_IMPORT_HELP,
|
|
@@ -118,20 +117,25 @@ import {
|
|
|
118
117
|
formatCommand,
|
|
119
118
|
parseOnConflict,
|
|
120
119
|
toPluginImportOnConflict
|
|
121
|
-
} from "./chunk-
|
|
120
|
+
} from "./chunk-WGVU3LA5.js";
|
|
122
121
|
import {
|
|
123
122
|
APM_MANIFEST_FILENAME,
|
|
124
123
|
ApmGitResolveError,
|
|
125
124
|
BundleSymlinkError,
|
|
126
125
|
CatalogDependencyVersionError,
|
|
127
126
|
CriticalUnicodeError,
|
|
127
|
+
InvalidGitDependencyConstraintError,
|
|
128
|
+
LocalPluginSelectorError,
|
|
128
129
|
LockIntegrityError,
|
|
129
130
|
MATERIAL_RESOURCE_TYPES,
|
|
130
131
|
PLUGIN_ATTACHMENT_TYPES,
|
|
131
132
|
PROFILE_PLUGIN_TAG,
|
|
132
133
|
PinnedPluginInstallConsentError,
|
|
134
|
+
PluginAmbiguityError,
|
|
133
135
|
PluginAttachmentHintError,
|
|
136
|
+
PluginForkError,
|
|
134
137
|
PluginProvenanceError,
|
|
138
|
+
PluginResolveError,
|
|
135
139
|
PluginVersionError,
|
|
136
140
|
PolicyError,
|
|
137
141
|
RESOURCE_TYPES,
|
|
@@ -142,6 +146,7 @@ import {
|
|
|
142
146
|
addPluginAttachment,
|
|
143
147
|
addResourceToPlugin,
|
|
144
148
|
applyCheckedPluginOrigin,
|
|
149
|
+
applyConfiguredPluginToProject,
|
|
145
150
|
assertAuthored,
|
|
146
151
|
assertCheckoutPathSafe,
|
|
147
152
|
assertContainedPath,
|
|
@@ -158,11 +163,13 @@ import {
|
|
|
158
163
|
collectPluginPinsForPrepare,
|
|
159
164
|
collectSkillMdFiles,
|
|
160
165
|
createPlugin,
|
|
166
|
+
createSnapshot,
|
|
161
167
|
cutPluginVersion,
|
|
162
168
|
deletePlugin,
|
|
163
169
|
dependenciesFromResources,
|
|
164
170
|
describeConflictSide,
|
|
165
171
|
detectPlatforms,
|
|
172
|
+
displayConstraint,
|
|
166
173
|
ensureClaudeMarketplacesFromConfig,
|
|
167
174
|
ensureCursorMarketplaces,
|
|
168
175
|
ensureMissingCatalogDependencies,
|
|
@@ -170,30 +177,39 @@ import {
|
|
|
170
177
|
ensurePluginResource,
|
|
171
178
|
evaluateApplyPolicy,
|
|
172
179
|
fetchCatalogPlugin,
|
|
173
|
-
|
|
180
|
+
findLocalPluginBySelector,
|
|
174
181
|
findProjectConfig,
|
|
182
|
+
forkPlugin,
|
|
175
183
|
formatOriginLocator,
|
|
176
184
|
formatPluginRollbackConfirmMessage,
|
|
177
185
|
formatPluginVersionLabel,
|
|
178
186
|
gateDeployFiles,
|
|
179
187
|
generateFiles,
|
|
188
|
+
getActiveProfileName,
|
|
189
|
+
getGitOrigin,
|
|
180
190
|
getPlugin,
|
|
181
191
|
getPluginById,
|
|
182
192
|
getPluginByName,
|
|
183
193
|
getPluginOrigin,
|
|
184
194
|
getPluginResources,
|
|
185
195
|
getProfileEntry,
|
|
196
|
+
getProjectByOrigin,
|
|
186
197
|
getProjectHarnessConfig,
|
|
198
|
+
gitFetchRefForPin,
|
|
187
199
|
gitOriginCacheDir,
|
|
188
200
|
hashResourceBody,
|
|
189
201
|
importApPackageFiles,
|
|
190
|
-
|
|
202
|
+
importPluginFromGitHubRef,
|
|
191
203
|
installPluginFromCatalog,
|
|
192
204
|
installPluginPinAsync,
|
|
193
205
|
isApEnvelopePath,
|
|
194
206
|
isApmVirtualFilePath,
|
|
207
|
+
isCatalogUpstreamRef,
|
|
195
208
|
isFilesystemApmDependency,
|
|
209
|
+
isGitHubPluginRef,
|
|
210
|
+
isPendingUpdate,
|
|
196
211
|
isPluginInstallRoot,
|
|
212
|
+
isPluginUrl,
|
|
197
213
|
isProfilePlugin,
|
|
198
214
|
listAttachedPluginPins,
|
|
199
215
|
listAttachedPluginRefs,
|
|
@@ -209,9 +225,12 @@ import {
|
|
|
209
225
|
lockIsUsable,
|
|
210
226
|
lockedVersionsFrom,
|
|
211
227
|
lockfileFromResolution,
|
|
228
|
+
marketplaceListsPlugin,
|
|
212
229
|
materializeFiles,
|
|
213
230
|
mergePluginsById,
|
|
231
|
+
normalizeGitUrl,
|
|
214
232
|
normalizeResourceInput,
|
|
233
|
+
notifySafely,
|
|
215
234
|
originApplyFailureRow,
|
|
216
235
|
originFailRow,
|
|
217
236
|
originSkipRow,
|
|
@@ -219,21 +238,26 @@ import {
|
|
|
219
238
|
parseApPackageFiles,
|
|
220
239
|
parseApmYamlDocument,
|
|
221
240
|
parseDependencyRef,
|
|
241
|
+
parseGitDependencyConstraint,
|
|
222
242
|
parsePluginRef,
|
|
223
243
|
parseVersionConstraint,
|
|
224
244
|
persistPluginSourceScanResults,
|
|
225
245
|
persistWrittenMaterializations,
|
|
226
|
-
pluginDescriptionFromManifest,
|
|
227
246
|
preparePluginPinsForApply,
|
|
228
247
|
printUnicodeGateWarnings,
|
|
248
|
+
projectNameFromUrl,
|
|
249
|
+
readContainedPackageFiles,
|
|
229
250
|
readLockfile,
|
|
230
251
|
readPackageRuntimeApmDependencies,
|
|
252
|
+
readUpstreamChecks,
|
|
253
|
+
recordedPluginInstallRoot,
|
|
231
254
|
recoverOriginLocator,
|
|
232
255
|
removeDependency,
|
|
233
256
|
removePluginAttachment,
|
|
234
257
|
removeResourceFromPlugin,
|
|
235
258
|
removeStaleProjectDeployedFiles,
|
|
236
259
|
resolveAndFetchApmGitDependency,
|
|
260
|
+
resolveClaudeEnabledPluginRef,
|
|
237
261
|
resolveCompileTargets,
|
|
238
262
|
resolveComposition,
|
|
239
263
|
resolveDefaultPluginInstallScope,
|
|
@@ -242,11 +266,11 @@ import {
|
|
|
242
266
|
resolvePluginInstallScope,
|
|
243
267
|
resolvePluginPackageRoot,
|
|
244
268
|
resolvePluginSelector,
|
|
269
|
+
resolveUpstreamParent,
|
|
245
270
|
rollbackPluginVersion,
|
|
246
271
|
scanPluginSource,
|
|
247
272
|
scanPluginSourceSync,
|
|
248
273
|
selectOriginUpdateTarget,
|
|
249
|
-
semverSafePluginVersion,
|
|
250
274
|
setPluginEnvironmentCommand,
|
|
251
275
|
setPluginOrigin,
|
|
252
276
|
setPluginResourceOrder,
|
|
@@ -256,6 +280,7 @@ import {
|
|
|
256
280
|
skillPlacementsFromPaths,
|
|
257
281
|
slugifyApName,
|
|
258
282
|
stampPluginOrigin,
|
|
283
|
+
substituteResourcesForApply,
|
|
259
284
|
summarizeOriginUpdate,
|
|
260
285
|
syncClaudeMarketplacePluginsAfterAdd,
|
|
261
286
|
syncPluginPinsForApply,
|
|
@@ -263,8 +288,10 @@ import {
|
|
|
263
288
|
touchPluginUpdatedAt,
|
|
264
289
|
uniqueHarnessTargets,
|
|
265
290
|
unsetPluginEnvironmentCommand,
|
|
266
|
-
|
|
291
|
+
upsertProject,
|
|
267
292
|
upsertResource,
|
|
293
|
+
upstreamRange,
|
|
294
|
+
upstreamRefBase,
|
|
268
295
|
validateApManifest,
|
|
269
296
|
validatePluginAttachmentType,
|
|
270
297
|
validatePublicOrgHasPlugins,
|
|
@@ -273,19 +300,33 @@ import {
|
|
|
273
300
|
writeApEnvelope,
|
|
274
301
|
writeApPackageFiles,
|
|
275
302
|
writeLockfile
|
|
276
|
-
} from "./chunk-
|
|
303
|
+
} from "./chunk-BUA7WFI4.js";
|
|
277
304
|
import {
|
|
278
|
-
|
|
305
|
+
catalogPluginDisplayVersion,
|
|
306
|
+
catalogPluginVersionLabel,
|
|
307
|
+
findKnownMarketplace,
|
|
308
|
+
isPromptCancellationError,
|
|
279
309
|
marketplaceCacheDir,
|
|
310
|
+
parseFrontmatter,
|
|
311
|
+
promptForChoice,
|
|
312
|
+
promptForConfirmation,
|
|
313
|
+
promptForSearchableChoice,
|
|
314
|
+
promptForValue,
|
|
315
|
+
refreshGitSource,
|
|
280
316
|
refreshMarketplaceCatalog,
|
|
281
|
-
|
|
282
|
-
|
|
317
|
+
resolveHomeRoot,
|
|
318
|
+
searchCatalogPlugins,
|
|
319
|
+
shouldUseBrowsePicker,
|
|
320
|
+
shouldUseWizard
|
|
321
|
+
} from "./chunk-UC27MQ3T.js";
|
|
283
322
|
import {
|
|
284
323
|
DEFAULT_CATALOG_ORG_SLUG,
|
|
324
|
+
cloudFetch,
|
|
285
325
|
connectCatalogOrg,
|
|
286
326
|
connectCatalogPlugin,
|
|
287
327
|
disconnectCatalogOrg,
|
|
288
328
|
disconnectCatalogPlugin,
|
|
329
|
+
ensureCloudAccountAccess,
|
|
289
330
|
formatCatalogScopeLabel,
|
|
290
331
|
loadCatalogSettings,
|
|
291
332
|
loadRegisteredCatalogs,
|
|
@@ -293,97 +334,69 @@ import {
|
|
|
293
334
|
resolveRemotePluginSelector,
|
|
294
335
|
trackPluginApplied,
|
|
295
336
|
trackPluginInstalled
|
|
296
|
-
} from "./chunk-
|
|
297
|
-
import {
|
|
298
|
-
CliUsageError,
|
|
299
|
-
conflictingOptions,
|
|
300
|
-
createProgress,
|
|
301
|
-
missingRequiredArg,
|
|
302
|
-
theme,
|
|
303
|
-
ui
|
|
304
|
-
} from "./chunk-2A36HWDE.js";
|
|
305
|
-
import {
|
|
306
|
-
applyConfiguredPluginToProject,
|
|
307
|
-
createSnapshot,
|
|
308
|
-
getActiveProfileName,
|
|
309
|
-
getGitOrigin,
|
|
310
|
-
getProjectByOrigin,
|
|
311
|
-
normalizeGitUrl,
|
|
312
|
-
projectNameFromUrl,
|
|
313
|
-
resolveClaudeEnabledPluginRef,
|
|
314
|
-
resolveHomeRoot,
|
|
315
|
-
substituteResourcesForApply,
|
|
316
|
-
upsertProject
|
|
317
|
-
} from "./chunk-DF4Z7LAD.js";
|
|
318
|
-
import {
|
|
319
|
-
refreshGitSource
|
|
320
|
-
} from "./chunk-G6WKY2W4.js";
|
|
337
|
+
} from "./chunk-V4UNYSZO.js";
|
|
321
338
|
import {
|
|
322
339
|
CLI_ERRORS,
|
|
323
340
|
CLI_HINTS,
|
|
341
|
+
CliUsageError,
|
|
324
342
|
applyCancelledMessage,
|
|
343
|
+
conflictingOptions,
|
|
344
|
+
createProgress,
|
|
325
345
|
fetchWithTimeout,
|
|
326
346
|
formatCatalogRequestError,
|
|
327
347
|
formatCount,
|
|
328
348
|
getDb,
|
|
329
|
-
getHarnesstapDir
|
|
330
|
-
|
|
349
|
+
getHarnesstapDir,
|
|
350
|
+
missingRequiredArg,
|
|
351
|
+
theme,
|
|
352
|
+
ui
|
|
353
|
+
} from "./chunk-OHZNDV4A.js";
|
|
331
354
|
|
|
332
355
|
// src/cli/commands/plugin.ts
|
|
333
356
|
import { Option as Option2 } from "commander";
|
|
334
|
-
import { readFileSync as
|
|
357
|
+
import { readFileSync as readFileSync4 } from "fs";
|
|
335
358
|
|
|
336
359
|
// src/cli/handlers/plugin-fork.ts
|
|
337
360
|
function handlePluginForkCommand(selector, opts = {}) {
|
|
338
361
|
const db = getDb();
|
|
339
362
|
initializeSchema(db);
|
|
340
363
|
const format = parseOutputFormat(opts.format);
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
return;
|
|
346
|
-
}
|
|
347
|
-
if (getPluginOrigin(source.id) === "authored") {
|
|
348
|
-
process.exitCode = 1;
|
|
349
|
-
ui.danger(`${source.name} is already authored; there is nothing to fork.`, {
|
|
350
|
-
hints: [`ht plugin edit ${source.name}`]
|
|
351
|
-
});
|
|
352
|
-
return;
|
|
353
|
-
}
|
|
354
|
-
const name = opts.as ?? `${source.name}-fork`;
|
|
355
|
-
if (getPluginByName(name)) {
|
|
364
|
+
let result;
|
|
365
|
+
try {
|
|
366
|
+
result = forkPlugin(selector, opts.as);
|
|
367
|
+
} catch (error) {
|
|
356
368
|
process.exitCode = 1;
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
369
|
+
if (error instanceof PluginForkError) {
|
|
370
|
+
const sourceName = error.sourceName ?? selector;
|
|
371
|
+
if (error.code === "already_authored") {
|
|
372
|
+
ui.danger(error.message, { hints: [formatCommand(["plugin", "edit", sourceName])] });
|
|
373
|
+
return;
|
|
374
|
+
}
|
|
375
|
+
if (error.code === "plugin_exists") {
|
|
376
|
+
ui.danger(error.message, {
|
|
377
|
+
hints: [`${formatCommand(["plugin", "fork", sourceName])} --as <name>`]
|
|
378
|
+
});
|
|
379
|
+
return;
|
|
380
|
+
}
|
|
381
|
+
}
|
|
382
|
+
ui.danger(error instanceof Error ? error.message : String(error));
|
|
360
383
|
return;
|
|
361
384
|
}
|
|
362
|
-
const
|
|
363
|
-
name,
|
|
364
|
-
version: source.version,
|
|
365
|
-
description: source.description || `Fork of ${source.name}@${source.version}`,
|
|
366
|
-
tags: source.tags,
|
|
367
|
-
...source.claude ? { claude: source.claude } : {},
|
|
368
|
-
...source.needs ? { needs: source.needs } : {},
|
|
369
|
-
origin: "authored"
|
|
370
|
-
});
|
|
371
|
-
for (const resource of getPluginResources(source.id)) {
|
|
372
|
-
addResourceToPlugin(fork.id, resource.id);
|
|
373
|
-
}
|
|
385
|
+
const { plugin, source, forked_from, upstream } = result;
|
|
374
386
|
if (format === "json") {
|
|
375
387
|
printJson({
|
|
376
|
-
name:
|
|
377
|
-
version:
|
|
388
|
+
name: plugin.name,
|
|
389
|
+
version: plugin.version,
|
|
378
390
|
origin: "authored",
|
|
379
|
-
forked_from
|
|
391
|
+
forked_from,
|
|
392
|
+
upstream
|
|
380
393
|
});
|
|
381
394
|
return;
|
|
382
395
|
}
|
|
383
396
|
ui.success(
|
|
384
|
-
`Forked ${source.name}@${source.version} into ${ui.theme.accent(
|
|
397
|
+
`Forked ${source.name}@${source.version} into ${ui.theme.accent(plugin.name)}`
|
|
385
398
|
);
|
|
386
|
-
ui.hint(
|
|
399
|
+
ui.hint(formatCommand(["plugin", "edit", plugin.name]));
|
|
387
400
|
}
|
|
388
401
|
|
|
389
402
|
// src/services/plugin-origin-update.ts
|
|
@@ -650,11 +663,15 @@ async function checkPluginOrigins(opts) {
|
|
|
650
663
|
marketplaceFetches.set(name, pending);
|
|
651
664
|
return pending;
|
|
652
665
|
};
|
|
653
|
-
const fetchGit = (url) => {
|
|
654
|
-
const
|
|
666
|
+
const fetchGit = (url, pinnedRef) => {
|
|
667
|
+
const key = pinnedRef ? `${url}#${pinnedRef}` : url;
|
|
668
|
+
const existing = gitFetches.get(key);
|
|
655
669
|
if (existing) return existing;
|
|
656
670
|
const targetDir = gitOriginCacheDir(harnesstapDir, url);
|
|
657
|
-
const pending = Promise.resolve().then(
|
|
671
|
+
const pending = Promise.resolve().then(async () => {
|
|
672
|
+
const { fetchRef } = await gitFetchRefForPin(url, pinnedRef, opts?.deps?.resolveSemverTag);
|
|
673
|
+
return refreshGit({ url, targetDir, ...fetchRef ? { ref: fetchRef } : {} });
|
|
674
|
+
}).catch((error) => ({
|
|
658
675
|
ok: false,
|
|
659
676
|
message: thrownErrorMessage(error)
|
|
660
677
|
}));
|
|
@@ -678,7 +695,7 @@ async function checkPluginOrigins(opts) {
|
|
|
678
695
|
break;
|
|
679
696
|
}
|
|
680
697
|
case "git": {
|
|
681
|
-
const fetched = await fetchGit(locator.url);
|
|
698
|
+
const fetched = await fetchGit(locator.url, locator.ref);
|
|
682
699
|
targetRow = await compareGitSha(
|
|
683
700
|
target,
|
|
684
701
|
locatorStr,
|
|
@@ -800,6 +817,431 @@ async function updatePluginOrigins(opts) {
|
|
|
800
817
|
return { results, summary: summarizeOriginUpdate(results) };
|
|
801
818
|
}
|
|
802
819
|
|
|
820
|
+
// src/services/upstream-update-lock.ts
|
|
821
|
+
import { closeSync, mkdirSync, openSync, readFileSync, unlinkSync, writeSync } from "fs";
|
|
822
|
+
import { join as join2 } from "path";
|
|
823
|
+
var UPSTREAM_UPDATE_LOCK_FILE = "upstream-update.lock";
|
|
824
|
+
var UpstreamUpdateLockBusyError = class extends Error {
|
|
825
|
+
lockPath;
|
|
826
|
+
constructor(lockPath) {
|
|
827
|
+
super(`Another plugin update is in progress (${lockPath}). Try again when it finishes.`);
|
|
828
|
+
this.name = "UpstreamUpdateLockBusyError";
|
|
829
|
+
this.lockPath = lockPath;
|
|
830
|
+
}
|
|
831
|
+
};
|
|
832
|
+
function upstreamUpdateLockPath() {
|
|
833
|
+
return join2(getHarnesstapDir(), UPSTREAM_UPDATE_LOCK_FILE);
|
|
834
|
+
}
|
|
835
|
+
var depth = 0;
|
|
836
|
+
var heldFd;
|
|
837
|
+
function pidAlive(pid) {
|
|
838
|
+
try {
|
|
839
|
+
process.kill(pid, 0);
|
|
840
|
+
return true;
|
|
841
|
+
} catch (error) {
|
|
842
|
+
return error.code === "EPERM";
|
|
843
|
+
}
|
|
844
|
+
}
|
|
845
|
+
function clearIfStale(lockPath) {
|
|
846
|
+
let pid;
|
|
847
|
+
try {
|
|
848
|
+
pid = Number.parseInt(readFileSync(lockPath, "utf8").trim(), 10);
|
|
849
|
+
} catch {
|
|
850
|
+
return false;
|
|
851
|
+
}
|
|
852
|
+
if (!Number.isInteger(pid) || pid <= 0 || pid === process.pid || pidAlive(pid)) return false;
|
|
853
|
+
try {
|
|
854
|
+
unlinkSync(lockPath);
|
|
855
|
+
return true;
|
|
856
|
+
} catch {
|
|
857
|
+
return false;
|
|
858
|
+
}
|
|
859
|
+
}
|
|
860
|
+
function tryAcquire(lockPath) {
|
|
861
|
+
try {
|
|
862
|
+
heldFd = openSync(lockPath, "wx");
|
|
863
|
+
writeSync(heldFd, `${process.pid}
|
|
864
|
+
`);
|
|
865
|
+
return true;
|
|
866
|
+
} catch (error) {
|
|
867
|
+
if (error.code !== "EEXIST") throw error;
|
|
868
|
+
return clearIfStale(lockPath) ? tryAcquire(lockPath) : false;
|
|
869
|
+
}
|
|
870
|
+
}
|
|
871
|
+
function release(lockPath) {
|
|
872
|
+
depth -= 1;
|
|
873
|
+
if (depth > 0) return;
|
|
874
|
+
const fd = heldFd;
|
|
875
|
+
heldFd = void 0;
|
|
876
|
+
if (fd === void 0) return;
|
|
877
|
+
try {
|
|
878
|
+
closeSync(fd);
|
|
879
|
+
} finally {
|
|
880
|
+
try {
|
|
881
|
+
unlinkSync(lockPath);
|
|
882
|
+
} catch {
|
|
883
|
+
}
|
|
884
|
+
}
|
|
885
|
+
}
|
|
886
|
+
async function withUpstreamUpdateLock(fn, opts) {
|
|
887
|
+
const lockPath = upstreamUpdateLockPath();
|
|
888
|
+
if (depth > 0) {
|
|
889
|
+
depth += 1;
|
|
890
|
+
try {
|
|
891
|
+
return await fn();
|
|
892
|
+
} finally {
|
|
893
|
+
release(lockPath);
|
|
894
|
+
}
|
|
895
|
+
}
|
|
896
|
+
mkdirSync(getHarnesstapDir(), { recursive: true });
|
|
897
|
+
const waitMs = opts?.waitMs ?? 0;
|
|
898
|
+
const pollMs = opts?.pollMs ?? 250;
|
|
899
|
+
const deadline = Date.now() + waitMs;
|
|
900
|
+
let announced = false;
|
|
901
|
+
while (!tryAcquire(lockPath)) {
|
|
902
|
+
if (Date.now() >= deadline) throw new UpstreamUpdateLockBusyError(lockPath);
|
|
903
|
+
if (!announced) {
|
|
904
|
+
announced = true;
|
|
905
|
+
opts?.onWait?.();
|
|
906
|
+
}
|
|
907
|
+
await new Promise((resolve5) => setTimeout(resolve5, pollMs));
|
|
908
|
+
}
|
|
909
|
+
depth = 1;
|
|
910
|
+
try {
|
|
911
|
+
return await fn();
|
|
912
|
+
} finally {
|
|
913
|
+
release(lockPath);
|
|
914
|
+
}
|
|
915
|
+
}
|
|
916
|
+
|
|
917
|
+
// src/services/upstream-check.ts
|
|
918
|
+
import { mkdirSync as mkdirSync2, readFileSync as readFileSync2, writeFileSync } from "fs";
|
|
919
|
+
import { dirname, join as join3 } from "path";
|
|
920
|
+
import semver from "semver";
|
|
921
|
+
var UPDATES_SINCE_BATCH = 100;
|
|
922
|
+
function catalogBaseOf(plugin) {
|
|
923
|
+
const locator = plugin.origin_locator ?? "";
|
|
924
|
+
const base = upstreamRefBase(locator);
|
|
925
|
+
return base.split("/").length === 3 ? base : void 0;
|
|
926
|
+
}
|
|
927
|
+
function listUpstreamTargets() {
|
|
928
|
+
const byKey = /* @__PURE__ */ new Map();
|
|
929
|
+
const put = (target) => {
|
|
930
|
+
const key = `${target.plugin_name}\0${target.kind === "catalog" ? upstreamRefBase(target.ref) : target.ref}`;
|
|
931
|
+
const existing = byKey.get(key);
|
|
932
|
+
if (!existing || semver.valid(target.local_version) && semver.valid(existing.local_version) && semver.gt(target.local_version, existing.local_version)) {
|
|
933
|
+
byKey.set(key, target);
|
|
934
|
+
}
|
|
935
|
+
};
|
|
936
|
+
for (const plugin of listPlugins()) {
|
|
937
|
+
if (plugin.frozen_at) continue;
|
|
938
|
+
if (plugin.upstream) {
|
|
939
|
+
const parent = plugin.upstream.kind === "extends" ? resolveUpstreamParent(plugin) : void 0;
|
|
940
|
+
put({
|
|
941
|
+
plugin_name: plugin.name,
|
|
942
|
+
ref: plugin.upstream.ref,
|
|
943
|
+
local_version: parent?.version ?? plugin.upstream.version_at_link,
|
|
944
|
+
kind: plugin.upstream.kind
|
|
945
|
+
});
|
|
946
|
+
continue;
|
|
947
|
+
}
|
|
948
|
+
if (plugin.origin === "catalog") {
|
|
949
|
+
const base = catalogBaseOf(plugin);
|
|
950
|
+
if (!base || !semver.valid(plugin.version)) continue;
|
|
951
|
+
put({
|
|
952
|
+
plugin_name: plugin.name,
|
|
953
|
+
ref: `${base}@${upstreamRange(plugin.version)}`,
|
|
954
|
+
local_version: plugin.version,
|
|
955
|
+
kind: "catalog"
|
|
956
|
+
});
|
|
957
|
+
}
|
|
958
|
+
}
|
|
959
|
+
return [...byKey.values()].sort(
|
|
960
|
+
(a, b) => a.plugin_name.localeCompare(b.plugin_name) || a.ref.localeCompare(b.ref)
|
|
961
|
+
);
|
|
962
|
+
}
|
|
963
|
+
function upstreamRefRange(ref) {
|
|
964
|
+
const at = ref.lastIndexOf("@");
|
|
965
|
+
const range = at > 0 ? ref.slice(at + 1) : "*";
|
|
966
|
+
return semver.validRange(range) ? range : "*";
|
|
967
|
+
}
|
|
968
|
+
function pickLatest(versions, range) {
|
|
969
|
+
const valid = versions.filter((version) => semver.valid(version));
|
|
970
|
+
const inRange = semver.maxSatisfying(valid, range) ?? "";
|
|
971
|
+
const floor = semver.minVersion(range)?.version;
|
|
972
|
+
const above = valid.filter(
|
|
973
|
+
(version) => !semver.satisfies(version, range) && (!floor || semver.gt(version, floor))
|
|
974
|
+
);
|
|
975
|
+
const major = above.length > 0 ? semver.rsort([...above])[0] ?? "" : "";
|
|
976
|
+
return { latest_in_range: inRange, latest_major: major };
|
|
977
|
+
}
|
|
978
|
+
function classifyUpstream(localVersion, latest) {
|
|
979
|
+
if (!latest.ok) {
|
|
980
|
+
return { status: latest.status, latest_in_range: "", latest_major: "", message: latest.message };
|
|
981
|
+
}
|
|
982
|
+
const { latest_in_range, latest_major } = latest;
|
|
983
|
+
const newer = (candidate) => Boolean(candidate) && (!semver.valid(localVersion) || semver.valid(candidate) !== null && semver.gt(candidate, localVersion));
|
|
984
|
+
if (newer(latest_in_range)) return { status: "update", latest_in_range, latest_major, message: "" };
|
|
985
|
+
if (newer(latest_major)) return { status: "major", latest_in_range, latest_major, message: "" };
|
|
986
|
+
return { status: "current", latest_in_range, latest_major, message: "" };
|
|
987
|
+
}
|
|
988
|
+
function localLatest(ref) {
|
|
989
|
+
const name = upstreamRefBase(ref);
|
|
990
|
+
const versions = listPlugins().filter((plugin) => plugin.name === name).map((plugin) => plugin.version);
|
|
991
|
+
if (versions.length === 0) {
|
|
992
|
+
return { ok: false, status: "unpublished", message: `${name} is not in the Library.` };
|
|
993
|
+
}
|
|
994
|
+
return { ok: true, ...pickLatest(versions, upstreamRefRange(ref)) };
|
|
995
|
+
}
|
|
996
|
+
var UPDATES_SINCE_MISSING = /* @__PURE__ */ new Set([404, 405, 501]);
|
|
997
|
+
function upstreamQueryKey(item) {
|
|
998
|
+
return `${item.base}@${item.range}`;
|
|
999
|
+
}
|
|
1000
|
+
var UPDATES_SINCE_CACHE_FILE = "updates-since.json";
|
|
1001
|
+
var UPDATES_SINCE_CACHE_KEEP = 20;
|
|
1002
|
+
function updatesSinceCachePath() {
|
|
1003
|
+
return join3(getHarnesstapDir(), "cache", UPDATES_SINCE_CACHE_FILE);
|
|
1004
|
+
}
|
|
1005
|
+
function readUpdatesSinceCache() {
|
|
1006
|
+
try {
|
|
1007
|
+
const parsed = JSON.parse(readFileSync2(updatesSinceCachePath(), "utf8"));
|
|
1008
|
+
return parsed && typeof parsed === "object" && !Array.isArray(parsed) ? parsed : {};
|
|
1009
|
+
} catch {
|
|
1010
|
+
return {};
|
|
1011
|
+
}
|
|
1012
|
+
}
|
|
1013
|
+
function writeUpdatesSinceCache(cache) {
|
|
1014
|
+
try {
|
|
1015
|
+
const keys = Object.keys(cache);
|
|
1016
|
+
const trimmed = {};
|
|
1017
|
+
for (const key of keys.slice(-UPDATES_SINCE_CACHE_KEEP)) trimmed[key] = cache[key];
|
|
1018
|
+
mkdirSync2(dirname(updatesSinceCachePath()), { recursive: true });
|
|
1019
|
+
writeFileSync(updatesSinceCachePath(), JSON.stringify(trimmed));
|
|
1020
|
+
} catch {
|
|
1021
|
+
}
|
|
1022
|
+
}
|
|
1023
|
+
function latestFromUpdatesSince(item, row) {
|
|
1024
|
+
if (!row) return { ok: false, status: "unpublished", message: `${item.base} is not published.` };
|
|
1025
|
+
const inRange = row.latest_in_range_yanked ? "" : row.latest_in_range ?? "";
|
|
1026
|
+
return { ok: true, latest_in_range: inRange, latest_major: row.latest_major ?? "" };
|
|
1027
|
+
}
|
|
1028
|
+
var defaultFetchUpstreamLatest = async (items, opts) => {
|
|
1029
|
+
const out = /* @__PURE__ */ new Map();
|
|
1030
|
+
if (items.length === 0) return out;
|
|
1031
|
+
const root = resolveCatalogScope().cloudBaseUrl.replace(/\/+$/, "");
|
|
1032
|
+
let token;
|
|
1033
|
+
try {
|
|
1034
|
+
token = (await ensureCloudAccountAccess())?.accessToken;
|
|
1035
|
+
} catch {
|
|
1036
|
+
token = void 0;
|
|
1037
|
+
}
|
|
1038
|
+
const cache = readUpdatesSinceCache();
|
|
1039
|
+
let cacheChanged = false;
|
|
1040
|
+
for (let start = 0; start < items.length; start += UPDATES_SINCE_BATCH) {
|
|
1041
|
+
const batch = items.slice(start, start + UPDATES_SINCE_BATCH);
|
|
1042
|
+
const body = JSON.stringify({
|
|
1043
|
+
selectors: batch.map((item) => ({ ref: item.base, version: item.version, constraint: item.range }))
|
|
1044
|
+
});
|
|
1045
|
+
const cacheKey = `${root}
|
|
1046
|
+
${token ? "auth" : "public"}
|
|
1047
|
+
${body}`;
|
|
1048
|
+
const cached = cache[cacheKey];
|
|
1049
|
+
let response;
|
|
1050
|
+
try {
|
|
1051
|
+
response = await cloudFetch(`${root}/api/catalog/updates-since`, {
|
|
1052
|
+
method: "POST",
|
|
1053
|
+
headers: {
|
|
1054
|
+
"content-type": "application/json",
|
|
1055
|
+
...token ? { authorization: `Bearer ${token}` } : {},
|
|
1056
|
+
...cached?.etag ? { "if-none-match": cached.etag } : {}
|
|
1057
|
+
},
|
|
1058
|
+
body,
|
|
1059
|
+
...opts.signal ? { signal: opts.signal } : {}
|
|
1060
|
+
});
|
|
1061
|
+
} catch (error) {
|
|
1062
|
+
for (const item of batch) {
|
|
1063
|
+
out.set(upstreamQueryKey(item), { ok: false, status: "unreachable", message: formatCatalogRequestError(error) });
|
|
1064
|
+
}
|
|
1065
|
+
continue;
|
|
1066
|
+
}
|
|
1067
|
+
const failure = response.ok || response.status === 304 ? void 0 : await readCloudError(response);
|
|
1068
|
+
if (failure && UPDATES_SINCE_MISSING.has(response.status) && !failure.code) {
|
|
1069
|
+
for (const item of batch) out.set(upstreamQueryKey(item), await latestFromCatalogList(item));
|
|
1070
|
+
continue;
|
|
1071
|
+
}
|
|
1072
|
+
let rows;
|
|
1073
|
+
if (response.status === 304 && cached) {
|
|
1074
|
+
rows = cached.items;
|
|
1075
|
+
} else if (response.ok) {
|
|
1076
|
+
const parsed = await response.json().catch(() => ({}));
|
|
1077
|
+
rows = Array.isArray(parsed.items) ? parsed.items : [];
|
|
1078
|
+
const etag = response.headers.get("etag");
|
|
1079
|
+
if (etag) {
|
|
1080
|
+
delete cache[cacheKey];
|
|
1081
|
+
cache[cacheKey] = { etag, items: rows };
|
|
1082
|
+
cacheChanged = true;
|
|
1083
|
+
}
|
|
1084
|
+
} else {
|
|
1085
|
+
const detail = describeCloudError(response.status, failure ?? {});
|
|
1086
|
+
for (const item of batch) {
|
|
1087
|
+
out.set(upstreamQueryKey(item), { ok: false, status: "unreachable", message: detail });
|
|
1088
|
+
}
|
|
1089
|
+
continue;
|
|
1090
|
+
}
|
|
1091
|
+
for (const item of batch) {
|
|
1092
|
+
const row = rows.find((candidate) => candidate.ref === item.base && candidate.constraint === item.range) ?? rows.find((candidate) => candidate.ref === item.base && candidate.constraint === void 0);
|
|
1093
|
+
out.set(upstreamQueryKey(item), latestFromUpdatesSince(item, row));
|
|
1094
|
+
}
|
|
1095
|
+
}
|
|
1096
|
+
if (cacheChanged) writeUpdatesSinceCache(cache);
|
|
1097
|
+
return out;
|
|
1098
|
+
};
|
|
1099
|
+
function nonEmpty(value) {
|
|
1100
|
+
return typeof value === "string" && value.length > 0 ? value : void 0;
|
|
1101
|
+
}
|
|
1102
|
+
function parseCloudError(body, headers) {
|
|
1103
|
+
const top = body && typeof body === "object" ? body : {};
|
|
1104
|
+
const nested = top.error && typeof top.error === "object" ? top.error : {};
|
|
1105
|
+
return {
|
|
1106
|
+
code: nonEmpty(nested.code) ?? nonEmpty(top.error) ?? nonEmpty(top.code),
|
|
1107
|
+
message: nonEmpty(nested.message) ?? nonEmpty(top.message),
|
|
1108
|
+
requestId: nonEmpty(nested.requestId) ?? nonEmpty(top.requestId) ?? nonEmpty(headers?.get("x-request-id") ?? void 0)
|
|
1109
|
+
};
|
|
1110
|
+
}
|
|
1111
|
+
async function readCloudError(response) {
|
|
1112
|
+
const text = await response.text().catch(() => "");
|
|
1113
|
+
let body;
|
|
1114
|
+
try {
|
|
1115
|
+
body = text.trim() ? JSON.parse(text) : void 0;
|
|
1116
|
+
} catch {
|
|
1117
|
+
body = void 0;
|
|
1118
|
+
}
|
|
1119
|
+
return parseCloudError(body, response.headers);
|
|
1120
|
+
}
|
|
1121
|
+
function describeCloudError(status, info) {
|
|
1122
|
+
const request = info.requestId ? ` (request ${info.requestId})` : "";
|
|
1123
|
+
if (info.code === "catalog_not_found") {
|
|
1124
|
+
return `Cloud could not find the catalog for this check${info.message ? `: ${info.message}` : "."}${request}`;
|
|
1125
|
+
}
|
|
1126
|
+
if (info.code === "not_found") {
|
|
1127
|
+
return `Cloud could not find what this check asked for${info.message ? `: ${info.message}` : "."}${request}`;
|
|
1128
|
+
}
|
|
1129
|
+
return [`Cloud answered ${status}`, info.message ?? info.code ?? ""].filter(Boolean).join(" ") + request;
|
|
1130
|
+
}
|
|
1131
|
+
var upstreamCheckDeps = {
|
|
1132
|
+
fetchLatest: defaultFetchUpstreamLatest
|
|
1133
|
+
};
|
|
1134
|
+
async function latestFromCatalogList(item) {
|
|
1135
|
+
const [org = "", catalog = "", slug = ""] = item.base.split("/");
|
|
1136
|
+
try {
|
|
1137
|
+
const plugin = await fetchCatalogPlugin({ orgSlug: org, catalogSlug: catalog, slug });
|
|
1138
|
+
if (!plugin.latestVersion) {
|
|
1139
|
+
return { ok: false, status: "unpublished", message: `${item.base} has no published version.` };
|
|
1140
|
+
}
|
|
1141
|
+
return { ok: true, ...pickLatest([plugin.latestVersion], item.range) };
|
|
1142
|
+
} catch (error) {
|
|
1143
|
+
const message = formatCatalogRequestError(error);
|
|
1144
|
+
return /not found/i.test(message) ? { ok: false, status: "unpublished", message: `${item.base} is not published.` } : { ok: false, status: "unreachable", message };
|
|
1145
|
+
}
|
|
1146
|
+
}
|
|
1147
|
+
async function runUpstreamCheck(opts) {
|
|
1148
|
+
const all = listUpstreamTargets();
|
|
1149
|
+
const targets = opts?.name ? all.filter((target) => target.plugin_name === opts.name) : all;
|
|
1150
|
+
const catalogQueries = /* @__PURE__ */ new Map();
|
|
1151
|
+
for (const target of targets) {
|
|
1152
|
+
if (!isCatalogUpstreamRef(target.ref)) continue;
|
|
1153
|
+
const base = upstreamRefBase(target.ref);
|
|
1154
|
+
const query = { base, version: target.local_version, range: upstreamRefRange(target.ref) };
|
|
1155
|
+
catalogQueries.set(upstreamQueryKey(query), query);
|
|
1156
|
+
}
|
|
1157
|
+
const fetchLatest = opts?.fetchLatest ?? upstreamCheckDeps.fetchLatest;
|
|
1158
|
+
const latestByBase = await fetchLatest([...catalogQueries.values()], { signal: opts?.signal });
|
|
1159
|
+
const checkedAt = (opts?.now?.() ?? /* @__PURE__ */ new Date()).toISOString();
|
|
1160
|
+
const computed = targets.map((target) => {
|
|
1161
|
+
const base = upstreamRefBase(target.ref);
|
|
1162
|
+
const latest = isCatalogUpstreamRef(target.ref) ? latestByBase.get(upstreamQueryKey({ base, range: upstreamRefRange(target.ref) })) ?? latestByBase.get(base) ?? { ok: false, status: "unreachable", message: "No answer for this ref." } : localLatest(target.ref);
|
|
1163
|
+
const known = isCatalogUpstreamRef(target.ref) && latest.ok ? { ok: true, ...narrowToRange(latest, upstreamRefRange(target.ref)) } : latest;
|
|
1164
|
+
return {
|
|
1165
|
+
plugin_name: target.plugin_name,
|
|
1166
|
+
ref: target.ref,
|
|
1167
|
+
local_version: target.local_version,
|
|
1168
|
+
checked_at: checkedAt,
|
|
1169
|
+
...classifyUpstream(target.local_version, known)
|
|
1170
|
+
};
|
|
1171
|
+
});
|
|
1172
|
+
const db = getDb();
|
|
1173
|
+
const previous = new Map(
|
|
1174
|
+
readUpstreamChecks().map((row) => [`${row.plugin_name}\0${row.ref}`, row.local_version])
|
|
1175
|
+
);
|
|
1176
|
+
const upsert = db.prepare(
|
|
1177
|
+
`INSERT INTO upstream_checks
|
|
1178
|
+
(plugin_name, ref, local_version, latest_in_range, latest_major, status, checked_at, message)
|
|
1179
|
+
VALUES (?, ?, ?, ?, ?, ?, ?, ?)
|
|
1180
|
+
ON CONFLICT(plugin_name, ref) DO UPDATE SET
|
|
1181
|
+
local_version = excluded.local_version,
|
|
1182
|
+
latest_in_range = excluded.latest_in_range,
|
|
1183
|
+
latest_major = excluded.latest_major,
|
|
1184
|
+
status = excluded.status,
|
|
1185
|
+
checked_at = excluded.checked_at,
|
|
1186
|
+
message = excluded.message`
|
|
1187
|
+
);
|
|
1188
|
+
db.transaction(() => {
|
|
1189
|
+
for (const row of computed) {
|
|
1190
|
+
upsert.run(
|
|
1191
|
+
row.plugin_name,
|
|
1192
|
+
row.ref,
|
|
1193
|
+
row.local_version,
|
|
1194
|
+
row.latest_in_range,
|
|
1195
|
+
row.latest_major,
|
|
1196
|
+
row.status,
|
|
1197
|
+
row.checked_at,
|
|
1198
|
+
row.message
|
|
1199
|
+
);
|
|
1200
|
+
}
|
|
1201
|
+
if (!opts?.name) {
|
|
1202
|
+
const keep = new Set(computed.map((row) => `${row.plugin_name}\0${row.ref}`));
|
|
1203
|
+
const stale = db.prepare("SELECT plugin_name, ref FROM upstream_checks").all().filter((row) => !keep.has(`${row.plugin_name}\0${row.ref}`));
|
|
1204
|
+
const drop = db.prepare("DELETE FROM upstream_checks WHERE plugin_name = ? AND ref = ?");
|
|
1205
|
+
for (const row of stale) drop.run(row.plugin_name, row.ref);
|
|
1206
|
+
}
|
|
1207
|
+
})();
|
|
1208
|
+
const rows = readUpstreamChecks().filter(
|
|
1209
|
+
(row) => !opts?.name || row.plugin_name === opts.name
|
|
1210
|
+
);
|
|
1211
|
+
notifyUpstreamUpdates(rows, new Map(targets.map((target) => [`${target.plugin_name}\0${target.ref}`, target.kind])), previous);
|
|
1212
|
+
return { checked_at: checkedAt, rows };
|
|
1213
|
+
}
|
|
1214
|
+
function notifyUpstreamUpdates(rows, kinds, previous) {
|
|
1215
|
+
for (const row of rows) {
|
|
1216
|
+
const key = `${row.plugin_name}\0${row.ref}`;
|
|
1217
|
+
const before = previous.get(key);
|
|
1218
|
+
if (kinds.get(key) === "extends" && before && semver.valid(before) && semver.valid(row.local_version) && semver.gt(row.local_version, before)) {
|
|
1219
|
+
notifySafely({
|
|
1220
|
+
kind: "parent_published",
|
|
1221
|
+
plugin_name: row.plugin_name,
|
|
1222
|
+
title: `${row.plugin_name} now uses ${row.local_version}`,
|
|
1223
|
+
body: `Synced from ${upstreamRefBase(row.ref)} (was ${before}).`,
|
|
1224
|
+
payload: { version: row.local_version, ref: row.ref, from: before, major: false }
|
|
1225
|
+
});
|
|
1226
|
+
}
|
|
1227
|
+
if (!isPendingUpdate(row)) continue;
|
|
1228
|
+
const major = row.status === "major";
|
|
1229
|
+
const version = major ? row.latest_major : row.latest_in_range;
|
|
1230
|
+
const parent = kinds.get(`${row.plugin_name}\0${row.ref}`) === "extends";
|
|
1231
|
+
const source = upstreamRefBase(row.ref);
|
|
1232
|
+
notifySafely({
|
|
1233
|
+
kind: parent ? "parent_published" : "update_available",
|
|
1234
|
+
plugin_name: row.plugin_name,
|
|
1235
|
+
title: parent ? `${source} published ${version}` : `${row.plugin_name} ${version} is available`,
|
|
1236
|
+
body: major ? `Major update, needs your OK. You have ${row.local_version}.` : `You have ${row.local_version}.`,
|
|
1237
|
+
payload: { version, ref: row.ref, from: row.local_version, major }
|
|
1238
|
+
});
|
|
1239
|
+
}
|
|
1240
|
+
}
|
|
1241
|
+
function narrowToRange(latest, range) {
|
|
1242
|
+
return pickLatest([latest.latest_in_range, latest.latest_major].filter(Boolean), range);
|
|
1243
|
+
}
|
|
1244
|
+
|
|
803
1245
|
// src/cli/handlers/plugin-origin-update.ts
|
|
804
1246
|
function originUpdateConfirmMode(yes) {
|
|
805
1247
|
if (yes) {
|
|
@@ -816,6 +1258,12 @@ function originUpdateConfirmMode(yes) {
|
|
|
816
1258
|
function originRef(row) {
|
|
817
1259
|
return row.origin_version ?? row.origin_fingerprint ?? "";
|
|
818
1260
|
}
|
|
1261
|
+
function upstreamAvailable(row) {
|
|
1262
|
+
if (row.status === "update") return row.latest_in_range;
|
|
1263
|
+
if (row.status === "major") return `${row.latest_major} (major)`;
|
|
1264
|
+
if (row.status === "unreachable" || row.status === "unpublished") return row.message;
|
|
1265
|
+
return "";
|
|
1266
|
+
}
|
|
819
1267
|
async function handlePluginCheckCommand(name, opts) {
|
|
820
1268
|
const db = getDb();
|
|
821
1269
|
initializeSchema(db);
|
|
@@ -824,8 +1272,9 @@ async function handlePluginCheckCommand(name, opts) {
|
|
|
824
1272
|
name,
|
|
825
1273
|
refresh: opts.refresh
|
|
826
1274
|
});
|
|
1275
|
+
const upstream = (await runUpstreamCheck(name ? { name } : void 0)).rows;
|
|
827
1276
|
if (format === "json") {
|
|
828
|
-
printJson(report);
|
|
1277
|
+
printJson({ ...report, upstream });
|
|
829
1278
|
} else {
|
|
830
1279
|
ui.table.print({
|
|
831
1280
|
columns: [
|
|
@@ -845,6 +1294,25 @@ async function handlePluginCheckCommand(name, opts) {
|
|
|
845
1294
|
summary: formatCount(report.results.length, "plugin"),
|
|
846
1295
|
empty: "No syncable working heads."
|
|
847
1296
|
});
|
|
1297
|
+
if (upstream.length > 0) {
|
|
1298
|
+
ui.table.print({
|
|
1299
|
+
columns: [
|
|
1300
|
+
{ key: "name", header: "NAME", width: 18 },
|
|
1301
|
+
{ key: "upstream", header: "UPSTREAM", width: 30 },
|
|
1302
|
+
{ key: "status", header: "STATUS", width: 11 },
|
|
1303
|
+
{ key: "local", header: "LOCAL", width: 8 },
|
|
1304
|
+
{ key: "available", header: "AVAILABLE", width: 16 }
|
|
1305
|
+
],
|
|
1306
|
+
rows: upstream.map((row) => ({
|
|
1307
|
+
name: row.plugin_name,
|
|
1308
|
+
upstream: row.ref,
|
|
1309
|
+
status: row.status,
|
|
1310
|
+
local: row.local_version,
|
|
1311
|
+
available: upstreamAvailable(row)
|
|
1312
|
+
})),
|
|
1313
|
+
summary: upstream.some((row) => row.status === "major") ? `${formatCount(upstream.length, "upstream link")}. A major version is never installed automatically.` : formatCount(upstream.length, "upstream link")
|
|
1314
|
+
});
|
|
1315
|
+
}
|
|
848
1316
|
}
|
|
849
1317
|
if (report.results.some((row) => row.status === "error")) {
|
|
850
1318
|
process.exitCode = 1;
|
|
@@ -875,7 +1343,7 @@ async function handlePluginUpdateCommand(name, opts) {
|
|
|
875
1343
|
const count = listOriginUpdateCandidates().length;
|
|
876
1344
|
try {
|
|
877
1345
|
const confirmed = await promptForConfirmation({
|
|
878
|
-
message: `Update ${count}
|
|
1346
|
+
message: `Update ${formatCount(count, "plugin")} from origin?`,
|
|
879
1347
|
default: false
|
|
880
1348
|
});
|
|
881
1349
|
if (!confirmed) {
|
|
@@ -892,11 +1360,13 @@ async function handlePluginUpdateCommand(name, opts) {
|
|
|
892
1360
|
}
|
|
893
1361
|
}
|
|
894
1362
|
try {
|
|
895
|
-
const report = await
|
|
896
|
-
name,
|
|
897
|
-
|
|
898
|
-
|
|
899
|
-
|
|
1363
|
+
const report = await withUpstreamUpdateLock(
|
|
1364
|
+
() => updatePluginOrigins({ name, all: opts.all, force: opts.force }),
|
|
1365
|
+
{
|
|
1366
|
+
waitMs: UPDATE_LOCK_WAIT_MS,
|
|
1367
|
+
onWait: () => ui.info("Waiting for another plugin update to finish.")
|
|
1368
|
+
}
|
|
1369
|
+
);
|
|
900
1370
|
if (format === "json") {
|
|
901
1371
|
printJson(report);
|
|
902
1372
|
} else {
|
|
@@ -907,6 +1377,8 @@ async function handlePluginUpdateCommand(name, opts) {
|
|
|
907
1377
|
}
|
|
908
1378
|
if (report.results.some((row) => row.status === "failed")) {
|
|
909
1379
|
process.exitCode = 1;
|
|
1380
|
+
} else if (opts.all && format !== "json") {
|
|
1381
|
+
await maybePromptKeepUpToDate();
|
|
910
1382
|
}
|
|
911
1383
|
} catch (error) {
|
|
912
1384
|
process.exitCode = 1;
|
|
@@ -914,6 +1386,7 @@ async function handlePluginUpdateCommand(name, opts) {
|
|
|
914
1386
|
ui.danger(message);
|
|
915
1387
|
}
|
|
916
1388
|
}
|
|
1389
|
+
var UPDATE_LOCK_WAIT_MS = 5 * 60 * 1e3;
|
|
917
1390
|
function printUpdateHuman(rows) {
|
|
918
1391
|
ui.table.print({
|
|
919
1392
|
columns: [
|
|
@@ -1228,8 +1701,8 @@ function resolveProjectCompileTargets(input) {
|
|
|
1228
1701
|
}
|
|
1229
1702
|
|
|
1230
1703
|
// src/services/plugin-editor.ts
|
|
1231
|
-
import { mkdirSync } from "fs";
|
|
1232
|
-
import { dirname, join as
|
|
1704
|
+
import { mkdirSync as mkdirSync3 } from "fs";
|
|
1705
|
+
import { dirname as dirname2, join as join4 } from "path";
|
|
1233
1706
|
|
|
1234
1707
|
// src/services/plugin-export.ts
|
|
1235
1708
|
import { existsSync as existsSync2, statSync } from "fs";
|
|
@@ -1267,7 +1740,7 @@ function exportToFile(pluginNameOrId, filePath, exportOpts) {
|
|
|
1267
1740
|
|
|
1268
1741
|
// src/services/plugin-editor.ts
|
|
1269
1742
|
function resolvePluginDefinitionPath(plugin) {
|
|
1270
|
-
return
|
|
1743
|
+
return join4(
|
|
1271
1744
|
getHarnesstapDir(),
|
|
1272
1745
|
"plugins",
|
|
1273
1746
|
`${slugifyApName(plugin.name)}@${plugin.version}.ap.json`
|
|
@@ -1275,7 +1748,7 @@ function resolvePluginDefinitionPath(plugin) {
|
|
|
1275
1748
|
}
|
|
1276
1749
|
function exportPluginDefinition(plugin, filePath) {
|
|
1277
1750
|
const definitionPath = filePath ?? resolvePluginDefinitionPath(plugin);
|
|
1278
|
-
|
|
1751
|
+
mkdirSync3(dirname2(definitionPath), { recursive: true });
|
|
1279
1752
|
exportToFile(plugin.id, definitionPath, { singleFile: true });
|
|
1280
1753
|
return definitionPath;
|
|
1281
1754
|
}
|
|
@@ -1373,7 +1846,7 @@ async function handlePluginCatalogDisconnectPluginCommand(selector) {
|
|
|
1373
1846
|
|
|
1374
1847
|
// src/services/plugin-diff.ts
|
|
1375
1848
|
import { existsSync as existsSync3, statSync as statSync2 } from "fs";
|
|
1376
|
-
import { join as
|
|
1849
|
+
import { join as join5 } from "path";
|
|
1377
1850
|
function resourceKey(resource) {
|
|
1378
1851
|
if (resource.namespace) {
|
|
1379
1852
|
return `${resource.type}:${resource.name}@${resource.namespace}`;
|
|
@@ -1386,7 +1859,7 @@ function isPackagePath(nameOrPath) {
|
|
|
1386
1859
|
}
|
|
1387
1860
|
try {
|
|
1388
1861
|
if (existsSync3(nameOrPath) && statSync2(nameOrPath).isDirectory()) {
|
|
1389
|
-
return existsSync3(
|
|
1862
|
+
return existsSync3(join5(nameOrPath, "plugin.json"));
|
|
1390
1863
|
}
|
|
1391
1864
|
} catch {
|
|
1392
1865
|
return false;
|
|
@@ -1571,7 +2044,7 @@ function diffPlugins(leftName, rightName) {
|
|
|
1571
2044
|
|
|
1572
2045
|
// src/services/plugin-package-hydrate.ts
|
|
1573
2046
|
import { existsSync as existsSync4 } from "fs";
|
|
1574
|
-
import { join as
|
|
2047
|
+
import { join as join6 } from "path";
|
|
1575
2048
|
var MATERIAL_TYPES = new Set(MATERIAL_RESOURCE_TYPES);
|
|
1576
2049
|
function hasMaterialResources(resources) {
|
|
1577
2050
|
return resources.some((resource) => MATERIAL_TYPES.has(resource.type));
|
|
@@ -1590,11 +2063,11 @@ function tryScan(sourcePath, pluginName) {
|
|
|
1590
2063
|
}
|
|
1591
2064
|
function scanMarketplaceManifests(sourcePath, pluginName) {
|
|
1592
2065
|
const manifestCandidates = [
|
|
1593
|
-
|
|
1594
|
-
|
|
1595
|
-
|
|
1596
|
-
|
|
1597
|
-
|
|
2066
|
+
join6(sourcePath, ".claude-plugin", "marketplace.json"),
|
|
2067
|
+
join6(sourcePath, ".cursor-plugin", "marketplace.json"),
|
|
2068
|
+
join6(sourcePath, ".github", "plugin", "marketplace.json"),
|
|
2069
|
+
join6(sourcePath, ".agents", "plugins", "marketplace.json"),
|
|
2070
|
+
join6(sourcePath, "marketplace.json")
|
|
1598
2071
|
];
|
|
1599
2072
|
for (const manifestPath of manifestCandidates) {
|
|
1600
2073
|
if (!existsSync4(manifestPath)) {
|
|
@@ -1629,6 +2102,9 @@ function ensureUpstreamPluginResources(plugin) {
|
|
|
1629
2102
|
if (plugin.origin === "authored") {
|
|
1630
2103
|
return attached;
|
|
1631
2104
|
}
|
|
2105
|
+
if (recordedPluginInstallRoot(plugin.name, plugin.version)) {
|
|
2106
|
+
return attached;
|
|
2107
|
+
}
|
|
1632
2108
|
const packageRoot = resolvePluginPackageRoot(plugin);
|
|
1633
2109
|
if (!packageRoot) {
|
|
1634
2110
|
return attached;
|
|
@@ -1740,13 +2216,40 @@ var emptyPluginCheck = {
|
|
|
1740
2216
|
}
|
|
1741
2217
|
};
|
|
1742
2218
|
|
|
2219
|
+
// src/services/git-dependency-pin-check.ts
|
|
2220
|
+
function gitDependencyPinIssue(ref, constraint) {
|
|
2221
|
+
try {
|
|
2222
|
+
const pin = parseGitDependencyConstraint(constraint);
|
|
2223
|
+
if (pin.kind === "none") {
|
|
2224
|
+
return {
|
|
2225
|
+
severity: "warning",
|
|
2226
|
+
message: `Git dependency ${ref} is not pinned and tracks the default branch HEAD. Pin a commit, tag or branch, for example #<sha> or ref:<tag>.`
|
|
2227
|
+
};
|
|
2228
|
+
}
|
|
2229
|
+
return null;
|
|
2230
|
+
} catch (error) {
|
|
2231
|
+
return {
|
|
2232
|
+
severity: "error",
|
|
2233
|
+
message: error instanceof InvalidGitDependencyConstraintError ? `${error.message} (${ref})` : `Invalid git dependency constraint for ${ref}`
|
|
2234
|
+
};
|
|
2235
|
+
}
|
|
2236
|
+
}
|
|
2237
|
+
|
|
1743
2238
|
// src/services/plugin-doctor/checks/plugin-metadata.ts
|
|
2239
|
+
function checkGitDependencyPin(ref, constraint) {
|
|
2240
|
+
const issue = gitDependencyPinIssue(ref, constraint);
|
|
2241
|
+
return issue ? [{ severity: issue.severity === "error" ? "error" : "warn", message: issue.message }] : [];
|
|
2242
|
+
}
|
|
1744
2243
|
var pluginMetadataCheck = {
|
|
1745
2244
|
id: "plugin-metadata",
|
|
1746
2245
|
description: "Validate plugin refs, versions, and Claude plugin metadata",
|
|
1747
2246
|
run({ plugin, plugins }) {
|
|
1748
2247
|
const results = [];
|
|
1749
2248
|
for (const pin of plugins) {
|
|
2249
|
+
if (pin.source_kind === "git") {
|
|
2250
|
+
results.push(...checkGitDependencyPin(pin.ref, pin.version_constraint));
|
|
2251
|
+
continue;
|
|
2252
|
+
}
|
|
1750
2253
|
if (!pin.ref.includes("@")) {
|
|
1751
2254
|
results.push({
|
|
1752
2255
|
severity: "error",
|
|
@@ -1787,23 +2290,52 @@ var pluginMetadataCheck = {
|
|
|
1787
2290
|
}
|
|
1788
2291
|
};
|
|
1789
2292
|
|
|
2293
|
+
// src/services/plugin-doctor/checks/skipped-files.ts
|
|
2294
|
+
var skippedFilesCheck = {
|
|
2295
|
+
id: "skipped-files",
|
|
2296
|
+
description: "Detect package files that import skipped (bad frontmatter, unsupported dirs)",
|
|
2297
|
+
run({ packageDiagnostics: packageDiagnostics2 }) {
|
|
2298
|
+
if (!packageDiagnostics2) return [];
|
|
2299
|
+
return packageDiagnostics2.skipped.map((item) => ({
|
|
2300
|
+
severity: "error",
|
|
2301
|
+
message: formatSkippedEntry(item)
|
|
2302
|
+
}));
|
|
2303
|
+
}
|
|
2304
|
+
};
|
|
2305
|
+
|
|
1790
2306
|
// src/services/plugin-doctor.ts
|
|
1791
2307
|
var pluginDoctorChecks = [
|
|
1792
2308
|
emptyPluginCheck,
|
|
1793
2309
|
duplicateResourcesCheck,
|
|
1794
2310
|
emptyContentCheck,
|
|
1795
|
-
pluginMetadataCheck
|
|
2311
|
+
pluginMetadataCheck,
|
|
2312
|
+
skippedFilesCheck
|
|
1796
2313
|
];
|
|
2314
|
+
function packageDiagnostics(plugin, resources) {
|
|
2315
|
+
const root = recordedPluginInstallRoot(plugin.name, plugin.version);
|
|
2316
|
+
if (!root) return void 0;
|
|
2317
|
+
try {
|
|
2318
|
+
const parsed = parseApPackageFiles(readContainedPackageFiles(root), { root });
|
|
2319
|
+
return diagnoseParsedPackage(
|
|
2320
|
+
parsed,
|
|
2321
|
+
resources.map((resource) => resource.type)
|
|
2322
|
+
);
|
|
2323
|
+
} catch {
|
|
2324
|
+
return void 0;
|
|
2325
|
+
}
|
|
2326
|
+
}
|
|
1797
2327
|
function createPluginDoctorContext(nameOrId) {
|
|
1798
2328
|
const plugin = getPlugin(nameOrId);
|
|
1799
2329
|
if (!plugin) {
|
|
1800
2330
|
throw new Error(`Plugin not found: ${nameOrId}`);
|
|
1801
2331
|
}
|
|
1802
2332
|
const resources = ensureUpstreamPluginResources(plugin);
|
|
2333
|
+
const diagnostics = packageDiagnostics(plugin, resources);
|
|
1803
2334
|
return {
|
|
1804
2335
|
plugin,
|
|
1805
2336
|
resources,
|
|
1806
|
-
plugins: dependenciesFromResources(resources)
|
|
2337
|
+
plugins: dependenciesFromResources(resources),
|
|
2338
|
+
...diagnostics ? { packageDiagnostics: diagnostics } : {}
|
|
1807
2339
|
};
|
|
1808
2340
|
}
|
|
1809
2341
|
function listPluginDoctorChecks() {
|
|
@@ -1831,9 +2363,16 @@ function runPluginDoctor(input) {
|
|
|
1831
2363
|
plugin: context.plugin.name,
|
|
1832
2364
|
valid: !results.some((result) => result.severity === "error"),
|
|
1833
2365
|
checks: checks.map((check) => check.id),
|
|
1834
|
-
results
|
|
2366
|
+
results,
|
|
2367
|
+
resource_counts: context.packageDiagnostics?.counts ?? libraryCounts(context.resources)
|
|
1835
2368
|
};
|
|
1836
2369
|
}
|
|
2370
|
+
function libraryCounts(resources) {
|
|
2371
|
+
return [...MATERIAL_RESOURCE_TYPES, "plugin"].flatMap((type) => {
|
|
2372
|
+
const count = resources.filter((resource) => resource.type === type).length;
|
|
2373
|
+
return count > 0 ? [{ type, discovered: count, imported: count }] : [];
|
|
2374
|
+
});
|
|
2375
|
+
}
|
|
1837
2376
|
|
|
1838
2377
|
// src/services/constraint-recovery.ts
|
|
1839
2378
|
function catalogDependencyMatches(dependency, pluginName) {
|
|
@@ -1842,6 +2381,10 @@ function catalogDependencyMatches(dependency, pluginName) {
|
|
|
1842
2381
|
function marketplaceDependencyMatches(dependency, pluginName) {
|
|
1843
2382
|
return dependency.source_kind === "marketplace" && (dependency.name === pluginName || dependency.ref === pluginName || dependency.ref.endsWith(`/${pluginName}`));
|
|
1844
2383
|
}
|
|
2384
|
+
function gitDependencyMatches(dependency, pluginName) {
|
|
2385
|
+
const ref = dependency.ref.replace(/\.git$/, "").replace(/\/+$/, "");
|
|
2386
|
+
return dependency.source_kind === "git" && (dependency.name === pluginName || ref === pluginName || ref.endsWith(`/${pluginName}`));
|
|
2387
|
+
}
|
|
1845
2388
|
async function runConstraintRecovery(input) {
|
|
1846
2389
|
const root = resolvePluginSelector(input.rootName);
|
|
1847
2390
|
if (!root) {
|
|
@@ -1947,8 +2490,31 @@ async function runConstraintRecovery(input) {
|
|
|
1947
2490
|
}
|
|
1948
2491
|
return;
|
|
1949
2492
|
}
|
|
2493
|
+
if (action.sourceKind === "git") {
|
|
2494
|
+
const pins = listDependencies(root.id).filter((dependency) => gitDependencyMatches(dependency, action.pluginName)).map((dependency) => ({
|
|
2495
|
+
ref: dependency.ref,
|
|
2496
|
+
version_constraint: dependency.version_constraint || "*"
|
|
2497
|
+
}));
|
|
2498
|
+
if (pins.length === 0) {
|
|
2499
|
+
throw new Error(`No git dependency on ${action.pluginName} in ${input.rootName}`);
|
|
2500
|
+
}
|
|
2501
|
+
const syncResult = await syncPluginPinsForApply({
|
|
2502
|
+
pins,
|
|
2503
|
+
syncAll: true,
|
|
2504
|
+
projectRoot: input.projectRoot ?? resolveHomeRoot()
|
|
2505
|
+
});
|
|
2506
|
+
const failed = syncResult.installs.filter(
|
|
2507
|
+
(install) => install.status === "failed" || install.status === "unsupported"
|
|
2508
|
+
);
|
|
2509
|
+
if (failed.length > 0) {
|
|
2510
|
+
throw new Error(
|
|
2511
|
+
`Could not fetch ${action.pluginName}: ${failed.map((install) => `${install.ref}: ${install.message}`).join("; ")}`
|
|
2512
|
+
);
|
|
2513
|
+
}
|
|
2514
|
+
return;
|
|
2515
|
+
}
|
|
1950
2516
|
throw new Error(
|
|
1951
|
-
`Automated sync-install is only supported for marketplace and
|
|
2517
|
+
`Automated sync-install is only supported for marketplace, catalog and git dependencies. Create or import ${action.pluginName} first (ht plugin create ${action.pluginName}).`
|
|
1952
2518
|
);
|
|
1953
2519
|
}
|
|
1954
2520
|
default: {
|
|
@@ -2140,7 +2706,8 @@ function explainPayload(result) {
|
|
|
2140
2706
|
path: plugin.path,
|
|
2141
2707
|
constraints: plugin.constraints.map((record) => ({
|
|
2142
2708
|
requirer: record.requirer,
|
|
2143
|
-
constraint: record.constraint
|
|
2709
|
+
constraint: record.constraint,
|
|
2710
|
+
...record.declared ? { declared: record.declared } : {}
|
|
2144
2711
|
}))
|
|
2145
2712
|
})),
|
|
2146
2713
|
resources: result.decisions.map((decision) => ({
|
|
@@ -2168,7 +2735,7 @@ function renderExplain(result) {
|
|
|
2168
2735
|
for (const record of plugin.constraints) {
|
|
2169
2736
|
lines.push(
|
|
2170
2737
|
ui.theme.muted(
|
|
2171
|
-
` ${record.requirer} \u2192 ${plugin.name} ${record
|
|
2738
|
+
` ${record.requirer} \u2192 ${plugin.name} ${displayConstraint(record)}`
|
|
2172
2739
|
)
|
|
2173
2740
|
);
|
|
2174
2741
|
}
|
|
@@ -2191,13 +2758,11 @@ function renderExplain(result) {
|
|
|
2191
2758
|
|
|
2192
2759
|
// src/services/apm-graph.ts
|
|
2193
2760
|
import { existsSync as existsSync6, lstatSync as lstatSync2 } from "fs";
|
|
2194
|
-
import {
|
|
2195
|
-
import { isAbsolute, join as join6, resolve as resolve4 } from "path";
|
|
2761
|
+
import { isAbsolute, join as join8, resolve as resolve4 } from "path";
|
|
2196
2762
|
|
|
2197
2763
|
// src/services/apm-git-import.ts
|
|
2198
|
-
import { existsSync as existsSync5, lstatSync, readdirSync, readFileSync } from "fs";
|
|
2199
|
-
import { basename as basename2, join as
|
|
2200
|
-
import matter from "gray-matter";
|
|
2764
|
+
import { existsSync as existsSync5, lstatSync, readdirSync, readFileSync as readFileSync3 } from "fs";
|
|
2765
|
+
import { basename as basename2, join as join7 } from "path";
|
|
2201
2766
|
function isRecord(value) {
|
|
2202
2767
|
return value !== null && typeof value === "object" && !Array.isArray(value);
|
|
2203
2768
|
}
|
|
@@ -2214,8 +2779,8 @@ function importVirtualFile(checkoutRoot, relativePath) {
|
|
|
2214
2779
|
`Virtual package file ${relativePath} is missing: apply aborted closed`
|
|
2215
2780
|
);
|
|
2216
2781
|
}
|
|
2217
|
-
const raw =
|
|
2218
|
-
const parsed =
|
|
2782
|
+
const raw = readFileSync3(absolute, "utf8");
|
|
2783
|
+
const parsed = parseFrontmatter(raw);
|
|
2219
2784
|
const data = isRecord(parsed.data) ? parsed.data : {};
|
|
2220
2785
|
const fallback = basename2(relativePath).replace(/\.(agent|prompt|instructions)\.md$/i, "");
|
|
2221
2786
|
const name = typeof data.name === "string" && data.name.trim().length > 0 ? data.name.trim() : fallback;
|
|
@@ -2250,7 +2815,7 @@ function assertPackageRootSafe(packageRoot) {
|
|
|
2250
2815
|
if (entry.name === ".git") {
|
|
2251
2816
|
continue;
|
|
2252
2817
|
}
|
|
2253
|
-
const child =
|
|
2818
|
+
const child = join7(packageRoot, entry.name);
|
|
2254
2819
|
if (entry.isSymbolicLink() || lstatSync(child).isSymbolicLink()) {
|
|
2255
2820
|
throw new BundleSymlinkError(entry.name);
|
|
2256
2821
|
}
|
|
@@ -2264,10 +2829,10 @@ function assertPackageRootSafe(packageRoot) {
|
|
|
2264
2829
|
}
|
|
2265
2830
|
}
|
|
2266
2831
|
function peekApmPackageIdentity(packageRoot) {
|
|
2267
|
-
const pluginJson =
|
|
2832
|
+
const pluginJson = join7(packageRoot, ".claude-plugin", "plugin.json");
|
|
2268
2833
|
if (existsSync5(pluginJson) && lstatSync(pluginJson).isFile()) {
|
|
2269
2834
|
try {
|
|
2270
|
-
const parsed = JSON.parse(
|
|
2835
|
+
const parsed = JSON.parse(readFileSync3(pluginJson, "utf8"));
|
|
2271
2836
|
if (isRecord(parsed)) {
|
|
2272
2837
|
return {
|
|
2273
2838
|
...typeof parsed.name === "string" && parsed.name.trim() ? { name: parsed.name.trim() } : {},
|
|
@@ -2277,11 +2842,11 @@ function peekApmPackageIdentity(packageRoot) {
|
|
|
2277
2842
|
} catch {
|
|
2278
2843
|
}
|
|
2279
2844
|
}
|
|
2280
|
-
const manifestPath =
|
|
2845
|
+
const manifestPath = join7(packageRoot, APM_MANIFEST_FILENAME);
|
|
2281
2846
|
if (!existsSync5(manifestPath) || !lstatSync(manifestPath).isFile()) {
|
|
2282
2847
|
return {};
|
|
2283
2848
|
}
|
|
2284
|
-
const document = parseApmYamlDocument(
|
|
2849
|
+
const document = parseApmYamlDocument(readFileSync3(manifestPath, "utf8"), manifestPath);
|
|
2285
2850
|
return {
|
|
2286
2851
|
...typeof document.name === "string" && document.name.trim() ? { name: document.name.trim() } : {},
|
|
2287
2852
|
...typeof document.version === "string" && document.version.trim() ? { version: document.version.trim() } : {}
|
|
@@ -2467,7 +3032,7 @@ function apmDependencyIdentity(dependency, declaringRoot) {
|
|
|
2467
3032
|
}
|
|
2468
3033
|
function expandHome(originRef2) {
|
|
2469
3034
|
if (originRef2.startsWith("~/") || originRef2.startsWith("~\\")) {
|
|
2470
|
-
return
|
|
3035
|
+
return join8(resolveHomeRoot(), originRef2.slice(2));
|
|
2471
3036
|
}
|
|
2472
3037
|
return originRef2;
|
|
2473
3038
|
}
|
|
@@ -2492,7 +3057,7 @@ function linkParent(parentPluginId, imported) {
|
|
|
2492
3057
|
});
|
|
2493
3058
|
}
|
|
2494
3059
|
function pushGitLock(gitLocks, pluginName, fetched) {
|
|
2495
|
-
const licenseRoot = fetched.virtualPath ?
|
|
3060
|
+
const licenseRoot = fetched.virtualPath ? join8(fetched.checkoutRoot, fetched.virtualPath) : fetched.checkoutRoot;
|
|
2496
3061
|
const declared_license = readDeclaredLicense(licenseRoot);
|
|
2497
3062
|
gitLocks.push({
|
|
2498
3063
|
name: pluginName,
|
|
@@ -3479,9 +4044,7 @@ async function addPluginFromMarketplace(input) {
|
|
|
3479
4044
|
const plugin = requirePlugin(input.pluginName);
|
|
3480
4045
|
const parsed = requireMarketplaceRef(input.ref);
|
|
3481
4046
|
const marketplaceName = parsed.namespace;
|
|
3482
|
-
const marketplace =
|
|
3483
|
-
(entry) => entry.name === marketplaceName
|
|
3484
|
-
);
|
|
4047
|
+
const marketplace = findKnownMarketplace(input.harnesstapDir, marketplaceName);
|
|
3485
4048
|
if (!marketplace) {
|
|
3486
4049
|
throw new Error(`Marketplace not found in registry: ${marketplaceName}`);
|
|
3487
4050
|
}
|
|
@@ -3553,188 +4116,6 @@ async function addPluginFromMarketplace(input) {
|
|
|
3553
4116
|
};
|
|
3554
4117
|
}
|
|
3555
4118
|
|
|
3556
|
-
// src/services/github-plugin-ref.ts
|
|
3557
|
-
var GitPluginImportError = class extends Error {
|
|
3558
|
-
code;
|
|
3559
|
-
constructor(code, message) {
|
|
3560
|
-
super(message);
|
|
3561
|
-
this.name = "GitPluginImportError";
|
|
3562
|
-
this.code = code;
|
|
3563
|
-
}
|
|
3564
|
-
};
|
|
3565
|
-
var MISSING_PLUGIN_JSON_MESSAGE = "No plugin.json found at the repository root. Import currently supports Agent Plugins packages only; scanning the tree as loose resources is not available yet.";
|
|
3566
|
-
var OWNER_REPO = /^[A-Za-z0-9_.-]+\/[A-Za-z0-9_.-]+$/;
|
|
3567
|
-
var GH_PREFIX = /^gh:/i;
|
|
3568
|
-
function invalidRef(input) {
|
|
3569
|
-
return new GitPluginImportError(
|
|
3570
|
-
"invalid_ref",
|
|
3571
|
-
`Unrecognized GitHub plugin source "${input}". Use https://github.com/owner/repo, owner/repo, or gh:owner/repo.`
|
|
3572
|
-
);
|
|
3573
|
-
}
|
|
3574
|
-
function ownerRepoFromPath(pathname) {
|
|
3575
|
-
const parts = pathname.split("/").filter(Boolean);
|
|
3576
|
-
if (parts.length < 2) {
|
|
3577
|
-
return null;
|
|
3578
|
-
}
|
|
3579
|
-
const owner = parts[0];
|
|
3580
|
-
const repo = (parts[1] ?? "").replace(/\.git$/i, "");
|
|
3581
|
-
if (!owner || !repo || !OWNER_REPO.test(`${owner}/${repo}`)) {
|
|
3582
|
-
return null;
|
|
3583
|
-
}
|
|
3584
|
-
return { owner, repo };
|
|
3585
|
-
}
|
|
3586
|
-
function normalizeGitHubPluginUrl(input) {
|
|
3587
|
-
const trimmed = input.trim();
|
|
3588
|
-
if (!trimmed) {
|
|
3589
|
-
throw invalidRef(input);
|
|
3590
|
-
}
|
|
3591
|
-
const withoutGh = GH_PREFIX.test(trimmed) ? trimmed.replace(GH_PREFIX, "") : trimmed;
|
|
3592
|
-
const candidate = withoutGh.trim();
|
|
3593
|
-
if (OWNER_REPO.test(candidate.replace(/\.git$/i, ""))) {
|
|
3594
|
-
const [owner, repo] = candidate.replace(/\.git$/i, "").split("/");
|
|
3595
|
-
if (!owner || !repo) {
|
|
3596
|
-
throw invalidRef(input);
|
|
3597
|
-
}
|
|
3598
|
-
return `https://github.com/${owner}/${repo}.git`;
|
|
3599
|
-
}
|
|
3600
|
-
let parsed;
|
|
3601
|
-
try {
|
|
3602
|
-
parsed = new URL(candidate);
|
|
3603
|
-
} catch {
|
|
3604
|
-
throw invalidRef(input);
|
|
3605
|
-
}
|
|
3606
|
-
const host = parsed.hostname.replace(/^www\./i, "").toLowerCase();
|
|
3607
|
-
if (host !== "github.com" || parsed.protocol !== "https:" && parsed.protocol !== "http:") {
|
|
3608
|
-
throw invalidRef(input);
|
|
3609
|
-
}
|
|
3610
|
-
const pair = ownerRepoFromPath(parsed.pathname);
|
|
3611
|
-
if (!pair) {
|
|
3612
|
-
throw invalidRef(input);
|
|
3613
|
-
}
|
|
3614
|
-
return `https://github.com/${pair.owner}/${pair.repo}.git`;
|
|
3615
|
-
}
|
|
3616
|
-
function isGitHubPluginRef(input) {
|
|
3617
|
-
try {
|
|
3618
|
-
normalizeGitHubPluginUrl(input);
|
|
3619
|
-
return true;
|
|
3620
|
-
} catch {
|
|
3621
|
-
return false;
|
|
3622
|
-
}
|
|
3623
|
-
}
|
|
3624
|
-
|
|
3625
|
-
// src/services/plugin-git-import.ts
|
|
3626
|
-
function sameGitLocator(plugin, url) {
|
|
3627
|
-
const locator = recoverOriginLocator(plugin);
|
|
3628
|
-
if (!locator || locator.kind !== "git") {
|
|
3629
|
-
return false;
|
|
3630
|
-
}
|
|
3631
|
-
return formatOriginLocator(locator) === url;
|
|
3632
|
-
}
|
|
3633
|
-
async function importPluginFromGitHubRef(input, deps) {
|
|
3634
|
-
let url;
|
|
3635
|
-
try {
|
|
3636
|
-
url = normalizeGitHubPluginUrl(input);
|
|
3637
|
-
} catch (error) {
|
|
3638
|
-
if (error instanceof GitPluginImportError) {
|
|
3639
|
-
throw error;
|
|
3640
|
-
}
|
|
3641
|
-
throw new GitPluginImportError(
|
|
3642
|
-
"invalid_ref",
|
|
3643
|
-
error instanceof Error ? error.message : String(error)
|
|
3644
|
-
);
|
|
3645
|
-
}
|
|
3646
|
-
const harnesstapDir = getHarnesstapDir();
|
|
3647
|
-
const targetDir = gitOriginCacheDir(harnesstapDir, url);
|
|
3648
|
-
const refreshGit = deps?.refreshGit ?? refreshGitSource;
|
|
3649
|
-
const refresh = await refreshGit({ url, targetDir });
|
|
3650
|
-
if (!refresh.ok || !refresh.sha) {
|
|
3651
|
-
throw new GitPluginImportError(
|
|
3652
|
-
"clone_failed",
|
|
3653
|
-
refresh.message || `Failed to fetch ${url}`
|
|
3654
|
-
);
|
|
3655
|
-
}
|
|
3656
|
-
if (!isPluginInstallRoot(targetDir)) {
|
|
3657
|
-
throw new GitPluginImportError("missing_plugin_json", MISSING_PLUGIN_JSON_MESSAGE);
|
|
3658
|
-
}
|
|
3659
|
-
const scans = await scanPluginSource(targetDir);
|
|
3660
|
-
const scan = scans[0];
|
|
3661
|
-
if (!scan?.plugin_name) {
|
|
3662
|
-
throw new GitPluginImportError("missing_plugin_json", MISSING_PLUGIN_JSON_MESSAGE);
|
|
3663
|
-
}
|
|
3664
|
-
const existing = getPluginByName(scan.plugin_name);
|
|
3665
|
-
let plugin;
|
|
3666
|
-
let created = false;
|
|
3667
|
-
if (existing) {
|
|
3668
|
-
if (getPluginOrigin(existing.id) !== "upstream" || !sameGitLocator(existing, url)) {
|
|
3669
|
-
throw new GitPluginImportError(
|
|
3670
|
-
"name_conflict",
|
|
3671
|
-
`Plugin name already exists: ${scan.plugin_name}. Use a different local name or delete the existing plugin first.`
|
|
3672
|
-
);
|
|
3673
|
-
}
|
|
3674
|
-
plugin = existing;
|
|
3675
|
-
const nextDescription = pluginDescriptionFromManifest(scan.plugin_description);
|
|
3676
|
-
if (nextDescription && nextDescription !== existing.description) {
|
|
3677
|
-
updatePluginDescription(existing.id, nextDescription);
|
|
3678
|
-
}
|
|
3679
|
-
} else {
|
|
3680
|
-
plugin = createPlugin({
|
|
3681
|
-
name: scan.plugin_name,
|
|
3682
|
-
version: semverSafePluginVersion(scan.plugin_version, refresh.sha),
|
|
3683
|
-
description: pluginDescriptionFromManifest(scan.plugin_description),
|
|
3684
|
-
origin: "upstream"
|
|
3685
|
-
});
|
|
3686
|
-
setPluginOrigin(plugin.id, "upstream");
|
|
3687
|
-
created = true;
|
|
3688
|
-
}
|
|
3689
|
-
try {
|
|
3690
|
-
await applyCheckedPluginOrigin(plugin, {
|
|
3691
|
-
origin_locator: url,
|
|
3692
|
-
origin_fingerprint: refresh.sha
|
|
3693
|
-
});
|
|
3694
|
-
const pinRef = `${scan.plugin_name}@local`;
|
|
3695
|
-
const pinVersion = plugin.version || refresh.sha.slice(0, 12) || "0.0.0";
|
|
3696
|
-
ingestHostPluginTreeIntoCache({
|
|
3697
|
-
harnesstapDir: getHarnesstapDir(),
|
|
3698
|
-
homeRoot: resolveHomeRoot(),
|
|
3699
|
-
originRef: pinRef,
|
|
3700
|
-
sourceInstallRoot: targetDir,
|
|
3701
|
-
version: pinVersion
|
|
3702
|
-
});
|
|
3703
|
-
attachPluginPinToPlugin(plugin.id, pinRef, pinVersion);
|
|
3704
|
-
const pin = findPluginResourceByPin(pinRef, pinVersion) ?? findPluginResourceByPin(pinRef);
|
|
3705
|
-
if (pin) {
|
|
3706
|
-
const metadata = {
|
|
3707
|
-
...pin.metadata,
|
|
3708
|
-
resolved_version: pinVersion,
|
|
3709
|
-
sync_status: "synced",
|
|
3710
|
-
marketplace_name: "local"
|
|
3711
|
-
};
|
|
3712
|
-
getDb().prepare("UPDATE resources SET metadata = ?, origin_ref = ?, updated_at = ? WHERE id = ?").run(JSON.stringify(metadata), pinRef, (/* @__PURE__ */ new Date()).toISOString(), pin.id);
|
|
3713
|
-
}
|
|
3714
|
-
const updated = getPluginById(plugin.id) ?? plugin;
|
|
3715
|
-
if (created) {
|
|
3716
|
-
trackPluginInstalled({ pluginSlug: updated.name, source: "url" });
|
|
3717
|
-
}
|
|
3718
|
-
return {
|
|
3719
|
-
plugin: updated,
|
|
3720
|
-
origin_locator: url,
|
|
3721
|
-
origin_fingerprint: refresh.sha,
|
|
3722
|
-
created
|
|
3723
|
-
};
|
|
3724
|
-
} catch (error) {
|
|
3725
|
-
if (created) {
|
|
3726
|
-
deletePlugin(plugin.id);
|
|
3727
|
-
}
|
|
3728
|
-
if (error instanceof GitPluginImportError) {
|
|
3729
|
-
throw error;
|
|
3730
|
-
}
|
|
3731
|
-
throw new GitPluginImportError(
|
|
3732
|
-
"clone_failed",
|
|
3733
|
-
error instanceof Error ? error.message : String(error)
|
|
3734
|
-
);
|
|
3735
|
-
}
|
|
3736
|
-
}
|
|
3737
|
-
|
|
3738
4119
|
// src/services/plugin-edit.ts
|
|
3739
4120
|
function attachmentKey(resource) {
|
|
3740
4121
|
if (resource.namespace) {
|
|
@@ -4483,6 +4864,7 @@ async function handleProjectApplyCommand(pluginNames, opts) {
|
|
|
4483
4864
|
syncAll: opts.syncPlugins,
|
|
4484
4865
|
scope: resolvePluginInstallScope(projectRoot, Boolean(getGitOrigin(projectRoot))),
|
|
4485
4866
|
ignoreMissingInstall: Boolean(opts.ignorePluginVersions || opts.dryRun),
|
|
4867
|
+
installInexactPins: Boolean(opts.ignorePluginVersions && !opts.dryRun),
|
|
4486
4868
|
yes: Boolean(opts.yes),
|
|
4487
4869
|
interactive: opts.noInteractive === true ? false : opts.interactive,
|
|
4488
4870
|
progress: {
|
|
@@ -4657,6 +5039,7 @@ async function handleProjectApplyCommand(pluginNames, opts) {
|
|
|
4657
5039
|
syncAll: opts.syncPlugins,
|
|
4658
5040
|
scope: resolvePluginInstallScope(projectRoot, Boolean(getGitOrigin(projectRoot))),
|
|
4659
5041
|
ignoreMissingInstall: opts.ignorePluginVersions,
|
|
5042
|
+
installInexactPins: Boolean(opts.ignorePluginVersions),
|
|
4660
5043
|
yes: Boolean(opts.yes),
|
|
4661
5044
|
interactive: opts.noInteractive === true ? false : opts.interactive,
|
|
4662
5045
|
progress: {
|
|
@@ -5239,7 +5622,7 @@ async function handlePluginEditCommand(name, opts) {
|
|
|
5239
5622
|
return;
|
|
5240
5623
|
}
|
|
5241
5624
|
if (opts.apply) {
|
|
5242
|
-
const raw =
|
|
5625
|
+
const raw = readFileSync4(opts.apply, "utf8");
|
|
5243
5626
|
const attachments = parsePluginEditApplyFile(raw);
|
|
5244
5627
|
const pending = buildPendingFromApplySpec(candidates, attachments);
|
|
5245
5628
|
const result2 = await applyPluginEdit({
|
|
@@ -5456,7 +5839,7 @@ function handlePluginDiffCommand(left, right, opts) {
|
|
|
5456
5839
|
console.log(ui.renderChangeList(changeEntries));
|
|
5457
5840
|
console.log("");
|
|
5458
5841
|
console.log(
|
|
5459
|
-
`${report.changes.length}
|
|
5842
|
+
`${formatCount(report.changes.length, "change")} ${ui.icons.bullet} ${added} added ${ui.icons.bullet} ${removed} removed ${ui.icons.bullet} ${modified} modified`
|
|
5460
5843
|
);
|
|
5461
5844
|
} catch (err) {
|
|
5462
5845
|
process.exitCode = 1;
|
|
@@ -5501,8 +5884,9 @@ async function handlePluginDoctorCommand(name, opts) {
|
|
|
5501
5884
|
);
|
|
5502
5885
|
return;
|
|
5503
5886
|
}
|
|
5887
|
+
const target = getPlugin(resolvedName) ?? findLocalPluginBySelector(resolvedName, { command: "ht plugin doctor" });
|
|
5504
5888
|
const report = runPluginDoctor({
|
|
5505
|
-
nameOrId: resolvedName,
|
|
5889
|
+
nameOrId: target?.id ?? resolvedName,
|
|
5506
5890
|
checkIds: opts.check
|
|
5507
5891
|
});
|
|
5508
5892
|
if (format === "json") {
|
|
@@ -5549,13 +5933,18 @@ async function handlePluginDoctorCommand(name, opts) {
|
|
|
5549
5933
|
{ key: "message", header: "MESSAGE", width: 44 }
|
|
5550
5934
|
],
|
|
5551
5935
|
rows,
|
|
5936
|
+
wordWrap: true,
|
|
5552
5937
|
summary: report.valid ? `${report.plugin}: valid` : `${report.plugin}: invalid`
|
|
5553
5938
|
});
|
|
5939
|
+
ui.info(`Resources, imported of discovered: ${formatResourceCounts(report.resource_counts)}`);
|
|
5554
5940
|
if (!report.valid) {
|
|
5555
5941
|
process.exitCode = 1;
|
|
5556
5942
|
}
|
|
5557
5943
|
} catch (err) {
|
|
5558
|
-
fail(
|
|
5944
|
+
fail(
|
|
5945
|
+
err instanceof Error ? err.message : String(err),
|
|
5946
|
+
err instanceof LocalPluginSelectorError ? { hints: err.hints } : void 0
|
|
5947
|
+
);
|
|
5559
5948
|
process.exitCode = 1;
|
|
5560
5949
|
}
|
|
5561
5950
|
}
|
|
@@ -5581,7 +5970,7 @@ async function handlePluginFromProjectCommand(name, opts) {
|
|
|
5581
5970
|
fail(error instanceof Error ? error.message : String(error));
|
|
5582
5971
|
return;
|
|
5583
5972
|
}
|
|
5584
|
-
const { previewPluginFromProject } = await import("./plugin-from-project-
|
|
5973
|
+
const { previewPluginFromProject } = await import("./plugin-from-project-U5UGKTJH.js");
|
|
5585
5974
|
const preview = await previewPluginFromProject({
|
|
5586
5975
|
name: resolvedName,
|
|
5587
5976
|
projectRoot,
|
|
@@ -5928,7 +6317,7 @@ function printPluginSearchResults(plugins, format) {
|
|
|
5928
6317
|
rows: plugins.map((plugin) => ({
|
|
5929
6318
|
name: plugin.name,
|
|
5930
6319
|
ref: plugin.ref,
|
|
5931
|
-
version: plugin
|
|
6320
|
+
version: catalogPluginDisplayVersion(plugin) ?? "",
|
|
5932
6321
|
description: plugin.description ?? ""
|
|
5933
6322
|
})),
|
|
5934
6323
|
summary: formatCount(plugins.length, "plugin"),
|
|
@@ -5977,7 +6366,7 @@ async function handlePluginSearchCommand(query, opts = {}) {
|
|
|
5977
6366
|
choices: plugins2.map((plugin) => ({
|
|
5978
6367
|
name: plugin.description ? `${plugin.name}: ${plugin.description}` : plugin.name,
|
|
5979
6368
|
value: plugin.ref,
|
|
5980
|
-
description: plugin
|
|
6369
|
+
description: catalogPluginVersionLabel(plugin)
|
|
5981
6370
|
}))
|
|
5982
6371
|
});
|
|
5983
6372
|
const pluginName = await resolveMarketplacePinPluginName(opts.plugin, true);
|
|
@@ -6022,6 +6411,27 @@ function handlePluginAddDependencyCommand(ref, opts = {}) {
|
|
|
6022
6411
|
fail(`Plugin not found: ${targetName}`);
|
|
6023
6412
|
return;
|
|
6024
6413
|
}
|
|
6414
|
+
const parsedRef = parseDependencyRef(ref);
|
|
6415
|
+
const marketplace = parsedRef.source_kind === "marketplace" ? parsedRef.namespace : "";
|
|
6416
|
+
if (marketplace && !marketplaceIsKnown(marketplace, resolveHomeRoot())) {
|
|
6417
|
+
process.exitCode = 1;
|
|
6418
|
+
fail(`Marketplace ${marketplace} is not configured.`, {
|
|
6419
|
+
hint: `ht marketplace add <git-url> --name ${marketplace}`
|
|
6420
|
+
});
|
|
6421
|
+
return;
|
|
6422
|
+
}
|
|
6423
|
+
if (marketplace && marketplaceListsPlugin({
|
|
6424
|
+
homeRoot: resolveHomeRoot(),
|
|
6425
|
+
harnesstapDir: getHarnesstapDir(),
|
|
6426
|
+
marketplace,
|
|
6427
|
+
pluginName: parsedRef.name
|
|
6428
|
+
}) === false) {
|
|
6429
|
+
process.exitCode = 1;
|
|
6430
|
+
fail(`Plugin ${parsedRef.name} not found in marketplace ${marketplace}.`, {
|
|
6431
|
+
hint: `ht marketplace show ${marketplace}`
|
|
6432
|
+
});
|
|
6433
|
+
return;
|
|
6434
|
+
}
|
|
6025
6435
|
addDependency(plugin.id, ref);
|
|
6026
6436
|
const format = parseOutputFormat(opts.format);
|
|
6027
6437
|
if (format === "json") {
|
|
@@ -6138,7 +6548,10 @@ function registerPluginCommands(root) {
|
|
|
6138
6548
|
}
|
|
6139
6549
|
handlePluginShowCommand(resolvedName, opts);
|
|
6140
6550
|
});
|
|
6141
|
-
pluginCmd.command("edit").argument("[name]", "Plugin name or ID").option("-t, --type <type>", `Attachment or filter type (${PLUGIN_ATTACHMENT_TYPES.join(", ")})`).option("-s, --search <query>", "Pre-fill search filter (interactive mode)").option("--show-id", "Show IDs in tables").option("--all", "Show all resources per type (default: first 10 per type)").option("--add <selector>", "Add attachment (repeatable; scripting mode)", collectRepeatedOption, []).option("--remove <selector>", "Remove attachment (repeatable; scripting mode)", collectRepeatedOption, []).option("--apply <file>", "Apply membership from JSON file (scripting mode)").option("--version <constraint>", "Version constraint for plugin or plugin attachments").option("--embed", "Mark plugin pin as embed-on-export when adding").option("--sync", "Sync plugin resource immediately after add").option("--environment <name>", "Set default environment for plugin apply cascade").option("--clear-environment", "Clear default environment from plugin").option("--profile", "Tag the plugin as a switchable profile").option("--no-profile", "Remove the profile tag from the plugin").option("--dry-run", "Preview changes without writing").option("--format <mode>", "Output format: human or json", "human").option("--interactive", "Prompt instead of relying on explicit flags").description("Edit plugin composition and default environment (interactive or scripting)").action(async (name, opts) => {
|
|
6551
|
+
pluginCmd.command("edit").argument("[name]", "Plugin name or ID").option("-t, --type <type>", `Attachment or filter type (${PLUGIN_ATTACHMENT_TYPES.join(", ")})`).option("-s, --search <query>", "Pre-fill search filter (interactive mode)").option("--show-id", "Show IDs in tables").option("--all", "Show all resources per type (default: first 10 per type)").option("--add <selector>", "Add attachment (repeatable; scripting mode)", collectRepeatedOption, []).option("--remove <selector>", "Remove attachment (repeatable; scripting mode)", collectRepeatedOption, []).option("--apply <file>", "Apply membership from JSON file (scripting mode)").option("--version <constraint>", "Version constraint for plugin or plugin attachments").option("--embed", "Mark plugin pin as embed-on-export when adding").option("--sync", "Sync plugin resource immediately after add").option("--environment <name>", "Set default environment for plugin apply cascade").option("--clear-environment", "Clear default environment from plugin").option("--profile", "Tag the plugin as a switchable profile").option("--no-profile", "Remove the profile tag from the plugin").option("--hide <entry>", "Hide an inherited item, e.g. skill:review or plugin:web-search (repeatable; keep-in-sync profiles)", collectRepeatedOption, []).option("--unhide <entry>", "Show a hidden inherited item again (repeatable)", collectRepeatedOption, []).option("--dry-run", "Preview changes without writing").option("--format <mode>", "Output format: human or json", "human").option("--interactive", "Prompt instead of relying on explicit flags").description("Edit plugin composition and default environment (interactive or scripting)").action(async (name, opts) => {
|
|
6552
|
+
if (handlePluginHideOptions(name, opts)) {
|
|
6553
|
+
return;
|
|
6554
|
+
}
|
|
6142
6555
|
try {
|
|
6143
6556
|
await handlePluginEditCommand(name, opts);
|
|
6144
6557
|
} catch (error) {
|
|
@@ -6199,7 +6612,10 @@ function registerPluginCommands(root) {
|
|
|
6199
6612
|
pluginCmd.command("add").argument(
|
|
6200
6613
|
"<ref>",
|
|
6201
6614
|
"GitHub plugin URL (owner/repo, gh:owner/repo, or https://github.com/owner/repo) to import into the library, or a dependency ref with --to"
|
|
6202
|
-
).option("--to <plugin>", "Plugin that receives the dependency (skips GitHub library import)").addOption(new Option2("--layer <plugin>", "Deprecated alias for --to").hideHelp()).option(
|
|
6615
|
+
).option("--to <plugin>", "Plugin that receives the dependency (skips GitHub library import)").addOption(new Option2("--layer <plugin>", "Deprecated alias for --to").hideHelp()).option(
|
|
6616
|
+
"--force-remove",
|
|
6617
|
+
"Back up and replace files in a host plugin cache folder that HarnessTap did not write"
|
|
6618
|
+
).option("--format <mode>", "Output format: human or json", "human").description(
|
|
6203
6619
|
"Import a GitHub plugin.json package into the library, or add a dependency to a plugin with --to"
|
|
6204
6620
|
).action(async (ref, opts) => {
|
|
6205
6621
|
try {
|
|
@@ -6384,6 +6800,14 @@ function registerPluginCommands(root) {
|
|
|
6384
6800
|
renderCliError(error);
|
|
6385
6801
|
}
|
|
6386
6802
|
});
|
|
6803
|
+
pluginCmd.command("auto-update").option("--mode <mode>", "off, notify (default) or install (minor and patch in range, never a major)").option("--frequency <frequency>", "hourly, daily (default) or weekly").option("--format <mode>", "Output format: human or json", "human").description("Show or change how plugin updates are checked and installed").action(async (opts) => {
|
|
6804
|
+
try {
|
|
6805
|
+
await handlePluginAutoUpdateCommand(opts);
|
|
6806
|
+
} catch (error) {
|
|
6807
|
+
process.exitCode = 1;
|
|
6808
|
+
renderCliError(error);
|
|
6809
|
+
}
|
|
6810
|
+
});
|
|
6387
6811
|
pluginCmd.command("why").argument("<target>", "Plugin name, or a resource key like skill:deploy").option("--project <path>", "Project directory", ".").option("--root <plugin>", "Resolve against this root instead of the lockfile root").option("--format <mode>", "Output format: human or json", "human").description("Explain why a version was selected or which plugin won a resource").action((target, opts) => {
|
|
6388
6812
|
handlePluginWhyCommand(target, opts);
|
|
6389
6813
|
});
|
|
@@ -6419,4 +6843,4 @@ export {
|
|
|
6419
6843
|
registerPluginCommands,
|
|
6420
6844
|
registerDeprecatedLayerAlias
|
|
6421
6845
|
};
|
|
6422
|
-
//# sourceMappingURL=chunk-
|
|
6846
|
+
//# sourceMappingURL=chunk-3Q72LZPJ.js.map
|