Skip to content

CLI for SidePulse

Python

Add JetBrains Junie agent support

Peter Kuhar1249a264f121
diff --git a/README.md b/README.md
index ae4f8a9..ac58357 100644
--- a/README.md
+++ b/README.md
@@ -201,7 +201,7 @@ SidePulse Pro and SidePulse Dot.
#### AI Agent Monitoring
-SidePulse can monitor AI agents such as Codex, Claude, and Grok through hooks, then
+SidePulse can monitor AI agents such as Codex, Claude, Grok, Cursor, and Junie through hooks, then
translate the current agent state into a small, glanceable LED status.
Agent status modes:
@@ -228,7 +228,7 @@ that depend on the hardware layout have only `-2.LED` and `-8.LED` variants.
Custom programs are stored in the `animations/` folder beside `settings.json`.
An animation may set its own `brightness`, which is multiplied by the device's
brightness setting so the device setting remains the overall limit. The tab shows a
-live Screen Bar-rendered preview for every state;
+live SidePulse Notch-rendered preview for every state;
**Show** sends that pattern to connected agent-display devices for three
seconds, then restores live status. **Current** appears whenever individual
state selections no longer match one of the built-in or saved profiles.
@@ -356,11 +356,11 @@ Set up this Mac explicitly after package install:
sidepulse setup
```
-`sidepulse setup` installs or refreshes Codex, Claude, and Grok hooks, installs
-SidePulse Pro Eject Prevention, writes the status-bar LaunchAgent, starts both helpers
-immediately, and enables them at login. This is intentionally an explicit
-command instead of a `pip install` side effect. To set up only one provider, use
-`sidepulse setup codex`, `sidepulse setup claude`, or `sidepulse setup grok`.
+`sidepulse setup` installs or refreshes all supported agent hooks, including
+Junie CLI, installs SidePulse Pro Eject Prevention, writes the status-bar
+LaunchAgent, starts both helpers immediately, and enables them at login. This is
+intentionally an explicit command instead of a `pip install` side effect. To set
+up only one provider, pass its name, for example `sidepulse setup junie`.
To skip the status-bar app but still install hooks and SidePulse Pro Eject Prevention, use
`sidepulse setup --no-status-bar`.
@@ -417,6 +417,8 @@ sidepulse agent-monitor install
sidepulse agent-monitor install codex
sidepulse agent-monitor install claude
sidepulse agent-monitor install grok
+sidepulse agent-monitor install cursor
+sidepulse agent-monitor install junie
```
Each hook invokes a small, standard-library-only Python entry point. It writes
@@ -483,7 +485,7 @@ Codex `PermissionRequest` events are treated as Ask and remain sticky until the
matching tool command finishes. This prevents unrelated same-session activity
from hiding an approval prompt that is still waiting on the user.
-For Codex, Claude, or Grok projects that should report this reliably, add
+For Codex, Claude, Grok, Cursor, or Junie projects that should report this reliably, add
guidance like this to the relevant agent instructions:
```text
@@ -518,6 +520,8 @@ sidepulse agent-monitor uninstall
sidepulse agent-monitor uninstall codex
sidepulse agent-monitor uninstall claude
sidepulse agent-monitor uninstall grok
+sidepulse agent-monitor uninstall cursor
+sidepulse agent-monitor uninstall junie
```
Install and start the macOS status-bar app:
@@ -568,23 +572,30 @@ battery status. When agent status is selected, `Show Battery on Plug/Unplug`
can briefly show the battery animation for seven seconds after the power source
changes.
-The Devices section also offers **Add Screen Bar**, an optional virtual
+The Devices section also offers **Add SidePulse Notch**, an optional virtual
eight-LED device. It appears as a notch-shaped status-bar overlay that covers
the camera island/notch footprint and adds a straight 5 px LED band along the
bottom edge, or the corresponding top-center position on a display without a
notch. Each virtual LED blends across a three-LED footprint: centered on the
target LED, fading one LED width left and right. It shares the physical
device's status animations, display-mode selection, and per-device brightness
-control. The Screen Bar evaluates the same `LEDS.LED` programs with the
+control. SidePulse Notch evaluates the same `LEDS.LED` programs with the
firmware/websim `sdled.wasm` engine, then AppKit only draws the returned RGB
frames.
Open `Settings...` from the dropdown to manage agent integrations. The settings
-window can install or uninstall Codex, Claude, and Grok hooks. The transcript
+window can install or uninstall Codex, Claude, Grok, and Junie hooks. The transcript
checkboxes control the file-based CLI/debug fallback; the status-bar app gets
live updates from the local hook event socket. Settings are stored at
`${XDG_CONFIG_HOME:-~/.config}/sidepulse/agent-monitor/settings.json`.
+Junie support uses its user-level `~/.junie/config.json` hooks. Junie currently
+emits hooks from its interactive and batch CLI hosts, including CLI sessions
+connected to a JetBrains IDE; Junie hosted directly through IDE/ACP does not yet
+emit hooks. SidePulse intentionally does not register a Junie `PermissionRequest`
+hook because a successful observer hook would automatically approve the requested
+action. Junie's normal approval prompts therefore remain unchanged.
+
Settings can export the hook decision log as CSV or HTML. This log lives at
`${XDG_STATE_HOME:-~/.local/state}/sidepulse/agent-monitor/event-status.jsonl`
and shows the path from provider hook event to interpreted SidePulse status.
diff --git a/src/sidepulse/cli.py b/src/sidepulse/cli.py
index 7ded3fd..1feb725 100644
--- a/src/sidepulse/cli.py
+++ b/src/sidepulse/cli.py
@@ -36,10 +36,12 @@ from .install import (
install_codex_hooks,
install_cursor_hooks,
install_grok_hooks,
+ install_junie_hooks,
uninstall_claude_hooks,
uninstall_codex_hooks,
uninstall_cursor_hooks,
uninstall_grok_hooks,
+ uninstall_junie_hooks,
)
from .led_status import AgentLedController, LedStatusWrite
from .links import (
@@ -70,10 +72,8 @@ from .lid_sleep import (
from .models import AgentStatus
from .providers import (
HOOK_PROVIDERS,
- detect_claude_config,
- detect_codex_config,
- detect_grok_config,
detect_log_path,
+ detect_provider_configs,
default_log_path,
)
from .settings import (
@@ -130,6 +130,8 @@ def build_sidepulse_parser() -> argparse.ArgumentParser:
setup.add_argument("--codex-log", type=Path, help="Codex JSONL log path.")
setup.add_argument("--claude-log", type=Path, help="Claude JSONL log path.")
setup.add_argument("--grok-log", type=Path, help="Grok JSONL log path.")
+ setup.add_argument("--cursor-log", type=Path, help="Cursor JSONL log path.")
+ setup.add_argument("--junie-log", type=Path, help="Junie JSONL log path.")
setup.add_argument("--dry-run", action="store_true", help="Show what would change.")
setup.add_argument(
"--sd-eject-guard-scope",
@@ -1135,20 +1137,24 @@ def build_parser(prog: str = "agent-monitor") -> argparse.ArgumentParser:
)
status_bar.set_defaults(func=cmd_status_bar)
- install = subparsers.add_parser("install", help="Install Codex, Claude, and/or Grok monitor hooks.")
+ install = subparsers.add_parser("install", help="Install supported AI agent monitor hooks.")
install.add_argument("provider", choices=("all", *HOOK_PROVIDERS), nargs="?", default="all")
install.add_argument("--log-dir", type=Path, help="Directory for provider JSONL files.")
install.add_argument("--codex-log", type=Path, help="Codex JSONL log path.")
install.add_argument("--claude-log", type=Path, help="Claude JSONL log path.")
install.add_argument("--grok-log", type=Path, help="Grok JSONL log path.")
+ install.add_argument("--cursor-log", type=Path, help="Cursor JSONL log path.")
+ install.add_argument("--junie-log", type=Path, help="Junie JSONL log path.")
install.add_argument("--dry-run", action="store_true", help="Show what would change.")
install.set_defaults(func=cmd_install)
- uninstall = subparsers.add_parser("uninstall", help="Remove Codex, Claude, and/or Grok monitor hooks.")
+ uninstall = subparsers.add_parser("uninstall", help="Remove supported AI agent monitor hooks.")
uninstall.add_argument("provider", choices=("all", *HOOK_PROVIDERS), nargs="?", default="all")
uninstall.add_argument("--codex-log", type=Path, help="Codex JSONL log path.")
uninstall.add_argument("--claude-log", type=Path, help="Claude JSONL log path.")
uninstall.add_argument("--grok-log", type=Path, help="Grok JSONL log path.")
+ uninstall.add_argument("--cursor-log", type=Path, help="Cursor JSONL log path.")
+ uninstall.add_argument("--junie-log", type=Path, help="Junie JSONL log path.")
uninstall.add_argument("--dry-run", action="store_true", help="Show what would change.")
uninstall.set_defaults(func=cmd_uninstall)
@@ -1190,10 +1196,12 @@ def add_status_args(parser: argparse.ArgumentParser, include_json: bool = True)
parser.add_argument("--codex-log", type=Path, help="Codex JSONL log path.")
parser.add_argument("--claude-log", type=Path, help="Claude JSONL log path.")
parser.add_argument("--grok-log", type=Path, help="Grok JSONL log path.")
+ parser.add_argument("--cursor-log", type=Path, help="Cursor JSONL log path.")
+ parser.add_argument("--junie-log", type=Path, help="Junie JSONL log path.")
def cmd_doctor(args: argparse.Namespace) -> int:
- configs = [detect_codex_config(), detect_claude_config(), detect_grok_config()]
+ configs = detect_provider_configs()
payload = {"providers": [config.to_dict() for config in configs]}
if args.json:
print(json.dumps(payload, indent=2))
@@ -1314,8 +1322,10 @@ def install_hook_results(args: argparse.Namespace):
results.append(install_claude_hooks(log_path=log_path, dry_run=args.dry_run))
elif provider == "cursor":
results.append(install_cursor_hooks(log_path=log_path, dry_run=args.dry_run))
- else:
+ elif provider == "grok":
results.append(install_grok_hooks(log_path=log_path, dry_run=args.dry_run))
+ else:
+ results.append(install_junie_hooks(log_path=log_path, dry_run=args.dry_run))
return results
@@ -1342,8 +1352,10 @@ def cmd_uninstall(args: argparse.Namespace) -> int:
results.append(uninstall_claude_hooks(log_path=log_path, dry_run=args.dry_run))
elif provider == "cursor":
results.append(uninstall_cursor_hooks(log_path=log_path, dry_run=args.dry_run))
- else:
+ elif provider == "grok":
results.append(uninstall_grok_hooks(log_path=log_path, dry_run=args.dry_run))
+ else:
+ results.append(uninstall_junie_hooks(log_path=log_path, dry_run=args.dry_run))
for result in results:
action = "would remove" if args.dry_run and result.changed else "removed"
diff --git a/src/sidepulse/collector.py b/src/sidepulse/collector.py
index 598a228..529dd08 100644
--- a/src/sidepulse/collector.py
+++ b/src/sidepulse/collector.py
@@ -514,6 +514,7 @@ def default_sources(settings: AgentMonitorSettings | None = None) -> tuple[Sourc
if active_settings.claude_transcripts_enabled:
sources.append(SourceSpec(CLAUDE_TRANSCRIPT_PROVIDER, Path.home() / ".claude" / "projects"))
sources.append(SourceSpec("grok", detect_log_path("grok")))
+ sources.append(SourceSpec("junie", detect_log_path("junie")))
return unique_sources(sources)
diff --git a/src/sidepulse/hook.py b/src/sidepulse/hook.py
index ad4aeb9..af89dec 100644
--- a/src/sidepulse/hook.py
+++ b/src/sidepulse/hook.py
@@ -8,7 +8,7 @@ from pathlib import Path
from typing import Any
from .audit import append_status_audit_record
-from .collector import StatusMetadata, status_from_event, title_from_event
+from .collector import StatusMetadata, read_recent_lines, status_from_event, title_from_event
from .ipc import send_hook_event
from .origin import annotate_payload_with_origin
from .providers import detect_log_path, infer_provider_from_payload, parse_log_line
@@ -105,6 +105,91 @@ def hook_event_socket_disabled() -> bool:
}
+def normalize_junie_payload(
+ payload: dict[str, Any],
+ log_path: Path,
+ *,
+ process_id: int | None = None,
+) -> dict[str, Any]:
+ """Restore session context omitted by some Junie hook payloads.
+
+ Junie's Stop, StopFailure, and SessionEnd wire payloads do not include the
+ session fields sent with SessionStart/UserPromptSubmit. The Junie process id
+ lets separate CLI instances correlate independently; the most recent Junie
+ context is a fallback for launchers where ancestry cannot be identified.
+ """
+ normalized = dict(payload)
+ if process_id is None:
+ active_process_id, origin = junie_process_context()
+ if origin is not None and "agent_origin" not in normalized:
+ normalized.update(origin)
+ else:
+ active_process_id = process_id
+ if active_process_id is not None:
+ normalized.setdefault("sidepulse_junie_process_id", active_process_id)
+
+ if normalized.get("session_id") and normalized.get("cwd"):
+ return normalized
+
+ context = latest_junie_hook_context(log_path, active_process_id)
+ if context is None:
+ return normalized
+ for key in ("session_id", "cwd", "project_path"):
+ if context.get(key) is not None:
+ normalized.setdefault(key, context[key])
+ return normalized
+
+
+def junie_process_id() -> int | None:
+ return junie_process_context()[0]
+
+
+def junie_process_context() -> tuple[int | None, dict[str, str] | None]:
+ try:
+ from .origin import origin_from_processes, process_ancestry, process_basename
+
+ ancestry = process_ancestry(os.getppid())
+ origin = origin_from_processes("junie", ancestry)
+ for info in ancestry:
+ command = info.command.lower()
+ if process_basename(info) == "junie" or any(
+ marker in command
+ for marker in (
+ "/junie.app/",
+ "junie-release-",
+ "matterhorn.ej.app.cli.standalone",
+ )
+ ):
+ return info.pid, origin.to_payload() if origin is not None else None
+ except Exception:
+ pass
+ return None, None
+
+
+def latest_junie_hook_context(
+ log_path: Path,
+ process_id: int | None,
+) -> dict[str, Any] | None:
+ try:
+ lines = read_recent_lines(log_path.expanduser(), 200)
+ except OSError:
+ return None
+
+ fallback = None
+ for line in reversed(lines):
+ try:
+ row = json.loads(line)
+ except (json.JSONDecodeError, TypeError):
+ continue
+ if not isinstance(row, dict) or not row.get("session_id"):
+ continue
+ if fallback is None:
+ fallback = row
+ if process_id is not None and row.get("sidepulse_junie_process_id") == process_id:
+ return row
+ return fallback
+
+
def hook_log_main(provider: str, log_path: Path, event: str | None = None) -> int:
try:
payload_text = sys.stdin.read()
@@ -118,6 +203,14 @@ def hook_log_main(provider: str, log_path: Path, event: str | None = None) -> in
payload = raw if isinstance(raw, dict) else {}
normalized = normalize_payload(event, payload)
payload_text = json.dumps(normalized, separators=(",", ":"), ensure_ascii=False)
+ elif provider == "junie":
+ try:
+ raw = json.loads(payload_text or "{}")
+ except json.JSONDecodeError:
+ raw = {}
+ payload = raw if isinstance(raw, dict) else {}
+ normalized = normalize_junie_payload(payload, log_path)
+ payload_text = json.dumps(normalized, separators=(",", ":"), ensure_ascii=False)
actual_provider, actual_log_path, line = routed_hook_payload(
provider,
diff --git a/src/sidepulse/install.py b/src/sidepulse/install.py
index 4d5669b..0d2ed8e 100644
--- a/src/sidepulse/install.py
+++ b/src/sidepulse/install.py
@@ -20,8 +20,11 @@ from .providers import (
CODEX_EVENTS,
CURSOR_EVENTS,
GROK_EVENTS,
+ JUNIE_EVENTS,
+ JUNIE_MONITOR_EVENTS,
default_cursor_hook_config_path,
default_grok_hook_config_path,
+ default_junie_hook_config_path,
detect_log_path,
)
@@ -169,6 +172,39 @@ def install_grok_hooks(
return InstallResult("grok", config, target_log, changed, backup, dry_run)
+def install_junie_hooks(
+ log_path: Path | None = None,
+ config_path: Path | None = None,
+ dry_run: bool = False,
+ python_executable: str | None = None,
+) -> InstallResult:
+ config = config_path or default_junie_hook_config_path()
+ target_log = (log_path or detect_log_path("junie")).expanduser()
+ data = read_json_config(config)
+ original = json.dumps(data, sort_keys=True)
+ hooks = data.setdefault("hooks", {})
+ command = hook_command("junie", target_log, python_executable)
+
+ for event_name in JUNIE_MONITOR_EVENTS:
+ entries = hooks.get(event_name, [])
+ if not isinstance(entries, list):
+ entries = []
+ cleaned = remove_json_command_hooks_for_log(entries, target_log)
+ cleaned.append({"hooks": [{"type": "command", "command": command}]})
+ hooks[event_name] = cleaned
+
+ changed = json.dumps(data, sort_keys=True) != original
+ backup = None
+ if changed and not dry_run:
+ config.parent.mkdir(parents=True, exist_ok=True)
+ backup = backup_file(config)
+ config.write_text(json.dumps(data, indent=2, sort_keys=False) + "\n")
+ target_log.parent.mkdir(parents=True, exist_ok=True)
+ target_log.touch(exist_ok=True)
+
+ return InstallResult("junie", config, target_log, changed, backup, dry_run)
+
+
def uninstall_codex_hooks(
log_path: Path | None = None,
config_path: Path | None = None,
@@ -282,6 +318,32 @@ def uninstall_grok_hooks(
return InstallResult("grok", config, target_log, changed, backup, dry_run)
+def uninstall_junie_hooks(
+ log_path: Path | None = None,
+ config_path: Path | None = None,
+ dry_run: bool = False,
+) -> InstallResult:
+ config = config_path or default_junie_hook_config_path()
+ target_log = (log_path or detect_log_path("junie")).expanduser()
+ data = read_json_config(config)
+ original = json.dumps(data, sort_keys=True)
+ cleaned = clean_json_hook_data(data, target_log, JUNIE_EVENTS)
+ changed = json.dumps(cleaned, sort_keys=True) != original
+ backup = None
+ if changed and not dry_run:
+ config.parent.mkdir(parents=True, exist_ok=True)
+ backup = backup_file(config)
+ if cleaned:
+ config.write_text(json.dumps(cleaned, indent=2, sort_keys=False) + "\n")
+ else:
+ try:
+ config.unlink()
+ except FileNotFoundError:
+ pass
+
+ return InstallResult("junie", config, target_log, changed, backup, dry_run)
+
+
def install_cursor_hooks(
log_path: Path | None = None,
config_path: Path | None = None,
diff --git a/src/sidepulse/origin.py b/src/sidepulse/origin.py
index 3f87a73..1e7c514 100644
--- a/src/sidepulse/origin.py
+++ b/src/sidepulse/origin.py
@@ -94,6 +94,8 @@ def origin_from_environment(provider: str, env: Mapping[str, str]) -> AgentOrigi
return surface_origin(provider, "app", "env:__CFBundleIdentifier")
if provider == "grok" and "grok" in bundle_id:
return surface_origin(provider, "app", "env:__CFBundleIdentifier")
+ if provider == "junie" and "jetbrains" in bundle_id:
+ return surface_origin(provider, "ide", "env:__CFBundleIdentifier")
return None
@@ -119,6 +121,21 @@ def origin_from_processes(
return surface_origin(provider, "app", "process:Claude.app")
if provider == "grok" and "grok.app" in haystack:
return surface_origin(provider, "app", "process:Grok.app")
+ if provider == "junie" and any(
+ token in haystack
+ for token in (
+ "intellij idea.app",
+ "pycharm.app",
+ "webstorm.app",
+ "goland.app",
+ "phpstorm.app",
+ "rubymine.app",
+ "rustrover.app",
+ "rider.app",
+ "clion.app",
+ )
+ ):
+ return surface_origin(provider, "ide", "process:JetBrains IDE")
for info in processes:
basename = process_basename(info)
@@ -128,6 +145,8 @@ def origin_from_processes(
return surface_origin(provider, "cli", "process:claude")
if provider == "grok" and basename == "grok":
return surface_origin(provider, "cli", "process:grok")
+ if provider == "junie" and basename == "junie":
+ return surface_origin(provider, "cli", "process:junie")
return None
@@ -152,6 +171,9 @@ def surface_origin(provider: str, surface: str, source: str) -> AgentOrigin:
("grok", "cursor"): "Grok in Cursor",
("grok", "windsurf"): "Grok in Windsurf",
("grok", "transcript"): "Grok Transcript",
+ ("junie", "cli"): "Junie CLI",
+ ("junie", "ide"): "Junie in JetBrains IDE",
+ ("junie", "transcript"): "Junie Transcript",
}
label = labels.get((provider, surface), provider_label(provider))
return AgentOrigin(
diff --git a/src/sidepulse/providers.py b/src/sidepulse/providers.py
index 516ec6c..7180801 100644
--- a/src/sidepulse/providers.py
+++ b/src/sidepulse/providers.py
@@ -74,8 +74,25 @@ CURSOR_EVENTS = (
"stop",
)
-HOOK_PROVIDERS = ("codex", "claude", "grok", "cursor")
-KNOWN_EVENTS = tuple(dict.fromkeys(CODEX_EVENTS + CLAUDE_EVENTS + GROK_EVENTS))
+JUNIE_EVENTS = (
+ "SessionStart",
+ "UserPromptSubmit",
+ "PreToolUse",
+ "PermissionRequest",
+ "Stop",
+ "StopFailure",
+ "SessionEnd",
+)
+# Junie treats a successful PermissionRequest hook as approval. An observer must
+# not change that security decision, so SidePulse monitors every other event.
+JUNIE_MONITOR_EVENTS = tuple(
+ event for event in JUNIE_EVENTS if event != "PermissionRequest"
+)
+
+HOOK_PROVIDERS = ("codex", "claude", "grok", "cursor", "junie")
+KNOWN_EVENTS = tuple(
+ dict.fromkeys(CODEX_EVENTS + CLAUDE_EVENTS + GROK_EVENTS + JUNIE_EVENTS)
+)
@dataclass(frozen=True)
@@ -134,6 +151,7 @@ def detect_provider_configs(home: Path | None = None) -> list[ProviderConfig]:
detect_claude_config(home),
detect_grok_config(home),
detect_cursor_config(home),
+ detect_junie_config(home),
]
@@ -322,6 +340,64 @@ def detect_cursor_config(home: Path | None = None) -> ProviderConfig:
)
+def default_junie_hook_config_path(home: Path | None = None) -> Path:
+ base = home or Path.home()
+ return base / ".junie" / "config.json"
+
+
+def detect_junie_config(home: Path | None = None) -> ProviderConfig:
+ config_path = default_junie_hook_config_path(home)
+ if not config_path.exists():
+ return ProviderConfig("junie", config_path, False, False, (), ())
+
+ try:
+ data = json.loads(config_path.read_text())
+ except Exception:
+ return ProviderConfig("junie", config_path, True, False, (), ())
+
+ hooks = data.get("hooks") or {}
+ hook_events: list[str] = []
+ paths: list[Path] = []
+ if isinstance(hooks, dict):
+ for event_name, entries in hooks.items():
+ if event_name not in JUNIE_EVENTS or not isinstance(entries, list):
+ continue
+ managed_entries = [
+ entry
+ for entry in entries
+ if _entry_has_sidepulse_hook(entry)
+ ]
+ if managed_entries:
+ hook_events.append(event_name)
+ paths.extend(_paths_from_hook_entries(managed_entries))
+
+ return ProviderConfig(
+ "junie",
+ config_path,
+ True,
+ bool(hook_events),
+ tuple(sorted(set(hook_events))),
+ _dedupe_paths(paths),
+ )
+
+
+def _entry_has_sidepulse_hook(entry: Any) -> bool:
+ if not isinstance(entry, dict):
+ return False
+ hooks = entry.get("hooks")
+ if not isinstance(hooks, list):
+ return False
+ return any(
+ isinstance(hook, dict)
+ and (
+ "sidepulse hook-log" in str(hook.get("command") or "")
+ or "agent-monitor hook-log" in str(hook.get("command") or "")
+ or "hook_entry.py" in str(hook.get("command") or "")
+ )
+ for hook in hooks
+ )
+
+
def _paths_from_cursor_entries(entries: list[Any]) -> list[Path]:
"""Cursor stores a flat ``{"command": ...}`` per entry, not a nested list."""
paths: list[Path] = []
@@ -344,6 +420,8 @@ def detect_log_path(provider: str, home: Path | None = None) -> Path:
config = detect_grok_config(home)
elif provider == "cursor":
config = detect_cursor_config(home)
+ elif provider == "junie":
+ config = detect_junie_config(home)
else:
config = ProviderConfig(provider, default_log_path(provider, home), False, False, (), ())
if config.log_paths:
@@ -393,7 +471,13 @@ def parse_log_line(provider: str, line: str) -> HookEvent | None:
agent_id=_first_string(normalized_raw, "agent_id", "agentId"),
cwd=_first_string(normalized_raw, "cwd", "workspaceRoot"),
tool_name=_first_string(normalized_raw, "tool_name", "toolName"),
- message=_first_string(normalized_raw, "message", "last_assistant_message", "lastAssistantMessage"),
+ message=_first_string(
+ normalized_raw,
+ "message",
+ "last_assistant_message",
+ "lastAssistantMessage",
+ "error_details",
+ ),
origin=origin_label_from_payload(provider, normalized_raw),
)
diff --git a/src/sidepulse/session_actions.py b/src/sidepulse/session_actions.py
index a337b61..528ae2a 100644
--- a/src/sidepulse/session_actions.py
+++ b/src/sidepulse/session_actions.py
@@ -49,6 +49,8 @@ def session_resume_command(status: AgentStatus) -> str | None:
return f"cd {cwd} && claude --resume {session_id}"
if provider == "grok":
return f"cd {cwd} && grok --resume {session_id}"
+ if provider == "junie":
+ return f"cd {cwd} && junie --session-id={session_id} --resume"
return None
diff --git a/src/sidepulse/status_bar.py b/src/sidepulse/status_bar.py
index 4b9046c..90b98aa 100644
--- a/src/sidepulse/status_bar.py
+++ b/src/sidepulse/status_bar.py
@@ -101,10 +101,14 @@ from .ipc import HookEventServer, default_event_socket_path, default_latest_stat
from .install import (
install_claude_hooks,
install_codex_hooks,
+ install_cursor_hooks,
install_grok_hooks,
+ install_junie_hooks,
uninstall_claude_hooks,
uninstall_codex_hooks,
+ uninstall_cursor_hooks,
uninstall_grok_hooks,
+ uninstall_junie_hooks,
)
from .led_status import (
AgentLedController,
@@ -137,7 +141,9 @@ from .providers import (
ProviderConfig,
detect_claude_config,
detect_codex_config,
+ detect_cursor_config,
detect_grok_config,
+ detect_junie_config,
default_state_dir,
parse_log_line,
)
@@ -271,7 +277,7 @@ class AnimationProgramTextView(NSTextView):
class AgentAnimationMenuItemView(NSView):
- """Interactive menu row with a Screen Bar-rendered animation preview."""
+ """Interactive menu row with a SidePulse Notch-rendered animation preview."""
def initWithFrame_(self, frame):
self = objc.super(AgentAnimationMenuItemView, self).initWithFrame_(frame)
@@ -351,7 +357,7 @@ STATUS_BAR_KEEPALIVE_VOLUME_NAMES = (
STATUS_BAR_REFRESH_SECONDS = 15.0
STATUS_BAR_DEVICE_POLL_SECONDS = 2.0
STATUS_BAR_SESSION_HISTORY_LIMIT = 10
-SCREEN_BAR_FEATURE_ENABLED = True
+SIDEPULSE_NOTCH_FEATURE_ENABLED = True
STATUS_BAR_MAX_LINES_PER_SOURCE = 500
SETTINGS_WINDOW_WIDTH = 680
SETTINGS_WINDOW_HEIGHT = 560
@@ -637,7 +643,7 @@ class StatusBarController(NSObject):
True,
)
self.show_setup_window_if_needed()
- if SCREEN_BAR_FEATURE_ENABLED and self.settings.virtual_status_device_enabled:
+ if SIDEPULSE_NOTCH_FEATURE_ENABLED and self.settings.virtual_status_device_enabled:
self.virtual_status_device.show()
else:
self.virtual_status_device.hide()
@@ -872,6 +878,22 @@ class StatusBarController(NSObject):
def uninstallGrokHooks_(self, _sender):
self.update_hooks("grok", install=False)
+ @objc.IBAction
+ def installCursorHooks_(self, _sender):
+ self.update_hooks("cursor", install=True)
+
+ @objc.IBAction
+ def uninstallCursorHooks_(self, _sender):
+ self.update_hooks("cursor", install=False)
+
+ @objc.IBAction
+ def installJunieHooks_(self, _sender):
+ self.update_hooks("junie", install=True)
+
+ @objc.IBAction
+ def uninstallJunieHooks_(self, _sender):
+ self.update_hooks("junie", install=False)
+
@objc.IBAction
def toggleCodexTranscripts_(self, sender):
self.set_transcript_monitoring("codex", sender.state() == NSOnState)
@@ -996,7 +1018,7 @@ class StatusBarController(NSObject):
@objc.IBAction
def toggleVirtualStatusDevice_(self, _sender):
- if not SCREEN_BAR_FEATURE_ENABLED:
+ if not SIDEPULSE_NOTCH_FEATURE_ENABLED:
self.set_virtual_status_device(False)
return
self.set_virtual_status_device(not self.settings.virtual_status_device_enabled)
@@ -1342,6 +1364,8 @@ class StatusBarController(NSObject):
codex = detect_codex_config()
claude = detect_claude_config()
grok = detect_grok_config()
+ cursor = detect_cursor_config()
+ junie = detect_junie_config()
set_field_value(
self.settings_fields.get("codex_hook_status"),
hook_status_text(codex),
@@ -1354,6 +1378,14 @@ class StatusBarController(NSObject):
self.settings_fields.get("grok_hook_status"),
hook_status_text(grok),
)
+ set_field_value(
+ self.settings_fields.get("cursor_hook_status"),
+ hook_status_text(cursor),
+ )
+ set_field_value(
+ self.settings_fields.get("junie_hook_status"),
+ hook_status_text(junie),
+ )
set_field_value(
self.settings_fields.get("settings_path"),
f"Settings: {default_settings_path()}",
@@ -1558,10 +1590,20 @@ class StatusBarController(NSObject):
result = install_claude_hooks()
elif provider == "claude":
result = uninstall_claude_hooks()
- elif install:
+ elif provider == "grok" and install:
result = install_grok_hooks()
- else:
+ elif provider == "grok":
result = uninstall_grok_hooks()
+ elif provider == "cursor" and install:
+ result = install_cursor_hooks()
+ elif provider == "cursor":
+ result = uninstall_cursor_hooks()
+ elif provider == "junie" and install:
+ result = install_junie_hooks()
+ elif provider == "junie":
+ result = uninstall_junie_hooks()
+ else:
+ raise ValueError(f"Unsupported hook provider: {provider}")
except Exception as exc:
self.set_settings_message(f"{provider.title()} hooks failed: {exc}")
self.refresh_settings_window()
@@ -1755,15 +1797,15 @@ class StatusBarController(NSObject):
)
def set_virtual_status_device(self, enabled: bool) -> None:
- if not SCREEN_BAR_FEATURE_ENABLED:
+ if not SIDEPULSE_NOTCH_FEATURE_ENABLED:
try:
self.settings = self.settings.with_virtual_status_device(False)
save_settings(self.settings)
except Exception as exc:
- self.set_settings_message(f"Could not disable Screen Bar: {exc}")
+ self.set_settings_message(f"Could not disable SidePulse Notch: {exc}")
return
self.virtual_status_device.hide()
- self.set_settings_message("Screen Bar is disabled for now.")
+ self.set_settings_message("SidePulse Notch is disabled for now.")
self.refresh_(None)
return
@@ -1777,7 +1819,7 @@ class StatusBarController(NSObject):
)
save_settings(self.settings)
except Exception as exc:
- self.set_settings_message(f"Could not save Screen Bar: {exc}")
+ self.set_settings_message(f"Could not save SidePulse Notch: {exc}")
return
if enabled:
self.virtual_status_device.show()
@@ -2615,7 +2657,7 @@ class StatusBarController(NSObject):
for device in self.settings.devices:
if device.device_id == VIRTUAL_DEVICE_ID:
if (
- SCREEN_BAR_FEATURE_ENABLED
+ SIDEPULSE_NOTCH_FEATURE_ENABLED
and self.settings.virtual_status_device_enabled
):
entries_by_id[device.device_id] = StatusBarDevice(
@@ -2757,7 +2799,7 @@ class StatusBarController(NSObject):
mode: AgentMode,
battery_snapshot: BatterySnapshot | None,
) -> None:
- if not SCREEN_BAR_FEATURE_ENABLED:
+ if not SIDEPULSE_NOTCH_FEATURE_ENABLED:
self.virtual_status_device.hide()
return
if not self.settings.virtual_status_device_enabled:
@@ -3345,9 +3387,9 @@ def build_menu(snapshot, state: StatusBarState, target: StatusBarController) ->
menu.addItem_(build_device_menu_item(device, target))
if not devices:
menu.addItem_(disabled_menu_item("No devices"))
- if SCREEN_BAR_FEATURE_ENABLED and not target.settings.virtual_status_device_enabled:
+ if SIDEPULSE_NOTCH_FEATURE_ENABLED and not target.settings.virtual_status_device_enabled:
virtual_toggle = NSMenuItem.alloc().initWithTitle_action_keyEquivalent_(
- "Add Screen Bar",
+ "Add SidePulse Notch",
"toggleVirtualStatusDevice:",
"",
)
@@ -3456,13 +3498,13 @@ def build_device_menu_item(device: StatusBarDevice, target: StatusBarController)
if device.device_id == VIRTUAL_DEVICE_ID:
submenu.addItem_(NSMenuItem.separatorItem())
- remove_screen_bar = NSMenuItem.alloc().initWithTitle_action_keyEquivalent_(
- "Remove Screen Bar",
+ remove_sidepulse_notch = NSMenuItem.alloc().initWithTitle_action_keyEquivalent_(
+ "Remove SidePulse Notch",
"toggleVirtualStatusDevice:",
"",
)
- remove_screen_bar.setTarget_(target)
- submenu.addItem_(remove_screen_bar)
+ remove_sidepulse_notch.setTarget_(target)
+ submenu.addItem_(remove_sidepulse_notch)
if not device.connected:
submenu.addItem_(NSMenuItem.separatorItem())
@@ -4344,43 +4386,102 @@ def build_settings_window(target: StatusBarController) -> NSWindow:
agent_animations_tab = animations_tab
- add_label(agents_tab, "Agent Hooks", 24, 398, 200, 24)
- add_label(agents_tab, "Codex", 32, 360, 80, 22)
- codex_status = add_label(agents_tab, "", 130, 360, 240, 22)
- add_button(agents_tab, "Install", 400, 356, 90, 28, target, "installCodexHooks:")
- add_button(agents_tab, "Uninstall", 500, 356, 100, 28, target, "uninstallCodexHooks:")
-
- add_label(agents_tab, "Claude", 32, 326, 80, 22)
- claude_status = add_label(agents_tab, "", 130, 326, 240, 22)
- add_button(agents_tab, "Install", 400, 322, 90, 28, target, "installClaudeHooks:")
- add_button(agents_tab, "Uninstall", 500, 322, 100, 28, target, "uninstallClaudeHooks:")
-
- add_label(agents_tab, "Grok", 32, 292, 80, 22)
- grok_status = add_label(agents_tab, "", 130, 292, 240, 22)
- add_button(agents_tab, "Install", 400, 288, 90, 28, target, "installGrokHooks:")
- add_button(agents_tab, "Uninstall", 500, 288, 100, 28, target, "uninstallGrokHooks:")
-
- add_separator(agents_tab, 24, 258, tab_width - 48)
- add_label(agents_tab, "Session Opening", 24, 224, 240, 24)
- add_label(agents_tab, "Codex", 32, 188, 100, 22)
- codex_opener = add_provider_opener_popup(agents_tab, "codex", 160, 186, target)
- add_label(agents_tab, "Claude", 32, 154, 100, 22)
- claude_opener = add_provider_opener_popup(agents_tab, "claude", 160, 152, target)
- add_label(agents_tab, "Grok Sessions", 32, 120, 120, 22)
- grok_opener = add_provider_opener_popup(agents_tab, "grok", 160, 118, target)
-
- add_label(agents_tab, "Terminal App", 376, 188, 120, 22)
- terminal_popup = add_terminal_popup(agents_tab, 376, 156, target)
- custom_terminal_path = add_label(agents_tab, "", 376, 128, 170, 22)
- add_button(agents_tab, "Choose...", 500, 92, 100, 28, target, "chooseSessionTerminal:")
-
- add_separator(agents_tab, 24, 80, tab_width - 48)
- add_label(agents_tab, "Transcript Monitoring", 24, 46, 240, 24)
+ section_x = 24
+ label_x = 32
+ value_x = 130
+ primary_action_x = 400
+ secondary_action_x = 500
+ value_width = primary_action_x - value_x - 5
+
+ add_label(agents_tab, "Agent Hooks", section_x, 398, 200, 24)
+
+ def add_hook_row(
+ title: str,
+ y: int,
+ install_selector: str,
+ uninstall_selector: str,
+ ):
+ add_label(agents_tab, title, label_x, y, 80, 22)
+ status = add_label(agents_tab, "", value_x, y, value_width, 22)
+ add_button(
+ agents_tab,
+ "Install",
+ primary_action_x,
+ y - 4,
+ 90,
+ 28,
+ target,
+ install_selector,
+ )
+ add_button(
+ agents_tab,
+ "Uninstall",
+ secondary_action_x,
+ y - 4,
+ 100,
+ 28,
+ target,
+ uninstall_selector,
+ )
+ return status
+
+ codex_status = add_hook_row(
+ "Codex", 364, "installCodexHooks:", "uninstallCodexHooks:"
+ )
+ claude_status = add_hook_row(
+ "Claude", 338, "installClaudeHooks:", "uninstallClaudeHooks:"
+ )
+ grok_status = add_hook_row(
+ "Grok", 312, "installGrokHooks:", "uninstallGrokHooks:"
+ )
+ cursor_status = add_hook_row(
+ "Cursor", 286, "installCursorHooks:", "uninstallCursorHooks:"
+ )
+ junie_status = add_hook_row(
+ "Junie", 260, "installJunieHooks:", "uninstallJunieHooks:"
+ )
+
+ add_separator(agents_tab, section_x, 246, tab_width - 48)
+ add_label(agents_tab, "Session Opening", section_x, 220, 240, 24)
+ add_label(agents_tab, "Terminal App", primary_action_x, 220, 200, 24)
+
+ add_label(agents_tab, "Codex", label_x, 184, 90, 22)
+ codex_opener = add_provider_opener_popup(
+ agents_tab, "codex", value_x, 182, target, width=value_width
+ )
+ add_label(agents_tab, "Claude", label_x, 150, 90, 22)
+ claude_opener = add_provider_opener_popup(
+ agents_tab, "claude", value_x, 148, target, width=value_width
+ )
+ add_label(agents_tab, "Grok", label_x, 116, 90, 22)
+ grok_opener = add_provider_opener_popup(
+ agents_tab, "grok", value_x, 114, target, width=value_width
+ )
+
+ terminal_popup = add_terminal_popup(
+ agents_tab, primary_action_x, 182, target, width=200
+ )
+ custom_terminal_path = add_label(
+ agents_tab, "", primary_action_x, 150, 200, 22
+ )
+ add_button(
+ agents_tab,
+ "Choose...",
+ secondary_action_x,
+ 114,
+ 100,
+ 28,
+ target,
+ "chooseSessionTerminal:",
+ )
+
+ add_separator(agents_tab, section_x, 78, tab_width - 48)
+ add_label(agents_tab, "Transcript Monitoring", section_x, 50, 240, 24)
codex_transcripts = add_checkbox(
agents_tab,
"CLI fallback: Codex transcripts",
32,
- 14,
+ 18,
260,
24,
target,
@@ -4390,7 +4491,7 @@ def build_settings_window(target: StatusBarController) -> NSWindow:
agents_tab,
"CLI fallback: Claude transcripts",
312,
- 14,
+ 18,
260,
24,
target,
@@ -4582,6 +4683,8 @@ def build_settings_window(target: StatusBarController) -> NSWindow:
"codex_hook_status": codex_status,
"claude_hook_status": claude_status,
"grok_hook_status": grok_status,
+ "cursor_hook_status": cursor_status,
+ "junie_hook_status": junie_status,
"debug_log_status": debug_log_status,
"codex_session_opener": codex_opener,
"claude_session_opener": claude_opener,
@@ -5017,9 +5120,17 @@ def refresh_agent_animation_profile_popup(
return
-def add_provider_opener_popup(parent, provider: str, x: int, y: int, target):
+def add_provider_opener_popup(
+ parent,
+ provider: str,
+ x: int,
+ y: int,
+ target,
+ *,
+ width: int = 180,
+):
popup = NSPopUpButton.alloc().initWithFrame_pullsDown_(
- ((x, y), (180, 26)), False
+ ((x, y), (width, 26)), False
)
popup.setTarget_(target)
popup.setAction_("setProviderOpenPreference:")
@@ -5032,9 +5143,9 @@ def add_provider_opener_popup(parent, provider: str, x: int, y: int, target):
return popup
-def add_terminal_popup(parent, x: int, y: int, target):
+def add_terminal_popup(parent, x: int, y: int, target, *, width: int = 150):
popup = NSPopUpButton.alloc().initWithFrame_pullsDown_(
- ((x, y), (150, 26)), False
+ ((x, y), (width, 26)), False
)
popup.setTarget_(target)
popup.setAction_("setSessionTerminal:")
@@ -5374,7 +5485,7 @@ def restore_led_display(target, token_value) -> None:
def hook_status_text(config: ProviderConfig) -> str:
if not config.exists:
- return f"Not installed - config will be created at {config.config_path}"
+ return "Not installed — config created on install"
if config.hook_events:
event_count = len(config.hook_events)
suffix = "event" if event_count == 1 else "events"
diff --git a/src/sidepulse/virtual_device.py b/src/sidepulse/virtual_device.py
index ea21d44..1967d88 100644
--- a/src/sidepulse/virtual_device.py
+++ b/src/sidepulse/virtual_device.py
@@ -25,7 +25,7 @@ from .led_wasm import LedWasmUnavailableError, SdLedWasmController
VIRTUAL_DEVICE_ID = "virtual:status-bar"
-VIRTUAL_DEVICE_NAME = "Screen Bar"
+VIRTUAL_DEVICE_NAME = "SidePulse Notch"
LED_COUNT = 8
WINDOW_WIDTH = 220.0
FALLBACK_NOTCH_DEPTH = 32.0
diff --git a/tests/test_junie_provider.py b/tests/test_junie_provider.py
new file mode 100644
index 0000000..a6171a5
--- /dev/null
+++ b/tests/test_junie_provider.py
@@ -0,0 +1,182 @@
+from __future__ import annotations
+
+import json
+import tempfile
+import unittest
+from datetime import datetime, timezone
+from pathlib import Path
+
+from sidepulse.collector import AgentMonitor, SourceSpec
+from sidepulse.cli import build_parser
+from sidepulse.hook import normalize_junie_payload
+from sidepulse.install import install_junie_hooks, uninstall_junie_hooks
+from sidepulse.models import AgentMode, AgentStatus
+from sidepulse.providers import JUNIE_MONITOR_EVENTS, detect_junie_config
+from sidepulse.session_actions import session_resume_command
+
+
+class JunieProviderTests(unittest.TestCase):
+ def test_installer_preserves_existing_config_and_hooks(self) -> None:
+ with tempfile.TemporaryDirectory() as tmp:
+ home = Path(tmp)
+ config = home / ".junie" / "config.json"
+ config.parent.mkdir(parents=True)
+ config.write_text(
+ json.dumps(
+ {
+ "model": "sonnet",
+ "hooks": {
+ "PreToolUse": [
+ {
+ "matcher": "Bash",
+ "hooks": [
+ {"type": "command", "command": "python guard.py"}
+ ],
+ }
+ ]
+ },
+ }
+ )
+ )
+ log = home / "state" / "junie.jsonl"
+
+ result = install_junie_hooks(
+ config_path=config,
+ log_path=log,
+ python_executable="python3",
+ )
+
+ self.assertTrue(result.changed)
+ data = json.loads(config.read_text())
+ self.assertEqual(data["model"], "sonnet")
+ self.assertEqual(set(data["hooks"]), set(JUNIE_MONITOR_EVENTS))
+ self.assertNotIn("PermissionRequest", data["hooks"])
+ pre_tool_commands = [
+ hook["command"]
+ for entry in data["hooks"]["PreToolUse"]
+ for hook in entry["hooks"]
+ ]
+ self.assertIn("python guard.py", pre_tool_commands)
+ self.assertTrue(any("--provider junie" in command for command in pre_tool_commands))
+ self.assertTrue(log.exists())
+
+ second = install_junie_hooks(
+ config_path=config,
+ log_path=log,
+ python_executable="python3",
+ )
+ self.assertFalse(second.changed)
+
+ detected = detect_junie_config(home)
+ self.assertTrue(detected.hooks_enabled)
+ self.assertEqual(detected.hook_events, tuple(sorted(JUNIE_MONITOR_EVENTS)))
+ self.assertEqual(detected.log_paths, (log,))
+
+ def test_uninstaller_removes_only_sidepulse_hooks(self) -> None:
+ with tempfile.TemporaryDirectory() as tmp:
+ root = Path(tmp)
+ config = root / "config.json"
+ log = root / "junie.jsonl"
+ config.write_text(
+ json.dumps(
+ {
+ "model": "gpt",
+ "hooks": {
+ "Stop": [
+ {
+ "hooks": [
+ {"type": "command", "command": "python notify.py"}
+ ]
+ }
+ ]
+ },
+ }
+ )
+ )
+ install_junie_hooks(config_path=config, log_path=log)
+
+ result = uninstall_junie_hooks(config_path=config, log_path=log)
+
+ self.assertTrue(result.changed)
+ data = json.loads(config.read_text())
+ self.assertEqual(data["model"], "gpt")
+ self.assertEqual(
+ data["hooks"]["Stop"],
+ [{"hooks": [{"type": "command", "command": "python notify.py"}]}],
+ )
+
+ def test_junie_events_map_to_sidepulse_states(self) -> None:
+ with tempfile.TemporaryDirectory() as tmp:
+ log = Path(tmp) / "junie.jsonl"
+ timestamp = datetime.now(timezone.utc).isoformat()
+ rows = [
+ {
+ "logged_at": timestamp,
+ "hook_event_name": "UserPromptSubmit",
+ "session_id": "junie-session",
+ "cwd": "/tmp/project",
+ "prompt": "fix the test",
+ },
+ {
+ "logged_at": timestamp,
+ "hook_event_name": "PreToolUse",
+ "tool_name": "Bash",
+ "tool_input": {"command": "pytest"},
+ },
+ {
+ "logged_at": timestamp,
+ "hook_event_name": "Stop",
+ "last_assistant_message": "Fixed the test.",
+ },
+ ]
+ normalized_rows = []
+ for row in rows:
+ normalized = normalize_junie_payload(row, log, process_id=123)
+ normalized_rows.append(normalized)
+ with log.open("a") as handle:
+ handle.write(json.dumps(normalized) + "\n")
+
+ self.assertEqual(normalized_rows[-1]["session_id"], "junie-session")
+ self.assertEqual(normalized_rows[-1]["cwd"], "/tmp/project")
+
+ snapshot = AgentMonitor(
+ sources=(SourceSpec("junie", log),),
+ stale_after_seconds=3600,
+ ).snapshot()
+
+ self.assertEqual(snapshot.aggregate.mode, AgentMode.COMPLETED)
+ self.assertEqual(snapshot.statuses[0].provider, "junie")
+ self.assertEqual(snapshot.statuses[0].session_id, "junie-session")
+ self.assertEqual(
+ snapshot.statuses[0].display_name,
+ "project: fix the test (junie-se)",
+ )
+
+ def test_cli_accepts_junie_and_custom_log_path(self) -> None:
+ args = build_parser().parse_args(
+ ["install", "junie", "--junie-log", "/tmp/custom-junie.jsonl"]
+ )
+
+ self.assertEqual(args.provider, "junie")
+ self.assertEqual(args.junie_log, Path("/tmp/custom-junie.jsonl"))
+
+ def test_session_can_resume_in_junie_cli(self) -> None:
+ status = AgentStatus(
+ provider="junie",
+ agent_id="junie:session:session-123",
+ display_name="Junie session",
+ mode=AgentMode.COMPLETED,
+ updated_at=datetime.now(timezone.utc),
+ event_name="Stop",
+ session_id="session-123",
+ cwd="/tmp/project path",
+ )
+
+ self.assertEqual(
+ session_resume_command(status),
+ "cd '/tmp/project path' && junie --session-id=session-123 --resume",
+ )
+
+
+if __name__ == "__main__":
+ unittest.main()
diff --git a/tests/test_sidepulse.py b/tests/test_sidepulse.py
index 3798891..ec12d33 100644
--- a/tests/test_sidepulse.py
+++ b/tests/test_sidepulse.py
@@ -915,7 +915,7 @@ class AgentMonitorTests(unittest.TestCase):
self.assertGreater(image.size().width, 38)
self.assertEqual(image.size().height, 18)
- def test_virtual_screen_bar_frame_covers_notch_plus_led_band(self) -> None:
+ def test_virtual_sidepulse_notch_frame_covers_notch_plus_led_band(self) -> None:
try:
from sidepulse import virtual_device
except (ImportError, SystemExit) as exc:
@@ -946,7 +946,7 @@ class AgentMonitorTests(unittest.TestCase):
((0.0, 0.0), (232.0, 5.0)),
)
- def test_virtual_screen_bar_on_notchless_display_is_led_band_only(self) -> None:
+ def test_virtual_sidepulse_notch_on_notchless_display_is_led_band_only(self) -> None:
try:
from sidepulse import virtual_device
except (ImportError, SystemExit) as exc:
@@ -974,7 +974,7 @@ class AgentMonitorTests(unittest.TestCase):
((850.0, 1075.0), (220.0, 5.0)),
)
- def test_virtual_screen_bar_redraws_at_60fps(self) -> None:
+ def test_virtual_sidepulse_notch_redraws_at_60fps(self) -> None:
try:
from sidepulse import virtual_device
except (ImportError, SystemExit) as exc:
@@ -1076,7 +1076,7 @@ class AgentMonitorTests(unittest.TestCase):
)
self.assertEqual(controller.step(1320), [black] * 8)
- def test_virtual_screen_bar_led_blend_spans_three_leds(self) -> None:
+ def test_virtual_sidepulse_notch_led_blend_spans_three_leds(self) -> None:
try:
from sidepulse import virtual_device
except (ImportError, SystemExit) as exc:
@@ -1638,7 +1638,7 @@ class AgentMonitorTests(unittest.TestCase):
self.assertEqual(by_title["Manual"].state(), 1)
- def test_status_bar_screen_bar_remove_lives_in_screen_bar_submenu(self) -> None:
+ def test_status_bar_sidepulse_notch_remove_lives_in_sidepulse_notch_submenu(self) -> None:
try:
from sidepulse import status_bar
except SystemExit as exc:
@@ -1646,7 +1646,7 @@ class AgentMonitorTests(unittest.TestCase):
device = status_bar.StatusBarDevice(
device_id=status_bar.VIRTUAL_DEVICE_ID,
- name="Screen Bar",
+ name=status_bar.VIRTUAL_DEVICE_NAME,
root=Path(status_bar.VIRTUAL_DEVICE_ID),
target=Path(status_bar.VIRTUAL_DEVICE_ID),
connected=True,
@@ -1664,17 +1664,18 @@ class AgentMonitorTests(unittest.TestCase):
)
menu = status_bar.build_menu(snapshot, status_bar.STATE_IDLE, target)
+ self.assertEqual(status_bar.VIRTUAL_DEVICE_NAME, "SidePulse Notch")
titles = [
menu.itemAtIndex_(index).title()
for index in range(menu.numberOfItems())
if menu.itemAtIndex_(index).title()
]
- screen_bar_item = next(
+ sidepulse_notch_item = next(
menu.itemAtIndex_(index)
for index in range(menu.numberOfItems())
- if menu.itemAtIndex_(index).title() == "Screen Bar"
+ if menu.itemAtIndex_(index).title() == "SidePulse Notch"
)
- submenu = screen_bar_item.submenu()
+ submenu = sidepulse_notch_item.submenu()
submenu_titles = [
submenu.itemAtIndex_(index).title()
for index in range(submenu.numberOfItems())
@@ -1686,8 +1687,8 @@ class AgentMonitorTests(unittest.TestCase):
if submenu.itemAtIndex_(index).view() is not None
)
- self.assertNotIn("Remove Screen Bar", titles)
- self.assertIn("Remove Screen Bar", submenu_titles)
+ self.assertNotIn("Remove SidePulse Notch", titles)
+ self.assertIn("Remove SidePulse Notch", submenu_titles)
self.assertNotIn("Brightness 100%", submenu_titles)
self.assertEqual(submenu_view_count, 0)
@@ -1700,7 +1701,7 @@ class AgentMonitorTests(unittest.TestCase):
if menu.itemAtIndex_(index).title()
]
- self.assertIn("Add Screen Bar", titles)
+ self.assertIn("Add SidePulse Notch", titles)
def test_status_bar_observe_connected_device_resets_on_new_mount(self) -> None:
try:
@@ -3864,6 +3865,13 @@ class AgentMonitorTests(unittest.TestCase):
changed=True,
backup_path=None,
)
+ junie_result = SimpleNamespace(
+ provider="junie",
+ config_path=Path("/tmp/junie-config.json"),
+ log_path=Path("/tmp/junie.jsonl"),
+ changed=True,
+ backup_path=None,
+ )
launch_result = SimpleNamespace(
plist_path=Path("/tmp/io.sidepulse.agentstatus.plist"),
changed=True,
@@ -3902,6 +3910,7 @@ class AgentMonitorTests(unittest.TestCase):
return_value=cursor_result,
) as cursor,
patch.object(cli_module, "install_grok_hooks", return_value=grok_result) as grok,
+ patch.object(cli_module, "install_junie_hooks", return_value=junie_result) as junie,
patch(
"sidepulse.sd_eject_guard_launch.install_sd_eject_guard",
return_value=guard_result,
@@ -3918,6 +3927,7 @@ class AgentMonitorTests(unittest.TestCase):
claude.assert_called_once()
cursor.assert_called_once()
grok.assert_called_once()
+ junie.assert_called_once()
guard.assert_called_once_with(scope="auto", dry_run=False)
launch.assert_called_once_with(start=True)
service.assert_called_once_with(start=True, dry_run=False)
@@ -5825,6 +5835,7 @@ class AgentMonitorTests(unittest.TestCase):
self.assertIn("codex", providers)
self.assertIn("claude", providers)
self.assertIn("grok", providers)
+ self.assertIn("junie", providers)
self.assertNotIn("codex-transcripts", providers)
self.assertNotIn("claude-transcripts", providers)
diff --git a/tests/test_status_bar_ui.py b/tests/test_status_bar_ui.py
index d2853a7..54a35ad 100644
--- a/tests/test_status_bar_ui.py
+++ b/tests/test_status_bar_ui.py
@@ -439,6 +439,24 @@ class WindowBuildTests(StatusBarTestCase):
self.assertIsNotNone(window)
self.assertTrue(window.title())
self.assertEqual(window.contentView().frame().size.height, 560)
+ self.assertIn("cursor_hook_status", self.controller.settings_fields)
+ aligned_fields = (
+ "codex_hook_status",
+ "claude_hook_status",
+ "grok_hook_status",
+ "cursor_hook_status",
+ "junie_hook_status",
+ "codex_session_opener",
+ "claude_session_opener",
+ "grok_session_opener",
+ )
+ self.assertEqual(
+ {
+ self.controller.settings_fields[name].frame().origin.x
+ for name in aligned_fields
+ },
+ {130.0},
+ )
self.assert_controls_are_wired(window)
def test_settings_window_resizes_for_compact_animations_tab(self):