测试与排查
每次交付前都跑同一套检查:
npm run typechecknpm run buildcargo fmt --checkcargo checknpx --yes @haloforge/plugin-pack@0.2.13 check .npx --yes @haloforge/plugin-pack@0.2.13 pack . --out dist/packagehf 操作的是本地 HaloForge workspace。源码仓库示例使用 npm run hf -- ...;Windows 安装版重新打开终端后可以直接使用 hf ...。macOS 当前还没有自动 PATH link,请先运行 command -v hf 确认。
cd /path/to/HaloForgenpm run hf -- plugin install local /path/to/plugin/dist/package/<plugin-id>-<version>.hfpkg --jsonnpm run hf -- plugin list --json插件应显示:
enabled: truestate: "active"error_message: null
启动配置和 catalog admin 命令见命令行。
HaloForge 会把应用、前端桥接和插件日志写入按天滚动的文件:
tail -f ~/.haloforge/logs/haloforge.log.$(date +%F)开发时可以提高 Rust tracing 级别:
RUST_LOG=debug npm run tauri dev前端插件使用 @haloforge/plugin-sdk 的 createPluginLogger();Rust 后端使用 ctx.log(...)。生图和其他网关流程应记录请求开始、成功、失败,并包含 request ID、模型、尺寸、状态、耗时、输出数量和短错误摘要。不要记录 API key、bearer token、完整 prompt 或原始图片/base64。
unzip -l dist/package/dev.example.my-plugin-0.1.0.hfpkgUI 插件至少应包含:
manifest.json- 前端 bundle
- manifest 声明的 CSS
- manifest 声明的 native library
- manifest 引用的 icon/assets
Plugin panel not loaded
Section titled “Plugin panel not loaded”优先检查:
registerPlugin()的 ID 是否和manifest.json完全一致。entry.frontend是否指向包内实际 JS 文件。integration.*.panel_entry是否指向 panel bundle。- 包里是否包含前端 bundle 和 CSS。
- bundle 执行时是否有 JavaScript 异常。
- Rust 后端是否加载并注册命令。
- host capabilities 和 permissions 是否声明完整。