feat(skills): native Rust market download (HarmonyOS) - #242
Closed
hanlinyu1030 wants to merge 3 commits into
Closed
hanlinyu1030 wants to merge 3 commits into
hanlinyu1030 wants to merge 3 commits into
Conversation
…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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description:
让技能市场在鸿蒙 PC 上可用。
修复
npx skills add。按 SKILL.md frontmattername定位 skill,兼容 slug≠文件夹名(vercel 那种)和嵌套目录。ProxyConfig;加 offset 分页;去掉会掐断慢直连的激进超时(per-page 4s 兜底描述抓取)。hasWorkspace不查workspaceKind→ skill 落到助理目录、切走工作区后从列表消失。加isAssistantWorkspace判断,助理为 current 时禁用 project 级(卡片 disabled + 详情弹窗 project 按钮 hidden + 提示),保留 user 级。