mirror of
https://github.com/runkids/skillshare.git
synced 2026-11-18 18:04:17 +00:00
Add ProjectSources struct to ProjectConfig with optional skills, agents,
and extras fields. When set, project-mode commands resolve source paths
from these values instead of hardcoded .skillshare/{skills,agents,extras}/.
Config example:
sources:
skills: ./docs/skills
agents: ./docs/agents
Three EffectiveXxxSource(projectRoot) methods provide the central
resolution logic with fallback to defaults. The projectRuntime gateway
and server layer route through these methods, so most commands get
custom source support automatically.
Closes #153
23 lines
429 B
Go
23 lines
429 B
Go
package server
|
|
|
|
import (
|
|
"net/http"
|
|
|
|
"skillshare/internal/hub"
|
|
)
|
|
|
|
func (s *Server) handleHubIndex(w http.ResponseWriter, r *http.Request) {
|
|
// Snapshot config under RLock, then release before I/O.
|
|
s.mu.RLock()
|
|
sourcePath := s.skillsSource()
|
|
s.mu.RUnlock()
|
|
|
|
idx, err := hub.BuildIndex(sourcePath, false, false)
|
|
if err != nil {
|
|
writeError(w, http.StatusInternalServerError, err.Error())
|
|
return
|
|
}
|
|
|
|
writeJSON(w, idx)
|
|
}
|