@kvali/cli 0.7.4 → 0.7.6
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.
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "kvali",
|
|
3
|
-
"version": "0.7.
|
|
3
|
+
"version": "0.7.6",
|
|
4
4
|
"description": "Live progress for Claude Code: plan progress, the current step and the time left, what the agent is doing right now, tokens and your plan limits, in a pane beside the chat.",
|
|
5
5
|
"author": { "name": "Giorgi Khiladze" },
|
|
6
6
|
"homepage": "https://github.com/webGrandpa/kvali",
|
package/dist/kvali.mjs
CHANGED
|
@@ -351,6 +351,17 @@ function cleanFields(o, fields) {
|
|
|
351
351
|
}
|
|
352
352
|
return out ?? o;
|
|
353
353
|
}
|
|
354
|
+
function errorMessage(v, depth = 0) {
|
|
355
|
+
if (typeof v === "string") return v.trim() || void 0;
|
|
356
|
+
if (typeof v === "number") return String(v);
|
|
357
|
+
if (!v || typeof v !== "object" || depth > 4) return void 0;
|
|
358
|
+
const o = v;
|
|
359
|
+
const inner = errorMessage(o.message, depth + 1) ?? errorMessage(o.error, depth + 1) ?? errorMessage(o.data, depth + 1) ?? errorMessage(o.cause, depth + 1);
|
|
360
|
+
const status = typeof o.status === "number" ? o.status : void 0;
|
|
361
|
+
if (inner) return status && !inner.includes(String(status)) ? `${inner} (${status})` : inner;
|
|
362
|
+
if (typeof o.type === "string" && o.type !== "error") return o.type;
|
|
363
|
+
return status ? `API error ${status}` : void 0;
|
|
364
|
+
}
|
|
354
365
|
|
|
355
366
|
// ../core/src/week.ts
|
|
356
367
|
var WEEK_DAYS = 7;
|
|
@@ -1217,7 +1228,7 @@ var AntigravityAdapter = class {
|
|
|
1217
1228
|
st.turnStartedAt = at;
|
|
1218
1229
|
}
|
|
1219
1230
|
st.turnSteps += tools.length;
|
|
1220
|
-
if (type === "ERROR_MESSAGE") st.error = firstLine(
|
|
1231
|
+
if (type === "ERROR_MESSAGE") st.error = firstLine(errorMessage(o.content) ?? errorMessage(o.error) ?? "Error", 120);
|
|
1221
1232
|
else if (source === "MODEL") st.error = void 0;
|
|
1222
1233
|
st.pendingAsk = void 0;
|
|
1223
1234
|
if (type === "PLANNER_RESPONSE") {
|
|
@@ -1679,13 +1690,14 @@ var ClaudeCodeAdapter = class {
|
|
|
1679
1690
|
const err = o.error && typeof o.error === "object" ? o.error : {};
|
|
1680
1691
|
const attempt = Number(o.retryAttempt ?? o.attempt ?? err.retryAttempt) || void 0;
|
|
1681
1692
|
const max = Number(o.maxRetries ?? o.max_retries ?? err.maxRetries) || void 0;
|
|
1682
|
-
const message = firstLine(
|
|
1693
|
+
const message = firstLine(errorMessage(o.content) ?? errorMessage(o.error) ?? errorMessage(o.cause) ?? "API problem", 100);
|
|
1683
1694
|
st.trouble = { message, at: ts ?? st.updatedAt, attempt, maxAttempts: max };
|
|
1684
1695
|
}
|
|
1685
|
-
|
|
1696
|
+
const retried = o.retryInMs !== void 0 || o.retryAttempt !== void 0;
|
|
1697
|
+
if ((o.level === "error" || o.subtype === "api_error") && !retried) {
|
|
1686
1698
|
st.phase = "error";
|
|
1687
1699
|
st.phaseAt = ts ?? st.updatedAt;
|
|
1688
|
-
st.errorText = firstLine(
|
|
1700
|
+
st.errorText = firstLine(errorMessage(o.content) ?? errorMessage(o.error) ?? "API error", 120);
|
|
1689
1701
|
}
|
|
1690
1702
|
return;
|
|
1691
1703
|
case "attachment": {
|
|
@@ -1832,6 +1844,7 @@ var ClaudeCodeAdapter = class {
|
|
|
1832
1844
|
onUser(st, o, ts) {
|
|
1833
1845
|
const m = o.message;
|
|
1834
1846
|
if (!m || o.isSidechain) return;
|
|
1847
|
+
if (o.isCompactSummary) return;
|
|
1835
1848
|
const content = m.content;
|
|
1836
1849
|
if (Array.isArray(content) && content.some((b) => b?.type === "tool_result")) {
|
|
1837
1850
|
for (const b of content) {
|
|
@@ -2093,7 +2106,10 @@ var ClaudeCodeAdapter = class {
|
|
|
2093
2106
|
if (beat.phase === "needs-you") {
|
|
2094
2107
|
status = "waiting";
|
|
2095
2108
|
detail = beat.label ? `Needs you: ${truncate(beat.label, 80)}` : "Needs your input";
|
|
2096
|
-
} else if (status !== "waiting" && status !== "error"
|
|
2109
|
+
} else if (status !== "waiting" && (status !== "error" || beat.since > st.phaseAt)) {
|
|
2110
|
+
status = "working";
|
|
2111
|
+
detail = void 0;
|
|
2112
|
+
}
|
|
2097
2113
|
} else if (st.updatedAt <= beat.at + PULSE_FRESH_MS && (status === "working" || status === "waiting")) {
|
|
2098
2114
|
pulse = { phase: "gone", since: beat.at, at: beat.at };
|
|
2099
2115
|
status = "stale";
|
|
@@ -2828,7 +2844,7 @@ function sdkFailure(result) {
|
|
|
2828
2844
|
}
|
|
2829
2845
|
if (!Array.isArray(content)) return void 0;
|
|
2830
2846
|
const failed = content.find((c) => c && typeof c === "object" && c.success === false);
|
|
2831
|
-
return failed ?
|
|
2847
|
+
return failed ? errorMessage(failed.error) ?? errorMessage(failed.result) ?? "Command failed" : void 0;
|
|
2832
2848
|
}
|
|
2833
2849
|
function sdkUserText(content) {
|
|
2834
2850
|
const text = contentText(content);
|
|
@@ -8564,7 +8580,7 @@ function qrTerminal(text, color = true) {
|
|
|
8564
8580
|
}
|
|
8565
8581
|
|
|
8566
8582
|
// src/index.ts
|
|
8567
|
-
var VERSION = "0.7.
|
|
8583
|
+
var VERSION = "0.7.6";
|
|
8568
8584
|
function parse(argv) {
|
|
8569
8585
|
const opts = {
|
|
8570
8586
|
json: false,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@kvali/cli",
|
|
3
|
-
"version": "0.7.
|
|
3
|
+
"version": "0.7.6",
|
|
4
4
|
"description": "Live progress, time left, tokens, plan limits and phone alerts for AI coding agents (Claude Code, Codex, Gemini CLI, Antigravity, Copilot, Cline, Roo Code, Kilo Code, OpenCode), in your terminal.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"author": "Giorgi Khiladze (https://github.com/webGrandpa)",
|