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