devduck 0.5.0__py3-none-any.whl → 0.5.3__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 devduck might be problematic. Click here for more details.

@@ -0,0 +1,413 @@
1
+ Metadata-Version: 2.4
2
+ Name: devduck
3
+ Version: 0.5.3
4
+ Summary: 🦆 Extreme minimalist self-adapting AI agent - one file, self-healing, runtime dependencies
5
+ Author-email: Cagatay Cali <cagataycali@icloud.com>
6
+ License: Apache-2.0
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.14,>=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[anthropic]
33
+ Requires-Dist: strands-agents[openai]
34
+ Requires-Dist: strands-agents[otel]
35
+ Requires-Dist: strands-agents-tools
36
+ Requires-Dist: strands-fun-tools[all]; sys_platform == "darwin"
37
+ Requires-Dist: strands-fun-tools[audio]; sys_platform == "darwin"
38
+ Requires-Dist: beautifulsoup4
39
+ Requires-Dist: colorama
40
+ Requires-Dist: websockets
41
+ Requires-Dist: strands-mcp-server
42
+ Requires-Dist: bedrock-agentcore-starter-toolkit
43
+ Requires-Dist: bedrock-agentcore
44
+ Requires-Dist: rumps; sys_platform == "darwin"
45
+ Requires-Dist: strands-mlx; sys_platform == "darwin" and platform_machine == "arm64"
46
+ Dynamic: license-file
47
+
48
+ # 🦆 DevDuck
49
+
50
+ [![PyPI](https://badge.fury.io/py/devduck.svg)](https://pypi.org/project/devduck/)
51
+
52
+ **Self-modifying AI agent that hot-reloads its own code—builds itself as it runs.**
53
+
54
+ One Python file that adapts to your environment, fixes itself, and expands capabilities at runtime.
55
+
56
+ ---
57
+
58
+ ## Install & Run
59
+
60
+ | Method | Command |
61
+ |--------|---------|
62
+ | **pipx** | `pipx install devduck && devduck` |
63
+ | **uvx** | `uvx devduck "create a Flask API"` |
64
+ | **Python** | `pip install devduck` → `import devduck; devduck("query")` |
65
+
66
+ **Requirements:** Python 3.10-3.13, Bedrock (or Ollama/Anthropic/GitHub/MLX)
67
+
68
+ ---
69
+
70
+ ## What It Does
71
+
72
+ | Feature | Description | Example |
73
+ |---------|-------------|---------|
74
+ | 🔥 **Hot-Reload** | Agent reloads its own code + custom tools instantly | Modify agent code → auto-restart, or add `weather.py` → use immediately |
75
+ | 🧠 **Auto-RAG** | Remembers past conversations | "I prefer FastAPI" → later uses FastAPI automatically |
76
+ | 🌊 **Multi-Protocol** | CLI, Python, TCP, WebSocket, MCP, IPC | `devduck "query"` or `nc localhost 9999` |
77
+ | ☁️ **AWS Deploy** | One-command serverless deployment | `agentcore_config(auto_launch=True)` |
78
+ | 🛠️ **30+ Tools** | Shell, GitHub, file editing, math, UI control | `devduck("create GitHub issue")` |
79
+ | 🎛️ **Flexible Config** | Load only tools you need | `DEVDUCK_TOOLS="strands_tools:shell,editor"` |
80
+
81
+ ---
82
+
83
+ ## Architecture
84
+
85
+ ```mermaid
86
+ graph TB
87
+ A[User Input] -->|CLI/TCP/WS/MCP/IPC| B[DevDuck Core]
88
+ B -->|Auto RAG| C[Knowledge Base]
89
+ C -.->|Context Retrieval| B
90
+ B -->|Tool Calls| D[30+ Built-in Tools]
91
+ D --> E[shell/editor/calculator]
92
+ D --> F[GitHub/AgentCore]
93
+ D --> G[TCP/WebSocket/MCP/IPC]
94
+ D --> H[tray/ambient/cursor/clipboard]
95
+ B -->|Hot-reload| I[./tools/*.py + __init__.py]
96
+ I -.->|Load Instantly| D
97
+ B -->|Response| J[User Output]
98
+ J -.->|Store Memory| C
99
+
100
+ style B fill:#e1f5ff
101
+ style C fill:#d4edda
102
+ style I fill:#fff3cd
103
+ style H fill:#ffe6f0
104
+ ```
105
+
106
+ **Self-adapting loop:** User queries → RAG retrieval → Tool execution → Response → Memory storage → Hot-reload new capabilities → Repeat.
107
+
108
+ ---
109
+
110
+ ## Quick Start
111
+
112
+ ```bash
113
+ # 1. Install
114
+ pipx install devduck
115
+
116
+ # 2. Start (auto-launches TCP/WS/MCP/IPC servers)
117
+ devduck
118
+
119
+ # 3. Use
120
+ 🦆 create a REST API with FastAPI
121
+ 🦆 !ls -la
122
+ 🦆 exit
123
+ ```
124
+
125
+ **One-shot:**
126
+ ```bash
127
+ devduck "analyze this error: ImportError: No module named 'flask'"
128
+ ```
129
+
130
+ **Python API:**
131
+ ```python
132
+ import devduck
133
+ devduck("refactor my code to use async/await")
134
+ ```
135
+
136
+ ---
137
+
138
+ ## Model Setup
139
+
140
+ | Provider | Setup | When to Use |
141
+ |----------|-------|-------------|
142
+ | **Bedrock** (auto-detected) | [Get API key](https://console.aws.amazon.com/bedrock) → `export AWS_BEARER_TOKEN_BEDROCK=...` | Production (auto-selected if credentials found) |
143
+ | **MLX** (macOS auto-detected) | Auto-detected on Apple Silicon | Local, optimized for M-series Macs |
144
+ | **Ollama** (fallback) | `ollama pull qwen3:1.7b` | Local, free, private (used if Bedrock/MLX unavailable) |
145
+ | **Anthropic** | `export ANTHROPIC_API_KEY=...` | Claude API direct access |
146
+ | **GitHub** | `export GITHUB_TOKEN=...` | Free GPT-4o for GitHub users |
147
+
148
+ **Quick Bedrock setup:**
149
+ ```bash
150
+ export MODEL_PROVIDER=bedrock
151
+ export AWS_BEARER_TOKEN_BEDROCK=your_token # From AWS console
152
+ devduck
153
+ ```
154
+
155
+ ---
156
+
157
+ ## Core Tools
158
+
159
+ | Category | Tools | Use Case |
160
+ |----------|-------|----------|
161
+ | **Dev** | `shell`, `editor`, `file_read`, `calculator` | Code, test, debug |
162
+ | **GitHub** | `use_github`, `create_subagent` | Issues, PRs, CI/CD automation |
163
+ | **Network** | `tcp`, `websocket`, `mcp_server`, `ipc` | Serve agents over protocols |
164
+ | **AWS** | `agentcore_config`, `agentcore_invoke`, `agentcore_logs` | Deploy to serverless |
165
+ | **AI** | `use_agent`, `retrieve`, `store_in_kb` | Multi-agent, memory |
166
+ | **UI** (macOS) | `tray`, `ambient`, `cursor`, `clipboard` | Desktop automation |
167
+
168
+ <details>
169
+ <summary><strong>📋 Full tool list (click to expand)</strong></summary>
170
+
171
+ ### DevDuck Core Tools
172
+ - `tcp` - TCP server with streaming
173
+ - `websocket` - WebSocket server with concurrent messaging
174
+ - `ipc` - Unix socket IPC server
175
+ - `mcp_server` - MCP server (HTTP/stdio)
176
+ - `install_tools` - Dynamic tool loading from packages
177
+ - `use_github` - GitHub GraphQL API operations
178
+ - `create_subagent` - Spawn sub-agents via GitHub Actions
179
+ - `store_in_kb` - Store content in Bedrock Knowledge Base
180
+ - `system_prompt` - Manage agent system prompt
181
+ - `tray` - System tray app control (macOS)
182
+ - `ambient` - Ambient AI input overlay (macOS)
183
+
184
+ ### AgentCore Tools (AWS)
185
+ - `agentcore_config` - Configure & launch on Bedrock AgentCore
186
+ - `agentcore_invoke` - Invoke deployed agents
187
+ - `agentcore_logs` - View CloudWatch logs
188
+ - `agentcore_agents` - List/manage agent runtimes
189
+
190
+ ### strands-agents-tools
191
+ - `shell` - Interactive shell with PTY support
192
+ - `editor` - File editing (view/create/replace/insert)
193
+ - `file_read` - Multi-file reading with search
194
+ - `file_write` - Write content to files
195
+ - `calculator` - SymPy-powered math operations
196
+ - `image_reader` - Read images for Converse API
197
+ - `use_agent` - Nested agent with different model
198
+ - `load_tool` - Load custom tools at runtime
199
+ - `environment` - Environment variable management
200
+ - `mcp_client` - Connect to external MCP servers
201
+ - `retrieve` - Bedrock Knowledge Base retrieval
202
+
203
+ ### strands-fun-tools (macOS)
204
+ - `listen` - Background speech transcription with Whisper
205
+ - `cursor` - Mouse & keyboard control
206
+ - `clipboard` - Clipboard monitoring & control
207
+ - `screen_reader` - OCR & UI element detection
208
+ - `yolo_vision` - Object detection with YOLO
209
+
210
+ ### Hot-Reload Tools
211
+ - Custom tools in `./tools/*.py` load instantly
212
+ - Agent code changes trigger auto-restart
213
+
214
+ </details>
215
+
216
+ ---
217
+
218
+ ## Hot-Reload Example
219
+
220
+ ```python
221
+ # ./tools/weather.py
222
+ from strands import tool
223
+ import requests
224
+
225
+ @tool
226
+ def weather(city: str) -> str:
227
+ """Get weather for a city."""
228
+ r = requests.get(f"https://wttr.in/{city}?format=%C+%t")
229
+ return r.text
230
+ ```
231
+
232
+ **Save → use instantly:**
233
+ ```bash
234
+ 🦆 weather(city="Tokyo")
235
+ # Clear sky +15°C
236
+ ```
237
+
238
+ No restart. No configuration. Just works.
239
+
240
+ ---
241
+
242
+ ## Access Methods
243
+
244
+ | Protocol | Endpoint | Test Command |
245
+ |----------|----------|--------------|
246
+ | CLI | Terminal | `devduck "query"` |
247
+ | Python | Import | `from devduck import devduck` |
248
+ | TCP | `localhost:9999` | `nc localhost 9999` |
249
+ | WebSocket | `ws://localhost:8080` | `wscat -c ws://localhost:8080` |
250
+ | MCP | `http://localhost:8000/mcp` | Add to Claude Desktop config |
251
+ | IPC | `/tmp/devduck_main.sock` | `nc -U /tmp/devduck_main.sock` |
252
+
253
+ **Custom ports:** `export DEVDUCK_TCP_PORT=9000`
254
+
255
+ ---
256
+
257
+ ## Configuration
258
+
259
+ | Variable | Default | Options |
260
+ |----------|---------|---------|
261
+ | `MODEL_PROVIDER` | Auto-detect | `bedrock`, `anthropic`, `github`, `mlx`, `ollama` |
262
+ | `STRANDS_MODEL_ID` | Auto | Model name (e.g., `qwen3:1.7b`, `claude-sonnet-4`) |
263
+ | `DEVDUCK_TOOLS` | All | `pkg:tool1,tool2:pkg2:tool3` |
264
+ | `DEVDUCK_KNOWLEDGE_BASE_ID` | - | Bedrock KB ID for auto-RAG |
265
+ | `DEVDUCK_TCP_PORT` | `9999` | TCP server port |
266
+ | `DEVDUCK_ENABLE_TCP` | `true` | Enable/disable TCP |
267
+
268
+ **Minimal config (shell + editor only):**
269
+ ```bash
270
+ export DEVDUCK_TOOLS="strands_tools:shell,editor"
271
+ devduck
272
+ ```
273
+
274
+ ---
275
+
276
+
277
+ ## MCP Integration
278
+
279
+ **Claude Desktop** (`~/Library/Application Support/Claude/claude_desktop_config.json`):
280
+ ```json
281
+ {
282
+ "mcpServers": {
283
+ "devduck": {
284
+ "command": "uvx",
285
+ "args": ["devduck", "--mcp"]
286
+ }
287
+ }
288
+ }
289
+ ```
290
+
291
+ Restart Claude → DevDuck tools appear automatically.
292
+
293
+ ---
294
+
295
+ ## Troubleshooting
296
+
297
+ **Ollama model not found:**
298
+ ```bash
299
+ # DevDuck auto-pulls models, but if it fails:
300
+ ollama pull qwen3:1.7b
301
+ ```
302
+
303
+ **Port already in use:**
304
+ ```bash
305
+ # Change ports
306
+ export DEVDUCK_TCP_PORT=9000
307
+ export DEVDUCK_WS_PORT=8001
308
+ devduck
309
+ ```
310
+
311
+ **Hot-reload not working:**
312
+ ```bash
313
+ # Ensure tools directory exists
314
+ mkdir -p ./tools
315
+
316
+ # Check file watcher logs
317
+ devduck
318
+ 🦆 view_logs(action="search", pattern="watcher")
319
+ ```
320
+
321
+ **Memory/performance issues:**
322
+ ```bash
323
+ # Use lighter model
324
+ export STRANDS_MODEL_ID="qwen3:0.5b"
325
+
326
+ # Reduce context
327
+ export DEVDUCK_LOG_LINE_COUNT=20
328
+ export DEVDUCK_LAST_MESSAGE_COUNT=50
329
+ ```
330
+
331
+ **Ambient overlay not starting:**
332
+ ```bash
333
+ # Make sure tkinter is installed
334
+ python3 -c "import tkinter"
335
+
336
+ # Install tkinter if missing
337
+ brew install python-tk@3.13 # macOS
338
+ sudo apt-get install python3-tk # Ubuntu/Debian
339
+ sudo dnf install python3-tkinter # Fedora
340
+ ```
341
+
342
+ **Tray app not starting (macOS):**
343
+ ```bash
344
+ # Install rumps
345
+ pip install rumps
346
+
347
+ # Or reinstall devduck
348
+ pip install -e .
349
+ ```
350
+
351
+ **View logs:** `devduck` → `🦆 view_logs()`
352
+
353
+ ---
354
+
355
+ ## GitHub Actions
356
+
357
+ **Run DevDuck in CI/CD pipelines:**
358
+
359
+ ```yaml
360
+ name: AI Code Assistant
361
+ on:
362
+ issues:
363
+ types: [opened, edited]
364
+ pull_request:
365
+ types: [opened, edited, synchronize]
366
+
367
+ jobs:
368
+ devduck:
369
+ runs-on: ubuntu-latest
370
+ permissions:
371
+ contents: read
372
+ issues: write
373
+ pull-requests: write
374
+ steps:
375
+ - uses: cagataycali/devduck@main
376
+ with:
377
+ task: "Analyze and help with this issue or PR"
378
+ provider: "github"
379
+ model: "gpt-4o"
380
+ tools: "shell,file_read,file_write,use_github,calculator"
381
+ env:
382
+ GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
383
+ ```
384
+
385
+ **Sub-agent workflows:**
386
+ ```python
387
+ devduck("Create a sub-agent to analyze test coverage")
388
+ ```
389
+
390
+ ---
391
+
392
+ ## Resources
393
+
394
+ - **Strands SDK:** [github.com/strands-agents/sdk-python](https://github.com/strands-agents/sdk-python)
395
+ - **Documentation:** [strandsagents.com](https://strandsagents.com)
396
+ - **Web UI:** [cagataycali.github.io/devduck](http://cagataycali.github.io/devduck)
397
+
398
+ ---
399
+
400
+ ## Citation
401
+
402
+ ```bibtex
403
+ @software{devduck2025,
404
+ author = {Cagatay Cali},
405
+ title = {DevDuck: Self-Modifying AI Agent with Hot-Reload and Multi-Protocol Servers},
406
+ year = {2025},
407
+ url = {https://github.com/cagataycali/devduck}
408
+ }
409
+ ```
410
+
411
+ ---
412
+
413
+ **Apache 2.0** | Built with [Strands Agents](https://strandsagents.com) | [@cagataycali](https://github.com/cagataycali)
@@ -1,10 +1,15 @@
1
- devduck/__init__.py,sha256=q0IrDemVoenG34IU_LHdmjB7canmluWHQBbiTsgMYR8,57338
1
+ devduck/__init__.py,sha256=wtpaq3t6k1z0AT5RyW3-O9evSNV7Taaxw6xyiup022k,38867
2
2
  devduck/__main__.py,sha256=aeF2RR4k7lzSR2X1QKV9XQPCKhtsH0JYUv2etBBqmL0,145
3
- devduck/_version.py,sha256=fvHpBU3KZKRinkriKdtAt3crenOyysELF-M9y3ozg3U,704
3
+ devduck/_version.py,sha256=EWl7XaGZUG57Di8WiRltpKAkwy1CShJuJ-i6_rAPr-w,704
4
+ devduck/agentcore_handler.py,sha256=0DKJTTjoH9P8a70G0f5dOIIwy6bjqaN46voAWaSOpDY,2221
4
5
  devduck/test_redduck.py,sha256=nqRchR7d54jWGx7JN5tji2ZV4Ek4L9s-P7hp0mKjA0Y,1773
5
- devduck/tools/__init__.py,sha256=PAgIkQcxTx5KU441wi6OgCHiinRqjckQxRLcWqbUCwM,248
6
+ devduck/tools/__init__.py,sha256=vmfaz6785obybPDzJhdgO1e0Ty-bBtk5jSb0MskyyWQ,1276
6
7
  devduck/tools/_ambient_input.py,sha256=3lBgLO81BvkxjgTrQc-EuxNLXmO1oPUt2Ysg1jR4Fsk,13897
7
- devduck/tools/_tray_app.py,sha256=VOuuOLNpOJ0vp5WMgOnBvlfHYSeKzUiSpeJuFBFvxRw,19152
8
+ devduck/tools/_tray_app.py,sha256=E4rtJcegRsBs_FdQVGdA-0Ax7uxVb6AbuyqjwCArHj0,19405
9
+ devduck/tools/agentcore_agents.py,sha256=fiDNhl7R2tVbp1mEOySJTfGXwap5q3COenYOjiJDE_g,6488
10
+ devduck/tools/agentcore_config.py,sha256=KbX6XS7Wzh9cs1AWxJciDGtF97lAI1lfKliiSAinCQg,14802
11
+ devduck/tools/agentcore_invoke.py,sha256=SMKqVAig_cZEBL-W5gfumUpPFIHC9CSRSY9BJbnx6wY,17449
12
+ devduck/tools/agentcore_logs.py,sha256=A3YQIoRErJtvzeaMSPNqOLX1BH-vYTbYKs1NXoCnC5E,10222
8
13
  devduck/tools/ambient.py,sha256=HB1ZhfeOdOaMU0xe4e44VNUT_-DQ5SY7sl3r4r-4X44,4806
9
14
  devduck/tools/create_subagent.py,sha256=UzRz9BmU4PbTveZROEpZ311aH-u-i6x89gttu-CniAE,24687
10
15
  devduck/tools/install_tools.py,sha256=wm_67b9IfY-2wRuWgxuEKhaSIV5vNfbGmZL3G9dGi2A,10348
@@ -16,9 +21,9 @@ devduck/tools/tcp.py,sha256=f74xWa9pgBgQ3icr-KsRVM8GEEs6Wi9B4eP_ZYlKxhQ,21726
16
21
  devduck/tools/tray.py,sha256=hlX7LSsS1sOavVDulcsyydmKQ0jCa4Ong3kzsBYMlQY,7531
17
22
  devduck/tools/use_github.py,sha256=nr3JSGk48mKUobpgW__2gu6lFyUj93a1XRs3I6vH8W4,13682
18
23
  devduck/tools/websocket.py,sha256=lRJZt813iHorVr5UI66Lq-lmaFuLYAfpodeV2gtda7k,16635
19
- devduck-0.5.0.dist-info/licenses/LICENSE,sha256=UANcoWwfVeuM9597WUkjEQbzqIUH0bJoE9Tpwgj_LvU,11345
20
- devduck-0.5.0.dist-info/METADATA,sha256=OcmZn6REtBizgbUtfB9cro43M_w0DvgxAQeMryJ39cM,14533
21
- devduck-0.5.0.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
22
- devduck-0.5.0.dist-info/entry_points.txt,sha256=n2-DJpbibfm1YlPARgBdlseUZkZWYj09-eEadxamSGI,56
23
- devduck-0.5.0.dist-info/top_level.txt,sha256=ySXWlVronp8xHYfQ_Hdfr463e0EnbWuqyuxs94EU7yk,8
24
- devduck-0.5.0.dist-info/RECORD,,
24
+ devduck-0.5.3.dist-info/licenses/LICENSE,sha256=UANcoWwfVeuM9597WUkjEQbzqIUH0bJoE9Tpwgj_LvU,11345
25
+ devduck-0.5.3.dist-info/METADATA,sha256=EGqbmuhxoZUj31Ir7r1Fv7WjQMtxxLbiLVzGZftO-zU,12010
26
+ devduck-0.5.3.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
27
+ devduck-0.5.3.dist-info/entry_points.txt,sha256=BAMQaIg_BLZQOTk12bT7hy1dE9oGPLt-_dTbI4cnBnQ,40
28
+ devduck-0.5.3.dist-info/top_level.txt,sha256=ySXWlVronp8xHYfQ_Hdfr463e0EnbWuqyuxs94EU7yk,8
29
+ devduck-0.5.3.dist-info/RECORD,,
@@ -1,3 +1,2 @@
1
1
  [console_scripts]
2
- d = devduck:cli
3
2
  devduck = devduck:cli