nolo-cli 0.16.0 → 0.17.0
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-AVCA2NAV.js → _executeModel-WPNX5DH4.js} +49 -43
- 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-QW5PUMDQ.js → agentDeleteCommand-L3357EFL.js} +31 -28
- package/{agentEmailCommands-4ORVLGVQ.js → agentEmailCommands-N65AVLEI.js} +61 -55
- package/{agentListCommands-YWBYRTYC.js → agentListCommands-CH27FTI2.js} +30 -27
- package/{agentMachineCommands-JSQW4FOA.js → agentMachineCommands-PPK5HJZB.js} +29 -26
- package/{agentPullCommand-6HWUT3SW.js → agentPullCommand-ZZGU5KOY.js} +4 -4
- package/{agentRecordCommands-AASIWOBT.js → agentRecordCommands-HTVXD4TT.js} +56 -50
- package/{agentRunCommand-TB5BHXUH.js → agentRunCommand-MGLVJUA5.js} +62 -53
- package/{agentRunControl-6ADXVYMR.js → agentRunControl-P75VPTGS.js} +24 -1
- package/{agentRuntimeLocal-QNPNJRVH.js → agentRuntimeLocal-QUTBSY3I.js} +24 -21
- package/{agentSlice-RUNXC62Y.js → agentSlice-DOGRCMWK.js} +9 -8
- package/appDeleteCommands-FEEVXUBG.js +127 -0
- package/appDeployCommands-C4HCGC4B.js +166 -0
- package/appDeployStatusCommands-IR5ZUZBQ.js +147 -0
- package/appGetCommands-6RJGZ66Z.js +122 -0
- package/appListCommands-VMTF5YZF.js +125 -0
- package/{authCommand-YFTR3347.js → authCommand-WJZPOLSS.js} +16 -9
- package/{authCommands-YXGOXNBZ.js → authCommands-XTBV7OFZ.js} +6 -5
- package/{chunk-XPC5C7BK.js → chunk-3ND52WIL.js} +2 -2
- package/{chunk-SOTZ6RDN.js → chunk-3Q7WHGCB.js} +1 -1
- package/{chunk-M43KDE25.js → chunk-45BY7RLP.js} +2 -8
- package/{chunk-KKY4B2Q2.js → chunk-4PWB7JRR.js} +4 -1
- package/{chunk-6N4KODMN.js → chunk-4T5F7YZQ.js} +1 -1
- package/chunk-7BUYEZ6U.js +671 -0
- package/{chunk-AS3ZQ3O2.js → chunk-7OBMZCRD.js} +1 -1
- package/{chunk-AVVZUXXC.js → chunk-AAODAAUQ.js} +34 -13
- package/{chunk-QLUFR47U.js → chunk-AL2V7U3E.js} +1 -1
- package/{chunk-MTU75CZ2.js → chunk-B5TOXZAK.js} +1 -1
- package/{chunk-AUURUT6L.js → chunk-BT6K76S7.js} +238 -424
- package/chunk-CEFXYF66.js +107 -0
- package/{chunk-RLCXU7A5.js → chunk-D3HVJJIA.js} +1 -1
- package/{chunk-JTMNCCWF.js → chunk-DKZFOK24.js} +16 -87
- package/chunk-DL6EPNIK.js +50 -0
- package/{chunk-4L2OJPCU.js → chunk-EGPCU42M.js} +58 -8
- package/{chunk-IWLUTMYX.js → chunk-ELT65PZW.js} +2 -2
- package/chunk-FKXFCYVO.js +221 -0
- package/{chunk-4FX6NVDW.js → chunk-FPKLD4KB.js} +3 -136
- package/{chunk-PCTUYVUM.js → chunk-FVIPEIVX.js} +10 -3
- package/chunk-GFUIQ4RY.js +136 -0
- package/{chunk-66X4VSRC.js → chunk-HQPG2PIV.js} +41 -1
- package/{chunk-IGXREZW2.js → chunk-HV2A3B4W.js} +1 -1
- package/{chunk-LPEUV5RE.js → chunk-IOOMJJ4Z.js} +2 -2
- package/{setDialogExtraReferencesAction-LR6MSIXO.js → chunk-JLA4FXYC.js} +2 -17
- package/{chunk-3OIRVWXA.js → chunk-JP7REMYP.js} +10 -1
- package/chunk-KFEVY3ST.js +255 -0
- package/{chunk-P3RIAYGG.js → chunk-L2MLZQXU.js} +3 -3
- package/{chunk-55NSNCFM.js → chunk-L6NVTGI7.js} +1 -1
- package/{chunk-3WGLLTK4.js → chunk-LSFAWXKC.js} +100 -3
- package/{chunk-S2LXHNHG.js → chunk-MD3V54DA.js} +6 -6
- package/{chunk-6EVITP2G.js → chunk-MUCU6ATG.js} +2 -251
- package/{chunk-KFHN5NGJ.js → chunk-MVQ4TBSD.js} +1 -1
- package/{chunk-ZQBL7LIC.js → chunk-NEKFSXOP.js} +310 -211
- package/{chunk-NSCHQQPU.js → chunk-NVB267BZ.js} +397 -324
- package/{chunk-Z5JQNBNY.js → chunk-NYUXSXLY.js} +33 -14
- package/{chunk-FRV6A633.js → chunk-PZCBZO4J.js} +2 -2
- package/{chunk-GSINCD4P.js → chunk-QCJITMYO.js} +21 -11
- package/{chunk-OOSFSFMA.js → chunk-R5V5G73M.js} +2 -0
- package/{chunk-4IJYA27C.js → chunk-RG2U2MTJ.js} +1 -1
- package/{chunk-BEBNFWDU.js → chunk-RRGVDPH3.js} +3 -3
- package/{chunk-EABWT43X.js → chunk-RVOUXDFU.js} +5 -5
- package/{chunk-JTINRTBT.js → chunk-SKDNBYZK.js} +2 -2
- package/{chunk-3663CXZN.js → chunk-SNZV4QCE.js} +65 -22
- package/{chunk-KMQPSTMJ.js → chunk-TRT4I4UD.js} +2 -2
- package/{chunk-MYMMNKYL.js → chunk-TSIYZBTH.js} +156 -6
- package/{chunk-EHLHSX7R.js → chunk-UB4RYYNQ.js} +9 -2
- package/{chunk-YJKXGHJ6.js → chunk-UGUW3FHG.js} +4 -4
- package/{chunk-DPAB4FQ7.js → chunk-UZY4BEBR.js} +1579 -212
- package/chunk-V5R4NZP2.js +78 -0
- package/{chunk-MR6ISAGB.js → chunk-VDNQF5VI.js} +6 -6
- package/{chunk-33BJUVK4.js → chunk-VGMJ6PDJ.js} +5 -5
- 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-7UKFVQ5W.js → chunk-YLRTBX4Y.js} +105 -36
- package/{chunk-DGEYDWEZ.js → chunk-YXTRNO5W.js} +3 -3
- package/{chunk-FY233ZFU.js → chunk-ZJZCMKOR.js} +107 -177
- package/{chunk-NVEWUJVX.js → chunk-ZVOZH2HW.js} +1 -1
- package/chunk-ZZ2MH7LE.js +84 -0
- package/{cliExecutor-K3F7DMRO.js → cliExecutor-DNE7TCC4.js} +2 -2
- package/codingSkills-36KN5NQT.js +48 -0
- package/{createAgentAutomationAction-FNHPSKKO.js → createAgentAutomationAction-PMOLEPGJ.js} +19 -18
- package/{createDialogAction-TZCVQ3NU.js → createDialogAction-DPRTYNAK.js} +21 -20
- package/{createPageAction-EIGZ3BKT.js → createPageAction-JGZK3WAM.js} +25 -24
- package/{dbSlice-7KQH6GOU.js → dbSlice-CGSRFJN3.js} +8 -7
- package/{deleteFile-WPWVZE4B.js → deleteFile-WDZ3VM7B.js} +3 -3
- package/{dialogCommands-FO77J5DQ.js → dialogCommands-XED6DKLV.js} +29 -26
- package/{dialogSlice-MM5U4KE2.js → dialogSlice-KO4NRNKC.js} +19 -18
- package/{docCreateCommands-I3BS3AZI.js → docCreateCommands-P6DYWHH3.js} +32 -27
- package/{docDeleteCommands-Q2OPV52P.js → docDeleteCommands-KUWXAMSN.js} +31 -26
- package/{docReadCommands-YOOFACYZ.js → docReadCommands-ECW55TKB.js} +30 -25
- package/{docStore-NGYQ2JTR.js → docStore-6KMERNUY.js} +20 -19
- package/{docUpdateCommands-2B32ITHN.js → docUpdateCommands-5J4BTJQN.js} +31 -26
- package/{fetchMessages-KTNM7QAR.js → fetchMessages-BMGVZVSE.js} +4 -3
- package/{getPricing-P4XRJRZB.js → getPricing-RYY6OBA4.js} +2 -2
- package/{handleSendMessageAction-JRZWWBKP.js → handleSendMessageAction-R3ZHTVU4.js} +20 -19
- package/index.js +95 -64
- package/{localDialogRead-2VRI24F4.js → localDialogRead-HQZPVIE3.js} +1 -1
- package/{localRuntimeDb-LGDF6FQP.js → localRuntimeDb-THJZGAOJ.js} +1 -1
- package/{machineCommands-WRWF2ICZ.js → machineCommands-JF2YL34J.js} +62 -56
- package/{machineWsRunDispatch-ZX7Q3TWZ.js → machineWsRunDispatch-ON4AEOJL.js} +54 -48
- package/{models-WQ5N4OJM.js → models-5K5G2CZI.js} +1 -1
- package/package.json +1 -1
- package/queryRunOverlay-O4LOMMPO.js +161 -0
- package/{read-CN3TNXIP.js → read-3FMPZPER.js} +3 -3
- package/{readDocTool-WF3675ED.js → readDocTool-VSYHKK3V.js} +1 -1
- package/{readlineWorkspace-ZTGRGW46.js → readlineWorkspace-SUCINTL7.js} +354 -185
- package/{removeDialogAgentAction-YDHBFEGI.js → removeDialogAgentAction-OAGA2G3U.js} +10 -9
- package/{runAgentClientLoop-JZCOP7LG.js → runAgentClientLoop-OBD2AVEL.js} +43 -37
- package/runOverlayPresentation-ZO4VCWEU.js +11 -0
- package/{runtimeDoctorCommands-THIHX2SY.js → runtimeDoctorCommands-E2OUORHK.js} +6 -6
- package/setDialogExtraReferencesAction-JZEXA5SL.js +27 -0
- package/{setPrimaryDialogAgentAction-IIVDCY5C.js → setPrimaryDialogAgentAction-4ZUQQKDG.js} +26 -17
- package/{settingSlice-O23YDK2O.js → settingSlice-7MNKHZ6R.js} +9 -8
- package/{skillDiscovery-6M2BZUFN.js → skillDiscovery-KJWT7JBU.js} +3 -3
- package/{spaceCommands-VV4GTPQK.js → spaceCommands-32NTNLHS.js} +30 -27
- package/{spaceSlice-DRWWZJP7.js → spaceSlice-P7VOXLY6.js} +19 -18
- package/{streamAgentChatTurn-Y6WGATQR.js → streamAgentChatTurn-UHEMNI3X.js} +97 -56
- package/{tableCommands-3P7MJ3PF.js → tableCommands-BEQAGE4I.js} +1 -1
- package/{tools-PUNBY3AH.js → tools-BMXIXHMB.js} +32 -27
- package/{tuiSummaryLlmCaller-F64WLSAF.js → tuiSummaryLlmCaller-VUNVBRX3.js} +5 -4
- package/types-ZSTJ7MPR.js +7 -0
- package/{updateDialogTitleAction-YSR4TCMB.js → updateDialogTitleAction-LJBDYZLH.js} +22 -21
- package/{chunk-O4BU24WZ.js → chunk-6Y7A3OQQ.js} +3 -3
- package/{chunk-XBS2WYJ2.js → chunk-RK5NYQEL.js} +0 -0
- package/{chunk-CMKUBIGW.js → chunk-X7W4TNB4.js} +3 -3
- package/{localRuntimeAuthority-TEGCOWX4.js → localRuntimeAuthority-4IXJCHZ7.js} +3 -3
|
@@ -3,7 +3,7 @@ import {
|
|
|
3
3
|
prepareAndPersistMessage,
|
|
4
4
|
uiAskChoiceFunc,
|
|
5
5
|
uiAskChoiceFunctionSchema
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-NVB267BZ.js";
|
|
7
7
|
import {
|
|
8
8
|
require_date_fns
|
|
9
9
|
} from "./chunk-M76ECQRD.js";
|
|
@@ -21,7 +21,7 @@ import {
|
|
|
21
21
|
removeCachedEntity,
|
|
22
22
|
upsertSSREntity,
|
|
23
23
|
write
|
|
24
|
-
} from "./chunk-
|
|
24
|
+
} from "./chunk-XRZJGPFI.js";
|
|
25
25
|
import {
|
|
26
26
|
createAgentKey,
|
|
27
27
|
createDialogKey,
|
|
@@ -30,10 +30,13 @@ import {
|
|
|
30
30
|
dialogMessageRange,
|
|
31
31
|
memoryOwnerRange,
|
|
32
32
|
memorySubjectKindRange
|
|
33
|
-
} from "./chunk-
|
|
33
|
+
} from "./chunk-6Y7A3OQQ.js";
|
|
34
34
|
import {
|
|
35
35
|
selectIdentityUserId
|
|
36
|
-
} from "./chunk-
|
|
36
|
+
} from "./chunk-XMLRJUU5.js";
|
|
37
|
+
import {
|
|
38
|
+
isDevelopment
|
|
39
|
+
} from "./chunk-R5V5G73M.js";
|
|
37
40
|
import {
|
|
38
41
|
asTrimmedString
|
|
39
42
|
} from "./chunk-3EUW3WEO.js";
|
|
@@ -333,11 +336,18 @@ function resolveAgentMemoryPolicy(input) {
|
|
|
333
336
|
}
|
|
334
337
|
function buildMemorySubjectsForAgent(input) {
|
|
335
338
|
const policy = input.policy ?? resolveAgentMemoryPolicy({ agentKey: input.agentKey });
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
339
|
+
const result = [];
|
|
340
|
+
const agentSubject = input.memorySubjectId?.trim();
|
|
341
|
+
if (agentSubject) {
|
|
342
|
+
result.push({ subjectType: "agent", subjectId: agentSubject });
|
|
343
|
+
}
|
|
344
|
+
if (policy.includeUserSubject && input.userId) {
|
|
345
|
+
result.push({ subjectType: "user", subjectId: input.userId });
|
|
346
|
+
}
|
|
347
|
+
if (input.spaceId) {
|
|
348
|
+
result.push({ subjectType: "space", subjectId: input.spaceId });
|
|
349
|
+
}
|
|
350
|
+
return result;
|
|
341
351
|
}
|
|
342
352
|
|
|
343
353
|
// packages/ai/memory/recentRelationshipRecap.ts
|
|
@@ -832,7 +842,9 @@ var notifyUserDataUpdated = () => {
|
|
|
832
842
|
};
|
|
833
843
|
var createDialogAction = async (args, thunkApi) => {
|
|
834
844
|
const {
|
|
835
|
-
cybots,
|
|
845
|
+
cybots: requestedCybots = [],
|
|
846
|
+
agentMode: requestedAgentMode,
|
|
847
|
+
autoRoute,
|
|
836
848
|
category,
|
|
837
849
|
spaceId: explicitSpaceId,
|
|
838
850
|
inheritFromDialogKey,
|
|
@@ -846,6 +858,8 @@ var createDialogAction = async (args, thunkApi) => {
|
|
|
846
858
|
} = args;
|
|
847
859
|
const { dispatch: dispatchRaw, getState, extra } = thunkApi;
|
|
848
860
|
const dispatch = dispatchRaw;
|
|
861
|
+
const agentMode = requestedAgentMode ?? (requestedCybots.length > 0 ? "fixed" : "auto");
|
|
862
|
+
const cybots = agentMode === "auto" ? [] : requestedCybots;
|
|
849
863
|
const agentKey = cybots[0];
|
|
850
864
|
const currentUserId = selectIdentityUserId(getState()) ?? null;
|
|
851
865
|
const isDeviceLocalDialog = isLocalOwnerDialogAgents(cybots);
|
|
@@ -861,6 +875,7 @@ var createDialogAction = async (args, thunkApi) => {
|
|
|
861
875
|
} catch {
|
|
862
876
|
}
|
|
863
877
|
const readAgentConfig = async () => {
|
|
878
|
+
if (!agentKey) return null;
|
|
864
879
|
const existing = await dispatch(
|
|
865
880
|
readAndWait({
|
|
866
881
|
dbKey: agentKey,
|
|
@@ -884,9 +899,9 @@ var createDialogAction = async (args, thunkApi) => {
|
|
|
884
899
|
).unwrap();
|
|
885
900
|
return recoveredBuiltinAgent;
|
|
886
901
|
};
|
|
887
|
-
const canSkipAgentConfigRead = !!skipAgentConfigRead && !!args.skipGreeting && !!titleOverride;
|
|
902
|
+
const canSkipAgentConfigRead = agentMode === "auto" || !!skipAgentConfigRead && !!args.skipGreeting && !!titleOverride;
|
|
888
903
|
const agentConfig = canSkipAgentConfigRead ? null : await readAgentConfig();
|
|
889
|
-
if (!agentConfig && !canSkipAgentConfigRead) {
|
|
904
|
+
if (agentMode === "fixed" && !agentConfig && !canSkipAgentConfigRead) {
|
|
890
905
|
throw new Error(`Agent with key ${agentKey} not found.`);
|
|
891
906
|
}
|
|
892
907
|
const shouldUseRelationshipGreeting = shouldUseRecentRelationshipRecap({
|
|
@@ -909,7 +924,8 @@ var createDialogAction = async (args, thunkApi) => {
|
|
|
909
924
|
agentKey,
|
|
910
925
|
currentSpaceId: explicitSpaceId
|
|
911
926
|
}).catch(() => ({ recap: null, reason: "no-db", sourceDialogKey: void 0 })) : null;
|
|
912
|
-
if (typeof window !== "undefined" && recentRelationshipRecapResolution && process
|
|
927
|
+
if (typeof window !== "undefined" && recentRelationshipRecapResolution && // 浏览器端没有 process:走 app/utils/env 的安全读法。
|
|
928
|
+
isDevelopment) {
|
|
913
929
|
console.debug("[dialog] recent relationship recap", {
|
|
914
930
|
agentKey,
|
|
915
931
|
userId,
|
|
@@ -919,7 +935,7 @@ var createDialogAction = async (args, thunkApi) => {
|
|
|
919
935
|
});
|
|
920
936
|
}
|
|
921
937
|
const time = (0, import_date_fns.format)(/* @__PURE__ */ new Date(), "MM-dd HH:mm");
|
|
922
|
-
const title = titleOverride || (agentConfig?.name || "Agent") + " " + time;
|
|
938
|
+
const title = titleOverride || (agentMode === "auto" ? "\u65B0\u5BF9\u8BDD" : agentConfig?.name || "Agent") + " " + time;
|
|
923
939
|
const spaceId = explicitSpaceId;
|
|
924
940
|
const dialogPath = createDialogKey(userId);
|
|
925
941
|
const dialogId = extractCustomId(dialogPath);
|
|
@@ -954,7 +970,10 @@ var createDialogAction = async (args, thunkApi) => {
|
|
|
954
970
|
id: dialogId,
|
|
955
971
|
dbKey: dialogPath,
|
|
956
972
|
userId,
|
|
973
|
+
agentMode,
|
|
957
974
|
cybots,
|
|
975
|
+
...agentMode === "fixed" && agentKey ? { primaryAgentKey: agentKey } : {},
|
|
976
|
+
...agentMode === "auto" && autoRoute ? { autoRoute } : {},
|
|
958
977
|
title,
|
|
959
978
|
type: "dialog" /* DIALOG */,
|
|
960
979
|
createdAt: (0, import_date_fns.formatISO)(/* @__PURE__ */ new Date()),
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import {
|
|
2
2
|
i18n_default,
|
|
3
3
|
toolRegistry
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-NEKFSXOP.js";
|
|
5
5
|
import {
|
|
6
6
|
canonicalizeToolNames
|
|
7
|
-
} from "./chunk-
|
|
7
|
+
} from "./chunk-ZZ2MH7LE.js";
|
|
8
8
|
import {
|
|
9
9
|
isNoloHostedProvider
|
|
10
10
|
} from "./chunk-O6W2O2DA.js";
|
|
@@ -2,30 +2,30 @@ import {
|
|
|
2
2
|
buildCurrentTimeBlock,
|
|
3
3
|
buildIdentityBlock,
|
|
4
4
|
buildRuntimeGuidanceBlocks
|
|
5
|
-
} from "./chunk-
|
|
6
|
-
import {
|
|
7
|
-
canonicalizeToolNames
|
|
8
|
-
} from "./chunk-JTMNCCWF.js";
|
|
5
|
+
} from "./chunk-IOOMJJ4Z.js";
|
|
9
6
|
import {
|
|
10
7
|
estimateTokenCount,
|
|
11
8
|
getModelContextWindow,
|
|
12
9
|
planCompression,
|
|
13
10
|
planContextUsage,
|
|
14
11
|
serializeMessageContent
|
|
15
|
-
} from "./chunk-
|
|
12
|
+
} from "./chunk-EGPCU42M.js";
|
|
16
13
|
import {
|
|
17
14
|
clipCompactText
|
|
18
15
|
} from "./chunk-5MMAK75Q.js";
|
|
19
16
|
import {
|
|
20
17
|
findModelConfig,
|
|
21
18
|
getProviderByModelName
|
|
22
|
-
} from "./chunk-
|
|
23
|
-
import {
|
|
24
|
-
buildDialogSummaryLayer
|
|
25
|
-
} from "./chunk-QLUFR47U.js";
|
|
19
|
+
} from "./chunk-HQPG2PIV.js";
|
|
26
20
|
import {
|
|
27
21
|
toErrorMessage
|
|
28
22
|
} from "./chunk-HNMXYYJR.js";
|
|
23
|
+
import {
|
|
24
|
+
buildDialogSummaryLayer
|
|
25
|
+
} from "./chunk-AL2V7U3E.js";
|
|
26
|
+
import {
|
|
27
|
+
canonicalizeToolNames
|
|
28
|
+
} from "./chunk-ZZ2MH7LE.js";
|
|
29
29
|
import {
|
|
30
30
|
asRecordOrEmpty
|
|
31
31
|
} from "./chunk-KX6YBIHG.js";
|
|
@@ -1034,7 +1034,11 @@ function buildMessages(args) {
|
|
|
1034
1034
|
${dynamicContent}` : stableContent;
|
|
1035
1035
|
return {
|
|
1036
1036
|
messages: [
|
|
1037
|
-
...systemContent2 ? [{
|
|
1037
|
+
...systemContent2 ? [{
|
|
1038
|
+
role: "system",
|
|
1039
|
+
content: systemContent2,
|
|
1040
|
+
...stableContent ? { stable_prefix_chars: stableContent.length } : {}
|
|
1041
|
+
}] : [],
|
|
1038
1042
|
...prepareHistoryForNextTurn(args.history, args.contextReferenceResolver),
|
|
1039
1043
|
{ role: "user", content: args.input }
|
|
1040
1044
|
],
|
|
@@ -1147,7 +1151,9 @@ function applyPersistedTurnInput(messages, persistedInput, persistedInputReferen
|
|
|
1147
1151
|
async function runLocalAgentTurn(input) {
|
|
1148
1152
|
const agentConfig = await input.adapter.loadAgentConfig(input.agentRef);
|
|
1149
1153
|
if (!agentConfig) {
|
|
1150
|
-
const error = new Error(
|
|
1154
|
+
const error = new Error(
|
|
1155
|
+
`agentRef "${input.agentRef}" \u672A\u5339\u914D\u5230\u672C\u5730 agent\u3002\u8FD9\u4E0D\u662F\u914D\u7F6E\u7F3A\u5931\uFF0C\u8BF7\u7528 listAgents \u67E5\u770B\u53EF\u7528 agent\uFF0C\u518D\u7528 readAgent \u89E3\u6790 agentKey\uFF0C\u52FF\u624B\u5DE5\u62FC key\u3002`
|
|
1156
|
+
);
|
|
1151
1157
|
error.code = LOCAL_AGENT_CONFIG_MISSING_CODE;
|
|
1152
1158
|
error.agentRef = input.agentRef;
|
|
1153
1159
|
throw error;
|
|
@@ -1370,7 +1376,11 @@ async function runLocalAgentTurn(input) {
|
|
|
1370
1376
|
name: toolName,
|
|
1371
1377
|
arguments: toolCall.function.arguments,
|
|
1372
1378
|
...userInputText ? { userInput: userInputText } : {},
|
|
1379
|
+
...input.runtimeContext ? { runtimeContext: input.runtimeContext } : {},
|
|
1373
1380
|
...input.abortSignal ? { abortSignal: input.abortSignal } : {}
|
|
1381
|
+
}, {
|
|
1382
|
+
...input.abortSignal ? { abortSignal: input.abortSignal } : {},
|
|
1383
|
+
...input.runtimeContext ? { runtimeContext: input.runtimeContext } : {}
|
|
1374
1384
|
});
|
|
1375
1385
|
toolResult = await raceWithAbort(input, executePromise, toolName);
|
|
1376
1386
|
const actionGate = buildActionGate({
|
|
@@ -13,6 +13,7 @@ import {
|
|
|
13
13
|
var processEnv = typeof process !== "undefined" ? process.env : void 0;
|
|
14
14
|
var reactNativeDev = typeof globalThis !== "undefined" && "__DEV__" in globalThis ? globalThis.__DEV__ : void 0;
|
|
15
15
|
var isProduction = processEnv?.NOLO_FORCE_PRODUCTION === "1" || processEnv?.NODE_ENV === "production" || reactNativeDev === false;
|
|
16
|
+
var isDevelopment = !isProduction;
|
|
16
17
|
var getIsDesktopApp = () => (typeof process !== "undefined" ? process.env?.NOLO_DESKTOP : processEnv?.NOLO_DESKTOP) === "1" || typeof window !== "undefined" && window.__NOLO_DESKTOP__ === true;
|
|
17
18
|
var isDesktopApp = getIsDesktopApp();
|
|
18
19
|
|
|
@@ -258,6 +259,7 @@ var normalizeTimeFields = (data) => ({
|
|
|
258
259
|
|
|
259
260
|
export {
|
|
260
261
|
isProduction,
|
|
262
|
+
isDevelopment,
|
|
261
263
|
getIsDesktopApp,
|
|
262
264
|
createClientLogger,
|
|
263
265
|
isAbortError,
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import {
|
|
2
2
|
listUserRecordsFromServers,
|
|
3
3
|
readLiveDbRecordAfterTombstoneMerge
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-ZVOZH2HW.js";
|
|
5
5
|
import {
|
|
6
6
|
agentRecordHasConfiguredCredential
|
|
7
|
-
} from "./chunk-
|
|
7
|
+
} from "./chunk-FVIPEIVX.js";
|
|
8
8
|
import {
|
|
9
9
|
toSafeAgentSummary
|
|
10
|
-
} from "./chunk-
|
|
10
|
+
} from "./chunk-JP7REMYP.js";
|
|
11
11
|
|
|
12
12
|
// packages/cli/agentListHelpers.ts
|
|
13
13
|
function parseAgentRecordId(privateKey, explicitId) {
|
|
@@ -10,18 +10,18 @@ import {
|
|
|
10
10
|
toTimestampMs,
|
|
11
11
|
upsert,
|
|
12
12
|
write
|
|
13
|
-
} from "./chunk-
|
|
13
|
+
} from "./chunk-XRZJGPFI.js";
|
|
14
14
|
import {
|
|
15
15
|
createUserKey,
|
|
16
16
|
createUserPreferenceKey,
|
|
17
17
|
ulid
|
|
18
|
-
} from "./chunk-
|
|
18
|
+
} from "./chunk-6Y7A3OQQ.js";
|
|
19
19
|
import {
|
|
20
20
|
asTrimmedLowercaseString
|
|
21
21
|
} from "./chunk-QSJ3HFEF.js";
|
|
22
22
|
import {
|
|
23
23
|
BUILTIN_NOLO_AGENT_KEY
|
|
24
|
-
} from "./chunk-
|
|
24
|
+
} from "./chunk-3ND52WIL.js";
|
|
25
25
|
import {
|
|
26
26
|
asyncThunkCreator,
|
|
27
27
|
buildCreateSlice,
|
|
@@ -29,12 +29,12 @@ import {
|
|
|
29
29
|
createAsyncThunk,
|
|
30
30
|
createSelector,
|
|
31
31
|
selectIdentityUserId
|
|
32
|
-
} from "./chunk-
|
|
32
|
+
} from "./chunk-XMLRJUU5.js";
|
|
33
33
|
import {
|
|
34
34
|
getAllServers,
|
|
35
35
|
getIsDesktopApp,
|
|
36
36
|
isProduction
|
|
37
|
-
} from "./chunk-
|
|
37
|
+
} from "./chunk-R5V5G73M.js";
|
|
38
38
|
import {
|
|
39
39
|
SERVERS
|
|
40
40
|
} from "./chunk-LCBAMY2M.js";
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import {
|
|
2
2
|
getRuntimeServerContext,
|
|
3
3
|
scheduleDeleteReplication
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-XMLRJUU5.js";
|
|
5
5
|
import {
|
|
6
6
|
fetchFromClientDb
|
|
7
|
-
} from "./chunk-
|
|
7
|
+
} from "./chunk-R5V5G73M.js";
|
|
8
8
|
import {
|
|
9
9
|
buildTombstoneRecord
|
|
10
10
|
} from "./chunk-GBRG75BQ.js";
|
|
@@ -5,10 +5,10 @@ import {
|
|
|
5
5
|
inlineImageUrlsForCustomProvider,
|
|
6
6
|
prepareTools,
|
|
7
7
|
shouldInlineImageUrlsForAgent
|
|
8
|
-
} from "./chunk-
|
|
8
|
+
} from "./chunk-PZCBZO4J.js";
|
|
9
9
|
import {
|
|
10
10
|
performFetchRequest
|
|
11
|
-
} from "./chunk-
|
|
11
|
+
} from "./chunk-ZJZCMKOR.js";
|
|
12
12
|
import {
|
|
13
13
|
createSSEParser,
|
|
14
14
|
createToolRunId,
|
|
@@ -19,7 +19,7 @@ import {
|
|
|
19
19
|
toolRunSetPending,
|
|
20
20
|
toolRunStarted,
|
|
21
21
|
toolRunSucceeded
|
|
22
|
-
} from "./chunk-
|
|
22
|
+
} from "./chunk-NEKFSXOP.js";
|
|
23
23
|
import {
|
|
24
24
|
getPublicImageAgentMode
|
|
25
25
|
} from "./chunk-VIDPVFP3.js";
|
|
@@ -29,25 +29,31 @@ import {
|
|
|
29
29
|
messageStreaming,
|
|
30
30
|
selectCurrentSpaceId,
|
|
31
31
|
updateToolMessage
|
|
32
|
-
} from "./chunk-
|
|
32
|
+
} from "./chunk-NVB267BZ.js";
|
|
33
33
|
import {
|
|
34
34
|
streamAgentChatTurn
|
|
35
|
-
} from "./chunk-
|
|
35
|
+
} from "./chunk-MD3V54DA.js";
|
|
36
36
|
import {
|
|
37
37
|
EMPTY_ASSISTANT_REPAIR_PROMPT
|
|
38
|
-
} from "./chunk-
|
|
38
|
+
} from "./chunk-QCJITMYO.js";
|
|
39
39
|
import {
|
|
40
40
|
accumulateToolCallDelta,
|
|
41
41
|
createThinkParserState,
|
|
42
|
+
createToolCallTextParserState,
|
|
42
43
|
flushThinkParser,
|
|
44
|
+
flushToolCallTextParserIntoCallback,
|
|
45
|
+
processContentChunkWithToolCallStripping,
|
|
43
46
|
processThinkChunk
|
|
44
|
-
} from "./chunk-
|
|
47
|
+
} from "./chunk-LSFAWXKC.js";
|
|
45
48
|
import {
|
|
46
49
|
getModelInfo
|
|
47
|
-
} from "./chunk-
|
|
50
|
+
} from "./chunk-EGPCU42M.js";
|
|
48
51
|
import {
|
|
49
52
|
getApiEndpoint
|
|
50
|
-
} from "./chunk-
|
|
53
|
+
} from "./chunk-HQPG2PIV.js";
|
|
54
|
+
import {
|
|
55
|
+
toErrorMessage
|
|
56
|
+
} from "./chunk-HNMXYYJR.js";
|
|
51
57
|
import {
|
|
52
58
|
extractCustomId
|
|
53
59
|
} from "./chunk-DFFIZ25G.js";
|
|
@@ -56,27 +62,24 @@ import {
|
|
|
56
62
|
removeActiveController,
|
|
57
63
|
tokenUsageLiveUpdate
|
|
58
64
|
} from "./chunk-3ASDTTEI.js";
|
|
59
|
-
import {
|
|
60
|
-
toErrorMessage
|
|
61
|
-
} from "./chunk-HNMXYYJR.js";
|
|
62
65
|
import {
|
|
63
66
|
selectCurrentServer
|
|
64
|
-
} from "./chunk-
|
|
67
|
+
} from "./chunk-RVOUXDFU.js";
|
|
65
68
|
import {
|
|
66
69
|
write
|
|
67
|
-
} from "./chunk-
|
|
70
|
+
} from "./chunk-XRZJGPFI.js";
|
|
68
71
|
import {
|
|
69
72
|
createDialogMessageKeyAndId,
|
|
70
73
|
dialogMessageKey,
|
|
71
74
|
toTrimmedString
|
|
72
|
-
} from "./chunk-
|
|
75
|
+
} from "./chunk-6Y7A3OQQ.js";
|
|
73
76
|
import {
|
|
74
77
|
createAsyncThunk,
|
|
75
78
|
selectIdentityToken
|
|
76
|
-
} from "./chunk-
|
|
79
|
+
} from "./chunk-XMLRJUU5.js";
|
|
77
80
|
import {
|
|
78
81
|
isAbortError
|
|
79
|
-
} from "./chunk-
|
|
82
|
+
} from "./chunk-R5V5G73M.js";
|
|
80
83
|
import {
|
|
81
84
|
asTrimmedString
|
|
82
85
|
} from "./chunk-3EUW3WEO.js";
|
|
@@ -504,7 +507,7 @@ var processToolData = createAsyncThunk(
|
|
|
504
507
|
...llmContext ? { llmContext } : {},
|
|
505
508
|
...activity ? { activity } : {}
|
|
506
509
|
};
|
|
507
|
-
const isUiAskChoice = canonicalName === "
|
|
510
|
+
const isUiAskChoice = canonicalName === "ask_user";
|
|
508
511
|
const blocking = typeof executionToolArgs?.blocking === "boolean" ? executionToolArgs.blocking : true;
|
|
509
512
|
const hasPendingInteraction = isUiAskChoice && blocking === true;
|
|
510
513
|
return {
|
|
@@ -1105,6 +1108,7 @@ function createInitialStreamState() {
|
|
|
1105
1108
|
accumulatedToolCalls: [],
|
|
1106
1109
|
reasoningBuffer: "",
|
|
1107
1110
|
thinkState: createThinkParserState(),
|
|
1111
|
+
toolCallTextState: createToolCallTextParserState(),
|
|
1108
1112
|
assistantToolCalls: void 0,
|
|
1109
1113
|
hasHandedOff: false,
|
|
1110
1114
|
hasProcessedToolCalls: false,
|
|
@@ -1248,7 +1252,19 @@ function applyDelta(state, delta) {
|
|
|
1248
1252
|
}
|
|
1249
1253
|
const contentChunk = delta.content || "";
|
|
1250
1254
|
if (contentChunk) {
|
|
1251
|
-
const
|
|
1255
|
+
const { cleanedContent, state: tcState } = processContentChunkWithToolCallStripping(
|
|
1256
|
+
contentChunk,
|
|
1257
|
+
next.toolCallTextState,
|
|
1258
|
+
(name, arguments_) => {
|
|
1259
|
+
next.accumulatedToolCalls = accumulateToolCallChunks(
|
|
1260
|
+
next.accumulatedToolCalls ?? [],
|
|
1261
|
+
[{ index: next.accumulatedToolCalls.length, type: "function", function: { name, arguments: arguments_ } }]
|
|
1262
|
+
);
|
|
1263
|
+
}
|
|
1264
|
+
);
|
|
1265
|
+
next.toolCallTextState = tcState;
|
|
1266
|
+
if (!cleanedContent) return { state: next, hasNewVisibleContent };
|
|
1267
|
+
const parsed = processThinkChunk(cleanedContent, next.thinkState);
|
|
1252
1268
|
next.thinkState = parsed.state;
|
|
1253
1269
|
if (parsed.reasoning) {
|
|
1254
1270
|
next.reasoningBuffer = (next.reasoningBuffer || "") + parsed.reasoning;
|
|
@@ -1438,15 +1454,26 @@ async function readStreamChunkWithTimeout(reader, signal) {
|
|
|
1438
1454
|
async function handleStreamCompletion(state, ctx, finalizeCtx) {
|
|
1439
1455
|
let hasHandedOff = false;
|
|
1440
1456
|
let hasPendingInteraction = false;
|
|
1457
|
+
const { residualContent, state: tcFlushState } = flushToolCallTextParserIntoCallback(
|
|
1458
|
+
state.toolCallTextState,
|
|
1459
|
+
(name, arguments_) => {
|
|
1460
|
+
state.accumulatedToolCalls = accumulateToolCallChunks(
|
|
1461
|
+
state.accumulatedToolCalls ?? [],
|
|
1462
|
+
[{ index: state.accumulatedToolCalls.length, type: "function", function: { name, arguments: arguments_ } }]
|
|
1463
|
+
);
|
|
1464
|
+
}
|
|
1465
|
+
);
|
|
1466
|
+
state.toolCallTextState = tcFlushState;
|
|
1441
1467
|
const flushed = flushThinkParser(state.thinkState);
|
|
1442
1468
|
state.thinkState = flushed.state;
|
|
1443
1469
|
if (flushed.reasoning) {
|
|
1444
1470
|
state.reasoningBuffer = (state.reasoningBuffer || "") + flushed.reasoning;
|
|
1445
1471
|
}
|
|
1446
|
-
|
|
1472
|
+
const combinedFlushContent = residualContent + (flushed.content ?? "");
|
|
1473
|
+
if (combinedFlushContent) {
|
|
1447
1474
|
state = {
|
|
1448
1475
|
...state,
|
|
1449
|
-
contentBuffer: appendTextChunk(state.contentBuffer,
|
|
1476
|
+
contentBuffer: appendTextChunk(state.contentBuffer, combinedFlushContent)
|
|
1450
1477
|
};
|
|
1451
1478
|
}
|
|
1452
1479
|
if (!state.hasProcessedToolCalls && state.accumulatedToolCalls.length > 0) {
|
|
@@ -1568,7 +1595,23 @@ var sendOpenAICompletionsRequest = async ({
|
|
|
1568
1595
|
currentServer: selectCurrentServer(getState()),
|
|
1569
1596
|
signal,
|
|
1570
1597
|
token,
|
|
1571
|
-
dialogId
|
|
1598
|
+
dialogId,
|
|
1599
|
+
onRetry: (info) => {
|
|
1600
|
+
dispatch(
|
|
1601
|
+
messageStreaming({
|
|
1602
|
+
id: messageId,
|
|
1603
|
+
dialogId,
|
|
1604
|
+
dbKey: msgKey,
|
|
1605
|
+
content: "",
|
|
1606
|
+
role: "assistant",
|
|
1607
|
+
agentKey: agentConfig.dbKey,
|
|
1608
|
+
cybotKey: agentConfig.dbKey,
|
|
1609
|
+
...activeMessageMetadata ?? {},
|
|
1610
|
+
isStreaming: true,
|
|
1611
|
+
retryProgress: info
|
|
1612
|
+
})
|
|
1613
|
+
);
|
|
1614
|
+
}
|
|
1572
1615
|
});
|
|
1573
1616
|
logQuickChatPerfStage(quickChatPerfStartedAt, "openai-completions-fetch-response", {
|
|
1574
1617
|
ok: response.ok,
|
|
@@ -3,7 +3,7 @@ import {
|
|
|
3
3
|
} from "./chunk-6HYVJV7B.js";
|
|
4
4
|
import {
|
|
5
5
|
getDefaultCliLocalRuntimeDb
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-WJRJDX2W.js";
|
|
7
7
|
import {
|
|
8
8
|
buildCliRuntimeEnv,
|
|
9
9
|
clearProfileAuthToken,
|
|
@@ -23,7 +23,7 @@ import {
|
|
|
23
23
|
createMemoryOwnerIndexKey,
|
|
24
24
|
createMemorySubjectKindIndexKey,
|
|
25
25
|
memoryOwnerRange
|
|
26
|
-
} from "./chunk-
|
|
26
|
+
} from "./chunk-6Y7A3OQQ.js";
|
|
27
27
|
import {
|
|
28
28
|
asTrimmedNonEmptyStringArray
|
|
29
29
|
} from "./chunk-I42VC5KR.js";
|