Skip to content

refactor(install): move install and update logic into hk-core - #192

Merged
RealZST merged 2 commits into
mainfrom
refactor/install-cleanup
Nov 19, 2026
Merged

RealZST merged 2 commits into
mainfrom
refactor/install-cleanup

Conversation

@RealZST

@RealZST RealZST commented Nov 19, 2026

Copy link
Copy Markdown
Owner

What

The desktop commands and the web handlers each carried their own, near-identical copy of the skill install, check-updates and update code. This moves it into hk-core, so both are thin wrappers.

  • hk_core::install: installing from a local folder, a scanned Git repository, the Marketplace and a followed repository now share one path, and one function resolves an agent's skill directory (Hermes category included).
  • hk_core::updates: cached statuses, check updates, update.
  • Removed "More from repos", the disabled banner and dialog that Following replaced, with its endpoint, the new-skill discovery inside check updates, and its strings.
  • Removed install_from_git, which the frontend never called, and the uuid / tempfile dependencies the desktop and web crates no longer need.

About 2,800 lines removed and 960 added, tests included.

Behaviour changes

  • check_updates returns the status list itself, not { statuses, new_skills }.
  • install_scanned_skills returns one result per skill, not one per agent and skill. The UI only reads the names.
  • An install request that names no agent is rejected. It used to go to the first detected agent. The UI always names one.
  • The web install_to_agent returns what the desktop one returns. The frontend ignores the value.
  • Installing a repository's only skill uses the clone the scan already made, not a second clone per agent.

Checked

  • cargo test --workspace (871 passed), cargo clippy -D warnings, tsc, biome, vitest (373 passed).
  • New tests for the shared install path: single-skill scan, multi-skill scan and choice, local folder, no agent or an unknown one.
  • The same 17 requests (local install, Git with one and several skills, follow on install, check updates before and after upstream moves, update, Marketplace install, error cases) against hk serve built from main and from this branch, each in a fresh home. Responses, installed files and recorded sources are identical apart from the two response shapes above.
  • Not run: the desktop app. It compiles and now calls the same core functions as the web server.

🤖 Generated with Claude Code

The desktop commands and the web handlers each carried their own copy of
the skill install, check-updates and update code. Both now call
hk_core::install and hk_core::updates, and one function resolves an
agent's skill directory, Hermes category included.

Also removes the disabled "More from repos" feature, which Following
replaced, and the install_from_git command, which the frontend never
called.

Behaviour changes:
- check_updates returns the status list itself.
- install_scanned_skills returns one result per skill.
- An install that names no agent is rejected instead of going to the
  first detected agent.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
@cloudflare-workers-and-pages

Copy link
Copy Markdown

Deploying harnesskit with  Cloudflare Pages  Cloudflare Pages

Latest commit: 9e6e770
Status: ✅  Deploy successful!
Preview URL: https://9b45fed0.harnesskit.pages.dev
Branch Preview URL: https://refactor-install-cleanup.harnesskit.pages.dev

View logs

- check_updates only clones the repositories whose skills it has to
  verify; the rest were cloned for the removed new-skill discovery.
- Linking unlinked skills to the Marketplace by name is one function,
  shared by check_updates and both rescans.
- An install resolves its target before cloning, and no longer creates
  skill directories ahead of a copy that may fail.
- install_scanned_skills takes the cache root from its caller, like the
  other repository functions.
- The Marketplace install requires its target agent.
- The desktop commands share one blocking helper.
- Tests: following on install, and a check/update/removed round trip.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
@RealZST
RealZST merged commit f01e765 into main Nov 19, 2026
5 checks passed
@RealZST
RealZST deleted the refactor/install-cleanup branch November 19, 2026 08:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant