@pi-unipi/command-enchantment 0.1.5 → 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 +1 -1
- package/src/constants.ts +5 -1
- package/src/provider.ts +43 -5
package/package.json
CHANGED
package/src/constants.ts
CHANGED
|
@@ -132,11 +132,13 @@ export const COMMAND_REGISTRY: Record<string, string> = {
|
|
|
132
132
|
"unipi:milestone-onboard": "milestone",
|
|
133
133
|
"unipi:milestone-update": "milestone",
|
|
134
134
|
|
|
135
|
-
// notify (
|
|
135
|
+
// notify (6 commands)
|
|
136
136
|
"unipi:notify-settings": "notify",
|
|
137
137
|
"unipi:notify-set-gotify": "notify",
|
|
138
138
|
"unipi:notify-set-tg": "notify",
|
|
139
|
+
"unipi:notify-set-ntfy": "notify",
|
|
139
140
|
"unipi:notify-test": "notify",
|
|
141
|
+
"unipi:notify-recap-model": "notify",
|
|
140
142
|
|
|
141
143
|
// kanboard (3 commands)
|
|
142
144
|
"unipi:kanboard": "kanboard",
|
|
@@ -219,7 +221,9 @@ export const COMMAND_DESCRIPTIONS: Record<string, string> = {
|
|
|
219
221
|
"unipi:notify-settings": "Configure notification platforms and events",
|
|
220
222
|
"unipi:notify-set-gotify": "Set up Gotify push notifications",
|
|
221
223
|
"unipi:notify-set-tg": "Set up Telegram bot notifications",
|
|
224
|
+
"unipi:notify-set-ntfy": "Set up ntfy push notifications",
|
|
222
225
|
"unipi:notify-test": "Test all enabled notification platforms",
|
|
226
|
+
"unipi:notify-recap-model": "Select model for notification recaps",
|
|
223
227
|
|
|
224
228
|
"unipi:milestone-onboard": "Create MILESTONES.md from existing workflow docs",
|
|
225
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,
|
|
277
|
+
// If no unipi items match, handle skill vs system items
|
|
278
278
|
if (enhancedUnipiItems.length === 0) {
|
|
279
|
-
|
|
280
|
-
|
|
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
|
-
//
|
|
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:
|
|
324
|
+
items: finalItems,
|
|
287
325
|
prefix: effectivePrefix,
|
|
288
326
|
};
|
|
289
327
|
},
|