nolo-cli 0.212.0-alpha.1 → 0.213.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.
- package/{_executeModel-KE6MBNUJ.js → _executeModel-CUJLCFWR.js} +35 -35
- package/{addContentAction-N2YC5IL3.js → addContentAction-WERAONNY.js} +5 -5
- package/{addDialogAgentAction-3NKVQCEC.js → addDialogAgentAction-7VI7YRML.js} +4 -4
- package/{agentDeleteCommand-NWK7VU4N.js → agentDeleteCommand-XJORXPGU.js} +42 -42
- package/{agentEmailCommands-UZ4DHEX2.js → agentEmailCommands-XTYYFR6Z.js} +43 -43
- package/{agentListCommands-HE7L2A6L.js → agentListCommands-OBLRBLHS.js} +60 -51
- package/{agentMachineCommands-6TE4MBMP.js → agentMachineCommands-5FMT3OT5.js} +13 -12
- package/{agentRecordCommands-L3QQ7HZ4.js → agentRecordCommands-ZQ7SVYGG.js} +42 -42
- package/{agentRunCommand-2IFGQHCO.js → agentRunCommand-WS7IGO2W.js} +43 -43
- package/{agentRunControl-OI3LOENH.js → agentRunControl-TAMHJQSR.js} +3 -3
- package/{agentRuntimeLocal-HL526DNQ.js → agentRuntimeLocal-SOO2OPJG.js} +10 -10
- package/{agentSlice-TMYP2UEA.js → agentSlice-CHR6KOZN.js} +5 -5
- package/{appDeleteCommands-ZERW4AXY.js → appDeleteCommands-GUP6P5YE.js} +15 -14
- package/{appDeployCommands-DUWSMYHL.js → appDeployCommands-MH2FX4O5.js} +15 -14
- package/{appDeployStatusCommands-N2KIE4BF.js → appDeployStatusCommands-SUHN3HPJ.js} +15 -14
- package/{appGetCommands-YVR4NPVY.js → appGetCommands-YWDEX6Z4.js} +15 -14
- package/{appListCommands-JS6HOHZS.js → appListCommands-ZQVMLPAY.js} +15 -14
- package/{authCommand-FE2C3ZUM.js → authCommand-PWX2ZNUP.js} +2 -2
- package/{builtinSkillRegistry-3YOIGEF6.js → builtinSkillRegistry-2QETTQPM.js} +2 -2
- package/{chromeOpsCommands-HEN5AX2J.js → chromeOpsCommands-DIVM2K3T.js} +1 -1
- package/{chunk-YUXQAVRD.js → chunk-3UKL3HPD.js} +251 -14
- package/{chunk-PDGKOTO7.js → chunk-4T2WNOY7.js} +4 -4
- package/{chunk-NOMIGOST.js → chunk-5MQRBSMW.js} +35 -41
- package/{chunk-5RYBGBQH.js → chunk-6DWMYIUY.js} +3 -3
- package/{chunk-KSTEXKL6.js → chunk-75XIDFBW.js} +4 -3
- package/{chunk-CZM5YTZ7.js → chunk-7BT37FK3.js} +193 -305
- package/{chunk-GPO7FCEZ.js → chunk-7QTZCMKL.js} +159 -106
- package/{chunk-NJR3WKVP.js → chunk-7Y4YTDQF.js} +6 -6
- package/{chunk-CKAHAVMK.js → chunk-A7TFUNZO.js} +35 -25
- package/{chunk-PJNFNEJE.js → chunk-ALQ3657A.js} +28 -2
- package/{chunk-YJMRHHGY.js → chunk-BBJ22CLB.js} +5 -5
- package/{chunk-AVTVGMDY.js → chunk-COFEN36Z.js} +1 -1
- package/{chunk-DM6UMOEL.js → chunk-CRHOO2ZR.js} +1 -1
- package/{chunk-EYUBHHFB.js → chunk-EHGEOAHI.js} +2 -2
- package/{chunk-Y2WUYX4I.js → chunk-EHSZD5OI.js} +1 -1
- package/{chunk-QT6PKHYJ.js → chunk-FUGMREBO.js} +2 -2
- package/{chunk-BFM34N54.js → chunk-FW6YHHLI.js} +4 -4
- package/{chunk-3FOQHGHN.js → chunk-G2BQWAVT.js} +2 -2
- package/{chunk-VPAZOH2D.js → chunk-GPVRUGGY.js} +1 -1
- package/{chunk-JNKSDZFS.js → chunk-H4UOTUOX.js} +162 -48
- package/{chunk-UTV2AYEG.js → chunk-H5HF7TJA.js} +1 -1
- package/{chunk-IJXYFTV7.js → chunk-H7PPIYWP.js} +1 -1
- package/{chunk-NRFKLKRU.js → chunk-HSVBJRF4.js} +1 -1
- package/{chunk-GNDJKC4B.js → chunk-HUBHAQK2.js} +8 -8
- package/{chunk-LKDF3ATR.js → chunk-INUFILG6.js} +1 -1
- package/{chunk-OHNELDTO.js → chunk-IXNGOHV5.js} +2 -2
- package/{chunk-WXYLV624.js → chunk-J2NHJ7WX.js} +4 -4
- package/{chunk-YPD3VJZW.js → chunk-KFLT5KAD.js} +4 -4
- package/{chunk-OOF4UPC5.js → chunk-LLRPJECG.js} +4 -4
- package/{chunk-B7NJ3T4A.js → chunk-MDB67IWP.js} +4 -4
- package/{chunk-IF45XG7K.js → chunk-MOIJOHA5.js} +9 -4
- package/{chunk-IIQ6JGRI.js → chunk-NJLL224W.js} +1 -1
- package/{chunk-YOIW77S2.js → chunk-NOKUNJON.js} +2 -2
- package/{chunk-HIRC32DV.js → chunk-NSAPDIN2.js} +8 -4
- package/{chunk-JIT6FSXJ.js → chunk-O2TZF4AI.js} +1 -1
- package/{chunk-4KH4J3G5.js → chunk-OQPKUBPB.js} +1 -1
- package/{chunk-OXME3PEE.js → chunk-PCLE46CE.js} +1 -1
- package/{chunk-CJRONOYL.js → chunk-QG4AOSON.js} +8 -45
- package/{chunk-6OQUPIQF.js → chunk-QHPRUL4O.js} +3 -3
- package/{chunk-MMNYUVLW.js → chunk-R5O4QAWG.js} +1 -1
- package/{chunk-IAPCBNEE.js → chunk-RLBNLZVC.js} +1 -1
- package/{chunk-FHU44LN3.js → chunk-RSHTSUEG.js} +246 -77
- package/{chunk-25JZEIXN.js → chunk-RZOV7OMV.js} +11 -11
- package/{chunk-D2MDMY2M.js → chunk-SVYO6AO7.js} +7 -1
- package/{chunk-INSBKSBB.js → chunk-TAKB25RM.js} +1 -1
- package/{chunk-RU4SD66C.js → chunk-TX5EYMGT.js} +5 -5
- package/{chunk-D5RCRX4A.js → chunk-UYD5HQ6T.js} +746 -177
- package/{chunk-JTDORD5P.js → chunk-V5Y3R6BT.js} +110 -2
- package/{chunk-3RQVYR4B.js → chunk-VNYYOX3V.js} +59 -20
- package/{chunk-3AKFVZ2I.js → chunk-VO4WSAVP.js} +3 -3
- package/{chunk-6NSSLV67.js → chunk-WMTBPBMP.js} +6 -6
- package/{chunk-EZFQ6XRV.js → chunk-WRYQ35LQ.js} +4 -4
- package/{chunk-SOHTHFV2.js → chunk-WYDI6TGM.js} +14 -14
- package/{chunk-M6RL5JCD.js → chunk-X7SDOJUM.js} +3 -3
- package/{chunk-CQ46IRNN.js → chunk-XHQC4PXX.js} +48 -34
- package/{chunk-2WZXXAQD.js → chunk-YB3YZK56.js} +67 -1
- package/{chunk-22CIEBYO.js → chunk-YJAFKXMU.js} +11 -11
- package/{chunk-GSQNH63I.js → chunk-YTF4WH7J.js} +3 -19
- package/{chunk-5AQR3DGV.js → chunk-ZNWI6OVT.js} +2 -2
- package/{chunk-VZKUKCA6.js → chunk-ZXOUUDCG.js} +49 -40
- package/{commandRegistry-VVMTPFAX.js → commandRegistry-W63CYRZJ.js} +64 -64
- package/{contentThunks-N52O67MI.js → contentThunks-U7PL5MQD.js} +12 -12
- package/{cooldownCommands-YXLWOXWR.js → cooldownCommands-TIGUHXTD.js} +3 -3
- package/{createAgentAutomationAction-ZC57YRSV.js → createAgentAutomationAction-OLBQDD6R.js} +12 -12
- package/{createDialogAction-VQW5WDYX.js → createDialogAction-SVH6B3SB.js} +14 -14
- package/{createPageAction-M5VDA7SC.js → createPageAction-F4DIWZ2Z.js} +14 -14
- package/{dbSlice-HP7G4LX3.js → dbSlice-BVH2YZPQ.js} +4 -4
- package/{deleteFile-7VQGLK2V.js → deleteFile-5YOEKV4U.js} +2 -2
- package/{dialogCommands-JHMR2N2Y.js → dialogCommands-KHIEPY3M.js} +18 -18
- package/{dialogSlice-GRSVGDTF.js → dialogSlice-ZCTDV2PZ.js} +11 -11
- package/{docCreateCommands-F2K3UPSQ.js → docCreateCommands-DPMZI7G5.js} +14 -13
- package/{docDeleteCommands-XGXB5RFT.js → docDeleteCommands-IRQQLUBT.js} +16 -16
- package/{docReadCommands-7HWZZV6J.js → docReadCommands-LK37XH6L.js} +14 -13
- package/{docStore-KNZK6Y2G.js → docStore-V2KECILA.js} +5 -5
- package/{docUpdateCommands-OZZ7NQII.js → docUpdateCommands-O6T3HJHH.js} +14 -13
- package/{fetchMessages-M3QU7ZCQ.js → fetchMessages-NR4KNQLO.js} +2 -2
- package/{handleSendMessageAction-SHIH74GJ.js → handleSendMessageAction-2PE25WM3.js} +25 -25
- package/{hostCredentialCreate-X64WK4JD.js → hostCredentialCreate-S233UMAP.js} +42 -42
- package/index.js +7 -7
- package/{localDialogRead-XRLAH4CZ.js → localDialogRead-7NNDVVF7.js} +1 -1
- package/{localRuntimeAdapter-A7K3ABA6.js → localRuntimeAdapter-KY6WXNBR.js} +41 -41
- package/{machineCommands-DE3MR7CJ.js → machineCommands-Q6HA3IXF.js} +42 -42
- package/{machineWsRunDispatch-R26P5V36.js → machineWsRunDispatch-WWJQ6WR3.js} +42 -42
- package/{memberThunks-7WJAY5V6.js → memberThunks-7EDJADWU.js} +5 -5
- package/package.json +1 -1
- package/{projectArchive-GGL5HLMD.js → projectArchive-DRTDIMEV.js} +14 -14
- package/{read-4VZQODSN.js → read-4V2RMG7N.js} +2 -2
- package/{readDocTool-AVD32RUJ.js → readDocTool-BH6ATGQO.js} +1 -1
- package/{readlineWorkspace-XKYKNL2I.js → readlineWorkspace-2W4WRCOU.js} +322 -159
- package/{removeDialogAgentAction-FKL4BYMR.js → removeDialogAgentAction-LYAZGNKW.js} +5 -5
- package/{runAgentClientLoop-V7E2WBVM.js → runAgentClientLoop-J2VQBS2Z.js} +33 -33
- package/{secretCommands-4QS3HCA2.js → secretCommands-LXDWOLZ6.js} +1 -1
- package/{setDialogExtraReferencesAction-TLIOLWWI.js → setDialogExtraReferencesAction-OCRPGPYH.js} +5 -5
- package/{setPrimaryDialogAgentAction-2OLWRFYR.js → setPrimaryDialogAgentAction-HFJDQIBU.js} +5 -5
- package/{settingThunks-UGBPCNYF.js → settingThunks-RAMHMTGM.js} +7 -7
- package/{spaceCommands-4KSLKVNF.js → spaceCommands-KVJZVKVO.js} +14 -14
- package/{streamAgentChatTurn-7FR7X2NU.js → streamAgentChatTurn-GHBMJJ6S.js} +37 -37
- package/{switchDialogAgentAction-UZSAG2N5.js → switchDialogAgentAction-EBRMW3RA.js} +4 -4
- package/{tools-ZLKCC25W.js → tools-EWKCPKMS.js} +28 -28
- package/{tuiSummaryLlmCaller-WC54MVGP.js → tuiSummaryLlmCaller-ALQYUUWB.js} +41 -12
- package/{updateCommands-4744PL3P.js → updateCommands-ZQYU6SCI.js} +3 -3
- package/{updateDialogTitleAction-U53ZT7PJ.js → updateDialogTitleAction-5GGMBTDF.js} +12 -12
- package/{windowsSelfUpdate-XSQVF2GK.js → windowsSelfUpdate-257DV2T6.js} +2 -2
- package/{workloadLifecycle-4BEQHMSD.js → workloadLifecycle-4C42SVBD.js} +1 -0
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import {
|
|
2
2
|
fetchCiStatus,
|
|
3
3
|
summarizeLatest
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-A7TFUNZO.js";
|
|
5
5
|
import "./chunk-M3JEW6N6.js";
|
|
6
6
|
import {
|
|
7
7
|
resolveAuthGuidanceState
|
|
@@ -12,19 +12,19 @@ import {
|
|
|
12
12
|
normalizeDialogRecord,
|
|
13
13
|
readDialogSnapshot,
|
|
14
14
|
sortDialogs
|
|
15
|
-
} from "./chunk-
|
|
15
|
+
} from "./chunk-WMTBPBMP.js";
|
|
16
16
|
import {
|
|
17
17
|
listFavoriteAgentIdsAcrossServers,
|
|
18
18
|
listLocalCachedAgents,
|
|
19
19
|
listRemoteAgents,
|
|
20
20
|
listRemoteAgentsAcrossServers,
|
|
21
21
|
normalizeListedAgent
|
|
22
|
-
} from "./chunk-
|
|
22
|
+
} from "./chunk-J2NHJ7WX.js";
|
|
23
23
|
import "./chunk-ID4G2MAR.js";
|
|
24
24
|
import {
|
|
25
25
|
listUserRecordsFromServers,
|
|
26
26
|
readLiveDbRecordAfterTombstoneMerge
|
|
27
|
-
} from "./chunk-
|
|
27
|
+
} from "./chunk-VO4WSAVP.js";
|
|
28
28
|
import {
|
|
29
29
|
ANSI_ESCAPE_REGEX,
|
|
30
30
|
COLLAPSED_PASTE_PLACEHOLDER_RE,
|
|
@@ -101,10 +101,10 @@ import {
|
|
|
101
101
|
wrapTextToLines,
|
|
102
102
|
wrapTranscriptLine,
|
|
103
103
|
wrapTranscriptLineWithLayout
|
|
104
|
-
} from "./chunk-
|
|
104
|
+
} from "./chunk-7QTZCMKL.js";
|
|
105
105
|
import "./chunk-6QDYSCPW.js";
|
|
106
106
|
import "./chunk-Y5GCAMGP.js";
|
|
107
|
-
import "./chunk-
|
|
107
|
+
import "./chunk-HSVBJRF4.js";
|
|
108
108
|
import {
|
|
109
109
|
refreshSubscriptionQuotas
|
|
110
110
|
} from "./chunk-YGILMZ7N.js";
|
|
@@ -118,7 +118,7 @@ import {
|
|
|
118
118
|
runXaiOAuthDeviceCode,
|
|
119
119
|
runXaiOAuthLogin,
|
|
120
120
|
syncCredentialToServer
|
|
121
|
-
} from "./chunk-
|
|
121
|
+
} from "./chunk-H7PPIYWP.js";
|
|
122
122
|
import {
|
|
123
123
|
runCloudflareOAuthLogin
|
|
124
124
|
} from "./chunk-7OCO4TDT.js";
|
|
@@ -137,14 +137,14 @@ import {
|
|
|
137
137
|
formatApprovalRemaining,
|
|
138
138
|
readTimestamp,
|
|
139
139
|
registerHostApprovalRenderer
|
|
140
|
-
} from "./chunk-
|
|
140
|
+
} from "./chunk-UYD5HQ6T.js";
|
|
141
141
|
import "./chunk-VP3BINY7.js";
|
|
142
|
-
import "./chunk-
|
|
142
|
+
import "./chunk-YTF4WH7J.js";
|
|
143
143
|
import {
|
|
144
144
|
deleteDbRecord,
|
|
145
145
|
queryUserRecords,
|
|
146
146
|
readDbRecord
|
|
147
|
-
} from "./chunk-
|
|
147
|
+
} from "./chunk-MOIJOHA5.js";
|
|
148
148
|
import "./chunk-WOAZVUSN.js";
|
|
149
149
|
import {
|
|
150
150
|
anthropicGrantRemainingMs,
|
|
@@ -169,51 +169,54 @@ import "./chunk-ATNTHIZI.js";
|
|
|
169
169
|
import "./chunk-JEXVIMYZ.js";
|
|
170
170
|
import {
|
|
171
171
|
prepareTools
|
|
172
|
-
} from "./chunk-
|
|
172
|
+
} from "./chunk-G2BQWAVT.js";
|
|
173
173
|
import "./chunk-HS7MLR74.js";
|
|
174
|
-
import "./chunk-
|
|
174
|
+
import "./chunk-XHQC4PXX.js";
|
|
175
175
|
import "./chunk-KFHREHUQ.js";
|
|
176
|
-
import "./chunk-
|
|
177
|
-
import "./chunk-
|
|
178
|
-
import "./chunk-
|
|
179
|
-
import "./chunk-
|
|
176
|
+
import "./chunk-QG4AOSON.js";
|
|
177
|
+
import "./chunk-PCLE46CE.js";
|
|
178
|
+
import "./chunk-IXNGOHV5.js";
|
|
179
|
+
import "./chunk-75XIDFBW.js";
|
|
180
180
|
import {
|
|
181
181
|
formatSkillSlashReference,
|
|
182
182
|
parseSkillSlashReference,
|
|
183
183
|
resolveSkillSlashUserPrompt
|
|
184
184
|
} from "./chunk-PRJ473FK.js";
|
|
185
185
|
import "./chunk-BMQ2MJUK.js";
|
|
186
|
-
import "./chunk-
|
|
187
|
-
import "./chunk-
|
|
186
|
+
import "./chunk-ZNWI6OVT.js";
|
|
187
|
+
import "./chunk-HUBHAQK2.js";
|
|
188
188
|
import "./chunk-NF64D32W.js";
|
|
189
189
|
import "./chunk-3L2WKC3W.js";
|
|
190
|
-
import "./chunk-
|
|
191
|
-
import "./chunk-
|
|
190
|
+
import "./chunk-R5O4QAWG.js";
|
|
191
|
+
import "./chunk-6DWMYIUY.js";
|
|
192
192
|
import "./chunk-MYOH447Z.js";
|
|
193
193
|
import "./chunk-VF4K2QE6.js";
|
|
194
|
-
import "./chunk-
|
|
195
|
-
import "./chunk-
|
|
194
|
+
import "./chunk-TAKB25RM.js";
|
|
195
|
+
import "./chunk-RLBNLZVC.js";
|
|
196
196
|
import "./chunk-AGIM7IMJ.js";
|
|
197
197
|
import "./chunk-INN4LTAJ.js";
|
|
198
198
|
import "./chunk-VIDPVFP3.js";
|
|
199
199
|
import "./chunk-63W5N6P3.js";
|
|
200
|
-
import "./chunk-
|
|
201
|
-
import "./chunk-
|
|
200
|
+
import "./chunk-LLRPJECG.js";
|
|
201
|
+
import "./chunk-7Y4YTDQF.js";
|
|
202
202
|
import {
|
|
203
203
|
estimateMessagesTokens,
|
|
204
204
|
historyTokensBeforeLatestAssistant
|
|
205
|
-
} from "./chunk-
|
|
205
|
+
} from "./chunk-ZXOUUDCG.js";
|
|
206
206
|
import "./chunk-TZXPT53C.js";
|
|
207
207
|
import "./chunk-7RFNTILS.js";
|
|
208
208
|
import "./chunk-LEC5ALIN.js";
|
|
209
|
-
import
|
|
210
|
-
|
|
209
|
+
import {
|
|
210
|
+
BUILTIN_DIALOG_LLM_FALLBACK_MODEL,
|
|
211
|
+
BUILTIN_SUMMARY_LLM_CONFIG
|
|
212
|
+
} from "./chunk-523DITKR.js";
|
|
213
|
+
import "./chunk-KFLT5KAD.js";
|
|
211
214
|
import "./chunk-5XBUWM6I.js";
|
|
212
215
|
import "./chunk-BYXBJQAS.js";
|
|
213
216
|
import "./chunk-QYPE3TS3.js";
|
|
214
|
-
import "./chunk-
|
|
217
|
+
import "./chunk-NJLL224W.js";
|
|
215
218
|
import "./chunk-4JH2UMJR.js";
|
|
216
|
-
import "./chunk-
|
|
219
|
+
import "./chunk-GPVRUGGY.js";
|
|
217
220
|
import "./chunk-UAD2WT54.js";
|
|
218
221
|
import "./chunk-5RGU3J7P.js";
|
|
219
222
|
import "./chunk-WPORQFYN.js";
|
|
@@ -228,10 +231,10 @@ import "./chunk-AZMYUSVF.js";
|
|
|
228
231
|
import "./chunk-GLKOYSRU.js";
|
|
229
232
|
import "./chunk-HPFCI4SK.js";
|
|
230
233
|
import "./chunk-4I7ERB7F.js";
|
|
231
|
-
import "./chunk-
|
|
234
|
+
import "./chunk-FW6YHHLI.js";
|
|
232
235
|
import "./chunk-3PVYUPXK.js";
|
|
233
|
-
import "./chunk-
|
|
234
|
-
import "./chunk-
|
|
236
|
+
import "./chunk-COFEN36Z.js";
|
|
237
|
+
import "./chunk-O2TZF4AI.js";
|
|
235
238
|
import "./chunk-PYRUW7XN.js";
|
|
236
239
|
import "./chunk-UEILX4EV.js";
|
|
237
240
|
import "./chunk-P5L7CXOC.js";
|
|
@@ -239,8 +242,8 @@ import "./chunk-AGP3YSEC.js";
|
|
|
239
242
|
import "./chunk-QQ56R7KS.js";
|
|
240
243
|
import "./chunk-OW765XBU.js";
|
|
241
244
|
import "./chunk-PXYBUFDB.js";
|
|
242
|
-
import "./chunk-
|
|
243
|
-
import "./chunk-
|
|
245
|
+
import "./chunk-EHSZD5OI.js";
|
|
246
|
+
import "./chunk-SVYO6AO7.js";
|
|
244
247
|
import {
|
|
245
248
|
buildSkillDiscoveryContextBlock,
|
|
246
249
|
buildSkillDiscoveryContextLayer,
|
|
@@ -248,10 +251,10 @@ import {
|
|
|
248
251
|
} from "./chunk-F6UUQOG6.js";
|
|
249
252
|
import {
|
|
250
253
|
listBuiltinSkills
|
|
251
|
-
} from "./chunk-
|
|
254
|
+
} from "./chunk-WRYQ35LQ.js";
|
|
252
255
|
import {
|
|
253
256
|
expandEnabledPacks
|
|
254
|
-
} from "./chunk-
|
|
257
|
+
} from "./chunk-EHGEOAHI.js";
|
|
255
258
|
import {
|
|
256
259
|
parseExternalSkillMarkdown
|
|
257
260
|
} from "./chunk-AETZ7AD6.js";
|
|
@@ -262,10 +265,11 @@ import {
|
|
|
262
265
|
buildLocalWorkspaceOpenAiTools,
|
|
263
266
|
buildLocalWorkspaceToolset,
|
|
264
267
|
readCommandActionGatePayload,
|
|
268
|
+
runTaskStop,
|
|
265
269
|
scrubSecrets
|
|
266
|
-
} from "./chunk-
|
|
270
|
+
} from "./chunk-RSHTSUEG.js";
|
|
267
271
|
import "./chunk-ZNFJWEN4.js";
|
|
268
|
-
import "./chunk-
|
|
272
|
+
import "./chunk-OQPKUBPB.js";
|
|
269
273
|
import "./chunk-CTPXME7U.js";
|
|
270
274
|
import "./chunk-HNUWUO75.js";
|
|
271
275
|
import "./chunk-CHOZJMJS.js";
|
|
@@ -288,16 +292,16 @@ import {
|
|
|
288
292
|
buildRuntimeGuidanceBlocks,
|
|
289
293
|
resolveResponseGuidelines,
|
|
290
294
|
resolveToolGuidedSections
|
|
291
|
-
} from "./chunk-
|
|
292
|
-
import "./chunk-
|
|
295
|
+
} from "./chunk-5MQRBSMW.js";
|
|
296
|
+
import "./chunk-H5HF7TJA.js";
|
|
293
297
|
import "./chunk-E2BESSAW.js";
|
|
294
|
-
import "./chunk-
|
|
298
|
+
import "./chunk-RZOV7OMV.js";
|
|
295
299
|
import {
|
|
296
300
|
formatQuotaSummary,
|
|
297
301
|
isQuotaExhaustedError
|
|
298
|
-
} from "./chunk-
|
|
302
|
+
} from "./chunk-3UKL3HPD.js";
|
|
299
303
|
import "./chunk-KC4XDTT3.js";
|
|
300
|
-
import "./chunk-
|
|
304
|
+
import "./chunk-YB3YZK56.js";
|
|
301
305
|
import "./chunk-YWSEPJ7C.js";
|
|
302
306
|
import "./chunk-WJZOQR2J.js";
|
|
303
307
|
import "./chunk-UHJGXRJ4.js";
|
|
@@ -305,19 +309,18 @@ import "./chunk-2MBTWINN.js";
|
|
|
305
309
|
import {
|
|
306
310
|
extractReferenceKeysFromMessage,
|
|
307
311
|
normalizeUsage
|
|
308
|
-
} from "./chunk-
|
|
312
|
+
} from "./chunk-V5Y3R6BT.js";
|
|
309
313
|
import {
|
|
310
314
|
DEFAULT_CONTEXT_WINDOW,
|
|
315
|
+
buildBoundedCompactionRequest,
|
|
311
316
|
buildCompactionMetricsFromPlan,
|
|
312
|
-
buildCompactionUserContent,
|
|
313
317
|
computeSummarySourceMetadata,
|
|
318
|
+
findModelContextWindow,
|
|
314
319
|
formatCompactionMetricsLog,
|
|
315
|
-
formatFileOperationsFromMessages,
|
|
316
|
-
formatMessagesForSummaryWithTruncation,
|
|
317
320
|
getModelContextWindow,
|
|
318
321
|
planCompression,
|
|
319
322
|
serializeMessageContent
|
|
320
|
-
} from "./chunk-
|
|
323
|
+
} from "./chunk-7BT37FK3.js";
|
|
321
324
|
import "./chunk-H57T64RA.js";
|
|
322
325
|
import "./chunk-5ZUL4CUO.js";
|
|
323
326
|
import "./chunk-UKZX3NHN.js";
|
|
@@ -364,8 +367,9 @@ import {
|
|
|
364
367
|
checkStaleRun,
|
|
365
368
|
isRunRecordClaimed,
|
|
366
369
|
listRunRecords,
|
|
367
|
-
readRunRecord
|
|
368
|
-
|
|
370
|
+
readRunRecord,
|
|
371
|
+
runAgentStopCommand
|
|
372
|
+
} from "./chunk-NSAPDIN2.js";
|
|
369
373
|
import "./chunk-HRMJUN5J.js";
|
|
370
374
|
import {
|
|
371
375
|
clipText,
|
|
@@ -376,11 +380,11 @@ import {
|
|
|
376
380
|
normalizeRunTitle,
|
|
377
381
|
resolveRunLabel,
|
|
378
382
|
shortRunId
|
|
379
|
-
} from "./chunk-
|
|
383
|
+
} from "./chunk-ALQ3657A.js";
|
|
380
384
|
import {
|
|
381
385
|
formatToolOverflowMarker,
|
|
382
386
|
getProcessRegistry
|
|
383
|
-
} from "./chunk-
|
|
387
|
+
} from "./chunk-H4UOTUOX.js";
|
|
384
388
|
import {
|
|
385
389
|
estimateTokenCount
|
|
386
390
|
} from "./chunk-PSCNXBYA.js";
|
|
@@ -408,7 +412,7 @@ import {
|
|
|
408
412
|
import {
|
|
409
413
|
checkForCliUpdate,
|
|
410
414
|
runSelfUpdateDetailed
|
|
411
|
-
} from "./chunk-
|
|
415
|
+
} from "./chunk-NOKUNJON.js";
|
|
412
416
|
import {
|
|
413
417
|
parseUserIdFromAuthToken,
|
|
414
418
|
resolveAuthToken,
|
|
@@ -441,14 +445,14 @@ import {
|
|
|
441
445
|
resolveDefaultSpawn,
|
|
442
446
|
spawnProcess
|
|
443
447
|
} from "./chunk-4O22PGNQ.js";
|
|
444
|
-
import "./chunk-
|
|
448
|
+
import "./chunk-INUFILG6.js";
|
|
445
449
|
import {
|
|
446
450
|
dailyWelcomeTip,
|
|
447
451
|
initCliLocale,
|
|
448
452
|
parseCliLocale,
|
|
449
453
|
setCliLocale,
|
|
450
454
|
t
|
|
451
|
-
} from "./chunk-
|
|
455
|
+
} from "./chunk-VNYYOX3V.js";
|
|
452
456
|
import {
|
|
453
457
|
createOAuthTokenStore,
|
|
454
458
|
isTokenExpired
|
|
@@ -3688,6 +3692,88 @@ ${t("dialogConfirmRememberLocal")}`;
|
|
|
3688
3692
|
return chosen.value;
|
|
3689
3693
|
}
|
|
3690
3694
|
|
|
3695
|
+
// packages/cli/tui/taskActions.ts
|
|
3696
|
+
function bounded(value, max = 200) {
|
|
3697
|
+
return value.replace(/[\x00-\x1f\x7f-\x9f]/g, " ").slice(0, max);
|
|
3698
|
+
}
|
|
3699
|
+
var defaultDeps = {
|
|
3700
|
+
readRun: (id, env) => readRunRecord(id, { env }),
|
|
3701
|
+
readProcess: (id) => getProcessRegistry().getByTaskId(id),
|
|
3702
|
+
stopRun: async (id, env) => {
|
|
3703
|
+
let output = "";
|
|
3704
|
+
const code = await runAgentStopCommand([id], { env, output: { write: (text) => {
|
|
3705
|
+
output += text;
|
|
3706
|
+
} } });
|
|
3707
|
+
return { code, confirmed: code === 0 && output.startsWith(`Stopped ${id} `) && output.includes("process group confirmed gone"), finished: code === 0 && output.startsWith(`Run ${id} is already `) };
|
|
3708
|
+
},
|
|
3709
|
+
stopProcess: (id) => runTaskStop({ taskId: id, registry: getProcessRegistry() }),
|
|
3710
|
+
probeProcessGroup: (pgid) => {
|
|
3711
|
+
if (!Number.isSafeInteger(pgid) || pgid <= 0) return "unknown";
|
|
3712
|
+
try {
|
|
3713
|
+
process.kill(-pgid, 0);
|
|
3714
|
+
return "alive";
|
|
3715
|
+
} catch (error) {
|
|
3716
|
+
return error.code === "ESRCH" ? "gone" : "unknown";
|
|
3717
|
+
}
|
|
3718
|
+
}
|
|
3719
|
+
};
|
|
3720
|
+
async function handleTaskAction(input, deps = {}) {
|
|
3721
|
+
const { action, target, dialogId, env } = input;
|
|
3722
|
+
if (!target || !["run", "process"].includes(target.kind) || !/^[A-Za-z0-9][A-Za-z0-9_-]{3,199}$/.test(target.id) || (target.kind === "run" ? !target.id.startsWith("run-") : !target.id.startsWith("ptask-"))) return { outcome: "invalid", reason: "A complete runId or taskId is required." };
|
|
3723
|
+
if (!dialogId || !dialogId.trim()) return { outcome: "unauthorized", reason: "No current dialog; ownership cannot be established." };
|
|
3724
|
+
const read = () => target.kind === "run" ? (deps.readRun ?? defaultDeps.readRun)(target.id, env) : (deps.readProcess ?? defaultDeps.readProcess)(target.id);
|
|
3725
|
+
const first = read();
|
|
3726
|
+
if (!first) return { outcome: "not-found" };
|
|
3727
|
+
const owned = (record) => target.kind === "run" ? record.runId === target.id && record.parentDialogId === dialogId : record.taskId === target.id && record.owner?.dialogId === dialogId;
|
|
3728
|
+
if (!owned(first)) return { outcome: "unauthorized", reason: "Task has no matching current-dialog owner." };
|
|
3729
|
+
const viewOf = (record) => {
|
|
3730
|
+
if (target.kind === "run") {
|
|
3731
|
+
const run = record;
|
|
3732
|
+
return { ...target, title: bounded(run.title || run.agentName || run.agentKey || "Agent run"), status: run.status, ...run.resultFile && run.resultFile.length <= 1024 && !/[\x00-\x1f\x7f-\x9f]/.test(run.resultFile) ? { resultPath: run.resultFile } : {} };
|
|
3733
|
+
}
|
|
3734
|
+
return { ...target, title: "Background process", status: record.status };
|
|
3735
|
+
};
|
|
3736
|
+
const view = viewOf(first);
|
|
3737
|
+
if (action === "show") return { outcome: "shown", view };
|
|
3738
|
+
if (action !== "stop") return { outcome: "invalid" };
|
|
3739
|
+
if (first.status !== "running") return { outcome: "finished", view };
|
|
3740
|
+
if (!deps.confirm) return { outcome: "confirmation-required", view };
|
|
3741
|
+
if (!await deps.confirm(view)) return { outcome: "cancelled", view };
|
|
3742
|
+
if (deps.getCurrentDialogId && deps.getCurrentDialogId() !== dialogId) return { outcome: "unauthorized", reason: "Current dialog changed after confirmation." };
|
|
3743
|
+
const current = read();
|
|
3744
|
+
if (!current) return { outcome: "not-found" };
|
|
3745
|
+
if (!owned(current)) return { outcome: "unauthorized", reason: "Task ownership changed after confirmation." };
|
|
3746
|
+
const sameIdentity = target.kind === "run" ? first.startedAt === current.startedAt && first.pid === current.pid && first.processStartedAt === current.processStartedAt && first.agentKey === current.agentKey : first.startedAt === current.startedAt && first.pid === current.pid && first.pgid === current.pgid;
|
|
3747
|
+
if (!sameIdentity) return { outcome: "changed", reason: "Task identity changed after confirmation." };
|
|
3748
|
+
const currentView = viewOf(current);
|
|
3749
|
+
if (current.status !== "running") return { outcome: "finished", view: currentView };
|
|
3750
|
+
try {
|
|
3751
|
+
if (target.kind === "run") {
|
|
3752
|
+
const result2 = await (deps.stopRun ?? defaultDeps.stopRun)(target.id, env);
|
|
3753
|
+
if (result2.finished) return { outcome: "finished", view: currentView };
|
|
3754
|
+
return { outcome: result2.code === 0 && result2.confirmed ? "stopped" : "failed", view: currentView };
|
|
3755
|
+
}
|
|
3756
|
+
const result = await (deps.stopProcess ?? defaultDeps.stopProcess)(target.id);
|
|
3757
|
+
if (result.outcome === "not-found") return { outcome: "not-found" };
|
|
3758
|
+
if (result.outcome === "not-stoppable") return { outcome: result.reason === "already-terminal" ? "finished" : "failed", view: { ...currentView, status: result.status } };
|
|
3759
|
+
const probe = (deps.probeProcessGroup ?? defaultDeps.probeProcessGroup)(current.pgid);
|
|
3760
|
+
return { outcome: probe === "gone" ? "stopped" : "stop-requested", view: currentView };
|
|
3761
|
+
} catch {
|
|
3762
|
+
return { outcome: "failed", view: currentView, reason: "Stop operation failed." };
|
|
3763
|
+
}
|
|
3764
|
+
}
|
|
3765
|
+
async function runTaskSlashCommand(line, options) {
|
|
3766
|
+
const tokens = line.trim().split(/\s+/);
|
|
3767
|
+
if (tokens[0]?.toLowerCase() !== "/tasks" || tokens.length === 1) return null;
|
|
3768
|
+
if (tokens.length !== 3 || !["show", "stop"].includes(tokens[1] ?? "")) return "Usage: /tasks show <runId|taskId> | /tasks stop <runId|taskId>";
|
|
3769
|
+
const id = tokens[2];
|
|
3770
|
+
const kind = id.startsWith("run-") ? "run" : id.startsWith("ptask-") ? "process" : null;
|
|
3771
|
+
if (!kind) return "A complete runId or taskId is required.";
|
|
3772
|
+
const result = await handleTaskAction({ action: tokens[1], target: { kind, id }, dialogId: options.getDialogId(), env: options.env }, { ...options.deps, confirm: options.confirm, getCurrentDialogId: options.getDialogId });
|
|
3773
|
+
const view = result.view;
|
|
3774
|
+
return [`Task ${result.outcome}`, ...view ? [`${view.kind} ${view.title} ${view.status} ${view.id}`, ...view.resultPath ? [`Result: ${view.resultPath}`] : []] : [], ...result.reason ? [result.reason] : []].join("\n");
|
|
3775
|
+
}
|
|
3776
|
+
|
|
3691
3777
|
// packages/cli/tui/hostApprovalCard.ts
|
|
3692
3778
|
var ALLOW_KEYS = /* @__PURE__ */ new Set(["y", "Y"]);
|
|
3693
3779
|
var DENY_KEYS = /* @__PURE__ */ new Set(["n", "N"]);
|
|
@@ -4007,6 +4093,7 @@ function displayAgentName(snapshot) {
|
|
|
4007
4093
|
|
|
4008
4094
|
// packages/cli/tui/runZoneLines.ts
|
|
4009
4095
|
var RUN_ZONE_MAX_ROWS = 3;
|
|
4096
|
+
var RUN_ZONE_ICON = "\u21B3";
|
|
4010
4097
|
var STOP_CONFIRMED_LABEL = "\u5DF2\u505C\u6B62";
|
|
4011
4098
|
var RECLAIMED_LABEL = "\u5DF2\u6309 TTL \u5230\u671F\u56DE\u6536";
|
|
4012
4099
|
var STOP_UNCONFIRMED_LABEL = "\u505C\u6B62\u672A\u786E\u8BA4";
|
|
@@ -4067,7 +4154,7 @@ function remoteCostIsExplicitlyUnknown(carrier) {
|
|
|
4067
4154
|
function runZoneLeadIcon(status, carrier) {
|
|
4068
4155
|
if (!isAgentRunTerminalStatus(status)) {
|
|
4069
4156
|
if (carrier?.remoteTask && !remoteTaskIsActive(carrier)) return REMOTE_UNKNOWN_GLYPH;
|
|
4070
|
-
return
|
|
4157
|
+
return RUN_ZONE_ICON;
|
|
4071
4158
|
}
|
|
4072
4159
|
switch (status) {
|
|
4073
4160
|
case "done":
|
|
@@ -4159,6 +4246,7 @@ function formatRunZoneLines(snapshots, colorEnabled, now = Date.now(), maxRows =
|
|
|
4159
4246
|
const clock = remoteTaskClock(carrier, now);
|
|
4160
4247
|
const icon = runZoneLeadIcon(snapshot.status, carrier);
|
|
4161
4248
|
const label = runZoneLabel(snapshot, duplicateTitles);
|
|
4249
|
+
const typedLabel = isAgentRunTerminalStatus(snapshot.status) ? label : `${t("runZoneAgentType")} ${label}`;
|
|
4162
4250
|
const { time, rest, stalled } = runZoneFacts(snapshot, clock ?? now);
|
|
4163
4251
|
const remoteFacts = remoteTaskFacts(carrier, now);
|
|
4164
4252
|
const hideCredits = remoteCostIsExplicitlyUnknown(carrier);
|
|
@@ -4171,15 +4259,15 @@ function formatRunZoneLines(snapshots, colorEnabled, now = Date.now(), maxRows =
|
|
|
4171
4259
|
...base,
|
|
4172
4260
|
...remoteFacts
|
|
4173
4261
|
];
|
|
4174
|
-
let shownLabel =
|
|
4262
|
+
let shownLabel = typedLabel;
|
|
4175
4263
|
if (columns !== void 0) {
|
|
4176
4264
|
const fixed = (l, f) => visibleWidth(`${icon} ${l}${f.length ? ` \xB7 ${f.join(" \xB7 ")}` : ""}`);
|
|
4177
4265
|
const keep = (time && clock !== null ? 1 : 0) + (stalled ? 1 : 0);
|
|
4178
|
-
while (factList.length > keep && fixed(
|
|
4179
|
-
if (fixed(
|
|
4266
|
+
while (factList.length > keep && fixed(typedLabel, factList) > columns) factList.pop();
|
|
4267
|
+
if (fixed(typedLabel, factList) > columns) {
|
|
4180
4268
|
const tail = factList.length ? ` \xB7 ${factList.join(" \xB7 ")}` : "";
|
|
4181
4269
|
const room = columns - visibleWidth(`${icon} `) - visibleWidth(tail);
|
|
4182
|
-
shownLabel = fitAnsiLine(
|
|
4270
|
+
shownLabel = fitAnsiLine(typedLabel, Math.max(1, room));
|
|
4183
4271
|
}
|
|
4184
4272
|
}
|
|
4185
4273
|
const factsPart = factList.length > 0 ? ` \xB7 ${factList.join(" \xB7 ")}` : "";
|
|
@@ -4458,6 +4546,10 @@ function createActivityIndicator(deps) {
|
|
|
4458
4546
|
const fallbackDelayMs = deps.fallbackDelayMs ?? ACTIVITY_FALLBACK_DELAY_MS;
|
|
4459
4547
|
const setIntervalFn = deps.setIntervalFn ?? ((cb, ms) => setInterval(cb, ms));
|
|
4460
4548
|
const clearIntervalFn = deps.clearIntervalFn ?? ((handle) => clearInterval(handle));
|
|
4549
|
+
let disposed = false;
|
|
4550
|
+
const repaint = () => {
|
|
4551
|
+
if (!disposed) deps.onRepaint();
|
|
4552
|
+
};
|
|
4461
4553
|
let explicitLabel = null;
|
|
4462
4554
|
let explicitStartedAt = 0;
|
|
4463
4555
|
let fallbackActive = false;
|
|
@@ -4470,7 +4562,7 @@ function createActivityIndicator(deps) {
|
|
|
4470
4562
|
const elapsedSecFrom = (startedAt) => startedAt > 0 ? Math.max(0, Math.floor((now() - startedAt) / 1e3)) : 0;
|
|
4471
4563
|
const tick = () => {
|
|
4472
4564
|
if (stopping) {
|
|
4473
|
-
|
|
4565
|
+
repaint();
|
|
4474
4566
|
return;
|
|
4475
4567
|
}
|
|
4476
4568
|
frameIndex += 1;
|
|
@@ -4478,7 +4570,7 @@ function createActivityIndicator(deps) {
|
|
|
4478
4570
|
fallbackActive = true;
|
|
4479
4571
|
fallbackStartedAt = now();
|
|
4480
4572
|
}
|
|
4481
|
-
|
|
4573
|
+
repaint();
|
|
4482
4574
|
};
|
|
4483
4575
|
const ensureTimer = () => {
|
|
4484
4576
|
if (timer === null) {
|
|
@@ -4500,11 +4592,11 @@ function createActivityIndicator(deps) {
|
|
|
4500
4592
|
fallbackStartedAt = 0;
|
|
4501
4593
|
}
|
|
4502
4594
|
ensureTimer();
|
|
4503
|
-
|
|
4595
|
+
repaint();
|
|
4504
4596
|
};
|
|
4505
4597
|
const markStopping = () => {
|
|
4506
4598
|
stopping = true;
|
|
4507
|
-
|
|
4599
|
+
repaint();
|
|
4508
4600
|
};
|
|
4509
4601
|
const isStopping = () => stopping;
|
|
4510
4602
|
const getView = () => {
|
|
@@ -4533,8 +4625,9 @@ function createActivityIndicator(deps) {
|
|
|
4533
4625
|
}
|
|
4534
4626
|
return null;
|
|
4535
4627
|
};
|
|
4628
|
+
const processRegistry = deps.processRegistry ?? getProcessRegistry();
|
|
4536
4629
|
const runDock = deps.runDock ?? createRunDock({
|
|
4537
|
-
onRepaint:
|
|
4630
|
+
onRepaint: repaint,
|
|
4538
4631
|
now,
|
|
4539
4632
|
setIntervalFn,
|
|
4540
4633
|
clearIntervalFn,
|
|
@@ -4542,11 +4635,11 @@ function createActivityIndicator(deps) {
|
|
|
4542
4635
|
// 的 listBackground()(transient 前台 grace 包络不算后台),这里只把
|
|
4543
4636
|
// 渲染需要的四个字段投影过去,registry 记录本身不进 UI 层。
|
|
4544
4637
|
listProcs: () => {
|
|
4545
|
-
const nowMs =
|
|
4546
|
-
return
|
|
4638
|
+
const nowMs = now();
|
|
4639
|
+
return processRegistry.listBackground().filter((proc) => {
|
|
4547
4640
|
if (proc.status === "running") return true;
|
|
4548
|
-
const endedAt = proc.startedAt + (proc.resultCapsule?.durationMs ?? 0);
|
|
4549
|
-
const failed = proc.status === "
|
|
4641
|
+
const endedAt = proc.endedAt ?? proc.startedAt + (proc.resultCapsule?.durationMs ?? 0);
|
|
4642
|
+
const failed = proc.status === "stopped" || proc.status === "failed" || (proc.exitCode ?? 0) !== 0;
|
|
4550
4643
|
const window = failed ? PROC_LINGER_FAILURE_MS : PROC_LINGER_SUCCESS_MS;
|
|
4551
4644
|
return nowMs - endedAt <= window;
|
|
4552
4645
|
}).map((proc) => ({
|
|
@@ -4554,12 +4647,13 @@ function createActivityIndicator(deps) {
|
|
|
4554
4647
|
label: proc.label,
|
|
4555
4648
|
command: proc.command,
|
|
4556
4649
|
startedAt: proc.startedAt,
|
|
4557
|
-
status: proc.status,
|
|
4650
|
+
status: proc.status === "stopped" ? "killed" : proc.status,
|
|
4558
4651
|
exitCode: proc.exitCode,
|
|
4559
|
-
durationMs: proc.resultCapsule?.durationMs
|
|
4652
|
+
durationMs: proc.resultCapsule?.durationMs ?? (proc.endedAt !== void 0 ? proc.endedAt - proc.startedAt : void 0)
|
|
4560
4653
|
}));
|
|
4561
4654
|
}
|
|
4562
4655
|
});
|
|
4656
|
+
const unsubscribeBackground = processRegistry.onBackgroundChange(repaint);
|
|
4563
4657
|
const updateAgentRun = (snapshot) => {
|
|
4564
4658
|
runDock.update(snapshot);
|
|
4565
4659
|
};
|
|
@@ -4613,6 +4707,8 @@ function createActivityIndicator(deps) {
|
|
|
4613
4707
|
isStopping,
|
|
4614
4708
|
stop,
|
|
4615
4709
|
dispose() {
|
|
4710
|
+
disposed = true;
|
|
4711
|
+
unsubscribeBackground();
|
|
4616
4712
|
stop();
|
|
4617
4713
|
runDock.dispose();
|
|
4618
4714
|
}
|
|
@@ -5159,7 +5255,10 @@ function createRunRegistryPoller(deps) {
|
|
|
5159
5255
|
ensureRunning();
|
|
5160
5256
|
},
|
|
5161
5257
|
endHold() {
|
|
5162
|
-
if (holdCount > 0)
|
|
5258
|
+
if (holdCount > 0) {
|
|
5259
|
+
holdCount -= 1;
|
|
5260
|
+
if (holdCount === 0) tickCount = 0;
|
|
5261
|
+
}
|
|
5163
5262
|
},
|
|
5164
5263
|
poll,
|
|
5165
5264
|
requestLogTail,
|
|
@@ -5187,6 +5286,7 @@ function normalizeRunCompletionShape(record) {
|
|
|
5187
5286
|
...typeof record.exitCode === "number" ? { exitCode: record.exitCode } : {},
|
|
5188
5287
|
...typeof record.parentDialogId === "string" ? { parentDialogId: record.parentDialogId } : {},
|
|
5189
5288
|
...typeof record.dialogId === "string" ? { dialogId: record.dialogId } : {},
|
|
5289
|
+
...typeof record.resultFile === "string" ? { resultFile: record.resultFile } : {},
|
|
5190
5290
|
...typeof record.ephemeral === "boolean" ? { ephemeral: record.ephemeral } : {},
|
|
5191
5291
|
...record.startedAt !== void 0 ? { startedAt: record.startedAt } : {},
|
|
5192
5292
|
...record.endedAt !== void 0 ? { endedAt: record.endedAt } : {},
|
|
@@ -5277,6 +5377,11 @@ function buildRunElement(record, nowMs, errorBudgetTokens) {
|
|
|
5277
5377
|
if (verbose && typeof record.exitCode === "number") {
|
|
5278
5378
|
attrs.push(`exitCode="${record.exitCode}"`);
|
|
5279
5379
|
}
|
|
5380
|
+
if (record.resultFile) {
|
|
5381
|
+
attrs.push(`resultFile="${escapeXmlAttribute(record.resultFile)}"`);
|
|
5382
|
+
} else {
|
|
5383
|
+
attrs.push(`result="unavailable"`);
|
|
5384
|
+
}
|
|
5280
5385
|
if (record.ephemeral) {
|
|
5281
5386
|
attrs.push(`ephemeral="true"`);
|
|
5282
5387
|
} else if (record.dialogId) {
|
|
@@ -5309,7 +5414,7 @@ function renderWakeMessage(elements, count) {
|
|
|
5309
5414
|
return [
|
|
5310
5415
|
`<background_run_completion count="${count}">`,
|
|
5311
5416
|
...elements,
|
|
5312
|
-
`\
|
|
5417
|
+
`\u6709 resultFile \u65F6\u7528 readFile\uFF1B\u672C\u5730\u7F3A\u5931\u5373\u65E0\u7ED3\u8BBA\uFF0C\u4E0D\u8BFB\u65E5\u5FD7\u3002\u7EC8\u6001\u53EA\u8868\u793A run \u7ED3\u675F\u3002`,
|
|
5313
5418
|
`</background_run_completion>`
|
|
5314
5419
|
].join("\n");
|
|
5315
5420
|
}
|
|
@@ -5340,10 +5445,11 @@ function buildWakeDisplayText(finished, nowMs = Date.now()) {
|
|
|
5340
5445
|
const mark = isFailureStatus(record.status) ? "\u2717" : "\u2713";
|
|
5341
5446
|
const duration = runDuration(record, nowMs);
|
|
5342
5447
|
const label = resolveRunLabel(record);
|
|
5343
|
-
const
|
|
5344
|
-
|
|
5448
|
+
const taskName = typeof record.title === "string" && record.title.trim() ? `\u300C${record.title.trim()}\u300D` : label;
|
|
5449
|
+
const status = String(record.status);
|
|
5450
|
+
return `${mark} ${taskName} [${status}]${duration ? ` \xB7 ${duration}` : ""}`;
|
|
5345
5451
|
});
|
|
5346
|
-
return `${finished.length} \u6761\u540E\u53F0 run \u5DF2\
|
|
5452
|
+
return `${finished.length} \u6761\u540E\u53F0 run \u5DF2\u7ED3\u675F \xB7 ${parts.join(" \xB7 ")}`;
|
|
5347
5453
|
}
|
|
5348
5454
|
function filterUnclaimedChildRuns(runs, deps = {}) {
|
|
5349
5455
|
const rawNow = deps.now ? deps.now() : Date.now();
|
|
@@ -6472,8 +6578,6 @@ var SLASH_COMMANDS = [
|
|
|
6472
6578
|
"/version",
|
|
6473
6579
|
"/logs",
|
|
6474
6580
|
"/tasks",
|
|
6475
|
-
"/jobs",
|
|
6476
|
-
"/procs",
|
|
6477
6581
|
"/stop",
|
|
6478
6582
|
"/exit",
|
|
6479
6583
|
"/quit",
|
|
@@ -8727,7 +8831,7 @@ function formatAttachedSkillLine(skillRef) {
|
|
|
8727
8831
|
const name = themeText(skillRef, "chrome", true);
|
|
8728
8832
|
return `${bullet} ${label} ${name}`;
|
|
8729
8833
|
}
|
|
8730
|
-
function handleTuiInput(input, state, historyTurns) {
|
|
8834
|
+
function handleTuiInput(input, state, historyTurns, deps) {
|
|
8731
8835
|
const trimmed = input.trim();
|
|
8732
8836
|
if (!trimmed) {
|
|
8733
8837
|
return { nextState: state, output: "" };
|
|
@@ -8944,7 +9048,19 @@ ${t("autoUsage")}` };
|
|
|
8944
9048
|
return { nextState: state, output: `${stateLine()}
|
|
8945
9049
|
${t("autoUsage")}` };
|
|
8946
9050
|
}
|
|
8947
|
-
case "/tasks":
|
|
9051
|
+
case "/tasks": {
|
|
9052
|
+
const runs = state.dialogId ? listRunRecords({ env: deps?.env ?? process.env }).filter((run) => run.parentDialogId === state.dialogId) : [];
|
|
9053
|
+
const processes = getProcessRegistry().listBackground();
|
|
9054
|
+
const lines = [
|
|
9055
|
+
...runs.map((run) => `agent ${run.title || run.agentName || run.agentKey} ${run.status} ${run.runId}`),
|
|
9056
|
+
...processes.map((p) => {
|
|
9057
|
+
const title = p.label && p.command && !p.command.includes(p.label) ? p.label : "background process";
|
|
9058
|
+
return `process ${title} ${p.status} ${p.taskId}`;
|
|
9059
|
+
})
|
|
9060
|
+
];
|
|
9061
|
+
return { nextState: state, output: `${lines.length ? lines.join("\n") : t("tasksNone")}
|
|
9062
|
+
/tasks show <id> | /tasks stop <id>` };
|
|
9063
|
+
}
|
|
8948
9064
|
case "/jobs":
|
|
8949
9065
|
case "/procs": {
|
|
8950
9066
|
const registry2 = getProcessRegistry();
|
|
@@ -9403,7 +9519,7 @@ function applyAgentSwitchState(state, target, messages) {
|
|
|
9403
9519
|
};
|
|
9404
9520
|
}
|
|
9405
9521
|
var LEARN_COMMAND = "/learn";
|
|
9406
|
-
function handleTuiInput2(input, state, historyTurns) {
|
|
9522
|
+
function handleTuiInput2(input, state, historyTurns, deps) {
|
|
9407
9523
|
const trimmed = input.trim();
|
|
9408
9524
|
if (trimmed === LEARN_COMMAND) {
|
|
9409
9525
|
if (!state.dialogId) {
|
|
@@ -9431,7 +9547,7 @@ function handleTuiInput2(input, state, historyTurns) {
|
|
|
9431
9547
|
}
|
|
9432
9548
|
return { nextState: state, output: "", action: { type: "learn-history", limit: Number(value) } };
|
|
9433
9549
|
}
|
|
9434
|
-
const result = handleTuiInput(input, state, historyTurns);
|
|
9550
|
+
const result = handleTuiInput(input, state, historyTurns, deps);
|
|
9435
9551
|
const switchMatch = trimmed.match(/^\/(?:switch|agent)\s+(.+)$/s);
|
|
9436
9552
|
if (switchMatch && !["list", "current", "show"].includes(switchMatch[1])) {
|
|
9437
9553
|
const target = switchMatch[1];
|
|
@@ -9590,11 +9706,14 @@ function createTurnInjectionInbox() {
|
|
|
9590
9706
|
pending.push(entry);
|
|
9591
9707
|
return true;
|
|
9592
9708
|
},
|
|
9593
|
-
drain() {
|
|
9709
|
+
drain(onEntry) {
|
|
9594
9710
|
if (pending.length === 0) return [];
|
|
9595
9711
|
const taken = pending;
|
|
9596
9712
|
pending = [];
|
|
9597
|
-
return taken.map((entry) =>
|
|
9713
|
+
return taken.map((entry) => {
|
|
9714
|
+
onEntry?.(entry);
|
|
9715
|
+
return entry.text;
|
|
9716
|
+
});
|
|
9598
9717
|
},
|
|
9599
9718
|
close() {
|
|
9600
9719
|
closed = true;
|
|
@@ -9930,15 +10049,7 @@ function normalizeStatus(raw) {
|
|
|
9930
10049
|
// packages/agent-runtime/processTerminalResume.ts
|
|
9931
10050
|
var DEFAULT_MAX_CHAINED_COMPLETION_TURNS = 3;
|
|
9932
10051
|
function createProcessTerminalResumeState() {
|
|
9933
|
-
|
|
9934
|
-
const chainDepthByDialog = /* @__PURE__ */ new Map();
|
|
9935
|
-
return {
|
|
9936
|
-
claimedTaskIds,
|
|
9937
|
-
chainDepthByDialog,
|
|
9938
|
-
noteUserTurn() {
|
|
9939
|
-
chainDepthByDialog.clear();
|
|
9940
|
-
}
|
|
9941
|
-
};
|
|
10052
|
+
return { claimedTaskIds: /* @__PURE__ */ new Set() };
|
|
9942
10053
|
}
|
|
9943
10054
|
var resolveCap = (value) => {
|
|
9944
10055
|
if (typeof value !== "number" || !Number.isFinite(value) || value < 1) {
|
|
@@ -9965,24 +10076,21 @@ function decideProcessTerminalResume(input) {
|
|
|
9965
10076
|
if (currentDialogId !== dialogId) {
|
|
9966
10077
|
return { kind: "notice-only", reason: "dialog-mismatch", taskId };
|
|
9967
10078
|
}
|
|
9968
|
-
if (input.turnActive) {
|
|
9969
|
-
input.state.claimedTaskIds.add(taskId);
|
|
9970
|
-
return { kind: "inject-turn", taskId, owner: input.owner, notice: input.notice };
|
|
9971
|
-
}
|
|
9972
10079
|
const cap = resolveCap(input.maxChainedCompletionTurns);
|
|
9973
|
-
const depth = input.
|
|
10080
|
+
const depth = input.owner.processCausalDepth ?? 0;
|
|
9974
10081
|
if (depth >= cap) {
|
|
9975
10082
|
return { kind: "notice-only", reason: "chain-cap", taskId };
|
|
9976
10083
|
}
|
|
9977
10084
|
input.state.claimedTaskIds.add(taskId);
|
|
9978
|
-
input.
|
|
10085
|
+
if (input.turnActive) {
|
|
10086
|
+
return { kind: "inject-turn", taskId, owner: input.owner, notice: input.notice };
|
|
10087
|
+
}
|
|
9979
10088
|
return { kind: "completion-turn", taskId, owner: input.owner, notice: input.notice };
|
|
9980
10089
|
}
|
|
9981
10090
|
function createProcessTerminalAutoResumer(deps) {
|
|
9982
10091
|
const state = createProcessTerminalResumeState();
|
|
9983
10092
|
return {
|
|
9984
10093
|
state,
|
|
9985
|
-
noteUserTurn: () => state.noteUserTurn(),
|
|
9986
10094
|
decide: (notice) => {
|
|
9987
10095
|
const promoted = notice.promoted ?? deps.isPromoted?.(notice.taskId) ?? false;
|
|
9988
10096
|
const effectiveNotice = notice.promoted === promoted ? notice : { ...notice, promoted };
|
|
@@ -12321,6 +12429,7 @@ async function runAgentChat(scriptDir, state, message, env, output, agentRunner
|
|
|
12321
12429
|
agentKey: effectiveAgentKey,
|
|
12322
12430
|
serverUrl: state.serverUrl,
|
|
12323
12431
|
message: effectiveMessage,
|
|
12432
|
+
getProcessCausalDepth: options.getProcessCausalDepth,
|
|
12324
12433
|
continueDialogId: state.dialogId,
|
|
12325
12434
|
...state.dialogId ? { parentDialogId: state.dialogId } : {},
|
|
12326
12435
|
// 显式注入 TUI 真实会话身份(createInitialTuiState mint、跨轮稳定),
|
|
@@ -12769,7 +12878,6 @@ async function runOneAgentTurn(ctx, inputMsg, imageUrls, actionGateHandler, conf
|
|
|
12769
12878
|
}
|
|
12770
12879
|
}
|
|
12771
12880
|
const message = req.text;
|
|
12772
|
-
if (req.event.kind === "user") ctx.noteUserTurn?.();
|
|
12773
12881
|
ctx.forcedStop = false;
|
|
12774
12882
|
ctx.turnEpoch += 1;
|
|
12775
12883
|
const myEpoch = ctx.turnEpoch;
|
|
@@ -12803,7 +12911,7 @@ async function runOneAgentTurn(ctx, inputMsg, imageUrls, actionGateHandler, conf
|
|
|
12803
12911
|
if (!approved) return false;
|
|
12804
12912
|
const commandText = typeof request.command === "string" ? request.command : "";
|
|
12805
12913
|
if (commandText) {
|
|
12806
|
-
const { runApprovedCredentialCommand } = await import("./hostCredentialCreate-
|
|
12914
|
+
const { runApprovedCredentialCommand } = await import("./hostCredentialCreate-S233UMAP.js");
|
|
12807
12915
|
const hostResult = await runApprovedCredentialCommand({
|
|
12808
12916
|
commandText,
|
|
12809
12917
|
approvalEventId: request.id,
|
|
@@ -12896,6 +13004,7 @@ async function runOneAgentTurn(ctx, inputMsg, imageUrls, actionGateHandler, conf
|
|
|
12896
13004
|
ctx.runRegistryPoller.beginHold();
|
|
12897
13005
|
const injectionInbox = createTurnInjectionInbox();
|
|
12898
13006
|
ctx.turnInjectionInbox = injectionInbox;
|
|
13007
|
+
let processCausalDepth = req.event.kind === "background-task-completed" ? req.event.processCausalDepth ?? 0 : 0;
|
|
12899
13008
|
const injectedProcessNoticeLines = ctx.state.pendingProcessNotices ? [...ctx.state.pendingProcessNotices] : [];
|
|
12900
13009
|
const consumeInjectedProcessNotices = () => {
|
|
12901
13010
|
if (injectedProcessNoticeLines.length === 0) {
|
|
@@ -12924,7 +13033,13 @@ async function runOneAgentTurn(ctx, inputMsg, imageUrls, actionGateHandler, conf
|
|
|
12924
13033
|
...confirmDestructiveActionWithStatus ? { confirmDestructiveAction: confirmDestructiveActionWithStatus } : {},
|
|
12925
13034
|
...requestUserChoice ? { requestUserChoice } : {},
|
|
12926
13035
|
abortSignal: ctx.activeTurnAbort.signal,
|
|
12927
|
-
|
|
13036
|
+
getProcessCausalDepth: () => processCausalDepth,
|
|
13037
|
+
drainInjections: () => injectionInbox.drain(({ fallback }) => {
|
|
13038
|
+
const event = typeof fallback === "object" && fallback !== null && "event" in fallback ? fallback.event : fallback;
|
|
13039
|
+
if (typeof event === "object" && event !== null && event.kind === "background-task-completed") {
|
|
13040
|
+
processCausalDepth = Math.max(processCausalDepth, event.processCausalDepth ?? 0);
|
|
13041
|
+
}
|
|
13042
|
+
}),
|
|
12928
13043
|
pastedTextStore: ctx.pasteStore,
|
|
12929
13044
|
activityReporter: ctx.activityReporter,
|
|
12930
13045
|
// 分享 OAuth agent 的 shell 会话授权(块 D):宿主装配的会话级对象;
|
|
@@ -14209,6 +14324,11 @@ async function addDialogToSpaceIfNeeded(fetchImpl, serverUrl, authToken, record)
|
|
|
14209
14324
|
console.warn(`[nolo] compact: addDialogToSpace error: ${error}`);
|
|
14210
14325
|
}
|
|
14211
14326
|
}
|
|
14327
|
+
var SUMMARY_CONTEXT_WINDOW = Math.min(
|
|
14328
|
+
32768,
|
|
14329
|
+
findModelContextWindow(BUILTIN_SUMMARY_LLM_CONFIG.model) ?? 32768,
|
|
14330
|
+
findModelContextWindow(BUILTIN_DIALOG_LLM_FALLBACK_MODEL) ?? 32768
|
|
14331
|
+
);
|
|
14212
14332
|
async function resolveContextWindow(fetchImpl, serverUrl, authToken, agentKey) {
|
|
14213
14333
|
if (!agentKey) return DEFAULT_CONTEXT_WINDOW;
|
|
14214
14334
|
try {
|
|
@@ -14267,60 +14387,63 @@ async function compactDialog(options) {
|
|
|
14267
14387
|
reason: "manual"
|
|
14268
14388
|
});
|
|
14269
14389
|
if (plan.shouldCompress && plan.msgsToCompress.length > 0) {
|
|
14270
|
-
options.onProgress?.("summarizing");
|
|
14271
14390
|
const previousSummary = current.summary || "";
|
|
14272
|
-
const
|
|
14273
|
-
|
|
14274
|
-
plan.msgsToCompress,
|
|
14275
|
-
(name) => name
|
|
14276
|
-
// CLI 端无 tool alias 系统,直接用原始名
|
|
14277
|
-
);
|
|
14278
|
-
const promptContent = buildCompactionUserContent({
|
|
14391
|
+
const request = buildBoundedCompactionRequest({
|
|
14392
|
+
msgsToCompress: plan.msgsToCompress,
|
|
14279
14393
|
previousSummary,
|
|
14280
|
-
|
|
14281
|
-
fileOpsText
|
|
14394
|
+
contextWindow: SUMMARY_CONTEXT_WINDOW
|
|
14282
14395
|
});
|
|
14283
|
-
|
|
14284
|
-
|
|
14285
|
-
|
|
14286
|
-
|
|
14287
|
-
|
|
14288
|
-
|
|
14289
|
-
|
|
14290
|
-
|
|
14291
|
-
|
|
14292
|
-
|
|
14396
|
+
if (request.status === "blocked") {
|
|
14397
|
+
console.warn(`[nolo] compact: summary blocked: ${request.reason}`);
|
|
14398
|
+
} else {
|
|
14399
|
+
options.onProgress?.("summarizing");
|
|
14400
|
+
try {
|
|
14401
|
+
const newSummary = await options.summaryLlmCaller(request.promptContent, {
|
|
14402
|
+
maxOutputTokens: request.outputTokenBudget
|
|
14403
|
+
});
|
|
14404
|
+
if (newSummary && newSummary.trim()) {
|
|
14405
|
+
const compressionCount = current.compressionCount || 0;
|
|
14406
|
+
const extractedKeys = new Set(
|
|
14407
|
+
Array.isArray(current.referenceKeys) ? current.referenceKeys : []
|
|
14408
|
+
);
|
|
14409
|
+
for (const msg of request.coveredMessages) {
|
|
14410
|
+
for (const key of extractReferenceKeysFromMessage(msg)) {
|
|
14411
|
+
extractedKeys.add(key);
|
|
14412
|
+
}
|
|
14293
14413
|
}
|
|
14414
|
+
const sourceMeta = await computeSummarySourceMetadata(
|
|
14415
|
+
allMsgs,
|
|
14416
|
+
request.summarizedBeforeId
|
|
14417
|
+
);
|
|
14418
|
+
await patchDialog(fetchImpl, options.serverUrl, options.authToken, dialogKey, {
|
|
14419
|
+
summary: newSummary.trim(),
|
|
14420
|
+
summarizedBeforeId: request.summarizedBeforeId,
|
|
14421
|
+
compressionCount: compressionCount + 1,
|
|
14422
|
+
referenceKeys: Array.from(extractedKeys),
|
|
14423
|
+
...sourceMeta ? {
|
|
14424
|
+
sourceHash: sourceMeta.sourceHash,
|
|
14425
|
+
sourceCount: sourceMeta.sourceCount,
|
|
14426
|
+
schemaVersion: sourceMeta.schemaVersion
|
|
14427
|
+
} : {}
|
|
14428
|
+
});
|
|
14429
|
+
current.referenceKeys = Array.from(extractedKeys);
|
|
14430
|
+
summaryGenerated = true;
|
|
14431
|
+
generatedSummary = newSummary.trim();
|
|
14432
|
+
compactedMessageCount = request.coveredMessages.length;
|
|
14433
|
+
const metrics = buildCompactionMetricsFromPlan({
|
|
14434
|
+
reason: "manual",
|
|
14435
|
+
previousSummary: current.summary || "",
|
|
14436
|
+
plan: {
|
|
14437
|
+
msgsToCompress: request.coveredMessages,
|
|
14438
|
+
msgsToKeep: [...plan.msgsToCompress.slice(request.coveredMessages.length), ...plan.msgsToKeep]
|
|
14439
|
+
},
|
|
14440
|
+
newSummary: newSummary.trim()
|
|
14441
|
+
});
|
|
14442
|
+
console.log(formatCompactionMetricsLog(metrics));
|
|
14294
14443
|
}
|
|
14295
|
-
|
|
14296
|
-
|
|
14297
|
-
plan.newSummarizedBeforeId
|
|
14298
|
-
);
|
|
14299
|
-
await patchDialog(fetchImpl, options.serverUrl, options.authToken, dialogKey, {
|
|
14300
|
-
summary: newSummary.trim(),
|
|
14301
|
-
summarizedBeforeId: plan.newSummarizedBeforeId,
|
|
14302
|
-
compressionCount: compressionCount + 1,
|
|
14303
|
-
referenceKeys: Array.from(extractedKeys),
|
|
14304
|
-
...sourceMeta ? {
|
|
14305
|
-
sourceHash: sourceMeta.sourceHash,
|
|
14306
|
-
sourceCount: sourceMeta.sourceCount,
|
|
14307
|
-
schemaVersion: sourceMeta.schemaVersion
|
|
14308
|
-
} : {}
|
|
14309
|
-
});
|
|
14310
|
-
current.referenceKeys = Array.from(extractedKeys);
|
|
14311
|
-
summaryGenerated = true;
|
|
14312
|
-
generatedSummary = newSummary.trim();
|
|
14313
|
-
compactedMessageCount = plan.compressCount;
|
|
14314
|
-
const metrics = buildCompactionMetricsFromPlan({
|
|
14315
|
-
reason: "manual",
|
|
14316
|
-
previousSummary: current.summary || "",
|
|
14317
|
-
plan,
|
|
14318
|
-
newSummary: newSummary.trim()
|
|
14319
|
-
});
|
|
14320
|
-
console.log(formatCompactionMetricsLog(metrics));
|
|
14444
|
+
} catch (error) {
|
|
14445
|
+
console.warn(`[nolo] compact: summary generation failed: ${error}`);
|
|
14321
14446
|
}
|
|
14322
|
-
} catch (error) {
|
|
14323
|
-
console.warn(`[nolo] compact: summary generation failed: ${error}`);
|
|
14324
14447
|
}
|
|
14325
14448
|
}
|
|
14326
14449
|
}
|
|
@@ -14985,7 +15108,12 @@ async function runSubmittedSlashLine(line, host2, actionGateHandler, confirmDest
|
|
|
14985
15108
|
spawnRunner,
|
|
14986
15109
|
installAltScreenRestoreHandlers: installAltScreenRestoreHandlers2
|
|
14987
15110
|
} = host2;
|
|
14988
|
-
const
|
|
15111
|
+
const taskOutput = await runTaskSlashCommand(line, { getDialogId: () => host2.state.dialogId, env: host2.taskEnv ?? process.env, confirm: host2.confirmTaskStop });
|
|
15112
|
+
if (taskOutput !== null) {
|
|
15113
|
+
emitCommandOutput(taskOutput, line.trim());
|
|
15114
|
+
return false;
|
|
15115
|
+
}
|
|
15116
|
+
const result = handleTuiInput2(line, host2.state, collectConversationTurns(host2.history), { env: host2.taskEnv });
|
|
14989
15117
|
const previousState = host2.state;
|
|
14990
15118
|
const previousAgentKey = host2.state.agentKey;
|
|
14991
15119
|
host2.state = result.nextState;
|
|
@@ -16316,7 +16444,6 @@ async function runTuiWorkspace(options) {
|
|
|
16316
16444
|
};
|
|
16317
16445
|
let chatQueueBinding = null;
|
|
16318
16446
|
let turnInjectionInbox = null;
|
|
16319
|
-
let noteUserTurnHook = null;
|
|
16320
16447
|
const childShellApprovals = createShellApprovalSession(async (request, signal) => runWithInputRequiredAttention({ output, env: effectiveEnv }, () => {
|
|
16321
16448
|
if (signal.aborted) return Promise.resolve(false);
|
|
16322
16449
|
return dialogHost.run((anchor) => runConfirmDialog({
|
|
@@ -16434,7 +16561,6 @@ async function runTuiWorkspace(options) {
|
|
|
16434
16561
|
set turnInjectionInbox(v) {
|
|
16435
16562
|
turnInjectionInbox = v;
|
|
16436
16563
|
},
|
|
16437
|
-
noteUserTurn: () => noteUserTurnHook?.(),
|
|
16438
16564
|
onUserTurnFinalized: (turn, imageUrls) => {
|
|
16439
16565
|
const preview = imageCache.preview(`turn-${turnIdentity++}`, imageUrls.map((dataUrl) => ({
|
|
16440
16566
|
dataUrl,
|
|
@@ -16512,6 +16638,19 @@ async function runTuiWorkspace(options) {
|
|
|
16512
16638
|
);
|
|
16513
16639
|
return true;
|
|
16514
16640
|
};
|
|
16641
|
+
const confirmTaskStop = async (view) => {
|
|
16642
|
+
if (!isInteractiveInput(input)) return false;
|
|
16643
|
+
return runWithInputRequiredAttention(
|
|
16644
|
+
{ output, env: effectiveEnv },
|
|
16645
|
+
() => dialogHost.run((anchor) => runConfirmDialog({
|
|
16646
|
+
request: { id: `task-stop-${view.id}`, tool: "taskStop", action: "task-stop", title: "Stop task?", body: view.title, command: view.id },
|
|
16647
|
+
fullCommand: true,
|
|
16648
|
+
input,
|
|
16649
|
+
output,
|
|
16650
|
+
...anchor
|
|
16651
|
+
}))
|
|
16652
|
+
);
|
|
16653
|
+
};
|
|
16515
16654
|
const slashHost = {
|
|
16516
16655
|
get state() {
|
|
16517
16656
|
return state;
|
|
@@ -16538,6 +16677,8 @@ async function runTuiWorkspace(options) {
|
|
|
16538
16677
|
input,
|
|
16539
16678
|
output,
|
|
16540
16679
|
options,
|
|
16680
|
+
taskEnv: effectiveEnv,
|
|
16681
|
+
confirmTaskStop,
|
|
16541
16682
|
fetchImpl,
|
|
16542
16683
|
turnCtx,
|
|
16543
16684
|
emitCommandOutput,
|
|
@@ -16712,7 +16853,7 @@ async function runTuiWorkspace(options) {
|
|
|
16712
16853
|
onApprove: createSnapshotGuardedApproval("local", () => state.permissionGrants, approveLocalConfirms),
|
|
16713
16854
|
onApproved: async (approvedGate) => {
|
|
16714
16855
|
if (approvedGate.kind !== "confirm") return null;
|
|
16715
|
-
const { executeApprovedCredentialCreate } = await import("./hostCredentialCreate-
|
|
16856
|
+
const { executeApprovedCredentialCreate } = await import("./hostCredentialCreate-S233UMAP.js");
|
|
16716
16857
|
const hostResult = await executeApprovedCredentialCreate({
|
|
16717
16858
|
gate: approvedGate,
|
|
16718
16859
|
approvalGateId: approvedGate.id,
|
|
@@ -16746,9 +16887,25 @@ async function runTuiWorkspace(options) {
|
|
|
16746
16887
|
isPromoted: (taskId) => getProcessRegistry().getByTaskId(taskId)?.promoted ?? false,
|
|
16747
16888
|
getCurrentDialogId: () => state.dialogId ?? null,
|
|
16748
16889
|
isTurnActive: () => busy || fixedInput.isPaused(),
|
|
16749
|
-
canDeliver: () => !sessionEnded && !done && runWakeHandler !== null
|
|
16890
|
+
canDeliver: () => !sessionEnded && !done && runWakeHandler !== null,
|
|
16891
|
+
onDecision: (decision) => {
|
|
16892
|
+
const owner = getProcessRegistry().getByTaskId(decision.taskId)?.owner;
|
|
16893
|
+
try {
|
|
16894
|
+
const resumeLogger = getDiagnostics()?.logger.child({ component: "process-terminal-resume" });
|
|
16895
|
+
const fields = {
|
|
16896
|
+
taskId: decision.taskId,
|
|
16897
|
+
kind: decision.kind,
|
|
16898
|
+
reason: decision.kind === "notice-only" ? decision.reason : void 0,
|
|
16899
|
+
ownerDialogId: owner?.dialogId,
|
|
16900
|
+
currentDialogId: state.dialogId ?? null,
|
|
16901
|
+
depth: owner?.processCausalDepth ?? 0
|
|
16902
|
+
};
|
|
16903
|
+
if (decision.kind === "notice-only") resumeLogger?.warn("process terminal decision: notice-only", fields);
|
|
16904
|
+
else resumeLogger?.debug("process terminal decision", fields);
|
|
16905
|
+
} catch {
|
|
16906
|
+
}
|
|
16907
|
+
}
|
|
16750
16908
|
});
|
|
16751
|
-
noteUserTurnHook = () => processTerminalResumer.noteUserTurn();
|
|
16752
16909
|
const runIdleTextTurn = async (inputMsg) => {
|
|
16753
16910
|
const req = createTurnRequest(inputMsg);
|
|
16754
16911
|
const { actionGateHandler, confirmDestructiveAction } = buildInteractiveTurnHandlers();
|
|
@@ -16850,7 +17007,7 @@ ${err.message}` : ""}`
|
|
|
16850
17007
|
pushPendingProcessNotice(notice);
|
|
16851
17008
|
return;
|
|
16852
17009
|
}
|
|
16853
|
-
runWakeHandler?.(buildProcessTaskCompletedTurnEvent(notice));
|
|
17010
|
+
runWakeHandler?.({ ...buildProcessTaskCompletedTurnEvent(notice), processCausalDepth: (decision.owner.processCausalDepth ?? 0) + 1 });
|
|
16854
17011
|
if (fixedInput.active && !fixedInput.isPaused()) {
|
|
16855
17012
|
fixedInput.repaint(buffer, cursorPos);
|
|
16856
17013
|
}
|
|
@@ -17021,8 +17178,14 @@ ${err.message}` : ""}`
|
|
|
17021
17178
|
buffer = "";
|
|
17022
17179
|
cursorPos = 0;
|
|
17023
17180
|
if (fixedInput.active) fixedInput.repaint(buffer, cursorPos);
|
|
17181
|
+
const taskOutput = await runTaskSlashCommand(submittedText, { getDialogId: () => state.dialogId, env: effectiveEnv, confirm: confirmTaskStop });
|
|
17182
|
+
if (taskOutput !== null) {
|
|
17183
|
+
output.write(`${taskOutput}
|
|
17184
|
+
`);
|
|
17185
|
+
return;
|
|
17186
|
+
}
|
|
17024
17187
|
const beforeAgentKey = state.agentKey;
|
|
17025
|
-
const res = handleTuiInput2(submittedText, state, collectConversationTurns(history));
|
|
17188
|
+
const res = handleTuiInput2(submittedText, state, collectConversationTurns(history), { env: effectiveEnv });
|
|
17026
17189
|
if (res.action?.type === "paste-clipboard") {
|
|
17027
17190
|
await readAndApplyClipboard("slash");
|
|
17028
17191
|
return;
|