nolo-cli 0.251.0-alpha.1 → 0.252.0-alpha.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/{_executeModel-55PHWQWB.js → _executeModel-RXHY2BDR.js} +47 -47
- package/{action-WZTKEF5H.js → action-4MADDU52.js} +5 -5
- package/{addContentAction-LBVAQUF7.js → addContentAction-F4XO3VRF.js} +8 -8
- package/{addDialogAgentAction-6WAUSUSZ.js → addDialogAgentAction-NSCVHTZJ.js} +7 -7
- package/{agentDeleteCommand-KEO3KDK3.js → agentDeleteCommand-EJAI2VTH.js} +69 -68
- package/{agentEmailCommands-RWJQQRNT.js → agentEmailCommands-YBKHZMMZ.js} +69 -68
- package/{agentListCommands-L3TLPLNH.js → agentListCommands-M2KYLAOB.js} +226 -39
- package/{agentMachineCommands-EZWWXWDH.js → agentMachineCommands-GLY6NJWZ.js} +31 -29
- package/{agentProviderCommands-C5T7C5KZ.js → agentProviderCommands-QLTABYR7.js} +2 -2
- package/{agentRecordCommands-7W2CGHJJ.js → agentRecordCommands-JANPX6XI.js} +68 -67
- package/{agentRunCommand-POL6B6BO.js → agentRunCommand-TNLAXLUU.js} +68 -67
- package/{agentRunControl-FKSXBUAF.js → agentRunControl-KNNDEEDI.js} +8 -6
- package/{agentRuntimeLocal-WSHWNIMF.js → agentRuntimeLocal-EOW6FFXL.js} +26 -25
- package/{agentSlice-3G2YLTA4.js → agentSlice-PVFGBJXB.js} +8 -8
- package/{appDeleteCommands-DZZQCVYH.js → appDeleteCommands-3VCRRWUX.js} +33 -31
- package/{appDeployCommands-NJJBVNH5.js → appDeployCommands-XN6IEMYK.js} +33 -31
- package/{appDeployStatusCommands-GBOAFEYG.js → appDeployStatusCommands-ZSJJXMVR.js} +33 -31
- package/{appGetCommands-GOOKYMKO.js → appGetCommands-DJ7YQCEE.js} +33 -31
- package/{appListCommands-OBCGUG3S.js → appListCommands-4KU5CV5H.js} +33 -31
- package/{authCommand-77CRN332.js → authCommand-5DC3ES4Q.js} +12 -12
- package/{builtinSkillRegistry-PFTTFPWW.js → builtinSkillRegistry-PQWEXSFW.js} +1 -1
- package/{chromeOpsCommands-6RLEBBJJ.js → chromeOpsCommands-AA555ANS.js} +1 -1
- package/{chunk-LOXR4TQN.js → chunk-25GCVHBZ.js} +2 -2
- package/{chunk-A55E2OCP.js → chunk-26KL6533.js} +639 -125
- package/{chunk-MAA42MMV.js → chunk-2FZVXOFX.js} +4 -4
- package/{chunk-CUYFRVJF.js → chunk-2HF6DINU.js} +6 -6
- package/{chunk-ESN4WNWU.js → chunk-2JHGUL5K.js} +2 -2
- package/{chunk-GMWZRXRM.js → chunk-3272HU62.js} +1 -1
- package/{chunk-43VT5PLM.js → chunk-3LL5HRIJ.js} +1 -1
- package/{chunk-ZQ6K57FJ.js → chunk-4YPH5KRA.js} +1 -1
- package/{chunk-T4V6C3J3.js → chunk-52M4RYVP.js} +1 -1
- package/{chunk-OQCAHPDQ.js → chunk-5QEOTC35.js} +4 -4
- package/{chunk-R7D5SRAZ.js → chunk-5UYDG6HP.js} +17 -0
- package/{chunk-Z7A2ZQ5X.js → chunk-64ACTEAE.js} +1 -1
- package/{chunk-CTWCZKNS.js → chunk-6SOWMEAY.js} +4 -4
- package/{chunk-UCMUXZJV.js → chunk-7XO73H5X.js} +111 -1
- package/{chunk-222CJNC2.js → chunk-BLBGVSLB.js} +3 -3
- package/{chunk-ZM5AZTQG.js → chunk-BTQU2PRC.js} +19 -7
- package/{chunk-QJ5YDTEF.js → chunk-BVCCRSGK.js} +42 -24
- package/{chunk-SX6AWTNK.js → chunk-BZLGPM5B.js} +3 -3
- package/chunk-CGSIW2KI.js +594 -0
- package/{chunk-LTVEOOZL.js → chunk-CIAV4WK2.js} +14 -1
- package/{chunk-Q5KZ6F55.js → chunk-CSTCYYCR.js} +19 -17
- package/{chunk-D3E5MYXO.js → chunk-CYGFNMCH.js} +1 -1
- package/{chunk-MZVCFV3T.js → chunk-D3WOFN6N.js} +3 -3
- package/{chunk-VUHKG4KS.js → chunk-DNNPARJK.js} +9 -5
- package/{chunk-MTS5DCL2.js → chunk-EG3JTV7H.js} +2 -2
- package/{chunk-6ASGEP5D.js → chunk-EJQE5HB7.js} +1 -1
- package/{chunk-D35TOEMM.js → chunk-EPBEZKYK.js} +137 -53
- package/{chunk-KJDN2YRH.js → chunk-EQJK6LSN.js} +4 -4
- package/{chunk-N3SEV3CG.js → chunk-F6GZFIGR.js} +79 -30
- package/{chunk-6UNJ6JGR.js → chunk-FJPVVLP3.js} +4 -4
- package/{chunk-L5HV76QT.js → chunk-FRC2DNTN.js} +1 -1
- package/{chunk-W3HSD32M.js → chunk-FXEPZKNJ.js} +2 -2
- package/{chunk-WWTSEBDF.js → chunk-GIXWVN2W.js} +1 -1
- package/{chunk-IFJ6OTI6.js → chunk-GJ4UTSAW.js} +33 -11
- package/{chunk-ZKKJZBNO.js → chunk-GUFTHWDO.js} +10 -10
- package/{chunk-KHVTT4WW.js → chunk-HF4C5WIU.js} +81 -542
- package/{chunk-W2N4OAKM.js → chunk-IQXMWBI6.js} +3 -3
- package/chunk-IVK2KT3H.js +209 -0
- package/{chunk-PLS2MJVW.js → chunk-J4KLOLYP.js} +4 -4
- package/{chunk-PQ63BDV3.js → chunk-JPXACKSW.js} +9 -1
- package/{chunk-CDIRKCPD.js → chunk-JX2IG37T.js} +153 -153
- package/{chunk-TGKAUEV3.js → chunk-K7RWY7JH.js} +14 -11
- package/{chunk-5IKKSJYX.js → chunk-KHYSFS3W.js} +76 -2
- package/{chunk-K5CIMK3R.js → chunk-KO6JNZCF.js} +115 -57
- package/{chunk-XJSEST7D.js → chunk-KQBGXCKM.js} +3 -3
- package/{chunk-HS7MLR74.js → chunk-KZ4A7EIV.js} +3 -5
- package/{chunk-QJTZ76CP.js → chunk-LS5KAVFQ.js} +1 -0
- package/{chunk-K26XPZRB.js → chunk-LVZVSLKO.js} +29 -9
- package/{chunk-HD5EKSLF.js → chunk-MDWHMQON.js} +3 -3
- package/{chunk-X337N4D6.js → chunk-MOAVLCCM.js} +4 -4
- package/{chunk-OARYOLF3.js → chunk-N2MDL5AZ.js} +12 -12
- package/{chunk-ZSRR6HCH.js → chunk-N2ZAY2DK.js} +1 -1
- package/{chunk-X3OZ655T.js → chunk-N7UXTVAR.js} +2 -2
- package/{chunk-KGOBJAWC.js → chunk-NJDOID7N.js} +207 -94
- package/{chunk-NTNX77FI.js → chunk-NRWZHHOB.js} +6 -6
- package/{chunk-3ZWJVKFB.js → chunk-NWZRCUHM.js} +84 -40
- package/{chunk-HQLCYPL4.js → chunk-OB4FBZXJ.js} +4 -4
- package/{chunk-CD2DK5JA.js → chunk-OKH74FML.js} +2 -1
- package/{chunk-IZWGO2ZS.js → chunk-OMIXG25B.js} +1 -1
- package/{chunk-CJ2BP6V7.js → chunk-OOV5JN25.js} +2 -2
- package/{chunk-3KWJPTVP.js → chunk-OQOXDQLB.js} +4 -4
- package/{chunk-LXKK7QFI.js → chunk-OTNPEE4G.js} +54 -24
- package/{chunk-LMMRWGGJ.js → chunk-OTOPQXP5.js} +2 -2
- package/{chunk-AS6L5KSD.js → chunk-P4R5KXU7.js} +2 -2
- package/{chunk-VTHWBTRE.js → chunk-PENRYZ4D.js} +1 -1
- package/{chunk-WZPG63Q4.js → chunk-PIVTQRX6.js} +43 -13
- package/{chunk-SLUZ6FBJ.js → chunk-Q5M27DUE.js} +1 -1
- package/{chunk-XC5RPSXK.js → chunk-QV32GSVO.js} +2 -2
- package/{chunk-WQDTSK5U.js → chunk-REINTCQF.js} +8 -2
- package/{chunk-IXAGRTAR.js → chunk-SBBSUBY3.js} +1 -1
- package/{chunk-MTM4LRVG.js → chunk-SCY2O7CU.js} +2 -2
- package/{chunk-FAFDIQJG.js → chunk-U3ZK2MXG.js} +3 -3
- package/{chunk-PKMDYRAM.js → chunk-UDQZ5JT7.js} +175 -241
- package/{chunk-UR4ZMRV3.js → chunk-UGHNYYOE.js} +2 -2
- package/{chunk-KZVRPCOR.js → chunk-UTFTXJU3.js} +4 -4
- package/{chunk-GX6DITLQ.js → chunk-UUCYUN6Y.js} +1 -1
- package/{chunk-U2OWDHDE.js → chunk-VH7AQEEF.js} +2 -2
- package/{chunk-QLGL43SI.js → chunk-VZWYP7LD.js} +2 -2
- package/{chunk-6XVPMGXK.js → chunk-W4S5FQWQ.js} +10 -4
- package/{chunk-KRAPKTAS.js → chunk-WJOC3AEM.js} +2 -2
- package/{chunk-2FK2KZSL.js → chunk-WLHUANWZ.js} +1 -1
- package/{chunk-JUYI2D7J.js → chunk-WNIBQBOR.js} +1 -1
- package/{chunk-BQ4CZEVZ.js → chunk-YWLMUFZ5.js} +1 -1
- package/{chunk-CD64YXRB.js → chunk-Z47UZT27.js} +1 -1
- package/{chunk-75TXQ4GY.js → chunk-ZMWDHPNG.js} +15 -29
- package/{chunk-CFDOIIOZ.js → chunk-ZMXO5G3E.js} +29 -23
- package/{cliAgentConfigHelpers-N6LTB7UY.js → cliAgentConfigHelpers-FKBPFPKR.js} +6 -6
- package/{cliLocalAgentRecordReader-NFNGYOOW.js → cliLocalAgentRecordReader-OHAC4JTY.js} +30 -29
- package/{commandRegistry-OM5DU4DS.js → commandRegistry-YQMAXCLP.js} +81 -81
- package/{contentThunks-7URM43ET.js → contentThunks-GSMUNWBA.js} +20 -20
- package/{cooldownCommands-JEEV75B7.js → cooldownCommands-PT5L4LNB.js} +3 -3
- package/{createAgentAutomationAction-GGEXIKMC.js → createAgentAutomationAction-RMADR4LG.js} +20 -20
- package/{createDialogAction-IXXEMFRQ.js → createDialogAction-CM5CBQVH.js} +21 -21
- package/{createPageAction-IXIVLIOO.js → createPageAction-JMGVMCTH.js} +21 -21
- package/{db-J5KE7XRI.js → db-VR74ADGC.js} +5 -1
- package/{dbSlice-IE4ADINL.js → dbSlice-Q637QR4L.js} +7 -7
- package/{deleteFile-ZCQESEEQ.js → deleteFile-TP6MKFUX.js} +10 -5
- package/{dialogCommands-RPBHOZB6.js → dialogCommands-ULWP5ASX.js} +35 -33
- package/{dialogNotifyCommand-ECKI5MMA.js → dialogNotifyCommand-JKYVSR6K.js} +7 -7
- package/{dialogSlice-5FQB2TNN.js → dialogSlice-ARQKXXTD.js} +18 -18
- package/{docCreateCommands-XJ2X57DW.js → docCreateCommands-ZJFHCZV4.js} +32 -30
- package/{docDeleteCommands-45WGFFEB.js → docDeleteCommands-LY5MF2BI.js} +33 -31
- package/{docReadCommands-LRRVDS46.js → docReadCommands-4X2DHCNZ.js} +32 -30
- package/{docStore-SUAVM24F.js → docStore-QWRVKIRI.js} +8 -8
- package/{docUpdateCommands-QUYX6BVR.js → docUpdateCommands-5TIT7DAJ.js} +32 -30
- package/{getPricing-FCHYVRJU.js → getPricing-5BLZRPTM.js} +3 -3
- package/{handleSendMessageAction-FDIWBQUB.js → handleSendMessageAction-TVR55KVT.js} +36 -36
- package/{hostCredentialCreate-CEXQHYT4.js → hostCredentialCreate-SIRXPUFR.js} +68 -67
- package/index.js +8 -8
- package/{localDialogRead-USDZXKIL.js → localDialogRead-BJJT3TF5.js} +1 -1
- package/{localRuntimeAdapter-O3JBRK6S.js → localRuntimeAdapter-VRB5EDDZ.js} +67 -66
- package/{machineCommands-I3YA7TNC.js → machineCommands-MG3BB6XM.js} +68 -67
- package/{machineWsRunDispatch-E5CIE2OJ.js → machineWsRunDispatch-3TOO3NCU.js} +68 -67
- package/{mcpLocalAuthorizeCommand-K5J2VMG6.js → mcpLocalAuthorizeCommand-LO7E4VQ5.js} +6 -6
- package/{memberThunks-T7EAZE6A.js → memberThunks-IGYRMEQC.js} +9 -9
- package/{models-EP7VG6N2.js → models-ZX2BYIMB.js} +2 -2
- package/package.json +1 -1
- package/{projectArchive-A7E65AZO.js → projectArchive-Q46BYZQ6.js} +21 -21
- package/{providerPresetApply-4H7YP5D7.js → providerPresetApply-NTJUINI6.js} +35 -16
- package/{providerRegistry-F3UPOTIY.js → providerRegistry-W45SLUV6.js} +5 -5
- package/{read-BRZHXUJ6.js → read-MPPXZHAO.js} +10 -5
- package/{readDocTool-N7RVFQEE.js → readDocTool-PKZ35PCR.js} +1 -1
- package/{readlineWorkspace-2O65NBFG.js → readlineWorkspace-RBH6PSE7.js} +613 -209
- package/{removeDialogAgentAction-GRT72HLK.js → removeDialogAgentAction-H6S7VLNA.js} +9 -9
- package/{runAgentClientLoop-NWCZIXCG.js → runAgentClientLoop-WZJ4HXOH.js} +44 -44
- package/{runtimeDoctorCommands-26HYHFTK.js → runtimeDoctorCommands-QGZSKNSE.js} +5 -5
- package/{secretCommands-XR72SHLK.js → secretCommands-BXAQEOES.js} +2 -2
- package/{setDialogExtraReferencesAction-CBG3X46B.js → setDialogExtraReferencesAction-CARUTAWS.js} +8 -8
- package/{setPrimaryDialogAgentAction-EWTDZOAX.js → setPrimaryDialogAgentAction-VRV56MLG.js} +9 -9
- package/{settingThunks-X4PT66J2.js → settingThunks-4FC4HXGN.js} +7 -7
- package/{spaceCommands-EVSNTGRS.js → spaceCommands-27Z5JAU3.js} +31 -29
- package/{streamAgentChatTurn-SYP3OEM5.js → streamAgentChatTurn-JKMBFM2O.js} +57 -53
- package/{switchDialogAgentAction-YHPZ7K6E.js → switchDialogAgentAction-O236K6HB.js} +7 -7
- package/{tableCommands-44GC4N6J.js → tableCommands-C3P2HHKK.js} +2 -2
- package/{tools-2AO2SK4L.js → tools-4RFLNHUW.js} +37 -37
- package/{tuiRestart-HBQDF4AE.js → tuiRestart-GF4DGAAN.js} +7 -7
- package/{tuiSummaryLlmCaller-Q2PNR63K.js → tuiSummaryLlmCaller-HROLGN4F.js} +12 -12
- package/{updateCommands-6SI7NWVC.js → updateCommands-BZ4YDHNM.js} +3 -3
- package/{updateDialogTitleAction-MWVMBIPZ.js → updateDialogTitleAction-F3ONQM3N.js} +20 -20
- package/{usageCommand-D44AOTMH.js → usageCommand-XVJ7ZUTM.js} +1 -1
- package/{usageRebuildCommand-IRIMKDI5.js → usageRebuildCommand-NK6S3D4J.js} +2 -2
- package/{windowsSelfUpdate-BJIJKKIS.js → windowsSelfUpdate-4BAXX7C3.js} +2 -2
- package/{workloadLifecycle-ZCSQCHG3.js → workloadLifecycle-DYX5ZMAT.js} +2 -2
- package/chunk-FGHEF6WI.js +0 -34
- package/{chunk-ANUP75N2.js → chunk-2E4BYAUE.js} +0 -0
- package/{chunk-YHNUDTU4.js → chunk-VYRTLHIT.js} +3 -3
- package/{dialogUsageCommand-TBIA2QAF.js → dialogUsageCommand-IHAXS7DW.js} +3 -3
|
@@ -2,13 +2,13 @@ import {
|
|
|
2
2
|
deleteDialog,
|
|
3
3
|
runtime_default,
|
|
4
4
|
toast
|
|
5
|
-
} from "./chunk-
|
|
5
|
+
} from "./chunk-26KL6533.js";
|
|
6
6
|
import {
|
|
7
7
|
getAllMemberSpaces,
|
|
8
8
|
getCurrentSpaceId,
|
|
9
9
|
getCurrentSpaceIdRaw,
|
|
10
10
|
updateCurrentSpaceIfMatch
|
|
11
|
-
} from "./chunk-
|
|
11
|
+
} from "./chunk-SBBSUBY3.js";
|
|
12
12
|
import {
|
|
13
13
|
require_formatISO
|
|
14
14
|
} from "./chunk-UVLYNWIE.js";
|
|
@@ -23,7 +23,7 @@ import {
|
|
|
23
23
|
patchIndividualContentRecord,
|
|
24
24
|
readContentRecordForSpaceSync,
|
|
25
25
|
syncContentRecordSpaceId
|
|
26
|
-
} from "./chunk-
|
|
26
|
+
} from "./chunk-VZWYP7LD.js";
|
|
27
27
|
import {
|
|
28
28
|
createSpaceKey,
|
|
29
29
|
normalizeSpaceId
|
|
@@ -36,7 +36,7 @@ import {
|
|
|
36
36
|
uploadFileAction,
|
|
37
37
|
upsertSSREntity,
|
|
38
38
|
write
|
|
39
|
-
} from "./chunk-
|
|
39
|
+
} from "./chunk-GJ4UTSAW.js";
|
|
40
40
|
import {
|
|
41
41
|
resolveFileCategory
|
|
42
42
|
} from "./chunk-3PVYUPXK.js";
|
|
@@ -50,13 +50,13 @@ import {
|
|
|
50
50
|
resolveReplicationServers,
|
|
51
51
|
scheduleDeleteReplication,
|
|
52
52
|
scheduleWriteReplication
|
|
53
|
-
} from "./chunk-
|
|
53
|
+
} from "./chunk-REINTCQF.js";
|
|
54
54
|
import {
|
|
55
55
|
createAsyncThunk
|
|
56
|
-
} from "./chunk-
|
|
56
|
+
} from "./chunk-W4S5FQWQ.js";
|
|
57
57
|
import {
|
|
58
58
|
getIsDesktopApp
|
|
59
|
-
} from "./chunk-
|
|
59
|
+
} from "./chunk-VYRTLHIT.js";
|
|
60
60
|
import {
|
|
61
61
|
createClientLogger
|
|
62
62
|
} from "./chunk-QQ56R7KS.js";
|
|
@@ -1513,11 +1513,11 @@ var ENTITY_DELETE_STRATEGIES = {
|
|
|
1513
1513
|
await dispatch(deleteTable({ dbKey: key })).unwrap();
|
|
1514
1514
|
},
|
|
1515
1515
|
file: async (key, { thunkAPI }) => {
|
|
1516
|
-
const { deleteFileAction } = await import("./deleteFile-
|
|
1516
|
+
const { deleteFileAction } = await import("./deleteFile-TP6MKFUX.js");
|
|
1517
1517
|
await deleteFileAction(key, thunkAPI);
|
|
1518
1518
|
},
|
|
1519
1519
|
image: async (key, { thunkAPI }) => {
|
|
1520
|
-
const { deleteFileAction } = await import("./deleteFile-
|
|
1520
|
+
const { deleteFileAction } = await import("./deleteFile-TP6MKFUX.js");
|
|
1521
1521
|
await deleteFileAction(key, thunkAPI);
|
|
1522
1522
|
},
|
|
1523
1523
|
agent: async (key, { dispatch, userId, sourceServerOrigin }) => {
|
|
@@ -2439,7 +2439,11 @@ var uploadOnce = async (payload, thunkAPI, userId) => {
|
|
|
2439
2439
|
fileName: file.name
|
|
2440
2440
|
});
|
|
2441
2441
|
const fileMetadata = await uploadFileAction(
|
|
2442
|
-
|
|
2442
|
+
// 这是「上传为 Space 资产」,不是「把个人文件收录进 Space」:
|
|
2443
|
+
// 明确声明 Space 归属,服务端校验成员身份后落库
|
|
2444
|
+
// `ownerType:"space"` + `ownerId:<spaceId>`,其他成员据此可读原件。
|
|
2445
|
+
// 声明只是请求,服务端(uploadOwnership.ts)才是归属权威。
|
|
2446
|
+
{ file, customKey: dbKey, userId, ownerType: "space", spaceId },
|
|
2443
2447
|
thunkAPI
|
|
2444
2448
|
);
|
|
2445
2449
|
if (!fileMetadata) {
|
|
@@ -2476,7 +2480,6 @@ var uploadOnce = async (payload, thunkAPI, userId) => {
|
|
|
2476
2480
|
title,
|
|
2477
2481
|
spaceId,
|
|
2478
2482
|
fileCategory,
|
|
2479
|
-
mimeType: file.type || void 0,
|
|
2480
2483
|
fileSize,
|
|
2481
2484
|
originalName: file.name
|
|
2482
2485
|
}
|
|
@@ -8,6 +8,12 @@ import {
|
|
|
8
8
|
Level,
|
|
9
9
|
createLevelAuthorityStore
|
|
10
10
|
} from "./chunk-R3MV2GII.js";
|
|
11
|
+
import {
|
|
12
|
+
Mutex
|
|
13
|
+
} from "./chunk-IVK2KT3H.js";
|
|
14
|
+
import {
|
|
15
|
+
isDialogRecordKey
|
|
16
|
+
} from "./chunk-OJKUU3LP.js";
|
|
11
17
|
import {
|
|
12
18
|
asTrimmedLowercaseString
|
|
13
19
|
} from "./chunk-QSJ3HFEF.js";
|
|
@@ -55,6 +61,74 @@ var SERVER_DB_ROLE_VIOLATION_MESSAGE = "\u5F53\u524D\u8FDB\u7A0B\u89D2\u8272\u4E
|
|
|
55
61
|
import fs from "fs";
|
|
56
62
|
import path from "path";
|
|
57
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
|
+
|
|
58
132
|
// packages/database-engine/memoryAuthorityStore.ts
|
|
59
133
|
var createNotFoundError = () => {
|
|
60
134
|
const error = new Error("NotFound");
|
|
@@ -396,10 +470,10 @@ function getOrCreateServerStoreRuntime(dbPath, options = {}) {
|
|
|
396
470
|
);
|
|
397
471
|
}
|
|
398
472
|
if (!globalScope.__serverAuthorityStore) {
|
|
399
|
-
globalScope.__serverAuthorityStore = createAuthorityStoreForDriver(
|
|
473
|
+
globalScope.__serverAuthorityStore = withPublicationBatch(createAuthorityStoreForDriver(
|
|
400
474
|
driver,
|
|
401
475
|
dbPath
|
|
402
|
-
);
|
|
476
|
+
));
|
|
403
477
|
globalScope.__serverAuthorityStoreDriver = driver;
|
|
404
478
|
} else if (!cachedDriver) {
|
|
405
479
|
globalScope.__serverAuthorityStoreDriver = driver;
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import {
|
|
2
2
|
getLocalProviderSecret
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-KZ4A7EIV.js";
|
|
4
4
|
import {
|
|
5
5
|
performServerProxyFetchWithRetry
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-2HF6DINU.js";
|
|
7
7
|
import {
|
|
8
8
|
fetchServerSyncedCredential
|
|
9
|
-
} from "./chunk-
|
|
9
|
+
} from "./chunk-BVCCRSGK.js";
|
|
10
10
|
import {
|
|
11
11
|
buildIdentityBlock,
|
|
12
12
|
buildPlatformStaticContextLayers,
|
|
@@ -15,7 +15,7 @@ import {
|
|
|
15
15
|
compileContextLayers,
|
|
16
16
|
detectDispatchIntentFromMessages,
|
|
17
17
|
resolveToolGuidedSections
|
|
18
|
-
} from "./chunk-
|
|
18
|
+
} from "./chunk-OTNPEE4G.js";
|
|
19
19
|
import {
|
|
20
20
|
convertMessagesToResponsesInput,
|
|
21
21
|
getUsageRequestOptions,
|
|
@@ -24,11 +24,15 @@ import {
|
|
|
24
24
|
resolveReasoningReplayOptions,
|
|
25
25
|
shouldStripReasoningContentForOutbound,
|
|
26
26
|
stablePromptCacheKey
|
|
27
|
-
} from "./chunk-
|
|
27
|
+
} from "./chunk-FXEPZKNJ.js";
|
|
28
28
|
import {
|
|
29
29
|
resolveAgentCallPlan,
|
|
30
30
|
resolveClientWire
|
|
31
|
-
} from "./chunk-
|
|
31
|
+
} from "./chunk-DNNPARJK.js";
|
|
32
|
+
import {
|
|
33
|
+
isGpt62DeveloperPrefixModel,
|
|
34
|
+
usesCodexDeveloperPrefix
|
|
35
|
+
} from "./chunk-CIAV4WK2.js";
|
|
32
36
|
import {
|
|
33
37
|
createFileCredentialBroker
|
|
34
38
|
} from "./chunk-E6A5NHDH.js";
|
|
@@ -41,7 +45,7 @@ import {
|
|
|
41
45
|
} from "./chunk-2SXN7LAY.js";
|
|
42
46
|
import {
|
|
43
47
|
buildSkillGuidancePromptBlock
|
|
44
|
-
} from "./chunk-
|
|
48
|
+
} from "./chunk-ZMWDHPNG.js";
|
|
45
49
|
import {
|
|
46
50
|
canonicalizeToolNames
|
|
47
51
|
} from "./chunk-YLAHYLDQ.js";
|
|
@@ -52,11 +56,13 @@ import {
|
|
|
52
56
|
toErrorMessage
|
|
53
57
|
} from "./chunk-HNMXYYJR.js";
|
|
54
58
|
import {
|
|
55
|
-
buildProviderAuthHeaders
|
|
56
|
-
|
|
59
|
+
buildProviderAuthHeaders,
|
|
60
|
+
isAgentCredentialShared,
|
|
61
|
+
resolveOutboundProxyApiKey
|
|
62
|
+
} from "./chunk-LVZVSLKO.js";
|
|
57
63
|
import {
|
|
58
64
|
OPENAI_RESPONSES_ENDPOINT
|
|
59
|
-
} from "./chunk-
|
|
65
|
+
} from "./chunk-2JHGUL5K.js";
|
|
60
66
|
import {
|
|
61
67
|
asTrimmedString
|
|
62
68
|
} from "./chunk-3EUW3WEO.js";
|
|
@@ -64,7 +70,7 @@ import {
|
|
|
64
70
|
clampReasoningEffort,
|
|
65
71
|
getModelConfig,
|
|
66
72
|
isModelSupportReasoningEffort
|
|
67
|
-
} from "./chunk-
|
|
73
|
+
} from "./chunk-OKH74FML.js";
|
|
68
74
|
import {
|
|
69
75
|
isRecord
|
|
70
76
|
} from "./chunk-KUG52IAP.js";
|
|
@@ -77,10 +83,10 @@ import {
|
|
|
77
83
|
import {
|
|
78
84
|
isDeepInfraKimiModel,
|
|
79
85
|
isFireworksKimiModel,
|
|
80
|
-
isPlatformMimoProviderModel,
|
|
81
86
|
resolveFireworksKimiModel,
|
|
82
|
-
resolvePlatformHostedRouting
|
|
83
|
-
|
|
87
|
+
resolvePlatformHostedRouting,
|
|
88
|
+
usesMimoThinkingWire
|
|
89
|
+
} from "./chunk-JPXACKSW.js";
|
|
84
90
|
import {
|
|
85
91
|
asTrimmedLowercaseString
|
|
86
92
|
} from "./chunk-QSJ3HFEF.js";
|
|
@@ -240,7 +246,11 @@ ${mainPrompt}` : "";
|
|
|
240
246
|
const agentTools = canonicalizeToolNames(agentConfig.tools ?? []);
|
|
241
247
|
const hasAskTool = agentTools.includes("ask_user");
|
|
242
248
|
const toolSections = resolveToolGuidedSections(agentTools, {
|
|
243
|
-
dispatchIntent: options.dispatchIntent === true
|
|
249
|
+
dispatchIntent: options.dispatchIntent === true,
|
|
250
|
+
// 安全透传:两者缺省均为 undefined,resolveToolGuidedSections 不追加任何文本,
|
|
251
|
+
// 因此未接线调用方拿到的 prompt 与既往逐字相同。
|
|
252
|
+
callerModel: options.callerModel,
|
|
253
|
+
externalAgentCount: options.externalAgentCount
|
|
244
254
|
});
|
|
245
255
|
const {
|
|
246
256
|
startupProtocol,
|
|
@@ -327,7 +337,7 @@ var applyClaudeCache = (stableContent, dynamicContent) => {
|
|
|
327
337
|
}
|
|
328
338
|
return parts.length > 0 ? parts : stableContent;
|
|
329
339
|
};
|
|
330
|
-
var prependPromptMessage = (messages, agentConfig, resolvedModel, language, contexts, prependSystemPrompt = true) => {
|
|
340
|
+
var prependPromptMessage = (messages, agentConfig, resolvedModel, language, contexts, prependSystemPrompt = true, preservePromptBoundary = false, preservePromptProvenance = preservePromptBoundary) => {
|
|
331
341
|
if (!prependSystemPrompt) return messages;
|
|
332
342
|
if (!contexts && !agentConfig.prompt) return messages;
|
|
333
343
|
const dispatchIntent = detectDispatchIntentFromMessages(messages);
|
|
@@ -341,25 +351,29 @@ var prependPromptMessage = (messages, agentConfig, resolvedModel, language, cont
|
|
|
341
351
|
const systemMessage2 = { role: "system", content };
|
|
342
352
|
return [systemMessage2, ...messages];
|
|
343
353
|
}
|
|
354
|
+
const promptProvenance = preservePromptProvenance && agentConfig.prompt?.trim() ? { agent_prompt_in_messages: true } : {};
|
|
355
|
+
if (preservePromptBoundary) {
|
|
356
|
+
const compiled = buildSystemPromptContext({ agentConfig, language, contexts, dispatchIntent });
|
|
357
|
+
if (!compiled.content.trim()) return messages;
|
|
358
|
+
return [{
|
|
359
|
+
role: "system",
|
|
360
|
+
content: compiled.content,
|
|
361
|
+
stable_prefix_chars: compiled.stablePrefixContent.length,
|
|
362
|
+
...promptProvenance
|
|
363
|
+
}, ...messages];
|
|
364
|
+
}
|
|
344
365
|
const promptContent = buildSystemPrompt({ agentConfig, language, contexts, dispatchIntent });
|
|
345
366
|
if (!promptContent.trim()) return messages;
|
|
346
|
-
const systemMessage = { role: "system", content: promptContent };
|
|
367
|
+
const systemMessage = { role: "system", content: promptContent, ...promptProvenance };
|
|
347
368
|
return [systemMessage, ...messages];
|
|
348
369
|
};
|
|
349
|
-
var
|
|
350
|
-
if (
|
|
351
|
-
|
|
352
|
-
return
|
|
353
|
-
};
|
|
354
|
-
var shouldDisableMiMoThinking = (agentConfig, resolvedModel) => {
|
|
355
|
-
if (agentConfig.enableThinking === true) return false;
|
|
356
|
-
if (/xiaomimimo\.com/i.test(agentConfig.customProviderUrl ?? "") || (agentConfig.provider ?? "").toLowerCase() === "mimo") {
|
|
357
|
-
return true;
|
|
358
|
-
}
|
|
359
|
-
return isPlatformMimoProviderModel(agentConfig.provider, resolvedModel);
|
|
370
|
+
var resolveLlamaCppThinkingToggle = (agentConfig) => {
|
|
371
|
+
if (!isLoopbackUrl(agentConfig.customProviderUrl) || !/qwen/i.test(agentConfig.model ?? "")) return void 0;
|
|
372
|
+
const effort = agentConfig.reasoning_effort?.toLowerCase();
|
|
373
|
+
return effort ? effort !== "none" && effort !== "off" : agentConfig.enableThinking ?? void 0;
|
|
360
374
|
};
|
|
361
375
|
var shouldDisableKimiThinking = (agentConfig, providerName, resolvedModel) => {
|
|
362
|
-
if (agentConfig.enableThinking !== false) return false;
|
|
376
|
+
if (agentConfig.reasoning_effort || agentConfig.enableThinking !== false) return false;
|
|
363
377
|
if (providerName === "deepinfra") return isDeepInfraKimiModel(resolvedModel);
|
|
364
378
|
if (providerName === "fireworks") return isFireworksKimiModel(resolvedModel);
|
|
365
379
|
return false;
|
|
@@ -396,6 +410,8 @@ var buildRequestBody = (options) => {
|
|
|
396
410
|
const {
|
|
397
411
|
model,
|
|
398
412
|
messages,
|
|
413
|
+
preservePromptBoundary,
|
|
414
|
+
preservePromptProvenance,
|
|
399
415
|
providerName,
|
|
400
416
|
customProviderUrl,
|
|
401
417
|
temperature,
|
|
@@ -406,13 +422,22 @@ var buildRequestBody = (options) => {
|
|
|
406
422
|
reasoning_effort,
|
|
407
423
|
shapingCounts
|
|
408
424
|
} = options;
|
|
409
|
-
const cleanedMessages = messages.map(
|
|
410
|
-
|
|
425
|
+
const cleanedMessages = messages.map((message) => {
|
|
426
|
+
const sanitized = sanitizeChatCompletionsMessage(message, {
|
|
411
427
|
provider: providerName,
|
|
412
428
|
model,
|
|
413
429
|
...shapingCounts ? { shapingCounts } : {}
|
|
414
|
-
})
|
|
415
|
-
|
|
430
|
+
});
|
|
431
|
+
if (message.role === "system") {
|
|
432
|
+
if (preservePromptBoundary && message.stable_prefix_chars !== void 0) {
|
|
433
|
+
sanitized.stable_prefix_chars = message.stable_prefix_chars;
|
|
434
|
+
}
|
|
435
|
+
if (preservePromptProvenance && message.agent_prompt_in_messages === true) {
|
|
436
|
+
sanitized.agent_prompt_in_messages = true;
|
|
437
|
+
}
|
|
438
|
+
}
|
|
439
|
+
return sanitized;
|
|
440
|
+
});
|
|
416
441
|
const bodyData = {
|
|
417
442
|
model,
|
|
418
443
|
messages: cleanedMessages,
|
|
@@ -443,7 +468,7 @@ var buildRequestBody = (options) => {
|
|
|
443
468
|
if (typeof max_tokens === "number") bodyData.max_tokens = max_tokens;
|
|
444
469
|
return bodyData;
|
|
445
470
|
};
|
|
446
|
-
var generateOpenAIRequestBody = (agentConfig, providerName, messages, contexts, stableMessages = [], prependSystemPrompt = true, shapingCounts) => {
|
|
471
|
+
var generateOpenAIRequestBody = (agentConfig, providerName, messages, contexts, stableMessages = [], prependSystemPrompt = true, shapingCounts, preservePromptBoundary = false, preservePromptProvenance = preservePromptBoundary) => {
|
|
447
472
|
const resolvedModel = providerName === "fireworks" ? resolveFireworksKimiModel(agentConfig.model) : agentConfig.model ?? "";
|
|
448
473
|
let processedStable = [...stableMessages];
|
|
449
474
|
if (isClaudeModel(resolvedModel) && processedStable.length > 0) {
|
|
@@ -475,11 +500,15 @@ var generateOpenAIRequestBody = (agentConfig, providerName, messages, contexts,
|
|
|
475
500
|
resolvedModel,
|
|
476
501
|
typeof navigator !== "undefined" ? navigator.language : "en",
|
|
477
502
|
contexts,
|
|
478
|
-
prependSystemPrompt
|
|
503
|
+
prependSystemPrompt,
|
|
504
|
+
preservePromptBoundary,
|
|
505
|
+
preservePromptProvenance
|
|
479
506
|
);
|
|
480
507
|
const requestBody = buildRequestBody({
|
|
481
508
|
model: resolvedModel,
|
|
482
509
|
messages: messagesWithPrompt,
|
|
510
|
+
preservePromptBoundary,
|
|
511
|
+
preservePromptProvenance,
|
|
483
512
|
providerName,
|
|
484
513
|
customProviderUrl: agentConfig.customProviderUrl,
|
|
485
514
|
temperature: agentConfig.temperature,
|
|
@@ -490,18 +519,28 @@ var generateOpenAIRequestBody = (agentConfig, providerName, messages, contexts,
|
|
|
490
519
|
reasoning_effort: agentConfig.reasoning_effort,
|
|
491
520
|
...shapingCounts ? { shapingCounts } : {}
|
|
492
521
|
});
|
|
493
|
-
|
|
522
|
+
const llamaCppThinking = resolveLlamaCppThinkingToggle(agentConfig);
|
|
523
|
+
if (llamaCppThinking !== void 0) {
|
|
524
|
+
delete requestBody.reasoning_effort;
|
|
494
525
|
requestBody.chat_template_kwargs = {
|
|
495
526
|
...requestBody.chat_template_kwargs ?? {},
|
|
496
|
-
enable_thinking:
|
|
527
|
+
enable_thinking: llamaCppThinking
|
|
497
528
|
};
|
|
498
529
|
}
|
|
499
|
-
if (
|
|
500
|
-
|
|
530
|
+
if (usesMimoThinkingWire(agentConfig.provider, resolvedModel, agentConfig.customProviderUrl)) {
|
|
531
|
+
const effort = agentConfig.reasoning_effort;
|
|
532
|
+
if (effort === "none" || effort === "off") {
|
|
533
|
+
requestBody.thinking = { type: "disabled" };
|
|
534
|
+
} else if (effort) {
|
|
535
|
+
const depth = clampReasoningEffort(effort, "mimo", resolvedModel);
|
|
536
|
+
if (depth) requestBody.reasoning_effort = depth;
|
|
537
|
+
} else if (agentConfig.enableThinking !== true) {
|
|
538
|
+
requestBody.thinking = { type: "disabled" };
|
|
539
|
+
}
|
|
501
540
|
}
|
|
502
541
|
if (shouldDisableKimiThinking(agentConfig, providerName, resolvedModel)) {
|
|
503
542
|
requestBody.thinking = { type: "disabled" };
|
|
504
|
-
requestBody.reasoning_effort = "none";
|
|
543
|
+
if (providerName !== "deepinfra") requestBody.reasoning_effort = "none";
|
|
505
544
|
requestBody.reasoning = { enabled: false };
|
|
506
545
|
}
|
|
507
546
|
return normalizeChatCompletionsBodyForProvider({
|
|
@@ -527,7 +566,7 @@ function usesGpt62DeveloperPrefix(agentConfig) {
|
|
|
527
566
|
} else if (provider !== "openai") {
|
|
528
567
|
return false;
|
|
529
568
|
}
|
|
530
|
-
return
|
|
569
|
+
return isGpt62DeveloperPrefixModel(model);
|
|
531
570
|
}
|
|
532
571
|
function resolveResponsesCompactionThreshold(agentConfig) {
|
|
533
572
|
const configured = Number(
|
|
@@ -752,9 +791,8 @@ var generateRequestBody = ({
|
|
|
752
791
|
agentConfig,
|
|
753
792
|
imageSettings.shouldEnableImage
|
|
754
793
|
);
|
|
755
|
-
const
|
|
756
|
-
|
|
757
|
-
);
|
|
794
|
+
const plan = resolveAgentCallPlan(agentConfigForRequest, {});
|
|
795
|
+
const clientWire = resolveClientWire(plan);
|
|
758
796
|
if (clientWire === "responses") {
|
|
759
797
|
const body = generateResponseRequestBody(
|
|
760
798
|
agentConfigForRequest,
|
|
@@ -775,13 +813,17 @@ var generateRequestBody = ({
|
|
|
775
813
|
);
|
|
776
814
|
return body;
|
|
777
815
|
}
|
|
816
|
+
const codexOAuth = plan.authMethod.kind === "oauth" && plan.authMethod.ref === "chatgpt";
|
|
778
817
|
const baseBody = generateOpenAIRequestBody(
|
|
779
818
|
agentConfigForRequest,
|
|
780
819
|
provider,
|
|
781
820
|
messages,
|
|
782
821
|
contexts,
|
|
783
822
|
stableMessages,
|
|
784
|
-
prependSystemPrompt
|
|
823
|
+
prependSystemPrompt,
|
|
824
|
+
void 0,
|
|
825
|
+
codexOAuth && usesCodexDeveloperPrefix(agentConfigForRequest, agentConfigForRequest.model),
|
|
826
|
+
codexOAuth
|
|
785
827
|
);
|
|
786
828
|
return applyImageConfigIfNeeded(baseBody, agentConfigForRequest, provider);
|
|
787
829
|
};
|
|
@@ -821,11 +863,11 @@ async function resolveDirectRequestApiKey(agentConfig, options) {
|
|
|
821
863
|
const broker = factory();
|
|
822
864
|
const local = await safeBrokerGet(broker, credentialRef);
|
|
823
865
|
if (local) return local;
|
|
824
|
-
if (credentialRef.startsWith("provider-key:") && options?.providerSecretFetcher) {
|
|
866
|
+
if (isAgentCredentialShared(agentConfig) && credentialRef.startsWith("provider-key:") && options?.providerSecretFetcher) {
|
|
825
867
|
const providerSecret = await options.providerSecretFetcher(credentialRef);
|
|
826
868
|
if (providerSecret) return providerSecret;
|
|
827
869
|
}
|
|
828
|
-
if (agentConfig
|
|
870
|
+
if (isAgentCredentialShared(agentConfig) && options?.syncFetcher) {
|
|
829
871
|
const synced = await options.syncFetcher(credentialRef);
|
|
830
872
|
const trimmed = asTrimmedString(synced);
|
|
831
873
|
if (trimmed) {
|
|
@@ -846,11 +888,11 @@ async function safeBrokerGet(broker, ref) {
|
|
|
846
888
|
}
|
|
847
889
|
}
|
|
848
890
|
|
|
849
|
-
// packages/ai/chat/
|
|
891
|
+
// packages/ai/chat/buildProxyPayload.ts
|
|
850
892
|
var buildProxyPayload = (bodyData, api, agentConfig, dialogId) => {
|
|
851
893
|
const apiSource = agentConfig.apiSource === "custom" || agentConfig.apiSource === "cli" ? agentConfig.apiSource : void 0;
|
|
852
894
|
const provider = bodyData.provider || agentConfig.provider || (apiSource === "custom" ? "custom" : void 0);
|
|
853
|
-
const apiKey =
|
|
895
|
+
const apiKey = resolveOutboundProxyApiKey(agentConfig);
|
|
854
896
|
return {
|
|
855
897
|
...bodyData,
|
|
856
898
|
url: api,
|
|
@@ -862,12 +904,14 @@ var buildProxyPayload = (bodyData, api, agentConfig, dialogId) => {
|
|
|
862
904
|
KEY: apiKey
|
|
863
905
|
};
|
|
864
906
|
};
|
|
907
|
+
|
|
908
|
+
// packages/ai/chat/fetchUtils.ts
|
|
865
909
|
var fetchDirectly = async (params) => {
|
|
866
910
|
const { api, agentConfig, bodyData, signal, currentServer, token, dialogId } = params;
|
|
867
911
|
try {
|
|
868
912
|
const apiKey = await resolveDirectRequestApiKey(agentConfig, {
|
|
869
913
|
syncFetcher: currentServer && token ? (ref) => fetchServerSyncedCredential({ currentServer, authToken: token }, ref) : void 0,
|
|
870
|
-
providerSecretFetcher: currentServer && token ? async (ref) => {
|
|
914
|
+
providerSecretFetcher: isAgentCredentialShared(agentConfig) && currentServer && token ? async (ref) => {
|
|
871
915
|
const presetId = ref.startsWith("provider-key:") ? ref.slice("provider-key:".length) : ref;
|
|
872
916
|
const local = getLocalProviderSecret(presetId);
|
|
873
917
|
if (local) return local;
|
|
@@ -951,19 +995,33 @@ var formatFriendlyNetworkErrorMessage = (error) => {
|
|
|
951
995
|
return rawMessage;
|
|
952
996
|
};
|
|
953
997
|
var performFetchRequest = async (params) => {
|
|
998
|
+
let direct = false;
|
|
954
999
|
try {
|
|
955
|
-
const
|
|
956
|
-
|
|
957
|
-
|
|
958
|
-
|
|
959
|
-
|
|
1000
|
+
const { agentConfig, bodyData } = params;
|
|
1001
|
+
const credentialRef = "credentialRef" in agentConfig && typeof agentConfig.credentialRef === "string" ? agentConfig.credentialRef : void 0;
|
|
1002
|
+
const plan = resolveAgentCallPlan({
|
|
1003
|
+
key: "",
|
|
1004
|
+
provider: bodyData.provider || agentConfig.provider,
|
|
1005
|
+
model: agentConfig.model,
|
|
1006
|
+
apiSource: agentConfig.apiSource,
|
|
1007
|
+
cliProvider: agentConfig.cliProvider ?? void 0,
|
|
1008
|
+
customProviderUrl: agentConfig.customProviderUrl,
|
|
1009
|
+
apiKey: agentConfig.apiKey ?? void 0,
|
|
1010
|
+
apiKeyRef: agentConfig.apiKeyRef,
|
|
1011
|
+
credentialRef,
|
|
1012
|
+
credentialSynced: agentConfig.credentialSynced,
|
|
1013
|
+
useServerProxy: agentConfig.useServerProxy
|
|
1014
|
+
}, void 0, { canResolveLocalCredential: true });
|
|
1015
|
+
direct = plan.transport === "direct";
|
|
1016
|
+
return direct ? await fetchDirectly(params) : await fetchWithServerProxy(params);
|
|
960
1017
|
} catch (error) {
|
|
961
1018
|
if (error instanceof DirectApiKeyResolutionError || error?.kind === "credential_missing") {
|
|
962
1019
|
throw error;
|
|
963
1020
|
}
|
|
964
1021
|
console.error("[performFetchRequest] \u8BF7\u6C42\u8FC7\u7A0B\u4E2D\u53D1\u751F\u9519\u8BEF:", error);
|
|
965
|
-
if (params.preserveStructuredError) throw error;
|
|
966
|
-
const
|
|
1022
|
+
if (params.preserveStructuredError || params.signal?.aborted || error?.name === "AbortError") throw error;
|
|
1023
|
+
const rawMessage = toErrorMessage(error);
|
|
1024
|
+
const friendlyMsg = direct && /failed to fetch|networkerror|network error|load failed/i.test(rawMessage) && !(typeof navigator !== "undefined" && navigator.onLine === false) ? "\u7F51\u7EDC\u8BF7\u6C42\u5931\u8D25\uFF1A\u6D4F\u89C8\u5668\u76F4\u8FDE\u670D\u52A1\u5546\u65F6\uFF0C\u53EF\u80FD\u88AB\u670D\u52A1\u5546\u7684\u8DE8\u57DF\u9650\u5236\uFF08CORS\uFF09\u62E6\u622A\u3002" : formatFriendlyNetworkErrorMessage(error);
|
|
967
1025
|
throw new Error(
|
|
968
1026
|
friendlyMsg.startsWith("\u7F51\u7EDC\u8BF7\u6C42\u5931\u8D25") ? friendlyMsg : `\u7F51\u7EDC\u8BF7\u6C42\u5931\u8D25: ${friendlyMsg}`
|
|
969
1027
|
);
|
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
import {
|
|
2
2
|
selectCurrentServer,
|
|
3
3
|
selectRemoteServers
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-SCY2O7CU.js";
|
|
5
5
|
import {
|
|
6
6
|
noloDeleteRequest,
|
|
7
7
|
noloWriteRequest
|
|
8
|
-
} from "./chunk-
|
|
8
|
+
} from "./chunk-W4S5FQWQ.js";
|
|
9
9
|
import {
|
|
10
10
|
normalizeTimeFields
|
|
11
|
-
} from "./chunk-
|
|
11
|
+
} from "./chunk-VYRTLHIT.js";
|
|
12
12
|
import {
|
|
13
13
|
selectIdentityUser,
|
|
14
14
|
selectIdentityUserId
|
|
@@ -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";
|