alissa-tools-github-devloop 0.8.29__py3-none-any.whl → 0.8.31__py3-none-any.whl

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.
@@ -80,6 +80,26 @@ def pane_path_argv(name: str) -> "list[str]":
80
80
  ]
81
81
 
82
82
 
83
+ # What `#{pane_current_command}` reads on a worker pane whose `claude` has
84
+ # EXITED (issue #140): the shell `alissa tmux new` launched it from, back in
85
+ # the foreground. A live worker reads `node` (Claude Code's runtime); a
86
+ # name here means the process the session was spawned for is gone, whatever
87
+ # the session listing says about liveness.
88
+ SHELL_COMMANDS = frozenset((
89
+ "bash", "sh", "zsh", "fish", "dash", "ksh", "ash", "tcsh", "csh",
90
+ ))
91
+
92
+
93
+ def pane_command_argv(name: str) -> "list[str]":
94
+ """`tmux -S <socket> display-message -p -t =<real>: #{pane_current_command}`:
95
+ the foreground process of the session's active pane, by name."""
96
+ check_session_name(name)
97
+ return [
98
+ "tmux", "-S", tmux_socket(), "display-message", "-p",
99
+ "-t", tmux_target(name), "#{pane_current_command}",
100
+ ]
101
+
102
+
83
103
  def send_keys_argv(name: str, keys: "tuple[str, ...]") -> "list[str]":
84
104
  """`tmux -S <socket> send-keys -t =<real> <key>…` with every key drawn
85
105
  from `prompts.ALLOWED_KEYS`. Anything else -- a letter, a word, a path --
@@ -270,6 +290,23 @@ class Alissa:
270
290
  log.debug("could not read the pane path of %s (%s)", name, exc)
271
291
  return ""
272
292
 
293
+ def pane_command(self, name: str) -> str:
294
+ """The session's pane current command (`#{pane_current_command}`),
295
+ or "" when tmux cannot answer. The first-turn death check's one
296
+ liveness probe (issue #140): a worker whose pane reads a shell
297
+ (`SHELL_COMMANDS`) has lost its `claude`, however alive the tmux
298
+ session itself is. A READ: runs under dry-run too."""
299
+ try:
300
+ argv = pane_command_argv(name)
301
+ except ValueError as exc:
302
+ log.warning("pane_command refused: %s", exc)
303
+ return ""
304
+ try:
305
+ return run(argv, timeout=15).strip()
306
+ except CommandError as exc:
307
+ log.debug("could not read the pane command of %s (%s)", name, exc)
308
+ return ""
309
+
273
310
  def send_keys(self, name: str, *keys: str, dry_run: bool = False) -> bool:
274
311
  """Press `keys` -- each one of `prompts.ALLOWED_KEYS`, nothing else
275
312
  -- on ONE managed session's pane. True when tmux accepted them.