sanityops-cli 0.1.3__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.
Files changed (53) hide show
  1. sanityops_cli/__init__.py +16 -0
  2. sanityops_cli/agents/__init__.py +14 -0
  3. sanityops_cli/agents/repair_agent/__init__.py +19 -0
  4. sanityops_cli/agents/repair_agent/agent.py +230 -0
  5. sanityops_cli/agents/repair_agent/prompts.py +100 -0
  6. sanityops_cli/agents/repair_agent/tools/__init__.py +19 -0
  7. sanityops_cli/agents/repair_agent/tools/store_repairs_tool.py +144 -0
  8. sanityops_cli/agents/scanner_agent/agent.py +332 -0
  9. sanityops_cli/agents/scanner_agent/hooks/progress_hook.py +152 -0
  10. sanityops_cli/agents/scanner_agent/models/finding.py +120 -0
  11. sanityops_cli/agents/scanner_agent/prompts.py +316 -0
  12. sanityops_cli/agents/scanner_agent/tools/grep_tool.py +667 -0
  13. sanityops_cli/agents/scanner_agent/tools/listfiles_tool.py +88 -0
  14. sanityops_cli/agents/scanner_agent/tools/readfile_tool.py +804 -0
  15. sanityops_cli/agents/scanner_agent/tools/storefindings_tool.py +178 -0
  16. sanityops_cli/api/__init__.py +16 -0
  17. sanityops_cli/api/client.py +403 -0
  18. sanityops_cli/commands/__init__.py +14 -0
  19. sanityops_cli/commands/config.py +312 -0
  20. sanityops_cli/commands/init.py +132 -0
  21. sanityops_cli/commands/inspect.py +646 -0
  22. sanityops_cli/constants/__init__.py +14 -0
  23. sanityops_cli/constants/config_defaults.py +22 -0
  24. sanityops_cli/constants/exit_codes.py +19 -0
  25. sanityops_cli/defect_checker/__init__.py +16 -0
  26. sanityops_cli/defect_checker/checker.py +100 -0
  27. sanityops_cli/defect_checker/llm_config.py +112 -0
  28. sanityops_cli/defect_checker/markdown_reporter.py +249 -0
  29. sanityops_cli/defect_checker/renderer.py +203 -0
  30. sanityops_cli/exceptions/__init__.py +14 -0
  31. sanityops_cli/exceptions/api_exceptions.py +60 -0
  32. sanityops_cli/exceptions/base_exceptions.py +25 -0
  33. sanityops_cli/help_panel.py +49 -0
  34. sanityops_cli/logging/__init__.py +18 -0
  35. sanityops_cli/logging/logger.py +108 -0
  36. sanityops_cli/main.py +123 -0
  37. sanityops_cli/progress/__init__.py +18 -0
  38. sanityops_cli/progress/tracker.py +159 -0
  39. sanityops_cli/renderers/__init__.py +14 -0
  40. sanityops_cli/renderers/command_renderer/inspect_command_renderer.py +87 -0
  41. sanityops_cli/templates/__init__.py +14 -0
  42. sanityops_cli/templates/inspect_config.yaml +55 -0
  43. sanityops_cli/utils/__init__.py +14 -0
  44. sanityops_cli/utils/artifact_packer.py +407 -0
  45. sanityops_cli/utils/config_loader.py +296 -0
  46. sanityops_cli/utils/config_resolver.py +358 -0
  47. sanityops_cli/utils/validators.py +117 -0
  48. sanityops_cli-0.1.3.dist-info/METADATA +213 -0
  49. sanityops_cli-0.1.3.dist-info/RECORD +53 -0
  50. sanityops_cli-0.1.3.dist-info/WHEEL +4 -0
  51. sanityops_cli-0.1.3.dist-info/entry_points.txt +2 -0
  52. sanityops_cli-0.1.3.dist-info/licenses/LICENSE +201 -0
  53. sanityops_cli-0.1.3.dist-info/licenses/NOTICE +5 -0
@@ -0,0 +1,88 @@
1
+ # Copyright 2026 zipsonken
2
+ #
3
+ # Licensed under the Apache License, Version 2.0 (the "License");
4
+ # you may not use this file except in compliance with the License.
5
+ # You may obtain a copy of the License at
6
+ #
7
+ # http://www.apache.org/licenses/LICENSE-2.0
8
+ #
9
+ # Unless required by applicable law or agreed to in writing, software
10
+ # distributed under the License is distributed on an "AS IS" BASIS,
11
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12
+ # See the License for the specific language governing permissions and
13
+ # limitations under the License.
14
+ #
15
+
16
+ from pathlib import Path
17
+
18
+ from sanityops_agent.tools.base import Tool, ToolResult
19
+
20
+
21
+ class ListFilesTool(Tool):
22
+ """List files in a directory with structure."""
23
+
24
+ name = "list_files"
25
+ description = "List all files and directories with their structure. Shows file types and sizes."
26
+ parameters = {
27
+ "type": "object",
28
+ "properties": {
29
+ "path": {
30
+ "type": "string",
31
+ "description": "Directory path to list"
32
+ },
33
+ "max_depth": {
34
+ "type": "integer",
35
+ "description": "Maximum depth to traverse (default 3)",
36
+ "default": 3
37
+ }
38
+ },
39
+ "required": ["path"]
40
+ }
41
+ tags = ["scanner"]
42
+
43
+ async def execute(self, path: str, max_depth: int = 3, **kwargs) -> ToolResult:
44
+ """List directory structure."""
45
+ try:
46
+ base_path = Path(path)
47
+ if not base_path.exists():
48
+ return ToolResult(
49
+ content=f"Path not found: {path}",
50
+ success=False,
51
+ error="Path not found"
52
+ )
53
+
54
+ result_lines = []
55
+ file_count = 0
56
+ dir_count = 0
57
+
58
+ for item in base_path.rglob("*"):
59
+ rel_path = item.relative_to(base_path)
60
+ depth = len(rel_path.parts)
61
+
62
+ if depth > max_depth:
63
+ continue
64
+
65
+ if item.is_dir():
66
+ dir_count += 1
67
+ result_lines.append(f"[DIR] {rel_path}/")
68
+ else:
69
+ file_count += 1
70
+ size = item.stat().st_size
71
+ ext = item.suffix.lower()
72
+ result_lines.append(f"[FILE] {rel_path} ({size} bytes, {ext})")
73
+
74
+ summary = f"\n---\nTotal: {dir_count} directories, {file_count} files"
75
+ return ToolResult(
76
+ content="\n".join(result_lines) + summary,
77
+ success=True,
78
+ metadata={"file_count": file_count, "dir_count": dir_count}
79
+ )
80
+
81
+ except Exception as e:
82
+ return ToolResult(
83
+ content=f"Error listing files: {e}",
84
+ success=False,
85
+ error=str(e)
86
+ )
87
+
88
+