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