dsh-token-total 1.1.3 → 1.1.5

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/src/wire.ts CHANGED
@@ -114,6 +114,22 @@ export interface SessionUsageTotals {
114
114
  cacheWriteTokens: number
115
115
  }
116
116
 
117
+ /** A descendant that could not be read. Reasons are stable and sanitized;
118
+ * exception messages and filesystem paths never cross the wire. */
119
+ export interface SessionUsageReadIssue {
120
+ sessionId: string
121
+ reason: 'corrupt' | 'missing' | 'unavailable'
122
+ }
123
+
124
+ /** A partial response is usable, but its totals are explicitly not the whole
125
+ * tree. The root is always readable; older hosts may omit this field. */
126
+ export interface SessionUsageCoverage {
127
+ complete: boolean
128
+ totalSessions: number
129
+ readableSessions: number
130
+ unreadableSessions: SessionUsageReadIssue[]
131
+ }
132
+
117
133
  /** What one session tree cost, split into the main agent and its subagents.
118
134
  * The composer stats row renders this so a delegating session shows its whole
119
135
  * spend (the native `tokenUsage` projection only covers the main agent). */
@@ -129,6 +145,7 @@ export interface SessionUsageTree {
129
145
  total: SessionUsageTotals
130
146
  /** How many descendant sessions were counted. */
131
147
  subagentSessions: number
148
+ coverage?: SessionUsageCoverage
132
149
  }
133
150
 
134
151
  /** Request body of POST /token-total/api/session. */
@@ -139,6 +156,7 @@ export interface SessionUsageRequest {
139
156
  /** Detailed per-session usage view used by the Usage tab. */
140
157
  export interface SessionUsageDetail {
141
158
  sessionId: string
159
+ coverage?: SessionUsageCoverage
142
160
  totals: SessionUsageTotals
143
161
  requests: number
144
162
  averageFirstTokenMs: number | null