@hype/clod 1.3.1 → 1.3.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/dist/list.js +0 -3
- package/dist/ui.js +5 -6
- package/package.json +4 -4
package/dist/list.js
CHANGED
|
@@ -4,9 +4,6 @@ const sessionIdAt = (items, i) => items[i].session.sessionId;
|
|
|
4
4
|
// below these widths a column is hidden rather than truncated into noise
|
|
5
5
|
export const BRANCH_MIN = 8;
|
|
6
6
|
export const DIR_MIN = 10;
|
|
7
|
-
export function termSize(stdout) {
|
|
8
|
-
return { width: stdout?.columns || 80, height: stdout?.rows || 24 };
|
|
9
|
-
}
|
|
10
7
|
export function truncate(str, max) {
|
|
11
8
|
if (!str)
|
|
12
9
|
return '';
|
package/dist/ui.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { Box, Text, useApp, useInput,
|
|
1
|
+
import { Box, Text, useApp, useInput, useWindowSize } from 'ink';
|
|
2
2
|
import React from 'react';
|
|
3
3
|
import { saveConfig } from './config.js';
|
|
4
|
-
import { buildDisplayItems, computeNavigate, computePage, computeRowLayout, ctxStr, displayTitle, filterItems, findAdjacentSessionId, nextSortMode, pad,
|
|
4
|
+
import { buildDisplayItems, computeNavigate, computePage, computeRowLayout, ctxStr, displayTitle, filterItems, findAdjacentSessionId, nextSortMode, pad, truncate, usedStr } from './list.js';
|
|
5
5
|
import { deleteSession, fmtTokens, getSessionMessages, MONTHS, relativeTime, renameSession, shortPath } from './sessions.js';
|
|
6
6
|
import { bar, computeStats, sparkline } from './stats.js';
|
|
7
7
|
const h = React.createElement;
|
|
@@ -184,10 +184,9 @@ function StatsView({ sessions, onBack, termWidth, termHeight }) {
|
|
|
184
184
|
const section = (label) => h(Box, { marginTop: 1 }, h(Text, { bold: true, color: 'cyan' }, label));
|
|
185
185
|
return h(Box, { flexDirection: 'column' }, h(Box, { paddingX: 1 }, h(Text, { color: 'white', bold: true }, 'Usage · real throughput (cache reads excluded)')), h(Box, { paddingX: 1, flexDirection: 'column' }, h(Text, {}, `${stats.totalSessions} sessions `, h(Text, { color: 'green', bold: true }, `${fmtTokens(stats.totalThroughput)} throughput`), h(Text, { dimColor: true }, ` ${fmtTokens(stats.grandTotal)} incl. cache reads`)), section('Token breakdown'), ...bdRows.map((r) => h(Text, { key: r.label }, pad(r.label, labelW), h(Text, { color: r.label === 'Cache rd' ? 'gray' : 'green' }, bar(r.value, bdMax, barW)), h(Text, { dimColor: true }, ` ${fmtTokens(r.value)}`))), section('Throughput / day (30d)'), h(Text, {}, h(Text, { dimColor: true }, `${pad(sparkStart, 7)} `), h(Text, { color: 'green' }, spark), h(Text, { dimColor: true }, ` ${sparkEnd}`)), section('By model'), ...stats.byModel.map((m) => h(Text, { key: m.name }, pad(m.name, labelW), h(Text, { color: 'green' }, bar(m.throughput, modelMax, barW)), h(Text, { dimColor: true }, ` ${fmtTokens(m.throughput)}`))), section('Top projects by throughput'), ...projects.map((p) => h(Text, { key: p.cwd }, pad(truncate(shortPath(p.cwd), projLabelW), projLabelW), ' ', h(Text, { color: 'green' }, bar(p.throughput, projMax, barW)), h(Text, { dimColor: true }, ` ${fmtTokens(p.throughput)}`)))), h(Box, { marginTop: 1 }, h(Text, { dimColor: true }, 'q/esc/u back')));
|
|
186
186
|
}
|
|
187
|
-
export default function App({ loadFirst, loadRest, initialSortMode, onResume, onDelete = deleteSession, onRename = renameSession, loadMessages = getSessionMessages }) {
|
|
187
|
+
export default function App({ loadFirst, loadRest, initialSortMode, onResume, onDelete = deleteSession, onRename = renameSession, loadMessages = getSessionMessages, onSaveConfig = saveConfig }) {
|
|
188
188
|
const { exit } = useApp();
|
|
189
|
-
const {
|
|
190
|
-
const { width: termWidth, height: termHeight } = termSize(stdout);
|
|
189
|
+
const { columns: termWidth, rows: termHeight } = useWindowSize();
|
|
191
190
|
const [sessions, setSessions] = useState([]);
|
|
192
191
|
const [selectedId, setSelectedId] = useState(null);
|
|
193
192
|
const [viewStart, setViewStart] = useState(0);
|
|
@@ -363,7 +362,7 @@ export default function App({ loadFirst, loadRest, initialSortMode, onResume, on
|
|
|
363
362
|
const next = nextSortMode(sortMode);
|
|
364
363
|
setSortMode(next);
|
|
365
364
|
setViewStart(0);
|
|
366
|
-
|
|
365
|
+
onSaveConfig({ sortMode: next }); // persist for next launch (fire and forget)
|
|
367
366
|
}
|
|
368
367
|
else if (input === 'q' || key.escape)
|
|
369
368
|
exit();
|
package/package.json
CHANGED
|
@@ -1,21 +1,21 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@hype/clod",
|
|
3
3
|
"description": "Terminal UI for managing Claude Code sessions.",
|
|
4
|
-
"version": "1.3.
|
|
4
|
+
"version": "1.3.2",
|
|
5
5
|
"author": "Nate Goldman <ungoldman@gmail.com>",
|
|
6
6
|
"bin": {
|
|
7
7
|
"clod": "./dist/index.js"
|
|
8
8
|
},
|
|
9
9
|
"bugs": "https://github.com/ungoldman/clod/issues",
|
|
10
10
|
"dependencies": {
|
|
11
|
-
"ink": "^
|
|
12
|
-
"react": "^19.
|
|
11
|
+
"ink": "^8.0.0",
|
|
12
|
+
"react": "^19.3.0",
|
|
13
13
|
"trash": "^10.1.1"
|
|
14
14
|
},
|
|
15
15
|
"devDependencies": {
|
|
16
16
|
"@biomejs/biome": "^2.5.2",
|
|
17
17
|
"@types/node": "^22.20.0",
|
|
18
|
-
"@types/react": "^19.
|
|
18
|
+
"@types/react": "^19.3.0",
|
|
19
19
|
"ink-testing-library": "^4.0.0",
|
|
20
20
|
"typescript": "^7.0.2"
|
|
21
21
|
},
|