handoff-mcp-server 0.8.0 → 0.8.1

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.
package/Cargo.lock CHANGED
@@ -144,7 +144,7 @@ dependencies = [
144
144
 
145
145
  [[package]]
146
146
  name = "handoff-mcp"
147
- version = "0.8.0"
147
+ version = "0.8.1"
148
148
  dependencies = [
149
149
  "anyhow",
150
150
  "chrono",
package/Cargo.toml CHANGED
@@ -1,6 +1,6 @@
1
1
  [package]
2
2
  name = "handoff-mcp"
3
- version = "0.8.0"
3
+ version = "0.8.1"
4
4
  edition = "2021"
5
5
  description = "MCP server that gives AI coding agents persistent memory across sessions"
6
6
  license = "MIT"
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "handoff-mcp-server",
3
- "version": "0.8.0",
3
+ "version": "0.8.1",
4
4
  "description": "MCP server that gives AI coding agents persistent memory across sessions",
5
5
  "license": "MIT",
6
6
  "author": "AlphaElements <66808803+alphaelements@users.noreply.github.com>",
@@ -49,6 +49,11 @@ pub fn handle(arguments: &Value) -> Result<String> {
49
49
  }
50
50
  }
51
51
 
52
+ let skip_session_close = arguments
53
+ .get("skip_session_close")
54
+ .and_then(|v| v.as_bool())
55
+ .unwrap_or(false);
56
+
52
57
  let mut session_saved = false;
53
58
  if let Some(session) = arguments.get("session") {
54
59
  let summary = session
@@ -58,7 +63,9 @@ pub fn handle(arguments: &Value) -> Result<String> {
58
63
  anyhow::anyhow!("'session.summary' is required when session is provided")
59
64
  })?;
60
65
 
61
- close_active_sessions(&sessions_dir)?;
66
+ if !skip_session_close {
67
+ close_active_sessions(&sessions_dir)?;
68
+ }
62
69
  let git_state = capture_git_state(&project_dir)?;
63
70
  let now = Utc::now().to_rfc3339();
64
71
 
@@ -118,7 +125,9 @@ pub fn handle(arguments: &Value) -> Result<String> {
118
125
  session_saved = true;
119
126
  } else if let Some(raw_notes) = arguments.get("raw_notes").and_then(|v| v.as_str()) {
120
127
  if !raw_notes.is_empty() {
121
- close_active_sessions(&sessions_dir)?;
128
+ if !skip_session_close {
129
+ close_active_sessions(&sessions_dir)?;
130
+ }
122
131
  let git_state = capture_git_state(&project_dir)?;
123
132
  let now = Utc::now().to_rfc3339();
124
133
 
@@ -21,11 +21,6 @@ pub fn handle(arguments: &Value) -> Result<String> {
21
21
  let sessions_dir = handoff.join("sessions");
22
22
  let config_path = handoff.join("config.toml");
23
23
 
24
- let summary = arguments
25
- .get("summary")
26
- .and_then(|v| v.as_str())
27
- .ok_or_else(|| anyhow::anyhow!("'summary' is required"))?;
28
-
29
24
  let close_id = arguments.get("close_session_id").and_then(|v| v.as_str());
30
25
  let pause_id = arguments.get("pause_session_id").and_then(|v| v.as_str());
31
26
  let pause_all = arguments
@@ -37,6 +32,19 @@ pub fn handle(arguments: &Value) -> Result<String> {
37
32
  .and_then(|v| v.as_str())
38
33
  .unwrap_or("open");
39
34
 
35
+ let is_pause_only = arguments
36
+ .get("pause_only")
37
+ .and_then(|v| v.as_bool())
38
+ .unwrap_or(false);
39
+
40
+ let summary_opt = arguments.get("summary").and_then(|v| v.as_str());
41
+
42
+ if !is_pause_only && summary_opt.is_none() {
43
+ anyhow::bail!("'summary' is required (unless pause_only=true)");
44
+ }
45
+
46
+ let summary = summary_opt.unwrap_or("");
47
+
40
48
  if session_status != "open" && session_status != "active" {
41
49
  anyhow::bail!(
42
50
  "Invalid session_status '{}': must be 'open' or 'active'",
@@ -53,6 +61,27 @@ pub fn handle(arguments: &Value) -> Result<String> {
53
61
  total_paused = pause_active_sessions(&sessions_dir)?.len();
54
62
  }
55
63
 
64
+ if is_pause_only {
65
+ let mut msg = String::new();
66
+ if total_paused > 0 {
67
+ msg.push_str(&format!("Paused {} session(s)", total_paused));
68
+ }
69
+ if let Some(id) = pause_id {
70
+ if total_paused == 0 {
71
+ msg.push_str(&format!(
72
+ "Warning: pause_session_id '{id}' not found among active/open sessions"
73
+ ));
74
+ }
75
+ }
76
+ if !pause_all && pause_id.is_none() {
77
+ msg.push_str("Warning: pause_only=true requires pause_session_id or pause_active=true");
78
+ }
79
+ if msg.is_empty() {
80
+ msg.push_str("No sessions were paused (none active)");
81
+ }
82
+ return Ok(msg);
83
+ }
84
+
56
85
  let total_closed = if let Some(id) = close_id {
57
86
  let closed = close_session_by_id(&sessions_dir, id)?;
58
87
  if closed.is_some() {
@@ -124,7 +153,7 @@ pub fn handle(arguments: &Value) -> Result<String> {
124
153
  if let Some(id) = pause_id {
125
154
  if total_paused == 0 {
126
155
  msg.push_str(&format!(
127
- "\nWarning: pause_session_id '{id}' not found among active sessions"
156
+ "\nWarning: pause_session_id '{id}' not found among active/open sessions"
128
157
  ));
129
158
  }
130
159
  }
package/src/mcp/tools.rs CHANGED
@@ -75,6 +75,10 @@ pub fn all_tool_definitions() -> Vec<ToolDefinition> {
75
75
  "type": "boolean",
76
76
  "description": "If true, pause all active sessions instead of closing them. Cannot be combined with close_session_id."
77
77
  },
78
+ "pause_only": {
79
+ "type": "boolean",
80
+ "description": "If true, only pause sessions (via pause_session_id or pause_active) without creating a new session. Useful for session switching. When true, summary is optional."
81
+ },
78
82
  "decisions": {
79
83
  "type": "array",
80
84
  "description": "Decisions made during this session",
@@ -479,6 +483,10 @@ pub fn all_tool_definitions() -> Vec<ToolDefinition> {
479
483
  "raw_notes": {
480
484
  "type": "string",
481
485
  "description": "Free-form text that couldn't be structured. Saved as a handoff_note with category 'context'."
486
+ },
487
+ "skip_session_close": {
488
+ "type": "boolean",
489
+ "description": "If true, do not close active sessions before creating the import session. Default false."
482
490
  }
483
491
  },
484
492
  "required": ["source"],
@@ -273,7 +273,10 @@ pub fn pause_active_sessions(sessions_dir: &Path) -> Result<Vec<PathBuf>> {
273
273
  }
274
274
 
275
275
  pub fn pause_session_by_id(sessions_dir: &Path, session_id: &str) -> Result<Option<PathBuf>> {
276
- transition_session_by_id(sessions_dir, session_id, "active", "paused")
276
+ if let Some(path) = transition_session_by_id(sessions_dir, session_id, "active", "paused")? {
277
+ return Ok(Some(path));
278
+ }
279
+ transition_session_by_id(sessions_dir, session_id, "open", "paused")
277
280
  }
278
281
 
279
282
  pub fn resume_paused_session_by_id(