integration: worker image, bridge, compose, Makefile, deploy scripts

This commit is contained in:
Raphael Westphal
2026-08-18 13:03:57 +02:00
parent 631aaf060b
commit 05ad577eea
8 changed files with 202 additions and 0 deletions
+32
View File
@@ -0,0 +1,32 @@
// lvmh worker bridge: headless pi session via SDK; the lvmh plugin (installed
// at /root/.pi/agent/extensions/lvmh-agent.ts) dials the daemon and delivers
// web prompts through pi.sendUserMessage. This process just hosts the session.
import { createAgentSession } from "@earendil-works/pi-coding-agent";
process.on("unhandledRejection", (err) => {
console.error("[lvmh-bridge] unhandledRejection:", err);
});
try {
const { session } = await createAgentSession();
console.error(`[lvmh-bridge] session up, cwd=${process.cwd()}`);
session.subscribe((event) => {
// Keep the loop warm; the extension does the mirroring.
if (event.type === "agent_settled") {
console.error("[lvmh-bridge] agent settled");
}
});
for (const sig of ["SIGTERM", "SIGINT"]) {
process.on(sig, () => {
console.error(`[lvmh-bridge] ${sig}, exiting`);
process.exit(0);
});
}
// Stay alive forever.
setInterval(() => {}, 1 << 30);
} catch (err) {
console.error("[lvmh-bridge] failed to create agent session", err);
process.exit(1);
}
+23
View File
@@ -0,0 +1,23 @@
{
"providers": {
"zai-renaud": {
"baseUrl": "https://api.z.ai/api/coding/paas/v4",
"api": "openai-completions",
"apiKey": "$ZAI_RENAUD_API_KEY",
"compat": {
"supportsDeveloperRole": false,
"thinkingFormat": "zai",
"supportsReasoningEffort": true
},
"models": [
{
"id": "glm-5.3",
"name": "GLM-5.3",
"reasoning": true,
"contextWindow": 1000000,
"thinkingLevelMap": { "xhigh": "xhigh", "max": "max" }
}
]
}
}
}
+23
View File
@@ -0,0 +1,23 @@
# lvmh worker image: headless pi with golang toolchain, git, ripgrep.
# Built by the daemon on first spawn if missing (LVMH_WORKER_DOCKERFILE),
# or manually via `make worker-image`.
FROM node:24-bookworm-slim
RUN apt-get update \
&& apt-get install -y --no-install-recommends \
bash ca-certificates git ripgrep curl xz-utils \
golang-go \
&& rm -rf /var/lib/apt/lists/*
RUN npm install -g --ignore-scripts @earendil-works/pi-coding-agent
# lvmh plugin: dial-home mirror (built from plugin/lvmh-agent.ts at image build)
ARG LVMH_PLUGIN=./plugin-placeholder
COPY ${LVMH_PLUGIN} /root/.pi/agent/extensions/lvmh-agent.ts
COPY docker/worker-models.json /root/.pi/agent/models.json
COPY docker/bridge /bridge
# Per-session pi sessions persist here (volume lvmh-sessions)
ENV PI_SESSION_DIR=/pi-sessions
WORKDIR /workspace
CMD ["node", "/bridge/index.mjs"]