@code-fixer-23/pi-session-manager 1.0.5 → 1.0.6

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/CHANGELOG.md CHANGED
@@ -1,3 +1,14 @@
1
+ ## 1.0.6 (2026-07-14)
2
+
3
+ ### 🩹 Fixes
4
+
5
+ - **pi-session-manager:** display README asset ([4628004](https://github.com/louiss0/pi-packages/commit/4628004))
6
+ - **pi-session-manager:** respect empty title cancellation ([37729af](https://github.com/louiss0/pi-packages/commit/37729af))
7
+
8
+ ### ❤️ Thank You
9
+
10
+ - louiss0 @louiss0
11
+
1
12
  ## 1.0.5 (2026-07-08)
2
13
 
3
14
  ### 🩹 Fixes
package/README.md CHANGED
@@ -1,6 +1,6 @@
1
1
  # pi-session-manager
2
2
 
3
- [!session-manager](https://raw.githubusercontent.com/louiss0/pi-packages/main/pi-session-manager/assets/Pi-Session-Manager-Big.png)
3
+ ![Session Manager](https://raw.githubusercontent.com/louiss0/pi-packages/main/pi-session-manager/assets/Pi-Session_Manager-Big.png)
4
4
 
5
5
 
6
6
  [![npm version](https://img.shields.io/npm/v/@code-fixer-23/pi-session-manager.svg)](https://www.npmjs.com/package/@code-fixer-23/pi-session-manager)
@@ -620,6 +620,41 @@ describe("handleSessionSeries", () => {
620
620
  expect(context.newSession).not.toHaveBeenCalled();
621
621
  });
622
622
 
623
+ it("stops creating a session series when the series input is empty", async () => {
624
+ const context = {
625
+ cwd: "/pi-packages",
626
+ newSession: vi.fn<ExtensionCommandContext["newSession"]>(),
627
+ ui: {
628
+ notify: vi.fn<ExtensionUIContext["notify"]>(),
629
+ input: vi
630
+ .fn<ExtensionUIContext["input"]>()
631
+ .mockResolvedValueOnce("")
632
+ .mockResolvedValueOnce("Should not be prompted"),
633
+ },
634
+ } satisfies MockExtenstionCommandContext;
635
+
636
+ await handleSessionSeries(
637
+ "create",
638
+ {
639
+ sessionManagerConfigurator: new SessionManagerConfiguratorMock(),
640
+ sessionFilter: new MockSessionFilter(
641
+ [],
642
+ new MockPastTimestampCalculator(),
643
+ ),
644
+ getSessionEntryWithSeries() {
645
+ return undefined;
646
+ },
647
+ removeSessionFiles() {
648
+ return;
649
+ },
650
+ },
651
+ castToExtensionContext(context),
652
+ );
653
+
654
+ expect(context.ui.input).toHaveBeenCalledTimes(1);
655
+ expect(context.newSession).not.toHaveBeenCalled();
656
+ });
657
+
623
658
  const seriesInput = "Implement Auth";
624
659
  it("keeps asking for a unique trimmed session series when creating", async () => {
625
660
  const sessionCtx = {
@@ -641,6 +676,7 @@ describe("handleSessionSeries", () => {
641
676
  notify: vi.fn<ExtensionUIContext["notify"]>(),
642
677
  input: vi
643
678
  .fn<ExtensionUIContext["input"]>()
679
+ .mockResolvedValueOnce(" ")
644
680
  .mockResolvedValueOnce(" Implement Auth ")
645
681
  .mockResolvedValueOnce(" Implement Billing ")
646
682
  .mockResolvedValueOnce(" Create JWT Token "),
@@ -694,7 +730,7 @@ describe("handleSessionSeries", () => {
694
730
  "warning",
695
731
  );
696
732
 
697
- expect(context.ui.input).toHaveBeenCalledTimes(3);
733
+ expect(context.ui.input).toHaveBeenCalledTimes(4);
698
734
 
699
735
  expect(appendSessionSeriesBasedOnCwdSpy).toHaveBeenCalledWith(
700
736
  sessionCtx.cwd,
@@ -764,7 +764,7 @@ export function applyPersistedSessionSeriesData(
764
764
  return true;
765
765
  }
766
766
 
767
- function promptForUniqueTrimmedInput(
767
+ function promptForUniqueInput(
768
768
  ctx: ExtensionCommandContext,
769
769
  prompt: string,
770
770
  description: string | undefined,
@@ -774,16 +774,17 @@ function promptForUniqueTrimmedInput(
774
774
  return (async () => {
775
775
  while (true) {
776
776
  const value = await ctx.ui.input(prompt, description);
777
- const trimmedValue = value?.trim();
778
777
 
779
- if (value === undefined) {
778
+ if (!value) {
780
779
  return;
781
780
  }
782
781
 
783
- if (!trimmedValue) {
782
+ if (/^\s+$/.test(value)) {
784
783
  continue;
785
784
  }
786
785
 
786
+ const trimmedValue = value.trim();
787
+
787
788
  if (
788
789
  existingValues.some(
789
790
  (existingValue) => existingValue.trim() === trimmedValue,
@@ -831,7 +832,7 @@ export async function handleSessionSeries(
831
832
  return;
832
833
  }
833
834
 
834
- const series = await promptForUniqueTrimmedInput(
835
+ const series = await promptForUniqueInput(
835
836
  ctx,
836
837
  "What is the name of your session series?",
837
838
  "What are you focused on?",
@@ -854,7 +855,7 @@ export async function handleSessionSeries(
854
855
  return;
855
856
  }
856
857
 
857
- const title = await promptForUniqueTrimmedInput(
858
+ const title = await promptForUniqueInput(
858
859
  ctx,
859
860
  "What is the name of the new session you want to make in this one?",
860
861
  "What task is a part of what you are focusing on?",
@@ -954,7 +955,7 @@ export async function handleSessionSeries(
954
955
  return;
955
956
  }
956
957
 
957
- const title = await promptForUniqueTrimmedInput(
958
+ const title = await promptForUniqueInput(
958
959
  ctx,
959
960
  "What is the name of the this new session?",
960
961
  "What do you want your agent to do now?",
@@ -1015,7 +1016,7 @@ export async function handleSessionSeries(
1015
1016
  entry.data.series,
1016
1017
  );
1017
1018
 
1018
- const title = await promptForUniqueTrimmedInput(
1019
+ const title = await promptForUniqueInput(
1019
1020
  ctx,
1020
1021
  `What's the new title for the session in series ${entry.data.series}`,
1021
1022
  undefined,
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@code-fixer-23/pi-session-manager",
3
3
  "type": "module",
4
- "version": "1.0.5",
4
+ "version": "1.0.6",
5
5
  "keywords": [
6
6
  "pi-package"
7
7
  ],