Commit Graph
176 Commits
Author SHA1 Message Date
Willie 6996237796 fix(install): keep the SSH reason when a git remote cannot be read
extractGitFatal kept only git's "fatal:" line, so SSH clone/fetch failures
(install from git@host:..., hub indexes over SSH, updates) reported just
"Could not read from remote repository." and dropped the ssh line that says
why: publickey denied, host key verification, unresolved hostname, or a
refused/timed-out connection.

For that generic message, append the preceding transport line (skipping
"Cloning into" and warning chatter). When the reason is a publickey denial,
WrapGitError adds an "ssh -T user@host" hint. Other errors are unchanged.
2026-09-30 16:35:30 +08:00
Willie 13a93242f8 feat(ui): redesign the Hubs page around one list with in-place editing
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.
2026-09-28 23:39:19 +08:00
Willie 529a8f2771 fix(install): keep config installs on the recorded branch
Installing from config set the branch only when one was recorded, so a
legacy entry with a tree/<tag>/... source and no branch was pinned to
that tag, while update kept it on the default branch. Use
ApplyRecordedBranch like the update paths do. Settling the ref up front
also lets web URL entries from one repo share a single clone again.

Refs #293
2026-09-28 22:12:09 +08:00
Willie 72b6a38dfd fix(install): treat tree/HEAD web URLs as the default branch
GitHub links to tree/HEAD/... when it means the default branch. Since
URL refs became clone refs, HEAD was taken as a branch name: with a
subdir the ref lookup failed, without one git clone --branch HEAD
failed. These URLs installed fine before, so keep them on the default
branch.

Refs #293
2026-09-28 22:12:09 +08:00
a352b8d243 feat(install): pin skills to a tag or commit from their web URL (#293)
* feat(install): pin GitHub tree/blob URLs to their ref

Hub entries only carry a source URL, so a team hub had no way to pin a
third-party skill to a reviewed tag or commit. The parser already read
tree/<ref>/ and blob/<ref>/ URLs but discarded the ref, installing from
the default branch instead of the version the URL names.

Keep that ref as Source.Branch. An explicit --branch (CLI) or branch
(API body) still overrides it; the server handlers now only override
when a branch is given. Batch installs group by repo and ref so two
pinned versions of one repo get separate clones.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

* docs(install): describe pinning hub sources to a tag or commit

Explain that a GitHub tree/<ref>/ source URL pins the install, in both
the hub index guide and the install reference.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

* feat(install): pin GitLab/Bitbucket URLs and resolve refs containing "/"

Pinning should not depend on the host, so GitLab (-/tree/<ref>/) and
Bitbucket (src/<ref>/) web URLs now keep their ref too.

Taking the first path segment as the ref broke branch names containing
"/": tree/feature/x/skills/foo cloned branch "feature" and failed. When
the first segment is not a branch or tag on the remote, the longest
matching one is used instead. A ref the remote does not have fails
with a hint to use --branch, rather than silently installing the
default branch. A saved branch that covers more of the path (from
--branch or config) moves the subdir without asking the remote.

The grouped-install round-trip test pinned -/tree/main/ against a repo
on master; the ref used to be ignored, so its branch is now renamed.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

* docs(install): cover GitLab, Bitbucket and "/" branches in URL pinning

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

* fix(install): keep web URL refs correct on reinstall, --branch and grouping

Review of the slash-branch resolution found four gaps:

- A saved branch equal to the whole URL tail (tree/feature/x) did not
  move the subdir back, so every reinstall or update looked for "x".
- An unrelated --branch with a slash-branch URL kept the parse-time
  subdir (x/skills/foo) instead of the URL's real one.
- Grouped installs copy the source to a repo root; resolution then put
  the subdir back and discovery looked under a doubled path. Grouping
  also keyed on the unresolved first segment, so tree/feature/x and
  tree/feature/y could share one clone. Web URLs with a ref now install
  on their own, and resolution leaves a repo-root copy at its root.
- A skill named after the parse-time subdir kept that name once the
  path turned out to be all ref (tree/feature/x named the skill "x").

The unknown-ref error now reads as a missing ref first, since a stale
ref (tree/master after a rename) is more common than a slash branch.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

* fix(update): keep legacy installs on the default branch

Skills installed before URL refs were honoured got the default branch
and recorded no branch. Single-skill update re-parses the recorded
source, so it moved them to the URL's ref (or failed on a stale one,
with a hint to pass --branch, which update does not accept), while
update --all rebuilds from RepoURL and kept the default branch.

ApplyRecordedBranch treats an empty recorded branch as the remote
default and drops the URL's ref. It replaces the branch handling at
every site that reinstalls from recorded metadata: CLI and server
update for skills and agents, and tracked-repo rehydration.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

* perf(search): share one clone across pinned hub skills from a repo

Any web URL with a path after its ref installed on its own, so a hub
listing many tree/<tag>/ skills from one repo cloned it once per skill.

groupByRepo now resolves each URL's ref before grouping, with a
RemoteRefs cache that lists each remote's refs once, and groups by
repo and resolved ref. Only refs containing "/" (whose subdir the
discovery match cannot re-derive) and refs that fail to resolve still
install alone. A resolved source is marked settled so the grouped
clone does not resolve it again, and ApplyRecordedBranch settles the
subdir from a recorded branch without asking the remote.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

---------

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Willie <egg358358@gmail.com>
2026-09-28 22:08:16 +08:00
Willie 97499ebcc4 fix: recognise Windows junctions wherever links are detected
Since Go 1.23, os.Lstat reports NTFS junctions as irregular files instead
of symlinks (winsymlink, active for go 1.25 in go.mod). Every check that
looked only at os.ModeSymlink therefore missed the junctions skillshare
itself creates on Windows: linked skills could be treated as local folders,
backed up, copied through, or left behind on prune.

Detect links through utils.IsLinkMode, which also asks the OS about the
reparse tag of irregular entries, and count only real symlinks and
junctions as links so OneDrive placeholders and deduplicated files stay
regular files. restore.go also used os.Stat for its link check, which
follows the link and never matched.

Refs #299
2026-09-28 13:53:16 +08:00
Willie 5dd83a8412 fix(server): guard metadata store access against concurrent requests
Every API request reloads the skills and agents metadata stores and
swaps the server's pointers under s.mu, but several handlers read or
wrote the stores outside that lock: listing, skill detail, check, the
update stream, and the hash refresh after setting targets. Concurrent
requests could race on the pointer or on the stores' maps, which the
race detector reported hundreds of times under load and which can
crash the server with a concurrent map access.

Store access now always happens under s.mu. Reads return a copy of
the entry so it can be used after unlocking, and target handlers hash
files outside the lock and only write the result under it.
2026-09-26 21:12:57 +08:00
Willie bc01ff1b3e feat(server): let tracked-repo skills take dashboard targets
Setting targets on a skill inside a tracked repo used to be refused,
because writing its SKILL.md leaves the clone dirty and `update` then
skips the repo (or `--force` throws the setting away).

Store those targets in the source's .metadata.json instead, keyed by
the skill's path, and apply them at discovery over the frontmatter.
The clone stays clean, `update` keeps working, and the setting survives
it. Uninstalling a repo or skill drops its entries.

Overrides are saved in the same lock section that writes them: every
API request reloads the store from disk, so saving after unlocking
could lose them, and saving outside the lock raced with other writers.

Refs #295
2026-09-26 21:02:28 +08:00
Willie bf32112032 feat(git): show pending remote commits and auto-merge metadata conflicts
Two machines sharing a source repo kept stopping at the same two places.
The Git page had no way to know the remote moved until a push bounced, so
it now fetches once on open and labels Pull with the commit count (status
itself stays offline because the sidebar polls it). And both machines
rewrite .metadata.json on every install or update, so nearly every
diverged pull conflicted there; those conflicts are now merged per entry,
keeping the later installed_at, while any other conflict still stops the
pull and names the files.
2026-09-25 02:22:35 +08:00
Willie cb2bcec948 feat(agents): convert agents with a target extension
Tools disagree on agent frontmatter and some need another format entirely,
so an agent written for Claude is misread elsewhere. An `extension` on a
target's agents block reuses the extras transform mechanism to convert each
agent during sync.

Converted targets hold transformed output, so collect never pulls them back
into the source. Leftover symlinks from merge or symlink mode are removed
rather than written through, and a failed conversion drops the old output
so an unconverted agent never stays active.

The bundled opencode-agents extension keeps only fields OpenCode documents
and refuses agents that restrict their tools, since dropping those fields
would widen the agent's access.

Refs #267
Refs #241
2026-09-21 13:31:38 +08:00
Willie de1abd4b33 feat(install): pin project skills to a commit with a lockfile
config.yaml records which skills a project wants, but not which commit
each one resolved to, so two teammates running `install -p` a week apart
could end up with different skill contents.

Project mode now writes .skillshare/skills.lock.json next to the config.
`install -p` checks out the locked commit for skills and tracked repos,
and brings an already installed skill to the lock when they differ.
`update -p` and the dashboard move a pin only for skills whose commit
actually changed, so a stale local copy cannot roll the team back, and
uninstall drops the pin. A locked value is only honoured when it is a
full SHA for the same source, since it ends up as a git argument.
2026-09-21 04:31:22 +08:00
Willie 73b1ebf12c fix(install): record grouped installs at the skills root
A skill installed into a group had its metadata written to the group
folder instead of the skills root, so it never reached config.yaml and
teammates running `install -p` did not get it.

Two paths left the skills root unset and fell back to the parent of the
skill: `install <git source> --into <group>`, because only Install
derived the root and InstallFromDiscovery did not, and config installs
of an entry with `group:`, in both project and global mode. Both now
resolve the root the same way.
2026-09-21 04:31:14 +08:00
Willie 338bc2c2a4 fix(install): harden ref pinning after code review
- Fallback fetch pulled only the default branch because a depth-1 clone
  is single-branch; fetch all heads and tags so an abbreviated SHA off
  the default branch resolves.
- Move the --track guard from CLI flag parsing into InstallTrackedRepo
  so the Web UI is covered too, and reject tags as well as SHAs: both
  leave HEAD detached with nothing for `git pull` to follow.
- An all-hex branch or tag name (e.g. 20240915) was treated as a SHA in
  check and never queried; look the ref up first and fall back to the
  literal SHA only when the remote has no such ref. Full 40-char SHAs
  still skip the network.
- Rename the git package's 7-char shortHash to abbrevHash to avoid
  clashing with install's 12-char helper.

Refs #281
2026-09-21 02:26:55 +08:00
Willie 3000227175 feat(install): support commit SHA and tag pinning via --branch
Teams with supply-chain review need reproducible installs, but --branch
only worked for branch names because git clone --branch rejects SHAs.

Clone the default branch and detach at the pinned commit (targeted
depth-1 fetch, falling back to --unshallow for abbreviated SHAs or
servers that refuse arbitrary wants). Resolve tags in check via
refs/tags and the peeled ^{} commit, and short-circuit SHA pins without
a network round-trip since they can never move. Reject --track with a
SHA: a tracked repo must follow a branch to pull.

Closes #281
2026-09-21 02:07:50 +08:00
Willie 2ed71d7b7b fix(install): keep the Gitea token on the API host
The Contents API names a download_url for every file and the downloader
sent the token to it unchecked, so a hostile or compromised server could
point it at another host and collect GITEA_TOKEN or the generic git token.
A URL on another origin is now refused, which falls back to a git clone.

Adds the missing tests for the Gitea and CNB download paths.
2026-09-19 19:19:41 +00:00
Willie 1e054236bd Merge remote-tracking branch 'origin/main' into pr-168 2026-09-19 19:17:29 +00:00
Willie f52ae74c5f feat(audit): remember findings accepted via --force across updates
Overriding the audit gate with --force was per-invocation, so skills that
legitimately quote attack strings (security scanners, red-team docs) had to
be forced on every `update --all`. The only alternative, disabling the rule,
was global and turned it off for every skill.

Record the accepted findings (rule + file + matched text, no line number) in
.metadata.json under `audit_accepted`, keyed by skill relPath so it survives
entry rewrites and works for tracked repos. Later updates mark matching
findings as acknowledged and exclude them from the block decision; any new
finding, or the same rule matching different text, still blocks.

Staged installs audit a temp directory, so InstallOptions gains an
AuditAcceptRoot/AuditAcceptPath override pointing at the final destination.

Refs #279
2026-09-17 10:24:18 +08:00
Willie ea442b9f52 fix(install): skip directory symlinks when computing file hashes
Avoid discarding all file hashes when a directory symlink cannot be read as a file. Preserve file symlink hashing and error propagation for broken links and other hash failures.

Add regression coverage for directory symlinks, file symlinks, and broken links. Verified with make check in the devcontainer.

Refs #272
2026-09-05 11:42:39 +08:00
Willie 99fc3321b1 fix(install): recognise Windows drive-letter paths as local sources
Source parsing only treated inputs starting with /, ~, ./ or ../ as local
paths, so Windows paths such as D:\folder fell through to git URL parsing
and failed with "unrecognized source format" (or were expanded into a
bogus GitHub shorthand when written with forward slashes).

Refs #269
2026-09-02 13:08:40 +08:00
Willie efcc3e6f61 fix(update): honour installed branch in batch update and web UI check/update
Skills installed from a non-default branch record that branch in metadata,
but the grouped update path (update --all) cloned the remote default branch,
so the skills were either downgraded or reported as removed upstream and
pruned. The web UI update and check handlers had the same gap, comparing
against the remote HEAD instead of the installed branch.

Group batch updates and web UI checks by URL+branch, pass the branch through
to the clone, and resolve remote tree hashes for that branch as well.

Refs #268
2026-09-02 13:08:40 +08:00
Willie 4f46a08a8b fix(update): stage grouped updates so a blocked audit keeps the installed skill
The grouped update path (update --all) removed the existing skill directory
before copying the new content, and the audit-block cleanup then removed the
freshly copied content as well. A rejected update therefore deleted the
previously installed, already-audited version and left a stale metadata
entry that update --all could no longer discover.

Stage the new content in a temp directory when updating, audit it there, and
only swap it into place once the audit passes, matching the single-skill
update path.

Refs #271
2026-09-02 13:08:40 +08:00
Willie 0a3e669b09 fix(audit): decouple audit override from Force so --force reaches the gate
InstallOptions.Force carried two meanings: "overwrite what is already
there" and "proceed despite audit findings". Update paths set Force
unconditionally to overwrite a staged temp dir, so they had to leave it
off to keep the audit gate alive -- which swallowed the caller's --force
and made the gate impossible to override from either the CLI or the web
UI.

Split the audit intent into InstallOptions.AuditOverride and route every
gate through it alone. Entry points translate --force explicitly, so a
missed one degrades to "force has no effect" rather than "audit is
bypassed". Scan failures stay fail-closed regardless: accepting known
findings is not the same as being unable to learn any.

This also closes two paths that bypassed the gate outright, since both
inherited Force for overwrite reasons alone: install --json and grouped
batch updates.

In the web UI, Force Retry now appears only on failures force can
actually resolve -- a permission-denied unlink previously offered a
button that could never succeed -- and CLI-only flag hints are stripped
from messages rendered there.

Behaviour change: a --force at install time no longer exempts later
updates from the audit gate; it is a one-off decision per command.
2026-08-27 17:10:29 +08:00
Willie 8e4b9e5ae3 fix(install): scan explicitly requested target dot-dir roots
Discovery skips well-known target dot-dirs (.claude, .cursor, ...) so that
target-synced copies are not mistaken for source skills. filepath.Walk visits
the walk root first, so pointing an install directly at such a directory —
`skillshare install user/repo/.claude` — matched the guard on the root itself
and returned SkipDir before scanning anything, yielding zero skills.

Exempt the walk root from the dot-dir filter in discoverSkills and
scanAgentDir: it was requested explicitly, so filtering it can only discover
nothing. .git stays unconditionally skipped, and repo-root walks are
unchanged, preserving the original guard.
2026-08-06 11:17:03 +08:00
Colin Mason 325c9bb5f8 fix(update): resolve dot-dir subdirs in batch
Batch update looks up each skill's subdir in the discovery map, but
discovery deliberately skips target dot-dirs (.claude, .codex, ...) to
avoid counting target-synced copies as source skills. A skill installed
from such a subdir therefore never appears in the map and is falsely
reported as stale (deleted upstream), steering users toward --prune on a
healthy skill. Fall back to a direct SKILL.md stat in the cloned repo --
mirroring the single-skill update path -- before declaring the path
missing.

Fixes #261
2026-08-06 10:57:32 +08:00
zishuo 9fcba2744d feat: 支持配置自定义 CNB 和 Gitea 主机
将 CNBHosts 和 GiteaHosts 配置从 InstallContext 传递到 Source,使认证、平台检测和克隆操作能正确识别自定义的 CNB 和 Gitea 实例,而非仅依赖内置默认域名。
2026-06-23 18:45:43 +08:00
zishuo 45390d4761 feat: 支持 CNB 平台 API 安装与发现
新增 CNB (cnb.cool) 代码托管平台的 Contents API 支持,实现免克隆直接下载仓库子目录内容,用于技能的安装与发现。同时将 Gitea/CNB 的主机检测逻辑统一提取,并在 URL 解析中对 Gitea/CNB 主机显式处理 owner/repo 分割,修复了 Gitea/CNB 带子目录路径及 `.git` 后缀的解析问题。
2026-06-23 18:35:03 +08:00
zishuo 49e33c564d Merge remote-tracking branch 'upstream/main' into develop 2026-06-23 17:05:33 +08:00
Willie 30bdd72b6f fix: retry nested GitLab repo URLs
Retry generic HTTPS clone failures by progressively treating additional path segments as part of a nested GitLab repository. Limit retry to repo-boundary errors and preserve the final fallback error for debugging.
2026-06-18 23:56:54 +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 ebe8cc277e fix(install): prevent project root self-install
Reject project-mode installs that target the current project root and add a copy-layer guard that skips destination subtrees during recursive copies. This prevents install ./ -p from recursively copying .skillshare/skills into itself on Windows.
2026-06-15 22:21:46 +08:00
Willie 9e488bf5c1 fix(update): prevent panic when skill metadata is unreadable
A corrupt or unreadable .metadata.json caused LoadMetadataWithMigration
to return a nil store whose error was discarded, so update --all
dereferenced a nil MetadataStore in GetByPath and crashed with a raw
stack trace. Guard GetByPath against a nil receiver and surface the
load failure as a resolve warning instead.
2026-06-15 14:34:46 +08:00
Willie ab8bc4c1f2 Merge branch 'main' of github.com:runkids/skillshare 2026-06-15 11:13:03 +08:00
Willie c5544c5e65 fix(install): preserve unsafe blob subdirs for validation
Trim SKILL.md suffixes without filepath.Dir so traversal segments remain visible to SEC003 subdir validation. Add regression coverage for GitHub, GitLab, and Bitbucket blob-style skill URLs.
2026-06-15 11:12:44 +08:00
Willie d21d31e86c test(install): cover unsafe subdirs across source parsers
Add SEC003 regression cases for SSH, file, Azure, and generic HTTPS source parser branches so traversal rejection stays covered beyond the GitHub parser.
2026-06-15 11:12:44 +08:00
jnhu 087b5ee846 fix(install): validate repo subdir and source name in ParseSourceWithOptions
Reject unsafe subdirs that contain path traversal (..), NUL bytes,
control characters, backslashes, absolute paths, and URL-encoded
traversal (single, double, or overly deep encoding). Validate derived
source names and CloneURLs for NUL and control characters.

SEC003: github.com/owner/repo/../../etc/passwd previously produced a
Source with Subdir containing traversal segments. Now rejected.
2026-06-15 11:12:44 +08:00
Willie 0519b0bb52 fix: preserve readable metadata permissions
Ensure the atomic metadata save path writes .metadata.json with 0644 permissions so Git and other tooling can read it after install/update operations.
2026-06-15 10:46:38 +08:00
Willie 6f49546476 fix(install): warn when temp repo cleanup fails
Route temp clone cleanup through a shared helper that logs cleanup failures with path and error while preserving existing best-effort cleanup semantics.

Cover cleanup failure logging with a deterministic unit test.
2026-06-14 14:52:22 +08:00
Willie 01d721a670 fix(git): preserve push stdout diagnostics 2026-06-13 22:15:25 +08:00
Willie 54dd7d12a3 fix(update): surface missing tracked repos in update --all across CLI, API, and UI
When tracked repo metadata is committed but the gitignored clone dirs are
absent on a fresh machine, `update --all` silently reported zero work: the
batch path skipped missing repos with no message, and the web UI's
update-all paths only listed repos present on disk.

Missing tracked repos are now detected and surfaced everywhere:
- CLI: a warning block (human output) plus an aggregated
  `missing_tracked_repos` summary (names + one-shot rehydrate hint) in JSON;
  the per-item error is concise. Fixed for both global and project modes,
  and batch and single-target paths.
- Server: GET /api/update/missing-tracked-repos and the update-all/stream
  summaries report them; POST /api/update/rehydrate re-clones them from
  metadata (mirrors bare `skillshare install`).
- UI: the Update page shows a warning banner listing missing repos with a
  Rehydrate button; strings added to all 11 locales.

Closes #212
2026-06-11 15:32:28 +08:00
Willie ef57f030dc fix: report missing tracked repositories 2026-06-10 15:37:16 +08:00
Willie e4ba03334a chore: release v0.20.8 2026-06-05 13:56:07 +08:00
Willie 694d784799 fix(preview): render SKILL.md for non-github.com hub sources
The web UI skill preview always fetched SKILL.md via api.github.com, so skills from GHE or other non-github.com hubs showed only index metadata (name, description, tags) instead of the full rendered content.

FetchPreview now resolves the source platform: github.com and GHE use the host's REST Contents API, while other platforms (GitLab, Bitbucket, Azure, SSH) fall back to a shallow clone. Sources whose content can't be retrieved degrade gracefully with a clear notice in the modal.

Fixes #193
2026-06-03 15:37:57 +08:00
Willie 1d0ee69955 feat: support SSH hub sources for private and GHE hosts
Hub index fetch previously handled only unauthenticated HTTP(S) GET or
local file paths, leaving private and GitHub Enterprise repos out of
reach — raw HTTPS URLs redirect to login before token headers apply, and
SSH-style hub URLs were unrecognized.

Resolve SSH hub sources by shallow-cloning the repo with the user's SSH
keys and reading the index from it. The in-repo index path uses the
existing //path subdir convention (consistent with `install`), defaulting
to skillshare-hub.json at the repo root. Both scp-style and ssh:// URLs
are accepted. In the web dashboard, SSH clones are restricted to saved
hubs so a request-supplied URL can't drive an arbitrary clone.

Ref #185
2026-06-02 16:29:25 +08:00
Letiancheng Lee d35ed81789 fix: recognize GHE data residency hosts 2026-05-31 22:28:33 +08:00
Letiancheng Lee 980e7e3d87 fix: support custom SSH usernames 2026-05-31 22:28:33 +08:00
Willie fcbfd39be2 refactor(extensions): describe and rename built-ins by output
md2codex / md2gemini named the *input* (markdown) and read poorly. Rename
the bundled extensions after what they produce: codex-agents and
gemini-commands. Turn the BuiltinExtensions catalog into structs carrying
a human-readable description so the dashboard can explain each one before
install, and propagate the new names across tests and docs.
2026-05-30 19:23:12 +08:00
Willie f6eca1fc7d feat(ui): add extensions management to Config page
Add an "Extensions" tab to the Config page for managing transform
extensions in the active mode (global or project):

- GET /api/extensions lists installed extensions with their manifest
  descriptions, merged with the built-in catalog so users can see what
  is available to download.
- POST /api/extensions/install downloads a whitelisted built-in
  extension into the active mode's extensions directory.
- POST /api/extensions/open opens that directory in the user's editor,
  mirroring the skill "open in editor" affordance.

ExtensionSpec now carries the manifest description so the list can
surface it. The UI shows installed extensions with a built-in badge,
available built-ins with a Download button, and an Open-directory
action. Strings are translated across all 11 locales.
2026-05-30 19:23:12 +08:00
zishuo bbd9090348 fix: address bot review comments on PR #168
- fix(gitea): use shortHash instead of undefined shortCommitHash
- fix(gitea): use strings.LastIndex for robust SSH URL parsing
- fix(discovery): preserve warnings in Gitea API discovery fast path
- feat(auth): add detectPlatformFromHost with configured host support
2026-05-26 19:54:58 +08:00
zishuo c3c0764365 fix(gitea): use segment-by-segment path escaping in Contents API URL
Replace url.PathEscape(path) with escapeGiteaPath() that escapes each
path segment individually, preserving directory separators. The previous
approach would encode slashes as %2F, breaking nested subdirectory
downloads via the Gitea Contents API.
2026-05-26 19:21:31 +08:00
zishuo ce9593e98e feat(install): add Gitea platform support with API fast path
Support Gitea (gitea.com and self-hosted instances) as a git hosting
platform for installing skills. Includes both core platform integration
and a Gitea Contents API fast path for direct file downloads without
full git clone.

Platform support (P0):
- auth.go: add PlatformGitea, detect gitea hosts, resolve GITEA_TOKEN
- config.go / project.go: add gitea_hosts config field with normalization,
  env var merge (SKILLSHARE_GITEA_HOSTS), and EffectiveGiteaHosts()
- source.go: add isGiteaHost() and GiteaHosts to ParseOptions
- install.go: pass GiteaHosts from config to source parsing
- install_git.go: include GITEA_TOKEN in auth error hints

API fast path (P1):
- gitea_download.go: Gitea Contents API recursive directory download
  (GET /api/v1/repos/{owner}/{repo}/contents/{path}), matching the
  GitHub Contents API pattern
- install_apply.go / install_discovery.go: hook Gitea API fallback
  after sparse checkout, before full clone
2026-05-26 19:00:25 +08:00