@wrongstack/tui 1.0.35 → 1.0.36
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-settings-props.d.ts +6 -0
- package/dist/index.js +28 -12
- package/dist/run-tui-options.d.ts +6 -0
- package/package.json +9 -9
|
@@ -10,6 +10,12 @@ export interface TuiSettingsProps {
|
|
|
10
10
|
*/
|
|
11
11
|
/** Settings shape — shared between getSettings and saveSettings. */
|
|
12
12
|
getSettings?: (() => Settings) | undefined;
|
|
13
|
+
/**
|
|
14
|
+
* The leader's own effort override (`leader_effort_set`), while it is in
|
|
15
|
+
* force. Display-only: kept apart from `getSettings` so the settings picker
|
|
16
|
+
* never reads — and on save persists — the leader's choice as the user's.
|
|
17
|
+
*/
|
|
18
|
+
getLeaderEffort?: (() => string | undefined) | undefined;
|
|
13
19
|
/**
|
|
14
20
|
* Live view over the persisted user config. The TUI uses this to:
|
|
15
21
|
* - apply `themePreset` on boot (so `/theme` choices persist across
|
package/dist/index.js
CHANGED
|
@@ -47150,6 +47150,9 @@ function mergeComposerOwnedChips(hiddenItems) {
|
|
|
47150
47150
|
for (const chip of COMPOSER_OWNED_CHIPS) merged.add(chip);
|
|
47151
47151
|
return [...merged];
|
|
47152
47152
|
}
|
|
47153
|
+
function leaderEffortLabel(effort) {
|
|
47154
|
+
return effort ? `${effort} (leader)` : void 0;
|
|
47155
|
+
}
|
|
47153
47156
|
function AppStatusRegion({
|
|
47154
47157
|
host,
|
|
47155
47158
|
runtime,
|
|
@@ -47168,6 +47171,7 @@ function AppStatusRegion({
|
|
|
47168
47171
|
fleetRoster,
|
|
47169
47172
|
getModeLabel,
|
|
47170
47173
|
getSettings,
|
|
47174
|
+
getLeaderEffort,
|
|
47171
47175
|
onCoordinatorStart,
|
|
47172
47176
|
onCoordinatorStop,
|
|
47173
47177
|
tokenCounter,
|
|
@@ -47248,7 +47252,7 @@ function AppStatusRegion({
|
|
|
47248
47252
|
{
|
|
47249
47253
|
provider: liveProvider,
|
|
47250
47254
|
model: liveModel,
|
|
47251
|
-
effort: getSettings ? state.settingsPicker.open ? state.settingsPicker.reasoningEffort : getSettings().reasoningEffort : void 0,
|
|
47255
|
+
effort: getSettings ? state.settingsPicker.open ? state.settingsPicker.reasoningEffort : leaderEffortLabel(getLeaderEffort?.()) ?? getSettings().reasoningEffort : void 0,
|
|
47252
47256
|
version: appVersion,
|
|
47253
47257
|
latestVersion,
|
|
47254
47258
|
updateAvailable,
|
|
@@ -47859,7 +47863,7 @@ function ClearConfirmPanel({
|
|
|
47859
47863
|
|
|
47860
47864
|
// src/components/confirm-prompt.tsx
|
|
47861
47865
|
var import_react63 = __toESM(require_react(), 1);
|
|
47862
|
-
import { unifiedDiff, writeOut } from "@wrongstack/core/utils";
|
|
47866
|
+
import { sanitizeTerminalText as sanitizeTerminalText2, unifiedDiff, writeOut } from "@wrongstack/core/utils";
|
|
47863
47867
|
|
|
47864
47868
|
// src/highlight.ts
|
|
47865
47869
|
var C = {
|
|
@@ -50556,15 +50560,23 @@ function countUnifiedDiffChanges(diff2) {
|
|
|
50556
50560
|
let removed = 0;
|
|
50557
50561
|
let lineStart = 0;
|
|
50558
50562
|
const startsWithAny = (prefixes, end) => prefixes.find((p) => end - lineStart >= p.length && diff2.startsWith(p, lineStart));
|
|
50563
|
+
let sawHunk = !/^@@/m.test(diff2);
|
|
50564
|
+
let skipHeaderPlus = false;
|
|
50559
50565
|
const processLine = (end) => {
|
|
50560
50566
|
const found = startsWithAny(["diff --git ", "@@"], end);
|
|
50561
50567
|
if (found === "diff --git ") {
|
|
50562
50568
|
} else if (found === "@@") {
|
|
50563
|
-
|
|
50569
|
+
sawHunk = true;
|
|
50570
|
+
} else if (skipHeaderPlus) {
|
|
50571
|
+
skipHeaderPlus = false;
|
|
50572
|
+
} else if (sawHunk) {
|
|
50573
|
+
if (startsWithAny(["--- "], end) && diff2.startsWith("+++ ", end + 1)) {
|
|
50574
|
+
skipHeaderPlus = true;
|
|
50575
|
+
return;
|
|
50576
|
+
}
|
|
50564
50577
|
const first = diff2.charCodeAt(lineStart);
|
|
50565
|
-
|
|
50566
|
-
if (
|
|
50567
|
-
else if (!fileHeader && first === 45) removed++;
|
|
50578
|
+
if (first === 43) added++;
|
|
50579
|
+
else if (first === 45) removed++;
|
|
50568
50580
|
}
|
|
50569
50581
|
};
|
|
50570
50582
|
for (let index = 0; index < diff2.length; index++) {
|
|
@@ -51232,7 +51244,7 @@ function ConfirmPrompt({
|
|
|
51232
51244
|
decide("deny");
|
|
51233
51245
|
}
|
|
51234
51246
|
});
|
|
51235
|
-
const inputSummary = stringifyInput(input);
|
|
51247
|
+
const inputSummary = sanitizeTerminalText2(stringifyInput(input));
|
|
51236
51248
|
const inp = input;
|
|
51237
51249
|
const diff2 = payloadDiff(input);
|
|
51238
51250
|
const diffPath = typeof inp?.path === "string" ? inp.path : void 0;
|
|
@@ -51264,8 +51276,9 @@ function ConfirmPrompt({
|
|
|
51264
51276
|
boundaryReason
|
|
51265
51277
|
] }) : null,
|
|
51266
51278
|
writeTargets && writeTargets.length > 0 ? /* @__PURE__ */ (0, import_jsx_runtime47.jsxs)(Text2, { color: "yellow", children: [
|
|
51267
|
-
"WRITES:
|
|
51268
|
-
|
|
51279
|
+
"WRITES:",
|
|
51280
|
+
" ",
|
|
51281
|
+
writeTargets.slice(0, 5).map((target) => sanitizeTerminalText2(target)).join(", "),
|
|
51269
51282
|
writeTargets.length > 5 ? ` (+${writeTargets.length - 5} more)` : ""
|
|
51270
51283
|
] }) : null,
|
|
51271
51284
|
diff2 ? /* @__PURE__ */ (0, import_jsx_runtime47.jsx)(Box2, { flexDirection: "column", marginY: 1, children: renderDiff(diff2, diffPath) }) : null,
|
|
@@ -81684,8 +81697,8 @@ async function routeInputKey(host, input, key2) {
|
|
|
81684
81697
|
host.nextSteps.setCountdown(null);
|
|
81685
81698
|
host.nextSteps.setLabel(null);
|
|
81686
81699
|
host.nextSteps.suggestion.current = null;
|
|
81687
|
-
const
|
|
81688
|
-
if (
|
|
81700
|
+
const text2 = pending.trim();
|
|
81701
|
+
if (text2) host.setDraft(text2, text2.length);
|
|
81689
81702
|
}
|
|
81690
81703
|
return true;
|
|
81691
81704
|
}
|
|
@@ -81865,8 +81878,10 @@ async function routeInputKey(host, input, key2) {
|
|
|
81865
81878
|
await host.commitPaste(input);
|
|
81866
81879
|
return true;
|
|
81867
81880
|
}
|
|
81881
|
+
const text = sanitizeTerminalText(input);
|
|
81882
|
+
if (!text) return true;
|
|
81868
81883
|
host.nextSteps.cancel();
|
|
81869
|
-
host.setDraft(buffer.slice(0, cursor) +
|
|
81884
|
+
host.setDraft(buffer.slice(0, cursor) + text + buffer.slice(cursor), cursor + text.length);
|
|
81870
81885
|
return true;
|
|
81871
81886
|
}
|
|
81872
81887
|
|
|
@@ -93064,6 +93079,7 @@ async function runTui(opts) {
|
|
|
93064
93079
|
sessionsDir: opts.sessionsDir,
|
|
93065
93080
|
projectRoot: opts.projectRoot,
|
|
93066
93081
|
getSettings: opts.getSettings,
|
|
93082
|
+
getLeaderEffort: opts.getLeaderEffort,
|
|
93067
93083
|
saveSettings: opts.saveSettings,
|
|
93068
93084
|
saveThemePreset: opts.saveThemePreset,
|
|
93069
93085
|
configStore: opts.configStore,
|
|
@@ -387,6 +387,12 @@ export interface RunTuiOptions {
|
|
|
387
387
|
* Used by the SettingsPicker in the TUI on mount and after Ctrl+S toggle.
|
|
388
388
|
*/
|
|
389
389
|
getSettings?: (() => import('./app-state.js').Settings) | undefined;
|
|
390
|
+
/**
|
|
391
|
+
* The leader's own effort override (`leader_effort_set`), while it is in
|
|
392
|
+
* force. Display-only: kept apart from `getSettings` so the settings picker
|
|
393
|
+
* never reads — and on save persists — the leader's choice as the user's.
|
|
394
|
+
*/
|
|
395
|
+
getLeaderEffort?: (() => string | undefined) | undefined;
|
|
390
396
|
/**
|
|
391
397
|
* Persist settings changes. Returns null on success, or an
|
|
392
398
|
* error string on failure (so the TUI can display it as a hint).
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@wrongstack/tui",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.36",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"description": "WrongStack terminal UI: Ink-based interactive renderer with history, pickers, and slash menus.",
|
|
6
6
|
"repository": {
|
|
@@ -26,12 +26,12 @@
|
|
|
26
26
|
"!dist/**/*.map"
|
|
27
27
|
],
|
|
28
28
|
"dependencies": {
|
|
29
|
-
"@wrongstack/core": "1.0.
|
|
30
|
-
"@wrongstack/kanban": "1.0.
|
|
31
|
-
"@wrongstack/runtime": "1.0.
|
|
32
|
-
"@wrongstack/sage": "1.0.
|
|
33
|
-
"@wrongstack/sdd": "1.0.
|
|
34
|
-
"@wrongstack/tools": "1.0.
|
|
29
|
+
"@wrongstack/core": "1.0.36",
|
|
30
|
+
"@wrongstack/kanban": "1.0.36",
|
|
31
|
+
"@wrongstack/runtime": "1.0.36",
|
|
32
|
+
"@wrongstack/sage": "1.0.36",
|
|
33
|
+
"@wrongstack/sdd": "1.0.36",
|
|
34
|
+
"@wrongstack/tools": "1.0.36",
|
|
35
35
|
"string-width": "8.2.2",
|
|
36
36
|
"wrap-ansi": "^10.0.1"
|
|
37
37
|
},
|
|
@@ -57,8 +57,8 @@
|
|
|
57
57
|
"test:status-bar": "vitest run --config vitest.status-bar-sgr.config.ts",
|
|
58
58
|
"test:watch": "vitest --config vitest.config.ts",
|
|
59
59
|
"test:coverage": "vitest run --coverage --config vitest.config.ts",
|
|
60
|
-
"typecheck": "
|
|
61
|
-
"typecheck:tests": "
|
|
60
|
+
"typecheck": "node ../../scripts/bun-typecheck.mjs --noEmit && node ../../scripts/bun-typecheck.mjs --noEmit -p tsconfig.test.json",
|
|
61
|
+
"typecheck:tests": "node ../../scripts/bun-typecheck.mjs --noEmit -p tsconfig.test.json",
|
|
62
62
|
"clean": "node -e \"require('node:fs').rmSync('dist',{recursive:true,force:true})\""
|
|
63
63
|
}
|
|
64
64
|
}
|