claude-agent-skills 1.5.0 → 1.5.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/commands/hub.js +18 -9
- package/lib/picker.js +3 -1
- package/package.json +1 -1
- package/skills.json +1 -1
package/commands/hub.js
CHANGED
|
@@ -22,12 +22,12 @@ import { runCheck } from './check.js';
|
|
|
22
22
|
const SKIP = { skipIntro: true };
|
|
23
23
|
|
|
24
24
|
const MENU = [
|
|
25
|
-
{ value: 'add', label: 'Add Skill(s)',
|
|
26
|
-
{ value: 'update', label: 'Update Existing Skill(s)',
|
|
27
|
-
{ value: 'remove', label: 'Remove Existing Skill(s)',
|
|
28
|
-
{ value: 'list', label: 'List Installed Skill(s)',
|
|
29
|
-
{ value: 'sync', label: 'Sync/Restore from Lockfile',
|
|
30
|
-
{ value: 'check', label: 'Check Skill(s)',
|
|
25
|
+
{ value: 'add', label: 'Add Skill(s)', hint: 'install new skills' },
|
|
26
|
+
{ value: 'update', label: 'Update Existing Skill(s)', hint: 'pull latest versions' },
|
|
27
|
+
{ value: 'remove', label: 'Remove Existing Skill(s)', hint: 'uninstall skills' },
|
|
28
|
+
{ value: 'list', label: 'List Installed Skill(s)', hint: "show what's installed" },
|
|
29
|
+
{ value: 'sync', label: 'Sync/Restore from Lockfile', hint: 'restore from claude-skills-lock.json' },
|
|
30
|
+
{ value: 'check', label: 'Check Skill(s)', hint: 'verify hashes & lockfile' },
|
|
31
31
|
{ value: 'quit', label: 'Quit' },
|
|
32
32
|
];
|
|
33
33
|
|
|
@@ -38,13 +38,21 @@ function printCompactHeader() {
|
|
|
38
38
|
process.stdout.write('\n');
|
|
39
39
|
}
|
|
40
40
|
|
|
41
|
+
function restoreScreen() {
|
|
42
|
+
process.stdout.write('\x1b[?1049l');
|
|
43
|
+
}
|
|
44
|
+
|
|
41
45
|
export async function runHub() {
|
|
46
|
+
// Enter alternate screen buffer — isolated viewport with no scrollback accumulation.
|
|
47
|
+
// Original terminal content is restored when we exit (same as vim/less/claude-code).
|
|
48
|
+
process.stdout.write('\x1b[?1049h\x1b[2J\x1b[H');
|
|
49
|
+
process.on('exit', restoreScreen); // covers Ctrl+C, process.exit(), uncaught errors
|
|
50
|
+
|
|
42
51
|
await showIntro();
|
|
43
52
|
|
|
44
53
|
let first = true;
|
|
45
54
|
for (;;) {
|
|
46
55
|
if (!first) {
|
|
47
|
-
// Clear entire screen and show compact header instead of re-running the banner
|
|
48
56
|
process.stdout.write('\x1b[2J\x1b[H');
|
|
49
57
|
printCompactHeader();
|
|
50
58
|
}
|
|
@@ -58,7 +66,7 @@ export async function runHub() {
|
|
|
58
66
|
});
|
|
59
67
|
|
|
60
68
|
if (choice === 'quit') {
|
|
61
|
-
|
|
69
|
+
restoreScreen();
|
|
62
70
|
return;
|
|
63
71
|
}
|
|
64
72
|
|
|
@@ -71,9 +79,10 @@ export async function runHub() {
|
|
|
71
79
|
} catch (e) {
|
|
72
80
|
if (e instanceof CliCancel) continue; // sub-command ESC → back to menu
|
|
73
81
|
if (e?.isCancel) { // hub menu ESC → quit
|
|
74
|
-
|
|
82
|
+
restoreScreen();
|
|
75
83
|
return;
|
|
76
84
|
}
|
|
85
|
+
restoreScreen();
|
|
77
86
|
throw e;
|
|
78
87
|
}
|
|
79
88
|
}
|
package/lib/picker.js
CHANGED
|
@@ -157,7 +157,9 @@ export async function skillPicker({ message, options }) {
|
|
|
157
157
|
if (key === KEY.ENTER) {
|
|
158
158
|
if (!sel.size) return;
|
|
159
159
|
cleanup();
|
|
160
|
-
|
|
160
|
+
// Clear entire picker block then write compact confirmation
|
|
161
|
+
if (lastLines > 0) process.stdout.write(`\x1b[${lastLines}A\x1b[0J`);
|
|
162
|
+
process.stdout.write(success('◆') + ' ' +
|
|
161
163
|
white(`${sel.size} skill(s) selected`) + '\n');
|
|
162
164
|
resolve([...sel].sort((a, b) => a - b).map(i => options[i].value));
|
|
163
165
|
return;
|
package/package.json
CHANGED