Skip to content

feat(skills): native Rust market download (HarmonyOS) - #242

Closed
hanlinyu1030 wants to merge 3 commits into
mainfrom
hly_feature
Closed

hanlinyu1030 wants to merge 3 commits into
mainfrom
hly_feature

Conversation

@hanlinyu1030

@hanlinyu1030 hanlinyu1030 commented Aug 25, 2026 •

Copy link
Copy Markdown
Collaborator

Description:
让技能市场在鸿蒙 PC 上可用。

修复

  • 下载失败(exit code -1):用纯 Rust 下 GitHub tarball + 解压 + 原子落盘替代 npx skills add。按 SKILL.md frontmatter name 定位 skill,兼容 slug≠文件夹名(vercel 那种)和嵌套目录。
  • 列表超时:列表 client 改用 BitFun ProxyConfig;加 offset 分页;去掉会掐断慢直连的激进超时(per-page 4s 兜底描述抓取)。
  • 项目级 skill 装完消失:没开真实项目时自动激活助理工作区,旧守卫只查 hasWorkspace 不查 workspaceKind → skill 落到助理目录、切走工作区后从列表消失。加 isAssistantWorkspace 判断,助理为 current 时禁用 project 级(卡片 disabled + 详情弹窗 project 按钮 hidden + 提示),保留 user 级。

hanlinyu1030 and others added 3 commits August 25, 2026 20:41
…agination

- Replace npx/bun skill install with pure-Rust GitHub tarball download + gzip/tar
  extract + atomic install. Works on HarmonyOS (where the bundled bun binary
  V8-aborts, exit code -1) without Node/npx/bun. Locates the skill by SKILL.md
  frontmatter `name` (== skills.sh slug) so repos whose folder name differs from
  the slug (vercel-labs/agent-skills) and nested layouts both install.
- Listing: per-call build_market_client reads BitFun ProxyConfig live (HarmonyOS
  connectivity — otherwise skills.sh direct times out) + UA; real offset pagination
  (over-fetch+slice, no grow-limit); blocks on description fill so cards appear
  with descriptions. No aggressive per-request timeout (skills.sh is international;
  a slow-but-reachable direct connection can take 8-20s and a tight connect_timeout
  would cut it). Each per-skill description fetch is bounded by the 4s per-page
  timeout.
- New get_skill_descriptions command + fetch_descriptions_for_ids helper.
- Filter reqwest/rustls/rustls_platform_verifier/hyper to Warn (stop per-connection
  DEBUG log flood).

Known limit: per-page listing ~4-8s cold is inherent (skills.sh legacy search
has no description field; v1 API needs Vercel OIDC auth BitFun cannot obtain;
per-skill HTML scrape is the only no-auth source). Process cache speeds repeat
views.
…s active

When no real project is open, BitFun auto-activates an assistant workspace as currentWorkspace. hasWorkspace only checked non-null (not workspaceKind), so project-level skill install landed in <assistant>/.bitfun/skills/ and 'disappeared' when the workspace switched (scan root changed; files still on disk). Add isAssistantWorkspace to useWorkspaceManagerSync; in useSkillMarket.handleDownload and useInstalledSkills.handleAdd, block project-level when assistant is current (no auto-fallback to user). SkillsScene: market card download button disabled, detail-modal project button hidden + a noWorkspace hint, manual-add project level option disabled + projectDisabled label. User-level install stays available. Reuses existing messages.noWorkspace text (no new i18n key). Matches the existing pickWorkspaceForProjectChatSession pattern that already excludes Assistant.
@SWangHash SWangHash closed this Aug 26, 2026
@SWangHash
SWangHash deleted the hly_feature branch August 26, 2026 01:34
@hanlinyu1030
hanlinyu1030 restored the hly_feature branch August 26, 2026 08:42
@hanlinyu1030
hanlinyu1030 deleted the hly_feature branch August 26, 2026 08:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants