@kvali/cli 0.6.6 → 0.6.7

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.6.6",
3
+ "version": "0.6.7",
4
4
  "description": "Live progress for Claude Code: plan progress, the current step and its time, what the agent is doing right now, and tokens, 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
@@ -1098,6 +1098,7 @@ var ClaudeCodeAdapter = class {
1098
1098
  phaseAt: 0,
1099
1099
  turns: 0,
1100
1100
  turnSteps: 0,
1101
+ turnOpen: false,
1101
1102
  subagents: /* @__PURE__ */ new Map(),
1102
1103
  timer: new TaskTimer(),
1103
1104
  recent: [],
@@ -1211,8 +1212,15 @@ var ClaudeCodeAdapter = class {
1211
1212
  st.phase = "error";
1212
1213
  st.phaseAt = ts;
1213
1214
  st.errorText = firstLine(contentText(m.content) || "API error", 120);
1215
+ this.endTurn(st, ts, void 0);
1214
1216
  return;
1215
1217
  }
1218
+ const msgId = typeof m.id === "string" ? m.id : void 0;
1219
+ if (!st.turnOpen && !(msgId && msgId === st.turnEndedBy)) {
1220
+ st.turnOpen = true;
1221
+ st.turnSteps = 0;
1222
+ st.turnStartedAt = st.promptAt !== void 0 && st.promptAt >= (st.turnEndedAt ?? 0) ? st.promptAt : ts;
1223
+ }
1216
1224
  let sawToolUse = false;
1217
1225
  for (const block of Array.isArray(m.content) ? m.content : []) {
1218
1226
  if (!block || typeof block !== "object") continue;
@@ -1230,9 +1238,15 @@ var ClaudeCodeAdapter = class {
1230
1238
  else if (stop === "end_turn" || stop === "stop_sequence" || stop === "max_tokens" || stop === "refusal") {
1231
1239
  st.phase = "idle";
1232
1240
  st.open.clear();
1241
+ this.endTurn(st, ts, msgId);
1233
1242
  } else st.phase = "working";
1234
1243
  st.phaseAt = ts;
1235
1244
  }
1245
+ endTurn(st, ts, by) {
1246
+ st.turnOpen = false;
1247
+ st.turnEndedAt = ts;
1248
+ st.turnEndedBy = by;
1249
+ }
1236
1250
  onToolUse(st, block, ts) {
1237
1251
  const name = String(block.name ?? "tool");
1238
1252
  const input = block.input && typeof block.input === "object" ? block.input : {};
@@ -1308,8 +1322,10 @@ var ClaudeCodeAdapter = class {
1308
1322
  st.phase = "interrupted";
1309
1323
  st.phaseAt = ts;
1310
1324
  st.open.clear();
1325
+ this.endTurn(st, ts, void 0);
1311
1326
  return;
1312
1327
  }
1328
+ st.promptAt = ts;
1313
1329
  const isCommand = raw.includes("<command-name>") || raw.includes("<local-command-");
1314
1330
  const text = stripInjectedTags(raw);
1315
1331
  if (!text) return;
@@ -1319,6 +1335,8 @@ var ClaudeCodeAdapter = class {
1319
1335
  st.turns += 1;
1320
1336
  st.turnSteps = 0;
1321
1337
  st.turnStartedAt = ts;
1338
+ st.turnOpen = true;
1339
+ st.turnEndedBy = void 0;
1322
1340
  }
1323
1341
  if (!isCommand) {
1324
1342
  st.phase = "working";
@@ -5143,7 +5161,7 @@ function qrTerminal(text, color = true) {
5143
5161
  }
5144
5162
 
5145
5163
  // src/index.ts
5146
- var VERSION = "0.6.6";
5164
+ var VERSION = "0.6.7";
5147
5165
  function parse(argv) {
5148
5166
  const opts = {
5149
5167
  json: false,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@kvali/cli",
3
- "version": "0.6.6",
3
+ "version": "0.6.7",
4
4
  "description": "Live progress, tokens and phone alerts for AI coding agents (Claude Code, Codex, Gemini CLI, Antigravity), in your terminal.",
5
5
  "license": "MIT",
6
6
  "author": "Giorgi Khiladze (https://github.com/webGrandpa)",