Commit Graph
5 Commits
Author SHA1 Message Date
Willie 51af05ce6b fix(server): reload skills metadata store after install
install.Install persists metadata through its own store instance, leaving
the server's cached skillsStore stale. Freshly installed skills resolved
to a nil metadata entry and rendered with an empty source/type (shown as
"Local" in the UI) until restart. The agent path already reloaded
agentsStore; mirror it for skills across all three install completion
points (batch, tracked repo, single install).
2026-07-21 00:31:37 +08:00
Willie 54ae7b04e2 fix(install): reject project-root self-install via web UI
The project-root self-install guard lived only in the CLI handler, so the
web UI could still copy the project root into its own .skillshare/skills/
subtree in project mode. Extract the check into a shared
install.RejectProjectRootLocalInstall and apply it in handleInstall and
handleInstallBatch, returning 400 with the same guidance.

Also restructure the rejection message into a cause line plus an
actionable "Run '...'" hint, matching the project's error convention.
2026-06-16 10:04:57 +08:00
Willie da000c4d07 feat(server): agent tracked repo install, prune-on-empty, audit guards
- appendAgentDiffs helper deduplicates diff/stream agent logic
- handler_agent_diff: skip local copies, junction-aware checks
- handler_sync: prune orphan agents even when source is empty
- handler_install: tracked agent repo auto-detection and routing
- handler_skills: expose RepoRelPath and Targets for agents
- handler_skills_batch: agent target assignment via frontmatter
- handler_sync_matrix: pass agent Targets to ClassifySkillForTarget
- handler_update: tracked agent repo git pull update
- handler_audit: guard empty/missing source dirs gracefully
- Tests for all of the above
2026-04-10 02:05:13 +08:00
Willie b8a189ba58 Improve resource install agent support
Add local-path resource discovery so install flows can detect agents as well as skills. Preserve nested agent paths and suffixless agent metadata keys during batch install and update, and refresh the UI copy to use resource-aware wording on the install surface.
2026-04-10 01:26:40 +08:00
Willie d16c4f3812 fix: correct metadata store routing, corruption handling, and lookup depth
Three bugs introduced during centralized metadata migration:

1. Batch agent installs via UI wrote metadata to skills/.metadata.json
   instead of agents/.metadata.json because handleInstallBatch hard-coded
   SourceDir to s.cfg.Source. Override SourceDir with agentsSource() when
   body.Kind is agent.

2. CheckAgents used LoadMetadataOrNew which silently converts parse
   failures into an empty store, making all tracked agents appear local
   and suppressing drift/update diagnostics. Switch to LoadMetadata and
   surface corruption as status=error with the parse error message.

3. findMetaEntry only climbed 3 parent directories when searching for
   .metadata.json, but --into supports arbitrary nesting depth. Raise
   the ceiling to 10 (root sentinel still terminates early).
2026-04-08 18:06:20 +08:00