@wrongstack/tui 0.256.1 → 0.257.2

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/index.d.ts CHANGED
@@ -297,6 +297,10 @@ interface RunTuiOptions {
297
297
  type: 'clearHistory';
298
298
  } | {
299
299
  type: 'resetContextChip';
300
+ } | {
301
+ type: 'streamReset';
302
+ } | {
303
+ type: 'toolStreamClear';
300
304
  }>) => void) | undefined;
301
305
  /**
302
306
  * Live director instance. When set, the TUI renders a fleet panel
@@ -430,6 +434,15 @@ interface RunTuiOptions {
430
434
  * Used by the TUI to display and auto-submit next steps in 'auto' mode.
431
435
  */
432
436
  getSuggestions?: (() => string[]) | undefined;
437
+ /**
438
+ * Retrieve current auto suggestions (items with auto="true" attribute).
439
+ * Used by YOLO+auto mode for automatic next-step submission.
440
+ */
441
+ getAutoSuggestions?: (() => string[]) | undefined;
442
+ /**
443
+ * Autonomy next prompt template for YOLO+auto mode. Contains {{suggestion}} placeholder.
444
+ */
445
+ autonomyNextPrompt?: string | undefined;
433
446
  /**
434
447
  * Write parsed next steps into the shared suggestion store.
435
448
  * Called by the Entry component after parsing each assistant message
@@ -574,6 +587,8 @@ declare function replaySessionEvents(events: SessionEvent[], startId: number): H
574
587
  interface ParsedNextStep {
575
588
  index: number;
576
589
  text: string;
590
+ /** Whether this item has auto="true" attribute for YOLO+auto autonomy mode. */
591
+ auto?: boolean;
577
592
  }
578
593
  interface ParseNextStepsResult {
579
594
  /** Matched steps with their original index and stripped text. */
@@ -585,6 +600,8 @@ interface ParseNextStepsResult {
585
600
  * Used by entry.tsx to strip suggestions from the rendered message body.
586
601
  */
587
602
  stripped: string;
603
+ /** Flat string array — texts of items with auto="true" attribute only. */
604
+ autoTexts: string[];
588
605
  }
589
606
  /**
590
607
  * Parse "<next_steps>" or "💡 Next steps" blocks from assistant output (or raw numbered lines).
package/dist/index.js CHANGED
@@ -1,4 +1,4 @@
1
- import { writeErr, resolveProjectDir, wstackGlobalRoot, GlobalMailbox, resolveWstackPaths, loadGoal, InputBuilder, DefaultSessionRewinder, writeOut, formatTodosList, buildGoalPreamble, expectDefined as expectDefined$1, shouldEnhance, enhanceUserPrompt, recentTextTurns, normalizedEqual, buildChildEnv } from '@wrongstack/core';
1
+ import { writeErr, resolveProjectDir, wstackGlobalRoot, GlobalMailbox, resolveWstackPaths, loadGoal, InputBuilder, DefaultSessionRewinder, writeOut, formatTodosList, buildGoalPreamble, expectDefined as expectDefined$1, shouldEnhance, enhanceUserPrompt, recentTextTurns, normalizedEqual, truncate, buildChildEnv } from '@wrongstack/core';
2
2
  export { buildGoalPreamble } from '@wrongstack/core';
3
3
  import { Box as Box$1, useInput, useStdin, useStdout, Text as Text$1, render, useApp, measureElement, Static } from 'ink';
4
4
  import { randomUUID } from 'crypto';
@@ -126,6 +126,10 @@ function modeIcon(label) {
126
126
  const icon = MODE_ICONS[label] ?? "\u25AA";
127
127
  return `${icon} ${label}`;
128
128
  }
129
+ function truncateLabel(label, maxWidth) {
130
+ const stripped = label.replace(/^\/next\s+[\d\s]+\s*/, "");
131
+ return truncate(stripped, maxWidth);
132
+ }
129
133
  var COMPACT_THRESHOLD = 50;
130
134
  var COMFORTABLE_THRESHOLD = 90;
131
135
  var SPINNER_FRAMES = ["\u280B", "\u2819", "\u2839", "\u2838", "\u283C", "\u2834", "\u2826", "\u2827", "\u2807", "\u280F"];
@@ -161,6 +165,7 @@ function StatusBar({
161
165
  debugStreamStats,
162
166
  enhanceCountdown,
163
167
  nextStepsAutoSubmitCountdown,
168
+ nextStepsAutoSubmitLabel,
164
169
  autoProceedCountdown,
165
170
  sessionCount,
166
171
  mailbox,
@@ -578,7 +583,9 @@ function StatusBar({
578
583
  hasNextStepsAutoSubmit && nextStepsAutoSubmitCountdown != null ? /* @__PURE__ */ jsxs(Fragment, { children: [
579
584
  todos && (todos.pending > 0 || todos.inProgress > 0 || todos.completed > 0) || plan && (plan.open > 0 || plan.inProgress > 0 || plan.done > 0) || fleetHasActivity || hasBrainActivity || hasDebugStream || hasEnhanceCountdown ? /* @__PURE__ */ jsx(Text, { dimColor: true, children: "\u2502" }) : null,
580
585
  /* @__PURE__ */ jsxs(Text, { color: nextStepsAutoSubmitCountdown <= 3 ? "yellow" : "cyan", children: [
581
- "\u23F3 next step in ",
586
+ "\u23F3 ",
587
+ nextStepsAutoSubmitLabel ? truncateLabel(nextStepsAutoSubmitLabel, 30) : "next step",
588
+ " in ",
582
589
  nextStepsAutoSubmitCountdown,
583
590
  "s"
584
591
  ] })
@@ -1557,9 +1564,9 @@ function buttonLabels(suggestedPattern) {
1557
1564
  function stringifyInput(input) {
1558
1565
  if (!input || typeof input !== "object") return "";
1559
1566
  const obj = input;
1560
- return Object.entries(obj).filter(([k]) => k !== "content" && k !== "new_string").map(([k, v]) => `${k}: ${truncate(JSON.stringify(v), 80)}`).join(" ");
1567
+ return Object.entries(obj).filter(([k]) => k !== "content" && k !== "new_string").map(([k, v]) => `${k}: ${truncate2(JSON.stringify(v), 80)}`).join(" ");
1561
1568
  }
1562
- function truncate(s2, max) {
1569
+ function truncate2(s2, max) {
1563
1570
  return s2.length <= max ? s2 : `${s2.slice(0, max - 1)}\u2026`;
1564
1571
  }
1565
1572
  function hasDiff(input) {
@@ -2850,18 +2857,20 @@ var QUOTE_RE = /^>\s?(.*)$/;
2850
2857
  function MarkdownView({
2851
2858
  text,
2852
2859
  termWidth,
2853
- contentWidth
2860
+ contentWidth,
2861
+ tableWidth
2854
2862
  }) {
2855
2863
  const lines = text.split("\n");
2856
2864
  const rows = [];
2857
2865
  let i = 0;
2858
2866
  let key = 0;
2859
- const tableBudget = Math.max(20, contentWidth ?? termWidth);
2867
+ const tableBudget = Math.max(20, tableWidth ?? contentWidth ?? termWidth);
2860
2868
  while (i < lines.length) {
2861
2869
  const tableEnd = detectTable(lines, i);
2862
2870
  if (tableEnd > i) {
2871
+ const tableText = renderTable(lines.slice(i, tableEnd), tableBudget);
2863
2872
  rows.push(
2864
- /* @__PURE__ */ jsx(Box, { width: tableBudget, backgroundColor: "transparent", children: /* @__PURE__ */ jsx(Text, { children: renderTable(lines.slice(i, tableEnd), tableBudget) }) }, `t${key++}`)
2873
+ /* @__PURE__ */ jsx(Box, { width: tableBudget, backgroundColor: "transparent", children: /* @__PURE__ */ jsx(Text, { children: tableText }) }, `t${key++}`)
2865
2874
  );
2866
2875
  i = tableEnd;
2867
2876
  continue;
@@ -2926,7 +2935,7 @@ function MarkdownView({
2926
2935
  }
2927
2936
  rows.push(/* @__PURE__ */ jsx(InlineLine, { tokens: parseInline(line) }, `p${key++}`));
2928
2937
  }
2929
- return /* @__PURE__ */ jsx(Box, { flexDirection: "column", children: rows });
2938
+ return /* @__PURE__ */ jsx(Box, { flexDirection: "column", width: Math.max(20, tableBudget), children: rows });
2930
2939
  }
2931
2940
  function shortenPath(p, max) {
2932
2941
  if (p.length <= max) return p;
@@ -3683,9 +3692,8 @@ function extractDiffPreview(toolName, output) {
3683
3692
  return parseUnifiedDiff(diff, DIFF_MAX_LINES);
3684
3693
  }
3685
3694
  var MESSAGE_PANEL_CHROME_WIDTH = 2;
3686
- var MESSAGE_PANEL_MARGIN = 2;
3687
3695
  function assistantContentWidth(termWidth) {
3688
- return Math.max(20, termWidth - MESSAGE_PANEL_CHROME_WIDTH - MESSAGE_PANEL_MARGIN * 2);
3696
+ return Math.max(20, termWidth - MESSAGE_PANEL_CHROME_WIDTH);
3689
3697
  }
3690
3698
  function splitFencedBlocks(text) {
3691
3699
  const lines = text.split("\n");
@@ -3733,7 +3741,15 @@ function AssistantBody({
3733
3741
  /* @__PURE__ */ jsx(CodeBlock, { code: seg.text, lang: seg.lang ?? "plain", contentWidth: inner }, i)
3734
3742
  ) : (
3735
3743
  // biome-ignore lint/suspicious/noArrayIndexKey: segment order is stable
3736
- /* @__PURE__ */ jsx(MarkdownView, { text: seg.text, termWidth: inner }, i)
3744
+ /* @__PURE__ */ jsx(
3745
+ MarkdownView,
3746
+ {
3747
+ text: seg.text,
3748
+ termWidth: inner,
3749
+ tableWidth: termWidth - MESSAGE_PANEL_CHROME_WIDTH
3750
+ },
3751
+ i
3752
+ )
3737
3753
  )
3738
3754
  ) });
3739
3755
  }
@@ -3826,7 +3842,7 @@ var PERMISSIVE_HEADING_PATTERNS = [
3826
3842
  { re: /\n{1,2}Next steps?\s*\n+/i, label: "plain" },
3827
3843
  { re: /<next_steps>\s*\n+/i, label: "xml-tag" }
3828
3844
  ];
3829
- var ITEM_RE = /^(?:(\d+)[.)]\s*|[-*•]\s*)(.+)$/;
3845
+ var ITEM_RE = /^(?:(\d+)[.)]\s*|[-*•]\s*)(.+?)(\s+auto="true")?$/;
3830
3846
  var MAX_STEPS = 6;
3831
3847
  function parseNextSteps(content, strict = false, requireHeading = true) {
3832
3848
  if (requireHeading) {
@@ -3845,6 +3861,7 @@ function parseRawNumbered(content) {
3845
3861
  if (!m) continue;
3846
3862
  const numPart = m[1];
3847
3863
  let text = m[2].trim();
3864
+ const hasAuto = !!m[3];
3848
3865
  let index;
3849
3866
  if (numPart !== void 0) {
3850
3867
  index = Number.parseInt(numPart, 10);
@@ -3854,16 +3871,21 @@ function parseRawNumbered(content) {
3854
3871
  if (seenNumbers.has(index)) continue;
3855
3872
  if (text.length < 3) continue;
3856
3873
  seenNumbers.add(index);
3857
- steps.push({ index, text });
3874
+ steps.push({ index, text, auto: hasAuto });
3858
3875
  if (steps.length >= MAX_STEPS) break;
3859
3876
  }
3860
- return { steps, texts: steps.map((s2) => s2.text), stripped: content };
3877
+ return {
3878
+ steps,
3879
+ texts: steps.map((s2) => s2.text),
3880
+ stripped: content,
3881
+ autoTexts: steps.filter((s2) => s2.auto).map((s2) => s2.text)
3882
+ };
3861
3883
  }
3862
3884
  function parseWithHeading(content, strict) {
3863
3885
  const headingRe = strict ? STRICT_HEADING_RE : buildPermissiveHeadingRe();
3864
3886
  const headingMatch = headingRe.exec(content);
3865
3887
  if (!headingMatch) {
3866
- return { steps: [], texts: [], stripped: content };
3888
+ return { steps: [], texts: [], stripped: content, autoTexts: [] };
3867
3889
  }
3868
3890
  const headingEnd = headingMatch.index + headingMatch[0].length;
3869
3891
  const afterHeading = content.slice(headingEnd);
@@ -3877,6 +3899,7 @@ function parseWithHeading(content, strict) {
3877
3899
  if (!m) break;
3878
3900
  const numPart = m[1];
3879
3901
  let text = m[2].trim();
3902
+ const hasAuto = !!m[3];
3880
3903
  let index;
3881
3904
  if (numPart !== void 0) {
3882
3905
  index = Number.parseInt(numPart, 10);
@@ -3886,17 +3909,18 @@ function parseWithHeading(content, strict) {
3886
3909
  if (seenNumbers.has(index)) continue;
3887
3910
  if (text.length < 3) continue;
3888
3911
  seenNumbers.add(index);
3889
- steps.push({ index, text });
3912
+ steps.push({ index, text, auto: hasAuto });
3890
3913
  if (steps.length >= MAX_STEPS) break;
3891
3914
  }
3892
3915
  if (steps.length === 0) {
3893
- return { steps: [], texts: [], stripped: content };
3916
+ return { steps: [], texts: [], stripped: content, autoTexts: [] };
3894
3917
  }
3895
3918
  const texts = steps.map((s2) => s2.text);
3919
+ const autoTexts = steps.filter((s2) => s2.auto).map((s2) => s2.text);
3896
3920
  const blockStart = headingMatch.index;
3897
3921
  const blockEnd = headingEnd + findBlockEnd(afterHeading, steps.length);
3898
3922
  const stripped = (content.slice(0, blockStart) + content.slice(blockStart + blockEnd)).replace(/\n{3,}/g, "\n\n").trim();
3899
- return { steps, texts, stripped };
3923
+ return { steps, texts, stripped, autoTexts };
3900
3924
  }
3901
3925
  function buildPermissiveHeadingRe() {
3902
3926
  const variants = PERMISSIVE_HEADING_PATTERNS.map(({ re }) => `(?:${re.source})`).join("|");
@@ -3970,13 +3994,12 @@ var Entry = React5.memo(function Entry2({
3970
3994
  return /* @__PURE__ */ jsx(
3971
3995
  Box,
3972
3996
  {
3973
- marginX: MESSAGE_PANEL_MARGIN,
3997
+ marginX: 0,
3974
3998
  borderStyle: "single",
3975
3999
  borderTop: false,
3976
4000
  borderRight: false,
3977
4001
  borderBottom: false,
3978
4002
  borderColor: theme.user,
3979
- backgroundColor: "#1e1e2e",
3980
4003
  paddingLeft: 1,
3981
4004
  children: /* @__PURE__ */ jsxs(Text, { children: [
3982
4005
  /* @__PURE__ */ jsx(Text, { bold: true, color: theme.user, children: "USER " }),
@@ -4001,14 +4024,13 @@ var Entry = React5.memo(function Entry2({
4001
4024
  Box,
4002
4025
  {
4003
4026
  flexDirection: "column",
4004
- marginX: MESSAGE_PANEL_MARGIN,
4027
+ marginX: 0,
4005
4028
  marginY: 1,
4006
4029
  borderStyle: "single",
4007
4030
  borderTop: false,
4008
4031
  borderRight: false,
4009
4032
  borderBottom: false,
4010
4033
  borderColor: theme.assistant,
4011
- backgroundColor: "#1e1e2e",
4012
4034
  paddingLeft: 1,
4013
4035
  children: [
4014
4036
  /* @__PURE__ */ jsx(Box, { flexDirection: "row", children: /* @__PURE__ */ jsx(Text, { bold: true, color: theme.assistant, children: "ASSISTANT" }) }),
@@ -4020,7 +4042,7 @@ var Entry = React5.memo(function Entry2({
4020
4042
  Box,
4021
4043
  {
4022
4044
  flexDirection: "column",
4023
- marginX: MESSAGE_PANEL_MARGIN,
4045
+ marginX: 0,
4024
4046
  marginY: 1,
4025
4047
  borderStyle: "single",
4026
4048
  borderTop: false,
@@ -4035,7 +4057,8 @@ var Entry = React5.memo(function Entry2({
4035
4057
  ] }),
4036
4058
  steps.map((s2) => /* @__PURE__ */ jsx(Box, { flexDirection: "row", marginTop: 0, children: /* @__PURE__ */ jsxs(Text, { children: [
4037
4059
  /* @__PURE__ */ jsx(Text, { bold: true, color: theme.accent, children: ` ${s2.index}. ` }),
4038
- /* @__PURE__ */ jsx(Text, { children: s2.text })
4060
+ /* @__PURE__ */ jsx(Text, { children: s2.text }),
4061
+ s2.auto ? /* @__PURE__ */ jsx(Text, { color: "cyan", dimColor: true, children: " auto" }) : null
4039
4062
  ] }) }, s2.index))
4040
4063
  ]
4041
4064
  }
@@ -4103,7 +4126,7 @@ var Entry = React5.memo(function Entry2({
4103
4126
  return /* @__PURE__ */ jsx(
4104
4127
  Box,
4105
4128
  {
4106
- marginX: MESSAGE_PANEL_MARGIN,
4129
+ marginX: 0,
4107
4130
  borderStyle: "single",
4108
4131
  borderTop: false,
4109
4132
  borderRight: false,
@@ -4117,7 +4140,7 @@ var Entry = React5.memo(function Entry2({
4117
4140
  return /* @__PURE__ */ jsx(
4118
4141
  Box,
4119
4142
  {
4120
- marginX: MESSAGE_PANEL_MARGIN,
4143
+ marginX: 0,
4121
4144
  borderStyle: "single",
4122
4145
  borderTop: false,
4123
4146
  borderRight: false,
@@ -4136,7 +4159,7 @@ var Entry = React5.memo(function Entry2({
4136
4159
  Box,
4137
4160
  {
4138
4161
  flexDirection: "column",
4139
- marginX: MESSAGE_PANEL_MARGIN,
4162
+ marginX: 0,
4140
4163
  marginY: 1,
4141
4164
  borderStyle: "single",
4142
4165
  borderTop: false,
@@ -8824,6 +8847,8 @@ function App({
8824
8847
  predictNext,
8825
8848
  onSuggestionsParsed,
8826
8849
  getSuggestions,
8850
+ getAutoSuggestions,
8851
+ autonomyNextPrompt,
8827
8852
  setSuggestions,
8828
8853
  switchAutonomy,
8829
8854
  effectiveMaxContext,
@@ -10051,17 +10076,26 @@ function App({
10051
10076
  return;
10052
10077
  }
10053
10078
  const delay = cfg?.delayMs ?? 45e3;
10054
- const top = suggestions[0];
10079
+ const isYolo = getYolo?.() ?? false;
10080
+ const autoSuggestions = isYolo ? getAutoSuggestions?.() ?? [] : [];
10081
+ const useAutoSuggestions = isYolo && autoSuggestions.length > 0;
10082
+ const top = useAutoSuggestions ? autoSuggestions[0] : suggestions[0];
10055
10083
  if (!top) return;
10056
- nextStepsAutoSubmitSuggestionRef.current = top;
10084
+ let promptToSubmit = top;
10085
+ if (useAutoSuggestions && autonomyNextPrompt) {
10086
+ promptToSubmit = autonomyNextPrompt.replace("{{suggestion}}", top);
10087
+ }
10088
+ nextStepsAutoSubmitSuggestionRef.current = promptToSubmit;
10057
10089
  const start = Date.now();
10058
10090
  setNextStepsAutoSubmitCountdown(Math.ceil(delay / 1e3));
10091
+ setNextStepsAutoSubmitLabel(promptToSubmit);
10059
10092
  nextStepsAutoSubmitTimerRef.current = setInterval(() => {
10060
10093
  const remaining = Math.max(0, Math.ceil((delay - (Date.now() - start)) / 1e3));
10061
10094
  if (remaining <= 0) {
10062
10095
  clearInterval(nextStepsAutoSubmitTimerRef.current);
10063
10096
  nextStepsAutoSubmitTimerRef.current = void 0;
10064
10097
  setNextStepsAutoSubmitCountdown(null);
10098
+ setNextStepsAutoSubmitLabel(null);
10065
10099
  const suggestion = nextStepsAutoSubmitSuggestionRef.current;
10066
10100
  nextStepsAutoSubmitSuggestionRef.current = null;
10067
10101
  if (suggestion) {
@@ -10069,10 +10103,17 @@ function App({
10069
10103
  setDraft(suggestion, suggestion.length);
10070
10104
  void (async () => {
10071
10105
  const trimmed = suggestion.trim();
10072
- if (!trimmed) return;
10106
+ if (!trimmed) {
10107
+ clearDraft();
10108
+ return;
10109
+ }
10073
10110
  const blocks = [{ type: "text", text: trimmed }];
10074
10111
  dispatch({ type: "addEntry", entry: { kind: "user", text: trimmed } });
10075
- await runBlocksRef.current(blocks);
10112
+ try {
10113
+ await runBlocksRef.current(blocks);
10114
+ } finally {
10115
+ clearDraft();
10116
+ }
10076
10117
  })();
10077
10118
  }
10078
10119
  } else {
@@ -10082,6 +10123,8 @@ function App({
10082
10123
  return () => {
10083
10124
  clearInterval(nextStepsAutoSubmitTimerRef.current);
10084
10125
  nextStepsAutoSubmitTimerRef.current = void 0;
10126
+ setNextStepsAutoSubmitCountdown(null);
10127
+ setNextStepsAutoSubmitLabel(null);
10085
10128
  };
10086
10129
  }, [state.status, autonomyLive, state.enhance, state.enhanceBusy, nextStepsRecheck, getSettings, getSuggestions, dispatch]);
10087
10130
  const settingsAutoSaveGateRef = useRef(true);
@@ -10447,6 +10490,7 @@ function App({
10447
10490
  const enhanceAbortRef = useRef(null);
10448
10491
  const [enhanceCountdown, setEnhanceCountdown] = useState(null);
10449
10492
  const [nextStepsAutoSubmitCountdown, setNextStepsAutoSubmitCountdown] = useState(null);
10493
+ const [nextStepsAutoSubmitLabel, setNextStepsAutoSubmitLabel] = useState(null);
10450
10494
  const nextStepsAutoSubmitSuggestionRef = useRef(null);
10451
10495
  const nextStepsAutoSubmitTimerRef = useRef(void 0);
10452
10496
  useTuiEventBridge({
@@ -11426,6 +11470,7 @@ function App({
11426
11470
  clearInterval(nextStepsAutoSubmitTimerRef.current);
11427
11471
  nextStepsAutoSubmitTimerRef.current = void 0;
11428
11472
  setNextStepsAutoSubmitCountdown(null);
11473
+ setNextStepsAutoSubmitLabel(null);
11429
11474
  nextStepsAutoSubmitSuggestionRef.current = null;
11430
11475
  }
11431
11476
  setDraft(next2, cursor - 1);
@@ -11454,6 +11499,7 @@ function App({
11454
11499
  clearInterval(nextStepsAutoSubmitTimerRef.current);
11455
11500
  nextStepsAutoSubmitTimerRef.current = void 0;
11456
11501
  setNextStepsAutoSubmitCountdown(null);
11502
+ setNextStepsAutoSubmitLabel(null);
11457
11503
  nextStepsAutoSubmitSuggestionRef.current = null;
11458
11504
  }
11459
11505
  setDraft(next2, cursor);
@@ -11587,6 +11633,7 @@ function App({
11587
11633
  clearInterval(nextStepsAutoSubmitTimerRef.current);
11588
11634
  nextStepsAutoSubmitTimerRef.current = void 0;
11589
11635
  setNextStepsAutoSubmitCountdown(null);
11636
+ setNextStepsAutoSubmitLabel(null);
11590
11637
  nextStepsAutoSubmitSuggestionRef.current = null;
11591
11638
  }
11592
11639
  setDraft("", 0);
@@ -11600,6 +11647,7 @@ function App({
11600
11647
  clearInterval(nextStepsAutoSubmitTimerRef.current);
11601
11648
  nextStepsAutoSubmitTimerRef.current = void 0;
11602
11649
  setNextStepsAutoSubmitCountdown(null);
11650
+ setNextStepsAutoSubmitLabel(null);
11603
11651
  nextStepsAutoSubmitSuggestionRef.current = null;
11604
11652
  }
11605
11653
  setDraft(next2, cursor);
@@ -11612,6 +11660,7 @@ function App({
11612
11660
  clearInterval(nextStepsAutoSubmitTimerRef.current);
11613
11661
  nextStepsAutoSubmitTimerRef.current = void 0;
11614
11662
  setNextStepsAutoSubmitCountdown(null);
11663
+ setNextStepsAutoSubmitLabel(null);
11615
11664
  nextStepsAutoSubmitSuggestionRef.current = null;
11616
11665
  }
11617
11666
  setDraft(next2, cursor);
@@ -11635,6 +11684,7 @@ function App({
11635
11684
  clearInterval(nextStepsAutoSubmitTimerRef.current);
11636
11685
  nextStepsAutoSubmitTimerRef.current = void 0;
11637
11686
  setNextStepsAutoSubmitCountdown(null);
11687
+ setNextStepsAutoSubmitLabel(null);
11638
11688
  nextStepsAutoSubmitSuggestionRef.current = null;
11639
11689
  }
11640
11690
  const next = buffer.slice(0, cursor) + input + buffer.slice(cursor);
@@ -11964,7 +12014,12 @@ ${content}
11964
12014
  while (stateRef.current.status !== "idle" && Date.now() - start < 1500) {
11965
12015
  await new Promise((r) => setTimeout(r, 25));
11966
12016
  }
11967
- await runBlocks(blocks2);
12017
+ setDraft(res.runText, res.runText.length);
12018
+ try {
12019
+ await runBlocks(blocks2);
12020
+ } finally {
12021
+ clearDraft();
12022
+ }
11968
12023
  }
11969
12024
  }
11970
12025
  const cmd = trimmed.slice(1).split(/\s+/, 1)[0];
@@ -12429,6 +12484,7 @@ User message:
12429
12484
  debugStreamStats: state.debugStreamStats,
12430
12485
  enhanceCountdown,
12431
12486
  nextStepsAutoSubmitCountdown,
12487
+ nextStepsAutoSubmitLabel,
12432
12488
  autoProceedCountdown: state.countdown?.remainingSeconds ?? null,
12433
12489
  sessionCount,
12434
12490
  mailbox: mailboxStatus,
@@ -12858,6 +12914,10 @@ async function runTui(opts) {
12858
12914
  saveSettings: opts.saveSettings,
12859
12915
  predictNext: opts.predictNext,
12860
12916
  onSuggestionsParsed: opts.onSuggestionsParsed,
12917
+ getSuggestions: opts.getSuggestions,
12918
+ getAutoSuggestions: opts.getAutoSuggestions,
12919
+ autonomyNextPrompt: opts.autonomyNextPrompt,
12920
+ setSuggestions: opts.setSuggestions,
12861
12921
  chime: opts.chime,
12862
12922
  confirmExit: opts.confirmExit,
12863
12923
  mouse: mouseEnabled,