@wrongstack/tui 0.7.4 → 0.7.5
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/README.md +2 -1
- package/dist/index.d.ts +9 -0
- package/dist/index.js +27 -25
- package/dist/index.js.map +1 -1
- package/package.json +4 -4
package/README.md
CHANGED
|
@@ -71,7 +71,8 @@ process.exit(exitCode);
|
|
|
71
71
|
| `↑` / `↓` | History navigation when buffer empty |
|
|
72
72
|
| `@` | File picker |
|
|
73
73
|
| `/` (at start) | Slash command picker |
|
|
74
|
-
| `
|
|
74
|
+
| `Ctrl+Shift+M` | Toggle agents monitor overlay |
|
|
75
|
+
| `Esc` | Close any picker / dialog / agents monitor |
|
|
75
76
|
| `Ctrl+L` | Clear screen (TUI keeps state — equivalent to scrolling) |
|
|
76
77
|
|
|
77
78
|
## Options worth knowing
|
package/dist/index.d.ts
CHANGED
|
@@ -163,6 +163,15 @@ interface RunTuiOptions {
|
|
|
163
163
|
*/
|
|
164
164
|
statuslineHiddenItems: Array<'todos' | 'plan' | 'fleet' | 'git' | 'elapsed' | 'context' | 'cost'>;
|
|
165
165
|
setStatuslineHiddenItems: (items: Array<'todos' | 'plan' | 'fleet' | 'git' | 'elapsed' | 'context' | 'cost'>) => void;
|
|
166
|
+
/**
|
|
167
|
+
* Controller for the agents monitor overlay. App installs a dispatch-backed
|
|
168
|
+
* setter on mount so the `/agents on|off` slash command can toggle the
|
|
169
|
+
* overlay without a round-trip.
|
|
170
|
+
*/
|
|
171
|
+
agentsMonitorController?: {
|
|
172
|
+
visible: boolean;
|
|
173
|
+
setVisible: (visible: boolean) => void;
|
|
174
|
+
};
|
|
166
175
|
/**
|
|
167
176
|
* If set, the App boots straight into goal mode — the text is wrapped
|
|
168
177
|
* in the GOAL preamble and submitted as the first turn. Lets users
|
package/dist/index.js
CHANGED
|
@@ -3217,6 +3217,7 @@ function App({
|
|
|
3217
3217
|
fleetStreamController,
|
|
3218
3218
|
statuslineHiddenItems,
|
|
3219
3219
|
setStatuslineHiddenItems,
|
|
3220
|
+
agentsMonitorController,
|
|
3220
3221
|
initialGoal,
|
|
3221
3222
|
initialAsk,
|
|
3222
3223
|
sessionsDir
|
|
@@ -3344,10 +3345,6 @@ function App({
|
|
|
3344
3345
|
draftRef.current = { buffer: "", cursor: 0 };
|
|
3345
3346
|
dispatch({ type: "clearInput" });
|
|
3346
3347
|
};
|
|
3347
|
-
const clearPlaceholdersOnly = () => {
|
|
3348
|
-
draftRef.current = { buffer: "", cursor: 0 };
|
|
3349
|
-
dispatch({ type: "clearPlaceholdersOnly" });
|
|
3350
|
-
};
|
|
3351
3348
|
const startedAtRef = useRef(Date.now());
|
|
3352
3349
|
const [nowTick, setNowTick] = React2.useState(Date.now());
|
|
3353
3350
|
useEffect(() => {
|
|
@@ -3790,8 +3787,12 @@ function App({
|
|
|
3790
3787
|
const cmd = {
|
|
3791
3788
|
name: "agents",
|
|
3792
3789
|
description: "Toggle the agents monitor overlay.",
|
|
3793
|
-
async run() {
|
|
3794
|
-
|
|
3790
|
+
async run(args) {
|
|
3791
|
+
const arg = args.trim().toLowerCase();
|
|
3792
|
+
if (!arg || arg === "monitor") {
|
|
3793
|
+
dispatch({ type: "toggleAgentsMonitor" });
|
|
3794
|
+
return { message: void 0 };
|
|
3795
|
+
}
|
|
3795
3796
|
return { message: void 0 };
|
|
3796
3797
|
}
|
|
3797
3798
|
};
|
|
@@ -3817,23 +3818,6 @@ function App({
|
|
|
3817
3818
|
slashRegistry.unregister("model");
|
|
3818
3819
|
};
|
|
3819
3820
|
}, [slashRegistry, getPickableProviders, switchProviderAndModel]);
|
|
3820
|
-
useEffect(() => {
|
|
3821
|
-
const cmd = {
|
|
3822
|
-
name: "agents",
|
|
3823
|
-
description: "Open or close the agents monitor overlay.",
|
|
3824
|
-
async run(args) {
|
|
3825
|
-
if (args.trim().toLowerCase() === "monitor") {
|
|
3826
|
-
dispatch({ type: "toggleAgentsMonitor" });
|
|
3827
|
-
return { message: "Agents monitor toggled." };
|
|
3828
|
-
}
|
|
3829
|
-
return { message: "Usage: /agents monitor" };
|
|
3830
|
-
}
|
|
3831
|
-
};
|
|
3832
|
-
slashRegistry.register(cmd);
|
|
3833
|
-
return () => {
|
|
3834
|
-
slashRegistry.unregister("agents");
|
|
3835
|
-
};
|
|
3836
|
-
}, [slashRegistry]);
|
|
3837
3821
|
useEffect(() => {
|
|
3838
3822
|
if (!switchAutonomy) return;
|
|
3839
3823
|
const cmd = {
|
|
@@ -4169,6 +4153,23 @@ function App({
|
|
|
4169
4153
|
useEffect(() => {
|
|
4170
4154
|
if (fleetStreamController) fleetStreamController.enabled = state.streamFleet;
|
|
4171
4155
|
}, [state.streamFleet, fleetStreamController]);
|
|
4156
|
+
useEffect(() => {
|
|
4157
|
+
if (!agentsMonitorController) return;
|
|
4158
|
+
agentsMonitorController.visible = state.agentsMonitorOpen;
|
|
4159
|
+
agentsMonitorController.setVisible = (visible) => {
|
|
4160
|
+
if (visible !== state.agentsMonitorOpen) {
|
|
4161
|
+
dispatch({ type: "toggleAgentsMonitor" });
|
|
4162
|
+
}
|
|
4163
|
+
};
|
|
4164
|
+
return () => {
|
|
4165
|
+
agentsMonitorController.setVisible = (visible) => {
|
|
4166
|
+
agentsMonitorController.visible = visible;
|
|
4167
|
+
};
|
|
4168
|
+
};
|
|
4169
|
+
}, [agentsMonitorController, state.agentsMonitorOpen]);
|
|
4170
|
+
useEffect(() => {
|
|
4171
|
+
if (agentsMonitorController) agentsMonitorController.visible = state.agentsMonitorOpen;
|
|
4172
|
+
}, [state.agentsMonitorOpen, agentsMonitorController]);
|
|
4172
4173
|
const lastEscAtRef = useRef(0);
|
|
4173
4174
|
const ESC_DOUBLE_PRESS_MS = 1e3;
|
|
4174
4175
|
useEffect(() => {
|
|
@@ -4729,7 +4730,7 @@ function App({
|
|
|
4729
4730
|
dispatch({ type: "toggleMonitor" });
|
|
4730
4731
|
return;
|
|
4731
4732
|
}
|
|
4732
|
-
if (key.ctrl && key.shift
|
|
4733
|
+
if (key.ctrl && input.toLowerCase() === "m" && (key.shift || input === "m")) {
|
|
4733
4734
|
dispatch({ type: "toggleAgentsMonitor" });
|
|
4734
4735
|
return;
|
|
4735
4736
|
}
|
|
@@ -5141,7 +5142,7 @@ User message:
|
|
|
5141
5142
|
}
|
|
5142
5143
|
const pasteContent = pasteParts.length > 0 ? pasteParts.join("\n") : void 0;
|
|
5143
5144
|
pushSubmittedHistory();
|
|
5144
|
-
|
|
5145
|
+
clearDraft();
|
|
5145
5146
|
const blocks = await builder.submit();
|
|
5146
5147
|
if (state.status !== "idle") {
|
|
5147
5148
|
dispatch({
|
|
@@ -5461,6 +5462,7 @@ async function runTui(opts) {
|
|
|
5461
5462
|
fleetStreamController: opts.fleetStreamController,
|
|
5462
5463
|
statuslineHiddenItems: opts.statuslineHiddenItems,
|
|
5463
5464
|
setStatuslineHiddenItems: opts.setStatuslineHiddenItems,
|
|
5465
|
+
agentsMonitorController: opts.agentsMonitorController,
|
|
5464
5466
|
initialGoal: opts.initialGoal,
|
|
5465
5467
|
initialAsk: opts.initialAsk,
|
|
5466
5468
|
getSDDContext: opts.getSDDContext,
|