nolo-cli 0.8.0-alpha.12 → 0.8.0-alpha.14
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-JOUHEEDS.js → _executeModel-KBMAUV6G.js} +26 -22
- package/{action-PAXRPJJF.js → action-SQGI5JY5.js} +5 -4
- package/{addContentAction-CZVWF3QZ.js → addContentAction-ZX2PUS3X.js} +4 -3
- package/{addDialogAgentAction-CCIDTPHC.js → addDialogAgentAction-ULADQX2Q.js} +3 -2
- package/{agentDeleteCommand-TVJH2JID.js → agentDeleteCommand-GNVYHOGZ.js} +11 -8
- package/{agentEmailCommands-TB2RKQJL.js → agentEmailCommands-QETL62SU.js} +29 -25
- package/{agentListCommands-GVD6ZQ3B.js → agentListCommands-FM4OWXYT.js} +12 -9
- package/{agentMachineCommands-UJI6CDKE.js → agentMachineCommands-LDHJBWQO.js} +11 -8
- package/{agentRecordCommands-IQBFI3QO.js → agentRecordCommands-UW76EZ25.js} +29 -25
- package/{agentRunCommand-VCQ5ONRC.js → agentRunCommand-UFBOW4ZF.js} +33 -26
- package/{agentRuntimeLocal-JTCFVEEL.js → agentRuntimeLocal-XL5PLRJV.js} +16 -12
- package/{agentSlice-NZMLVXT5.js → agentSlice-2IBSFH4O.js} +5 -4
- package/{authCommand-WXMD3IPR.js → authCommand-PXFX6JDT.js} +8 -1
- package/{authCommands-X74AFDTC.js → authCommands-356AYWEK.js} +10 -1
- package/{chunk-FUU63UA7.js → chunk-2IRF4LEX.js} +418 -12
- package/chunk-3TZDXYSF.js +71 -0
- package/chunk-4ZDM73SD.js +34 -0
- package/{chunk-TDIQFT2F.js → chunk-5CS33IBL.js} +1 -1
- package/{chunk-IYQV26RA.js → chunk-6A3LI5TZ.js} +2 -2
- package/{chunk-VEJLAVTC.js → chunk-6CBN7GGH.js} +2 -2
- package/{chunk-BSTNFPHD.js → chunk-6XKX2N2E.js} +1 -1
- package/{chunk-IEPE5Z7Y.js → chunk-7IPLJUYC.js} +1 -1
- package/{chunk-6VTZSYDT.js → chunk-B6DFDN4R.js} +2 -2
- package/{chunk-QNCWJXVH.js → chunk-BKPVTIEK.js} +4 -4
- package/{chunk-LM25IZBJ.js → chunk-DG7AAAR3.js} +1 -1
- package/{chunk-K367HWYT.js → chunk-DGFWICQJ.js} +1 -1
- package/chunk-DSNONPGW.js +386 -0
- package/{chunk-GH7LOVLY.js → chunk-EQHI2AR3.js} +21 -17
- package/{chunk-OF5H3QWS.js → chunk-EXTIQUCI.js} +182 -0
- package/chunk-I42VC5KR.js +15 -0
- package/{chunk-FY4NQTEC.js → chunk-I6DI7SGU.js} +41 -19
- package/chunk-JEXVIMYZ.js +55 -0
- package/{chunk-4EPRP7A3.js → chunk-JRPR5M4O.js} +2 -2
- package/{chunk-VJEKUYDK.js → chunk-JW43YCM5.js} +1 -1
- package/{chunk-GSENGCXB.js → chunk-MMRAIO5Y.js} +3 -3
- package/{chunk-AAKR4CKW.js → chunk-MXLQWBVM.js} +1 -88
- package/chunk-OPZYGHUC.js +89 -0
- package/{chunk-J4576WMJ.js → chunk-PCWC3JTN.js} +1 -1
- package/{chunk-6HSAQUHW.js → chunk-PFUCDPUH.js} +19 -20
- package/{chunk-HEIIIZBX.js → chunk-Q2YZULBH.js} +1 -1
- package/{chunk-6G3WLUY5.js → chunk-QKRUUZCL.js} +6 -6
- package/{chunk-IAXBCTTE.js → chunk-QO4YO77G.js} +2 -2
- package/{chunk-NDZOFKHS.js → chunk-QTFSBLCF.js} +8 -15
- package/{chunk-RAUV2V7X.js → chunk-RJKDVL4L.js} +2 -2
- package/{chunk-MTV2I4IF.js → chunk-RLCFUU46.js} +3 -3
- package/{chunk-OF6IBT3Z.js → chunk-RTZFUR3V.js} +5 -5
- package/{chunk-U5CWPEKM.js → chunk-SACYB45H.js} +19 -378
- package/{chunk-PN7AFLOK.js → chunk-SH2CFQOH.js} +3 -13
- package/{chunk-CM54RSSA.js → chunk-SL35K7AH.js} +21 -1
- package/{chunk-OW6OA65Z.js → chunk-SRLZ7IVA.js} +170 -176
- package/{chunk-VEWET5JQ.js → chunk-TWPGVS2U.js} +2 -2
- package/{chunk-G5H7RNFL.js → chunk-V2AISYMA.js} +2 -2
- package/{chunk-5KDNEBJR.js → chunk-VH4YK6KZ.js} +14 -4
- package/{chunk-AUGHVUFE.js → chunk-YYUCRDOK.js} +1 -1
- package/{chunk-H2RMRZJE.js → chunk-ZDXZSXYQ.js} +1 -1
- package/{chunk-NXZGF7F7.js → chunk-ZQ2UM4KG.js} +1 -1
- package/{createAgentAutomationAction-CGYKGZQK.js → createAgentAutomationAction-CSWOQOY5.js} +12 -10
- package/{createDialogAction-W34WVXOG.js → createDialogAction-6VWL2TDI.js} +15 -13
- package/{createPageAction-BX3BTTBM.js → createPageAction-INRC4MH2.js} +13 -11
- package/{dbSlice-C4UJLRZP.js → dbSlice-TO2TSMWM.js} +3 -2
- package/{dialogCommands-DS6WHBNJ.js → dialogCommands-DWSE4PMW.js} +13 -10
- package/{dialogSlice-3QIHGXBA.js → dialogSlice-CELFVS3F.js} +12 -10
- package/{docCreateCommands-X6ACQKZU.js → docCreateCommands-UFJL5PUM.js} +12 -9
- package/{docDeleteCommands-NS7VBNDH.js → docDeleteCommands-XHEIBAB2.js} +13 -10
- package/{docReadCommands-U5PGIWTF.js → docReadCommands-PEDIC2CW.js} +12 -9
- package/{docStore-ZUQS4K5X.js → docStore-Q5AFYT6G.js} +13 -11
- package/{docUpdateCommands-MKUDMRFB.js → docUpdateCommands-WBRODQ7P.js} +12 -9
- package/{fetchMessages-JOCYIFKL.js → fetchMessages-U6ZHN56A.js} +3 -2
- package/{handleSendMessageAction-T4LFZFCM.js → handleSendMessageAction-PPIGKCBQ.js} +12 -10
- package/index.js +49 -45
- package/{localDialogRead-D3BELSTF.js → localDialogRead-Z5UTAJPU.js} +1 -1
- package/{machineCommands-EFFHN5DU.js → machineCommands-3D7JMHUP.js} +28 -24
- package/{machineWsRunDispatch-NXBROTNC.js → machineWsRunDispatch-PA5BR4AX.js} +28 -24
- package/package.json +1 -1
- package/{readlineWorkspace-32SJR27M.js → readlineWorkspace-7WPA5OUS.js} +166 -32
- package/{removeDialogAgentAction-CXLST3N6.js → removeDialogAgentAction-3MUQGFZX.js} +5 -4
- package/{runAgentClientLoop-AUA4XII6.js → runAgentClientLoop-DRAXPP6R.js} +21 -19
- package/{setDialogExtraReferencesAction-LP6VYGU7.js → setDialogExtraReferencesAction-MXHX2HPK.js} +3 -2
- package/{setPrimaryDialogAgentAction-D3GGH23T.js → setPrimaryDialogAgentAction-7DLDZHDT.js} +5 -4
- package/{settingSlice-J4I3Z5H7.js → settingSlice-PNLASZGI.js} +4 -3
- package/{spaceCommands-JLMZTC3V.js → spaceCommands-ORSFAWEY.js} +11 -8
- package/{spaceSlice-ECPEQE5G.js → spaceSlice-5F2CDP2O.js} +12 -10
- package/{streamAgentChatTurn-5UNGDRXQ.js → streamAgentChatTurn-ROOB5RLM.js} +29 -27
- package/{tools-BLAZGXMF.js → tools-BAWXW4F6.js} +19 -17
- package/tuiSummaryLlmCaller-JSI4GL6W.js +78 -0
- package/{understanding-HCSFPE7R.js → understanding-GQKNDDWM.js} +7 -54
- package/{updateDialogTitleAction-Y4SKBCZX.js → updateDialogTitleAction-KJM65IGF.js} +14 -11
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import {
|
|
2
2
|
updateContentTitle
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-SRLZ7IVA.js";
|
|
4
4
|
import {
|
|
5
5
|
require_date_fns
|
|
6
6
|
} from "./chunk-M76ECQRD.js";
|
|
@@ -13,7 +13,7 @@ import {
|
|
|
13
13
|
import {
|
|
14
14
|
patch,
|
|
15
15
|
readAndWait
|
|
16
|
-
} from "./chunk-
|
|
16
|
+
} from "./chunk-V2AISYMA.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-INRC4MH2.js");
|
|
371
371
|
return createPageAction(args, thunkApi);
|
|
372
372
|
}
|
|
373
373
|
function subscribe(listener) {
|
|
@@ -890,89 +890,6 @@ async function runLocalAgentTurn(input) {
|
|
|
890
890
|
};
|
|
891
891
|
}
|
|
892
892
|
|
|
893
|
-
// packages/agent-runtime/thinkTagParser.ts
|
|
894
|
-
var OPEN_TAG = "<think>";
|
|
895
|
-
var CLOSE_TAG = "</think>";
|
|
896
|
-
function longestTagPrefixLength(buffer, tag) {
|
|
897
|
-
const max = Math.min(buffer.length, tag.length - 1);
|
|
898
|
-
for (let len = max; len > 0; len--) {
|
|
899
|
-
if (tag.startsWith(buffer.slice(-len))) {
|
|
900
|
-
return len;
|
|
901
|
-
}
|
|
902
|
-
}
|
|
903
|
-
return 0;
|
|
904
|
-
}
|
|
905
|
-
function extractThinkContent(content) {
|
|
906
|
-
const regex = new RegExp(`${OPEN_TAG}([\\s\\S]*?)${CLOSE_TAG}`, "g");
|
|
907
|
-
const matches = [...content.matchAll(regex)];
|
|
908
|
-
if (matches.length === 0) {
|
|
909
|
-
return { content };
|
|
910
|
-
}
|
|
911
|
-
const reasoning = matches.map((m) => m[1]).join("\n");
|
|
912
|
-
const cleaned = content.replace(regex, "");
|
|
913
|
-
return { content: cleaned.replace(/^\n/, ""), reasoning };
|
|
914
|
-
}
|
|
915
|
-
function createThinkParserState() {
|
|
916
|
-
return { mode: "content", buffer: "", trimNextVisible: false };
|
|
917
|
-
}
|
|
918
|
-
function processThinkChunk(chunk, state) {
|
|
919
|
-
let visible = "";
|
|
920
|
-
let reasoning = "";
|
|
921
|
-
let { mode, buffer, trimNextVisible } = state;
|
|
922
|
-
buffer += chunk;
|
|
923
|
-
while (true) {
|
|
924
|
-
if (mode === "content") {
|
|
925
|
-
const idx = buffer.indexOf(OPEN_TAG);
|
|
926
|
-
if (idx === -1) {
|
|
927
|
-
const keep = longestTagPrefixLength(buffer, OPEN_TAG);
|
|
928
|
-
visible += buffer.slice(0, buffer.length - keep);
|
|
929
|
-
buffer = buffer.slice(buffer.length - keep);
|
|
930
|
-
break;
|
|
931
|
-
}
|
|
932
|
-
visible += buffer.slice(0, idx);
|
|
933
|
-
buffer = buffer.slice(idx + OPEN_TAG.length);
|
|
934
|
-
mode = "reasoning";
|
|
935
|
-
} else {
|
|
936
|
-
const idx = buffer.indexOf(CLOSE_TAG);
|
|
937
|
-
if (idx === -1) {
|
|
938
|
-
const keep = longestTagPrefixLength(buffer, CLOSE_TAG);
|
|
939
|
-
reasoning += buffer.slice(0, buffer.length - keep);
|
|
940
|
-
buffer = buffer.slice(buffer.length - keep);
|
|
941
|
-
break;
|
|
942
|
-
}
|
|
943
|
-
reasoning += buffer.slice(0, idx);
|
|
944
|
-
buffer = buffer.slice(idx + CLOSE_TAG.length);
|
|
945
|
-
mode = "content";
|
|
946
|
-
trimNextVisible = true;
|
|
947
|
-
}
|
|
948
|
-
}
|
|
949
|
-
if (mode === "content" && visible.length > 0 && trimNextVisible) {
|
|
950
|
-
visible = visible.replace(/^\n/, "");
|
|
951
|
-
trimNextVisible = false;
|
|
952
|
-
}
|
|
953
|
-
return { content: visible, reasoning, state: { mode, buffer, trimNextVisible } };
|
|
954
|
-
}
|
|
955
|
-
function flushThinkParser(state) {
|
|
956
|
-
const { mode, buffer, trimNextVisible } = state;
|
|
957
|
-
if (mode === "reasoning") {
|
|
958
|
-
return {
|
|
959
|
-
content: "",
|
|
960
|
-
reasoning: buffer,
|
|
961
|
-
state: { mode: "content", buffer: "", trimNextVisible: false }
|
|
962
|
-
};
|
|
963
|
-
}
|
|
964
|
-
let visible = buffer;
|
|
965
|
-
const nextTrim = trimNextVisible;
|
|
966
|
-
if (nextTrim) {
|
|
967
|
-
visible = visible.replace(/^\n/, "");
|
|
968
|
-
}
|
|
969
|
-
return {
|
|
970
|
-
content: visible,
|
|
971
|
-
reasoning: "",
|
|
972
|
-
state: { mode: "content", buffer: "", trimNextVisible: false }
|
|
973
|
-
};
|
|
974
|
-
}
|
|
975
|
-
|
|
976
893
|
export {
|
|
977
894
|
readCommandActionGatePayload,
|
|
978
895
|
readActionGate,
|
|
@@ -982,9 +899,5 @@ export {
|
|
|
982
899
|
LOCAL_AGENT_CONFIG_MISSING_CODE,
|
|
983
900
|
EMPTY_ASSISTANT_REPAIR_PROMPT,
|
|
984
901
|
LOCAL_TURN_ABORTED_CODE,
|
|
985
|
-
runLocalAgentTurn
|
|
986
|
-
extractThinkContent,
|
|
987
|
-
createThinkParserState,
|
|
988
|
-
processThinkChunk,
|
|
989
|
-
flushThinkParser
|
|
902
|
+
runLocalAgentTurn
|
|
990
903
|
};
|
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
// packages/agent-runtime/thinkTagParser.ts
|
|
2
|
+
var OPEN_TAG = "<think>";
|
|
3
|
+
var CLOSE_TAG = "</think>";
|
|
4
|
+
function longestTagPrefixLength(buffer, tag) {
|
|
5
|
+
const max = Math.min(buffer.length, tag.length - 1);
|
|
6
|
+
for (let len = max; len > 0; len--) {
|
|
7
|
+
if (tag.startsWith(buffer.slice(-len))) {
|
|
8
|
+
return len;
|
|
9
|
+
}
|
|
10
|
+
}
|
|
11
|
+
return 0;
|
|
12
|
+
}
|
|
13
|
+
function extractThinkContent(content) {
|
|
14
|
+
const regex = new RegExp(`${OPEN_TAG}([\\s\\S]*?)${CLOSE_TAG}`, "g");
|
|
15
|
+
const matches = [...content.matchAll(regex)];
|
|
16
|
+
if (matches.length === 0) {
|
|
17
|
+
return { content };
|
|
18
|
+
}
|
|
19
|
+
const reasoning = matches.map((m) => m[1]).join("\n");
|
|
20
|
+
const cleaned = content.replace(regex, "");
|
|
21
|
+
return { content: cleaned.replace(/^\n/, ""), reasoning };
|
|
22
|
+
}
|
|
23
|
+
function createThinkParserState() {
|
|
24
|
+
return { mode: "content", buffer: "", trimNextVisible: false };
|
|
25
|
+
}
|
|
26
|
+
function processThinkChunk(chunk, state) {
|
|
27
|
+
let visible = "";
|
|
28
|
+
let reasoning = "";
|
|
29
|
+
let { mode, buffer, trimNextVisible } = state;
|
|
30
|
+
buffer += chunk;
|
|
31
|
+
while (true) {
|
|
32
|
+
if (mode === "content") {
|
|
33
|
+
const idx = buffer.indexOf(OPEN_TAG);
|
|
34
|
+
if (idx === -1) {
|
|
35
|
+
const keep = longestTagPrefixLength(buffer, OPEN_TAG);
|
|
36
|
+
visible += buffer.slice(0, buffer.length - keep);
|
|
37
|
+
buffer = buffer.slice(buffer.length - keep);
|
|
38
|
+
break;
|
|
39
|
+
}
|
|
40
|
+
visible += buffer.slice(0, idx);
|
|
41
|
+
buffer = buffer.slice(idx + OPEN_TAG.length);
|
|
42
|
+
mode = "reasoning";
|
|
43
|
+
} else {
|
|
44
|
+
const idx = buffer.indexOf(CLOSE_TAG);
|
|
45
|
+
if (idx === -1) {
|
|
46
|
+
const keep = longestTagPrefixLength(buffer, CLOSE_TAG);
|
|
47
|
+
reasoning += buffer.slice(0, buffer.length - keep);
|
|
48
|
+
buffer = buffer.slice(buffer.length - keep);
|
|
49
|
+
break;
|
|
50
|
+
}
|
|
51
|
+
reasoning += buffer.slice(0, idx);
|
|
52
|
+
buffer = buffer.slice(idx + CLOSE_TAG.length);
|
|
53
|
+
mode = "content";
|
|
54
|
+
trimNextVisible = true;
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
if (mode === "content" && visible.length > 0 && trimNextVisible) {
|
|
58
|
+
visible = visible.replace(/^\n/, "");
|
|
59
|
+
trimNextVisible = false;
|
|
60
|
+
}
|
|
61
|
+
return { content: visible, reasoning, state: { mode, buffer, trimNextVisible } };
|
|
62
|
+
}
|
|
63
|
+
function flushThinkParser(state) {
|
|
64
|
+
const { mode, buffer, trimNextVisible } = state;
|
|
65
|
+
if (mode === "reasoning") {
|
|
66
|
+
return {
|
|
67
|
+
content: "",
|
|
68
|
+
reasoning: buffer,
|
|
69
|
+
state: { mode: "content", buffer: "", trimNextVisible: false }
|
|
70
|
+
};
|
|
71
|
+
}
|
|
72
|
+
let visible = buffer;
|
|
73
|
+
const nextTrim = trimNextVisible;
|
|
74
|
+
if (nextTrim) {
|
|
75
|
+
visible = visible.replace(/^\n/, "");
|
|
76
|
+
}
|
|
77
|
+
return {
|
|
78
|
+
content: visible,
|
|
79
|
+
reasoning: "",
|
|
80
|
+
state: { mode: "content", buffer: "", trimNextVisible: false }
|
|
81
|
+
};
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
export {
|
|
85
|
+
extractThinkContent,
|
|
86
|
+
createThinkParserState,
|
|
87
|
+
processThinkChunk,
|
|
88
|
+
flushThinkParser
|
|
89
|
+
};
|
|
@@ -1,12 +1,15 @@
|
|
|
1
|
+
import {
|
|
2
|
+
clipHeadAndTail
|
|
3
|
+
} from "./chunk-JEXVIMYZ.js";
|
|
1
4
|
import {
|
|
2
5
|
prepareTools
|
|
3
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-JRPR5M4O.js";
|
|
4
7
|
import {
|
|
5
8
|
getPublicImageAgentMode
|
|
6
9
|
} from "./chunk-VIDPVFP3.js";
|
|
7
10
|
import {
|
|
8
11
|
performFetchRequest
|
|
9
|
-
} from "./chunk-
|
|
12
|
+
} from "./chunk-QTFSBLCF.js";
|
|
10
13
|
import {
|
|
11
14
|
createSSEParser,
|
|
12
15
|
createToolRunId,
|
|
@@ -17,7 +20,7 @@ import {
|
|
|
17
20
|
toolRunSetPending,
|
|
18
21
|
toolRunStarted,
|
|
19
22
|
toolRunSucceeded
|
|
20
|
-
} from "./chunk-
|
|
23
|
+
} from "./chunk-I6DI7SGU.js";
|
|
21
24
|
import {
|
|
22
25
|
addToolMessage,
|
|
23
26
|
getModelInfo,
|
|
@@ -25,16 +28,18 @@ import {
|
|
|
25
28
|
messageStreaming,
|
|
26
29
|
selectCurrentSpaceId,
|
|
27
30
|
updateToolMessage
|
|
28
|
-
} from "./chunk-
|
|
31
|
+
} from "./chunk-SRLZ7IVA.js";
|
|
29
32
|
import {
|
|
30
33
|
streamAgentChatTurn
|
|
31
|
-
} from "./chunk-
|
|
34
|
+
} from "./chunk-QKRUUZCL.js";
|
|
35
|
+
import {
|
|
36
|
+
EMPTY_ASSISTANT_REPAIR_PROMPT
|
|
37
|
+
} from "./chunk-MXLQWBVM.js";
|
|
32
38
|
import {
|
|
33
|
-
EMPTY_ASSISTANT_REPAIR_PROMPT,
|
|
34
39
|
createThinkParserState,
|
|
35
40
|
flushThinkParser,
|
|
36
41
|
processThinkChunk
|
|
37
|
-
} from "./chunk-
|
|
42
|
+
} from "./chunk-OPZYGHUC.js";
|
|
38
43
|
import {
|
|
39
44
|
getApiEndpoint
|
|
40
45
|
} from "./chunk-572EKYLF.js";
|
|
@@ -54,15 +59,15 @@ import {
|
|
|
54
59
|
} from "./chunk-HNMXYYJR.js";
|
|
55
60
|
import {
|
|
56
61
|
selectCurrentServer
|
|
57
|
-
} from "./chunk-
|
|
62
|
+
} from "./chunk-6CBN7GGH.js";
|
|
58
63
|
import {
|
|
59
64
|
write
|
|
60
|
-
} from "./chunk-
|
|
65
|
+
} from "./chunk-V2AISYMA.js";
|
|
61
66
|
import {
|
|
62
67
|
createDialogMessageKeyAndId,
|
|
63
68
|
dialogMessageKey,
|
|
64
69
|
toTrimmedString
|
|
65
|
-
} from "./chunk-
|
|
70
|
+
} from "./chunk-SH2CFQOH.js";
|
|
66
71
|
import {
|
|
67
72
|
createAsyncThunk,
|
|
68
73
|
selectIdentityToken
|
|
@@ -81,12 +86,6 @@ import {
|
|
|
81
86
|
} from "./chunk-KUG52IAP.js";
|
|
82
87
|
|
|
83
88
|
// packages/integrations/openai/filterAndCleanMessages.ts
|
|
84
|
-
var TOOL_CONTEXT_MAX_CHARS = 4e3;
|
|
85
|
-
var truncateText = (text, maxChars = TOOL_CONTEXT_MAX_CHARS) => {
|
|
86
|
-
if (text.length <= maxChars) return text;
|
|
87
|
-
return `${text.slice(0, maxChars)}
|
|
88
|
-
\u2026[\u622A\u65AD\uFF0C\u539F\u59CB\u957F\u5EA6 ${text.length} \u5B57\u7B26]`;
|
|
89
|
-
};
|
|
90
89
|
var isValidMessagePart = (part) => {
|
|
91
90
|
if (!part || typeof part !== "object") return false;
|
|
92
91
|
if (part.type === "text") return typeof part.text === "string";
|
|
@@ -99,11 +98,11 @@ var isValidMessagePart = (part) => {
|
|
|
99
98
|
var extractContent = (msg) => {
|
|
100
99
|
if (msg.role === "tool") {
|
|
101
100
|
const llmContext = asTrimmedString(msg.toolPayload?.llmContext);
|
|
102
|
-
if (llmContext) return
|
|
101
|
+
if (llmContext) return clipHeadAndTail(llmContext, { toolCallId: extractToolCallId(msg) ?? void 0 }).content;
|
|
103
102
|
const summary = asTrimmedString(msg.toolPayload?.summary);
|
|
104
|
-
if (summary) return
|
|
105
|
-
if (typeof msg.content === "string") return
|
|
106
|
-
if (msg.content != null) return
|
|
103
|
+
if (summary) return clipHeadAndTail(summary, { toolCallId: extractToolCallId(msg) ?? void 0 }).content;
|
|
104
|
+
if (typeof msg.content === "string") return clipHeadAndTail(msg.content, { toolCallId: extractToolCallId(msg) ?? void 0 }).content;
|
|
105
|
+
if (msg.content != null) return clipHeadAndTail(JSON.stringify(msg.content), { toolCallId: extractToolCallId(msg) ?? void 0 }).content;
|
|
107
106
|
return null;
|
|
108
107
|
}
|
|
109
108
|
if (typeof msg.content === "string") return msg.content;
|
|
@@ -3,12 +3,12 @@ import {
|
|
|
3
3
|
createFileCredentialBroker,
|
|
4
4
|
migrateAgentSecrets,
|
|
5
5
|
normalizeAgentRuntimeToolPolicy
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-5CS33IBL.js";
|
|
7
7
|
import {
|
|
8
8
|
patch,
|
|
9
9
|
remove,
|
|
10
10
|
write
|
|
11
|
-
} from "./chunk-
|
|
11
|
+
} from "./chunk-V2AISYMA.js";
|
|
12
12
|
import {
|
|
13
13
|
asRecordOrEmpty
|
|
14
14
|
} from "./chunk-KX6YBIHG.js";
|
|
@@ -16,7 +16,7 @@ import {
|
|
|
16
16
|
createAgentKey,
|
|
17
17
|
require_index_umd,
|
|
18
18
|
toTrimmedString
|
|
19
|
-
} from "./chunk-
|
|
19
|
+
} from "./chunk-SH2CFQOH.js";
|
|
20
20
|
import {
|
|
21
21
|
asyncThunkCreator,
|
|
22
22
|
buildCreateSlice,
|
|
@@ -289,7 +289,7 @@ var slice = createSliceWithThunks({
|
|
|
289
289
|
const overrides = {};
|
|
290
290
|
if (args.systemPromptOverride !== void 0) overrides.prompt = args.systemPromptOverride;
|
|
291
291
|
if (args.toolsOverride !== void 0) overrides.tools = args.toolsOverride;
|
|
292
|
-
const { _executeModel } = await import("./_executeModel-
|
|
292
|
+
const { _executeModel } = await import("./_executeModel-KBMAUV6G.js");
|
|
293
293
|
return _executeModel(
|
|
294
294
|
{
|
|
295
295
|
isStreaming: args.isStreaming ?? false,
|
|
@@ -310,7 +310,7 @@ var slice = createSliceWithThunks({
|
|
|
310
310
|
* - 循环直到无工具调用或触发其他运行时停止条件
|
|
311
311
|
*/
|
|
312
312
|
runAgent: create.asyncThunk(async (args, thunkApi) => {
|
|
313
|
-
const { runAgentClientLoop } = await import("./runAgentClientLoop-
|
|
313
|
+
const { runAgentClientLoop } = await import("./runAgentClientLoop-DRAXPP6R.js");
|
|
314
314
|
const { content: loopContent, toolCallCount } = await runAgentClientLoop(
|
|
315
315
|
{
|
|
316
316
|
agentKey: args.agentKey,
|
|
@@ -326,7 +326,7 @@ var slice = createSliceWithThunks({
|
|
|
326
326
|
* 聊天轮次流式 Agent 调用
|
|
327
327
|
*/
|
|
328
328
|
streamAgentChatTurn: create.asyncThunk(async (args, thunkApi) => {
|
|
329
|
-
const { streamAgentChatTurnHandler } = await import("./streamAgentChatTurn-
|
|
329
|
+
const { streamAgentChatTurnHandler } = await import("./streamAgentChatTurn-ROOB5RLM.js");
|
|
330
330
|
return streamAgentChatTurnHandler(args, thunkApi);
|
|
331
331
|
}),
|
|
332
332
|
/**
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import {
|
|
2
2
|
selectCurrentServer,
|
|
3
3
|
selectRemoteServers
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-6CBN7GGH.js";
|
|
5
5
|
import {
|
|
6
6
|
createUserKey,
|
|
7
7
|
extractAgentInfo,
|
|
@@ -10,7 +10,7 @@ import {
|
|
|
10
10
|
sanitizeShareData,
|
|
11
11
|
shareKey,
|
|
12
12
|
toNonEmptyString
|
|
13
|
-
} from "./chunk-
|
|
13
|
+
} from "./chunk-SH2CFQOH.js";
|
|
14
14
|
import {
|
|
15
15
|
noloDeleteRequest,
|
|
16
16
|
noloWriteRequest,
|
|
@@ -9,7 +9,7 @@ import {
|
|
|
9
9
|
import {
|
|
10
10
|
clipMultilineText,
|
|
11
11
|
fetchAndSerializeTable
|
|
12
|
-
} from "./chunk-
|
|
12
|
+
} from "./chunk-I6DI7SGU.js";
|
|
13
13
|
import {
|
|
14
14
|
normalizeNonNegativeMs,
|
|
15
15
|
parseRetryAfterHeaderMs
|
|
@@ -22,14 +22,14 @@ import {
|
|
|
22
22
|
} from "./chunk-VP4WJWKW.js";
|
|
23
23
|
import {
|
|
24
24
|
resolvePageSkillMetadata
|
|
25
|
-
} from "./chunk-
|
|
25
|
+
} from "./chunk-ZQ2UM4KG.js";
|
|
26
26
|
import {
|
|
27
27
|
estimateTokenCount,
|
|
28
28
|
fetchAndCacheMessages
|
|
29
|
-
} from "./chunk-
|
|
29
|
+
} from "./chunk-SRLZ7IVA.js";
|
|
30
30
|
import {
|
|
31
31
|
fetchServerSyncedCredential
|
|
32
|
-
} from "./chunk-
|
|
32
|
+
} from "./chunk-QKRUUZCL.js";
|
|
33
33
|
import {
|
|
34
34
|
createSpaceKey
|
|
35
35
|
} from "./chunk-UAD2WT54.js";
|
|
@@ -42,14 +42,14 @@ import {
|
|
|
42
42
|
} from "./chunk-XDVAYP26.js";
|
|
43
43
|
import {
|
|
44
44
|
canonicalizeToolNames
|
|
45
|
-
} from "./chunk-
|
|
45
|
+
} from "./chunk-DG7AAAR3.js";
|
|
46
46
|
import {
|
|
47
47
|
getModelConfig,
|
|
48
48
|
isModelSupportReasoningEffort
|
|
49
49
|
} from "./chunk-572EKYLF.js";
|
|
50
50
|
import {
|
|
51
51
|
createFileCredentialBroker
|
|
52
|
-
} from "./chunk-
|
|
52
|
+
} from "./chunk-5CS33IBL.js";
|
|
53
53
|
import {
|
|
54
54
|
isDeepInfraKimiModel,
|
|
55
55
|
isFireworksKimiModel,
|
|
@@ -63,10 +63,10 @@ import {
|
|
|
63
63
|
} from "./chunk-HNMXYYJR.js";
|
|
64
64
|
import {
|
|
65
65
|
read
|
|
66
|
-
} from "./chunk-
|
|
66
|
+
} from "./chunk-V2AISYMA.js";
|
|
67
67
|
import {
|
|
68
68
|
asNonEmptyStringArray
|
|
69
|
-
} from "./chunk-
|
|
69
|
+
} from "./chunk-I42VC5KR.js";
|
|
70
70
|
import {
|
|
71
71
|
asTrimmedLowercaseString
|
|
72
72
|
} from "./chunk-QSJ3HFEF.js";
|
|
@@ -1223,8 +1223,6 @@ ${contexts.userGlobalPrompt.trim()} ` : "";
|
|
|
1223
1223
|
const referenceMaterialsSection = buildReferenceMaterialsBlock(contexts);
|
|
1224
1224
|
const dialogSummarySection = contexts.dialogSummary?.trim() ? `--- \u5386\u53F2\u5BF9\u8BDD\u6458\u8981 ---
|
|
1225
1225
|
${wrapHistoricalSummaryWithReplayGuard(contexts.dialogSummary)}` : "";
|
|
1226
|
-
const proactiveSummarySection = contexts.proactiveSummary?.trim() ? `--- \u9636\u6BB5\u5DE5\u4F5C\u6458\u8981 ---
|
|
1227
|
-
${wrapHistoricalSummaryWithReplayGuard(contexts.proactiveSummary)}` : "";
|
|
1228
1226
|
return compileContextLayers([
|
|
1229
1227
|
{ id: "identity", owner: "platform", cacheScope: "session", content: identitySection },
|
|
1230
1228
|
{ id: "startup-protocol", owner: "platform", cacheScope: "static", content: startupProtocol },
|
|
@@ -1259,7 +1257,6 @@ ${wrapHistoricalSummaryWithReplayGuard(contexts.proactiveSummary)}` : "";
|
|
|
1259
1257
|
{ id: "memory-overlay", owner: "runtime", cacheScope: "turn", content: memoryOverlaySection },
|
|
1260
1258
|
{ id: "app-working-memory", owner: "runtime", cacheScope: "turn", content: appWorkingMemorySection },
|
|
1261
1259
|
{ id: "dialog-summary", owner: "runtime", cacheScope: "turn", content: dialogSummarySection },
|
|
1262
|
-
{ id: "proactive-summary", owner: "runtime", cacheScope: "turn", content: proactiveSummarySection },
|
|
1263
1260
|
{ id: "editing-context", owner: "runtime", cacheScope: "turn", content: editingContextSection },
|
|
1264
1261
|
{
|
|
1265
1262
|
id: "current-time",
|
|
@@ -1960,7 +1957,6 @@ var fetchDialogReference = async (dbKey, refContent, dispatch) => {
|
|
|
1960
1957
|
const dialogId = extractCustomId(dbKey) || dbKey.replace(/^dialog-/, "");
|
|
1961
1958
|
const checkpoint = dialogConfig.runtimeCheckpoint || null;
|
|
1962
1959
|
const summary = asTrimmedString(dialogConfig.summary);
|
|
1963
|
-
const proactiveSummary = asTrimmedString(dialogConfig.proactiveSummary);
|
|
1964
1960
|
const messages = await dispatch(
|
|
1965
1961
|
async (_dispatch, getState, { db }) => {
|
|
1966
1962
|
const state = getState();
|
|
@@ -2005,7 +2001,6 @@ var fetchDialogReference = async (dbKey, refContent, dispatch) => {
|
|
|
2005
2001
|
`- Use this when continuing work, transferring to another Agent, comparing with the current task, or preparing a document/plan from the prior discussion.`,
|
|
2006
2002
|
`- Current state source: ${checkpointLines.length ? "Runtime Checkpoint" : "summaries and recent transcript"}.`,
|
|
2007
2003
|
summary ? `- Compressed background: passive summary is available below; treat it as lossy, not original wording.` : "",
|
|
2008
|
-
proactiveSummary ? `- Recent work: proactive summary is available below; use it for current direction, not exact evidence.` : "",
|
|
2009
2004
|
recentToolEvidence.length ? `- Recent tool evidence:
|
|
2010
2005
|
${recentToolEvidence.join("\n")}` : `- Recent tool evidence: none loaded in the latest ${DIALOG_REFERENCE_MESSAGE_LIMIT} messages.`,
|
|
2011
2006
|
`- For exact claims, old decisions, original wording, files/tools mentioned earlier, or anything not visible in the recent transcript, call searchDialogMessages with DB Key ${dbKey}.`
|
|
@@ -2022,8 +2017,6 @@ ${handoffLines.join("\n")}`,
|
|
|
2022
2017
|
${checkpointLines.join("\n")}` : "",
|
|
2023
2018
|
summary ? `Passive Summary (compressed history, not original wording):
|
|
2024
2019
|
${wrapHistoricalSummaryWithReplayGuard(summary)}` : "",
|
|
2025
|
-
proactiveSummary ? `Proactive Summary (recent work summary, not original wording):
|
|
2026
|
-
${wrapHistoricalSummaryWithReplayGuard(proactiveSummary)}` : "",
|
|
2027
2020
|
`Recent Transcript (original message excerpts, oldest to newest):
|
|
2028
2021
|
${transcript || "[no recent messages loaded]"}`,
|
|
2029
2022
|
[
|
|
@@ -2,7 +2,7 @@ import {
|
|
|
2
2
|
buildLocalAgentLookupKeys,
|
|
3
3
|
normalizeAgentHandle,
|
|
4
4
|
shouldReadAgentKeyRemotely
|
|
5
|
-
} from "./chunk-
|
|
5
|
+
} from "./chunk-DGFWICQJ.js";
|
|
6
6
|
import {
|
|
7
7
|
resolveCliAgentKeyInput
|
|
8
8
|
} from "./chunk-VHBWHNVT.js";
|
|
@@ -22,7 +22,7 @@ import {
|
|
|
22
22
|
} from "./chunk-HNMXYYJR.js";
|
|
23
23
|
import {
|
|
24
24
|
createAgentKey
|
|
25
|
-
} from "./chunk-
|
|
25
|
+
} from "./chunk-SH2CFQOH.js";
|
|
26
26
|
|
|
27
27
|
// packages/cli/agentRecordHelpers.ts
|
|
28
28
|
import { readFileSync } from "node:fs";
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import {
|
|
2
2
|
readDbRecord,
|
|
3
3
|
writeAgentRecord
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-RJKDVL4L.js";
|
|
5
5
|
import {
|
|
6
6
|
buildSkillSummaryMarker
|
|
7
7
|
} from "./chunk-VF4K2QE6.js";
|
|
8
8
|
import {
|
|
9
9
|
buildSkillDocMarkdown
|
|
10
|
-
} from "./chunk-
|
|
10
|
+
} from "./chunk-ZQ2UM4KG.js";
|
|
11
11
|
import {
|
|
12
12
|
createSpaceKey
|
|
13
13
|
} from "./chunk-UAD2WT54.js";
|
|
@@ -19,7 +19,7 @@ import {
|
|
|
19
19
|
} from "./chunk-ISNCLGUZ.js";
|
|
20
20
|
import {
|
|
21
21
|
require_index_umd
|
|
22
|
-
} from "./chunk-
|
|
22
|
+
} from "./chunk-SH2CFQOH.js";
|
|
23
23
|
import {
|
|
24
24
|
asTrimmedLowercaseString
|
|
25
25
|
} from "./chunk-QSJ3HFEF.js";
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import {
|
|
2
2
|
createCliLocalRuntimeAdapter,
|
|
3
3
|
summarizeEndpoint
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-EQHI2AR3.js";
|
|
5
5
|
import {
|
|
6
6
|
clipMultilineText
|
|
7
|
-
} from "./chunk-
|
|
7
|
+
} from "./chunk-I6DI7SGU.js";
|
|
8
8
|
import {
|
|
9
9
|
readPipeText,
|
|
10
10
|
spawnProcess
|
|
@@ -17,10 +17,10 @@ import {
|
|
|
17
17
|
} from "./chunk-OLZBQWZU.js";
|
|
18
18
|
import {
|
|
19
19
|
runLocalAgentTurn
|
|
20
|
-
} from "./chunk-
|
|
20
|
+
} from "./chunk-MXLQWBVM.js";
|
|
21
21
|
import {
|
|
22
22
|
resolveLocalRuntimeEnvFromPolicy
|
|
23
|
-
} from "./chunk-
|
|
23
|
+
} from "./chunk-5CS33IBL.js";
|
|
24
24
|
import {
|
|
25
25
|
toErrorMessage
|
|
26
26
|
} from "./chunk-HNMXYYJR.js";
|
|
@@ -29,7 +29,7 @@ import {
|
|
|
29
29
|
} from "./chunk-KX6YBIHG.js";
|
|
30
30
|
import {
|
|
31
31
|
asTrimmedNonEmptyStringArray
|
|
32
|
-
} from "./chunk-
|
|
32
|
+
} from "./chunk-I42VC5KR.js";
|
|
33
33
|
import {
|
|
34
34
|
asTrimmedString
|
|
35
35
|
} from "./chunk-3EUW3WEO.js";
|