@wrongstack/tui 1.1.4 → 1.1.6

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,17 @@
1
+ import type React from 'react';
2
+ import type { ContextPanelData } from './context-panel-types.js';
3
+ /**
4
+ * Cache coverage section — answers "exactly how far does the prompt cache
5
+ * extend into the live request?" Renders the last request's hit ratio (the
6
+ * session-cumulative one next to it lags: it carries the cold first request
7
+ * forever) plus a per-request coverage meter that visibly marks where the cached
8
+ * prefix ends. Hidden when nothing has been cached yet so the panel does
9
+ * not advertise a 0% figure as if it were meaningful.
10
+ */
11
+ export declare function CacheSection({ data }: {
12
+ data: ContextPanelData;
13
+ }): React.ReactElement;
14
+ export declare function MemoryContextSection({ data }: {
15
+ data: ContextPanelData;
16
+ }): React.ReactElement;
17
+ //# sourceMappingURL=context-panel-cache-memory.d.ts.map
@@ -1,6 +1,7 @@
1
1
  import type { ContextBreakdown } from '@wrongstack/core/utils';
2
2
  import type React from 'react';
3
3
  import type { ContextPanelData } from './context-panel-types.js';
4
+ export { CacheSection, MemoryContextSection } from './context-panel-cache-memory.js';
4
5
  type ZoneLevel = 'safe' | 'warning' | 'critical' | 'danger';
5
6
  export declare function zoneFor(pct: number): ZoneLevel;
6
7
  export declare function zoneColor(zone: ZoneLevel): string;
@@ -33,22 +34,7 @@ export declare function AgentFootprintSection({ data, contentWidth, }: {
33
34
  export declare function MetricsSection({ data }: {
34
35
  data: ContextPanelData;
35
36
  }): React.ReactElement;
36
- /**
37
- * Cache coverage section — answers "exactly how far does the prompt cache
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
41
- * prefix ends. Hidden when nothing has been cached yet so the panel does
42
- * not advertise a 0% figure as if it were meaningful.
43
- */
44
- export declare function CacheSection({ data }: {
45
- data: ContextPanelData;
46
- }): React.ReactElement;
47
37
  export declare function StatusSection({ data }: {
48
38
  data: ContextPanelData;
49
39
  }): React.ReactElement;
50
- export declare function MemoryContextSection({ data }: {
51
- data: ContextPanelData;
52
- }): React.ReactElement;
53
- export {};
54
40
  //# sourceMappingURL=context-panel-sections.d.ts.map
@@ -0,0 +1,29 @@
1
+ import type React from 'react';
2
+ import type { InputCell } from '../input-tokens.js';
3
+ import type { AnimationStyle } from './animation-style.js';
4
+ import { type ComposerStatus } from './composer-status-chip.js';
5
+ /** Exact-width composer top rail with an isolated activity-icon timer.
6
+ *
7
+ * Layout:
8
+ * ╭─ icon TITLE ──────── status ─╮
9
+ * The provider/model is shown in the status bar instead.
10
+ */
11
+ export declare function ComposerTopRail({ width, title, status, animationStyle, disabled, workingTime, icon, accent, }: {
12
+ width: number;
13
+ title: string;
14
+ status: ComposerStatus;
15
+ animationStyle: AnimationStyle | 'cycle';
16
+ disabled: boolean;
17
+ workingTime?: number | undefined;
18
+ /** Glyph drawn before the title; defaults to the brand glyph. */
19
+ icon?: string | undefined;
20
+ /** Rail color override (e.g. warn color while bash mode is active). */
21
+ accent?: string | undefined;
22
+ }): React.ReactElement;
23
+ /**
24
+ * Render one wrapped row of input cells into styled `<Text>` spans. Consecutive
25
+ * cells with the same style are coalesced into a single span; the cursor cell is
26
+ * always emitted on its own (inverse). `promptColor` styles the leading prompt.
27
+ */
28
+ export declare function renderRow(cells: InputCell[], rowKey: string, promptColor: string): React.ReactNode[];
29
+ //# sourceMappingURL=input-rows.d.ts.map
@@ -1,7 +1,7 @@
1
1
  import type React from 'react';
2
2
  import { type MouseEventInfo } from '../mouse.js';
3
3
  import type { AnimationStyle } from './animation-style.js';
4
- import { type ComposerStatus } from './composer-status-chip.js';
4
+ import type { ComposerStatus } from './composer-status-chip.js';
5
5
  export declare const DEFAULT_INPUT_PROMPT: string;
6
6
  /** Columns available to input tokens inside the two-sided composer rail. */
7
7
  export declare function inputContentWidth(termColumns: number): number;
@@ -0,0 +1,9 @@
1
+ import type { SettingsPickerProps } from './settings-picker-props.js';
2
+ import type { SettingsPickerRowData } from './settings-picker-row-list.js';
3
+ /**
4
+ * The settings picker's row list — section headers and one row per field,
5
+ * each with its current value and a one-line description. Field order here
6
+ * IS the field index the reducer and jump chords use.
7
+ */
8
+ export declare function buildSettingsPickerRows({ mode, delayMs, titleAnimation, yolo, fleetChat, chime, confirmExit, nextPrediction, featureMcp, featurePlugins, featureMemory, featureSkills, featureModelsRegistry, featureToolCoach, tokenSavingTier, allowOutsideProjectRoot, maxIterations, autoProceedMaxIterations, enhanceDelayMs, enhanceEnabled, enhanceLanguage, preRefineSeconds, indexOnStart, multiDiffSummaryThreshold, thinkingWord, thinkingWordEditing, thinkingWordDraft, wrongProxyUrlEditing, wrongProxyUrlDraft, reasoningMode, reasoningEffort, reasoningEffortLevels, reasoningPreserve, cacheTtl, contextAutoCompact, contextStrategy, contextMode, maxConcurrent, logLevel, auditLevel, debugStream, statuslineMode, configScope, animationStyle, breakerEnabled, breakerAutoKillResetMs, showModelReasoning, toolResultViewMode, showAgentSwarmPanel, showSidebar, showSageMemoryInject, sageMemoryInjectThreshold, nextStepsTool, nextStepsRequired, rememberStartupChoices, nextSystemPromptVariant, readSymbols, panelPositions, wrongProxyEnabled, wrongProxyUrl, }: SettingsPickerProps): SettingsPickerRowData[];
9
+ //# sourceMappingURL=settings-picker-rows.d.ts.map
@@ -3,5 +3,5 @@ import type { SettingsPickerProps } from './settings-picker-props.js';
3
3
  export { SETTINGS_PICKER_JUMP_CHORDS, settingsPickerJumpByName, settingsPickerJumpField, settingsPickerJumpNames, } from './settings-picker-jumps.js';
4
4
  export * from './settings-picker-model.js';
5
5
  export type { SettingsPickerProps } from './settings-picker-props.js';
6
- export declare function SettingsPicker({ field, filter, mode, delayMs, titleAnimation, yolo, fleetChat, chime, confirmExit, nextPrediction, featureMcp, featurePlugins, featureMemory, featureSkills, featureModelsRegistry, featureToolCoach, tokenSavingTier, allowOutsideProjectRoot, maxIterations, autoProceedMaxIterations, enhanceDelayMs, enhanceEnabled, enhanceLanguage, preRefineSeconds, indexOnStart, multiDiffSummaryThreshold, thinkingWord, thinkingWordEditing, thinkingWordDraft, wrongProxyUrlEditing, wrongProxyUrlDraft, reasoningMode, reasoningEffort, reasoningEffortLevels, reasoningPreserve, cacheTtl, contextAutoCompact, contextStrategy, contextMode, maxConcurrent, logLevel, auditLevel, debugStream, statuslineMode, configScope, profileConfigPath, animationStyle, breakerEnabled, breakerAutoKillResetMs, showModelReasoning, toolResultViewMode, showAgentSwarmPanel, showSidebar, showSageMemoryInject, sageMemoryInjectThreshold, nextStepsTool, nextStepsRequired, rememberStartupChoices, nextSystemPromptVariant, readSymbols, panelPositions, wrongProxyEnabled, wrongProxyUrl, inputHeight, maxRows, columns, hint, onLayoutComputed, }: SettingsPickerProps): React.ReactElement;
6
+ export declare function SettingsPicker(props: SettingsPickerProps): React.ReactElement;
7
7
  //# sourceMappingURL=settings-picker.d.ts.map
@@ -0,0 +1,8 @@
1
+ import type { CacheStats } from '@wrongstack/core/types';
2
+ import type React from 'react';
3
+ /** Sidebar prompt-cache card: last-request hit ratio, session average and coverage. */
4
+ export declare function CacheCard({ cacheStats, innerWidth, }: {
5
+ cacheStats: CacheStats | undefined;
6
+ innerWidth: number;
7
+ }): React.ReactElement;
8
+ //# sourceMappingURL=sidebar-cache-card.d.ts.map
@@ -0,0 +1,23 @@
1
+ import type React from 'react';
2
+ import type { ResumeSessionEntry } from '../app-state.js';
3
+ import type { LiveSessionEntry } from './sessions-panel.js';
4
+ export interface SessionsPanelSidebarProps {
5
+ liveSessions?: readonly LiveSessionEntry[] | undefined;
6
+ resumeSessions?: readonly ResumeSessionEntry[] | undefined;
7
+ currentSessionId?: string | undefined;
8
+ now?: number | undefined;
9
+ width: number;
10
+ }
11
+ export declare function SessionsPanelSidebar({ liveSessions, resumeSessions, currentSessionId, now, width, }: SessionsPanelSidebarProps): React.ReactElement;
12
+ export interface KanbanPanelSidebarProps {
13
+ columns: readonly {
14
+ name: string;
15
+ count: number;
16
+ wip?: number;
17
+ }[];
18
+ totalActive: number;
19
+ activeCardTitles: readonly string[];
20
+ width: number;
21
+ }
22
+ export declare function KanbanPanelSidebar({ columns, totalActive, activeCardTitles, width, }: KanbanPanelSidebarProps): React.ReactElement;
23
+ //# sourceMappingURL=sidebar-panels-sessions.d.ts.map
@@ -1,8 +1,9 @@
1
1
  import type { TodoItem } from '@wrongstack/core/agent';
2
2
  import type React from 'react';
3
- import type { GoalSummary, ResumeSessionEntry } from '../app-state.js';
3
+ import type { GoalSummary } from '../app-state.js';
4
4
  import type { QueueItem } from '../app-state-core-types.js';
5
- import type { LiveSessionEntry } from './sessions-panel.js';
5
+ export type { KanbanPanelSidebarProps, SessionsPanelSidebarProps, } from './sidebar-panels-sessions.js';
6
+ export { KanbanPanelSidebar, SessionsPanelSidebar } from './sidebar-panels-sessions.js';
6
7
  export interface PlanPanelSidebarProps {
7
8
  openCount: number;
8
9
  inProgressCount: number;
@@ -43,23 +44,4 @@ export interface GoalPanelSidebarProps {
43
44
  width: number;
44
45
  }
45
46
  export declare function GoalPanelSidebar({ goal, coordinatorRunning, width, }: GoalPanelSidebarProps): React.ReactElement;
46
- export interface SessionsPanelSidebarProps {
47
- liveSessions?: readonly LiveSessionEntry[] | undefined;
48
- resumeSessions?: readonly ResumeSessionEntry[] | undefined;
49
- currentSessionId?: string | undefined;
50
- now?: number | undefined;
51
- width: number;
52
- }
53
- export declare function SessionsPanelSidebar({ liveSessions, resumeSessions, currentSessionId, now, width, }: SessionsPanelSidebarProps): React.ReactElement;
54
- export interface KanbanPanelSidebarProps {
55
- columns: readonly {
56
- name: string;
57
- count: number;
58
- wip?: number;
59
- }[];
60
- totalActive: number;
61
- activeCardTitles: readonly string[];
62
- width: number;
63
- }
64
- export declare function KanbanPanelSidebar({ columns, totalActive, activeCardTitles, width, }: KanbanPanelSidebarProps): React.ReactElement;
65
47
  //# sourceMappingURL=sidebar-panels-task.d.ts.map
@@ -0,0 +1,34 @@
1
+ import type { UserInputAnswer, UserInputQuestion, UserInputRequest } from '@wrongstack/core/types';
2
+ import { type DOMElement } from '../ink.js';
3
+ export type AnswerDraft = {
4
+ selected: string[];
5
+ text: string;
6
+ customSelected: boolean;
7
+ delegated: boolean;
8
+ };
9
+ export type Draft = Record<string, AnswerDraft>;
10
+ export declare const EMPTY_ANSWER: AnswerDraft;
11
+ export declare function initialDraft(request: UserInputRequest): Draft;
12
+ export declare function canEditText(question: UserInputQuestion): boolean;
13
+ export declare function hasRecommendation(question: UserInputQuestion): boolean;
14
+ export declare function hasAnswer(question: UserInputQuestion, answer?: AnswerDraft): boolean;
15
+ export declare function validateDraft(questions: UserInputQuestion[], draft: Draft): {
16
+ valid: boolean;
17
+ missingCount: number;
18
+ firstMissing?: UserInputQuestion | undefined;
19
+ };
20
+ export declare function toAnswer(question: UserInputQuestion, answer: AnswerDraft): UserInputAnswer;
21
+ export declare function answerMarker(question: UserInputQuestion, answer?: AnswerDraft): string;
22
+ export declare function progressBar(completed: number, total: number, width: number): string;
23
+ /** Match one-based SGR mouse cells against Ink's measured zero-based rectangle. */
24
+ export declare function pointInsideElement(element: DOMElement | null, x: number, y: number): boolean;
25
+ export declare function truncate(value: string, width: number): string;
26
+ export declare function visibleWindow<T>(items: readonly T[], selected: number, limit: number): {
27
+ items: Array<{
28
+ item: T;
29
+ index: number;
30
+ }>;
31
+ above: number;
32
+ below: number;
33
+ };
34
+ //# sourceMappingURL=user-input-draft.d.ts.map
@@ -1,31 +1,15 @@
1
1
  import type { EventBus } from '@wrongstack/core/kernel';
2
- import type { UserInputQuestion, UserInputRequest, UserInputResponse } from '@wrongstack/core/types';
2
+ import type { UserInputRequest, UserInputResponse } from '@wrongstack/core/types';
3
3
  import type React from 'react';
4
- import { type DOMElement } from '../ink.js';
4
+ export { initialDraft, pointInsideElement, validateDraft } from './user-input-draft.js';
5
5
  export type PendingUserInput = {
6
6
  request: UserInputRequest;
7
7
  resolve: (response: UserInputResponse) => void;
8
8
  };
9
- type AnswerDraft = {
10
- selected: string[];
11
- text: string;
12
- customSelected: boolean;
13
- delegated: boolean;
14
- };
15
- type Draft = Record<string, AnswerDraft>;
16
9
  export declare function usePendingUserInput(events: EventBus): PendingUserInput | null;
17
10
  interface UserInputPromptProps {
18
11
  pending: PendingUserInput;
19
12
  onInterrupt?: (() => void) | undefined;
20
13
  }
21
14
  export declare function UserInputPrompt(props: UserInputPromptProps): React.ReactElement;
22
- export declare function initialDraft(request: UserInputRequest): Draft;
23
- export declare function validateDraft(questions: UserInputQuestion[], draft: Draft): {
24
- valid: boolean;
25
- missingCount: number;
26
- firstMissing?: UserInputQuestion | undefined;
27
- };
28
- /** Match one-based SGR mouse cells against Ink's measured zero-based rectangle. */
29
- export declare function pointInsideElement(element: DOMElement | null, x: number, y: number): boolean;
30
- export {};
31
15
  //# sourceMappingURL=user-input-prompt.d.ts.map
@@ -0,0 +1,32 @@
1
+ import type { Dispatch, MutableRefObject } from 'react';
2
+ import type { Action } from '../app-action-type.js';
3
+ import type { AppProps } from '../app-props.js';
4
+ import type { State } from '../app-state.js';
5
+ /** What one render of `useAppPickerKeys` hands the resume runner. */
6
+ export interface ResumeRunnerDeps {
7
+ state: State;
8
+ dispatch: Dispatch<Action>;
9
+ sessionGenerationRef?: MutableRefObject<number> | undefined;
10
+ /** Supersede token: bumped by every run, re-checked by every continuation. */
11
+ resumeRunRef: MutableRefObject<number>;
12
+ mountedRef: MutableRefObject<boolean>;
13
+ onResumeSession: AppProps['onResumeSession'];
14
+ switchQueueSession?: ((sessionId: string) => void) | undefined;
15
+ agent: AppProps['agent'];
16
+ setSuggestions: AppProps['setSuggestions'];
17
+ }
18
+ /**
19
+ * Run one resume, from the wipe to the last streamed entry.
20
+ *
21
+ * Shared by the `/resume` picker and the F10 sessions panel so the two cannot
22
+ * drift into showing different things for the same operation.
23
+ *
24
+ * The shape of it is the whole feature: clear the screen the way `/clear`
25
+ * does, show a live block while the journal is read (seconds, with nothing
26
+ * else on screen), then stream the transcript in so it scrolls into place the
27
+ * way it did when it was live — and stop there, waiting.
28
+ */
29
+ export declare function createResumeRunner({ state, dispatch, sessionGenerationRef, resumeRunRef, mountedRef, onResumeSession, switchQueueSession, agent, setSuggestions, }: ResumeRunnerDeps): (sessionId: string, label: string, hooks?: {
30
+ onSettled?: (() => void) | undefined;
31
+ }) => Promise<void>;
32
+ //# sourceMappingURL=app-resume-runner.d.ts.map
@@ -0,0 +1,43 @@
1
+ import type { Action, State } from '../app-reducer.js';
2
+ import type { AuthPanelHost } from '../auth-panel-model.js';
3
+ export interface UseAuthPanelOptions {
4
+ authHost: AuthPanelHost | undefined;
5
+ stateRef: {
6
+ current: State;
7
+ };
8
+ dispatch: React.Dispatch<Action>;
9
+ /**
10
+ * Live `state.authPanel.open` — when the panel closes from OUTSIDE the
11
+ * controller (another panel's `closePanels`, an F-key toggle, Ctrl+C),
12
+ * any in-flight flow must be aborted so an invisible prompt can't leave
13
+ * an OAuth loopback server (or a pending readline promise) running
14
+ * behind a closed panel.
15
+ */
16
+ open: boolean;
17
+ }
18
+ export interface AuthPanelController {
19
+ /** Open the panel (used by `/auth` via the panel bridge). No-op without a host. */
20
+ openAuthPanel: (view?: 'list' | 'oauth') => boolean;
21
+ onAuthEnter: () => void;
22
+ onAuthBack: () => void;
23
+ onAuthShortcut: (input: string) => void;
24
+ onAuthPromptSubmit: () => void;
25
+ onAuthPromptCancel: () => void;
26
+ onAuthConfirm: (yes: boolean) => void;
27
+ onAuthFlowCancel: () => void;
28
+ /**
29
+ * Ctrl+C while the panel is open. In raw-mode terminals (ConPTY, most
30
+ * Windows setups) Ctrl+C arrives as key DATA — not a SIGINT — so the
31
+ * key router must handle it; the app's SIGINT ladder covers the
32
+ * console-event delivery path. Both paths abort any in-flight flow and
33
+ * close the panel.
34
+ */
35
+ onAuthCtrlC: () => void;
36
+ /** Open the existing masked modal for a slash-command secret prompt. */
37
+ readSecret: (label: string) => Promise<string>;
38
+ /** Open the same modal with visible text for slash-command selections. */
39
+ readText: (label: string) => Promise<string>;
40
+ }
41
+ export declare function abortError(): Error;
42
+ export declare function toMessage(err: unknown): string;
43
+ //# sourceMappingURL=auth-panel-support.d.ts.map
@@ -0,0 +1,15 @@
1
+ import type { Dispatch } from 'react';
2
+ import type { Action } from '../app-action-type.js';
3
+ import type { AppProps } from '../app-props.js';
4
+ /**
5
+ * Subscribe the transcript to provider routing events: retries, errors,
6
+ * fallback hops, explicit and server-side model switches, and the fallback
7
+ * gate's pending prompt. Returns one unsubscribe for all of them.
8
+ */
9
+ export declare function subscribeProviderRoutingEvents(events: AppProps['events'], { agent, dispatch, discardAbandonedStream, }: {
10
+ agent: AppProps['agent'];
11
+ dispatch: Dispatch<Action>;
12
+ /** Drop a partial stream a retry or fallback hop is about to re-send. */
13
+ discardAbandonedStream: () => void;
14
+ }): () => void;
15
+ //# sourceMappingURL=provider-routing-events.d.ts.map
@@ -1,43 +1,4 @@
1
- import type { Action, State } from '../app-reducer.js';
2
- import { type AuthPanelHost } from '../auth-panel-model.js';
3
- interface UseAuthPanelOptions {
4
- authHost: AuthPanelHost | undefined;
5
- stateRef: {
6
- current: State;
7
- };
8
- dispatch: React.Dispatch<Action>;
9
- /**
10
- * Live `state.authPanel.open` — when the panel closes from OUTSIDE the
11
- * controller (another panel's `closePanels`, an F-key toggle, Ctrl+C),
12
- * any in-flight flow must be aborted so an invisible prompt can't leave
13
- * an OAuth loopback server (or a pending readline promise) running
14
- * behind a closed panel.
15
- */
16
- open: boolean;
17
- }
18
- export interface AuthPanelController {
19
- /** Open the panel (used by `/auth` via the panel bridge). No-op without a host. */
20
- openAuthPanel: (view?: 'list' | 'oauth') => boolean;
21
- onAuthEnter: () => void;
22
- onAuthBack: () => void;
23
- onAuthShortcut: (input: string) => void;
24
- onAuthPromptSubmit: () => void;
25
- onAuthPromptCancel: () => void;
26
- onAuthConfirm: (yes: boolean) => void;
27
- onAuthFlowCancel: () => void;
28
- /**
29
- * Ctrl+C while the panel is open. In raw-mode terminals (ConPTY, most
30
- * Windows setups) Ctrl+C arrives as key DATA — not a SIGINT — so the
31
- * key router must handle it; the app's SIGINT ladder covers the
32
- * console-event delivery path. Both paths abort any in-flight flow and
33
- * close the panel.
34
- */
35
- onAuthCtrlC: () => void;
36
- /** Open the existing masked modal for a slash-command secret prompt. */
37
- readSecret: (label: string) => Promise<string>;
38
- /** Open the same modal with visible text for slash-command selections. */
39
- readText: (label: string) => Promise<string>;
40
- }
1
+ import type { AuthPanelController, UseAuthPanelOptions } from './auth-panel-support.js';
2
+ export type { AuthPanelController } from './auth-panel-support.js';
41
3
  export declare function useAuthPanel(opts: UseAuthPanelOptions): AuthPanelController;
42
- export {};
43
4
  //# sourceMappingURL=use-auth-panel.d.ts.map
@@ -0,0 +1,8 @@
1
+ import type { KeyEvent } from '../components/input.js';
2
+ import type { PickerKeysHost } from './use-picker-keys-types.js';
3
+ /**
4
+ * Keys for the navigation pickers — project, sessions panel, slash, F-key and
5
+ * the general picker. Tried last, after every tools/settings picker.
6
+ */
7
+ export declare function tryNavigationPickerKeys(host: PickerKeysHost, input: string, key: KeyEvent, isEnter: boolean, debouncedEnter: (host: PickerKeysHost) => boolean): boolean;
8
+ //# sourceMappingURL=use-picker-keys-navigation.d.ts.map