From 199175f5f60b7b7f3cbde063ed5215d34d44b1fe Mon Sep 17 00:00:00 2001 From: Matthew Jackson Date: Fri, 6 Mar 2026 14:09:19 -0800 Subject: [PATCH] Add --telegram flag to status report, fix missing duplicate/closed counts status.mjs --telegram sends the report to Telegram with proper bold formatting. Console output strips markdown. Queue total now accounts for duplicates. Co-Authored-By: Claude Opus 4.6 --- status.mjs | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) diff --git a/status.mjs b/status.mjs index a67e760..da90321 100644 --- a/status.mjs +++ b/status.mjs @@ -118,9 +118,11 @@ function buildStatus() { }, queue: { total: queue.length, + duplicate: byStatus['duplicate'] || 0, new: byStatus['new'] || 0, filtered: byStatus['filtered'] || 0, applied: byStatus['applied'] || 0, + closed: byStatus['closed'] || 0, failed: byStatus['failed'] || 0, needs_answer: byStatus['needs_answer'] || 0, skipped_external: byStatus['skipped_external_unsupported'] || 0, @@ -220,12 +222,14 @@ function formatReport(s) { if (lastApplierDetail) lines.push(lastApplierDetail); // Queue summary — only show non-zero counts - lines.push('', `📋 *Queue* — ${q.total} total`); + const unique = q.total - (q.duplicate || 0); + lines.push('', `📋 *Queue* — ${unique} unique jobs (${q.duplicate || 0} dupes)`); const queueLines = [ [q.new, 'Ready to apply'], [q.applied, 'Applied'], [q.filtered || 0, 'AI filtered'], + [q.closed || 0, 'Closed'], [q.needs_answer, 'Needs answer'], [q.skipped_other || 0, 'Incomplete/stuck'], [q.skipped_no_apply, 'No apply button'], @@ -252,10 +256,19 @@ function formatReport(s) { return lines.join('\n'); } +import { loadConfig } from './lib/queue.mjs'; +import { sendTelegram } from './lib/notify.mjs'; + +const telegramMode = process.argv.includes('--telegram'); const status = buildStatus(); if (jsonMode) { console.log(JSON.stringify(status, null, 2)); } else { - console.log(formatReport(status)); + const report = formatReport(status); + console.log(report.replace(/\*/g, '')); + if (telegramMode) { + const settings = loadConfig(resolve(__dir, 'config/settings.json')); + await sendTelegram(settings, report); + } }