deepparallel 0.4.0__tar.gz → 0.4.1__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.
- {deepparallel-0.4.0 → deepparallel-0.4.1}/PKG-INFO +1 -1
- {deepparallel-0.4.0 → deepparallel-0.4.1}/deepparallel/__init__.py +1 -1
- {deepparallel-0.4.0 → deepparallel-0.4.1}/deepparallel/renderer.py +55 -5
- {deepparallel-0.4.0 → deepparallel-0.4.1}/deepparallel.egg-info/PKG-INFO +1 -1
- {deepparallel-0.4.0 → deepparallel-0.4.1}/pyproject.toml +1 -1
- {deepparallel-0.4.0 → deepparallel-0.4.1}/tests/test_renderer.py +32 -10
- {deepparallel-0.4.0 → deepparallel-0.4.1}/README.md +0 -0
- {deepparallel-0.4.0 → deepparallel-0.4.1}/deepparallel/agent.py +0 -0
- {deepparallel-0.4.0 → deepparallel-0.4.1}/deepparallel/backend.py +0 -0
- {deepparallel-0.4.0 → deepparallel-0.4.1}/deepparallel/branding.py +0 -0
- {deepparallel-0.4.0 → deepparallel-0.4.1}/deepparallel/cli.py +0 -0
- {deepparallel-0.4.0 → deepparallel-0.4.1}/deepparallel/config.py +0 -0
- {deepparallel-0.4.0 → deepparallel-0.4.1}/deepparallel/fusion.py +0 -0
- {deepparallel-0.4.0 → deepparallel-0.4.1}/deepparallel/licensing.py +0 -0
- {deepparallel-0.4.0 → deepparallel-0.4.1}/deepparallel/registry.json +0 -0
- {deepparallel-0.4.0 → deepparallel-0.4.1}/deepparallel/research/__init__.py +0 -0
- {deepparallel-0.4.0 → deepparallel-0.4.1}/deepparallel/research/conduit.py +0 -0
- {deepparallel-0.4.0 → deepparallel-0.4.1}/deepparallel/supply_chain.py +0 -0
- {deepparallel-0.4.0 → deepparallel-0.4.1}/deepparallel/system_prompt.txt +0 -0
- {deepparallel-0.4.0 → deepparallel-0.4.1}/deepparallel/tools/__init__.py +0 -0
- {deepparallel-0.4.0 → deepparallel-0.4.1}/deepparallel/tools/codeast.py +0 -0
- {deepparallel-0.4.0 → deepparallel-0.4.1}/deepparallel/tools/edit.py +0 -0
- {deepparallel-0.4.0 → deepparallel-0.4.1}/deepparallel/tools/files.py +0 -0
- {deepparallel-0.4.0 → deepparallel-0.4.1}/deepparallel/tools/registry.py +0 -0
- {deepparallel-0.4.0 → deepparallel-0.4.1}/deepparallel/tools/sandbox.py +0 -0
- {deepparallel-0.4.0 → deepparallel-0.4.1}/deepparallel/tools/search.py +0 -0
- {deepparallel-0.4.0 → deepparallel-0.4.1}/deepparallel/tools/shell.py +0 -0
- {deepparallel-0.4.0 → deepparallel-0.4.1}/deepparallel/tools/vision.py +0 -0
- {deepparallel-0.4.0 → deepparallel-0.4.1}/deepparallel/tools/web.py +0 -0
- {deepparallel-0.4.0 → deepparallel-0.4.1}/deepparallel.egg-info/SOURCES.txt +0 -0
- {deepparallel-0.4.0 → deepparallel-0.4.1}/deepparallel.egg-info/dependency_links.txt +0 -0
- {deepparallel-0.4.0 → deepparallel-0.4.1}/deepparallel.egg-info/entry_points.txt +0 -0
- {deepparallel-0.4.0 → deepparallel-0.4.1}/deepparallel.egg-info/requires.txt +0 -0
- {deepparallel-0.4.0 → deepparallel-0.4.1}/deepparallel.egg-info/top_level.txt +0 -0
- {deepparallel-0.4.0 → deepparallel-0.4.1}/setup.cfg +0 -0
- {deepparallel-0.4.0 → deepparallel-0.4.1}/tests/test_agent.py +0 -0
- {deepparallel-0.4.0 → deepparallel-0.4.1}/tests/test_backend.py +0 -0
- {deepparallel-0.4.0 → deepparallel-0.4.1}/tests/test_backend_chat.py +0 -0
- {deepparallel-0.4.0 → deepparallel-0.4.1}/tests/test_backend_stream.py +0 -0
- {deepparallel-0.4.0 → deepparallel-0.4.1}/tests/test_branding.py +0 -0
- {deepparallel-0.4.0 → deepparallel-0.4.1}/tests/test_cli.py +0 -0
- {deepparallel-0.4.0 → deepparallel-0.4.1}/tests/test_config.py +0 -0
- {deepparallel-0.4.0 → deepparallel-0.4.1}/tests/test_fusion.py +0 -0
- {deepparallel-0.4.0 → deepparallel-0.4.1}/tests/test_issuer_signer.py +0 -0
- {deepparallel-0.4.0 → deepparallel-0.4.1}/tests/test_licensing.py +0 -0
- {deepparallel-0.4.0 → deepparallel-0.4.1}/tests/test_research.py +0 -0
- {deepparallel-0.4.0 → deepparallel-0.4.1}/tests/test_supply_chain.py +0 -0
- {deepparallel-0.4.0 → deepparallel-0.4.1}/tests/test_tool_registry.py +0 -0
- {deepparallel-0.4.0 → deepparallel-0.4.1}/tests/test_tools_codeast.py +0 -0
- {deepparallel-0.4.0 → deepparallel-0.4.1}/tests/test_tools_edit.py +0 -0
- {deepparallel-0.4.0 → deepparallel-0.4.1}/tests/test_tools_files.py +0 -0
- {deepparallel-0.4.0 → deepparallel-0.4.1}/tests/test_tools_sandbox.py +0 -0
- {deepparallel-0.4.0 → deepparallel-0.4.1}/tests/test_tools_search.py +0 -0
- {deepparallel-0.4.0 → deepparallel-0.4.1}/tests/test_tools_shell.py +0 -0
- {deepparallel-0.4.0 → deepparallel-0.4.1}/tests/test_tools_vision.py +0 -0
- {deepparallel-0.4.0 → deepparallel-0.4.1}/tests/test_tools_web.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: deepparallel
|
|
3
|
-
Version: 0.4.
|
|
3
|
+
Version: 0.4.1
|
|
4
4
|
Summary: DeepParallel - a multi-model agentic coding CLI with cross-model Guardian review, served via Crowe Logic.
|
|
5
5
|
Author-email: Michael Crowe <michael@crowelogic.com>
|
|
6
6
|
License: Apache-2.0
|
|
@@ -25,6 +25,15 @@ from deepparallel import branding
|
|
|
25
25
|
_REVEAL_SECONDS = 0.04 # per-line delay for the animated intro (tests set 0)
|
|
26
26
|
|
|
27
27
|
|
|
28
|
+
def _balance_fences(text: str) -> str:
|
|
29
|
+
"""Close a dangling ``` while streaming so a half-arrived code block renders
|
|
30
|
+
as code instead of leaking its fence as literal text. The closing fence is
|
|
31
|
+
cosmetic for the in-progress frame; the final frame has the real one."""
|
|
32
|
+
if text.count("```") % 2 == 1:
|
|
33
|
+
return text + "\n```"
|
|
34
|
+
return text
|
|
35
|
+
|
|
36
|
+
|
|
28
37
|
class Renderer(ABC):
|
|
29
38
|
@abstractmethod
|
|
30
39
|
def welcome(
|
|
@@ -146,10 +155,18 @@ class RichRenderer(Renderer):
|
|
|
146
155
|
self._console.print(branding.build_transcript_markdown(self._console, text))
|
|
147
156
|
|
|
148
157
|
def answer_stream(self, chunks: Iterable[str]) -> str:
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
158
|
+
"""Stream the answer. On a real terminal, render Markdown live in a panel
|
|
159
|
+
that grows as tokens arrive (headings, code, lists format in place); the
|
|
160
|
+
final frame is the same panel `answer()` would print, so there is no
|
|
161
|
+
double render. On a pipe / non-tty, fall back to raw inline streaming."""
|
|
162
|
+
if self._console.is_terminal:
|
|
163
|
+
return self._stream_live_markdown(chunks)
|
|
164
|
+
return self._stream_inline(chunks)
|
|
165
|
+
|
|
166
|
+
def _stream_inline(self, chunks: Iterable[str]) -> str:
|
|
167
|
+
# Raw token streaming for pipes / non-tty: no Live, never ghosts. The
|
|
168
|
+
# marker is printed only on the first VISIBLE character, so empty /
|
|
169
|
+
# whitespace-leading (tool-only) turns render no stray marker.
|
|
153
170
|
parts: list[str] = []
|
|
154
171
|
started = False
|
|
155
172
|
for c in chunks:
|
|
@@ -158,7 +175,7 @@ class RichRenderer(Renderer):
|
|
|
158
175
|
self._console.print(c, end="", soft_wrap=True, highlight=False, markup=False)
|
|
159
176
|
continue
|
|
160
177
|
if not "".join(parts).strip():
|
|
161
|
-
continue
|
|
178
|
+
continue
|
|
162
179
|
started = True
|
|
163
180
|
self._console.print(
|
|
164
181
|
f"[{branding.DP_ACCENT}]{branding.MARK}[/] ", end="", highlight=False
|
|
@@ -168,6 +185,39 @@ class RichRenderer(Renderer):
|
|
|
168
185
|
self._console.print()
|
|
169
186
|
return "".join(parts)
|
|
170
187
|
|
|
188
|
+
def _stream_live_markdown(self, chunks: Iterable[str]) -> str:
|
|
189
|
+
from rich.live import Live
|
|
190
|
+
|
|
191
|
+
parts: list[str] = []
|
|
192
|
+
started = False
|
|
193
|
+
last_draw = 0.0
|
|
194
|
+
live = Live(
|
|
195
|
+
console=self._console,
|
|
196
|
+
auto_refresh=False, # we drive refreshes; deterministic, no bg thread
|
|
197
|
+
vertical_overflow="visible", # let answers taller than the screen scroll
|
|
198
|
+
)
|
|
199
|
+
try:
|
|
200
|
+
for c in chunks:
|
|
201
|
+
parts.append(c)
|
|
202
|
+
if not started:
|
|
203
|
+
if not "".join(parts).strip():
|
|
204
|
+
continue # hold the panel back until real content arrives
|
|
205
|
+
started = True
|
|
206
|
+
live.start()
|
|
207
|
+
now = time.monotonic()
|
|
208
|
+
if now - last_draw >= 0.06: # throttle to ~16 fps
|
|
209
|
+
live.update(self._answer_panel("".join(parts)), refresh=True)
|
|
210
|
+
last_draw = now
|
|
211
|
+
if started: # final frame: the complete, settled answer
|
|
212
|
+
live.update(self._answer_panel("".join(parts)), refresh=True)
|
|
213
|
+
finally:
|
|
214
|
+
if started:
|
|
215
|
+
live.stop()
|
|
216
|
+
return "".join(parts)
|
|
217
|
+
|
|
218
|
+
def _answer_panel(self, text: str):
|
|
219
|
+
return branding.build_transcript_markdown(self._console, _balance_fences(text))
|
|
220
|
+
|
|
171
221
|
def reasoning(self, text: str) -> None:
|
|
172
222
|
self._console.print(branding.build_reasoning_panel(self._console, text))
|
|
173
223
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: deepparallel
|
|
3
|
-
Version: 0.4.
|
|
3
|
+
Version: 0.4.1
|
|
4
4
|
Summary: DeepParallel - a multi-model agentic coding CLI with cross-model Guardian review, served via Crowe Logic.
|
|
5
5
|
Author-email: Michael Crowe <michael@crowelogic.com>
|
|
6
6
|
License: Apache-2.0
|
|
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
|
|
|
4
4
|
|
|
5
5
|
[project]
|
|
6
6
|
name = "deepparallel"
|
|
7
|
-
version = "0.4.
|
|
7
|
+
version = "0.4.1"
|
|
8
8
|
description = "DeepParallel - a multi-model agentic coding CLI with cross-model Guardian review, served via Crowe Logic."
|
|
9
9
|
readme = "README.md"
|
|
10
10
|
license = { text = "Apache-2.0" }
|
|
@@ -123,14 +123,27 @@ def test_rich_confirm_shows_detail():
|
|
|
123
123
|
assert "added line" in out
|
|
124
124
|
|
|
125
125
|
|
|
126
|
-
def
|
|
126
|
+
def test_rich_answer_stream_returns_text_and_renders_live_markdown():
|
|
127
127
|
buf = io.StringIO()
|
|
128
128
|
con = Console(no_color=True, width=80, file=buf, force_terminal=True, highlight=False)
|
|
129
129
|
r = RichRenderer(console=con)
|
|
130
130
|
full = r.answer_stream(iter(["Hel", "lo ", "world"]))
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
assert
|
|
131
|
+
out = buf.getvalue()
|
|
132
|
+
assert full == "Hello world" # full text preserved for history
|
|
133
|
+
assert "Hello world" in out # rendered in the live answer panel
|
|
134
|
+
assert "◆" in out and "answer" in out # panel marker + title
|
|
135
|
+
|
|
136
|
+
|
|
137
|
+
def test_rich_answer_stream_renders_markdown_formatting():
|
|
138
|
+
buf = io.StringIO()
|
|
139
|
+
con = Console(no_color=True, width=80, file=buf, force_terminal=True, highlight=False)
|
|
140
|
+
r = RichRenderer(console=con)
|
|
141
|
+
full = r.answer_stream(iter(["# Big\n\n", "body **bold**"]))
|
|
142
|
+
out = buf.getvalue()
|
|
143
|
+
assert full == "# Big\n\nbody **bold**"
|
|
144
|
+
# markdown is rendered, not shown raw: the heading hash is consumed
|
|
145
|
+
assert "Big" in out and "body" in out
|
|
146
|
+
assert "# Big" not in out
|
|
134
147
|
|
|
135
148
|
|
|
136
149
|
def test_rich_answer_stream_empty_prints_nothing():
|
|
@@ -139,20 +152,29 @@ def test_rich_answer_stream_empty_prints_nothing():
|
|
|
139
152
|
r = RichRenderer(console=con)
|
|
140
153
|
full = r.answer_stream(iter([]))
|
|
141
154
|
assert full == ""
|
|
142
|
-
assert buf.getvalue() == "" # tool-only turns
|
|
155
|
+
assert buf.getvalue() == "" # tool-only turns never start the live panel
|
|
143
156
|
|
|
144
157
|
|
|
145
|
-
def
|
|
158
|
+
def test_rich_answer_stream_whitespace_leading_holds_panel():
|
|
146
159
|
buf = io.StringIO()
|
|
147
160
|
con = Console(no_color=True, width=80, file=buf, force_terminal=True, highlight=False)
|
|
148
161
|
r = RichRenderer(console=con)
|
|
149
162
|
full = r.answer_stream(iter(["\n", " ", "\n", "Hello"]))
|
|
150
163
|
out = buf.getvalue()
|
|
151
164
|
assert full == "\n \nHello" # full text preserved for history
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
165
|
+
assert "Hello" in out and "◆" in out
|
|
166
|
+
|
|
167
|
+
|
|
168
|
+
def test_rich_answer_stream_inline_when_not_a_terminal():
|
|
169
|
+
# pipes / CI: raw inline streaming, no Live panel (no border characters)
|
|
170
|
+
buf = io.StringIO()
|
|
171
|
+
con = Console(no_color=True, width=80, file=buf, highlight=False) # not a terminal
|
|
172
|
+
r = RichRenderer(console=con)
|
|
173
|
+
full = r.answer_stream(iter(["Hel", "lo"]))
|
|
174
|
+
out = buf.getvalue()
|
|
175
|
+
assert full == "Hello"
|
|
176
|
+
assert "Hello" in out
|
|
177
|
+
assert "─" not in out and "answer" not in out # no panel chrome
|
|
156
178
|
|
|
157
179
|
|
|
158
180
|
# ---------------------------------------------------------------- FakeRenderer
|
|
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
|