@aliou/pi-utils-settings 0.3.0 → 0.4.0

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@aliou/pi-utils-settings",
3
- "version": "0.3.0",
3
+ "version": "0.4.0",
4
4
  "type": "module",
5
5
  "private": false,
6
6
  "license": "MIT",
@@ -5,7 +5,10 @@
5
5
  * Changes are tracked in memory. Ctrl+S saves, Esc exits without saving.
6
6
  */
7
7
 
8
- import type { ExtensionAPI } from "@mariozechner/pi-coding-agent";
8
+ import type {
9
+ ExtensionAPI,
10
+ ExtensionCommandContext,
11
+ } from "@mariozechner/pi-coding-agent";
9
12
  import { getSettingsListTheme } from "@mariozechner/pi-coding-agent";
10
13
  import { Key, matchesKey } from "@mariozechner/pi-tui";
11
14
  import {
@@ -76,7 +79,7 @@ export interface SettingsCommandOptions<
76
79
  * Called after save succeeds. Use this to reload runtime state
77
80
  * that was captured at extension init time.
78
81
  */
79
- onSave?: () => void | Promise<void>;
82
+ onSave?: (ctx: ExtensionCommandContext) => void | Promise<void>;
80
83
  }
81
84
 
82
85
  function defaultChangeHandler<TConfig extends object>(
@@ -256,7 +259,7 @@ export function registerSettingsCommand<
256
259
 
257
260
  if (saved) {
258
261
  ctx.ui.notify(`${extensionLabel}: saved`, "info");
259
- if (onSave) await onSave();
262
+ if (onSave) await onSave(ctx);
260
263
  // Rebuild with fresh data.
261
264
  settings = buildSettingsComponent(activeScope);
262
265
  }