pi-archimedes 0.3.2 → 0.5.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.
Files changed (2) hide show
  1. package/package.json +6 -6
  2. package/src/settings.ts +17 -5
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "pi-archimedes",
3
- "version": "0.3.2",
3
+ "version": "0.5.0",
4
4
  "type": "module",
5
5
  "keywords": [
6
6
  "pi-package"
@@ -11,11 +11,11 @@
11
11
  ],
12
12
  "main": "./src/index.ts",
13
13
  "dependencies": {
14
- "@pi-archimedes/core": "0.3.2",
15
- "@pi-archimedes/image-paste": "0.3.2",
16
- "@pi-archimedes/footer": "0.3.2",
17
- "@pi-archimedes/diff": "0.3.2",
18
- "@pi-archimedes/subagent": "0.3.2"
14
+ "@pi-archimedes/core": "0.5.0",
15
+ "@pi-archimedes/diff": "0.5.0",
16
+ "@pi-archimedes/image-paste": "0.5.0",
17
+ "@pi-archimedes/subagent": "0.5.0",
18
+ "@pi-archimedes/footer": "0.5.0"
19
19
  },
20
20
  "peerDependencies": {
21
21
  "@earendil-works/pi-coding-agent": ">=0.1.0",
package/src/settings.ts CHANGED
@@ -23,7 +23,7 @@ function createTextSubmenu(opts: {
23
23
  label: string;
24
24
  cancelHint?: string;
25
25
  confirmHint?: string;
26
- }): SettingItem["submenu"] {
26
+ }): (currentValue: string, done: (selectedValue?: string) => void) => import("@earendil-works/pi-tui").Component {
27
27
  return (currentValue: string, done: (selectedValue?: string) => void) => {
28
28
  const state = { value: currentValue };
29
29
  return {
@@ -57,7 +57,7 @@ function createNumberSubmenu(opts: {
57
57
  cancelHint?: string;
58
58
  confirmHint?: string;
59
59
  min?: number;
60
- }): SettingItem["submenu"] {
60
+ }): (currentValue: string, done: (selectedValue?: string) => void) => import("@earendil-works/pi-tui").Component {
61
61
  return (currentValue: string, done: (selectedValue?: string) => void) => {
62
62
  const state = { value: currentValue };
63
63
  return {
@@ -177,12 +177,24 @@ export function openSettings(pi: ExtensionAPI, ctx: ExtensionContext): void {
177
177
  case "animationStyle": coreConfig.animationStyle = newValue as CoreConfig["animationStyle"]; break;
178
178
 
179
179
  // ── Footer settings ──
180
- case "splitThreshold": footerConfig.splitThreshold = parseInt(newValue, 10); break;
180
+ case "splitThreshold": {
181
+ const v = parseInt(newValue, 10);
182
+ if (Number.isFinite(v)) footerConfig.splitThreshold = v;
183
+ break;
184
+ }
181
185
 
182
186
  // ── Diff settings ──
183
187
  case "diffTheme": diffConfig.diffTheme = newValue; break;
184
- case "diffSplitMinWidth": diffConfig.diffSplitMinWidth = parseInt(newValue, 10); break;
185
- case "diffSplitMinCodeWidth": diffConfig.diffSplitMinCodeWidth = parseInt(newValue, 10); break;
188
+ case "diffSplitMinWidth": {
189
+ const v = parseInt(newValue, 10);
190
+ if (Number.isFinite(v)) diffConfig.diffSplitMinWidth = v;
191
+ break;
192
+ }
193
+ case "diffSplitMinCodeWidth": {
194
+ const v = parseInt(newValue, 10);
195
+ if (Number.isFinite(v)) diffConfig.diffSplitMinCodeWidth = v;
196
+ break;
197
+ }
186
198
 
187
199
  // ── Save ──
188
200
  case "save": {