@wrongstack/tui 0.298.0 → 0.298.2
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/dist/app-action-type.d.ts +16 -1
- package/dist/app-key-handler.d.ts +4 -0
- package/dist/app-settings-type.d.ts +30 -2
- package/dist/app-state.d.ts +17 -4
- package/dist/app-status-region.d.ts +7 -2
- package/dist/app-ui-state.d.ts +24 -0
- package/dist/auth-panel-model.d.ts +36 -2
- package/dist/components/fleet-panel.d.ts +3 -1
- package/dist/components/history/copy-geometry.d.ts +61 -0
- package/dist/components/history/sage-output-format.d.ts +7 -6
- package/dist/components/history/scroll-controller-types.d.ts +116 -0
- package/dist/components/history/scrollbar-geometry.d.ts +60 -0
- package/dist/components/history/scrollbar-rail.d.ts +18 -0
- package/dist/components/history/selection-helpers.d.ts +111 -0
- package/dist/components/input.d.ts +8 -1
- package/dist/components/plan-panel.d.ts +30 -3
- package/dist/components/scrollable-history.d.ts +7 -335
- package/dist/components/settings-picker-model.d.ts +13 -52
- package/dist/components/settings-picker.d.ts +10 -5
- package/dist/components/sidebar-content.d.ts +47 -0
- package/dist/components/sidebar-panel-frame.d.ts +80 -0
- package/dist/components/sidebar-panels.d.ts +136 -0
- package/dist/components/sidebar.d.ts +49 -0
- package/dist/components/status-bar-format.d.ts +10 -0
- package/dist/components/status-bar-types.d.ts +7 -0
- package/dist/components/status-bar.d.ts +1 -1
- package/dist/hit-test.d.ts +3 -2
- package/dist/hooks/use-provider-event-bridge.d.ts +1 -1
- package/dist/hooks/use-sidebar-panel-data.d.ts +59 -0
- package/dist/index.js +4224 -2010
- package/dist/input-validation/action-types.d.ts +1 -1
- package/dist/reducers/helpers.d.ts +1 -1
- package/dist/reducers/workspace-panels.d.ts +1 -1
- package/dist/settings-contracts.d.ts +11 -1
- package/dist/ui-contracts.d.ts +54 -0
- package/package.json +8 -8
|
@@ -0,0 +1,136 @@
|
|
|
1
|
+
import type React from 'react';
|
|
2
|
+
import type { FleetEntry } from '../app-state.js';
|
|
3
|
+
import type { TodoItem } from '@wrongstack/core/agent';
|
|
4
|
+
import type { GoalSummary } from '../app-state.js';
|
|
5
|
+
import type { QueueItem } from '../app-state-core-types.js';
|
|
6
|
+
import type { LiveSessionEntry } from './sessions-panel.js';
|
|
7
|
+
import type { ProjectPickerItem } from './project-picker.js';
|
|
8
|
+
import type { ResumeSessionEntry } from '../app-state.js';
|
|
9
|
+
import type { WorktreeRow } from '../ui-contracts.js';
|
|
10
|
+
export interface ProjectPickerSidebarProps {
|
|
11
|
+
/** Already-filtered picker items. Navigation indices target this list directly. */
|
|
12
|
+
items: readonly ProjectPickerItem[];
|
|
13
|
+
/** Index into `items`. */
|
|
14
|
+
selected: number;
|
|
15
|
+
/** Current filter text. */
|
|
16
|
+
filter: string;
|
|
17
|
+
/** Optional status/error hint shown below the list. */
|
|
18
|
+
hint?: string | undefined;
|
|
19
|
+
/** Current project name to highlight. */
|
|
20
|
+
currentProject?: string | undefined;
|
|
21
|
+
/** Width of the sidebar in columns. */
|
|
22
|
+
width: number;
|
|
23
|
+
}
|
|
24
|
+
export declare function ProjectPickerSidebar({ items, selected, filter, hint, currentProject, width, }: ProjectPickerSidebarProps): React.ReactElement;
|
|
25
|
+
export interface FleetPanelSidebarProps {
|
|
26
|
+
entries: Record<string, FleetEntry>;
|
|
27
|
+
/** Active (running) subagent count. */
|
|
28
|
+
runningCount: number;
|
|
29
|
+
/** Width of the sidebar in columns. */
|
|
30
|
+
width: number;
|
|
31
|
+
}
|
|
32
|
+
export declare function FleetPanelSidebar({ entries, runningCount, width, }: FleetPanelSidebarProps): React.ReactElement;
|
|
33
|
+
export interface AgentsPanelSidebarProps {
|
|
34
|
+
entries: Record<string, FleetEntry>;
|
|
35
|
+
totalCost: number;
|
|
36
|
+
nowTick: number;
|
|
37
|
+
width: number;
|
|
38
|
+
}
|
|
39
|
+
export declare function AgentsPanelSidebar({ entries, totalCost, nowTick, width, }: AgentsPanelSidebarProps): React.ReactElement;
|
|
40
|
+
export interface WorktreePanelSidebarProps {
|
|
41
|
+
worktrees: Record<string, WorktreeRow>;
|
|
42
|
+
/** Width of the sidebar in columns. */
|
|
43
|
+
width: number;
|
|
44
|
+
}
|
|
45
|
+
export declare function WorktreePanelSidebar({ worktrees, width, }: WorktreePanelSidebarProps): React.ReactElement;
|
|
46
|
+
export interface PlanPanelSidebarProps {
|
|
47
|
+
/** Plan items grouped by status. */
|
|
48
|
+
openCount: number;
|
|
49
|
+
inProgressCount: number;
|
|
50
|
+
doneCount: number;
|
|
51
|
+
/** Up to N plan item titles to display. */
|
|
52
|
+
items: readonly {
|
|
53
|
+
id: string;
|
|
54
|
+
title: string;
|
|
55
|
+
status: 'open' | 'in_progress' | 'done';
|
|
56
|
+
}[];
|
|
57
|
+
/** Title of the plan (if any). */
|
|
58
|
+
title?: string | undefined;
|
|
59
|
+
width: number;
|
|
60
|
+
}
|
|
61
|
+
export declare function PlanPanelSidebar({ openCount, inProgressCount, doneCount, items, title, width, }: PlanPanelSidebarProps): React.ReactElement;
|
|
62
|
+
export interface TodosPanelSidebarProps {
|
|
63
|
+
todos: readonly TodoItem[];
|
|
64
|
+
width: number;
|
|
65
|
+
}
|
|
66
|
+
export declare function TodosPanelSidebar({ todos, width }: TodosPanelSidebarProps): React.ReactElement;
|
|
67
|
+
export interface QueuePanelSidebarProps {
|
|
68
|
+
items: readonly QueueItem[];
|
|
69
|
+
width: number;
|
|
70
|
+
}
|
|
71
|
+
export declare function QueuePanelSidebar({ items, width }: QueuePanelSidebarProps): React.ReactElement;
|
|
72
|
+
export interface ProcessListPanelSidebarProps {
|
|
73
|
+
/** Active process count and a few process summaries. */
|
|
74
|
+
activeCount: number;
|
|
75
|
+
/** Total process count. */
|
|
76
|
+
totalCount: number;
|
|
77
|
+
/** Up to 8 process rows: name + pid. */
|
|
78
|
+
processes: readonly {
|
|
79
|
+
pid: number;
|
|
80
|
+
name: string;
|
|
81
|
+
status?: string;
|
|
82
|
+
}[];
|
|
83
|
+
width: number;
|
|
84
|
+
}
|
|
85
|
+
export declare function ProcessListPanelSidebar({ activeCount, totalCount, processes, width, }: ProcessListPanelSidebarProps): React.ReactElement;
|
|
86
|
+
export interface GoalPanelSidebarProps {
|
|
87
|
+
goal: GoalSummary | null;
|
|
88
|
+
coordinatorRunning: boolean;
|
|
89
|
+
width: number;
|
|
90
|
+
}
|
|
91
|
+
export declare function GoalPanelSidebar({ goal, coordinatorRunning, width, }: GoalPanelSidebarProps): React.ReactElement;
|
|
92
|
+
export interface SessionsPanelSidebarProps {
|
|
93
|
+
liveSessions?: readonly LiveSessionEntry[] | undefined;
|
|
94
|
+
resumeSessions?: readonly ResumeSessionEntry[] | undefined;
|
|
95
|
+
currentSessionId?: string | undefined;
|
|
96
|
+
width: number;
|
|
97
|
+
}
|
|
98
|
+
export declare function SessionsPanelSidebar({ liveSessions, resumeSessions, currentSessionId, width, }: SessionsPanelSidebarProps): React.ReactElement;
|
|
99
|
+
export interface CoordinatorPanelSidebarProps {
|
|
100
|
+
running: boolean;
|
|
101
|
+
/** Active phase count. */
|
|
102
|
+
activePhases: number;
|
|
103
|
+
/** Completed phase count. */
|
|
104
|
+
completedPhases: number;
|
|
105
|
+
/** Up to 5 active phase names. */
|
|
106
|
+
phaseNames: readonly string[];
|
|
107
|
+
/** Elapsed ms since coordinator started. */
|
|
108
|
+
elapsedMs: number;
|
|
109
|
+
width: number;
|
|
110
|
+
}
|
|
111
|
+
export declare function CoordinatorPanelSidebar({ running, activePhases, completedPhases, phaseNames, elapsedMs, width, }: CoordinatorPanelSidebarProps): React.ReactElement;
|
|
112
|
+
export interface KanbanPanelSidebarProps {
|
|
113
|
+
/** Per-column counts: Backlog / Up Next / In Progress / Review / Done. */
|
|
114
|
+
columns: readonly {
|
|
115
|
+
name: string;
|
|
116
|
+
count: number;
|
|
117
|
+
wip?: number;
|
|
118
|
+
}[];
|
|
119
|
+
/** Active card count (total cards across all columns). */
|
|
120
|
+
totalActive: number;
|
|
121
|
+
/** Up to 6 active card titles. */
|
|
122
|
+
activeCardTitles: readonly string[];
|
|
123
|
+
width: number;
|
|
124
|
+
}
|
|
125
|
+
export declare function KanbanPanelSidebar({ columns, totalActive, activeCardTitles, width, }: KanbanPanelSidebarProps): React.ReactElement;
|
|
126
|
+
export interface ConnectionsPanelSidebarProps {
|
|
127
|
+
/** Connection summaries: name + status badge. */
|
|
128
|
+
connections: readonly {
|
|
129
|
+
name: string;
|
|
130
|
+
status: 'ok' | 'warn' | 'down' | 'unknown';
|
|
131
|
+
latencyMs?: number | undefined;
|
|
132
|
+
}[];
|
|
133
|
+
width: number;
|
|
134
|
+
}
|
|
135
|
+
export declare function ConnectionsPanelSidebar({ connections, width, }: ConnectionsPanelSidebarProps): React.ReactElement;
|
|
136
|
+
//# sourceMappingURL=sidebar-panels.d.ts.map
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
import type React from 'react';
|
|
2
|
+
/** Terminal widths below this hide the sidebar entirely. */
|
|
3
|
+
export declare const SIDEBAR_MIN_TERMINAL = 64;
|
|
4
|
+
/** Smallest sidebar width (in columns) when visible. */
|
|
5
|
+
export declare const SIDEBAR_MIN_WIDTH = 20;
|
|
6
|
+
/** Largest sidebar width (in columns). */
|
|
7
|
+
export declare const SIDEBAR_MAX_WIDTH = 48;
|
|
8
|
+
/** Fraction of terminal width to allocate to the sidebar. */
|
|
9
|
+
export declare const SIDEBAR_FRACTION = 0.25;
|
|
10
|
+
/** Border (2) plus horizontal padding (2) consumed by RightSidebar. */
|
|
11
|
+
export declare const SIDEBAR_HORIZONTAL_CHROME = 4;
|
|
12
|
+
/**
|
|
13
|
+
* Return the width available to children inside RightSidebar.
|
|
14
|
+
*
|
|
15
|
+
* Routed panel frames have their own border and padding, so they must receive
|
|
16
|
+
* this content width rather than claiming the outer sidebar width again.
|
|
17
|
+
*/
|
|
18
|
+
export declare function computeSidebarContentWidth(sidebarWidth: number): number;
|
|
19
|
+
/**
|
|
20
|
+
* Compute the sidebar width in columns for a given terminal width.
|
|
21
|
+
* Returns 0 when the terminal is too narrow for a sidebar.
|
|
22
|
+
*
|
|
23
|
+
* Pure — no React, no Ink — so callers can use the same value for layout
|
|
24
|
+
* math (e.g. narrowing the history column) without mounting the component.
|
|
25
|
+
*/
|
|
26
|
+
export declare function computeSidebarWidth(termCols: number): number;
|
|
27
|
+
export interface RightSidebarProps {
|
|
28
|
+
/**
|
|
29
|
+
* Optional explicit width override (in columns). When omitted, the width
|
|
30
|
+
* is derived from the current terminal width via {@link computeSidebarWidth}.
|
|
31
|
+
*/
|
|
32
|
+
width?: number | undefined;
|
|
33
|
+
/**
|
|
34
|
+
* Maximum height in rows. Content beyond this is clipped (scroll handled
|
|
35
|
+
* by the caller via scrollOffset). When omitted, no height cap is applied.
|
|
36
|
+
*/
|
|
37
|
+
maxHeight?: number | undefined;
|
|
38
|
+
/**
|
|
39
|
+
* When true, the sidebar border is highlighted to indicate keyboard focus.
|
|
40
|
+
*/
|
|
41
|
+
focused?: boolean | undefined;
|
|
42
|
+
/**
|
|
43
|
+
* Content to render inside the sidebar. When omitted, a dimmed placeholder
|
|
44
|
+
* label is shown so the reserved region is visually self-documenting.
|
|
45
|
+
*/
|
|
46
|
+
children?: React.ReactNode | undefined;
|
|
47
|
+
}
|
|
48
|
+
export declare function RightSidebar({ width, maxHeight, focused, children }: RightSidebarProps): React.ReactElement | null;
|
|
49
|
+
//# sourceMappingURL=sidebar.d.ts.map
|
|
@@ -58,6 +58,16 @@ export declare function stateChip(state: 'idle' | 'running' | 'streaming' | 'abo
|
|
|
58
58
|
export declare function renderProgress(ratio: number, width: number): string;
|
|
59
59
|
export declare function contextBarColor(ratio: number): string;
|
|
60
60
|
export declare function renderMeter(ratio: number, width: number): string;
|
|
61
|
+
/**
|
|
62
|
+
* Block-style meter for the sidebar — a solid fill (`█`) plus an empty track
|
|
63
|
+
* (`░`). Returned as two segments so the caller can color the fill (e.g. by
|
|
64
|
+
* context pressure via {@link contextBarColor}) independently of the dim track.
|
|
65
|
+
* Width-safe: `filled.length + empty.length === max(1, width)` always holds.
|
|
66
|
+
*/
|
|
67
|
+
export declare function blockMeter(ratio: number, width: number): {
|
|
68
|
+
filled: string;
|
|
69
|
+
empty: string;
|
|
70
|
+
};
|
|
61
71
|
export declare function fmtTok(n: number): string;
|
|
62
72
|
export declare function fmtMemory(bytes: number): string;
|
|
63
73
|
export declare function fmtElapsed(ms: number): string;
|
|
@@ -372,5 +372,12 @@ export interface StatusBarProps {
|
|
|
372
372
|
* Clicking opens /audit (TUI) — in the REPL it's informational.
|
|
373
373
|
*/
|
|
374
374
|
sideEffectCount?: number | undefined;
|
|
375
|
+
/**
|
|
376
|
+
* Optional cap on the column width used for layout adaptation. When set,
|
|
377
|
+
* the status bar treats this as its effective terminal width instead of
|
|
378
|
+
* `stdout.columns` — needed when the bar sits in a column narrower than
|
|
379
|
+
* the full terminal (e.g. beside a sidebar).
|
|
380
|
+
*/
|
|
381
|
+
maxWidth?: number | undefined;
|
|
375
382
|
}
|
|
376
383
|
//# sourceMappingURL=status-bar-types.d.ts.map
|
|
@@ -11,5 +11,5 @@ export declare const COMPACT_THRESHOLD = 50;
|
|
|
11
11
|
* to show — git branch, elapsed time, todo counts, YOLO marker — so a
|
|
12
12
|
* vanilla session keeps the original single-line footprint.
|
|
13
13
|
*/
|
|
14
|
-
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, processMemory, cpuPercent, context, estimatedContextTokens, Sage, memoryContextMonitor, contextStrategy, hiddenItems, mode, events, sessionId, eternalStage, goalSummary, droppedTools, indexState, breakerCountdown, modeLabel, debugStreamStats, enhanceCountdown, nextStepsAutoSubmitCountdown, nextStepsAutoSubmitLabel, autoProceedCountdown, sessionCount, mailbox, tokenSavingMode, toolCount, visibleChips, sideEffectCount, }: StatusBarProps): React.ReactElement;
|
|
14
|
+
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, processMemory, cpuPercent, context, estimatedContextTokens, Sage, memoryContextMonitor, contextStrategy, hiddenItems, mode, events, sessionId, eternalStage, goalSummary, droppedTools, indexState, breakerCountdown, modeLabel, debugStreamStats, enhanceCountdown, nextStepsAutoSubmitCountdown, nextStepsAutoSubmitLabel, autoProceedCountdown, sessionCount, mailbox, tokenSavingMode, toolCount, visibleChips, sideEffectCount, maxWidth, }: StatusBarProps): React.ReactElement;
|
|
15
15
|
//# sourceMappingURL=status-bar.d.ts.map
|
package/dist/hit-test.d.ts
CHANGED
|
@@ -40,9 +40,10 @@ export type HitRegion =
|
|
|
40
40
|
};
|
|
41
41
|
/**
|
|
42
42
|
* Columns at the right edge of the history viewport reserved for the copy/scroll
|
|
43
|
-
* rail. Copy icons use the first column
|
|
43
|
+
* rail. Copy icons use the first column, a blank gap separates them from the
|
|
44
|
+
* scrollbar track in the last column.
|
|
44
45
|
*/
|
|
45
|
-
export declare const SCROLLBAR_HIT_WIDTH =
|
|
46
|
+
export declare const SCROLLBAR_HIT_WIDTH = 3;
|
|
46
47
|
/** Rows available to managed history after reserving the measured bottom UI. */
|
|
47
48
|
export declare function historyViewportRows(termRows: number, bottomHeight: number): number;
|
|
48
49
|
/**
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { type Dispatch, type MutableRefObject, type SetStateAction } from 'react';
|
|
2
|
-
import type { AppProps } from '../app-props.js';
|
|
3
2
|
import type { Action } from '../app-action-type.js';
|
|
3
|
+
import type { AppProps } from '../app-props.js';
|
|
4
4
|
import { type MemoryContextMonitorState } from '../memory-context-monitor.js';
|
|
5
5
|
interface ProviderEventBridgeOptions {
|
|
6
6
|
events: AppProps['events'];
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Data hooks for sidebar panel twins.
|
|
3
|
+
*
|
|
4
|
+
* These hooks lift the data sources used by the bottom-region panels
|
|
5
|
+
* (ProcessList, Kanban, Connections) into the shared `app-view.tsx`
|
|
6
|
+
* runtime scope so the sidebar twins can receive real data instead of
|
|
7
|
+
* hardcoded empty arrays.
|
|
8
|
+
*
|
|
9
|
+
* Each hook is self-contained: it manages its own refresh interval and
|
|
10
|
+
* cleanup. The hooks must be called unconditionally (rules of hooks), but
|
|
11
|
+
* polling is gated by the `enabled` flag — app-view passes whether the
|
|
12
|
+
* twin currently occupies a visible sidebar slot. While a panel is closed
|
|
13
|
+
* or routed to the bottom region no polling runs (the bottom panels run
|
|
14
|
+
* their own polling when open), so the session pays no IPC probes or disk
|
|
15
|
+
* reads for panels nobody is looking at. Each hook performs an immediate
|
|
16
|
+
* first read when enabled, so data is fresh the moment the twin mounts.
|
|
17
|
+
*/
|
|
18
|
+
export interface SidebarProcess {
|
|
19
|
+
pid: number;
|
|
20
|
+
name: string;
|
|
21
|
+
status: string;
|
|
22
|
+
}
|
|
23
|
+
/**
|
|
24
|
+
* Read the live process registry. Refreshes every 2 seconds (only while
|
|
25
|
+
* `enabled`) so elapsed times and newly spawned/killed processes are
|
|
26
|
+
* reflected.
|
|
27
|
+
*/
|
|
28
|
+
export declare function useSidebarProcessList(enabled?: boolean): {
|
|
29
|
+
activeCount: number;
|
|
30
|
+
totalCount: number;
|
|
31
|
+
processes: readonly SidebarProcess[];
|
|
32
|
+
};
|
|
33
|
+
export interface SidebarConnection {
|
|
34
|
+
name: string;
|
|
35
|
+
status: 'ok' | 'warn' | 'down' | 'unknown';
|
|
36
|
+
latencyMs?: number | undefined;
|
|
37
|
+
}
|
|
38
|
+
/**
|
|
39
|
+
* Poll connections health every 8 seconds (only while `enabled`). The
|
|
40
|
+
* collection function lives in `connections-health.ts` and mirrors the
|
|
41
|
+
* WebUI server's shape. We map the richer `ConnectionHealthService` status
|
|
42
|
+
* into the sidebar's 4-state enum so the sidebar twin stays simple.
|
|
43
|
+
*/
|
|
44
|
+
export declare function useSidebarConnections(projectRoot: string, enabled?: boolean): readonly SidebarConnection[];
|
|
45
|
+
export interface SidebarKanbanColumn {
|
|
46
|
+
name: string;
|
|
47
|
+
count: number;
|
|
48
|
+
}
|
|
49
|
+
/**
|
|
50
|
+
* Load the kanban board summary for the sidebar. Uses `listBoards()` to
|
|
51
|
+
* find the most recently used board, then fetches its column counts.
|
|
52
|
+
* Refreshes every 10 seconds (only while `enabled`).
|
|
53
|
+
*/
|
|
54
|
+
export declare function useSidebarKanban(projectRoot: string, enabled?: boolean): {
|
|
55
|
+
columns: readonly SidebarKanbanColumn[];
|
|
56
|
+
totalActive: number;
|
|
57
|
+
activeCardTitles: readonly string[];
|
|
58
|
+
};
|
|
59
|
+
//# sourceMappingURL=use-sidebar-panel-data.d.ts.map
|