push-oynptmmzrplt #2

Merged
eric merged 10 commits from push-oynptmmzrplt into main 2026-03-11 22:47:25 +01:00
10 changed files with 125 additions and 59 deletions
Showing only changes of commit f984f5f062 - Show all commits

View File

@@ -3,5 +3,9 @@
"dockerComposeFile": "docker-compose.yml", "dockerComposeFile": "docker-compose.yml",
"service": "pmocrazy-coder", "service": "pmocrazy-coder",
"workspaceFolder": "/workspace", "workspaceFolder": "/workspace",
"remoteUser": "devuser" "remoteUser": "devuser",
"settings": {
"terminal.integrated.shell.linux": "/bin/bash",
},
"features": {},
} }

View File

@@ -1,5 +1,3 @@
version: "3.8"
services: services:
pmocrazy-coder: pmocrazy-coder:
build: build:
@@ -9,7 +7,9 @@ services:
- ..:/workspace - ..:/workspace
working_dir: /workspace working_dir: /workspace
ports: ports:
- "1248:1248" - "1249:1248"
environment:
- LOCAL_LLM_API=http://host.docker.internal:1248/v1
user: devuser user: devuser
entrypoint: ["/usr/local/bin/entrypoint.sh"] entrypoint: ["/usr/local/bin/entrypoint.sh"]
command: ["bash", "-c", "tail -f /dev/null"] command: ["bash", "-c", "tail -f /dev/null"]

8
.opencode/config.json Normal file
View File

@@ -0,0 +1,8 @@
{
"llm": {
"provider": "openai",
"model": "default",
"apiKey": "not-needed",
"baseURL": "${LOCAL_LLM_API:-http://host.docker.internal:1248/v1}"
}
}

View File

@@ -1,29 +1,28 @@
# OpenCode Global Instructions # OpenCode Global Instructions Optimized for Minimal Scope
## Path handling rules ## Path handling
- Always use relative paths. Never generate absolute paths (e.g., /Users/..., /home/..., C:\...).
- Always use relative paths. - All paths must be relative to the project root unless explicitly specified.
- Never generate absolute paths (e.g. /Users/..., /home/..., C:\...). - Do not guess the current working directory. Ask for clarification if ambiguous.
- Never assume a specific username, OS, or local filesystem layout. - Only operate on files explicitly mentioned in the task. Never traverse directories not specified.
- All paths must be relative to the project root unless explicitly specified.
- Do not guess the current working directory.
- If the working directory is ambiguous, ask for clarification instead of inventing one.
## Workspace assumptions ## Workspace assumptions
- Assume the workspace root is the repository root.
- Do not infer environment-specific values (machine, OS, home directory).
- Only read or reference files explicitly provided or mentioned. Ignore all others.
- Assume the workspace root is the repository root. ## File generation
- Do not hardcode environment-specific values. - Generate only the requested file. Do not modify unrelated files.
- Do not infer the machine, OS, or home directory. - Do not add extra files or configurations unless explicitly requested.
- Output valid JSON without comments when JSON is requested.
## File generation rules - When accessing a file, assume no knowledge of other files unless explicitly provided.
- Generate only the requested file.
- Do not modify unrelated files.
- Do not add additional configuration unless explicitly requested.
- Output valid JSON with no comments when JSON is requested.
## Determinism ## Determinism
- Avoid creative alternatives. Produce a single, minimal, correct implementation.
- Do not propose multiple solutions unless explicitly asked.
- Do not speculate about missing files, directories, or dependencies.
- Avoid creative alternatives. ## Explicit scope limitation
- Do not propose multiple solutions unless asked. - Operate strictly on files and paths explicitly mentioned in the prompt.
- Produce a single, minimal, correct implementation. - Do not recursively explore the directory tree.
- Ask for clarification if necessary information is missing instead of assuming.

View File

@@ -4,9 +4,8 @@
// see the documentation: https://zed.dev/docs/configuring-zed#settings-files // see the documentation: https://zed.dev/docs/configuring-zed#settings-files
{ {
"inlay_hints": { "inlay_hints": {
"enabled": true "enabled": true,
}, },
"colorize_brackets": true, "colorize_brackets": true,
"project_name": "PMO Crazy Coder", "project_name": "PMO Crazy Coder",
"autosave": "on_window_change",
} }

View File

@@ -1,22 +1,40 @@
FROM debian:bookworm-slim FROM debian:bookworm-slim
RUN apt-get update && apt-get install -y \ RUN apt-get update && apt-get install -y \
python3 python3-pip \ clang llvm-dev libclang-dev pkg-config build-essential git make curl nodejs npm \
golang-go rustc cargo \ pylint black flake8 mypy isort logrotate sudo cmake libicu-dev zlib1g-dev \
r-base \ libcurl4-openssl-dev libssl-dev ruby-dev jq python3 python3-pip golang-go rustc cargo \
sqlite3 build-essential git curl wget \ r-base sqlite3 wget bash zsh libgit2-dev \
bash zsh \
&& apt-get clean && rm -rf /var/lib/apt/lists/* && apt-get clean && rm -rf /var/lib/apt/lists/*
# Installer jj RUN echo "deb http://deb.debian.org/debian testing main" > /etc/apt/sources.list.d/testing.list
RUN curl -LO https://github.com/martinvonz/jj/releases/latest/download/jj-x86_64-unknown-linux-gnu \
&& chmod +x jj-x86_64-unknown-linux-gnu \
&& mv jj-x86_64-unknown-linux-gnu /opt/bin/jj
# Installer jj_lsp (si binaire séparé) COPY tools/install_latest_go.sh /tmp/install_latest_go.sh
RUN curl -LO https://github.com/martinvonz/jj/releases/latest/download/jj_lsp-x86_64-unknown-linux-gnu \ RUN bash /tmp/install_latest_go.sh && \
&& chmod +x jj_lsp-x86_64-unknown-linux-gnu \ echo "PATH=/usr/local/go/bin:$PATH" >> /root/.bashrc
&& mv jj_lsp-x86_64-unknown-linux-gnu /opt/bin/jj_lsp ENV PATH=/usr/local/go/bin:$PATH
ENV RUSTUP_HOME=/usr/local/rustup
ENV CARGO_HOME=/usr/local/cargo
ENV PATH=/usr/local/cargo/bin:$PATH
RUN curl https://sh.rustup.rs -sSf | sh -s -- -y --default-toolchain stable && \
rustup install nightly && \
rustup component add rustfmt clippy rust-src rust-docs && \
cargo install cargo-edit cargo-watch cargo-outdated cargo-make cargo-binstall
RUN npm install -g typescript tsc @types/node eslint prettier
RUN cargo binstall --strategies crate-meta-data jj-cli
RUN cargo install --git https://github.com/nilskch/jj-lsp.git
RUN gem install github-linguist
RUN pip install --no-cache-dir --break-system-packages ruff fastmcp ipython
RUN curl -fsSL https://opencode.ai/install | bash && \
mkdir -p /root/.config/opencode && \
mv /root/.opencode/bin/opencode /usr/local/bin/
COPY opt/bin/ /opt/bin/ COPY opt/bin/ /opt/bin/
COPY opt/dev-tools/ /opt/dev-tools/ COPY opt/dev-tools/ /opt/dev-tools/
@@ -27,8 +45,8 @@ ENV PATH="/opt/bin:/opt/dev-tools:/opt/lm-client:${PATH}"
ARG USERNAME=devuser ARG USERNAME=devuser
ARG USER_UID=1000 ARG USER_UID=1000
ARG USER_GID=1000 ARG USER_GID=1000
RUN groupadd --gid $USER_GID $USERNAME \ RUN groupadd --gid $USER_GID $USERNAME && \
&& useradd --uid $USER_UID --gid $USER_GID -m $USERNAME useradd --uid $USER_UID --gid $USER_GID -m $USERNAME
COPY docker-entrypoint.sh /usr/local/bin/entrypoint.sh COPY docker-entrypoint.sh /usr/local/bin/entrypoint.sh
RUN chmod +x /usr/local/bin/entrypoint.sh RUN chmod +x /usr/local/bin/entrypoint.sh

View File

@@ -1,10 +0,0 @@
version: "3.8"
services:
pmocrazy-coder:
build: .
volumes:
- .:/workspace
working_dir: /workspace
ports:
- "1248:1248"

View File

@@ -1,14 +1,29 @@
#!/bin/bash #!/bin/bash
# docker-entrypoint.sh # docker-entrypoint.sh
# --- Initialise .ai_index si nécessaire ---
if [ ! -d "/workspace/.ai_index" ]; then if [ ! -d "/workspace/.ai_index" ]; then
mkdir -p /workspace/.ai_index/ast mkdir -p /workspace/.ai_index/ast
mkdir -p /workspace/.ai_index/embeddings mkdir -p /workspace/.ai_index/embeddings
touch /workspace/.ai_index/graph.db touch /workspace/.ai_index/graph.db
fi fi
/opt/bin/mcp-server > /workspace/.ai_index/mcp.log 2>&1 & # --- Configure LOCAL_LLM_API pour Bash ---
MCP_PID=$! if [ -n "$LOCAL_LLM_API" ]; then
echo $MCP_PID > /workspace/.ai_index/mcp.pid if ! grep -q "LOCAL_LLM_API" /home/devuser/.bashrc; then
echo "export LOCAL_LLM_API=$LOCAL_LLM_API" >> /home/devuser/.bashrc
fi
fi
exec "$@" # --- Lance MCP server en background si pas déjà lancé ---
if [ ! -f "/workspace/.ai_index/mcp.pid" ] || ! kill -0 $(cat /workspace/.ai_index/mcp.pid) 2>/dev/null; then
/opt/bin/mcp-server >/workspace/.ai_index/mcp.log 2>&1 &
echo $! >/workspace/.ai_index/mcp.pid
fi
# --- Force Bash comme shell par défaut ---
if [ -z "$1" ]; then
exec /bin/bash
else
exec "$@"
fi

View File

@@ -1,3 +1,3 @@
LM Studio client for Qwen3-Coder-Next Local LLM API client for Qwen3-Coder-Next
Download from: https://lmstudio.ai/ Download from: https://lmstudio.ai/
Configure to run on localhost:1248 Configure to run on http://host.docker.internal:1248/v1 (or set LOCAL_LLM_API environment variable)

View File

@@ -0,0 +1,33 @@
#!/bin/bash
URL="https://go.dev/dl/"
OS=$(uname -a | awk '{print $1}')
ARCH=$(uname -m)
if [[ "$ARCH" == "x86_64" ]] ; then
ARCH="amd64"
fi
if [[ "$ARCH" == "aarch64" ]] ; then
ARCH="arm64"
fi
GOFILE=$(curl "$URL" \
| grep 'class="download"' \
| grep "\.tar\.gz" \
| sed -E 's@^.*/dl/(go[1-9].+\.tar\.gz)".*$@\1@' \
| grep -i "$OS" \
| grep -i "$ARCH" \
| head -1)
GOURL=$(curl "${URL}${GOFILE}" \
| sed -E 's@^.*href="(.*\.tar\.gz)".*$@\1@')
echo "Install GO from : $GOURL" 1>&2
mkdir -p /usr/local
cd /usr/local
curl "$GOURL" \
| tar zxf -