@martintrojer/murmur 0.2.0 → 0.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/ARCHITECTURE.md CHANGED
@@ -354,7 +354,7 @@ where the system interpreter is least yours to touch.
354
354
  "murmur_snapshot": 1,
355
355
  "host_id": "1d2ee96e-3a94-41b2-90fa-5f1ee2f04276", // from identity.json
356
356
  "display_name": "mtrojer-mac",
357
- "murmur_version": "0.2.0", // read from package.json, never restated
357
+ "murmur_version": "0.2.1", // read from package.json, never restated
358
358
  "generated_at": 1788105698997, // this node's clock at build time
359
359
  "panes": [
360
360
  {
package/CHANGELOG.md CHANGED
@@ -3,6 +3,28 @@
3
3
  Notable changes per release. Written for someone deciding whether to upgrade,
4
4
  so it says what changed for a user rather than listing every commit.
5
5
 
6
+ ## 0.2.1
7
+
8
+ **Agents are named by their tmux session, not by whatever process tmux found
9
+ running in the window.** The picker's `agent` column showed `Python`, `node` and
10
+ `zsh` for real agents — pi's own interpreter, labelled "agent".
11
+
12
+ tmux's `automatic-rename` is on by default, which makes a window name simply the
13
+ foreground command, and murmur preferred that name over the session name. So any
14
+ agent without a mu agent name or a pi `/name` was listed under a process name,
15
+ and `hacking/murmur` — the string you actually search for — was hidden. A window
16
+ name is now recorded only when someone chose it, which means a window you renamed
17
+ yourself still wins, as does mu's own naming.
18
+
19
+ A row also no longer prints one string twice: the name and the stream column both
20
+ fell back to the session name, so an unnamed agent read `hacking/murmur
21
+ hacking/murmur` and spent thirteen columns saying nothing new.
22
+
23
+ Upgrading does not retroactively fix agents that are already running. The name is
24
+ recorded by the pane's own owner, so each agent's row is corrected when its pi
25
+ process next starts. A pi `/reload` is not enough — it re-runs the extension
26
+ inside the same process, which has the old code cached.
27
+
6
28
  ## 0.2.0
7
29
 
8
30
  **murmur now stores current state instead of an event log, and every node
package/README.md CHANGED
@@ -235,7 +235,7 @@ already full-screen, and you land back at your shell prompt on exit.
235
235
 
236
236
  ## Status
237
237
 
238
- **0.2.0.** In daily use on one machine and verified across two over real ssh.
238
+ **0.2.1.** In daily use on one machine and verified across two over real ssh.
239
239
  It is new and not battle-tested. The known gaps and the accepted limitations are
240
240
  listed at the end of [ARCHITECTURE.md](ARCHITECTURE.md#known-gaps).
241
241
 
package/dist/cli.js CHANGED
@@ -27,6 +27,10 @@ function runTmux(args) {
27
27
  return null;
28
28
  }
29
29
  }
30
+ function chosenWindowName(name, autoRename) {
31
+ if (autoRename === "1") return null;
32
+ return name || null;
33
+ }
30
34
  function exactSession(session) {
31
35
  return `=${session}`;
32
36
  }
@@ -46,16 +50,16 @@ var tmux = {
46
50
  "-t",
47
51
  pane,
48
52
  "-p",
49
- "#{session_id} #{window_id} #{session_name} #{window_name}"
53
+ "#{session_id} #{window_id} #{session_name} #{window_name} #{?automatic-rename,1,0}"
50
54
  ]);
51
- const [session, window, sessionName, windowName] = fields?.split(" ") ?? [];
55
+ const [session, window, sessionName, windowName, autoRename] = fields?.split(" ") ?? [];
52
56
  if (!session || !window) return null;
53
57
  return {
54
58
  session: asSessionId(session),
55
59
  window: asWindowId(window),
56
60
  pane,
57
61
  session_name: sessionName || null,
58
- window_name: windowName || null
62
+ window_name: chosenWindowName(windowName, autoRename)
59
63
  };
60
64
  },
61
65
  // Which of this host's PANES still exist. The only liveness question tmux is
@@ -955,7 +959,7 @@ function describeFailure(peer, message) {
955
959
  const detail = collapsed.length > 160 ? `${collapsed.slice(0, 157)}...` : collapsed;
956
960
  return `${peer}: ${detail}`;
957
961
  }
958
- async function collect(store, channel, now = Date.now(), deadline) {
962
+ async function collect(store, channel, now = Date.now(), deadline, mux = tmux) {
959
963
  const results = [];
960
964
  let timer;
961
965
  try {
@@ -1002,7 +1006,7 @@ async function collect(store, channel, now = Date.now(), deadline) {
1002
1006
  clearTimeout(timer);
1003
1007
  }
1004
1008
  try {
1005
- store.reconcileLocal({ panes: tmux.livePanes(), now });
1009
+ store.reconcileLocal({ panes: mux.livePanes(), now });
1006
1010
  } catch {
1007
1011
  }
1008
1012
  return results;
@@ -1708,9 +1712,9 @@ function status(store, identity, now = Date.now()) {
1708
1712
  }))
1709
1713
  };
1710
1714
  }
1711
- async function statusWithCollect(store, identity, now = Date.now(), channel = ssh) {
1715
+ async function statusWithCollect(store, identity, now = Date.now(), channel = ssh, mux = tmux) {
1712
1716
  try {
1713
- await collect(store, channel, now);
1717
+ await collect(store, channel, now, void 0, mux);
1714
1718
  } catch {
1715
1719
  }
1716
1720
  return status(store, identity, now);
@@ -1824,7 +1828,7 @@ function pickerRow(agent, showHost, current, local = agent.local) {
1824
1828
  const name = agent.agent_name ?? agent.pi_session ?? agentLabel(agent);
1825
1829
  const host = showHost ? local ? `${DIM} here${RESET}` : `${REMOTE}\u2192 ${terminalText(agent.host)}${RESET}` : "";
1826
1830
  const group = agent.workstream ?? agent.session_name;
1827
- const workstream = group ? `${DIM}${terminalText(group)}${RESET}` : "";
1831
+ const workstream = group && group !== name ? `${DIM}${terminalText(group)}${RESET}` : "";
1828
1832
  const extra = agent.attention.filter((kind) => kind !== state);
1829
1833
  const flags = [
1830
1834
  agent.driver === "orchestrated" ? "crew" : "",
@@ -1897,7 +1901,7 @@ async function runPick(store, options = {}, deps = {}) {
1897
1901
  const jumpTo = deps.jump ?? jumpToAgent;
1898
1902
  const identity = requireIdentity();
1899
1903
  if (!identity) return;
1900
- const view = await statusWithCollect(store, identity);
1904
+ const view = await statusWithCollect(store, identity, Date.now(), ssh, deps.mux ?? tmux);
1901
1905
  const agents = view.panes.filter((agent2) => options.all || isVisible(agent2));
1902
1906
  const hidden = view.panes.length - agents.length;
1903
1907
  if (agents.length === 0) {