chore(mana): news aus unified-App entfernen
Some checks are pending
CD Mac Mini / Detect Changes (push) Waiting to run
CD Mac Mini / Deploy (push) Blocked by required conditions
CI / Build mana-sync (push) Blocked by required conditions
CI / Build mana-api-gateway (push) Blocked by required conditions
CI / Build mana-crawler (push) Blocked by required conditions
CI / Detect Changes (push) Waiting to run
CI / Validate (push) Waiting to run
CI / Build mana-search (push) Blocked by required conditions
Docker Validate / Validate Dockerfiles (push) Waiting to run
Docker Validate / Build calendar-web (push) Blocked by required conditions
Docker Validate / Build quotes-web (push) Blocked by required conditions
Docker Validate / Build todo-backend (push) Blocked by required conditions
Docker Validate / Build todo-web (push) Blocked by required conditions
Docker Validate / Build mana-auth (push) Blocked by required conditions
Docker Validate / Build mana-sync (push) Blocked by required conditions
Docker Validate / Build mana-media (push) Blocked by required conditions
Mirror to Forgejo / Push to Forgejo (push) Waiting to run

Reader-Surface ist nach Pageta (pageta.mana.how + pageta-api.mana.how)
umgezogen, das seit 2026-05-16 live ist und mehr Features bietet als
das alte managarten-news-Modul:
- Highlights (4 Farben, plain-text-offsets, Kontext)
- Reading-Progress + User-Note pro Artikel
- Bulk-Import (200 URLs/Job mit Worker)
- 5 MCP-Tools (save/list/archive/tag/highlight)
- Reading-Status-Enum (unread/reading/finished/archived) statt Boolean

Was Pageta NICHT hat: Categories mit Color+Icon — Pageta verwendet
freie String-Tags statt visuelle Folders. Bewusste Design-Entscheidung
in Pageta.

Daten-Migration: KEIN automatisches Skript. User mit gespeicherten
Artikeln im managarten-newsArticles müssen ihre Liste in Pageta neu
aufbauen (oder Bulk-Import via /api/v1/imports verwenden).

Gelöscht / abgebaut:
- Module: apps/mana/.../modules/news + Routen + Locales
- apps/articles/migrations/from-news.ts (one-off-Migration nach
  articles-Modul, Sentinel-gated, abgeschlossen) + Call in
  (app)/+layout.svelte
- apps/api/src/modules/news + MCP-Executor save_news_article
- shared-branding: APP_ICONS.news + MANA_APPS news-Entry
- shared-ai/tools/schemas save_news_article
- shared-types/spaces: 3 'news'-Einträge in Space-Modul-Listen
- Cross-Module: news-research/ListView + (app)/news-research/+page.svelte
  hatten den preferencesStore + usePreferences vom news-Modul für
  Custom-Feed-Pinning — Pin-UI entfernt (Custom-Feeds sind jetzt
  Pageta-Verantwortung)
- Dashboard: 'news-unread' Widget + NewsUnreadWidget-Import
- Registries: app-registry/apps.ts (News registerApp + Newspaper icon +
  Header), categories, help-content, module-registry, data/tools/init
- i18n: news in apps/{de,en,es,fr,it}.json

Was BLEIBT:
- `news-research` Modul + `apps/api/src/modules/news-research/` —
  RSS-Discovery + Search-Funktion bleibt im managarten als
  Recherche-Tool für andere Module
- `mana-news-pool` Plattform-Service (Code/mana/services/) — wird von
  news-research + Pageta-Standalone konsumiert
- shared-ai `research_news` Tool

Dexie v65 Migration:
- droppt newsArticles, newsCategories, newsPreferences, newsReactions,
  newsCachedFeed

mana-web svelte-check 0/0, snapshot test 10/10.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
Till JS 2026-05-18 15:03:56 +02:00
parent fc616688e3
commit 609f662538
54 changed files with 19 additions and 4766 deletions

View file

@ -1,94 +0,0 @@
/**
* News module Reads the curated article pool + extracts ad-hoc URLs.
*
* Pool population: handled by the Plattform-Service `mana-news-pool`
* (Port 3079, eigene DB `mana_news_pool`, Schema `pool.curated_articles`).
* Cutover am 2026-05-17: ehemals direkter Raw-SQL-Read auf
* `mana_platform.news.curated_articles` aus dem `news-ingester:3066`-
* Container. Hier nur noch HTTP-Proxy auf den Plattform-Pool.
*
* Saved articles (die persönliche Reading-List eines Users) leben
* weiterhin client-side in der IndexedDB der unified Mana-App und
* syncen via mana-sync; dieses Modul sieht sie nicht.
*/
import { Hono } from 'hono';
import { extractFromUrl } from '@mana/shared-rss';
const POOL_URL = process.env.MANA_NEWS_POOL_URL ?? 'http://mana-news-pool:3079';
const POOL_KEY = process.env.MANA_SERVICE_KEY ?? '';
// ─── Routes ─────────────────────────────────────────────────
const routes = new Hono();
// ─── Feed (proxy on mana-news-pool) ────────────────────────
//
// Query params:
// topics — comma-separated topic slugs (tech,wissenschaft,…)
// lang — 'de' | 'en' | 'all' (default 'all')
// since — ISO timestamp
// limit — default 50, max 200
// offset — default 0
routes.get('/feed', async (c) => {
const passthrough = ['topics', 'lang', 'since', 'limit', 'offset'] as const;
const url = new URL(`${POOL_URL}/feed`);
for (const k of passthrough) {
const v = c.req.query(k);
if (v) url.searchParams.set(k, v);
}
try {
const res = await fetch(url.toString(), {
headers: { 'X-Service-Key': POOL_KEY },
signal: AbortSignal.timeout(8_000),
});
if (!res.ok) {
console.warn(`[news] pool ${url}${res.status}`);
return c.json([] as Record<string, unknown>[]);
}
const data = (await res.json()) as Record<string, unknown>[];
return c.json(data);
} catch (err) {
console.warn('[news] pool fetch failed', err);
return c.json([] as Record<string, unknown>[]);
}
});
// ─── Extract (content extraction for user-pasted URLs) ─────
routes.post('/extract/preview', async (c) => {
const { url } = await c.req.json<{ url: string }>();
if (!url) return c.json({ error: 'URL is required' }, 400);
const article = await extractFromUrl(url);
if (!article) return c.json({ error: 'Extraction failed' }, 502);
return c.json(article);
});
routes.post('/extract/save', async (c) => {
const { url } = await c.req.json<{ url: string }>();
if (!url) return c.json({ error: 'URL is required' }, 400);
const extracted = await extractFromUrl(url);
if (!extracted) return c.json({ error: 'Extraction failed' }, 502);
return c.json({
id: crypto.randomUUID(),
type: 'saved',
sourceOrigin: 'user_saved',
originalUrl: url,
title: extracted.title,
content: extracted.content,
htmlContent: extracted.htmlContent,
excerpt: extracted.excerpt,
author: extracted.byline,
siteName: extracted.siteName,
wordCount: extracted.wordCount,
readingTimeMinutes: extracted.readingTimeMinutes,
isArchived: false,
});
});
export { routes as newsRoutes };