nolo-cli 0.16.0-alpha.16 → 0.16.0-alpha.18
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-UD2KY354.js → _executeModel-UREJOVS3.js} +39 -35
- package/{action-F5JACQBG.js → action-LT7BRFLK.js} +10 -9
- package/{addContentAction-AQXEYRBE.js → addContentAction-PL3KKBDH.js} +9 -8
- package/{addDialogAgentAction-EJHHJZWW.js → addDialogAgentAction-FCMSKYAF.js} +8 -7
- package/{agentDeleteCommand-UVL3YSRK.js → agentDeleteCommand-TJ2EAYDA.js} +27 -25
- package/{agentEmailCommands-77H4MECZ.js → agentEmailCommands-TOPVS5Q3.js} +50 -46
- package/{agentListCommands-J2F4E5C6.js → agentListCommands-WD5XYVGK.js} +25 -23
- package/{agentMachineCommands-DKDXHUDO.js → agentMachineCommands-24BLT7M4.js} +25 -23
- package/{agentPullCommand-6HWUT3SW.js → agentPullCommand-ZZGU5KOY.js} +4 -4
- package/{agentRecordCommands-KESYXWJZ.js → agentRecordCommands-FYRQB7SX.js} +45 -41
- package/{agentRunCommand-LZMUCDVH.js → agentRunCommand-TLW6PYPA.js} +46 -42
- package/{agentRuntimeLocal-44OVOJQ7.js → agentRuntimeLocal-K2J7IS6O.js} +18 -16
- package/{agentSlice-R4TX7ZSI.js → agentSlice-B6FQEOAF.js} +9 -8
- package/{appDeleteCommands-KXZCWKF2.js → appDeleteCommands-X7YGULGZ.js} +22 -20
- package/{appDeployCommands-JNXA3HP7.js → appDeployCommands-IMNPBUN7.js} +22 -20
- package/{appDeployStatusCommands-IZ225RMY.js → appDeployStatusCommands-2KFZUEET.js} +22 -20
- package/{appGetCommands-WALF7VTA.js → appGetCommands-AYG44S7G.js} +22 -20
- package/{appListCommands-Y3KMGFVO.js → appListCommands-Z7CLYPLH.js} +22 -20
- package/{authCommand-MSSBXCQ6.js → authCommand-WJZPOLSS.js} +9 -8
- package/{authCommands-YXGOXNBZ.js → authCommands-XTBV7OFZ.js} +6 -5
- package/{chunk-LBOJLRSS.js → chunk-37XKBS4O.js} +368 -320
- package/{chunk-XPC5C7BK.js → chunk-3ND52WIL.js} +2 -2
- package/{chunk-SOTZ6RDN.js → chunk-3Q7WHGCB.js} +1 -1
- package/{chunk-IPY6NKPP.js → chunk-4CQFPP2G.js} +9 -5
- package/{chunk-6N4KODMN.js → chunk-4T5F7YZQ.js} +1 -1
- package/{chunk-IRLFPNG7.js → chunk-5ICZUVFN.js} +2 -2
- package/chunk-7BUYEZ6U.js +671 -0
- package/{chunk-RADTZFVM.js → chunk-7TENCSE7.js} +40 -50
- package/{chunk-4PIVMGLG.js → chunk-A7QNCVO5.js} +10 -3
- package/{chunk-SR4IC7DS.js → chunk-B26VDWID.js} +2 -8
- package/{chunk-MTU75CZ2.js → chunk-B5TOXZAK.js} +1 -1
- package/{chunk-HYURMZU3.js → chunk-BLQ3U7UK.js} +3 -3
- package/{chunk-6HV3GSA4.js → chunk-BUTE3AHD.js} +6 -6
- package/{chunk-PXZY7NIS.js → chunk-C5SQSDB7.js} +6 -6
- package/{chunk-TX6S7JCM.js → chunk-C75ONZYN.js} +2 -2
- package/{chunk-UIVHASVR.js → chunk-CZAAQLAW.js} +3 -3
- package/{chunk-OSIJVBXP.js → chunk-DKZFOK24.js} +14 -85
- package/{chunk-IIHJMUV5.js → chunk-EGPCU42M.js} +6 -6
- package/{chunk-IWLUTMYX.js → chunk-ELT65PZW.js} +2 -2
- package/{chunk-X6LNYUFU.js → chunk-GO7R5K32.js} +5 -5
- package/{chunk-3ZLCL32L.js → chunk-I2NSE23G.js} +1 -1
- package/{chunk-SOW2GCA5.js → chunk-IOOMJJ4Z.js} +1 -1
- package/{setDialogExtraReferencesAction-LR6MSIXO.js → chunk-JLA4FXYC.js} +2 -17
- package/{chunk-FQLNGLOX.js → chunk-KO4PXGVN.js} +1 -1
- package/{chunk-ARJBFRBT.js → chunk-LP5UAY5I.js} +38 -54
- package/{chunk-QW7K3Y7V.js → chunk-LRYORNMJ.js} +63 -163
- package/{chunk-KFHN5NGJ.js → chunk-MVQ4TBSD.js} +1 -1
- package/{chunk-5PWAAPWU.js → chunk-OOKISU7J.js} +4 -4
- package/{chunk-Y62XMRMG.js → chunk-QCJITMYO.js} +10 -8
- package/{chunk-OOSFSFMA.js → chunk-R5V5G73M.js} +2 -0
- package/{chunk-EABWT43X.js → chunk-RVOUXDFU.js} +5 -5
- package/{chunk-JTINRTBT.js → chunk-SKDNBYZK.js} +2 -2
- package/{chunk-PVHN3TZV.js → chunk-TKV34RQ6.js} +138 -56
- package/{chunk-IAXU3LK5.js → chunk-TP6TE4L7.js} +16 -16
- package/{chunk-KMQPSTMJ.js → chunk-TRT4I4UD.js} +2 -2
- package/{chunk-YJKXGHJ6.js → chunk-UGUW3FHG.js} +4 -4
- package/{chunk-W4NVOSFF.js → chunk-WFHXMLHZ.js} +1 -1
- package/{chunk-H33743XH.js → chunk-WJRJDX2W.js} +1 -1
- package/chunk-X4Q4UZEY.js +26 -0
- package/{chunk-RPDGJO4D.js → chunk-XHG22OEX.js} +4 -4
- package/{chunk-DVRHHFEA.js → chunk-XMLRJUU5.js} +1 -1
- package/{chunk-3S2VOMIF.js → chunk-XRZJGPFI.js} +7 -7
- package/{chunk-DLH6BOUO.js → chunk-XU6XCPWB.js} +1 -1
- package/{chunk-NKN2NIW7.js → chunk-YEFSRF54.js} +10 -8
- package/chunk-ZZ2MH7LE.js +84 -0
- package/{cliExecutor-K3F7DMRO.js → cliExecutor-DNE7TCC4.js} +2 -2
- package/codingSkills-36KN5NQT.js +48 -0
- package/{createAgentAutomationAction-HXIGGMHG.js → createAgentAutomationAction-F62DAY54.js} +18 -17
- package/{createDialogAction-HDNEXHMH.js → createDialogAction-RPB6W3QN.js} +20 -19
- package/{createPageAction-F37QJEHE.js → createPageAction-APL7B2KC.js} +24 -23
- package/{dbSlice-7KQH6GOU.js → dbSlice-CGSRFJN3.js} +8 -7
- package/{deleteFile-WPWVZE4B.js → deleteFile-WDZ3VM7B.js} +3 -3
- package/{dialogCommands-6HHOMMSZ.js → dialogCommands-J7C6MB3Q.js} +23 -21
- package/{dialogSlice-ZCVFV3WX.js → dialogSlice-DMJVC2XX.js} +18 -17
- package/{docCreateCommands-C6DUOJZQ.js → docCreateCommands-Y7OSXNB6.js} +21 -19
- package/{docDeleteCommands-WAKYWSKE.js → docDeleteCommands-ALZGQRCE.js} +22 -20
- package/{docReadCommands-QXWKU7NB.js → docReadCommands-4BDDESGT.js} +21 -19
- package/{docStore-CSWTGKJJ.js → docStore-YAPW55HZ.js} +19 -18
- package/{docUpdateCommands-7AX4KLZZ.js → docUpdateCommands-LU2ZM2VE.js} +21 -19
- package/{fetchMessages-KTNM7QAR.js → fetchMessages-BMGVZVSE.js} +4 -3
- package/{handleSendMessageAction-3KHB7J7E.js → handleSendMessageAction-YDCWKDVY.js} +19 -18
- package/index.js +62 -62
- package/{localDialogRead-2VRI24F4.js → localDialogRead-HQZPVIE3.js} +1 -1
- package/{localRuntimeDb-LGDF6FQP.js → localRuntimeDb-THJZGAOJ.js} +1 -1
- package/{machineCommands-GKOAG4SD.js → machineCommands-QKGBDYER.js} +52 -48
- package/{machineWsRunDispatch-CBRB2L3Q.js → machineWsRunDispatch-25LT4UG6.js} +43 -39
- package/package.json +1 -1
- package/queryRunOverlay-O5IAGNXY.js +203 -0
- package/{read-CN3TNXIP.js → read-3FMPZPER.js} +3 -3
- package/{readDocTool-WF3675ED.js → readDocTool-VSYHKK3V.js} +1 -1
- package/{readlineWorkspace-LTW3NLCR.js → readlineWorkspace-U6UCWL4I.js} +66 -62
- package/{removeDialogAgentAction-YDHBFEGI.js → removeDialogAgentAction-OAGA2G3U.js} +10 -9
- package/{runAgentClientLoop-LVE52RH4.js → runAgentClientLoop-PDE63NNW.js} +35 -31
- package/runOverlayPresentation-BHD5POEM.js +79 -0
- package/{runtimeDoctorCommands-THIHX2SY.js → runtimeDoctorCommands-E2OUORHK.js} +6 -6
- package/setDialogExtraReferencesAction-JZEXA5SL.js +27 -0
- package/{setPrimaryDialogAgentAction-57GRIGX5.js → setPrimaryDialogAgentAction-4ZUQQKDG.js} +10 -9
- package/{settingSlice-O23YDK2O.js → settingSlice-7MNKHZ6R.js} +9 -8
- package/{spaceCommands-7RB3OWGN.js → spaceCommands-UG4QHSHD.js} +24 -22
- package/{spaceSlice-HLNFOVCA.js → spaceSlice-DPX4F5V3.js} +18 -17
- package/{streamAgentChatTurn-VS5W3C3N.js → streamAgentChatTurn-LYN66RLC.js} +66 -41
- package/{tableCommands-3P7MJ3PF.js → tableCommands-BEQAGE4I.js} +1 -1
- package/{tools-RWQXREN7.js → tools-VAJZFXRP.js} +29 -25
- package/types-ZSTJ7MPR.js +7 -0
- package/{updateDialogTitleAction-C6WFIIAW.js → updateDialogTitleAction-LE7SCNSB.js} +21 -20
- package/{chunk-O4BU24WZ.js → chunk-6Y7A3OQQ.js} +3 -3
- package/{chunk-CMKUBIGW.js → chunk-X7W4TNB4.js} +3 -3
- package/{localRuntimeAuthority-TEGCOWX4.js → localRuntimeAuthority-4IXJCHZ7.js} +3 -3
|
@@ -2,26 +2,23 @@ import {
|
|
|
2
2
|
BUILTIN_SUMMARY_LLM_CONFIG,
|
|
3
3
|
buildBuiltinSummaryContent
|
|
4
4
|
} from "./chunk-XOIF2TNF.js";
|
|
5
|
-
import {
|
|
6
|
-
authRoutes
|
|
7
|
-
} from "./chunk-MRC4Q34M.js";
|
|
8
5
|
import {
|
|
9
6
|
buildDialogAttachmentPlan,
|
|
10
7
|
extractFileContentIds
|
|
11
|
-
} from "./chunk-
|
|
8
|
+
} from "./chunk-B5TOXZAK.js";
|
|
12
9
|
import {
|
|
13
|
-
|
|
14
|
-
} from "./chunk-
|
|
10
|
+
authRoutes
|
|
11
|
+
} from "./chunk-MRC4Q34M.js";
|
|
15
12
|
import {
|
|
16
13
|
deleteServerSyncedCredential,
|
|
17
14
|
runLlm
|
|
18
|
-
} from "./chunk-
|
|
15
|
+
} from "./chunk-C5SQSDB7.js";
|
|
19
16
|
import {
|
|
20
|
-
|
|
21
|
-
} from "./chunk-
|
|
17
|
+
getApproxPricePerImage
|
|
18
|
+
} from "./chunk-CWMSB67P.js";
|
|
22
19
|
import {
|
|
23
|
-
|
|
24
|
-
} from "./chunk-
|
|
20
|
+
cleanupCliSessionForDialog
|
|
21
|
+
} from "./chunk-XHG22OEX.js";
|
|
25
22
|
import {
|
|
26
23
|
getDialogAgentIds,
|
|
27
24
|
getPrimaryDialogAgentId
|
|
@@ -29,6 +26,9 @@ import {
|
|
|
29
26
|
import {
|
|
30
27
|
require_date_fns
|
|
31
28
|
} from "./chunk-M76ECQRD.js";
|
|
29
|
+
import {
|
|
30
|
+
fetchMessages
|
|
31
|
+
} from "./chunk-3Q7WHGCB.js";
|
|
32
32
|
import {
|
|
33
33
|
DEFAULT_AUTO_EXECUTION_PROFILE,
|
|
34
34
|
DEFAULT_CONTEXT_WINDOW,
|
|
@@ -38,14 +38,25 @@ import {
|
|
|
38
38
|
planCompression,
|
|
39
39
|
resolveAutoExecutionProfile,
|
|
40
40
|
serializeMessageContent
|
|
41
|
-
} from "./chunk-
|
|
41
|
+
} from "./chunk-EGPCU42M.js";
|
|
42
|
+
import {
|
|
43
|
+
createFileCredentialBroker
|
|
44
|
+
} from "./chunk-5CS33IBL.js";
|
|
42
45
|
import {
|
|
43
46
|
findModelConfig,
|
|
44
47
|
getModelConfig
|
|
45
48
|
} from "./chunk-HQPG2PIV.js";
|
|
46
49
|
import {
|
|
47
|
-
|
|
48
|
-
} from "./chunk-
|
|
50
|
+
toErrorMessage
|
|
51
|
+
} from "./chunk-HNMXYYJR.js";
|
|
52
|
+
import {
|
|
53
|
+
UNCATEGORIZED_ID,
|
|
54
|
+
addContentAction,
|
|
55
|
+
checkSpaceMembership,
|
|
56
|
+
createSpaceKey,
|
|
57
|
+
localSpaceAuthorityPatchStamp,
|
|
58
|
+
normalizeSpaceId
|
|
59
|
+
} from "./chunk-ELT65PZW.js";
|
|
49
60
|
import {
|
|
50
61
|
extractCustomId,
|
|
51
62
|
extractUserId
|
|
@@ -67,27 +78,16 @@ import {
|
|
|
67
78
|
setActiveDialogKey,
|
|
68
79
|
setDialogConfigError
|
|
69
80
|
} from "./chunk-3ASDTTEI.js";
|
|
70
|
-
import {
|
|
71
|
-
toErrorMessage
|
|
72
|
-
} from "./chunk-HNMXYYJR.js";
|
|
73
81
|
import {
|
|
74
82
|
isSystemAdmin,
|
|
75
83
|
nolotusId,
|
|
76
84
|
selectRemoteServer,
|
|
77
85
|
selectRemoteServers,
|
|
78
86
|
selectRemoteSyncServers
|
|
79
|
-
} from "./chunk-
|
|
87
|
+
} from "./chunk-RVOUXDFU.js";
|
|
80
88
|
import {
|
|
81
89
|
asRecordOrEmpty
|
|
82
90
|
} from "./chunk-KX6YBIHG.js";
|
|
83
|
-
import {
|
|
84
|
-
UNCATEGORIZED_ID,
|
|
85
|
-
addContentAction,
|
|
86
|
-
checkSpaceMembership,
|
|
87
|
-
createSpaceKey,
|
|
88
|
-
localSpaceAuthorityPatchStamp,
|
|
89
|
-
normalizeSpaceId
|
|
90
|
-
} from "./chunk-IWLUTMYX.js";
|
|
91
91
|
import {
|
|
92
92
|
patch,
|
|
93
93
|
read,
|
|
@@ -100,7 +100,7 @@ import {
|
|
|
100
100
|
uploadFileAction,
|
|
101
101
|
upsertSSREntity,
|
|
102
102
|
write
|
|
103
|
-
} from "./chunk-
|
|
103
|
+
} from "./chunk-XRZJGPFI.js";
|
|
104
104
|
import {
|
|
105
105
|
DB_PREFIX,
|
|
106
106
|
SEPARATOR,
|
|
@@ -125,20 +125,20 @@ import {
|
|
|
125
125
|
splitKey,
|
|
126
126
|
toTrimmedString,
|
|
127
127
|
ulid
|
|
128
|
-
} from "./chunk-
|
|
128
|
+
} from "./chunk-6Y7A3OQQ.js";
|
|
129
|
+
import {
|
|
130
|
+
asOptionalFiniteNumber
|
|
131
|
+
} from "./chunk-WWC7I6TA.js";
|
|
129
132
|
import {
|
|
130
133
|
asNonEmptyStringArray,
|
|
131
134
|
asTrimmedNonEmptyStringArray
|
|
132
135
|
} from "./chunk-I42VC5KR.js";
|
|
133
|
-
import {
|
|
134
|
-
asOptionalFiniteNumber
|
|
135
|
-
} from "./chunk-WWC7I6TA.js";
|
|
136
136
|
import {
|
|
137
137
|
asTrimmedLowercaseString
|
|
138
138
|
} from "./chunk-QSJ3HFEF.js";
|
|
139
139
|
import {
|
|
140
140
|
readAction
|
|
141
|
-
} from "./chunk-
|
|
141
|
+
} from "./chunk-3ND52WIL.js";
|
|
142
142
|
import {
|
|
143
143
|
DEVICE_LOCAL_OWNER_ID,
|
|
144
144
|
asyncThunkCreator,
|
|
@@ -159,7 +159,7 @@ import {
|
|
|
159
159
|
selectIdentityToken,
|
|
160
160
|
selectIdentityUserId,
|
|
161
161
|
selectRuntimeSnapshot
|
|
162
|
-
} from "./chunk-
|
|
162
|
+
} from "./chunk-XMLRJUU5.js";
|
|
163
163
|
import {
|
|
164
164
|
createClientLogger,
|
|
165
165
|
fetchFromServer,
|
|
@@ -167,7 +167,7 @@ import {
|
|
|
167
167
|
getAllServers,
|
|
168
168
|
isAbortError,
|
|
169
169
|
logger
|
|
170
|
-
} from "./chunk-
|
|
170
|
+
} from "./chunk-R5V5G73M.js";
|
|
171
171
|
import {
|
|
172
172
|
buildTombstoneRecord,
|
|
173
173
|
isTombstoneRecord,
|
|
@@ -601,8 +601,8 @@ var require_react_dom = __commonJS({
|
|
|
601
601
|
}
|
|
602
602
|
try {
|
|
603
603
|
__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(checkDCE);
|
|
604
|
-
} catch (
|
|
605
|
-
console.error(
|
|
604
|
+
} catch (err2) {
|
|
605
|
+
console.error(err2);
|
|
606
606
|
}
|
|
607
607
|
}
|
|
608
608
|
if (process.env.NODE_ENV === "production") {
|
|
@@ -945,7 +945,7 @@ var require_core = __commonJS({
|
|
|
945
945
|
if (!crypto && typeof __require === "function") {
|
|
946
946
|
try {
|
|
947
947
|
crypto = __require("crypto");
|
|
948
|
-
} catch (
|
|
948
|
+
} catch (err2) {
|
|
949
949
|
}
|
|
950
950
|
}
|
|
951
951
|
var cryptoSecureRandomInt = function() {
|
|
@@ -953,13 +953,13 @@ var require_core = __commonJS({
|
|
|
953
953
|
if (typeof crypto.getRandomValues === "function") {
|
|
954
954
|
try {
|
|
955
955
|
return crypto.getRandomValues(new Uint32Array(1))[0];
|
|
956
|
-
} catch (
|
|
956
|
+
} catch (err2) {
|
|
957
957
|
}
|
|
958
958
|
}
|
|
959
959
|
if (typeof crypto.randomBytes === "function") {
|
|
960
960
|
try {
|
|
961
961
|
return crypto.randomBytes(4).readInt32LE();
|
|
962
|
-
} catch (
|
|
962
|
+
} catch (err2) {
|
|
963
963
|
}
|
|
964
964
|
}
|
|
965
965
|
}
|
|
@@ -3259,11 +3259,11 @@ var fetchConvMsgs = async (server, token, {
|
|
|
3259
3259
|
|
|
3260
3260
|
// packages/app/utils/async.ts
|
|
3261
3261
|
function swallowNonAbortError(promise, fallback, signal) {
|
|
3262
|
-
return promise.catch((
|
|
3263
|
-
if (isAbortError(
|
|
3264
|
-
throw
|
|
3262
|
+
return promise.catch((err2) => {
|
|
3263
|
+
if (isAbortError(err2) || signal?.aborted) {
|
|
3264
|
+
throw err2;
|
|
3265
3265
|
}
|
|
3266
|
-
console.error("Non-abort error in async op:",
|
|
3266
|
+
console.error("Non-abort error in async op:", err2);
|
|
3267
3267
|
return fallback;
|
|
3268
3268
|
});
|
|
3269
3269
|
}
|
|
@@ -3567,8 +3567,8 @@ var updateDialogSummaryAction = async (args, thunkApi) => {
|
|
|
3567
3567
|
).unwrap();
|
|
3568
3568
|
console.log(`[ContextCompression] Compressed ${plan.compressCount} messages. New summary len: ${newSummary.length}`);
|
|
3569
3569
|
}
|
|
3570
|
-
} catch (
|
|
3571
|
-
console.error("[ContextCompression] Failed:",
|
|
3570
|
+
} catch (err2) {
|
|
3571
|
+
console.error("[ContextCompression] Failed:", err2);
|
|
3572
3572
|
}
|
|
3573
3573
|
} finally {
|
|
3574
3574
|
summarizingDialogs.delete(dialogKey);
|
|
@@ -3627,7 +3627,7 @@ var normalizeAppRouteId = (contentKey) => isAppContentKey(contentKey) ? contentK
|
|
|
3627
3627
|
|
|
3628
3628
|
// packages/ai/tools/uiAskChoiceTool.ts
|
|
3629
3629
|
var uiAskChoiceFunctionSchema = {
|
|
3630
|
-
name: "
|
|
3630
|
+
name: "ask_user",
|
|
3631
3631
|
description: [
|
|
3632
3632
|
"\u8BA9\u7528\u6237\u5728 2\uFF5E5 \u4E2A\u4E92\u65A5\u9009\u9879\u4E4B\u95F4\u505A\u9009\u62E9\u7684\u901A\u7528\u201C\u51FA\u9009\u9879\u201D\u5DE5\u5177\u3002\u9002\u7528\u573A\u666F\uFF1A\u9700\u6C42\u6A21\u7CCA\u65F6\u7ED9\u65B9\u5411\u5019\u9009\u3001\u8BA1\u5212\u5206\u652F\u8282\u70B9\u51B3\u7B56\u3001\u51FA\u9898/\u95EE\u5377\u3001\u65B0\u4F1A\u8BDD\u529F\u80FD\u5BFC\u822A\u3002",
|
|
3633
3633
|
"\u8C03\u7528\u524D\u987B\u5148\u5728\u666E\u901A\u56DE\u590D\u6587\u672C\u91CC\u89E3\u91CA\u80CC\u666F\u4E0E\u6743\u8861\uFF08\u5148\u89E3\u91CA\uFF0C\u518D\u8C03\u7528\uFF09\u3002",
|
|
@@ -3637,6 +3637,11 @@ var uiAskChoiceFunctionSchema = {
|
|
|
3637
3637
|
"- \u6BCF\u4E2A question \u53EF\u4EE5\u8BBE\u7F6E multiSelect: true \u5141\u8BB8\u591A\u9009\u3002",
|
|
3638
3638
|
"- \u6BCF\u4E2A question \u53EF\u4EE5\u8BBE\u7F6E allowOther: false \u9690\u85CF\u201C\u5176\u4ED6\u201D\u8F93\u5165\u6846\u3002",
|
|
3639
3639
|
"- \u6BCF\u4E2A choice \u53EF\u4EE5\u52A0 detail \u5B57\u6BB5\u63D0\u4F9B\u66F4\u957F\u7684\u63CF\u8FF0\u3002",
|
|
3640
|
+
"- \u6BCF\u4E2A choice \u53EF\u4EE5\u52A0 recommended: true \u6807\u8BB0\u4F60\u7684\u63A8\u8350\u9879\uFF08\u6709\u660E\u786E\u63A8\u8350\u65F6\u7528\uFF09\u3002",
|
|
3641
|
+
"",
|
|
3642
|
+
"\u63A8\u8350 & \u6743\u8861\u8BF4\u660E\uFF1A",
|
|
3643
|
+
"- \u82E5\u6709\u660E\u786E\u63A8\u8350\u65B9\u5411\uFF0C\u628A\u5B83\u653E\u5728 choices \u7684\u7B2C\u4E00\u4F4D\uFF0C\u5E76\u7ED9\u8BE5\u9009\u9879\u6807 recommended: true\u3002",
|
|
3644
|
+
"- \u82E5\u6CA1\u6709\u660E\u786E\u63A8\u8350\u9879\uFF0C\u5219\u5728\u8C03\u7528\u524D\u7684\u666E\u901A\u56DE\u590D\u6587\u672C\u91CC\u7B80\u8981\u8BF4\u660E\u6BCF\u4E2A\u9009\u9879\u7684\u4F18\u7F3A\u70B9\uFF08\u6216\u5404\u9009\u9879\u7684\u5173\u952E\u5DEE\u5F02\uFF09\uFF0C\u5E2E\u52A9\u7528\u6237\u6743\u8861\uFF0C\u800C\u4E0D\u662F\u5217\u51FA\u9009\u9879\u5C31\u5B8C\u4E8B\u3002",
|
|
3640
3645
|
"",
|
|
3641
3646
|
"\u4F55\u65F6\u8C03\u7528 / \u8C03\u7528\u89C4\u8303\u7684\u5B8C\u6574\u884C\u4E3A\u89C4\u5219\u7531\u7CFB\u7EDF\u63D0\u793A\u7684\u300C\u4EA4\u4E92\u8BF4\u660E\u300D\u5757\u6CE8\u5165\uFF0C\u4E0D\u5728\u6B64\u91CD\u590D\u3002"
|
|
3642
3647
|
].join("\n"),
|
|
@@ -3665,6 +3670,13 @@ var uiAskChoiceFunctionSchema = {
|
|
|
3665
3670
|
type: "string",
|
|
3666
3671
|
description: "\u7B80\u77ED\u8865\u5145\uFF08\u5EFA\u8BAE\u4E00\u53E5\u8BDD\uFF09\uFF0C\u957F\u89E3\u91CA\u5199\u8FDB\u8C03\u7528\u524D\u7684\u56DE\u590D\u6587\u672C\u3002"
|
|
3667
3672
|
},
|
|
3673
|
+
recommended: {
|
|
3674
|
+
type: "boolean",
|
|
3675
|
+
description: [
|
|
3676
|
+
"\u6807\u8BB0\u8FD9\u662F\u4F60\u7684\u63A8\u8350\u9879\u3002\u6709\u660E\u786E\u63A8\u8350\u65F6\u628A\u8BE5\u9009\u9879\u653E\u5728 choices \u7B2C\u4E00\u4F4D\u5E76\u7F6E true\u3002",
|
|
3677
|
+
"\u6CA1\u6709\u660E\u786E\u63A8\u8350\u65F6\u4E0D\u8981\u8BBE\u7F6E\uFF08\u9ED8\u8BA4 false\uFF09\uFF0C\u5E76\u5728\u8C03\u7528\u524D\u6587\u672C\u91CC\u8BF4\u660E\u5404\u9009\u9879\u4F18\u7F3A\u70B9\u3002"
|
|
3678
|
+
].join(" ")
|
|
3679
|
+
},
|
|
3668
3680
|
userMessage: {
|
|
3669
3681
|
type: "string",
|
|
3670
3682
|
description: [
|
|
@@ -3703,6 +3715,10 @@ var uiAskChoiceFunctionSchema = {
|
|
|
3703
3715
|
type: "string",
|
|
3704
3716
|
description: "\u7B80\u77ED\u8865\u5145\uFF08\u5EFA\u8BAE\u4E00\u53E5\u8BDD\uFF09\uFF0C\u957F\u89E3\u91CA\u5199\u8FDB\u8C03\u7528\u524D\u7684\u56DE\u590D\u6587\u672C\u3002"
|
|
3705
3717
|
},
|
|
3718
|
+
recommended: {
|
|
3719
|
+
type: "boolean",
|
|
3720
|
+
description: "\u6807\u8BB0\u8FD9\u662F\u4F60\u7684\u63A8\u8350\u9879\uFF08\u6709\u660E\u786E\u63A8\u8350\u65F6\u7F6E true\uFF0C\u65E0\u5219\u7701\u7565\uFF09\u3002"
|
|
3721
|
+
},
|
|
3706
3722
|
userMessage: { type: "string" }
|
|
3707
3723
|
},
|
|
3708
3724
|
required: ["id", "label"]
|
|
@@ -3745,7 +3761,7 @@ async function uiAskChoiceFunc(args, _thunkApi) {
|
|
|
3745
3761
|
const firstQ = args.questions[0];
|
|
3746
3762
|
return {
|
|
3747
3763
|
rawData: {
|
|
3748
|
-
type: "
|
|
3764
|
+
type: "ask_user",
|
|
3749
3765
|
question: firstQ?.question ?? "",
|
|
3750
3766
|
choices: firstQ?.choices ?? [],
|
|
3751
3767
|
blocking,
|
|
@@ -3757,11 +3773,11 @@ async function uiAskChoiceFunc(args, _thunkApi) {
|
|
|
3757
3773
|
const question = String(args?.question ?? "").trim();
|
|
3758
3774
|
const choices = Array.isArray(args?.choices) ? args.choices : [];
|
|
3759
3775
|
if (!question || choices.length === 0) {
|
|
3760
|
-
throw new Error("
|
|
3776
|
+
throw new Error("ask_user \u9700\u8981 question+choices \u6216 questions\u3002");
|
|
3761
3777
|
}
|
|
3762
3778
|
return {
|
|
3763
3779
|
rawData: {
|
|
3764
|
-
type: "
|
|
3780
|
+
type: "ask_user",
|
|
3765
3781
|
question,
|
|
3766
3782
|
choices,
|
|
3767
3783
|
blocking
|
|
@@ -3778,14 +3794,14 @@ function parseUiAskChoiceContent(rawContent) {
|
|
|
3778
3794
|
}
|
|
3779
3795
|
})() : rawContent;
|
|
3780
3796
|
if (!parsed || typeof parsed !== "object") return null;
|
|
3781
|
-
if (parsed.type !== "
|
|
3797
|
+
if (parsed.type !== "ask_user") return null;
|
|
3782
3798
|
return parsed;
|
|
3783
3799
|
}
|
|
3784
3800
|
|
|
3785
3801
|
// packages/ai/policy/personalizationDialog.ts
|
|
3786
3802
|
var PERSONALIZATION_DIALOG_CATEGORY = "user-overlay-profile";
|
|
3787
3803
|
var PERSONALIZATION_DIALOG_EXTRA_TOOLS = [
|
|
3788
|
-
"
|
|
3804
|
+
"ask_user",
|
|
3789
3805
|
"updateUserPreferenceProfile"
|
|
3790
3806
|
];
|
|
3791
3807
|
var buildPersonalizationRuntimeOptions = (runtimeOptions) => ({
|
|
@@ -3801,7 +3817,7 @@ var buildPersonalizationDialogPolicyContext = () => [
|
|
|
3801
3817
|
"\u5F53\u524D\u5BF9\u8BDD\u662F\u201C\u7528\u6237\u4E2A\u6027\u5316\u8BBE\u7F6E\u201D\u6A21\u5F0F\uFF0C\u4E0D\u662F\u666E\u901A\u95F2\u804A\u3002",
|
|
3802
3818
|
"\u4F60\u7684\u76EE\u6807\u662F\u7528\u7B80\u77ED\u5BF9\u8BDD\u5E2E\u52A9\u7528\u6237\u786E\u8BA4 tone\u3001knowledge_capture\u3001space_context \u8FD9\u4E09\u9879\u504F\u597D\u3002",
|
|
3803
3819
|
"\u5982\u679C\u7528\u6237\u5148\u4ECB\u7ECD\u81EA\u5DF1\u3001\u5DE5\u4F5C\u65B9\u5F0F\u6216\u957F\u671F\u6C9F\u901A\u504F\u597D\uFF0C\u8BF7\u628A\u8FD9\u4E9B\u53EF\u590D\u7528\u4FE1\u606F\u6574\u7406\u6210\u7B80\u6D01\u7684 globalPrompt \u8349\u6848\uFF0C\u5E76\u5728\u7528\u6237\u786E\u8BA4\u540E\u901A\u8FC7 updateUserPreferenceProfile \u4FDD\u5B58\u3002",
|
|
3804
|
-
"\u4F18\u5148\u4E00\u6B21\u53EA\u95EE\u4E00\u4E2A\u95EE\u9898\uFF1B\u5F53\u5B58\u5728\u6E05\u6670\u4E92\u65A5\u9009\u9879\u65F6\uFF0C\u4F18\u5148\u8C03\u7528
|
|
3820
|
+
"\u4F18\u5148\u4E00\u6B21\u53EA\u95EE\u4E00\u4E2A\u95EE\u9898\uFF1B\u5F53\u5B58\u5728\u6E05\u6670\u4E92\u65A5\u9009\u9879\u65F6\uFF0C\u4F18\u5148\u8C03\u7528 ask_user\u3002",
|
|
3805
3821
|
"\u6536\u96C6\u5230\u8DB3\u591F\u4FE1\u606F\u540E\uFF0C\u8C03\u7528 updateUserPreferenceProfile \u4FDD\u5B58\u7ED3\u679C\uFF0C\u7136\u540E\u7528\u81EA\u7136\u8BED\u8A00\u603B\u7ED3\u5DF2\u4FDD\u5B58\u7684\u8BBE\u7F6E\u3002",
|
|
3806
3822
|
"\u4FDD\u5B58\u5B8C\u6210\u540E\uFF0C\u8981\u63D0\u9192\u7528\u6237\uFF1A\u4EE5\u540E\u4E5F\u53EF\u4EE5\u5728\u8BBE\u7F6E\u91CC\u4FEE\u6539 globalPrompt \u548C\u8FD9\u4E9B\u504F\u597D\uFF0C\u6216\u8005\u518D\u6B21\u6253\u5F00\u8FD9\u4E2A\u5165\u53E3\u7EE7\u7EED\u8C03\u6574\u3002",
|
|
3807
3823
|
"\u4E2A\u6027\u5316\u8BBE\u7F6E\u5B8C\u6210\u540E\uFF0C\u53EF\u987A\u624B\u5F15\u5BFC\u7528\u6237\u5C1D\u8BD5 1 \u5230 2 \u4E2A\u76F8\u5173\u529F\u80FD\uFF0C\u4F8B\u5982\u9996\u9875\u5FEB\u6377\u5BF9\u8BDD\u3001\u521B\u5EFA\u7B14\u8BB0\u3001\u521B\u5EFA AI\uFF0C\u4F46\u4E0D\u8981\u4E00\u6B21\u63A8\u8350\u592A\u591A\u3002",
|
|
@@ -4968,6 +4984,33 @@ var messageSlice = createSliceWithThunks({
|
|
|
4968
4984
|
});
|
|
4969
4985
|
}
|
|
4970
4986
|
}),
|
|
4987
|
+
/**
|
|
4988
|
+
* Append a run-overlay presentation as a non-streaming assistant message.
|
|
4989
|
+
*
|
|
4990
|
+
* This is a pure UI presentation action — it does NOT trigger a new agent
|
|
4991
|
+
* turn, does NOT call the LLM, and is therefore not billed. The message
|
|
4992
|
+
* is upserted into the dialog's message list so the user sees the run
|
|
4993
|
+
* status snapshot at turn-end. A fresh message id/dbKey are minted from
|
|
4994
|
+
* the dialog id so repeated overlays across turns don't collide.
|
|
4995
|
+
*
|
|
4996
|
+
* The message is marked role:"assistant" with isStreaming:false. Callers
|
|
4997
|
+
* that want to keep it out of the LLM context can post-filter by the
|
|
4998
|
+
* `metadata.overlayMessage` flag set here.
|
|
4999
|
+
*/
|
|
5000
|
+
appendOverlayMessage: create.reducer((state3, action2) => {
|
|
5001
|
+
const dialogId = extractCustomId(action2.payload.dialogKey);
|
|
5002
|
+
if (!dialogId) return;
|
|
5003
|
+
const dialogState = ensureMessageDialogState(state3, dialogId);
|
|
5004
|
+
const { key: msgKey, messageId } = createDialogMessageKeyAndId(dialogId);
|
|
5005
|
+
upsertOneMessage(dialogState, {
|
|
5006
|
+
id: messageId,
|
|
5007
|
+
dbKey: msgKey,
|
|
5008
|
+
role: "assistant",
|
|
5009
|
+
content: action2.payload.text,
|
|
5010
|
+
isStreaming: false,
|
|
5011
|
+
metadata: { overlayMessage: true }
|
|
5012
|
+
});
|
|
5013
|
+
}),
|
|
4971
5014
|
prepareAndPersistMessage: create.asyncThunk(
|
|
4972
5015
|
async (args, thunkApi) => {
|
|
4973
5016
|
const { message, dialogConfig } = args;
|
|
@@ -4993,7 +5036,7 @@ var messageSlice = createSliceWithThunks({
|
|
|
4993
5036
|
content: message.content,
|
|
4994
5037
|
dialogKey
|
|
4995
5038
|
})
|
|
4996
|
-
).catch((
|
|
5039
|
+
).catch((err2) => console.error("Failed to add refs:", err2));
|
|
4997
5040
|
dispatch(messageActions.addUserMessage({ ...fullMessage, dialogId }));
|
|
4998
5041
|
const { controller, ...messageToWrite } = fullMessage;
|
|
4999
5042
|
await dispatch(
|
|
@@ -5060,8 +5103,8 @@ var messageSlice = createSliceWithThunks({
|
|
|
5060
5103
|
messages: finalMessages2.filter(isValidMessage)
|
|
5061
5104
|
})
|
|
5062
5105
|
);
|
|
5063
|
-
}).catch((
|
|
5064
|
-
console.error("[initMsgs] background remote revalidate failed:",
|
|
5106
|
+
}).catch((err2) => {
|
|
5107
|
+
console.error("[initMsgs] background remote revalidate failed:", err2);
|
|
5065
5108
|
});
|
|
5066
5109
|
return validLocalMessages;
|
|
5067
5110
|
}
|
|
@@ -5078,7 +5121,7 @@ var messageSlice = createSliceWithThunks({
|
|
|
5078
5121
|
updateDialogSummaryAction(
|
|
5079
5122
|
{ dialogKey: decision.dialogKey, preFetchedMessages: finalMessages },
|
|
5080
5123
|
thunkApi
|
|
5081
|
-
).catch((
|
|
5124
|
+
).catch((err2) => console.error("Resume summary failed:", err2));
|
|
5082
5125
|
}
|
|
5083
5126
|
} catch {
|
|
5084
5127
|
console.error("[initMsgs] Failed to resume summary");
|
|
@@ -5384,12 +5427,12 @@ var messageSlice = createSliceWithThunks({
|
|
|
5384
5427
|
reason: summaryReason
|
|
5385
5428
|
},
|
|
5386
5429
|
{ dispatch, getState }
|
|
5387
|
-
).catch((
|
|
5430
|
+
).catch((err2) => console.error("Summary update failed:", err2));
|
|
5388
5431
|
if (addRefs) {
|
|
5389
5432
|
dispatch(addReferenceKeysAction({
|
|
5390
5433
|
content: finalVisibleContent,
|
|
5391
5434
|
dialogKey
|
|
5392
|
-
})).catch((
|
|
5435
|
+
})).catch((err2) => console.error("Failed to add assistant refs:", err2));
|
|
5393
5436
|
}
|
|
5394
5437
|
}
|
|
5395
5438
|
captureUnderstandingFromCompletedUiTurn2({
|
|
@@ -5401,7 +5444,7 @@ var messageSlice = createSliceWithThunks({
|
|
|
5401
5444
|
assistantText: textContent,
|
|
5402
5445
|
toolCalls
|
|
5403
5446
|
}).catch(
|
|
5404
|
-
(
|
|
5447
|
+
(err2) => console.error("Understanding memory capture failed:", err2)
|
|
5405
5448
|
);
|
|
5406
5449
|
return {
|
|
5407
5450
|
id: messageId,
|
|
@@ -5553,7 +5596,7 @@ var messageSlice = createSliceWithThunks({
|
|
|
5553
5596
|
runtimeOptions: args.runtimeOptions
|
|
5554
5597
|
});
|
|
5555
5598
|
if (agentKeyToUse) {
|
|
5556
|
-
const { streamAgentChatTurn } = await import("./agentSlice-
|
|
5599
|
+
const { streamAgentChatTurn } = await import("./agentSlice-B6FQEOAF.js");
|
|
5557
5600
|
await dispatch(
|
|
5558
5601
|
streamAgentChatTurn({
|
|
5559
5602
|
agentKey: agentKeyToUse,
|
|
@@ -5609,7 +5652,8 @@ var {
|
|
|
5609
5652
|
editUserMessageAndReplay,
|
|
5610
5653
|
addToolMessage,
|
|
5611
5654
|
updateToolMessage,
|
|
5612
|
-
removeMessagesByIds
|
|
5655
|
+
removeMessagesByIds,
|
|
5656
|
+
appendOverlayMessage
|
|
5613
5657
|
} = messageSlice.actions;
|
|
5614
5658
|
var messageSlice_default = messageSlice.reducer;
|
|
5615
5659
|
|
|
@@ -8024,7 +8068,7 @@ var saveTokenUsage = async (data, thunkApi) => {
|
|
|
8024
8068
|
currentStats = await thunkApi.dispatch(read({
|
|
8025
8069
|
dbKey: tokenDayStatsKey
|
|
8026
8070
|
})).unwrap();
|
|
8027
|
-
} catch (
|
|
8071
|
+
} catch (err2) {
|
|
8028
8072
|
logger3.warn({ tokenDayStatsKey }, "No existing stats found");
|
|
8029
8073
|
}
|
|
8030
8074
|
const updatedStats = await updateStats(
|
|
@@ -8211,7 +8255,7 @@ var deleteOwnedDialogAttachments = async (args) => {
|
|
|
8211
8255
|
metadataReadFailures
|
|
8212
8256
|
});
|
|
8213
8257
|
if (!plan.deleteCandidates.length) return plan;
|
|
8214
|
-
const { deleteFileAction } = await import("./deleteFile-
|
|
8258
|
+
const { deleteFileAction } = await import("./deleteFile-WDZ3VM7B.js");
|
|
8215
8259
|
for (const candidate of plan.deleteCandidates) {
|
|
8216
8260
|
if (candidate.fileDbKey) {
|
|
8217
8261
|
await deleteFileAction(candidate.fileDbKey, args.thunkApi);
|
|
@@ -8273,7 +8317,7 @@ var deleteDialogThunk = async (payload, thunkApi) => {
|
|
|
8273
8317
|
}
|
|
8274
8318
|
if (isCurrentDialog) {
|
|
8275
8319
|
await thunkApi.dispatch(resetMsgs());
|
|
8276
|
-
const { clearPendingAttachments: clearPendingAttachments2 } = await import("./dialogSlice-
|
|
8320
|
+
const { clearPendingAttachments: clearPendingAttachments2 } = await import("./dialogSlice-DMJVC2XX.js");
|
|
8277
8321
|
dispatch(clearPendingAttachments2());
|
|
8278
8322
|
clearWorkflow();
|
|
8279
8323
|
}
|
|
@@ -8282,35 +8326,35 @@ var deleteDialogThunk = async (payload, thunkApi) => {
|
|
|
8282
8326
|
|
|
8283
8327
|
// packages/chat/dialog/dialogSlice.ts
|
|
8284
8328
|
var runCreateDialogAction = async (args, thunkApi) => {
|
|
8285
|
-
const { createDialogAction } = await import("./createDialogAction-
|
|
8329
|
+
const { createDialogAction } = await import("./createDialogAction-RPB6W3QN.js");
|
|
8286
8330
|
return createDialogAction(args, thunkApi);
|
|
8287
8331
|
};
|
|
8288
8332
|
var runCreateAgentAutomationAction = async (args, thunkApi) => {
|
|
8289
|
-
const { createAgentAutomationAction } = await import("./createAgentAutomationAction-
|
|
8333
|
+
const { createAgentAutomationAction } = await import("./createAgentAutomationAction-F62DAY54.js");
|
|
8290
8334
|
return createAgentAutomationAction(args, thunkApi);
|
|
8291
8335
|
};
|
|
8292
8336
|
var runUpdateDialogTitleAction = async (args, thunkApi) => {
|
|
8293
|
-
const { updateDialogTitleAction } = await import("./updateDialogTitleAction-
|
|
8337
|
+
const { updateDialogTitleAction } = await import("./updateDialogTitleAction-LE7SCNSB.js");
|
|
8294
8338
|
return updateDialogTitleAction(args, thunkApi);
|
|
8295
8339
|
};
|
|
8296
8340
|
var runAddDialogAgentAction = async (args, thunkApi) => {
|
|
8297
|
-
const { addDialogAgentAction } = await import("./addDialogAgentAction-
|
|
8341
|
+
const { addDialogAgentAction } = await import("./addDialogAgentAction-FCMSKYAF.js");
|
|
8298
8342
|
return addDialogAgentAction(args, thunkApi);
|
|
8299
8343
|
};
|
|
8300
8344
|
var runRemoveDialogAgentAction = async (args, thunkApi) => {
|
|
8301
|
-
const { removeDialogAgentAction } = await import("./removeDialogAgentAction-
|
|
8345
|
+
const { removeDialogAgentAction } = await import("./removeDialogAgentAction-OAGA2G3U.js");
|
|
8302
8346
|
return removeDialogAgentAction(args, thunkApi);
|
|
8303
8347
|
};
|
|
8304
8348
|
var runSetPrimaryDialogAgentAction = async (args, thunkApi) => {
|
|
8305
|
-
const { setPrimaryDialogAgentAction } = await import("./setPrimaryDialogAgentAction-
|
|
8349
|
+
const { setPrimaryDialogAgentAction } = await import("./setPrimaryDialogAgentAction-4ZUQQKDG.js");
|
|
8306
8350
|
return setPrimaryDialogAgentAction(args, thunkApi);
|
|
8307
8351
|
};
|
|
8308
8352
|
var runSetDialogExtraReferencesAction = async (args, thunkApi) => {
|
|
8309
|
-
const { setDialogExtraReferencesAction } = await import("./setDialogExtraReferencesAction-
|
|
8353
|
+
const { setDialogExtraReferencesAction } = await import("./setDialogExtraReferencesAction-JZEXA5SL.js");
|
|
8310
8354
|
return setDialogExtraReferencesAction(args, thunkApi);
|
|
8311
8355
|
};
|
|
8312
8356
|
var runHandleSendMessageAction = async (args, thunkApi) => {
|
|
8313
|
-
const { handleSendMessageAction } = await import("./handleSendMessageAction-
|
|
8357
|
+
const { handleSendMessageAction } = await import("./handleSendMessageAction-YDCWKDVY.js");
|
|
8314
8358
|
return handleSendMessageAction(args, thunkApi);
|
|
8315
8359
|
};
|
|
8316
8360
|
function clearDialogState() {
|
|
@@ -8323,7 +8367,7 @@ var createPageAndAddReference = createAsyncThunk(
|
|
|
8323
8367
|
async (payload, { dispatch, getState, rejectWithValue }) => {
|
|
8324
8368
|
const { slateData, jsonData, title, type, fileId, groupId, dialogKey } = payload;
|
|
8325
8369
|
try {
|
|
8326
|
-
const { createDocState } = await import("./docStore-
|
|
8370
|
+
const { createDocState } = await import("./docStore-YAPW55HZ.js");
|
|
8327
8371
|
const pageKey = await createDocState(
|
|
8328
8372
|
{ slateData, title },
|
|
8329
8373
|
{ dispatch, getState }
|
|
@@ -8378,12 +8422,12 @@ var initDialog = createAsyncThunk(
|
|
|
8378
8422
|
})
|
|
8379
8423
|
).unwrap();
|
|
8380
8424
|
} catch (error) {
|
|
8381
|
-
const
|
|
8382
|
-
const isAborted = isAbortError(
|
|
8425
|
+
const err2 = error;
|
|
8426
|
+
const isAborted = isAbortError(err2) || err2?.message === "Aborted";
|
|
8383
8427
|
const isCurrentDialog = getActiveDialogKey() === id;
|
|
8384
8428
|
if (!isAborted && isCurrentDialog) {
|
|
8385
|
-
setDialogConfigError(
|
|
8386
|
-
console.info("Failed to load dialog config:",
|
|
8429
|
+
setDialogConfigError(err2?.message || "Failed to load dialog");
|
|
8430
|
+
console.info("Failed to load dialog config:", err2?.message);
|
|
8387
8431
|
}
|
|
8388
8432
|
throw error;
|
|
8389
8433
|
}
|
|
@@ -8551,9 +8595,9 @@ var fetchTableRowsFromServer = async (server, tenantId, tableId, headers) => {
|
|
|
8551
8595
|
if (!res.ok) {
|
|
8552
8596
|
let msg = `\u52A0\u8F7D\u8868 ${tableId} \u884C\u5931\u8D25\uFF08${res.status}\uFF09`;
|
|
8553
8597
|
try {
|
|
8554
|
-
const
|
|
8555
|
-
if (
|
|
8556
|
-
msg =
|
|
8598
|
+
const err2 = await res.json();
|
|
8599
|
+
if (err2 && typeof err2.message === "string") {
|
|
8600
|
+
msg = err2.message;
|
|
8557
8601
|
}
|
|
8558
8602
|
} catch {
|
|
8559
8603
|
}
|
|
@@ -8678,6 +8722,140 @@ var fetchAndCacheTableRows = async ({
|
|
|
8678
8722
|
return tableDeleted ? [] : mergedRows.filter((row) => !row?.deletedAt);
|
|
8679
8723
|
};
|
|
8680
8724
|
|
|
8725
|
+
// packages/render/table/tableColumnCore.ts
|
|
8726
|
+
var ok = (value) => ({ ok: true, value });
|
|
8727
|
+
var err = (error) => ({ ok: false, error });
|
|
8728
|
+
var hasOwn = (obj, key) => Object.prototype.hasOwnProperty.call(obj, key);
|
|
8729
|
+
var buildMeta = (meta, columns, updatedAt) => ({
|
|
8730
|
+
meta: { ...meta, columns, updatedAt },
|
|
8731
|
+
metaChanges: { columns, updatedAt },
|
|
8732
|
+
noop: false
|
|
8733
|
+
});
|
|
8734
|
+
var reorderList = (list, from, to) => {
|
|
8735
|
+
const next = [...list];
|
|
8736
|
+
const [moved] = next.splice(from, 1);
|
|
8737
|
+
next.splice(to, 0, moved);
|
|
8738
|
+
return next;
|
|
8739
|
+
};
|
|
8740
|
+
function addColumnToMeta(meta, input, deps) {
|
|
8741
|
+
const { columnName } = input;
|
|
8742
|
+
if (!columnName.trim()) {
|
|
8743
|
+
return err("\u5B57\u6BB5\u540D\u4E0D\u80FD\u4E3A\u7A7A");
|
|
8744
|
+
}
|
|
8745
|
+
if (meta.columns.some((c) => c.name === columnName)) {
|
|
8746
|
+
return err(`\u5B57\u6BB5 ${columnName} \u5DF2\u5B58\u5728`);
|
|
8747
|
+
}
|
|
8748
|
+
const newColumn = {
|
|
8749
|
+
id: deps.id,
|
|
8750
|
+
name: columnName,
|
|
8751
|
+
label: columnName
|
|
8752
|
+
};
|
|
8753
|
+
return ok(buildMeta(meta, [...meta.columns, newColumn], deps.nowIso));
|
|
8754
|
+
}
|
|
8755
|
+
function deleteColumnFromMeta(meta, rows, input, deps) {
|
|
8756
|
+
const { columnName } = input;
|
|
8757
|
+
const { nowIso } = deps;
|
|
8758
|
+
if (!meta.columns.some((c) => c.name === columnName)) {
|
|
8759
|
+
return err(`\u5B57\u6BB5 ${columnName} \u4E0D\u5B58\u5728`);
|
|
8760
|
+
}
|
|
8761
|
+
const newColumns = meta.columns.filter((c) => c.name !== columnName);
|
|
8762
|
+
const rowPatches = rows.filter((row) => hasOwn(row, columnName)).map((row) => ({
|
|
8763
|
+
dbKey: row.dbKey,
|
|
8764
|
+
changes: { [columnName]: null, updatedAt: nowIso }
|
|
8765
|
+
}));
|
|
8766
|
+
const newRows = rows.map((row) => {
|
|
8767
|
+
if (!hasOwn(row, columnName)) {
|
|
8768
|
+
return row;
|
|
8769
|
+
}
|
|
8770
|
+
const { [columnName]: _removed, ...rest } = row;
|
|
8771
|
+
return { ...rest, updatedAt: nowIso };
|
|
8772
|
+
});
|
|
8773
|
+
return ok({
|
|
8774
|
+
...buildMeta(meta, newColumns, nowIso),
|
|
8775
|
+
rows: newRows,
|
|
8776
|
+
rowPatches
|
|
8777
|
+
});
|
|
8778
|
+
}
|
|
8779
|
+
function reorderColumnInMeta(meta, input, deps) {
|
|
8780
|
+
const { fromIndex, toIndex } = input;
|
|
8781
|
+
const columnCount = meta.columns.length;
|
|
8782
|
+
if (fromIndex < 0 || fromIndex >= columnCount || toIndex < 0 || toIndex >= columnCount) {
|
|
8783
|
+
return err("\u5217\u7D22\u5F15\u8D85\u51FA\u8303\u56F4");
|
|
8784
|
+
}
|
|
8785
|
+
if (fromIndex === toIndex) {
|
|
8786
|
+
return ok({
|
|
8787
|
+
meta,
|
|
8788
|
+
metaChanges: { columns: meta.columns, updatedAt: meta.updatedAt },
|
|
8789
|
+
noop: true
|
|
8790
|
+
});
|
|
8791
|
+
}
|
|
8792
|
+
return ok(
|
|
8793
|
+
buildMeta(meta, reorderList(meta.columns, fromIndex, toIndex), deps.nowIso)
|
|
8794
|
+
);
|
|
8795
|
+
}
|
|
8796
|
+
function renameColumnInMeta(meta, rows, input, deps) {
|
|
8797
|
+
const { oldName } = input;
|
|
8798
|
+
const { nowIso } = deps;
|
|
8799
|
+
const newName = input.newName.trim();
|
|
8800
|
+
if (!newName) {
|
|
8801
|
+
return err("\u65B0\u7684\u5B57\u6BB5\u540D\u4E0D\u80FD\u4E3A\u7A7A");
|
|
8802
|
+
}
|
|
8803
|
+
if (!meta.columns.some((c) => c.name === oldName)) {
|
|
8804
|
+
return err(`\u5B57\u6BB5 ${oldName} \u4E0D\u5B58\u5728`);
|
|
8805
|
+
}
|
|
8806
|
+
if (meta.columns.some((c) => c.name === newName)) {
|
|
8807
|
+
return err(`\u5B57\u6BB5 ${newName} \u5DF2\u5B58\u5728`);
|
|
8808
|
+
}
|
|
8809
|
+
const newColumns = meta.columns.map(
|
|
8810
|
+
(c) => c.name === oldName ? { ...c, name: newName } : c
|
|
8811
|
+
);
|
|
8812
|
+
const rowPatches = rows.filter((row) => hasOwn(row, oldName)).map((row) => ({
|
|
8813
|
+
dbKey: row.dbKey,
|
|
8814
|
+
changes: {
|
|
8815
|
+
[newName]: row[oldName],
|
|
8816
|
+
[oldName]: null,
|
|
8817
|
+
updatedAt: nowIso
|
|
8818
|
+
}
|
|
8819
|
+
}));
|
|
8820
|
+
const newRows = rows.map((row) => {
|
|
8821
|
+
if (!hasOwn(row, oldName)) {
|
|
8822
|
+
return row;
|
|
8823
|
+
}
|
|
8824
|
+
const { [oldName]: oldValue, ...rest } = row;
|
|
8825
|
+
return { ...rest, [newName]: oldValue, updatedAt: nowIso };
|
|
8826
|
+
});
|
|
8827
|
+
return ok({
|
|
8828
|
+
...buildMeta(meta, newColumns, nowIso),
|
|
8829
|
+
rows: newRows,
|
|
8830
|
+
rowPatches
|
|
8831
|
+
});
|
|
8832
|
+
}
|
|
8833
|
+
function renameColumnLabelInMeta(meta, input, deps) {
|
|
8834
|
+
const { columnId } = input;
|
|
8835
|
+
const label = input.label.trim();
|
|
8836
|
+
if (!label) {
|
|
8837
|
+
return err("\u5B57\u6BB5\u663E\u793A\u540D\u4E0D\u80FD\u4E3A\u7A7A");
|
|
8838
|
+
}
|
|
8839
|
+
if (!meta.columns.some((c) => c.id === columnId)) {
|
|
8840
|
+
return err("\u8981\u91CD\u547D\u540D\u7684\u5B57\u6BB5\u4E0D\u5B58\u5728");
|
|
8841
|
+
}
|
|
8842
|
+
const newColumns = meta.columns.map(
|
|
8843
|
+
(c) => c.id === columnId ? { ...c, label } : c
|
|
8844
|
+
);
|
|
8845
|
+
return ok(buildMeta(meta, newColumns, deps.nowIso));
|
|
8846
|
+
}
|
|
8847
|
+
function updateColumnWidthInMeta(meta, input, deps) {
|
|
8848
|
+
const { columnId, width } = input;
|
|
8849
|
+
if (!meta.columns.some((c) => c.id === columnId)) {
|
|
8850
|
+
return err("\u8981\u8C03\u6574\u5BBD\u5EA6\u7684\u5B57\u6BB5\u4E0D\u5B58\u5728");
|
|
8851
|
+
}
|
|
8852
|
+
const normalizedWidth = typeof width === "number" && width > 0 ? Math.round(width) : void 0;
|
|
8853
|
+
const newColumns = meta.columns.map(
|
|
8854
|
+
(c) => c.id === columnId ? { ...c, width: normalizedWidth } : c
|
|
8855
|
+
);
|
|
8856
|
+
return ok(buildMeta(meta, newColumns, deps.nowIso));
|
|
8857
|
+
}
|
|
8858
|
+
|
|
8681
8859
|
// packages/render/table/createTableAction.ts
|
|
8682
8860
|
var import_date_fns2 = __toESM(require_date_fns(), 1);
|
|
8683
8861
|
import { ulid as ulid4 } from "ulid";
|
|
@@ -9833,7 +10011,7 @@ var PluralResolver = class {
|
|
|
9833
10011
|
});
|
|
9834
10012
|
this.pluralRulesCache[cacheKey] = rule;
|
|
9835
10013
|
return rule;
|
|
9836
|
-
} catch (
|
|
10014
|
+
} catch (err2) {
|
|
9837
10015
|
return;
|
|
9838
10016
|
}
|
|
9839
10017
|
}
|
|
@@ -10311,23 +10489,23 @@ var Connector = class extends EventEmitter {
|
|
|
10311
10489
|
toLoadNamespaces: Object.keys(toLoadNamespaces)
|
|
10312
10490
|
};
|
|
10313
10491
|
}
|
|
10314
|
-
loaded(name,
|
|
10492
|
+
loaded(name, err2, data) {
|
|
10315
10493
|
const s = name.split("|");
|
|
10316
10494
|
const lng = s[0];
|
|
10317
10495
|
const ns = s[1];
|
|
10318
|
-
if (
|
|
10319
|
-
if (!
|
|
10496
|
+
if (err2) this.emit("failedLoading", lng, ns, err2);
|
|
10497
|
+
if (!err2 && data) {
|
|
10320
10498
|
this.store.addResourceBundle(lng, ns, data, void 0, void 0, {
|
|
10321
10499
|
skipCopy: true
|
|
10322
10500
|
});
|
|
10323
10501
|
}
|
|
10324
|
-
this.state[name] =
|
|
10325
|
-
if (
|
|
10502
|
+
this.state[name] = err2 ? -1 : 2;
|
|
10503
|
+
if (err2 && data) this.state[name] = 0;
|
|
10326
10504
|
const loaded = {};
|
|
10327
10505
|
this.queue.forEach((q) => {
|
|
10328
10506
|
pushPath(q.loaded, [lng], ns);
|
|
10329
10507
|
removePending(q, name);
|
|
10330
|
-
if (
|
|
10508
|
+
if (err2) q.errors.push(err2);
|
|
10331
10509
|
if (q.pendingCount === 0 && !q.done) {
|
|
10332
10510
|
Object.keys(q.loaded).forEach((l) => {
|
|
10333
10511
|
if (!loaded[l]) loaded[l] = {};
|
|
@@ -10366,19 +10544,19 @@ var Connector = class extends EventEmitter {
|
|
|
10366
10544
|
return;
|
|
10367
10545
|
}
|
|
10368
10546
|
this.readingCalls++;
|
|
10369
|
-
const resolver = (
|
|
10547
|
+
const resolver = (err2, data) => {
|
|
10370
10548
|
this.readingCalls--;
|
|
10371
10549
|
if (this.waitingReads.length > 0) {
|
|
10372
10550
|
const next = this.waitingReads.shift();
|
|
10373
10551
|
this.read(next.lng, next.ns, next.fcName, next.tried, next.wait, next.callback);
|
|
10374
10552
|
}
|
|
10375
|
-
if (
|
|
10553
|
+
if (err2 && data && tried < this.maxRetries) {
|
|
10376
10554
|
setTimeout(() => {
|
|
10377
10555
|
this.read.call(this, lng, ns, fcName, tried + 1, wait * 2, callback);
|
|
10378
10556
|
}, wait);
|
|
10379
10557
|
return;
|
|
10380
10558
|
}
|
|
10381
|
-
callback(
|
|
10559
|
+
callback(err2, data);
|
|
10382
10560
|
};
|
|
10383
10561
|
const fc = this.backend[fcName].bind(this.backend);
|
|
10384
10562
|
if (fc.length === 2) {
|
|
@@ -10389,8 +10567,8 @@ var Connector = class extends EventEmitter {
|
|
|
10389
10567
|
} else {
|
|
10390
10568
|
resolver(null, r);
|
|
10391
10569
|
}
|
|
10392
|
-
} catch (
|
|
10393
|
-
resolver(
|
|
10570
|
+
} catch (err2) {
|
|
10571
|
+
resolver(err2);
|
|
10394
10572
|
}
|
|
10395
10573
|
return;
|
|
10396
10574
|
}
|
|
@@ -10427,10 +10605,10 @@ var Connector = class extends EventEmitter {
|
|
|
10427
10605
|
const s = name.split("|");
|
|
10428
10606
|
const lng = s[0];
|
|
10429
10607
|
const ns = s[1];
|
|
10430
|
-
this.read(lng, ns, "read", void 0, void 0, (
|
|
10431
|
-
if (
|
|
10432
|
-
if (!
|
|
10433
|
-
this.loaded(name,
|
|
10608
|
+
this.read(lng, ns, "read", void 0, void 0, (err2, data) => {
|
|
10609
|
+
if (err2) this.logger.warn(`${prefix}loading namespace ${ns} for language ${lng} failed`, err2);
|
|
10610
|
+
if (!err2 && data) this.logger.log(`${prefix}loaded namespace ${ns} for language ${lng}`, data);
|
|
10611
|
+
this.loaded(name, err2, data);
|
|
10434
10612
|
});
|
|
10435
10613
|
}
|
|
10436
10614
|
saveMissing(languages, namespace, key, fallbackValue, isUpdate) {
|
|
@@ -10461,8 +10639,8 @@ var Connector = class extends EventEmitter {
|
|
|
10461
10639
|
} else {
|
|
10462
10640
|
clb(null, r);
|
|
10463
10641
|
}
|
|
10464
|
-
} catch (
|
|
10465
|
-
clb(
|
|
10642
|
+
} catch (err2) {
|
|
10643
|
+
clb(err2);
|
|
10466
10644
|
}
|
|
10467
10645
|
} else {
|
|
10468
10646
|
fc(languages, namespace, key, fallbackValue, clb, opts);
|
|
@@ -10694,14 +10872,14 @@ var I18n = class _I18n extends EventEmitter {
|
|
|
10694
10872
|
});
|
|
10695
10873
|
const deferred = defer();
|
|
10696
10874
|
const load = () => {
|
|
10697
|
-
const finish = (
|
|
10875
|
+
const finish = (err2, t2) => {
|
|
10698
10876
|
this.isInitializing = false;
|
|
10699
10877
|
if (this.isInitialized && !this.initializedStoreOnce) this.logger.warn("init: i18next is already initialized. You should call init just once!");
|
|
10700
10878
|
this.isInitialized = true;
|
|
10701
10879
|
if (!this.options.isClone) this.logger.log("initialized", this.options);
|
|
10702
10880
|
this.emit("initialized", this.options);
|
|
10703
10881
|
deferred.resolve(t2);
|
|
10704
|
-
callback(
|
|
10882
|
+
callback(err2, t2);
|
|
10705
10883
|
};
|
|
10706
10884
|
if (this.languages && this.options.compatibilityAPI !== "v1" && !this.isInitialized) return finish(null, this.t.bind(this));
|
|
10707
10885
|
this.changeLanguage(this.options.lng, finish);
|
|
@@ -10760,9 +10938,9 @@ var I18n = class _I18n extends EventEmitter {
|
|
|
10760
10938
|
if (!lngs) lngs = this.languages;
|
|
10761
10939
|
if (!ns) ns = this.options.ns;
|
|
10762
10940
|
if (!callback) callback = noop;
|
|
10763
|
-
this.services.backendConnector.reload(lngs, ns, (
|
|
10941
|
+
this.services.backendConnector.reload(lngs, ns, (err2) => {
|
|
10764
10942
|
deferred.resolve();
|
|
10765
|
-
callback(
|
|
10943
|
+
callback(err2);
|
|
10766
10944
|
});
|
|
10767
10945
|
return deferred;
|
|
10768
10946
|
}
|
|
@@ -10815,7 +10993,7 @@ var I18n = class _I18n extends EventEmitter {
|
|
|
10815
10993
|
this.resolvedLanguage = void 0;
|
|
10816
10994
|
this.setResolvedLanguage(l);
|
|
10817
10995
|
};
|
|
10818
|
-
const done = (
|
|
10996
|
+
const done = (err2, l) => {
|
|
10819
10997
|
if (l) {
|
|
10820
10998
|
setLngProps(l);
|
|
10821
10999
|
this.translator.changeLanguage(l);
|
|
@@ -10828,7 +11006,7 @@ var I18n = class _I18n extends EventEmitter {
|
|
|
10828
11006
|
deferred.resolve(function() {
|
|
10829
11007
|
return _this2.t(...arguments);
|
|
10830
11008
|
});
|
|
10831
|
-
if (callback) callback(
|
|
11009
|
+
if (callback) callback(err2, function() {
|
|
10832
11010
|
return _this2.t(...arguments);
|
|
10833
11011
|
});
|
|
10834
11012
|
};
|
|
@@ -10842,8 +11020,8 @@ var I18n = class _I18n extends EventEmitter {
|
|
|
10842
11020
|
if (!this.translator.language) this.translator.changeLanguage(l);
|
|
10843
11021
|
if (this.services.languageDetector && this.services.languageDetector.cacheUserLanguage) this.services.languageDetector.cacheUserLanguage(l);
|
|
10844
11022
|
}
|
|
10845
|
-
this.loadResources(l, (
|
|
10846
|
-
done(
|
|
11023
|
+
this.loadResources(l, (err2) => {
|
|
11024
|
+
done(err2, l);
|
|
10847
11025
|
});
|
|
10848
11026
|
};
|
|
10849
11027
|
if (!lng && this.services.languageDetector && !this.services.languageDetector.async) {
|
|
@@ -10941,9 +11119,9 @@ var I18n = class _I18n extends EventEmitter {
|
|
|
10941
11119
|
ns.forEach((n) => {
|
|
10942
11120
|
if (this.options.ns.indexOf(n) < 0) this.options.ns.push(n);
|
|
10943
11121
|
});
|
|
10944
|
-
this.loadResources((
|
|
11122
|
+
this.loadResources((err2) => {
|
|
10945
11123
|
deferred.resolve();
|
|
10946
|
-
if (callback) callback(
|
|
11124
|
+
if (callback) callback(err2);
|
|
10947
11125
|
});
|
|
10948
11126
|
return deferred;
|
|
10949
11127
|
}
|
|
@@ -10957,9 +11135,9 @@ var I18n = class _I18n extends EventEmitter {
|
|
|
10957
11135
|
return Promise.resolve();
|
|
10958
11136
|
}
|
|
10959
11137
|
this.options.preload = preloaded.concat(newLngs);
|
|
10960
|
-
this.loadResources((
|
|
11138
|
+
this.loadResources((err2) => {
|
|
10961
11139
|
deferred.resolve();
|
|
10962
|
-
if (callback) callback(
|
|
11140
|
+
if (callback) callback(err2);
|
|
10963
11141
|
});
|
|
10964
11142
|
return deferred;
|
|
10965
11143
|
}
|
|
@@ -11456,12 +11634,6 @@ var initialState3 = {
|
|
|
11456
11634
|
rows: [],
|
|
11457
11635
|
focusContext: null
|
|
11458
11636
|
};
|
|
11459
|
-
var reorderList = (list, from, to) => {
|
|
11460
|
-
const next = [...list];
|
|
11461
|
-
const [moved] = next.splice(from, 1);
|
|
11462
|
-
next.splice(to, 0, moved);
|
|
11463
|
-
return next;
|
|
11464
|
-
};
|
|
11465
11637
|
var createSliceWithThunks3 = buildCreateSlice({
|
|
11466
11638
|
creators: { asyncThunk: asyncThunkCreator }
|
|
11467
11639
|
});
|
|
@@ -11675,41 +11847,27 @@ var tableSlice = createSliceWithThunks3({
|
|
|
11675
11847
|
addColumn: create.asyncThunk(
|
|
11676
11848
|
async (args, { dispatch, getState, rejectWithValue }) => {
|
|
11677
11849
|
const { tenantId, tableId, columnName } = args;
|
|
11678
|
-
if (!columnName.trim()) {
|
|
11679
|
-
return rejectWithValue("\u5B57\u6BB5\u540D\u4E0D\u80FD\u4E3A\u7A7A");
|
|
11680
|
-
}
|
|
11681
11850
|
const state3 = getState().table;
|
|
11682
11851
|
const meta = state3.currentTable;
|
|
11683
11852
|
if (!meta || meta.tenantId !== tenantId || meta.tableId !== tableId) {
|
|
11684
11853
|
return rejectWithValue("\u5F53\u524D\u6CA1\u6709\u52A0\u8F7D\u5BF9\u5E94\u7684\u8868\u5B9A\u4E49");
|
|
11685
11854
|
}
|
|
11686
|
-
|
|
11687
|
-
|
|
11855
|
+
const result = addColumnToMeta(
|
|
11856
|
+
meta,
|
|
11857
|
+
{ columnName },
|
|
11858
|
+
{ id: ulid5(), nowIso: (0, import_date_fns3.formatISO)(/* @__PURE__ */ new Date()) }
|
|
11859
|
+
);
|
|
11860
|
+
if (!result.ok) {
|
|
11861
|
+
return rejectWithValue(result.error);
|
|
11688
11862
|
}
|
|
11689
11863
|
try {
|
|
11690
|
-
const nowIso = (0, import_date_fns3.formatISO)(/* @__PURE__ */ new Date());
|
|
11691
|
-
const newColumn = {
|
|
11692
|
-
id: ulid5(),
|
|
11693
|
-
name: columnName,
|
|
11694
|
-
// 默认显示名与机器名一致;之后用户可以单独改 label
|
|
11695
|
-
label: columnName
|
|
11696
|
-
};
|
|
11697
|
-
const newColumns = [...meta.columns, newColumn];
|
|
11698
11864
|
await dispatch(
|
|
11699
11865
|
patch({
|
|
11700
11866
|
dbKey: meta.dbKey,
|
|
11701
|
-
changes:
|
|
11702
|
-
columns: newColumns,
|
|
11703
|
-
updatedAt: nowIso
|
|
11704
|
-
}
|
|
11867
|
+
changes: result.value.metaChanges
|
|
11705
11868
|
})
|
|
11706
11869
|
).unwrap();
|
|
11707
|
-
|
|
11708
|
-
...meta,
|
|
11709
|
-
columns: newColumns,
|
|
11710
|
-
updatedAt: nowIso
|
|
11711
|
-
};
|
|
11712
|
-
return nextMeta;
|
|
11870
|
+
return result.value.meta;
|
|
11713
11871
|
} catch (e) {
|
|
11714
11872
|
return rejectWithValue(e.message || "\u6DFB\u52A0\u5B57\u6BB5\u5931\u8D25");
|
|
11715
11873
|
}
|
|
@@ -11738,58 +11896,24 @@ var tableSlice = createSliceWithThunks3({
|
|
|
11738
11896
|
if (!meta || meta.tenantId !== tenantId || meta.tableId !== tableId) {
|
|
11739
11897
|
return rejectWithValue("\u5F53\u524D\u6CA1\u6709\u52A0\u8F7D\u5BF9\u5E94\u7684\u8868\u5B9A\u4E49");
|
|
11740
11898
|
}
|
|
11741
|
-
|
|
11742
|
-
|
|
11743
|
-
|
|
11744
|
-
|
|
11745
|
-
|
|
11746
|
-
(c) => c.name !== columnName
|
|
11899
|
+
const result = deleteColumnFromMeta(
|
|
11900
|
+
meta,
|
|
11901
|
+
state3.rows,
|
|
11902
|
+
{ columnName },
|
|
11903
|
+
{ nowIso: (0, import_date_fns3.formatISO)(/* @__PURE__ */ new Date()) }
|
|
11747
11904
|
);
|
|
11748
|
-
|
|
11905
|
+
if (!result.ok) {
|
|
11906
|
+
return rejectWithValue(result.error);
|
|
11907
|
+
}
|
|
11908
|
+
const { meta: nextMeta, metaChanges, rows: newRows, rowPatches } = result.value;
|
|
11749
11909
|
try {
|
|
11750
|
-
const rowsWithField = rows.filter(
|
|
11751
|
-
(row) => Object.prototype.hasOwnProperty.call(row, columnName)
|
|
11752
|
-
);
|
|
11753
11910
|
await Promise.all(
|
|
11754
|
-
|
|
11755
|
-
(row) => dispatch(
|
|
11756
|
-
patch({
|
|
11757
|
-
dbKey: row.dbKey,
|
|
11758
|
-
changes: {
|
|
11759
|
-
[columnName]: null,
|
|
11760
|
-
updatedAt: nowIso
|
|
11761
|
-
}
|
|
11762
|
-
})
|
|
11763
|
-
).unwrap()
|
|
11764
|
-
)
|
|
11911
|
+
rowPatches.map((p) => dispatch(patch(p)).unwrap())
|
|
11765
11912
|
);
|
|
11766
11913
|
await dispatch(
|
|
11767
|
-
patch({
|
|
11768
|
-
dbKey: meta.dbKey,
|
|
11769
|
-
changes: {
|
|
11770
|
-
columns: newColumns,
|
|
11771
|
-
updatedAt: nowIso
|
|
11772
|
-
}
|
|
11773
|
-
})
|
|
11914
|
+
patch({ dbKey: meta.dbKey, changes: metaChanges })
|
|
11774
11915
|
).unwrap();
|
|
11775
|
-
|
|
11776
|
-
if (!Object.prototype.hasOwnProperty.call(row, columnName)) {
|
|
11777
|
-
return row;
|
|
11778
|
-
}
|
|
11779
|
-
const { [columnName]: _removed, ...rest } = row;
|
|
11780
|
-
return {
|
|
11781
|
-
...rest,
|
|
11782
|
-
updatedAt: nowIso
|
|
11783
|
-
};
|
|
11784
|
-
});
|
|
11785
|
-
return {
|
|
11786
|
-
meta: {
|
|
11787
|
-
...meta,
|
|
11788
|
-
columns: newColumns,
|
|
11789
|
-
updatedAt: nowIso
|
|
11790
|
-
},
|
|
11791
|
-
rows: newRows
|
|
11792
|
-
};
|
|
11916
|
+
return { meta: nextMeta, rows: newRows };
|
|
11793
11917
|
} catch (e) {
|
|
11794
11918
|
return rejectWithValue(e.message || "\u5220\u9664\u5B57\u6BB5\u5931\u8D25");
|
|
11795
11919
|
}
|
|
@@ -11819,30 +11943,22 @@ var tableSlice = createSliceWithThunks3({
|
|
|
11819
11943
|
if (!meta || meta.tenantId !== tenantId || meta.tableId !== tableId) {
|
|
11820
11944
|
return rejectWithValue("\u5F53\u524D\u6CA1\u6709\u52A0\u8F7D\u5BF9\u5E94\u7684\u8868\u5B9A\u4E49");
|
|
11821
11945
|
}
|
|
11822
|
-
const
|
|
11823
|
-
|
|
11824
|
-
|
|
11946
|
+
const result = reorderColumnInMeta(
|
|
11947
|
+
meta,
|
|
11948
|
+
{ fromIndex, toIndex },
|
|
11949
|
+
{ nowIso: (0, import_date_fns3.formatISO)(/* @__PURE__ */ new Date()) }
|
|
11950
|
+
);
|
|
11951
|
+
if (!result.ok) {
|
|
11952
|
+
return rejectWithValue(result.error);
|
|
11825
11953
|
}
|
|
11826
|
-
if (
|
|
11954
|
+
if (result.value.noop) {
|
|
11827
11955
|
return meta;
|
|
11828
11956
|
}
|
|
11829
|
-
const
|
|
11830
|
-
const newColumns = reorderList(meta.columns, fromIndex, toIndex);
|
|
11957
|
+
const { meta: nextMeta, metaChanges } = result.value;
|
|
11831
11958
|
try {
|
|
11832
11959
|
await dispatch(
|
|
11833
|
-
patch({
|
|
11834
|
-
dbKey: meta.dbKey,
|
|
11835
|
-
changes: {
|
|
11836
|
-
columns: newColumns,
|
|
11837
|
-
updatedAt: nowIso
|
|
11838
|
-
}
|
|
11839
|
-
})
|
|
11960
|
+
patch({ dbKey: meta.dbKey, changes: metaChanges })
|
|
11840
11961
|
).unwrap();
|
|
11841
|
-
const nextMeta = {
|
|
11842
|
-
...meta,
|
|
11843
|
-
columns: newColumns,
|
|
11844
|
-
updatedAt: nowIso
|
|
11845
|
-
};
|
|
11846
11962
|
return nextMeta;
|
|
11847
11963
|
} catch (e) {
|
|
11848
11964
|
return rejectWithValue(e.message || "\u8C03\u6574\u5217\u987A\u5E8F\u5931\u8D25");
|
|
@@ -11869,73 +11985,29 @@ var tableSlice = createSliceWithThunks3({
|
|
|
11869
11985
|
renameColumn: create.asyncThunk(
|
|
11870
11986
|
async (args, { dispatch, getState, rejectWithValue }) => {
|
|
11871
11987
|
const { tenantId, tableId, oldName, newName } = args;
|
|
11872
|
-
const trimmedNewName = newName.trim();
|
|
11873
|
-
if (!trimmedNewName) {
|
|
11874
|
-
return rejectWithValue("\u65B0\u7684\u5B57\u6BB5\u540D\u4E0D\u80FD\u4E3A\u7A7A");
|
|
11875
|
-
}
|
|
11876
11988
|
const state3 = getState().table;
|
|
11877
11989
|
const meta = state3.currentTable;
|
|
11878
11990
|
if (!meta || meta.tenantId !== tenantId || meta.tableId !== tableId) {
|
|
11879
11991
|
return rejectWithValue("\u5F53\u524D\u6CA1\u6709\u52A0\u8F7D\u5BF9\u5E94\u7684\u8868\u5B9A\u4E49");
|
|
11880
11992
|
}
|
|
11881
|
-
|
|
11882
|
-
|
|
11883
|
-
|
|
11884
|
-
|
|
11885
|
-
|
|
11886
|
-
}
|
|
11887
|
-
const nowIso = (0, import_date_fns3.formatISO)(/* @__PURE__ */ new Date());
|
|
11888
|
-
const rows = state3.rows;
|
|
11889
|
-
const newColumns = meta.columns.map(
|
|
11890
|
-
(c) => c.name === oldName ? { ...c, name: trimmedNewName } : c
|
|
11993
|
+
const result = renameColumnInMeta(
|
|
11994
|
+
meta,
|
|
11995
|
+
state3.rows,
|
|
11996
|
+
{ oldName, newName },
|
|
11997
|
+
{ nowIso: (0, import_date_fns3.formatISO)(/* @__PURE__ */ new Date()) }
|
|
11891
11998
|
);
|
|
11999
|
+
if (!result.ok) {
|
|
12000
|
+
return rejectWithValue(result.error);
|
|
12001
|
+
}
|
|
12002
|
+
const { meta: nextMeta, metaChanges, rows: newRows, rowPatches } = result.value;
|
|
11892
12003
|
try {
|
|
11893
|
-
const rowsWithOldField = rows.filter(
|
|
11894
|
-
(row) => Object.prototype.hasOwnProperty.call(row, oldName)
|
|
11895
|
-
);
|
|
11896
12004
|
await Promise.all(
|
|
11897
|
-
|
|
11898
|
-
const changes = {
|
|
11899
|
-
[trimmedNewName]: row[oldName],
|
|
11900
|
-
[oldName]: null,
|
|
11901
|
-
updatedAt: nowIso
|
|
11902
|
-
};
|
|
11903
|
-
return dispatch(
|
|
11904
|
-
patch({
|
|
11905
|
-
dbKey: row.dbKey,
|
|
11906
|
-
changes
|
|
11907
|
-
})
|
|
11908
|
-
).unwrap();
|
|
11909
|
-
})
|
|
12005
|
+
rowPatches.map((p) => dispatch(patch(p)).unwrap())
|
|
11910
12006
|
);
|
|
11911
12007
|
await dispatch(
|
|
11912
|
-
patch({
|
|
11913
|
-
dbKey: meta.dbKey,
|
|
11914
|
-
changes: {
|
|
11915
|
-
columns: newColumns,
|
|
11916
|
-
updatedAt: nowIso
|
|
11917
|
-
}
|
|
11918
|
-
})
|
|
12008
|
+
patch({ dbKey: meta.dbKey, changes: metaChanges })
|
|
11919
12009
|
).unwrap();
|
|
11920
|
-
|
|
11921
|
-
if (!Object.prototype.hasOwnProperty.call(row, oldName)) {
|
|
11922
|
-
return row;
|
|
11923
|
-
}
|
|
11924
|
-
const { [oldName]: oldValue, ...rest } = row;
|
|
11925
|
-
return {
|
|
11926
|
-
...rest,
|
|
11927
|
-
[trimmedNewName]: oldValue,
|
|
11928
|
-
updatedAt: nowIso
|
|
11929
|
-
};
|
|
11930
|
-
});
|
|
11931
|
-
return {
|
|
11932
|
-
meta: {
|
|
11933
|
-
...meta,
|
|
11934
|
-
columns: newColumns,
|
|
11935
|
-
updatedAt: nowIso
|
|
11936
|
-
},
|
|
11937
|
-
rows: newRows
|
|
11938
|
-
};
|
|
12010
|
+
return { meta: nextMeta, rows: newRows };
|
|
11939
12011
|
} catch (e) {
|
|
11940
12012
|
return rejectWithValue(e.message || "\u91CD\u547D\u540D\u5B57\u6BB5\u5931\u8D25");
|
|
11941
12013
|
}
|
|
@@ -11962,38 +12034,24 @@ var tableSlice = createSliceWithThunks3({
|
|
|
11962
12034
|
renameColumnLabel: create.asyncThunk(
|
|
11963
12035
|
async (args, { dispatch, getState, rejectWithValue }) => {
|
|
11964
12036
|
const { tenantId, tableId, columnId, newLabel } = args;
|
|
11965
|
-
const trimmedLabel = newLabel.trim();
|
|
11966
|
-
if (!trimmedLabel) {
|
|
11967
|
-
return rejectWithValue("\u5B57\u6BB5\u663E\u793A\u540D\u4E0D\u80FD\u4E3A\u7A7A");
|
|
11968
|
-
}
|
|
11969
12037
|
const state3 = getState().table;
|
|
11970
12038
|
const meta = state3.currentTable;
|
|
11971
12039
|
if (!meta || meta.tenantId !== tenantId || meta.tableId !== tableId) {
|
|
11972
12040
|
return rejectWithValue("\u5F53\u524D\u6CA1\u6709\u52A0\u8F7D\u5BF9\u5E94\u7684\u8868\u5B9A\u4E49");
|
|
11973
12041
|
}
|
|
11974
|
-
const
|
|
11975
|
-
|
|
11976
|
-
|
|
11977
|
-
|
|
11978
|
-
const nowIso = (0, import_date_fns3.formatISO)(/* @__PURE__ */ new Date());
|
|
11979
|
-
const newColumns = meta.columns.map(
|
|
11980
|
-
(c) => c.id === columnId ? { ...c, label: trimmedLabel } : c
|
|
12042
|
+
const result = renameColumnLabelInMeta(
|
|
12043
|
+
meta,
|
|
12044
|
+
{ columnId, label: newLabel },
|
|
12045
|
+
{ nowIso: (0, import_date_fns3.formatISO)(/* @__PURE__ */ new Date()) }
|
|
11981
12046
|
);
|
|
12047
|
+
if (!result.ok) {
|
|
12048
|
+
return rejectWithValue(result.error);
|
|
12049
|
+
}
|
|
12050
|
+
const { meta: nextMeta, metaChanges } = result.value;
|
|
11982
12051
|
try {
|
|
11983
12052
|
await dispatch(
|
|
11984
|
-
patch({
|
|
11985
|
-
dbKey: meta.dbKey,
|
|
11986
|
-
changes: {
|
|
11987
|
-
columns: newColumns,
|
|
11988
|
-
updatedAt: nowIso
|
|
11989
|
-
}
|
|
11990
|
-
})
|
|
12053
|
+
patch({ dbKey: meta.dbKey, changes: metaChanges })
|
|
11991
12054
|
).unwrap();
|
|
11992
|
-
const nextMeta = {
|
|
11993
|
-
...meta,
|
|
11994
|
-
columns: newColumns,
|
|
11995
|
-
updatedAt: nowIso
|
|
11996
|
-
};
|
|
11997
12055
|
return nextMeta;
|
|
11998
12056
|
} catch (e) {
|
|
11999
12057
|
return rejectWithValue(e.message || "\u91CD\u547D\u540D\u5B57\u6BB5\u663E\u793A\u540D\u5931\u8D25");
|
|
@@ -12024,30 +12082,19 @@ var tableSlice = createSliceWithThunks3({
|
|
|
12024
12082
|
if (!meta || meta.tenantId !== tenantId || meta.tableId !== tableId) {
|
|
12025
12083
|
return rejectWithValue("\u5F53\u524D\u6CA1\u6709\u52A0\u8F7D\u5BF9\u5E94\u7684\u8868\u5B9A\u4E49");
|
|
12026
12084
|
}
|
|
12027
|
-
const
|
|
12028
|
-
|
|
12029
|
-
|
|
12030
|
-
|
|
12031
|
-
const normalizedWidth = typeof width === "number" && width > 0 ? Math.round(width) : void 0;
|
|
12032
|
-
const nowIso = (0, import_date_fns3.formatISO)(/* @__PURE__ */ new Date());
|
|
12033
|
-
const newColumns = meta.columns.map(
|
|
12034
|
-
(c) => c.id === columnId ? { ...c, width: normalizedWidth } : c
|
|
12085
|
+
const result = updateColumnWidthInMeta(
|
|
12086
|
+
meta,
|
|
12087
|
+
{ columnId, width },
|
|
12088
|
+
{ nowIso: (0, import_date_fns3.formatISO)(/* @__PURE__ */ new Date()) }
|
|
12035
12089
|
);
|
|
12090
|
+
if (!result.ok) {
|
|
12091
|
+
return rejectWithValue(result.error);
|
|
12092
|
+
}
|
|
12093
|
+
const { meta: nextMeta, metaChanges } = result.value;
|
|
12036
12094
|
try {
|
|
12037
12095
|
await dispatch(
|
|
12038
|
-
patch({
|
|
12039
|
-
dbKey: meta.dbKey,
|
|
12040
|
-
changes: {
|
|
12041
|
-
columns: newColumns,
|
|
12042
|
-
updatedAt: nowIso
|
|
12043
|
-
}
|
|
12044
|
-
})
|
|
12096
|
+
patch({ dbKey: meta.dbKey, changes: metaChanges })
|
|
12045
12097
|
).unwrap();
|
|
12046
|
-
const nextMeta = {
|
|
12047
|
-
...meta,
|
|
12048
|
-
columns: newColumns,
|
|
12049
|
-
updatedAt: nowIso
|
|
12050
|
-
};
|
|
12051
12098
|
return nextMeta;
|
|
12052
12099
|
} catch (e) {
|
|
12053
12100
|
return rejectWithValue(e.message || "\u66F4\u65B0\u5B57\u6BB5\u5BBD\u5EA6\u5931\u8D25");
|
|
@@ -12280,11 +12327,11 @@ var ENTITY_DELETE_STRATEGIES = {
|
|
|
12280
12327
|
await dispatch(deleteTable({ dbKey: key })).unwrap();
|
|
12281
12328
|
},
|
|
12282
12329
|
file: async (key, { thunkAPI }) => {
|
|
12283
|
-
const { deleteFileAction } = await import("./deleteFile-
|
|
12330
|
+
const { deleteFileAction } = await import("./deleteFile-WDZ3VM7B.js");
|
|
12284
12331
|
await deleteFileAction(key, thunkAPI);
|
|
12285
12332
|
},
|
|
12286
12333
|
image: async (key, { thunkAPI }) => {
|
|
12287
|
-
const { deleteFileAction } = await import("./deleteFile-
|
|
12334
|
+
const { deleteFileAction } = await import("./deleteFile-WDZ3VM7B.js");
|
|
12288
12335
|
await deleteFileAction(key, thunkAPI);
|
|
12289
12336
|
},
|
|
12290
12337
|
agent: async (key, { dispatch, userId, sourceServerOrigin }) => {
|
|
@@ -12367,9 +12414,9 @@ var deleteContentFromSpaceAction = async (input, thunkAPI) => {
|
|
|
12367
12414
|
sourceServerOrigin
|
|
12368
12415
|
});
|
|
12369
12416
|
}
|
|
12370
|
-
} catch (
|
|
12371
|
-
console.error(`[deleteContent] Failed to delete entity ${entityKey}:`,
|
|
12372
|
-
entityRemoveError =
|
|
12417
|
+
} catch (err2) {
|
|
12418
|
+
console.error(`[deleteContent] Failed to delete entity ${entityKey}:`, err2);
|
|
12419
|
+
entityRemoveError = err2.message || "Unknown error";
|
|
12373
12420
|
}
|
|
12374
12421
|
return {
|
|
12375
12422
|
contentKey,
|
|
@@ -13690,8 +13737,8 @@ async function resolveMemberId(db, identifier) {
|
|
|
13690
13737
|
matchCount++;
|
|
13691
13738
|
}
|
|
13692
13739
|
}
|
|
13693
|
-
} catch (
|
|
13694
|
-
logger.warn({ err, identifier: trimmed }, "Failed to scan users by username");
|
|
13740
|
+
} catch (err2) {
|
|
13741
|
+
logger.warn({ err: err2, identifier: trimmed }, "Failed to scan users by username");
|
|
13695
13742
|
}
|
|
13696
13743
|
if (matchCount > 1) {
|
|
13697
13744
|
throw new Error(
|
|
@@ -13877,8 +13924,8 @@ async function getUserDataOnce({
|
|
|
13877
13924
|
const localResults = await fetchUserData(db, typeArray, effectiveUserId);
|
|
13878
13925
|
const localData = Object.values(localResults).flat();
|
|
13879
13926
|
return { data: localData };
|
|
13880
|
-
} catch (
|
|
13881
|
-
const error =
|
|
13927
|
+
} catch (err2) {
|
|
13928
|
+
const error = err2 instanceof Error ? err2 : new Error("Unknown error occurred");
|
|
13882
13929
|
return { data: [], error };
|
|
13883
13930
|
}
|
|
13884
13931
|
}
|
|
@@ -14227,8 +14274,8 @@ var deleteDbKey = (input, spaceId) => async (dispatch, getState) => {
|
|
|
14227
14274
|
spaceId: spaceId2,
|
|
14228
14275
|
...preferredServerOrigin ? { sourceServerOrigin: preferredServerOrigin } : {}
|
|
14229
14276
|
})
|
|
14230
|
-
).unwrap().catch((
|
|
14231
|
-
console.warn("[deleteDbKey] space cleanup failed (entity already tombstoned):",
|
|
14277
|
+
).unwrap().catch((err2) => {
|
|
14278
|
+
console.warn("[deleteDbKey] space cleanup failed (entity already tombstoned):", err2);
|
|
14232
14279
|
})
|
|
14233
14280
|
)
|
|
14234
14281
|
);
|
|
@@ -14334,10 +14381,10 @@ var deleteLocalSpaceAuthority = async (spaceId, spaceData, dispatch) => {
|
|
|
14334
14381
|
},
|
|
14335
14382
|
dispatch
|
|
14336
14383
|
);
|
|
14337
|
-
} catch (
|
|
14384
|
+
} catch (err2) {
|
|
14338
14385
|
console.warn(
|
|
14339
14386
|
`Failed to tombstone local membership ${memberId} for space ${spaceId}:`,
|
|
14340
|
-
|
|
14387
|
+
err2
|
|
14341
14388
|
);
|
|
14342
14389
|
}
|
|
14343
14390
|
}
|
|
@@ -14347,9 +14394,9 @@ var deleteAllMembers = async (spaceData, spaceId, dispatch) => {
|
|
|
14347
14394
|
for (const memberId of spaceData.members) {
|
|
14348
14395
|
const memberKey = createSpaceKey.member(memberId, spaceId);
|
|
14349
14396
|
await dispatch(remove(memberKey)).unwrap().catch(
|
|
14350
|
-
(
|
|
14397
|
+
(err2) => console.warn(
|
|
14351
14398
|
`Failed to delete member ${memberId} for space ${spaceId}:`,
|
|
14352
|
-
|
|
14399
|
+
err2
|
|
14353
14400
|
)
|
|
14354
14401
|
);
|
|
14355
14402
|
}
|
|
@@ -14358,9 +14405,9 @@ var deleteAllMembers = async (spaceData, spaceId, dispatch) => {
|
|
|
14358
14405
|
var deleteCurrentUserMember = async (userId, spaceId, dispatch) => {
|
|
14359
14406
|
const currentUserMemberKey = createSpaceKey.member(userId, spaceId);
|
|
14360
14407
|
await dispatch(remove(currentUserMemberKey)).unwrap().catch(
|
|
14361
|
-
(
|
|
14408
|
+
(err2) => console.warn(
|
|
14362
14409
|
`Failed to delete member key for user ${userId} in space ${spaceId}:`,
|
|
14363
|
-
|
|
14410
|
+
err2
|
|
14364
14411
|
)
|
|
14365
14412
|
);
|
|
14366
14413
|
};
|
|
@@ -14479,7 +14526,7 @@ var fetchSpaceAction = async (input, thunkAPI) => {
|
|
|
14479
14526
|
const spaceKey = createSpaceKey.space(spaceId);
|
|
14480
14527
|
const readSpace = async (dbKey) => {
|
|
14481
14528
|
try {
|
|
14482
|
-
const { read: read2, readAndWait: readAndWait2 } = await import("./dbSlice-
|
|
14529
|
+
const { read: read2, readAndWait: readAndWait2 } = await import("./dbSlice-CGSRFJN3.js");
|
|
14483
14530
|
if (fresh) {
|
|
14484
14531
|
return await dispatch(readAndWait2(dbKey)).unwrap();
|
|
14485
14532
|
}
|
|
@@ -15183,6 +15230,7 @@ export {
|
|
|
15183
15230
|
messageStreamEnd,
|
|
15184
15231
|
addToolMessage,
|
|
15185
15232
|
updateToolMessage,
|
|
15233
|
+
appendOverlayMessage,
|
|
15186
15234
|
setWorkflow,
|
|
15187
15235
|
updateStep,
|
|
15188
15236
|
incrementStepsExecuted,
|