jobdeck 0.2.0__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (67) hide show
  1. analyzer.py +115 -0
  2. auto_fill_engine.py +161 -0
  3. auto_fill_helper.py +70 -0
  4. config.py +144 -0
  5. cover_letter_generator.py +415 -0
  6. cv_profiler.py +166 -0
  7. cv_tailor.py +1128 -0
  8. dashboard/__init__.py +1 -0
  9. dashboard/dashboard_server.py +785 -0
  10. dashboard/run_dashboard.bat +11 -0
  11. dashboard/run_tunnel.bat +8 -0
  12. dashboard/start_dashboard_silent.vbs +4 -0
  13. dashboard/static/index.html +3715 -0
  14. dashboard/static/manifest.json +15 -0
  15. dashboard/static/noir-webling.webp +0 -0
  16. dashboard/static/pet_anim.gif +0 -0
  17. dashboard/static/pet_anim_192.gif +0 -0
  18. dashboard/tunnel_manager.py +70 -0
  19. db.py +217 -0
  20. fetcher.py +615 -0
  21. heuristic_scorer.py +110 -0
  22. jobdeck-0.2.0.dist-info/METADATA +184 -0
  23. jobdeck-0.2.0.dist-info/RECORD +67 -0
  24. jobdeck-0.2.0.dist-info/WHEEL +5 -0
  25. jobdeck-0.2.0.dist-info/entry_points.txt +3 -0
  26. jobdeck-0.2.0.dist-info/licenses/LICENSE +21 -0
  27. jobdeck-0.2.0.dist-info/top_level.txt +15 -0
  28. notifier.py +206 -0
  29. rjh/__init__.py +5 -0
  30. rjh/__main__.py +5 -0
  31. rjh/analysis.py +451 -0
  32. rjh/cli.py +350 -0
  33. rjh/discovery.py +1012 -0
  34. rjh/doctor.py +212 -0
  35. rjh/heuristic.py +446 -0
  36. rjh/http.py +158 -0
  37. rjh/jsonparse.py +131 -0
  38. rjh/liveness.py +783 -0
  39. rjh/llm.py +361 -0
  40. rjh/manual.py +138 -0
  41. rjh/market_radar.py +870 -0
  42. rjh/messages.py +123 -0
  43. rjh/models.py +49 -0
  44. rjh/paths.py +109 -0
  45. rjh/profile.py +298 -0
  46. rjh/scanner.py +602 -0
  47. rjh/sources/__init__.py +87 -0
  48. rjh/sources/adzuna.py +43 -0
  49. rjh/sources/ashby.py +55 -0
  50. rjh/sources/base.py +213 -0
  51. rjh/sources/greenhouse.py +31 -0
  52. rjh/sources/hn.py +107 -0
  53. rjh/sources/jobicy.py +68 -0
  54. rjh/sources/lever.py +58 -0
  55. rjh/sources/remotive.py +34 -0
  56. rjh/sources/smartrecruiters.py +129 -0
  57. rjh/sources/workable.py +109 -0
  58. rjh/sources/wttj.py +120 -0
  59. rjh/sources/wwr.py +108 -0
  60. rjh/textutil.py +43 -0
  61. rjh/web/__init__.py +0 -0
  62. rjh/web/manual_panel.html +93 -0
  63. rjh/web/manual_router.py +77 -0
  64. rjh/web/server.py +16 -0
  65. rjh/wizard.py +289 -0
  66. run_hunter.py +40 -0
  67. scrapling_enricher.py +36 -0
analyzer.py ADDED
@@ -0,0 +1,115 @@
1
+ import json
2
+ import time
3
+ import urllib.request
4
+ import urllib.error
5
+ from typing import Any
6
+ from config import GOOGLE_API_KEY, GEMINI_MODEL, APPLICANT
7
+
8
+ _CANDIDATE_NAME = APPLICANT.get("name", "the candidate")
9
+
10
+ SYSTEM_PROMPT = f"""You are an elite Tech Career Agent representing {_CANDIDATE_NAME}.
11
+ Candidate profile:
12
+ - Title: {APPLICANT['title']}
13
+ - Location: {APPLICANT['location']}
14
+ - Languages: {APPLICANT['languages']}
15
+ - Core Stack: {APPLICANT['stack']}
16
+ - Proven Impact: {APPLICANT['key_metrics']}
17
+ - Key Highlights: {APPLICANT['experience_highlight']}
18
+ - Portfolio: {APPLICANT['portfolio']} | GitHub: {APPLICANT['github']}
19
+
20
+ Your task is to analyze a remote job posting and evaluate its relevance for {_CANDIDATE_NAME}.
21
+
22
+ Scoring criteria (BE RIGOROUS, PRAGMATIC AND ADVERSARIAL):
23
+ - 9.0 - 10.0: IDEAL SWEET-SPOT (Junior to Mid Builder, Full-Time OR Part-Time/Contract). AI Automation Specialist, Solutions Engineer (Associate/Junior/Mid), Operations Automation Builder, RevOps Specialist, or Integration Specialist at a PME, startup, agency, or scale-up where the primary mission is connecting APIs, building n8n/Python pipelines, prompt chaining, and automating business workflows. Note: Part-Time (10-25h/week), Fractional, or Freelance contract roles in automation are highly valued!
24
+ - 7.5 - 8.9: STRONG FIT. SMB / Scale-up roles in Operations, Growth, or Customer Technical Solutions where the candidate's production automation experience ({APPLICANT['key_metrics']}) provides immediate, provable ROI from week 1.
25
+ - < 5.0: AUTOMATIC DISQUALIFICATION (HARD GATES):
26
+ * Seniority Mismatch: Any posting requiring 4+ or 5+ years of experience, or explicitly titled Senior / Staff / Principal / Lead / Director / Architect. The candidate has ~2 years of high-velocity automation/building experience.
27
+ * Frontier AI Lab Core Engineering (Anthropic, OpenAI, Cohere, DeepMind) demanding heavy computer science, distributed infrastructure, or model evaluations.
28
+ * Language Mismatch: If the job strictly requires "Native German" or "Fluent German" ({APPLICANT['languages']}).
29
+ * Travel / On-Site Requirement: If the job requires frequent travel (> 10%) or is not true 100% full-remote.
30
+ * Pure "Software Engineer" / "Backend Engineer" focused on distributed systems, compilers, or heavy CS algorithms/LeetCode.
31
+ * Research Scientist / Deep Learning Researcher.
32
+ * Non-technical Sales / SDR / HR / Recruiter roles.
33
+
34
+ Output strictly valid JSON with these keys:
35
+ {{
36
+ "fit_score": 8.5,
37
+ "rationale": "One-line explanation of why this matches the candidate's skills.",
38
+ "tech_match": ["n8n", "Python", "LLMs", "REST APIs"],
39
+ "pitch_hook": "2 punchy sentences connecting the candidate's real production work to this specific job's biggest need.",
40
+ "tailored_pitch": "A complete, high-converting 120-150 word application pitch written in professional English, citing the production workflows, hours saved, and linking to the candidate's portfolio.",
41
+ "proof_of_work": {{
42
+ "problem_diagnosis": "Specific operational or technical bottleneck the company is hiring to solve.",
43
+ "solution_architecture": "3 concrete technical implementation steps (Ingestion, LLM Validation/Guardrails, Action Delivery) using n8n, Python, and modern APIs.",
44
+ "mermaid_diagram": "graph LR\\n A[Inbound Lead/Event] --> B[n8n / FastAPI Router]\\n B --> C[LLM Structured Parse & Guardrails]\\n C --> D[CRM / Webhook Sync]"
45
+ }},
46
+ "cold_outreach": {{
47
+ "target_role": "Title of the hiring manager / decision maker (e.g. Head of Solutions Engineering, VP Ops, CTO)",
48
+ "subject": "Punchy message subject line under 50 chars",
49
+ "dm_text": "A concise 50-70 word cold message to the decision maker bypassing the ATS, referencing their bottleneck, key metrics, and linking to the candidate's portfolio.",
50
+ "linkedin_search_url": "https://www.google.com/search?q=site%3Alinkedin.com%2Fin+%22Company%22+%22Target+Role%22"
51
+ }}
52
+ }}
53
+ Note: If fit_score < 7.5, set proof_of_work and cold_outreach to null to conserve tokens.
54
+ """
55
+
56
+ def analyze_job(title: str, company: str, location: str, description: str) -> dict[str, Any]:
57
+ model_name = GEMINI_MODEL if GEMINI_MODEL.startswith("gemini-") else f"gemini-{GEMINI_MODEL}"
58
+ url = f"https://generativelanguage.googleapis.com/v1beta/models/{model_name}:generateContent"
59
+
60
+ prompt = f"""Evaluate this job posting for candidate {APPLICANT.get('name', 'Builder')}:
61
+
62
+ COMPANY: {company}
63
+ JOB TITLE: {title}
64
+ LOCATION: {location}
65
+ DESCRIPTION:
66
+ {description[:8000]}
67
+ """
68
+
69
+ payload = {
70
+ "contents": [{"parts": [{"text": prompt}]}],
71
+ "systemInstruction": {"parts": [{"text": SYSTEM_PROMPT}]},
72
+ "generationConfig": {"responseMimeType": "application/json"}
73
+ }
74
+
75
+ req = urllib.request.Request(
76
+ url,
77
+ data=json.dumps(payload).encode("utf-8"),
78
+ headers={
79
+ "Content-Type": "application/json",
80
+ "x-goog-api-key": GOOGLE_API_KEY or ""
81
+ }
82
+ )
83
+
84
+ for attempt in range(3):
85
+ try:
86
+ with urllib.request.urlopen(req, timeout=30) as resp:
87
+ data = json.loads(resp.read().decode("utf-8"))
88
+ candidates = data.get("candidates", [])
89
+ if candidates:
90
+ parts = candidates[0].get("content", {}).get("parts", [])
91
+ if parts and "text" in parts[0]:
92
+ raw_text = parts[0]["text"]
93
+ from rjh.jsonparse import parse_json_loose
94
+ res = parse_json_loose(raw_text)
95
+ res["analysis_status"] = "success"
96
+ return res
97
+ except urllib.error.HTTPError as e:
98
+ if e.code == 429:
99
+ time.sleep(4 * (attempt + 1))
100
+ continue
101
+ err_msg = e.read().decode("utf-8")
102
+ print(f"⚠️ Gemini API error [{e.code}]: {err_msg[:200]}")
103
+ break
104
+ except Exception as e:
105
+ print(f"⚠️ Analysis error: {e}")
106
+ time.sleep(2)
107
+
108
+ return {
109
+ "fit_score": None,
110
+ "analysis_status": "failed",
111
+ "rationale": "Analysis failed",
112
+ "tech_match": [],
113
+ "pitch_hook": "",
114
+ "tailored_pitch": ""
115
+ }
auto_fill_engine.py ADDED
@@ -0,0 +1,161 @@
1
+ import os
2
+ import sys
3
+ import time
4
+ from pathlib import Path
5
+ from playwright.sync_api import sync_playwright
6
+
7
+ BASE_DIR = Path(__file__).resolve().parent
8
+ sys.path.append(str(BASE_DIR))
9
+
10
+ import db
11
+ from config import APPLICANT
12
+
13
+ # Dynamic Resume Path
14
+ resume_env = os.getenv("APPLICANT_RESUME_PATH", "")
15
+ CV_PATH = Path(resume_env) if resume_env and Path(resume_env).exists() else (
16
+ Path(BASE_DIR / "uploaded_cv.pdf") if Path(BASE_DIR / "uploaded_cv.pdf").exists() else Path(BASE_DIR / "cv.pdf")
17
+ )
18
+
19
+ def auto_fill_application(job_id_or_url: str):
20
+ """
21
+ Launches a headful browser, navigates to the job application page,
22
+ fills in all standard form fields (Name, Email, Phone, Links, Cover Letter),
23
+ attaches the PDF CV, and leaves the browser open for the user to review.
24
+ """
25
+ job = db.get_job_by_id(job_id_or_url)
26
+ if not job:
27
+ # Try search by URL
28
+ conn = db.get_conn()
29
+ c = conn.cursor()
30
+ c.execute("SELECT * FROM jobs WHERE url = ?", (job_id_or_url,))
31
+ row = c.fetchone()
32
+ conn.close()
33
+ job = dict(row) if row else None
34
+
35
+ if not job:
36
+ print(f"❌ Job not found: {job_id_or_url}")
37
+ return False
38
+
39
+ url = job.get("url")
40
+ if not url:
41
+ print("❌ Job has no URL")
42
+ return False
43
+
44
+ pitch = job.get("tailored_pitch", "")
45
+ print(f"\n🚀 Launching Assisted Auto-Fill for {job.get('company')} — {job.get('title')}...")
46
+ print(f"🔗 Target: {url}\n")
47
+
48
+ name_parts = APPLICANT.get("name", "Candidate").split()
49
+ first_name = name_parts[0] if name_parts else ""
50
+ last_name = " ".join(name_parts[1:]) if len(name_parts) > 1 else ""
51
+ loc_val = APPLICANT.get("location", "")
52
+
53
+ with sync_playwright() as p:
54
+ browser = p.chromium.launch(
55
+ headless=False,
56
+ args=["--start-maximized", "--disable-blink-features=AutomationControlled"]
57
+ )
58
+ context = browser.new_context(no_viewport=True)
59
+ page = context.new_page()
60
+
61
+ try:
62
+ page.goto(url, wait_until="domcontentloaded", timeout=45000)
63
+ time.sleep(3)
64
+
65
+ apply_triggers = page.locator("a:has-text('Apply'), button:has-text('Apply'), a:has-text('Postuler'), button:has-text('Postuler')")
66
+ if apply_triggers.count() > 0:
67
+ first_trigger = apply_triggers.first
68
+ if first_trigger.is_visible():
69
+ try:
70
+ first_trigger.click()
71
+ time.sleep(2)
72
+ except Exception:
73
+ pass
74
+
75
+ # 1. Fill First Name
76
+ fn_loc = page.locator("input[name*='first' i], input[id*='first' i], input[placeholder*='first' i], input[autocomplete*='given-name']")
77
+ if fn_loc.count() > 0:
78
+ fn_loc.first.fill(first_name)
79
+
80
+ # 2. Fill Last Name
81
+ ln_loc = page.locator("input[name*='last' i], input[id*='last' i], input[placeholder*='last' i], input[autocomplete*='family-name']")
82
+ if ln_loc.count() > 0:
83
+ ln_loc.first.fill(last_name)
84
+
85
+ # 3. Fill Full Name
86
+ if fn_loc.count() == 0 and ln_loc.count() == 0:
87
+ name_loc = page.locator("input[name*='name' i], input[id*='name' i], input[placeholder*='Full Name' i]")
88
+ if name_loc.count() > 0:
89
+ name_loc.first.fill(APPLICANT.get("name", ""))
90
+
91
+ # 4. Fill Email
92
+ email_loc = page.locator("input[type='email'], input[name*='email' i], input[id*='email' i], input[placeholder*='email' i]")
93
+ if email_loc.count() > 0:
94
+ email_loc.first.fill(APPLICANT.get("email", ""))
95
+
96
+ # 5. Fill Phone
97
+ phone_loc = page.locator("input[type='tel'], input[name*='phone' i], input[id*='phone' i], input[placeholder*='phone' i]")
98
+ if phone_loc.count() > 0:
99
+ phone_loc.first.fill(APPLICANT.get("phone", ""))
100
+
101
+ # 6. Fill Location
102
+ if loc_val:
103
+ loc_loc = page.locator("input[name*='location' i], input[id*='location' i], input[placeholder*='city' i], input[name*='city' i]")
104
+ if loc_loc.count() > 0:
105
+ loc_loc.first.fill(loc_val)
106
+
107
+ # 7. Fill LinkedIn
108
+ linkedin_loc = page.locator("input[name*='linkedin' i], input[id*='linkedin' i], input[placeholder*='linkedin' i]")
109
+ if linkedin_loc.count() > 0:
110
+ linkedin_loc.first.fill(APPLICANT.get("linkedin", ""))
111
+
112
+ # 8. Fill Website / Portfolio
113
+ web_loc = page.locator("input[name*='website' i], input[name*='portfolio' i], input[id*='portfolio' i], input[placeholder*='portfolio' i], input[placeholder*='website' i]")
114
+ if web_loc.count() > 0:
115
+ web_loc.first.fill(APPLICANT.get("portfolio", ""))
116
+
117
+ # 9. Fill GitHub
118
+ gh_loc = page.locator("input[name*='github' i], input[id*='github' i], input[placeholder*='github' i]")
119
+ if gh_loc.count() > 0:
120
+ gh_loc.first.fill(APPLICANT.get("github", ""))
121
+
122
+ # 10. Fill Cover Letter
123
+ if pitch:
124
+ cl_loc = page.locator("textarea[name*='cover' i], textarea[id*='cover' i], textarea[placeholder*='cover' i], textarea[name*='additional' i], textarea[name*='notes' i], textarea[name*='comments' i]")
125
+ if cl_loc.count() > 0:
126
+ cl_loc.first.fill(pitch)
127
+
128
+ # 11. Attach Resume / CV PDF
129
+ if CV_PATH.exists():
130
+ file_inputs = page.locator("input[type='file']")
131
+ if file_inputs.count() > 0:
132
+ try:
133
+ file_inputs.first.set_input_files(str(CV_PATH))
134
+ print(f"📎 Attached Resume PDF: {CV_PATH.name}")
135
+ except Exception as e:
136
+ print(f"⚠️ Could not attach CV automatically: {e}")
137
+
138
+ print("✅ Auto-Fill complete! The browser is left open in front of you.")
139
+ print("👉 Check the inputs, answer any custom company questions, and click 'Submit'!")
140
+
141
+ # Update status in DB to 'prefilled' rather than prematurely 'applied'
142
+ if job.get("status") not in ("applied", "interview"):
143
+ db.update_job_status(job["id"], "prefilled")
144
+
145
+ # Leave browser open until user interaction ends or window is closed
146
+ try:
147
+ page.wait_for_event("close", timeout=0)
148
+ except Exception:
149
+ pass
150
+
151
+ except Exception as e:
152
+ print(f"⚠️ Auto-fill error: {e}")
153
+ return False
154
+
155
+ return True
156
+
157
+ if __name__ == "__main__":
158
+ if len(sys.argv) > 1:
159
+ auto_fill_application(sys.argv[1])
160
+ else:
161
+ print("Usage: python auto_fill_engine.py <job_id_or_url>")
auto_fill_helper.py ADDED
@@ -0,0 +1,70 @@
1
+ import sys
2
+ import subprocess
3
+ from db import get_conn
4
+
5
+ def copy_to_clipboard(text: str):
6
+ try:
7
+ p = subprocess.Popen(['clip.exe'], stdin=subprocess.PIPE, close_fds=True)
8
+ p.communicate(input=text.encode('utf-8'))
9
+ print("📋 Tailored pitch copied to clipboard!")
10
+ except Exception as e:
11
+ print(f"Could not copy to clipboard: {e}")
12
+
13
+ def open_job(job_id_or_url: str):
14
+ conn = get_conn()
15
+ c = conn.cursor()
16
+ c.execute("SELECT * FROM jobs WHERE id = ? OR url = ?", (job_id_or_url, job_id_or_url))
17
+ row = c.fetchone()
18
+ conn.close()
19
+
20
+ if not row:
21
+ print(f"❌ Job '{job_id_or_url}' not found in database.")
22
+ return
23
+
24
+ job = dict(row)
25
+ url = job.get("url")
26
+ pitch = job.get("tailored_pitch", "")
27
+
28
+ print("\n" + "="*60)
29
+ print(f"🎯 Preparing application for: {job.get('company')} — {job.get('title')}")
30
+ print(f"🔗 URL: {url}")
31
+ print("="*60)
32
+
33
+ if pitch:
34
+ copy_to_clipboard(pitch)
35
+ print("\n📝 PITCH READY TO PASTE:\n")
36
+ print(pitch)
37
+ print("\n" + "-"*60)
38
+
39
+ pow_raw = job.get("proof_of_work")
40
+ if pow_raw:
41
+ try:
42
+ from rjh.jsonparse import parse_json_loose
43
+ pow_data = parse_json_loose(pow_raw) if isinstance(pow_raw, str) else pow_raw
44
+ print("\n🏗️ PROOF-OF-WORK ARCHITECTURE:\n")
45
+ if pow_data.get("problem_diagnosis"):
46
+ print(f"• Bottleneck: {pow_data['problem_diagnosis']}")
47
+ if pow_data.get("solution_architecture"):
48
+ print(f"• Plan: {pow_data['solution_architecture']}")
49
+ if pow_data.get("mermaid_diagram"):
50
+ print(f"\n```mermaid\n{pow_data['mermaid_diagram']}\n```")
51
+ print("\n" + "-"*60)
52
+ except Exception:
53
+ pass
54
+
55
+ import webbrowser
56
+ from urllib.parse import urlparse
57
+
58
+ print("\n🚀 Opening application in your browser...")
59
+ if url:
60
+ parsed = urlparse(url)
61
+ if parsed.scheme in ("http", "https"):
62
+ webbrowser.open(url)
63
+ else:
64
+ print(f"⚠️ Invalid URL scheme: {url}")
65
+
66
+ if __name__ == "__main__":
67
+ if len(sys.argv) > 1:
68
+ open_job(sys.argv[1])
69
+ else:
70
+ print("Usage: python auto_fill_helper.py <job_id_or_url>")
config.py ADDED
@@ -0,0 +1,144 @@
1
+ import os
2
+ from pathlib import Path
3
+
4
+ BASE_DIR = Path(__file__).resolve().parent
5
+
6
+ def load_env_file(filepath: Path):
7
+ if not filepath.exists():
8
+ return
9
+ try:
10
+ with open(filepath, "r", encoding="utf-8") as f:
11
+ for line in f:
12
+ line = line.strip()
13
+ if not line or line.startswith("#") or "=" not in line:
14
+ continue
15
+ k, v = line.split("=", 1)
16
+ k = k.strip()
17
+ v = v.strip().strip("\"'")
18
+ if k not in os.environ:
19
+ os.environ[k] = v
20
+ except Exception:
21
+ pass
22
+
23
+ # Check JOBDECK_ENV_FILE or RJH_ENV_FILE first (if set), then JOBDECK_HOME/.env, then project .env
24
+ active_home_str = os.environ.get("JOBDECK_HOME") or os.environ.get("RJH_HOME")
25
+ ACTIVE_HOME = Path(active_home_str).expanduser() if active_home_str else BASE_DIR
26
+
27
+ env_file_str = os.environ.get("JOBDECK_ENV_FILE") or os.environ.get("RJH_ENV_FILE")
28
+ ENV_FILE_OVERRIDE = Path(env_file_str).expanduser() if env_file_str else None
29
+
30
+ if ENV_FILE_OVERRIDE is not None:
31
+ load_env_file(ENV_FILE_OVERRIDE)
32
+ load_env_file(ACTIVE_HOME / ".env")
33
+ load_env_file(BASE_DIR / ".env")
34
+
35
+ db_str = os.environ.get("JOBDECK_DB") or os.environ.get("RJH_DB")
36
+ DB_PATH = db_str or os.path.join(str(ACTIVE_HOME), "jobs.db")
37
+ DIGEST_PATH = os.path.join(str(ACTIVE_HOME), "HOT_OPPORTUNITIES.md")
38
+
39
+ # Load profile.yaml fallback values for APPLICANT when env vars are not set
40
+ _prof_identity: dict = {}
41
+ _prof_candidate: dict = {}
42
+ _prof_search: dict = {}
43
+ _prof_llm: dict = {}
44
+ _prof_scoring: dict = {}
45
+ try:
46
+ import yaml
47
+ _pfile = ACTIVE_HOME / "profile.yaml"
48
+ if not _pfile.exists():
49
+ _pfile = BASE_DIR / "profile.yaml"
50
+ if _pfile.exists():
51
+ _pdata = yaml.safe_load(_pfile.read_text(encoding="utf-8")) or {}
52
+ _prof_identity = _pdata.get("identity") or {}
53
+ _prof_candidate = _pdata.get("candidate") or {}
54
+ _prof_search = _pdata.get("search") or {}
55
+ _prof_llm = _pdata.get("llm") or {}
56
+ _prof_scoring = _pdata.get("scoring") or {}
57
+ except Exception:
58
+ pass
59
+
60
+ _links = _prof_identity.get("links") or {}
61
+ _primary_titles = (_prof_search.get("titles") or {}).get("primary") or []
62
+ _boost_keys = list(((_prof_search.get("keywords") or {}).get("boost") or {}).keys())
63
+ _facts = _prof_candidate.get("facts") or []
64
+
65
+ # Applicant Profile (hydrated from env vars first, then profile.yaml, then safe defaults)
66
+ APPLICANT = {
67
+ "name": os.getenv("APPLICANT_NAME") or _prof_identity.get("name") or "AI Automation Builder",
68
+ "location": os.getenv("APPLICANT_LOCATION") or _prof_identity.get("city") or "Remote (EU / US timezone overlap)",
69
+ "email": os.getenv("APPLICANT_EMAIL") or _prof_identity.get("email") or "",
70
+ "phone": os.getenv("APPLICANT_PHONE") or _prof_identity.get("phone") or "",
71
+ "portfolio": os.getenv("APPLICANT_PORTFOLIO") or _links.get("portfolio") or "",
72
+ "github": os.getenv("APPLICANT_GITHUB") or _links.get("github") or "",
73
+ "linkedin": os.getenv("APPLICANT_LINKEDIN") or _links.get("linkedin") or "",
74
+ "title": os.getenv("APPLICANT_TITLE") or (_primary_titles[0].title() if _primary_titles else "AI & Automation Builder · Operations, Growth & Systems"),
75
+ "key_metrics": os.getenv("APPLICANT_KEY_METRICS") or (_facts[0] if _facts else "32+ production n8n workflows, ~350h/mo saved, ~720 ops/mo automated"),
76
+ "stack": os.getenv("APPLICANT_STACK") or (", ".join(_boost_keys) if _boost_keys else "n8n, Python, LLMs, REST APIs, Webhooks, PostgreSQL, HubSpot"),
77
+ "languages": os.getenv("APPLICANT_LANGUAGES", "French (Native), English (C1 Full Professional)"),
78
+ "experience_highlight": os.getenv("APPLICANT_HIGHLIGHT") or (_prof_candidate.get("summary") or "").strip() or "Builder of multimodal AI automation pipelines and autonomous CRM/lead enrichment engines."
79
+ }
80
+
81
+ # Keywords to prioritize
82
+ KEYWORD_FILTERS = [
83
+ "automation", "n8n", "ai", "llm", "agent", "workflow",
84
+ "revops", "growth", "operations", "python", "prompt", "pipeline",
85
+ "solutions", "forward deployed", "integration"
86
+ ]
87
+
88
+ # Roles specifically targeted (Junior to Mid sweet-spot for hybrid tech/ops profile)
89
+ TARGET_ROLES = [
90
+ "ai automation", "automation specialist", "automation engineer",
91
+ "workflow automation", "revops", "revenue operations", "growth operations",
92
+ "solutions engineer", "associate solutions engineer", "junior solutions engineer",
93
+ "ai ops", "ai implementation", "technical operations", "integration specialist",
94
+ "ai agent specialist", "no-code engineer", "low-code"
95
+ ]
96
+
97
+ # Roles and Seniority to disqualify (Strictly avoid Senior, Staff, Principal, LeetCode CS, Research)
98
+ EXCLUDED_ROLES = [
99
+ "senior", "staff", "principal", "lead", "director", "head of", "architect",
100
+ "backend engineer", "back-end engineer", "front-end engineer", "frontend engineer",
101
+ "full-stack engineer", "fullstack engineer", "compiler", "kernel",
102
+ "distributed systems", "infrastructure engineer", "site reliability", "sre",
103
+ "research scientist", "research engineer", "account executive", "recruiter",
104
+ "sales development", "account manager", "legal", "payroll"
105
+ ]
106
+
107
+ # Discord Webhook & Bot
108
+ DISCORD_WEBHOOK_URL = os.getenv("DISCORD_WEBHOOK_URL", "")
109
+ DISCORD_BOT_TOKEN = os.getenv("DISCORD_BOT_TOKEN", None)
110
+
111
+ # Google Gemini API Key
112
+ def get_google_api_key(env_file: "str | Path | None" = None) -> str:
113
+ if os.getenv("GOOGLE_API_KEY"):
114
+ return os.getenv("GOOGLE_API_KEY") or ""
115
+ explicit_env = env_file or os.environ.get("JOBDECK_ENV_FILE") or os.environ.get("RJH_ENV_FILE")
116
+ active_home_str = os.environ.get("JOBDECK_HOME") or os.environ.get("RJH_HOME")
117
+ active_home = Path(active_home_str).expanduser() if active_home_str else BASE_DIR
118
+ candidates: list[Path] = []
119
+ if explicit_env:
120
+ candidates.append(Path(explicit_env).expanduser())
121
+ candidates.append(active_home / ".env")
122
+ if BASE_DIR / ".env" not in candidates:
123
+ candidates.append(BASE_DIR / ".env")
124
+ for env_path in candidates:
125
+ if env_path.exists():
126
+ try:
127
+ with open(env_path, "r", encoding="utf-8") as f:
128
+ for line in f:
129
+ line = line.strip()
130
+ if line.startswith("GOOGLE_API_KEY="):
131
+ return line.split("=", 1)[1].strip("\"'")
132
+ except Exception:
133
+ pass
134
+ return ""
135
+
136
+ GOOGLE_API_KEY = get_google_api_key()
137
+ GEMINI_MODEL = os.getenv("GEMINI_MODEL", "gemini-3.8-flash")
138
+
139
+ # Scoring threshold
140
+ MIN_SCORE_THRESHOLD = float(os.getenv("MIN_SCORE_THRESHOLD", "7.5"))
141
+
142
+ # Server Config
143
+ COMMAND_CENTER_PORT = int(os.getenv("COMMAND_CENTER_PORT", "5070"))
144
+ COMMAND_CENTER_HOST = os.getenv("COMMAND_CENTER_HOST", "127.0.0.1")