nolo-cli 0.84.0-alpha.1 → 0.84.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +2 -2
- package/{_executeModel-IULR47HG.js → _executeModel-BPUR2QYH.js} +51 -50
- package/{action-D22U6CTH.js → action-P4TNFGAD.js} +11 -11
- package/{addContentAction-XAPUTGL4.js → addContentAction-MB2HHMDZ.js} +9 -9
- package/{addDialogAgentAction-M7VLLBZM.js → addDialogAgentAction-S2NRBCWW.js} +9 -9
- package/{agentDeleteCommand-2S4WCDQC.js → agentDeleteCommand-MNAA6MIG.js} +32 -30
- package/{agentEmailCommands-V3ADGHX7.js → agentEmailCommands-SK34WJKU.js} +70 -66
- package/{agentGrantCommands-R3VQEZJR.js → agentGrantCommands-M3XFO6EN.js} +2 -2
- package/{agentListCommands-EPK3S274.js → agentListCommands-I26MKI4T.js} +55 -36
- package/{agentMachineCommands-XMZWK7P3.js → agentMachineCommands-M6QDR6P3.js} +32 -30
- package/{agentProviderCommands-65ZC2WB4.js → agentProviderCommands-X3UNW77C.js} +87 -0
- package/{agentPullCommand-N7L2CT7L.js → agentPullCommand-O5MPVJ5E.js} +3 -3
- package/agentRecordCommands-HTHLO2MM.js +129 -0
- package/{agentRunCommand-VUWNWC7C.js → agentRunCommand-IAIRCMTH.js} +70 -65
- package/{agentRunControl-T44MESII.js → agentRunControl-AVJR4JW4.js} +2 -2
- package/{agentRuntimeLocal-YRONTDLM.js → agentRuntimeLocal-3WTYYIT2.js} +32 -26
- package/{agentSlice-2P7OJFES.js → agentSlice-TVP3HINW.js} +10 -10
- package/{appDeleteCommands-YS7UGMP3.js → appDeleteCommands-SB5TNLKY.js} +32 -30
- package/{appDeployCommands-XIE5Z4BE.js → appDeployCommands-2IPKZINV.js} +32 -30
- package/{appDeployStatusCommands-54UDVYET.js → appDeployStatusCommands-K63TFUID.js} +32 -30
- package/{appGetCommands-6XYLBCRN.js → appGetCommands-VU2SLNEH.js} +32 -30
- package/{appListCommands-VEGH7SF5.js → appListCommands-S3T4DJ36.js} +32 -30
- package/{authCommand-JIEOFHXW.js → authCommand-HGP2XTKC.js} +185 -28
- package/{authCommands-ILTBI6JV.js → authCommands-RGOGCPP6.js} +4 -5
- package/builtinSkillRegistry-Q2VVY3SC.js +33 -0
- package/{chatQueueReduxAdapter-GPYCH5Z2.js → chatQueueReduxAdapter-TWIYKVIZ.js} +25 -25
- package/{chromeCommands-VOIRNJBL.js → chromeCommands-FZYAU75D.js} +1 -1
- package/{chromeOpsCommands-M7DPCX2T.js → chromeOpsCommands-62P2Q2YB.js} +31 -1
- package/{chunk-C3FZR5EC.js → chunk-2F7RJC6L.js} +1 -1
- package/{chunk-BOYUESO7.js → chunk-3AMA42ZI.js} +1 -1
- package/{chunk-RZOJRTKR.js → chunk-3BGIKIPF.js} +444 -920
- package/{chunk-HQUORJTM.js → chunk-3BMYXEUW.js} +1 -1
- package/{chunk-EBKMQULC.js → chunk-3IUWIAHP.js} +13 -15
- package/{chunk-NTW5GWDM.js → chunk-3VNWWVKB.js} +2 -0
- package/{chunk-4SZ37KLL.js → chunk-3VUWPRFW.js} +50 -30
- package/{chunk-WL2RKIBF.js → chunk-3YIAR5UI.js} +1 -1
- package/{chunk-DWUCB2A3.js → chunk-42V6BK2E.js} +1 -1
- package/{chunk-AX7RMXSH.js → chunk-4MK3I7Y4.js} +38 -4
- package/{chunk-PF6O3GR3.js → chunk-52Q2IW2X.js} +1340 -1273
- package/{chunk-Y3NZYLPG.js → chunk-5MEYHVIB.js} +1 -1
- package/{chunk-5XTOKQLW.js → chunk-5UTFL4QJ.js} +6 -2
- package/chunk-5ZUL4CUO.js +10 -0
- package/{chunk-6YTOJY35.js → chunk-6D2JFXLY.js} +35 -0
- package/{chunk-E6RGHPDR.js → chunk-6D6VBVEW.js} +4 -6
- package/{chunk-FZGV4FGK.js → chunk-6GFOD3TK.js} +260 -140
- package/{chunk-TMPLPCVX.js → chunk-6OZ36FXI.js} +2 -2
- package/{chunk-PZM3EENV.js → chunk-6Z7MY3V7.js} +1 -1
- package/{chunk-BYEJ7K2Z.js → chunk-7S4YWN7P.js} +1 -1
- package/{chunk-SREASRV5.js → chunk-ABQYVJBJ.js} +1 -1
- package/chunk-ACTMNVHM.js +93 -0
- package/{chunk-ZZCJUXUI.js → chunk-AHAHBQMU.js} +2 -2
- package/{chunk-BJCWNHVU.js → chunk-BFDFRLLQ.js} +2 -2
- package/chunk-BMQ2MJUK.js +153 -0
- package/chunk-BNGW5ASC.js +344 -0
- package/{chunk-2KDR4CWE.js → chunk-BYMV6QZG.js} +24 -1
- package/{chunk-73BR2IQT.js → chunk-CWQINZEA.js} +127 -7
- package/{chunk-HTMVBPOF.js → chunk-DD6XE56O.js} +19 -72
- package/{chunk-CADAR6QU.js → chunk-EYAQT56M.js} +4 -3
- package/{chunk-CJCJF5XB.js → chunk-FDTR4QJ6.js} +4 -2
- package/{chunk-D6XYLSOS.js → chunk-FKNWP6SG.js} +1 -1
- package/{chunk-3VPDELAP.js → chunk-FP76KI2Y.js} +1500 -84
- package/chunk-FV3JEYR3.js +870 -0
- package/{chunk-GCJ3IS5M.js → chunk-GIVFXPWK.js} +177 -6
- package/chunk-GMZLP5DV.js +82 -0
- package/{chunk-LHDV2QUI.js → chunk-GNCCNNZD.js} +4 -2
- package/{chunk-XWNRAIUL.js → chunk-GP5LKBUZ.js} +6 -16
- package/{chunk-PZCTYKGU.js → chunk-GQBOR3G6.js} +2 -2
- package/{chunk-NFT2AOK5.js → chunk-H4AHY5BU.js} +13 -85
- package/{chunk-FNGAF7C4.js → chunk-HAFJ3NDE.js} +137 -12
- package/{chunk-ZVN6I33J.js → chunk-HCT7U36O.js} +9 -5
- package/{chunk-7QVPPOEC.js → chunk-HKNXJGEC.js} +43 -43
- package/{chunk-3JQ2NRYU.js → chunk-HVURBGF3.js} +4 -4
- package/{chunk-OZX2IPKM.js → chunk-HYJFRTLW.js} +2 -2
- package/{chunk-HH65VA5U.js → chunk-I3TQJXQ7.js} +109 -6
- package/{chunk-UDQWGU7F.js → chunk-J4MOO56S.js} +1 -1
- package/{chunk-KC5FAHVS.js → chunk-JEDZAO7L.js} +1 -1
- package/{chunk-6XIE5ZGI.js → chunk-JPGCXHNM.js} +1 -1
- package/{chunk-DUJWWUGV.js → chunk-K36IXSCQ.js} +1 -1
- package/{chunk-KRMWO2NN.js → chunk-KAUSRTO6.js} +3 -3
- package/{chunk-7FWPLK4M.js → chunk-LJ5VW2UJ.js} +1 -1
- package/{chunk-GHEJJGJI.js → chunk-LMREEBWT.js} +833 -109
- package/{chunk-RXX4GDIH.js → chunk-LS2ZANRJ.js} +1 -1
- package/chunk-LVIFM7VW.js +1625 -0
- package/{chunk-BJIRLHJR.js → chunk-M2EJHDJP.js} +4 -0
- package/{chunk-EVBFYPDC.js → chunk-MC4XLIJ7.js} +6 -2
- package/{chunk-KEZNSFGD.js → chunk-MZYBSTMH.js} +11 -173
- package/chunk-OCZKATRC.js +129 -0
- package/{chunk-MXUSPS2N.js → chunk-OIVSQH2O.js} +1510 -1592
- package/{chunk-E36HZARC.js → chunk-P5EVSOPA.js} +93 -17
- package/{chunk-SZLVDREM.js → chunk-PBA4UJBK.js} +3 -3
- package/{chunk-URWDSZRW.js → chunk-PMAIQX7A.js} +3 -3
- package/{chunk-AETZ7AD6.js → chunk-Q554LLSI.js} +1 -1
- package/{chunk-AJHEFRGJ.js → chunk-Q67DOFOO.js} +214 -5
- package/{chunk-UZ6XXCVR.js → chunk-QDSINZM3.js} +15 -2
- package/{chunk-NRALD3CC.js → chunk-QSHEEA5N.js} +54 -10
- package/chunk-QU7KDSZX.js +677 -0
- package/{chunk-T25L377S.js → chunk-RPJUFEGR.js} +10 -10
- package/{chunk-QCZX4FTW.js → chunk-SH43IESU.js} +173 -15
- package/{chunk-SPAQ4PVV.js → chunk-SV5IJK6K.js} +1 -1
- package/{chunk-BKJO7LDP.js → chunk-U4OKDZFH.js} +6 -6
- package/{chunk-DM4FBSWG.js → chunk-UDVH2P4A.js} +7 -7
- package/{chunk-4EJ5QYB5.js → chunk-UEVXFHQB.js} +2 -2
- package/{chunk-JYYZCK2Z.js → chunk-V7E4PXQD.js} +1 -1
- package/{chunk-NHRQCXIQ.js → chunk-VMFTFOWF.js} +13 -3
- package/{chunk-YFADVSZE.js → chunk-VRTTFDBM.js} +7 -6
- package/{chunk-U7YP7ECK.js → chunk-WP5UXDA5.js} +84 -13
- package/{chunk-5J7W2VWW.js → chunk-WV42OMV7.js} +6 -265
- package/{chunk-3QPYFHAH.js → chunk-XD2MJFUG.js} +1 -1
- package/{chunk-IDGYOD2O.js → chunk-XP3VVAPG.js} +3174 -223
- package/{chunk-ETLZZQJE.js → chunk-Z2PV6O2T.js} +121 -26
- package/{chunk-BZNGCVAW.js → chunk-Z5625XML.js} +4 -4
- package/{contentThunks-THSCADSK.js → contentThunks-JYWI7G7I.js} +26 -26
- package/{cooldownCommands-BSCH2W7P.js → cooldownCommands-REAWYVTY.js} +2 -2
- package/{createAgentAutomationAction-WGN3UQ5A.js → createAgentAutomationAction-Z4SUJ54Y.js} +26 -26
- package/{createDialogAction-3EN2NLH7.js → createDialogAction-RCHFLVJ2.js} +29 -29
- package/{createPageAction-4VK473QV.js → createPageAction-YK2253XQ.js} +28 -28
- package/{dbSlice-GKGGFNOB.js → dbSlice-A6C6H32X.js} +8 -8
- package/{deleteFile-LWSR674W.js → deleteFile-YG6QMJLU.js} +3 -3
- package/{dialogCommands-PS4NWYY7.js → dialogCommands-X4UOZQWX.js} +36 -32
- package/{dialogSlice-CLV7SVOZ.js → dialogSlice-IVTWLCE2.js} +31 -25
- package/{docCreateCommands-4KANZJR6.js → docCreateCommands-VD6TGHG4.js} +33 -31
- package/{docDeleteCommands-F2S2TRUF.js → docDeleteCommands-OT3R2G4W.js} +34 -32
- package/{docReadCommands-B2WDPZQE.js → docReadCommands-2G7BIXSH.js} +33 -31
- package/{docStore-TDLCHWPF.js → docStore-UENKCCDX.js} +9 -9
- package/{docUpdateCommands-E7TKHRIO.js → docUpdateCommands-45MVJKZA.js} +33 -31
- package/{fetchMessages-DRABNDPZ.js → fetchMessages-EIU7UFFK.js} +3 -4
- package/{getPricing-QVTUQQTM.js → getPricing-LUSEABA6.js} +4 -4
- package/{handleSendMessageAction-AHL3ZHE4.js → handleSendMessageAction-LM2J4HC3.js} +66 -74
- package/index.js +99 -86
- package/{localDialogRead-PUQKFI73.js → localDialogRead-BTFJ4V2I.js} +2 -2
- package/{localRuntimeDb-P37ZTX55.js → localRuntimeDb-SYQGUF4U.js} +1 -1
- package/{machineCommands-OTABVXOA.js → machineCommands-6N6MQIE6.js} +69 -65
- package/{machineWsRunDispatch-V4EVQSMZ.js → machineWsRunDispatch-7MFKVQCR.js} +65 -61
- package/{memberThunks-KATHH3F4.js → memberThunks-P2ECUJ56.js} +9 -9
- package/{models-GS72DVJS.js → models-T3SG6MJ5.js} +2 -2
- package/{offlineMarxistsAgentCommand-GEH6SNNA.js → offlineMarxistsAgentCommand-HGXZV4XJ.js} +1 -1
- package/package.json +1 -1
- package/pdf-U6KSUEZZ.js +26435 -0
- package/providerPresetApply-XI3WUPTI.js +214 -0
- package/providerRegistry-KEPWWGXD.js +31 -0
- package/{read-LC6HVYBN.js → read-COE3ZYR6.js} +5 -4
- package/{readDocTool-N3ERJHHF.js → readDocTool-5USN4A6V.js} +1 -1
- package/{readlineWorkspace-IIT3FQ6I.js → readlineWorkspace-JWBON5CX.js} +291 -135
- package/{removeDialogAgentAction-F5GPTALR.js → removeDialogAgentAction-W66BJ7CF.js} +12 -12
- package/{runAgentClientLoop-7TQM7IAR.js → runAgentClientLoop-TA4SSPHE.js} +49 -49
- package/{runtimeDoctorCommands-CROTMULY.js → runtimeDoctorCommands-X6WDBEQX.js} +2 -2
- package/{setDialogExtraReferencesAction-AY4ZCF3A.js → setDialogExtraReferencesAction-2ALKG3WA.js} +10 -10
- package/{setPrimaryDialogAgentAction-HPMG7V3R.js → setPrimaryDialogAgentAction-TQZB55F6.js} +12 -12
- package/{settingSlice-OEJA4NQO.js → settingSlice-P4ZW7K5X.js} +10 -10
- package/{spaceCommands-FSYH7AL4.js → spaceCommands-6NSAXB7D.js} +31 -29
- package/{streamAgentChatTurn-6EF6TVFK.js → streamAgentChatTurn-X5ENGUIS.js} +126 -65
- package/{switchDialogAgentAction-HMDZTZ4I.js → switchDialogAgentAction-3KI72HHS.js} +9 -9
- package/{tableCommands-SUNTHAYX.js → tableCommands-O6NWHFKV.js} +1 -1
- package/{toolApiClient-VGYUB4P5.js → toolApiClient-G3M73RTB.js} +3 -3
- package/{tools-R3QNWWTD.js → tools-XRQR7ZZR.js} +45 -45
- package/tuiSummaryLlmCaller-UFGFOIIW.js +128 -0
- package/{updateCommands-Y363MC3L.js → updateCommands-2M74UL7P.js} +2 -2
- package/{updateDialogTitleAction-F3EUOWOB.js → updateDialogTitleAction-ESUUD3GT.js} +46 -29
- package/agentRecordCommands-WFPWLWOF.js +0 -125
- package/chunk-FMODTASJ.js +0 -109
- package/chunk-I42VC5KR.js +0 -15
- package/chunk-NB5SIWC4.js +0 -611
- package/chunk-NG4UT4K4.js +0 -79
- package/codingSkills-7S6523WH.js +0 -48
- package/tuiSummaryLlmCaller-PWOXTCBF.js +0 -116
- package/{chunk-3RAG2NAD.js → chunk-UKWGR5SS.js} +3 -3
- package/{db-VQSAOWAO.js → db-WK5MDZVN.js} +1 -1
- package/{localRuntimeAuthority-R5UBODT3.js → localRuntimeAuthority-6IR6BBXE.js} +3 -3
|
@@ -5,14 +5,14 @@ import {
|
|
|
5
5
|
inlineImageUrlsForCustomProvider,
|
|
6
6
|
prepareTools,
|
|
7
7
|
shouldInlineImageUrlsForAgent
|
|
8
|
-
} from "./chunk-
|
|
8
|
+
} from "./chunk-KAUSRTO6.js";
|
|
9
9
|
import {
|
|
10
10
|
INVALID_TOOL_ARGS_REPLACEMENT,
|
|
11
11
|
buildInvalidToolCallSelfHealResult,
|
|
12
12
|
parseToolCallArguments,
|
|
13
13
|
performFetchRequest,
|
|
14
14
|
sanitizeOutboundMessages
|
|
15
|
-
} from "./chunk-
|
|
15
|
+
} from "./chunk-3VUWPRFW.js";
|
|
16
16
|
import {
|
|
17
17
|
createSSEParser,
|
|
18
18
|
createToolRunId,
|
|
@@ -23,10 +23,13 @@ import {
|
|
|
23
23
|
toolRunSetPending,
|
|
24
24
|
toolRunStarted,
|
|
25
25
|
toolRunSucceeded
|
|
26
|
-
} from "./chunk-
|
|
26
|
+
} from "./chunk-3BGIKIPF.js";
|
|
27
27
|
import {
|
|
28
28
|
getPublicImageAgentMode
|
|
29
29
|
} from "./chunk-VIDPVFP3.js";
|
|
30
|
+
import {
|
|
31
|
+
parseApiError
|
|
32
|
+
} from "./chunk-OCZKATRC.js";
|
|
30
33
|
import {
|
|
31
34
|
getCurrentSpaceId
|
|
32
35
|
} from "./chunk-ZJ7UHBJS.js";
|
|
@@ -35,15 +38,15 @@ import {
|
|
|
35
38
|
messageStreamEnd,
|
|
36
39
|
messageStreaming,
|
|
37
40
|
updateToolMessage
|
|
38
|
-
} from "./chunk-
|
|
41
|
+
} from "./chunk-XP3VVAPG.js";
|
|
39
42
|
import {
|
|
40
43
|
streamAgentChatTurn
|
|
41
|
-
} from "./chunk-
|
|
44
|
+
} from "./chunk-UDVH2P4A.js";
|
|
42
45
|
import {
|
|
43
46
|
addActiveController,
|
|
44
47
|
removeActiveController,
|
|
45
48
|
tokenUsageLiveUpdate
|
|
46
|
-
} from "./chunk-
|
|
49
|
+
} from "./chunk-6D2JFXLY.js";
|
|
47
50
|
import {
|
|
48
51
|
accumulateToolCallDelta,
|
|
49
52
|
createThinkParserState,
|
|
@@ -56,42 +59,42 @@ import {
|
|
|
56
59
|
import {
|
|
57
60
|
EMPTY_ASSISTANT_REPAIR_PROMPT,
|
|
58
61
|
getModelInfo
|
|
59
|
-
} from "./chunk-
|
|
62
|
+
} from "./chunk-HKNXJGEC.js";
|
|
60
63
|
import {
|
|
61
64
|
getApiEndpoint
|
|
62
|
-
} from "./chunk-
|
|
65
|
+
} from "./chunk-OIVSQH2O.js";
|
|
63
66
|
import {
|
|
64
67
|
toErrorMessage
|
|
65
68
|
} from "./chunk-HNMXYYJR.js";
|
|
66
69
|
import {
|
|
67
70
|
selectCurrentServer
|
|
68
|
-
} from "./chunk-
|
|
71
|
+
} from "./chunk-GP5LKBUZ.js";
|
|
69
72
|
import {
|
|
70
73
|
write
|
|
71
|
-
} from "./chunk-
|
|
74
|
+
} from "./chunk-VRTTFDBM.js";
|
|
72
75
|
import {
|
|
73
76
|
createDialogMessageKeyAndId,
|
|
74
77
|
dialogMessageKey,
|
|
75
78
|
toTrimmedString
|
|
76
|
-
} from "./chunk-
|
|
79
|
+
} from "./chunk-VMFTFOWF.js";
|
|
77
80
|
import {
|
|
78
81
|
extractCustomId
|
|
79
|
-
} from "./chunk-
|
|
82
|
+
} from "./chunk-M2EJHDJP.js";
|
|
80
83
|
import {
|
|
81
84
|
createAsyncThunk
|
|
82
|
-
} from "./chunk-
|
|
85
|
+
} from "./chunk-UKWGR5SS.js";
|
|
83
86
|
import {
|
|
84
87
|
isAbortError
|
|
85
88
|
} from "./chunk-QOKAKDPE.js";
|
|
86
89
|
import {
|
|
87
90
|
selectIdentityToken
|
|
88
91
|
} from "./chunk-SEJ5OS6F.js";
|
|
89
|
-
import {
|
|
90
|
-
asTrimmedString
|
|
91
|
-
} from "./chunk-3EUW3WEO.js";
|
|
92
92
|
import {
|
|
93
93
|
isRecord
|
|
94
94
|
} from "./chunk-KUG52IAP.js";
|
|
95
|
+
import {
|
|
96
|
+
asTrimmedString
|
|
97
|
+
} from "./chunk-3EUW3WEO.js";
|
|
95
98
|
import {
|
|
96
99
|
asOptionalTrimmedString
|
|
97
100
|
} from "./chunk-G3SUCT4W.js";
|
|
@@ -794,61 +797,6 @@ var handleToolCalls = createAsyncThunk(
|
|
|
794
797
|
}
|
|
795
798
|
);
|
|
796
799
|
|
|
797
|
-
// packages/ai/chat/parseApiError.ts
|
|
798
|
-
async function parseApiError(response) {
|
|
799
|
-
const errorBody = await response.text();
|
|
800
|
-
const truncateErrorMessage = (message, maxChars = 320) => message.length <= maxChars ? message : `${message.slice(0, maxChars)}\u2026`;
|
|
801
|
-
const isContextOverflow = (message) => /maximum context length|context length|context_length_exceeded|requested about .*tokens|too many tokens/i.test(message);
|
|
802
|
-
let defaultMessage = `\u72B6\u6001\u7801 ${response.status} ${response.statusText}`;
|
|
803
|
-
let errorMessage = defaultMessage;
|
|
804
|
-
let errorCode = `E${response.status}`;
|
|
805
|
-
try {
|
|
806
|
-
const errorJson = JSON.parse(errorBody);
|
|
807
|
-
errorMessage = errorJson?.error?.message || errorJson?.message || errorJson?.msg || errorBody || defaultMessage;
|
|
808
|
-
errorCode = errorJson?.error?.code || errorJson?.code || errorCode;
|
|
809
|
-
} catch (_e) {
|
|
810
|
-
if (errorBody) {
|
|
811
|
-
errorMessage = errorBody;
|
|
812
|
-
}
|
|
813
|
-
}
|
|
814
|
-
switch (response.status) {
|
|
815
|
-
case 400:
|
|
816
|
-
if (isContextOverflow(errorMessage) || isContextOverflow(errorBody) || errorCode === "UPSTREAM_400") {
|
|
817
|
-
return "\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";
|
|
818
|
-
}
|
|
819
|
-
if (errorCode === "MISSING_PROVIDER_API_KEY") {
|
|
820
|
-
return truncateErrorMessage(errorMessage);
|
|
821
|
-
}
|
|
822
|
-
if (errorMessage && errorMessage !== defaultMessage) {
|
|
823
|
-
return `\u8BF7\u6C42\u53C2\u6570\u9519\u8BEF: ${truncateErrorMessage(errorMessage)}`;
|
|
824
|
-
}
|
|
825
|
-
return "\u8BF7\u6C42\u53C2\u6570\u9519\u8BEF\uFF0C\u8BF7\u68C0\u67E5\u8F93\u5165";
|
|
826
|
-
case 413:
|
|
827
|
-
return "\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";
|
|
828
|
-
case 401:
|
|
829
|
-
switch (errorCode) {
|
|
830
|
-
case "AUTH_TOKEN_EXPIRED":
|
|
831
|
-
return "\u767B\u5F55\u72B6\u6001\u5DF2\u8FC7\u671F\uFF0C\u8BF7\u5148\u767B\u51FA\u540E\u91CD\u65B0\u767B\u5F55";
|
|
832
|
-
case "AUTH_ACCOUNT_INVALID":
|
|
833
|
-
return "\u8D26\u6237\u65E0\u6548\u6216\u5DF2\u88AB\u505C\u7528\uFF0C\u8BF7\u8054\u7CFB\u7BA1\u7406\u5458";
|
|
834
|
-
case "AUTH_NO_TOKEN":
|
|
835
|
-
return "\u672A\u68C0\u6D4B\u5230\u767B\u5F55\u72B6\u6001\uFF0C\u8BF7\u5148\u767B\u5F55";
|
|
836
|
-
case "AUTH_INVALID_TOKEN":
|
|
837
|
-
return "\u767B\u5F55\u51ED\u8BC1\u65E0\u6548\uFF0C\u8BF7\u5148\u767B\u51FA\u540E\u91CD\u65B0\u767B\u5F55";
|
|
838
|
-
case "AUTH_TOKEN_NOT_ACTIVE":
|
|
839
|
-
return "\u4EE4\u724C\u5C1A\u672A\u751F\u6548\uFF0C\u8BF7\u7A0D\u540E\u518D\u8BD5";
|
|
840
|
-
default:
|
|
841
|
-
return 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";
|
|
842
|
-
}
|
|
843
|
-
case 503:
|
|
844
|
-
return errorMessage && errorMessage !== `\u72B6\u6001\u7801 503 Service Unavailable` ? truncateErrorMessage(errorMessage) : "\u670D\u52A1\u6682\u65F6\u4E0D\u53EF\u7528\uFF0C\u8BF7\u7A0D\u540E\u518D\u8BD5";
|
|
845
|
-
case 504:
|
|
846
|
-
return "\u8BF7\u6C42\u8D85\u65F6\uFF0C\u8BF7\u7A0D\u540E\u518D\u8BD5";
|
|
847
|
-
default:
|
|
848
|
-
return `API\u8BF7\u6C42\u5931\u8D25: ${truncateErrorMessage(errorMessage)}`;
|
|
849
|
-
}
|
|
850
|
-
}
|
|
851
|
-
|
|
852
800
|
// packages/ai/chat/accumulateToolCallChunks.ts
|
|
853
801
|
function accumulateToolCallChunks(currentAccumulatedCalls, toolCallChunks) {
|
|
854
802
|
const accumulator = {
|
|
@@ -1839,7 +1787,6 @@ export {
|
|
|
1839
1787
|
filterAndCleanMessages,
|
|
1840
1788
|
persistToolMessages,
|
|
1841
1789
|
handleToolCalls,
|
|
1842
|
-
parseApiError,
|
|
1843
1790
|
updateTotalUsage,
|
|
1844
1791
|
readStreamChunk,
|
|
1845
1792
|
sendOpenAICompletionsRequest
|
|
@@ -6,10 +6,10 @@ import {
|
|
|
6
6
|
} from "./chunk-AGGIDPCZ.js";
|
|
7
7
|
import {
|
|
8
8
|
getModelConfig
|
|
9
|
-
} from "./chunk-
|
|
9
|
+
} from "./chunk-OIVSQH2O.js";
|
|
10
10
|
import {
|
|
11
11
|
isPlatformHostedImageModel
|
|
12
|
-
} from "./chunk-
|
|
12
|
+
} from "./chunk-Q67DOFOO.js";
|
|
13
13
|
import {
|
|
14
14
|
asOptionalFiniteNumber
|
|
15
15
|
} from "./chunk-WWC7I6TA.js";
|
|
@@ -31,9 +31,10 @@ var getModelPricing = (provider, modelName, _requestedServiceTier) => {
|
|
|
31
31
|
};
|
|
32
32
|
var getModelPricingForModel = (provider, modelName, model) => {
|
|
33
33
|
if (!model.price) return null;
|
|
34
|
+
const rawCacheHit = typeof model.price.inputCacheHit === "number" ? model.price.inputCacheHit : model.price.cachingRead;
|
|
34
35
|
return {
|
|
35
36
|
inputPrice: model.price.input,
|
|
36
|
-
inputCacheHitPrice: typeof
|
|
37
|
+
inputCacheHitPrice: typeof rawCacheHit === "number" ? rawCacheHit : 0,
|
|
37
38
|
outputPrice: model.price.output
|
|
38
39
|
};
|
|
39
40
|
};
|
|
@@ -46,6 +46,7 @@ function extractMessage(error) {
|
|
|
46
46
|
}
|
|
47
47
|
function parseResetsInMs(text) {
|
|
48
48
|
if (!text) return void 0;
|
|
49
|
+
const sanitized = text.replace(/\btrace[\s_-]?id\b[^)\n]*/gi, " ").replace(/\b[0-9a-f]{16,}\b/gi, " ");
|
|
49
50
|
const unitMs = (n, unit) => {
|
|
50
51
|
if (/^d/.test(unit)) return n * 24 * 3600 * 1e3;
|
|
51
52
|
if (/^h/.test(unit)) return n * 3600 * 1e3;
|
|
@@ -54,12 +55,13 @@ function parseResetsInMs(text) {
|
|
|
54
55
|
return NaN;
|
|
55
56
|
};
|
|
56
57
|
const re = /(\d+)\s*(d(?:ay|ays)?|h(?:r|rs|our|ours)?|m(?:in|ins|inute|inutes)?|s(?:ec|ecs|econd|econds)?)/gi;
|
|
58
|
+
const MAX_SINGLE_MATCH_MS = 7 * 24 * 3600 * 1e3;
|
|
57
59
|
let totalMs = 0;
|
|
58
60
|
let matched = false;
|
|
59
61
|
let m;
|
|
60
|
-
while ((m = re.exec(
|
|
62
|
+
while ((m = re.exec(sanitized)) !== null) {
|
|
61
63
|
const ms = unitMs(Number(m[1]), m[2]);
|
|
62
|
-
if (!Number.isFinite(ms)) continue;
|
|
64
|
+
if (!Number.isFinite(ms) || ms > MAX_SINGLE_MATCH_MS) continue;
|
|
63
65
|
totalMs += ms;
|
|
64
66
|
matched = true;
|
|
65
67
|
}
|