@wrongstack/tui 1.0.33 → 1.0.35
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.
- package/dist/app-action-settings.d.ts +1 -0
- package/dist/app-action-workflows.d.ts +4 -0
- package/dist/app-coordination-props.d.ts +116 -0
- package/dist/app-enhancement-props.d.ts +57 -0
- package/dist/app-panel-state.d.ts +2 -0
- package/dist/app-props.d.ts +9 -350
- package/dist/app-session-props.d.ts +91 -0
- package/dist/app-settings-props.d.ts +101 -0
- package/dist/app-settings-type.d.ts +5 -2
- package/dist/app-state.d.ts +6 -0
- package/dist/app-view-contract.d.ts +2 -3
- package/dist/app-view-pickers.d.ts +1 -12
- package/dist/app-view-prompts.d.ts +19 -0
- package/dist/components/chat-search-bar.d.ts +0 -2
- package/dist/components/history/assistant.d.ts +0 -7
- package/dist/components/history/banner-formation.d.ts +6 -0
- package/dist/components/history/banner.d.ts +3 -1
- package/dist/components/history/basic-format.d.ts +0 -2
- package/dist/components/history/copy-geometry.d.ts +0 -9
- package/dist/components/history/entry.d.ts +2 -1
- package/dist/components/history/index.d.ts +1 -1
- package/dist/components/history/scroll-controller-types.d.ts +5 -0
- package/dist/components/history/scrollbar-geometry.d.ts +2 -0
- package/dist/components/history/types.d.ts +1 -1
- package/dist/components/history/use-history-controller.d.ts +4 -0
- package/dist/components/model-picker-effort.d.ts +7 -0
- package/dist/components/model-picker.d.ts +6 -0
- package/dist/components/provider-colors.d.ts +0 -7
- package/dist/components/scrollable-history.d.ts +2 -5
- package/dist/components/settings-picker-constants.d.ts +2 -3
- package/dist/components/settings-picker-props.d.ts +139 -0
- package/dist/components/settings-picker.d.ts +4 -138
- package/dist/components/sidebar-panels-workspace.d.ts +7 -7
- package/dist/components/sidebar-panels.d.ts +2 -3
- package/dist/components/status-bar-format.d.ts +0 -10
- package/dist/components/status-bar-icons.d.ts +0 -2
- package/dist/components/status-bar-rails-common.d.ts +1 -0
- package/dist/components/status-bar-rails.d.ts +0 -1
- package/dist/components/status-bar-types.d.ts +2 -0
- package/dist/components/status-bar.d.ts +3 -4
- package/dist/components/worktree-monitor.d.ts +8 -12
- package/dist/components/worktree-timeline-bars.d.ts +31 -0
- package/dist/heap-watchdog.d.ts +1 -1
- package/dist/hooks/use-app-pipeline-builders.d.ts +1 -0
- package/dist/hooks/use-bug-hunt-loop.d.ts +1 -0
- package/dist/hooks/use-history-viewport-sync.d.ts +4 -7
- package/dist/hooks/use-tui-slash-commands.d.ts +0 -1
- package/dist/index.js +40454 -39672
- package/dist/input-validation/action-types.d.ts +1 -2
- package/dist/input-validation/allow-lists.d.ts +0 -6
- package/dist/input-validation/terminal.d.ts +0 -13
- package/dist/key-handler-context.d.ts +1 -1
- package/dist/memory-slash-types.d.ts +1 -4
- package/dist/on-panel-open.d.ts +0 -13
- package/dist/reducers/workspace-panels.d.ts +1 -1
- package/dist/settings-contracts.d.ts +7 -0
- package/dist/submit-controller.d.ts +1 -0
- package/dist/tool-result-view-mode.d.ts +0 -2
- package/dist/topic-shift-advisor.d.ts +1 -1
- package/dist/tui-host-capabilities.d.ts +2 -1
- package/dist/ui-contracts.d.ts +2 -1
- package/dist/use-app-controller.d.ts +6 -8
- package/dist/use-controller-app-state.d.ts +13 -0
- package/dist/use-controller-auto-prompts.d.ts +14 -0
- package/dist/use-controller-commands.d.ts +51 -0
- package/dist/use-controller-confirm-auth.d.ts +20 -0
- package/dist/use-controller-environment.d.ts +112 -0
- package/dist/use-controller-input-wiring.d.ts +53 -0
- package/dist/use-controller-key-pipeline.d.ts +1 -0
- package/dist/use-controller-panel-hooks.d.ts +1 -0
- package/dist/use-controller-session-bridges.d.ts +19 -0
- package/dist/use-controller-statusline-picker.d.ts +16 -0
- package/dist/use-controller-theme-events.d.ts +31 -0
- package/dist/use-controller-theme-wiring.d.ts +25 -0
- package/package.json +7 -7
|
@@ -129,6 +129,7 @@ export type AppActionSettings = {
|
|
|
129
129
|
showSageMemoryInject: boolean;
|
|
130
130
|
sageMemoryInjectThreshold: number;
|
|
131
131
|
nextStepsTool: boolean;
|
|
132
|
+
nextStepsRequired: boolean;
|
|
132
133
|
/**
|
|
133
134
|
* WrongProxy / WrongTrace: master switch + configurable URL
|
|
134
135
|
* (default http://localhost:3444). Mirrors `Settings.wrongProxy*`
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import type { AutonomyStage } from '@wrongstack/core/types';
|
|
2
|
+
import type { WorktreeTimelineEvent } from '@wrongstack/core/types/worktree-timeline';
|
|
2
3
|
import type { SddBoardSnapshot } from '@wrongstack/sdd';
|
|
3
4
|
import type { State } from './app-state.js';
|
|
4
5
|
import type { GoalSummary } from './app-state-core-types.js';
|
|
@@ -185,6 +186,9 @@ export type AppActionWorkflows = {
|
|
|
185
186
|
} | {
|
|
186
187
|
type: 'worktreeRemove';
|
|
187
188
|
handleId: string;
|
|
189
|
+
} | {
|
|
190
|
+
type: 'worktreeTimelineEvent';
|
|
191
|
+
event: WorktreeTimelineEvent;
|
|
188
192
|
} | {
|
|
189
193
|
type: 'collabBugFound';
|
|
190
194
|
sessionId: string;
|
|
@@ -0,0 +1,116 @@
|
|
|
1
|
+
import type { Director } from '@wrongstack/core/coordination';
|
|
2
|
+
import type { StatuslineDensities, StatuslineLines, StatuslineOrder } from '@wrongstack/core/statusline';
|
|
3
|
+
import type { FleetChatVerbosity } from '@wrongstack/core/types';
|
|
4
|
+
import type { SessionInterruptController } from './hooks/use-session-interrupt-controller.js';
|
|
5
|
+
import type { AgentTranscriptReader, StatuslineItem } from './ui-contracts.js';
|
|
6
|
+
export interface TuiCoordinationProps {
|
|
7
|
+
/** Live director for fleet panel rendering. Null when director mode is off. */
|
|
8
|
+
director: Director | null;
|
|
9
|
+
/**
|
|
10
|
+
* Read the CURRENT director. Unlike the static `director` prop (captured at
|
|
11
|
+
* boot, null in non---director sessions), this sees a director the fleet
|
|
12
|
+
* host built lazily on the first delegate/spawn. Fleet teardown paths
|
|
13
|
+
* (Ctrl+C, Esc, /steer) resolve through this.
|
|
14
|
+
*/
|
|
15
|
+
getDirector?: (() => Director | null) | undefined;
|
|
16
|
+
/** Optional roster for human-readable subagent names. */
|
|
17
|
+
fleetRoster?: Record<string, {
|
|
18
|
+
name: string;
|
|
19
|
+
}> | undefined;
|
|
20
|
+
/**
|
|
21
|
+
* Shared controller for the `/fleet stream on|off` and `/agents chat`
|
|
22
|
+
* slash commands. The App installs dispatch-backed setters on mount so
|
|
23
|
+
* the commands can flip the reducer's `fleetChat` mode from the CLI
|
|
24
|
+
* surface. Also seeds the boot value of `state.fleetChat` (cli-main
|
|
25
|
+
* creates it from the persisted config).
|
|
26
|
+
*/
|
|
27
|
+
fleetStreamController?: {
|
|
28
|
+
mode: FleetChatVerbosity;
|
|
29
|
+
setMode: (mode: FleetChatVerbosity) => void;
|
|
30
|
+
} | undefined;
|
|
31
|
+
/**
|
|
32
|
+
* Read-only per-subagent transcript access for the F3 agents monitor.
|
|
33
|
+
* The CLI passes AgentMonitorService (structurally compatible); absent
|
|
34
|
+
* in embedded/test surfaces, where the detail card falls back to the
|
|
35
|
+
* streaming-tail snippet.
|
|
36
|
+
*/
|
|
37
|
+
agentTranscripts?: AgentTranscriptReader | undefined;
|
|
38
|
+
/**
|
|
39
|
+
* Shared controller for the `/interrupt` slash command. The App installs the
|
|
40
|
+
* real `abortLeader` on mount so the command can abort the in-flight leader
|
|
41
|
+
* run (slash commands don't get the RunController). The fleet teardown is the
|
|
42
|
+
* command's own `onFleetKill`.
|
|
43
|
+
*/
|
|
44
|
+
interruptController?: SessionInterruptController | undefined;
|
|
45
|
+
/**
|
|
46
|
+
* Controller for status bar hidden items. App installs a dispatch-backed
|
|
47
|
+
* setter on mount so the /statusline slash command can update the TUI's
|
|
48
|
+
* visible bar without a round-trip. The initial value is loaded from
|
|
49
|
+
* the config file before App mounts.
|
|
50
|
+
*/
|
|
51
|
+
statuslineHiddenItems: StatuslineItem[];
|
|
52
|
+
setStatuslineHiddenItems: (items: StatuslineItem[]) => void;
|
|
53
|
+
/**
|
|
54
|
+
* Atomically persists statusline hidden items to disk. Used by the
|
|
55
|
+
* statusline picker so each toggle is immediately durable.
|
|
56
|
+
*/
|
|
57
|
+
saveStatuslineHiddenItems: (items: StatuslineItem[]) => Promise<void>;
|
|
58
|
+
/**
|
|
59
|
+
* Per-chip statusline line assignment (statusline.json schema v2).
|
|
60
|
+
* Optional: hosts that don't load it keep the core contract defaults.
|
|
61
|
+
*/
|
|
62
|
+
statuslineLines?: StatuslineLines | undefined;
|
|
63
|
+
setStatuslineLines?: ((lines: StatuslineLines) => void) | undefined;
|
|
64
|
+
saveStatuslineLines?: ((lines: StatuslineLines) => Promise<void>) | undefined;
|
|
65
|
+
/**
|
|
66
|
+
* Per-chip density pin (statusline.json schema v3). Absent keys leave the
|
|
67
|
+
* chip to the rail fitter.
|
|
68
|
+
*/
|
|
69
|
+
statuslineDensities?: StatuslineDensities | undefined;
|
|
70
|
+
setStatuslineDensities?: ((densities: StatuslineDensities) => void) | undefined;
|
|
71
|
+
saveStatuslineDensities?: ((densities: StatuslineDensities) => Promise<void>) | undefined;
|
|
72
|
+
/** Custom left-to-right chip order (statusline.json schema v4). */
|
|
73
|
+
statuslineOrder?: StatuslineOrder | undefined;
|
|
74
|
+
setStatuslineOrder?: ((order: StatuslineOrder) => void) | undefined;
|
|
75
|
+
saveStatuslineOrder?: ((order: StatuslineOrder) => Promise<void>) | undefined;
|
|
76
|
+
/**
|
|
77
|
+
* Controller for the agents monitor overlay. App installs a dispatch-backed
|
|
78
|
+
* setter on mount so the `/agents on|off` slash command can toggle the
|
|
79
|
+
* overlay without a round-trip.
|
|
80
|
+
*/
|
|
81
|
+
agentsMonitorController?: {
|
|
82
|
+
visible: boolean;
|
|
83
|
+
setVisible: (visible: boolean) => void;
|
|
84
|
+
} | undefined;
|
|
85
|
+
/**
|
|
86
|
+
* Mutable ref for opening TUI panels from slash commands. The slash commands
|
|
87
|
+
* call `onPanelOpen.current(action)` to open panels. The App sets
|
|
88
|
+
* `onPanelOpen.current` to its actual dispatch function on mount.
|
|
89
|
+
*/
|
|
90
|
+
onPanelOpen?: {
|
|
91
|
+
current: ((action: string) => boolean) | null;
|
|
92
|
+
} | undefined;
|
|
93
|
+
/** Active agent mode label shown in the status bar (e.g. "teach", "brief"). */
|
|
94
|
+
modeLabel?: string | undefined;
|
|
95
|
+
/**
|
|
96
|
+
* Called ONCE on mount by the App to install its debug-stream telemetry
|
|
97
|
+
* callback. The callback receives throttled DebugStreamStats every ~200 ms
|
|
98
|
+
* while the stream debug feature is active. The App dispatches to its
|
|
99
|
+
* reducer; the StatusBar renders the stats on line 3. When omitted (headless
|
|
100
|
+
* CLI/no TTY), debug stats go to stderr via the default callback.
|
|
101
|
+
*/
|
|
102
|
+
registerDebugStreamCallback?: ((cb: (stats: {
|
|
103
|
+
chunkCount: number;
|
|
104
|
+
lastChunkSize: number;
|
|
105
|
+
lastDeltaMs: number;
|
|
106
|
+
totalBytes: number;
|
|
107
|
+
lastChunkAt: string;
|
|
108
|
+
}) => void) => void) | undefined;
|
|
109
|
+
/**
|
|
110
|
+
* Called on App unmount (via useEffect cleanup). Restores the debug-stream
|
|
111
|
+
* callback to the default stderr writer so non-TUI invocations continue to
|
|
112
|
+
* print debug lines.
|
|
113
|
+
*/
|
|
114
|
+
restoreDebugStreamCallback?: (() => void) | undefined;
|
|
115
|
+
}
|
|
116
|
+
//# sourceMappingURL=app-coordination-props.d.ts.map
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
export interface TuiEnhancementProps {
|
|
2
|
+
/**
|
|
3
|
+
* When true, free-text prompts are run through the prompt refiner
|
|
4
|
+
* ("did you mean this?") before reaching the main agent. Default on;
|
|
5
|
+
* toggled live via the `/enhance` slash command + `enhanceController`.
|
|
6
|
+
*/
|
|
7
|
+
enhanceEnabled?: boolean | undefined;
|
|
8
|
+
/**
|
|
9
|
+
* Shared controller for the `/enhance on|off` toggle. The TUI rebinds
|
|
10
|
+
* `setEnabled` on mount to a dispatch-backed setter so the slash command
|
|
11
|
+
* (handled in the CLI) flips the reducer flag. Mirrors `fleetStreamController`.
|
|
12
|
+
*/
|
|
13
|
+
enhanceController?: {
|
|
14
|
+
enabled: boolean;
|
|
15
|
+
setEnabled: (enabled: boolean) => void;
|
|
16
|
+
} | undefined;
|
|
17
|
+
/**
|
|
18
|
+
* When true (default), submitting a plain message while the agent is busy
|
|
19
|
+
* pops the send-mode picker (queue / by-the-way / steer) instead of silently
|
|
20
|
+
* queueing. Toggled live via `/queue picker on|off`; persisted to
|
|
21
|
+
* `autonomy.midRunSendPicker`.
|
|
22
|
+
*/
|
|
23
|
+
midRunSendPicker?: boolean | undefined;
|
|
24
|
+
/** Auto-send countdown (ms) for the refinement preview panel. Default 4000. */
|
|
25
|
+
enhanceDelayMs?: number | undefined;
|
|
26
|
+
/**
|
|
27
|
+
* Returns a capability-gated low-effort reasoning hint for the prompt
|
|
28
|
+
* refiner (or undefined when nothing can be safely reduced). Forwarded to
|
|
29
|
+
* `enhanceUserPrompt` so a slow reasoning model does not burn thinking
|
|
30
|
+
* tokens on this shallow rewrite. Absent → the refiner sends no reasoning
|
|
31
|
+
* field, exactly as before.
|
|
32
|
+
*/
|
|
33
|
+
getEnhancerReasoning?: ((providerId?: string, modelId?: string) => import('@wrongstack/core/types').ReasoningRequest | undefined | Promise<import('@wrongstack/core/types').ReasoningRequest | undefined>) | undefined;
|
|
34
|
+
/**
|
|
35
|
+
* Effort levels the ACTIVE model documents (models.dev reasoningConfig),
|
|
36
|
+
* for the model-aware /settings reasoning-effort cycle (WebUI parity).
|
|
37
|
+
* Undefined = vocabulary undocumented; the picker cycles the full set.
|
|
38
|
+
*/
|
|
39
|
+
getActiveModelReasoningEffortLevels?: (() => string[] | undefined) | undefined;
|
|
40
|
+
/**
|
|
41
|
+
* Build a Provider for a (providerId, modelId) pair WITHOUT switching the
|
|
42
|
+
* session — used to retry a failed refinement on the fallback/another model
|
|
43
|
+
* ephemerally. Returns undefined when the host can't build the provider
|
|
44
|
+
* (missing key, unknown id), in which case that recovery option is skipped.
|
|
45
|
+
*/
|
|
46
|
+
buildEnhancerProvider?: ((providerId: string, modelId: string) => Promise<import('@wrongstack/core/types').Provider | undefined>) | undefined;
|
|
47
|
+
/**
|
|
48
|
+
* Resolve the one-key "retry with another model" fallback ref
|
|
49
|
+
* (`provider/model`) offered on a refine failure, or undefined when none is
|
|
50
|
+
* configured/derivable. Recomputed per call so `/fallback` and `/model`
|
|
51
|
+
* changes are reflected.
|
|
52
|
+
*/
|
|
53
|
+
getEnhanceFallbackRef?: (() => string | undefined) | undefined;
|
|
54
|
+
/** Resolve the dedicated refiner target (`provider/model`) for the initial attempt. */
|
|
55
|
+
getConfiguredRefinerRef?: (() => string | undefined) | undefined;
|
|
56
|
+
}
|
|
57
|
+
//# sourceMappingURL=app-enhancement-props.d.ts.map
|
|
@@ -273,6 +273,8 @@ export type PanelState = {
|
|
|
273
273
|
sageMemoryInjectThreshold: number;
|
|
274
274
|
/** Register the leader's agent-callable `nextsteps` tool. Default: false. */
|
|
275
275
|
nextStepsTool: boolean;
|
|
276
|
+
/** Leader must end every finished turn with <nextsteps> or the completion marker (`autonomy.nextSteps: 'required'`). Default: true. */
|
|
277
|
+
nextStepsRequired: boolean;
|
|
276
278
|
/** When true, read tool includes codebase-index symbols alongside file content. */
|
|
277
279
|
readSymbols: boolean;
|
|
278
280
|
/** Prompt cache TTL. */
|
package/dist/app-props.d.ts
CHANGED
|
@@ -1,19 +1,18 @@
|
|
|
1
1
|
import type { Agent } from '@wrongstack/core/agent';
|
|
2
|
-
import type { CoordinatorEvent
|
|
2
|
+
import type { CoordinatorEvent } from '@wrongstack/core/coordination';
|
|
3
3
|
import type { EventBus } from '@wrongstack/core/kernel';
|
|
4
4
|
import type { SlashCommandRegistry } from '@wrongstack/core/registry';
|
|
5
|
-
import type { StatuslineDensities, StatuslineLines, StatuslineOrder } from '@wrongstack/core/statusline';
|
|
6
5
|
import type { QueueStore } from '@wrongstack/core/storage';
|
|
7
|
-
import type { AttachmentStore, AutonomyStage,
|
|
6
|
+
import type { AttachmentStore, AutonomyStage, Message, SkillLoader, TokenCounter, TokenSavingTier } from '@wrongstack/core/types';
|
|
8
7
|
import type { VisionAdapters } from '@wrongstack/runtime/vision';
|
|
9
8
|
import type { SddLifecycleResult, SddRunControl } from '@wrongstack/sdd';
|
|
10
9
|
import type React from 'react';
|
|
11
|
-
import type {
|
|
12
|
-
import type {
|
|
13
|
-
import type {
|
|
14
|
-
import type {
|
|
15
|
-
import type {
|
|
16
|
-
import type {
|
|
10
|
+
import type { TuiCoordinationProps } from './app-coordination-props.js';
|
|
11
|
+
import type { TuiEnhancementProps } from './app-enhancement-props.js';
|
|
12
|
+
import type { TuiSessionProps } from './app-session-props.js';
|
|
13
|
+
import type { TuiSettingsProps } from './app-settings-props.js';
|
|
14
|
+
import type { AutonomyAgentStatus } from './history-entry.js';
|
|
15
|
+
import type { ProviderOption, ResourceMenuId, ResourceMenuSnapshot } from './ui-contracts.js';
|
|
17
16
|
/**
|
|
18
17
|
* Props for the TUI `<App>` shell.
|
|
19
18
|
*
|
|
@@ -32,7 +31,7 @@ export interface TuiLeaderAutoWake {
|
|
|
32
31
|
onSessionDisplayed(sessionId: string): unknown;
|
|
33
32
|
noteUserInput(sessionId: string): void;
|
|
34
33
|
}
|
|
35
|
-
export interface AppProps {
|
|
34
|
+
export interface AppProps extends TuiCoordinationProps, TuiSessionProps, TuiSettingsProps, TuiEnhancementProps {
|
|
36
35
|
agent: Agent;
|
|
37
36
|
slashRegistry: SlashCommandRegistry;
|
|
38
37
|
/** Shared loader used by the interactive `/skill` browser. */
|
|
@@ -105,60 +104,6 @@ export interface AppProps {
|
|
|
105
104
|
* on legacy, non-TTY, or restricted-terminal environments.
|
|
106
105
|
*/
|
|
107
106
|
capability?: import('@wrongstack/core/utils').TerminalCapability | undefined;
|
|
108
|
-
/**
|
|
109
|
-
* When true, free-text prompts are run through the prompt refiner
|
|
110
|
-
* ("did you mean this?") before reaching the main agent. Default on;
|
|
111
|
-
* toggled live via the `/enhance` slash command + `enhanceController`.
|
|
112
|
-
*/
|
|
113
|
-
enhanceEnabled?: boolean | undefined;
|
|
114
|
-
/**
|
|
115
|
-
* Shared controller for the `/enhance on|off` toggle. The TUI rebinds
|
|
116
|
-
* `setEnabled` on mount to a dispatch-backed setter so the slash command
|
|
117
|
-
* (handled in the CLI) flips the reducer flag. Mirrors `fleetStreamController`.
|
|
118
|
-
*/
|
|
119
|
-
enhanceController?: {
|
|
120
|
-
enabled: boolean;
|
|
121
|
-
setEnabled: (enabled: boolean) => void;
|
|
122
|
-
} | undefined;
|
|
123
|
-
/**
|
|
124
|
-
* When true (default), submitting a plain message while the agent is busy
|
|
125
|
-
* pops the send-mode picker (queue / by-the-way / steer) instead of silently
|
|
126
|
-
* queueing. Toggled live via `/queue picker on|off`; persisted to
|
|
127
|
-
* `autonomy.midRunSendPicker`.
|
|
128
|
-
*/
|
|
129
|
-
midRunSendPicker?: boolean | undefined;
|
|
130
|
-
/** Auto-send countdown (ms) for the refinement preview panel. Default 4000. */
|
|
131
|
-
enhanceDelayMs?: number | undefined;
|
|
132
|
-
/**
|
|
133
|
-
* Returns a capability-gated low-effort reasoning hint for the prompt
|
|
134
|
-
* refiner (or undefined when nothing can be safely reduced). Forwarded to
|
|
135
|
-
* `enhanceUserPrompt` so a slow reasoning model does not burn thinking
|
|
136
|
-
* tokens on this shallow rewrite. Absent → the refiner sends no reasoning
|
|
137
|
-
* field, exactly as before.
|
|
138
|
-
*/
|
|
139
|
-
getEnhancerReasoning?: ((providerId?: string, modelId?: string) => import('@wrongstack/core/types').ReasoningRequest | undefined | Promise<import('@wrongstack/core/types').ReasoningRequest | undefined>) | undefined;
|
|
140
|
-
/**
|
|
141
|
-
* Effort levels the ACTIVE model documents (models.dev reasoningConfig),
|
|
142
|
-
* for the model-aware /settings reasoning-effort cycle (WebUI parity).
|
|
143
|
-
* Undefined = vocabulary undocumented; the picker cycles the full set.
|
|
144
|
-
*/
|
|
145
|
-
getActiveModelReasoningEffortLevels?: (() => string[] | undefined) | undefined;
|
|
146
|
-
/**
|
|
147
|
-
* Build a Provider for a (providerId, modelId) pair WITHOUT switching the
|
|
148
|
-
* session — used to retry a failed refinement on the fallback/another model
|
|
149
|
-
* ephemerally. Returns undefined when the host can't build the provider
|
|
150
|
-
* (missing key, unknown id), in which case that recovery option is skipped.
|
|
151
|
-
*/
|
|
152
|
-
buildEnhancerProvider?: ((providerId: string, modelId: string) => Promise<import('@wrongstack/core/types').Provider | undefined>) | undefined;
|
|
153
|
-
/**
|
|
154
|
-
* Resolve the one-key "retry with another model" fallback ref
|
|
155
|
-
* (`provider/model`) offered on a refine failure, or undefined when none is
|
|
156
|
-
* configured/derivable. Recomputed per call so `/fallback` and `/model`
|
|
157
|
-
* changes are reflected.
|
|
158
|
-
*/
|
|
159
|
-
getEnhanceFallbackRef?: (() => string | undefined) | undefined;
|
|
160
|
-
/** Resolve the dedicated refiner target (`provider/model`) for the initial attempt. */
|
|
161
|
-
getConfiguredRefinerRef?: (() => string | undefined) | undefined;
|
|
162
107
|
/**
|
|
163
108
|
* Query the live YOLO state from the permission policy. Called after
|
|
164
109
|
* every slash-command dispatch so `/yolo off` (which mutates the
|
|
@@ -228,99 +173,6 @@ export interface AppProps {
|
|
|
228
173
|
* Handlers receive the event name and payload from PhaseEventMap.
|
|
229
174
|
*/
|
|
230
175
|
subscribeGoal?: ((handler: (event: string, payload: unknown) => void) => () => void) | undefined;
|
|
231
|
-
/**
|
|
232
|
-
* Read the persisted autonomy settings (defaultMode, autoProceedDelayMs).
|
|
233
|
-
* Used by the SettingsPicker in the TUI on mount and after Ctrl+S toggle.
|
|
234
|
-
*/
|
|
235
|
-
/** Settings shape — shared between getSettings and saveSettings. */
|
|
236
|
-
getSettings?: (() => Settings) | undefined;
|
|
237
|
-
/**
|
|
238
|
-
* Live view over the persisted user config. The TUI uses this to:
|
|
239
|
-
* - apply `themePreset` on boot (so `/theme` choices persist across
|
|
240
|
-
* restarts), and
|
|
241
|
-
* - write `themePreset` back when the picker Enter handler fires
|
|
242
|
-
* (so the picker shows `[active]` on the right row next session).
|
|
243
|
-
*
|
|
244
|
-
* Optional for hosts that don't expose a config store (e.g. tests);
|
|
245
|
-
* when omitted the TUI stays on the default catppuccin palette and
|
|
246
|
-
* picker changes are ephemeral.
|
|
247
|
-
*/
|
|
248
|
-
configStore?: ConfigStore | undefined;
|
|
249
|
-
/**
|
|
250
|
-
* Persist settings changes. Returns null on success, or an
|
|
251
|
-
* error string on failure (so the TUI can display it as a hint).
|
|
252
|
-
*/
|
|
253
|
-
saveSettings?: ((s: Settings) => string | null | Promise<string | null>) | undefined;
|
|
254
|
-
/** Persist the active theme preset to disk so the next boot starts with it. */
|
|
255
|
-
saveThemePreset?: ((preset: import('@wrongstack/core/types').ThemePresetId) => Promise<void>) | undefined;
|
|
256
|
-
/** Load toggleable plugin rows for the interactive plugin picker. */
|
|
257
|
-
getPluginItems?: (() => PluginPickerItem[]) | undefined;
|
|
258
|
-
/** Toggle one plugin from the interactive picker and return the refreshed rows. */
|
|
259
|
-
onPluginToggle?: ((name: string) => Promise<{
|
|
260
|
-
items: PluginPickerItem[];
|
|
261
|
-
message?: string | undefined;
|
|
262
|
-
error?: string | undefined;
|
|
263
|
-
}>) | undefined;
|
|
264
|
-
/** Load MCP server rows for the interactive MCP picker. */
|
|
265
|
-
getMcpServers?: (() => McpPickerItem[]) | undefined;
|
|
266
|
-
/** Toggle one MCP server (enable/disable) from the interactive picker. */
|
|
267
|
-
onMcpToggle?: ((name: string) => Promise<{
|
|
268
|
-
items: McpPickerItem[];
|
|
269
|
-
message?: string | undefined;
|
|
270
|
-
error?: string | undefined;
|
|
271
|
-
}>) | undefined;
|
|
272
|
-
/** Restart one MCP server from the interactive picker. */
|
|
273
|
-
onMcpRestart?: ((name: string) => Promise<{
|
|
274
|
-
items: McpPickerItem[];
|
|
275
|
-
message?: string | undefined;
|
|
276
|
-
error?: string | undefined;
|
|
277
|
-
}>) | undefined;
|
|
278
|
-
/** Load tool rows for the interactive tool picker. */
|
|
279
|
-
getToolsItems?: (() => ToolPickerItem[]) | undefined;
|
|
280
|
-
/** Toggle one tool (enable/disable) from the interactive tool picker. */
|
|
281
|
-
onToolToggle?: ((name: string) => Promise<{
|
|
282
|
-
items: ToolPickerItem[];
|
|
283
|
-
message?: string | undefined;
|
|
284
|
-
error?: string | undefined;
|
|
285
|
-
}>) | undefined;
|
|
286
|
-
/** Get current brain risk level and decision log. */
|
|
287
|
-
getBrainData?: (() => {
|
|
288
|
-
riskLevel: BrainRiskLevel;
|
|
289
|
-
log: Array<{
|
|
290
|
-
kind: string;
|
|
291
|
-
question: string;
|
|
292
|
-
outcome: string;
|
|
293
|
-
age: string;
|
|
294
|
-
}>;
|
|
295
|
-
}) | undefined;
|
|
296
|
-
/** Set brain risk ceiling. */
|
|
297
|
-
onBrainRiskLevel?: ((level: BrainRiskLevel) => string | undefined) | undefined;
|
|
298
|
-
/** Full Brain settings editor bridge (live apply + persist). */
|
|
299
|
-
brainPanelHost?: import('./brain-panel-model.js').BrainPanelHost | undefined;
|
|
300
|
-
/**
|
|
301
|
-
* Session-scoped subagent model plan bridge for `/subagent-models`. The host
|
|
302
|
-
* owns the plan (it needs the session writer to journal it); the panel only
|
|
303
|
-
* reads snapshots and calls back. Absent = the panel stays unavailable and
|
|
304
|
-
* the slash command falls back to its text output.
|
|
305
|
-
*/
|
|
306
|
-
subagentModelsHost?: import('./subagent-models-panel-model.js').SubagentModelsPanelHost | undefined;
|
|
307
|
-
/** Get current Shadow Agent state. */
|
|
308
|
-
getShadowData?: (() => {
|
|
309
|
-
activeId: string | null;
|
|
310
|
-
running: boolean;
|
|
311
|
-
model: string;
|
|
312
|
-
intervalMs: number;
|
|
313
|
-
}) | undefined;
|
|
314
|
-
/** Start Shadow Agent. Returns message or error. */
|
|
315
|
-
onShadowStart?: (() => Promise<string | undefined>) | undefined;
|
|
316
|
-
/** Stop Shadow Agent. Returns message or error. */
|
|
317
|
-
onShadowStop?: (() => Promise<string | undefined>) | undefined;
|
|
318
|
-
/**
|
|
319
|
-
* Host for the interactive `/auth` panel (provider/key management, OAuth
|
|
320
|
-
* sign-in, local-server add). Provided by the CLI; when absent, `/auth`
|
|
321
|
-
* falls back to its plain-text output.
|
|
322
|
-
*/
|
|
323
|
-
authHost?: AuthPanelHost | undefined;
|
|
324
176
|
/**
|
|
325
177
|
* Predict likely next steps after a completed turn (/next). The CLI owns the
|
|
326
178
|
* gating (toggle + autonomy off) and returns [] when disabled, so the App can
|
|
@@ -452,91 +304,6 @@ export interface AppProps {
|
|
|
452
304
|
* bar. No-op outside the TUI.
|
|
453
305
|
*/
|
|
454
306
|
clearTerminal?: (() => void) | undefined;
|
|
455
|
-
/**
|
|
456
|
-
* Called when the user selects a session in the /resume picker. The host
|
|
457
|
-
* loads the session JSONL, replays history entries, rebuilds the agent
|
|
458
|
-
* context, and returns the hydrated history entries + nextId for display.
|
|
459
|
-
* Returns null when resume fails (session not found, corrupt JSONL, etc.).
|
|
460
|
-
*
|
|
461
|
-
* The returned entries replace the TUI's current entries in a single
|
|
462
|
-
* `replaceHistory` dispatch, so the user sees the prior conversation
|
|
463
|
-
* exactly as it appeared during live interaction.
|
|
464
|
-
*/
|
|
465
|
-
onResumeSession?: ((sessionId: string, onLoadProgress?: (progress: SessionLoadProgress) => void,
|
|
466
|
-
/**
|
|
467
|
-
* Live stage names as each step of the resume begins (`resolve_id`,
|
|
468
|
-
* `open_journal`, `swap_writer`, …). Drives the rolling rows of the
|
|
469
|
-
* resume loading block, so the screen reports what is actually
|
|
470
|
-
* happening instead of a spinner over an unexplained multi-second wait.
|
|
471
|
-
*/
|
|
472
|
-
onStage?: (stage: string) => void) => Promise<{
|
|
473
|
-
entries: HistoryEntry[];
|
|
474
|
-
nextId: number;
|
|
475
|
-
sessionId: string;
|
|
476
|
-
/**
|
|
477
|
-
* Optional context-window snapshot computed from the resumed
|
|
478
|
-
* session's tokenCounter after accounting the persisted usage.
|
|
479
|
-
* When present, the reducer writes `tokens` to `state.leader.ctxTokens`,
|
|
480
|
-
* `maxContext` to `state.leader.ctxMaxTokens`, and bumps
|
|
481
|
-
* `state.contextChipVersion` so the chip refreshes immediately. When
|
|
482
|
-
* absent, the chip stays at its previous value until the next ctx.pct
|
|
483
|
-
* event lands.
|
|
484
|
-
*/
|
|
485
|
-
contextSnapshot?: ContextSnapshot | undefined;
|
|
486
|
-
/**
|
|
487
|
-
* `false` when the transcript loaded but the session was NOT claimed
|
|
488
|
-
* for writing — another process owns it, or the claim lapsed. The
|
|
489
|
-
* conversation is still shown (read-only); the agent keeps writing to
|
|
490
|
-
* the session it was already in. Treated as present-but-true by hosts
|
|
491
|
-
* that predate the field.
|
|
492
|
-
*/
|
|
493
|
-
attached?: boolean | undefined;
|
|
494
|
-
/**
|
|
495
|
-
* Non-fatal problems to print alongside the replayed transcript
|
|
496
|
-
* (sidecars that did not re-point, a provider that is gone). These no
|
|
497
|
-
* longer abort a resume, so they have to be visible somewhere.
|
|
498
|
-
*/
|
|
499
|
-
warnings?: string[] | undefined;
|
|
500
|
-
/**
|
|
501
|
-
* `<nextsteps>` parsed from the resumed session's final assistant turn.
|
|
502
|
-
*
|
|
503
|
-
* OFFERED, never executed: the resume lists them and stops. Empty when
|
|
504
|
-
* the session did not end on a next-steps block, when it has open todos
|
|
505
|
-
* (the board keeps precedence), or when the transcript is read-only.
|
|
506
|
-
*/
|
|
507
|
-
nextSteps?: string[] | undefined;
|
|
508
|
-
} | null>) | undefined;
|
|
509
|
-
/**
|
|
510
|
-
* List recent session summaries for the /resume picker. The host reads
|
|
511
|
-
* from the session store and returns ResumeSessionEntry-shaped data.
|
|
512
|
-
* Used both by the /resume slash command (to populate the picker) and
|
|
513
|
-
* optionally by the startup rehydration path.
|
|
514
|
-
*/
|
|
515
|
-
listSessions?: ((limit?: number) => Promise<ResumeSessionEntry[]>) | undefined;
|
|
516
|
-
/**
|
|
517
|
-
* Branch a session at a checkpoint (the conversation before that prompt)
|
|
518
|
-
* into a new session, leaving the original as it is. Returns the new id;
|
|
519
|
-
* the TUI then resumes it. The working tree is shared, not copied.
|
|
520
|
-
*/
|
|
521
|
-
forkSession?: ((sessionId: string, checkpointPromptIndex: number) => Promise<{
|
|
522
|
-
id: string;
|
|
523
|
-
}>) | undefined;
|
|
524
|
-
/**
|
|
525
|
-
* Goal text passed from `--goal "..."` on the command line. When set,
|
|
526
|
-
* the App mounts, renders the banner, then automatically dispatches
|
|
527
|
-
* a synthetic `/goal <text>` so the user lands in goal mode without
|
|
528
|
-
* having to type the slash command. Mutually advisory with `initialSteer`
|
|
529
|
-
* — `initialGoal` wins if both are present.
|
|
530
|
-
*/
|
|
531
|
-
initialGoal?: string | undefined;
|
|
532
|
-
/**
|
|
533
|
-
* Initial user message passed from `--ask "..."` on the command line.
|
|
534
|
-
* Submitted verbatim as the first turn (no preamble) so users can
|
|
535
|
-
* launch the TUI and pre-populate one turn from a shell alias / script.
|
|
536
|
-
*/
|
|
537
|
-
initialAsk?: string | undefined;
|
|
538
|
-
/** Directory for session JSONL files. Passed to App for /rewind. */
|
|
539
|
-
sessionsDir?: string | undefined;
|
|
540
307
|
/**
|
|
541
308
|
* Load project picker items from the global manifest.
|
|
542
309
|
* Called each time the project picker panel opens (F1).
|
|
@@ -564,114 +331,6 @@ export interface AppProps {
|
|
|
564
331
|
* target project directory. Same-project sessions use onResumeSession.
|
|
565
332
|
*/
|
|
566
333
|
onSwitchToSession?: ((sessionId: string, projectRoot: string, projectName: string) => void) | undefined;
|
|
567
|
-
/** Live director for fleet panel rendering. Null when director mode is off. */
|
|
568
|
-
director: Director | null;
|
|
569
|
-
/**
|
|
570
|
-
* Read the CURRENT director. Unlike the static `director` prop (captured at
|
|
571
|
-
* boot, null in non---director sessions), this sees a director the fleet
|
|
572
|
-
* host built lazily on the first delegate/spawn. Fleet teardown paths
|
|
573
|
-
* (Ctrl+C, Esc, /steer) resolve through this.
|
|
574
|
-
*/
|
|
575
|
-
getDirector?: (() => Director | null) | undefined;
|
|
576
|
-
/** Optional roster for human-readable subagent names. */
|
|
577
|
-
fleetRoster?: Record<string, {
|
|
578
|
-
name: string;
|
|
579
|
-
}> | undefined;
|
|
580
|
-
/**
|
|
581
|
-
* Shared controller for the `/fleet stream on|off` and `/agents chat`
|
|
582
|
-
* slash commands. The App installs dispatch-backed setters on mount so
|
|
583
|
-
* the commands can flip the reducer's `fleetChat` mode from the CLI
|
|
584
|
-
* surface. Also seeds the boot value of `state.fleetChat` (cli-main
|
|
585
|
-
* creates it from the persisted config).
|
|
586
|
-
*/
|
|
587
|
-
fleetStreamController?: {
|
|
588
|
-
mode: FleetChatVerbosity;
|
|
589
|
-
setMode: (mode: FleetChatVerbosity) => void;
|
|
590
|
-
} | undefined;
|
|
591
|
-
/**
|
|
592
|
-
* Read-only per-subagent transcript access for the F3 agents monitor.
|
|
593
|
-
* The CLI passes AgentMonitorService (structurally compatible); absent
|
|
594
|
-
* in embedded/test surfaces, where the detail card falls back to the
|
|
595
|
-
* streaming-tail snippet.
|
|
596
|
-
*/
|
|
597
|
-
agentTranscripts?: AgentTranscriptReader | undefined;
|
|
598
|
-
/**
|
|
599
|
-
* Shared controller for the `/interrupt` slash command. The App installs the
|
|
600
|
-
* real `abortLeader` on mount so the command can abort the in-flight leader
|
|
601
|
-
* run (slash commands don't get the RunController). The fleet teardown is the
|
|
602
|
-
* command's own `onFleetKill`.
|
|
603
|
-
*/
|
|
604
|
-
interruptController?: SessionInterruptController | undefined;
|
|
605
|
-
/**
|
|
606
|
-
* Controller for status bar hidden items. App installs a dispatch-backed
|
|
607
|
-
* setter on mount so the /statusline slash command can update the TUI's
|
|
608
|
-
* visible bar without a round-trip. The initial value is loaded from
|
|
609
|
-
* the config file before App mounts.
|
|
610
|
-
*/
|
|
611
|
-
statuslineHiddenItems: StatuslineItem[];
|
|
612
|
-
setStatuslineHiddenItems: (items: StatuslineItem[]) => void;
|
|
613
|
-
/**
|
|
614
|
-
* Atomically persists statusline hidden items to disk. Used by the
|
|
615
|
-
* statusline picker so each toggle is immediately durable.
|
|
616
|
-
*/
|
|
617
|
-
saveStatuslineHiddenItems: (items: StatuslineItem[]) => Promise<void>;
|
|
618
|
-
/**
|
|
619
|
-
* Per-chip statusline line assignment (statusline.json schema v2).
|
|
620
|
-
* Optional: hosts that don't load it keep the core contract defaults.
|
|
621
|
-
*/
|
|
622
|
-
statuslineLines?: StatuslineLines | undefined;
|
|
623
|
-
setStatuslineLines?: ((lines: StatuslineLines) => void) | undefined;
|
|
624
|
-
saveStatuslineLines?: ((lines: StatuslineLines) => Promise<void>) | undefined;
|
|
625
|
-
/**
|
|
626
|
-
* Per-chip density pin (statusline.json schema v3). Absent keys leave the
|
|
627
|
-
* chip to the rail fitter.
|
|
628
|
-
*/
|
|
629
|
-
statuslineDensities?: StatuslineDensities | undefined;
|
|
630
|
-
setStatuslineDensities?: ((densities: StatuslineDensities) => void) | undefined;
|
|
631
|
-
saveStatuslineDensities?: ((densities: StatuslineDensities) => Promise<void>) | undefined;
|
|
632
|
-
/** Custom left-to-right chip order (statusline.json schema v4). */
|
|
633
|
-
statuslineOrder?: StatuslineOrder | undefined;
|
|
634
|
-
setStatuslineOrder?: ((order: StatuslineOrder) => void) | undefined;
|
|
635
|
-
saveStatuslineOrder?: ((order: StatuslineOrder) => Promise<void>) | undefined;
|
|
636
|
-
/**
|
|
637
|
-
* Controller for the agents monitor overlay. App installs a dispatch-backed
|
|
638
|
-
* setter on mount so the `/agents on|off` slash command can toggle the
|
|
639
|
-
* overlay without a round-trip.
|
|
640
|
-
*/
|
|
641
|
-
agentsMonitorController?: {
|
|
642
|
-
visible: boolean;
|
|
643
|
-
setVisible: (visible: boolean) => void;
|
|
644
|
-
} | undefined;
|
|
645
|
-
/**
|
|
646
|
-
* Mutable ref for opening TUI panels from slash commands. The slash commands
|
|
647
|
-
* call `onPanelOpen.current(action)` to open panels. The App sets
|
|
648
|
-
* `onPanelOpen.current` to its actual dispatch function on mount.
|
|
649
|
-
*/
|
|
650
|
-
onPanelOpen?: {
|
|
651
|
-
current: ((action: string) => boolean) | null;
|
|
652
|
-
} | undefined;
|
|
653
|
-
/** Active agent mode label shown in the status bar (e.g. "teach", "brief"). */
|
|
654
|
-
modeLabel?: string | undefined;
|
|
655
|
-
/**
|
|
656
|
-
* Called ONCE on mount by the App to install its debug-stream telemetry
|
|
657
|
-
* callback. The callback receives throttled DebugStreamStats every ~200 ms
|
|
658
|
-
* while the stream debug feature is active. The App dispatches to its
|
|
659
|
-
* reducer; the StatusBar renders the stats on line 3. When omitted (headless
|
|
660
|
-
* CLI/no TTY), debug stats go to stderr via the default callback.
|
|
661
|
-
*/
|
|
662
|
-
registerDebugStreamCallback?: ((cb: (stats: {
|
|
663
|
-
chunkCount: number;
|
|
664
|
-
lastChunkSize: number;
|
|
665
|
-
lastDeltaMs: number;
|
|
666
|
-
totalBytes: number;
|
|
667
|
-
lastChunkAt: string;
|
|
668
|
-
}) => void) => void) | undefined;
|
|
669
|
-
/**
|
|
670
|
-
* Called on App unmount (via useEffect cleanup). Restores the debug-stream
|
|
671
|
-
* callback to the default stderr writer so non-TUI invocations continue to
|
|
672
|
-
* print debug lines.
|
|
673
|
-
*/
|
|
674
|
-
restoreDebugStreamCallback?: (() => void) | undefined;
|
|
675
334
|
/**
|
|
676
335
|
* Messages restored from a previous session. When provided (non-empty),
|
|
677
336
|
* the TUI renders the prior conversation as history entries so a resumed
|