deepcode-ai 1.1.14 → 1.1.16

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.js CHANGED
@@ -4584,6 +4584,7 @@ var SubagentManager = class {
4584
4584
  systemPrompt: task.systemPrompt,
4585
4585
  allowedTools: task.allowedTools,
4586
4586
  disallowedTools: task.disallowedTools,
4587
+ onChunk: this.events ? (text) => this.events.emit("subagent:chunk", { taskId: task.id, text }) : void 0,
4587
4588
  onToolActivity: this.events ? (toolName, active) => this.events.emit("subagent:tool", { taskId: task.id, toolName, active }) : void 0
4588
4589
  });
4589
4590
  this.events?.emit("subagent:complete", { taskId: task.id });
@@ -7765,7 +7766,7 @@ import path32 from "path";
7765
7766
  import { jsx, jsxs } from "react/jsx-runtime";
7766
7767
  import fs6 from "fs";
7767
7768
  import path112 from "path";
7768
- import { isValidElement, useCallback as useCallback22, useEffect as useEffect25, useMemo as useMemo15, useRef as useRef16, useState as useState26 } from "react";
7769
+ import { isValidElement, useCallback as useCallback23, useEffect as useEffect25, useMemo as useMemo15, useRef as useRef17, useState as useState27 } from "react";
7769
7770
  import { Box as Box39, Text as Text47, useInput as useInput4, useStdin as useStdin3 } from "ink";
7770
7771
  import os4 from "os";
7771
7772
  import path62 from "path";
@@ -9687,13 +9688,13 @@ import { Box as Box22, Text as Text25 } from "ink";
9687
9688
  import { jsxs as jsxs21 } from "react/jsx-runtime";
9688
9689
  import { jsx as jsx27, jsxs as jsxs22 } from "react/jsx-runtime";
9689
9690
  import { Box as Box31, Text as Text39, useIsScreenReaderEnabled as useIsScreenReaderEnabled3 } from "ink";
9690
- import { useCallback as useCallback16, useState as useState21 } from "react";
9691
+ import { useCallback as useCallback17, useState as useState222 } from "react";
9691
9692
  import { useRef as useRef7 } from "react";
9692
9693
  import { Box as Box24, Text as Text26 } from "ink";
9693
9694
  import { useEffect as useEffect13, useState as useState11 } from "react";
9694
9695
  import { useEffect as useEffect14, useRef as useRef6, useState as useState12 } from "react";
9695
9696
  import { jsx as jsx28, jsxs as jsxs23 } from "react/jsx-runtime";
9696
- import { useCallback as useCallback14, useEffect as useEffect21, useMemo as useMemo9, useState as useState18, useRef as useRef11 } from "react";
9697
+ import { useCallback as useCallback15, useEffect as useEffect21, useMemo as useMemo9, useState as useState19, useRef as useRef12 } from "react";
9697
9698
  import { Box as Box27, Text as Text30 } from "ink";
9698
9699
  import { Box as Box25, Text as Text28 } from "ink";
9699
9700
  import React22 from "react";
@@ -9711,11 +9712,12 @@ import { useCallback as useCallback11, useMemo as useMemo7, useEffect as useEffe
9711
9712
  import { useEffect as useEffect17, useReducer as useReducer3, useRef as useRef9 } from "react";
9712
9713
  import { useState as useState17, useEffect as useEffect18, useMemo as useMemo6 } from "react";
9713
9714
  import { useCallback as useCallback12, useEffect as useEffect20, useMemo as useMemo8, useRef as useRef10 } from "react";
9715
+ import { useState as useState18, useCallback as useCallback13, useRef as useRef11 } from "react";
9714
9716
  import * as path102 from "path";
9715
9717
  import { createContext as createContext5, useContext as useContext6 } from "react";
9716
9718
  import { createContext as createContext6, useContext as useContext7 } from "react";
9717
9719
  import { createContext as createContext7, useContext as useContext8 } from "react";
9718
- import { useCallback as useCallback13 } from "react";
9720
+ import { useCallback as useCallback14 } from "react";
9719
9721
  import { Box as Box26, Text as Text29 } from "ink";
9720
9722
  import chalk2 from "chalk";
9721
9723
  import { jsx as jsx31, jsxs as jsxs26 } from "react/jsx-runtime";
@@ -9731,18 +9733,18 @@ import { Text as Text34 } from "ink";
9731
9733
  import { jsxs as jsxs31 } from "react/jsx-runtime";
9732
9734
  import { Text as Text35 } from "ink";
9733
9735
  import { jsxs as jsxs32 } from "react/jsx-runtime";
9734
- import { useState as useState19, useEffect as useEffect222 } from "react";
9736
+ import { useState as useState20, useEffect as useEffect222 } from "react";
9735
9737
  import { execFile as execFile22 } from "child_process";
9736
9738
  import os42 from "os";
9737
9739
  import {
9738
9740
  createContext as createContext8,
9739
- useCallback as useCallback15,
9741
+ useCallback as useCallback16,
9740
9742
  useContext as useContext9,
9741
- useState as useState20
9743
+ useState as useState21
9742
9744
  } from "react";
9743
9745
  import { jsx as jsx36 } from "react/jsx-runtime";
9744
9746
  import { jsx as jsx37, jsxs as jsxs33 } from "react/jsx-runtime";
9745
- import { useRef as useRef12 } from "react";
9747
+ import { useRef as useRef13 } from "react";
9746
9748
  import { Box as Box29, Text as Text37 } from "ink";
9747
9749
  import { jsx as jsx38, jsxs as jsxs34 } from "react/jsx-runtime";
9748
9750
  import { Box as Box30, Text as Text38 } from "ink";
@@ -9750,19 +9752,19 @@ import { jsx as jsx39, jsxs as jsxs35 } from "react/jsx-runtime";
9750
9752
  import { jsx as jsx40, jsxs as jsxs36 } from "react/jsx-runtime";
9751
9753
  import { Box as Box32, Text as Text40 } from "ink";
9752
9754
  import { jsx as jsx41, jsxs as jsxs37 } from "react/jsx-runtime";
9753
- import { useCallback as useCallback17, useMemo as useMemo10, useRef as useRef13 } from "react";
9755
+ import { useCallback as useCallback18, useMemo as useMemo10, useRef as useRef14 } from "react";
9754
9756
  import { Box as Box33, Text as Text41 } from "ink";
9755
9757
  import { jsx as jsx42, jsxs as jsxs38 } from "react/jsx-runtime";
9756
- import { useCallback as useCallback18, useMemo as useMemo11, useState as useState222 } from "react";
9758
+ import { useCallback as useCallback19, useMemo as useMemo11, useState as useState23 } from "react";
9757
9759
  import { Box as Box34, Text as Text42, useInput as useInput2 } from "ink";
9758
9760
  import { Fragment as Fragment9, jsx as jsx43, jsxs as jsxs39 } from "react/jsx-runtime";
9759
- import { useCallback as useCallback19, useMemo as useMemo12, useState as useState23 } from "react";
9761
+ import { useCallback as useCallback20, useMemo as useMemo12, useState as useState24 } from "react";
9760
9762
  import { Box as Box35, Text as Text43 } from "ink";
9761
9763
  import { jsx as jsx44, jsxs as jsxs40 } from "react/jsx-runtime";
9762
- import { useCallback as useCallback20, useEffect as useEffect23, useMemo as useMemo13, useRef as useRef14, useState as useState24 } from "react";
9764
+ import { useCallback as useCallback21, useEffect as useEffect23, useMemo as useMemo13, useRef as useRef15, useState as useState25 } from "react";
9763
9765
  import { Box as Box36, Text as Text44 } from "ink";
9764
9766
  import { jsx as jsx45, jsxs as jsxs41 } from "react/jsx-runtime";
9765
- import { useCallback as useCallback21, useEffect as useEffect24, useMemo as useMemo14, useRef as useRef15, useState as useState25 } from "react";
9767
+ import { useCallback as useCallback22, useEffect as useEffect24, useMemo as useMemo14, useRef as useRef16, useState as useState26 } from "react";
9766
9768
  import { Box as Box37, Text as Text45, useInput as useInput3 } from "ink";
9767
9769
  import { jsx as jsx46, jsxs as jsxs42 } from "react/jsx-runtime";
9768
9770
  import { Box as Box38, Text as Text46 } from "ink";
@@ -25517,21 +25519,35 @@ function useExportCompletion(buffer, slashCommands) {
25517
25519
  ]
25518
25520
  );
25519
25521
  }
25520
- var INERT = {
25521
- state: { isVisible: false, suggestion: null },
25522
- setSuggestion: () => {
25523
- },
25524
- accept: () => {
25525
- },
25526
- dismiss: () => {
25527
- },
25528
- clear: () => {
25529
- },
25530
- recordKeystroke: () => {
25531
- }
25532
- };
25533
- function useFollowupSuggestionsCLI(_options) {
25534
- return INERT;
25522
+ function useFollowupSuggestionsCLI(options) {
25523
+ const [state, setState] = useState18({ isVisible: false, suggestion: null });
25524
+ const onAcceptRef = useRef11(options?.onAccept);
25525
+ onAcceptRef.current = options?.onAccept;
25526
+ const setSuggestion = useCallback13((text) => {
25527
+ setState({ isVisible: text !== null && text.trim().length > 0, suggestion: text });
25528
+ }, []);
25529
+ const dismiss = useCallback13(() => {
25530
+ setState({ isVisible: false, suggestion: null });
25531
+ }, []);
25532
+ const accept = useCallback13(
25533
+ (_method, opts) => {
25534
+ setState((prev) => {
25535
+ if (prev.suggestion && !opts?.skipOnAccept) {
25536
+ onAcceptRef.current?.(prev.suggestion);
25537
+ }
25538
+ return { isVisible: false, suggestion: null };
25539
+ });
25540
+ },
25541
+ []
25542
+ );
25543
+ return {
25544
+ state,
25545
+ setSuggestion,
25546
+ accept,
25547
+ dismiss,
25548
+ clear: dismiss,
25549
+ recordKeystroke: dismiss
25550
+ };
25535
25551
  }
25536
25552
  var HIGHLIGHT_REGEX = /(^\/[a-zA-Z][a-zA-Z0-9:_-]*)|((?<=\s)\/[a-zA-Z][a-zA-Z0-9:_-]*)|(@(?:\\ |[a-zA-Z0-9_./-])+)/g;
25537
25553
  function parseInputForHighlighting(text, index, slashCommands) {
@@ -25710,7 +25726,7 @@ var BaseTextInput = ({
25710
25726
  isActive = true,
25711
25727
  renderLine = defaultRenderLine
25712
25728
  }) => {
25713
- const handleKey = useCallback13(
25729
+ const handleKey = useCallback14(
25714
25730
  (key) => {
25715
25731
  if (onKeypress?.(key)) {
25716
25732
  return;
@@ -25941,20 +25957,20 @@ var InputPrompt = ({
25941
25957
  const { setPillFocused: setBgPillFocused } = useBackgroundTaskViewActions();
25942
25958
  const hasAgents = agents.size > 0;
25943
25959
  const hasBgAgents = bgEntries.length > 0;
25944
- const [justNavigatedHistory, setJustNavigatedHistory] = useState18(false);
25945
- const [escPressCount, setEscPressCount] = useState18(0);
25946
- const [showEscapePrompt, setShowEscapePrompt] = useState18(false);
25947
- const escapeTimerRef = useRef11(null);
25948
- const [recentPasteTime, setRecentPasteTime] = useState18(null);
25949
- const pasteTimeoutRef = useRef11(null);
25950
- const [attachments, setAttachments] = useState18([]);
25951
- const [isAttachmentMode, setIsAttachmentMode] = useState18(false);
25952
- const [selectedAttachmentIndex, setSelectedAttachmentIndex] = useState18(-1);
25953
- const [pendingPastes, setPendingPastes] = useState18(
25960
+ const [justNavigatedHistory, setJustNavigatedHistory] = useState19(false);
25961
+ const [escPressCount, setEscPressCount] = useState19(0);
25962
+ const [showEscapePrompt, setShowEscapePrompt] = useState19(false);
25963
+ const escapeTimerRef = useRef12(null);
25964
+ const [recentPasteTime, setRecentPasteTime] = useState19(null);
25965
+ const pasteTimeoutRef = useRef12(null);
25966
+ const [attachments, setAttachments] = useState19([]);
25967
+ const [isAttachmentMode, setIsAttachmentMode] = useState19(false);
25968
+ const [selectedAttachmentIndex, setSelectedAttachmentIndex] = useState19(-1);
25969
+ const [pendingPastes, setPendingPastes] = useState19(
25954
25970
  /* @__PURE__ */ new Map()
25955
25971
  );
25956
- const activePlaceholderIds = useRef11(/* @__PURE__ */ new Map());
25957
- const parsePlaceholder = useCallback14(
25972
+ const activePlaceholderIds = useRef12(/* @__PURE__ */ new Map());
25973
+ const parsePlaceholder = useCallback15(
25958
25974
  (placeholder2) => {
25959
25975
  const match = placeholder2.match(
25960
25976
  /^\[Pasted Content (\d+) chars\](?: #(\d+))?$/
@@ -25966,7 +25982,7 @@ var InputPrompt = ({
25966
25982
  },
25967
25983
  []
25968
25984
  );
25969
- const freePlaceholderId = useCallback14((charCount, id) => {
25985
+ const freePlaceholderId = useCallback15((charCount, id) => {
25970
25986
  const activeIds = activePlaceholderIds.current.get(charCount);
25971
25987
  if (activeIds) {
25972
25988
  activeIds.delete(id);
@@ -25975,14 +25991,14 @@ var InputPrompt = ({
25975
25991
  }
25976
25992
  }
25977
25993
  }, []);
25978
- const [reverseSearchActive, setReverseSearchActive] = useState18(false);
25979
- const [commandSearchActive, setCommandSearchActive] = useState18(false);
25980
- const [textBeforeReverseSearch, setTextBeforeReverseSearch] = useState18("");
25981
- const [cursorPosition, setCursorPosition] = useState18([
25994
+ const [reverseSearchActive, setReverseSearchActive] = useState19(false);
25995
+ const [commandSearchActive, setCommandSearchActive] = useState19(false);
25996
+ const [textBeforeReverseSearch, setTextBeforeReverseSearch] = useState19("");
25997
+ const [cursorPosition, setCursorPosition] = useState19([
25982
25998
  0,
25983
25999
  0
25984
26000
  ]);
25985
- const [expandedSuggestionIndex, setExpandedSuggestionIndex] = useState18(-1);
26001
+ const [expandedSuggestionIndex, setExpandedSuggestionIndex] = useState19(-1);
25986
26002
  const exportCompletion = useExportCompletion(buffer, slashCommands);
25987
26003
  const shellHistory = useShellHistory(config.getProjectRoot());
25988
26004
  const shellHistoryData = shellHistory.history;
@@ -25997,7 +26013,7 @@ var InputPrompt = ({
25997
26013
  !justNavigatedHistory,
25998
26014
  recentSlashCommands
25999
26015
  );
26000
- const midInputGhostTextRef = useRef11(null);
26016
+ const midInputGhostTextRef = useRef12(null);
26001
26017
  midInputGhostTextRef.current = completion.midInputGhostText;
26002
26018
  const reverseSearchCompletion = useReverseSearchCompletion(
26003
26019
  buffer,
@@ -26024,7 +26040,7 @@ var InputPrompt = ({
26024
26040
  const resetReverseSearchCompletionState = reverseSearchCompletion.resetCompletionState;
26025
26041
  const resetCommandSearchCompletionState = commandSearchCompletion.resetCompletionState;
26026
26042
  const showCursor = focus && isShellFocused && !isEmbeddedShellFocused && !agentTabBarFocused;
26027
- const resetEscapeState = useCallback14(() => {
26043
+ const resetEscapeState = useCallback15(() => {
26028
26044
  if (escapeTimerRef.current) {
26029
26045
  clearTimeout(escapeTimerRef.current);
26030
26046
  escapeTimerRef.current = null;
@@ -26037,7 +26053,7 @@ var InputPrompt = ({
26037
26053
  onEscapePromptChange(showEscapePrompt);
26038
26054
  }
26039
26055
  }, [showEscapePrompt, onEscapePromptChange]);
26040
- const nextLargePastePlaceholder = useCallback14((charCount) => {
26056
+ const nextLargePastePlaceholder = useCallback15((charCount) => {
26041
26057
  const activeIds = activePlaceholderIds.current.get(charCount) || /* @__PURE__ */ new Set();
26042
26058
  let id = 1;
26043
26059
  while (activeIds.has(id)) {
@@ -26059,9 +26075,9 @@ var InputPrompt = ({
26059
26075
  },
26060
26076
  []
26061
26077
  );
26062
- const resetHistoryNavRef = useRef11(() => {
26078
+ const resetHistoryNavRef = useRef12(() => {
26063
26079
  });
26064
- const handleSubmitAndClear = useCallback14(
26080
+ const handleSubmitAndClear = useCallback15(
26065
26081
  (submittedValue) => {
26066
26082
  exportCompletion.reset();
26067
26083
  let finalValue = submittedValue;
@@ -26113,7 +26129,7 @@ ${finalValue.trim()}`;
26113
26129
  followup
26114
26130
  ]
26115
26131
  );
26116
- const customSetTextAndResetCompletionSignal = useCallback14(
26132
+ const customSetTextAndResetCompletionSignal = useCallback15(
26117
26133
  (newText) => {
26118
26134
  buffer.setText(newText);
26119
26135
  setJustNavigatedHistory(true);
@@ -26130,7 +26146,7 @@ ${finalValue.trim()}`;
26130
26146
  onChange: customSetTextAndResetCompletionSignal
26131
26147
  });
26132
26148
  resetHistoryNavRef.current = inputHistory.resetHistoryNav;
26133
- const prevHasAgentsRef = useRef11(hasAgents);
26149
+ const prevHasAgentsRef = useRef12(hasAgents);
26134
26150
  useEffect21(() => {
26135
26151
  if (hasAgents && !prevHasAgentsRef.current) {
26136
26152
  inputHistory.resetHistoryNav();
@@ -26153,7 +26169,7 @@ ${finalValue.trim()}`;
26153
26169
  resetReverseSearchCompletionState,
26154
26170
  resetCommandSearchCompletionState
26155
26171
  ]);
26156
- const handleClipboardImage = useCallback14(async (validated = false) => {
26172
+ const handleClipboardImage = useCallback15(async (validated = false) => {
26157
26173
  try {
26158
26174
  const hasImage = validated || await clipboardHasImage();
26159
26175
  if (hasImage) {
@@ -26174,7 +26190,7 @@ ${finalValue.trim()}`;
26174
26190
  debugLogger14.error("Error handling clipboard image:", error);
26175
26191
  }
26176
26192
  }, []);
26177
- const handleAttachmentDelete = useCallback14((index) => {
26193
+ const handleAttachmentDelete = useCallback15((index) => {
26178
26194
  setAttachments((prev) => {
26179
26195
  const newList = prev.filter((_, i) => i !== index);
26180
26196
  if (newList.length === 0) {
@@ -26186,7 +26202,7 @@ ${finalValue.trim()}`;
26186
26202
  return newList;
26187
26203
  });
26188
26204
  }, []);
26189
- const handleInput = useCallback14(
26205
+ const handleInput = useCallback15(
26190
26206
  (key) => {
26191
26207
  if (agentTabBarFocused || bgPillFocused) {
26192
26208
  if (key.sequence && key.sequence.length === 1 && !key.ctrl && !key.meta) {
@@ -26764,7 +26780,7 @@ ${currentText}`);
26764
26780
  exportCompletion
26765
26781
  ]
26766
26782
  );
26767
- const renderLineWithHighlighting = useCallback14(
26783
+ const renderLineWithHighlighting = useCallback15(
26768
26784
  (opts) => {
26769
26785
  const {
26770
26786
  lineText,
@@ -27035,7 +27051,7 @@ function MCPHealthPill() {
27035
27051
  function useStatusLine() {
27036
27052
  const config = useConfig();
27037
27053
  const cwd = config.getWorkingDir();
27038
- const [line, setLine] = useState19(null);
27054
+ const [line, setLine] = useState20(null);
27039
27055
  useEffect222(() => {
27040
27056
  let cancelled = false;
27041
27057
  execFile22("git", ["branch", "--show-current"], { cwd }, (err, stdout) => {
@@ -27060,11 +27076,11 @@ var VimModeProvider = ({
27060
27076
  children,
27061
27077
  initialVimEnabled = false
27062
27078
  }) => {
27063
- const [vimEnabled, setVimEnabled] = useState20(initialVimEnabled);
27064
- const [vimMode, setVimMode] = useState20(
27079
+ const [vimEnabled, setVimEnabled] = useState21(initialVimEnabled);
27080
+ const [vimMode, setVimMode] = useState21(
27065
27081
  initialVimEnabled ? "NORMAL" : "INSERT"
27066
27082
  );
27067
- const toggleVimEnabled = useCallback15(async () => {
27083
+ const toggleVimEnabled = useCallback16(async () => {
27068
27084
  const next = !vimEnabled;
27069
27085
  setVimEnabled(next);
27070
27086
  setVimMode(next ? "NORMAL" : "INSERT");
@@ -27166,8 +27182,8 @@ var NUM_TIMES_QUEUE_HINT_SHOWN = 3;
27166
27182
  var QueuedMessageDisplay = ({
27167
27183
  messageQueue
27168
27184
  }) => {
27169
- const hintSeenCountRef = useRef12(0);
27170
- const wasEmptyRef = useRef12(true);
27185
+ const hintSeenCountRef = useRef13(0);
27186
+ const wasEmptyRef = useRef13(true);
27171
27187
  if (messageQueue.length === 0) {
27172
27188
  wasEmptyRef.current = true;
27173
27189
  return null;
@@ -27300,12 +27316,12 @@ var Composer = () => {
27300
27316
  }
27301
27317
  }
27302
27318
  }
27303
- const [showShortcuts, setShowShortcuts] = useState21(false);
27304
- const handleToggleShortcuts = useCallback16(() => {
27319
+ const [showShortcuts, setShowShortcuts] = useState222(false);
27320
+ const handleToggleShortcuts = useCallback17(() => {
27305
27321
  setShowShortcuts((prev) => !prev);
27306
27322
  }, []);
27307
- const [showSuggestions, setShowSuggestions] = useState21(false);
27308
- const handleSuggestionsVisibilityChange = useCallback16(
27323
+ const [showSuggestions, setShowSuggestions] = useState222(false);
27324
+ const handleSuggestionsVisibilityChange = useCallback17(
27309
27325
  (visible) => {
27310
27326
  setShowSuggestions(visible);
27311
27327
  uiActions.onSuggestionsVisibilityChange(visible);
@@ -27739,7 +27755,7 @@ var CommandDialog = ({
27739
27755
  /* @__PURE__ */ jsx41(Box32, { marginTop: 1, children: /* @__PURE__ */ jsx41(Text40, { color: theme.text.secondary, children: footerText }) })
27740
27756
  ] }) });
27741
27757
  var ThemeDialog = ({ onSelect, onClose, onPreview }) => {
27742
- const originalTheme = useRef13(themeManager.getActiveTheme().name);
27758
+ const originalTheme = useRef14(themeManager.getActiveTheme().name);
27743
27759
  const available = useMemo10(() => themeManager.getAvailableThemes(), []);
27744
27760
  const items = useMemo10(
27745
27761
  () => available.map((entry) => ({
@@ -27755,7 +27771,7 @@ var ThemeDialog = ({ onSelect, onClose, onPreview }) => {
27755
27771
  0,
27756
27772
  available.findIndex((entry) => entry.name === originalTheme.current)
27757
27773
  );
27758
- const handleEscape = useCallback17(
27774
+ const handleEscape = useCallback18(
27759
27775
  (key) => {
27760
27776
  if (key.name === "escape") {
27761
27777
  themeManager.setActiveTheme(originalTheme.current);
@@ -27766,7 +27782,7 @@ var ThemeDialog = ({ onSelect, onClose, onPreview }) => {
27766
27782
  [onClose, onPreview]
27767
27783
  );
27768
27784
  useKeypress(handleEscape, { isActive: true });
27769
- const handleHighlight = useCallback17(
27785
+ const handleHighlight = useCallback18(
27770
27786
  (themeName) => {
27771
27787
  themeManager.setActiveTheme(themeName);
27772
27788
  onPreview();
@@ -27831,12 +27847,12 @@ var ProviderDialog = ({
27831
27847
  onTestProvider,
27832
27848
  onClose
27833
27849
  }) => {
27834
- const [phase, setPhase] = useState222("providers");
27835
- const [selectedProvider, setSelectedProvider] = useState222(currentProvider);
27836
- const [apiKeyInput, setApiKeyInput] = useState222("");
27837
- const [isBusy, setIsBusy] = useState222(false);
27838
- const [status, setStatus] = useState222(null);
27839
- const [testLatencyMs, setTestLatencyMs] = useState222(void 0);
27850
+ const [phase, setPhase] = useState23("providers");
27851
+ const [selectedProvider, setSelectedProvider] = useState23(currentProvider);
27852
+ const [apiKeyInput, setApiKeyInput] = useState23("");
27853
+ const [isBusy, setIsBusy] = useState23(false);
27854
+ const [status, setStatus] = useState23(null);
27855
+ const [testLatencyMs, setTestLatencyMs] = useState23(void 0);
27840
27856
  const isLocal = CREDENTIAL_FREE_PROVIDERS.has(selectedProvider);
27841
27857
  const keyIsSet = hasApiKey(selectedProvider);
27842
27858
  const keyHint = getProviderKeyHint(selectedProvider);
@@ -27895,7 +27911,7 @@ var ProviderDialog = ({
27895
27911
  ],
27896
27912
  [canTest, currentProvider, isLocal, selectedProvider]
27897
27913
  );
27898
- const selectProvider = useCallback18(
27914
+ const selectProvider = useCallback19(
27899
27915
  (provider) => {
27900
27916
  setSelectedProvider(provider);
27901
27917
  setStatus(null);
@@ -27904,7 +27920,7 @@ var ProviderDialog = ({
27904
27920
  },
27905
27921
  []
27906
27922
  );
27907
- const runTest = useCallback18(async () => {
27923
+ const runTest = useCallback19(async () => {
27908
27924
  setIsBusy(true);
27909
27925
  setTestLatencyMs(void 0);
27910
27926
  setStatus({ text: `Testing ${selectedProvider}\u2026`, ok: true });
@@ -27926,7 +27942,7 @@ var ProviderDialog = ({
27926
27942
  setIsBusy(false);
27927
27943
  }
27928
27944
  }, [onTestProvider, selectedProvider]);
27929
- const selectAction = useCallback18(
27945
+ const selectAction = useCallback19(
27930
27946
  (action) => {
27931
27947
  if (isBusy) return;
27932
27948
  if (action === "editKey") {
@@ -27967,7 +27983,7 @@ var ProviderDialog = ({
27967
27983
  },
27968
27984
  [isBusy, onClose, onSelectProvider, onSetDefaultProvider, runTest, selectedProvider]
27969
27985
  );
27970
- const saveApiKey = useCallback18(async () => {
27986
+ const saveApiKey = useCallback19(async () => {
27971
27987
  const normalized2 = apiKeyInput.trim();
27972
27988
  if (!normalized2) {
27973
27989
  setStatus({ text: "Type a key before saving.", ok: false });
@@ -28153,7 +28169,7 @@ var PermissionsDialog = ({
28153
28169
  onSave,
28154
28170
  onClose
28155
28171
  }) => {
28156
- const [modes, setModes] = useState23(current);
28172
+ const [modes, setModes] = useState24(current);
28157
28173
  const dirty = useMemo12(
28158
28174
  () => PERMISSION_KEYS.some((key) => modes[key] !== current[key]),
28159
28175
  [modes, current]
@@ -28168,7 +28184,7 @@ var PermissionsDialog = ({
28168
28184
  rows.push({ key: CANCEL_VALUE, value: CANCEL_VALUE, label: "Cancel" });
28169
28185
  return rows;
28170
28186
  }, [modes, dirty]);
28171
- const handleSelect = useCallback19(
28187
+ const handleSelect = useCallback20(
28172
28188
  (value) => {
28173
28189
  if (value === SAVE_VALUE) {
28174
28190
  onSave(modes);
@@ -28183,7 +28199,7 @@ var PermissionsDialog = ({
28183
28199
  },
28184
28200
  [modes, onClose, onSave]
28185
28201
  );
28186
- const handleEscape = useCallback19(
28202
+ const handleEscape = useCallback20(
28187
28203
  (key) => {
28188
28204
  if (key.name === "escape") {
28189
28205
  onClose();
@@ -28219,10 +28235,10 @@ var AuthDialog = ({
28219
28235
  onPersistToken,
28220
28236
  onClose
28221
28237
  }) => {
28222
- const [phase, setPhase] = useState24("menu");
28223
- const [deviceCode, setDeviceCode] = useState24(null);
28224
- const [message, setMessage] = useState24("");
28225
- const abortRef = useRef14(null);
28238
+ const [phase, setPhase] = useState25("menu");
28239
+ const [deviceCode, setDeviceCode] = useState25(null);
28240
+ const [message, setMessage] = useState25("");
28241
+ const abortRef = useRef15(null);
28226
28242
  const items = useMemo13(
28227
28243
  () => [
28228
28244
  { key: "login", value: "login", label: "Login with GitHub" },
@@ -28231,7 +28247,7 @@ var AuthDialog = ({
28231
28247
  ],
28232
28248
  [hasToken]
28233
28249
  );
28234
- const startLogin = useCallback20(async () => {
28250
+ const startLogin = useCallback21(async () => {
28235
28251
  if (!clientId) {
28236
28252
  setMessage(
28237
28253
  "No OAuth client configured. Set github.oauthClientId in .deepcode/config.json, or run `deepcode github login` in a terminal."
@@ -28275,7 +28291,7 @@ var AuthDialog = ({
28275
28291
  abortRef.current = null;
28276
28292
  }
28277
28293
  }, [clientId, enterpriseUrl, onPersistToken, scopes, worktree]);
28278
- const clearToken = useCallback20(async () => {
28294
+ const clearToken = useCallback21(async () => {
28279
28295
  try {
28280
28296
  await onPersistToken(void 0);
28281
28297
  setPhase("done");
@@ -28285,7 +28301,7 @@ var AuthDialog = ({
28285
28301
  setMessage(error instanceof Error ? error.message : String(error));
28286
28302
  }
28287
28303
  }, [onPersistToken]);
28288
- const handleSelect = useCallback20(
28304
+ const handleSelect = useCallback21(
28289
28305
  (value) => {
28290
28306
  if (value === "login") {
28291
28307
  void startLogin();
@@ -28300,7 +28316,7 @@ var AuthDialog = ({
28300
28316
  useEffect23(() => () => {
28301
28317
  abortRef.current?.abort();
28302
28318
  }, []);
28303
- const handleEscape = useCallback20(
28319
+ const handleEscape = useCallback21(
28304
28320
  (key) => {
28305
28321
  if (key.name !== "escape") return;
28306
28322
  if (phase === "running") {
@@ -28393,12 +28409,12 @@ var ModelDialog = ({
28393
28409
  onSelectModel,
28394
28410
  onClose
28395
28411
  }) => {
28396
- const [loadState, setLoadState] = useState25("loading");
28397
- const [models, setModels] = useState25([]);
28398
- const [errorMsg, setErrorMsg] = useState25("");
28399
- const [search, setSearch] = useState25("");
28400
- const [activeSelIndex, setActiveSelIndex] = useState25(0);
28401
- const abortRef = useRef15(null);
28412
+ const [loadState, setLoadState] = useState26("loading");
28413
+ const [models, setModels] = useState26([]);
28414
+ const [errorMsg, setErrorMsg] = useState26("");
28415
+ const [search, setSearch] = useState26("");
28416
+ const [activeSelIndex, setActiveSelIndex] = useState26(0);
28417
+ const abortRef = useRef16(null);
28402
28418
  useEffect24(() => {
28403
28419
  const ctrl = new AbortController();
28404
28420
  abortRef.current = ctrl;
@@ -28431,7 +28447,7 @@ var ModelDialog = ({
28431
28447
  [activeRowPos, rows.length]
28432
28448
  );
28433
28449
  const visibleRows = rows.slice(scrollTop, scrollTop + MAX_VISIBLE);
28434
- const confirm = useCallback21(() => {
28450
+ const confirm = useCallback22(() => {
28435
28451
  const row = rows.find((r) => r.kind === "item" && r.selIndex === clampedIndex);
28436
28452
  if (row?.kind === "item") onSelectModel(row.model.id);
28437
28453
  }, [rows, clampedIndex, onSelectModel]);
@@ -28575,14 +28591,14 @@ var ModelDialog = ({
28575
28591
  }
28576
28592
  );
28577
28593
  };
28578
- function statusIcon(entry) {
28579
- if (entry.status === "done") return "\u2713";
28580
- if (entry.status === "failed") return "\u2717";
28594
+ function statusIcon(e) {
28595
+ if (e.status === "done") return "\u2713";
28596
+ if (e.status === "failed") return "\u2717";
28581
28597
  return "\u2026";
28582
28598
  }
28583
- function statusColor2(entry) {
28584
- if (entry.status === "done") return theme.status.success;
28585
- if (entry.status === "failed") return theme.status.error;
28599
+ function statusColor2(e) {
28600
+ if (e.status === "done") return theme.status.success;
28601
+ if (e.status === "failed") return theme.status.error;
28586
28602
  return theme.text.accent;
28587
28603
  }
28588
28604
  var SubagentsPanel = ({ subagents, mainAreaWidth }) => {
@@ -28601,22 +28617,26 @@ var SubagentsPanel = ({ subagents, mainAreaWidth }) => {
28601
28617
  width: Math.min(mainAreaWidth, 80),
28602
28618
  children: [
28603
28619
  /* @__PURE__ */ jsx47(Box38, { paddingX: 1, children: /* @__PURE__ */ jsx47(Text46, { bold: true, color: theme.text.accent, children: title }) }),
28604
- subagents.map((entry) => /* @__PURE__ */ jsxs43(Box38, { flexDirection: "row", paddingX: 1, gap: 1, children: [
28605
- /* @__PURE__ */ jsx47(Text46, { color: statusColor2(entry), children: statusIcon(entry) }),
28606
- /* @__PURE__ */ jsxs43(Box38, { flexDirection: "column", flexShrink: 1, children: [
28620
+ subagents.map((entry) => /* @__PURE__ */ jsxs43(Box38, { flexDirection: "column", paddingX: 1, children: [
28621
+ /* @__PURE__ */ jsxs43(Box38, { flexDirection: "row", gap: 1, children: [
28622
+ /* @__PURE__ */ jsx47(Text46, { color: statusColor2(entry), children: statusIcon(entry) }),
28607
28623
  /* @__PURE__ */ jsxs43(Text46, { wrap: "truncate", color: theme.text.primary, children: [
28608
28624
  entry.prompt,
28609
28625
  entry.prompt.length >= 50 ? "\u2026" : ""
28610
- ] }),
28611
- entry.status === "running" && entry.currentTool && /* @__PURE__ */ jsxs43(Text46, { color: theme.text.secondary, dimColor: true, children: [
28612
- " ",
28613
- "using ",
28614
- entry.currentTool
28615
- ] }),
28616
- entry.status === "failed" && entry.error && /* @__PURE__ */ jsxs43(Text46, { color: theme.status.error, dimColor: true, children: [
28617
- " ",
28618
- entry.error.slice(0, 60)
28619
28626
  ] })
28627
+ ] }),
28628
+ entry.status === "running" && entry.currentTool && /* @__PURE__ */ jsxs43(Text46, { color: theme.text.secondary, dimColor: true, children: [
28629
+ " ",
28630
+ "using ",
28631
+ entry.currentTool
28632
+ ] }),
28633
+ entry.status === "running" && !entry.currentTool && entry.currentOutput && /* @__PURE__ */ jsxs43(Text46, { color: theme.text.secondary, dimColor: true, wrap: "truncate", children: [
28634
+ " ",
28635
+ entry.currentOutput.trimStart()
28636
+ ] }),
28637
+ entry.status === "failed" && entry.error && /* @__PURE__ */ jsxs43(Text46, { color: theme.status.error, dimColor: true, wrap: "truncate", children: [
28638
+ " ",
28639
+ entry.error.slice(0, 60)
28620
28640
  ] })
28621
28641
  ] }, entry.taskId))
28622
28642
  ]
@@ -28751,68 +28771,94 @@ function resolveSlashInvocation(rawInput, commands) {
28751
28771
  args: tokens.slice(consumed).join(" ")
28752
28772
  };
28753
28773
  }
28774
+ async function generateFollowupSuggestion(runtime, session, lastOutput, signal) {
28775
+ if (!lastOutput.trim()) return null;
28776
+ try {
28777
+ const provider = runtime.providers.get(session.provider);
28778
+ const model = session.model ?? resolveConfiguredModelForProvider(runtime.config, session.provider);
28779
+ if (!model) return null;
28780
+ const snippet = lastOutput.trim().slice(-300);
28781
+ const prompt = `[Task: suggest ONE concise follow-up question or action the user might ask next, in under 10 words. Return ONLY the suggestion text, no explanation, no quotes, no punctuation at the end.]
28782
+
28783
+ Assistant just said:
28784
+ ${snippet}
28785
+
28786
+ Follow-up suggestion:`;
28787
+ const suggestion = await provider.complete(prompt, {
28788
+ model,
28789
+ maxTokens: 20,
28790
+ temperature: 0.7,
28791
+ signal
28792
+ });
28793
+ const clean = suggestion.trim().replace(/^["']|["']$/g, "").replace(/[.!?]$/, "").split("\n")[0].trim();
28794
+ if (!clean || clean.length < 3 || clean.length > 80) return null;
28795
+ return clean;
28796
+ } catch {
28797
+ return null;
28798
+ }
28799
+ }
28754
28800
  var AppContainer = ({ cwd, config, provider, model }) => {
28755
28801
  const historyManager = useHistory();
28756
28802
  const addHistoryItem = historyManager.addItem;
28757
- const [initError, setInitError] = useState26(null);
28758
- const [isInitializing, setIsInitializing] = useState26(true);
28759
- const [isRunning, setIsRunning] = useState26(false);
28760
- const [pendingAssistantText, setPendingAssistantText] = useState26("");
28761
- const [approvalQueue, setApprovalQueue] = useState26([]);
28762
- const [providerLabel, setProviderLabel] = useState26("(unconfigured)");
28763
- const [targetSource, setTargetSource] = useState26("config");
28764
- const [currentModel, setCurrentModel] = useState26("(unconfigured)");
28765
- const [agentMode, setAgentMode] = useState26("build");
28766
- const [streamingState, setStreamingState] = useState26(
28803
+ const [initError, setInitError] = useState27(null);
28804
+ const [isInitializing, setIsInitializing] = useState27(true);
28805
+ const [isRunning, setIsRunning] = useState27(false);
28806
+ const [pendingAssistantText, setPendingAssistantText] = useState27("");
28807
+ const [approvalQueue, setApprovalQueue] = useState27([]);
28808
+ const [providerLabel, setProviderLabel] = useState27("(unconfigured)");
28809
+ const [targetSource, setTargetSource] = useState27("config");
28810
+ const [currentModel, setCurrentModel] = useState27("(unconfigured)");
28811
+ const [agentMode, setAgentMode] = useState27("build");
28812
+ const [streamingState, setStreamingState] = useState27(
28767
28813
  "idle"
28768
28814
  /* Idle */
28769
28815
  );
28770
- const [compactMode, setCompactMode] = useState26(false);
28771
- const [shellModeActive, setShellModeActive] = useState26(false);
28772
- const [showEscapePrompt, setShowEscapePrompt] = useState26(false);
28773
- const [messageQueue, setMessageQueue] = useState26([]);
28774
- const [historyRemountKey, setHistoryRemountKey] = useState26(0);
28775
- const [pendingItem, setPendingItem] = useState26(null);
28776
- const [isFeedbackDialogOpen, setIsFeedbackDialogOpen] = useState26(false);
28777
- const [lastPromptTokenCount, setLastPromptTokenCount] = useState26(0);
28778
- const [lastOutputTokenCount, setLastOutputTokenCount] = useState26(0);
28779
- const [elapsedTime, setElapsedTime] = useState26(0);
28780
- const [isReceivingContent, setIsReceivingContent] = useState26(false);
28781
- const [iterationInfo, setIterationInfo] = useState26(null);
28782
- const [liveToolCalls, setLiveToolCalls] = useState26([]);
28783
- const [taskPlan, setTaskPlan] = useState26(null);
28784
- const [taskStreams, setTaskStreams] = useState26({});
28785
- const [recentSlashCommandsState, setRecentSlashCommandsState] = useState26(/* @__PURE__ */ new Map());
28786
- const [activeDialog, setActiveDialog] = useState26(null);
28787
- const [themeName, setThemeName] = useState26("(unknown)");
28788
- const [permissionSummary, setPermissionSummary] = useState26("(unknown)");
28789
- const [authSummary, setAuthSummary] = useState26("(unknown)");
28790
- const [permissionModes, setPermissionModes] = useState26({
28816
+ const [compactMode, setCompactMode] = useState27(false);
28817
+ const [shellModeActive, setShellModeActive] = useState27(false);
28818
+ const [showEscapePrompt, setShowEscapePrompt] = useState27(false);
28819
+ const [messageQueue, setMessageQueue] = useState27([]);
28820
+ const [historyRemountKey, setHistoryRemountKey] = useState27(0);
28821
+ const [pendingItem, setPendingItem] = useState27(null);
28822
+ const [isFeedbackDialogOpen, setIsFeedbackDialogOpen] = useState27(false);
28823
+ const [lastPromptTokenCount, setLastPromptTokenCount] = useState27(0);
28824
+ const [lastOutputTokenCount, setLastOutputTokenCount] = useState27(0);
28825
+ const [elapsedTime, setElapsedTime] = useState27(0);
28826
+ const [isReceivingContent, setIsReceivingContent] = useState27(false);
28827
+ const [iterationInfo, setIterationInfo] = useState27(null);
28828
+ const [liveToolCalls, setLiveToolCalls] = useState27([]);
28829
+ const [taskPlan, setTaskPlan] = useState27(null);
28830
+ const [taskStreams, setTaskStreams] = useState27({});
28831
+ const [recentSlashCommandsState, setRecentSlashCommandsState] = useState27(/* @__PURE__ */ new Map());
28832
+ const [activeDialog, setActiveDialog] = useState27(null);
28833
+ const [themeName, setThemeName] = useState27("(unknown)");
28834
+ const [permissionSummary, setPermissionSummary] = useState27("(unknown)");
28835
+ const [authSummary, setAuthSummary] = useState27("(unknown)");
28836
+ const [permissionModes, setPermissionModes] = useState27({
28791
28837
  read: "allow",
28792
28838
  write: "ask",
28793
28839
  gitLocal: "allow",
28794
28840
  shell: "ask",
28795
28841
  dangerous: "ask"
28796
28842
  });
28797
- const [providerConfigVersion, setProviderConfigVersion] = useState26(0);
28798
- const [, setThemeVersion] = useState26(0);
28799
- const [mcpConnected, setMcpConnected] = useState26(0);
28800
- const [mcpTotal, setMcpTotal] = useState26(0);
28801
- const [subagentMap, setSubagentMap] = useState26(/* @__PURE__ */ new Map());
28802
- const [, setDrainTick] = useState26(0);
28803
- const [pendingCommandConfirmation, setPendingCommandConfirmation] = useState26(null);
28804
- const runtimeRef = useRef16(null);
28805
- const sessionRef = useRef16(null);
28806
- const configAdapterRef = useRef16(null);
28807
- const abortRef = useRef16(null);
28808
- const unsubscribeRef = useRef16([]);
28809
- const lastSubmittedPromptRef = useRef16(null);
28810
- const runStartedAtRef = useRef16(null);
28811
- const streamingResponseLengthRef = useRef16(0);
28812
- const drainingQueueRef = useRef16(false);
28813
- const messageQueueRef = useRef16([]);
28814
- const sessionShellAllowlistRef = useRef16(/* @__PURE__ */ new Set());
28815
- const mainControlsRef = useRef16(null);
28843
+ const [providerConfigVersion, setProviderConfigVersion] = useState27(0);
28844
+ const [, setThemeVersion] = useState27(0);
28845
+ const [mcpConnected, setMcpConnected] = useState27(0);
28846
+ const [mcpTotal, setMcpTotal] = useState27(0);
28847
+ const [subagentMap, setSubagentMap] = useState27(/* @__PURE__ */ new Map());
28848
+ const [, setDrainTick] = useState27(0);
28849
+ const [pendingCommandConfirmation, setPendingCommandConfirmation] = useState27(null);
28850
+ const runtimeRef = useRef17(null);
28851
+ const sessionRef = useRef17(null);
28852
+ const configAdapterRef = useRef17(null);
28853
+ const abortRef = useRef17(null);
28854
+ const unsubscribeRef = useRef17([]);
28855
+ const lastSubmittedPromptRef = useRef17(null);
28856
+ const runStartedAtRef = useRef17(null);
28857
+ const streamingResponseLengthRef = useRef17(0);
28858
+ const drainingQueueRef = useRef17(false);
28859
+ const messageQueueRef = useRef17([]);
28860
+ const sessionShellAllowlistRef = useRef17(/* @__PURE__ */ new Set());
28861
+ const mainControlsRef = useRef17(null);
28816
28862
  const { stdin, setRawMode } = useStdin3();
28817
28863
  const { columns: terminalWidth, rows: terminalHeight } = useTerminalSize();
28818
28864
  const mainAreaWidth = Math.min(Math.max(terminalWidth - 4, 20), 120);
@@ -28833,7 +28879,7 @@ var AppContainer = ({ cwd, config, provider, model }) => {
28833
28879
  []
28834
28880
  );
28835
28881
  const configAdapter = configAdapterRef.current ?? new DeepCodeConfigAdapter(cwd);
28836
- const isValidPath = useCallback22(
28882
+ const isValidPath = useCallback23(
28837
28883
  (candidate) => {
28838
28884
  const resolved = path112.resolve(cwd, candidate);
28839
28885
  const relative2 = path112.relative(cwd, resolved);
@@ -28878,9 +28924,9 @@ var AppContainer = ({ cwd, config, provider, model }) => {
28878
28924
  () => recentSlashCommandsState,
28879
28925
  [recentSlashCommandsState]
28880
28926
  );
28881
- const dismissPromptSuggestion = useCallback22(() => {
28882
- }, []);
28883
- const registerSlashCommandUsage = useCallback22((name) => {
28927
+ const [promptSuggestion, setPromptSuggestion] = useState27(null);
28928
+ const dismissPromptSuggestion = useCallback23(() => setPromptSuggestion(null), []);
28929
+ const registerSlashCommandUsage = useCallback23((name) => {
28884
28930
  setRecentSlashCommandsState((prev) => {
28885
28931
  const next = new Map(prev);
28886
28932
  const existing = next.get(name);
@@ -28892,8 +28938,8 @@ var AppContainer = ({ cwd, config, provider, model }) => {
28892
28938
  return next;
28893
28939
  });
28894
28940
  }, []);
28895
- const listAvailableProviders = useCallback22(() => PROVIDER_IDS, []);
28896
- const getSessionCommandState = useCallback22(() => {
28941
+ const listAvailableProviders = useCallback23(() => PROVIDER_IDS, []);
28942
+ const getSessionCommandState = useCallback23(() => {
28897
28943
  const runtime = runtimeRef.current;
28898
28944
  const session = sessionRef.current;
28899
28945
  const fallbackProvider = runtime?.config.defaultProvider ?? PROVIDER_IDS[0];
@@ -28905,7 +28951,7 @@ var AppContainer = ({ cwd, config, provider, model }) => {
28905
28951
  mode: agentMode
28906
28952
  };
28907
28953
  }, [agentMode]);
28908
- const setSessionProvider = useCallback22((provider2) => {
28954
+ const setSessionProvider = useCallback23((provider2) => {
28909
28955
  const runtime = runtimeRef.current;
28910
28956
  const session = sessionRef.current;
28911
28957
  if (!runtime || !session) return;
@@ -28925,7 +28971,7 @@ var AppContainer = ({ cwd, config, provider, model }) => {
28925
28971
  );
28926
28972
  }
28927
28973
  }, [historyManager]);
28928
- const setSessionModel = useCallback22((model2) => {
28974
+ const setSessionModel = useCallback23((model2) => {
28929
28975
  const runtime = runtimeRef.current;
28930
28976
  const session = sessionRef.current;
28931
28977
  if (!runtime || !session) return;
@@ -28936,7 +28982,7 @@ var AppContainer = ({ cwd, config, provider, model }) => {
28936
28982
  setCurrentModel(session.model ?? "(unconfigured)");
28937
28983
  setProviderLabel(formatProviderLabel(session.provider, session.model));
28938
28984
  }, []);
28939
- const setSessionMode = useCallback22((mode) => {
28985
+ const setSessionMode = useCallback23((mode) => {
28940
28986
  setAgentMode(mode);
28941
28987
  }, []);
28942
28988
  const sessionCommandServices = useMemo15(
@@ -29116,6 +29162,18 @@ var AppContainer = ({ cwd, config, provider, model }) => {
29116
29162
  });
29117
29163
  })
29118
29164
  );
29165
+ unsubscribers.push(
29166
+ runtime.events.on("subagent:chunk", ({ taskId, text }) => {
29167
+ setSubagentMap((prev) => {
29168
+ const entry = prev.get(taskId);
29169
+ if (!entry) return prev;
29170
+ const next = new Map(prev);
29171
+ const combined = ((entry.currentOutput ?? "") + text).slice(-80);
29172
+ next.set(taskId, { ...entry, currentOutput: combined });
29173
+ return next;
29174
+ });
29175
+ })
29176
+ );
29119
29177
  unsubscribers.push(
29120
29178
  runtime.events.on("subagent:tool", ({ taskId, toolName, active }) => {
29121
29179
  setSubagentMap((prev) => {
@@ -29172,7 +29230,7 @@ var AppContainer = ({ cwd, config, provider, model }) => {
29172
29230
  unsubscribeRef.current = [];
29173
29231
  };
29174
29232
  }, [addHistoryItem, config, cwd, model, provider]);
29175
- const resolveApproval = useCallback22(
29233
+ const resolveApproval = useCallback23(
29176
29234
  (decision) => {
29177
29235
  const runtime = runtimeRef.current;
29178
29236
  const current = approvalQueue[0];
@@ -29185,7 +29243,7 @@ var AppContainer = ({ cwd, config, provider, model }) => {
29185
29243
  },
29186
29244
  [approvalQueue]
29187
29245
  );
29188
- const appendTurnItems = useCallback22(
29246
+ const appendTurnItems = useCallback23(
29189
29247
  (items) => {
29190
29248
  const base = Date.now();
29191
29249
  for (const item of items) {
@@ -29194,7 +29252,7 @@ var AppContainer = ({ cwd, config, provider, model }) => {
29194
29252
  },
29195
29253
  [historyManager]
29196
29254
  );
29197
- const runPrompt = useCallback22(
29255
+ const runPrompt = useCallback23(
29198
29256
  async (rawPrompt) => {
29199
29257
  const runtime = runtimeRef.current;
29200
29258
  const session = sessionRef.current;
@@ -29203,6 +29261,7 @@ var AppContainer = ({ cwd, config, provider, model }) => {
29203
29261
  if (!prompt) return;
29204
29262
  historyManager.addItem({ type: "user", text: prompt }, Date.now());
29205
29263
  lastSubmittedPromptRef.current = prompt;
29264
+ setPromptSuggestion(null);
29206
29265
  setPendingAssistantText("");
29207
29266
  setIsRunning(true);
29208
29267
  setIsReceivingContent(false);
@@ -29255,6 +29314,14 @@ var AppContainer = ({ cwd, config, provider, model }) => {
29255
29314
  turnItems.push({ type: "gemini", text: output.trim() });
29256
29315
  }
29257
29316
  appendTurnItems(turnItems);
29317
+ const rt = runtimeRef.current;
29318
+ const sess = sessionRef.current;
29319
+ if (rt && sess && output.trim()) {
29320
+ generateFollowupSuggestion(rt, sess, output, controller.signal).then((s) => {
29321
+ if (s) setPromptSuggestion(s);
29322
+ }).catch(() => {
29323
+ });
29324
+ }
29258
29325
  } catch (error) {
29259
29326
  const aborted = controller.signal.aborted;
29260
29327
  const partialMessages = session.messages.slice(startIndex);
@@ -29276,7 +29343,7 @@ var AppContainer = ({ cwd, config, provider, model }) => {
29276
29343
  },
29277
29344
  [agentMode, appendTurnItems, historyManager]
29278
29345
  );
29279
- const executeClientToolCommand = useCallback22(
29346
+ const executeClientToolCommand = useCallback23(
29280
29347
  async (toolName, toolArgs) => {
29281
29348
  const runtime = runtimeRef.current;
29282
29349
  const session = sessionRef.current;
@@ -29369,7 +29436,7 @@ var AppContainer = ({ cwd, config, provider, model }) => {
29369
29436
  },
29370
29437
  [agentMode, historyManager]
29371
29438
  );
29372
- const applySlashCommandResult = useCallback22(
29439
+ const applySlashCommandResult = useCallback23(
29373
29440
  async (result, _rawInvocation) => {
29374
29441
  if (!result) return;
29375
29442
  switch (result.type) {
@@ -29430,7 +29497,7 @@ var AppContainer = ({ cwd, config, provider, model }) => {
29430
29497
  },
29431
29498
  [appendTurnItems, executeClientToolCommand, historyManager, runPrompt]
29432
29499
  );
29433
- const executeSlashCommand = useCallback22(
29500
+ const executeSlashCommand = useCallback23(
29434
29501
  async (rawInput, overwriteConfirmed = false) => {
29435
29502
  const trimmed = rawInput.trim();
29436
29503
  if (!trimmed.startsWith("/")) return false;
@@ -29503,7 +29570,7 @@ var AppContainer = ({ cwd, config, provider, model }) => {
29503
29570
  slashCommands
29504
29571
  ]
29505
29572
  );
29506
- const executeSubmission = useCallback22(
29573
+ const executeSubmission = useCallback23(
29507
29574
  async (value) => {
29508
29575
  const trimmed = value.trim();
29509
29576
  if (!trimmed) return;
@@ -29513,7 +29580,7 @@ var AppContainer = ({ cwd, config, provider, model }) => {
29513
29580
  },
29514
29581
  [executeSlashCommand, runPrompt]
29515
29582
  );
29516
- const handleFinalSubmit = useCallback22(
29583
+ const handleFinalSubmit = useCallback23(
29517
29584
  (value) => {
29518
29585
  const prompt = value.trim();
29519
29586
  if (!prompt) return;
@@ -29539,7 +29606,7 @@ var AppContainer = ({ cwd, config, provider, model }) => {
29539
29606
  isRunning
29540
29607
  ]
29541
29608
  );
29542
- const handleRetryLastPrompt = useCallback22(() => {
29609
+ const handleRetryLastPrompt = useCallback23(() => {
29543
29610
  const lastPrompt = lastSubmittedPromptRef.current;
29544
29611
  if (!lastPrompt) {
29545
29612
  historyManager.addItem(
@@ -29554,7 +29621,7 @@ var AppContainer = ({ cwd, config, provider, model }) => {
29554
29621
  }
29555
29622
  void runPrompt(lastPrompt);
29556
29623
  }, [approvalQueue.length, historyManager, isInitializing, isRunning, runPrompt]);
29557
- const resolveCommandConfirmation = useCallback22(
29624
+ const resolveCommandConfirmation = useCallback23(
29558
29625
  (confirmed) => {
29559
29626
  const pending = pendingCommandConfirmation;
29560
29627
  if (!pending) return;
@@ -29585,7 +29652,7 @@ var AppContainer = ({ cwd, config, provider, model }) => {
29585
29652
  pendingCommandConfirmation
29586
29653
  ]
29587
29654
  );
29588
- const persistConfig = useCallback22(
29655
+ const persistConfig = useCallback23(
29589
29656
  async (mutate) => {
29590
29657
  const loader = new ConfigLoader();
29591
29658
  const options = { cwd, configPath: config };
@@ -29594,7 +29661,7 @@ var AppContainer = ({ cwd, config, provider, model }) => {
29594
29661
  },
29595
29662
  [config, cwd]
29596
29663
  );
29597
- const handleSelectTheme = useCallback22(
29664
+ const handleSelectTheme = useCallback23(
29598
29665
  (nextThemeName) => {
29599
29666
  themeManager.setActiveTheme(nextThemeName);
29600
29667
  setThemeName(themeManager.getActiveTheme().name);
@@ -29615,7 +29682,7 @@ var AppContainer = ({ cwd, config, provider, model }) => {
29615
29682
  },
29616
29683
  [cwd, historyManager]
29617
29684
  );
29618
- const handleSavePermissions = useCallback22(
29685
+ const handleSavePermissions = useCallback23(
29619
29686
  (modes) => {
29620
29687
  setPermissionModes(modes);
29621
29688
  setPermissionSummary(formatPermissionSummary(modes));
@@ -29644,7 +29711,7 @@ var AppContainer = ({ cwd, config, provider, model }) => {
29644
29711
  },
29645
29712
  [historyManager, persistConfig]
29646
29713
  );
29647
- const handlePersistToken = useCallback22(
29714
+ const handlePersistToken = useCallback23(
29648
29715
  async (token) => {
29649
29716
  await persistConfig((cfg) => ({
29650
29717
  ...cfg,
@@ -29658,12 +29725,12 @@ var AppContainer = ({ cwd, config, provider, model }) => {
29658
29725
  },
29659
29726
  [persistConfig]
29660
29727
  );
29661
- const providerHasApiKey = useCallback22((provider2) => {
29728
+ const providerHasApiKey = useCallback23((provider2) => {
29662
29729
  const runtime = runtimeRef.current;
29663
29730
  void providerConfigVersion;
29664
29731
  return Boolean(runtime?.config.providers[provider2]?.apiKey?.trim());
29665
29732
  }, [providerConfigVersion]);
29666
- const getProviderKeyHint = useCallback22((provider2) => {
29733
+ const getProviderKeyHint = useCallback23((provider2) => {
29667
29734
  const runtime = runtimeRef.current;
29668
29735
  void providerConfigVersion;
29669
29736
  const key = runtime?.config.providers[provider2]?.apiKey?.trim();
@@ -29671,7 +29738,7 @@ var AppContainer = ({ cwd, config, provider, model }) => {
29671
29738
  if (key.length <= 8) return "\u25CF".repeat(key.length);
29672
29739
  return `${key.slice(0, 6)}\u25CF\u25CF\u25CF\u25CF${key.slice(-4)}`;
29673
29740
  }, [providerConfigVersion]);
29674
- const handleSaveProviderApiKey = useCallback22(
29741
+ const handleSaveProviderApiKey = useCallback23(
29675
29742
  async (provider2, apiKey) => {
29676
29743
  await persistConfig((cfg) => ({
29677
29744
  ...cfg,
@@ -29696,7 +29763,7 @@ var AppContainer = ({ cwd, config, provider, model }) => {
29696
29763
  },
29697
29764
  [historyManager, persistConfig]
29698
29765
  );
29699
- const handleSetDefaultProvider = useCallback22(
29766
+ const handleSetDefaultProvider = useCallback23(
29700
29767
  async (provider2) => {
29701
29768
  const runtime = runtimeRef.current;
29702
29769
  const session = sessionRef.current;
@@ -29738,7 +29805,7 @@ var AppContainer = ({ cwd, config, provider, model }) => {
29738
29805
  },
29739
29806
  [historyManager, persistConfig]
29740
29807
  );
29741
- const handleTestProvider = useCallback22(
29808
+ const handleTestProvider = useCallback23(
29742
29809
  async (provider2) => {
29743
29810
  const runtime = runtimeRef.current;
29744
29811
  const session = sessionRef.current;
@@ -29786,7 +29853,7 @@ var AppContainer = ({ cwd, config, provider, model }) => {
29786
29853
  },
29787
29854
  []
29788
29855
  );
29789
- const handleFetchModels = useCallback22(
29856
+ const handleFetchModels = useCallback23(
29790
29857
  async (provider2, signal) => {
29791
29858
  const runtime = runtimeRef.current;
29792
29859
  if (!runtime) throw new Error("Runtime not ready.");
@@ -29794,15 +29861,15 @@ var AppContainer = ({ cwd, config, provider, model }) => {
29794
29861
  },
29795
29862
  []
29796
29863
  );
29797
- const handleSelectModel = useCallback22(
29864
+ const handleSelectModel = useCallback23(
29798
29865
  (modelId) => {
29799
29866
  setSessionModel(modelId);
29800
29867
  setActiveDialog(null);
29801
29868
  },
29802
29869
  [setSessionModel]
29803
29870
  );
29804
- const closeDialog = useCallback22(() => setActiveDialog(null), []);
29805
- const previewTheme = useCallback22(() => setThemeVersion((version) => version + 1), []);
29871
+ const closeDialog = useCallback23(() => setActiveDialog(null), []);
29872
+ const previewTheme = useCallback23(() => setThemeVersion((version) => version + 1), []);
29806
29873
  useEffect25(() => {
29807
29874
  if (drainingQueueRef.current || isRunning || isInitializing || Boolean(initError) || approvalQueue.length > 0 || messageQueue.length === 0) {
29808
29875
  return;
@@ -29958,7 +30025,7 @@ var AppContainer = ({ cwd, config, provider, model }) => {
29958
30025
  commandContext,
29959
30026
  recentSlashCommands,
29960
30027
  embeddedShellFocused: false,
29961
- promptSuggestion: null,
30028
+ promptSuggestion,
29962
30029
  dismissPromptSuggestion,
29963
30030
  terminalWidth,
29964
30031
  terminalHeight,
@@ -29997,6 +30064,7 @@ var AppContainer = ({ cwd, config, provider, model }) => {
29997
30064
  currentModel,
29998
30065
  cwd,
29999
30066
  dismissPromptSuggestion,
30067
+ promptSuggestion,
30000
30068
  elapsedTime,
30001
30069
  historyManager,
30002
30070
  historyRemountKey,