tapps-agents 3.5.38__py3-none-any.whl → 3.5.39__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.
@@ -0,0 +1,228 @@
1
+ """
2
+ Cleanup Agent parser definitions
3
+ """
4
+ import argparse
5
+
6
+
7
+ def add_cleanup_agent_parser(subparsers: argparse._SubParsersAction) -> None:
8
+ """Add cleanup-agent parser and subparsers."""
9
+ cleanup_agent_parser = subparsers.add_parser(
10
+ "cleanup-agent",
11
+ help="Project Cleanup Agent commands",
12
+ description="""Project structure analysis and intelligent cleanup agent.
13
+
14
+ The Cleanup Agent helps keep projects clean by:
15
+ - Analyzing project structure for cleanup opportunities
16
+ - Detecting duplicate files and content
17
+ - Identifying outdated documentation
18
+ - Enforcing naming conventions (kebab-case)
19
+ - Generating cleanup plans with rationale
20
+ - Executing cleanup operations safely with backups
21
+
22
+ Use this agent for guided project and docs cleanup after heavy development.""",
23
+ )
24
+ cleanup_subparsers = cleanup_agent_parser.add_subparsers(
25
+ dest="command",
26
+ help="Cleanup agent subcommand (use 'help' to see all available commands)",
27
+ )
28
+
29
+ # Analyze command
30
+ analyze_parser = cleanup_subparsers.add_parser(
31
+ "analyze",
32
+ aliases=["*analyze"],
33
+ help="Analyze project structure for cleanup opportunities",
34
+ description="""Analyze project structure to identify cleanup opportunities.
35
+
36
+ Scans the specified path and detects:
37
+ - Duplicate files (by content hash)
38
+ - Outdated files (not modified in 90+ days)
39
+ - Naming convention violations
40
+ - Files with no references
41
+
42
+ Example:
43
+ tapps-agents cleanup-agent analyze --path ./docs --pattern "*.md"
44
+ tapps-agents cleanup-agent analyze --output analysis.json""",
45
+ )
46
+ analyze_parser.add_argument(
47
+ "--path",
48
+ help="Path to analyze (defaults to ./docs). Can be any directory in the project.",
49
+ )
50
+ analyze_parser.add_argument(
51
+ "--pattern",
52
+ default="*.md",
53
+ help="File pattern to match (default: *.md). Supports glob patterns.",
54
+ )
55
+ analyze_parser.add_argument(
56
+ "--output",
57
+ help="Output file for analysis report (JSON format). If not specified, displays summary.",
58
+ )
59
+ analyze_parser.add_argument(
60
+ "--format",
61
+ choices=["json", "text", "markdown"],
62
+ default="json",
63
+ help="Output format: 'json' for structured data (default), 'text' for human-readable, 'markdown' for markdown",
64
+ )
65
+
66
+ # Plan command
67
+ plan_parser = cleanup_subparsers.add_parser(
68
+ "plan",
69
+ aliases=["*plan"],
70
+ help="Generate cleanup plan from analysis",
71
+ description="""Generate a cleanup plan with prioritized actions.
72
+
73
+ Creates a plan based on analysis that includes:
74
+ - File categorization (keep, archive, delete, merge, rename)
75
+ - Priority levels (high, medium, low)
76
+ - Safety levels (safe, moderate, risky)
77
+ - Rationale for each action
78
+ - Estimated space savings
79
+
80
+ Example:
81
+ tapps-agents cleanup-agent plan --analysis-file analysis.json
82
+ tapps-agents cleanup-agent plan --path ./docs --output cleanup-plan.json""",
83
+ )
84
+ plan_parser.add_argument(
85
+ "--analysis-file",
86
+ help="Path to analysis report JSON. If not provided, runs fresh analysis.",
87
+ )
88
+ plan_parser.add_argument(
89
+ "--path",
90
+ help="Path to analyze if no analysis file provided (defaults to ./docs).",
91
+ )
92
+ plan_parser.add_argument(
93
+ "--pattern",
94
+ default="*.md",
95
+ help="File pattern if running fresh analysis (default: *.md).",
96
+ )
97
+ plan_parser.add_argument(
98
+ "--output",
99
+ help="Output file for cleanup plan (JSON format).",
100
+ )
101
+ plan_parser.add_argument(
102
+ "--format",
103
+ choices=["json", "text", "markdown"],
104
+ default="json",
105
+ help="Output format (default: json).",
106
+ )
107
+
108
+ # Execute command
109
+ execute_parser = cleanup_subparsers.add_parser(
110
+ "execute",
111
+ aliases=["*execute"],
112
+ help="Execute cleanup plan (dry-run by default)",
113
+ description="""Execute cleanup operations from a plan.
114
+
115
+ Performs cleanup actions with safety measures:
116
+ - Dry-run mode by default (preview changes)
117
+ - Optional backup creation before execution
118
+ - Reference updating for renamed/moved files
119
+ - Transaction logging for rollback capability
120
+
121
+ Example:
122
+ tapps-agents cleanup-agent execute --plan-file cleanup-plan.json --dry-run
123
+ tapps-agents cleanup-agent execute --plan-file cleanup-plan.json --no-dry-run --backup""",
124
+ )
125
+ execute_parser.add_argument(
126
+ "--plan-file",
127
+ help="Path to cleanup plan JSON. If not provided, generates plan from analysis.",
128
+ )
129
+ execute_parser.add_argument(
130
+ "--path",
131
+ help="Path to analyze if no plan file provided (defaults to ./docs).",
132
+ )
133
+ execute_parser.add_argument(
134
+ "--pattern",
135
+ default="*.md",
136
+ help="File pattern if running fresh (default: *.md).",
137
+ )
138
+ execute_parser.add_argument(
139
+ "--dry-run",
140
+ action="store_true",
141
+ default=True,
142
+ help="Preview changes without executing (default: True).",
143
+ )
144
+ execute_parser.add_argument(
145
+ "--no-dry-run",
146
+ action="store_true",
147
+ help="Execute changes for real (disables dry-run).",
148
+ )
149
+ execute_parser.add_argument(
150
+ "--backup",
151
+ action="store_true",
152
+ default=True,
153
+ help="Create backup before execution (default: True).",
154
+ )
155
+ execute_parser.add_argument(
156
+ "--no-backup",
157
+ action="store_true",
158
+ help="Skip backup creation (not recommended).",
159
+ )
160
+ execute_parser.add_argument(
161
+ "--format",
162
+ choices=["json", "text", "markdown"],
163
+ default="json",
164
+ help="Output format (default: json).",
165
+ )
166
+
167
+ # Run command (full workflow)
168
+ run_parser = cleanup_subparsers.add_parser(
169
+ "run",
170
+ aliases=["*run"],
171
+ help="Run full cleanup workflow (analyze, plan, execute)",
172
+ description="""Run the complete cleanup workflow in one command.
173
+
174
+ Executes all steps:
175
+ 1. Analyze project structure
176
+ 2. Generate cleanup plan
177
+ 3. Execute cleanup operations
178
+
179
+ By default runs in dry-run mode with backups enabled.
180
+
181
+ Example:
182
+ tapps-agents cleanup-agent run --path ./docs --dry-run
183
+ tapps-agents cleanup-agent run --path ./docs --no-dry-run --backup""",
184
+ )
185
+ run_parser.add_argument(
186
+ "--path",
187
+ help="Path to analyze (defaults to ./docs).",
188
+ )
189
+ run_parser.add_argument(
190
+ "--pattern",
191
+ default="*.md",
192
+ help="File pattern to match (default: *.md).",
193
+ )
194
+ run_parser.add_argument(
195
+ "--dry-run",
196
+ action="store_true",
197
+ default=True,
198
+ help="Preview changes without executing (default: True).",
199
+ )
200
+ run_parser.add_argument(
201
+ "--no-dry-run",
202
+ action="store_true",
203
+ help="Execute changes for real (disables dry-run).",
204
+ )
205
+ run_parser.add_argument(
206
+ "--backup",
207
+ action="store_true",
208
+ default=True,
209
+ help="Create backup before execution (default: True).",
210
+ )
211
+ run_parser.add_argument(
212
+ "--no-backup",
213
+ action="store_true",
214
+ help="Skip backup creation (not recommended).",
215
+ )
216
+ run_parser.add_argument(
217
+ "--format",
218
+ choices=["json", "text", "markdown"],
219
+ default="json",
220
+ help="Output format (default: json).",
221
+ )
222
+
223
+ # Help command
224
+ cleanup_subparsers.add_parser(
225
+ "help",
226
+ aliases=["*help"],
227
+ help="Show cleanup agent commands",
228
+ )