nolo-cli 0.68.0 → 0.69.0-alpha.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (54) hide show
  1. package/{_executeModel-XCNYHC6S.js → _executeModel-YXI7ADJF.js} +11 -11
  2. package/{agentDeleteCommand-Z3DTLQEG.js → agentDeleteCommand-B5SKAPTR.js} +2 -2
  3. package/{agentEmailCommands-DFK2MIXR.js → agentEmailCommands-LVUZQHBF.js} +11 -11
  4. package/{agentListCommands-FSX7RY7U.js → agentListCommands-D2E7SFRQ.js} +2 -2
  5. package/{agentMachineCommands-FYPV45TJ.js → agentMachineCommands-XNIBG4L2.js} +3 -3
  6. package/{agentRecordCommands-SXOCVBX7.js → agentRecordCommands-ID3URU2J.js} +11 -11
  7. package/{agentRunCommand-XISX4ICI.js → agentRunCommand-KZMPUI53.js} +11 -11
  8. package/{agentRuntimeLocal-2ENB2B2Z.js → agentRuntimeLocal-T47DU3IA.js} +2 -2
  9. package/{agentSlice-QLZWET7H.js → agentSlice-K5IE7FV3.js} +1 -1
  10. package/{appDeleteCommands-XKAUWKUI.js → appDeleteCommands-URD2F5YN.js} +2 -2
  11. package/{appDeployCommands-SNXZY5IX.js → appDeployCommands-OACWEEWP.js} +2 -2
  12. package/{appDeployStatusCommands-NXUJ6LXS.js → appDeployStatusCommands-TVYLIUEU.js} +2 -2
  13. package/{appGetCommands-DNRYKGOK.js → appGetCommands-ZWG2YEAE.js} +2 -2
  14. package/{appListCommands-URESGUKU.js → appListCommands-E3BMSQEY.js} +2 -2
  15. package/{chatQueueReduxAdapter-FNXZNIAT.js → chatQueueReduxAdapter-HL5A3L2W.js} +2 -2
  16. package/{chunk-Z6S2JBE4.js → chunk-2L7EUBRN.js} +1 -1
  17. package/{chunk-LTLZPAO7.js → chunk-36G25COQ.js} +1 -1
  18. package/{chunk-RLZ6HZSX.js → chunk-4ENGEYUY.js} +3 -3
  19. package/{chunk-K4326DRU.js → chunk-6RNOFHEM.js} +8 -8
  20. package/{chunk-XNO3T6RB.js → chunk-C2SHPJSS.js} +8 -8
  21. package/{chunk-AUA5DTWI.js → chunk-JKAWV72Y.js} +98 -32
  22. package/{chunk-K5YS7FAN.js → chunk-KRR3AG7T.js} +4 -1
  23. package/{chunk-XHNOCBUU.js → chunk-LMEH4C4G.js} +2 -2
  24. package/{chunk-IY2BLZKO.js → chunk-O2X6R45W.js} +3 -3
  25. package/{chunk-IX6H4NKR.js → chunk-OMHOVU2L.js} +1 -1
  26. package/{chunk-MIN5X7GI.js → chunk-PADUIVUU.js} +2 -2
  27. package/{chunk-5JTJG4OG.js → chunk-RXYIUZU5.js} +1 -1
  28. package/{chunk-VHADFQCI.js → chunk-SKWZFK56.js} +2 -2
  29. package/{chunk-SM4ED2LZ.js → chunk-V3B6FQKC.js} +4 -4
  30. package/{chunk-LNOW66U4.js → chunk-VOEOMLKR.js} +5 -5
  31. package/{chunk-7NG5APVZ.js → chunk-Z3XXUE2E.js} +21 -13
  32. package/{contentThunks-6K4RZXKH.js → contentThunks-XV3U3V2O.js} +3 -3
  33. package/{createAgentAutomationAction-6XYIZ3GS.js → createAgentAutomationAction-UKKP6SAJ.js} +3 -3
  34. package/{createDialogAction-TJWDXAKL.js → createDialogAction-WK6Y7DD7.js} +4 -4
  35. package/{createPageAction-EZ2LPB6K.js → createPageAction-SLRDORVZ.js} +3 -3
  36. package/{dialogCommands-ULXMRIAM.js → dialogCommands-E5AAV7PB.js} +2 -2
  37. package/{dialogSlice-5DRM6AQQ.js → dialogSlice-2TSABNK5.js} +2 -2
  38. package/{docCreateCommands-PPHO6KUM.js → docCreateCommands-N7P5VBTU.js} +2 -2
  39. package/{docDeleteCommands-U2GVGQPR.js → docDeleteCommands-LZPPUYY6.js} +2 -2
  40. package/{docReadCommands-CYY3DJXY.js → docReadCommands-UCQGMMBR.js} +2 -2
  41. package/{docStore-OJXM46BB.js → docStore-GX4LBBIB.js} +1 -1
  42. package/{docUpdateCommands-B5UVFLJU.js → docUpdateCommands-H57EVVVE.js} +2 -2
  43. package/{handleSendMessageAction-EWY3J2AV.js → handleSendMessageAction-DYAB4HTU.js} +2 -2
  44. package/index.js +43 -43
  45. package/{machineCommands-B76BYAJF.js → machineCommands-3Y3EHK2H.js} +11 -11
  46. package/{machineWsRunDispatch-LN6274EL.js → machineWsRunDispatch-RSVSJ4D7.js} +11 -11
  47. package/{memoryCommands-EBMICQR6.js → memoryCommands-CUNBFRVS.js} +13 -4
  48. package/package.json +1 -1
  49. package/{readlineWorkspace-UFHEJIDS.js → readlineWorkspace-7FZA4JYG.js} +207 -95
  50. package/{runAgentClientLoop-MAER6Y5K.js → runAgentClientLoop-VZCX37ZP.js} +9 -9
  51. package/{spaceCommands-2YT7C56D.js → spaceCommands-ANELRNRF.js} +2 -2
  52. package/{streamAgentChatTurn-AKUDQL5W.js → streamAgentChatTurn-QM364J6U.js} +10 -10
  53. package/{tools-NM36O7ZG.js → tools-YNRN4HC7.js} +6 -6
  54. package/{updateDialogTitleAction-RHH353JB.js → updateDialogTitleAction-OOYKI7LI.js} +3 -3
@@ -72,7 +72,7 @@ import {
72
72
  wrapTextToLines,
73
73
  wrapTranscriptLine,
74
74
  wrapTranscriptLineWithLayout
75
- } from "./chunk-AUA5DTWI.js";
75
+ } from "./chunk-JKAWV72Y.js";
76
76
  import "./chunk-S7Z2HMCN.js";
77
77
  import {
78
78
  listFavoriteAgentIdsAcrossServers,
@@ -96,7 +96,7 @@ import {
96
96
  readTimestamp,
97
97
  setCliLocale,
98
98
  t
99
- } from "./chunk-7NG5APVZ.js";
99
+ } from "./chunk-Z3XXUE2E.js";
100
100
  import "./chunk-BNATE77Z.js";
101
101
  import "./chunk-EADNWBAZ.js";
102
102
  import {
@@ -134,12 +134,12 @@ import "./chunk-ATNTHIZI.js";
134
134
  import "./chunk-JEXVIMYZ.js";
135
135
  import {
136
136
  prepareTools
137
- } from "./chunk-XHNOCBUU.js";
137
+ } from "./chunk-LMEH4C4G.js";
138
138
  import {
139
139
  buildResponseGuidelines
140
140
  } from "./chunk-EDKF7RX4.js";
141
141
  import "./chunk-HS7MLR74.js";
142
- import "./chunk-K4326DRU.js";
142
+ import "./chunk-6RNOFHEM.js";
143
143
  import "./chunk-5XTOKQLW.js";
144
144
  import "./chunk-NF64D32W.js";
145
145
  import "./chunk-3L2WKC3W.js";
@@ -165,18 +165,18 @@ import "./chunk-FZGV4FGK.js";
165
165
  import "./chunk-MEYIRKDN.js";
166
166
  import "./chunk-63W5N6P3.js";
167
167
  import "./chunk-VF4K2QE6.js";
168
- import "./chunk-MIN5X7GI.js";
169
- import "./chunk-VHADFQCI.js";
170
- import "./chunk-Z6S2JBE4.js";
168
+ import "./chunk-PADUIVUU.js";
169
+ import "./chunk-SKWZFK56.js";
170
+ import "./chunk-2L7EUBRN.js";
171
171
  import "./chunk-ZJ7UHBJS.js";
172
172
  import {
173
173
  extractReferenceKeysFromMessage
174
- } from "./chunk-XNO3T6RB.js";
174
+ } from "./chunk-C2SHPJSS.js";
175
175
  import "./chunk-EVBFYPDC.js";
176
176
  import "./chunk-HQUORJTM.js";
177
177
  import "./chunk-YYLHWIW6.js";
178
178
  import "./chunk-AGGIDPCZ.js";
179
- import "./chunk-RLZ6HZSX.js";
179
+ import "./chunk-4ENGEYUY.js";
180
180
  import "./chunk-76JAMDUT.js";
181
181
  import "./chunk-5RGU3J7P.js";
182
182
  import "./chunk-6YTOJY35.js";
@@ -201,7 +201,7 @@ import {
201
201
  buildLocalWorkspaceToolset,
202
202
  getProcessRegistry,
203
203
  readCommandActionGatePayload
204
- } from "./chunk-5JTJG4OG.js";
204
+ } from "./chunk-RXYIUZU5.js";
205
205
  import "./chunk-ZCVO2HLZ.js";
206
206
  import "./chunk-ZNFJWEN4.js";
207
207
  import "./chunk-Y7PULBIA.js";
@@ -211,7 +211,7 @@ import {
211
211
  buildIdentityBlock,
212
212
  buildRuntimeGuidanceBlocks,
213
213
  resolveToolGuidedSections
214
- } from "./chunk-K5YS7FAN.js";
214
+ } from "./chunk-KRR3AG7T.js";
215
215
  import "./chunk-XTJTN3RW.js";
216
216
  import "./chunk-ZW22L5ES.js";
217
217
  import {
@@ -6806,18 +6806,50 @@ function normalizeQuestion(raw, index) {
6806
6806
  required: raw?.required !== false
6807
6807
  };
6808
6808
  }
6809
- function createInitialAskChoiceState(questions) {
6809
+ function createInitialAskChoiceState(questions, savedAnswers) {
6810
+ const hasSaved = Boolean(
6811
+ savedAnswers?.answers?.length || savedAnswers?.selected || savedAnswers?.phase === "submitted"
6812
+ );
6810
6813
  return {
6811
6814
  questions,
6812
6815
  activeIndex: 0,
6813
- questionStates: questions.map(() => ({
6814
- cursorIndex: 0,
6815
- selectedIds: [],
6816
- pickedId: null,
6817
- otherText: "",
6818
- otherFocused: false
6819
- })),
6820
- phase: "active"
6816
+ questionStates: questions.map((q, i) => {
6817
+ let pickedId = null;
6818
+ let selectedIds = [];
6819
+ let otherText = "";
6820
+ if (savedAnswers?.answers?.length) {
6821
+ const byId = savedAnswers.answers.find((a) => a.questionId === q.id);
6822
+ const byPosition = savedAnswers.answers[i]?.questionId ? void 0 : savedAnswers.answers[i];
6823
+ const found = byId ?? byPosition;
6824
+ if (found) {
6825
+ selectedIds = Array.isArray(found.selectedIds) ? found.selectedIds : [];
6826
+ otherText = typeof found.otherText === "string" ? found.otherText : "";
6827
+ if (!q.multiSelect && selectedIds.length > 0) {
6828
+ pickedId = selectedIds[0];
6829
+ }
6830
+ }
6831
+ } else if (savedAnswers?.selected) {
6832
+ const label = savedAnswers.selected.label;
6833
+ const matched = q.choices.find(
6834
+ (c) => c.label === label || savedAnswers.selected?.userMessage && c.userMessage === savedAnswers.selected.userMessage
6835
+ );
6836
+ if (matched) {
6837
+ pickedId = matched.id;
6838
+ selectedIds = [matched.id];
6839
+ } else if (label) {
6840
+ otherText = label;
6841
+ }
6842
+ }
6843
+ return {
6844
+ cursorIndex: 0,
6845
+ selectedIds,
6846
+ pickedId,
6847
+ otherText,
6848
+ otherFocused: false
6849
+ };
6850
+ }),
6851
+ phase: savedAnswers?.phase ?? (hasSaved ? "submitted" : "active"),
6852
+ validationAttempted: false
6821
6853
  };
6822
6854
  }
6823
6855
  function askChoiceReducer(state, action) {
@@ -6847,8 +6879,15 @@ function askChoiceReducer(state, action) {
6847
6879
  case "CANCEL":
6848
6880
  return { ...state, phase: "cancelled" };
6849
6881
  case "SUBMIT": {
6850
- if (!canSubmit(state)) return state;
6851
- return { ...state, phase: "submitted" };
6882
+ const firstUnanswered = findFirstUnansweredIndex(state);
6883
+ if (firstUnanswered !== -1) {
6884
+ return {
6885
+ ...state,
6886
+ activeIndex: firstUnanswered,
6887
+ validationAttempted: true
6888
+ };
6889
+ }
6890
+ return { ...state, phase: "submitted", validationAttempted: false };
6852
6891
  }
6853
6892
  case "SWITCH_TAB": {
6854
6893
  const idx = clamp(action.index, 0, state.questions.length - 1);
@@ -6878,58 +6917,62 @@ function askChoiceReducer(state, action) {
6878
6917
  case "TOGGLE_AT_CURSOR": {
6879
6918
  const qs = state.questionStates[state.activeIndex];
6880
6919
  const q = state.questions[state.activeIndex];
6881
- if (!q.multiSelect) return state;
6920
+ if (!q.multiSelect) {
6921
+ return askChoiceReducer(state, { type: "SELECT_AT_CURSOR" });
6922
+ }
6882
6923
  const isOtherRow = qs.cursorIndex >= q.choices.length;
6883
6924
  if (isOtherRow) {
6884
- const newQs2 = [...state.questionStates];
6885
- newQs2[state.activeIndex] = { ...qs, otherFocused: !qs.otherFocused };
6886
- return { ...state, questionStates: newQs2 };
6925
+ const newQs = [...state.questionStates];
6926
+ newQs[state.activeIndex] = { ...qs, otherFocused: !qs.otherFocused };
6927
+ return { ...state, questionStates: newQs };
6887
6928
  }
6888
6929
  const choiceId = q.choices[qs.cursorIndex]?.id;
6889
6930
  if (!choiceId) return state;
6890
- const has = qs.selectedIds.includes(choiceId);
6891
- const newSelected = has ? qs.selectedIds.filter((id) => id !== choiceId) : [...qs.selectedIds, choiceId];
6931
+ return askChoiceReducer(state, { type: "SELECT_CHOICE", choiceId });
6932
+ }
6933
+ // The one explicit "choose this option" action, addressed by choice id so
6934
+ // that click / tap handlers on every platform share the same behaviour as
6935
+ // cursor-driven keys. Multi-select toggles, single-select picks. It never
6936
+ // advances the tab and never submits.
6937
+ case "SELECT_CHOICE": {
6938
+ const qs = state.questionStates[state.activeIndex];
6939
+ const q = state.questions[state.activeIndex];
6940
+ const choiceIndex = q.choices.findIndex((c) => c.id === action.choiceId);
6941
+ if (choiceIndex === -1) return state;
6892
6942
  const newQs = [...state.questionStates];
6893
- newQs[state.activeIndex] = { ...qs, selectedIds: newSelected };
6894
- return { ...state, questionStates: newQs };
6943
+ if (q.multiSelect) {
6944
+ const has = qs.selectedIds.includes(action.choiceId);
6945
+ const newSelected = has ? qs.selectedIds.filter((id) => id !== action.choiceId) : [...qs.selectedIds, action.choiceId];
6946
+ newQs[state.activeIndex] = {
6947
+ ...qs,
6948
+ cursorIndex: choiceIndex,
6949
+ selectedIds: newSelected,
6950
+ otherText: "",
6951
+ otherFocused: false
6952
+ };
6953
+ } else {
6954
+ newQs[state.activeIndex] = {
6955
+ ...qs,
6956
+ cursorIndex: choiceIndex,
6957
+ pickedId: action.choiceId,
6958
+ otherText: "",
6959
+ otherFocused: false
6960
+ };
6961
+ }
6962
+ return { ...state, questionStates: newQs, validationAttempted: false };
6895
6963
  }
6896
6964
  case "SELECT_AT_CURSOR": {
6897
6965
  const qs = state.questionStates[state.activeIndex];
6898
6966
  const q = state.questions[state.activeIndex];
6899
6967
  const isOtherRow = qs.cursorIndex >= q.choices.length;
6900
6968
  if (isOtherRow) {
6901
- const newQs2 = [...state.questionStates];
6902
- newQs2[state.activeIndex] = { ...qs, otherFocused: true };
6903
- return { ...state, questionStates: newQs2 };
6969
+ const newQs = [...state.questionStates];
6970
+ newQs[state.activeIndex] = { ...qs, otherFocused: true };
6971
+ return { ...state, questionStates: newQs };
6904
6972
  }
6905
6973
  const choiceId = q.choices[qs.cursorIndex]?.id;
6906
6974
  if (!choiceId) return state;
6907
- if (q.multiSelect) {
6908
- const has = qs.selectedIds.includes(choiceId);
6909
- const newSelected = has ? qs.selectedIds.filter((id) => id !== choiceId) : [...qs.selectedIds, choiceId];
6910
- const newQs2 = [...state.questionStates];
6911
- newQs2[state.activeIndex] = { ...qs, selectedIds: newSelected };
6912
- return { ...state, questionStates: newQs2 };
6913
- }
6914
- const newQs = [...state.questionStates];
6915
- newQs[state.activeIndex] = { ...qs, pickedId: choiceId, otherFocused: false };
6916
- if (state.questions.length === 1) {
6917
- return {
6918
- ...state,
6919
- questionStates: newQs,
6920
- phase: "submitted"
6921
- };
6922
- }
6923
- const nextState = { ...state, questionStates: newQs };
6924
- const isLastTab = state.activeIndex >= state.questions.length - 1;
6925
- if (isLastTab && canSubmit(nextState)) {
6926
- return { ...nextState, phase: "submitted" };
6927
- }
6928
- const nextTab = Math.min(
6929
- state.activeIndex + 1,
6930
- state.questions.length - 1
6931
- );
6932
- return { ...nextState, activeIndex: nextTab };
6975
+ return askChoiceReducer(state, { type: "SELECT_CHOICE", choiceId });
6933
6976
  }
6934
6977
  case "FOCUS_OTHER": {
6935
6978
  const qs = state.questionStates[state.activeIndex];
@@ -6946,40 +6989,47 @@ function askChoiceReducer(state, action) {
6946
6989
  case "SET_OTHER_TEXT": {
6947
6990
  const qs = state.questionStates[state.activeIndex];
6948
6991
  const newQs = [...state.questionStates];
6949
- newQs[state.activeIndex] = { ...qs, otherText: action.text };
6950
- return { ...state, questionStates: newQs };
6992
+ const hasText = action.text.trim().length > 0;
6993
+ newQs[state.activeIndex] = {
6994
+ ...qs,
6995
+ otherText: action.text,
6996
+ // Non-empty Other is mutually exclusive with predefined choices
6997
+ ...hasText ? { pickedId: null, selectedIds: [] } : {}
6998
+ };
6999
+ return { ...state, questionStates: newQs, validationAttempted: false };
6951
7000
  }
6952
7001
  default:
6953
7002
  return state;
6954
7003
  }
6955
7004
  }
7005
+ function findFirstUnansweredIndex(state) {
7006
+ return state.questions.findIndex(
7007
+ (q, i) => !isQuestionAnswered(q, state.questionStates[i])
7008
+ );
7009
+ }
6956
7010
  function isQuestionAnswered(q, qs) {
6957
7011
  if (!q.required) return true;
6958
- const hasSelection = q.multiSelect ? qs.selectedIds.length > 0 : qs.pickedId !== null;
6959
7012
  const hasOther = q.allowOther && qs.otherText.trim().length > 0;
6960
- return hasSelection || hasOther;
6961
- }
6962
- function canSubmit(state) {
6963
- return state.questions.every(
6964
- (q, i) => isQuestionAnswered(q, state.questionStates[i])
6965
- );
7013
+ const hasSelection = q.multiSelect ? qs.selectedIds.length > 0 : qs.pickedId !== null;
7014
+ return hasOther || hasSelection;
6966
7015
  }
6967
7016
  function buildAskChoiceResult(state) {
6968
7017
  if (state.phase === "cancelled") return { kind: "cancelled" };
6969
7018
  if (state.phase !== "submitted") return { kind: "cancelled" };
6970
7019
  const answers = state.questions.map((q, i) => {
6971
7020
  const qs = state.questionStates[i];
6972
- const selectedIds = q.multiSelect ? qs.selectedIds : qs.pickedId ? [qs.pickedId] : [];
6973
7021
  const otherText = qs.otherText.trim();
7022
+ const selectedIds = otherText ? [] : q.multiSelect ? qs.selectedIds : qs.pickedId ? [qs.pickedId] : [];
6974
7023
  const parts = [];
6975
- for (const id of selectedIds) {
6976
- const choice = q.choices.find((c) => c.id === id);
6977
- if (choice) {
6978
- parts.push(choice.userMessage || choice.label);
6979
- }
6980
- }
6981
7024
  if (otherText) {
6982
7025
  parts.push(otherText);
7026
+ } else {
7027
+ for (const id of selectedIds) {
7028
+ const choice = q.choices.find((c) => c.id === id);
7029
+ if (choice) {
7030
+ parts.push(choice.userMessage || choice.label);
7031
+ }
7032
+ }
6983
7033
  }
6984
7034
  return {
6985
7035
  questionId: q.id,
@@ -6990,6 +7040,19 @@ function buildAskChoiceResult(state) {
6990
7040
  });
6991
7041
  return { kind: "submitted", answers };
6992
7042
  }
7043
+ function formatOutboundUserMessage(questions, answers) {
7044
+ if (answers.length <= 1) {
7045
+ return answers[0]?.userMessage ?? "";
7046
+ }
7047
+ return answers.map((a) => {
7048
+ const q = questions.find((item) => item.id === a.questionId);
7049
+ const title = q?.header || q?.question;
7050
+ if (title && a.userMessage) {
7051
+ return `[${title}]: ${a.userMessage}`;
7052
+ }
7053
+ return a.userMessage;
7054
+ }).filter(Boolean).join("\n\n");
7055
+ }
6993
7056
  function clamp(value, min, max) {
6994
7057
  return Math.max(min, Math.min(max, value));
6995
7058
  }
@@ -7000,10 +7063,17 @@ var KEY_SHIFT_TAB = "\x1B[Z";
7000
7063
  var KEY_BACKSPACE = "\x7F";
7001
7064
  var KEY_BACKSPACE_ALT = "\b";
7002
7065
  var KEY_SPACE = " ";
7003
- function renderTabBar(questions, activeIndex, colorEnabled) {
7004
- const tabs = questions.map((q, i) => {
7005
- const label = q.header || `Q${i + 1}`;
7006
- if (i === activeIndex) {
7066
+ var KEY_CTRL_S = "";
7067
+ var TAB_DONE = "\u2713";
7068
+ var TAB_MISSING = "!";
7069
+ var TAB_OPTIONAL = "\xB7";
7070
+ function renderTabBar(state, colorEnabled) {
7071
+ const tabs = state.questions.map((q, i) => {
7072
+ const qs = state.questionStates[i];
7073
+ const hasAnswer = qs.pickedId !== null || qs.selectedIds.length > 0 || qs.otherText.trim().length > 0;
7074
+ const mark = hasAnswer ? TAB_DONE : q.required ? TAB_MISSING : TAB_OPTIONAL;
7075
+ const label = `${mark} ${q.header || `Q${i + 1}`}`;
7076
+ if (i === state.activeIndex) {
7007
7077
  return colorEnabled ? `${themeColorSequence("accent")} ${label} \x1B[0m` : `[${label}]`;
7008
7078
  }
7009
7079
  return colorEnabled ? themeText(` ${label} `, "muted", colorEnabled) : ` ${label} `;
@@ -7020,6 +7090,7 @@ function otherRowPrefix(index) {
7020
7090
  }
7021
7091
  function renderAskChoiceFrame(state, options) {
7022
7092
  const colorEnabled = resolveCliColorEnabled();
7093
+ const submitFocused = options?.submitFocused === true;
7023
7094
  const q = state.questions[state.activeIndex];
7024
7095
  const qs = state.questionStates[state.activeIndex];
7025
7096
  const lines = [];
@@ -7032,7 +7103,13 @@ function renderAskChoiceFrame(state, options) {
7032
7103
  }
7033
7104
  lines.push("");
7034
7105
  if (state.questions.length > 1) {
7035
- lines.push(renderTabBar(state.questions, state.activeIndex, colorEnabled));
7106
+ lines.push(renderTabBar(state, colorEnabled));
7107
+ lines.push("");
7108
+ }
7109
+ if (state.validationAttempted) {
7110
+ lines.push(
7111
+ colorEnabled ? themeText(` ${t("askChoiceValidationRequired")}`, "warning", colorEnabled) : ` ${t("askChoiceValidationRequired")}`
7112
+ );
7036
7113
  lines.push("");
7037
7114
  }
7038
7115
  lines.push(
@@ -7059,7 +7136,7 @@ function renderAskChoiceFrame(state, options) {
7059
7136
  for (let i = window.start; i < window.end; i++) {
7060
7137
  if (i < q.choices.length) {
7061
7138
  const choice = q.choices[i];
7062
- const focused = qs.cursorIndex === i;
7139
+ const focused = qs.cursorIndex === i && !submitFocused;
7063
7140
  const checkbox = q.multiSelect ? qs.selectedIds.includes(choice.id) ? DIALOG_CHECKED : DIALOG_UNCHECKED : qs.pickedId === choice.id ? DIALOG_CHECKED : void 0;
7064
7141
  lines.push(
7065
7142
  renderDialogRow({
@@ -7070,7 +7147,7 @@ function renderAskChoiceFrame(state, options) {
7070
7147
  })
7071
7148
  );
7072
7149
  } else {
7073
- const focused = qs.cursorIndex === i;
7150
+ const focused = qs.cursorIndex === i && !submitFocused;
7074
7151
  const marker = focused ? DIALOG_CURSOR : " ";
7075
7152
  const plainPrefix = `${marker}${otherRowPrefix(i)}`;
7076
7153
  const plainRow = `${plainPrefix}${qs.otherText}`;
@@ -7092,6 +7169,12 @@ function renderAskChoiceFrame(state, options) {
7092
7169
  if (window.end < totalRows) {
7093
7170
  lines.push(renderOverflowBelow(totalRows - window.end));
7094
7171
  }
7172
+ lines.push(
7173
+ renderDialogRow({
7174
+ label: t("askChoiceSubmitRow"),
7175
+ focused: submitFocused
7176
+ })
7177
+ );
7095
7178
  lines.push("");
7096
7179
  lines.push(renderFooter(q.multiSelect, colorEnabled));
7097
7180
  return { text: lines.join("\n"), otherCursor };
@@ -7114,6 +7197,7 @@ async function runAskChoiceDialog(args) {
7114
7197
  const session = args.session ?? createStandaloneDialogSession({ input, output });
7115
7198
  const wheelThrottle = createWheelThrottle();
7116
7199
  let rawAcquired = false;
7200
+ let submitFocused = false;
7117
7201
  const bottomAnchored = Boolean(args.bottomAnchored && args.bottomRow);
7118
7202
  const resolveBottomRow = () => Math.max(
7119
7203
  1,
@@ -7122,7 +7206,7 @@ async function runAskChoiceDialog(args) {
7122
7206
  const painter = createDialogFramePainter({
7123
7207
  output,
7124
7208
  render: () => {
7125
- const frame = renderAskChoiceFrame(state, { bottomAnchored });
7209
+ const frame = renderAskChoiceFrame(state, { bottomAnchored, submitFocused });
7126
7210
  return {
7127
7211
  text: frame.text,
7128
7212
  cursor: frame.otherCursor
@@ -7164,6 +7248,7 @@ async function runAskChoiceDialog(args) {
7164
7248
  }
7165
7249
  const direction = scrollAction === "wheel-up" ? -1 : 1;
7166
7250
  if (wheelThrottle.step(direction) === 0) continue;
7251
+ submitFocused = false;
7167
7252
  state = askChoiceReducer(state, {
7168
7253
  type: "MOVE_CURSOR",
7169
7254
  delta: direction
@@ -7185,29 +7270,49 @@ async function runAskChoiceDialog(args) {
7185
7270
  } else if (isCancel(sequence)) {
7186
7271
  action = { type: "CANCEL" };
7187
7272
  } else if (isArrowUp(sequence)) {
7273
+ if (submitFocused) {
7274
+ submitFocused = false;
7275
+ paint();
7276
+ continue;
7277
+ }
7188
7278
  action = { type: "MOVE_CURSOR", delta: -1 };
7189
7279
  } else if (isArrowDown(sequence)) {
7280
+ const maxRowIndex = q.allowOther ? q.choices.length : q.choices.length - 1;
7281
+ if (submitFocused) {
7282
+ continue;
7283
+ }
7284
+ if (qs.cursorIndex >= maxRowIndex) {
7285
+ submitFocused = true;
7286
+ state = askChoiceReducer(state, { type: "MOVE_CURSOR", delta: 1 });
7287
+ paint();
7288
+ continue;
7289
+ }
7190
7290
  action = { type: "MOVE_CURSOR", delta: 1 };
7291
+ } else if (sequence === KEY_CTRL_S) {
7292
+ action = { type: "SUBMIT" };
7191
7293
  } else if (sequence === KEY_SPACE) {
7294
+ if (submitFocused) {
7295
+ continue;
7296
+ }
7192
7297
  if (qs.otherFocused) {
7193
7298
  action = {
7194
7299
  type: "SET_OTHER_TEXT",
7195
7300
  text: qs.otherText + " "
7196
7301
  };
7197
- } else if (q.multiSelect) {
7198
- action = { type: "TOGGLE_AT_CURSOR" };
7199
7302
  } else if (isOtherRow) {
7200
7303
  action = { type: "FOCUS_OTHER" };
7304
+ } else {
7305
+ action = { type: "TOGGLE_AT_CURSOR" };
7201
7306
  }
7202
7307
  } else if (isSubmit(sequence)) {
7203
- if (qs.otherFocused) {
7308
+ if (submitFocused) {
7309
+ action = { type: "SUBMIT" };
7310
+ } else if (qs.otherFocused) {
7204
7311
  action = { type: "BLUR_OTHER" };
7205
- } else if (isOtherRow && !qs.otherFocused) {
7312
+ } else if (isOtherRow) {
7206
7313
  action = { type: "FOCUS_OTHER" };
7207
- } else if (q.multiSelect) {
7208
- action = { type: "SUBMIT" };
7209
7314
  } else {
7210
- action = { type: "SELECT_AT_CURSOR" };
7315
+ action = { type: "TOGGLE_AT_CURSOR" };
7211
7316
  }
7212
7317
  } else if (sequence === KEY_BACKSPACE || sequence === KEY_BACKSPACE_ALT) {
7213
7318
  if (qs.otherFocused && qs.otherText.length > 0) {
@@ -7217,6 +7322,16 @@ async function runAskChoiceDialog(args) {
7217
7322
  text: chars.slice(0, -1).join("")
7218
7323
  };
7219
7324
  }
7325
+ } else if (submitFocused) {
7326
+ continue;
7327
+ } else if (sequence.length === 1 && sequence >= "1" && sequence <= "9" && !qs.otherFocused) {
7328
+ const rowIndex = Number(sequence) - 1;
7329
+ if (rowIndex < q.choices.length) {
7330
+ const choice = q.choices[rowIndex];
7331
+ if (choice) action = { type: "SELECT_CHOICE", choiceId: choice.id };
7332
+ } else if (rowIndex === q.choices.length && q.allowOther) {
7333
+ action = { type: "FOCUS_OTHER" };
7334
+ }
7220
7335
  } else if (sequence.length >= 1 && sequence.charCodeAt(0) >= 32 && !sequence.startsWith("\x1B")) {
7221
7336
  if (qs.otherFocused || isOtherRow && q.allowOther) {
7222
7337
  const cleaned = sequence.replace(/[\x00-\x1f\x7f]/g, "");
@@ -7235,10 +7350,7 @@ async function runAskChoiceDialog(args) {
7235
7350
  if (action) {
7236
7351
  state = askChoiceReducer(state, action);
7237
7352
  if (state.phase !== "active") break;
7238
- if (action.type === "BLUR_OTHER" && state.activeIndex >= state.questions.length - 1 && canSubmit(state)) {
7239
- state = askChoiceReducer(state, { type: "SUBMIT" });
7240
- break;
7241
- }
7353
+ submitFocused = false;
7242
7354
  paint();
7243
7355
  }
7244
7356
  }
@@ -7270,7 +7382,7 @@ async function runAskChoiceDialog(args) {
7270
7382
  return {
7271
7383
  kind: "multi-submitted",
7272
7384
  answers: result.answers,
7273
- userMessage: result.answers.map((a) => a.userMessage).filter(Boolean).join("\n\n")
7385
+ userMessage: formatOutboundUserMessage(normalized.questions, result.answers)
7274
7386
  };
7275
7387
  }
7276
7388
 
@@ -1,18 +1,18 @@
1
1
  import {
2
2
  fetchAgentContexts
3
- } from "./chunk-IX6H4NKR.js";
3
+ } from "./chunk-OMHOVU2L.js";
4
4
  import {
5
5
  generateRequestBody,
6
6
  mergeReferences,
7
7
  performFetchRequest,
8
8
  sanitizeOutboundBody
9
- } from "./chunk-SM4ED2LZ.js";
9
+ } from "./chunk-V3B6FQKC.js";
10
10
  import "./chunk-EDKF7RX4.js";
11
11
  import "./chunk-HS7MLR74.js";
12
12
  import {
13
13
  findToolExecutor,
14
14
  getToolResultErrorData
15
- } from "./chunk-K4326DRU.js";
15
+ } from "./chunk-6RNOFHEM.js";
16
16
  import "./chunk-5XTOKQLW.js";
17
17
  import "./chunk-NF64D32W.js";
18
18
  import "./chunk-3L2WKC3W.js";
@@ -28,18 +28,18 @@ import "./chunk-FZGV4FGK.js";
28
28
  import "./chunk-MEYIRKDN.js";
29
29
  import "./chunk-63W5N6P3.js";
30
30
  import "./chunk-VF4K2QE6.js";
31
- import "./chunk-MIN5X7GI.js";
32
- import "./chunk-VHADFQCI.js";
33
- import "./chunk-Z6S2JBE4.js";
31
+ import "./chunk-PADUIVUU.js";
32
+ import "./chunk-SKWZFK56.js";
33
+ import "./chunk-2L7EUBRN.js";
34
34
  import "./chunk-ZJ7UHBJS.js";
35
35
  import {
36
36
  updateTokensAction
37
- } from "./chunk-XNO3T6RB.js";
37
+ } from "./chunk-C2SHPJSS.js";
38
38
  import "./chunk-EVBFYPDC.js";
39
39
  import "./chunk-HQUORJTM.js";
40
40
  import "./chunk-YYLHWIW6.js";
41
41
  import "./chunk-AGGIDPCZ.js";
42
- import "./chunk-RLZ6HZSX.js";
42
+ import "./chunk-4ENGEYUY.js";
43
43
  import "./chunk-76JAMDUT.js";
44
44
  import "./chunk-5RGU3J7P.js";
45
45
  import "./chunk-6YTOJY35.js";
@@ -49,7 +49,7 @@ import "./chunk-RW76G3YN.js";
49
49
  import "./chunk-AJF6YRN7.js";
50
50
  import "./chunk-AETZ7AD6.js";
51
51
  import "./chunk-KHCLMKZZ.js";
52
- import "./chunk-K5YS7FAN.js";
52
+ import "./chunk-KRR3AG7T.js";
53
53
  import "./chunk-XTJTN3RW.js";
54
54
  import "./chunk-ZW22L5ES.js";
55
55
  import "./chunk-VLQRD7ZJ.js";
@@ -11,13 +11,13 @@ import {
11
11
  import "./chunk-Q6FF2MCK.js";
12
12
  import "./chunk-SPAQ4PVV.js";
13
13
  import "./chunk-KQHGZWSV.js";
14
- import "./chunk-5JTJG4OG.js";
14
+ import "./chunk-RXYIUZU5.js";
15
15
  import "./chunk-ZCVO2HLZ.js";
16
16
  import "./chunk-ZNFJWEN4.js";
17
17
  import "./chunk-Y7PULBIA.js";
18
18
  import "./chunk-2QDDKFG5.js";
19
19
  import "./chunk-N7J63Q6C.js";
20
- import "./chunk-K5YS7FAN.js";
20
+ import "./chunk-KRR3AG7T.js";
21
21
  import "./chunk-XTJTN3RW.js";
22
22
  import "./chunk-ZW22L5ES.js";
23
23
  import "./chunk-VLQRD7ZJ.js";
@@ -16,11 +16,11 @@ import {
16
16
  readStreamChunk,
17
17
  sendOpenAICompletionsRequest,
18
18
  updateTotalUsage
19
- } from "./chunk-LNOW66U4.js";
19
+ } from "./chunk-VOEOMLKR.js";
20
20
  import "./chunk-JEXVIMYZ.js";
21
21
  import {
22
22
  prepareTools
23
- } from "./chunk-XHNOCBUU.js";
23
+ } from "./chunk-LMEH4C4G.js";
24
24
  import {
25
25
  INVALID_TOOL_ARGS_REPLACEMENT,
26
26
  buildInvalidToolCallSelfHealResult,
@@ -38,7 +38,7 @@ import {
38
38
  sanitizeOutboundResponsesInput,
39
39
  selectResponsesConversationState,
40
40
  updateResponsesConversationState
41
- } from "./chunk-SM4ED2LZ.js";
41
+ } from "./chunk-V3B6FQKC.js";
42
42
  import "./chunk-EDKF7RX4.js";
43
43
  import "./chunk-HS7MLR74.js";
44
44
  import {
@@ -46,7 +46,7 @@ import {
46
46
  getAllToolRuns,
47
47
  resolveAgentRecommendedSkillNames,
48
48
  resolveAgentRequiredPackIds
49
- } from "./chunk-K4326DRU.js";
49
+ } from "./chunk-6RNOFHEM.js";
50
50
  import "./chunk-5XTOKQLW.js";
51
51
  import "./chunk-NF64D32W.js";
52
52
  import "./chunk-3L2WKC3W.js";
@@ -80,11 +80,11 @@ import "./chunk-63W5N6P3.js";
80
80
  import "./chunk-VF4K2QE6.js";
81
81
  import {
82
82
  getDocState
83
- } from "./chunk-MIN5X7GI.js";
84
- import "./chunk-VHADFQCI.js";
83
+ } from "./chunk-PADUIVUU.js";
84
+ import "./chunk-SKWZFK56.js";
85
85
  import {
86
86
  getTableState
87
- } from "./chunk-Z6S2JBE4.js";
87
+ } from "./chunk-2L7EUBRN.js";
88
88
  import {
89
89
  getCurrentSpaceId,
90
90
  getCurrentSpaceIdRaw,
@@ -109,12 +109,12 @@ import {
109
109
  shouldBlockForGptPro,
110
110
  updateTokens,
111
111
  updateToolMessage
112
- } from "./chunk-XNO3T6RB.js";
112
+ } from "./chunk-C2SHPJSS.js";
113
113
  import "./chunk-EVBFYPDC.js";
114
114
  import "./chunk-HQUORJTM.js";
115
115
  import "./chunk-YYLHWIW6.js";
116
116
  import "./chunk-AGGIDPCZ.js";
117
- import "./chunk-RLZ6HZSX.js";
117
+ import "./chunk-4ENGEYUY.js";
118
118
  import {
119
119
  createCliChatTurnStream,
120
120
  getCliChatSession,
@@ -155,7 +155,7 @@ import {
155
155
  } from "./chunk-Y7PULBIA.js";
156
156
  import "./chunk-2QDDKFG5.js";
157
157
  import "./chunk-N7J63Q6C.js";
158
- import "./chunk-K5YS7FAN.js";
158
+ import "./chunk-KRR3AG7T.js";
159
159
  import {
160
160
  extractImagePartsFromResponseOutput,
161
161
  extractTextFromResponseOutput,