@wrongstack/tui 1.0.36 → 1.1.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 (33) hide show
  1. package/dist/app-action-services.d.ts +3 -0
  2. package/dist/app-action-settings.d.ts +2 -0
  3. package/dist/app-panel-state.d.ts +5 -0
  4. package/dist/app-settings-props.d.ts +5 -0
  5. package/dist/app-settings-type.d.ts +4 -0
  6. package/dist/browser-access-hint.d.ts +4 -0
  7. package/dist/components/context-panel-residency.d.ts +8 -0
  8. package/dist/components/context-panel-sections.d.ts +3 -2
  9. package/dist/components/context-panel-types.d.ts +13 -1
  10. package/dist/components/mcp-picker.d.ts +6 -1
  11. package/dist/components/settings-picker-constants.d.ts +8 -1
  12. package/dist/components/settings-picker-props.d.ts +4 -0
  13. package/dist/components/settings-picker.d.ts +1 -1
  14. package/dist/components/sidebar-panels-workspace.d.ts +3 -3
  15. package/dist/components/status-bar-rails-common.d.ts +3 -0
  16. package/dist/controller-props.d.ts +5 -0
  17. package/dist/history-archive.d.ts +3 -0
  18. package/dist/hooks/use-app-pipeline-builders.d.ts +1 -0
  19. package/dist/hooks/use-panel-controllers.d.ts +3 -1
  20. package/dist/hooks/use-picker-keys-types.d.ts +1 -0
  21. package/dist/hooks/use-statusbar-view-model.d.ts +5 -1
  22. package/dist/index.js +3888 -3355
  23. package/dist/input-validation/action-types.d.ts +1 -1
  24. package/dist/key-handler-context.d.ts +7 -1
  25. package/dist/reducers/panel-pickers.d.ts +1 -1
  26. package/dist/run-tui-options.d.ts +5 -0
  27. package/dist/settings-contracts.d.ts +4 -0
  28. package/dist/ui-contracts.d.ts +14 -2
  29. package/dist/use-app-controller.d.ts +2 -0
  30. package/dist/use-controller-commands.d.ts +1 -0
  31. package/dist/use-controller-key-pipeline.d.ts +6 -1
  32. package/package.json +18 -18
  33. package/LICENSE +0 -21
@@ -124,6 +124,9 @@ export type AppActionServices = {
124
124
  } | {
125
125
  type: 'mcpPickerHint';
126
126
  text?: string | undefined;
127
+ } | {
128
+ type: 'mcpPickerEditor';
129
+ editor?: import('./ui-contracts.js').McpPickerEditor | undefined;
127
130
  } | {
128
131
  type: 'toolsPickerOpen';
129
132
  items?: ToolPickerItem[] | undefined;
@@ -130,6 +130,8 @@ export type AppActionSettings = {
130
130
  sageMemoryInjectThreshold: number;
131
131
  nextStepsTool: boolean;
132
132
  nextStepsRequired: boolean;
133
+ rememberStartupChoices: boolean;
134
+ nextSystemPromptVariant: 'lite' | 'default' | 'pro' | 'scout';
133
135
  /**
134
136
  * WrongProxy / WrongTrace: master switch + configurable URL
135
137
  * (default http://localhost:3444). Mirrors `Settings.wrongProxy*`
@@ -275,6 +275,10 @@ export type PanelState = {
275
275
  nextStepsTool: boolean;
276
276
  /** Leader must end every finished turn with <nextsteps> or the completion marker (`autonomy.nextSteps: 'required'`). Default: true. */
277
277
  nextStepsRequired: boolean;
278
+ /** Launch with the last model, system prompt and mode/YOLO/autonomy instead of asking (`launch.rememberStartupChoices`). Default: true. */
279
+ rememberStartupChoices: boolean;
280
+ /** System prompt the NEXT session starts with (`systemPrompt.variant` in the profile config); the running session keeps its own. */
281
+ nextSystemPromptVariant: 'lite' | 'default' | 'pro' | 'scout';
278
282
  /** When true, read tool includes codebase-index symbols alongside file content. */
279
283
  readSymbols: boolean;
280
284
  /** Prompt cache TTL. */
@@ -367,6 +371,7 @@ export type PanelState = {
367
371
  selected: number;
368
372
  busy: boolean;
369
373
  hint?: string | undefined;
374
+ editor?: import('./ui-contracts.js').McpPickerEditor | undefined;
370
375
  };
371
376
  /** Tool picker — opened by `/tools`. */
372
377
  toolsPicker: {
@@ -45,6 +45,11 @@ export interface TuiSettingsProps {
45
45
  }>) | undefined;
46
46
  /** Load MCP server rows for the interactive MCP picker. */
47
47
  getMcpServers?: (() => McpPickerItem[]) | undefined;
48
+ onMcpManage?: ((action: 'add' | 'edit' | 'remove', input: Pick<McpPickerItem, 'name' | 'transport' | 'command' | 'url' | 'args'>) => Promise<{
49
+ items: McpPickerItem[];
50
+ message?: string | undefined;
51
+ error?: string | undefined;
52
+ }>) | undefined;
48
53
  /** Toggle one MCP server (enable/disable) from the interactive picker. */
49
54
  onMcpToggle?: ((name: string) => Promise<{
50
55
  items: McpPickerItem[];
@@ -100,6 +100,10 @@ export type Settings = {
100
100
  nextStepsTool: boolean;
101
101
  /** Leader must end every finished turn with <nextsteps> or the completion marker (`autonomy.nextSteps: 'required'`). Default: true. */
102
102
  nextStepsRequired: boolean;
103
+ /** Launch with the last model, system prompt and mode/YOLO/autonomy instead of asking (`launch.rememberStartupChoices`). Default: true. */
104
+ rememberStartupChoices: boolean;
105
+ /** System prompt the NEXT session starts with (`systemPrompt.variant` in the profile config); the running session keeps its own. */
106
+ nextSystemPromptVariant: 'lite' | 'default' | 'pro' | 'scout';
103
107
  /** Prompt cache TTL. */
104
108
  cacheTtl: CacheTtl;
105
109
  /** Where to persist settings: 'global' or 'project'. */
@@ -0,0 +1,4 @@
1
+ /** Put browser and HTTP-reader origin guidance outside collapsed tool output. */
2
+ export declare function networkAccessHint(name: string, ok: boolean, output: string | undefined): string | undefined;
3
+ export declare const browserAccessHint: typeof networkAccessHint;
4
+ //# sourceMappingURL=browser-access-hint.d.ts.map
@@ -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;
@@ -1,4 +1,5 @@
1
1
  import type React from 'react';
2
+ import type { McpPickerEditor } from '../ui-contracts.js';
2
3
  export interface McpPickerItem {
3
4
  name: string;
4
5
  enabled: boolean;
@@ -7,6 +8,9 @@ export interface McpPickerItem {
7
8
  description?: string | undefined;
8
9
  toolCount: number;
9
10
  lazy?: boolean | undefined;
11
+ command?: string | undefined;
12
+ url?: string | undefined;
13
+ args?: string[] | undefined;
10
14
  }
11
15
  interface McpPickerProps {
12
16
  maxRows?: number | undefined;
@@ -15,7 +19,8 @@ interface McpPickerProps {
15
19
  selected: number;
16
20
  busy?: boolean | undefined;
17
21
  hint?: string | undefined;
22
+ editor?: McpPickerEditor | undefined;
18
23
  }
19
- export declare function McpPicker({ items, selected, busy, hint, maxRows, columns, }: McpPickerProps): React.ReactElement;
24
+ export declare function McpPicker({ items, selected, busy, hint, maxRows, columns, editor, }: McpPickerProps): React.ReactElement;
20
25
  export {};
21
26
  //# sourceMappingURL=mcp-picker.d.ts.map
@@ -1,5 +1,5 @@
1
1
  import type { ReasoningEffort as CoreReasoningEffort } from '@wrongstack/core/types';
2
- export { TOOL_RESULT_VIEW_MODES, } from '../tool-result-view-mode.js';
2
+ export { TOOL_RESULT_VIEW_MODES } from '../tool-result-view-mode.js';
3
3
  /** Selectable presets for the auto-proceed delay, so the field is fully
4
4
  * keyboard-cyclable (←/→) instead of needing typed numeric input. */
5
5
  export declare const DELAY_PRESETS_MS: number[];
@@ -24,6 +24,13 @@ export declare const REASONING_EFFORTS: readonly ["none", "minimal", "low", "med
24
24
  export type ReasoningEffort = CoreReasoningEffort;
25
25
  export declare const CACHE_TTLS: readonly ['default', '5m', '1h'];
26
26
  export type CacheTtl = (typeof CACHE_TTLS)[number];
27
+ /**
28
+ * System-prompt variants in startup-menu order. Mirrors core
29
+ * `SYSTEM_PROMPT_VARIANT_OPTIONS` (`default` is shown as "Standard").
30
+ */
31
+ export declare const SYSTEM_PROMPT_CHOICES: readonly ['lite', 'default', 'pro', 'scout'];
32
+ export type SystemPromptChoice = (typeof SYSTEM_PROMPT_CHOICES)[number];
33
+ export declare const SYSTEM_PROMPT_CHOICE_LABELS: Record<SystemPromptChoice, string>;
27
34
  export declare const STATUSLINE_MODE_DESCS: Record<StatuslineMode, string>;
28
35
  /** Presets for max iterations — cyclable via ←/→. 0 = unlimited. */
29
36
  export declare const MAX_ITERATIONS_PRESETS: number[];
@@ -77,6 +77,10 @@ export interface SettingsPickerProps {
77
77
  nextStepsTool: boolean;
78
78
  /** Leader must end every finished turn with <nextsteps> or the completion marker (`autonomy.nextSteps: 'required'`). Default: true. */
79
79
  nextStepsRequired: boolean;
80
+ /** Launch with the last model, system prompt and mode/YOLO/autonomy instead of asking (`launch.rememberStartupChoices`). Default: true. */
81
+ rememberStartupChoices: boolean;
82
+ /** System prompt the NEXT session starts with (`systemPrompt.variant` in the profile config); the running session keeps its own. */
83
+ nextSystemPromptVariant: 'lite' | 'default' | 'pro' | 'scout';
80
84
  /** When true, read tool includes codebase-index symbols alongside file content. */
81
85
  readSymbols: boolean;
82
86
  /**
@@ -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, readSymbols, panelPositions, wrongProxyEnabled, wrongProxyUrl, inputHeight, maxRows, columns, hint, onLayoutComputed, }: SettingsPickerProps): React.ReactElement;
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;
7
7
  //# sourceMappingURL=settings-picker.d.ts.map
@@ -4,10 +4,10 @@
4
4
  * path stable for `sidebar-panels.tsx` and tests.
5
5
  */
6
6
  export { AgentsPanelSidebar } from './sidebar-panel-agents.js';
7
- export { ConnectionsPanelSidebar, } from './sidebar-panel-connections.js';
8
- export { CoordinatorPanelSidebar, } from './sidebar-panel-coordinator.js';
7
+ export { ConnectionsPanelSidebar } from './sidebar-panel-connections.js';
8
+ export { CoordinatorPanelSidebar } from './sidebar-panel-coordinator.js';
9
9
  export { FleetPanelSidebar } from './sidebar-panel-fleet.js';
10
10
  export { ProjectPickerSidebar } from './sidebar-panel-project.js';
11
11
  export { WorktreePanelSidebar } from './sidebar-panel-worktree.js';
12
- export { WrongProxyPanelSidebar, } from './sidebar-panel-wrong-proxy.js';
12
+ export { WrongProxyPanelSidebar } from './sidebar-panel-wrong-proxy.js';
13
13
  //# sourceMappingURL=sidebar-panels-workspace.d.ts.map
@@ -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;
@@ -64,6 +64,11 @@ export declare function resolveControllerProps(props: AppProps): {
64
64
  message?: string | undefined;
65
65
  error?: string | undefined;
66
66
  }>) | undefined;
67
+ onMcpManage: ((action: 'add' | 'edit' | 'remove', input: Pick<import("./ui-contracts.js").McpPickerItem, 'name' | 'transport' | 'command' | 'url' | 'args'>) => Promise<{
68
+ items: import("./ui-contracts.js").McpPickerItem[];
69
+ message?: string | undefined;
70
+ error?: string | undefined;
71
+ }>) | undefined;
67
72
  getToolsItems: (() => import("./ui-contracts.js").ToolPickerItem[]) | undefined;
68
73
  onToolToggle: ((name: string) => Promise<{
69
74
  items: import("./ui-contracts.js").ToolPickerItem[];
@@ -24,6 +24,8 @@ export declare class HistoryArchive {
24
24
  private closed;
25
25
  /** Byte-offset index: index → { offset, length }. Built on first load. */
26
26
  private index;
27
+ /** Bumped on every invalidation so an in-flight scan can tell its result is stale. */
28
+ private indexGeneration;
27
29
  /** Total entries written so far (monotonic counter). */
28
30
  private writeChain;
29
31
  private drainToken;
@@ -58,6 +60,7 @@ export declare class HistoryArchive {
58
60
  * The index is cached for the lifetime of the archive object.
59
61
  */
60
62
  private buildIndex;
63
+ private scanIndex;
61
64
  /** Serialise writes through a FIFO promise chain with per-drain batching. */
62
65
  private enqueueWrite;
63
66
  }
@@ -61,6 +61,7 @@ export declare function buildAppPipelineArgs(params: {
61
61
  pasteClipboardText: K['pasteClipboardText'];
62
62
  pasteClipboardImage: K['pasteClipboardImage'];
63
63
  onHistoryCopy: K['onHistoryCopy'];
64
+ closeMailboxPanel: K['closeMailboxPanel'];
64
65
  tryPickerKey: K['tryPickerKey'];
65
66
  pasteAccumRef: K['pasteAccumRef'];
66
67
  pasteFlushTimerRef: K['pasteFlushTimerRef'];
@@ -24,6 +24,7 @@ interface PanelControllersOptions {
24
24
  getMcpServers: AppProps['getMcpServers'];
25
25
  onMcpToggle: AppProps['onMcpToggle'];
26
26
  onMcpRestart: AppProps['onMcpRestart'];
27
+ onMcpManage?: AppProps['onMcpManage'];
27
28
  getToolsItems: AppProps['getToolsItems'];
28
29
  onToolToggle: AppProps['onToolToggle'];
29
30
  setLiveToolCount: Dispatch<SetStateAction<number | undefined>>;
@@ -31,7 +32,7 @@ interface PanelControllersOptions {
31
32
  getActiveModelReasoningEffortLevels?: AppProps['getActiveModelReasoningEffortLevels'];
32
33
  }
33
34
  /** Owns panel openers and extension picker refresh/toggle controllers. */
34
- export declare function usePanelControllers({ state, stateRef, dispatch, getPickableProviders, getProjectPickerItems, getLiveSessions, onPanelOpen, openStatuslinePicker, openAuthPanel, openModePicker, openBrainPanel, openShadowPanel, openSubagentModelsPanel, openHelpPanel, getSettings, getPluginItems, onPluginToggle, getMcpServers, onMcpToggle, onMcpRestart, getToolsItems, onToolToggle, setLiveToolCount, getActiveModelReasoningEffortLevels, }: PanelControllersOptions): {
35
+ export declare function usePanelControllers({ state, stateRef, dispatch, getPickableProviders, getProjectPickerItems, getLiveSessions, onPanelOpen, openStatuslinePicker, openAuthPanel, openModePicker, openBrainPanel, openShadowPanel, openSubagentModelsPanel, openHelpPanel, getSettings, getPluginItems, onPluginToggle, getMcpServers, onMcpToggle, onMcpRestart, onMcpManage, getToolsItems, onToolToggle, setLiveToolCount, getActiveModelReasoningEffortLevels, }: PanelControllersOptions): {
35
36
  openModelPicker: () => Promise<void>;
36
37
  openProjectPicker: () => Promise<void>;
37
38
  openFKeyPicker: () => void;
@@ -40,6 +41,7 @@ export declare function usePanelControllers({ state, stateRef, dispatch, getPick
40
41
  toggleSelectedPlugin: () => Promise<void>;
41
42
  toggleSelectedMcpServer: () => Promise<void>;
42
43
  restartSelectedMcpServer: () => Promise<void>;
44
+ saveMcpEditor: () => Promise<void>;
43
45
  toggleSelectedTool: () => Promise<void>;
44
46
  };
45
47
  export {};
@@ -49,6 +49,7 @@ export interface PickerKeysHost {
49
49
  onPluginPickerToggle: (() => Promise<void> | void) | undefined;
50
50
  onMcpPickerToggle: (() => Promise<void> | void) | undefined;
51
51
  onMcpPickerRestart: (() => Promise<void> | void) | undefined;
52
+ onMcpPickerSave?: (() => Promise<void> | void) | undefined;
52
53
  onToolsPickerToggle: (() => Promise<void> | void) | undefined;
53
54
  onHelpPanelEnter: (() => void) | undefined;
54
55
  onBrainRiskChange: ((delta: number) => void) | 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;