MCPcopy Create free account
hub / github.com/Noumena-Network/code / marketplaceUpdateHandler

Function marketplaceUpdateHandler

src/cli/handlers/plugins.ts:612–661  ·  view source on GitHub ↗
(
  name: string | undefined,
  options: { cowork?: boolean },
)

Source from the content-addressed store, hash-verified

610
611// marketplace update (lines 5609–5672)
612export async function marketplaceUpdateHandler(
613 name: string | undefined,
614 options: { cowork?: boolean },
615): Promise<void> {
616 if (options.cowork) setUseCoworkPlugins(true)
617 try {
618 if (name) {
619 // biome-ignore lint/suspicious/noConsole:: intentional console output
620 console.log(`Updating marketplace: ${name}...`)
621
622 await refreshMarketplace(name, message => {
623 // biome-ignore lint/suspicious/noConsole:: intentional console output
624 console.log(message)
625 })
626
627 clearAllCaches()
628
629 logEvent('ncode_marketplace_updated', {
630 marketplace_name:
631 name as AnalyticsMetadata_I_VERIFIED_THIS_IS_NOT_CODE_OR_FILEPATHS,
632 })
633
634 cliOk(`${figures.tick} Successfully updated marketplace: ${name}`)
635 } else {
636 const config = await loadKnownMarketplacesConfig()
637 const marketplaceNames = Object.keys(config)
638
639 if (marketplaceNames.length === 0) {
640 cliOk('No marketplaces configured')
641 }
642
643 // biome-ignore lint/suspicious/noConsole:: intentional console output
644 console.log(`Updating ${marketplaceNames.length} marketplace(s)...`)
645
646 await refreshAllMarketplaces()
647 clearAllCaches()
648
649 logEvent('ncode_marketplace_updated_all', {
650 count:
651 marketplaceNames.length as AnalyticsMetadata_I_VERIFIED_THIS_IS_NOT_CODE_OR_FILEPATHS,
652 })
653
654 cliOk(
655 `${figures.tick} Successfully updated ${marketplaceNames.length} marketplace(s)`,
656 )
657 }
658 } catch (error) {
659 handleMarketplaceError(error, 'update marketplace(s)')
660 }
661}
662
663// plugin install (lines 5690–5721)
664export async function pluginInstallHandler(

Callers 1

runFunction · 0.85

Calls 9

setUseCoworkPluginsFunction · 0.85
refreshMarketplaceFunction · 0.85
clearAllCachesFunction · 0.85
cliOkFunction · 0.85
refreshAllMarketplacesFunction · 0.85
handleMarketplaceErrorFunction · 0.85
keysMethod · 0.80
logEventFunction · 0.50

Tested by

no test coverage detected