Format the reading-report completion message with direct document links.
(created_docs: List[Dict[str, Any]])
| 1321 | } |
| 1322 | return updated_profile, metadata |
| 1323 | def format_created_docs_summary(created_docs: List[Dict[str, Any]]) -> str: |
| 1324 | """Format the reading-report completion message with direct document links.""" |
| 1325 | lines = [ |
| 1326 | "=" * 60, |
| 1327 | f"Reading reports ready ({len(created_docs)})", |
| 1328 | "=" * 60, |
| 1329 | "", |
| 1330 | ] |
| 1331 | |
| 1332 | for index, doc in enumerate(created_docs, start=1): |
| 1333 | title = doc.get("paper", {}).get("title") or doc.get("title", "Unknown") |
| 1334 | lines.append(f"{index:02d}. {title[:60]}") |
| 1335 | if doc.get("tracking_url"): |
| 1336 | lines.append(f" {doc['tracking_url']}") |
| 1337 | elif doc.get("url"): |
| 1338 | lines.append(f" {doc['url']}") |
| 1339 | elif doc.get("doc_token"): |
| 1340 | lines.append(f" doc_token: {doc['doc_token']}") |
| 1341 | lines.append("") |
| 1342 | |
| 1343 | lines.append("Open the links above to start reading.") |
| 1344 | return "\n".join(lines) |
| 1345 | |
| 1346 | |
| 1347 | def _build_reused_doc_entry( |
no test coverage detected