Commit graph

875 commits

Author SHA1 Message Date
dongmucat
8bdcdab652 fix(cli): regenerate bun.lock against default registry
The previous lockfile had all 138 dependency tarball URLs pinned to
registry.npmmirror.com (leaked from a developer's ~/.npmrc). This made
`bun install --frozen-lockfile` slow or hang on GitHub-hosted runners
located outside China — observed on macos-latest in PR #436 (stuck
9+ minutes on bun install).

Regenerated with the default registry so URLs resolve at install time
via the client-configured registry instead of being baked into the
lockfile.
2026-05-14 17:45:32 +08:00
dongmucat
a9bc076f81 chore(cli): bump version to 0.1.6 2026-05-14 17:18:46 +08:00
dongmucat
356e507cf9
Merge pull request #434 from iflytek/worktree-fix-promotion-download
fix(promotion): copy bundleReady and downloadReady when promoting skill to global
2026-05-14 15:50:06 +08:00
dongmucat
afa6b6c834
Merge pull request #417 from iflytek/fix/admin-skill-scan-bypass
fix(security): trigger security scan for admin-published skills
2026-05-14 14:50:53 +08:00
dongmucat
9dfbed2ef1
Merge pull request #422 from iflytek/feat/cli-auto-build
feat(cli): add automated build and publish workflow
2026-05-14 14:50:27 +08:00
dongmucat
2af0bf184b fix(promotion): copy bundleReady and downloadReady when promoting skill to global
When approving a promotion, the new SkillVersion was created without copying
bundleReady and downloadReady from the source version, causing the download
button to be permanently disabled for promoted skills.
2026-05-14 14:32:36 +08:00
Cheney
f59a10e36f chore(ci): remove temporary publish-script test workflow 2026-05-13 09:28:28 +08:00
Cheney
48174c9ad2 fix(cli): match 'push' anywhere in git args, not just $1
The script calls `git -C /path push ...` so the first arg is `-C`,
not `push`. Use glob match on full args instead.
2026-05-13 09:27:44 +08:00
dongmucat
5ccb7f9cf7
Merge pull request #423 from iflytek/feat/landing-cli-tab
feat(web): add CLI install tab on landing quick start
2026-05-13 09:27:39 +08:00
Cheney
dad06b465d fix(cli): fix exit code capture in tests using git wrappers
The `status="$(env ... printf | bash ... && echo 0 || echo $?)"` pattern
doesn't correctly capture the script's exit code because the command
substitution and pipe interact poorly. Use direct assignment with
`|| status=$?` instead.
2026-05-13 09:26:33 +08:00
Cheney
935054cc9e fix(cli): use git wrapper for push-failure test
The old approach (breaking origin URL) caused `git pull` to fail
before reaching the push step. Use a git wrapper that only fails
on `push` so the rest of the script runs normally.
2026-05-13 09:18:19 +08:00
Cheney
c520f38135 fix(cli): remove unreliable race-condition test, renumber tests
Remove test 7 (remote tag race condition) — the scenario is nearly
impossible with the new baseline sync logic and too complex to
reliably simulate. Fix variable naming inconsistencies from the
renumbering.
2026-05-13 09:16:19 +08:00
Cheney
1c29cfac57 test(cli): add debug logging to race-condition test wrapper 2026-05-12 18:05:02 +08:00
Cheney
85a758bbdd fix(cli): rewrite test 7 to cover real remote tag race condition
Old test 7 used `--no-tags` config to prevent fetch from pulling the
remote tag, but that doesn't reflect any real-world scenario. With the
new baseline sync logic, a pre-existing remote tag would be synced
into the local version, eliminating the conflict path the test claimed
to cover.

Replace with a git wrapper that injects the conflicting tag into origin
right before the script's `ls-remote` check, which simulates a real
race between two developers attempting to release the same version.
2026-05-12 18:02:02 +08:00
Cheney
c1c12c56eb fix(cli): gitignore test scaffolding files in publish-cli tests
Tests write stdout.log/stderr.log into the test repo root, which made
`git status --porcelain` non-empty and broke test 3 (non-main branch
abort) by tripping the dirty-tree check first.

Add a .gitignore to the test fixture repo to filter out these files.
2026-05-12 17:57:32 +08:00
Cheney
1420ffac56 test(ci): add temporary workflow to test publish-cli script
This workflow runs scripts/tests/publish-cli-test.sh in CI to verify
the publish script changes. Will be removed after verification.
2026-05-12 17:53:12 +08:00
Cheney
eeb2540a3e fix(cli): align checkout ref across all workflow jobs
publish-npm and create-release now checkout the same ref as
build-and-test (the input tag or push ref), preventing source
mismatch between npm package and GitHub Release artifacts.
2026-05-12 17:29:58 +08:00
Cheney
70b962a4c8 fix(cli): harden release pipeline per PR #422 review
1. npm version check: three-state logic (exists/missing/error) to prevent
   silent skip on network failures, registry 5xx, or auth issues.

2. workflow_dispatch: checkout the specified tag and validate SHA matches,
   preventing builds from wrong ref.

3. Atomic push: use `git push --atomic` and detect unpushed tags via
   `git ls-remote` instead of `--no-merged` (catches branch-pushed-but-
   tag-failed state).
2026-05-12 17:15:35 +08:00
Cheney
8126faa452 fix(cli): detect and guide recovery of unpushed release artifacts
Add pre-flight check in publish-cli.sh to detect unpushed commits and tags
from previous failed pushes. When detected, the script exits with clear
recovery instructions:

1. Retry push (for transient network failures)
2. Rollback and re-release (for clean restart)

This prevents the baseline sync logic from skipping failed versions when
local tags participate in version calculation after a push failure.

Addresses feedback from dongmucat in PR #422.
2026-05-12 16:14:47 +08:00
Cheney
159886b76d fix(cli): ensure create-release depends on publish-npm and rewrite publish-cli tests
1. Update release-cli.yml to make create-release depend on publish-npm with proper skip_npm handling, preventing half-released state where GitHub Release exists but npm package is unavailable.

2. Rewrite publish-cli-test.sh to cover the new publish flow: main branch check, dirty tree detection, tag baseline sync, version bumping, tag conflict detection, user cancellation, and atomic push verification.
2026-05-12 16:12:57 +08:00
dongjiang
41b1d03cfc
Add AGENTS.md and SKILL.md to support AI tools (#393)
Signed-off-by: dongjiang <dongjiang1989@126.com>
2026-05-12 15:35:17 +08:00
dongmucat
fed4eeb2b9 fix(web): make quick start tab icons exhaustive 2026-05-12 14:08:29 +08:00
dongmucat
8931f6d241 feat(web): add CLI install tab on landing quick start
Add a third peer tab 'CLI' to LandingQuickStartSection that surfaces the
official install command 'npm i -g @astron-team/skillhub'. Layout uses
grid-cols-1 md:grid-cols-3 so mobile shows tabs stacked and desktop
shows three equal-width columns.

Addresses iflytek/skillhub#419 (homepage Quick Start part only).
2026-05-12 11:05:02 +08:00
Cheney
490ddfa548 fix(cli): push branch and tag atomically in publish-cli.sh 2026-05-12 11:01:50 +08:00
Cheney
378216c6da feat(cli): add automated build and publish workflow
- Add release-cli.yml GitHub Actions workflow: build, test, npm publish,
  and GitHub Release triggered by cli-v* tags
- Rewrite scripts/publish-cli.sh: local bump + commit + tag + push,
  enforces main branch, idempotent tag checks
- Add concurrency group and release idempotency to workflow
- Add make publish-cli / publish-cli-minor / publish-cli-major targets
- Add cli/RELEASE.md documenting the full release process
2026-05-12 10:32:06 +08:00
dongmucat
15e55e8055
Merge pull request #418 from iflytek/fix/cli-update-registry
fix(cli): respect configured npm registry
2026-05-11 15:18:29 +08:00
dongmucat
836267fd45 fix(cli): respect configured npm registry 2026-05-11 14:53:20 +08:00
dongmucat
554cad5b2e
Merge pull request #416 from iflytek/fix/cli-publish-version-sync
fix(cli): sync publish version flow
2026-05-11 14:14:32 +08:00
dongmucat
cebad0bbd7 refactor(security): use explicit SCANNING check in processScanResult
Gemini review feedback: the previous != PUBLISHED condition was too broad
and could inadvertently overwrite terminal states like REJECTED or YANKED.
Now explicitly check == SCANNING before transitioning status.
2026-05-11 13:56:08 +08:00
dongmucat
299659bf93 fix(cli): avoid publish temp file leak 2026-05-11 13:43:31 +08:00
dongmucat
ec4598efec fix(security): trigger security scan for admin-published skills
Super admin auto-publish flow was skipping security scanning entirely.
Now triggerScan is called regardless of autoPublish flag, while preserving
the PUBLISHED status (scan runs as post-publish audit rather than blocking).

Closes #415
2026-05-11 11:36:08 +08:00
dongmucat
e7aecc4050 fix(cli): sync publish version flow 2026-05-11 11:00:10 +08:00
dongmucat
84914c9d94
Merge pull request #359 from iflytek/feature/skillhub-cli-v1
Some checks failed
Deploy Docs / build (push) Has been cancelled
Deploy Docs / Deploy (push) Has been cancelled
feat(cli): add SkillHub CLI v1
2026-05-09 17:25:24 +08:00
dongmucat
d77a7d67c9 fix(cli): return correct exit code for network failures
- Handle 502/503 status codes as network errors (EXIT.network = 3)
- Previously these were treated as generic errors (EXIT.generic = 1)
- Fixes integration tests for login and search network failure scenarios
- Bump version to 0.1.4
2026-05-09 17:09:16 +08:00
dongmucat
3aef0ed4bc
Merge pull request #412 from iflytek/fix/namespace-management-gaps
fix(namespace): close namespace management gaps (#351)
2026-05-09 16:07:10 +08:00
dongmucat
ab06c75737 Merge branch 'main' into fix/namespace-management-gaps
Resolved conflicts by keeping both sides:
- web/src/api/client.ts: preserve paginated listMembers(slug, {page,size})
  and add delete(slug) from main.
- web/src/shared/hooks/use-namespace-queries.ts: keep useUpdateNamespace
  and useTransferNamespaceOwnership from this branch, plus useDeleteNamespace
  from main.
2026-05-09 15:13:44 +08:00
dongmucat
2821262fa4
Merge pull request #408 from iflytek/fix/namespace-delete-341
fix(namespace): support team namespace deletion
2026-05-09 15:04:06 +08:00
dongmucat
ab6fd07530
Merge pull request #414 from iflytek/fix/web-js-compat
fix(web): restore compatibility with Chromium 83 (Debian 10)
2026-05-09 15:03:02 +08:00
dongmucat
58a48e2670 docs: restructure CLI README and sync guide docs with improvements
变更摘要:

- 重构 cli/README.md 大纲结构,参考 guide 文档重新组织章节逻辑

- 补充 Windows PowerShell/CMD 环境变量设置方式到三份文档

- Command Reference 表格补全 --json、--registry、--token 等选项

- 英文 guide Registry 优先级第3条补充文件路径与中文版对齐

- 两份 guide 末尾补充 License 章节,Local Development 补 Windows 说明

- README 各章节标题添加语义化 emoji icon

关键文件:

- cli/README.md

- docs/skillhub/en/guide/cli.md

- docs/skillhub/guide/cli.md
2026-05-09 15:01:00 +08:00
dongmucat
30f3a84ce0 fix(namespace): remove optimistic update on member add to avoid cross-page duplication
appendNamespaceMember was being called via setQueriesData across all cached
pages, causing the new member to appear at the end of every page. The
invalidation will refresh the list correctly.
2026-05-09 14:22:16 +08:00
dongmucat
9b64cbedba feat(namespace): add edit/transfer UI with pagination support
Add namespace edit dialog, transfer ownership dialog, and member list pagination. Update API layer to support pagination (PagedResponse), add useUpdateNamespace and useTransferNamespaceOwnership hooks with pagination-aware optimistic updates. Integrate edit button in NamespaceHeader and transfer button on members page. Add i18n keys for all new features (en + zh).
2026-05-09 14:22:16 +08:00
dongmucat
2f640e42a3 feat(namespace): add transfer ownership endpoint
Implement POST /namespaces/{slug}/transfer-ownership to allow namespace owners to transfer ownership to existing members. Includes comprehensive test coverage for success and failure scenarios (non-owner, target not found, frozen namespace).
2026-05-09 14:22:16 +08:00
Cheney
702bbff216 Merge branch 'main' into fix/web-js-compat 2026-05-09 14:18:05 +08:00
Cheney
81f7e3943f fix(web): scope legacy browser target to production build only
The top-level esbuild.target also applied to dev/test transforms, which
broke vitest suites that use top-level await (Chromium 83 / ES2020 does
not support it). Only build.target and optimizeDeps.esbuildOptions.target
need the legacy target; remove the global esbuild.target override.
2026-05-09 13:55:57 +08:00
Cheney
e869a4d365 fix(web): restore compatibility with Chromium 83 (Debian 10)
Publish page dropdowns (namespace/visibility) failed to open on older
Chromium because Vite 6 defaults build target to chrome87 and some
bundled deps call runtime APIs absent in Chrome 83 (replaceAll, .at,
hasOwn). Lower esbuild/vite target to chrome83, add browserslist, drop
??= in bootstrap, and inject runtime polyfills before main loads.
2026-05-09 13:55:50 +08:00
dongmucat
42f6bb7582
Merge pull request #413 from iflytek/fix/web-build
fix(ci): pin pnpm 10.33 and approve esbuild build scripts
2026-05-09 13:50:48 +08:00
dongmucat
a14d89d8c9 refactor(cli): improve doctor command semantics and transparency
变更摘要:

- doctor 命令重构:从重建改为扫描并合并语义,保留扫描范围外的条目

- 修复字段命名:itemsRestored → itemsScanned/itemsPreserved,语义更清晰

- 改进用户提示:输出区分扫描到的和保留的条目,帮助文档补充保留行为说明

- 补充代码注释:说明同 slug 不同 installDir 允许并存的设计意图

- 统一错误码:download/handleJsonResponse 的非 2xx 响应统一使用 EXIT.generic

- 新增测试覆盖:合并场景、刷新场景、冲突不删除无关条目等边界情况

关键文件:

- cli/src/services/doctor-service.ts

- cli/src/commands/doctor.ts

- cli/src/commands/help.ts

- cli/test/unit/services/doctor-service.test.ts

- cli/test/integration/doctor-command.test.ts
2026-05-09 11:30:36 +08:00
dongmucat
04a4545107 refactor(ci): inline pnpm build-script approval into package.json
Addresses review feedback on #413: for a single-package project,
pnpm-workspace.yaml is unnecessary and its 'packages: [.]' declaration
turns the web/ directory into a pnpm workspace root, which is a
semantic side effect we don't want.

Move onlyBuiltDependencies under the 'pnpm' field in package.json
(pnpm 10 still reads it there) and drop the workspace file from the
Dockerfile COPY list. Verified locally with docker buildx: pnpm 10.33
runs esbuild postinstall and the build succeeds.
2026-05-09 11:10:53 +08:00
dongmucat
32e40cbbb4 fix(ci): pin pnpm 10.33 and approve esbuild build scripts
Corepack was resolving pnpm to latest (11.0.9) on each CI run, and
pnpm 11 refuses unapproved postinstall scripts in --frozen-lockfile
mode. That caused ERR_PNPM_IGNORED_BUILDS: esbuild@0.25.12 and failed
the web image build in publish-images.

Changes:
- web/package.json: pin packageManager to pnpm@10.33.0
- web/pnpm-workspace.yaml: approve esbuild via onlyBuiltDependencies
  (pnpm 10 syntax; matches the pinned major)
- web/Dockerfile: copy pnpm-workspace.yaml before pnpm install so the
  approval list is visible inside the build stage
2026-05-09 10:46:48 +08:00
dongmucat
aecdecccab
Merge pull request #376 from iflytek/fix/oss-chunked-encoding
fix(storage): disable chunked encoding for Aliyun OSS compatibility
2026-05-08 17:22:51 +08:00