@vietor/easy-agent 0.5.8 → 0.5.9
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/tui/spinner.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
2
|
import { useEffect, useState } from "react";
|
|
3
3
|
import { Text } from "ink";
|
|
4
|
-
import {
|
|
4
|
+
import { formatSeconds, formatCompactNumber } from "@vietor/easy-agent-core";
|
|
5
5
|
const SPINNER_FRAMES = ["⠋", "⠙", "⠹", "⠸", "⠼", "⠴", "⠦", "⠧", "⠇", "⠏"];
|
|
6
6
|
export function Spinner({ label, thinkingElapsed, replyElapsed, inputTokens, outputTokens, }) {
|
|
7
7
|
const [frame, setFrame] = useState(0);
|
|
@@ -9,5 +9,5 @@ export function Spinner({ label, thinkingElapsed, replyElapsed, inputTokens, out
|
|
|
9
9
|
const id = setInterval(() => setFrame((f) => (f + 1) % SPINNER_FRAMES.length), 80);
|
|
10
10
|
return () => clearInterval(id);
|
|
11
11
|
}, []);
|
|
12
|
-
return (_jsxs(Text, { children: [_jsx(Text, { color: "cyan", children: SPINNER_FRAMES[frame] }), _jsxs(Text, { children: [" ", label] }), _jsxs(Text, { dimColor: true, children: [" \u00B7 work ",
|
|
12
|
+
return (_jsxs(Text, { children: [_jsx(Text, { color: "cyan", children: SPINNER_FRAMES[frame] }), _jsxs(Text, { children: [" ", label] }), _jsxs(Text, { dimColor: true, children: [" \u00B7 work ", formatSeconds(thinkingElapsed), " \u00B7 reply ", formatSeconds(replyElapsed), " \u00B7 \u2191", formatCompactNumber(inputTokens), " \u00B7 \u2193", formatCompactNumber(outputTokens)] })] }));
|
|
13
13
|
}
|
package/dist/tui/status-bar.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
2
|
import { memo } from "react";
|
|
3
3
|
import { Box, Text, useWindowSize } from "ink";
|
|
4
|
-
import {
|
|
4
|
+
import { formatCompactNumber } from "@vietor/easy-agent-core";
|
|
5
5
|
export const StatusBar = memo(function StatusBar({ contextTokens, contextLimit, running, questionPending, reasoningAvailable }) {
|
|
6
6
|
const { columns } = useWindowSize();
|
|
7
7
|
const pct = Math.min(100, contextLimit > 0 ? Math.round((contextTokens / contextLimit) * 100) : 0);
|
|
@@ -15,5 +15,5 @@ export const StatusBar = memo(function StatusBar({ contextTokens, contextLimit,
|
|
|
15
15
|
hints = reasoningAvailable ? "esc stop · t reasoning" : "esc stop";
|
|
16
16
|
else
|
|
17
17
|
hints = "/ commands";
|
|
18
|
-
return (_jsxs(Box, { width: columns, paddingX: 1, flexDirection: "row", justifyContent: "space-between", borderStyle: "single", borderTop: true, borderBottom: false, borderLeft: false, borderRight: false, borderColor: "gray", children: [_jsxs(Text, { children: [_jsx(Text, { dimColor: true, children: `context ${
|
|
18
|
+
return (_jsxs(Box, { width: columns, paddingX: 1, flexDirection: "row", justifyContent: "space-between", borderStyle: "single", borderTop: true, borderBottom: false, borderLeft: false, borderRight: false, borderColor: "gray", children: [_jsxs(Text, { children: [_jsx(Text, { dimColor: true, children: `context ${formatCompactNumber(contextTokens)} ` }), _jsx(Text, { color: ctxColor, children: `▕${bar}▏ ${pct}%` })] }), _jsx(Text, { dimColor: true, children: hints })] }));
|
|
19
19
|
});
|
|
@@ -2,7 +2,7 @@ import { appendFile, writeFile } from "node:fs/promises";
|
|
|
2
2
|
import { existsSync, mkdirSync, readFileSync, readdirSync, statSync } from "node:fs";
|
|
3
3
|
import { homedir } from "node:os";
|
|
4
4
|
import { join } from "node:path";
|
|
5
|
-
import { ellipsisText,
|
|
5
|
+
import { ellipsisText, MAX_PREVIEW_LENGTH } from "@vietor/easy-agent-core";
|
|
6
6
|
function encodeCwd(cwd) {
|
|
7
7
|
return cwd.replace(/[\/\\:]/g, "-");
|
|
8
8
|
}
|
|
@@ -92,7 +92,7 @@ export class FileSessionPersistence {
|
|
|
92
92
|
const first = this.readFirstUser(path);
|
|
93
93
|
if (!first)
|
|
94
94
|
return undefined;
|
|
95
|
-
return ellipsisText(first,
|
|
95
|
+
return ellipsisText(first, MAX_PREVIEW_LENGTH);
|
|
96
96
|
}
|
|
97
97
|
readFirstUser(path) {
|
|
98
98
|
const first = parseJsonLines(readFileSync(path, "utf-8"))
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@vietor/easy-agent",
|
|
3
|
-
"version": "0.5.
|
|
3
|
+
"version": "0.5.9",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"bin": {
|
|
@@ -23,7 +23,7 @@
|
|
|
23
23
|
"react": "^19.2.8",
|
|
24
24
|
"string-width": "^8.2.2",
|
|
25
25
|
"zod": "^4.4.3",
|
|
26
|
-
"@vietor/easy-agent-core": "0.5.
|
|
26
|
+
"@vietor/easy-agent-core": "0.5.9"
|
|
27
27
|
},
|
|
28
28
|
"devDependencies": {
|
|
29
29
|
"@types/node": "^22.20.1",
|