onako 0.4.0__tar.gz → 0.4.2__tar.gz

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.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: onako
3
- Version: 0.4.0
3
+ Version: 0.4.2
4
4
  Summary: Dispatch and monitor Claude Code tasks from your phone
5
5
  Author: Amir
6
6
  License-Expression: MIT
@@ -45,6 +45,14 @@ onako serve # foreground server (for development)
45
45
  onako version # print version
46
46
  ```
47
47
 
48
+ ### Adopting existing tmux windows
49
+
50
+ If you already have work running in another tmux session, move those windows into onako's session so they show up in the dashboard:
51
+
52
+ ```bash
53
+ tmux move-window -s <session>:<window> -t onako
54
+ ```
55
+
48
56
  ## How it works
49
57
 
50
58
  Onako monitors all tmux windows in the configured session. Windows it creates (via the dashboard) are "managed" tasks. Windows created by you or other tools are discovered automatically as "external" — both get full dashboard support: view output, send messages, kill.
@@ -28,6 +28,14 @@ onako serve # foreground server (for development)
28
28
  onako version # print version
29
29
  ```
30
30
 
31
+ ### Adopting existing tmux windows
32
+
33
+ If you already have work running in another tmux session, move those windows into onako's session so they show up in the dashboard:
34
+
35
+ ```bash
36
+ tmux move-window -s <session>:<window> -t onako
37
+ ```
38
+
31
39
  ## How it works
32
40
 
33
41
  Onako monitors all tmux windows in the configured session. Windows it creates (via the dashboard) are "managed" tasks. Windows created by you or other tools are discovered automatically as "external" — both get full dashboard support: view output, send messages, kill.
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
4
4
 
5
5
  [project]
6
6
  name = "onako"
7
- version = "0.4.0"
7
+ version = "0.4.2"
8
8
  description = "Dispatch and monitor Claude Code tasks from your phone"
9
9
  readme = "README.md"
10
10
  license = "MIT"
@@ -0,0 +1 @@
1
+ __version__ = "0.4.2"
@@ -43,8 +43,10 @@ def main(ctx, host, port, session, working_dir, skip_permissions):
43
43
 
44
44
  _start_server(host, port, session, working_dir, skip_permissions)
45
45
 
46
- # If not inside tmux, ensure session exists and attach
47
- if not os.environ.get("TMUX"):
46
+ inside_tmux = bool(os.environ.get("TMUX"))
47
+
48
+ # If not inside tmux, ensure session exists
49
+ if not inside_tmux:
48
50
  result = subprocess.run(
49
51
  ["tmux", "has-session", "-t", session],
50
52
  capture_output=True,
@@ -54,6 +56,16 @@ def main(ctx, host, port, session, working_dir, skip_permissions):
54
56
  ["tmux", "new-session", "-d", "-s", session],
55
57
  check=True,
56
58
  )
59
+
60
+ # Show dashboard URL in tmux status bar
61
+ local_ip = _get_local_ip() or "localhost"
62
+ subprocess.run(
63
+ ["tmux", "set", "-t", session, "status-right",
64
+ f"onako dash: http://{local_ip}:{port}"],
65
+ capture_output=True,
66
+ )
67
+
68
+ if not inside_tmux:
57
69
  os.execvp("tmux", ["tmux", "attach-session", "-t", session])
58
70
 
59
71
 
@@ -21,9 +21,14 @@ class TmuxOrchestrator:
21
21
  self._ensure_session()
22
22
  self.rediscover_tasks()
23
23
 
24
+ @property
25
+ def _session_target(self) -> str:
26
+ """Session name with colon suffix for unambiguous tmux targeting."""
27
+ return f"{self.session_name}:"
28
+
24
29
  def _ensure_session(self):
25
30
  result = subprocess.run(
26
- ["tmux", "has-session", "-t", self.session_name],
31
+ ["tmux", "has-session", "-t", self._session_target],
27
32
  capture_output=True,
28
33
  )
29
34
  if result.returncode != 0:
@@ -88,11 +93,11 @@ class TmuxOrchestrator:
88
93
  self._ensure_session()
89
94
  task_id = f"task-{secrets.token_hex(4)}"
90
95
  self._run_tmux(
91
- "new-window", "-t", self.session_name, "-n", task_id,
96
+ "new-window", "-t", self._session_target, "-n", task_id,
92
97
  )
93
98
  # Look up the window ID for safe targeting
94
99
  result = self._run_tmux(
95
- "list-windows", "-t", self.session_name, "-F", "#{window_name}|#{window_id}",
100
+ "list-windows", "-t", self._session_target, "-F", "#{window_name}|#{window_id}",
96
101
  )
97
102
  if result.stdout.strip():
98
103
  for line in result.stdout.strip().split("\n"):
@@ -179,7 +184,7 @@ class TmuxOrchestrator:
179
184
 
180
185
  def _sync_task_status(self):
181
186
  result = self._run_tmux(
182
- "list-windows", "-t", self.session_name, "-F", "#{window_name}|#{window_id}",
187
+ "list-windows", "-t", self._session_target, "-F", "#{window_name}|#{window_id}",
183
188
  )
184
189
  active_windows = set()
185
190
  if result.stdout.strip():
@@ -196,7 +201,7 @@ class TmuxOrchestrator:
196
201
  def rediscover_tasks(self):
197
202
  """Rediscover tasks from existing tmux windows on server restart."""
198
203
  result = self._run_tmux(
199
- "list-windows", "-t", self.session_name, "-F", "#{window_name}|#{window_id}",
204
+ "list-windows", "-t", self._session_target, "-F", "#{window_name}|#{window_id}",
200
205
  )
201
206
  if not result.stdout.strip():
202
207
  return
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: onako
3
- Version: 0.4.0
3
+ Version: 0.4.2
4
4
  Summary: Dispatch and monitor Claude Code tasks from your phone
5
5
  Author: Amir
6
6
  License-Expression: MIT
@@ -45,6 +45,14 @@ onako serve # foreground server (for development)
45
45
  onako version # print version
46
46
  ```
47
47
 
48
+ ### Adopting existing tmux windows
49
+
50
+ If you already have work running in another tmux session, move those windows into onako's session so they show up in the dashboard:
51
+
52
+ ```bash
53
+ tmux move-window -s <session>:<window> -t onako
54
+ ```
55
+
48
56
  ## How it works
49
57
 
50
58
  Onako monitors all tmux windows in the configured session. Windows it creates (via the dashboard) are "managed" tasks. Windows created by you or other tools are discovered automatically as "external" — both get full dashboard support: view output, send messages, kill.
@@ -6,7 +6,7 @@ def test_version():
6
6
  runner = CliRunner()
7
7
  result = runner.invoke(main, ["version"])
8
8
  assert result.exit_code == 0
9
- assert "0.3.0" in result.output
9
+ assert "onako" in result.output
10
10
 
11
11
 
12
12
  def test_default_help():
@@ -1 +0,0 @@
1
- __version__ = "0.4.0"
File without changes
File without changes
File without changes
File without changes
File without changes