ccperm 1.9.0 → 1.9.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/dist/interactive.js +4 -4
- package/dist/renderer.js +4 -4
- package/package.json +1 -1
package/dist/interactive.js
CHANGED
|
@@ -120,7 +120,7 @@ function renderList(state, withPerms, emptyCount) {
|
|
|
120
120
|
const cats = ['Bash', 'WebFetch', 'MCP', 'Tools'];
|
|
121
121
|
const catsPresent = cats.filter((c) => withPerms.some((r) => r.groups.has(c)));
|
|
122
122
|
const catColWidth = catsPresent.length * 7;
|
|
123
|
-
const maxName = Math.max(...withPerms.map((r) => r.shortName.length), 7);
|
|
123
|
+
const maxName = Math.max(...withPerms.map((r) => r.isGlobal ? r.shortName.length + 2 : r.shortName.length), 7);
|
|
124
124
|
const nameWidth = Math.min(maxName, inner - catColWidth - 16);
|
|
125
125
|
const hasGlobalSep = withPerms.some((r) => r.isGlobal) && withPerms.some((r) => !r.isGlobal);
|
|
126
126
|
// box takes: top(1) + header(2) + sep(1) + content + globalSep?(1) + emptyLine?(1) + bottom(1)
|
|
@@ -140,12 +140,12 @@ function renderList(state, withPerms, emptyCount) {
|
|
|
140
140
|
for (let i = state.scrollOffset; i < end; i++) {
|
|
141
141
|
const r = withPerms[i];
|
|
142
142
|
const isCursor = i === state.cursor;
|
|
143
|
-
const
|
|
143
|
+
const displayName = r.isGlobal ? `★ ${r.shortName}` : r.shortName;
|
|
144
|
+
const truncName = displayName.length > nameWidth ? displayName.slice(0, nameWidth - 1) + '…' : displayName;
|
|
144
145
|
const typeTag = r.isGlobal ? pad('', 7) : `${colors_js_1.DIM} ${pad(r.fileType, 6)}${colors_js_1.NC}`;
|
|
145
|
-
const prefix = r.isGlobal ? '★ ' : '';
|
|
146
146
|
const marker = isCursor ? `${colors_js_1.CYAN}▸ ` : ' ';
|
|
147
147
|
const nameStyle = isCursor ? `${colors_js_1.BOLD}` : r.isGlobal ? `${colors_js_1.YELLOW}` : '';
|
|
148
|
-
const nameCol = `${marker}${nameStyle}${
|
|
148
|
+
const nameCol = `${marker}${nameStyle}${pad(truncName, nameWidth)}${colors_js_1.NC}${typeTag}`;
|
|
149
149
|
const catCols = catsPresent.map((c) => {
|
|
150
150
|
const count = r.groups.get(c) || 0;
|
|
151
151
|
if (count > 0)
|
package/dist/renderer.js
CHANGED
|
@@ -19,7 +19,7 @@ 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 maxName = Math.max(...withPerms.map((r) => r.shortName.length), 7);
|
|
22
|
+
const maxName = Math.max(...withPerms.map((r) => r.isGlobal ? r.shortName.length + 2 : r.shortName.length), 7);
|
|
23
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);
|
|
@@ -27,11 +27,11 @@ function printCompact(entries, summary) {
|
|
|
27
27
|
// rows
|
|
28
28
|
for (let i = 0; i < withPerms.length; i++) {
|
|
29
29
|
const result = withPerms[i];
|
|
30
|
-
const
|
|
30
|
+
const displayName = result.isGlobal ? `★ ${result.shortName}` : result.shortName;
|
|
31
|
+
const truncName = displayName.length > nameWidth ? displayName.slice(0, nameWidth - 1) + '…' : displayName;
|
|
31
32
|
const typeTag = result.isGlobal ? pad('', 7) : `${colors_js_1.DIM} ${pad(result.fileType, 6)}${colors_js_1.NC}`;
|
|
32
|
-
const prefix = result.isGlobal ? '★ ' : '';
|
|
33
33
|
const nameStyle = result.isGlobal ? `${colors_js_1.YELLOW}` : '';
|
|
34
|
-
const nameCol = ` ${nameStyle}${
|
|
34
|
+
const nameCol = ` ${nameStyle}${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}`;
|