@mu-crew/mu 3.1.0 → 3.2.1
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/AGENTS.md +203 -588
- package/README.md +80 -308
- package/dist/cli.js +6106 -4716
- package/dist/cli.js.map +1 -1
- package/dist/extension/mu-pi.js +786 -0
- package/dist/extension/mu-pi.js.map +1 -0
- package/dist/index.d.ts +738 -536
- package/dist/index.js +6617 -5785
- package/dist/index.js.map +1 -1
- package/docs/ARCHITECTURE.md +178 -1008
- package/docs/ROADMAP.md +88 -169
- package/docs/VISION.md +206 -407
- package/docs/VOCABULARY.md +202 -455
- package/docs/architecture/control-socket.md +119 -0
- package/docs/architecture/dag.md +113 -0
- package/docs/architecture/mux.md +163 -0
- package/docs/architecture/ops-log.md +140 -0
- package/docs/architecture/sdk.md +185 -0
- package/docs/architecture/sync.md +129 -0
- package/docs/architecture/tui.md +146 -0
- package/docs/guide/README.md +25 -0
- package/docs/guide/backends.md +61 -0
- package/docs/guide/cleanup.md +74 -0
- package/docs/guide/delegate.md +87 -0
- package/docs/guide/dispatch.md +137 -0
- package/docs/guide/getting-started.md +177 -0
- package/docs/guide/recovery.md +133 -0
- package/docs/guide/remote.md +74 -0
- package/docs/guide/sql.md +76 -0
- package/docs/guide/stop-a-worker.md +64 -0
- package/docs/guide/sync.md +78 -0
- package/docs/guide/tui.md +98 -0
- package/docs/guide/upgrade.md +76 -0
- package/docs/history/CHANGELOG-pre-3.md +4866 -0
- package/docs/reference/env.md +87 -0
- package/docs/reference/naming.md +82 -0
- package/docs/specs/2026-09-28-agent-state-from-murmur.md +1 -1
- package/docs/specs/2026-09-29-task-substates.md +1 -1
- package/package.json +4 -4
- package/skills/mu/REMOTE_WORKERS.md +186 -491
- package/skills/mu/SKILL.md +142 -217
- package/docs/HANDOVER.md +0 -486
- package/docs/USAGE_GUIDE.md +0 -2637
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
# Environment variables
|
|
2
|
+
|
|
3
|
+
Every env var mu reads or sets. mu has no config file. Durations are
|
|
4
|
+
milliseconds; `0` disables a wait unless noted.
|
|
5
|
+
|
|
6
|
+
## State and workstream
|
|
7
|
+
|
|
8
|
+
| Name | Effect | Default |
|
|
9
|
+
| --- | --- | --- |
|
|
10
|
+
| `MU_DB_PATH` | SQLite file path. Wins over the state dir. | `<state-dir>/mu.db` |
|
|
11
|
+
| `MU_STATE_DIR` | State directory. | `$XDG_STATE_HOME/mu` |
|
|
12
|
+
| `XDG_STATE_HOME` | XDG state base; mu appends `mu/`. | `~/.local/state` |
|
|
13
|
+
| `MU_SESSION` | Active workstream when `-w` is absent. | current `mu-<name>` mux session |
|
|
14
|
+
| `MU_SYNC_DIR` | Folder holding one segment per machine. This is the whole sync setup; there is no peer list. | unset: sync off |
|
|
15
|
+
|
|
16
|
+
## Multiplexer
|
|
17
|
+
|
|
18
|
+
| Name | Effect | Default |
|
|
19
|
+
| --- | --- | --- |
|
|
20
|
+
| `MU_MUX` | Force `tmux` or `herdr`, skipping mux detection. An unknown value fails the invocation. | detected |
|
|
21
|
+
| `HERDR_ENV` | Read only. `1` (set by herdr in its panes) selects herdr; outranks `$TMUX`. | |
|
|
22
|
+
| `MU_TMUX_SOCKET` | tmux socket name (`-L <name>`). tmux only. | `$TMUX` |
|
|
23
|
+
| `MU_HERDR_SESSION` | Named herdr server (`--session <name>`). herdr only. Tests must set it to a non-default name. | herdr default session |
|
|
24
|
+
| `MU_BANNER_QUIET` | `1` disables mu's pane border and banner decorations. tmux only. | unset |
|
|
25
|
+
|
|
26
|
+
## Spawn
|
|
27
|
+
|
|
28
|
+
| Name | Effect | Default |
|
|
29
|
+
| --- | --- | --- |
|
|
30
|
+
| `MU_<CLI>_COMMAND` | Executable for `--cli <cli>`; hyphens become underscores (`--cli pi-meta` reads `MU_PI_META_COMMAND`). May hold arguments. `--command` wins; the spawn line names the env var when it supplied the command. | the cli value |
|
|
31
|
+
| `MU_SPAWN_CTL_MS` | Budget for the control-socket handshake with a new pi agent, polled every 250ms. On timeout spawn still exits 0, reports `ctl: missing` or `ctl: refused`, and warns. `--no-ctl` skips it per spawn. | `30000` |
|
|
32
|
+
| `MU_SPAWN_LIVENESS_MS` | tmux only. Wait this long, then check the pane is alive and its scrollback has no startup error (auth failure, `command not found`). Failure rolls back the row and throws `AgentDiedOnSpawnError` or `AgentSpawnStartupError`. | `1500` |
|
|
33
|
+
| `MU_SPAWN_READINESS_MS` | tmux only, when murmur is installed. Budget to wait for murmur to claim the new pane. | `10000` |
|
|
34
|
+
| `MU_SPAWN_LOCK_TIMEOUT_MS` | How long a spawn waits for the per-workstream spawn lock. | `15000` |
|
|
35
|
+
|
|
36
|
+
## Send and state (tmux path)
|
|
37
|
+
|
|
38
|
+
These apply to the tmux paste path only. For when that path runs, see
|
|
39
|
+
[No silent fallback](../architecture/control-socket.md#no-silent-fallback).
|
|
40
|
+
|
|
41
|
+
| Name | Effect | Default |
|
|
42
|
+
| --- | --- | --- |
|
|
43
|
+
| `MU_SEND_READINESS_MS` | Before pasting, wait out a pane's modal or re-init; after Enter, confirm it landed. `0` sends fire-and-forget. A busy pane is not waited on. | `15000` |
|
|
44
|
+
| `MU_SEND_DELAY_MS` | Delay between the bracketed paste and Enter. | `500` |
|
|
45
|
+
|
|
46
|
+
## Agents and timing
|
|
47
|
+
|
|
48
|
+
| Name | Effect | Default |
|
|
49
|
+
| --- | --- | --- |
|
|
50
|
+
| `MU_IDLE_THRESHOLD_MS` | Time without progress before an owning agent, or a scratch agent, counts as idle. | `300000` |
|
|
51
|
+
| `MU_LOG_TAIL_INTERVAL_MS` | `mu log --tail` poll interval; clamped to ≥ 50. | `1000` |
|
|
52
|
+
|
|
53
|
+
## Set by mu in agent panes
|
|
54
|
+
|
|
55
|
+
| Name | Value |
|
|
56
|
+
| --- | --- |
|
|
57
|
+
| `MU_AGENT_NAME` | The agent's name; first rung of actor identity. |
|
|
58
|
+
| `MU_WORKSTREAM` | The agent's workstream. |
|
|
59
|
+
| `MU_CTL_SOCK` | The agent's control socket path, derived from state dir, workstream, and agent. The mu pi extension serves it. |
|
|
60
|
+
| `MU_MANAGED_AGENT` | `1`. Hides `mu_delegate` inside agents, so a helper cannot spawn helpers. |
|
|
61
|
+
|
|
62
|
+
`mu agent remote-env <agent> --shell` prints `MU_SSH_ARGS` (the ssh
|
|
63
|
+
socket forward) and `MU_REMOTE_ENV` (the four vars above) for a remote
|
|
64
|
+
pi agent's `--command`. mu never reads them back.
|
|
65
|
+
|
|
66
|
+
## pi extension and `mu link pi`
|
|
67
|
+
|
|
68
|
+
| Name | Effect | Default |
|
|
69
|
+
| --- | --- | --- |
|
|
70
|
+
| `MU_DELEGATE` | `0` hides the `mu_delegate` tool. `mu doctor` reports it. | unset: shown |
|
|
71
|
+
| `MU_PI_HOME` | Root under which `mu link pi` writes `.pi/` and `.agents/`. | `$HOME` |
|
|
72
|
+
| `PI_CODING_AGENT_DIR` | Read only. pi's agent dir, checked for a linked murmur extension. | `~/.pi/agent` |
|
|
73
|
+
| `MU_EXTENSION_ENTRY` | Test only. Built extension the `mu link pi` shim imports. | `dist/extension/mu-pi.js` |
|
|
74
|
+
|
|
75
|
+
## Output and TUI
|
|
76
|
+
|
|
77
|
+
| Name | Effect | Default |
|
|
78
|
+
| --- | --- | --- |
|
|
79
|
+
| `NO_COLOR` | Any value turns colour off; wins over everything. | unset |
|
|
80
|
+
| `MU_FORCE_COLOR` | Truthy forces colour on. `""`, `0`, and `false` opt out. Checked before `FORCE_COLOR`. | unset |
|
|
81
|
+
| `MU_NO_TUI` | `1` makes bare `mu` print help instead of opening the TUI. | unset |
|
|
82
|
+
| `MU_TUI_DEBUG_MOUSE` | `1` logs mouse hit-tests to stderr. | unset |
|
|
83
|
+
|
|
84
|
+
## Tests
|
|
85
|
+
|
|
86
|
+
`VITEST` or `NODE_ENV=test` makes `openDb()` refuse the real default DB.
|
|
87
|
+
`test/_setup.ts` clears inherited `MU_*` vars except `MU_TMUX_SOCKET`.
|
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
# Naming conventions
|
|
2
|
+
|
|
3
|
+
Terms are defined in [VOCABULARY.md](../VOCABULARY.md).
|
|
4
|
+
|
|
5
|
+
## Flags and positionals
|
|
6
|
+
|
|
7
|
+
The primary entity a verb acts on is positional. Scope, modifiers, and
|
|
8
|
+
payload are flags: `mu task close <id>`, `mu agent send <name> <text>`.
|
|
9
|
+
|
|
10
|
+
- The workstream is a scope (`-w`) everywhere except under
|
|
11
|
+
`mu workstream`, where it is the entity. `init` and `teardown` take
|
|
12
|
+
it positionally; if the positional and `-w` disagree, mu exits 2.
|
|
13
|
+
- When one verb takes a payload positionally and a sibling takes it as
|
|
14
|
+
a flag, both shapes are accepted (`mu task note <id> --text "..."`).
|
|
15
|
+
Adding an alias is not a breaking change; removing a shape is.
|
|
16
|
+
- One concept, one parser: `--blocked-by` and `--by` are both blocker
|
|
17
|
+
lists and accept repeated, comma-separated, or mixed forms.
|
|
18
|
+
|
|
19
|
+
## Empty and blank list fragments
|
|
20
|
+
|
|
21
|
+
`parseCsvFlag` (`src/cli.ts`) applies one rule to every list flag
|
|
22
|
+
(`--status`, `--by`, `--blocked-by`, `-w`):
|
|
23
|
+
|
|
24
|
+
| Input | Kind | Result |
|
|
25
|
+
| --- | --- | --- |
|
|
26
|
+
| `--status "OPEN,"` | empty fragment | dropped: `[OPEN]` |
|
|
27
|
+
| `--blocked-by ""` | empty fragment | dropped: `[]` |
|
|
28
|
+
| `--status " "` | blank fragment | `UsageError`, exit 2 |
|
|
29
|
+
| `--status "OPEN, "` | blank fragment | `UsageError`, exit 2 |
|
|
30
|
+
|
|
31
|
+
A blank `-w ' '` is also rejected. Whether zero fragments is legal is
|
|
32
|
+
per verb: `--by ''` exits 2, while `mu task reparent --blocked-by ''`
|
|
33
|
+
clears all blockers.
|
|
34
|
+
|
|
35
|
+
## Ids
|
|
36
|
+
|
|
37
|
+
| Id | Shape | Unique within |
|
|
38
|
+
| --- | --- | --- |
|
|
39
|
+
| Agent name | `[a-z][a-z0-9_-]*`, ≤ 32 chars | workstream |
|
|
40
|
+
| Task `local_id` | same | DB |
|
|
41
|
+
| Workstream name | same; mux session is `mu-<name>` | DB |
|
|
42
|
+
| Window (`--tab`) | `[A-Za-z][A-Za-z0-9 _-]*`, ≤ 32 chars | workstream |
|
|
43
|
+
|
|
44
|
+
`scratch` is reserved: it is created only by the first
|
|
45
|
+
`mu agent spawn <name> -w scratch`, and `mu workstream init scratch`
|
|
46
|
+
is rejected. The `mu-` prefix is reserved too.
|
|
47
|
+
|
|
48
|
+
## Agent names
|
|
49
|
+
|
|
50
|
+
Name agents by role with a numeric suffix: `worker-1`, `reviewer-1`,
|
|
51
|
+
`scout-1`. Human names (`alice`, `bob`) read as people in commands and
|
|
52
|
+
make `mu agent list` harder to scan. mu does not enforce this; test
|
|
53
|
+
fixtures may use human names.
|
|
54
|
+
|
|
55
|
+
| Role | Use |
|
|
56
|
+
| --- | --- |
|
|
57
|
+
| `worker` | Long-lived implementer (the default) |
|
|
58
|
+
| `reviewer` | Reads diffs; usually `--role read-only` |
|
|
59
|
+
| `scout` | One-shot recon |
|
|
60
|
+
| `oracle` | Second opinion before acting |
|
|
61
|
+
| `auditor` | Long-lived watcher; `--role read-only` |
|
|
62
|
+
| `planner` | Writes implementation plans |
|
|
63
|
+
|
|
64
|
+
## File paths
|
|
65
|
+
|
|
66
|
+
The state dir is `MU_STATE_DIR`, else `$XDG_STATE_HOME/mu`, else
|
|
67
|
+
`~/.local/state/mu`.
|
|
68
|
+
|
|
69
|
+
| Path | Contents |
|
|
70
|
+
| --- | --- |
|
|
71
|
+
| `<state-dir>/mu.db` | The SQLite DB for every workstream |
|
|
72
|
+
| `<state-dir>/workstreams/<workstream>/` | Per-workstream artifacts, created lazily |
|
|
73
|
+
| `<state-dir>/workspaces/<workstream>/<agent>/` | Per-agent VCS workspace, created by `mu agent spawn --workspace` |
|
|
74
|
+
| `<sync-dir>/<machine_id>.jsonl` | This machine's segment; `<sync-dir>` is `MU_SYNC_DIR` |
|
|
75
|
+
| `<sync-dir>/<machine_id>.manifest` | `{count, last_hlc, sha256}` for segment verification |
|
|
76
|
+
|
|
77
|
+
Never put `MU_DB_PATH` inside `MU_SYNC_DIR`: syncing a live SQLite
|
|
78
|
+
file and its `-wal` and `-shm` sidecars corrupts it. `mu doctor` checks
|
|
79
|
+
for this.
|
|
80
|
+
|
|
81
|
+
mu reads no agent-template directory (`~/.pi/agent/agents/`,
|
|
82
|
+
`.pi/agents/`). A role is a name and a brief.
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# Agent state from murmur (mu 2.0.0, murmur 1.0.0)
|
|
2
2
|
|
|
3
|
-
Status:
|
|
3
|
+
Status: shipped in 2.0.0; partly superseded in 3.2.0 by the control socket ([architecture/control-socket.md](../architecture/control-socket.md)). Approved 2026-09-28. Task `crew/mu_status_from_murmur`.
|
|
4
4
|
|
|
5
5
|
## Problem
|
|
6
6
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# Task substates: classification without stranded dependents
|
|
2
2
|
|
|
3
|
-
Status:
|
|
3
|
+
Status: shipped in 3.0.0 (schema v11); `CLOSED/rejected` added in 3.1.0. Implemented 2026-09-29 (approved 2026-09-29; see [Deviations during implementation](#deviations-during-implementation))
|
|
4
4
|
Date: 2026-09-29
|
|
5
5
|
Supersedes the notes-only convention from `9e3c47b` ("tasks: reduce lifecycle to three states").
|
|
6
6
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mu-crew/mu",
|
|
3
|
-
"version": "3.1
|
|
3
|
+
"version": "3.2.1",
|
|
4
4
|
"description": "A persistent, observable crew of pi agents running in one tmux or herdr session per workstream, coordinated through a built-in task DAG.",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"access": "public"
|
|
@@ -55,9 +55,9 @@
|
|
|
55
55
|
"test:fast": "vitest run --config vitest.fast.config.ts",
|
|
56
56
|
"test:watch": "vitest",
|
|
57
57
|
"test:watch:fast": "vitest --config vitest.fast.config.ts",
|
|
58
|
-
"lint": "biome check src test scripts",
|
|
59
|
-
"lint:fix": "biome check --write src test scripts",
|
|
60
|
-
"format": "biome format --write src test scripts",
|
|
58
|
+
"lint": "biome check src test scripts extension",
|
|
59
|
+
"lint:fix": "biome check --write src test scripts extension",
|
|
60
|
+
"format": "biome format --write src test scripts extension",
|
|
61
61
|
"typecheck": "tsc --noEmit && tsc -p tsconfig.test.json --noEmit",
|
|
62
62
|
"prepare": "npm run build",
|
|
63
63
|
"test:stress": "tools/test-stress.sh"
|