- Introduced AGENT-SPECS.md detailing the specifications for seven agents including their inputs, processing steps, and outputs. - Created API-REFERENCE.md outlining the Sectors API v2 endpoints, parameters, costs, and usage. - Developed API.md to specify backend routes, request/response structures, and error handling. - Established ARCHITECTURE.md to describe the project layout, conventions, scheduler, and citation pipeline. - Added DATA-MODEL.md to define the database schema, tables, and seed strategy. - Compiled PLAN.md to outline the project concept, problem statement, unique features, and implementation timeline. - Created README.md as an index for documentation with links to all relevant files. - Documented ROUTINES.md detailing the seven automated routines, their schedules, inputs, detection logic, and delivery formats. - Introduced TECH-STACK.md to specify the technology choices and rationale for both backend and frontend components.
2.0 KiB
2.0 KiB
Backend API
Base /api. Demo auth: X-User-Key header (single demo key for hackathon).
Errors: {error: {code, message}} with HTTP 400/404/422/502 (502 = upstream Sectors).
Flow
GET /api/flow/summary?date=→ foreign net total, top-5 accumulation rows, rotation signal, mover of day. Each value with citations.GET /api/flow/broker?ticker=&start=&end=→ buyers/sellers + 5d net series.GET /api/flow/foreign?ticker=&start=&end=→ inflow series + reversal flag.GET /api/stream→ SSE (channels: agents, alerts, activity; heartbeat 15 s).
Screen
POST /api/screenbody{where?, q?, institutional?: {broker_score_min, foreign_trend, insider_buying, volume_anomaly}, limit?}→ ranked rows{symbol, name, composite, breakdown: {broker, foreign, insider, fundamental}, citations}.
Routines & briefing
GET /api/routines→ list with enabled + last run status.POST /api/routinesbody{type, schedule_cron?, channels[]}→ created.PATCH /api/routines/:idbody{enabled?, schedule_cron?, channels?}.GET /api/routine-runs?routine_id=&limit=→ run history.GET /api/briefing/today→ latest briefing payload + citations.
Alerts
GET /api/alerts,POST /api/alertsbody{name, rule, channels[]},DELETE /api/alerts/:id,GET /api/alert-events?since=&ticker=.
Report
POST /api/report/:tickerquery?format=json|html|pdf|md→ 7-section payload withcitations[]per section. PDF rendered server-side.
Watchlist / portfolio / accuracy / chat / health
GET /api/watchlist,POST /api/watchlist{ticker},DELETE /api/watchlist/:ticker.GET /api/portfolio/risk→ concentration[], correlation[][], beta, warnings[].GET /api/accuracy→ per-agent{calls, resolved, hits, hit_rate}.POST /api/chatbody{message, scope?: {report_id}}→ cited answer (report scope restricts grounding to that report's citations).GET /api/health→{last_cycle_at, credits_today, scheduler_ok, stale_flags}.