pi-skillful 0.3.3 → 0.3.4

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
@@ -6,6 +6,12 @@ This project follows the spirit of [Keep a Changelog](https://keepachangelog.com
6
6
 
7
7
  ## [Unreleased]
8
8
 
9
+ ## [0.3.4] - 2026-05-12
10
+
11
+ ### Changed
12
+
13
+ - Preserve session skill toggle state across `/new` within the same Pi process.
14
+
9
15
  ## [0.3.3] - 2026-05-12
10
16
 
11
17
  ### Fixed
package/README.md CHANGED
@@ -88,7 +88,7 @@ Configured slots appear on the prompt editor's top border as `N skill-name`. Lon
88
88
 
89
89
  `toggleModifier` defaults to `"alt"`. Supported values are `"alt"`, `"ctrl"`, `"ctrl+shift"`, `"alt+shift"`, `"ctrl+alt"`, and `"ctrl+alt+shift"`. Change it if your terminal reserves `alt+number` shortcuts.
90
90
 
91
- On session start, non-hidden skills are active and hidden skills are inactive. Starting, resuming, or forking a session resets toggle state from settings. Inline `/skill:name` invocation remains explicit and works even when that skill is inactive.
91
+ On app startup, non-hidden skills are active and hidden skills are inactive. Within a running Pi process, `/new` preserves the current toggle state for the new session. Resuming, forking, cloning, reloading, or restarting Pi resets toggle state from settings. Inline `/skill:name` invocation remains explicit and works even when that skill is inactive.
92
92
 
93
93
  ## Installation
94
94
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "pi-skillful",
3
- "version": "0.3.3",
3
+ "version": "0.3.4",
4
4
  "description": "Pi package with skill invocation and visibility improvements.",
5
5
  "type": "module",
6
6
  "license": "MIT",
@@ -39,6 +39,7 @@ interface SessionToggleState {
39
39
  }
40
40
 
41
41
  let state: SessionToggleState = createEmptyState();
42
+ let preservedNewSessionActiveBySkill: { cwd: string; activeBySkill: Map<string, boolean> } | undefined;
42
43
 
43
44
  export default function sessionSkillToggles(pi: ExtensionAPI) {
44
45
  for (const modifier of SUPPORTED_TOGGLE_MODIFIERS) {
@@ -53,7 +54,7 @@ export default function sessionSkillToggles(pi: ExtensionAPI) {
53
54
  }
54
55
  }
55
56
 
56
- pi.on("session_start", async (_event, ctx) => {
57
+ pi.on("session_start", async (event, ctx) => {
57
58
  const settings = await readEffectiveSkillfulSettings(ctx.cwd);
58
59
  const loadedSkillNames = new Set(listLoadedSkills(pi.getCommands()).map((s) => s.name));
59
60
  const slots = SKILL_TOGGLE_SLOTS.flatMap((slot): ToggleSlotState[] => {
@@ -62,12 +63,23 @@ export default function sessionSkillToggles(pi: ExtensionAPI) {
62
63
  return [{ slot, skillName }];
63
64
  });
64
65
 
66
+ const preservedActiveBySkill =
67
+ event.reason === "new" && preservedNewSessionActiveBySkill?.cwd === ctx.cwd
68
+ ? preservedNewSessionActiveBySkill.activeBySkill
69
+ : undefined;
70
+ preservedNewSessionActiveBySkill = undefined;
71
+
65
72
  state = {
66
73
  cwd: ctx.cwd,
67
74
  modifier: settings.toggleModifier,
68
75
  hiddenSkills: settings.hiddenSkillSet,
69
76
  slots,
70
- activeBySkill: new Map(slots.map(({ skillName }) => [skillName, !settings.hiddenSkillSet.has(skillName)])),
77
+ activeBySkill: new Map(
78
+ slots.map(({ skillName }) => [
79
+ skillName,
80
+ preservedActiveBySkill?.get(skillName) ?? !settings.hiddenSkillSet.has(skillName),
81
+ ]),
82
+ ),
71
83
  installedEditor: false,
72
84
  installedWidget: false,
73
85
  previousEditorFactory: undefined,
@@ -92,9 +104,11 @@ export default function sessionSkillToggles(pi: ExtensionAPI) {
92
104
  return { systemPrompt };
93
105
  });
94
106
 
95
- pi.on("session_shutdown", (_event, ctx) => {
107
+ pi.on("session_shutdown", (event, ctx) => {
96
108
  if (state.installedEditor) ctx.ui.setEditorComponent(state.previousEditorFactory);
97
109
  if (state.installedWidget) ctx.ui.setWidget(WIDGET_KEY, undefined);
110
+ preservedNewSessionActiveBySkill =
111
+ event.reason === "new" ? { cwd: state.cwd, activeBySkill: new Map(state.activeBySkill) } : undefined;
98
112
  state = createEmptyState();
99
113
  });
100
114
  }