koala73 / koala73/worldmonitor
feat(pro): exportable intelligence reports — HTML/PDF document artifact from cached briefs and panels
- Dominant language
- TypeScript
- Stars
- 86.6k
- Forks
- 13.1k
- Avg merge
- 8h 4m
- Merged PRs (30d)
- 825
Description
## Summary
We generate world/country briefs as JSON/text (`get_world_brief`, `get_country_brief`) but offer no **document artifact**: a formatted, shareable multi-domain intelligence report (HTML/PDF) that a user or agent can produce on demand. This is a natural Pro deliverable — "give me this morning's brief as a PDF I can forward" — and an obvious agent workflow terminus.
## Proposed scope
1. **Report composer**: server-side template assembling selected sections (world brief, country risk, markets snapshot, conflict summary, energy, forecasts) from existing cached envelopes — no new data.
2. **Formats**: HTML first (cheap, styleable, printable); PDF as a follow-up if demand shows (client `src/utils/export-report.ts` already does some export work — reuse patterns, don't fork).
3. **Surfaces**: REST endpoint + MCP tool (`generate_report`) returning a URL or the HTML body; Pro-gated (composition is expensive relative to single reads).
4. **Branding/disclaimer**: consistent footer with data-vintage stamps per section (seed-meta timestamps).
## Considerations
- Bound section count and reuse cached brief outputs — the tool must not fan out into dozens of fresh LLM calls per invocation.
- Decide storage/expiry if returning URLs (short-lived blob vs inline body).
## Acceptance criteria
- [ ] HTML report with selectable sections, per-section freshness stamps, tests.
- [ ] REST + MCP exposure with quota treatment documented.
Contributor guide
Research direction
Start with src/utils/export-report.ts to understand existing export patterns, then trace the cached brief envelopes and the REST and MCP entry points. Define the HTML composer around selectable sections, per-section freshness stamps, and the branding disclaimer without new data fetches. Done means the HTML report is covered by tests and both REST and MCP exposure document quota treatment.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- html, typescript
- Domain
- api, backend-api-design, documentation
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Quiet
- Clarity
- Mostly clear
- Newbie friendliness
- 48/100