@wrongstack/tui 0.319.0 → 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 (86) 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/help-panel.d.ts +1 -1
  13. package/dist/components/history/entry-helpers.d.ts +5 -0
  14. package/dist/components/history/index.d.ts +2 -2
  15. package/dist/components/history/scroll-controller-types.d.ts +1 -1
  16. package/dist/components/history/types.d.ts +1 -1
  17. package/dist/components/history/utils.d.ts +2 -2
  18. package/dist/components/history.d.ts +1 -1
  19. package/dist/components/mode-picker.d.ts +1 -1
  20. package/dist/components/powerline-rail.d.ts +46 -8
  21. package/dist/components/settings-picker-constants.d.ts +73 -0
  22. package/dist/components/settings-picker-model.d.ts +2 -192
  23. package/dist/components/settings-picker-resolver.d.ts +27 -0
  24. package/dist/components/shadow-panel.d.ts +1 -1
  25. package/dist/components/status-bar-chips.d.ts +1 -1
  26. package/dist/components/status-bar-format.d.ts +8 -1
  27. package/dist/components/status-bar-icons.d.ts +7 -1
  28. package/dist/components/status-bar-rails-async.d.ts +9 -0
  29. package/dist/components/status-bar-rails-common.d.ts +117 -0
  30. package/dist/components/status-bar-rails-safety.d.ts +9 -0
  31. package/dist/components/status-bar-rails.d.ts +16 -103
  32. package/dist/components/status-bar-types.d.ts +24 -5
  33. package/dist/components/status-bar.d.ts +18 -16
  34. package/dist/components/status-line-registry.d.ts +11 -13
  35. package/dist/components/statusline-picker.d.ts +48 -15
  36. package/dist/history-archive.d.ts +3 -1
  37. package/dist/history-entry.d.ts +18 -0
  38. package/dist/hooks/use-app-event-bridges.d.ts +22 -43
  39. package/dist/hooks/use-app-panels-state.d.ts +30 -12
  40. package/dist/hooks/use-app-pipeline-builders.d.ts +5 -0
  41. package/dist/hooks/use-bug-hunt-loop.d.ts +9 -0
  42. package/dist/hooks/use-history-auto-scroll.d.ts +13 -0
  43. package/dist/hooks/use-history-viewport-sync.d.ts +2 -2
  44. package/dist/hooks/use-mode-picker.d.ts +1 -1
  45. package/dist/hooks/use-statusline-hidden-sync.d.ts +29 -0
  46. package/dist/hooks/use-statusline-state.d.ts +5 -1
  47. package/dist/hooks/use-tui-environment-state.d.ts +4 -2
  48. package/dist/index.d.ts +1 -1
  49. package/dist/index.js +6698 -5035
  50. package/dist/input-validation/action-types.d.ts +1 -1
  51. package/dist/input-validation.d.ts +3 -3
  52. package/dist/reducers/dialogs.d.ts +1 -1
  53. package/dist/reducers/panel-pickers.d.ts +1 -1
  54. package/dist/run-tui-options.d.ts +5 -1
  55. package/dist/submit-controller.d.ts +2 -0
  56. package/dist/theme-presets/accessible.d.ts +66 -0
  57. package/dist/theme-presets/atom.d.ts +97 -0
  58. package/dist/theme-presets/ayu.d.ts +66 -0
  59. package/dist/theme-presets/base.d.ts +3 -0
  60. package/dist/theme-presets/catppuccin.d.ts +97 -0
  61. package/dist/theme-presets/everforest.d.ts +66 -0
  62. package/dist/theme-presets/flexoki.d.ts +35 -0
  63. package/dist/theme-presets/github.d.ts +99 -0
  64. package/dist/theme-presets/gruvbox.d.ts +97 -0
  65. package/dist/theme-presets/japanese.d.ts +35 -0
  66. package/dist/theme-presets/material.d.ts +66 -0
  67. package/dist/theme-presets/misc-1.d.ts +254 -0
  68. package/dist/theme-presets/misc-2.d.ts +256 -0
  69. package/dist/theme-presets/misc-3.d.ts +252 -0
  70. package/dist/theme-presets/mono-crt.d.ts +66 -0
  71. package/dist/theme-presets/mono.d.ts +128 -0
  72. package/dist/theme-presets/monokai.d.ts +68 -0
  73. package/dist/theme-presets/nightfox.d.ts +35 -0
  74. package/dist/theme-presets/options.d.ts +4 -0
  75. package/dist/theme-presets/rose-pine.d.ts +66 -0
  76. package/dist/theme-presets/synthwave.d.ts +68 -0
  77. package/dist/theme-presets/tokyo-night.d.ts +97 -0
  78. package/dist/theme-presets/vitesse.d.ts +66 -0
  79. package/dist/theme-presets.d.ts +17 -4
  80. package/dist/tui-host-capabilities.d.ts +4 -0
  81. package/dist/ui-contracts.d.ts +1 -1
  82. package/package.json +7 -7
  83. package/dist/components/key-hint-bar.d.ts +0 -42
  84. package/dist/components/live-activity-strip.d.ts +0 -40
  85. package/dist/components/memory-context-widget.d.ts +0 -5
  86. package/dist/components/statusline-detail-panel.d.ts +0 -10
@@ -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';
4
- export { chipColor, SPINNER_INTERVAL_MS, STACK_ORANGE, STATUSLINE_ICONS } from './status-bar-icons.js';
3
+ export { contextBarColor, fmtElapsed, hasTokenDisplay, nodeText, renderMeter, renderProgress, shortenPath, stateChip, type TokenDisplayTotals, tokenDisplayTotals, truncateChip, } from './status-bar-format.js';
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
@@ -12,8 +12,8 @@ import { type StatusBarRailBuildParams } from './status-bar-rails.js';
12
12
  * canonical chip key, applies the user's per-chip line assignment
13
13
  * (`StatuslineLines`), and places the right-anchored chips (version, index)
14
14
  * on their assigned line. With default lines the partition is byte-identical
15
- * to the pre-registry four-rail composition, which the
16
- * `status-bar-rail-order` / `status-bar-separators` suites pin.
15
+ * to the builders' own grouping, which the `status-bar-rail-order` /
16
+ * `status-bar-separators` suites pin.
17
17
  */
18
18
  /** A rail (physical status bar line) in the detailed layout: left chips in
19
19
  * render order plus an optional right-anchored chip. */
@@ -22,14 +22,8 @@ export interface DetailedRail {
22
22
  rightAnchor: React.ReactElement | null;
23
23
  }
24
24
  /**
25
- * Map a rail entry id to its canonical statusline chip key.
26
- *
27
- * Composite and detail spans carry synthetic ids that travel with their
28
- * parent chip: `primary-0` is the ctx·tokens·cost·cache telemetry composite
29
- * (key `context`), `detail-N` are the mailbox peer/detail chips (key
30
- * `mailbox`), and `memory-N` are the memory-context group (key
31
- * `memory_context`). Returns null for ids outside the contract — those fall
32
- * back to their builder's default line.
25
+ * Map a rail entry id to its canonical statusline chip key. Returns null for
26
+ * ids outside the contract — those fall back to their builder's default line.
33
27
  */
34
28
  export declare function canonicalChipKey(entryId: string): StatuslineItem | null;
35
29
  /** One builder's output plus the line its unmapped ids fall back to. */
@@ -45,6 +39,9 @@ export declare function partitionRailEntries(sources: readonly RailSource[], lin
45
39
  export interface DetailedRailBuildOptions {
46
40
  /** Pre-built provider/model chip (status-bar.tsx owns its dim-provider styling). */
47
41
  modelChip: React.ReactElement | null;
42
+ /** Narrower model renderings for the density fitter (model only, provider dropped). */
43
+ modelShortChip?: React.ReactElement | null;
44
+ modelMicroChip?: React.ReactElement | null;
48
45
  /** `v{version} (update …)` chip, right-anchored on its assigned line. */
49
46
  versionChip: React.ReactElement | null;
50
47
  /** Codebase-index health chip, right-anchored on its assigned line. */
@@ -54,9 +51,10 @@ export interface DetailedRailBuildOptions {
54
51
  }
55
52
  /**
56
53
  * Build the four detailed-mode rails: run the rail builders (which apply
57
- * each chip's data + hidden gates), then partition the surviving entries by
58
- * the user's line assignment. Rails are returned in logical order 1–4;
59
- * rendering/click-map code decides which rails render.
54
+ * each chip's data + hidden gates and attach its density levels), then
55
+ * partition the surviving entries by the user's line assignment. Rails are
56
+ * returned in logical order 1–4; rendering/click-map code decides which
57
+ * rails render.
60
58
  */
61
59
  export declare function buildDetailedRails(p: StatusBarRailBuildParams, opts: DetailedRailBuildOptions): DetailedRail[];
62
60
  //# sourceMappingURL=status-line-registry.d.ts.map
@@ -1,22 +1,25 @@
1
+ import { CHIP_DESCRIPTIONS, DEFAULT_LINES, STATUSLINE_FIELD_COUNT, STATUSLINE_ITEMS, type StatuslineDensities, type StatuslineDensity, type StatuslineItem, type StatuslineLines } from '@wrongstack/core/statusline';
1
2
  import type React from 'react';
2
- import { DEFAULT_LINES, STATUSLINE_FIELD_COUNT, STATUSLINE_ITEMS, type StatuslineItem } from '@wrongstack/core/statusline';
3
- export { DEFAULT_LINES, STATUSLINE_FIELD_COUNT, STATUSLINE_ITEMS };
4
- export { DEFAULT_LINES as ITEM_LINE };
3
+ import type { ChipMeta } from '../ui-contracts.js';
4
+ import type { StatusBarClickMap } from './status-bar-types.js';
5
5
  export type { StatuslineItem };
6
+ export { CHIP_DESCRIPTIONS, DEFAULT_LINES, DEFAULT_LINES as ITEM_LINE, STATUSLINE_FIELD_COUNT, STATUSLINE_ITEMS, };
7
+ /**
8
+ * Chips the composer's top rail already renders, so the status bar suppresses
9
+ * them to avoid a double display. They stay in `STATUSLINE_ITEMS` (the mouse
10
+ * hit-test indexes by position) and stay togglable — the picker just labels
11
+ * them so their "on" state doesn't read as a lie.
12
+ */
13
+ export declare const COMPOSER_OWNED_CHIPS: StatuslineItem[];
6
14
  /**
7
15
  * Metadata for a temporarily-visible chip (one that appeared due to data,
8
16
  * not user toggle). Tracked so the chip can auto-expire.
17
+ *
18
+ * Declared in the `ui-contracts` leaf and re-exported here under the picker's
19
+ * historical name: `status-bar-types.ts` needs the type, and owning it in a
20
+ * `.tsx` view module put the contracts leaf and the view in one type cycle.
9
21
  */
10
- export interface ChipMeta {
11
- key: StatuslineItem;
12
- /** Unix timestamp (ms) when the chip was shown. */
13
- shownAt: number;
14
- /**
15
- * Optional expiration time in minutes. Null/undefined = permanent (only
16
- * hidden when user toggles it off). Stream chips get a default 5 min.
17
- */
18
- expiresIn?: number;
19
- }
22
+ export type { ChipMeta };
20
23
  /** Default expiration for stream-triggered chips (5 minutes). */
21
24
  export declare const STREAM_CHIP_EXPIRES_IN_MINUTES = 5;
22
25
  /**
@@ -29,15 +32,45 @@ export declare function isChipExpired(meta: ChipMeta, now?: number): boolean;
29
32
  * Returns null if the chip has no expiration or has already expired.
30
33
  */
31
34
  export declare function getExpiresInLabel(meta: ChipMeta, now?: number): string | null;
35
+ /** Next density in the cycle: auto → full → short → micro → auto. */
36
+ export declare function nextDensity(current: StatuslineDensity, delta?: number): StatuslineDensity;
37
+ /**
38
+ * Whether `item` survives the picker's text filter. Matches the chip key and
39
+ * its description so "cost" finds `cost` and "cache" finds the cache chip by
40
+ * either its name or its blurb.
41
+ */
42
+ export declare function matchesFilter(item: StatuslineItem, filter: string): boolean;
43
+ /** Field indices the arrow keys may land on under the current filter. */
44
+ export declare function navigableFields(filter: string): number[];
32
45
  interface StatuslinePickerProps {
33
- /** Focused field index. */
46
+ /** Focused field index into STATUSLINE_ITEMS. */
34
47
  field: number;
35
48
  /** Current hidden-items list. */
36
49
  hiddenItems: StatuslineItem[];
50
+ /** Per-chip line assignment; absent keys use DEFAULT_LINES. */
51
+ lines?: StatuslineLines | undefined;
52
+ /** Per-chip density pin; absent keys mean 'auto'. */
53
+ densities?: StatuslineDensities | undefined;
37
54
  /** Temporarily-visible chips with expiration metadata. */
38
55
  visibleChips?: ChipMeta[] | undefined;
56
+ /** Text filter over chip names and descriptions. */
57
+ filter?: string | undefined;
58
+ /** True while `/` filter entry is capturing keystrokes. */
59
+ filtering?: boolean | undefined;
39
60
  /** Optional hint message from the reducer. */
40
61
  hint?: string | undefined;
62
+ /** Last published rail geometry, used for the live fill gauges. */
63
+ clickMap?: StatusBarClickMap | null | undefined;
41
64
  }
42
- export declare function StatuslinePicker({ field, hiddenItems, visibleChips, hint, }: StatuslinePickerProps): React.ReactElement;
65
+ /**
66
+ * The `/statusline` editor.
67
+ *
68
+ * Three things the old picker could not do, all of which the renderer and the
69
+ * v3 config already supported with no UI to reach them: move a chip to
70
+ * another line, pin its density, and see whether the result actually fits.
71
+ * The layout strip at the top is not a mock-up — it reads the rail geometry
72
+ * the StatusBar published on its last render, so `used/budget` and the
73
+ * dropped/shortened marks are the real thing.
74
+ */
75
+ export declare function StatuslinePicker({ field, hiddenItems, lines, densities, visibleChips, filter, filtering, hint, clickMap, }: StatuslinePickerProps): React.ReactElement;
43
76
  //# sourceMappingURL=statusline-picker.d.ts.map
@@ -27,6 +27,8 @@ export declare class HistoryArchive {
27
27
  /** Total entries written so far (monotonic counter). */
28
28
  private writeChain;
29
29
  private drainToken;
30
+ /** In-flight `fsp.open`, so concurrent first-uses share one handle. */
31
+ private opening;
30
32
  constructor(sessionDir: string);
31
33
  /**
32
34
  * Append an entry to the archive. Fire-and-forget: the write is queued
@@ -56,7 +58,7 @@ export declare class HistoryArchive {
56
58
  * The index is cached for the lifetime of the archive object.
57
59
  */
58
60
  private buildIndex;
59
- /** Serialise writes through a FIFO promise chain with fresh-token coalescing. */
61
+ /** Serialise writes through a FIFO promise chain with per-drain batching. */
60
62
  private enqueueWrite;
61
63
  }
62
64
  /**
@@ -6,10 +6,16 @@ interface BrainCouncilSeatTrace {
6
6
  status: 'valid' | 'invalid' | 'failed' | 'cancelled';
7
7
  /** The option the seat voted for, when the question was option-bearing. */
8
8
  optionId?: string | undefined;
9
+ /** Free-text position, for an optionless question. */
10
+ stance?: string | undefined;
9
11
  model?: string | undefined;
10
12
  veto?: boolean | undefined;
11
13
  durationMs?: number | undefined;
12
14
  error?: string | undefined;
15
+ /** Deliberation round this ballot came from; 1 is the independent round. */
16
+ round?: number | undefined;
17
+ /** The seat changed its vote after seeing the other ballots. */
18
+ changed?: boolean | undefined;
13
19
  }
14
20
  /**
15
21
  * Panel summary attached to a council-tier Brain entry.
@@ -26,6 +32,12 @@ interface BrainCouncilTrace {
26
32
  /** Distinct provider/model targets that served the valid votes. */
27
33
  distinctTargetCount: number;
28
34
  judgeUsed: boolean;
35
+ /** The tie-breaker's label, and whether it had already cast a vote. */
36
+ judgeLabel?: string | undefined;
37
+ judgeIsVoter?: boolean | undefined;
38
+ /** Deliberation rounds run (1 = none) and seats that moved in the last one. */
39
+ rounds?: number | undefined;
40
+ deliberationChanges?: number | undefined;
29
41
  totalTokens?: number | undefined;
30
42
  durationMs?: number | undefined;
31
43
  /** Structural warnings — most importantly a CORRELATED (non-diverse) panel. */
@@ -218,6 +230,12 @@ export type HistoryEntry = {
218
230
  rationale?: string | undefined;
219
231
  outcome?: string | undefined;
220
232
  interventionKind?: string | undefined;
233
+ /**
234
+ * Which tier of the ladder resolved this — the difference between a free
235
+ * rule hit and a multi-model council call, which are otherwise identical
236
+ * in the transcript.
237
+ */
238
+ tier?: string | undefined;
221
239
  /**
222
240
  * How the multi-LLM council reached this verdict, when a council decided
223
241
  * it. Present only for council-tier decisions; the single-LLM and policy
@@ -1,46 +1,25 @@
1
- export declare function useAppEventBridges(params: {
2
- events: any;
3
- agent: any;
4
- dispatch: any;
5
- streamingTextRef: any;
6
- streamSegmentsRef: any;
7
- pendingDeltaRef: any;
8
- flushTimerRef: any;
9
- sessionGenerationRef: any;
10
- activeRunGenerationRef: any;
11
- assistantCommittedThisRunRef: any;
12
- setMemoryContextMonitor: any;
13
- clientId: any;
14
- tokenCounter: any;
15
- getAutonomy: any;
16
- registerDebugStreamCallback: any;
17
- restoreDebugStreamCallback: any;
18
- stateRef: any;
19
- setActiveMaxContext: any;
20
- subscribeGoal: any;
21
- onClearHistory: any;
22
- fleetChat: any;
23
- enhanceEnabled: boolean;
24
- agentsMonitorOpen: boolean;
25
- fleetStreamController: any;
26
- enhanceController: any;
27
- agentsMonitorController: any;
28
- interruptController: any;
29
- activeCtrlRef: any;
30
- activeRunSettledRef: any;
31
- eternalLoopRunningRef: any;
32
- parallelLoopRunningRef: any;
33
- tokenPreviewsRef: any;
34
- clearPendingConfirms: () => void;
35
- getEternalEngine: any;
36
- getParallelEngine: any;
37
- getSddRun: any;
38
- switchAutonomy: any;
39
- slashRegistry: any;
40
- exitConfirm: any;
41
- liveDirector: any;
42
- director: any;
43
- }): {
1
+ import { useClientTelemetry } from './use-client-telemetry.js';
2
+ import { useDirectorFleetBridge } from './use-director-fleet-bridge.js';
3
+ import { useExitCommand } from './use-exit-command.js';
4
+ import { useProviderEventBridge } from './use-provider-event-bridge.js';
5
+ import { useSessionInterruptController } from './use-session-interrupt-controller.js';
6
+ import { useTuiControllers } from './use-tui-controllers.js';
7
+ import { useTuiEventBridge } from './use-tui-event-bridge.js';
8
+ /**
9
+ * This hook only fans its argument out to the seven bridge hooks below, so its
10
+ * parameter type is *taken from* them rather than restated. The decomposition
11
+ * that extracted it retyped all 38 fields as `any`, which silently unhooked
12
+ * every one of those already-typed contracts at the single point where the
13
+ * TUI wires them together.
14
+ */
15
+ type AppEventBridgeParams = Parameters<typeof useProviderEventBridge>[0] & Parameters<typeof useClientTelemetry>[0] & Omit<Parameters<typeof useTuiEventBridge>[0], 'getSessionId'> & Parameters<typeof useTuiControllers>[0] & Parameters<typeof useSessionInterruptController>[0] & Omit<Parameters<typeof useExitCommand>[0], 'getDirector'> & Omit<Parameters<typeof useDirectorFleetBridge>[0], 'chatMode'> & {
16
+ /** Passed to `useExitCommand` as `getDirector`. */
17
+ liveDirector: Parameters<typeof useExitCommand>[0]['getDirector'];
18
+ /** Passed to `useDirectorFleetBridge` as `chatMode`. */
19
+ fleetChat: Parameters<typeof useDirectorFleetBridge>[0]['chatMode'];
20
+ };
21
+ export declare function useAppEventBridges(params: AppEventBridgeParams): {
44
22
  getLeaderTranscript: () => import("@wrongstack/core/coordination").AgentTimelineEntry[];
45
23
  };
24
+ export {};
46
25
  //# sourceMappingURL=use-app-event-bridges.d.ts.map
@@ -1,22 +1,40 @@
1
1
  import type { Dispatch } from 'react';
2
2
  import type { AppProps } from '../app-props.js';
3
3
  import type { Action, State } from '../app-reducer.js';
4
+ import { useAutonomousCoordinator } from './use-autonomous-coordinator.js';
5
+ import { useBrainPanel } from './use-brain-panel.js';
6
+ import { useBrainRiskSync } from './use-brain-risk-sync.js';
7
+ import { useModePicker } from './use-mode-picker.js';
8
+ import { useModelPickRequest } from './use-model-pick.js';
9
+ import { useShadowPanel } from './use-shadow-panel.js';
10
+ import { useStatuslineHiddenSync } from './use-statusline-hidden-sync.js';
11
+ /**
12
+ * Every field below is forwarded verbatim to one of the panel hooks, so the
13
+ * types come from those hooks instead of `any`. AppProps already carries the
14
+ * host-supplied callbacks (`getModes`, `getBrainData`, …) with their real
15
+ * signatures — the decomposition just dropped them on the way through.
16
+ */
4
17
  export declare function useAppPanelsState(params: {
5
18
  projectRoot: string;
6
19
  dispatch: Dispatch<Action>;
7
20
  state: State;
8
- getModes?: any;
9
- getPickableProviders?: any;
10
- getBrainData?: any;
11
- brainPanelHost?: any;
12
- onBrainRiskLevel?: any;
13
- getShadowData?: any;
14
- onShadowStart?: any;
15
- onShadowStop?: any;
16
- slashRegistry?: AppProps['slashRegistry'];
17
- hiddenItems: any;
18
- setHiddenItems: (items: any) => void;
19
- subscribeCoordinatorEvents?: any;
21
+ getModes?: Parameters<typeof useModePicker>[0]['getModes'];
22
+ getPickableProviders?: Parameters<typeof useModelPickRequest>[0]['getPickableProviders'];
23
+ getBrainData?: Parameters<typeof useBrainPanel>[0]['getBrainData'];
24
+ brainPanelHost?: Parameters<typeof useBrainPanel>[0]['brainPanelHost'];
25
+ onBrainRiskLevel?: Parameters<typeof useBrainRiskSync>[0]['onBrainRiskLevel'];
26
+ getShadowData?: Parameters<typeof useShadowPanel>[1]['getShadowData'];
27
+ onShadowStart?: Parameters<typeof useShadowPanel>[1]['onShadowStart'];
28
+ onShadowStop?: Parameters<typeof useShadowPanel>[1]['onShadowStop'];
29
+ /**
30
+ * Required: `useHelpPanel` calls `slashRegistry.listWithOwner()` with no
31
+ * guard, so an omitted registry threw the moment the help panel opened.
32
+ * The previous `as any` at the call site hid exactly that.
33
+ */
34
+ slashRegistry: AppProps['slashRegistry'];
35
+ hiddenItems: Parameters<typeof useStatuslineHiddenSync>[0]['hiddenItems'];
36
+ setHiddenItems: Parameters<typeof useStatuslineHiddenSync>[0]['setHiddenItems'];
37
+ subscribeCoordinatorEvents?: Parameters<typeof useAutonomousCoordinator>[0];
20
38
  }): {
21
39
  openPromptPicker: () => Promise<void>;
22
40
  setPromptFavorite: (slug: string, favorite: boolean) => Promise<void>;
@@ -8,6 +8,7 @@ export declare function buildAppPipelineArgs(params: {
8
8
  state: K['state'];
9
9
  dispatch: K['dispatch'];
10
10
  historyScrollRef: K['historyScrollRef'];
11
+ onHistoryScrollActivity: K['onHistoryScrollActivity'];
11
12
  runInterruptLadder: K['runInterruptLadder'];
12
13
  enhanceCancelledRef: K['enhanceCancelledRef'];
13
14
  enhanceAbortRef: K['enhanceAbortRef'];
@@ -99,6 +100,10 @@ export declare function buildAppPipelineArgs(params: {
99
100
  setEnhanceDurationMs: S['actions']['setEnhanceDuration'];
100
101
  setRefineProviderId: S['actions']['setRefineProvider'];
101
102
  setRefineModel: S['actions']['setRefineModel'];
103
+ onBugHuntStarted: S['actions']['onBugHuntStarted'];
104
+ consumeBugHuntReplay: S['actions']['consumeBugHuntReplay'];
105
+ onBugHuntRunFinished: R['capabilities']['onRunFinished'];
106
+ shouldSuppressBugHuntNextSteps: () => boolean;
102
107
  }): AppExecutionPipelineArgs;
103
108
  export {};
104
109
  //# sourceMappingURL=use-app-pipeline-builders.d.ts.map
@@ -0,0 +1,9 @@
1
+ import type { Action } from '../app-reducer.js';
2
+ /** Coordinates bounded or user-stopped `/bughunt` rounds in the TUI. */
3
+ export declare function useBugHuntLoop(dispatch: (action: Action) => void, submit: (command: string) => void, historyGen?: number): {
4
+ onBugHuntStarted: (command: string, totalRounds?: number) => void;
5
+ onRunFinished: (status: 'done' | 'aborted' | 'failed' | 'max_iterations') => void;
6
+ consumeReplay: (command: string) => boolean;
7
+ shouldSuppressNextSteps: () => boolean;
8
+ };
9
+ //# sourceMappingURL=use-bug-hunt-loop.d.ts.map
@@ -0,0 +1,13 @@
1
+ import type { MutableRefObject } from 'react';
2
+ import type { HistoryScrollController } from '../components/scrollable-history.js';
3
+ /**
4
+ * Gives a reader a short window to inspect older chat output, then returns
5
+ * the managed history viewport to the live tail. Keeping this in App makes
6
+ * the timeout independent of ScrollableHistory remounts and layout changes.
7
+ */
8
+ export declare const HISTORY_AUTO_SCROLL_DELAY_MS = 30000;
9
+ export declare function useHistoryAutoScroll({ historyScrolled, historyScrollRef, }: {
10
+ historyScrolled: boolean;
11
+ historyScrollRef: MutableRefObject<HistoryScrollController | null>;
12
+ }): () => void;
13
+ //# sourceMappingURL=use-history-auto-scroll.d.ts.map
@@ -11,8 +11,8 @@ export declare function useHistoryViewportSync(input: {
11
11
  termRows: number;
12
12
  /**
13
13
  * Measured height (rows) of the status chrome below the pickers: the
14
- * status bar itself plus everything beneath it (mailbox panel, monitors,
15
- * key-hint bar). Pickers use it to size their window against the REAL
14
+ * status bar itself plus everything beneath it (mailbox panel, monitors).
15
+ * Pickers use it to size their window against the REAL
16
16
  * space left after input + status chrome instead of the hardcoded
17
17
  * 6-row `shellReservedRows` guess in use-windowed-picker.ts — the guess
18
18
  * under-reserves whenever the input wraps or the status bar grows, which
@@ -9,7 +9,7 @@ interface UseModePickerOptions {
9
9
  getModes?: (() => Promise<GetModesResult>) | undefined;
10
10
  }
11
11
  export declare function buildModePickerOptions(result: GetModesResult): import("../components/mode-picker.js").ModeOption[];
12
- export declare function useModePicker({ dispatch, getModes, }: UseModePickerOptions): {
12
+ export declare function useModePicker({ dispatch, getModes }: UseModePickerOptions): {
13
13
  openModePicker: () => Promise<void>;
14
14
  };
15
15
  export {};
@@ -1,5 +1,12 @@
1
+ import type { StatuslineDensities, StatuslineLines } from '@wrongstack/core/statusline';
1
2
  import type { StatuslineItem } from '../components/statusline-picker.js';
2
3
  export declare function statuslineHiddenDiffers(hookHidden: readonly StatuslineItem[], pickerHidden: readonly StatuslineItem[]): boolean;
4
+ /**
5
+ * Shallow key/value comparison for the sparse layout maps. Cheap enough to
6
+ * run on every picker keystroke and exact enough that a no-op re-render
7
+ * never triggers a disk write.
8
+ */
9
+ export declare function statuslineLayoutDiffers(a: Readonly<Record<string, unknown>>, b: Readonly<Record<string, unknown>>): boolean;
3
10
  interface UseStatuslineHiddenSyncOptions {
4
11
  pickerOpen: boolean;
5
12
  pickerHidden: readonly StatuslineItem[];
@@ -11,5 +18,27 @@ interface UseStatuslineHiddenSyncOptions {
11
18
  * statusline state hook so the visible status bar updates immediately.
12
19
  */
13
20
  export declare function useStatuslineHiddenSync({ pickerOpen, pickerHidden, hiddenItems, setHiddenItems, }: UseStatuslineHiddenSyncOptions): void;
21
+ interface UseStatuslineLayoutSyncOptions {
22
+ pickerOpen: boolean;
23
+ /**
24
+ * Whether the editor's layout is the live one. False when a caller opened
25
+ * the picker without seeding it — mirroring an unseeded (empty) layout back
26
+ * would publish, and then persist, a wipe of the user's assignment.
27
+ */
28
+ layoutSeeded: boolean;
29
+ pickerLines: StatuslineLines;
30
+ pickerDensities: StatuslineDensities;
31
+ lines: StatuslineLines;
32
+ densities: StatuslineDensities;
33
+ setLines: (lines: StatuslineLines) => void;
34
+ setDensities: (densities: StatuslineDensities) => void;
35
+ }
36
+ /**
37
+ * The layout twin of {@link useStatuslineHiddenSync}: reducer-owned line and
38
+ * density edits land in the statusline state hook, which re-renders the bar
39
+ * and (via `use-tui-environment-state`) persists them. Without this the
40
+ * picker's `1-4` / `d` keys would only change the picker's own view.
41
+ */
42
+ export declare function useStatuslineLayoutSync({ pickerOpen, layoutSeeded, pickerLines, pickerDensities, lines, densities, setLines, setDensities, }: UseStatuslineLayoutSyncOptions): void;
14
43
  export {};
15
44
  //# sourceMappingURL=use-statusline-hidden-sync.d.ts.map
@@ -1,4 +1,4 @@
1
- import type { StatuslineLines } from '@wrongstack/core/statusline';
1
+ import type { StatuslineDensities, StatuslineLines } from '@wrongstack/core/statusline';
2
2
  import type { StatuslineItem } from '../components/statusline-picker.js';
3
3
  export type AutonomyStage = 'off' | 'suggest' | 'auto' | 'eternal' | 'eternal-parallel';
4
4
  /**
@@ -24,6 +24,8 @@ interface UseStatuslineStateOptions {
24
24
  statuslineHiddenItems: Set<string> | readonly string[];
25
25
  /** Per-chip line assignment (schema v2); absent keys use DEFAULT_LINES. */
26
26
  statuslineLines?: StatuslineLines | undefined;
27
+ /** Per-chip density pin (schema v3); absent keys leave the rail fitter free. */
28
+ statuslineDensities?: StatuslineDensities | undefined;
27
29
  }
28
30
  interface UseStatuslineState {
29
31
  liveModel: string;
@@ -42,6 +44,8 @@ interface UseStatuslineState {
42
44
  setHiddenItems: (v: StatuslineHiddenItem[]) => void;
43
45
  lines: StatuslineLines;
44
46
  setLines: (v: StatuslineLines) => void;
47
+ densities: StatuslineDensities;
48
+ setDensities: (v: StatuslineDensities) => void;
45
49
  sessionCount: number;
46
50
  setSessionCount: (v: number) => void;
47
51
  }
@@ -1,8 +1,8 @@
1
1
  import type { AppProps } from '../app-props.js';
2
- type EnvironmentProps = Omit<Pick<AppProps, 'events' | 'memoryStore' | 'model' | 'provider' | 'effectiveMaxContext' | 'yolo' | 'getAutonomy' | 'modeLabel' | 'statuslineHiddenItems' | 'statuslineLines' | 'toolCount' | 'getSettings' | 'setStatuslineHiddenItems' | 'saveStatuslineHiddenItems'>, 'yolo'> & {
2
+ type EnvironmentProps = Omit<Pick<AppProps, 'events' | 'memoryStore' | 'model' | 'provider' | 'effectiveMaxContext' | 'yolo' | 'getAutonomy' | 'modeLabel' | 'statuslineHiddenItems' | 'statuslineLines' | 'statuslineDensities' | 'toolCount' | 'getSettings' | 'setStatuslineHiddenItems' | 'saveStatuslineHiddenItems' | 'setStatuslineLines' | 'saveStatuslineLines' | 'setStatuslineDensities' | 'saveStatuslineDensities'>, 'yolo'> & {
3
3
  yolo: boolean;
4
4
  };
5
- export declare function useTuiEnvironmentState({ events, memoryStore, model, provider, effectiveMaxContext, yolo, getAutonomy, modeLabel, statuslineHiddenItems, statuslineLines, toolCount, getSettings, setStatuslineHiddenItems, saveStatuslineHiddenItems, }: EnvironmentProps): {
5
+ export declare function useTuiEnvironmentState({ events, memoryStore, model, provider, effectiveMaxContext, yolo, getAutonomy, modeLabel, statuslineHiddenItems, statuslineLines, statuslineDensities, toolCount, getSettings, setStatuslineHiddenItems, saveStatuslineHiddenItems, setStatuslineLines, saveStatuslineLines, setStatuslineDensities, saveStatuslineDensities, }: EnvironmentProps): {
6
6
  liveModel: string;
7
7
  setLiveModel: (v: string) => void;
8
8
  liveProvider: string;
@@ -19,6 +19,8 @@ export declare function useTuiEnvironmentState({ events, memoryStore, model, pro
19
19
  setHiddenItems: (v: import("@wrongstack/core/statusline").StatuslineItem[]) => void;
20
20
  lines: import("@wrongstack/core/statusline").StatuslineLines;
21
21
  setLines: (v: import("@wrongstack/core/statusline").StatuslineLines) => void;
22
+ densities: import("@wrongstack/core/statusline").StatuslineDensities;
23
+ setDensities: (v: import("@wrongstack/core/statusline").StatuslineDensities) => void;
22
24
  sessionCount: number;
23
25
  setSessionCount: (v: number) => void;
24
26
  hiddenItemsRef: import("react").RefObject<import("@wrongstack/core/statusline").StatuslineItem[]>;
package/dist/index.d.ts CHANGED
@@ -1,6 +1,6 @@
1
1
  export type { Settings } from './app.js';
2
2
  export { buildGoalPreamble } from './app.js';
3
- export type { AuthCatalogRow, AuthFlowIo, AuthFlowResult, AuthKeyRow, AuthLocalPresetRow, AuthOAuthKind, AuthPanelHost, AuthProviderRow, } from './auth-panel-model.js';
3
+ export type { AuthCatalogRow, AuthFlowIo, AuthFlowResult, AuthKeyEdit, AuthKeyRow, AuthLocalPresetRow, AuthModelEdit, AuthOAuthKind, AuthPanelHost, AuthProviderEdit, AuthProviderRow, AuthProviderSetup, } from './auth-panel-model.js';
4
4
  export type { BrainDenyIsTerminal, BrainHeuristicKey, BrainPanelHeuristics, BrainPanelHost, BrainPanelPersona, BrainPanelSettings, BrainPanelVoter, BrainTerminalPolicyValue, BrainTraceContent, } from './brain-panel-model.js';
5
5
  export { replaySessionMessages } from './components/history/replay.js';
6
6
  export type { ProviderOption } from './components/model-picker.js';