feat: add forge-hub sync — lightweight runtime sync#25
Conversation
chatId.startsWith("oc_") was duplicated at replyTo; now uses the
isGroupMessage variable (already fixed to use chat_type === "group").
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
git pull 后源码更新,但 ~/.forge-hub/ 运行时文件不会自动同步, 导致通道插件调用新 HubAPI 方法(如 isAllowed)时报错。 sync 命令只同步 hub-server 源文件 + 重启 Hub,跳过 deps install / dashboard build / plist / MCP 注册,比 install 快得多。 维护地图.md 同步更新:源码更新后跑 forge-hub sync 对齐运行时。 Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
|
Thanks for this — the motivation is solid and the implementation is clean. One change needed before we can merge: Missing
|
Per review feedback on PR LinekForge#25: syncCmd missed the cleanDirContents step before cpDir for channels. If a channel file is deleted or renamed in source, the old .ts file would otherwise remain in ~/.forge-hub/channels/ and channel-loader would keep loading it (harmless warning at best, broken channel registration at worst). Mirrors installCmd behavior at L79-82. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
Summary
forge-hub synccommand: only syncs hub-server source files (including channels/) from source to runtime, then restarts Hubforge-hub syncinstead of fullforge-hub installaftergit pullMotivation
After
git pull,~/.forge-hub/runtime files don't auto-update. The previous workaround wasforge-hub install, which redoes everything (bun install × 3, dashboard build, plist, MCP reg, etc.) — slow and unnecessary.This caused a real outage:
hub.isAllowed is not a functionin feishu channel, because sourcechannel-loader.tsaddedisAllowed()to HubAPI but runtime wasn't synced.Changes
cli.tssyncCmd()+ wired into dispatch + help text维护地图.mdforge-hub syncafter source updateSelf-test
🤖 Generated with Claude Code