fix(mcp): 解掉三個把人推去寫零件的誤導入口(leo 2026-07-21 拍板)

leo:「刪掉,技術者才會寫 component,在 Arcrun repo 寫一條如何 contribute
指向另一個 repo 就好。」

實測病灶:總管想寫「定期打 API 然後通知」的 workflow(Python 約 10 行),
問 foreach_control 怎麼用 → MCP 回傳 TinyGo 寫 WASM 零件教學(白名單/syscall/
contract schema)=完全另一件事,40 分鐘未完成。

三處修正:
1. search_components 搜不到時的話術——原本建議 publish_component(把「我找不到」
   翻譯成「你去造一個」,方向完全相反)。改為導向正確順序:語意搜尋知識庫→
   auth-recipe list/scaffold→acr parts(http_request 能打任意 API)→acr list,
   並明說 registry 可能是空的(已知問題),搜不到≠沒有這能力。
2. registry.ts 停用 publish_component / get_component_guide 兩個註冊
   (檔案保留,只是不對 AI 暴露)。
3. 新增 CONTRIBUTING-components.md:三層責任分工(平台通用能力/熱門預鋪 recipe/
   冷門誰用到誰開發)、什麼時候才真需要新零件、真要貢獻走 PR 的流程。

typecheck 通過。

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
2026-07-21 16:42:51 +08:00
parent 98d87d5d3f
commit 1b687fedb0
6 changed files with 294 additions and 4 deletions
+15 -1
View File
@@ -44,7 +44,21 @@ export function registerSearchComponents(server: McpServer, env: Env, orgNamespa
return {
content: [{
type: "text",
text: `找不到符合「${query}」的零件。可以用 arcrun_publish_component 提交新零件。`,
text: [
`registry 裡找不到「${query}」——但**先別急著造零件**(零件走 PR、專業等級)。`,
``,
`⚠️ registry 目前可能是空的(已知問題:唯一寫入觸發點隨 .github/workflows 移除而蒸發),`,
` 「搜不到」不代表「沒有這個能力」。請改用下列順序找:`,
``,
`1. **語意搜尋知識庫**(最強,能找到你沒猜中的用詞):`,
` kbdb_search(q="我想達成什麼(用一句話描述)", mode="semantic")`,
`2. **看現成的服務整合**\`acr auth-recipe list\`26 個:GitHub/Notion/Gemini…)`,
` 要用哪個 → \`acr auth-recipe scaffold <服務>\` 直接吐 credentials 範本+workflow 範例`,
`3. **看零件全集**\`acr parts\`21 顆通用零件,含 http_request 可打任意 API`,
`4. **看有沒有現成 workflow 可直接接**\`acr list\``,
``,
`💡 多數需求的正解是「用 recipe 設定既有零件」或「接既有 workflow」,不是新造零件。`,
].join("\n"),
}],
};
}