devduck 0.3.0__tar.gz → 0.4.0__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 devduck might be problematic. Click here for more details.
- devduck-0.4.0/PKG-INFO +260 -0
- devduck-0.4.0/README.md +215 -0
- {devduck-0.3.0 → devduck-0.4.0}/devduck/__init__.py +69 -17
- {devduck-0.3.0 → devduck-0.4.0}/devduck/_version.py +3 -3
- {devduck-0.3.0 → devduck-0.4.0}/devduck/tools/mcp_server.py +34 -6
- devduck-0.4.0/devduck.egg-info/PKG-INFO +260 -0
- {devduck-0.3.0 → devduck-0.4.0}/devduck.egg-info/SOURCES.txt +0 -1
- {devduck-0.3.0 → devduck-0.4.0}/pyproject.toml +1 -1
- devduck-0.3.0/PKG-INFO +0 -152
- devduck-0.3.0/README.md +0 -107
- devduck-0.3.0/devduck.egg-info/PKG-INFO +0 -152
- devduck-0.3.0/tools/store_in_kb.py +0 -187
- {devduck-0.3.0 → devduck-0.4.0}/.github/workflows/agent.yml +0 -0
- {devduck-0.3.0 → devduck-0.4.0}/.gitignore +0 -0
- {devduck-0.3.0 → devduck-0.4.0}/LICENSE +0 -0
- {devduck-0.3.0 → devduck-0.4.0}/MANIFEST.in +0 -0
- {devduck-0.3.0 → devduck-0.4.0}/action.yml +0 -0
- {devduck-0.3.0 → devduck-0.4.0}/agent_runner.py +0 -0
- {devduck-0.3.0 → devduck-0.4.0}/devduck/__main__.py +0 -0
- {devduck-0.3.0 → devduck-0.4.0}/devduck/test_redduck.py +0 -0
- {devduck-0.3.0 → devduck-0.4.0}/devduck/tools/__init__.py +0 -0
- {devduck-0.3.0 → devduck-0.4.0}/devduck/tools/create_subagent.py +0 -0
- {devduck-0.3.0 → devduck-0.4.0}/devduck/tools/install_tools.py +0 -0
- {devduck-0.3.0 → devduck-0.4.0}/devduck/tools/store_in_kb.py +0 -0
- {devduck-0.3.0 → devduck-0.4.0}/devduck/tools/tcp.py +0 -0
- {devduck-0.3.0 → devduck-0.4.0}/devduck/tools/use_github.py +0 -0
- {devduck-0.3.0 → devduck-0.4.0}/devduck/tools/websocket.py +0 -0
- {devduck-0.3.0 → devduck-0.4.0}/devduck.egg-info/dependency_links.txt +0 -0
- {devduck-0.3.0 → devduck-0.4.0}/devduck.egg-info/entry_points.txt +0 -0
- {devduck-0.3.0 → devduck-0.4.0}/devduck.egg-info/requires.txt +1 -1
- {devduck-0.3.0 → devduck-0.4.0}/devduck.egg-info/top_level.txt +0 -0
- {devduck-0.3.0 → devduck-0.4.0}/docs/index.html +0 -0
- {devduck-0.3.0 → devduck-0.4.0}/install.sh +0 -0
- {devduck-0.3.0 → devduck-0.4.0}/mcp.json +0 -0
- {devduck-0.3.0 → devduck-0.4.0}/requirements.txt +0 -0
- {devduck-0.3.0 → devduck-0.4.0}/setup-aws-oidc.sh +0 -0
- {devduck-0.3.0 → devduck-0.4.0}/setup.cfg +0 -0
- {devduck-0.3.0 → devduck-0.4.0}/test.py +0 -0
- {devduck-0.3.0 → devduck-0.4.0}/tools/__init__.py +0 -0
- {devduck-0.3.0 → devduck-0.4.0}/tools/fetch_github_tool.py +0 -0
- {devduck-0.3.0 → devduck-0.4.0}/tools/gist.py +0 -0
- {devduck-0.3.0 → devduck-0.4.0}/tools/github_tools.py +0 -0
- {devduck-0.3.0 → devduck-0.4.0}/tools/scraper.py +0 -0
- {devduck-0.3.0 → devduck-0.4.0}/tools/system_prompt.py +0 -0
devduck-0.4.0/PKG-INFO
ADDED
|
@@ -0,0 +1,260 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: devduck
|
|
3
|
+
Version: 0.4.0
|
|
4
|
+
Summary: 🦆 Extreme minimalist self-adapting AI agent - one file, self-healing, runtime dependencies
|
|
5
|
+
Author-email: duck <hey@devduck.dev>
|
|
6
|
+
License-Expression: MIT
|
|
7
|
+
Project-URL: Homepage, https://github.com/cagataycali/devduck
|
|
8
|
+
Project-URL: Repository, https://github.com/cagataycali/devduck.git
|
|
9
|
+
Project-URL: Documentation, https://github.com/cagataycali/devduck#readme
|
|
10
|
+
Project-URL: Bug Tracker, https://github.com/cagataycali/devduck/issues
|
|
11
|
+
Keywords: ai,agent,minimalist,self-healing,ollama,strands-agents
|
|
12
|
+
Classifier: Development Status :: 4 - Beta
|
|
13
|
+
Classifier: Environment :: Console
|
|
14
|
+
Classifier: Intended Audience :: Developers
|
|
15
|
+
Classifier: Intended Audience :: System Administrators
|
|
16
|
+
Classifier: Operating System :: OS Independent
|
|
17
|
+
Classifier: Programming Language :: Python :: 3
|
|
18
|
+
Classifier: Programming Language :: Python :: 3.10
|
|
19
|
+
Classifier: Programming Language :: Python :: 3.11
|
|
20
|
+
Classifier: Programming Language :: Python :: 3.12
|
|
21
|
+
Classifier: Programming Language :: Python :: 3.13
|
|
22
|
+
Classifier: Topic :: Scientific/Engineering :: Artificial Intelligence
|
|
23
|
+
Classifier: Topic :: Software Development :: Libraries :: Python Modules
|
|
24
|
+
Classifier: Topic :: System :: Systems Administration
|
|
25
|
+
Classifier: Topic :: Utilities
|
|
26
|
+
Requires-Python: >=3.10
|
|
27
|
+
Description-Content-Type: text/markdown
|
|
28
|
+
License-File: LICENSE
|
|
29
|
+
Requires-Dist: strands-agents
|
|
30
|
+
Requires-Dist: prompt_toolkit
|
|
31
|
+
Requires-Dist: strands-agents[ollama]
|
|
32
|
+
Requires-Dist: strands-agents-tools
|
|
33
|
+
Requires-Dist: strands-agentcore-tools
|
|
34
|
+
Requires-Dist: beautifulsoup4
|
|
35
|
+
Requires-Dist: colorama
|
|
36
|
+
Requires-Dist: websockets
|
|
37
|
+
Requires-Dist: strands-mcp-server
|
|
38
|
+
Provides-Extra: all
|
|
39
|
+
Requires-Dist: strands-agents[openai]; extra == "all"
|
|
40
|
+
Requires-Dist: strands-agents[anthropic]; extra == "all"
|
|
41
|
+
Requires-Dist: strands-fun-tools[audio]; extra == "all"
|
|
42
|
+
Requires-Dist: strands-fun-tools[vision]; extra == "all"
|
|
43
|
+
Requires-Dist: strands-fun-tools[all]; extra == "all"
|
|
44
|
+
Dynamic: license-file
|
|
45
|
+
|
|
46
|
+
# 🦆 DevDuck
|
|
47
|
+
|
|
48
|
+
**Self-healing agent. One file. Zero config.**
|
|
49
|
+
|
|
50
|
+
Minimalist AI that adapts to your environment and fixes itself when things break.
|
|
51
|
+
|
|
52
|
+
## Install
|
|
53
|
+
|
|
54
|
+
```bash
|
|
55
|
+
pipx install "devduck[all]" # Full install (recommended)
|
|
56
|
+
```
|
|
57
|
+
|
|
58
|
+
Requires: Python 3.10+, Ollama (or set `MODEL_PROVIDER`)
|
|
59
|
+
|
|
60
|
+
## Quick Start
|
|
61
|
+
|
|
62
|
+
```bash
|
|
63
|
+
devduck # Interactive mode (auto-starts servers)
|
|
64
|
+
devduck "analyze this code" # CLI mode
|
|
65
|
+
```
|
|
66
|
+
|
|
67
|
+
```python
|
|
68
|
+
import devduck
|
|
69
|
+
devduck("calculate 2+2") # Python API
|
|
70
|
+
```
|
|
71
|
+
|
|
72
|
+
## Core Features
|
|
73
|
+
|
|
74
|
+
- **🔧 Self-healing** - Auto-fixes dependencies, models, errors
|
|
75
|
+
- **🔥 Hot-reload** - Save `.py` files in `./tools/`, use instantly (no restart)
|
|
76
|
+
- **🧠 RAG memory** - Set `STRANDS_KNOWLEDGE_BASE_ID` for automatic context retrieval/storage
|
|
77
|
+
- **🌍 Multi-protocol** - TCP (9999), WebSocket (8080), MCP (8000), CLI, Python
|
|
78
|
+
- **📚 19+ tools** - shell, editor, calculator, python, GitHub, subagents, and more
|
|
79
|
+
- **🎯 Adaptive** - Auto-selects model by OS (macOS: 1.7b, Linux: 30b)
|
|
80
|
+
|
|
81
|
+
## Auto-Started Servers
|
|
82
|
+
|
|
83
|
+
When you run `devduck`, 3 servers start automatically:
|
|
84
|
+
|
|
85
|
+
| Server | Endpoint | Usage |
|
|
86
|
+
|--------|----------|-------|
|
|
87
|
+
| 🌐 **Web UI** | [cagataycali.github.io/devduck](http://cagataycali.github.io/devduck) | Browser interface |
|
|
88
|
+
| 🔌 **TCP** | `localhost:9999` | `nc localhost 9999` |
|
|
89
|
+
| 🌊 **WebSocket** | `ws://localhost:8080` | Structured JSON messages |
|
|
90
|
+
| 🔗 **MCP** | `http://localhost:8000/mcp` | Model Context Protocol |
|
|
91
|
+
|
|
92
|
+
**Customize ports:**
|
|
93
|
+
```bash
|
|
94
|
+
devduck --tcp-port 9000 --ws-port 8001 --mcp-port 3000
|
|
95
|
+
devduck --no-tcp --no-ws # Disable specific servers
|
|
96
|
+
```
|
|
97
|
+
|
|
98
|
+
## Connect Options
|
|
99
|
+
|
|
100
|
+
### MCP Client (Claude Desktop)
|
|
101
|
+
|
|
102
|
+
**Simple stdio mode (recommended):**
|
|
103
|
+
```json
|
|
104
|
+
{
|
|
105
|
+
"mcpServers": {
|
|
106
|
+
"devduck": {
|
|
107
|
+
"command": "uvx",
|
|
108
|
+
"args": ["devduck", "--mcp"]
|
|
109
|
+
}
|
|
110
|
+
}
|
|
111
|
+
}
|
|
112
|
+
```
|
|
113
|
+
|
|
114
|
+
**Proxy mode (if devduck already running):**
|
|
115
|
+
```json
|
|
116
|
+
{
|
|
117
|
+
"mcpServers": {
|
|
118
|
+
"devduck": {
|
|
119
|
+
"command": "uvx",
|
|
120
|
+
"args": ["strands-mcp-server", "--upstream-url", "http://localhost:8000/mcp/"]
|
|
121
|
+
}
|
|
122
|
+
}
|
|
123
|
+
}
|
|
124
|
+
```
|
|
125
|
+
|
|
126
|
+
### Terminal (TCP)
|
|
127
|
+
```bash
|
|
128
|
+
nc localhost 9999
|
|
129
|
+
> analyze logs
|
|
130
|
+
```
|
|
131
|
+
|
|
132
|
+
### Shell Prefix
|
|
133
|
+
```bash
|
|
134
|
+
devduck
|
|
135
|
+
🦆 ! git status # Run shell commands with !
|
|
136
|
+
```
|
|
137
|
+
|
|
138
|
+
## Hot-Reload Tool Creation
|
|
139
|
+
|
|
140
|
+
Create tools instantly—no restart needed:
|
|
141
|
+
|
|
142
|
+
```python
|
|
143
|
+
# ./tools/tip_calc.py
|
|
144
|
+
from strands import tool
|
|
145
|
+
|
|
146
|
+
@tool
|
|
147
|
+
def calculate_tip(amount: float, percent: float = 15.0) -> str:
|
|
148
|
+
"""Calculate restaurant tip."""
|
|
149
|
+
tip = amount * (percent / 100)
|
|
150
|
+
return f"Tip: ${tip:.2f} | Total: ${amount + tip:.2f}"
|
|
151
|
+
```
|
|
152
|
+
|
|
153
|
+
Save → Available instantly → Use: `devduck "calculate tip for $42"`
|
|
154
|
+
|
|
155
|
+
## Built-in Tools (19+)
|
|
156
|
+
|
|
157
|
+
| Category | Tools |
|
|
158
|
+
|----------|-------|
|
|
159
|
+
| **Development** | shell, editor, python_repl, load_tool, environment |
|
|
160
|
+
| **GitHub** | use_github, create_subagent, gist, add_comment, list_issues |
|
|
161
|
+
| **Network** | tcp, websocket, mcp_server, mcp_client, http_request |
|
|
162
|
+
| **AI** | use_agent, install_tools, retrieve, store_in_kb |
|
|
163
|
+
| **Utilities** | calculator, image_reader, scraper, system_prompt, view_logs |
|
|
164
|
+
|
|
165
|
+
## Multi-Model Support
|
|
166
|
+
|
|
167
|
+
Switch models via environment variables:
|
|
168
|
+
|
|
169
|
+
```bash
|
|
170
|
+
# Bedrock (Claude)
|
|
171
|
+
export MODEL_PROVIDER="bedrock"
|
|
172
|
+
export STRANDS_MODEL_ID="us.anthropic.claude-sonnet-4-5-20250929-v1:0"
|
|
173
|
+
export STRANDS_MAX_TOKENS="64000"
|
|
174
|
+
|
|
175
|
+
# Anthropic API
|
|
176
|
+
export MODEL_PROVIDER="anthropic"
|
|
177
|
+
export STRANDS_MODEL_ID="claude-sonnet-4-20250514"
|
|
178
|
+
|
|
179
|
+
# Ollama (default)
|
|
180
|
+
export MODEL_PROVIDER="ollama"
|
|
181
|
+
export OLLAMA_HOST="http://localhost:11434"
|
|
182
|
+
```
|
|
183
|
+
|
|
184
|
+
## Knowledge Base (RAG)
|
|
185
|
+
|
|
186
|
+
Enable automatic memory across sessions:
|
|
187
|
+
|
|
188
|
+
```bash
|
|
189
|
+
export STRANDS_KNOWLEDGE_BASE_ID="your-kb-id"
|
|
190
|
+
devduck # Auto-retrieves context before queries, stores after responses
|
|
191
|
+
```
|
|
192
|
+
|
|
193
|
+
Works with AWS Bedrock Knowledge Bases.
|
|
194
|
+
|
|
195
|
+
## Environment Variables
|
|
196
|
+
|
|
197
|
+
| Variable | Default | Description |
|
|
198
|
+
|----------|---------|-------------|
|
|
199
|
+
| `MODEL_PROVIDER` | `ollama` | Model provider (bedrock, anthropic, ollama) |
|
|
200
|
+
| `STRANDS_KNOWLEDGE_BASE_ID` | - | Enable auto-RAG with KB ID |
|
|
201
|
+
| `DEVDUCK_TCP_PORT` | `9999` | TCP server port |
|
|
202
|
+
| `DEVDUCK_WS_PORT` | `8080` | WebSocket port |
|
|
203
|
+
| `DEVDUCK_MCP_PORT` | `8000` | MCP server port |
|
|
204
|
+
| `DEVDUCK_ENABLE_TCP` | `true` | Enable TCP server |
|
|
205
|
+
| `DEVDUCK_ENABLE_WS` | `true` | Enable WebSocket |
|
|
206
|
+
| `DEVDUCK_ENABLE_MCP` | `true` | Enable MCP server |
|
|
207
|
+
| `DEVDUCK_LOG_LINE_COUNT` | `50` | Log lines in context |
|
|
208
|
+
| `SYSTEM_PROMPT` | - | Custom system prompt |
|
|
209
|
+
|
|
210
|
+
## Dynamic Tool Loading
|
|
211
|
+
|
|
212
|
+
Load tools from any Python package at runtime:
|
|
213
|
+
|
|
214
|
+
```python
|
|
215
|
+
devduck
|
|
216
|
+
🦆 install_tools(action="install_and_load",
|
|
217
|
+
package="strands-fun-tools",
|
|
218
|
+
module="strands_fun_tools")
|
|
219
|
+
```
|
|
220
|
+
|
|
221
|
+
No restart required—tools available immediately.
|
|
222
|
+
|
|
223
|
+
## System Prompt Management
|
|
224
|
+
|
|
225
|
+
Modify agent behavior dynamically:
|
|
226
|
+
|
|
227
|
+
```bash
|
|
228
|
+
devduck
|
|
229
|
+
🦆 system_prompt(action="update", prompt="You are a senior Python expert.")
|
|
230
|
+
🦆 system_prompt(action="view") # See current prompt
|
|
231
|
+
```
|
|
232
|
+
|
|
233
|
+
## Logs
|
|
234
|
+
|
|
235
|
+
```bash
|
|
236
|
+
devduck
|
|
237
|
+
🦆 view_logs(action="view", lines=100)
|
|
238
|
+
🦆 view_logs(action="search", pattern="error")
|
|
239
|
+
🦆 view_logs(action="stats")
|
|
240
|
+
```
|
|
241
|
+
|
|
242
|
+
Log location: `/tmp/devduck/logs/devduck.log`
|
|
243
|
+
|
|
244
|
+
## GitHub Actions
|
|
245
|
+
|
|
246
|
+
Run DevDuck in CI/CD:
|
|
247
|
+
|
|
248
|
+
```yaml
|
|
249
|
+
- name: DevDuck Analysis
|
|
250
|
+
uses: cagataycali/devduck@main
|
|
251
|
+
with:
|
|
252
|
+
query: "analyze test coverage"
|
|
253
|
+
model: "us.anthropic.claude-sonnet-4-20250514-v1:0"
|
|
254
|
+
```
|
|
255
|
+
|
|
256
|
+
---
|
|
257
|
+
|
|
258
|
+
**One file. 19+ tools. Self-healing. Hot-reload. RAG memory.**
|
|
259
|
+
|
|
260
|
+
*Built with [Strands Agents SDK](https://github.com/strands-agents/sdk-python)*
|
devduck-0.4.0/README.md
ADDED
|
@@ -0,0 +1,215 @@
|
|
|
1
|
+
# 🦆 DevDuck
|
|
2
|
+
|
|
3
|
+
**Self-healing agent. One file. Zero config.**
|
|
4
|
+
|
|
5
|
+
Minimalist AI that adapts to your environment and fixes itself when things break.
|
|
6
|
+
|
|
7
|
+
## Install
|
|
8
|
+
|
|
9
|
+
```bash
|
|
10
|
+
pipx install "devduck[all]" # Full install (recommended)
|
|
11
|
+
```
|
|
12
|
+
|
|
13
|
+
Requires: Python 3.10+, Ollama (or set `MODEL_PROVIDER`)
|
|
14
|
+
|
|
15
|
+
## Quick Start
|
|
16
|
+
|
|
17
|
+
```bash
|
|
18
|
+
devduck # Interactive mode (auto-starts servers)
|
|
19
|
+
devduck "analyze this code" # CLI mode
|
|
20
|
+
```
|
|
21
|
+
|
|
22
|
+
```python
|
|
23
|
+
import devduck
|
|
24
|
+
devduck("calculate 2+2") # Python API
|
|
25
|
+
```
|
|
26
|
+
|
|
27
|
+
## Core Features
|
|
28
|
+
|
|
29
|
+
- **🔧 Self-healing** - Auto-fixes dependencies, models, errors
|
|
30
|
+
- **🔥 Hot-reload** - Save `.py` files in `./tools/`, use instantly (no restart)
|
|
31
|
+
- **🧠 RAG memory** - Set `STRANDS_KNOWLEDGE_BASE_ID` for automatic context retrieval/storage
|
|
32
|
+
- **🌍 Multi-protocol** - TCP (9999), WebSocket (8080), MCP (8000), CLI, Python
|
|
33
|
+
- **📚 19+ tools** - shell, editor, calculator, python, GitHub, subagents, and more
|
|
34
|
+
- **🎯 Adaptive** - Auto-selects model by OS (macOS: 1.7b, Linux: 30b)
|
|
35
|
+
|
|
36
|
+
## Auto-Started Servers
|
|
37
|
+
|
|
38
|
+
When you run `devduck`, 3 servers start automatically:
|
|
39
|
+
|
|
40
|
+
| Server | Endpoint | Usage |
|
|
41
|
+
|--------|----------|-------|
|
|
42
|
+
| 🌐 **Web UI** | [cagataycali.github.io/devduck](http://cagataycali.github.io/devduck) | Browser interface |
|
|
43
|
+
| 🔌 **TCP** | `localhost:9999` | `nc localhost 9999` |
|
|
44
|
+
| 🌊 **WebSocket** | `ws://localhost:8080` | Structured JSON messages |
|
|
45
|
+
| 🔗 **MCP** | `http://localhost:8000/mcp` | Model Context Protocol |
|
|
46
|
+
|
|
47
|
+
**Customize ports:**
|
|
48
|
+
```bash
|
|
49
|
+
devduck --tcp-port 9000 --ws-port 8001 --mcp-port 3000
|
|
50
|
+
devduck --no-tcp --no-ws # Disable specific servers
|
|
51
|
+
```
|
|
52
|
+
|
|
53
|
+
## Connect Options
|
|
54
|
+
|
|
55
|
+
### MCP Client (Claude Desktop)
|
|
56
|
+
|
|
57
|
+
**Simple stdio mode (recommended):**
|
|
58
|
+
```json
|
|
59
|
+
{
|
|
60
|
+
"mcpServers": {
|
|
61
|
+
"devduck": {
|
|
62
|
+
"command": "uvx",
|
|
63
|
+
"args": ["devduck", "--mcp"]
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
```
|
|
68
|
+
|
|
69
|
+
**Proxy mode (if devduck already running):**
|
|
70
|
+
```json
|
|
71
|
+
{
|
|
72
|
+
"mcpServers": {
|
|
73
|
+
"devduck": {
|
|
74
|
+
"command": "uvx",
|
|
75
|
+
"args": ["strands-mcp-server", "--upstream-url", "http://localhost:8000/mcp/"]
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
```
|
|
80
|
+
|
|
81
|
+
### Terminal (TCP)
|
|
82
|
+
```bash
|
|
83
|
+
nc localhost 9999
|
|
84
|
+
> analyze logs
|
|
85
|
+
```
|
|
86
|
+
|
|
87
|
+
### Shell Prefix
|
|
88
|
+
```bash
|
|
89
|
+
devduck
|
|
90
|
+
🦆 ! git status # Run shell commands with !
|
|
91
|
+
```
|
|
92
|
+
|
|
93
|
+
## Hot-Reload Tool Creation
|
|
94
|
+
|
|
95
|
+
Create tools instantly—no restart needed:
|
|
96
|
+
|
|
97
|
+
```python
|
|
98
|
+
# ./tools/tip_calc.py
|
|
99
|
+
from strands import tool
|
|
100
|
+
|
|
101
|
+
@tool
|
|
102
|
+
def calculate_tip(amount: float, percent: float = 15.0) -> str:
|
|
103
|
+
"""Calculate restaurant tip."""
|
|
104
|
+
tip = amount * (percent / 100)
|
|
105
|
+
return f"Tip: ${tip:.2f} | Total: ${amount + tip:.2f}"
|
|
106
|
+
```
|
|
107
|
+
|
|
108
|
+
Save → Available instantly → Use: `devduck "calculate tip for $42"`
|
|
109
|
+
|
|
110
|
+
## Built-in Tools (19+)
|
|
111
|
+
|
|
112
|
+
| Category | Tools |
|
|
113
|
+
|----------|-------|
|
|
114
|
+
| **Development** | shell, editor, python_repl, load_tool, environment |
|
|
115
|
+
| **GitHub** | use_github, create_subagent, gist, add_comment, list_issues |
|
|
116
|
+
| **Network** | tcp, websocket, mcp_server, mcp_client, http_request |
|
|
117
|
+
| **AI** | use_agent, install_tools, retrieve, store_in_kb |
|
|
118
|
+
| **Utilities** | calculator, image_reader, scraper, system_prompt, view_logs |
|
|
119
|
+
|
|
120
|
+
## Multi-Model Support
|
|
121
|
+
|
|
122
|
+
Switch models via environment variables:
|
|
123
|
+
|
|
124
|
+
```bash
|
|
125
|
+
# Bedrock (Claude)
|
|
126
|
+
export MODEL_PROVIDER="bedrock"
|
|
127
|
+
export STRANDS_MODEL_ID="us.anthropic.claude-sonnet-4-5-20250929-v1:0"
|
|
128
|
+
export STRANDS_MAX_TOKENS="64000"
|
|
129
|
+
|
|
130
|
+
# Anthropic API
|
|
131
|
+
export MODEL_PROVIDER="anthropic"
|
|
132
|
+
export STRANDS_MODEL_ID="claude-sonnet-4-20250514"
|
|
133
|
+
|
|
134
|
+
# Ollama (default)
|
|
135
|
+
export MODEL_PROVIDER="ollama"
|
|
136
|
+
export OLLAMA_HOST="http://localhost:11434"
|
|
137
|
+
```
|
|
138
|
+
|
|
139
|
+
## Knowledge Base (RAG)
|
|
140
|
+
|
|
141
|
+
Enable automatic memory across sessions:
|
|
142
|
+
|
|
143
|
+
```bash
|
|
144
|
+
export STRANDS_KNOWLEDGE_BASE_ID="your-kb-id"
|
|
145
|
+
devduck # Auto-retrieves context before queries, stores after responses
|
|
146
|
+
```
|
|
147
|
+
|
|
148
|
+
Works with AWS Bedrock Knowledge Bases.
|
|
149
|
+
|
|
150
|
+
## Environment Variables
|
|
151
|
+
|
|
152
|
+
| Variable | Default | Description |
|
|
153
|
+
|----------|---------|-------------|
|
|
154
|
+
| `MODEL_PROVIDER` | `ollama` | Model provider (bedrock, anthropic, ollama) |
|
|
155
|
+
| `STRANDS_KNOWLEDGE_BASE_ID` | - | Enable auto-RAG with KB ID |
|
|
156
|
+
| `DEVDUCK_TCP_PORT` | `9999` | TCP server port |
|
|
157
|
+
| `DEVDUCK_WS_PORT` | `8080` | WebSocket port |
|
|
158
|
+
| `DEVDUCK_MCP_PORT` | `8000` | MCP server port |
|
|
159
|
+
| `DEVDUCK_ENABLE_TCP` | `true` | Enable TCP server |
|
|
160
|
+
| `DEVDUCK_ENABLE_WS` | `true` | Enable WebSocket |
|
|
161
|
+
| `DEVDUCK_ENABLE_MCP` | `true` | Enable MCP server |
|
|
162
|
+
| `DEVDUCK_LOG_LINE_COUNT` | `50` | Log lines in context |
|
|
163
|
+
| `SYSTEM_PROMPT` | - | Custom system prompt |
|
|
164
|
+
|
|
165
|
+
## Dynamic Tool Loading
|
|
166
|
+
|
|
167
|
+
Load tools from any Python package at runtime:
|
|
168
|
+
|
|
169
|
+
```python
|
|
170
|
+
devduck
|
|
171
|
+
🦆 install_tools(action="install_and_load",
|
|
172
|
+
package="strands-fun-tools",
|
|
173
|
+
module="strands_fun_tools")
|
|
174
|
+
```
|
|
175
|
+
|
|
176
|
+
No restart required—tools available immediately.
|
|
177
|
+
|
|
178
|
+
## System Prompt Management
|
|
179
|
+
|
|
180
|
+
Modify agent behavior dynamically:
|
|
181
|
+
|
|
182
|
+
```bash
|
|
183
|
+
devduck
|
|
184
|
+
🦆 system_prompt(action="update", prompt="You are a senior Python expert.")
|
|
185
|
+
🦆 system_prompt(action="view") # See current prompt
|
|
186
|
+
```
|
|
187
|
+
|
|
188
|
+
## Logs
|
|
189
|
+
|
|
190
|
+
```bash
|
|
191
|
+
devduck
|
|
192
|
+
🦆 view_logs(action="view", lines=100)
|
|
193
|
+
🦆 view_logs(action="search", pattern="error")
|
|
194
|
+
🦆 view_logs(action="stats")
|
|
195
|
+
```
|
|
196
|
+
|
|
197
|
+
Log location: `/tmp/devduck/logs/devduck.log`
|
|
198
|
+
|
|
199
|
+
## GitHub Actions
|
|
200
|
+
|
|
201
|
+
Run DevDuck in CI/CD:
|
|
202
|
+
|
|
203
|
+
```yaml
|
|
204
|
+
- name: DevDuck Analysis
|
|
205
|
+
uses: cagataycali/devduck@main
|
|
206
|
+
with:
|
|
207
|
+
query: "analyze test coverage"
|
|
208
|
+
model: "us.anthropic.claude-sonnet-4-20250514-v1:0"
|
|
209
|
+
```
|
|
210
|
+
|
|
211
|
+
---
|
|
212
|
+
|
|
213
|
+
**One file. 19+ tools. Self-healing. Hot-reload. RAG memory.**
|
|
214
|
+
|
|
215
|
+
*Built with [Strands Agents SDK](https://github.com/strands-agents/sdk-python)*
|
|
@@ -677,29 +677,33 @@ class DevDuck:
|
|
|
677
677
|
except ImportError as e:
|
|
678
678
|
logger.warning(f"devduck.tools import failed: {e}")
|
|
679
679
|
|
|
680
|
-
|
|
681
|
-
|
|
682
|
-
|
|
683
|
-
|
|
684
|
-
|
|
685
|
-
|
|
686
|
-
|
|
687
|
-
|
|
680
|
+
# Skip fun tools in --mcp mode (they're not needed for MCP server)
|
|
681
|
+
if "--mcp" not in sys.argv:
|
|
682
|
+
try:
|
|
683
|
+
from strands_fun_tools import (
|
|
684
|
+
listen,
|
|
685
|
+
cursor,
|
|
686
|
+
clipboard,
|
|
687
|
+
screen_reader,
|
|
688
|
+
yolo_vision,
|
|
689
|
+
)
|
|
688
690
|
|
|
689
|
-
|
|
690
|
-
|
|
691
|
-
|
|
692
|
-
|
|
693
|
-
|
|
694
|
-
|
|
695
|
-
|
|
691
|
+
core_tools.extend(
|
|
692
|
+
[listen, cursor, clipboard, screen_reader, yolo_vision]
|
|
693
|
+
)
|
|
694
|
+
except ImportError:
|
|
695
|
+
logger.info(
|
|
696
|
+
"strands-fun-tools not installed - vision/audio tools unavailable (install with: pip install devduck[all])"
|
|
697
|
+
)
|
|
698
|
+
else:
|
|
699
|
+
logger.info("--mcp mode: skipping vision/audio tools")
|
|
696
700
|
|
|
697
701
|
try:
|
|
698
702
|
from strands_tools import (
|
|
699
703
|
shell,
|
|
700
704
|
editor,
|
|
701
705
|
calculator,
|
|
702
|
-
python_repl,
|
|
706
|
+
# python_repl,
|
|
703
707
|
image_reader,
|
|
704
708
|
use_agent,
|
|
705
709
|
load_tool,
|
|
@@ -713,7 +717,7 @@ class DevDuck:
|
|
|
713
717
|
shell,
|
|
714
718
|
editor,
|
|
715
719
|
calculator,
|
|
716
|
-
python_repl,
|
|
720
|
+
# python_repl,
|
|
717
721
|
image_reader,
|
|
718
722
|
use_agent,
|
|
719
723
|
load_tool,
|
|
@@ -1267,7 +1271,13 @@ def weather(action: str, location: str = None) -> Dict[str, Any]:
|
|
|
1267
1271
|
|
|
1268
1272
|
# 🦆 Auto-initialize when imported
|
|
1269
1273
|
# Check environment variables to control server configuration
|
|
1274
|
+
# Also check if --mcp flag is present to skip auto-starting servers
|
|
1270
1275
|
_auto_start = os.getenv("DEVDUCK_AUTO_START_SERVERS", "true").lower() == "true"
|
|
1276
|
+
|
|
1277
|
+
# Disable auto-start if --mcp flag is present (stdio mode)
|
|
1278
|
+
if "--mcp" in sys.argv:
|
|
1279
|
+
_auto_start = False
|
|
1280
|
+
|
|
1271
1281
|
_tcp_port = int(os.getenv("DEVDUCK_TCP_PORT", "9999"))
|
|
1272
1282
|
_ws_port = int(os.getenv("DEVDUCK_WS_PORT", "8080"))
|
|
1273
1283
|
_mcp_port = int(os.getenv("DEVDUCK_MCP_PORT", "8000"))
|
|
@@ -1561,15 +1571,33 @@ def cli():
|
|
|
1561
1571
|
Examples:
|
|
1562
1572
|
devduck # Start interactive mode
|
|
1563
1573
|
devduck "your query here" # One-shot query
|
|
1574
|
+
devduck --mcp # MCP stdio mode (for Claude Desktop)
|
|
1564
1575
|
devduck --tcp-port 9000 # Custom TCP port
|
|
1565
1576
|
devduck --no-tcp --no-ws # Disable TCP and WebSocket
|
|
1566
1577
|
devduck --mcp-port 3000 # Custom MCP port
|
|
1578
|
+
|
|
1579
|
+
Claude Desktop Config:
|
|
1580
|
+
{
|
|
1581
|
+
"mcpServers": {
|
|
1582
|
+
"devduck": {
|
|
1583
|
+
"command": "uvx",
|
|
1584
|
+
"args": ["devduck", "--mcp"]
|
|
1585
|
+
}
|
|
1586
|
+
}
|
|
1587
|
+
}
|
|
1567
1588
|
""",
|
|
1568
1589
|
)
|
|
1569
1590
|
|
|
1570
1591
|
# Query argument
|
|
1571
1592
|
parser.add_argument("query", nargs="*", help="Query to send to the agent")
|
|
1572
1593
|
|
|
1594
|
+
# MCP stdio mode flag
|
|
1595
|
+
parser.add_argument(
|
|
1596
|
+
"--mcp",
|
|
1597
|
+
action="store_true",
|
|
1598
|
+
help="Start MCP server in stdio mode (for Claude Desktop integration)",
|
|
1599
|
+
)
|
|
1600
|
+
|
|
1573
1601
|
# Server configuration
|
|
1574
1602
|
parser.add_argument(
|
|
1575
1603
|
"--tcp-port", type=int, default=9999, help="TCP server port (default: 9999)"
|
|
@@ -1601,6 +1629,30 @@ Examples:
|
|
|
1601
1629
|
|
|
1602
1630
|
logger.info("CLI mode started")
|
|
1603
1631
|
|
|
1632
|
+
# Handle --mcp flag for stdio mode
|
|
1633
|
+
if args.mcp:
|
|
1634
|
+
logger.info("Starting MCP server in stdio mode (blocking, foreground)")
|
|
1635
|
+
print("🦆 Starting MCP stdio server...", file=sys.stderr)
|
|
1636
|
+
|
|
1637
|
+
# Don't auto-start HTTP/TCP/WS servers for stdio mode
|
|
1638
|
+
if devduck.agent:
|
|
1639
|
+
try:
|
|
1640
|
+
# Start MCP server in stdio mode - this BLOCKS until terminated
|
|
1641
|
+
devduck.agent.tool.mcp_server(
|
|
1642
|
+
action="start",
|
|
1643
|
+
transport="stdio",
|
|
1644
|
+
expose_agent=True,
|
|
1645
|
+
agent=devduck.agent,
|
|
1646
|
+
)
|
|
1647
|
+
except Exception as e:
|
|
1648
|
+
logger.error(f"Failed to start MCP stdio server: {e}")
|
|
1649
|
+
print(f"🦆 Error: {e}", file=sys.stderr)
|
|
1650
|
+
sys.exit(1)
|
|
1651
|
+
else:
|
|
1652
|
+
print("🦆 Agent not available", file=sys.stderr)
|
|
1653
|
+
sys.exit(1)
|
|
1654
|
+
return
|
|
1655
|
+
|
|
1604
1656
|
if args.query:
|
|
1605
1657
|
query = " ".join(args.query)
|
|
1606
1658
|
logger.info(f"CLI query: {query}")
|
|
@@ -28,7 +28,7 @@ version_tuple: VERSION_TUPLE
|
|
|
28
28
|
commit_id: COMMIT_ID
|
|
29
29
|
__commit_id__: COMMIT_ID
|
|
30
30
|
|
|
31
|
-
__version__ = version = '0.
|
|
32
|
-
__version_tuple__ = version_tuple = (0,
|
|
31
|
+
__version__ = version = '0.4.0'
|
|
32
|
+
__version_tuple__ = version_tuple = (0, 4, 0)
|
|
33
33
|
|
|
34
|
-
__commit_id__ = commit_id = '
|
|
34
|
+
__commit_id__ = commit_id = 'ga94b2b054'
|
|
@@ -190,9 +190,11 @@ def _start_mcp_server(
|
|
|
190
190
|
agent_invoke_tool = types.Tool(
|
|
191
191
|
name="devduck",
|
|
192
192
|
description=(
|
|
193
|
-
"Invoke
|
|
194
|
-
"
|
|
195
|
-
"
|
|
193
|
+
"Invoke a FULL DevDuck instance with complete capabilities. "
|
|
194
|
+
"Each invocation creates a fresh DevDuck agent with self-healing, "
|
|
195
|
+
"hot-reload, all tools, knowledge base integration, and system prompt building. "
|
|
196
|
+
"Use this for complex queries requiring reasoning, multi-tool orchestration, "
|
|
197
|
+
"or when you need the complete DevDuck experience via MCP."
|
|
196
198
|
),
|
|
197
199
|
inputSchema={
|
|
198
200
|
"type": "object",
|
|
@@ -228,7 +230,7 @@ def _start_mcp_server(
|
|
|
228
230
|
try:
|
|
229
231
|
logger.debug(f"call_tool: name={name}, arguments={arguments}")
|
|
230
232
|
|
|
231
|
-
# Handle agent invocation tool -
|
|
233
|
+
# Handle agent invocation tool - create a full DevDuck instance
|
|
232
234
|
if name == "devduck" and expose_agent:
|
|
233
235
|
prompt = arguments.get("prompt")
|
|
234
236
|
if not prompt:
|
|
@@ -241,8 +243,34 @@ def _start_mcp_server(
|
|
|
241
243
|
|
|
242
244
|
logger.debug(f"Invoking devduck with prompt: {prompt[:100]}...")
|
|
243
245
|
|
|
244
|
-
#
|
|
245
|
-
|
|
246
|
+
# Create a NEW DevDuck instance for this MCP invocation
|
|
247
|
+
# This gives full DevDuck power: self-healing, hot-reload, all tools, etc.
|
|
248
|
+
try:
|
|
249
|
+
from devduck import DevDuck
|
|
250
|
+
|
|
251
|
+
# Create fresh DevDuck instance (no auto-start to avoid recursion)
|
|
252
|
+
mcp_devduck = DevDuck(auto_start_servers=False)
|
|
253
|
+
mcp_agent = mcp_devduck.agent
|
|
254
|
+
|
|
255
|
+
if not mcp_agent:
|
|
256
|
+
return [
|
|
257
|
+
types.TextContent(
|
|
258
|
+
type="text",
|
|
259
|
+
text="❌ Error: Failed to create DevDuck instance",
|
|
260
|
+
)
|
|
261
|
+
]
|
|
262
|
+
|
|
263
|
+
# Execute with full DevDuck capabilities
|
|
264
|
+
result = mcp_agent(prompt)
|
|
265
|
+
|
|
266
|
+
except Exception as e:
|
|
267
|
+
logger.error(f"DevDuck creation failed: {e}", exc_info=True)
|
|
268
|
+
return [
|
|
269
|
+
types.TextContent(
|
|
270
|
+
type="text",
|
|
271
|
+
text=f"❌ Error creating DevDuck instance: {str(e)}",
|
|
272
|
+
)
|
|
273
|
+
]
|
|
246
274
|
|
|
247
275
|
# Extract text response from agent result
|
|
248
276
|
response_text = str(result)
|