UNPKG

openclaw

Version:

Multi-channel AI gateway with extensible messaging integrations

42 lines (41 loc) • 1.79 kB
import { r as defaultRuntime } from "./runtime-BRg2NubB.mjs"; import { t as ExpectedCliError } from "./failure-output-Cq0Ej4cE.mjs"; import { r as theme } from "./theme-DzaUZY4q.mjs"; import { t as formatVersionLabel } from "./version-format-B-C6AzAF.mjs"; import { t as quietPluginJsonLogger } from "./plugins-json-logger-D7ZlRw7s.mjs"; //#region src/cli/plugins-marketplace-list-command.ts /** List plugins from a configured marketplace manifest. */ async function runPluginMarketplaceListCommand(source, opts) { const { listMarketplacePlugins } = await import("./marketplace-DWIuTtnZ.mjs"); const { createPluginInstallLogger } = await import("./plugins-command-helpers-D1f_yGgm.mjs"); const result = await listMarketplacePlugins({ marketplace: source, logger: opts.json ? quietPluginJsonLogger : createPluginInstallLogger() }); if (!result.ok) { const message = result.error; throw new ExpectedCliError({ message, humanOutput: message, machineOutput: message }); } if (opts.json) return defaultRuntime.writeJson({ source: result.sourceLabel, name: result.manifest.name, version: result.manifest.version, plugins: result.manifest.plugins }); if (result.manifest.plugins.length === 0) { defaultRuntime.log(`No plugins found in marketplace ${result.sourceLabel}.`); return; } defaultRuntime.log(`${theme.heading("Marketplace")} ${theme.muted(result.manifest.name ?? result.sourceLabel)}`); for (const plugin of result.manifest.plugins) { const suffix = plugin.version ? theme.muted(` ${formatVersionLabel(plugin.version)}`) : ""; const desc = plugin.description ? ` - ${theme.muted(plugin.description)}` : ""; defaultRuntime.log(`${theme.command(plugin.name)}${suffix}${desc}`); } } //#endregion export { runPluginMarketplaceListCommand };