diff --git a/package.json b/package.json index 14b1944..0095595 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "oh-my-workers", - "version": "1.2.0", + "version": "1.3.1", "description": "A personal AI agent that automates daily working tasks at workplace, eg: Cronjobs, KPI reporting and etc", "type": "module", "main": "index.js", @@ -21,23 +21,30 @@ }, "keywords": [ "oh-my-workers", - "kpi", - "daily work diary", - "workplace automation", + "KPI", + "Daily work diary", + "Workplace automation", "AI assistant", - "daily kpi reporting", - "cronjobs", + "Daily KPI reporting", + "Cronjob", + "AI news", + "Github trending", + "AI generated Github trending projects", "automation", "AI agent", "langchain", "langsmith", + "langgraph", "Nvidia", "nemotron", "typescript", "neon", "postgresql", "personal assistant", - "news search" + "news search", + "Pino", + "zod", + "LangChain AI agent" ], "author": "damengrandom", "license": "ISC", diff --git a/src/agent/kpi-record.ts b/src/agent/kpi-record.ts index 8102d81..b534be4 100644 --- a/src/agent/kpi-record.ts +++ b/src/agent/kpi-record.ts @@ -1,13 +1,6 @@ import { parseJson } from './utils.ts' import type { KpiRecord } from '../schemas/index.ts' -// Lives in its own module so it can be tested without importing agent/index.ts, -// which pulls in the agents — and those call createLlm() at module load, so a -// test would need a live LLM_API_KEY just to check JSON parsing. -// -// Every field is defensive: the GitHub tool output is LLM-relayed, so any of it -// can be missing. Silently writing zeros is the failure nobody notices, which is -// exactly why this half is separated and covered. export function toKpiRecord(githubOutput: string, now: string): KpiRecord { const data = parseJson<{ summary?: string; commits?: unknown[]; pullRequests?: unknown[] }>(githubOutput, {}) diff --git a/src/agent/llm.ts b/src/agent/llm.ts index 690bd69..e07936f 100644 --- a/src/agent/llm.ts +++ b/src/agent/llm.ts @@ -1,12 +1,6 @@ import { ChatOpenAI } from '@langchain/openai' import { DEFAULT_LLM, DEFAULT_LLM_BASE_URL, LLM_FALLBACK_MODELS } from '../constants/index.js' -// ponytail: OpenRouter answers HTTP 200 with an {error} body and NO `choices` -// when the upstream provider is capacity-exhausted ("Worker local total request -// limit reached (32/32)"). The OpenAI SDK sees 200, doesn't throw, and hands back -// an empty result — which only blows up later inside LangChain as -// `Cannot read properties of undefined (reading 'message')`, nowhere near the -// real cause. Convert it to a real error here so retries and alerts can see it. export const failLoudlyOnProviderError: typeof fetch = async (input, init) => { const res = await fetch(input, init) diff --git a/src/agent/news-curator.agent.ts b/src/agent/news-curator.agent.ts index 56a1056..4a3cf78 100644 --- a/src/agent/news-curator.agent.ts +++ b/src/agent/news-curator.agent.ts @@ -3,8 +3,6 @@ import { createLlm } from './llm.js' import { TRENDING_CURATOR_PROMPT } from './prompt.js' import type { TrendingRepo } from '../schemas/index.js' -// The model only writes prose. Star counts, URLs and ordering come from the -// scrape, so no amount of hallucination can corrupt the numbers on the digest. const SummarySchema = z.object({ repos: z.array( z.object({ @@ -15,9 +13,6 @@ const SummarySchema = z.object({ ), }) -// Exported for testing: merges model prose back onto the authoritative scraped -// rows, preserving the caller's (star-growth) ordering and dropping any repo the -// model invented. export function mergeSummaries(repos: TrendingRepo[], summaries: z.infer['repos']) { const byName = new Map(summaries.map((s) => [s.repo_name, s])) @@ -41,10 +36,6 @@ export function mergeSummaries(repos: TrendingRepo[], summaries: z.infer { const listing = repos.map((r) => `${r.name} (${r.todayStars} stars today, ${r.stars} total, ${r.language}) — ${r.description}`).join('\n')