@zenobius/pi-worktrees 0.5.0 → 0.5.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/README.md CHANGED
@@ -129,7 +129,7 @@ This creates a new Zellij tab with Neovim and Pi running in the new worktree pat
129
129
 
130
130
  ## Configuration
131
131
 
132
- Settings live in `~/.pi/agent/pi-worktrees-settings.json`.
132
+ Settings live in `~/.pi/agent/pi-worktrees.config.json`.
133
133
 
134
134
  ```json
135
135
  {
package/dist/index.js CHANGED
@@ -1705,7 +1705,10 @@ Valid keys: ${VALID_SETTING_KEYS.join(", ")}`, "error");
1705
1705
  ctx.ui.notify(`${resolvedKey}: ${defaults[resolvedKey]}`, "info");
1706
1706
  return;
1707
1707
  }
1708
- const newSettings = { ...currentSettings };
1708
+ const resolvedCurrent = deps.configService.current(ctx);
1709
+ const matchedPattern = resolvedCurrent.matchedPattern ?? "**";
1710
+ const configuredWorktrees = deps.configService.config.worktrees ?? {};
1711
+ const newSettings = { ...configuredWorktrees[matchedPattern] ?? {} };
1709
1712
  if (value === "" || value === '""' || value === "null" || value === "clear") {
1710
1713
  delete newSettings[resolvedKey];
1711
1714
  delete newSettings.parentDir;
@@ -1717,7 +1720,13 @@ Valid keys: ${VALID_SETTING_KEYS.join(", ")}`, "error");
1717
1720
  }
1718
1721
  ctx.ui.notify(`\u2713 Set ${resolvedKey} = "${value}"`, "info");
1719
1722
  }
1720
- try {} catch (err) {
1723
+ const nextWorktrees = { ...configuredWorktrees, [matchedPattern]: newSettings };
1724
+ if (matchedPattern !== "**" && Object.keys(newSettings).length === 0) {
1725
+ delete nextWorktrees[matchedPattern];
1726
+ }
1727
+ try {
1728
+ await deps.configService.save({ worktrees: nextWorktrees });
1729
+ } catch (err) {
1721
1730
  ctx.ui.notify(`Failed to save settings: ${err.message}`, "error");
1722
1731
  }
1723
1732
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@zenobius/pi-worktrees",
3
- "version": "0.5.0",
3
+ "version": "0.5.1",
4
4
  "description": "Worktrees extension for Pi Coding Agent",
5
5
  "author": {
6
6
  "name": "Zenobius",