Refactor MCP server structure and add AI commit tool
- Restructure src/ into package src/crazy_mcp with modular tools - Add jj.py and sandbox.py tool modules for jujutsu and sandbox management - Remove circular dependency on crazy-mcp from pyproject.toml - Fix async get_state call in PMOCrazyCoder.py increment tool - Add bin/jj-ai-commit.sh for AI-generated commit messages from diffs - Update entrypoint to copy all bin scripts and create config directory
This commit is contained in:
16
bin/jj-ai-commit.sh
Executable file
16
bin/jj-ai-commit.sh
Executable file
@@ -0,0 +1,16 @@
|
||||
#!/bin/bash
|
||||
|
||||
LOCAL_LLM_API=${LOCAL_LLM_API:-http://host.docker.internal:1248/v1}
|
||||
|
||||
DIFF=$(jj diff)
|
||||
PROMPT='Analyse ce diff et réponds UNIQUEMENT avec un objet JSON valide contenant "title" (string) et "message" (string) pour le message de commit. Pas de texte avant ou après le JSON.'
|
||||
|
||||
CONTENT="${PROMPT}
|
||||
${DIFF}"
|
||||
|
||||
REQUEST=$(jq -n --arg content "$CONTENT" '{"model": "qwen3-coder", "messages": [{"role": "user", "content": $content}]}')
|
||||
|
||||
curl -s -X POST \
|
||||
-H "Content-Type: application/json" \
|
||||
-d "$REQUEST" \
|
||||
"$LOCAL_LLM_API/chat/completions" | jq -r '.choices[0].message.content' | jq -r '.title + "\n\n" + .message'
|
||||
Reference in New Issue
Block a user