hcom 0.1.7__tar.gz → 0.1.8__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.
Potentially problematic release.
This version of hcom might be problematic. Click here for more details.
- {hcom-0.1.7/src/hcom.egg-info → hcom-0.1.8}/PKG-INFO +2 -2
- {hcom-0.1.7 → hcom-0.1.8}/README.md +1 -1
- {hcom-0.1.7 → hcom-0.1.8}/pyproject.toml +1 -1
- {hcom-0.1.7 → hcom-0.1.8}/src/hcom/__init__.py +1 -1
- {hcom-0.1.7 → hcom-0.1.8}/src/hcom/__main__.py +82 -9
- {hcom-0.1.7 → hcom-0.1.8/src/hcom.egg-info}/PKG-INFO +2 -2
- {hcom-0.1.7 → hcom-0.1.8}/MANIFEST.in +0 -0
- {hcom-0.1.7 → hcom-0.1.8}/setup.cfg +0 -0
- {hcom-0.1.7 → hcom-0.1.8}/src/hcom.egg-info/SOURCES.txt +0 -0
- {hcom-0.1.7 → hcom-0.1.8}/src/hcom.egg-info/dependency_links.txt +0 -0
- {hcom-0.1.7 → hcom-0.1.8}/src/hcom.egg-info/entry_points.txt +0 -0
- {hcom-0.1.7 → hcom-0.1.8}/src/hcom.egg-info/top_level.txt +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: hcom
|
|
3
|
-
Version: 0.1.
|
|
3
|
+
Version: 0.1.8
|
|
4
4
|
Summary: Lightweight CLI tool for real-time communication between Claude Code subagents using hooks
|
|
5
5
|
Author-email: aannoo <your@email.com>
|
|
6
6
|
License: MIT
|
|
@@ -92,7 +92,7 @@ hcom open test-writer --claude-args "-p 'write tests for any new code'"
|
|
|
92
92
|
hcom open reviewer --claude-args "-p 'review when @mentioned'"
|
|
93
93
|
|
|
94
94
|
# Pass multiple Claude flags
|
|
95
|
-
hcom open orchestrator --claude-args "--model
|
|
95
|
+
hcom open orchestrator --claude-args "--model sonnet
|
|
96
96
|
--resume session_id"
|
|
97
97
|
|
|
98
98
|
# Launch in specific directories
|
|
@@ -64,7 +64,7 @@ hcom open test-writer --claude-args "-p 'write tests for any new code'"
|
|
|
64
64
|
hcom open reviewer --claude-args "-p 'review when @mentioned'"
|
|
65
65
|
|
|
66
66
|
# Pass multiple Claude flags
|
|
67
|
-
hcom open orchestrator --claude-args "--model
|
|
67
|
+
hcom open orchestrator --claude-args "--model sonnet
|
|
68
68
|
--resume session_id"
|
|
69
69
|
|
|
70
70
|
# Launch in specific directories
|
|
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
|
|
|
4
4
|
|
|
5
5
|
[project]
|
|
6
6
|
name = "hcom"
|
|
7
|
-
version = "0.1.
|
|
7
|
+
version = "0.1.8"
|
|
8
8
|
description = "Lightweight CLI tool for real-time communication between Claude Code subagents using hooks"
|
|
9
9
|
readme = "README.md"
|
|
10
10
|
requires-python = ">=3.6"
|
|
@@ -262,7 +262,7 @@ def send_message(from_instance, message):
|
|
|
262
262
|
except Exception:
|
|
263
263
|
return False
|
|
264
264
|
|
|
265
|
-
def should_deliver_message(msg, instance_name):
|
|
265
|
+
def should_deliver_message(msg, instance_name, all_instance_names=None):
|
|
266
266
|
"""Check if message should be delivered based on @-mentions"""
|
|
267
267
|
text = msg['message']
|
|
268
268
|
|
|
@@ -274,11 +274,22 @@ def should_deliver_message(msg, instance_name):
|
|
|
274
274
|
if not mentions:
|
|
275
275
|
return True
|
|
276
276
|
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
277
|
+
# Check if this instance matches any mention
|
|
278
|
+
this_instance_matches = any(instance_name.lower().startswith(mention.lower()) for mention in mentions)
|
|
279
|
+
|
|
280
|
+
if this_instance_matches:
|
|
281
|
+
return True
|
|
280
282
|
|
|
281
|
-
|
|
283
|
+
# If we have all_instance_names, check if ANY mention matches ANY instance
|
|
284
|
+
if all_instance_names:
|
|
285
|
+
any_mention_matches = any(
|
|
286
|
+
any(name.lower().startswith(mention.lower()) for name in all_instance_names)
|
|
287
|
+
for mention in mentions
|
|
288
|
+
)
|
|
289
|
+
if not any_mention_matches:
|
|
290
|
+
return True # No matches anywhere = broadcast to all
|
|
291
|
+
|
|
292
|
+
return False # This instance doesn't match, but others might
|
|
282
293
|
|
|
283
294
|
# ==================== Parsing and Helper Functions ====================
|
|
284
295
|
|
|
@@ -713,7 +724,7 @@ def setup_hooks():
|
|
|
713
724
|
if 'hooks' not in settings:
|
|
714
725
|
settings['hooks'] = {}
|
|
715
726
|
|
|
716
|
-
hcom_send_permission = 'Bash(echo
|
|
727
|
+
hcom_send_permission = 'Bash(echo HCOM_SEND:*)'
|
|
717
728
|
if hcom_send_permission not in settings['permissions']['allow']:
|
|
718
729
|
settings['permissions']['allow'].append(hcom_send_permission)
|
|
719
730
|
|
|
@@ -885,10 +896,11 @@ def get_new_messages(instance_name):
|
|
|
885
896
|
# Filter messages:
|
|
886
897
|
# 1. Exclude own messages
|
|
887
898
|
# 2. Apply @-mention filtering
|
|
899
|
+
all_instance_names = list(positions.keys())
|
|
888
900
|
messages = []
|
|
889
901
|
for msg in all_messages:
|
|
890
902
|
if msg['from'] != instance_name:
|
|
891
|
-
if should_deliver_message(msg, instance_name):
|
|
903
|
+
if should_deliver_message(msg, instance_name, all_instance_names):
|
|
892
904
|
messages.append(msg)
|
|
893
905
|
|
|
894
906
|
# Update position to end of file
|
|
@@ -1280,12 +1292,13 @@ def show_main_screen_header():
|
|
|
1280
1292
|
|
|
1281
1293
|
def cmd_help():
|
|
1282
1294
|
"""Show help text"""
|
|
1295
|
+
# Basic help for interactive users
|
|
1283
1296
|
print("""hcom - Claude Hook Comms
|
|
1284
1297
|
|
|
1285
1298
|
Usage:
|
|
1286
1299
|
hcom open [n] Launch n Claude instances
|
|
1287
1300
|
hcom open <agent> Launch named agent from .claude/agents/
|
|
1288
|
-
hcom open --prefix
|
|
1301
|
+
hcom open --prefix <team> n Launch n instances with team prefix
|
|
1289
1302
|
hcom watch View conversation dashboard
|
|
1290
1303
|
hcom clear Clear and archive conversation
|
|
1291
1304
|
hcom cleanup Remove hooks from current directory
|
|
@@ -1293,12 +1306,59 @@ Usage:
|
|
|
1293
1306
|
hcom help Show this help
|
|
1294
1307
|
|
|
1295
1308
|
Automation:
|
|
1296
|
-
hcom send 'msg' Send message
|
|
1309
|
+
hcom send 'msg' Send message to all
|
|
1297
1310
|
hcom send '@prefix msg' Send to specific instances
|
|
1298
1311
|
hcom watch --logs Show logs
|
|
1299
1312
|
hcom watch --status Show status
|
|
1313
|
+
hcom watch --wait [timeout] Wait and notify for new messages (seconds)
|
|
1300
1314
|
|
|
1301
1315
|
Docs: https://raw.githubusercontent.com/aannoo/claude-hook-comms/main/README.md""")
|
|
1316
|
+
|
|
1317
|
+
# Additional help for AI assistants when running in non-interactive mode
|
|
1318
|
+
if not sys.stdin.isatty():
|
|
1319
|
+
print("""
|
|
1320
|
+
|
|
1321
|
+
=== ADDITIONAL INFO ===
|
|
1322
|
+
|
|
1323
|
+
CONCEPT: HCOM creates multi-agent collaboration by launching multiple Claude Code
|
|
1324
|
+
instances in separate terminals that share a single conversation.
|
|
1325
|
+
|
|
1326
|
+
KEY UNDERSTANDING:
|
|
1327
|
+
• Single conversation - All instances share ~/.hcom/hcom.log
|
|
1328
|
+
• Agents are system prompts - "reviewer" loads .claude/agents/reviewer.md
|
|
1329
|
+
• CLI usage - Use 'hcom send' for messaging. Internal instances use 'echo HCOM_SEND:'
|
|
1330
|
+
• hcom open is directory-specific - always cd to project directory first
|
|
1331
|
+
|
|
1332
|
+
LAUNCH PATTERNS:
|
|
1333
|
+
hcom open 2 reviewer # 2 generic + 1 reviewer agent
|
|
1334
|
+
hcom open reviewer reviewer # 2 separate reviewer instances
|
|
1335
|
+
hcom open --prefix api 2 # Team naming: api-hova7, api-kolec
|
|
1336
|
+
hcom open test --claude-args "-p 'write tests'" # Pass 'claude' CLI flags
|
|
1337
|
+
|
|
1338
|
+
@MENTION TARGETING:
|
|
1339
|
+
hcom send "message" # Broadcasts to everyone
|
|
1340
|
+
hcom send "@api fix this" # Targets all api-* instances (api-hova7, api-kolec)
|
|
1341
|
+
hcom send "@hova7 status?" # Targets specific instance
|
|
1342
|
+
(Unmatched @mentions broadcast to everyone)
|
|
1343
|
+
|
|
1344
|
+
STATUS INDICATORS:
|
|
1345
|
+
• ◉ thinking, ▷ responding, ▶ executing - instance is working
|
|
1346
|
+
• ◉ waiting - instance is waiting for new messages (hcom send)
|
|
1347
|
+
• ■ blocked - instance is blocked by permission request (needs user approval)
|
|
1348
|
+
• ○ inactive - instance is inactive (timed out, disconnected, etc)
|
|
1349
|
+
|
|
1350
|
+
CONFIG:
|
|
1351
|
+
Environment overrides (temporary): HCOM_INSTANCE_HINTS="useful info" hcom send "hi"
|
|
1352
|
+
Config file (persistent): ~/.hcom/config.json
|
|
1353
|
+
|
|
1354
|
+
Key settings (all in config.json):
|
|
1355
|
+
terminal_mode: "new_window" | "same_terminal" | "show_commands"
|
|
1356
|
+
initial_prompt: "Say hi in chat", first_use_text: "Essential, concise messages only..."
|
|
1357
|
+
instance_hints: "", cli_hints: "" # Extra info for instances/CLI
|
|
1358
|
+
|
|
1359
|
+
EXPECT: Instance names are auto-generated (5-char format based on uuid: "hova7"). Check actual names
|
|
1360
|
+
with 'hcom watch --status'. Instances respond automatically in shared chat.""")
|
|
1361
|
+
|
|
1302
1362
|
return 0
|
|
1303
1363
|
|
|
1304
1364
|
def cmd_open(*args):
|
|
@@ -1786,6 +1846,19 @@ def cmd_send(message):
|
|
|
1786
1846
|
print(f"Error: {error}", file=sys.stderr)
|
|
1787
1847
|
return 1
|
|
1788
1848
|
|
|
1849
|
+
# Check for unmatched mentions (minimal warning)
|
|
1850
|
+
mentions = MENTION_PATTERN.findall(message)
|
|
1851
|
+
if mentions and pos_file.exists():
|
|
1852
|
+
try:
|
|
1853
|
+
positions = load_positions(pos_file)
|
|
1854
|
+
all_instances = list(positions.keys())
|
|
1855
|
+
unmatched = [m for m in mentions
|
|
1856
|
+
if not any(name.lower().startswith(m.lower()) for name in all_instances)]
|
|
1857
|
+
if unmatched:
|
|
1858
|
+
print(f"Note: @{', @'.join(unmatched)} don't match any instances - broadcasting to all")
|
|
1859
|
+
except Exception:
|
|
1860
|
+
pass # Don't fail on warning
|
|
1861
|
+
|
|
1789
1862
|
# Send message
|
|
1790
1863
|
sender_name = get_config_value('sender_name', 'bigboss')
|
|
1791
1864
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: hcom
|
|
3
|
-
Version: 0.1.
|
|
3
|
+
Version: 0.1.8
|
|
4
4
|
Summary: Lightweight CLI tool for real-time communication between Claude Code subagents using hooks
|
|
5
5
|
Author-email: aannoo <your@email.com>
|
|
6
6
|
License: MIT
|
|
@@ -92,7 +92,7 @@ hcom open test-writer --claude-args "-p 'write tests for any new code'"
|
|
|
92
92
|
hcom open reviewer --claude-args "-p 'review when @mentioned'"
|
|
93
93
|
|
|
94
94
|
# Pass multiple Claude flags
|
|
95
|
-
hcom open orchestrator --claude-args "--model
|
|
95
|
+
hcom open orchestrator --claude-args "--model sonnet
|
|
96
96
|
--resume session_id"
|
|
97
97
|
|
|
98
98
|
# Launch in specific directories
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|