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

Function renderChatSources

deployments/desktop/static/desktop.js:4242–4259  ·  view source on GitHub ↗
(sources = DEMO_MODE ? demoSources : [])

Source from the content-addressed store, hash-verified

4240 ...(state.wikiGraph?.nodes || []),
4241 ...(state.wikiNodes || [])
4242 ]);
4243 return Object.fromEntries(nodes.map((node) => [graphId(node), node]));
4244 }
4245
4246 function currentGraphEdges() {
4247 return (state.wikiGraph?.edges || []).map(normalizeGraphEdge);
4248 }
4249
4250 function relationLabel(raw) {
4251 return localizeWikiText(String(raw || "related").replaceAll("_", " "));
4252 }
4253
4254 function pickWikiFocusNodeId() {
4255 const nodes = state.wikiGraph?.nodes || [];
4256 if (!nodes.length) return "";
4257 const edges = currentGraphEdges();
4258 const degree = graphDegreeMap(nodes, edges);
4259 const candidates = nodes.filter((node) => {
4260 const id = graphId(node);
4261 const type = graphType(node);
4262 return !id.startsWith("user:") && type !== "frontier";

Callers 6

resetChatThreadFunction · 0.85
renderChatMessagesFunction · 0.85
clearChatHistoryFunction · 0.85
processFrameFunction · 0.85
askWikiFunction · 0.85
initFunction · 0.85

Calls 4

normalizeCitationSourceFunction · 0.85
uiFunction · 0.85
$Function · 0.70
escapeHtmlFunction · 0.70

Tested by

no test coverage detected