liteharness 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.
- liteharness-0.1.0/LICENSE +21 -0
- liteharness-0.1.0/PKG-INFO +209 -0
- liteharness-0.1.0/README.md +171 -0
- liteharness-0.1.0/liteharness/__init__.py +3 -0
- liteharness-0.1.0/liteharness/cli.py +2429 -0
- liteharness-0.1.0/liteharness/cli_scripts/__init__.py +0 -0
- liteharness-0.1.0/liteharness/cli_scripts/codex/__init__.py +0 -0
- liteharness-0.1.0/liteharness/cli_scripts/codex/liteharness_inbox_watcher.py +534 -0
- liteharness-0.1.0/liteharness/cli_scripts/codex/liteharness_notify.py +303 -0
- liteharness-0.1.0/liteharness/cli_scripts/codex/liteharness_watcher_supervisor.py +135 -0
- liteharness-0.1.0/liteharness/cli_scripts/copilot/__init__.py +0 -0
- liteharness-0.1.0/liteharness/cli_scripts/copilot/copilot_inbox_watcher.py +603 -0
- liteharness-0.1.0/liteharness/cli_scripts/copilot/copilot_notify.py +231 -0
- liteharness-0.1.0/liteharness/cli_scripts/copilot/copilot_targeting.py +168 -0
- liteharness-0.1.0/liteharness/cli_scripts/copilot/copilot_watcher_supervisor.py +107 -0
- liteharness-0.1.0/liteharness/cli_scripts/kilo/__init__.py +1 -0
- liteharness-0.1.0/liteharness/cli_scripts/kilo/kilo_inbox_watcher.py +355 -0
- liteharness-0.1.0/liteharness/codex_hooks.py +93 -0
- liteharness-0.1.0/liteharness/config.py +224 -0
- liteharness-0.1.0/liteharness/copilot_waiter.py +166 -0
- liteharness-0.1.0/liteharness/desktop_automation.py +111 -0
- liteharness-0.1.0/liteharness/embed_service.py +501 -0
- liteharness-0.1.0/liteharness/evolution.py +90 -0
- liteharness-0.1.0/liteharness/hooks.py +1213 -0
- liteharness-0.1.0/liteharness/hooks_configs/claude_hooks.json +110 -0
- liteharness-0.1.0/liteharness/hooks_configs/codex_hooks.json +45 -0
- liteharness-0.1.0/liteharness/hooks_configs/copilot_hooks.json +35 -0
- liteharness-0.1.0/liteharness/hooks_configs/opencode_plugin.ts +58 -0
- liteharness-0.1.0/liteharness/inbox.py +224 -0
- liteharness-0.1.0/liteharness/naming.py +149 -0
- liteharness-0.1.0/liteharness/nudge_bot.py +322 -0
- liteharness-0.1.0/liteharness/ps_scripts/codex_desktop.ps1 +323 -0
- liteharness-0.1.0/liteharness/ps_scripts/command_palette.ps1 +74 -0
- liteharness-0.1.0/liteharness/ps_scripts/find_pane_by_buffer_markers.ps1 +115 -0
- liteharness-0.1.0/liteharness/ps_scripts/list_panes.ps1 +157 -0
- liteharness-0.1.0/liteharness/ps_scripts/read_buffer.ps1 +74 -0
- liteharness-0.1.0/liteharness/ps_scripts/send_keys.ps1 +93 -0
- liteharness-0.1.0/liteharness/ps_scripts/split_pane.ps1 +83 -0
- liteharness-0.1.0/liteharness/pty_daemon.py +655 -0
- liteharness-0.1.0/liteharness/rag/__init__.py +25 -0
- liteharness-0.1.0/liteharness/rag/chunker.py +282 -0
- liteharness-0.1.0/liteharness/rag/embeddings.py +141 -0
- liteharness-0.1.0/liteharness/rag/engine.py +1229 -0
- liteharness-0.1.0/liteharness/rag/mcp_tool.py +91 -0
- liteharness-0.1.0/liteharness/rag/reranker.py +103 -0
- liteharness-0.1.0/liteharness/rag/scanners/__init__.py +17 -0
- liteharness-0.1.0/liteharness/rag/scanners/base.py +85 -0
- liteharness-0.1.0/liteharness/rag/scanners/claude_scanner.py +147 -0
- liteharness-0.1.0/liteharness/rag/scanners/codex_scanner.py +117 -0
- liteharness-0.1.0/liteharness/rag/scanners/copilot_scanner.py +105 -0
- liteharness-0.1.0/liteharness/rag/scanners/git_scanner.py +128 -0
- liteharness-0.1.0/liteharness/rag/scanners/litecode_scanner.py +91 -0
- liteharness-0.1.0/liteharness/rag/scanners/pattern_scanner.py +97 -0
- liteharness-0.1.0/liteharness/rag/storage.py +304 -0
- liteharness-0.1.0/liteharness/session_manager.py +900 -0
- liteharness-0.1.0/liteharness/terminal_automation.py +274 -0
- liteharness-0.1.0/liteharness/tts/__init__.py +1 -0
- liteharness-0.1.0/liteharness/tts/smart_tts.py +482 -0
- liteharness-0.1.0/liteharness/tts/utils/__init__.py +1 -0
- liteharness-0.1.0/liteharness/tts/utils/edge_tts.py +116 -0
- liteharness-0.1.0/liteharness/tts/utils/pyttsx3_tts.py +39 -0
- liteharness-0.1.0/liteharness/tts/utils/tts_queue.py +300 -0
- liteharness-0.1.0/liteharness.egg-info/PKG-INFO +209 -0
- liteharness-0.1.0/liteharness.egg-info/SOURCES.txt +74 -0
- liteharness-0.1.0/liteharness.egg-info/dependency_links.txt +1 -0
- liteharness-0.1.0/liteharness.egg-info/entry_points.txt +2 -0
- liteharness-0.1.0/liteharness.egg-info/requires.txt +7 -0
- liteharness-0.1.0/liteharness.egg-info/top_level.txt +1 -0
- liteharness-0.1.0/pyproject.toml +58 -0
- liteharness-0.1.0/setup.cfg +4 -0
- liteharness-0.1.0/tests/test_codex_headed_detection.py +292 -0
- liteharness-0.1.0/tests/test_codex_hook_install.py +138 -0
- liteharness-0.1.0/tests/test_codex_hooks.py +90 -0
- liteharness-0.1.0/tests/test_copilot_waiter.py +93 -0
- liteharness-0.1.0/tests/test_inbox.py +39 -0
- liteharness-0.1.0/tests/test_session_manager.py +144 -0
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Ryan Devlin
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
|
@@ -0,0 +1,209 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: liteharness
|
|
3
|
+
Version: 0.1.0
|
|
4
|
+
Summary: Portable cross-CLI agent orchestration. Hook-polled inbox, conversation discovery, task tracking.
|
|
5
|
+
Author-email: Ryan Devlin <ryan@litesuite.dev>
|
|
6
|
+
Maintainer-email: Ryan Devlin <ryan@litesuite.dev>
|
|
7
|
+
License: MIT
|
|
8
|
+
Project-URL: Homepage, https://litesuite.dev/liteharness
|
|
9
|
+
Project-URL: Documentation, https://litesuite.dev/liteharness
|
|
10
|
+
Project-URL: Repository, https://github.com/ahostbr/liteharness
|
|
11
|
+
Project-URL: Issues, https://github.com/ahostbr/liteharness/issues
|
|
12
|
+
Project-URL: Changelog, https://github.com/ahostbr/liteharness/blob/main/CHANGELOG.md
|
|
13
|
+
Keywords: ai,agents,orchestration,claude,gemini,codex,mcp,multi-agent,cli,pty
|
|
14
|
+
Classifier: Development Status :: 4 - Beta
|
|
15
|
+
Classifier: Intended Audience :: Developers
|
|
16
|
+
Classifier: Intended Audience :: System Administrators
|
|
17
|
+
Classifier: License :: OSI Approved :: MIT License
|
|
18
|
+
Classifier: Operating System :: Microsoft :: Windows
|
|
19
|
+
Classifier: Operating System :: POSIX :: Linux
|
|
20
|
+
Classifier: Operating System :: MacOS
|
|
21
|
+
Classifier: Programming Language :: Python :: 3
|
|
22
|
+
Classifier: Programming Language :: Python :: 3.10
|
|
23
|
+
Classifier: Programming Language :: Python :: 3.11
|
|
24
|
+
Classifier: Programming Language :: Python :: 3.12
|
|
25
|
+
Classifier: Topic :: Software Development :: Libraries
|
|
26
|
+
Classifier: Topic :: System :: Distributed Computing
|
|
27
|
+
Classifier: Topic :: Terminals
|
|
28
|
+
Requires-Python: >=3.10
|
|
29
|
+
Description-Content-Type: text/markdown
|
|
30
|
+
License-File: LICENSE
|
|
31
|
+
Requires-Dist: psutil>=5.9
|
|
32
|
+
Provides-Extra: embed
|
|
33
|
+
Requires-Dist: onnxruntime>=1.18.0; extra == "embed"
|
|
34
|
+
Requires-Dist: numpy>=1.26.0; extra == "embed"
|
|
35
|
+
Requires-Dist: huggingface_hub>=0.23.0; extra == "embed"
|
|
36
|
+
Requires-Dist: tokenizers>=0.19.0; extra == "embed"
|
|
37
|
+
Dynamic: license-file
|
|
38
|
+
|
|
39
|
+
# LiteHarness
|
|
40
|
+
|
|
41
|
+
Portable cross-CLI agent orchestration for Claude Code, Codex, Copilot, and any CLI agent. Spawn, name, message, and programmatically control agent sessions from pure Python.
|
|
42
|
+
|
|
43
|
+
## Install
|
|
44
|
+
|
|
45
|
+
```bash
|
|
46
|
+
pip install -e packages/liteharness
|
|
47
|
+
```
|
|
48
|
+
|
|
49
|
+
## Quick Start
|
|
50
|
+
|
|
51
|
+
```bash
|
|
52
|
+
# Initialize (creates dirs, detects CLIs, installs hooks)
|
|
53
|
+
liteharness init
|
|
54
|
+
|
|
55
|
+
# Discover active agents
|
|
56
|
+
liteharness discover
|
|
57
|
+
|
|
58
|
+
# Send a message
|
|
59
|
+
liteharness send <agent-id> "fix the auth bug" --from <your-id>
|
|
60
|
+
|
|
61
|
+
# Spawn a new Claude session (visible terminal tab)
|
|
62
|
+
liteharness spawn --model opus --name "Recon" --prompt "review the PR"
|
|
63
|
+
|
|
64
|
+
# Spawn headless with full stdin/stdout control
|
|
65
|
+
liteharness pty-daemon
|
|
66
|
+
liteharness spawn --pty --model haiku --name "Worker"
|
|
67
|
+
liteharness send-input <agent-id> "/compact"
|
|
68
|
+
liteharness read-output <agent-id>
|
|
69
|
+
```
|
|
70
|
+
|
|
71
|
+
## Features
|
|
72
|
+
|
|
73
|
+
### Agent Spawning
|
|
74
|
+
|
|
75
|
+
Three modes for spawning Claude Code sessions:
|
|
76
|
+
|
|
77
|
+
| Mode | Flag | Visible | Stdin Control | Use Case |
|
|
78
|
+
| -------- | ------------ | ------- | ------------- | -------------------------- |
|
|
79
|
+
| Terminal | (default) | Yes | No | Agents you want to watch |
|
|
80
|
+
| PTY | `--pty` | No | Full | Automation, Karpathy loops |
|
|
81
|
+
| Headed | UIAutomation | Yes | Full | Best of both worlds |
|
|
82
|
+
|
|
83
|
+
### ConPTY Daemon
|
|
84
|
+
|
|
85
|
+
Headless agent control via Windows ConPTY (pywinpty). Token-authenticated TCP daemon on port 7450.
|
|
86
|
+
|
|
87
|
+
```bash
|
|
88
|
+
liteharness pty-daemon # Start daemon
|
|
89
|
+
liteharness spawn --pty --model opus --name "Worker"
|
|
90
|
+
liteharness send-input <id> "/compact" # Send slash commands
|
|
91
|
+
liteharness send-input <id> "fix it" # Send prompts
|
|
92
|
+
liteharness read-output <id> # Read terminal output
|
|
93
|
+
liteharness pty-list # List sessions
|
|
94
|
+
liteharness pty-kill <id> # Kill session
|
|
95
|
+
```
|
|
96
|
+
|
|
97
|
+
**Security:** Bearer token auth, executable whitelist (claude/codex/python only), shell metachar block, agent ID validation, max 20 sessions, input length caps.
|
|
98
|
+
|
|
99
|
+
### UIAutomation (Headed Mode)
|
|
100
|
+
|
|
101
|
+
Read and write to visible Windows Terminal panes via PowerShell UIAutomation. Uses clipboard paste for atomic input (no race conditions).
|
|
102
|
+
|
|
103
|
+
```bash
|
|
104
|
+
liteharness wt-list-panes # Find windows/panes
|
|
105
|
+
liteharness send-input --headed <handle:pane> "text" # Paste into terminal
|
|
106
|
+
liteharness read-output --headed <handle:pane> # Read terminal buffer
|
|
107
|
+
```
|
|
108
|
+
|
|
109
|
+
```python
|
|
110
|
+
from liteharness.terminal_automation import list_panes, read_buffer, send_input
|
|
111
|
+
|
|
112
|
+
panes = list_panes()
|
|
113
|
+
output = read_buffer(window_handle, pane_id)
|
|
114
|
+
send_input(window_handle, pane_id, "/compact") # auto-appends Enter
|
|
115
|
+
```
|
|
116
|
+
|
|
117
|
+
### Agent Naming
|
|
118
|
+
|
|
119
|
+
Every agent gets a deterministic two-word name derived from its UUID (e.g., SwiftRelay, IronWatch). Same UUID always produces the same name. Override with `--name`.
|
|
120
|
+
|
|
121
|
+
```bash
|
|
122
|
+
liteharness discover
|
|
123
|
+
# [active] Sentinel (fa88c542) claude-code/opus — 0s ago
|
|
124
|
+
# [active] PrimeFlint (b2db8be8) claude-code/opus — 7m ago
|
|
125
|
+
```
|
|
126
|
+
|
|
127
|
+
### Inter-Agent Messaging
|
|
128
|
+
|
|
129
|
+
Maildir-style inbox with hook-polled delivery. Agents discover each other automatically via presence files.
|
|
130
|
+
|
|
131
|
+
```bash
|
|
132
|
+
liteharness send <agent-id> "message" --from <your-id>
|
|
133
|
+
liteharness list # List inbox
|
|
134
|
+
liteharness discover # Find active agents
|
|
135
|
+
```
|
|
136
|
+
|
|
137
|
+
### Hook Integration
|
|
138
|
+
|
|
139
|
+
Auto-installs hooks for supported CLIs:
|
|
140
|
+
|
|
141
|
+
- **Claude Code** — SessionStart registration, PostToolUse inbox polling
|
|
142
|
+
- **Codex CLI** — `codex_hooks.json` routes through Codex JSON adapters for SessionStart, PostToolUse, and UserPromptSubmit
|
|
143
|
+
- **Copilot CLI** — Project-level .github/hooks/
|
|
144
|
+
- **OpenCode / KiloCode** — Plugin-based hooks
|
|
145
|
+
|
|
146
|
+
## Commands
|
|
147
|
+
|
|
148
|
+
| Command | Description |
|
|
149
|
+
| -------------------------- | ---------------------------------------------------------- |
|
|
150
|
+
| `init` | Initialize LiteHarness, detect CLIs, install hooks |
|
|
151
|
+
| `status` | Show root, agent ID, inbox counts, active agents |
|
|
152
|
+
| `send <to> <msg>` | Send a message to another agent |
|
|
153
|
+
| `list` | List inbox messages |
|
|
154
|
+
| `discover [N]` | Discover N most recent active agents |
|
|
155
|
+
| `spawn [opts]` | Spawn a new Claude Code session |
|
|
156
|
+
| `sessions <cmd>` | Save/restore Claude, Codex, and Copilot terminal sessions |
|
|
157
|
+
| `register` | Update agent presence (--agent-id, --cli, --model, --name) |
|
|
158
|
+
| `pty-daemon` | Start the ConPTY daemon |
|
|
159
|
+
| `send-input <id> <text>` | Send text to a PTY or headed terminal |
|
|
160
|
+
| `read-output <id>` | Read output from a PTY or headed terminal |
|
|
161
|
+
| `pty-list` | List active PTY sessions |
|
|
162
|
+
| `pty-kill <id>` | Kill a PTY session |
|
|
163
|
+
| `wt-list-panes` | List Windows Terminal windows/panes |
|
|
164
|
+
| `wt-focus <handle> <pane>` | Focus a specific WT pane |
|
|
165
|
+
| `query-patterns` | Query task patterns (BM25) |
|
|
166
|
+
| `embed-query` | Hybrid RAG pattern query |
|
|
167
|
+
| `record-pattern` | Record a task outcome pattern |
|
|
168
|
+
|
|
169
|
+
### Terminal Session Restore
|
|
170
|
+
|
|
171
|
+
Save and restore visible terminal agents:
|
|
172
|
+
|
|
173
|
+
```bash
|
|
174
|
+
liteharness sessions save morning-layout
|
|
175
|
+
liteharness sessions restore morning-layout
|
|
176
|
+
liteharness sessions restore morning-layout --layout tabs --dry-run
|
|
177
|
+
liteharness sessions status
|
|
178
|
+
liteharness sessions list
|
|
179
|
+
```
|
|
180
|
+
|
|
181
|
+
Restore defaults to `windows`, which opens one top-level Windows Terminal window per restored agent. Use `--layout tabs` for legacy grouped tabs or `--layout panes` for one window with split panes. Snapshots and config live under `~/.liteharness/sessions/`.
|
|
182
|
+
|
|
183
|
+
## Architecture
|
|
184
|
+
|
|
185
|
+
```
|
|
186
|
+
~/.liteharness/
|
|
187
|
+
agents/ # Presence files (heartbeat, model, CLI)
|
|
188
|
+
names/ # Name overrides (plain text, immune to clobbering)
|
|
189
|
+
inbox/
|
|
190
|
+
new/ # Unread messages
|
|
191
|
+
cur/ # In-progress messages
|
|
192
|
+
done/ # Completed messages
|
|
193
|
+
tmp/ # Atomic write staging
|
|
194
|
+
tasks/ # Task store
|
|
195
|
+
patterns/ # Pattern learning
|
|
196
|
+
pty_daemon.lock # PTY daemon token + port
|
|
197
|
+
config.json # Global config
|
|
198
|
+
```
|
|
199
|
+
|
|
200
|
+
## Requirements
|
|
201
|
+
|
|
202
|
+
- Python 3.10+
|
|
203
|
+
- Windows 10+ (for ConPTY and UIAutomation features)
|
|
204
|
+
- `pywinpty` (included on Windows Python installations)
|
|
205
|
+
- Claude Code CLI (for spawning agents)
|
|
206
|
+
|
|
207
|
+
## License
|
|
208
|
+
|
|
209
|
+
MIT
|
|
@@ -0,0 +1,171 @@
|
|
|
1
|
+
# LiteHarness
|
|
2
|
+
|
|
3
|
+
Portable cross-CLI agent orchestration for Claude Code, Codex, Copilot, and any CLI agent. Spawn, name, message, and programmatically control agent sessions from pure Python.
|
|
4
|
+
|
|
5
|
+
## Install
|
|
6
|
+
|
|
7
|
+
```bash
|
|
8
|
+
pip install -e packages/liteharness
|
|
9
|
+
```
|
|
10
|
+
|
|
11
|
+
## Quick Start
|
|
12
|
+
|
|
13
|
+
```bash
|
|
14
|
+
# Initialize (creates dirs, detects CLIs, installs hooks)
|
|
15
|
+
liteharness init
|
|
16
|
+
|
|
17
|
+
# Discover active agents
|
|
18
|
+
liteharness discover
|
|
19
|
+
|
|
20
|
+
# Send a message
|
|
21
|
+
liteharness send <agent-id> "fix the auth bug" --from <your-id>
|
|
22
|
+
|
|
23
|
+
# Spawn a new Claude session (visible terminal tab)
|
|
24
|
+
liteharness spawn --model opus --name "Recon" --prompt "review the PR"
|
|
25
|
+
|
|
26
|
+
# Spawn headless with full stdin/stdout control
|
|
27
|
+
liteharness pty-daemon
|
|
28
|
+
liteharness spawn --pty --model haiku --name "Worker"
|
|
29
|
+
liteharness send-input <agent-id> "/compact"
|
|
30
|
+
liteharness read-output <agent-id>
|
|
31
|
+
```
|
|
32
|
+
|
|
33
|
+
## Features
|
|
34
|
+
|
|
35
|
+
### Agent Spawning
|
|
36
|
+
|
|
37
|
+
Three modes for spawning Claude Code sessions:
|
|
38
|
+
|
|
39
|
+
| Mode | Flag | Visible | Stdin Control | Use Case |
|
|
40
|
+
| -------- | ------------ | ------- | ------------- | -------------------------- |
|
|
41
|
+
| Terminal | (default) | Yes | No | Agents you want to watch |
|
|
42
|
+
| PTY | `--pty` | No | Full | Automation, Karpathy loops |
|
|
43
|
+
| Headed | UIAutomation | Yes | Full | Best of both worlds |
|
|
44
|
+
|
|
45
|
+
### ConPTY Daemon
|
|
46
|
+
|
|
47
|
+
Headless agent control via Windows ConPTY (pywinpty). Token-authenticated TCP daemon on port 7450.
|
|
48
|
+
|
|
49
|
+
```bash
|
|
50
|
+
liteharness pty-daemon # Start daemon
|
|
51
|
+
liteharness spawn --pty --model opus --name "Worker"
|
|
52
|
+
liteharness send-input <id> "/compact" # Send slash commands
|
|
53
|
+
liteharness send-input <id> "fix it" # Send prompts
|
|
54
|
+
liteharness read-output <id> # Read terminal output
|
|
55
|
+
liteharness pty-list # List sessions
|
|
56
|
+
liteharness pty-kill <id> # Kill session
|
|
57
|
+
```
|
|
58
|
+
|
|
59
|
+
**Security:** Bearer token auth, executable whitelist (claude/codex/python only), shell metachar block, agent ID validation, max 20 sessions, input length caps.
|
|
60
|
+
|
|
61
|
+
### UIAutomation (Headed Mode)
|
|
62
|
+
|
|
63
|
+
Read and write to visible Windows Terminal panes via PowerShell UIAutomation. Uses clipboard paste for atomic input (no race conditions).
|
|
64
|
+
|
|
65
|
+
```bash
|
|
66
|
+
liteharness wt-list-panes # Find windows/panes
|
|
67
|
+
liteharness send-input --headed <handle:pane> "text" # Paste into terminal
|
|
68
|
+
liteharness read-output --headed <handle:pane> # Read terminal buffer
|
|
69
|
+
```
|
|
70
|
+
|
|
71
|
+
```python
|
|
72
|
+
from liteharness.terminal_automation import list_panes, read_buffer, send_input
|
|
73
|
+
|
|
74
|
+
panes = list_panes()
|
|
75
|
+
output = read_buffer(window_handle, pane_id)
|
|
76
|
+
send_input(window_handle, pane_id, "/compact") # auto-appends Enter
|
|
77
|
+
```
|
|
78
|
+
|
|
79
|
+
### Agent Naming
|
|
80
|
+
|
|
81
|
+
Every agent gets a deterministic two-word name derived from its UUID (e.g., SwiftRelay, IronWatch). Same UUID always produces the same name. Override with `--name`.
|
|
82
|
+
|
|
83
|
+
```bash
|
|
84
|
+
liteharness discover
|
|
85
|
+
# [active] Sentinel (fa88c542) claude-code/opus — 0s ago
|
|
86
|
+
# [active] PrimeFlint (b2db8be8) claude-code/opus — 7m ago
|
|
87
|
+
```
|
|
88
|
+
|
|
89
|
+
### Inter-Agent Messaging
|
|
90
|
+
|
|
91
|
+
Maildir-style inbox with hook-polled delivery. Agents discover each other automatically via presence files.
|
|
92
|
+
|
|
93
|
+
```bash
|
|
94
|
+
liteharness send <agent-id> "message" --from <your-id>
|
|
95
|
+
liteharness list # List inbox
|
|
96
|
+
liteharness discover # Find active agents
|
|
97
|
+
```
|
|
98
|
+
|
|
99
|
+
### Hook Integration
|
|
100
|
+
|
|
101
|
+
Auto-installs hooks for supported CLIs:
|
|
102
|
+
|
|
103
|
+
- **Claude Code** — SessionStart registration, PostToolUse inbox polling
|
|
104
|
+
- **Codex CLI** — `codex_hooks.json` routes through Codex JSON adapters for SessionStart, PostToolUse, and UserPromptSubmit
|
|
105
|
+
- **Copilot CLI** — Project-level .github/hooks/
|
|
106
|
+
- **OpenCode / KiloCode** — Plugin-based hooks
|
|
107
|
+
|
|
108
|
+
## Commands
|
|
109
|
+
|
|
110
|
+
| Command | Description |
|
|
111
|
+
| -------------------------- | ---------------------------------------------------------- |
|
|
112
|
+
| `init` | Initialize LiteHarness, detect CLIs, install hooks |
|
|
113
|
+
| `status` | Show root, agent ID, inbox counts, active agents |
|
|
114
|
+
| `send <to> <msg>` | Send a message to another agent |
|
|
115
|
+
| `list` | List inbox messages |
|
|
116
|
+
| `discover [N]` | Discover N most recent active agents |
|
|
117
|
+
| `spawn [opts]` | Spawn a new Claude Code session |
|
|
118
|
+
| `sessions <cmd>` | Save/restore Claude, Codex, and Copilot terminal sessions |
|
|
119
|
+
| `register` | Update agent presence (--agent-id, --cli, --model, --name) |
|
|
120
|
+
| `pty-daemon` | Start the ConPTY daemon |
|
|
121
|
+
| `send-input <id> <text>` | Send text to a PTY or headed terminal |
|
|
122
|
+
| `read-output <id>` | Read output from a PTY or headed terminal |
|
|
123
|
+
| `pty-list` | List active PTY sessions |
|
|
124
|
+
| `pty-kill <id>` | Kill a PTY session |
|
|
125
|
+
| `wt-list-panes` | List Windows Terminal windows/panes |
|
|
126
|
+
| `wt-focus <handle> <pane>` | Focus a specific WT pane |
|
|
127
|
+
| `query-patterns` | Query task patterns (BM25) |
|
|
128
|
+
| `embed-query` | Hybrid RAG pattern query |
|
|
129
|
+
| `record-pattern` | Record a task outcome pattern |
|
|
130
|
+
|
|
131
|
+
### Terminal Session Restore
|
|
132
|
+
|
|
133
|
+
Save and restore visible terminal agents:
|
|
134
|
+
|
|
135
|
+
```bash
|
|
136
|
+
liteharness sessions save morning-layout
|
|
137
|
+
liteharness sessions restore morning-layout
|
|
138
|
+
liteharness sessions restore morning-layout --layout tabs --dry-run
|
|
139
|
+
liteharness sessions status
|
|
140
|
+
liteharness sessions list
|
|
141
|
+
```
|
|
142
|
+
|
|
143
|
+
Restore defaults to `windows`, which opens one top-level Windows Terminal window per restored agent. Use `--layout tabs` for legacy grouped tabs or `--layout panes` for one window with split panes. Snapshots and config live under `~/.liteharness/sessions/`.
|
|
144
|
+
|
|
145
|
+
## Architecture
|
|
146
|
+
|
|
147
|
+
```
|
|
148
|
+
~/.liteharness/
|
|
149
|
+
agents/ # Presence files (heartbeat, model, CLI)
|
|
150
|
+
names/ # Name overrides (plain text, immune to clobbering)
|
|
151
|
+
inbox/
|
|
152
|
+
new/ # Unread messages
|
|
153
|
+
cur/ # In-progress messages
|
|
154
|
+
done/ # Completed messages
|
|
155
|
+
tmp/ # Atomic write staging
|
|
156
|
+
tasks/ # Task store
|
|
157
|
+
patterns/ # Pattern learning
|
|
158
|
+
pty_daemon.lock # PTY daemon token + port
|
|
159
|
+
config.json # Global config
|
|
160
|
+
```
|
|
161
|
+
|
|
162
|
+
## Requirements
|
|
163
|
+
|
|
164
|
+
- Python 3.10+
|
|
165
|
+
- Windows 10+ (for ConPTY and UIAutomation features)
|
|
166
|
+
- `pywinpty` (included on Windows Python installations)
|
|
167
|
+
- Claude Code CLI (for spawning agents)
|
|
168
|
+
|
|
169
|
+
## License
|
|
170
|
+
|
|
171
|
+
MIT
|