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

Function _daily_note_reading_entries

deployments/desktop/shared/agents.py:3442–3475  ·  view source on GitHub ↗
(scope: str = "latest", month: str = "", query: str = "", limit: int = 12)

Source from the content-addressed store, hash-verified

3440 return {
3441 "node_id": node.get("node_id"),
3442 "node_type": node.get("node_type"),
3443 "title": node.get("title"),
3444 "body": str(node.get("body") or "")[:800],
3445 "keywords": node.get("keywords"),
3446 "file_path": node.get("file_path"),
3447 "metadata": _compact_wiki_metadata(node.get("metadata") or {}),
3448 "score": node.get("score"),
3449 "updated_at": node.get("updated_at"),
3450 }
3451
3452
3453def _compact_wiki_metadata(value: Any, *, depth: int = 0) -> Any:
3454 if depth > 3:
3455 return None
3456 if isinstance(value, dict):
3457 compact: Dict[str, Any] = {}
3458 for key, item in value.items():
3459 key_text = str(key)
3460 if re.search(r"(embedding|vector|long_term_vector|short_term_vector)", key_text, re.I):
3461 continue
3462 cleaned = _compact_wiki_metadata(item, depth=depth + 1)
3463 if cleaned is not None:
3464 compact[key_text] = cleaned
3465 return compact
3466 if isinstance(value, list):
3467 if len(value) > 24 and all(isinstance(item, (int, float)) for item in value):
3468 return None
3469 return [_compact_wiki_metadata(item, depth=depth + 1) for item in value[:24]]
3470 if isinstance(value, (str, int, float, bool)) or value is None:
3471 return value
3472 return str(value)
3473
3474
3475def _wiki_display_priority(node: Dict[str, Any]) -> Tuple[int, float]:
3476 node_type = str(node.get("node_type") or "")
3477 metadata = node.get("metadata") if isinstance(node.get("metadata"), dict) else {}
3478 section_kind = str(metadata.get("section_kind") or "").lower()

Callers 3

daily_note_mentionsFunction · 0.85
_resolve_wiki_mentionsFunction · 0.85
_chat_pinned_nodesFunction · 0.85

Calls 6

getMethod · 0.80

Tested by

no test coverage detected