MCPcopy Create free account
hub / github.com/OpenRaiser/PaperFlow / _preview_payload

Function _preview_payload

deployments/desktop/shared/agents.py:324–339  ·  view source on GitHub ↗
(task: Dict[str, Any])

Source from the content-addressed store, hash-verified

322
323
324def _preview_payload(task: Dict[str, Any]) -> Optional[Dict[str, Any]]:
325 items = list(task.get("preview_items") or [])
326 if not items:
327 return None
328 return {
329 "push_id": task.get("task_id"),
330 "push_time": task.get("started_at") or task.get("created_at"),
331 "papers": [_paper_card(paper, index) for index, paper in enumerate(items, start=1)],
332 "metadata": {
333 "preview": True,
334 "phase": task.get("progress_phase") or task.get("status"),
335 "fetched_count": int(task.get("fetched_count") or 0),
336 "ranked_count": int(task.get("ranked_count") or 0),
337 "total_fetched": int(task.get("fetched_count") or len(items)),
338 },
339 }
340
341
342def _profile_summary(profile: Optional[Dict[str, Any]]) -> Optional[Dict[str, Any]]:

Callers 1

_daily_task_payloadFunction · 0.85

Calls 2

_paper_cardFunction · 0.85
getMethod · 0.80

Tested by

no test coverage detected