@wrongstack/tui 1.0.24 → 1.0.26

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 (84) hide show
  1. package/dist/app-action-type.d.ts +54 -1
  2. package/dist/app-panel-state.d.ts +25 -0
  3. package/dist/app-props.d.ts +20 -0
  4. package/dist/app-reducer.d.ts +1 -1
  5. package/dist/app-state-core-types.d.ts +13 -0
  6. package/dist/app-view-contract.d.ts +1 -1
  7. package/dist/background-strip-model.d.ts +65 -0
  8. package/dist/brain-panel-model.d.ts +7 -7
  9. package/dist/chat-search-slash.d.ts +15 -0
  10. package/dist/clipboard.d.ts +14 -1
  11. package/dist/components/background-strip.d.ts +20 -0
  12. package/dist/components/chat-search-bar.d.ts +19 -0
  13. package/dist/components/checkpoint-timeline.d.ts +6 -2
  14. package/dist/components/history/code-block.d.ts +2 -136
  15. package/dist/components/history/diff-model.d.ts +143 -0
  16. package/dist/components/history/scroll-controller-types.d.ts +11 -0
  17. package/dist/components/history/scrollbar-rail.d.ts +14 -2
  18. package/dist/components/history/use-history-controller.d.ts +5 -0
  19. package/dist/components/monitor-shell.d.ts +5 -1
  20. package/dist/components/phase-monitor.d.ts +3 -1
  21. package/dist/components/prompt-picker-model.d.ts +16 -0
  22. package/dist/components/prompt-picker.d.ts +2 -16
  23. package/dist/components/resource-menu-model.d.ts +3 -0
  24. package/dist/components/resource-menu.d.ts +3 -3
  25. package/dist/components/scrollable-history.d.ts +1 -1
  26. package/dist/components/send-mode-model.d.ts +44 -0
  27. package/dist/components/send-mode-picker.d.ts +2 -43
  28. package/dist/components/sidebar-panel-agents.d.ts +10 -0
  29. package/dist/components/sidebar-panel-connections.d.ts +11 -0
  30. package/dist/components/sidebar-panel-coordinator.d.ts +11 -0
  31. package/dist/components/sidebar-panel-fleet.d.ts +16 -0
  32. package/dist/components/sidebar-panel-project.d.ts +12 -0
  33. package/dist/components/sidebar-panel-worktree.d.ts +10 -0
  34. package/dist/components/sidebar-panel-wrong-proxy.d.ts +25 -0
  35. package/dist/components/sidebar-panels-workspace.d.ts +10 -79
  36. package/dist/components/status-bar-rails-async.d.ts +2 -2
  37. package/dist/components/status-bar-types.d.ts +6 -0
  38. package/dist/components/status-bar.d.ts +1 -1
  39. package/dist/components/statusline-picker-model.d.ts +45 -0
  40. package/dist/components/statusline-picker.d.ts +2 -41
  41. package/dist/hooks/fork-at-checkpoint.d.ts +25 -0
  42. package/dist/hooks/use-app-execution-pipeline.d.ts +1 -1
  43. package/dist/hooks/use-app-picker-keys.d.ts +4 -2
  44. package/dist/hooks/use-chip-staleness-guard.d.ts +6 -0
  45. package/dist/hooks/use-core-tui-commands.d.ts +7 -2
  46. package/dist/hooks/use-file-search.d.ts +10 -0
  47. package/dist/hooks/use-picker-keys-brain-statusline.d.ts +4 -0
  48. package/dist/hooks/use-provider-warmup.d.ts +9 -0
  49. package/dist/hooks/use-queue-manager.d.ts +11 -1
  50. package/dist/hooks/use-session-rewind.d.ts +8 -1
  51. package/dist/hooks/use-slash-picker.d.ts +1 -1
  52. package/dist/hooks/use-stable-key-handler.d.ts +8 -1
  53. package/dist/hooks/use-status-sync-interval.d.ts +3 -2
  54. package/dist/hooks/use-tui-environment-state.d.ts +3 -0
  55. package/dist/hooks/use-tui-event-bridge.d.ts +12 -0
  56. package/dist/index.js +22173 -20317
  57. package/dist/ink.d.ts +1 -1
  58. package/dist/input-validation/action-types.d.ts +1 -1
  59. package/dist/input-validation/limits.d.ts +2 -0
  60. package/dist/input-validation-display.d.ts +9 -0
  61. package/dist/input-validation.d.ts +0 -52
  62. package/dist/key-routes/key-route-background-strip.d.ts +14 -0
  63. package/dist/key-routes/key-route-chat-search.d.ts +24 -0
  64. package/dist/layout-store.d.ts +2 -2
  65. package/dist/memory-slash-render.d.ts +1 -1
  66. package/dist/message-checkpoint.d.ts +19 -0
  67. package/dist/motion.d.ts +16 -0
  68. package/dist/reducers/chat-search.d.ts +11 -0
  69. package/dist/reducers/composer-action-types.d.ts +6 -0
  70. package/dist/reducers/composer-pickers.d.ts +4 -0
  71. package/dist/reducers/composer.d.ts +1 -5
  72. package/dist/reducers/message-jump.d.ts +16 -0
  73. package/dist/reducers/workspace-panels.d.ts +1 -1
  74. package/dist/resume-session-tree.d.ts +8 -0
  75. package/dist/rewind-prompt.d.ts +24 -0
  76. package/dist/run-tui-options.d.ts +23 -4
  77. package/dist/scroll-anchor.d.ts +6 -0
  78. package/dist/submit-controller.d.ts +1 -1
  79. package/dist/submit-slash-command.d.ts +67 -0
  80. package/dist/transcript-search.d.ts +38 -0
  81. package/dist/ui-contracts.d.ts +1 -1
  82. package/dist/use-app-controller.d.ts +1 -1
  83. package/dist/use-controller-key-pipeline.d.ts +217 -0
  84. package/package.json +7 -7
@@ -0,0 +1,45 @@
1
+ import { CHIP_DESCRIPTIONS, DEFAULT_LINES, STATUSLINE_FIELD_COUNT, STATUSLINE_ITEMS, type StatuslineDensity, type StatuslineItem, type StatuslineLines, type StatuslineOrder } from '@wrongstack/core/statusline';
2
+ import type { ChipMeta } from '../ui-contracts.js';
3
+ export type { StatuslineItem };
4
+ export { CHIP_DESCRIPTIONS, DEFAULT_LINES, DEFAULT_LINES as ITEM_LINE, STATUSLINE_FIELD_COUNT, STATUSLINE_ITEMS, };
5
+ /**
6
+ * Chips the composer's top rail already renders, so the status bar suppresses
7
+ * them to avoid a double display. They stay in `STATUSLINE_ITEMS` (the mouse
8
+ * hit-test indexes by position) and stay togglable — the picker just labels
9
+ * them so their "on" state doesn't read as a lie.
10
+ */
11
+ export declare const COMPOSER_OWNED_CHIPS: StatuslineItem[];
12
+ /**
13
+ * Metadata for a temporarily-visible chip (one that appeared due to data,
14
+ * not user toggle). Tracked so the chip can auto-expire.
15
+ *
16
+ * Declared in the `ui-contracts` leaf and re-exported here under the picker's
17
+ * historical name: `status-bar-types.ts` needs the type, and owning it in a
18
+ * `.tsx` view module put the contracts leaf and the view in one type cycle.
19
+ */
20
+ export type { ChipMeta };
21
+ /** Default expiration for stream-triggered chips (5 minutes). */
22
+ export declare const STREAM_CHIP_EXPIRES_IN_MINUTES = 5;
23
+ /**
24
+ * Returns true if a chip with the given metadata has expired.
25
+ * Chips with no `expiresIn` never expire on their own.
26
+ */
27
+ export declare function isChipExpired(meta: ChipMeta, now?: number): boolean;
28
+ /**
29
+ * Returns a human-readable countdown label for a chip with expiration.
30
+ * Returns null if the chip has no expiration or has already expired.
31
+ */
32
+ export declare function getExpiresInLabel(meta: ChipMeta, now?: number): string | null;
33
+ /** Stream-triggered chips — these auto-expire unless toggled on permanently. */
34
+ export declare const STREAM_CHIP_KEYS: StatuslineItem[];
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
+ /** Shared visual/keyboard order: effective line groups, then saved order within each line. */
44
+ export declare function navigableFields(filter: string, order?: StatuslineOrder, lines?: StatuslineLines): number[];
45
+ //# sourceMappingURL=statusline-picker-model.d.ts.map
@@ -1,47 +1,8 @@
1
- import { CHIP_DESCRIPTIONS, DEFAULT_LINES, STATUSLINE_FIELD_COUNT, STATUSLINE_ITEMS, type StatuslineDensities, type StatuslineDensity, type StatuslineItem, type StatuslineLine, type StatuslineLines, type StatuslineOrder } from '@wrongstack/core/statusline';
1
+ import { type StatuslineDensities, type StatuslineItem, type StatuslineLine, type StatuslineLines, type StatuslineOrder } from '@wrongstack/core/statusline';
2
2
  import type React from 'react';
3
3
  import type { ChipMeta } from '../ui-contracts.js';
4
4
  import type { StatusBarClickMap } from './status-bar-types.js';
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[];
14
- /**
15
- * Metadata for a temporarily-visible chip (one that appeared due to data,
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.
21
- */
22
- export type { ChipMeta };
23
- /** Default expiration for stream-triggered chips (5 minutes). */
24
- export declare const STREAM_CHIP_EXPIRES_IN_MINUTES = 5;
25
- /**
26
- * Returns true if a chip with the given metadata has expired.
27
- * Chips with no `expiresIn` never expire on their own.
28
- */
29
- export declare function isChipExpired(meta: ChipMeta, now?: number): boolean;
30
- /**
31
- * Returns a human-readable countdown label for a chip with expiration.
32
- * Returns null if the chip has no expiration or has already expired.
33
- */
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
- /** Shared visual/keyboard order: effective line groups, then saved order within each line. */
44
- export declare function navigableFields(filter: string, order?: StatuslineOrder, lines?: StatuslineLines): number[];
5
+ export * from './statusline-picker-model.js';
45
6
  interface StatuslinePickerProps {
46
7
  /** Focused field index into STATUSLINE_ITEMS. */
47
8
  field: number;
@@ -0,0 +1,25 @@
1
+ import type { Action } from '../app-action-type.js';
2
+ export interface ForkAtCheckpointDeps {
3
+ /** Host fork: branches `sessionId` at the checkpoint and returns the new id. */
4
+ forkSession: (sessionId: string, checkpointPromptIndex: number) => Promise<{
5
+ id: string;
6
+ }>;
7
+ /** The prompt recorded for the checkpoint (see `DefaultSessionRewinder.promptAt`). */
8
+ promptAt: (sessionId: string, checkpointPromptIndex: number) => Promise<string | undefined>;
9
+ /** The resume flow the /resume picker runs. */
10
+ resume: (sessionId: string, label: string) => Promise<void>;
11
+ /** The session the agent is on now; tells whether the resume attached the fork. */
12
+ currentSessionId: () => string | undefined;
13
+ dispatch: (action: Action) => void;
14
+ }
15
+ /**
16
+ * Fork the current session at a checkpoint and switch to the fork: the
17
+ * conversation up to that prompt continues in a new session, the original
18
+ * stays as it was, and the prompt is back in the composer to edit and send.
19
+ */
20
+ export declare function forkAtCheckpoint(deps: ForkAtCheckpointDeps, request: {
21
+ sessionId: string;
22
+ promptIndex: number;
23
+ draft: string;
24
+ }): Promise<void>;
25
+ //# sourceMappingURL=fork-at-checkpoint.d.ts.map
@@ -12,7 +12,7 @@ export interface AppExecutionPipelineArgs {
12
12
  current: ReturnType<typeof createRunBlocksController>;
13
13
  };
14
14
  submitRef: {
15
- current: any;
15
+ current: (text?: string) => void;
16
16
  };
17
17
  }
18
18
  export declare function useAppExecutionPipeline(args: AppExecutionPipelineArgs): {
@@ -1,4 +1,4 @@
1
- import type { PromptUsageStore } from '@wrongstack/core/storage';
1
+ import { type PromptUsageStore } from '@wrongstack/core/storage';
2
2
  import type { Dispatch, MutableRefObject } from 'react';
3
3
  import type { Action } from '../app-action-type.js';
4
4
  import type { AppProps } from '../app-props.js';
@@ -12,6 +12,8 @@ import type { useStatusbarViewModel } from './use-statusbar-view-model.js';
12
12
  import type { useTuiEnvironmentState } from './use-tui-environment-state.js';
13
13
  interface UseAppPickerKeysOptions {
14
14
  sessionGenerationRef?: MutableRefObject<number> | undefined;
15
+ /** Move the input queue to a resumed session (see `useQueueManager`). */
16
+ switchQueueSession?: ((sessionId: string) => void) | undefined;
15
17
  host: AppProps;
16
18
  state: State;
17
19
  dispatch: Dispatch<Action>;
@@ -37,6 +39,6 @@ interface UseAppPickerKeysOptions {
37
39
  onThemePickerEnter?: () => void;
38
40
  setPromptFavorite: (slug: string, favorite: boolean) => Promise<void>;
39
41
  }
40
- export declare function useAppPickerKeys({ sessionGenerationRef, host, state, dispatch, environment, statusbar, panelControllers, authPanelController, brainController, lastEnterAtRef, inputGateRef, submitRef, promptUsageRef, setDraft, acceptSlashPickerSelection, changeBrainRisk, handleModelPicked, handleShadowStart, handleShadowStop, subagentModelsController, statuslineHiddenForPicker, onPickerEnter, onThemePickerEnter, setPromptFavorite, }: UseAppPickerKeysOptions): (input: string, key: import("../components/input.js").KeyEvent, isEnter: boolean) => boolean;
42
+ export declare function useAppPickerKeys({ sessionGenerationRef, switchQueueSession, host, state, dispatch, environment, statusbar, panelControllers, authPanelController, brainController, lastEnterAtRef, inputGateRef, submitRef, promptUsageRef, setDraft, acceptSlashPickerSelection, changeBrainRisk, handleModelPicked, handleShadowStart, handleShadowStop, subagentModelsController, statuslineHiddenForPicker, onPickerEnter, onThemePickerEnter, setPromptFavorite, }: UseAppPickerKeysOptions): (input: string, key: import("../components/input.js").KeyEvent, isEnter: boolean) => boolean;
41
43
  export {};
42
44
  //# sourceMappingURL=use-app-picker-keys.d.ts.map
@@ -41,6 +41,12 @@ interface UseChipStalenessGuardOptions {
41
41
  agentState: 'idle' | 'running' | 'streaming' | 'aborting';
42
42
  /** Current spinner phase index (advances every SPINNER_INTERVAL_MS while active). */
43
43
  spinnerPhase: number;
44
+ /**
45
+ * False while the spinner is deliberately still (the `static` animation
46
+ * style / reduced motion): a still spinner is then not a frozen one.
47
+ * Default true.
48
+ */
49
+ spinnerAnimated?: boolean;
44
50
  /** Token usage fingerprint — changes when new token events arrive. */
45
51
  tokenFingerprint: string;
46
52
  /** Context usage ratio (0..1) — changes as context grows. */
@@ -1,10 +1,12 @@
1
1
  import type { Director } from '@wrongstack/core/coordination';
2
+ import type { RedoRewindResult } from '@wrongstack/core/storage';
2
3
  import { type Dispatch, type MutableRefObject, type SetStateAction } from 'react';
3
4
  import type { Action } from '../app-action-type.js';
4
5
  import type { AppProps } from '../app-props.js';
5
6
  import type { State } from '../app-state.js';
6
7
  import { createCronJobsGetter } from '../cron-slash.js';
7
8
  import type { MemoryContextMonitorState } from '../memory-context-monitor.js';
9
+ import type { RewindOutcome } from './use-session-rewind.js';
8
10
  interface CoreTuiCommandsOptions {
9
11
  agent: AppProps['agent'];
10
12
  slashRegistry: AppProps['slashRegistry'];
@@ -25,10 +27,13 @@ interface CoreTuiCommandsOptions {
25
27
  liveDirector: () => Director | null | undefined;
26
28
  streamingTextRef: MutableRefObject<string>;
27
29
  director: AppProps['director'];
28
- handleRewindTo: (index: number) => Promise<void>;
30
+ handleRewindTo: (index: number) => Promise<RewindOutcome>;
31
+ /** `/rewind redo`: undo the newest rewind. */
32
+ handleRewindRedo: () => Promise<RedoRewindResult | null>;
33
+ getSettings?: AppProps['getSettings'] | undefined;
29
34
  }
30
35
  /** Registers process/context/kanban/steer/rewind/agents commands. */
31
- export declare function useCoreTuiCommands({ agent, slashRegistry, memoryStore, onPanelOpen, memoryContextMonitorRef, memoryRecordTotalRef, stateRef, boardFocusRef, setFocusedBoardId, terminalWidth, getModeLabel, activeCtrlRef, clearPendingConfirms, dispatch, liveDirector, streamingTextRef, director, handleRewindTo, }: CoreTuiCommandsOptions): {
36
+ export declare function useCoreTuiCommands({ agent, slashRegistry, memoryStore, onPanelOpen, memoryContextMonitorRef, memoryRecordTotalRef, stateRef, boardFocusRef, setFocusedBoardId, terminalWidth, getModeLabel, activeCtrlRef, clearPendingConfirms, dispatch, liveDirector, streamingTextRef, director, handleRewindTo, handleRewindRedo, getSettings, }: CoreTuiCommandsOptions): {
32
37
  getCronJobs: ReturnType<typeof createCronJobsGetter>;
33
38
  runSteerSequence: (text: string) => {
34
39
  preamble: string;
@@ -19,6 +19,16 @@ export declare function detectAtToken(buffer: string, cursor: number): {
19
19
  end: number;
20
20
  query: string;
21
21
  } | null;
22
+ export declare function isFileSelectionCurrent(current: {
23
+ buffer: string;
24
+ cursor: number;
25
+ }, original: {
26
+ buffer: string;
27
+ cursor: number;
28
+ }, token: {
29
+ start: number;
30
+ end: number;
31
+ }): boolean;
22
32
  interface UseFileSearchOptions {
23
33
  state: State;
24
34
  dispatch: React.Dispatch<Action>;
@@ -0,0 +1,4 @@
1
+ import type { KeyEvent } from '../components/input.js';
2
+ import type { PickerKeysHost } from './use-picker-keys-types.js';
3
+ export declare function tryBrainStatuslinePickerKeys(host: PickerKeysHost, input: string, key: KeyEvent, isEnter: boolean, debouncedEnter: (host: PickerKeysHost) => boolean): boolean;
4
+ //# sourceMappingURL=use-picker-keys-brain-statusline.d.ts.map
@@ -0,0 +1,9 @@
1
+ import type { AppProps } from '../app-props.js';
2
+ import type { State } from '../app-state.js';
3
+ /**
4
+ * Warm the provider connection while the user types, so DNS and TLS are done
5
+ * by the time they press Enter (`Provider.warm`). Runs on every keystroke;
6
+ * the provider throttles to one small request per endpoint every few seconds.
7
+ */
8
+ export declare function useProviderWarmup(agent: AppProps['agent'], buffer: string, status: State['status']): void;
9
+ //# sourceMappingURL=use-provider-warmup.d.ts.map
@@ -5,6 +5,12 @@ import type { Settings } from '../app-state.js';
5
5
  export interface UseQueueManagerOptions {
6
6
  /** Optional persistent store — absent => in-memory only (no crash recovery). */
7
7
  queueStore?: QueueStore | undefined;
8
+ /**
9
+ * The store of another session. With it, resuming a session brings that
10
+ * session's queue along (the WebUI keeps its queue in the same file) and
11
+ * leaves the previous session's on disk; without it, the queue is dropped.
12
+ */
13
+ queueStoreFor?: ((sessionId: string) => QueueStore | undefined) | undefined;
8
14
  /** Called on every queue change so the host learns what's waiting. */
9
15
  onQueueChange?: ((items: string[]) => void) | undefined;
10
16
  /** Slash registry to register the /queue command. */
@@ -18,10 +24,14 @@ export interface UseQueueManagerOptions {
18
24
  /** Live mirror of the mid-run send-mode picker enabled flag. */
19
25
  midRunSendPickerRef: React.MutableRefObject<boolean>;
20
26
  }
27
+ export interface QueueManager {
28
+ /** Move the queue to the session just resumed: its own queue replaces this one. */
29
+ switchSession(sessionId: string): void;
30
+ }
21
31
  /**
22
32
  * Manages the TUI message queue: rehydration from persistent store,
23
33
  * persistence on every change, host mirroring, and the /queue slash
24
34
  * command. All side-effect wiring extracted from app.tsx.
25
35
  */
26
- export declare function useQueueManager({ queueStore, onQueueChange, slashRegistry, stateRef, dispatch, getSettings, saveSettings, midRunSendPickerRef, }: UseQueueManagerOptions): void;
36
+ export declare function useQueueManager({ queueStore, queueStoreFor, onQueueChange, slashRegistry, stateRef, dispatch, getSettings, saveSettings, midRunSendPickerRef, }: UseQueueManagerOptions): QueueManager;
27
37
  //# sourceMappingURL=use-queue-manager.d.ts.map
@@ -1,6 +1,12 @@
1
1
  import type { Agent } from '@wrongstack/core/agent';
2
2
  import type { Director } from '@wrongstack/core/coordination';
3
+ import { type RedoRewindResult, type RewoundConversation } from '@wrongstack/core/storage';
3
4
  import type { SessionInterruptController } from './use-session-interrupt-controller.js';
5
+ /** What a rewind leaves for the screen: the prompt taken back, and the rest. */
6
+ export interface RewindOutcome {
7
+ promptText?: string | undefined;
8
+ conversation?: RewoundConversation | undefined;
9
+ }
4
10
  interface UseSessionRewindOptions {
5
11
  agent: Agent;
6
12
  sessionsDir?: string | undefined;
@@ -9,7 +15,8 @@ interface UseSessionRewindOptions {
9
15
  sessionGenerationRef: React.MutableRefObject<number>;
10
16
  }
11
17
  export declare function useSessionRewind({ agent, sessionsDir, interruptController, liveDirector, sessionGenerationRef, }: UseSessionRewindOptions): {
12
- handleRewindTo: (checkpointIndex: number) => Promise<void>;
18
+ handleRewindTo: (checkpointIndex: number) => Promise<RewindOutcome>;
19
+ handleRewindRedo: () => Promise<RedoRewindResult | null>;
13
20
  };
14
21
  export {};
15
22
  //# sourceMappingURL=use-session-rewind.d.ts.map
@@ -1,6 +1,6 @@
1
1
  import { type Dispatch } from 'react';
2
- import type { AppProps } from '../app-props.js';
3
2
  import type { Action } from '../app-action-type.js';
3
+ import type { AppProps } from '../app-props.js';
4
4
  import type { State } from '../app-state.js';
5
5
  interface SlashPickerOptions {
6
6
  state: State;
@@ -1,5 +1,12 @@
1
1
  import type { KeyEvent } from '../components/input.js';
2
2
  type AppKeyHandler = (input: string, key: KeyEvent) => Promise<void>;
3
- export declare function useStableKeyHandler(handleKey: AppKeyHandler): AppKeyHandler;
3
+ /**
4
+ * Returns an identity-stable key handler that always calls the latest
5
+ * `handleKey`. A rejected key handler must never kill the process, but it
6
+ * must not vanish either: `onError` receives the failure so the host can
7
+ * surface it (an error entry in the transcript). Without `onError` the
8
+ * failure is still contained.
9
+ */
10
+ export declare function useStableKeyHandler(handleKey: AppKeyHandler, onError?: (err: unknown) => void): AppKeyHandler;
4
11
  export {};
5
12
  //# sourceMappingURL=use-stable-key-handler.d.ts.map
@@ -1,6 +1,7 @@
1
1
  import type { Agent } from '@wrongstack/core/agent';
2
+ import type { AutonomyStage } from './use-statusline-state.js';
2
3
  interface UseStatusSyncIntervalOptions {
3
- getAutonomy?: (() => string) | undefined;
4
+ getAutonomy?: (() => AutonomyStage) | undefined;
4
5
  getYolo?: (() => boolean) | undefined;
5
6
  getModeLabel?: (() => string) | undefined;
6
7
  getEternalEngine?: unknown;
@@ -11,7 +12,7 @@ interface UseStatusSyncIntervalOptions {
11
12
  liveModeLabel: string;
12
13
  liveModel: string;
13
14
  liveProvider: string;
14
- setAutonomyLive: (v: any) => void;
15
+ setAutonomyLive: (v: AutonomyStage) => void;
15
16
  setYoloLive: (v: boolean) => void;
16
17
  setLiveModeLabel: (v: string) => void;
17
18
  setLiveModel: (v: string) => void;
@@ -1,3 +1,4 @@
1
+ import { getIndexState } from '@wrongstack/tools';
1
2
  import type { AppProps } from '../app-props.js';
2
3
  type EnvironmentProps = Omit<Pick<AppProps, 'events' | 'memoryStore' | 'model' | 'provider' | 'effectiveMaxContext' | 'yolo' | 'getAutonomy' | 'modeLabel' | 'statuslineHiddenItems' | 'statuslineLines' | 'statuslineDensities' | 'statuslineOrder' | 'toolCount' | 'getSettings' | 'setStatuslineHiddenItems' | 'saveStatuslineHiddenItems' | 'setStatuslineLines' | 'saveStatuslineLines' | 'setStatuslineDensities' | 'saveStatuslineDensities' | 'setStatuslineOrder' | 'saveStatuslineOrder'>, 'yolo'> & {
3
4
  yolo: boolean;
@@ -45,5 +46,7 @@ export declare function useTuiEnvironmentState({ events, memoryStore, model, pro
45
46
  };
46
47
  breakerCountdown: import("@wrongstack/tools").BreakerCountdown | null;
47
48
  };
49
+ /** Everything the index status chip renders; equal keys draw an equal chip. */
50
+ export declare function indexChipKey(state: ReturnType<typeof getIndexState>): string;
48
51
  export {};
49
52
  //# sourceMappingURL=use-tui-environment-state.d.ts.map
@@ -4,6 +4,18 @@ type ClearHistoryDispatch = React.Dispatch<{
4
4
  type: 'clearHistory';
5
5
  model?: string | undefined;
6
6
  provider?: string | undefined;
7
+ /**
8
+ * When explicitly `null`, the reducer treats the boot-time restored
9
+ * transcript as discarded and resets `historyBudget`, `autoProceedHold`,
10
+ * and `nextId` to the fresh-boot values. `/clear` passes `null` for
11
+ * all three so the screen genuinely looks like first launch. Pass
12
+ * `undefined` (or omit) to preserve the existing resume-derived
13
+ * budget/hold — the behavior the bridge uses for `session.rewound` /
14
+ * `project.switched`.
15
+ */
16
+ restoredMessages?: readonly unknown[] | null | undefined;
17
+ restoredToolCalls?: readonly unknown[] | null | undefined;
18
+ restoredEvents?: readonly unknown[] | null | undefined;
7
19
  } | {
8
20
  type: 'resetContextChip';
9
21
  } | {