@pi-unipi/command-enchantment 2.6.0 → 2.6.2
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 +4 -2
- package/src/constants.ts +43 -15
- package/src/provider.ts +3 -17
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@pi-unipi/command-enchantment",
|
|
3
|
-
"version": "2.6.
|
|
3
|
+
"version": "2.6.2",
|
|
4
4
|
"description": "Enhanced TUI autocomplete for /unipi:* commands — colored, sorted, and grouped by package",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "src/index.ts",
|
|
@@ -40,7 +40,9 @@
|
|
|
40
40
|
"vitest": "^4.1.5"
|
|
41
41
|
},
|
|
42
42
|
"pi": {
|
|
43
|
-
"extensions": [
|
|
43
|
+
"extensions": [
|
|
44
|
+
"./src/index.ts"
|
|
45
|
+
],
|
|
44
46
|
"skills": [],
|
|
45
47
|
"prompts": [],
|
|
46
48
|
"themes": []
|
package/src/constants.ts
CHANGED
|
@@ -33,8 +33,9 @@ export const PACKAGE_ORDER: string[] = [
|
|
|
33
33
|
"footer",
|
|
34
34
|
"updater",
|
|
35
35
|
"input-shortcuts",
|
|
36
|
-
"cocoindex",
|
|
37
36
|
"image",
|
|
37
|
+
"subagents",
|
|
38
|
+
"background-tasks",
|
|
38
39
|
];
|
|
39
40
|
|
|
40
41
|
// ─── Package Colors ──────────────────────────────────────────────────
|
|
@@ -56,8 +57,9 @@ export const PACKAGE_COLORS: Record<string, string> = {
|
|
|
56
57
|
footer: `${ESC}[34m`, // Blue
|
|
57
58
|
updater: `${ESC}[93m`, // Bright Yellow
|
|
58
59
|
"input-shortcuts": `${ESC}[95m`, // Bright Magenta
|
|
59
|
-
cocoindex: `${ESC}[97m`, // Bright White
|
|
60
60
|
image: `${ESC}[35m`, // Magenta
|
|
61
|
+
subagents: `${ESC}[34m`, // Blue
|
|
62
|
+
"background-tasks": `${ESC}[91m`, // Bright Red
|
|
61
63
|
};
|
|
62
64
|
|
|
63
65
|
// ─── Command Registry ────────────────────────────────────────────────
|
|
@@ -131,6 +133,25 @@ export const COMMAND_REGISTRY: Record<string, string> = {
|
|
|
131
133
|
// ask-user (1 command)
|
|
132
134
|
"unipi:ask-user-settings": "ask-user",
|
|
133
135
|
|
|
136
|
+
// subagents (3 commands)
|
|
137
|
+
"unipi:subagents-fleet": "subagents",
|
|
138
|
+
"unipi:subagents-doctor": "subagents",
|
|
139
|
+
"unipi:subagents-guide": "subagents",
|
|
140
|
+
|
|
141
|
+
// background-tasks (8 commands)
|
|
142
|
+
"unipi:bg": "background-tasks",
|
|
143
|
+
"unipi:bg-clear": "background-tasks",
|
|
144
|
+
"unipi:bg-tasks": "background-tasks",
|
|
145
|
+
"unipi:bg-settings": "background-tasks",
|
|
146
|
+
"unipi:bg-update": "background-tasks",
|
|
147
|
+
"unipi:tasks": "background-tasks",
|
|
148
|
+
"unipi:jobs": "background-tasks",
|
|
149
|
+
"unipi:kill": "background-tasks",
|
|
150
|
+
"unipi:logs": "background-tasks",
|
|
151
|
+
"unipi:claude-cache": "background-tasks",
|
|
152
|
+
"unipi:fusion": "background-tasks",
|
|
153
|
+
"unipi:fusion-models": "background-tasks",
|
|
154
|
+
|
|
134
155
|
// info (2 commands)
|
|
135
156
|
"unipi:info": "info",
|
|
136
157
|
"unipi:info-settings": "info",
|
|
@@ -151,12 +172,6 @@ export const COMMAND_REGISTRY: Record<string, string> = {
|
|
|
151
172
|
"unipi:compact-preset": "compact",
|
|
152
173
|
"unipi:compact-help": "compact",
|
|
153
174
|
|
|
154
|
-
// cocoindex (5 commands)
|
|
155
|
-
"unipi:cocoindex-update": "cocoindex",
|
|
156
|
-
"unipi:cocoindex-status": "cocoindex",
|
|
157
|
-
"unipi:cocoindex-init": "cocoindex",
|
|
158
|
-
"unipi:cocoindex-search": "cocoindex",
|
|
159
|
-
"unipi:cocoindex-settings": "cocoindex",
|
|
160
175
|
|
|
161
176
|
// milestone (2 commands)
|
|
162
177
|
"unipi:milestone-onboard": "milestone",
|
|
@@ -169,6 +184,7 @@ export const COMMAND_REGISTRY: Record<string, string> = {
|
|
|
169
184
|
"unipi:notify-set-ntfy": "notify",
|
|
170
185
|
"unipi:notify-test": "notify",
|
|
171
186
|
"unipi:notify-recap-model": "notify",
|
|
187
|
+
"unipi:notify-event": "notify",
|
|
172
188
|
|
|
173
189
|
// kanboard (2 commands)
|
|
174
190
|
"unipi:kanboard": "kanboard",
|
|
@@ -270,18 +286,13 @@ export const COMMAND_DESCRIPTIONS: Record<string, string> = {
|
|
|
270
286
|
"unipi:compact-settings": "Configure compaction settings",
|
|
271
287
|
"unipi:compact-preset": "Manage compaction presets",
|
|
272
288
|
"unipi:compact-help": "Show compactor command help",
|
|
273
|
-
"unipi:cocoindex-update": "Run CocoIndex update to index project",
|
|
274
|
-
"unipi:cocoindex-status": "Show CocoIndex indexing status",
|
|
275
|
-
"unipi:cocoindex-init": "Initialize CocoIndex pipeline",
|
|
276
|
-
"unipi:cocoindex-search": "Search indexed codebase semantically",
|
|
277
|
-
"unipi:cocoindex-settings": "Show CocoIndex configuration",
|
|
278
|
-
|
|
279
289
|
"unipi:notify-settings": "Configure notification platforms and events",
|
|
280
290
|
"unipi:notify-set-gotify": "Set up Gotify push notifications",
|
|
281
291
|
"unipi:notify-set-tg": "Set up Telegram bot notifications",
|
|
282
292
|
"unipi:notify-set-ntfy": "Set up ntfy push notifications",
|
|
283
293
|
"unipi:notify-test": "Test all enabled notification platforms",
|
|
284
294
|
"unipi:notify-recap-model": "Select model for notification recaps",
|
|
295
|
+
"unipi:notify-event": "Toggle a notify event without the TUI: <event> <on|off>",
|
|
285
296
|
|
|
286
297
|
"unipi:milestone-onboard": "Create MILESTONES.md from existing workflow docs",
|
|
287
298
|
"unipi:milestone-update": "Sync MILESTONES.md with completed work",
|
|
@@ -295,6 +306,22 @@ export const COMMAND_DESCRIPTIONS: Record<string, string> = {
|
|
|
295
306
|
"unipi:updater-settings": "Configure updater — check interval and auto-update",
|
|
296
307
|
|
|
297
308
|
"unipi:stash-settings": "Open input shortcuts settings — customize keybindings",
|
|
309
|
+
|
|
310
|
+
"unipi:bg": "Start a shell command as a tracked background task",
|
|
311
|
+
"unipi:bg-clear": "Clear finished background task footer notices",
|
|
312
|
+
"unipi:bg-tasks": "Open the background task manager UI",
|
|
313
|
+
"unipi:bg-settings": "Open background-tasks settings (master toggle, defaults)",
|
|
314
|
+
"unipi:bg-update": "Show installed background-tasks version and update instructions",
|
|
315
|
+
"unipi:tasks": "Open the background task manager UI",
|
|
316
|
+
"unipi:jobs": "List running and recent background tasks",
|
|
317
|
+
"unipi:kill": "Stop a running background task: /unipi:kill <id>",
|
|
318
|
+
"unipi:logs": "Show bounded output from a background task",
|
|
319
|
+
"unipi:claude-cache": "Show or set Claude cache retention for this session",
|
|
320
|
+
"unipi:fusion": "Run the Fusion reason workflow with a prompt",
|
|
321
|
+
"unipi:fusion-models": "Open the Fusion five-slot model selector",
|
|
322
|
+
"unipi:subagents-fleet": "Open the subagents fleet view",
|
|
323
|
+
"unipi:subagents-doctor": "Diagnose subagents configuration",
|
|
324
|
+
"unipi:subagents-guide": "Show the subagents usage guide",
|
|
298
325
|
};
|
|
299
326
|
|
|
300
327
|
// ─── Package Display Names ───────────────────────────────────────────
|
|
@@ -316,6 +343,7 @@ export const PACKAGE_LABELS: Record<string, string> = {
|
|
|
316
343
|
footer: "footer",
|
|
317
344
|
updater: "updater",
|
|
318
345
|
"input-shortcuts": "input-shortcuts",
|
|
319
|
-
cocoindex: "cocoindex",
|
|
320
346
|
image: "image",
|
|
347
|
+
subagents: "subagents",
|
|
348
|
+
"background-tasks": "background-tasks",
|
|
321
349
|
};
|
package/src/provider.ts
CHANGED
|
@@ -11,7 +11,7 @@ import type {
|
|
|
11
11
|
AutocompleteProvider,
|
|
12
12
|
AutocompleteSuggestions,
|
|
13
13
|
} from "@earendil-works/pi-tui";
|
|
14
|
-
import {
|
|
14
|
+
import { fuzzyMatch as piFuzzyMatch } from "@earendil-works/pi-tui";
|
|
15
15
|
|
|
16
16
|
import {
|
|
17
17
|
COMMAND_REGISTRY,
|
|
@@ -27,20 +27,6 @@ import {
|
|
|
27
27
|
} from "./sorting.js";
|
|
28
28
|
import type { TaggedItem } from "./sorting.js";
|
|
29
29
|
|
|
30
|
-
// ─── Fuzzy matching ──────────────────────────────────────────────────
|
|
31
|
-
|
|
32
|
-
/** Simple character-subsequence fuzzy match (case-insensitive) */
|
|
33
|
-
function fuzzyMatch(text: string, query: string): boolean {
|
|
34
|
-
if (!query) return true;
|
|
35
|
-
const lower = text.toLowerCase();
|
|
36
|
-
const q = query.toLowerCase();
|
|
37
|
-
let qi = 0;
|
|
38
|
-
for (let i = 0; i < lower.length && qi < q.length; i++) {
|
|
39
|
-
if (lower[i] === q[qi]) qi++;
|
|
40
|
-
}
|
|
41
|
-
return qi === q.length;
|
|
42
|
-
}
|
|
43
|
-
|
|
44
30
|
// ─── Namespace detection ─────────────────────────────────────────────
|
|
45
31
|
|
|
46
32
|
/**
|
|
@@ -131,9 +117,9 @@ function getEnhancedUnipiItems(
|
|
|
131
117
|
// commands surface when the user hasn't typed the full prefix.
|
|
132
118
|
matched = entries.filter(([cmd]) => {
|
|
133
119
|
if (isPastUnipiColon) {
|
|
134
|
-
return
|
|
120
|
+
return piFuzzyMatch(query, cmd.replace("unipi:", "").toLowerCase()).matches;
|
|
135
121
|
}
|
|
136
|
-
return
|
|
122
|
+
return piFuzzyMatch(query, cmd.toLowerCase()).matches;
|
|
137
123
|
});
|
|
138
124
|
}
|
|
139
125
|
|