Skip to main content

Module install_skill

Module install_skill 

Source
Expand description

install_skill: search skillhub.cn for a skill, let the user review it in the TUI, and install it to ~/.recursive/skills/<slug>/.

This tool is TUI-only. When called without a TUI side-channel (skill_tx.is_none()) it returns an informative error rather than blocking forever.

§Communication flow

Agent calls install_skill(query)
  → HTTP GET skillhub.cn/search?q=…
  → sends SkillInstallEvent::Search to TUI side-channel
  → awaits oneshot reply (selected slug or None)
TUI shows results modal, user picks a skill or presses Esc
  → oneshot reply: Some(slug) or None
If slug: HTTP GET skillhub.cn/download?slug=…  (zip)
  → parse zip → collect SkillZipFile list
  → sends SkillInstallEvent::Files to TUI side-channel
  → awaits oneshot reply (bool: confirm)
TUI shows files preview; user presses y or Esc
  → oneshot reply: true or false
If confirmed: extract zip to ~/.recursive/skills/<slug>/

Structs§

InstallSkill
SkillFilesRequest
Phase 2: tool → TUI. User reviews files and confirms installation.
SkillSearchRequest
Phase 1: tool → TUI. User selects a slug or cancels.
SkillSearchResult
One search result returned by skillhub.cn.
SkillZipFile
A single file from inside a skill zip archive.

Enums§

SkillInstallEvent
Events from the install_skill tool to the TUI side-channel. Carried on a dedicated mpsc::UnboundedReceiver<SkillInstallEvent> in the TUI backend, separate from event_rx, because the payloads contain oneshot::Sender values which are not PartialEq.