A skill installed from a non-default branch of an SSH or other-host
remote (git@host:o/r.git, Gitea, self-hosted HTTPS) could not switch
back to main: the Branch picker was greyed out with "This source can
only use its default branch" (#787). The picker reused /api/hub/refs,
which only lists refs for GitHub, GitLab and Bitbucket web URLs because
a hub entry pins its ref in the URL. Reinstalling from a branch does
not need that; the update endpoint already accepts any git source.
/api/hub/refs now takes anyGit, which lists a non-pinnable git source's
refs while still reporting pinnable=false. The detail page asks for it
under its own query key; the hub editors keep the old request, so they
run no extra ls-remote for sources they cannot pin.
Closes#787
Co-authored-by: sim <sim@example.invalid>
Previewing a hub from the builder landed on an empty "pick a hub" state:
the builder and the browser kept separate copies of the drafts and the
browser's copy went stale. Merging both into one page removes the split,
so your own hub is shown exactly as others will see it and edited in place.
Hub entries can now be added from any repository URL, not only from
installed skills, with a branch or tag picked from the remote. The version
is written into the source URL, the only place the hub format keeps it,
and a new /api/hub/refs endpoint lists refs and rewrites sources so the UI
never builds tree/<ref> URLs itself. Skills added from installed ones keep
the version they were installed from.
Draft reads and saves read refs from the URLs only, so opening a hub never
waits on a remote. Added hubs get unique labels, since the default hub is
stored by label.