nolo-cli 0.106.0-alpha.1 → 0.106.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-C5ZUOC7O.js → _executeModel-EP6HAX3W.js} +77 -69
- package/action-GVA5ARSJ.js +20 -0
- package/{addContentAction-O7R66HEX.js → addContentAction-NZZNAVCB.js} +13 -12
- package/{addDialogAgentAction-74OA7KYP.js → addDialogAgentAction-5HVGEIXI.js} +19 -20
- package/{agentDeleteCommand-YB3S2LPY.js → agentDeleteCommand-M25A6UGB.js} +118 -43
- package/{agentEmailCommands-YBCBTG6X.js → agentEmailCommands-RUL4NL64.js} +99 -89
- package/agentListCommands-KSPFKHFO.js +741 -0
- package/{agentMachineCommands-QHYLBTVW.js → agentMachineCommands-IHBB6PHD.js} +48 -44
- package/{agentProviderCommands-GNPTL5XR.js → agentProviderCommands-ND4S2Q6Q.js} +97 -2
- package/{agentPullCommand-O5MPVJ5E.js → agentPullCommand-B4T2DJ5H.js} +1 -1
- package/agentRecordCommands-7OKIBN6H.js +138 -0
- package/agentRunCommand-GBKJTQQU.js +167 -0
- package/{agentRunControl-AVJR4JW4.js → agentRunControl-3HWA2LLQ.js} +2 -2
- package/{agentRuntimeLocal-FRUE5P2V.js → agentRuntimeLocal-E5HXZNXZ.js} +44 -40
- package/{agentSlice-7OEXULAY.js → agentSlice-7T3ZLYET.js} +15 -14
- package/{appDeleteCommands-JPWTSFID.js → appDeleteCommands-TTJUYTQN.js} +46 -42
- package/{appDeployCommands-YCVY2UYO.js → appDeployCommands-65WYK2TQ.js} +46 -42
- package/{appDeployStatusCommands-JMCEIKTI.js → appDeployStatusCommands-U4XESYYG.js} +46 -42
- package/{appGetCommands-EXWT3QAE.js → appGetCommands-VNHZZC4D.js} +46 -42
- package/{appListCommands-PKRLSWRE.js → appListCommands-O667ZEU6.js} +46 -42
- package/{authCommand-F4EFRRX6.js → authCommand-SUHHTVHA.js} +118 -24
- package/{authCommands-RGOGCPP6.js → authCommands-5RTUDYZW.js} +7 -5
- package/{builtinSkillRegistry-FUAVTRVZ.js → builtinSkillRegistry-PUGT65WS.js} +11 -9
- package/{chromeCommands-FZYAU75D.js → chromeCommands-AU5ZJXBG.js} +289 -37
- package/{chromeOpsCommands-62P2Q2YB.js → chromeOpsCommands-ZYTCMNHG.js} +156 -22
- package/{chunk-ZNV445LB.js → chunk-2NGKYC3L.js} +29 -9
- package/{chunk-JEDZAO7L.js → chunk-2SYTUTLI.js} +257 -37
- package/{chunk-HVURBGF3.js → chunk-2U3NHADM.js} +6 -6
- package/{chunk-XA2FJW4L.js → chunk-3SXZ6SUC.js} +11 -9
- package/{chunk-UKZDAFYT.js → chunk-3VKDWQMJ.js} +6 -10
- package/chunk-4LCOCOR5.js +50 -0
- package/{chunk-JPGCXHNM.js → chunk-4LKMZ3RR.js} +1 -1
- package/{chunk-PQFHGD77.js → chunk-4VDS344D.js} +161 -14
- 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-GQBOR3G6.js → chunk-5F7UKMLN.js} +8 -4
- package/{chunk-E4MARS3Q.js → chunk-5GVBDNTO.js} +1 -1
- 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-YCJN2RA3.js → chunk-6AIURTE7.js} +20 -11
- package/{chunk-VLTIYV3X.js → chunk-7I25CBT5.js} +34 -8
- package/chunk-AGIM7IMJ.js +147 -0
- package/{chunk-S4VLC46A.js → chunk-AM4G3LDJ.js} +66 -54
- package/{chunk-5UTFL4QJ.js → chunk-AOTBKDRK.js} +7 -0
- package/{chunk-TJGWNDGO.js → chunk-AZB6HR4I.js} +846 -276
- package/{chunk-L5UXH3B2.js → chunk-BIH7KCDJ.js} +58 -9
- package/{chunk-UZGQNTVW.js → chunk-BPLIXNC6.js} +8 -6
- package/chunk-CEQ75WPL.js +915 -0
- package/chunk-CHOZJMJS.js +78 -0
- package/{chunk-GBRG75BQ.js → chunk-D2MDMY2M.js} +1 -0
- package/{chunk-GPCZ7UXG.js → chunk-DBKRC5O2.js} +1 -1
- package/chunk-DJ3JABG5.js +7990 -0
- package/{chunk-Q554LLSI.js → chunk-DMXLXZKL.js} +1 -1
- package/{chunk-UOBDA2JS.js → chunk-DSXRVBTA.js} +118 -90
- package/{chunk-3VNWWVKB.js → chunk-E3YWHWCR.js} +50 -18
- package/{chunk-HJUYAD4A.js → chunk-EBS4FKW4.js} +5 -5
- package/{chunk-LC43IGO4.js → chunk-EHGIEGLI.js} +834 -962
- package/{chunk-ABQYVJBJ.js → chunk-EV235ILT.js} +5 -5
- package/{chunk-TRV2MIDW.js → chunk-EXAJ6DCR.js} +1 -0
- package/{chunk-TOP2VXOR.js → chunk-FJKZSR5P.js} +5 -5
- package/{chunk-2F7RJC6L.js → chunk-FOXQ7BAB.js} +1 -1
- package/{chunk-SH43IESU.js → chunk-GGC55Q32.js} +199 -29
- package/{chunk-ZCYXJSTU.js → chunk-GMP3NBAA.js} +65 -95
- package/chunk-GMZLP5DV.js +82 -0
- package/{chunk-OIVSQH2O.js → chunk-GU7DC2TD.js} +300 -5
- 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-RJXZDT2P.js → chunk-HNA5KV37.js} +23 -28
- package/{chunk-ONXOABJR.js → chunk-HNGRBWYF.js} +3 -0
- package/{chunk-ACTMNVHM.js → chunk-I5YMDACN.js} +1 -1
- package/{chunk-O6OSWFZQ.js → chunk-IHPDK6UD.js} +6 -0
- package/{chunk-QDSINZM3.js → chunk-IXH3HKY2.js} +1 -22
- package/{chunk-Q67DOFOO.js → chunk-IYIXAIEB.js} +199 -92
- package/{chunk-BP4XNZRM.js → chunk-JIXGJTBU.js} +4 -4
- package/{chunk-OEVAY4J6.js → chunk-JWNBEIME.js} +18 -20
- package/{chunk-Z77CRGTW.js → chunk-KA5O5KQL.js} +1 -1
- package/{chunk-JZL6EHZR.js → chunk-LGWABBTZ.js} +47 -67
- package/{chunk-LS2ZANRJ.js → chunk-LOCNXNOU.js} +1 -1
- package/{chunk-GEPUP7OO.js → chunk-LOPP5VT6.js} +3 -3
- package/{chunk-DHDMC6FO.js → chunk-LUBFABMJ.js} +15 -14
- package/chunk-LWLNLZC5.js +265 -0
- package/{chunk-BNGW5ASC.js → chunk-LYLO5U3H.js} +15 -2
- package/{chunk-4OEFYTWL.js → chunk-MJ3CRU77.js} +85 -50
- package/{chunk-BFU6C242.js → chunk-NMFV26UG.js} +1 -1
- package/{chunk-NA35QHCF.js → chunk-NTNKA5VL.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-FM2YTE6D.js → chunk-OAXBDMT7.js} +1 -1
- package/chunk-OCZKATRC.js +129 -0
- package/{chunk-EYAQT56M.js → chunk-ODTBO4W6.js} +9 -6
- package/{chunk-VMFTFOWF.js → chunk-OKGVNZTL.js} +35 -8
- package/{chunk-EEGDMATE.js → chunk-OQ5IVGCV.js} +86 -81
- package/{chunk-KQHGZWSV.js → chunk-OXME3PEE.js} +1 -1
- package/{chunk-KQ4ONNQD.js → chunk-OYTWDOQV.js} +155 -8
- package/{chunk-JRQFUXY7.js → chunk-OZ2IIIRP.js} +99 -22
- package/{chunk-WV42OMV7.js → chunk-PFLF4R4E.js} +8 -8
- package/{chunk-J4MOO56S.js → chunk-QDH32WF5.js} +10 -2
- package/{chunk-3DII57IT.js → chunk-QVAWUJAJ.js} +1 -1
- package/{chunk-3BMYXEUW.js → chunk-R5AJODNI.js} +1 -1
- package/{chunk-6OZ36FXI.js → chunk-SJ7CUF65.js} +22 -4
- package/{chunk-IIVGDG4I.js → chunk-SJKULPGX.js} +13 -7
- package/{chunk-ETI2NYVF.js → chunk-SYEBIZOF.js} +4 -4
- package/{chunk-J3WULTWA.js → chunk-TLKXNTQJ.js} +19 -17
- package/chunk-TLYSGGPG.js +15 -0
- 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-VBQGO5NX.js +164 -0
- package/chunk-VIWDGTDA.js +8 -0
- package/chunk-VJVNU77E.js +83 -0
- package/{chunk-UKWGR5SS.js → chunk-VY6VFGKR.js} +194 -1144
- package/chunk-VYKXIHRP.js +13692 -0
- package/chunk-VZLO4XJD.js +17 -0
- package/{chunk-DNCEALKX.js → chunk-WMWYWYK2.js} +22 -29
- package/{chunk-H56FOERC.js → chunk-XDQ7PHU3.js} +567 -684
- package/{chunk-AEOE4Z6Q.js → chunk-XGOHDYM2.js} +39 -15
- package/{chunk-53HEEOTT.js → chunk-XLWMNFBZ.js} +83 -16
- package/{chunk-V4MJDUSR.js → chunk-YFU5EELM.js} +2 -2
- package/{chunk-IUTWFZOX.js → chunk-YQFLBS6A.js} +68 -46
- package/chunk-YV25TM3R.js +780 -0
- package/chunk-ZRAU6T47.js +56 -0
- package/{chunk-5H7KJX7J.js → chunk-ZVGXD7UJ.js} +5 -5
- package/{chunk-H62HCIUP.js → chunk-ZYM73IHG.js} +36 -22
- package/commandRegistry-6QIAUQDS.js +833 -0
- package/{contentThunks-AZVYDLM4.js → contentThunks-5DDMUQ7B.js} +39 -36
- package/{cooldownCommands-REAWYVTY.js → cooldownCommands-ZLEPIB4A.js} +2 -2
- package/{createAgentAutomationAction-V55DNYCE.js → createAgentAutomationAction-NQ6AZM42.js} +40 -37
- package/createDialogAction-QZ6X4A7O.js +70 -0
- package/{createPageAction-I3HH23O3.js → createPageAction-NCGEJBVK.js} +47 -43
- package/{chunk-GDNQO3QR.js → cursorProvider-YGGNMVWX.js} +2751 -10172
- package/{dbSlice-XVWBAGYN.js → dbSlice-RCZ7NRAF.js} +12 -11
- package/{deleteFile-YG6QMJLU.js → deleteFile-KESP65GC.js} +7 -6
- package/{dialogCommands-YVMHDEOX.js → dialogCommands-OGQLEF63.js} +49 -46
- package/{dialogSlice-LVJ67QWE.js → dialogSlice-GIKNUHNW.js} +57 -37
- package/{dist-VODFSGNG.js → dist-NJC2W7I4.js} +61 -54
- package/{docCreateCommands-7UTWDYJU.js → docCreateCommands-RW6LNYT6.js} +48 -44
- package/{docDeleteCommands-GG6BJ4PS.js → docDeleteCommands-Z742TRNY.js} +49 -45
- package/{docReadCommands-QHMQVSLP.js → docReadCommands-5DIGA42Y.js} +47 -43
- package/{docStore-UJNL6SBT.js → docStore-6GUOZH52.js} +17 -13
- package/{docUpdateCommands-QPL6IVUK.js → docUpdateCommands-ZFZ2QEVK.js} +48 -44
- package/{fetchMessages-EIU7UFFK.js → fetchMessages-3PXAHKCR.js} +5 -5
- package/{getPricing-LUSEABA6.js → getPricing-QVSNUFZ6.js} +4 -4
- package/{handleSendMessageAction-CCL7ETCL.js → handleSendMessageAction-B2VXOLMM.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-2QNINBNI.js → machineCommands-AI3N7JHQ.js} +93 -83
- package/machineWsRunDispatch-RPF2D6VV.js +154 -0
- package/{memberThunks-QGFLFVCI.js → memberThunks-YICJI4IS.js} +20 -18
- package/{models-T3SG6MJ5.js → models-FTNFVO3D.js} +2 -2
- package/oauthTokenStore-ITEB663N.js +23 -0
- package/package.json +1 -1
- package/pdf-U6KSUEZZ.js +26435 -0
- package/processSpawn-SOAV3FEV.js +11 -0
- package/profileConfig-ZGOFORWV.js +43 -0
- package/{providerPresetApply-FG6NZ57W.js → providerPresetApply-OJJXQ7NM.js} +7 -7
- package/{providerRegistry-757OWH3O.js → providerRegistry-DXFBDCGQ.js} +11 -7
- package/{read-COE3ZYR6.js → read-XMBM52Y4.js} +8 -7
- package/{readDocTool-5USN4A6V.js → readDocTool-LAQHKCVT.js} +5 -3
- package/{readlineWorkspace-4GULS23D.js → readlineWorkspace-EPUCVZ73.js} +2594 -2030
- package/{removeDialogAgentAction-IX3MN2ZO.js → removeDialogAgentAction-HDUI2MU3.js} +22 -26
- package/{runAgentClientLoop-MUMLW2SA.js → runAgentClientLoop-OXQMDGAN.js} +78 -71
- package/{runtimeDoctorCommands-X6WDBEQX.js → runtimeDoctorCommands-PIVSBZRZ.js} +4 -4
- package/runtimeModeArgs-2Y7BALTO.js +31 -0
- package/{setDialogExtraReferencesAction-X4HCPNZL.js → setDialogExtraReferencesAction-ADBVOP4O.js} +16 -14
- package/{setPrimaryDialogAgentAction-4GMIQLOD.js → setPrimaryDialogAgentAction-PXVXQJ62.js} +23 -27
- package/{chunk-AFUORTY4.js → settingThunks-G2MJRKUE.js} +226 -940
- package/{skillDiscovery-CYUCJMAG.js → skillDiscovery-ZBU76COE.js} +3 -3
- package/{slateUtils-RIZES3PV.js → slateUtils-NGV2NMKM.js} +1 -1
- package/{spaceCommands-BMXKR7H6.js → spaceCommands-Z662QYY6.js} +51 -47
- package/{streamAgentChatTurn-6EOS5PNG.js → streamAgentChatTurn-YJYEJHP7.js} +214 -114
- package/{switchDialogAgentAction-N52LRPA3.js → switchDialogAgentAction-Z3RZACGF.js} +19 -20
- package/{tableCommands-O6NWHFKV.js → tableCommands-6U4BMLRR.js} +10 -10
- package/{toolApiClient-QVJ6HDNN.js → toolApiClient-AD7CXTA4.js} +4 -3
- package/tools-GHI3WBEI.js +117 -0
- package/{tuiSummaryLlmCaller-WFRWERGK.js → tuiSummaryLlmCaller-WTC6GCQC.js} +25 -23
- package/{updateCommands-2M74UL7P.js → updateCommands-4EHDLF5J.js} +3 -3
- package/{updateDialogTitleAction-4YUVCBDU.js → updateDialogTitleAction-GJCNWTPY.js} +84 -45
- package/action-YVYQEAAV.js +0 -31
- package/agentListCommands-3GWH4E4G.js +0 -410
- package/agentRecordCommands-P76DPWKV.js +0 -128
- package/agentRunCommand-EQPL4F4K.js +0 -156
- package/browser-image-compression-MFDTD7K6.js +0 -1763
- package/chatQueueReduxAdapter-ZBDDI2E5.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-WC6UUQ2C.js +0 -20923
- package/chunk-Y5GCAMGP.js +0 -9
- package/chunk-YPREESF4.js +0 -225
- package/createDialogAction-H6URYLIZ.js +0 -65
- package/machineWsRunDispatch-S3XXOKR7.js +0 -144
- package/settingSlice-ZQZVUPKK.js +0 -204
- package/syncMapping-N6RGXGBW.js +0 -437
- package/tools-4AJZHAK3.js +0 -110
- package/{chunk-X7HHHIOZ.js → chunk-Y6ROFCZO.js} +0 -0
- package/{db-WK5MDZVN.js → db-VQSAOWAO.js} +1 -1
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
// packages/agent-runtime/sseFrames.ts
|
|
2
|
+
async function* readSseFrames(response) {
|
|
3
|
+
const reader = response.body?.getReader();
|
|
4
|
+
if (!reader) {
|
|
5
|
+
throw new Error("SSE response did not include a readable body.");
|
|
6
|
+
}
|
|
7
|
+
const decoder = new TextDecoder();
|
|
8
|
+
let buffer = "";
|
|
9
|
+
while (true) {
|
|
10
|
+
const { done, value } = await reader.read();
|
|
11
|
+
if (done) break;
|
|
12
|
+
buffer += decoder.decode(value, { stream: true });
|
|
13
|
+
let boundary = findSseFrameBoundary(buffer);
|
|
14
|
+
while (boundary) {
|
|
15
|
+
yield buffer.slice(0, boundary.index);
|
|
16
|
+
buffer = buffer.slice(boundary.index + boundary.separatorLength);
|
|
17
|
+
boundary = findSseFrameBoundary(buffer);
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
const remaining = decoder.decode();
|
|
21
|
+
if (remaining) {
|
|
22
|
+
buffer += remaining;
|
|
23
|
+
let boundary = findSseFrameBoundary(buffer);
|
|
24
|
+
while (boundary) {
|
|
25
|
+
yield buffer.slice(0, boundary.index);
|
|
26
|
+
buffer = buffer.slice(boundary.index + boundary.separatorLength);
|
|
27
|
+
boundary = findSseFrameBoundary(buffer);
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
if (buffer.trim()) yield buffer;
|
|
31
|
+
}
|
|
32
|
+
function findSseFrameBoundary(buffer) {
|
|
33
|
+
const lfLf = buffer.indexOf("\n\n");
|
|
34
|
+
const crLfCrLf = buffer.indexOf("\r\n\r\n");
|
|
35
|
+
if (lfLf === -1 && crLfCrLf === -1) return null;
|
|
36
|
+
const useLf = lfLf !== -1 && (crLfCrLf === -1 || lfLf < crLfCrLf);
|
|
37
|
+
return useLf ? { index: lfLf, separatorLength: 2 } : { index: crLfCrLf, separatorLength: 4 };
|
|
38
|
+
}
|
|
39
|
+
async function* streamSseDataValues(response, parse) {
|
|
40
|
+
const reader = response.body?.getReader();
|
|
41
|
+
if (!reader) return;
|
|
42
|
+
const decoder = new TextDecoder();
|
|
43
|
+
let buffer = "";
|
|
44
|
+
while (true) {
|
|
45
|
+
const { done, value } = await reader.read();
|
|
46
|
+
if (done) break;
|
|
47
|
+
buffer += decoder.decode(value, { stream: true });
|
|
48
|
+
const lines = buffer.split("\n");
|
|
49
|
+
buffer = lines.pop() ?? "";
|
|
50
|
+
for (const line of lines) {
|
|
51
|
+
const parsed = parse(line);
|
|
52
|
+
if (parsed) yield parsed;
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
const remaining = decoder.decode();
|
|
56
|
+
if (remaining) {
|
|
57
|
+
buffer += remaining;
|
|
58
|
+
const lines = buffer.split("\n");
|
|
59
|
+
buffer = lines.pop() ?? "";
|
|
60
|
+
for (const line of lines) {
|
|
61
|
+
const parsed = parse(line);
|
|
62
|
+
if (parsed) yield parsed;
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
if (buffer.trim()) {
|
|
66
|
+
const parsed = parse(buffer);
|
|
67
|
+
if (parsed) yield parsed;
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
async function readSseDataValues(response, parse) {
|
|
71
|
+
const values = [];
|
|
72
|
+
for await (const value of streamSseDataValues(response, parse)) {
|
|
73
|
+
values.push(value);
|
|
74
|
+
}
|
|
75
|
+
return values;
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
export {
|
|
79
|
+
readSseFrames,
|
|
80
|
+
streamSseDataValues,
|
|
81
|
+
readSseDataValues
|
|
82
|
+
};
|
|
@@ -9,7 +9,7 @@ import {
|
|
|
9
9
|
platformHostedModels,
|
|
10
10
|
toCnyCredits,
|
|
11
11
|
zaiModels
|
|
12
|
-
} from "./chunk-
|
|
12
|
+
} from "./chunk-IYIXAIEB.js";
|
|
13
13
|
|
|
14
14
|
// packages/integrations/qwen/models.ts
|
|
15
15
|
var qwenModels = [
|
|
@@ -1188,8 +1188,18 @@ function pipe(...pipe$1) {
|
|
|
1188
1188
|
|
|
1189
1189
|
// packages/ai/agent/createAgentSchema.ts
|
|
1190
1190
|
var DEFAULT_REASONING_EFFORT = "medium";
|
|
1191
|
+
var REASONING_EFFORT_OPTIONS = [
|
|
1192
|
+
"none",
|
|
1193
|
+
"minimal",
|
|
1194
|
+
"low",
|
|
1195
|
+
"medium",
|
|
1196
|
+
"high",
|
|
1197
|
+
"xhigh",
|
|
1198
|
+
"max"
|
|
1199
|
+
];
|
|
1191
1200
|
var PROVIDER_REASONING_EFFORT_VALUES = {
|
|
1192
1201
|
openai: ["none", "minimal", "low", "medium", "high", "xhigh", "max"],
|
|
1202
|
+
openrouter: ["none", "minimal", "low", "medium", "high", "xhigh", "max"],
|
|
1193
1203
|
deepseek: ["low", "high", "max"],
|
|
1194
1204
|
// nolo (Ollama Cloud) 支持 DeepSeek/Kimi/GLM 等 thinking 模型,
|
|
1195
1205
|
// reasoning_effort 通过 OpenAI 兼容端点透传到 Ollama Cloud。
|
|
@@ -1310,7 +1320,12 @@ var oauthModel = ({ name, displayName, contextWindow, thinkingMode, maxOutputTok
|
|
|
1310
1320
|
price: { input: 0, output: 0 }
|
|
1311
1321
|
});
|
|
1312
1322
|
var anthropicOAuthModels = [
|
|
1313
|
-
// 5 代(1M + Adaptive thinking always-on;官方 max output 128k)
|
|
1323
|
+
// 5 代与 5.5 代(1M + Adaptive thinking always-on;官方 max output 128k)
|
|
1324
|
+
oauthModel({ name: "claude-opus-5-5", displayName: "Claude Opus 5.5", contextWindow: 1e6, thinkingMode: "adaptive", maxOutputTokens: 128e3 }),
|
|
1325
|
+
// Claude Sonnet 5.5(2026-09-28 发布):官方规格 1M + Adaptive thinking + max output 128k。
|
|
1326
|
+
// 注意该模型对非默认 temperature/top_p/top_k 直接 400——nolo 的 anthropicAdapter
|
|
1327
|
+
// 不传采样参数,不受影响。
|
|
1328
|
+
oauthModel({ name: "claude-sonnet-5-5", displayName: "Claude Sonnet 5.5", contextWindow: 1e6, thinkingMode: "adaptive", maxOutputTokens: 128e3 }),
|
|
1314
1329
|
oauthModel({ name: "claude-fable-5", displayName: "Claude Fable 5", contextWindow: 1e6, thinkingMode: "adaptive", maxOutputTokens: 128e3 }),
|
|
1315
1330
|
oauthModel({ name: "claude-opus-5", displayName: "Claude Opus 5", contextWindow: 1e6, thinkingMode: "adaptive", maxOutputTokens: 128e3 }),
|
|
1316
1331
|
oauthModel({ name: "claude-sonnet-5", displayName: "Claude Sonnet 5", contextWindow: 1e6, thinkingMode: "adaptive", maxOutputTokens: 128e3 }),
|
|
@@ -1325,6 +1340,11 @@ var anthropicOAuthModels = [
|
|
|
1325
1340
|
// haiku-4-5(官方明确 context=200k + Extended thinking)
|
|
1326
1341
|
oauthModel({ name: "claude-haiku-4-5-20251001", displayName: "Claude Haiku 4.5", contextWindow: 2e5, thinkingMode: "extended" })
|
|
1327
1342
|
];
|
|
1343
|
+
function anthropicOAuthModelMaxOutputTokens(model) {
|
|
1344
|
+
if (!model) return void 0;
|
|
1345
|
+
const found = anthropicOAuthModels.find((m) => m.name === model);
|
|
1346
|
+
return typeof found?.maxOutputTokens === "number" ? found.maxOutputTokens : void 0;
|
|
1347
|
+
}
|
|
1328
1348
|
var OAUTH_MODEL_THINKING_MODE = new Map(
|
|
1329
1349
|
anthropicOAuthModels.map((m) => [m.name, m.thinkingMode])
|
|
1330
1350
|
);
|
|
@@ -1758,6 +1778,259 @@ var fireworksModels = [
|
|
|
1758
1778
|
}
|
|
1759
1779
|
];
|
|
1760
1780
|
|
|
1781
|
+
// packages/ai/agent/openrouterModelCapability.ts
|
|
1782
|
+
var VALID_EFFORTS_SET = new Set(REASONING_EFFORT_OPTIONS);
|
|
1783
|
+
function extractOpenRouterReasoningCapability(rawModel) {
|
|
1784
|
+
if (!rawModel) {
|
|
1785
|
+
return {
|
|
1786
|
+
found: false,
|
|
1787
|
+
supportsReasoning: false,
|
|
1788
|
+
supportedEfforts: []
|
|
1789
|
+
};
|
|
1790
|
+
}
|
|
1791
|
+
const supportedParams = rawModel.supported_parameters ?? [];
|
|
1792
|
+
const reasoning = rawModel.reasoning;
|
|
1793
|
+
const hasReasoningSupport = Boolean(reasoning) || supportedParams.includes("reasoning") || supportedParams.includes("reasoning_effort") || supportedParams.includes("include_reasoning");
|
|
1794
|
+
if (!hasReasoningSupport) {
|
|
1795
|
+
return {
|
|
1796
|
+
found: true,
|
|
1797
|
+
supportsReasoning: false,
|
|
1798
|
+
supportedEfforts: []
|
|
1799
|
+
};
|
|
1800
|
+
}
|
|
1801
|
+
const rawEfforts = reasoning?.supported_efforts ?? [];
|
|
1802
|
+
const supportedEfforts = rawEfforts.filter(
|
|
1803
|
+
(e) => VALID_EFFORTS_SET.has(e)
|
|
1804
|
+
);
|
|
1805
|
+
let defaultEffort;
|
|
1806
|
+
if (reasoning?.default_effort && VALID_EFFORTS_SET.has(reasoning.default_effort) && supportedEfforts.includes(reasoning.default_effort)) {
|
|
1807
|
+
defaultEffort = reasoning.default_effort;
|
|
1808
|
+
} else if (supportedEfforts.length > 0) {
|
|
1809
|
+
defaultEffort = supportedEfforts.includes("medium") ? "medium" : supportedEfforts[0];
|
|
1810
|
+
}
|
|
1811
|
+
return {
|
|
1812
|
+
found: true,
|
|
1813
|
+
supportsReasoning: true,
|
|
1814
|
+
mandatory: reasoning?.mandatory,
|
|
1815
|
+
supportedEfforts,
|
|
1816
|
+
defaultEffort
|
|
1817
|
+
};
|
|
1818
|
+
}
|
|
1819
|
+
var cachedModels = null;
|
|
1820
|
+
var CACHE_TTL_MS = 10 * 60 * 1e3;
|
|
1821
|
+
function getCachedOpenRouterModelReasoning(modelId) {
|
|
1822
|
+
const trimmed = modelId.trim().toLowerCase();
|
|
1823
|
+
if (!trimmed) return null;
|
|
1824
|
+
if (!cachedModels || Date.now() - cachedModels.timestamp >= CACHE_TTL_MS) {
|
|
1825
|
+
return null;
|
|
1826
|
+
}
|
|
1827
|
+
const rawModel = cachedModels.data.get(trimmed);
|
|
1828
|
+
if (!rawModel) return null;
|
|
1829
|
+
return extractOpenRouterReasoningCapability(rawModel);
|
|
1830
|
+
}
|
|
1831
|
+
|
|
1832
|
+
// packages/ai/agent/modelReasoningCapability.ts
|
|
1833
|
+
var GATEWAY_PROVIDERS = /* @__PURE__ */ new Set(["openrouter", "nolo"]);
|
|
1834
|
+
var THINKING_MECHANISM_PROVIDERS = /* @__PURE__ */ new Set(["anthropic", "google"]);
|
|
1835
|
+
var MODEL_REASONING_OVERRIDES = [
|
|
1836
|
+
// ---- OpenAI ----
|
|
1837
|
+
{
|
|
1838
|
+
providers: ["openai"],
|
|
1839
|
+
prefix: "gpt-5",
|
|
1840
|
+
includes: "-pro",
|
|
1841
|
+
efforts: ["high"],
|
|
1842
|
+
note: "gpt-5-pro \u7CFB\u5217\u53EA\u66B4\u9732 high \u6863\uFF08OpenAI \u6587\u6863\uFF1Apro \u53D8\u4F53\u4E0D\u53EF\u8C03\u4F4E\uFF09"
|
|
1843
|
+
},
|
|
1844
|
+
{
|
|
1845
|
+
providers: ["openai"],
|
|
1846
|
+
prefix: "o1-preview",
|
|
1847
|
+
supportsReasoning: false,
|
|
1848
|
+
note: "o1-preview \u4E0D\u63A5\u53D7 reasoning_effort \u53C2\u6570"
|
|
1849
|
+
},
|
|
1850
|
+
{
|
|
1851
|
+
providers: ["openai"],
|
|
1852
|
+
prefix: "o1-mini",
|
|
1853
|
+
supportsReasoning: false,
|
|
1854
|
+
note: "o1-mini \u4E0D\u63A5\u53D7 reasoning_effort \u53C2\u6570"
|
|
1855
|
+
},
|
|
1856
|
+
{
|
|
1857
|
+
providers: ["openai"],
|
|
1858
|
+
prefix: "o1",
|
|
1859
|
+
efforts: ["low", "medium", "high"],
|
|
1860
|
+
note: "o1 \u652F\u6301 low/medium/high\uFF0C\u65E0 none/minimal/xhigh/max"
|
|
1861
|
+
},
|
|
1862
|
+
{
|
|
1863
|
+
providers: ["openai"],
|
|
1864
|
+
prefix: "o3",
|
|
1865
|
+
efforts: ["low", "medium", "high"],
|
|
1866
|
+
note: "o3 / o3-mini \u652F\u6301 low/medium/high"
|
|
1867
|
+
},
|
|
1868
|
+
{
|
|
1869
|
+
providers: ["openai"],
|
|
1870
|
+
prefix: "o4-mini",
|
|
1871
|
+
efforts: ["low", "medium", "high"],
|
|
1872
|
+
note: "o4-mini \u652F\u6301 low/medium/high"
|
|
1873
|
+
},
|
|
1874
|
+
{
|
|
1875
|
+
providers: ["openai"],
|
|
1876
|
+
prefix: "gpt-4o",
|
|
1877
|
+
supportsReasoning: false,
|
|
1878
|
+
note: "gpt-4o \u7CFB\u5217\u975E\u63A8\u7406\u6A21\u578B"
|
|
1879
|
+
},
|
|
1880
|
+
{
|
|
1881
|
+
providers: ["openai"],
|
|
1882
|
+
prefix: "gpt-4.1",
|
|
1883
|
+
supportsReasoning: false,
|
|
1884
|
+
note: "gpt-4.1 \u7CFB\u5217\u975E\u63A8\u7406\u6A21\u578B"
|
|
1885
|
+
},
|
|
1886
|
+
{
|
|
1887
|
+
providers: ["openai"],
|
|
1888
|
+
prefix: "chatgpt-4o",
|
|
1889
|
+
supportsReasoning: false,
|
|
1890
|
+
note: "chatgpt-4o \u975E\u63A8\u7406\u6A21\u578B"
|
|
1891
|
+
},
|
|
1892
|
+
// ---- xAI / Grok ----
|
|
1893
|
+
{
|
|
1894
|
+
providers: ["xai", "grok"],
|
|
1895
|
+
prefix: "grok-3-mini",
|
|
1896
|
+
efforts: ["low", "high"],
|
|
1897
|
+
note: "grok-3-mini \u4EC5 low/high\uFF0C\u65E0 medium\uFF08xAI \u6587\u6863\uFF09"
|
|
1898
|
+
},
|
|
1899
|
+
{
|
|
1900
|
+
providers: ["xai", "grok"],
|
|
1901
|
+
prefix: "grok-3",
|
|
1902
|
+
exact: true,
|
|
1903
|
+
// 只匹配 grok-3 本体;grok-3-fast 等变体不被误伤
|
|
1904
|
+
supportsReasoning: false,
|
|
1905
|
+
note: "grok-3\uFF08\u975E mini\uFF09\u4E0D\u652F\u6301 reasoning_effort"
|
|
1906
|
+
},
|
|
1907
|
+
{
|
|
1908
|
+
providers: ["xai", "grok"],
|
|
1909
|
+
prefix: "grok-2",
|
|
1910
|
+
supportsReasoning: false,
|
|
1911
|
+
note: "grok-2 \u7CFB\u5217\u975E\u63A8\u7406\u6A21\u578B"
|
|
1912
|
+
},
|
|
1913
|
+
// ---- DeepSeek ----
|
|
1914
|
+
{
|
|
1915
|
+
providers: ["deepseek"],
|
|
1916
|
+
prefix: "deepseek-chat",
|
|
1917
|
+
exact: true,
|
|
1918
|
+
// 只匹配 deepseek-chat 本体;deepseek-chat-v3.1 是混合推理模型
|
|
1919
|
+
supportsReasoning: false,
|
|
1920
|
+
note: "deepseek-chat\uFF08V3 \u975E\u63A8\u7406\u7EBF\uFF09\u65E0\u63A8\u7406\u5F3A\u5EA6"
|
|
1921
|
+
},
|
|
1922
|
+
// ---- Kimi / Moonshot ----
|
|
1923
|
+
{
|
|
1924
|
+
providers: ["kimi", "moonshot"],
|
|
1925
|
+
prefix: "moonshot-v1",
|
|
1926
|
+
supportsReasoning: false,
|
|
1927
|
+
note: "moonshot-v1 \u7CFB\u5217\u975E\u63A8\u7406\u6A21\u578B"
|
|
1928
|
+
},
|
|
1929
|
+
{
|
|
1930
|
+
providers: ["kimi", "moonshot"],
|
|
1931
|
+
prefix: "kimi-k2-instruct",
|
|
1932
|
+
supportsReasoning: false,
|
|
1933
|
+
note: "kimi-k2-instruct \u975E thinking \u53D8\u4F53"
|
|
1934
|
+
},
|
|
1935
|
+
{
|
|
1936
|
+
providers: ["kimi", "moonshot"],
|
|
1937
|
+
prefix: "kimi-latest",
|
|
1938
|
+
supportsReasoning: false,
|
|
1939
|
+
note: "kimi-latest \u6307\u5411\u975E\u63A8\u7406\u5FEB\u7167"
|
|
1940
|
+
}
|
|
1941
|
+
];
|
|
1942
|
+
function modelBasename(model) {
|
|
1943
|
+
const idx = model.lastIndexOf("/");
|
|
1944
|
+
return idx === -1 ? model : model.slice(idx + 1);
|
|
1945
|
+
}
|
|
1946
|
+
function matchOverride(provider, model) {
|
|
1947
|
+
const m = model.toLowerCase();
|
|
1948
|
+
const base = modelBasename(m);
|
|
1949
|
+
const isGateway = GATEWAY_PROVIDERS.has(provider);
|
|
1950
|
+
let best = null;
|
|
1951
|
+
let bestPrefixLen = -1;
|
|
1952
|
+
for (const o of MODEL_REASONING_OVERRIDES) {
|
|
1953
|
+
if (!isGateway && !o.providers.includes(provider)) continue;
|
|
1954
|
+
const hit = o.exact ? m === o.prefix || base === o.prefix : m.startsWith(o.prefix) || base.startsWith(o.prefix);
|
|
1955
|
+
if (!hit) continue;
|
|
1956
|
+
if (o.includes && !m.includes(o.includes) && !base.includes(o.includes)) {
|
|
1957
|
+
continue;
|
|
1958
|
+
}
|
|
1959
|
+
if (o.prefix.length > bestPrefixLen) {
|
|
1960
|
+
best = o;
|
|
1961
|
+
bestPrefixLen = o.prefix.length;
|
|
1962
|
+
}
|
|
1963
|
+
}
|
|
1964
|
+
return best;
|
|
1965
|
+
}
|
|
1966
|
+
function capabilityFromOpenRouterLive(live) {
|
|
1967
|
+
return {
|
|
1968
|
+
found: true,
|
|
1969
|
+
supportsReasoning: live.supportsReasoning,
|
|
1970
|
+
efforts: live.supportedEfforts,
|
|
1971
|
+
defaultEffort: live.defaultEffort,
|
|
1972
|
+
mandatory: live.mandatory,
|
|
1973
|
+
source: "openrouter-live"
|
|
1974
|
+
};
|
|
1975
|
+
}
|
|
1976
|
+
function resolveModelReasoningCapability(provider, model) {
|
|
1977
|
+
const p = (provider ?? "").toLowerCase();
|
|
1978
|
+
const m = (model ?? "").trim();
|
|
1979
|
+
if (THINKING_MECHANISM_PROVIDERS.has(p)) {
|
|
1980
|
+
return {
|
|
1981
|
+
found: false,
|
|
1982
|
+
supportsReasoning: true,
|
|
1983
|
+
// 有推理能力,只是走 Thinking 机制而非 effort
|
|
1984
|
+
efforts: [],
|
|
1985
|
+
source: "provider-map"
|
|
1986
|
+
};
|
|
1987
|
+
}
|
|
1988
|
+
if (m) {
|
|
1989
|
+
const override = matchOverride(p, m);
|
|
1990
|
+
if (override) {
|
|
1991
|
+
const supportsReasoning = override.supportsReasoning ?? true;
|
|
1992
|
+
const efforts = supportsReasoning === false ? [] : override.efforts ?? PROVIDER_REASONING_EFFORT_VALUES[p] ?? [
|
|
1993
|
+
"low",
|
|
1994
|
+
"medium",
|
|
1995
|
+
"high"
|
|
1996
|
+
];
|
|
1997
|
+
return {
|
|
1998
|
+
found: true,
|
|
1999
|
+
supportsReasoning,
|
|
2000
|
+
efforts,
|
|
2001
|
+
defaultEffort: efforts.includes("medium") ? "medium" : efforts[0],
|
|
2002
|
+
source: "model-override"
|
|
2003
|
+
};
|
|
2004
|
+
}
|
|
2005
|
+
}
|
|
2006
|
+
const providerEfforts = PROVIDER_REASONING_EFFORT_VALUES[p];
|
|
2007
|
+
if (providerEfforts) {
|
|
2008
|
+
return {
|
|
2009
|
+
found: false,
|
|
2010
|
+
supportsReasoning: providerEfforts.length > 0,
|
|
2011
|
+
efforts: providerEfforts,
|
|
2012
|
+
source: "provider-map"
|
|
2013
|
+
};
|
|
2014
|
+
}
|
|
2015
|
+
return {
|
|
2016
|
+
found: false,
|
|
2017
|
+
supportsReasoning: true,
|
|
2018
|
+
efforts: ["low", "medium", "high"],
|
|
2019
|
+
source: "provider-fallback"
|
|
2020
|
+
};
|
|
2021
|
+
}
|
|
2022
|
+
function resolveModelReasoningCapabilityWithCache(provider, model) {
|
|
2023
|
+
const p = (provider ?? "").toLowerCase();
|
|
2024
|
+
const m = (model ?? "").trim();
|
|
2025
|
+
if (p === "openrouter" && m) {
|
|
2026
|
+
const live = getCachedOpenRouterModelReasoning(m);
|
|
2027
|
+
if (live?.found) {
|
|
2028
|
+
return capabilityFromOpenRouterLive(live);
|
|
2029
|
+
}
|
|
2030
|
+
}
|
|
2031
|
+
return resolveModelReasoningCapability(provider, model);
|
|
2032
|
+
}
|
|
2033
|
+
|
|
1761
2034
|
// packages/ai/llm/reasoningModels.ts
|
|
1762
2035
|
var REASONING_MODEL_NAMES = /* @__PURE__ */ new Set([
|
|
1763
2036
|
"deepseek-flash",
|
|
@@ -1772,6 +2045,8 @@ var REASONING_MODEL_NAMES = /* @__PURE__ */ new Set([
|
|
|
1772
2045
|
"gemini-3.1-pro-preview",
|
|
1773
2046
|
"gpt-5.5-pro",
|
|
1774
2047
|
"gpt-6-astra",
|
|
2048
|
+
"gpt-6.1-sol",
|
|
2049
|
+
"gpt-6-sol",
|
|
1775
2050
|
"gpt-6-luna",
|
|
1776
2051
|
"gpt-5.6-sol",
|
|
1777
2052
|
"gpt-5.6-terra",
|
|
@@ -1792,7 +2067,12 @@ var REASONING_MODEL_NAMES = /* @__PURE__ */ new Set([
|
|
|
1792
2067
|
"accounts/fireworks/models/glm-5p2",
|
|
1793
2068
|
"zai-org/GLM-5.2-FP8"
|
|
1794
2069
|
]);
|
|
1795
|
-
var isModelSupportReasoningEffort = (model) =>
|
|
2070
|
+
var isModelSupportReasoningEffort = (model, provider) => {
|
|
2071
|
+
if (provider && provider.toLowerCase() === "openrouter") {
|
|
2072
|
+
return true;
|
|
2073
|
+
}
|
|
2074
|
+
return REASONING_MODEL_NAMES.has(model);
|
|
2075
|
+
};
|
|
1796
2076
|
var supportedReasoningModels = Array.from(REASONING_MODEL_NAMES);
|
|
1797
2077
|
var EFFORT_ORDER = [
|
|
1798
2078
|
"none",
|
|
@@ -1819,13 +2099,23 @@ function nearestSupportedEffort(effort, supported) {
|
|
|
1819
2099
|
}
|
|
1820
2100
|
return EFFORT_ORDER[best];
|
|
1821
2101
|
}
|
|
1822
|
-
function clampReasoningEffort(effort, provider) {
|
|
2102
|
+
function clampReasoningEffort(effort, provider, model) {
|
|
1823
2103
|
if (!effort) return void 0;
|
|
1824
2104
|
const normalized = effort === "off" ? "none" : effort;
|
|
1825
2105
|
const providerLower = (provider ?? "").toLowerCase();
|
|
1826
|
-
if (providerLower
|
|
2106
|
+
if (THINKING_MECHANISM_PROVIDERS.has(providerLower)) {
|
|
1827
2107
|
return void 0;
|
|
1828
2108
|
}
|
|
2109
|
+
if (model) {
|
|
2110
|
+
const cap = resolveModelReasoningCapabilityWithCache(provider, model);
|
|
2111
|
+
if (cap.found) {
|
|
2112
|
+
if (!cap.supportsReasoning || cap.efforts.length === 0) {
|
|
2113
|
+
return void 0;
|
|
2114
|
+
}
|
|
2115
|
+
if (cap.efforts.includes(normalized)) return normalized;
|
|
2116
|
+
return nearestSupportedEffort(normalized, cap.efforts);
|
|
2117
|
+
}
|
|
2118
|
+
}
|
|
1829
2119
|
const supported = PROVIDER_REASONING_EFFORT_VALUES[providerLower];
|
|
1830
2120
|
if (!supported || supported.length === 0) {
|
|
1831
2121
|
if (normalized === "low" || normalized === "medium" || normalized === "high") {
|
|
@@ -1883,6 +2173,9 @@ var MODEL_LOOKUP_MAP = {
|
|
|
1883
2173
|
...MODEL_MAP
|
|
1884
2174
|
};
|
|
1885
2175
|
var ANTHROPIC_MODEL_ALIASES = {
|
|
2176
|
+
"claude-opus-5.5": "claude-opus-5-5",
|
|
2177
|
+
"claude-sonnet-5.5": "claude-sonnet-5-5",
|
|
2178
|
+
"claude-haiku-5.5": "claude-haiku-5-5",
|
|
1886
2179
|
"claude-sonnet-4.6": "claude-3-7-sonnet-latest",
|
|
1887
2180
|
"claude-sonnet-4.5": "claude-3-5-sonnet-latest"
|
|
1888
2181
|
};
|
|
@@ -2097,6 +2390,7 @@ function getApiEndpoint(agent) {
|
|
|
2097
2390
|
}
|
|
2098
2391
|
|
|
2099
2392
|
export {
|
|
2393
|
+
anthropicOAuthModelMaxOutputTokens,
|
|
2100
2394
|
isAdaptiveThinkingModelId,
|
|
2101
2395
|
qwenModels,
|
|
2102
2396
|
qwenTokenPlanModels,
|
|
@@ -2106,6 +2400,7 @@ export {
|
|
|
2106
2400
|
stepfunStepPlanModels,
|
|
2107
2401
|
opencodeGoModels,
|
|
2108
2402
|
DEFAULT_REASONING_EFFORT,
|
|
2403
|
+
resolveModelReasoningCapabilityWithCache,
|
|
2109
2404
|
isModelSupportReasoningEffort,
|
|
2110
2405
|
clampReasoningEffort,
|
|
2111
2406
|
MODEL_LOOKUP_MAP,
|
|
@@ -180,6 +180,36 @@ function resolveCooldownGate(input, now) {
|
|
|
180
180
|
}
|
|
181
181
|
return now - lastProbeAt >= PROBE_INTERVAL_MS ? "probe" : "blocked";
|
|
182
182
|
}
|
|
183
|
+
function resolveCredentialKey(agent) {
|
|
184
|
+
if (!agent || typeof agent !== "object") return void 0;
|
|
185
|
+
for (const field of ["apiKeyRef", "credentialRef"]) {
|
|
186
|
+
const value = agent[field];
|
|
187
|
+
if (typeof value === "string") {
|
|
188
|
+
const trimmed = value.trim();
|
|
189
|
+
if (trimmed) return trimmed;
|
|
190
|
+
}
|
|
191
|
+
}
|
|
192
|
+
return void 0;
|
|
193
|
+
}
|
|
194
|
+
function resolveCredentialKeyWithFallback(agent) {
|
|
195
|
+
const byRef = resolveCredentialKey(agent);
|
|
196
|
+
if (byRef) return byRef;
|
|
197
|
+
if (!agent || typeof agent !== "object") return void 0;
|
|
198
|
+
const endpoint = agent.customProviderUrl;
|
|
199
|
+
if (typeof endpoint === "string") {
|
|
200
|
+
const trimmed = endpoint.trim();
|
|
201
|
+
if (trimmed) {
|
|
202
|
+
try {
|
|
203
|
+
const origin = new URL(trimmed).origin;
|
|
204
|
+
if (origin && origin !== "null") return `custom-endpoint:${origin}`;
|
|
205
|
+
} catch {
|
|
206
|
+
}
|
|
207
|
+
}
|
|
208
|
+
}
|
|
209
|
+
const key = agent.key;
|
|
210
|
+
if (typeof key === "string" && key.trim()) return `custom-agent:${key.trim()}`;
|
|
211
|
+
return void 0;
|
|
212
|
+
}
|
|
183
213
|
|
|
184
214
|
export {
|
|
185
215
|
QUOTA_ERROR_PATTERNS,
|
|
@@ -188,5 +218,6 @@ export {
|
|
|
188
218
|
isQuotaLimited403Body,
|
|
189
219
|
resolveAvailabilityAction,
|
|
190
220
|
mergeAvailabilityDeadline,
|
|
191
|
-
resolveCooldownGate
|
|
221
|
+
resolveCooldownGate,
|
|
222
|
+
resolveCredentialKeyWithFallback
|
|
192
223
|
};
|
|
@@ -1,28 +1,35 @@
|
|
|
1
1
|
import {
|
|
2
2
|
addContentToSpace
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-LGWABBTZ.js";
|
|
4
4
|
import {
|
|
5
|
+
format,
|
|
5
6
|
prepareAndPersistMessage,
|
|
6
7
|
uiAskChoiceFunc,
|
|
7
8
|
uiAskChoiceFunctionSchema
|
|
8
|
-
} from "./chunk-
|
|
9
|
+
} from "./chunk-VYKXIHRP.js";
|
|
9
10
|
import {
|
|
10
|
-
|
|
11
|
-
} from "./chunk-
|
|
11
|
+
formatISO
|
|
12
|
+
} from "./chunk-ZRAU6T47.js";
|
|
12
13
|
import {
|
|
13
14
|
buildBuiltinObjectSkillReference
|
|
14
|
-
} from "./chunk-
|
|
15
|
-
import {
|
|
16
|
-
PLATFORM_HOSTED_DEEPSEEK_FLASH_MODEL,
|
|
17
|
-
PLATFORM_HOSTED_KIMI_PROVIDER
|
|
18
|
-
} from "./chunk-Q67DOFOO.js";
|
|
15
|
+
} from "./chunk-LUBFABMJ.js";
|
|
19
16
|
import {
|
|
20
17
|
read,
|
|
21
18
|
readAndWait,
|
|
22
19
|
removeCachedEntity,
|
|
23
20
|
upsertSSREntity,
|
|
24
21
|
write
|
|
25
|
-
} from "./chunk-
|
|
22
|
+
} from "./chunk-ZYM73IHG.js";
|
|
23
|
+
import {
|
|
24
|
+
PLATFORM_HOSTED_DEEPSEEK_FLASH_MODEL,
|
|
25
|
+
PLATFORM_HOSTED_KIMI_PROVIDER
|
|
26
|
+
} from "./chunk-IYIXAIEB.js";
|
|
27
|
+
import {
|
|
28
|
+
extractCustomId
|
|
29
|
+
} from "./chunk-M2EJHDJP.js";
|
|
30
|
+
import {
|
|
31
|
+
isRecord
|
|
32
|
+
} from "./chunk-KUG52IAP.js";
|
|
26
33
|
import {
|
|
27
34
|
createAgentKey,
|
|
28
35
|
createDialogKey,
|
|
@@ -30,34 +37,22 @@ import {
|
|
|
30
37
|
dialogMessageRange,
|
|
31
38
|
memoryOwnerRange,
|
|
32
39
|
memorySubjectKindRange
|
|
33
|
-
} from "./chunk-
|
|
34
|
-
import {
|
|
35
|
-
extractCustomId
|
|
36
|
-
} from "./chunk-M2EJHDJP.js";
|
|
40
|
+
} from "./chunk-OKGVNZTL.js";
|
|
37
41
|
import {
|
|
38
42
|
isDevelopment
|
|
39
|
-
} from "./chunk-
|
|
43
|
+
} from "./chunk-HIM3FCLF.js";
|
|
40
44
|
import {
|
|
41
45
|
selectIdentityUserId
|
|
42
46
|
} from "./chunk-SEJ5OS6F.js";
|
|
43
47
|
import {
|
|
44
|
-
|
|
45
|
-
} from "./chunk-
|
|
48
|
+
asOptionalPositiveFiniteNumber
|
|
49
|
+
} from "./chunk-U6VC4MU4.js";
|
|
46
50
|
import {
|
|
47
51
|
asTrimmedString
|
|
48
52
|
} from "./chunk-3EUW3WEO.js";
|
|
49
|
-
import {
|
|
50
|
-
asOptionalPositiveFiniteNumber
|
|
51
|
-
} from "./chunk-U6VC4MU4.js";
|
|
52
53
|
import {
|
|
53
54
|
asOptionalTrimmedString
|
|
54
55
|
} from "./chunk-G3SUCT4W.js";
|
|
55
|
-
import {
|
|
56
|
-
__toESM
|
|
57
|
-
} from "./chunk-4VNS5WPM.js";
|
|
58
|
-
|
|
59
|
-
// packages/chat/dialog/actions/createDialogAction.ts
|
|
60
|
-
var import_date_fns = __toESM(require_date_fns());
|
|
61
56
|
|
|
62
57
|
// packages/chat/dialog/objectAssistantRegistry.ts
|
|
63
58
|
var OBJECT_ASSISTANT_TO_SKILL = {
|
|
@@ -811,7 +806,7 @@ var createDialogAction = async (args, thunkApi) => {
|
|
|
811
806
|
preview: recentRelationshipRecapResolution.recap ?? null
|
|
812
807
|
});
|
|
813
808
|
}
|
|
814
|
-
const time =
|
|
809
|
+
const time = format(/* @__PURE__ */ new Date(), "MM-dd HH:mm");
|
|
815
810
|
const title = titleOverride || (agentMode === "auto" ? "\u65B0\u5BF9\u8BDD" : agentConfig?.name || "Agent") + " " + time;
|
|
816
811
|
const spaceId = explicitSpaceId;
|
|
817
812
|
const dialogPath = createDialogKey(userId);
|
|
@@ -853,7 +848,7 @@ var createDialogAction = async (args, thunkApi) => {
|
|
|
853
848
|
...agentMode === "auto" && autoRoute ? { autoRoute } : {},
|
|
854
849
|
title,
|
|
855
850
|
type: "dialog" /* DIALOG */,
|
|
856
|
-
createdAt:
|
|
851
|
+
createdAt: formatISO(/* @__PURE__ */ new Date()),
|
|
857
852
|
...spaceId && { spaceId },
|
|
858
853
|
category,
|
|
859
854
|
referenceKeys,
|
|
@@ -206,9 +206,12 @@ export {
|
|
|
206
206
|
resolveNoloStateDir,
|
|
207
207
|
getLegacyCredentialPath,
|
|
208
208
|
migrateLegacyCredentialFile,
|
|
209
|
+
DEFAULT_REFRESH_SKEW_MS,
|
|
209
210
|
getCredentialsDir,
|
|
211
|
+
getCredentialPath,
|
|
210
212
|
readOAuthCredential,
|
|
211
213
|
writeOAuthCredential,
|
|
214
|
+
removeOAuthCredential,
|
|
212
215
|
createOAuthTokenStore,
|
|
213
216
|
isTokenExpired,
|
|
214
217
|
resolveFreshAccessToken
|
|
@@ -1,5 +1,11 @@
|
|
|
1
|
+
import {
|
|
2
|
+
CHROME_CONNECTOR_LEGACY_TOOL_ALIASES
|
|
3
|
+
} from "./chunk-LWLNLZC5.js";
|
|
4
|
+
|
|
1
5
|
// packages/agent-runtime/toolNameAliases.ts
|
|
2
6
|
var LEGACY_TOOL_NAME_ALIASES = {
|
|
7
|
+
// Nolo Browser Connector: legacy chrome_* → canonical browser_*
|
|
8
|
+
...CHROME_CONNECTOR_LEGACY_TOOL_ALIASES,
|
|
3
9
|
createPage: "createDoc",
|
|
4
10
|
updatePage: "updateDoc",
|
|
5
11
|
update_page: "updateDoc",
|