tunacode-cli 0.0.26__tar.gz → 0.0.28__tar.gz
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-0.0.28/PKG-INFO +121 -0
- tunacode_cli-0.0.28/README.md +85 -0
- {tunacode_cli-0.0.26 → tunacode_cli-0.0.28}/pyproject.toml +1 -1
- {tunacode_cli-0.0.26 → tunacode_cli-0.0.28}/src/tunacode/cli/commands.py +83 -4
- {tunacode_cli-0.0.26 → tunacode_cli-0.0.28}/src/tunacode/constants.py +1 -1
- {tunacode_cli-0.0.26 → tunacode_cli-0.0.28}/src/tunacode/core/agents/main.py +27 -3
- {tunacode_cli-0.0.26 → tunacode_cli-0.0.28}/src/tunacode/core/agents/orchestrator.py +5 -3
- {tunacode_cli-0.0.26 → tunacode_cli-0.0.28}/src/tunacode/ui/output.py +1 -1
- tunacode_cli-0.0.28/src/tunacode_cli.egg-info/PKG-INFO +121 -0
- tunacode_cli-0.0.26/PKG-INFO +0 -567
- tunacode_cli-0.0.26/README.md +0 -531
- tunacode_cli-0.0.26/src/tunacode_cli.egg-info/PKG-INFO +0 -567
- {tunacode_cli-0.0.26 → tunacode_cli-0.0.28}/CLAUDE.md +0 -0
- {tunacode_cli-0.0.26 → tunacode_cli-0.0.28}/LICENSE +0 -0
- {tunacode_cli-0.0.26 → tunacode_cli-0.0.28}/MANIFEST.in +0 -0
- {tunacode_cli-0.0.26 → tunacode_cli-0.0.28}/TUNACODE.md +0 -0
- {tunacode_cli-0.0.26 → tunacode_cli-0.0.28}/setup.cfg +0 -0
- {tunacode_cli-0.0.26 → tunacode_cli-0.0.28}/setup.py +0 -0
- {tunacode_cli-0.0.26 → tunacode_cli-0.0.28}/src/tunacode/__init__.py +0 -0
- {tunacode_cli-0.0.26 → tunacode_cli-0.0.28}/src/tunacode/cli/__init__.py +0 -0
- {tunacode_cli-0.0.26 → tunacode_cli-0.0.28}/src/tunacode/cli/main.py +0 -0
- {tunacode_cli-0.0.26 → tunacode_cli-0.0.28}/src/tunacode/cli/repl.py +0 -0
- {tunacode_cli-0.0.26 → tunacode_cli-0.0.28}/src/tunacode/cli/textual_app.py +0 -0
- {tunacode_cli-0.0.26 → tunacode_cli-0.0.28}/src/tunacode/cli/textual_bridge.py +0 -0
- {tunacode_cli-0.0.26 → tunacode_cli-0.0.28}/src/tunacode/configuration/__init__.py +0 -0
- {tunacode_cli-0.0.26 → tunacode_cli-0.0.28}/src/tunacode/configuration/defaults.py +0 -0
- {tunacode_cli-0.0.26 → tunacode_cli-0.0.28}/src/tunacode/configuration/models.py +0 -0
- {tunacode_cli-0.0.26 → tunacode_cli-0.0.28}/src/tunacode/configuration/settings.py +0 -0
- {tunacode_cli-0.0.26 → tunacode_cli-0.0.28}/src/tunacode/context.py +0 -0
- {tunacode_cli-0.0.26 → tunacode_cli-0.0.28}/src/tunacode/core/__init__.py +0 -0
- {tunacode_cli-0.0.26 → tunacode_cli-0.0.28}/src/tunacode/core/agents/__init__.py +0 -0
- {tunacode_cli-0.0.26 → tunacode_cli-0.0.28}/src/tunacode/core/agents/planner_schema.py +0 -0
- {tunacode_cli-0.0.26 → tunacode_cli-0.0.28}/src/tunacode/core/agents/readonly.py +0 -0
- {tunacode_cli-0.0.26 → tunacode_cli-0.0.28}/src/tunacode/core/background/__init__.py +0 -0
- {tunacode_cli-0.0.26 → tunacode_cli-0.0.28}/src/tunacode/core/background/manager.py +0 -0
- {tunacode_cli-0.0.26 → tunacode_cli-0.0.28}/src/tunacode/core/llm/__init__.py +0 -0
- {tunacode_cli-0.0.26 → tunacode_cli-0.0.28}/src/tunacode/core/llm/planner.py +0 -0
- {tunacode_cli-0.0.26 → tunacode_cli-0.0.28}/src/tunacode/core/setup/__init__.py +0 -0
- {tunacode_cli-0.0.26 → tunacode_cli-0.0.28}/src/tunacode/core/setup/agent_setup.py +0 -0
- {tunacode_cli-0.0.26 → tunacode_cli-0.0.28}/src/tunacode/core/setup/base.py +0 -0
- {tunacode_cli-0.0.26 → tunacode_cli-0.0.28}/src/tunacode/core/setup/config_setup.py +0 -0
- {tunacode_cli-0.0.26 → tunacode_cli-0.0.28}/src/tunacode/core/setup/coordinator.py +0 -0
- {tunacode_cli-0.0.26 → tunacode_cli-0.0.28}/src/tunacode/core/setup/environment_setup.py +0 -0
- {tunacode_cli-0.0.26 → tunacode_cli-0.0.28}/src/tunacode/core/setup/git_safety_setup.py +0 -0
- {tunacode_cli-0.0.26 → tunacode_cli-0.0.28}/src/tunacode/core/state.py +0 -0
- {tunacode_cli-0.0.26 → tunacode_cli-0.0.28}/src/tunacode/core/tool_handler.py +0 -0
- {tunacode_cli-0.0.26 → tunacode_cli-0.0.28}/src/tunacode/exceptions.py +0 -0
- {tunacode_cli-0.0.26 → tunacode_cli-0.0.28}/src/tunacode/prompts/system.md +0 -0
- {tunacode_cli-0.0.26 → tunacode_cli-0.0.28}/src/tunacode/py.typed +0 -0
- {tunacode_cli-0.0.26 → tunacode_cli-0.0.28}/src/tunacode/services/__init__.py +0 -0
- {tunacode_cli-0.0.26 → tunacode_cli-0.0.28}/src/tunacode/services/mcp.py +0 -0
- {tunacode_cli-0.0.26 → tunacode_cli-0.0.28}/src/tunacode/setup.py +0 -0
- {tunacode_cli-0.0.26 → tunacode_cli-0.0.28}/src/tunacode/tools/__init__.py +0 -0
- {tunacode_cli-0.0.26 → tunacode_cli-0.0.28}/src/tunacode/tools/base.py +0 -0
- {tunacode_cli-0.0.26 → tunacode_cli-0.0.28}/src/tunacode/tools/bash.py +0 -0
- {tunacode_cli-0.0.26 → tunacode_cli-0.0.28}/src/tunacode/tools/grep.py +0 -0
- {tunacode_cli-0.0.26 → tunacode_cli-0.0.28}/src/tunacode/tools/read_file.py +0 -0
- {tunacode_cli-0.0.26 → tunacode_cli-0.0.28}/src/tunacode/tools/run_command.py +0 -0
- {tunacode_cli-0.0.26 → tunacode_cli-0.0.28}/src/tunacode/tools/update_file.py +0 -0
- {tunacode_cli-0.0.26 → tunacode_cli-0.0.28}/src/tunacode/tools/write_file.py +0 -0
- {tunacode_cli-0.0.26 → tunacode_cli-0.0.28}/src/tunacode/types.py +0 -0
- {tunacode_cli-0.0.26 → tunacode_cli-0.0.28}/src/tunacode/ui/__init__.py +0 -0
- {tunacode_cli-0.0.26 → tunacode_cli-0.0.28}/src/tunacode/ui/completers.py +0 -0
- {tunacode_cli-0.0.26 → tunacode_cli-0.0.28}/src/tunacode/ui/console.py +0 -0
- {tunacode_cli-0.0.26 → tunacode_cli-0.0.28}/src/tunacode/ui/constants.py +0 -0
- {tunacode_cli-0.0.26 → tunacode_cli-0.0.28}/src/tunacode/ui/decorators.py +0 -0
- {tunacode_cli-0.0.26 → tunacode_cli-0.0.28}/src/tunacode/ui/input.py +0 -0
- {tunacode_cli-0.0.26 → tunacode_cli-0.0.28}/src/tunacode/ui/keybindings.py +0 -0
- {tunacode_cli-0.0.26 → tunacode_cli-0.0.28}/src/tunacode/ui/lexers.py +0 -0
- {tunacode_cli-0.0.26 → tunacode_cli-0.0.28}/src/tunacode/ui/panels.py +0 -0
- {tunacode_cli-0.0.26 → tunacode_cli-0.0.28}/src/tunacode/ui/prompt_manager.py +0 -0
- {tunacode_cli-0.0.26 → tunacode_cli-0.0.28}/src/tunacode/ui/tool_ui.py +0 -0
- {tunacode_cli-0.0.26 → tunacode_cli-0.0.28}/src/tunacode/ui/validators.py +0 -0
- {tunacode_cli-0.0.26 → tunacode_cli-0.0.28}/src/tunacode/utils/__init__.py +0 -0
- {tunacode_cli-0.0.26 → tunacode_cli-0.0.28}/src/tunacode/utils/bm25.py +0 -0
- {tunacode_cli-0.0.26 → tunacode_cli-0.0.28}/src/tunacode/utils/diff_utils.py +0 -0
- {tunacode_cli-0.0.26 → tunacode_cli-0.0.28}/src/tunacode/utils/file_utils.py +0 -0
- {tunacode_cli-0.0.26 → tunacode_cli-0.0.28}/src/tunacode/utils/import_cache.py +0 -0
- {tunacode_cli-0.0.26 → tunacode_cli-0.0.28}/src/tunacode/utils/ripgrep.py +0 -0
- {tunacode_cli-0.0.26 → tunacode_cli-0.0.28}/src/tunacode/utils/system.py +0 -0
- {tunacode_cli-0.0.26 → tunacode_cli-0.0.28}/src/tunacode/utils/text_utils.py +0 -0
- {tunacode_cli-0.0.26 → tunacode_cli-0.0.28}/src/tunacode/utils/user_configuration.py +0 -0
- {tunacode_cli-0.0.26 → tunacode_cli-0.0.28}/src/tunacode_cli.egg-info/SOURCES.txt +0 -0
- {tunacode_cli-0.0.26 → tunacode_cli-0.0.28}/src/tunacode_cli.egg-info/dependency_links.txt +0 -0
- {tunacode_cli-0.0.26 → tunacode_cli-0.0.28}/src/tunacode_cli.egg-info/entry_points.txt +0 -0
- {tunacode_cli-0.0.26 → tunacode_cli-0.0.28}/src/tunacode_cli.egg-info/requires.txt +0 -0
- {tunacode_cli-0.0.26 → tunacode_cli-0.0.28}/src/tunacode_cli.egg-info/top_level.txt +0 -0
- {tunacode_cli-0.0.26 → tunacode_cli-0.0.28}/tests/test_agent_initialization.py +0 -0
- {tunacode_cli-0.0.26 → tunacode_cli-0.0.28}/tests/test_architect_integration.py +0 -0
- {tunacode_cli-0.0.26 → tunacode_cli-0.0.28}/tests/test_architect_simple.py +0 -0
- {tunacode_cli-0.0.26 → tunacode_cli-0.0.28}/tests/test_background_manager.py +0 -0
- {tunacode_cli-0.0.26 → tunacode_cli-0.0.28}/tests/test_config_setup_async.py +0 -0
- {tunacode_cli-0.0.26 → tunacode_cli-0.0.28}/tests/test_fallback_responses.py +0 -0
- {tunacode_cli-0.0.26 → tunacode_cli-0.0.28}/tests/test_fast_glob_search.py +0 -0
- {tunacode_cli-0.0.26 → tunacode_cli-0.0.28}/tests/test_file_reference_expansion.py +0 -0
- {tunacode_cli-0.0.26 → tunacode_cli-0.0.28}/tests/test_json_tool_parsing.py +0 -0
- {tunacode_cli-0.0.26 → tunacode_cli-0.0.28}/tests/test_orchestrator_file_references.py +0 -0
- {tunacode_cli-0.0.26 → tunacode_cli-0.0.28}/tests/test_orchestrator_import.py +0 -0
- {tunacode_cli-0.0.26 → tunacode_cli-0.0.28}/tests/test_orchestrator_planning_visibility.py +0 -0
- {tunacode_cli-0.0.26 → tunacode_cli-0.0.28}/tests/test_react_thoughts.py +0 -0
- {tunacode_cli-0.0.26 → tunacode_cli-0.0.28}/tests/test_update_command.py +0 -0
|
@@ -0,0 +1,121 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: tunacode-cli
|
|
3
|
+
Version: 0.0.28
|
|
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: typer==0.15.3
|
|
23
|
+
Requires-Dist: prompt_toolkit==3.0.51
|
|
24
|
+
Requires-Dist: pydantic-ai[logfire]==0.2.6
|
|
25
|
+
Requires-Dist: pygments==2.19.1
|
|
26
|
+
Requires-Dist: rich==14.0.0
|
|
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
|
+
Requires-Dist: textual-dev; extra == "dev"
|
|
35
|
+
Dynamic: license-file
|
|
36
|
+
|
|
37
|
+
# TunaCode
|
|
38
|
+
|
|
39
|
+
<div align="center">
|
|
40
|
+
|
|
41
|
+
[](https://badge.fury.io/py/tunacode-cli)
|
|
42
|
+
[](https://www.python.org/downloads/)
|
|
43
|
+
[](https://opensource.org/licenses/MIT)
|
|
44
|
+
|
|
45
|
+
**AI-powered CLI coding assistant**
|
|
46
|
+
|
|
47
|
+

|
|
48
|
+
|
|
49
|
+
</div>
|
|
50
|
+
|
|
51
|
+
---
|
|
52
|
+
|
|
53
|
+
## Quick Install
|
|
54
|
+
|
|
55
|
+
```bash
|
|
56
|
+
# Option 1: One-line install (Linux/macOS)
|
|
57
|
+
wget -qO- https://raw.githubusercontent.com/alchemiststudiosDOTai/tunacode/master/scripts/install_linux.sh | bash
|
|
58
|
+
|
|
59
|
+
# Option 2: pip install
|
|
60
|
+
pip install tunacode-cli
|
|
61
|
+
```
|
|
62
|
+
|
|
63
|
+
## Configuration
|
|
64
|
+
|
|
65
|
+
Choose your AI provider and set your API key:
|
|
66
|
+
|
|
67
|
+
```bash
|
|
68
|
+
# OpenAI
|
|
69
|
+
tunacode --model "openai:gpt-4o" --key "sk-your-openai-key"
|
|
70
|
+
|
|
71
|
+
# Anthropic Claude
|
|
72
|
+
tunacode --model "anthropic:claude-3.5-sonnet" --key "sk-ant-your-anthropic-key"
|
|
73
|
+
|
|
74
|
+
# OpenRouter (100+ models)
|
|
75
|
+
tunacode --model "openrouter:openai/gpt-4o" --key "sk-or-your-openrouter-key"
|
|
76
|
+
```
|
|
77
|
+
|
|
78
|
+
Your config is saved to `~/.config/tunacode.json`
|
|
79
|
+
|
|
80
|
+
## Start Coding
|
|
81
|
+
|
|
82
|
+
```bash
|
|
83
|
+
tunacode
|
|
84
|
+
```
|
|
85
|
+
|
|
86
|
+
## Basic Commands
|
|
87
|
+
|
|
88
|
+
| Command | Description |
|
|
89
|
+
| ------- | ----------- |
|
|
90
|
+
| `/help` | Show all commands |
|
|
91
|
+
| `/model <provider:name>` | Switch model |
|
|
92
|
+
| `/clear` | Clear message history |
|
|
93
|
+
| `/compact` | Summarize conversation |
|
|
94
|
+
| `/branch <name>` | Create Git branch |
|
|
95
|
+
| `/yolo` | Skip confirmations |
|
|
96
|
+
| `!<command>` | Run shell command |
|
|
97
|
+
| `exit` | Exit TunaCode |
|
|
98
|
+
|
|
99
|
+
## Safety First
|
|
100
|
+
|
|
101
|
+
⚠️ **Important**: TunaCode can modify your codebase. Always:
|
|
102
|
+
- Use Git branches before making changes
|
|
103
|
+
- Review file modifications before confirming
|
|
104
|
+
- Keep backups of important work
|
|
105
|
+
|
|
106
|
+
## Documentation
|
|
107
|
+
|
|
108
|
+
- [**Features**](documentation/FEATURES.md) - All features, tools, and commands
|
|
109
|
+
- [**Advanced Configuration**](documentation/ADVANCED-CONFIG.md) - Provider setup, MCP, customization
|
|
110
|
+
- [**Architecture**](documentation/ARCHITECTURE.md) - Source code organization and design
|
|
111
|
+
- [**Development**](documentation/DEVELOPMENT.md) - Contributing and development setup
|
|
112
|
+
|
|
113
|
+
## Links
|
|
114
|
+
|
|
115
|
+
- [PyPI Package](https://pypi.org/project/tunacode-cli/)
|
|
116
|
+
- [GitHub Repository](https://github.com/alchemiststudiosDOTai/tunacode)
|
|
117
|
+
- [Report Issues](https://github.com/alchemiststudiosDOTai/tunacode/issues)
|
|
118
|
+
|
|
119
|
+
---
|
|
120
|
+
|
|
121
|
+
MIT License - see [LICENSE](LICENSE) file
|
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
# TunaCode
|
|
2
|
+
|
|
3
|
+
<div align="center">
|
|
4
|
+
|
|
5
|
+
[](https://badge.fury.io/py/tunacode-cli)
|
|
6
|
+
[](https://www.python.org/downloads/)
|
|
7
|
+
[](https://opensource.org/licenses/MIT)
|
|
8
|
+
|
|
9
|
+
**AI-powered CLI coding assistant**
|
|
10
|
+
|
|
11
|
+

|
|
12
|
+
|
|
13
|
+
</div>
|
|
14
|
+
|
|
15
|
+
---
|
|
16
|
+
|
|
17
|
+
## Quick Install
|
|
18
|
+
|
|
19
|
+
```bash
|
|
20
|
+
# Option 1: One-line install (Linux/macOS)
|
|
21
|
+
wget -qO- https://raw.githubusercontent.com/alchemiststudiosDOTai/tunacode/master/scripts/install_linux.sh | bash
|
|
22
|
+
|
|
23
|
+
# Option 2: pip install
|
|
24
|
+
pip install tunacode-cli
|
|
25
|
+
```
|
|
26
|
+
|
|
27
|
+
## Configuration
|
|
28
|
+
|
|
29
|
+
Choose your AI provider and set your API key:
|
|
30
|
+
|
|
31
|
+
```bash
|
|
32
|
+
# OpenAI
|
|
33
|
+
tunacode --model "openai:gpt-4o" --key "sk-your-openai-key"
|
|
34
|
+
|
|
35
|
+
# Anthropic Claude
|
|
36
|
+
tunacode --model "anthropic:claude-3.5-sonnet" --key "sk-ant-your-anthropic-key"
|
|
37
|
+
|
|
38
|
+
# OpenRouter (100+ models)
|
|
39
|
+
tunacode --model "openrouter:openai/gpt-4o" --key "sk-or-your-openrouter-key"
|
|
40
|
+
```
|
|
41
|
+
|
|
42
|
+
Your config is saved to `~/.config/tunacode.json`
|
|
43
|
+
|
|
44
|
+
## Start Coding
|
|
45
|
+
|
|
46
|
+
```bash
|
|
47
|
+
tunacode
|
|
48
|
+
```
|
|
49
|
+
|
|
50
|
+
## Basic Commands
|
|
51
|
+
|
|
52
|
+
| Command | Description |
|
|
53
|
+
| ------- | ----------- |
|
|
54
|
+
| `/help` | Show all commands |
|
|
55
|
+
| `/model <provider:name>` | Switch model |
|
|
56
|
+
| `/clear` | Clear message history |
|
|
57
|
+
| `/compact` | Summarize conversation |
|
|
58
|
+
| `/branch <name>` | Create Git branch |
|
|
59
|
+
| `/yolo` | Skip confirmations |
|
|
60
|
+
| `!<command>` | Run shell command |
|
|
61
|
+
| `exit` | Exit TunaCode |
|
|
62
|
+
|
|
63
|
+
## Safety First
|
|
64
|
+
|
|
65
|
+
⚠️ **Important**: TunaCode can modify your codebase. Always:
|
|
66
|
+
- Use Git branches before making changes
|
|
67
|
+
- Review file modifications before confirming
|
|
68
|
+
- Keep backups of important work
|
|
69
|
+
|
|
70
|
+
## Documentation
|
|
71
|
+
|
|
72
|
+
- [**Features**](documentation/FEATURES.md) - All features, tools, and commands
|
|
73
|
+
- [**Advanced Configuration**](documentation/ADVANCED-CONFIG.md) - Provider setup, MCP, customization
|
|
74
|
+
- [**Architecture**](documentation/ARCHITECTURE.md) - Source code organization and design
|
|
75
|
+
- [**Development**](documentation/DEVELOPMENT.md) - Contributing and development setup
|
|
76
|
+
|
|
77
|
+
## Links
|
|
78
|
+
|
|
79
|
+
- [PyPI Package](https://pypi.org/project/tunacode-cli/)
|
|
80
|
+
- [GitHub Repository](https://github.com/alchemiststudiosDOTai/tunacode)
|
|
81
|
+
- [Report Issues](https://github.com/alchemiststudiosDOTai/tunacode/issues)
|
|
82
|
+
|
|
83
|
+
---
|
|
84
|
+
|
|
85
|
+
MIT License - see [LICENSE](LICENSE) file
|
|
@@ -521,13 +521,92 @@ class CompactCommand(SimpleCommand):
|
|
|
521
521
|
await ui.error("Compact command not available - process_request not configured")
|
|
522
522
|
return
|
|
523
523
|
|
|
524
|
-
#
|
|
525
|
-
|
|
526
|
-
|
|
524
|
+
# Count current messages
|
|
525
|
+
original_count = len(context.state_manager.session.messages)
|
|
526
|
+
|
|
527
|
+
# Generate summary with output captured
|
|
528
|
+
summary_prompt = (
|
|
529
|
+
"Summarize the conversation so far in a concise paragraph, "
|
|
530
|
+
"focusing on the main topics discussed and any important context "
|
|
531
|
+
"that should be preserved."
|
|
527
532
|
)
|
|
528
|
-
await
|
|
533
|
+
result = await process_request(
|
|
534
|
+
summary_prompt,
|
|
535
|
+
context.state_manager,
|
|
536
|
+
output=False, # We'll handle the output ourselves
|
|
537
|
+
)
|
|
538
|
+
|
|
539
|
+
# Extract summary text from result
|
|
540
|
+
summary_text = ""
|
|
541
|
+
|
|
542
|
+
# First try: standard result structure
|
|
543
|
+
if (
|
|
544
|
+
result
|
|
545
|
+
and hasattr(result, "result")
|
|
546
|
+
and result.result
|
|
547
|
+
and hasattr(result.result, "output")
|
|
548
|
+
):
|
|
549
|
+
summary_text = result.result.output
|
|
550
|
+
|
|
551
|
+
# Second try: check messages for assistant response
|
|
552
|
+
if not summary_text:
|
|
553
|
+
messages = context.state_manager.session.messages
|
|
554
|
+
# Look through new messages in reverse order
|
|
555
|
+
for i in range(len(messages) - 1, original_count - 1, -1):
|
|
556
|
+
msg = messages[i]
|
|
557
|
+
# Handle ModelResponse objects
|
|
558
|
+
if hasattr(msg, "parts") and msg.parts:
|
|
559
|
+
for part in msg.parts:
|
|
560
|
+
if hasattr(part, "content") and part.content:
|
|
561
|
+
content = part.content
|
|
562
|
+
# Skip JSON thought objects
|
|
563
|
+
if content.strip().startswith('{"thought"'):
|
|
564
|
+
lines = content.split("\n")
|
|
565
|
+
# Find the actual summary after the JSON
|
|
566
|
+
for i, line in enumerate(lines):
|
|
567
|
+
if (
|
|
568
|
+
line.strip()
|
|
569
|
+
and not line.strip().startswith("{")
|
|
570
|
+
and not line.strip().endswith("}")
|
|
571
|
+
):
|
|
572
|
+
summary_text = "\n".join(lines[i:]).strip()
|
|
573
|
+
break
|
|
574
|
+
else:
|
|
575
|
+
summary_text = content
|
|
576
|
+
if summary_text:
|
|
577
|
+
break
|
|
578
|
+
# Handle dict-style messages
|
|
579
|
+
elif isinstance(msg, dict):
|
|
580
|
+
if msg.get("role") == "assistant" and msg.get("content"):
|
|
581
|
+
summary_text = msg["content"]
|
|
582
|
+
break
|
|
583
|
+
# Handle other message types
|
|
584
|
+
elif hasattr(msg, "content") and hasattr(msg, "role"):
|
|
585
|
+
if getattr(msg, "role", None) == "assistant":
|
|
586
|
+
summary_text = msg.content
|
|
587
|
+
break
|
|
588
|
+
|
|
589
|
+
if summary_text:
|
|
590
|
+
break
|
|
591
|
+
|
|
592
|
+
if not summary_text:
|
|
593
|
+
await ui.error("Failed to generate summary - no assistant response found")
|
|
594
|
+
return
|
|
595
|
+
|
|
596
|
+
# Display summary in a formatted panel
|
|
597
|
+
from tunacode.ui import panels
|
|
598
|
+
|
|
599
|
+
await panels.panel("Conversation Summary", summary_text, border_style="cyan")
|
|
600
|
+
|
|
601
|
+
# Show statistics
|
|
602
|
+
await ui.info(f"Current message count: {original_count}")
|
|
603
|
+
await ui.info("After compaction: 3 (summary + last 2 messages)")
|
|
604
|
+
|
|
605
|
+
# Truncate the conversation history
|
|
529
606
|
context.state_manager.session.messages = context.state_manager.session.messages[-2:]
|
|
530
607
|
|
|
608
|
+
await ui.success("Context history has been summarized and truncated.")
|
|
609
|
+
|
|
531
610
|
|
|
532
611
|
class UpdateCommand(SimpleCommand):
|
|
533
612
|
"""Update TunaCode to the latest version."""
|
|
@@ -370,6 +370,8 @@ async def process_request(
|
|
|
370
370
|
|
|
371
371
|
await ui.warning(f"⚠️ Reached maximum iterations ({max_iterations})")
|
|
372
372
|
break
|
|
373
|
+
|
|
374
|
+
# If we need to add a fallback response, create a wrapper
|
|
373
375
|
if not response_state.has_user_response and i >= max_iterations and fallback_enabled:
|
|
374
376
|
patch_tool_messages("Task incomplete", state_manager=state_manager)
|
|
375
377
|
response_state.has_final_synthesis = True
|
|
@@ -378,6 +380,28 @@ async def process_request(
|
|
|
378
380
|
progress=f"{i}/{max_iterations} iterations completed",
|
|
379
381
|
)
|
|
380
382
|
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
383
|
+
# Create a wrapper object that mimics AgentRun with the required attributes
|
|
384
|
+
class AgentRunWrapper:
|
|
385
|
+
def __init__(self, wrapped_run, fallback_result):
|
|
386
|
+
self._wrapped = wrapped_run
|
|
387
|
+
self.result = fallback_result
|
|
388
|
+
self.response_state = response_state
|
|
389
|
+
|
|
390
|
+
def __getattr__(self, name):
|
|
391
|
+
# Delegate all other attributes to the wrapped object
|
|
392
|
+
return getattr(self._wrapped, name)
|
|
393
|
+
|
|
394
|
+
return AgentRunWrapper(agent_run, SimpleResult(fallback.summary))
|
|
395
|
+
|
|
396
|
+
# For non-fallback cases, we still need to handle the response_state
|
|
397
|
+
# Create a minimal wrapper just to add response_state
|
|
398
|
+
class AgentRunWithState:
|
|
399
|
+
def __init__(self, wrapped_run):
|
|
400
|
+
self._wrapped = wrapped_run
|
|
401
|
+
self.response_state = response_state
|
|
402
|
+
|
|
403
|
+
def __getattr__(self, name):
|
|
404
|
+
# Delegate all other attributes to the wrapped object
|
|
405
|
+
return getattr(self._wrapped, name)
|
|
406
|
+
|
|
407
|
+
return AgentRunWithState(agent_run)
|
|
@@ -108,8 +108,10 @@ class OrchestratorAgent:
|
|
|
108
108
|
def __init__(self, output: str):
|
|
109
109
|
self.output = output
|
|
110
110
|
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
111
|
+
class SynthRun:
|
|
112
|
+
def __init__(self):
|
|
113
|
+
self.result = SynthResult(summary)
|
|
114
|
+
|
|
115
|
+
results.append(SynthRun())
|
|
114
116
|
|
|
115
117
|
return results
|
|
@@ -24,7 +24,7 @@ BANNER = """[bold cyan]
|
|
|
24
24
|
██║ ╚██████╔╝██║ ╚████║██║ ██║
|
|
25
25
|
╚═╝ ╚═════╝ ╚═╝ ╚═══╝╚═╝ ╚═╝
|
|
26
26
|
|
|
27
|
-
██████╗ ██████╗ ██████╗ ███████╗
|
|
27
|
+
██████╗ ██████╗ ██████╗ ███████╗ dev
|
|
28
28
|
██╔════╝██╔═══██╗██╔══██╗██╔════╝
|
|
29
29
|
██║ ██║ ██║██║ ██║█████╗
|
|
30
30
|
██║ ██║ ██║██║ ██║██╔══╝
|
|
@@ -0,0 +1,121 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: tunacode-cli
|
|
3
|
+
Version: 0.0.28
|
|
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: typer==0.15.3
|
|
23
|
+
Requires-Dist: prompt_toolkit==3.0.51
|
|
24
|
+
Requires-Dist: pydantic-ai[logfire]==0.2.6
|
|
25
|
+
Requires-Dist: pygments==2.19.1
|
|
26
|
+
Requires-Dist: rich==14.0.0
|
|
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
|
+
Requires-Dist: textual-dev; extra == "dev"
|
|
35
|
+
Dynamic: license-file
|
|
36
|
+
|
|
37
|
+
# TunaCode
|
|
38
|
+
|
|
39
|
+
<div align="center">
|
|
40
|
+
|
|
41
|
+
[](https://badge.fury.io/py/tunacode-cli)
|
|
42
|
+
[](https://www.python.org/downloads/)
|
|
43
|
+
[](https://opensource.org/licenses/MIT)
|
|
44
|
+
|
|
45
|
+
**AI-powered CLI coding assistant**
|
|
46
|
+
|
|
47
|
+

|
|
48
|
+
|
|
49
|
+
</div>
|
|
50
|
+
|
|
51
|
+
---
|
|
52
|
+
|
|
53
|
+
## Quick Install
|
|
54
|
+
|
|
55
|
+
```bash
|
|
56
|
+
# Option 1: One-line install (Linux/macOS)
|
|
57
|
+
wget -qO- https://raw.githubusercontent.com/alchemiststudiosDOTai/tunacode/master/scripts/install_linux.sh | bash
|
|
58
|
+
|
|
59
|
+
# Option 2: pip install
|
|
60
|
+
pip install tunacode-cli
|
|
61
|
+
```
|
|
62
|
+
|
|
63
|
+
## Configuration
|
|
64
|
+
|
|
65
|
+
Choose your AI provider and set your API key:
|
|
66
|
+
|
|
67
|
+
```bash
|
|
68
|
+
# OpenAI
|
|
69
|
+
tunacode --model "openai:gpt-4o" --key "sk-your-openai-key"
|
|
70
|
+
|
|
71
|
+
# Anthropic Claude
|
|
72
|
+
tunacode --model "anthropic:claude-3.5-sonnet" --key "sk-ant-your-anthropic-key"
|
|
73
|
+
|
|
74
|
+
# OpenRouter (100+ models)
|
|
75
|
+
tunacode --model "openrouter:openai/gpt-4o" --key "sk-or-your-openrouter-key"
|
|
76
|
+
```
|
|
77
|
+
|
|
78
|
+
Your config is saved to `~/.config/tunacode.json`
|
|
79
|
+
|
|
80
|
+
## Start Coding
|
|
81
|
+
|
|
82
|
+
```bash
|
|
83
|
+
tunacode
|
|
84
|
+
```
|
|
85
|
+
|
|
86
|
+
## Basic Commands
|
|
87
|
+
|
|
88
|
+
| Command | Description |
|
|
89
|
+
| ------- | ----------- |
|
|
90
|
+
| `/help` | Show all commands |
|
|
91
|
+
| `/model <provider:name>` | Switch model |
|
|
92
|
+
| `/clear` | Clear message history |
|
|
93
|
+
| `/compact` | Summarize conversation |
|
|
94
|
+
| `/branch <name>` | Create Git branch |
|
|
95
|
+
| `/yolo` | Skip confirmations |
|
|
96
|
+
| `!<command>` | Run shell command |
|
|
97
|
+
| `exit` | Exit TunaCode |
|
|
98
|
+
|
|
99
|
+
## Safety First
|
|
100
|
+
|
|
101
|
+
⚠️ **Important**: TunaCode can modify your codebase. Always:
|
|
102
|
+
- Use Git branches before making changes
|
|
103
|
+
- Review file modifications before confirming
|
|
104
|
+
- Keep backups of important work
|
|
105
|
+
|
|
106
|
+
## Documentation
|
|
107
|
+
|
|
108
|
+
- [**Features**](documentation/FEATURES.md) - All features, tools, and commands
|
|
109
|
+
- [**Advanced Configuration**](documentation/ADVANCED-CONFIG.md) - Provider setup, MCP, customization
|
|
110
|
+
- [**Architecture**](documentation/ARCHITECTURE.md) - Source code organization and design
|
|
111
|
+
- [**Development**](documentation/DEVELOPMENT.md) - Contributing and development setup
|
|
112
|
+
|
|
113
|
+
## Links
|
|
114
|
+
|
|
115
|
+
- [PyPI Package](https://pypi.org/project/tunacode-cli/)
|
|
116
|
+
- [GitHub Repository](https://github.com/alchemiststudiosDOTai/tunacode)
|
|
117
|
+
- [Report Issues](https://github.com/alchemiststudiosDOTai/tunacode/issues)
|
|
118
|
+
|
|
119
|
+
---
|
|
120
|
+
|
|
121
|
+
MIT License - see [LICENSE](LICENSE) file
|