hcom 0.1.6__py3-none-any.whl → 0.1.7__py3-none-any.whl

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/__init__.py CHANGED
@@ -1,3 +1,3 @@
1
1
  """Claude Hook Comms - Real-time messaging between Claude Code agents."""
2
2
 
3
- __version__ = "0.1.5"
3
+ __version__ = "0.1.7"
hcom/__main__.py CHANGED
@@ -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
- for mention in mentions:
278
- if instance_name.lower().startswith(mention.lower()):
279
- return True
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
282
+
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
280
291
 
281
- return False
292
+ return False # This instance doesn't match, but others might
282
293
 
283
294
  # ==================== Parsing and Helper Functions ====================
284
295
 
@@ -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
@@ -1284,18 +1296,21 @@ def cmd_help():
1284
1296
 
1285
1297
  Usage:
1286
1298
  hcom open [n] Launch n Claude instances
1287
- hcom open --prefix name n Launch with name prefix
1299
+ hcom open <agent> Launch named agent from .claude/agents/
1300
+ hcom open --prefix <team> n Launch n instances with team prefix
1288
1301
  hcom watch View conversation dashboard
1289
- hcom clear Clear and archive conversation
1290
- hcom cleanup Remove hooks from current directory
1291
- hcom cleanup --all Remove hooks from all tracked directories
1292
- hcom help Show this help
1302
+ hcom clear Clear and archive conversation
1303
+ hcom cleanup Remove hooks from current directory
1304
+ hcom cleanup --all Remove hooks from all tracked directories
1305
+ hcom help Show this help
1293
1306
 
1294
1307
  Automation:
1295
- hcom send 'msg' Send message
1296
- hcom send '@prefix msg' Send to specific instances
1297
- hcom watch --logs Show logs
1298
- hcom watch --status Show status""")
1308
+ hcom send 'msg' Send message
1309
+ hcom send '@prefix msg' Send to specific instances
1310
+ hcom watch --logs Show logs
1311
+ hcom watch --status Show status
1312
+
1313
+ Docs: https://raw.githubusercontent.com/aannoo/claude-hook-comms/main/README.md""")
1299
1314
  return 0
1300
1315
 
1301
1316
  def cmd_open(*args):
@@ -1783,6 +1798,19 @@ def cmd_send(message):
1783
1798
  print(f"Error: {error}", file=sys.stderr)
1784
1799
  return 1
1785
1800
 
1801
+ # Check for unmatched mentions (minimal warning)
1802
+ mentions = MENTION_PATTERN.findall(message)
1803
+ if mentions and pos_file.exists():
1804
+ try:
1805
+ positions = load_positions(pos_file)
1806
+ all_instances = list(positions.keys())
1807
+ unmatched = [m for m in mentions
1808
+ if not any(name.lower().startswith(m.lower()) for name in all_instances)]
1809
+ if unmatched:
1810
+ print(f"Note: @{', @'.join(unmatched)} don't match any instances - broadcasting to all")
1811
+ except Exception:
1812
+ pass # Don't fail on warning
1813
+
1786
1814
  # Send message
1787
1815
  sender_name = get_config_value('sender_name', 'bigboss')
1788
1816
 
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: hcom
3
- Version: 0.1.6
3
+ Version: 0.1.7
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
@@ -100,11 +100,12 @@ cd backend && hcom open api-specialist
100
100
  cd ../frontend && hcom open ui-specialist
101
101
 
102
102
  # Create named teams that can be @mentioned
103
- cd ~/api && hcom open --prefix api debugger
104
- cd ~/auth && hcom open --prefix auth debugger
103
+ cd ~/api && hcom open --prefix api debugger # Creates api-hovoa7
104
+ cd ~/auth && hcom open --prefix auth debugger # Creates auth-hovob8
105
105
 
106
- # Message specific teams
107
- hcom send "@api login works but API fails" # or in dashboard: hcom watch
106
+ # Message specific teams or instances
107
+ hcom send "@api login works but API fails" # Messages all api-* instances
108
+ hcom send "@hovoa7 can you check this?" # Message specific instance by name
108
109
  ```
109
110
 
110
111
 
@@ -120,7 +121,7 @@ hcom send "@api login works but API fails" # or in dashboard: hcom watch
120
121
  ### Automation Commands
121
122
  | Command | Description |
122
123
  |---------|-------------|
123
- | `hcom send 'message'` | Send message |
124
+ | `hcom send 'message'` | Send message to chat |
124
125
  | `hcom watch --logs` | View message history (non-interactive) |
125
126
  | `hcom watch --status` | Show instance status (non-interactive) |
126
127
  | `hcom watch --wait [timeout]` | Wait and notify for new messages |
@@ -195,7 +196,7 @@ HCOM_MAX_MESSAGE_SIZE=8192 hcom send "$(cat long_report.txt)"
195
196
 
196
197
  hcom adds hooks to your project directory's `.claude/settings.local.json`:
197
198
 
198
- 1. **Sending**: Claude writes messages with `echo "HCOM_SEND:message"` - captured by PostToolUse hook
199
+ 1. **Sending**: Claude agents use `echo "HCOM_SEND:message"` internally (you use `hcom send` from terminal)
199
200
  2. **Receiving**: Other Claudes get notified via Stop hook
200
201
  3. **Waiting**: Stop hook keeps Claude in a waiting state for new messages
201
202
 
@@ -0,0 +1,7 @@
1
+ hcom/__init__.py,sha256=yxqzLIr5XxsUrfSe-inggLeqMM300Z4PrewklOE1FCk,96
2
+ hcom/__main__.py,sha256=VsTjMMUpknJ_D638HT9KrLX7Aid0c9dPq8p020c5gZA,75178
3
+ hcom-0.1.7.dist-info/METADATA,sha256=rYV5yFW1j2FFvxKSvKrSKzGSq3FzFrM3pD04x2xRpwY,10370
4
+ hcom-0.1.7.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
5
+ hcom-0.1.7.dist-info/entry_points.txt,sha256=cz9K9PsgYmORUxNKxVRrpxLS3cxRJcDZkE-PpfvOhI8,44
6
+ hcom-0.1.7.dist-info/top_level.txt,sha256=8AS1nVUWA26vxjDQ5viRxgJnwSvUWk1W6GP4g6ldZ-0,5
7
+ hcom-0.1.7.dist-info/RECORD,,
@@ -1,7 +0,0 @@
1
- hcom/__init__.py,sha256=21Stc_3iuK1pjO6Nhkq7JmBYyatpk5yhMR0iSZ9U7eA,96
2
- hcom/__main__.py,sha256=wrCu0v2Ap36nUHZJSSGO6LtzKSEAK4AYFiXniGDpzco,73776
3
- hcom-0.1.6.dist-info/METADATA,sha256=7jqHjBIqhB8RV231IG-7m0QD1Xm6bFJ4qCO75MjoBGE,10216
4
- hcom-0.1.6.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
5
- hcom-0.1.6.dist-info/entry_points.txt,sha256=cz9K9PsgYmORUxNKxVRrpxLS3cxRJcDZkE-PpfvOhI8,44
6
- hcom-0.1.6.dist-info/top_level.txt,sha256=8AS1nVUWA26vxjDQ5viRxgJnwSvUWk1W6GP4g6ldZ-0,5
7
- hcom-0.1.6.dist-info/RECORD,,
File without changes