Skip to content

Add skills management methods to SkillsClient #163

@malhotra5

Description

@malhotra5

Summary

Add methods to SkillsClient to support the new skills CRUD endpoints being added to the agent-server.

Depends on: OpenHands/software-agent-sdk#3230

Background

The SkillsClient currently only supports:

  • getSkills(request) - Load/list skills from various sources
  • syncSkills() - Refresh public skills cache

Once the agent-server adds CRUD endpoints for skills management, the typescript-client needs corresponding methods.

Proposed Changes

New Methods

// Install a skill from source (URL, local path, or marketplace)
async installSkill(request: InstallSkillRequest): Promise<InstallSkillResponse>

// Uninstall a skill by name
async uninstallSkill(skillName: string): Promise<SkillActionResponse>

// Enable or disable a skill
async toggleSkill(skillName: string, enabled: boolean): Promise<SkillActionResponse>

// List installed skills with their enabled status
async listInstalledSkills(): Promise<InstalledSkillsResponse>

// (Optional) Get marketplace catalog
async getMarketplace(): Promise<MarketplaceResponse>

New Types

interface InstallSkillRequest {
  source: string;  // URL, local path, or "marketplace:skill-name"
  force?: boolean; // Overwrite if exists
}

interface InstallSkillResponse {
  name: string;
  source: string;
  install_path: string;
}

interface SkillActionResponse {
  success: boolean;
  message?: string;
}

interface InstalledSkillInfo {
  name: string;
  source: string;
  install_path: string;
  enabled: boolean;
  description?: string | null;
}

interface InstalledSkillsResponse {
  skills: InstalledSkillInfo[];
}

interface MarketplaceSkill {
  name: string;
  description: string;
  source: string;
  installed: boolean;
}

interface MarketplaceResponse {
  skills: MarketplaceSkill[];
}

Endpoint Mapping

Method HTTP Endpoint
installSkill() POST /api/skills/install
uninstallSkill() DELETE /api/skills/{skill_name}
toggleSkill() PATCH /api/skills/{skill_name}
listInstalledSkills() GET /api/skills/installed
getMarketplace() GET /api/skills/marketplace

Implementation Notes

  • All methods should use the existing HttpClient pattern
  • Error handling should follow existing conventions
  • Consider adding the new types to src/models/api.ts

Use Case

This enables the agent-canvas frontend to:

  1. Display a marketplace of available skills
  2. Install/uninstall skills with one click
  3. Manage installed skills (enable/disable)
  4. Support default bundled skills on first startup

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions