nolo-cli 0.54.0-alpha.2 → 0.61.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/README.md +3 -3
- package/{_executeModel-ANY4SIAS.js → _executeModel-CKT6RGTL.js} +58 -49
- package/{action-Q4W5JPI5.js → action-76JX3JX3.js} +9 -8
- package/{addContentAction-O25HFR37.js → addContentAction-V3NAZRTJ.js} +9 -7
- package/{addDialogAgentAction-GH7AUPPB.js → addDialogAgentAction-RZOAF46K.js} +11 -9
- package/{agentDeleteCommand-JWIKNWWI.js → agentDeleteCommand-VN7NPXQ4.js} +37 -32
- package/{agentEmailCommands-PL22BEU5.js → agentEmailCommands-F2TNAV4A.js} +73 -65
- package/{agentGrantCommands-2LEZDADN.js → agentGrantCommands-R3VQEZJR.js} +1 -1
- package/{agentListCommands-6NR7AQEK.js → agentListCommands-OSM2ANI3.js} +78 -39
- package/{agentMachineCommands-TASPU6OA.js → agentMachineCommands-MTPWYVRV.js} +38 -33
- package/{agentPullCommand-M552CYSI.js → agentPullCommand-N7L2CT7L.js} +2 -2
- package/agentRecordCommands-VWAWTVVC.js +122 -0
- package/agentRunCommand-PLZOBNVK.js +149 -0
- package/{agentRunControl-4GHHSXFZ.js → agentRunControl-WECMOO6O.js} +13 -6
- package/{agentRuntimeLocal-PCJJ56J2.js → agentRuntimeLocal-XCJLRWQE.js} +35 -28
- package/{agentSlice-KYLDUSNN.js → agentSlice-F6DOP4IW.js} +10 -9
- package/{appDeleteCommands-WLHMJAVT.js → appDeleteCommands-3BCFTRFJ.js} +37 -32
- package/{appDeployCommands-CKON7N2E.js → appDeployCommands-B4GMHCYA.js} +37 -32
- package/{appDeployStatusCommands-PXRLDASH.js → appDeployStatusCommands-4MN36WIG.js} +37 -32
- package/{appGetCommands-RAB5RM4M.js → appGetCommands-4GJIEUAX.js} +37 -32
- package/{appListCommands-GU57FB62.js → appListCommands-CHU53GSX.js} +37 -32
- package/{authCommand-QOPOEYEK.js → authCommand-WOTWLJNF.js} +38 -32
- package/{authCommands-SBQVTD6V.js → authCommands-ILTBI6JV.js} +8 -6
- package/{chatQueueReduxAdapter-5O2WLITN.js → chatQueueReduxAdapter-HNSQXNIR.js} +29 -24
- package/{chunk-WL3UOGYO.js → chunk-22BTGNSP.js} +151 -155
- package/{chunk-7CH6U3FL.js → chunk-2GRGFCF6.js} +2 -4
- package/{chunk-V4KZGLOI.js → chunk-2HPRMEEZ.js} +3059 -1079
- package/{chunk-UNZDCI3O.js → chunk-2KDR4CWE.js} +35 -4
- package/{chunk-VRZIH5JO.js → chunk-2PGGC63K.js} +1 -1
- package/{chunk-T27IEBNQ.js → chunk-2QDDKFG5.js} +74 -1
- package/{chunk-7K5VMB4Q.js → chunk-37QVS7BU.js} +21 -8
- package/{chunk-UITMHBVK.js → chunk-37XDGCY7.js} +1 -1
- package/chunk-3BLB7QKO.js +433 -0
- package/{chunk-NQ4N4IGO.js → chunk-3JQ2NRYU.js} +33 -10
- package/{chunk-UW4INMD2.js → chunk-3JWKQDA4.js} +2 -2
- package/{chunk-IKTHA3JH.js → chunk-3QGUVVX5.js} +2 -2
- package/{chunk-WHVQA7PJ.js → chunk-45YO6H7P.js} +97 -35
- package/chunk-4C4ST2YE.js +20015 -0
- package/{chunk-32I5RVMY.js → chunk-4NJEIGBQ.js} +5 -5
- package/{chunk-KUUTWU4I.js → chunk-5ZYA4JJ3.js} +90 -22
- package/chunk-6YTOJY35.js +352 -0
- package/{chunk-INXBNYCG.js → chunk-7A3RRUCQ.js} +155 -12
- package/{chunk-GV35EHNA.js → chunk-7O7KH4X5.js} +1262 -971
- package/{chunk-Y7LNKP32.js → chunk-7UF7CQ6B.js} +4 -6
- package/{chunk-2BWU4ORW.js → chunk-AQMVUA7N.js} +2 -1
- package/{chunk-LA4IDAK7.js → chunk-AVE2YR4F.js} +1056 -3591
- package/{chunk-TI5BCZCH.js → chunk-B7DXRX7F.js} +59 -121
- package/chunk-BFU6C242.js +66 -0
- package/{chunk-FA4SY4F5.js → chunk-BYEJ7K2Z.js} +1 -1
- package/chunk-BYXBJQAS.js +0 -0
- package/{chunk-IA3A5373.js → chunk-C3FZR5EC.js} +1 -1
- package/{chunk-IWUMSAQF.js → chunk-CJCJF5XB.js} +26 -3
- package/{chunk-PAHILFNT.js → chunk-CP7VIDZ7.js} +4 -4
- package/{chunk-OYNDYVSE.js → chunk-CTCW7U7N.js} +1 -1
- package/{chunk-BJLYCOZK.js → chunk-D5XKNNUV.js} +135 -795
- package/{chunk-AV6KQCM5.js → chunk-DNNSCSA2.js} +19 -14
- package/{chunk-3AOLVADY.js → chunk-DVINR3PL.js} +1 -1
- package/{chunk-NI2BS6UD.js → chunk-DWUCB2A3.js} +1 -1
- package/{chunk-AA564GBL.js → chunk-DZZL7UBV.js} +1 -1
- package/{chunk-6FGXGFAH.js → chunk-E6RGHPDR.js} +6 -4
- package/chunk-EDKF7RX4.js +30 -0
- package/{chunk-6SZ52ORL.js → chunk-ES6CVKVD.js} +24 -30
- package/{chunk-DQLYEGP7.js → chunk-FHAGENAS.js} +3 -4
- package/{chunk-56W233KG.js → chunk-FKFMIBTT.js} +5 -1
- package/{chunk-INZZJSQF.js → chunk-FZGV4FGK.js} +24 -12
- package/{chunk-D3JQPONH.js → chunk-GAL47RNP.js} +1 -1
- package/{chunk-6FQ2552G.js → chunk-HBPV76EK.js} +1085 -1150
- package/{chunk-LN3OQJGG.js → chunk-HLU5Q2GV.js} +4 -4
- package/{chunk-U2A47SVI.js → chunk-HQP7HJDL.js} +7 -7
- package/{chunk-H2G6JXTR.js → chunk-HQUORJTM.js} +1 -1
- package/{chunk-3Z3DXZBD.js → chunk-IYCUMIYS.js} +24 -20
- package/{chunk-7APQB6R6.js → chunk-JX5PJCWS.js} +8 -6
- package/{chunk-LYGNQHUW.js → chunk-JYYZCK2Z.js} +2 -4
- package/{chunk-PYKV6FSC.js → chunk-KWSQR2KK.js} +16 -31
- package/{chunk-VULELK4T.js → chunk-L7B47JXR.js} +37 -64
- package/{chunk-4NN3EK7H.js → chunk-LAFC3B2I.js} +1 -1
- package/{chunk-VRJUIUIY.js → chunk-LJKICKVC.js} +2 -2
- package/chunk-M3JEW6N6.js +193 -0
- package/chunk-MBOEV4L2.js +301 -0
- package/{chunk-QDHZCAH3.js → chunk-MMZ6ZTVO.js} +229 -74
- package/{chunk-JDSUTNYY.js → chunk-MP64VFGD.js} +2 -2
- package/{chunk-U5Z7LFZF.js → chunk-MXUDQZXQ.js} +47 -8
- package/chunk-N4G4PKQ6.js +23 -0
- package/{chunk-SVEUG45B.js → chunk-NHRQCXIQ.js} +0 -24
- package/{chunk-KXKQO4Q6.js → chunk-NTW5GWDM.js} +58 -1
- package/chunk-ONXOABJR.js +215 -0
- package/{chunk-BANYWEYY.js → chunk-OZX2IPKM.js} +8 -3
- package/{chunk-Q24S4NDF.js → chunk-P7OOB7QP.js} +1 -1
- package/{chunk-GLGD2JGY.js → chunk-PEZJEQAO.js} +7 -7
- package/{chunk-GBADO3SM.js → chunk-PQDIDWGX.js} +1 -1
- package/chunk-PSCNXBYA.js +11 -0
- package/chunk-QEFJJS2I.js +508 -0
- package/{chunk-757BGY6Y.js → chunk-QEW2MFDQ.js} +1 -1
- package/{chunk-SP3DPVBH.js → chunk-RDBARW6T.js} +8 -3
- package/{chunk-TNPCQNGQ.js → chunk-RJ2SAFB5.js} +83 -41
- package/{chunk-FGEYVPPR.js → chunk-RVWRKFUB.js} +8 -65
- package/{chunk-43CXXVJD.js → chunk-RXX4GDIH.js} +1 -1
- package/chunk-SEJ5OS6F.js +49 -0
- package/{chunk-MFI4FGHX.js → chunk-SOJM57FX.js} +5 -2
- package/{chunk-EKLRRZIN.js → chunk-SPAQ4PVV.js} +0 -5
- package/{chunk-L7NG2M6H.js → chunk-TRV2MIDW.js} +89 -74
- package/chunk-UAD2WT54.js +64 -0
- package/{chunk-RTLJUGQH.js → chunk-UZPQSVM6.js} +2 -2
- package/{chunk-3QJTD6DO.js → chunk-VMWYBIXG.js} +9 -7
- package/{chunk-ZHXJ6M7T.js → chunk-W7XHHYWM.js} +4 -0
- package/{chunk-5WADL4O7.js → chunk-XAVSS3KE.js} +21 -3
- package/{chunk-CVT7L2WZ.js → chunk-XOKOSO35.js} +13 -22
- package/{chunk-6BYAXNH5.js → chunk-XTJTN3RW.js} +57 -4
- package/{chunk-T5HJEUQN.js → chunk-YCDWJX45.js} +1 -1
- package/{chunk-MRWGHF56.js → chunk-YDH3FDFQ.js} +12 -356
- package/{chunk-H4RYESI6.js → chunk-Z4QSJILV.js} +85 -13
- package/chunk-ZJ7UHBJS.js +89 -0
- package/{chunk-O5FLGN2L.js → chunk-ZRSJ3JEH.js} +6 -2
- package/{cliExecutor-BBUVQU4L.js → cliExecutor-HG3S345O.js} +1 -1
- package/{codingSkills-BCQXRZOI.js → codingSkills-VDXQYWX4.js} +2 -2
- package/contentThunks-7YG2ZYQC.js +73 -0
- package/{cooldownCommands-GI5NNWGL.js → cooldownCommands-BSCH2W7P.js} +2 -2
- package/{createAgentAutomationAction-UJLNFFFC.js → createAgentAutomationAction-PJQSCAIO.js} +32 -26
- package/createDialogAction-SFEJX6SP.js +64 -0
- package/{createPageAction-N3IYABHV.js → createPageAction-B7WRHOQO.js} +35 -28
- package/{dbSlice-D5CNGWPD.js → dbSlice-IBVOBVMS.js} +7 -6
- package/{deleteFile-44TUM34Y.js → deleteFile-FWP2PSBG.js} +4 -3
- package/{dialogCommands-35M6RBAC.js → dialogCommands-VL2X22QC.js} +38 -33
- package/{dialogSlice-KO7ADD7H.js → dialogSlice-ANMACABO.js} +29 -24
- package/{docCreateCommands-VXHZWQ3P.js → docCreateCommands-ITLGZ5YI.js} +40 -35
- package/{docDeleteCommands-4WFAJR6A.js → docDeleteCommands-LH3YNL4C.js} +37 -32
- package/{docReadCommands-OYREEFAR.js → docReadCommands-YAJ77F36.js} +36 -31
- package/{docStore-5BU76DFK.js → docStore-D4HGHPWI.js} +9 -33
- package/{docUpdateCommands-A7QERSME.js → docUpdateCommands-DQBOMH2G.js} +40 -35
- package/{fetchMessages-KZQVBXKY.js → fetchMessages-DRABNDPZ.js} +3 -3
- package/{getPricing-HAU62AFM.js → getPricing-NM3NUTAS.js} +5 -5
- package/handleSendMessageAction-DF2OABGW.js +675 -0
- package/index.js +79 -88
- package/{lib-2ZTNRXR4.js → lib-FRRS27KN.js} +63 -28
- package/{localDialogRead-NQ33HBSI.js → localDialogRead-PUQKFI73.js} +1 -1
- package/{localRuntimeAuthority-KQDAE64E.js → localRuntimeAuthority-R5UBODT3.js} +6 -4
- package/{localRuntimeDb-PF7CFKDL.js → localRuntimeDb-P37ZTX55.js} +1 -1
- package/{machineCommands-J43U3TX5.js → machineCommands-JXDYQ5LB.js} +309 -87
- package/{machineWsRunDispatch-Z2Z6STXZ.js → machineWsRunDispatch-3QHI7JX5.js} +67 -59
- package/memberThunks-VZI6G7YZ.js +640 -0
- package/{models-4QF4BJVY.js → models-FAMINFZ7.js} +2 -2
- package/package.json +3 -2
- package/{read-RGNPI5H2.js → read-2BYWW7AA.js} +4 -3
- package/{readDocTool-6ESWKTXD.js → readDocTool-LC3A7QTB.js} +1 -1
- package/{readlineWorkspace-YRPV6JPN.js → readlineWorkspace-KVZTEAHB.js} +4609 -2698
- package/{removeDialogAgentAction-JYT73FU2.js → removeDialogAgentAction-SFYZXHNK.js} +14 -12
- package/{runAgentClientLoop-5YM5WMAY.js → runAgentClientLoop-KGTEL7ZP.js} +60 -50
- package/{runtimeDoctorCommands-JKTTN723.js → runtimeDoctorCommands-CROTMULY.js} +7 -5
- package/{setDialogExtraReferencesAction-D564LMYQ.js → setDialogExtraReferencesAction-Q32RGFTA.js} +10 -8
- package/{setPrimaryDialogAgentAction-ACY3BLYA.js → setPrimaryDialogAgentAction-BFYJHUJS.js} +14 -12
- package/{settingSlice-MKI3MNZJ.js → settingSlice-IRUU4VFB.js} +8 -7
- package/{skillDiscovery-GPUDHDTZ.js → skillDiscovery-NTRLM6KP.js} +3 -3
- package/{spaceCommands-MY26V52L.js → spaceCommands-KNAYWMCZ.js} +40 -220
- package/{streamAgentChatTurn-XV5X5TNQ.js → streamAgentChatTurn-FLYPTXKZ.js} +140 -95
- package/{switchDialogAgentAction-CJ5H6SAR.js → switchDialogAgentAction-L2KOKCGG.js} +11 -9
- package/{tableCommands-R6WFRDYF.js → tableCommands-SUNTHAYX.js} +1 -1
- package/{toolApiClient-B2MFXMEG.js → toolApiClient-VGYUB4P5.js} +4 -2
- package/{tools-MIMELA2Y.js → tools-CVLUXK6P.js} +46 -38
- package/{tuiSummaryLlmCaller-XJ5BKNNS.js → tuiSummaryLlmCaller-F3DPFFZM.js} +20 -16
- package/{updateCommands-IYKLF3JX.js → updateCommands-AJYSD73Y.js} +2 -2
- package/{updateDialogTitleAction-EIZUSWHR.js → updateDialogTitleAction-HWJIZEIV.js} +33 -27
- package/agentRecordCommands-Z64TA63M.js +0 -114
- package/agentRunCommand-4QJQLPRW.js +0 -134
- package/agentSuperviseCommands-VB6BUS5H.js +0 -640
- package/chunk-6BGAQ3KR.js +0 -7081
- package/chunk-FD36SCCD.js +0 -105
- package/chunk-J3UALFHL.js +0 -370
- package/chunk-RU5D3B22.js +0 -230
- package/chunk-YBV6QJKM.js +0 -441
- package/createDialogAction-TJCX6GUE.js +0 -58
- package/handleSendMessageAction-OSGQJQ45.js +0 -406
- package/spaceSlice-JUIXC365.js +0 -127
|
@@ -1,16 +1,14 @@
|
|
|
1
|
+
import {
|
|
2
|
+
buildResponseGuidelines
|
|
3
|
+
} from "./chunk-EDKF7RX4.js";
|
|
1
4
|
import {
|
|
2
5
|
getLocalProviderSecret
|
|
3
6
|
} from "./chunk-HS7MLR74.js";
|
|
4
|
-
import {
|
|
5
|
-
ANTIGRAVITY_CLOUD_CODE_BASE_URL,
|
|
6
|
-
isAntigravityOAuthAgent
|
|
7
|
-
} from "./chunk-757BGY6Y.js";
|
|
8
7
|
import {
|
|
9
8
|
clipMultilineText,
|
|
10
9
|
fetchAndSerializeTable,
|
|
11
|
-
resolveBuiltinSkillPage
|
|
12
|
-
|
|
13
|
-
} from "./chunk-V4KZGLOI.js";
|
|
10
|
+
resolveBuiltinSkillPage
|
|
11
|
+
} from "./chunk-2HPRMEEZ.js";
|
|
14
12
|
import {
|
|
15
13
|
isGatewayHttpStatus
|
|
16
14
|
} from "./chunk-NF64D32W.js";
|
|
@@ -22,55 +20,63 @@ import {
|
|
|
22
20
|
} from "./chunk-3L2WKC3W.js";
|
|
23
21
|
import {
|
|
24
22
|
slateToSimplifiedMarkdown
|
|
25
|
-
} from "./chunk-
|
|
23
|
+
} from "./chunk-2PGGC63K.js";
|
|
24
|
+
import {
|
|
25
|
+
waitForAbortableDelay
|
|
26
|
+
} from "./chunk-N4G4PKQ6.js";
|
|
26
27
|
import {
|
|
27
28
|
extractCategorizedMentions
|
|
28
29
|
} from "./chunk-MEYIRKDN.js";
|
|
29
30
|
import {
|
|
30
31
|
fetchAndCacheMessages
|
|
31
|
-
} from "./chunk-
|
|
32
|
+
} from "./chunk-D5XKNNUV.js";
|
|
32
33
|
import {
|
|
33
34
|
shouldUseServerProxy
|
|
34
35
|
} from "./chunk-YYLHWIW6.js";
|
|
35
36
|
import {
|
|
36
37
|
fetchServerSyncedCredential
|
|
37
|
-
} from "./chunk-
|
|
38
|
+
} from "./chunk-HQP7HJDL.js";
|
|
38
39
|
import {
|
|
39
40
|
buildSkillGuidancePromptBlock,
|
|
40
41
|
extractRuntimePageCapabilities,
|
|
41
42
|
resolveSkillGraphFromRoots
|
|
42
|
-
} from "./chunk-
|
|
43
|
+
} from "./chunk-DZZL7UBV.js";
|
|
43
44
|
import {
|
|
44
|
-
buildCurrentTimeBlock,
|
|
45
45
|
buildIdentityBlock,
|
|
46
46
|
buildRuntimeGuidanceBlocks,
|
|
47
|
+
compileContextLayers,
|
|
47
48
|
normalizeChatCompletionsBodyForProvider,
|
|
48
49
|
resolveToolGuidedSections
|
|
49
|
-
} from "./chunk-
|
|
50
|
+
} from "./chunk-QEFJJS2I.js";
|
|
50
51
|
import {
|
|
51
52
|
convertMessagesToResponsesInput,
|
|
52
53
|
getUsageRequestOptions,
|
|
53
|
-
preserveAgentStateFields
|
|
54
|
-
|
|
54
|
+
preserveAgentStateFields,
|
|
55
|
+
stablePromptCacheKey
|
|
56
|
+
} from "./chunk-XTJTN3RW.js";
|
|
55
57
|
import {
|
|
56
|
-
|
|
57
|
-
|
|
58
|
+
ANTIGRAVITY_CLOUD_CODE_BASE_URL,
|
|
59
|
+
isAntigravityOAuthAgent
|
|
60
|
+
} from "./chunk-QEW2MFDQ.js";
|
|
58
61
|
import {
|
|
59
|
-
|
|
60
|
-
} from "./chunk-
|
|
62
|
+
buildProviderAuthHeaders
|
|
63
|
+
} from "./chunk-RDBARW6T.js";
|
|
61
64
|
import {
|
|
62
65
|
isOpenAiResponsesModel,
|
|
63
66
|
resolvePlatformChatCompletionsEndpoint,
|
|
64
67
|
resolvePlatformResponsesEndpoint
|
|
65
|
-
} from "./chunk-
|
|
68
|
+
} from "./chunk-LJKICKVC.js";
|
|
66
69
|
import {
|
|
67
|
-
|
|
68
|
-
} from "./chunk-
|
|
70
|
+
estimateTokenCount
|
|
71
|
+
} from "./chunk-PSCNXBYA.js";
|
|
69
72
|
import {
|
|
70
73
|
clampReasoningEffort,
|
|
71
74
|
getModelConfig,
|
|
72
75
|
isModelSupportReasoningEffort
|
|
73
|
-
} from "./chunk-
|
|
76
|
+
} from "./chunk-MMZ6ZTVO.js";
|
|
77
|
+
import {
|
|
78
|
+
createFileCredentialBroker
|
|
79
|
+
} from "./chunk-3JQ2NRYU.js";
|
|
74
80
|
import {
|
|
75
81
|
toErrorMessage
|
|
76
82
|
} from "./chunk-HNMXYYJR.js";
|
|
@@ -78,7 +84,7 @@ import {
|
|
|
78
84
|
MEMORY_USE_GUIDANCE,
|
|
79
85
|
buildUserResponseLanguageContext,
|
|
80
86
|
wrapHistoricalSummaryWithReplayGuard
|
|
81
|
-
} from "./chunk-
|
|
87
|
+
} from "./chunk-2GRGFCF6.js";
|
|
82
88
|
import {
|
|
83
89
|
canonicalizeToolNames
|
|
84
90
|
} from "./chunk-O6OSWFZQ.js";
|
|
@@ -86,13 +92,13 @@ import {
|
|
|
86
92
|
isDeepInfraKimiModel,
|
|
87
93
|
isFireworksKimiModel,
|
|
88
94
|
resolveFireworksKimiModel
|
|
89
|
-
} from "./chunk-
|
|
95
|
+
} from "./chunk-22BTGNSP.js";
|
|
90
96
|
import {
|
|
91
97
|
createSpaceKey
|
|
92
|
-
} from "./chunk-
|
|
98
|
+
} from "./chunk-UAD2WT54.js";
|
|
93
99
|
import {
|
|
94
100
|
read
|
|
95
|
-
} from "./chunk-
|
|
101
|
+
} from "./chunk-DNNSCSA2.js";
|
|
96
102
|
import {
|
|
97
103
|
asTrimmedLowercaseString
|
|
98
104
|
} from "./chunk-QSJ3HFEF.js";
|
|
@@ -101,16 +107,16 @@ import {
|
|
|
101
107
|
} from "./chunk-BJIRLHJR.js";
|
|
102
108
|
import {
|
|
103
109
|
getRuntimeServerContext
|
|
104
|
-
} from "./chunk-
|
|
110
|
+
} from "./chunk-KWSQR2KK.js";
|
|
105
111
|
import {
|
|
106
112
|
isAbortError
|
|
107
113
|
} from "./chunk-QOKAKDPE.js";
|
|
108
|
-
import {
|
|
109
|
-
isRecord
|
|
110
|
-
} from "./chunk-KUG52IAP.js";
|
|
111
114
|
import {
|
|
112
115
|
asTrimmedString
|
|
113
116
|
} from "./chunk-3EUW3WEO.js";
|
|
117
|
+
import {
|
|
118
|
+
isRecord
|
|
119
|
+
} from "./chunk-KUG52IAP.js";
|
|
114
120
|
import {
|
|
115
121
|
API_ENDPOINTS
|
|
116
122
|
} from "./chunk-LCBAMY2M.js";
|
|
@@ -473,8 +479,8 @@ function resolveAgentCallPlan(agentConfig, _env) {
|
|
|
473
479
|
model: agentConfig.model,
|
|
474
480
|
endpointKey: agentConfig.endpointKey
|
|
475
481
|
});
|
|
476
|
-
const upstreamWire =
|
|
477
|
-
const endpoint = upstreamWire === "responses" ? resolvePlatformResponsesEndpoint(provider) ?? "" : resolvePlatformChatCompletionsEndpoint(provider, agentConfig.model) ?? "";
|
|
482
|
+
const upstreamWire = useResponses ? "responses" : "chat.completions";
|
|
483
|
+
const endpoint = upstreamWire === "responses" ? resolvePlatformResponsesEndpoint(provider, agentConfig.model) ?? "" : resolvePlatformChatCompletionsEndpoint(provider, agentConfig.model) ?? "";
|
|
478
484
|
return {
|
|
479
485
|
authMethod: { kind: "platform-key" },
|
|
480
486
|
transport,
|
|
@@ -485,66 +491,6 @@ function resolveAgentCallPlan(agentConfig, _env) {
|
|
|
485
491
|
};
|
|
486
492
|
}
|
|
487
493
|
|
|
488
|
-
// packages/ai/agent/contextCompiler.ts
|
|
489
|
-
function createHash(_algo) {
|
|
490
|
-
let buf = "";
|
|
491
|
-
return {
|
|
492
|
-
update(s) {
|
|
493
|
-
buf += s;
|
|
494
|
-
return this;
|
|
495
|
-
},
|
|
496
|
-
digest(_enc) {
|
|
497
|
-
let h = 2166136261;
|
|
498
|
-
for (let i = 0; i < buf.length; i++) {
|
|
499
|
-
h ^= buf.charCodeAt(i);
|
|
500
|
-
h = h * 16777619 >>> 0;
|
|
501
|
-
}
|
|
502
|
-
return h.toString(16).padStart(8, "0");
|
|
503
|
-
}
|
|
504
|
-
};
|
|
505
|
-
}
|
|
506
|
-
var hasLayerContent = (layer) => Boolean(layer.content);
|
|
507
|
-
var estimateContextTokens = (content) => estimateTokenCount(content);
|
|
508
|
-
var compileContextLayers = (layers) => {
|
|
509
|
-
const compiledLayers = [];
|
|
510
|
-
for (const layer of layers) {
|
|
511
|
-
if (!hasLayerContent(layer)) continue;
|
|
512
|
-
const estimatedTokens = estimateContextTokens(layer.content);
|
|
513
|
-
compiledLayers.push({
|
|
514
|
-
id: layer.id,
|
|
515
|
-
owner: layer.owner,
|
|
516
|
-
content: layer.content,
|
|
517
|
-
cacheScope: layer.cacheScope ?? "turn",
|
|
518
|
-
charCount: layer.content.length,
|
|
519
|
-
estimatedTokens,
|
|
520
|
-
tokenBudget: layer.tokenBudget,
|
|
521
|
-
budgetStatus: typeof layer.tokenBudget === "number" ? estimatedTokens <= layer.tokenBudget ? "within-budget" : "over-budget" : void 0
|
|
522
|
-
});
|
|
523
|
-
}
|
|
524
|
-
const stablePrefixLayers = [];
|
|
525
|
-
for (const layer of compiledLayers) {
|
|
526
|
-
if (layer.cacheScope === "turn") break;
|
|
527
|
-
stablePrefixLayers.push(layer);
|
|
528
|
-
}
|
|
529
|
-
const stablePrefixContent = stablePrefixLayers.map((layer) => layer.content).join("\n\n");
|
|
530
|
-
const dynamicLayers = compiledLayers.slice(stablePrefixLayers.length);
|
|
531
|
-
const dynamicContent = dynamicLayers.map((layer) => layer.content).join("\n\n");
|
|
532
|
-
const misorderedLayerIds = dynamicLayers.filter((layer) => layer.cacheScope !== "turn").map((layer) => layer.id);
|
|
533
|
-
return {
|
|
534
|
-
content: compiledLayers.map((layer) => layer.content).join("\n\n"),
|
|
535
|
-
stablePrefixContent,
|
|
536
|
-
dynamicContent,
|
|
537
|
-
layers: compiledLayers,
|
|
538
|
-
cacheProfile: {
|
|
539
|
-
stablePrefixHash: createHash("sha256").update(stablePrefixContent).digest("hex"),
|
|
540
|
-
stablePrefixLayerIds: stablePrefixLayers.map((layer) => layer.id),
|
|
541
|
-
stablePrefixCharCount: stablePrefixContent.length,
|
|
542
|
-
stablePrefixEstimatedTokens: estimateContextTokens(stablePrefixContent),
|
|
543
|
-
misorderedLayerIds
|
|
544
|
-
}
|
|
545
|
-
};
|
|
546
|
-
};
|
|
547
|
-
|
|
548
494
|
// packages/ai/agent/buildSystemPrompt.ts
|
|
549
495
|
var CLARIFICATION_MODE_INSTRUCTIONS = `\u5728\u4F60\u8FD8\u4E0D\u4E86\u89E3\u7528\u6237\u610F\u56FE\u65F6\uFF0C\u901A\u8FC7\u63D0\u95EE\u6765\u6F84\u6E05\u9700\u6C42\uFF0C\u800C\u4E0D\u662F\u4ED3\u4FC3\u7ED9\u51FA\u7B54\u6848\u3002`;
|
|
550
496
|
var isBrowser = typeof window !== "undefined";
|
|
@@ -559,22 +505,6 @@ var createContextSection = (title, description, content) => content ? `### ${tit
|
|
|
559
505
|
${description}
|
|
560
506
|
|
|
561
507
|
${content} ` : "";
|
|
562
|
-
var buildResponseGuidelines = (isMobile) => {
|
|
563
|
-
if (isMobile) {
|
|
564
|
-
return `--- \u54CD\u5E94\u5C55\u793A\u6307\u5357\uFF08\u7A84\u5C4F / TUI / \u79FB\u52A8\u7AEF\uFF09 ---
|
|
565
|
-
\u5F53\u524D\u5904\u4E8E\u7A84\u5C4F\u6216\u7EC8\u7AEF\u89C6\u56FE\uFF0C\u8BF7\u91C7\u7528\u7D27\u51D1\u3001\u9AD8\u626B\u63CF\u7387\u7684\u6392\u7248\uFF1A
|
|
566
|
-
- **\u7ED3\u6784\u4E0E\u7559\u767D**\uFF1A\u7ED3\u8BBA\u6216\u5173\u952E\u72B6\u6001\u7F6E\u9876\uFF0C\u76F4\u5954\u4E3B\u9898\uFF1B\u77ED\u6BB5\u843D\uFF082-4 \u53E5\uFF09\u5E76\u4FDD\u6301\u7A7A\u884C\u547C\u5438\uFF0C\u62D2\u7EDD\u957F\u6BB5\u6587\u5B57\u5899\u3002
|
|
567
|
-
- **\u5217\u8868\u4E0E\u7F29\u8FDB**\uFF1A\u5217\u8868\u9879\u7528\u300C- **\u6838\u5FC3\u8BCD**\uFF1A\u8BF4\u660E\u300D\uFF1B\u5D4C\u5957\u6700\u591A 2 \u5C42\uFF0C\u5B50\u5217\u8868\u7F29\u8FDB 2 \u7A7A\u683C\uFF0C\u9632\u6B62\u7EC8\u7AEF\u4E0E\u79FB\u52A8\u7AEF\u6298\u884C\u9519\u4F4D\uFF1B\u5E76\u5217\u7528\u65E0\u5E8F\u5217\u8868\uFF0C\u6B65\u9AA4\u7528\u6709\u5E8F\u5217\u8868\u3002
|
|
568
|
-
- **\u8868\u683C\u964D\u7EA7**\uFF1A\u4E25\u7981\u4F7F\u7528 \u22654 \u5217\u7684\u5927\u5BBD\u8868\uFF08\u7A84\u5C4F/\u7EC8\u7AEF\u4E0B\u6298\u884C\u4E25\u91CD\u9519\u4F4D\uFF09\uFF0C\u6539\u7528\u300C\u952E\u503C\u6E05\u5355\u300D\u6216\u7EB5\u5411\u5361\u7247\u3002
|
|
569
|
-
- **\u7B26\u53F7\u4E0E\u4EE3\u7801**\uFF1A\u514B\u5236\u4F7F\u7528\u300C---\u300D\u5206\u5272\u7EBF\uFF08\u4EC5\u5927\u4E3B\u9898\u5207\u6362\u6216\u7ED3\u8BBA\u524D\uFF0C\u524D\u540E\u7559\u7A7A\u884C\uFF09\uFF1B\u8DEF\u5F84\u3001\u547D\u4EE4\u4E0E\u53C2\u6570\u4E00\u5F8B\u7528\u53CD\u5F15\u53F7 \` \` \u5305\u88F9\uFF1B\u4EE3\u7801\u5757\u6807\u660E\u8BED\u8A00\u4E14\u907F\u514D\u6A2A\u5411\u8D85\u957F\u884C\uFF1B\u514B\u5236 Emoji\u3002`;
|
|
570
|
-
}
|
|
571
|
-
return `--- \u54CD\u5E94\u5C55\u793A\u6307\u5357\uFF08\u5BBD\u5C4F / \u684C\u9762\u7AEF\uFF09 ---
|
|
572
|
-
\u5F53\u524D\u5904\u4E8E\u5927\u5C4F\u89C6\u56FE\uFF0C\u53EF\u5145\u5206\u53D1\u6325\u7A7A\u95F4\u4F18\u52BF\uFF1A
|
|
573
|
-
- **\u7ED3\u6784\u4E0E\u7559\u767D**\uFF1A\u63D0\u4F9B\u5C42\u6B21\u6E05\u6670\u7684\u5168\u666F\u7ED3\u6784\uFF0C\u91CD\u8981\u6A21\u5757\u7528\u4E8C\u7EA7/\u4E09\u7EA7\u6807\u9898\u5212\u5206\uFF1B\u6BB5\u843D\u4FDD\u6301 2-4 \u53E5\u5E76\u7559\u7A7A\u884C\u547C\u5438\uFF0C\u76F4\u5954\u4E3B\u9898\u3002
|
|
574
|
-
- **\u5217\u8868\u4E0E\u7F29\u8FDB**\uFF1A\u5217\u8868\u9879\u7528\u300C- **\u6838\u5FC3\u8BCD**\uFF1A\u8BF4\u660E\u300D\uFF1B\u5D4C\u5957\u6700\u591A 2 \u5C42\uFF0C\u5B50\u5217\u8868\u7F29\u8FDB 2 \u7A7A\u683C\uFF1B\u5E76\u5217\u7528\u65E0\u5E8F\u5217\u8868\uFF0C\u6B65\u9AA4\u7528\u6709\u5E8F\u5217\u8868\u3002
|
|
575
|
-
- **\u8868\u683C\u4E0E\u5BF9\u6BD4**\uFF1A\u5BBD\u5C4F\u4E0B\u53EF\u9002\u5EA6\u4F7F\u7528 Markdown \u591A\u5217\u8868\u683C\u8FDB\u884C\u65B9\u6848\u6A2A\u5411\u5BF9\u6BD4\u3001\u53C2\u6570\u6C47\u603B\u6216\u77E9\u9635\u5206\u6790\u3002
|
|
576
|
-
- **\u7B26\u53F7\u4E0E\u4EE3\u7801**\uFF1A\u53EF\u5C55\u793A\u66F4\u5B8C\u6574\u7684\u4EE3\u7801\u4E0A\u4E0B\u6587\u4E0E\u591A\u6B65\u6267\u884C\u793A\u4F8B\uFF1B\u8DEF\u5F84\u3001\u547D\u4EE4\u4E0E\u53C2\u6570\u7528\u53CD\u5F15\u53F7 \` \` \u5305\u88F9\uFF0C\u4EE3\u7801\u5757\u6807\u660E\u8BED\u8A00\uFF1B\u514B\u5236\u4F7F\u7528\u5206\u5272\u7EBF\u4E0E Emoji\u3002`;
|
|
577
|
-
};
|
|
578
508
|
var buildReferenceMaterialsBlock = (contexts) => {
|
|
579
509
|
const sections = [
|
|
580
510
|
createContextSection(
|
|
@@ -706,6 +636,8 @@ ${wrapHistoricalSummaryWithReplayGuard(contexts.dialogSummary)}` : "";
|
|
|
706
636
|
{ id: "user-response-language", owner: "platform", cacheScope: "session", content: buildUserResponseLanguageContext({ language: safeLanguage }) },
|
|
707
637
|
{ id: "startup-protocol", owner: "platform", cacheScope: "static", content: startupProtocol },
|
|
708
638
|
{ id: "core-persona", owner: "agent", cacheScope: "session", content: corePersonaSection },
|
|
639
|
+
{ id: "tool-round-economy", owner: "platform", cacheScope: "session", content: toolSections.toolRoundEconomy },
|
|
640
|
+
{ id: "privilege-escalation", owner: "platform", cacheScope: "session", content: toolSections.privilegeEscalation },
|
|
709
641
|
{ id: "agent-orchestration", owner: "platform", cacheScope: "session", content: toolSections.agentOrchestration },
|
|
710
642
|
{ id: "agent-collaboration", owner: "platform", cacheScope: "session", content: toolSections.agentCollaboration },
|
|
711
643
|
{ id: "web-access", owner: "platform", cacheScope: "session", content: toolSections.webAccess },
|
|
@@ -713,8 +645,7 @@ ${wrapHistoricalSummaryWithReplayGuard(contexts.dialogSummary)}` : "";
|
|
|
713
645
|
{ id: "clarification-mode", owner: "platform", cacheScope: "session", content: clarifyingSection },
|
|
714
646
|
{ id: "knowledge-management", owner: "platform", cacheScope: "session", content: toolSections.knowledgeManagement },
|
|
715
647
|
{ id: "memory-capture", owner: "platform", cacheScope: "session", content: toolSections.memoryCapture },
|
|
716
|
-
{ id: "
|
|
717
|
-
{ id: "generic-agent-update", owner: "platform", cacheScope: "session", content: toolSections.genericAgentUpdate },
|
|
648
|
+
{ id: "agent-config-maintenance", owner: "platform", cacheScope: "session", content: toolSections.agentConfigMaintenance },
|
|
718
649
|
{ id: "context-layer-contract", owner: "platform", cacheScope: "static", content: contextLayerContract },
|
|
719
650
|
{
|
|
720
651
|
id: "email-registration-workflow",
|
|
@@ -731,13 +662,7 @@ ${wrapHistoricalSummaryWithReplayGuard(contexts.dialogSummary)}` : "";
|
|
|
731
662
|
{ id: "memory-overlay", owner: "runtime", cacheScope: "turn", content: memoryOverlaySection },
|
|
732
663
|
{ id: "app-working-memory", owner: "runtime", cacheScope: "turn", content: appWorkingMemorySection },
|
|
733
664
|
{ id: "dialog-summary", owner: "runtime", cacheScope: "turn", content: dialogSummarySection },
|
|
734
|
-
{ id: "editing-context", owner: "runtime", cacheScope: "turn", content: editingContextSection }
|
|
735
|
-
{
|
|
736
|
-
id: "current-time",
|
|
737
|
-
owner: "platform",
|
|
738
|
-
cacheScope: "turn",
|
|
739
|
-
content: buildCurrentTimeBlock(now, timeZone)
|
|
740
|
-
}
|
|
665
|
+
{ id: "editing-context", owner: "runtime", cacheScope: "turn", content: editingContextSection }
|
|
741
666
|
]);
|
|
742
667
|
};
|
|
743
668
|
|
|
@@ -809,6 +734,7 @@ var buildRequestBody = (options) => {
|
|
|
809
734
|
model,
|
|
810
735
|
messages,
|
|
811
736
|
providerName,
|
|
737
|
+
customProviderUrl,
|
|
812
738
|
temperature,
|
|
813
739
|
top_p,
|
|
814
740
|
frequency_penalty,
|
|
@@ -825,7 +751,8 @@ var buildRequestBody = (options) => {
|
|
|
825
751
|
stream: true
|
|
826
752
|
};
|
|
827
753
|
const usageRequestOptions = getUsageRequestOptions(providerName, {
|
|
828
|
-
api: "chat-completions"
|
|
754
|
+
api: "chat-completions",
|
|
755
|
+
endpoint: customProviderUrl
|
|
829
756
|
});
|
|
830
757
|
Object.assign(bodyData, usageRequestOptions);
|
|
831
758
|
if (reasoning_effort && isModelSupportReasoningEffort(model)) {
|
|
@@ -881,6 +808,7 @@ var generateOpenAIRequestBody = (agentConfig, providerName, messages, contexts,
|
|
|
881
808
|
model: resolvedModel,
|
|
882
809
|
messages: messagesWithPrompt,
|
|
883
810
|
providerName,
|
|
811
|
+
customProviderUrl: agentConfig.customProviderUrl,
|
|
884
812
|
temperature: agentConfig.temperature,
|
|
885
813
|
top_p: agentConfig.top_p,
|
|
886
814
|
frequency_penalty: agentConfig.frequency_penalty,
|
|
@@ -905,7 +833,8 @@ var generateOpenAIRequestBody = (agentConfig, providerName, messages, contexts,
|
|
|
905
833
|
return normalizeChatCompletionsBodyForProvider({
|
|
906
834
|
body: requestBody,
|
|
907
835
|
provider: providerName,
|
|
908
|
-
model: requestBody.model
|
|
836
|
+
model: requestBody.model,
|
|
837
|
+
endpoint: agentConfig.customProviderUrl
|
|
909
838
|
});
|
|
910
839
|
};
|
|
911
840
|
|
|
@@ -1077,13 +1006,22 @@ var generateRequestBody = ({
|
|
|
1077
1006
|
resolveAgentCallPlan(agentConfigForRequest, {})
|
|
1078
1007
|
);
|
|
1079
1008
|
if (clientWire === "responses") {
|
|
1080
|
-
|
|
1009
|
+
const body = generateResponseRequestBody(
|
|
1081
1010
|
agentConfigForRequest,
|
|
1082
1011
|
[...stableMessages ?? [], ...messages],
|
|
1083
1012
|
contexts,
|
|
1084
1013
|
prependSystemPrompt,
|
|
1085
1014
|
responsesState
|
|
1086
1015
|
);
|
|
1016
|
+
body.prompt_cache_key ??= stablePromptCacheKey(
|
|
1017
|
+
[
|
|
1018
|
+
agentConfigForRequest.model,
|
|
1019
|
+
agentConfigForRequest.dbKey ?? "",
|
|
1020
|
+
agentConfigForRequest.prompt ?? ""
|
|
1021
|
+
],
|
|
1022
|
+
"nolo-openai"
|
|
1023
|
+
);
|
|
1024
|
+
return body;
|
|
1087
1025
|
}
|
|
1088
1026
|
const baseBody = generateOpenAIRequestBody(
|
|
1089
1027
|
agentConfigForRequest,
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
import {
|
|
2
|
+
resolveNoloHome
|
|
3
|
+
} from "./chunk-GLKOYSRU.js";
|
|
4
|
+
|
|
5
|
+
// packages/database-engine/cliAuthorityStoreDriver.ts
|
|
6
|
+
import path from "node:path";
|
|
7
|
+
function readCliAuthorityDriver(env) {
|
|
8
|
+
const value = env.NOLO_CLI_AUTHORITY_DRIVER?.trim();
|
|
9
|
+
if (value === "broker") {
|
|
10
|
+
return { driver: "broker", invalidDriver: null };
|
|
11
|
+
}
|
|
12
|
+
return {
|
|
13
|
+
driver: "broker",
|
|
14
|
+
invalidDriver: value ? value : null
|
|
15
|
+
};
|
|
16
|
+
}
|
|
17
|
+
function resolveCliAuthorityRunDir(options = {}) {
|
|
18
|
+
return path.join(resolveNoloHome({
|
|
19
|
+
...options,
|
|
20
|
+
env: options.env ?? process.env
|
|
21
|
+
}), "run");
|
|
22
|
+
}
|
|
23
|
+
function hashString(value) {
|
|
24
|
+
let hash = 0;
|
|
25
|
+
for (let index = 0; index < value.length; index += 1) {
|
|
26
|
+
hash = (hash << 5) - hash + value.charCodeAt(index) | 0;
|
|
27
|
+
}
|
|
28
|
+
return Math.abs(hash);
|
|
29
|
+
}
|
|
30
|
+
function resolveCliAuthorityBrokerPort(options = {}) {
|
|
31
|
+
const envPort = options.env?.NOLO_CLI_AUTHORITY_BROKER_PORT?.trim();
|
|
32
|
+
if (envPort) {
|
|
33
|
+
const port = Number(envPort);
|
|
34
|
+
if (Number.isInteger(port) && port > 0 && port < 65536) return port;
|
|
35
|
+
}
|
|
36
|
+
const noloHome = resolveNoloHome({
|
|
37
|
+
...options,
|
|
38
|
+
env: options.env ?? {}
|
|
39
|
+
});
|
|
40
|
+
return 47e3 + hashString(noloHome) % 2e3;
|
|
41
|
+
}
|
|
42
|
+
function resolveCliAuthorityStoreDriver(options = {}) {
|
|
43
|
+
return readCliAuthorityDriver(options.env ?? {}).driver;
|
|
44
|
+
}
|
|
45
|
+
function resolveCliAuthorityBrokerSocketPath(options) {
|
|
46
|
+
return path.join(resolveCliAuthorityRunDir(options), "authority-store-broker.sock");
|
|
47
|
+
}
|
|
48
|
+
function resolveCliAuthorityBrokerEndpoint(options) {
|
|
49
|
+
if (options.transport === "tcp") {
|
|
50
|
+
return `tcp://127.0.0.1:${resolveCliAuthorityBrokerPort(options)}`;
|
|
51
|
+
}
|
|
52
|
+
return `unix://${resolveCliAuthorityBrokerSocketPath(options)}`;
|
|
53
|
+
}
|
|
54
|
+
function resolveCliAuthorityBrokerMetadataPath(options) {
|
|
55
|
+
return path.join(resolveCliAuthorityRunDir(options), "authority-store-broker.json");
|
|
56
|
+
}
|
|
57
|
+
function resolveCliAuthorityBrokerHealthPath(options) {
|
|
58
|
+
return path.join(resolveCliAuthorityRunDir(options), "authority-store-broker.health.json");
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
export {
|
|
62
|
+
resolveCliAuthorityStoreDriver,
|
|
63
|
+
resolveCliAuthorityBrokerEndpoint,
|
|
64
|
+
resolveCliAuthorityBrokerMetadataPath,
|
|
65
|
+
resolveCliAuthorityBrokerHealthPath
|
|
66
|
+
};
|
|
File without changes
|
|
@@ -14,7 +14,7 @@ function buildCliLocalRuntimeDbEnv(env = process.env) {
|
|
|
14
14
|
};
|
|
15
15
|
}
|
|
16
16
|
async function getDefaultCliLocalRuntimeDb(options = {}) {
|
|
17
|
-
const { getDefaultCliLocalRuntimeDb: getAuthorityBackedDb } = await import("./localRuntimeAuthority-
|
|
17
|
+
const { getDefaultCliLocalRuntimeDb: getAuthorityBackedDb } = await import("./localRuntimeAuthority-R5UBODT3.js");
|
|
18
18
|
return getAuthorityBackedDb(options);
|
|
19
19
|
}
|
|
20
20
|
|
|
@@ -2,6 +2,8 @@
|
|
|
2
2
|
var QUOTA_ERROR_PATTERNS = [
|
|
3
3
|
/429/,
|
|
4
4
|
/quota/i,
|
|
5
|
+
/access_terminated_error/i,
|
|
6
|
+
/(?:weekly|monthly)\s*(?:\([^)]*\)\s*)?usage\s+limit/i,
|
|
5
7
|
/rate\s*limit/i,
|
|
6
8
|
/too\s*many\s*requests/i,
|
|
7
9
|
/额度/,
|
|
@@ -24,11 +26,24 @@ function isQuotaExhaustedError(error) {
|
|
|
24
26
|
return QUOTA_ERROR_PATTERNS.some((pattern) => pattern.test(error));
|
|
25
27
|
}
|
|
26
28
|
const maybeStatus = error.status;
|
|
27
|
-
if (typeof maybeStatus === "number" && maybeStatus === 429) return true;
|
|
28
29
|
const maybeStatusCode = error.statusCode;
|
|
29
|
-
|
|
30
|
+
const status = typeof maybeStatus === "number" ? maybeStatus : maybeStatusCode;
|
|
31
|
+
if (status === 429) return true;
|
|
32
|
+
if (status === 403) {
|
|
33
|
+
const message = extractMessage(error);
|
|
34
|
+
return QUOTA_ERROR_PATTERNS.some((pattern) => pattern.test(message));
|
|
35
|
+
}
|
|
30
36
|
return false;
|
|
31
37
|
}
|
|
38
|
+
function extractMessage(error) {
|
|
39
|
+
if (typeof error === "string") return error;
|
|
40
|
+
if (error instanceof Error) return error.message;
|
|
41
|
+
if (error && typeof error === "object") {
|
|
42
|
+
const m = error.message;
|
|
43
|
+
return typeof m === "string" ? m : "";
|
|
44
|
+
}
|
|
45
|
+
return "";
|
|
46
|
+
}
|
|
32
47
|
function parseResetsInMs(text) {
|
|
33
48
|
if (!text) return void 0;
|
|
34
49
|
const unitMs = (n, unit) => {
|
|
@@ -114,7 +129,11 @@ function parseResetAtText(value, now) {
|
|
|
114
129
|
return Number.isFinite(parsed) && parsed > now ? parsed : void 0;
|
|
115
130
|
}
|
|
116
131
|
function matchesPeriodicUsageLimitText(text) {
|
|
117
|
-
return /weekly
|
|
132
|
+
return /(?:weekly|monthly)\s*(?:\([^)]*\)\s*)?usage\s+limit/i.test(text);
|
|
133
|
+
}
|
|
134
|
+
function isQuotaLimited403Body(body) {
|
|
135
|
+
const text = typeof body === "string" ? body : JSON.stringify(body ?? "");
|
|
136
|
+
return matchesPeriodicUsageLimitText(text) || /access_terminated_error/i.test(text) || /(?:quota|usage)\s+(?:is\s+)?(?:exhausted|depleted|used\s+up|reached)/i.test(text) || /(?:quota|usage).{0,40}\b(?:reset|resets)\s+at\b/i.test(text);
|
|
118
137
|
}
|
|
119
138
|
function resolveNextAvailableAt(body, now, headers) {
|
|
120
139
|
const headerRetryAfter = headers && typeof headers.get === "function" ? headers.get("retry-after") : headers?.["retry-after"] ?? headers?.["Retry-After"];
|
|
@@ -132,6 +151,9 @@ function resolveNextAvailableAt(body, now, headers) {
|
|
|
132
151
|
return clampCooldownDeadline(parsed, now);
|
|
133
152
|
}
|
|
134
153
|
function resolveAvailabilityAction(status, body, now, headers) {
|
|
154
|
+
if (status === 403 && isQuotaLimited403Body(body)) {
|
|
155
|
+
return { kind: "mark", nextAvailableAt: resolveNextAvailableAt(body, now, headers) };
|
|
156
|
+
}
|
|
135
157
|
if (status >= 200 && status < 300) return { kind: "clear" };
|
|
136
158
|
if (status === 429) {
|
|
137
159
|
return { kind: "mark", nextAvailableAt: resolveNextAvailableAt(body, now, headers) };
|
|
@@ -161,6 +183,7 @@ export {
|
|
|
161
183
|
QUOTA_ERROR_PATTERNS,
|
|
162
184
|
isQuotaExhaustedError,
|
|
163
185
|
isAgentUnavailableNow,
|
|
186
|
+
isQuotaLimited403Body,
|
|
164
187
|
resolveAvailabilityAction,
|
|
165
188
|
mergeAvailabilityDeadline,
|
|
166
189
|
resolveCooldownGate
|
|
@@ -1,13 +1,13 @@
|
|
|
1
|
+
import {
|
|
2
|
+
getActiveDialogKey
|
|
3
|
+
} from "./chunk-6YTOJY35.js";
|
|
1
4
|
import {
|
|
2
5
|
require_date_fns
|
|
3
6
|
} from "./chunk-M76ECQRD.js";
|
|
4
|
-
import {
|
|
5
|
-
getActiveDialogKey
|
|
6
|
-
} from "./chunk-MRWGHF56.js";
|
|
7
7
|
import {
|
|
8
8
|
patch,
|
|
9
9
|
selectById
|
|
10
|
-
} from "./chunk-
|
|
10
|
+
} from "./chunk-DNNSCSA2.js";
|
|
11
11
|
import {
|
|
12
12
|
__toESM
|
|
13
13
|
} from "./chunk-4VNS5WPM.js";
|