claude-nb 0.3.0 → 0.4.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/README.md +70 -33
- package/VERSION +1 -1
- package/bin/board +10 -0
- package/bin/cnb +109 -48
- package/bin/init +5 -39
- package/bin/swarm +41 -860
- package/lib/board_db.py +15 -137
- package/lib/board_lock.py +0 -1
- package/lib/board_mailbox.py +15 -7
- package/lib/board_maintenance.py +26 -27
- package/lib/board_msg.py +18 -69
- package/lib/board_task.py +35 -38
- package/lib/board_tui.py +112 -0
- package/lib/board_view.py +12 -24
- package/lib/concerns/__init__.py +4 -11
- package/lib/concerns/{coral_manager.py → coral.py} +53 -3
- package/lib/concerns/file_watcher.py +1 -1
- package/lib/concerns/health.py +136 -0
- package/lib/concerns/helpers.py +1 -5
- package/lib/concerns/idle.py +130 -0
- package/lib/concerns/notifications.py +90 -0
- package/lib/migrate.py +1 -0
- package/lib/monitor.py +1 -18
- package/lib/swarm.py +456 -0
- package/lib/swarm_backend.py +266 -0
- package/package.json +1 -1
- package/pyproject.toml +1 -1
- package/registry/pubkeys.json +2 -1
- package/lib/concerns/bug_sla_checker.py +0 -32
- package/lib/concerns/coral_poker.py +0 -57
- package/lib/concerns/health_checker.py +0 -72
- package/lib/concerns/idle_detector.py +0 -56
- package/lib/concerns/idle_killer.py +0 -41
- package/lib/concerns/idle_nudger.py +0 -38
- package/lib/concerns/inbox_nudger.py +0 -34
- package/lib/concerns/resource_monitor.py +0 -47
- package/lib/concerns/session_keepalive.py +0 -23
- package/lib/concerns/time_announcer.py +0 -34
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
"""SessionKeepAlive — detect dead dev sessions."""
|
|
2
|
-
|
|
3
|
-
from lib.common import is_suspended
|
|
4
|
-
|
|
5
|
-
from .base import Concern
|
|
6
|
-
from .config import DispatcherConfig
|
|
7
|
-
from .helpers import get_dev_sessions, is_claude_running, log, tmux_ok
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
class SessionKeepAlive(Concern):
|
|
11
|
-
interval = 5
|
|
12
|
-
|
|
13
|
-
def __init__(self, cfg: DispatcherConfig) -> None:
|
|
14
|
-
super().__init__()
|
|
15
|
-
self.cfg = cfg
|
|
16
|
-
|
|
17
|
-
def tick(self, now: int) -> None:
|
|
18
|
-
for name in get_dev_sessions(self.cfg):
|
|
19
|
-
if is_suspended(name, self.cfg.suspended_file):
|
|
20
|
-
continue
|
|
21
|
-
sess = f"{self.cfg.prefix}-{name}"
|
|
22
|
-
if tmux_ok("has-session", "-t", sess) and not is_claude_running(sess):
|
|
23
|
-
log(f"{name}: agent exited, NOT restarting (idle policy)")
|
|
@@ -1,34 +0,0 @@
|
|
|
1
|
-
"""TimeAnnouncer — hourly/daily announcements."""
|
|
2
|
-
|
|
3
|
-
from .base import Concern
|
|
4
|
-
from .config import DispatcherConfig
|
|
5
|
-
from .helpers import board_send, log
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
class TimeAnnouncer(Concern):
|
|
9
|
-
interval = 30
|
|
10
|
-
|
|
11
|
-
def __init__(self, cfg: DispatcherConfig) -> None:
|
|
12
|
-
super().__init__()
|
|
13
|
-
self.cfg = cfg
|
|
14
|
-
self.last_hour = -1
|
|
15
|
-
|
|
16
|
-
def tick(self, now: int) -> None:
|
|
17
|
-
from datetime import datetime as dt
|
|
18
|
-
|
|
19
|
-
d = dt.now()
|
|
20
|
-
if d.minute != 0 or d.hour == self.last_hour:
|
|
21
|
-
return
|
|
22
|
-
self.last_hour = d.hour
|
|
23
|
-
ts = d.strftime("%Y-%m-%d %H:%M")
|
|
24
|
-
|
|
25
|
-
if d.hour == 9:
|
|
26
|
-
board_send(
|
|
27
|
-
self.cfg,
|
|
28
|
-
"All",
|
|
29
|
-
f"[Clock] {ts} ({d.strftime('%A')}) — 新一天。检查 KR 列表,确认优先级。",
|
|
30
|
-
)
|
|
31
|
-
log("Daily announcement sent")
|
|
32
|
-
else:
|
|
33
|
-
board_send(self.cfg, "All", f"[Clock] 现在是 {ts}。")
|
|
34
|
-
log(f"Hourly announcement: {d.hour}:00")
|