nolo-cli 0.152.0-alpha.1 → 0.153.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 (148) hide show
  1. package/{_executeModel-4KHFMQT4.js → _executeModel-YAHIA3TR.js} +44 -45
  2. package/{accountResolver-7RYB4D2P.js → accountResolver-55EDKEIK.js} +1 -1
  3. package/{action-SXJD5N5R.js → action-GPPJC5TI.js} +4 -4
  4. package/{addContentAction-ZV774PHH.js → addContentAction-BI6RDRTQ.js} +8 -8
  5. package/{addDialogAgentAction-A6SMKAGH.js → addDialogAgentAction-4RJYUSIK.js} +7 -7
  6. package/{agentDeleteCommand-EKFV5FC7.js → agentDeleteCommand-6W2VQADC.js} +57 -57
  7. package/{agentEmailCommands-MNV3MUH5.js → agentEmailCommands-ZTS5JSP5.js} +59 -59
  8. package/{agentListCommands-E6FYKXC3.js → agentListCommands-MM5OLPBY.js} +23 -23
  9. package/{agentMachineCommands-2GFUU7GF.js → agentMachineCommands-WPFV4TSD.js} +22 -21
  10. package/{agentProviderCommands-HL6MBLCL.js → agentProviderCommands-MKG2OOEY.js} +2 -2
  11. package/{agentRecordCommands-LPHHTEPM.js → agentRecordCommands-YW7XO5CX.js} +57 -57
  12. package/{agentRunCommand-JSPW7W32.js → agentRunCommand-R2JTIRPZ.js} +59 -58
  13. package/{agentRunControl-IFM7IGMG.js → agentRunControl-2C5GM3BW.js} +5 -5
  14. package/{agentRuntimeLocal-ARS4TV77.js → agentRuntimeLocal-RJKTDWNN.js} +16 -16
  15. package/{agentSlice-IP4DZNNV.js → agentSlice-7FNTOPHE.js} +8 -8
  16. package/{appDeleteCommands-JHTLKQSX.js → appDeleteCommands-7EOM274T.js} +21 -21
  17. package/{appDeployCommands-5V26M2KA.js → appDeployCommands-2I3QYJ5G.js} +21 -21
  18. package/{appDeployStatusCommands-SBSPS627.js → appDeployStatusCommands-LEML7FPR.js} +21 -21
  19. package/{appGetCommands-NKPD2L45.js → appGetCommands-ZQSVHGQM.js} +21 -21
  20. package/{appListCommands-ZOGRZFYY.js → appListCommands-BVA7XKQO.js} +21 -21
  21. package/{authCommand-QYN47CQD.js → authCommand-NIV3DKPF.js} +13 -293
  22. package/{authCommands-77CHYBGF.js → authCommands-AMNIAKEG.js} +2 -2
  23. package/{builtinSkillRegistry-TDQ6JB2E.js → builtinSkillRegistry-H3AY27TR.js} +3 -3
  24. package/{chromeCommands-OBBNJCLS.js → chromeCommands-IY4NVSXZ.js} +17 -10
  25. package/{chunk-SW4S4XYB.js → chunk-2AB2HA4M.js} +84 -34
  26. package/{chunk-VNP54NZL.js → chunk-2EROINJB.js} +14 -14
  27. package/{chunk-4PXHOOFA.js → chunk-2MTE2PEH.js} +3 -3
  28. package/{chunk-4YRTZIVN.js → chunk-2SGAI64X.js} +2 -2
  29. package/{chunk-QFEW2ULV.js → chunk-32ZKZET7.js} +1 -1
  30. package/{chunk-GQV5KHJU.js → chunk-3C2QLERX.js} +1 -1
  31. package/{chunk-XPWGOTBQ.js → chunk-3L2WKC3W.js} +1 -8
  32. package/{chunk-WD4XYDYC.js → chunk-3WIXU4XO.js} +224 -1
  33. package/{chunk-MZHOLWW5.js → chunk-4J4RVSHE.js} +3 -3
  34. package/{chunk-YBNHPX4S.js → chunk-4RJJDA57.js} +1 -1
  35. package/{chunk-OFVFQYIE.js → chunk-6COBMDV4.js} +19 -13
  36. package/{chunk-HL3O3PCQ.js → chunk-6TF64IF2.js} +2 -2
  37. package/{chunk-BNDETALN.js → chunk-7NSQJKGA.js} +45 -13
  38. package/{chunk-UUPR3TD7.js → chunk-7RF4O6AT.js} +1 -3
  39. package/{chunk-LC23WBCU.js → chunk-ACTR4SH2.js} +6 -6
  40. package/{chunk-HSJPKBLC.js → chunk-ANJTRG52.js} +2 -2
  41. package/{chunk-2GGXHQIW.js → chunk-BLVSFYQ3.js} +4 -2
  42. package/{chunk-ISQL4V7C.js → chunk-C3OK72G3.js} +1 -1
  43. package/{chunk-CHCS6XPJ.js → chunk-CGFNDIKK.js} +65 -0
  44. package/{chunk-F32Z66T4.js → chunk-CON6SI7N.js} +1 -1
  45. package/{chunk-HIQ4GF53.js → chunk-DC3SZCRR.js} +7 -3
  46. package/{chunk-RQ6E3G5L.js → chunk-DRPDGHQB.js} +18 -2
  47. package/{chunk-RVWMAFIT.js → chunk-FYYSDHVQ.js} +1 -1
  48. package/{chunk-XTWDF6RU.js → chunk-GLUL4C5S.js} +21 -17
  49. package/{chunk-TYYRSFBG.js → chunk-HB4XPBC7.js} +3 -35
  50. package/{chunk-6MJNEXUU.js → chunk-HGDKT2D6.js} +4 -0
  51. package/{chunk-UBUH2TCC.js → chunk-I2RMFLLH.js} +2 -2
  52. package/{chunk-VJXHL6MH.js → chunk-ICRRXBRN.js} +3 -3
  53. package/{chunk-XS47QOFV.js → chunk-IE5PXKVU.js} +2 -264
  54. package/{chunk-KMM2X7LP.js → chunk-ILVOUUMR.js} +3 -3
  55. package/{chunk-KFHQQ3NO.js → chunk-INFHX73M.js} +1 -1
  56. package/{chunk-XRUSXPCQ.js → chunk-IPAW7XLD.js} +57 -4
  57. package/{chunk-PLSVXHSA.js → chunk-IRTOYSA2.js} +3 -3
  58. package/{chunk-GCKHQECX.js → chunk-IYBIRCQV.js} +1 -1
  59. package/{chunk-ILU2NPWY.js → chunk-J2ATF74A.js} +2 -2
  60. package/{chunk-XZNCX52W.js → chunk-JGRPBIZZ.js} +1 -1
  61. package/{chunk-E2AKSW7L.js → chunk-JPJGMOIM.js} +2 -2
  62. package/{chunk-6LIKQYG4.js → chunk-JZYIISJB.js} +21 -23
  63. package/{chunk-44WXLHFI.js → chunk-K43ZF2C3.js} +1 -1
  64. package/{chunk-I2ZMGXXF.js → chunk-KFHREHUQ.js} +1 -1
  65. package/{chunk-JKMLSTZK.js → chunk-KLA62VVE.js} +3 -3
  66. package/{chunk-AHYBQP3M.js → chunk-L57R6PFF.js} +3 -3
  67. package/{chunk-DYYMIUN4.js → chunk-L6EQV5OC.js} +4 -4
  68. package/{chunk-EZVK3N5L.js → chunk-LOEO7LRC.js} +56 -0
  69. package/{chunk-EDX5XSJM.js → chunk-M2P3OGXZ.js} +3 -3
  70. package/{chunk-YVLQXTUB.js → chunk-MM3662RS.js} +1 -1
  71. package/{chunk-CBHGZRCE.js → chunk-MYOH447Z.js} +1 -1
  72. package/{chunk-A4MW3YZL.js → chunk-NDZOXXIM.js} +18 -4
  73. package/{chunk-EHFS4XZO.js → chunk-NKBMD4TC.js} +12 -8
  74. package/{chunk-64PFYIAY.js → chunk-OJ2PQXBV.js} +674 -637
  75. package/{chunk-36OMEXXR.js → chunk-OON4OBWI.js} +1 -1
  76. package/{chunk-SEJ5OS6F.js → chunk-PXYBUFDB.js} +4 -0
  77. package/{chunk-XCA6HQGS.js → chunk-QEONMOV7.js} +5 -5
  78. package/{chunk-USHQX6VT.js → chunk-QPY264HO.js} +1 -1
  79. package/{chunk-PFBIXTFB.js → chunk-QSKN3E7Q.js} +52 -26
  80. package/{chunk-TNIX77YM.js → chunk-R5GO3YZP.js} +34 -1
  81. package/{chunk-I5V3V2H4.js → chunk-RL2OOQUM.js} +37 -25
  82. package/{chunk-AIZE5TDM.js → chunk-SPKLALBU.js} +2 -2
  83. package/{chunk-K2AER7RX.js → chunk-SUKSWFLP.js} +2 -2
  84. package/{chunk-I4SN4NUQ.js → chunk-TRW43TSC.js} +1 -1
  85. package/{chunk-D2QN6CTI.js → chunk-UCLSOLX4.js} +8 -6
  86. package/{chunk-TYJ5XFEA.js → chunk-UFYBYB26.js} +1 -1
  87. package/{chunk-SCMHQUMK.js → chunk-US6MKPE7.js} +1 -1
  88. package/{chunk-ZIWPQEFU.js → chunk-VYNMQ6HW.js} +1 -28
  89. package/{chunk-PPU323UE.js → chunk-W2NNEHHW.js} +183 -66
  90. package/{chunk-IJERIUXS.js → chunk-WRCZXJ4N.js} +6 -3
  91. package/chunk-Y5GCAMGP.js +9 -0
  92. package/{chunk-GKXCHNTE.js → chunk-Y6ORVLSS.js} +1 -1
  93. package/{chunk-RSHPU4PD.js → chunk-YANF2RR4.js} +2 -2
  94. package/{chunk-EYWJT7A2.js → chunk-YPG7TUQD.js} +3 -3
  95. package/{chunk-PMYAE4OZ.js → chunk-YPY2S3DV.js} +3 -3
  96. package/{chunk-ZF6526IQ.js → chunk-ZEY4NJRE.js} +2 -2
  97. package/{chunk-JWTSWUPS.js → chunk-ZGG7BBVE.js} +7 -6
  98. package/{chunk-T5BHHWA5.js → chunk-ZGSW3HWM.js} +7 -7
  99. package/{chunk-74RAWNQN.js → chunk-ZVQHBIWV.js} +6 -6
  100. package/{chunk-DTODXBHK.js → chunk-ZWG3C7VI.js} +2 -2
  101. package/{commandRegistry-VBALU4Q4.js → commandRegistry-ZPK4AUWM.js} +79 -87
  102. package/{contentThunks-HPY2QNWZ.js → contentThunks-SXEQLAFP.js} +20 -20
  103. package/{createAgentAutomationAction-6ADGPGY6.js → createAgentAutomationAction-INVACTI3.js} +20 -20
  104. package/{createDialogAction-6ABMSEW2.js → createDialogAction-FDO3DYW4.js} +21 -21
  105. package/{createPageAction-OC4NNRPC.js → createPageAction-Q5CQPEQH.js} +20 -20
  106. package/{dbSlice-J37OGIXH.js → dbSlice-DC2J53RC.js} +7 -7
  107. package/{deleteFile-6JWDDRVP.js → deleteFile-KYWEMNFX.js} +4 -4
  108. package/{dialogCommands-EIGBRSQP.js → dialogCommands-MUFYPVMP.js} +24 -23
  109. package/{dialogSlice-SI45KJOH.js → dialogSlice-DS22VO6X.js} +19 -19
  110. package/{docCreateCommands-3JDBBMU5.js → docCreateCommands-OPWOKG62.js} +19 -19
  111. package/{docDeleteCommands-5M6C7UUB.js → docDeleteCommands-IBV3WMKI.js} +20 -20
  112. package/{docReadCommands-DUB57F6V.js → docReadCommands-LVALHMLZ.js} +19 -19
  113. package/{docStore-L43MDEK4.js → docStore-UFEWRQ5W.js} +8 -8
  114. package/{docUpdateCommands-WF7MAMPK.js → docUpdateCommands-Z5OUEAK7.js} +19 -19
  115. package/{getPricing-FKK3F5EJ.js → getPricing-TX35D7PI.js} +3 -3
  116. package/{handleSendMessageAction-BSMU7SVS.js → handleSendMessageAction-AOPC2RYQ.js} +33 -33
  117. package/index.js +7 -7
  118. package/{localRuntimeAdapter-N5PDR26F.js → localRuntimeAdapter-OK722XHN.js} +57 -55
  119. package/{machineCommands-TMXJKZCE.js → machineCommands-NW3KT5RE.js} +61 -59
  120. package/{machineWsRunDispatch-25H63KEH.js → machineWsRunDispatch-EWQDI6TL.js} +56 -56
  121. package/{memberThunks-66DH6ABQ.js → memberThunks-2DWKLE6W.js} +8 -8
  122. package/{models-LAS4B2B5.js → models-PZQC7VV4.js} +2 -2
  123. package/package.json +1 -1
  124. package/{profileConfig-ZGOFORWV.js → profileConfig-KN3N2BLF.js} +7 -1
  125. package/{providerPresetApply-MY66I6NT.js → providerPresetApply-GSJI4JBJ.js} +6 -6
  126. package/{providerRegistry-QOE2FT57.js → providerRegistry-TSSTPGWF.js} +6 -6
  127. package/{read-DC4NUGN6.js → read-L7QEJETH.js} +5 -5
  128. package/{readDocTool-NCJ5NT25.js → readDocTool-QELXV2GW.js} +1 -1
  129. package/{readlineWorkspace-BS7WVCL2.js → readlineWorkspace-ZTNEFMTX.js} +330 -118
  130. package/{removeDialogAgentAction-E2H3OZU6.js → removeDialogAgentAction-376XSUP2.js} +9 -9
  131. package/{runAgentClientLoop-BVKRI4SY.js → runAgentClientLoop-PQTFXXFA.js} +48 -44
  132. package/{runtimeDoctorCommands-GIOGC5SC.js → runtimeDoctorCommands-56NWKNON.js} +5 -5
  133. package/{secretCommands-ZXZRLR3R.js → secretCommands-DNY56NSU.js} +11 -1
  134. package/{setDialogExtraReferencesAction-SITRPMYU.js → setDialogExtraReferencesAction-QBDSH63D.js} +8 -8
  135. package/{setPrimaryDialogAgentAction-U7N45TGC.js → setPrimaryDialogAgentAction-537QFGW3.js} +9 -9
  136. package/settingThunks-4Z43ZSAT.js +923 -0
  137. package/{spaceCommands-5EWREUWS.js → spaceCommands-AWIIP7J5.js} +19 -19
  138. package/{streamAgentChatTurn-B4VFUV52.js → streamAgentChatTurn-I4M3CUBF.js} +53 -103
  139. package/{switchDialogAgentAction-OMGBD3N2.js → switchDialogAgentAction-CSO6AKRL.js} +7 -7
  140. package/{tableCommands-U3QDY4L6.js → tableCommands-LBH3QPPO.js} +1 -1
  141. package/{toolApiClient-7WSJJJBV.js → toolApiClient-HGNO53TC.js} +2 -2
  142. package/{tools-5WYAUKMK.js → tools-TOSN72UD.js} +37 -37
  143. package/{tuiSummaryLlmCaller-PPU7YDBG.js → tuiSummaryLlmCaller-KLK6K3Q3.js} +8 -8
  144. package/{updateCommands-NQXAGFM7.js → updateCommands-LXZLG44Y.js} +2 -2
  145. package/{updateDialogTitleAction-YJHDKHFX.js → updateDialogTitleAction-TJWFUJX4.js} +20 -20
  146. package/{workloadLifecycle-36DXRZKU.js → workloadLifecycle-6O6PMISX.js} +2 -2
  147. package/chunk-W4S6OTSC.js +0 -35
  148. package/settingThunks-Y7SVJOMZ.js +0 -1371
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  resolveAuthGuidanceState
3
- } from "./chunk-44WXLHFI.js";
3
+ } from "./chunk-K43ZF2C3.js";
4
4
  import {
5
5
  fetchCiStatus,
6
6
  summarizeLatest
@@ -13,7 +13,7 @@ import {
13
13
  listRemoteAgents,
14
14
  listRemoteAgentsAcrossServers,
15
15
  normalizeListedAgent
16
- } from "./chunk-VJXHL6MH.js";
16
+ } from "./chunk-ICRRXBRN.js";
17
17
  import {
18
18
  refreshSubscriptionQuotas
19
19
  } from "./chunk-U4STABYN.js";
@@ -91,9 +91,9 @@ import {
91
91
  wrapTextToLines,
92
92
  wrapTranscriptLine,
93
93
  wrapTranscriptLineWithLayout
94
- } from "./chunk-I5V3V2H4.js";
94
+ } from "./chunk-RL2OOQUM.js";
95
95
  import "./chunk-6QDYSCPW.js";
96
- import "./chunk-RQ6E3G5L.js";
96
+ import "./chunk-DRPDGHQB.js";
97
97
  import {
98
98
  getReadableCliDb
99
99
  } from "./chunk-P5QACQDK.js";
@@ -103,8 +103,8 @@ import {
103
103
  createCliLocalRuntimeAdapter,
104
104
  createOriginShellGrant,
105
105
  readTimestamp
106
- } from "./chunk-64PFYIAY.js";
107
- import "./chunk-XS47QOFV.js";
106
+ } from "./chunk-OJ2PQXBV.js";
107
+ import "./chunk-IE5PXKVU.js";
108
108
  import "./chunk-6MXDOUMH.js";
109
109
  import {
110
110
  dailyWelcomeTip,
@@ -112,11 +112,11 @@ import {
112
112
  parseCliLocale,
113
113
  setCliLocale,
114
114
  t
115
- } from "./chunk-SW4S4XYB.js";
115
+ } from "./chunk-2AB2HA4M.js";
116
116
  import {
117
117
  defaultOpenBrowser,
118
118
  saveTokenLogin
119
- } from "./chunk-36OMEXXR.js";
119
+ } from "./chunk-OON4OBWI.js";
120
120
  import "./chunk-TY3TIUJK.js";
121
121
  import {
122
122
  isHiddenFromDialogList,
@@ -124,19 +124,20 @@ import {
124
124
  normalizeDialogRecord,
125
125
  readDialogSnapshot,
126
126
  sortDialogs
127
- } from "./chunk-D2QN6CTI.js";
127
+ } from "./chunk-UCLSOLX4.js";
128
128
  import "./chunk-ID4G2MAR.js";
129
129
  import {
130
130
  listUserRecordsFromServers,
131
131
  readLiveDbRecordAfterTombstoneMerge
132
- } from "./chunk-USHQX6VT.js";
132
+ } from "./chunk-QPY264HO.js";
133
+ import "./chunk-Y5GCAMGP.js";
133
134
  import {
134
135
  deleteDbRecord,
135
136
  queryUserRecords,
136
137
  readDbRecord
137
- } from "./chunk-ZF6526IQ.js";
138
+ } from "./chunk-ZEY4NJRE.js";
138
139
  import "./chunk-VP3BINY7.js";
139
- import "./chunk-UUPR3TD7.js";
140
+ import "./chunk-7RF4O6AT.js";
140
141
  import {
141
142
  NOLO_DEFAULT_AGENT_KEY,
142
143
  resolveCliAgentKeyInput
@@ -145,109 +146,109 @@ import "./chunk-VL5KOY2C.js";
145
146
  import "./chunk-S73EPYNC.js";
146
147
  import "./chunk-ZEZC7IIM.js";
147
148
  import "./chunk-VIWDGTDA.js";
148
- import "./chunk-6MJNEXUU.js";
149
+ import "./chunk-HGDKT2D6.js";
149
150
  import "./chunk-BU2YQBV4.js";
150
151
  import "./chunk-BMQ2MJUK.js";
151
- import "./chunk-XRUSXPCQ.js";
152
+ import "./chunk-IPAW7XLD.js";
152
153
  import "./chunk-ATNTHIZI.js";
153
- import "./chunk-KFHQQ3NO.js";
154
+ import "./chunk-INFHX73M.js";
154
155
  import "./chunk-JEXVIMYZ.js";
155
156
  import {
156
157
  prepareTools
157
- } from "./chunk-MZHOLWW5.js";
158
- import {
159
- buildResponseGuidelines
160
- } from "./chunk-W4S6OTSC.js";
158
+ } from "./chunk-4J4RVSHE.js";
161
159
  import "./chunk-HS7MLR74.js";
162
- import "./chunk-PPU323UE.js";
163
- import "./chunk-JKMLSTZK.js";
164
- import "./chunk-I2ZMGXXF.js";
160
+ import "./chunk-W2NNEHHW.js";
161
+ import "./chunk-KLA62VVE.js";
162
+ import "./chunk-KFHREHUQ.js";
165
163
  import "./chunk-OXME3PEE.js";
166
- import "./chunk-EHFS4XZO.js";
164
+ import "./chunk-NKBMD4TC.js";
167
165
  import "./chunk-NF64D32W.js";
168
- import "./chunk-XPWGOTBQ.js";
169
- import "./chunk-ZIWPQEFU.js";
170
- import "./chunk-CBHGZRCE.js";
171
- import "./chunk-SCMHQUMK.js";
172
- import "./chunk-RSHPU4PD.js";
166
+ import "./chunk-3L2WKC3W.js";
167
+ import "./chunk-VYNMQ6HW.js";
168
+ import "./chunk-MYOH447Z.js";
169
+ import "./chunk-US6MKPE7.js";
170
+ import "./chunk-YANF2RR4.js";
173
171
  import "./chunk-VIDPVFP3.js";
174
172
  import "./chunk-5MM7NNO6.js";
175
173
  import "./chunk-IA7TRNNR.js";
176
174
  import "./chunk-AGIM7IMJ.js";
177
175
  import "./chunk-63W5N6P3.js";
178
176
  import "./chunk-VF4K2QE6.js";
179
- import "./chunk-KMM2X7LP.js";
180
- import "./chunk-ILU2NPWY.js";
181
- import "./chunk-XCA6HQGS.js";
182
- import "./chunk-F32Z66T4.js";
183
- import "./chunk-EYWJT7A2.js";
184
- import "./chunk-OFVFQYIE.js";
185
- import "./chunk-PFBIXTFB.js";
177
+ import "./chunk-ILVOUUMR.js";
178
+ import "./chunk-J2ATF74A.js";
179
+ import "./chunk-QEONMOV7.js";
180
+ import "./chunk-CON6SI7N.js";
181
+ import "./chunk-YPG7TUQD.js";
182
+ import "./chunk-6COBMDV4.js";
183
+ import "./chunk-QSKN3E7Q.js";
186
184
  import "./chunk-523DITKR.js";
187
185
  import "./chunk-UKZX3NHN.js";
188
186
  import "./chunk-OFFL4DCR.js";
189
187
  import "./chunk-QYPE3TS3.js";
190
- import "./chunk-LC23WBCU.js";
188
+ import "./chunk-ACTR4SH2.js";
191
189
  import "./chunk-4JH2UMJR.js";
192
190
  import "./chunk-ZJ7UHBJS.js";
193
191
  import "./chunk-BYXBJQAS.js";
194
- import "./chunk-PLSVXHSA.js";
192
+ import "./chunk-IRTOYSA2.js";
195
193
  import "./chunk-5RGU3J7P.js";
196
194
  import "./chunk-OWYYDMGJ.js";
197
195
  import "./chunk-ZRAU6T47.js";
198
196
  import "./chunk-4LCOCOR5.js";
199
197
  import "./chunk-YDH3FDFQ.js";
200
- import "./chunk-QFEW2ULV.js";
198
+ import "./chunk-32ZKZET7.js";
201
199
  import "./chunk-XI7DGLUK.js";
202
- import "./chunk-EDX5XSJM.js";
200
+ import "./chunk-M2P3OGXZ.js";
203
201
  import "./chunk-UAD2WT54.js";
204
- import "./chunk-74RAWNQN.js";
202
+ import "./chunk-ZVQHBIWV.js";
205
203
  import "./chunk-3PVYUPXK.js";
206
- import "./chunk-A4MW3YZL.js";
207
- import "./chunk-AIZE5TDM.js";
208
- import "./chunk-4YRTZIVN.js";
204
+ import "./chunk-NDZOXXIM.js";
205
+ import "./chunk-SPKLALBU.js";
206
+ import "./chunk-2SGAI64X.js";
209
207
  import "./chunk-UEILX4EV.js";
210
- import "./chunk-IJERIUXS.js";
208
+ import "./chunk-WRCZXJ4N.js";
211
209
  import "./chunk-6Q7UTJKR.js";
212
210
  import "./chunk-QQ56R7KS.js";
213
211
  import "./chunk-OW765XBU.js";
214
- import "./chunk-SEJ5OS6F.js";
212
+ import "./chunk-PXYBUFDB.js";
215
213
  import "./chunk-D2MDMY2M.js";
216
- import "./chunk-HIQ4GF53.js";
214
+ import "./chunk-DC3SZCRR.js";
217
215
  import {
218
216
  expandEnabledPacks
219
217
  } from "./chunk-JZX2XLKC.js";
220
218
  import "./chunk-EUGTFFO6.js";
221
219
  import "./chunk-XETG4RIX.js";
222
- import "./chunk-GKXCHNTE.js";
220
+ import "./chunk-Y6ORVLSS.js";
223
221
  import {
224
222
  buildLocalWorkspaceOpenAiTools,
225
223
  buildLocalWorkspaceToolset,
226
224
  formatToolOverflowMarker,
227
225
  getProcessRegistry,
228
226
  readCommandActionGatePayload
229
- } from "./chunk-BNDETALN.js";
230
- import "./chunk-GQV5KHJU.js";
227
+ } from "./chunk-7NSQJKGA.js";
228
+ import "./chunk-3C2QLERX.js";
231
229
  import "./chunk-ZNFJWEN4.js";
232
- import "./chunk-DYYMIUN4.js";
230
+ import "./chunk-L6EQV5OC.js";
233
231
  import "./chunk-HNUWUO75.js";
234
232
  import "./chunk-CHOZJMJS.js";
235
233
  import "./chunk-PWTNI4N7.js";
236
- import "./chunk-HSJPKBLC.js";
234
+ import "./chunk-ANJTRG52.js";
237
235
  import "./chunk-5ZUL4CUO.js";
238
- import "./chunk-GCKHQECX.js";
236
+ import "./chunk-IYBIRCQV.js";
239
237
  import "./chunk-G6OOUQWJ.js";
240
238
  import "./chunk-56GBUMO5.js";
241
239
  import "./chunk-WJZOQR2J.js";
242
240
  import {
241
+ CREDENTIAL_HYGIENE_RULE,
243
242
  DELETE_SAFETY_RED_LINE,
244
243
  PARALLEL_DISPATCH_DEFAULT_RULE,
245
244
  PLATFORM_RISK_CONTROL_RULE,
245
+ buildConsultationModeBlock,
246
246
  buildIdentityBlock,
247
247
  buildRuntimeGuidanceBlocks,
248
+ resolveResponseGuidelines,
248
249
  resolveToolGuidedSections
249
- } from "./chunk-WD4XYDYC.js";
250
- import "./chunk-HL3O3PCQ.js";
250
+ } from "./chunk-3WIXU4XO.js";
251
+ import "./chunk-6TF64IF2.js";
251
252
  import "./chunk-QLQ573SU.js";
252
253
  import {
253
254
  isQuotaExhaustedError
@@ -256,7 +257,7 @@ import "./chunk-2MBTWINN.js";
256
257
  import {
257
258
  extractReferenceKeysFromMessage,
258
259
  normalizeUsage
259
- } from "./chunk-DTODXBHK.js";
260
+ } from "./chunk-ZWG3C7VI.js";
260
261
  import {
261
262
  DEFAULT_CONTEXT_WINDOW,
262
263
  buildCompactionMetricsFromPlan,
@@ -268,7 +269,7 @@ import {
268
269
  getModelContextWindow,
269
270
  planCompression,
270
271
  serializeMessageContent
271
- } from "./chunk-4PXHOOFA.js";
272
+ } from "./chunk-2MTE2PEH.js";
272
273
  import {
273
274
  clipCompactText
274
275
  } from "./chunk-5MMAK75Q.js";
@@ -289,7 +290,7 @@ import {
289
290
  BUILTIN_NOLO_AGENT_NAME,
290
291
  builtinAgentCatalogEntryById,
291
292
  parseBuiltinPlatformAgentId
292
- } from "./chunk-EZVK3N5L.js";
293
+ } from "./chunk-LOEO7LRC.js";
293
294
  import {
294
295
  extractCustomId,
295
296
  parsePublicAgentId
@@ -297,8 +298,8 @@ import {
297
298
  import "./chunk-5EMSBTQ6.js";
298
299
  import "./chunk-I42VC5KR.js";
299
300
  import "./chunk-U6VC4MU4.js";
300
- import "./chunk-TYYRSFBG.js";
301
- import "./chunk-XZNCX52W.js";
301
+ import "./chunk-HB4XPBC7.js";
302
+ import "./chunk-JGRPBIZZ.js";
302
303
  import "./chunk-WWC7I6TA.js";
303
304
  import {
304
305
  backfillRunRecordParentDialog,
@@ -306,7 +307,7 @@ import {
306
307
  isRunRecordClaimed,
307
308
  listRunRecords,
308
309
  readRunRecord
309
- } from "./chunk-YVLQXTUB.js";
310
+ } from "./chunk-MM3662RS.js";
310
311
  import {
311
312
  clipText,
312
313
  formatDuration,
@@ -322,9 +323,9 @@ import {
322
323
  } from "./chunk-PSCNXBYA.js";
323
324
  import {
324
325
  resolvePlatformAuthToken
325
- } from "./chunk-K2AER7RX.js";
326
- import "./chunk-UBUH2TCC.js";
327
- import "./chunk-I4SN4NUQ.js";
326
+ } from "./chunk-SUKSWFLP.js";
327
+ import "./chunk-I2RMFLLH.js";
328
+ import "./chunk-TRW43TSC.js";
328
329
  import "./chunk-5BHQICF2.js";
329
330
  import {
330
331
  isRecord
@@ -347,7 +348,7 @@ import {
347
348
  import {
348
349
  checkForCliUpdate,
349
350
  runSelfUpdateDetailed
350
- } from "./chunk-YBNHPX4S.js";
351
+ } from "./chunk-4RJJDA57.js";
351
352
  import {
352
353
  parseUserIdFromAuthToken,
353
354
  resolveAuthToken,
@@ -366,22 +367,25 @@ import {
366
367
  asOptionalTrimmedString
367
368
  } from "./chunk-G3SUCT4W.js";
368
369
  import {
370
+ PERMISSION_GRANT_KINDS,
369
371
  getAgentSelectionAuditPath,
370
372
  getDefaultProfileConfigPath,
371
373
  getProfileTokens,
372
374
  loadProfileConfig,
375
+ permissionGrantList,
373
376
  readLastAgentSelectionAudit,
374
377
  saveProfileAgentSelection,
375
378
  saveProfileLocale,
379
+ saveProfilePermissionGrant,
376
380
  saveProfileTokens
377
- } from "./chunk-TNIX77YM.js";
381
+ } from "./chunk-R5GO3YZP.js";
378
382
  import {
379
383
  readPipeText,
380
384
  resolveDefaultSpawn,
381
385
  spawnProcess
382
386
  } from "./chunk-Y6ROFCZO.js";
383
- import "./chunk-RVWMAFIT.js";
384
- import "./chunk-CHCS6XPJ.js";
387
+ import "./chunk-FYYSDHVQ.js";
388
+ import "./chunk-CGFNDIKK.js";
385
389
  import {
386
390
  asTrimmedLowercaseString
387
391
  } from "./chunk-QSJ3HFEF.js";
@@ -449,6 +453,44 @@ import { createInterface } from "node:readline";
449
453
  import { PassThrough } from "node:stream";
450
454
  import { stdin as defaultInput, stdout as defaultOutput } from "node:process";
451
455
 
456
+ // packages/cli/tui/permissionGrantPersist.ts
457
+ function createPermissionGrantEnabler(kind, deps) {
458
+ return () => {
459
+ deps.setGrants({ ...deps.getGrants() ?? {}, [kind]: true });
460
+ let saved = null;
461
+ try {
462
+ saved = saveProfilePermissionGrant(kind, true);
463
+ } catch {
464
+ saved = null;
465
+ }
466
+ deps.scheduleRender();
467
+ if (!saved) deps.onPersistFailed();
468
+ };
469
+ }
470
+ function persistPermissionGrantChanges(before, after) {
471
+ const changed = PERMISSION_GRANT_KINDS.filter(
472
+ (kind) => before?.[kind] === true !== (after?.[kind] === true)
473
+ );
474
+ let allSaved = true;
475
+ for (const kind of changed) {
476
+ let saved = null;
477
+ try {
478
+ saved = saveProfilePermissionGrant(kind, after?.[kind] === true);
479
+ } catch {
480
+ saved = null;
481
+ }
482
+ if (!saved) allSaved = false;
483
+ }
484
+ return allSaved;
485
+ }
486
+ function createSnapshotGuardedApproval(kind, getGrants, approve) {
487
+ const snapshot = getGrants()?.[kind] === true;
488
+ return () => {
489
+ if (getGrants()?.[kind] === true !== snapshot) return;
490
+ approve();
491
+ };
492
+ }
493
+
452
494
  // packages/core/crypto.ts
453
495
  import nacl from "tweetnacl";
454
496
 
@@ -671,6 +713,7 @@ var SSR_SNAPSHOT = Object.freeze({
671
713
  });
672
714
  var AccountSessionCore = class {
673
715
  snapshot;
716
+ sessionGeneration = 0;
674
717
  tokenByUserId = /* @__PURE__ */ new Map();
675
718
  listeners = /* @__PURE__ */ new Set();
676
719
  constructor(initial) {
@@ -680,6 +723,7 @@ var AccountSessionCore = class {
680
723
  const parsedActive = rawActiveToken ? parseUserToken(rawActiveToken) : null;
681
724
  const hasValidPair = typeof rawActiveId === "string" && rawActiveId.length > 0 && parsedActive !== null && parsedActive.userId === rawActiveId && accounts.some((account) => account.userId === rawActiveId);
682
725
  this.snapshot = {
726
+ sessionGeneration: this.sessionGeneration,
683
727
  accounts,
684
728
  activeAccountId: hasValidPair ? rawActiveId : null,
685
729
  activeToken: hasValidPair ? rawActiveToken : null,
@@ -707,8 +751,11 @@ var AccountSessionCore = class {
707
751
  listener();
708
752
  }
709
753
  }
710
- setSnapshot(next) {
711
- this.snapshot = next;
754
+ setSnapshot(next, forceAdvanceSession = false) {
755
+ if (forceAdvanceSession || next.activeAccountId !== this.snapshot.activeAccountId || next.activeToken !== this.snapshot.activeToken) {
756
+ this.sessionGeneration += 1;
757
+ }
758
+ this.snapshot = { ...next, sessionGeneration: this.sessionGeneration };
712
759
  this.emit();
713
760
  }
714
761
  initializeFromTokens(tokens, preferredActiveAccountId) {
@@ -785,7 +832,7 @@ var AccountSessionCore = class {
785
832
  activeToken: token,
786
833
  initialized: true,
787
834
  transition: "idle"
788
- });
835
+ }, true);
789
836
  return true;
790
837
  }
791
838
  completeTransition() {
@@ -3517,14 +3564,26 @@ async function runConfirmDialog(args) {
3517
3564
  value: false
3518
3565
  }
3519
3566
  ];
3567
+ const rejectIndex = items.length - 1;
3520
3568
  let titleText = args.request.title;
3521
3569
  let bodyText = args.request.body;
3570
+ let localRunClass = false;
3522
3571
  if (args.request.action === "destructive_shell_command") {
3523
3572
  titleText = t("dialogConfirmTitle");
3524
3573
  bodyText = t("dialogConfirmBody");
3574
+ localRunClass = true;
3525
3575
  } else if (args.request.action === "external_file_access") {
3526
3576
  titleText = t("dialogConfirmExternalFileTitle");
3527
3577
  bodyText = t("dialogConfirmExternalFileBody");
3578
+ localRunClass = true;
3579
+ } else if (args.request.action === "file_write") {
3580
+ titleText = t("dialogConfirmFileWriteTitle");
3581
+ bodyText = t("dialogConfirmFileWriteBody");
3582
+ localRunClass = true;
3583
+ }
3584
+ if (localRunClass && bodyText && args.onApprove) {
3585
+ bodyText = `${bodyText}
3586
+ ${t("dialogConfirmRememberLocal")}`;
3528
3587
  }
3529
3588
  const terminalWidth = typeof output.columns === "number" && output.columns > 0 ? output.columns : FALLBACK_TERMINAL_WIDTH;
3530
3589
  const titleLines = [
@@ -3538,14 +3597,14 @@ async function runConfirmDialog(args) {
3538
3597
  const result = await runSelectDialog({
3539
3598
  items,
3540
3599
  signal: args.signal,
3541
- initialIndex: 1,
3600
+ initialIndex: rejectIndex,
3542
3601
  titleLines,
3543
3602
  input,
3544
3603
  output,
3545
- // Fixed by the modal-ownership spec: this two-item gate never owns the
3546
- // wheel — "transcript" routes wheel/page events to the workspace history,
3604
+ // Fixed by the modal-ownership spec: this gate never owns the wheel —
3605
+ // "transcript" routes wheel/page events to the workspace history,
3547
3606
  // and when no transcript callback exists (standalone runs) the event is
3548
- // simply dropped. The wheel must never flip Allow/Cancel.
3607
+ // simply dropped. The wheel must never flip Approve/Reject.
3549
3608
  inputPolicy: { wheel: "transcript", pageKeys: "transcript" },
3550
3609
  onTranscriptScroll: args.onTranscriptScroll,
3551
3610
  mouseEnabled: args.mouseEnabled,
@@ -3558,7 +3617,14 @@ async function runConfirmDialog(args) {
3558
3617
  if (result.kind === "cancelled") {
3559
3618
  return false;
3560
3619
  }
3561
- return result.item.value;
3620
+ const chosen = result.item;
3621
+ if (chosen.value === true && args.onApprove) {
3622
+ try {
3623
+ args.onApprove();
3624
+ } catch {
3625
+ }
3626
+ }
3627
+ return chosen.value;
3562
3628
  }
3563
3629
 
3564
3630
  // packages/cli/tui/terminalNotification.ts
@@ -7785,7 +7851,7 @@ function estimateToolSchemas(toolNames) {
7785
7851
  const platformTools = platformNames.length > 0 ? prepareTools([...platformNames]) : [];
7786
7852
  return estimateTokenCount(JSON.stringify([...workspaceTools, ...platformTools]));
7787
7853
  }
7788
- function estimateDefaultCliContextTokens(opts = {}) {
7854
+ function buildCliEstimateSystemText(opts = {}) {
7789
7855
  const cwd = opts.cwd?.trim() || process.cwd();
7790
7856
  const model = opts.model?.trim() || BUILTIN_NOLO_AGENT_MODEL;
7791
7857
  const agentName = opts.agentName?.trim() || BUILTIN_NOLO_AGENT_NAME;
@@ -7800,11 +7866,16 @@ function estimateDefaultCliContextTokens(opts = {}) {
7800
7866
  ]);
7801
7867
  const guidance = buildRuntimeGuidanceBlocks(toolNames);
7802
7868
  const toolSections = resolveToolGuidedSections(toolNames);
7869
+ const responseGuidelines = resolveResponseGuidelines(
7870
+ opts.responseViewport ?? "unknown"
7871
+ );
7803
7872
  const systemParts = [
7804
7873
  // 与实际装配线一致:删除安全红线是系统提示词的最顶层块。
7805
7874
  DELETE_SAFETY_RED_LINE,
7875
+ CREDENTIAL_HYGIENE_RULE,
7806
7876
  PARALLEL_DISPATCH_DEFAULT_RULE,
7807
7877
  PLATFORM_RISK_CONTROL_RULE,
7878
+ buildConsultationModeBlock(),
7808
7879
  prompt,
7809
7880
  opts.userLanguage?.trim() ? buildUserResponseLanguageContext({ language: opts.userLanguage }) : "",
7810
7881
  buildIdentityBlock({
@@ -7816,17 +7887,27 @@ function estimateDefaultCliContextTokens(opts = {}) {
7816
7887
  guidance.contextLayerContract,
7817
7888
  guidance.emailRegistrationWorkflow,
7818
7889
  ...Object.values(toolSections),
7890
+ responseGuidelines.behavior,
7891
+ responseGuidelines.presentation,
7819
7892
  readAgentsMd(cwd),
7820
7893
  buildSkillDiscoveryContextBlock(cwd) ?? ""
7821
7894
  ];
7822
- const systemTokens = estimateTokenCount(
7823
- systemParts.filter((part) => part?.trim()).join("\n\n")
7824
- );
7895
+ return systemParts.filter((part) => part?.trim()).join("\n\n");
7896
+ }
7897
+ function estimateDefaultCliContextTokens(opts = {}) {
7898
+ const toolNames = canonicalizeToolNames([
7899
+ ...canonicalizeToolNames(expandEnabledPacks([...DEFAULT_CLI_PACKS], [])),
7900
+ ...DEFAULT_CLI_PLATFORM_TOOLS
7901
+ ]);
7902
+ const systemTokens = estimateTokenCount(buildCliEstimateSystemText(opts));
7825
7903
  const toolTokens = estimateToolSchemas(toolNames);
7826
7904
  const historyTokens = opts.messages && opts.messages.length > 0 ? estimateMessagesTokens(opts.messages) : opts.historyText ? estimateTokenCount(opts.historyText) : 0;
7827
7905
  return Math.max(0, systemTokens + toolTokens + historyTokens);
7828
7906
  }
7829
7907
 
7908
+ // packages/cli/tui/responseViewport.ts
7909
+ var TUI_RESPONSE_VIEWPORT = "narrow";
7910
+
7830
7911
  // packages/cli/tui/sessionDispatch.ts
7831
7912
  import { ulid } from "ulid";
7832
7913
 
@@ -7878,6 +7959,14 @@ function resolveStatusLineCredits(state) {
7878
7959
  }
7879
7960
  return (base ?? 0) + (session ?? 0) + (live ?? 0);
7880
7961
  }
7962
+ function renderPermissionGrantChip(state) {
7963
+ const local = state.permissionGrants?.local === true;
7964
+ const remote = state.permissionGrants?.remote === true;
7965
+ if (local && remote) return "\u23F5 auto";
7966
+ if (local) return "\u23F5 local";
7967
+ if (remote) return "\u23F5 remote";
7968
+ return null;
7969
+ }
7881
7970
  function renderStatusLine(state, maxWidth) {
7882
7971
  const colorEnabled = resolveCliColorEnabled();
7883
7972
  const sep = themeText(" \xB7 ", "chrome", colorEnabled);
@@ -7905,8 +7994,9 @@ function renderStatusLine(state, maxWidth) {
7905
7994
  if (pendingProcessCount > 0) {
7906
7995
  parts.push(themeText(`\u21AA ${pendingProcessCount} pending`, "info", colorEnabled));
7907
7996
  }
7908
- if (state.autoConfirm === true) {
7909
- parts.push(themeText("\u23F5 auto", "warning", colorEnabled));
7997
+ const grantChip = renderPermissionGrantChip(state);
7998
+ if (grantChip) {
7999
+ parts.push(themeText(grantChip, "warning", colorEnabled));
7910
8000
  }
7911
8001
  let surface = colorEnabled ? surfaceBackgroundSequence() : "";
7912
8002
  let padWidth = surface ? 2 : 0;
@@ -7984,7 +8074,7 @@ function renderStatusLine(state, maxWidth) {
7984
8074
  }
7985
8075
  if (widthOf(visibleParts) > maxWidth) {
7986
8076
  const budget = maxWidth - padWidth;
7987
- const autoMark = state.autoConfirm === true ? themeText("\u23F5", "warning", colorEnabled) : "";
8077
+ const autoMark = renderPermissionGrantChip(state) ? themeText("\u23F5", "warning", colorEnabled) : "";
7988
8078
  const gitCounts = state.gitStatus ? themeText(
7989
8079
  `\u2442${state.gitStatus.modified > 0 ? `*${state.gitStatus.modified}` : ""}${state.gitStatus.untracked > 0 ? `?${state.gitStatus.untracked}` : ""}`,
7990
8080
  "warning",
@@ -8282,15 +8372,27 @@ function createInitialTuiState(env = process.env) {
8282
8372
  userLanguage: asOptionalTrimmedString(env.NOLO_LANG),
8283
8373
  gitStatus: void 0,
8284
8374
  thinkingDisplay: resolveThinkingDisplayMode(env),
8375
+ // 持久化的授权桶落成 NOLO_PERMISSION_GRANTS(如 "local,remote");
8376
+ // 缺失即两桶都未授权(逐次询问)。
8377
+ permissionGrants: parsePermissionGrants(env.NOLO_PERMISSION_GRANTS),
8285
8378
  contextWindow: resolveAgentContextWindow({ agentKey, agentName }),
8286
8379
  estimatedContextTokens: estimateDefaultCliContextTokens({
8287
8380
  cwd,
8288
8381
  agentKey,
8289
8382
  userLanguage: asOptionalTrimmedString(env.NOLO_LANG),
8383
+ responseViewport: TUI_RESPONSE_VIEWPORT,
8290
8384
  ...resolveAgentModelIdentity({ agentKey, agentName })
8291
8385
  })
8292
8386
  };
8293
8387
  }
8388
+ function parsePermissionGrants(raw) {
8389
+ const grants = {};
8390
+ for (const part of (raw ?? "").split(",")) {
8391
+ const kind = part.trim().toLowerCase();
8392
+ if (kind === "local" || kind === "remote") grants[kind] = true;
8393
+ }
8394
+ return grants;
8395
+ }
8294
8396
  function applyAgentSwitch(state, target, historyTurns) {
8295
8397
  const contextWindow = resolveAgentContextWindow({
8296
8398
  agentKey: target.key,
@@ -8309,6 +8411,7 @@ function applyAgentSwitch(state, target, historyTurns) {
8309
8411
  agentName: target.name,
8310
8412
  model: target.model,
8311
8413
  userLanguage: state.userLanguage,
8414
+ responseViewport: TUI_RESPONSE_VIEWPORT,
8312
8415
  messages: historyTurns
8313
8416
  })
8314
8417
  },
@@ -8489,30 +8592,56 @@ ${t("cdUsage")}`
8489
8592
  };
8490
8593
  }
8491
8594
  case "/auto": {
8492
- const normalizedArg = asTrimmedLowercaseString(argText);
8493
- if (!normalizedArg) {
8595
+ const words = asTrimmedLowercaseString(argText).split(/\s+/).filter(Boolean);
8596
+ const grants = state.permissionGrants ?? {};
8597
+ const stateLine = () => t(
8598
+ "autoStateLine",
8599
+ grants.local === true ? t("autoStateOnPersisted") : t("autoStateOff"),
8600
+ grants.remote === true ? t("autoStateOnPersisted") : t("autoStateOff")
8601
+ );
8602
+ const applyKinds = (kinds, on) => {
8603
+ const next = { ...grants };
8604
+ for (const kind of kinds) {
8605
+ if (on) next[kind] = true;
8606
+ else delete next[kind];
8607
+ }
8608
+ return { ...state, permissionGrants: next };
8609
+ };
8610
+ if (words.length === 0) {
8611
+ return { nextState: state, output: `${stateLine()}
8612
+ ${t("autoUsage")}` };
8613
+ }
8614
+ const [scope, action] = words;
8615
+ if (scope === "reset") {
8494
8616
  return {
8495
- nextState: state,
8496
- output: `${t("autoCurrent", state.autoConfirm ? "on" : "off")}
8497
- ${t("autoUsage")}`
8617
+ nextState: applyKinds(["local", "remote"], false),
8618
+ output: t("autoReset")
8498
8619
  };
8499
8620
  }
8500
- if (normalizedArg === "on") {
8621
+ if (scope === "on" || scope === "off") {
8622
+ const on = scope === "on";
8501
8623
  return {
8502
- nextState: { ...state, autoConfirm: true },
8503
- output: t("autoOn")
8624
+ nextState: applyKinds(["local", "remote"], on),
8625
+ output: t(
8626
+ on ? "autoGrantOn" : "autoGrantOff",
8627
+ `${t("autoKindLocal")} + ${t("autoKindRemote")}`,
8628
+ on ? "/auto off" : "/auto on"
8629
+ )
8504
8630
  };
8505
8631
  }
8506
- if (normalizedArg === "off") {
8632
+ if ((scope === "local" || scope === "remote") && (action === "on" || action === "off")) {
8633
+ const on = action === "on";
8507
8634
  return {
8508
- nextState: { ...state, autoConfirm: false },
8509
- output: t("autoOff")
8635
+ nextState: applyKinds([scope], on),
8636
+ output: t(
8637
+ on ? "autoGrantOn" : "autoGrantOff",
8638
+ scope === "local" ? t("autoKindLocal") : t("autoKindRemote"),
8639
+ `/auto ${scope} ${on ? "off" : "on"}`
8640
+ )
8510
8641
  };
8511
8642
  }
8512
- return {
8513
- nextState: state,
8514
- output: t("autoUsage")
8515
- };
8643
+ return { nextState: state, output: `${stateLine()}
8644
+ ${t("autoUsage")}` };
8516
8645
  }
8517
8646
  case "/tasks":
8518
8647
  case "/jobs":
@@ -8681,6 +8810,7 @@ ${t("autoUsage")}`
8681
8810
  cwd: state.cwd,
8682
8811
  agentKey: state.agentKey,
8683
8812
  userLanguage: locale,
8813
+ responseViewport: TUI_RESPONSE_VIEWPORT,
8684
8814
  messages: historyTurns,
8685
8815
  ...resolveAgentModelIdentity({
8686
8816
  agentKey: state.agentKey,
@@ -8955,6 +9085,7 @@ function applyAgentSwitchState(state, target, messages) {
8955
9085
  agentName: target.name,
8956
9086
  model: target.model,
8957
9087
  userLanguage: state.userLanguage,
9088
+ responseViewport: TUI_RESPONSE_VIEWPORT,
8958
9089
  messages
8959
9090
  }),
8960
9091
  turnTokens: void 0,
@@ -11736,10 +11867,6 @@ async function runAgentChat(scriptDir, state, message, env, output, agentRunner
11736
11867
  // 宿主环境层(session-scope 稳定前缀):快速注入当前系统发行版、架构与桌面环境
11737
11868
  buildHostEnvironmentLayer()
11738
11869
  ];
11739
- const responseGuidelinesBlock = {
11740
- content: buildResponseGuidelines(true),
11741
- cacheScope: "session"
11742
- };
11743
11870
  let memoryPromptBlock = state.cachedMemoryOverlay;
11744
11871
  if (options.abortSignal?.aborted) {
11745
11872
  throw options.abortSignal.reason ?? new DOMException("Aborted", "AbortError");
@@ -11770,7 +11897,6 @@ async function runAgentChat(scriptDir, state, message, env, output, agentRunner
11770
11897
  }] : [];
11771
11898
  const contextBlockScopes = partitionScopedBlocks([
11772
11899
  ...renderTurnContextBlocksWithScope(layers),
11773
- responseGuidelinesBlock,
11774
11900
  ...renderTurnContextBlocksWithScope([memoryUseGuidanceLayer]),
11775
11901
  // Attached skill bodies are already self-contained sections built by
11776
11902
  // buildSkillContextBlocks; they stay turn-scope because the user can
@@ -11802,6 +11928,10 @@ async function runAgentChat(scriptDir, state, message, env, output, agentRunner
11802
11928
  ...options.onToolExecutionLocation ? { onToolExecutionLocation: options.onToolExecutionLocation } : {},
11803
11929
  ...state.agentKey === DEFAULT_TUI_AGENT_KEY && env.NOLO_AUTO_ROUTE !== "0" ? { dialogAgentMode: "auto" } : { dialogAgentMode: "fixed" },
11804
11930
  runtimeMode: state.runtimeMode,
11931
+ // TUI 是窄屏终端:只声明展示能力,不自拼准则文本。行为段与窄屏排版段
11932
+ // 都由 localLoop(local 线的最终装配边界)经 resolveResponseGuidelines 注入。
11933
+ // 若该轮走远端 server 线,local 线不参与装配,此字段被忽略(server 线自己注入行为段)。
11934
+ responseViewport: TUI_RESPONSE_VIEWPORT,
11805
11935
  // `/lang` updates the in-memory TUI state immediately. Pass that state
11806
11936
  // explicitly so the next real turn cannot keep using the workspace's
11807
11937
  // launch-time NOLO_LANG value while the estimator already uses the new one.
@@ -12129,6 +12259,7 @@ async function resolveActionGate(gate, deps) {
12129
12259
  request: asConfirmPermissionRequest(gate),
12130
12260
  input: deps.input,
12131
12261
  output: deps.output,
12262
+ onApprove: deps.onApprove,
12132
12263
  ...anchor
12133
12264
  })
12134
12265
  );
@@ -12217,7 +12348,7 @@ async function runOneAgentTurn(ctx, inputMsg, imageUrls, actionGateHandler, conf
12217
12348
  };
12218
12349
  emitStatus({ state: "working" });
12219
12350
  const gateHandlerWithStatus = async (gate) => {
12220
- if (ctx.state.autoConfirm && isAutoConfirmableFileWriteGate(gate)) {
12351
+ if (ctx.state.permissionGrants?.local === true && isAutoConfirmableFileWriteGate(gate)) {
12221
12352
  return await actionGateHandler(gate);
12222
12353
  }
12223
12354
  emitStatusUnlessForceStopped({
@@ -12231,7 +12362,7 @@ async function runOneAgentTurn(ctx, inputMsg, imageUrls, actionGateHandler, conf
12231
12362
  }
12232
12363
  };
12233
12364
  const confirmDestructiveActionWithStatus = confirmDestructiveAction && ctx.output.isTTY === true ? async (request) => {
12234
- if (ctx.state.autoConfirm) return await confirmDestructiveAction(request);
12365
+ if (ctx.state.permissionGrants?.local === true) return await confirmDestructiveAction(request);
12235
12366
  emitStatusUnlessForceStopped({ state: "blocked", kind: "permission" });
12236
12367
  try {
12237
12368
  return await confirmDestructiveAction(request);
@@ -12264,6 +12395,7 @@ async function runOneAgentTurn(ctx, inputMsg, imageUrls, actionGateHandler, conf
12264
12395
  agentKey: ctx.state.agentKey,
12265
12396
  agentName: ctx.state.agentName,
12266
12397
  userLanguage: ctx.state.userLanguage,
12398
+ responseViewport: TUI_RESPONSE_VIEWPORT,
12267
12399
  messages: ctx.history.turns,
12268
12400
  ...resolveAgentModelIdentity({
12269
12401
  agentKey: ctx.state.agentKey,
@@ -12486,6 +12618,7 @@ async function runOneAgentTurn(ctx, inputMsg, imageUrls, actionGateHandler, conf
12486
12618
  agentKey: ctx.state.agentKey,
12487
12619
  agentName: ctx.state.agentName,
12488
12620
  userLanguage: ctx.state.userLanguage,
12621
+ responseViewport: TUI_RESPONSE_VIEWPORT,
12489
12622
  messages: ctx.history.turns
12490
12623
  }),
12491
12624
  lastAuthorityTurnCount: void 0,
@@ -14061,6 +14194,12 @@ async function runSubmittedSlashLine(line, host, actionGateHandler, confirmDestr
14061
14194
  const previousState = host.state;
14062
14195
  const previousAgentKey = host.state.agentKey;
14063
14196
  host.state = result.nextState;
14197
+ if (previousState.permissionGrants?.remote === true && host.state.permissionGrants?.remote !== true) {
14198
+ host.revokeRemoteShellGrants?.();
14199
+ }
14200
+ if (!persistPermissionGrantChanges(previousState.permissionGrants, host.state.permissionGrants)) {
14201
+ emitCommandOutput(t("autoPersistFailed"));
14202
+ }
14064
14203
  const command = line.trim().split(/\s+/)[0];
14065
14204
  if ((command === "/agent" || command === "/switch") && result.nextState !== previousState) {
14066
14205
  clearCliLocalRuntimePreparedAgentCache();
@@ -14120,6 +14259,7 @@ async function runSubmittedSlashLine(line, host, actionGateHandler, confirmDestr
14120
14259
  cwd: host.state.cwd,
14121
14260
  agentKey: host.state.agentKey,
14122
14261
  userLanguage: host.state.userLanguage,
14262
+ responseViewport: TUI_RESPONSE_VIEWPORT,
14123
14263
  ...resolveAgentModelIdentity({
14124
14264
  agentKey: host.state.agentKey,
14125
14265
  agentName: host.state.agentName
@@ -14221,6 +14361,7 @@ async function runSubmittedSlashLine(line, host, actionGateHandler, confirmDestr
14221
14361
  cwd: host.state.cwd,
14222
14362
  agentKey: host.state.agentKey,
14223
14363
  userLanguage: host.state.userLanguage,
14364
+ responseViewport: TUI_RESPONSE_VIEWPORT,
14224
14365
  messages: [
14225
14366
  ...compactResult.summary ? [{ role: "system", content: compactResult.summary }] : [],
14226
14367
  ...compactResult.compactedMessageCount > 0 ? host.history.turns.slice(compactResult.compactedMessageCount) : compactResult.summaryGenerated ? [] : host.history.turns
@@ -14353,6 +14494,7 @@ async function runSubmittedSlashLine(line, host, actionGateHandler, confirmDestr
14353
14494
  agentName: pickResult.name,
14354
14495
  model: pickResult.model,
14355
14496
  userLanguage: host.state.userLanguage,
14497
+ responseViewport: TUI_RESPONSE_VIEWPORT,
14356
14498
  messages: host.history.turns
14357
14499
  }),
14358
14500
  turnTokens: void 0,
@@ -14491,6 +14633,7 @@ async function runSubmittedSlashLine(line, host, actionGateHandler, confirmDestr
14491
14633
  agentKey: host.state.agentKey,
14492
14634
  agentName: host.state.agentName,
14493
14635
  userLanguage: host.state.userLanguage,
14636
+ responseViewport: TUI_RESPONSE_VIEWPORT,
14494
14637
  messages: history.turns,
14495
14638
  ...resolveAgentModelIdentity({
14496
14639
  agentKey: host.state.agentKey,
@@ -14971,6 +15114,19 @@ async function runTuiWorkspace(options) {
14971
15114
  output.write(pinnedAgentNotice);
14972
15115
  initialBannerLineCount += pinnedAgentNotice.split("\n").length - 1;
14973
15116
  }
15117
+ const startupGrantKinds = permissionGrantList(state.permissionGrants);
15118
+ if (startupGrantKinds.length > 0) {
15119
+ output.write(
15120
+ `${t(
15121
+ "autoPersistedStartup",
15122
+ startupGrantKinds.map(
15123
+ (kind) => kind === "local" ? t("autoKindLocal") : t("autoKindRemote")
15124
+ ).join(" + ")
15125
+ )}
15126
+
15127
+ `
15128
+ );
15129
+ }
14974
15130
  let lastSentTitle = null;
14975
15131
  const syncWindowTitle = () => {
14976
15132
  if (!output.isTTY) return;
@@ -15292,6 +15448,16 @@ async function runTuiWorkspace(options) {
15292
15448
  renderHistoryToOutput();
15293
15449
  if (fixedInput.active) fixedInput.repaint(buffer, cursorPos);
15294
15450
  };
15451
+ const grantEnablerDeps = {
15452
+ getGrants: () => state.permissionGrants,
15453
+ setGrants: (next) => {
15454
+ state = { ...state, permissionGrants: next };
15455
+ },
15456
+ scheduleRender,
15457
+ onPersistFailed: () => emitCommandOutput(t("autoPersistFailed"))
15458
+ };
15459
+ const approveLocalConfirms = createPermissionGrantEnabler("local", grantEnablerDeps);
15460
+ const approveRemoteShell = createPermissionGrantEnabler("remote", grantEnablerDeps);
15295
15461
  const applyClipboardPasteResult = (outcome, source) => {
15296
15462
  const colorEnabled = resolveCliColorEnabled();
15297
15463
  if (outcome.kind === "image") {
@@ -15349,24 +15515,29 @@ async function runTuiWorkspace(options) {
15349
15515
  id: `child-shell-${crypto.randomUUID()}`,
15350
15516
  tool: "execShell",
15351
15517
  action: "shell-per-call",
15352
- title: "Background shell \u2014 approve this command once?",
15353
- body: `Run: ${request.runId}
15354
- Agent: ${request.agentKey}
15355
- Owner: ${request.ownerUserId}
15356
- Device: ${request.deviceId}
15357
- Workspace: ${request.workspaceRoot}
15358
- ${request.permissionNotice}`,
15518
+ title: t("shellPerCall.title"),
15519
+ body: t(
15520
+ "shellPerCall.body",
15521
+ request.runId,
15522
+ request.agentKey,
15523
+ request.ownerUserId,
15524
+ request.deviceId,
15525
+ request.workspaceRoot,
15526
+ request.permissionNotice
15527
+ ),
15359
15528
  command: request.command
15360
15529
  },
15361
15530
  signal,
15362
15531
  fullCommand: true,
15363
15532
  input,
15364
15533
  output,
15534
+ onApprove: createSnapshotGuardedApproval("remote", () => state.permissionGrants, approveRemoteShell),
15365
15535
  ...anchor
15366
15536
  }));
15367
- }), () => state.autoConfirm === true);
15537
+ }), () => state.permissionGrants?.remote === true);
15368
15538
  const sessionShellGrant = createOriginShellGrant({
15369
15539
  confirm: async (request) => {
15540
+ if (state.permissionGrants?.remote === true) return true;
15370
15541
  return await runWithInputRequiredAttention(
15371
15542
  { output, env: effectiveEnv },
15372
15543
  () => dialogHost.run(
@@ -15392,12 +15563,18 @@ ${request.permissionNotice}`,
15392
15563
  },
15393
15564
  input,
15394
15565
  output,
15566
+ onApprove: createSnapshotGuardedApproval("remote", () => state.permissionGrants, approveRemoteShell),
15395
15567
  ...anchor
15396
15568
  })
15397
15569
  )
15398
15570
  );
15399
15571
  }
15400
15572
  });
15573
+ const shellGrantForTurns = {
15574
+ isGranted: () => state.permissionGrants?.remote === true || sessionShellGrant.isGranted(),
15575
+ requestGrant: (request) => sessionShellGrant.requestGrant(request),
15576
+ revoke: () => sessionShellGrant.revoke()
15577
+ };
15401
15578
  let turnIdentity = 0;
15402
15579
  const turnCtx = {
15403
15580
  get state() {
@@ -15466,7 +15643,7 @@ ${request.permissionNotice}`,
15466
15643
  },
15467
15644
  // 分享 OAuth agent 的 shell 会话授权(块 D):会话级单例透传给 turn
15468
15645
  // 执行路径;撤销经 /shell-revoke 或设置面板调 sessionShellGrant.revoke()。
15469
- shellGrant: sessionShellGrant,
15646
+ shellGrant: shellGrantForTurns,
15470
15647
  shellApprovalSession: childShellApprovals.session,
15471
15648
  // 运行位置展示(块 D):owner-required 场景 adapter 回调一次;渲染一行
15472
15649
  // 「工具在 <deviceName>(<deviceId>) · workspace <root> · status: <s>」。
@@ -15542,6 +15719,10 @@ ${request.permissionNotice}`,
15542
15719
  get fixedInput() {
15543
15720
  return fixedInput;
15544
15721
  },
15722
+ revokeRemoteShellGrants: () => {
15723
+ sessionShellGrant.revoke();
15724
+ childShellApprovals.revoke();
15725
+ },
15545
15726
  history,
15546
15727
  pasteStore,
15547
15728
  dialogHost,
@@ -15568,6 +15749,14 @@ ${request.permissionNotice}`,
15568
15749
  const wasGranted = sessionShellGrant.isGranted();
15569
15750
  sessionShellGrant.revoke();
15570
15751
  childShellApprovals.revoke();
15752
+ if (state.permissionGrants?.remote === true) {
15753
+ const nextGrants = { ...state.permissionGrants };
15754
+ delete nextGrants.remote;
15755
+ state = { ...state, permissionGrants: nextGrants };
15756
+ if (!persistPermissionGrantChanges({ remote: true }, nextGrants)) {
15757
+ emitCommandOutput(t("autoPersistFailed"));
15758
+ }
15759
+ }
15571
15760
  emitCommandOutput(
15572
15761
  wasGranted ? t("shellGrant.revoked") : t("shellGrant.revokeNone"),
15573
15762
  "/shell-revoke"
@@ -15691,7 +15880,7 @@ ${request.permissionNotice}`,
15691
15880
  };
15692
15881
  const buildInteractiveTurnHandlers = () => {
15693
15882
  const actionGateHandler = async (gate) => {
15694
- if (state.autoConfirm && isAutoConfirmableFileWriteGate(gate)) {
15883
+ if (state.permissionGrants?.local === true && isAutoConfirmableFileWriteGate(gate)) {
15695
15884
  return buildGateConfirmedResult(gate);
15696
15885
  }
15697
15886
  return await runWithInputRequiredAttention(
@@ -15706,12 +15895,13 @@ ${request.permissionNotice}`,
15706
15895
  },
15707
15896
  pauseComposer: () => fixedInput.pause(),
15708
15897
  resumeComposerFromSubprocess: () => fixedInput.resumeFromSubprocess(),
15709
- resumeComposerFromDialog: () => fixedInput.resumeFromDialog()
15898
+ resumeComposerFromDialog: () => fixedInput.resumeFromDialog(),
15899
+ onApprove: createSnapshotGuardedApproval("local", () => state.permissionGrants, approveLocalConfirms)
15710
15900
  })
15711
15901
  );
15712
15902
  };
15713
15903
  const confirmDestructiveAction = async (request) => {
15714
- if (state.autoConfirm) return true;
15904
+ if (state.permissionGrants?.local === true) return true;
15715
15905
  return await runWithInputRequiredAttention(
15716
15906
  { output, env: effectiveEnv },
15717
15907
  () => dialogHost.run(
@@ -15719,6 +15909,7 @@ ${request.permissionNotice}`,
15719
15909
  request,
15720
15910
  input,
15721
15911
  output,
15912
+ onApprove: createSnapshotGuardedApproval("local", () => state.permissionGrants, approveLocalConfirms),
15722
15913
  ...anchor
15723
15914
  })
15724
15915
  )
@@ -15986,6 +16177,15 @@ ${err.message}` : ""}`
15986
16177
  const wasGranted = sessionShellGrant.isGranted();
15987
16178
  sessionShellGrant.revoke();
15988
16179
  childShellApprovals.revoke();
16180
+ if (state.permissionGrants?.remote === true) {
16181
+ const nextGrants = { ...state.permissionGrants };
16182
+ delete nextGrants.remote;
16183
+ state = { ...state, permissionGrants: nextGrants };
16184
+ if (!persistPermissionGrantChanges({ remote: true }, nextGrants)) {
16185
+ output.write(`[nolo] ${t("autoPersistFailed")}
16186
+ `);
16187
+ }
16188
+ }
15989
16189
  emitCommandOutput(
15990
16190
  wasGranted ? t("shellGrant.revoked") : t("shellGrant.revokeNone"),
15991
16191
  "/shell-revoke"
@@ -16054,8 +16254,19 @@ ${err.message}` : ""}`
16054
16254
  "Model picker isn't available while a reply is running. Use `/switch <name>` to switch now (takes effect on the next turn), or wait for the reply to finish.\n"
16055
16255
  );
16056
16256
  } else {
16257
+ const grantsBefore = state.permissionGrants;
16057
16258
  state = res.nextState;
16259
+ if (grantsBefore?.remote === true && state.permissionGrants?.remote !== true) {
16260
+ sessionShellGrant.revoke();
16261
+ childShellApprovals.revoke();
16262
+ }
16058
16263
  let msg = res.output;
16264
+ if (!persistPermissionGrantChanges(grantsBefore, state.permissionGrants)) {
16265
+ output.write(`[nolo] ${t("autoPersistFailed")}
16266
+ `);
16267
+ } else if (state.permissionGrants !== grantsBefore) {
16268
+ scheduleRender();
16269
+ }
16059
16270
  if (busySlashCommand === "/switch" && persistExplicitAgentSwitch(beforeAgentKey)) {
16060
16271
  const hint = "Note: the new model takes effect on the next turn. Switching models may consume more tokens because the conversation context is re-sent to the new model.";
16061
16272
  msg = msg ? `${msg}
@@ -16442,10 +16653,10 @@ ${merged}` : merged;
16442
16653
  (gate) => (
16443
16654
  // /auto on 同款短路,见上方交互路径的 actionGateHandler 注释:
16444
16655
  // 只放行 file_write 的 confirm gate,handoff/input 类仍要求真人操作。
16445
- state.autoConfirm && isAutoConfirmableFileWriteGate(gate) ? Promise.resolve(buildGateConfirmedResult(gate)) : waitForActionGate(rl, input, output, gate, spawnRunner)
16656
+ state.permissionGrants?.local === true && isAutoConfirmableFileWriteGate(gate) ? Promise.resolve(buildGateConfirmedResult(gate)) : waitForActionGate(rl, input, output, gate, spawnRunner)
16446
16657
  ),
16447
16658
  async (request) => {
16448
- if (state.autoConfirm) return true;
16659
+ if (state.permissionGrants?.local === true) return true;
16449
16660
  if (!isInteractiveInput(input)) {
16450
16661
  return false;
16451
16662
  }
@@ -16456,6 +16667,7 @@ ${merged}` : merged;
16456
16667
  request,
16457
16668
  input,
16458
16669
  output,
16670
+ onApprove: createSnapshotGuardedApproval("local", () => state.permissionGrants, approveLocalConfirms),
16459
16671
  ...anchor
16460
16672
  })
16461
16673
  );