Skip to content

feat: publish forked Hypit Runtime for Piko - #4

Merged
Handanhhhy merged 9 commits into
mainfrom
codex/hypit-runtime-release
Oct 20, 2026
Merged

Handanhhhy merged 9 commits into
mainfrom
codex/hypit-runtime-release

Conversation

@wangwenqq

@wangwenqq wangwenqq commented Oct 19, 2026 •

Copy link
Copy Markdown
Collaborator

变更说明

Piko 需要使用 dramaclaw/hypit fork 自己的 Skill 和 Runtime,这样安装后会加载 @dramaclaw/provider-newapi,而不是官方的 hypit/hypit。本 PR 增加 Piko PR #7 所需的 Runtime 发布流程。

  • 构建当前 fork 的 hypit-hypit-<version>.tgz 和 Runtime manifest。
  • 在对应的 GitHub Release 中发布 tarball 和 manifest。
  • 在 manifest 中锁定 fork 仓库、完整 Git commit、包名、Provider、Node 版本、Chrome 版本、SHA256 和文件大小。
  • 如果 Release 中已经存在同名制品,先逐字节校验;发现内容不一致时直接失败,避免旧 tarball 与新 manifest 不匹配。
  • Runtime 打包时始终重新构建当前版本的 tarball,避免本地旧文件被重复使用。
  • 更新 fork Skill/Runtime 的安装文档,并增加 manifest 校验测试。

验证结果

  • npm run check
  • node --import tsx --test packages/desktop-setup/test/piko-runtime.test.ts
  • npm test:1778 个通过,25 个跳过,0 个失败。
  • Runtime 打包结果:hypit-hypit-0.2.16.tgz,大小 2,847,828 字节,SHA256 为 b8d0d3318afdb954dcc888be3756406b0b2374c3bfc73ae5813eb24be75d6e0f。

对应的 Piko 修改见 claymorelab/piko-plugins#7。本 PR 合并后,还需要发布 v0.2.16 GitHub Release;发布流程会自动上传 tarball 和 manifest。

Windows CI 的 check job 当前受到仓库已有的跨平台测试 fixture 问题影响,首个错误是 Windows runner 执行 macOS fixture 时报告 FFmpeg is not executable;Ubuntu check、Ubuntu package 和 Windows package 均已通过。

@wangwenqq wangwenqq changed the title feat: publish fork Runtime asset for Piko 为 Piko 发布 fork Runtime 制品 Oct 19, 2026
@wangwenqq wangwenqq changed the title 为 Piko 发布 fork Runtime 制品 feat: publish forked Hypit Runtime for Piko Oct 20, 2026

@Handanhhhy Handanhhhy left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

审查提交:bc4d90d1526978c8531558148cc3d3952f37490f(base 7cdc9866)。本 PR 修改了 CI/发布工作流,按完整深度审查。

结论:建议 APPROVE(建议合并),无 P0/P1;以下 P2/P3 作为后续跟进。

P2 — fork 发布 npm 上不存在的版本时,Runtime 资产不会挂到 Release

  • 位置:.github/workflows/publish-npm.yml 中 release-assets 声明 needs: [package, publish],没有 !failure() 之类的放行条件。
  • 触发:版本在 npm 上不存在(例如 0.3.2;npm 上 @hypit/hypit 已到 0.3.1)时,publish 会以 @hypit/hypit 名义执行 npm publish。它只能用 OIDC trusted publishing 认证,而该包归上游所有,fork 无法认证,于是 publish 失败,release-assets 被跳过,tarball 和 manifest 都不会上传。
  • 本次的 v0.2.16 不受影响:npm 上已有 0.2.16,publish 会被跳过。
  • 证据:静态证明,未实际执行(需要真实发布一次 Release);npm 包的 trusted publishing 配置在仓库中不可见,属于推断。已经过独立复核。
  • 建议:fork 不向 npm 发布 @hypit/hypit,例如移除 publish job,或让 release-assets 只依赖 package。另外,Release 上的 hypit-hypit-0.2.16.tgz 与 npm 上的 @hypit/hypit@0.2.16 名字和版本相同但内容不同,建议在文档中说明。

P3 — scripts/pack-piko-runtime.mjs 不可移植,输出目录参数无效

  • execFileSync("npm", …) 未开 shell,在 Windows 上会失败(npm 是 npm.cmd);pack-distribution.mjs 为此专门改用 process.execPath 加 npm_execpath,新脚本没有沿用。
  • argv[2] 输出目录没有传给 pack:distribution(后者固定写到 dist/release),传其他目录会报 "Expected exactly one …"。
  • CI 只在 Linux 上运行且传的正是 dist/release,目前不受影响。另外 Linux job 会打两次包。

P3 — manifest 脚本写死了 Chrome 153.0.8010.12 和 Node >=22.15.0

以后升级 captureBrowser.version 或 engines.node 时,每个 PR 的 npm-package CI 和发布都会失败,直到回来修改这个脚本。如果是有意锁定,建议加注释说明;否则改为从 package.json 读取。

验证范围

  • 本地:只运行了 packages/desktop-setup/test/piko-runtime.test.ts,2/2 通过(Node 22);没有安装依赖,没有跑全量测试或打包。
  • GitHub CI:4/4 通过。
  • 没有实际触发 Release 发布流程。

@wangwenqq

Copy link
Copy Markdown
Collaborator Author

感谢详细审查。已按建议处理并推送后续提交:

  • P2:fork 不再执行官方 @hypit/hypit 的 npm 发布,已移除 publish job;release-assets 现在只依赖 package,因此 Runtime tarball 和 manifest 不会因 npm 权限或版本问题而被跳过。
  • P3:pack-piko-runtime.mjs 已改用 npm 的实际 CLI 路径,兼容 Windows;输出目录参数也会继续传递给 distribution packer,并增加了自定义输出目录回归测试。
  • Node >=22.15.0 与 Chrome 153.0.8010.12 是当前 Piko Runtime 的兼容性契约,因此暂时保留;后续升级运行时契约时会在同一变更中同步更新 manifest。
  • Runtime tarball 使用与 package 对齐的名称和版本,但发布来源是该 fork 的 GitHub Release,安装流程不会从官方 npm 包获取。

验证结果:

  • npm run check 通过;
  • 全量测试 1779 passed、0 failed、25 skipped;
  • GitHub CI 的 Ubuntu/Windows check 和 package 共 4 个任务全部通过。

@Handanhhhy
Handanhhhy merged commit 81c9307 into main Oct 20, 2026
4 checks passed
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