terminalhire 0.2.0 → 0.2.3

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.
@@ -1471,10 +1471,12 @@ function clearSpinnerVerbs() {
1471
1471
  }
1472
1472
  return { cleared: true, keptUserVerbs };
1473
1473
  }
1474
- function buildTips(topMatches, baseUrl, max = 3) {
1474
+ function buildTips(topMatches, baseUrl, max = 8) {
1475
1475
  const base = String(baseUrl || "https://terminalhire.com").replace(/\/+$/, "");
1476
1476
  const out = [];
1477
- const seen = /* @__PURE__ */ new Set();
1477
+ const seenRole = /* @__PURE__ */ new Set();
1478
+ const perCompany = /* @__PURE__ */ new Map();
1479
+ const COMPANY_CAP = 2;
1478
1480
  for (const m of Array.isArray(topMatches) ? topMatches : []) {
1479
1481
  if (!m || !m.title || !m.company || !m.id) continue;
1480
1482
  const idx = String(m.id).indexOf(":");
@@ -1482,14 +1484,20 @@ function buildTips(topMatches, baseUrl, max = 3) {
1482
1484
  const source = String(m.id).slice(0, idx);
1483
1485
  const ext = String(m.id).slice(idx + 1);
1484
1486
  if (!source || !ext) continue;
1485
- const key = `${source}/${ext}`;
1486
- if (seen.has(key)) continue;
1487
- seen.add(key);
1488
- let title = String(m.title).trim().replace(/\s+/g, " ");
1487
+ const companyRaw = String(m.company).trim().replace(/\s+/g, " ");
1488
+ const titleRaw = String(m.title).trim().replace(/\s+/g, " ");
1489
+ const roleKey = `${titleRaw.toLowerCase()}@${companyRaw.toLowerCase()}`;
1490
+ const coKey = companyRaw.toLowerCase();
1491
+ if (seenRole.has(roleKey)) continue;
1492
+ if ((perCompany.get(coKey) || 0) >= COMPANY_CAP) continue;
1493
+ seenRole.add(roleKey);
1494
+ perCompany.set(coKey, (perCompany.get(coKey) || 0) + 1);
1495
+ let title = titleRaw;
1489
1496
  if (title.length > 34) title = title.slice(0, 33).trimEnd() + "\u2026";
1490
- const company = titleCase(String(m.company).trim().replace(/\s+/g, " "));
1497
+ const company = titleCase(companyRaw);
1491
1498
  const pct = Math.max(1, Math.min(99, Math.round((Number(m.score) || 0) * 100)));
1492
- const url = `${base}/j/${source}/${encodeURIComponent(ext)}`;
1499
+ const token = Buffer.from(String(m.id)).toString("base64url");
1500
+ const url = `${base}/j/${token}`;
1493
1501
  out.push(`\u2197 ${title} @ ${company} \xB7 ${pct}% \u2014 ${url}`);
1494
1502
  if (out.length >= max) break;
1495
1503
  }
@@ -1822,7 +1830,7 @@ async function run() {
1822
1830
  const fp = profileToFingerprint2(profile);
1823
1831
  const results = match2(fp, jobs, jobs.length);
1824
1832
  matchCount = results.length;
1825
- topMatches = results.slice(0, 8).map((r) => ({
1833
+ topMatches = results.slice(0, 25).map((r) => ({
1826
1834
  id: r.job.id,
1827
1835
  title: r.job.title,
1828
1836
  company: r.job.company,
@@ -1867,7 +1875,7 @@ async function run() {
1867
1875
  const verbs = buildSpinnerPool2(ranked, sc.max, { sessionTags, frequency: sc.frequency });
1868
1876
  if (verbs.length > 0) applySpinnerVerbs2(verbs, sc.mode);
1869
1877
  else clearSpinnerVerbs2();
1870
- const tips = buildTips2(ranked, API_URL, 3);
1878
+ const tips = buildTips2(ranked, API_URL, 8);
1871
1879
  if (tips.length > 0) applySpinnerTips2(tips);
1872
1880
  else clearSpinnerTips2();
1873
1881
  } else {