nolo-cli 0.206.1 → 0.208.0

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 (113) hide show
  1. package/{_executeModel-U2XB3H4R.js → _executeModel-F4GZ3K75.js} +20 -20
  2. package/{agentDeleteCommand-NVXNQ2VQ.js → agentDeleteCommand-F2HW7SZI.js} +36 -36
  3. package/{agentEmailCommands-VUJOYASY.js → agentEmailCommands-6PJSMXBQ.js} +35 -35
  4. package/{agentListCommands-KDRCBFUE.js → agentListCommands-S54ZR3L7.js} +27 -47
  5. package/{agentMachineCommands-TGZIF2SL.js → agentMachineCommands-HN7VKXOV.js} +16 -16
  6. package/{agentProviderCommands-SKW4L6NN.js → agentProviderCommands-MN3ABDME.js} +2 -2
  7. package/{agentPullCommand-LGASFNH7.js → agentPullCommand-2JMJP5BS.js} +1 -1
  8. package/{agentRecordCommands-DM5UHNZM.js → agentRecordCommands-SZ6JTRZG.js} +32 -32
  9. package/{agentRunCommand-T6JGFAFZ.js → agentRunCommand-XEV3BK3L.js} +33 -33
  10. package/{agentRunControl-GOH5VSQU.js → agentRunControl-AF7BMR22.js} +3 -3
  11. package/{agentRuntimeLocal-N5S7NSJB.js → agentRuntimeLocal-KCC7QW7Z.js} +12 -12
  12. package/{agentSlice-6XXGHTPP.js → agentSlice-QHBCIRZZ.js} +1 -1
  13. package/{appDeleteCommands-VJNS4HSF.js → appDeleteCommands-7O4SMBTL.js} +18 -18
  14. package/{appDeployCommands-HLZIEHUP.js → appDeployCommands-4Y46KPQJ.js} +18 -18
  15. package/{appDeployStatusCommands-PT64TF2T.js → appDeployStatusCommands-WRAXA7AH.js} +18 -18
  16. package/{appGetCommands-FM2ICAF7.js → appGetCommands-RKC3OW5T.js} +18 -18
  17. package/{appListCommands-QVC3TKQD.js → appListCommands-3QVE4TSI.js} +18 -18
  18. package/authCommand-AUP7FHGM.js +69 -0
  19. package/{authCommands-MZUXPRYJ.js → authCommands-WK6E42L2.js} +2 -2
  20. package/{chromeOpsCommands-ECVS6CAO.js → chromeOpsCommands-HEN5AX2J.js} +1 -1
  21. package/{chunk-4NWJ3Z3G.js → chunk-25OB36GU.js} +1 -1
  22. package/{chunk-5MXA4LWL.js → chunk-27E2CBBY.js} +1 -1
  23. package/{chunk-3ZUXGHFS.js → chunk-2UZ22L3V.js} +4 -80
  24. package/{chunk-3UCYYSKN.js → chunk-35DNCETZ.js} +29 -29
  25. package/{chunk-7NMNKOW5.js → chunk-3IBHFELR.js} +2 -2
  26. package/{chunk-JASKVAYJ.js → chunk-3QKILTO3.js} +2 -2
  27. package/{chunk-PPCUXO3E.js → chunk-3RQVYR4B.js} +103 -0
  28. package/{chunk-YZGNKHUM.js → chunk-3V2QMRNN.js} +1 -1
  29. package/{chunk-BAPZCPYU.js → chunk-4LEGTOSR.js} +1 -1
  30. package/{chunk-64K7WX26.js → chunk-4WVJLODK.js} +1 -1
  31. package/{chunk-Y3ASVJWL.js → chunk-64D757HH.js} +3 -3
  32. package/{chunk-2Q3LOAFE.js → chunk-6HVBI6TI.js} +2 -2
  33. package/{chunk-U7HTU2S7.js → chunk-7AUQ3WCW.js} +1 -1
  34. package/{chunk-L5FZUSB6.js → chunk-AD26C3WW.js} +3 -3
  35. package/{chunk-4RERKW4Q.js → chunk-AJ65N2PX.js} +5 -5
  36. package/{chunk-5XNUQGLF.js → chunk-ALBTWLUE.js} +7 -7
  37. package/{chunk-P64WRQYV.js → chunk-AZMYUSVF.js} +1 -1
  38. package/{authCommand-NZC3H2EN.js → chunk-B2WYM23T.js} +18 -43
  39. package/{chunk-WC6TH54L.js → chunk-BF3TXGWM.js} +5 -5
  40. package/{chunk-PK5TD4ST.js → chunk-C2XZM3K4.js} +1 -1
  41. package/{chunk-5ZBZHVMF.js → chunk-CAB2CZ5H.js} +36 -19
  42. package/{chunk-ZCKXJTCW.js → chunk-CGQSAFXP.js} +10 -10
  43. package/{chunk-XNOILBHV.js → chunk-CKOO42G5.js} +1 -1
  44. package/{chunk-SEOM7GLZ.js → chunk-COWSUNBH.js} +1 -1
  45. package/{chunk-JBWLZ3CB.js → chunk-DA7CTWT4.js} +2 -2
  46. package/{chunk-YJ6UWOO5.js → chunk-DNQ5NOAR.js} +2 -2
  47. package/{chunk-NUAQ3QHF.js → chunk-FPCPCTSA.js} +2 -2
  48. package/{chunk-5OJDQAJ2.js → chunk-FQQWTOBR.js} +2 -2
  49. package/{chunk-7LJEJV4F.js → chunk-GMEAELJ6.js} +88 -1
  50. package/{chunk-7DQSP7JU.js → chunk-J5JTMQIA.js} +1 -1
  51. package/{chunk-EVG6HQQ7.js → chunk-JBOUVTZX.js} +2 -2
  52. package/{chunk-5BHQICF2.js → chunk-JRTNUU5Z.js} +25 -6
  53. package/{chunk-7T5TLIY4.js → chunk-LKDF3ATR.js} +1 -1
  54. package/{chunk-LKV5K7PW.js → chunk-MKK2YY5Q.js} +2 -2
  55. package/{chunk-73PRLLT6.js → chunk-MONJ5H3H.js} +5 -5
  56. package/{chunk-LEJSZV6V.js → chunk-P2ZLUIW2.js} +243 -15
  57. package/{chunk-YF4ZRVP3.js → chunk-PLYWH7XM.js} +1 -1
  58. package/{chunk-WPOKOKZA.js → chunk-PV6JJAUB.js} +1 -1
  59. package/{chunk-IAYMBPDZ.js → chunk-QOI7USOV.js} +2 -2
  60. package/{chunk-W45PCJHS.js → chunk-R56VAYY4.js} +1 -1
  61. package/{chunk-DDVXTOFJ.js → chunk-RIALQUSF.js} +8 -8
  62. package/{chunk-LTI5T3A6.js → chunk-SN5XE6GQ.js} +1 -1
  63. package/{chunk-D3DGBEYY.js → chunk-SU3QL7YG.js} +2 -2
  64. package/{chunk-MNWKNN6V.js → chunk-SZ4ADZFT.js} +1 -1
  65. package/{chunk-2GKUVGRT.js → chunk-THE5CKB2.js} +13 -5
  66. package/{chunk-ZRDUMMDG.js → chunk-UTBQCL6N.js} +9 -7
  67. package/{chunk-6AMR3AE6.js → chunk-UZT65S6D.js} +12 -1
  68. package/{chunk-K7ZZPUNO.js → chunk-WWSPE2GG.js} +12 -12
  69. package/{chunk-2PW2KOII.js → chunk-XDMGY5IU.js} +2 -2
  70. package/{chunk-UGCQKKXW.js → chunk-XE4Q46FF.js} +1 -1
  71. package/{chunk-QSAUX2Q2.js → chunk-YCEA47VH.js} +2 -2
  72. package/{chunk-LDPZBAQK.js → chunk-YY37MQSS.js} +2 -2
  73. package/{chunk-AWVFQMOV.js → chunk-ZYKJBRZ3.js} +5 -1
  74. package/{commandRegistry-PASVNTAX.js → commandRegistry-XVFA25FB.js} +70 -70
  75. package/{contentThunks-IXBWQP4P.js → contentThunks-V3CDW4YX.js} +4 -4
  76. package/{cooldownCommands-I4ETQ4AO.js → cooldownCommands-YL7H74YB.js} +3 -3
  77. package/{createAgentAutomationAction-7O7PFPDO.js → createAgentAutomationAction-FGWAYVEP.js} +4 -4
  78. package/{createDialogAction-DRHO4XCF.js → createDialogAction-UXAMBNR4.js} +5 -5
  79. package/{createPageAction-TFGJRDZX.js → createPageAction-S6HULJP6.js} +4 -4
  80. package/{db-2QOTXYGH.js → db-HUCI5R4G.js} +2 -2
  81. package/{dialogCommands-RYIONJLY.js → dialogCommands-HW6WWUII.js} +21 -21
  82. package/{dialogSlice-CXIZ5UTI.js → dialogSlice-TBITWBDH.js} +3 -3
  83. package/{dialogUsageCommand-QTG6ILEJ.js → dialogUsageCommand-ZCPPHPJ5.js} +1 -1
  84. package/{docCreateCommands-KC2V2RPX.js → docCreateCommands-ETFMIYE5.js} +16 -16
  85. package/{docDeleteCommands-S2SDQL2S.js → docDeleteCommands-HEDB7AHB.js} +17 -17
  86. package/{docReadCommands-3YGFKAOZ.js → docReadCommands-4T5EQQW6.js} +16 -16
  87. package/{docStore-5AHNSAEI.js → docStore-NFLRMEX3.js} +1 -1
  88. package/{docUpdateCommands-PU6MQTLW.js → docUpdateCommands-TYM5V565.js} +16 -16
  89. package/{getPricing-3PQY3TGI.js → getPricing-OQXBJ6VZ.js} +1 -1
  90. package/{handleSendMessageAction-SO3PD3YA.js → handleSendMessageAction-UCFZXCXP.js} +12 -12
  91. package/index.js +7 -7
  92. package/{localDialogRead-FUXGZ57B.js → localDialogRead-5VCMQQZF.js} +1 -1
  93. package/{localRuntimeAdapter-5B7QODVK.js → localRuntimeAdapter-JBXUIVNU.js} +29 -29
  94. package/{localRuntimeAuthority-NEGF3LRQ.js → localRuntimeAuthority-OYH4AE4G.js} +2 -2
  95. package/{localRuntimeDb-SDYFAEKA.js → localRuntimeDb-VBIMCWUC.js} +1 -1
  96. package/{machineCommands-U3DO4TFR.js → machineCommands-FDQA6NCY.js} +30 -30
  97. package/{machineWsRunDispatch-Y3IMIZO7.js → machineWsRunDispatch-VBTEUSVI.js} +30 -30
  98. package/package.json +1 -1
  99. package/{providerPresetApply-EQESXT6X.js → providerPresetApply-ZYMLQA46.js} +3 -3
  100. package/{providerRegistry-PZ56P43E.js → providerRegistry-E34XWDLJ.js} +3 -3
  101. package/{readlineWorkspace-32IDD2MQ.js → readlineWorkspace-SJY4M4YP.js} +558 -139
  102. package/{removeDialogAgentAction-BDLO7UC2.js → removeDialogAgentAction-UQFCQO6L.js} +1 -1
  103. package/{runAgentClientLoop-ERVJ4LFY.js → runAgentClientLoop-V4KMRRPJ.js} +18 -18
  104. package/{runtimeDoctorCommands-3VFVTGPI.js → runtimeDoctorCommands-PGAA47G5.js} +5 -5
  105. package/{secretCommands-RLIO3QK5.js → secretCommands-ZCZ4KVET.js} +1 -1
  106. package/{setPrimaryDialogAgentAction-PGBTR247.js → setPrimaryDialogAgentAction-23PMBXWD.js} +1 -1
  107. package/{spaceCommands-4UWABUD7.js → spaceCommands-JMU4R5LB.js} +15 -15
  108. package/{streamAgentChatTurn-2M4L7PF4.js → streamAgentChatTurn-SUWOIV4S.js} +22 -22
  109. package/{tools-GINHFGST.js → tools-JW4EEFK7.js} +13 -13
  110. package/{tuiSummaryLlmCaller-CEIZAKUV.js → tuiSummaryLlmCaller-4QCQ2TIN.js} +6 -6
  111. package/{updateCommands-X23W5F73.js → updateCommands-Q6CYAEYJ.js} +3 -3
  112. package/{updateDialogTitleAction-4EIHKTKR.js → updateDialogTitleAction-EDXTLVGM.js} +4 -4
  113. package/{windowsSelfUpdate-SVJKL6VH.js → windowsSelfUpdate-XSQVF2GK.js} +2 -2
@@ -1,37 +1,48 @@
1
1
  import {
2
2
  resolveAuthGuidanceState
3
- } from "./chunk-YZGNKHUM.js";
3
+ } from "./chunk-3V2QMRNN.js";
4
4
  import {
5
5
  fetchCiStatus,
6
6
  summarizeLatest
7
7
  } from "./chunk-CKAHAVMK.js";
8
8
  import "./chunk-M3JEW6N6.js";
9
+ import {
10
+ runAnthropicOAuthLogin,
11
+ runCursorOAuthLogin,
12
+ runDevinOAuthLogin,
13
+ runXaiOAuthDeviceCode,
14
+ runXaiOAuthLogin,
15
+ syncCredentialToServer
16
+ } from "./chunk-B2WYM23T.js";
17
+ import {
18
+ runCloudflareOAuthLogin
19
+ } from "./chunk-27E2CBBY.js";
9
20
  import {
10
21
  isHiddenFromDialogList,
11
22
  loadLocalRunChildDialogIds,
12
23
  normalizeDialogRecord,
13
24
  readDialogSnapshot,
14
25
  sortDialogs
15
- } from "./chunk-DDVXTOFJ.js";
26
+ } from "./chunk-RIALQUSF.js";
16
27
  import {
17
- formatQuotaSummary,
18
28
  listFavoriteAgentIdsAcrossServers,
19
29
  listLocalCachedAgents,
20
30
  listRemoteAgents,
21
31
  listRemoteAgentsAcrossServers,
22
32
  normalizeListedAgent
23
- } from "./chunk-3ZUXGHFS.js";
33
+ } from "./chunk-2UZ22L3V.js";
24
34
  import "./chunk-ID4G2MAR.js";
25
35
  import {
26
36
  listUserRecordsFromServers,
27
37
  readLiveDbRecordAfterTombstoneMerge
28
- } from "./chunk-BAPZCPYU.js";
38
+ } from "./chunk-4LEGTOSR.js";
29
39
  import {
30
40
  refreshSubscriptionQuotas
31
41
  } from "./chunk-YGILMZ7N.js";
32
42
  import {
33
43
  ANSI_ESCAPE_REGEX,
34
44
  COLLAPSED_PASTE_PLACEHOLDER_RE,
45
+ OWNER_OAUTH_UNAVAILABLE_HINT,
35
46
  THEME_PALETTES,
36
47
  TUI_TREE_MARKER,
37
48
  allocateCollapsedPaste,
@@ -60,6 +71,8 @@ import {
60
71
  getActiveThemeMode,
61
72
  getActiveThemeName,
62
73
  isBalanceExhaustedError,
74
+ isInvalidGrantError,
75
+ isOwnerOAuthUnavailableError,
63
76
  isRunResultStalledOrTruncated,
64
77
  padOrTruncateToWidth,
65
78
  platformCreditsFromUsage,
@@ -102,18 +115,18 @@ import {
102
115
  wrapTextToLines,
103
116
  wrapTranscriptLine,
104
117
  wrapTranscriptLineWithLayout
105
- } from "./chunk-5ZBZHVMF.js";
118
+ } from "./chunk-CAB2CZ5H.js";
106
119
  import "./chunk-6QDYSCPW.js";
107
- import "./chunk-NUAQ3QHF.js";
120
+ import "./chunk-FPCPCTSA.js";
108
121
  import "./chunk-Y5GCAMGP.js";
109
122
  import {
110
123
  getReadableCliDb
111
- } from "./chunk-7DQSP7JU.js";
124
+ } from "./chunk-J5JTMQIA.js";
112
125
  import {
113
126
  deleteDbRecord,
114
127
  queryUserRecords,
115
128
  readDbRecord
116
- } from "./chunk-2PW2KOII.js";
129
+ } from "./chunk-XDMGY5IU.js";
117
130
  import {
118
131
  RUN_WAKE_CHANNEL_ENV,
119
132
  clearCliLocalRuntimePreparedAgentCache,
@@ -123,24 +136,30 @@ import {
123
136
  formatApprovalRemaining,
124
137
  readTimestamp,
125
138
  registerHostApprovalRenderer
126
- } from "./chunk-3UCYYSKN.js";
127
- import "./chunk-LTI5T3A6.js";
139
+ } from "./chunk-35DNCETZ.js";
140
+ import {
141
+ anthropicGrantRemainingMs,
142
+ resolveServerSyncConfig,
143
+ runAntigravityOAuthLogin,
144
+ runOpenAiCodexBrowserPkce,
145
+ runOpenAiCodexDeviceCode
146
+ } from "./chunk-SN5XE6GQ.js";
128
147
  import "./chunk-VP3BINY7.js";
129
- import "./chunk-W45PCJHS.js";
130
- import "./chunk-LKZPX6YH.js";
131
- import "./chunk-U7HTU2S7.js";
132
- import "./chunk-WOAZVUSN.js";
148
+ import "./chunk-R56VAYY4.js";
149
+ import "./chunk-7AUQ3WCW.js";
133
150
  import {
134
151
  NOLO_DEFAULT_AGENT_KEY,
135
152
  resolveCliAgentKeyInput
136
153
  } from "./chunk-NBTY7YJF.js";
154
+ import "./chunk-LKZPX6YH.js";
155
+ import "./chunk-WOAZVUSN.js";
137
156
  import "./chunk-VIWDGTDA.js";
138
157
  import "./chunk-HGDKT2D6.js";
139
158
  import "./chunk-F7CI2ZC5.js";
140
159
  import {
141
160
  defaultOpenBrowser,
142
161
  saveTokenLogin
143
- } from "./chunk-UGCQKKXW.js";
162
+ } from "./chunk-XE4Q46FF.js";
144
163
  import "./chunk-TY3TIUJK.js";
145
164
  import "./chunk-S73EPYNC.js";
146
165
  import "./chunk-RQ22OZD7.js";
@@ -157,20 +176,20 @@ import "./chunk-NEZGPBL7.js";
157
176
  import "./chunk-JEXVIMYZ.js";
158
177
  import {
159
178
  prepareTools
160
- } from "./chunk-LDPZBAQK.js";
179
+ } from "./chunk-YY37MQSS.js";
161
180
  import "./chunk-HS7MLR74.js";
162
- import "./chunk-K7ZZPUNO.js";
181
+ import "./chunk-WWSPE2GG.js";
163
182
  import "./chunk-KFHREHUQ.js";
164
- import "./chunk-L5FZUSB6.js";
183
+ import "./chunk-AD26C3WW.js";
165
184
  import "./chunk-OXME3PEE.js";
166
185
  import "./chunk-KSTEXKL6.js";
167
186
  import "./chunk-Z3MQYKRN.js";
168
- import "./chunk-QSAUX2Q2.js";
187
+ import "./chunk-YCEA47VH.js";
169
188
  import "./chunk-NF64D32W.js";
170
189
  import "./chunk-3L2WKC3W.js";
171
190
  import "./chunk-I5PBXF7O.js";
172
191
  import "./chunk-VF4K2QE6.js";
173
- import "./chunk-IAYMBPDZ.js";
192
+ import "./chunk-QOI7USOV.js";
174
193
  import "./chunk-MYOH447Z.js";
175
194
  import "./chunk-RXUKDHS5.js";
176
195
  import "./chunk-WYKMOZTW.js";
@@ -178,17 +197,17 @@ import "./chunk-AGIM7IMJ.js";
178
197
  import "./chunk-A2ZMIRLN.js";
179
198
  import "./chunk-VIDPVFP3.js";
180
199
  import "./chunk-63W5N6P3.js";
181
- import "./chunk-LKV5K7PW.js";
182
- import "./chunk-SEOM7GLZ.js";
200
+ import "./chunk-MKK2YY5Q.js";
201
+ import "./chunk-COWSUNBH.js";
183
202
  import "./chunk-5XBUWM6I.js";
184
203
  import {
185
204
  estimateMessagesTokens,
186
205
  historyTokensBeforeLatestAssistant
187
- } from "./chunk-ZCKXJTCW.js";
206
+ } from "./chunk-CGQSAFXP.js";
188
207
  import "./chunk-TZXPT53C.js";
189
208
  import "./chunk-LEC5ALIN.js";
190
209
  import "./chunk-523DITKR.js";
191
- import "./chunk-Y3ASVJWL.js";
210
+ import "./chunk-64D757HH.js";
192
211
  import "./chunk-BYXBJQAS.js";
193
212
  import "./chunk-QYPE3TS3.js";
194
213
  import "./chunk-T3U2KQF4.js";
@@ -200,11 +219,11 @@ import "./chunk-ZRAU6T47.js";
200
219
  import "./chunk-4LCOCOR5.js";
201
220
  import "./chunk-OWYYDMGJ.js";
202
221
  import "./chunk-YDH3FDFQ.js";
203
- import "./chunk-LEJSZV6V.js";
204
- import "./chunk-AWVFQMOV.js";
222
+ import "./chunk-P2ZLUIW2.js";
223
+ import "./chunk-ZYKJBRZ3.js";
205
224
  import "./chunk-5ZMIIR23.js";
206
225
  import "./chunk-CVMMWN6P.js";
207
- import "./chunk-P64WRQYV.js";
226
+ import "./chunk-AZMYUSVF.js";
208
227
  import "./chunk-GLKOYSRU.js";
209
228
  import "./chunk-GL7W7TTR.js";
210
229
  import "./chunk-HWZT5DKX.js";
@@ -242,23 +261,24 @@ import {
242
261
  buildLocalWorkspaceOpenAiTools,
243
262
  buildLocalWorkspaceToolset,
244
263
  readCommandActionGatePayload
245
- } from "./chunk-ZRDUMMDG.js";
264
+ } from "./chunk-UTBQCL6N.js";
246
265
  import "./chunk-ZNFJWEN4.js";
247
- import "./chunk-JASKVAYJ.js";
248
- import "./chunk-7NMNKOW5.js";
266
+ import "./chunk-3QKILTO3.js";
267
+ import "./chunk-3IBHFELR.js";
249
268
  import "./chunk-HNUWUO75.js";
250
269
  import "./chunk-CHOZJMJS.js";
251
270
  import "./chunk-PWTNI4N7.js";
252
271
  import "./chunk-Y63ZSOR6.js";
253
- import "./chunk-MNWKNN6V.js";
272
+ import "./chunk-SZ4ADZFT.js";
254
273
  import "./chunk-2WZXXAQD.js";
255
- import "./chunk-JBWLZ3CB.js";
274
+ import "./chunk-DA7CTWT4.js";
256
275
  import "./chunk-4KB6WQUL.js";
257
276
  import "./chunk-56GBUMO5.js";
258
277
  import {
259
278
  CREDENTIAL_HYGIENE_RULE,
260
279
  DELETE_SAFETY_RED_LINE,
261
280
  DISPATCH_BACKEND_POLICY,
281
+ DISPATCH_CANDIDATE_POLICY,
262
282
  PARALLEL_DISPATCH_DEFAULT_RULE,
263
283
  PLATFORM_RISK_CONTROL_RULE,
264
284
  buildConsultationModeBlock,
@@ -266,15 +286,16 @@ import {
266
286
  buildRuntimeGuidanceBlocks,
267
287
  resolveResponseGuidelines,
268
288
  resolveToolGuidedSections
269
- } from "./chunk-6AMR3AE6.js";
289
+ } from "./chunk-UZT65S6D.js";
270
290
  import "./chunk-CVCRAO6Q.js";
271
291
  import "./chunk-E2BESSAW.js";
272
- import "./chunk-2Q3LOAFE.js";
292
+ import "./chunk-6HVBI6TI.js";
273
293
  import {
294
+ formatQuotaSummary,
274
295
  isQuotaExhaustedError
275
- } from "./chunk-7LJEJV4F.js";
296
+ } from "./chunk-GMEAELJ6.js";
276
297
  import "./chunk-WJZOQR2J.js";
277
- import "./chunk-XNOILBHV.js";
298
+ import "./chunk-CKOO42G5.js";
278
299
  import "./chunk-2MBTWINN.js";
279
300
  import {
280
301
  extractReferenceKeysFromMessage,
@@ -305,7 +326,10 @@ import {
305
326
  compactWhitespace
306
327
  } from "./chunk-DWLEOOGR.js";
307
328
  import "./chunk-7DPNBQSV.js";
308
- import "./chunk-G7Y4GXTY.js";
329
+ import {
330
+ createOAuthTokenStore,
331
+ isTokenExpired
332
+ } from "./chunk-G7Y4GXTY.js";
309
333
  import {
310
334
  buildMemoryOverlayLayer,
311
335
  buildMemoryUseGuidanceLayer,
@@ -330,7 +354,7 @@ import {
330
354
  extractCustomId,
331
355
  parsePublicAgentId
332
356
  } from "./chunk-M2EJHDJP.js";
333
- import "./chunk-YF4ZRVP3.js";
357
+ import "./chunk-PLYWH7XM.js";
334
358
  import {
335
359
  TAIL_LINES_MAX,
336
360
  backfillRunRecordParentDialog,
@@ -338,7 +362,7 @@ import {
338
362
  isRunRecordClaimed,
339
363
  listRunRecords,
340
364
  readRunRecord
341
- } from "./chunk-PK5TD4ST.js";
365
+ } from "./chunk-C2XZM3K4.js";
342
366
  import {
343
367
  clipText,
344
368
  formatDuration,
@@ -359,10 +383,10 @@ import {
359
383
  import "./chunk-6UBGXX2W.js";
360
384
  import {
361
385
  resolvePlatformAuthToken
362
- } from "./chunk-WPOKOKZA.js";
386
+ } from "./chunk-PV6JJAUB.js";
363
387
  import "./chunk-YUA6OAH5.js";
364
388
  import "./chunk-SM3NSZJV.js";
365
- import "./chunk-5BHQICF2.js";
389
+ import "./chunk-JRTNUU5Z.js";
366
390
  import {
367
391
  toErrorMessage
368
392
  } from "./chunk-HNMXYYJR.js";
@@ -377,7 +401,7 @@ import {
377
401
  import {
378
402
  checkForCliUpdate,
379
403
  runSelfUpdateDetailed
380
- } from "./chunk-EVG6HQQ7.js";
404
+ } from "./chunk-JBOUVTZX.js";
381
405
  import {
382
406
  parseUserIdFromAuthToken,
383
407
  resolveAuthToken,
@@ -410,14 +434,14 @@ import {
410
434
  resolveDefaultSpawn,
411
435
  spawnProcess
412
436
  } from "./chunk-4O22PGNQ.js";
413
- import "./chunk-7T5TLIY4.js";
437
+ import "./chunk-LKDF3ATR.js";
414
438
  import {
415
439
  dailyWelcomeTip,
416
440
  initCliLocale,
417
441
  parseCliLocale,
418
442
  setCliLocale,
419
443
  t
420
- } from "./chunk-PPCUXO3E.js";
444
+ } from "./chunk-3RQVYR4B.js";
421
445
  import "./chunk-ECX3NKRD.js";
422
446
  import "./chunk-XJWWBO34.js";
423
447
  import "./chunk-I42VC5KR.js";
@@ -6435,6 +6459,7 @@ var SLASH_COMMANDS = [
6435
6459
  "/skill",
6436
6460
  "/customize",
6437
6461
  "/login",
6462
+ "/auth",
6438
6463
  "/profile",
6439
6464
  "/update",
6440
6465
  "/version",
@@ -8138,6 +8163,7 @@ function buildCliEstimateSystemText(opts = {}) {
8138
8163
  CREDENTIAL_HYGIENE_RULE,
8139
8164
  PARALLEL_DISPATCH_DEFAULT_RULE,
8140
8165
  DISPATCH_BACKEND_POLICY,
8166
+ DISPATCH_CANDIDATE_POLICY,
8141
8167
  PLATFORM_RISK_CONTROL_RULE,
8142
8168
  buildConsultationModeBlock(),
8143
8169
  prompt,
@@ -9241,6 +9267,13 @@ ${t("autoUsage")}` };
9241
9267
  action: { type: "login", args: rest }
9242
9268
  };
9243
9269
  }
9270
+ case "/auth": {
9271
+ return {
9272
+ nextState: state,
9273
+ output: "",
9274
+ action: { type: "auth", args: rest }
9275
+ };
9276
+ }
9244
9277
  case "/profile":
9245
9278
  return {
9246
9279
  nextState: state,
@@ -13008,7 +13041,16 @@ async function runOneAgentTurn(ctx, inputMsg, imageUrls, actionGateHandler, conf
13008
13041
  });
13009
13042
  scheduleTitlePatchSync(runResult);
13010
13043
  if (!wasAborted && runResult.exitCode !== 0) {
13011
- if (isBalanceExhaustedError(runResult.localError) && runResult.dialogId) {
13044
+ if (isOwnerOAuthUnavailableError(runResult.localError)) {
13045
+ ctx.emitCommandOutput(OWNER_OAUTH_UNAVAILABLE_HINT);
13046
+ } else if (isInvalidGrantError(runResult.localError)) {
13047
+ const provider = "claude";
13048
+ ctx.emitCommandOutput(t("auth.grantExpiredHint", provider));
13049
+ ctx.state = {
13050
+ ...ctx.state,
13051
+ suggestedAuthCommand: `/auth ${provider}`
13052
+ };
13053
+ } else if (isBalanceExhaustedError(runResult.localError) && runResult.dialogId) {
13012
13054
  ctx.emitCommandOutput(t("balanceExhaustedHint"));
13013
13055
  } else if (isQuotaExhaustedError(runResult.localError)) {
13014
13056
  ctx.emitCommandOutput(t("quotaExhaustedHint"));
@@ -13333,8 +13375,8 @@ function openVisibleUrlAtScreen(history, contentWidth, scrollTop, screenRow, scr
13333
13375
  }
13334
13376
 
13335
13377
  // packages/cli/tui/tuiRender.ts
13336
- function createTuiRender(host) {
13337
- const { output, history, selectionState } = host;
13378
+ function createTuiRender(host2) {
13379
+ const { output, history, selectionState } = host2;
13338
13380
  const RENDER_THROTTLE_MS = 33;
13339
13381
  let renderScheduled = false;
13340
13382
  let renderTimer = null;
@@ -13349,15 +13391,15 @@ function createTuiRender(host) {
13349
13391
  paintSyncedFrame();
13350
13392
  };
13351
13393
  const paintSyncedFrame = () => {
13352
- if (host.fixedInput.isPaused()) {
13353
- host.imageRenderer?.suspend();
13394
+ if (host2.fixedInput.isPaused()) {
13395
+ host2.imageRenderer?.suspend();
13354
13396
  return;
13355
13397
  }
13356
13398
  output.write("\x1B[?2026h\x1B[?25l");
13357
13399
  try {
13358
13400
  renderHistoryToOutput();
13359
- if (host.fixedInput.active)
13360
- host.fixedInput.repaint(host.buffer, host.cursorPos);
13401
+ if (host2.fixedInput.active)
13402
+ host2.fixedInput.repaint(host2.buffer, host2.cursorPos);
13361
13403
  } finally {
13362
13404
  output.write("\x1B[?25h\x1B[?2026l");
13363
13405
  }
@@ -13375,12 +13417,12 @@ function createTuiRender(host) {
13375
13417
  if (syncingLayout) return;
13376
13418
  syncingLayout = true;
13377
13419
  try {
13378
- const reservedRows = host.getReservedRows?.() ?? 0;
13379
- const imageRenderer = host.imageRenderer;
13420
+ const reservedRows = host2.getReservedRows?.() ?? 0;
13421
+ const imageRenderer = host2.imageRenderer;
13380
13422
  renderHistory(
13381
13423
  output,
13382
13424
  history,
13383
- host.fixedInput.getInputLines(),
13425
+ host2.fixedInput.getInputLines(),
13384
13426
  selectionState,
13385
13427
  reservedRows,
13386
13428
  imageRenderer && withImages ? {
@@ -13392,15 +13434,15 @@ function createTuiRender(host) {
13392
13434
  }
13393
13435
  };
13394
13436
  const renderHistoryToOutput = () => {
13395
- if (host.fixedInput.isPaused()) {
13396
- host.imageRenderer?.suspend();
13437
+ if (host2.fixedInput.isPaused()) {
13438
+ host2.imageRenderer?.suspend();
13397
13439
  return;
13398
13440
  }
13399
- host.imageRenderer?.resume();
13441
+ host2.imageRenderer?.resume();
13400
13442
  renderHistoryCore(true);
13401
13443
  };
13402
13444
  const renderHistoryUnderDialog = () => {
13403
- host.imageRenderer?.suspend();
13445
+ host2.imageRenderer?.suspend();
13404
13446
  renderHistoryCore(false);
13405
13447
  };
13406
13448
  return {
@@ -14369,6 +14411,346 @@ async function runTuiLogin(args, emit, deps = {}) {
14369
14411
  }
14370
14412
  }
14371
14413
 
14414
+ // packages/cli/tui/tuiAuth.ts
14415
+ var TUI_AUTH_PROVIDERS = [
14416
+ "claude",
14417
+ "chatgpt",
14418
+ "antigravity",
14419
+ "xai",
14420
+ "cursor",
14421
+ "devin"
14422
+ ];
14423
+ var PROVIDER_DISPLAY_NAMES = {
14424
+ claude: "Claude (Anthropic)",
14425
+ chatgpt: "ChatGPT (OpenAI)",
14426
+ antigravity: "Antigravity (Google)",
14427
+ xai: "xAI (Grok)",
14428
+ cursor: "Cursor",
14429
+ devin: "Devin",
14430
+ cloudflare: "Cloudflare"
14431
+ };
14432
+ function strWidth(str) {
14433
+ let w = 0;
14434
+ for (const ch of str) {
14435
+ w += ch.charCodeAt(0) > 255 ? 2 : 1;
14436
+ }
14437
+ return w;
14438
+ }
14439
+ function padRight(str, width) {
14440
+ const diff = width - strWidth(str);
14441
+ return diff > 0 ? str + " ".repeat(diff) : str;
14442
+ }
14443
+ function formatGrantRemaining(provider, credential, now) {
14444
+ if (provider !== "claude" || !credential) return "-";
14445
+ const rem = anthropicGrantRemainingMs(credential, now);
14446
+ if (rem === void 0) return "-";
14447
+ if (rem <= 0) return t("auth.grantExpired");
14448
+ const days = Math.floor(rem / (24 * 3600 * 1e3));
14449
+ const hours = Math.floor(rem % (24 * 3600 * 1e3) / (3600 * 1e3));
14450
+ if (days > 0) return `${days}d ${hours}h`;
14451
+ const minutes = Math.floor(rem / (60 * 1e3));
14452
+ if (minutes > 0) return `${minutes}m`;
14453
+ return "<1m";
14454
+ }
14455
+ function formatLocalStatus(credential, now) {
14456
+ if (!credential) return t("auth.statusUnauthenticated");
14457
+ if (isTokenExpired(credential, 0, now)) return t("auth.statusExpired");
14458
+ return t("auth.statusAuthenticated");
14459
+ }
14460
+ function formatServerSyncStatus(credential) {
14461
+ if (!credential) return "-";
14462
+ if (credential.serverManaged) {
14463
+ return t("auth.syncStatusSynced");
14464
+ }
14465
+ return t("auth.syncStatusNotSynced");
14466
+ }
14467
+ function toAuthProviderPickerItems(tokenStore, now = Date.now()) {
14468
+ return TUI_AUTH_PROVIDERS.map((provider) => {
14469
+ const cred = tokenStore.read(provider);
14470
+ const isAuthed = cred && !isTokenExpired(cred, 0, now);
14471
+ const isExp = cred && isTokenExpired(cred, 0, now);
14472
+ const statusLabel = isAuthed ? `\u2713 ${t("auth.statusAuthenticated")}` : isExp ? `\u26A0 ${t("auth.statusExpired")}` : t("auth.statusUnauthenticated");
14473
+ const brandName = PROVIDER_DISPLAY_NAMES[provider] ?? provider;
14474
+ const label = `${padRight(brandName, 26)} ${statusLabel}`;
14475
+ const grantPart = formatGrantRemaining(provider, cred, now);
14476
+ const syncPart = formatServerSyncStatus(cred);
14477
+ const detailParts = [];
14478
+ if (provider === "claude" && cred && grantPart !== "-") {
14479
+ detailParts.push(`${t("auth.statusColGrantRemaining")}: ${grantPart}`);
14480
+ }
14481
+ if (cred && syncPart !== "-") {
14482
+ detailParts.push(syncPart);
14483
+ }
14484
+ const detail = detailParts.length > 0 ? detailParts.join(" \xB7 ") : void 0;
14485
+ return {
14486
+ label,
14487
+ ...detail ? { detail } : {},
14488
+ provider
14489
+ };
14490
+ });
14491
+ }
14492
+ async function promptSelectProvider(deps, tokenStore, now = Date.now()) {
14493
+ const items = toAuthProviderPickerItems(tokenStore, now);
14494
+ if (deps.selectProvider) {
14495
+ return deps.selectProvider(items);
14496
+ }
14497
+ if (deps.dialogHost) {
14498
+ const pickResult = await deps.dialogHost.run(
14499
+ (anchor) => runSelectDialog({
14500
+ items,
14501
+ initialIndex: 0,
14502
+ titleLines: [renderDialogTitle(t("auth.pickerTitle"))],
14503
+ input: deps.input ?? process.stdin,
14504
+ output: deps.output ?? process.stdout,
14505
+ ...anchor
14506
+ })
14507
+ );
14508
+ if (pickResult.kind === "selected") {
14509
+ return pickResult.item.provider;
14510
+ }
14511
+ return null;
14512
+ }
14513
+ return null;
14514
+ }
14515
+ function renderAuthStatusPanel(tokenStore, now = Date.now()) {
14516
+ const headers = [
14517
+ t("auth.statusColProvider"),
14518
+ t("auth.statusColLocalStatus"),
14519
+ t("auth.statusColGrantRemaining"),
14520
+ t("auth.statusColServerSync")
14521
+ ];
14522
+ const rows = TUI_AUTH_PROVIDERS.map((provider) => {
14523
+ const cred = tokenStore.read(provider);
14524
+ return [
14525
+ provider,
14526
+ formatLocalStatus(cred, now),
14527
+ formatGrantRemaining(provider, cred, now),
14528
+ formatServerSyncStatus(cred)
14529
+ ];
14530
+ });
14531
+ const colWidths = headers.map((header, colIndex) => {
14532
+ let max = strWidth(header);
14533
+ for (const row of rows) {
14534
+ const cellWidth = strWidth(row[colIndex] ?? "");
14535
+ if (cellWidth > max) max = cellWidth;
14536
+ }
14537
+ return Math.max(max, 10);
14538
+ });
14539
+ const formatLine = (cells) => cells.map((cell, i) => padRight(cell, colWidths[i] + 2)).join("").trimEnd();
14540
+ const lines = [
14541
+ t("auth.statusTitle"),
14542
+ "",
14543
+ formatLine(headers),
14544
+ formatLine(colWidths.map((w) => "-".repeat(w)))
14545
+ ];
14546
+ for (const row of rows) {
14547
+ lines.push(formatLine(row));
14548
+ }
14549
+ lines.push("");
14550
+ lines.push(t("auth.statusBottomHint"));
14551
+ return lines.join("\n");
14552
+ }
14553
+ function classifyAuthFlowError(err, provider) {
14554
+ const msg = err instanceof Error ? err.message : String(err);
14555
+ if (/state verification failed|state mismatch|invalid_state/i.test(msg)) {
14556
+ return t("auth.errorStateMismatch", provider);
14557
+ }
14558
+ if (/denied|cancelled|canceled|rejected|access_denied|abort/i.test(msg)) {
14559
+ return t("auth.errorCancelled", provider);
14560
+ }
14561
+ if (/invalid_grant|expired|revoked|refresh[_ ]token.*(expired|invalid)/i.test(msg)) {
14562
+ return t("auth.errorGrantExpired", provider);
14563
+ }
14564
+ if (/fetch failed|econnrefused|enotfound|etimedout|timeout|network|socket|ehostunreach/i.test(
14565
+ msg
14566
+ )) {
14567
+ return t("auth.errorNetwork");
14568
+ }
14569
+ return t("auth.commandFailed", provider, msg);
14570
+ }
14571
+ async function runTuiAuthLogout(provider, emit, deps = {}) {
14572
+ const tokenStore = deps.tokenStore ?? createOAuthTokenStore();
14573
+ const credential = tokenStore.read(provider);
14574
+ if (!credential) {
14575
+ emit(t("auth.noLocalCredential", provider));
14576
+ return { status: "failed", reason: "no_credential" };
14577
+ }
14578
+ const wasServerManaged = Boolean(credential.serverManaged);
14579
+ tokenStore.remove(provider);
14580
+ if (wasServerManaged) {
14581
+ emit(t("auth.logoutLocalWithServerNotice", provider));
14582
+ } else {
14583
+ emit(t("auth.logoutSuccess", provider));
14584
+ }
14585
+ return { status: "logout-success" };
14586
+ }
14587
+ async function runTuiAuth(args, emit, deps = {}) {
14588
+ const tokenStore = deps.tokenStore ?? createOAuthTokenStore();
14589
+ const now = deps.now?.() ?? Date.now();
14590
+ if (args.length === 0) {
14591
+ if (deps.selectProvider || deps.dialogHost) {
14592
+ const selected = await promptSelectProvider(deps, tokenStore, now);
14593
+ if (!selected) {
14594
+ return { status: "failed", reason: "cancelled" };
14595
+ }
14596
+ return runTuiAuth([selected], emit, deps);
14597
+ }
14598
+ const panel = renderAuthStatusPanel(tokenStore, now);
14599
+ emit(panel);
14600
+ return { status: "status-rendered" };
14601
+ }
14602
+ const [subCommand, ...rest] = args;
14603
+ if (subCommand === "logout") {
14604
+ const target = rest[0]?.toLowerCase();
14605
+ if (!target || !isValidProvider(target)) {
14606
+ emit(t("auth.unknownProvider", target ?? "", TUI_AUTH_PROVIDERS.join(", ")));
14607
+ return { status: "failed", reason: "unknown_provider" };
14608
+ }
14609
+ return runTuiAuthLogout(target, emit, deps);
14610
+ }
14611
+ const provider = subCommand.toLowerCase();
14612
+ if (!isValidProvider(provider)) {
14613
+ emit(t("auth.unknownProvider", provider, TUI_AUTH_PROVIDERS.join(", ")));
14614
+ return { status: "failed", reason: "unknown_provider" };
14615
+ }
14616
+ const flowDeps = {
14617
+ ...deps.fetchImpl ? { fetchImpl: deps.fetchImpl } : {},
14618
+ ...deps.sleep ? { sleep: deps.sleep } : {},
14619
+ ...deps.now ? { now: deps.now } : {},
14620
+ readLine: async (rawPrompt) => {
14621
+ const prompt = t("auth.pasteCallbackPrompt");
14622
+ if (deps.readLine) {
14623
+ return deps.readLine(prompt);
14624
+ }
14625
+ if (deps.dialogHost) {
14626
+ return deps.dialogHost.withKeyboard(async () => {
14627
+ const readline2 = await import("node:readline/promises");
14628
+ const rl2 = readline2.createInterface({
14629
+ input: deps.input ?? process.stdin,
14630
+ output: deps.output ?? process.stdout
14631
+ });
14632
+ try {
14633
+ return await rl2.question(prompt);
14634
+ } finally {
14635
+ rl2.close();
14636
+ }
14637
+ });
14638
+ }
14639
+ const readline = await import("node:readline/promises");
14640
+ const rl = readline.createInterface({
14641
+ input: deps.input ?? process.stdin,
14642
+ output: deps.output ?? process.stdout
14643
+ });
14644
+ try {
14645
+ return await rl.question(prompt);
14646
+ } finally {
14647
+ rl.close();
14648
+ }
14649
+ },
14650
+ ...deps.manualCode || rest.includes("--manual") || rest.includes("--no-browser") ? { manualCode: true } : {},
14651
+ openBrowser: deps.openBrowser ?? defaultOpenBrowser,
14652
+ output: { log: (msg) => emit(redactSecrets(String(msg))) },
14653
+ error: { error: (msg) => emit(redactSecrets(String(msg))) }
14654
+ };
14655
+ let credential;
14656
+ try {
14657
+ if (provider === "claude") {
14658
+ credential = await runAnthropicOAuthLogin(flowDeps);
14659
+ } else if (provider === "chatgpt") {
14660
+ const useDeviceCode = rest.includes("--device-code");
14661
+ credential = useDeviceCode ? await runOpenAiCodexDeviceCode(flowDeps) : await runOpenAiCodexBrowserPkce(flowDeps);
14662
+ } else if (provider === "xai") {
14663
+ const useDeviceCode = rest.includes("--device-code");
14664
+ credential = useDeviceCode ? await runXaiOAuthDeviceCode(flowDeps) : await runXaiOAuthLogin(flowDeps);
14665
+ } else if (provider === "cursor") {
14666
+ credential = await runCursorOAuthLogin(flowDeps);
14667
+ } else if (provider === "devin") {
14668
+ credential = await runDevinOAuthLogin(flowDeps);
14669
+ } else if (provider === "cloudflare") {
14670
+ credential = await runCloudflareOAuthLogin(flowDeps);
14671
+ } else {
14672
+ credential = await runAntigravityOAuthLogin(flowDeps);
14673
+ }
14674
+ } catch (err) {
14675
+ const errorText = classifyAuthFlowError(err, provider);
14676
+ emit(redactSecrets(errorText));
14677
+ return {
14678
+ status: "failed",
14679
+ reason: err instanceof Error ? err.message : String(err)
14680
+ };
14681
+ }
14682
+ tokenStore.write(provider, credential);
14683
+ const accountLabel = credential.metadata?.email ?? credential.accountId ?? "";
14684
+ emit(
14685
+ t(
14686
+ "auth.authorizationSaved",
14687
+ provider,
14688
+ accountLabel ? t("auth.authorizationSavedForAccount", accountLabel) : ""
14689
+ )
14690
+ );
14691
+ const hasExplicitNoSync = rest.includes("--no-sync-to-server");
14692
+ const hasExplicitSync = rest.includes("--sync-to-server");
14693
+ let shouldSync = false;
14694
+ if (hasExplicitNoSync) {
14695
+ shouldSync = false;
14696
+ } else if (hasExplicitSync) {
14697
+ shouldSync = true;
14698
+ } else {
14699
+ const syncConfig = (deps.resolveServerSyncConfig ?? resolveServerSyncConfig)();
14700
+ if (!syncConfig) {
14701
+ emit(t("auth.noServerConfigured", provider));
14702
+ shouldSync = false;
14703
+ } else {
14704
+ const question = t(
14705
+ "auth.syncPromptQuestion",
14706
+ syncConfig.serverOrigin,
14707
+ provider
14708
+ );
14709
+ if (deps.promptSync) {
14710
+ shouldSync = await deps.promptSync(question);
14711
+ } else if (deps.dialogHost) {
14712
+ const syncResult = await deps.dialogHost.run(
14713
+ (anchor) => runSelectDialog({
14714
+ items: [
14715
+ { label: t("auth.syncOptionNo"), value: false },
14716
+ { label: t("auth.syncOptionYes"), value: true }
14717
+ ],
14718
+ initialIndex: 0,
14719
+ titleLines: [renderDialogTitle(question)],
14720
+ input: deps.input ?? process.stdin,
14721
+ output: deps.output ?? process.stdout,
14722
+ ...anchor
14723
+ })
14724
+ );
14725
+ shouldSync = syncResult.kind === "selected" ? syncResult.item.value : false;
14726
+ } else if (deps.readLine) {
14727
+ const raw = await deps.readLine(question);
14728
+ const trimmed = raw.trim().toLowerCase();
14729
+ shouldSync = trimmed === "y" || trimmed === "yes";
14730
+ } else {
14731
+ shouldSync = false;
14732
+ }
14733
+ }
14734
+ }
14735
+ if (shouldSync) {
14736
+ const syncFn = deps.syncCredentialToServer ?? syncCredentialToServer;
14737
+ const syncResult = await syncFn(provider, credential, {
14738
+ ...deps,
14739
+ output: flowDeps.output,
14740
+ error: flowDeps.error
14741
+ });
14742
+ if (syncResult === "mark_failed") {
14743
+ emit(t("auth.markFailed"));
14744
+ }
14745
+ } else if (!hasExplicitNoSync) {
14746
+ emit(t("auth.notSyncedToServer", provider));
14747
+ }
14748
+ return { status: "success", credential };
14749
+ }
14750
+ function isValidProvider(provider) {
14751
+ return TUI_AUTH_PROVIDERS.includes(provider) || provider === "cloudflare";
14752
+ }
14753
+
14372
14754
  // packages/cli/tui/dialogPicker.ts
14373
14755
  var DEFAULT_PICKER_LIMIT = 20;
14374
14756
  var PICKER_OVERSAMPLE_FACTOR = 5;
@@ -14532,7 +14914,7 @@ ${content}`);
14532
14914
  }
14533
14915
  return parts.join("\n\n");
14534
14916
  };
14535
- async function runSubmittedSlashLine(line, host, actionGateHandler, confirmDestructiveAction) {
14917
+ async function runSubmittedSlashLine(line, host2, actionGateHandler, confirmDestructiveAction) {
14536
14918
  const {
14537
14919
  history,
14538
14920
  pasteStore,
@@ -14554,21 +14936,21 @@ async function runSubmittedSlashLine(line, host, actionGateHandler, confirmDestr
14554
14936
  selfUpdater,
14555
14937
  spawnRunner,
14556
14938
  installAltScreenRestoreHandlers: installAltScreenRestoreHandlers2
14557
- } = host;
14558
- const result = handleTuiInput2(line, host.state, collectConversationTurns(host.history));
14559
- const previousState = host.state;
14560
- const previousAgentKey = host.state.agentKey;
14561
- host.state = result.nextState;
14562
- if (previousState.permissionGrants?.remote === true && host.state.permissionGrants?.remote !== true) {
14563
- host.revokeRemoteShellGrants?.();
14564
- }
14565
- if (!persistPermissionGrantChanges(previousState.permissionGrants, host.state.permissionGrants)) {
14939
+ } = host2;
14940
+ const result = handleTuiInput2(line, host2.state, collectConversationTurns(host2.history));
14941
+ const previousState = host2.state;
14942
+ const previousAgentKey = host2.state.agentKey;
14943
+ host2.state = result.nextState;
14944
+ if (previousState.permissionGrants?.remote === true && host2.state.permissionGrants?.remote !== true) {
14945
+ host2.revokeRemoteShellGrants?.();
14946
+ }
14947
+ if (!persistPermissionGrantChanges(previousState.permissionGrants, host2.state.permissionGrants)) {
14566
14948
  emitCommandOutput(t("autoPersistFailed"));
14567
14949
  }
14568
14950
  const command = line.trim().split(/\s+/)[0];
14569
14951
  if ((command === "/agent" || command === "/switch") && result.nextState !== previousState) {
14570
14952
  clearCliLocalRuntimePreparedAgentCache();
14571
- persistAgentSelection2(host.state, options.env ?? process.env);
14953
+ persistAgentSelection2(host2.state, options.env ?? process.env);
14572
14954
  }
14573
14955
  const interactive = isInteractiveInput(input);
14574
14956
  const isChatAction = result.action?.type === "chat";
@@ -14578,7 +14960,7 @@ async function runSubmittedSlashLine(line, host, actionGateHandler, confirmDestr
14578
14960
  interactive && !isChatAction ? line.trim() : ""
14579
14961
  );
14580
14962
  }
14581
- if (host.state.agentKey !== previousAgentKey) {
14963
+ if (host2.state.agentKey !== previousAgentKey) {
14582
14964
  persistExplicitAgentSwitch(previousAgentKey);
14583
14965
  }
14584
14966
  if (result.action?.type === "exit") {
@@ -14597,7 +14979,7 @@ async function runSubmittedSlashLine(line, host, actionGateHandler, confirmDestr
14597
14979
  deleteOptions: { type: "messages" },
14598
14980
  authToken,
14599
14981
  fetchImpl,
14600
- serverUrl: host.state.serverUrl
14982
+ serverUrl: host2.state.serverUrl
14601
14983
  });
14602
14984
  emitCommandOutput(t("clearedDialog"));
14603
14985
  } catch (error) {
@@ -14608,8 +14990,8 @@ async function runSubmittedSlashLine(line, host, actionGateHandler, confirmDestr
14608
14990
  }
14609
14991
  clearCollapsedPasteStore(pasteStore);
14610
14992
  bumpDraftEpoch();
14611
- host.state = {
14612
- ...host.state,
14993
+ host2.state = {
14994
+ ...host2.state,
14613
14995
  turnTokens: void 0,
14614
14996
  lastAuthorityTurnCount: void 0,
14615
14997
  liveTurnEstimatedTokens: void 0,
@@ -14621,13 +15003,13 @@ async function runSubmittedSlashLine(line, host, actionGateHandler, confirmDestr
14621
15003
  cachedMemoryOverlay: void 0,
14622
15004
  // 新对话重新加载记忆
14623
15005
  estimatedContextTokens: estimateDefaultCliContextTokens({
14624
- cwd: host.state.cwd,
14625
- agentKey: host.state.agentKey,
14626
- userLanguage: host.state.userLanguage,
15006
+ cwd: host2.state.cwd,
15007
+ agentKey: host2.state.agentKey,
15008
+ userLanguage: host2.state.userLanguage,
14627
15009
  responseViewport: TUI_RESPONSE_VIEWPORT,
14628
15010
  ...resolveAgentModelIdentity({
14629
- agentKey: host.state.agentKey,
14630
- agentName: host.state.agentName
15011
+ agentKey: host2.state.agentKey,
15012
+ agentName: host2.state.agentName
14631
15013
  })
14632
15014
  })
14633
15015
  };
@@ -14648,7 +15030,7 @@ async function runSubmittedSlashLine(line, host, actionGateHandler, confirmDestr
14648
15030
  if (result.action?.type === "learn-history") {
14649
15031
  const token = resolvePlatformAuthToken(options.env ?? {});
14650
15032
  try {
14651
- const response = await fetchImpl(new URL("/api/agent/runs/control", host.state.serverUrl), {
15033
+ const response = await fetchImpl(new URL("/api/agent/runs/control", host2.state.serverUrl), {
14652
15034
  method: "POST",
14653
15035
  headers: { "Content-Type": "application/json", ...token ? { Authorization: `Bearer ${token}` } : {} },
14654
15036
  body: JSON.stringify({ action: "learn", limit: result.action.limit }),
@@ -14690,7 +15072,7 @@ async function runSubmittedSlashLine(line, host, actionGateHandler, confirmDestr
14690
15072
  const compactStart = Date.now();
14691
15073
  try {
14692
15074
  const compactResult = await runner({
14693
- serverUrl: host.state.serverUrl,
15075
+ serverUrl: host2.state.serverUrl,
14694
15076
  authToken,
14695
15077
  dialogId: result.action.dialogId,
14696
15078
  summaryLlmCaller: options.summaryLlmCaller,
@@ -14702,12 +15084,12 @@ async function runSubmittedSlashLine(line, host, actionGateHandler, confirmDestr
14702
15084
  }
14703
15085
  });
14704
15086
  const elapsedSec = ((Date.now() - compactStart) / 1e3).toFixed(1);
14705
- host.state = {
14706
- ...host.state,
15087
+ host2.state = {
15088
+ ...host2.state,
14707
15089
  dialogId: compactResult.dialogId,
14708
15090
  dialogKey: compactResult.dialogKey,
14709
15091
  dialogLabel: compactResult.dialogId,
14710
- dialogTitle: host.state.dialogTitle,
15092
+ dialogTitle: host2.state.dialogTitle,
14711
15093
  // Compact forks into a fresh dialog that only inherits the summary,
14712
15094
  // not the full message history. Drop usage-derived context so the
14713
15095
  // composer chip falls back to the default CLI surface estimate and
@@ -14723,17 +15105,17 @@ async function runSubmittedSlashLine(line, host, actionGateHandler, confirmDestr
14723
15105
  cachedMemoryOverlay: void 0,
14724
15106
  // compact 创建新 dialog,重新加载记忆
14725
15107
  estimatedContextTokens: estimateDefaultCliContextTokens({
14726
- cwd: host.state.cwd,
14727
- agentKey: host.state.agentKey,
14728
- userLanguage: host.state.userLanguage,
15108
+ cwd: host2.state.cwd,
15109
+ agentKey: host2.state.agentKey,
15110
+ userLanguage: host2.state.userLanguage,
14729
15111
  responseViewport: TUI_RESPONSE_VIEWPORT,
14730
15112
  messages: [
14731
15113
  ...compactResult.summary ? [{ role: "system", content: compactResult.summary }] : [],
14732
- ...compactResult.compactedMessageCount > 0 ? host.history.turns.slice(compactResult.compactedMessageCount) : compactResult.summaryGenerated ? [] : host.history.turns
15114
+ ...compactResult.compactedMessageCount > 0 ? host2.history.turns.slice(compactResult.compactedMessageCount) : compactResult.summaryGenerated ? [] : host2.history.turns
14733
15115
  ],
14734
15116
  ...resolveAgentModelIdentity({
14735
- agentKey: host.state.agentKey,
14736
- agentName: host.state.agentName
15117
+ agentKey: host2.state.agentKey,
15118
+ agentName: host2.state.agentName
14737
15119
  })
14738
15120
  })
14739
15121
  };
@@ -14794,8 +15176,8 @@ async function runSubmittedSlashLine(line, host, actionGateHandler, confirmDestr
14794
15176
  }
14795
15177
  if (result.action?.type === "cwd-refresh") {
14796
15178
  if ((options.env?.NOLO_CLI_GIT_STATUS ?? process.env.NOLO_CLI_GIT_STATUS) !== "0") {
14797
- const gitStatus = await detectGitStatusAsync(host.state.cwd);
14798
- host.state = { ...host.state, gitStatus };
15179
+ const gitStatus = await detectGitStatusAsync(host2.state.cwd);
15180
+ host2.state = { ...host2.state, gitStatus };
14799
15181
  }
14800
15182
  if (result.action.switchMessage) {
14801
15183
  emitCommandOutput(result.action.switchMessage);
@@ -14805,24 +15187,24 @@ async function runSubmittedSlashLine(line, host, actionGateHandler, confirmDestr
14805
15187
  if (result.action?.type === "switch-agent") {
14806
15188
  const query = result.action.target;
14807
15189
  try {
14808
- const entries = await (host.loadAgentCatalog ?? loadAgentCatalog)({
15190
+ const entries = await (host2.loadAgentCatalog ?? loadAgentCatalog)({
14809
15191
  env: options.env ?? process.env,
14810
- currentKey: host.state.agentKey,
15192
+ currentKey: host2.state.agentKey,
14811
15193
  fetchImpl,
14812
- fallbackFetchImpl: host.fallbackFetchImpl,
15194
+ fallbackFetchImpl: host2.fallbackFetchImpl,
14813
15195
  fresh: true
14814
15196
  });
14815
15197
  const target = resolveAgentSwitchTarget(query, entries);
14816
15198
  if (!target || !entries.some((entry) => entry.key === target.key)) {
14817
15199
  emitCommandOutput(t("agentUnknown", query));
14818
15200
  } else {
14819
- const nextState = applyAgentSwitchState(host.state, target, host.history.turns);
14820
- const oldKey = host.state.agentKey;
14821
- host.state = nextState;
15201
+ const nextState = applyAgentSwitchState(host2.state, target, host2.history.turns);
15202
+ const oldKey = host2.state.agentKey;
15203
+ host2.state = nextState;
14822
15204
  clearCliLocalRuntimePreparedAgentCache();
14823
- persistAgentSelection2(host.state, options.env ?? process.env);
14824
- if (host.state.agentKey !== oldKey) persistExplicitAgentSwitch(oldKey);
14825
- emitCommandOutput(formatAgentSwitchMessage({ name: target.name, dialogId: host.state.dialogId }));
15205
+ persistAgentSelection2(host2.state, options.env ?? process.env);
15206
+ if (host2.state.agentKey !== oldKey) persistExplicitAgentSwitch(oldKey);
15207
+ emitCommandOutput(formatAgentSwitchMessage({ name: target.name, dialogId: host2.state.dialogId }));
14826
15208
  }
14827
15209
  } catch (error) {
14828
15210
  emitCommandOutput(`[nolo] Agent switch failed: ${toErrorMessage(error)}`);
@@ -14832,7 +15214,7 @@ async function runSubmittedSlashLine(line, host, actionGateHandler, confirmDestr
14832
15214
  try {
14833
15215
  const pickResult = await dialogHost.run(
14834
15216
  (anchor) => runAgentPicker({
14835
- currentKey: host.state.agentKey,
15217
+ currentKey: host2.state.agentKey,
14836
15218
  env: options.env ?? process.env,
14837
15219
  input,
14838
15220
  output,
@@ -14844,8 +15226,8 @@ async function runSubmittedSlashLine(line, host, actionGateHandler, confirmDestr
14844
15226
  `);
14845
15227
  } else if (pickResult.kind === "selected") {
14846
15228
  clearCliLocalRuntimePreparedAgentCache();
14847
- host.state = {
14848
- ...host.state,
15229
+ host2.state = {
15230
+ ...host2.state,
14849
15231
  agentName: pickResult.name,
14850
15232
  agentKey: pickResult.key,
14851
15233
  contextWindow: resolveAgentContextWindow({
@@ -14854,13 +15236,13 @@ async function runSubmittedSlashLine(line, host, actionGateHandler, confirmDestr
14854
15236
  model: pickResult.model
14855
15237
  }),
14856
15238
  estimatedContextTokens: estimateDefaultCliContextTokens({
14857
- cwd: host.state.cwd,
15239
+ cwd: host2.state.cwd,
14858
15240
  agentKey: pickResult.key,
14859
15241
  agentName: pickResult.name,
14860
15242
  model: pickResult.model,
14861
- userLanguage: host.state.userLanguage,
15243
+ userLanguage: host2.state.userLanguage,
14862
15244
  responseViewport: TUI_RESPONSE_VIEWPORT,
14863
- messages: host.history.turns
15245
+ messages: host2.history.turns
14864
15246
  }),
14865
15247
  turnTokens: void 0,
14866
15248
  lastAuthorityTurnCount: void 0,
@@ -14868,11 +15250,11 @@ async function runSubmittedSlashLine(line, host, actionGateHandler, confirmDestr
14868
15250
  cachedMemoryOverlay: void 0
14869
15251
  // 切换 agent 后重新加载记忆
14870
15252
  };
14871
- persistAgentSelection2(host.state, options.env ?? process.env);
15253
+ persistAgentSelection2(host2.state, options.env ?? process.env);
14872
15254
  output.write(
14873
15255
  `${formatAgentSwitchMessage({
14874
15256
  name: pickResult.name,
14875
- dialogId: host.state.dialogId
15257
+ dialogId: host2.state.dialogId
14876
15258
  })}
14877
15259
  `
14878
15260
  );
@@ -14894,7 +15276,7 @@ async function runSubmittedSlashLine(line, host, actionGateHandler, confirmDestr
14894
15276
  }
14895
15277
  }
14896
15278
  if (result.action?.type === "set-mouse") {
14897
- host.fixedInput.setMouseEnabled(result.action.enabled);
15279
+ host2.fixedInput.setMouseEnabled(result.action.enabled);
14898
15280
  }
14899
15281
  if (result.action?.type === "set-math") {
14900
15282
  setMathRenderingEnabled(result.action.enabled);
@@ -14908,7 +15290,7 @@ async function runSubmittedSlashLine(line, host, actionGateHandler, confirmDestr
14908
15290
  }
14909
15291
  resetHistoryFrameDiffCache(output);
14910
15292
  renderHistoryToOutput();
14911
- host.fixedInput.repaint(host.buffer, host.cursorPos);
15293
+ host2.fixedInput.repaint(host2.buffer, host2.cursorPos);
14912
15294
  }
14913
15295
  if (result.action?.type === "copy-last") {
14914
15296
  const text = readLatestAssistantReply(history) ?? "";
@@ -14977,8 +15359,8 @@ async function runSubmittedSlashLine(line, host, actionGateHandler, confirmDestr
14977
15359
  history.currentContent = "";
14978
15360
  history.scrollTop = 0;
14979
15361
  history.followBottom = true;
14980
- host.state = {
14981
- ...host.state,
15362
+ host2.state = {
15363
+ ...host2.state,
14982
15364
  dialogId: pickResult.dialog.id,
14983
15365
  dialogKey: pickResult.dialog.dbKey,
14984
15366
  dialogLabel: pickResult.dialog.title || pickResult.dialog.id,
@@ -14994,15 +15376,15 @@ async function runSubmittedSlashLine(line, host, actionGateHandler, confirmDestr
14994
15376
  cachedMemoryOverlay: void 0,
14995
15377
  // 切换对话后重新加载记忆
14996
15378
  estimatedContextTokens: estimateDefaultCliContextTokens({
14997
- cwd: host.state.cwd,
14998
- agentKey: host.state.agentKey,
14999
- agentName: host.state.agentName,
15000
- userLanguage: host.state.userLanguage,
15379
+ cwd: host2.state.cwd,
15380
+ agentKey: host2.state.agentKey,
15381
+ agentName: host2.state.agentName,
15382
+ userLanguage: host2.state.userLanguage,
15001
15383
  responseViewport: TUI_RESPONSE_VIEWPORT,
15002
15384
  messages: history.turns,
15003
15385
  ...resolveAgentModelIdentity({
15004
- agentKey: host.state.agentKey,
15005
- agentName: host.state.agentName
15386
+ agentKey: host2.state.agentKey,
15387
+ agentName: host2.state.agentName
15006
15388
  })
15007
15389
  })
15008
15390
  };
@@ -15028,7 +15410,7 @@ async function runSubmittedSlashLine(line, host, actionGateHandler, confirmDestr
15028
15410
  if (result.action?.type === "list-agents") {
15029
15411
  try {
15030
15412
  const pickResult = await runAgentPicker({
15031
- currentKey: host.state.agentKey,
15413
+ currentKey: host2.state.agentKey,
15032
15414
  env: options.env ?? process.env,
15033
15415
  input,
15034
15416
  output,
@@ -15055,7 +15437,7 @@ async function runSubmittedSlashLine(line, host, actionGateHandler, confirmDestr
15055
15437
  const shellInvocation = process.platform === "win32" ? [process.env.ComSpec || "cmd.exe", "/d", "/s", "/c", shellCmd] : ["/bin/sh", "-c", shellCmd];
15056
15438
  const proc = spawnRunner({
15057
15439
  cmd: shellInvocation,
15058
- cwd: host.state.cwd,
15440
+ cwd: host2.state.cwd,
15059
15441
  env: options.env ?? process.env,
15060
15442
  stdout: "pipe",
15061
15443
  stderr: "pipe"
@@ -15101,13 +15483,13 @@ ${stderrText.trim()}
15101
15483
  emitCommandOutput(t("mediaPreprocessStart", base));
15102
15484
  const transcript = await transcribeMediaFile({
15103
15485
  path: result.action.path,
15104
- serverUrl: host.state.serverUrl,
15486
+ serverUrl: host2.state.serverUrl,
15105
15487
  authToken,
15106
15488
  language: result.action.lang,
15107
15489
  fromSec: trim.fromSec,
15108
15490
  toSec: trim.toSec,
15109
15491
  denoise: result.action.denoise,
15110
- dialogId: host.state.dialogId,
15492
+ dialogId: host2.state.dialogId,
15111
15493
  fetchImpl,
15112
15494
  onProgress: (info) => {
15113
15495
  const label = info.message ?? info.stage ?? "";
@@ -15115,10 +15497,10 @@ ${stderrText.trim()}
15115
15497
  }
15116
15498
  });
15117
15499
  const block = formatTranscriptForModel(transcript, result.action.path);
15118
- host.state = {
15119
- ...host.state,
15500
+ host2.state = {
15501
+ ...host2.state,
15120
15502
  pendingTranscripts: [
15121
- ...host.state.pendingTranscripts ?? [],
15503
+ ...host2.state.pendingTranscripts ?? [],
15122
15504
  block
15123
15505
  ]
15124
15506
  };
@@ -15137,16 +15519,28 @@ ${stderrText.trim()}
15137
15519
  }
15138
15520
  }
15139
15521
  if (result.action?.type === "login") {
15140
- const env = host.options.env ?? process.env;
15522
+ const env = host2.options.env ?? process.env;
15141
15523
  const outcome = await runTuiLogin(
15142
15524
  result.action.args ?? [],
15143
15525
  (text) => emitCommandOutput(text)
15144
15526
  );
15145
15527
  if (outcome.status === "success") {
15146
15528
  env.AUTH_TOKEN = outcome.token;
15147
- host.state = { ...host.state, showAuthGuidance: false };
15529
+ host2.state = { ...host2.state, showAuthGuidance: false };
15148
15530
  }
15149
15531
  }
15532
+ if (result.action?.type === "auth") {
15533
+ await runTuiAuth(
15534
+ result.action.args ?? [],
15535
+ (text) => emitCommandOutput(text),
15536
+ {
15537
+ fetchImpl: host2.fetchImpl,
15538
+ dialogHost: host2.dialogHost,
15539
+ input: host2.input,
15540
+ output: host2.output
15541
+ }
15542
+ );
15543
+ }
15150
15544
  if (result.action?.type === "chat") {
15151
15545
  let messageForModel = result.action.message;
15152
15546
  const mediaPaths = result.action.mediaPaths ?? [];
@@ -15164,9 +15558,9 @@ ${stderrText.trim()}
15164
15558
  emitCommandOutput(t("mediaPreprocessStart", base));
15165
15559
  const transcript = await transcribeMediaFile({
15166
15560
  path: mediaPath,
15167
- serverUrl: host.state.serverUrl,
15561
+ serverUrl: host2.state.serverUrl,
15168
15562
  authToken,
15169
- dialogId: host.state.dialogId,
15563
+ dialogId: host2.state.dialogId,
15170
15564
  fromSec: trim.fromSec,
15171
15565
  toSec: trim.toSec,
15172
15566
  fetchImpl,
@@ -15202,9 +15596,9 @@ ${messageForModel}` : block;
15202
15596
  for (const path3 of unreadable) {
15203
15597
  try {
15204
15598
  const image = await readClipboardImage({ env: options.env ?? process.env });
15205
- host.state = {
15206
- ...host.state,
15207
- attachedImages: mergeAttachedImages(host.state.attachedImages, [image])
15599
+ host2.state = {
15600
+ ...host2.state,
15601
+ attachedImages: mergeAttachedImages(host2.state.attachedImages, [image])
15208
15602
  };
15209
15603
  emitCommandOutput(
15210
15604
  `[nolo] image attached from clipboard (path unreadable: ${path3})`
@@ -15223,17 +15617,17 @@ ${messageForModel}` : block;
15223
15617
  }
15224
15618
  const { imageUrls } = await resolveAttachmentImageUrls({
15225
15619
  actionImagePaths: result.action.imagePaths,
15226
- attachedImages: host.state.attachedImages,
15620
+ attachedImages: host2.state.attachedImages,
15227
15621
  onFailure: (_path, err) => output.write(`[nolo] image skipped: ${err.message}
15228
15622
  `)
15229
15623
  });
15230
15624
  const localAttachmentPaths = [
15231
15625
  ...result.action.imagePaths ?? [],
15232
- ...host.state.attachedImages.map((img) => img.sourcePath),
15626
+ ...host2.state.attachedImages.map((img) => img.sourcePath),
15233
15627
  ...result.action.mediaPaths ?? []
15234
15628
  ];
15235
- host.state = {
15236
- ...host.state,
15629
+ host2.state = {
15630
+ ...host2.state,
15237
15631
  attachedImages: []
15238
15632
  };
15239
15633
  history.followBottom = true;
@@ -15256,7 +15650,7 @@ ${messageForModel}` : block;
15256
15650
  ${err.message}` : ""}`
15257
15651
  );
15258
15652
  }
15259
- if (host.fixedInput.active) host.fixedInput.repaint(host.buffer, host.cursorPos);
15653
+ if (host2.fixedInput.active) host2.fixedInput.repaint(host2.buffer, host2.cursorPos);
15260
15654
  }
15261
15655
  return false;
15262
15656
  }
@@ -16615,6 +17009,19 @@ ${err.message}` : ""}`
16615
17009
  env.AUTH_TOKEN = outcome.token;
16616
17010
  state = { ...state, showAuthGuidance: false };
16617
17011
  }
17012
+ } else if (res.action?.type === "auth") {
17013
+ state = res.nextState;
17014
+ await runTuiAuth(res.action.args ?? [], (text) => {
17015
+ output.write(`${text}
17016
+ `);
17017
+ }, {
17018
+ fetchImpl: options.fetchImpl ?? fetch,
17019
+ // 与空闲路径一致:选择器/粘贴码交互要接同一套弹窗宿主与输入输出,
17020
+ // 否则 busy 期间 /auth 会拿不到键盘输入,表现为"卡住没反应"。
17021
+ dialogHost,
17022
+ input,
17023
+ output
17024
+ });
16618
17025
  } else if (res.action?.type === "transcribe") {
16619
17026
  output.write(
16620
17027
  `[nolo] ${t("transcribeBusyHint")}
@@ -16896,7 +17303,7 @@ ${merged}` : merged;
16896
17303
  if (busyLock) {
16897
17304
  const trimmedText = submittedText.trim();
16898
17305
  const busySlashCommand = trimmedText.split(/\s+/)[0]?.toLowerCase();
16899
- const isBusyLocalSlash = busySlashCommand === "/context" || busySlashCommand === "/ctx" || busySlashCommand === "/cd" || busySlashCommand === "/switch" || busySlashCommand === "/theme" || busySlashCommand === "/runtime" || busySlashCommand === "/logs" || busySlashCommand === "/auto" || busySlashCommand === "/tasks" || busySlashCommand === "/jobs" || busySlashCommand === "/procs" || busySlashCommand === "/agents" || busySlashCommand === "/doc" || busySlashCommand === "/skill" || busySlashCommand === "/customize" || busySlashCommand === "/login" || busySlashCommand === "/profile" || busySlashCommand === "/paste" || busySlashCommand === "/version" || busySlashCommand === "/links" || busySlashCommand === "/transcribe" || busySlashCommand === "/shell-revoke";
17306
+ const isBusyLocalSlash = busySlashCommand === "/context" || busySlashCommand === "/ctx" || busySlashCommand === "/cd" || busySlashCommand === "/switch" || busySlashCommand === "/theme" || busySlashCommand === "/runtime" || busySlashCommand === "/logs" || busySlashCommand === "/auto" || busySlashCommand === "/tasks" || busySlashCommand === "/jobs" || busySlashCommand === "/procs" || busySlashCommand === "/agents" || busySlashCommand === "/doc" || busySlashCommand === "/skill" || busySlashCommand === "/customize" || busySlashCommand === "/login" || busySlashCommand === "/auth" || busySlashCommand === "/profile" || busySlashCommand === "/paste" || busySlashCommand === "/version" || busySlashCommand === "/links" || busySlashCommand === "/transcribe" || busySlashCommand === "/shell-revoke";
16900
17307
  if (isBusyLocalSlash) {
16901
17308
  await handleBusyLocalSlash(submittedText, busySlashCommand);
16902
17309
  return;
@@ -16937,6 +17344,18 @@ ${merged}` : merged;
16937
17344
  }
16938
17345
  return;
16939
17346
  }
17347
+ if (!submittedText.trim() && state.suggestedAuthCommand) {
17348
+ const authCmd = state.suggestedAuthCommand;
17349
+ state = { ...state, suggestedAuthCommand: void 0 };
17350
+ buffer = "";
17351
+ cursorPos = 0;
17352
+ bumpDraftEpoch();
17353
+ await runSubmittedLine(authCmd, host, runOneAgentTurn);
17354
+ return;
17355
+ }
17356
+ if (state.suggestedAuthCommand) {
17357
+ state = { ...state, suggestedAuthCommand: void 0 };
17358
+ }
16940
17359
  if (!submittedText.trim() && chatQueueBinding && chatQueueBinding.queueLength() > 0) {
16941
17360
  const { actionGateHandler, confirmDestructiveAction } = buildInteractiveTurnHandlers();
16942
17361
  const manualBinding = ensureChatQueueBinding(turnCtx, actionGateHandler, confirmDestructiveAction);