pi-archimedes 1.3.3 → 1.4.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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "pi-archimedes",
3
- "version": "1.3.3",
3
+ "version": "1.4.1",
4
4
  "type": "module",
5
5
  "keywords": [
6
6
  "pi-package"
@@ -11,13 +11,14 @@
11
11
  ],
12
12
  "main": "./src/index.ts",
13
13
  "dependencies": {
14
- "@pi-archimedes/core": "1.3.3",
15
- "@pi-archimedes/diff": "1.3.3",
16
- "@pi-archimedes/ask": "1.3.3",
17
- "@pi-archimedes/image-paste": "1.3.3",
18
- "@pi-archimedes/todo": "1.3.3",
19
- "@pi-archimedes/subagent": "1.3.3",
20
- "@pi-archimedes/footer": "1.3.3"
14
+ "@pi-archimedes/footer": "1.4.1",
15
+ "@pi-archimedes/diff": "1.4.1",
16
+ "@pi-archimedes/ask": "1.4.1",
17
+ "@pi-archimedes/image-paste": "1.4.1",
18
+ "@pi-archimedes/subagent": "1.4.1",
19
+ "@pi-archimedes/todo": "1.4.1",
20
+ "@pi-archimedes/notify": "1.4.1",
21
+ "@pi-archimedes/core": "1.4.1"
21
22
  },
22
23
  "peerDependencies": {
23
24
  "@earendil-works/pi-coding-agent": ">=0.1.0",
package/src/config.ts CHANGED
@@ -52,16 +52,33 @@ export function saveDiffConfig(config: DiffConfig): void {
52
52
  saveConfig(NAMESPACE, config);
53
53
  }
54
54
 
55
+ // ── Re-export notify config ────────────────────────────────────────────
56
+
57
+ import {
58
+ loadNotifyConfig,
59
+ saveNotifyConfig,
60
+ DEFAULT_NOTIFY_CONFIG,
61
+ type NotifyConfig,
62
+ } from "@pi-archimedes/notify";
63
+ export {
64
+ loadNotifyConfig,
65
+ saveNotifyConfig,
66
+ DEFAULT_NOTIFY_CONFIG,
67
+ type NotifyConfig,
68
+ } from "@pi-archimedes/notify";
69
+
55
70
  // ── Composed config loader ─────────────────────────────────────────────
56
71
 
57
72
  export function loadAllConfig(): {
58
73
  core: CoreConfig;
59
74
  footer: FooterConfig;
60
75
  diff: DiffConfig;
76
+ notify: NotifyConfig;
61
77
  } {
62
78
  return {
63
79
  core: loadCoreConfig(),
64
80
  footer: loadFooterConfig(),
65
81
  diff: loadDiffConfig(),
82
+ notify: loadNotifyConfig(),
66
83
  };
67
84
  }
package/src/index.ts CHANGED
@@ -7,6 +7,7 @@ import { registerImagePaste, initImagePasteSession, shutdownImagePaste } from "@
7
7
  import { registerSubagent, registerAgentsCommand } from "@pi-archimedes/subagent";
8
8
  import { registerTodo } from "@pi-archimedes/todo";
9
9
  import { registerAsk } from "@pi-archimedes/ask";
10
+ import { registerNotify } from "@pi-archimedes/notify";
10
11
  import { loadDiffConfig } from "./config.js";
11
12
  import { openSettings } from "./settings.js";
12
13
 
@@ -27,6 +28,9 @@ export default function (pi: ExtensionAPI): void {
27
28
  // Register ask tool
28
29
  registerAsk(pi);
29
30
 
31
+ // Register notify
32
+ registerNotify(pi);
33
+
30
34
  // Register /agents command
31
35
  registerAgentsCommand(pi);
32
36
 
package/src/settings.ts CHANGED
@@ -6,15 +6,18 @@ import { SettingsList, type SettingItem, TUI } from "@earendil-works/pi-tui";
6
6
  import { getCoreSettingsItems } from "@pi-archimedes/core";
7
7
  import { getFooterSettingsItems } from "@pi-archimedes/footer/config";
8
8
  import { getDiffSettingsItems } from "@pi-archimedes/diff";
9
+ import { getNotifySettingsItems } from "@pi-archimedes/notify";
9
10
  import {
10
11
  loadAllConfig,
11
12
  saveCoreConfig,
12
13
  saveFooterConfig,
13
14
  saveDiffConfig,
15
+ saveNotifyConfig,
14
16
  ANIMATION_STYLES,
15
17
  type CoreConfig,
16
18
  type FooterConfig,
17
19
  type DiffConfig,
20
+ type NotifyConfig,
18
21
  } from "./config.js";
19
22
 
20
23
  // ── Factory: text submenu ───────────────────────────────────────────────
@@ -97,11 +100,13 @@ export function openSettings(pi: ExtensionAPI, ctx: ExtensionContext): void {
97
100
  const coreConfig: CoreConfig = { ...allConfig.core };
98
101
  const footerConfig: FooterConfig = { ...allConfig.footer };
99
102
  const diffConfig: DiffConfig = { ...allConfig.diff };
103
+ const notifyConfig: NotifyConfig = { ...allConfig.notify };
100
104
 
101
105
  // Build composed items from sub-packages
102
106
  const coreItems = getCoreSettingsItems(coreConfig);
103
107
  const footerItems = getFooterSettingsItems();
104
108
  const diffItems = getDiffSettingsItems();
109
+ const notifyItems = getNotifySettingsItems(notifyConfig);
105
110
 
106
111
  // Add submenus for text/number fields
107
112
  const addSubmenus = (items: SettingItem[]) => {
@@ -145,6 +150,13 @@ export function openSettings(pi: ExtensionAPI, ctx: ExtensionContext): void {
145
150
  confirmHint: "min 80",
146
151
  min: 80,
147
152
  });
153
+ } else if (item.id === "delayMs") {
154
+ item.submenu = createNumberSubmenu({
155
+ label: "Enter delay in seconds (ESC to cancel):",
156
+ cancelHint: "ESC: cancel",
157
+ confirmHint: "min 1",
158
+ min: 1,
159
+ });
148
160
  }
149
161
  }
150
162
  };
@@ -152,11 +164,13 @@ export function openSettings(pi: ExtensionAPI, ctx: ExtensionContext): void {
152
164
  addSubmenus(coreItems);
153
165
  addSubmenus(diffItems);
154
166
  addSubmenus(footerItems);
167
+ addSubmenus(notifyItems);
155
168
 
156
169
  const items: SettingItem[] = [
157
170
  ...coreItems,
158
171
  ...footerItems,
159
172
  ...diffItems,
173
+ ...notifyItems,
160
174
  {
161
175
  id: "save",
162
176
  label: "Save",
@@ -196,11 +210,22 @@ export function openSettings(pi: ExtensionAPI, ctx: ExtensionContext): void {
196
210
  break;
197
211
  }
198
212
 
213
+ // ── Notify settings ──
214
+ case "enabled": notifyConfig.enabled = newValue === "On"; break;
215
+ case "notifyOnAgentEnd": notifyConfig.notifyOnAgentEnd = newValue === "On"; break;
216
+ case "notifyOnQuestion": notifyConfig.notifyOnQuestion = newValue === "On"; break;
217
+ case "delayMs": {
218
+ const v = parseInt(newValue, 10);
219
+ if (Number.isFinite(v) && v >= 1) notifyConfig.delayMs = v * 1000;
220
+ break;
221
+ }
222
+
199
223
  // ── Save ──
200
224
  case "save": {
201
225
  saveCoreConfig(coreConfig);
202
226
  saveFooterConfig(footerConfig);
203
227
  saveDiffConfig(diffConfig);
228
+ saveNotifyConfig(notifyConfig);
204
229
  done(undefined);
205
230
  return;
206
231
  }