@wrongstack/tui 0.319.1 → 1.0.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.
Files changed (77) hide show
  1. package/README.md +0 -1
  2. package/dist/app-action-type.d.ts +46 -0
  3. package/dist/app-key-handler.d.ts +2 -0
  4. package/dist/app-props.d.ts +8 -1
  5. package/dist/app-state.d.ts +30 -0
  6. package/dist/app-view-contract.d.ts +2 -3
  7. package/dist/auth-panel-model.d.ts +70 -0
  8. package/dist/brain-panel-model.d.ts +11 -0
  9. package/dist/components/bug-hunt-continue-panel.d.ts +15 -0
  10. package/dist/components/bug-hunt-running-panel.d.ts +9 -0
  11. package/dist/components/confirm-prompt.d.ts +7 -1
  12. package/dist/components/history/entry-helpers.d.ts +5 -0
  13. package/dist/components/history/scroll-controller-types.d.ts +1 -1
  14. package/dist/components/powerline-rail.d.ts +46 -8
  15. package/dist/components/settings-picker-constants.d.ts +73 -0
  16. package/dist/components/settings-picker-model.d.ts +2 -192
  17. package/dist/components/settings-picker-resolver.d.ts +27 -0
  18. package/dist/components/status-bar-chips.d.ts +1 -1
  19. package/dist/components/status-bar-format.d.ts +8 -1
  20. package/dist/components/status-bar-icons.d.ts +7 -1
  21. package/dist/components/status-bar-rails-async.d.ts +9 -0
  22. package/dist/components/status-bar-rails-common.d.ts +117 -0
  23. package/dist/components/status-bar-rails-safety.d.ts +9 -0
  24. package/dist/components/status-bar-rails.d.ts +16 -103
  25. package/dist/components/status-bar-types.d.ts +24 -5
  26. package/dist/components/status-bar.d.ts +17 -15
  27. package/dist/components/status-line-registry.d.ts +11 -13
  28. package/dist/components/statusline-picker.d.ts +48 -15
  29. package/dist/history-archive.d.ts +3 -1
  30. package/dist/history-entry.d.ts +18 -0
  31. package/dist/hooks/use-app-event-bridges.d.ts +22 -43
  32. package/dist/hooks/use-app-panels-state.d.ts +30 -12
  33. package/dist/hooks/use-app-pipeline-builders.d.ts +5 -0
  34. package/dist/hooks/use-bug-hunt-loop.d.ts +9 -0
  35. package/dist/hooks/use-history-auto-scroll.d.ts +13 -0
  36. package/dist/hooks/use-history-viewport-sync.d.ts +2 -2
  37. package/dist/hooks/use-statusline-hidden-sync.d.ts +29 -0
  38. package/dist/hooks/use-statusline-state.d.ts +5 -1
  39. package/dist/hooks/use-tui-environment-state.d.ts +4 -2
  40. package/dist/index.d.ts +1 -1
  41. package/dist/index.js +6394 -4834
  42. package/dist/input-validation/action-types.d.ts +1 -1
  43. package/dist/reducers/dialogs.d.ts +1 -1
  44. package/dist/reducers/panel-pickers.d.ts +1 -1
  45. package/dist/run-tui-options.d.ts +5 -1
  46. package/dist/submit-controller.d.ts +2 -0
  47. package/dist/theme-presets/accessible.d.ts +66 -0
  48. package/dist/theme-presets/atom.d.ts +97 -0
  49. package/dist/theme-presets/ayu.d.ts +66 -0
  50. package/dist/theme-presets/base.d.ts +3 -0
  51. package/dist/theme-presets/catppuccin.d.ts +97 -0
  52. package/dist/theme-presets/everforest.d.ts +66 -0
  53. package/dist/theme-presets/flexoki.d.ts +35 -0
  54. package/dist/theme-presets/github.d.ts +99 -0
  55. package/dist/theme-presets/gruvbox.d.ts +97 -0
  56. package/dist/theme-presets/japanese.d.ts +35 -0
  57. package/dist/theme-presets/material.d.ts +66 -0
  58. package/dist/theme-presets/misc-1.d.ts +254 -0
  59. package/dist/theme-presets/misc-2.d.ts +256 -0
  60. package/dist/theme-presets/misc-3.d.ts +252 -0
  61. package/dist/theme-presets/mono-crt.d.ts +66 -0
  62. package/dist/theme-presets/mono.d.ts +128 -0
  63. package/dist/theme-presets/monokai.d.ts +68 -0
  64. package/dist/theme-presets/nightfox.d.ts +35 -0
  65. package/dist/theme-presets/options.d.ts +4 -0
  66. package/dist/theme-presets/rose-pine.d.ts +66 -0
  67. package/dist/theme-presets/synthwave.d.ts +68 -0
  68. package/dist/theme-presets/tokyo-night.d.ts +97 -0
  69. package/dist/theme-presets/vitesse.d.ts +66 -0
  70. package/dist/theme-presets.d.ts +17 -4
  71. package/dist/tui-host-capabilities.d.ts +4 -0
  72. package/dist/ui-contracts.d.ts +1 -1
  73. package/package.json +7 -7
  74. package/dist/components/key-hint-bar.d.ts +0 -42
  75. package/dist/components/live-activity-strip.d.ts +0 -40
  76. package/dist/components/memory-context-widget.d.ts +0 -5
  77. package/dist/components/statusline-detail-panel.d.ts +0 -10
@@ -1,196 +1,6 @@
1
- import type { ReasoningEffort as CoreReasoningEffort } from '@wrongstack/core/types';
2
1
  import type { SettingsPickerPatch } from '../settings-contracts.js';
3
- /** Selectable presets for the auto-proceed delay, so the field is fully
4
- * keyboard-cyclable (←/→) instead of needing typed numeric input. */
5
- export declare const DELAY_PRESETS_MS: number[];
6
- export declare const SETTINGS_MODES: readonly ['off', 'suggest', 'auto'];
7
- export type SettingsMode = (typeof SETTINGS_MODES)[number];
8
- export declare const LOG_LEVELS: readonly ['error', 'warn', 'info', 'debug', 'trace'];
9
- export type LogLevel = (typeof LOG_LEVELS)[number];
10
- export declare const AUDIT_LEVELS: readonly ['minimal', 'standard', 'full'];
11
- export type AuditLevel = (typeof AUDIT_LEVELS)[number];
12
- export declare const COMPACTOR_STRATEGIES: readonly ['hybrid', 'intelligent', 'selective'];
13
- export type CompactorStrategy = (typeof COMPACTOR_STRATEGIES)[number];
14
- /** Context window mode options — cyclable via ←/→. */
15
- export declare const CONTEXT_MODES: readonly ['balanced', 'frugal', 'deep'];
16
- export type ContextMode = (typeof CONTEXT_MODES)[number];
17
- export declare const CONTEXT_MODE_DESCS: Record<ContextMode, string>;
18
- export declare const STATUSLINE_MODES: readonly ['minimum', 'detailed', 'no-color'];
19
- export type StatuslineMode = (typeof STATUSLINE_MODES)[number];
20
- /**
21
- * Factory default statusline density. `minimum` is the default so a fresh
22
- * session shows a single clean rail (state · provider/model · context meter ·
23
- * version) with conditional chips only when relevant; `detailed` and
24
- * `no-color` are opt-in via /settings. Every app-level default site references
25
- * this constant so the default has a single source of truth. (The StatusBar
26
- * component's own prop default stays 'detailed' for back-compat with callers
27
- * that omit `mode` — the user-facing default is applied at the settings layer.)
28
- */
29
- export declare const DEFAULT_STATUSLINE_MODE: StatuslineMode;
30
- export declare const REASONING_MODES: readonly ['auto', 'on', 'off'];
31
- export type ReasoningMode = (typeof REASONING_MODES)[number];
32
- /**
33
- * Effort levels cycled by the /settings picker. Pinned to core's canonical
34
- * union via `satisfies` (subset-typed, not equal-typed, so a future core level
35
- * shows up here as a compile error reminding us to add it to the cycle) and
36
- * the exported type re-exports core's union directly.
37
- */
38
- export declare const REASONING_EFFORTS: readonly ["none", "minimal", "low", "medium", "high", "xhigh", "max"];
39
- export type ReasoningEffort = CoreReasoningEffort;
40
- export declare const CACHE_TTLS: readonly ['default', '5m', '1h'];
41
- export type CacheTtl = (typeof CACHE_TTLS)[number];
42
- export declare const STATUSLINE_MODE_DESCS: Record<StatuslineMode, string>;
43
- /** Presets for max iterations — cyclable via ←/→. 0 = unlimited. */
44
- export declare const MAX_ITERATIONS_PRESETS: number[];
45
- /** Presets for max concurrent subagents. 0 = runtime default. */
46
- export declare const MAX_CONCURRENT_PRESETS: number[];
47
- /** Presets for auto-proceed max iterations. 0 = unlimited, 50 default. */
48
- export declare const AUTO_PROCEED_MAX_PRESETS: number[];
49
- /** Presets for prompt refinement preview countdown. */
50
- export declare const ENHANCE_DELAY_PRESETS: number[];
51
- /** Presets for pre-refine grace countdown (seconds). 0 = skip. */
52
- export declare const PRE_REFINE_SECONDS_PRESETS: number[];
53
- /** Presets for the circuit-breaker auto kill/reset delay. 0 = manual recovery. */
54
- export declare const BREAKER_TIMEOUT_PRESETS: number[];
55
- export declare function formatBreakerTimeout(ms: number): string;
56
- /**
57
- * Presets for the multi-file diff summary footer cutoff. Each value is the
58
- * minimum number of files before the aggregate `N files · +X -Y · …`
59
- * line is rendered above the per-file blocks. `0` suppresses the footer
60
- * entirely; `5` is the package default; values up to 15 are useful for
61
- * very wide terminals where per-file footers are cheap.
62
- */
63
- export declare const MULTI_DIFF_SUMMARY_THRESHOLD_PRESETS: number[];
64
- /** Language options for prompt refinement. */
65
- export declare const ENHANCE_LANGUAGES: readonly ['original', 'english'];
66
- export type EnhanceLanguage = (typeof ENHANCE_LANGUAGES)[number];
67
- /** Token-saving tier options — cyclable via ←/→ in the settings picker.
68
- * `auto` is the default: it keeps the executable catalog, uses the medium
69
- * direct surface, and adapts prompt trimming to the model window. */
70
- export declare const TOKEN_SAVING_TIERS: readonly ['auto', 'off', 'minimal', 'light', 'medium', 'aggressive'];
71
- export type TokenSavingTierTui = (typeof TOKEN_SAVING_TIERS)[number];
72
- export declare const TOKEN_SAVING_TIER_DESCS: Record<TokenSavingTierTui, string>;
73
- /**
74
- * Fleet-chat verbosity options — cyclable via ←/→ in the settings picker.
75
- * Values MUST match core's `FleetChatVerbosity` union (config schema).
76
- */
77
- export declare const FLEET_CHAT_MODES: readonly ['off', 'full'];
78
- export type FleetChatVerbosityTui = (typeof FLEET_CHAT_MODES)[number];
79
- export declare const FLEET_CHAT_MODE_DESCS: Record<FleetChatVerbosityTui, string>;
80
- export declare function formatSettingsDelay(ms: number): string;
81
- export declare function formatMaxIterations(n: number): string;
82
- export declare function formatMultiDiffSummaryThreshold(n: number): string;
83
- export declare function formatEnhanceDelay(ms: number): string;
84
- export declare function formatPreRefineSeconds(s: number): string;
85
- /** Animation style choices for the settings picker — all AnimationStyles plus 'cycle'. */
86
- export declare const ANIMATION_STYLE_CHOICES: readonly ["rainbow", "wave", "pulse", "dots", "breathe", "static", "cycle"];
87
- export type AnimationStyleChoice = (typeof ANIMATION_STYLE_CHOICES)[number];
88
- /** Human-readable label for an animation style choice (including cycle). */
89
- export declare function formatAnimationStyle(style: AnimationStyleChoice): string;
90
- export declare const MODE_DESC: Record<SettingsMode, string>;
91
- /** Total number of settings rows (used for wrap-around navigation).
92
- * Indices 0–45 are the legacy auto-rebuilt Settings surface; 46..45+PANEL_IDS.length
93
- * are the per-panel position rows (one per PanelId in PANEL_IDS order)
94
- * added when the showAgentSwarmPanel tri-state was generalized into the
95
- * per-panel PanelPositionMap. Derived from PANEL_IDS.length so adding
96
- * a new panel id automatically extends the surface. */
97
- export declare const SETTINGS_FIELD_COUNT: number;
98
- /**
99
- * Field index of the "Thinking word" row. The reducer's per-field switch and
100
- * the app.tsx key handler both branch on this, so it lives next to the row
101
- * definitions to keep the three in sync. If the row order changes, update this.
102
- */
103
- export declare const THINKING_WORD_FIELD = 22;
104
- /**
105
- * Field index of the "WrongProxy URL" row. Same rationale as
106
- * {@link THINKING_WORD_FIELD}: the keyboard handler in `use-app-picker-keys.ts`
107
- * dispatches `settingsWrongProxyUrlEditStart` when the user presses Enter
108
- * on this row, so the constant lives next to the row definition to keep
109
- * the three in sync.
110
- */
111
- export declare const WRONGPROXY_URL_FIELD = 60;
112
- /**
113
- * Field index of the "Multi-diff summary" row. Same rationale as
114
- * {@link THINKING_WORD_FIELD}: the keyboard handler in app.tsx dispatches
115
- * `settingsFieldSet` to this index when the user presses Ctrl+M inside the
116
- * picker, so any reorder of the Tools section must update this constant.
117
- */
118
- export declare const MULTI_DIFF_SUMMARY_THRESHOLD_FIELD = 21;
119
- /**
120
- * Map of modifier+<letter> chords to settings-picker rows. While the picker
121
- * is open, pressing a chord jumps the cursor straight to the target row so
122
- * the user can immediately cycle its value with ←/→ (or, for the thinking
123
- * word, Enter to open the free-text editor).
124
- *
125
- * Ctrl chords must NOT collide with global bindings:
126
- * Ctrl+S = close picker · Ctrl+G = F3 agents monitor · Ctrl+F = F2 fleet
127
- * monitor · Ctrl+P = PhaseMonitor · Ctrl+T = F4 worktree · Ctrl+A = F5 plan
128
- * panel · Ctrl+K = F9 goal panel.
129
- *
130
- * Alt chords must NOT collide with:
131
- * Alt+V = paste image from clipboard (chat input).
132
- *
133
- * Alt+Shift chords (mod+Alt in the user's framing) reuse the same letter as
134
- * plain Alt or Ctrl when the plain variants are already taken — the
135
- * composition distinguishes them at the keyboard level. For example, the
136
- * Ctrl and Alt+Shift sets both use 'L' for the Logging rows, but Alt+L and
137
- * Alt+Shift+L land on different fields.
138
- *
139
- * Each entry's `field` must match the actual row index at render time — the
140
- * `settingsFieldSet` action clamps out-of-range values to 0, so a drift
141
- * between this map and the picker row order would silently land the user on
142
- * row 0 instead of jumping them to the intended target.
143
- */
144
- /**
145
- * Curated words the "Thinking word" field cycles through with ←/→. The user's
146
- * own custom word (set via Enter free-text edit or config) is folded into this
147
- * list at runtime so cycling never drops it. All entries must satisfy
148
- * `normalizeTuiThinkingWord` (single short word, ≤16 chars).
149
- *
150
- * `'thinking'` (the default) and `'random'` both surface a fresh fun word from
151
- * the pool on each working spell — see `isRandomTuiThinkingWord`.
152
- */
153
- export declare const THINKING_WORD_PRESETS: readonly ['thinking', 'random', 'working', 'cooking', 'vibing', 'pondering', 'brewing', 'crunching', 'computing', 'grinding', 'noodling', 'churning', 'hacking'];
154
- export declare const CONFIG_SCOPES: readonly ['global', 'project'];
155
- export type ConfigScope = (typeof CONFIG_SCOPES)[number];
156
- /**
157
- * Re-export of the canonical `SettingsPickerPatch` from `settings-contracts.ts`.
158
- * That module is the single source of truth so that `Action['patch']` (in
159
- * app-action-type.ts) and the helpers below stay in lock-step. Adding a new
160
- * key here requires adding it there too — keep them in sync.
161
- */
162
- export type { SettingsPickerPatch };
163
- /**
164
- * Human-readable labels for all settings fields (0–SETTINGS_FIELD_COUNT-1),
165
- * in picker row order. Used by `resolveSettingsFieldValue` for confirmation
166
- * and error messages, and by the `/settings` help text.
167
- */
168
- export declare const SETTINGS_FIELD_LABELS: readonly string[];
169
- /**
170
- * Resolve a free-text value for a given settings field into a typed
171
- * state patch. Used by the `/settings <chord> <value>` slash command.
172
- *
173
- * Value parsing rules:
174
- * - **Boolean fields**: "on"/"off", "true"/"false", "yes"/"no",
175
- * "1"/"0" (case-insensitive).
176
- * - **Enum fields**: case-insensitive match against the allowed values.
177
- * - **Preset fields**: either the raw number (e.g. "500") or the
178
- * display name (e.g. "unlimited" for 0, "off" for 0, "1m" for 60000).
179
- * - **Text fields** (thinking word): accepted as-is, validated by
180
- * `normalizeTuiThinkingWord`.
181
- *
182
- * Returns `{ ok: true, patch, label, displayValue }` on success, or
183
- * `{ ok: false, error }` with a helpful message listing valid options.
184
- */
185
- export declare function resolveSettingsFieldValue(field: number, input: string): {
186
- ok: true;
187
- patch: SettingsPickerPatch;
188
- label: string;
189
- displayValue: string;
190
- } | {
191
- ok: false;
192
- error: string;
193
- };
2
+ export * from './settings-picker-constants.js';
3
+ export * from './settings-picker-resolver.js';
194
4
  /**
195
5
  * Read-only counterpart to {@link resolveSettingsFieldValue}. Given the
196
6
  * current settings-picker values and a field index, returns the value
@@ -0,0 +1,27 @@
1
+ import type { SettingsPickerPatch } from '../settings-contracts.js';
2
+ /**
3
+ * Resolve a free-text value for a given settings field into a typed
4
+ * state patch. Used by the `/settings <chord> <value>` slash command.
5
+ *
6
+ * Value parsing rules:
7
+ * - **Boolean fields**: "on"/"off", "true"/"false", "yes"/"no",
8
+ * "1"/"0" (case-insensitive).
9
+ * - **Enum fields**: case-insensitive match against the allowed values.
10
+ * - **Preset fields**: either the raw number (e.g. "500") or the
11
+ * display name (e.g. "unlimited" for 0, "off" for 0, "1m" for 60000).
12
+ * - **Text fields** (thinking word): accepted as-is, validated by
13
+ * `normalizeTuiThinkingWord`.
14
+ *
15
+ * Returns `{ ok: true, patch, label, displayValue }` on success, or
16
+ * `{ ok: false, error }` with a helpful message listing valid options.
17
+ */
18
+ export declare function resolveSettingsFieldValue(field: number, input: string): {
19
+ ok: true;
20
+ patch: SettingsPickerPatch;
21
+ label: string;
22
+ displayValue: string;
23
+ } | {
24
+ ok: false;
25
+ error: string;
26
+ };
27
+ //# sourceMappingURL=settings-picker-resolver.d.ts.map
@@ -7,7 +7,7 @@
7
7
  */
8
8
  import type React from 'react';
9
9
  import { type AnimationStyle } from './animation-style.js';
10
- import type { BrainStatusChip, StatusBarProps } from './status-bar.js';
10
+ import type { BrainStatusChip, StatusBarProps } from './status-bar-types.js';
11
11
  export declare function BrainChip({ brain, monochrome, }: {
12
12
  brain: BrainStatusChip;
13
13
  monochrome?: boolean;
@@ -9,7 +9,14 @@ export declare function truncateChip(text: string, max: number): string;
9
9
  * element tree (string/number leaves only).
10
10
  */
11
11
  export declare function nodeText(node: React.ReactNode): string;
12
- export declare function planChipFit(widths: number[], budget: number, sepCost?: number): number;
12
+ /**
13
+ * Keep only the last `segments` path components, prefixed with `…/` when
14
+ * anything was elided. Used by the working-dir chip's narrower density
15
+ * levels: `D:\Codebox\PROJECTS\WrongStack` → `…/PROJECTS/WrongStack` →
16
+ * `…/WrongStack`. Separators are normalized to `/` so the result has a
17
+ * predictable width on Windows too.
18
+ */
19
+ export declare function shortenPath(path: string, segments: number): string;
13
20
  export interface TokenDisplayTotals {
14
21
  input: number;
15
22
  output: number;
@@ -43,7 +43,13 @@ export declare const STATUSLINE_ICONS: {
43
43
  export declare const COMPACT_THRESHOLD = 50;
44
44
  export declare function chipColor(color: string, isNoColor: boolean): string | undefined;
45
45
  export declare const STACK_ORANGE = "#FD9F02";
46
- export declare const LINE_BG_COLORS: readonly [string, string, string, string];
46
+ /**
47
+ * Per-rail background tone. Read through a function (not a frozen array) so
48
+ * it follows a live `/theme` switch, and genuinely alternated so the four
49
+ * rails read as four bands instead of one block: identity/safety sit on the
50
+ * base surface, vitals/async on the raised one.
51
+ */
52
+ export declare function lineBackground(logical: 0 | 1 | 2 | 3): string;
47
53
  export declare const SPINNER_FRAMES: string[];
48
54
  export declare const SPINNER_INTERVAL_MS = 1000;
49
55
  //# sourceMappingURL=status-bar-icons.d.ts.map
@@ -0,0 +1,9 @@
1
+ import type { RailSpanEntry } from "./powerline-rail.js";
2
+ import { type StatusBarRailBuildParams } from "./status-bar-rails-common.js";
3
+ /**
4
+ * Background activity: fleets, peers, services — plus the countdowns, which
5
+ * tick every second and belong with the other things that arrive and leave
6
+ * on their own schedule rather than with the turn's telemetry.
7
+ */
8
+ export declare function buildAsyncChipEntries(p: StatusBarRailBuildParams): RailSpanEntry[];
9
+ //# sourceMappingURL=status-bar-rails-async.d.ts.map
@@ -0,0 +1,117 @@
1
+ import type { StatuslineDensity } from "@wrongstack/core/statusline";
2
+ import type React from "react";
3
+ import type { AnimationStyle } from "./animation-style.js";
4
+ import type { RailSpanEntry } from "./powerline-rail.js";
5
+ import type { FleetAgentDetail, MailboxStatus, StatusBarProps } from "./status-bar-types.js";
6
+ import type { StatuslineItem } from "./statusline-picker.js";
7
+ export interface StatusBarRailBuildParams {
8
+ showChip: (item: StatuslineItem) => boolean;
9
+ /** Resolved density for a chip ('auto' unless the user pinned one). */
10
+ chipDensity: (item: StatuslineItem) => StatuslineDensity;
11
+ isNoColor: boolean;
12
+ model: string;
13
+ provider?: string | undefined;
14
+ version?: string | undefined;
15
+ latestVersion?: string | undefined;
16
+ updateAvailable?: boolean | undefined;
17
+ yolo?: boolean | undefined;
18
+ autonomy?: StatusBarProps['autonomy'];
19
+ processCount?: number | undefined;
20
+ stateStatusChip: React.ReactElement | null;
21
+ fleetWorkingTime?: number | undefined;
22
+ context?: StatusBarProps['context'];
23
+ contextStrategy?: string | undefined;
24
+ showTokenDisplay: boolean;
25
+ displayTokens: {
26
+ input: number;
27
+ output: number;
28
+ };
29
+ cost?: {
30
+ total: number;
31
+ } | undefined;
32
+ cache?: {
33
+ hitRatio: number;
34
+ readTokens: number;
35
+ writeTokens: number;
36
+ savedUsd: number;
37
+ } | undefined;
38
+ queueCount?: number | undefined;
39
+ hint?: string | undefined;
40
+ breakerCountdown?: StatusBarProps['breakerCountdown'];
41
+ projectName?: string | undefined;
42
+ workingDir?: string | undefined;
43
+ git?: StatusBarProps['git'];
44
+ modeLabel?: string | undefined;
45
+ themeName?: string | undefined;
46
+ sessionCount?: number | undefined;
47
+ toolCount?: number | undefined;
48
+ tokenSavingMode?: StatusBarProps['tokenSavingMode'];
49
+ sideEffectCount?: number | undefined;
50
+ todos?: StatusBarProps['todos'];
51
+ todosCleared: boolean;
52
+ plan?: StatusBarProps['plan'];
53
+ tasks?: StatusBarProps['tasks'];
54
+ hasTaskActivity: boolean | undefined;
55
+ fleet?: StatusBarProps['fleet'];
56
+ fleetHasActivity: boolean | undefined;
57
+ subagentCount: number;
58
+ showBrain: boolean;
59
+ brain?: StatusBarProps['brain'];
60
+ showDebugStream: boolean;
61
+ debugStreamStats?: StatusBarProps['debugStreamStats'];
62
+ showEnhance: boolean;
63
+ enhanceCountdown?: number | null | undefined;
64
+ hasNextStepsAutoSubmit: boolean;
65
+ nextStepsAutoSubmitCountdown?: number | null | undefined;
66
+ nextStepsAutoSubmitLabel?: string | null | undefined;
67
+ nextStepsColor: string;
68
+ showEternalStage: boolean;
69
+ eternalStage?: StatusBarProps['eternalStage'];
70
+ hasActiveGoal: boolean;
71
+ goalSummary?: StatusBarProps['goalSummary'];
72
+ hasAutoProceed: boolean;
73
+ autoProceedCountdown?: number | null | undefined;
74
+ droppedTools?: number | undefined;
75
+ minimalWorkParts: string[];
76
+ thinking: boolean;
77
+ statePrefix: string;
78
+ stateLabel: string;
79
+ stateColor: string;
80
+ animationStyle: AnimationStyle | 'cycle';
81
+ spinnerIdx: number;
82
+ cycleTick: number;
83
+ memoryContextMonitor?: StatusBarProps['memoryContextMonitor'];
84
+ Sage?: StatusBarProps['Sage'];
85
+ indexState?: StatusBarProps['indexState'];
86
+ /** Mailbox status for the async rail. */
87
+ mailbox?: MailboxStatus | undefined;
88
+ /** Per-agent live detail rows for the async rail. */
89
+ fleetAgents?: FleetAgentDetail[] | undefined;
90
+ /** Whether the mailbox chip is eligible (not hidden + has activity). */
91
+ showMailbox: boolean;
92
+ /** Pre-built memory-context chips for the async rail. */
93
+ memoryDetailChips: RailSpanEntry[];
94
+ /** Active system-prompt variant (Lite / Standard / Pro) — identity chip. */
95
+ promptVariant?: 'lite' | 'default' | 'pro' | undefined;
96
+ }
97
+ /**
98
+ * Translate a chip's density setting into the level bounds the rail fitter
99
+ * may use. `auto` leaves the full range open; every other value pins one
100
+ * level (clamped to what the chip actually offers, so a two-level chip
101
+ * pinned to `micro` renders its narrowest form rather than nothing).
102
+ */
103
+ export declare function densityBounds(density: StatuslineDensity, levelCount: number): {
104
+ lo: number;
105
+ hi: number;
106
+ };
107
+ /**
108
+ * Assemble one rail entry from its density levels (widest → narrowest).
109
+ * Nullish levels are dropped, so a chip can declare `[full, short, micro]`
110
+ * and silently degrade to fewer levels when the data for a richer form
111
+ * isn't there. Returns null when the chip has nothing to render at all.
112
+ */
113
+ export declare function entry(id: string, key: StatuslineItem, p: StatusBarRailBuildParams, levels: Array<React.ReactElement | null | false | undefined>): RailSpanEntry | null;
114
+ export declare function compact(entries: Array<RailSpanEntry | null>): RailSpanEntry[];
115
+ /** `icon ` prefix, or '' in no-color/ASCII-ish mode. */
116
+ export declare function icon(glyph: string, isNoColor: boolean): string;
117
+ //# sourceMappingURL=status-bar-rails-common.d.ts.map
@@ -0,0 +1,9 @@
1
+ import type { RailSpanEntry } from "./powerline-rail.js";
2
+ import { type StatusBarRailBuildParams } from "./status-bar-rails-common.js";
3
+ /**
4
+ * Standing posture (is this session dangerous? is it throttled?) followed by
5
+ * the work in flight. A reader scans this rail left-to-right to answer
6
+ * "what is it allowed to do, and what is it doing".
7
+ */
8
+ export declare function buildSafetyWorkEntries(p: StatusBarRailBuildParams): RailSpanEntry[];
9
+ //# sourceMappingURL=status-bar-rails-safety.d.ts.map
@@ -1,108 +1,21 @@
1
- import type React from 'react';
2
- import type { AnimationStyle } from './animation-style.js';
3
- import type { RailSpanEntry } from './powerline-rail.js';
4
- import type { FleetAgentDetail, MailboxStatus, StatusBarProps } from './status-bar-types.js';
5
- import type { StatuslineItem } from './statusline-picker.js';
6
- export interface StatusBarRailBuildParams {
7
- showChip: (item: StatuslineItem) => boolean;
8
- isNoColor: boolean;
9
- model: string;
10
- provider?: string | undefined;
11
- version?: string | undefined;
12
- latestVersion?: string | undefined;
13
- updateAvailable?: boolean | undefined;
14
- yolo?: boolean | undefined;
15
- autonomy?: StatusBarProps['autonomy'];
16
- processCount?: number | undefined;
17
- stateStatusChip: React.ReactElement | null;
18
- fleetWorkingTime?: number | undefined;
19
- primaryChips: React.ReactElement[];
20
- context?: StatusBarProps['context'];
21
- contextStrategy?: string | undefined;
22
- showTokenDisplay: boolean;
23
- displayTokens: {
24
- input: number;
25
- output: number;
26
- };
27
- cost?: {
28
- total: number;
29
- } | undefined;
30
- cache?: {
31
- hitRatio: number;
32
- readTokens: number;
33
- writeTokens: number;
34
- savedUsd: number;
35
- } | undefined;
36
- queueCount?: number | undefined;
37
- hint?: string | undefined;
38
- breakerCountdown?: StatusBarProps['breakerCountdown'];
39
- projectName?: string | undefined;
40
- workingDir?: string | undefined;
41
- git?: StatusBarProps['git'];
42
- modeLabel?: string | undefined;
43
- themeName?: string | undefined;
44
- sessionCount?: number | undefined;
45
- toolCount?: number | undefined;
46
- tokenSavingMode?: string | undefined;
47
- sideEffectCount?: number | undefined;
48
- todos?: StatusBarProps['todos'];
49
- todosCleared: boolean;
50
- plan?: StatusBarProps['plan'];
51
- tasks?: StatusBarProps['tasks'];
52
- hasTaskActivity: boolean | null | undefined;
53
- fleet?: StatusBarProps['fleet'];
54
- fleetHasActivity: boolean | null | undefined;
55
- subagentCount: number;
56
- showBrain: boolean;
57
- brain?: StatusBarProps['brain'];
58
- showDebugStream: boolean;
59
- debugStreamStats?: StatusBarProps['debugStreamStats'];
60
- showEnhance: boolean;
61
- enhanceCountdown?: StatusBarProps['enhanceCountdown'];
62
- hasNextStepsAutoSubmit: boolean;
63
- nextStepsAutoSubmitCountdown?: StatusBarProps['nextStepsAutoSubmitCountdown'];
64
- nextStepsAutoSubmitLabel?: StatusBarProps['nextStepsAutoSubmitLabel'];
65
- nextStepsColor: string;
66
- showEternalStage: boolean;
67
- eternalStage?: StatusBarProps['eternalStage'];
68
- hasActiveGoal: boolean;
69
- goalSummary?: StatusBarProps['goalSummary'];
70
- hasAutoProceed: boolean;
71
- autoProceedCountdown?: StatusBarProps['autoProceedCountdown'];
72
- droppedTools?: number | undefined;
73
- minimalWorkParts: string[];
74
- thinking: boolean;
75
- statePrefix: string;
76
- stateLabel: string;
77
- stateColor: string;
78
- animationStyle: AnimationStyle | 'cycle';
79
- spinnerIdx: number;
80
- cycleTick: number;
81
- memoryContextMonitor?: StatusBarProps['memoryContextMonitor'];
82
- Sage?: StatusBarProps['Sage'];
83
- indexState?: StatusBarProps['indexState'];
84
- /** Mailbox status for the connectivity rail (line 4). */
85
- mailbox?: MailboxStatus | undefined;
86
- /** Per-agent live detail rows for the connectivity rail (line 4). */
87
- fleetAgents?: FleetAgentDetail[] | undefined;
88
- /** Whether the mailbox chip is eligible (not hidden + has activity). */
89
- showMailbox: boolean;
90
- /** Pre-built memory-context chips for the connectivity rail (line 4). */
91
- memoryDetailChips: React.ReactElement[];
92
- /** Active system-prompt variant (Lite / Standard / Pro) — line 1 identity chip. */
93
- promptVariant?: 'lite' | 'default' | 'pro' | undefined;
94
- }
1
+ import type React from "react";
2
+ import type { RailSpanEntry } from "./powerline-rail.js";
3
+ import type { StatusBarProps } from "./status-bar-types.js";
4
+ import type { StatuslineItem } from "./statusline-picker.js";
5
+ import { type StatusBarRailBuildParams } from "./status-bar-rails-common.js";
6
+ export type { StatusBarRailBuildParams } from "./status-bar-rails-common.js";
7
+ export { densityBounds } from "./status-bar-rails-common.js";
8
+ export { buildSafetyWorkEntries } from "./status-bar-rails-safety.js";
9
+ export { buildAsyncChipEntries } from "./status-bar-rails-async.js";
10
+ export declare function buildWorkspaceChipEntries(p: StatusBarRailBuildParams, modelStatusChip: React.ReactElement | null, modelShortChip?: React.ReactElement | null, modelMicroChip?: React.ReactElement | null): RailSpanEntry[];
95
11
  /**
96
- * The ctx·tokens·cost·cache telemetry composite for the run-state rail.
97
- * queue/hint/breaker are separate entries in buildRunStateChipEntries so
98
- * each keeps a stable click-map id and its urgency-sorted position.
12
+ * The per-turn telemetry chips. Formerly a single 90-column composite whose
13
+ * four contract keys (context/tokens/cost/cache) could neither be assigned
14
+ * to different lines nor partially shed on overflow — they are four real
15
+ * entries now, each independently placeable, degradable and hit-testable.
99
16
  */
100
- export declare function buildPrimaryChips(p: StatusBarRailBuildParams): React.ReactElement[];
101
- export declare function buildWorkspaceChipEntries(p: StatusBarRailBuildParams, modelStatusChip: React.ReactElement | null): RailSpanEntry[];
102
- export declare function buildRunStateChipEntries(p: StatusBarRailBuildParams): RailSpanEntry[];
17
+ export declare function buildVitalsChipEntries(p: StatusBarRailBuildParams): RailSpanEntry[];
103
18
  export declare function buildMinimumChips(p: StatusBarRailBuildParams): React.ReactElement[];
104
- export declare function buildWorkRowEntries(p: StatusBarRailBuildParams): RailSpanEntry[];
105
- export declare function buildConnectivityChipEntries(p: StatusBarRailBuildParams): RailSpanEntry[];
106
19
  export declare function buildIndexStatusChip(indexState: StatusBarProps['indexState'], showChip: (item: StatuslineItem) => boolean, isNoColor: boolean): React.ReactElement | null;
107
- export declare function buildMemoryDetailChips(memoryContextMonitor: StatusBarProps['memoryContextMonitor'], Sage: StatusBarProps['Sage'], isNoColor: boolean): React.ReactElement[];
20
+ export declare function buildMemoryDetailEntries(p: StatusBarRailBuildParams): RailSpanEntry[];
108
21
  //# sourceMappingURL=status-bar-rails.d.ts.map
@@ -1,11 +1,11 @@
1
1
  import type { EventBus } from '@wrongstack/core/kernel';
2
+ import type { StatuslineDensities, StatuslineLine, StatuslineLines } from '@wrongstack/core/statusline';
2
3
  import type { AutonomyStage, TokenCounter, TokenSavingTier } from '@wrongstack/core/types';
3
4
  import type { GitInfo } from '../git-info.js';
4
5
  import type { MemoryContextMonitorState } from '../memory-context-monitor.js';
5
- import type { StatuslineLines } from '@wrongstack/core/statusline';
6
+ import type { ChipMeta, StatuslineItem } from '../ui-contracts.js';
6
7
  import type { AnimationStyle } from './animation-style.js';
7
8
  import type { StatuslineMode } from './settings-picker.js';
8
- import type { ChipMeta, StatuslineItem } from './statusline-picker.js';
9
9
  export interface TodoCounts {
10
10
  pending: number;
11
11
  inProgress: number;
@@ -141,9 +141,11 @@ export interface StatusBarProps {
141
141
  queueCount?: number | undefined;
142
142
  yolo?: boolean | undefined;
143
143
  /**
144
- * Session start timestamp (ms). Used by StatuslineDetailPanel for its
145
- * elapsed-time display. StatusBar itself no longer renders this chip
146
- * (working time and fleet time are tracked separately).
144
+ * Session start timestamp (ms). Still passed by `app-status-region.tsx`
145
+ * but currently read by nothing: StatusBar stopped rendering the chip
146
+ * (working time and fleet time are tracked separately), and the detail
147
+ * panel that consumed it was removed once the `/statusline` picker took
148
+ * over per-line reporting.
147
149
  */
148
150
  startedAt?: number | undefined;
149
151
  /**
@@ -241,6 +243,13 @@ export interface StatusBarProps {
241
243
  * the persistence layer and again by the registry partition.
242
244
  */
243
245
  statuslineLines?: StatuslineLines | undefined;
246
+ /**
247
+ * Per-chip density pin (statusline.json schema v3). Absent keys — and an
248
+ * explicit 'auto' — leave the chip to the rail fitter, which shortens the
249
+ * widest chip first and only drops a chip once every chip on that rail is
250
+ * already at its narrowest form.
251
+ */
252
+ statuslineDensities?: StatuslineDensities | undefined;
244
253
  /**
245
254
  * Statusline density. The prop default 'detailed' is kept for back-compat
246
255
  * with tests/callers that omit `mode`; the user-facing default is 'minimum'
@@ -406,7 +415,17 @@ export interface StatusBarClickMap {
406
415
  lines: Array<{
407
416
  /** 0-based content-line index within the status-bar box (line 1 = 0). */
408
417
  line: number;
418
+ /** Logical rail (1-4) this physical row renders — the /statusline picker
419
+ * maps its per-line fill gauges through this, since conditional rails
420
+ * make the physical index shift. */
421
+ logical?: StatuslineLine | undefined;
409
422
  spans: Array<import('./powerline-rail.js').RailSpan>;
423
+ /** Columns this rail was fitted into (terminal width). */
424
+ budget?: number | undefined;
425
+ /** Columns the rail actually consumes after fitting. */
426
+ used?: number | undefined;
427
+ /** Chip ids the fitter had to shed entirely (the `+N` marker). */
428
+ droppedIds?: string[] | undefined;
410
429
  }>;
411
430
  }
412
431
  //# sourceMappingURL=status-bar-types.d.ts.map
@@ -1,24 +1,26 @@
1
1
  import type React from 'react';
2
2
  import type { StatusBarProps } from './status-bar-types.js';
3
- export { contextBarColor, fmtElapsed, hasTokenDisplay, nodeText, planChipFit, renderMeter, renderProgress, stateChip, type TokenDisplayTotals, tokenDisplayTotals, truncateChip, } from './status-bar-format.js';
3
+ export { contextBarColor, fmtElapsed, hasTokenDisplay, nodeText, renderMeter, renderProgress, shortenPath, stateChip, type TokenDisplayTotals, tokenDisplayTotals, truncateChip, } from './status-bar-format.js';
4
4
  export { chipColor, SPINNER_INTERVAL_MS, STACK_ORANGE, STATUSLINE_ICONS, } from './status-bar-icons.js';
5
5
  export type { BrainStatusChip, ContextWindow, FleetAgentDetail, FleetCounts, MailboxStatus, PlanCounts, StatusBarProps, TaskCounts, TodoCounts, } from './status-bar-types.js';
6
6
  /**
7
- * Four-rail status bar — one semantic question per line, left-to-right in
8
- * descending importance:
7
+ * Four-rail status bar. Lines are assigned by VOLATILITY, not by topic, so
8
+ * the reader's eye learns where to look:
9
9
  *
10
- * L1 workspace & identity (static): project, working_dir, git, model, mode,
11
- * prompt_variant, theme, sessions, tools; version right-anchored.
12
- * L2 run state, safety & vitals (live): state, yolo, autonomy,
13
- * eternal_stage, breaker, ctx·tokens·cost·cache, queue, processes,
14
- * elapsed, token_saving, side_effects; hint last (first dropped).
15
- * L3 active work & countdowns (conditional): goal, todos, plan, tasks,
16
- * next_steps, auto_proceed, enhance, dropped_tools.
17
- * L4 fleet, connectivity & services (conditional): fleet, mailbox, brain,
18
- * debug_stream, memory; index right-anchored.
10
+ * L1 IDENTITY — project, working_dir, git, model, mode, prompt_variant,
11
+ * theme, sessions, tools; version right-anchored. Fixed for the session.
12
+ * L2 VITALS — state, context, tokens, cost, cache, elapsed, queue, hint;
13
+ * index right-anchored. Redraws every token.
14
+ * L3 SAFETY & WORK — yolo, autonomy, eternal_stage, breaker, token_saving,
15
+ * processes, side_effects, dropped_tools, goal, todos, plan, tasks.
16
+ * L4 ASYNC — fleet, fleet_agents, mailbox, brain, debug_stream, memory,
17
+ * next_steps, auto_proceed, enhance.
19
18
  *
20
- * L3/L4 gates derive from the rendered entries themselves, so an empty rail
21
- * never renders and a vanilla session keeps its two-line footprint.
19
+ * Every chip declares its density levels (full → short → micro) and the rail
20
+ * fitter in `powerline-rail.tsx` shortens before it drops, so a narrow
21
+ * terminal loses detail rather than losing chips. L3/L4 gates derive from
22
+ * the rendered entries themselves, so an empty rail never renders and a
23
+ * vanilla session keeps its two-line footprint.
22
24
  */
23
- export declare function StatusBar({ model, provider, version, latestVersion, updateAvailable, state, thinkingWord, thinkingAnimationStyle, tokenCounter, hint, queueCount, yolo, autonomy, fleetWorkingTime, todos, plan, tasks, fleet, fleetAgents, git, subagentCount, brain, projectName, workingDir, processCount, context, estimatedContextTokens, Sage, memoryContextMonitor, contextStrategy, hiddenItems, statuslineLines, mode, events, sessionId, eternalStage, goalSummary, droppedTools, indexState, breakerCountdown, modeLabel, promptVariant, themeName, debugStreamStats, enhanceCountdown, nextStepsAutoSubmitCountdown, nextStepsAutoSubmitLabel, autoProceedCountdown, sessionCount, mailbox, tokenSavingMode, toolCount, visibleChips, sideEffectCount, maxWidth, clickMapRef, }: StatusBarProps): React.ReactElement;
25
+ export declare function StatusBar({ model, provider, version, latestVersion, updateAvailable, state, thinkingWord, thinkingAnimationStyle, tokenCounter, hint, queueCount, yolo, autonomy, fleetWorkingTime, todos, plan, tasks, fleet, fleetAgents, git, subagentCount, brain, projectName, workingDir, processCount, context, estimatedContextTokens, Sage, memoryContextMonitor, contextStrategy, hiddenItems, statuslineLines, statuslineDensities, mode, events, sessionId, eternalStage, goalSummary, droppedTools, indexState, breakerCountdown, modeLabel, promptVariant, themeName, debugStreamStats, enhanceCountdown, nextStepsAutoSubmitCountdown, nextStepsAutoSubmitLabel, autoProceedCountdown, sessionCount, mailbox, tokenSavingMode, toolCount, visibleChips, sideEffectCount, maxWidth, clickMapRef, }: StatusBarProps): React.ReactElement;
24
26
  //# sourceMappingURL=status-bar.d.ts.map