5 Commits
Author SHA1 Message Date
Willie 20ae89a838 fix(server): stop dropping git and metadata errors in check, uninstall and batch targets
The dashboard check reimplemented the CLI's per-repo check but fetched
without the HTTPS token and ignored git status errors. Private tracked
repos could fail in the dashboard while `skillshare check` worked, and a
repo whose status could not be read showed as up to date. Both check
endpoints now call check.ParallelCheckRepos, the same code the CLI uses.
The JSON and SSE response shape does not change.

Batch uninstall treated a failed dirty check as clean and moved the
repo to trash. Without force, that item now fails with the git error
instead. This is stricter than the CLI, which only warns and continues.

Batch target updates ignored metadata save failures and still reported
success, so an override could silently disappear on the next reload.
They now return 500.
2026-09-30 01:34:58 +08:00
Willie acb150dfe3 fix(server): allow uninstalling disabled skills via Web UI
The skill list endpoint discovers skills with DiscoverSourceSkillsAll
(which includes disabled skills), but the uninstall handler used
DiscoverSourceSkills, which excludes anything listed in .skillignore.
A disabled skill therefore stayed visible in the dashboard yet failed
to uninstall with "skill not found".

Switch handleBatchUninstallSkills to DiscoverSourceSkillsAll so the two
endpoints agree on which skills exist. The CLI was unaffected.

Fixes #190
2026-06-02 23:48:09 +08:00
Willie 0c010c55f4 fix: wire custom sources into server reload and gitignore paths
reloadConfig now updates s.cfg.Source and s.cfg.AgentsSource from the
refreshed ProjectConfig so project UI handlers see the latest source
directories after a config edit.

Add ProjectGitignoreTarget helper that computes the correct .gitignore
directory and entry prefix based on whether the source path is inside
.skillshare/ or a custom location. All gitignore write and remove
operations (reconcile, install, uninstall, server handlers) now use
this helper instead of hardcoded 'skills/' prefix.

Fix nil projectCfg panics in three server tests that simulate project
mode by setting projectRoot without projectCfg.
2026-05-20 16:12:02 +08:00
Willie 1f1790b6be refactor: replace Registry with MetadataStore in reconcile, server, install context
Phase 1 of caller migration:
- projectRuntime: registry → skillsStore + agentsStore
- globalInstallContext: reg → store
- ReconcileGlobalSkills/ProjectSkills/ProjectAgents: take *MetadataStore
- Server struct: registry → skillsStore + agentsStore
- handler_install, handler_skills, handler_uninstall: use MetadataStore
- install.go, search.go: post-install reconciliation via MetadataStore
2026-04-08 10:59:13 +08:00
Willie 115edf3f24 fix(server): correct project-mode gitignore path + prevent registry prune basename collision
P2-1: handleUninstallRepo and handleBatchUninstall used s.cfg.Source for
gitignore removal, but project-mode installs write to .skillshare/.gitignore
with a "skills/" prefix. Add gitignoreDir() helper that returns the correct
base directory per mode, and prefix entries in project mode.

P2-2: Registry prune used filepath.Base(repoName) to derive the legacy group,
causing sibling nested repos (e.g., org/_team-skills vs dept/_team-skills) to
collide on the same basename. Now uses exact Group match for nested repos and
restricts legacy basename matching to top-level repos only.

Tests added (15 new):
- resolveTrackedRepo: auto _ prefix, nested, already-prefixed, not-found,
  basename fallback
- Registry prune: full-path Group, nested members by prefix, sibling isolation
- Project-mode gitignore: single + batch uninstall
- updateSingle: basename fallback, not-found, regular skill priority
- cleanEmptyParents: multi-level, stops at non-empty, stops at boundary
2026-04-04 17:05:22 +08:00