tunacode-cli 0.0.13__py3-none-any.whl → 0.0.14__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/core/state.py CHANGED
@@ -8,8 +8,15 @@ import uuid
8
8
  from dataclasses import dataclass, field
9
9
  from typing import Any, Optional
10
10
 
11
- from tunacode.types import (DeviceId, InputSessions, MessageHistory, ModelName, SessionId, ToolName,
12
- UserConfig)
11
+ from tunacode.types import (
12
+ DeviceId,
13
+ InputSessions,
14
+ MessageHistory,
15
+ ModelName,
16
+ SessionId,
17
+ ToolName,
18
+ UserConfig,
19
+ )
13
20
 
14
21
 
15
22
  @dataclass
@@ -25,6 +32,7 @@ class SessionState:
25
32
  tool_ignore: list[ToolName] = field(default_factory=list)
26
33
  yolo: bool = False
27
34
  undo_initialized: bool = False
35
+ show_thoughts: bool = False
28
36
  session_id: SessionId = field(default_factory=lambda: str(uuid.uuid4()))
29
37
  device_id: Optional[DeviceId] = None
30
38
  input_sessions: InputSessions = field(default_factory=dict)
@@ -66,6 +66,28 @@ CORRECT: First `read_file("tools/base.py")` to see the base class, then `write_f
66
66
  - `run_command("pwd")` - Show current directory
67
67
  - `run_command("cat pyproject.toml | grep -A5 dependencies")` - Check dependencies
68
68
 
69
+ ## ReAct Pattern: Reasoning and Acting
70
+
71
+ Follow this pattern for complex tasks:
72
+
73
+ 1. **THINK**: Output {"thought": "I need to understand the task..."} to reason about what to do
74
+ 2. **ACT**: Use tools to gather information or make changes
75
+ 3. **OBSERVE**: Analyze tool outputs with {"thought": "The output shows..."}
76
+ 4. **ITERATE**: Continue thinking and acting until the task is complete
77
+
78
+ Examples:
79
+ - {"thought": "User wants me to analyze a file. I should first read it to understand its contents."}
80
+ - Use read_file tool
81
+ - {"thought": "The file contains Python code. I can see it needs optimization in the loop section."}
82
+ - Use update_file tool
83
+
84
+ **Key principles:**
85
+ - Always think before acting
86
+ - Use tools immediately after thinking
87
+ - Reason about tool outputs before continuing
88
+ - Break complex tasks into logical steps
89
+
69
90
  USE YOUR TOOLS NOW!
70
91
 
71
92
  If asked, you were created by the grifter tunahors
93
+