Skip to content

agent-sdk / Exports / MarketplaceClient

Class: MarketplaceClient

Manages marketplace registries via shallow git clones.

Table of contents

Constructors

Methods

Constructors

constructor

new MarketplaceClient(options): MarketplaceClient

Parameters

NameType
optionsIMarketplaceClientOptions

Returns

MarketplaceClient

Defined in

agent-sdk/src/plugins/marketplace-client.ts:75

Methods

addMarketplace

addMarketplace(source): string

Add a marketplace by cloning its repository.

  1. Parse source: owner/repo string becomes a GitHub source.
  2. Shallow git clone (--depth 1) to marketplaces/<name>/.
  3. Read .claude-plugin/marketplace.json for the name field.
  4. Register in known_marketplaces.json.

Returns the registered marketplace name from the manifest.

Parameters

NameType
sourceIMarketplaceSource

Returns

string

Defined in

agent-sdk/src/plugins/marketplace-client.ts:92


removeMarketplace

removeMarketplace(name): void

Remove a marketplace. Uninstalls all plugins from that marketplace, then deletes the clone directory and removes from the registry.

Parameters

NameType
namestring

Returns

void

Defined in

agent-sdk/src/plugins/marketplace-client.ts:162


updateMarketplace

updateMarketplace(name): void

Update a marketplace by running git pull on its clone. The manifest is re-read from disk on demand (via fetchManifest), so the updated manifest is automatically available after pull.

TODO: After pull, detect version changes in installed plugins and offer to update them (re-install at new version).

Parameters

NameType
namestring

Returns

void

Defined in

agent-sdk/src/plugins/marketplace-client.ts:190


listMarketplaces

listMarketplaces(): { name: string ; source: IMarketplaceSource ; lastUpdated: string }[]

List all registered marketplaces.

Returns

{ name: string ; source: IMarketplaceSource ; lastUpdated: string }[]

Defined in

agent-sdk/src/plugins/marketplace-client.ts:225


fetchManifest

fetchManifest(marketplaceName): IMarketplaceManifest

Read the marketplace manifest from a registered marketplace's clone.

Parameters

NameType
marketplaceNamestring

Returns

IMarketplaceManifest

Defined in

agent-sdk/src/plugins/marketplace-client.ts:237


getMarketplaceDir

getMarketplaceDir(name): string

Get the clone directory path for a registered marketplace.

Parameters

NameType
namestring

Returns

string

Defined in

agent-sdk/src/plugins/marketplace-client.ts:255


getMarketplaceSha

getMarketplaceSha(name): string

Get the current git SHA (first 12 chars) for a marketplace clone. Used as a version identifier when plugins lack explicit versions.

Parameters

NameType
namestring

Returns

string

Defined in

agent-sdk/src/plugins/marketplace-client.ts:268


listAvailablePlugins

listAvailablePlugins(): IMarketplacePluginEntry & { marketplace: string }[]

List all available plugins across all marketplaces.

Returns

IMarketplacePluginEntry & { marketplace: string }[]

Defined in

agent-sdk/src/plugins/marketplace-client.ts:282

Released under the MIT License.