Commit Graph
1839 Commits
Author SHA1 Message Date
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 dd7f14c07e chore: update built-in skill 2026-06-20 05:03:26 +08:00
Willie 90356071c7 chore: release v0.20.20 v0.20.20 2026-06-19 00:25:35 +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 d9e3df9fda chore: release v0.20.19 v0.20.19 2026-06-17 21:24:27 +08:00
Willie 2d06b004d5 fix(init): collapse shared skills discovery
Avoid presenting targets that share ~/.agents/skills as individually detected CLIs during init discovery. Show the universal shared-directory guidance instead and cover the re-init regression.
2026-06-17 20:55:27 +08:00
jnhu 6bddfbbe1d fix(trash): fix two regressions from PR #230 path hardening
- List() now uses trashLogicalName() to produce slash-separated logical
  names, preventing Windows backslash paths that validateTrashName rejects.
- ensureUnderBase/ensureStrictlyUnderBase now use filepath.Abs+filepath.Rel
  instead of string prefix, fixing false escapes when base is '.'.
- Add regression tests for Restore(entry, '.'), nested List->Restore roundtrip,
  sibling prefix rejection, and validateTrashName backslash enforcement.
2026-06-17 14:30:24 +08:00
Willie c09968dd6e chore: release v0.20.18
Update changelog surfaces and bundled skill metadata for v0.20.18.
v0.20.18
2026-06-16 23:19:58 +08:00
jnhu 1ad13588ad harden trash path boundary checks 2026-06-16 22:57:28 +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 5941891eef chore: release v0.20.17 v0.20.17 2026-06-15 22:39:44 +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 377faa8b06 chore: release v0.20.16 v0.20.16 2026-06-15 13:17:17 +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 a897c2cd6c test(backup): select newest backup dir to fix flaky symlink test
TestBackup_AfterSync_ResolvesSymlinks failed ~7-10% of runs. The cause
is in the test, not production: `sync` takes a pre-sync backup of the
target before creating the agent-browser symlink, and the explicit
`backup` takes a second one. When the two land in different clock-seconds
there are two timestamp dirs, and `entries[0]` (lexicographically oldest)
points at the pre-sync backup that predates the symlink, so the
symlinked-skill assertion fails.

Select the newest backup dir (last entry, ascending sort) so the
assertion targets the post-sync backup that actually contains the
resolved symlink. Verified 0/80 failures under -race.

ref #226
2026-06-14 20:57:31 +08:00
Willie 451785cf1f chore: release v0.20.15
Update changelog, website changelog, release notes, and built-in skill metadata for v0.20.15.
v0.20.15
2026-06-14 16:02:01 +08:00
Willie 306bf99e0e fix(version): handle release version formats
Accept leading v prefixes during version checks, keep local metadata builds in dev mode unless they are clean exact release tags, and prevent cleanup warnings from leaking into JSON-mode stderr.
2026-06-14 15:54:25 +08:00
Willie 140df6b4c9 fix(server): surface git fetch failures
Return errors from branch refresh and checkout when git fetch fails instead of serving stale refs or proceeding with checkout.

Cover branch-list and checkout fetch failures with server regression tests.
2026-06-14 15:08:19 +08:00
Willie 224607af81 fix(server): fail source updates when remote update fails
Update tracked repo remotes before persisting source metadata so the API cannot report success while the on-disk git remote remains unchanged.

Cover both remote update failure and successful remote plus metadata updates.
2026-06-14 15:01:51 +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 7280ec265f fix(version): reject malformed version segments
Return explicit comparison errors for non-numeric version segments instead of treating them as zero.

Fail closed in update checks when current or cached latest versions are malformed, and cover numeric, malformed, and cache-preserving cases.
2026-06-14 14:01:01 +08:00
Willie 5d684393f1 fix: propagate lint rule load errors 2026-06-14 13:44:36 +08:00
Willie e5cf18eef5 fix(server): preserve targets when cleanup fails 2026-06-14 13:37:35 +08:00
Willie bf34d8009b fix(ui): center audit finding severity dot 2026-06-14 13:37:35 +08:00
britz 1bcd02a3d9 fix: cache lint load error in package state to persist across Once calls 2026-06-14 13:37:24 +08:00
britz 4439d118fe fix: replace panic with error returns in loadLintRules and LintSkill 2026-06-14 13:37:24 +08:00
britz 11c31ab742 fix: handle os.Remove and filepath.Rel errors in symlink conversion 2026-06-14 02:43:32 +08:00
Willie 5740574af9 chore: release v0.20.14 v0.20.14 2026-06-13 22:20:12 +08:00
Willie 01d721a670 fix(git): preserve push stdout diagnostics 2026-06-13 22:15:25 +08:00
jnhu b48d23b312 fix(git): sanitize push remote error output 2026-06-13 22:07:03 +08:00
Willie 3ad54abb6e chore: release v0.20.13 v0.20.13 2026-06-11 16:15:25 +08:00
Willie 80f1e04657 fix(ui): surface missing tracked repos on Dashboard "Update All"
The Dashboard uses POST /api/update (not the stream) and only inspected
res.results.length, so a fresh machine whose only tracked repos are
missing on disk fell through to the "no tracked repos" toast with no
rehydrate hint — leaving one web update-all entry point with the old
issue #212 symptom.

- Type the POST /api/update response with missingTrackedRepos.
- Guard against a null results slice (Go returns nil → JSON null) before
  filtering, and only show "no tracked repos" when there is genuinely
  nothing — including no missing repos.
- When missing tracked repos are reported, show a warning toast pointing
  the user to the Updates page to rehydrate; string added to all 11 locales.

Follow-up to 54dd7d12.
2026-06-11 15:44:20 +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 fee069841b ci(website): split build and deploy jobs 2026-06-11 11:41:46 +08:00
Willie 5d60242585 ci: skip tests for docs-only changes 2026-06-11 11:24:35 +08:00
Willie 68639be975 ci(website): deploy to cloudflare pages 2026-06-11 11:06:10 +08:00
Willie d01a5b2cb4 docs: update v0.20.12 release notes v0.20.12 2026-06-11 01:50:39 +08:00
Willie abdee142b9 fix(ui): respect agent filters during sync 2026-06-11 01:46:08 +08:00
Willie 59754ca3e6 fix(sync): resolve agent target aliases 2026-06-11 01:32:34 +08:00
Willie 060886c281 chore: release v0.20.12 2026-06-11 01:18:10 +08:00
Willie 51656e9cb3 fix(sync): keep project agent symlinks stable across syncs on symlinked paths
Project-mode agent sync re-reported every agent as updated on the second
sync when the project lived under a symlinked ancestor (e.g. macOS temp
dirs under /var -> /private/var), failing idempotency on macOS CI.

Two interacting causes:

- shouldUseRelative was unstable: on the first sync the target directory
  does not exist yet, so evalOrClean fell back to a non-resolved path and
  the under-project-root check failed, producing an absolute link; on the
  second sync the directory existed and resolved, so it wanted a relative
  link and reformatted the existing one. evalOrClean now resolves the
  deepest existing ancestor and re-appends the missing tail, so the answer
  is the same whether or not the leaf exists.
- The existing-symlink comparison only did a direct string compare, so a
  stable relative link whose resolved target carried the unresolved alias
  prefix looked like it pointed elsewhere. It now canonicalizes both sides
  via EvalSymlinks on the slow path, mirroring isSymlinkToSource.

Adds a regression test that reproduces the symlinked-ancestor case on any
platform.
2026-06-11 01:18:05 +08:00
Willie 9176c86ae9 feat(targets): add agents sync and factory alias to droid target
Factory Droid stores custom droids as markdown with YAML frontmatter in
.factory/droids/, which maps onto skillshare's existing agents sync. Add
the agents path so droids sync alongside skills, and register a factory
alias so the target is discoverable by brand name.

Refs #213
2026-06-11 00:53:27 +08:00
Willie 2b08bdf400 fix: use relative project symlinks for agents 2026-06-10 23:39:45 +08:00
Willie 78b3fc0085 chore: release v0.20.11 v0.20.11 2026-06-10 22:37:16 +08:00