nolo-cli 0.11.0 → 0.12.0-alpha.1
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-MWAY74HA.js} +51 -50
- package/{action-AA4IJ5K2.js → action-RAXNQQKC.js} +8 -9
- package/{addContentAction-QYVO4SYP.js → addContentAction-ZHI7TVV3.js} +7 -9
- package/{addDialogAgentAction-WVVKT5WQ.js → addDialogAgentAction-JWXPKXNC.js} +9 -10
- package/{agentDeleteCommand-RDPGYIWF.js → agentDeleteCommand-LXR5A5FV.js} +38 -28
- package/{agentEmailCommands-2HJJKS5F.js → agentEmailCommands-DXRAP7BB.js} +64 -62
- package/{agentListCommands-HFEVV3ZW.js → agentListCommands-ZFMS5ZLY.js} +127 -31
- package/{agentMachineCommands-25ZOENJU.js → agentMachineCommands-ZJLYVV52.js} +37 -26
- package/{agentPullCommand-GOL2S4W2.js → agentPullCommand-KRBRIFIY.js} +7 -7
- package/{agentRecordCommands-GTCOAM3L.js → agentRecordCommands-DFS626TB.js} +56 -54
- package/{agentRunCommand-YBS3JDLD.js → agentRunCommand-GWBIE2TS.js} +59 -59
- package/{agentRunControl-K4VKNEHF.js → agentRunControl-IX4F5W2C.js} +3 -3
- package/{agentRuntimeLocal-UQBMQI2M.js → agentRuntimeLocal-YNZSHMZC.js} +30 -15
- package/{agentSlice-6EKOBCCS.js → agentSlice-T2PXOEPQ.js} +8 -9
- package/{authCommand-O2OWACN4.js → authCommand-DMW336GT.js} +15 -15
- package/{authCommands-H7365TZP.js → authCommands-GH5T6RYV.js} +6 -6
- package/{chunk-7D3JY6C2.js → chunk-3HHTVM6G.js} +64 -5
- package/{chunk-AFON4QUU.js → chunk-3QKO4EHV.js} +3 -3
- package/{chunk-4SOKXIW4.js → chunk-43UD5ZP7.js} +8 -11
- package/{chunk-S3GS2PRL.js → chunk-4BTHUYMY.js} +597 -68
- package/{chunk-SV5MWASH.js → chunk-4EH7AR52.js} +12 -12
- package/{chunk-FXXSGWAJ.js → chunk-4GBNEA5B.js} +1 -1
- 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-X2S7JTIG.js → chunk-5ITRDSHY.js} +1240 -136
- package/{chunk-ISNCLGUZ.js → chunk-5NBHQD4D.js} +4 -3
- package/{chunk-GBDSZATH.js → chunk-6LMFFG3K.js} +3 -3
- package/{chunk-OUI3ZHYD.js → chunk-6OVCRC72.js} +1 -1
- package/{chunk-CKOJQDKR.js → chunk-7JJCGV7N.js} +146 -3
- package/{chunk-MQI77IRB.js → chunk-7MYHLZ3F.js} +2 -2
- package/{chunk-5MOUAAMK.js → chunk-AM53Q2SD.js} +194 -2564
- package/chunk-BYXBJQAS.js +0 -0
- package/{chunk-LAX2JSTX.js → chunk-DE5BA4O6.js} +20 -2
- package/{chunk-BX6U3ETE.js → chunk-DRMGJFGQ.js} +293 -89
- package/{chunk-KJR5KAUQ.js → chunk-EBH7G34M.js} +20 -7
- package/{chunk-E4HNJSHC.js → chunk-G3B356GF.js} +16 -18
- package/{chunk-KQQVGRA3.js → chunk-GDBCUWQ3.js} +35 -29
- package/{chunk-Q3UKJVU4.js → chunk-GPZM7QH6.js} +10 -10
- package/chunk-IKXL2HZ3.js +70 -0
- package/{chunk-QNMFBBZK.js → chunk-IVAOVLM7.js} +1 -1
- package/{chunk-EVZKZF32.js → chunk-JUN3HFMN.js} +182 -75
- package/{chunk-NEM67FX7.js → chunk-JZDIW766.js} +1 -1
- package/{chunk-TACHTH5D.js → chunk-LHSJMY5V.js} +18 -18
- package/{chunk-XYZA7S7V.js → chunk-MEVCDATU.js} +6 -6
- package/{chunk-YOCHZD7D.js → chunk-NCGFB7NN.js} +5 -3
- package/{chunk-O26GI2JP.js → chunk-NITP2JDG.js} +39 -8
- package/{chunk-YPRZSPF3.js → chunk-OCDEWRE2.js} +1 -1
- package/{chunk-PNEW2Z3T.js → chunk-OHEKYYJF.js} +7 -7
- package/chunk-OOIN7HSO.js +146 -0
- package/{chunk-DWGAEFJL.js → chunk-OPKKB25T.js} +1 -1
- package/{chunk-AEZAORLG.js → chunk-QCA3EPYK.js} +5 -5
- package/{chunk-C4FTUXVF.js → chunk-QLUFR47U.js} +11 -1
- package/{chunk-C2MDQQ4O.js → chunk-RNQ5BLR2.js} +1 -1
- package/{chunk-L53FGHA4.js → chunk-RSEUHW6T.js} +1 -1
- package/{chunk-2W2VYVI5.js → chunk-RZ735TLX.js} +527 -176
- package/chunk-S3UTETIC.js +4885 -0
- package/chunk-S73OEOHH.js +2286 -0
- package/{chunk-YTBMA7NO.js → chunk-TSKWE74T.js} +58 -8
- package/{chunk-5OIFWVX7.js → chunk-UG3WOFU6.js} +1 -1
- package/{chunk-4ZDM73SD.js → chunk-V2J635L5.js} +1 -1
- package/{chunk-IPYUUY4E.js → chunk-WPHL6ALY.js} +1 -1
- package/{chunk-3NSIQZZ6.js → chunk-WTYKCU4W.js} +9 -9
- package/{chunk-LP65VRCI.js → chunk-WWU275LU.js} +6 -6
- package/{chunk-XFOLQLDN.js → chunk-XHQWJUW4.js} +2 -2
- package/{chunk-D6OQHXVG.js → chunk-YDCZVUFP.js} +7 -7
- package/{chunk-PXQN7IBQ.js → chunk-YTQLJYLB.js} +2 -2
- package/{chunk-ZEYDOXHF.js → chunk-ZPFRLGIZ.js} +1467 -869
- package/{chunk-ZPRK73XY.js → chunk-ZR4VHQ5D.js} +14 -13
- package/cliEnvHelpers-VYC2OPTB.js +30 -0
- package/{createAgentAutomationAction-LTI5QU35.js → createAgentAutomationAction-G32GKDGV.js} +25 -26
- package/{createDialogAction-OJJ7L3L3.js → createDialogAction-TISANRZK.js} +26 -27
- package/{createPageAction-5MXWVRGY.js → createPageAction-O7KOYNV4.js} +26 -27
- package/{dbSlice-RQFQQVHT.js → dbSlice-WDP2ZZHK.js} +6 -7
- package/{deleteFile-7XP5BGC7.js → deleteFile-M7UNIUOO.js} +4 -4
- package/{dialogCommands-JTJ3RPPW.js → dialogCommands-6JPB3YQY.js} +33 -23
- package/{dialogSlice-OWROKURJ.js → dialogSlice-PRHHYSP5.js} +26 -27
- package/{docCreateCommands-WJBEW2V7.js → docCreateCommands-75E6TZNN.js} +33 -23
- package/{docDeleteCommands-BVEHJOY5.js → docDeleteCommands-EJHLN7LW.js} +34 -25
- package/{docReadCommands-NEWOZIJV.js → docReadCommands-RJYBC4FS.js} +33 -23
- package/{docStore-3DXRYBMD.js → docStore-H5VWKT5D.js} +25 -26
- package/{docUpdateCommands-C7WHT7UU.js → docUpdateCommands-MG4CNISV.js} +33 -23
- package/fetchMessages-KTNM7QAR.js +1 -1
- package/{getPricing-3E6UNPKL.js → getPricing-6TOZXPAU.js} +7 -3
- package/{handleSendMessageAction-B5PRR7BE.js → handleSendMessageAction-QTUGICSZ.js} +29 -30
- package/index.js +77 -76
- package/{localDialogRead-YSKFFRTT.js → localDialogRead-2VRI24F4.js} +1 -1
- package/{machineCommands-IIIREAEK.js → machineCommands-MAV7M3TK.js} +63 -61
- package/{machineWsRunDispatch-3SIU6ILW.js → machineWsRunDispatch-ZOEGTKHC.js} +55 -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-SWQKC7ZS.js} +1113 -678
- package/{removeDialogAgentAction-TCT35SOF.js → removeDialogAgentAction-GTX5AN54.js} +13 -13
- package/{runAgentClientLoop-EFM4PTVI.js → runAgentClientLoop-P25HACXX.js} +47 -47
- package/{runtimeDoctorCommands-ID43Z7VX.js → runtimeDoctorCommands-QNF3J3UV.js} +6 -6
- package/{setDialogExtraReferencesAction-CGYLZMFH.js → setDialogExtraReferencesAction-WFQ63KYO.js} +9 -10
- package/{setPrimaryDialogAgentAction-F6BFQDJU.js → setPrimaryDialogAgentAction-P57FXTSU.js} +13 -13
- package/{settingSlice-2I5HMG47.js → settingSlice-CK5YZGNI.js} +7 -8
- package/{skillDiscovery-UGSQGX2U.js → skillDiscovery-ZYHSX7VD.js} +3 -3
- package/{spaceCommands-MT7BWCIL.js → spaceCommands-6O5EFEM5.js} +37 -29
- package/{spaceSlice-BS5TSW3W.js → spaceSlice-4EXTYXS4.js} +28 -27
- package/{streamAgentChatTurn-I3VBFNR3.js → streamAgentChatTurn-Q3FJAHG2.js} +222 -128
- package/{toolApiClient-C7P7YSE4.js → toolApiClient-QI3YBNWB.js} +2 -2
- package/{tools-XSD2BOEN.js → tools-AHNQE4GP.js} +34 -34
- package/{tuiSummaryLlmCaller-32NRHTT2.js → tuiSummaryLlmCaller-TXLF4MEI.js} +8 -6
- package/{updateCommands-VOSPKXFF.js → updateCommands-XZDOOYFH.js} +13 -5
- package/{updateDialogTitleAction-7FYNJOGP.js → updateDialogTitleAction-XZDVLKVX.js} +29 -29
- package/chunk-5MMAK75Q.js +0 -15
- 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,6 +1,9 @@
|
|
|
1
1
|
import {
|
|
2
2
|
resolveMachineId
|
|
3
3
|
} from "./chunk-6HYVJV7B.js";
|
|
4
|
+
import {
|
|
5
|
+
getDefaultCliLocalRuntimeDb
|
|
6
|
+
} from "./chunk-H33743XH.js";
|
|
4
7
|
import {
|
|
5
8
|
buildCliRuntimeEnv,
|
|
6
9
|
clearProfileAuthToken,
|
|
@@ -18,18 +21,15 @@ import {
|
|
|
18
21
|
import {
|
|
19
22
|
asTrimmedNonEmptyStringArray
|
|
20
23
|
} from "./chunk-I42VC5KR.js";
|
|
24
|
+
import {
|
|
25
|
+
asTrimmedString
|
|
26
|
+
} from "./chunk-3EUW3WEO.js";
|
|
21
27
|
import {
|
|
22
28
|
resolveAuthTokenFromEnv
|
|
23
|
-
} from "./chunk-
|
|
29
|
+
} from "./chunk-5NBHQD4D.js";
|
|
24
30
|
import {
|
|
25
31
|
DEFAULT_NOLO_SERVER_URL
|
|
26
32
|
} from "./chunk-OLZBQWZU.js";
|
|
27
|
-
import {
|
|
28
|
-
getDefaultCliLocalRuntimeDb
|
|
29
|
-
} from "./chunk-H33743XH.js";
|
|
30
|
-
import {
|
|
31
|
-
asTrimmedString
|
|
32
|
-
} from "./chunk-3EUW3WEO.js";
|
|
33
33
|
import {
|
|
34
34
|
normalizeServerOrigin
|
|
35
35
|
} from "./chunk-CF7PE763.js";
|
|
@@ -0,0 +1,146 @@
|
|
|
1
|
+
import {
|
|
2
|
+
getModelAbility
|
|
3
|
+
} from "./chunk-IKXL2HZ3.js";
|
|
4
|
+
|
|
5
|
+
// packages/ai/agent/safeAgentSummary.ts
|
|
6
|
+
function parseTimestamp(val) {
|
|
7
|
+
if (typeof val === "number" && Number.isFinite(val)) return val;
|
|
8
|
+
if (typeof val === "string") return Date.parse(val) || 0;
|
|
9
|
+
return 0;
|
|
10
|
+
}
|
|
11
|
+
function safeTimestamp(val) {
|
|
12
|
+
if (typeof val === "number" && Number.isFinite(val)) return val;
|
|
13
|
+
if (typeof val === "string") return val;
|
|
14
|
+
return null;
|
|
15
|
+
}
|
|
16
|
+
function parseAgentRecordId(privateKey, explicitId) {
|
|
17
|
+
if (explicitId && typeof explicitId === "string" && explicitId.trim()) {
|
|
18
|
+
return explicitId.trim();
|
|
19
|
+
}
|
|
20
|
+
if (privateKey && typeof privateKey === "string") {
|
|
21
|
+
const match = privateKey.match(/^agent-[^-]+-(.+)$/i);
|
|
22
|
+
if (match?.[1]) return match[1];
|
|
23
|
+
}
|
|
24
|
+
return null;
|
|
25
|
+
}
|
|
26
|
+
function resolveFavoriteStatus(record, options) {
|
|
27
|
+
if (options?.isFavorite !== void 0) {
|
|
28
|
+
return {
|
|
29
|
+
isFavorite: !!options.isFavorite,
|
|
30
|
+
favoritedAt: safeTimestamp(options.favoritedAt)
|
|
31
|
+
};
|
|
32
|
+
}
|
|
33
|
+
if (record?.isFavorite === true) {
|
|
34
|
+
return {
|
|
35
|
+
isFavorite: true,
|
|
36
|
+
favoritedAt: safeTimestamp(record?.favoritedAt)
|
|
37
|
+
};
|
|
38
|
+
}
|
|
39
|
+
const favoritesMap = options?.favoritesMap;
|
|
40
|
+
if (!favoritesMap) {
|
|
41
|
+
return { isFavorite: false, favoritedAt: null };
|
|
42
|
+
}
|
|
43
|
+
const candidateKeys = [];
|
|
44
|
+
if (typeof record?.dbKey === "string" && record.dbKey) candidateKeys.push(record.dbKey);
|
|
45
|
+
if (typeof record?.privateKey === "string" && record.privateKey) candidateKeys.push(record.privateKey);
|
|
46
|
+
if (typeof record?.publicKey === "string" && record.publicKey) candidateKeys.push(record.publicKey);
|
|
47
|
+
if (typeof record?.id === "string" && record.id) {
|
|
48
|
+
candidateKeys.push(record.id);
|
|
49
|
+
candidateKeys.push(`agent-pub-${record.id}`);
|
|
50
|
+
if (options?.userId) {
|
|
51
|
+
candidateKeys.push(`agent-${options.userId}-${record.id}`);
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
let matched = false;
|
|
55
|
+
let highestFavAt = null;
|
|
56
|
+
let highestFavTime = -1;
|
|
57
|
+
for (const key of candidateKeys) {
|
|
58
|
+
const val = favoritesMap instanceof Map ? favoritesMap.get(key) : favoritesMap[key];
|
|
59
|
+
if (val !== void 0 && val !== false && val !== null) {
|
|
60
|
+
const favAt = val === true ? 1 : safeTimestamp(val);
|
|
61
|
+
if (favAt === null) continue;
|
|
62
|
+
matched = true;
|
|
63
|
+
const time = parseTimestamp(favAt);
|
|
64
|
+
if (time > highestFavTime) {
|
|
65
|
+
highestFavTime = time;
|
|
66
|
+
highestFavAt = favAt;
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
if (matched) {
|
|
71
|
+
return {
|
|
72
|
+
isFavorite: true,
|
|
73
|
+
favoritedAt: highestFavAt ?? 1
|
|
74
|
+
};
|
|
75
|
+
}
|
|
76
|
+
return { isFavorite: false, favoritedAt: null };
|
|
77
|
+
}
|
|
78
|
+
function toSafeAgentSummary(record, options) {
|
|
79
|
+
const rawId = parseAgentRecordId(
|
|
80
|
+
typeof record?.privateKey === "string" ? record.privateKey : record?.dbKey,
|
|
81
|
+
typeof record?.id === "string" ? record.id : void 0
|
|
82
|
+
);
|
|
83
|
+
const id = rawId ?? (typeof record?.id === "string" ? record.id : null);
|
|
84
|
+
const publicRecordDenied = record?.publicRecordExists === false || options?.publicRecordExists === false;
|
|
85
|
+
const publicRecordConfirmed = record?.publicRecordExists === true || options?.publicRecordExists === true;
|
|
86
|
+
let publicKey;
|
|
87
|
+
if (typeof record?.publicKey === "string" && record.publicKey && !publicRecordDenied) {
|
|
88
|
+
publicKey = record.publicKey;
|
|
89
|
+
} else if (publicRecordConfirmed && id) {
|
|
90
|
+
publicKey = `agent-pub-${id}`;
|
|
91
|
+
}
|
|
92
|
+
const name = typeof record?.name === "string" && record.name ? record.name : "(unnamed)";
|
|
93
|
+
const handle = typeof record?.handle === "string" && record.handle ? record.handle : null;
|
|
94
|
+
const introduction = typeof record?.introduction === "string" && record.introduction ? record.introduction : typeof record?.description === "string" && record.description ? record.description : null;
|
|
95
|
+
const model = typeof record?.model === "string" && record.model ? record.model : null;
|
|
96
|
+
const provider = typeof record?.provider === "string" && record.provider ? record.provider : typeof record?.apiSource === "string" && record.apiSource ? record.apiSource : null;
|
|
97
|
+
const apiSource = typeof record?.apiSource === "string" && record.apiSource ? record.apiSource : null;
|
|
98
|
+
const cliProvider = typeof record?.cliProvider === "string" && record.cliProvider ? record.cliProvider : null;
|
|
99
|
+
const tools = Array.isArray(record?.tools) ? record.tools.filter((t) => typeof t === "string") : [];
|
|
100
|
+
const inputPrice = typeof record?.inputPrice === "number" && Number.isFinite(record.inputPrice) ? record.inputPrice : null;
|
|
101
|
+
const outputPrice = typeof record?.outputPrice === "number" && Number.isFinite(record.outputPrice) ? record.outputPrice : null;
|
|
102
|
+
const modelAbility = model ? getModelAbility(model) ?? null : null;
|
|
103
|
+
const favStatus = resolveFavoriteStatus(record, options);
|
|
104
|
+
const isPublic = record?.isPublic === true || record?.isPublicFlag === true || record?.publicRecordExists === true;
|
|
105
|
+
const updatedAt = safeTimestamp(record?.updatedAt ?? record?.createdAt ?? record?.created);
|
|
106
|
+
return {
|
|
107
|
+
id,
|
|
108
|
+
...publicKey !== void 0 ? { publicKey } : {},
|
|
109
|
+
name,
|
|
110
|
+
handle,
|
|
111
|
+
introduction,
|
|
112
|
+
model,
|
|
113
|
+
provider,
|
|
114
|
+
apiSource,
|
|
115
|
+
cliProvider,
|
|
116
|
+
tools,
|
|
117
|
+
inputPrice,
|
|
118
|
+
outputPrice,
|
|
119
|
+
modelAbility,
|
|
120
|
+
isFavorite: favStatus.isFavorite,
|
|
121
|
+
favoritedAt: favStatus.favoritedAt,
|
|
122
|
+
isPublic,
|
|
123
|
+
updatedAt
|
|
124
|
+
};
|
|
125
|
+
}
|
|
126
|
+
function sortSafeAgentSummaries(agents) {
|
|
127
|
+
return [...agents].sort((left, right) => {
|
|
128
|
+
const leftFav = left.isFavorite === true;
|
|
129
|
+
const rightFav = right.isFavorite === true;
|
|
130
|
+
if (leftFav && !rightFav) return -1;
|
|
131
|
+
if (!leftFav && rightFav) return 1;
|
|
132
|
+
if (leftFav && rightFav) {
|
|
133
|
+
const leftFavAt = parseTimestamp(left.favoritedAt);
|
|
134
|
+
const rightFavAt = parseTimestamp(right.favoritedAt);
|
|
135
|
+
if (leftFavAt !== rightFavAt) return rightFavAt - leftFavAt;
|
|
136
|
+
}
|
|
137
|
+
const leftUpdated = parseTimestamp(left.updatedAt ?? left.createdAt);
|
|
138
|
+
const rightUpdated = parseTimestamp(right.updatedAt ?? right.createdAt);
|
|
139
|
+
return rightUpdated - leftUpdated;
|
|
140
|
+
});
|
|
141
|
+
}
|
|
142
|
+
|
|
143
|
+
export {
|
|
144
|
+
toSafeAgentSummary,
|
|
145
|
+
sortSafeAgentSummaries
|
|
146
|
+
};
|
|
@@ -2,10 +2,13 @@ import {
|
|
|
2
2
|
buildLocalAgentLookupKeys,
|
|
3
3
|
normalizeAgentHandle,
|
|
4
4
|
shouldReadAgentKeyRemotely
|
|
5
|
-
} from "./chunk-
|
|
5
|
+
} from "./chunk-RNQ5BLR2.js";
|
|
6
6
|
import {
|
|
7
7
|
resolveCliAgentKeyInput
|
|
8
8
|
} from "./chunk-VHBWHNVT.js";
|
|
9
|
+
import {
|
|
10
|
+
toErrorMessage
|
|
11
|
+
} from "./chunk-HNMXYYJR.js";
|
|
9
12
|
import {
|
|
10
13
|
readPipeText,
|
|
11
14
|
spawnProcess
|
|
@@ -19,10 +22,7 @@ import {
|
|
|
19
22
|
resolveAuthToken,
|
|
20
23
|
resolveServerCandidates,
|
|
21
24
|
resolveServerUrl
|
|
22
|
-
} from "./chunk-
|
|
23
|
-
import {
|
|
24
|
-
toErrorMessage
|
|
25
|
-
} from "./chunk-HNMXYYJR.js";
|
|
25
|
+
} from "./chunk-5NBHQD4D.js";
|
|
26
26
|
|
|
27
27
|
// packages/cli/agentRecordHelpers.ts
|
|
28
28
|
import { readFileSync } from "node:fs";
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import {
|
|
2
|
-
MEMORY_USE_GUIDANCE
|
|
2
|
+
MEMORY_USE_GUIDANCE,
|
|
3
|
+
wrapHistoricalSummaryWithReplayGuard
|
|
3
4
|
} from "./chunk-KKY4B2Q2.js";
|
|
4
5
|
|
|
5
6
|
// packages/agent-runtime/turnContext.ts
|
|
@@ -122,6 +123,14 @@ var buildLinkedSpacesSection = async (args) => {
|
|
|
122
123
|
"\u63D0\u793A\uFF1A\u5982\u9700\u67E5\u8BE2\u8FD9\u4E9B\u7A7A\u95F4\u7684\u8BE6\u7EC6\u5185\u5BB9\uFF0C\u53EF\u4F7F\u7528 read \u5DE5\u5177\u914D\u5408\u5BF9\u5E94\u7684 dbKey\u3002"
|
|
123
124
|
].join("\n");
|
|
124
125
|
};
|
|
126
|
+
var buildDialogSummaryLayer = (args) => {
|
|
127
|
+
const historical = wrapHistoricalSummaryWithReplayGuard(
|
|
128
|
+
asTrimmed(args.summary)
|
|
129
|
+
);
|
|
130
|
+
if (!historical) return null;
|
|
131
|
+
return makeLayer("dialog-summary", `--- \u5386\u53F2\u5BF9\u8BDD\u6458\u8981 ---
|
|
132
|
+
${historical}`);
|
|
133
|
+
};
|
|
125
134
|
var buildMemoryOverlayLayer = (args) => {
|
|
126
135
|
const promptBlock = asTrimmed(args.promptBlock);
|
|
127
136
|
if (!promptBlock) return null;
|
|
@@ -141,6 +150,7 @@ export {
|
|
|
141
150
|
buildSpaceContextLayer,
|
|
142
151
|
buildSkillDiscoveryLayer,
|
|
143
152
|
buildLinkedSpacesSection,
|
|
153
|
+
buildDialogSummaryLayer,
|
|
144
154
|
buildMemoryOverlayLayer,
|
|
145
155
|
buildMemoryUseGuidanceLayer
|
|
146
156
|
};
|