@agentikos/omega-os 0.19.24 → 0.19.26

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.
@@ -188,7 +188,7 @@ from omega_engine.genesis import (
188
188
  )
189
189
  from omega_engine import plan as plan_v7
190
190
 
191
- __version__ = "0.19.24"
191
+ __version__ = "0.19.26"
192
192
 
193
193
  __all__ = [
194
194
  "__version__",
@@ -2798,145 +2798,254 @@ def _session_age(unix_ts: int) -> str:
2798
2798
 
2799
2799
 
2800
2800
  def cmd_menu(_args: argparse.Namespace) -> int:
2801
- """`omega` (no args) — open the OmegaOS session manager.
2802
-
2803
- v0.19.19 redesign per the user's spec: bare `omega` no longer
2804
- auto-attaches to AISB-chat. Instead it shows a fzf-driven menu:
2805
-
2806
- ┌─ Omega — Session Manager ──────────────────┐
2807
- > AISB-chat now │
2808
- │ Hermes-chat 5m ago │
2809
- │ Causio-oracle 2h ago │
2810
- ───────────────────────────────────────── │
2811
- + New Claude Code session (AISB master) │
2812
- + New Hermès session │
2813
- └────────────────────────────────────────────┘
2814
-
2815
- Pick a session attach. Pick "+ New …" → spawn + attach. Esc / q
2816
- exit cleanly.
2817
-
2818
- Direct shortcuts kept:
2819
- * `omega aisb` → straight to AISB-chat (no menu)
2820
- * `omega hermes` → straight to Hermes-chat (no menu)
2821
- * `omega menu` → legacy whiptail picker (advanced ops)
2801
+ """`omega` (no args) — attach to the persistent Omega master tmux session.
2802
+
2803
+ v0.19.25 redesign per the user's spec: bare `omega` should feel like
2804
+ typing `claude` (opens the Claude Code TUI) or `hermes` (opens
2805
+ Hermès). It should TAKE OVER your terminal as the OmegaOS home.
2806
+
2807
+ Mechanism (tmux-based, since OmegaOS is multi-session by design):
2808
+ 1. Ensure the `Omega` tmux session exists (spawn if missing).
2809
+ The session's window 0 runs `omega menu-tui` — the fzf-driven
2810
+ action picker.
2811
+ 2. `os.execvp("tmux attach -t Omega")` your terminal now IS
2812
+ the Omega session. Detach with Ctrl-b d, attach again with
2813
+ `omega`.
2814
+
2815
+ Inside the Omega session you have:
2816
+ * window 0 (menu) — the action picker
2817
+ * spawned on demand: AISB-chat, Hermes-chat, projects, scratch shells
2818
+ * Ctrl-b w — tmux's own window picker
2819
+ * Ctrl-b z tmux-claude session manager (if installed)
2820
+
2821
+ If you're already inside tmux (e.g. iTerm tmux integration), we
2822
+ don't take over the current session — we tell you how to switch
2823
+ to the Omega session manually.
2822
2824
  """
2823
2825
  import os
2824
2826
  import shutil
2825
- import subprocess
2826
2827
  from omega_engine import tmux
2827
2828
 
2828
- # If we're already inside a tmux session, instruct the user — we can't
2829
- # take over the current pane from a subprocess, but `omega aisb` /
2830
- # `omega hermes` from inside tmux still print switch-client instructions.
2831
- if os.environ.get("TMUX"):
2832
- print(" You're already inside tmux. Use Ctrl+b z (tmux-claude")
2833
- print(" session manager) or one of:")
2834
- print(" tmux switch-client -t AISB-chat")
2835
- print(" tmux switch-client -t Hermes-chat")
2836
- return 0
2829
+ OMEGA_SESSION = "Omega"
2837
2830
 
2838
2831
  if not shutil.which("tmux"):
2839
2832
  print(" tmux not installed — `brew install tmux` (macOS) or "
2840
2833
  "`apt-get install tmux` (Linux)")
2841
2834
  return 2
2842
2835
 
2843
- sessions = tmux.list_sessions(_omega_home())
2844
- sessions.sort(key=lambda s: -int(s.created))
2845
-
2846
- NEW_AISB = "__new_aisb__"
2847
- NEW_HERMES = "__new_hermes__"
2848
-
2849
- lines: list[tuple[str, str]] = [] # (display, action_key)
2850
- if sessions:
2851
- for s in sessions:
2852
- attach_mark = " *" if s.attached else " "
2853
- line = f"{attach_mark} {s.name:<32} {_session_age(s.created):<10} {s.category}"
2854
- lines.append((line, s.name))
2855
- lines.append(("──────────────────────────────────────────────",
2856
- "__separator__"))
2857
- lines.append((" + New Claude Code session (AISB master)", NEW_AISB))
2858
- lines.append((" + New Hermès session", NEW_HERMES))
2859
-
2860
- chosen_key: str | None = None
2861
- if shutil.which("fzf"):
2862
- # fzf path — prettiest UX. Header shows the title, separator line
2863
- # is non-selectable (we filter it after).
2864
- fzf_input = "\n".join(disp for disp, _ in lines)
2836
+ if os.environ.get("TMUX"):
2837
+ # We're already in a tmux session. Don't try to attach (tmux
2838
+ # refuses nested attach). Tell the user how to switch.
2839
+ if not tmux.is_alive(OMEGA_SESSION):
2840
+ tmux.spawn_omega_master(_omega_home())
2841
+ print(f" Omega session is running. Switch to it with:")
2842
+ print(f" tmux switch-client -t {OMEGA_SESSION}")
2843
+ print(f" Or use Ctrl-b s to pick from the session list,")
2844
+ print(f" or Ctrl-b z for the tmux-claude session manager.")
2845
+ return 0
2846
+
2847
+ if not tmux.is_alive(OMEGA_SESSION):
2848
+ tmux.spawn_omega_master(_omega_home())
2849
+
2850
+ try:
2851
+ os.execvp("tmux", ["tmux", "attach", "-t", OMEGA_SESSION])
2852
+ except FileNotFoundError:
2853
+ print(" tmux not on PATH")
2854
+ return 2
2855
+ return 0
2856
+
2857
+
2858
+ def cmd_menu_tui(_args: argparse.Namespace) -> int:
2859
+ """`omega menu-tui` — the fzf action picker for the Omega session.
2860
+
2861
+ v0.19.26 — actions now run INLINE in the menu pane (not in dead
2862
+ background tmux windows). After every action, "press Enter to
2863
+ return to menu". Sessions (AISB/Hermes) still spawn as separate
2864
+ tmux sessions because they're meant to be talked to long-running.
2865
+
2866
+ Bug fix: previous version used fzf with leading-space labels,
2867
+ then `pick.strip()` killed the spaces, so display matching failed
2868
+ and every pick became a no-op. Both sides stripped now.
2869
+ """
2870
+ import os
2871
+ import shlex
2872
+ import shutil
2873
+ import subprocess
2874
+ from omega_engine import tmux
2875
+ from omega_engine import __version__
2876
+
2877
+ HOME = _omega_home()
2878
+ OMEGA_BIN = str(HOME / "Agentik_Tools" / "bin" / "omega")
2879
+
2880
+ if not shutil.which("fzf"):
2881
+ print(" fzf not installed — install with `brew install fzf` "
2882
+ "(macOS) or `apt install fzf` (Linux)")
2883
+ return 2
2884
+
2885
+ def _build_menu() -> list[tuple[str, str]]:
2886
+ active = _active_provider()
2887
+ sessions = tmux.list_sessions(HOME)
2888
+ return [
2889
+ ("── CHAT ─────────────────────", "__sep__"),
2890
+ (f"AISB master chat (Claude Max OAuth)", "open:aisb"),
2891
+ (f"Hermès meta-companion (Anthropic API)", "open:hermes"),
2892
+ (f"Switch LLM provider [{active}]", "switch:provider"),
2893
+ ("── PROJECTS ─────────────────", "__sep__"),
2894
+ (f"New project (Genesis pipeline)", "genesis:new"),
2895
+ (f"Open project shell", "project:open"),
2896
+ ("── AUDITS & MISSIONS ────────", "__sep__"),
2897
+ (f"Run a mission", "run:mission"),
2898
+ (f"Quality Arsenal — list audits", "audit:menu"),
2899
+ ("── INFRASTRUCTURE ───────────", "__sep__"),
2900
+ (f"Sessions ({len(sessions)} active) — pick to attach", "sessions:list"),
2901
+ (f"Accounts — Claude Max + per-provider auth", "accounts:menu"),
2902
+ (f"Vault — secrets", "vault:menu"),
2903
+ ("── HEALTH ───────────────────", "__sep__"),
2904
+ (f"omega doctor", "cmd:doctor"),
2905
+ (f"omega status", "cmd:status"),
2906
+ ("── SCRAPE & SEARCH ──────────", "__sep__"),
2907
+ (f"Stealth scrape a URL (CloakBrowser)", "scrape:cloak"),
2908
+ (f"Fast scrape a URL (Scrapling)", "scrape:scrapling"),
2909
+ ("── EXIT ─────────────────────", "__sep__"),
2910
+ (f"Detach (Ctrl-b d also works)", "detach"),
2911
+ (f"Quit Omega session (kills the tmux session)", "quit:kill"),
2912
+ ]
2913
+
2914
+ def _run_inline(cmd_argv: list[str] | str, *, shell: bool = False) -> None:
2915
+ """Run a command in the current pane, stream stdout/stderr,
2916
+ then prompt the user to return to the menu."""
2917
+ os.system("clear")
2918
+ print(f" Ω › running: {cmd_argv if shell else ' '.join(cmd_argv)}")
2919
+ print(" " + "─" * 60)
2920
+ if shell:
2921
+ subprocess.run(cmd_argv, shell=True)
2922
+ else:
2923
+ subprocess.run(cmd_argv)
2924
+ print()
2925
+ print(" " + "─" * 60)
2926
+ try:
2927
+ input(" press Enter to return to Omega menu… ")
2928
+ except (EOFError, KeyboardInterrupt):
2929
+ pass
2930
+
2931
+ def _prompt(label: str) -> str:
2932
+ try:
2933
+ return input(f" {label}: ").strip()
2934
+ except (EOFError, KeyboardInterrupt):
2935
+ return ""
2936
+
2937
+ while True:
2938
+ items = _build_menu()
2939
+ lines = [label for label, _ in items]
2940
+ fzf_input = "\n".join(lines)
2865
2941
  try:
2866
2942
  proc = subprocess.run(
2867
2943
  ["fzf",
2868
- "--prompt=omega › ",
2869
- "--header=Omega Session Manager — Enter to attach, Esc to quit",
2944
+ "--prompt › ",
2945
+ "--header=Omega — Enter to pick, Esc to refresh, "
2946
+ "Ctrl-c to exit",
2870
2947
  "--layout=reverse",
2871
- "--height=70%",
2872
- "--border",
2873
- "--no-multi"],
2948
+ "--height=100%",
2949
+ "--border=rounded",
2950
+ "--no-multi",
2951
+ "--info=inline",
2952
+ "--ansi"],
2874
2953
  input=fzf_input, capture_output=True, text=True,
2875
2954
  )
2876
- if proc.returncode == 0:
2877
- pick = proc.stdout.strip()
2878
- for disp, key in lines:
2879
- if disp == pick and key != "__separator__":
2880
- chosen_key = key
2881
- break
2882
- except Exception as exc: # noqa: BLE001
2883
- print(f" fzf failed: {exc}")
2884
- return 2
2885
- else:
2886
- # Plain stdin fallback — numbered list.
2887
- print()
2888
- print(" Omega Session Manager")
2889
- for i, (disp, _) in enumerate(lines, 1):
2890
- print(f" {i:2}) {disp}")
2891
- print()
2892
- try:
2893
- raw = input(" pick a number (Enter to quit): ").strip()
2894
- except (EOFError, KeyboardInterrupt):
2955
+ except KeyboardInterrupt:
2895
2956
  return 0
2896
- if not raw:
2957
+ if proc.returncode != 0:
2958
+ # Esc → refresh.
2959
+ continue
2960
+ # FIX (v0.19.26): match label EXACTLY, no strip — fzf returns the
2961
+ # full line including any chars we put in. Just trim trailing \n.
2962
+ pick = proc.stdout.rstrip("\n")
2963
+ action = None
2964
+ for label, key in items:
2965
+ if label == pick and key != "__sep__":
2966
+ action = key
2967
+ break
2968
+ if action is None:
2969
+ continue
2970
+
2971
+ # === Dispatch ===
2972
+ if action == "detach":
2973
+ subprocess.run(["tmux", "detach-client"])
2897
2974
  return 0
2898
- try:
2899
- n = int(raw)
2900
- except ValueError:
2901
- print(f" not a number: {raw!r}")
2975
+ if action == "quit:kill":
2976
+ subprocess.run(["tmux", "kill-session", "-t", "Omega"])
2902
2977
  return 0
2903
- if 1 <= n <= len(lines):
2904
- chosen_key = lines[n - 1][1]
2905
- if chosen_key == "__separator__":
2906
- chosen_key = None
2907
2978
 
2908
- if chosen_key is None:
2909
- return 0
2910
- if chosen_key == NEW_AISB:
2911
- # "+ New AISB" means the user wants a FRESH session — kill
2912
- # the existing AISB-chat first so we don't attach to a dead
2913
- # one (claude died, OAuth missing, etc.).
2914
- return _attach_or_spawn_chat(
2915
- "AISB-chat",
2916
- spawn_fn=lambda h: tmux.spawn_aisb_chat(h, force_replace=True),
2917
- label="AISB master (Claude Code on Max OAuth)",
2918
- )
2919
- if chosen_key == NEW_HERMES:
2920
- return _attach_or_spawn_chat(
2921
- "Hermes-chat",
2922
- spawn_fn=lambda h: tmux.spawn_hermes_chat(h, force_replace=True),
2923
- label="Hermès (Claude Code on Anthropic API)",
2924
- )
2925
- # Otherwise it's an existing session name — just attach.
2926
- print(f" attaching to {chosen_key}…")
2927
- try:
2928
- os.execvp("tmux", ["tmux", "attach", "-t", chosen_key])
2929
- except FileNotFoundError:
2930
- print(" tmux not on PATH")
2931
- return 2
2932
- return 0
2979
+ # Chat sessions — switch tmux client to the chat session.
2980
+ if action == "open:aisb":
2981
+ tmux.spawn_aisb_chat(HOME, force_replace=False)
2982
+ subprocess.run(["tmux", "switch-client", "-t", "AISB-chat"])
2983
+ continue
2984
+ if action == "open:hermes":
2985
+ tmux.spawn_hermes_chat(HOME, force_replace=False)
2986
+ subprocess.run(["tmux", "switch-client", "-t", "Hermes-chat"])
2987
+ continue
2988
+
2989
+ # Inline actions — run in the menu pane, prompt to return.
2990
+ if action == "switch:provider":
2991
+ _run_inline([OMEGA_BIN, "switch"])
2992
+ continue
2993
+ if action == "genesis:new":
2994
+ slug = _prompt("project slug (alphanumeric, _-)")
2995
+ if slug:
2996
+ _run_inline([OMEGA_BIN, "genesis", "new", slug])
2997
+ continue
2998
+ if action == "project:open":
2999
+ _run_inline("ls -la ~/Omega/Agentik_Coding/projects/ 2>/dev/null "
3000
+ "&& echo && echo '(cd into one to start working)'",
3001
+ shell=True)
3002
+ continue
3003
+ if action == "run:mission":
3004
+ intent = _prompt("mission intent (free-form)")
3005
+ if intent:
3006
+ _run_inline([OMEGA_BIN, "run", intent])
3007
+ continue
3008
+ if action == "audit:menu":
3009
+ _run_inline(
3010
+ "echo 'Quality Arsenal — 17 forensic audits:' && "
3011
+ "echo ' /codeaudit /uiuxaudit /flowaudit /debugaudit' && "
3012
+ "echo ' /featureaudit /perfaudit /secaudit /a11yaudit' && "
3013
+ "echo ' /seoaudit /dataaudit /apiaudit /copyaudit' && "
3014
+ "echo ' /dxaudit /motionaudit /automationaudit' && "
3015
+ "echo ' /logicaudit /retentionaudit /refontaudit' && "
3016
+ "echo && echo 'invoke from any claude session, or:' && "
3017
+ f"echo ' {OMEGA_BIN} audit <id>'",
3018
+ shell=True)
3019
+ continue
3020
+ if action == "sessions:list":
3021
+ _run_inline("tmux ls", shell=True)
3022
+ continue
3023
+ if action == "accounts:menu":
3024
+ _run_inline([OMEGA_BIN, "account", "list"])
3025
+ continue
3026
+ if action == "vault:menu":
3027
+ _run_inline([OMEGA_BIN, "vault", "status"])
3028
+ continue
3029
+ if action == "cmd:doctor":
3030
+ _run_inline([OMEGA_BIN, "doctor"])
3031
+ continue
3032
+ if action == "cmd:status":
3033
+ _run_inline([OMEGA_BIN, "status"])
3034
+ continue
3035
+ if action == "scrape:cloak":
3036
+ url = _prompt("URL")
3037
+ if url:
3038
+ _run_inline([OMEGA_BIN, "scrape", url])
3039
+ continue
3040
+ if action == "scrape:scrapling":
3041
+ url = _prompt("URL")
3042
+ if url:
3043
+ _run_inline([OMEGA_BIN, "scrape", url, "--engine", "scrapling"])
3044
+ continue
2933
3045
 
2934
3046
 
2935
3047
  def cmd_menu_whiptail(_args: argparse.Namespace) -> int:
2936
- """`omega menu` — the explicit whiptail picker.
2937
-
2938
- The old bare-omega behaviour, moved behind an explicit subcommand
2939
- because the default is now the AISB chat (v0.19.15)."""
3048
+ """`omega menu` — the explicit whiptail picker (legacy)."""
2940
3049
  from omega_engine.menu import run_menu
2941
3050
  return run_menu()
2942
3051
 
@@ -4221,8 +4330,12 @@ def _build_parser() -> argparse.ArgumentParser:
4221
4330
  parser.set_defaults(fn=cmd_menu)
4222
4331
  sub = parser.add_subparsers(dest="cmd")
4223
4332
  sub.add_parser("menu",
4224
- help="open the interactive whiptail menu (the old `omega` behaviour)"
4333
+ help="open the interactive whiptail menu (legacy)"
4225
4334
  ).set_defaults(fn=cmd_menu_whiptail)
4335
+ sub.add_parser("menu-tui",
4336
+ help="the fzf action picker that runs INSIDE the Omega tmux "
4337
+ "session (don't call directly — bare `omega` lands you here)"
4338
+ ).set_defaults(fn=cmd_menu_tui)
4226
4339
  sub.add_parser("version", help="print the engine version").set_defaults(fn=cmd_version)
4227
4340
 
4228
4341
  # `omega switch <provider>` — hot-swap the LLM CLI used for new chats.
@@ -353,6 +353,41 @@ def spawn_aisb_chat(omega_home: str | Path | None = None,
353
353
  )
354
354
 
355
355
 
356
+ def spawn_omega_master(omega_home: str | Path | None = None) -> str:
357
+ """Spawn the master Omega tmux session — your persistent home.
358
+
359
+ v0.19.25 redesign: when you type `omega`, you ENTER this session.
360
+ Like `claude` opens the Claude Code TUI in your terminal, `omega`
361
+ attaches to a persistent tmux session called `Omega` which acts as
362
+ your OS-level dashboard. Inside, window 0 runs the Omega menu TUI
363
+ (`omega menu-tui` — the fzf-driven action picker). Other windows
364
+ open on demand:
365
+ - window 1: AISB-chat (spawned when user picks it)
366
+ - window 2: Hermes-chat
367
+ - window 3+: per-project oracles / workers / shells
368
+
369
+ Survives across terminal restarts. `tmux kill-server` is the only
370
+ way to nuke it.
371
+ """
372
+ name = "Omega"
373
+ home = Path(omega_home or os.environ.get("OMEGA_HOME")
374
+ or Path.home() / "Omega")
375
+ if is_alive(name):
376
+ return name
377
+ omega_bin = home / "Agentik_Tools" / "bin" / "omega"
378
+ # Window 0 = menu TUI. We launch the user's shell first then send
379
+ # the menu command — so if the TUI exits, the shell stays alive
380
+ # and the user can manually `omega menu-tui` again or run anything
381
+ # else. Same shell-stays-alive pattern as spawn_aisb_chat.
382
+ rc, _ = _tmux("new-session", "-d", "-s", name,
383
+ "-n", "menu", "-c", str(Path.home()))
384
+ if rc != 0:
385
+ return name
386
+ _tmux("send-keys", "-t", f"{name}:menu",
387
+ f"{omega_bin} menu-tui", "Enter")
388
+ return name
389
+
390
+
356
391
  def spawn_hermes_chat(omega_home: str | Path | None = None,
357
392
  force_replace: bool = False) -> str:
358
393
  """Spawn the Hermès chat tmux session — REAL Claude Code TUI, but on
@@ -1,6 +1,6 @@
1
1
  [project]
2
2
  name = "omega-engine"
3
- version = "0.19.24"
3
+ version = "0.19.26"
4
4
  description = "The Omega OS orchestration engine — event-sourced, verified-completion agent graphs."
5
5
  readme = "README.md"
6
6
  requires-python = ">=3.11"
@@ -1 +1 @@
1
- 0.19.24
1
+ 0.19.26
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@agentikos/omega-os",
3
- "version": "0.19.24",
3
+ "version": "0.19.26",
4
4
  "description": "Omega OS — installable agentic operating system with verified-completion orchestration. Event-sourced engine, 8-block rack, autonomous agents, MCP.",
5
5
  "bin": {
6
6
  "omega-os": "bin/omega-os.js"