nolo-cli 0.107.0-alpha.4 → 0.107.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -1
- package/{_executeModel-UDCSOTD2.js → _executeModel-M573MKVE.js} +78 -70
- package/action-GVA5ARSJ.js +20 -0
- package/{addContentAction-MB2HHMDZ.js → addContentAction-M2WOWZCL.js} +13 -12
- package/{addDialogAgentAction-MCEABSBA.js → addDialogAgentAction-QMAQ5Z6N.js} +19 -20
- package/{agentDeleteCommand-OWYHN6D6.js → agentDeleteCommand-ZFHYRHBS.js} +118 -43
- package/{agentEmailCommands-AU5I4M4W.js → agentEmailCommands-X6AVPIVQ.js} +100 -90
- package/agentListCommands-PAD2CI2I.js +741 -0
- package/{agentMachineCommands-YMNME2L6.js → agentMachineCommands-UPH6RJCC.js} +50 -46
- package/{agentProviderCommands-GNPTL5XR.js → agentProviderCommands-CMVTBY5X.js} +97 -2
- package/{agentPullCommand-O5MPVJ5E.js → agentPullCommand-B4T2DJ5H.js} +1 -1
- package/agentRecordCommands-UMACPRAF.js +138 -0
- package/agentRunCommand-H6KKHHMU.js +167 -0
- package/{agentRunControl-AVJR4JW4.js → agentRunControl-3HWA2LLQ.js} +2 -2
- package/{agentRuntimeLocal-KCMC2TBD.js → agentRuntimeLocal-N4YGKL7M.js} +44 -40
- package/{agentSlice-R7PR6KYM.js → agentSlice-2LPP43XH.js} +15 -14
- package/{appDeleteCommands-JEPA3EWE.js → appDeleteCommands-7DAF33AM.js} +46 -42
- package/{appDeployCommands-UTB76XFM.js → appDeployCommands-ZPZSMFGZ.js} +46 -42
- package/{appDeployStatusCommands-LGHF2SBD.js → appDeployStatusCommands-FWBDSSS5.js} +46 -42
- package/{appGetCommands-PX2BFHOB.js → appGetCommands-SZZOHGEP.js} +46 -42
- package/{appListCommands-BSMPTWKC.js → appListCommands-FPMUBDPM.js} +46 -42
- package/{authCommand-YW42YZA4.js → authCommand-VL3G26NQ.js} +119 -25
- package/{authCommands-RGOGCPP6.js → authCommands-5RTUDYZW.js} +7 -5
- package/{builtinSkillRegistry-FUAVTRVZ.js → builtinSkillRegistry-ZK4K67Y5.js} +11 -9
- package/{chromeCommands-FZYAU75D.js → chromeCommands-AU5ZJXBG.js} +289 -37
- package/{chromeOpsCommands-62P2Q2YB.js → chromeOpsCommands-ZYTCMNHG.js} +156 -22
- package/{chunk-JEDZAO7L.js → chunk-2SYTUTLI.js} +257 -37
- package/{chunk-HVURBGF3.js → chunk-2U3NHADM.js} +6 -6
- package/{chunk-QTGQ2LTL.js → chunk-3DQY5IFB.js} +6 -10
- package/{chunk-XT35TTFG.js → chunk-3IXAHOJS.js} +19 -21
- package/{chunk-UVA7OYO3.js → chunk-3W67RV75.js} +29 -9
- package/chunk-4LCOCOR5.js +50 -0
- package/{chunk-JPGCXHNM.js → chunk-4LKMZ3RR.js} +1 -1
- package/{chunk-2GRGFCF6.js → chunk-4VJAC32I.js} +2 -1
- package/{chunk-6D6VBVEW.js → chunk-4W24JM32.js} +80 -14
- package/{chunk-MC4XLIJ7.js → chunk-523DITKR.js} +1 -1
- package/{chunk-E4MARS3Q.js → chunk-5GVBDNTO.js} +1 -1
- package/{chunk-C3M4465B.js → chunk-5HYJ3DSZ.js} +404 -659
- package/chunk-5MMAK75Q.js +15 -0
- package/{chunk-7S4YWN7P.js → chunk-5UUIGN6I.js} +4 -4
- package/{chunk-42V6BK2E.js → chunk-62IL3KQV.js} +4 -34
- package/{chunk-4MK3I7Y4.js → chunk-6MAW4XOF.js} +5 -5
- package/{chunk-3UZPUAES.js → chunk-74PPKIY2.js} +1 -1
- package/chunk-76HO2DP6.js +15 -0
- package/{chunk-ASIFZ2WY.js → chunk-7BBP7ZX3.js} +66 -54
- package/{chunk-VLTIYV3X.js → chunk-7I25CBT5.js} +34 -8
- package/{chunk-IBOZNTG2.js → chunk-7X5XZ34C.js} +23 -28
- package/chunk-AGIM7IMJ.js +147 -0
- package/{chunk-5UTFL4QJ.js → chunk-APO5TOXO.js} +1 -1
- package/{chunk-EEGDMATE.js → chunk-AZOVPTL6.js} +91 -81
- package/{chunk-6OZ36FXI.js → chunk-BIPGGSJS.js} +22 -4
- package/{chunk-EYAQT56M.js → chunk-BNQMNUKZ.js} +9 -6
- package/{chunk-62CATUYY.js → chunk-CBUMFIFE.js} +834 -962
- package/{chunk-OIVSQH2O.js → chunk-CDEEFJXN.js} +308 -11
- package/chunk-CHOZJMJS.js +78 -0
- package/{chunk-ETI2NYVF.js → chunk-CIP3AAMT.js} +4 -4
- package/{chunk-GBRG75BQ.js → chunk-D2MDMY2M.js} +1 -0
- package/{chunk-W7HLWAQ7.js → chunk-DE45KZNH.js} +118 -90
- package/{chunk-Q554LLSI.js → chunk-DMXLXZKL.js} +1 -1
- package/{chunk-3VNWWVKB.js → chunk-E3YWHWCR.js} +50 -18
- package/{chunk-HKNXJGEC.js → chunk-ECFHBYUW.js} +85 -50
- package/{chunk-ACTMNVHM.js → chunk-EHSYSKXV.js} +1 -1
- package/{chunk-WV42OMV7.js → chunk-ELUDRSRD.js} +8 -8
- package/{chunk-ABQYVJBJ.js → chunk-EV235ILT.js} +5 -5
- package/{chunk-TRV2MIDW.js → chunk-EXAJ6DCR.js} +1 -0
- package/{chunk-BFDFRLLQ.js → chunk-EZ4VZHAG.js} +5 -5
- package/{chunk-GO3Z72MT.js → chunk-FHLMQIU7.js} +65 -95
- package/{chunk-2F7RJC6L.js → chunk-FOXQ7BAB.js} +1 -1
- package/{chunk-SH43IESU.js → chunk-GGC55Q32.js} +199 -29
- package/chunk-GMZLP5DV.js +82 -0
- package/{chunk-FDTR4QJ6.js → chunk-H6A6X4EK.js} +32 -1
- package/{chunk-DVINR3PL.js → chunk-HDLLCBRF.js} +1 -1
- package/{chunk-QOKAKDPE.js → chunk-HIM3FCLF.js} +0 -1
- package/{chunk-ONXOABJR.js → chunk-HNGRBWYF.js} +3 -0
- package/{chunk-BNGW5ASC.js → chunk-I2RGRVQ7.js} +22 -2
- package/{chunk-O6OSWFZQ.js → chunk-IHPDK6UD.js} +6 -0
- package/{chunk-QDSINZM3.js → chunk-IXH3HKY2.js} +1 -22
- package/{chunk-GQBOR3G6.js → chunk-JBKHQOYK.js} +8 -4
- package/{chunk-XD2MJFUG.js → chunk-JEFXP73H.js} +1 -1
- package/{chunk-PBA4UJBK.js → chunk-JIXGJTBU.js} +4 -4
- package/{chunk-AEOE4Z6Q.js → chunk-K6L5PNXK.js} +39 -15
- package/{chunk-Z77CRGTW.js → chunk-KA5O5KQL.js} +1 -1
- package/{chunk-GPCZ7UXG.js → chunk-KD6D6BLA.js} +1 -1
- package/{chunk-4CR5I7BD.js → chunk-KFWDYYSS.js} +47 -67
- package/{chunk-UZGQNTVW.js → chunk-KHKTDMYG.js} +8 -6
- package/{chunk-JDPFV2JV.js → chunk-KWUKOQM2.js} +20 -11
- package/{chunk-MRIHM22T.js → chunk-LBFL6RZG.js} +58 -9
- package/{chunk-LS2ZANRJ.js → chunk-LOCNXNOU.js} +1 -1
- package/{chunk-DHDMC6FO.js → chunk-LUBFABMJ.js} +15 -14
- package/{chunk-NA35QHCF.js → chunk-LVBFKW65.js} +1 -1
- package/chunk-LWLNLZC5.js +265 -0
- package/chunk-N4NGJDT6.js +929 -0
- package/{chunk-BFU6C242.js → chunk-NMFV26UG.js} +1 -1
- package/{chunk-FZGV4FGK.js → chunk-NUHHBEJC.js} +378 -187
- package/chunk-NWENLDMM.js +42 -0
- package/chunk-O7SVKKLY.js +875 -0
- package/chunk-OCZKATRC.js +129 -0
- package/{chunk-6Z7MY3V7.js → chunk-OEJLGVBL.js} +5 -5
- package/{chunk-VMFTFOWF.js → chunk-OKGVNZTL.js} +35 -8
- package/{chunk-GEPUP7OO.js → chunk-OR2UWD6X.js} +3 -3
- package/{chunk-KQHGZWSV.js → chunk-OXME3PEE.js} +1 -1
- package/{chunk-J4MOO56S.js → chunk-PNXHPLRU.js} +10 -2
- package/{chunk-3BMYXEUW.js → chunk-R5AJODNI.js} +1 -1
- package/{chunk-P5EVSOPA.js → chunk-R6EBQEQE.js} +22 -29
- package/chunk-RQ6CTX2E.js +164 -0
- package/{chunk-MS7TSPZR.js → chunk-RU36ZYSG.js} +19 -17
- package/{chunk-ALXHV7NK.js → chunk-RWXLPUKI.js} +40 -4
- package/{chunk-KQ4ONNQD.js → chunk-RXA3HAVW.js} +190 -8
- package/{chunk-IIVGDG4I.js → chunk-SJKULPGX.js} +13 -7
- package/{chunk-Q67DOFOO.js → chunk-SZC4REES.js} +212 -105
- package/{chunk-JRQFUXY7.js → chunk-TBAXFWOS.js} +99 -22
- package/{chunk-PQFHGD77.js → chunk-TBM2RS3U.js} +161 -14
- package/{chunk-NOF3HDSN.js → chunk-TFOIJFCM.js} +11 -9
- package/{chunk-BYMV6QZG.js → chunk-TNIX77YM.js} +4 -0
- package/chunk-TY3TIUJK.js +89 -0
- package/{chunk-I3TQJXQ7.js → chunk-U3C3IA32.js} +9 -2
- package/{chunk-YYLHWIW6.js → chunk-UKZX3NHN.js} +1 -1
- package/chunk-UM7TA3K4.js +1008 -0
- package/{chunk-6YTOJY35.js → chunk-VBG7GWWR.js} +253 -8
- package/{chunk-GL3EHUR4.js → chunk-VHGYUYQ3.js} +69 -47
- package/chunk-VIWDGTDA.js +8 -0
- package/chunk-VJVNU77E.js +83 -0
- package/chunk-VM6IE2GN.js +8004 -0
- package/{chunk-UKWGR5SS.js → chunk-VY6VFGKR.js} +194 -1144
- package/chunk-VZLO4XJD.js +17 -0
- package/chunk-W32HPLTL.js +13692 -0
- package/{chunk-AHAHBQMU.js → chunk-WDLSZMTA.js} +2 -2
- package/{chunk-53HEEOTT.js → chunk-WF5X57VW.js} +83 -16
- package/{chunk-VRTTFDBM.js → chunk-WPHY3VPF.js} +35 -22
- package/{chunk-3L2WKC3W.js → chunk-XPWGOTBQ.js} +8 -1
- package/chunk-YV25TM3R.js +780 -0
- package/chunk-ZRAU6T47.js +56 -0
- package/{chunk-IBOOZVVD.js → chunk-ZTKZZY2A.js} +851 -279
- package/commandRegistry-ASW6IVZ3.js +833 -0
- package/{contentThunks-IV2T3EJC.js → contentThunks-4XNVOIR7.js} +39 -36
- package/{cooldownCommands-REAWYVTY.js → cooldownCommands-ZLEPIB4A.js} +2 -2
- package/{createAgentAutomationAction-JCOIEYY4.js → createAgentAutomationAction-NHHTCJMC.js} +40 -37
- package/createDialogAction-XEBTHDB3.js +70 -0
- package/{createPageAction-D2VOOLP3.js → createPageAction-VR3WW2AQ.js} +47 -43
- package/{chunk-FG3HKPQP.js → cursorProvider-YGGNMVWX.js} +2751 -10185
- package/{dbSlice-A6C6H32X.js → dbSlice-TG4MZ5EB.js} +12 -11
- package/{deleteFile-YG6QMJLU.js → deleteFile-KESP65GC.js} +7 -6
- package/{dialogCommands-H7FPUYUQ.js → dialogCommands-FJWQG3MX.js} +50 -47
- package/{dialogSlice-6JZOOTDS.js → dialogSlice-GVRDGCRG.js} +57 -37
- package/{dist-VODFSGNG.js → dist-NJC2W7I4.js} +61 -54
- package/{docCreateCommands-WRG2JLGM.js → docCreateCommands-AZSK4NAG.js} +48 -44
- package/{docDeleteCommands-SHWJIBJS.js → docDeleteCommands-DDJMSMFZ.js} +49 -45
- package/{docReadCommands-WJN3WT6O.js → docReadCommands-5F5Q6EBZ.js} +47 -43
- package/{docStore-HUPQ2FSS.js → docStore-SUZUUWDI.js} +17 -13
- package/{docUpdateCommands-IE32IL6O.js → docUpdateCommands-XPNPVZOC.js} +48 -44
- package/{fetchMessages-EIU7UFFK.js → fetchMessages-3PXAHKCR.js} +5 -5
- package/{getPricing-LUSEABA6.js → getPricing-DOBBZLOK.js} +4 -4
- package/{handleSendMessageAction-DFPMQ7YM.js → handleSendMessageAction-VC6VTFKS.js} +109 -42
- package/index.js +87 -884
- package/{lib-FRRS27KN.js → lib-PU2G2MSO.js} +523 -191
- package/{localDialogRead-BTFJ4V2I.js → localDialogRead-UYCKO7YZ.js} +2 -2
- package/{localRuntimeAuthority-6IR6BBXE.js → localRuntimeAuthority-TU6OBC76.js} +9 -6
- package/{localRuntimeDb-SYQGUF4U.js → localRuntimeDb-VKWVOPPI.js} +1 -1
- package/{machineCommands-M2T2I5NF.js → machineCommands-M634V2L3.js} +98 -89
- package/machineWsRunDispatch-Z3HUSTFI.js +154 -0
- package/{memberThunks-P2ECUJ56.js → memberThunks-5S5D3N4U.js} +20 -18
- package/{models-T3SG6MJ5.js → models-PQU25T6Q.js} +2 -2
- package/oauthTokenStore-ITEB663N.js +23 -0
- package/package.json +1 -1
- package/processSpawn-SOAV3FEV.js +11 -0
- package/profileConfig-ZGOFORWV.js +43 -0
- package/{providerPresetApply-FG6NZ57W.js → providerPresetApply-HAQWVAQX.js} +7 -7
- package/{providerRegistry-757OWH3O.js → providerRegistry-5FGWB3X5.js} +11 -7
- package/{read-COE3ZYR6.js → read-LSYFLSIM.js} +8 -7
- package/{readDocTool-5USN4A6V.js → readDocTool-XWRXV3DR.js} +5 -3
- package/{readlineWorkspace-XQRDGWRZ.js → readlineWorkspace-J3YD3DNW.js} +2596 -2032
- package/{removeDialogAgentAction-J6X5QMTA.js → removeDialogAgentAction-4TEFC3VL.js} +22 -26
- package/{runAgentClientLoop-5ZA62FBA.js → runAgentClientLoop-APSMCLAF.js} +79 -72
- package/{runtimeDoctorCommands-X6WDBEQX.js → runtimeDoctorCommands-PIVSBZRZ.js} +4 -4
- package/runtimeModeArgs-2Y7BALTO.js +31 -0
- package/{setDialogExtraReferencesAction-WX5VTY6O.js → setDialogExtraReferencesAction-LSEN44OY.js} +16 -14
- package/{setPrimaryDialogAgentAction-FN22THHT.js → setPrimaryDialogAgentAction-SR366X5A.js} +23 -27
- package/{chunk-GP5LKBUZ.js → settingThunks-CTVPPGIN.js} +226 -940
- package/{skillDiscovery-CYUCJMAG.js → skillDiscovery-ZBU76COE.js} +3 -3
- package/{slateUtils-RIZES3PV.js → slateUtils-NGV2NMKM.js} +1 -1
- package/{spaceCommands-5GLCWZPO.js → spaceCommands-3UK63WPE.js} +51 -47
- package/{streamAgentChatTurn-6UZJMYRB.js → streamAgentChatTurn-DNY2PSRW.js} +215 -115
- package/{switchDialogAgentAction-LVTEV3FR.js → switchDialogAgentAction-M6NAFOOU.js} +19 -20
- package/{tableCommands-O6NWHFKV.js → tableCommands-6U4BMLRR.js} +10 -10
- package/{toolApiClient-QVJ6HDNN.js → toolApiClient-AD7CXTA4.js} +4 -3
- package/tools-X5UWATZK.js +117 -0
- package/{tuiSummaryLlmCaller-OHHFTHMG.js → tuiSummaryLlmCaller-DEH7ZEM6.js} +25 -23
- package/{updateCommands-2M74UL7P.js → updateCommands-4EHDLF5J.js} +3 -3
- package/{updateDialogTitleAction-QTKNIURB.js → updateDialogTitleAction-YSY5BF5A.js} +84 -45
- package/action-P4TNFGAD.js +0 -31
- package/agentListCommands-B2V4YAC4.js +0 -410
- package/agentRecordCommands-G4KK4R7H.js +0 -128
- package/agentRunCommand-UTZJA23G.js +0 -156
- package/browser-image-compression-MFDTD7K6.js +0 -1763
- package/chatQueueReduxAdapter-2P6NFX64.js +0 -186
- package/chunk-CQ3WA2NE.js +0 -299
- package/chunk-M76ECQRD.js +0 -13658
- package/chunk-MEYIRKDN.js +0 -8967
- package/chunk-PUOC4YRO.js +0 -394
- package/chunk-Q5FJJ6XI.js +0 -103
- package/chunk-S7Z2HMCN.js +0 -25
- package/chunk-T75QD6AB.js +0 -20923
- package/chunk-Y5GCAMGP.js +0 -9
- package/chunk-YPREESF4.js +0 -225
- package/createDialogAction-NGG7YVNU.js +0 -65
- package/machineWsRunDispatch-ISBKOOD7.js +0 -144
- package/settingSlice-P4ZW7K5X.js +0 -204
- package/syncMapping-N6RGXGBW.js +0 -437
- package/tools-KMGFWO43.js +0 -110
- package/{chunk-X7HHHIOZ.js → chunk-Y6ROFCZO.js} +0 -0
- package/{db-WK5MDZVN.js → db-VQSAOWAO.js} +1 -1
|
@@ -1,25 +1,65 @@
|
|
|
1
1
|
import {
|
|
2
2
|
normalizeTimingMs
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-R6EBQEQE.js";
|
|
4
4
|
import {
|
|
5
5
|
MODEL_LOOKUP_MAP
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-CDEEFJXN.js";
|
|
7
7
|
import {
|
|
8
8
|
ALL_MODELS
|
|
9
|
-
} from "./chunk-
|
|
9
|
+
} from "./chunk-EHSYSKXV.js";
|
|
10
|
+
import {
|
|
11
|
+
isPlatformManagedProvider
|
|
12
|
+
} from "./chunk-SZC4REES.js";
|
|
13
|
+
import {
|
|
14
|
+
BUILTIN_NOLO_AGENT_KEY
|
|
15
|
+
} from "./chunk-I2RGRVQ7.js";
|
|
10
16
|
import {
|
|
11
17
|
asTrimmedNonEmptyStringArray
|
|
12
|
-
} from "./chunk-
|
|
18
|
+
} from "./chunk-OKGVNZTL.js";
|
|
13
19
|
import {
|
|
14
20
|
asOptionalFiniteNumber
|
|
15
21
|
} from "./chunk-WWC7I6TA.js";
|
|
16
|
-
import {
|
|
17
|
-
BUILTIN_NOLO_AGENT_KEY
|
|
18
|
-
} from "./chunk-BNGW5ASC.js";
|
|
19
22
|
import {
|
|
20
23
|
asOptionalTrimmedString
|
|
21
24
|
} from "./chunk-G3SUCT4W.js";
|
|
22
25
|
|
|
26
|
+
// packages/agent-runtime/autoExecutionProfiles.ts
|
|
27
|
+
var createProfile = (input) => ({
|
|
28
|
+
id: input.id,
|
|
29
|
+
tier: input.tier,
|
|
30
|
+
legacyAgentKey: input.legacyAgentKey,
|
|
31
|
+
key: input.legacyAgentKey,
|
|
32
|
+
name: input.name,
|
|
33
|
+
provider: "nolo",
|
|
34
|
+
model: input.model,
|
|
35
|
+
apiSource: "platform",
|
|
36
|
+
useServerProxy: true,
|
|
37
|
+
rawRecord: {
|
|
38
|
+
dbKey: input.legacyAgentKey,
|
|
39
|
+
isPublic: true,
|
|
40
|
+
provider: "nolo",
|
|
41
|
+
model: input.model,
|
|
42
|
+
apiSource: "platform",
|
|
43
|
+
useServerProxy: true
|
|
44
|
+
}
|
|
45
|
+
});
|
|
46
|
+
var FLASH_PROFILE = createProfile({
|
|
47
|
+
id: "builtin:auto:nolo",
|
|
48
|
+
tier: "flash",
|
|
49
|
+
legacyAgentKey: BUILTIN_NOLO_AGENT_KEY,
|
|
50
|
+
name: "nolo",
|
|
51
|
+
model: "deepseek-flash"
|
|
52
|
+
});
|
|
53
|
+
var AUTO_EXECUTION_PROFILES = {
|
|
54
|
+
flash: FLASH_PROFILE,
|
|
55
|
+
balanced: { ...FLASH_PROFILE, tier: "balanced" },
|
|
56
|
+
quality: { ...FLASH_PROFILE, tier: "quality" },
|
|
57
|
+
image: { ...FLASH_PROFILE, tier: "image" }
|
|
58
|
+
};
|
|
59
|
+
var DEFAULT_AUTO_EXECUTION_TIER = "flash";
|
|
60
|
+
var DEFAULT_AUTO_EXECUTION_PROFILE = AUTO_EXECUTION_PROFILES[DEFAULT_AUTO_EXECUTION_TIER];
|
|
61
|
+
var resolveAutoExecutionProfile = (tier) => AUTO_EXECUTION_PROFILES[tier ?? DEFAULT_AUTO_EXECUTION_TIER] ?? DEFAULT_AUTO_EXECUTION_PROFILE;
|
|
62
|
+
|
|
23
63
|
// packages/ai/token/cacheTokenFields.ts
|
|
24
64
|
var finiteTokenCount = (value) => {
|
|
25
65
|
if (typeof value !== "number" || !Number.isFinite(value)) return void 0;
|
|
@@ -53,13 +93,20 @@ var readCacheReadInputTokens = (usage) => firstPositive(usage, [
|
|
|
53
93
|
]);
|
|
54
94
|
var readCacheCreationInputTokens = (usage) => firstPositive(usage, [
|
|
55
95
|
topLevel("cache_creation_input_tokens"),
|
|
56
|
-
topLevel("prompt_cache_miss_tokens")
|
|
96
|
+
topLevel("prompt_cache_miss_tokens"),
|
|
97
|
+
nested(["input_tokens_details", "cache_write_tokens"])
|
|
57
98
|
]);
|
|
58
99
|
|
|
59
100
|
// packages/ai/llm/getModelContextWindow.ts
|
|
60
101
|
var DEFAULT_CONTEXT_WINDOW = 256e3;
|
|
61
102
|
var QWEN_3_6_CONTEXT_WINDOW = 262144;
|
|
62
103
|
var GLM_5_2_CONTEXT_WINDOW = 1e6;
|
|
104
|
+
var GPT_6_1_SOL_CONTEXT_WINDOW = 5e5;
|
|
105
|
+
var GPT_6_1_SOL_PATTERN = /(^|\/)gpt-6\.1[- ]sol(?![a-z])/;
|
|
106
|
+
function channelPinnedContextWindow(normalizedName) {
|
|
107
|
+
if (GPT_6_1_SOL_PATTERN.test(normalizedName)) return GPT_6_1_SOL_CONTEXT_WINDOW;
|
|
108
|
+
return void 0;
|
|
109
|
+
}
|
|
63
110
|
var ANTIGRAVITY_EFFORT_SUFFIXES = [
|
|
64
111
|
"-tiered",
|
|
65
112
|
"-extra-low",
|
|
@@ -126,6 +173,7 @@ function fuzzyContextWindow(normalizedName) {
|
|
|
126
173
|
if (normalizedName.includes("glm-5.3") || normalizedName.includes("glm5.3")) return 105e4;
|
|
127
174
|
if (normalizedName.includes("glm-5.2") || normalizedName.includes("glm5.2")) return GLM_5_2_CONTEXT_WINDOW;
|
|
128
175
|
if (normalizedName.includes("deepseek")) return 1e6;
|
|
176
|
+
if (GPT_6_1_SOL_PATTERN.test(normalizedName)) return GPT_6_1_SOL_CONTEXT_WINDOW;
|
|
129
177
|
if (normalizedName.includes("gpt-5") || normalizedName.includes("gpt-4.1")) return 1047576;
|
|
130
178
|
if (normalizedName.startsWith("cursor-grok-4.5")) return 1e6;
|
|
131
179
|
if (normalizedName.includes("claude-4.6")) return 1e6;
|
|
@@ -134,6 +182,22 @@ function fuzzyContextWindow(normalizedName) {
|
|
|
134
182
|
if (normalizedName.includes("qwen3.6") || normalizedName.includes("qwen3p6")) return QWEN_3_6_CONTEXT_WINDOW;
|
|
135
183
|
if (normalizedName.includes("qwen3.7") || normalizedName.includes("qwen3p7")) return 262144;
|
|
136
184
|
if (normalizedName.includes("minimax-m2") || normalizedName.includes("minimax_m2")) return 262144;
|
|
185
|
+
const bareModelName = (normalizedName.includes("/") ? normalizedName.slice(normalizedName.lastIndexOf("/") + 1) : normalizedName).replace(/:.*$/, "");
|
|
186
|
+
if (normalizedName.includes("mistral-large-4")) {
|
|
187
|
+
const rest = normalizedName.slice(
|
|
188
|
+
normalizedName.indexOf("mistral-large-4") + "mistral-large-4".length
|
|
189
|
+
);
|
|
190
|
+
if (rest === "" || /^[-:_@/\s]/.test(rest)) return 524288;
|
|
191
|
+
}
|
|
192
|
+
if (normalizedName.includes("mistral-vibe-cli") || normalizedName.includes("mistral-medium-3.5") || normalizedName.includes("mistral-medium-3-5") || normalizedName.includes("mistral-medium-latest") || normalizedName.includes("mistral-medium-2604") || normalizedName.includes("mistral-large-latest") || normalizedName.includes("mistral-large-2512") || normalizedName.includes("mistral-small-latest") || normalizedName.includes("mistral-small-2603") || normalizedName.includes("magistral-medium-latest") || normalizedName.includes("magistral-small-latest") || // 展示名(TUI 传 displayName 的路径;Mistral 不在 MODEL_LOOKUP_MAP,无法走精确表):
|
|
193
|
+
normalizedName.includes("mistral vibe cli") || normalizedName.includes("mistral medium 3.5") || normalizedName.includes("mistral large (latest)")) {
|
|
194
|
+
return 262144;
|
|
195
|
+
}
|
|
196
|
+
if (bareModelName === "mistral-medium" || bareModelName === "mistral-medium-3") return 262144;
|
|
197
|
+
if (normalizedName.includes("mistral-embed") || normalizedName.includes("codestral-embed")) return 8192;
|
|
198
|
+
if (normalizedName.includes("mistral-ocr")) return 16384;
|
|
199
|
+
if (normalizedName.includes("mistral-moderation")) return 131072;
|
|
200
|
+
if (normalizedName.includes("codestral") || normalizedName.includes("mistral-code")) return 256e3;
|
|
137
201
|
if (normalizedName.includes("claude")) return 2e5;
|
|
138
202
|
if (normalizedName.includes("llama3.1") || normalizedName.includes("llama-3.1") || normalizedName.includes("llama3.2") || normalizedName.includes("llama-3.2") || normalizedName.includes("llama3.3") || normalizedName.includes("llama-3.3") || normalizedName.includes("qwen2.5") || normalizedName.includes("qwen-2.5") || normalizedName.includes("mistral-nemo") || normalizedName.includes("phi3.5") || normalizedName.includes("phi-3.5") || normalizedName.includes("phi4") || normalizedName.includes("phi-4")) {
|
|
139
203
|
return 131072;
|
|
@@ -152,8 +216,9 @@ function fuzzyContextWindow(normalizedName) {
|
|
|
152
216
|
}
|
|
153
217
|
return void 0;
|
|
154
218
|
}
|
|
155
|
-
var getModelContextWindow = (modelName) => {
|
|
219
|
+
var getModelContextWindow = (modelName, provider) => {
|
|
156
220
|
if (!modelName) return DEFAULT_CONTEXT_WINDOW;
|
|
221
|
+
const onPlatformChannel = isPlatformManagedProvider(provider, modelName);
|
|
157
222
|
const normalizedName = modelName.toLowerCase();
|
|
158
223
|
const map = getFullModelMap();
|
|
159
224
|
const rawCandidates = [modelName, normalizedName];
|
|
@@ -182,9 +247,16 @@ var getModelContextWindow = (modelName) => {
|
|
|
182
247
|
for (const candidate of candidates) {
|
|
183
248
|
const model = map.get(candidate);
|
|
184
249
|
if (model?.contextWindow) {
|
|
250
|
+
if (!onPlatformChannel && isPlatformManagedProvider(model.provider, model.name) && channelPinnedContextWindow(model.name.toLowerCase()) !== void 0) {
|
|
251
|
+
continue;
|
|
252
|
+
}
|
|
185
253
|
return typeof model.contextWindow === "number" ? model.contextWindow : DEFAULT_CONTEXT_WINDOW;
|
|
186
254
|
}
|
|
187
255
|
}
|
|
256
|
+
if (!onPlatformChannel) {
|
|
257
|
+
const pinned = channelPinnedContextWindow(normalizedName);
|
|
258
|
+
if (pinned !== void 0) return pinned;
|
|
259
|
+
}
|
|
188
260
|
return fuzzyContextWindow(normalizedName) ?? DEFAULT_CONTEXT_WINDOW;
|
|
189
261
|
};
|
|
190
262
|
var getModelInfo = (modelName) => {
|
|
@@ -279,7 +351,7 @@ var normalizeUsage = (usage) => {
|
|
|
279
351
|
// packages/agent-runtime/emptyAssistantRepair.ts
|
|
280
352
|
var EMPTY_ASSISTANT_REPAIR_PROMPT = "\u8BF7\u7ED9\u51FA\u660E\u786E\u7684\u6587\u5B57\u56DE\u7B54\u6216\u6267\u884C\u4E0B\u4E00\u6B65\uFF1A\u5982\u679C\u4EFB\u52A1\u5DF2\u5B8C\u6210\uFF0C\u8BF7\u76F4\u63A5\u603B\u7ED3\u7ED3\u679C\uFF1B\u5982\u679C\u9700\u8981\u8C03\u7528\u5DE5\u5177\uFF0C\u53EA\u80FD\u8C03\u7528\u672C\u6B21\u8BF7\u6C42\u4E2D\u5DF2\u58F0\u660E\u7684\u5DE5\u5177\u2014\u2014\u4F60\u60F3\u7528\u7684\u5DE5\u5177\u4E0D\u5728\u58F0\u660E\u5217\u8868\u4E2D\u65F6\uFF0C\u4E0D\u8981\u5C1D\u8BD5\u8C03\u7528\u5B83\uFF0C\u76F4\u63A5\u7528\u6587\u5B57\u8BF4\u660E\u8BE5\u80FD\u529B\u5F53\u524D\u4E0D\u53EF\u7528\u3002\u8BF7\u5207\u52FF\u8FD4\u56DE\u7A7A\u5185\u5BB9\u3002";
|
|
281
353
|
var EMPTY_ASSISTANT_FALLBACK_MESSAGE = "\u6A21\u578B\u8FDE\u7EED\u8FD4\u56DE\u7A7A\u6D88\u606F\uFF0C\u5F53\u524D\u4EFB\u52A1\u672A\u5B8C\u6210\u3002\u8BF7\u91CD\u8BD5\u5F53\u524D\u6B65\u9AA4\uFF0C\u6216\u7ED9\u51FA\u66F4\u5177\u4F53\u7684\u4FEE\u6539\u8303\u56F4\u3002";
|
|
282
|
-
var LENGTH_TRUNCATED_FALLBACK_MESSAGE = "\u8F93\u51FA\u8FBE\u5230\u957F\u5EA6\u4E0A\u9650\u88AB\u622A\u65AD\uFF0C\u5EFA\u8BAE\u7F29\u77ED\u4EFB\u52A1\u6216\u63D0\u9AD8\u8F93\u51FA\u4E0A\u9650\u3002";
|
|
354
|
+
var LENGTH_TRUNCATED_FALLBACK_MESSAGE = "\u8F93\u51FA\u8FBE\u5230\u957F\u5EA6\u4E0A\u9650\u88AB\u622A\u65AD\uFF0C\u6216\u4E0A\u4E0B\u6587\u5DF2\u8D85\u51FA\u6A21\u578B\u7A97\u53E3\u3002\u5EFA\u8BAE\u7F29\u77ED\u4EFB\u52A1\u3001\u538B\u7F29\u6216\u65B0\u5F00\u5BF9\u8BDD\uFF0C\u6216\u63D0\u9AD8\u8F93\u51FA\u4E0A\u9650\u3002";
|
|
283
355
|
var STREAM_TRUNCATED_FALLBACK_MESSAGE = "\u4E0A\u6E38\u54CD\u5E94\u6D41\u5728\u6536\u5C3E\u524D\u88AB\u4E2D\u65AD\uFF08\u672A\u6536\u5230\u7ED3\u675F\u6807\u8BB0\uFF09\uFF0C\u672C\u8F6E\u8F93\u51FA\u4E0D\u5B8C\u6574\u3002\u8BF7\u91CD\u8BD5\u5F53\u524D\u6B65\u9AA4\u3002";
|
|
284
356
|
var REPETITION_LOOP_FALLBACK_MESSAGE = "\u68C0\u6D4B\u5230\u6A21\u578B\u9677\u5165\u91CD\u590D\u8F93\u51FA\u6B7B\u5FAA\u73AF\uFF0C\u5DF2\u81EA\u52A8\u7194\u65AD\u7EC8\u6B62\u5F53\u524D\u4EFB\u52A1\u3002";
|
|
285
357
|
var STAGNANT_TOOL_CALLS_FALLBACK_MESSAGE = "\u68C0\u6D4B\u5230\u8FDE\u7EED\u591A\u6B21\u76F8\u540C\u5DE5\u5177\u8C03\u7528\u4E14\u65E0\u5B9E\u8D28\u8FDB\u5C55\uFF0C\u5DF2\u81EA\u52A8\u7194\u65AD\u7EC8\u6B62\u5F53\u524D\u4EFB\u52A1\u3002";
|
|
@@ -346,44 +418,9 @@ function resolveTruncatedReasoningTailLog(reason, reasoning_content) {
|
|
|
346
418
|
return null;
|
|
347
419
|
}
|
|
348
420
|
|
|
349
|
-
// packages/agent-runtime/autoExecutionProfiles.ts
|
|
350
|
-
var createProfile = (input) => ({
|
|
351
|
-
id: input.id,
|
|
352
|
-
tier: input.tier,
|
|
353
|
-
legacyAgentKey: input.legacyAgentKey,
|
|
354
|
-
key: input.legacyAgentKey,
|
|
355
|
-
name: input.name,
|
|
356
|
-
provider: "nolo",
|
|
357
|
-
model: input.model,
|
|
358
|
-
apiSource: "platform",
|
|
359
|
-
useServerProxy: true,
|
|
360
|
-
rawRecord: {
|
|
361
|
-
dbKey: input.legacyAgentKey,
|
|
362
|
-
isPublic: true,
|
|
363
|
-
provider: "nolo",
|
|
364
|
-
model: input.model,
|
|
365
|
-
apiSource: "platform",
|
|
366
|
-
useServerProxy: true
|
|
367
|
-
}
|
|
368
|
-
});
|
|
369
|
-
var FLASH_PROFILE = createProfile({
|
|
370
|
-
id: "builtin:auto:nolo",
|
|
371
|
-
tier: "flash",
|
|
372
|
-
legacyAgentKey: BUILTIN_NOLO_AGENT_KEY,
|
|
373
|
-
name: "nolo",
|
|
374
|
-
model: "deepseek-flash"
|
|
375
|
-
});
|
|
376
|
-
var AUTO_EXECUTION_PROFILES = {
|
|
377
|
-
flash: FLASH_PROFILE,
|
|
378
|
-
balanced: { ...FLASH_PROFILE, tier: "balanced" },
|
|
379
|
-
quality: { ...FLASH_PROFILE, tier: "quality" },
|
|
380
|
-
image: { ...FLASH_PROFILE, tier: "image" }
|
|
381
|
-
};
|
|
382
|
-
var DEFAULT_AUTO_EXECUTION_TIER = "flash";
|
|
383
|
-
var DEFAULT_AUTO_EXECUTION_PROFILE = AUTO_EXECUTION_PROFILES[DEFAULT_AUTO_EXECUTION_TIER];
|
|
384
|
-
var resolveAutoExecutionProfile = (tier) => AUTO_EXECUTION_PROFILES[tier ?? DEFAULT_AUTO_EXECUTION_TIER] ?? DEFAULT_AUTO_EXECUTION_PROFILE;
|
|
385
|
-
|
|
386
421
|
export {
|
|
422
|
+
DEFAULT_AUTO_EXECUTION_PROFILE,
|
|
423
|
+
resolveAutoExecutionProfile,
|
|
387
424
|
readCacheReadInputTokens,
|
|
388
425
|
readCacheCreationInputTokens,
|
|
389
426
|
DEFAULT_CONTEXT_WINDOW,
|
|
@@ -399,7 +436,5 @@ export {
|
|
|
399
436
|
resolveEmptyAssistantOutcome,
|
|
400
437
|
resolveEmptyAssistantFallbackMessage,
|
|
401
438
|
hasAssistantVisibleOutput,
|
|
402
|
-
resolveTruncatedReasoningTailLog
|
|
403
|
-
DEFAULT_AUTO_EXECUTION_PROFILE,
|
|
404
|
-
resolveAutoExecutionProfile
|
|
439
|
+
resolveTruncatedReasoningTailLog
|
|
405
440
|
};
|
|
@@ -1,6 +1,3 @@
|
|
|
1
|
-
import {
|
|
2
|
-
BUILTIN_PLATFORM_AGENT_KEYS
|
|
3
|
-
} from "./chunk-BNGW5ASC.js";
|
|
4
1
|
import {
|
|
5
2
|
getRuntimeServerContext,
|
|
6
3
|
partitionReadServers,
|
|
@@ -10,17 +7,20 @@ import {
|
|
|
10
7
|
scheduleExistingRecordReplication,
|
|
11
8
|
shouldReplaceLocalWithRemoteRecord,
|
|
12
9
|
shouldReplicateLocalRecord
|
|
13
|
-
} from "./chunk-
|
|
10
|
+
} from "./chunk-O7SVKKLY.js";
|
|
11
|
+
import {
|
|
12
|
+
shouldReplaceWithNextRecord
|
|
13
|
+
} from "./chunk-D2MDMY2M.js";
|
|
14
|
+
import {
|
|
15
|
+
BUILTIN_PLATFORM_AGENT_KEYS
|
|
16
|
+
} from "./chunk-I2RGRVQ7.js";
|
|
14
17
|
import {
|
|
15
18
|
fetchFromClientDb,
|
|
16
19
|
fetchFromServer,
|
|
17
20
|
isAbortError,
|
|
18
21
|
isReadTimeoutError,
|
|
19
22
|
logger
|
|
20
|
-
} from "./chunk-
|
|
21
|
-
import {
|
|
22
|
-
shouldReplaceWithNextRecord
|
|
23
|
-
} from "./chunk-GBRG75BQ.js";
|
|
23
|
+
} from "./chunk-HIM3FCLF.js";
|
|
24
24
|
import {
|
|
25
25
|
NOLO_CLUSTER_SERVERS,
|
|
26
26
|
normalizeKnownServerOrigin
|
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
import {
|
|
2
2
|
getRuntimeServerContext,
|
|
3
3
|
scheduleDeleteReplication
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-O7SVKKLY.js";
|
|
5
|
+
import {
|
|
6
|
+
buildTombstoneRecord
|
|
7
|
+
} from "./chunk-D2MDMY2M.js";
|
|
5
8
|
import {
|
|
6
9
|
fetchFromClientDb
|
|
7
|
-
} from "./chunk-
|
|
10
|
+
} from "./chunk-HIM3FCLF.js";
|
|
8
11
|
import {
|
|
9
12
|
selectIdentityToken
|
|
10
13
|
} from "./chunk-SEJ5OS6F.js";
|
|
11
|
-
import {
|
|
12
|
-
buildTombstoneRecord
|
|
13
|
-
} from "./chunk-GBRG75BQ.js";
|
|
14
14
|
|
|
15
15
|
// packages/database/fileStorage.ts
|
|
16
16
|
var DB_NAME = "nolo-file-storage";
|
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
import {
|
|
2
|
-
selectCurrentServer
|
|
3
|
-
} from "./chunk-GP5LKBUZ.js";
|
|
4
1
|
import {
|
|
5
2
|
patch
|
|
6
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-WPHY3VPF.js";
|
|
4
|
+
import {
|
|
5
|
+
selectCurrentServer
|
|
6
|
+
} from "./chunk-NWENLDMM.js";
|
|
7
7
|
import {
|
|
8
8
|
getIsDesktopApp
|
|
9
|
-
} from "./chunk-
|
|
9
|
+
} from "./chunk-HIM3FCLF.js";
|
|
10
10
|
import {
|
|
11
11
|
selectIdentityToken
|
|
12
12
|
} from "./chunk-SEJ5OS6F.js";
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import {
|
|
2
|
-
|
|
3
|
-
} from "./chunk-
|
|
2
|
+
readSseFrames
|
|
3
|
+
} from "./chunk-GMZLP5DV.js";
|
|
4
4
|
import {
|
|
5
5
|
accumulateToolCallDelta,
|
|
6
6
|
createThinkParserState,
|
|
@@ -21,11 +21,19 @@ import {
|
|
|
21
21
|
extractToolCallsFromResponseOutput,
|
|
22
22
|
getUsageRequestOptions,
|
|
23
23
|
hasImageParts,
|
|
24
|
+
sanitizeForOutbound,
|
|
24
25
|
shouldStripReasoningContentForOutbound,
|
|
25
26
|
stablePromptCacheKey,
|
|
26
27
|
toOpenAiCompatibleMessages,
|
|
27
28
|
toResponsesTools
|
|
28
|
-
} from "./chunk-
|
|
29
|
+
} from "./chunk-UM7TA3K4.js";
|
|
30
|
+
import {
|
|
31
|
+
isMeaningfulChatCompletionOutput,
|
|
32
|
+
isMeaningfulResponsesOutput
|
|
33
|
+
} from "./chunk-R6EBQEQE.js";
|
|
34
|
+
import {
|
|
35
|
+
clipCompactText
|
|
36
|
+
} from "./chunk-5MMAK75Q.js";
|
|
29
37
|
import {
|
|
30
38
|
buildProviderExecutionPlan,
|
|
31
39
|
canUsePlatformChatProvider,
|
|
@@ -35,16 +43,11 @@ import {
|
|
|
35
43
|
resolvePlatformAuthToken,
|
|
36
44
|
resolvePlatformServerUrl,
|
|
37
45
|
resolveProviderTransportDecision
|
|
38
|
-
} from "./chunk-
|
|
39
|
-
import {
|
|
40
|
-
clipCompactText,
|
|
41
|
-
isMeaningfulChatCompletionOutput,
|
|
42
|
-
isMeaningfulResponsesOutput
|
|
43
|
-
} from "./chunk-P5EVSOPA.js";
|
|
46
|
+
} from "./chunk-BIPGGSJS.js";
|
|
44
47
|
import {
|
|
45
48
|
NOLO_CLIENT_VERSION_HEADER,
|
|
46
49
|
isPlatformMimoProviderModel
|
|
47
|
-
} from "./chunk-
|
|
50
|
+
} from "./chunk-SZC4REES.js";
|
|
48
51
|
import {
|
|
49
52
|
isRecord
|
|
50
53
|
} from "./chunk-KUG52IAP.js";
|
|
@@ -213,18 +216,58 @@ function createResponsesToolAccumulator() {
|
|
|
213
216
|
function keyOf(event) {
|
|
214
217
|
return typeof event?.item_id === "string" && event.item_id ? event.item_id : typeof event?.item?.id === "string" && event.item.id ? event.item.id : typeof event?.item?.call_id === "string" && event.item.call_id ? event.item.call_id : typeof event?.call_id === "string" && event.call_id ? event.call_id : "";
|
|
215
218
|
}
|
|
219
|
+
function shortFingerprint(value) {
|
|
220
|
+
let hash = 2166136261;
|
|
221
|
+
for (let i = 0; i < value.length; i++) {
|
|
222
|
+
hash ^= value.charCodeAt(i);
|
|
223
|
+
hash = Math.imul(hash, 16777619);
|
|
224
|
+
}
|
|
225
|
+
return (hash >>> 0).toString(16).padStart(8, "0");
|
|
226
|
+
}
|
|
227
|
+
function parsesAsJsonObject(value) {
|
|
228
|
+
try {
|
|
229
|
+
const parsed = JSON.parse(value);
|
|
230
|
+
return parsed !== null && typeof parsed === "object";
|
|
231
|
+
} catch {
|
|
232
|
+
return false;
|
|
233
|
+
}
|
|
234
|
+
}
|
|
216
235
|
function applyResponsesToolEvent(calls, event) {
|
|
217
236
|
const key = keyOf(event);
|
|
218
237
|
if (!key) return;
|
|
219
238
|
const item = event?.item;
|
|
220
239
|
const id = item?.call_id || item?.id || event?.call_id || key;
|
|
221
|
-
const current = calls.get(key) ?? { id, name: "", arguments: "" };
|
|
240
|
+
const current = calls.get(key) ?? { id, name: "", arguments: "", sawDelta: false };
|
|
222
241
|
if (typeof item?.name === "string" && item.name) current.name = item.name;
|
|
242
|
+
const applySnapshot = (next) => {
|
|
243
|
+
if (!current.sawDelta) {
|
|
244
|
+
current.arguments = next;
|
|
245
|
+
return;
|
|
246
|
+
}
|
|
247
|
+
if (next.startsWith(current.arguments)) {
|
|
248
|
+
current.arguments = next;
|
|
249
|
+
} else if (current.arguments.startsWith(next)) {
|
|
250
|
+
} else {
|
|
251
|
+
if (!parsesAsJsonObject(current.arguments) && parsesAsJsonObject(next)) {
|
|
252
|
+
console.warn(
|
|
253
|
+
`[responses-tool-call] adopting parsable snapshot over unparsable accumulation (accumulated length=${current.arguments.length}, fingerprint=${shortFingerprint(current.arguments)}; snapshot length=${next.length}, fingerprint=${shortFingerprint(next)})`
|
|
254
|
+
);
|
|
255
|
+
current.arguments = next;
|
|
256
|
+
return;
|
|
257
|
+
}
|
|
258
|
+
console.warn(
|
|
259
|
+
`[responses-tool-call] conflicting arguments snapshot (accumulated length=${current.arguments.length}, fingerprint=${shortFingerprint(current.arguments)}; snapshot length=${next.length}, fingerprint=${shortFingerprint(next)})`
|
|
260
|
+
);
|
|
261
|
+
}
|
|
262
|
+
};
|
|
223
263
|
const itemArguments = normalizeResponsesToolArguments(item?.arguments);
|
|
224
|
-
if (itemArguments !== void 0)
|
|
264
|
+
if (itemArguments !== void 0) applySnapshot(itemArguments);
|
|
225
265
|
const eventArguments = normalizeResponsesToolArguments(event?.arguments);
|
|
226
|
-
if (eventArguments !== void 0)
|
|
227
|
-
if (typeof event?.delta === "string")
|
|
266
|
+
if (eventArguments !== void 0) applySnapshot(eventArguments);
|
|
267
|
+
if (typeof event?.delta === "string") {
|
|
268
|
+
current.sawDelta = true;
|
|
269
|
+
current.arguments += event.delta;
|
|
270
|
+
}
|
|
228
271
|
calls.set(key, current);
|
|
229
272
|
}
|
|
230
273
|
function addResponsesToolCall(calls, call) {
|
|
@@ -232,7 +275,8 @@ function addResponsesToolCall(calls, call) {
|
|
|
232
275
|
calls.set(key, {
|
|
233
276
|
id: call.id,
|
|
234
277
|
name: call.function.name,
|
|
235
|
-
arguments: call.function.arguments
|
|
278
|
+
arguments: call.function.arguments,
|
|
279
|
+
sawDelta: false
|
|
236
280
|
});
|
|
237
281
|
}
|
|
238
282
|
function finalizeResponsesToolCalls(calls) {
|
|
@@ -347,83 +391,6 @@ function flushChatCompletionStream(state) {
|
|
|
347
391
|
}
|
|
348
392
|
}
|
|
349
393
|
|
|
350
|
-
// packages/agent-runtime/sseFrames.ts
|
|
351
|
-
async function* readSseFrames(response) {
|
|
352
|
-
const reader = response.body?.getReader();
|
|
353
|
-
if (!reader) {
|
|
354
|
-
throw new Error("SSE response did not include a readable body.");
|
|
355
|
-
}
|
|
356
|
-
const decoder = new TextDecoder();
|
|
357
|
-
let buffer = "";
|
|
358
|
-
while (true) {
|
|
359
|
-
const { done, value } = await reader.read();
|
|
360
|
-
if (done) break;
|
|
361
|
-
buffer += decoder.decode(value, { stream: true });
|
|
362
|
-
let boundary = findSseFrameBoundary(buffer);
|
|
363
|
-
while (boundary) {
|
|
364
|
-
yield buffer.slice(0, boundary.index);
|
|
365
|
-
buffer = buffer.slice(boundary.index + boundary.separatorLength);
|
|
366
|
-
boundary = findSseFrameBoundary(buffer);
|
|
367
|
-
}
|
|
368
|
-
}
|
|
369
|
-
const remaining = decoder.decode();
|
|
370
|
-
if (remaining) {
|
|
371
|
-
buffer += remaining;
|
|
372
|
-
let boundary = findSseFrameBoundary(buffer);
|
|
373
|
-
while (boundary) {
|
|
374
|
-
yield buffer.slice(0, boundary.index);
|
|
375
|
-
buffer = buffer.slice(boundary.index + boundary.separatorLength);
|
|
376
|
-
boundary = findSseFrameBoundary(buffer);
|
|
377
|
-
}
|
|
378
|
-
}
|
|
379
|
-
if (buffer.trim()) yield buffer;
|
|
380
|
-
}
|
|
381
|
-
function findSseFrameBoundary(buffer) {
|
|
382
|
-
const lfLf = buffer.indexOf("\n\n");
|
|
383
|
-
const crLfCrLf = buffer.indexOf("\r\n\r\n");
|
|
384
|
-
if (lfLf === -1 && crLfCrLf === -1) return null;
|
|
385
|
-
const useLf = lfLf !== -1 && (crLfCrLf === -1 || lfLf < crLfCrLf);
|
|
386
|
-
return useLf ? { index: lfLf, separatorLength: 2 } : { index: crLfCrLf, separatorLength: 4 };
|
|
387
|
-
}
|
|
388
|
-
async function* streamSseDataValues(response, parse) {
|
|
389
|
-
const reader = response.body?.getReader();
|
|
390
|
-
if (!reader) return;
|
|
391
|
-
const decoder = new TextDecoder();
|
|
392
|
-
let buffer = "";
|
|
393
|
-
while (true) {
|
|
394
|
-
const { done, value } = await reader.read();
|
|
395
|
-
if (done) break;
|
|
396
|
-
buffer += decoder.decode(value, { stream: true });
|
|
397
|
-
const lines = buffer.split("\n");
|
|
398
|
-
buffer = lines.pop() ?? "";
|
|
399
|
-
for (const line of lines) {
|
|
400
|
-
const parsed = parse(line);
|
|
401
|
-
if (parsed) yield parsed;
|
|
402
|
-
}
|
|
403
|
-
}
|
|
404
|
-
const remaining = decoder.decode();
|
|
405
|
-
if (remaining) {
|
|
406
|
-
buffer += remaining;
|
|
407
|
-
const lines = buffer.split("\n");
|
|
408
|
-
buffer = lines.pop() ?? "";
|
|
409
|
-
for (const line of lines) {
|
|
410
|
-
const parsed = parse(line);
|
|
411
|
-
if (parsed) yield parsed;
|
|
412
|
-
}
|
|
413
|
-
}
|
|
414
|
-
if (buffer.trim()) {
|
|
415
|
-
const parsed = parse(buffer);
|
|
416
|
-
if (parsed) yield parsed;
|
|
417
|
-
}
|
|
418
|
-
}
|
|
419
|
-
async function readSseDataValues(response, parse) {
|
|
420
|
-
const values = [];
|
|
421
|
-
for await (const value of streamSseDataValues(response, parse)) {
|
|
422
|
-
values.push(value);
|
|
423
|
-
}
|
|
424
|
-
return values;
|
|
425
|
-
}
|
|
426
|
-
|
|
427
394
|
// packages/agent-runtime/platformChatProvider.ts
|
|
428
395
|
var PlatformStreamInterruptedError = class extends Error {
|
|
429
396
|
code = "PLATFORM_STREAM_INTERRUPTED";
|
|
@@ -535,6 +502,12 @@ async function resolvePlatformChatProviderConfig(args) {
|
|
|
535
502
|
};
|
|
536
503
|
}
|
|
537
504
|
function buildPlatformChatCompletionRequest(args) {
|
|
505
|
+
if (!args.providerConfig.authToken?.trim()) {
|
|
506
|
+
throw Object.assign(
|
|
507
|
+
new Error("desktop platform provider failed: AUTH_NO_TOKEN"),
|
|
508
|
+
{ code: "AUTH_NO_TOKEN", authCode: "AUTH_NO_TOKEN", stage: "provider" }
|
|
509
|
+
);
|
|
510
|
+
}
|
|
538
511
|
const usesResponsesApi = isResponsesEndpoint(args.providerConfig.endpoint);
|
|
539
512
|
const requestOptions = usesResponsesApi ? toResponsesRequestOptions(args.providerConfig.requestOptions) : args.providerConfig.requestOptions;
|
|
540
513
|
const shouldStripReasoning = shouldStripReasoningContentForOutbound(
|
|
@@ -926,9 +899,6 @@ export {
|
|
|
926
899
|
applyChatCompletionDelta,
|
|
927
900
|
flushChatCompletionStream,
|
|
928
901
|
providerHttpFailure,
|
|
929
|
-
readSseFrames,
|
|
930
|
-
streamSseDataValues,
|
|
931
|
-
readSseDataValues,
|
|
932
902
|
createResponsesToolAccumulator,
|
|
933
903
|
applyResponsesToolEvent,
|
|
934
904
|
finalizeResponsesToolCalls,
|
|
@@ -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-TU6OBC76.js");
|
|
18
18
|
return getAuthorityBackedDb(options);
|
|
19
19
|
}
|
|
20
20
|
|