tunacode-cli 0.0.9__py3-none-any.whl → 0.0.10__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.
Potentially problematic release.
This version of tunacode-cli might be problematic. Click here for more details.
- tunacode/cli/commands.py +34 -165
- tunacode/cli/main.py +15 -38
- tunacode/cli/repl.py +24 -18
- tunacode/configuration/defaults.py +1 -1
- tunacode/configuration/models.py +4 -11
- tunacode/configuration/settings.py +10 -3
- tunacode/constants.py +6 -4
- tunacode/context.py +3 -1
- tunacode/core/agents/main.py +94 -52
- tunacode/core/setup/agent_setup.py +1 -1
- tunacode/core/setup/config_setup.py +148 -78
- tunacode/core/setup/coordinator.py +4 -2
- tunacode/core/setup/environment_setup.py +1 -1
- tunacode/core/setup/git_safety_setup.py +51 -39
- tunacode/exceptions.py +2 -0
- tunacode/prompts/system.txt +1 -1
- tunacode/services/undo_service.py +16 -13
- tunacode/setup.py +6 -2
- tunacode/tools/base.py +20 -11
- tunacode/tools/update_file.py +14 -24
- tunacode/tools/write_file.py +7 -9
- tunacode/ui/completers.py +33 -98
- tunacode/ui/input.py +9 -13
- tunacode/ui/keybindings.py +3 -1
- tunacode/ui/lexers.py +17 -16
- tunacode/ui/output.py +8 -14
- tunacode/ui/panels.py +7 -5
- tunacode/ui/prompt_manager.py +4 -8
- tunacode/ui/tool_ui.py +3 -3
- tunacode/utils/system.py +0 -40
- tunacode_cli-0.0.10.dist-info/METADATA +366 -0
- tunacode_cli-0.0.10.dist-info/RECORD +65 -0
- {tunacode_cli-0.0.9.dist-info → tunacode_cli-0.0.10.dist-info}/licenses/LICENSE +1 -1
- tunacode/cli/model_selector.py +0 -178
- tunacode/core/agents/tinyagent_main.py +0 -194
- tunacode/core/setup/optimized_coordinator.py +0 -73
- tunacode/services/enhanced_undo_service.py +0 -322
- tunacode/services/project_undo_service.py +0 -311
- tunacode/tools/tinyagent_tools.py +0 -103
- tunacode/utils/lazy_imports.py +0 -59
- tunacode/utils/regex_cache.py +0 -33
- tunacode_cli-0.0.9.dist-info/METADATA +0 -321
- tunacode_cli-0.0.9.dist-info/RECORD +0 -73
- {tunacode_cli-0.0.9.dist-info → tunacode_cli-0.0.10.dist-info}/WHEEL +0 -0
- {tunacode_cli-0.0.9.dist-info → tunacode_cli-0.0.10.dist-info}/entry_points.txt +0 -0
- {tunacode_cli-0.0.9.dist-info → tunacode_cli-0.0.10.dist-info}/top_level.txt +0 -0
|
@@ -0,0 +1,366 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: tunacode-cli
|
|
3
|
+
Version: 0.0.10
|
|
4
|
+
Summary: Your agentic CLI developer.
|
|
5
|
+
Author-email: larock22 <noreply@github.com>
|
|
6
|
+
License-Expression: MIT
|
|
7
|
+
Project-URL: Homepage, https://github.com/larock22/tunacode
|
|
8
|
+
Project-URL: Repository, https://github.com/larock22/tunacode
|
|
9
|
+
Keywords: cli,agent,development,automation
|
|
10
|
+
Classifier: Development Status :: 4 - Beta
|
|
11
|
+
Classifier: Intended Audience :: Developers
|
|
12
|
+
Classifier: Programming Language :: Python :: 3
|
|
13
|
+
Classifier: Programming Language :: Python :: 3.10
|
|
14
|
+
Classifier: Programming Language :: Python :: 3.11
|
|
15
|
+
Classifier: Programming Language :: Python :: 3.12
|
|
16
|
+
Classifier: Programming Language :: Python :: 3.13
|
|
17
|
+
Classifier: Topic :: Software Development
|
|
18
|
+
Classifier: Topic :: Utilities
|
|
19
|
+
Requires-Python: >=3.10
|
|
20
|
+
Description-Content-Type: text/markdown
|
|
21
|
+
License-File: LICENSE
|
|
22
|
+
Requires-Dist: prompt_toolkit==3.0.51
|
|
23
|
+
Requires-Dist: pydantic-ai[logfire]==0.2.6
|
|
24
|
+
Requires-Dist: pygments==2.19.1
|
|
25
|
+
Requires-Dist: rich==14.0.0
|
|
26
|
+
Requires-Dist: typer==0.15.3
|
|
27
|
+
Provides-Extra: dev
|
|
28
|
+
Requires-Dist: build; extra == "dev"
|
|
29
|
+
Requires-Dist: black; extra == "dev"
|
|
30
|
+
Requires-Dist: flake8; extra == "dev"
|
|
31
|
+
Requires-Dist: isort; extra == "dev"
|
|
32
|
+
Requires-Dist: pytest; extra == "dev"
|
|
33
|
+
Requires-Dist: pytest-cov; extra == "dev"
|
|
34
|
+
Dynamic: license-file
|
|
35
|
+
|
|
36
|
+
# TunaCode
|
|
37
|
+
|
|
38
|
+
<div align="center">
|
|
39
|
+
|
|
40
|
+
[](https://badge.fury.io/py/tunacode-cli)
|
|
41
|
+
[](https://www.python.org/downloads/)
|
|
42
|
+
[](https://opensource.org/licenses/MIT)
|
|
43
|
+
|
|
44
|
+
**Your AI-powered CLI coding assistant**
|
|
45
|
+
|
|
46
|
+
[Quick Start](#quick-start) • [Features](#features) • [Configuration](#configuration) • [Documentation](#documentation)
|
|
47
|
+
|
|
48
|
+
</div>
|
|
49
|
+
|
|
50
|
+
---
|
|
51
|
+
|
|
52
|
+
## Overview
|
|
53
|
+
|
|
54
|
+
> **⚠️ Safety First**: TunaCode can modify your codebase. Always use git branches before making major changes. The `/undo` command has been removed - use git for version control.
|
|
55
|
+
|
|
56
|
+
> **Beta Notice**: TunaCode is currently in beta. [Report issues](https://github.com/alchemiststudiosDOTai/tunacode/issues) or share feedback to help us improve!
|
|
57
|
+
|
|
58
|
+
---
|
|
59
|
+
|
|
60
|
+
### Recent Updates
|
|
61
|
+
|
|
62
|
+
- **Simplified Setup**: Direct CLI configuration with `--model` and `--key` flags
|
|
63
|
+
- **Enhanced Safety**: Removed `/undo` command in favor of git-based workflows
|
|
64
|
+
- **Cleaner Codebase**: Removed `/init` command and automatic TUNACODE.md generation
|
|
65
|
+
- **Better Onboarding**: No model validation - trust users to provide correct model names
|
|
66
|
+
- **Unified Model Format**: All models use `provider:model-name` format
|
|
67
|
+
|
|
68
|
+
### Core Features
|
|
69
|
+
|
|
70
|
+
<table>
|
|
71
|
+
<tr>
|
|
72
|
+
<td width="50%">
|
|
73
|
+
|
|
74
|
+
### **Multi-Provider Support**
|
|
75
|
+
|
|
76
|
+
- Anthropic Claude
|
|
77
|
+
- OpenAI GPT
|
|
78
|
+
- Google Gemini
|
|
79
|
+
- OpenRouter (100+ models)
|
|
80
|
+
- Any OpenAI-compatible API
|
|
81
|
+
|
|
82
|
+
### **Developer Tools**
|
|
83
|
+
|
|
84
|
+
- 4 core tools: read_file, write_file, update_file, run_command
|
|
85
|
+
- MCP (Model Context Protocol) support
|
|
86
|
+
- File operation confirmations with diffs
|
|
87
|
+
- Per-project context guides (TUNACODE.md)
|
|
88
|
+
|
|
89
|
+
</td>
|
|
90
|
+
<td width="50%">
|
|
91
|
+
|
|
92
|
+
### **Safety & Control**
|
|
93
|
+
|
|
94
|
+
- Git branch integration (`/branch`)
|
|
95
|
+
- No automatic commits
|
|
96
|
+
- Explicit file operation confirmations
|
|
97
|
+
- Permission tracking per session
|
|
98
|
+
- `/yolo` mode for power users
|
|
99
|
+
|
|
100
|
+
### **Architecture**
|
|
101
|
+
|
|
102
|
+
- Built on pydantic-ai
|
|
103
|
+
- Async throughout
|
|
104
|
+
- Modular command system
|
|
105
|
+
- Rich UI with syntax highlighting
|
|
106
|
+
|
|
107
|
+
</td>
|
|
108
|
+
</tr>
|
|
109
|
+
</table>
|
|
110
|
+
|
|
111
|
+
---
|
|
112
|
+
|
|
113
|
+
## Quick Start
|
|
114
|
+
|
|
115
|
+
### Installation
|
|
116
|
+
|
|
117
|
+
#### PyPI
|
|
118
|
+
|
|
119
|
+
```bash
|
|
120
|
+
pip install tunacode-cli
|
|
121
|
+
```
|
|
122
|
+
|
|
123
|
+
#### One-line Install (Linux/macOS)
|
|
124
|
+
|
|
125
|
+
```bash
|
|
126
|
+
wget -qO- https://raw.githubusercontent.com/alchemiststudiosDOTai/tunacode/master/scripts/install_linux.sh | bash
|
|
127
|
+
```
|
|
128
|
+
|
|
129
|
+
### Setup Options
|
|
130
|
+
|
|
131
|
+
<details>
|
|
132
|
+
<summary><b>Option 1: Interactive Setup (Beginner-friendly)</b></summary>
|
|
133
|
+
|
|
134
|
+
```bash
|
|
135
|
+
tunacode
|
|
136
|
+
```
|
|
137
|
+
|
|
138
|
+
Follow the interactive prompts to configure your preferred LLM provider.
|
|
139
|
+
|
|
140
|
+
</details>
|
|
141
|
+
|
|
142
|
+
<details>
|
|
143
|
+
<summary><b>Option 2: Direct CLI Setup (Recommended)</b></summary>
|
|
144
|
+
|
|
145
|
+
```bash
|
|
146
|
+
# OpenAI
|
|
147
|
+
tunacode --model "openai:gpt-4.1" --key "your-openai-key"
|
|
148
|
+
|
|
149
|
+
# Anthropic Claude
|
|
150
|
+
tunacode --model "anthropic:claude-3-opus" --key "your-anthropic-key"
|
|
151
|
+
|
|
152
|
+
# OpenRouter (Access to multiple models)
|
|
153
|
+
tunacode --baseurl "https://openrouter.ai/api/v1" \
|
|
154
|
+
--model "openrouter:openai/gpt-4.1" \
|
|
155
|
+
--key "your-openrouter-key"
|
|
156
|
+
```
|
|
157
|
+
|
|
158
|
+
</details>
|
|
159
|
+
|
|
160
|
+
> **Important**: Model names require provider prefixes (e.g., `openai:gpt-4.1`, not `gpt-4.1`)
|
|
161
|
+
|
|
162
|
+
---
|
|
163
|
+
|
|
164
|
+
## Configuration
|
|
165
|
+
|
|
166
|
+
### Config Location
|
|
167
|
+
|
|
168
|
+
Configuration is stored in `~/.config/tunacode.json`
|
|
169
|
+
|
|
170
|
+
### Model Format
|
|
171
|
+
|
|
172
|
+
```
|
|
173
|
+
provider:model-name
|
|
174
|
+
```
|
|
175
|
+
|
|
176
|
+
**Examples:**
|
|
177
|
+
|
|
178
|
+
- `openai:gpt-4.1`
|
|
179
|
+
- `anthropic:claude-3-opus`
|
|
180
|
+
- `google-gla:gemini-2.0-flash`
|
|
181
|
+
- `openrouter:mistralai/devstral-small`
|
|
182
|
+
|
|
183
|
+
### OpenRouter Integration
|
|
184
|
+
|
|
185
|
+
<details>
|
|
186
|
+
<summary><b>Click to expand OpenRouter setup</b></summary>
|
|
187
|
+
|
|
188
|
+
[OpenRouter](https://openrouter.ai) provides access to 100+ models through a single API:
|
|
189
|
+
|
|
190
|
+
```bash
|
|
191
|
+
tunacode --baseurl "https://openrouter.ai/api/v1" \
|
|
192
|
+
--model "openrouter:openai/gpt-4.1" \
|
|
193
|
+
--key "your-openrouter-key"
|
|
194
|
+
```
|
|
195
|
+
|
|
196
|
+
**Manual Configuration:**
|
|
197
|
+
|
|
198
|
+
```json
|
|
199
|
+
{
|
|
200
|
+
"env": {
|
|
201
|
+
"OPENROUTER_API_KEY": "<YOUR_KEY>",
|
|
202
|
+
"OPENAI_BASE_URL": "https://openrouter.ai/api/v1"
|
|
203
|
+
},
|
|
204
|
+
"default_model": "openrouter:openai/gpt-4.1"
|
|
205
|
+
}
|
|
206
|
+
```
|
|
207
|
+
|
|
208
|
+
**Popular Models:**
|
|
209
|
+
|
|
210
|
+
- `openrouter:mistralai/devstral-small`
|
|
211
|
+
- `openrouter:openai/gpt-4.1-mini`
|
|
212
|
+
- `openrouter:codex-mini-latest`
|
|
213
|
+
|
|
214
|
+
</details>
|
|
215
|
+
|
|
216
|
+
### MCP (Model Context Protocol) Support
|
|
217
|
+
|
|
218
|
+
<details>
|
|
219
|
+
<summary><b>Click to expand MCP configuration</b></summary>
|
|
220
|
+
|
|
221
|
+
Extend your AI's capabilities with MCP servers:
|
|
222
|
+
|
|
223
|
+
```json
|
|
224
|
+
{
|
|
225
|
+
"mcpServers": {
|
|
226
|
+
"fetch": {
|
|
227
|
+
"command": "uvx",
|
|
228
|
+
"args": ["mcp-server-fetch"]
|
|
229
|
+
},
|
|
230
|
+
"github": {
|
|
231
|
+
"command": "npx",
|
|
232
|
+
"args": ["-y", "@modelcontextprotocol/server-github"],
|
|
233
|
+
"env": {
|
|
234
|
+
"GITHUB_PERSONAL_ACCESS_TOKEN": "<YOUR_TOKEN>"
|
|
235
|
+
}
|
|
236
|
+
}
|
|
237
|
+
}
|
|
238
|
+
}
|
|
239
|
+
```
|
|
240
|
+
|
|
241
|
+
Learn more at [modelcontextprotocol.io](https://modelcontextprotocol.io/)
|
|
242
|
+
|
|
243
|
+
</details>
|
|
244
|
+
|
|
245
|
+
---
|
|
246
|
+
|
|
247
|
+
## Commands Reference
|
|
248
|
+
|
|
249
|
+
| Command | Description |
|
|
250
|
+
| -------------------------------- | -------------------------------- |
|
|
251
|
+
| `/help` | Show available commands |
|
|
252
|
+
| `/yolo` | Toggle confirmation skipping |
|
|
253
|
+
| `/clear` | Clear message history |
|
|
254
|
+
| `/compact` | Summarize and clear old messages |
|
|
255
|
+
| `/model` | Show current model |
|
|
256
|
+
| `/model <provider:name>` | Switch model |
|
|
257
|
+
| `/model <provider:name> default` | Set default model |
|
|
258
|
+
| `/branch <name>` | Create and switch Git branch |
|
|
259
|
+
| `/dump` | Show message history (debug) |
|
|
260
|
+
| `exit` | Exit application |
|
|
261
|
+
|
|
262
|
+
---
|
|
263
|
+
|
|
264
|
+
## Customization
|
|
265
|
+
|
|
266
|
+
### Project Guides
|
|
267
|
+
|
|
268
|
+
Create a `TUNACODE.md` file your project root to customize TunaCode's behavior:
|
|
269
|
+
|
|
270
|
+
```markdown
|
|
271
|
+
# Project Guide
|
|
272
|
+
|
|
273
|
+
## Tech Stack
|
|
274
|
+
|
|
275
|
+
- Python 3.11
|
|
276
|
+
- FastAPI
|
|
277
|
+
- PostgreSQL
|
|
278
|
+
|
|
279
|
+
## Preferences
|
|
280
|
+
|
|
281
|
+
- Use type hints
|
|
282
|
+
- Follow PEP 8
|
|
283
|
+
- Write tests for new features
|
|
284
|
+
```
|
|
285
|
+
|
|
286
|
+
---
|
|
287
|
+
|
|
288
|
+
## Development
|
|
289
|
+
|
|
290
|
+
### Requirements
|
|
291
|
+
|
|
292
|
+
- Python 3.10+
|
|
293
|
+
- Git (for version control)
|
|
294
|
+
|
|
295
|
+
### Development Setup
|
|
296
|
+
|
|
297
|
+
```bash
|
|
298
|
+
# Install development dependencies
|
|
299
|
+
make install
|
|
300
|
+
|
|
301
|
+
# Run linting
|
|
302
|
+
make lint
|
|
303
|
+
|
|
304
|
+
# Run tests
|
|
305
|
+
make test
|
|
306
|
+
```
|
|
307
|
+
|
|
308
|
+
### Release Process
|
|
309
|
+
|
|
310
|
+
<details>
|
|
311
|
+
<summary><b>Click to expand release steps</b></summary>
|
|
312
|
+
|
|
313
|
+
1. **Update versions:**
|
|
314
|
+
|
|
315
|
+
- `pyproject.toml`
|
|
316
|
+
- `src/tunacode/constants.py` (APP_VERSION)
|
|
317
|
+
|
|
318
|
+
2. **Commit and tag:**
|
|
319
|
+
|
|
320
|
+
```bash
|
|
321
|
+
git add pyproject.toml src/tunacode/constants.py
|
|
322
|
+
git commit -m "chore: bump version to X.Y.Z"
|
|
323
|
+
git tag vX.Y.Z
|
|
324
|
+
git push origin vX.Y.Z
|
|
325
|
+
```
|
|
326
|
+
|
|
327
|
+
3. **Create release:**
|
|
328
|
+
```bash
|
|
329
|
+
gh release create vX.Y.Z --title "vX.Y.Z" --notes "Release notes"
|
|
330
|
+
```
|
|
331
|
+
|
|
332
|
+
</details>
|
|
333
|
+
|
|
334
|
+
### Commit Convention
|
|
335
|
+
|
|
336
|
+
Following [Conventional Commits](https://www.conventionalcommits.org/):
|
|
337
|
+
|
|
338
|
+
- `feat:` New features
|
|
339
|
+
- `fix:` Bug fixes
|
|
340
|
+
- `docs:` Documentation
|
|
341
|
+
- `style:` Code formatting
|
|
342
|
+
- `refactor:` Code refactoring
|
|
343
|
+
- `test:` Tests
|
|
344
|
+
- `chore:` Maintenance
|
|
345
|
+
|
|
346
|
+
---
|
|
347
|
+
|
|
348
|
+
## Links
|
|
349
|
+
|
|
350
|
+
<div align="center">
|
|
351
|
+
|
|
352
|
+
[](https://pypi.org/project/tunacode-cli/)
|
|
353
|
+
[](https://github.com/alchemiststudiosDOTai/tunacode)
|
|
354
|
+
[](https://github.com/alchemiststudiosDOTai/tunacode/issues)
|
|
355
|
+
|
|
356
|
+
</div>
|
|
357
|
+
|
|
358
|
+
---
|
|
359
|
+
|
|
360
|
+
## License
|
|
361
|
+
|
|
362
|
+
MIT License - see [LICENSE](LICENSE) file for details.
|
|
363
|
+
|
|
364
|
+
## Acknowledgments
|
|
365
|
+
|
|
366
|
+
TunaCode is a fork of [sidekick-cli](https://github.com/geekforbrains/sidekick-cli). Special thanks to the sidekick-cli team for creating the foundation that made TunaCode possible.
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
tunacode/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
2
|
+
tunacode/constants.py,sha256=6sdwSsDllPvvZ7l2yGQLoOigIZBIMND34qa_01TWtH0,4235
|
|
3
|
+
tunacode/context.py,sha256=0ttsxxLAyD4pSoxw7S-pyzor0JUkhOFZh96aAf4Kqsg,2634
|
|
4
|
+
tunacode/exceptions.py,sha256=RFUH8wOsWEvSPGIYM2exr4t47YkEyZt4Fr-DfTo6_JY,2647
|
|
5
|
+
tunacode/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
6
|
+
tunacode/setup.py,sha256=4LIlYtDk5FzBoJzC9Uw_9VmVUkZ8ojmeNdrxspBa2BU,2016
|
|
7
|
+
tunacode/types.py,sha256=5mMJDgFqVcKzhtHh9unPISBFqkeNje6KISGUpRkqRjY,7146
|
|
8
|
+
tunacode/cli/__init__.py,sha256=zgs0UbAck8hfvhYsWhWOfBe5oK09ug2De1r4RuQZREA,55
|
|
9
|
+
tunacode/cli/commands.py,sha256=6q2gRN9uSd_BQTBUQK7QGpFUR7i0QtBTs5n8BPHkFCo,18473
|
|
10
|
+
tunacode/cli/main.py,sha256=BXsWm4b-XtmnJBh-9g4X0Dt5y6jNR-mIugzw9jPigNM,1721
|
|
11
|
+
tunacode/cli/repl.py,sha256=oQ7w7SQ8TXi8V6fmxxy7WDpCWJueZUtIUBa14-yPfvk,9115
|
|
12
|
+
tunacode/configuration/__init__.py,sha256=MbVXy8bGu0yKehzgdgZ_mfWlYGvIdb1dY2Ly75nfuPE,17
|
|
13
|
+
tunacode/configuration/defaults.py,sha256=6CQbXUslZLShZCyRqak_Hz8d889jPxfB-QQ26qnIuUg,683
|
|
14
|
+
tunacode/configuration/models.py,sha256=SclALgdHhL1ffxNMlSamTVA_EJvxlcTbtqdHJ502n5o,3781
|
|
15
|
+
tunacode/configuration/settings.py,sha256=4vXHiRuhyU6vW1nvtxzxEMSnT5E0mhZ0RwtAiKtGcq8,991
|
|
16
|
+
tunacode/core/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
17
|
+
tunacode/core/state.py,sha256=0U_WU92yn5EQ27BLlHIkNIJJqjLMNHKNYSoba1rQqbQ,1376
|
|
18
|
+
tunacode/core/tool_handler.py,sha256=OKx7jM8pml6pSEnoARu33_uBY8awJBqvhbVeBn6T4ow,1804
|
|
19
|
+
tunacode/core/agents/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
20
|
+
tunacode/core/agents/main.py,sha256=ZGB-EUQ7ow-m3ohSAmfPZ5UN9XC2Gbz40rKjsZsWwrA,4669
|
|
21
|
+
tunacode/core/setup/__init__.py,sha256=jlveyriTXRcnoBLU6_TJ7Z-3E6EXjT9L5GD1vW4dei0,427
|
|
22
|
+
tunacode/core/setup/agent_setup.py,sha256=65FVtta4xE9Dg_rDgVBsUkIHsAjXEavhmvAy5eFS5IA,1411
|
|
23
|
+
tunacode/core/setup/base.py,sha256=x9uYOITulrf4faP70NPTNBPb-wW1ZJGmcjAe0Sk5slk,961
|
|
24
|
+
tunacode/core/setup/config_setup.py,sha256=xeEZu-xDFRwbCONshS0NHsc3eQH1IxpGaUC_wuDjQYo,11163
|
|
25
|
+
tunacode/core/setup/coordinator.py,sha256=v_zJIPCGlJWEApY5I2S7VR5uKAQe0TVn5zI-NYq2m_c,1653
|
|
26
|
+
tunacode/core/setup/environment_setup.py,sha256=c371l9ePPmI-3I4NCJVu3iQg_tgFZz_X7qWbc_Lld_k,2234
|
|
27
|
+
tunacode/core/setup/git_safety_setup.py,sha256=1NuzSASi0b69wQRpcOgINKklGnq34Xh3itm_PEpjDus,7238
|
|
28
|
+
tunacode/core/setup/undo_setup.py,sha256=uHy7YWXPnxQ-b_36SNKtMZNyDR_u-p4OPDARHAgp6Lo,1179
|
|
29
|
+
tunacode/prompts/system.txt,sha256=6ecousLK6KvRj6wzIVyzRE7OPQVC5n7P6ceSbtmmaZQ,3207
|
|
30
|
+
tunacode/services/__init__.py,sha256=w_E8QK6RnvKSvU866eDe8BCRV26rAm4d3R-Yg06OWCU,19
|
|
31
|
+
tunacode/services/mcp.py,sha256=R48X73KQjQ9vwhBrtbWHSBl-4K99QXmbIhh5J_1Gezo,3046
|
|
32
|
+
tunacode/services/undo_service.py,sha256=lb2IlSv7bMDOOz72iVAiAy-0U49T1MsCO9bhhNhdzww,7783
|
|
33
|
+
tunacode/tools/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
34
|
+
tunacode/tools/base.py,sha256=5IXKgiHVnV7pPgWTiT0mhFLy2dA2vuryy8Ri_CHsZBY,8936
|
|
35
|
+
tunacode/tools/read_file.py,sha256=QW97pPVcHvNJk48iPSwzOZ9Dbq_Ce8lQ7W0F82SXi7k,3051
|
|
36
|
+
tunacode/tools/run_command.py,sha256=dspFV71g98gbOQV6CT9LsEoytQ_4zyVqqZD99zf__OY,3796
|
|
37
|
+
tunacode/tools/update_file.py,sha256=oG7ELWX3uHboDs2BPy8hfZb6hh0bQOav-LlWIRynMO4,4145
|
|
38
|
+
tunacode/tools/write_file.py,sha256=bV-Xz_Wy_SaCqU78PcxP2ttScfH7F7GGnvs4P7EDuAM,2821
|
|
39
|
+
tunacode/ui/__init__.py,sha256=aRNE2pS50nFAX6y--rSGMNYwhz905g14gRd6g4BolYU,13
|
|
40
|
+
tunacode/ui/completers.py,sha256=mWnZmm8tjTuIgDq7Y8znwjKEF_ZAvrkMKPx1DEdqLJQ,5060
|
|
41
|
+
tunacode/ui/console.py,sha256=7ua1LaBP3ZCRHzV0SqVCkgNlgBuBcBTcvybRjWl5jew,1943
|
|
42
|
+
tunacode/ui/constants.py,sha256=NxegAWaoDaEa4gzNZ7p67M0ZsHJJxZMtf2bW8E5WeZE,421
|
|
43
|
+
tunacode/ui/decorators.py,sha256=I09tETtxPfcWdh1B3kEM0nJ8E6HvdBZAdYhRzYUa_p8,1901
|
|
44
|
+
tunacode/ui/input.py,sha256=IZovxw_-1zEJ-OXMdb0O0T-bqn7Eo09NFc6M6yq3fp0,2962
|
|
45
|
+
tunacode/ui/keybindings.py,sha256=uT23EYLLoso-b4ppN-RqbdYOYanGqMr5FKm8OphhhFs,701
|
|
46
|
+
tunacode/ui/lexers.py,sha256=3qFwogyS_3zlS0NDxbc4e_sPvNHylNdCVMjPIIp85go,1507
|
|
47
|
+
tunacode/ui/output.py,sha256=p9q5dTHaqvawtM2TTDi-mnIsAiY0WNMWcLF2pFQaFnM,3716
|
|
48
|
+
tunacode/ui/panels.py,sha256=Ju4eOOfrazPVjySiyEcXkame7IXHiBb2HZFWKl5Re48,6008
|
|
49
|
+
tunacode/ui/prompt_manager.py,sha256=i8LBDFalo72b9YP1-65X0v0DA62k-auSVEJMXXr31fs,4010
|
|
50
|
+
tunacode/ui/tool_ui.py,sha256=S5-k1HwRlSqiQ8shGQ_QYGXQbuzb6Pg7u3CTqZwffdQ,6533
|
|
51
|
+
tunacode/ui/validators.py,sha256=wkg-lQrP-Wjm5phUHKD3Mte8F1J3A2EjESQgPPtRcvQ,758
|
|
52
|
+
tunacode/utils/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
53
|
+
tunacode/utils/bm25.py,sha256=yq7KFWP3g_zIsjUV7l2hFPXYCzXyNQUInLU7u4qsc_4,1909
|
|
54
|
+
tunacode/utils/diff_utils.py,sha256=V9PM1Of0wvWNTVyw7iZYrNowFuRiKSyWiw5F39yRRYA,2394
|
|
55
|
+
tunacode/utils/file_utils.py,sha256=AXiAJ_idtlmXEi9pMvwtfPy9Ys3yK-F4K7qb_NpwonU,923
|
|
56
|
+
tunacode/utils/ripgrep.py,sha256=AXUs2FFt0A7KBV996deS8wreIlUzKOlAHJmwrcAr4No,583
|
|
57
|
+
tunacode/utils/system.py,sha256=FSoibTIH0eybs4oNzbYyufIiV6gb77QaeY2yGqW39AY,11381
|
|
58
|
+
tunacode/utils/text_utils.py,sha256=B9M1cuLTm_SSsr15WNHF6j7WdLWPvWzKZV0Lvfgdbjg,2458
|
|
59
|
+
tunacode/utils/user_configuration.py,sha256=uFrpSRTUf0CijZjw1rOp1sovqy1uyr0UNcn85S6jvdk,1790
|
|
60
|
+
tunacode_cli-0.0.10.dist-info/licenses/LICENSE,sha256=Btzdu2kIoMbdSp6OyCLupB1aRgpTCJ_szMimgEnpkkE,1056
|
|
61
|
+
tunacode_cli-0.0.10.dist-info/METADATA,sha256=jPpFb8CYOsphFyiT-stgLBMTHhtyQorUFCDIsdIM1xU,8705
|
|
62
|
+
tunacode_cli-0.0.10.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
|
|
63
|
+
tunacode_cli-0.0.10.dist-info/entry_points.txt,sha256=hbkytikj4dGu6rizPuAd_DGUPBGF191RTnhr9wdhORY,51
|
|
64
|
+
tunacode_cli-0.0.10.dist-info/top_level.txt,sha256=lKy2P6BWNi5XSA4DHFvyjQ14V26lDZctwdmhEJrxQbU,9
|
|
65
|
+
tunacode_cli-0.0.10.dist-info/RECORD,,
|
tunacode/cli/model_selector.py
DELETED
|
@@ -1,178 +0,0 @@
|
|
|
1
|
-
"""Interactive model selector with modern UI."""
|
|
2
|
-
|
|
3
|
-
from dataclasses import dataclass
|
|
4
|
-
from enum import Enum
|
|
5
|
-
from typing import Dict, List, Optional
|
|
6
|
-
|
|
7
|
-
from tunacode.configuration.models import ModelRegistry
|
|
8
|
-
from tunacode.types import ModelName
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
class ModelProvider(Enum):
|
|
12
|
-
"""Model providers with their display names."""
|
|
13
|
-
|
|
14
|
-
ANTHROPIC = ("anthropic", "Anthropic", "🤖")
|
|
15
|
-
OPENAI = ("openai", "OpenAI", "🧠")
|
|
16
|
-
GOOGLE = ("google-gla", "Google", "🌐")
|
|
17
|
-
OPENROUTER = ("openrouter", "OpenRouter", "🚀")
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
@dataclass
|
|
21
|
-
class ModelInfo:
|
|
22
|
-
"""Enhanced model information."""
|
|
23
|
-
|
|
24
|
-
id: ModelName
|
|
25
|
-
provider: ModelProvider
|
|
26
|
-
display_name: str
|
|
27
|
-
short_name: str
|
|
28
|
-
description: str
|
|
29
|
-
cost_tier: str # low, medium, high, premium
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
class ModelSelector:
|
|
33
|
-
"""Enhanced model selection with categorization and search."""
|
|
34
|
-
|
|
35
|
-
def __init__(self):
|
|
36
|
-
self.registry = ModelRegistry()
|
|
37
|
-
self.models = self._build_model_info()
|
|
38
|
-
|
|
39
|
-
def _build_model_info(self) -> List[ModelInfo]:
|
|
40
|
-
"""Build enhanced model information with metadata."""
|
|
41
|
-
models = []
|
|
42
|
-
|
|
43
|
-
# Model metadata mapping
|
|
44
|
-
model_metadata = {
|
|
45
|
-
# Anthropic models
|
|
46
|
-
"anthropic:claude-opus-4-20250514": (
|
|
47
|
-
"Claude Opus 4",
|
|
48
|
-
"opus-4",
|
|
49
|
-
"Most capable Claude model",
|
|
50
|
-
"high",
|
|
51
|
-
),
|
|
52
|
-
"anthropic:claude-sonnet-4-20250514": (
|
|
53
|
-
"Claude Sonnet 4",
|
|
54
|
-
"sonnet-4",
|
|
55
|
-
"Balanced performance",
|
|
56
|
-
"medium",
|
|
57
|
-
),
|
|
58
|
-
"anthropic:claude-3-7-sonnet-latest": (
|
|
59
|
-
"Claude 3.7 Sonnet",
|
|
60
|
-
"sonnet-3.7",
|
|
61
|
-
"Previous generation",
|
|
62
|
-
"medium",
|
|
63
|
-
),
|
|
64
|
-
# Google models
|
|
65
|
-
"google-gla:gemini-2.0-flash": (
|
|
66
|
-
"Gemini 2.0 Flash",
|
|
67
|
-
"flash-2.0",
|
|
68
|
-
"Fast and efficient",
|
|
69
|
-
"low",
|
|
70
|
-
),
|
|
71
|
-
"google-gla:gemini-2.5-flash-preview-05-20": (
|
|
72
|
-
"Gemini 2.5 Flash",
|
|
73
|
-
"flash-2.5",
|
|
74
|
-
"Latest preview",
|
|
75
|
-
"low",
|
|
76
|
-
),
|
|
77
|
-
"google-gla:gemini-2.5-pro-preview-05-06": (
|
|
78
|
-
"Gemini 2.5 Pro",
|
|
79
|
-
"pro-2.5",
|
|
80
|
-
"Most capable Gemini",
|
|
81
|
-
"medium",
|
|
82
|
-
),
|
|
83
|
-
# OpenAI models
|
|
84
|
-
"openai:gpt-4.1": ("GPT-4.1", "gpt-4.1", "Latest GPT-4", "medium"),
|
|
85
|
-
"openai:gpt-4.1-mini": ("GPT-4.1 Mini", "4.1-mini", "Efficient GPT-4", "low"),
|
|
86
|
-
"openai:gpt-4.1-nano": ("GPT-4.1 Nano", "4.1-nano", "Smallest GPT-4", "low"),
|
|
87
|
-
"openai:gpt-4o": ("GPT-4o", "gpt-4o", "Optimized GPT-4", "medium"),
|
|
88
|
-
"openai:o3": ("O3", "o3", "Advanced reasoning", "premium"),
|
|
89
|
-
"openai:o3-mini": ("O3 Mini", "o3-mini", "Efficient reasoning", "high"),
|
|
90
|
-
# OpenRouter models
|
|
91
|
-
"openrouter:mistralai/devstral-small": (
|
|
92
|
-
"Devstral Small",
|
|
93
|
-
"devstral",
|
|
94
|
-
"Code-focused",
|
|
95
|
-
"low",
|
|
96
|
-
),
|
|
97
|
-
"openrouter:codex-mini-latest": ("Codex Mini", "codex", "Code completion", "medium"),
|
|
98
|
-
"openrouter:o4-mini-high": ("O4 Mini High", "o4-high", "Enhanced O4", "high"),
|
|
99
|
-
"openrouter:o3": ("O3 (OpenRouter)", "o3-or", "O3 via OpenRouter", "premium"),
|
|
100
|
-
"openrouter:o4-mini": ("O4 Mini", "o4-mini", "Standard O4", "high"),
|
|
101
|
-
"openrouter:openai/gpt-4.1": (
|
|
102
|
-
"GPT-4.1 (OR)",
|
|
103
|
-
"gpt-4.1-or",
|
|
104
|
-
"GPT-4.1 via OpenRouter",
|
|
105
|
-
"medium",
|
|
106
|
-
),
|
|
107
|
-
"openrouter:openai/gpt-4.1-mini": (
|
|
108
|
-
"GPT-4.1 Mini (OR)",
|
|
109
|
-
"4.1-mini-or",
|
|
110
|
-
"GPT-4.1 Mini via OpenRouter",
|
|
111
|
-
"low",
|
|
112
|
-
),
|
|
113
|
-
}
|
|
114
|
-
|
|
115
|
-
for model_id in self.registry.list_model_ids():
|
|
116
|
-
provider = self._get_provider(model_id)
|
|
117
|
-
if provider and model_id in model_metadata:
|
|
118
|
-
display_name, short_name, description, cost_tier = model_metadata[model_id]
|
|
119
|
-
models.append(
|
|
120
|
-
ModelInfo(
|
|
121
|
-
id=model_id,
|
|
122
|
-
provider=provider,
|
|
123
|
-
display_name=display_name,
|
|
124
|
-
short_name=short_name,
|
|
125
|
-
description=description,
|
|
126
|
-
cost_tier=cost_tier,
|
|
127
|
-
)
|
|
128
|
-
)
|
|
129
|
-
|
|
130
|
-
return models
|
|
131
|
-
|
|
132
|
-
def _get_provider(self, model_id: str) -> Optional[ModelProvider]:
|
|
133
|
-
"""Get provider from model ID."""
|
|
134
|
-
for provider in ModelProvider:
|
|
135
|
-
if model_id.startswith(provider.value[0]):
|
|
136
|
-
return provider
|
|
137
|
-
return None
|
|
138
|
-
|
|
139
|
-
def get_models_by_provider(self) -> Dict[ModelProvider, List[ModelInfo]]:
|
|
140
|
-
"""Group models by provider."""
|
|
141
|
-
grouped = {provider: [] for provider in ModelProvider}
|
|
142
|
-
for model in self.models:
|
|
143
|
-
if model.provider:
|
|
144
|
-
grouped[model.provider].append(model)
|
|
145
|
-
return grouped
|
|
146
|
-
|
|
147
|
-
def find_model(self, query: str) -> Optional[ModelInfo]:
|
|
148
|
-
"""Find model by index, name, or fuzzy match."""
|
|
149
|
-
query = query.lower().strip()
|
|
150
|
-
|
|
151
|
-
# Try as index first
|
|
152
|
-
try:
|
|
153
|
-
index = int(query)
|
|
154
|
-
if 0 <= index < len(self.models):
|
|
155
|
-
return self.models[index]
|
|
156
|
-
except ValueError:
|
|
157
|
-
pass
|
|
158
|
-
|
|
159
|
-
# Exact match on ID
|
|
160
|
-
for model in self.models:
|
|
161
|
-
if model.id.lower() == query:
|
|
162
|
-
return model
|
|
163
|
-
|
|
164
|
-
# Match on short name
|
|
165
|
-
for model in self.models:
|
|
166
|
-
if model.short_name.lower() == query:
|
|
167
|
-
return model
|
|
168
|
-
|
|
169
|
-
# Fuzzy match on display name or short name
|
|
170
|
-
for model in self.models:
|
|
171
|
-
if query in model.display_name.lower() or query in model.short_name.lower():
|
|
172
|
-
return model
|
|
173
|
-
|
|
174
|
-
return None
|
|
175
|
-
|
|
176
|
-
def get_cost_emoji(self, cost_tier: str) -> str:
|
|
177
|
-
"""Get emoji representation of cost tier."""
|
|
178
|
-
return {"low": "💚", "medium": "💛", "high": "🧡", "premium": "❤️"}.get(cost_tier, "⚪")
|