streamdown 0.34.0__tar.gz → 0.35.0__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.
- {streamdown-0.34.0 → streamdown-0.35.0}/PKG-INFO +2 -2
- {streamdown-0.34.0 → streamdown-0.35.0}/README.md +1 -1
- {streamdown-0.34.0 → streamdown-0.35.0}/pyproject.toml +1 -1
- {streamdown-0.34.0 → streamdown-0.35.0}/streamdown/sd.py +30 -13
- {streamdown-0.34.0 → streamdown-0.35.0}/.aider.chat.history.md +0 -0
- {streamdown-0.34.0 → streamdown-0.35.0}/.aider.input.history +0 -0
- {streamdown-0.34.0 → streamdown-0.35.0}/.aider.tags.cache.v4/cache.db +0 -0
- {streamdown-0.34.0 → streamdown-0.35.0}/.envrc +0 -0
- {streamdown-0.34.0 → streamdown-0.35.0}/.gitignore +0 -0
- {streamdown-0.34.0 → streamdown-0.35.0}/.vimrc +0 -0
- {streamdown-0.34.0 → streamdown-0.35.0}/24-bit-color.sh +0 -0
- {streamdown-0.34.0 → streamdown-0.35.0}/LICENSE.MIT +0 -0
- {streamdown-0.34.0 → streamdown-0.35.0}/assets/logo.png +0 -0
- {streamdown-0.34.0 → streamdown-0.35.0}/assets/logo.svg +0 -0
- {streamdown-0.34.0 → streamdown-0.35.0}/configurable.png +0 -0
- {streamdown-0.34.0 → streamdown-0.35.0}/copyable.png +0 -0
- {streamdown-0.34.0 → streamdown-0.35.0}/dunder.png +0 -0
- {streamdown-0.34.0 → streamdown-0.35.0}/error.txt +0 -0
- {streamdown-0.34.0 → streamdown-0.35.0}/math +0 -0
- {streamdown-0.34.0 → streamdown-0.35.0}/newdir/file_0.py +0 -0
- {streamdown-0.34.0 → streamdown-0.35.0}/newdir/file_1.rb +0 -0
- {streamdown-0.34.0 → streamdown-0.35.0}/newdir/file_2.jl +0 -0
- {streamdown-0.34.0 → streamdown-0.35.0}/passthrough.py +0 -0
- {streamdown-0.34.0 → streamdown-0.35.0}/pygments.util +0 -0
- {streamdown-0.34.0 → streamdown-0.35.0}/python-go.png +0 -0
- {streamdown-0.34.0 → streamdown-0.35.0}/re +0 -0
- {streamdown-0.34.0 → streamdown-0.35.0}/requirements.txt +0 -0
- {streamdown-0.34.0 → streamdown-0.35.0}/shutil +0 -0
- {streamdown-0.34.0 → streamdown-0.35.0}/somelog.txt +0 -0
- {streamdown-0.34.0 → streamdown-0.35.0}/ss-new.py +0 -0
- {streamdown-0.34.0 → streamdown-0.35.0}/ss.py +0 -0
- {streamdown-0.34.0 → streamdown-0.35.0}/streamdown/__init__.py +0 -0
- {streamdown-0.34.0 → streamdown-0.35.0}/streamdown/plugins/README.md +0 -0
- {streamdown-0.34.0 → streamdown-0.35.0}/streamdown/plugins/latex.py +0 -0
- {streamdown-0.34.0 → streamdown-0.35.0}/streamdown/qwen3.md +0 -0
- {streamdown-0.34.0 → streamdown-0.35.0}/streamdown/ss +0 -0
- {streamdown-0.34.0 → streamdown-0.35.0}/streamdown/ss1 +0 -0
- {streamdown-0.34.0 → streamdown-0.35.0}/streamdown/test.txt +0 -0
- {streamdown-0.34.0 → streamdown-0.35.0}/subprocess +0 -0
- {streamdown-0.34.0 → streamdown-0.35.0}/table.png +0 -0
- {streamdown-0.34.0 → streamdown-0.35.0}/temp.py +0 -0
- {streamdown-0.34.0 → streamdown-0.35.0}/test.py +0 -0
- {streamdown-0.34.0 → streamdown-0.35.0}/tester.py +0 -0
- {streamdown-0.34.0 → streamdown-0.35.0}/tests/README.md +0 -0
- {streamdown-0.34.0 → streamdown-0.35.0}/tests/backtick-with-post-spaces.md +0 -0
- {streamdown-0.34.0 → streamdown-0.35.0}/tests/bg-messed-up.md +0 -0
- {streamdown-0.34.0 → streamdown-0.35.0}/tests/blankie.md +0 -0
- {streamdown-0.34.0 → streamdown-0.35.0}/tests/block.md +0 -0
- {streamdown-0.34.0 → streamdown-0.35.0}/tests/bold_reset_with_link.md +0 -0
- {streamdown-0.34.0 → streamdown-0.35.0}/tests/broken-code.md +0 -0
- {streamdown-0.34.0 → streamdown-0.35.0}/tests/broken-example.md +0 -0
- {streamdown-0.34.0 → streamdown-0.35.0}/tests/chinese.md +0 -0
- {streamdown-0.34.0 → streamdown-0.35.0}/tests/chunk-buffer.sh +0 -0
- {streamdown-0.34.0 → streamdown-0.35.0}/tests/cjj.mv +0 -0
- {streamdown-0.34.0 → streamdown-0.35.0}/tests/cjk-comment.md +0 -0
- {streamdown-0.34.0 → streamdown-0.35.0}/tests/cjk-table.md +0 -0
- {streamdown-0.34.0 → streamdown-0.35.0}/tests/cjk-wrap.md +0 -0
- {streamdown-0.34.0 → streamdown-0.35.0}/tests/code.md +0 -0
- {streamdown-0.34.0 → streamdown-0.35.0}/tests/dimcheck.md +0 -0
- {streamdown-0.34.0 → streamdown-0.35.0}/tests/example.md +0 -0
- {streamdown-0.34.0 → streamdown-0.35.0}/tests/fizzbuzz.md +0 -0
- {streamdown-0.34.0 → streamdown-0.35.0}/tests/fucking-garbage.md +0 -0
- {streamdown-0.34.0 → streamdown-0.35.0}/tests/inline.md +0 -0
- {streamdown-0.34.0 → streamdown-0.35.0}/tests/jimmy_webb.md +0 -0
- {streamdown-0.34.0 → streamdown-0.35.0}/tests/line-buffer.sh +0 -0
- {streamdown-0.34.0 → streamdown-0.35.0}/tests/line-wrap.md +0 -0
- {streamdown-0.34.0 → streamdown-0.35.0}/tests/links.md +0 -0
- {streamdown-0.34.0 → streamdown-0.35.0}/tests/managerie.md +0 -0
- {streamdown-0.34.0 → streamdown-0.35.0}/tests/mandlebrot.md +0 -0
- {streamdown-0.34.0 → streamdown-0.35.0}/tests/markdown.md +0 -0
- {streamdown-0.34.0 → streamdown-0.35.0}/tests/nested-example.md +0 -0
- {streamdown-0.34.0 → streamdown-0.35.0}/tests/no-newline.md +0 -0
- {streamdown-0.34.0 → streamdown-0.35.0}/tests/oneline-equal.md +0 -0
- {streamdown-0.34.0 → streamdown-0.35.0}/tests/outline.md +0 -0
- {streamdown-0.34.0 → streamdown-0.35.0}/tests/output.txt +0 -0
- {streamdown-0.34.0 → streamdown-0.35.0}/tests/pvgo_512.jpg +0 -0
- {streamdown-0.34.0 → streamdown-0.35.0}/tests/pythonvgo.md +0 -0
- {streamdown-0.34.0 → streamdown-0.35.0}/tests/qwen3.md +0 -0
- {streamdown-0.34.0 → streamdown-0.35.0}/tests/rerun.zsh +0 -0
- {streamdown-0.34.0 → streamdown-0.35.0}/tests/run-tests.sh +0 -0
- {streamdown-0.34.0 → streamdown-0.35.0}/tests/slash.md +0 -0
- {streamdown-0.34.0 → streamdown-0.35.0}/tests/strip-chunks.sh +0 -0
- {streamdown-0.34.0 → streamdown-0.35.0}/tests/table-break.md +0 -0
- {streamdown-0.34.0 → streamdown-0.35.0}/tests/table_test.md +0 -0
- {streamdown-0.34.0 → streamdown-0.35.0}/tests/test.md +0 -0
- {streamdown-0.34.0 → streamdown-0.35.0}/tests/test_input.md +0 -0
- {streamdown-0.34.0 → streamdown-0.35.0}/tests/uline.md +0 -0
- {streamdown-0.34.0 → streamdown-0.35.0}/tests/wm.md +0 -0
- {streamdown-0.34.0 → streamdown-0.35.0}/tools/deploy.sh +0 -0
- {streamdown-0.34.0 → streamdown-0.35.0}/tty +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: streamdown
|
|
3
|
-
Version: 0.
|
|
3
|
+
Version: 0.35.0
|
|
4
4
|
Summary: A streaming markdown renderer for modern terminals with syntax highlighting
|
|
5
5
|
Project-URL: Homepage, https://github.com/day50-dev/Streamdown
|
|
6
6
|
Project-URL: Bug Tracker, https://github.com/day50-dev/Streamdown/issues
|
|
@@ -70,7 +70,7 @@ The optional `Clipboard` feature puts the final codeblock into your clipboard. S
|
|
|
70
70
|
[links.webm](https://github.com/user-attachments/assets/a5f71791-7c58-4183-ad3b-309f470c08a3)
|
|
71
71
|
|
|
72
72
|
### As well as everything else...
|
|
73
|
-
Here's the `Savebrace` feature with `
|
|
73
|
+
Here's the `Savebrace` feature with [`sidechat` and `sc-picker`](https://github.com/day50-dev/sidechat). You can have an ongoing conversation in tmux with your terminal session. Then use popups and fzf to insert command or coding blocks all with a keystroke.
|
|
74
74
|
|
|
75
75
|
This allows you to interactively debug in a way that the agent doesn't just wander off doing silly things.
|
|
76
76
|
|
|
@@ -40,7 +40,7 @@ The optional `Clipboard` feature puts the final codeblock into your clipboard. S
|
|
|
40
40
|
[links.webm](https://github.com/user-attachments/assets/a5f71791-7c58-4183-ad3b-309f470c08a3)
|
|
41
41
|
|
|
42
42
|
### As well as everything else...
|
|
43
|
-
Here's the `Savebrace` feature with `
|
|
43
|
+
Here's the `Savebrace` feature with [`sidechat` and `sc-picker`](https://github.com/day50-dev/sidechat). You can have an ongoing conversation in tmux with your terminal session. Then use popups and fzf to insert command or coding blocks all with a keystroke.
|
|
44
44
|
|
|
45
45
|
This allows you to interactively debug in a way that the agent doesn't just wander off doing silly things.
|
|
46
46
|
|
|
@@ -57,6 +57,8 @@ Clipboard = true
|
|
|
57
57
|
Logging = false
|
|
58
58
|
Timeout = 0.1
|
|
59
59
|
Savebrace = true
|
|
60
|
+
Images = true
|
|
61
|
+
Links = true
|
|
60
62
|
|
|
61
63
|
[style]
|
|
62
64
|
Margin = 2
|
|
@@ -165,6 +167,7 @@ class ParseState:
|
|
|
165
167
|
self.is_pty = False
|
|
166
168
|
self.is_exec = False
|
|
167
169
|
self.maybe_prompt = False
|
|
170
|
+
self.prompt_regex = None
|
|
168
171
|
self.emit_flag = None
|
|
169
172
|
self.scrape = None
|
|
170
173
|
self.scrape_ix = 0
|
|
@@ -204,6 +207,7 @@ class ParseState:
|
|
|
204
207
|
self.in_underline = False
|
|
205
208
|
self.in_strikeout = False
|
|
206
209
|
self.block_depth = 0
|
|
210
|
+
self.block_type = None
|
|
207
211
|
|
|
208
212
|
self.exec_sub = None
|
|
209
213
|
self.exec_master = None
|
|
@@ -496,8 +500,12 @@ def line_format(line):
|
|
|
496
500
|
url = match.group(2)
|
|
497
501
|
return f'{LINK[0]}{url}\033\\{Style.Link}{description}{UNDERLINE[1]}{LINK[1]}{FGRESET}'
|
|
498
502
|
|
|
499
|
-
|
|
500
|
-
|
|
503
|
+
if state.Images:
|
|
504
|
+
line = re.sub(r"\!\[([^\]]*)\]\(([^\)]+)\)", process_images, line)
|
|
505
|
+
|
|
506
|
+
if state.Links:
|
|
507
|
+
line = re.sub(r"\[([^\]]+)\]\(([^\)]+)\)", process_links, line)
|
|
508
|
+
|
|
501
509
|
line = re.sub(r"\[\^(\d+)\]:?", footnotes, line)
|
|
502
510
|
|
|
503
511
|
tokenList = re.finditer(r"((~~|\*\*_|_\*\*|\*{1,3}|_{1,3}|`+)|[^~_*`]+)", line)
|
|
@@ -630,8 +638,7 @@ def parse(stream):
|
|
|
630
638
|
line = state.buffer.decode('utf-8').replace('\t',' ')
|
|
631
639
|
state.has_newline = line.endswith('\n')
|
|
632
640
|
|
|
633
|
-
|
|
634
|
-
state.maybe_prompt = not state.has_newline and state.current()['none'] and re.match(r'^.*>\s+$', visible(line))
|
|
641
|
+
state.maybe_prompt = not state.has_newline and state.current()['none'] and re.match(state.prompt_regex, visible(line))
|
|
635
642
|
|
|
636
643
|
# let's wait for a newline
|
|
637
644
|
if state.maybe_prompt:
|
|
@@ -658,19 +665,27 @@ def parse(stream):
|
|
|
658
665
|
"""
|
|
659
666
|
|
|
660
667
|
# running this here avoids stray |
|
|
661
|
-
|
|
668
|
+
# So kimi doesn't newline after the <think> token and it uses some unicode triangle?. They'll
|
|
669
|
+
# newline at the end of it, but not the beginning.
|
|
670
|
+
block_match = re.match(r"^\s*((>\s*)+|[◁<].?think[>▷])(.*)", line)
|
|
662
671
|
if not state.in_code and block_match:
|
|
663
|
-
|
|
672
|
+
# wtf is this you might ask! Not all thinking models use < and > ...
|
|
673
|
+
# because why make life easy?
|
|
674
|
+
if block_match.group(1)[1:7] == '/think':
|
|
675
|
+
line = ''
|
|
664
676
|
state.block_depth = 0
|
|
665
677
|
yield RESET
|
|
666
|
-
elif block_match.group(1) == '
|
|
678
|
+
elif block_match.group(1)[1:6] == 'think':
|
|
679
|
+
line = block_match.group(3)
|
|
667
680
|
state.block_depth = 1
|
|
681
|
+
state.block_type = 'think'
|
|
668
682
|
else:
|
|
669
|
-
state.block_depth = block_match.group(
|
|
683
|
+
state.block_depth = block_match.group(1).count('>')
|
|
684
|
+
state.block_type = '>'
|
|
670
685
|
# we also need to consume those tokens
|
|
671
|
-
line = line[len(block_match.group(
|
|
686
|
+
line = line[len(block_match.group(1)):]
|
|
672
687
|
else:
|
|
673
|
-
if state.block_depth > 0:
|
|
688
|
+
if state.block_type == '>' and state.block_depth > 0:
|
|
674
689
|
yield FGRESET
|
|
675
690
|
state.block_depth = 0
|
|
676
691
|
|
|
@@ -839,7 +854,7 @@ def parse(stream):
|
|
|
839
854
|
while parts[-1] in [FGRESET, FORMATRESET]:
|
|
840
855
|
parts.pop()
|
|
841
856
|
|
|
842
|
-
tline_len = visible_length(tline)
|
|
857
|
+
tline_len = visible_length(tline.rstrip('\r\n'))
|
|
843
858
|
|
|
844
859
|
# now we find the new stuff:
|
|
845
860
|
ttl = 0
|
|
@@ -850,7 +865,7 @@ def parse(stream):
|
|
|
850
865
|
|
|
851
866
|
ttl += len(idx) if idx[0] != '\x1b' else 0
|
|
852
867
|
|
|
853
|
-
if ttl >
|
|
868
|
+
if ttl > tline_len:
|
|
854
869
|
break
|
|
855
870
|
|
|
856
871
|
|
|
@@ -1109,6 +1124,7 @@ def main():
|
|
|
1109
1124
|
parser.add_argument("-c", "--config", default=None, help="Use a custom config override")
|
|
1110
1125
|
parser.add_argument("-w", "--width", default="0", help="Set the width WIDTH")
|
|
1111
1126
|
parser.add_argument("-e", "--exec", help="Wrap a program EXEC for more 'proper' i/o handling")
|
|
1127
|
+
parser.add_argument("-p", "--prompt", default="^.*>\\s+$", help="A PCRE regex prompt to detect (default: %(default)s)")
|
|
1112
1128
|
parser.add_argument("-s", "--scrape", help="Scrape code snippets to a directory SCRAPE")
|
|
1113
1129
|
parser.add_argument("-v", "--version", action="store_true", help="Show version information")
|
|
1114
1130
|
args = parser.parse_args()
|
|
@@ -1142,7 +1158,7 @@ def main():
|
|
|
1142
1158
|
setattr(Style, color, apply_multipliers(style, color, H, S, V))
|
|
1143
1159
|
for attr in ['PrettyPad', 'PrettyBroken', 'Margin', 'ListIndent', 'Syntax']:
|
|
1144
1160
|
setattr(Style, attr, style.get(attr))
|
|
1145
|
-
for attr in ['CodeSpaces', 'Clipboard', 'Logging', 'Timeout', 'Savebrace']:
|
|
1161
|
+
for attr in ['Links', 'Images', 'CodeSpaces', 'Clipboard', 'Logging', 'Timeout', 'Savebrace']:
|
|
1146
1162
|
setattr(state, attr, features.get(attr))
|
|
1147
1163
|
|
|
1148
1164
|
|
|
@@ -1152,6 +1168,7 @@ def main():
|
|
|
1152
1168
|
|
|
1153
1169
|
Style.MarginSpaces = " " * Style.Margin
|
|
1154
1170
|
state.WidthArg = int(args.width) or style.get("Width") or 0
|
|
1171
|
+
state.prompt_regex = re.compile(args.prompt)
|
|
1155
1172
|
Style.Blockquote = f"{FG}{Style.Grey}│ "
|
|
1156
1173
|
width_calc()
|
|
1157
1174
|
|
|
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
|
|
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
|
|
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
|
|
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
|
|
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
|
|
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
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|