tiny-agent-os 0.65__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.
Files changed (56) hide show
  1. tiny_agent_os-0.65/PKG-INFO +202 -0
  2. tiny_agent_os-0.65/README.md +176 -0
  3. tiny_agent_os-0.65/pyproject.toml +51 -0
  4. tiny_agent_os-0.65/setup.cfg +4 -0
  5. tiny_agent_os-0.65/setup.py +11 -0
  6. tiny_agent_os-0.65/test/test_cookbook_examples.py +58 -0
  7. tiny_agent_os-0.65/tiny_agent_os.egg-info/PKG-INFO +202 -0
  8. tiny_agent_os-0.65/tiny_agent_os.egg-info/SOURCES.txt +54 -0
  9. tiny_agent_os-0.65/tiny_agent_os.egg-info/dependency_links.txt +1 -0
  10. tiny_agent_os-0.65/tiny_agent_os.egg-info/entry_points.txt +2 -0
  11. tiny_agent_os-0.65/tiny_agent_os.egg-info/requires.txt +11 -0
  12. tiny_agent_os-0.65/tiny_agent_os.egg-info/top_level.txt +1 -0
  13. tiny_agent_os-0.65/tinyagent/__init__.py +71 -0
  14. tiny_agent_os-0.65/tinyagent/agent.py +954 -0
  15. tiny_agent_os-0.65/tinyagent/chat/__init__.py +12 -0
  16. tiny_agent_os-0.65/tinyagent/chat/chat_mode.py +291 -0
  17. tiny_agent_os-0.65/tinyagent/cli/__init__.py +16 -0
  18. tiny_agent_os-0.65/tinyagent/cli/colors.py +104 -0
  19. tiny_agent_os-0.65/tinyagent/cli/main.py +665 -0
  20. tiny_agent_os-0.65/tinyagent/cli/spinner.py +94 -0
  21. tiny_agent_os-0.65/tinyagent/config/__init__.py +14 -0
  22. tiny_agent_os-0.65/tinyagent/config/config.py +248 -0
  23. tiny_agent_os-0.65/tinyagent/decorators.py +187 -0
  24. tiny_agent_os-0.65/tinyagent/exceptions.py +85 -0
  25. tiny_agent_os-0.65/tinyagent/factory/__init__.py +18 -0
  26. tiny_agent_os-0.65/tinyagent/factory/agent_factory.py +439 -0
  27. tiny_agent_os-0.65/tinyagent/factory/dynamic_agent_factory.py +561 -0
  28. tiny_agent_os-0.65/tinyagent/factory/orchestrator.py +1514 -0
  29. tiny_agent_os-0.65/tinyagent/logging.py +97 -0
  30. tiny_agent_os-0.65/tinyagent/mcp/__init__.py +14 -0
  31. tiny_agent_os-0.65/tinyagent/mcp/manager.py +321 -0
  32. tiny_agent_os-0.65/tinyagent/tool.py +185 -0
  33. tiny_agent_os-0.65/tinyagent/tools/__init__.py +44 -0
  34. tiny_agent_os-0.65/tinyagent/tools/aider.py +122 -0
  35. tiny_agent_os-0.65/tinyagent/tools/anon_coder.py +296 -0
  36. tiny_agent_os-0.65/tinyagent/tools/boilerplate_tool.py +147 -0
  37. tiny_agent_os-0.65/tinyagent/tools/brave_search.py +104 -0
  38. tiny_agent_os-0.65/tinyagent/tools/business_deepsearch.py +797 -0
  39. tiny_agent_os-0.65/tinyagent/tools/codeagent_tool.py +217 -0
  40. tiny_agent_os-0.65/tinyagent/tools/content_processor.py +285 -0
  41. tiny_agent_os-0.65/tinyagent/tools/custom_text_browser.py +958 -0
  42. tiny_agent_os-0.65/tinyagent/tools/duckduckgo_search.py +153 -0
  43. tiny_agent_os-0.65/tinyagent/tools/enhanced_deepsearch.py +1589 -0
  44. tiny_agent_os-0.65/tinyagent/tools/external.py +303 -0
  45. tiny_agent_os-0.65/tinyagent/tools/file_manipulator.py +274 -0
  46. tiny_agent_os-0.65/tinyagent/tools/final_extractor_tool.py +249 -0
  47. tiny_agent_os-0.65/tinyagent/tools/llm_serializer.py +124 -0
  48. tiny_agent_os-0.65/tinyagent/tools/markdown_gen.py +300 -0
  49. tiny_agent_os-0.65/tinyagent/tools/ripgrep.py +136 -0
  50. tiny_agent_os-0.65/tinyagent/utils/__init__.py +13 -0
  51. tiny_agent_os-0.65/tinyagent/utils/json_parser.py +231 -0
  52. tiny_agent_os-0.65/tinyagent/utils/logging_utils.py +78 -0
  53. tiny_agent_os-0.65/tinyagent/utils/openrouter_request.py +120 -0
  54. tiny_agent_os-0.65/tinyagent/utils/serialization.py +185 -0
  55. tiny_agent_os-0.65/tinyagent/utils/structured_outputs.py +126 -0
  56. tiny_agent_os-0.65/tinyagent/utils/type_converter.py +134 -0
@@ -0,0 +1,202 @@
1
+ Metadata-Version: 2.4
2
+ Name: tiny_agent_os
3
+ Version: 0.65
4
+ Summary: A streamlined framework for building powerful LLM-powered agents
5
+ Author-email: tinyagent <contact@example.com>
6
+ License: MIT
7
+ Project-URL: Homepage, https://github.com/tinyagent/tinyagent
8
+ Project-URL: Bug Tracker, https://github.com/tinyagent/tinyagent/issues
9
+ Classifier: Programming Language :: Python :: 3
10
+ Classifier: License :: OSI Approved :: MIT License
11
+ Classifier: Operating System :: OS Independent
12
+ Classifier: Topic :: Scientific/Engineering :: Artificial Intelligence
13
+ Requires-Python: >=3.8
14
+ Description-Content-Type: text/markdown
15
+ Requires-Dist: python-dotenv>=1.0.0
16
+ Requires-Dist: requests>=2.31.0
17
+ Requires-Dist: openai>=1.0.0
18
+ Requires-Dist: pyyaml>=6.0.1
19
+ Requires-Dist: jinja2>=3.1.2
20
+ Requires-Dist: click>=8.1.6
21
+ Requires-Dist: rich>=13.7.1
22
+ Requires-Dist: jsonschema>=4.10.3
23
+ Requires-Dist: typing-extensions>=4.10.0
24
+ Requires-Dist: colorama>=0.4.6
25
+ Requires-Dist: regex>=2023.0.0
26
+
27
+ # tinyAgent 🤖
28
+
29
+ A streamlined framework for building powerful LLM-powered agents that can solve complex tasks through tool execution, orchestration, and dynamic capability creation.
30
+
31
+ **Made by (x) @tunahorse21 | A product of alchemiststudios.ai**
32
+
33
+ > **Heads Up**: tinyAgent is in BETA until V1. It's working but still evolving!
34
+ > While I can't guarantee it's 100% bug-free, I'm actively improving it whenever I can between my day job and business.
35
+ > Found something that could be better? Show off your skills and open an issue with a fix: I'd genuinely appreciate it!
36
+
37
+ ![tinyAgent Logo](tintAgentLogo.png)
38
+
39
+ ```
40
+ __ .__ _____ __
41
+ _/ |_|__| ____ ___.__. / _ \ ____ ____ _____/ |_
42
+ \ __\ |/ < | |/ /_\ \ / ___\_/ __ \ / \ __\
43
+ | | | | | \___ / | \/ /_/ > ___/| | \ |
44
+ |__| |__|___| / ____\____|__ /\___ / \___ >___| /__|
45
+ \/\/ \//_____/ \/ \/
46
+ ```
47
+
48
+ ### Installation
49
+
50
+ ```bash
51
+ # Clone the repository
52
+ git clone https://github.com/alchemiststudiosDOTai/tinyAgent.git
53
+
54
+ cd tinyagent
55
+
56
+ # Option 1: For Linux users, run the installation script
57
+ chmod +x install/linuxInstall.sh && ./install/linuxInstall.sh
58
+
59
+ # Option 2: Manual installation
60
+ # Create a virtual environment (recommended)
61
+ python3 -m venv .venv
62
+
63
+ # Activate the virtual environment
64
+ # On macOS/Linux
65
+ source .venv/bin/activate
66
+ # On Windows
67
+ .\.venv\Scripts\activate
68
+
69
+ # Install dependencies
70
+ # Option 1: Using UV (recommended - see INSTALL.md for details)
71
+ # Option 2: Using pip
72
+ pip install -r requirements.txt
73
+
74
+ # Set up required configuration files
75
+ # 1. Environment variables
76
+ cp .envexample .env
77
+ # Edit .env to add your API keys (especially OpenRouter)
78
+
79
+ # 2. Configuration file
80
+ cp exampleconfig.yml config.yml
81
+ # Edit config.yml to customize your settings
82
+ ```
83
+
84
+ ### Pip Installation
85
+
86
+ ```bash
87
+ # Simple pip installation
88
+ pip install tinyagent
89
+ ```
90
+
91
+ **Note:** The orchestrator component is currently being built and is in beta.
92
+
93
+ ---
94
+
95
+ ## Philosophy
96
+
97
+ 1. **Functions as Agents**
98
+ - You can turn **any function** into a **tool** or **agent**.
99
+ - This makes it easy to add new capabilities.
100
+
101
+ ```mermaid
102
+ flowchart LR
103
+ A["Python Function"] --> B["Tool"]
104
+ B --> C["Agent"]
105
+ C --> D["Result"]
106
+ ```
107
+
108
+ ![Function to Agent Flow](static/images/func_agent.png)
109
+
110
+ ```python
111
+ # Define a simple calculator function and turn it into a tool
112
+ @tool
113
+ def calculate_sum(a: int, b: int) -> int:
114
+ """Calculate the sum of two integers."""
115
+ return a + b
116
+
117
+ def main():
118
+ """Create a basic agent with a calculator tool."""
119
+ # One-liner: create agent with our tool directly
120
+ agent = AgentFactory.get_instance().create_agent(tools=[calculate_sum])
121
+ # Run the agent with a query
122
+ query = "calculate the sum of 5 and 3"
123
+ print(f"Running agent with query: '{query}'")
124
+ # you can also specify the expected type of the result
125
+ result = agent.run(query, expected_type=int)
126
+ print(f"Result: {result}")
127
+ print(f"Result Type: {type(result)}")
128
+ ```
129
+
130
+ 2. **Hierarchical Orchestration**
131
+ - You can **combine many agents** together.
132
+ - A **top-level agent** or **orchestrator** can **delegate tasks** to **specialized agents**.
133
+ - This helps solve **complex problems** by breaking them into parts.
134
+
135
+ ```mermaid
136
+ flowchart TD
137
+ O["Research Orchestrator"] --> A1["Web Search Agent"]
138
+ O --> A2["Summarizer Agent"]
139
+ O --> A3["Code Snippet Agent"]
140
+ ```
141
+
142
+ ---
143
+
144
+ ## Features
145
+
146
+ 1. **Modular Design**
147
+
148
+ - Tools are defined with `@tool` and easily integrated or swapped.
149
+
150
+ 2. **Flexible Agent Options**
151
+
152
+ - **Orchestrator**: Simple task execution.
153
+ - **AgentFactory**: Fine-tuned control.
154
+ - **DynamicAgentFactory**: Dynamic agent creation.
155
+
156
+ 3. **Centralized Setup**
157
+
158
+ - Factory pattern streamlines configuration and logging.
159
+
160
+ 4. **Robust Error Handling**
161
+
162
+ - Custom exceptions (e.g., `ToolError`) improve debugging.
163
+
164
+ 5. **Clean Code Structure**
165
+
166
+ - Agents handle logic; tools handle execution.
167
+
168
+ 6. **Versatile Interaction**
169
+
170
+ - Use `agent.execute_tool()` for precision or `agent.run()` for broader tasks.
171
+
172
+ 7. **Structured Output**
173
+ - Enforce JSON structure on LLM responses for consistent parsing
174
+ - Enable with `output.structured: true` in config.yml
175
+ - Compatible with OpenRouter's JSON schema validation
176
+
177
+ ---
178
+
179
+ ## Acknowledgments & Inspo
180
+
181
+ We'd like to thank the creators of these amazing projects that inspired TinyAgent:
182
+
183
+ - My Wife
184
+ - [HuggingFace SmoLAgents](https://github.com/huggingface/smolagents)
185
+ - [Aider-AI](https://github.com/Aider-AI/aider)
186
+ - [Kyon-eth](https://github.com/kyon-eth)
187
+ - [RA.Aid](https://github.com/ai-christianson/RA.Aid)
188
+
189
+ ---
190
+
191
+ ## Key Takeaways
192
+
193
+ - **tinyAgent** is perfect for scalable AI projects needing structured agent and tool management.
194
+ - It offers **extensibility**, **error handling**, and **logging**, but may be overkill for simple tasks.
195
+
196
+ _Important Note on Tools_:
197
+
198
+ The aider tool integrated in TinyAgent is extremely powerful but requires proper understanding to use effectively. It's highly configurable with many advanced features that can dramatically enhance productivity when used correctly.
199
+
200
+ **⚠️ We strongly recommend thoroughly learning aider before using it in any serious projects.**
201
+
202
+ Invest time in studying the documentation at https://aider.chat/ to understand its capabilities, configuration options, and best practices. This investment will pay off significantly in your development workflow.
@@ -0,0 +1,176 @@
1
+ # tinyAgent 🤖
2
+
3
+ A streamlined framework for building powerful LLM-powered agents that can solve complex tasks through tool execution, orchestration, and dynamic capability creation.
4
+
5
+ **Made by (x) @tunahorse21 | A product of alchemiststudios.ai**
6
+
7
+ > **Heads Up**: tinyAgent is in BETA until V1. It's working but still evolving!
8
+ > While I can't guarantee it's 100% bug-free, I'm actively improving it whenever I can between my day job and business.
9
+ > Found something that could be better? Show off your skills and open an issue with a fix: I'd genuinely appreciate it!
10
+
11
+ ![tinyAgent Logo](tintAgentLogo.png)
12
+
13
+ ```
14
+ __ .__ _____ __
15
+ _/ |_|__| ____ ___.__. / _ \ ____ ____ _____/ |_
16
+ \ __\ |/ < | |/ /_\ \ / ___\_/ __ \ / \ __\
17
+ | | | | | \___ / | \/ /_/ > ___/| | \ |
18
+ |__| |__|___| / ____\____|__ /\___ / \___ >___| /__|
19
+ \/\/ \//_____/ \/ \/
20
+ ```
21
+
22
+ ### Installation
23
+
24
+ ```bash
25
+ # Clone the repository
26
+ git clone https://github.com/alchemiststudiosDOTai/tinyAgent.git
27
+
28
+ cd tinyagent
29
+
30
+ # Option 1: For Linux users, run the installation script
31
+ chmod +x install/linuxInstall.sh && ./install/linuxInstall.sh
32
+
33
+ # Option 2: Manual installation
34
+ # Create a virtual environment (recommended)
35
+ python3 -m venv .venv
36
+
37
+ # Activate the virtual environment
38
+ # On macOS/Linux
39
+ source .venv/bin/activate
40
+ # On Windows
41
+ .\.venv\Scripts\activate
42
+
43
+ # Install dependencies
44
+ # Option 1: Using UV (recommended - see INSTALL.md for details)
45
+ # Option 2: Using pip
46
+ pip install -r requirements.txt
47
+
48
+ # Set up required configuration files
49
+ # 1. Environment variables
50
+ cp .envexample .env
51
+ # Edit .env to add your API keys (especially OpenRouter)
52
+
53
+ # 2. Configuration file
54
+ cp exampleconfig.yml config.yml
55
+ # Edit config.yml to customize your settings
56
+ ```
57
+
58
+ ### Pip Installation
59
+
60
+ ```bash
61
+ # Simple pip installation
62
+ pip install tinyagent
63
+ ```
64
+
65
+ **Note:** The orchestrator component is currently being built and is in beta.
66
+
67
+ ---
68
+
69
+ ## Philosophy
70
+
71
+ 1. **Functions as Agents**
72
+ - You can turn **any function** into a **tool** or **agent**.
73
+ - This makes it easy to add new capabilities.
74
+
75
+ ```mermaid
76
+ flowchart LR
77
+ A["Python Function"] --> B["Tool"]
78
+ B --> C["Agent"]
79
+ C --> D["Result"]
80
+ ```
81
+
82
+ ![Function to Agent Flow](static/images/func_agent.png)
83
+
84
+ ```python
85
+ # Define a simple calculator function and turn it into a tool
86
+ @tool
87
+ def calculate_sum(a: int, b: int) -> int:
88
+ """Calculate the sum of two integers."""
89
+ return a + b
90
+
91
+ def main():
92
+ """Create a basic agent with a calculator tool."""
93
+ # One-liner: create agent with our tool directly
94
+ agent = AgentFactory.get_instance().create_agent(tools=[calculate_sum])
95
+ # Run the agent with a query
96
+ query = "calculate the sum of 5 and 3"
97
+ print(f"Running agent with query: '{query}'")
98
+ # you can also specify the expected type of the result
99
+ result = agent.run(query, expected_type=int)
100
+ print(f"Result: {result}")
101
+ print(f"Result Type: {type(result)}")
102
+ ```
103
+
104
+ 2. **Hierarchical Orchestration**
105
+ - You can **combine many agents** together.
106
+ - A **top-level agent** or **orchestrator** can **delegate tasks** to **specialized agents**.
107
+ - This helps solve **complex problems** by breaking them into parts.
108
+
109
+ ```mermaid
110
+ flowchart TD
111
+ O["Research Orchestrator"] --> A1["Web Search Agent"]
112
+ O --> A2["Summarizer Agent"]
113
+ O --> A3["Code Snippet Agent"]
114
+ ```
115
+
116
+ ---
117
+
118
+ ## Features
119
+
120
+ 1. **Modular Design**
121
+
122
+ - Tools are defined with `@tool` and easily integrated or swapped.
123
+
124
+ 2. **Flexible Agent Options**
125
+
126
+ - **Orchestrator**: Simple task execution.
127
+ - **AgentFactory**: Fine-tuned control.
128
+ - **DynamicAgentFactory**: Dynamic agent creation.
129
+
130
+ 3. **Centralized Setup**
131
+
132
+ - Factory pattern streamlines configuration and logging.
133
+
134
+ 4. **Robust Error Handling**
135
+
136
+ - Custom exceptions (e.g., `ToolError`) improve debugging.
137
+
138
+ 5. **Clean Code Structure**
139
+
140
+ - Agents handle logic; tools handle execution.
141
+
142
+ 6. **Versatile Interaction**
143
+
144
+ - Use `agent.execute_tool()` for precision or `agent.run()` for broader tasks.
145
+
146
+ 7. **Structured Output**
147
+ - Enforce JSON structure on LLM responses for consistent parsing
148
+ - Enable with `output.structured: true` in config.yml
149
+ - Compatible with OpenRouter's JSON schema validation
150
+
151
+ ---
152
+
153
+ ## Acknowledgments & Inspo
154
+
155
+ We'd like to thank the creators of these amazing projects that inspired TinyAgent:
156
+
157
+ - My Wife
158
+ - [HuggingFace SmoLAgents](https://github.com/huggingface/smolagents)
159
+ - [Aider-AI](https://github.com/Aider-AI/aider)
160
+ - [Kyon-eth](https://github.com/kyon-eth)
161
+ - [RA.Aid](https://github.com/ai-christianson/RA.Aid)
162
+
163
+ ---
164
+
165
+ ## Key Takeaways
166
+
167
+ - **tinyAgent** is perfect for scalable AI projects needing structured agent and tool management.
168
+ - It offers **extensibility**, **error handling**, and **logging**, but may be overkill for simple tasks.
169
+
170
+ _Important Note on Tools_:
171
+
172
+ The aider tool integrated in TinyAgent is extremely powerful but requires proper understanding to use effectively. It's highly configurable with many advanced features that can dramatically enhance productivity when used correctly.
173
+
174
+ **⚠️ We strongly recommend thoroughly learning aider before using it in any serious projects.**
175
+
176
+ Invest time in studying the documentation at https://aider.chat/ to understand its capabilities, configuration options, and best practices. This investment will pay off significantly in your development workflow.
@@ -0,0 +1,51 @@
1
+ [build-system]
2
+ requires = ["setuptools>=42", "wheel"]
3
+ build-backend = "setuptools.build_meta"
4
+
5
+ [project]
6
+ name = "tiny_agent_os"
7
+ version = "0.65"
8
+ description = "A streamlined framework for building powerful LLM-powered agents"
9
+ requires-python = ">=3.8"
10
+ authors = [{name = "tinyagent", email = "contact@example.com"}]
11
+ readme = "README.md"
12
+ license = {text = "MIT"}
13
+ classifiers = [
14
+ "Programming Language :: Python :: 3",
15
+ "License :: OSI Approved :: MIT License",
16
+ "Operating System :: OS Independent",
17
+ "Topic :: Scientific/Engineering :: Artificial Intelligence",
18
+ ]
19
+
20
+ dependencies = [
21
+ "python-dotenv>=1.0.0",
22
+ "requests>=2.31.0",
23
+ "openai>=1.0.0",
24
+ "pyyaml>=6.0.1",
25
+ "jinja2>=3.1.2",
26
+ "click>=8.1.6",
27
+ "rich>=13.7.1",
28
+ "jsonschema>=4.10.3",
29
+ "typing-extensions>=4.10.0",
30
+ "colorama>=0.4.6",
31
+ "regex>=2023.0.0",
32
+ ]
33
+
34
+ [project.urls]
35
+ "Homepage" = "https://github.com/tinyagent/tinyagent"
36
+ "Bug Tracker" = "https://github.com/tinyagent/tinyagent/issues"
37
+
38
+ [project.scripts]
39
+ tinyagent = "tinyagent.main:main"
40
+
41
+ [tool.setuptools]
42
+ packages = [
43
+ "tinyagent",
44
+ "tinyagent.utils",
45
+ "tinyagent.tools",
46
+ "tinyagent.factory",
47
+ "tinyagent.chat",
48
+ "tinyagent.mcp",
49
+ "tinyagent.cli",
50
+ "tinyagent.config"
51
+ ]
@@ -0,0 +1,4 @@
1
+ [egg_info]
2
+ tag_build =
3
+ tag_date = 0
4
+
@@ -0,0 +1,11 @@
1
+ #!/usr/bin/env python
2
+ """Setup script for tinyagent.
3
+
4
+ This is a minimal setup.py file that defers to pyproject.toml for configuration.
5
+ It's provided for backward compatibility with older pip versions.
6
+ """
7
+
8
+ from setuptools import setup
9
+
10
+ if __name__ == "__main__":
11
+ setup()
@@ -0,0 +1,58 @@
1
+ import subprocess
2
+ import glob
3
+ import os
4
+ import pathlib
5
+ import sys
6
+
7
+ import pytest
8
+
9
+ COOKBOOK_DIR = pathlib.Path(__file__).parent.parent / "cookbook"
10
+ EXPECTED_DIR = COOKBOOK_DIR / "expected"
11
+
12
+ # Ensure expected directory exists
13
+ EXPECTED_DIR.mkdir(parents=True, exist_ok=True)
14
+
15
+ # We don't need to import the package directly for these tests
16
+ # as we're running the cookbook examples as separate processes
17
+
18
+ example_scripts = sorted(COOKBOOK_DIR.glob("*.py"))
19
+
20
+ @pytest.mark.parametrize("script_path", example_scripts)
21
+ def test_cookbook_example(script_path):
22
+ """Run cookbook example, capture output, compare or bootstrap expected output."""
23
+ # Run the script as a module to ensure imports work correctly
24
+ module_path = f"cookbook.{script_path.stem}"
25
+
26
+ # Use python -m to run the module
27
+ result = subprocess.run(
28
+ [sys.executable, "-m", module_path],
29
+ capture_output=True,
30
+ text=True,
31
+ timeout=120, # prevent hanging scripts
32
+ cwd=str(COOKBOOK_DIR.parent) # Set working directory to project root
33
+ )
34
+
35
+ # Fail if script errors
36
+ assert result.returncode == 0, (
37
+ f"Script {script_path.name} exited with code {result.returncode}\n"
38
+ f"STDOUT:\n{result.stdout}\n"
39
+ f"STDERR:\n{result.stderr}"
40
+ )
41
+
42
+ expected_file = EXPECTED_DIR / (script_path.stem + ".txt")
43
+
44
+ if not expected_file.exists():
45
+ # Bootstrap mode: save current output as expected
46
+ with open(expected_file, "w", encoding="utf-8") as f:
47
+ f.write(result.stdout)
48
+ # Pass the test and inform user
49
+ print(f"[BOOTSTRAP] Saved baseline expected output for {script_path.name}")
50
+ else:
51
+ with open(expected_file, "r", encoding="utf-8") as f:
52
+ expected_output = f.read()
53
+ # Compare outputs
54
+ assert result.stdout == expected_output, (
55
+ f"Output mismatch for {script_path.name}\n"
56
+ f"--- Expected ---\n{expected_output}\n"
57
+ f"--- Got ---\n{result.stdout}"
58
+ )