@kvali/cli 0.0.0 → 0.6.0

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.
@@ -0,0 +1,85 @@
1
+ /** A step of the agent's plan (Claude Code Tasks or TodoWrite). */
2
+ export type KvTask = {
3
+ id: string
4
+ title: string
5
+ /** The present-tense form shown while the step runs ("Writing tests"). */
6
+ active?: string
7
+ status: 'pending' | 'in_progress' | 'completed'
8
+ }
9
+
10
+ /** The step in progress: when it started and how many actions it took so far. */
11
+ export type KvStep = { key: string; startedAt: number; actions: number }
12
+
13
+ export type KvPlan = {
14
+ tasks: KvTask[]
15
+ step?: KvStep
16
+ /** How long finished steps took, seen live. */
17
+ durations: number[]
18
+ /** The same, estimated from the task files' times (covers a plan made before Kvali loaded). */
19
+ fileDurations: number[]
20
+ }
21
+
22
+ /**
23
+ * What the agent is doing, from the engine's own events, so nothing here is a guess:
24
+ * the model's stream (thinking, writing, writing a tool call), a tool running, a
25
+ * question or permission waiting for the person, the turn's end.
26
+ */
27
+ export type KvPhase =
28
+ | 'idle'
29
+ | 'requesting'
30
+ | 'thinking'
31
+ | 'writing'
32
+ | 'tool-input'
33
+ | 'running'
34
+ | 'needs-you'
35
+ | 'stalled'
36
+ | 'done'
37
+ | 'interrupted'
38
+ | 'error'
39
+ | 'ended'
40
+
41
+ export type KvLive = {
42
+ phase: KvPhase
43
+ /** When this phase began. */
44
+ since: number
45
+ turnStartedAt?: number
46
+ /** The last piece of the model's response that arrived. */
47
+ lastDataAt?: number
48
+ label?: string
49
+ detail?: string
50
+ lastTurnMs?: number
51
+ }
52
+
53
+ /** A tool call, for the "latest actions" list. */
54
+ export type KvAction = {
55
+ id: string
56
+ label: string
57
+ detail?: string
58
+ startedAt: number
59
+ endedAt?: number
60
+ isError?: boolean
61
+ }
62
+
63
+ export type KvUsage = {
64
+ input: number
65
+ output: number
66
+ cacheRead: number
67
+ cacheWrite: number
68
+ /** Tokens the last main request sent: how full the context window is. */
69
+ context?: number
70
+ model?: string
71
+ /** False when only the requests since Kvali loaded are counted. */
72
+ isWholeSession: boolean
73
+ }
74
+
75
+ declare module 'claude-code' {
76
+ interface PluginState {
77
+ kvali: {
78
+ plan: Shaped<KvPlan>
79
+ live: Shaped<KvLive>
80
+ recent: Shaped<KvAction[]>
81
+ usage: Shaped<KvUsage>
82
+ showTasks: boolean
83
+ }
84
+ }
85
+ }