supyagent 0.1.0__tar.gz → 0.2.1__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.
- {supyagent-0.1.0 → supyagent-0.2.1}/PKG-INFO +95 -32
- {supyagent-0.1.0 → supyagent-0.2.1}/README.md +94 -31
- {supyagent-0.1.0 → supyagent-0.2.1}/pyproject.toml +1 -1
- supyagent-0.2.1/scripts/release.sh +151 -0
- {supyagent-0.1.0 → supyagent-0.2.1}/supyagent/cli/main.py +251 -1
- {supyagent-0.1.0 → supyagent-0.2.1}/supyagent/core/__init__.py +3 -0
- supyagent-0.2.1/supyagent/core/config.py +352 -0
- supyagent-0.2.1/supyagent/default_tools/__init__.py +74 -0
- supyagent-0.2.1/supyagent/default_tools/files.py +439 -0
- supyagent-0.2.1/supyagent/default_tools/shell.py +217 -0
- supyagent-0.2.1/supypowers/__init__.py +6 -0
- supyagent-0.2.1/supypowers/files.py +439 -0
- supyagent-0.2.1/supypowers/shell.py +217 -0
- {supyagent-0.1.0 → supyagent-0.2.1}/.gitignore +0 -0
- {supyagent-0.1.0 → supyagent-0.2.1}/LICENSE +0 -0
- {supyagent-0.1.0 → supyagent-0.2.1}/agents/assistant.yaml +0 -0
- {supyagent-0.1.0 → supyagent-0.2.1}/agents/coder.yaml +0 -0
- {supyagent-0.1.0 → supyagent-0.2.1}/agents/planner.yaml +0 -0
- {supyagent-0.1.0 → supyagent-0.2.1}/agents/researcher.yaml +0 -0
- {supyagent-0.1.0 → supyagent-0.2.1}/agents/summarizer.yaml +0 -0
- {supyagent-0.1.0 → supyagent-0.2.1}/agents/writer.yaml +0 -0
- {supyagent-0.1.0 → supyagent-0.2.1}/plans/initial_plan.md +0 -0
- {supyagent-0.1.0 → supyagent-0.2.1}/sprints/README.md +0 -0
- {supyagent-0.1.0 → supyagent-0.2.1}/sprints/sprint_1_foundation.md +0 -0
- {supyagent-0.1.0 → supyagent-0.2.1}/sprints/sprint_2_sessions.md +0 -0
- {supyagent-0.1.0 → supyagent-0.2.1}/sprints/sprint_3_repl.md +0 -0
- {supyagent-0.1.0 → supyagent-0.2.1}/sprints/sprint_4_execution.md +0 -0
- {supyagent-0.1.0 → supyagent-0.2.1}/sprints/sprint_5_multiagent.md +0 -0
- {supyagent-0.1.0 → supyagent-0.2.1}/sprints/sprint_6_polish.md +0 -0
- {supyagent-0.1.0 → supyagent-0.2.1}/supyagent/__init__.py +0 -0
- {supyagent-0.1.0 → supyagent-0.2.1}/supyagent/__main__.py +0 -0
- {supyagent-0.1.0 → supyagent-0.2.1}/supyagent/cli/__init__.py +0 -0
- {supyagent-0.1.0 → supyagent-0.2.1}/supyagent/core/agent.py +0 -0
- {supyagent-0.1.0 → supyagent-0.2.1}/supyagent/core/context.py +0 -0
- {supyagent-0.1.0 → supyagent-0.2.1}/supyagent/core/credentials.py +0 -0
- {supyagent-0.1.0 → supyagent-0.2.1}/supyagent/core/delegation.py +0 -0
- {supyagent-0.1.0 → supyagent-0.2.1}/supyagent/core/executor.py +0 -0
- {supyagent-0.1.0 → supyagent-0.2.1}/supyagent/core/llm.py +0 -0
- {supyagent-0.1.0 → supyagent-0.2.1}/supyagent/core/registry.py +0 -0
- {supyagent-0.1.0 → supyagent-0.2.1}/supyagent/core/session_manager.py +0 -0
- {supyagent-0.1.0 → supyagent-0.2.1}/supyagent/core/tools.py +0 -0
- {supyagent-0.1.0 → supyagent-0.2.1}/supyagent/models/__init__.py +0 -0
- {supyagent-0.1.0 → supyagent-0.2.1}/supyagent/models/agent_config.py +0 -0
- {supyagent-0.1.0 → supyagent-0.2.1}/supyagent/models/session.py +0 -0
- {supyagent-0.1.0 → supyagent-0.2.1}/supyagent/utils/__init__.py +0 -0
- {supyagent-0.1.0 → supyagent-0.2.1}/supyagent/utils/paths.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: supyagent
|
|
3
|
-
Version: 0.1
|
|
3
|
+
Version: 0.2.1
|
|
4
4
|
Summary: LLM agents powered by supypowers - build AI agents with tool use, multi-agent orchestration, and secure credential management
|
|
5
5
|
Project-URL: Homepage, https://github.com/ergodic-ai/supyagent
|
|
6
6
|
Project-URL: Documentation, https://github.com/ergodic-ai/supyagent#readme
|
|
@@ -68,6 +68,12 @@ uv pip install supyagent
|
|
|
68
68
|
## Quick Start
|
|
69
69
|
|
|
70
70
|
```bash
|
|
71
|
+
# Initialize supyagent (sets up default tools)
|
|
72
|
+
supyagent init
|
|
73
|
+
|
|
74
|
+
# Set up your API key (stored securely)
|
|
75
|
+
supyagent config set ANTHROPIC_API_KEY
|
|
76
|
+
|
|
71
77
|
# Create your first agent
|
|
72
78
|
supyagent new myagent
|
|
73
79
|
|
|
@@ -133,39 +139,40 @@ supyagent plan "Build a Python library for data validation"
|
|
|
133
139
|
# The planner will delegate to specialist agents (coder, writer, researcher)
|
|
134
140
|
```
|
|
135
141
|
|
|
136
|
-
##
|
|
142
|
+
## Configuration
|
|
137
143
|
|
|
138
|
-
|
|
144
|
+
### Setting Up API Keys
|
|
139
145
|
|
|
140
|
-
|
|
141
|
-
name: researcher
|
|
142
|
-
description: An AI research assistant
|
|
143
|
-
type: interactive # or "execution"
|
|
146
|
+
Supyagent securely stores your LLM API keys so you don't need to export them every time:
|
|
144
147
|
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
148
|
+
```bash
|
|
149
|
+
# Interactive setup (recommended)
|
|
150
|
+
supyagent config set
|
|
151
|
+
# Shows a menu of common providers to choose from
|
|
149
152
|
|
|
150
|
-
|
|
151
|
-
|
|
153
|
+
# Set a specific key
|
|
154
|
+
supyagent config set ANTHROPIC_API_KEY
|
|
155
|
+
supyagent config set OPENAI_API_KEY
|
|
152
156
|
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
- "*" # Allow all tools
|
|
156
|
-
# or be specific:
|
|
157
|
-
# - "web:*" # All functions in web.py
|
|
158
|
-
# - "math:calc" # Specific function
|
|
159
|
-
deny:
|
|
160
|
-
- "dangerous:*" # Block specific tools
|
|
157
|
+
# Import from a .env file
|
|
158
|
+
supyagent config import .env
|
|
161
159
|
|
|
162
|
-
#
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
160
|
+
# Import only specific keys
|
|
161
|
+
supyagent config import .env --filter OPENAI
|
|
162
|
+
|
|
163
|
+
# List configured keys
|
|
164
|
+
supyagent config list
|
|
165
|
+
|
|
166
|
+
# Export keys to backup
|
|
167
|
+
supyagent config export backup.env
|
|
168
|
+
|
|
169
|
+
# Delete a key
|
|
170
|
+
supyagent config delete OPENAI_API_KEY
|
|
166
171
|
```
|
|
167
172
|
|
|
168
|
-
|
|
173
|
+
Keys are encrypted and stored in `~/.supyagent/config/`. They're automatically loaded when running any agent command.
|
|
174
|
+
|
|
175
|
+
### Supported Providers
|
|
169
176
|
|
|
170
177
|
Supyagent uses LiteLLM, supporting 100+ providers:
|
|
171
178
|
|
|
@@ -187,11 +194,36 @@ model:
|
|
|
187
194
|
provider: gemini/gemini-pro
|
|
188
195
|
```
|
|
189
196
|
|
|
190
|
-
|
|
197
|
+
## Agent Configuration
|
|
191
198
|
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
199
|
+
Agents are defined in YAML files in the `agents/` directory:
|
|
200
|
+
|
|
201
|
+
```yaml
|
|
202
|
+
name: researcher
|
|
203
|
+
description: An AI research assistant
|
|
204
|
+
type: interactive # or "execution"
|
|
205
|
+
|
|
206
|
+
model:
|
|
207
|
+
provider: anthropic/claude-3-5-sonnet-20241022
|
|
208
|
+
temperature: 0.7
|
|
209
|
+
max_tokens: 4096
|
|
210
|
+
|
|
211
|
+
system_prompt: |
|
|
212
|
+
You are a helpful research assistant...
|
|
213
|
+
|
|
214
|
+
tools:
|
|
215
|
+
allow:
|
|
216
|
+
- "*" # Allow all tools
|
|
217
|
+
# or be specific:
|
|
218
|
+
# - "web:*" # All functions in web.py
|
|
219
|
+
# - "math:calc" # Specific function
|
|
220
|
+
deny:
|
|
221
|
+
- "dangerous:*" # Block specific tools
|
|
222
|
+
|
|
223
|
+
# For multi-agent support
|
|
224
|
+
delegates:
|
|
225
|
+
- coder
|
|
226
|
+
- writer
|
|
195
227
|
```
|
|
196
228
|
|
|
197
229
|
## CLI Reference
|
|
@@ -200,6 +232,7 @@ export ANTHROPIC_API_KEY=sk-ant-...
|
|
|
200
232
|
|
|
201
233
|
| Command | Description |
|
|
202
234
|
|---------|-------------|
|
|
235
|
+
| `supyagent init` | Initialize project with default tools |
|
|
203
236
|
| `supyagent new <name>` | Create a new agent |
|
|
204
237
|
| `supyagent list` | List all agents |
|
|
205
238
|
| `supyagent show <name>` | Show agent details |
|
|
@@ -223,6 +256,16 @@ export ANTHROPIC_API_KEY=sk-ant-...
|
|
|
223
256
|
| `supyagent agents` | List active agent instances |
|
|
224
257
|
| `supyagent cleanup` | Remove completed instances |
|
|
225
258
|
|
|
259
|
+
### Config Commands
|
|
260
|
+
|
|
261
|
+
| Command | Description |
|
|
262
|
+
|---------|-------------|
|
|
263
|
+
| `supyagent config set [KEY]` | Set an API key (interactive menu if no key specified) |
|
|
264
|
+
| `supyagent config list` | List all configured keys |
|
|
265
|
+
| `supyagent config import <file>` | Import keys from .env file |
|
|
266
|
+
| `supyagent config export <file>` | Export keys to .env file |
|
|
267
|
+
| `supyagent config delete <key>` | Delete a stored key |
|
|
268
|
+
|
|
226
269
|
### In-Chat Commands
|
|
227
270
|
|
|
228
271
|
While chatting, use these commands:
|
|
@@ -242,6 +285,25 @@ While chatting, use these commands:
|
|
|
242
285
|
| `/clear` | Clear conversation history |
|
|
243
286
|
| `/quit` | Exit the chat |
|
|
244
287
|
|
|
288
|
+
## Bundled Tools
|
|
289
|
+
|
|
290
|
+
Running `supyagent init` installs these default tools:
|
|
291
|
+
|
|
292
|
+
### Shell (`shell.py`)
|
|
293
|
+
- `run_command` - Execute shell commands
|
|
294
|
+
- `run_script` - Run multi-line bash scripts
|
|
295
|
+
- `which` - Find executable paths
|
|
296
|
+
- `get_env` - Get environment variables
|
|
297
|
+
|
|
298
|
+
### Files (`files.py`)
|
|
299
|
+
- `read_file` / `write_file` - File I/O
|
|
300
|
+
- `list_directory` - List files with glob patterns
|
|
301
|
+
- `copy_file` / `move_file` / `delete_file` - File operations
|
|
302
|
+
- `create_directory` - Create directories
|
|
303
|
+
- `file_info` - Get file metadata
|
|
304
|
+
|
|
305
|
+
You can add your own tools by creating Python files in `supypowers/`.
|
|
306
|
+
|
|
245
307
|
## Project Structure
|
|
246
308
|
|
|
247
309
|
```
|
|
@@ -251,8 +313,9 @@ your-project/
|
|
|
251
313
|
│ ├── planner.yaml
|
|
252
314
|
│ └── researcher.yaml
|
|
253
315
|
├── supypowers/ # Tool definitions (Python)
|
|
254
|
-
│ ├──
|
|
255
|
-
│
|
|
316
|
+
│ ├── shell.py # Shell commands (bundled)
|
|
317
|
+
│ ├── files.py # File operations (bundled)
|
|
318
|
+
│ └── my_tools.py # Your custom tools
|
|
256
319
|
└── .supyagent/ # Runtime data (gitignore this)
|
|
257
320
|
├── sessions/ # Conversation history
|
|
258
321
|
├── credentials/ # Encrypted secrets
|
|
@@ -32,6 +32,12 @@ uv pip install supyagent
|
|
|
32
32
|
## Quick Start
|
|
33
33
|
|
|
34
34
|
```bash
|
|
35
|
+
# Initialize supyagent (sets up default tools)
|
|
36
|
+
supyagent init
|
|
37
|
+
|
|
38
|
+
# Set up your API key (stored securely)
|
|
39
|
+
supyagent config set ANTHROPIC_API_KEY
|
|
40
|
+
|
|
35
41
|
# Create your first agent
|
|
36
42
|
supyagent new myagent
|
|
37
43
|
|
|
@@ -97,39 +103,40 @@ supyagent plan "Build a Python library for data validation"
|
|
|
97
103
|
# The planner will delegate to specialist agents (coder, writer, researcher)
|
|
98
104
|
```
|
|
99
105
|
|
|
100
|
-
##
|
|
106
|
+
## Configuration
|
|
101
107
|
|
|
102
|
-
|
|
108
|
+
### Setting Up API Keys
|
|
103
109
|
|
|
104
|
-
|
|
105
|
-
name: researcher
|
|
106
|
-
description: An AI research assistant
|
|
107
|
-
type: interactive # or "execution"
|
|
110
|
+
Supyagent securely stores your LLM API keys so you don't need to export them every time:
|
|
108
111
|
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
112
|
+
```bash
|
|
113
|
+
# Interactive setup (recommended)
|
|
114
|
+
supyagent config set
|
|
115
|
+
# Shows a menu of common providers to choose from
|
|
113
116
|
|
|
114
|
-
|
|
115
|
-
|
|
117
|
+
# Set a specific key
|
|
118
|
+
supyagent config set ANTHROPIC_API_KEY
|
|
119
|
+
supyagent config set OPENAI_API_KEY
|
|
116
120
|
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
- "*" # Allow all tools
|
|
120
|
-
# or be specific:
|
|
121
|
-
# - "web:*" # All functions in web.py
|
|
122
|
-
# - "math:calc" # Specific function
|
|
123
|
-
deny:
|
|
124
|
-
- "dangerous:*" # Block specific tools
|
|
121
|
+
# Import from a .env file
|
|
122
|
+
supyagent config import .env
|
|
125
123
|
|
|
126
|
-
#
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
124
|
+
# Import only specific keys
|
|
125
|
+
supyagent config import .env --filter OPENAI
|
|
126
|
+
|
|
127
|
+
# List configured keys
|
|
128
|
+
supyagent config list
|
|
129
|
+
|
|
130
|
+
# Export keys to backup
|
|
131
|
+
supyagent config export backup.env
|
|
132
|
+
|
|
133
|
+
# Delete a key
|
|
134
|
+
supyagent config delete OPENAI_API_KEY
|
|
130
135
|
```
|
|
131
136
|
|
|
132
|
-
|
|
137
|
+
Keys are encrypted and stored in `~/.supyagent/config/`. They're automatically loaded when running any agent command.
|
|
138
|
+
|
|
139
|
+
### Supported Providers
|
|
133
140
|
|
|
134
141
|
Supyagent uses LiteLLM, supporting 100+ providers:
|
|
135
142
|
|
|
@@ -151,11 +158,36 @@ model:
|
|
|
151
158
|
provider: gemini/gemini-pro
|
|
152
159
|
```
|
|
153
160
|
|
|
154
|
-
|
|
161
|
+
## Agent Configuration
|
|
155
162
|
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
163
|
+
Agents are defined in YAML files in the `agents/` directory:
|
|
164
|
+
|
|
165
|
+
```yaml
|
|
166
|
+
name: researcher
|
|
167
|
+
description: An AI research assistant
|
|
168
|
+
type: interactive # or "execution"
|
|
169
|
+
|
|
170
|
+
model:
|
|
171
|
+
provider: anthropic/claude-3-5-sonnet-20241022
|
|
172
|
+
temperature: 0.7
|
|
173
|
+
max_tokens: 4096
|
|
174
|
+
|
|
175
|
+
system_prompt: |
|
|
176
|
+
You are a helpful research assistant...
|
|
177
|
+
|
|
178
|
+
tools:
|
|
179
|
+
allow:
|
|
180
|
+
- "*" # Allow all tools
|
|
181
|
+
# or be specific:
|
|
182
|
+
# - "web:*" # All functions in web.py
|
|
183
|
+
# - "math:calc" # Specific function
|
|
184
|
+
deny:
|
|
185
|
+
- "dangerous:*" # Block specific tools
|
|
186
|
+
|
|
187
|
+
# For multi-agent support
|
|
188
|
+
delegates:
|
|
189
|
+
- coder
|
|
190
|
+
- writer
|
|
159
191
|
```
|
|
160
192
|
|
|
161
193
|
## CLI Reference
|
|
@@ -164,6 +196,7 @@ export ANTHROPIC_API_KEY=sk-ant-...
|
|
|
164
196
|
|
|
165
197
|
| Command | Description |
|
|
166
198
|
|---------|-------------|
|
|
199
|
+
| `supyagent init` | Initialize project with default tools |
|
|
167
200
|
| `supyagent new <name>` | Create a new agent |
|
|
168
201
|
| `supyagent list` | List all agents |
|
|
169
202
|
| `supyagent show <name>` | Show agent details |
|
|
@@ -187,6 +220,16 @@ export ANTHROPIC_API_KEY=sk-ant-...
|
|
|
187
220
|
| `supyagent agents` | List active agent instances |
|
|
188
221
|
| `supyagent cleanup` | Remove completed instances |
|
|
189
222
|
|
|
223
|
+
### Config Commands
|
|
224
|
+
|
|
225
|
+
| Command | Description |
|
|
226
|
+
|---------|-------------|
|
|
227
|
+
| `supyagent config set [KEY]` | Set an API key (interactive menu if no key specified) |
|
|
228
|
+
| `supyagent config list` | List all configured keys |
|
|
229
|
+
| `supyagent config import <file>` | Import keys from .env file |
|
|
230
|
+
| `supyagent config export <file>` | Export keys to .env file |
|
|
231
|
+
| `supyagent config delete <key>` | Delete a stored key |
|
|
232
|
+
|
|
190
233
|
### In-Chat Commands
|
|
191
234
|
|
|
192
235
|
While chatting, use these commands:
|
|
@@ -206,6 +249,25 @@ While chatting, use these commands:
|
|
|
206
249
|
| `/clear` | Clear conversation history |
|
|
207
250
|
| `/quit` | Exit the chat |
|
|
208
251
|
|
|
252
|
+
## Bundled Tools
|
|
253
|
+
|
|
254
|
+
Running `supyagent init` installs these default tools:
|
|
255
|
+
|
|
256
|
+
### Shell (`shell.py`)
|
|
257
|
+
- `run_command` - Execute shell commands
|
|
258
|
+
- `run_script` - Run multi-line bash scripts
|
|
259
|
+
- `which` - Find executable paths
|
|
260
|
+
- `get_env` - Get environment variables
|
|
261
|
+
|
|
262
|
+
### Files (`files.py`)
|
|
263
|
+
- `read_file` / `write_file` - File I/O
|
|
264
|
+
- `list_directory` - List files with glob patterns
|
|
265
|
+
- `copy_file` / `move_file` / `delete_file` - File operations
|
|
266
|
+
- `create_directory` - Create directories
|
|
267
|
+
- `file_info` - Get file metadata
|
|
268
|
+
|
|
269
|
+
You can add your own tools by creating Python files in `supypowers/`.
|
|
270
|
+
|
|
209
271
|
## Project Structure
|
|
210
272
|
|
|
211
273
|
```
|
|
@@ -215,8 +277,9 @@ your-project/
|
|
|
215
277
|
│ ├── planner.yaml
|
|
216
278
|
│ └── researcher.yaml
|
|
217
279
|
├── supypowers/ # Tool definitions (Python)
|
|
218
|
-
│ ├──
|
|
219
|
-
│
|
|
280
|
+
│ ├── shell.py # Shell commands (bundled)
|
|
281
|
+
│ ├── files.py # File operations (bundled)
|
|
282
|
+
│ └── my_tools.py # Your custom tools
|
|
220
283
|
└── .supyagent/ # Runtime data (gitignore this)
|
|
221
284
|
├── sessions/ # Conversation history
|
|
222
285
|
├── credentials/ # Encrypted secrets
|
|
@@ -0,0 +1,151 @@
|
|
|
1
|
+
#!/bin/bash
|
|
2
|
+
#
|
|
3
|
+
# Release script for supyagent
|
|
4
|
+
# Usage: ./scripts/release.sh [version]
|
|
5
|
+
#
|
|
6
|
+
# Examples:
|
|
7
|
+
# ./scripts/release.sh 0.2.0 # Release version 0.2.0
|
|
8
|
+
# ./scripts/release.sh patch # Bump patch version (0.1.0 -> 0.1.1)
|
|
9
|
+
# ./scripts/release.sh minor # Bump minor version (0.1.0 -> 0.2.0)
|
|
10
|
+
# ./scripts/release.sh major # Bump major version (0.1.0 -> 1.0.0)
|
|
11
|
+
#
|
|
12
|
+
|
|
13
|
+
set -e # Exit on error
|
|
14
|
+
|
|
15
|
+
# Colors for output
|
|
16
|
+
RED='\033[0;31m'
|
|
17
|
+
GREEN='\033[0;32m'
|
|
18
|
+
YELLOW='\033[1;33m'
|
|
19
|
+
BLUE='\033[0;34m'
|
|
20
|
+
NC='\033[0m' # No Color
|
|
21
|
+
|
|
22
|
+
# Change to project root
|
|
23
|
+
cd "$(dirname "$0")/.."
|
|
24
|
+
PROJECT_ROOT=$(pwd)
|
|
25
|
+
|
|
26
|
+
echo -e "${BLUE}📦 Supyagent Release Script${NC}"
|
|
27
|
+
echo "================================"
|
|
28
|
+
echo ""
|
|
29
|
+
|
|
30
|
+
# Get current version from pyproject.toml
|
|
31
|
+
CURRENT_VERSION=$(grep '^version = ' pyproject.toml | sed 's/version = "\(.*\)"/\1/')
|
|
32
|
+
echo -e "Current version: ${YELLOW}${CURRENT_VERSION}${NC}"
|
|
33
|
+
|
|
34
|
+
# Determine new version
|
|
35
|
+
if [ -z "$1" ]; then
|
|
36
|
+
echo -e "${RED}Error: Version argument required${NC}"
|
|
37
|
+
echo ""
|
|
38
|
+
echo "Usage: $0 [version|patch|minor|major]"
|
|
39
|
+
echo ""
|
|
40
|
+
echo "Examples:"
|
|
41
|
+
echo " $0 0.2.0 # Set specific version"
|
|
42
|
+
echo " $0 patch # Bump patch (0.1.0 -> 0.1.1)"
|
|
43
|
+
echo " $0 minor # Bump minor (0.1.0 -> 0.2.0)"
|
|
44
|
+
echo " $0 major # Bump major (0.1.0 -> 1.0.0)"
|
|
45
|
+
exit 1
|
|
46
|
+
fi
|
|
47
|
+
|
|
48
|
+
# Parse version
|
|
49
|
+
IFS='.' read -r MAJOR MINOR PATCH <<< "$CURRENT_VERSION"
|
|
50
|
+
|
|
51
|
+
case "$1" in
|
|
52
|
+
patch)
|
|
53
|
+
NEW_VERSION="$MAJOR.$MINOR.$((PATCH + 1))"
|
|
54
|
+
;;
|
|
55
|
+
minor)
|
|
56
|
+
NEW_VERSION="$MAJOR.$((MINOR + 1)).0"
|
|
57
|
+
;;
|
|
58
|
+
major)
|
|
59
|
+
NEW_VERSION="$((MAJOR + 1)).0.0"
|
|
60
|
+
;;
|
|
61
|
+
*)
|
|
62
|
+
NEW_VERSION="$1"
|
|
63
|
+
;;
|
|
64
|
+
esac
|
|
65
|
+
|
|
66
|
+
echo -e "New version: ${GREEN}${NEW_VERSION}${NC}"
|
|
67
|
+
echo ""
|
|
68
|
+
|
|
69
|
+
# Confirm
|
|
70
|
+
read -p "Proceed with release? [y/N] " -n 1 -r
|
|
71
|
+
echo ""
|
|
72
|
+
if [[ ! $REPLY =~ ^[Yy]$ ]]; then
|
|
73
|
+
echo "Cancelled."
|
|
74
|
+
exit 0
|
|
75
|
+
fi
|
|
76
|
+
|
|
77
|
+
echo ""
|
|
78
|
+
echo -e "${BLUE}Step 1: Update version in pyproject.toml${NC}"
|
|
79
|
+
sed -i.bak "s/^version = \".*\"/version = \"${NEW_VERSION}\"/" pyproject.toml
|
|
80
|
+
rm -f pyproject.toml.bak
|
|
81
|
+
|
|
82
|
+
# Also update version in CLI if it's hardcoded there
|
|
83
|
+
if grep -q "version=\"${CURRENT_VERSION}\"" supyagent/cli/main.py 2>/dev/null; then
|
|
84
|
+
sed -i.bak "s/version=\"${CURRENT_VERSION}\"/version=\"${NEW_VERSION}\"/" supyagent/cli/main.py
|
|
85
|
+
rm -f supyagent/cli/main.py.bak
|
|
86
|
+
fi
|
|
87
|
+
|
|
88
|
+
echo -e "${GREEN}✓${NC} Version updated to ${NEW_VERSION}"
|
|
89
|
+
|
|
90
|
+
echo ""
|
|
91
|
+
echo -e "${BLUE}Step 2: Run tests${NC}"
|
|
92
|
+
source .venv/bin/activate 2>/dev/null || true
|
|
93
|
+
python -m pytest tests/ -q
|
|
94
|
+
echo -e "${GREEN}✓${NC} All tests passed"
|
|
95
|
+
|
|
96
|
+
echo ""
|
|
97
|
+
echo -e "${BLUE}Step 3: Clean old builds${NC}"
|
|
98
|
+
rm -rf dist/ build/ *.egg-info
|
|
99
|
+
echo -e "${GREEN}✓${NC} Cleaned build directories"
|
|
100
|
+
|
|
101
|
+
echo ""
|
|
102
|
+
echo -e "${BLUE}Step 4: Build package${NC}"
|
|
103
|
+
python -m build
|
|
104
|
+
echo -e "${GREEN}✓${NC} Built successfully"
|
|
105
|
+
|
|
106
|
+
echo ""
|
|
107
|
+
echo -e "${BLUE}Step 5: Verify package${NC}"
|
|
108
|
+
twine check dist/*
|
|
109
|
+
echo -e "${GREEN}✓${NC} Package verified"
|
|
110
|
+
|
|
111
|
+
echo ""
|
|
112
|
+
echo -e "${BLUE}Step 6: Upload to PyPI${NC}"
|
|
113
|
+
# Load credentials from .env if present
|
|
114
|
+
if [ -f .env ]; then
|
|
115
|
+
export $(cat .env | grep -v '^#' | xargs)
|
|
116
|
+
fi
|
|
117
|
+
twine upload dist/*
|
|
118
|
+
echo -e "${GREEN}✓${NC} Uploaded to PyPI"
|
|
119
|
+
|
|
120
|
+
echo ""
|
|
121
|
+
echo -e "${BLUE}Step 7: Clear local caches${NC}"
|
|
122
|
+
|
|
123
|
+
# Clear pip cache
|
|
124
|
+
echo " Clearing pip cache..."
|
|
125
|
+
pip cache purge 2>/dev/null || true
|
|
126
|
+
|
|
127
|
+
# Clear uv cache for supyagent
|
|
128
|
+
echo " Clearing uv cache..."
|
|
129
|
+
uv cache clean supyagent 2>/dev/null || true
|
|
130
|
+
|
|
131
|
+
# Remove any local installs
|
|
132
|
+
echo " Removing local editable install..."
|
|
133
|
+
pip uninstall -y supyagent 2>/dev/null || true
|
|
134
|
+
uv pip uninstall supyagent 2>/dev/null || true
|
|
135
|
+
|
|
136
|
+
echo -e "${GREEN}✓${NC} Caches cleared"
|
|
137
|
+
|
|
138
|
+
echo ""
|
|
139
|
+
echo -e "${GREEN}========================================${NC}"
|
|
140
|
+
echo -e "${GREEN}🎉 Released supyagent ${NEW_VERSION}${NC}"
|
|
141
|
+
echo -e "${GREEN}========================================${NC}"
|
|
142
|
+
echo ""
|
|
143
|
+
echo "View on PyPI: https://pypi.org/project/supyagent/${NEW_VERSION}/"
|
|
144
|
+
echo ""
|
|
145
|
+
echo "To install the new version:"
|
|
146
|
+
echo " pip install supyagent==${NEW_VERSION}"
|
|
147
|
+
echo " # or"
|
|
148
|
+
echo " uv pip install supyagent==${NEW_VERSION}"
|
|
149
|
+
echo ""
|
|
150
|
+
echo "To reinstall locally for development:"
|
|
151
|
+
echo " uv pip install -e ."
|