nolo-cli 0.211.0 → 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-VVQEOY3D.js → _executeModel-CUJLCFWR.js} +57 -54
- package/{action-U235TV4P.js → action-DF5UYSJF.js} +4 -4
- package/{addContentAction-7C76J7ST.js → addContentAction-WERAONNY.js} +9 -9
- package/{addDialogAgentAction-KTYANUEC.js → addDialogAgentAction-7VI7YRML.js} +16 -13
- package/{agentDeleteCommand-WHRU6VDJ.js → agentDeleteCommand-XJORXPGU.js} +80 -76
- package/{agentEmailCommands-ALLHXPW3.js → agentEmailCommands-XTYYFR6Z.js} +85 -80
- package/{agentListCommands-POKMEKMS.js → agentListCommands-OBLRBLHS.js} +237 -115
- package/{agentMachineCommands-WJLZLBPI.js → agentMachineCommands-5FMT3OT5.js} +33 -31
- package/{agentProviderCommands-MN3ABDME.js → agentProviderCommands-Q5O33MED.js} +33 -4
- package/{agentRecordCommands-OULZW3KM.js → agentRecordCommands-ZQ7SVYGG.js} +75 -70
- package/{agentRunCommand-ZNG4LGNQ.js → agentRunCommand-WS7IGO2W.js} +77 -73
- package/{agentRunControl-AF7BMR22.js → agentRunControl-TAMHJQSR.js} +8 -7
- package/{agentRuntimeLocal-YMUHFV5M.js → agentRuntimeLocal-SOO2OPJG.js} +30 -27
- package/{agentSlice-WNGUIMQZ.js → agentSlice-CHR6KOZN.js} +13 -13
- package/{appDeleteCommands-6MXPLAVF.js → appDeleteCommands-GUP6P5YE.js} +34 -32
- package/{appDeployCommands-ERRSVASW.js → appDeployCommands-MH2FX4O5.js} +34 -32
- package/{appDeployStatusCommands-ULICISLI.js → appDeployStatusCommands-SUHN3HPJ.js} +34 -32
- package/{appGetCommands-WYYYWROF.js → appGetCommands-YWDEX6Z4.js} +34 -32
- package/{appListCommands-DFCUCRCV.js → appListCommands-ZQVMLPAY.js} +34 -32
- package/{authCommand-ZJMWXFMA.js → authCommand-PWX2ZNUP.js} +15 -15
- package/{authCommands-WK6E42L2.js → authCommands-HV3EAU3V.js} +2 -2
- package/{builtinSkillRegistry-HH75G5J3.js → builtinSkillRegistry-2QETTQPM.js} +5 -4
- package/{chromeOpsCommands-HEN5AX2J.js → chromeOpsCommands-DIVM2K3T.js} +1 -1
- package/{chunk-TRZP7JZ7.js → chunk-2QHFH3DR.js} +1 -0
- package/{chunk-XE4Q46FF.js → chunk-3CGG2PAL.js} +1 -1
- package/{chunk-YUXQAVRD.js → chunk-3UKL3HPD.js} +251 -14
- package/{chunk-BSISWVB4.js → chunk-4I7ERB7F.js} +1 -1
- package/{chunk-5ORJGHTL.js → chunk-4T2WNOY7.js} +6 -6
- package/{chunk-W5VC7F7V.js → chunk-5MQRBSMW.js} +84 -91
- package/{chunk-YLTLB5A7.js → chunk-6DWMYIUY.js} +7 -6
- package/chunk-6VLJ6YA7.js +11751 -0
- package/{chunk-KSTEXKL6.js → chunk-75XIDFBW.js} +4 -3
- package/{chunk-BTYQAODF.js → chunk-7BT37FK3.js} +196 -308
- package/{chunk-27E2CBBY.js → chunk-7OCO4TDT.js} +1 -1
- package/{chunk-V3M6IXQI.js → chunk-7QTZCMKL.js} +335 -131
- package/chunk-7RFNTILS.js +2213 -0
- package/{chunk-NHQKWPLP.js → chunk-7Y4YTDQF.js} +25 -23
- package/{chunk-CKAHAVMK.js → chunk-A7TFUNZO.js} +35 -25
- package/{chunk-PJNFNEJE.js → chunk-ALQ3657A.js} +28 -2
- package/{chunk-NV572QM3.js → chunk-BBJ22CLB.js} +15 -15
- package/chunk-CJEIOP3E.js +0 -0
- package/{chunk-4WCEC56C.js → chunk-COFEN36Z.js} +2 -2
- package/{chunk-25OB36GU.js → chunk-CRHOO2ZR.js} +4 -4
- package/{chunk-NTSRCTUX.js → chunk-CTPXME7U.js} +2 -2
- package/{chunk-TPCDYNJK.js → chunk-EHGEOAHI.js} +3 -3
- package/{chunk-Y2WUYX4I.js → chunk-EHSZD5OI.js} +1 -1
- package/{chunk-SU3QL7YG.js → chunk-FUGMREBO.js} +2 -2
- package/{chunk-UMEGDH6A.js → chunk-FW6YHHLI.js} +8 -8
- package/chunk-FY7F4Q6X.js +127 -0
- package/{chunk-25M2K6OA.js → chunk-G2BQWAVT.js} +3 -3
- package/chunk-G7MLNNEX.js +84 -0
- package/{chunk-DQLB4NQ3.js → chunk-GPVRUGGY.js} +2 -2
- package/{chunk-RQ22OZD7.js → chunk-H2TJUNCH.js} +1 -1
- package/{chunk-XPHZK3PJ.js → chunk-H4UOTUOX.js} +165 -51
- package/{chunk-CVCRAO6Q.js → chunk-H5HF7TJA.js} +9 -7
- package/{chunk-OP7PTBAJ.js → chunk-H7PPIYWP.js} +9 -9
- package/{chunk-QQM464AL.js → chunk-HPFCI4SK.js} +3 -3
- package/chunk-HRMJUN5J.js +26 -0
- package/{chunk-WI6OGHXJ.js → chunk-HSVBJRF4.js} +5 -5
- package/{chunk-RYWO5AKN.js → chunk-HUBHAQK2.js} +10 -10
- package/{chunk-LKDF3ATR.js → chunk-INUFILG6.js} +1 -1
- package/{chunk-NXCGNS4N.js → chunk-IXNGOHV5.js} +2 -2
- package/{chunk-ET2CWLIJ.js → chunk-J2NHJ7WX.js} +4 -4
- package/{chunk-ECX3NKRD.js → chunk-JY5NGFFH.js} +11 -0
- package/chunk-KC4XDTT3.js +227 -0
- package/{chunk-ADBWFYJD.js → chunk-KFLT5KAD.js} +9 -9
- package/{chunk-PLYWH7XM.js → chunk-KIM6CLW5.js} +7 -7
- package/{chunk-7IYBN7IA.js → chunk-LLRPJECG.js} +22 -13
- package/{chunk-3J3U3KXB.js → chunk-MDB67IWP.js} +5 -5
- package/chunk-MMA3LZ3W.js +105 -0
- package/{chunk-XDMGY5IU.js → chunk-MOIJOHA5.js} +227 -11
- package/{chunk-NLT32XBZ.js → chunk-NJLL224W.js} +2 -2
- package/{chunk-JBOUVTZX.js → chunk-NOKUNJON.js} +15 -4
- package/{chunk-C2XZM3K4.js → chunk-NSAPDIN2.js} +12 -27
- package/{chunk-PAFTGNWA.js → chunk-O2TZF4AI.js} +2 -2
- package/{chunk-UIOEHFF6.js → chunk-OQHIVPG4.js} +1 -0
- package/{chunk-TCTSYFDM.js → chunk-OQPKUBPB.js} +19 -6
- package/{chunk-X4F26D5K.js → chunk-P5L7CXOC.js} +58 -33
- package/{chunk-OXME3PEE.js → chunk-PCLE46CE.js} +1 -1
- package/{chunk-UCPAVEQB.js → chunk-PYRUW7XN.js} +1 -1
- package/{chunk-YXOBCDNW.js → chunk-QG4AOSON.js} +12 -49
- package/{chunk-RXCCWVA2.js → chunk-QHPRUL4O.js} +3 -3
- package/{chunk-I5PBXF7O.js → chunk-R5O4QAWG.js} +1 -1
- package/{chunk-HD3WR3TD.js → chunk-RLBNLZVC.js} +1 -1
- package/{chunk-SN5XE6GQ.js → chunk-RPQXPZZF.js} +4 -4
- package/{chunk-ZOO3WJIE.js → chunk-RSHTSUEG.js} +948 -108
- package/{chunk-6HVBI6TI.js → chunk-RZOV7OMV.js} +12 -229
- package/{chunk-D2MDMY2M.js → chunk-SVYO6AO7.js} +7 -1
- package/{chunk-IIHY4ZAI.js → chunk-TAKB25RM.js} +8 -4
- package/{chunk-ZN5AH4BY.js → chunk-TX5EYMGT.js} +6 -6
- package/{chunk-CKOO42G5.js → chunk-UHJGXRJ4.js} +4 -4
- package/{chunk-M4NTDZG3.js → chunk-UYD5HQ6T.js} +857 -295
- package/{chunk-WTKYP6QO.js → chunk-V5Y3R6BT.js} +114 -6
- package/{chunk-3RQVYR4B.js → chunk-VNYYOX3V.js} +59 -20
- package/{chunk-4LEGTOSR.js → chunk-VO4WSAVP.js} +3 -3
- package/{chunk-LNYHAKBP.js → chunk-W4S457LU.js} +1 -1
- package/{chunk-RIALQUSF.js → chunk-WMTBPBMP.js} +6 -6
- package/chunk-WPORQFYN.js +74 -0
- package/{chunk-Y6M7KJOA.js → chunk-WRYQ35LQ.js} +5 -5
- package/{chunk-YKFP6UGT.js → chunk-WYDI6TGM.js} +17 -17
- package/{chunk-SCYQJPGA.js → chunk-X7SDOJUM.js} +147 -20
- package/chunk-XFYFMTOM.js +92 -0
- package/{chunk-LT3EAHJY.js → chunk-XHQC4PXX.js} +65 -49
- package/{chunk-2WZXXAQD.js → chunk-YB3YZK56.js} +67 -1
- package/{chunk-JKW6LERJ.js → chunk-YJAFKXMU.js} +14 -14
- package/{chunk-GSQNH63I.js → chunk-YTF4WH7J.js} +3 -19
- package/{chunk-DA7CTWT4.js → chunk-YWSEPJ7C.js} +5 -5
- package/{chunk-3V2QMRNN.js → chunk-ZL5RAEEB.js} +3 -3
- package/{chunk-NEZGPBL7.js → chunk-ZNWI6OVT.js} +2 -2
- package/{chunk-MBS6CTZB.js → chunk-ZXOUUDCG.js} +266 -2014
- package/cliAgentConfigHelpers-WJBZQTLW.js +41 -0
- package/{commandRegistry-FI2IOQ3U.js → commandRegistry-W63CYRZJ.js} +91 -87
- package/{contentThunks-5LKNNDGY.js → contentThunks-U7PL5MQD.js} +27 -26
- package/{cooldownCommands-YXLWOXWR.js → cooldownCommands-TIGUHXTD.js} +3 -3
- package/{createAgentAutomationAction-TI4QG4CY.js → createAgentAutomationAction-OLBQDD6R.js} +27 -26
- package/{createDialogAction-TJ3JKLO4.js → createDialogAction-SVH6B3SB.js} +29 -28
- package/{createPageAction-GKXT6WEH.js → createPageAction-F4DIWZ2Z.js} +29 -28
- package/{dbSlice-LPMZ2DGJ.js → dbSlice-BVH2YZPQ.js} +8 -8
- package/{deleteFile-EPUQHKPA.js → deleteFile-5YOEKV4U.js} +4 -4
- package/{dialogCommands-IWPXIZ5P.js → dialogCommands-KHIEPY3M.js} +38 -36
- package/{dialogSlice-ZWNNS7GZ.js → dialogSlice-ZCTDV2PZ.js} +25 -24
- package/{dialogUsageCommand-ZCPPHPJ5.js → dialogUsageCommand-7KCPYGHG.js} +1 -1
- package/{docCreateCommands-HFSPKJSI.js → docCreateCommands-DPMZI7G5.js} +32 -30
- package/{docDeleteCommands-CRL62POH.js → docDeleteCommands-IRQQLUBT.js} +34 -33
- package/{docReadCommands-QOTOX3XW.js → docReadCommands-LK37XH6L.js} +32 -30
- package/{docStore-WYLRB7ED.js → docStore-V2KECILA.js} +11 -11
- package/{docUpdateCommands-7BMH4MCA.js → docUpdateCommands-O6T3HJHH.js} +32 -30
- package/{fetchMessages-YY4SATNR.js → fetchMessages-NR4KNQLO.js} +3 -3
- package/{getPricing-OQXBJ6VZ.js → getPricing-2MNMXEVG.js} +3 -3
- package/{handleSendMessageAction-P27YP2DQ.js → handleSendMessageAction-2PE25WM3.js} +49 -47
- package/hostCredentialCreate-S233UMAP.js +357 -0
- package/index.js +7 -7
- package/{keys-P4ZDOVJW.js → keys-BEGDOTRL.js} +3 -1
- package/{localDialogRead-5VCMQQZF.js → localDialogRead-7NNDVVF7.js} +1 -1
- package/{localRuntimeAdapter-GP6ZSSO3.js → localRuntimeAdapter-KY6WXNBR.js} +82 -75
- package/{machineCommands-6Z6H4BFX.js → machineCommands-Q6HA3IXF.js} +74 -69
- package/{machineWsRunDispatch-F2ZIXMYM.js → machineWsRunDispatch-WWJQ6WR3.js} +74 -69
- package/{memberThunks-YSEFJF47.js → memberThunks-7EDJADWU.js} +9 -9
- package/package.json +1 -1
- package/{projectArchive-PIGEOX3D.js → projectArchive-DRTDIMEV.js} +29 -28
- package/{providerPresetApply-ZYMLQA46.js → providerPresetApply-YXGV6NXB.js} +4 -4
- package/{providerRegistry-E34XWDLJ.js → providerRegistry-S6UL6UNA.js} +4 -4
- package/{read-DIIQBOOO.js → read-4V2RMG7N.js} +4 -4
- package/{readDocTool-HXYGOEA7.js → readDocTool-BH6ATGQO.js} +1 -1
- package/{readlineWorkspace-UG25G7KC.js → readlineWorkspace-2W4WRCOU.js} +437 -217
- package/{removeDialogAgentAction-ALJDUJ2E.js → removeDialogAgentAction-LYAZGNKW.js} +18 -15
- package/{runAgentClientLoop-IO5F7TCZ.js → runAgentClientLoop-J2VQBS2Z.js} +55 -52
- package/{runtimeDoctorCommands-PGAA47G5.js → runtimeDoctorCommands-QAI3MBKQ.js} +6 -6
- package/{secretCommands-ZCZ4KVET.js → secretCommands-LXDWOLZ6.js} +4 -4
- package/{setDialogExtraReferencesAction-O3SVMD5A.js → setDialogExtraReferencesAction-OCRPGPYH.js} +11 -11
- package/{setPrimaryDialogAgentAction-HE7RVFFF.js → setPrimaryDialogAgentAction-HFJDQIBU.js} +19 -16
- package/{settingThunks-BWWJQG4L.js → settingThunks-RAMHMTGM.js} +13 -12
- package/{spaceCommands-UAELIFEI.js → spaceCommands-KVJZVKVO.js} +32 -31
- package/{streamAgentChatTurn-VUKZQYJR.js → streamAgentChatTurn-GHBMJJ6S.js} +63 -60
- package/{switchDialogAgentAction-3VZS7SOS.js → switchDialogAgentAction-EBRMW3RA.js} +16 -13
- package/{tools-VRXJAVYI.js → tools-EWKCPKMS.js} +49 -46
- package/{tuiSummaryLlmCaller-TGCHZLSW.js → tuiSummaryLlmCaller-ALQYUUWB.js} +48 -19
- package/{updateCommands-Q6CYAEYJ.js → updateCommands-ZQYU6SCI.js} +5 -3
- package/{updateDialogTitleAction-MULWCJCW.js → updateDialogTitleAction-5GGMBTDF.js} +40 -72
- package/usageCommand-F4IPVMIZ.js +32 -0
- package/usageRebuildCommand-HAW2AD5N.js +626 -0
- package/{windowsSelfUpdate-XSQVF2GK.js → windowsSelfUpdate-257DV2T6.js} +2 -2
- package/{workloadLifecycle-4BEQHMSD.js → workloadLifecycle-4C42SVBD.js} +1 -0
- package/chunk-4LCOCOR5.js +0 -50
- package/chunk-7AUQ3WCW.js +0 -51
- package/chunk-ZRAU6T47.js +0 -56
- package/{agentFavoriteCommands-GAFEXKKP.js → agentFavoriteCommands-EDK743YA.js} +1 -1
- package/{agentGrantCommands-V5FOQKFD.js → agentGrantCommands-RQWK2TEV.js} +1 -1
- package/{agentPullCommand-2JMJP5BS.js → agentPullCommand-6EM3URVK.js} +1 -1
- package/{chunk-A2ZMIRLN.js → chunk-INN4LTAJ.js} +5 -5
- package/{chunk-PV6JJAUB.js → chunk-TCZHTTUU.js} +8 -8
- package/{chunk-AKE53VMW.js → chunk-ZCWRMUWT.js} +0 -0
- package/{tableCommands-D7WR4QSM.js → tableCommands-MP6VFSVT.js} +3 -3
|
@@ -1,48 +1,30 @@
|
|
|
1
|
-
import {
|
|
2
|
-
resolveAuthGuidanceState
|
|
3
|
-
} from "./chunk-3V2QMRNN.js";
|
|
4
1
|
import {
|
|
5
2
|
fetchCiStatus,
|
|
6
3
|
summarizeLatest
|
|
7
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-A7TFUNZO.js";
|
|
8
5
|
import "./chunk-M3JEW6N6.js";
|
|
9
6
|
import {
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
runDevinOAuthLogin,
|
|
13
|
-
runXaiOAuthDeviceCode,
|
|
14
|
-
runXaiOAuthLogin,
|
|
15
|
-
syncCredentialToServer
|
|
16
|
-
} from "./chunk-OP7PTBAJ.js";
|
|
17
|
-
import {
|
|
18
|
-
runCloudflareOAuthLogin
|
|
19
|
-
} from "./chunk-27E2CBBY.js";
|
|
20
|
-
import {
|
|
21
|
-
defaultOpenBrowser,
|
|
22
|
-
saveTokenLogin
|
|
23
|
-
} from "./chunk-XE4Q46FF.js";
|
|
7
|
+
resolveAuthGuidanceState
|
|
8
|
+
} from "./chunk-ZL5RAEEB.js";
|
|
24
9
|
import {
|
|
25
10
|
isHiddenFromDialogList,
|
|
26
11
|
loadLocalRunChildDialogIds,
|
|
27
12
|
normalizeDialogRecord,
|
|
28
13
|
readDialogSnapshot,
|
|
29
14
|
sortDialogs
|
|
30
|
-
} from "./chunk-
|
|
15
|
+
} from "./chunk-WMTBPBMP.js";
|
|
31
16
|
import {
|
|
32
17
|
listFavoriteAgentIdsAcrossServers,
|
|
33
18
|
listLocalCachedAgents,
|
|
34
19
|
listRemoteAgents,
|
|
35
20
|
listRemoteAgentsAcrossServers,
|
|
36
21
|
normalizeListedAgent
|
|
37
|
-
} from "./chunk-
|
|
38
|
-
import {
|
|
39
|
-
refreshSubscriptionQuotas
|
|
40
|
-
} from "./chunk-YGILMZ7N.js";
|
|
22
|
+
} from "./chunk-J2NHJ7WX.js";
|
|
41
23
|
import "./chunk-ID4G2MAR.js";
|
|
42
24
|
import {
|
|
43
25
|
listUserRecordsFromServers,
|
|
44
26
|
readLiveDbRecordAfterTombstoneMerge
|
|
45
|
-
} from "./chunk-
|
|
27
|
+
} from "./chunk-VO4WSAVP.js";
|
|
46
28
|
import {
|
|
47
29
|
ANSI_ESCAPE_REGEX,
|
|
48
30
|
COLLAPSED_PASTE_PLACEHOLDER_RE,
|
|
@@ -119,19 +101,32 @@ import {
|
|
|
119
101
|
wrapTextToLines,
|
|
120
102
|
wrapTranscriptLine,
|
|
121
103
|
wrapTranscriptLineWithLayout
|
|
122
|
-
} from "./chunk-
|
|
104
|
+
} from "./chunk-7QTZCMKL.js";
|
|
123
105
|
import "./chunk-6QDYSCPW.js";
|
|
124
|
-
import "./chunk-WI6OGHXJ.js";
|
|
125
|
-
import "./chunk-TY3TIUJK.js";
|
|
126
106
|
import "./chunk-Y5GCAMGP.js";
|
|
107
|
+
import "./chunk-HSVBJRF4.js";
|
|
108
|
+
import {
|
|
109
|
+
refreshSubscriptionQuotas
|
|
110
|
+
} from "./chunk-YGILMZ7N.js";
|
|
127
111
|
import {
|
|
128
112
|
getReadableCliDb
|
|
129
113
|
} from "./chunk-J5JTMQIA.js";
|
|
130
114
|
import {
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
115
|
+
runAnthropicOAuthLogin,
|
|
116
|
+
runCursorOAuthLogin,
|
|
117
|
+
runDevinOAuthLogin,
|
|
118
|
+
runXaiOAuthDeviceCode,
|
|
119
|
+
runXaiOAuthLogin,
|
|
120
|
+
syncCredentialToServer
|
|
121
|
+
} from "./chunk-H7PPIYWP.js";
|
|
122
|
+
import {
|
|
123
|
+
runCloudflareOAuthLogin
|
|
124
|
+
} from "./chunk-7OCO4TDT.js";
|
|
125
|
+
import {
|
|
126
|
+
defaultOpenBrowser,
|
|
127
|
+
saveTokenLogin
|
|
128
|
+
} from "./chunk-3CGG2PAL.js";
|
|
129
|
+
import "./chunk-TY3TIUJK.js";
|
|
135
130
|
import "./chunk-S73EPYNC.js";
|
|
136
131
|
import {
|
|
137
132
|
RUN_WAKE_CHANNEL_ENV,
|
|
@@ -142,7 +137,14 @@ import {
|
|
|
142
137
|
formatApprovalRemaining,
|
|
143
138
|
readTimestamp,
|
|
144
139
|
registerHostApprovalRenderer
|
|
145
|
-
} from "./chunk-
|
|
140
|
+
} from "./chunk-UYD5HQ6T.js";
|
|
141
|
+
import "./chunk-VP3BINY7.js";
|
|
142
|
+
import "./chunk-YTF4WH7J.js";
|
|
143
|
+
import {
|
|
144
|
+
deleteDbRecord,
|
|
145
|
+
queryUserRecords,
|
|
146
|
+
readDbRecord
|
|
147
|
+
} from "./chunk-MOIJOHA5.js";
|
|
146
148
|
import "./chunk-WOAZVUSN.js";
|
|
147
149
|
import {
|
|
148
150
|
anthropicGrantRemainingMs,
|
|
@@ -150,73 +152,75 @@ import {
|
|
|
150
152
|
runAntigravityOAuthLogin,
|
|
151
153
|
runOpenAiCodexBrowserPkce,
|
|
152
154
|
runOpenAiCodexDeviceCode
|
|
153
|
-
} from "./chunk-
|
|
154
|
-
import "./chunk-
|
|
155
|
-
import "./chunk-
|
|
156
|
-
import "./chunk-7AUQ3WCW.js";
|
|
155
|
+
} from "./chunk-RPQXPZZF.js";
|
|
156
|
+
import "./chunk-LKZPX6YH.js";
|
|
157
|
+
import "./chunk-G7MLNNEX.js";
|
|
157
158
|
import {
|
|
158
159
|
NOLO_DEFAULT_AGENT_KEY,
|
|
159
160
|
resolveCliAgentKeyInput
|
|
160
161
|
} from "./chunk-NBTY7YJF.js";
|
|
161
|
-
import "./chunk-LKZPX6YH.js";
|
|
162
162
|
import "./chunk-VL5KOY2C.js";
|
|
163
163
|
import "./chunk-ZEZC7IIM.js";
|
|
164
164
|
import "./chunk-VIWDGTDA.js";
|
|
165
165
|
import "./chunk-HGDKT2D6.js";
|
|
166
166
|
import "./chunk-F7CI2ZC5.js";
|
|
167
|
-
import "./chunk-
|
|
167
|
+
import "./chunk-H2TJUNCH.js";
|
|
168
168
|
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
|
-
import "./chunk-
|
|
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
|
+
import "./chunk-7RFNTILS.js";
|
|
207
208
|
import "./chunk-LEC5ALIN.js";
|
|
208
|
-
import
|
|
209
|
-
|
|
209
|
+
import {
|
|
210
|
+
BUILTIN_DIALOG_LLM_FALLBACK_MODEL,
|
|
211
|
+
BUILTIN_SUMMARY_LLM_CONFIG
|
|
212
|
+
} from "./chunk-523DITKR.js";
|
|
213
|
+
import "./chunk-KFLT5KAD.js";
|
|
210
214
|
import "./chunk-5XBUWM6I.js";
|
|
211
215
|
import "./chunk-BYXBJQAS.js";
|
|
212
216
|
import "./chunk-QYPE3TS3.js";
|
|
213
|
-
import "./chunk-
|
|
217
|
+
import "./chunk-NJLL224W.js";
|
|
214
218
|
import "./chunk-4JH2UMJR.js";
|
|
215
|
-
import "./chunk-
|
|
219
|
+
import "./chunk-GPVRUGGY.js";
|
|
216
220
|
import "./chunk-UAD2WT54.js";
|
|
217
221
|
import "./chunk-5RGU3J7P.js";
|
|
218
|
-
import "./chunk-
|
|
219
|
-
import "./chunk-
|
|
222
|
+
import "./chunk-WPORQFYN.js";
|
|
223
|
+
import "./chunk-MMA3LZ3W.js";
|
|
220
224
|
import "./chunk-OWYYDMGJ.js";
|
|
221
225
|
import "./chunk-YDH3FDFQ.js";
|
|
222
226
|
import "./chunk-P2ZLUIW2.js";
|
|
@@ -225,21 +229,21 @@ import "./chunk-5ZMIIR23.js";
|
|
|
225
229
|
import "./chunk-CVMMWN6P.js";
|
|
226
230
|
import "./chunk-AZMYUSVF.js";
|
|
227
231
|
import "./chunk-GLKOYSRU.js";
|
|
228
|
-
import "./chunk-
|
|
229
|
-
import "./chunk-
|
|
230
|
-
import "./chunk-
|
|
232
|
+
import "./chunk-HPFCI4SK.js";
|
|
233
|
+
import "./chunk-4I7ERB7F.js";
|
|
234
|
+
import "./chunk-FW6YHHLI.js";
|
|
231
235
|
import "./chunk-3PVYUPXK.js";
|
|
232
|
-
import "./chunk-
|
|
233
|
-
import "./chunk-
|
|
234
|
-
import "./chunk-
|
|
236
|
+
import "./chunk-COFEN36Z.js";
|
|
237
|
+
import "./chunk-O2TZF4AI.js";
|
|
238
|
+
import "./chunk-PYRUW7XN.js";
|
|
235
239
|
import "./chunk-UEILX4EV.js";
|
|
236
|
-
import "./chunk-
|
|
240
|
+
import "./chunk-P5L7CXOC.js";
|
|
237
241
|
import "./chunk-AGP3YSEC.js";
|
|
238
242
|
import "./chunk-QQ56R7KS.js";
|
|
239
243
|
import "./chunk-OW765XBU.js";
|
|
240
244
|
import "./chunk-PXYBUFDB.js";
|
|
241
|
-
import "./chunk-
|
|
242
|
-
import "./chunk-
|
|
245
|
+
import "./chunk-EHSZD5OI.js";
|
|
246
|
+
import "./chunk-SVYO6AO7.js";
|
|
243
247
|
import {
|
|
244
248
|
buildSkillDiscoveryContextBlock,
|
|
245
249
|
buildSkillDiscoveryContextLayer,
|
|
@@ -247,10 +251,10 @@ import {
|
|
|
247
251
|
} from "./chunk-F6UUQOG6.js";
|
|
248
252
|
import {
|
|
249
253
|
listBuiltinSkills
|
|
250
|
-
} from "./chunk-
|
|
254
|
+
} from "./chunk-WRYQ35LQ.js";
|
|
251
255
|
import {
|
|
252
256
|
expandEnabledPacks
|
|
253
|
-
} from "./chunk-
|
|
257
|
+
} from "./chunk-EHGEOAHI.js";
|
|
254
258
|
import {
|
|
255
259
|
parseExternalSkillMarkdown
|
|
256
260
|
} from "./chunk-AETZ7AD6.js";
|
|
@@ -260,16 +264,18 @@ import {
|
|
|
260
264
|
buildLoadSkillExecutor,
|
|
261
265
|
buildLocalWorkspaceOpenAiTools,
|
|
262
266
|
buildLocalWorkspaceToolset,
|
|
263
|
-
readCommandActionGatePayload
|
|
264
|
-
|
|
267
|
+
readCommandActionGatePayload,
|
|
268
|
+
runTaskStop,
|
|
269
|
+
scrubSecrets
|
|
270
|
+
} from "./chunk-RSHTSUEG.js";
|
|
265
271
|
import "./chunk-ZNFJWEN4.js";
|
|
266
|
-
import "./chunk-
|
|
267
|
-
import "./chunk-
|
|
272
|
+
import "./chunk-OQPKUBPB.js";
|
|
273
|
+
import "./chunk-CTPXME7U.js";
|
|
268
274
|
import "./chunk-HNUWUO75.js";
|
|
269
275
|
import "./chunk-CHOZJMJS.js";
|
|
270
276
|
import "./chunk-PWTNI4N7.js";
|
|
271
277
|
import "./chunk-Y63ZSOR6.js";
|
|
272
|
-
import "./chunk-
|
|
278
|
+
import "./chunk-W4S457LU.js";
|
|
273
279
|
import "./chunk-4KB6WQUL.js";
|
|
274
280
|
import "./chunk-56GBUMO5.js";
|
|
275
281
|
import {
|
|
@@ -279,58 +285,56 @@ import {
|
|
|
279
285
|
DISPATCH_CANDIDATE_POLICY,
|
|
280
286
|
PARALLEL_DISPATCH_DEFAULT_RULE,
|
|
281
287
|
PLATFORM_RISK_CONTROL_RULE,
|
|
288
|
+
TOOL_GUIDED_SECTION_ORDER,
|
|
282
289
|
VERIFY_BEFORE_CONCLUDING_RULE,
|
|
283
290
|
buildConsultationModeBlock,
|
|
284
291
|
buildIdentityBlock,
|
|
285
292
|
buildRuntimeGuidanceBlocks,
|
|
286
293
|
resolveResponseGuidelines,
|
|
287
294
|
resolveToolGuidedSections
|
|
288
|
-
} from "./chunk-
|
|
289
|
-
import "./chunk-
|
|
295
|
+
} from "./chunk-5MQRBSMW.js";
|
|
296
|
+
import "./chunk-H5HF7TJA.js";
|
|
290
297
|
import "./chunk-E2BESSAW.js";
|
|
291
|
-
import "./chunk-
|
|
298
|
+
import "./chunk-RZOV7OMV.js";
|
|
292
299
|
import {
|
|
293
300
|
formatQuotaSummary,
|
|
294
301
|
isQuotaExhaustedError
|
|
295
|
-
} from "./chunk-
|
|
296
|
-
import "./chunk-
|
|
297
|
-
import "./chunk-
|
|
302
|
+
} from "./chunk-3UKL3HPD.js";
|
|
303
|
+
import "./chunk-KC4XDTT3.js";
|
|
304
|
+
import "./chunk-YB3YZK56.js";
|
|
305
|
+
import "./chunk-YWSEPJ7C.js";
|
|
298
306
|
import "./chunk-WJZOQR2J.js";
|
|
299
|
-
import "./chunk-
|
|
307
|
+
import "./chunk-UHJGXRJ4.js";
|
|
300
308
|
import "./chunk-2MBTWINN.js";
|
|
301
309
|
import {
|
|
302
310
|
extractReferenceKeysFromMessage,
|
|
303
311
|
normalizeUsage
|
|
304
|
-
} from "./chunk-
|
|
305
|
-
import "./chunk-5ZUL4CUO.js";
|
|
312
|
+
} from "./chunk-V5Y3R6BT.js";
|
|
306
313
|
import {
|
|
307
314
|
DEFAULT_CONTEXT_WINDOW,
|
|
315
|
+
buildBoundedCompactionRequest,
|
|
308
316
|
buildCompactionMetricsFromPlan,
|
|
309
|
-
buildCompactionUserContent,
|
|
310
317
|
computeSummarySourceMetadata,
|
|
318
|
+
findModelContextWindow,
|
|
311
319
|
formatCompactionMetricsLog,
|
|
312
|
-
formatFileOperationsFromMessages,
|
|
313
|
-
formatMessagesForSummaryWithTruncation,
|
|
314
320
|
getModelContextWindow,
|
|
315
321
|
planCompression,
|
|
316
322
|
serializeMessageContent
|
|
317
|
-
} from "./chunk-
|
|
323
|
+
} from "./chunk-7BT37FK3.js";
|
|
318
324
|
import "./chunk-H57T64RA.js";
|
|
325
|
+
import "./chunk-5ZUL4CUO.js";
|
|
319
326
|
import "./chunk-UKZX3NHN.js";
|
|
320
327
|
import {
|
|
321
328
|
clipCompactText
|
|
322
329
|
} from "./chunk-5MMAK75Q.js";
|
|
323
|
-
import "./chunk-
|
|
324
|
-
import "./chunk-
|
|
330
|
+
import "./chunk-2QHFH3DR.js";
|
|
331
|
+
import "./chunk-OQHIVPG4.js";
|
|
325
332
|
import "./chunk-KX6YBIHG.js";
|
|
326
333
|
import {
|
|
327
334
|
compactWhitespace
|
|
328
335
|
} from "./chunk-DWLEOOGR.js";
|
|
329
336
|
import "./chunk-7DPNBQSV.js";
|
|
330
|
-
import
|
|
331
|
-
createOAuthTokenStore,
|
|
332
|
-
isTokenExpired
|
|
333
|
-
} from "./chunk-G7Y4GXTY.js";
|
|
337
|
+
import "./chunk-T43B7LB2.js";
|
|
334
338
|
import {
|
|
335
339
|
buildMemoryOverlayLayer,
|
|
336
340
|
buildMemoryUseGuidanceLayer,
|
|
@@ -340,9 +344,10 @@ import {
|
|
|
340
344
|
import {
|
|
341
345
|
buildUserResponseLanguageContext
|
|
342
346
|
} from "./chunk-4VJAC32I.js";
|
|
347
|
+
import "./chunk-CJEIOP3E.js";
|
|
343
348
|
import {
|
|
344
349
|
canonicalizeToolNames
|
|
345
|
-
} from "./chunk-
|
|
350
|
+
} from "./chunk-ZCWRMUWT.js";
|
|
346
351
|
import "./chunk-ZC3CMUKU.js";
|
|
347
352
|
import {
|
|
348
353
|
BUILTIN_NOLO_AGENT_KEY,
|
|
@@ -355,15 +360,17 @@ import {
|
|
|
355
360
|
extractCustomId,
|
|
356
361
|
parsePublicAgentId
|
|
357
362
|
} from "./chunk-M2EJHDJP.js";
|
|
358
|
-
import "./chunk-
|
|
363
|
+
import "./chunk-KIM6CLW5.js";
|
|
359
364
|
import {
|
|
360
365
|
TAIL_LINES_MAX,
|
|
361
366
|
backfillRunRecordParentDialog,
|
|
362
367
|
checkStaleRun,
|
|
363
368
|
isRunRecordClaimed,
|
|
364
369
|
listRunRecords,
|
|
365
|
-
readRunRecord
|
|
366
|
-
|
|
370
|
+
readRunRecord,
|
|
371
|
+
runAgentStopCommand
|
|
372
|
+
} from "./chunk-NSAPDIN2.js";
|
|
373
|
+
import "./chunk-HRMJUN5J.js";
|
|
367
374
|
import {
|
|
368
375
|
clipText,
|
|
369
376
|
formatDuration,
|
|
@@ -373,18 +380,17 @@ import {
|
|
|
373
380
|
normalizeRunTitle,
|
|
374
381
|
resolveRunLabel,
|
|
375
382
|
shortRunId
|
|
376
|
-
} from "./chunk-
|
|
383
|
+
} from "./chunk-ALQ3657A.js";
|
|
377
384
|
import {
|
|
378
385
|
formatToolOverflowMarker,
|
|
379
386
|
getProcessRegistry
|
|
380
|
-
} from "./chunk-
|
|
387
|
+
} from "./chunk-H4UOTUOX.js";
|
|
381
388
|
import {
|
|
382
389
|
estimateTokenCount
|
|
383
390
|
} from "./chunk-PSCNXBYA.js";
|
|
384
|
-
import "./chunk-6UBGXX2W.js";
|
|
385
391
|
import {
|
|
386
392
|
resolvePlatformAuthToken
|
|
387
|
-
} from "./chunk-
|
|
393
|
+
} from "./chunk-TCZHTTUU.js";
|
|
388
394
|
import "./chunk-YUA6OAH5.js";
|
|
389
395
|
import "./chunk-SM3NSZJV.js";
|
|
390
396
|
import "./chunk-JRTNUU5Z.js";
|
|
@@ -394,6 +400,10 @@ import {
|
|
|
394
400
|
import {
|
|
395
401
|
isRecord
|
|
396
402
|
} from "./chunk-KUG52IAP.js";
|
|
403
|
+
import "./chunk-GOO6G4PY.js";
|
|
404
|
+
import {
|
|
405
|
+
asTrimmedLowercaseString
|
|
406
|
+
} from "./chunk-QSJ3HFEF.js";
|
|
397
407
|
import {
|
|
398
408
|
getDiagnostics,
|
|
399
409
|
getProcessRingBuffer,
|
|
@@ -402,7 +412,7 @@ import {
|
|
|
402
412
|
import {
|
|
403
413
|
checkForCliUpdate,
|
|
404
414
|
runSelfUpdateDetailed
|
|
405
|
-
} from "./chunk-
|
|
415
|
+
} from "./chunk-NOKUNJON.js";
|
|
406
416
|
import {
|
|
407
417
|
parseUserIdFromAuthToken,
|
|
408
418
|
resolveAuthToken,
|
|
@@ -435,15 +445,20 @@ import {
|
|
|
435
445
|
resolveDefaultSpawn,
|
|
436
446
|
spawnProcess
|
|
437
447
|
} from "./chunk-4O22PGNQ.js";
|
|
438
|
-
import "./chunk-
|
|
448
|
+
import "./chunk-INUFILG6.js";
|
|
439
449
|
import {
|
|
440
450
|
dailyWelcomeTip,
|
|
441
451
|
initCliLocale,
|
|
442
452
|
parseCliLocale,
|
|
443
453
|
setCliLocale,
|
|
444
454
|
t
|
|
445
|
-
} from "./chunk-
|
|
446
|
-
import
|
|
455
|
+
} from "./chunk-VNYYOX3V.js";
|
|
456
|
+
import {
|
|
457
|
+
createOAuthTokenStore,
|
|
458
|
+
isTokenExpired
|
|
459
|
+
} from "./chunk-G7Y4GXTY.js";
|
|
460
|
+
import "./chunk-6UBGXX2W.js";
|
|
461
|
+
import "./chunk-JY5NGFFH.js";
|
|
447
462
|
import "./chunk-XJWWBO34.js";
|
|
448
463
|
import "./chunk-I42VC5KR.js";
|
|
449
464
|
import "./chunk-U6VC4MU4.js";
|
|
@@ -452,11 +467,6 @@ import "./chunk-3EUW3WEO.js";
|
|
|
452
467
|
import {
|
|
453
468
|
asOptionalTrimmedString
|
|
454
469
|
} from "./chunk-G3SUCT4W.js";
|
|
455
|
-
import "./chunk-T43B7LB2.js";
|
|
456
|
-
import "./chunk-GOO6G4PY.js";
|
|
457
|
-
import {
|
|
458
|
-
asTrimmedLowercaseString
|
|
459
|
-
} from "./chunk-QSJ3HFEF.js";
|
|
460
470
|
import "./chunk-4VNS5WPM.js";
|
|
461
471
|
|
|
462
472
|
// packages/cli/tui/shellApprovalSession.ts
|
|
@@ -3682,6 +3692,88 @@ ${t("dialogConfirmRememberLocal")}`;
|
|
|
3682
3692
|
return chosen.value;
|
|
3683
3693
|
}
|
|
3684
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
|
+
|
|
3685
3777
|
// packages/cli/tui/hostApprovalCard.ts
|
|
3686
3778
|
var ALLOW_KEYS = /* @__PURE__ */ new Set(["y", "Y"]);
|
|
3687
3779
|
var DENY_KEYS = /* @__PURE__ */ new Set(["n", "N"]);
|
|
@@ -4001,6 +4093,7 @@ function displayAgentName(snapshot) {
|
|
|
4001
4093
|
|
|
4002
4094
|
// packages/cli/tui/runZoneLines.ts
|
|
4003
4095
|
var RUN_ZONE_MAX_ROWS = 3;
|
|
4096
|
+
var RUN_ZONE_ICON = "\u21B3";
|
|
4004
4097
|
var STOP_CONFIRMED_LABEL = "\u5DF2\u505C\u6B62";
|
|
4005
4098
|
var RECLAIMED_LABEL = "\u5DF2\u6309 TTL \u5230\u671F\u56DE\u6536";
|
|
4006
4099
|
var STOP_UNCONFIRMED_LABEL = "\u505C\u6B62\u672A\u786E\u8BA4";
|
|
@@ -4061,7 +4154,7 @@ function remoteCostIsExplicitlyUnknown(carrier) {
|
|
|
4061
4154
|
function runZoneLeadIcon(status, carrier) {
|
|
4062
4155
|
if (!isAgentRunTerminalStatus(status)) {
|
|
4063
4156
|
if (carrier?.remoteTask && !remoteTaskIsActive(carrier)) return REMOTE_UNKNOWN_GLYPH;
|
|
4064
|
-
return
|
|
4157
|
+
return RUN_ZONE_ICON;
|
|
4065
4158
|
}
|
|
4066
4159
|
switch (status) {
|
|
4067
4160
|
case "done":
|
|
@@ -4153,6 +4246,7 @@ function formatRunZoneLines(snapshots, colorEnabled, now = Date.now(), maxRows =
|
|
|
4153
4246
|
const clock = remoteTaskClock(carrier, now);
|
|
4154
4247
|
const icon = runZoneLeadIcon(snapshot.status, carrier);
|
|
4155
4248
|
const label = runZoneLabel(snapshot, duplicateTitles);
|
|
4249
|
+
const typedLabel = isAgentRunTerminalStatus(snapshot.status) ? label : `${t("runZoneAgentType")} ${label}`;
|
|
4156
4250
|
const { time, rest, stalled } = runZoneFacts(snapshot, clock ?? now);
|
|
4157
4251
|
const remoteFacts = remoteTaskFacts(carrier, now);
|
|
4158
4252
|
const hideCredits = remoteCostIsExplicitlyUnknown(carrier);
|
|
@@ -4165,15 +4259,15 @@ function formatRunZoneLines(snapshots, colorEnabled, now = Date.now(), maxRows =
|
|
|
4165
4259
|
...base,
|
|
4166
4260
|
...remoteFacts
|
|
4167
4261
|
];
|
|
4168
|
-
let shownLabel =
|
|
4262
|
+
let shownLabel = typedLabel;
|
|
4169
4263
|
if (columns !== void 0) {
|
|
4170
4264
|
const fixed = (l, f) => visibleWidth(`${icon} ${l}${f.length ? ` \xB7 ${f.join(" \xB7 ")}` : ""}`);
|
|
4171
4265
|
const keep = (time && clock !== null ? 1 : 0) + (stalled ? 1 : 0);
|
|
4172
|
-
while (factList.length > keep && fixed(
|
|
4173
|
-
if (fixed(
|
|
4266
|
+
while (factList.length > keep && fixed(typedLabel, factList) > columns) factList.pop();
|
|
4267
|
+
if (fixed(typedLabel, factList) > columns) {
|
|
4174
4268
|
const tail = factList.length ? ` \xB7 ${factList.join(" \xB7 ")}` : "";
|
|
4175
4269
|
const room = columns - visibleWidth(`${icon} `) - visibleWidth(tail);
|
|
4176
|
-
shownLabel = fitAnsiLine(
|
|
4270
|
+
shownLabel = fitAnsiLine(typedLabel, Math.max(1, room));
|
|
4177
4271
|
}
|
|
4178
4272
|
}
|
|
4179
4273
|
const factsPart = factList.length > 0 ? ` \xB7 ${factList.join(" \xB7 ")}` : "";
|
|
@@ -4452,6 +4546,10 @@ function createActivityIndicator(deps) {
|
|
|
4452
4546
|
const fallbackDelayMs = deps.fallbackDelayMs ?? ACTIVITY_FALLBACK_DELAY_MS;
|
|
4453
4547
|
const setIntervalFn = deps.setIntervalFn ?? ((cb, ms) => setInterval(cb, ms));
|
|
4454
4548
|
const clearIntervalFn = deps.clearIntervalFn ?? ((handle) => clearInterval(handle));
|
|
4549
|
+
let disposed = false;
|
|
4550
|
+
const repaint = () => {
|
|
4551
|
+
if (!disposed) deps.onRepaint();
|
|
4552
|
+
};
|
|
4455
4553
|
let explicitLabel = null;
|
|
4456
4554
|
let explicitStartedAt = 0;
|
|
4457
4555
|
let fallbackActive = false;
|
|
@@ -4464,7 +4562,7 @@ function createActivityIndicator(deps) {
|
|
|
4464
4562
|
const elapsedSecFrom = (startedAt) => startedAt > 0 ? Math.max(0, Math.floor((now() - startedAt) / 1e3)) : 0;
|
|
4465
4563
|
const tick = () => {
|
|
4466
4564
|
if (stopping) {
|
|
4467
|
-
|
|
4565
|
+
repaint();
|
|
4468
4566
|
return;
|
|
4469
4567
|
}
|
|
4470
4568
|
frameIndex += 1;
|
|
@@ -4472,7 +4570,7 @@ function createActivityIndicator(deps) {
|
|
|
4472
4570
|
fallbackActive = true;
|
|
4473
4571
|
fallbackStartedAt = now();
|
|
4474
4572
|
}
|
|
4475
|
-
|
|
4573
|
+
repaint();
|
|
4476
4574
|
};
|
|
4477
4575
|
const ensureTimer = () => {
|
|
4478
4576
|
if (timer === null) {
|
|
@@ -4494,11 +4592,11 @@ function createActivityIndicator(deps) {
|
|
|
4494
4592
|
fallbackStartedAt = 0;
|
|
4495
4593
|
}
|
|
4496
4594
|
ensureTimer();
|
|
4497
|
-
|
|
4595
|
+
repaint();
|
|
4498
4596
|
};
|
|
4499
4597
|
const markStopping = () => {
|
|
4500
4598
|
stopping = true;
|
|
4501
|
-
|
|
4599
|
+
repaint();
|
|
4502
4600
|
};
|
|
4503
4601
|
const isStopping = () => stopping;
|
|
4504
4602
|
const getView = () => {
|
|
@@ -4527,8 +4625,9 @@ function createActivityIndicator(deps) {
|
|
|
4527
4625
|
}
|
|
4528
4626
|
return null;
|
|
4529
4627
|
};
|
|
4628
|
+
const processRegistry = deps.processRegistry ?? getProcessRegistry();
|
|
4530
4629
|
const runDock = deps.runDock ?? createRunDock({
|
|
4531
|
-
onRepaint:
|
|
4630
|
+
onRepaint: repaint,
|
|
4532
4631
|
now,
|
|
4533
4632
|
setIntervalFn,
|
|
4534
4633
|
clearIntervalFn,
|
|
@@ -4536,11 +4635,11 @@ function createActivityIndicator(deps) {
|
|
|
4536
4635
|
// 的 listBackground()(transient 前台 grace 包络不算后台),这里只把
|
|
4537
4636
|
// 渲染需要的四个字段投影过去,registry 记录本身不进 UI 层。
|
|
4538
4637
|
listProcs: () => {
|
|
4539
|
-
const nowMs =
|
|
4540
|
-
return
|
|
4638
|
+
const nowMs = now();
|
|
4639
|
+
return processRegistry.listBackground().filter((proc) => {
|
|
4541
4640
|
if (proc.status === "running") return true;
|
|
4542
|
-
const endedAt = proc.startedAt + (proc.resultCapsule?.durationMs ?? 0);
|
|
4543
|
-
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;
|
|
4544
4643
|
const window = failed ? PROC_LINGER_FAILURE_MS : PROC_LINGER_SUCCESS_MS;
|
|
4545
4644
|
return nowMs - endedAt <= window;
|
|
4546
4645
|
}).map((proc) => ({
|
|
@@ -4548,12 +4647,13 @@ function createActivityIndicator(deps) {
|
|
|
4548
4647
|
label: proc.label,
|
|
4549
4648
|
command: proc.command,
|
|
4550
4649
|
startedAt: proc.startedAt,
|
|
4551
|
-
status: proc.status,
|
|
4650
|
+
status: proc.status === "stopped" ? "killed" : proc.status,
|
|
4552
4651
|
exitCode: proc.exitCode,
|
|
4553
|
-
durationMs: proc.resultCapsule?.durationMs
|
|
4652
|
+
durationMs: proc.resultCapsule?.durationMs ?? (proc.endedAt !== void 0 ? proc.endedAt - proc.startedAt : void 0)
|
|
4554
4653
|
}));
|
|
4555
4654
|
}
|
|
4556
4655
|
});
|
|
4656
|
+
const unsubscribeBackground = processRegistry.onBackgroundChange(repaint);
|
|
4557
4657
|
const updateAgentRun = (snapshot) => {
|
|
4558
4658
|
runDock.update(snapshot);
|
|
4559
4659
|
};
|
|
@@ -4607,6 +4707,8 @@ function createActivityIndicator(deps) {
|
|
|
4607
4707
|
isStopping,
|
|
4608
4708
|
stop,
|
|
4609
4709
|
dispose() {
|
|
4710
|
+
disposed = true;
|
|
4711
|
+
unsubscribeBackground();
|
|
4610
4712
|
stop();
|
|
4611
4713
|
runDock.dispose();
|
|
4612
4714
|
}
|
|
@@ -5153,7 +5255,10 @@ function createRunRegistryPoller(deps) {
|
|
|
5153
5255
|
ensureRunning();
|
|
5154
5256
|
},
|
|
5155
5257
|
endHold() {
|
|
5156
|
-
if (holdCount > 0)
|
|
5258
|
+
if (holdCount > 0) {
|
|
5259
|
+
holdCount -= 1;
|
|
5260
|
+
if (holdCount === 0) tickCount = 0;
|
|
5261
|
+
}
|
|
5157
5262
|
},
|
|
5158
5263
|
poll,
|
|
5159
5264
|
requestLogTail,
|
|
@@ -5181,6 +5286,7 @@ function normalizeRunCompletionShape(record) {
|
|
|
5181
5286
|
...typeof record.exitCode === "number" ? { exitCode: record.exitCode } : {},
|
|
5182
5287
|
...typeof record.parentDialogId === "string" ? { parentDialogId: record.parentDialogId } : {},
|
|
5183
5288
|
...typeof record.dialogId === "string" ? { dialogId: record.dialogId } : {},
|
|
5289
|
+
...typeof record.resultFile === "string" ? { resultFile: record.resultFile } : {},
|
|
5184
5290
|
...typeof record.ephemeral === "boolean" ? { ephemeral: record.ephemeral } : {},
|
|
5185
5291
|
...record.startedAt !== void 0 ? { startedAt: record.startedAt } : {},
|
|
5186
5292
|
...record.endedAt !== void 0 ? { endedAt: record.endedAt } : {},
|
|
@@ -5271,6 +5377,11 @@ function buildRunElement(record, nowMs, errorBudgetTokens) {
|
|
|
5271
5377
|
if (verbose && typeof record.exitCode === "number") {
|
|
5272
5378
|
attrs.push(`exitCode="${record.exitCode}"`);
|
|
5273
5379
|
}
|
|
5380
|
+
if (record.resultFile) {
|
|
5381
|
+
attrs.push(`resultFile="${escapeXmlAttribute(record.resultFile)}"`);
|
|
5382
|
+
} else {
|
|
5383
|
+
attrs.push(`result="unavailable"`);
|
|
5384
|
+
}
|
|
5274
5385
|
if (record.ephemeral) {
|
|
5275
5386
|
attrs.push(`ephemeral="true"`);
|
|
5276
5387
|
} else if (record.dialogId) {
|
|
@@ -5303,7 +5414,7 @@ function renderWakeMessage(elements, count) {
|
|
|
5303
5414
|
return [
|
|
5304
5415
|
`<background_run_completion count="${count}">`,
|
|
5305
5416
|
...elements,
|
|
5306
|
-
`\
|
|
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`,
|
|
5307
5418
|
`</background_run_completion>`
|
|
5308
5419
|
].join("\n");
|
|
5309
5420
|
}
|
|
@@ -5334,10 +5445,11 @@ function buildWakeDisplayText(finished, nowMs = Date.now()) {
|
|
|
5334
5445
|
const mark = isFailureStatus(record.status) ? "\u2717" : "\u2713";
|
|
5335
5446
|
const duration = runDuration(record, nowMs);
|
|
5336
5447
|
const label = resolveRunLabel(record);
|
|
5337
|
-
const
|
|
5338
|
-
|
|
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}` : ""}`;
|
|
5339
5451
|
});
|
|
5340
|
-
return `${finished.length} \u6761\u540E\u53F0 run \u5DF2\
|
|
5452
|
+
return `${finished.length} \u6761\u540E\u53F0 run \u5DF2\u7ED3\u675F \xB7 ${parts.join(" \xB7 ")}`;
|
|
5341
5453
|
}
|
|
5342
5454
|
function filterUnclaimedChildRuns(runs, deps = {}) {
|
|
5343
5455
|
const rawNow = deps.now ? deps.now() : Date.now();
|
|
@@ -6466,8 +6578,6 @@ var SLASH_COMMANDS = [
|
|
|
6466
6578
|
"/version",
|
|
6467
6579
|
"/logs",
|
|
6468
6580
|
"/tasks",
|
|
6469
|
-
"/jobs",
|
|
6470
|
-
"/procs",
|
|
6471
6581
|
"/stop",
|
|
6472
6582
|
"/exit",
|
|
6473
6583
|
"/quit",
|
|
@@ -8178,7 +8288,10 @@ function buildCliEstimateSystemText(opts = {}) {
|
|
|
8178
8288
|
guidance.startupProtocol,
|
|
8179
8289
|
guidance.contextLayerContract,
|
|
8180
8290
|
guidance.emailRegistrationWorkflow,
|
|
8181
|
-
|
|
8291
|
+
// 工具段的顺序以 TOOL_GUIDED_SECTION_ORDER 为准(localLoop 按它注入;
|
|
8292
|
+
// buildSystemPrompt 仍是手写层列表,需人工保持同序);用 Object.values
|
|
8293
|
+
// 自行定序会与运行时装配分叉。
|
|
8294
|
+
...TOOL_GUIDED_SECTION_ORDER.map((id) => toolSections[id] ?? ""),
|
|
8182
8295
|
responseGuidelines.behavior,
|
|
8183
8296
|
responseGuidelines.presentation,
|
|
8184
8297
|
readAgentsMd(cwd),
|
|
@@ -8718,7 +8831,7 @@ function formatAttachedSkillLine(skillRef) {
|
|
|
8718
8831
|
const name = themeText(skillRef, "chrome", true);
|
|
8719
8832
|
return `${bullet} ${label} ${name}`;
|
|
8720
8833
|
}
|
|
8721
|
-
function handleTuiInput(input, state, historyTurns) {
|
|
8834
|
+
function handleTuiInput(input, state, historyTurns, deps) {
|
|
8722
8835
|
const trimmed = input.trim();
|
|
8723
8836
|
if (!trimmed) {
|
|
8724
8837
|
return { nextState: state, output: "" };
|
|
@@ -8935,7 +9048,19 @@ ${t("autoUsage")}` };
|
|
|
8935
9048
|
return { nextState: state, output: `${stateLine()}
|
|
8936
9049
|
${t("autoUsage")}` };
|
|
8937
9050
|
}
|
|
8938
|
-
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
|
+
}
|
|
8939
9064
|
case "/jobs":
|
|
8940
9065
|
case "/procs": {
|
|
8941
9066
|
const registry2 = getProcessRegistry();
|
|
@@ -9394,7 +9519,7 @@ function applyAgentSwitchState(state, target, messages) {
|
|
|
9394
9519
|
};
|
|
9395
9520
|
}
|
|
9396
9521
|
var LEARN_COMMAND = "/learn";
|
|
9397
|
-
function handleTuiInput2(input, state, historyTurns) {
|
|
9522
|
+
function handleTuiInput2(input, state, historyTurns, deps) {
|
|
9398
9523
|
const trimmed = input.trim();
|
|
9399
9524
|
if (trimmed === LEARN_COMMAND) {
|
|
9400
9525
|
if (!state.dialogId) {
|
|
@@ -9422,7 +9547,7 @@ function handleTuiInput2(input, state, historyTurns) {
|
|
|
9422
9547
|
}
|
|
9423
9548
|
return { nextState: state, output: "", action: { type: "learn-history", limit: Number(value) } };
|
|
9424
9549
|
}
|
|
9425
|
-
const result = handleTuiInput(input, state, historyTurns);
|
|
9550
|
+
const result = handleTuiInput(input, state, historyTurns, deps);
|
|
9426
9551
|
const switchMatch = trimmed.match(/^\/(?:switch|agent)\s+(.+)$/s);
|
|
9427
9552
|
if (switchMatch && !["list", "current", "show"].includes(switchMatch[1])) {
|
|
9428
9553
|
const target = switchMatch[1];
|
|
@@ -9581,11 +9706,14 @@ function createTurnInjectionInbox() {
|
|
|
9581
9706
|
pending.push(entry);
|
|
9582
9707
|
return true;
|
|
9583
9708
|
},
|
|
9584
|
-
drain() {
|
|
9709
|
+
drain(onEntry) {
|
|
9585
9710
|
if (pending.length === 0) return [];
|
|
9586
9711
|
const taken = pending;
|
|
9587
9712
|
pending = [];
|
|
9588
|
-
return taken.map((entry) =>
|
|
9713
|
+
return taken.map((entry) => {
|
|
9714
|
+
onEntry?.(entry);
|
|
9715
|
+
return entry.text;
|
|
9716
|
+
});
|
|
9589
9717
|
},
|
|
9590
9718
|
close() {
|
|
9591
9719
|
closed = true;
|
|
@@ -9921,15 +10049,7 @@ function normalizeStatus(raw) {
|
|
|
9921
10049
|
// packages/agent-runtime/processTerminalResume.ts
|
|
9922
10050
|
var DEFAULT_MAX_CHAINED_COMPLETION_TURNS = 3;
|
|
9923
10051
|
function createProcessTerminalResumeState() {
|
|
9924
|
-
|
|
9925
|
-
const chainDepthByDialog = /* @__PURE__ */ new Map();
|
|
9926
|
-
return {
|
|
9927
|
-
claimedTaskIds,
|
|
9928
|
-
chainDepthByDialog,
|
|
9929
|
-
noteUserTurn() {
|
|
9930
|
-
chainDepthByDialog.clear();
|
|
9931
|
-
}
|
|
9932
|
-
};
|
|
10052
|
+
return { claimedTaskIds: /* @__PURE__ */ new Set() };
|
|
9933
10053
|
}
|
|
9934
10054
|
var resolveCap = (value) => {
|
|
9935
10055
|
if (typeof value !== "number" || !Number.isFinite(value) || value < 1) {
|
|
@@ -9956,24 +10076,21 @@ function decideProcessTerminalResume(input) {
|
|
|
9956
10076
|
if (currentDialogId !== dialogId) {
|
|
9957
10077
|
return { kind: "notice-only", reason: "dialog-mismatch", taskId };
|
|
9958
10078
|
}
|
|
9959
|
-
if (input.turnActive) {
|
|
9960
|
-
input.state.claimedTaskIds.add(taskId);
|
|
9961
|
-
return { kind: "inject-turn", taskId, owner: input.owner, notice: input.notice };
|
|
9962
|
-
}
|
|
9963
10079
|
const cap = resolveCap(input.maxChainedCompletionTurns);
|
|
9964
|
-
const depth = input.
|
|
10080
|
+
const depth = input.owner.processCausalDepth ?? 0;
|
|
9965
10081
|
if (depth >= cap) {
|
|
9966
10082
|
return { kind: "notice-only", reason: "chain-cap", taskId };
|
|
9967
10083
|
}
|
|
9968
10084
|
input.state.claimedTaskIds.add(taskId);
|
|
9969
|
-
input.
|
|
10085
|
+
if (input.turnActive) {
|
|
10086
|
+
return { kind: "inject-turn", taskId, owner: input.owner, notice: input.notice };
|
|
10087
|
+
}
|
|
9970
10088
|
return { kind: "completion-turn", taskId, owner: input.owner, notice: input.notice };
|
|
9971
10089
|
}
|
|
9972
10090
|
function createProcessTerminalAutoResumer(deps) {
|
|
9973
10091
|
const state = createProcessTerminalResumeState();
|
|
9974
10092
|
return {
|
|
9975
10093
|
state,
|
|
9976
|
-
noteUserTurn: () => state.noteUserTurn(),
|
|
9977
10094
|
decide: (notice) => {
|
|
9978
10095
|
const promoted = notice.promoted ?? deps.isPromoted?.(notice.taskId) ?? false;
|
|
9979
10096
|
const effectiveNotice = notice.promoted === promoted ? notice : { ...notice, promoted };
|
|
@@ -12312,6 +12429,7 @@ async function runAgentChat(scriptDir, state, message, env, output, agentRunner
|
|
|
12312
12429
|
agentKey: effectiveAgentKey,
|
|
12313
12430
|
serverUrl: state.serverUrl,
|
|
12314
12431
|
message: effectiveMessage,
|
|
12432
|
+
getProcessCausalDepth: options.getProcessCausalDepth,
|
|
12315
12433
|
continueDialogId: state.dialogId,
|
|
12316
12434
|
...state.dialogId ? { parentDialogId: state.dialogId } : {},
|
|
12317
12435
|
// 显式注入 TUI 真实会话身份(createInitialTuiState mint、跨轮稳定),
|
|
@@ -12663,6 +12781,31 @@ async function resolveActionGate(gate, deps) {
|
|
|
12663
12781
|
...anchor
|
|
12664
12782
|
})
|
|
12665
12783
|
);
|
|
12784
|
+
if (approved && deps.onApproved) {
|
|
12785
|
+
let decision;
|
|
12786
|
+
try {
|
|
12787
|
+
decision = await deps.onApproved(gate);
|
|
12788
|
+
} catch (error) {
|
|
12789
|
+
const reason = scrubSecrets(
|
|
12790
|
+
`host execution failed: ${String(error?.message ?? error)}`
|
|
12791
|
+
).cleaned;
|
|
12792
|
+
return {
|
|
12793
|
+
content: `action gate failed: ${gate.title} \u2014 ${reason}`,
|
|
12794
|
+
metadata: {
|
|
12795
|
+
exitCode: 1,
|
|
12796
|
+
actionGateResult: { gateId: gate.id, status: "failed", output: reason }
|
|
12797
|
+
}
|
|
12798
|
+
};
|
|
12799
|
+
}
|
|
12800
|
+
if (decision && typeof decision === "object") {
|
|
12801
|
+
if (decision.hostResult) return decision.hostResult;
|
|
12802
|
+
if (decision.approved === false) {
|
|
12803
|
+
return buildGateCancelledResult(gate, "host action declined");
|
|
12804
|
+
}
|
|
12805
|
+
} else if (decision === false) {
|
|
12806
|
+
return buildGateCancelledResult(gate, "host action declined");
|
|
12807
|
+
}
|
|
12808
|
+
}
|
|
12666
12809
|
return approved ? buildGateConfirmedResult(gate) : buildGateCancelledResult(gate, "confirmation declined");
|
|
12667
12810
|
}
|
|
12668
12811
|
return deps.dialogHost.withKeyboard(async () => {
|
|
@@ -12735,7 +12878,6 @@ async function runOneAgentTurn(ctx, inputMsg, imageUrls, actionGateHandler, conf
|
|
|
12735
12878
|
}
|
|
12736
12879
|
}
|
|
12737
12880
|
const message = req.text;
|
|
12738
|
-
if (req.event.kind === "user") ctx.noteUserTurn?.();
|
|
12739
12881
|
ctx.forcedStop = false;
|
|
12740
12882
|
ctx.turnEpoch += 1;
|
|
12741
12883
|
const myEpoch = ctx.turnEpoch;
|
|
@@ -12765,7 +12907,19 @@ async function runOneAgentTurn(ctx, inputMsg, imageUrls, actionGateHandler, conf
|
|
|
12765
12907
|
if (ctx.state.permissionGrants?.local === true) return await confirmDestructiveAction(request);
|
|
12766
12908
|
emitStatusUnlessForceStopped({ state: "blocked", kind: "permission" });
|
|
12767
12909
|
try {
|
|
12768
|
-
|
|
12910
|
+
const approved = await confirmDestructiveAction(request);
|
|
12911
|
+
if (!approved) return false;
|
|
12912
|
+
const commandText = typeof request.command === "string" ? request.command : "";
|
|
12913
|
+
if (commandText) {
|
|
12914
|
+
const { runApprovedCredentialCommand } = await import("./hostCredentialCreate-S233UMAP.js");
|
|
12915
|
+
const hostResult = await runApprovedCredentialCommand({
|
|
12916
|
+
commandText,
|
|
12917
|
+
approvalEventId: request.id,
|
|
12918
|
+
env: process.env ?? {}
|
|
12919
|
+
});
|
|
12920
|
+
if (hostResult) return { approved: true, hostResult };
|
|
12921
|
+
}
|
|
12922
|
+
return true;
|
|
12769
12923
|
} finally {
|
|
12770
12924
|
emitStatusUnlessForceStopped({ state: "working" });
|
|
12771
12925
|
}
|
|
@@ -12850,6 +13004,7 @@ async function runOneAgentTurn(ctx, inputMsg, imageUrls, actionGateHandler, conf
|
|
|
12850
13004
|
ctx.runRegistryPoller.beginHold();
|
|
12851
13005
|
const injectionInbox = createTurnInjectionInbox();
|
|
12852
13006
|
ctx.turnInjectionInbox = injectionInbox;
|
|
13007
|
+
let processCausalDepth = req.event.kind === "background-task-completed" ? req.event.processCausalDepth ?? 0 : 0;
|
|
12853
13008
|
const injectedProcessNoticeLines = ctx.state.pendingProcessNotices ? [...ctx.state.pendingProcessNotices] : [];
|
|
12854
13009
|
const consumeInjectedProcessNotices = () => {
|
|
12855
13010
|
if (injectedProcessNoticeLines.length === 0) {
|
|
@@ -12878,7 +13033,13 @@ async function runOneAgentTurn(ctx, inputMsg, imageUrls, actionGateHandler, conf
|
|
|
12878
13033
|
...confirmDestructiveActionWithStatus ? { confirmDestructiveAction: confirmDestructiveActionWithStatus } : {},
|
|
12879
13034
|
...requestUserChoice ? { requestUserChoice } : {},
|
|
12880
13035
|
abortSignal: ctx.activeTurnAbort.signal,
|
|
12881
|
-
|
|
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
|
+
}),
|
|
12882
13043
|
pastedTextStore: ctx.pasteStore,
|
|
12883
13044
|
activityReporter: ctx.activityReporter,
|
|
12884
13045
|
// 分享 OAuth agent 的 shell 会话授权(块 D):宿主装配的会话级对象;
|
|
@@ -14163,6 +14324,11 @@ async function addDialogToSpaceIfNeeded(fetchImpl, serverUrl, authToken, record)
|
|
|
14163
14324
|
console.warn(`[nolo] compact: addDialogToSpace error: ${error}`);
|
|
14164
14325
|
}
|
|
14165
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
|
+
);
|
|
14166
14332
|
async function resolveContextWindow(fetchImpl, serverUrl, authToken, agentKey) {
|
|
14167
14333
|
if (!agentKey) return DEFAULT_CONTEXT_WINDOW;
|
|
14168
14334
|
try {
|
|
@@ -14221,60 +14387,63 @@ async function compactDialog(options) {
|
|
|
14221
14387
|
reason: "manual"
|
|
14222
14388
|
});
|
|
14223
14389
|
if (plan.shouldCompress && plan.msgsToCompress.length > 0) {
|
|
14224
|
-
options.onProgress?.("summarizing");
|
|
14225
14390
|
const previousSummary = current.summary || "";
|
|
14226
|
-
const
|
|
14227
|
-
|
|
14228
|
-
plan.msgsToCompress,
|
|
14229
|
-
(name) => name
|
|
14230
|
-
// CLI 端无 tool alias 系统,直接用原始名
|
|
14231
|
-
);
|
|
14232
|
-
const promptContent = buildCompactionUserContent({
|
|
14391
|
+
const request = buildBoundedCompactionRequest({
|
|
14392
|
+
msgsToCompress: plan.msgsToCompress,
|
|
14233
14393
|
previousSummary,
|
|
14234
|
-
|
|
14235
|
-
fileOpsText
|
|
14394
|
+
contextWindow: SUMMARY_CONTEXT_WINDOW
|
|
14236
14395
|
});
|
|
14237
|
-
|
|
14238
|
-
|
|
14239
|
-
|
|
14240
|
-
|
|
14241
|
-
|
|
14242
|
-
|
|
14243
|
-
|
|
14244
|
-
|
|
14245
|
-
|
|
14246
|
-
|
|
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
|
+
}
|
|
14247
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));
|
|
14248
14443
|
}
|
|
14249
|
-
|
|
14250
|
-
|
|
14251
|
-
plan.newSummarizedBeforeId
|
|
14252
|
-
);
|
|
14253
|
-
await patchDialog(fetchImpl, options.serverUrl, options.authToken, dialogKey, {
|
|
14254
|
-
summary: newSummary.trim(),
|
|
14255
|
-
summarizedBeforeId: plan.newSummarizedBeforeId,
|
|
14256
|
-
compressionCount: compressionCount + 1,
|
|
14257
|
-
referenceKeys: Array.from(extractedKeys),
|
|
14258
|
-
...sourceMeta ? {
|
|
14259
|
-
sourceHash: sourceMeta.sourceHash,
|
|
14260
|
-
sourceCount: sourceMeta.sourceCount,
|
|
14261
|
-
schemaVersion: sourceMeta.schemaVersion
|
|
14262
|
-
} : {}
|
|
14263
|
-
});
|
|
14264
|
-
current.referenceKeys = Array.from(extractedKeys);
|
|
14265
|
-
summaryGenerated = true;
|
|
14266
|
-
generatedSummary = newSummary.trim();
|
|
14267
|
-
compactedMessageCount = plan.compressCount;
|
|
14268
|
-
const metrics = buildCompactionMetricsFromPlan({
|
|
14269
|
-
reason: "manual",
|
|
14270
|
-
previousSummary: current.summary || "",
|
|
14271
|
-
plan,
|
|
14272
|
-
newSummary: newSummary.trim()
|
|
14273
|
-
});
|
|
14274
|
-
console.log(formatCompactionMetricsLog(metrics));
|
|
14444
|
+
} catch (error) {
|
|
14445
|
+
console.warn(`[nolo] compact: summary generation failed: ${error}`);
|
|
14275
14446
|
}
|
|
14276
|
-
} catch (error) {
|
|
14277
|
-
console.warn(`[nolo] compact: summary generation failed: ${error}`);
|
|
14278
14447
|
}
|
|
14279
14448
|
}
|
|
14280
14449
|
}
|
|
@@ -14939,7 +15108,12 @@ async function runSubmittedSlashLine(line, host2, actionGateHandler, confirmDest
|
|
|
14939
15108
|
spawnRunner,
|
|
14940
15109
|
installAltScreenRestoreHandlers: installAltScreenRestoreHandlers2
|
|
14941
15110
|
} = host2;
|
|
14942
|
-
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 });
|
|
14943
15117
|
const previousState = host2.state;
|
|
14944
15118
|
const previousAgentKey = host2.state.agentKey;
|
|
14945
15119
|
host2.state = result.nextState;
|
|
@@ -16270,7 +16444,6 @@ async function runTuiWorkspace(options) {
|
|
|
16270
16444
|
};
|
|
16271
16445
|
let chatQueueBinding = null;
|
|
16272
16446
|
let turnInjectionInbox = null;
|
|
16273
|
-
let noteUserTurnHook = null;
|
|
16274
16447
|
const childShellApprovals = createShellApprovalSession(async (request, signal) => runWithInputRequiredAttention({ output, env: effectiveEnv }, () => {
|
|
16275
16448
|
if (signal.aborted) return Promise.resolve(false);
|
|
16276
16449
|
return dialogHost.run((anchor) => runConfirmDialog({
|
|
@@ -16388,7 +16561,6 @@ async function runTuiWorkspace(options) {
|
|
|
16388
16561
|
set turnInjectionInbox(v) {
|
|
16389
16562
|
turnInjectionInbox = v;
|
|
16390
16563
|
},
|
|
16391
|
-
noteUserTurn: () => noteUserTurnHook?.(),
|
|
16392
16564
|
onUserTurnFinalized: (turn, imageUrls) => {
|
|
16393
16565
|
const preview = imageCache.preview(`turn-${turnIdentity++}`, imageUrls.map((dataUrl) => ({
|
|
16394
16566
|
dataUrl,
|
|
@@ -16466,6 +16638,19 @@ async function runTuiWorkspace(options) {
|
|
|
16466
16638
|
);
|
|
16467
16639
|
return true;
|
|
16468
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
|
+
};
|
|
16469
16654
|
const slashHost = {
|
|
16470
16655
|
get state() {
|
|
16471
16656
|
return state;
|
|
@@ -16492,6 +16677,8 @@ async function runTuiWorkspace(options) {
|
|
|
16492
16677
|
input,
|
|
16493
16678
|
output,
|
|
16494
16679
|
options,
|
|
16680
|
+
taskEnv: effectiveEnv,
|
|
16681
|
+
confirmTaskStop,
|
|
16495
16682
|
fetchImpl,
|
|
16496
16683
|
turnCtx,
|
|
16497
16684
|
emitCommandOutput,
|
|
@@ -16663,7 +16850,18 @@ async function runTuiWorkspace(options) {
|
|
|
16663
16850
|
pauseComposer: () => fixedInput.pause(),
|
|
16664
16851
|
resumeComposerFromSubprocess: () => fixedInput.resumeFromSubprocess(),
|
|
16665
16852
|
resumeComposerFromDialog: () => fixedInput.resumeFromDialog(),
|
|
16666
|
-
onApprove: createSnapshotGuardedApproval("local", () => state.permissionGrants, approveLocalConfirms)
|
|
16853
|
+
onApprove: createSnapshotGuardedApproval("local", () => state.permissionGrants, approveLocalConfirms),
|
|
16854
|
+
onApproved: async (approvedGate) => {
|
|
16855
|
+
if (approvedGate.kind !== "confirm") return null;
|
|
16856
|
+
const { executeApprovedCredentialCreate } = await import("./hostCredentialCreate-S233UMAP.js");
|
|
16857
|
+
const hostResult = await executeApprovedCredentialCreate({
|
|
16858
|
+
gate: approvedGate,
|
|
16859
|
+
approvalGateId: approvedGate.id,
|
|
16860
|
+
env: effectiveEnv
|
|
16861
|
+
});
|
|
16862
|
+
if (!hostResult) return null;
|
|
16863
|
+
return { approved: true, hostResult };
|
|
16864
|
+
}
|
|
16667
16865
|
})
|
|
16668
16866
|
);
|
|
16669
16867
|
};
|
|
@@ -16689,9 +16887,25 @@ async function runTuiWorkspace(options) {
|
|
|
16689
16887
|
isPromoted: (taskId) => getProcessRegistry().getByTaskId(taskId)?.promoted ?? false,
|
|
16690
16888
|
getCurrentDialogId: () => state.dialogId ?? null,
|
|
16691
16889
|
isTurnActive: () => busy || fixedInput.isPaused(),
|
|
16692
|
-
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
|
+
}
|
|
16693
16908
|
});
|
|
16694
|
-
noteUserTurnHook = () => processTerminalResumer.noteUserTurn();
|
|
16695
16909
|
const runIdleTextTurn = async (inputMsg) => {
|
|
16696
16910
|
const req = createTurnRequest(inputMsg);
|
|
16697
16911
|
const { actionGateHandler, confirmDestructiveAction } = buildInteractiveTurnHandlers();
|
|
@@ -16793,7 +17007,7 @@ ${err.message}` : ""}`
|
|
|
16793
17007
|
pushPendingProcessNotice(notice);
|
|
16794
17008
|
return;
|
|
16795
17009
|
}
|
|
16796
|
-
runWakeHandler?.(buildProcessTaskCompletedTurnEvent(notice));
|
|
17010
|
+
runWakeHandler?.({ ...buildProcessTaskCompletedTurnEvent(notice), processCausalDepth: (decision.owner.processCausalDepth ?? 0) + 1 });
|
|
16797
17011
|
if (fixedInput.active && !fixedInput.isPaused()) {
|
|
16798
17012
|
fixedInput.repaint(buffer, cursorPos);
|
|
16799
17013
|
}
|
|
@@ -16964,8 +17178,14 @@ ${err.message}` : ""}`
|
|
|
16964
17178
|
buffer = "";
|
|
16965
17179
|
cursorPos = 0;
|
|
16966
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
|
+
}
|
|
16967
17187
|
const beforeAgentKey = state.agentKey;
|
|
16968
|
-
const res = handleTuiInput2(submittedText, state, collectConversationTurns(history));
|
|
17188
|
+
const res = handleTuiInput2(submittedText, state, collectConversationTurns(history), { env: effectiveEnv });
|
|
16969
17189
|
if (res.action?.type === "paste-clipboard") {
|
|
16970
17190
|
await readAndApplyClipboard("slash");
|
|
16971
17191
|
return;
|