codebind 0.1.2__tar.gz → 0.1.3__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.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: codebind
3
- Version: 0.1.2
3
+ Version: 0.1.3
4
4
  Summary: A minimal model loop over a persistent IPython session.
5
5
  Keywords: ai,ipython,llm,repl,agents
6
6
  Author: Giovanni Gravili
@@ -1,6 +1,6 @@
1
1
  [project]
2
2
  name = "codebind"
3
- version = "0.1.2"
3
+ version = "0.1.3"
4
4
  description = "A minimal model loop over a persistent IPython session."
5
5
  readme = "README.md"
6
6
  requires-python = ">=3.13"
@@ -1,6 +1,6 @@
1
1
  [project]
2
2
  name = "codebind"
3
- version = "0.1.2"
3
+ version = "0.1.3"
4
4
  description = "A minimal model loop over a persistent IPython session."
5
5
  readme = "README.md"
6
6
  authors = [
@@ -62,4 +62,5 @@ def render_output_prompt(shell: object, prompts: CellPrompts) -> None:
62
62
  """Render an output prompt with IPython's terminal style."""
63
63
  pt_app = getattr(shell, "pt_app", None)
64
64
  style = pt_app.app.style if pt_app is not None else None
65
+ sys.stdout.write(getattr(shell, "separate_out", "") or "\n")
65
66
  print_formatted_text(PygmentsTokens(prompts.out_prompt_tokens()), style=style, end="")
@@ -2,20 +2,14 @@
2
2
 
3
3
  from __future__ import annotations
4
4
 
5
- from itertools import chain
6
-
7
5
  from rich.console import Console
8
6
  from rich.markdown import Markdown
9
- from rich.segment import Segments
10
7
  from rich.text import Text
11
8
 
12
9
  from .execution import ExecutionReport
13
10
  from .prompts import CellPrompts, render_output_prompt
14
11
 
15
12
 
16
- _MAXIMUM_OUTPUT_LINES = 10
17
-
18
-
19
13
  def _visible_output(report: ExecutionReport) -> str:
20
14
  parts = [part for part in (report.stdout, report.stderr) if part]
21
15
  if report.displays:
@@ -28,28 +22,20 @@ def _visible_output(report: ExecutionReport) -> str:
28
22
 
29
23
 
30
24
  class TerminalRenderer:
31
- """Render concise tool previews and Markdown answers to the active terminal."""
25
+ """Render tool output and Markdown answers to the active terminal."""
32
26
 
33
27
  def __init__(self) -> None:
34
28
  self.console = Console()
35
29
 
36
30
  def tool_output(self, report: ExecutionReport, shell: object, prompts: CellPrompts) -> None:
37
- """Show a bounded preview while leaving the report itself intact for the model."""
31
+ """Show the complete tool output."""
38
32
  visible = _visible_output(report)
39
33
  if not visible:
40
34
  return
41
35
  output = Text.from_ansi(visible)
42
- options = self.console.options
43
- complete = self.console.render_lines(output, options, pad=False, new_lines=True)
44
- preview = complete[:_MAXIMUM_OUTPUT_LINES]
45
36
  if report.ok:
46
37
  render_output_prompt(shell, prompts)
47
- self.console.print(Segments(chain.from_iterable(preview)), end="")
48
- if len(complete) > len(preview):
49
- self.console.print(
50
- f"[dim]{len(preview)} of {len(complete)} lines shown; "
51
- "the complete result was returned to the model.[/dim]"
52
- )
38
+ self.console.print(output)
53
39
 
54
40
  def assistant(self, text: str) -> None:
55
41
  """Render the final model response as terminal Markdown."""
File without changes
File without changes
File without changes
File without changes