markdown-flow 0.3.2.dev1__py3-none-any.whl → 0.3.3__py3-none-any.whl
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/__init__.py +1 -1
- markdown_flow/escaping.py +22 -2
- {markdown_flow-0.3.2.dev1.dist-info → markdown_flow-0.3.3.dist-info}/METADATA +1 -1
- {markdown_flow-0.3.2.dev1.dist-info → markdown_flow-0.3.3.dist-info}/RECORD +7 -7
- {markdown_flow-0.3.2.dev1.dist-info → markdown_flow-0.3.3.dist-info}/WHEEL +0 -0
- {markdown_flow-0.3.2.dev1.dist-info → markdown_flow-0.3.3.dist-info}/licenses/LICENSE +0 -0
- {markdown_flow-0.3.2.dev1.dist-info → markdown_flow-0.3.3.dist-info}/top_level.txt +0 -0
markdown_flow/__init__.py
CHANGED
markdown_flow/escaping.py
CHANGED
|
@@ -30,14 +30,34 @@ def is_escape(text: str, index: int) -> bool:
|
|
|
30
30
|
def escape_interaction_text(text: str) -> str:
|
|
31
31
|
"""Make `text` safe to write inside `?[...]`, keeping every character it has.
|
|
32
32
|
|
|
33
|
-
|
|
33
|
+
A dot is escaped only inside a run of three or more, because only `...` is a delimiter and a
|
|
34
|
+
single period ends most sentences: escaping every one turns `Yes, I agree.` into
|
|
35
|
+
`Yes, I agree\\.` in everything that stores or shows the raw interaction. Two dots cannot
|
|
36
|
+
become three on their own, and the run is escaped whole so it cannot be read as one.
|
|
37
|
+
|
|
38
|
+
Bars, brackets and slashes are escaped wherever they appear. They are rare in option text,
|
|
39
|
+
and escaping them unconditionally removes the need to reason about what a neighbouring
|
|
40
|
+
character might combine with once the option is written next to a separator.
|
|
41
|
+
|
|
42
|
+
Escaping the delimiters rather than the backslashes as well is what keeps existing content
|
|
34
43
|
readable: a script that writes `$\\pi$` in an option still writes `$\\pi$` afterwards.
|
|
35
44
|
"""
|
|
36
45
|
out: list[str] = []
|
|
37
|
-
|
|
46
|
+
index = 0
|
|
47
|
+
while index < len(text):
|
|
48
|
+
char = text[index]
|
|
49
|
+
if char == ".":
|
|
50
|
+
run = len(text) - index - len(text[index:].lstrip("."))
|
|
51
|
+
if run >= 3:
|
|
52
|
+
out.append("\\." * run)
|
|
53
|
+
else:
|
|
54
|
+
out.append("." * run)
|
|
55
|
+
index += run
|
|
56
|
+
continue
|
|
38
57
|
if char in ESCAPABLE:
|
|
39
58
|
out.append("\\")
|
|
40
59
|
out.append(char)
|
|
60
|
+
index += 1
|
|
41
61
|
return "".join(out)
|
|
42
62
|
|
|
43
63
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: markdown-flow
|
|
3
|
-
Version: 0.3.
|
|
3
|
+
Version: 0.3.3
|
|
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
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
markdown_flow/__init__.py,sha256
|
|
1
|
+
markdown_flow/__init__.py,sha256=-6ErwuasY_bthvY13FyjyVFLxLlo1cB74jekMFuzRyY,3520
|
|
2
2
|
markdown_flow/constants.py,sha256=oHfTFtNoIjgRNFXwhVRqcbo5o-DY0KtVxHJLDBfcX7c,14542
|
|
3
3
|
markdown_flow/constants_system_prompt.py,sha256=hzw6Ajm_lebqnXQmQMQFqJDmPCj6wugSPNs24lckn8c,617
|
|
4
4
|
markdown_flow/core.py,sha256=7sC4kZBHWndG6zh4DM2SqYAYA7c2Y7WcgwrtmPqvYFg,70443
|
|
5
5
|
markdown_flow/enums.py,sha256=Wr41zt0Ce5b3fyLtOTE2erEVp1n92g9OVaBF_BZg_l8,820
|
|
6
|
-
markdown_flow/escaping.py,sha256=
|
|
6
|
+
markdown_flow/escaping.py,sha256=4THY3R5tcKKcah9X7mSscSiUVl3l0-92J6nOWfibHto,6334
|
|
7
7
|
markdown_flow/exceptions.py,sha256=9sUZ-Jd3CPLdSRqG8Pw7eMm7cv_S3VZM6jmjUU8OhIc,976
|
|
8
8
|
markdown_flow/higher_priority_prompt.md,sha256=ms6HvMK4UZYr3cpUQRyJxUkMajSJ_gnmzgeJRVjTlwk,484
|
|
9
9
|
markdown_flow/llm.py,sha256=XH27meLtwcYigAPTJaX6fQYYup5HEb7MFZKAFsKV0Qg,2888
|
|
@@ -29,8 +29,8 @@ markdown_flow/parser/variable.py,sha256=3UwDSacqlXi7zfRm2ZA5D7h8fFMIL68iV6uFNqu-
|
|
|
29
29
|
markdown_flow/providers/__init__.py,sha256=QMr8H9gxoLr6pWXoAb11oZX_She6KWPxnRips537nQ4,319
|
|
30
30
|
markdown_flow/providers/config.py,sha256=NT6Sy_8j7Yy2zYwjEQ1XsG3NC_L_ABeQg2DJnct5QsE,3356
|
|
31
31
|
markdown_flow/providers/openai.py,sha256=09w1ruYzVOavtP7uE-osfEdAr97Fyjkr8gaGLqkgUrg,12434
|
|
32
|
-
markdown_flow-0.3.
|
|
33
|
-
markdown_flow-0.3.
|
|
34
|
-
markdown_flow-0.3.
|
|
35
|
-
markdown_flow-0.3.
|
|
36
|
-
markdown_flow-0.3.
|
|
32
|
+
markdown_flow-0.3.3.dist-info/licenses/LICENSE,sha256=qz3BziejhHPd1xa5eVtYEU5Qp6L2pn4otuj194uGxmc,1069
|
|
33
|
+
markdown_flow-0.3.3.dist-info/METADATA,sha256=mvKkiq2PbrPbkFtcujvb8GJxOOhhXW3RuswY-ybl8Hw,22376
|
|
34
|
+
markdown_flow-0.3.3.dist-info/WHEEL,sha256=YVMoNqKzERt-wjUZwJ33xBGAwnFl-4cqbYkTtWa4itE,91
|
|
35
|
+
markdown_flow-0.3.3.dist-info/top_level.txt,sha256=DpigGvQuIt2L0TTLnDU5sylhiTGiZS7MmAMa2hi-AJs,14
|
|
36
|
+
markdown_flow-0.3.3.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|