@jimmy-jtcg/skill-gateway-sync
v0.3.3
Published
OpenClaw plugin: auto-sync agent mapping / specs / Slack DM channels to a remote Skill Gateway for attribution & compliance review.
Readme
@jimmy-jtcg/skill-gateway-sync
OpenClaw plugin:自動把本機 agent mapping / 合規 spec / Slack DM 頻道同步到遠端 Skill Gateway,讓雲端 dashboard 的數位員工歸戶與合規稽核不依賴手動 sync。
同步什麼
- Agent 名冊(
agents.list:id / 識別名)— 歸戶索引與員工頁顯示名 - Channel 對應(slack 帳號、頻道、DM 頻道枚舉、bindings)— 事件歸戶
- 合規 spec(各 agent workspace 的
AGENTS.md/SOUL.md)— LLM judge 評判標準
憑證(botToken 等)只在本機使用、不上傳。payload 帶 schema_version,gateway 對未知版本明確 4xx。
同步時機
- openclaw 啟動(
gateway_start) - 每小時(
syncIntervalMs,預設 3600000) - 每個 agent run 結束後 debounce(
debounceMs,預設 300000 = 5 分)— 新 DM 頻道在第一個 run 後就跟上
每次同步先比 payload hash,無變化不重送。
安裝
# 開發(本機 checkout)
git clone https://github.com/JTCG-TW/openclaw-plugin-skill-gateway ~/.openclaw/plugins-src/openclaw-plugin-skill-gateway
openclaw plugins install --link ~/.openclaw/plugins-src/openclaw-plugin-skill-gateway~/.openclaw/openclaw.json:
{
"plugins": {
"entries": {
"skill-gateway-sync": {
"enabled": true,
"hooks": { "allowConversationAccess": true },
"config": {
"gatewayUrl": "https://crew.raccoonai.co",
"clientToken": "sgk_…(該公司的 client token)"
}
}
}
}
}然後 openclaw gateway restart,log 應出現:
[skill-gateway-sync] startup: synced N agents / N specs → https://crew.raccoonai.co開發備忘(踩坑錄)
- manifest 必須宣告
activation.onCapabilities: ["hook"]——hook-only plugin 沒宣告會被 gateway 啟動名單靜默跳過(plugins list卻顯示 loaded,別被騙) - register 必須同步(
export default (api) => {},不能 async);async 工作放 hook handler agent_end是對話存取類 hook:config entry 必須設"hooks": {"allowConversationAccess": true},否則該 hook 註冊被靜默擋掉(plugin 不讀對話內容,但要收到事件就得開)- 改完
.ts要重 build:npx esbuild index.ts sync.ts --outdir=dist --format=esm --platform=node --target=es2022——dist 存在時 gateway 優先載 dist,跑舊 build 會誤判
