mercury-agent 0.4.24 → 0.4.25
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/README.md +5 -0
- package/docs/runbooks/publish-checklist.md +38 -0
- package/package.json +1 -1
- package/src/core/router.ts +7 -0
package/README.md
CHANGED
|
@@ -17,6 +17,7 @@ Mercury is a personal AI assistant that lives where you chat. It connects to Wha
|
|
|
17
17
|
|
|
18
18
|
## Prerequisites
|
|
19
19
|
|
|
20
|
+
- **[Node.js](https://nodejs.org/)** >= 18 — Required for `npm install -g mercury-agent`
|
|
20
21
|
- **[Bun](https://bun.sh)** >= 1.0 — JavaScript runtime used by Mercury
|
|
21
22
|
- **[Docker](https://docs.docker.com/get-docker/)** — Required for running agent containers
|
|
22
23
|
- **Windows users:** Mercury runs best under [WSL2](https://learn.microsoft.com/en-us/windows/wsl/install). Install WSL2 with `wsl --install`, then install Bun and Docker inside it.
|
|
@@ -357,6 +358,10 @@ Supported OAuth providers: Anthropic, GitHub Copilot, Google Gemini CLI, Antigra
|
|
|
357
358
|
|----------|---------|-------------|
|
|
358
359
|
| `MERCURY_AGENT_CONTAINER_IMAGE` | `ghcr.io/avishai-tsabari/mercury-agent:latest` | Container image |
|
|
359
360
|
| `MERCURY_CONTAINER_TIMEOUT_MS` | `300000` | Container timeout (5 min) |
|
|
361
|
+
| `MERCURY_CONTAINER_RUNTIME` | `runc` | `runc` (default) or `runsc` ([gVisor](https://gvisor.dev)) |
|
|
362
|
+
| `MERCURY_CONTAINER_BWRAP_DOCKER_COMPAT` | `false` | Set `true` on Linux Docker Engine (see note below) |
|
|
363
|
+
|
|
364
|
+
> **Linux Docker Engine:** Mercury uses [bubblewrap](https://github.com/containers/bubblewrap) for in-container sandboxing. On Linux Docker Engine (not Docker Desktop), bwrap cannot mount `/proc` without extra privileges. Either set `container_bwrap_docker_compat: true` in `mercury.yaml` (adds `--privileged` to `docker run`), or install [gVisor](https://gvisor.dev/docs/user_guide/install/) and set `MERCURY_CONTAINER_RUNTIME=runsc` to skip bwrap entirely.
|
|
360
365
|
|
|
361
366
|
**KB Distillation:**
|
|
362
367
|
|
|
@@ -6,3 +6,41 @@ Before publishing a new version to npm:
|
|
|
6
6
|
2. **`mercury build`** — if you touched build path, Dockerfiles, or file-copy logic
|
|
7
7
|
3. **`mercury init` + `mercury service install`** in a test project — if you touched CLI flow, config loading, or service management
|
|
8
8
|
4. **Smoke test assistants** — send a message, verify they respond
|
|
9
|
+
|
|
10
|
+
## Version bump & publish
|
|
11
|
+
|
|
12
|
+
```bash
|
|
13
|
+
npm version patch --no-git-tag-version # or minor/major
|
|
14
|
+
git add package.json
|
|
15
|
+
git commit -m "chore: bump version to $(node -p 'require("./package.json").version')"
|
|
16
|
+
git tag "v$(node -p 'require("./package.json").version')"
|
|
17
|
+
git push && git push --tags
|
|
18
|
+
npm publish
|
|
19
|
+
```
|
|
20
|
+
|
|
21
|
+
Always tag and publish together — `package.json` is the single source of truth for both npm and GitHub.
|
|
22
|
+
|
|
23
|
+
## Beta testing on another machine
|
|
24
|
+
|
|
25
|
+
Use `--tag beta` to publish a test version without affecting the stable `latest` tag.
|
|
26
|
+
|
|
27
|
+
```bash
|
|
28
|
+
# 1. Bump to a beta prerelease
|
|
29
|
+
npm version prerelease --preid=beta # e.g. 0.4.24 → 0.4.25-beta.0
|
|
30
|
+
|
|
31
|
+
# 2. Publish under the beta tag (won't affect `npm install mercury-agent`)
|
|
32
|
+
npm publish --tag beta
|
|
33
|
+
|
|
34
|
+
# 3. On the other machine, install the beta
|
|
35
|
+
npm install -g mercury-agent@beta
|
|
36
|
+
|
|
37
|
+
# 4. Test, iterate. Bump again if needed:
|
|
38
|
+
npm version prerelease --preid=beta # 0.4.25-beta.0 → 0.4.25-beta.1
|
|
39
|
+
npm publish --tag beta
|
|
40
|
+
|
|
41
|
+
# 5. When satisfied, promote to stable:
|
|
42
|
+
npm version patch # 0.4.25-beta.1 → 0.4.25
|
|
43
|
+
npm publish # publishes to "latest"
|
|
44
|
+
```
|
|
45
|
+
|
|
46
|
+
`npm install -g mercury-agent` (without @beta) always gets the stable version. Only explicit `@beta` gets the test version.
|
package/package.json
CHANGED
package/src/core/router.ts
CHANGED
|
@@ -84,6 +84,13 @@ export function routeInput(input: {
|
|
|
84
84
|
.split(",")
|
|
85
85
|
.map((s) => s.trim())
|
|
86
86
|
.filter(Boolean);
|
|
87
|
+
|
|
88
|
+
// Auto-inject @botUsername so adapters that rewrite @-mentions (e.g. WhatsApp)
|
|
89
|
+
// always trigger the bot without manual config.
|
|
90
|
+
const atBot = `@${input.config.botUsername}`;
|
|
91
|
+
if (!defaultPatterns.some((p) => p.toLowerCase() === atBot.toLowerCase())) {
|
|
92
|
+
defaultPatterns.push(atBot);
|
|
93
|
+
}
|
|
87
94
|
const triggerConfig = loadTriggerConfig(input.db, input.spaceId, {
|
|
88
95
|
patterns: defaultPatterns,
|
|
89
96
|
match: input.config.triggerMatch,
|