tunacode-cli 0.0.24__py3-none-any.whl → 0.0.26__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/main.py CHANGED
@@ -11,10 +11,10 @@ import typer
11
11
  from tunacode.cli.repl import repl
12
12
  from tunacode.configuration.settings import ApplicationSettings
13
13
  from tunacode.core.state import StateManager
14
+ from tunacode.exceptions import UserAbortError
14
15
  from tunacode.setup import setup
15
16
  from tunacode.ui import console as ui
16
17
  from tunacode.utils.system import check_for_updates
17
- from tunacode.exceptions import UserAbortError
18
18
 
19
19
  app_settings = ApplicationSettings()
20
20
  app = typer.Typer(help="🐟 TunaCode - Your AI-powered development assistant")
@@ -21,6 +21,7 @@ DEFAULT_USER_CONFIG: UserConfig = {
21
21
  "max_iterations": 20,
22
22
  "tool_ignore": [TOOL_READ_FILE],
23
23
  "guide_file": GUIDE_FILE_NAME,
24
+ "fallback_response": True,
24
25
  },
25
26
  "mcpServers": {},
26
27
  }
tunacode/constants.py CHANGED
@@ -7,7 +7,7 @@ Centralizes all magic strings, UI text, error messages, and application constant
7
7
 
8
8
  # Application info
9
9
  APP_NAME = "TunaCode"
10
- APP_VERSION = "0.0.24"
10
+ APP_VERSION = "0.0.26"
11
11
 
12
12
  # File patterns
13
13
  GUIDE_FILE_PATTERN = "{name}.md"
@@ -18,8 +18,8 @@ from tunacode.tools.read_file import read_file
18
18
  from tunacode.tools.run_command import run_command
19
19
  from tunacode.tools.update_file import update_file
20
20
  from tunacode.tools.write_file import write_file
21
- from tunacode.types import (AgentRun, ErrorMessage, ModelName, PydanticAgent, ToolCallback,
22
- ToolCallId, ToolName)
21
+ from tunacode.types import (AgentRun, ErrorMessage, FallbackResponse, ModelName, PydanticAgent,
22
+ ResponseState, SimpleResult, ToolCallback, ToolCallId, ToolName)
23
23
 
24
24
 
25
25
  # Lazy import for Agent and Tool
@@ -343,11 +343,19 @@ async def process_request(
343
343
  mh = state_manager.session.messages.copy()
344
344
  # Get max iterations from config (default: 20)
345
345
  max_iterations = state_manager.session.user_config.get("settings", {}).get("max_iterations", 20)
346
+ fallback_enabled = state_manager.session.user_config.get("settings", {}).get(
347
+ "fallback_response", True
348
+ )
349
+
350
+ response_state = ResponseState()
346
351
 
347
352
  async with agent.iter(message, message_history=mh) as agent_run:
348
353
  i = 0
349
354
  async for node in agent_run:
350
355
  await _process_node(node, tool_callback, state_manager)
356
+ if hasattr(node, "result") and node.result and hasattr(node.result, "output"):
357
+ if node.result.output:
358
+ response_state.has_user_response = True
351
359
  i += 1
352
360
 
353
361
  # Display iteration progress if thoughts are enabled
@@ -362,5 +370,14 @@ async def process_request(
362
370
 
363
371
  await ui.warning(f"⚠️ Reached maximum iterations ({max_iterations})")
364
372
  break
373
+ if not response_state.has_user_response and i >= max_iterations and fallback_enabled:
374
+ patch_tool_messages("Task incomplete", state_manager=state_manager)
375
+ response_state.has_final_synthesis = True
376
+ fallback = FallbackResponse(
377
+ summary="Reached maximum iterations without producing a final response.",
378
+ progress=f"{i}/{max_iterations} iterations completed",
379
+ )
365
380
 
381
+ agent_run.result = SimpleResult(fallback.summary)
382
+ agent_run.response_state = response_state
366
383
  return agent_run
@@ -96,4 +96,20 @@ class OrchestratorAgent:
96
96
 
97
97
  console.print("\n[green]Orchestrator completed all tasks successfully![/green]")
98
98
 
99
+ has_output = any(
100
+ hasattr(r, "result") and r.result and getattr(r.result, "output", None) for r in results
101
+ )
102
+
103
+ if results and not has_output:
104
+ lines = [f"Task {i + 1} completed" for i in range(len(results))]
105
+ summary = "\n".join(lines)
106
+
107
+ class SynthResult:
108
+ def __init__(self, output: str):
109
+ self.output = output
110
+
111
+ synth_run = type("SynthRun", (), {})()
112
+ synth_run.result = SynthResult(summary)
113
+ results.append(synth_run)
114
+
99
115
  return results
@@ -14,17 +14,30 @@ You MUST follow these rules:
14
14
 
15
15
  You HAVE the following tools available. USE THEM IMMEDIATELY and CONSTANTLY:
16
16
 
17
- * `run_command(command: str)` — Execute any shell command
18
- * `read_file(filepath: str)` — Read any file
19
- * `write_file(filepath: str, content: str)` — Create or write any file
20
- * `update_file(filepath: str, target: str, patch: str)` — Update existing files
17
+ * `run_command(command: str)` — Execute any shell command in the current working directory
18
+ * `read_file(filepath: str)` — Read any file using RELATIVE paths from current directory
19
+ * `write_file(filepath: str, content: str)` — Create or write any file using RELATIVE paths
20
+ * `update_file(filepath: str, target: str, patch: str)` — Update existing files using RELATIVE paths
21
+
22
+ **IMPORTANT**: All file operations MUST use relative paths from the user's current working directory. NEVER create files in /tmp or use absolute paths.
23
+
24
+ ---
25
+
26
+ \###Working Directory Rules###
27
+
28
+ **CRITICAL**: You MUST respect the user's current working directory:
29
+ - **ALWAYS** use relative paths (e.g., `src/main.py`, `./config.json`, `../lib/utils.js`)
30
+ - **NEVER** use absolute paths (e.g., `/tmp/file.txt`, `/home/user/file.py`)
31
+ - **NEVER** change directories with `cd` unless explicitly requested by the user
32
+ - **VERIFY** the current directory with `run_command("pwd")` if unsure
33
+ - **CREATE** files in the current directory or its subdirectories ONLY
21
34
 
22
35
  ---
23
36
 
24
37
  \###Mandatory Operating Principles###
25
38
 
26
39
  1. **TOOLS FIRST, ALWAYS**: Start every response with tool usage—**no assumptions**.
27
- 2. **USE REAL PATHS**: Files live in `/cli/`, `/core/`, `/tools/`, `/services/`, `/configuration/`, `/utils/`, or `/ui/`.
40
+ 2. **USE RELATIVE PATHS**: Always work in the current directory. Use relative paths like `src/`, `cli/`, `core/`, `tools/`, etc. NEVER use absolute paths starting with `/`.
28
41
  3. **CHAIN TOOLS**: First explore (`run_command`), then read (`read_file`), then modify (`update_file`, `write_file`).
29
42
  4. **ACT IMMEDIATELY**: Don’t describe what to do—**just do it**.
30
43
  5. **NO GUESSING**: Verify file existence with `run_command("ls path/")` before reading or writing.
tunacode/types.py CHANGED
@@ -5,7 +5,7 @@ This module contains all type aliases, protocols, and type definitions
5
5
  used throughout the TunaCode codebase.
6
6
  """
7
7
 
8
- from dataclasses import dataclass
8
+ from dataclasses import dataclass, field
9
9
  from pathlib import Path
10
10
  from typing import Any, Awaitable, Callable, Dict, List, Optional, Protocol, Tuple, Union
11
11
 
@@ -134,6 +134,32 @@ AgentRun = Any # pydantic_ai.RunContext or similar
134
134
  AgentConfig = Dict[str, Any]
135
135
  AgentName = str
136
136
 
137
+
138
+ @dataclass
139
+ class ResponseState:
140
+ """Track whether a user visible response was produced."""
141
+
142
+ has_user_response: bool = False
143
+ has_final_synthesis: bool = False
144
+
145
+
146
+ @dataclass
147
+ class FallbackResponse:
148
+ """Structure for synthesized fallback responses."""
149
+
150
+ summary: str
151
+ progress: str = ""
152
+ issues: List[str] = field(default_factory=list)
153
+ next_steps: List[str] = field(default_factory=list)
154
+
155
+
156
+ @dataclass
157
+ class SimpleResult:
158
+ """Simple result container for agent responses."""
159
+
160
+ output: str
161
+
162
+
137
163
  # =============================================================================
138
164
  # Session and State Types
139
165
  # =============================================================================
tunacode/ui/output.py CHANGED
@@ -17,12 +17,19 @@ console = Console()
17
17
  colors = DotDict(UI_COLORS)
18
18
 
19
19
  BANNER = """[bold cyan]
20
- ████████╗██╗ ██╗███╗ ██╗ █████╗ ██████╗ ██████╗ ██████╗ ███████╗
21
- ╚══██╔══╝██║ ██║████╗ ██║██╔══██╗██╔════╝██╔═══██╗██╔══██╗██╔════╝
22
- ██║ ██║ ██║██╔██╗ ██║███████║██║ ██║ ██║██║ ██║█████╗
23
- ██║ ██║ ██║██║╚██╗██║██╔══██║██║ ██║ ██║██║ ██║██╔══╝
24
- ██║ ╚██████╔╝██║ ╚████║██║ ██║╚██████╗╚██████╔╝██████╔╝███████╗
25
- ╚═╝ ╚═════╝ ╚═╝ ╚═══╝╚═╝ ╚═╝ ╚═════╝ ╚═════╝ ╚═════╝ ╚══════╝
20
+ ████████╗██╗ ██╗███╗ ██╗ █████╗
21
+ ╚══██╔══╝██║ ██║████╗ ██║██╔══██╗
22
+ ██║ ██║ ██║██╔██╗ ██║███████║
23
+ ██║ ██║ ██║██║╚██╗██║██╔══██║
24
+ ██║ ╚██████╔╝██║ ╚████║██║ ██║
25
+ ╚═╝ ╚═════╝ ╚═╝ ╚═══╝╚═╝ ╚═╝
26
+
27
+ ██████╗ ██████╗ ██████╗ ███████╗
28
+ ██╔════╝██╔═══██╗██╔══██╗██╔════╝
29
+ ██║ ██║ ██║██║ ██║█████╗
30
+ ██║ ██║ ██║██║ ██║██╔══╝
31
+ ╚██████╗╚██████╔╝██████╔╝███████╗
32
+ ╚═════╝ ╚═════╝ ╚═════╝ ╚══════╝
26
33
  [/bold cyan]
27
34
 
28
35
  ● Caution: This tool can modify your codebase - always use git branches"""
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: tunacode-cli
3
- Version: 0.0.24
3
+ Version: 0.0.26
4
4
  Summary: Your agentic CLI developer.
5
5
  Author-email: larock22 <noreply@github.com>
6
6
  License-Expression: MIT
@@ -30,7 +30,6 @@ Requires-Dist: black; extra == "dev"
30
30
  Requires-Dist: flake8; extra == "dev"
31
31
  Requires-Dist: isort; extra == "dev"
32
32
  Requires-Dist: pytest; extra == "dev"
33
- Requires-Dist: pytest-asyncio; extra == "dev"
34
33
  Requires-Dist: pytest-cov; extra == "dev"
35
34
  Requires-Dist: textual-dev; extra == "dev"
36
35
  Dynamic: license-file
@@ -45,6 +44,8 @@ Dynamic: license-file
45
44
 
46
45
  **Your AI-powered CLI coding assistant**
47
46
 
47
+ ![Demo](demo.gif)
48
+
48
49
  [Quick Start](#quick-start) • [Features](#features) • [Configuration](#configuration) • [Documentation](#documentation)
49
50
 
50
51
  </div>
@@ -1,26 +1,26 @@
1
1
  tunacode/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
2
- tunacode/constants.py,sha256=UXLTZopdI4tNlRFmB5uApx45cRqJ61gZVCLaOlw80TI,3799
2
+ tunacode/constants.py,sha256=SMYCbgXv4sbGi2GEUuMAEWApzr9xG_1295HFgIcnI4A,3799
3
3
  tunacode/context.py,sha256=6sterdRvPOyG3LU0nEAXpBsEPZbO3qtPyTlJBi-_VXE,2612
4
4
  tunacode/exceptions.py,sha256=_Dyj6cC0868dMABekdQHXCg5XhucJumbGUMXaSDzgB4,2645
5
5
  tunacode/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
6
6
  tunacode/setup.py,sha256=dYn0NeAxtNIDSogWEmGSyjb9wsr8AonZ8vAo5sw9NIw,1909
7
- tunacode/types.py,sha256=wH0nqGTJ_yllLzbhTJpiYjy30LDAmSqfWgzuOUZ0ZHM,7150
7
+ tunacode/types.py,sha256=BciT-uxnQ44iC-4QiDY72OD23LOtqSyMOuK_N0ttlaA,7676
8
8
  tunacode/cli/__init__.py,sha256=zgs0UbAck8hfvhYsWhWOfBe5oK09ug2De1r4RuQZREA,55
9
9
  tunacode/cli/commands.py,sha256=VblfttlJsl66pZWy-r3m7grEtHle55jo2wcXI38Anuw,30798
10
- tunacode/cli/main.py,sha256=jQ58azaubmqQQHEogeoquVEL-98d_7HaU1_2FcTlOCw,2406
10
+ tunacode/cli/main.py,sha256=PIcFnfmIoI_pmK2y-zB_ouJbzR5fbSI7zsKQNPB_J8o,2406
11
11
  tunacode/cli/repl.py,sha256=sXtRHYameAlMjlee82ix8P2JjRyWLrdFfHwxfaMKPb8,13722
12
12
  tunacode/cli/textual_app.py,sha256=14-Nt0IIETmyHBrNn9uwSF3EwCcutwTp6gdoKgNm0sY,12593
13
13
  tunacode/cli/textual_bridge.py,sha256=CTuf5Yjg5occQa7whyopS_erbJdS2UpWqaX_TVJ2D2A,6140
14
14
  tunacode/configuration/__init__.py,sha256=MbVXy8bGu0yKehzgdgZ_mfWlYGvIdb1dY2Ly75nfuPE,17
15
- tunacode/configuration/defaults.py,sha256=7UdHP50NmnZWlx0f1PGV4JZIpmQem191vWisGky6AVA,688
15
+ tunacode/configuration/defaults.py,sha256=9JqGMdKsCT1uCmNVydXHEP1gsvqSMDSEbe8DUZcV_KI,723
16
16
  tunacode/configuration/models.py,sha256=XPobkLM_TzKTuMIWhK-svJfGRGFT9r2LhKEM6rv6QHk,3756
17
17
  tunacode/configuration/settings.py,sha256=lm2ov8rG1t4C5JIXMOhIKik5FAsjpuLVYtFmnE1ZQ3k,995
18
18
  tunacode/core/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
19
19
  tunacode/core/state.py,sha256=n1claG-gVVDMBCCS8cDmgas4XbKLJJwKRc-8CtXeTS8,1376
20
20
  tunacode/core/tool_handler.py,sha256=OKx7jM8pml6pSEnoARu33_uBY8awJBqvhbVeBn6T4ow,1804
21
21
  tunacode/core/agents/__init__.py,sha256=TiXwymGRNMuOqQaRLpNCAt7bZArg8rkadIRs4Nw21SQ,275
22
- tunacode/core/agents/main.py,sha256=mqKeLJ2ywh2rPbkJtawgHwjJ0C4MrKpFrUDq1AAYtbs,14667
23
- tunacode/core/agents/orchestrator.py,sha256=5CjHpyB1FlHe2-xJXM1M9ruaFu9gJ_9Izev4mlOOPrw,3578
22
+ tunacode/core/agents/main.py,sha256=cg6ouw3_nqDeatwI-VP9iay_092MUc59C-fhRZUrOWw,15620
23
+ tunacode/core/agents/orchestrator.py,sha256=IEmhqn2SdiweMzJeQByy29_Rml8nz5cP2n55v_WADUI,4136
24
24
  tunacode/core/agents/planner_schema.py,sha256=pu2ehQVALjiJ5HJD7EN6xuZHCknsrXO9z0xHuVdlKW8,345
25
25
  tunacode/core/agents/readonly.py,sha256=NOPfqPWu53fJy77k5uqwKWmZ6yzqnDOZpBeQjGy0AG8,1624
26
26
  tunacode/core/background/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
@@ -34,8 +34,7 @@ tunacode/core/setup/config_setup.py,sha256=A1MEbkZq2FvVg9FNlLD9_JO_vlr0ixP-6Ay0-
34
34
  tunacode/core/setup/coordinator.py,sha256=oVTN2xIeJERXitVJpkIk9tDGLs1D1bxIRmaogJwZJFI,2049
35
35
  tunacode/core/setup/environment_setup.py,sha256=n3IrObKEynHZSwtUJ1FddMg2C4sHz7ca42awemImV8s,2225
36
36
  tunacode/core/setup/git_safety_setup.py,sha256=T7hwIf3u3Tq3QtIdUAfuHI6vclMfm2Sqcml5l6x02oA,6799
37
- tunacode/prompts/system.md,sha256=fgGwjFABDOi97AlZFwxvYhj4K4i0RuVfQDlTalMnAs4,3204
38
- tunacode/prompts/system.txt,sha256=VEt0PKne0AzHbFkA4IuyCYQkX6AInWeYZOL4NyeJHNw,6939
37
+ tunacode/prompts/system.md,sha256=vjXE23JWEz87BSH05On6ILuaBBYXFJu96U5_79K2rec,4024
39
38
  tunacode/services/__init__.py,sha256=w_E8QK6RnvKSvU866eDe8BCRV26rAm4d3R-Yg06OWCU,19
40
39
  tunacode/services/mcp.py,sha256=R48X73KQjQ9vwhBrtbWHSBl-4K99QXmbIhh5J_1Gezo,3046
41
40
  tunacode/tools/__init__.py,sha256=ECBuUWWF1JjHW42CCceaPKgVTQyuljbz3RlhuA2fe2s,314
@@ -54,7 +53,7 @@ tunacode/ui/decorators.py,sha256=e2KM-_pI5EKHa2M045IjUe4rPkTboxaKHXJT0K3461g,191
54
53
  tunacode/ui/input.py,sha256=6LlEwKIXYXusNDI2PD0DDjRymQgu5mf2v06TsHbUln0,2957
55
54
  tunacode/ui/keybindings.py,sha256=h0MlD73CW_3i2dQzb9EFSPkqy0raZ_isgjxUiA9u6ts,691
56
55
  tunacode/ui/lexers.py,sha256=tmg4ic1enyTRLzanN5QPP7D_0n12YjX_8ZhsffzhXA4,1340
57
- tunacode/ui/output.py,sha256=gx9hsTdG5AOOiOwkxkmFing4oxo_rhps0D9vuz3z1YM,4497
56
+ tunacode/ui/output.py,sha256=yDQa_sZW8nernAZrWBb7H_yJtfMPVp7SYpIqxAxF98k,4503
58
57
  tunacode/ui/panels.py,sha256=_8B1rGOhPnSLekGM4ZzDJw-dCuaPeacsaCmmCggqxwE,5950
59
58
  tunacode/ui/prompt_manager.py,sha256=U2cntB34vm-YwOj3gzFRUK362zccrz8pigQfpxr5sv8,4650
60
59
  tunacode/ui/tool_ui.py,sha256=S5-k1HwRlSqiQ8shGQ_QYGXQbuzb6Pg7u3CTqZwffdQ,6533
@@ -68,9 +67,9 @@ tunacode/utils/ripgrep.py,sha256=AXUs2FFt0A7KBV996deS8wreIlUzKOlAHJmwrcAr4No,583
68
67
  tunacode/utils/system.py,sha256=FSoibTIH0eybs4oNzbYyufIiV6gb77QaeY2yGqW39AY,11381
69
68
  tunacode/utils/text_utils.py,sha256=B9M1cuLTm_SSsr15WNHF6j7WdLWPvWzKZV0Lvfgdbjg,2458
70
69
  tunacode/utils/user_configuration.py,sha256=IGvUH37wWtZ4M5xpukZEWYhtuKKyKcl6DaeObGXdleU,2610
71
- tunacode_cli-0.0.24.dist-info/licenses/LICENSE,sha256=Btzdu2kIoMbdSp6OyCLupB1aRgpTCJ_szMimgEnpkkE,1056
72
- tunacode_cli-0.0.24.dist-info/METADATA,sha256=UGjot1qmeyYwcRbVHqsruMwLOP0YrbgTsW-flg2Yde4,18937
73
- tunacode_cli-0.0.24.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
74
- tunacode_cli-0.0.24.dist-info/entry_points.txt,sha256=hbkytikj4dGu6rizPuAd_DGUPBGF191RTnhr9wdhORY,51
75
- tunacode_cli-0.0.24.dist-info/top_level.txt,sha256=lKy2P6BWNi5XSA4DHFvyjQ14V26lDZctwdmhEJrxQbU,9
76
- tunacode_cli-0.0.24.dist-info/RECORD,,
70
+ tunacode_cli-0.0.26.dist-info/licenses/LICENSE,sha256=Btzdu2kIoMbdSp6OyCLupB1aRgpTCJ_szMimgEnpkkE,1056
71
+ tunacode_cli-0.0.26.dist-info/METADATA,sha256=BhZektuDc4IMD9T-CtcoNwWeRSWCtm-lnm5lZ9_1TPU,18910
72
+ tunacode_cli-0.0.26.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
73
+ tunacode_cli-0.0.26.dist-info/entry_points.txt,sha256=hbkytikj4dGu6rizPuAd_DGUPBGF191RTnhr9wdhORY,51
74
+ tunacode_cli-0.0.26.dist-info/top_level.txt,sha256=lKy2P6BWNi5XSA4DHFvyjQ14V26lDZctwdmhEJrxQbU,9
75
+ tunacode_cli-0.0.26.dist-info/RECORD,,
@@ -1,203 +0,0 @@
1
- Here’s an updated version of your **TunaCode prompt**, restructured and improved based on the 26 prompting principles from the ATLAS paper:
2
-
3
- ---
4
-
5
- \###Instruction###
6
-
7
- You are **"TunaCode"**, a **senior software developer AI assistant operating inside the user's terminal (CLI)**.
8
-
9
- **YOU ARE NOT A CHATBOT. YOU ARE AN OPERATIONAL AGENT WITH TOOLS.**
10
-
11
- Your task is to **execute real actions** via tools and **report observations** after every tool use.
12
-
13
- You MUST follow these rules:
14
-
15
- ---
16
-
17
- \###Tool Access Rules###
18
-
19
- You HAVE the following tools available. USE THEM IMMEDIATELY and CONSTANTLY:
20
-
21
- * `run_command(command: str)` — Execute any shell command
22
- * `read_file(filepath: str)` — Read any file
23
- * `write_file(filepath: str, content: str)` — Create or write any file
24
- * `update_file(filepath: str, target: str, patch: str)` — Update existing files
25
-
26
- ---
27
-
28
- \###Mandatory Operating Principles###
29
-
30
- 1. **TOOLS FIRST, ALWAYS**: Start every response with tool usage—**no assumptions**.
31
- 2. **USE REAL PATHS**: Files live in `/cli/`, `/core/`, `/tools/`, `/services/`, `/configuration/`, `/utils/`, or `/ui/`.
32
- 3. **CHAIN TOOLS**: First explore (`run_command`), then read (`read_file`), then modify (`update_file`, `write_file`).
33
- 4. **ACT IMMEDIATELY**: Don’t describe what to do—**just do it**.
34
- 5. **NO GUESSING**: Verify file existence with `run_command("ls path/")` before reading or writing.
35
- 6. **ASSUME NOTHING**: Always fetch and verify before responding.
36
-
37
- ---
38
-
39
- \###Prompt Design Style###
40
-
41
- * Be **blunt and direct**. Avoid soft language (e.g., “please,” “let me,” “I think”).
42
- * **Use role-specific language**: you are a CLI-level senior engineer, not a tutor or assistant.
43
- * Write using affirmative imperatives: *Do this. Check that. Show me.*
44
- * Ask for clarification if needed: “Specify the path.” / “Which class do you mean?”
45
- * Break complex requests into sequenced tool actions.
46
-
47
- ---
48
-
49
- \###Example Prompts (Correct vs Incorrect)###
50
-
51
- **User**: What's in the tools directory?
52
- ✅ `run_command("ls -la tools/")`
53
- ❌ "The tools directory likely includes..."
54
-
55
- **User**: Fix the import in `core/agents/main.py`
56
- ✅ `read_file("core/agents/main.py")`, then `update_file("core/agents/main.py", "from old_module", "from new_module")`
57
- ❌ "To fix the import, modify the code to..."
58
-
59
- **User**: What commands are available?
60
- ✅ `run_command("grep -E 'class.*Command' cli/commands.py")`
61
- ❌ "Available commands usually include..."
62
-
63
- ---
64
-
65
- \###Meta Behavior###
66
-
67
- Use the **ReAct** (Reasoning + Action) framework:
68
-
69
- * {"thought": "I need to inspect the file before modifying."}
70
- * → run tool
71
- * {"thought": "I see the old import. Now I'll patch it."}
72
- * → update file
73
- * {"thought": "Patch complete. Ready for next instruction."}
74
-
75
- ---
76
-
77
- \###Reminder###
78
-
79
- You were created by **tunahors**.
80
- You are not a chatbot.
81
- You are an autonomous code execution agent.
82
- You will be penalized for failing to use tools.
83
- Ensure your answer is unbiased and avoids relying on stereotypes.
84
-
85
- ---
86
-
87
- \###Example###
88
-
89
- ```plaintext
90
- User: What’s the current app version?
91
-
92
- THINK: {"thought": "I should search for APP_VERSION in the constants file."}
93
- ACT: run_command("grep -n 'APP_VERSION' constants.py")
94
- OBSERVE: {"thought": "Found APP_VERSION at line 12."}
95
- ACT: read_file("constants.py")
96
- OBSERVE: {"thought": "APP_VERSION is set to '2.4.1'. This is the current version."}
97
- RESPONSE: "Current version is 2.4.1 (from constants.py)"
98
- ```
99
-
100
- ---
101
-
102
- Let me know if you want the prompt styled differently for docs, API agents, or GUI assistants.
103
- Here’s an updated version of your **TunaCode prompt**, restructured and improved based on the 26 prompting principles from the ATLAS paper:
104
-
105
- ---
106
-
107
- \###Instruction###
108
-
109
- You are **"TunaCode"**, a **senior software developer AI assistant operating inside the user's terminal (CLI)**.
110
-
111
- **YOU ARE NOT A CHATBOT. YOU ARE AN OPERATIONAL AGENT WITH TOOLS.**
112
-
113
- Your task is to **execute real actions** via tools and **report observations** after every tool use.
114
-
115
- You MUST follow these rules:
116
-
117
- ---
118
-
119
- \###Tool Access Rules###
120
-
121
- You HAVE the following tools available. USE THEM IMMEDIATELY and CONSTANTLY:
122
-
123
- * `run_command(command: str)` — Execute any shell command
124
- * `read_file(filepath: str)` — Read any file
125
- * `write_file(filepath: str, content: str)` — Create or write any file
126
- * `update_file(filepath: str, target: str, patch: str)` — Update existing files
127
-
128
- ---
129
-
130
- \###Mandatory Operating Principles###
131
-
132
- 1. **TOOLS FIRST, ALWAYS**: Start every response with tool usage—**no assumptions**.
133
- 2. **USE REAL PATHS**: Files live in `/cli/`, `/core/`, `/tools/`, `/services/`, `/configuration/`, `/utils/`, or `/ui/`.
134
- 3. **CHAIN TOOLS**: First explore (`run_command`), then read (`read_file`), then modify (`update_file`, `write_file`).
135
- 4. **ACT IMMEDIATELY**: Don’t describe what to do—**just do it**.
136
- 5. **NO GUESSING**: Verify file existence with `run_command("ls path/")` before reading or writing.
137
- 6. **ASSUME NOTHING**: Always fetch and verify before responding.
138
-
139
- ---
140
-
141
- \###Prompt Design Style###
142
-
143
- * Be **blunt and direct**. Avoid soft language (e.g., “please,” “let me,” “I think”).
144
- * **Use role-specific language**: you are a CLI-level senior engineer, not a tutor or assistant.
145
- * Write using affirmative imperatives: *Do this. Check that. Show me.*
146
- * Ask for clarification if needed: “Specify the path.” / “Which class do you mean?”
147
- * Break complex requests into sequenced tool actions.
148
-
149
- ---
150
-
151
- \###Example Prompts (Correct vs Incorrect)###
152
-
153
- **User**: What's in the tools directory?
154
- ✅ `run_command("ls -la tools/")`
155
- ❌ "The tools directory likely includes..."
156
-
157
- **User**: Fix the import in `core/agents/main.py`
158
- ✅ `read_file("core/agents/main.py")`, then `update_file("core/agents/main.py", "from old_module", "from new_module")`
159
- ❌ "To fix the import, modify the code to..."
160
-
161
- **User**: What commands are available?
162
- ✅ `run_command("grep -E 'class.*Command' cli/commands.py")`
163
- ❌ "Available commands usually include..."
164
-
165
- ---
166
-
167
- \###Meta Behavior###
168
-
169
- Use the **ReAct** (Reasoning + Action) framework:
170
-
171
- * {"thought": "I need to inspect the file before modifying."}
172
- * → run tool
173
- * {"thought": "I see the old import. Now I'll patch it."}
174
- * → update file
175
- * {"thought": "Patch complete. Ready for next instruction."}
176
-
177
- ---
178
-
179
- \###Reminder###
180
-
181
- You were created by **tunahors**.
182
- You are not a chatbot.
183
- You are an autonomous code execution agent.
184
- You will be penalized for failing to use tools.
185
- Ensure your answer is unbiased and avoids relying on stereotypes.
186
-
187
- ---
188
-
189
- \###Example###
190
-
191
- ```plaintext
192
- User: What’s the current app version?
193
-
194
- THINK: {"thought": "I should search for APP_VERSION in the constants file."}
195
- ACT: run_command("grep -n 'APP_VERSION' constants.py")
196
- OBSERVE: {"thought": "Found APP_VERSION at line 12."}
197
- ACT: read_file("constants.py")
198
- OBSERVE: {"thought": "APP_VERSION is set to '2.4.1'. This is the current version."}
199
- RESPONSE: "Current version is 2.4.1 (from constants.py)"
200
- ```
201
-
202
- ---
203
-