@wrongstack/tui 1.0.37 → 1.1.1

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,8 @@
1
+ import { type HistoryRetention, type RequestResidency } from '@wrongstack/core/utils';
2
+ import type React from 'react';
3
+ export declare function ResidencySection({ residency, retention, contentWidth, }: {
4
+ residency: RequestResidency | undefined;
5
+ retention: HistoryRetention | undefined;
6
+ contentWidth: number;
7
+ }): React.ReactElement;
8
+ //# sourceMappingURL=context-panel-residency.d.ts.map
@@ -35,8 +35,9 @@ export declare function MetricsSection({ data }: {
35
35
  }): React.ReactElement;
36
36
  /**
37
37
  * Cache coverage section — answers "exactly how far does the prompt cache
38
- * extend into the live request?" Renders the cumulative cache hit ratio
39
- * plus a per-request coverage meter that visibly marks where the cached
38
+ * extend into the live request?" Renders the last request's hit ratio (the
39
+ * session-cumulative one next to it lags: it carries the cold first request
40
+ * forever) plus a per-request coverage meter that visibly marks where the cached
40
41
  * prefix ends. Hidden when nothing has been cached yet so the panel does
41
42
  * not advertise a 0% figure as if it were meaningful.
42
43
  */
@@ -1,4 +1,4 @@
1
- import type { ContextBreakdown } from '@wrongstack/core/utils';
1
+ import type { ContextBreakdown, HistoryRetention, RequestResidency } from '@wrongstack/core/utils';
2
2
  import type { MemoryContextMonitorState } from '../memory-context-monitor.js';
3
3
  export interface ContextPanelData {
4
4
  ctxPct: number | undefined;
@@ -28,6 +28,10 @@ export interface ContextPanelData {
28
28
  cacheWrite1h?: number | undefined;
29
29
  hitRatio: number;
30
30
  savedUsd: number;
31
+ /** Last provider-reported request on its own; `hitRatio` is cumulative. */
32
+ last?: {
33
+ hitRatio: number;
34
+ } | undefined;
31
35
  } | undefined;
32
36
  /**
33
37
  * How far the cached prefix reaches through the live request, in
@@ -52,6 +56,14 @@ export interface ContextPanelData {
52
56
  * percentages.
53
57
  */
54
58
  breakdown: ContextBreakdown | undefined;
59
+ /**
60
+ * Cache residency of the last request — which segments were served from the
61
+ * prompt cache, written, or never cached, and what broke the cache. Absent
62
+ * before the first request.
63
+ */
64
+ residency?: RequestResidency | undefined;
65
+ /** Which history survives the next compaction (preserve window, elision). */
66
+ retention?: HistoryRetention | undefined;
55
67
  fleetEntries: Array<{
56
68
  name: string;
57
69
  status: string;
@@ -36,6 +36,9 @@ export interface StatusBarRailBuildParams {
36
36
  readTokens: number;
37
37
  writeTokens: number;
38
38
  savedUsd: number;
39
+ last?: {
40
+ hitRatio: number;
41
+ } | undefined;
39
42
  } | undefined;
40
43
  queueCount?: number | undefined;
41
44
  hint?: string | undefined;
@@ -1,5 +1,5 @@
1
1
  import type { CacheStats } from '@wrongstack/core/types';
2
- import { type ContextBreakdown } from '@wrongstack/core/utils';
2
+ import { type ContextBreakdown, type HistoryRetention, type RequestResidency } from '@wrongstack/core/utils';
3
3
  import type { AppProps } from '../app-props.js';
4
4
  import type { FleetEntry, State } from '../app-state.js';
5
5
  import type { StatuslineItem } from '../components/statusline-picker.js';
@@ -49,6 +49,10 @@ export interface TaskCounts {
49
49
  /** Builds status-bar projections without coupling them to the root App render. */
50
50
  export declare function useStatusbarViewModel({ agent, tokenCounter, activeMaxContext, effectiveMaxContext, liveProvider, liveModel, liveTodos, sidebarVisible, state, hiddenItems, tokenRefresh, }: StatusbarViewModelOptions): {
51
51
  contextBreakdown: ContextBreakdown | undefined;
52
+ /** Last request's cache residency — computed only while the context panel is open. */
53
+ contextResidency: RequestResidency | undefined;
54
+ /** What the next compaction keeps — computed only while the context panel is open. */
55
+ historyRetention: HistoryRetention | undefined;
52
56
  currentContextTokens: number;
53
57
  contextWindow: {
54
58
  used: number;