regcode 0.2.0__py3-none-any.whl → 0.3.0__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.
- regcode/cli.py +5 -1
- regcode/config.py +6 -0
- regcode/tools/__init__.py +1 -1
- regcode/tui.py +5 -2
- {regcode-0.2.0.dist-info → regcode-0.3.0.dist-info}/METADATA +1 -1
- {regcode-0.2.0.dist-info → regcode-0.3.0.dist-info}/RECORD +8 -8
- {regcode-0.2.0.dist-info → regcode-0.3.0.dist-info}/WHEEL +0 -0
- {regcode-0.2.0.dist-info → regcode-0.3.0.dist-info}/entry_points.txt +0 -0
regcode/cli.py
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import sys
|
|
2
|
+
from pathlib import Path
|
|
2
3
|
|
|
3
4
|
import click
|
|
4
5
|
import yaml
|
|
@@ -42,7 +43,10 @@ def cli(ctx):
|
|
|
42
43
|
)
|
|
43
44
|
def chat(model, config_path, stream, full, no_color):
|
|
44
45
|
"""Chat with the agent using a Textual TUI with sticky bottom bar."""
|
|
45
|
-
|
|
46
|
+
# Pass None if the file doesn't exist so Config.load falls back
|
|
47
|
+
# to ~/.regcode/config.yaml (matching the TUI's expected behaviour).
|
|
48
|
+
_effective_path = config_path if Path(config_path).exists() else None
|
|
49
|
+
config = regcode.Config.load(_effective_path)
|
|
46
50
|
if model:
|
|
47
51
|
config.provider.model = model
|
|
48
52
|
if full:
|
regcode/config.py
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import logging
|
|
1
2
|
import os
|
|
2
3
|
from pathlib import Path
|
|
3
4
|
from textwrap import dedent
|
|
@@ -40,6 +41,7 @@ default_system_prompt = dedent(
|
|
|
40
41
|
"""
|
|
41
42
|
)
|
|
42
43
|
|
|
44
|
+
logger = logging.getLogger(__name__)
|
|
43
45
|
|
|
44
46
|
class AgentConfig(BaseModel):
|
|
45
47
|
model_config = ConfigDict(extra="allow")
|
|
@@ -95,8 +97,12 @@ class Config(BaseModel):
|
|
|
95
97
|
def load(cls, path: str | None = None) -> "Config":
|
|
96
98
|
# get default home dir for user first
|
|
97
99
|
if path is None:
|
|
100
|
+
logger.warning(
|
|
101
|
+
"No config path provided, looking for ~/.regcode/config.yaml"
|
|
102
|
+
)
|
|
98
103
|
alt_config_path = Path.home() / ".regcode" / "config.yaml"
|
|
99
104
|
if alt_config_path.exists():
|
|
105
|
+
logger.warning(f"Loading from config at {alt_config_path}")
|
|
100
106
|
_path = alt_config_path
|
|
101
107
|
else:
|
|
102
108
|
_path = Path("config.yaml")
|
regcode/tools/__init__.py
CHANGED
regcode/tui.py
CHANGED
|
@@ -8,6 +8,7 @@ Provides a clean, modern chat interface with:
|
|
|
8
8
|
|
|
9
9
|
from __future__ import annotations
|
|
10
10
|
|
|
11
|
+
import logging
|
|
11
12
|
import re
|
|
12
13
|
import threading
|
|
13
14
|
|
|
@@ -23,6 +24,7 @@ from textual.widgets import Input, RichLog, Static
|
|
|
23
24
|
from regcode import __version__
|
|
24
25
|
from regcode.main import ToolCall
|
|
25
26
|
|
|
27
|
+
_logger = logging.getLogger(__name__)
|
|
26
28
|
|
|
27
29
|
class ChatApp(App):
|
|
28
30
|
"""Textual chat app with clean modern UI."""
|
|
@@ -368,8 +370,9 @@ class ChatApp(App):
|
|
|
368
370
|
self.call_from_thread(
|
|
369
371
|
self._write_error_line, "Agent not initialized!"
|
|
370
372
|
)
|
|
371
|
-
except Exception:
|
|
372
|
-
|
|
373
|
+
except Exception as e:
|
|
374
|
+
_logger.exception("Agent error: %s", e)
|
|
375
|
+
self.call_from_thread(self._write_error_line, f"Agent error! {e}")
|
|
373
376
|
finally:
|
|
374
377
|
self.call_from_thread(self._finish_message)
|
|
375
378
|
|
|
@@ -1,18 +1,18 @@
|
|
|
1
1
|
regcode/__init__.py,sha256=2Cv_d6ciJzl49HiCT7_xpCw0efN5gtoYM7_MPnYZRE8,168
|
|
2
|
-
regcode/cli.py,sha256=
|
|
3
|
-
regcode/config.py,sha256=
|
|
2
|
+
regcode/cli.py,sha256=Gpmb84WGQ976WaJ67aSAdMW_xkuOObev7vYFOS649cA,4881
|
|
3
|
+
regcode/config.py,sha256=jdl-2A9tkhqf5tp8MeRahJkP62Q2npjmLwgLpEp-q98,5831
|
|
4
4
|
regcode/conversation_manager.py,sha256=7b1hB7881ydPkCvePJIZ-HgtUi95FglJ7MyFAYw2H1o,5636
|
|
5
5
|
regcode/main.py,sha256=6MOYRZNnFuqE85TmxeqfwJgFweU9ISD3ZVLzYTdDPXU,40084
|
|
6
6
|
regcode/monty_sandbox.py,sha256=UxTFmczQr5F4nlDe1gJ5Ul6GX_5KJkVYekVia-JKKvw,12930
|
|
7
7
|
regcode/permissions.py,sha256=9R1dz6ypxBq_tNj-l4ixq_KJ-kAbXHarOey5EmnZzgU,784
|
|
8
8
|
regcode/sandbox.py,sha256=v7oyl4PZVs4uMGGJRQC7YdQNLf7pbtRpVMXuNfnslJI,11414
|
|
9
|
-
regcode/tui.py,sha256=
|
|
10
|
-
regcode/tools/__init__.py,sha256=
|
|
9
|
+
regcode/tui.py,sha256=yaypO-7HoGOgL0KJBKb-a_lwH8SMDd2gm8c-wbu3OWs,23064
|
|
10
|
+
regcode/tools/__init__.py,sha256=HBkogWF-KHPsJJqqqEgxVcG1lcdFhiRulxU3bT2eKEQ,348
|
|
11
11
|
regcode/tools/base.py,sha256=D4oalxZb-cKvCMFeghyKSoLy_M7LUVPMeFTUPmrcuyY,3538
|
|
12
12
|
regcode/tools/builtins.py,sha256=-Q4OIW6WpnbdT6CxTi0rn98xxfKEZK3wsP4lzUgTASY,30920
|
|
13
13
|
regcode/tools/registry.py,sha256=jrGtKLlRPgfFQFGlCAaxEfoR0ZXForQUmZexM5-HnEo,2638
|
|
14
14
|
regcode/tools/review_notes.py,sha256=zdbKTKv2hlnfd7Q-F0xlg8n2IHt7h0KssS0OyyY2gcM,3743
|
|
15
|
-
regcode-0.
|
|
16
|
-
regcode-0.
|
|
17
|
-
regcode-0.
|
|
18
|
-
regcode-0.
|
|
15
|
+
regcode-0.3.0.dist-info/METADATA,sha256=VKBQTCwpvMqEXj_H1nt3aYgWC4JiBs6LPmPoWk5_aDc,5069
|
|
16
|
+
regcode-0.3.0.dist-info/WHEEL,sha256=mffPy8wBnZQn2VnJUU5jE99KsxaSfiyMHV9Yt0aLVxs,87
|
|
17
|
+
regcode-0.3.0.dist-info/entry_points.txt,sha256=DzSdoP-DefYTNnnuwctq7neSx19XjfB78Jzk-c1UcsQ,44
|
|
18
|
+
regcode-0.3.0.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|