claude-mpm 5.4.99__py3-none-any.whl → 5.4.101__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.
- claude_mpm/VERSION +1 -1
- claude_mpm/cli/commands/autotodos.py +43 -3
- claude_mpm/core/config.py +5 -0
- claude_mpm/hooks/claude_hooks/__pycache__/event_handlers.cpython-311.pyc +0 -0
- claude_mpm/hooks/claude_hooks/event_handlers.py +34 -0
- claude_mpm/hooks/claude_hooks/services/__pycache__/connection_manager.cpython-311.pyc +0 -0
- claude_mpm/services/event_log.py +8 -0
- {claude_mpm-5.4.99.dist-info → claude_mpm-5.4.101.dist-info}/METADATA +1 -1
- {claude_mpm-5.4.99.dist-info → claude_mpm-5.4.101.dist-info}/RECORD +14 -13
- {claude_mpm-5.4.99.dist-info → claude_mpm-5.4.101.dist-info}/WHEEL +0 -0
- {claude_mpm-5.4.99.dist-info → claude_mpm-5.4.101.dist-info}/entry_points.txt +0 -0
- {claude_mpm-5.4.99.dist-info → claude_mpm-5.4.101.dist-info}/licenses/LICENSE +0 -0
- {claude_mpm-5.4.99.dist-info → claude_mpm-5.4.101.dist-info}/licenses/LICENSE-FAQ.md +0 -0
- {claude_mpm-5.4.99.dist-info → claude_mpm-5.4.101.dist-info}/top_level.txt +0 -0
claude_mpm/VERSION
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
5.4.
|
|
1
|
+
5.4.101
|
|
@@ -16,7 +16,7 @@ DESIGN DECISION: Event-driven architecture
|
|
|
16
16
|
import json
|
|
17
17
|
from datetime import datetime, timezone
|
|
18
18
|
from pathlib import Path
|
|
19
|
-
from typing import Any, Dict, List
|
|
19
|
+
from typing import Any, Dict, List, Optional
|
|
20
20
|
|
|
21
21
|
import click
|
|
22
22
|
|
|
@@ -101,13 +101,16 @@ def format_delegation_event_as_todo(event: Dict[str, Any]) -> Dict[str, str]:
|
|
|
101
101
|
}
|
|
102
102
|
|
|
103
103
|
|
|
104
|
-
def get_autotodos() -> List[Dict[str, Any]]:
|
|
104
|
+
def get_autotodos(max_todos: int = 100) -> List[Dict[str, Any]]:
|
|
105
105
|
"""Get all pending hook error events formatted as todos.
|
|
106
106
|
|
|
107
107
|
DESIGN DECISION: Only autotodo.error events are returned
|
|
108
108
|
- autotodo.error = Script/coding failures → PM should delegate fix
|
|
109
109
|
- pm.violation = Delegation anti-patterns → PM behavior error (not todo)
|
|
110
110
|
|
|
111
|
+
Args:
|
|
112
|
+
max_todos: Maximum number of todos to return (default: 100)
|
|
113
|
+
|
|
111
114
|
Returns:
|
|
112
115
|
List of todo dictionaries ready for PM injection
|
|
113
116
|
"""
|
|
@@ -119,7 +122,44 @@ def get_autotodos() -> List[Dict[str, Any]]:
|
|
|
119
122
|
event_type="autotodo.error", status="pending"
|
|
120
123
|
)
|
|
121
124
|
|
|
122
|
-
for event in pending_error_events:
|
|
125
|
+
for event in pending_error_events[:max_todos]:
|
|
126
|
+
todo = format_error_event_as_todo(event)
|
|
127
|
+
todos.append(todo)
|
|
128
|
+
|
|
129
|
+
return todos
|
|
130
|
+
|
|
131
|
+
|
|
132
|
+
def get_pending_todos(
|
|
133
|
+
max_todos: int = 10, working_dir: Optional[Path] = None
|
|
134
|
+
) -> List[Dict[str, Any]]:
|
|
135
|
+
"""Get pending autotodo errors for injection.
|
|
136
|
+
|
|
137
|
+
WHY this function exists:
|
|
138
|
+
- Provides a consistent API for retrieving pending autotodos
|
|
139
|
+
- Used by CLI inject command AND SessionStart hook
|
|
140
|
+
- Supports limiting number of todos to avoid overwhelming PM
|
|
141
|
+
|
|
142
|
+
Args:
|
|
143
|
+
max_todos: Maximum number of todos to return (default: 10)
|
|
144
|
+
working_dir: Working directory to use for event log path (default: Path.cwd())
|
|
145
|
+
|
|
146
|
+
Returns:
|
|
147
|
+
List of todo dicts with content, activeForm, status, metadata
|
|
148
|
+
"""
|
|
149
|
+
# Construct log file path from working_dir if provided
|
|
150
|
+
log_file = None
|
|
151
|
+
if working_dir:
|
|
152
|
+
log_file = Path(working_dir) / ".claude-mpm" / "event_log.json"
|
|
153
|
+
|
|
154
|
+
event_log = get_event_log(log_file)
|
|
155
|
+
todos = []
|
|
156
|
+
|
|
157
|
+
# Get all pending autotodo.error events (script failures)
|
|
158
|
+
pending_error_events = event_log.list_events(
|
|
159
|
+
event_type="autotodo.error", status="pending"
|
|
160
|
+
)
|
|
161
|
+
|
|
162
|
+
for event in pending_error_events[:max_todos]:
|
|
123
163
|
todo = format_error_event_as_todo(event)
|
|
124
164
|
todos.append(todo)
|
|
125
165
|
|
claude_mpm/core/config.py
CHANGED
|
@@ -605,6 +605,11 @@ class Config:
|
|
|
605
605
|
"sync_interval": "startup", # Options: "startup", "hourly", "daily", "manual"
|
|
606
606
|
"cache_dir": str(Path.home() / ".claude-mpm" / "cache" / "agents"),
|
|
607
607
|
},
|
|
608
|
+
# Autotodos configuration
|
|
609
|
+
"autotodos": {
|
|
610
|
+
"auto_inject_on_startup": True, # Auto-inject pending todos on PM session start
|
|
611
|
+
"max_todos_per_session": 10, # Max todos to inject per session
|
|
612
|
+
},
|
|
608
613
|
}
|
|
609
614
|
|
|
610
615
|
# Apply defaults for missing keys
|
|
Binary file
|
|
@@ -949,6 +949,7 @@ class EventHandlers:
|
|
|
949
949
|
- Provides visibility into new conversation sessions
|
|
950
950
|
- Enables tracking of session lifecycle and duration
|
|
951
951
|
- Useful for monitoring concurrent sessions and resource usage
|
|
952
|
+
- Auto-inject pending autotodos if enabled in config
|
|
952
953
|
"""
|
|
953
954
|
session_id = event.get("session_id", "")
|
|
954
955
|
working_dir = event.get("cwd", "")
|
|
@@ -962,6 +963,39 @@ class EventHandlers:
|
|
|
962
963
|
"hook_event_name": "SessionStart",
|
|
963
964
|
}
|
|
964
965
|
|
|
966
|
+
# Auto-inject pending autotodos if enabled
|
|
967
|
+
try:
|
|
968
|
+
from pathlib import Path
|
|
969
|
+
|
|
970
|
+
from claude_mpm.cli.commands.autotodos import get_pending_todos
|
|
971
|
+
from claude_mpm.core.config import Config
|
|
972
|
+
|
|
973
|
+
config = Config()
|
|
974
|
+
auto_inject_enabled = config.get("autotodos.auto_inject_on_startup", True)
|
|
975
|
+
max_todos = config.get("autotodos.max_todos_per_session", 10)
|
|
976
|
+
|
|
977
|
+
if auto_inject_enabled:
|
|
978
|
+
# Pass working directory from event to avoid Path.cwd() issues
|
|
979
|
+
working_dir_param = None
|
|
980
|
+
if working_dir:
|
|
981
|
+
working_dir_param = Path(working_dir)
|
|
982
|
+
|
|
983
|
+
pending_todos = get_pending_todos(
|
|
984
|
+
max_todos=max_todos, working_dir=working_dir_param
|
|
985
|
+
)
|
|
986
|
+
if pending_todos:
|
|
987
|
+
session_start_data["pending_autotodos"] = pending_todos
|
|
988
|
+
session_start_data["autotodos_count"] = len(pending_todos)
|
|
989
|
+
if DEBUG:
|
|
990
|
+
print(
|
|
991
|
+
f" - Auto-injected {len(pending_todos)} pending autotodos",
|
|
992
|
+
file=sys.stderr,
|
|
993
|
+
)
|
|
994
|
+
except Exception as e: # nosec B110
|
|
995
|
+
# Auto-injection is optional - continue if it fails
|
|
996
|
+
if DEBUG:
|
|
997
|
+
print(f" - Failed to auto-inject autotodos: {e}", file=sys.stderr)
|
|
998
|
+
|
|
965
999
|
# Debug logging
|
|
966
1000
|
if DEBUG:
|
|
967
1001
|
print(
|
|
Binary file
|
claude_mpm/services/event_log.py
CHANGED
|
@@ -310,8 +310,16 @@ def get_event_log(log_file: Optional[Path] = None) -> EventLog:
|
|
|
310
310
|
|
|
311
311
|
Returns:
|
|
312
312
|
EventLog instance
|
|
313
|
+
|
|
314
|
+
Note:
|
|
315
|
+
If log_file is provided and differs from the current instance,
|
|
316
|
+
a new EventLog is created and replaces the global instance.
|
|
317
|
+
This allows hooks to use project-specific event logs.
|
|
313
318
|
"""
|
|
314
319
|
global _event_log
|
|
315
320
|
if _event_log is None:
|
|
316
321
|
_event_log = EventLog(log_file)
|
|
322
|
+
elif log_file is not None and _event_log.log_file != log_file:
|
|
323
|
+
# Create new instance if log file differs from current
|
|
324
|
+
_event_log = EventLog(log_file)
|
|
317
325
|
return _event_log
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
claude_mpm/BUILD_NUMBER,sha256=9JfxhnDtr-8l3kCP2U5TVXSErptHoga8m7XA8zqgGOc,4
|
|
2
|
-
claude_mpm/VERSION,sha256=
|
|
2
|
+
claude_mpm/VERSION,sha256=7uiIfp7M7ZlTKcn8sVbkpSxsQFNScL0dijhJ4CJP95s,8
|
|
3
3
|
claude_mpm/__init__.py,sha256=AGfh00BHKvLYD-UVFw7qbKtl7NMRIzRXOWw7vEuZ-h4,2214
|
|
4
4
|
claude_mpm/__main__.py,sha256=Ro5UBWBoQaSAIoSqWAr7zkbLyvi4sSy28WShqAhKJG0,723
|
|
5
5
|
claude_mpm/constants.py,sha256=pz3lTrZZR5HhV3eZzYtIbtBwWo7iM6pkBHP_ixxmI6Y,6827
|
|
@@ -58,7 +58,7 @@ claude_mpm/cli/commands/aggregate.py,sha256=v5JzzoWf6Omc4DaWfx_3gm5EWiUmUp6ps3Bd
|
|
|
58
58
|
claude_mpm/cli/commands/analyze.py,sha256=NuSreG9PINgf_1_41adMT_sOXz-z695Zqjwef4OEc9w,19162
|
|
59
59
|
claude_mpm/cli/commands/analyze_code.py,sha256=5FAoubjZbEO_GlErj3xNgNbJXBjhtqSOWE2FkhAzTaM,17256
|
|
60
60
|
claude_mpm/cli/commands/auto_configure.py,sha256=0Suzil6O0SBNeHUCwHOkt2q7gfuXRTyUu2UC99cCG4Y,40567
|
|
61
|
-
claude_mpm/cli/commands/autotodos.py,sha256=
|
|
61
|
+
claude_mpm/cli/commands/autotodos.py,sha256=mm2R6dIfHOjAMCgFkjfjBzdFQ-ou19b_R3Lo0Vi8vCI,19428
|
|
62
62
|
claude_mpm/cli/commands/cleanup.py,sha256=RQikOGLuLFWXzjeoHArdr5FA4Pf7tSK9w2NXL4vCrok,19769
|
|
63
63
|
claude_mpm/cli/commands/cleanup_orphaned_agents.py,sha256=JR8crvgrz7Sa6d-SI-gKywok5S9rwc_DzDVk_h85sVs,4467
|
|
64
64
|
claude_mpm/cli/commands/config.py,sha256=2M9VUPYcQkBUCIyyB-v1qTL3xYvao9YI2l_JGBUDauA,23374
|
|
@@ -180,7 +180,7 @@ claude_mpm/core/api_validator.py,sha256=zxeUykC2asy1KwHBDu5w3Eoo64E51PJyNe4PT7CT
|
|
|
180
180
|
claude_mpm/core/base_service.py,sha256=4Zrt-vQ6g_KVk4hEfvd4QccuItYoOf7wUHCimIW6zJQ,29953
|
|
181
181
|
claude_mpm/core/cache.py,sha256=orh8B40oYnRRGmXdANR4P4f-KVMIHV0vg7vrsemk0no,17232
|
|
182
182
|
claude_mpm/core/claude_runner.py,sha256=Wle-wI-ag25oC0EYX3n8dDC56I5GIdbpi5NtvT4IgBw,34263
|
|
183
|
-
claude_mpm/core/config.py,sha256=
|
|
183
|
+
claude_mpm/core/config.py,sha256=IGhNAkq8qtoIcayrIqGH0GY64S_J4nzQ1xN4p4LDpNw,42748
|
|
184
184
|
claude_mpm/core/config_aliases.py,sha256=QpNNECkTY4TYYAhVlFZvB-msPnZrui90g19u0-v0HDE,9703
|
|
185
185
|
claude_mpm/core/config_constants.py,sha256=MEF35Y2Lj5FMzRdhgSgZrZeTzHfCzistPGZVY8INta4,10073
|
|
186
186
|
claude_mpm/core/constants.py,sha256=tm6IkmDxnsEqdEImtdQOeWvvGEHrThWCgAz5FMjckCQ,11557
|
|
@@ -336,7 +336,7 @@ claude_mpm/hooks/claude_hooks/__init__.py,sha256=b4mud_g3S-3itHY_Dzpbb_SmdMEcJwt
|
|
|
336
336
|
claude_mpm/hooks/claude_hooks/auto_pause_handler.py,sha256=xDAQZ33I5OhGvtWvA9mxwVSoir9tM-aCvrWkSRdnVmU,17465
|
|
337
337
|
claude_mpm/hooks/claude_hooks/connection_pool.py,sha256=vpi-XbVf61GWhh85tHBzubbOgbJly_I-5-QmsleND2M,8658
|
|
338
338
|
claude_mpm/hooks/claude_hooks/correlation_manager.py,sha256=3n-RxzqE8egG4max_NcpJgL9gzrBY6Ti529LrjleI1g,2033
|
|
339
|
-
claude_mpm/hooks/claude_hooks/event_handlers.py,sha256=
|
|
339
|
+
claude_mpm/hooks/claude_hooks/event_handlers.py,sha256=_GUOe9urO9RVIaOWSNXv2F_di4D7SaePjxONyd37das,47019
|
|
340
340
|
claude_mpm/hooks/claude_hooks/hook_handler.py,sha256=R2RhUoRvI0q_EGu-d5L9bH7cGg5_OLDskQoNrl3JsU0,28504
|
|
341
341
|
claude_mpm/hooks/claude_hooks/hook_wrapper.sh,sha256=4lG3TlLVoVfTJipPj1X_ICUlS-KpnkbUp1U3oSq80Bw,2476
|
|
342
342
|
claude_mpm/hooks/claude_hooks/installer.py,sha256=VbvVGMcrmCXQB3Pf9zOdjeGET2AFqbUDMHDy5KXuvz0,30463
|
|
@@ -346,7 +346,7 @@ claude_mpm/hooks/claude_hooks/tool_analysis.py,sha256=3_o2PP9D7wEMwLriCtIBOw0cj2
|
|
|
346
346
|
claude_mpm/hooks/claude_hooks/__pycache__/__init__.cpython-311.pyc,sha256=EGpgXqhPM0iRRZtCqHaLVQ6wDH42OH_M7Gt5GiFLyro,346
|
|
347
347
|
claude_mpm/hooks/claude_hooks/__pycache__/auto_pause_handler.cpython-311.pyc,sha256=X7A8O4KPXkuDaLDFbF7Izi1qVDyS0tQjHVo1xy_HzNQ,21172
|
|
348
348
|
claude_mpm/hooks/claude_hooks/__pycache__/correlation_manager.cpython-311.pyc,sha256=SQX5iiP9bQZkLL-cj_2tlGH7lpAzarO0mYal7btj3tc,3521
|
|
349
|
-
claude_mpm/hooks/claude_hooks/__pycache__/event_handlers.cpython-311.pyc,sha256=
|
|
349
|
+
claude_mpm/hooks/claude_hooks/__pycache__/event_handlers.cpython-311.pyc,sha256=76VtByCuOr7L1_snjeHo1iWDyD2QyvoMpAj1hrSq4-Q,45735
|
|
350
350
|
claude_mpm/hooks/claude_hooks/__pycache__/hook_handler.cpython-311.pyc,sha256=ehLm68zhDmqOwzr1Di6xYjGuE9SRg0mvKePQfepuuQ4,30577
|
|
351
351
|
claude_mpm/hooks/claude_hooks/__pycache__/installer.cpython-311.pyc,sha256=9mpAKY4gNcbU5VvZ5tGbf2UM0uIEWdreKSUvVr_BKcM,33917
|
|
352
352
|
claude_mpm/hooks/claude_hooks/__pycache__/memory_integration.cpython-311.pyc,sha256=YbwauQDKSGvXkT1972faalJLuxwyvq328DYQhkCnel0,10513
|
|
@@ -359,6 +359,7 @@ claude_mpm/hooks/claude_hooks/services/duplicate_detector.py,sha256=Fh9LmEMsVmQM
|
|
|
359
359
|
claude_mpm/hooks/claude_hooks/services/state_manager.py,sha256=QB0JPJQThTVg0TGRO3Dc_3y3bac-hkulgMqqzo_71ng,11189
|
|
360
360
|
claude_mpm/hooks/claude_hooks/services/subagent_processor.py,sha256=nJw1ERCMxq23ioZ5DKwprmwO0fuvuqpdFHJ03XaMiDo,16052
|
|
361
361
|
claude_mpm/hooks/claude_hooks/services/__pycache__/__init__.cpython-311.pyc,sha256=xBfLBSqnpcKfcQBWfh7xUm454g1lq1LvbO7SxGvcOPc,644
|
|
362
|
+
claude_mpm/hooks/claude_hooks/services/__pycache__/connection_manager.cpython-311.pyc,sha256=9BnGRXKqMq5FI3vqUlho0NyMxJTiMD_Pn560x-4kNh4,10513
|
|
362
363
|
claude_mpm/hooks/claude_hooks/services/__pycache__/connection_manager_http.cpython-311.pyc,sha256=xN6QYqLTQ9I9qPDKsSikhAhncXrxYemjfQp4wLiiq9M,9774
|
|
363
364
|
claude_mpm/hooks/claude_hooks/services/__pycache__/duplicate_detector.cpython-311.pyc,sha256=Yy_REAUhJCiFjOhxeDb4v0qyEvEbUtCmXD9PAz40dhw,5321
|
|
364
365
|
claude_mpm/hooks/claude_hooks/services/__pycache__/state_manager.cpython-311.pyc,sha256=TPkEc-Zi3oNS5dCXBpGbSZwg_8RQvzNzd4pVx9B3WeM,12364
|
|
@@ -389,7 +390,7 @@ claude_mpm/services/command_deployment_service.py,sha256=GgSxRehQY-PR-yeztz9WP8w
|
|
|
389
390
|
claude_mpm/services/command_handler_service.py,sha256=8iru6eRdQloXrGiE75E1zoUbD_Ajldu3sw17Yx772Lw,7280
|
|
390
391
|
claude_mpm/services/delegation_detector.py,sha256=ZpElqjhTbuEeeTjTMUsl-G1lHMJ9m1g-6orM3t7wNfM,6168
|
|
391
392
|
claude_mpm/services/event_aggregator.py,sha256=V_5Wln1RzozLMDZawIPl5gSjIN5KHniNPaaSP11Lihc,20251
|
|
392
|
-
claude_mpm/services/event_log.py,sha256=
|
|
393
|
+
claude_mpm/services/event_log.py,sha256=pMKc8p2lXRoRi_cvVxaU1uNuUCNrGc0EXqBv8TeueyI,10043
|
|
393
394
|
claude_mpm/services/exceptions.py,sha256=5lVZETr_6-xk0ItH7BTfYUiX5RlckS1e8ah_UalYG9c,26475
|
|
394
395
|
claude_mpm/services/hook_installer_service.py,sha256=x3H3bFVlmhK4Ue1K279f44lwMEw3W1p3zoETGfjIH_w,19708
|
|
395
396
|
claude_mpm/services/hook_service.py,sha256=I6JILbackBsdvrDNQ9TeGSB7XNqozNRP26T4E9_ROtU,15693
|
|
@@ -997,10 +998,10 @@ claude_mpm/utils/subprocess_utils.py,sha256=D0izRT8anjiUb_JG72zlJR_JAw1cDkb7kalN
|
|
|
997
998
|
claude_mpm/validation/__init__.py,sha256=YZhwE3mhit-lslvRLuwfX82xJ_k4haZeKmh4IWaVwtk,156
|
|
998
999
|
claude_mpm/validation/agent_validator.py,sha256=GprtAvu80VyMXcKGsK_VhYiXWA6BjKHv7O6HKx0AB9w,20917
|
|
999
1000
|
claude_mpm/validation/frontmatter_validator.py,sha256=YpJlYNNYcV8u6hIOi3_jaRsDnzhbcQpjCBE6eyBKaFY,7076
|
|
1000
|
-
claude_mpm-5.4.
|
|
1001
|
-
claude_mpm-5.4.
|
|
1002
|
-
claude_mpm-5.4.
|
|
1003
|
-
claude_mpm-5.4.
|
|
1004
|
-
claude_mpm-5.4.
|
|
1005
|
-
claude_mpm-5.4.
|
|
1006
|
-
claude_mpm-5.4.
|
|
1001
|
+
claude_mpm-5.4.101.dist-info/licenses/LICENSE,sha256=ca3y_Rk4aPrbF6f62z8Ht5MJM9OAvbGlHvEDcj9vUQ4,3867
|
|
1002
|
+
claude_mpm-5.4.101.dist-info/licenses/LICENSE-FAQ.md,sha256=TxfEkXVCK98RzDOer09puc7JVCP_q_bN4dHtZKHCMcM,5104
|
|
1003
|
+
claude_mpm-5.4.101.dist-info/METADATA,sha256=EcAf5IvBn4Rh-1LQeXukAQkwnYbxaMJAVrRuXE5LD6c,14350
|
|
1004
|
+
claude_mpm-5.4.101.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
|
|
1005
|
+
claude_mpm-5.4.101.dist-info/entry_points.txt,sha256=n-Uk4vwHPpuvu-g_I7-GHORzTnN_m6iyOsoLveKKD0E,228
|
|
1006
|
+
claude_mpm-5.4.101.dist-info/top_level.txt,sha256=1nUg3FEaBySgm8t-s54jK5zoPnu3_eY6EP6IOlekyHA,11
|
|
1007
|
+
claude_mpm-5.4.101.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|