nolo-cli 0.11.0 → 0.12.0-alpha.10
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-ZEDPX6OF.js → _executeModel-4F7VZR5U.js} +52 -50
- package/{action-AA4IJ5K2.js → action-OTOWUMPW.js} +8 -9
- package/{addContentAction-QYVO4SYP.js → addContentAction-JGBUVR7K.js} +7 -9
- package/{addDialogAgentAction-WVVKT5WQ.js → addDialogAgentAction-V6CL2UCF.js} +9 -10
- package/{agentDeleteCommand-RDPGYIWF.js → agentDeleteCommand-MMRSG6AB.js} +39 -28
- package/{agentEmailCommands-2HJJKS5F.js → agentEmailCommands-YFVKOGM7.js} +65 -62
- package/{agentListCommands-HFEVV3ZW.js → agentListCommands-2PZHIQ3I.js} +128 -31
- package/{agentMachineCommands-25ZOENJU.js → agentMachineCommands-55UUZNHF.js} +38 -26
- package/{agentPullCommand-GOL2S4W2.js → agentPullCommand-KRBRIFIY.js} +7 -7
- package/{agentRecordCommands-GTCOAM3L.js → agentRecordCommands-BTP3OAPL.js} +57 -54
- package/{agentRunCommand-YBS3JDLD.js → agentRunCommand-AA4QLRQZ.js} +60 -59
- package/{agentRunControl-K4VKNEHF.js → agentRunControl-IX4F5W2C.js} +3 -3
- package/{agentRuntimeLocal-UQBMQI2M.js → agentRuntimeLocal-QDJCBXM2.js} +31 -15
- package/{agentSlice-6EKOBCCS.js → agentSlice-6JAJOU3X.js} +8 -9
- package/{authCommand-O2OWACN4.js → authCommand-DMW336GT.js} +15 -15
- package/{authCommands-H7365TZP.js → authCommands-GH5T6RYV.js} +6 -6
- package/{chunk-E4HNJSHC.js → chunk-2BVGERJ2.js} +81 -19
- package/{chunk-LP65VRCI.js → chunk-3MI5LDDU.js} +6 -6
- package/{chunk-OPZYGHUC.js → chunk-3WGLLTK4.js} +59 -1
- package/{chunk-KJR5KAUQ.js → chunk-3XF6LCCN.js} +20 -7
- package/{chunk-PXZAAB4L.js → chunk-4LG74DRG.js} +4 -4
- package/{chunk-2FTTDCD4.js → chunk-4ON5AV72.js} +2 -1
- package/{chunk-IWX4UW2E.js → chunk-524BDL33.js} +89 -8
- package/{chunk-ISNCLGUZ.js → chunk-5NBHQD4D.js} +4 -3
- package/{chunk-ZPRK73XY.js → chunk-5S4SWV5G.js} +51 -38
- package/{chunk-EVZKZF32.js → chunk-5V524MHX.js} +195 -78
- package/{chunk-CKOJQDKR.js → chunk-7JJCGV7N.js} +146 -3
- package/{chunk-NEM67FX7.js → chunk-ARSC56DC.js} +1 -1
- package/{chunk-AFON4QUU.js → chunk-AS3ZQ3O2.js} +19 -28
- package/{chunk-4SOKXIW4.js → chunk-B4KT7RN2.js} +10 -13
- package/chunk-BYXBJQAS.js +0 -0
- package/{chunk-PXQN7IBQ.js → chunk-C3BFP57W.js} +95 -2
- package/{chunk-AEZAORLG.js → chunk-CGDQDXKZ.js} +5 -5
- package/{chunk-MQI77IRB.js → chunk-DPFWKRHG.js} +2 -2
- package/{chunk-TACHTH5D.js → chunk-EIMX5ER5.js} +18 -18
- package/{chunk-5MOUAAMK.js → chunk-FSUZIGIG.js} +197 -2578
- package/{chunk-FXXSGWAJ.js → chunk-H5Y2H2N6.js} +1 -1
- package/chunk-IKXL2HZ3.js +70 -0
- package/{chunk-QNMFBBZK.js → chunk-IVAOVLM7.js} +1 -1
- package/chunk-JFANOO7I.js +2274 -0
- package/{chunk-YPRZSPF3.js → chunk-JKWWVF2I.js} +1 -1
- package/{chunk-3NSIQZZ6.js → chunk-JU7J7EAV.js} +45 -45
- package/{chunk-X2S7JTIG.js → chunk-KWBH4RAL.js} +1280 -137
- package/{chunk-OUI3ZHYD.js → chunk-LUKQQJFL.js} +39 -2
- package/{chunk-BX6U3ETE.js → chunk-MG6BVV3T.js} +320 -102
- package/{chunk-L53FGHA4.js → chunk-MQRZ5QUH.js} +1 -1
- package/{chunk-2W2VYVI5.js → chunk-MZHSAPZP.js} +675 -177
- package/{chunk-YOCHZD7D.js → chunk-NCGFB7NN.js} +5 -3
- package/{chunk-DWGAEFJL.js → chunk-O4FOPRCP.js} +1 -1
- package/chunk-OGGHETUE.js +4900 -0
- package/{chunk-PNEW2Z3T.js → chunk-OHEKYYJF.js} +7 -7
- package/chunk-OOIN7HSO.js +146 -0
- package/{chunk-SV5MWASH.js → chunk-OPM2DE2J.js} +12 -12
- package/{chunk-5OIFWVX7.js → chunk-QJSTNKJY.js} +1 -1
- package/{chunk-C4FTUXVF.js → chunk-QLUFR47U.js} +11 -1
- package/{chunk-LAX2JSTX.js → chunk-QUHUVG6Y.js} +20 -2
- package/{chunk-D6OQHXVG.js → chunk-RQSOAMPJ.js} +22 -6
- package/{chunk-ZEYDOXHF.js → chunk-RUGEW4P7.js} +1515 -884
- package/{chunk-GBDSZATH.js → chunk-RWO5DGXI.js} +3 -3
- package/{chunk-S3GS2PRL.js → chunk-TA7VKOHU.js} +613 -70
- package/{chunk-XYZA7S7V.js → chunk-TQYYGE6G.js} +6 -6
- package/{chunk-YTBMA7NO.js → chunk-TYPHUVK5.js} +70 -8
- package/{chunk-4ZDM73SD.js → chunk-V2J635L5.js} +1 -1
- package/{chunk-C2MDQQ4O.js → chunk-VBSWHE5W.js} +1 -1
- package/{chunk-O26GI2JP.js → chunk-VKG4HXYV.js} +39 -8
- package/{chunk-IPYUUY4E.js → chunk-WPHL6ALY.js} +1 -1
- package/{chunk-7D3JY6C2.js → chunk-WVTBAALN.js} +64 -5
- package/{chunk-XFOLQLDN.js → chunk-XHQWJUW4.js} +2 -2
- package/{chunk-Q3UKJVU4.js → chunk-Y5P3ZRGC.js} +10 -10
- package/{chunk-KQQVGRA3.js → chunk-YUMYYXPI.js} +53 -183
- package/cliEnvHelpers-VYC2OPTB.js +30 -0
- package/{createAgentAutomationAction-LTI5QU35.js → createAgentAutomationAction-4NY4JLOK.js} +26 -26
- package/{createDialogAction-OJJ7L3L3.js → createDialogAction-I5WUWFJ6.js} +26 -26
- package/{createPageAction-5MXWVRGY.js → createPageAction-HFTIQ7TW.js} +26 -26
- package/{dbSlice-RQFQQVHT.js → dbSlice-J4PUZ6Y5.js} +6 -7
- package/{deleteFile-7XP5BGC7.js → deleteFile-M7UNIUOO.js} +4 -4
- package/{dialogCommands-JTJ3RPPW.js → dialogCommands-SVXRJFZS.js} +34 -23
- package/{dialogSlice-OWROKURJ.js → dialogSlice-35LA3ZRG.js} +26 -26
- package/{docCreateCommands-WJBEW2V7.js → docCreateCommands-Z7RIAYKQ.js} +34 -23
- package/{docDeleteCommands-BVEHJOY5.js → docDeleteCommands-NEYHUVZF.js} +35 -25
- package/{docReadCommands-NEWOZIJV.js → docReadCommands-I4US2SDE.js} +34 -23
- package/{docStore-3DXRYBMD.js → docStore-3CP2IO6M.js} +25 -25
- package/{docUpdateCommands-C7WHT7UU.js → docUpdateCommands-UU5HQBRP.js} +34 -23
- package/fetchMessages-KTNM7QAR.js +1 -1
- package/{getPricing-3E6UNPKL.js → getPricing-UGDJHI7M.js} +7 -3
- package/{handleSendMessageAction-B5PRR7BE.js → handleSendMessageAction-FWTLQGOZ.js} +30 -30
- package/index.js +77 -76
- package/{localDialogRead-YSKFFRTT.js → localDialogRead-2VRI24F4.js} +1 -1
- package/{machineCommands-IIIREAEK.js → machineCommands-STHZKBDJ.js} +64 -61
- package/{machineWsRunDispatch-3SIU6ILW.js → machineWsRunDispatch-7YHT4TPT.js} +56 -53
- package/{memoryCommands-O4MIPIWQ.js → memoryCommands-AFMES3LN.js} +5 -5
- package/{models-4OPOOLFS.js → models-LSCRJJ6P.js} +2 -2
- package/package.json +1 -1
- package/{read-QJNKRROM.js → read-2MIMRBZ2.js} +4 -4
- package/{readDocTool-H6X6KO6X.js → readDocTool-QHVGQHUJ.js} +1 -1
- package/{readlineWorkspace-HGP3I3OC.js → readlineWorkspace-OMRWYMB6.js} +1279 -716
- package/{removeDialogAgentAction-TCT35SOF.js → removeDialogAgentAction-XUZYQBV4.js} +13 -13
- package/{runAgentClientLoop-EFM4PTVI.js → runAgentClientLoop-FP2K33ZO.js} +47 -46
- package/{runtimeDoctorCommands-ID43Z7VX.js → runtimeDoctorCommands-QNF3J3UV.js} +6 -6
- package/{setDialogExtraReferencesAction-CGYLZMFH.js → setDialogExtraReferencesAction-PTAIFKGM.js} +9 -10
- package/{setPrimaryDialogAgentAction-F6BFQDJU.js → setPrimaryDialogAgentAction-HRFTDB44.js} +13 -13
- package/{settingSlice-2I5HMG47.js → settingSlice-VGRJUSE5.js} +7 -8
- package/{skillDiscovery-UGSQGX2U.js → skillDiscovery-6M2BZUFN.js} +3 -3
- package/{spaceCommands-MT7BWCIL.js → spaceCommands-GN73BCOB.js} +38 -29
- package/{spaceSlice-BS5TSW3W.js → spaceSlice-WTFNKOVA.js} +30 -26
- package/{streamAgentChatTurn-I3VBFNR3.js → streamAgentChatTurn-HBAQQVNK.js} +442 -130
- package/{toolApiClient-C7P7YSE4.js → toolApiClient-QI3YBNWB.js} +2 -2
- package/{tools-XSD2BOEN.js → tools-TPQYTLQZ.js} +34 -33
- package/{tuiSummaryLlmCaller-32NRHTT2.js → tuiSummaryLlmCaller-XDC7WG4K.js} +11 -7
- package/{updateCommands-VOSPKXFF.js → updateCommands-XZDOOYFH.js} +13 -5
- package/{updateDialogTitleAction-7FYNJOGP.js → updateDialogTitleAction-AWXNPUQJ.js} +30 -29
- package/chunk-AZPCASRE.js +0 -36
- package/chunk-BBYVOSU2.js +0 -792
- package/chunk-DCOA4QSN.js +0 -105
- package/chunk-UAD2WT54.js +0 -64
- package/{chunk-JK7VW2FN.js → chunk-5MIDPSSK.js} +3 -3
- package/{chunk-5CS33IBL.js → chunk-PDL2AV3E.js} +3 -3
- package/{chunk-5MMZUWSG.js → chunk-TOILAPLH.js} +5 -5
- package/{chunk-OOM6SJNR.js → chunk-TSUJOM6N.js} +6 -6
- package/{db-6QED3ZVO.js → db-HCJ5PRB5.js} +3 -3
- package/{offlineMarxistsAgentCommand-BCPJITJL.js → offlineMarxistsAgentCommand-5OOWZLJI.js} +3 -3
- package/{tableCommands-M3DJUETS.js → tableCommands-E4SQWDOX.js} +6 -6
- package/{understanding-ZOESBLF3.js → understanding-3CUQQ6SV.js} +3 -3
|
@@ -1,19 +1,19 @@
|
|
|
1
1
|
import {
|
|
2
2
|
updateContentTitle
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-FSUZIGIG.js";
|
|
4
4
|
import {
|
|
5
5
|
require_date_fns
|
|
6
6
|
} from "./chunk-M76ECQRD.js";
|
|
7
|
-
import {
|
|
8
|
-
patch,
|
|
9
|
-
readAndWait
|
|
10
|
-
} from "./chunk-O26GI2JP.js";
|
|
11
7
|
import {
|
|
12
8
|
require_react
|
|
13
9
|
} from "./chunk-3ASDTTEI.js";
|
|
14
10
|
import {
|
|
15
11
|
toErrorMessage
|
|
16
12
|
} from "./chunk-HNMXYYJR.js";
|
|
13
|
+
import {
|
|
14
|
+
patch,
|
|
15
|
+
readAndWait
|
|
16
|
+
} from "./chunk-VKG4HXYV.js";
|
|
17
17
|
import {
|
|
18
18
|
asOptionalTrimmedString
|
|
19
19
|
} from "./chunk-G3SUCT4W.js";
|
|
@@ -367,7 +367,7 @@ async function saveDocState(arg, { dispatch, getState }) {
|
|
|
367
367
|
}
|
|
368
368
|
}
|
|
369
369
|
async function createDocState(args, thunkApi) {
|
|
370
|
-
const { createPageAction } = await import("./createPageAction-
|
|
370
|
+
const { createPageAction } = await import("./createPageAction-HFTIQ7TW.js");
|
|
371
371
|
return createPageAction(args, thunkApi);
|
|
372
372
|
}
|
|
373
373
|
function subscribe(listener) {
|
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
import {
|
|
2
2
|
getModelConfig
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-OGGHETUE.js";
|
|
4
4
|
import {
|
|
5
5
|
asTrimmedLowercaseString
|
|
6
6
|
} from "./chunk-QSJ3HFEF.js";
|
|
7
|
-
import {
|
|
8
|
-
asTrimmedString
|
|
9
|
-
} from "./chunk-3EUW3WEO.js";
|
|
10
7
|
import {
|
|
11
8
|
isRecord
|
|
12
9
|
} from "./chunk-KUG52IAP.js";
|
|
10
|
+
import {
|
|
11
|
+
asTrimmedString
|
|
12
|
+
} from "./chunk-3EUW3WEO.js";
|
|
13
13
|
import {
|
|
14
14
|
normalizeServerOrigin
|
|
15
15
|
} from "./chunk-CF7PE763.js";
|
|
@@ -29,8 +29,35 @@ function pickAgentRuntimeInferenceOptions(agentConfig) {
|
|
|
29
29
|
};
|
|
30
30
|
}
|
|
31
31
|
|
|
32
|
+
// packages/agent-runtime/openAiCompatibleMessages.ts
|
|
33
|
+
function preserveAgentStateFields(source, target) {
|
|
34
|
+
const mutableTarget = target;
|
|
35
|
+
if (source.role === "assistant") {
|
|
36
|
+
if (typeof source.reasoning_content === "string") {
|
|
37
|
+
mutableTarget.reasoning_content = source.reasoning_content;
|
|
38
|
+
}
|
|
39
|
+
if (Array.isArray(source.tool_calls)) {
|
|
40
|
+
mutableTarget.tool_calls = source.tool_calls;
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
if (source.role === "tool") {
|
|
44
|
+
const toolCallId = typeof source.tool_call_id === "string" ? source.tool_call_id.trim() : typeof source.toolCallId === "string" ? source.toolCallId.trim() : "";
|
|
45
|
+
if (toolCallId) mutableTarget.tool_call_id = toolCallId;
|
|
46
|
+
}
|
|
47
|
+
return target;
|
|
48
|
+
}
|
|
49
|
+
function toOpenAiCompatibleMessages(messages) {
|
|
50
|
+
return messages.map(
|
|
51
|
+
(message) => preserveAgentStateFields(message, {
|
|
52
|
+
role: message.role,
|
|
53
|
+
content: message.content ?? ""
|
|
54
|
+
})
|
|
55
|
+
);
|
|
56
|
+
}
|
|
57
|
+
|
|
32
58
|
// packages/agent-runtime/platformProviderEndpoints.ts
|
|
33
59
|
var OPENAI_RESPONSES_ENDPOINT = "https://api.openai.com/v1/responses";
|
|
60
|
+
var DEEPSEEK_RESPONSES_ENDPOINT = "https://api.deepseek.com/v1/responses";
|
|
34
61
|
var PLATFORM_CHAT_COMPLETIONS_ENDPOINTS = {
|
|
35
62
|
deepinfra: "https://api.deepinfra.com/v1/openai/chat/completions",
|
|
36
63
|
deepseek: "https://api.deepseek.com/chat/completions",
|
|
@@ -47,7 +74,11 @@ var PLATFORM_CHAT_COMPLETIONS_ENDPOINTS = {
|
|
|
47
74
|
nolo: "https://ollama.com/v1/chat/completions"
|
|
48
75
|
};
|
|
49
76
|
function isOpenAiResponsesModel(args) {
|
|
50
|
-
|
|
77
|
+
const provider = asTrimmedLowercaseString(args.provider);
|
|
78
|
+
if (provider === "deepseek") {
|
|
79
|
+
return asTrimmedLowercaseString(args.model) === "deepseek-v4-flash";
|
|
80
|
+
}
|
|
81
|
+
if (provider !== "openai") return false;
|
|
51
82
|
if (args.endpointKey === "responses") return true;
|
|
52
83
|
if (!args.model) return false;
|
|
53
84
|
try {
|
|
@@ -56,10 +87,24 @@ function isOpenAiResponsesModel(args) {
|
|
|
56
87
|
return false;
|
|
57
88
|
}
|
|
58
89
|
}
|
|
90
|
+
function resolvePlatformResponsesEndpoint(provider) {
|
|
91
|
+
switch (asTrimmedLowercaseString(provider)) {
|
|
92
|
+
case "openai":
|
|
93
|
+
return OPENAI_RESPONSES_ENDPOINT;
|
|
94
|
+
case "deepseek":
|
|
95
|
+
return DEEPSEEK_RESPONSES_ENDPOINT;
|
|
96
|
+
default:
|
|
97
|
+
return void 0;
|
|
98
|
+
}
|
|
99
|
+
}
|
|
100
|
+
var PLATFORM_PROVIDER_ENDPOINT_ALIASES = {
|
|
101
|
+
"ollama-cloud": "nolo"
|
|
102
|
+
};
|
|
59
103
|
function resolvePlatformChatCompletionsEndpoint(provider) {
|
|
60
104
|
const key = asTrimmedLowercaseString(provider);
|
|
61
105
|
if (!key) return void 0;
|
|
62
|
-
|
|
106
|
+
const aliased = PLATFORM_PROVIDER_ENDPOINT_ALIASES[key] ?? key;
|
|
107
|
+
return PLATFORM_CHAT_COMPLETIONS_ENDPOINTS[aliased];
|
|
63
108
|
}
|
|
64
109
|
|
|
65
110
|
// packages/agent-runtime/providerResolution.ts
|
|
@@ -77,7 +122,7 @@ function resolvePlatformProviderEndpoint(agentConfig) {
|
|
|
77
122
|
model: agentConfig.model,
|
|
78
123
|
endpointKey: agentConfig.endpointKey
|
|
79
124
|
})) {
|
|
80
|
-
return
|
|
125
|
+
return resolvePlatformResponsesEndpoint(provider) ?? "";
|
|
81
126
|
}
|
|
82
127
|
const endpoint = resolvePlatformChatCompletionsEndpoint(provider);
|
|
83
128
|
if (!endpoint) {
|
|
@@ -407,6 +452,9 @@ var convertMessagesToResponsesInput = (messages) => {
|
|
|
407
452
|
continue;
|
|
408
453
|
}
|
|
409
454
|
const role = message.role;
|
|
455
|
+
if (role === "assistant" && typeof message.reasoning_content === "string" && message.reasoning_content) {
|
|
456
|
+
input.push({ type: "reasoning", content: message.reasoning_content });
|
|
457
|
+
}
|
|
410
458
|
const contentParts = normalizeMessageParts(message.content, role);
|
|
411
459
|
if (contentParts.length > 0) {
|
|
412
460
|
input.push({
|
|
@@ -515,10 +563,24 @@ var extractToolCallsFromResponseOutput = (response) => {
|
|
|
515
563
|
return calls;
|
|
516
564
|
};
|
|
517
565
|
|
|
566
|
+
// packages/core/chat/imageParts.ts
|
|
567
|
+
function isImageUrlPart(part) {
|
|
568
|
+
return isRecord(part) && part.type === "image_url";
|
|
569
|
+
}
|
|
570
|
+
function hasImageParts(messages) {
|
|
571
|
+
return messages.some(
|
|
572
|
+
(message) => Array.isArray(message.content) && message.content.some(isImageUrlPart)
|
|
573
|
+
);
|
|
574
|
+
}
|
|
575
|
+
|
|
518
576
|
export {
|
|
519
577
|
pickAgentRuntimeInferenceOptions,
|
|
520
|
-
|
|
578
|
+
isImageUrlPart,
|
|
579
|
+
hasImageParts,
|
|
580
|
+
preserveAgentStateFields,
|
|
581
|
+
toOpenAiCompatibleMessages,
|
|
521
582
|
isOpenAiResponsesModel,
|
|
583
|
+
resolvePlatformResponsesEndpoint,
|
|
522
584
|
resolvePlatformChatCompletionsEndpoint,
|
|
523
585
|
trimTrailingSlash,
|
|
524
586
|
resolvePlatformServerUrl,
|
|
@@ -16,7 +16,7 @@ var BUILTIN_SUMMARY_LLM_CONFIG = {
|
|
|
16
16
|
provider: "deepseek",
|
|
17
17
|
id: "builtin-dialog-summary-llm",
|
|
18
18
|
name: "Builtin Dialog Summary LLM",
|
|
19
|
-
model: "deepseek-v4-
|
|
19
|
+
model: "deepseek-v4-flash",
|
|
20
20
|
prompt: "\u4F60\u662F\u4E00\u4E2A\u4E13\u4E1A\u7684\u5BF9\u8BDD\u8BB0\u5FC6\u52A9\u7406\u3002\u8BF7\u57FA\u4E8E\u3010\u73B0\u6709\u8BB0\u5FC6\u3011\u548C\u3010\u65B0\u589E\u5BF9\u8BDD\u3011\uFF0C\u8F93\u51FA\u4E00\u4EFD\u66F4\u65B0\u540E\u7684\u5BF9\u8BDD\u8BB0\u5FC6\u6863\u6848\u3002\u4E25\u683C\u53EA\u8F93\u51FA\u4E0B\u9762\u4E24\u90E8\u5206\uFF0C\u6807\u9898\u5FC5\u987B\u5B8C\u5168\u4E00\u81F4\uFF1A\n\u5173\u952E\u4E8B\u5B9E\u6863\u6848\n- ...\n\u5BF9\u8BDD\u5267\u60C5\u6458\u8981\n- ...\n\u8981\u6C42\uFF1A1) \u4F7F\u7528\u5BF9\u8BDD\u4E3B\u8BED\u8A00\uFF1B\u6DF7\u5408\u8BED\u8A00\u65F6\u4F18\u5148\u8DDF\u968F\u7528\u6237\u4E3B\u8981\u8BED\u8A00\uFF0C\u4E13\u6709\u540D\u8BCD\u4FDD\u7559\u539F\u6587\u30022) \u5173\u952E\u4E8B\u5B9E\u6863\u6848\u53EA\u4FDD\u7559\u4E4B\u540E\u7EE7\u7EED\u5BF9\u8BDD\u4ECD\u6709\u4EF7\u503C\u7684\u4FE1\u606F\uFF0C\u4F8B\u5982\u7528\u6237\u504F\u597D\u3001\u76EE\u6807\u3001\u7EA6\u675F\u3001\u6280\u672F\u6808\u3001\u786E\u5B9A\u7684\u6587\u4EF6\u540D/\u53D8\u91CF\u540D\u3001\u6838\u5FC3\u51B3\u7B56\u3001\u5F85\u529E\u4E8B\u9879\u30023) \u5BF9\u8BDD\u5267\u60C5\u6458\u8981\u5148\u6781\u7B80\u6982\u62EC\u65E7\u4E0A\u4E0B\u6587\uFF0C\u518D\u66F4\u8BE6\u7EC6\u8BB0\u5F55\u6700\u8FD1\u65B0\u589E\u7684\u8FDB\u5C55\u3001\u5206\u6B67\u3001\u7ED3\u8BBA\u548C\u4E0B\u4E00\u6B65\u30024) \u5FFD\u7565\u5BD2\u6684\u3001\u91CD\u590D\u5C1D\u8BD5\u3001\u5DF2\u653E\u5F03\u65B9\u6848\u548C\u65E0\u4EF7\u503C\u5E9F\u8BDD\u30025) \u4E0D\u8981\u7F16\u9020\u672A\u51FA\u73B0\u7684\u4FE1\u606F\uFF0C\u4E0D\u8981\u8F93\u51FA\u5F00\u573A\u767D\u3001\u7ED3\u675F\u8BED\u3001markdown \u4EE3\u7801\u5757\u6216\u989D\u5916\u7AE0\u8282\u3002"
|
|
21
21
|
};
|
|
22
22
|
var buildBuiltinSummaryContent = (previousSummary, messagesText) => `
|
|
@@ -1,11 +1,8 @@
|
|
|
1
|
-
import {
|
|
2
|
-
resolveFileCategory
|
|
3
|
-
} from "./chunk-AZPCASRE.js";
|
|
4
1
|
import {
|
|
5
2
|
loadFileFromIndexedDb,
|
|
6
3
|
removeAction,
|
|
7
4
|
saveFileToIndexedDb
|
|
8
|
-
} from "./chunk-
|
|
5
|
+
} from "./chunk-WPHL6ALY.js";
|
|
9
6
|
import {
|
|
10
7
|
fileKey,
|
|
11
8
|
getFileIdFromKey,
|
|
@@ -15,7 +12,7 @@ import {
|
|
|
15
12
|
readAction,
|
|
16
13
|
readRequestManager,
|
|
17
14
|
resolveAgentReadServers
|
|
18
|
-
} from "./chunk-
|
|
15
|
+
} from "./chunk-XHQWJUW4.js";
|
|
19
16
|
import {
|
|
20
17
|
asyncThunkCreator,
|
|
21
18
|
buildCreateSlice,
|
|
@@ -35,7 +32,7 @@ import {
|
|
|
35
32
|
shouldReplaceLocalWithRemoteRecord,
|
|
36
33
|
shouldReplicateLocalRecord,
|
|
37
34
|
uploadToCurrentServer
|
|
38
|
-
} from "./chunk-
|
|
35
|
+
} from "./chunk-TSUJOM6N.js";
|
|
39
36
|
import {
|
|
40
37
|
fetchFromClientDb,
|
|
41
38
|
fetchFromServer,
|
|
@@ -456,6 +453,39 @@ var upsertAction = async (upsertConfig, thunkApi) => {
|
|
|
456
453
|
}
|
|
457
454
|
};
|
|
458
455
|
|
|
456
|
+
// packages/app/utils/fileUtils.ts
|
|
457
|
+
var fileConstructor = typeof globalThis !== "undefined" && typeof globalThis.File === "function" ? globalThis.File : void 0;
|
|
458
|
+
var isImageMimeType = (value) => typeof value === "string" && value.toLowerCase().startsWith("image/");
|
|
459
|
+
var IMAGE_FILE_NAME_RE = /\.(avif|bmp|gif|heic|heif|ico|jpe?g|png|svg|tiff?|webp)$/i;
|
|
460
|
+
var VIDEO_FILE_NAME_RE = /\.(avi|m4v|mkv|mov|mp4|mpeg|mpg|webm)$/i;
|
|
461
|
+
var AUDIO_FILE_NAME_RE = /\.(aac|flac|m4a|mp3|ogg|wav|weba)$/i;
|
|
462
|
+
var DOCUMENT_FILE_NAME_RE = /\.(csv|doc|docx|md|odt|pdf|ppt|pptx|rtf|txt|xls|xlsx)$/i;
|
|
463
|
+
var isImageFileName = (value) => typeof value === "string" && IMAGE_FILE_NAME_RE.test(value.trim());
|
|
464
|
+
var isVideoMimeType = (value) => typeof value === "string" && value.toLowerCase().startsWith("video/");
|
|
465
|
+
var isAudioMimeType = (value) => typeof value === "string" && value.toLowerCase().startsWith("audio/");
|
|
466
|
+
var isPdfMimeType = (value) => typeof value === "string" && value.toLowerCase() === "application/pdf";
|
|
467
|
+
var isDocumentMimeType = (value) => {
|
|
468
|
+
if (typeof value !== "string") return false;
|
|
469
|
+
const normalized = value.toLowerCase();
|
|
470
|
+
return isPdfMimeType(normalized) || normalized === "text/plain" || normalized === "text/markdown" || normalized === "text/csv" || normalized === "application/msword" || normalized === "application/vnd.openxmlformats-officedocument.wordprocessingml.document" || normalized === "application/vnd.ms-powerpoint" || normalized === "application/vnd.openxmlformats-officedocument.presentationml.presentation" || normalized === "application/vnd.ms-excel" || normalized === "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet" || normalized === "application/rtf" || normalized === "application/vnd.oasis.opendocument.text";
|
|
471
|
+
};
|
|
472
|
+
var resolveFileCategory = ({
|
|
473
|
+
mimeType,
|
|
474
|
+
fileName
|
|
475
|
+
}) => {
|
|
476
|
+
if (isImageMimeType(mimeType) || isImageFileName(fileName)) return "image";
|
|
477
|
+
if (isVideoMimeType(mimeType) || typeof fileName === "string" && VIDEO_FILE_NAME_RE.test(fileName.trim())) {
|
|
478
|
+
return "video";
|
|
479
|
+
}
|
|
480
|
+
if (isAudioMimeType(mimeType) || typeof fileName === "string" && AUDIO_FILE_NAME_RE.test(fileName.trim())) {
|
|
481
|
+
return "audio";
|
|
482
|
+
}
|
|
483
|
+
if (isDocumentMimeType(mimeType) || typeof fileName === "string" && DOCUMENT_FILE_NAME_RE.test(fileName.trim())) {
|
|
484
|
+
return "document";
|
|
485
|
+
}
|
|
486
|
+
return "other";
|
|
487
|
+
};
|
|
488
|
+
|
|
459
489
|
// packages/database/actions/upload.ts
|
|
460
490
|
var saveToClientDb2 = async (clientDb, dbKey, metadata) => {
|
|
461
491
|
if (!clientDb) {
|
|
@@ -674,7 +704,7 @@ var dbSlice = createSliceWithThunks({
|
|
|
674
704
|
// 动态 import 在调用期解析,避开 TDZ/求值顺序问题(同下方 share)。
|
|
675
705
|
read: create.asyncThunk(
|
|
676
706
|
async (payload, thunkApi) => {
|
|
677
|
-
const { readAction: readAction2 } = await import("./read-
|
|
707
|
+
const { readAction: readAction2 } = await import("./read-2MIMRBZ2.js");
|
|
678
708
|
return readAction2(payload, thunkApi);
|
|
679
709
|
},
|
|
680
710
|
{
|
|
@@ -748,7 +778,7 @@ var dbSlice = createSliceWithThunks({
|
|
|
748
778
|
// 这里改成动态 import,运行期才解析,彻底断开这条边。
|
|
749
779
|
share: create.asyncThunk(
|
|
750
780
|
async (config, thunkApi) => {
|
|
751
|
-
const { shareResourceAction } = await import("./action-
|
|
781
|
+
const { shareResourceAction } = await import("./action-OTOWUMPW.js");
|
|
752
782
|
return shareResourceAction(config, thunkApi);
|
|
753
783
|
}
|
|
754
784
|
),
|
|
@@ -784,6 +814,7 @@ var dbSlice_default = dbSlice.reducer;
|
|
|
784
814
|
export {
|
|
785
815
|
readAndWaitAction,
|
|
786
816
|
toTimestampMs,
|
|
817
|
+
resolveFileCategory,
|
|
787
818
|
uploadFileAction,
|
|
788
819
|
dbAdapter,
|
|
789
820
|
selectById,
|
|
@@ -1,15 +1,72 @@
|
|
|
1
|
-
import {
|
|
2
|
-
createSpaceKey
|
|
3
|
-
} from "./chunk-UAD2WT54.js";
|
|
4
1
|
import {
|
|
5
2
|
patch,
|
|
6
3
|
read
|
|
7
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-VKG4HXYV.js";
|
|
8
5
|
import {
|
|
9
6
|
DEVICE_LOCAL_OWNER_ID,
|
|
10
7
|
isDeviceLocalSpaceBody,
|
|
11
8
|
selectIdentityUserId
|
|
12
|
-
} from "./chunk-
|
|
9
|
+
} from "./chunk-TSUJOM6N.js";
|
|
10
|
+
|
|
11
|
+
// packages/create/space/spaceKeys.ts
|
|
12
|
+
var SEPARATOR = "-";
|
|
13
|
+
var SPACE_PREFIX = "space";
|
|
14
|
+
var SPACE_PREFIX_WITH_SEPARATOR = `${SPACE_PREFIX}${SEPARATOR}`;
|
|
15
|
+
var normalizeSpaceId = (spaceId) => {
|
|
16
|
+
if (!spaceId) return spaceId;
|
|
17
|
+
return spaceId.startsWith(SPACE_PREFIX_WITH_SEPARATOR) ? spaceId.slice(SPACE_PREFIX_WITH_SEPARATOR.length) : spaceId;
|
|
18
|
+
};
|
|
19
|
+
var createSpaceKey = {
|
|
20
|
+
// 空间基础信息的key
|
|
21
|
+
space: (spaceId) => {
|
|
22
|
+
return [SPACE_PREFIX, normalizeSpaceId(spaceId)].join(SEPARATOR);
|
|
23
|
+
},
|
|
24
|
+
// 空间成员的key
|
|
25
|
+
member: (userId, spaceId) => {
|
|
26
|
+
return [SPACE_PREFIX, "member", userId, normalizeSpaceId(spaceId)].join(
|
|
27
|
+
SEPARATOR
|
|
28
|
+
);
|
|
29
|
+
},
|
|
30
|
+
// 查询用户所在的所有空间的范围
|
|
31
|
+
memberRange: (userId) => {
|
|
32
|
+
return {
|
|
33
|
+
start: [SPACE_PREFIX, "member", userId, ""].join(SEPARATOR),
|
|
34
|
+
end: [SPACE_PREFIX, "member", userId, "\uFFFF"].join(SEPARATOR)
|
|
35
|
+
};
|
|
36
|
+
},
|
|
37
|
+
/**
|
|
38
|
+
* 预留:未来若出现“按用户、按空间、且必须跨设备同步”的空间级偏好,
|
|
39
|
+
* 统一使用这个 key family。当前产品主链不要依赖它。
|
|
40
|
+
*/
|
|
41
|
+
setting: (userId, spaceId) => {
|
|
42
|
+
return [SPACE_PREFIX, "setting", userId, normalizeSpaceId(spaceId)].join(
|
|
43
|
+
SEPARATOR
|
|
44
|
+
);
|
|
45
|
+
},
|
|
46
|
+
/**
|
|
47
|
+
* 预留:未来如确实需要批量读取空间级远端偏好,再使用这个范围。
|
|
48
|
+
*/
|
|
49
|
+
settingRange: (userId) => {
|
|
50
|
+
return {
|
|
51
|
+
start: [SPACE_PREFIX, "setting", userId, ""].join(SEPARATOR),
|
|
52
|
+
end: [SPACE_PREFIX, "setting", userId, "\uFFFF"].join(SEPARATOR)
|
|
53
|
+
};
|
|
54
|
+
},
|
|
55
|
+
// 从成员key中提取空间key
|
|
56
|
+
// 成员 key 格式: space-member-{userId}-{spaceId}
|
|
57
|
+
// userId 是单段(无连字符),spaceId 是 ULID(无连字符)
|
|
58
|
+
spaceFromMember: (memberKey) => {
|
|
59
|
+
const parts = memberKey.split(SEPARATOR);
|
|
60
|
+
if (parts.length < 4) return "";
|
|
61
|
+
const spaceId = parts[parts.length - 1];
|
|
62
|
+
return [SPACE_PREFIX, spaceId].join(SEPARATOR);
|
|
63
|
+
},
|
|
64
|
+
// 从成员key中提取空间ID
|
|
65
|
+
spaceIdFromMember: (memberKey) => {
|
|
66
|
+
const parts = memberKey.split(SEPARATOR);
|
|
67
|
+
return parts.length >= 4 ? parts[parts.length - 1] : "";
|
|
68
|
+
}
|
|
69
|
+
};
|
|
13
70
|
|
|
14
71
|
// packages/create/space/utils/permissions.ts
|
|
15
72
|
var checkSpaceMembership = (spaceData, userId) => {
|
|
@@ -106,6 +163,8 @@ var addContentAction = async (input, thunkAPI) => {
|
|
|
106
163
|
};
|
|
107
164
|
|
|
108
165
|
export {
|
|
166
|
+
normalizeSpaceId,
|
|
167
|
+
createSpaceKey,
|
|
109
168
|
checkSpaceMembership,
|
|
110
169
|
localSpaceAuthorityPatchStamp,
|
|
111
170
|
UNCATEGORIZED_ID,
|
|
@@ -7,7 +7,7 @@ import {
|
|
|
7
7
|
scheduleExistingRecordReplication,
|
|
8
8
|
shouldReplaceLocalWithRemoteRecord,
|
|
9
9
|
shouldReplicateLocalRecord
|
|
10
|
-
} from "./chunk-
|
|
10
|
+
} from "./chunk-TSUJOM6N.js";
|
|
11
11
|
import {
|
|
12
12
|
fetchFromClientDb,
|
|
13
13
|
fetchFromServer,
|
|
@@ -466,13 +466,13 @@ var readAction = async (payload, thunkApi) => {
|
|
|
466
466
|
};
|
|
467
467
|
|
|
468
468
|
export {
|
|
469
|
+
readRequestManager,
|
|
469
470
|
BUILTIN_NOLO_AGENT_KEY,
|
|
470
471
|
PUBLIC_DEEPSEEK_V4_FLASH_AGENT_KEY,
|
|
471
472
|
PUBLIC_DEEPSEEK_V4_PRO_AGENT_KEY,
|
|
472
473
|
PUBLIC_KIMI_K27_CODING_AGENT_KEY,
|
|
473
474
|
PUBLIC_GLM_52_AGENT_KEY,
|
|
474
475
|
PUBLIC_KIMI_K26_IMAGE_AGENT_KEY,
|
|
475
|
-
readRequestManager,
|
|
476
476
|
resolveAgentReadServers,
|
|
477
477
|
readAction
|
|
478
478
|
};
|
|
@@ -1,17 +1,17 @@
|
|
|
1
|
-
import {
|
|
2
|
-
patch,
|
|
3
|
-
remove,
|
|
4
|
-
write
|
|
5
|
-
} from "./chunk-O26GI2JP.js";
|
|
6
1
|
import {
|
|
7
2
|
applyAgentSecretMigrationUpdates,
|
|
8
3
|
createFileCredentialBroker,
|
|
9
4
|
migrateAgentSecrets,
|
|
10
5
|
normalizeAgentRuntimeToolPolicy
|
|
11
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-PDL2AV3E.js";
|
|
12
7
|
import {
|
|
13
8
|
asRecordOrEmpty
|
|
14
9
|
} from "./chunk-KX6YBIHG.js";
|
|
10
|
+
import {
|
|
11
|
+
patch,
|
|
12
|
+
remove,
|
|
13
|
+
write
|
|
14
|
+
} from "./chunk-VKG4HXYV.js";
|
|
15
15
|
import {
|
|
16
16
|
createAgentKey,
|
|
17
17
|
toTrimmedString
|
|
@@ -20,7 +20,7 @@ import {
|
|
|
20
20
|
asyncThunkCreator,
|
|
21
21
|
buildCreateSlice,
|
|
22
22
|
getRuntimeServerContext
|
|
23
|
-
} from "./chunk-
|
|
23
|
+
} from "./chunk-TSUJOM6N.js";
|
|
24
24
|
import {
|
|
25
25
|
asTrimmedString
|
|
26
26
|
} from "./chunk-3EUW3WEO.js";
|
|
@@ -300,7 +300,7 @@ var slice = createSliceWithThunks({
|
|
|
300
300
|
const overrides = {};
|
|
301
301
|
if (args.systemPromptOverride !== void 0) overrides.prompt = args.systemPromptOverride;
|
|
302
302
|
if (args.toolsOverride !== void 0) overrides.tools = args.toolsOverride;
|
|
303
|
-
const { _executeModel } = await import("./_executeModel-
|
|
303
|
+
const { _executeModel } = await import("./_executeModel-4F7VZR5U.js");
|
|
304
304
|
return _executeModel(
|
|
305
305
|
{
|
|
306
306
|
isStreaming: args.isStreaming ?? false,
|
|
@@ -321,7 +321,7 @@ var slice = createSliceWithThunks({
|
|
|
321
321
|
* - 循环直到无工具调用或触发其他运行时停止条件
|
|
322
322
|
*/
|
|
323
323
|
runAgent: create.asyncThunk(async (args, thunkApi) => {
|
|
324
|
-
const { runAgentClientLoop } = await import("./runAgentClientLoop-
|
|
324
|
+
const { runAgentClientLoop } = await import("./runAgentClientLoop-FP2K33ZO.js");
|
|
325
325
|
const { content: loopContent, toolCallCount } = await runAgentClientLoop(
|
|
326
326
|
{
|
|
327
327
|
agentKey: args.agentKey,
|
|
@@ -337,7 +337,7 @@ var slice = createSliceWithThunks({
|
|
|
337
337
|
* 聊天轮次流式 Agent 调用
|
|
338
338
|
*/
|
|
339
339
|
streamAgentChatTurn: create.asyncThunk(async (args, thunkApi) => {
|
|
340
|
-
const { streamAgentChatTurnHandler } = await import("./streamAgentChatTurn-
|
|
340
|
+
const { streamAgentChatTurnHandler } = await import("./streamAgentChatTurn-HBAQQVNK.js");
|
|
341
341
|
return streamAgentChatTurnHandler(args, thunkApi);
|
|
342
342
|
}),
|
|
343
343
|
/**
|