@wrongstack/tui 0.1.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.
package/LICENSE ADDED
@@ -0,0 +1,17 @@
1
+ Apache License
2
+ Version 2.0, January 2004
3
+ http://www.apache.org/licenses/
4
+
5
+ Copyright 2026 ECOSTACK TECHNOLOGY OÜ
6
+
7
+ Licensed under the Apache License, Version 2.0 (the "License");
8
+ you may not use this file except in compliance with the License.
9
+ You may obtain a copy of the License at
10
+
11
+ http://www.apache.org/licenses/LICENSE-2.0
12
+
13
+ Unless required by applicable law or agreed to in writing, software
14
+ distributed under the License is distributed on an "AS IS" BASIS,
15
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16
+ See the License for the specific language governing permissions and
17
+ limitations under the License.
@@ -0,0 +1,47 @@
1
+ import { Agent, SlashCommandRegistry, AttachmentStore, EventBus, TokenCounter, QueueStore } from '@wrongstack/core';
2
+
3
+ interface RunTuiOptions {
4
+ agent: Agent;
5
+ slashRegistry: SlashCommandRegistry;
6
+ attachments: AttachmentStore;
7
+ events: EventBus;
8
+ tokenCounter?: TokenCounter;
9
+ model: string;
10
+ banner?: boolean;
11
+ /** Persists the input queue across crashes; if omitted, the queue is in-memory only. */
12
+ queueStore?: QueueStore;
13
+ /** Surfaces the "⚠ YOLO" chip in the status bar. */
14
+ yolo?: boolean;
15
+ /** Renders in the startup banner. Read from the CLI's package.json. */
16
+ appVersion?: string;
17
+ /** Provider id for the startup banner ("openai", "anthropic", ...). */
18
+ provider?: string;
19
+ /**
20
+ * Model-specific maxContext (tokens), resolved by the CLI via the
21
+ * ModelsRegistry. When omitted, the TUI falls back to the provider
22
+ * family's baseline (e.g. anthropic = 200_000), which can be wrong
23
+ * for variants like the 1M-context Opus build. The status bar's
24
+ * context chip uses this for its progress denominator.
25
+ */
26
+ effectiveMaxContext?: number;
27
+ /**
28
+ * Render into the terminal's alternate screen buffer (like vim/less/htop).
29
+ * Default: false — we render into normal scrollback so the user can
30
+ * scroll history with the terminal's native mouse wheel / Shift+PgUp,
31
+ * and so completed chat survives after exit. Pass true to switch to
32
+ * a fixed full-screen view (no scrollback, no native scroll); useful
33
+ * when terminal redraw flicker is bad enough to outweigh the loss of
34
+ * scrollback.
35
+ */
36
+ altScreen?: boolean;
37
+ /**
38
+ * Called right after we exit the alt-screen on a clean shutdown. The
39
+ * CLI uses this to print a one-line "session saved to …" hint into
40
+ * the user's normal terminal, since alt-screen exit erases the whole
41
+ * TUI view.
42
+ */
43
+ onAfterExit?: () => void;
44
+ }
45
+ declare function runTui(opts: RunTuiOptions): Promise<number>;
46
+
47
+ export { type RunTuiOptions, runTui };