mercury-agent 0.4.8 → 0.4.10
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/container/Dockerfile.power +1 -1
- package/docs/container-lifecycle.md +4 -4
- package/examples/extensions/voice-transcribe/scripts/transcribe.py +1 -1
- package/package.json +1 -1
- package/resources/templates/mercury.example.yaml +1 -1
- package/src/agent/container-runner.ts +3 -1
- package/src/cli/mercury.ts +24 -10
- package/src/config.ts +1 -1
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
# Extends Base with: python3 + pip + venv, build-essential, jq, ffmpeg, bubblewrap
|
|
4
4
|
# The patch script, mrctl, and entrypoint are all inherited from Base — not duplicated here.
|
|
5
5
|
ARG BASE_TAG
|
|
6
|
-
FROM ghcr.io/
|
|
6
|
+
FROM ghcr.io/avishai-tsabari/mercury-agent:${BASE_TAG}-base
|
|
7
7
|
|
|
8
8
|
USER root
|
|
9
9
|
RUN apt-get update && apt-get install -y --no-install-recommends \
|
|
@@ -176,8 +176,8 @@ Message received
|
|
|
176
176
|
export MERCURY_CONTAINER_TIMEOUT_MS=600000
|
|
177
177
|
|
|
178
178
|
# Use a preset image from GitHub Container Registry
|
|
179
|
-
export MERCURY_AGENT_IMAGE=ghcr.io/
|
|
180
|
-
export MERCURY_AGENT_IMAGE=ghcr.io/
|
|
179
|
+
export MERCURY_AGENT_IMAGE=ghcr.io/avishai-tsabari/mercury-agent:latest # Full (default)
|
|
180
|
+
export MERCURY_AGENT_IMAGE=ghcr.io/avishai-tsabari/mercury-agent:minimal # Lightweight
|
|
181
181
|
```
|
|
182
182
|
|
|
183
183
|
## Sandboxing (Bubblewrap)
|
|
@@ -204,8 +204,8 @@ Mercury publishes two image presets to GitHub Container Registry:
|
|
|
204
204
|
|
|
205
205
|
| Preset | Size | Contents |
|
|
206
206
|
|--------|------|----------|
|
|
207
|
-
| `ghcr.io/
|
|
208
|
-
| `ghcr.io/
|
|
207
|
+
| `ghcr.io/avishai-tsabari/mercury-agent:latest` | ~2.8GB | Full devcontainer: Bun, Node.js, Python, Go, git, build tools |
|
|
208
|
+
| `ghcr.io/avishai-tsabari/mercury-agent:minimal` | ~1.9GB | Lightweight runtime: Bun + pi + Chromium deps |
|
|
209
209
|
|
|
210
210
|
Images are published on each release. Version-specific tags are also available (e.g., `:0.2.0`, `:0.2.0-minimal`).
|
|
211
211
|
|
|
@@ -117,7 +117,7 @@ def _run_transformers(audio_path: str, model_id: str) -> str:
|
|
|
117
117
|
model=model_id,
|
|
118
118
|
device=device,
|
|
119
119
|
)
|
|
120
|
-
result = pipe(audio_path)
|
|
120
|
+
result = pipe(audio_path, return_timestamps=True)
|
|
121
121
|
if isinstance(result, dict):
|
|
122
122
|
return (result.get("text") or "").strip()
|
|
123
123
|
return str(result).strip()
|
package/package.json
CHANGED
|
@@ -483,7 +483,9 @@ export class AgentContainerRunner {
|
|
|
483
483
|
logger.info("Agent image pulled successfully", { image });
|
|
484
484
|
} catch {
|
|
485
485
|
throw new Error(
|
|
486
|
-
`Failed to pull agent image: ${image}\
|
|
486
|
+
`Failed to pull agent image: ${image}\n` +
|
|
487
|
+
`Build it locally with: mercury build\n` +
|
|
488
|
+
`Or pull manually: docker pull ${image}`,
|
|
487
489
|
);
|
|
488
490
|
}
|
|
489
491
|
}
|
package/src/cli/mercury.ts
CHANGED
|
@@ -229,18 +229,32 @@ function buildAction(): void {
|
|
|
229
229
|
copyFileSync(src, dest);
|
|
230
230
|
}
|
|
231
231
|
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
232
|
+
const resourcesSrc = join(PACKAGE_ROOT, "resources");
|
|
233
|
+
const resourcesDest = join(tmpDir, "resources");
|
|
234
|
+
if (!existsSync(resourcesSrc)) {
|
|
235
|
+
console.error(`❌ resources/ not found at ${resourcesSrc}`);
|
|
236
|
+
console.error(
|
|
237
|
+
"The installed package may be corrupt. Try: npm install -g mercury-agent",
|
|
238
|
+
);
|
|
239
|
+
process.exit(1);
|
|
240
|
+
}
|
|
241
|
+
// Bun's cpSync with a filter callback silently fails on Windows —
|
|
242
|
+
// use without filter; node_modules exclusion is only needed in dev.
|
|
243
|
+
cpSync(resourcesSrc, resourcesDest, { recursive: true });
|
|
244
|
+
if (!existsSync(resourcesDest)) {
|
|
245
|
+
console.error(`❌ Failed to copy resources/ into build context`);
|
|
246
|
+
console.error(` Source: ${resourcesSrc} (exists: ${existsSync(resourcesSrc)})`);
|
|
247
|
+
console.error(` Dest: ${resourcesDest}`);
|
|
248
|
+
process.exit(1);
|
|
249
|
+
}
|
|
236
250
|
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
{ recursive: true },
|
|
241
|
-
);
|
|
251
|
+
const examplesSrc = join(PACKAGE_ROOT, "examples", "extensions");
|
|
252
|
+
const examplesDest = join(tmpDir, "examples", "extensions");
|
|
253
|
+
cpSync(examplesSrc, examplesDest, { recursive: true });
|
|
242
254
|
|
|
243
|
-
console.log(
|
|
255
|
+
console.log(`📦 Building container image...`);
|
|
256
|
+
console.log(` Package root: ${PACKAGE_ROOT}`);
|
|
257
|
+
console.log(` Build context: ${tmpDir}\n`);
|
|
244
258
|
const result = spawnSync(
|
|
245
259
|
"docker",
|
|
246
260
|
[
|
package/src/config.ts
CHANGED
|
@@ -118,7 +118,7 @@ const schema = z.object({
|
|
|
118
118
|
// ─── Container / Agent ──────────────────────────────────────────────
|
|
119
119
|
agentContainerImage: z
|
|
120
120
|
.string()
|
|
121
|
-
.default("ghcr.io/
|
|
121
|
+
.default("ghcr.io/avishai-tsabari/mercury-agent:latest"),
|
|
122
122
|
containerTimeoutMs: z.coerce
|
|
123
123
|
.number()
|
|
124
124
|
.int()
|