@@ -14,7 +14,7 @@ ENV PATH="${PATH}:${PYTHON_DIR}/bin"
1414RUN <<'FOE'
1515
1616ln -s /usr/local/bin/bun /usr/local/bin/node
17- ls -s /usr/local/bin/bun /usr/local/bin/npx
17+ ln -s /usr/local/bin/bun /usr/local/bin/npx
1818
1919apt-get update
2020apt-get install \
7979FOE
8080
8181ARG OPENCODE_VERSION=latest
82- ARG AZURE_FOUNDRY_PROVIDER_REF=v0.3.1
82+ ARG CAVEMAN_VERSION=latest
83+ ARG AZURE_FOUNDRY_PROVIDER_REF=v0.4.0
8384ARG ENGRAM_VERSION=latest
8485ARG OPENCODE_BUILD_DIR=/usr/local/share/opencode-build
8586
@@ -116,6 +117,10 @@ resolve_github_latest_version() {
116117 echo "${version}"
117118}
118119
120+ resolve_caveman_version() {
121+ resolve_github_latest_version "JuliusBrussee/caveman" "${CAVEMAN_VERSION}"
122+ }
123+
119124mkdir -p "${BUN_INSTALL}" "${OPENCODE_CONFIG_DIR}" "${OPENCODE_PLUGINS_DIR}" "${PROVIDER_DIR}"
120125chmod 0777 "${OPENCODE_CONFIG_DIR}"
121126
@@ -185,6 +190,41 @@ curl -fsSL "https://raw.githubusercontent.com/rtk-ai/rtk/refs/heads/master/hooks
185190# vercel/skills
186191bun install -g --trust skills@latest
187192
193+ # ##
194+ # caveman
195+ #
196+ caveman_resolved_version=$(resolve_caveman_version) || exit 1
197+ echo "CAVEMAN_RESOLVED_REF=${caveman_resolved_version}"
198+ echo "${caveman_resolved_version}" > /tmp/caveman_version
199+
200+ mkdir -p "${OPENCODE_CONFIG_DIR}/plugins/caveman" "${OPENCODE_CONFIG_DIR}/commands"
201+
202+ CAVEMAN_RAW_BASE="https://raw.githubusercontent.com/JuliusBrussee/caveman/refs/tags/${caveman_resolved_version}"
203+
204+ {
205+ curl -fsSL "${CAVEMAN_RAW_BASE}/src/plugins/opencode/package.json" -o "${OPENCODE_CONFIG_DIR}/plugins/caveman/package.json"
206+ curl -fsSL "${CAVEMAN_RAW_BASE}/src/plugins/opencode/plugin.js" -o "${OPENCODE_CONFIG_DIR}/plugins/caveman/plugin.js"
207+ curl -fsSL "${CAVEMAN_RAW_BASE}/src/hooks/caveman-config.js" -o "${OPENCODE_CONFIG_DIR}/plugins/caveman/caveman-config.cjs"
208+ curl -fsSL "${CAVEMAN_RAW_BASE}/src/plugins/opencode/commands/caveman.md" -o "${OPENCODE_CONFIG_DIR}/commands/caveman.md"
209+ curl -fsSL "${CAVEMAN_RAW_BASE}/src/plugins/opencode/commands/caveman-commit.md" -o "${OPENCODE_CONFIG_DIR}/commands/caveman-commit.md"
210+ curl -fsSL "${CAVEMAN_RAW_BASE}/src/plugins/opencode/commands/caveman-review.md" -o "${OPENCODE_CONFIG_DIR}/commands/caveman-review.md"
211+ curl -fsSL "${CAVEMAN_RAW_BASE}/src/plugins/opencode/commands/caveman-stats.md" -o "${OPENCODE_CONFIG_DIR}/commands/caveman-stats.md"
212+ curl -fsSL "${CAVEMAN_RAW_BASE}/src/plugins/opencode/commands/caveman-help.md" -o "${OPENCODE_CONFIG_DIR}/commands/caveman-help.md"
213+ } & wait || exit 1
214+
215+ cat > "${OPENCODE_CONFIG_DIR}/commands/caveman-compress.md" <<'EOF'
216+ ---
217+ description: Compress a Markdown memory file using the caveman-compress skill
218+ ---
219+ Compress the target file with `caveman-compress`.
220+
221+ Input: `$ARGUMENTS`
222+
223+ Run the installed `caveman-compress` skill workflow against the given file path.
224+ Preserve code, URLs, paths, commands, and structure exactly as the skill requires.
225+ Overwrite the original file only if the compression succeeds, and keep the `.original.md` backup.
226+ EOF
227+
188228# ##
189229# cleanup
190230rm -rf /root/.bun
@@ -199,6 +239,10 @@ COPY skills.yaml "${OPENCODE_BUILD_DIR}/skills.yaml"
199239RUN <<'FOE'
200240source /etc/bash.bashrc
201241
242+ CAVEMAN_RESOLVED_REF=$(cat /tmp/caveman_version)
243+
244+ export CAVEMAN_RESOLVED_REF
245+
202246BUN_INSTALL=/tmp/bun bun install --cwd "${OPENCODE_BUILD_DIR}/scripts" yaml || exit 1
203247bun "${OPENCODE_BUILD_DIR}/scripts/install-skills.ts" || exit 1
204248
@@ -210,6 +254,7 @@ cat >"${OPENCODE_CONFIG_DIR}/opencode.json" <<-'EOF'
210254 "$schema" : "https://opencode.ai/config.json" ,
211255 "plugin" : [
212256 "file:///usr/local/bun/install/global/node_modules/opencode-gemini-auth" ,
257+ "file:///etc/opencode/plugins/caveman"
213258 ],
214259 "mcp" : {
215260 "engram" : {
0 commit comments