claude-mpm 5.6.14__py3-none-any.whl → 5.6.15__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 CHANGED
@@ -1 +1 @@
1
- 5.6.14
1
+ 5.6.15
@@ -1,5 +1,7 @@
1
1
  """Claude runner with both exec and subprocess launch methods."""
2
2
 
3
+ import hashlib
4
+ import json
3
5
  import os
4
6
  from pathlib import Path
5
7
  from typing import Optional
@@ -211,9 +213,137 @@ class ClaudeRunner:
211
213
  }
212
214
  )
213
215
 
216
+ def _get_deployment_state_path(self) -> Path:
217
+ """Get path to deployment state file."""
218
+ return Path.cwd() / ".claude" / "agents" / ".deployment-state.json"
219
+
220
+ def _calculate_deployment_hash(self, agents_dir: Path) -> str:
221
+ """Calculate hash of all agent files for change detection.
222
+
223
+ Args:
224
+ agents_dir: Directory containing agent .md files
225
+
226
+ Returns:
227
+ SHA256 hash of agent file contents
228
+ """
229
+ if not agents_dir.exists():
230
+ return ""
231
+
232
+ # Get all .md files sorted for consistent hashing
233
+ agent_files = sorted(agents_dir.glob("*.md"))
234
+
235
+ hash_obj = hashlib.sha256()
236
+ for agent_file in agent_files:
237
+ # Include filename and content in hash
238
+ hash_obj.update(agent_file.name.encode())
239
+ try:
240
+ hash_obj.update(agent_file.read_bytes())
241
+ except Exception as e:
242
+ self.logger.debug(f"Error reading {agent_file} for hash: {e}")
243
+
244
+ return hash_obj.hexdigest()
245
+
246
+ def _check_deployment_state(self) -> bool:
247
+ """Check if agents are already deployed and up-to-date.
248
+
249
+ Returns:
250
+ True if agents are already deployed and match current version, False otherwise
251
+ """
252
+ state_file = self._get_deployment_state_path()
253
+ agents_dir = Path.cwd() / ".claude" / "agents"
254
+
255
+ # If state file doesn't exist, need to deploy
256
+ if not state_file.exists():
257
+ return False
258
+
259
+ # If agents directory doesn't exist, need to deploy
260
+ if not agents_dir.exists():
261
+ return False
262
+
263
+ try:
264
+ # Load deployment state
265
+ state_data = json.loads(state_file.read_text())
266
+
267
+ # Get current version from package
268
+ from claude_mpm import __version__
269
+
270
+ # Check if version matches
271
+ if state_data.get("version") != __version__:
272
+ self.logger.debug(
273
+ f"Version mismatch: {state_data.get('version')} != {__version__}"
274
+ )
275
+ return False
276
+
277
+ # Check if agent count and hash match
278
+ current_hash = self._calculate_deployment_hash(agents_dir)
279
+ stored_hash = state_data.get("deployment_hash", "")
280
+
281
+ if current_hash != stored_hash:
282
+ self.logger.debug("Agent deployment hash mismatch")
283
+ return False
284
+
285
+ # All checks passed - agents are already deployed
286
+ agent_count = state_data.get("agent_count", 0)
287
+ self.logger.debug(
288
+ f"Agents already deployed: {agent_count} agents (v{__version__})"
289
+ )
290
+ return True
291
+
292
+ except Exception as e:
293
+ self.logger.debug(f"Error checking deployment state: {e}")
294
+ return False
295
+
296
+ def _save_deployment_state(self, agent_count: int) -> None:
297
+ """Save current deployment state.
298
+
299
+ Args:
300
+ agent_count: Number of agents deployed
301
+ """
302
+ state_file = self._get_deployment_state_path()
303
+ agents_dir = Path.cwd() / ".claude" / "agents"
304
+
305
+ try:
306
+ import time
307
+
308
+ from claude_mpm import __version__
309
+
310
+ # Calculate deployment hash
311
+ deployment_hash = self._calculate_deployment_hash(agents_dir)
312
+
313
+ # Create state data
314
+ state_data = {
315
+ "version": __version__,
316
+ "agent_count": agent_count,
317
+ "deployment_hash": deployment_hash,
318
+ "deployed_at": time.time(),
319
+ }
320
+
321
+ # Ensure directory exists
322
+ state_file.parent.mkdir(parents=True, exist_ok=True)
323
+
324
+ # Write state file
325
+ state_file.write_text(json.dumps(state_data, indent=2))
326
+ self.logger.debug(f"Saved deployment state: {agent_count} agents")
327
+
328
+ except Exception as e:
329
+ self.logger.debug(f"Error saving deployment state: {e}")
330
+
214
331
  def setup_agents(self) -> bool:
215
332
  """Deploy native agents to .claude/agents/."""
216
333
  try:
334
+ # Check if agents are already deployed and up-to-date
335
+ if self._check_deployment_state():
336
+ agents_dir = Path.cwd() / ".claude" / "agents"
337
+ agent_count = len(list(agents_dir.glob("*.md")))
338
+ print(f"✓ Agents: {agent_count} cached")
339
+ if self.project_logger:
340
+ self.project_logger.log_system(
341
+ f"Agents already deployed: {agent_count} cached",
342
+ level="INFO",
343
+ component="deployment",
344
+ )
345
+ return True
346
+
217
347
  if self.project_logger:
218
348
  self.project_logger.log_system(
219
349
  "Starting agent deployment", level="INFO", component="deployment"
@@ -239,6 +369,12 @@ class ClaudeRunner:
239
369
 
240
370
  # Set Claude environment
241
371
  self.deployment_service.set_claude_environment()
372
+
373
+ # Save deployment state for future runs
374
+ agents_dir = Path.cwd() / ".claude" / "agents"
375
+ total_agents = len(list(agents_dir.glob("*.md")))
376
+ self._save_deployment_state(total_agents)
377
+
242
378
  return True
243
379
  self.logger.info("All agents already up to date")
244
380
  if self.project_logger:
@@ -247,6 +383,13 @@ class ClaudeRunner:
247
383
  level="INFO",
248
384
  component="deployment",
249
385
  )
386
+
387
+ # Save deployment state even if no changes
388
+ agents_dir = Path.cwd() / ".claude" / "agents"
389
+ if agents_dir.exists():
390
+ total_agents = len(list(agents_dir.glob("*.md")))
391
+ self._save_deployment_state(total_agents)
392
+
250
393
  return True
251
394
 
252
395
  except PermissionError as e:
@@ -0,0 +1,170 @@
1
+ ---
2
+ name: mpm-session-pause
3
+ description: Pause session and save current work state for later resume
4
+ user-invocable: true
5
+ version: "1.0.0"
6
+ category: mpm-command
7
+ tags: [mpm-command, session, pm-recommended]
8
+ ---
9
+
10
+ # /mpm-pause
11
+
12
+ Pause the current session and save all work state for later resume.
13
+
14
+ ## What This Does
15
+
16
+ When invoked, this skill:
17
+ 1. Captures current work state (todos, git status, context summary)
18
+ 2. Creates session file at `.claude-mpm/sessions/session-{timestamp}.md`
19
+ 3. Updates `.claude-mpm/sessions/LATEST-SESSION.txt` pointer
20
+ 4. Optionally commits session state to git
21
+ 5. Shows user the session file path for later resume
22
+
23
+ ## Usage
24
+
25
+ ```
26
+ /mpm-pause [optional message describing current work]
27
+ ```
28
+
29
+ **Examples:**
30
+ ```
31
+ /mpm-pause
32
+ /mpm-pause Working on authentication refactor, about to test login flow
33
+ /mpm-pause Need to context switch to urgent bug fix
34
+ ```
35
+
36
+ ## Implementation
37
+
38
+ **Execute the following Python code to pause the session:**
39
+
40
+ ```python
41
+ from pathlib import Path
42
+ from claude_mpm.services.cli.session_pause_manager import SessionPauseManager
43
+
44
+ # Optional: Get message from user's command
45
+ # If user provided message after /mpm-pause, extract it
46
+ # Otherwise, message = None
47
+
48
+ # Create session pause manager
49
+ manager = SessionPauseManager(project_path=Path.cwd())
50
+
51
+ # Create pause session
52
+ session_id = manager.create_pause_session(
53
+ message=message, # Optional context message
54
+ skip_commit=False, # Will commit to git if in a repo
55
+ export_path=None, # No additional export needed
56
+ )
57
+
58
+ # Report success to user
59
+ print(f"✅ Session paused successfully!")
60
+ print(f"")
61
+ print(f"Session ID: {session_id}")
62
+ print(f"Session files:")
63
+ print(f" - .claude-mpm/sessions/{session_id}.md (human-readable)")
64
+ print(f" - .claude-mpm/sessions/{session_id}.json (machine-readable)")
65
+ print(f" - .claude-mpm/sessions/{session_id}.yaml (config format)")
66
+ print(f"")
67
+ print(f"Quick resume:")
68
+ print(f" /mpm-resume")
69
+ print(f"")
70
+ print(f"View session context:")
71
+ print(f" cat .claude-mpm/sessions/LATEST-SESSION.txt")
72
+ print(f" cat .claude-mpm/sessions/{session_id}.md")
73
+ ```
74
+
75
+ ## What Gets Saved
76
+
77
+ **Session State:**
78
+ - Session ID and timestamp
79
+ - Current working directory
80
+ - Git branch, recent commits, and file status
81
+ - Primary task and current phase
82
+ - Context message (if provided)
83
+
84
+ **Resume Instructions:**
85
+ - Quick-start commands
86
+ - Validation commands
87
+ - Files to review
88
+
89
+ **File Formats:**
90
+ - `.md` - Human-readable markdown (for reading)
91
+ - `.json` - Machine-readable (for tooling)
92
+ - `.yaml` - Human-readable config (for editing)
93
+
94
+ ## Session File Location
95
+
96
+ All session files are stored in:
97
+ ```
98
+ .claude-mpm/sessions/
99
+ ├── LATEST-SESSION.txt # Pointer to most recent session
100
+ ├── session-YYYYMMDD-HHMMSS.md
101
+ ├── session-YYYYMMDD-HHMMSS.json
102
+ └── session-YYYYMMDD-HHMMSS.yaml
103
+ ```
104
+
105
+ ## Token Budget
106
+
107
+ **Token usage:** ~5-10k tokens to execute (2-5% of context budget)
108
+
109
+ **Benefit:** Saves all remaining context for future resume, allowing you to:
110
+ - Context switch to urgent tasks
111
+ - Take a break and resume later
112
+ - Archive current work state before major changes
113
+
114
+ ## Resume Later
115
+
116
+ To resume this session:
117
+ ```
118
+ /mpm-resume
119
+ ```
120
+
121
+ Or manually:
122
+ ```bash
123
+ cat .claude-mpm/sessions/LATEST-SESSION.txt
124
+ cat .claude-mpm/sessions/session-YYYYMMDD-HHMMSS.md
125
+ ```
126
+
127
+ ## Git Integration
128
+
129
+ If in a git repository, the session will be automatically committed with message:
130
+ ```
131
+ session: pause at YYYY-MM-DD HH:MM:SS
132
+
133
+ Session ID: session-YYYYMMDD-HHMMSS
134
+ Context: [your optional message]
135
+ ```
136
+
137
+ ## Use Cases
138
+
139
+ **Context switching:**
140
+ ```
141
+ /mpm-pause Switching to urgent production bug
142
+ ```
143
+
144
+ **End of work session:**
145
+ ```
146
+ /mpm-pause Completed API refactor, ready for testing tomorrow
147
+ ```
148
+
149
+ **Before major changes:**
150
+ ```
151
+ /mpm-pause Saving state before attempting risky refactor
152
+ ```
153
+
154
+ **When approaching context limit:**
155
+ ```
156
+ /mpm-pause Hit 150k tokens, starting fresh session
157
+ ```
158
+
159
+ ## Related Commands
160
+
161
+ - `/mpm-resume` - Resume from most recent paused session
162
+ - `/mpm-init resume` - Alternative resume command
163
+ - See `docs/features/session-auto-resume.md` for auto-pause behavior
164
+
165
+ ## Notes
166
+
167
+ - Session files are project-local (not synced across machines)
168
+ - Git commit is optional (automatically skipped if not a repo)
169
+ - LATEST-SESSION.txt always points to most recent session
170
+ - Session format compatible with auto-pause feature (70% context trigger)
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: claude-mpm
3
- Version: 5.6.14
3
+ Version: 5.6.15
4
4
  Summary: Claude Multi-Agent Project Manager - Orchestrate Claude with agent delegation and ticket tracking
5
5
  Author-email: Bob Matsuoka <bob@matsuoka.com>
6
6
  Maintainer: Claude MPM Team
@@ -1,5 +1,5 @@
1
1
  claude_mpm/BUILD_NUMBER,sha256=9JfxhnDtr-8l3kCP2U5TVXSErptHoga8m7XA8zqgGOc,4
2
- claude_mpm/VERSION,sha256=N3JXgSQF14_WNnDj_WQaXFRyVIXk9kjTMKcZXD7xw-M,7
2
+ claude_mpm/VERSION,sha256=lmdMySaW5TqBtIgJf9AVG6eb87dY9SfKu-1p6Ru0_JI,7
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
@@ -271,7 +271,7 @@ claude_mpm/core/agent_session_manager.py,sha256=F10LS-nyTQxzMP3fkhbI94klsJy5xpSA
271
271
  claude_mpm/core/api_validator.py,sha256=zxeUykC2asy1KwHBDu5w3Eoo64E51PJyNe4PT7CTJf0,12282
272
272
  claude_mpm/core/base_service.py,sha256=4Zrt-vQ6g_KVk4hEfvd4QccuItYoOf7wUHCimIW6zJQ,29953
273
273
  claude_mpm/core/cache.py,sha256=orh8B40oYnRRGmXdANR4P4f-KVMIHV0vg7vrsemk0no,17232
274
- claude_mpm/core/claude_runner.py,sha256=Wle-wI-ag25oC0EYX3n8dDC56I5GIdbpi5NtvT4IgBw,34263
274
+ claude_mpm/core/claude_runner.py,sha256=kAZLgtkcOw4AZQxTc2zIba_BoUCOhVRNJ92vSFTP4Y4,39369
275
275
  claude_mpm/core/config.py,sha256=0R1ZLdwxTM2N3-uIBgcbr37jDiEe-G7h7x4YmYIVit0,43385
276
276
  claude_mpm/core/config_aliases.py,sha256=QpNNECkTY4TYYAhVlFZvB-msPnZrui90g19u0-v0HDE,9703
277
277
  claude_mpm/core/config_constants.py,sha256=MEF35Y2Lj5FMzRdhgSgZrZeTzHfCzistPGZVY8INta4,10073
@@ -1019,6 +1019,7 @@ claude_mpm/skills/bundled/pm/mpm-organize/SKILL.md,sha256=eMUxGO24f9FyaxAV_BvN0T
1019
1019
  claude_mpm/skills/bundled/pm/mpm-postmortem/SKILL.md,sha256=OjswFa5mRvlHpioAN02sjKISL1RJR4u4pVlfj-Hsuhc,516
1020
1020
  claude_mpm/skills/bundled/pm/mpm-pr-workflow/SKILL.md,sha256=HSeVxw_znHqiPA95gpHnPKavNkSgSLTKuVaHqV976Ao,3369
1021
1021
  claude_mpm/skills/bundled/pm/mpm-session-management/SKILL.md,sha256=GcGbCPoVs-N4MHZIoLf7q3EK1Noy4DLoCGvs3dVfZq4,8341
1022
+ claude_mpm/skills/bundled/pm/mpm-session-pause/SKILL.md,sha256=xwgFxX5Pi8eMno7UalnjVWBiX3aCb1e2Jwh9dS0Y8OU,4323
1022
1023
  claude_mpm/skills/bundled/pm/mpm-session-resume/SKILL.md,sha256=7O1iu6qORTglX1VlAy4da_oEGvBwZ53Vmg6yBc02DqY,722
1023
1024
  claude_mpm/skills/bundled/pm/mpm-status/SKILL.md,sha256=9cj2l-aEdQ7_pTqTjTn7_EZe-CyzM9ab8vzWpX62LFY,906
1024
1025
  claude_mpm/skills/bundled/pm/mpm-teaching-mode/SKILL.md,sha256=SRhxpc6EyiO-hH5pQ7FcxNDUaaj5pfTEV9FwkjxfCA4,17761
@@ -1127,10 +1128,10 @@ claude_mpm/utils/subprocess_utils.py,sha256=D0izRT8anjiUb_JG72zlJR_JAw1cDkb7kalN
1127
1128
  claude_mpm/validation/__init__.py,sha256=YZhwE3mhit-lslvRLuwfX82xJ_k4haZeKmh4IWaVwtk,156
1128
1129
  claude_mpm/validation/agent_validator.py,sha256=GprtAvu80VyMXcKGsK_VhYiXWA6BjKHv7O6HKx0AB9w,20917
1129
1130
  claude_mpm/validation/frontmatter_validator.py,sha256=YpJlYNNYcV8u6hIOi3_jaRsDnzhbcQpjCBE6eyBKaFY,7076
1130
- claude_mpm-5.6.14.dist-info/licenses/LICENSE,sha256=ca3y_Rk4aPrbF6f62z8Ht5MJM9OAvbGlHvEDcj9vUQ4,3867
1131
- claude_mpm-5.6.14.dist-info/licenses/LICENSE-FAQ.md,sha256=TxfEkXVCK98RzDOer09puc7JVCP_q_bN4dHtZKHCMcM,5104
1132
- claude_mpm-5.6.14.dist-info/METADATA,sha256=A_iow_IpMJgpDMXTCkMOJuppdanbmP2-JL-WsljSmkE,15245
1133
- claude_mpm-5.6.14.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
1134
- claude_mpm-5.6.14.dist-info/entry_points.txt,sha256=n-Uk4vwHPpuvu-g_I7-GHORzTnN_m6iyOsoLveKKD0E,228
1135
- claude_mpm-5.6.14.dist-info/top_level.txt,sha256=1nUg3FEaBySgm8t-s54jK5zoPnu3_eY6EP6IOlekyHA,11
1136
- claude_mpm-5.6.14.dist-info/RECORD,,
1131
+ claude_mpm-5.6.15.dist-info/licenses/LICENSE,sha256=ca3y_Rk4aPrbF6f62z8Ht5MJM9OAvbGlHvEDcj9vUQ4,3867
1132
+ claude_mpm-5.6.15.dist-info/licenses/LICENSE-FAQ.md,sha256=TxfEkXVCK98RzDOer09puc7JVCP_q_bN4dHtZKHCMcM,5104
1133
+ claude_mpm-5.6.15.dist-info/METADATA,sha256=oYFEVPPcmoJk4V558WRo8MS9Trx52xQKoUN5k6nCd14,15245
1134
+ claude_mpm-5.6.15.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
1135
+ claude_mpm-5.6.15.dist-info/entry_points.txt,sha256=n-Uk4vwHPpuvu-g_I7-GHORzTnN_m6iyOsoLveKKD0E,228
1136
+ claude_mpm-5.6.15.dist-info/top_level.txt,sha256=1nUg3FEaBySgm8t-s54jK5zoPnu3_eY6EP6IOlekyHA,11
1137
+ claude_mpm-5.6.15.dist-info/RECORD,,