ripperdoc 0.2.0__py3-none-any.whl → 0.2.2__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.
- ripperdoc/__init__.py +1 -1
- ripperdoc/cli/cli.py +66 -8
- ripperdoc/cli/commands/__init__.py +4 -0
- ripperdoc/cli/commands/agents_cmd.py +22 -0
- ripperdoc/cli/commands/context_cmd.py +11 -1
- ripperdoc/cli/commands/doctor_cmd.py +200 -0
- ripperdoc/cli/commands/memory_cmd.py +209 -0
- ripperdoc/cli/commands/models_cmd.py +25 -0
- ripperdoc/cli/commands/tasks_cmd.py +27 -0
- ripperdoc/cli/ui/rich_ui.py +156 -9
- ripperdoc/core/agents.py +4 -2
- ripperdoc/core/config.py +48 -3
- ripperdoc/core/default_tools.py +16 -2
- ripperdoc/core/permissions.py +19 -0
- ripperdoc/core/query.py +231 -297
- ripperdoc/core/query_utils.py +537 -0
- ripperdoc/core/system_prompt.py +2 -1
- ripperdoc/core/tool.py +13 -0
- ripperdoc/tools/background_shell.py +9 -3
- ripperdoc/tools/bash_tool.py +15 -0
- ripperdoc/tools/file_edit_tool.py +7 -0
- ripperdoc/tools/file_read_tool.py +7 -0
- ripperdoc/tools/file_write_tool.py +7 -0
- ripperdoc/tools/glob_tool.py +55 -15
- ripperdoc/tools/grep_tool.py +7 -0
- ripperdoc/tools/ls_tool.py +242 -73
- ripperdoc/tools/mcp_tools.py +32 -10
- ripperdoc/tools/multi_edit_tool.py +11 -0
- ripperdoc/tools/notebook_edit_tool.py +6 -3
- ripperdoc/tools/task_tool.py +7 -0
- ripperdoc/tools/todo_tool.py +159 -25
- ripperdoc/tools/tool_search_tool.py +9 -0
- ripperdoc/utils/git_utils.py +276 -0
- ripperdoc/utils/json_utils.py +28 -0
- ripperdoc/utils/log.py +130 -29
- ripperdoc/utils/mcp.py +71 -6
- ripperdoc/utils/memory.py +14 -1
- ripperdoc/utils/message_compaction.py +26 -5
- ripperdoc/utils/messages.py +63 -4
- ripperdoc/utils/output_utils.py +36 -9
- ripperdoc/utils/permissions/path_validation_utils.py +6 -0
- ripperdoc/utils/safe_get_cwd.py +4 -0
- ripperdoc/utils/session_history.py +27 -9
- ripperdoc/utils/todo.py +2 -2
- {ripperdoc-0.2.0.dist-info → ripperdoc-0.2.2.dist-info}/METADATA +4 -2
- ripperdoc-0.2.2.dist-info/RECORD +86 -0
- ripperdoc-0.2.0.dist-info/RECORD +0 -81
- {ripperdoc-0.2.0.dist-info → ripperdoc-0.2.2.dist-info}/WHEEL +0 -0
- {ripperdoc-0.2.0.dist-info → ripperdoc-0.2.2.dist-info}/entry_points.txt +0 -0
- {ripperdoc-0.2.0.dist-info → ripperdoc-0.2.2.dist-info}/licenses/LICENSE +0 -0
- {ripperdoc-0.2.0.dist-info → ripperdoc-0.2.2.dist-info}/top_level.txt +0 -0
ripperdoc/core/permissions.py
CHANGED
|
@@ -11,6 +11,9 @@ from typing import Any, Awaitable, Callable, Optional, Set
|
|
|
11
11
|
from ripperdoc.core.config import config_manager
|
|
12
12
|
from ripperdoc.core.tool import Tool
|
|
13
13
|
from ripperdoc.utils.permissions import PermissionDecision, ToolRule
|
|
14
|
+
from ripperdoc.utils.log import get_logger
|
|
15
|
+
|
|
16
|
+
logger = get_logger()
|
|
14
17
|
|
|
15
18
|
|
|
16
19
|
@dataclass
|
|
@@ -46,11 +49,19 @@ def permission_key(tool: Tool[Any, Any], parsed_input: Any) -> str:
|
|
|
46
49
|
try:
|
|
47
50
|
return f"{tool.name}::path::{Path(getattr(parsed_input, 'file_path')).resolve()}"
|
|
48
51
|
except Exception:
|
|
52
|
+
logger.exception(
|
|
53
|
+
"[permissions] Failed to resolve file_path for permission key",
|
|
54
|
+
extra={"tool": getattr(tool, "name", None)},
|
|
55
|
+
)
|
|
49
56
|
return f"{tool.name}::path::{getattr(parsed_input, 'file_path')}"
|
|
50
57
|
if hasattr(parsed_input, "path"):
|
|
51
58
|
try:
|
|
52
59
|
return f"{tool.name}::path::{Path(getattr(parsed_input, 'path')).resolve()}"
|
|
53
60
|
except Exception:
|
|
61
|
+
logger.exception(
|
|
62
|
+
"[permissions] Failed to resolve path for permission key",
|
|
63
|
+
extra={"tool": getattr(tool, "name", None)},
|
|
64
|
+
)
|
|
54
65
|
return f"{tool.name}::path::{getattr(parsed_input, 'path')}"
|
|
55
66
|
return tool.name
|
|
56
67
|
|
|
@@ -116,6 +127,10 @@ def make_permission_checker(
|
|
|
116
127
|
if hasattr(tool, "needs_permissions") and not tool.needs_permissions(parsed_input):
|
|
117
128
|
return PermissionResult(result=True)
|
|
118
129
|
except Exception:
|
|
130
|
+
logger.exception(
|
|
131
|
+
"[permissions] Tool needs_permissions check failed",
|
|
132
|
+
extra={"tool": getattr(tool, "name", None)},
|
|
133
|
+
)
|
|
119
134
|
return PermissionResult(
|
|
120
135
|
result=False,
|
|
121
136
|
message="Permission check failed for this tool invocation.",
|
|
@@ -153,6 +168,10 @@ def make_permission_checker(
|
|
|
153
168
|
if isinstance(decision, dict) and "behavior" in decision:
|
|
154
169
|
decision = PermissionDecision(**decision)
|
|
155
170
|
except Exception:
|
|
171
|
+
logger.exception(
|
|
172
|
+
"[permissions] Tool check_permissions failed",
|
|
173
|
+
extra={"tool": getattr(tool, "name", None)},
|
|
174
|
+
)
|
|
156
175
|
decision = PermissionDecision(
|
|
157
176
|
behavior="ask",
|
|
158
177
|
message="Error checking permissions for this tool.",
|