nolo-cli 0.240.0-alpha.3 → 0.242.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/README.md +3 -5
- package/{_executeModel-5NA4USGG.js → _executeModel-IZ2MCXHO.js} +77 -77
- package/{action-X75O3XPH.js → action-VDEW6WLI.js} +9 -9
- package/{addContentAction-GVC77QSN.js → addContentAction-7YVXHIPQ.js} +14 -14
- package/{addDialogAgentAction-KKDVAMW3.js → addDialogAgentAction-BX7B47HF.js} +17 -17
- package/{agentDeleteCommand-2RFGKFAB.js → agentDeleteCommand-N7ELXPLD.js} +107 -108
- package/{agentEmailCommands-GQCQKKOR.js → agentEmailCommands-OFS477PV.js} +110 -111
- package/{agentListCommands-HSGLDPDQ.js → agentListCommands-IQQHJSXP.js} +202 -164
- package/{agentMachineCommands-BISF6PVV.js → agentMachineCommands-NS65BEW7.js} +52 -49
- package/{agentProviderCommands-O3Q25PKU.js → agentProviderCommands-SS6M6VGY.js} +2 -2
- package/{agentPullCommand-G6U2LHMW.js → agentPullCommand-QQQZSC6S.js} +1 -1
- package/{agentRecordCommands-AOXPGYAJ.js → agentRecordCommands-4VE7CNLC.js} +103 -104
- package/{agentRunCommand-AFAIP7U7.js → agentRunCommand-2MUXHKNW.js} +109 -108
- package/{agentRunControl-VBL7UFSG.js → agentRunControl-55GL6Q3M.js} +11 -9
- package/{agentRuntimeLocal-T7BX2WGL.js → agentRuntimeLocal-5DB2P4MU.js} +51 -43
- package/{agentSlice-XJNKE3PG.js → agentSlice-5VTAFG43.js} +14 -14
- package/{appDeleteCommands-LURUSPY7.js → appDeleteCommands-EDKUPHJM.js} +52 -49
- package/{appDeployCommands-SMEW4AK2.js → appDeployCommands-JO74GW4L.js} +52 -49
- package/{appDeployStatusCommands-VYPJTBJK.js → appDeployStatusCommands-U77ZUHX7.js} +52 -49
- package/{appGetCommands-N4NI5GGJ.js → appGetCommands-QCMHBYPX.js} +52 -49
- package/{appListCommands-5C6ONN3Z.js → appListCommands-ZQJYEXI6.js} +52 -49
- package/{authCommand-4CVBDADE.js → authCommand-W4KXRZLI.js} +23 -19
- package/{authCommands-EHU2BHOX.js → authCommands-6AUYO65N.js} +10 -6
- package/{builtinSkillRegistry-AYWYQVA4.js → builtinSkillRegistry-GHE3RD3V.js} +6 -6
- package/{chromeCommands-G5UDKVSV.js → chromeCommands-S7AW3AOD.js} +383 -6
- package/{chromeOpsCommands-CSDG2HYN.js → chromeOpsCommands-TBPM6MR4.js} +1 -1
- package/{chunk-7TTMMOKH.js → chunk-247AAJRK.js} +1 -1
- package/{chunk-4X5AVCM7.js → chunk-2BSLGODA.js} +258 -23
- package/{chunk-P3IZUMIC.js → chunk-2N4UBHUU.js} +4 -4
- package/{chunk-A74QP4FI.js → chunk-2T5BHLID.js} +572 -208
- package/{chunk-H7ZYKHAZ.js → chunk-3OQFXODL.js} +102 -31
- package/{chunk-BIABIPGW.js → chunk-3ORFJP2Z.js} +1 -1
- package/{chunk-3FBAVU2Y.js → chunk-3UNAGTBW.js} +19 -84
- package/{chunk-DNZ4JJ7C.js → chunk-4F7SWSWO.js} +19 -6
- package/{chunk-2X7WFDT6.js → chunk-4FE3IWRE.js} +1 -1
- package/{chunk-N2JROHD3.js → chunk-4UK6UBXF.js} +3 -3
- package/{chunk-XS5A3EKX.js → chunk-4YFC3DWW.js} +75 -1
- package/chunk-53W5BXLN.js +340 -0
- package/{chunk-E5KJOZWY.js → chunk-5GRWWUB4.js} +3 -3
- package/{chunk-HCNOO374.js → chunk-6326DRQY.js} +1 -1
- package/{chunk-RM4UMFY4.js → chunk-6MQWGA5F.js} +10 -10
- package/{chunk-TEMLHVGX.js → chunk-6MX6S6TE.js} +3 -3
- package/{chunk-6WOLPIPY.js → chunk-6RSNVJGO.js} +2 -102
- package/{chunk-Y5OWZQMJ.js → chunk-6S6CZUXK.js} +19 -19
- package/{chunk-PDCV7P5W.js → chunk-6XIE5ZGI.js} +1 -1
- package/{chunk-FZKA3XFA.js → chunk-6XLWUNZB.js} +27 -27
- package/{chunk-62HXNQVV.js → chunk-776CXKMX.js} +1 -1
- package/{chunk-MYPKBJJO.js → chunk-7AWKDRXG.js} +2 -2
- package/{chunk-GDUC4VS2.js → chunk-7GTXPS3D.js} +10 -10
- package/{chunk-Z2WZAE4P.js → chunk-7HUHOCIY.js} +36 -30
- package/{chunk-PWTNI4N7.js → chunk-ANUP75N2.js} +22 -0
- package/{chunk-ULLHVDTZ.js → chunk-BH7CEVOH.js} +4 -4
- package/{chunk-A3LUWRQK.js → chunk-C4KX626C.js} +5 -5
- package/chunk-C5A54QS7.js +108 -0
- package/{chunk-DXW5WDHZ.js → chunk-CHYYSFFM.js} +6 -6
- package/{chunk-O6IPRAVV.js → chunk-CJTB3OYB.js} +2 -2
- package/{chunk-AVJDELEA.js → chunk-DLT2DN4M.js} +1 -1
- package/{chunk-LKA64WH4.js → chunk-DMPZMYH4.js} +37 -1
- package/{chunk-MM73SP4K.js → chunk-DOK7GDRU.js} +1 -1
- package/{chunk-VREG6ANQ.js → chunk-DPAIQLAL.js} +16 -16
- package/{chunk-ANJRDS6U.js → chunk-EKXPHL7M.js} +3 -3
- package/{chunk-TWTJV35S.js → chunk-ENYTIRIO.js} +3 -3
- package/{chunk-PGKA77TZ.js → chunk-ER3P6MBT.js} +170 -107
- package/{chunk-EEOOBRA7.js → chunk-F4MCAOWN.js} +2 -2
- package/{chunk-7NIBQ4HY.js → chunk-FDZ2GBWO.js} +30 -2
- package/{chunk-VSRISJXZ.js → chunk-GAHJLSDO.js} +1 -1
- package/{chunk-U3G7RRXJ.js → chunk-GES5GIAU.js} +8 -8
- package/{chunk-4IQVE43Z.js → chunk-HQVNO7FH.js} +22 -22
- package/{chunk-DVYAFH2Q.js → chunk-HSWEFHFS.js} +1 -1
- package/{chunk-MECDGHLK.js → chunk-IIG3TT73.js} +43 -6
- package/{chunk-YGCOJNFZ.js → chunk-IZJFTY4R.js} +3 -3
- package/{chunk-BXSMFPTG.js → chunk-J25ESVUW.js} +10 -10
- package/{chunk-CVJRVBJL.js → chunk-J2XZZXIH.js} +4 -4
- package/{chunk-3EMIEC27.js → chunk-JVJ53XCH.js} +1 -1
- package/{chunk-AH5R7BYW.js → chunk-KC2QVCI7.js} +6 -6
- package/{chunk-MYOSN6BT.js → chunk-KF2DWSAH.js} +34 -13
- package/chunk-KK3FCYZM.js +647 -0
- package/{chunk-PRMEU7BT.js → chunk-KLD7K5FD.js} +7 -7
- package/{chunk-7AJRJGSQ.js → chunk-KMW5CRRM.js} +801 -381
- package/{chunk-Y2MF4DCJ.js → chunk-LELADM5Q.js} +1 -1
- package/{chunk-RTHFJZ6M.js → chunk-LMFMV5UC.js} +2 -2
- package/{chunk-2574ANSV.js → chunk-LZOOUQAZ.js} +4 -4
- package/{chunk-HOM6LTEW.js → chunk-M5EA44QU.js} +6 -6
- package/{chunk-IUMS6F53.js → chunk-MEDPR36J.js} +9 -5
- package/{chunk-6D25V6CB.js → chunk-MFXJY44K.js} +4 -4
- package/chunk-MVOZ22RZ.js +26 -0
- package/{chunk-CBUZ6DKA.js → chunk-N6EN3HK3.js} +1 -1
- package/{chunk-VS276URX.js → chunk-NEG5LYK5.js} +1 -1
- package/{chunk-B7DE5XJW.js → chunk-ODGSLWLO.js} +249 -66
- package/{chunk-S2MHR4PU.js → chunk-OGZE6BZG.js} +190 -118
- package/{chunk-CD3RU7XL.js → chunk-OJRTTERA.js} +62 -2
- package/{chunk-GXXY2NL3.js → chunk-OKPC4QNX.js} +37 -2
- package/{chunk-5QZSEQSK.js → chunk-ONFFUQYM.js} +1 -1
- package/{chunk-BGGAY6OK.js → chunk-P244EH4W.js} +3 -3
- package/chunk-P27E22MA.js +203 -0
- package/{chunk-UFC4J7OY.js → chunk-PK7VT4ZU.js} +3 -3
- package/{chunk-4FIO2S7Z.js → chunk-QLUYDJST.js} +1 -1
- package/{chunk-AEQMKYZN.js → chunk-QUJKDFZW.js} +7 -7
- package/{chunk-G22P367E.js → chunk-QXUVCIPB.js} +62 -18
- package/{chunk-IJTXNLQE.js → chunk-QYNABNNQ.js} +6 -6
- package/{chunk-TRHJ4NJB.js → chunk-RGUWOMXU.js} +626 -237
- package/{chunk-L32W3PRP.js → chunk-RH44TIHX.js} +165 -16
- package/{chunk-EBKHA63G.js → chunk-RIMFTQMC.js} +178 -46
- package/{chunk-OOJNQK6V.js → chunk-S25VJYXV.js} +8 -2
- package/{chunk-BGGV6B5O.js → chunk-SBRJOYND.js} +280 -139
- package/{chunk-KZPEGO6D.js → chunk-SBRSXY67.js} +6 -6
- package/chunk-SR4FE5VD.js +9 -0
- package/{chunk-4WVJLODK.js → chunk-T23G6PXQ.js} +8 -3
- package/{chunk-D374I563.js → chunk-T3WSFTBS.js} +1 -1
- package/{chunk-VP3BINY7.js → chunk-TOK555CQ.js} +31 -1
- package/{chunk-OBSEKCVK.js → chunk-U4VSBDO5.js} +88 -0
- package/{chunk-OX6GNNVT.js → chunk-U5LOKQ2R.js} +24 -13
- package/{chunk-LYDEFPQP.js → chunk-UDT4SI37.js} +1 -1
- package/{chunk-CKZPMJNU.js → chunk-UQXOORR3.js} +5 -5
- package/{chunk-FFYE5ATM.js → chunk-UR7555FE.js} +11 -11
- package/{chunk-F3XI6WQP.js → chunk-UWOCASVL.js} +5 -5
- package/{chunk-A5EVA6HU.js → chunk-V2V5Q6DU.js} +2 -2
- package/{chunk-PROOOQZ3.js → chunk-VCU5GV42.js} +1 -1
- package/{chunk-F6YWDVIB.js → chunk-VMWY7TUA.js} +1 -1
- package/{chunk-RETQOQ4D.js → chunk-VNALJT32.js} +2 -2
- package/{chunk-HGDKT2D6.js → chunk-VTHWBTRE.js} +177 -1
- package/{chunk-X7IA2B7R.js → chunk-WBSJAIZP.js} +7 -3
- package/{chunk-ZEKUFJLW.js → chunk-WVOZ35E4.js} +7 -7
- package/{chunk-B5SV4H3J.js → chunk-XDNXKFWF.js} +4 -4
- package/{chunk-4Q6HQORG.js → chunk-XLN2GD6Z.js} +4 -4
- package/{chunk-HBRDSQ3M.js → chunk-XNEDFWT4.js} +2 -2
- package/{chunk-6CKUO32A.js → chunk-Y22P6ASC.js} +11 -8
- package/{chunk-SRCCSTIM.js → chunk-Y3DOUQQQ.js} +4 -4
- package/{chunk-6WZVM33D.js → chunk-Y5EBOURK.js} +3 -3
- package/{chunk-6OVNSQHN.js → chunk-YLAHYLDQ.js} +5 -0
- package/{chunk-T6VROBY7.js → chunk-YTEY27GN.js} +2 -2
- package/{chunk-5ZUOVCKT.js → chunk-YUZ2DAIH.js} +3 -1
- package/{chunk-IUTUWIKE.js → chunk-ZCVBIIUE.js} +4 -4
- package/{chunk-VM72HKW2.js → chunk-ZCZLTJEW.js} +9 -36
- package/{cliAgentConfigHelpers-U5OAVAKQ.js → cliAgentConfigHelpers-6OFDHJFT.js} +8 -8
- package/{cliAuthorityBrokerClient-S42VMGB6.js → cliAuthorityBrokerClient-SFPC3WVK.js} +1 -1
- package/{cliLocalAgentRecordReader-HVZAQCUD.js → cliLocalAgentRecordReader-FHIMCBUK.js} +52 -45
- package/{commandRegistry-TME7INFU.js → commandRegistry-OKIWAJIS.js} +101 -93
- package/{contentThunks-U6OC4R2N.js → contentThunks-VF2DCU46.js} +33 -32
- package/{cooldownCommands-U7XSRVJP.js → cooldownCommands-QL6DWGVU.js} +1 -1
- package/{createAgentAutomationAction-IP4LFN3W.js → createAgentAutomationAction-BGET7Q6K.js} +34 -33
- package/{createDialogAction-IAGQJ3LH.js → createDialogAction-XYDQZETK.js} +34 -33
- package/{createPageAction-AZ3UIFKA.js → createPageAction-74S5RO7U.js} +38 -37
- package/{db-M7FU2GNK.js → db-6NRZLEW2.js} +1 -1
- package/{dbSlice-DKKMJJYY.js → dbSlice-FI7VNDR5.js} +13 -13
- package/{deleteFile-TQSONMVU.js → deleteFile-GD62MPZW.js} +8 -8
- package/{dialogCommands-PCDRMBWG.js → dialogCommands-Y6DHZUAM.js} +56 -54
- package/{dialogNotifyCommand-O35MWMOS.js → dialogNotifyCommand-MKXL4NGL.js} +10 -10
- package/{dialogSlice-QAKYN4DE.js → dialogSlice-XAUKSWZ4.js} +32 -31
- package/{dialogUsageCommand-2SSLTXKO.js → dialogUsageCommand-BZPKR3DW.js} +5 -5
- package/{docCreateCommands-CFQFZOAD.js → docCreateCommands-PHDFOQBM.js} +51 -48
- package/{docDeleteCommands-5CPNTIIS.js → docDeleteCommands-OSHJM67Y.js} +53 -50
- package/{docReadCommands-XQILYSAJ.js → docReadCommands-E6QYCFMS.js} +51 -48
- package/{docStore-GIVRT7TQ.js → docStore-ZZT2BEBU.js} +15 -15
- package/{docUpdateCommands-VETKSUDD.js → docUpdateCommands-DHIOPK2C.js} +51 -48
- package/fetchMessages-TQEUZD7H.js +1 -1
- package/{getPricing-LF5C4XSI.js → getPricing-RNRITFOP.js} +4 -4
- package/{handleSendMessageAction-HKIW4ZNO.js → handleSendMessageAction-ARUU6CNF.js} +71 -70
- package/{hostCredentialCreate-6VDJFNDO.js → hostCredentialCreate-SNQT73H4.js} +103 -104
- package/index.js +8 -8
- package/{localDialogRead-AV2VKKPG.js → localDialogRead-3T2KMCRC.js} +1 -1
- package/{localRuntimeAdapter-BQ4F5PZV.js → localRuntimeAdapter-MHI6Y2IZ.js} +112 -111
- package/{localRuntimeAuthority-WCNA4A3G.js → localRuntimeAuthority-7DKIT7UH.js} +2 -2
- package/{localRuntimeDb-CRNIBOOM.js → localRuntimeDb-5WZ4RJJO.js} +1 -1
- package/{machineCommands-K6XIGOAD.js → machineCommands-3O6Y27R4.js} +229 -321
- package/{machineWsRunDispatch-4OO7Z6UM.js → machineWsRunDispatch-5PFLR5XC.js} +101 -102
- package/markdownToSlate-KIYM7B3P.js +8 -0
- package/{mcpLocalAuthorizeCommand-ZP6ESAGE.js → mcpLocalAuthorizeCommand-BQCQ2KRJ.js} +15 -15
- package/{memberThunks-PBJPZ2JU.js → memberThunks-TU6A6OBV.js} +16 -16
- package/{models-H5NNZRLH.js → models-CINY5UZR.js} +2 -2
- package/package.json +1 -1
- package/{projectArchive-G7AOQPRW.js → projectArchive-X2EVXU3N.js} +40 -39
- package/{providerPresetApply-OPBCAONX.js → providerPresetApply-HUWNV2NI.js} +6 -6
- package/{providerRegistry-J2HCVTHE.js → providerRegistry-7FWKDKZJ.js} +6 -6
- package/{read-JEGPITEW.js → read-QAHEQID5.js} +8 -8
- package/{readDocTool-TE3XIU4Y.js → readDocTool-KG5DP6EM.js} +1 -1
- package/{readlineWorkspace-SOW5QUGZ.js → readlineWorkspace-SO3APHVP.js} +3300 -1518
- package/rememberExplicit-CPAPONSI.js +15 -0
- package/{removeDialogAgentAction-CX3OAH4Y.js → removeDialogAgentAction-QZCCVK2G.js} +19 -19
- package/{runAgentClientLoop-HQJPDFGQ.js → runAgentClientLoop-FLHHCOVH.js} +77 -77
- package/{runtimeDoctorCommands-GUH2YGMH.js → runtimeDoctorCommands-DN3I52C6.js} +8 -8
- package/{secretCommands-NJXFVHZU.js → secretCommands-36BCE3UE.js} +2 -2
- package/{setDialogExtraReferencesAction-CGM67EEQ.js → setDialogExtraReferencesAction-PDPTYSEW.js} +15 -15
- package/{setPrimaryDialogAgentAction-3ABWPPXR.js → setPrimaryDialogAgentAction-DOUIPR66.js} +19 -19
- package/{settingThunks-AY76OHYX.js → settingThunks-MHGGP6UE.js} +23 -23
- package/{spaceCommands-G63QGYQO.js → spaceCommands-JH7UYE3K.js} +54 -51
- package/{streamAgentChatTurn-E3XH2KFD.js → streamAgentChatTurn-VDDA2TX6.js} +118 -118
- package/{switchDialogAgentAction-G6EZRKCQ.js → switchDialogAgentAction-7USK3DAP.js} +17 -17
- package/{tableCommands-JI75ZHDI.js → tableCommands-UONBFC7L.js} +6 -6
- package/{toolApiClient-62UUPDUA.js → toolApiClient-53YMJ2G6.js} +7 -3
- package/{tools-7RSX22FT.js → tools-MIOCXKMG.js} +59 -60
- package/{tuiRestart-KAAA7TND.js → tuiRestart-ET3QISZ5.js} +10 -10
- package/{tuiSummaryLlmCaller-BVNHMWLR.js → tuiSummaryLlmCaller-MSINBP3M.js} +15 -14
- package/{updateCommands-ASK5XYPH.js → updateCommands-5OYND6EF.js} +3 -3
- package/{updateDialogTitleAction-SEWV252V.js → updateDialogTitleAction-2L4CC4YO.js} +35 -34
- package/{usageCommand-JVT5J3DC.js → usageCommand-JTKDAG6I.js} +2 -2
- package/{usageRebuildCommand-IZYYUTEW.js → usageRebuildCommand-4TFZCKXM.js} +3 -3
- package/{windowsSelfUpdate-BSDIS2J5.js → windowsSelfUpdate-HIYNL3VR.js} +2 -2
- package/{workContext-MM3P5GP5.js → workContext-Y3ADAPZU.js} +2 -1
- package/{workloadLifecycle-YIZ7KLUP.js → workloadLifecycle-ZCSQCHG3.js} +6 -6
- package/chunk-TUSTONB3.js +0 -81
- package/chunk-XBAEM4RI.js +0 -272
- package/{accountResolver-EK2S4PWF.js → accountResolver-QETKNC7T.js} +3 -3
- package/{chunk-W6RFEDN4.js → chunk-AETZ7AD6.js} +3 -3
- package/{chunk-VMJVAJ6W.js → chunk-TB5KTLNB.js} +3 -3
- /package/{chunk-FJ23FZXF.js → chunk-VIYVRPMJ.js} +0 -0
|
@@ -1,9 +1,14 @@
|
|
|
1
1
|
import {
|
|
2
2
|
findPotentialSecrets
|
|
3
3
|
} from "./chunk-6QDYSCPW.js";
|
|
4
|
+
import {
|
|
5
|
+
deriveStateResident,
|
|
6
|
+
resolvePureVNextRuntime,
|
|
7
|
+
touchMemoryItemsInDb
|
|
8
|
+
} from "./chunk-GAHJLSDO.js";
|
|
4
9
|
import {
|
|
5
10
|
getReadableCliDb
|
|
6
|
-
} from "./chunk-
|
|
11
|
+
} from "./chunk-DLT2DN4M.js";
|
|
7
12
|
import {
|
|
8
13
|
INSTABOX_RUN_CONFIG_ENV,
|
|
9
14
|
buildLocalRunEnv,
|
|
@@ -17,7 +22,6 @@ import {
|
|
|
17
22
|
isInstaboxBillingPolicy,
|
|
18
23
|
isLiveAgentRunObservation,
|
|
19
24
|
isMachineBoundLocalhostCustomProvider,
|
|
20
|
-
isSubtaskRun,
|
|
21
25
|
normalizeCliRunImages,
|
|
22
26
|
parseAgentRunArgs,
|
|
23
27
|
parseAgentRunEvent,
|
|
@@ -29,25 +33,21 @@ import {
|
|
|
29
33
|
resolveServerUrl,
|
|
30
34
|
validateInstaboxWorkspaceSelection,
|
|
31
35
|
writeUsage
|
|
32
|
-
} from "./chunk-
|
|
33
|
-
import {
|
|
34
|
-
clearCredentialAvailability,
|
|
35
|
-
readEffectiveCredentialEntry
|
|
36
|
-
} from "./chunk-WWTSEBDF.js";
|
|
36
|
+
} from "./chunk-KMW5CRRM.js";
|
|
37
37
|
import {
|
|
38
38
|
boxGlyphs,
|
|
39
39
|
displayWidth,
|
|
40
40
|
fitAnsiLine,
|
|
41
|
+
resolveAmbiguousWidth,
|
|
41
42
|
resolveBoxCharset,
|
|
42
43
|
stripAnsi,
|
|
43
44
|
tokenizeAnsiLine,
|
|
44
45
|
visibleWidth
|
|
45
|
-
} from "./chunk-
|
|
46
|
+
} from "./chunk-KF2DWSAH.js";
|
|
46
47
|
import {
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
} from "./chunk-VSRISJXZ.js";
|
|
48
|
+
clearCredentialAvailability,
|
|
49
|
+
readEffectiveCredentialEntry
|
|
50
|
+
} from "./chunk-WWTSEBDF.js";
|
|
51
51
|
import {
|
|
52
52
|
rankMemoryCandidates,
|
|
53
53
|
recallMemoryVNextLocal
|
|
@@ -67,14 +67,17 @@ import {
|
|
|
67
67
|
resolveWorkContextAccess
|
|
68
68
|
} from "./chunk-Z6YTCDU4.js";
|
|
69
69
|
import {
|
|
70
|
-
applyMemoryInterpreterMutation,
|
|
71
70
|
isWorkContextState,
|
|
72
71
|
readWorkContexts
|
|
73
|
-
} from "./chunk-
|
|
72
|
+
} from "./chunk-C5A54QS7.js";
|
|
74
73
|
import {
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
74
|
+
applyMemoryInterpreterMutation
|
|
75
|
+
} from "./chunk-6RSNVJGO.js";
|
|
76
|
+
import {
|
|
77
|
+
getMemoryEvidenceVNextStrict,
|
|
78
|
+
loadMemoryVNextCatalog,
|
|
79
|
+
putMemoryEvidenceVNext
|
|
80
|
+
} from "./chunk-324FWHUA.js";
|
|
78
81
|
import {
|
|
79
82
|
CliProviderQuotaError
|
|
80
83
|
} from "./chunk-R7XWZDOH.js";
|
|
@@ -82,20 +85,15 @@ import {
|
|
|
82
85
|
resolveMachineId
|
|
83
86
|
} from "./chunk-S73EPYNC.js";
|
|
84
87
|
import {
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
putMemoryEvidenceVNext
|
|
88
|
-
} from "./chunk-324FWHUA.js";
|
|
88
|
+
resolveCliLocalRuntimeKeyCapability
|
|
89
|
+
} from "./chunk-SBRJOYND.js";
|
|
89
90
|
import {
|
|
90
91
|
extractGoogleValidationLink
|
|
91
92
|
} from "./chunk-BMQ2MJUK.js";
|
|
92
|
-
import {
|
|
93
|
-
resolveCliLocalRuntimeKeyCapability
|
|
94
|
-
} from "./chunk-BGGV6B5O.js";
|
|
95
93
|
import {
|
|
96
94
|
parseUiCard,
|
|
97
95
|
uiCardFallback
|
|
98
|
-
} from "./chunk-
|
|
96
|
+
} from "./chunk-DPAIQLAL.js";
|
|
99
97
|
import {
|
|
100
98
|
isGatewayHttpStatus
|
|
101
99
|
} from "./chunk-NF64D32W.js";
|
|
@@ -106,7 +104,7 @@ import {
|
|
|
106
104
|
loadOwnerItemsFromDb,
|
|
107
105
|
parseUiAskChoiceContent,
|
|
108
106
|
resolveAgentMemoryPolicy
|
|
109
|
-
} from "./chunk-
|
|
107
|
+
} from "./chunk-KLD7K5FD.js";
|
|
110
108
|
import {
|
|
111
109
|
API_REPORTED_COST_MULTIPLIER,
|
|
112
110
|
estimateMessagesTokens,
|
|
@@ -115,25 +113,17 @@ import {
|
|
|
115
113
|
resolveAgentContextWindow,
|
|
116
114
|
resolveOccupancy,
|
|
117
115
|
resolveOccupancyWindow
|
|
118
|
-
} from "./chunk-
|
|
116
|
+
} from "./chunk-ODGSLWLO.js";
|
|
119
117
|
import {
|
|
120
118
|
parsePositiveFiniteNumberOrFallback
|
|
121
119
|
} from "./chunk-Y5GCAMGP.js";
|
|
122
120
|
import {
|
|
123
121
|
readDbRecord,
|
|
124
122
|
resolveAgentRecordFromHybridStore
|
|
125
|
-
} from "./chunk-
|
|
123
|
+
} from "./chunk-J25ESVUW.js";
|
|
126
124
|
import {
|
|
127
125
|
isTransientFetchError
|
|
128
126
|
} from "./chunk-DXWGFL2Z.js";
|
|
129
|
-
import {
|
|
130
|
-
isCliAuthorityBrokerProtocolError,
|
|
131
|
-
isCliAuthorityBrokerTimeoutError,
|
|
132
|
-
isCliAuthorityBrokerUnavailableError
|
|
133
|
-
} from "./chunk-XBAEM4RI.js";
|
|
134
|
-
import {
|
|
135
|
-
getDefaultCliLocalRuntimeDb
|
|
136
|
-
} from "./chunk-Y2MF4DCJ.js";
|
|
137
127
|
import {
|
|
138
128
|
awaitLocalWriterChild,
|
|
139
129
|
createMcpApprovalChild,
|
|
@@ -154,7 +144,7 @@ import {
|
|
|
154
144
|
settleRunTerminalAuthoritatively,
|
|
155
145
|
spawnLocalBackgroundRun,
|
|
156
146
|
transitionRunToTerminal
|
|
157
|
-
} from "./chunk-
|
|
147
|
+
} from "./chunk-IIG3TT73.js";
|
|
158
148
|
import {
|
|
159
149
|
formatAgentListCard,
|
|
160
150
|
formatFinishedRunCard,
|
|
@@ -165,23 +155,29 @@ import {
|
|
|
165
155
|
formatStopRunCard,
|
|
166
156
|
getAgentRunStatusIcon,
|
|
167
157
|
isAgentRunTerminalStatus
|
|
168
|
-
} from "./chunk-
|
|
158
|
+
} from "./chunk-S25VJYXV.js";
|
|
169
159
|
import {
|
|
170
|
-
|
|
171
|
-
} from "./chunk-
|
|
160
|
+
buildSkillDiscoveryContextLayer
|
|
161
|
+
} from "./chunk-UHW6SCVK.js";
|
|
162
|
+
import {
|
|
163
|
+
isCliAuthorityBrokerProtocolError,
|
|
164
|
+
isCliAuthorityBrokerTimeoutError,
|
|
165
|
+
isCliAuthorityBrokerUnavailableError
|
|
166
|
+
} from "./chunk-KK3FCYZM.js";
|
|
167
|
+
import {
|
|
168
|
+
getDefaultCliLocalRuntimeDb
|
|
169
|
+
} from "./chunk-LELADM5Q.js";
|
|
172
170
|
import {
|
|
173
171
|
LOCAL_AGENT_CONFIG_MISSING_CODE,
|
|
174
172
|
LOCAL_TURN_ABORTED_CODE,
|
|
173
|
+
isSubtaskRun,
|
|
175
174
|
markCliUserBatchPhase,
|
|
176
175
|
readActionGate,
|
|
177
176
|
readAgentsMdLayerFromDisk
|
|
178
|
-
} from "./chunk-
|
|
177
|
+
} from "./chunk-RGUWOMXU.js";
|
|
179
178
|
import {
|
|
180
179
|
resolveAgentRuntimeConfigFromRecord
|
|
181
|
-
} from "./chunk-
|
|
182
|
-
import {
|
|
183
|
-
resolveAgentImageInputSupport
|
|
184
|
-
} from "./chunk-BGGAY6OK.js";
|
|
180
|
+
} from "./chunk-SBRSXY67.js";
|
|
185
181
|
import {
|
|
186
182
|
createThinkParserState,
|
|
187
183
|
flushThinkParser,
|
|
@@ -194,17 +190,23 @@ import {
|
|
|
194
190
|
resolveAvailabilityAction,
|
|
195
191
|
resolveCredentialKeyWithFallback
|
|
196
192
|
} from "./chunk-QJTZ76CP.js";
|
|
193
|
+
import {
|
|
194
|
+
resolveAgentImageInputSupport
|
|
195
|
+
} from "./chunk-P244EH4W.js";
|
|
196
|
+
import {
|
|
197
|
+
isContextOverflowText
|
|
198
|
+
} from "./chunk-TLE77UJ5.js";
|
|
197
199
|
import {
|
|
198
200
|
ATTACHMENT_PART_TYPE,
|
|
199
201
|
ATTACHMENT_PART_VERSION,
|
|
200
202
|
describeAttachmentForModel,
|
|
201
203
|
normalizeAttachmentPart
|
|
202
|
-
} from "./chunk-
|
|
204
|
+
} from "./chunk-4F7SWSWO.js";
|
|
203
205
|
import {
|
|
204
206
|
findCodexOAuthPinnedContextWindow,
|
|
205
207
|
normalizeUsage,
|
|
206
208
|
readCacheReadInputTokensOrNull
|
|
207
|
-
} from "./chunk-
|
|
209
|
+
} from "./chunk-RH44TIHX.js";
|
|
208
210
|
import {
|
|
209
211
|
isOAuthApiKeyRef
|
|
210
212
|
} from "./chunk-UKZX3NHN.js";
|
|
@@ -215,9 +217,6 @@ import {
|
|
|
215
217
|
normalizeRuntimeToolPolicyOverride,
|
|
216
218
|
resolveEffectiveRuntimeToolPolicy
|
|
217
219
|
} from "./chunk-USGHJSGO.js";
|
|
218
|
-
import {
|
|
219
|
-
compactWhitespace
|
|
220
|
-
} from "./chunk-DWLEOOGR.js";
|
|
221
220
|
import {
|
|
222
221
|
QUOTA_ERROR_PATTERNS,
|
|
223
222
|
isQuotaExhaustedError
|
|
@@ -225,10 +224,29 @@ import {
|
|
|
225
224
|
import {
|
|
226
225
|
estimateTokenCount
|
|
227
226
|
} from "./chunk-PSCNXBYA.js";
|
|
227
|
+
import {
|
|
228
|
+
compactWhitespace
|
|
229
|
+
} from "./chunk-DWLEOOGR.js";
|
|
230
|
+
import {
|
|
231
|
+
buildMemoryOverlayLayer,
|
|
232
|
+
buildMemoryUseGuidanceLayer,
|
|
233
|
+
partitionScopedBlocks,
|
|
234
|
+
renderTurnContextBlocksWithScope
|
|
235
|
+
} from "./chunk-5HUO7SEX.js";
|
|
228
236
|
import {
|
|
229
237
|
parseExternalSkillMarkdown,
|
|
230
238
|
parseSkillDocProtocol
|
|
231
|
-
} from "./chunk-
|
|
239
|
+
} from "./chunk-AETZ7AD6.js";
|
|
240
|
+
import {
|
|
241
|
+
ulid
|
|
242
|
+
} from "./chunk-OJKUU3LP.js";
|
|
243
|
+
import {
|
|
244
|
+
isBuiltinNoloAgentRef,
|
|
245
|
+
resolveLocalUserId
|
|
246
|
+
} from "./chunk-LZOOUQAZ.js";
|
|
247
|
+
import {
|
|
248
|
+
isLocalCliAgentKey
|
|
249
|
+
} from "./chunk-BR3GT6MR.js";
|
|
232
250
|
import {
|
|
233
251
|
BUILTIN_NOLO_AGENT_KEY,
|
|
234
252
|
BUILTIN_NOLO_AGENT_NAME,
|
|
@@ -238,18 +256,6 @@ import {
|
|
|
238
256
|
import {
|
|
239
257
|
parsePublicAgentId
|
|
240
258
|
} from "./chunk-M2EJHDJP.js";
|
|
241
|
-
import {
|
|
242
|
-
ulid
|
|
243
|
-
} from "./chunk-OJKUU3LP.js";
|
|
244
|
-
import {
|
|
245
|
-
buildSkillDiscoveryContextLayer
|
|
246
|
-
} from "./chunk-UHW6SCVK.js";
|
|
247
|
-
import {
|
|
248
|
-
buildMemoryOverlayLayer,
|
|
249
|
-
buildMemoryUseGuidanceLayer,
|
|
250
|
-
partitionScopedBlocks,
|
|
251
|
-
renderTurnContextBlocksWithScope
|
|
252
|
-
} from "./chunk-5HUO7SEX.js";
|
|
253
259
|
import {
|
|
254
260
|
exitCliFromWatchdog,
|
|
255
261
|
getLogger,
|
|
@@ -275,22 +281,22 @@ import {
|
|
|
275
281
|
toolIcon,
|
|
276
282
|
toolLabel,
|
|
277
283
|
toolLabelVariants
|
|
278
|
-
} from "./chunk-
|
|
284
|
+
} from "./chunk-OGZE6BZG.js";
|
|
279
285
|
import {
|
|
280
286
|
isAntigravityOAuthAgent
|
|
281
|
-
} from "./chunk-
|
|
282
|
-
import {
|
|
283
|
-
resolveClientVersion
|
|
284
|
-
} from "./chunk-RTHFJZ6M.js";
|
|
287
|
+
} from "./chunk-Y22P6ASC.js";
|
|
285
288
|
import {
|
|
286
289
|
toErrorMessage
|
|
287
290
|
} from "./chunk-HNMXYYJR.js";
|
|
291
|
+
import {
|
|
292
|
+
resolveClientVersion
|
|
293
|
+
} from "./chunk-LMFMV5UC.js";
|
|
288
294
|
import {
|
|
289
295
|
asTrimmedString
|
|
290
296
|
} from "./chunk-3EUW3WEO.js";
|
|
291
297
|
import {
|
|
292
298
|
findModelConfig
|
|
293
|
-
} from "./chunk-
|
|
299
|
+
} from "./chunk-OJRTTERA.js";
|
|
294
300
|
import {
|
|
295
301
|
asOptionalTrimmedString
|
|
296
302
|
} from "./chunk-G3SUCT4W.js";
|
|
@@ -298,7 +304,7 @@ import {
|
|
|
298
304
|
CLIENT_VERSION_TOO_OLD_CODE,
|
|
299
305
|
NOLO_CLIENT_VERSION_HEADER,
|
|
300
306
|
buildClientVersionUpgradeMessage
|
|
301
|
-
} from "./chunk-
|
|
307
|
+
} from "./chunk-U4VSBDO5.js";
|
|
302
308
|
import {
|
|
303
309
|
asTrimmedLowercaseString
|
|
304
310
|
} from "./chunk-QSJ3HFEF.js";
|
|
@@ -1379,6 +1385,40 @@ function formatCliHyperlink(url, label, enabled = resolveCliHyperlinkEnabled())
|
|
|
1379
1385
|
|
|
1380
1386
|
// packages/cli/tui/theme.ts
|
|
1381
1387
|
var THEME_PALETTES = {
|
|
1388
|
+
nature: {
|
|
1389
|
+
light: {
|
|
1390
|
+
accent: { hex: "1A5FA4", ansiFallback: "\x1B[34m" },
|
|
1391
|
+
// deep ocean ink (--hl-blue-text, 6.53:1 on #FFFFFF)
|
|
1392
|
+
chrome: { hex: "78828E", ansiFallback: "\x1B[90m" },
|
|
1393
|
+
// mist slate (3.90:1 on #FFFFFF — structural rules/comments recede cleanly)
|
|
1394
|
+
success: { hex: "267347", ansiFallback: "\x1B[32m" },
|
|
1395
|
+
// pine forest green (5.61:1 on #FFFFFF)
|
|
1396
|
+
warning: { hex: "966014", ansiFallback: "\x1B[33m" },
|
|
1397
|
+
// warm sand amber (5.38:1 on #FFFFFF, never muddy yellow)
|
|
1398
|
+
info: { hex: "1B6F8A", ansiFallback: "\x1B[36m" },
|
|
1399
|
+
// fjord cyan-blue (5.77:1 on #FFFFFF, distinct from accent)
|
|
1400
|
+
danger: { hex: "BE3428", ansiFallback: "\x1B[31m" },
|
|
1401
|
+
// terracotta red (5.68:1 on #FFFFFF)
|
|
1402
|
+
muted: { hex: "525D6B", ansiFallback: "\x1B[90m" }
|
|
1403
|
+
// mountain granite (6.73:1 on #FFFFFF — crisp secondary copy)
|
|
1404
|
+
},
|
|
1405
|
+
dark: {
|
|
1406
|
+
accent: { hex: "6AA8EA", ansiFallback: "\x1B[94m" },
|
|
1407
|
+
// moonlight ocean (--hl-blue dark, 6.89:1 on #1C1C1F)
|
|
1408
|
+
chrome: { hex: "6E7683", ansiFallback: "\x1B[90m" },
|
|
1409
|
+
// night stone (3.69:1 on #1C1C1F — clear rules/comments below muted)
|
|
1410
|
+
success: { hex: "72C488", ansiFallback: "\x1B[32m" },
|
|
1411
|
+
// alpine meadow green (8.22:1 on #1C1C1F)
|
|
1412
|
+
warning: { hex: "DDA955", ansiFallback: "\x1B[33m" },
|
|
1413
|
+
// sunset sand gold (7.98:1 on #1C1C1F)
|
|
1414
|
+
info: { hex: "5EB5C8", ansiFallback: "\x1B[36m" },
|
|
1415
|
+
// glacier stream cyan (7.36:1 on #1C1C1F)
|
|
1416
|
+
danger: { hex: "E6766B", ansiFallback: "\x1B[31m" },
|
|
1417
|
+
// warm coral clay (5.86:1 on #1C1C1F)
|
|
1418
|
+
muted: { hex: "9AA3B0", ansiFallback: "\x1B[90m" }
|
|
1419
|
+
// silver mist (6.67:1 on #1C1C1F — legible status & tool details)
|
|
1420
|
+
}
|
|
1421
|
+
},
|
|
1382
1422
|
trail: {
|
|
1383
1423
|
light: {
|
|
1384
1424
|
accent: { hex: "2E7DB5", ansiFallback: "\x1B[34m" },
|
|
@@ -1389,8 +1429,8 @@ var THEME_PALETTES = {
|
|
|
1389
1429
|
// moss green
|
|
1390
1430
|
warning: { hex: "9A6A1F", ansiFallback: "\x1B[33m" },
|
|
1391
1431
|
// deeper amber — B57F2E still read as yellow/washed on white (H2 headers like ## Plan floated); 9A6A1F raises contrast
|
|
1392
|
-
info: { hex: "
|
|
1393
|
-
// sky blue
|
|
1432
|
+
info: { hex: "2376A6", ansiFallback: "\x1B[36m" },
|
|
1433
|
+
// deepened sky blue (5.05:1 on white; 4A9FD4 was only 3.0:1)
|
|
1394
1434
|
danger: { hex: "C45C4A", ansiFallback: "\x1B[31m" },
|
|
1395
1435
|
// reddish
|
|
1396
1436
|
muted: { hex: "5E6A78", ansiFallback: "\x1B[90m" }
|
|
@@ -1399,7 +1439,7 @@ var THEME_PALETTES = {
|
|
|
1399
1439
|
dark: {
|
|
1400
1440
|
accent: { hex: "5BA3D9", ansiFallback: "\x1B[94m" },
|
|
1401
1441
|
// trail dark primary (was wrongly copied from catppuccin 89B4FA)
|
|
1402
|
-
chrome: { hex: "
|
|
1442
|
+
chrome: { hex: "747E91", ansiFallback: "\x1B[90m" },
|
|
1403
1443
|
success: { hex: "5CB87A", ansiFallback: "\x1B[32m" },
|
|
1404
1444
|
// trail dark success (was A6E3A1)
|
|
1405
1445
|
warning: { hex: "E6B35C", ansiFallback: "\x1B[33m" },
|
|
@@ -1415,17 +1455,19 @@ var THEME_PALETTES = {
|
|
|
1415
1455
|
catppuccin: {
|
|
1416
1456
|
light: {
|
|
1417
1457
|
accent: { hex: "0969DA", ansiFallback: "\x1B[34m" },
|
|
1418
|
-
chrome: { hex: "
|
|
1458
|
+
chrome: { hex: "77808B", ansiFallback: "\x1B[90m" },
|
|
1459
|
+
// lighter than muted so structural chrome recedes below secondary text
|
|
1419
1460
|
success: { hex: "116329", ansiFallback: "\x1B[32m" },
|
|
1420
1461
|
warning: { hex: "9A6700", ansiFallback: "\x1B[33m" },
|
|
1421
|
-
info: { hex: "
|
|
1462
|
+
info: { hex: "0E7490", ansiFallback: "\x1B[36m" },
|
|
1463
|
+
// distinct cyan-teal rather than duplicating accent
|
|
1422
1464
|
danger: { hex: "CF222E", ansiFallback: "\x1B[31m" },
|
|
1423
|
-
muted: { hex: "
|
|
1465
|
+
muted: { hex: "57606A", ansiFallback: "\x1B[90m" }
|
|
1424
1466
|
},
|
|
1425
1467
|
dark: {
|
|
1426
1468
|
accent: { hex: "89B4FA", ansiFallback: "\x1B[94m" },
|
|
1427
1469
|
// Catppuccin Mocha Blue
|
|
1428
|
-
chrome: { hex: "
|
|
1470
|
+
chrome: { hex: "7F849C", ansiFallback: "\x1B[90m" },
|
|
1429
1471
|
success: { hex: "A6E3A1", ansiFallback: "\x1B[32m" },
|
|
1430
1472
|
warning: { hex: "F9E2AF", ansiFallback: "\x1B[33m" },
|
|
1431
1473
|
info: { hex: "89B4FA", ansiFallback: "\x1B[36m" },
|
|
@@ -1516,7 +1558,7 @@ var THEME_PALETTES = {
|
|
|
1516
1558
|
}
|
|
1517
1559
|
}
|
|
1518
1560
|
};
|
|
1519
|
-
var activeThemeName = "
|
|
1561
|
+
var activeThemeName = "nature";
|
|
1520
1562
|
function getActiveThemeName() {
|
|
1521
1563
|
return activeThemeName;
|
|
1522
1564
|
}
|
|
@@ -1529,15 +1571,21 @@ function setActiveThemeName(name) {
|
|
|
1529
1571
|
}
|
|
1530
1572
|
var activeThemeMode = "terminal";
|
|
1531
1573
|
var resolvedBrightness = null;
|
|
1574
|
+
var terminalModeExplicit = false;
|
|
1532
1575
|
function getActiveThemeMode() {
|
|
1533
1576
|
return activeThemeMode;
|
|
1534
1577
|
}
|
|
1535
|
-
function setActiveThemeMode(mode) {
|
|
1578
|
+
function setActiveThemeMode(mode, options) {
|
|
1536
1579
|
activeThemeMode = mode;
|
|
1537
|
-
if (mode === "terminal")
|
|
1580
|
+
if (mode === "terminal") {
|
|
1581
|
+
resolvedBrightness = null;
|
|
1582
|
+
terminalModeExplicit = options?.explicit === true;
|
|
1583
|
+
} else {
|
|
1584
|
+
terminalModeExplicit = false;
|
|
1585
|
+
}
|
|
1538
1586
|
}
|
|
1539
|
-
function setActiveBrightness(brightness) {
|
|
1540
|
-
setActiveThemeMode(brightness ?? "terminal");
|
|
1587
|
+
function setActiveBrightness(brightness, options) {
|
|
1588
|
+
setActiveThemeMode(brightness ?? "terminal", options);
|
|
1541
1589
|
}
|
|
1542
1590
|
var TRUECOLOR_TERM_PROGRAMS = /* @__PURE__ */ new Set([
|
|
1543
1591
|
"iterm.app",
|
|
@@ -1547,13 +1595,17 @@ var TRUECOLOR_TERM_PROGRAMS = /* @__PURE__ */ new Set([
|
|
|
1547
1595
|
"hyper",
|
|
1548
1596
|
"tabby",
|
|
1549
1597
|
"rio",
|
|
1550
|
-
"warpterminal"
|
|
1598
|
+
"warpterminal",
|
|
1599
|
+
"ptyxis"
|
|
1551
1600
|
]);
|
|
1552
1601
|
function supportsTruecolor(env = process.env) {
|
|
1553
1602
|
const explicit = (env.NOLO_TUI_TRUECOLOR ?? "").trim().toLowerCase();
|
|
1554
1603
|
if (explicit === "1" || explicit === "true") return true;
|
|
1555
1604
|
if (explicit === "0" || explicit === "false") return false;
|
|
1556
1605
|
if ((env.WT_SESSION ?? "").trim()) return true;
|
|
1606
|
+
if ((env.PTYXIS_VERSION ?? "").trim()) return true;
|
|
1607
|
+
const vteVersion = Number.parseInt((env.VTE_VERSION ?? "").trim(), 10);
|
|
1608
|
+
if (Number.isFinite(vteVersion) && vteVersion >= 3600) return true;
|
|
1557
1609
|
if (/truecolor|24bit/i.test(env.COLORTERM ?? "")) return true;
|
|
1558
1610
|
if (/direct|24bit/i.test(env.TERM ?? "")) return true;
|
|
1559
1611
|
const program = (env.TERM_PROGRAM ?? "").toLowerCase();
|
|
@@ -1603,18 +1655,121 @@ function hexToSgrParams(hex) {
|
|
|
1603
1655
|
const b = Number.parseInt(hex.slice(4, 6), 16);
|
|
1604
1656
|
return `38;2;${r};${g};${b}`;
|
|
1605
1657
|
}
|
|
1606
|
-
function
|
|
1607
|
-
|
|
1658
|
+
function relativeLuminanceFromHex(hex) {
|
|
1659
|
+
const channels = readHexChannels(hex.replace(/^#/, "").toUpperCase());
|
|
1660
|
+
if (!channels) return null;
|
|
1661
|
+
const linearize = (byte) => {
|
|
1662
|
+
const s = byte / 255;
|
|
1663
|
+
return s <= 0.04045 ? s / 12.92 : ((s + 0.055) / 1.055) ** 2.4;
|
|
1664
|
+
};
|
|
1665
|
+
return 0.2126 * linearize(channels[0]) + 0.7152 * linearize(channels[1]) + 0.0722 * linearize(channels[2]);
|
|
1666
|
+
}
|
|
1667
|
+
function wcagContrastRatio(fgHex, bgHex) {
|
|
1668
|
+
const l1 = relativeLuminanceFromHex(fgHex);
|
|
1669
|
+
const l2 = relativeLuminanceFromHex(bgHex);
|
|
1670
|
+
if (l1 === null || l2 === null) return null;
|
|
1671
|
+
const lighter = Math.max(l1, l2);
|
|
1672
|
+
const darker = Math.min(l1, l2);
|
|
1673
|
+
return (lighter + 0.05) / (darker + 0.05);
|
|
1674
|
+
}
|
|
1675
|
+
var POLE_LIGHT_NEUTRAL = "F7F9FC";
|
|
1676
|
+
var POLE_DARK_NEUTRAL = "0A0C10";
|
|
1677
|
+
var POLE_LIGHT_EXTREME = "FFFFFF";
|
|
1678
|
+
var POLE_DARK_EXTREME = "000000";
|
|
1679
|
+
function solveBlendForContrast(sourceHex, anchorHex, canvasHex, targetRatio) {
|
|
1680
|
+
let lo = 0;
|
|
1681
|
+
let hi = 1;
|
|
1682
|
+
let best = sourceHex;
|
|
1683
|
+
let bestErr = Math.abs((wcagContrastRatio(sourceHex, canvasHex) ?? targetRatio) - targetRatio);
|
|
1684
|
+
for (let step = 0; step < 16; step++) {
|
|
1685
|
+
const mid = (lo + hi) / 2;
|
|
1686
|
+
const candidate = blendHex(anchorHex, sourceHex, mid);
|
|
1687
|
+
const ratio = wcagContrastRatio(candidate, canvasHex) ?? targetRatio;
|
|
1688
|
+
const err = Math.abs(ratio - targetRatio);
|
|
1689
|
+
if (err < bestErr) {
|
|
1690
|
+
bestErr = err;
|
|
1691
|
+
best = candidate;
|
|
1692
|
+
}
|
|
1693
|
+
const anchorRatio = wcagContrastRatio(anchorHex, canvasHex) ?? targetRatio;
|
|
1694
|
+
const sourceRatio = wcagContrastRatio(sourceHex, canvasHex) ?? targetRatio;
|
|
1695
|
+
const increasing = anchorRatio >= sourceRatio;
|
|
1696
|
+
if (increasing && ratio < targetRatio || !increasing && ratio > targetRatio) {
|
|
1697
|
+
lo = mid;
|
|
1698
|
+
} else {
|
|
1699
|
+
hi = mid;
|
|
1700
|
+
}
|
|
1701
|
+
}
|
|
1702
|
+
return best;
|
|
1703
|
+
}
|
|
1704
|
+
function adaptTokenHexToCanvas(rawHex, tokenKey, canvasHex) {
|
|
1705
|
+
const normRaw = rawHex.replace(/^#/, "").toUpperCase();
|
|
1706
|
+
const normCanvas = canvasHex.replace(/^#/, "").toUpperCase();
|
|
1707
|
+
const canvasLum = relativeLuminanceFromHex(normCanvas);
|
|
1708
|
+
const ratio = wcagContrastRatio(normRaw, normCanvas);
|
|
1709
|
+
if (canvasLum === null || ratio === null) return normRaw;
|
|
1710
|
+
if (tokenKey === "chrome") {
|
|
1711
|
+
if (ratio < 3.25) return pushToContrast(normRaw, normCanvas, 3.7, 3.3);
|
|
1712
|
+
if (ratio > 4.45) return solveBlendForContrast(normRaw, normCanvas, normCanvas, 3.85);
|
|
1713
|
+
return normRaw;
|
|
1714
|
+
}
|
|
1715
|
+
if (tokenKey === "muted") {
|
|
1716
|
+
if (ratio < 5.2) return pushToContrast(normRaw, normCanvas, 6.1, 6.1);
|
|
1717
|
+
if (ratio > 8.2) return solveBlendForContrast(normRaw, normCanvas, normCanvas, 6.6);
|
|
1718
|
+
return normRaw;
|
|
1719
|
+
}
|
|
1720
|
+
if (ratio < 4.5) {
|
|
1721
|
+
return pushToContrast(normRaw, normCanvas, 4.85, 4.55);
|
|
1722
|
+
}
|
|
1723
|
+
return normRaw;
|
|
1724
|
+
}
|
|
1725
|
+
function polesByReach(canvasHex) {
|
|
1726
|
+
const ranked = [
|
|
1727
|
+
POLE_LIGHT_NEUTRAL,
|
|
1728
|
+
POLE_DARK_NEUTRAL,
|
|
1729
|
+
POLE_LIGHT_EXTREME,
|
|
1730
|
+
POLE_DARK_EXTREME
|
|
1731
|
+
].map((pole) => ({ pole, reach: wcagContrastRatio(pole, canvasHex) ?? 1 }));
|
|
1732
|
+
const neutralFirst = (pole) => pole === POLE_LIGHT_NEUTRAL || pole === POLE_DARK_NEUTRAL ? 0 : 1;
|
|
1733
|
+
ranked.sort(
|
|
1734
|
+
(a, b) => a.reach !== b.reach ? b.reach - a.reach : neutralFirst(a.pole) - neutralFirst(b.pole)
|
|
1735
|
+
);
|
|
1736
|
+
return ranked.map((r) => r.pole);
|
|
1737
|
+
}
|
|
1738
|
+
function pushToContrast(rawHex, canvasHex, target, floor) {
|
|
1739
|
+
const poles = polesByReach(canvasHex);
|
|
1740
|
+
for (const pole of poles) {
|
|
1741
|
+
if ((wcagContrastRatio(pole, canvasHex) ?? 1) > target) {
|
|
1742
|
+
return solveBlendForContrast(rawHex, pole, canvasHex, target);
|
|
1743
|
+
}
|
|
1744
|
+
}
|
|
1745
|
+
const best = poles[0];
|
|
1746
|
+
if ((wcagContrastRatio(best, canvasHex) ?? 1) > floor) {
|
|
1747
|
+
return solveBlendForContrast(rawHex, best, canvasHex, floor);
|
|
1748
|
+
}
|
|
1749
|
+
return best;
|
|
1750
|
+
}
|
|
1751
|
+
function shouldUseTruecolorTokens(env) {
|
|
1752
|
+
if (!supportsTruecolor(env)) return false;
|
|
1753
|
+
const explicit = (env.NOLO_TUI_THEME ?? "").trim().toLowerCase();
|
|
1754
|
+
if (explicit === "terminal" || explicit === "ansi") return false;
|
|
1755
|
+
if (resolveTuiThemeMode(env) !== "terminal") return true;
|
|
1756
|
+
if (terminalModeExplicit) return false;
|
|
1757
|
+
return activeTerminalBaseHex !== null || detectColorFgBgBrightness(env) !== null;
|
|
1608
1758
|
}
|
|
1609
1759
|
function themeSgrParams(token, env = process.env, brightness = resolveTuiBrightness(env)) {
|
|
1610
|
-
const palette = THEME_PALETTES[activeThemeName] ?? THEME_PALETTES.
|
|
1760
|
+
const palette = THEME_PALETTES[activeThemeName] ?? THEME_PALETTES.nature;
|
|
1611
1761
|
const entry = palette[brightness][token];
|
|
1612
|
-
|
|
1762
|
+
if (!shouldUseTruecolorTokens(env)) {
|
|
1763
|
+
return entry.ansiFallback.slice(2, -1);
|
|
1764
|
+
}
|
|
1765
|
+
const effectiveHex = activeTerminalBaseHex ? adaptTokenHexToCanvas(entry.hex, token, activeTerminalBaseHex) : entry.hex;
|
|
1766
|
+
return hexToSgrParams(effectiveHex);
|
|
1613
1767
|
}
|
|
1614
1768
|
function themeColorSequence(token, env = process.env, brightness = resolveTuiBrightness(env)) {
|
|
1615
1769
|
return `\x1B[${themeSgrParams(token, env, brightness)}m`;
|
|
1616
1770
|
}
|
|
1617
1771
|
var SURFACE_HEX = {
|
|
1772
|
+
nature: { light: "EBF0F5", dark: "262932" },
|
|
1618
1773
|
trail: { light: "E4E8EC", dark: "313244" },
|
|
1619
1774
|
catppuccin: { light: "E8ECF0", dark: "181825" },
|
|
1620
1775
|
wave: { light: "E5E1D6", dark: "2A2A37" },
|
|
@@ -1636,6 +1791,7 @@ function setActiveTerminalBaseHex(hex) {
|
|
|
1636
1791
|
}
|
|
1637
1792
|
function resetWorkspaceThemeState() {
|
|
1638
1793
|
setActiveThemeMode("terminal");
|
|
1794
|
+
terminalModeExplicit = false;
|
|
1639
1795
|
setActiveTerminalBaseHex(null);
|
|
1640
1796
|
}
|
|
1641
1797
|
function applyDetectedBackground(detected) {
|
|
@@ -1682,37 +1838,40 @@ function blendHex(fg, base, weight) {
|
|
|
1682
1838
|
return `${r}${g}${b}`;
|
|
1683
1839
|
}
|
|
1684
1840
|
function diffLineSequences(env = process.env, brightness = resolveTuiBrightness(env)) {
|
|
1685
|
-
if (
|
|
1686
|
-
|
|
1687
|
-
const palette = THEME_PALETTES[activeThemeName] ?? THEME_PALETTES.trail;
|
|
1841
|
+
if (resolveSurfaceWashFallback(env) !== null) return null;
|
|
1842
|
+
const palette = THEME_PALETTES[activeThemeName] ?? THEME_PALETTES.nature;
|
|
1688
1843
|
const successHex = palette[brightness].success.hex;
|
|
1689
1844
|
const dangerHex = palette[brightness].danger.hex;
|
|
1690
1845
|
const infoHex = palette[brightness].info.hex;
|
|
1691
|
-
const weight = brightness === "dark" ? 0.
|
|
1846
|
+
const weight = brightness === "dark" ? 0.15 : 0.1;
|
|
1692
1847
|
const baseHex = resolveTerminalBaseHex(brightness);
|
|
1693
1848
|
const addedBgHex = blendHex(successHex, baseHex, weight);
|
|
1694
1849
|
const removedBgHex = blendHex(dangerHex, baseHex, weight);
|
|
1695
1850
|
const hunkBgHex = blendHex(infoHex, baseHex, weight * 0.6);
|
|
1696
|
-
const successSgr =
|
|
1697
|
-
const dangerSgr =
|
|
1698
|
-
const infoSgr =
|
|
1851
|
+
const successSgr = themeColorSequence("success", env, brightness);
|
|
1852
|
+
const dangerSgr = themeColorSequence("danger", env, brightness);
|
|
1853
|
+
const infoSgr = themeColorSequence("info", env, brightness);
|
|
1699
1854
|
return {
|
|
1700
1855
|
added: {
|
|
1701
1856
|
fg: successSgr,
|
|
1702
1857
|
bg: hexToBgSgr(addedBgHex),
|
|
1703
|
-
bar: `${successSgr}\
|
|
1858
|
+
bar: `${successSgr}\u258E\x1B[39m`
|
|
1704
1859
|
},
|
|
1705
1860
|
removed: {
|
|
1706
1861
|
fg: dangerSgr,
|
|
1707
1862
|
bg: hexToBgSgr(removedBgHex),
|
|
1708
|
-
bar: `${dangerSgr}\
|
|
1863
|
+
bar: `${dangerSgr}\u258E\x1B[39m`
|
|
1709
1864
|
},
|
|
1710
1865
|
hunk: {
|
|
1711
1866
|
fg: infoSgr,
|
|
1712
1867
|
bg: hexToBgSgr(hunkBgHex),
|
|
1713
|
-
bar:
|
|
1868
|
+
bar: `${infoSgr}\u258E\x1B[39m`
|
|
1714
1869
|
},
|
|
1715
|
-
context: {
|
|
1870
|
+
context: {
|
|
1871
|
+
fg: "",
|
|
1872
|
+
bg: "",
|
|
1873
|
+
bar: `${themeColorSequence("chrome", env, brightness)}\u258E\x1B[39m`
|
|
1874
|
+
}
|
|
1716
1875
|
};
|
|
1717
1876
|
}
|
|
1718
1877
|
function renderSurfaceLine(args) {
|
|
@@ -1723,10 +1882,24 @@ function renderSurfaceLine(args) {
|
|
|
1723
1882
|
return `${surface}${reopened}${padding}\x1B[0m`;
|
|
1724
1883
|
}
|
|
1725
1884
|
function renderDiffLine(args) {
|
|
1726
|
-
const { kind, text, highlightedText } = args;
|
|
1885
|
+
const { kind, text, highlightedText, gutter } = args;
|
|
1727
1886
|
const env = args.env ?? process.env;
|
|
1728
1887
|
const colorEnabled = args.colorEnabled ?? resolveCliColorEnabled();
|
|
1729
1888
|
if (!colorEnabled) return text;
|
|
1889
|
+
if (gutter) {
|
|
1890
|
+
const charset = args.boxCharset ?? resolveBoxCharset(resolveAmbiguousWidth(void 0, env), env);
|
|
1891
|
+
const railGlyph = charset === "ascii" ? "|" : "\u258E";
|
|
1892
|
+
const railTone = kind === "added" ? "success" : kind === "removed" ? "danger" : kind === "hunk" ? "info" : "chrome";
|
|
1893
|
+
const rail = `${themeColorSequence(railTone, env)}${railGlyph}\x1B[39m`;
|
|
1894
|
+
const body = highlightedText ?? (kind === "context" ? text : `${themeColorSequence(railTone, env)}${text}`);
|
|
1895
|
+
const closedBody = body.endsWith("\x1B[0m") ? body : `${body}\x1B[0m`;
|
|
1896
|
+
const seq2 = diffLineSequences(env)?.[kind];
|
|
1897
|
+
return `${rail} ${seq2?.bg ? renderSurfaceLine({
|
|
1898
|
+
text: body,
|
|
1899
|
+
surface: seq2.bg,
|
|
1900
|
+
padTo: args.padTo ?? visibleWidth(text)
|
|
1901
|
+
}) : closedBody}`;
|
|
1902
|
+
}
|
|
1730
1903
|
const seqs = diffLineSequences(env);
|
|
1731
1904
|
if (!seqs) {
|
|
1732
1905
|
if (kind === "context") return highlightedText ?? text;
|
|
@@ -1776,9 +1949,9 @@ function themeText(text, token, colorEnabled = resolveCliColorEnabled(), env = p
|
|
|
1776
1949
|
}
|
|
1777
1950
|
function tuiRenderThemeFingerprint(colorEnabled, env = process.env) {
|
|
1778
1951
|
const mode = resolveTuiThemeMode(env);
|
|
1779
|
-
const colorKind = !colorEnabled ? "plain" :
|
|
1952
|
+
const colorKind = !colorEnabled ? "plain" : shouldUseTruecolorTokens(env) ? "truecolor" : "ansi";
|
|
1780
1953
|
const surface = colorEnabled ? userSurfaceBackgroundSequence(env) : "";
|
|
1781
|
-
return `${activeThemeName}|${mode}|${colorKind}|${surface}`;
|
|
1954
|
+
return `${activeThemeName}|${mode}|${colorKind}|${resolveTuiBrightness(env)}|${activeTerminalBaseHex ?? ""}|${env.COLORFGBG ?? ""}|${surface}`;
|
|
1782
1955
|
}
|
|
1783
1956
|
function classifyDiffLine(line) {
|
|
1784
1957
|
if (line.startsWith("@@")) return "hunk";
|
|
@@ -7299,6 +7472,59 @@ function renderMermaidBlock(source, brightness, colorEnabled = true, cols) {
|
|
|
7299
7472
|
return toAnsi(art, themeAnsiTheme(brightness)).join("\n");
|
|
7300
7473
|
}
|
|
7301
7474
|
|
|
7475
|
+
// packages/cli/tui/tuiUrlOpener.ts
|
|
7476
|
+
import { spawn as nodeSpawn } from "node:child_process";
|
|
7477
|
+
var MAX_URL_LENGTH = 2048;
|
|
7478
|
+
function normalizeHttpUrl(raw) {
|
|
7479
|
+
const trimmed = raw.trim();
|
|
7480
|
+
if (trimmed.length === 0 || trimmed.length > MAX_URL_LENGTH) return null;
|
|
7481
|
+
if (/[\u0000-\u001f\u007f]/.test(trimmed)) return null;
|
|
7482
|
+
let parsed;
|
|
7483
|
+
try {
|
|
7484
|
+
parsed = new URL(trimmed);
|
|
7485
|
+
} catch {
|
|
7486
|
+
return null;
|
|
7487
|
+
}
|
|
7488
|
+
if (parsed.protocol !== "http:" && parsed.protocol !== "https:") return null;
|
|
7489
|
+
if (parsed.hostname.length === 0) return null;
|
|
7490
|
+
return trimmed;
|
|
7491
|
+
}
|
|
7492
|
+
function resolveUrlOpenCommand(platform, url) {
|
|
7493
|
+
if (normalizeHttpUrl(url) === null) return null;
|
|
7494
|
+
if (platform === "darwin") {
|
|
7495
|
+
return { command: "open", args: [url] };
|
|
7496
|
+
}
|
|
7497
|
+
if (platform === "win32") {
|
|
7498
|
+
return { command: "rundll32.exe", args: ["url.dll,FileProtocolHandler", url] };
|
|
7499
|
+
}
|
|
7500
|
+
return { command: "xdg-open", args: [url] };
|
|
7501
|
+
}
|
|
7502
|
+
function openExternalUrl(raw, options = {}) {
|
|
7503
|
+
const url = normalizeHttpUrl(raw);
|
|
7504
|
+
if (url === null) return false;
|
|
7505
|
+
const resolved = resolveUrlOpenCommand(options.platform ?? process.platform, url);
|
|
7506
|
+
if (!resolved) return false;
|
|
7507
|
+
const spawnImpl = options.spawnImpl ?? nodeSpawn;
|
|
7508
|
+
const report = (error) => {
|
|
7509
|
+
try {
|
|
7510
|
+
options.onError?.(error instanceof Error ? error.message : String(error));
|
|
7511
|
+
} catch {
|
|
7512
|
+
}
|
|
7513
|
+
};
|
|
7514
|
+
try {
|
|
7515
|
+
const child = spawnImpl(resolved.command, resolved.args, {
|
|
7516
|
+
detached: true,
|
|
7517
|
+
stdio: "ignore"
|
|
7518
|
+
});
|
|
7519
|
+
child.on?.("error", report);
|
|
7520
|
+
child.unref?.();
|
|
7521
|
+
return true;
|
|
7522
|
+
} catch (error) {
|
|
7523
|
+
report(error);
|
|
7524
|
+
return false;
|
|
7525
|
+
}
|
|
7526
|
+
}
|
|
7527
|
+
|
|
7302
7528
|
// packages/cli/client/mathText.ts
|
|
7303
7529
|
var mathRenderingEnabled = true;
|
|
7304
7530
|
function setMathRenderingEnabled(enabled) {
|
|
@@ -7863,19 +8089,42 @@ var STYLE = {
|
|
|
7863
8089
|
function colorSeq(token, brightness) {
|
|
7864
8090
|
return themeColorSequence(token, process.env, brightness);
|
|
7865
8091
|
}
|
|
7866
|
-
function renderMarkdownLink(
|
|
7867
|
-
const
|
|
7868
|
-
|
|
8092
|
+
function renderMarkdownLink(text, url, brightness) {
|
|
8093
|
+
const safeText = sanitizeHyperlinkLabel(text);
|
|
8094
|
+
const safeHttpUrl = normalizeHttpUrl(url);
|
|
8095
|
+
if (safeHttpUrl === null) {
|
|
8096
|
+
const safeRawUrl = sanitizeHyperlinkLabel(url);
|
|
8097
|
+
return safeText.trim() === safeRawUrl.trim() ? safeText : `${safeText} (${safeRawUrl})`;
|
|
8098
|
+
}
|
|
8099
|
+
const sameAsUrl = safeText.trim() === safeHttpUrl.trim();
|
|
8100
|
+
if (!resolveCliHyperlinkEnabled()) {
|
|
8101
|
+
return sameAsUrl ? safeText : `${safeText} (${safeHttpUrl})`;
|
|
8102
|
+
}
|
|
8103
|
+
const colorEnabled = resolveCliColorEnabled();
|
|
8104
|
+
if (sameAsUrl || !safeText.trim()) {
|
|
8105
|
+
const label = safeText.trim() ? safeText : safeHttpUrl;
|
|
8106
|
+
if (!colorEnabled) {
|
|
8107
|
+
return `\x1B]8;;${safeHttpUrl}\x1B\\${label}\x1B]8;;\x1B\\`;
|
|
8108
|
+
}
|
|
8109
|
+
const linkColor2 = colorSeq("accent", brightness);
|
|
8110
|
+
return `\x1B]8;;${safeHttpUrl}\x1B\\\x1B[4m${linkColor2}${label}${STYLE.reset}\x1B]8;;\x1B\\`;
|
|
8111
|
+
}
|
|
8112
|
+
if (!colorEnabled) {
|
|
8113
|
+
return `\x1B]8;;${safeHttpUrl}\x1B\\${safeText} \u2197\x1B]8;;\x1B\\`;
|
|
8114
|
+
}
|
|
8115
|
+
const linkColor = colorSeq("accent", brightness);
|
|
8116
|
+
const muted = colorSeq("muted", brightness);
|
|
8117
|
+
return `\x1B]8;;${safeHttpUrl}\x1B\\\x1B[4m${linkColor}${safeText}${STYLE.reset}${muted} \u2197${STYLE.reset}\x1B]8;;\x1B\\`;
|
|
7869
8118
|
}
|
|
7870
8119
|
var MARKDOWN_LINK_RE = /\[([^\]]+)\]\(([^)\s]+)\)/g;
|
|
7871
8120
|
function styleInlineMarkdown(line, brightness) {
|
|
7872
|
-
const inlineCode = colorSeq("
|
|
8121
|
+
const inlineCode = colorSeq("info", brightness);
|
|
7873
8122
|
const reset = STYLE.reset;
|
|
7874
8123
|
const bold = STYLE.bold;
|
|
7875
8124
|
const dim = STYLE.dim;
|
|
7876
8125
|
const zwsCode = "\u200B";
|
|
7877
8126
|
const mathMask = maskMathInLine(line, brightness);
|
|
7878
|
-
const styled = mathMask.maskedText.replace(MARKDOWN_LINK_RE, (
|
|
8127
|
+
const styled = mathMask.maskedText.replace(MARKDOWN_LINK_RE, (_m, t2, u) => renderMarkdownLink(t2, u, brightness)).replace(
|
|
7879
8128
|
/\u200b([^\u200b\n]+)\u200b/g,
|
|
7880
8129
|
(_m, inner) => `${zwsCode}${inlineCode}${inner}${reset}${zwsCode}`
|
|
7881
8130
|
).replace(/`([^`]+)`/g, `${inlineCode}$1${reset}`).replace(/\*\*(.+?)\*\*/g, `${bold}$1${reset}`).replace(/(?<!\*)\*([^*]+?)\*(?!\*)/g, `${dim}$1${reset}`).replace(/~~([^~]+?)~~/g, `${dim}\x1B[9m$1\x1B[29m${reset}`);
|
|
@@ -8396,24 +8645,23 @@ function highlightCodeLine(line, lang, brightness) {
|
|
|
8396
8645
|
const success = colorSeq("success", brightness);
|
|
8397
8646
|
const warning = colorSeq("warning", brightness);
|
|
8398
8647
|
const chrome = colorSeq("chrome", brightness);
|
|
8399
|
-
const dim = STYLE.dim;
|
|
8400
8648
|
const reset = STYLE.reset;
|
|
8401
8649
|
const out = [];
|
|
8402
8650
|
let cursor = 0;
|
|
8403
8651
|
for (const region of regions) {
|
|
8404
8652
|
if (region.start > cursor) {
|
|
8405
|
-
out.push(emitPlainGap(line.slice(cursor, region.start), keywords,
|
|
8653
|
+
out.push(emitPlainGap(line.slice(cursor, region.start), keywords, "\x1B[39m", accent, warning, reset));
|
|
8406
8654
|
}
|
|
8407
8655
|
const text = line.slice(region.start, region.end);
|
|
8408
8656
|
if (region.kind === "string") {
|
|
8409
8657
|
out.push(`${success}${text}${reset}`);
|
|
8410
8658
|
} else {
|
|
8411
|
-
out.push(`${chrome}${
|
|
8659
|
+
out.push(`${chrome}${text}${reset}`);
|
|
8412
8660
|
}
|
|
8413
8661
|
cursor = region.end;
|
|
8414
8662
|
}
|
|
8415
8663
|
if (cursor < line.length) {
|
|
8416
|
-
out.push(emitPlainGap(line.slice(cursor), keywords,
|
|
8664
|
+
out.push(emitPlainGap(line.slice(cursor), keywords, "\x1B[39m", accent, warning, reset));
|
|
8417
8665
|
}
|
|
8418
8666
|
return out.join("");
|
|
8419
8667
|
}
|
|
@@ -8529,7 +8777,7 @@ function styleToolDetailSegments(detail, muted, chrome) {
|
|
|
8529
8777
|
if (!metaMatch) {
|
|
8530
8778
|
return `${muted}${detail}${STYLE.reset}`;
|
|
8531
8779
|
}
|
|
8532
|
-
return `${muted}${metaMatch[1]}${STYLE.reset}${chrome}${
|
|
8780
|
+
return `${muted}${metaMatch[1]}${STYLE.reset}${chrome}${metaMatch[2]}${STYLE.reset}`;
|
|
8533
8781
|
}
|
|
8534
8782
|
function styleTuiToolLine(line, brightness) {
|
|
8535
8783
|
const plain = plainToolLine(line);
|
|
@@ -8540,13 +8788,13 @@ function styleTuiToolLine(line, brightness) {
|
|
|
8540
8788
|
const header = toolTreeHeaderMatch(plain);
|
|
8541
8789
|
if (header) {
|
|
8542
8790
|
const glyph = plain.startsWith("\u2022") ? "\u2022" : "\u25B8";
|
|
8543
|
-
return `${chrome}${glyph}${STYLE.reset} ${STYLE.bold}${
|
|
8791
|
+
return `${chrome}${glyph}${STYLE.reset} ${STYLE.bold}${muted}${header[1]}${STYLE.reset} ${chrome}(${header[2]})${STYLE.reset} ${chrome}\xB7${STYLE.reset} ${muted}${header[3]}${STYLE.reset} ${statusColorSeq("\u2713", brightness)}\u2713${STYLE.reset}`;
|
|
8544
8792
|
}
|
|
8545
8793
|
const single = plain.match(TOOL_SINGLE_RE);
|
|
8546
8794
|
if (single) {
|
|
8547
8795
|
const [, label, detail, marker, statusDetail] = single;
|
|
8548
8796
|
const isError = marker === "\u2717";
|
|
8549
|
-
const labelColor = isError ? danger :
|
|
8797
|
+
const labelColor = isError ? danger : muted;
|
|
8550
8798
|
let rendered = `${chrome}\u25B8${STYLE.reset} ${STYLE.bold}${labelColor}${label}${STYLE.reset}`;
|
|
8551
8799
|
if (detail) {
|
|
8552
8800
|
rendered += ` ${chrome}\xB7${STYLE.reset} ${styleToolDetailSegments(detail, muted, chrome)}`;
|
|
@@ -8556,7 +8804,7 @@ function styleTuiToolLine(line, brightness) {
|
|
|
8556
8804
|
if (isError) {
|
|
8557
8805
|
rendered += ` ${danger}${statusDetail}${STYLE.reset}`;
|
|
8558
8806
|
} else {
|
|
8559
|
-
rendered += ` ${chrome}${
|
|
8807
|
+
rendered += ` ${chrome}${statusDetail}${STYLE.reset}`;
|
|
8560
8808
|
}
|
|
8561
8809
|
}
|
|
8562
8810
|
return rendered;
|
|
@@ -8688,25 +8936,23 @@ function styleRichMarkdownLine(line, brightness) {
|
|
|
8688
8936
|
return `${STYLE.bold}${colorSeq("accent", brightness)}${styledTitle}${STYLE.reset}`;
|
|
8689
8937
|
}
|
|
8690
8938
|
if (level === 2) {
|
|
8691
|
-
return `${STYLE.bold}${colorSeq("warning", brightness)}${styledTitle}${STYLE.reset}`;
|
|
8692
|
-
}
|
|
8693
|
-
if (level === 3) {
|
|
8694
8939
|
return `${STYLE.bold}${colorSeq("info", brightness)}${styledTitle}${STYLE.reset}`;
|
|
8695
8940
|
}
|
|
8696
8941
|
return `${STYLE.bold}${colorSeq("muted", brightness)}${styledTitle}${STYLE.reset}`;
|
|
8697
8942
|
}
|
|
8698
8943
|
if (line.startsWith("\u8FDB\u5165 nolo-plan")) {
|
|
8699
|
-
return `${colorSeq("chrome", brightness)}${
|
|
8944
|
+
return `${colorSeq("chrome", brightness)}${line}${STYLE.reset}`;
|
|
8700
8945
|
}
|
|
8701
8946
|
const blockquote = line.match(/^>\s?(.*)$/);
|
|
8702
8947
|
if (blockquote) {
|
|
8703
8948
|
const border = colorSeq("chrome", brightness);
|
|
8949
|
+
const muted = colorSeq("muted", brightness);
|
|
8704
8950
|
const content = blockquote[1];
|
|
8705
|
-
const styled = styleInlineMarkdown(content, brightness);
|
|
8706
|
-
return `${border}\u2502${STYLE.reset} ${
|
|
8951
|
+
const styled = styleInlineMarkdown(content, brightness).split(STYLE.reset).join(`${STYLE.reset}${muted}`);
|
|
8952
|
+
return `${border}\u2502${STYLE.reset} ${muted}${styled}${STYLE.reset}`;
|
|
8707
8953
|
}
|
|
8708
8954
|
if (THEMATIC_BREAK_RE.test(line)) {
|
|
8709
|
-
return `${colorSeq("chrome", brightness)}${
|
|
8955
|
+
return `${colorSeq("chrome", brightness)}${boxGlyphs(resolveBoxCharset()).h.repeat(36)}${STYLE.reset}`;
|
|
8710
8956
|
}
|
|
8711
8957
|
const bullet = line.match(/^(\s*)(•)\s(.+)$/);
|
|
8712
8958
|
if (bullet) {
|
|
@@ -8728,6 +8974,26 @@ function styleRichMarkdownLine(line, brightness) {
|
|
|
8728
8974
|
}
|
|
8729
8975
|
return styleInlineMarkdown(line, brightness);
|
|
8730
8976
|
}
|
|
8977
|
+
var CODE_FENCE_RULE_WIDTH = 24;
|
|
8978
|
+
function renderCodeFenceOpen(rawLang, brightness) {
|
|
8979
|
+
const { h, tl } = boxGlyphs(resolveBoxCharset());
|
|
8980
|
+
const chrome = colorSeq("chrome", brightness);
|
|
8981
|
+
if (rawLang) {
|
|
8982
|
+
const tailLen = Math.max(4, CODE_FENCE_RULE_WIDTH - rawLang.length - 3);
|
|
8983
|
+
return `${chrome}${tl}${h} ${rawLang} ${h.repeat(tailLen)}${STYLE.reset}`;
|
|
8984
|
+
}
|
|
8985
|
+
return `${chrome}${tl}${h.repeat(CODE_FENCE_RULE_WIDTH)}${STYLE.reset}`;
|
|
8986
|
+
}
|
|
8987
|
+
function renderCodeFenceClose(brightness) {
|
|
8988
|
+
const { h, bl } = boxGlyphs(resolveBoxCharset());
|
|
8989
|
+
const chrome = colorSeq("chrome", brightness);
|
|
8990
|
+
return `${chrome}${bl}${h.repeat(CODE_FENCE_RULE_WIDTH)}${STYLE.reset}`;
|
|
8991
|
+
}
|
|
8992
|
+
function renderCodeFenceLine(line, lang, brightness) {
|
|
8993
|
+
const { v } = boxGlyphs(resolveBoxCharset());
|
|
8994
|
+
const chrome = colorSeq("chrome", brightness);
|
|
8995
|
+
return `${chrome}${v}${STYLE.reset} ${highlightCodeLine(line, lang, brightness)}`;
|
|
8996
|
+
}
|
|
8731
8997
|
var FenceTracker = class {
|
|
8732
8998
|
inFence = false;
|
|
8733
8999
|
inMermaid = false;
|
|
@@ -8754,15 +9020,15 @@ var FenceTracker = class {
|
|
|
8754
9020
|
this.fenceLang = "unknown";
|
|
8755
9021
|
return { kind: "close-code" };
|
|
8756
9022
|
}
|
|
8757
|
-
const
|
|
8758
|
-
this.fenceLang = normalizeCodeLang(
|
|
9023
|
+
const rawLang = readFenceLanguage(line);
|
|
9024
|
+
this.fenceLang = normalizeCodeLang(rawLang);
|
|
8759
9025
|
this.inFence = true;
|
|
8760
|
-
if (/^mermaid$/i.test(
|
|
9026
|
+
if (/^mermaid$/i.test(rawLang)) {
|
|
8761
9027
|
this.inMermaid = true;
|
|
8762
9028
|
this.mermaidBody = [];
|
|
8763
|
-
return { kind: "open" };
|
|
9029
|
+
return { kind: "open-mermaid" };
|
|
8764
9030
|
}
|
|
8765
|
-
return { kind: "open" };
|
|
9031
|
+
return { kind: "open-code", rawLang };
|
|
8766
9032
|
}
|
|
8767
9033
|
if (this.inMermaid) {
|
|
8768
9034
|
this.mermaidBody.push(line);
|
|
@@ -8810,21 +9076,25 @@ function formatAssistantDisplay(text, options = {}) {
|
|
|
8810
9076
|
const event = tracker.processLine(line);
|
|
8811
9077
|
if (event.kind === "close-mermaid") {
|
|
8812
9078
|
out.push(renderMermaidBody(event.body, brightness));
|
|
8813
|
-
out.push(`${STYLE.dim}${line}${STYLE.reset}`);
|
|
8814
9079
|
i++;
|
|
8815
9080
|
continue;
|
|
8816
9081
|
}
|
|
8817
|
-
if (event.kind === "open" || event.kind === "
|
|
8818
|
-
out.push(`${STYLE.dim}${line}${STYLE.reset}`);
|
|
9082
|
+
if (event.kind === "open-mermaid" || event.kind === "mermaid-body") {
|
|
8819
9083
|
i++;
|
|
8820
9084
|
continue;
|
|
8821
9085
|
}
|
|
8822
|
-
if (event.kind === "
|
|
9086
|
+
if (event.kind === "open-code") {
|
|
9087
|
+
out.push(renderCodeFenceOpen(event.rawLang, brightness));
|
|
9088
|
+
i++;
|
|
9089
|
+
continue;
|
|
9090
|
+
}
|
|
9091
|
+
if (event.kind === "close-code") {
|
|
9092
|
+
out.push(renderCodeFenceClose(brightness));
|
|
8823
9093
|
i++;
|
|
8824
9094
|
continue;
|
|
8825
9095
|
}
|
|
8826
9096
|
if (event.kind === "code-line") {
|
|
8827
|
-
out.push(
|
|
9097
|
+
out.push(renderCodeFenceLine(line, event.lang, brightness));
|
|
8828
9098
|
i++;
|
|
8829
9099
|
continue;
|
|
8830
9100
|
}
|
|
@@ -8950,17 +9220,30 @@ function createRenderAwareStreamWriter(args) {
|
|
|
8950
9220
|
if (event.kind === "close-mermaid") {
|
|
8951
9221
|
const diagram = renderMermaidBody(event.body, brightness);
|
|
8952
9222
|
args.write(diagram + "\n");
|
|
8953
|
-
|
|
8954
|
-
|
|
9223
|
+
lastKind = "fence";
|
|
9224
|
+
lastLine = firstLine;
|
|
9225
|
+
buffer = lines.slice(1).join("\n");
|
|
9226
|
+
continue;
|
|
9227
|
+
}
|
|
9228
|
+
if (event.kind === "open-mermaid") {
|
|
9229
|
+
emitBreathIfNeeded("fence", firstLine);
|
|
9230
|
+
lastKind = "fence";
|
|
9231
|
+
lastLine = firstLine;
|
|
9232
|
+
buffer = lines.slice(1).join("\n");
|
|
9233
|
+
continue;
|
|
9234
|
+
}
|
|
9235
|
+
if (event.kind === "open-code") {
|
|
9236
|
+
emitBreathIfNeeded("fence", firstLine);
|
|
9237
|
+
args.write(`${renderCodeFenceOpen(event.rawLang, brightness)}
|
|
8955
9238
|
`);
|
|
8956
9239
|
lastKind = "fence";
|
|
8957
9240
|
lastLine = firstLine;
|
|
8958
9241
|
buffer = lines.slice(1).join("\n");
|
|
8959
9242
|
continue;
|
|
8960
9243
|
}
|
|
8961
|
-
if (event.kind === "
|
|
8962
|
-
emitBreathIfNeeded("fence");
|
|
8963
|
-
args.write(`${
|
|
9244
|
+
if (event.kind === "close-code") {
|
|
9245
|
+
emitBreathIfNeeded("fence", firstLine);
|
|
9246
|
+
args.write(`${renderCodeFenceClose(brightness)}
|
|
8964
9247
|
`);
|
|
8965
9248
|
lastKind = "fence";
|
|
8966
9249
|
lastLine = firstLine;
|
|
@@ -8972,7 +9255,7 @@ function createRenderAwareStreamWriter(args) {
|
|
|
8972
9255
|
continue;
|
|
8973
9256
|
}
|
|
8974
9257
|
if (event.kind === "code-line") {
|
|
8975
|
-
args.write(`${
|
|
9258
|
+
args.write(`${renderCodeFenceLine(firstLine, event.lang, brightness)}
|
|
8976
9259
|
`);
|
|
8977
9260
|
lastKind = "fence";
|
|
8978
9261
|
lastLine = firstLine;
|
|
@@ -9065,6 +9348,16 @@ function createRenderAwareStreamWriter(args) {
|
|
|
9065
9348
|
},
|
|
9066
9349
|
flush() {
|
|
9067
9350
|
if (tracker.isInMermaid()) {
|
|
9351
|
+
if (buffer && isCodeFenceLine(buffer)) {
|
|
9352
|
+
const event2 = tracker.processLine(buffer);
|
|
9353
|
+
buffer = "";
|
|
9354
|
+
if (event2.kind === "close-mermaid") {
|
|
9355
|
+
args.write(renderMermaidBody(event2.body, brightness));
|
|
9356
|
+
lastKind = "fence";
|
|
9357
|
+
lastLine = "```";
|
|
9358
|
+
return;
|
|
9359
|
+
}
|
|
9360
|
+
}
|
|
9068
9361
|
const extra = buffer ? buffer.split("\n") : void 0;
|
|
9069
9362
|
const unclosed = tracker.flushMermaid(extra);
|
|
9070
9363
|
if (unclosed !== null) {
|
|
@@ -9074,8 +9367,25 @@ function createRenderAwareStreamWriter(args) {
|
|
|
9074
9367
|
return;
|
|
9075
9368
|
}
|
|
9076
9369
|
if (!buffer) return;
|
|
9077
|
-
|
|
9078
|
-
|
|
9370
|
+
const event = tracker.processLine(buffer);
|
|
9371
|
+
if (event.kind === "open-mermaid") {
|
|
9372
|
+
emitBreathIfNeeded("fence", buffer);
|
|
9373
|
+
lastKind = "fence";
|
|
9374
|
+
lastLine = buffer;
|
|
9375
|
+
} else if (event.kind === "open-code") {
|
|
9376
|
+
emitBreathIfNeeded("fence", buffer);
|
|
9377
|
+
args.write(renderCodeFenceOpen(event.rawLang, brightness));
|
|
9378
|
+
lastKind = "fence";
|
|
9379
|
+
lastLine = buffer;
|
|
9380
|
+
} else if (event.kind === "close-code") {
|
|
9381
|
+
emitBreathIfNeeded("fence", buffer);
|
|
9382
|
+
args.write(renderCodeFenceClose(brightness));
|
|
9383
|
+
lastKind = "fence";
|
|
9384
|
+
lastLine = buffer;
|
|
9385
|
+
} else if (event.kind === "code-line") {
|
|
9386
|
+
args.write(renderCodeFenceLine(buffer, event.lang, brightness));
|
|
9387
|
+
lastKind = "fence";
|
|
9388
|
+
lastLine = buffer;
|
|
9079
9389
|
} else {
|
|
9080
9390
|
emitBreathIfNeeded(classifyStreamLine(buffer), buffer);
|
|
9081
9391
|
emitFormattedAssistantBlock(args.write, buffer);
|
|
@@ -10026,6 +10336,8 @@ var families = {
|
|
|
10026
10336
|
editFile: ["edit", "\u4FEE\u6539", ["path"], false],
|
|
10027
10337
|
globFiles: ["find", "\u67E5\u627E\u6587\u4EF6", ["pattern", "path"], true],
|
|
10028
10338
|
search: ["search", "\u641C\u7D22", ["query", "pattern"], true],
|
|
10339
|
+
codeSearch: ["search", "\u641C\u7D22", ["query", "pattern"], true],
|
|
10340
|
+
exa_search: ["search", "\u641C\u7D22", ["query", "pattern"], true],
|
|
10029
10341
|
grep: ["search", "\u641C\u7D22", ["pattern", "query"], true],
|
|
10030
10342
|
loadSkill: ["skill", "\u52A0\u8F7D\u6280\u80FD", ["name", "slug"], true]
|
|
10031
10343
|
};
|
|
@@ -10626,10 +10938,12 @@ function formatToolTraceLine(text, colorEnabled, accent = "none") {
|
|
|
10626
10938
|
`;
|
|
10627
10939
|
const width = resolveSurfacePaintWidth(process.stdout.columns || 80);
|
|
10628
10940
|
const fitted = fitAnsiLine(text.replace(/\r?\n/g, " "), width);
|
|
10629
|
-
const styled = accent === "error" ? themeText(fitted, "danger", true) :
|
|
10941
|
+
const styled = accent === "error" ? themeText(fitted, "danger", true) : themeText(fitted, "muted", true);
|
|
10942
|
+
const candidateSurface = composerSurfaceBackgroundSequence();
|
|
10943
|
+
const surface = candidateSurface.startsWith("\x1B[48;2;") ? candidateSurface : "";
|
|
10630
10944
|
return `${renderSurfaceLine({
|
|
10631
10945
|
text: styled,
|
|
10632
|
-
surface
|
|
10946
|
+
surface,
|
|
10633
10947
|
padTo: width
|
|
10634
10948
|
})}
|
|
10635
10949
|
`;
|
|
@@ -10902,7 +11216,7 @@ function prefixFor(kind) {
|
|
|
10902
11216
|
return kind === "added" ? "+ " : kind === "removed" ? "- " : " ";
|
|
10903
11217
|
}
|
|
10904
11218
|
function buildEditLine(kind, body, maxWidth = resolveEditSnippetMaxWidth()) {
|
|
10905
|
-
return { kind, text: prefixFor(kind) + truncateByDisplayWidth(body, maxWidth) };
|
|
11219
|
+
return { kind, text: prefixFor(kind) + truncateByDisplayWidth(body.replace(/\t/g, " "), maxWidth) };
|
|
10906
11220
|
}
|
|
10907
11221
|
function snippetLinesWithKind(snippet, kind, maxWidth = resolveEditSnippetMaxWidth()) {
|
|
10908
11222
|
const lines = snippet.split(/\r?\n/);
|
|
@@ -10986,15 +11300,23 @@ function formatEditDetailBlock(lines, colorEnabled, filePath, env = process.env)
|
|
|
10986
11300
|
const isTruecolor = supportsTruecolor(env);
|
|
10987
11301
|
const lang = isTruecolor ? detectCodeLangFromPath(filePath) : "unknown";
|
|
10988
11302
|
const brightness = resolveTuiBrightness(env);
|
|
10989
|
-
const
|
|
10990
|
-
|
|
10991
|
-
|
|
10992
|
-
|
|
10993
|
-
|
|
10994
|
-
|
|
10995
|
-
|
|
10996
|
-
|
|
10997
|
-
|
|
11303
|
+
const contentWidth = resolveHistoryLayoutGeometry(process.stdout.columns || 80).contentWidth;
|
|
11304
|
+
const bodyBudget = Math.max(0, contentWidth - 4);
|
|
11305
|
+
const clipped = lines.map((line) => ({ ...line, text: truncateByDisplayWidth(line.text, bodyBudget) }));
|
|
11306
|
+
const padTo = Math.max(0, ...clipped.map((line) => displayWidth(line.text)));
|
|
11307
|
+
return clipped.map((line) => {
|
|
11308
|
+
const rendered = renderDiffLine({
|
|
11309
|
+
kind: line.kind,
|
|
11310
|
+
text: line.text,
|
|
11311
|
+
highlightedText: shouldHighlightEditLine(line, lang, isTruecolor) ? buildHighlightedEditLine(line, lang, brightness, env) : void 0,
|
|
11312
|
+
gutter: true,
|
|
11313
|
+
padTo,
|
|
11314
|
+
colorEnabled: true,
|
|
11315
|
+
env
|
|
11316
|
+
});
|
|
11317
|
+
return `${fitAnsiLine(` ${rendered}`, contentWidth)}
|
|
11318
|
+
`;
|
|
11319
|
+
}).join("");
|
|
10998
11320
|
}
|
|
10999
11321
|
function shouldHighlightEditLine(line, lang, isTruecolor) {
|
|
11000
11322
|
if (!isTruecolor || lang === "unknown") return false;
|
|
@@ -11044,7 +11366,7 @@ function normalToolGistRaw(event) {
|
|
|
11044
11366
|
const url = typeof metadata.url === "string" ? metadata.url : "";
|
|
11045
11367
|
if (url) return formatFetchItemUrl(url);
|
|
11046
11368
|
}
|
|
11047
|
-
if (toolName === "exa_search") {
|
|
11369
|
+
if (toolName === "exa_search" || toolName === "codeSearch" || toolName === "globFiles" || toolName === "searchFiles") {
|
|
11048
11370
|
const query2 = typeof metadata.query === "string" ? metadata.query : typeof metadata.pattern === "string" ? metadata.pattern : "";
|
|
11049
11371
|
const path3 = typeof metadata.path === "string" ? metadata.path : void 0;
|
|
11050
11372
|
if (query2 || path3) return formatSearchItemQuery(query2, path3);
|
|
@@ -11127,7 +11449,7 @@ function formatNormalToolLine(event, pending, colorEnabled, opts, omitSuccessGly
|
|
|
11127
11449
|
const title = gist2 ? `${label} \xB7 ${gist2}` : label;
|
|
11128
11450
|
return formatToolTraceLine(fitNormalLine(`\u25B8 ${title}`, `\u2717 ${reason}`, totalBudget), colorEnabled, "error");
|
|
11129
11451
|
}
|
|
11130
|
-
const successLabel = omitSuccessGlyph?.(toolName) ? "
|
|
11452
|
+
const successLabel = omitSuccessGlyph?.(toolName) ? " ".repeat(displayWidth(label)) : label;
|
|
11131
11453
|
const resultSummary = normalResultSummary(event);
|
|
11132
11454
|
const gist = [normalToolGist(event), resultSummary].filter(Boolean).join(" \xB7 ");
|
|
11133
11455
|
const hint = editFileResultHint(event);
|
|
@@ -11234,7 +11556,7 @@ var TUI_TREE_END = "";
|
|
|
11234
11556
|
var TUI_TREE_TOOLS = {
|
|
11235
11557
|
Run: ["execShell", "runCommand", "launchProcess"],
|
|
11236
11558
|
Read: ["readFile"],
|
|
11237
|
-
Search: ["exa_search"],
|
|
11559
|
+
Search: ["exa_search", "globFiles", "searchFiles", "codeSearch"],
|
|
11238
11560
|
Fetch: ["fetchWebpage"]
|
|
11239
11561
|
};
|
|
11240
11562
|
function toolDetails(event, line) {
|
|
@@ -11259,20 +11581,38 @@ function createToolEventFormatter(colorEnabled = resolveCliColorEnabled(), opts
|
|
|
11259
11581
|
let lastFamilyId;
|
|
11260
11582
|
let tree = null;
|
|
11261
11583
|
const treeKind = (name) => Object.keys(TUI_TREE_TOOLS).find((kind) => TUI_TREE_TOOLS[kind].includes(name)) ?? null;
|
|
11262
|
-
const treeLine = (kind, items, fallback, details) => {
|
|
11263
|
-
const
|
|
11264
|
-
const
|
|
11584
|
+
const treeLine = (kind, counts, items, fallback, details) => {
|
|
11585
|
+
const activeKinds = Object.keys(counts).filter((k) => counts[k] > 0);
|
|
11586
|
+
const isMixed = activeKinds.length > 1;
|
|
11265
11587
|
const columns = resolveHistoryLayoutGeometry(process.stdout.columns).contentWidth - displayWidth("\u25C8 ");
|
|
11266
11588
|
const budget = Math.max(1, columns);
|
|
11267
|
-
let
|
|
11268
|
-
|
|
11269
|
-
|
|
11270
|
-
|
|
11271
|
-
|
|
11589
|
+
let summary;
|
|
11590
|
+
let payloadKind = kind;
|
|
11591
|
+
if (isMixed) {
|
|
11592
|
+
const parts = [
|
|
11593
|
+
counts.Read > 0 ? t("explorePartRead", String(counts.Read)) : "",
|
|
11594
|
+
counts.Search > 0 ? t("explorePartSearch", String(counts.Search)) : "",
|
|
11595
|
+
counts.Run > 0 ? t("explorePartRun", String(counts.Run)) : "",
|
|
11596
|
+
counts.Fetch > 0 ? t("explorePartFetch", String(counts.Fetch)) : ""
|
|
11597
|
+
].filter(Boolean).join(", ");
|
|
11598
|
+
const label = toolIcon("readFile");
|
|
11599
|
+
summary = fitNormalLine(`${label} \xB7 ${t("exploreSummary", String(items.length), parts)}`, "\u2713", Math.max(1, budget - 2));
|
|
11600
|
+
payloadKind = "Read";
|
|
11601
|
+
} else {
|
|
11602
|
+
const singleKind = activeKinds[0] ?? kind;
|
|
11603
|
+
payloadKind = singleKind;
|
|
11604
|
+
const label = singleKind === "Run" ? toolIcon("execShell") : singleKind === "Read" ? toolIcon("readFile") : singleKind === "Fetch" ? toolIcon("fetchWebpage") : toolIcon("exa_search");
|
|
11605
|
+
const header = `${label} (${items.length}) \xB7 `;
|
|
11606
|
+
let shown = 1;
|
|
11607
|
+
for (let count = 2; count <= items.length; count++) {
|
|
11608
|
+
const suffix = count < items.length ? ", \u2026" : "";
|
|
11609
|
+
if (displayWidth(`\u25B8 ${header}${items.slice(0, count).join(", ")}${suffix} \u2713`) > budget) break;
|
|
11610
|
+
shown = count;
|
|
11611
|
+
}
|
|
11612
|
+
summary = fitNormalLine(`${header}${items.slice(0, shown).join(", ")}${shown < items.length ? ", \u2026" : ""}`, "\u2713", Math.max(1, budget - 2));
|
|
11272
11613
|
}
|
|
11273
|
-
const summary = fitNormalLine(`${header}${items.slice(0, shown).join(", ")}${shown < items.length ? ", \u2026" : ""}`, "\u2713", Math.max(1, budget - 2));
|
|
11274
11614
|
const payload = {
|
|
11275
|
-
kind,
|
|
11615
|
+
kind: payloadKind,
|
|
11276
11616
|
summary,
|
|
11277
11617
|
fallback,
|
|
11278
11618
|
details,
|
|
@@ -11303,11 +11643,17 @@ function createToolEventFormatter(colorEnabled = resolveCliColorEnabled(), opts
|
|
|
11303
11643
|
attention: [],
|
|
11304
11644
|
mode: "ordinary",
|
|
11305
11645
|
// Formatter lifecycle/reset is the real assistant-output boundary;
|
|
11306
|
-
//
|
|
11646
|
+
// consecutive read-only exploration folds across rounds until a
|
|
11647
|
+
// non-readonly tool, error/gate, or assistant prose interrupts it.
|
|
11307
11648
|
scopeKey: `assistant:${scope}`,
|
|
11308
|
-
batchKey:
|
|
11649
|
+
batchKey: `explore:${scope}`,
|
|
11309
11650
|
evidenceKey: event.toolCallId
|
|
11310
11651
|
});
|
|
11652
|
+
const isReadOnlyExploration = kind === "Read" || kind === "Search" || kind === "Fetch" || kind === "Run" && activity.readOnly === true;
|
|
11653
|
+
if (!isReadOnlyExploration) {
|
|
11654
|
+
tree = null;
|
|
11655
|
+
return null;
|
|
11656
|
+
}
|
|
11311
11657
|
let item = "";
|
|
11312
11658
|
const m = event.metadata ?? {};
|
|
11313
11659
|
if (kind === "Run") {
|
|
@@ -11317,7 +11663,10 @@ function createToolEventFormatter(colorEnabled = resolveCliColorEnabled(), opts
|
|
|
11317
11663
|
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);
|
|
11318
11664
|
if (kind === "Fetch") item = formatFetchItemUrl(typeof m.url === "string" ? m.url : "webpage");
|
|
11319
11665
|
item = safeAskText(item) || toolLabel(name);
|
|
11320
|
-
if (tree
|
|
11666
|
+
if (!tree || !canCoalesceToolActivities(tree.activity, activity)) {
|
|
11667
|
+
tree = { counts: { Run: 0, Read: 0, Search: 0, Fetch: 0 }, items: [], activity };
|
|
11668
|
+
}
|
|
11669
|
+
tree.counts[kind] += 1;
|
|
11321
11670
|
tree.items.push(item);
|
|
11322
11671
|
if (tree.items.length < 2) {
|
|
11323
11672
|
const line2 = formatNormalToolLine(event, call, colorEnabled, opts);
|
|
@@ -11326,7 +11675,7 @@ function createToolEventFormatter(colorEnabled = resolveCliColorEnabled(), opts
|
|
|
11326
11675
|
`;
|
|
11327
11676
|
}
|
|
11328
11677
|
const line = formatNormalToolLine(event, call, colorEnabled, opts);
|
|
11329
|
-
return treeLine(kind, tree.items, line, toolDetails(event, line));
|
|
11678
|
+
return treeLine(kind, tree.counts, tree.items, line, toolDetails(event, line));
|
|
11330
11679
|
};
|
|
11331
11680
|
const format = (event) => {
|
|
11332
11681
|
if (event.type === "tool-call") {
|
|
@@ -11616,7 +11965,7 @@ function createCliTurnOutput(params) {
|
|
|
11616
11965
|
});
|
|
11617
11966
|
const eventMode = resolveAgentEventMode(options);
|
|
11618
11967
|
const assistantLabelManaged = options.output.assistantLabelManaged === true;
|
|
11619
|
-
const showThinking =
|
|
11968
|
+
const showThinking = options.showThinking !== false;
|
|
11620
11969
|
const hidesRoutineTuiToolDetail = (event) => {
|
|
11621
11970
|
return false;
|
|
11622
11971
|
};
|
|
@@ -11626,28 +11975,17 @@ function createCliTurnOutput(params) {
|
|
|
11626
11975
|
let thinkState = createThinkParserState();
|
|
11627
11976
|
let thinkingFirstAt = null;
|
|
11628
11977
|
let thinkingPreview = "";
|
|
11629
|
-
let tuiThinkingReported = false;
|
|
11630
|
-
const clearTuiThinkingLabel = () => {
|
|
11631
|
-
if (!tuiThinkingReported) return;
|
|
11632
|
-
tuiThinkingReported = false;
|
|
11633
|
-
options.activityReporter?.(null);
|
|
11634
|
-
};
|
|
11635
11978
|
const markThinkingDelta = (chunk) => {
|
|
11636
|
-
if (assistantLabelManaged) {
|
|
11637
|
-
if (!tuiThinkingReported && !streamedAssistantText) {
|
|
11638
|
-
tuiThinkingReported = true;
|
|
11639
|
-
options.activityReporter?.(t("thinkingActive"));
|
|
11640
|
-
}
|
|
11641
|
-
return;
|
|
11642
|
-
}
|
|
11643
11979
|
if (!showThinking) return;
|
|
11644
|
-
if (streamedAssistantText) return;
|
|
11980
|
+
if (streamedAssistantText || assistantLabelManaged && pendingTuiNarration) return;
|
|
11645
11981
|
if (thinkingFirstAt === null) {
|
|
11646
11982
|
thinkingFirstAt = Date.now();
|
|
11647
11983
|
thinkingPreview = "";
|
|
11648
11984
|
}
|
|
11649
11985
|
thinkingPreview = appendThinkingPreview(thinkingPreview, chunk);
|
|
11650
|
-
|
|
11986
|
+
if (!assistantLabelManaged) {
|
|
11987
|
+
spinner.setThinkingHint(thinkingPreview);
|
|
11988
|
+
}
|
|
11651
11989
|
reportThinkingProgress();
|
|
11652
11990
|
};
|
|
11653
11991
|
const reportThinkingProgress = () => {
|
|
@@ -11657,14 +11995,15 @@ function createCliTurnOutput(params) {
|
|
|
11657
11995
|
options.activityReporter?.(label);
|
|
11658
11996
|
};
|
|
11659
11997
|
const endThinkingPhase = () => {
|
|
11660
|
-
clearTuiThinkingLabel();
|
|
11661
11998
|
if (thinkingFirstAt === null) return;
|
|
11662
11999
|
const seconds = Math.max(0, Math.round((Date.now() - thinkingFirstAt) / 1e3));
|
|
11663
12000
|
thinkingFirstAt = null;
|
|
11664
12001
|
thinkingPreview = "";
|
|
11665
|
-
|
|
12002
|
+
if (!assistantLabelManaged) {
|
|
12003
|
+
spinner.stop();
|
|
12004
|
+
}
|
|
11666
12005
|
options.activityReporter?.(null);
|
|
11667
|
-
if (seconds >= 1) {
|
|
12006
|
+
if (!assistantLabelManaged && seconds >= 1) {
|
|
11668
12007
|
options.output.write(`${dimCliText(t("thinkingTraceLine", formatElapsed(seconds)))}
|
|
11669
12008
|
`);
|
|
11670
12009
|
}
|
|
@@ -12288,11 +12627,15 @@ function findCollapsedPasteSpanAt(buffer, pos, opts = {}) {
|
|
|
12288
12627
|
return null;
|
|
12289
12628
|
}
|
|
12290
12629
|
|
|
12291
|
-
// packages/
|
|
12630
|
+
// packages/agent-runtime/idleHeapRelease.ts
|
|
12292
12631
|
var IDLE_HEAP_RELEASE_DELAY_MS = 2e3;
|
|
12632
|
+
function isIdleHeapReleaseDisabled(env, disableEnvVar) {
|
|
12633
|
+
return env?.[disableEnvVar] === "0";
|
|
12634
|
+
}
|
|
12293
12635
|
function releaseHeapPages(options = {}) {
|
|
12294
12636
|
const env = options.env ?? process.env;
|
|
12295
|
-
|
|
12637
|
+
const disableEnvVar = options.disableEnvVar ?? "NOLO_TUI_IDLE_HEAP_RELEASE";
|
|
12638
|
+
if (isIdleHeapReleaseDisabled(env, disableEnvVar)) return;
|
|
12296
12639
|
const bun = "bun" in options ? options.bun : globalThis.Bun;
|
|
12297
12640
|
if (typeof bun?.gc !== "function" || typeof bun?.shrink !== "function") return;
|
|
12298
12641
|
try {
|
|
@@ -12302,10 +12645,11 @@ function releaseHeapPages(options = {}) {
|
|
|
12302
12645
|
}
|
|
12303
12646
|
}
|
|
12304
12647
|
function createIdleHeapReleaser(options = {}) {
|
|
12305
|
-
const
|
|
12648
|
+
const disableEnvVar = options.disableEnvVar ?? "NOLO_TUI_IDLE_HEAP_RELEASE";
|
|
12649
|
+
const hasExplicitEnv = "env" in options;
|
|
12306
12650
|
const bun = "bun" in options ? options.bun : globalThis.Bun;
|
|
12307
|
-
const
|
|
12308
|
-
if (
|
|
12651
|
+
const disabledAtCreation = hasExplicitEnv && isIdleHeapReleaseDisabled(options.env, disableEnvVar) || typeof bun?.gc !== "function" || typeof bun?.shrink !== "function";
|
|
12652
|
+
if (disabledAtCreation) return { schedule() {
|
|
12309
12653
|
}, cancel() {
|
|
12310
12654
|
} };
|
|
12311
12655
|
const delayMs = options.delayMs ?? IDLE_HEAP_RELEASE_DELAY_MS;
|
|
@@ -12316,20 +12660,26 @@ function createIdleHeapReleaser(options = {}) {
|
|
|
12316
12660
|
});
|
|
12317
12661
|
const clearTimer = options.clearTimer ?? ((handle) => clearTimeout(handle));
|
|
12318
12662
|
let pending = null;
|
|
12663
|
+
const currentEnv = () => hasExplicitEnv ? options.env : process.env;
|
|
12664
|
+
const cancel = () => {
|
|
12665
|
+
if (pending === null) return;
|
|
12666
|
+
clearTimer(pending);
|
|
12667
|
+
pending = null;
|
|
12668
|
+
};
|
|
12319
12669
|
const release = () => {
|
|
12320
12670
|
pending = null;
|
|
12321
|
-
releaseHeapPages({ env, bun });
|
|
12671
|
+
releaseHeapPages({ env: currentEnv(), disableEnvVar, bun });
|
|
12322
12672
|
};
|
|
12323
12673
|
return {
|
|
12324
12674
|
schedule() {
|
|
12675
|
+
if (isIdleHeapReleaseDisabled(currentEnv(), disableEnvVar)) {
|
|
12676
|
+
cancel();
|
|
12677
|
+
return;
|
|
12678
|
+
}
|
|
12325
12679
|
if (pending !== null) clearTimer(pending);
|
|
12326
12680
|
pending = setTimer(release, delayMs);
|
|
12327
12681
|
},
|
|
12328
|
-
cancel
|
|
12329
|
-
if (pending === null) return;
|
|
12330
|
-
clearTimer(pending);
|
|
12331
|
-
pending = null;
|
|
12332
|
-
}
|
|
12682
|
+
cancel
|
|
12333
12683
|
};
|
|
12334
12684
|
}
|
|
12335
12685
|
|
|
@@ -12374,7 +12724,7 @@ function isBalanceExhaustedError(error) {
|
|
|
12374
12724
|
|
|
12375
12725
|
// packages/cli/client/agentRun.ts
|
|
12376
12726
|
async function loadRunLocalAgentTurn() {
|
|
12377
|
-
const { runLocalAgentTurn } = await import("./agentRuntimeLocal-
|
|
12727
|
+
const { runLocalAgentTurn } = await import("./agentRuntimeLocal-5DB2P4MU.js");
|
|
12378
12728
|
return runLocalAgentTurn;
|
|
12379
12729
|
}
|
|
12380
12730
|
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();
|
|
@@ -12422,7 +12772,7 @@ function parseEmbeddedBalanceDetails(message) {
|
|
|
12422
12772
|
function parseContextLengthDetails(message) {
|
|
12423
12773
|
let max;
|
|
12424
12774
|
let requested;
|
|
12425
|
-
const maxMatch = message.match(/maximum context length\s+(?:is|of)\s*(\d+)/i);
|
|
12775
|
+
const maxMatch = message.match(/maximum context length\s+(?:is|of)\s*(\d+)/i) ?? message.match(/maximum number of tokens allowed(?:\s*(?:is|of))?\s*[:=]?\s*(\d+)/i) ?? message.match(/exceeds?\s+(?:the\s+)?(?:model(?:'s)?\s+)?maximum(?:\s+context)?\s+(?:length|limit|tokens?)\s*(?:is|of|:)?\s*(\d+)/i);
|
|
12426
12776
|
if (maxMatch) {
|
|
12427
12777
|
max = maxMatch[1];
|
|
12428
12778
|
}
|
|
@@ -12647,6 +12997,12 @@ function looksLikeRateLimitedText(message) {
|
|
|
12647
12997
|
return EXTRA_RATE_LIMIT_TEXT_RE.test(message) || QUOTA_ERROR_PATTERNS.some((pattern) => pattern.test(message));
|
|
12648
12998
|
}
|
|
12649
12999
|
var AUTH_TEXT_SIGNAL_RE = /\b401\b|unauthori[sz]ed|invalid[_\s-]?(?:api[_\s-]?key|token|credential)s?|(?:api[_\s-]?key|token|credential)s?[_\s-](?:invalid|expired|rejected|missing|not[_\s-]?found)|authentication[_\s-]?(?:error|failed|required)/i;
|
|
13000
|
+
function isAuthFailureError(error) {
|
|
13001
|
+
if (!error) return false;
|
|
13002
|
+
const msg = toErrorMessage(error);
|
|
13003
|
+
if (!msg) return false;
|
|
13004
|
+
return AUTH_TEXT_SIGNAL_RE.test(msg) || classifyLocalRunError(msg).kind === "auth";
|
|
13005
|
+
}
|
|
12650
13006
|
var QUOTA_EXHAUSTED_EXTRA_RE = /insufficient[_\s-]?(?:quota|balance|credits?)|余额不足|额度已?用尽/i;
|
|
12651
13007
|
function looksLikeQuotaExhaustedText(message) {
|
|
12652
13008
|
return isQuotaExhaustedText(message) || QUOTA_EXHAUSTED_EXTRA_RE.test(message);
|
|
@@ -13073,6 +13429,12 @@ function formatLocalTurnFailureLine(error) {
|
|
|
13073
13429
|
}
|
|
13074
13430
|
if (isMissingBatchReceiptFailure(message)) {
|
|
13075
13431
|
return `[nolo] ${describeMissingBatchReceipt()}.
|
|
13432
|
+
`;
|
|
13433
|
+
}
|
|
13434
|
+
if (isContextOverflowText(message)) {
|
|
13435
|
+
const details = parseContextLengthDetails(message);
|
|
13436
|
+
const shownMessage = details.requested && details.max ? t("contextLengthExceeded", details.requested, details.max) : details.max ? t("contextLengthExceededLimitOnly", details.max) : t("contextLengthExceededGeneric");
|
|
13437
|
+
return `[nolo] ${shownMessage}
|
|
13076
13438
|
`;
|
|
13077
13439
|
}
|
|
13078
13440
|
if (error?.code === "LLM_REQUEST_TIMEOUT") {
|
|
@@ -13133,7 +13495,11 @@ function describeLocalRunFailure(message, rawError) {
|
|
|
13133
13495
|
where: PLATFORM_TRANSPORT_RE.test(message) ? "server chat proxy" : "local provider"
|
|
13134
13496
|
});
|
|
13135
13497
|
}
|
|
13136
|
-
if (
|
|
13498
|
+
if (isLocalContextCoverageFailure(rawError ?? message)) {
|
|
13499
|
+
return `[nolo] ${describeContextRefusal(contextRefusalDiagnostics(rawError))}
|
|
13500
|
+
`;
|
|
13501
|
+
}
|
|
13502
|
+
if (isContextOverflowText(message)) {
|
|
13137
13503
|
const details = parseContextLengthDetails(message);
|
|
13138
13504
|
const shownMessage = details.requested && details.max ? t("contextLengthExceeded", details.requested, details.max) : details.max ? t("contextLengthExceededLimitOnly", details.max) : t("contextLengthExceededGeneric");
|
|
13139
13505
|
return `[nolo] ${shownMessage}
|
|
@@ -13166,10 +13532,6 @@ function describeLocalRunFailure(message, rawError) {
|
|
|
13166
13532
|
if (isCliBatchPhaseFailure(rawError)) {
|
|
13167
13533
|
return describeCliBatchPhaseFailure(rawError);
|
|
13168
13534
|
}
|
|
13169
|
-
if (isLocalContextCoverageFailure(rawError ?? message)) {
|
|
13170
|
-
return `[nolo] ${describeContextRefusal(contextRefusalDiagnostics(rawError))}
|
|
13171
|
-
`;
|
|
13172
|
-
}
|
|
13173
13535
|
if (isMissingBatchReceiptFailure(message)) {
|
|
13174
13536
|
return `[nolo] ${describeMissingBatchReceipt()}.
|
|
13175
13537
|
`;
|
|
@@ -17440,17 +17802,17 @@ export {
|
|
|
17440
17802
|
setActiveThemeMode,
|
|
17441
17803
|
setActiveBrightness,
|
|
17442
17804
|
detectSystemBrightnessFromEnv,
|
|
17443
|
-
resolveTuiBrightnessSignal,
|
|
17444
17805
|
resolveTuiThemeMode,
|
|
17445
17806
|
themeColorSequence,
|
|
17446
17807
|
resetWorkspaceThemeState,
|
|
17447
17808
|
applyDetectedBackground,
|
|
17448
17809
|
renderSurfaceLine,
|
|
17449
17810
|
surfaceBackgroundSequence,
|
|
17450
|
-
composerSurfaceBackgroundSequence,
|
|
17451
|
-
userSurfaceBackgroundSequence,
|
|
17452
17811
|
themeText,
|
|
17453
17812
|
tuiRenderThemeFingerprint,
|
|
17813
|
+
MAX_URL_LENGTH,
|
|
17814
|
+
normalizeHttpUrl,
|
|
17815
|
+
openExternalUrl,
|
|
17454
17816
|
setMathRenderingEnabled,
|
|
17455
17817
|
polishBreathInsertsBlankBetween,
|
|
17456
17818
|
formatAssistantDisplay,
|
|
@@ -17465,6 +17827,7 @@ export {
|
|
|
17465
17827
|
allocateCollapsedPaste,
|
|
17466
17828
|
releaseCollapsedPaste,
|
|
17467
17829
|
clearCollapsedPasteStore,
|
|
17830
|
+
expandCollapsedPastes,
|
|
17468
17831
|
replaceCollapsedPastesWithReferences,
|
|
17469
17832
|
releaseCollapsedPasteReferences,
|
|
17470
17833
|
expandRangeToCollapsedPasteChips,
|
|
@@ -17475,6 +17838,7 @@ export {
|
|
|
17475
17838
|
describeContextRefusal,
|
|
17476
17839
|
inspectLocalRunWorkspace,
|
|
17477
17840
|
isBalanceExhaustedError,
|
|
17841
|
+
isAuthFailureError,
|
|
17478
17842
|
OWNER_OAUTH_UNAVAILABLE_HINT,
|
|
17479
17843
|
isOwnerOAuthUnavailableError,
|
|
17480
17844
|
isInvalidGrantError,
|