devduck 0.2.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/.github/workflows/agent.yml +163 -0
- {devduck-0.2.0 → devduck-0.4.0}/.gitignore +3 -1
- devduck-0.4.0/PKG-INFO +260 -0
- devduck-0.4.0/README.md +215 -0
- devduck-0.4.0/action.yml +212 -0
- devduck-0.4.0/agent_runner.py +206 -0
- {devduck-0.2.0 → devduck-0.4.0}/devduck/__init__.py +325 -99
- {devduck-0.2.0 → devduck-0.4.0}/devduck/_version.py +3 -3
- devduck-0.4.0/devduck/tools/create_subagent.py +659 -0
- {devduck-0.2.0 → devduck-0.4.0}/devduck/tools/mcp_server.py +34 -6
- devduck-0.4.0/devduck/tools/store_in_kb.py +187 -0
- {devduck-0.2.0 → devduck-0.4.0}/devduck/tools/tcp.py +0 -3
- devduck-0.4.0/devduck/tools/use_github.py +438 -0
- {devduck-0.2.0 → devduck-0.4.0}/devduck/tools/websocket.py +1 -1
- devduck-0.4.0/devduck.egg-info/PKG-INFO +260 -0
- {devduck-0.2.0 → devduck-0.4.0}/devduck.egg-info/SOURCES.txt +16 -2
- {devduck-0.2.0 → devduck-0.4.0}/devduck.egg-info/requires.txt +9 -3
- devduck-0.4.0/mcp.json +10 -0
- {devduck-0.2.0 → devduck-0.4.0}/pyproject.toml +11 -3
- devduck-0.4.0/requirements.txt +4 -0
- devduck-0.4.0/setup-aws-oidc.sh +145 -0
- devduck-0.4.0/tools/__init__.py +0 -0
- devduck-0.4.0/tools/fetch_github_tool.py +201 -0
- devduck-0.4.0/tools/gist.py +708 -0
- devduck-0.4.0/tools/github_tools.py +134 -0
- devduck-0.4.0/tools/scraper.py +935 -0
- devduck-0.4.0/tools/system_prompt.py +485 -0
- devduck-0.2.0/PKG-INFO +0 -143
- devduck-0.2.0/README.md +0 -103
- devduck-0.2.0/devduck/install.sh +0 -42
- devduck-0.2.0/devduck.egg-info/PKG-INFO +0 -143
- {devduck-0.2.0 → devduck-0.4.0}/LICENSE +0 -0
- {devduck-0.2.0 → devduck-0.4.0}/MANIFEST.in +0 -0
- {devduck-0.2.0 → devduck-0.4.0}/devduck/__main__.py +0 -0
- {devduck-0.2.0 → devduck-0.4.0}/devduck/test_redduck.py +0 -0
- {devduck-0.2.0 → devduck-0.4.0}/devduck/tools/__init__.py +0 -0
- {devduck-0.2.0 → devduck-0.4.0}/devduck/tools/install_tools.py +0 -0
- {devduck-0.2.0 → devduck-0.4.0}/devduck.egg-info/dependency_links.txt +0 -0
- {devduck-0.2.0 → devduck-0.4.0}/devduck.egg-info/entry_points.txt +0 -0
- {devduck-0.2.0 → devduck-0.4.0}/devduck.egg-info/top_level.txt +0 -0
- {devduck-0.2.0 → devduck-0.4.0}/docs/index.html +0 -0
- {devduck-0.2.0 → devduck-0.4.0}/install.sh +0 -0
- {devduck-0.2.0 → devduck-0.4.0}/setup.cfg +0 -0
- {devduck-0.2.0 → devduck-0.4.0}/test.py +0 -0
|
@@ -0,0 +1,163 @@
|
|
|
1
|
+
name: DevDuck
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
schedule:
|
|
5
|
+
- cron: '0 8 * * *'
|
|
6
|
+
issues:
|
|
7
|
+
types: [opened, edited, closed, reopened, assigned, unassigned, labeled, unlabeled]
|
|
8
|
+
issue_comment:
|
|
9
|
+
types: [created, edited, deleted]
|
|
10
|
+
pull_request:
|
|
11
|
+
types: [opened, closed, edited, reopened, synchronize, ready_for_review]
|
|
12
|
+
pull_request_review:
|
|
13
|
+
types: [submitted, edited]
|
|
14
|
+
discussion:
|
|
15
|
+
types: [created, edited, answered, unanswered, category_changed, labeled, unlabeled, transferred, pinned, unpinned, locked, unlocked]
|
|
16
|
+
discussion_comment:
|
|
17
|
+
types: [created, edited, deleted]
|
|
18
|
+
pull_request_review_comment:
|
|
19
|
+
types: [created, edited]
|
|
20
|
+
workflow_dispatch:
|
|
21
|
+
inputs:
|
|
22
|
+
task:
|
|
23
|
+
description: 'Task'
|
|
24
|
+
required: false
|
|
25
|
+
type: string
|
|
26
|
+
system_prompt:
|
|
27
|
+
description: 'System prompt'
|
|
28
|
+
required: false
|
|
29
|
+
type: string
|
|
30
|
+
tools:
|
|
31
|
+
description: 'Comma-separated list of tools to enable for the agent'
|
|
32
|
+
required: false
|
|
33
|
+
type: string
|
|
34
|
+
provider:
|
|
35
|
+
description: 'Provider'
|
|
36
|
+
default: "bedrock"
|
|
37
|
+
required: false
|
|
38
|
+
type: choice
|
|
39
|
+
options:
|
|
40
|
+
- bedrock
|
|
41
|
+
- openai
|
|
42
|
+
- github
|
|
43
|
+
- anthropic
|
|
44
|
+
- litellm
|
|
45
|
+
- llamaapi
|
|
46
|
+
model:
|
|
47
|
+
description: 'Model ID'
|
|
48
|
+
default: "us.anthropic.claude-sonnet-4-5-20250929-v1:0"
|
|
49
|
+
required: false
|
|
50
|
+
type: string
|
|
51
|
+
max_tokens:
|
|
52
|
+
description: 'Max tokens'
|
|
53
|
+
default: "60000"
|
|
54
|
+
required: false
|
|
55
|
+
type: string
|
|
56
|
+
temperature:
|
|
57
|
+
description: 'Temperature (0.0-1.0)'
|
|
58
|
+
default: "1"
|
|
59
|
+
required: false
|
|
60
|
+
type: string
|
|
61
|
+
mcp_servers:
|
|
62
|
+
description: 'MCP servers configuration (JSON string)'
|
|
63
|
+
required: false
|
|
64
|
+
type: string
|
|
65
|
+
default: '{"mcpServers":{"strands-docs":{"command":"uvx","args":["strands-agents-mcp-server"],"timeout":30000}}}'
|
|
66
|
+
additional_request_fields:
|
|
67
|
+
description: 'Additional request fields JSON (e.g., thinking, anthropic_beta)'
|
|
68
|
+
required: false
|
|
69
|
+
type: string
|
|
70
|
+
|
|
71
|
+
permissions: write-all
|
|
72
|
+
|
|
73
|
+
jobs:
|
|
74
|
+
check-permissions:
|
|
75
|
+
runs-on: ubuntu-latest
|
|
76
|
+
outputs:
|
|
77
|
+
authorized: ${{ steps.check.outputs.authorized }}
|
|
78
|
+
steps:
|
|
79
|
+
- name: Check user authorization
|
|
80
|
+
id: check
|
|
81
|
+
run: |
|
|
82
|
+
# 🔐 CONFIGURE AUTHORIZED USERS HERE
|
|
83
|
+
# Add your authorized usernames (comma-separated)
|
|
84
|
+
AUTHORIZED_USERS="${{ secrets.AUTHORIZED_USERS }}"
|
|
85
|
+
|
|
86
|
+
echo "Checking authorization for user: ${{ github.actor }}"
|
|
87
|
+
|
|
88
|
+
# Check if the triggering user is in the authorized list
|
|
89
|
+
if [[ ",$AUTHORIZED_USERS," == *",${{ github.actor }},"* ]]; then
|
|
90
|
+
echo "✅ User ${{ github.actor }} is authorized"
|
|
91
|
+
echo "authorized=true" >> $GITHUB_OUTPUT
|
|
92
|
+
else
|
|
93
|
+
echo "❌ User ${{ github.actor }} is NOT authorized"
|
|
94
|
+
echo "Authorized users: $AUTHORIZED_USERS"
|
|
95
|
+
echo "authorized=false" >> $GITHUB_OUTPUT
|
|
96
|
+
fi
|
|
97
|
+
|
|
98
|
+
agent:
|
|
99
|
+
needs: check-permissions
|
|
100
|
+
runs-on: ubuntu-latest
|
|
101
|
+
# Only run if user is authorized
|
|
102
|
+
if: needs.check-permissions.outputs.authorized == 'true'
|
|
103
|
+
steps:
|
|
104
|
+
- name: Checkout code
|
|
105
|
+
uses: actions/checkout@v4
|
|
106
|
+
with:
|
|
107
|
+
token: ${{ secrets.PAT_TOKEN }}
|
|
108
|
+
|
|
109
|
+
- name: Run Strands Agent
|
|
110
|
+
uses: ./
|
|
111
|
+
env:
|
|
112
|
+
PAT_TOKEN: ${{ secrets.PAT_TOKEN }}
|
|
113
|
+
MODEL_PROVIDER: "bedrock"
|
|
114
|
+
with:
|
|
115
|
+
task: |
|
|
116
|
+
${{
|
|
117
|
+
github.event.inputs.task ||
|
|
118
|
+
'I received a GitHub event and am running autonomously. I will analyze the context and take appropriate action. I have full GitHub event details available.'
|
|
119
|
+
}}
|
|
120
|
+
|
|
121
|
+
# Model configuration
|
|
122
|
+
provider: ${{ github.event.inputs.provider || vars.STRANDS_PROVIDER || 'bedrock' }}
|
|
123
|
+
model: ${{ github.event.inputs.model || vars.STRANDS_MODEL_ID || 'us.anthropic.claude-sonnet-4-5-20250929-v1:0' }}
|
|
124
|
+
max_tokens: ${{ github.event.inputs.max_tokens || vars.STRANDS_MAX_TOKENS || '60000' }}
|
|
125
|
+
temperature: ${{ github.event.inputs.temperature || vars.STRANDS_TEMPERATURE || '1' }}
|
|
126
|
+
|
|
127
|
+
# System prompt configuration
|
|
128
|
+
system_prompt: ${{ github.event.inputs.system_prompt || vars.SYSTEM_PROMPT || vars.INPUT_SYSTEM_PROMPT || 'You are a restricted GitHub agent for this repository, powered by Strands Agents SDK. Only authorized users can trigger your execution.' }}
|
|
129
|
+
|
|
130
|
+
# Tool configuration
|
|
131
|
+
tools: ${{ github.event.inputs.tools || vars.STRANDS_TOOLS}}
|
|
132
|
+
|
|
133
|
+
# AWS configuration
|
|
134
|
+
aws_role_arn: ${{ secrets.AWS_ROLE_ARN }}
|
|
135
|
+
aws_region: ${{ secrets.AWS_REGION || 'us-west-2' }}
|
|
136
|
+
|
|
137
|
+
# Knowledge base
|
|
138
|
+
knowledge_base_id: ${{ secrets.STRANDS_KNOWLEDGE_BASE_ID }}
|
|
139
|
+
|
|
140
|
+
# Advanced configuration
|
|
141
|
+
additional_request_fields: ${{ github.event.inputs.additional_request_fields || vars.STRANDS_ADDITIONAL_REQUEST_FIELDS }}
|
|
142
|
+
bypass_tool_consent: "true"
|
|
143
|
+
|
|
144
|
+
# MCP configuration
|
|
145
|
+
mcp_servers: ${{ github.event.inputs.mcp_servers || vars.MCP_SERVERS }}
|
|
146
|
+
|
|
147
|
+
unauthorized-notice:
|
|
148
|
+
needs: check-permissions
|
|
149
|
+
runs-on: ubuntu-latest
|
|
150
|
+
# Only run if user is NOT authorized
|
|
151
|
+
if: needs.check-permissions.outputs.authorized == 'false'
|
|
152
|
+
steps:
|
|
153
|
+
- name: Unauthorized access attempt
|
|
154
|
+
run: |
|
|
155
|
+
echo "🚫 UNAUTHORIZED ACCESS ATTEMPT"
|
|
156
|
+
echo "User: ${{ github.actor }}"
|
|
157
|
+
echo "Repository: ${{ github.repository }}"
|
|
158
|
+
echo "Event: ${{ github.event_name }}"
|
|
159
|
+
echo "Time: $(date)"
|
|
160
|
+
echo ""
|
|
161
|
+
echo "This incident has been logged."
|
|
162
|
+
echo "Contact repository administrators for access."
|
|
163
|
+
exit 1
|
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)*
|