mixhub-cli 0.1.0__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.
@@ -0,0 +1,18 @@
1
+ # Runtime & user session state (never committed)
2
+ data/
3
+ screenshots/
4
+ *.log
5
+ .hub.pid
6
+ .hub.lock
7
+ hub_state.json
8
+ ACCEPTANCE.md
9
+
10
+ # Python & OS caches
11
+ __pycache__/
12
+ *.py[cod]
13
+ *$py.class
14
+ .pytest_cache/
15
+ dist/
16
+ build/
17
+ *.egg-info/
18
+ .DS_Store
@@ -0,0 +1,98 @@
1
+ Metadata-Version: 2.5
2
+ Name: mixhub-cli
3
+ Version: 0.1.0
4
+ Summary: MixHub: Cross-agent coding session multiplexer, lossless 10-section handoff engine, SSoT rules compiler, and universal mobile control bus for Claude Code, Gemini, and OpenAI Codex.
5
+ Project-URL: Homepage, https://github.com/ShinoKana/mixhub
6
+ Project-URL: Repository, https://github.com/ShinoKana/mixhub.git
7
+ Author: Kana
8
+ License: MIT
9
+ Keywords: ai-agents,claude-code,codex,gemini,handoff,multiplexer,tmux
10
+ Classifier: Development Status :: 4 - Beta
11
+ Classifier: Environment :: Console
12
+ Classifier: Environment :: Web Environment
13
+ Classifier: Intended Audience :: Developers
14
+ Classifier: License :: OSI Approved :: MIT License
15
+ Classifier: Operating System :: MacOS
16
+ Classifier: Operating System :: Microsoft :: Windows
17
+ Classifier: Operating System :: POSIX :: Linux
18
+ Classifier: Programming Language :: Python :: 3
19
+ Classifier: Programming Language :: Python :: 3.10
20
+ Classifier: Programming Language :: Python :: 3.11
21
+ Classifier: Programming Language :: Python :: 3.12
22
+ Classifier: Programming Language :: Python :: 3.13
23
+ Requires-Python: >=3.10
24
+ Description-Content-Type: text/markdown
25
+
26
+ # MixHub (Agent Session Hub)
27
+
28
+ > *"Runners change. The task runs on. — High-ROI daily workhorses meet top-tier masterminds, with lossless cross-agent handoff and universal mobile control."*
29
+
30
+ A zero-dependency cross-agent workspace, lossless handoff engine, SSoT rules compiler, and universal mobile control bus (`tmux` + `curses` + local HTTP/Web UI) for **Claude Code**, **Google Gemini (`agy`)**, **OpenAI Codex**, and **DeepSeek**.
31
+
32
+ ## Key Features
33
+
34
+ - **Dual-Pane In-Place Live Workspace (`mixhub` / `hub` / `hub workspace`)**
35
+ - **Left 32-Column Sidebar**: Displays all live and archived sessions with brand-colored state dots (`★` pinned, `●` live, `·` dormant; `●●` dual brand dots for cross-agent relay sessions) and draggable split border (`⋮`).
36
+ - **Right 80% Dynamic Pane (`tmux -L hubpool`)**:
37
+ - **Dormant sessions** open instantaneously in a zero-RAM archive reader (`--reader`) with sticky prompt headers, `[` / `]` user-turn jumping, and a right-edge turn minimap rail.
38
+ - **Pressing `Enter` or `→`** automatically releases any idle external session lock and attaches the live interactive CLI in-place inside the right pane.
39
+ - **Cross-Agent 10-Section + `handoff.yaml` Directional Handoff & Write Fence (`hub handoff <id> --to claude|agy|codex|deepseek [--mode auto|escalate|delegate|review]`)**
40
+ - Enforces a SQLite WAL `QUIESCING -> SOURCE_FENCED` write-lease fence (`tasks`, `handoff_bundles`, `write_leases`) with `workspace_epoch` tracking before starting a new writer.
41
+ - Deterministically extracts both a structured `data/handoffs/<id>.yaml` contract (`task`, `status`, `mode`, `repository`, `verified`, `unverified`, `failed_attempts`) and a `<2000 tokens` 10-section Handoff Bundle (`data/handoffs/<id>.md`).
42
+ - **3-Mode Directional Filtering**:
43
+ - `escalate` (Weak/Daily -> Strong Mastermind): strips predecessor subjective narrative (`de_anchored: true`) to prevent anchoring on flawed paths.
44
+ - `delegate` (Mastermind -> Workhorse / Quota Relay): preserves `decisions_rationale`, `rejected_approaches`, `interface_contracts`, and `acceptance_criteria`.
45
+ - `review` (Cross-Vendor Blind Review): strips developer self-justification (`blind_review: true`, `status: ready_for_review`) to prevent correlated blindness.
46
+ - Native `--provider deepseek` support via `codex --no-daemon -c model_provider="deepseek"`.
47
+ - **`AGENTS.md` Single Source of Truth Bidirectional Compiler (`hub sync-rules [dir]`)**
48
+ - Compiles project root `AGENTS.md` into `CLAUDE.md` (with `@AGENTS.md` + managed block) and `.gemini/GEMINI.md` (`<!-- BEGIN HUB SYNC -->...<!-- END HUB SYNC -->`) with `--dry-run` unified diff preview, SHA-256 tamper detection, and `hub-policy` digest approval guard.
49
+ - **Agent-Agnostic Two-Way Bridge & Task-Level Topic Continuity (`hub notify`)**
50
+ - **Inbound (`send_to_session` / `handle_inbound_message`)**: Routes messages and local multimodal image paths from Telegram Topics / Discord Threads / Slack `thread_ts` (`/bind <id>`, `/use claude|codex|agy`) to controlled `tmux` panes (`tmux send-keys`) or headless session resume (`claude --resume <id> -p`, `codex exec resume <id>`).
51
+ - **Outbound (`poll_outbound_replies`)**: Monitors bound `.jsonl` transcripts (`claude`, `codex`, `agy`) with SQLite watermarks; replies exceeding 80 lines are automatically saved as `.md` files and dispatched as document attachments (`--file`).
52
+ - **Cross-Agent Topic Continuity**: Topic / Thread bindings attach to the task (`task_id`); when handing off across agents (`claude -> codex -> agy`), the new session automatically inherits the bound Telegram Topic / Slack `thread_ts` / Discord `thread_id` without dropping the conversation thread.
53
+ - **100% ToS-Compliant Two-Tier Remote Architecture**
54
+ - **Zero OAuth Token Extraction**: MixHub never reads, extracts, or proxies any third-party cloud OAuth token or subscription credential.
55
+ - **Tier 1 (First-Party Native Remote Apps)**: Prioritizes Anthropic's official `claude --resume <id> --remote-control` (Claude iOS App / `claude.ai/code`) and OpenAI's official `ChatGPT.app` / ChatGPT Mobile App (`hub codex-release-lock <id>`).
56
+ - **Tier 2 (Official Hooks & Local Personal Bridge)**: Integrates via Claude Code's documented `Stop` / `Notification` hooks (`~/.claude/settings.json`) and Codex's `notify` hook (`~/.codex/config.toml`), with optional strict notify-only guard (`enable_local_pty_input=False`).
57
+ - **Fable 5.1 Modular Protocols & Health Check (`protocols.py` / `hub doctor`)**
58
+ - Defines the 4 narrow-waist `@runtime_checkable` protocols (`Provider`, `Channel`, `Quirk`, `Theme`) with `safe()` fault isolation (3 consecutive plugin failures auto-degrade without crashing the kernel) and 90-day `sunset` / `evaporate_when` Quirk audits.
59
+ - **Hybrid-Brain Cost & ROI Report Calculator (`cost_report.py` / `hub report`)**
60
+ - Quantifies token and USD savings across local sessions using authoritative binary pricing tiers (`Claude Fable 5.1`, `Claude Opus 5.5`, `Gemini 4 Argon`, `GPT-6 Astra`, `GPT-6.1 Sol`, `DeepSeek V4 Pro`), cumulative multi-turn context growth, and 5-minute active Cache TTL window refreshes (`$5.00/1M` on Opus 5.5).
61
+ - **Practical 85/15 Hybrid Sizing Guidance**: By routing `85%` of high-frequency file reading, iteration, and test execution to daily workhorses (`Argon`, `Sol`, `DeepSeek`) and invoking top-tier masterminds (`Opus 5.5`, `Fable 5.1`, `Astra`) for the `15%` critical architecture and blind-review checkpoints via `<2k` `handoff.yaml` bundles, high-intensity developers typically require only **`~$15–$30/month`** in top-tier API quota (or a base tier subscription) for full-month coverage.
62
+ - Includes a restrained Claude Code-style 5-second ephemeral toast (`✦ Handoff 84.2k → 1.2k ctx (-83.0k tokens · ~$2.40 saved) · How was this handoff? [1] Great [2] Fine [3] Dismiss`) and a reproducible 60-turn A/B benchmark (`tests/test_handoff_ab.py`).
63
+ - **5 Unified Semantic Channel Primitives Across Telegram, Discord, Slack & Feishu/Lark (`channels.py`)**
64
+ - Exposes 5 cohesive cross-platform methods (`thinking`, `progress`, `brief`, `ask`, `handoff_notice`) + first-class `typing_context` breathing indicator (`sendChatAction("typing")` / `assistant.threads.setStatus`), `<blockquote expandable>` / CardKit 2.0 `collapsible_panel` collapsible blocks, `copy_text` one-tap clipboard buttons, OpenAI Opus voice notes (`sendVoice`), and Slack Canvas sync.
65
+ - **Official Brand Vector SVGs & PUA Font Generator (`hub install-icons`)**
66
+ - Web UI (`http://127.0.0.1:8765`) renders authentic vector SVGs for Anthropic Claude, Google Gemini, and OpenAI Codex with stacked avatar badges for cross-agent relays and local time-of-day greetings.
67
+ - `hub install-icons` generates `~/Library/Fonts/HubIcons.ttf` (`\uE900-\uE902`) when `fontTools` is available and gracefully falls back to brand-colored `●`.
68
+
69
+ ## Quick Start
70
+
71
+ ```bash
72
+ ln -sf ~/.gemini/session-hub/bin/hub ~/.local/bin/hub
73
+ ln -sf ~/.gemini/session-hub/bin/mixhub ~/.local/bin/mixhub
74
+ ```
75
+
76
+ ### Commands
77
+
78
+ | Command | Description |
79
+ | :--- | :--- |
80
+ | `mixhub` / `hub` / `hub workspace` | Open the dual-pane in-place workspace (32-col left sidebar + right live/reader pane) |
81
+ | `hub tui` | Open the single-window TUI browser |
82
+ | `hub handoff <id> --to <agent>` | Fence source session and generate 10-section `<2000 tok` handoff bundle (`claude\|agy\|codex\|deepseek`) |
83
+ | `hub sync-rules [dir] [--dry-run]` | Synchronize `AGENTS.md` (SSoT) with `CLAUDE.md` and `.gemini/GEMINI.md` |
84
+ | `hub notify [options] <message>` | Send plain-text notifications / mobile cards to Telegram, Discord, or Slack |
85
+ | `hub codex-release-lock <id>` | Release terminal Codex writer lock for instant `ChatGPT.app` / mobile takeover |
86
+ | `hub mobile-handoff <id>` | Switch session to `NATIVE_EXTERNAL` mobile control mode |
87
+ | `hub install-icons` | Generate `HubIcons.ttf` PUA vector font (`\uE900-\uE902`) or verify `●` fallback |
88
+ | `hub doctor [--json]` | Run Fable 5.1 modular health check across Providers, Channels, Locks, and Quirks |
89
+ | `hub report [--format terminal\|mobile\|markdown\|json]` | Calculate High-Low Brain Hybrid token & USD savings report |
90
+ | `hub anchor [id]` | Generate zero-token Markdown fact anchors from raw JSONL transcripts |
91
+ | `hub slim [--dry-run]` | Strip historical base64 screenshots (>7d) and expired subagent logs (>1d) |
92
+ | `hub web` | Open the local MixHub web workspace (`http://127.0.0.1:8765`) |
93
+
94
+ ## Running Tests
95
+
96
+ ```bash
97
+ python3 -m unittest discover -s tests -v
98
+ ```
@@ -0,0 +1,73 @@
1
+ # MixHub (Agent Session Hub)
2
+
3
+ > *"Runners change. The task runs on. — High-ROI daily workhorses meet top-tier masterminds, with lossless cross-agent handoff and universal mobile control."*
4
+
5
+ A zero-dependency cross-agent workspace, lossless handoff engine, SSoT rules compiler, and universal mobile control bus (`tmux` + `curses` + local HTTP/Web UI) for **Claude Code**, **Google Gemini (`agy`)**, **OpenAI Codex**, and **DeepSeek**.
6
+
7
+ ## Key Features
8
+
9
+ - **Dual-Pane In-Place Live Workspace (`mixhub` / `hub` / `hub workspace`)**
10
+ - **Left 32-Column Sidebar**: Displays all live and archived sessions with brand-colored state dots (`★` pinned, `●` live, `·` dormant; `●●` dual brand dots for cross-agent relay sessions) and draggable split border (`⋮`).
11
+ - **Right 80% Dynamic Pane (`tmux -L hubpool`)**:
12
+ - **Dormant sessions** open instantaneously in a zero-RAM archive reader (`--reader`) with sticky prompt headers, `[` / `]` user-turn jumping, and a right-edge turn minimap rail.
13
+ - **Pressing `Enter` or `→`** automatically releases any idle external session lock and attaches the live interactive CLI in-place inside the right pane.
14
+ - **Cross-Agent 10-Section + `handoff.yaml` Directional Handoff & Write Fence (`hub handoff <id> --to claude|agy|codex|deepseek [--mode auto|escalate|delegate|review]`)**
15
+ - Enforces a SQLite WAL `QUIESCING -> SOURCE_FENCED` write-lease fence (`tasks`, `handoff_bundles`, `write_leases`) with `workspace_epoch` tracking before starting a new writer.
16
+ - Deterministically extracts both a structured `data/handoffs/<id>.yaml` contract (`task`, `status`, `mode`, `repository`, `verified`, `unverified`, `failed_attempts`) and a `<2000 tokens` 10-section Handoff Bundle (`data/handoffs/<id>.md`).
17
+ - **3-Mode Directional Filtering**:
18
+ - `escalate` (Weak/Daily -> Strong Mastermind): strips predecessor subjective narrative (`de_anchored: true`) to prevent anchoring on flawed paths.
19
+ - `delegate` (Mastermind -> Workhorse / Quota Relay): preserves `decisions_rationale`, `rejected_approaches`, `interface_contracts`, and `acceptance_criteria`.
20
+ - `review` (Cross-Vendor Blind Review): strips developer self-justification (`blind_review: true`, `status: ready_for_review`) to prevent correlated blindness.
21
+ - Native `--provider deepseek` support via `codex --no-daemon -c model_provider="deepseek"`.
22
+ - **`AGENTS.md` Single Source of Truth Bidirectional Compiler (`hub sync-rules [dir]`)**
23
+ - Compiles project root `AGENTS.md` into `CLAUDE.md` (with `@AGENTS.md` + managed block) and `.gemini/GEMINI.md` (`<!-- BEGIN HUB SYNC -->...<!-- END HUB SYNC -->`) with `--dry-run` unified diff preview, SHA-256 tamper detection, and `hub-policy` digest approval guard.
24
+ - **Agent-Agnostic Two-Way Bridge & Task-Level Topic Continuity (`hub notify`)**
25
+ - **Inbound (`send_to_session` / `handle_inbound_message`)**: Routes messages and local multimodal image paths from Telegram Topics / Discord Threads / Slack `thread_ts` (`/bind <id>`, `/use claude|codex|agy`) to controlled `tmux` panes (`tmux send-keys`) or headless session resume (`claude --resume <id> -p`, `codex exec resume <id>`).
26
+ - **Outbound (`poll_outbound_replies`)**: Monitors bound `.jsonl` transcripts (`claude`, `codex`, `agy`) with SQLite watermarks; replies exceeding 80 lines are automatically saved as `.md` files and dispatched as document attachments (`--file`).
27
+ - **Cross-Agent Topic Continuity**: Topic / Thread bindings attach to the task (`task_id`); when handing off across agents (`claude -> codex -> agy`), the new session automatically inherits the bound Telegram Topic / Slack `thread_ts` / Discord `thread_id` without dropping the conversation thread.
28
+ - **100% ToS-Compliant Two-Tier Remote Architecture**
29
+ - **Zero OAuth Token Extraction**: MixHub never reads, extracts, or proxies any third-party cloud OAuth token or subscription credential.
30
+ - **Tier 1 (First-Party Native Remote Apps)**: Prioritizes Anthropic's official `claude --resume <id> --remote-control` (Claude iOS App / `claude.ai/code`) and OpenAI's official `ChatGPT.app` / ChatGPT Mobile App (`hub codex-release-lock <id>`).
31
+ - **Tier 2 (Official Hooks & Local Personal Bridge)**: Integrates via Claude Code's documented `Stop` / `Notification` hooks (`~/.claude/settings.json`) and Codex's `notify` hook (`~/.codex/config.toml`), with optional strict notify-only guard (`enable_local_pty_input=False`).
32
+ - **Fable 5.1 Modular Protocols & Health Check (`protocols.py` / `hub doctor`)**
33
+ - Defines the 4 narrow-waist `@runtime_checkable` protocols (`Provider`, `Channel`, `Quirk`, `Theme`) with `safe()` fault isolation (3 consecutive plugin failures auto-degrade without crashing the kernel) and 90-day `sunset` / `evaporate_when` Quirk audits.
34
+ - **Hybrid-Brain Cost & ROI Report Calculator (`cost_report.py` / `hub report`)**
35
+ - Quantifies token and USD savings across local sessions using authoritative binary pricing tiers (`Claude Fable 5.1`, `Claude Opus 5.5`, `Gemini 4 Argon`, `GPT-6 Astra`, `GPT-6.1 Sol`, `DeepSeek V4 Pro`), cumulative multi-turn context growth, and 5-minute active Cache TTL window refreshes (`$5.00/1M` on Opus 5.5).
36
+ - **Practical 85/15 Hybrid Sizing Guidance**: By routing `85%` of high-frequency file reading, iteration, and test execution to daily workhorses (`Argon`, `Sol`, `DeepSeek`) and invoking top-tier masterminds (`Opus 5.5`, `Fable 5.1`, `Astra`) for the `15%` critical architecture and blind-review checkpoints via `<2k` `handoff.yaml` bundles, high-intensity developers typically require only **`~$15–$30/month`** in top-tier API quota (or a base tier subscription) for full-month coverage.
37
+ - Includes a restrained Claude Code-style 5-second ephemeral toast (`✦ Handoff 84.2k → 1.2k ctx (-83.0k tokens · ~$2.40 saved) · How was this handoff? [1] Great [2] Fine [3] Dismiss`) and a reproducible 60-turn A/B benchmark (`tests/test_handoff_ab.py`).
38
+ - **5 Unified Semantic Channel Primitives Across Telegram, Discord, Slack & Feishu/Lark (`channels.py`)**
39
+ - Exposes 5 cohesive cross-platform methods (`thinking`, `progress`, `brief`, `ask`, `handoff_notice`) + first-class `typing_context` breathing indicator (`sendChatAction("typing")` / `assistant.threads.setStatus`), `<blockquote expandable>` / CardKit 2.0 `collapsible_panel` collapsible blocks, `copy_text` one-tap clipboard buttons, OpenAI Opus voice notes (`sendVoice`), and Slack Canvas sync.
40
+ - **Official Brand Vector SVGs & PUA Font Generator (`hub install-icons`)**
41
+ - Web UI (`http://127.0.0.1:8765`) renders authentic vector SVGs for Anthropic Claude, Google Gemini, and OpenAI Codex with stacked avatar badges for cross-agent relays and local time-of-day greetings.
42
+ - `hub install-icons` generates `~/Library/Fonts/HubIcons.ttf` (`\uE900-\uE902`) when `fontTools` is available and gracefully falls back to brand-colored `●`.
43
+
44
+ ## Quick Start
45
+
46
+ ```bash
47
+ ln -sf ~/.gemini/session-hub/bin/hub ~/.local/bin/hub
48
+ ln -sf ~/.gemini/session-hub/bin/mixhub ~/.local/bin/mixhub
49
+ ```
50
+
51
+ ### Commands
52
+
53
+ | Command | Description |
54
+ | :--- | :--- |
55
+ | `mixhub` / `hub` / `hub workspace` | Open the dual-pane in-place workspace (32-col left sidebar + right live/reader pane) |
56
+ | `hub tui` | Open the single-window TUI browser |
57
+ | `hub handoff <id> --to <agent>` | Fence source session and generate 10-section `<2000 tok` handoff bundle (`claude\|agy\|codex\|deepseek`) |
58
+ | `hub sync-rules [dir] [--dry-run]` | Synchronize `AGENTS.md` (SSoT) with `CLAUDE.md` and `.gemini/GEMINI.md` |
59
+ | `hub notify [options] <message>` | Send plain-text notifications / mobile cards to Telegram, Discord, or Slack |
60
+ | `hub codex-release-lock <id>` | Release terminal Codex writer lock for instant `ChatGPT.app` / mobile takeover |
61
+ | `hub mobile-handoff <id>` | Switch session to `NATIVE_EXTERNAL` mobile control mode |
62
+ | `hub install-icons` | Generate `HubIcons.ttf` PUA vector font (`\uE900-\uE902`) or verify `●` fallback |
63
+ | `hub doctor [--json]` | Run Fable 5.1 modular health check across Providers, Channels, Locks, and Quirks |
64
+ | `hub report [--format terminal\|mobile\|markdown\|json]` | Calculate High-Low Brain Hybrid token & USD savings report |
65
+ | `hub anchor [id]` | Generate zero-token Markdown fact anchors from raw JSONL transcripts |
66
+ | `hub slim [--dry-run]` | Strip historical base64 screenshots (>7d) and expired subagent logs (>1d) |
67
+ | `hub web` | Open the local MixHub web workspace (`http://127.0.0.1:8765`) |
68
+
69
+ ## Running Tests
70
+
71
+ ```bash
72
+ python3 -m unittest discover -s tests -v
73
+ ```