stackprep-pro 0.2.15__tar.gz → 0.2.17__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.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: stackprep-pro
3
- Version: 0.2.15
3
+ Version: 0.2.17
4
4
  Summary: stackprep-pro — interview & certification prep MCP server for any AI client
5
5
  Project-URL: Homepage, https://github.com/youngpada1/stackprep-pro
6
6
  Project-URL: Repository, https://github.com/youngpada1/stackprep-pro
@@ -166,6 +166,7 @@ Point this at any Dropbox, Google Drive, or OneDrive folder for cross-platform s
166
166
  | `submit_answer` | Record the result of an answered question. | `session_id`, `result`, `question` |
167
167
  | `flag_for_study` | Manually flag the current question for the study pack. | `session_id`, `question` |
168
168
  | `save_session` | Save an in-progress session so the user can continue it later. | `session_id`, `session_name` |
169
+ | `discard_session` | Permanently delete a session. Call this when the user is exiting and answers NO to saving the | `session_id` |
169
170
  | `end_session` | End the session. Returns the score and flagged topics so the AI can generate a study plan and study pack. | `session_id` |
170
171
  | `save_study_pack` | Save the study pack content to disk. | `session_id`, `name`, `content` |
171
172
  | `list_sessions` | List saved sessions. Call this silently when the user wants to continue. Never mention this tool to the user. | `mode` |
@@ -146,6 +146,7 @@ Point this at any Dropbox, Google Drive, or OneDrive folder for cross-platform s
146
146
  | `submit_answer` | Record the result of an answered question. | `session_id`, `result`, `question` |
147
147
  | `flag_for_study` | Manually flag the current question for the study pack. | `session_id`, `question` |
148
148
  | `save_session` | Save an in-progress session so the user can continue it later. | `session_id`, `session_name` |
149
+ | `discard_session` | Permanently delete a session. Call this when the user is exiting and answers NO to saving the | `session_id` |
149
150
  | `end_session` | End the session. Returns the score and flagged topics so the AI can generate a study plan and study pack. | `session_id` |
150
151
  | `save_study_pack` | Save the study pack content to disk. | `session_id`, `name`, `content` |
151
152
  | `list_sessions` | List saved sessions. Call this silently when the user wants to continue. Never mention this tool to the user. | `mode` |
@@ -1,6 +1,6 @@
1
1
  [project]
2
2
  name = "stackprep-pro"
3
- version = "0.2.15"
3
+ version = "0.2.17"
4
4
  description = "stackprep-pro — interview & certification prep MCP server for any AI client"
5
5
  readme = "README.md"
6
6
  license = { text = "MIT" }
@@ -293,6 +293,18 @@ def save_session(session_id: str, session_name: str) -> str:
293
293
  return f"Session saved as '{name}'. You can continue it later."
294
294
 
295
295
 
296
+ @mcp.tool()
297
+ def discard_session(session_id: str) -> str:
298
+ """Permanently delete a session. Call this when the user is exiting and answers NO to saving the
299
+ session — it removes the session file from disk so it does NOT appear in the continue list later.
300
+
301
+ Args:
302
+ session_id: The session ID to delete
303
+ """
304
+ _delete_session(session_id)
305
+ return "Session discarded. Nothing was saved."
306
+
307
+
296
308
  @mcp.tool()
297
309
  def end_session(session_id: str) -> str:
298
310
  """End the session. Returns the score and flagged topics so the AI can generate a study plan and study pack.
@@ -336,15 +348,13 @@ def save_study_pack(session_id: str, name: str, content: str) -> str:
336
348
  """Save the study pack content to disk.
337
349
 
338
350
  Args:
339
- session_id: The session ID (must have called end_session first)
351
+ session_id: The session ID. Can be saved mid-session — does NOT end the session.
340
352
  name: Slug name for this pack, e.g. "aws-saa-week1" or "python-interview-june"
341
353
  content: The full study pack markdown generated by the AI
342
354
  """
343
355
  session = _sessions.get(session_id) or _restore_session(session_id)
344
356
  if not session:
345
357
  return f"ERROR: No session found with ID '{session_id}'."
346
- if not session.get("ended"):
347
- return "ERROR: Call end_session first before saving a study pack."
348
358
 
349
359
  safe_name = re.sub(r"[^a-z0-9_-]", "-", name.lower().strip())
350
360
  if not safe_name:
@@ -392,6 +402,10 @@ def list_sessions(mode: str = "") -> str:
392
402
  continue
393
403
  if mode and data.get("mode", "") != mode:
394
404
  continue
405
+ # Only show sessions the user explicitly saved (named). Unnamed auto-persisted
406
+ # sessions are not surfaced unless the user named them via save_session.
407
+ if not data.get("session_name", "").strip():
408
+ continue
395
409
  rows.append((f.stem, data))
396
410
 
397
411
  if not rows:
@@ -16,7 +16,7 @@ The instant the user says ANYTHING meaning they want to stop — "exit", "quit",
16
16
 
17
17
  - **Yes** → ask "What would you like to name this session?" (the user MUST give the name — never invent one),
18
18
  then call `save_session(session_id, session_name=<that name>)`. It stays resumable under that name.
19
- - **No** → only then end, saving nothing.
19
+ - **No** → call `discard_session(session_id)` to permanently delete it, then end. It will NOT appear later.
20
20
 
21
21
  This is mandatory EVERY time, no matter how few questions were answered.
22
22
 
@@ -89,8 +89,10 @@ After scoring, ask:
89
89
 
90
90
  Handling the reply:
91
91
  - **Y** → next question.
92
- - **S** → the user is DONE and wants a study pack. Call `end_session` and follow its returned flow
93
- (generate study plan, name the study pack, save_study_pack). This marks the session finished.
92
+ - **S** → the user wants to save a study pack, but this does NOT end the session. Generate the study plan,
93
+ ask the user to name the study pack, then call `save_study_pack` (do NOT call `end_session`). After saving,
94
+ ask: "Study pack saved! Do you want to continue this session or exit? (continue / exit)" — if continue, go
95
+ to the next question; if exit, follow the exit rule above.
94
96
  - **X — or ANY exit intent: "exit", "quit", "stop", "leave", "I'm done for now", "bye", etc.** → the user
95
97
  wants to PAUSE and resume later. You MUST, before ending, ask "Do you want to save this session to continue
96
98
  later? (y/n)". If yes, ask "What would you like to name this session?" — the user MUST name it (never
@@ -16,7 +16,7 @@ The instant the user says ANYTHING meaning they want to stop — "exit", "quit",
16
16
 
17
17
  - **Yes** → ask "What would you like to name this session?" (the user MUST give the name — never invent one),
18
18
  then call `save_session(session_id, session_name=<that name>)`. It stays resumable under that name.
19
- - **No** → only then end, saving nothing.
19
+ - **No** → call `discard_session(session_id)` to permanently delete it, then end. It will NOT appear later.
20
20
 
21
21
  This is mandatory EVERY time, no matter how few questions were answered.
22
22
 
@@ -90,8 +90,10 @@ After scoring, ask:
90
90
 
91
91
  Handling the reply:
92
92
  - **Y** → next question.
93
- - **S** → the user is DONE and wants a study pack. Call `end_session` and follow its returned flow
94
- (generate study plan, name the study pack, save_study_pack). This marks the session finished.
93
+ - **S** → the user wants to save a study pack, but this does NOT end the session. Generate the study plan,
94
+ ask the user to name the study pack, then call `save_study_pack` (do NOT call `end_session`). After saving,
95
+ ask: "Study pack saved! Do you want to continue this session or exit? (continue / exit)" — if continue, go
96
+ to the next question; if exit, follow the exit rule above.
95
97
  - **X — or ANY exit intent: "exit", "quit", "stop", "leave", "I'm done for now", "bye", etc.** → the user
96
98
  wants to PAUSE and resume later. You MUST, before ending, ask "Do you want to save this session to continue
97
99
  later? (y/n)". If yes, ask "What would you like to name this session?" — the user MUST name it (never
@@ -723,7 +723,7 @@ wheels = [
723
723
 
724
724
  [[package]]
725
725
  name = "stackprep-pro"
726
- version = "0.2.15"
726
+ version = "0.2.17"
727
727
  source = { editable = "." }
728
728
  dependencies = [
729
729
  { name = "mcp", extra = ["cli"] },
File without changes
File without changes