@cofy-x/dsh-console 0.1.0-alpha.11 → 0.1.0-alpha.13

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.
@@ -6402,7 +6402,7 @@ import { Box as Box25 } from "ink";
6402
6402
  import { Box as Box21, Text as Text21 } from "ink";
6403
6403
 
6404
6404
  // src/generated/git-commit.ts
6405
- var GIT_COMMIT_INFO = "c20eaa5";
6405
+ var GIT_COMMIT_INFO = "d287de5";
6406
6406
 
6407
6407
  // src/ui/components/dialogs/about-box.tsx
6408
6408
  import { jsx as jsx28, jsxs as jsxs21 } from "react/jsx-runtime";
@@ -7040,7 +7040,7 @@ var QuittingDisplay = () => {
7040
7040
  };
7041
7041
 
7042
7042
  // src/ui/components/layout/screen-reader-app-layout.tsx
7043
- import { Box as Box65 } from "ink";
7043
+ import { Box as Box66 } from "ink";
7044
7044
 
7045
7045
  // src/ui/components/indicators/notifications.tsx
7046
7046
  import { Box as Box27, Text as Text26, useIsScreenReaderEnabled as useIsScreenReaderEnabled3 } from "ink";
@@ -8629,6 +8629,7 @@ var Command = /* @__PURE__ */ ((Command2) => {
8629
8629
  Command2["TOGGLE_MARKDOWN"] = "app.toggleMarkdown";
8630
8630
  Command2["TOGGLE_COPY_MODE"] = "app.toggleCopyMode";
8631
8631
  Command2["SHOW_MORE_LINES"] = "app.showMoreLines";
8632
+ Command2["TOGGLE_PLAN_MODE"] = "app.togglePlanMode";
8632
8633
  Command2["FOCUS_SHELL_INPUT"] = "app.focusShellInput";
8633
8634
  Command2["UNFOCUS_SHELL_INPUT"] = "app.unfocusShellInput";
8634
8635
  Command2["CLEAR_SCREEN"] = "app.clearScreen";
@@ -8768,6 +8769,7 @@ var defaultKeyBindings = {
8768
8769
  { key: "o", ctrl: true },
8769
8770
  { key: "s", ctrl: true }
8770
8771
  ],
8772
+ ["app.togglePlanMode" /* TOGGLE_PLAN_MODE */]: [{ key: "tab", shift: true }],
8771
8773
  ["app.focusShellInput" /* FOCUS_SHELL_INPUT */]: [{ key: "tab", shift: false }],
8772
8774
  ["app.unfocusShellInput" /* UNFOCUS_SHELL_INPUT */]: [{ key: "tab" }],
8773
8775
  ["app.clearScreen" /* CLEAR_SCREEN */]: [{ key: "l", ctrl: true }],
@@ -14350,7 +14352,7 @@ var DialogManager = ({ terminalWidth }) => {
14350
14352
 
14351
14353
  // src/ui/components/input/composer.tsx
14352
14354
  import { useState as useState34 } from "react";
14353
- import { Box as Box59, useIsScreenReaderEnabled as useIsScreenReaderEnabled4 } from "ink";
14355
+ import { Box as Box60, useIsScreenReaderEnabled as useIsScreenReaderEnabled4 } from "ink";
14354
14356
 
14355
14357
  // src/ui/components/indicators/loading-indicator.tsx
14356
14358
  import { Box as Box46, Text as Text40 } from "ink";
@@ -14454,9 +14456,9 @@ var LoadingIndicator = ({
14454
14456
  // src/ui/components/indicators/shell-mode-indicator.tsx
14455
14457
  import { Box as Box47, Text as Text41 } from "ink";
14456
14458
  import { jsx as jsx61, jsxs as jsxs43 } from "react/jsx-runtime";
14457
- var ShellModeIndicator = () => /* @__PURE__ */ jsx61(Box47, { children: /* @__PURE__ */ jsxs43(Text41, { color: theme.ui.symbol, children: [
14458
- "shell mode enabled",
14459
- /* @__PURE__ */ jsx61(Text41, { color: theme.text.secondary, children: " (esc to disable)" })
14459
+ var ShellModeIndicator = () => /* @__PURE__ */ jsx61(Box47, { paddingX: 1, children: /* @__PURE__ */ jsxs43(Text41, { color: theme.status.warning, bold: true, children: [
14460
+ "Shell mode",
14461
+ /* @__PURE__ */ jsx61(Text41, { color: theme.text.secondary, children: " (Esc to disable)" })
14460
14462
  ] }) });
14461
14463
 
14462
14464
  // src/ui/components/indicators/detailed-messages-display.tsx
@@ -16233,6 +16235,21 @@ var parseSlashCommand = (query, commands) => {
16233
16235
  return { commandToExecute, args, canonicalPath };
16234
16236
  };
16235
16237
 
16238
+ // src/ui/components/input/interaction-mode-style.ts
16239
+ var interactionModeColor = (kind) => {
16240
+ switch (kind) {
16241
+ case "plan":
16242
+ return themeManager.getActiveTheme().colors.AccentCyan;
16243
+ case "full-access":
16244
+ return theme.status.error;
16245
+ case "permission":
16246
+ return theme.status.warning;
16247
+ default:
16248
+ return void 0;
16249
+ }
16250
+ };
16251
+ var interactionModeLabel = (kind, label) => kind === "default" || kind === "plan" ? `${label} mode` : label;
16252
+
16236
16253
  // src/ui/components/input/input-prompt.tsx
16237
16254
  import { Fragment as Fragment13, jsx as jsx66, jsxs as jsxs48 } from "react/jsx-runtime";
16238
16255
  function isTerminalPasteTrusted(kittyProtocolSupported) {
@@ -16272,7 +16289,9 @@ var InputPrompt = ({
16272
16289
  streamingState,
16273
16290
  popAllMessages,
16274
16291
  suggestionsPosition = "below",
16275
- promptCompletionRuntime
16292
+ promptCompletionRuntime,
16293
+ interactionMode,
16294
+ onTogglePlanMode
16276
16295
  }) => {
16277
16296
  const { stdout } = useStdout2();
16278
16297
  const { merged: settings } = useSettings();
@@ -16552,6 +16571,11 @@ var InputPrompt = ({
16552
16571
  if (vimHandleInput && vimHandleInput(key)) {
16553
16572
  return;
16554
16573
  }
16574
+ if (!reverseSearchActive && !commandSearchActive && !completion.showSuggestions && interactionMode.canTogglePlan && !interactionMode.busy && keyMatchers["app.togglePlanMode" /* TOGGLE_PLAN_MODE */](key)) {
16575
+ if (shellModeActive) setShellModeActive(false);
16576
+ onTogglePlanMode(shellModeActive ? true : void 0);
16577
+ return;
16578
+ }
16555
16579
  if (key.name !== "escape") {
16556
16580
  if (escPressCount.current > 0 || showEscapePrompt) {
16557
16581
  resetEscapeState();
@@ -16875,7 +16899,9 @@ var InputPrompt = ({
16875
16899
  kittyProtocol.enabled,
16876
16900
  tryLoadQueuedMessages,
16877
16901
  activePtyId,
16878
- setEmbeddedShellFocused
16902
+ setEmbeddedShellFocused,
16903
+ interactionMode,
16904
+ onTogglePlanMode
16879
16905
  ]
16880
16906
  );
16881
16907
  useKeypress(handleInput, { isActive: !isEmbeddedShellFocused });
@@ -17002,10 +17028,16 @@ var InputPrompt = ({
17002
17028
  }
17003
17029
  }, [shouldShowSuggestions, onSuggestionsVisibilityChange]);
17004
17030
  let statusColor2;
17005
- let statusText = "";
17031
+ let statusText;
17006
17032
  if (shellModeActive) {
17007
- statusColor2 = theme.ui.symbol;
17033
+ statusColor2 = theme.status.warning;
17008
17034
  statusText = "Shell mode";
17035
+ } else {
17036
+ statusColor2 = interactionModeColor(interactionMode.kind);
17037
+ statusText = interactionModeLabel(
17038
+ interactionMode.kind,
17039
+ interactionMode.label
17040
+ );
17009
17041
  }
17010
17042
  const suggestionsNode = shouldShowSuggestions ? /* @__PURE__ */ jsx66(Box51, { paddingRight: 2, children: /* @__PURE__ */ jsx66(
17011
17043
  SuggestionsDisplay,
@@ -17020,7 +17052,7 @@ var InputPrompt = ({
17020
17052
  expandedIndex: expandedSuggestionIndex
17021
17053
  }
17022
17054
  ) }) : null;
17023
- const borderColor = isShellFocused && !isEmbeddedShellFocused ? statusColor2 ?? theme.border.focused : theme.border.default;
17055
+ const borderColor = statusColor2 ? statusColor2 : isShellFocused && !isEmbeddedShellFocused ? theme.border.focused : theme.border.default;
17024
17056
  return /* @__PURE__ */ jsxs48(Fragment13, { children: [
17025
17057
  suggestionsPosition === "above" && suggestionsNode,
17026
17058
  useLineFallback ? /* @__PURE__ */ jsx66(
@@ -17041,8 +17073,8 @@ var InputPrompt = ({
17041
17073
  /* @__PURE__ */ jsx66(
17042
17074
  HalfLinePaddedBox,
17043
17075
  {
17044
- backgroundBaseColor: isShellFocused && !isEmbeddedShellFocused ? theme.border.focused : theme.border.default,
17045
- backgroundOpacity: DEFAULT_BACKGROUND_OPACITY,
17076
+ backgroundBaseColor: isShellFocused && !isEmbeddedShellFocused ? statusColor2 ?? theme.border.focused : theme.border.default,
17077
+ backgroundOpacity: !shellModeActive && interactionMode.kind === "plan" ? DEFAULT_BACKGROUND_OPACITY / 2 : DEFAULT_BACKGROUND_OPACITY,
17046
17078
  useBackgroundColor,
17047
17079
  children: /* @__PURE__ */ jsxs48(
17048
17080
  Box51,
@@ -17798,8 +17830,45 @@ var StatusDisplay = () => {
17798
17830
  return null;
17799
17831
  };
17800
17832
 
17833
+ // src/ui/components/input/interaction-mode-indicator.tsx
17834
+ import { Box as Box59, Text as Text56 } from "ink";
17835
+ import { Fragment as Fragment16, jsx as jsx76, jsxs as jsxs57 } from "react/jsx-runtime";
17836
+ var InteractionModeIndicator = ({
17837
+ mode
17838
+ }) => {
17839
+ if (mode.kind === "unavailable" || mode.kind === "default" && !mode.pending)
17840
+ return null;
17841
+ const label = interactionModeLabel(mode.kind, mode.label);
17842
+ return /* @__PURE__ */ jsx76(Box59, { paddingX: 1, children: /* @__PURE__ */ jsxs57(
17843
+ Text56,
17844
+ {
17845
+ bold: true,
17846
+ color: interactionModeColor(mode.kind) ?? theme.text.secondary,
17847
+ "aria-label": `Interaction mode: ${label}${mode.showPermission && mode.permissionLabel ? `, permission: ${mode.permissionLabel}` : ""}${mode.pending ? ", pending" : ""}`,
17848
+ children: [
17849
+ label,
17850
+ mode.showPermission && mode.permissionLabel && /* @__PURE__ */ jsxs57(Fragment16, { children: [
17851
+ /* @__PURE__ */ jsxs57(Text56, { color: theme.text.secondary, children: [
17852
+ " ",
17853
+ " ["
17854
+ ] }),
17855
+ /* @__PURE__ */ jsx76(
17856
+ Text56,
17857
+ {
17858
+ color: mode.permissionRequiresConfirmation ? theme.status.error : theme.text.secondary,
17859
+ children: mode.permissionLabel
17860
+ }
17861
+ ),
17862
+ /* @__PURE__ */ jsx76(Text56, { color: theme.text.secondary, children: "]" })
17863
+ ] }),
17864
+ mode.busy ? /* @__PURE__ */ jsx76(Text56, { color: theme.text.secondary, children: " (switching...)" }) : mode.pending ? /* @__PURE__ */ jsx76(Text56, { color: theme.text.secondary, children: " (pending)" }) : null
17865
+ ]
17866
+ }
17867
+ ) });
17868
+ };
17869
+
17801
17870
  // src/ui/components/input/composer.tsx
17802
- import { jsx as jsx76, jsxs as jsxs57 } from "react/jsx-runtime";
17871
+ import { Fragment as Fragment17, jsx as jsx77, jsxs as jsxs58 } from "react/jsx-runtime";
17803
17872
  var Composer = ({ isFocused = true }) => {
17804
17873
  const config = useConfig();
17805
17874
  const settings = useSettings();
@@ -17813,26 +17882,26 @@ var Composer = ({ isFocused = true }) => {
17813
17882
  const [, setSuggestionsVisible] = useState34(false);
17814
17883
  const isAlternateBuffer = useAlternateBuffer();
17815
17884
  const suggestionsPosition = isAlternateBuffer ? "above" : "below";
17816
- return /* @__PURE__ */ jsxs57(
17817
- Box59,
17885
+ return /* @__PURE__ */ jsxs58(
17886
+ Box60,
17818
17887
  {
17819
17888
  flexDirection: "column",
17820
17889
  width: uiState.terminalWidth,
17821
17890
  flexGrow: 0,
17822
17891
  flexShrink: 0,
17823
17892
  children: [
17824
- !uiState.embeddedShellFocused && /* @__PURE__ */ jsx76(
17893
+ !uiState.embeddedShellFocused && /* @__PURE__ */ jsx77(
17825
17894
  LoadingIndicator,
17826
17895
  {
17827
17896
  currentLoadingPhrase: config.getAccessibility()?.enableLoadingPhrases === false ? void 0 : uiState.currentLoadingPhrase,
17828
17897
  elapsedTime: uiState.elapsedTime
17829
17898
  }
17830
17899
  ),
17831
- !uiState.slashCommands && /* @__PURE__ */ jsx76(CommandInitDisplay, {}),
17832
- /* @__PURE__ */ jsx76(QueuedMessageDisplay, { messageQueue: uiState.messageQueue }),
17833
- /* @__PURE__ */ jsx76(TodoTray, {}),
17834
- /* @__PURE__ */ jsxs57(
17835
- Box59,
17900
+ !uiState.slashCommands && /* @__PURE__ */ jsx77(CommandInitDisplay, {}),
17901
+ /* @__PURE__ */ jsx77(QueuedMessageDisplay, { messageQueue: uiState.messageQueue }),
17902
+ /* @__PURE__ */ jsx77(TodoTray, {}),
17903
+ /* @__PURE__ */ jsxs58(
17904
+ Box60,
17836
17905
  {
17837
17906
  marginTop: 1,
17838
17907
  justifyContent: "space-between",
@@ -17840,16 +17909,13 @@ var Composer = ({ isFocused = true }) => {
17840
17909
  flexDirection: isNarrow ? "column" : "row",
17841
17910
  alignItems: isNarrow ? "flex-start" : "center",
17842
17911
  children: [
17843
- /* @__PURE__ */ jsx76(Box59, { marginRight: 1, children: /* @__PURE__ */ jsx76(StatusDisplay, {}) }),
17844
- /* @__PURE__ */ jsxs57(Box59, { paddingTop: isNarrow ? 1 : 0, children: [
17845
- uiState.shellModeActive && /* @__PURE__ */ jsx76(ShellModeIndicator, {}),
17846
- !uiState.renderMarkdown && /* @__PURE__ */ jsx76(RawMarkdownIndicator, {})
17847
- ] })
17912
+ /* @__PURE__ */ jsx77(Box60, { marginRight: 1, children: /* @__PURE__ */ jsx77(StatusDisplay, {}) }),
17913
+ /* @__PURE__ */ jsx77(Box60, { paddingTop: isNarrow ? 1 : 0, children: !uiState.renderMarkdown && /* @__PURE__ */ jsx77(RawMarkdownIndicator, {}) })
17848
17914
  ]
17849
17915
  }
17850
17916
  ),
17851
- uiState.showErrorDetails && /* @__PURE__ */ jsx76(OverflowProvider, { children: /* @__PURE__ */ jsxs57(Box59, { flexDirection: "column", children: [
17852
- /* @__PURE__ */ jsx76(
17917
+ uiState.showErrorDetails && /* @__PURE__ */ jsx77(OverflowProvider, { children: /* @__PURE__ */ jsxs58(Box60, { flexDirection: "column", children: [
17918
+ /* @__PURE__ */ jsx77(
17853
17919
  DetailedMessagesDisplay,
17854
17920
  {
17855
17921
  messages: uiState.filteredConsoleMessages,
@@ -17858,49 +17924,54 @@ var Composer = ({ isFocused = true }) => {
17858
17924
  hasFocus: uiState.showErrorDetails
17859
17925
  }
17860
17926
  ),
17861
- /* @__PURE__ */ jsx76(ShowMoreLines, { constrainHeight: uiState.constrainHeight })
17927
+ /* @__PURE__ */ jsx77(ShowMoreLines, { constrainHeight: uiState.constrainHeight })
17862
17928
  ] }) }),
17863
- uiState.isInputActive && /* @__PURE__ */ jsx76(
17864
- InputPrompt,
17865
- {
17866
- buffer: uiState.buffer,
17867
- inputWidth: uiState.inputWidth,
17868
- suggestionsWidth: uiState.suggestionsWidth,
17869
- onSubmit: uiActions.handleFinalSubmit,
17870
- userMessages: uiState.userMessages,
17871
- promptCompletionRuntime: uiState.promptCompletionRuntime,
17872
- onClearScreen: uiActions.handleClearScreen,
17873
- config,
17874
- slashCommands: uiState.slashCommands || [],
17875
- commandContext: uiState.commandContext,
17876
- shellModeActive: uiState.shellModeActive,
17877
- setShellModeActive: uiActions.setShellModeActive,
17878
- onEscapePromptChange: uiActions.onEscapePromptChange,
17879
- focus: isFocused,
17880
- vimHandleInput: uiActions.vimHandleInput,
17881
- isEmbeddedShellFocused: uiState.embeddedShellFocused,
17882
- popAllMessages: uiActions.popAllMessages,
17883
- placeholder: vimEnabled ? " Press 'i' for INSERT mode and 'Esc' for NORMAL mode." : uiState.shellModeActive ? " Type your shell command" : " Type your message or @path/to/file",
17884
- setQueueErrorMessage: uiActions.setQueueErrorMessage,
17885
- streamingState: uiState.streamingState,
17886
- suggestionsPosition,
17887
- onSuggestionsVisibilityChange: setSuggestionsVisible
17888
- }
17889
- ),
17890
- !settings.merged.ui.hideFooter && !isScreenReaderEnabled && /* @__PURE__ */ jsx76(Footer, {})
17929
+ uiState.isInputActive && /* @__PURE__ */ jsxs58(Fragment17, { children: [
17930
+ uiState.shellModeActive ? /* @__PURE__ */ jsx77(ShellModeIndicator, {}) : /* @__PURE__ */ jsx77(InteractionModeIndicator, { mode: uiState.interactionMode }),
17931
+ /* @__PURE__ */ jsx77(
17932
+ InputPrompt,
17933
+ {
17934
+ buffer: uiState.buffer,
17935
+ inputWidth: uiState.inputWidth,
17936
+ suggestionsWidth: uiState.suggestionsWidth,
17937
+ onSubmit: uiActions.handleFinalSubmit,
17938
+ userMessages: uiState.userMessages,
17939
+ promptCompletionRuntime: uiState.promptCompletionRuntime,
17940
+ onClearScreen: uiActions.handleClearScreen,
17941
+ config,
17942
+ slashCommands: uiState.slashCommands || [],
17943
+ commandContext: uiState.commandContext,
17944
+ shellModeActive: uiState.shellModeActive,
17945
+ setShellModeActive: uiActions.setShellModeActive,
17946
+ onEscapePromptChange: uiActions.onEscapePromptChange,
17947
+ focus: isFocused,
17948
+ vimHandleInput: uiActions.vimHandleInput,
17949
+ isEmbeddedShellFocused: uiState.embeddedShellFocused,
17950
+ popAllMessages: uiActions.popAllMessages,
17951
+ placeholder: vimEnabled ? " Press 'i' for INSERT mode and 'Esc' for NORMAL mode." : uiState.shellModeActive ? " Type your shell command" : " Type your message or @path/to/file",
17952
+ setQueueErrorMessage: uiActions.setQueueErrorMessage,
17953
+ streamingState: uiState.streamingState,
17954
+ suggestionsPosition,
17955
+ onSuggestionsVisibilityChange: setSuggestionsVisible,
17956
+ interactionMode: uiState.interactionMode,
17957
+ onTogglePlanMode: uiActions.togglePlanMode
17958
+ }
17959
+ )
17960
+ ] }),
17961
+ !settings.merged.ui.hideFooter && !isScreenReaderEnabled && /* @__PURE__ */ jsx77(Footer, {})
17891
17962
  ]
17892
17963
  }
17893
17964
  );
17894
17965
  };
17895
17966
 
17896
17967
  // src/ui/components/dialogs/exit-warning.tsx
17897
- import { Box as Box60, Text as Text56 } from "ink";
17898
- import { Fragment as Fragment16, jsx as jsx77, jsxs as jsxs58 } from "react/jsx-runtime";
17968
+ import { Box as Box61, Text as Text57 } from "ink";
17969
+ import { Fragment as Fragment18, jsx as jsx78, jsxs as jsxs59 } from "react/jsx-runtime";
17899
17970
  var ExitWarning = () => {
17900
17971
  const uiState = useUIState();
17901
- return /* @__PURE__ */ jsxs58(Fragment16, { children: [
17902
- uiState.dialogsVisible && uiState.ctrlCPressedOnce && /* @__PURE__ */ jsx77(Box60, { marginTop: 1, children: /* @__PURE__ */ jsx77(Text56, { color: theme.status.warning, children: "Press Ctrl+C again to exit." }) }),
17903
- uiState.dialogsVisible && uiState.ctrlDPressedOnce && /* @__PURE__ */ jsx77(Box60, { marginTop: 1, children: /* @__PURE__ */ jsx77(Text56, { color: theme.status.warning, children: "Press Ctrl+D again to exit." }) })
17972
+ return /* @__PURE__ */ jsxs59(Fragment18, { children: [
17973
+ uiState.dialogsVisible && uiState.ctrlCPressedOnce && /* @__PURE__ */ jsx78(Box61, { marginTop: 1, children: /* @__PURE__ */ jsx78(Text57, { color: theme.status.warning, children: "Press Ctrl+C again to exit." }) }),
17974
+ uiState.dialogsVisible && uiState.ctrlDPressedOnce && /* @__PURE__ */ jsx78(Box61, { marginTop: 1, children: /* @__PURE__ */ jsx78(Text57, { color: theme.status.warning, children: "Press Ctrl+D again to exit." }) })
17904
17975
  ] });
17905
17976
  };
17906
17977
 
@@ -17929,7 +18000,7 @@ import {
17929
18000
  useMemo as useMemo24,
17930
18001
  useSyncExternalStore
17931
18002
  } from "react";
17932
- import { jsx as jsx78 } from "react/jsx-runtime";
18003
+ import { jsx as jsx79 } from "react/jsx-runtime";
17933
18004
  var ApprovalContext = createContext12(
17934
18005
  void 0
17935
18006
  );
@@ -17940,7 +18011,7 @@ var ApprovalRuntimeProvider = ({ runtime, children }) => {
17940
18011
  runtime.getSnapshot
17941
18012
  );
17942
18013
  const value = useMemo24(() => ({ runtime, snapshot }), [runtime, snapshot]);
17943
- return /* @__PURE__ */ jsx78(ApprovalContext.Provider, { value, children });
18014
+ return /* @__PURE__ */ jsx79(ApprovalContext.Provider, { value, children });
17944
18015
  };
17945
18016
  function useApprovalRuntime() {
17946
18017
  const value = useContext13(ApprovalContext);
@@ -17959,7 +18030,7 @@ import {
17959
18030
  useMemo as useMemo25,
17960
18031
  useSyncExternalStore as useSyncExternalStore2
17961
18032
  } from "react";
17962
- import { jsx as jsx79 } from "react/jsx-runtime";
18033
+ import { jsx as jsx80 } from "react/jsx-runtime";
17963
18034
  var UserQuestionContext = createContext13(void 0);
17964
18035
  var UserQuestionRuntimeProvider = ({ runtime, children }) => {
17965
18036
  const snapshot = useSyncExternalStore2(
@@ -17968,7 +18039,7 @@ var UserQuestionRuntimeProvider = ({ runtime, children }) => {
17968
18039
  runtime.getSnapshot
17969
18040
  );
17970
18041
  const value = useMemo25(() => ({ runtime, snapshot }), [runtime, snapshot]);
17971
- return /* @__PURE__ */ jsx79(UserQuestionContext.Provider, { value, children });
18042
+ return /* @__PURE__ */ jsx80(UserQuestionContext.Provider, { value, children });
17972
18043
  };
17973
18044
  function useUserQuestionRuntime() {
17974
18045
  const value = useContext14(UserQuestionContext);
@@ -17981,12 +18052,12 @@ function useUserQuestionRuntime() {
17981
18052
  }
17982
18053
 
17983
18054
  // src/ui/components/dialogs/tool-confirmation-queue.tsx
17984
- import { Box as Box62, Text as Text58 } from "ink";
18055
+ import { Box as Box63, Text as Text59 } from "ink";
17985
18056
 
17986
18057
  // src/ui/components/messages/tool-confirmation-message.tsx
17987
- import { Box as Box61, Text as Text57 } from "ink";
18058
+ import { Box as Box62, Text as Text58 } from "ink";
17988
18059
  import { useMemo as useMemo26 } from "react";
17989
- import { jsx as jsx80, jsxs as jsxs59 } from "react/jsx-runtime";
18060
+ import { jsx as jsx81, jsxs as jsxs60 } from "react/jsx-runtime";
17990
18061
  var ToolConfirmationMessage = ({ request, respond, isFocused }) => {
17991
18062
  useKeypress(
17992
18063
  (key) => {
@@ -18007,14 +18078,14 @@ var ToolConfirmationMessage = ({ request, respond, isFocused }) => {
18007
18078
  ],
18008
18079
  []
18009
18080
  );
18010
- return /* @__PURE__ */ jsxs59(Box61, { flexDirection: "column", paddingBottom: 1, children: [
18011
- request.reason !== void 0 && /* @__PURE__ */ jsx80(Box61, { marginBottom: 1, children: /* @__PURE__ */ jsx80(Text57, { color: theme.text.secondary, children: request.reason }) }),
18012
- /* @__PURE__ */ jsx80(Box61, { marginBottom: 1, children: /* @__PURE__ */ jsxs59(Text57, { color: theme.text.primary, children: [
18081
+ return /* @__PURE__ */ jsxs60(Box62, { flexDirection: "column", paddingBottom: 1, children: [
18082
+ request.reason !== void 0 && /* @__PURE__ */ jsx81(Box62, { marginBottom: 1, children: /* @__PURE__ */ jsx81(Text58, { color: theme.text.secondary, children: request.reason }) }),
18083
+ /* @__PURE__ */ jsx81(Box62, { marginBottom: 1, children: /* @__PURE__ */ jsxs60(Text58, { color: theme.text.primary, children: [
18013
18084
  "Allow ",
18014
- /* @__PURE__ */ jsx80(Text57, { bold: true, children: request.toolName }),
18085
+ /* @__PURE__ */ jsx81(Text58, { bold: true, children: request.toolName }),
18015
18086
  " to continue?"
18016
18087
  ] }) }),
18017
- /* @__PURE__ */ jsx80(
18088
+ /* @__PURE__ */ jsx81(
18018
18089
  RadioButtonSelect,
18019
18090
  {
18020
18091
  items: options,
@@ -18022,14 +18093,14 @@ var ToolConfirmationMessage = ({ request, respond, isFocused }) => {
18022
18093
  isFocused
18023
18094
  }
18024
18095
  ),
18025
- /* @__PURE__ */ jsx80(Text57, { color: theme.text.secondary, children: "Esc cancels this request" })
18096
+ /* @__PURE__ */ jsx81(Text58, { color: theme.text.secondary, children: "Esc cancels this request" })
18026
18097
  ] });
18027
18098
  };
18028
18099
 
18029
18100
  // src/ui/components/dialogs/tool-confirmation-queue.tsx
18030
- import { jsx as jsx81, jsxs as jsxs60 } from "react/jsx-runtime";
18031
- var ToolConfirmationQueue = ({ request, index, total, terminalWidth, respond }) => /* @__PURE__ */ jsxs60(
18032
- Box62,
18101
+ import { jsx as jsx82, jsxs as jsxs61 } from "react/jsx-runtime";
18102
+ var ToolConfirmationQueue = ({ request, index, total, terminalWidth, respond }) => /* @__PURE__ */ jsxs61(
18103
+ Box63,
18033
18104
  {
18034
18105
  flexDirection: "column",
18035
18106
  borderStyle: "round",
@@ -18038,22 +18109,22 @@ var ToolConfirmationQueue = ({ request, index, total, terminalWidth, respond })
18038
18109
  width: terminalWidth,
18039
18110
  flexShrink: 0,
18040
18111
  children: [
18041
- /* @__PURE__ */ jsxs60(Box62, { marginBottom: 1, justifyContent: "space-between", children: [
18042
- /* @__PURE__ */ jsx81(Text58, { color: theme.status.warning, bold: true, children: "Action Required" }),
18043
- /* @__PURE__ */ jsxs60(Text58, { color: theme.text.secondary, children: [
18112
+ /* @__PURE__ */ jsxs61(Box63, { marginBottom: 1, justifyContent: "space-between", children: [
18113
+ /* @__PURE__ */ jsx82(Text59, { color: theme.status.warning, bold: true, children: "Action Required" }),
18114
+ /* @__PURE__ */ jsxs61(Text59, { color: theme.text.secondary, children: [
18044
18115
  index,
18045
18116
  " of ",
18046
18117
  total
18047
18118
  ] })
18048
18119
  ] }),
18049
- /* @__PURE__ */ jsxs60(Box62, { marginBottom: 1, flexDirection: "column", children: [
18050
- /* @__PURE__ */ jsx81(Text58, { color: theme.text.primary, bold: true, children: request.toolName }),
18051
- request.callId !== void 0 && /* @__PURE__ */ jsxs60(Text58, { color: theme.text.secondary, children: [
18120
+ /* @__PURE__ */ jsxs61(Box63, { marginBottom: 1, flexDirection: "column", children: [
18121
+ /* @__PURE__ */ jsx82(Text59, { color: theme.text.primary, bold: true, children: request.toolName }),
18122
+ request.callId !== void 0 && /* @__PURE__ */ jsxs61(Text59, { color: theme.text.secondary, children: [
18052
18123
  "Call ",
18053
18124
  request.callId
18054
18125
  ] })
18055
18126
  ] }),
18056
- /* @__PURE__ */ jsx81(
18127
+ /* @__PURE__ */ jsx82(
18057
18128
  ToolConfirmationMessage,
18058
18129
  {
18059
18130
  request,
@@ -18077,12 +18148,12 @@ import {
18077
18148
  useReducer as useReducer4,
18078
18149
  useContext as useContext15
18079
18150
  } from "react";
18080
- import { Box as Box64, Text as Text60, useStdout as useStdout3 } from "ink";
18151
+ import { Box as Box65, Text as Text61, useStdout as useStdout3 } from "ink";
18081
18152
 
18082
18153
  // src/ui/components/layout/tab-header.tsx
18083
18154
  import React16 from "react";
18084
- import { Text as Text59, Box as Box63 } from "ink";
18085
- import { jsx as jsx82, jsxs as jsxs61 } from "react/jsx-runtime";
18155
+ import { Text as Text60, Box as Box64 } from "ink";
18156
+ import { jsx as jsx83, jsxs as jsxs62 } from "react/jsx-runtime";
18086
18157
  function TabHeader({
18087
18158
  tabs,
18088
18159
  currentIndex,
@@ -18102,16 +18173,16 @@ function TabHeader({
18102
18173
  if (tab.isSpecial) return "\u2261";
18103
18174
  return isCompleted ? "\u2713" : "\u25A1";
18104
18175
  };
18105
- return /* @__PURE__ */ jsxs61(Box63, { flexDirection: "row", marginBottom: 1, children: [
18106
- showArrows && /* @__PURE__ */ jsx82(Text59, { color: theme.text.secondary, children: "\u2190 " }),
18107
- tabs.map((tab, i) => /* @__PURE__ */ jsxs61(React16.Fragment, { children: [
18108
- i > 0 && /* @__PURE__ */ jsx82(Text59, { color: theme.text.secondary, children: " \u2502 " }),
18109
- showStatusIcons && /* @__PURE__ */ jsxs61(Text59, { color: theme.text.secondary, children: [
18176
+ return /* @__PURE__ */ jsxs62(Box64, { flexDirection: "row", marginBottom: 1, children: [
18177
+ showArrows && /* @__PURE__ */ jsx83(Text60, { color: theme.text.secondary, children: "\u2190 " }),
18178
+ tabs.map((tab, i) => /* @__PURE__ */ jsxs62(React16.Fragment, { children: [
18179
+ i > 0 && /* @__PURE__ */ jsx83(Text60, { color: theme.text.secondary, children: " \u2502 " }),
18180
+ showStatusIcons && /* @__PURE__ */ jsxs62(Text60, { color: theme.text.secondary, children: [
18110
18181
  getStatusIcon(tab, i),
18111
18182
  " "
18112
18183
  ] }),
18113
- /* @__PURE__ */ jsx82(
18114
- Text59,
18184
+ /* @__PURE__ */ jsx83(
18185
+ Text60,
18115
18186
  {
18116
18187
  color: i === currentIndex ? theme.text.accent : theme.text.secondary,
18117
18188
  bold: i === currentIndex,
@@ -18119,12 +18190,12 @@ function TabHeader({
18119
18190
  }
18120
18191
  )
18121
18192
  ] }, tab.key)),
18122
- showArrows && /* @__PURE__ */ jsx82(Text59, { color: theme.text.secondary, children: " \u2192" })
18193
+ showArrows && /* @__PURE__ */ jsx83(Text60, { color: theme.text.secondary, children: " \u2192" })
18123
18194
  ] });
18124
18195
  }
18125
18196
 
18126
18197
  // src/ui/components/dialogs/ask-user-dialog.tsx
18127
- import { Fragment as Fragment17, jsx as jsx83, jsxs as jsxs62 } from "react/jsx-runtime";
18198
+ import { Fragment as Fragment19, jsx as jsx84, jsxs as jsxs63 } from "react/jsx-runtime";
18128
18199
  var initialState2 = {
18129
18200
  currentQuestionIndex: 0,
18130
18201
  answers: {},
@@ -18244,7 +18315,7 @@ var QuestionPrompt = ({ question, presentation }) => {
18244
18315
  );
18245
18316
  const planKeyExtractor = useCallback33(() => "plan-review-detail", []);
18246
18317
  const renderPlanDetail = useCallback33(
18247
- ({ item }) => /* @__PURE__ */ jsx83(Box64, { flexDirection: "column", children: /* @__PURE__ */ jsx83(
18318
+ ({ item }) => /* @__PURE__ */ jsx84(Box65, { flexDirection: "column", children: /* @__PURE__ */ jsx84(
18248
18319
  MarkdownDisplay,
18249
18320
  {
18250
18321
  availableTerminalHeight: planViewportHeight - 2,
@@ -18255,11 +18326,11 @@ var QuestionPrompt = ({ question, presentation }) => {
18255
18326
  ) }),
18256
18327
  [planViewportHeight, terminalWidth]
18257
18328
  );
18258
- return /* @__PURE__ */ jsxs62(Fragment17, { children: [
18259
- presentation === "plan-review" && /* @__PURE__ */ jsx83(Box64, { marginBottom: 1, children: /* @__PURE__ */ jsx83(Text60, { bold: true, color: theme.text.accent, children: "Plan Review" }) }),
18260
- /* @__PURE__ */ jsx83(Box64, { marginBottom: 1, children: /* @__PURE__ */ jsx83(Text60, { bold: true, color: theme.text.primary, children: question.question }) }),
18261
- question.detail && (presentation === "plan-review" ? /* @__PURE__ */ jsx83(
18262
- Box64,
18329
+ return /* @__PURE__ */ jsxs63(Fragment19, { children: [
18330
+ presentation === "plan-review" && /* @__PURE__ */ jsx84(Box65, { marginBottom: 1, children: /* @__PURE__ */ jsx84(Text61, { bold: true, color: theme.text.accent, children: "Plan Review" }) }),
18331
+ /* @__PURE__ */ jsx84(Box65, { marginBottom: 1, children: /* @__PURE__ */ jsx84(Text61, { bold: true, color: theme.text.primary, children: question.question }) }),
18332
+ question.detail && (presentation === "plan-review" ? /* @__PURE__ */ jsx84(
18333
+ Box65,
18263
18334
  {
18264
18335
  flexDirection: "column",
18265
18336
  borderStyle: "single",
@@ -18268,7 +18339,7 @@ var QuestionPrompt = ({ question, presentation }) => {
18268
18339
  marginBottom: 1,
18269
18340
  height: planViewportHeight,
18270
18341
  overflow: "hidden",
18271
- children: /* @__PURE__ */ jsx83(
18342
+ children: /* @__PURE__ */ jsx84(
18272
18343
  ScrollableListWithForwardRef,
18273
18344
  {
18274
18345
  data: planDetail,
@@ -18280,7 +18351,7 @@ var QuestionPrompt = ({ question, presentation }) => {
18280
18351
  }
18281
18352
  )
18282
18353
  }
18283
- ) : /* @__PURE__ */ jsx83(Box64, { marginBottom: 1, children: /* @__PURE__ */ jsx83(Text60, { color: theme.text.secondary, children: question.detail }) }))
18354
+ ) : /* @__PURE__ */ jsx84(Box65, { marginBottom: 1, children: /* @__PURE__ */ jsx84(Text61, { color: theme.text.secondary, children: question.detail }) }))
18284
18355
  ] });
18285
18356
  };
18286
18357
  function formatAnswerForReview(question, answer) {
@@ -18307,8 +18378,8 @@ var ReviewView = ({
18307
18378
  },
18308
18379
  { isActive: true }
18309
18380
  );
18310
- return /* @__PURE__ */ jsxs62(
18311
- Box64,
18381
+ return /* @__PURE__ */ jsxs63(
18382
+ Box65,
18312
18383
  {
18313
18384
  flexDirection: "column",
18314
18385
  borderStyle: "round",
@@ -18316,19 +18387,19 @@ var ReviewView = ({
18316
18387
  borderColor: theme.border.default,
18317
18388
  children: [
18318
18389
  progressHeader,
18319
- /* @__PURE__ */ jsx83(Box64, { marginBottom: 1, children: /* @__PURE__ */ jsx83(Text60, { bold: true, color: theme.text.primary, children: "Review your answers:" }) }),
18320
- hasUnanswered && /* @__PURE__ */ jsx83(Box64, { marginBottom: 1, children: /* @__PURE__ */ jsxs62(Text60, { color: theme.status.warning, children: [
18390
+ /* @__PURE__ */ jsx84(Box65, { marginBottom: 1, children: /* @__PURE__ */ jsx84(Text61, { bold: true, color: theme.text.primary, children: "Review your answers:" }) }),
18391
+ hasUnanswered && /* @__PURE__ */ jsx84(Box65, { marginBottom: 1, children: /* @__PURE__ */ jsxs63(Text61, { color: theme.status.warning, children: [
18321
18392
  "\u26A0 You have ",
18322
18393
  unansweredCount,
18323
18394
  " unanswered question",
18324
18395
  unansweredCount > 1 ? "s" : ""
18325
18396
  ] }) }),
18326
- questions.map((q, i) => /* @__PURE__ */ jsxs62(Box64, { marginBottom: 0, children: [
18327
- /* @__PURE__ */ jsx83(Text60, { color: theme.text.secondary, children: q.header }),
18328
- /* @__PURE__ */ jsx83(Text60, { color: theme.text.secondary, children: " \u2192 " }),
18329
- /* @__PURE__ */ jsx83(Text60, { color: answers[i] ? theme.text.primary : theme.status.warning, children: (answers[i] ? formatAnswerForReview(q, answers[i]) : void 0) || "(not answered)" })
18397
+ questions.map((q, i) => /* @__PURE__ */ jsxs63(Box65, { marginBottom: 0, children: [
18398
+ /* @__PURE__ */ jsx84(Text61, { color: theme.text.secondary, children: q.header }),
18399
+ /* @__PURE__ */ jsx84(Text61, { color: theme.text.secondary, children: " \u2192 " }),
18400
+ /* @__PURE__ */ jsx84(Text61, { color: answers[i] ? theme.text.primary : theme.status.warning, children: (answers[i] ? formatAnswerForReview(q, answers[i]) : void 0) || "(not answered)" })
18330
18401
  ] }, i)),
18331
- /* @__PURE__ */ jsx83(Box64, { marginTop: 1, children: /* @__PURE__ */ jsx83(Text60, { color: theme.text.secondary, children: "Enter to submit \xB7 Tab/Shift+Tab to edit answers \xB7 Esc to cancel" }) })
18402
+ /* @__PURE__ */ jsx84(Box65, { marginTop: 1, children: /* @__PURE__ */ jsx84(Text61, { color: theme.text.secondary, children: "Enter to submit \xB7 Tab/Shift+Tab to edit answers \xB7 Esc to cancel" }) })
18332
18403
  ]
18333
18404
  }
18334
18405
  );
@@ -18394,8 +18465,8 @@ var TextQuestionView = ({
18394
18465
  };
18395
18466
  }, [onEditingCustomOption]);
18396
18467
  const placeholder = question.placeholder || "Enter your response";
18397
- return /* @__PURE__ */ jsxs62(
18398
- Box64,
18468
+ return /* @__PURE__ */ jsxs63(
18469
+ Box65,
18399
18470
  {
18400
18471
  flexDirection: "column",
18401
18472
  borderStyle: "round",
@@ -18403,10 +18474,10 @@ var TextQuestionView = ({
18403
18474
  borderColor: theme.border.default,
18404
18475
  children: [
18405
18476
  progressHeader,
18406
- /* @__PURE__ */ jsx83(QuestionPrompt, { question, presentation }),
18407
- /* @__PURE__ */ jsxs62(Box64, { flexDirection: "row", marginBottom: 1, children: [
18408
- /* @__PURE__ */ jsx83(Text60, { color: theme.text.accent, children: "> " }),
18409
- /* @__PURE__ */ jsx83(
18477
+ /* @__PURE__ */ jsx84(QuestionPrompt, { question, presentation }),
18478
+ /* @__PURE__ */ jsxs63(Box65, { flexDirection: "row", marginBottom: 1, children: [
18479
+ /* @__PURE__ */ jsx84(Text61, { color: theme.text.accent, children: "> " }),
18480
+ /* @__PURE__ */ jsx84(
18410
18481
  TextInput,
18411
18482
  {
18412
18483
  buffer,
@@ -18710,8 +18781,8 @@ var ChoiceQuestionView = ({
18710
18781
  });
18711
18782
  }
18712
18783
  }, [customOptionText, isCustomOptionSelected, question.multiSelect]);
18713
- return /* @__PURE__ */ jsxs62(
18714
- Box64,
18784
+ return /* @__PURE__ */ jsxs63(
18785
+ Box65,
18715
18786
  {
18716
18787
  flexDirection: "column",
18717
18788
  borderStyle: "round",
@@ -18719,12 +18790,12 @@ var ChoiceQuestionView = ({
18719
18790
  borderColor: theme.border.default,
18720
18791
  children: [
18721
18792
  progressHeader,
18722
- /* @__PURE__ */ jsx83(QuestionPrompt, { question, presentation }),
18723
- question.multiSelect && /* @__PURE__ */ jsxs62(Text60, { color: theme.text.secondary, italic: true, children: [
18793
+ /* @__PURE__ */ jsx84(QuestionPrompt, { question, presentation }),
18794
+ question.multiSelect && /* @__PURE__ */ jsxs63(Text61, { color: theme.text.secondary, italic: true, children: [
18724
18795
  " ",
18725
18796
  "(Select all that apply)"
18726
18797
  ] }),
18727
- /* @__PURE__ */ jsx83(
18798
+ /* @__PURE__ */ jsx84(
18728
18799
  BaseSelectionList,
18729
18800
  {
18730
18801
  items: selectionItems,
@@ -18739,9 +18810,9 @@ var ChoiceQuestionView = ({
18739
18810
  const isPreferred = optionItem.type === "option" && (questionOptions[optionItem.index]?.value ?? questionOptions[optionItem.index]?.label) === question.preferredValue;
18740
18811
  if (optionItem.type === "other") {
18741
18812
  const placeholder = presentation === "plan-review" ? context.isSelected ? "Describe what should change" : "Request changes..." : "Enter a custom value";
18742
- return /* @__PURE__ */ jsxs62(Box64, { flexDirection: "row", children: [
18743
- showCheck && /* @__PURE__ */ jsxs62(
18744
- Text60,
18813
+ return /* @__PURE__ */ jsxs63(Box65, { flexDirection: "row", children: [
18814
+ showCheck && /* @__PURE__ */ jsxs63(
18815
+ Text61,
18745
18816
  {
18746
18817
  color: isChecked ? theme.text.accent : theme.text.secondary,
18747
18818
  children: [
@@ -18751,8 +18822,8 @@ var ChoiceQuestionView = ({
18751
18822
  ]
18752
18823
  }
18753
18824
  ),
18754
- /* @__PURE__ */ jsx83(Text60, { color: theme.text.primary, children: " " }),
18755
- /* @__PURE__ */ jsx83(
18825
+ /* @__PURE__ */ jsx84(Text61, { color: theme.text.primary, children: " " }),
18826
+ /* @__PURE__ */ jsx84(
18756
18827
  TextInput,
18757
18828
  {
18758
18829
  buffer: customBuffer,
@@ -18761,14 +18832,14 @@ var ChoiceQuestionView = ({
18761
18832
  onSubmit: () => handleSelect(optionItem)
18762
18833
  }
18763
18834
  ),
18764
- isChecked && !question.multiSelect && /* @__PURE__ */ jsx83(Text60, { color: theme.status.success, children: " \u2713" })
18835
+ isChecked && !question.multiSelect && /* @__PURE__ */ jsx84(Text61, { color: theme.status.success, children: " \u2713" })
18765
18836
  ] });
18766
18837
  }
18767
18838
  const labelColor = isChecked && !question.multiSelect ? theme.status.success : isPreferred ? theme.status.success : context.isSelected ? context.titleColor : theme.text.primary;
18768
- return /* @__PURE__ */ jsxs62(Box64, { flexDirection: "column", children: [
18769
- /* @__PURE__ */ jsxs62(Box64, { flexDirection: "row", children: [
18770
- showCheck && /* @__PURE__ */ jsxs62(
18771
- Text60,
18839
+ return /* @__PURE__ */ jsxs63(Box65, { flexDirection: "column", children: [
18840
+ /* @__PURE__ */ jsxs63(Box65, { flexDirection: "row", children: [
18841
+ showCheck && /* @__PURE__ */ jsxs63(
18842
+ Text61,
18772
18843
  {
18773
18844
  color: isChecked ? theme.text.accent : theme.text.secondary,
18774
18845
  children: [
@@ -18778,13 +18849,13 @@ var ChoiceQuestionView = ({
18778
18849
  ]
18779
18850
  }
18780
18851
  ),
18781
- /* @__PURE__ */ jsxs62(Text60, { color: labelColor, bold: optionItem.type === "done", children: [
18852
+ /* @__PURE__ */ jsxs63(Text61, { color: labelColor, bold: optionItem.type === "done", children: [
18782
18853
  " ",
18783
18854
  optionItem.label
18784
18855
  ] }),
18785
- isChecked && !question.multiSelect && /* @__PURE__ */ jsx83(Text60, { color: theme.status.success, children: " \u2713" })
18856
+ isChecked && !question.multiSelect && /* @__PURE__ */ jsx84(Text61, { color: theme.status.success, children: " \u2713" })
18786
18857
  ] }),
18787
- optionItem.description && /* @__PURE__ */ jsxs62(Text60, { color: theme.text.secondary, wrap: "wrap", children: [
18858
+ optionItem.description && /* @__PURE__ */ jsxs63(Text61, { color: theme.text.secondary, wrap: "wrap", children: [
18788
18859
  " ",
18789
18860
  optionItem.description
18790
18861
  ] })
@@ -18967,7 +19038,7 @@ var AskUserDialog = ({
18967
19038
  }
18968
19039
  return questionTabs;
18969
19040
  }, [questions]);
18970
- const progressHeader = questions.length > 1 ? /* @__PURE__ */ jsx83(
19041
+ const progressHeader = questions.length > 1 ? /* @__PURE__ */ jsx84(
18971
19042
  TabHeader,
18972
19043
  {
18973
19044
  tabs,
@@ -18976,7 +19047,7 @@ var AskUserDialog = ({
18976
19047
  }
18977
19048
  ) : null;
18978
19049
  if (isOnReviewTab) {
18979
- return /* @__PURE__ */ jsx83(
19050
+ return /* @__PURE__ */ jsx84(
18980
19051
  ReviewView,
18981
19052
  {
18982
19053
  questions,
@@ -18987,9 +19058,9 @@ var AskUserDialog = ({
18987
19058
  );
18988
19059
  }
18989
19060
  if (!currentQuestion) return null;
18990
- const keyboardHints = /* @__PURE__ */ jsx83(Box64, { marginTop: 1, children: /* @__PURE__ */ jsx83(Text60, { color: theme.text.secondary, children: presentation === "plan-review" ? "Enter to select \xB7 \u2191/\u2193 options \xB7 Shift+\u2191/\u2193 or PgUp/PgDn scroll plan \xB7 Esc to cancel" : currentQuestion.type === "text" || isEditingCustomOption ? questions.length > 1 ? "Enter to submit \xB7 Tab/Shift+Tab to switch questions \xB7 Esc to cancel" : "Enter to submit \xB7 Esc to cancel" : questions.length > 1 ? "Enter to select \xB7 \u2190/\u2192 to switch questions \xB7 Esc to cancel" : "Enter to select \xB7 \u2191/\u2193 to navigate \xB7 Esc to cancel" }) });
19061
+ const keyboardHints = /* @__PURE__ */ jsx84(Box65, { marginTop: 1, children: /* @__PURE__ */ jsx84(Text61, { color: theme.text.secondary, children: presentation === "plan-review" ? "Enter to select \xB7 \u2191/\u2193 options \xB7 Shift+\u2191/\u2193 or PgUp/PgDn scroll plan \xB7 Esc to cancel" : currentQuestion.type === "text" || isEditingCustomOption ? questions.length > 1 ? "Enter to submit \xB7 Tab/Shift+Tab to switch questions \xB7 Esc to cancel" : "Enter to submit \xB7 Esc to cancel" : questions.length > 1 ? "Enter to select \xB7 \u2190/\u2192 to switch questions \xB7 Esc to cancel" : "Enter to select \xB7 \u2191/\u2193 to navigate \xB7 Esc to cancel" }) });
18991
19062
  if (currentQuestion.type === "text") {
18992
- return /* @__PURE__ */ jsx83(
19063
+ return /* @__PURE__ */ jsx84(
18993
19064
  TextQuestionView,
18994
19065
  {
18995
19066
  question: currentQuestion,
@@ -19005,7 +19076,7 @@ var AskUserDialog = ({
19005
19076
  currentQuestionIndex
19006
19077
  );
19007
19078
  }
19008
- return /* @__PURE__ */ jsx83(
19079
+ return /* @__PURE__ */ jsx84(
19009
19080
  ChoiceQuestionView,
19010
19081
  {
19011
19082
  question: effectiveQuestion,
@@ -19024,7 +19095,7 @@ var AskUserDialog = ({
19024
19095
 
19025
19096
  // src/ui/components/dialogs/plan-review-dialog.tsx
19026
19097
  import { useCallback as useCallback34, useMemo as useMemo28 } from "react";
19027
- import { jsx as jsx84 } from "react/jsx-runtime";
19098
+ import { jsx as jsx85 } from "react/jsx-runtime";
19028
19099
  function PlanReviewDialog({
19029
19100
  question,
19030
19101
  onSubmit,
@@ -19061,7 +19132,7 @@ function PlanReviewDialog({
19061
19132
  },
19062
19133
  [onSubmit, question.id]
19063
19134
  );
19064
- return /* @__PURE__ */ jsx84(
19135
+ return /* @__PURE__ */ jsx85(
19065
19136
  AskUserDialog,
19066
19137
  {
19067
19138
  questions: presentedQuestions,
@@ -19073,7 +19144,7 @@ function PlanReviewDialog({
19073
19144
  }
19074
19145
 
19075
19146
  // src/ui/components/dialogs/user-question-queue.tsx
19076
- import { jsx as jsx85 } from "react/jsx-runtime";
19147
+ import { jsx as jsx86 } from "react/jsx-runtime";
19077
19148
  function isPlanReview(question) {
19078
19149
  return question.intent?.kind === "plan-review" && question.detail !== void 0 && question.multiSelect === false && question.options?.some(
19079
19150
  (option) => option.value === question.intent?.approveValue
@@ -19103,7 +19174,7 @@ var UserQuestionQueue = () => {
19103
19174
  if (request === void 0) return null;
19104
19175
  const planReview = request.questions.length === 1 && isPlanReview(request.questions[0]) ? request.questions[0] : void 0;
19105
19176
  if (planReview !== void 0) {
19106
- return /* @__PURE__ */ jsx85(
19177
+ return /* @__PURE__ */ jsx86(
19107
19178
  PlanReviewDialog,
19108
19179
  {
19109
19180
  question: planReview,
@@ -19113,7 +19184,7 @@ var UserQuestionQueue = () => {
19113
19184
  request.id
19114
19185
  );
19115
19186
  }
19116
- return /* @__PURE__ */ jsx85(
19187
+ return /* @__PURE__ */ jsx86(
19117
19188
  AskUserDialog,
19118
19189
  {
19119
19190
  questions: [...questions],
@@ -19137,7 +19208,7 @@ var UserQuestionQueue = () => {
19137
19208
  };
19138
19209
 
19139
19210
  // src/ui/components/layout/screen-reader-app-layout.tsx
19140
- import { jsx as jsx86, jsxs as jsxs63 } from "react/jsx-runtime";
19211
+ import { jsx as jsx87, jsxs as jsxs64 } from "react/jsx-runtime";
19141
19212
  var ScreenReaderAppLayout = () => {
19142
19213
  const uiState = useUIState();
19143
19214
  const { rootUiRef, terminalHeight } = uiState;
@@ -19146,18 +19217,18 @@ var ScreenReaderAppLayout = () => {
19146
19217
  const { snapshot: userQuestionSnapshot } = useUserQuestionRuntime();
19147
19218
  const pendingUserQuestion = userQuestionSnapshot.pending[0];
19148
19219
  useFlickerDetector(rootUiRef, terminalHeight);
19149
- return /* @__PURE__ */ jsxs63(
19150
- Box65,
19220
+ return /* @__PURE__ */ jsxs64(
19221
+ Box66,
19151
19222
  {
19152
19223
  flexDirection: "column",
19153
19224
  width: "90%",
19154
19225
  height: "100%",
19155
19226
  ref: uiState.rootUiRef,
19156
19227
  children: [
19157
- /* @__PURE__ */ jsx86(Notifications, {}),
19158
- /* @__PURE__ */ jsx86(Footer, {}),
19159
- /* @__PURE__ */ jsx86(Box65, { flexGrow: 1, overflow: "hidden", children: /* @__PURE__ */ jsx86(MainContent, {}) }),
19160
- pendingApproval !== void 0 ? /* @__PURE__ */ jsx86(
19228
+ /* @__PURE__ */ jsx87(Notifications, {}),
19229
+ /* @__PURE__ */ jsx87(Footer, {}),
19230
+ /* @__PURE__ */ jsx87(Box66, { flexGrow: 1, overflow: "hidden", children: /* @__PURE__ */ jsx87(MainContent, {}) }),
19231
+ pendingApproval !== void 0 ? /* @__PURE__ */ jsx87(
19161
19232
  ToolConfirmationQueue,
19162
19233
  {
19163
19234
  request: pendingApproval,
@@ -19166,34 +19237,34 @@ var ScreenReaderAppLayout = () => {
19166
19237
  terminalWidth: uiState.terminalWidth,
19167
19238
  respond: (response) => approvalRuntime.respond(pendingApproval.id, response)
19168
19239
  }
19169
- ) : pendingUserQuestion !== void 0 ? /* @__PURE__ */ jsx86(UserQuestionQueue, {}) : uiState.dialogsVisible ? /* @__PURE__ */ jsx86(
19240
+ ) : pendingUserQuestion !== void 0 ? /* @__PURE__ */ jsx87(UserQuestionQueue, {}) : uiState.dialogsVisible ? /* @__PURE__ */ jsx87(
19170
19241
  DialogManager,
19171
19242
  {
19172
19243
  terminalWidth: uiState.terminalWidth
19173
19244
  }
19174
- ) : /* @__PURE__ */ jsx86(Composer, {}),
19175
- /* @__PURE__ */ jsx86(ExitWarning, {})
19245
+ ) : /* @__PURE__ */ jsx87(Composer, {}),
19246
+ /* @__PURE__ */ jsx87(ExitWarning, {})
19176
19247
  ]
19177
19248
  }
19178
19249
  );
19179
19250
  };
19180
19251
 
19181
19252
  // src/ui/components/layout/default-app-layout.tsx
19182
- import { Box as Box67 } from "ink";
19253
+ import { Box as Box68 } from "ink";
19183
19254
 
19184
19255
  // src/ui/components/dialogs/copy-mode-warning.tsx
19185
- import { Box as Box66, Text as Text61 } from "ink";
19186
- import { jsx as jsx87 } from "react/jsx-runtime";
19256
+ import { Box as Box67, Text as Text62 } from "ink";
19257
+ import { jsx as jsx88 } from "react/jsx-runtime";
19187
19258
  var CopyModeWarning = () => {
19188
19259
  const { copyModeEnabled } = useUIState();
19189
19260
  if (!copyModeEnabled) {
19190
19261
  return null;
19191
19262
  }
19192
- return /* @__PURE__ */ jsx87(Box66, { children: /* @__PURE__ */ jsx87(Text61, { color: theme.status.warning, children: "In Copy Mode. Press any key to exit." }) });
19263
+ return /* @__PURE__ */ jsx88(Box67, { children: /* @__PURE__ */ jsx88(Text62, { color: theme.status.warning, children: "In Copy Mode. Press any key to exit." }) });
19193
19264
  };
19194
19265
 
19195
19266
  // src/ui/components/layout/default-app-layout.tsx
19196
- import { Fragment as Fragment18, jsx as jsx88, jsxs as jsxs64 } from "react/jsx-runtime";
19267
+ import { Fragment as Fragment20, jsx as jsx89, jsxs as jsxs65 } from "react/jsx-runtime";
19197
19268
  var DefaultAppLayout = () => {
19198
19269
  const uiState = useUIState();
19199
19270
  const isAlternateBuffer = useAlternateBuffer();
@@ -19203,8 +19274,8 @@ var DefaultAppLayout = () => {
19203
19274
  const pendingUserQuestion = userQuestionSnapshot.pending[0];
19204
19275
  const { rootUiRef, terminalHeight } = uiState;
19205
19276
  useFlickerDetector(rootUiRef, terminalHeight);
19206
- return /* @__PURE__ */ jsxs64(
19207
- Box67,
19277
+ return /* @__PURE__ */ jsxs65(
19278
+ Box68,
19208
19279
  {
19209
19280
  flexDirection: "column",
19210
19281
  width: uiState.terminalWidth,
@@ -19215,9 +19286,9 @@ var DefaultAppLayout = () => {
19215
19286
  overflow: "hidden",
19216
19287
  ref: uiState.rootUiRef,
19217
19288
  children: [
19218
- /* @__PURE__ */ jsx88(MainContent, {}),
19219
- /* @__PURE__ */ jsxs64(
19220
- Box67,
19289
+ /* @__PURE__ */ jsx89(MainContent, {}),
19290
+ /* @__PURE__ */ jsxs65(
19291
+ Box68,
19221
19292
  {
19222
19293
  flexDirection: "column",
19223
19294
  ref: uiState.mainControlsRef,
@@ -19225,10 +19296,10 @@ var DefaultAppLayout = () => {
19225
19296
  flexGrow: 0,
19226
19297
  width: uiState.terminalWidth,
19227
19298
  children: [
19228
- /* @__PURE__ */ jsx88(Notifications, {}),
19229
- /* @__PURE__ */ jsx88(CopyModeWarning, {}),
19230
- pendingApproval !== void 0 ? /* @__PURE__ */ jsxs64(Fragment18, { children: [
19231
- /* @__PURE__ */ jsx88(
19299
+ /* @__PURE__ */ jsx89(Notifications, {}),
19300
+ /* @__PURE__ */ jsx89(CopyModeWarning, {}),
19301
+ pendingApproval !== void 0 ? /* @__PURE__ */ jsxs65(Fragment20, { children: [
19302
+ /* @__PURE__ */ jsx89(
19232
19303
  ToolConfirmationQueue,
19233
19304
  {
19234
19305
  request: pendingApproval,
@@ -19238,14 +19309,14 @@ var DefaultAppLayout = () => {
19238
19309
  respond: (response) => approvalRuntime.respond(pendingApproval.id, response)
19239
19310
  }
19240
19311
  ),
19241
- /* @__PURE__ */ jsx88(Composer, { isFocused: false })
19242
- ] }) : pendingUserQuestion !== void 0 ? /* @__PURE__ */ jsx88(UserQuestionQueue, {}) : uiState.customDialog ? uiState.customDialog : uiState.dialogsVisible ? /* @__PURE__ */ jsx88(
19312
+ /* @__PURE__ */ jsx89(Composer, { isFocused: false })
19313
+ ] }) : pendingUserQuestion !== void 0 ? /* @__PURE__ */ jsx89(UserQuestionQueue, {}) : uiState.customDialog ? uiState.customDialog : uiState.dialogsVisible ? /* @__PURE__ */ jsx89(
19243
19314
  DialogManager,
19244
19315
  {
19245
19316
  terminalWidth: uiState.terminalWidth
19246
19317
  }
19247
- ) : /* @__PURE__ */ jsx88(Composer, { isFocused: true }),
19248
- /* @__PURE__ */ jsx88(ExitWarning, {})
19318
+ ) : /* @__PURE__ */ jsx89(Composer, { isFocused: true }),
19319
+ /* @__PURE__ */ jsx89(ExitWarning, {})
19249
19320
  ]
19250
19321
  }
19251
19322
  )
@@ -19255,23 +19326,23 @@ var DefaultAppLayout = () => {
19255
19326
  };
19256
19327
 
19257
19328
  // src/ui/components/indicators/alternate-buffer-quitting-display.tsx
19258
- import { Box as Box68, Text as Text62 } from "ink";
19259
- import { jsx as jsx89, jsxs as jsxs65 } from "react/jsx-runtime";
19329
+ import { Box as Box69, Text as Text63 } from "ink";
19330
+ import { jsx as jsx90, jsxs as jsxs66 } from "react/jsx-runtime";
19260
19331
  var AlternateBufferQuittingDisplay = () => {
19261
19332
  const { version } = useAppContext();
19262
19333
  const uiState = useUIState();
19263
19334
  const { snapshot: approvalSnapshot } = useApprovalRuntime();
19264
19335
  const pendingApproval = approvalSnapshot.pending[0];
19265
- return /* @__PURE__ */ jsxs65(
19266
- Box68,
19336
+ return /* @__PURE__ */ jsxs66(
19337
+ Box69,
19267
19338
  {
19268
19339
  flexDirection: "column",
19269
19340
  flexShrink: 0,
19270
19341
  flexGrow: 0,
19271
19342
  width: uiState.terminalWidth,
19272
19343
  children: [
19273
- /* @__PURE__ */ jsx89(AppHeader, { version }, "app-header"),
19274
- uiState.history.map((h) => /* @__PURE__ */ jsx89(
19344
+ /* @__PURE__ */ jsx90(AppHeader, { version }, "app-header"),
19345
+ uiState.history.map((h) => /* @__PURE__ */ jsx90(
19275
19346
  HistoryItemDisplay,
19276
19347
  {
19277
19348
  terminalWidth: uiState.mainAreaWidth,
@@ -19283,7 +19354,7 @@ var AlternateBufferQuittingDisplay = () => {
19283
19354
  },
19284
19355
  h.id
19285
19356
  )),
19286
- uiState.pendingHistoryItems.map((item, i) => /* @__PURE__ */ jsx89(
19357
+ uiState.pendingHistoryItems.map((item, i) => /* @__PURE__ */ jsx90(
19287
19358
  HistoryItemDisplay,
19288
19359
  {
19289
19360
  availableTerminalHeight: void 0,
@@ -19296,31 +19367,31 @@ var AlternateBufferQuittingDisplay = () => {
19296
19367
  },
19297
19368
  i
19298
19369
  )),
19299
- pendingApproval !== void 0 && /* @__PURE__ */ jsxs65(Box68, { flexDirection: "column", marginTop: 1, marginBottom: 1, children: [
19300
- /* @__PURE__ */ jsx89(Text62, { color: theme.status.warning, bold: true, children: "Action Required (was prompted):" }),
19301
- /* @__PURE__ */ jsx89(Text62, { color: theme.text.primary, children: pendingApproval.toolName }),
19302
- pendingApproval.reason !== void 0 && /* @__PURE__ */ jsx89(Text62, { color: theme.text.secondary, children: pendingApproval.reason })
19370
+ pendingApproval !== void 0 && /* @__PURE__ */ jsxs66(Box69, { flexDirection: "column", marginTop: 1, marginBottom: 1, children: [
19371
+ /* @__PURE__ */ jsx90(Text63, { color: theme.status.warning, bold: true, children: "Action Required (was prompted):" }),
19372
+ /* @__PURE__ */ jsx90(Text63, { color: theme.text.primary, children: pendingApproval.toolName }),
19373
+ pendingApproval.reason !== void 0 && /* @__PURE__ */ jsx90(Text63, { color: theme.text.secondary, children: pendingApproval.reason })
19303
19374
  ] }),
19304
- /* @__PURE__ */ jsx89(QuittingDisplay, {})
19375
+ /* @__PURE__ */ jsx90(QuittingDisplay, {})
19305
19376
  ]
19306
19377
  }
19307
19378
  );
19308
19379
  };
19309
19380
 
19310
19381
  // src/ui/app.tsx
19311
- import { jsx as jsx90 } from "react/jsx-runtime";
19382
+ import { jsx as jsx91 } from "react/jsx-runtime";
19312
19383
  var App = () => {
19313
19384
  const uiState = useUIState();
19314
19385
  const isAlternateBuffer = useAlternateBuffer();
19315
19386
  const isScreenReaderEnabled = useIsScreenReaderEnabled5();
19316
19387
  if (uiState.quittingMessages) {
19317
19388
  if (isAlternateBuffer) {
19318
- return /* @__PURE__ */ jsx90(StreamingContext.Provider, { value: uiState.streamingState, children: /* @__PURE__ */ jsx90(AlternateBufferQuittingDisplay, {}) });
19389
+ return /* @__PURE__ */ jsx91(StreamingContext.Provider, { value: uiState.streamingState, children: /* @__PURE__ */ jsx91(AlternateBufferQuittingDisplay, {}) });
19319
19390
  } else {
19320
- return /* @__PURE__ */ jsx90(QuittingDisplay, {});
19391
+ return /* @__PURE__ */ jsx91(QuittingDisplay, {});
19321
19392
  }
19322
19393
  }
19323
- return /* @__PURE__ */ jsx90(StreamingContext.Provider, { value: uiState.streamingState, children: isScreenReaderEnabled ? /* @__PURE__ */ jsx90(ScreenReaderAppLayout, {}) : /* @__PURE__ */ jsx90(DefaultAppLayout, {}) });
19394
+ return /* @__PURE__ */ jsx91(StreamingContext.Provider, { value: uiState.streamingState, children: isScreenReaderEnabled ? /* @__PURE__ */ jsx91(ScreenReaderAppLayout, {}) : /* @__PURE__ */ jsx91(DefaultAppLayout, {}) });
19324
19395
  };
19325
19396
 
19326
19397
  // src/ui/app-container.tsx
@@ -19509,25 +19580,25 @@ function loadChangelog() {
19509
19580
 
19510
19581
  // src/ui/components/dialogs/changelog-dialog.tsx
19511
19582
  import { useMemo as useMemo31, useState as useState36 } from "react";
19512
- import { Box as Box69, Text as Text64 } from "ink";
19583
+ import { Box as Box70, Text as Text65 } from "ink";
19513
19584
  import stringWidth4 from "string-width";
19514
19585
 
19515
19586
  // src/ui/components/shared/dialog-close-action.tsx
19516
- import { Text as Text63 } from "ink";
19517
- import { jsx as jsx91 } from "react/jsx-runtime";
19587
+ import { Text as Text64 } from "ink";
19588
+ import { jsx as jsx92 } from "react/jsx-runtime";
19518
19589
  function DialogCloseAction({
19519
19590
  onClose,
19520
19591
  isActive = true,
19521
19592
  label = "Esc to close"
19522
19593
  }) {
19523
- return /* @__PURE__ */ jsx91(
19594
+ return /* @__PURE__ */ jsx92(
19524
19595
  InteractiveRegion,
19525
19596
  {
19526
19597
  onPress: onClose,
19527
19598
  isActive,
19528
19599
  mousePriority: MOUSE_EVENT_PRIORITY.dialog,
19529
- children: ({ hovered }) => /* @__PURE__ */ jsx91(
19530
- Text63,
19600
+ children: ({ hovered }) => /* @__PURE__ */ jsx92(
19601
+ Text64,
19531
19602
  {
19532
19603
  color: isActive ? hovered ? theme.text.accent : theme.text.link : theme.text.secondary,
19533
19604
  bold: isActive && hovered,
@@ -19540,7 +19611,7 @@ function DialogCloseAction({
19540
19611
  }
19541
19612
 
19542
19613
  // src/ui/components/dialogs/changelog-dialog.tsx
19543
- import { jsx as jsx92, jsxs as jsxs66 } from "react/jsx-runtime";
19614
+ import { jsx as jsx93, jsxs as jsxs67 } from "react/jsx-runtime";
19544
19615
  function wrapText(text, width) {
19545
19616
  if (text.length === 0) return [""];
19546
19617
  const lines = [];
@@ -19642,22 +19713,22 @@ function ChangelogDialog({
19642
19713
  },
19643
19714
  { isActive: true }
19644
19715
  );
19645
- return /* @__PURE__ */ jsxs66(
19646
- Box69,
19716
+ return /* @__PURE__ */ jsxs67(
19717
+ Box70,
19647
19718
  {
19648
19719
  flexDirection: "column",
19649
19720
  borderStyle: "round",
19650
19721
  borderColor: theme.border.default,
19651
19722
  paddingX: 1,
19652
19723
  children: [
19653
- /* @__PURE__ */ jsxs66(Box69, { justifyContent: "space-between", children: [
19654
- /* @__PURE__ */ jsx92(Text64, { bold: true, children: "Changelog" }),
19655
- /* @__PURE__ */ jsx92(DialogCloseAction, { onClose, label: closeLabel })
19724
+ /* @__PURE__ */ jsxs67(Box70, { justifyContent: "space-between", children: [
19725
+ /* @__PURE__ */ jsx93(Text65, { bold: true, children: "Changelog" }),
19726
+ /* @__PURE__ */ jsx93(DialogCloseAction, { onClose, label: closeLabel })
19656
19727
  ] }),
19657
- /* @__PURE__ */ jsx92(Box69, { flexDirection: "column", marginTop: 1, height: viewportHeight, children: lines.slice(visibleOffset, visibleOffset + viewportHeight).map((line, index) => {
19728
+ /* @__PURE__ */ jsx93(Box70, { flexDirection: "column", marginTop: 1, height: viewportHeight, children: lines.slice(visibleOffset, visibleOffset + viewportHeight).map((line, index) => {
19658
19729
  if (line.kind === "release") {
19659
- return /* @__PURE__ */ jsx92(
19660
- Text64,
19730
+ return /* @__PURE__ */ jsx93(
19731
+ Text65,
19661
19732
  {
19662
19733
  bold: true,
19663
19734
  color: theme.text.accent,
@@ -19667,8 +19738,8 @@ function ChangelogDialog({
19667
19738
  );
19668
19739
  }
19669
19740
  if (line.kind === "section") {
19670
- return /* @__PURE__ */ jsx92(
19671
- Text64,
19741
+ return /* @__PURE__ */ jsx93(
19742
+ Text65,
19672
19743
  {
19673
19744
  bold: true,
19674
19745
  color: theme.text.link,
@@ -19677,8 +19748,8 @@ function ChangelogDialog({
19677
19748
  `${visibleOffset}-${index}`
19678
19749
  );
19679
19750
  }
19680
- return /* @__PURE__ */ jsx92(
19681
- Text64,
19751
+ return /* @__PURE__ */ jsx93(
19752
+ Text65,
19682
19753
  {
19683
19754
  color: line.kind === "item" ? theme.text.primary : theme.text.secondary,
19684
19755
  children: line.text
@@ -19686,9 +19757,9 @@ function ChangelogDialog({
19686
19757
  `${visibleOffset}-${index}`
19687
19758
  );
19688
19759
  }) }),
19689
- /* @__PURE__ */ jsxs66(Box69, { justifyContent: "space-between", children: [
19690
- /* @__PURE__ */ jsx92(Text64, { color: theme.text.secondary, children: scrollLabel }),
19691
- /* @__PURE__ */ jsx92(Text64, { color: theme.text.secondary, children: lines.length === 0 ? "0 / 0" : `${visibleOffset + 1} / ${lines.length}` })
19760
+ /* @__PURE__ */ jsxs67(Box70, { justifyContent: "space-between", children: [
19761
+ /* @__PURE__ */ jsx93(Text65, { color: theme.text.secondary, children: scrollLabel }),
19762
+ /* @__PURE__ */ jsx93(Text65, { color: theme.text.secondary, children: lines.length === 0 ? "0 / 0" : `${visibleOffset + 1} / ${lines.length}` })
19692
19763
  ] })
19693
19764
  ]
19694
19765
  }
@@ -19809,12 +19880,12 @@ import React19 from "react";
19809
19880
 
19810
19881
  // src/ui/components/dialogs/model-dialog.tsx
19811
19882
  import { useCallback as useCallback36, useEffect as useEffect39, useMemo as useMemo32, useRef as useRef22, useState as useState38 } from "react";
19812
- import { Box as Box71, Text as Text66 } from "ink";
19883
+ import { Box as Box72, Text as Text67 } from "ink";
19813
19884
 
19814
19885
  // src/ui/components/dialogs/provider-setup-dialog.tsx
19815
19886
  import { useEffect as useEffect38, useRef as useRef21, useState as useState37 } from "react";
19816
- import { Box as Box70, Text as Text65 } from "ink";
19817
- import { jsx as jsx93, jsxs as jsxs67 } from "react/jsx-runtime";
19887
+ import { Box as Box71, Text as Text66 } from "ink";
19888
+ import { jsx as jsx94, jsxs as jsxs68 } from "react/jsx-runtime";
19818
19889
  function ProviderSetupDialog({
19819
19890
  runtime,
19820
19891
  provider,
@@ -19916,8 +19987,8 @@ function ProviderSetupDialog({
19916
19987
  const fieldLabel = credential.endsWith("_API_KEY") ? "API key" : "Credential";
19917
19988
  const canWrite = view?.writable === true;
19918
19989
  const isReadOnly = view !== void 0 && view.status !== "unsupported" && view.status !== "error" && !view.writable;
19919
- return /* @__PURE__ */ jsxs67(
19920
- Box70,
19990
+ return /* @__PURE__ */ jsxs68(
19991
+ Box71,
19921
19992
  {
19922
19993
  borderStyle: "round",
19923
19994
  borderColor: theme.border.default,
@@ -19926,45 +19997,45 @@ function ProviderSetupDialog({
19926
19997
  paddingY: 1,
19927
19998
  width: "100%",
19928
19999
  children: [
19929
- /* @__PURE__ */ jsxs67(Box70, { justifyContent: "space-between", children: [
19930
- /* @__PURE__ */ jsxs67(Text65, { bold: true, color: theme.text.accent, children: [
20000
+ /* @__PURE__ */ jsxs68(Box71, { justifyContent: "space-between", children: [
20001
+ /* @__PURE__ */ jsxs68(Text66, { bold: true, color: theme.text.accent, children: [
19931
20002
  "Configure ",
19932
20003
  label
19933
20004
  ] }),
19934
- /* @__PURE__ */ jsxs67(Text65, { color: theme.text.secondary, children: [
19935
- /* @__PURE__ */ jsx93(Text65, { bold: true, color: theme.text.primary, children: "Esc" }),
20005
+ /* @__PURE__ */ jsxs68(Text66, { color: theme.text.secondary, children: [
20006
+ /* @__PURE__ */ jsx94(Text66, { bold: true, color: theme.text.primary, children: "Esc" }),
19936
20007
  " ",
19937
20008
  reason === "first-run" ? "Cancel" : "Close"
19938
20009
  ] })
19939
20010
  ] }),
19940
- /* @__PURE__ */ jsxs67(Box70, { marginTop: 1, flexDirection: "column", children: [
19941
- /* @__PURE__ */ jsx93(Text65, { color: theme.text.primary, children: reason === "first-run" ? `Enter your ${label} API key to continue.` : `Enter a replacement credential for ${label}.` }),
19942
- /* @__PURE__ */ jsxs67(Text65, { color: theme.text.secondary, children: [
20011
+ /* @__PURE__ */ jsxs68(Box71, { marginTop: 1, flexDirection: "column", children: [
20012
+ /* @__PURE__ */ jsx94(Text66, { color: theme.text.primary, children: reason === "first-run" ? `Enter your ${label} API key to continue.` : `Enter a replacement credential for ${label}.` }),
20013
+ /* @__PURE__ */ jsxs68(Text66, { color: theme.text.secondary, children: [
19943
20014
  "Alternatively, set ",
19944
20015
  credential,
19945
20016
  " before starting DSH Console."
19946
20017
  ] })
19947
20018
  ] }),
19948
- !view && !error && /* @__PURE__ */ jsx93(Box70, { marginTop: 1, children: /* @__PURE__ */ jsx93(Text65, { color: theme.text.secondary, children: "Checking provider setup..." }) }),
19949
- view?.status === "configured" && /* @__PURE__ */ jsx93(Box70, { marginTop: 1, children: /* @__PURE__ */ jsxs67(Text65, { color: theme.status.success, children: [
20019
+ !view && !error && /* @__PURE__ */ jsx94(Box71, { marginTop: 1, children: /* @__PURE__ */ jsx94(Text66, { color: theme.text.secondary, children: "Checking provider setup..." }) }),
20020
+ view?.status === "configured" && /* @__PURE__ */ jsx94(Box71, { marginTop: 1, children: /* @__PURE__ */ jsxs68(Text66, { color: theme.status.success, children: [
19950
20021
  "Configured from ",
19951
20022
  view.source ?? "DSH credential storage",
19952
20023
  "."
19953
20024
  ] }) }),
19954
- (view?.status === "unsupported" || view?.status === "error") && view.message && /* @__PURE__ */ jsx93(Box70, { marginTop: 1, children: /* @__PURE__ */ jsx93(Text65, { color: theme.status.warning, children: view.message }) }),
19955
- isReadOnly && /* @__PURE__ */ jsx93(Box70, { marginTop: 1, children: /* @__PURE__ */ jsxs67(Text65, { color: theme.status.warning, children: [
20025
+ (view?.status === "unsupported" || view?.status === "error") && view.message && /* @__PURE__ */ jsx94(Box71, { marginTop: 1, children: /* @__PURE__ */ jsx94(Text66, { color: theme.status.warning, children: view.message }) }),
20026
+ isReadOnly && /* @__PURE__ */ jsx94(Box71, { marginTop: 1, children: /* @__PURE__ */ jsxs68(Text66, { color: theme.status.warning, children: [
19956
20027
  credential,
19957
20028
  " is supplied by a read-only source. Change that source and restart DSH Console."
19958
20029
  ] }) }),
19959
- canWrite && /* @__PURE__ */ jsxs67(Box70, { marginTop: 1, flexDirection: "column", children: [
19960
- /* @__PURE__ */ jsx93(Text65, { bold: true, color: theme.text.primary, children: fieldLabel }),
19961
- /* @__PURE__ */ jsx93(
19962
- Box70,
20030
+ canWrite && /* @__PURE__ */ jsxs68(Box71, { marginTop: 1, flexDirection: "column", children: [
20031
+ /* @__PURE__ */ jsx94(Text66, { bold: true, color: theme.text.primary, children: fieldLabel }),
20032
+ /* @__PURE__ */ jsx94(
20033
+ Box71,
19963
20034
  {
19964
20035
  borderStyle: "single",
19965
20036
  borderColor: saving ? theme.border.default : theme.text.accent,
19966
20037
  paddingX: 1,
19967
- children: /* @__PURE__ */ jsx93(Text65, { color: theme.text.primary, children: secret.length === 0 ? /* @__PURE__ */ jsxs67(Text65, { color: theme.text.secondary, children: [
20038
+ children: /* @__PURE__ */ jsx94(Text66, { color: theme.text.primary, children: secret.length === 0 ? /* @__PURE__ */ jsxs68(Text66, { color: theme.text.secondary, children: [
19968
20039
  "Paste your ",
19969
20040
  label,
19970
20041
  " API key"
@@ -19972,37 +20043,37 @@ function ProviderSetupDialog({
19972
20043
  }
19973
20044
  )
19974
20045
  ] }),
19975
- error && /* @__PURE__ */ jsx93(Box70, { marginTop: 1, children: /* @__PURE__ */ jsx93(Text65, { color: theme.status.error, children: error }) }),
19976
- canWrite ? /* @__PURE__ */ jsxs67(Box70, { marginTop: 1, flexDirection: "column", children: [
19977
- /* @__PURE__ */ jsx93(Text65, { color: theme.text.secondary, children: "Stored through the configured DSH credential service. Never added to prompts, sessions, history, or logs." }),
19978
- /* @__PURE__ */ jsxs67(Box70, { marginTop: 1, children: [
19979
- /* @__PURE__ */ jsx93(Text65, { bold: true, color: theme.text.accent, children: "Enter" }),
19980
- /* @__PURE__ */ jsx93(Text65, { color: theme.text.primary, children: " Save and continue" }),
19981
- /* @__PURE__ */ jsx93(Text65, { color: theme.text.secondary, children: " " }),
19982
- /* @__PURE__ */ jsx93(Text65, { bold: true, color: theme.text.primary, children: "Esc" }),
19983
- /* @__PURE__ */ jsxs67(Text65, { color: theme.text.secondary, children: [
20046
+ error && /* @__PURE__ */ jsx94(Box71, { marginTop: 1, children: /* @__PURE__ */ jsx94(Text66, { color: theme.status.error, children: error }) }),
20047
+ canWrite ? /* @__PURE__ */ jsxs68(Box71, { marginTop: 1, flexDirection: "column", children: [
20048
+ /* @__PURE__ */ jsx94(Text66, { color: theme.text.secondary, children: "Stored through the configured DSH credential service. Never added to prompts, sessions, history, or logs." }),
20049
+ /* @__PURE__ */ jsxs68(Box71, { marginTop: 1, children: [
20050
+ /* @__PURE__ */ jsx94(Text66, { bold: true, color: theme.text.accent, children: "Enter" }),
20051
+ /* @__PURE__ */ jsx94(Text66, { color: theme.text.primary, children: " Save and continue" }),
20052
+ /* @__PURE__ */ jsx94(Text66, { color: theme.text.secondary, children: " " }),
20053
+ /* @__PURE__ */ jsx94(Text66, { bold: true, color: theme.text.primary, children: "Esc" }),
20054
+ /* @__PURE__ */ jsxs68(Text66, { color: theme.text.secondary, children: [
19984
20055
  " ",
19985
20056
  reason === "first-run" ? "Cancel" : "Close"
19986
20057
  ] }),
19987
- /* @__PURE__ */ jsx93(Text65, { color: theme.text.secondary, children: " " }),
19988
- /* @__PURE__ */ jsx93(Text65, { bold: true, color: theme.text.primary, children: "Ctrl+C" }),
19989
- /* @__PURE__ */ jsxs67(Text65, { color: theme.text.secondary, children: [
20058
+ /* @__PURE__ */ jsx94(Text66, { color: theme.text.secondary, children: " " }),
20059
+ /* @__PURE__ */ jsx94(Text66, { bold: true, color: theme.text.primary, children: "Ctrl+C" }),
20060
+ /* @__PURE__ */ jsxs68(Text66, { color: theme.text.secondary, children: [
19990
20061
  " ",
19991
20062
  secret.length > 0 ? "Clear" : "Cancel"
19992
20063
  ] })
19993
20064
  ] })
19994
- ] }) : /* @__PURE__ */ jsxs67(Box70, { marginTop: 1, children: [
19995
- /* @__PURE__ */ jsx93(Text65, { bold: true, color: theme.text.primary, children: "Esc" }),
19996
- /* @__PURE__ */ jsx93(Text65, { color: theme.text.secondary, children: " Close" })
20065
+ ] }) : /* @__PURE__ */ jsxs68(Box71, { marginTop: 1, children: [
20066
+ /* @__PURE__ */ jsx94(Text66, { bold: true, color: theme.text.primary, children: "Esc" }),
20067
+ /* @__PURE__ */ jsx94(Text66, { color: theme.text.secondary, children: " Close" })
19997
20068
  ] }),
19998
- saving && /* @__PURE__ */ jsx93(Text65, { bold: true, color: theme.text.accent, children: "Saving credential..." })
20069
+ saving && /* @__PURE__ */ jsx94(Text66, { bold: true, color: theme.text.accent, children: "Saving credential..." })
19999
20070
  ]
20000
20071
  }
20001
20072
  );
20002
20073
  }
20003
20074
 
20004
20075
  // src/ui/components/dialogs/model-dialog.tsx
20005
- import { Fragment as Fragment19, jsx as jsx94, jsxs as jsxs68 } from "react/jsx-runtime";
20076
+ import { Fragment as Fragment21, jsx as jsx95, jsxs as jsxs69 } from "react/jsx-runtime";
20006
20077
  function capabilityLabel(model) {
20007
20078
  return model.inputModalities.includes("image") ? "Text + Vision" : "Text";
20008
20079
  }
@@ -20170,7 +20241,7 @@ function ModelDialog({
20170
20241
  { isActive: setupSelection === void 0 }
20171
20242
  );
20172
20243
  if (setupSelection) {
20173
- return /* @__PURE__ */ jsx94(
20244
+ return /* @__PURE__ */ jsx95(
20174
20245
  ProviderSetupDialog,
20175
20246
  {
20176
20247
  runtime: providerSetupRuntime,
@@ -20206,8 +20277,8 @@ function ModelDialog({
20206
20277
  0,
20207
20278
  effortItems.findIndex((item) => item.value === selectedEffort)
20208
20279
  );
20209
- return /* @__PURE__ */ jsxs68(
20210
- Box71,
20280
+ return /* @__PURE__ */ jsxs69(
20281
+ Box72,
20211
20282
  {
20212
20283
  borderStyle: "round",
20213
20284
  borderColor: theme.border.default,
@@ -20216,12 +20287,12 @@ function ModelDialog({
20216
20287
  paddingY: 1,
20217
20288
  width: "100%",
20218
20289
  children: [
20219
- /* @__PURE__ */ jsxs68(Box71, { justifyContent: "space-between", children: [
20220
- /* @__PURE__ */ jsx94(Text66, { bold: true, color: theme.text.primary, children: "Select Reasoning Effort" }),
20221
- /* @__PURE__ */ jsx94(DialogCloseAction, { onClose: dismiss, label: "Esc to models" })
20290
+ /* @__PURE__ */ jsxs69(Box72, { justifyContent: "space-between", children: [
20291
+ /* @__PURE__ */ jsx95(Text67, { bold: true, color: theme.text.primary, children: "Select Reasoning Effort" }),
20292
+ /* @__PURE__ */ jsx95(DialogCloseAction, { onClose: dismiss, label: "Esc to models" })
20222
20293
  ] }),
20223
- /* @__PURE__ */ jsxs68(Box71, { marginTop: 1, flexDirection: "row", children: [
20224
- /* @__PURE__ */ jsx94(Box71, { width: "55%", paddingRight: 2, flexDirection: "column", children: /* @__PURE__ */ jsx94(
20294
+ /* @__PURE__ */ jsxs69(Box72, { marginTop: 1, flexDirection: "row", children: [
20295
+ /* @__PURE__ */ jsx95(Box72, { width: "55%", paddingRight: 2, flexDirection: "column", children: /* @__PURE__ */ jsx95(
20225
20296
  RadioButtonSelect,
20226
20297
  {
20227
20298
  items: effortItems,
@@ -20240,26 +20311,26 @@ function ModelDialog({
20240
20311
  showNumbers: false
20241
20312
  }
20242
20313
  ) }),
20243
- /* @__PURE__ */ jsxs68(Box71, { width: "45%", paddingLeft: 2, flexDirection: "column", children: [
20244
- /* @__PURE__ */ jsx94(Text66, { bold: true, color: theme.text.primary, children: reasoningSelection.name }),
20245
- /* @__PURE__ */ jsxs68(Box71, { marginTop: 1, flexDirection: "column", children: [
20246
- /* @__PURE__ */ jsx94(Text66, { color: theme.text.secondary, children: "Current choice" }),
20247
- /* @__PURE__ */ jsx94(Text66, { children: modelReasoningEffortLabel({
20314
+ /* @__PURE__ */ jsxs69(Box72, { width: "45%", paddingLeft: 2, flexDirection: "column", children: [
20315
+ /* @__PURE__ */ jsx95(Text67, { bold: true, color: theme.text.primary, children: reasoningSelection.name }),
20316
+ /* @__PURE__ */ jsxs69(Box72, { marginTop: 1, flexDirection: "column", children: [
20317
+ /* @__PURE__ */ jsx95(Text67, { color: theme.text.secondary, children: "Current choice" }),
20318
+ /* @__PURE__ */ jsx95(Text67, { children: modelReasoningEffortLabel({
20248
20319
  ...reasoningSelection,
20249
20320
  reasoning: { ...reasoning, selectedEffort }
20250
20321
  }) }),
20251
- /* @__PURE__ */ jsx94(Text66, { color: theme.text.secondary, children: "Behavior" }),
20252
- /* @__PURE__ */ jsx94(Text66, { wrap: "wrap", children: "Provider default follows the model adapter. An explicit effort remains fixed for this Agent and future Sessions." })
20322
+ /* @__PURE__ */ jsx95(Text67, { color: theme.text.secondary, children: "Behavior" }),
20323
+ /* @__PURE__ */ jsx95(Text67, { wrap: "wrap", children: "Provider default follows the model adapter. An explicit effort remains fixed for this Agent and future Sessions." })
20253
20324
  ] })
20254
20325
  ] })
20255
20326
  ] }),
20256
- /* @__PURE__ */ jsx94(Box71, { marginTop: 1, children: /* @__PURE__ */ jsx94(Text66, { color: theme.text.secondary, children: "Use \u2191/\u2193 to navigate and Enter to select." }) })
20327
+ /* @__PURE__ */ jsx95(Box72, { marginTop: 1, children: /* @__PURE__ */ jsx95(Text67, { color: theme.text.secondary, children: "Use \u2191/\u2193 to navigate and Enter to select." }) })
20257
20328
  ]
20258
20329
  }
20259
20330
  );
20260
20331
  }
20261
- return /* @__PURE__ */ jsxs68(
20262
- Box71,
20332
+ return /* @__PURE__ */ jsxs69(
20333
+ Box72,
20263
20334
  {
20264
20335
  borderStyle: "round",
20265
20336
  borderColor: theme.border.default,
@@ -20268,9 +20339,9 @@ function ModelDialog({
20268
20339
  paddingY: 1,
20269
20340
  width: "100%",
20270
20341
  children: [
20271
- /* @__PURE__ */ jsxs68(Box71, { justifyContent: "space-between", children: [
20272
- /* @__PURE__ */ jsx94(Text66, { bold: true, color: theme.text.primary, children: "Select DSH Model" }),
20273
- /* @__PURE__ */ jsx94(
20342
+ /* @__PURE__ */ jsxs69(Box72, { justifyContent: "space-between", children: [
20343
+ /* @__PURE__ */ jsx95(Text67, { bold: true, color: theme.text.primary, children: "Select DSH Model" }),
20344
+ /* @__PURE__ */ jsx95(
20274
20345
  DialogCloseAction,
20275
20346
  {
20276
20347
  onClose: dismiss,
@@ -20279,9 +20350,9 @@ function ModelDialog({
20279
20350
  }
20280
20351
  )
20281
20352
  ] }),
20282
- error && /* @__PURE__ */ jsx94(Box71, { marginTop: 1, children: /* @__PURE__ */ jsx94(Text66, { color: theme.status.error, children: error }) }),
20283
- loading ? /* @__PURE__ */ jsx94(Box71, { marginTop: 1, children: /* @__PURE__ */ jsx94(Text66, { color: theme.text.secondary, children: "Loading models..." }) }) : models.length === 0 ? /* @__PURE__ */ jsx94(Box71, { marginTop: 1, children: /* @__PURE__ */ jsx94(Text66, { color: theme.status.warning, children: "No DSH models are available." }) }) : /* @__PURE__ */ jsxs68(Box71, { flexDirection: "row", marginTop: 1, children: [
20284
- /* @__PURE__ */ jsx94(Box71, { width: "55%", paddingRight: 2, flexDirection: "column", children: /* @__PURE__ */ jsx94(
20353
+ error && /* @__PURE__ */ jsx95(Box72, { marginTop: 1, children: /* @__PURE__ */ jsx95(Text67, { color: theme.status.error, children: error }) }),
20354
+ loading ? /* @__PURE__ */ jsx95(Box72, { marginTop: 1, children: /* @__PURE__ */ jsx95(Text67, { color: theme.text.secondary, children: "Loading models..." }) }) : models.length === 0 ? /* @__PURE__ */ jsx95(Box72, { marginTop: 1, children: /* @__PURE__ */ jsx95(Text67, { color: theme.status.warning, children: "No DSH models are available." }) }) : /* @__PURE__ */ jsxs69(Box72, { flexDirection: "row", marginTop: 1, children: [
20355
+ /* @__PURE__ */ jsx95(Box72, { width: "55%", paddingRight: 2, flexDirection: "column", children: /* @__PURE__ */ jsx95(
20285
20356
  RadioButtonSelect,
20286
20357
  {
20287
20358
  items,
@@ -20294,28 +20365,28 @@ function ModelDialog({
20294
20365
  renderItem: (item, { titleColor }) => {
20295
20366
  const model = item.value;
20296
20367
  const isCurrent = model.provider === current.provider && model.model === current.model;
20297
- return /* @__PURE__ */ jsxs68(Text66, { color: titleColor, wrap: "truncate", children: [
20368
+ return /* @__PURE__ */ jsxs69(Text67, { color: titleColor, wrap: "truncate", children: [
20298
20369
  model.name,
20299
20370
  " ",
20300
- /* @__PURE__ */ jsx94(Text66, { color: theme.text.secondary, children: model.provider }),
20301
- model.inputModalities.includes("image") && /* @__PURE__ */ jsx94(Text66, { color: theme.status.success, children: " Vision" }),
20302
- isCurrent && /* @__PURE__ */ jsx94(Text66, { color: theme.text.accent, children: " Current" })
20371
+ /* @__PURE__ */ jsx95(Text67, { color: theme.text.secondary, children: model.provider }),
20372
+ model.inputModalities.includes("image") && /* @__PURE__ */ jsx95(Text67, { color: theme.status.success, children: " Vision" }),
20373
+ isCurrent && /* @__PURE__ */ jsx95(Text67, { color: theme.text.accent, children: " Current" })
20303
20374
  ] });
20304
20375
  }
20305
20376
  },
20306
20377
  items.map((item) => item.key).join("|")
20307
20378
  ) }),
20308
- /* @__PURE__ */ jsx94(Box71, { width: "45%", paddingLeft: 2, flexDirection: "column", children: pending ? /* @__PURE__ */ jsxs68(Fragment19, { children: [
20309
- /* @__PURE__ */ jsx94(Text66, { bold: true, color: theme.status.warning, children: "Start a new Session?" }),
20310
- /* @__PURE__ */ jsxs68(Box71, { marginTop: 1, flexDirection: "column", children: [
20311
- /* @__PURE__ */ jsxs68(Text66, { children: [
20379
+ /* @__PURE__ */ jsx95(Box72, { width: "45%", paddingLeft: 2, flexDirection: "column", children: pending ? /* @__PURE__ */ jsxs69(Fragment21, { children: [
20380
+ /* @__PURE__ */ jsx95(Text67, { bold: true, color: theme.status.warning, children: "Start a new Session?" }),
20381
+ /* @__PURE__ */ jsxs69(Box72, { marginTop: 1, flexDirection: "column", children: [
20382
+ /* @__PURE__ */ jsxs69(Text67, { children: [
20312
20383
  "Changing to ",
20313
20384
  pending.name,
20314
20385
  " creates a new DSH Agent and Session."
20315
20386
  ] }),
20316
- /* @__PURE__ */ jsx94(Text66, { color: theme.text.secondary, children: "The existing transcript remains visible but is not sent to the new model." })
20387
+ /* @__PURE__ */ jsx95(Text67, { color: theme.text.secondary, children: "The existing transcript remains visible but is not sent to the new model." })
20317
20388
  ] }),
20318
- /* @__PURE__ */ jsx94(Box71, { marginTop: 1, children: /* @__PURE__ */ jsx94(
20389
+ /* @__PURE__ */ jsx95(Box72, { marginTop: 1, children: /* @__PURE__ */ jsx95(
20319
20390
  RadioButtonSelect,
20320
20391
  {
20321
20392
  items: [
@@ -20334,29 +20405,29 @@ function ModelDialog({
20334
20405
  showNumbers: false
20335
20406
  }
20336
20407
  ) })
20337
- ] }) : /* @__PURE__ */ jsxs68(Fragment19, { children: [
20338
- /* @__PURE__ */ jsx94(Text66, { bold: true, color: theme.text.primary, children: highlighted.name }),
20339
- /* @__PURE__ */ jsxs68(Box71, { marginTop: 1, flexDirection: "column", children: [
20340
- /* @__PURE__ */ jsx94(Text66, { color: theme.text.secondary, children: "Provider" }),
20341
- /* @__PURE__ */ jsx94(Text66, { children: highlighted.provider }),
20342
- /* @__PURE__ */ jsx94(Text66, { color: theme.text.secondary, children: "Model ID" }),
20343
- /* @__PURE__ */ jsx94(Text66, { wrap: "wrap", children: highlighted.model }),
20344
- /* @__PURE__ */ jsx94(Text66, { color: theme.text.secondary, children: "Input" }),
20345
- /* @__PURE__ */ jsx94(
20346
- Text66,
20408
+ ] }) : /* @__PURE__ */ jsxs69(Fragment21, { children: [
20409
+ /* @__PURE__ */ jsx95(Text67, { bold: true, color: theme.text.primary, children: highlighted.name }),
20410
+ /* @__PURE__ */ jsxs69(Box72, { marginTop: 1, flexDirection: "column", children: [
20411
+ /* @__PURE__ */ jsx95(Text67, { color: theme.text.secondary, children: "Provider" }),
20412
+ /* @__PURE__ */ jsx95(Text67, { children: highlighted.provider }),
20413
+ /* @__PURE__ */ jsx95(Text67, { color: theme.text.secondary, children: "Model ID" }),
20414
+ /* @__PURE__ */ jsx95(Text67, { wrap: "wrap", children: highlighted.model }),
20415
+ /* @__PURE__ */ jsx95(Text67, { color: theme.text.secondary, children: "Input" }),
20416
+ /* @__PURE__ */ jsx95(
20417
+ Text67,
20347
20418
  {
20348
20419
  color: highlighted.inputModalities.includes("image") ? theme.status.success : theme.text.primary,
20349
20420
  children: capabilityLabel(highlighted)
20350
20421
  }
20351
20422
  ),
20352
- /* @__PURE__ */ jsx94(Text66, { color: theme.text.secondary, children: "Context window" }),
20353
- /* @__PURE__ */ jsx94(Text66, { children: highlighted.contextWindow === void 0 ? "Not disclosed" : `${formatTokenCount(highlighted.contextWindow)} tokens` })
20423
+ /* @__PURE__ */ jsx95(Text67, { color: theme.text.secondary, children: "Context window" }),
20424
+ /* @__PURE__ */ jsx95(Text67, { children: highlighted.contextWindow === void 0 ? "Not disclosed" : `${formatTokenCount(highlighted.contextWindow)} tokens` })
20354
20425
  ] }),
20355
- switching && /* @__PURE__ */ jsx94(Box71, { marginTop: 1, children: /* @__PURE__ */ jsx94(Text66, { color: theme.text.accent, children: "Creating new Agent..." }) }),
20356
- checkingProvider && /* @__PURE__ */ jsx94(Box71, { marginTop: 1, children: /* @__PURE__ */ jsx94(Text66, { color: theme.text.accent, children: "Checking provider setup..." }) })
20426
+ switching && /* @__PURE__ */ jsx95(Box72, { marginTop: 1, children: /* @__PURE__ */ jsx95(Text67, { color: theme.text.accent, children: "Creating new Agent..." }) }),
20427
+ checkingProvider && /* @__PURE__ */ jsx95(Box72, { marginTop: 1, children: /* @__PURE__ */ jsx95(Text67, { color: theme.text.accent, children: "Checking provider setup..." }) })
20357
20428
  ] }) })
20358
20429
  ] }),
20359
- /* @__PURE__ */ jsx94(Box71, { marginTop: 1, children: /* @__PURE__ */ jsx94(Text66, { color: theme.text.secondary, children: "Use \u2191/\u2193 to navigate and Enter to select." }) })
20430
+ /* @__PURE__ */ jsx95(Box72, { marginTop: 1, children: /* @__PURE__ */ jsx95(Text67, { color: theme.text.secondary, children: "Use \u2191/\u2193 to navigate and Enter to select." }) })
20360
20431
  ]
20361
20432
  }
20362
20433
  );
@@ -20410,8 +20481,8 @@ import React20 from "react";
20410
20481
 
20411
20482
  // src/ui/components/dialogs/provider-dialog.tsx
20412
20483
  import { useEffect as useEffect40, useMemo as useMemo33, useState as useState39 } from "react";
20413
- import { Box as Box72, Text as Text67 } from "ink";
20414
- import { Fragment as Fragment20, jsx as jsx95, jsxs as jsxs69 } from "react/jsx-runtime";
20484
+ import { Box as Box73, Text as Text68 } from "ink";
20485
+ import { Fragment as Fragment22, jsx as jsx96, jsxs as jsxs70 } from "react/jsx-runtime";
20415
20486
  function statusLabel(status) {
20416
20487
  switch (status) {
20417
20488
  case "configured":
@@ -20502,7 +20573,7 @@ function ProviderDialog({
20502
20573
  );
20503
20574
  const currentProvider = runtime.getSnapshot().current.provider;
20504
20575
  if (editing) {
20505
- return /* @__PURE__ */ jsx95(
20576
+ return /* @__PURE__ */ jsx96(
20506
20577
  ProviderSetupDialog,
20507
20578
  {
20508
20579
  runtime,
@@ -20520,8 +20591,8 @@ function ProviderDialog({
20520
20591
  }
20521
20592
  );
20522
20593
  }
20523
- return /* @__PURE__ */ jsxs69(
20524
- Box72,
20594
+ return /* @__PURE__ */ jsxs70(
20595
+ Box73,
20525
20596
  {
20526
20597
  borderStyle: "round",
20527
20598
  borderColor: theme.border.default,
@@ -20530,18 +20601,18 @@ function ProviderDialog({
20530
20601
  paddingY: 1,
20531
20602
  width: "100%",
20532
20603
  children: [
20533
- /* @__PURE__ */ jsxs69(Box72, { justifyContent: "space-between", children: [
20534
- /* @__PURE__ */ jsx95(Text67, { bold: true, color: theme.text.accent, children: "DSH Providers" }),
20535
- /* @__PURE__ */ jsxs69(Text67, { color: theme.text.secondary, children: [
20536
- /* @__PURE__ */ jsx95(Text67, { bold: true, color: theme.text.primary, children: "Esc" }),
20604
+ /* @__PURE__ */ jsxs70(Box73, { justifyContent: "space-between", children: [
20605
+ /* @__PURE__ */ jsx96(Text68, { bold: true, color: theme.text.accent, children: "DSH Providers" }),
20606
+ /* @__PURE__ */ jsxs70(Text68, { color: theme.text.secondary, children: [
20607
+ /* @__PURE__ */ jsx96(Text68, { bold: true, color: theme.text.primary, children: "Esc" }),
20537
20608
  " Close"
20538
20609
  ] })
20539
20610
  ] }),
20540
- error && /* @__PURE__ */ jsx95(Box72, { marginTop: 1, children: /* @__PURE__ */ jsx95(Text67, { color: theme.status.error, children: error }) }),
20541
- loading && /* @__PURE__ */ jsx95(Box72, { marginTop: 1, children: /* @__PURE__ */ jsx95(Text67, { color: theme.text.secondary, children: "Loading providers..." }) }),
20542
- !loading && providers.length === 0 && /* @__PURE__ */ jsx95(Box72, { marginTop: 1, children: /* @__PURE__ */ jsx95(Text67, { color: theme.status.warning, children: "No DSH-managed providers are available." }) }),
20543
- providers.length > 0 && highlighted && /* @__PURE__ */ jsxs69(Box72, { marginTop: 1, children: [
20544
- /* @__PURE__ */ jsx95(Box72, { width: "55%", paddingRight: 2, children: /* @__PURE__ */ jsx95(
20611
+ error && /* @__PURE__ */ jsx96(Box73, { marginTop: 1, children: /* @__PURE__ */ jsx96(Text68, { color: theme.status.error, children: error }) }),
20612
+ loading && /* @__PURE__ */ jsx96(Box73, { marginTop: 1, children: /* @__PURE__ */ jsx96(Text68, { color: theme.text.secondary, children: "Loading providers..." }) }),
20613
+ !loading && providers.length === 0 && /* @__PURE__ */ jsx96(Box73, { marginTop: 1, children: /* @__PURE__ */ jsx96(Text68, { color: theme.status.warning, children: "No DSH-managed providers are available." }) }),
20614
+ providers.length > 0 && highlighted && /* @__PURE__ */ jsxs70(Box73, { marginTop: 1, children: [
20615
+ /* @__PURE__ */ jsx96(Box73, { width: "55%", paddingRight: 2, children: /* @__PURE__ */ jsx96(
20545
20616
  RadioButtonSelect,
20546
20617
  {
20547
20618
  items,
@@ -20554,45 +20625,45 @@ function ProviderDialog({
20554
20625
  },
20555
20626
  showScrollArrows: true,
20556
20627
  maxItemsToShow: 12,
20557
- renderItem: (item, { titleColor }) => /* @__PURE__ */ jsxs69(Text67, { color: titleColor, wrap: "truncate", children: [
20628
+ renderItem: (item, { titleColor }) => /* @__PURE__ */ jsxs70(Text68, { color: titleColor, wrap: "truncate", children: [
20558
20629
  item.value.displayName,
20559
20630
  " ",
20560
- /* @__PURE__ */ jsx95(Text67, { color: statusColor(item.value.status), children: statusLabel(item.value.status) }),
20561
- item.value.provider === currentProvider && /* @__PURE__ */ jsx95(Text67, { color: theme.text.accent, children: " Current" })
20631
+ /* @__PURE__ */ jsx96(Text68, { color: statusColor(item.value.status), children: statusLabel(item.value.status) }),
20632
+ item.value.provider === currentProvider && /* @__PURE__ */ jsx96(Text68, { color: theme.text.accent, children: " Current" })
20562
20633
  ] })
20563
20634
  }
20564
20635
  ) }),
20565
- /* @__PURE__ */ jsxs69(Box72, { width: "45%", paddingLeft: 2, flexDirection: "column", children: [
20566
- /* @__PURE__ */ jsx95(Text67, { bold: true, color: theme.text.primary, children: highlighted.displayName }),
20567
- /* @__PURE__ */ jsxs69(Box72, { marginTop: 1, flexDirection: "column", children: [
20568
- /* @__PURE__ */ jsx95(Text67, { color: theme.text.secondary, children: "Provider" }),
20569
- /* @__PURE__ */ jsx95(Text67, { children: highlighted.provider }),
20570
- /* @__PURE__ */ jsx95(Text67, { color: theme.text.secondary, children: "Status" }),
20571
- /* @__PURE__ */ jsx95(Text67, { color: statusColor(highlighted.status), children: statusLabel(highlighted.status) }),
20572
- highlighted.credentialLabel && /* @__PURE__ */ jsxs69(Fragment20, { children: [
20573
- /* @__PURE__ */ jsx95(Text67, { color: theme.text.secondary, children: "Credential" }),
20574
- /* @__PURE__ */ jsx95(Text67, { children: highlighted.credentialLabel })
20636
+ /* @__PURE__ */ jsxs70(Box73, { width: "45%", paddingLeft: 2, flexDirection: "column", children: [
20637
+ /* @__PURE__ */ jsx96(Text68, { bold: true, color: theme.text.primary, children: highlighted.displayName }),
20638
+ /* @__PURE__ */ jsxs70(Box73, { marginTop: 1, flexDirection: "column", children: [
20639
+ /* @__PURE__ */ jsx96(Text68, { color: theme.text.secondary, children: "Provider" }),
20640
+ /* @__PURE__ */ jsx96(Text68, { children: highlighted.provider }),
20641
+ /* @__PURE__ */ jsx96(Text68, { color: theme.text.secondary, children: "Status" }),
20642
+ /* @__PURE__ */ jsx96(Text68, { color: statusColor(highlighted.status), children: statusLabel(highlighted.status) }),
20643
+ highlighted.credentialLabel && /* @__PURE__ */ jsxs70(Fragment22, { children: [
20644
+ /* @__PURE__ */ jsx96(Text68, { color: theme.text.secondary, children: "Credential" }),
20645
+ /* @__PURE__ */ jsx96(Text68, { children: highlighted.credentialLabel })
20575
20646
  ] }),
20576
- highlighted.source && /* @__PURE__ */ jsxs69(Fragment20, { children: [
20577
- /* @__PURE__ */ jsx95(Text67, { color: theme.text.secondary, children: "Source" }),
20578
- /* @__PURE__ */ jsx95(Text67, { children: highlighted.source })
20647
+ highlighted.source && /* @__PURE__ */ jsxs70(Fragment22, { children: [
20648
+ /* @__PURE__ */ jsx96(Text68, { color: theme.text.secondary, children: "Source" }),
20649
+ /* @__PURE__ */ jsx96(Text68, { children: highlighted.source })
20579
20650
  ] }),
20580
- highlighted.message && /* @__PURE__ */ jsx95(Box72, { marginTop: 1, children: /* @__PURE__ */ jsx95(Text67, { color: theme.status.warning, children: highlighted.message }) }),
20581
- !highlighted.writable && highlighted.status !== "unsupported" && highlighted.status !== "error" && /* @__PURE__ */ jsx95(Box72, { marginTop: 1, children: /* @__PURE__ */ jsx95(Text67, { color: theme.status.warning, children: "This credential comes from a read-only source. Update it outside DSH Console." }) })
20651
+ highlighted.message && /* @__PURE__ */ jsx96(Box73, { marginTop: 1, children: /* @__PURE__ */ jsx96(Text68, { color: theme.status.warning, children: highlighted.message }) }),
20652
+ !highlighted.writable && highlighted.status !== "unsupported" && highlighted.status !== "error" && /* @__PURE__ */ jsx96(Box73, { marginTop: 1, children: /* @__PURE__ */ jsx96(Text68, { color: theme.status.warning, children: "This credential comes from a read-only source. Update it outside DSH Console." }) })
20582
20653
  ] })
20583
20654
  ] })
20584
20655
  ] }),
20585
- providers.length > 0 && highlighted && /* @__PURE__ */ jsx95(Box72, { marginTop: 1, children: highlighted.writable && highlighted.status !== "unsupported" ? /* @__PURE__ */ jsxs69(Fragment20, { children: [
20586
- /* @__PURE__ */ jsx95(Text67, { bold: true, color: theme.text.accent, children: "Enter" }),
20587
- /* @__PURE__ */ jsxs69(Text67, { color: theme.text.primary, children: [
20656
+ providers.length > 0 && highlighted && /* @__PURE__ */ jsx96(Box73, { marginTop: 1, children: highlighted.writable && highlighted.status !== "unsupported" ? /* @__PURE__ */ jsxs70(Fragment22, { children: [
20657
+ /* @__PURE__ */ jsx96(Text68, { bold: true, color: theme.text.accent, children: "Enter" }),
20658
+ /* @__PURE__ */ jsxs70(Text68, { color: theme.text.primary, children: [
20588
20659
  " ",
20589
20660
  highlighted.status === "configured" ? "Replace credential" : "Configure provider"
20590
20661
  ] }),
20591
- /* @__PURE__ */ jsxs69(Text67, { color: theme.text.secondary, children: [
20662
+ /* @__PURE__ */ jsxs70(Text68, { color: theme.text.secondary, children: [
20592
20663
  " ",
20593
20664
  "Use \u2191/\u2193 to navigate"
20594
20665
  ] })
20595
- ] }) : /* @__PURE__ */ jsx95(Text67, { color: theme.text.secondary, children: "Use \u2191/\u2193 to inspect providers. This credential cannot be changed here." }) })
20666
+ ] }) : /* @__PURE__ */ jsx96(Text68, { color: theme.text.secondary, children: "Use \u2191/\u2193 to inspect providers. This credential cannot be changed here." }) })
20596
20667
  ]
20597
20668
  }
20598
20669
  );
@@ -20645,8 +20716,8 @@ import React21 from "react";
20645
20716
 
20646
20717
  // src/ui/components/dialogs/session-dialog.tsx
20647
20718
  import { useCallback as useCallback37, useEffect as useEffect41, useMemo as useMemo34, useRef as useRef23, useState as useState40 } from "react";
20648
- import { Box as Box73, Text as Text68 } from "ink";
20649
- import { Fragment as Fragment21, jsx as jsx96, jsxs as jsxs70 } from "react/jsx-runtime";
20719
+ import { Box as Box74, Text as Text69 } from "ink";
20720
+ import { Fragment as Fragment23, jsx as jsx97, jsxs as jsxs71 } from "react/jsx-runtime";
20650
20721
  function shortId(id) {
20651
20722
  const start2 = id.startsWith("dsh-console-") ? "dsh-console-".length : 0;
20652
20723
  return id.slice(start2, start2 + 12);
@@ -20790,8 +20861,8 @@ function SessionDialog({
20790
20861
  },
20791
20862
  { isActive: true }
20792
20863
  );
20793
- return /* @__PURE__ */ jsxs70(
20794
- Box73,
20864
+ return /* @__PURE__ */ jsxs71(
20865
+ Box74,
20795
20866
  {
20796
20867
  borderStyle: "round",
20797
20868
  borderColor: theme.border.default,
@@ -20800,9 +20871,9 @@ function SessionDialog({
20800
20871
  paddingY: 1,
20801
20872
  width: "100%",
20802
20873
  children: [
20803
- /* @__PURE__ */ jsxs70(Box73, { justifyContent: "space-between", children: [
20804
- /* @__PURE__ */ jsx96(Text68, { bold: true, color: theme.text.primary, children: "DSH Sessions" }),
20805
- /* @__PURE__ */ jsx96(
20874
+ /* @__PURE__ */ jsxs71(Box74, { justifyContent: "space-between", children: [
20875
+ /* @__PURE__ */ jsx97(Text69, { bold: true, color: theme.text.primary, children: "DSH Sessions" }),
20876
+ /* @__PURE__ */ jsx97(
20806
20877
  DialogCloseAction,
20807
20878
  {
20808
20879
  onClose: dismiss,
@@ -20811,9 +20882,9 @@ function SessionDialog({
20811
20882
  }
20812
20883
  )
20813
20884
  ] }),
20814
- error && /* @__PURE__ */ jsx96(Box73, { marginTop: 1, children: /* @__PURE__ */ jsx96(Text68, { color: theme.status.error, children: error }) }),
20815
- loading ? /* @__PURE__ */ jsx96(Box73, { marginTop: 1, children: /* @__PURE__ */ jsx96(Text68, { color: theme.text.secondary, children: "Loading Sessions..." }) }) : sessions.length === 0 ? /* @__PURE__ */ jsx96(Box73, { marginTop: 1, children: /* @__PURE__ */ jsx96(Text68, { color: theme.text.secondary, children: "No resumable Sessions." }) }) : /* @__PURE__ */ jsxs70(Box73, { flexDirection: "row", marginTop: 1, children: [
20816
- /* @__PURE__ */ jsx96(Box73, { width: "55%", paddingRight: 2, flexDirection: "column", children: /* @__PURE__ */ jsx96(
20885
+ error && /* @__PURE__ */ jsx97(Box74, { marginTop: 1, children: /* @__PURE__ */ jsx97(Text69, { color: theme.status.error, children: error }) }),
20886
+ loading ? /* @__PURE__ */ jsx97(Box74, { marginTop: 1, children: /* @__PURE__ */ jsx97(Text69, { color: theme.text.secondary, children: "Loading Sessions..." }) }) : sessions.length === 0 ? /* @__PURE__ */ jsx97(Box74, { marginTop: 1, children: /* @__PURE__ */ jsx97(Text69, { color: theme.text.secondary, children: "No resumable Sessions." }) }) : /* @__PURE__ */ jsxs71(Box74, { flexDirection: "row", marginTop: 1, children: [
20887
+ /* @__PURE__ */ jsx97(Box74, { width: "55%", paddingRight: 2, flexDirection: "column", children: /* @__PURE__ */ jsx97(
20817
20888
  RadioButtonSelect,
20818
20889
  {
20819
20890
  items,
@@ -20823,20 +20894,20 @@ function SessionDialog({
20823
20894
  isFocused: !pending && !switching,
20824
20895
  showScrollArrows: true,
20825
20896
  maxItemsToShow: 12,
20826
- renderItem: (item, { titleColor }) => /* @__PURE__ */ jsxs70(Text68, { color: titleColor, wrap: "truncate", children: [
20897
+ renderItem: (item, { titleColor }) => /* @__PURE__ */ jsxs71(Text69, { color: titleColor, wrap: "truncate", children: [
20827
20898
  sessionLabel(item.value),
20828
- item.value.current && /* @__PURE__ */ jsx96(Text68, { color: theme.text.accent, children: " Current" }),
20829
- !item.value.current && !item.value.resumable && /* @__PURE__ */ jsx96(Text68, { color: theme.status.warning, children: " Not resumable" })
20899
+ item.value.current && /* @__PURE__ */ jsx97(Text69, { color: theme.text.accent, children: " Current" }),
20900
+ !item.value.current && !item.value.resumable && /* @__PURE__ */ jsx97(Text69, { color: theme.status.warning, children: " Not resumable" })
20830
20901
  ] })
20831
20902
  }
20832
20903
  ) }),
20833
- /* @__PURE__ */ jsx96(Box73, { width: "45%", paddingLeft: 2, flexDirection: "column", children: pending ? /* @__PURE__ */ jsxs70(Fragment21, { children: [
20834
- /* @__PURE__ */ jsx96(Text68, { bold: true, color: theme.status.warning, children: "Resume this Session?" }),
20835
- /* @__PURE__ */ jsxs70(Box73, { marginTop: 1, flexDirection: "column", children: [
20836
- /* @__PURE__ */ jsx96(Text68, { children: sessionLabel(pending) }),
20837
- /* @__PURE__ */ jsx96(Text68, { color: theme.text.secondary, children: "The current transcript will be replaced." })
20904
+ /* @__PURE__ */ jsx97(Box74, { width: "45%", paddingLeft: 2, flexDirection: "column", children: pending ? /* @__PURE__ */ jsxs71(Fragment23, { children: [
20905
+ /* @__PURE__ */ jsx97(Text69, { bold: true, color: theme.status.warning, children: "Resume this Session?" }),
20906
+ /* @__PURE__ */ jsxs71(Box74, { marginTop: 1, flexDirection: "column", children: [
20907
+ /* @__PURE__ */ jsx97(Text69, { children: sessionLabel(pending) }),
20908
+ /* @__PURE__ */ jsx97(Text69, { color: theme.text.secondary, children: "The current transcript will be replaced." })
20838
20909
  ] }),
20839
- /* @__PURE__ */ jsx96(Box73, { marginTop: 1, children: /* @__PURE__ */ jsx96(
20910
+ /* @__PURE__ */ jsx97(Box74, { marginTop: 1, children: /* @__PURE__ */ jsx97(
20840
20911
  RadioButtonSelect,
20841
20912
  {
20842
20913
  items: [
@@ -20848,21 +20919,21 @@ function SessionDialog({
20848
20919
  showNumbers: false
20849
20920
  }
20850
20921
  ) })
20851
- ] }) : highlighted ? /* @__PURE__ */ jsxs70(Fragment21, { children: [
20852
- /* @__PURE__ */ jsx96(Text68, { bold: true, children: sessionLabel(highlighted) }),
20853
- /* @__PURE__ */ jsxs70(Box73, { marginTop: 1, flexDirection: "column", children: [
20854
- /* @__PURE__ */ jsx96(Text68, { color: theme.text.secondary, children: "Created" }),
20855
- /* @__PURE__ */ jsx96(Text68, { children: new Date(highlighted.createdAt).toLocaleString() }),
20856
- !highlighted.resumable && highlighted.resumeUnavailableReason && /* @__PURE__ */ jsxs70(Fragment21, { children: [
20857
- /* @__PURE__ */ jsx96(Text68, { color: theme.text.secondary, children: "Resume status" }),
20858
- /* @__PURE__ */ jsx96(Text68, { color: theme.status.warning, children: highlighted.resumeUnavailableReason })
20922
+ ] }) : highlighted ? /* @__PURE__ */ jsxs71(Fragment23, { children: [
20923
+ /* @__PURE__ */ jsx97(Text69, { bold: true, children: sessionLabel(highlighted) }),
20924
+ /* @__PURE__ */ jsxs71(Box74, { marginTop: 1, flexDirection: "column", children: [
20925
+ /* @__PURE__ */ jsx97(Text69, { color: theme.text.secondary, children: "Created" }),
20926
+ /* @__PURE__ */ jsx97(Text69, { children: new Date(highlighted.createdAt).toLocaleString() }),
20927
+ !highlighted.resumable && highlighted.resumeUnavailableReason && /* @__PURE__ */ jsxs71(Fragment23, { children: [
20928
+ /* @__PURE__ */ jsx97(Text69, { color: theme.text.secondary, children: "Resume status" }),
20929
+ /* @__PURE__ */ jsx97(Text69, { color: theme.status.warning, children: highlighted.resumeUnavailableReason })
20859
20930
  ] }),
20860
- /* @__PURE__ */ jsx96(Text68, { color: theme.text.secondary, children: "Session ID" }),
20861
- /* @__PURE__ */ jsx96(Text68, { wrap: "wrap", children: highlighted.id })
20931
+ /* @__PURE__ */ jsx97(Text69, { color: theme.text.secondary, children: "Session ID" }),
20932
+ /* @__PURE__ */ jsx97(Text69, { wrap: "wrap", children: highlighted.id })
20862
20933
  ] })
20863
20934
  ] }) : null })
20864
20935
  ] }),
20865
- /* @__PURE__ */ jsx96(Box73, { marginTop: 1, children: /* @__PURE__ */ jsx96(Text68, { color: theme.text.secondary, children: "Use \u2191/\u2193 to navigate and Enter to resume." }) })
20936
+ /* @__PURE__ */ jsx97(Box74, { marginTop: 1, children: /* @__PURE__ */ jsx97(Text69, { color: theme.text.secondary, children: "Use \u2191/\u2193 to navigate and Enter to resume." }) })
20866
20937
  ]
20867
20938
  }
20868
20939
  );
@@ -20958,11 +21029,11 @@ import React22 from "react";
20958
21029
 
20959
21030
  // src/ui/components/dialogs/tools-dialog.tsx
20960
21031
  import { useEffect as useEffect42, useMemo as useMemo35, useState as useState41, useSyncExternalStore as useSyncExternalStore3 } from "react";
20961
- import { Box as Box75, Text as Text70 } from "ink";
21032
+ import { Box as Box76, Text as Text71 } from "ink";
20962
21033
 
20963
21034
  // src/ui/components/shared/descriptive-radio-button-select.tsx
20964
- import { Text as Text69, Box as Box74 } from "ink";
20965
- import { jsx as jsx97, jsxs as jsxs71 } from "react/jsx-runtime";
21035
+ import { Text as Text70, Box as Box75 } from "ink";
21036
+ import { jsx as jsx98, jsxs as jsxs72 } from "react/jsx-runtime";
20966
21037
  function DescriptiveRadioButtonSelect({
20967
21038
  items,
20968
21039
  initialIndex = 0,
@@ -20973,7 +21044,7 @@ function DescriptiveRadioButtonSelect({
20973
21044
  showScrollArrows = false,
20974
21045
  maxItemsToShow = 10
20975
21046
  }) {
20976
- return /* @__PURE__ */ jsx97(
21047
+ return /* @__PURE__ */ jsx98(
20977
21048
  BaseSelectionList,
20978
21049
  {
20979
21050
  items,
@@ -20984,16 +21055,16 @@ function DescriptiveRadioButtonSelect({
20984
21055
  showNumbers,
20985
21056
  showScrollArrows,
20986
21057
  maxItemsToShow,
20987
- renderItem: (item, { titleColor }) => /* @__PURE__ */ jsxs71(Box74, { flexDirection: "column", children: [
20988
- /* @__PURE__ */ jsx97(Text69, { color: titleColor, children: item.title }),
20989
- item.description && /* @__PURE__ */ jsx97(Text69, { color: theme.text.secondary, children: item.description })
21058
+ renderItem: (item, { titleColor }) => /* @__PURE__ */ jsxs72(Box75, { flexDirection: "column", children: [
21059
+ /* @__PURE__ */ jsx98(Text70, { color: titleColor, children: item.title }),
21060
+ item.description && /* @__PURE__ */ jsx98(Text70, { color: theme.text.secondary, children: item.description })
20990
21061
  ] }, item.key)
20991
21062
  }
20992
21063
  );
20993
21064
  }
20994
21065
 
20995
21066
  // src/ui/components/dialogs/tools-dialog.tsx
20996
- import { Fragment as Fragment22, jsx as jsx98, jsxs as jsxs72 } from "react/jsx-runtime";
21067
+ import { Fragment as Fragment24, jsx as jsx99, jsxs as jsxs73 } from "react/jsx-runtime";
20997
21068
  function summary(description) {
20998
21069
  const line = description.replace(/\s+/g, " ").trim();
20999
21070
  return line.length > 90 ? `${line.slice(0, 89)}...` : line;
@@ -21027,8 +21098,8 @@ function ToolsDialog({
21027
21098
  })),
21028
21099
  [snapshot.tools]
21029
21100
  );
21030
- return /* @__PURE__ */ jsxs72(
21031
- Box75,
21101
+ return /* @__PURE__ */ jsxs73(
21102
+ Box76,
21032
21103
  {
21033
21104
  borderStyle: "round",
21034
21105
  borderColor: theme.border.default,
@@ -21037,16 +21108,16 @@ function ToolsDialog({
21037
21108
  paddingY: 1,
21038
21109
  width: "100%",
21039
21110
  children: [
21040
- /* @__PURE__ */ jsxs72(Box75, { justifyContent: "space-between", children: [
21041
- /* @__PURE__ */ jsxs72(Text70, { bold: true, color: theme.text.primary, children: [
21111
+ /* @__PURE__ */ jsxs73(Box76, { justifyContent: "space-between", children: [
21112
+ /* @__PURE__ */ jsxs73(Text71, { bold: true, color: theme.text.primary, children: [
21042
21113
  "DSH Tools (",
21043
21114
  snapshot.tools.length,
21044
21115
  ")"
21045
21116
  ] }),
21046
- /* @__PURE__ */ jsx98(DialogCloseAction, { onClose })
21117
+ /* @__PURE__ */ jsx99(DialogCloseAction, { onClose })
21047
21118
  ] }),
21048
- snapshot.tools.length === 0 ? /* @__PURE__ */ jsx98(Box75, { marginTop: 1, children: /* @__PURE__ */ jsx98(Text70, { color: theme.text.secondary, children: "No tools are visible to the current Agent." }) }) : /* @__PURE__ */ jsxs72(Box75, { flexDirection: "row", marginTop: 1, children: [
21049
- /* @__PURE__ */ jsx98(Box75, { width: "55%", paddingRight: 2, flexDirection: "column", children: /* @__PURE__ */ jsx98(
21119
+ snapshot.tools.length === 0 ? /* @__PURE__ */ jsx99(Box76, { marginTop: 1, children: /* @__PURE__ */ jsx99(Text71, { color: theme.text.secondary, children: "No tools are visible to the current Agent." }) }) : /* @__PURE__ */ jsxs73(Box76, { flexDirection: "row", marginTop: 1, children: [
21120
+ /* @__PURE__ */ jsx99(Box76, { width: "55%", paddingRight: 2, flexDirection: "column", children: /* @__PURE__ */ jsx99(
21050
21121
  DescriptiveRadioButtonSelect,
21051
21122
  {
21052
21123
  items,
@@ -21057,26 +21128,26 @@ function ToolsDialog({
21057
21128
  maxItemsToShow: 10
21058
21129
  }
21059
21130
  ) }),
21060
- /* @__PURE__ */ jsx98(Box75, { width: "45%", paddingLeft: 2, flexDirection: "column", children: selected && /* @__PURE__ */ jsxs72(Fragment22, { children: [
21061
- /* @__PURE__ */ jsx98(Text70, { bold: true, color: theme.text.accent, children: selected.name }),
21062
- /* @__PURE__ */ jsx98(Box75, { marginTop: 1, children: /* @__PURE__ */ jsx98(Text70, { wrap: "wrap", children: selected.description }) }),
21063
- /* @__PURE__ */ jsxs72(Box75, { marginTop: 1, flexDirection: "column", children: [
21064
- /* @__PURE__ */ jsx98(Text70, { bold: true, color: theme.text.primary, children: "Parameters" }),
21065
- selected.parameters.length === 0 ? /* @__PURE__ */ jsx98(Text70, { color: theme.text.secondary, children: "None" }) : selected.parameters.map((parameter) => /* @__PURE__ */ jsxs72(Box75, { flexDirection: "column", children: [
21066
- /* @__PURE__ */ jsxs72(Text70, { color: theme.text.link, children: [
21131
+ /* @__PURE__ */ jsx99(Box76, { width: "45%", paddingLeft: 2, flexDirection: "column", children: selected && /* @__PURE__ */ jsxs73(Fragment24, { children: [
21132
+ /* @__PURE__ */ jsx99(Text71, { bold: true, color: theme.text.accent, children: selected.name }),
21133
+ /* @__PURE__ */ jsx99(Box76, { marginTop: 1, children: /* @__PURE__ */ jsx99(Text71, { wrap: "wrap", children: selected.description }) }),
21134
+ /* @__PURE__ */ jsxs73(Box76, { marginTop: 1, flexDirection: "column", children: [
21135
+ /* @__PURE__ */ jsx99(Text71, { bold: true, color: theme.text.primary, children: "Parameters" }),
21136
+ selected.parameters.length === 0 ? /* @__PURE__ */ jsx99(Text71, { color: theme.text.secondary, children: "None" }) : selected.parameters.map((parameter) => /* @__PURE__ */ jsxs73(Box76, { flexDirection: "column", children: [
21137
+ /* @__PURE__ */ jsxs73(Text71, { color: theme.text.link, children: [
21067
21138
  parameter.name,
21068
21139
  " ",
21069
- /* @__PURE__ */ jsxs72(Text70, { color: theme.text.secondary, children: [
21140
+ /* @__PURE__ */ jsxs73(Text71, { color: theme.text.secondary, children: [
21070
21141
  parameter.type,
21071
21142
  parameter.required ? " required" : " optional"
21072
21143
  ] })
21073
21144
  ] }),
21074
- parameter.description && /* @__PURE__ */ jsx98(Text70, { color: theme.text.secondary, children: parameter.description })
21145
+ parameter.description && /* @__PURE__ */ jsx99(Text71, { color: theme.text.secondary, children: parameter.description })
21075
21146
  ] }, parameter.name))
21076
21147
  ] })
21077
21148
  ] }) })
21078
21149
  ] }),
21079
- snapshot.tools.length > 0 && /* @__PURE__ */ jsx98(Box75, { marginTop: 1, children: /* @__PURE__ */ jsx98(Text70, { color: theme.text.secondary, children: "Use Up/Down to inspect the current Agent's tool catalog." }) })
21150
+ snapshot.tools.length > 0 && /* @__PURE__ */ jsx99(Box76, { marginTop: 1, children: /* @__PURE__ */ jsx99(Text71, { color: theme.text.secondary, children: "Use Up/Down to inspect the current Agent's tool catalog." }) })
21080
21151
  ]
21081
21152
  }
21082
21153
  );
@@ -21119,8 +21190,8 @@ import React23 from "react";
21119
21190
 
21120
21191
  // src/ui/components/dialogs/permission-dialog.tsx
21121
21192
  import { useCallback as useCallback38, useMemo as useMemo36, useState as useState42, useSyncExternalStore as useSyncExternalStore4 } from "react";
21122
- import { Box as Box76, Text as Text71 } from "ink";
21123
- import { Fragment as Fragment23, jsx as jsx99, jsxs as jsxs73 } from "react/jsx-runtime";
21193
+ import { Box as Box77, Text as Text72 } from "ink";
21194
+ import { Fragment as Fragment25, jsx as jsx100, jsxs as jsxs74 } from "react/jsx-runtime";
21124
21195
  function PermissionDialog({
21125
21196
  runtime,
21126
21197
  onClose,
@@ -21187,8 +21258,8 @@ function PermissionDialog({
21187
21258
  },
21188
21259
  { isActive: true }
21189
21260
  );
21190
- return /* @__PURE__ */ jsxs73(
21191
- Box76,
21261
+ return /* @__PURE__ */ jsxs74(
21262
+ Box77,
21192
21263
  {
21193
21264
  borderStyle: "round",
21194
21265
  borderColor: theme.border.default,
@@ -21197,9 +21268,9 @@ function PermissionDialog({
21197
21268
  paddingY: 1,
21198
21269
  width: "100%",
21199
21270
  children: [
21200
- /* @__PURE__ */ jsxs73(Box76, { justifyContent: "space-between", children: [
21201
- /* @__PURE__ */ jsx99(Text71, { bold: true, color: theme.text.primary, children: "Select DSH Permission" }),
21202
- /* @__PURE__ */ jsx99(
21271
+ /* @__PURE__ */ jsxs74(Box77, { justifyContent: "space-between", children: [
21272
+ /* @__PURE__ */ jsx100(Text72, { bold: true, color: theme.text.primary, children: "Select DSH Permission" }),
21273
+ /* @__PURE__ */ jsx100(
21203
21274
  DialogCloseAction,
21204
21275
  {
21205
21276
  onClose: dismiss,
@@ -21208,9 +21279,9 @@ function PermissionDialog({
21208
21279
  }
21209
21280
  )
21210
21281
  ] }),
21211
- error && /* @__PURE__ */ jsx99(Box76, { marginTop: 1, children: /* @__PURE__ */ jsx99(Text71, { color: theme.status.error, children: error }) }),
21212
- !snapshot.available ? /* @__PURE__ */ jsx99(Box76, { marginTop: 1, children: /* @__PURE__ */ jsx99(Text71, { color: theme.status.warning, children: "DSH permission presets are unavailable." }) }) : snapshot.options.length === 0 ? /* @__PURE__ */ jsx99(Box76, { marginTop: 1, children: /* @__PURE__ */ jsx99(Text71, { color: theme.status.warning, children: "No permission presets are available." }) }) : /* @__PURE__ */ jsxs73(Box76, { flexDirection: "row", marginTop: 1, children: [
21213
- /* @__PURE__ */ jsx99(Box76, { width: "50%", paddingRight: 2, flexDirection: "column", children: /* @__PURE__ */ jsx99(
21282
+ error && /* @__PURE__ */ jsx100(Box77, { marginTop: 1, children: /* @__PURE__ */ jsx100(Text72, { color: theme.status.error, children: error }) }),
21283
+ !snapshot.available ? /* @__PURE__ */ jsx100(Box77, { marginTop: 1, children: /* @__PURE__ */ jsx100(Text72, { color: theme.status.warning, children: "DSH permission presets are unavailable." }) }) : snapshot.options.length === 0 ? /* @__PURE__ */ jsx100(Box77, { marginTop: 1, children: /* @__PURE__ */ jsx100(Text72, { color: theme.status.warning, children: "No permission presets are available." }) }) : /* @__PURE__ */ jsxs74(Box77, { flexDirection: "row", marginTop: 1, children: [
21284
+ /* @__PURE__ */ jsx100(Box77, { width: "50%", paddingRight: 2, flexDirection: "column", children: /* @__PURE__ */ jsx100(
21214
21285
  RadioButtonSelect,
21215
21286
  {
21216
21287
  items,
@@ -21219,17 +21290,17 @@ function PermissionDialog({
21219
21290
  onSelect: selectPermission,
21220
21291
  isFocused: !pending && !snapshot.busy,
21221
21292
  showNumbers: false,
21222
- renderItem: (item, { titleColor }) => /* @__PURE__ */ jsxs73(Text71, { color: titleColor, wrap: "truncate", children: [
21293
+ renderItem: (item, { titleColor }) => /* @__PURE__ */ jsxs74(Text72, { color: titleColor, wrap: "truncate", children: [
21223
21294
  item.value.name,
21224
- item.value.value === snapshot.currentValue && /* @__PURE__ */ jsx99(Text71, { color: theme.text.accent, children: " Current" })
21295
+ item.value.value === snapshot.currentValue && /* @__PURE__ */ jsx100(Text72, { color: theme.text.accent, children: " Current" })
21225
21296
  ] })
21226
21297
  },
21227
21298
  items.map((item) => item.key).join("|")
21228
21299
  ) }),
21229
- /* @__PURE__ */ jsx99(Box76, { width: "50%", paddingLeft: 2, flexDirection: "column", children: pending ? /* @__PURE__ */ jsxs73(Fragment23, { children: [
21230
- /* @__PURE__ */ jsx99(Text71, { bold: true, color: theme.status.warning, children: "Enable Full access?" }),
21231
- /* @__PURE__ */ jsx99(Box76, { marginTop: 1, children: /* @__PURE__ */ jsx99(Text71, { children: "This allows commands to run without workspace sandbox restrictions or approval prompts." }) }),
21232
- /* @__PURE__ */ jsx99(Box76, { marginTop: 1, children: /* @__PURE__ */ jsx99(
21300
+ /* @__PURE__ */ jsx100(Box77, { width: "50%", paddingLeft: 2, flexDirection: "column", children: pending ? /* @__PURE__ */ jsxs74(Fragment25, { children: [
21301
+ /* @__PURE__ */ jsx100(Text72, { bold: true, color: theme.status.warning, children: "Enable Full access?" }),
21302
+ /* @__PURE__ */ jsx100(Box77, { marginTop: 1, children: /* @__PURE__ */ jsx100(Text72, { children: "This allows commands to run without workspace sandbox restrictions or approval prompts." }) }),
21303
+ /* @__PURE__ */ jsx100(Box77, { marginTop: 1, children: /* @__PURE__ */ jsx100(
21233
21304
  RadioButtonSelect,
21234
21305
  {
21235
21306
  items: [
@@ -21248,14 +21319,14 @@ function PermissionDialog({
21248
21319
  showNumbers: false
21249
21320
  }
21250
21321
  ) })
21251
- ] }) : selected ? /* @__PURE__ */ jsxs73(Fragment23, { children: [
21252
- /* @__PURE__ */ jsx99(Text71, { bold: true, color: theme.text.primary, children: selected.name }),
21253
- /* @__PURE__ */ jsx99(Text71, { color: theme.text.secondary, children: selected.value }),
21254
- /* @__PURE__ */ jsx99(Box76, { marginTop: 1, children: /* @__PURE__ */ jsx99(Text71, { children: selected.description ?? "No description is available for this preset." }) }),
21255
- snapshot.busy && /* @__PURE__ */ jsx99(Box76, { marginTop: 1, children: /* @__PURE__ */ jsx99(Text71, { color: theme.text.accent, children: "Applying permission..." }) })
21322
+ ] }) : selected ? /* @__PURE__ */ jsxs74(Fragment25, { children: [
21323
+ /* @__PURE__ */ jsx100(Text72, { bold: true, color: theme.text.primary, children: selected.name }),
21324
+ /* @__PURE__ */ jsx100(Text72, { color: theme.text.secondary, children: selected.value }),
21325
+ /* @__PURE__ */ jsx100(Box77, { marginTop: 1, children: /* @__PURE__ */ jsx100(Text72, { children: selected.description ?? "No description is available for this preset." }) }),
21326
+ snapshot.busy && /* @__PURE__ */ jsx100(Box77, { marginTop: 1, children: /* @__PURE__ */ jsx100(Text72, { color: theme.text.accent, children: "Applying permission..." }) })
21256
21327
  ] }) : null })
21257
21328
  ] }),
21258
- /* @__PURE__ */ jsx99(Box76, { marginTop: 1, children: /* @__PURE__ */ jsx99(Text71, { color: theme.text.secondary, children: "Changes apply to the current DSH Session immediately. No restart required." }) })
21329
+ /* @__PURE__ */ jsx100(Box77, { marginTop: 1, children: /* @__PURE__ */ jsx100(Text72, { color: theme.text.secondary, children: "Changes apply to the current DSH Session immediately. No restart required." }) })
21259
21330
  ]
21260
21331
  }
21261
21332
  );
@@ -21417,7 +21488,7 @@ import {
21417
21488
  useState as useState43,
21418
21489
  useSyncExternalStore as useSyncExternalStore5
21419
21490
  } from "react";
21420
- import { Box as Box77, Text as Text72 } from "ink";
21491
+ import { Box as Box78, Text as Text73 } from "ink";
21421
21492
 
21422
21493
  // src/ui/conversation-history-projector.ts
21423
21494
  function projectedToolCallIds(messages) {
@@ -21497,7 +21568,7 @@ function conversationMessageFingerprint(message, item) {
21497
21568
  }
21498
21569
 
21499
21570
  // src/ui/components/dialogs/agents-dialog.tsx
21500
- import { Fragment as Fragment24, jsx as jsx100, jsxs as jsxs74 } from "react/jsx-runtime";
21571
+ import { Fragment as Fragment26, jsx as jsx101, jsxs as jsxs75 } from "react/jsx-runtime";
21501
21572
  function shortId2(id) {
21502
21573
  return id.slice(-8);
21503
21574
  }
@@ -21609,7 +21680,7 @@ function AgentsDialog({ runtime, onClose }) {
21609
21680
  const item = snapshot.items.find(
21610
21681
  (candidate) => candidate.id === transcriptSessionId
21611
21682
  );
21612
- return /* @__PURE__ */ jsx100(
21683
+ return /* @__PURE__ */ jsx101(
21613
21684
  AgentTranscriptView,
21614
21685
  {
21615
21686
  runtime: transcript,
@@ -21618,8 +21689,8 @@ function AgentsDialog({ runtime, onClose }) {
21618
21689
  }
21619
21690
  );
21620
21691
  }
21621
- return /* @__PURE__ */ jsxs74(
21622
- Box77,
21692
+ return /* @__PURE__ */ jsxs75(
21693
+ Box78,
21623
21694
  {
21624
21695
  borderStyle: "round",
21625
21696
  borderColor: theme.border.default,
@@ -21628,16 +21699,16 @@ function AgentsDialog({ runtime, onClose }) {
21628
21699
  paddingY: 1,
21629
21700
  width: "100%",
21630
21701
  children: [
21631
- /* @__PURE__ */ jsxs74(Box77, { justifyContent: "space-between", children: [
21632
- /* @__PURE__ */ jsxs74(Text72, { bold: true, color: theme.text.primary, children: [
21702
+ /* @__PURE__ */ jsxs75(Box78, { justifyContent: "space-between", children: [
21703
+ /* @__PURE__ */ jsxs75(Text73, { bold: true, color: theme.text.primary, children: [
21633
21704
  "DSH Agents (",
21634
21705
  snapshot.items.length,
21635
21706
  ")"
21636
21707
  ] }),
21637
- /* @__PURE__ */ jsx100(Text72, { color: theme.text.secondary, children: "R refresh \xB7 Esc close" })
21708
+ /* @__PURE__ */ jsx101(Text73, { color: theme.text.secondary, children: "R refresh \xB7 Esc close" })
21638
21709
  ] }),
21639
- snapshot.status === "loading" && snapshot.items.length === 0 ? /* @__PURE__ */ jsx100(Box77, { marginTop: 1, children: /* @__PURE__ */ jsx100(Text72, { color: theme.text.secondary, children: "Loading delegated Agents..." }) }) : snapshot.status === "error" && snapshot.items.length === 0 ? /* @__PURE__ */ jsx100(Box77, { marginTop: 1, children: /* @__PURE__ */ jsx100(Text72, { color: theme.status.error, children: snapshot.error }) }) : snapshot.items.length === 0 ? /* @__PURE__ */ jsx100(Box77, { marginTop: 1, children: /* @__PURE__ */ jsx100(Text72, { color: theme.text.secondary, children: "The Main Agent has not delegated any subagents in this Session." }) }) : /* @__PURE__ */ jsxs74(Box77, { flexDirection: "row", marginTop: 1, children: [
21640
- /* @__PURE__ */ jsx100(Box77, { width: "55%", paddingRight: 2, flexDirection: "column", children: /* @__PURE__ */ jsx100(
21710
+ snapshot.status === "loading" && snapshot.items.length === 0 ? /* @__PURE__ */ jsx101(Box78, { marginTop: 1, children: /* @__PURE__ */ jsx101(Text73, { color: theme.text.secondary, children: "Loading delegated Agents..." }) }) : snapshot.status === "error" && snapshot.items.length === 0 ? /* @__PURE__ */ jsx101(Box78, { marginTop: 1, children: /* @__PURE__ */ jsx101(Text73, { color: theme.status.error, children: snapshot.error }) }) : snapshot.items.length === 0 ? /* @__PURE__ */ jsx101(Box78, { marginTop: 1, children: /* @__PURE__ */ jsx101(Text73, { color: theme.text.secondary, children: "The Main Agent has not delegated any subagents in this Session." }) }) : /* @__PURE__ */ jsxs75(Box78, { flexDirection: "row", marginTop: 1, children: [
21711
+ /* @__PURE__ */ jsx101(Box78, { width: "55%", paddingRight: 2, flexDirection: "column", children: /* @__PURE__ */ jsx101(
21641
21712
  DescriptiveRadioButtonSelect,
21642
21713
  {
21643
21714
  items,
@@ -21648,49 +21719,49 @@ function AgentsDialog({ runtime, onClose }) {
21648
21719
  maxItemsToShow: 10
21649
21720
  }
21650
21721
  ) }),
21651
- /* @__PURE__ */ jsx100(Box77, { width: "45%", paddingLeft: 2, flexDirection: "column", children: selected?.kind === "agent" ? /* @__PURE__ */ jsxs74(Fragment24, { children: [
21652
- /* @__PURE__ */ jsx100(Text72, { bold: true, color: theme.text.accent, children: selected.label }),
21653
- /* @__PURE__ */ jsxs74(Box77, { marginTop: 1, flexDirection: "column", children: [
21654
- /* @__PURE__ */ jsxs74(Text72, { color: theme.text.secondary, children: [
21722
+ /* @__PURE__ */ jsx101(Box78, { width: "45%", paddingLeft: 2, flexDirection: "column", children: selected?.kind === "agent" ? /* @__PURE__ */ jsxs75(Fragment26, { children: [
21723
+ /* @__PURE__ */ jsx101(Text73, { bold: true, color: theme.text.accent, children: selected.label }),
21724
+ /* @__PURE__ */ jsxs75(Box78, { marginTop: 1, flexDirection: "column", children: [
21725
+ /* @__PURE__ */ jsxs75(Text73, { color: theme.text.secondary, children: [
21655
21726
  "Status",
21656
21727
  " ",
21657
- /* @__PURE__ */ jsx100(
21658
- Text72,
21728
+ /* @__PURE__ */ jsx101(
21729
+ Text73,
21659
21730
  {
21660
21731
  color: selected.activity === "running" ? theme.status.success : theme.text.primary,
21661
21732
  children: selected.activity
21662
21733
  }
21663
21734
  )
21664
21735
  ] }),
21665
- /* @__PURE__ */ jsxs74(Text72, { color: theme.text.secondary, children: [
21736
+ /* @__PURE__ */ jsxs75(Text73, { color: theme.text.secondary, children: [
21666
21737
  "Mode ",
21667
- /* @__PURE__ */ jsx100(Text72, { color: theme.text.primary, children: selected.mode })
21738
+ /* @__PURE__ */ jsx101(Text73, { color: theme.text.primary, children: selected.mode })
21668
21739
  ] }),
21669
- /* @__PURE__ */ jsxs74(Text72, { color: theme.text.secondary, children: [
21740
+ /* @__PURE__ */ jsxs75(Text73, { color: theme.text.secondary, children: [
21670
21741
  "Depth ",
21671
- /* @__PURE__ */ jsx100(Text72, { color: theme.text.primary, children: selected.depth })
21742
+ /* @__PURE__ */ jsx101(Text73, { color: theme.text.primary, children: selected.depth })
21672
21743
  ] }),
21673
- /* @__PURE__ */ jsxs74(Text72, { color: theme.text.secondary, children: [
21744
+ /* @__PURE__ */ jsxs75(Text73, { color: theme.text.secondary, children: [
21674
21745
  "Session ",
21675
- /* @__PURE__ */ jsx100(Text72, { color: theme.text.primary, children: shortId2(selected.id) })
21746
+ /* @__PURE__ */ jsx101(Text73, { color: theme.text.primary, children: shortId2(selected.id) })
21676
21747
  ] })
21677
21748
  ] })
21678
- ] }) : selected ? /* @__PURE__ */ jsxs74(Fragment24, { children: [
21679
- /* @__PURE__ */ jsx100(Text72, { bold: true, color: theme.status.warning, children: "Unavailable Agent" }),
21680
- /* @__PURE__ */ jsxs74(Box77, { marginTop: 1, flexDirection: "column", children: [
21681
- /* @__PURE__ */ jsxs74(Text72, { color: theme.text.secondary, children: [
21749
+ ] }) : selected ? /* @__PURE__ */ jsxs75(Fragment26, { children: [
21750
+ /* @__PURE__ */ jsx101(Text73, { bold: true, color: theme.status.warning, children: "Unavailable Agent" }),
21751
+ /* @__PURE__ */ jsxs75(Box78, { marginTop: 1, flexDirection: "column", children: [
21752
+ /* @__PURE__ */ jsxs75(Text73, { color: theme.text.secondary, children: [
21682
21753
  "Reason ",
21683
- /* @__PURE__ */ jsx100(Text72, { color: theme.text.primary, children: selected.reason })
21754
+ /* @__PURE__ */ jsx101(Text73, { color: theme.text.primary, children: selected.reason })
21684
21755
  ] }),
21685
- /* @__PURE__ */ jsxs74(Text72, { color: theme.text.secondary, children: [
21756
+ /* @__PURE__ */ jsxs75(Text73, { color: theme.text.secondary, children: [
21686
21757
  "Session ",
21687
- /* @__PURE__ */ jsx100(Text72, { color: theme.text.primary, children: shortId2(selected.id) })
21758
+ /* @__PURE__ */ jsx101(Text73, { color: theme.text.primary, children: shortId2(selected.id) })
21688
21759
  ] })
21689
21760
  ] })
21690
21761
  ] }) : null })
21691
21762
  ] }),
21692
- (opening || openError !== void 0) && /* @__PURE__ */ jsx100(Box77, { marginTop: 1, children: /* @__PURE__ */ jsx100(Text72, { color: openError === void 0 ? theme.text.secondary : theme.status.error, children: openError ?? "Opening canonical Agent history..." }) }),
21693
- snapshot.items.length > 0 && /* @__PURE__ */ jsx100(Box77, { marginTop: 1, children: /* @__PURE__ */ jsx100(Text72, { color: theme.text.secondary, children: "Enter opens read-only history. Agent conversations remain DSH-owned." }) })
21763
+ (opening || openError !== void 0) && /* @__PURE__ */ jsx101(Box78, { marginTop: 1, children: /* @__PURE__ */ jsx101(Text73, { color: openError === void 0 ? theme.text.secondary : theme.status.error, children: openError ?? "Opening canonical Agent history..." }) }),
21764
+ snapshot.items.length > 0 && /* @__PURE__ */ jsx101(Box78, { marginTop: 1, children: /* @__PURE__ */ jsx101(Text73, { color: theme.text.secondary, children: "Enter opens read-only history. Agent conversations remain DSH-owned." }) })
21694
21765
  ]
21695
21766
  }
21696
21767
  );
@@ -21721,8 +21792,8 @@ function AgentTranscriptView({
21721
21792
  const width = Math.max(40, uiState.terminalWidth - 4);
21722
21793
  const height = Math.max(8, uiState.terminalHeight - 6);
21723
21794
  const label = item?.kind === "agent" ? item.label : shortId2(item?.id ?? "agent");
21724
- return /* @__PURE__ */ jsxs74(
21725
- Box77,
21795
+ return /* @__PURE__ */ jsxs75(
21796
+ Box78,
21726
21797
  {
21727
21798
  borderStyle: "round",
21728
21799
  borderColor: theme.border.default,
@@ -21731,28 +21802,28 @@ function AgentTranscriptView({
21731
21802
  height,
21732
21803
  width: "100%",
21733
21804
  children: [
21734
- /* @__PURE__ */ jsxs74(Box77, { justifyContent: "space-between", children: [
21735
- /* @__PURE__ */ jsxs74(Box77, { children: [
21736
- /* @__PURE__ */ jsx100(Text72, { bold: true, color: theme.text.primary, children: label }),
21737
- item?.kind === "agent" && /* @__PURE__ */ jsxs74(Text72, { color: theme.text.secondary, children: [
21805
+ /* @__PURE__ */ jsxs75(Box78, { justifyContent: "space-between", children: [
21806
+ /* @__PURE__ */ jsxs75(Box78, { children: [
21807
+ /* @__PURE__ */ jsx101(Text73, { bold: true, color: theme.text.primary, children: label }),
21808
+ item?.kind === "agent" && /* @__PURE__ */ jsxs75(Text73, { color: theme.text.secondary, children: [
21738
21809
  " ",
21739
21810
  "\xB7 ",
21740
21811
  item.mode,
21741
21812
  " \xB7",
21742
21813
  " ",
21743
- /* @__PURE__ */ jsx100(Text72, { color: item.activity === "running" ? theme.status.success : theme.text.secondary, children: item.activity })
21814
+ /* @__PURE__ */ jsx101(Text73, { color: item.activity === "running" ? theme.status.success : theme.text.secondary, children: item.activity })
21744
21815
  ] })
21745
21816
  ] }),
21746
- /* @__PURE__ */ jsx100(Text72, { color: theme.text.secondary, children: "Read only \xB7 Esc back" })
21817
+ /* @__PURE__ */ jsx101(Text73, { color: theme.text.secondary, children: "Read only \xB7 Esc back" })
21747
21818
  ] }),
21748
- snapshot.todos.length > 0 && /* @__PURE__ */ jsx100(Box77, { marginTop: 1, children: /* @__PURE__ */ jsxs74(Text72, { color: theme.text.secondary, children: [
21819
+ snapshot.todos.length > 0 && /* @__PURE__ */ jsx101(Box78, { marginTop: 1, children: /* @__PURE__ */ jsxs75(Text73, { color: theme.text.secondary, children: [
21749
21820
  "Todo ",
21750
21821
  completed,
21751
21822
  "/",
21752
21823
  snapshot.todos.length,
21753
21824
  " completed"
21754
21825
  ] }) }),
21755
- /* @__PURE__ */ jsx100(Box77, { flexGrow: 1, marginTop: 1, overflow: "hidden", children: history.length === 0 ? /* @__PURE__ */ jsx100(Text72, { color: theme.text.secondary, children: "This Agent has no conversation events yet." }) : /* @__PURE__ */ jsx100(
21826
+ /* @__PURE__ */ jsx101(Box78, { flexGrow: 1, marginTop: 1, overflow: "hidden", children: history.length === 0 ? /* @__PURE__ */ jsx101(Text73, { color: theme.text.secondary, children: "This Agent has no conversation events yet." }) : /* @__PURE__ */ jsx101(
21756
21827
  ScrollableListWithForwardRef,
21757
21828
  {
21758
21829
  ref: listRef,
@@ -21762,7 +21833,7 @@ function AgentTranscriptView({
21762
21833
  keyExtractor: (entry) => entry.key,
21763
21834
  estimatedItemHeight: () => 3,
21764
21835
  initialScrollIndex: history.length - 1,
21765
- renderItem: ({ item: entry, index }) => /* @__PURE__ */ jsx100(
21836
+ renderItem: ({ item: entry, index }) => /* @__PURE__ */ jsx101(
21766
21837
  HistoryItemDisplay,
21767
21838
  {
21768
21839
  item: { ...entry.item, id: index },
@@ -23794,7 +23865,7 @@ ${output}`;
23794
23865
  }
23795
23866
 
23796
23867
  // src/ui/app-container.tsx
23797
- import { jsx as jsx101 } from "react/jsx-runtime";
23868
+ import { jsx as jsx102 } from "react/jsx-runtime";
23798
23869
  var SHELL_WIDTH_FRACTION = 0.89;
23799
23870
  var SHELL_HEIGHT_PADDING = 10;
23800
23871
  var noopExternalStoreSubscribe = () => () => {
@@ -23827,6 +23898,7 @@ var AppContainer = (props) => {
23827
23898
  userQuestionRuntime,
23828
23899
  commandRuntime,
23829
23900
  permissionSelectionRuntime,
23901
+ interactionModeRuntime,
23830
23902
  toolCatalogRuntime,
23831
23903
  sideConversationRuntime,
23832
23904
  subagentCatalogRuntime
@@ -23859,6 +23931,11 @@ var AppContainer = (props) => {
23859
23931
  userQuestionRuntime.getSnapshot
23860
23932
  );
23861
23933
  const pendingUserQuestion = userQuestionSnapshot.pending[0];
23934
+ const interactionModeSnapshot = useSyncExternalStore6(
23935
+ interactionModeRuntime.subscribe,
23936
+ interactionModeRuntime.getSnapshot,
23937
+ interactionModeRuntime.getSnapshot
23938
+ );
23862
23939
  const conversationHistoryIds = useRef34(/* @__PURE__ */ new Map());
23863
23940
  const conversationHistoryTexts = useRef34(/* @__PURE__ */ new Map());
23864
23941
  const conversationSessionId = conversationRuntime.getSessionStats().sessionId;
@@ -23940,6 +24017,14 @@ var AppContainer = (props) => {
23940
24017
  () => setShowDebugProfiler((visible) => !visible),
23941
24018
  []
23942
24019
  );
24020
+ const togglePlanMode = useCallback50(
24021
+ (active) => {
24022
+ void interactionModeRuntime.togglePlan(void 0, active).catch((error) => {
24023
+ setQueueErrorMessage(getErrorMessage(error));
24024
+ });
24025
+ },
24026
+ [interactionModeRuntime]
24027
+ );
23943
24028
  const [modelSelectionSnapshot, setModelSelectionSnapshot] = useState56(
23944
24029
  () => modelSelectionRuntime?.getSnapshot()
23945
24030
  );
@@ -24353,7 +24438,7 @@ ${queuedText}` : queuedText;
24353
24438
  return;
24354
24439
  }
24355
24440
  setCustomDialog(
24356
- /* @__PURE__ */ jsx101(
24441
+ /* @__PURE__ */ jsx102(
24357
24442
  ProviderSetupDialog,
24358
24443
  {
24359
24444
  runtime: providerSetupRuntime,
@@ -24767,6 +24852,7 @@ ${queuedText}` : queuedText;
24767
24852
  queueErrorMessage,
24768
24853
  currentModel,
24769
24854
  currentReasoningEffort,
24855
+ interactionMode: interactionModeSnapshot,
24770
24856
  errorCount,
24771
24857
  availableTerminalHeight,
24772
24858
  mainAreaWidth,
@@ -24843,6 +24929,7 @@ ${queuedText}` : queuedText;
24843
24929
  rootUiRef,
24844
24930
  currentModel,
24845
24931
  currentReasoningEffort,
24932
+ interactionModeSnapshot,
24846
24933
  activePtyId,
24847
24934
  historyManager,
24848
24935
  embeddedShellFocused,
@@ -24872,6 +24959,7 @@ ${queuedText}` : queuedText;
24872
24959
  handleFinalSubmit,
24873
24960
  handleClearScreen,
24874
24961
  setQueueErrorMessage,
24962
+ togglePlanMode,
24875
24963
  popAllMessages,
24876
24964
  setEmbeddedShellFocused,
24877
24965
  handleRestart: async () => {
@@ -24894,18 +24982,19 @@ ${queuedText}` : queuedText;
24894
24982
  handleFinalSubmit,
24895
24983
  handleClearScreen,
24896
24984
  setQueueErrorMessage,
24985
+ togglePlanMode,
24897
24986
  popAllMessages,
24898
24987
  setEmbeddedShellFocused
24899
24988
  ]
24900
24989
  );
24901
- return /* @__PURE__ */ jsx101(UIStateContext.Provider, { value: uiState, children: /* @__PURE__ */ jsx101(UIActionsContext.Provider, { value: uiActions, children: /* @__PURE__ */ jsx101(ConfigContext.Provider, { value: config, children: /* @__PURE__ */ jsx101(
24990
+ return /* @__PURE__ */ jsx102(UIStateContext.Provider, { value: uiState, children: /* @__PURE__ */ jsx102(UIActionsContext.Provider, { value: uiActions, children: /* @__PURE__ */ jsx102(ConfigContext.Provider, { value: config, children: /* @__PURE__ */ jsx102(
24902
24991
  AppContext.Provider,
24903
24992
  {
24904
24993
  value: {
24905
24994
  version: props.version,
24906
24995
  startupWarnings: props.startupWarnings || []
24907
24996
  },
24908
- children: /* @__PURE__ */ jsx101(ApprovalRuntimeProvider, { runtime: approvalRuntime, children: /* @__PURE__ */ jsx101(UserQuestionRuntimeProvider, { runtime: userQuestionRuntime, children: /* @__PURE__ */ jsx101(ShellFocusContext.Provider, { value: isFocused, children: /* @__PURE__ */ jsx101(App, {}) }) }) })
24997
+ children: /* @__PURE__ */ jsx102(ApprovalRuntimeProvider, { runtime: approvalRuntime, children: /* @__PURE__ */ jsx102(UserQuestionRuntimeProvider, { runtime: userQuestionRuntime, children: /* @__PURE__ */ jsx102(ShellFocusContext.Provider, { value: isFocused, children: /* @__PURE__ */ jsx102(App, {}) }) }) })
24909
24998
  }
24910
24999
  ) }) }) });
24911
25000
  };
@@ -24913,7 +25002,7 @@ ${queuedText}` : queuedText;
24913
25002
  // src/ui/root.tsx
24914
25003
  import React25 from "react";
24915
25004
  import { render } from "ink";
24916
- import { jsx as jsx102 } from "react/jsx-runtime";
25005
+ import { jsx as jsx103 } from "react/jsx-runtime";
24917
25006
  var SLOW_RENDER_MS = 200;
24918
25007
  function validateDnsResolutionOrder(order) {
24919
25008
  const defaultValue = "ipv4first";
@@ -24945,7 +25034,7 @@ ${reason.stack}` : ""}`;
24945
25034
  }
24946
25035
  });
24947
25036
  }
24948
- async function startInteractiveUI(config, settings, startupWarnings, workspaceRoot = process.cwd(), initializationResult, conversationRuntime, approvalRuntime, userQuestionRuntime, commandRuntime, permissionSelectionRuntime, toolCatalogRuntime, promptCompletionRuntime, promptInputRuntime, modelSelectionRuntime, sessionManagementRuntime, initialPrompt, providerSetupRuntime, sideConversationRuntime, subagentCatalogRuntime) {
25037
+ async function startInteractiveUI(config, settings, startupWarnings, workspaceRoot = process.cwd(), initializationResult, conversationRuntime, approvalRuntime, userQuestionRuntime, commandRuntime, permissionSelectionRuntime, interactionModeRuntime, toolCatalogRuntime, promptCompletionRuntime, promptInputRuntime, modelSelectionRuntime, sessionManagementRuntime, initialPrompt, providerSetupRuntime, sideConversationRuntime, subagentCatalogRuntime) {
24949
25038
  const useAlternateBuffer2 = shouldEnterAlternateScreen(
24950
25039
  isAlternateBufferEnabled(settings),
24951
25040
  config.getScreenReader()
@@ -24955,17 +25044,17 @@ async function startInteractiveUI(config, settings, startupWarnings, workspaceRo
24955
25044
  const version = await getVersion();
24956
25045
  const AppWrapper = () => {
24957
25046
  useKittyKeyboardProtocol();
24958
- return /* @__PURE__ */ jsx102(SettingsContext.Provider, { value: settings, children: /* @__PURE__ */ jsx102(
25047
+ return /* @__PURE__ */ jsx103(SettingsContext.Provider, { value: settings, children: /* @__PURE__ */ jsx103(
24959
25048
  KeypressProvider,
24960
25049
  {
24961
25050
  config,
24962
25051
  debugKeystrokeLogging: settings.merged.general.debugKeystrokeLogging,
24963
- children: /* @__PURE__ */ jsx102(
25052
+ children: /* @__PURE__ */ jsx103(
24964
25053
  MouseProvider,
24965
25054
  {
24966
25055
  mouseEventsEnabled,
24967
25056
  debugKeystrokeLogging: settings.merged.general.debugKeystrokeLogging,
24968
- children: /* @__PURE__ */ jsx102(ScrollProvider, { children: /* @__PURE__ */ jsx102(SessionStatsProvider, { conversationRuntime, children: /* @__PURE__ */ jsx102(VimModeProvider, { settings, children: /* @__PURE__ */ jsx102(
25057
+ children: /* @__PURE__ */ jsx103(ScrollProvider, { children: /* @__PURE__ */ jsx103(SessionStatsProvider, { conversationRuntime, children: /* @__PURE__ */ jsx103(VimModeProvider, { settings, children: /* @__PURE__ */ jsx103(
24969
25058
  AppContainer,
24970
25059
  {
24971
25060
  config,
@@ -24982,6 +25071,7 @@ async function startInteractiveUI(config, settings, startupWarnings, workspaceRo
24982
25071
  userQuestionRuntime,
24983
25072
  commandRuntime,
24984
25073
  permissionSelectionRuntime,
25074
+ interactionModeRuntime,
24985
25075
  toolCatalogRuntime,
24986
25076
  sideConversationRuntime,
24987
25077
  subagentCatalogRuntime,
@@ -24995,7 +25085,7 @@ async function startInteractiveUI(config, settings, startupWarnings, workspaceRo
24995
25085
  };
24996
25086
  const { stdout: inkStdout, stderr: inkStderr } = createWorkingStdio();
24997
25087
  const instance = render(
24998
- process.env["DEBUG"] ? /* @__PURE__ */ jsx102(React25.StrictMode, { children: /* @__PURE__ */ jsx102(AppWrapper, {}) }) : /* @__PURE__ */ jsx102(AppWrapper, {}),
25088
+ process.env["DEBUG"] ? /* @__PURE__ */ jsx103(React25.StrictMode, { children: /* @__PURE__ */ jsx103(AppWrapper, {}) }) : /* @__PURE__ */ jsx103(AppWrapper, {}),
24999
25089
  {
25000
25090
  stdout: inkStdout,
25001
25091
  stderr: inkStderr,
@@ -25096,6 +25186,7 @@ async function main(options) {
25096
25186
  options.userQuestionRuntime,
25097
25187
  options.commandRuntime,
25098
25188
  options.permissionSelectionRuntime,
25189
+ options.interactionModeRuntime,
25099
25190
  options.toolCatalogRuntime,
25100
25191
  options.promptCompletionRuntime,
25101
25192
  options.promptInputRuntime,
@@ -25196,6 +25287,31 @@ function projectDshContent(content) {
25196
25287
  return content.map(projectDshContentBlock);
25197
25288
  }
25198
25289
 
25290
+ // src/dsh/assistant-stream.ts
25291
+ function isFirstTokenChunk(chunk) {
25292
+ return chunk.type === "text-delta" && chunk.text !== "" || chunk.type === "reasoning-delta" && chunk.text !== "" || chunk.type === "tool-call-delta" && (chunk.argumentsDelta !== "" || chunk.name !== void 0);
25293
+ }
25294
+ function assistantStreamFirstTokenTime(event) {
25295
+ for (const record of event.data.stream) {
25296
+ if (record.type === "chunk") {
25297
+ if (isFirstTokenChunk(record.chunk)) return record.time;
25298
+ continue;
25299
+ }
25300
+ const members = record.type === "tool-call-chunks" ? record.args : record.texts;
25301
+ let time = record.time0;
25302
+ for (let index = 0; index < members.length; index += 1) {
25303
+ if (index > 0) time += record.dt[index - 1] ?? 0;
25304
+ if (members[index] !== "" || record.type === "tool-call-chunks" && record.name !== void 0) {
25305
+ return time;
25306
+ }
25307
+ }
25308
+ }
25309
+ return void 0;
25310
+ }
25311
+ function subscribeToAssistantStream(agent, listener) {
25312
+ return agent.ctx.on("agent/assistant-stream", ({ frame }) => listener(frame));
25313
+ }
25314
+
25199
25315
  // src/dsh/session-timing-projector.ts
25200
25316
  function eventTime(event) {
25201
25317
  const value = event.time;
@@ -25232,18 +25348,20 @@ var SessionTimingProjector = class {
25232
25348
  }
25233
25349
  return void 0;
25234
25350
  }
25235
- if (event.type === "assistant/chunk") {
25236
- const { chunk } = event.data;
25237
- const isFirstToken = chunk.type === "text-delta" && chunk.text !== "" || chunk.type === "reasoning-delta" && chunk.text !== "" || chunk.type === "tool-call-delta" && (chunk.argumentsDelta !== "" || chunk.name !== void 0);
25238
- if (!isFirstToken) return void 0;
25239
- const step = this.turns.get(event.data.turn)?.steps.get(event.data.step);
25240
- if (step !== void 0 && step.firstTokenAt === void 0) {
25241
- step.firstTokenAt = at;
25351
+ if (event.type === "assistant/attempt") {
25352
+ const { turn, step } = event.data;
25353
+ const embeddedFirstTokenAt = assistantStreamFirstTokenTime(event);
25354
+ if (embeddedFirstTokenAt !== void 0) {
25355
+ this.markFirstToken(turn, step, embeddedFirstTokenAt);
25242
25356
  }
25243
25357
  return void 0;
25244
25358
  }
25245
25359
  if (event.type === "assistant/message") {
25246
25360
  const { turn, step } = event.data;
25361
+ const embeddedFirstTokenAt = assistantStreamFirstTokenTime(event);
25362
+ if (embeddedFirstTokenAt !== void 0) {
25363
+ this.markFirstToken(turn, step, embeddedFirstTokenAt);
25364
+ }
25247
25365
  const timing2 = this.turns.get(turn);
25248
25366
  const stepTiming = timing2?.steps.get(step);
25249
25367
  if (timing2 === void 0 || stepTiming === void 0 || stepTiming.completed) {
@@ -25321,6 +25439,15 @@ var SessionTimingProjector = class {
25321
25439
  }
25322
25440
  };
25323
25441
  }
25442
+ projectAssistantChunk(turn, step, chunk, at) {
25443
+ if (isFirstTokenChunk(chunk)) this.markFirstToken(turn, step, at);
25444
+ }
25445
+ markFirstToken(turn, step, at) {
25446
+ const timing = this.turns.get(turn)?.steps.get(step);
25447
+ if (timing !== void 0 && timing.firstTokenAt === void 0) {
25448
+ timing.firstTokenAt = at;
25449
+ }
25450
+ }
25324
25451
  };
25325
25452
 
25326
25453
  // src/dsh/projector.ts
@@ -25348,6 +25475,9 @@ var DshSessionProjector = class {
25348
25475
  cancelledTurns = /* @__PURE__ */ new Set();
25349
25476
  pendingUserIds = [];
25350
25477
  assistantStreams = /* @__PURE__ */ new Map();
25478
+ assistantAttempts = /* @__PURE__ */ new Map();
25479
+ activeAssistantAttempts = /* @__PURE__ */ new Map();
25480
+ liveUsageSteps = /* @__PURE__ */ new Set();
25351
25481
  accountedUsages = /* @__PURE__ */ new Set();
25352
25482
  metrics = createInitialSessionMetrics();
25353
25483
  timingProjector = new SessionTimingProjector();
@@ -25368,10 +25498,6 @@ var DshSessionProjector = class {
25368
25498
  replay(events) {
25369
25499
  const currentSurface = new Set(foldSurface(events).nodes);
25370
25500
  for (const event of events) {
25371
- if (event.type === "assistant/chunk") {
25372
- this.timingProjector.project(event);
25373
- continue;
25374
- }
25375
25501
  if (isSurfaceEvent(event) && !currentSurface.has(event.seq)) continue;
25376
25502
  this.project(event);
25377
25503
  }
@@ -25443,31 +25569,16 @@ var DshSessionProjector = class {
25443
25569
  }
25444
25570
  return;
25445
25571
  }
25446
- if (event.type === "assistant/chunk" && (event.data.chunk.type === "text-delta" || event.data.chunk.type === "reasoning-delta")) {
25447
- if (this.cancelledTurns.has(event.data.turn)) return;
25448
- const chunk = event.data.chunk;
25449
- const id = this.assistantId(event.data.turn, event.data.step);
25450
- this.upsertAssistantDelta(
25451
- id,
25452
- chunk.index,
25453
- chunk.type === "text-delta" ? "text" : "reasoning",
25454
- chunk.text
25455
- );
25456
- return;
25457
- }
25458
- if (event.type === "assistant/chunk" && event.data.chunk.type === "usage") {
25459
- if (this.cancelledTurns.has(event.data.turn)) return;
25460
- this.accountUsage(
25461
- event.data.turn,
25462
- event.data.step,
25463
- event.data.chunk.usage
25464
- );
25465
- return;
25466
- }
25467
25572
  if (event.type === "assistant/message") {
25468
25573
  if (this.cancelledTurns.has(event.data.turn)) return;
25469
- if (event.data.usage !== void 0) {
25470
- this.accountUsage(event.data.turn, event.data.step, event.data.usage);
25574
+ const stepKey = this.stepKey(event.data.turn, event.data.step);
25575
+ if (event.data.usage !== void 0 && !this.liveUsageSteps.has(stepKey)) {
25576
+ this.accountUsage(
25577
+ stepKey,
25578
+ event.data.turn,
25579
+ event.data.step,
25580
+ event.data.usage
25581
+ );
25471
25582
  }
25472
25583
  const id = this.assistantId(event.data.turn, event.data.step);
25473
25584
  this.assistantStreams.delete(id);
@@ -25477,6 +25588,7 @@ var DshSessionProjector = class {
25477
25588
  });
25478
25589
  return;
25479
25590
  }
25591
+ if (event.type === "assistant/attempt") return;
25480
25592
  if (event.type === "tool/call") {
25481
25593
  if (this.cancelledTurns.has(event.data.turn)) return;
25482
25594
  const callId = String(event.data.callId);
@@ -25555,6 +25667,7 @@ var DshSessionProjector = class {
25555
25667
  if (event.type === "turn/end") {
25556
25668
  this.cancelledTurns.delete(event.data.turn);
25557
25669
  this.clearAssistantStreams(event.data.turn);
25670
+ this.clearAssistantAttempts(event.data.turn);
25558
25671
  this.pendingUserIds.length = 0;
25559
25672
  this.activeTurn = void 0;
25560
25673
  if (event.data.reason.kind === "error") {
@@ -25573,11 +25686,82 @@ var DshSessionProjector = class {
25573
25686
  this.update({ busy: false });
25574
25687
  }
25575
25688
  }
25689
+ projectAssistantStream(frame) {
25690
+ const attemptId = String(frame.attemptId);
25691
+ if (frame.type === "start") {
25692
+ const id2 = this.assistantId(frame.turn, frame.step);
25693
+ const previousAttemptId = this.activeAssistantAttempts.get(id2);
25694
+ if (previousAttemptId !== void 0) {
25695
+ this.assistantAttempts.delete(previousAttemptId);
25696
+ }
25697
+ this.discardAssistantStream(id2);
25698
+ this.liveUsageSteps.delete(this.stepKey(frame.turn, frame.step));
25699
+ this.assistantAttempts.set(attemptId, {
25700
+ revision: frame.revision,
25701
+ nextIndex: 0,
25702
+ turn: frame.turn,
25703
+ step: frame.step
25704
+ });
25705
+ this.activeAssistantAttempts.set(id2, attemptId);
25706
+ return;
25707
+ }
25708
+ const attempt = this.assistantAttempts.get(attemptId);
25709
+ if (attempt === void 0) return;
25710
+ const id = this.assistantId(attempt.turn, attempt.step);
25711
+ if (this.activeAssistantAttempts.get(id) !== attemptId || frame.revision !== attempt.revision + 1 || frame.index !== attempt.nextIndex) {
25712
+ return;
25713
+ }
25714
+ attempt.revision = frame.revision;
25715
+ if (frame.type === "chunk") {
25716
+ attempt.nextIndex += 1;
25717
+ this.timingProjector.projectAssistantChunk(
25718
+ attempt.turn,
25719
+ attempt.step,
25720
+ frame.chunk,
25721
+ frame.time
25722
+ );
25723
+ this.projectAssistantChunk(
25724
+ attempt.turn,
25725
+ attempt.step,
25726
+ frame.chunk,
25727
+ `attempt:${attemptId}`,
25728
+ true
25729
+ );
25730
+ return;
25731
+ }
25732
+ this.assistantAttempts.delete(attemptId);
25733
+ this.activeAssistantAttempts.delete(id);
25734
+ this.liveUsageSteps.delete(this.stepKey(attempt.turn, attempt.step));
25735
+ if (frame.outcome.kind === "abandoned" || frame.outcome.eventType === "assistant/attempt") {
25736
+ this.discardAssistantStream(id);
25737
+ }
25738
+ }
25576
25739
  assistantId(turn, step) {
25577
25740
  return `assistant-${String(turn)}-${String(step)}`;
25578
25741
  }
25579
- accountUsage(turn, step, usage) {
25580
- const key = `${String(turn)}:${String(step)}`;
25742
+ projectAssistantChunk(turn, step, chunk, usageKey = this.stepKey(turn, step), liveAttempt = false) {
25743
+ if (this.cancelledTurns.has(turn)) return;
25744
+ if (chunk.type === "text-delta" || chunk.type === "reasoning-delta") {
25745
+ this.upsertAssistantDelta(
25746
+ this.assistantId(turn, step),
25747
+ chunk.index,
25748
+ chunk.type === "text-delta" ? "text" : "reasoning",
25749
+ chunk.text
25750
+ );
25751
+ } else if (chunk.type === "usage") {
25752
+ this.accountUsage(usageKey, turn, step, chunk.usage);
25753
+ if (liveAttempt) this.liveUsageSteps.add(this.stepKey(turn, step));
25754
+ }
25755
+ }
25756
+ discardAssistantStream(id) {
25757
+ if (!this.assistantStreams.delete(id)) return;
25758
+ this.snapshot = {
25759
+ ...this.snapshot,
25760
+ messages: this.snapshot.messages.filter((message) => message.id !== id)
25761
+ };
25762
+ this.emit();
25763
+ }
25764
+ accountUsage(key, turn, step, usage) {
25581
25765
  if (this.accountedUsages.has(key)) return;
25582
25766
  this.accountedUsages.add(key);
25583
25767
  const cacheRead = usage.cacheReadTokens ?? 0;
@@ -25600,6 +25784,20 @@ var DshSessionProjector = class {
25600
25784
  if (id.startsWith(prefix)) this.assistantStreams.delete(id);
25601
25785
  }
25602
25786
  }
25787
+ clearAssistantAttempts(turn) {
25788
+ for (const [attemptId, attempt] of this.assistantAttempts) {
25789
+ if (attempt.turn !== turn) continue;
25790
+ this.assistantAttempts.delete(attemptId);
25791
+ const id = this.assistantId(attempt.turn, attempt.step);
25792
+ if (this.activeAssistantAttempts.get(id) === attemptId) {
25793
+ this.activeAssistantAttempts.delete(id);
25794
+ }
25795
+ this.liveUsageSteps.delete(this.stepKey(attempt.turn, attempt.step));
25796
+ }
25797
+ }
25798
+ stepKey(turn, step) {
25799
+ return `${String(turn)}:${String(step)}`;
25800
+ }
25603
25801
  upsertAssistantDelta(id, index, type, text) {
25604
25802
  const stream = this.assistantStreams.get(id) ?? /* @__PURE__ */ new Map();
25605
25803
  const current = stream.get(index);
@@ -25757,9 +25955,7 @@ var DshPromptCompletionRuntime = class {
25757
25955
  let failureKind;
25758
25956
  off = this.services.onSessionEvent((session, event) => {
25759
25957
  if (session.id !== handle?.agent.session.id) return;
25760
- if (event.type === "assistant/chunk" && event.data.chunk.type === "text-delta") {
25761
- textResult += event.data.chunk.text;
25762
- } else if (event.type === "assistant/message") {
25958
+ if (event.type === "assistant/message") {
25763
25959
  textResult = finalAssistantText(event) || textResult;
25764
25960
  } else if (event.type === "turn/end") {
25765
25961
  if (event.data.reason.kind !== "completed") {
@@ -27268,6 +27464,222 @@ var DshPermissionSelectionRuntime = class {
27268
27464
  }
27269
27465
  };
27270
27466
 
27467
+ // src/dsh/plan-selection-runtime.ts
27468
+ var isPlanProjection = (value) => typeof value === "object" && value !== null && typeof value.active === "boolean" && typeof value.pending === "boolean";
27469
+ var DshPlanSelectionRuntime = class {
27470
+ constructor(projections, commands, activeAgent) {
27471
+ this.projections = projections;
27472
+ this.commands = commands;
27473
+ this.activeAgent = activeAgent;
27474
+ this.snapshot = this.readSnapshot(false);
27475
+ this.offProjection = projections.onChanged((session, key) => {
27476
+ const agent = this.activeAgent();
27477
+ if (agent === void 0 || session !== agent.session || key !== "plan")
27478
+ return;
27479
+ this.refresh();
27480
+ });
27481
+ }
27482
+ snapshot;
27483
+ listeners = /* @__PURE__ */ new Set();
27484
+ offProjection;
27485
+ getSnapshot = () => this.snapshot;
27486
+ subscribe = (listener) => {
27487
+ this.listeners.add(listener);
27488
+ return () => this.listeners.delete(listener);
27489
+ };
27490
+ async setActive(active, signal) {
27491
+ signal?.throwIfAborted();
27492
+ if (this.snapshot.busy)
27493
+ throw new Error("Another plan mode change is already in progress.");
27494
+ if (!this.snapshot.available)
27495
+ throw new Error("DSH plan mode is unavailable.");
27496
+ if (this.snapshot.requestedActive === active) return;
27497
+ this.snapshot = Object.freeze({ ...this.snapshot, busy: true });
27498
+ this.emit();
27499
+ try {
27500
+ const result = await this.commands.execute(
27501
+ active ? "/plan" : "/plan off",
27502
+ signal ?? new AbortController().signal
27503
+ );
27504
+ signal?.throwIfAborted();
27505
+ if (result.kind === "error") {
27506
+ throw new Error(
27507
+ result.text ?? `Unable to turn plan mode ${active ? "on" : "off"}.`
27508
+ );
27509
+ }
27510
+ this.snapshot = this.readSnapshot(false);
27511
+ if (this.snapshot.requestedActive !== active) {
27512
+ throw new Error(
27513
+ `DSH did not queue plan mode ${active ? "activation" : "deactivation"}.`
27514
+ );
27515
+ }
27516
+ } finally {
27517
+ if (this.snapshot.busy) {
27518
+ this.snapshot = Object.freeze({ ...this.snapshot, busy: false });
27519
+ }
27520
+ this.emit();
27521
+ }
27522
+ }
27523
+ activeAgentChanged() {
27524
+ this.refresh();
27525
+ }
27526
+ dispose() {
27527
+ this.offProjection();
27528
+ this.listeners.clear();
27529
+ }
27530
+ readSnapshot(busy) {
27531
+ const agent = this.activeAgent();
27532
+ if (agent === void 0) {
27533
+ return Object.freeze({
27534
+ available: false,
27535
+ active: false,
27536
+ pending: false,
27537
+ requestedActive: false,
27538
+ busy
27539
+ });
27540
+ }
27541
+ const values = this.projections.snapshot(agent.session).values;
27542
+ const plan = values["plan"];
27543
+ if (!isPlanProjection(plan)) {
27544
+ return Object.freeze({
27545
+ available: false,
27546
+ active: false,
27547
+ pending: false,
27548
+ requestedActive: false,
27549
+ busy
27550
+ });
27551
+ }
27552
+ return Object.freeze({
27553
+ available: true,
27554
+ active: plan.active,
27555
+ pending: plan.pending,
27556
+ requestedActive: plan.pending ? !plan.active : plan.active,
27557
+ busy
27558
+ });
27559
+ }
27560
+ refresh() {
27561
+ this.snapshot = this.readSnapshot(this.snapshot.busy);
27562
+ this.emit();
27563
+ }
27564
+ emit() {
27565
+ for (const listener of this.listeners) listener();
27566
+ }
27567
+ };
27568
+
27569
+ // src/ui/interaction-mode-runtime.ts
27570
+ var DEFAULT_PRESET = "workspace-write";
27571
+ var FULL_ACCESS_PRESET2 = "danger-full-access";
27572
+ var permissionDisplayLabel = (value, configuredName) => {
27573
+ if (configuredName !== void 0 && configuredName !== value) {
27574
+ return configuredName;
27575
+ }
27576
+ switch (value) {
27577
+ case "read-only":
27578
+ return "Read only";
27579
+ case DEFAULT_PRESET:
27580
+ return "Workspace write";
27581
+ case FULL_ACCESS_PRESET2:
27582
+ return "Full access";
27583
+ default:
27584
+ return configuredName ?? value;
27585
+ }
27586
+ };
27587
+ var DefaultInteractionModeRuntime = class {
27588
+ constructor(plan, permissions, prepare) {
27589
+ this.plan = plan;
27590
+ this.permissions = permissions;
27591
+ this.prepare = prepare;
27592
+ this.snapshot = this.readSnapshot();
27593
+ this.unsubscribe = [
27594
+ plan.subscribe(() => this.refresh()),
27595
+ permissions.subscribe(() => this.refresh())
27596
+ ];
27597
+ }
27598
+ snapshot;
27599
+ operating = false;
27600
+ listeners = /* @__PURE__ */ new Set();
27601
+ unsubscribe;
27602
+ getSnapshot = () => this.snapshot;
27603
+ subscribe = (listener) => {
27604
+ this.listeners.add(listener);
27605
+ return () => this.listeners.delete(listener);
27606
+ };
27607
+ async togglePlan(signal, active) {
27608
+ signal?.throwIfAborted();
27609
+ if (this.snapshot.busy)
27610
+ throw new Error(
27611
+ "Another interaction mode change is already in progress."
27612
+ );
27613
+ this.operating = true;
27614
+ this.refresh();
27615
+ try {
27616
+ if (this.prepare !== void 0 && !this.plan.getSnapshot().available) {
27617
+ await this.prepare(signal ?? new AbortController().signal);
27618
+ signal?.throwIfAborted();
27619
+ this.refresh();
27620
+ }
27621
+ const plan = this.plan.getSnapshot();
27622
+ if (!plan.available) throw new Error("DSH plan mode is unavailable.");
27623
+ await this.plan.setActive(active ?? !plan.requestedActive, signal);
27624
+ } finally {
27625
+ this.operating = false;
27626
+ this.refresh();
27627
+ }
27628
+ }
27629
+ dispose() {
27630
+ for (const unsubscribe of this.unsubscribe) unsubscribe();
27631
+ this.listeners.clear();
27632
+ }
27633
+ readSnapshot() {
27634
+ const plan = this.plan.getSnapshot();
27635
+ const permissions = this.permissions.getSnapshot();
27636
+ const option = permissions.options.find(
27637
+ (candidate) => candidate.value === permissions.currentValue
27638
+ );
27639
+ const permissionLabel = permissionDisplayLabel(
27640
+ permissions.currentValue,
27641
+ option?.name
27642
+ );
27643
+ const common2 = {
27644
+ ...permissionLabel === void 0 ? {} : { permissionLabel },
27645
+ permissionRequiresConfirmation: option?.requiresConfirmation === true,
27646
+ showPermission: plan.requestedActive && permissions.available && permissions.currentValue !== void 0 && permissions.currentValue !== DEFAULT_PRESET,
27647
+ pending: plan.pending,
27648
+ busy: this.operating || plan.busy || permissions.busy,
27649
+ canTogglePlan: plan.available || this.prepare !== void 0
27650
+ };
27651
+ if (plan.requestedActive) {
27652
+ return Object.freeze({ kind: "plan", label: "Plan", ...common2 });
27653
+ }
27654
+ if (!permissions.available) {
27655
+ return Object.freeze({
27656
+ kind: "unavailable",
27657
+ label: "Default",
27658
+ ...common2
27659
+ });
27660
+ }
27661
+ if (permissions.currentValue === FULL_ACCESS_PRESET2) {
27662
+ return Object.freeze({
27663
+ kind: "full-access",
27664
+ label: "Full access",
27665
+ ...common2
27666
+ });
27667
+ }
27668
+ if (permissions.currentValue === DEFAULT_PRESET) {
27669
+ return Object.freeze({ kind: "default", label: "Default", ...common2 });
27670
+ }
27671
+ return Object.freeze({
27672
+ kind: "permission",
27673
+ label: permissionLabel ?? "Custom permission",
27674
+ ...common2
27675
+ });
27676
+ }
27677
+ refresh() {
27678
+ this.snapshot = this.readSnapshot();
27679
+ for (const listener of this.listeners) listener();
27680
+ }
27681
+ };
27682
+
27271
27683
  // src/dsh/provider-setup-runtime.ts
27272
27684
  import { credentialRef } from "@deepseek-ai/dsh-credentials";
27273
27685
  var DEEPSEEK_SETTINGS_NAMESPACE = "llm-deepseek";
@@ -27782,7 +28194,7 @@ async function start(ctx, config) {
27782
28194
  );
27783
28195
  if (options.resumeSessionId !== void 0)
27784
28196
  projector.replay(snapshotSessionEvents(handle.agent.session));
27785
- offSession = ctx.on(
28197
+ const offSessionEvent = ctx.on(
27786
28198
  "session/event",
27787
28199
  (session, event) => {
27788
28200
  if (session.id !== handle.agent.session.id) return;
@@ -27796,6 +28208,14 @@ async function start(ctx, config) {
27796
28208
  }
27797
28209
  }
27798
28210
  );
28211
+ const offAssistantStream = subscribeToAssistantStream(
28212
+ handle.agent,
28213
+ projector.projectAssistantStream.bind(projector)
28214
+ );
28215
+ offSession = () => {
28216
+ offAssistantStream();
28217
+ offSessionEvent();
28218
+ };
27799
28219
  const offProjector = options.publishRuntimeEvents === false ? () => {
27800
28220
  } : projector.subscribe(notifyRuntime);
27801
28221
  return {
@@ -27872,6 +28292,20 @@ async function start(ctx, config) {
27872
28292
  commandRuntime,
27873
28293
  currentInteractiveAgent
27874
28294
  );
28295
+ const planSelectionRuntime = new DshPlanSelectionRuntime(
28296
+ sessionProjections,
28297
+ commandRuntime,
28298
+ currentInteractiveAgent
28299
+ );
28300
+ const interactionModeRuntime = new DefaultInteractionModeRuntime(
28301
+ planSelectionRuntime,
28302
+ permissionSelectionRuntime,
28303
+ async (signal) => {
28304
+ await commandRuntime.prepare(signal);
28305
+ planSelectionRuntime.activeAgentChanged();
28306
+ permissionSelectionRuntime.activeAgentChanged();
28307
+ }
28308
+ );
27875
28309
  const toolCatalogRuntime = new DshToolCatalogRuntime(
27876
28310
  tools,
27877
28311
  currentInteractiveAgent,
@@ -27899,12 +28333,12 @@ async function start(ctx, config) {
27899
28333
  })
27900
28334
  );
27901
28335
  let switchingConversation = false;
27902
- const isConversationBusy = () => switchingConversation || active.projector.getSnapshot().busy || approvalRuntime.getSnapshot().pending.length > 0 || userQuestionRuntime.getSnapshot().pending.length > 0 || permissionSelectionRuntime.getSnapshot().busy;
28336
+ const isConversationBusy = () => switchingConversation || active.projector.getSnapshot().busy || approvalRuntime.getSnapshot().pending.length > 0 || userQuestionRuntime.getSnapshot().pending.length > 0 || permissionSelectionRuntime.getSnapshot().busy || planSelectionRuntime.getSnapshot().busy;
27903
28337
  const switchActiveConversation = async (selected, options = {}) => {
27904
28338
  if (switchingConversation) {
27905
28339
  throw new Error("Another Agent change is already in progress.");
27906
28340
  }
27907
- if (active.projector.getSnapshot().busy || approvalRuntime.getSnapshot().pending.length > 0 || userQuestionRuntime.getSnapshot().pending.length > 0 || permissionSelectionRuntime.getSnapshot().busy) {
28341
+ if (active.projector.getSnapshot().busy || approvalRuntime.getSnapshot().pending.length > 0 || userQuestionRuntime.getSnapshot().pending.length > 0 || permissionSelectionRuntime.getSnapshot().busy || planSelectionRuntime.getSnapshot().busy) {
27908
28342
  throw new Error(
27909
28343
  "Cannot switch the active conversation while the current Session is busy."
27910
28344
  );
@@ -27940,6 +28374,7 @@ async function start(ctx, config) {
27940
28374
  await providerSetupRuntime.refreshCurrent();
27941
28375
  commandRuntime.activeAgentChanged();
27942
28376
  permissionSelectionRuntime.activeAgentChanged();
28377
+ planSelectionRuntime.activeAgentChanged();
27943
28378
  toolCatalogRuntime.activeAgentChanged();
27944
28379
  subagentCatalogRuntime.activeAgentChanged();
27945
28380
  notifyRuntime();
@@ -28003,7 +28438,9 @@ async function start(ctx, config) {
28003
28438
  Promise.resolve(approvalRuntime.dispose()),
28004
28439
  Promise.resolve(userQuestionRuntime.dispose()),
28005
28440
  Promise.resolve(commandRuntime.dispose()),
28441
+ Promise.resolve(interactionModeRuntime.dispose()),
28006
28442
  Promise.resolve(permissionSelectionRuntime.dispose()),
28443
+ Promise.resolve(planSelectionRuntime.dispose()),
28007
28444
  Promise.resolve(toolCatalogRuntime.dispose()),
28008
28445
  Promise.resolve(subagentCatalogRuntime.dispose())
28009
28446
  ]);
@@ -28023,6 +28460,7 @@ async function start(ctx, config) {
28023
28460
  active = next;
28024
28461
  commandRuntime.activeAgentChanged();
28025
28462
  permissionSelectionRuntime.activeAgentChanged();
28463
+ planSelectionRuntime.activeAgentChanged();
28026
28464
  toolCatalogRuntime.activeAgentChanged();
28027
28465
  subagentCatalogRuntime.activeAgentChanged();
28028
28466
  notifyRuntime();
@@ -28201,6 +28639,7 @@ async function start(ctx, config) {
28201
28639
  offWorkspaceSurface = conversationWorkspace.subscribeSurface(() => {
28202
28640
  commandRuntime.activeAgentChanged();
28203
28641
  permissionSelectionRuntime.activeAgentChanged();
28642
+ planSelectionRuntime.activeAgentChanged();
28204
28643
  toolCatalogRuntime.activeAgentChanged();
28205
28644
  });
28206
28645
  ctx.effect(() => cleanup, "dsh-console: terminal");
@@ -28226,6 +28665,7 @@ async function start(ctx, config) {
28226
28665
  userQuestionRuntime,
28227
28666
  commandRuntime,
28228
28667
  permissionSelectionRuntime,
28668
+ interactionModeRuntime,
28229
28669
  toolCatalogRuntime,
28230
28670
  subagentCatalogRuntime,
28231
28671
  sideConversationRuntime: conversationWorkspace,