feat: add /add-ollama skill for local model inference (#712)
* feat: add /add-ollama skill for local model inference Adds a skill that integrates Ollama as an MCP server, allowing the container agent to offload tasks to local models (summarization, translation, general queries) while keeping Claude as orchestrator. Skill contents: - ollama-mcp-stdio.ts: stdio MCP server with ollama_list_models and ollama_generate tools - ollama-watch.sh: macOS notification watcher for Ollama activity - Modifications to index.ts (MCP config) and container-runner.ts (log surfacing) Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> * chore: rename skill from /add-ollama to /add-ollama-tool Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> --------- Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com> Co-authored-by: gavrielc <gabicohen22@yahoo.com>
This commit is contained in:
41
.claude/skills/add-ollama-tool/add/scripts/ollama-watch.sh
Executable file
41
.claude/skills/add-ollama-tool/add/scripts/ollama-watch.sh
Executable file
@@ -0,0 +1,41 @@
|
||||
#!/bin/bash
|
||||
# Watch NanoClaw IPC for Ollama activity and show macOS notifications
|
||||
# Usage: ./scripts/ollama-watch.sh
|
||||
|
||||
cd "$(dirname "$0")/.." || exit 1
|
||||
|
||||
echo "Watching for Ollama activity..."
|
||||
echo "Press Ctrl+C to stop"
|
||||
echo ""
|
||||
|
||||
LAST_TIMESTAMP=""
|
||||
|
||||
while true; do
|
||||
# Check all group IPC dirs for ollama_status.json
|
||||
for status_file in data/ipc/*/ollama_status.json; do
|
||||
[ -f "$status_file" ] || continue
|
||||
|
||||
TIMESTAMP=$(python3 -c "import json; print(json.load(open('$status_file'))['timestamp'])" 2>/dev/null)
|
||||
[ -z "$TIMESTAMP" ] && continue
|
||||
[ "$TIMESTAMP" = "$LAST_TIMESTAMP" ] && continue
|
||||
|
||||
LAST_TIMESTAMP="$TIMESTAMP"
|
||||
STATUS=$(python3 -c "import json; d=json.load(open('$status_file')); print(d['status'])" 2>/dev/null)
|
||||
DETAIL=$(python3 -c "import json; d=json.load(open('$status_file')); print(d.get('detail',''))" 2>/dev/null)
|
||||
|
||||
case "$STATUS" in
|
||||
generating)
|
||||
osascript -e "display notification \"$DETAIL\" with title \"NanoClaw → Ollama\" sound name \"Submarine\"" 2>/dev/null
|
||||
echo "$(date +%H:%M:%S) 🔄 $DETAIL"
|
||||
;;
|
||||
done)
|
||||
osascript -e "display notification \"$DETAIL\" with title \"NanoClaw ← Ollama ✓\" sound name \"Glass\"" 2>/dev/null
|
||||
echo "$(date +%H:%M:%S) ✅ $DETAIL"
|
||||
;;
|
||||
listing)
|
||||
echo "$(date +%H:%M:%S) 📋 Listing models..."
|
||||
;;
|
||||
esac
|
||||
done
|
||||
sleep 0.5
|
||||
done
|
||||
Reference in New Issue
Block a user