@wrongstack/tui 0.309.1 → 0.310.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -328,6 +328,16 @@ export type Action = {
328
328
  showSageMemoryInject: boolean;
329
329
  sageMemoryInjectThreshold: number;
330
330
  nextStepsTool: boolean;
331
+ /**
332
+ * WrongProxy / WrongTrace: master switch + configurable URL
333
+ * (default http://localhost:8000). Mirrors `Settings.wrongProxy*`
334
+ * and `SettingsPickerPatch.wrongProxy*`. Both fields land in
335
+ * the Integrations section of the picker; the runtime probe
336
+ * reads the values via the TUI settings adapter (see
337
+ * `packages/cli/boot/tui-settings-adapter.ts`).
338
+ */
339
+ wrongProxyEnabled: boolean;
340
+ wrongProxyUrl: string;
331
341
  } | {
332
342
  type: 'settingsClose';
333
343
  } | {
@@ -378,6 +388,23 @@ export type Action = {
378
388
  /** Discard the draft and leave edit mode without changing the word. */
379
389
  | {
380
390
  type: 'settingsThinkingEditCancel';
391
+ }
392
+ /** Begin free-text editing of the WrongProxy URL (Enter on its row). */
393
+ | {
394
+ type: 'settingsWrongProxyUrlEditStart';
395
+ }
396
+ /** Replace the in-progress WrongProxy URL draft with the given buffer. */
397
+ | {
398
+ type: 'settingsWrongProxyUrlEditChange';
399
+ draft: string;
400
+ }
401
+ /** Commit the draft as the new WrongProxy URL (validated in the reducer). */
402
+ | {
403
+ type: 'settingsWrongProxyUrlEditCommit';
404
+ }
405
+ /** Discard the draft and leave edit mode without changing the URL. */
406
+ | {
407
+ type: 'settingsWrongProxyUrlEditCancel';
381
408
  } | {
382
409
  type: 'statuslineOpen';
383
410
  hiddenItems: StatuslineItem[];
@@ -110,5 +110,17 @@ export type Settings = {
110
110
  breakerEnabled?: boolean | undefined;
111
111
  /** Auto kill/reset delay (ms) when the breaker trips. 0 = manual recovery. */
112
112
  breakerAutoKillResetMs?: number | undefined;
113
+ /**
114
+ * WrongProxy / WrongTrace: master switch. When true AND the daemon at
115
+ * `wrongProxyUrl` is reachable, every provider's base URL is rewritten
116
+ * through `${wrongProxyUrl}/proxy/<host><path>`. openai-codex is
117
+ * excluded by spec. Mirrors `SettingsPickerPatch.wrongProxyEnabled`.
118
+ */
119
+ wrongProxyEnabled?: boolean | undefined;
120
+ /**
121
+ * WrongProxy / WrongTrace URL. Default `http://localhost:8000`. Mirrors
122
+ * `SettingsPickerPatch.wrongProxyUrl`.
123
+ */
124
+ wrongProxyUrl?: string | undefined;
113
125
  };
114
126
  //# sourceMappingURL=app-settings-type.d.ts.map
@@ -327,6 +327,24 @@ export type State = {
327
327
  * `CYCLE_INTERVAL_SECONDS`. Persisted on every ←/→ change in `/settings`.
328
328
  */
329
329
  animationStyle: 'rainbow' | 'wave' | 'pulse' | 'dots' | 'breathe' | 'cycle';
330
+ /**
331
+ * WrongProxy / WrongTrace: master switch. When true AND the daemon at
332
+ * `wrongProxyUrl` is reachable, every provider's base URL is rewritten
333
+ * through `${wrongProxyUrl}/proxy/<host><path>`. openai-codex is
334
+ * excluded by spec. Mirrors `Settings.wrongProxyEnabled` and the
335
+ * `tools.wrongProxy.enabled` config key. Picker field 59.
336
+ */
337
+ wrongProxyEnabled: boolean;
338
+ /**
339
+ * WrongProxy / WrongTrace URL. Default `http://localhost:8000`. The
340
+ * CLI's periodic probe targets `<wrongProxyUrl>/api/health`; a 2xx
341
+ * response flips the runtime's `active` flag. Picker field 60.
342
+ */
343
+ wrongProxyUrl: string;
344
+ /** True while free-text editing the WrongProxy URL (Enter on its row). */
345
+ wrongProxyUrlEditing: boolean;
346
+ /** In-progress text buffer while `wrongProxyUrlEditing`. */
347
+ wrongProxyUrlDraft: string;
330
348
  /** Whether the process circuit breaker gates bash/exec. */
331
349
  breakerEnabled: boolean;
332
350
  /** Auto kill/reset delay (ms) when the breaker trips. 0 = manual recovery. */
@@ -1,7 +1,7 @@
1
1
  import type React from 'react';
2
2
  import type { AppViewProps } from './app-view-contract.js';
3
3
  import type { usePlanPanelData } from './components/plan-panel.js';
4
- import type { useSidebarConnections, useSidebarKanban, useSidebarProcessList } from './hooks/use-sidebar-panel-data.js';
4
+ import type { useSidebarConnections, useSidebarKanban, useSidebarProcessList, useSidebarWrongProxy } from './hooks/use-sidebar-panel-data.js';
5
5
  import type { PanelId } from './ui-contracts.js';
6
6
  export interface AppViewSidebarProps {
7
7
  host: AppViewProps['host'];
@@ -14,6 +14,14 @@ export interface AppViewSidebarProps {
14
14
  sidebarConnectionsData: ReturnType<typeof useSidebarConnections>;
15
15
  sidebarKanbanData: ReturnType<typeof useSidebarKanban>;
16
16
  sidebarPlanData: ReturnType<typeof usePlanPanelData>;
17
+ /** Master switch from `liveSettings?.wrongProxyEnabled`. The WrongProxy
18
+ * sidebar panel renders only while this is true; when false the entire
19
+ * panel returns `null` so it doesn't take a slot in `SIDEBAR_PANEL_LIMIT`
20
+ * or burn IPC probes. */
21
+ sidebarWrongProxyEnabled: boolean;
22
+ /** Live probe data from `useSidebarWrongProxy`. `null` while the panel
23
+ * is bootstrapping or the daemon URL hasn't produced a response yet. */
24
+ sidebarWrongProxyData: ReturnType<typeof useSidebarWrongProxy>;
17
25
  }
18
- export declare function AppViewSidebar({ host, runtime, sidebarWidth, sidebarContentWidth, sidebarSlotVisible, hiddenSidebarPanelCount, sidebarProcessData, sidebarConnectionsData, sidebarKanbanData, sidebarPlanData, }: AppViewSidebarProps): React.ReactElement | null;
26
+ export declare function AppViewSidebar({ host, runtime, sidebarWidth, sidebarContentWidth, sidebarSlotVisible, hiddenSidebarPanelCount, sidebarProcessData, sidebarConnectionsData, sidebarKanbanData, sidebarPlanData, sidebarWrongProxyEnabled, sidebarWrongProxyData, }: AppViewSidebarProps): React.ReactElement | null;
19
27
  //# sourceMappingURL=app-view-sidebar.d.ts.map
@@ -14,10 +14,19 @@ export interface ContextPanelData {
14
14
  * Surfaced in the panel so `/context` answers "how much of my spend
15
15
  * is hitting the cache" without asking the user to chase the CLI
16
16
  * `/context cache` subcommand.
17
+ *
18
+ * `savedUsd` is the gross read-discount USD figure computed by the
19
+ * counter (cache-read tokens × (input price − cache-read price)).
20
+ * `cacheWrite5m` / `cacheWrite1h` are present when the upstream exposed
21
+ * an Anthropic-style TTL split (Anthropic family, including MiniMax
22
+ * routed through the Anthropic Messages surface); OpenAI-family
23
+ * gateways emit only the aggregate and leave them undefined.
17
24
  */
18
25
  cacheStats?: {
19
26
  readTokens: number;
20
27
  writeTokens: number;
28
+ cacheWrite5m?: number | undefined;
29
+ cacheWrite1h?: number | undefined;
21
30
  hitRatio: number;
22
31
  savedUsd: number;
23
32
  } | undefined;
@@ -27,6 +36,16 @@ export interface ContextPanelData {
27
36
  * exact extent of the cache, not just a percentage.
28
37
  */
29
38
  cacheCoverageTokens?: number | undefined;
39
+ /** Session cache telemetry split by provider, including fallback/model switches. */
40
+ providerCacheStats?: Array<{
41
+ provider: string;
42
+ input: number;
43
+ cacheRead: number;
44
+ cacheWrite: number;
45
+ cacheWrite5m?: number | undefined;
46
+ cacheWrite1h?: number | undefined;
47
+ hitRatio: number;
48
+ }> | undefined;
30
49
  /**
31
50
  * Real, measured per-category token accounting for the live request. When
32
51
  * present the Composition tab shows honest numbers; when absent (no request
@@ -101,6 +101,14 @@ export declare const SETTINGS_FIELD_COUNT: number;
101
101
  * definitions to keep the three in sync. If the row order changes, update this.
102
102
  */
103
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;
104
112
  /**
105
113
  * Field index of the "Multi-diff summary" row. Same rationale as
106
114
  * {@link THINKING_WORD_FIELD}: the keyboard handler in app.tsx dispatches
@@ -83,6 +83,22 @@ export interface SettingsPickerProps {
83
83
  * per PanelId in PANEL_IDS order; each row cycles 'bottom' ↔ 'sidebar'.
84
84
  */
85
85
  panelPositions: import('../ui-contracts.js').PanelPositionMap;
86
+ /**
87
+ * WrongProxy / WrongTrace: master switch. When true AND the daemon at
88
+ * `wrongProxyUrl` is reachable, every provider's base URL is rewritten
89
+ * through `${wrongProxyUrl}/proxy/<host><path>`. openai-codex is
90
+ * excluded by spec. Toggled on the row at field index 59.
91
+ */
92
+ wrongProxyEnabled: boolean;
93
+ /**
94
+ * WrongProxy / WrongTrace URL. Default `http://localhost:8000`. Text
95
+ * field (Enter on the row opens an inline edit). Picker field 60.
96
+ */
97
+ wrongProxyUrl: string;
98
+ /** True while free-text editing the WrongProxy URL (Enter on its row). */
99
+ wrongProxyUrlEditing: boolean;
100
+ /** In-progress text buffer while `wrongProxyUrlEditing`. */
101
+ wrongProxyUrlDraft: string;
86
102
  /** Raw SSE stream debugging toggle — hex-dump every byte received from providers. */
87
103
  debugStream: boolean;
88
104
  /** Statusline density: minimum single-line or detailed multi-line. */
@@ -117,5 +133,5 @@ export interface SettingsPickerProps {
117
133
  fieldRowIndex: readonly number[];
118
134
  }) => void) | undefined;
119
135
  }
120
- export declare function SettingsPicker({ field, filter, mode, delayMs, titleAnimation, yolo, fleetChat, chime, confirmExit, nextPrediction, featureMcp, featurePlugins, featureMemory, featureSkills, featureModelsRegistry, tokenSavingTier, allowOutsideProjectRoot, maxIterations, autoProceedMaxIterations, enhanceDelayMs, enhanceEnabled, enhanceLanguage, preRefineSeconds, indexOnStart, multiDiffSummaryThreshold, thinkingWord, thinkingWordEditing, thinkingWordDraft, reasoningMode, reasoningEffort, reasoningPreserve, cacheTtl, contextAutoCompact, contextStrategy, contextMode, maxConcurrent, logLevel, auditLevel, debugStream, statuslineMode, configScope, profileConfigPath, animationStyle, breakerEnabled, breakerAutoKillResetMs, showModelReasoning, showAgentSwarmPanel, showSageMemoryInject, sageMemoryInjectThreshold, nextStepsTool, readSymbols, panelPositions, inputHeight, hint, onLayoutComputed, }: SettingsPickerProps): React.ReactElement;
136
+ export declare function SettingsPicker({ field, filter, mode, delayMs, titleAnimation, yolo, fleetChat, chime, confirmExit, nextPrediction, featureMcp, featurePlugins, featureMemory, featureSkills, featureModelsRegistry, tokenSavingTier, allowOutsideProjectRoot, maxIterations, autoProceedMaxIterations, enhanceDelayMs, enhanceEnabled, enhanceLanguage, preRefineSeconds, indexOnStart, multiDiffSummaryThreshold, thinkingWord, thinkingWordEditing, thinkingWordDraft, wrongProxyUrlEditing, wrongProxyUrlDraft, reasoningMode, reasoningEffort, reasoningPreserve, cacheTtl, contextAutoCompact, contextStrategy, contextMode, maxConcurrent, logLevel, auditLevel, debugStream, statuslineMode, configScope, profileConfigPath, animationStyle, breakerEnabled, breakerAutoKillResetMs, showModelReasoning, showAgentSwarmPanel, showSageMemoryInject, sageMemoryInjectThreshold, nextStepsTool, readSymbols, panelPositions, wrongProxyEnabled, wrongProxyUrl, inputHeight, hint, onLayoutComputed, }: SettingsPickerProps): React.ReactElement;
121
137
  //# sourceMappingURL=settings-picker.d.ts.map
@@ -114,7 +114,7 @@ export declare function isCurrentSession(rowId: string | undefined, currentSessi
114
114
  * the routed F-key panel twins (`sidebar-panel-frame.tsx` +
115
115
  * `sidebar-panels-{workspace,task}.tsx`). Imported at the top of this file
116
116
  * for the `MODEL CORE`, `PROMPT CACHE`, `SYSTEM`, `AGENT SWARM`, `MISSIONS`,
117
- * `SESSIONS`, and `TOOL TICKER` cards — the migration keeps the persistent
117
+ * and `SESSIONS` cards — the migration keeps the persistent
118
118
  * call sites identical because the shared component preserves the same
119
119
  * `innerWidth` / `marginBottom` / `accent` / `children` contract.
120
120
  */
@@ -1,5 +1,6 @@
1
1
  import type React from 'react';
2
2
  import type { FleetEntry } from '../app-state.js';
3
+ import type { SidebarWrongProxy } from '../hooks/use-sidebar-panel-data.js';
3
4
  import { type WorktreeRow } from '../ui-contracts.js';
4
5
  import type { ProjectPickerItem } from './project-picker.js';
5
6
  export interface ProjectPickerSidebarProps {
@@ -47,4 +48,26 @@ export interface ConnectionsPanelSidebarProps {
47
48
  width: number;
48
49
  }
49
50
  export declare function ConnectionsPanelSidebar({ connections, width, }: ConnectionsPanelSidebarProps): React.ReactElement;
51
+ export interface WrongProxyPanelSidebarProps {
52
+ /**
53
+ * Live probe state. When `null` (URL missing or probe disabled) the
54
+ * panel renders an idle placeholder inside the same frame so the
55
+ * layout never jumps when the toggle flips on mid-session.
56
+ */
57
+ proxy: SidebarWrongProxy | null;
58
+ width: number;
59
+ }
60
+ /**
61
+ * Sidebar twin for the live WrongProxy / WrongTrace daemon. Renders
62
+ * the proxy URL, a status pill (LIVE / WARN / DOWN / ?), the round-trip
63
+ * latency when known, and a brief footer hint mirroring the WebUI copy
64
+ * about openai-codex being excluded by spec.
65
+ *
66
+ * The panel is mounted only when `wrongProxyEnabled` is true at the
67
+ * `app-view-sidebar.tsx` gate — see the `wrongProxyEnabled` usage there.
68
+ * This component still defensively renders an empty-state when
69
+ * `proxy === null` so a mount/unmount race during a toggle flip does
70
+ * not flash an inconsistent card.
71
+ */
72
+ export declare function WrongProxyPanelSidebar({ proxy, width, }: WrongProxyPanelSidebarProps): React.ReactElement;
50
73
  //# sourceMappingURL=sidebar-panels-workspace.d.ts.map
@@ -1,4 +1,4 @@
1
1
  export { EmptyState, fleetStatusVisual, fmtRelative, fmtShortDuration, liveSessionColor, liveSessionGlyph, SidebarWorklistRow, } from './sidebar-panels-shared.js';
2
2
  export { GoalPanelSidebar, type GoalPanelSidebarProps, KanbanPanelSidebar, type KanbanPanelSidebarProps, PlanPanelSidebar, type PlanPanelSidebarProps, ProcessListPanelSidebar, type ProcessListPanelSidebarProps, QueuePanelSidebar, type QueuePanelSidebarProps, SessionsPanelSidebar, type SessionsPanelSidebarProps, TodosPanelSidebar, type TodosPanelSidebarProps, } from './sidebar-panels-task.js';
3
- export { AgentsPanelSidebar, type AgentsPanelSidebarProps, ConnectionsPanelSidebar, type ConnectionsPanelSidebarProps, CoordinatorPanelSidebar, type CoordinatorPanelSidebarProps, FleetPanelSidebar, type FleetPanelSidebarProps, ProjectPickerSidebar, type ProjectPickerSidebarProps, WorktreePanelSidebar, type WorktreePanelSidebarProps, } from './sidebar-panels-workspace.js';
3
+ export { AgentsPanelSidebar, type AgentsPanelSidebarProps, ConnectionsPanelSidebar, type ConnectionsPanelSidebarProps, CoordinatorPanelSidebar, type CoordinatorPanelSidebarProps, FleetPanelSidebar, type FleetPanelSidebarProps, ProjectPickerSidebar, type ProjectPickerSidebarProps, WorktreePanelSidebar, type WorktreePanelSidebarProps, WrongProxyPanelSidebar, type WrongProxyPanelSidebarProps, } from './sidebar-panels-workspace.js';
4
4
  //# sourceMappingURL=sidebar-panels.d.ts.map
@@ -29,6 +29,12 @@ export interface StatusBarRailBuildParams {
29
29
  } | undefined;
30
30
  cache?: {
31
31
  hitRatio: number;
32
+ readTokens: number;
33
+ writeTokens: number;
34
+ savedUsd: number;
35
+ /** 5-min / 1-hour cache-write split; present for Anthropic-family providers. */
36
+ cacheWrite5m?: number | undefined;
37
+ cacheWrite1h?: number | undefined;
32
38
  } | undefined;
33
39
  queueCount?: number | undefined;
34
40
  hint?: string | undefined;
@@ -42,6 +42,35 @@ export interface SidebarConnection {
42
42
  * into the sidebar's 4-state enum so the sidebar twin stays simple.
43
43
  */
44
44
  export declare function useSidebarConnections(projectRoot: string, enabled?: boolean): readonly SidebarConnection[];
45
+ /**
46
+ * Status returned by the WrongProxy sidebar twin. Mirrors the
47
+ * 4-state shape used by `useSidebarConnections` so the sidebar frame's
48
+ * pill / glyph / row coloring stay uniform across panels.
49
+ */
50
+ export type SidebarWrongProxyStatus = 'ok' | 'warn' | 'down' | 'unknown';
51
+ export interface SidebarWrongProxy {
52
+ url: string;
53
+ status: SidebarWrongProxyStatus;
54
+ latencyMs?: number | undefined;
55
+ detail?: string | undefined;
56
+ }
57
+ /**
58
+ * Probe the WrongProxy daemon. Refreshes every 8 seconds while
59
+ * `enabled` is true; returns `null` when `enabled` is false so the
60
+ * sidebar twin (and its slot reservation) stop participating in the
61
+ * `SIDEBAR_PANEL_LIMIT` race — the panel is then rendered as `null`
62
+ * by `app-view-sidebar.tsx`. The probe hits `<base>/api/health`, the
63
+ * canonical endpoint shared with the runtime probe in
64
+ * `packages/cli/src/wiring/proxy-probe.ts`; we deliberately do NOT
65
+ * share the runtime probe's mutable `active` flag because the sidebar
66
+ * twin needs its own observable state (latency, error detail) to
67
+ * paint a useful panel — the runtime probe only flips a boolean.
68
+ *
69
+ * Errors stay silent: failures populate `status: 'down'` so the card
70
+ * shows "unreachable" without spamming the console, matching the
71
+ * no-throw contract used by every other sidebar probe.
72
+ */
73
+ export declare function useSidebarWrongProxy(url: string | undefined, enabled?: boolean): SidebarWrongProxy | null;
45
74
  export interface SidebarKanbanColumn {
46
75
  name: string;
47
76
  count: number;