agent-sdk / Exports / MarketplaceClient
Class: MarketplaceClient
Manages marketplace registries via shallow git clones.
Table of contents
Constructors
Methods
- addMarketplace
- removeMarketplace
- updateMarketplace
- listMarketplaces
- fetchManifest
- getMarketplaceDir
- getMarketplaceSha
- listAvailablePlugins
Constructors
constructor
• new MarketplaceClient(options): MarketplaceClient
Parameters
| Name | Type |
|---|---|
options | IMarketplaceClientOptions |
Returns
Defined in
agent-sdk/src/plugins/marketplace-client.ts:75
Methods
addMarketplace
▸ addMarketplace(source): string
Add a marketplace by cloning its repository.
- Parse source:
owner/repostring becomes a GitHub source. - Shallow git clone (
--depth 1) tomarketplaces/<name>/. - Read
.claude-plugin/marketplace.jsonfor thenamefield. - Register in
known_marketplaces.json.
Returns the registered marketplace name from the manifest.
Parameters
| Name | Type |
|---|---|
source | IMarketplaceSource |
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
| Name | Type |
|---|---|
name | string |
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
| Name | Type |
|---|---|
name | string |
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
| Name | Type |
|---|---|
marketplaceName | string |
Returns
Defined in
agent-sdk/src/plugins/marketplace-client.ts:237
getMarketplaceDir
▸ getMarketplaceDir(name): string
Get the clone directory path for a registered marketplace.
Parameters
| Name | Type |
|---|---|
name | string |
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
| Name | Type |
|---|---|
name | string |
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 }[]