@mu-crew/mu 3.11.2 → 3.12.0

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/dist/index.d.ts CHANGED
@@ -2126,6 +2126,8 @@ type SendResult = {
2126
2126
  runs?: number;
2127
2127
  /** ctl only: when pi entered `state` (epoch ms), from the same status. */
2128
2128
  since?: number;
2129
+ /** ctl only: pi's session file, from the same status. */
2130
+ sessionFile?: string;
2129
2131
  /** Set when the text ran as a pi session command over ctl. */
2130
2132
  command?: CtlCommandName;
2131
2133
  };
package/dist/index.js CHANGED
@@ -8,7 +8,7 @@ import {
8
8
  priorFieldValue,
9
9
  resolveGroupId,
10
10
  undoGroup
11
- } from "./chunk-DXKJY3NT.js";
11
+ } from "./chunk-XV7J56GD.js";
12
12
  import {
13
13
  AGENT_STATE_GLYPH,
14
14
  AgentAbortNeedsCtlError,
@@ -252,7 +252,7 @@ import {
252
252
  workspacePath,
253
253
  workspacesRoot,
254
254
  yankCommandForCheck
255
- } from "./chunk-JYZUNPPO.js";
255
+ } from "./chunk-IRPTNVJC.js";
256
256
  import {
257
257
  CAPTURE_TRIGGER_DDL,
258
258
  CURRENT_SCHEMA_VERSION,
@@ -325,10 +325,10 @@ import {
325
325
  withCaptureSuppressed,
326
326
  withFileLock,
327
327
  withOpContext
328
- } from "./chunk-WYBOR4FX.js";
328
+ } from "./chunk-R2SVBZAB.js";
329
329
  import {
330
330
  defaultStateDir
331
- } from "./chunk-4PACTXAB.js";
331
+ } from "./chunk-L2ABBTYG.js";
332
332
  import "./chunk-PZ5AY32C.js";
333
333
  export {
334
334
  AGENT_STATE_GLYPH,
@@ -12,7 +12,7 @@ import {
12
12
  relTimeBasisForSort,
13
13
  sortTasks,
14
14
  truncate
15
- } from "./chunk-2FJK6OOZ.js";
15
+ } from "./chunk-TEGZOXML.js";
16
16
  import {
17
17
  GLYPH,
18
18
  WORKSPACE_STALE_THRESHOLD,
@@ -41,15 +41,15 @@ import {
41
41
  summarizeOwnedTasks,
42
42
  superscriptDigit,
43
43
  yankCommandForCheck
44
- } from "./chunk-JYZUNPPO.js";
44
+ } from "./chunk-IRPTNVJC.js";
45
45
  import {
46
46
  TASK_STATUSES,
47
47
  ambientSyncPass,
48
48
  formatPair,
49
49
  syncEnabled,
50
50
  tryResolveWorkstreamId
51
- } from "./chunk-WYBOR4FX.js";
52
- import "./chunk-4PACTXAB.js";
51
+ } from "./chunk-R2SVBZAB.js";
52
+ import "./chunk-L2ABBTYG.js";
53
53
  import "./chunk-PZ5AY32C.js";
54
54
 
55
55
  // src/cli/tui/index.ts
@@ -6449,4 +6449,4 @@ async function runTui(db, opts) {
6449
6449
  export {
6450
6450
  runTui
6451
6451
  };
6452
- //# sourceMappingURL=tui-DGDEH4JX.js.map
6452
+ //# sourceMappingURL=tui-LO75XA3O.js.map
@@ -1,8 +1,8 @@
1
1
  import {
2
2
  ambientSyncPass,
3
3
  openDb
4
- } from "./chunk-WYBOR4FX.js";
5
- import "./chunk-4PACTXAB.js";
4
+ } from "./chunk-R2SVBZAB.js";
5
+ import "./chunk-L2ABBTYG.js";
6
6
  import "./chunk-PZ5AY32C.js";
7
7
 
8
8
  // src/cli/tui/sync-worker.ts
@@ -28,9 +28,9 @@ reply carries `v: 1`; the client (`src/ctl/client.ts`) throws
28
28
  | op | does |
29
29
  | --- | --- |
30
30
  | `hello` | identity plus `ops` (served ops) and `extVersion` (the mu version the extension was built from) |
31
- | `status` | `state` (`busy` / `idle`), `since`, `runs`, `pending` |
31
+ | `status` | `state` (`busy` / `idle`), `since`, `runs`, `pending`, and pi's `sessionFile` when it has one |
32
32
  | `send` | `pi.sendUserMessage`; when busy, `mode` is `steer` or `followUp` (default). Replies with the `status` fields measured before the dispatch, so `runs` is the baseline for a later `wait` |
33
- | `wait` | resolves on pi's `agent_settled` after `afterRuns`, with the run's `lastText` |
33
+ | `wait` | resolves on pi's `agent_settled` after `afterRuns`, with the run's `lastText` and pi's `sessionFile` |
34
34
  | `abort` | `ctx.abort()` (pi's Esc) |
35
35
  | `interrupt` | busy: `ctx.abort()`, wait for `agent_settled` (up to `timeoutMs`), then `pi.sendUserMessage(text)` as a new run; idle: just the send. Replies `wasBusy`, `pending` (measured before the abort) and the `status` fields measured after the settle and before the send, so `runs` is the `wait` baseline for the new run. `timeout`: nothing sent |
36
36
  | `fresh` | new session plus prompt as one operation, through the internal `/mu-fresh` command; replies once the new run starts; refused with `busy` unless `force` |
@@ -33,6 +33,11 @@ Delegates called in one turn run in parallel.
33
33
  - pi's footer shows how many delegates this session is waiting on, and
34
34
  `N results pending` for delegates that finished but whose answer has
35
35
  not reached the conversation yet (queued behind the running turn).
36
+ Escape drops those queued answers from pi. The extension then writes
37
+ one line per answer into the conversation, without starting a turn,
38
+ pointing at a copy under `~/.cache/mu/delegate-answers/` and
39
+ at the delegate's own pi session file. An answer that lands after
40
+ Escape arrives as usual.
36
41
  - Each delegate costs a pane and a pi process. A session runs at most
37
42
  `MU_DELEGATE_MAX` at once (default 16). Further calls are queued, up
38
43
  to four times the cap: the footer reads `16 delegates running, 4 queued`,
@@ -43,6 +48,11 @@ Delegates called in one turn run in parallel.
43
48
  keeps its pane. The answer names the error and leaves the choice to
44
49
  the model: re-issue, or record the check as unverified. The footer
45
50
  counts it as `1 failed` until the pane is closed.
51
+ - Every answer without a final text (API error, empty, timeout, died,
52
+ `mu_delegate_cancel`) names the delegate's pi session file and, when
53
+ it wrote anything, a copy of its last message so far under
54
+ `~/.cache/mu/delegate-answers/` (`*.partial.md`). Quitting pi or
55
+ `/reload` lists each running delegate's session file.
46
56
  - Answers arrive as follow-up messages when pi would otherwise stop,
47
57
  never mid-turn. To get several at once, set pi's `followUpMode` to
48
58
  `"all"`.
@@ -91,6 +101,8 @@ row carries:
91
101
  `error` means the run stopped on an API error after pi's own retries;
92
102
  `lastError` holds the message and the pane is kept.
93
103
  - `lastText`: the final message, capped at 64 KiB.
104
+ - `sessionFile`: the agent's pi session file, holding the full
105
+ transcript (absent for an ephemeral pi or an older extension).
94
106
 
95
107
  Exit codes: `0` met, `5` timeout, `6` pane died. Non-pi agents have no
96
108
  `lastText`; read the pane with `mu agent read helper-1 -w scratch -n 80`.
@@ -12,6 +12,7 @@ milliseconds; `0` disables a wait unless noted.
12
12
  | `MU_DB_PATH` | SQLite file path. Wins over the state dir. | `<state-dir>/mu.db` |
13
13
  | `MU_STATE_DIR` | State directory. Also holds `compile-cache/` (V8 code cache for the CLI; `NODE_DISABLE_COMPILE_CACHE=1` turns it off). | `$XDG_STATE_HOME/mu` |
14
14
  | `XDG_STATE_HOME` | XDG state base; mu appends `mu/`. An empty or relative value is ignored. | `~/.local/state` |
15
+ | `XDG_CACHE_HOME` | XDG cache base; mu appends `mu/`. Holds only disposable copies. An empty or relative value is ignored. | `~/.cache` |
15
16
  | `MU_SESSION` | Active workstream when `-w` is absent. | current `mu-<name>` mux session |
16
17
  | `MU_SYNC_DIR` | Folder holding one segment per machine. This is the whole sync setup; there is no peer list. | unset: sync off |
17
18
 
@@ -95,5 +95,12 @@ Never put `MU_DB_PATH` inside `MU_SYNC_DIR`: syncing a live SQLite
95
95
  file and its `-wal` and `-shm` sidecars corrupts it. `mu doctor` checks
96
96
  for this.
97
97
 
98
+ The cache dir is `$XDG_CACHE_HOME/mu`, else `~/.cache/mu`. Anything in
99
+ it can be deleted at any time.
100
+
101
+ | Path | Contents |
102
+ | --- | --- |
103
+ | `<cache-dir>/delegate-answers/` | Copies of delegate answers an Escape dropped from pi's queue, and `*.partial.md`: a delegate's last message before it timed out, died, failed or was cancelled (the delegate's pi session file keeps the original) |
104
+
98
105
  mu reads no agent-template directory (`~/.pi/agent/agents/`,
99
106
  `.pi/agents/`). A role is a name and a brief.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mu-crew/mu",
3
- "version": "3.11.2",
3
+ "version": "3.12.0",
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"
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../src/state-dir.ts"],"sourcesContent":["// The mu state directory, resolved from builtins only so the CLI\n// bootstrap (src/main.ts) can locate its compile cache before it loads\n// any of the CLI graph. db.ts re-exports defaultStateDir.\n\nimport { homedir } from \"node:os\";\nimport { isAbsolute, join } from \"node:path\";\n\n/**\n * Resolve the canonical mu state directory:\n * MU_STATE_DIR > $XDG_STATE_HOME/mu (absolute only) > ~/.local/state/mu\n */\nexport function defaultStateDir(): string {\n if (process.env.MU_STATE_DIR) return process.env.MU_STATE_DIR;\n return join(xdgStateHome(homedir()), \"mu\");\n}\n\n/** `$XDG_STATE_HOME`, or `<home>/.local/state` when it is unset, empty,\n * or relative: the XDG spec says such a value must be ignored, and a\n * relative one would scatter state across every cwd mu runs in. */\nexport function xdgStateHome(home: string): string {\n const xdg = process.env.XDG_STATE_HOME;\n return xdg !== undefined && isAbsolute(xdg) ? xdg : join(home, \".local\", \"state\");\n}\n"],"mappings":";AAIA,SAAS,eAAe;AACxB,SAAS,YAAY,YAAY;AAM1B,SAAS,kBAA0B;AACxC,MAAI,QAAQ,IAAI,aAAc,QAAO,QAAQ,IAAI;AACjD,SAAO,KAAK,aAAa,QAAQ,CAAC,GAAG,IAAI;AAC3C;AAKO,SAAS,aAAa,MAAsB;AACjD,QAAM,MAAM,QAAQ,IAAI;AACxB,SAAO,QAAQ,UAAa,WAAW,GAAG,IAAI,MAAM,KAAK,MAAM,UAAU,OAAO;AAClF;","names":[]}