@pi-unipi/command-enchantment 0.1.4 → 0.1.6

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-unipi/command-enchantment",
3
- "version": "0.1.4",
3
+ "version": "0.1.6",
4
4
  "description": "Enhanced TUI autocomplete for /unipi:* commands — colored, sorted, and grouped by package",
5
5
  "type": "module",
6
6
  "license": "MIT",
package/src/constants.ts CHANGED
@@ -104,6 +104,7 @@ export const COMMAND_REGISTRY: Record<string, string> = {
104
104
  "unipi:badge-gen": "utility",
105
105
  "unipi:badge-toggle": "utility",
106
106
  "unipi:badge-settings": "utility",
107
+ "unipi:util-settings": "utility",
107
108
 
108
109
  // ask-user (1 command)
109
110
  "unipi:ask-user-settings": "ask-user",
@@ -131,11 +132,13 @@ export const COMMAND_REGISTRY: Record<string, string> = {
131
132
  "unipi:milestone-onboard": "milestone",
132
133
  "unipi:milestone-update": "milestone",
133
134
 
134
- // notify (4 commands)
135
+ // notify (6 commands)
135
136
  "unipi:notify-settings": "notify",
136
137
  "unipi:notify-set-gotify": "notify",
137
138
  "unipi:notify-set-tg": "notify",
139
+ "unipi:notify-set-ntfy": "notify",
138
140
  "unipi:notify-test": "notify",
141
+ "unipi:notify-recap-model": "notify",
139
142
 
140
143
  // kanboard (3 commands)
141
144
  "unipi:kanboard": "kanboard",
@@ -193,6 +196,7 @@ export const COMMAND_DESCRIPTIONS: Record<string, string> = {
193
196
  "unipi:badge-gen": "Generate session name via background agent",
194
197
  "unipi:badge-toggle": "Configure badge settings (autoGen, badgeEnabled, agentTool)",
195
198
  "unipi:badge-settings": "Configure badge settings via TUI overlay",
199
+ "unipi:util-settings": "Unified settings — badge + diff rendering config",
196
200
  "unipi:kanboard": "Start the kanboard visualization server",
197
201
  "unipi:kanboard-doctor": "Diagnose and fix kanboard parser issues",
198
202
 
@@ -217,7 +221,9 @@ export const COMMAND_DESCRIPTIONS: Record<string, string> = {
217
221
  "unipi:notify-settings": "Configure notification platforms and events",
218
222
  "unipi:notify-set-gotify": "Set up Gotify push notifications",
219
223
  "unipi:notify-set-tg": "Set up Telegram bot notifications",
224
+ "unipi:notify-set-ntfy": "Set up ntfy push notifications",
220
225
  "unipi:notify-test": "Test all enabled notification platforms",
226
+ "unipi:notify-recap-model": "Select model for notification recaps",
221
227
 
222
228
  "unipi:milestone-onboard": "Create MILESTONES.md from existing workflow docs",
223
229
  "unipi:milestone-update": "Sync MILESTONES.md with completed work",
package/src/provider.ts CHANGED
@@ -274,16 +274,54 @@ export function createEnchantedProvider(
274
274
  descriptionOverrides,
275
275
  );
276
276
 
277
- // If no unipi items match, just return non-unipi (or null if empty)
277
+ // If no unipi items match, handle skill vs system items
278
278
  if (enhancedUnipiItems.length === 0) {
279
- return nonUnipiItems.length > 0
280
- ? { items: nonUnipiItems, prefix: effectivePrefix }
279
+ if (nonUnipiItems.length === 0) return null;
280
+
281
+ // Check if user explicitly typed /skill: prefix
282
+ const isSkillQuery = effectivePrefix.replace(/^\//, "").toLowerCase().startsWith("skill:");
283
+
284
+ if (isSkillQuery) {
285
+ // User wants skill commands — return them
286
+ return { items: nonUnipiItems, prefix: effectivePrefix };
287
+ }
288
+
289
+ // Otherwise, filter out skill commands from suggestions
290
+ const systemOnly = nonUnipiItems.filter(item => !item.value.startsWith("skill:"));
291
+ return systemOnly.length > 0
292
+ ? { items: systemOnly, prefix: effectivePrefix }
281
293
  : null;
282
294
  }
283
295
 
284
- // Merge: system commands first, then enhanced unipi (sorted by package)
296
+ // Separate non-unipi items into system commands and skill commands
297
+ const systemItems: AutocompleteItem[] = [];
298
+ const skillItems: AutocompleteItem[] = [];
299
+
300
+ for (const item of nonUnipiItems) {
301
+ if (item.value.startsWith("skill:")) {
302
+ skillItems.push(item);
303
+ } else {
304
+ systemItems.push(item);
305
+ }
306
+ }
307
+
308
+ // Check if user explicitly typed /skill: prefix
309
+ const isExplicitSkillQuery = effectivePrefix.replace(/^\//, "").toLowerCase().startsWith("skill:");
310
+
311
+ // Build final list based on query context
312
+ let finalItems: AutocompleteItem[];
313
+
314
+ if (isExplicitSkillQuery) {
315
+ // User explicitly wants skill commands — show them first
316
+ finalItems = [...skillItems, ...enhancedUnipiItems, ...systemItems];
317
+ } else {
318
+ // Default: unipi commands first, then system commands, hide skill commands
319
+ // (skill commands are redundant when unipi equivalents exist)
320
+ finalItems = [...enhancedUnipiItems, ...systemItems];
321
+ }
322
+
285
323
  return {
286
- items: [...nonUnipiItems, ...enhancedUnipiItems],
324
+ items: finalItems,
287
325
  prefix: effectivePrefix,
288
326
  };
289
327
  },