nolo-cli 0.149.0-alpha.1 → 0.151.0-alpha.2
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-OW3H7ICR.js → _executeModel-XHAFJ2MM.js} +134 -91
- package/accountResolver-7RYB4D2P.js +300 -0
- package/action-SXJD5N5R.js +23 -0
- package/{addContentAction-B2DRF7P6.js → addContentAction-ZV774PHH.js} +20 -14
- package/{addDialogAgentAction-2P2FLTLD.js → addDialogAgentAction-A6SMKAGH.js} +26 -22
- package/{agentDeleteCommand-7IDWF6E3.js → agentDeleteCommand-DPUUS56Z.js} +181 -93
- package/{agentEmailCommands-A6XBQZBN.js → agentEmailCommands-V4P5EFLP.js} +132 -112
- package/{agentGrantCommands-M3XFO6EN.js → agentGrantCommands-HOJ3JBBQ.js} +3 -3
- package/agentListCommands-TWFLUYIZ.js +802 -0
- package/{agentMachineCommands-DQPUIMAC.js → agentMachineCommands-MELPAZZI.js} +58 -62
- package/{agentProviderCommands-YK2BIIXZ.js → agentProviderCommands-HL6MBLCL.js} +149 -2
- package/{agentPullCommand-HF4A42D4.js → agentPullCommand-FA43RBRU.js} +7 -7
- package/agentRecordCommands-FSWSSQIO.js +154 -0
- package/agentRunCommand-GDBJVOAT.js +183 -0
- package/{agentRunControl-2SKCR4SB.js → agentRunControl-IFM7IGMG.js} +10 -2
- package/{agentRuntimeLocal-AK2QVJHY.js → agentRuntimeLocal-KKSQJMTE.js} +47 -50
- package/{agentSlice-O4RUQUMT.js → agentSlice-YO2ZLJMD.js} +23 -16
- package/{appDeleteCommands-N3XEVVYC.js → appDeleteCommands-4PL4KYRN.js} +58 -59
- package/{appDeployCommands-AWFIXYVW.js → appDeployCommands-EEEXCEB6.js} +67 -63
- package/{appDeployStatusCommands-CZRON2FO.js → appDeployStatusCommands-35ZX7T66.js} +56 -56
- package/{appGetCommands-XQIUY4TD.js → appGetCommands-WFCHXJWF.js} +56 -56
- package/{appListCommands-NNG4H36Y.js → appListCommands-XY2U6DPF.js} +57 -59
- package/{authCommand-UBJ4EWYZ.js → authCommand-QYN47CQD.js} +371 -68
- package/{authCommands-H6WKKCRW.js → authCommands-77CHYBGF.js} +12 -9
- package/{builtinSkillRegistry-ZMF6YGNO.js → builtinSkillRegistry-TDQ6JB2E.js} +13 -11
- package/{chromeCommands-2N6MEWRU.js → chromeCommands-OBBNJCLS.js} +314 -13
- package/chromeOpsCommands-3Z34RKSE.js +472 -0
- package/{chunk-ALXHV7NK.js → chunk-2GGXHQIW.js} +43 -4
- package/{localRuntimeAuthority-5W6IJRAD.js → chunk-2IXDJNZI.js} +154 -75
- package/{chunk-IVZJWTDI.js → chunk-36OMEXXR.js} +89 -21
- package/{chunk-H6A6X4EK.js → chunk-3MZAGMYY.js} +16 -0
- package/chunk-3PVYUPXK.js +40 -0
- package/chunk-3SZA4U64.js +1192 -0
- package/{chunk-GNMAFAIS.js → chunk-44WXLHFI.js} +1 -1
- package/{chunk-AGGIDPCZ.js → chunk-4JH2UMJR.js} +6 -0
- package/chunk-4LCOCOR5.js +50 -0
- package/chunk-4YRTZIVN.js +871 -0
- package/chunk-556RW72X.js +14110 -0
- package/{chunk-N7J63Q6C.js → chunk-56GBUMO5.js} +10 -1
- package/{chunk-W7XHHYWM.js → chunk-5BHQICF2.js} +5 -1
- package/{chunk-XUWRURDF.js → chunk-5EBLANFT.js} +1 -1
- package/{chunk-3AH7LNUB.js → chunk-5EMSBTQ6.js} +33 -14
- package/{chunk-YRRASA5Q.js → chunk-5MM7NNO6.js} +113 -52
- package/chunk-5MMAK75Q.js +15 -0
- package/{chunk-M5PVFLD4.js → chunk-64K7WX26.js} +90 -21
- package/{chunk-AKG5W4LG.js → chunk-6CCFTVBP.js} +76 -221
- package/chunk-6MJNEXUU.js +614 -0
- package/{chunk-62IL3KQV.js → chunk-6MXDOUMH.js} +15 -3
- package/{chunk-QOKAKDPE.js → chunk-6Q7UTJKR.js} +6 -94
- package/chunk-6QDYSCPW.js +223 -0
- package/{chunk-HYZIYH2H.js → chunk-74RAWNQN.js} +56 -63
- package/chunk-7DPNBQSV.js +9 -0
- package/chunk-7MOXKPHC.js +119 -0
- package/{chunk-ZUEK6A6C.js → chunk-7XKL25PW.js} +1973 -754
- package/{chunk-IAESIMK7.js → chunk-A4MW3YZL.js} +10 -14
- package/chunk-AGIM7IMJ.js +147 -0
- package/{chunk-7CHC4W22.js → chunk-AIZE5TDM.js} +3 -3
- package/{chunk-YAQJJDC2.js → chunk-AOCM7HPT.js} +214 -51
- package/{chunk-5GVBDNTO.js → chunk-AU7AXHUL.js} +1 -1
- package/{chunk-4H22P2JV.js → chunk-AUIJZACN.js} +2073 -1275
- package/{chunk-CIF4X6ZM.js → chunk-AWVFQMOV.js} +25 -3
- package/{chunk-RYZINGPM.js → chunk-BPMPOFWP.js} +347 -235
- package/{chunk-YUNJN43V.js → chunk-BU2YQBV4.js} +215 -28
- package/{chunk-XPRWFQQK.js → chunk-CBHGZRCE.js} +38 -12
- package/{chunk-Y3PMXGLH.js → chunk-CHCS6XPJ.js} +365 -144
- package/chunk-CHOZJMJS.js +78 -0
- package/{chunk-GBRG75BQ.js → chunk-D2MDMY2M.js} +1 -0
- package/{chunk-3SV7RM24.js → chunk-D2QN6CTI.js} +117 -72
- package/{chunk-5TEEECZM.js → chunk-E2AKSW7L.js} +10 -7
- package/{chunk-RSEEDUMS.js → chunk-EDX5XSJM.js} +2 -2
- package/{chunk-ATLTFRYJ.js → chunk-ES633ZS5.js} +280 -98
- package/{chunk-QDSINZM3.js → chunk-EUGTFFO6.js} +2 -23
- package/{chunk-UNYJU5L6.js → chunk-EYLGAEB4.js} +5 -1
- package/{chunk-CU3QB4HW.js → chunk-EYWJT7A2.js} +12 -12
- package/{chunk-BNGW5ASC.js → chunk-EZVK3N5L.js} +66 -18
- package/{chunk-6FGTMQCL.js → chunk-F32Z66T4.js} +6 -10
- package/chunk-FJMRBOPO.js +11507 -0
- package/{chunk-ZOVKKMF6.js → chunk-FY4SDK2E.js} +1 -1
- package/chunk-G6OOUQWJ.js +417 -0
- package/{chunk-PQWU42UQ.js → chunk-GCKHQECX.js} +6 -6
- package/chunk-GKXCHNTE.js +15 -0
- package/{chunk-TXH4IWJL.js → chunk-GQN2WLAI.js} +20 -11
- package/{chunk-P6GMCCAT.js → chunk-GQV5KHJU.js} +78 -12
- package/{chunk-B2XUQXQX.js → chunk-HIQ4GF53.js} +191 -68
- package/{chunk-MST6R3E4.js → chunk-HKX3ULQB.js} +34 -22
- package/{chunk-GMZLP5DV.js → chunk-HNUWUO75.js} +30 -19
- package/{chunk-5UTFL4QJ.js → chunk-I2ZMGXXF.js} +10 -5
- package/chunk-I42VC5KR.js +15 -0
- package/{chunk-3BXNTXYI.js → chunk-I4SN4NUQ.js} +1199 -56
- package/chunk-IA7TRNNR.js +11 -0
- package/{chunk-WIWM4FE3.js → chunk-IJERIUXS.js} +55 -748
- package/{chunk-CPUFH46E.js → chunk-ILU2NPWY.js} +10 -10
- package/{chunk-SLLGJZDT.js → chunk-ISQL4V7C.js} +4 -4
- package/chunk-IT3ZZRJE.js +12 -0
- package/{chunk-TZZ2WRBL.js → chunk-IZ7OJB6K.js} +20 -16
- package/{chunk-DY7ANLKG.js → chunk-JKMLSTZK.js} +43 -12
- package/{chunk-6TPOEJMQ.js → chunk-JZX2XLKC.js} +64 -23
- package/{chunk-27ONFIEY.js → chunk-K2AER7RX.js} +19 -12
- package/{chunk-O2OWEFII.js → chunk-KFHQQ3NO.js} +1 -1
- package/{chunk-QXGPFY6J.js → chunk-LGN377P3.js} +27 -17
- package/{chunk-L36OWPP3.js → chunk-LIQJTQRN.js} +118 -139
- package/{chunk-UASIEDKM.js → chunk-LTRUTOHX.js} +36 -31
- package/{chunk-BFU6C242.js → chunk-NMFV26UG.js} +1 -1
- package/{chunk-5J3PYNUP.js → chunk-NYYFIKHI.js} +17 -3
- package/{chunk-6O4IK4V2.js → chunk-OFFL4DCR.js} +1 -1
- package/{chunk-B6SAMB33.js → chunk-OWYYDMGJ.js} +209 -9
- package/{chunk-KQHGZWSV.js → chunk-OXME3PEE.js} +1 -1
- package/{chunk-CTUQJVQM.js → chunk-P5QACQDK.js} +1 -1
- package/{chunk-DXHL7G2L.js → chunk-PCKVQXYV.js} +274 -93
- package/{chunk-4JMDLJAD.js → chunk-PJNFNEJE.js} +114 -37
- package/{chunk-Z4CSIXYP.js → chunk-PLSVXHSA.js} +3 -3
- package/{chunk-BIDGLJQ3.js → chunk-PLXDDGBK.js} +45 -8
- package/chunk-PWTNI4N7.js +47 -0
- package/chunk-QFEW2ULV.js +42 -0
- package/{chunk-RGNEEJ3Y.js → chunk-QLQ573SU.js} +35 -9
- package/chunk-QQ56R7KS.js +88 -0
- package/chunk-QYPE3TS3.js +43 -0
- package/{chunk-4DPP773Q.js → chunk-RSHPU4PD.js} +59 -11
- package/chunk-RVWMAFIT.js +134 -0
- package/{chunk-ESHYE7WU.js → chunk-S73EPYNC.js} +10 -7
- package/{chunk-UQNS32WZ.js → chunk-SCMHQUMK.js} +1 -1
- package/{chunk-HTVYCXBP.js → chunk-SMENBO3M.js} +354 -120
- package/{chunk-OMRJYNCI.js → chunk-SSFDFOVT.js} +26 -31
- package/chunk-SW4S4XYB.js +1794 -0
- package/{chunk-TB3MIBRC.js → chunk-T6X3D7NB.js} +572 -430
- package/chunk-TY3TIUJK.js +89 -0
- package/{chunk-X2QRZXZH.js → chunk-TYJ5XFEA.js} +4 -4
- package/{chunk-ALFH24P3.js → chunk-TYYRSFBG.js} +197 -155
- package/{chunk-7KVZ5LDQ.js → chunk-UBUH2TCC.js} +18 -4
- package/chunk-UEILX4EV.js +15 -0
- package/chunk-UHTDNB5Y.js +140 -0
- package/{chunk-YYLHWIW6.js → chunk-UKZX3NHN.js} +1 -1
- package/{chunk-OHOVNO7I.js → chunk-UOKFKFPO.js} +6 -3
- package/{chunk-XISEYOGH.js → chunk-USHQX6VT.js} +5 -5
- package/chunk-UUPR3TD7.js +53 -0
- package/{chunk-HDLLCBRF.js → chunk-VEA7H5FG.js} +2 -2
- package/chunk-VHGD6FHV.js +116 -0
- package/chunk-VIWDGTDA.js +8 -0
- package/{chunk-GOH6RW6F.js → chunk-VJXHL6MH.js} +34 -11
- package/{chunk-4XEYAFLY.js → chunk-VL5KOY2C.js} +623 -94
- package/{chunk-EADNWBAZ.js → chunk-VP3BINY7.js} +13 -0
- package/{chunk-EOARMOVD.js → chunk-W4S6OTSC.js} +6 -3
- package/chunk-WD4XYDYC.js +567 -0
- package/chunk-WJZOQR2J.js +151 -0
- package/{chunk-AUDNYVRC.js → chunk-XETG4RIX.js} +5 -5
- package/{chunk-MX574M24.js → chunk-XI7DGLUK.js} +4 -4
- package/{chunk-3L2WKC3W.js → chunk-XPWGOTBQ.js} +8 -1
- package/chunk-XRUSXPCQ.js +514 -0
- package/{chunk-I4OPU5TK.js → chunk-XS47QOFV.js} +273 -11
- package/{chunk-S5XGT6GB.js → chunk-XZNCX52W.js} +30 -9
- package/{chunk-ID7LNBWR.js → chunk-Y2DXOPSO.js} +1920 -644
- package/{chunk-5OA5HMTL.js → chunk-YLMMECCH.js} +1 -1
- package/{chunk-CFT5HBGW.js → chunk-YVLQXTUB.js} +448 -12
- package/chunk-YVPQATSC.js +709 -0
- package/{chunk-3DAVPNFT.js → chunk-Z7OJUX6S.js} +122 -107
- package/chunk-ZEZC7IIM.js +126 -0
- package/{chunk-ALGORS6Y.js → chunk-ZF6526IQ.js} +43 -8
- package/chunk-ZIWPQEFU.js +165 -0
- package/chunk-ZKZ5X2HS.js +7012 -0
- package/chunk-ZRAU6T47.js +56 -0
- package/{cliExecutor-AWYR3T33.js → cliExecutor-BWBF2MTI.js} +4 -3
- package/{clipboardy-BX4NMYHE.js → clipboardy-GCO3GT3I.js} +3 -8
- package/{commandRegistry-2KBOXZQC.js → commandRegistry-XN7C5GHO.js} +183 -107
- package/contentThunks-5L7YQI3S.js +84 -0
- package/{cooldownCommands-ZLEPIB4A.js → cooldownCommands-JFKTYS2D.js} +2 -2
- package/{createAgentAutomationAction-5UGTB26P.js → createAgentAutomationAction-QOPOLCRK.js} +53 -44
- package/createDialogAction-MZ66VY5Q.js +76 -0
- package/{createPageAction-CDLDKPRM.js → createPageAction-VQDJIXMY.js} +65 -54
- package/cursorProvider-YGGNMVWX.js +6123 -0
- package/{db-VQSAOWAO.js → db-2QOTXYGH.js} +11 -5
- package/{dbSlice-DQ32LYTJ.js → dbSlice-J37OGIXH.js} +19 -13
- package/{deleteFile-NX6QHCWZ.js → deleteFile-6JWDDRVP.js} +10 -6
- package/dialogCommands-YZLSJB6X.js +113 -0
- package/{dialogSlice-N3YB65G5.js → dialogSlice-6RODVYCK.js} +53 -39
- package/{docCreateCommands-ZSLGVBZT.js → docCreateCommands-JB2RRMRJ.js} +54 -57
- package/{docDeleteCommands-5N4GVZBG.js → docDeleteCommands-AQENULNM.js} +56 -58
- package/{docReadCommands-YJSAA7AV.js → docReadCommands-DYD25YLQ.js} +53 -56
- package/{docStore-E3CEOV5Q.js → docStore-ZZA3OPM5.js} +25 -16
- package/{docUpdateCommands-WEMLSW6W.js → docUpdateCommands-3GVS23QL.js} +54 -57
- package/{fetchMessages-67MEFPZR.js → fetchMessages-IIJWQ3HR.js} +5 -4
- package/{getPricing-NMMFT3YI.js → getPricing-FKK3F5EJ.js} +11 -9
- package/{handleSendMessageAction-DQAD5ERJ.js → handleSendMessageAction-DVG5U26T.js} +422 -118
- package/index.js +11 -7
- package/{lib-FRRS27KN.js → lib-4YTWAGY7.js} +581 -248
- package/{localDialogRead-EBRS242U.js → localDialogRead-FSOMOPDZ.js} +2 -2
- package/localRuntimeAdapter-HXRHFKRC.js +244 -0
- package/localRuntimeAuthority-JDAD7CB6.js +16 -0
- package/{localRuntimeDb-3LRMNLCM.js → localRuntimeDb-CVC62PM5.js} +1 -1
- package/{machineCommands-HAP75VSG.js → machineCommands-5KBF4RCC.js} +503 -161
- package/{machineInfo-66ZFUMLE.js → machineInfo-UKPTZO5Y.js} +2 -2
- package/machineWsRunDispatch-4OQDEDOR.js +169 -0
- package/{memberThunks-5ZXPR63F.js → memberThunks-66DH6ABQ.js} +25 -18
- package/{models-ZPU5EDF4.js → models-LAS4B2B5.js} +2 -2
- package/package.json +1 -1
- package/{providerPresetApply-DD6NGWW6.js → providerPresetApply-MY66I6NT.js} +10 -10
- package/{providerRegistry-XDRLMYGJ.js → providerRegistry-QOE2FT57.js} +13 -9
- package/{read-EPTJRAEF.js → read-DC4NUGN6.js} +12 -8
- package/{readDocTool-W4NDXNEX.js → readDocTool-NCJ5NT25.js} +1 -1
- package/{readlineWorkspace-7BC66QSX.js → readlineWorkspace-RIE62QVZ.js} +5022 -921
- package/{removeDialogAgentAction-OSYNZRX7.js → removeDialogAgentAction-E2H3OZU6.js} +29 -28
- package/{runAgentClientLoop-6E6UC3CE.js → runAgentClientLoop-KLUUXBZS.js} +154 -97
- package/{runtimeDoctorCommands-ID23PNNZ.js → runtimeDoctorCommands-GIOGC5SC.js} +17 -17
- package/secretCommands-ZXZRLR3R.js +700 -0
- package/setDialogExtraReferencesAction-SITRPMYU.js +37 -0
- package/{setPrimaryDialogAgentAction-WZ7KI3YA.js → setPrimaryDialogAgentAction-U7N45TGC.js} +30 -29
- package/{chunk-SONWNI3L.js → settingThunks-Y7SVJOMZ.js} +223 -928
- package/{skillDiscovery-ZBU76COE.js → skillDiscovery-QC35EQY4.js} +2 -2
- package/{slateUtils-RIZES3PV.js → slateUtils-NGV2NMKM.js} +1 -1
- package/{spaceCommands-UJOVU4XI.js → spaceCommands-ZR5BR3GX.js} +59 -59
- package/{streamAgentChatTurn-3UXPYFNX.js → streamAgentChatTurn-MN2SSPGA.js} +309 -165
- package/{switchDialogAgentAction-GMR7WN3P.js → switchDialogAgentAction-OMGBD3N2.js} +26 -22
- package/{tableCommands-G7RV3RU3.js → tableCommands-U3QDY4L6.js} +19 -17
- package/{toolApiClient-CVGWM4PN.js → toolApiClient-7WSJJJBV.js} +6 -5
- package/tools-W2MOLERY.js +124 -0
- package/tuiSummaryLlmCaller-BM3VSTBU.js +130 -0
- package/{updateCommands-4EHDLF5J.js → updateCommands-NQXAGFM7.js} +3 -3
- package/{updateDialogTitleAction-UPFV7TDT.js → updateDialogTitleAction-Z4JX6REN.js} +102 -57
- package/workloadLifecycle-36DXRZKU.js +320 -0
- package/action-GI44T4DR.js +0 -31
- package/agentListCommands-IW3GQVUP.js +0 -427
- package/agentRecordCommands-VCA76W6B.js +0 -134
- package/agentRunCommand-YNLDKVR7.js +0 -161
- package/browser-image-compression-MFDTD7K6.js +0 -1763
- package/chatQueueReduxAdapter-TJRMXMYA.js +0 -186
- package/chromeOpsCommands-IXRLN57H.js +0 -289
- package/chunk-36KZDDO5.js +0 -2415
- package/chunk-ACQD6YI2.js +0 -25363
- package/chunk-CQ3WA2NE.js +0 -299
- package/chunk-CYSYR67N.js +0 -93
- package/chunk-JBTJAPUF.js +0 -35
- package/chunk-K2CSUCHJ.js +0 -620
- package/chunk-LTRXGFMS.js +0 -83
- package/chunk-M76ECQRD.js +0 -13658
- package/chunk-MEYIRKDN.js +0 -8967
- package/chunk-OCZKATRC.js +0 -129
- package/chunk-OTGFTBLI.js +0 -13
- package/chunk-PUOC4YRO.js +0 -394
- package/chunk-PZZTFEKK.js +0 -34
- package/chunk-URMS4XY2.js +0 -10
- package/chunk-UV6VISQJ.js +0 -20
- package/chunk-VJVNU77E.js +0 -83
- package/chunk-XYJSY4KG.js +0 -13807
- package/chunk-Y5GCAMGP.js +0 -9
- package/chunk-YPREESF4.js +0 -225
- package/contentThunks-BDIQRZR6.js +0 -73
- package/createDialogAction-B7VGVEVU.js +0 -66
- package/dialogCommands-G7YBVAMC.js +0 -102
- package/levelLazyShim-GZBKODGI.js +0 -7
- package/machineWsRunDispatch-L32G7C4P.js +0 -149
- package/serverStoreFactory-YMXDF4NI.js +0 -20
- package/setDialogExtraReferencesAction-M32UYNCG.js +0 -30
- package/settingSlice-Q6EKL7EQ.js +0 -204
- package/syncMapping-N6RGXGBW.js +0 -437
- package/tools-MKYDMWA4.js +0 -111
- package/tuiSummaryLlmCaller-3YFNHCTW.js +0 -128
- package/{chunk-SV5IJK6K.js → chunk-NBTY7YJF.js} +3 -3
- package/{chunk-2SYTUTLI.js → chunk-YBNHPX4S.js} +3 -3
- package/{offlineMarxistsAgentCommand-HGXZV4XJ.js → offlineMarxistsAgentCommand-2QTHJCHV.js} +4 -4
|
@@ -2,7 +2,7 @@ import {
|
|
|
2
2
|
clipMultilineText,
|
|
3
3
|
fetchAndSerializeTable,
|
|
4
4
|
waitForAbortableDelay
|
|
5
|
-
} from "./chunk-
|
|
5
|
+
} from "./chunk-ES633ZS5.js";
|
|
6
6
|
import {
|
|
7
7
|
isGatewayHttpStatus
|
|
8
8
|
} from "./chunk-NF64D32W.js";
|
|
@@ -11,46 +11,359 @@ import {
|
|
|
11
11
|
isCoreDrainingBody,
|
|
12
12
|
normalizeNonNegativeMs,
|
|
13
13
|
parseRetryAfterHeaderMs
|
|
14
|
-
} from "./chunk-
|
|
14
|
+
} from "./chunk-XPWGOTBQ.js";
|
|
15
15
|
import {
|
|
16
16
|
resolvePageReadMarkdown,
|
|
17
17
|
slateToSimplifiedMarkdown
|
|
18
|
-
} from "./chunk-
|
|
18
|
+
} from "./chunk-SCMHQUMK.js";
|
|
19
19
|
import {
|
|
20
20
|
extractCategorizedMentions
|
|
21
|
-
} from "./chunk-
|
|
21
|
+
} from "./chunk-AGIM7IMJ.js";
|
|
22
22
|
import {
|
|
23
23
|
fetchAndCacheMessages
|
|
24
|
-
} from "./chunk-
|
|
25
|
-
import {
|
|
26
|
-
extractRuntimePageCapabilities,
|
|
27
|
-
resolveBuiltinSkillPage,
|
|
28
|
-
resolveSkillGraphFromRoots
|
|
29
|
-
} from "./chunk-B2XUQXQX.js";
|
|
30
|
-
import {
|
|
31
|
-
estimateTokenCount
|
|
32
|
-
} from "./chunk-PSCNXBYA.js";
|
|
24
|
+
} from "./chunk-556RW72X.js";
|
|
33
25
|
import {
|
|
34
26
|
createSpaceKey
|
|
35
27
|
} from "./chunk-UAD2WT54.js";
|
|
36
|
-
import {
|
|
37
|
-
wrapHistoricalSummaryWithReplayGuard
|
|
38
|
-
} from "./chunk-4VJAC32I.js";
|
|
39
28
|
import {
|
|
40
29
|
read
|
|
41
|
-
} from "./chunk-
|
|
30
|
+
} from "./chunk-74RAWNQN.js";
|
|
42
31
|
import {
|
|
43
32
|
getRuntimeServerContext
|
|
44
|
-
} from "./chunk-
|
|
33
|
+
} from "./chunk-4YRTZIVN.js";
|
|
34
|
+
import {
|
|
35
|
+
extractRuntimePageCapabilities,
|
|
36
|
+
resolveBuiltinSkillPage,
|
|
37
|
+
resolveSkillGraphFromRoots
|
|
38
|
+
} from "./chunk-HIQ4GF53.js";
|
|
45
39
|
import {
|
|
46
40
|
isAbortError
|
|
47
|
-
} from "./chunk-
|
|
41
|
+
} from "./chunk-7DPNBQSV.js";
|
|
48
42
|
import {
|
|
49
43
|
extractCustomId
|
|
50
44
|
} from "./chunk-M2EJHDJP.js";
|
|
45
|
+
import {
|
|
46
|
+
isDialogRecordKey
|
|
47
|
+
} from "./chunk-5EMSBTQ6.js";
|
|
48
|
+
import {
|
|
49
|
+
estimateTokenCount
|
|
50
|
+
} from "./chunk-PSCNXBYA.js";
|
|
51
51
|
import {
|
|
52
52
|
asTrimmedString
|
|
53
53
|
} from "./chunk-3EUW3WEO.js";
|
|
54
|
+
import {
|
|
55
|
+
wrapHistoricalSummaryWithReplayGuard
|
|
56
|
+
} from "./chunk-4VJAC32I.js";
|
|
57
|
+
|
|
58
|
+
// packages/ai/chat/errorDiagnostics.ts
|
|
59
|
+
var record = (value) => value !== null && typeof value === "object" && !Array.isArray(value) ? value : {};
|
|
60
|
+
function httpOrigin(value) {
|
|
61
|
+
if (typeof value !== "string") return void 0;
|
|
62
|
+
try {
|
|
63
|
+
const url = new URL(value);
|
|
64
|
+
return url.protocol === "http:" || url.protocol === "https:" ? url.origin : void 0;
|
|
65
|
+
} catch {
|
|
66
|
+
return void 0;
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
var identifier = (value, max = 160) => typeof value === "string" && value.length <= max && /^[a-zA-Z0-9][a-zA-Z0-9._:/-]*$/.test(value) && !value.includes("://") && !/^(sk-|Bearer|AIza)/i.test(value) ? value : void 0;
|
|
70
|
+
function sanitizeErrorDiagnostics(value) {
|
|
71
|
+
const input = record(value);
|
|
72
|
+
const out = {};
|
|
73
|
+
for (const key of ["requestId", "provider", "model", "code"]) {
|
|
74
|
+
const safe = identifier(input[key], key === "code" ? 80 : 160);
|
|
75
|
+
if (safe) out[key] = safe;
|
|
76
|
+
}
|
|
77
|
+
if (typeof input.releaseSha === "string" && /^[a-fA-F0-9]{7,64}$/.test(input.releaseSha)) out.releaseSha = input.releaseSha;
|
|
78
|
+
const origin = httpOrigin(input.requestOrigin);
|
|
79
|
+
if (origin) out.requestOrigin = origin;
|
|
80
|
+
if (["found", "not_found", "invalid_record", "lookup_error", "not_requested"].includes(input.lookupStatus)) out.lookupStatus = input.lookupStatus;
|
|
81
|
+
if (typeof input.status === "number" && Number.isInteger(input.status) && input.status >= 100 && input.status <= 599) out.status = input.status;
|
|
82
|
+
if (["config_protocol", "empty", "policy", "quota", "transient"].includes(input.category)) out.category = input.category;
|
|
83
|
+
return Object.keys(out).length ? out : void 0;
|
|
84
|
+
}
|
|
85
|
+
function extractErrorDiagnostics(value, status) {
|
|
86
|
+
const envelope = record(value);
|
|
87
|
+
const error = record(envelope.error ?? value);
|
|
88
|
+
const diagnostics = record(record(error.details).diagnostics);
|
|
89
|
+
return sanitizeErrorDiagnostics({ ...diagnostics, code: error.code, status: status ?? error.status });
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
// packages/ai/chat/parseApiError.ts
|
|
93
|
+
var CONTEXT_OVERFLOW_ACTIONS = [
|
|
94
|
+
"compact-and-retry",
|
|
95
|
+
"new-dialog",
|
|
96
|
+
"switch-model",
|
|
97
|
+
"retry"
|
|
98
|
+
];
|
|
99
|
+
var CONTEXT_TOO_LARGE_ACTIONS = [
|
|
100
|
+
"new-dialog",
|
|
101
|
+
"switch-model",
|
|
102
|
+
"retry"
|
|
103
|
+
];
|
|
104
|
+
var truncateErrorMessage = (message, maxChars = 320) => message.length <= maxChars ? message : `${message.slice(0, maxChars)}\u2026`;
|
|
105
|
+
var isContextOverflowText = (message) => /maximum context|context (length|window|overflow|limit)|context_length_exceed\w*|requested about .*tokens|too many tokens|prompt is too long|exceeds? (the )?(model|max)/i.test(
|
|
106
|
+
message
|
|
107
|
+
);
|
|
108
|
+
var isQuotaExhaustedError = (status, ...texts) => status === 402 || /insufficient[_\s-]?(?:quota|balance|credits)|余额不足|wallet\s+balance\s+is\s+insufficient|payment[_ ]required/i.test(
|
|
109
|
+
texts.filter((t) => typeof t === "string").join(" ")
|
|
110
|
+
);
|
|
111
|
+
var QUOTA_EXHAUSTED_MESSAGE = "\u4F59\u989D\u6216\u914D\u989D\u5DF2\u8017\u5C3D\uFF0C\u672C\u6B21\u8BF7\u6C42\u672A\u88AB\u53D7\u7406\u3002\u8BF7\u5728 console \u7684 Billing \u9875\u9762\u5145\u503C\u540E\u91CD\u8BD5\uFF1B\u76F4\u63A5\u91CD\u53D1\u540C\u4E00\u8BF7\u6C42\u4E0D\u4F1A\u89E3\u51B3\u6B64\u95EE\u9898\u3002";
|
|
112
|
+
function classifyApiError(input) {
|
|
113
|
+
const { status, message, body, code } = input;
|
|
114
|
+
const errorMessage = message;
|
|
115
|
+
let defaultMessage = `\u72B6\u6001\u7801 ${status} ${input.statusText ?? ""}`;
|
|
116
|
+
switch (status) {
|
|
117
|
+
case 400:
|
|
118
|
+
if (isContextOverflowText(errorMessage) || isContextOverflowText(body) || code === "UPSTREAM_400") {
|
|
119
|
+
return {
|
|
120
|
+
kind: "context_overflow",
|
|
121
|
+
message: "\u4E0A\u4E0B\u6587\u8FC7\u957F\uFF1A\u672C\u8F6E\u6D88\u606F\u6216\u5DE5\u5177\u7ED3\u679C\u592A\u5927\u3002\u8BF7\u7F29\u5C0F\u8303\u56F4\uFF0C\u6216\u5148\u8BFB\u53D6\u66F4\u5C0F\u7247\u6BB5\u540E\u518D\u7EE7\u7EED\u3002",
|
|
122
|
+
code,
|
|
123
|
+
status,
|
|
124
|
+
retryable: true,
|
|
125
|
+
actions: [...CONTEXT_OVERFLOW_ACTIONS]
|
|
126
|
+
};
|
|
127
|
+
}
|
|
128
|
+
if (code === "MISSING_PROVIDER_API_KEY") {
|
|
129
|
+
return {
|
|
130
|
+
kind: "generic",
|
|
131
|
+
message: truncateErrorMessage(errorMessage),
|
|
132
|
+
code,
|
|
133
|
+
status,
|
|
134
|
+
retryable: false
|
|
135
|
+
};
|
|
136
|
+
}
|
|
137
|
+
if (errorMessage && errorMessage !== defaultMessage) {
|
|
138
|
+
return {
|
|
139
|
+
kind: "generic",
|
|
140
|
+
message: `\u8BF7\u6C42\u53C2\u6570\u9519\u8BEF: ${truncateErrorMessage(errorMessage)}`,
|
|
141
|
+
code,
|
|
142
|
+
status,
|
|
143
|
+
retryable: false
|
|
144
|
+
};
|
|
145
|
+
}
|
|
146
|
+
return { kind: "generic", message: "\u8BF7\u6C42\u53C2\u6570\u9519\u8BEF\uFF0C\u8BF7\u68C0\u67E5\u8F93\u5165", code, status, retryable: false };
|
|
147
|
+
case 413:
|
|
148
|
+
return {
|
|
149
|
+
kind: "context_too_large",
|
|
150
|
+
message: "\u8BF7\u6C42\u5185\u5BB9\u8FC7\u5927\uFF1A\u8BF7\u51CF\u5C11\u4E00\u6B21\u53D1\u9001\u7684\u6D88\u606F\u3001\u6587\u4EF6\u6216\u5DE5\u5177\u7ED3\u679C\u3002",
|
|
151
|
+
code,
|
|
152
|
+
status,
|
|
153
|
+
retryable: true,
|
|
154
|
+
actions: [...CONTEXT_TOO_LARGE_ACTIONS]
|
|
155
|
+
};
|
|
156
|
+
case 401:
|
|
157
|
+
return {
|
|
158
|
+
kind: "auth",
|
|
159
|
+
message: code === "AUTH_TOKEN_EXPIRED" ? "\u767B\u5F55\u72B6\u6001\u5DF2\u8FC7\u671F\uFF0C\u8BF7\u5148\u767B\u51FA\u540E\u91CD\u65B0\u767B\u5F55" : code === "AUTH_ACCOUNT_INVALID" ? "\u8D26\u6237\u65E0\u6548\u6216\u5DF2\u88AB\u505C\u7528\uFF0C\u8BF7\u8054\u7CFB\u7BA1\u7406\u5458" : code === "AUTH_NO_TOKEN" ? "\u672A\u68C0\u6D4B\u5230\u767B\u5F55\u72B6\u6001\uFF0C\u8BF7\u5148\u767B\u5F55" : code === "AUTH_INVALID_TOKEN" ? "\u767B\u5F55\u51ED\u8BC1\u65E0\u6548\uFF0C\u8BF7\u5148\u767B\u51FA\u540E\u91CD\u65B0\u767B\u5F55" : code === "AUTH_TOKEN_NOT_ACTIVE" ? "\u4EE4\u724C\u5C1A\u672A\u751F\u6548\uFF0C\u8BF7\u7A0D\u540E\u518D\u8BD5" : errorMessage && errorMessage !== `\u72B6\u6001\u7801 401 Unauthorized` ? `\u8BA4\u8BC1\u9519\u8BEF: ${truncateErrorMessage(errorMessage)}` : "\u8EAB\u4EFD\u9A8C\u8BC1\u5931\u8D25\uFF0C\u8BF7\u5148\u767B\u51FA\u540E\u91CD\u65B0\u767B\u5F55",
|
|
160
|
+
code,
|
|
161
|
+
status,
|
|
162
|
+
retryable: true,
|
|
163
|
+
actions: ["retry"]
|
|
164
|
+
};
|
|
165
|
+
case 503:
|
|
166
|
+
return {
|
|
167
|
+
kind: "server",
|
|
168
|
+
message: errorMessage && errorMessage !== `\u72B6\u6001\u7801 503 Service Unavailable` ? truncateErrorMessage(errorMessage) : "\u670D\u52A1\u6682\u65F6\u4E0D\u53EF\u7528\uFF0C\u8BF7\u7A0D\u540E\u518D\u8BD5",
|
|
169
|
+
code,
|
|
170
|
+
status,
|
|
171
|
+
retryable: true,
|
|
172
|
+
actions: ["retry"]
|
|
173
|
+
};
|
|
174
|
+
case 504:
|
|
175
|
+
return {
|
|
176
|
+
kind: "timeout",
|
|
177
|
+
message: "\u8BF7\u6C42\u8D85\u65F6\uFF0C\u8BF7\u7A0D\u540E\u518D\u8BD5",
|
|
178
|
+
code,
|
|
179
|
+
status,
|
|
180
|
+
retryable: true,
|
|
181
|
+
actions: ["retry"]
|
|
182
|
+
};
|
|
183
|
+
// 402 Payment Required(LithosAI/OpenAI 兼容网关的余额耗尽)。此前无 case,
|
|
184
|
+
// 落进 default(generic + retryable:true + 重试按钮),误导用户重发。
|
|
185
|
+
case 402:
|
|
186
|
+
return {
|
|
187
|
+
kind: "quota",
|
|
188
|
+
message: QUOTA_EXHAUSTED_MESSAGE,
|
|
189
|
+
code,
|
|
190
|
+
status,
|
|
191
|
+
// 余额耗尽重发无效:上游亦带 x-should-retry:false。
|
|
192
|
+
retryable: false
|
|
193
|
+
};
|
|
194
|
+
default:
|
|
195
|
+
if (isQuotaExhaustedError(status, errorMessage, body, code)) {
|
|
196
|
+
return {
|
|
197
|
+
kind: "quota",
|
|
198
|
+
message: QUOTA_EXHAUSTED_MESSAGE,
|
|
199
|
+
code,
|
|
200
|
+
status,
|
|
201
|
+
retryable: false
|
|
202
|
+
};
|
|
203
|
+
}
|
|
204
|
+
return {
|
|
205
|
+
kind: "generic",
|
|
206
|
+
message: `API\u8BF7\u6C42\u5931\u8D25: ${truncateErrorMessage(errorMessage)}`,
|
|
207
|
+
code,
|
|
208
|
+
status,
|
|
209
|
+
retryable: true,
|
|
210
|
+
actions: ["retry"]
|
|
211
|
+
};
|
|
212
|
+
}
|
|
213
|
+
}
|
|
214
|
+
async function parseApiErrorInfo(response) {
|
|
215
|
+
const errorBody = await response.text();
|
|
216
|
+
let errorMessage = `\u72B6\u6001\u7801 ${response.status} ${response.statusText}`;
|
|
217
|
+
let errorCode = `E${response.status}`;
|
|
218
|
+
try {
|
|
219
|
+
const errorJson = JSON.parse(errorBody);
|
|
220
|
+
errorMessage = errorJson?.error?.message || errorJson?.message || errorJson?.msg || errorBody || errorMessage;
|
|
221
|
+
errorCode = errorJson?.error?.code || errorJson?.code || errorCode;
|
|
222
|
+
} catch (_e) {
|
|
223
|
+
if (errorBody) {
|
|
224
|
+
errorMessage = errorBody;
|
|
225
|
+
}
|
|
226
|
+
}
|
|
227
|
+
return classifyApiError({
|
|
228
|
+
status: response.status,
|
|
229
|
+
statusText: response.statusText,
|
|
230
|
+
message: errorMessage,
|
|
231
|
+
body: errorBody,
|
|
232
|
+
code: errorCode
|
|
233
|
+
});
|
|
234
|
+
}
|
|
235
|
+
async function parseApiError(response) {
|
|
236
|
+
return (await parseApiErrorInfo(response)).message;
|
|
237
|
+
}
|
|
238
|
+
var UPSTREAM_AUTH_FAILURE_MESSAGE = "\u4E0A\u6E38\u9274\u6743\u5931\u8D25\uFF08401/403\uFF09\u3002\u82E5\u4F7F\u7528\u5E73\u53F0\u6258\u7BA1\u6A21\u578B\uFF0C\u8FD9\u662F\u5E73\u53F0\u4FA7\u51ED\u636E\u95EE\u9898\u3001\u4E0D\u662F\u4F60\u7684\u914D\u7F6E\u95EE\u9898\uFF0C\u8BF7\u8054\u7CFB\u7BA1\u7406\u5458\uFF1B\u82E5\u4F7F\u7528\u81EA\u5DF1\u7684 API Key\uFF0C\u8BF7\u68C0\u67E5\u8BE5 Key \u662F\u5426\u6709\u6548\u3002\u91CD\u590D\u53D1\u9001\u4E0D\u4F1A\u89E3\u51B3\u6B64\u95EE\u9898\u3002";
|
|
239
|
+
function classifyGenerationError(data, status) {
|
|
240
|
+
const error = data?.error ?? data;
|
|
241
|
+
const upstreamStatus = error?.status ?? data?.status;
|
|
242
|
+
if (status === void 0 && typeof upstreamStatus === "number") status = upstreamStatus;
|
|
243
|
+
const rawCode = error?.code ?? data?.code;
|
|
244
|
+
const code = typeof rawCode === "string" && /^[a-zA-Z0-9_.:-]{1,80}$/.test(rawCode) && !/^(sk-|Bearer|AIza)/i.test(rawCode) ? rawCode : void 0;
|
|
245
|
+
const message = typeof error?.message === "string" ? error.message : typeof error?.msg === "string" ? error.msg : typeof data === "string" ? data : "";
|
|
246
|
+
const evidence = `${code ?? ""} ${message}`;
|
|
247
|
+
let category = "config_protocol";
|
|
248
|
+
if (/content[_ -]filter|content[_ -]policy|safety[_ -](?:violation|blocked)|policy[_ -]violation|prohibited[_ -]content/i.test(evidence)) {
|
|
249
|
+
category = "policy";
|
|
250
|
+
} else if (isQuotaExhaustedError(status ?? 0, evidence, code)) {
|
|
251
|
+
category = "quota";
|
|
252
|
+
} else if (/thought_signature|reasoning_effort|not supported|invalid[_ -](?:request|argument)|authentication|api[_ -]key/i.test(evidence) || status === 401 || status === 403) {
|
|
253
|
+
category = "config_protocol";
|
|
254
|
+
} else if (code === "EMPTY_RESPONSE" || /空响应|empty response/i.test(message)) {
|
|
255
|
+
category = "empty";
|
|
256
|
+
} else if (status === 408 || status === 429 || status !== void 0 && status >= 500 || /timeout|timed out|秒内没有返回新内容|network|fetch failed|failed to fetch|ECONNRESET|ECONNREFUSED|EPIPE|socket hang up|connection (?:reset|closed)|rate[_ -]limit|overloaded|temporarily unavailable|internal_server_error|service_unavailable/i.test(evidence)) {
|
|
257
|
+
category = "transient";
|
|
258
|
+
}
|
|
259
|
+
const authFailure = status === 401 || status === 403 || /authentication|unauthori[sz]ed|forbidden|invalid[_ -]api[_ -]key|api[_ -]key (?:invalid|revoked)/i.test(
|
|
260
|
+
evidence
|
|
261
|
+
);
|
|
262
|
+
const messages = {
|
|
263
|
+
config_protocol: authFailure ? UPSTREAM_AUTH_FAILURE_MESSAGE : "\u6A21\u578B\u914D\u7F6E\u6216\u5DE5\u5177\u901A\u4FE1\u4E0D\u517C\u5BB9\uFF0C\u8BF7\u8054\u7CFB\u7BA1\u7406\u5458\u68C0\u67E5\u914D\u7F6E\uFF1B\u91CD\u590D\u53D1\u9001\u4E0D\u4F1A\u89E3\u51B3\u6B64\u95EE\u9898\u3002",
|
|
264
|
+
empty: "\u6A21\u578B\u8FD4\u56DE\u4E86\u7A7A\u54CD\u5E94\uFF0C\u8BF7\u8054\u7CFB\u7BA1\u7406\u5458\u68C0\u67E5\u670D\u52A1\u54CD\u5E94\u3002",
|
|
265
|
+
policy: "\u670D\u52A1\u5546\u7684\u5185\u5BB9\u5B89\u5168\u89C4\u5219\u963B\u6B62\u4E86\u672C\u6B21\u8BF7\u6C42\u3002\u8BF7\u68C0\u67E5\u8BF7\u6C42\u662F\u5426\u7B26\u5408\u5176\u89C4\u5219\uFF1B\u4E0D\u4F1A\u81EA\u52A8\u91CD\u8BD5\u6216\u6539\u5199\u5185\u5BB9\u3002",
|
|
266
|
+
quota: QUOTA_EXHAUSTED_MESSAGE,
|
|
267
|
+
transient: "\u6A21\u578B\u670D\u52A1\u6682\u65F6\u4E0D\u53EF\u7528\u3002\u4F60\u53EF\u4EE5\u7A0D\u540E\u624B\u52A8\u91CD\u8BD5\u540C\u4E00\u6A21\u578B\uFF08\u65B0\u8BF7\u6C42\u53EF\u80FD\u4EA7\u751F\u8D39\u7528\uFF09\u3002"
|
|
268
|
+
};
|
|
269
|
+
return {
|
|
270
|
+
category,
|
|
271
|
+
message: messages[category],
|
|
272
|
+
retryable: category === "transient",
|
|
273
|
+
actions: category === "transient" ? ["retry"] : [],
|
|
274
|
+
diagnostic: { ...extractErrorDiagnostics(data, status) }
|
|
275
|
+
};
|
|
276
|
+
}
|
|
277
|
+
|
|
278
|
+
// packages/ai/chat/serverProxyRetry.ts
|
|
279
|
+
var DEFAULT_SERVER_PROXY_RETRY_AFTER_MS = 1500;
|
|
280
|
+
var MAX_SERVER_PROXY_RETRIES = 2;
|
|
281
|
+
var MAX_STATUS_RETRIES = 3;
|
|
282
|
+
var MAX_SERVER_DRAIN_STATUS_RETRIES = 30;
|
|
283
|
+
var readRetryableResponseBody = async (response) => {
|
|
284
|
+
try {
|
|
285
|
+
return await response.clone().json();
|
|
286
|
+
} catch {
|
|
287
|
+
return null;
|
|
288
|
+
}
|
|
289
|
+
};
|
|
290
|
+
var resolveServerProxyRetryAfterMs = (response, body) => parseRetryAfterHeaderMs(response.headers.get("Retry-After")) ?? normalizeNonNegativeMs(
|
|
291
|
+
body?.retryAfterMs,
|
|
292
|
+
DEFAULT_SERVER_PROXY_RETRY_AFTER_MS
|
|
293
|
+
);
|
|
294
|
+
var isRetryableServerProxyFetchError = (error) => {
|
|
295
|
+
if (!error || isAbortError(error)) return false;
|
|
296
|
+
const message = typeof error?.message === "string" ? error.message : String(error);
|
|
297
|
+
return /ECONNREFUSED|ECONNRESET|EPIPE|socket hang up|network error|failed to fetch|fetch failed|connection closed|load failed|502|503|504/i.test(
|
|
298
|
+
message
|
|
299
|
+
);
|
|
300
|
+
};
|
|
301
|
+
var waitForServerProxyRetry = async (retryAfterMs, signal) => {
|
|
302
|
+
const delayMs = normalizeNonNegativeMs(
|
|
303
|
+
retryAfterMs,
|
|
304
|
+
DEFAULT_SERVER_PROXY_RETRY_AFTER_MS
|
|
305
|
+
);
|
|
306
|
+
if (delayMs <= 0) return;
|
|
307
|
+
await waitForAbortableDelay(delayMs, signal);
|
|
308
|
+
};
|
|
309
|
+
var performServerProxyFetchWithRetry = async ({
|
|
310
|
+
execute,
|
|
311
|
+
signal,
|
|
312
|
+
logPrefix = "[fetchWithServerProxy]",
|
|
313
|
+
onRetry,
|
|
314
|
+
retryNetworkErrors = true
|
|
315
|
+
}) => {
|
|
316
|
+
let networkRetries = 0;
|
|
317
|
+
let statusRetries = 0;
|
|
318
|
+
while (true) {
|
|
319
|
+
try {
|
|
320
|
+
const response = await execute();
|
|
321
|
+
const responseBody = isGatewayHttpStatus(response.status) ? await readRetryableResponseBody(response) : null;
|
|
322
|
+
const isCoreDraining = response.status === 503 && isCoreDrainingBody(responseBody);
|
|
323
|
+
const maxStatusRetries = isCoreDraining ? MAX_SERVER_DRAIN_STATUS_RETRIES : MAX_STATUS_RETRIES;
|
|
324
|
+
const classified = classifyGenerationError(responseBody, response.status);
|
|
325
|
+
if (classified.category === "transient" && statusRetries < maxStatusRetries && isGatewayHttpStatus(response.status)) {
|
|
326
|
+
statusRetries += 1;
|
|
327
|
+
const retryAfterMs = resolveServerProxyRetryAfterMs(
|
|
328
|
+
response,
|
|
329
|
+
responseBody
|
|
330
|
+
);
|
|
331
|
+
console.warn(
|
|
332
|
+
`${logPrefix} \u68C0\u6D4B\u5230${response.status}\u72B6\u6001\uFF0C${retryAfterMs}ms\u540E\u91CD\u8BD5...`
|
|
333
|
+
);
|
|
334
|
+
onRetry?.({
|
|
335
|
+
attempt: statusRetries,
|
|
336
|
+
maxAttempts: maxStatusRetries,
|
|
337
|
+
delayMs: retryAfterMs
|
|
338
|
+
});
|
|
339
|
+
await waitForServerProxyRetry(retryAfterMs, signal);
|
|
340
|
+
continue;
|
|
341
|
+
}
|
|
342
|
+
if (isCoreDraining) {
|
|
343
|
+
console.warn(`${logPrefix} core_draining \u91CD\u8BD5\u8017\u5C3D\uFF0C\u8FD4\u56DE\u53CB\u597D\u63D0\u793A`);
|
|
344
|
+
return createDrainExhaustedResponse(response);
|
|
345
|
+
}
|
|
346
|
+
return response;
|
|
347
|
+
} catch (error) {
|
|
348
|
+
if (retryNetworkErrors && networkRetries < MAX_SERVER_PROXY_RETRIES && isRetryableServerProxyFetchError(error)) {
|
|
349
|
+
networkRetries += 1;
|
|
350
|
+
const retryDelay = networkRetries * 1e3;
|
|
351
|
+
console.warn(
|
|
352
|
+
`${logPrefix} \u68C0\u6D4B\u5230\u7F51\u7EDC\u77AC\u65AD\uFF0C${retryDelay}ms\u540E\u91CD\u8BD5(\u7B2C${networkRetries}\u6B21)...`,
|
|
353
|
+
error
|
|
354
|
+
);
|
|
355
|
+
onRetry?.({
|
|
356
|
+
attempt: networkRetries,
|
|
357
|
+
maxAttempts: MAX_SERVER_PROXY_RETRIES,
|
|
358
|
+
delayMs: retryDelay
|
|
359
|
+
});
|
|
360
|
+
await waitForServerProxyRetry(retryDelay, signal);
|
|
361
|
+
continue;
|
|
362
|
+
}
|
|
363
|
+
throw error;
|
|
364
|
+
}
|
|
365
|
+
}
|
|
366
|
+
};
|
|
54
367
|
|
|
55
368
|
// packages/ai/agent/referenceUtils.ts
|
|
56
369
|
function mergeReferences(base, extra) {
|
|
@@ -151,12 +464,12 @@ var resolveReferenceAssets = async (references, dispatch) => {
|
|
|
151
464
|
}
|
|
152
465
|
const resolvedSkillLinks = await resolveSkillGraphFromRoots({
|
|
153
466
|
roots: [
|
|
154
|
-
...Array.from(hardSkillKeys).map((
|
|
155
|
-
...Array.from(softSkillKeys).map((
|
|
467
|
+
...Array.from(hardSkillKeys).map((identifier2) => ({ identifier: identifier2, mode: "required" })),
|
|
468
|
+
...Array.from(softSkillKeys).map((identifier2) => ({ identifier: identifier2, mode: "recommended" }))
|
|
156
469
|
],
|
|
157
|
-
loadPage: async (
|
|
158
|
-
const loaded = await loadContentsByKeys([
|
|
159
|
-
return loaded.get(
|
|
470
|
+
loadPage: async (identifier2) => {
|
|
471
|
+
const loaded = await loadContentsByKeys([identifier2], dispatch, contentByKey);
|
|
472
|
+
return loaded.get(identifier2) ?? null;
|
|
160
473
|
},
|
|
161
474
|
contentByKey
|
|
162
475
|
});
|
|
@@ -219,12 +532,12 @@ var resolveToolsFromKeys = async (keys, dispatch, preloaded) => {
|
|
|
219
532
|
}
|
|
220
533
|
const resolvedSkillLinks = await resolveSkillGraphFromRoots({
|
|
221
534
|
roots: [
|
|
222
|
-
...Array.from(hardSkillKeys).map((
|
|
223
|
-
...Array.from(softSkillKeys).map((
|
|
535
|
+
...Array.from(hardSkillKeys).map((identifier2) => ({ identifier: identifier2, mode: "required" })),
|
|
536
|
+
...Array.from(softSkillKeys).map((identifier2) => ({ identifier: identifier2, mode: "recommended" }))
|
|
224
537
|
],
|
|
225
|
-
loadPage: async (
|
|
226
|
-
const loaded = await loadContentsByKeys([
|
|
227
|
-
return loaded.get(
|
|
538
|
+
loadPage: async (identifier2) => {
|
|
539
|
+
const loaded = await loadContentsByKeys([identifier2], dispatch, contentByKey);
|
|
540
|
+
return loaded.get(identifier2) ?? null;
|
|
228
541
|
},
|
|
229
542
|
contentByKey
|
|
230
543
|
});
|
|
@@ -250,95 +563,6 @@ var resolveToolsFromKeys = async (keys, dispatch, preloaded) => {
|
|
|
250
563
|
};
|
|
251
564
|
};
|
|
252
565
|
|
|
253
|
-
// packages/ai/chat/serverProxyRetry.ts
|
|
254
|
-
var DEFAULT_SERVER_PROXY_RETRY_AFTER_MS = 1500;
|
|
255
|
-
var MAX_SERVER_PROXY_RETRIES = 2;
|
|
256
|
-
var MAX_STATUS_RETRIES = 3;
|
|
257
|
-
var MAX_SERVER_DRAIN_STATUS_RETRIES = 30;
|
|
258
|
-
var readRetryableResponseBody = async (response) => {
|
|
259
|
-
try {
|
|
260
|
-
return await response.clone().json();
|
|
261
|
-
} catch {
|
|
262
|
-
return null;
|
|
263
|
-
}
|
|
264
|
-
};
|
|
265
|
-
var resolveServerProxyRetryAfterMs = (response, body) => parseRetryAfterHeaderMs(response.headers.get("Retry-After")) ?? normalizeNonNegativeMs(
|
|
266
|
-
body?.retryAfterMs,
|
|
267
|
-
DEFAULT_SERVER_PROXY_RETRY_AFTER_MS
|
|
268
|
-
);
|
|
269
|
-
var isRetryableServerProxyFetchError = (error) => {
|
|
270
|
-
if (!error || isAbortError(error)) return false;
|
|
271
|
-
const message = typeof error?.message === "string" ? error.message : String(error);
|
|
272
|
-
return /ECONNREFUSED|ECONNRESET|EPIPE|socket hang up|network error|failed to fetch|fetch failed|connection closed|load failed|502|503|504/i.test(
|
|
273
|
-
message
|
|
274
|
-
);
|
|
275
|
-
};
|
|
276
|
-
var waitForServerProxyRetry = async (retryAfterMs, signal) => {
|
|
277
|
-
const delayMs = normalizeNonNegativeMs(
|
|
278
|
-
retryAfterMs,
|
|
279
|
-
DEFAULT_SERVER_PROXY_RETRY_AFTER_MS
|
|
280
|
-
);
|
|
281
|
-
if (delayMs <= 0) return;
|
|
282
|
-
await waitForAbortableDelay(delayMs, signal);
|
|
283
|
-
};
|
|
284
|
-
var performServerProxyFetchWithRetry = async ({
|
|
285
|
-
execute,
|
|
286
|
-
signal,
|
|
287
|
-
logPrefix = "[fetchWithServerProxy]",
|
|
288
|
-
onRetry,
|
|
289
|
-
retryNetworkErrors = true
|
|
290
|
-
}) => {
|
|
291
|
-
let networkRetries = 0;
|
|
292
|
-
let statusRetries = 0;
|
|
293
|
-
while (true) {
|
|
294
|
-
try {
|
|
295
|
-
const response = await execute();
|
|
296
|
-
const responseBody = response.status === 503 ? await readRetryableResponseBody(response) : null;
|
|
297
|
-
const isCoreDraining = response.status === 503 && isCoreDrainingBody(responseBody);
|
|
298
|
-
const maxStatusRetries = isCoreDraining ? MAX_SERVER_DRAIN_STATUS_RETRIES : MAX_STATUS_RETRIES;
|
|
299
|
-
if (statusRetries < maxStatusRetries && isGatewayHttpStatus(response.status)) {
|
|
300
|
-
statusRetries += 1;
|
|
301
|
-
const retryAfterMs = resolveServerProxyRetryAfterMs(
|
|
302
|
-
response,
|
|
303
|
-
responseBody
|
|
304
|
-
);
|
|
305
|
-
console.warn(
|
|
306
|
-
`${logPrefix} \u68C0\u6D4B\u5230${response.status}\u72B6\u6001\uFF0C${retryAfterMs}ms\u540E\u91CD\u8BD5...`
|
|
307
|
-
);
|
|
308
|
-
onRetry?.({
|
|
309
|
-
attempt: statusRetries,
|
|
310
|
-
maxAttempts: maxStatusRetries,
|
|
311
|
-
delayMs: retryAfterMs
|
|
312
|
-
});
|
|
313
|
-
await waitForServerProxyRetry(retryAfterMs, signal);
|
|
314
|
-
continue;
|
|
315
|
-
}
|
|
316
|
-
if (isCoreDraining) {
|
|
317
|
-
console.warn(`${logPrefix} core_draining \u91CD\u8BD5\u8017\u5C3D\uFF0C\u8FD4\u56DE\u53CB\u597D\u63D0\u793A`);
|
|
318
|
-
return createDrainExhaustedResponse(response);
|
|
319
|
-
}
|
|
320
|
-
return response;
|
|
321
|
-
} catch (error) {
|
|
322
|
-
if (retryNetworkErrors && networkRetries < MAX_SERVER_PROXY_RETRIES && isRetryableServerProxyFetchError(error)) {
|
|
323
|
-
networkRetries += 1;
|
|
324
|
-
const retryDelay = networkRetries * 1e3;
|
|
325
|
-
console.warn(
|
|
326
|
-
`${logPrefix} \u68C0\u6D4B\u5230\u7F51\u7EDC\u77AC\u65AD\uFF0C${retryDelay}ms\u540E\u91CD\u8BD5(\u7B2C${networkRetries}\u6B21)...`,
|
|
327
|
-
error
|
|
328
|
-
);
|
|
329
|
-
onRetry?.({
|
|
330
|
-
attempt: networkRetries,
|
|
331
|
-
maxAttempts: MAX_SERVER_PROXY_RETRIES,
|
|
332
|
-
delayMs: retryDelay
|
|
333
|
-
});
|
|
334
|
-
await waitForServerProxyRetry(retryDelay, signal);
|
|
335
|
-
continue;
|
|
336
|
-
}
|
|
337
|
-
throw error;
|
|
338
|
-
}
|
|
339
|
-
}
|
|
340
|
-
};
|
|
341
|
-
|
|
342
566
|
// packages/create/editor/transforms/slateToText.ts
|
|
343
567
|
function getNodeText(node) {
|
|
344
568
|
if (node.text) {
|
|
@@ -494,6 +718,9 @@ var fetchDialogReference = async (dbKey, refContent, dispatch) => {
|
|
|
494
718
|
return await fetchAndCacheMessages({
|
|
495
719
|
db,
|
|
496
720
|
dialogId,
|
|
721
|
+
// 引用读也带 key:keyless 读会让服务端退到 `dialog-*` 全命名空间扫描。
|
|
722
|
+
// dbKey 不是合法的 dialog 记录 key 时不硬编,保持原样(fail-open)。
|
|
723
|
+
dialogKey: isDialogRecordKey(dbKey) ? dbKey : void 0,
|
|
497
724
|
limit: DIALOG_REFERENCE_MESSAGE_LIMIT,
|
|
498
725
|
token,
|
|
499
726
|
remoteServers: remoteServers.length > 0 ? remoteServers : void 0
|
|
@@ -673,9 +900,16 @@ var fetchReferenceContents = async (references, dispatch, options = { format: "s
|
|
|
673
900
|
};
|
|
674
901
|
|
|
675
902
|
export {
|
|
903
|
+
extractErrorDiagnostics,
|
|
904
|
+
CONTEXT_OVERFLOW_ACTIONS,
|
|
905
|
+
CONTEXT_TOO_LARGE_ACTIONS,
|
|
906
|
+
isContextOverflowText,
|
|
907
|
+
classifyApiError,
|
|
908
|
+
parseApiError,
|
|
909
|
+
classifyGenerationError,
|
|
910
|
+
performServerProxyFetchWithRetry,
|
|
676
911
|
fetchReferenceContents,
|
|
677
912
|
mergeReferences,
|
|
678
913
|
resolveReferenceAssets,
|
|
679
|
-
resolveToolsFromKeys
|
|
680
|
-
performServerProxyFetchWithRetry
|
|
914
|
+
resolveToolsFromKeys
|
|
681
915
|
};
|
|
@@ -1,28 +1,34 @@
|
|
|
1
1
|
import {
|
|
2
2
|
addContentToSpace
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-ZKZ5X2HS.js";
|
|
4
4
|
import {
|
|
5
|
+
format,
|
|
5
6
|
prepareAndPersistMessage,
|
|
6
7
|
uiAskChoiceFunc,
|
|
7
8
|
uiAskChoiceFunctionSchema
|
|
8
|
-
} from "./chunk-
|
|
9
|
+
} from "./chunk-556RW72X.js";
|
|
9
10
|
import {
|
|
10
|
-
|
|
11
|
-
} from "./chunk-
|
|
12
|
-
import {
|
|
13
|
-
buildBuiltinObjectSkillReference
|
|
14
|
-
} from "./chunk-6TPOEJMQ.js";
|
|
15
|
-
import {
|
|
16
|
-
PLATFORM_HOSTED_DEEPSEEK_FLASH_MODEL,
|
|
17
|
-
PLATFORM_HOSTED_KIMI_PROVIDER
|
|
18
|
-
} from "./chunk-Y3PMXGLH.js";
|
|
11
|
+
formatISO
|
|
12
|
+
} from "./chunk-ZRAU6T47.js";
|
|
19
13
|
import {
|
|
20
14
|
read,
|
|
21
15
|
readAndWait,
|
|
22
16
|
removeCachedEntity,
|
|
23
17
|
upsertSSREntity,
|
|
24
18
|
write
|
|
25
|
-
} from "./chunk-
|
|
19
|
+
} from "./chunk-74RAWNQN.js";
|
|
20
|
+
import {
|
|
21
|
+
isDevelopment
|
|
22
|
+
} from "./chunk-6Q7UTJKR.js";
|
|
23
|
+
import {
|
|
24
|
+
selectIdentityUserId
|
|
25
|
+
} from "./chunk-SEJ5OS6F.js";
|
|
26
|
+
import {
|
|
27
|
+
buildBuiltinObjectSkillReference
|
|
28
|
+
} from "./chunk-JZX2XLKC.js";
|
|
29
|
+
import {
|
|
30
|
+
extractCustomId
|
|
31
|
+
} from "./chunk-M2EJHDJP.js";
|
|
26
32
|
import {
|
|
27
33
|
createAgentKey,
|
|
28
34
|
createDialogKey,
|
|
@@ -30,34 +36,23 @@ import {
|
|
|
30
36
|
dialogMessageRange,
|
|
31
37
|
memoryOwnerRange,
|
|
32
38
|
memorySubjectKindRange
|
|
33
|
-
} from "./chunk-
|
|
39
|
+
} from "./chunk-5EMSBTQ6.js";
|
|
34
40
|
import {
|
|
35
|
-
|
|
36
|
-
} from "./chunk-
|
|
37
|
-
import {
|
|
38
|
-
selectIdentityUserId
|
|
39
|
-
} from "./chunk-SEJ5OS6F.js";
|
|
41
|
+
asOptionalPositiveFiniteNumber
|
|
42
|
+
} from "./chunk-U6VC4MU4.js";
|
|
40
43
|
import {
|
|
41
44
|
isRecord
|
|
42
45
|
} from "./chunk-KUG52IAP.js";
|
|
43
|
-
import {
|
|
44
|
-
extractCustomId
|
|
45
|
-
} from "./chunk-M2EJHDJP.js";
|
|
46
46
|
import {
|
|
47
47
|
asTrimmedString
|
|
48
48
|
} from "./chunk-3EUW3WEO.js";
|
|
49
|
-
import {
|
|
50
|
-
asOptionalPositiveFiniteNumber
|
|
51
|
-
} from "./chunk-U6VC4MU4.js";
|
|
52
49
|
import {
|
|
53
50
|
asOptionalTrimmedString
|
|
54
51
|
} from "./chunk-G3SUCT4W.js";
|
|
55
52
|
import {
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
// packages/chat/dialog/actions/createDialogAction.ts
|
|
60
|
-
var import_date_fns = __toESM(require_date_fns());
|
|
53
|
+
PLATFORM_HOSTED_DEEPSEEK_FLASH_MODEL,
|
|
54
|
+
PLATFORM_HOSTED_KIMI_PROVIDER
|
|
55
|
+
} from "./chunk-CHCS6XPJ.js";
|
|
61
56
|
|
|
62
57
|
// packages/chat/dialog/objectAssistantRegistry.ts
|
|
63
58
|
var OBJECT_ASSISTANT_TO_SKILL = {
|
|
@@ -811,7 +806,7 @@ var createDialogAction = async (args, thunkApi) => {
|
|
|
811
806
|
preview: recentRelationshipRecapResolution.recap ?? null
|
|
812
807
|
});
|
|
813
808
|
}
|
|
814
|
-
const time =
|
|
809
|
+
const time = format(/* @__PURE__ */ new Date(), "MM-dd HH:mm");
|
|
815
810
|
const title = titleOverride || (agentMode === "auto" ? "\u65B0\u5BF9\u8BDD" : agentConfig?.name || "Agent") + " " + time;
|
|
816
811
|
const spaceId = explicitSpaceId;
|
|
817
812
|
const dialogPath = createDialogKey(userId);
|
|
@@ -853,7 +848,7 @@ var createDialogAction = async (args, thunkApi) => {
|
|
|
853
848
|
...agentMode === "auto" && autoRoute ? { autoRoute } : {},
|
|
854
849
|
title,
|
|
855
850
|
type: "dialog" /* DIALOG */,
|
|
856
|
-
createdAt:
|
|
851
|
+
createdAt: formatISO(/* @__PURE__ */ new Date()),
|
|
857
852
|
...spaceId && { spaceId },
|
|
858
853
|
category,
|
|
859
854
|
referenceKeys,
|