nolo-cli 0.228.0 → 0.228.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/{_executeModel-GIFVXKDT.js → _executeModel-AKCTHGMP.js} +62 -61
- package/{action-WZTKEF5H.js → action-C6IQAKN4.js} +6 -6
- package/{addContentAction-MLI6GOBV.js → addContentAction-53364YDW.js} +10 -10
- package/{addDialogAgentAction-ARGQM22H.js → addDialogAgentAction-U5DD5EN5.js} +9 -9
- package/{agentDeleteCommand-UF7XVELS.js → agentDeleteCommand-2E5FAGUO.js} +99 -93
- package/{agentEmailCommands-SFHRPQYC.js → agentEmailCommands-UGZZAH7E.js} +99 -93
- package/{agentListCommands-IXKBP3W5.js → agentListCommands-JCTW3J2K.js} +240 -52
- package/{agentMachineCommands-7NX6PWQ6.js → agentMachineCommands-QPG5ZXF4.js} +45 -41
- package/{agentProviderCommands-C5T7C5KZ.js → agentProviderCommands-QLTABYR7.js} +2 -2
- package/{agentPullCommand-4EQZYHU4.js → agentPullCommand-2EYJ5ENC.js} +1 -1
- package/{agentRecordCommands-IUNX6XD6.js → agentRecordCommands-4NTVR6MZ.js} +98 -92
- package/{agentRunCommand-LCR4XADM.js → agentRunCommand-VHF34PYC.js} +103 -94
- package/{agentRunControl-RN2P6AOD.js → agentRunControl-QYTXUQGY.js} +10 -7
- package/{agentRuntimeLocal-LVXPQ7QA.js → agentRuntimeLocal-U54AKHXH.js} +38 -36
- package/{agentSlice-ZGMOH6TE.js → agentSlice-4JGDEXWK.js} +10 -10
- package/{appDeleteCommands-BESCJOQM.js → appDeleteCommands-XBE5QJ6P.js} +46 -42
- package/{appDeployCommands-LPTR6IOX.js → appDeployCommands-QIYLXXGA.js} +46 -42
- package/{appDeployStatusCommands-BZ7KZ5RD.js → appDeployStatusCommands-JXS6ZQZZ.js} +46 -42
- package/{appGetCommands-EDWGJV4S.js → appGetCommands-SZS7SJPK.js} +46 -42
- package/{appListCommands-OPRWYPM6.js → appListCommands-B3GBJSNV.js} +46 -42
- package/{authCommand-3C3RN4OU.js → authCommand-V6EOMZX6.js} +15 -15
- package/{authCommands-ZMVEDCQD.js → authCommands-T5FODCEG.js} +2 -2
- package/{builtinSkillRegistry-VRCMQ77Q.js → builtinSkillRegistry-ZQC3IIO2.js} +4 -3
- package/{chromeOpsCommands-NZITLHWO.js → chromeOpsCommands-OFX7ZGKP.js} +2 -2
- package/{chunk-MZVCFV3T.js → chunk-223KZUJ6.js} +4 -4
- package/{chunk-UF6J7NXV.js → chunk-2C5VN7NH.js} +1 -1
- package/{chunk-MAA42MMV.js → chunk-2FZVXOFX.js} +4 -4
- package/{chunk-ESN4WNWU.js → chunk-2JHGUL5K.js} +2 -2
- package/chunk-3A5NNQCN.js +64 -0
- package/chunk-3F2FRLIO.js +372 -0
- package/{chunk-V4IYI3SB.js → chunk-46FETNLF.js} +2 -2
- package/{chunk-RR3MB26M.js → chunk-4GYVS4PM.js} +8 -6
- package/{chunk-ZQ6K57FJ.js → chunk-4YPH5KRA.js} +1 -1
- package/{chunk-Y4NPF2UN.js → chunk-5AYP5QBB.js} +5 -5
- package/{chunk-4OXPN3WC.js → chunk-5ISNPTQH.js} +4 -4
- package/{chunk-CO6E7YK6.js → chunk-5P3PPQVP.js} +1 -1
- package/{chunk-6TVYUQRM.js → chunk-6BMTKYAO.js} +2 -2
- package/{chunk-KLAMJNKQ.js → chunk-6PAHSSD2.js} +15 -8
- package/{chunk-CTWCZKNS.js → chunk-6SOWMEAY.js} +4 -4
- package/{chunk-ARFCL53U.js → chunk-6VEO7Z3Y.js} +5 -5
- package/{chunk-ZM5AZTQG.js → chunk-7BIJFGKS.js} +20 -8
- package/{chunk-BAH3BAUZ.js → chunk-7OVOZRZF.js} +5 -5
- package/{chunk-N74XL3NI.js → chunk-7PON4LBY.js} +42 -24
- package/{chunk-LTVEOOZL.js → chunk-7WHCIA5V.js} +16 -3
- package/{chunk-HZDK56EK.js → chunk-ADYWV732.js} +34 -12
- package/{chunk-2FK2KZSL.js → chunk-AIFQKNPP.js} +1 -1
- package/{chunk-VTHWBTRE.js → chunk-BPB3T5EU.js} +5 -8
- package/{chunk-SX6AWTNK.js → chunk-BZLGPM5B.js} +3 -3
- package/{chunk-MTM4LRVG.js → chunk-BZMDWGQQ.js} +2 -2
- package/{chunk-JP2BH4NC.js → chunk-CEKRIR22.js} +1 -1
- package/{chunk-5HUO7SEX.js → chunk-D634SL2Y.js} +1 -1
- package/{chunk-SCMYAGQE.js → chunk-DHRPLRIR.js} +294 -159
- package/{chunk-VUHKG4KS.js → chunk-DNNPARJK.js} +9 -5
- package/{chunk-X22AUZKL.js → chunk-E3LSO6EI.js} +189 -88
- package/{chunk-LHCGKAFO.js → chunk-EHFBP6IK.js} +100 -48
- package/{chunk-6ASGEP5D.js → chunk-EJQE5HB7.js} +1 -1
- package/{chunk-2BKNICGK.js → chunk-EL5NRJHI.js} +1 -1
- package/chunk-EUGTFFO6.js +42 -0
- package/{chunk-YFW4H6DL.js → chunk-EVHTYVD2.js} +821 -131
- package/{chunk-6XRPBZRS.js → chunk-EYLGAEB4.js} +0 -134
- package/{chunk-E5RYFR7E.js → chunk-FEIVARWR.js} +49 -15
- package/{chunk-3DJJ4CFG.js → chunk-FLBJ7IJI.js} +9 -9
- package/{chunk-W3HSD32M.js → chunk-FXEPZKNJ.js} +2 -2
- package/{chunk-VKCPKCSS.js → chunk-FYAMUU55.js} +625 -62
- package/{chunk-JEWMQR6J.js → chunk-FZANZZ63.js} +1 -1
- package/{chunk-WWTSEBDF.js → chunk-GIXWVN2W.js} +1 -1
- package/{chunk-YHNUDTU4.js → chunk-HDKMVYNJ.js} +4 -4
- package/chunk-HEVRQGGH.js +106 -0
- package/{chunk-PBPXXMWZ.js → chunk-HFHJPHFK.js} +1 -1
- package/{chunk-WQDTSK5U.js → chunk-HPDLPEUG.js} +11 -5
- package/{chunk-SPU3L3OR.js → chunk-HQUGB2HM.js} +3 -3
- package/chunk-IVK2KT3H.js +209 -0
- package/{chunk-73PZD7JZ.js → chunk-IYLUK67R.js} +2 -2
- package/{chunk-BFKJ2RS3.js → chunk-J55F3IEZ.js} +1 -1
- package/{chunk-ADOOL3PG.js → chunk-J7JRCOIW.js} +1 -1
- package/{chunk-AEZBAFC6.js → chunk-JAKRY74O.js} +138 -8
- package/{chunk-NEG5LYK5.js → chunk-JCQ3WCQ3.js} +3 -1
- package/{chunk-W6T4FNZP.js → chunk-JLZJL3WC.js} +219 -351
- package/{chunk-PQ63BDV3.js → chunk-JPXACKSW.js} +9 -1
- package/{chunk-IIOSZAJX.js → chunk-KDBDOXOM.js} +137 -53
- package/{chunk-CIGCTSBF.js → chunk-KDDHQMSH.js} +1 -1
- package/{chunk-OAZP4TSA.js → chunk-KG27JIG4.js} +2 -2
- package/{chunk-RHBD22LV.js → chunk-KHYSFS3W.js} +80 -4
- package/{chunk-7UVVLYKC.js → chunk-KKIQAVDR.js} +5 -5
- package/{chunk-HS7MLR74.js → chunk-KZ4A7EIV.js} +3 -5
- package/{chunk-OLGFIQN2.js → chunk-LLUBUHNT.js} +1 -1
- package/{chunk-QJTZ76CP.js → chunk-LS5KAVFQ.js} +1 -0
- package/{chunk-K26XPZRB.js → chunk-LVZVSLKO.js} +29 -9
- package/{chunk-XJSEST7D.js → chunk-MNFUKRRU.js} +3 -3
- package/{chunk-R5NRFXGD.js → chunk-O3A2CHAL.js} +5 -5
- package/{chunk-4IQN6FWY.js → chunk-OB4FBZXJ.js} +4 -4
- package/{chunk-J2VIGDJN.js → chunk-OJSJJKHF.js} +3 -3
- package/{chunk-OHUYN3YU.js → chunk-OKAXQFON.js} +1 -1
- package/{chunk-CD2DK5JA.js → chunk-OKH74FML.js} +2 -1
- package/{chunk-MYYNZG2M.js → chunk-OOV5JN25.js} +4 -4
- package/{chunk-TMRJGSK2.js → chunk-OOVOAG4Q.js} +1 -1
- package/chunk-OQFOE4SJ.js +405 -0
- package/{chunk-AS6L5KSD.js → chunk-P4R5KXU7.js} +2 -2
- package/{chunk-VIYVRPMJ.js → chunk-PHREU2KZ.js} +5 -3
- package/{chunk-EDT65EUE.js → chunk-PIVTQRX6.js} +45 -15
- package/{chunk-QMNVV3YM.js → chunk-PJL7OJRC.js} +12 -11
- package/{chunk-XCA4WHX5.js → chunk-PNLDLUMO.js} +315 -360
- package/{chunk-UPOW5HTG.js → chunk-QGFLVQ6E.js} +3 -3
- package/{chunk-JU7VN4LF.js → chunk-QONAOHVW.js} +6 -6
- package/{chunk-UOUMPHS5.js → chunk-R3FZHW4Q.js} +13 -13
- package/{chunk-K7VIXYTZ.js → chunk-R3MV2GII.js} +1 -45
- package/{chunk-FE7G6DSP.js → chunk-R72QWIFO.js} +14 -4
- package/{chunk-KZAT2M2V.js → chunk-RIWKZT7E.js} +22 -0
- package/{chunk-RMWDKLBE.js → chunk-S7H4KTMB.js} +1099 -71
- package/{chunk-IJZC2KIJ.js → chunk-SA356NGW.js} +1 -1
- package/{chunk-BVEDT6DM.js → chunk-SCAC3NM5.js} +3 -3
- package/{chunk-EQZQUQ33.js → chunk-SLUN7W6S.js} +5 -5
- package/{chunk-KK3FCYZM.js → chunk-SQL7YNED.js} +7 -4
- package/{chunk-LMGFVH65.js → chunk-SSOR2EDT.js} +10 -10
- package/chunk-TRRXYFTR.js +46 -0
- package/{chunk-XNTZD4AE.js → chunk-TUOHSUK5.js} +19367 -17503
- package/chunk-TYJCIA2O.js +835 -0
- package/{chunk-FTWAOKFU.js → chunk-U3BUWDUP.js} +415 -1962
- package/{chunk-CD64YXRB.js → chunk-U6QNVOR5.js} +1 -1
- package/chunk-UAF5VQCE.js +77 -0
- package/{chunk-CIUZXD5D.js → chunk-UFGUJ2IH.js} +5 -5
- package/{chunk-CTIEJRTP.js → chunk-UP7KBWLE.js} +81 -29
- package/{chunk-GX6DITLQ.js → chunk-UUCYUN6Y.js} +1 -1
- package/{chunk-UHW6SCVK.js → chunk-UZKBVQUX.js} +1 -1
- package/{chunk-XSRSAU3O.js → chunk-V5TI7HJH.js} +3 -3
- package/{chunk-WFGNWWJI.js → chunk-VH7UO6E5.js} +252 -114
- package/{chunk-ITBX27W6.js → chunk-VJFDG3ZG.js} +30 -122
- package/{chunk-6MTVACLN.js → chunk-WC3J5SL2.js} +277 -293
- package/{chunk-HCCQEMTK.js → chunk-WD5547ZF.js} +15 -12
- package/{chunk-X3OZ655T.js → chunk-WS36XPJD.js} +2 -2
- package/{chunk-JFRJEPFI.js → chunk-WSLL7VV4.js} +2 -2
- package/chunk-XRGBJHZX.js +136 -0
- package/{chunk-KZ5OD2MO.js → chunk-Y2KWJTOZ.js} +3 -3
- package/{dialogUsageCommand-6RW2FY6K.js → chunk-Y2TCTNUD.js} +24 -17
- package/{chunk-FFFKAOJN.js → chunk-YN23INFZ.js} +1 -1
- package/{chunk-ODBYGVO2.js → chunk-YXK3GJF5.js} +5 -5
- package/{chunk-6CXQ3YNJ.js → chunk-Z2OWAYMI.js} +53 -31
- package/{chunk-6XVPMGXK.js → chunk-ZTHAJU3O.js} +10 -4
- package/{chunk-D25ONVOH.js → chunk-ZYPXOQS2.js} +1 -1
- package/{cliAgentConfigHelpers-37ZNEY5Y.js → cliAgentConfigHelpers-BXHQ3PXP.js} +8 -8
- package/{cliAuthorityBrokerClient-SFPC3WVK.js → cliAuthorityBrokerClient-TFNXJLXL.js} +1 -1
- package/cliAuthorityBrokerProcess-5ZFBTHLB.js +22 -0
- package/{cliLocalAgentRecordReader-MCQVRWBR.js → cliLocalAgentRecordReader-47PXMHPH.js} +43 -41
- package/{commandRegistry-NTH5IAN5.js → commandRegistry-CTMPAQH2.js} +93 -156
- package/{contentThunks-SPXTX5U2.js → contentThunks-CAHIIZO5.js} +25 -25
- package/{cooldownCommands-TIFCHCUN.js → cooldownCommands-WDOI5VD7.js} +3 -3
- package/{createAgentAutomationAction-KUQKCOXB.js → createAgentAutomationAction-M25XZSPD.js} +25 -25
- package/{createDialogAction-HJN5U3XS.js → createDialogAction-4SN7FKI7.js} +26 -26
- package/{createPageAction-ZAHRDOAU.js → createPageAction-N7QPDN3M.js} +28 -28
- package/{db-CMUTP3W5.js → db-VR74ADGC.js} +7 -2
- package/{dbSlice-656PMWR2.js → dbSlice-RWPSVHBC.js} +9 -9
- package/{deleteFile-ZCQESEEQ.js → deleteFile-ECU6FU5C.js} +12 -7
- package/{dialogCommands-KZTZLWPZ.js → dialogCommands-BBHWCKDP.js} +57 -47
- package/{dialogNotifyCommand-PST75COP.js → dialogNotifyCommand-IASQGEMW.js} +9 -9
- package/{dialogSlice-BXIERQHO.js → dialogSlice-JI3J22RV.js} +23 -23
- package/dialogTraceCommand-EW2KK6A4.js +961 -0
- package/dialogUsageCommand-WJ3U6KZU.js +27 -0
- package/{docCreateCommands-26HJ5NAY.js → docCreateCommands-QSX3X5U4.js} +45 -41
- package/{docDeleteCommands-UAOHH5XK.js → docDeleteCommands-63JBG2HQ.js} +46 -42
- package/{docReadCommands-4ADG7YE6.js → docReadCommands-CQFKRQUI.js} +45 -41
- package/{docStore-FZ75HWP2.js → docStore-XLBKGGNM.js} +10 -10
- package/{docUpdateCommands-OGFJZENF.js → docUpdateCommands-534LUK25.js} +45 -41
- package/ebookDownloaderAgentCommand-DYSKF5ZY.js +677 -0
- package/{getPricing-FCHYVRJU.js → getPricing-5BLZRPTM.js} +3 -3
- package/{handleSendMessageAction-KP6GGBFY.js → handleSendMessageAction-Q2VMEVOR.js} +90 -48
- package/{hostCredentialCreate-23TX56G7.js → hostCredentialCreate-C57T7YPE.js} +99 -93
- package/index.js +23 -11
- package/{localDialogRead-CIOTQM5T.js → localDialogRead-BJJT3TF5.js} +1 -1
- package/{localRuntimeAdapter-MTUWOYPN.js → localRuntimeAdapter-OALZPFZU.js} +96 -90
- package/{localRuntimeAuthority-TYHQCTZN.js → localRuntimeAuthority-UF2DAQ3F.js} +13 -3
- package/{localRuntimeDb-BO7IVWAZ.js → localRuntimeDb-ZJFGNHML.js} +1 -1
- package/{machineCommands-4WJUJQHW.js → machineCommands-N6IVWRZT.js} +109 -92
- package/{machineWsRunDispatch-V3U4JM67.js → machineWsRunDispatch-PDWYB33B.js} +97 -91
- package/{markdownToSlate-KIYM7B3P.js → markdownToSlate-PXYAIBVL.js} +1 -1
- package/{mcpLocalAuthorizeCommand-TI656UWC.js → mcpLocalAuthorizeCommand-KYI4EGF5.js} +17 -13
- package/{memberThunks-JFYC4Z5L.js → memberThunks-43B7UYC5.js} +11 -11
- package/{models-EP7VG6N2.js → models-ZX2BYIMB.js} +2 -2
- package/package.json +2 -1
- package/{projectArchive-NU2Z5HOR.js → projectArchive-TJNW5DLM.js} +28 -28
- package/{providerPresetApply-4H7YP5D7.js → providerPresetApply-NTJUINI6.js} +35 -16
- package/{providerRegistry-F3UPOTIY.js → providerRegistry-W45SLUV6.js} +5 -5
- package/{read-BRZHXUJ6.js → read-KG6INYUT.js} +12 -7
- package/{readDocTool-N7RVFQEE.js → readDocTool-N3GA52JR.js} +1 -1
- package/{readlineWorkspace-T56MRMS5.js → readlineWorkspace-PJZJVGA5.js} +1296 -1056
- package/{removeDialogAgentAction-J7XU7OUX.js → removeDialogAgentAction-EEVSOQOJ.js} +11 -11
- package/{runAgentClientLoop-O2GRCGRZ.js → runAgentClientLoop-3VC5TCDW.js} +69 -58
- package/{runtimeDoctorCommands-RDRJXMXC.js → runtimeDoctorCommands-V3M3JTUV.js} +14 -11
- package/{secretCommands-2FEMRUFM.js → secretCommands-KVVZS7A6.js} +2 -2
- package/{setDialogExtraReferencesAction-Q4V2ZZW2.js → setDialogExtraReferencesAction-DNO5POHA.js} +10 -10
- package/{setPrimaryDialogAgentAction-742H5S6T.js → setPrimaryDialogAgentAction-QABBEO4C.js} +11 -11
- package/{settingThunks-T4FXSV6M.js → settingThunks-DVKG4X4S.js} +13 -17
- package/{skillDiscovery-MDDKPTW3.js → skillDiscovery-ZMJH36AK.js} +3 -3
- package/{spaceCommands-W5TAVFDT.js → spaceCommands-AGGZXPY3.js} +218 -77
- package/{streamAgentChatTurn-OWDJMU5E.js → streamAgentChatTurn-4GTLL2OF.js} +111 -95
- package/{switchDialogAgentAction-HLDLHRRA.js → switchDialogAgentAction-KYWJSGOO.js} +9 -9
- package/{tableCommands-44GC4N6J.js → tableCommands-EFA754RE.js} +3 -3
- package/{tools-O7SGGVA3.js → tools-5AGPOPLW.js} +48 -47
- package/{tuiRestart-EOGC2BYY.js → tuiRestart-77E7PL4R.js} +9 -8
- package/{tuiSummaryLlmCaller-TM5BU73J.js → tuiSummaryLlmCaller-HROLGN4F.js} +12 -12
- package/{updateCommands-FBYA5WVG.js → updateCommands-GJGRS6JK.js} +3 -3
- package/{updateDialogTitleAction-EXSZGTLL.js → updateDialogTitleAction-5OSEDGRK.js} +25 -25
- package/{usageCommand-L4OFWXEU.js → usageCommand-WI6SQOPB.js} +2 -2
- package/{usageRebuildCommand-7JR33UHS.js → usageRebuildCommand-WQRLLZAT.js} +3 -3
- package/{windowsSelfUpdate-M4V77OUB.js → windowsSelfUpdate-C7LGVWYX.js} +2 -2
- package/{workloadLifecycle-ZCSQCHG3.js → workloadLifecycle-P2SJVV3S.js} +2 -2
- package/chunk-FGHEF6WI.js +0 -34
- package/chunk-U5LOKQ2R.js +0 -176
- package/chunk-YDRRGVT5.js +0 -142
- package/chunk-YGDYYFRX.js +0 -86
- package/chunk-Z7KE4K3H.js +0 -758
- package/lib-62SWPXNF.js +0 -21042
- /package/{chunk-ANUP75N2.js → chunk-2E4BYAUE.js} +0 -0
|
@@ -37,6 +37,9 @@ var resolveFireworksKimiModel = (model) => {
|
|
|
37
37
|
}
|
|
38
38
|
return model ?? "";
|
|
39
39
|
};
|
|
40
|
+
function hostedKimiLegacyThinkingOverride(provider, model, enableThinking, effort) {
|
|
41
|
+
return enableThinking === false && !effort && isPlatformKimiProviderModel(provider, model) ? { thinking: { type: "disabled" }, reasoning: { enabled: false } } : void 0;
|
|
42
|
+
}
|
|
40
43
|
|
|
41
44
|
// packages/ai/llm/platformHostedRoutingTable.ts
|
|
42
45
|
var PLATFORM_HOSTED_CLAUDE_SONNET_5_MODEL = "anthropic/claude-sonnet-5";
|
|
@@ -1751,6 +1754,9 @@ var platformHostedModels = [
|
|
|
1751
1754
|
]
|
|
1752
1755
|
})
|
|
1753
1756
|
];
|
|
1757
|
+
function usesMimoThinkingWire(provider, model, endpoint) {
|
|
1758
|
+
return /xiaomimimo\.com/i.test(endpoint ?? "") || provider?.toLowerCase() === "mimo" || isPlatformMimoProviderModel(provider, model);
|
|
1759
|
+
}
|
|
1754
1760
|
|
|
1755
1761
|
// packages/ai/llm/cloudflare.ts
|
|
1756
1762
|
var getCloudflareWorkersAiChatCompletionsUrl = (accountId = (typeof process !== "undefined" ? process.env?.CLOUDFLARE_ACCOUNT_ID : void 0)?.trim()) => {
|
|
@@ -1776,8 +1782,10 @@ export {
|
|
|
1776
1782
|
isNoloHostedProvider,
|
|
1777
1783
|
isFireworksKimiModel,
|
|
1778
1784
|
isDeepInfraKimiModel,
|
|
1785
|
+
isPlatformKimiProviderModel,
|
|
1779
1786
|
isPlatformManagedProvider,
|
|
1780
1787
|
resolveFireworksKimiModel,
|
|
1788
|
+
hostedKimiLegacyThinkingOverride,
|
|
1781
1789
|
PLATFORM_HOSTED_CLAUDE_SONNET_5_MODEL,
|
|
1782
1790
|
PLATFORM_HOSTED_CLAUDE_OPUS_5_MODEL,
|
|
1783
1791
|
PLATFORM_HOSTED_CLAUDE_FABLE_5_MODEL,
|
|
@@ -1801,7 +1809,6 @@ export {
|
|
|
1801
1809
|
PLATFORM_HOSTED_GLM_53_FLASH_BASETEN_PRICE,
|
|
1802
1810
|
isPlatformHostedOpenAIImageModel,
|
|
1803
1811
|
isPlatformHostedImageModel,
|
|
1804
|
-
isPlatformMimoProviderModel,
|
|
1805
1812
|
PLATFORM_HOSTED_DEEPSEEK_FLASH_PEAK_PRICE,
|
|
1806
1813
|
PLATFORM_HOSTED_DEEPSEEK_FLASH_OFF_PEAK_PRICE,
|
|
1807
1814
|
PLATFORM_HOSTED_DEEPSEEK_PRO_PEAK_PRICE,
|
|
@@ -1810,6 +1817,7 @@ export {
|
|
|
1810
1817
|
isPlatformHostedDeepseekModel,
|
|
1811
1818
|
isPlatformHostedDeepSeekV4Model,
|
|
1812
1819
|
platformHostedModels,
|
|
1820
|
+
usesMimoThinkingWire,
|
|
1813
1821
|
getCloudflareWorkersAiChatCompletionsUrl,
|
|
1814
1822
|
cloudflareModels,
|
|
1815
1823
|
GMI_CHAT_COMPLETIONS_URL,
|
|
@@ -1,26 +1,42 @@
|
|
|
1
1
|
import {
|
|
2
2
|
toolRegistry
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-U3BUWDUP.js";
|
|
4
4
|
import {
|
|
5
|
+
INLINE_IMAGE_MAX_BYTES,
|
|
6
|
+
INLINE_IMAGE_TOTAL_MAX_BYTES,
|
|
5
7
|
runtime_default
|
|
6
|
-
} from "./chunk-
|
|
8
|
+
} from "./chunk-EVHTYVD2.js";
|
|
7
9
|
import {
|
|
8
10
|
canonicalizeToolNames
|
|
9
11
|
} from "./chunk-YLAHYLDQ.js";
|
|
12
|
+
import {
|
|
13
|
+
API_ENDPOINTS,
|
|
14
|
+
NOLO_CLUSTER_SERVERS
|
|
15
|
+
} from "./chunk-LCBAMY2M.js";
|
|
10
16
|
import {
|
|
11
17
|
isRecord
|
|
12
18
|
} from "./chunk-KUG52IAP.js";
|
|
13
19
|
import {
|
|
14
20
|
isNoloHostedProvider
|
|
15
|
-
} from "./chunk-
|
|
21
|
+
} from "./chunk-JPXACKSW.js";
|
|
16
22
|
import {
|
|
17
23
|
asTrimmedLowercaseString
|
|
18
24
|
} from "./chunk-QSJ3HFEF.js";
|
|
19
25
|
|
|
20
26
|
// packages/ai/chat/inlineImageUrlsForCustomProvider.ts
|
|
21
|
-
var
|
|
22
|
-
|
|
23
|
-
|
|
27
|
+
var FILE_CONTENT_PATH = `${API_ENDPOINTS.DATABASE}/file/content/`;
|
|
28
|
+
function trustedInlineFile(url, serverUrl, pageOrigin) {
|
|
29
|
+
try {
|
|
30
|
+
const source = new URL(url, pageOrigin ?? serverUrl);
|
|
31
|
+
const originOf = (base) => base ? new URL(base).origin : void 0;
|
|
32
|
+
if (!/^https?:$/.test(source.protocol) || source.username || source.password || !(source.origin === originOf(serverUrl) || source.origin === originOf(pageOrigin) || NOLO_CLUSTER_SERVERS.some((origin) => origin === source.origin))) return null;
|
|
33
|
+
const id = source.pathname.startsWith(FILE_CONTENT_PATH) ? source.pathname.slice(FILE_CONTENT_PATH.length) : "";
|
|
34
|
+
if (!/^[A-Za-z0-9._~-]{1,256}$/.test(id) || id === "." || id === "..") return null;
|
|
35
|
+
return { origin: source.origin, id, spaceId: source.searchParams.get("spaceId") };
|
|
36
|
+
} catch {
|
|
37
|
+
return null;
|
|
38
|
+
}
|
|
39
|
+
}
|
|
24
40
|
var shouldInlineImageUrlsForAgent = (agentConfig) => {
|
|
25
41
|
const apiSource = agentConfig?.apiSource?.toLowerCase();
|
|
26
42
|
const provider = agentConfig?.provider?.toLowerCase();
|
|
@@ -29,7 +45,15 @@ var shouldInlineImageUrlsForAgent = (agentConfig) => {
|
|
|
29
45
|
if (isNoloHostedProvider(provider)) return true;
|
|
30
46
|
return provider === "openrouter" && model === "minimax/minimax-m3";
|
|
31
47
|
};
|
|
32
|
-
var isInlineCandidate = (url) =>
|
|
48
|
+
var isInlineCandidate = (url) => {
|
|
49
|
+
if (/^data:/i.test(url)) return false;
|
|
50
|
+
if (url.includes(FILE_CONTENT_PATH)) return true;
|
|
51
|
+
try {
|
|
52
|
+
return new URL(url, "https://relative.invalid").pathname.startsWith(FILE_CONTENT_PATH);
|
|
53
|
+
} catch {
|
|
54
|
+
return false;
|
|
55
|
+
}
|
|
56
|
+
};
|
|
33
57
|
var bytesToBase64 = (bytes) => {
|
|
34
58
|
const chunks = [];
|
|
35
59
|
for (let offset = 0; offset < bytes.length; offset += 32768) {
|
|
@@ -37,84 +61,144 @@ var bytesToBase64 = (bytes) => {
|
|
|
37
61
|
}
|
|
38
62
|
return btoa(chunks.join(""));
|
|
39
63
|
};
|
|
40
|
-
|
|
41
|
-
const
|
|
42
|
-
if (!response.ok) {
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
error: `HTTP ${response.status}`
|
|
46
|
-
};
|
|
64
|
+
async function readBoundedInlineImage(response, maxBytes) {
|
|
65
|
+
const declaredSize = Number(response.headers.get("content-length"));
|
|
66
|
+
if (!response.ok || !response.body || declaredSize > maxBytes) {
|
|
67
|
+
await response.body?.cancel();
|
|
68
|
+
return declaredSize > maxBytes ? { ok: false, skippedSize: declaredSize } : { ok: false };
|
|
47
69
|
}
|
|
48
|
-
const
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
70
|
+
const reader = response.body.getReader();
|
|
71
|
+
const chunks = [];
|
|
72
|
+
let size = 0;
|
|
73
|
+
for (; ; ) {
|
|
74
|
+
const { value, done } = await reader.read();
|
|
75
|
+
if (done) break;
|
|
76
|
+
size += value.byteLength;
|
|
77
|
+
if (size > maxBytes) {
|
|
78
|
+
await reader.cancel();
|
|
79
|
+
return { ok: false, skippedSize: size };
|
|
80
|
+
}
|
|
81
|
+
chunks.push(value);
|
|
82
|
+
}
|
|
83
|
+
const bytes = new Uint8Array(size);
|
|
84
|
+
let offset = 0;
|
|
85
|
+
for (const chunk of chunks) {
|
|
86
|
+
bytes.set(chunk, offset);
|
|
87
|
+
offset += chunk.byteLength;
|
|
88
|
+
}
|
|
89
|
+
return { ok: true, bytes, mimeType: response.headers.get("content-type") ?? void 0 };
|
|
90
|
+
}
|
|
91
|
+
function publicImageFetcher(options) {
|
|
92
|
+
const timeout = AbortSignal.timeout(5e3);
|
|
93
|
+
const request = options.request ?? fetch;
|
|
94
|
+
const pageOrigin = typeof window === "undefined" ? void 0 : window.location?.origin;
|
|
95
|
+
return async (url, signal, maxBytes = INLINE_IMAGE_MAX_BYTES) => {
|
|
96
|
+
try {
|
|
97
|
+
const file = trustedInlineFile(url, options.serverUrl, pageOrigin);
|
|
98
|
+
if (!file) return { ok: false };
|
|
99
|
+
const init = {
|
|
100
|
+
credentials: "omit",
|
|
101
|
+
redirect: "error",
|
|
102
|
+
cache: "no-store",
|
|
103
|
+
signal: signal ? AbortSignal.any([signal, timeout]) : timeout
|
|
104
|
+
};
|
|
105
|
+
const base = `${file.origin}${API_ENDPOINTS.DATABASE}/file`;
|
|
106
|
+
const proof = await request(`${base}/public/${file.id}`, init);
|
|
107
|
+
if (!proof.ok || (await proof.json())?.public !== true) {
|
|
108
|
+
if (!proof.bodyUsed) await proof.body?.cancel();
|
|
109
|
+
return { ok: false };
|
|
110
|
+
}
|
|
111
|
+
return await readBoundedInlineImage(await request(`${base}/public-content/${file.id}?maxBytes=${maxBytes}`, init), maxBytes);
|
|
112
|
+
} catch {
|
|
113
|
+
signal?.throwIfAborted();
|
|
114
|
+
return { ok: false };
|
|
115
|
+
}
|
|
53
116
|
};
|
|
54
|
-
}
|
|
117
|
+
}
|
|
55
118
|
var cloneImagePartWithDataUrl = async (part, fetchImage, options, usedBytes) => {
|
|
56
|
-
const
|
|
57
|
-
|
|
119
|
+
const native = part?.type === "input_image";
|
|
120
|
+
const url = native && typeof part.image_url === "string" ? part.image_url : part?.image_url?.url;
|
|
121
|
+
const unavailable = { type: native ? "input_text" : "text", text: "[Image unavailable]" };
|
|
122
|
+
if (typeof url !== "string" || !isInlineCandidate(url)) return part;
|
|
58
123
|
if (options.signal?.aborted) throw new DOMException("The operation was aborted", "AbortError");
|
|
59
124
|
const remaining = options.maxTotalBytes === void 0 ? void 0 : options.maxTotalBytes - usedBytes.value;
|
|
125
|
+
if (remaining !== void 0 && remaining <= 0) {
|
|
126
|
+
options.onSkipTooLarge?.(url, void 0, "total-budget");
|
|
127
|
+
return unavailable;
|
|
128
|
+
}
|
|
60
129
|
const fetchLimit = options.maxBytes === void 0 ? remaining : remaining === void 0 ? options.maxBytes : Math.min(options.maxBytes, remaining);
|
|
61
|
-
const result = await fetchImage(url, options.signal, fetchLimit)
|
|
130
|
+
const result = await fetchImage(url, options.signal, fetchLimit).catch(() => {
|
|
131
|
+
options.signal?.throwIfAborted();
|
|
132
|
+
return { ok: false };
|
|
133
|
+
});
|
|
62
134
|
if (options.signal?.aborted) throw new DOMException("The operation was aborted", "AbortError");
|
|
63
135
|
if (result.skippedSize !== void 0) {
|
|
64
136
|
const reason = options.maxBytes !== void 0 && result.skippedSize > options.maxBytes ? "per-image" : "total-budget";
|
|
65
137
|
options.onSkipTooLarge?.(url, result.skippedSize, reason);
|
|
66
|
-
return
|
|
138
|
+
return unavailable;
|
|
67
139
|
}
|
|
68
|
-
if (!result.ok || !result.bytes) return
|
|
140
|
+
if (!result.ok || !result.bytes) return unavailable;
|
|
69
141
|
if (options.maxBytes !== void 0 && result.bytes.byteLength > options.maxBytes) {
|
|
70
142
|
options.onSkipTooLarge?.(url, result.bytes.byteLength, "per-image");
|
|
71
|
-
return
|
|
143
|
+
return unavailable;
|
|
72
144
|
}
|
|
73
145
|
if (options.maxTotalBytes !== void 0 && usedBytes.value + result.bytes.byteLength > options.maxTotalBytes) {
|
|
74
146
|
options.onSkipTooLarge?.(url, result.bytes.byteLength, "total-budget");
|
|
75
|
-
return
|
|
147
|
+
return unavailable;
|
|
76
148
|
}
|
|
77
149
|
usedBytes.value += result.bytes.byteLength;
|
|
78
150
|
const mimeType = (result.mimeType || "application/octet-stream").split(";")[0].trim() || "application/octet-stream";
|
|
79
|
-
|
|
151
|
+
const dataUrl = `data:${mimeType};base64,${bytesToBase64(result.bytes)}`;
|
|
152
|
+
return { ...part, image_url: native ? dataUrl : { ...part.image_url, url: dataUrl } };
|
|
80
153
|
};
|
|
81
154
|
var inlineImageUrlsForCustomProvider = async (bodyData, options) => {
|
|
82
155
|
if (!options.shouldInline) return bodyData;
|
|
83
156
|
const body = bodyData;
|
|
84
|
-
if (!Array.isArray(body?.messages)) return bodyData;
|
|
85
|
-
|
|
157
|
+
if (!Array.isArray(body?.messages) && !Array.isArray(body?.input)) return bodyData;
|
|
158
|
+
options = {
|
|
159
|
+
...options,
|
|
160
|
+
maxBytes: Math.min(options.maxBytes ?? INLINE_IMAGE_MAX_BYTES, INLINE_IMAGE_MAX_BYTES),
|
|
161
|
+
maxTotalBytes: Math.min(options.maxTotalBytes ?? INLINE_IMAGE_TOTAL_MAX_BYTES, INLINE_IMAGE_TOTAL_MAX_BYTES)
|
|
162
|
+
};
|
|
163
|
+
const fetchImage = options.fetchImage ?? publicImageFetcher(options);
|
|
86
164
|
const fetched = /* @__PURE__ */ new Map();
|
|
87
165
|
const fetchOnce = (url, signal, maxBytes) => {
|
|
88
|
-
let
|
|
89
|
-
if (!
|
|
90
|
-
|
|
91
|
-
fetched.set(url,
|
|
166
|
+
let result2 = fetched.get(url);
|
|
167
|
+
if (!result2) {
|
|
168
|
+
result2 = fetchImage(url, signal, maxBytes);
|
|
169
|
+
fetched.set(url, result2);
|
|
92
170
|
}
|
|
93
|
-
return
|
|
171
|
+
return result2;
|
|
94
172
|
};
|
|
95
173
|
const usedBytes = { value: 0 };
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
if (options.maxTotalBytes !== void 0 && usedBytes.value >= options.maxTotalBytes) {
|
|
106
|
-
if (typeof part?.image_url?.url === "string" && isInlineCandidate(part.image_url.url)) options.onSkipTooLarge?.(part.image_url.url, void 0, "total-budget");
|
|
107
|
-
continue;
|
|
174
|
+
const rewrite = async (items, imageType) => {
|
|
175
|
+
let output = items;
|
|
176
|
+
for (let i = items.length - 1; i >= 0; i--) {
|
|
177
|
+
const item = items[i];
|
|
178
|
+
let next = item;
|
|
179
|
+
if (item?.type === imageType) next = await cloneImagePartWithDataUrl(item, fetchOnce, options, usedBytes);
|
|
180
|
+
else if (Array.isArray(item?.content)) {
|
|
181
|
+
const content = await rewrite(item.content, imageType);
|
|
182
|
+
if (content !== item.content) next = { ...item, content };
|
|
108
183
|
}
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
184
|
+
if (imageType === "input_image" && item?.type === "function_call_output" && Array.isArray(item.output)) {
|
|
185
|
+
const outputItems = await rewrite(item.output, imageType);
|
|
186
|
+
if (outputItems !== item.output) next = { ...next, output: outputItems };
|
|
187
|
+
}
|
|
188
|
+
if (next !== item) {
|
|
189
|
+
if (output === items) output = [...items];
|
|
190
|
+
output[i] = next;
|
|
113
191
|
}
|
|
114
192
|
}
|
|
115
|
-
|
|
193
|
+
return output;
|
|
194
|
+
};
|
|
195
|
+
let result = body;
|
|
196
|
+
for (const [key, imageType] of [["messages", "image_url"], ["input", "input_image"]]) {
|
|
197
|
+
if (!Array.isArray(body[key])) continue;
|
|
198
|
+
const items = await rewrite(body[key], imageType);
|
|
199
|
+
if (items !== body[key]) result = { ...result, [key]: items };
|
|
116
200
|
}
|
|
117
|
-
return
|
|
201
|
+
return result;
|
|
118
202
|
};
|
|
119
203
|
|
|
120
204
|
// packages/ai/tools/toolSchemaCompatibility.ts
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import {
|
|
2
2
|
DEFAULT_USER_PREFERENCE_PROFILE
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-R3FZHW4Q.js";
|
|
4
4
|
import {
|
|
5
5
|
noloAgentId
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-5P3PPQVP.js";
|
|
7
7
|
import {
|
|
8
8
|
normalizeServerOrigin
|
|
9
9
|
} from "./chunk-CF7PE763.js";
|
|
@@ -1,11 +1,19 @@
|
|
|
1
1
|
import {
|
|
2
2
|
Database
|
|
3
3
|
} from "./chunk-IT3ZZRJE.js";
|
|
4
|
+
import {
|
|
5
|
+
createLegacyServerDb
|
|
6
|
+
} from "./chunk-TRRXYFTR.js";
|
|
4
7
|
import {
|
|
5
8
|
Level,
|
|
6
|
-
createLegacyServerDb,
|
|
7
9
|
createLevelAuthorityStore
|
|
8
|
-
} from "./chunk-
|
|
10
|
+
} from "./chunk-R3MV2GII.js";
|
|
11
|
+
import {
|
|
12
|
+
Mutex
|
|
13
|
+
} from "./chunk-IVK2KT3H.js";
|
|
14
|
+
import {
|
|
15
|
+
isDialogRecordKey
|
|
16
|
+
} from "./chunk-OJKUU3LP.js";
|
|
9
17
|
import {
|
|
10
18
|
asTrimmedLowercaseString
|
|
11
19
|
} from "./chunk-QSJ3HFEF.js";
|
|
@@ -53,6 +61,74 @@ var SERVER_DB_ROLE_VIOLATION_MESSAGE = "\u5F53\u524D\u8FDB\u7A0B\u89D2\u8272\u4E
|
|
|
53
61
|
import fs from "fs";
|
|
54
62
|
import path from "path";
|
|
55
63
|
|
|
64
|
+
// packages/database-engine/activeDialogRunIndex.ts
|
|
65
|
+
var ACTIVE_DIALOG_RUN_PREFIX = "active-dialog-run-";
|
|
66
|
+
var DEPLOYMENT_DIALOG_RUN_PREFIX = "deployment-dialog-run-";
|
|
67
|
+
var DEPLOYMENT_DIALOG_CANCEL_MESSAGE = "Cancelled by deployment (will auto-recover)";
|
|
68
|
+
function dialogRunIndexPrefix(value) {
|
|
69
|
+
if (!value || typeof value !== "object") return;
|
|
70
|
+
const { status, errorMessage } = value;
|
|
71
|
+
if (status === "pending" || status === "running") return ACTIVE_DIALOG_RUN_PREFIX;
|
|
72
|
+
if (status === "cancelled" && errorMessage === DEPLOYMENT_DIALOG_CANCEL_MESSAGE) {
|
|
73
|
+
return DEPLOYMENT_DIALOG_RUN_PREFIX;
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
function dialogRunIndexOps(op) {
|
|
77
|
+
if (!isDialogRecordKey(op.key)) return [];
|
|
78
|
+
const member = op.type === "put" ? dialogRunIndexPrefix(op.value) : void 0;
|
|
79
|
+
return [ACTIVE_DIALOG_RUN_PREFIX, DEPLOYMENT_DIALOG_RUN_PREFIX].map((prefix) => {
|
|
80
|
+
const key = prefix + op.key;
|
|
81
|
+
return member === prefix ? { type: "put", key, value: true } : { type: "del", key };
|
|
82
|
+
});
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
// packages/database-engine/publicationBatch.ts
|
|
86
|
+
function withPublicationBatch(store) {
|
|
87
|
+
const lock = new Mutex();
|
|
88
|
+
const batchWrite = (ops) => store.batchWrite(ops.flatMap((op) => [op, ...dialogRunIndexOps(op)]));
|
|
89
|
+
const put = (key, value) => {
|
|
90
|
+
const op = { type: "put", key, value };
|
|
91
|
+
const indexOps = dialogRunIndexOps(op);
|
|
92
|
+
return indexOps.length ? store.batchWrite([op, ...indexOps]) : store.put(key, value);
|
|
93
|
+
};
|
|
94
|
+
const del = (key) => {
|
|
95
|
+
const op = { type: "del", key };
|
|
96
|
+
const indexOps = dialogRunIndexOps(op);
|
|
97
|
+
return indexOps.length ? store.batchWrite([op, ...indexOps]) : store.del(key);
|
|
98
|
+
};
|
|
99
|
+
const wrapped = {
|
|
100
|
+
get location() {
|
|
101
|
+
return store.location;
|
|
102
|
+
},
|
|
103
|
+
get status() {
|
|
104
|
+
return store.status;
|
|
105
|
+
},
|
|
106
|
+
open: () => store.open(),
|
|
107
|
+
close: () => lock.runExclusive(() => store.close()),
|
|
108
|
+
get: (key) => store.get(key),
|
|
109
|
+
iterator: (options) => store.iterator(options),
|
|
110
|
+
put: (key, value) => lock.runExclusive(() => put(key, value)),
|
|
111
|
+
del: (key) => lock.runExclusive(() => del(key)),
|
|
112
|
+
batchWrite: (ops) => lock.runExclusive(() => batchWrite(ops)),
|
|
113
|
+
createBatch: () => {
|
|
114
|
+
const batch = store.createBatch();
|
|
115
|
+
const stage = (op) => {
|
|
116
|
+
for (const entry of [op, ...dialogRunIndexOps(op)]) {
|
|
117
|
+
if (entry.type === "put") batch.put(entry.key, entry.value);
|
|
118
|
+
else batch.del(entry.key);
|
|
119
|
+
}
|
|
120
|
+
};
|
|
121
|
+
return {
|
|
122
|
+
put: (key, value) => stage({ type: "put", key, value }),
|
|
123
|
+
del: (key) => stage({ type: "del", key }),
|
|
124
|
+
write: () => lock.runExclusive(() => batch.write())
|
|
125
|
+
};
|
|
126
|
+
},
|
|
127
|
+
runPublicationBatch: (task) => lock.runExclusive(() => task({ get: wrapped.get, batchWrite }))
|
|
128
|
+
};
|
|
129
|
+
return wrapped;
|
|
130
|
+
}
|
|
131
|
+
|
|
56
132
|
// packages/database-engine/memoryAuthorityStore.ts
|
|
57
133
|
var createNotFoundError = () => {
|
|
58
134
|
const error = new Error("NotFound");
|
|
@@ -394,10 +470,10 @@ function getOrCreateServerStoreRuntime(dbPath, options = {}) {
|
|
|
394
470
|
);
|
|
395
471
|
}
|
|
396
472
|
if (!globalScope.__serverAuthorityStore) {
|
|
397
|
-
globalScope.__serverAuthorityStore = createAuthorityStoreForDriver(
|
|
473
|
+
globalScope.__serverAuthorityStore = withPublicationBatch(createAuthorityStoreForDriver(
|
|
398
474
|
driver,
|
|
399
475
|
dbPath
|
|
400
|
-
);
|
|
476
|
+
));
|
|
401
477
|
globalScope.__serverAuthorityStoreDriver = driver;
|
|
402
478
|
} else if (!cachedDriver) {
|
|
403
479
|
globalScope.__serverAuthorityStoreDriver = driver;
|
|
@@ -1,20 +1,20 @@
|
|
|
1
1
|
import {
|
|
2
2
|
applyPublicAgentCatalogOverride
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-223KZUJ6.js";
|
|
4
4
|
import {
|
|
5
5
|
applyBuiltinAgentRuntimeOverride,
|
|
6
6
|
resolveBuiltinPlatformAgentConfig
|
|
7
|
-
} from "./chunk-
|
|
7
|
+
} from "./chunk-CEKRIR22.js";
|
|
8
8
|
import {
|
|
9
9
|
buildLocalAgentLookupKeys
|
|
10
|
-
} from "./chunk-
|
|
10
|
+
} from "./chunk-SA356NGW.js";
|
|
11
11
|
import {
|
|
12
12
|
localDialogMessageRecordToRuntimeMessage,
|
|
13
13
|
orderDialogHistory
|
|
14
|
-
} from "./chunk-
|
|
14
|
+
} from "./chunk-TUOHSUK5.js";
|
|
15
15
|
import {
|
|
16
16
|
resolveAgentRuntimeConfigFromRecord
|
|
17
|
-
} from "./chunk-
|
|
17
|
+
} from "./chunk-5ISNPTQH.js";
|
|
18
18
|
import {
|
|
19
19
|
dialogMessagePrefix,
|
|
20
20
|
dialogMessageRange
|
|
@@ -1,8 +1,6 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
return `${normalized}_KEY`;
|
|
5
|
-
}
|
|
1
|
+
import {
|
|
2
|
+
providerSecretKey
|
|
3
|
+
} from "./chunk-LVZVSLKO.js";
|
|
6
4
|
|
|
7
5
|
// packages/ai/agent/providerSecrets.ts
|
|
8
6
|
var STORAGE_KEY = "nolo-local-secrets";
|
|
@@ -4,7 +4,7 @@ import {
|
|
|
4
4
|
resolvePlatformHostedCredentialProvider,
|
|
5
5
|
resolvePlatformProxyChatGatewayEndpoint,
|
|
6
6
|
resolvePlatformResponsesEndpoint
|
|
7
|
-
} from "./chunk-
|
|
7
|
+
} from "./chunk-2JHGUL5K.js";
|
|
8
8
|
import {
|
|
9
9
|
asTrimmedString
|
|
10
10
|
} from "./chunk-3EUW3WEO.js";
|
|
@@ -21,7 +21,7 @@ import {
|
|
|
21
21
|
CLIENT_VERSION_TOO_OLD_CODE,
|
|
22
22
|
buildClientVersionGateErrorDetail,
|
|
23
23
|
evaluatePlatformHostedClientVersionGate
|
|
24
|
-
} from "./chunk-
|
|
24
|
+
} from "./chunk-JPXACKSW.js";
|
|
25
25
|
import {
|
|
26
26
|
asTrimmedLowercaseString
|
|
27
27
|
} from "./chunk-QSJ3HFEF.js";
|
|
@@ -38,6 +38,22 @@ function pickAgentRuntimeInferenceOptions(agentConfig) {
|
|
|
38
38
|
};
|
|
39
39
|
}
|
|
40
40
|
|
|
41
|
+
// packages/shared/providerSecrets.ts
|
|
42
|
+
function providerSecretKey(presetId) {
|
|
43
|
+
const normalized = presetId.trim().replace(/[^a-zA-Z0-9]+/g, "_").toUpperCase();
|
|
44
|
+
return `${normalized}_KEY`;
|
|
45
|
+
}
|
|
46
|
+
function isAgentCredentialShared(agent) {
|
|
47
|
+
return agent?.credentialSynced === true;
|
|
48
|
+
}
|
|
49
|
+
function resolveOutboundProxyApiKey(credential) {
|
|
50
|
+
const apiKey = asOptionalTrimmedString(credential.apiKey);
|
|
51
|
+
if (apiKey && !isAgentCredentialShared(credential)) {
|
|
52
|
+
throw new Error("\u672A\u6388\u6743\u5C06\u6B64\u5BC6\u94A5\u53D1\u9001\u5230 nolo \u4EE3\u7406\u3002\u8BF7\u4F7F\u7528\u672C\u673A\u76F4\u8FDE\uFF0C\u6216\u542F\u7528\u8DE8\u8BBE\u5907\u5171\u4EAB\u540E\u91CD\u8BD5\u3002");
|
|
53
|
+
}
|
|
54
|
+
return apiKey;
|
|
55
|
+
}
|
|
56
|
+
|
|
41
57
|
// packages/agent-runtime/providerResolution.ts
|
|
42
58
|
function resolvePlatformProviderEndpoint(agentConfig) {
|
|
43
59
|
const customProviderUrl = agentConfig.customProviderUrl?.trim();
|
|
@@ -223,7 +239,7 @@ async function buildProviderExecutionPlan(args) {
|
|
|
223
239
|
const credentialRef2 = agentConfig.credentialRef?.trim();
|
|
224
240
|
const apiKeyRef = agentConfig.apiKeyRef?.trim();
|
|
225
241
|
if (args.credentialBroker) {
|
|
226
|
-
const brokerRefs = [credentialRef2, apiKeyRef].filter(
|
|
242
|
+
const brokerRefs = [credentialRef2, ...!credentialRef2 || !apiKeyRef?.startsWith("provider-key:") ? [apiKeyRef] : []].filter(
|
|
227
243
|
(ref) => Boolean(ref)
|
|
228
244
|
);
|
|
229
245
|
for (const ref of brokerRefs) {
|
|
@@ -234,7 +250,7 @@ async function buildProviderExecutionPlan(args) {
|
|
|
234
250
|
}
|
|
235
251
|
}
|
|
236
252
|
}
|
|
237
|
-
if (!apiKey2 && agentConfig
|
|
253
|
+
if (!apiKey2 && isAgentCredentialShared(agentConfig) && args.syncFetcher && credentialRef2) {
|
|
238
254
|
let synced = null;
|
|
239
255
|
try {
|
|
240
256
|
synced = await args.syncFetcher(credentialRef2);
|
|
@@ -249,7 +265,7 @@ async function buildProviderExecutionPlan(args) {
|
|
|
249
265
|
apiKey2 = trimmed;
|
|
250
266
|
}
|
|
251
267
|
}
|
|
252
|
-
if (!apiKey2 &&
|
|
268
|
+
if (!apiKey2 && isAgentCredentialShared(agentConfig) && !credentialRef2 && apiKeyRef?.startsWith("provider-key:") && args.syncFetcher) {
|
|
253
269
|
try {
|
|
254
270
|
const shared = await args.syncFetcher(apiKeyRef);
|
|
255
271
|
const trimmed = asTrimmedString(shared);
|
|
@@ -264,12 +280,12 @@ async function buildProviderExecutionPlan(args) {
|
|
|
264
280
|
}
|
|
265
281
|
}
|
|
266
282
|
if (!apiKey2 && apiKeyRef && args.apiKeyRefResolver) {
|
|
267
|
-
const resolved = await args.apiKeyRefResolver(apiKeyRef);
|
|
283
|
+
const resolved = apiKeyRef.startsWith("provider-key:") ? null : await args.apiKeyRefResolver(apiKeyRef);
|
|
268
284
|
if (resolved) {
|
|
269
285
|
apiKey2 = resolved;
|
|
270
286
|
} else if (!agentConfig.apiKey?.trim() && !agentConfig.apiKeyFromAgentKey?.trim()) {
|
|
271
|
-
const isApiKeyRef =
|
|
272
|
-
const hint = isApiKeyRef ? agentConfig
|
|
287
|
+
const isApiKeyRef = /^(api-key|provider-key):/.test(apiKeyRef);
|
|
288
|
+
const hint = isApiKeyRef ? isAgentCredentialShared(agentConfig) ? `Local credential for "${apiKeyRef}" not found. It is synced to your account \u2014 run this agent once on a device that has the key, or re-enter it in agent settings.` : `Local credential for "${apiKeyRef}" not found. Re-enter the API key in agent settings, or enable cross-device sync.` : `OAuth credential for "${apiKeyRef}" not found locally. Run \`nolo auth ${apiKeyRef}\` (and \`--sync-to-server\` for server-side agent runs).`;
|
|
273
289
|
throw new Error(hint);
|
|
274
290
|
}
|
|
275
291
|
}
|
|
@@ -293,6 +309,7 @@ async function buildProviderExecutionPlan(args) {
|
|
|
293
309
|
agentKey: agentConfig.key,
|
|
294
310
|
...agentConfig.apiSource ? { apiSource: agentConfig.apiSource } : {},
|
|
295
311
|
...apiKey2 ? { apiKey: apiKey2 } : {},
|
|
312
|
+
...isAgentCredentialShared(agentConfig) ? { credentialSynced: true } : {},
|
|
296
313
|
...apiKeyHeader ? { apiKeyHeader } : {}
|
|
297
314
|
};
|
|
298
315
|
}
|
|
@@ -351,7 +368,7 @@ async function buildProviderExecutionPlan(args) {
|
|
|
351
368
|
apiKey = fromBroker;
|
|
352
369
|
}
|
|
353
370
|
}
|
|
354
|
-
if (!apiKey && agentConfig
|
|
371
|
+
if (!apiKey && isAgentCredentialShared(agentConfig) && args.syncFetcher && credentialRef) {
|
|
355
372
|
let synced = null;
|
|
356
373
|
try {
|
|
357
374
|
synced = await args.syncFetcher(credentialRef);
|
|
@@ -382,6 +399,9 @@ async function buildProviderExecutionPlan(args) {
|
|
|
382
399
|
}
|
|
383
400
|
|
|
384
401
|
export {
|
|
402
|
+
providerSecretKey,
|
|
403
|
+
isAgentCredentialShared,
|
|
404
|
+
resolveOutboundProxyApiKey,
|
|
385
405
|
pickAgentRuntimeInferenceOptions,
|
|
386
406
|
trimTrailingSlash,
|
|
387
407
|
resolvePlatformServerUrl,
|
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
import {
|
|
2
2
|
selectCurrentServer,
|
|
3
3
|
selectRemoteServers
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-BZMDWGQQ.js";
|
|
5
5
|
import {
|
|
6
6
|
noloDeleteRequest,
|
|
7
7
|
noloWriteRequest
|
|
8
|
-
} from "./chunk-
|
|
8
|
+
} from "./chunk-ZTHAJU3O.js";
|
|
9
9
|
import {
|
|
10
10
|
normalizeTimeFields
|
|
11
|
-
} from "./chunk-
|
|
11
|
+
} from "./chunk-HDKMVYNJ.js";
|
|
12
12
|
import {
|
|
13
13
|
selectIdentityUser,
|
|
14
14
|
selectIdentityUserId
|
|
@@ -3,13 +3,13 @@ import {
|
|
|
3
3
|
} from "./chunk-P27E22MA.js";
|
|
4
4
|
import {
|
|
5
5
|
getReadableCliDb
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-ZYPXOQS2.js";
|
|
7
7
|
import {
|
|
8
8
|
clearCliLocalRuntimePreparedAgentCache
|
|
9
|
-
} from "./chunk-
|
|
9
|
+
} from "./chunk-DHRPLRIR.js";
|
|
10
10
|
import {
|
|
11
11
|
readCredentialAvailability
|
|
12
|
-
} from "./chunk-
|
|
12
|
+
} from "./chunk-GIXWVN2W.js";
|
|
13
13
|
import {
|
|
14
14
|
BIGMODEL_PROVIDER_TARGET,
|
|
15
15
|
buildCredentialUseGrant,
|
|
@@ -25,7 +25,7 @@ import {
|
|
|
25
25
|
resolveAgentRecordFromHybridStore,
|
|
26
26
|
sanitizeAgentRecordForCliOutput,
|
|
27
27
|
writeAgentRecord
|
|
28
|
-
} from "./chunk-
|
|
28
|
+
} from "./chunk-UFGUJ2IH.js";
|
|
29
29
|
import {
|
|
30
30
|
resolveCliAgentKeyInput
|
|
31
31
|
} from "./chunk-BR3GT6MR.js";
|
|
@@ -256,7 +256,7 @@ async function runAgentCreateCommand(args, deps = {}) {
|
|
|
256
256
|
let verifyResult;
|
|
257
257
|
if (parsed.verify) {
|
|
258
258
|
try {
|
|
259
|
-
const { verifyCustomProvider } = await import("./agentProviderCommands-
|
|
259
|
+
const { verifyCustomProvider } = await import("./agentProviderCommands-QLTABYR7.js");
|
|
260
260
|
const rec = built.nextRecord;
|
|
261
261
|
const verifyCredentialRef = typeof rec.credentialRef === "string" && rec.credentialRef.trim() ? rec.credentialRef.trim() : "";
|
|
262
262
|
if (verifyCredentialRef) {
|