MCPcopy Create free account
hub / github.com/Qinbf/groundmap / process

Function process

scripts/postprocess.py:281–291  ·  view source on GitHub ↗

一站式:text → (含锚点文本, outline 字典) 幂等:text 已含锚点时仅重建 outline,不重复加锚。 若提供 previous_outline,新 outline 会保留同 anchor 的 agent_summary。

(text: str, doc_path: str, previous_outline: dict | None = None)

Source from the content-addressed store, hash-verified

279
280
281def process(text: str, doc_path: str, previous_outline: dict | None = None) -> tuple[str, dict]:
282 """
283 一站式:text → (含锚点文本, outline 字典)
284 幂等:text 已含锚点时仅重建 outline,不重复加锚。
285 若提供 previous_outline,新 outline 会保留同 anchor 的 agent_summary。
286 """
287 text_with_anchors, _blocks = add_anchors(text)
288 outline_data = build_outline_data(
289 text_with_anchors, doc_path, previous_outline=previous_outline
290 )
291 return text_with_anchors, outline_data

Calls 2

add_anchorsFunction · 0.85
build_outline_dataFunction · 0.85