@pi-unipi/command-enchantment 0.1.5 → 0.1.7
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 +15 -1
- package/src/provider.ts +43 -5
package/package.json
CHANGED
package/src/constants.ts
CHANGED
|
@@ -29,6 +29,7 @@ export const PACKAGE_ORDER: string[] = [
|
|
|
29
29
|
"compact",
|
|
30
30
|
"notify",
|
|
31
31
|
"kanboard",
|
|
32
|
+
"footer",
|
|
32
33
|
];
|
|
33
34
|
|
|
34
35
|
// ─── Package Colors ──────────────────────────────────────────────────
|
|
@@ -46,6 +47,7 @@ export const PACKAGE_COLORS: Record<string, string> = {
|
|
|
46
47
|
compact: `${ESC}[37m`, // White
|
|
47
48
|
notify: `${ESC}[96m`, // Bright Cyan
|
|
48
49
|
kanboard: `${ESC}[92m`, // Bright Green
|
|
50
|
+
footer: `${ESC}[34m`, // Blue
|
|
49
51
|
};
|
|
50
52
|
|
|
51
53
|
// ─── Command Registry ────────────────────────────────────────────────
|
|
@@ -132,15 +134,21 @@ export const COMMAND_REGISTRY: Record<string, string> = {
|
|
|
132
134
|
"unipi:milestone-onboard": "milestone",
|
|
133
135
|
"unipi:milestone-update": "milestone",
|
|
134
136
|
|
|
135
|
-
// notify (
|
|
137
|
+
// notify (6 commands)
|
|
136
138
|
"unipi:notify-settings": "notify",
|
|
137
139
|
"unipi:notify-set-gotify": "notify",
|
|
138
140
|
"unipi:notify-set-tg": "notify",
|
|
141
|
+
"unipi:notify-set-ntfy": "notify",
|
|
139
142
|
"unipi:notify-test": "notify",
|
|
143
|
+
"unipi:notify-recap-model": "notify",
|
|
140
144
|
|
|
141
145
|
// kanboard (3 commands)
|
|
142
146
|
"unipi:kanboard": "kanboard",
|
|
143
147
|
"unipi:kanboard-doctor": "kanboard",
|
|
148
|
+
|
|
149
|
+
// footer (2 commands)
|
|
150
|
+
"unipi:footer": "footer",
|
|
151
|
+
"unipi:footer-settings": "footer",
|
|
144
152
|
};
|
|
145
153
|
|
|
146
154
|
// ─── Description Map ─────────────────────────────────────────────────
|
|
@@ -219,10 +227,15 @@ export const COMMAND_DESCRIPTIONS: Record<string, string> = {
|
|
|
219
227
|
"unipi:notify-settings": "Configure notification platforms and events",
|
|
220
228
|
"unipi:notify-set-gotify": "Set up Gotify push notifications",
|
|
221
229
|
"unipi:notify-set-tg": "Set up Telegram bot notifications",
|
|
230
|
+
"unipi:notify-set-ntfy": "Set up ntfy push notifications",
|
|
222
231
|
"unipi:notify-test": "Test all enabled notification platforms",
|
|
232
|
+
"unipi:notify-recap-model": "Select model for notification recaps",
|
|
223
233
|
|
|
224
234
|
"unipi:milestone-onboard": "Create MILESTONES.md from existing workflow docs",
|
|
225
235
|
"unipi:milestone-update": "Sync MILESTONES.md with completed work",
|
|
236
|
+
|
|
237
|
+
"unipi:footer": "Toggle footer or switch preset",
|
|
238
|
+
"unipi:footer-settings": "Open footer settings — toggle groups and segments",
|
|
226
239
|
};
|
|
227
240
|
|
|
228
241
|
// ─── Package Display Names ───────────────────────────────────────────
|
|
@@ -240,4 +253,5 @@ export const PACKAGE_LABELS: Record<string, string> = {
|
|
|
240
253
|
compact: "compact",
|
|
241
254
|
notify: "notify",
|
|
242
255
|
kanboard: "kanboard",
|
|
256
|
+
footer: "footer",
|
|
243
257
|
};
|
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
|
},
|