markdown-flow 0.4.2.dev3__tar.gz → 0.4.2.dev4__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {markdown_flow-0.4.2.dev3 → markdown_flow-0.4.2.dev4}/PKG-INFO +1 -1
- {markdown_flow-0.4.2.dev3 → markdown_flow-0.4.2.dev4}/markdown_flow/__init__.py +1 -1
- {markdown_flow-0.4.2.dev3 → markdown_flow-0.4.2.dev4}/markdown_flow/parser/output.py +12 -4
- {markdown_flow-0.4.2.dev3 → markdown_flow-0.4.2.dev4}/markdown_flow.egg-info/PKG-INFO +1 -1
- {markdown_flow-0.4.2.dev3 → markdown_flow-0.4.2.dev4}/LICENSE +0 -0
- {markdown_flow-0.4.2.dev3 → markdown_flow-0.4.2.dev4}/README.md +0 -0
- {markdown_flow-0.4.2.dev3 → markdown_flow-0.4.2.dev4}/markdown_flow/constants.py +0 -0
- {markdown_flow-0.4.2.dev3 → markdown_flow-0.4.2.dev4}/markdown_flow/constants_system_prompt.py +0 -0
- {markdown_flow-0.4.2.dev3 → markdown_flow-0.4.2.dev4}/markdown_flow/core.py +0 -0
- {markdown_flow-0.4.2.dev3 → markdown_flow-0.4.2.dev4}/markdown_flow/enums.py +0 -0
- {markdown_flow-0.4.2.dev3 → markdown_flow-0.4.2.dev4}/markdown_flow/escaping.py +0 -0
- {markdown_flow-0.4.2.dev3 → markdown_flow-0.4.2.dev4}/markdown_flow/exceptions.py +0 -0
- {markdown_flow-0.4.2.dev3 → markdown_flow-0.4.2.dev4}/markdown_flow/formatter/__init__.py +0 -0
- {markdown_flow-0.4.2.dev3 → markdown_flow-0.4.2.dev4}/markdown_flow/formatter/classifier.py +0 -0
- {markdown_flow-0.4.2.dev3 → markdown_flow-0.4.2.dev4}/markdown_flow/formatter/format.py +0 -0
- {markdown_flow-0.4.2.dev3 → markdown_flow-0.4.2.dev4}/markdown_flow/formatter/patterns.py +0 -0
- {markdown_flow-0.4.2.dev3 → markdown_flow-0.4.2.dev4}/markdown_flow/formatter/sanitize.py +0 -0
- {markdown_flow-0.4.2.dev3 → markdown_flow-0.4.2.dev4}/markdown_flow/formatter/stream.py +0 -0
- {markdown_flow-0.4.2.dev3 → markdown_flow-0.4.2.dev4}/markdown_flow/formatter/types.py +0 -0
- {markdown_flow-0.4.2.dev3 → markdown_flow-0.4.2.dev4}/markdown_flow/higher_priority_prompt.md +0 -0
- {markdown_flow-0.4.2.dev3 → markdown_flow-0.4.2.dev4}/markdown_flow/llm.py +0 -0
- {markdown_flow-0.4.2.dev3 → markdown_flow-0.4.2.dev4}/markdown_flow/models.py +0 -0
- {markdown_flow-0.4.2.dev3 → markdown_flow-0.4.2.dev4}/markdown_flow/parser/__init__.py +0 -0
- {markdown_flow-0.4.2.dev3 → markdown_flow-0.4.2.dev4}/markdown_flow/parser/code_fence_utils.py +0 -0
- {markdown_flow-0.4.2.dev3 → markdown_flow-0.4.2.dev4}/markdown_flow/parser/document_blocks.py +0 -0
- {markdown_flow-0.4.2.dev3 → markdown_flow-0.4.2.dev4}/markdown_flow/parser/document_context.py +0 -0
- {markdown_flow-0.4.2.dev3 → markdown_flow-0.4.2.dev4}/markdown_flow/parser/html_comment_utils.py +0 -0
- {markdown_flow-0.4.2.dev3 → markdown_flow-0.4.2.dev4}/markdown_flow/parser/interaction.py +0 -0
- {markdown_flow-0.4.2.dev3 → markdown_flow-0.4.2.dev4}/markdown_flow/parser/json_parser.py +0 -0
- {markdown_flow-0.4.2.dev3 → markdown_flow-0.4.2.dev4}/markdown_flow/parser/preprocessor.py +0 -0
- {markdown_flow-0.4.2.dev3 → markdown_flow-0.4.2.dev4}/markdown_flow/parser/validation.py +0 -0
- {markdown_flow-0.4.2.dev3 → markdown_flow-0.4.2.dev4}/markdown_flow/parser/variable.py +0 -0
- {markdown_flow-0.4.2.dev3 → markdown_flow-0.4.2.dev4}/markdown_flow/providers/__init__.py +0 -0
- {markdown_flow-0.4.2.dev3 → markdown_flow-0.4.2.dev4}/markdown_flow/providers/config.py +0 -0
- {markdown_flow-0.4.2.dev3 → markdown_flow-0.4.2.dev4}/markdown_flow/providers/openai.py +0 -0
- {markdown_flow-0.4.2.dev3 → markdown_flow-0.4.2.dev4}/markdown_flow/system_prompt.md +0 -0
- {markdown_flow-0.4.2.dev3 → markdown_flow-0.4.2.dev4}/markdown_flow/tag_filter.py +0 -0
- {markdown_flow-0.4.2.dev3 → markdown_flow-0.4.2.dev4}/markdown_flow/variable_names.py +0 -0
- {markdown_flow-0.4.2.dev3 → markdown_flow-0.4.2.dev4}/markdown_flow.egg-info/SOURCES.txt +0 -0
- {markdown_flow-0.4.2.dev3 → markdown_flow-0.4.2.dev4}/markdown_flow.egg-info/dependency_links.txt +0 -0
- {markdown_flow-0.4.2.dev3 → markdown_flow-0.4.2.dev4}/markdown_flow.egg-info/top_level.txt +0 -0
- {markdown_flow-0.4.2.dev3 → markdown_flow-0.4.2.dev4}/pyproject.toml +0 -0
- {markdown_flow-0.4.2.dev3 → markdown_flow-0.4.2.dev4}/setup.cfg +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: markdown-flow
|
|
3
|
-
Version: 0.4.2.
|
|
3
|
+
Version: 0.4.2.dev4
|
|
4
4
|
Summary: An agent library designed to parse and process MarkdownFlow documents
|
|
5
5
|
Project-URL: Homepage, https://github.com/ai-shifu/markdown-flow-agent-py
|
|
6
6
|
Project-URL: Bug Tracker, https://github.com/ai-shifu/markdown-flow-agent-py/issues
|
|
@@ -31,6 +31,7 @@ def is_preserved_content_block(content: str) -> bool:
|
|
|
31
31
|
Returns:
|
|
32
32
|
True if content is fully wrapped by preserved markers
|
|
33
33
|
"""
|
|
34
|
+
content, _, _ = _protect_variable_names(content)
|
|
34
35
|
content = content.strip()
|
|
35
36
|
if not content:
|
|
36
37
|
return False
|
|
@@ -104,6 +105,14 @@ def _protect_variable_names(content: str) -> tuple[str, dict[str, str], str]:
|
|
|
104
105
|
return "".join(pieces), markers, prefix
|
|
105
106
|
|
|
106
107
|
|
|
108
|
+
def _restore_variable_names(content: str, markers: dict[str, str], prefix: str) -> str:
|
|
109
|
+
"""Restore protected marker source once after output syntax processing."""
|
|
110
|
+
if not markers:
|
|
111
|
+
return content
|
|
112
|
+
token_pattern = re.compile(re.escape(prefix) + r"[0-9]+\x00")
|
|
113
|
+
return token_pattern.sub(lambda match: markers[match.group()], content)
|
|
114
|
+
|
|
115
|
+
|
|
107
116
|
def process_output_instructions(content: str) -> tuple[str, bool]:
|
|
108
117
|
"""
|
|
109
118
|
Process output instruction markers, converting === and !=== formats to XML format.
|
|
@@ -231,9 +240,7 @@ def process_output_instructions(content: str) -> tuple[str, bool]:
|
|
|
231
240
|
|
|
232
241
|
# Assemble final content
|
|
233
242
|
processed_content = "\n".join(result_lines)
|
|
234
|
-
|
|
235
|
-
token_pattern = re.compile(re.escape(variable_prefix) + r"[0-9]+\x00")
|
|
236
|
-
processed_content = token_pattern.sub(lambda match: variable_markers[match.group()], processed_content)
|
|
243
|
+
processed_content = _restore_variable_names(processed_content, variable_markers, variable_prefix)
|
|
237
244
|
|
|
238
245
|
# Return both processed content and whether it contains preserved content
|
|
239
246
|
return processed_content, has_output_instruction
|
|
@@ -251,6 +258,7 @@ def extract_preserved_content(content: str) -> str:
|
|
|
251
258
|
Returns:
|
|
252
259
|
Actual content with === and !=== markers removed
|
|
253
260
|
"""
|
|
261
|
+
content, variable_markers, variable_prefix = _protect_variable_names(content)
|
|
254
262
|
content = content.strip()
|
|
255
263
|
if not content:
|
|
256
264
|
return ""
|
|
@@ -275,4 +283,4 @@ def extract_preserved_content(content: str) -> str:
|
|
|
275
283
|
# Normal content line, keep
|
|
276
284
|
result_lines.append(line)
|
|
277
285
|
|
|
278
|
-
return "\n".join(result_lines)
|
|
286
|
+
return _restore_variable_names("\n".join(result_lines), variable_markers, variable_prefix)
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: markdown-flow
|
|
3
|
-
Version: 0.4.2.
|
|
3
|
+
Version: 0.4.2.dev4
|
|
4
4
|
Summary: An agent library designed to parse and process MarkdownFlow documents
|
|
5
5
|
Project-URL: Homepage, https://github.com/ai-shifu/markdown-flow-agent-py
|
|
6
6
|
Project-URL: Bug Tracker, https://github.com/ai-shifu/markdown-flow-agent-py/issues
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{markdown_flow-0.4.2.dev3 → markdown_flow-0.4.2.dev4}/markdown_flow/constants_system_prompt.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{markdown_flow-0.4.2.dev3 → markdown_flow-0.4.2.dev4}/markdown_flow/higher_priority_prompt.md
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{markdown_flow-0.4.2.dev3 → markdown_flow-0.4.2.dev4}/markdown_flow/parser/code_fence_utils.py
RENAMED
|
File without changes
|
{markdown_flow-0.4.2.dev3 → markdown_flow-0.4.2.dev4}/markdown_flow/parser/document_blocks.py
RENAMED
|
File without changes
|
{markdown_flow-0.4.2.dev3 → markdown_flow-0.4.2.dev4}/markdown_flow/parser/document_context.py
RENAMED
|
File without changes
|
{markdown_flow-0.4.2.dev3 → markdown_flow-0.4.2.dev4}/markdown_flow/parser/html_comment_utils.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{markdown_flow-0.4.2.dev3 → markdown_flow-0.4.2.dev4}/markdown_flow.egg-info/dependency_links.txt
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|