From d61ca4f54f2b207c688634208988c0feeaf458d2 Mon Sep 17 00:00:00 2001 From: Claw Date: Fri, 6 Mar 2026 00:04:20 +0000 Subject: [PATCH] =?UTF-8?q?feat:=20AI-generated=20search=20keywords=20via?= =?UTF-8?q?=20Claude=20=E2=80=94=20full=20profile=20+=20search=20config=20?= =?UTF-8?q?context?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- job_searcher.mjs | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/job_searcher.mjs b/job_searcher.mjs index ead6d2c..e01e317 100644 --- a/job_searcher.mjs +++ b/job_searcher.mjs @@ -15,6 +15,7 @@ import { verifyLogin as liLogin, searchLinkedIn } from './lib/linkedin.mjs'; import { verifyLogin as wfLogin, searchWellfound } from './lib/wellfound.mjs'; import { sendTelegram, formatSearchSummary } from './lib/notify.mjs'; import { DEFAULT_FIRST_RUN_DAYS } from './lib/constants.mjs'; +import { generateKeywords } from './lib/keywords.mjs'; async function main() { console.log('🔍 claw-apply: Job Searcher starting\n'); @@ -24,6 +25,25 @@ async function main() { const searchConfig = loadConfig(resolve(__dir, 'config/search_config.json')); // First run detection: if queue is empty, use first_run_days lookback + const profile = loadConfig(resolve(__dir, 'config/profile.json')); + const anthropicKey = process.env.ANTHROPIC_API_KEY || settings.anthropic_api_key; + + // Enhance keywords with AI if API key available + if (anthropicKey) { + console.log('🤖 Generating AI-enhanced search keywords...'); + for (const search of searchConfig.searches) { + try { + const aiKeywords = await generateKeywords(search, profile, anthropicKey); + const merged = [...new Set([...search.keywords, ...aiKeywords])]; + console.log(` [${search.name}] ${search.keywords.length} → ${merged.length} keywords`); + search.keywords = merged; + } catch (e) { + console.warn(` [${search.name}] AI keywords failed, using static: ${e.message}`); + } + } + console.log(''); + } + const isFirstRun = loadQueue().length === 0; const lookbackDays = isFirstRun ? (searchConfig.first_run_days || DEFAULT_FIRST_RUN_DAYS) : null; if (isFirstRun) console.log(`📅 First run — looking back ${lookbackDays} days\n`);