ccperm 1.8.3 → 1.8.5
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/dist/interactive.js +7 -7
- package/dist/renderer.js +7 -7
- package/package.json +1 -1
package/dist/interactive.js
CHANGED
|
@@ -116,8 +116,8 @@ function renderList(state, withPerms, emptyCount) {
|
|
|
116
116
|
const cats = ['Bash', 'WebFetch', 'MCP', 'Tools'];
|
|
117
117
|
const catsPresent = cats.filter((c) => withPerms.some((r) => r.groups.has(c)));
|
|
118
118
|
const catColWidth = catsPresent.length * 7;
|
|
119
|
-
const
|
|
120
|
-
const nameWidth = Math.min(
|
|
119
|
+
const maxName = Math.max(...withPerms.map((r) => r.shortName.length), 7);
|
|
120
|
+
const nameWidth = Math.min(maxName, inner - catColWidth - 16);
|
|
121
121
|
const hasGlobalSep = withPerms.some((r) => r.isGlobal) && withPerms.some((r) => !r.isGlobal);
|
|
122
122
|
// box takes: top(1) + header(2) + sep(1) + content + globalSep?(1) + emptyLine?(1) + bottom(1)
|
|
123
123
|
const chrome = 5 + (hasGlobalSep ? 1 : 0) + (emptyCount > 0 ? 1 : 0);
|
|
@@ -136,12 +136,12 @@ function renderList(state, withPerms, emptyCount) {
|
|
|
136
136
|
for (let i = state.scrollOffset; i < end; i++) {
|
|
137
137
|
const r = withPerms[i];
|
|
138
138
|
const isCursor = i === state.cursor;
|
|
139
|
-
const
|
|
140
|
-
const
|
|
141
|
-
const
|
|
139
|
+
const truncName = r.shortName.length > nameWidth ? r.shortName.slice(0, nameWidth - 1) + '…' : r.shortName;
|
|
140
|
+
const typeTag = r.isGlobal ? pad('', 7) : `${colors_js_1.DIM} ${pad(r.fileType, 6)}${colors_js_1.NC}`;
|
|
141
|
+
const prefix = r.isGlobal ? '★ ' : '';
|
|
142
142
|
const marker = isCursor ? `${colors_js_1.CYAN}▸ ` : ' ';
|
|
143
|
-
const nameStyle = isCursor ? `${colors_js_1.BOLD}` : r.isGlobal ? `${colors_js_1.YELLOW}` :
|
|
144
|
-
const nameCol = `${marker}${nameStyle}${pad(truncName, nameWidth)}${colors_js_1.NC}`;
|
|
143
|
+
const nameStyle = isCursor ? `${colors_js_1.BOLD}` : r.isGlobal ? `${colors_js_1.YELLOW}` : '';
|
|
144
|
+
const nameCol = `${marker}${nameStyle}${prefix}${pad(truncName, nameWidth)}${colors_js_1.NC}${typeTag}`;
|
|
145
145
|
const catCols = catsPresent.map((c) => {
|
|
146
146
|
const count = r.groups.get(c) || 0;
|
|
147
147
|
if (count > 0)
|
package/dist/renderer.js
CHANGED
|
@@ -19,19 +19,19 @@ function printCompact(entries, summary) {
|
|
|
19
19
|
const withPerms = [...globals, ...projects];
|
|
20
20
|
const emptyCount = entries.filter((r) => r.totalCount === 0 && !r.isGlobal).length;
|
|
21
21
|
// header
|
|
22
|
-
const
|
|
23
|
-
const nameWidth = Math.min(
|
|
22
|
+
const maxName = Math.max(...withPerms.map((r) => r.shortName.length), 7);
|
|
23
|
+
const nameWidth = Math.min(maxName, 40);
|
|
24
24
|
const header = ` ${colors_js_1.DIM}${pad('PROJECT', nameWidth)} ${catsPresent.map((c) => rpad(c, 5)).join(' ')} TOTAL${colors_js_1.NC}`;
|
|
25
25
|
console.log(header);
|
|
26
26
|
console.log(` ${colors_js_1.DIM}${'─'.repeat(nameWidth + catsPresent.length * 7 + 8)}${colors_js_1.NC}`);
|
|
27
27
|
// rows
|
|
28
28
|
for (let i = 0; i < withPerms.length; i++) {
|
|
29
29
|
const result = withPerms[i];
|
|
30
|
-
const
|
|
31
|
-
const
|
|
32
|
-
const
|
|
33
|
-
const nameStyle = result.isGlobal ? `${colors_js_1.YELLOW}` :
|
|
34
|
-
const nameCol = ` ${nameStyle}${pad(truncName, nameWidth)}${colors_js_1.NC}`;
|
|
30
|
+
const truncName = result.shortName.length > nameWidth ? result.shortName.slice(0, nameWidth - 1) + '…' : result.shortName;
|
|
31
|
+
const typeTag = result.isGlobal ? pad('', 7) : `${colors_js_1.DIM} ${pad(result.fileType, 6)}${colors_js_1.NC}`;
|
|
32
|
+
const prefix = result.isGlobal ? '★ ' : '';
|
|
33
|
+
const nameStyle = result.isGlobal ? `${colors_js_1.YELLOW}` : '';
|
|
34
|
+
const nameCol = ` ${nameStyle}${prefix}${pad(truncName, nameWidth)}${colors_js_1.NC}${typeTag}`;
|
|
35
35
|
const catCols = catsPresent.map((c) => {
|
|
36
36
|
const count = result.groups.get(c) || 0;
|
|
37
37
|
return count > 0 ? rpad(count, 5) : `${colors_js_1.DIM}${rpad('·', 5)}${colors_js_1.NC}`;
|