Commit graph

780 commits

Author SHA1 Message Date
chenbaowang
0bef6fd0c7 feat(api): enhance permission checks for skill lifecycle operations
Add platformRoles parameter to skill lifecycle methods:
- hideSkill, archiveSkill, unhideSkill, unarchiveSkill, deleteVersion
- Support SUPER_ADMIN and SKILL_ADMIN role bypass
- Add hideSkillAsAdmin and unhideSkillAsAdmin for admin controllers
- Fix userId null checks in rating and star controllers

Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-openagent)

Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
2026-04-24 18:34:15 +08:00
chenbaowang
b25bbf50f3 fix(api): resolve API token authentication issues for skill operations
- Fix SkillStarController to use @RequestAttribute instead of @AuthenticationPrincipal
- Fix SkillRatingController to use @RequestAttribute instead of @AuthenticationPrincipal
- Fix SkillGovernanceService NPE when userNamespaceRoles is null
- Update ApiTokenAuthenticationFilter to properly populate userNsRoles
- Enhance error messages for 403 vs 401 status codes

Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-openagent)
Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
2026-04-24 17:34:46 +08:00
chenbaowang
5caf0b360b feat(cli): reorganize help categories - merge Skill Lifecycle into Publish & Manage
- Merge 'Skill Lifecycle' commands (archive, hide, unhide) into 'Publish & Manage'
- Move 'reviews' from My Profile to Publish & Manage (related to publish workflow)
- Rename section from 'Publish & Content' to 'Publish & Manage'

Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-openagent)
Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
2026-04-24 16:45:30 +08:00
chenbaowang
0bfcb028c2 feat(cli): move namespaces to me subcommand and reorganize help categories
- Add 'me namespaces' subcommand to list accessible namespaces
- Remove standalone 'namespaces' command from CLI
- Rename 'My Skills' help section to 'My Profile'
- Move namespaces listing under My Profile section

Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-openagent)
Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
2026-04-24 15:41:00 +08:00
chenbaowang
d273cac65c feat(cli): update hide/unhide commands and reorganize help categories
- Remove 'admin only' restriction from hide/unhide commands
- Update API endpoint from admin path to portal path
- Reorganize help categories:
  - Move rating to My Skills section
  - Create new Skill Lifecycle section (archive, hide, unhide)
  - Remove hide/unhide from Notifications & Admin

Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-openagent)
Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
2026-04-24 15:20:28 +08:00
chenbaowang
1ba1c9018a feat(api): unify permission checks for hide/unhide/archive operations
Add unified permission model for skill lifecycle operations:
- Skill owners can hide/unhide/archive their own skills
- Namespace admins/owners can manage skills in their namespace
- Platform admins retain full access via admin endpoints

Changes:
- SkillGovernanceService: add permission checks to hideSkill/unhideSkill
- SkillLifecycleAppService: add hideSkill/unhideSkill methods
- GovernanceWorkflowAppService: add facade methods for hide/unhide
- SkillLifecycleController: add POST /{namespace}/{slug}/hide and /unhide endpoints

Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-openagent)
Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
2026-04-24 15:19:17 +08:00
chenbaowang
c14b844c10 refactor(cli): merge list/check commands, unify skill status display
- Merge list and check into unified list command with status filtering
- Add skill-status.ts core module for shared discovery logic
- Unify interaction flow: scope -> agent -> status -> display
- Replace -g/-p/-a flags with --scope option
- Simplify check as alias for list --status managed,missing
- Fix uninstall to properly handle 'All' scope selection
- Display orphaned skills with [orphaned] marker in uninstall
- Update help text and examples

BREAKING CHANGE: Removed -g/--global, -p/--project, -a/--all flags from list command.
Use --scope global|project|all instead.
2026-04-24 14:58:07 +08:00
chenbaowang
d96fb008f9 feat(cli): enhance error handling and auto-create output directory 2026-04-24 11:40:50 +08:00
chenbaowang
bc9b3d1eb2 fix(cli): rename loop variable to avoid conflict with info function 2026-04-24 11:39:54 +08:00
chenbaowang
67c0726046 fix(cli): enhance 503 error handling in download command 2026-04-24 10:58:55 +08:00
chenbaowang
898325ac67 fix(cli): restore -v short option for --skill-version 2026-04-24 10:24:10 +08:00
chenbaowang
84a7288621 fix(cli): remove debug logging from api-client 2026-04-24 10:18:36 +08:00
chenbaowang
aa9fd5f771 feat(cli): add command aliases and unhide command 2026-04-24 10:16:16 +08:00
chenbaowang
803540b157 feat(auth): 优化权限配置,扩展 SKILL_ADMIN 和 AUDITOR 权限
## 后端修改
- 添加 RouteSecurityPolicyRegistry 权限配置(修复12个CLI命令403错误)
  - /api/v1/me/** - 用户个人相关
  - /api/v1/notifications/** - 通知相关
  - /api/v1/reviews/** - 审核相关
  - /api/v1/skills/** POST/PUT - archive, rating, report
  - /api/v1/namespaces/** POST - transfer
  - DELETE /api/v1/skills/*/* - 改为所有者可删除
- AdminSkillController: hide/unhide 允许 SKILL_ADMIN
- SkillDeleteController: delete 允许 SKILL_ADMIN
- 新增 AdminAuditorController: 审计员专用控制器

## CLI修改
- publish.ts: 修复 -v 选项冲突,改为只使用 --skill-version

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-24 00:47:53 +08:00
chenbaowang
f4752f2d9b feat(cli): 优化 download 和 update 命令,添加友好错误提示
- download: 添加智能搜索 namespace 和交互式版本选择
- download: 修复下载失败仍创建文件的问题
- update: 重写为带版本对比的更新流程
- update: 添加 -y/--yes 选项跳过确认
- star/rating/rate/report/delete/archive/hide/unhide: 添加 404 友好错误提示
- 提示用户使用 namespace/skill-name 格式
2026-04-23 17:32:13 +08:00
chenbaowang
273e14a26f feat(cli): 添加 --namespace 选项和智能 namespace 解析
- 新建 skill-resolver.ts 公共函数,提供 resolveSkillNamespace 和 parseSkillNamespace
- 为 resolve, download, star, rating, rate, report, delete, archive, hide, unhide 添加 --namespace 选项
- inspect 使用 resolveSkillNamespace 替代手动解析
- install 优化 --from 为主选项,-a, --add 为别名
- download 优化帮助界面,添加 Examples 和更清晰的描述
2026-04-23 15:20:38 +08:00
chenbaowang
58ee1a5220 fix(install): 修复帮助文本中的循环引用
将 --from 描述改为 'Alias for --add',避免与 -a, --add 的
描述互相引用导致循环感
2026-04-23 14:17:10 +08:00
chenbaowang
3239b4d5b8 fix(inspect): 修复版本选项与全局 --version 冲突
将 inspect 命令的版本选项从 --version 改为 --skill-version,
避免与 skillhub --version 全局版本选项冲突
2026-04-23 14:08:39 +08:00
chenbaowang
08ce3d59a1 feat(cli): 优化帮助界面和命令结构
- 重新组织帮助分类(Publish → Publish & Manage)
- 统一参数命名为 <skill>,添加参数说明
- 简化 config 命令描述
- 优化 explore 帮助,添加选项分组和示例
- 修复参数重复显示问题
- 子命令帮助显示 Arguments 部分
2026-04-23 12:33:04 +08:00
chenbaowang
c7d4f8273d feat(cli): enhance inspect with interactive selection and reorganize help sections
- Add interactive namespace selection to inspect command (like install)
- Add version selection when multiple versions exist (--version to skip)
- Skip version selection when --details is specified (shows all versions)
- Add error handling for 403/404 errors with helpful messages
- Add 'for installation' and 'for details' hints to explore command
- Reorganize help: separate 'Discover & Info' and 'Social & Reviews' sections
2026-04-22 18:02:53 +08:00
chenbaowang
f33a9e0a10 feat(cli): add inspect hint after explore selection 2026-04-22 16:40:51 +08:00
chenbaowang
4a7ebb4efc feat(cli): implement comprehensive sort strategy with backend and client-side sorting
- Backend sorts (direct API): newest, downloads, rating
- Client-side sorts (fetch then re-sort): hot, stars
- Add --rating option for rating-based sorting (backend supported)
- Add applyClientSort() function for client-side sorting logic
- Hot sort formula: downloads * 0.6 + stars * 0.4
- Update SearchSkill interface to include stars, rating, updatedAt fields
- Ensure all sort options work correctly with both list and search APIs
2026-04-22 16:35:06 +08:00
chenbaowang
2fffc2b377 fix(cli): remove unsupported rating sort, add stars sort, clean up versions command
- Remove --rating option and rating sort (API doesn't support it)
- Add --stars shorthand for star-based sorting
- Fix interactive-search.ts to use stars sort instead of rating
- Add ratingAvg field to SkillDetail and display in explore output
- Delete deprecated versions.ts command (functionality merged into inspect)
2026-04-22 16:01:12 +08:00
chenbaowang
3349182072 fix(cli): fix show-env-instructions output format
- Replace dim() function calls with chalk.dim() to return strings
- Use array join approach for clean output formatting
- Fix undefined output in environment variable instructions
2026-04-22 14:11:31 +08:00
chenbaowang
a1fb6d261e feat(cli): simplify config command and enhance inspect/install
- Simplify config command: remove <key> parameter, hardcode registry
- config set <value> now directly sets registry URL
- config get shows resolved value with source information
- Add --source option to config get for env/file/resolved
- Add version normalization (strip 'v' prefix) in install
- Skip version selection when --skill-version or --tag specified
- Enhance inspect with --details option for version history
- Reorganize help: Configuration at top, Discover & Info merged
- Move SkillVersionItem types to schema/routes.ts
- Fix error handling to return after setting exit code
- Remove versions command registration (file retained for compatibility)
2026-04-22 13:45:16 +08:00
chenbaowang
acea441625 feat(cli): enhance inspect/install commands and reorganize help
- Add --details option to inspect for version history and tags
- Normalize version input (strip 'v' prefix) in install command
- Skip version selection when --skill-version or --tag is specified
- Reorganize help: merge Discover & Info sections
- Move SkillVersionItem/VersionsResponse types to schema/routes.ts
- Remove versions command registration from CLI (file retained for now)
- Fix error handling to return after setting exit code
- Update tests to reflect command changes
2026-04-21 19:40:02 +08:00
chenbaowang
d4ea485662 fix(cli): fix registry config priority for login and all commands
- Remove hardcoded default from Commander --registry option that
  overrode config file settings in ALL commands
- Login command now uses loadConfigFromProgram() like other commands
  instead of hardcoded http://localhost:8080
- Improved login error messages with registry URL context
2026-04-21 17:32:06 +08:00
chenbaowang
d96ef86fac fix(cli): replace process.exit(1) with process.exitCode = 1
process.exit() forcefully kills the process, preventing libuv from
cleanly closing HTTP connections (undici). On Windows this triggers
an assertion failure: UV_HANDLE_CLOSING.

Using process.exitCode = 1 lets Node.js exit gracefully after the
event loop drains, eliminating the assertion error while still
returning exit code 1.
2026-04-21 10:54:50 +08:00
chenbaowang
8815c1596c fix(cli): human-readable API error messages
ApiError previously displayed raw JSON like:
  API error 403: {"code":403,"msg":"Access denied..."}

Now extracts the msg field from the API response body and displays:
  Access denied to skill: find-skills
  Run `skillhub login` to authenticate.

Changes:
- Add extractHumanMessage() to pull msg/message/error from response
- ApiError.message now shows human text instead of raw JSON
- 401/403 responses append login hint
- whoami: remove redundant 'Not authenticated:' prefix
2026-04-21 10:21:32 +08:00
chenbaowang
f5caed955e chore: remove local scripts from git tracking
Remove scripts/notify-feishu.sh and scripts/release-cli.sh from git tracking
as they are local utility files. Added to .gitignore to prevent future
accidental commits.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-21 10:11:32 +08:00
chenbaowang
b332d0ba97 Merge remote-tracking branch 'upstream/main' into feat/skillhub-cli-v2 2026-04-21 09:51:21 +08:00
chenbaowang
6a6df19f4b chore(cli): bump version to 1.1.3 for --registry parameter fix 2026-04-21 00:12:01 +08:00
chenbaowang
2543cd52e7 fix(cli): make --registry parameter work for all commands
Fixed the issue where the --registry command-line parameter was defined
but not actually used by any commands.

Changes:
- Added loadConfigFromProgram() helper in config.ts to read registry from program.opts()
- Updated all 21 command files to use loadConfigFromProgram() instead of loadConfig()
- Ensured correct priority: CLI args > env vars > config file > defaults

Priority order:
1. --registry <url> (command-line flag) - highest priority
2. SKILLHUB_REGISTRY (environment variable)
3. ~/.skillhub/config.json (config file)
4. http://localhost:8080 (default value)

This allows users to temporarily override the registry without modifying
environment variables or config files, providing better flexibility for:
- Testing against different registries
- Multi-project/multi-environment setups
- CI/CD automation scripts

Updated commands:
- install, download, update, check, sync, uninstall
- explore, search
- publish, delete, archive, versions
- inspect, resolve, rating, rate, star, report, reviews
- whoami, me, namespaces, notifications
- transfer, hide, unhide

Fixes issue where `npx motovis-skillhub install <skill> --registry <url>`
would ignore the --registry parameter and use env vars or defaults instead.
2026-04-21 00:07:15 +08:00
chenbaowang
d6b9f026b4 revert(web): restore vite.config.ts to use port 3000
Revert the vite.config.ts changes from e93adaa that changed the dev
server port from 3000 to 8181 and added local dev features (env loading,
serve-skill-md plugin, proxy headers). These were local development
configs that broke CI by changing the port away from 3000 which the
Makefile health check expects.
2026-04-20 21:17:55 +08:00
chenbaowang
ee18161d56 feat(cli): improve list and check commands with better filtering
list.ts:
- Remove locked universal section, all agents are now equal
- Users manually select which agents to list from
- No default selections, cleaner UX

check.ts:
- Add agent filtering via --agent flag or interactive selection
- Add status filtering via --status flag or interactive selection
- Default to showing only OK + Missing (not Orphaned)
- Interactive prompts for scope, agents, and statuses
- Show agent names and scope prefix in output
- Smart defaults reduce noise from orphaned skills
2026-04-20 20:24:44 +08:00
chenbaowang
3cf4d64cf5 chore(cli): bump version to 1.1.2 2026-04-20 19:53:35 +08:00
chenbaowang
04bc62fed4 feat(cli): add scope-aware universal grouping and improve output formatting
- list.ts: use isUniversalForScope for dynamic grouping based on scope
- list.ts: group output by skill name to avoid duplicate path listings
- uninstall.ts: use isUniversalForScope for dynamic grouping
- uninstall.ts: add printUninstallResults for consistent formatted output
- .npmignore: exclude development files from npm package
- package.json: bump version to 1.1.1
2026-04-20 19:49:17 +08:00
chenbaowang
e5da7397fa refactor(cli): sort all list outputs and agent names alphabetically
- update.ts: sort skill selection list alphabetically
- check.ts: sort results by status then name, sort agent names in locations
- install.ts: sort agent names in buildAgentSummary, sort --list output
- sync.ts: sort discovered skills by name before display

Ensures consistent alphabetical ordering across all CLI commands for
better user experience and predictability.
2026-04-20 19:49:16 +08:00
chenbaowang
b6301cb9a9 chore(cli): bump version to 1.1.0 2026-04-20 19:49:16 +08:00
chenbaowang
86b8de1fbc feat(cli): merge install results by path for cleaner output
Group agents that share the same install path into a single line.
When more than 5 agents share a path, show first 5 names + count.
Sort agent names alphabetically within each group.
Extract buildInstallResultLines utility function to DRY up
duplicate output logic in installFromRegistry and installFromGit.
2026-04-20 19:49:15 +08:00
chenbaowang
aaf80dbfd8 fix(cli): sort agent lists alphabetically and fix spinner residue
- Sort universal and non-universal agent lists by name in selectAgentsInteractive
- Exclude agents with showInUniversalList===false from locked section
- Replace spinner.stop() with spinner.succeed() before interactive prompts
  to prevent 'Fetching' text from appearing as the step title
- Also fix spinner.stop -> spinner.succeed for 'Installation complete'
2026-04-20 19:49:15 +08:00
chenbaowang
3353953675 fix(cli): determine scope before agent selection for correct universal grouping
- Move scope selection before agent selection in both installFromRegistry
  and installFromGit flows
- Use isUniversalForScope in selectAgentsInteractive so that the Universal
  locked section correctly reflects the actual scope:
  - Project: agents with skillsDir='.agents/skills' (Cline, Codex, Cursor, etc.)
  - Global: agents with globalSkillsDir='.agents/skills' (Cline, Warp only)
- Clean up unused getUniversalAgents/getNonUniversalAgents imports
2026-04-20 19:49:15 +08:00
chenbaowang
32395ee5c2 refactor(cli): use dynamic isUniversalForScope instead of static isUniversalAgent
- Add isUniversalForScope(agent, isGlobal) and getAgentTargetDir(agent, isGlobal) to agent-detector.ts
- An agent is 'universal' when its target install dir equals the canonical .agents/skills directory
- This fixes incorrect symlink skipping for agents like Codex/Cursor whose globalSkillsDir
  differs from .agents/skills (e.g. .codex/skills, .cursor/skills)
- Update installer.ts to use dynamic check via optional AgentInfo parameter
- Update install.ts to use getAgentTargetDir and pass agent info to installSkill
- Update uninstall.ts to use isUniversalForScope for correct path resolution
- Clean up unused isUniversalAgent import in list.ts
2026-04-20 19:48:58 +08:00
dongmucat
acc8899abb
Merge pull request #328 from iflytek/fix/gitlab-oauth-release-env
fix(env): add gitlab oauth release example config
2026-04-20 14:04:25 +08:00
dongmucat
1d0d6be816 fix(env): add gitlab oauth release example config 2026-04-20 13:54:41 +08:00
chenbaowang
ea4e206ad6 chore(cli): update .npmignore and add release scripts
- Remove "还未发布" from .npmignore, add src/ to excludes
- Add scripts/notify-feishu.sh for Feishu bot release notifications
- Add scripts/release-cli.sh for one-click CLI release workflow
2026-04-20 10:42:12 +08:00
chenbaowang
39db503700 fix(cli): improve install spinner messages and fix interactive search conflict
- Stop spinner before runInteractiveSearch to prevent terminal UI conflict
  (same issue as version selection p.select)
- Make spinner messages more specific: include skill name, version, path
  instead of generic "Fetching"/"Downloading"/"Extracting"
2026-04-20 09:37:59 +08:00
wrj97
7be6a36960
feat(auth): add GitLab OAuth2 provider support (#264)
* feat(auth): add GitLab OAuth2 provider support

Add GitLab as an additional OAuth2 authentication provider alongside
GitHub. This includes:

- GitLab OAuth2 client configuration with customizable base URL
- GitLabClaimsExtractor for handling GitLab-specific user claims
- Multi-provider login UI with provider-specific icons
- Updated localization to use OAuth-agnostic terminology
- JSON type annotation for IdentityBinding entity

* fix(auth): restore oauth redirect and gitlab email checks

* test(auth): align oauth login handler expectation

---------

Co-authored-by: wowo-zZ <zhenggui5228@126.com>
2026-04-17 19:56:32 +08:00
chenbaowang
90809c47ab fix(cli): stop spinner before version selection to prevent UI conflict
The ora spinner was still running during p.select() interactive prompt,
causing the spinner to continuously overwrite the terminal and block
the version selection UI. The user would see "Fetching..." stuck until
pressing Enter.

Stop spinner before p.select() and restart after selection completes.
2026-04-17 18:49:23 +08:00
XiaoSeS
080be28eef
fix(search): align portal visibility for private skills (#323)
* feat(ci): add AI-powered release notes generation

- Add GitHub Models integration for automated release notes
- Support bilingual (EN) release notes with highlights extraction
- Fallback to conventional commit grouping when LLM unavailable
- Trigger on tag push or manual workflow dispatch
- Zero configuration: uses GitHub Models (gpt-4o-mini) by default

* chore: pin action versions and update gitignore

- Pin checkout and setup-deno to commit hashes matching project convention
- Add .playwright-mcp/ and .mcp.json to gitignore

* fix(search): keep private skills out of portal discovery

- remove super admin expanded visibility from portal search
- exclude all private skills from portal search results
- keep namespace-only skills visible only to namespace members
- reserve private skill access for my-skills and future admin surfaces

* test(search): update test to reflect portal visibility policy

- rename test from platformWideAccessShouldBypass... to platformWideAccessShouldNotBypass...
- verify that platformWideAccess flag does not grant extra visibility in portal search
- verify PRIVATE skills are excluded from search SQL
- aligns test with new requirement: portal search uses standard visibility rules

* test(search): update app service test for portal visibility policy

- rename test from search_shouldGrantPlatformWideAccessToSuperAdmin to search_shouldNotGrantPlatformWideAccessToSuperAdminInPortal
- verify super admin does not get platformWideAccess in portal search
- aligns with requirement: portal uses standard visibility, admin features reserved for dedicated interface
2026-04-17 17:46:05 +08:00