nolo-cli 0.245.0-alpha.1 → 0.247.0-alpha.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/{_executeModel-OO6SN7M7.js → _executeModel-GIFVXKDT.js} +35 -35
- package/{accountResolver-QETKNC7T.js → accountResolver-NGICIMEE.js} +1 -1
- package/{action-R2EIXR7I.js → action-WZTKEF5H.js} +5 -5
- package/{addContentAction-W6JVLQ6H.js → addContentAction-MLI6GOBV.js} +8 -8
- package/{addDialogAgentAction-LVNKMXKZ.js → addDialogAgentAction-ARGQM22H.js} +7 -7
- package/{agentDeleteCommand-NEKF5OEM.js → agentDeleteCommand-MEJNOUQB.js} +53 -53
- package/{agentEmailCommands-4KEJPLEE.js → agentEmailCommands-RBQXQLVY.js} +53 -53
- package/{agentListCommands-GDHBLDRV.js → agentListCommands-U436UABA.js} +15 -15
- package/{agentMachineCommands-NE34FAX6.js → agentMachineCommands-R6WKJ622.js} +11 -11
- package/{agentPullCommand-QQQZSC6S.js → agentPullCommand-4EQZYHU4.js} +1 -1
- package/{agentRecordCommands-CKPX4I7D.js → agentRecordCommands-5MAINXNS.js} +52 -52
- package/{agentRunCommand-H7ZFCCGQ.js → agentRunCommand-DNBAO4PN.js} +52 -52
- package/{agentRunControl-CSMSJFFB.js → agentRunControl-RN2P6AOD.js} +2 -2
- package/{agentRuntimeLocal-J64NEF4X.js → agentRuntimeLocal-4Y47ZSIP.js} +7 -7
- package/{agentSlice-PRSWXIK3.js → agentSlice-ZGMOH6TE.js} +8 -8
- package/{appDeleteCommands-32M4NTHK.js → appDeleteCommands-KTYELLHJ.js} +12 -12
- package/{appDeployCommands-7DSA4N6M.js → appDeployCommands-HH4ZVRIS.js} +12 -12
- package/{appDeployStatusCommands-IPLQKNYA.js → appDeployStatusCommands-KSIDBUL2.js} +12 -12
- package/{appGetCommands-B26E4N3X.js → appGetCommands-N5E5L24Z.js} +12 -12
- package/{appListCommands-MLZPVLGF.js → appListCommands-7QC63Y6R.js} +12 -12
- package/{authCommand-PVZ45QRO.js → authCommand-3C3RN4OU.js} +7 -7
- package/{authCommands-6AUYO65N.js → authCommands-ZMVEDCQD.js} +3 -3
- package/{builtinSkillRegistry-LRVAQCPW.js → builtinSkillRegistry-VRCMQ77Q.js} +1 -1
- package/{chromeCommands-S7AW3AOD.js → chromeCommands-O4IIKTBD.js} +1 -1
- package/{chromeOpsCommands-TBPM6MR4.js → chromeOpsCommands-NZITLHWO.js} +3 -3
- package/{chunk-CUKLAFB3.js → chunk-2BKNICGK.js} +1 -1
- package/{chunk-6R4RGCPD.js → chunk-3DJJ4CFG.js} +4 -4
- package/{chunk-NUUVI2YB.js → chunk-3UPWX4NA.js} +3 -3
- package/{chunk-JVBLTZDJ.js → chunk-45L3GRIE.js} +171 -55
- package/{chunk-QIVE5WJE.js → chunk-4IQN6FWY.js} +1 -1
- package/{chunk-EH52A3UU.js → chunk-6CXQ3YNJ.js} +10 -10
- package/{chunk-TKE4OJ4B.js → chunk-6MTVACLN.js} +90 -12
- package/{chunk-XGWRH3OF.js → chunk-6TVYUQRM.js} +22 -6
- package/{chunk-QOURTDZL.js → chunk-6XVPMGXK.js} +1 -1
- package/{chunk-MEDPR36J.js → chunk-73PZD7JZ.js} +2 -2
- package/{chunk-NRDGAMC3.js → chunk-7IEJYF7U.js} +4 -4
- package/{chunk-JUW5ECKD.js → chunk-ABG4QNBR.js} +371 -49
- package/{chunk-VEVLLBFK.js → chunk-ADOOL3PG.js} +1 -1
- package/{chunk-XKV53E4E.js → chunk-AEZBAFC6.js} +21 -6
- package/{chunk-AVSZ6PBM.js → chunk-ARFCL53U.js} +3 -3
- package/{chunk-MECW2HJG.js → chunk-BAH3BAUZ.js} +4 -4
- package/{chunk-LELADM5Q.js → chunk-BFKJ2RS3.js} +1 -1
- package/{chunk-56O2J2Y4.js → chunk-BVEDT6DM.js} +2 -2
- package/{chunk-IFWXH7LH.js → chunk-CD64YXRB.js} +1 -1
- package/{chunk-EQZZASCD.js → chunk-CIGCTSBF.js} +1 -1
- package/{chunk-6MZMUZVR.js → chunk-CIUZXD5D.js} +2 -2
- package/{chunk-TB5KTLNB.js → chunk-CTIEJRTP.js} +25 -1
- package/{chunk-DLT2DN4M.js → chunk-D25ONVOH.js} +1 -1
- package/{chunk-OGZE6BZG.js → chunk-E5RYFR7E.js} +29 -16
- package/{chunk-2YGBI2XB.js → chunk-FE7G6DSP.js} +11 -1
- package/{chunk-RXTZB2DH.js → chunk-FFFKAOJN.js} +1 -1
- package/{chunk-ZJ3253MU.js → chunk-FTWAOKFU.js} +29 -29
- package/{chunk-YYRCIDK3.js → chunk-HCCQEMTK.js} +9 -9
- package/{chunk-PDAXMBLW.js → chunk-HZDK56EK.js} +7 -7
- package/{chunk-FZIZTODU.js → chunk-IIOSZAJX.js} +2 -2
- package/{chunk-UJUDZCJ7.js → chunk-IJZC2KIJ.js} +1 -1
- package/{chunk-2DWSICJH.js → chunk-ITBX27W6.js} +1 -1
- package/{chunk-R73TPODO.js → chunk-J2VIGDJN.js} +3 -3
- package/{chunk-WHEVIYHU.js → chunk-JEWMQR6J.js} +1 -1
- package/{chunk-KMDHRVS7.js → chunk-JFRJEPFI.js} +2 -2
- package/{chunk-VVCLWOAG.js → chunk-JU7VN4LF.js} +6 -6
- package/{chunk-7E3ZWTRX.js → chunk-K4CHT35N.js} +102 -61
- package/{chunk-ZYKJBRZ3.js → chunk-K7VIXYTZ.js} +1 -3
- package/{chunk-5QX6DBZP.js → chunk-KLAMJNKQ.js} +2 -2
- package/{chunk-JRRDP7EB.js → chunk-KXOPLLFP.js} +16 -0
- package/{chunk-6HNHHRB4.js → chunk-KZ5OD2MO.js} +2 -2
- package/{chunk-JN5FHTGU.js → chunk-LMGFVH65.js} +10 -10
- package/{chunk-76HAJUOJ.js → chunk-MTM4LRVG.js} +2 -2
- package/{chunk-T53F52YF.js → chunk-N74XL3NI.js} +6 -6
- package/{chunk-SF4GMDZO.js → chunk-OAZP4TSA.js} +1 -1
- package/{chunk-DEEYTDV6.js → chunk-ODBYGVO2.js} +4 -4
- package/{chunk-SESKIWB4.js → chunk-OLGFIQN2.js} +1 -1
- package/{chunk-F26GAEH3.js → chunk-OYUMJMC5.js} +5 -0
- package/{chunk-4TVOZGOS.js → chunk-PBPXXMWZ.js} +1 -1
- package/{chunk-2M6XS5HX.js → chunk-QMNVV3YM.js} +8 -8
- package/{chunk-T23G6PXQ.js → chunk-RHBD22LV.js} +1 -1
- package/{chunk-ZTTKOZQV.js → chunk-RR3MB26M.js} +2 -2
- package/{chunk-WBKUBX3E.js → chunk-S4UP27EG.js} +2 -2
- package/{chunk-KC2QVCI7.js → chunk-SPU3L3OR.js} +5 -4
- package/{chunk-QLUYDJST.js → chunk-TMRJGSK2.js} +1 -1
- package/{chunk-UAIHKQIA.js → chunk-U6RD332P.js} +18 -2
- package/{chunk-KB5RQRSJ.js → chunk-UF6J7NXV.js} +1 -1
- package/{chunk-6PXFEPHL.js → chunk-UOUMPHS5.js} +5 -5
- package/{chunk-CJQBWHNM.js → chunk-V4IYI3SB.js} +2 -2
- package/{chunk-H67WJ6JL.js → chunk-VKCPKCSS.js} +4 -4
- package/{chunk-2BSLGODA.js → chunk-W6T4FNZP.js} +1 -1
- package/{chunk-FMYNIAI6.js → chunk-WQDTSK5U.js} +2 -2
- package/{chunk-JIT5NMXZ.js → chunk-X22AUZKL.js} +9 -9
- package/{chunk-2IPR4PBB.js → chunk-X3OZ655T.js} +2 -2
- package/{chunk-VX5ABJWX.js → chunk-XCA4WHX5.js} +1 -1
- package/{chunk-LC5CVWP2.js → chunk-XJSEST7D.js} +3 -3
- package/{chunk-NJJK3PDA.js → chunk-XSRSAU3O.js} +3 -3
- package/{chunk-3IAIGS6N.js → chunk-Y4NPF2UN.js} +3 -3
- package/{chunk-JV5FHHF7.js → chunk-YDRRGVT5.js} +1 -1
- package/{chunk-VBKHKUB5.js → chunk-YFW4H6DL.js} +20 -20
- package/{chunk-5PASH2MB.js → chunk-YHNUDTU4.js} +4 -3
- package/{chunk-WBSJAIZP.js → chunk-YJPK35HB.js} +5 -0
- package/{chunk-RGANFHQO.js → chunk-Z7KE4K3H.js} +2 -2
- package/{chunk-5VVP7DW3.js → chunk-ZM5AZTQG.js} +2 -2
- package/{cliLocalAgentRecordReader-VSD6XTZS.js → cliLocalAgentRecordReader-LWMGOH3X.js} +9 -9
- package/{commandRegistry-7QPM63UU.js → commandRegistry-ZZUPMMTU.js} +86 -86
- package/{contentThunks-IOAU2PUW.js → contentThunks-SPXTX5U2.js} +14 -14
- package/{cooldownCommands-QL6DWGVU.js → cooldownCommands-TIFCHCUN.js} +1 -1
- package/{createAgentAutomationAction-BBKHUTSM.js → createAgentAutomationAction-KUQKCOXB.js} +14 -14
- package/{createDialogAction-RBSCOSW3.js → createDialogAction-HJN5U3XS.js} +15 -15
- package/{createPageAction-WYC37RBB.js → createPageAction-ZAHRDOAU.js} +15 -15
- package/{db-6NRZLEW2.js → db-CMUTP3W5.js} +2 -2
- package/{dbSlice-5MQ3ELID.js → dbSlice-656PMWR2.js} +7 -7
- package/{deleteFile-VCCHS72Y.js → deleteFile-ZCQESEEQ.js} +5 -5
- package/{dialogCommands-2BN4RK6W.js → dialogCommands-2JL3C5A3.js} +16 -16
- package/{dialogSlice-G77LC4NX.js → dialogSlice-BXIERQHO.js} +12 -12
- package/{dialogUsageCommand-BZPKR3DW.js → dialogUsageCommand-6RW2FY6K.js} +1 -1
- package/{docCreateCommands-L27KPSIL.js → docCreateCommands-CZOVKJM5.js} +11 -11
- package/{docDeleteCommands-ZD5C5I2W.js → docDeleteCommands-WOVJXKOC.js} +12 -12
- package/{docReadCommands-DKLSJSPU.js → docReadCommands-ZHBKTJLT.js} +11 -11
- package/{docStore-QQMKHKAF.js → docStore-FZ75HWP2.js} +8 -8
- package/{docUpdateCommands-D7DDA2DB.js → docUpdateCommands-UYXQNOU7.js} +11 -11
- package/{handleSendMessageAction-JGXBAJZH.js → handleSendMessageAction-KP6GGBFY.js} +26 -26
- package/{hostCredentialCreate-LNYCVHL7.js → hostCredentialCreate-6UGOSRDR.js} +52 -52
- package/index.js +8 -8
- package/{localDialogRead-3T2KMCRC.js → localDialogRead-CIOTQM5T.js} +1 -1
- package/{localRuntimeAdapter-KQRN4NYX.js → localRuntimeAdapter-R25LKDEH.js} +50 -50
- package/{localRuntimeAuthority-7DKIT7UH.js → localRuntimeAuthority-TYHQCTZN.js} +2 -2
- package/{localRuntimeDb-5WZ4RJJO.js → localRuntimeDb-BO7IVWAZ.js} +1 -1
- package/{machineCommands-DCWRWBG2.js → machineCommands-CNIN7M4X.js} +51 -51
- package/{machineWsRunDispatch-AI5BNSLG.js → machineWsRunDispatch-GLJGQSXX.js} +51 -51
- package/{mcpLocalAuthorizeCommand-DA6DT6B6.js → mcpLocalAuthorizeCommand-TI656UWC.js} +4 -4
- package/{memberThunks-KC3WJGL3.js → memberThunks-JFYC4Z5L.js} +9 -9
- package/package.json +1 -1
- package/{projectArchive-YXYBSSLF.js → projectArchive-NU2Z5HOR.js} +15 -15
- package/{read-T7VU2IMO.js → read-BRZHXUJ6.js} +5 -5
- package/{readDocTool-BPQ3QJSD.js → readDocTool-N7RVFQEE.js} +1 -1
- package/{readlineWorkspace-REGKKDAE.js → readlineWorkspace-RZCJAWF7.js} +586 -216
- package/{removeDialogAgentAction-FEUUVMYC.js → removeDialogAgentAction-J7XU7OUX.js} +9 -9
- package/{runAgentClientLoop-22324RL4.js → runAgentClientLoop-O2GRCGRZ.js} +33 -33
- package/{runtimeDoctorCommands-XQD4MN4I.js → runtimeDoctorCommands-RDRJXMXC.js} +2 -2
- package/{secretCommands-LH7QTJO2.js → secretCommands-2FEMRUFM.js} +2 -2
- package/{setDialogExtraReferencesAction-JSTQJPXL.js → setDialogExtraReferencesAction-Q4V2ZZW2.js} +8 -8
- package/{setPrimaryDialogAgentAction-Z2BQE3IY.js → setPrimaryDialogAgentAction-742H5S6T.js} +9 -9
- package/{settingThunks-C2YWCNYI.js → settingThunks-T4FXSV6M.js} +11 -11
- package/{spaceCommands-BRY25UNP.js → spaceCommands-C4UE2TNV.js} +11 -11
- package/{streamAgentChatTurn-AN66RJDM.js → streamAgentChatTurn-OWDJMU5E.js} +36 -36
- package/{switchDialogAgentAction-G7XVAOGH.js → switchDialogAgentAction-HLDLHRRA.js} +7 -7
- package/{tableCommands-UHEA5QNL.js → tableCommands-44GC4N6J.js} +2 -2
- package/{tools-YNGRZIHJ.js → tools-O7SGGVA3.js} +29 -29
- package/{tuiRestart-3J7LRMPR.js → tuiRestart-EOGC2BYY.js} +3 -3
- package/{tuiSummaryLlmCaller-2J6NG53N.js → tuiSummaryLlmCaller-TM5BU73J.js} +2 -2
- package/{updateCommands-5OYND6EF.js → updateCommands-FBYA5WVG.js} +3 -3
- package/{updateDialogTitleAction-N53JXNKY.js → updateDialogTitleAction-EXSZGTLL.js} +14 -14
- package/{usageCommand-SK7JTEPC.js → usageCommand-L4OFWXEU.js} +2 -2
- package/{usageRebuildCommand-DF3HUP6F.js → usageRebuildCommand-7JR33UHS.js} +2 -2
- package/{windowsSelfUpdate-HIYNL3VR.js → windowsSelfUpdate-M4V77OUB.js} +2 -2
|
@@ -8,7 +8,7 @@ import {
|
|
|
8
8
|
} from "./chunk-GAHJLSDO.js";
|
|
9
9
|
import {
|
|
10
10
|
getReadableCliDb
|
|
11
|
-
} from "./chunk-
|
|
11
|
+
} from "./chunk-D25ONVOH.js";
|
|
12
12
|
import {
|
|
13
13
|
INSTABOX_RUN_CONFIG_ENV,
|
|
14
14
|
buildLocalRunEnv,
|
|
@@ -33,7 +33,7 @@ import {
|
|
|
33
33
|
resolveServerUrl,
|
|
34
34
|
validateInstaboxWorkspaceSelection,
|
|
35
35
|
writeUsage
|
|
36
|
-
} from "./chunk-
|
|
36
|
+
} from "./chunk-K4CHT35N.js";
|
|
37
37
|
import {
|
|
38
38
|
boxGlyphs,
|
|
39
39
|
displayWidth,
|
|
@@ -43,7 +43,7 @@ import {
|
|
|
43
43
|
stripAnsi,
|
|
44
44
|
tokenizeAnsiLine,
|
|
45
45
|
visibleWidth
|
|
46
|
-
} from "./chunk-
|
|
46
|
+
} from "./chunk-6TVYUQRM.js";
|
|
47
47
|
import {
|
|
48
48
|
clearCredentialAvailability,
|
|
49
49
|
readEffectiveCredentialEntry
|
|
@@ -86,14 +86,14 @@ import {
|
|
|
86
86
|
} from "./chunk-S73EPYNC.js";
|
|
87
87
|
import {
|
|
88
88
|
resolveCliLocalRuntimeKeyCapability
|
|
89
|
-
} from "./chunk-
|
|
89
|
+
} from "./chunk-FTWAOKFU.js";
|
|
90
90
|
import {
|
|
91
91
|
extractGoogleValidationLink
|
|
92
92
|
} from "./chunk-BMQ2MJUK.js";
|
|
93
93
|
import {
|
|
94
94
|
parseUiCard,
|
|
95
95
|
uiCardFallback
|
|
96
|
-
} from "./chunk-
|
|
96
|
+
} from "./chunk-LMGFVH65.js";
|
|
97
97
|
import {
|
|
98
98
|
isGatewayHttpStatus
|
|
99
99
|
} from "./chunk-NF64D32W.js";
|
|
@@ -104,7 +104,7 @@ import {
|
|
|
104
104
|
loadOwnerItemsFromDb,
|
|
105
105
|
parseUiAskChoiceContent,
|
|
106
106
|
resolveAgentMemoryPolicy
|
|
107
|
-
} from "./chunk-
|
|
107
|
+
} from "./chunk-ODBYGVO2.js";
|
|
108
108
|
import {
|
|
109
109
|
API_REPORTED_COST_MULTIPLIER,
|
|
110
110
|
estimateMessagesTokens,
|
|
@@ -113,14 +113,14 @@ import {
|
|
|
113
113
|
resolveAgentContextWindow,
|
|
114
114
|
resolveOccupancy,
|
|
115
115
|
resolveOccupancyWindow
|
|
116
|
-
} from "./chunk-
|
|
116
|
+
} from "./chunk-YFW4H6DL.js";
|
|
117
117
|
import {
|
|
118
118
|
parsePositiveFiniteNumberOrFallback
|
|
119
119
|
} from "./chunk-Y5GCAMGP.js";
|
|
120
120
|
import {
|
|
121
121
|
readDbRecord,
|
|
122
122
|
resolveAgentRecordFromHybridStore
|
|
123
|
-
} from "./chunk-
|
|
123
|
+
} from "./chunk-CIUZXD5D.js";
|
|
124
124
|
import {
|
|
125
125
|
isTransientFetchError
|
|
126
126
|
} from "./chunk-DXWGFL2Z.js";
|
|
@@ -144,7 +144,7 @@ import {
|
|
|
144
144
|
settleRunTerminalAuthoritatively,
|
|
145
145
|
spawnLocalBackgroundRun,
|
|
146
146
|
transitionRunToTerminal
|
|
147
|
-
} from "./chunk-
|
|
147
|
+
} from "./chunk-AEZBAFC6.js";
|
|
148
148
|
import {
|
|
149
149
|
formatAgentListCard,
|
|
150
150
|
formatFinishedRunCard,
|
|
@@ -166,7 +166,7 @@ import {
|
|
|
166
166
|
} from "./chunk-KK3FCYZM.js";
|
|
167
167
|
import {
|
|
168
168
|
getDefaultCliLocalRuntimeDb
|
|
169
|
-
} from "./chunk-
|
|
169
|
+
} from "./chunk-BFKJ2RS3.js";
|
|
170
170
|
import {
|
|
171
171
|
LOCAL_AGENT_CONFIG_MISSING_CODE,
|
|
172
172
|
LOCAL_TURN_ABORTED_CODE,
|
|
@@ -174,7 +174,7 @@ import {
|
|
|
174
174
|
markCliUserBatchPhase,
|
|
175
175
|
readActionGate,
|
|
176
176
|
readAgentsMdLayerFromDisk
|
|
177
|
-
} from "./chunk-
|
|
177
|
+
} from "./chunk-45L3GRIE.js";
|
|
178
178
|
import {
|
|
179
179
|
resolveAgentRuntimeConfigFromRecord
|
|
180
180
|
} from "./chunk-4OXPN3WC.js";
|
|
@@ -217,6 +217,9 @@ import {
|
|
|
217
217
|
normalizeRuntimeToolPolicyOverride,
|
|
218
218
|
resolveEffectiveRuntimeToolPolicy
|
|
219
219
|
} from "./chunk-USGHJSGO.js";
|
|
220
|
+
import {
|
|
221
|
+
workspaceChildEnv
|
|
222
|
+
} from "./chunk-CTIEJRTP.js";
|
|
220
223
|
import {
|
|
221
224
|
QUOTA_ERROR_PATTERNS,
|
|
222
225
|
isQuotaExhaustedError
|
|
@@ -281,7 +284,7 @@ import {
|
|
|
281
284
|
toolIcon,
|
|
282
285
|
toolLabel,
|
|
283
286
|
toolLabelVariants
|
|
284
|
-
} from "./chunk-
|
|
287
|
+
} from "./chunk-E5RYFR7E.js";
|
|
285
288
|
import {
|
|
286
289
|
isAntigravityOAuthAgent
|
|
287
290
|
} from "./chunk-CTWCZKNS.js";
|
|
@@ -8727,12 +8730,15 @@ function plainToolLine(line) {
|
|
|
8727
8730
|
return stripAnsi(line);
|
|
8728
8731
|
}
|
|
8729
8732
|
var TOOL_TREE_GROUP_LABELS = new Set(
|
|
8730
|
-
["execShell", "readFile", "fetchWebpage", "exa_search"].flatMap((name) =>
|
|
8731
|
-
|
|
8732
|
-
|
|
8733
|
-
|
|
8734
|
-
|
|
8735
|
-
|
|
8733
|
+
["execShell", "readFile", "fetchWebpage", "exa_search"].flatMap((name) => {
|
|
8734
|
+
const fam = toolFamilyOf(name);
|
|
8735
|
+
return [
|
|
8736
|
+
fam.icon,
|
|
8737
|
+
fam.en,
|
|
8738
|
+
fam.zh,
|
|
8739
|
+
...toolLabelVariants(name)
|
|
8740
|
+
];
|
|
8741
|
+
})
|
|
8736
8742
|
);
|
|
8737
8743
|
function isKnownToolGroupLabel(label) {
|
|
8738
8744
|
return TOOL_TREE_GROUP_LABELS.has(label);
|
|
@@ -9507,6 +9513,11 @@ function shellWords(text, validationOnly = false) {
|
|
|
9507
9513
|
started = true;
|
|
9508
9514
|
continue;
|
|
9509
9515
|
}
|
|
9516
|
+
if (ch === "?" && /^https?:\/\//i.test(word)) {
|
|
9517
|
+
word += ch;
|
|
9518
|
+
started = true;
|
|
9519
|
+
continue;
|
|
9520
|
+
}
|
|
9510
9521
|
if (/[<> &|;(){}*?\[\]#~]/.test(ch) && !/\s/.test(ch)) return null;
|
|
9511
9522
|
if (/\s/.test(ch)) {
|
|
9512
9523
|
if (started) words2.push(word);
|
|
@@ -9754,6 +9765,9 @@ function firstVerbToken(segment) {
|
|
|
9754
9765
|
const [, word, restAfter] = m;
|
|
9755
9766
|
const base = word.replace(/^.*\//, "");
|
|
9756
9767
|
if (wrappers.has(base) && restAfter.trim()) {
|
|
9768
|
+
if (base === "command" && /^-(?:v|V)(?:\s|$)/.test(restAfter.trim())) {
|
|
9769
|
+
return { verb: base, rest: restAfter.trim() };
|
|
9770
|
+
}
|
|
9757
9771
|
rest = restAfter.trim();
|
|
9758
9772
|
continue;
|
|
9759
9773
|
}
|
|
@@ -9957,6 +9971,179 @@ function parseNolo(rest) {
|
|
|
9957
9971
|
if (sub === "ci") return { verb: "\u67E5 CI \u72B6\u6001", readOnly: true };
|
|
9958
9972
|
return null;
|
|
9959
9973
|
}
|
|
9974
|
+
function stripTrailingPipe(rest) {
|
|
9975
|
+
let quote = null;
|
|
9976
|
+
for (let i = 0; i < rest.length; i++) {
|
|
9977
|
+
const ch = rest[i];
|
|
9978
|
+
const next = rest[i + 1];
|
|
9979
|
+
if (quote) {
|
|
9980
|
+
if (ch === "\\" && next && quote === '"') {
|
|
9981
|
+
i++;
|
|
9982
|
+
continue;
|
|
9983
|
+
}
|
|
9984
|
+
if (ch === quote) quote = null;
|
|
9985
|
+
continue;
|
|
9986
|
+
}
|
|
9987
|
+
if (ch === '"' || ch === "'") {
|
|
9988
|
+
quote = ch;
|
|
9989
|
+
continue;
|
|
9990
|
+
}
|
|
9991
|
+
if (ch === "\\" && next) {
|
|
9992
|
+
i++;
|
|
9993
|
+
continue;
|
|
9994
|
+
}
|
|
9995
|
+
if (ch === "|" && next !== "|" && rest[i - 1] !== "|") {
|
|
9996
|
+
return rest.slice(0, i).trim();
|
|
9997
|
+
}
|
|
9998
|
+
}
|
|
9999
|
+
return rest.trim();
|
|
10000
|
+
}
|
|
10001
|
+
var CURL_VALUE_FLAGS = /* @__PURE__ */ new Set([
|
|
10002
|
+
"-o",
|
|
10003
|
+
"--output",
|
|
10004
|
+
"-H",
|
|
10005
|
+
"--header",
|
|
10006
|
+
"-d",
|
|
10007
|
+
"--data",
|
|
10008
|
+
"--data-raw",
|
|
10009
|
+
"--data-binary",
|
|
10010
|
+
"--data-urlencode",
|
|
10011
|
+
"--data-ascii",
|
|
10012
|
+
"-F",
|
|
10013
|
+
"--form",
|
|
10014
|
+
"--form-string",
|
|
10015
|
+
"-u",
|
|
10016
|
+
"--user",
|
|
10017
|
+
"-A",
|
|
10018
|
+
"--user-agent",
|
|
10019
|
+
"-e",
|
|
10020
|
+
"--referer",
|
|
10021
|
+
"-b",
|
|
10022
|
+
"--cookie",
|
|
10023
|
+
"-c",
|
|
10024
|
+
"--cookie-jar",
|
|
10025
|
+
"-x",
|
|
10026
|
+
"--proxy",
|
|
10027
|
+
"-U",
|
|
10028
|
+
"--proxy-user",
|
|
10029
|
+
"-X",
|
|
10030
|
+
"--request",
|
|
10031
|
+
"-m",
|
|
10032
|
+
"--max-time",
|
|
10033
|
+
"--connect-timeout",
|
|
10034
|
+
"--retry",
|
|
10035
|
+
"--retry-delay",
|
|
10036
|
+
"--retry-max-time",
|
|
10037
|
+
"-w",
|
|
10038
|
+
"--write-out",
|
|
10039
|
+
"-T",
|
|
10040
|
+
"--upload-file",
|
|
10041
|
+
"-K",
|
|
10042
|
+
"--config",
|
|
10043
|
+
"--resolve",
|
|
10044
|
+
"--cacert",
|
|
10045
|
+
"--capath",
|
|
10046
|
+
"--cert",
|
|
10047
|
+
"--key",
|
|
10048
|
+
"-E",
|
|
10049
|
+
"--interface",
|
|
10050
|
+
"--limit-rate",
|
|
10051
|
+
"-r",
|
|
10052
|
+
"--range",
|
|
10053
|
+
"-Y",
|
|
10054
|
+
"-y",
|
|
10055
|
+
"--oauth2-bearer",
|
|
10056
|
+
"--aws-sigv4",
|
|
10057
|
+
"--connect-to",
|
|
10058
|
+
"--dns-servers"
|
|
10059
|
+
]);
|
|
10060
|
+
var WGET_VALUE_FLAGS = /* @__PURE__ */ new Set([
|
|
10061
|
+
"-O",
|
|
10062
|
+
"--output-document",
|
|
10063
|
+
"-P",
|
|
10064
|
+
"--directory-prefix",
|
|
10065
|
+
"--header",
|
|
10066
|
+
"--user",
|
|
10067
|
+
"--password",
|
|
10068
|
+
"--http-user",
|
|
10069
|
+
"--http-password",
|
|
10070
|
+
"-U",
|
|
10071
|
+
"--user-agent",
|
|
10072
|
+
"-T",
|
|
10073
|
+
"--timeout",
|
|
10074
|
+
"-t",
|
|
10075
|
+
"--tries",
|
|
10076
|
+
"-a",
|
|
10077
|
+
"--append-output",
|
|
10078
|
+
"-o",
|
|
10079
|
+
"--output-file",
|
|
10080
|
+
"--post-data",
|
|
10081
|
+
"--post-file",
|
|
10082
|
+
"--load-cookies",
|
|
10083
|
+
"--save-cookies",
|
|
10084
|
+
"-e",
|
|
10085
|
+
"--execute",
|
|
10086
|
+
"--referer",
|
|
10087
|
+
"--wait",
|
|
10088
|
+
"--limit-rate",
|
|
10089
|
+
"--ca-certificate",
|
|
10090
|
+
"--certificate"
|
|
10091
|
+
]);
|
|
10092
|
+
function extractSafeUrlTarget(rawUrl) {
|
|
10093
|
+
const trimmed = rawUrl.trim();
|
|
10094
|
+
if (!/^(?:https?|ftp):\/\//i.test(trimmed)) return null;
|
|
10095
|
+
let parsed;
|
|
10096
|
+
try {
|
|
10097
|
+
parsed = new URL(trimmed);
|
|
10098
|
+
} catch {
|
|
10099
|
+
return null;
|
|
10100
|
+
}
|
|
10101
|
+
if (!["http:", "https:", "ftp:"].includes(parsed.protocol)) return null;
|
|
10102
|
+
const hostname = parsed.hostname;
|
|
10103
|
+
if (!hostname) return null;
|
|
10104
|
+
const pathname = parsed.pathname || "/";
|
|
10105
|
+
if (!pathname.endsWith("/")) {
|
|
10106
|
+
const rawLast = pathname.split("/").filter(Boolean).pop();
|
|
10107
|
+
if (rawLast) {
|
|
10108
|
+
let decoded = rawLast;
|
|
10109
|
+
try {
|
|
10110
|
+
decoded = decodeURIComponent(rawLast);
|
|
10111
|
+
} catch {
|
|
10112
|
+
}
|
|
10113
|
+
const looksLikeSecret = decoded.includes("=") || /^(?:sk-|ghp_|gho_|ghu_|ghs_|github_pat_|AKIA|AIza|xox[baprs]-|eyJ)/i.test(decoded);
|
|
10114
|
+
if (!looksLikeSecret && !/[\s?#\\]/.test(decoded) && decoded.length <= 64 && /^[^/]+\.[A-Za-z0-9]{1,8}$/.test(decoded)) {
|
|
10115
|
+
return { kind: "file", target: clipShortText(decoded, 32) };
|
|
10116
|
+
}
|
|
10117
|
+
}
|
|
10118
|
+
}
|
|
10119
|
+
return { kind: "host", target: clipShortText(hostname, 32) };
|
|
10120
|
+
}
|
|
10121
|
+
function parseCurlOrWget(verb, rest) {
|
|
10122
|
+
const head = stripTrailingPipe(rest);
|
|
10123
|
+
const tokens2 = shellWords(head);
|
|
10124
|
+
if (!tokens2) return null;
|
|
10125
|
+
const valueFlags = verb === "curl" ? CURL_VALUE_FLAGS : WGET_VALUE_FLAGS;
|
|
10126
|
+
const positionals = [];
|
|
10127
|
+
for (let i = 0; i < tokens2.length; i++) {
|
|
10128
|
+
const tok = tokens2[i];
|
|
10129
|
+
if (tok === "--") {
|
|
10130
|
+
positionals.push(...tokens2.slice(i + 1));
|
|
10131
|
+
break;
|
|
10132
|
+
}
|
|
10133
|
+
if (tok.startsWith("-")) {
|
|
10134
|
+
if (!tok.includes("=") && valueFlags.has(tok)) i++;
|
|
10135
|
+
continue;
|
|
10136
|
+
}
|
|
10137
|
+
positionals.push(tok);
|
|
10138
|
+
}
|
|
10139
|
+
for (const pos of positionals) {
|
|
10140
|
+
const extracted = extractSafeUrlTarget(pos);
|
|
10141
|
+
if (extracted) {
|
|
10142
|
+
return extracted.kind === "file" ? { verb: "\u4E0B\u8F7D", target: extracted.target, readOnly: false } : { verb: "\u8BF7\u6C42", target: extracted.target, readOnly: false };
|
|
10143
|
+
}
|
|
10144
|
+
}
|
|
10145
|
+
return { verb: "\u4E0B\u8F7D", readOnly: false };
|
|
10146
|
+
}
|
|
9960
10147
|
function classifySegment(segment) {
|
|
9961
10148
|
const { verb, rest } = firstVerbToken(segment);
|
|
9962
10149
|
if (!verb) return null;
|
|
@@ -10065,7 +10252,7 @@ function classifySegment(segment) {
|
|
|
10065
10252
|
}
|
|
10066
10253
|
case "curl":
|
|
10067
10254
|
case "wget":
|
|
10068
|
-
return
|
|
10255
|
+
return parseCurlOrWget(verb, rest);
|
|
10069
10256
|
case "bun":
|
|
10070
10257
|
case "npm":
|
|
10071
10258
|
case "pnpm":
|
|
@@ -10123,22 +10310,104 @@ function classifySegment(segment) {
|
|
|
10123
10310
|
case "wc":
|
|
10124
10311
|
case "sort":
|
|
10125
10312
|
case "uniq": {
|
|
10126
|
-
const tokens2 = shellWords(rest
|
|
10127
|
-
|
|
10128
|
-
if (tokens2) {
|
|
10129
|
-
|
|
10130
|
-
|
|
10131
|
-
|
|
10132
|
-
|
|
10133
|
-
|
|
10134
|
-
|
|
10135
|
-
|
|
10136
|
-
|
|
10313
|
+
const tokens2 = shellWords(stripTrailingPipe(rest));
|
|
10314
|
+
if (!tokens2) return null;
|
|
10315
|
+
if (verb === "sort" && tokens2.some((t2) => t2 === "-o" || t2.startsWith("-") && !t2.startsWith("--") && t2.includes("o") || t2 === "--output" || t2.startsWith("--output="))) {
|
|
10316
|
+
return null;
|
|
10317
|
+
}
|
|
10318
|
+
const valueFlagsByCmd = {
|
|
10319
|
+
head: /* @__PURE__ */ new Set(["-n", "-c", "--lines", "--bytes"]),
|
|
10320
|
+
tail: /* @__PURE__ */ new Set(["-n", "-c", "-s", "--lines", "--bytes", "--sleep-interval", "--pid"]),
|
|
10321
|
+
wc: /* @__PURE__ */ new Set(["--files0-from"]),
|
|
10322
|
+
sort: /* @__PURE__ */ new Set(["-t", "-k", "-T", "-S", "--field-separator", "--key", "--temporary-directory", "--buffer-size", "--files0-from"]),
|
|
10323
|
+
uniq: /* @__PURE__ */ new Set(["-f", "-s", "-w", "--skip-fields", "--skip-chars", "--check-chars"])
|
|
10324
|
+
};
|
|
10325
|
+
const valueFlags = valueFlagsByCmd[verb];
|
|
10326
|
+
const positionals = [];
|
|
10327
|
+
for (let i = 0; i < tokens2.length; i++) {
|
|
10328
|
+
const tok = tokens2[i];
|
|
10329
|
+
if (tok === "--") {
|
|
10330
|
+
positionals.push(...tokens2.slice(i + 1));
|
|
10137
10331
|
break;
|
|
10138
10332
|
}
|
|
10333
|
+
if (tok.startsWith("-")) {
|
|
10334
|
+
if (!tok.includes("=") && valueFlags.has(tok)) i++;
|
|
10335
|
+
continue;
|
|
10336
|
+
}
|
|
10337
|
+
positionals.push(tok);
|
|
10139
10338
|
}
|
|
10339
|
+
if (verb === "uniq" && positionals.length >= 2) return null;
|
|
10340
|
+
const file = positionals[0];
|
|
10140
10341
|
return file ? { verb: "\u67E5\u770B", target: baseName(file), readOnly: true } : { verb: "\u67E5\u770B\u8F93\u51FA", readOnly: true };
|
|
10141
10342
|
}
|
|
10343
|
+
case "which": {
|
|
10344
|
+
const tokens2 = shellWords(stripTrailingPipe(rest));
|
|
10345
|
+
if (!tokens2) return null;
|
|
10346
|
+
const target = tokens2.find((t2) => !t2.startsWith("-"));
|
|
10347
|
+
return target ? { verb: "\u67E5\u547D\u4EE4", target: clipShortText(target, 24), readOnly: true } : { verb: "\u67E5\u547D\u4EE4", readOnly: true };
|
|
10348
|
+
}
|
|
10349
|
+
case "command": {
|
|
10350
|
+
const tokens2 = shellWords(stripTrailingPipe(rest));
|
|
10351
|
+
if (!tokens2 || tokens2.length < 2) return null;
|
|
10352
|
+
if (tokens2[0] !== "-v" && tokens2[0] !== "-V") return null;
|
|
10353
|
+
const target = tokens2.slice(1).find((t2) => !t2.startsWith("-"));
|
|
10354
|
+
return target ? { verb: "\u67E5\u547D\u4EE4", target: clipShortText(target, 24), readOnly: true } : null;
|
|
10355
|
+
}
|
|
10356
|
+
case "file": {
|
|
10357
|
+
const tokens2 = shellWords(stripTrailingPipe(rest));
|
|
10358
|
+
if (!tokens2) return null;
|
|
10359
|
+
for (const tok of tokens2) {
|
|
10360
|
+
if (tok === "--") break;
|
|
10361
|
+
if (tok === "--compile" || tok.startsWith("-") && !tok.startsWith("--") && tok.includes("C")) {
|
|
10362
|
+
return null;
|
|
10363
|
+
}
|
|
10364
|
+
}
|
|
10365
|
+
let file;
|
|
10366
|
+
for (let i = 0; i < tokens2.length; i++) {
|
|
10367
|
+
const tok = tokens2[i];
|
|
10368
|
+
if (tok === "--") {
|
|
10369
|
+
file = tokens2[i + 1];
|
|
10370
|
+
break;
|
|
10371
|
+
}
|
|
10372
|
+
if (["-m", "-f", "-F", "-e", "--exclude", "--magic-file"].includes(tok)) {
|
|
10373
|
+
i++;
|
|
10374
|
+
continue;
|
|
10375
|
+
}
|
|
10376
|
+
if (tok.startsWith("-")) continue;
|
|
10377
|
+
file = tok;
|
|
10378
|
+
break;
|
|
10379
|
+
}
|
|
10380
|
+
return { verb: "\u67E5\u7C7B\u578B", target: file ? baseName(file) : void 0, readOnly: true };
|
|
10381
|
+
}
|
|
10382
|
+
case "stat": {
|
|
10383
|
+
const tokens2 = shellWords(stripTrailingPipe(rest));
|
|
10384
|
+
if (!tokens2) return null;
|
|
10385
|
+
let file;
|
|
10386
|
+
for (let i = 0; i < tokens2.length; i++) {
|
|
10387
|
+
const tok = tokens2[i];
|
|
10388
|
+
if (["-c", "--format", "--printf"].includes(tok)) {
|
|
10389
|
+
i++;
|
|
10390
|
+
continue;
|
|
10391
|
+
}
|
|
10392
|
+
if (tok.startsWith("-")) continue;
|
|
10393
|
+
file = tok;
|
|
10394
|
+
break;
|
|
10395
|
+
}
|
|
10396
|
+
return { verb: "\u67E5\u6587\u4EF6\u4FE1\u606F", target: file ? baseName(file) : void 0, readOnly: true };
|
|
10397
|
+
}
|
|
10398
|
+
case "readlink":
|
|
10399
|
+
case "realpath": {
|
|
10400
|
+
const tokens2 = shellWords(stripTrailingPipe(rest));
|
|
10401
|
+
if (!tokens2) return null;
|
|
10402
|
+
const file = tokens2.find((t2) => !t2.startsWith("-"));
|
|
10403
|
+
return { verb: "\u89E3\u6790\u8DEF\u5F84", target: file ? baseName(file) : void 0, readOnly: true };
|
|
10404
|
+
}
|
|
10405
|
+
case "pwd":
|
|
10406
|
+
return { verb: "\u67E5\u5F53\u524D\u76EE\u5F55", readOnly: true };
|
|
10407
|
+
case "uname":
|
|
10408
|
+
return { verb: "\u67E5\u7CFB\u7EDF\u4FE1\u606F", readOnly: true };
|
|
10409
|
+
case "whoami":
|
|
10410
|
+
return { verb: "\u67E5\u8EAB\u4EFD", readOnly: true };
|
|
10142
10411
|
default:
|
|
10143
10412
|
return null;
|
|
10144
10413
|
}
|
|
@@ -10332,6 +10601,7 @@ var families = {
|
|
|
10332
10601
|
readFile: ["read", "\u8BFB\u53D6", ["path"], true],
|
|
10333
10602
|
read_file: ["read", "\u8BFB\u53D6", ["path"], true],
|
|
10334
10603
|
readWorkspaceFile: ["read", "\u8BFB\u53D6", ["path"], true],
|
|
10604
|
+
read_image: ["read", "\u770B\u56FE", ["path"], true],
|
|
10335
10605
|
writeFile: ["write", "\u5199\u5165", ["path"], false],
|
|
10336
10606
|
editFile: ["edit", "\u4FEE\u6539", ["path"], false],
|
|
10337
10607
|
globFiles: ["find", "\u67E5\u627E\u6587\u4EF6", ["pattern", "path"], true],
|
|
@@ -10395,10 +10665,14 @@ function safeAskText(value, max) {
|
|
|
10395
10665
|
const guarded = withholdIfSecretLike(cleaned) || ASK_SECRET_PLACEHOLDER;
|
|
10396
10666
|
return max === void 0 ? guarded : clipCompactText(guarded, max, "\u2026");
|
|
10397
10667
|
}
|
|
10668
|
+
var BIDI_CONTROL_REGEX = new RegExp("\\p{Bidi_Control}", "gu");
|
|
10669
|
+
function safeApprovalSingleLineText(value, max) {
|
|
10670
|
+
return safeAskText(value, max).replace(BIDI_CONTROL_REGEX, "");
|
|
10671
|
+
}
|
|
10398
10672
|
function safeApprovalMultilineText(value) {
|
|
10399
10673
|
const lines = stripAnsi(String(value ?? "")).replace(/\r\n?|\u2028|\u2029/g, "\n").split("\n");
|
|
10400
10674
|
return lines.map((line) => {
|
|
10401
|
-
const cleaned = line.replace(/\t/g, " ").replace(C0_C1_CONTROL_REGEX, "");
|
|
10675
|
+
const cleaned = line.replace(/\t/g, " ").replace(C0_C1_CONTROL_REGEX, "").replace(BIDI_CONTROL_REGEX, "");
|
|
10402
10676
|
const redacted = redactSecrets(cleaned);
|
|
10403
10677
|
return redacted ? withholdIfSecretLike(redacted) || ASK_SECRET_PLACEHOLDER : "";
|
|
10404
10678
|
}).join("\n");
|
|
@@ -10717,10 +10991,11 @@ function formatReadItemPath(rawPath, metadata, customHomedir) {
|
|
|
10717
10991
|
}
|
|
10718
10992
|
function formatSearchItemQuery(query, path2, customHomedir) {
|
|
10719
10993
|
let text = (query || "").trim();
|
|
10720
|
-
|
|
10721
|
-
|
|
10994
|
+
const trimmedPath = (path2 || "").trim();
|
|
10995
|
+
if (trimmedPath && trimmedPath !== "." && trimmedPath !== "./") {
|
|
10996
|
+
const formattedPath = formatHomePath(trimmedPath, customHomedir);
|
|
10722
10997
|
if (formattedPath) {
|
|
10723
|
-
text = text ? `${text}
|
|
10998
|
+
text = text ? `${text} \xB7 ${formattedPath}` : formattedPath;
|
|
10724
10999
|
}
|
|
10725
11000
|
}
|
|
10726
11001
|
if (!text) return "search";
|
|
@@ -11355,9 +11630,27 @@ function memoryToolGist(toolName, metadata) {
|
|
|
11355
11630
|
}
|
|
11356
11631
|
return "";
|
|
11357
11632
|
}
|
|
11633
|
+
function formatReadImageSummary(metadata) {
|
|
11634
|
+
const rawPaths = Array.isArray(metadata.paths) ? metadata.paths.filter((p) => typeof p === "string" && p.trim().length > 0) : [];
|
|
11635
|
+
const singlePath = typeof metadata.path === "string" && metadata.path.trim() || (rawPaths.length === 1 ? rawPaths[0].trim() : "");
|
|
11636
|
+
if (singlePath && rawPaths.length <= 1) {
|
|
11637
|
+
return gistClip(redactSecrets(formatReadItemPath(singlePath, metadata)), 52);
|
|
11638
|
+
}
|
|
11639
|
+
if (rawPaths.length > 1) {
|
|
11640
|
+
const firstRaw = rawPaths[0];
|
|
11641
|
+
const first = pathBasenameGist(redactSecrets(firstRaw)) || gistClip(redactSecrets(formatHomePath(firstRaw)), 28) || "image";
|
|
11642
|
+
const text = getCliLocale() === "zh" ? `${first} \u7B49 ${rawPaths.length} \u5F20\u56FE` : `${first} +${rawPaths.length - 1} more`;
|
|
11643
|
+
return gistClip(redactSecrets(text), 52);
|
|
11644
|
+
}
|
|
11645
|
+
return "";
|
|
11646
|
+
}
|
|
11358
11647
|
function normalToolGistRaw(event) {
|
|
11359
11648
|
const metadata = event.metadata ?? {};
|
|
11360
11649
|
const toolName = event.toolName || "";
|
|
11650
|
+
if (toolName === "read_image") {
|
|
11651
|
+
const summary = formatReadImageSummary(metadata);
|
|
11652
|
+
if (summary) return summary;
|
|
11653
|
+
}
|
|
11361
11654
|
if (toolName === "readFile" || toolName === "writeFile" || toolName === "editFile") {
|
|
11362
11655
|
const path3 = typeof metadata.path === "string" ? metadata.path : typeof metadata.filePath === "string" ? metadata.filePath : "";
|
|
11363
11656
|
if (path3) return gistClip(formatReadItemPath(path3, metadata), 52);
|
|
@@ -11449,11 +11742,12 @@ function formatNormalToolLine(event, pending, colorEnabled, opts, omitSuccessGly
|
|
|
11449
11742
|
const title = gist2 ? `${label} \xB7 ${gist2}` : label;
|
|
11450
11743
|
return formatToolTraceLine(fitNormalLine(`\u25B8 ${title}`, `\u2717 ${reason}`, totalBudget), colorEnabled, "error");
|
|
11451
11744
|
}
|
|
11452
|
-
const successLabel = omitSuccessGlyph?.(toolName) ? " ".repeat(displayWidth(label)) : label;
|
|
11453
11745
|
const resultSummary = normalResultSummary(event);
|
|
11454
11746
|
const gist = [normalToolGist(event), resultSummary].filter(Boolean).join(" \xB7 ");
|
|
11455
11747
|
const hint = editFileResultHint(event);
|
|
11456
11748
|
const statsInline = hint?.inline ? ` ${hint.inline}` : "";
|
|
11749
|
+
const canOmitLabel = Boolean(gist || statsInline);
|
|
11750
|
+
const successLabel = canOmitLabel && omitSuccessGlyph?.(toolName) ? " ".repeat(displayWidth(label)) : label;
|
|
11457
11751
|
const durationInline = formatNormalToolDuration(event.elapsedMs);
|
|
11458
11752
|
const tail = durationInline ? ` \u2713 ${durationInline}` : " \u2713";
|
|
11459
11753
|
let fittedGist = gist;
|
|
@@ -11555,7 +11849,7 @@ var TUI_TREE_MARKER = "TUI_TREE\n";
|
|
|
11555
11849
|
var TUI_TREE_END = "";
|
|
11556
11850
|
var TUI_TREE_TOOLS = {
|
|
11557
11851
|
Run: ["execShell", "runCommand", "launchProcess"],
|
|
11558
|
-
Read: ["readFile"],
|
|
11852
|
+
Read: ["readFile", "read_image"],
|
|
11559
11853
|
Search: ["exa_search", "globFiles", "searchFiles", "codeSearch"],
|
|
11560
11854
|
Fetch: ["fetchWebpage"]
|
|
11561
11855
|
};
|
|
@@ -11571,6 +11865,7 @@ function toolRowDetailLine(line) {
|
|
|
11571
11865
|
const glyph = match[1] ?? "";
|
|
11572
11866
|
const family = toolFamilyOfIcon(glyph);
|
|
11573
11867
|
if (!family) return line;
|
|
11868
|
+
if (glyph === family.en || glyph === family.zh) return line;
|
|
11574
11869
|
const familyName = toolFamilyLabel(glyph);
|
|
11575
11870
|
const glyphIndex = match[0].length - glyph.length;
|
|
11576
11871
|
return `${line.slice(0, glyphIndex)}${familyName}${line.slice(match[0].length)}`;
|
|
@@ -11659,7 +11954,13 @@ function createToolEventFormatter(colorEnabled = resolveCliColorEnabled(), opts
|
|
|
11659
11954
|
if (kind === "Run") {
|
|
11660
11955
|
item = activity.summary ?? (activity.confidence === "raw-fallback" ? clipCompactText(redactSecrets(activity.object ?? ""), 56, "\u2026") : [activity.action, activity.object].filter(Boolean).join(" "));
|
|
11661
11956
|
}
|
|
11662
|
-
if (kind === "Read")
|
|
11957
|
+
if (kind === "Read") {
|
|
11958
|
+
if (name === "read_image") {
|
|
11959
|
+
item = formatReadImageSummary(m) || toolIcon("read_image");
|
|
11960
|
+
} else {
|
|
11961
|
+
item = formatReadItemPath(typeof m.path === "string" ? m.path : typeof m.filePath === "string" ? m.filePath : "file", m);
|
|
11962
|
+
}
|
|
11963
|
+
}
|
|
11663
11964
|
if (kind === "Search") item = formatSearchItemQuery(typeof m.query === "string" ? m.query : typeof m.pattern === "string" ? m.pattern : "search", typeof m.path === "string" ? m.path : void 0);
|
|
11664
11965
|
if (kind === "Fetch") item = formatFetchItemUrl(typeof m.url === "string" ? m.url : "webpage");
|
|
11665
11966
|
item = safeAskText(item) || toolLabel(name);
|
|
@@ -12724,7 +13025,7 @@ function isBalanceExhaustedError(error) {
|
|
|
12724
13025
|
|
|
12725
13026
|
// packages/cli/client/agentRun.ts
|
|
12726
13027
|
async function loadRunLocalAgentTurn() {
|
|
12727
|
-
const { runLocalAgentTurn } = await import("./agentRuntimeLocal-
|
|
13028
|
+
const { runLocalAgentTurn } = await import("./agentRuntimeLocal-4Y47ZSIP.js");
|
|
12728
13029
|
return runLocalAgentTurn;
|
|
12729
13030
|
}
|
|
12730
13031
|
var stripDebugNoise = (s) => s.replace(/\s*raw="[\s\S]*"/g, "").replace(/\s*raw=\S+/g, "").replace(/\s*headers=\[[^\]]*\]/g, "").replace(/\s*headers=\S+/g, "").trim();
|
|
@@ -14026,6 +14327,7 @@ async function executeLocalAgentTurnForCliWithAdapter(options, settings, resolve
|
|
|
14026
14327
|
};
|
|
14027
14328
|
const expandedMessage = options.pastedTextStore?.items.size ? expandCollapsedPastes(options.message, options.pastedTextStore) : options.message;
|
|
14028
14329
|
const commandObservations = [];
|
|
14330
|
+
const collectedToolImageArtifacts = [];
|
|
14029
14331
|
const retainCommandObservations = (result) => {
|
|
14030
14332
|
recordRunResultHeaderMeta(result, { commandObservations });
|
|
14031
14333
|
return result;
|
|
@@ -14131,6 +14433,13 @@ async function executeLocalAgentTurnForCliWithAdapter(options, settings, resolve
|
|
|
14131
14433
|
onToolEvent: (event) => {
|
|
14132
14434
|
const observation = observeLocalCommandResult(event, options.localRuntimeCwd ?? process.cwd());
|
|
14133
14435
|
if (observation) commandObservations.push({ ...observation, ...commandVersionBindings.get(event.toolCallId) });
|
|
14436
|
+
if (event.type === "tool-result" && event.imageArtifacts?.length) {
|
|
14437
|
+
if (options.onToolImageArtifacts) {
|
|
14438
|
+
options.onToolImageArtifacts(event.imageArtifacts);
|
|
14439
|
+
} else {
|
|
14440
|
+
collectedToolImageArtifacts.push(...event.imageArtifacts);
|
|
14441
|
+
}
|
|
14442
|
+
}
|
|
14134
14443
|
turnOutput.handleToolEvent(event);
|
|
14135
14444
|
},
|
|
14136
14445
|
...!options.noStream ? {
|
|
@@ -14166,7 +14475,8 @@ async function executeLocalAgentTurnForCliWithAdapter(options, settings, resolve
|
|
|
14166
14475
|
...turnTokens !== void 0 ? { turnTokens } : {},
|
|
14167
14476
|
...turnCredits !== void 0 ? { turnCredits } : {},
|
|
14168
14477
|
...usageRecords?.length ? { usageRecords } : {},
|
|
14169
|
-
...runContextWindow !== void 0 ? { contextWindow: runContextWindow } : {}
|
|
14478
|
+
...runContextWindow !== void 0 ? { contextWindow: runContextWindow } : {},
|
|
14479
|
+
...collectedToolImageArtifacts.length > 0 ? { toolImageArtifacts: collectedToolImageArtifacts } : {}
|
|
14170
14480
|
};
|
|
14171
14481
|
const serverMeta = resolveResultServerMeta({
|
|
14172
14482
|
env: options.env ?? {},
|
|
@@ -14709,6 +15019,7 @@ function executeDoDCommand(cmd, cwd, deps = {}) {
|
|
|
14709
15019
|
shell: true,
|
|
14710
15020
|
windowsHide: true,
|
|
14711
15021
|
cwd: cwd || process.cwd(),
|
|
15022
|
+
env: workspaceChildEnv(deps.env),
|
|
14712
15023
|
timeout: DOD_COMMAND_TIMEOUT_MS,
|
|
14713
15024
|
maxBuffer: 10 * 1024 * 1024,
|
|
14714
15025
|
encoding: "utf8"
|
|
@@ -16943,22 +17254,32 @@ async function resolveAgentBoundMachineIdFromRecord(args) {
|
|
|
16943
17254
|
return resolveBoundMachineId(record) || void 0;
|
|
16944
17255
|
}
|
|
16945
17256
|
async function runAgentRunCommand(args, deps) {
|
|
17257
|
+
if (args.includes("--help") || args.includes("-h")) {
|
|
17258
|
+
writeUsage(deps.output ?? process.stdout, deps.commandPath);
|
|
17259
|
+
return 0;
|
|
17260
|
+
}
|
|
16946
17261
|
const env = deps.env ?? process.env;
|
|
16947
17262
|
const runId = env.NOLO_AGENT_RUN_ID;
|
|
16948
17263
|
const controlDeps = { env, homedir: deps.homedir, fs: deps.fs, now: deps.now };
|
|
16949
17264
|
const failStartup = async (error) => {
|
|
16950
|
-
if (!runId
|
|
17265
|
+
if (!runId) return;
|
|
17266
|
+
const record = readRunRecord(runId, controlDeps);
|
|
17267
|
+
if (record?.status !== "running" || record.pid != null && record.pid !== process.pid) return;
|
|
16951
17268
|
const result = await settleRunTerminalAuthoritatively(runId, {
|
|
16952
17269
|
status: "failed",
|
|
16953
17270
|
exitCode: 1,
|
|
16954
17271
|
failureReason: error instanceof RuntimeProtocolMismatchError ? "runtime_protocol_mismatch" : error instanceof RuntimeVersionMismatchError ? "runtime_version_mismatch" : "startup_failed",
|
|
16955
17272
|
note: error ? toErrorMessage(error) : "Child initialization returned without terminal result"
|
|
16956
|
-
}, controlDeps, (id, update, d) => transitionRunToTerminal(id, update, d
|
|
17273
|
+
}, controlDeps, (id, update, d, opts) => transitionRunToTerminal(id, update, d, {
|
|
17274
|
+
...opts?.expectedPid != null ? { expectedPid: opts.expectedPid } : {}
|
|
17275
|
+
}), { expectedPid: process.pid });
|
|
16957
17276
|
if (result.kind === "contended") throw new Error(`Startup settlement lock busy: ${runId}`);
|
|
16958
17277
|
};
|
|
16959
17278
|
try {
|
|
16960
17279
|
if (runId) {
|
|
16961
|
-
|
|
17280
|
+
const record = readRunRecord(runId, controlDeps);
|
|
17281
|
+
if (record?.pid != null && record.pid !== process.pid) throw new Error(`Run ${runId} belongs to PID ${record.pid}, not ${process.pid}`);
|
|
17282
|
+
if (!record) throw new Error("[local-writer-resource] missing child binding");
|
|
16962
17283
|
await recordRunStartup(runId, "initializing", controlDeps);
|
|
16963
17284
|
validateAgentRunProtocol(env.NOLO_AGENT_RUN_PROTOCOL);
|
|
16964
17285
|
await recordRunStartup(runId, "protocol_validated", controlDeps);
|
|
@@ -16977,10 +17298,6 @@ async function runAgentRunCommandImpl(args, deps) {
|
|
|
16977
17298
|
write: (chunk) => process.stdout.write(chunk),
|
|
16978
17299
|
writeErr: (chunk) => process.stderr.write(chunk)
|
|
16979
17300
|
};
|
|
16980
|
-
if (args.includes("--help") || args.includes("-h")) {
|
|
16981
|
-
writeUsage(output, deps.commandPath);
|
|
16982
|
-
return 0;
|
|
16983
|
-
}
|
|
16984
17301
|
let parsed;
|
|
16985
17302
|
try {
|
|
16986
17303
|
parsed = parseAgentRunArgs(args, { commandPath: deps.commandPath });
|
|
@@ -17107,7 +17424,8 @@ async function runAgentRunCommandImpl(args, deps) {
|
|
|
17107
17424
|
},
|
|
17108
17425
|
{ env, homedir: deps.homedir, fs: deps.fs, now: deps.now, sleep: deps.sleep },
|
|
17109
17426
|
// Test seam: stubbed transitions keep their single-attempt semantics.
|
|
17110
|
-
deps.transitionRunToTerminal
|
|
17427
|
+
deps.transitionRunToTerminal,
|
|
17428
|
+
{ expectedPid: process.pid }
|
|
17111
17429
|
);
|
|
17112
17430
|
};
|
|
17113
17431
|
if (armStallWatchdog) {
|
|
@@ -17671,7 +17989,8 @@ async function runAgentRunCommandImpl(args, deps) {
|
|
|
17671
17989
|
try {
|
|
17672
17990
|
dodResults = (deps.runDoDCommands ?? runDoDCommands)(
|
|
17673
17991
|
childRecordForDoD?.dodCommands,
|
|
17674
|
-
childRecordForDoD?.cwd
|
|
17992
|
+
childRecordForDoD?.cwd,
|
|
17993
|
+
{ env }
|
|
17675
17994
|
);
|
|
17676
17995
|
} catch (dodError) {
|
|
17677
17996
|
console.warn(`[nolo] DoD verification failed to run for ${childRunId}:`, dodError);
|
|
@@ -17746,7 +18065,8 @@ async function runAgentRunCommandImpl(args, deps) {
|
|
|
17746
18065
|
now: deps.now,
|
|
17747
18066
|
sleep: deps.sleep
|
|
17748
18067
|
},
|
|
17749
|
-
deps.transitionRunToTerminal
|
|
18068
|
+
deps.transitionRunToTerminal,
|
|
18069
|
+
{ expectedPid: process.pid }
|
|
17750
18070
|
);
|
|
17751
18071
|
} catch (error) {
|
|
17752
18072
|
terminalStatus.fail();
|
|
@@ -17795,6 +18115,7 @@ export {
|
|
|
17795
18115
|
redactSecrets,
|
|
17796
18116
|
resolveCliColorEnabled,
|
|
17797
18117
|
dimCliText,
|
|
18118
|
+
resolveCliHyperlinkEnabled,
|
|
17798
18119
|
THEME_PALETTES,
|
|
17799
18120
|
getActiveThemeName,
|
|
17800
18121
|
setActiveThemeName,
|
|
@@ -17817,6 +18138,7 @@ export {
|
|
|
17817
18138
|
polishBreathInsertsBlankBetween,
|
|
17818
18139
|
formatAssistantDisplay,
|
|
17819
18140
|
safeAskText,
|
|
18141
|
+
safeApprovalSingleLineText,
|
|
17820
18142
|
safeApprovalMultilineText,
|
|
17821
18143
|
TUI_TREE_MARKER,
|
|
17822
18144
|
TUI_TREE_TOOLS,
|