@wrongstack/tui 1.0.8 → 1.0.10
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-props.d.ts +12 -0
- package/dist/components/autonomy-picker.d.ts +10 -1
- package/dist/components/design-picker.d.ts +10 -1
- package/dist/components/resume-picker.d.ts +10 -1
- package/dist/components/status-bar-format.d.ts +1 -0
- package/dist/hooks/use-app-execution-pipeline.d.ts +1 -1
- package/dist/hooks/use-leader-auto-wake.d.ts +41 -0
- package/dist/index.js +38542 -4652
- package/dist/run-blocks-controller.d.ts +2 -2
- package/dist/run-tui-exits.d.ts +8 -2
- package/dist/run-tui-options.d.ts +6 -0
- package/dist/tui-host-capabilities.d.ts +16 -0
- package/package.json +14 -14
package/dist/app-props.d.ts
CHANGED
|
@@ -22,6 +22,16 @@ import type { AgentTranscriptReader, McpPickerItem, PluginPickerItem, ProviderOp
|
|
|
22
22
|
* own. `app.tsx` re-exports `AppProps` for consumers importing it from
|
|
23
23
|
* '@wrongstack/tui' / '../src/app.js'.
|
|
24
24
|
*/
|
|
25
|
+
/**
|
|
26
|
+
* The TUI's view of core's `LeaderAutoWakeController` (structural, so tests
|
|
27
|
+
* can pass a fake). The TUI binds a port for its foreground session.
|
|
28
|
+
*/
|
|
29
|
+
export interface TuiLeaderAutoWake {
|
|
30
|
+
attachPort(port: import('@wrongstack/core/coordination').LeaderWakePort): () => void;
|
|
31
|
+
onRunFinished(sessionId: string): unknown;
|
|
32
|
+
onSessionDisplayed(sessionId: string): unknown;
|
|
33
|
+
noteUserInput(sessionId: string): void;
|
|
34
|
+
}
|
|
25
35
|
export interface AppProps {
|
|
26
36
|
agent: Agent;
|
|
27
37
|
slashRegistry: SlashCommandRegistry;
|
|
@@ -50,6 +60,8 @@ export interface AppProps {
|
|
|
50
60
|
* awareness — see core's queued-messages.ts). Display state is unaffected.
|
|
51
61
|
*/
|
|
52
62
|
onQueueChange?: ((items: string[]) => void) | undefined;
|
|
63
|
+
/** Background-delegation auto-wake controller; see {@link TuiLeaderAutoWake}. */
|
|
64
|
+
leaderAutoWake?: TuiLeaderAutoWake | undefined;
|
|
53
65
|
/** Reflects the policy's --yolo flag for the status bar's "⚠ YOLO" chip. */
|
|
54
66
|
yolo?: boolean | undefined;
|
|
55
67
|
/** Play terminal bell when an agent run completes. */
|
|
@@ -9,7 +9,16 @@ export interface AutonomyPickerProps {
|
|
|
9
9
|
options: AutonomyOption[];
|
|
10
10
|
selected: number;
|
|
11
11
|
hint?: string | undefined;
|
|
12
|
+
/**
|
|
13
|
+
* Measured vertical budget for the whole picker box (terminal rows minus
|
|
14
|
+
* status bar, input, and margins — see `pickerMaxRows` in app-view.tsx).
|
|
15
|
+
* When provided the window math uses it instead of the
|
|
16
|
+
* `rows - shellReservedRows` guess, which under-reserves whenever the
|
|
17
|
+
* status bar or input bar grows — the same overflow class the resume
|
|
18
|
+
* panel had before it consumed this budget.
|
|
19
|
+
*/
|
|
20
|
+
maxRows?: number | undefined;
|
|
12
21
|
}
|
|
13
22
|
export declare const AUTONOMY_OPTIONS: AutonomyOption[];
|
|
14
|
-
export declare function AutonomyPicker({ options, selected, hint, }: AutonomyPickerProps): React.ReactElement;
|
|
23
|
+
export declare function AutonomyPicker({ options, selected, hint, maxRows, }: AutonomyPickerProps): React.ReactElement;
|
|
15
24
|
//# sourceMappingURL=autonomy-picker.d.ts.map
|
|
@@ -4,6 +4,15 @@ interface DesignPickerProps {
|
|
|
4
4
|
kits: DesignKitEntry[];
|
|
5
5
|
selected: number;
|
|
6
6
|
stack: string;
|
|
7
|
+
/**
|
|
8
|
+
* Measured vertical budget for the whole picker box (terminal rows minus
|
|
9
|
+
* status bar, input, and margins — see `pickerMaxRows` in app-view.tsx).
|
|
10
|
+
* When provided the window math uses it instead of the
|
|
11
|
+
* `rows - shellReservedRows` guess, which under-reserves whenever the
|
|
12
|
+
* status bar or input bar grows — the same overflow class the resume
|
|
13
|
+
* panel had before it consumed this budget.
|
|
14
|
+
*/
|
|
15
|
+
maxRows?: number | undefined;
|
|
7
16
|
}
|
|
8
17
|
/**
|
|
9
18
|
* Design Studio kit picker overlay (opened by `/design`). Presentational only —
|
|
@@ -13,6 +22,6 @@ interface DesignPickerProps {
|
|
|
13
22
|
* Windowed via {@link useWindowedPicker} so 50+ installed kits stay
|
|
14
23
|
* navigable on small terminals.
|
|
15
24
|
*/
|
|
16
|
-
export declare function DesignPicker({ kits, selected, stack }: DesignPickerProps): React.ReactElement;
|
|
25
|
+
export declare function DesignPicker({ kits, selected, stack, maxRows, }: DesignPickerProps): React.ReactElement;
|
|
17
26
|
export {};
|
|
18
27
|
//# sourceMappingURL=design-picker.d.ts.map
|
|
@@ -6,6 +6,15 @@ interface ResumePickerProps {
|
|
|
6
6
|
busy: boolean;
|
|
7
7
|
error?: string | undefined;
|
|
8
8
|
hint?: string | undefined;
|
|
9
|
+
/**
|
|
10
|
+
* Measured vertical budget for the whole picker box (terminal rows minus
|
|
11
|
+
* status bar, input, and margins — see `pickerMaxRows` in app-view.tsx).
|
|
12
|
+
* When provided the window math uses it instead of the legacy
|
|
13
|
+
* `rows - shellReservedRows` guess, which reserved less than the real
|
|
14
|
+
* status bar + input bar chrome — the resume panel could then grow past
|
|
15
|
+
* the terminal on ordinary session counts.
|
|
16
|
+
*/
|
|
17
|
+
maxRows?: number | undefined;
|
|
9
18
|
}
|
|
10
19
|
/**
|
|
11
20
|
* Interactive session-resume picker. Renders a scrollable list of recent
|
|
@@ -16,6 +25,6 @@ interface ResumePickerProps {
|
|
|
16
25
|
* three rows (title line, meta line, preview line). The window auto-recenters
|
|
17
26
|
* on the focused session so 30+ entries stay navigable on a 24-row terminal.
|
|
18
27
|
*/
|
|
19
|
-
export declare function ResumePicker({ sessions, selected, busy, error, hint, }: ResumePickerProps): React.ReactElement;
|
|
28
|
+
export declare function ResumePicker({ sessions, selected, busy, error, hint, maxRows, }: ResumePickerProps): React.ReactElement;
|
|
20
29
|
export {};
|
|
21
30
|
//# sourceMappingURL=resume-picker.d.ts.map
|
|
@@ -2,6 +2,7 @@ import type React from 'react';
|
|
|
2
2
|
/**
|
|
3
3
|
* Head-truncate a chip's free-text payload (branch, path, project name) with a
|
|
4
4
|
* trailing ellipsis so one long value can't blow out the line width.
|
|
5
|
+
* Caps on terminal columns, not UTF-16 length (CJK/emoji are 2 cells).
|
|
5
6
|
*/
|
|
6
7
|
export declare function truncateChip(text: string, max: number): string;
|
|
7
8
|
/**
|
|
@@ -17,7 +17,7 @@ export interface AppExecutionPipelineArgs {
|
|
|
17
17
|
}
|
|
18
18
|
export declare function useAppExecutionPipeline(args: AppExecutionPipelineArgs): {
|
|
19
19
|
handleKey: (input: string, key: import("../components/input.js").KeyEvent) => Promise<void>;
|
|
20
|
-
runBlocks: (blocks: import("@wrongstack/core/types").ContentBlock[]) => Promise<void>;
|
|
20
|
+
runBlocks: (blocks: import("@wrongstack/core/types").ContentBlock[], opts?: import("../tui-host-capabilities.js").RunBlocksOptions) => Promise<void>;
|
|
21
21
|
submit: (overrideRaw?: string) => Promise<void>;
|
|
22
22
|
stableOnKey: (input: string, key: import("../components/input.js").KeyEvent) => Promise<void>;
|
|
23
23
|
};
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import type { LeaderWakePort } from '@wrongstack/core/coordination';
|
|
2
|
+
import type { EventBus } from '@wrongstack/core/kernel';
|
|
3
|
+
import type { ContentBlock } from '@wrongstack/core/types';
|
|
4
|
+
import type { Action, State } from '../app-reducer.js';
|
|
5
|
+
import type { TuiLeaderAutoWake } from '../app-props.js';
|
|
6
|
+
import type { RunBlocksOptions } from '../tui-host-capabilities.js';
|
|
7
|
+
interface Cell<T> {
|
|
8
|
+
current: T;
|
|
9
|
+
}
|
|
10
|
+
export interface TuiLeaderWakePortDeps {
|
|
11
|
+
getSessionId(): string | undefined;
|
|
12
|
+
activeController: Cell<AbortController | null>;
|
|
13
|
+
eternalLoopRunning: Cell<boolean>;
|
|
14
|
+
parallelLoopRunning: Cell<boolean>;
|
|
15
|
+
enhanceAbort?: Cell<AbortController | null> | undefined;
|
|
16
|
+
state: Cell<Pick<State, 'queue' | 'confirmQueue'>>;
|
|
17
|
+
/** Open structured user-input forms (user.input_requested not yet resolved). */
|
|
18
|
+
pendingForms: Cell<number>;
|
|
19
|
+
runBlocks: Cell<(blocks: ContentBlock[], opts?: RunBlocksOptions) => Promise<void>>;
|
|
20
|
+
}
|
|
21
|
+
/**
|
|
22
|
+
* The foreground TUI's wake port. The TUI shows exactly one session — the
|
|
23
|
+
* agent's current one — so open and displayed both mean "is that session".
|
|
24
|
+
* Idle is the race-free busy signal `runBlocks` itself uses (the controller
|
|
25
|
+
* cell), plus the autonomy loop drivers that call the engine directly.
|
|
26
|
+
*/
|
|
27
|
+
export declare function createTuiLeaderWakePort(deps: TuiLeaderWakePortDeps): LeaderWakePort;
|
|
28
|
+
export interface UseLeaderAutoWakeArgs extends Omit<TuiLeaderWakePortDeps, 'pendingForms'> {
|
|
29
|
+
leaderAutoWake?: TuiLeaderAutoWake | undefined;
|
|
30
|
+
events: EventBus;
|
|
31
|
+
dispatch(action: Action): void;
|
|
32
|
+
}
|
|
33
|
+
/**
|
|
34
|
+
* Bind the auto-wake controller to the foreground TUI session and surface its
|
|
35
|
+
* activity in history: a notice line when a wake fires (the turn's own
|
|
36
|
+
* turn-summary line carries its token/cost), and a warning when the chain cap
|
|
37
|
+
* holds results until the user sends a message.
|
|
38
|
+
*/
|
|
39
|
+
export declare function useLeaderAutoWake(args: UseLeaderAutoWakeArgs): void;
|
|
40
|
+
export {};
|
|
41
|
+
//# sourceMappingURL=use-leader-auto-wake.d.ts.map
|