Self-hosted, Self-Improving, Federated Everything App — dev management, agent orchestration, persistent mind, digital twin, second brain, and creative pipeline from a single dashboard over Tailscale to port the user into the OS
JavaScript ai-agentsdashboarddeveloper-toolsdigital-twinquantified-selfsecond-brainself-hostedtailscale
feat(cos): add Claude Code changelog tracking to daily briefing
Adam Eivy5cc7793679dd
diff --git a/.changelog/NEXT.md b/.changelog/NEXT.mdindex 9869be3d15..e90f64f471 100644--- a/.changelog/NEXT.md+++ b/.changelog/NEXT.md@@ -1,6 +1,7 @@# Unreleased Changes## Added+- Claude Code changelog tracking: fetches GitHub Atom feed for new releases, caches with 1-hour TTL, surfaces new versions in daily briefing- POST wordplay drill cache: pre-generates challenges on startup so drills load instantly from cache with background replenishment- POST local scoring for deterministic drill types (bridge-word, compound-chain, verbal-fluency, story-recall) — instant results without LLM calls- POST loading indicator with elapsed timer, progress bar, and cycling status messages replaces static spinnerdiff --git a/server/routes/cos.js b/server/routes/cos.jsindex 73602c5140..eeddeff357 100644--- a/server/routes/cos.js+++ b/server/routes/cos.js@@ -17,6 +17,7 @@ import * as productivity from '../services/productivity.js';import * as goalProgress from '../services/goalProgress.js';import * as decisionLog from '../services/decisionLog.js';import { reinitialize as reinitializeEmbeddings } from '../services/memoryEmbeddings.js';+import * as claudeChangelog from '../services/claudeChangelog.js';import { asyncHandler, ServerError } from '../lib/errorHandler.js';import { validateRequest, sanitizeTaskMetadata } from '../lib/validation.js';import { z } from 'zod';@@ -456,6 +457,18 @@ router.get('/briefings/:date', asyncHandler(async (req, res) => {res.json(briefing);}));+// GET /api/cos/claude-changelog - Get Claude Code changelog (fetches Atom feed)+router.get('/claude-changelog', asyncHandler(async (req, res) => {+ const result = await claudeChangelog.checkChangelog();+ res.json(result);+}));++// GET /api/cos/claude-changelog/cached - Get cached changelog without fetching+router.get('/claude-changelog/cached', asyncHandler(async (req, res) => {+ const result = await claudeChangelog.getCachedChangelog();+ res.json(result);+}));+// GET /api/cos/scripts - List generated scriptsrouter.get('/scripts', asyncHandler(async (req, res) => {const scripts = await cos.listScripts();diff --git a/server/services/autonomousJobs.js b/server/services/autonomousJobs.jsindex 07359ab446..80aade3ba5 100644--- a/server/services/autonomousJobs.js+++ b/server/services/autonomousJobs.js@@ -228,8 +228,9 @@ Tasks to perform:3. Check brain digest (GET /api/brain/digest/latest) for recent thought patterns4. Review CoS learning insights (GET /api/cos/learning/insights) for system health5. Check which agents completed work recently (GET /api/cos/agents)-6. Suggest 2-3 focus areas for today based on open tasks and recent activity-7. For each agent-actionable focus area (coding tasks, GitHub maintenance, system fixes — NOT personal activities), create a CoS task via POST /api/cos/tasks if no equivalent task already exists in the pending tasks from steps 1-2. Use type "internal", appropriate priority, and include context about why it was flagged.+6. Check Claude Code changelog for new releases (GET /api/cos/claude-changelog). If there are newEntries, include a "Claude Code Updates" section listing each new version with a brief summary. Link to the release page for details.+7. Suggest 2-3 focus areas for today based on open tasks and recent activity+8. For each agent-actionable focus area (coding tasks, GitHub maintenance, system fixes — NOT personal activities), create a CoS task via POST /api/cos/tasks if no equivalent task already exists in the pending tasks from steps 1-2. Use type "internal", appropriate priority, and include context about why it was flagged.Write the briefing in a concise, actionable format. Save it as a CoS report. Note which tasks were created.`,lastRun: null,diff --git a/server/services/claudeChangelog.js b/server/services/claudeChangelog.jsnew file mode 100644index 0000000000..408efe1f9b--- /dev/null+++ b/server/services/claudeChangelog.js@@ -0,0 +1,159 @@+/**+ * Claude Code Changelog Service+ *+ * Fetches the Claude Code releases Atom feed from GitHub,+ * parses entries, and tracks which releases are new since last check.+ * Used by the daily briefing to alert the user of new Claude Code features.+ */++import { writeFile } from 'fs/promises'+import { join } from 'path'+import sax from 'sax'+import { readJSONFile, PATHS, ensureDir } from '../lib/fileUtils.js'+import { fetchWithTimeout } from '../lib/fetchWithTimeout.js'++const FEED_URL = 'https://github.com/anthropics/claude-code/releases.atom'+const STATE_FILE = join(PATHS.data, 'claude-changelog.json')+const MAX_ENTRIES = 10+const MAX_SUMMARY_LENGTH = 500+const STALE_MS = 60 * 60 * 1000 // 1 hour++const defaultState = () => ({+ lastCheck: null,+ lastSeenVersion: null,+ entries: []+})++function parseAtomFeed(xml) {+ return new Promise((resolve, reject) => {+ const parser = sax.parser(true, { trim: true })+ const entries = []+ let current = null+ let tag = null+ let inFeed = false+ let settled = false++ parser.onopentag = (node) => {+ tag = node.name+ if (tag === 'feed') inFeed = true+ if (tag === 'entry' && inFeed) {+ current = { title: '', link: '', updated: '', content: '' }+ }+ if (current && tag === 'link' && node.attributes.href) {+ current.link = node.attributes.href+ }+ }++ parser.ontext = (text) => {+ if (!current || !tag) return+ if (tag === 'title') current.title += text+ if (tag === 'updated') current.updated += text+ if (tag === 'content') current.content += text+ }++ parser.oncdata = (cdata) => {+ if (!current || !tag) return+ if (tag === 'content') current.content += cdata+ }++ parser.onclosetag = (name) => {+ if (name === 'entry' && current) {+ entries.push(current)+ current = null+ }+ tag = null+ }++ parser.onerror = (err) => {+ if (!settled) {+ settled = true+ reject(err)+ }+ }++ parser.onend = () => {+ if (!settled) {+ settled = true+ resolve(entries)+ }+ }++ parser.write(xml).close()+ })+}++function extractVersion(title) {+ const match = title?.match(/v?(\d+\.\d+\.\d+(?:-[a-zA-Z0-9.]+)?)/)+ return match ? match[1] : null+}++function stripHtml(html) {+ return html+ .replace(/<[^>]+>/g, ' ')+ .replace(/&/g, '&')+ .replace(/</g, '<')+ .replace(/>/g, '>')+ .replace(/"/g, '"')+ .replace(/'/g, "'")+ .replace(/\s+/g, ' ')+ .trim()+}++/**+ * Fetch the Claude Code changelog, parse it, and return new entries since last check.+ * Returns cached data if checked within the last hour.+ */+export async function checkChangelog() {+ const state = await readJSONFile(STATE_FILE, defaultState())++ // Return cached data if fresh enough+ if (state.lastCheck && (Date.now() - new Date(state.lastCheck).getTime()) < STALE_MS) {+ const newEntries = state.lastSeenVersion+ ? state.entries.filter(e => new Date(e.date) > new Date(state.lastCheck))+ : []+ return { ...state, newEntries }+ }++ const response = await fetchWithTimeout(FEED_URL, {}, 15000)+ if (!response.ok) {+ console.error(`❌ Claude changelog fetch failed: ${response.status}`)+ return { ...state, newEntries: [] }+ }++ const xml = await response.text()+ const allEntries = await parseAtomFeed(xml)++ const entries = allEntries.slice(0, MAX_ENTRIES).map(e => ({+ version: extractVersion(e.title),+ title: e.title,+ link: e.link,+ date: e.updated,+ summary: stripHtml(e.content.slice(0, MAX_SUMMARY_LENGTH * 4)).slice(0, MAX_SUMMARY_LENGTH)+ }))++ // Determine new entries since last check using date comparison+ const newEntries = state.lastCheck+ ? entries.filter(e => new Date(e.date) > new Date(state.lastCheck))+ : []++ const now = new Date().toISOString()+ const newState = {+ lastCheck: now,+ lastSeenVersion: entries[0]?.version || state.lastSeenVersion,+ entries+ }++ await ensureDir(PATHS.data)+ await writeFile(STATE_FILE, JSON.stringify(newState, null, 2))++ console.log(`📋 Claude changelog: ${entries.length} entries, ${newEntries.length} new since ${state.lastCheck || 'first check'}`)++ return { ...newState, newEntries }+}++/**+ * Get cached changelog state without fetching.+ */+export async function getCachedChangelog() {+ return readJSONFile(STATE_FILE, defaultState())+}