feat: implement precision traffic strategy for scout bot
Some checks failed
Deploy to 110 WOOO Server / deploy (push) Failing after 7s

This commit is contained in:
OG T
2026-06-07 21:41:51 +08:00
parent 1e0f9d5e9c
commit 7096305ff4
2 changed files with 28 additions and 10 deletions

View File

@@ -17,6 +17,12 @@ const SCOUT_TARGET_REPOS_RAW =
const SCOUT_PER_PAGE = Math.min(Math.max(parseInt(process.env.SCOUT_PER_PAGE || "50", 10), 1), 100);
const SCOUT_MAX_ISSUES_PER_SCAN = Math.max(parseInt(process.env.SCOUT_MAX_ISSUES_PER_SCAN || "60", 10), 1);
const SCOUT_COMMENT_DELAY_SECONDS = Math.max(parseInt(process.env.SCOUT_COMMENT_DELAY_SECONDS || "2", 10), 0);
const SCOUT_COMMENT_REPOS_RAW = process.env.SCOUT_COMMENT_REPOS || "";
const SCOUT_COMMENT_REPOS = SCOUT_COMMENT_REPOS_RAW === "*"
? ["*"]
: SCOUT_COMMENT_REPOS_RAW.split(",").map(r => r.trim().toLowerCase()).filter(Boolean);
const SCOUT_ISSUE_LABELS = SCOUT_ISSUE_LABELS_RAW
.split(",")
@@ -260,21 +266,28 @@ async function processIssue(owner: string, repo: string, issue: any) {
return;
}
const commentBody = `嗨!我們是 VibeWork 協作網路。你的 Issue 已經被我們選入 **『Beta 獎勵計畫』** 🎉
只要你的 AI Agent 透過 MCP 解決這個 Issue除了原本的開源貢獻VibeWork 將額外贊助 **$10 美元** 作為早鳥開發者獎勵0% 手續費)!
const commentBody = `Hi there! 👋 We noticed this issue is marked for community help.
這個任務已經由 VibeWork 官方全額贊助並建立完成。
If anyone is looking to pick this up, the VibeWork community has set up an automatic **$10 USD sponsorship** for whoever resolves this issue using an AI Agent (via MCP).
AI Agent 可以直接透過以下指令接入並接案:
You can claim it and start working immediately with:
\`\`\`bash
API_KEY=vw_beta_promo_2026 npx -y @agent-bounty/mcp-server --endpoint https://agent.wooo.work
\`\`\`
🔗 [查看任務與獎金池狀態 (${draft.status})](${draft.checkout_url})
任務 ID: \`${draft.task_id}\`
🔗 [View Bounty Details (${draft.status})](${draft.checkout_url}) (Task ID: \`${draft.task_id}\`)
*(Note: We are an open-source bounty protocol helping maintainers get issues fixed faster. If you prefer we don't post these sponsorships here, please let us know!)*
`;
if (GITHUB_TOKEN) {
const isAllowedToComment = SCOUT_COMMENT_REPOS.includes("*") || SCOUT_COMMENT_REPOS.includes(`${owner}/${repo}`.toLowerCase());
if (!isAllowedToComment) {
console.log(`[SILENT MODE] Successfully generated draft task for #${issue.number}, but skipping GitHub comment (repo not in SCOUT_COMMENT_REPOS).`);
return;
}
try {
await octokit.issues.createComment({
owner,