devduck 0.7.0__tar.gz → 1.1.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.

Files changed (54) hide show
  1. devduck-1.1.0/PKG-INFO +716 -0
  2. devduck-1.1.0/README.md +668 -0
  3. {devduck-0.7.0 → devduck-1.1.0}/action.yml +1 -1
  4. {devduck-0.7.0 → devduck-1.1.0}/devduck/__init__.py +151 -67
  5. {devduck-0.7.0 → devduck-1.1.0}/devduck/_version.py +3 -3
  6. devduck-1.1.0/devduck/tools/speech_to_speech.py +750 -0
  7. devduck-1.1.0/devduck.egg-info/PKG-INFO +716 -0
  8. {devduck-0.7.0 → devduck-1.1.0}/devduck.egg-info/SOURCES.txt +1 -0
  9. {devduck-0.7.0 → devduck-1.1.0}/devduck.egg-info/entry_points.txt +1 -0
  10. {devduck-0.7.0 → devduck-1.1.0}/devduck.egg-info/requires.txt +1 -0
  11. {devduck-0.7.0 → devduck-1.1.0}/pyproject.toml +2 -0
  12. devduck-0.7.0/PKG-INFO +0 -589
  13. devduck-0.7.0/README.md +0 -542
  14. devduck-0.7.0/devduck.egg-info/PKG-INFO +0 -589
  15. {devduck-0.7.0 → devduck-1.1.0}/.github/workflows/agent.yml +0 -0
  16. {devduck-0.7.0 → devduck-1.1.0}/.gitignore +0 -0
  17. {devduck-0.7.0 → devduck-1.1.0}/LICENSE +0 -0
  18. {devduck-0.7.0 → devduck-1.1.0}/MANIFEST.in +0 -0
  19. {devduck-0.7.0 → devduck-1.1.0}/agent_runner.py +0 -0
  20. {devduck-0.7.0 → devduck-1.1.0}/devduck/__main__.py +0 -0
  21. {devduck-0.7.0 → devduck-1.1.0}/devduck/agentcore_handler.py +0 -0
  22. {devduck-0.7.0 → devduck-1.1.0}/devduck/test_redduck.py +0 -0
  23. {devduck-0.7.0 → devduck-1.1.0}/devduck/tools/__init__.py +0 -0
  24. {devduck-0.7.0 → devduck-1.1.0}/devduck/tools/_ambient_input.py +0 -0
  25. {devduck-0.7.0 → devduck-1.1.0}/devduck/tools/_tray_app.py +0 -0
  26. {devduck-0.7.0 → devduck-1.1.0}/devduck/tools/agentcore_agents.py +0 -0
  27. {devduck-0.7.0 → devduck-1.1.0}/devduck/tools/agentcore_config.py +0 -0
  28. {devduck-0.7.0 → devduck-1.1.0}/devduck/tools/agentcore_invoke.py +0 -0
  29. {devduck-0.7.0 → devduck-1.1.0}/devduck/tools/agentcore_logs.py +0 -0
  30. {devduck-0.7.0 → devduck-1.1.0}/devduck/tools/ambient.py +0 -0
  31. {devduck-0.7.0 → devduck-1.1.0}/devduck/tools/create_subagent.py +0 -0
  32. {devduck-0.7.0 → devduck-1.1.0}/devduck/tools/install_tools.py +0 -0
  33. {devduck-0.7.0 → devduck-1.1.0}/devduck/tools/ipc.py +0 -0
  34. {devduck-0.7.0 → devduck-1.1.0}/devduck/tools/mcp_server.py +0 -0
  35. {devduck-0.7.0 → devduck-1.1.0}/devduck/tools/state_manager.py +0 -0
  36. {devduck-0.7.0 → devduck-1.1.0}/devduck/tools/store_in_kb.py +0 -0
  37. {devduck-0.7.0 → devduck-1.1.0}/devduck/tools/system_prompt.py +0 -0
  38. {devduck-0.7.0 → devduck-1.1.0}/devduck/tools/tcp.py +0 -0
  39. {devduck-0.7.0 → devduck-1.1.0}/devduck/tools/tray.py +0 -0
  40. {devduck-0.7.0 → devduck-1.1.0}/devduck/tools/use_github.py +0 -0
  41. {devduck-0.7.0 → devduck-1.1.0}/devduck/tools/websocket.py +0 -0
  42. {devduck-0.7.0 → devduck-1.1.0}/devduck.egg-info/dependency_links.txt +0 -0
  43. {devduck-0.7.0 → devduck-1.1.0}/devduck.egg-info/top_level.txt +0 -0
  44. {devduck-0.7.0 → devduck-1.1.0}/docs/index.html +0 -0
  45. {devduck-0.7.0 → devduck-1.1.0}/docs/mac-os-tray.jpg +0 -0
  46. {devduck-0.7.0 → devduck-1.1.0}/requirements.txt +0 -0
  47. {devduck-0.7.0 → devduck-1.1.0}/setup-aws-oidc.sh +0 -0
  48. {devduck-0.7.0 → devduck-1.1.0}/setup.cfg +0 -0
  49. {devduck-0.7.0 → devduck-1.1.0}/test.py +0 -0
  50. {devduck-0.7.0 → devduck-1.1.0}/tools/__init__.py +0 -0
  51. {devduck-0.7.0 → devduck-1.1.0}/tools/fetch_github_tool.py +0 -0
  52. {devduck-0.7.0 → devduck-1.1.0}/tools/gist.py +0 -0
  53. {devduck-0.7.0 → devduck-1.1.0}/tools/github_tools.py +0 -0
  54. {devduck-0.7.0 → devduck-1.1.0}/tools/scraper.py +0 -0
devduck-1.1.0/PKG-INFO ADDED
@@ -0,0 +1,716 @@
1
+ Metadata-Version: 2.4
2
+ Name: devduck
3
+ Version: 1.1.0
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[bidi-all]; sys_platform == "darwin"
35
+ Requires-Dist: strands-agents[otel]
36
+ Requires-Dist: strands-agents-tools
37
+ Requires-Dist: strands-fun-tools[all]; sys_platform == "darwin"
38
+ Requires-Dist: strands-fun-tools[audio]; sys_platform == "darwin"
39
+ Requires-Dist: beautifulsoup4
40
+ Requires-Dist: colorama
41
+ Requires-Dist: websockets
42
+ Requires-Dist: strands-mcp-server
43
+ Requires-Dist: bedrock-agentcore-starter-toolkit
44
+ Requires-Dist: bedrock-agentcore
45
+ Requires-Dist: rumps; sys_platform == "darwin"
46
+ Requires-Dist: strands-mlx; sys_platform == "darwin"
47
+ Dynamic: license-file
48
+
49
+ # 🦆 DevDuck
50
+
51
+ [![PyPI](https://badge.fury.io/py/devduck.svg)](https://pypi.org/project/devduck/)
52
+
53
+ **Self-modifying AI agent that hot-reloads its own code—builds itself as it runs.**
54
+
55
+ One Python file that adapts to your environment, fixes itself, and expands capabilities at runtime.
56
+
57
+ Learn more: https://duck.nyc
58
+
59
+ ## 🎬 See It In Action
60
+
61
+ | Feature | What You'll See | Demo |
62
+ |---------|----------------|-------|
63
+ | 🔥 **Hot-Reload** | Agent detects code changes and restarts instantly | [Watch](https://redduck.dev/videos/hot-reload.mp4) |
64
+ | 🌐 **Web UI** | Clean web interface with real-time streaming | [Watch](https://redduck.dev/videos/web-ui.mp4) |
65
+ | 🛠️ **Dynamic Tools** | Save `.py` file in `./tools/` → use instantly | [Watch](https://redduck.dev/videos/dynamic-tool-creation.mp4) |
66
+ | 🌊 **TCP Streaming** | Connect via netcat, apps, or other agents | [Watch](https://redduck.dev/videos/tcp.mp4) |
67
+ | 🔌 **IPC & Tray** | macOS menu bar + Unix socket IPC | ![Demo](docs/mac-os-tray.jpg) |
68
+ | 💬 **Ambient Overlay** | Floating AI input with glassmorphism UI | [Watch](https://redduck.dev/videos/floating-input.mp4) |
69
+
70
+ ---
71
+
72
+ ## Quick Start
73
+
74
+ ```bash
75
+ # Install & run
76
+ pipx install devduck && devduck
77
+
78
+ # One-shot query
79
+ devduck "create a REST API with FastAPI"
80
+
81
+ # Python API
82
+ python -c "import devduck; devduck('analyze this code')"
83
+ ```
84
+
85
+ **Requirements:** Python 3.10-3.13, AWS credentials (or Ollama/Anthropic/GitHub/MLX)
86
+
87
+ ---
88
+
89
+ ## Core Capabilities
90
+
91
+ | Feature | What It Does | How to Use |
92
+ |---------|--------------|------------|
93
+ | 🔥 **Hot-Reload** | Auto-restarts on code changes | Edit `__init__.py` → saves → auto-restart |
94
+ | 🛠️ **Runtime Tools** | Add/remove tools without restart | `manage_tools(action="add", ...)` |
95
+ | 📦 **Dynamic Loading** | Install packages and load tools on-the-fly | `install_tools(action="install_and_load", package="...")` |
96
+ | 🧠 **Auto-RAG** | Remembers conversations via Knowledge Base | Set `DEVDUCK_KNOWLEDGE_BASE_ID` |
97
+ | 🌊 **Multi-Protocol** | TCP, WebSocket, MCP, IPC servers | Auto-starts on ports 9999, 8080, 8000 |
98
+ | 🔌 **MCP Client** | Connect to external MCP servers | Set `MCP_SERVERS` env var |
99
+ | 💾 **State Time-Travel** | Save/restore agent state | `state_manager(action="export")` |
100
+ | 📝 **Self-Improvement** | Updates own system prompt | `system_prompt(action="add_context", ...)` |
101
+ | ☁️ **AWS Deploy** | One-command serverless | `agentcore_config(auto_launch=True)` |
102
+
103
+ ---
104
+
105
+ ## Developer Setup
106
+
107
+ ```bash
108
+ git clone git@github.com:cagataycali/devduck.git
109
+ cd devduck
110
+ python3.13 -m venv .venv
111
+ source .venv/bin/activate
112
+ .venv/bin/pip3.13 install -e .
113
+ devduck
114
+ ```
115
+
116
+ ---
117
+
118
+ ## Architecture
119
+
120
+ ```mermaid
121
+ graph TB
122
+ A[User Input] -->|CLI/TCP/WS/MCP/IPC| B[DevDuck Core]
123
+ B -->|Auto RAG| C[Knowledge Base]
124
+ C -.->|Context Retrieval| B
125
+ B -->|Tool Calls| D[38+ Built-in Tools]
126
+ D --> E[shell/editor/calculator]
127
+ D --> F[GitHub/AgentCore]
128
+ D --> G[TCP/WebSocket/MCP/IPC]
129
+ D --> H[tray/ambient/cursor/clipboard]
130
+ B -->|Hot-reload| I[./tools/*.py + __init__.py]
131
+ I -.->|Load Instantly| D
132
+ B -->|Runtime| K[manage_tools/install_tools]
133
+ K -.->|Expand| D
134
+ B -->|Response| J[User Output]
135
+ J -.->|Store Memory| C
136
+
137
+ style B fill:#e1f5ff
138
+ style C fill:#d4edda
139
+ style I fill:#fff3cd
140
+ style K fill:#ffe6cc
141
+ ```
142
+
143
+ **Self-adapting loop:** Query → RAG → Tools → Response → Memory → Hot-reload/Runtime-load → Repeat
144
+
145
+ ---
146
+
147
+ ## Model Setup
148
+
149
+ DevDuck **auto-detects** providers based on credentials:
150
+
151
+ **Priority:** Bedrock → Anthropic → OpenAI → GitHub → Gemini → Cohere → Writer → Mistral → LiteLLM → LlamaAPI → MLX → Ollama
152
+
153
+ | Provider | API Key | Auto-Detected |
154
+ |----------|---------|---------------|
155
+ | **Bedrock** | AWS credentials | ✅ If `boto3` auth succeeds |
156
+ | **Anthropic** | `ANTHROPIC_API_KEY` | ✅ If key present |
157
+ | **OpenAI** | `OPENAI_API_KEY` | ✅ If key present |
158
+ | **GitHub** | `GITHUB_TOKEN` or `PAT_TOKEN` | ✅ If key present |
159
+ | **Gemini** | `GOOGLE_API_KEY` or `GEMINI_API_KEY` | ✅ If key present |
160
+ | **Cohere** | `COHERE_API_KEY` | ✅ If key present |
161
+ | **Writer** | `WRITER_API_KEY` | ✅ If key present |
162
+ | **Mistral** | `MISTRAL_API_KEY` | ✅ If key present |
163
+ | **LiteLLM** | `LITELLM_API_KEY` | ✅ If key present |
164
+ | **LlamaAPI** | `LLAMAAPI_API_KEY` | ✅ If key present |
165
+ | **MLX** | No key needed | ✅ On Apple Silicon (M1/M2/M3) |
166
+ | **Ollama** | No key needed | ✅ Fallback if nothing else found |
167
+
168
+ **Just set your API key - DevDuck handles the rest:**
169
+ ```bash
170
+ export ANTHROPIC_API_KEY=sk-ant-...
171
+ devduck # Auto-uses Anthropic
172
+
173
+ export OPENAI_API_KEY=sk-...
174
+ devduck # Auto-uses OpenAI
175
+
176
+ export GOOGLE_API_KEY=...
177
+ devduck # Auto-uses Gemini
178
+ ```
179
+
180
+ **Manual override:**
181
+ ```bash
182
+ export MODEL_PROVIDER=bedrock
183
+ export STRANDS_MODEL_ID=us.anthropic.claude-sonnet-4-20250514-v1:0
184
+ devduck
185
+ ```
186
+
187
+ ---
188
+
189
+ ## Tool Management
190
+
191
+ ### Runtime Tool Management
192
+
193
+ Add, remove, or reload tools while agent is running:
194
+
195
+ ```python
196
+ # List all loaded tools
197
+ manage_tools(action="list")
198
+
199
+ # Add tools from a package at runtime
200
+ manage_tools(action="add", package="strands_fun_tools", tool_names="cursor,clipboard,bluetooth")
201
+
202
+ # Remove tools you don't need
203
+ manage_tools(action="remove", tool_names="cursor,clipboard")
204
+
205
+ # Reload specific tools after editing
206
+ manage_tools(action="reload", tool_names="shell,editor")
207
+
208
+ # Reload all tools (restarts agent)
209
+ manage_tools(action="reload")
210
+
211
+ # Load custom tool from file
212
+ manage_tools(action="add", tool_path="./my_custom_tool.py")
213
+ ```
214
+
215
+ ### Dynamic Package Installation
216
+
217
+ Install Python packages and load their tools at runtime:
218
+
219
+ ```python
220
+ # Discover available tools before loading
221
+ install_tools(action="list_available", package="strands-fun-tools", module="strands_fun_tools")
222
+
223
+ # Install package and load all tools
224
+ install_tools(action="install_and_load", package="strands-agents-tools", module="strands_tools")
225
+
226
+ # Install and load specific tools only
227
+ install_tools(
228
+ action="install_and_load",
229
+ package="strands-fun-tools",
230
+ module="strands_fun_tools",
231
+ tool_names=["clipboard", "cursor", "bluetooth"]
232
+ )
233
+
234
+ # Load tools from already installed package
235
+ install_tools(action="load", module="strands_tools", tool_names=["shell", "calculator"])
236
+
237
+ # List currently loaded tools
238
+ install_tools(action="list_loaded")
239
+ ```
240
+
241
+ ### Static Tool Configuration
242
+
243
+ **Format:** `package1:tool1,tool2;package2:tool3,tool4`
244
+
245
+ ```bash
246
+ # Minimal (shell + editor only)
247
+ export DEVDUCK_TOOLS="strands_tools:shell,editor"
248
+
249
+ # Dev essentials
250
+ export DEVDUCK_TOOLS="strands_tools:shell,editor,file_read,file_write,calculator"
251
+
252
+ # Full stack + GitHub
253
+ export DEVDUCK_TOOLS="devduck.tools:tcp,websocket,mcp_server,use_github;strands_tools:shell,editor,file_read"
254
+
255
+ devduck
256
+ ```
257
+
258
+ ### Hot-Reload Tools from Directory
259
+
260
+ Create `./tools/weather.py`:
261
+ ```python
262
+ from strands import tool
263
+ import requests
264
+
265
+ @tool
266
+ def weather(city: str) -> str:
267
+ """Get weather for a city."""
268
+ r = requests.get(f"https://wttr.in/{city}?format=%C+%t")
269
+ return r.text
270
+ ```
271
+
272
+ **Enable directory auto-loading:**
273
+ ```bash
274
+ export DEVDUCK_LOAD_TOOLS_FROM_DIR=true
275
+ devduck
276
+ # Save weather.py → use instantly (no restart needed)
277
+ ```
278
+
279
+ **Default:** Directory loading is OFF. Use `manage_tools()` or `install_tools()` for explicit control.
280
+
281
+ ---
282
+
283
+ ## MCP Integration
284
+
285
+ ### As MCP Server (Expose DevDuck)
286
+
287
+ **Claude Desktop** (`~/Library/Application Support/Claude/claude_desktop_config.json`):
288
+ ```json
289
+ {
290
+ "mcpServers": {
291
+ "devduck": {
292
+ "command": "uvx",
293
+ "args": ["devduck", "--mcp"]
294
+ }
295
+ }
296
+ }
297
+ ```
298
+
299
+ **Or start HTTP MCP server:**
300
+ ```python
301
+ mcp_server(action="start", port=8000, stateless=True)
302
+ # Connect at: http://localhost:8000/mcp
303
+ ```
304
+
305
+ **Modes:** `--mcp` (stdio for Claude Desktop) | `http` (background server) | `stateless=True` (multi-node)
306
+
307
+ ### As MCP Client (Load External Servers)
308
+
309
+ **Expand capabilities** by loading tools from external MCP servers:
310
+
311
+ ```bash
312
+ export MCP_SERVERS='{
313
+ "mcpServers": {
314
+ "strands-docs": {"command": "uvx", "args": ["strands-agents-mcp-server"]},
315
+ "remote": {"url": "https://api.example.com/mcp", "headers": {"Auth": "Bearer token"}},
316
+ "custom": {"command": "python", "args": ["my_server.py"]}
317
+ }
318
+ }'
319
+ devduck
320
+ ```
321
+
322
+ **Supported transports:** stdio (`command`/`args`/`env`) | HTTP (`url`/`headers`) | SSE (`url` with `/sse` path)
323
+
324
+ **Tool prefixing:** Each server's tools get prefixed (e.g., `strands-docs_search_docs`)
325
+
326
+ ---
327
+
328
+ ## Advanced Features
329
+
330
+ ### State Management (Time-Travel)
331
+
332
+ Save and restore agent state for reproducibility:
333
+
334
+ ```python
335
+ # Export current state
336
+ state_manager(action="export", metadata={"note": "before refactor"})
337
+
338
+ # List saved states
339
+ state_manager(action="list")
340
+
341
+ # Load and display state
342
+ state_manager(action="load", state_file="~/.devduck/states/devduck_20250118_150000.pkl")
343
+
344
+ # Resume from state (ephemeral - doesn't mutate parent)
345
+ state_manager(
346
+ action="resume",
347
+ state_file="~/.devduck/states/devduck_20250118_150000.pkl",
348
+ query="continue the analysis from where we left off"
349
+ )
350
+
351
+ # Modify state metadata
352
+ state_manager(
353
+ action="modify",
354
+ state_file="path/to/state.pkl",
355
+ metadata={"tags": ["important", "refactor"]}
356
+ )
357
+
358
+ # Delete state
359
+ state_manager(action="delete", state_file="path/to/state.pkl")
360
+ ```
361
+
362
+ States saved to: `~/.devduck/states/`
363
+
364
+ ### System Prompt Management
365
+
366
+ **Self-improvement** - agent updates its own system prompt:
367
+
368
+ ```python
369
+ # View current system prompt
370
+ system_prompt(action="view")
371
+
372
+ # Add new context (appends to prompt)
373
+ system_prompt(action="add_context", context="New learning: Always use FastAPI for APIs")
374
+
375
+ # Update entire prompt
376
+ system_prompt(action="update", prompt="You are a specialized DevOps agent...")
377
+
378
+ # Sync to GitHub (persist across deployments)
379
+ system_prompt(
380
+ action="update",
381
+ prompt="Updated system prompt with new learnings...",
382
+ repository="cagataycali/devduck"
383
+ )
384
+
385
+ # Reset to default
386
+ system_prompt(action="reset")
387
+ ```
388
+
389
+ **Pattern:** Learn → Add context → Sync to GitHub → Persist forever
390
+
391
+ ### Knowledge Base (Auto-RAG)
392
+
393
+ **Automatic memory** across sessions:
394
+
395
+ ```bash
396
+ export DEVDUCK_KNOWLEDGE_BASE_ID=your_kb_id
397
+ devduck
398
+ ```
399
+
400
+ **How it works:**
401
+ 1. Before each query: Retrieves relevant context from KB
402
+ 2. After each response: Stores conversation for future reference
403
+ 3. No manual tool calls needed - fully automatic
404
+
405
+ **Manual storage:**
406
+ ```python
407
+ store_in_kb(
408
+ content="Important information to remember...",
409
+ title="Project Context",
410
+ knowledge_base_id="optional-kb-id"
411
+ )
412
+ ```
413
+
414
+ ### Sub-Agent Creation
415
+
416
+ **Delegate tasks** to specialized agents via GitHub Actions:
417
+
418
+ ```python
419
+ # Create sub-agent with specific model and tools
420
+ create_subagent(
421
+ repository="owner/repo",
422
+ workflow_id="agent.yml",
423
+ task="Analyze this dataset and provide insights",
424
+ model="us.anthropic.claude-sonnet-4-20250514-v1:0",
425
+ provider="bedrock",
426
+ max_tokens=60000,
427
+ tools="file_read,python_repl,calculator,http_request"
428
+ )
429
+
430
+ # Custom system prompt for specialized behavior
431
+ create_subagent(
432
+ repository="owner/repo",
433
+ workflow_id="agent.yml",
434
+ task="Review code and suggest improvements",
435
+ tools="file_read,editor,shell",
436
+ system_prompt="You are a senior code reviewer focused on best practices"
437
+ )
438
+
439
+ # Check sub-agent status
440
+ create_subagent(action="status", repository="owner/repo", workflow_id="agent.yml", run_id="12345")
441
+
442
+ # List recent runs
443
+ create_subagent(action="list", repository="owner/repo", workflow_id="agent.yml")
444
+ ```
445
+
446
+ ---
447
+
448
+ <details>
449
+ <summary><strong>📋 All Built-in Tools (38 total)</strong></summary>
450
+
451
+ ### DevDuck Core (17 tools)
452
+ - `system_prompt` - Update agent's system prompt (GitHub sync support)
453
+ - `store_in_kb` - Store content in Bedrock Knowledge Base
454
+ - `state_manager` - Save/restore agent state (time-travel)
455
+ - `tcp` - TCP server with real-time streaming
456
+ - `websocket` - WebSocket server with concurrent messaging
457
+ - `ipc` - Unix socket IPC server for local processes
458
+ - `mcp_server` - Expose as MCP server (HTTP/stdio)
459
+ - `install_tools` - Install packages and load tools at runtime
460
+ - `create_subagent` - Spawn sub-agents via GitHub Actions
461
+ - `use_github` - GitHub GraphQL API operations
462
+ - `tray` - System tray app control (macOS)
463
+ - `ambient` - Ambient AI input overlay (macOS)
464
+ - `agentcore_config` - Configure & launch on Bedrock AgentCore
465
+ - `agentcore_invoke` - Invoke deployed AgentCore agents
466
+ - `agentcore_logs` - View CloudWatch logs from agents
467
+ - `agentcore_agents` - List/manage agent runtimes
468
+ - `manage_tools` - Runtime tool add/remove/reload
469
+ - `view_logs` - View/search/clear DevDuck logs
470
+
471
+ ### Strands Tools (13 tools)
472
+ - `shell` - Interactive shell with PTY support
473
+ - `editor` - File editing (view/create/replace/insert/undo)
474
+ - `file_read` - Multi-file reading with search modes
475
+ - `file_write` - Write content to files
476
+ - `file_read` - Read files with document mode for PDFs/CSVs
477
+ - `calculator` - SymPy-powered math (solve/derive/integrate)
478
+ - `image_reader` - Read images for Converse API
479
+ - `use_agent` - Nested agent with different model
480
+ - `load_tool` - Load custom tools from Python files
481
+ - `environment` - Environment variable management
482
+ - `mcp_client` - Connect to external MCP servers autonomously
483
+ - `retrieve` - Bedrock Knowledge Base retrieval
484
+ - `speak` - Text-to-speech (macOS `say` or AWS Polly)
485
+ - `slack` - Slack messaging and event handling
486
+
487
+ ### Strands Fun Tools (6 tools - macOS)
488
+ - `listen` - Background speech transcription (Whisper)
489
+ - `cursor` - Mouse & keyboard control
490
+ - `clipboard` - Clipboard monitoring & control
491
+ - `screen_reader` - OCR & UI element detection
492
+ - `bluetooth` - BLE scanning and GATT operations
493
+ - `yolo_vision` - Object detection with YOLO
494
+
495
+ ### Community Tools (./tools/)
496
+ - `fetch_github_tool` - Fetch and load tools from GitHub repos
497
+ - `gist` - Comprehensive GitHub Gist management (create/update/fork/star/comment)
498
+ - `scraper` - HTML/XML parsing with BeautifulSoup4
499
+ - `add_comment` - Add comments to GitHub issues/PRs
500
+ - `list_issues` - List GitHub repository issues
501
+ - `list_pull_requests` - List GitHub repository PRs
502
+
503
+ **Plus:** Hot-reload tools from `./tools/` directory when `DEVDUCK_LOAD_TOOLS_FROM_DIR=true`
504
+
505
+ </details>
506
+
507
+ ---
508
+
509
+ ## Hot-Reload Example
510
+
511
+ ```python
512
+ # ./tools/weather.py
513
+ from strands import tool
514
+ import requests
515
+
516
+ @tool
517
+ def weather(city: str) -> str:
518
+ """Get weather for a city."""
519
+ r = requests.get(f"https://wttr.in/{city}?format=%C+%t")
520
+ return r.text
521
+ ```
522
+
523
+ **Save → use instantly:**
524
+ ```bash
525
+ 🦆 weather(city="Tokyo")
526
+ # Clear sky +15°C
527
+ ```
528
+
529
+ No restart. No configuration. Just works.
530
+
531
+ ---
532
+
533
+ ## Access Methods
534
+
535
+ | Protocol | Endpoint | Test Command | Use Case |
536
+ |----------|----------|--------------|----------|
537
+ | **CLI** | Terminal | `devduck "query"` | Interactive/one-shot |
538
+ | **Python** | Import | `import devduck; devduck("query")` | Script integration |
539
+ | **TCP** | `localhost:9999` | `nc localhost 9999` | Network clients |
540
+ | **WebSocket** | `localhost:8080` | `wscat -c ws://localhost:8080` | Browser/async apps |
541
+ | **MCP** | `localhost:8000/mcp` | Add to Claude Desktop | MCP clients |
542
+ | **IPC** | `/tmp/devduck_main.sock` | `nc -U /tmp/devduck_main.sock` | Local processes |
543
+
544
+ **Custom ports:**
545
+ ```bash
546
+ export DEVDUCK_TCP_PORT=9000 DEVDUCK_WS_PORT=8001 DEVDUCK_MCP_PORT=8002
547
+ devduck
548
+ ```
549
+
550
+ **Disable servers:**
551
+ ```bash
552
+ export DEVDUCK_ENABLE_TCP=false DEVDUCK_ENABLE_MCP=false
553
+ devduck
554
+ ```
555
+
556
+ ---
557
+
558
+ ## Configuration
559
+
560
+ | Variable | Default | Description |
561
+ |----------|---------|-------------|
562
+ | **Model** | | |
563
+ | `MODEL_PROVIDER` | Auto | Manual override: `bedrock`, `anthropic`, `openai`, `github`, `gemini`, `cohere`, `writer`, `mistral`, `litellm`, `llamaapi`, `mlx`, `ollama` |
564
+ | `STRANDS_MODEL_ID` | Auto | Model name (e.g., `claude-sonnet-4`, `gpt-4o`, `qwen3:1.7b`) |
565
+ | **Provider API Keys** | | |
566
+ | `ANTHROPIC_API_KEY` | - | Anthropic API key (auto-detected) |
567
+ | `OPENAI_API_KEY` | - | OpenAI API key (auto-detected) |
568
+ | `GOOGLE_API_KEY` / `GEMINI_API_KEY` | - | Google Gemini API key (auto-detected) |
569
+ | `GITHUB_TOKEN` / `PAT_TOKEN` | - | GitHub token for GitHub Models (auto-detected) |
570
+ | `COHERE_API_KEY` | - | Cohere API key (auto-detected) |
571
+ | `WRITER_API_KEY` | - | Writer API key (auto-detected) |
572
+ | `MISTRAL_API_KEY` | - | Mistral API key (auto-detected) |
573
+ | `LITELLM_API_KEY` | - | LiteLLM API key (auto-detected) |
574
+ | `LLAMAAPI_API_KEY` | - | LlamaAPI key (auto-detected) |
575
+ | **Tools** | | |
576
+ | `DEVDUCK_TOOLS` | 38 tools | Format: `package1:tool1,tool2;package2:tool3` |
577
+ | `DEVDUCK_LOAD_TOOLS_FROM_DIR` | `false` | Auto-load from `./tools/` directory |
578
+ | **Memory** | | |
579
+ | `DEVDUCK_KNOWLEDGE_BASE_ID` | - | Bedrock KB ID for auto-RAG |
580
+ | `SYSTEM_PROMPT` | - | Additional system prompt content |
581
+ | **MCP** | | |
582
+ | `MCP_SERVERS` | - | JSON config for external MCP servers |
583
+ | **Servers** | | |
584
+ | `DEVDUCK_TCP_PORT` | `9999` | TCP server port |
585
+ | `DEVDUCK_WS_PORT` | `8080` | WebSocket server port |
586
+ | `DEVDUCK_MCP_PORT` | `8000` | MCP server port |
587
+ | `DEVDUCK_IPC_SOCKET` | `/tmp/devduck_main.sock` | IPC socket path |
588
+ | `DEVDUCK_ENABLE_TCP` | `true` | Enable TCP server |
589
+ | `DEVDUCK_ENABLE_WS` | `true` | Enable WebSocket server |
590
+ | `DEVDUCK_ENABLE_MCP` | `true` | Enable MCP server |
591
+ | `DEVDUCK_ENABLE_IPC` | `true` | Enable IPC server |
592
+ | **Context** | | |
593
+ | `DEVDUCK_LOG_LINE_COUNT` | `50` | Recent log lines in context |
594
+ | `DEVDUCK_LAST_MESSAGE_COUNT` | `200` | Recent messages in context |
595
+
596
+ ---
597
+
598
+ ## Troubleshooting
599
+
600
+ **Ollama model not found:**
601
+ ```bash
602
+ # DevDuck auto-pulls models, but if it fails:
603
+ ollama pull qwen3:1.7b
604
+ ```
605
+
606
+ **Port already in use:**
607
+ ```bash
608
+ # Change ports
609
+ export DEVDUCK_TCP_PORT=9000
610
+ export DEVDUCK_WS_PORT=8001
611
+ devduck
612
+ ```
613
+
614
+ **Hot-reload not working:**
615
+ ```bash
616
+ # Ensure tools directory exists
617
+ mkdir -p ./tools
618
+
619
+ # Check file watcher logs
620
+ devduck
621
+ 🦆 view_logs(action="search", pattern="watcher")
622
+ ```
623
+
624
+ **Memory/performance issues:**
625
+ ```bash
626
+ # Use lighter model
627
+ export STRANDS_MODEL_ID="qwen3:0.5b"
628
+
629
+ # Reduce context
630
+ export DEVDUCK_LOG_LINE_COUNT=20
631
+ export DEVDUCK_LAST_MESSAGE_COUNT=50
632
+ ```
633
+
634
+ **Ambient overlay not starting:**
635
+ ```bash
636
+ # Make sure tkinter is installed
637
+ python3 -c "import tkinter"
638
+
639
+ # Install tkinter if missing
640
+ brew install python-tk@3.13 # macOS
641
+ sudo apt-get install python3-tk # Ubuntu/Debian
642
+ sudo dnf install python3-tkinter # Fedora
643
+ ```
644
+
645
+ **Tray app not starting (macOS):**
646
+ ```bash
647
+ # Install rumps
648
+ pip install rumps
649
+
650
+ # Or reinstall devduck
651
+ pip install -e .
652
+ ```
653
+
654
+ **View logs:** `devduck` → `🦆 view_logs()`
655
+
656
+ ---
657
+
658
+ ## GitHub Actions
659
+
660
+ **Run DevDuck in CI/CD pipelines:**
661
+
662
+ ```yaml
663
+ name: AI Code Assistant
664
+ on:
665
+ issues:
666
+ types: [opened, edited]
667
+ pull_request:
668
+ types: [opened, edited, synchronize]
669
+
670
+ jobs:
671
+ devduck:
672
+ runs-on: ubuntu-latest
673
+ permissions:
674
+ contents: read
675
+ issues: write
676
+ pull-requests: write
677
+ steps:
678
+ - uses: cagataycali/devduck@main
679
+ with:
680
+ task: "Analyze and help with this issue or PR"
681
+ provider: "github"
682
+ model: "gpt-4o"
683
+ tools: "shell,file_read,file_write,use_github,calculator"
684
+ env:
685
+ GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
686
+ ```
687
+
688
+ **Sub-agent workflows:**
689
+ ```python
690
+ devduck("Create a sub-agent to analyze test coverage")
691
+ ```
692
+
693
+ ---
694
+
695
+ ## Resources
696
+
697
+ - **Strands SDK:** [github.com/strands-agents/sdk-python](https://github.com/strands-agents/sdk-python)
698
+ - **Documentation:** [strandsagents.com](https://strandsagents.com)
699
+ - **Web UI:** [cagataycali.github.io/devduck](http://cagataycali.github.io/devduck)
700
+
701
+ ---
702
+
703
+ ## Citation
704
+
705
+ ```bibtex
706
+ @software{devduck2025,
707
+ author = {Cagatay Cali},
708
+ title = {DevDuck: Self-Modifying AI Agent with Hot-Reload and Multi-Protocol Servers},
709
+ year = {2025},
710
+ url = {https://github.com/cagataycali/devduck}
711
+ }
712
+ ```
713
+
714
+ ---
715
+
716
+ **Apache 2.0** | Built with [Strands Agents](https://strandsagents.com) | [@cagataycali](https://github.com/cagataycali)