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

Function clean_must_read_value

agents/must-read-manager/main.py:104–118  ·  view source on GitHub ↗

Normalize user-provided must-read values while preserving readable output.

(value: str)

Source from the content-addressed store, hash-verified

102
103
104def clean_must_read_value(value: str) -> str:
105 """Normalize user-provided must-read values while preserving readable output."""
106 cleaned = re.sub(r"\s+", " ", (value or "").strip().strip("\"'`"))
107 connector_patterns = (
108 r"^(?:的)\s*",
109 r"^(?:是|为)\s*",
110 r"^(?:叫做|叫|名为)\s*",
111 )
112 previous = None
113 while cleaned and cleaned != previous:
114 previous = cleaned
115 for pattern in connector_patterns:
116 cleaned = re.sub(pattern, "", cleaned, count=1)
117 cleaned = cleaned.strip()
118 return cleaned
119
120
121def normalize_must_read_value(value: str) -> str:

Callers 6

parse_commandFunction · 0.85
add_must_readFunction · 0.85
remove_must_readFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected