nolo-cli 0.8.0-alpha.6 → 0.8.0-alpha.7
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-XIGO7HW5.js +198 -0
- package/action-PAXRPJJF.js +27 -0
- package/addContentAction-CZVWF3QZ.js +25 -0
- package/addDialogAgentAction-CCIDTPHC.js +67 -0
- package/agentDeleteCommand-47B24JYG.js +323 -0
- package/agentEmailCommands-D4FC6OZJ.js +621 -0
- package/agentListCommands-UFET7CC4.js +219 -0
- package/agentMachineCommands-LH7QDQPP.js +421 -0
- package/agentPullCommand-O2MTUAFR.js +122 -0
- package/agentRecordCommands-CWS2B5IA.js +89 -0
- package/agentRunCommand-3FRPISLG.js +102 -0
- package/agentRunControl-K4VKNEHF.js +57 -0
- package/agentRuntimeLocal-JNQQC2WG.js +99 -0
- package/agentSlice-XDFSELFJ.js +41 -0
- package/authCommand-WXMD3IPR.js +574 -0
- package/authCommands-X74AFDTC.js +26 -0
- package/chunk-2EISRLRC.js +238 -0
- package/chunk-2FTTDCD4.js +675 -0
- package/chunk-2JHWPW5B.js +2127 -0
- package/chunk-2LMT6K6N.js +171 -0
- package/chunk-2MALU52L.js +51 -0
- package/chunk-364VYAX2.js +19 -0
- package/chunk-3ASDTTEI.js +1774 -0
- package/chunk-3EUW3WEO.js +8 -0
- package/chunk-3LY4F7SV.js +9293 -0
- package/chunk-4CQLVGRV.js +50 -0
- package/chunk-4IJYA27C.js +342 -0
- package/chunk-4SN6J65J.js +38 -0
- package/chunk-4VNS5WPM.js +42 -0
- package/chunk-543C7RDK.js +562 -0
- package/chunk-572EKYLF.js +792 -0
- package/chunk-5MIDPSSK.js +206 -0
- package/chunk-5MMAK75Q.js +15 -0
- package/chunk-5XH3NZ4T.js +3631 -0
- package/chunk-63W5N6P3.js +150 -0
- package/chunk-6HYVJV7B.js +102 -0
- package/chunk-6PWWWMI7.js +628 -0
- package/chunk-6WD3OOJS.js +20 -0
- package/chunk-A3X4Y7MO.js +4294 -0
- package/chunk-AR7ZSGDI.js +929 -0
- package/chunk-ATNTHIZI.js +13 -0
- package/chunk-AUGHVUFE.js +69 -0
- package/chunk-AVMKZHBC.js +85 -0
- package/chunk-AZPCASRE.js +36 -0
- package/chunk-B76D3JJK.js +1447 -0
- package/chunk-BR2WP3DF.js +548 -0
- package/chunk-BSTNFPHD.js +231 -0
- package/chunk-CF2WZF4N.js +134 -0
- package/chunk-CF7PE763.js +10 -0
- package/chunk-CKOJQDKR.js +198 -0
- package/chunk-CM54RSSA.js +206 -0
- package/chunk-CWMSB67P.js +34 -0
- package/chunk-DA2OEKS6.js +27 -0
- package/chunk-DFFIZ25G.js +30 -0
- package/chunk-DWLEOOGR.js +8 -0
- package/chunk-DZ3XJVET.js +231 -0
- package/chunk-E5HMHIKL.js +222 -0
- package/chunk-EHLHSX7R.js +1433 -0
- package/chunk-ELRRLDWI.js +478 -0
- package/chunk-EYEEHCU4.js +3066 -0
- package/chunk-G3SUCT4W.js +8 -0
- package/chunk-G5H7RNFL.js +807 -0
- package/chunk-GAKEBQD6.js +30 -0
- package/chunk-GBRG75BQ.js +86 -0
- package/chunk-GEKCOPTN.js +190 -0
- package/chunk-H2RMRZJE.js +113 -0
- package/chunk-H33743XH.js +25 -0
- package/chunk-HEIIIZBX.js +104 -0
- package/chunk-HNMXYYJR.js +12 -0
- package/chunk-IAXBCTTE.js +175 -0
- package/chunk-IDZTNRP2.js +85 -0
- package/chunk-IECI4YHR.js +421 -0
- package/chunk-ISNCLGUZ.js +146 -0
- package/chunk-IYQV26RA.js +138 -0
- package/chunk-JBTJAPUF.js +35 -0
- package/chunk-JZPBVBIY.js +94 -0
- package/chunk-KK6SWS5B.js +1078 -0
- package/chunk-KQHGZWSV.js +63 -0
- package/chunk-KTI2WDDG.js +24674 -0
- package/chunk-KUG52IAP.js +8 -0
- package/chunk-KX6YBIHG.js +8 -0
- package/chunk-LCBAMY2M.js +60 -0
- package/chunk-LM25IZBJ.js +902 -0
- package/chunk-LM6IYQ3F.js +16 -0
- package/chunk-M76ECQRD.js +13658 -0
- package/chunk-MRC4Q34M.js +188 -0
- package/chunk-NE3E3XJ2.js +936 -0
- package/chunk-NXZGF7F7.js +2878 -0
- package/chunk-OF5H3QWS.js +300 -0
- package/chunk-OLZBQWZU.js +6 -0
- package/chunk-OVGXXUVI.js +91 -0
- package/chunk-OWOHNGCN.js +50 -0
- package/chunk-PN7AFLOK.js +3401 -0
- package/chunk-QSJ3HFEF.js +8 -0
- package/chunk-QYXLLLGL.js +4519 -0
- package/chunk-ROWQEJRP.js +139 -0
- package/chunk-S7Z2HMCN.js +25 -0
- package/chunk-SL3EPWB4.js +1949 -0
- package/chunk-TDIQFT2F.js +301 -0
- package/chunk-TILFE6LV.js +381 -0
- package/chunk-U4TRT5V4.js +246 -0
- package/chunk-U6VC4MU4.js +8 -0
- package/chunk-UAD2WT54.js +64 -0
- package/chunk-USZDUWOV.js +191 -0
- package/chunk-USZMK5UT.js +105 -0
- package/chunk-UVPF33PW.js +46995 -0
- package/chunk-V2F4OGYM.js +9013 -0
- package/chunk-VEJLAVTC.js +2052 -0
- package/chunk-VF4K2QE6.js +21 -0
- package/chunk-VHBWHNVT.js +59 -0
- package/chunk-VIDPVFP3.js +20 -0
- package/chunk-VP4WJWKW.js +8882 -0
- package/chunk-VQ2AJRGD.js +148 -0
- package/chunk-W4NVOSFF.js +37 -0
- package/chunk-WWC7I6TA.js +8 -0
- package/chunk-X7W4TNB4.js +1550 -0
- package/chunk-XDVAYP26.js +537 -0
- package/chunk-XKIMRZO2.js +221 -0
- package/chunk-Y5GCAMGP.js +9 -0
- package/chunk-YD43KPCK.js +360 -0
- package/chunk-YIJFUVKA.js +34 -0
- package/chunk-Z4NR32XR.js +50 -0
- package/chunk-ZNFJWEN4.js +56 -0
- package/cliExecutor-DNE7TCC4.js +36 -0
- package/clipboardy-BVE3LVEH.js +12001 -0
- package/createAgentAutomationAction-3QTGNYJC.js +864 -0
- package/createDialogAction-5YX3ARBK.js +52 -0
- package/createPageAction-EQNQQRCW.js +169 -0
- package/db-HCJ5PRB5.js +271 -0
- package/dbSlice-C4UJLRZP.js +59 -0
- package/deleteFile-4SKGPHOZ.js +41 -0
- package/dialogCommands-AOQS23FV.js +59 -0
- package/dialogSlice-GZE3NCMC.js +146 -0
- package/docCreateCommands-GVOQVJON.js +215 -0
- package/docDeleteCommands-GEB7YAUZ.js +176 -0
- package/docReadCommands-XYKI2DF2.js +129 -0
- package/docStore-MLM5AME5.js +96 -0
- package/docUpdateCommands-4L3RAMHZ.js +313 -0
- package/fetchMessages-JOCYIFKL.js +16 -0
- package/getPricing-PWPJ6MNV.js +30 -0
- package/handleSendMessageAction-WG2GKTGZ.js +183 -0
- package/index.js +188 -113035
- package/localDialogRead-D3BELSTF.js +26 -0
- package/localFirstLog-DHNOY2NA.js +19 -0
- package/localRuntimeAuthority-TEGCOWX4.js +471 -0
- package/localRuntimeDb-LGDF6FQP.js +12 -0
- package/machineCommands-ZNXKLH6Q.js +774 -0
- package/machineInfo-M6KB6HZN.js +10 -0
- package/machineWsRunDispatch-7WRG6HNV.js +105 -0
- package/memoryCommands-O4MIPIWQ.js +476 -0
- package/models-XLEOET3E.js +9 -0
- package/offlineMarxistsAgentCommand-BCPJITJL.js +242 -0
- package/package.json +3 -25
- package/read-RIJCIVKX.js +17 -0
- package/readDocTool-GZD2N3LO.js +16 -0
- package/readlineWorkspace-AQURUDN4.js +5357 -0
- package/removeDialogAgentAction-CXLST3N6.js +72 -0
- package/runAgentClientLoop-VQUEKGA5.js +288 -0
- package/runtimeDoctorCommands-LRHLPDRC.js +289 -0
- package/setDialogExtraReferencesAction-LP6VYGU7.js +59 -0
- package/setPrimaryDialogAgentAction-D3GGH23T.js +79 -0
- package/settingSlice-J4I3Z5H7.js +198 -0
- package/skillSummaryMarker-42HKSXYY.js +9 -0
- package/slateToRenderMarkdown-Y5IYN73U.js +7 -0
- package/slateUtils-2M7MUTWX.js +19 -0
- package/spaceCommands-R2RXD5UY.js +450 -0
- package/spaceSlice-5UT4JNIN.js +145 -0
- package/streamAgentChatTurn-NRWSQKFN.js +4503 -0
- package/tableCommands-66XEWHAK.js +1286 -0
- package/toolApiClient-QI3YBNWB.js +26 -0
- package/tools-TNMUDDRK.js +83 -0
- package/understanding-HCSFPE7R.js +318 -0
- package/updateCommands-VOSPKXFF.js +31 -0
- package/updateDialogTitleAction-IXOKAVX3.js +185 -0
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import {
|
|
2
|
+
ToolApiError,
|
|
3
|
+
buildToolRequestHeaders,
|
|
4
|
+
callToolApi,
|
|
5
|
+
getRequestConfig,
|
|
6
|
+
getToolBaseUrl,
|
|
7
|
+
getToolRequestContext,
|
|
8
|
+
resolveToolApiBaseUrl,
|
|
9
|
+
resolveToolBaseUrl
|
|
10
|
+
} from "./chunk-5MIDPSSK.js";
|
|
11
|
+
import "./chunk-DFFIZ25G.js";
|
|
12
|
+
import "./chunk-3ASDTTEI.js";
|
|
13
|
+
import "./chunk-DWLEOOGR.js";
|
|
14
|
+
import "./chunk-QSJ3HFEF.js";
|
|
15
|
+
import "./chunk-KUG52IAP.js";
|
|
16
|
+
import "./chunk-4VNS5WPM.js";
|
|
17
|
+
export {
|
|
18
|
+
ToolApiError,
|
|
19
|
+
buildToolRequestHeaders,
|
|
20
|
+
callToolApi,
|
|
21
|
+
getRequestConfig,
|
|
22
|
+
getToolBaseUrl,
|
|
23
|
+
getToolRequestContext,
|
|
24
|
+
resolveToolApiBaseUrl,
|
|
25
|
+
resolveToolBaseUrl
|
|
26
|
+
};
|
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
import {
|
|
2
|
+
TOOL_GROUP_META,
|
|
3
|
+
TOOL_PACKS,
|
|
4
|
+
addDefaultLightWebToolsForConfiguredAgents,
|
|
5
|
+
applyDefaultWebToolPacks,
|
|
6
|
+
findToolExecutor,
|
|
7
|
+
patchAgentToolSchemas,
|
|
8
|
+
toolDefinitionsByName,
|
|
9
|
+
toolDescriptions,
|
|
10
|
+
toolExecutors,
|
|
11
|
+
toolQueryFunc,
|
|
12
|
+
toolQueryFunctionSchema,
|
|
13
|
+
toolRegistry
|
|
14
|
+
} from "./chunk-UVPF33PW.js";
|
|
15
|
+
import "./chunk-GAKEBQD6.js";
|
|
16
|
+
import "./chunk-KQHGZWSV.js";
|
|
17
|
+
import "./chunk-XKIMRZO2.js";
|
|
18
|
+
import "./chunk-3LY4F7SV.js";
|
|
19
|
+
import "./chunk-VP4WJWKW.js";
|
|
20
|
+
import "./chunk-63W5N6P3.js";
|
|
21
|
+
import "./chunk-IECI4YHR.js";
|
|
22
|
+
import "./chunk-AR7ZSGDI.js";
|
|
23
|
+
import "./chunk-NXZGF7F7.js";
|
|
24
|
+
import "./chunk-HEIIIZBX.js";
|
|
25
|
+
import "./chunk-KTI2WDDG.js";
|
|
26
|
+
import "./chunk-MRC4Q34M.js";
|
|
27
|
+
import "./chunk-OVGXXUVI.js";
|
|
28
|
+
import "./chunk-CWMSB67P.js";
|
|
29
|
+
import "./chunk-543C7RDK.js";
|
|
30
|
+
import "./chunk-IYQV26RA.js";
|
|
31
|
+
import "./chunk-Z4NR32XR.js";
|
|
32
|
+
import "./chunk-M76ECQRD.js";
|
|
33
|
+
import "./chunk-AUGHVUFE.js";
|
|
34
|
+
import "./chunk-H2RMRZJE.js";
|
|
35
|
+
import "./chunk-UAD2WT54.js";
|
|
36
|
+
import "./chunk-USZMK5UT.js";
|
|
37
|
+
import "./chunk-LM25IZBJ.js";
|
|
38
|
+
import "./chunk-5MMAK75Q.js";
|
|
39
|
+
import "./chunk-572EKYLF.js";
|
|
40
|
+
import "./chunk-TDIQFT2F.js";
|
|
41
|
+
import "./chunk-JZPBVBIY.js";
|
|
42
|
+
import "./chunk-BR2WP3DF.js";
|
|
43
|
+
import "./chunk-5MIDPSSK.js";
|
|
44
|
+
import "./chunk-DFFIZ25G.js";
|
|
45
|
+
import "./chunk-3ASDTTEI.js";
|
|
46
|
+
import "./chunk-DWLEOOGR.js";
|
|
47
|
+
import "./chunk-HNMXYYJR.js";
|
|
48
|
+
import "./chunk-IAXBCTTE.js";
|
|
49
|
+
import "./chunk-VEJLAVTC.js";
|
|
50
|
+
import "./chunk-Y5GCAMGP.js";
|
|
51
|
+
import "./chunk-G5H7RNFL.js";
|
|
52
|
+
import "./chunk-AZPCASRE.js";
|
|
53
|
+
import "./chunk-2EISRLRC.js";
|
|
54
|
+
import "./chunk-KX6YBIHG.js";
|
|
55
|
+
import "./chunk-PN7AFLOK.js";
|
|
56
|
+
import "./chunk-WWC7I6TA.js";
|
|
57
|
+
import "./chunk-QSJ3HFEF.js";
|
|
58
|
+
import "./chunk-ELRRLDWI.js";
|
|
59
|
+
import "./chunk-EYEEHCU4.js";
|
|
60
|
+
import "./chunk-QYXLLLGL.js";
|
|
61
|
+
import "./chunk-GBRG75BQ.js";
|
|
62
|
+
import "./chunk-4SN6J65J.js";
|
|
63
|
+
import "./chunk-LCBAMY2M.js";
|
|
64
|
+
import "./chunk-3EUW3WEO.js";
|
|
65
|
+
import "./chunk-U6VC4MU4.js";
|
|
66
|
+
import "./chunk-CF7PE763.js";
|
|
67
|
+
import "./chunk-G3SUCT4W.js";
|
|
68
|
+
import "./chunk-KUG52IAP.js";
|
|
69
|
+
import "./chunk-4VNS5WPM.js";
|
|
70
|
+
export {
|
|
71
|
+
TOOL_GROUP_META,
|
|
72
|
+
TOOL_PACKS,
|
|
73
|
+
addDefaultLightWebToolsForConfiguredAgents,
|
|
74
|
+
applyDefaultWebToolPacks,
|
|
75
|
+
findToolExecutor,
|
|
76
|
+
patchAgentToolSchemas,
|
|
77
|
+
toolDefinitionsByName,
|
|
78
|
+
toolDescriptions,
|
|
79
|
+
toolExecutors,
|
|
80
|
+
toolQueryFunc,
|
|
81
|
+
toolQueryFunctionSchema,
|
|
82
|
+
toolRegistry
|
|
83
|
+
};
|
|
@@ -0,0 +1,318 @@
|
|
|
1
|
+
import {
|
|
2
|
+
loadMemoryCandidatesFromDb
|
|
3
|
+
} from "./chunk-HEIIIZBX.js";
|
|
4
|
+
import {
|
|
5
|
+
compactWhitespace
|
|
6
|
+
} from "./chunk-DWLEOOGR.js";
|
|
7
|
+
import {
|
|
8
|
+
createMemoryKey,
|
|
9
|
+
createMemoryOwnerIndexKey,
|
|
10
|
+
createMemorySubjectKindIndexKey,
|
|
11
|
+
ulid
|
|
12
|
+
} from "./chunk-PN7AFLOK.js";
|
|
13
|
+
import "./chunk-WWC7I6TA.js";
|
|
14
|
+
import "./chunk-3EUW3WEO.js";
|
|
15
|
+
import "./chunk-U6VC4MU4.js";
|
|
16
|
+
import "./chunk-G3SUCT4W.js";
|
|
17
|
+
import "./chunk-4VNS5WPM.js";
|
|
18
|
+
|
|
19
|
+
// packages/ai/memory/storeShared.ts
|
|
20
|
+
var createMemoryItem = (input) => {
|
|
21
|
+
const now = (/* @__PURE__ */ new Date()).toISOString();
|
|
22
|
+
return {
|
|
23
|
+
id: ulid(),
|
|
24
|
+
createdAt: now,
|
|
25
|
+
lastActivatedAt: now,
|
|
26
|
+
activationCount: 0,
|
|
27
|
+
...input
|
|
28
|
+
};
|
|
29
|
+
};
|
|
30
|
+
var writeMemoryItemWithIndexesToDb = async (db, item) => {
|
|
31
|
+
const batch = db.batch();
|
|
32
|
+
batch.put(createMemoryKey(item.ownerType, item.ownerId, item.id), item);
|
|
33
|
+
batch.put(
|
|
34
|
+
createMemoryOwnerIndexKey(
|
|
35
|
+
item.ownerType,
|
|
36
|
+
item.ownerId,
|
|
37
|
+
item.createdAt,
|
|
38
|
+
item.id
|
|
39
|
+
),
|
|
40
|
+
{
|
|
41
|
+
memoryKey: createMemoryKey(item.ownerType, item.ownerId, item.id),
|
|
42
|
+
ownerType: item.ownerType,
|
|
43
|
+
ownerId: item.ownerId,
|
|
44
|
+
memoryId: item.id
|
|
45
|
+
}
|
|
46
|
+
);
|
|
47
|
+
batch.put(
|
|
48
|
+
createMemorySubjectKindIndexKey(
|
|
49
|
+
item.subjectType,
|
|
50
|
+
item.subjectId,
|
|
51
|
+
item.kind,
|
|
52
|
+
item.createdAt,
|
|
53
|
+
item.id
|
|
54
|
+
),
|
|
55
|
+
{
|
|
56
|
+
memoryKey: createMemoryKey(item.ownerType, item.ownerId, item.id),
|
|
57
|
+
subjectType: item.subjectType,
|
|
58
|
+
subjectId: item.subjectId,
|
|
59
|
+
kind: item.kind,
|
|
60
|
+
memoryId: item.id
|
|
61
|
+
}
|
|
62
|
+
);
|
|
63
|
+
await batch.write();
|
|
64
|
+
};
|
|
65
|
+
|
|
66
|
+
// packages/ai/memory/scope.ts
|
|
67
|
+
var buildUserMemoryTarget = (userId) => ({
|
|
68
|
+
ownerType: "user",
|
|
69
|
+
ownerId: userId,
|
|
70
|
+
visibility: "private",
|
|
71
|
+
subjectType: "user",
|
|
72
|
+
subjectId: userId
|
|
73
|
+
});
|
|
74
|
+
var buildSpaceMemoryTarget = (spaceId) => ({
|
|
75
|
+
ownerType: "space",
|
|
76
|
+
ownerId: spaceId,
|
|
77
|
+
visibility: "shared",
|
|
78
|
+
subjectType: "space",
|
|
79
|
+
subjectId: spaceId
|
|
80
|
+
});
|
|
81
|
+
var resolveUserOrSpaceMemoryTarget = (input) => {
|
|
82
|
+
if (input.userId) return buildUserMemoryTarget(input.userId);
|
|
83
|
+
if (input.spaceId) return buildSpaceMemoryTarget(input.spaceId);
|
|
84
|
+
return null;
|
|
85
|
+
};
|
|
86
|
+
var buildAgentSubjectTarget = (target, agentKey) => ({
|
|
87
|
+
owner: { ownerType: target.ownerType, ownerId: target.ownerId },
|
|
88
|
+
visibility: target.visibility,
|
|
89
|
+
subjectType: "agent",
|
|
90
|
+
subjectId: agentKey
|
|
91
|
+
});
|
|
92
|
+
|
|
93
|
+
// packages/ai/memory/understanding.ts
|
|
94
|
+
var UNDERSTANDING_TAG = "understanding-memory";
|
|
95
|
+
var normalizeClause = (value) => (
|
|
96
|
+
// Compact first so trailing whitespace after sentence punct still strips
|
|
97
|
+
// (matches pre-seam: compact → strip end punct → trim residual spaces).
|
|
98
|
+
compactWhitespace(value.replace(/[“”"]/g, "")).replace(/[。!?!?;;]+$/u, "").trim()
|
|
99
|
+
);
|
|
100
|
+
var normalizeSignalLead = (value) => normalizeClause(value.split(/[\n,,。!?!?;;]+/u)[0] ?? "");
|
|
101
|
+
var stripLead = (value) => value.replace(/^(明白|好的|对|是的|所以|其实|我记得|欢迎回来|嗯|那)\s*[,,::\-]?\s*/u, "").trim();
|
|
102
|
+
var contentToText = (content) => {
|
|
103
|
+
if (typeof content === "string") return content.trim();
|
|
104
|
+
if (!Array.isArray(content)) return "";
|
|
105
|
+
return content.map((part) => part?.type === "text" ? part.text.trim() : "").filter(Boolean).join("\n").trim();
|
|
106
|
+
};
|
|
107
|
+
var extractPreference = (text) => {
|
|
108
|
+
const matches = [];
|
|
109
|
+
const normalized = stripLead(text);
|
|
110
|
+
const moreValue = normalized.match(/[你我](?:更)?在意(.+)/u);
|
|
111
|
+
if (moreValue?.[1]) {
|
|
112
|
+
matches.push(`\u66F4\u5728\u610F${normalizeSignalLead(moreValue[1])}`);
|
|
113
|
+
}
|
|
114
|
+
const concern = normalized.match(/[你我](?:更)?关心(.+)/u);
|
|
115
|
+
if (concern?.[1]) {
|
|
116
|
+
matches.push(`\u66F4\u5173\u5FC3${normalizeSignalLead(concern[1])}`);
|
|
117
|
+
}
|
|
118
|
+
const fear = normalized.match(/[你我](?:更)?怕(.+)/u);
|
|
119
|
+
if (fear?.[1]) {
|
|
120
|
+
matches.push(`\u66F4\u6015${normalizeSignalLead(fear[1])}`);
|
|
121
|
+
}
|
|
122
|
+
const dontWant = normalized.match(/[你我]不想(.+)/u);
|
|
123
|
+
if (dontWant?.[1]) {
|
|
124
|
+
matches.push(`\u4E0D\u60F3${normalizeSignalLead(dontWant[1])}`);
|
|
125
|
+
}
|
|
126
|
+
const dontHope = normalized.match(/[你我]不希望(.+)/u);
|
|
127
|
+
if (dontHope?.[1]) {
|
|
128
|
+
matches.push(`\u4E0D\u5E0C\u671B${normalizeSignalLead(dontHope[1])}`);
|
|
129
|
+
}
|
|
130
|
+
return matches;
|
|
131
|
+
};
|
|
132
|
+
var extractStyle = (text) => {
|
|
133
|
+
const matches = [];
|
|
134
|
+
const normalized = stripLead(text);
|
|
135
|
+
const dislike = normalized.match(/[你我]不喜欢(.+)/u);
|
|
136
|
+
if (dislike?.[1]) {
|
|
137
|
+
matches.push(`\u4E0D\u559C\u6B22${normalizeSignalLead(dislike[1])}`);
|
|
138
|
+
}
|
|
139
|
+
const prefer = normalized.match(/[你我](?:更)?喜欢(.+)/u);
|
|
140
|
+
if (prefer?.[1]) {
|
|
141
|
+
matches.push(`\u66F4\u559C\u6B22${normalizeSignalLead(prefer[1])}`);
|
|
142
|
+
}
|
|
143
|
+
return matches;
|
|
144
|
+
};
|
|
145
|
+
var extractGoal = (text) => {
|
|
146
|
+
const matches = [];
|
|
147
|
+
const normalized = stripLead(text);
|
|
148
|
+
if (/[??]/u.test(normalized)) {
|
|
149
|
+
return matches;
|
|
150
|
+
}
|
|
151
|
+
const wantFirst = normalized.match(/[你我](?:这次)?(?:更)?想先(?:把)?(.+)/u);
|
|
152
|
+
if (wantFirst?.[1]) {
|
|
153
|
+
matches.push(`\u60F3\u5148${normalizeSignalLead(wantFirst[1])}`);
|
|
154
|
+
}
|
|
155
|
+
const shouldFirst = normalized.match(/[你我](?:还是)?想要先(?:把)?(.+)/u);
|
|
156
|
+
if (shouldFirst?.[1]) {
|
|
157
|
+
matches.push(`\u60F3\u5148${normalizeSignalLead(shouldFirst[1])}`);
|
|
158
|
+
}
|
|
159
|
+
return matches;
|
|
160
|
+
};
|
|
161
|
+
var normalizeTensionTail = (tail) => normalizeClause(
|
|
162
|
+
tail.replace(/^在/u, "").replace(/^权衡/u, "").replace(/^比较/u, "").split(/[。!?!?;;\n]/u)[0] ?? ""
|
|
163
|
+
);
|
|
164
|
+
var extractTension = (text) => {
|
|
165
|
+
const matches = [];
|
|
166
|
+
const normalized = stripLead(text);
|
|
167
|
+
const weigh = normalized.match(/[你我]在权衡(.+)/u);
|
|
168
|
+
if (weigh?.[1]) {
|
|
169
|
+
matches.push(`\u5728\u6743\u8861${normalizeTensionTail(weigh[1])}`);
|
|
170
|
+
}
|
|
171
|
+
const struggle = normalized.match(/[你我](?:现在)?(?:真正)?纠结(?:的是)?[::,,\s]*(.+)/u);
|
|
172
|
+
if (struggle?.[1] && struggle[1].includes("\u8FD8\u662F")) {
|
|
173
|
+
matches.push(`\u5728\u6743\u8861${normalizeTensionTail(struggle[1])}`);
|
|
174
|
+
}
|
|
175
|
+
const stuck = normalized.match(/[你我]卡的点不是.+?而是(.+)/u);
|
|
176
|
+
if (stuck?.[1]) {
|
|
177
|
+
matches.push(`\u5728\u6743\u8861${normalizeTensionTail(stuck[1])}`);
|
|
178
|
+
}
|
|
179
|
+
return matches;
|
|
180
|
+
};
|
|
181
|
+
var extractUnfinished = (text) => {
|
|
182
|
+
const matches = [];
|
|
183
|
+
const normalized = stripLead(text);
|
|
184
|
+
const direct = normalized.match(/[你我](?:还)?(?:没|尚未)决定(.+)/u);
|
|
185
|
+
if (direct?.[1]) {
|
|
186
|
+
matches.push(`\u8FD8\u6CA1\u51B3\u5B9A${normalizeClause(direct[1])}`);
|
|
187
|
+
}
|
|
188
|
+
const uncertain = normalized.match(/[你我](?:还)?不确定(.+)/u);
|
|
189
|
+
if (uncertain?.[1]) {
|
|
190
|
+
matches.push(`\u8FD8\u4E0D\u786E\u5B9A${normalizeClause(uncertain[1])}`);
|
|
191
|
+
}
|
|
192
|
+
const notReady = normalized.match(/[你我](?:还)?没想好(.+)/u);
|
|
193
|
+
if (notReady?.[1]) {
|
|
194
|
+
matches.push(`\u8FD8\u6CA1\u60F3\u597D${normalizeClause(notReady[1])}`);
|
|
195
|
+
}
|
|
196
|
+
return matches;
|
|
197
|
+
};
|
|
198
|
+
var buildPatternKey = (facet, content) => `understanding:${facet}:${content.toLowerCase()}`;
|
|
199
|
+
var buildCandidate = (facet, content) => {
|
|
200
|
+
const normalized = normalizeClause(content);
|
|
201
|
+
if (!normalized || normalized.length < 6) return null;
|
|
202
|
+
const importance = facet === "unfinished" ? 0.91 : facet === "tension" ? 0.89 : facet === "preference" ? 0.84 : facet === "style" ? 0.8 : 0.82;
|
|
203
|
+
const confidence = facet === "unfinished" || facet === "tension" ? 0.76 : 0.72;
|
|
204
|
+
return {
|
|
205
|
+
facet,
|
|
206
|
+
content: normalized,
|
|
207
|
+
importance,
|
|
208
|
+
confidence,
|
|
209
|
+
patternKey: buildPatternKey(facet, normalized),
|
|
210
|
+
tags: [UNDERSTANDING_TAG, `memory-facet:${facet}`]
|
|
211
|
+
};
|
|
212
|
+
};
|
|
213
|
+
var extractUnderstandingMemoryCandidates = (input) => {
|
|
214
|
+
const texts = [
|
|
215
|
+
input.userInput,
|
|
216
|
+
...(input.trace ?? []).filter((message) => message.role === "assistant" || message.role === "user").map((message) => contentToText(message.content))
|
|
217
|
+
].map((value) => value.trim()).filter(Boolean);
|
|
218
|
+
const candidates = [];
|
|
219
|
+
for (const text of texts) {
|
|
220
|
+
for (const content of extractPreference(text)) {
|
|
221
|
+
const candidate = buildCandidate("preference", content);
|
|
222
|
+
if (candidate) candidates.push(candidate);
|
|
223
|
+
}
|
|
224
|
+
for (const content of extractStyle(text)) {
|
|
225
|
+
const candidate = buildCandidate("style", content);
|
|
226
|
+
if (candidate) candidates.push(candidate);
|
|
227
|
+
}
|
|
228
|
+
for (const content of extractGoal(text)) {
|
|
229
|
+
const candidate = buildCandidate("goal", content);
|
|
230
|
+
if (candidate) candidates.push(candidate);
|
|
231
|
+
}
|
|
232
|
+
for (const content of extractTension(text)) {
|
|
233
|
+
const candidate = buildCandidate("tension", content);
|
|
234
|
+
if (candidate) candidates.push(candidate);
|
|
235
|
+
}
|
|
236
|
+
for (const content of extractUnfinished(text)) {
|
|
237
|
+
const candidate = buildCandidate("unfinished", content);
|
|
238
|
+
if (candidate) candidates.push(candidate);
|
|
239
|
+
}
|
|
240
|
+
}
|
|
241
|
+
const seen = /* @__PURE__ */ new Set();
|
|
242
|
+
return candidates.filter((candidate) => {
|
|
243
|
+
const key = `${candidate.facet}:${candidate.content.toLowerCase()}`;
|
|
244
|
+
if (seen.has(key)) return false;
|
|
245
|
+
seen.add(key);
|
|
246
|
+
return true;
|
|
247
|
+
});
|
|
248
|
+
};
|
|
249
|
+
var buildUnderstandingTarget = (input) => {
|
|
250
|
+
const target = resolveUserOrSpaceMemoryTarget(input);
|
|
251
|
+
return target ? buildAgentSubjectTarget(target, input.agentKey) : null;
|
|
252
|
+
};
|
|
253
|
+
var sameUnderstanding = (item, candidate, agentKey) => item.subjectType === "agent" && item.subjectId === agentKey && item.patternKey === candidate.patternKey;
|
|
254
|
+
var captureUnderstandingMemoryFromDialog = async (input) => {
|
|
255
|
+
const target = buildUnderstandingTarget(input);
|
|
256
|
+
if (!target) return;
|
|
257
|
+
const candidates = extractUnderstandingMemoryCandidates({
|
|
258
|
+
userInput: input.userInput,
|
|
259
|
+
trace: input.trace
|
|
260
|
+
});
|
|
261
|
+
if (candidates.length === 0) return;
|
|
262
|
+
const existing = await loadMemoryCandidatesFromDb(input.db, {
|
|
263
|
+
owners: [target.owner],
|
|
264
|
+
subjects: [{ subjectType: target.subjectType, subjectId: target.subjectId }],
|
|
265
|
+
kinds: ["episodic", "semantic"],
|
|
266
|
+
ownerLimit: 100
|
|
267
|
+
});
|
|
268
|
+
for (const candidate of candidates) {
|
|
269
|
+
const sameItems = existing.filter((item) => sameUnderstanding(item, candidate, input.agentKey));
|
|
270
|
+
const existingSemantic = sameItems.find((item) => item.kind === "semantic");
|
|
271
|
+
if (existingSemantic) continue;
|
|
272
|
+
const existingEpisode = sameItems.find((item) => item.kind === "episodic");
|
|
273
|
+
if (existingEpisode && existingEpisode.sourceDialogId && existingEpisode.sourceDialogId !== input.dialogId) {
|
|
274
|
+
const semantic = createMemoryItem({
|
|
275
|
+
ownerType: target.owner.ownerType,
|
|
276
|
+
ownerId: target.owner.ownerId,
|
|
277
|
+
visibility: target.visibility,
|
|
278
|
+
subjectType: target.subjectType,
|
|
279
|
+
subjectId: target.subjectId,
|
|
280
|
+
kind: "semantic",
|
|
281
|
+
content: candidate.content,
|
|
282
|
+
facet: candidate.facet,
|
|
283
|
+
importance: Math.min(0.95, candidate.importance + 0.03),
|
|
284
|
+
confidence: Math.min(0.86, candidate.confidence + 0.06),
|
|
285
|
+
tags: [...candidate.tags, "consolidated-understanding"],
|
|
286
|
+
patternKey: candidate.patternKey,
|
|
287
|
+
sourceDialogId: input.dialogId
|
|
288
|
+
});
|
|
289
|
+
await writeMemoryItemWithIndexesToDb(input.db, semantic);
|
|
290
|
+
existing.push(semantic);
|
|
291
|
+
continue;
|
|
292
|
+
}
|
|
293
|
+
if (existingEpisode && existingEpisode.sourceDialogId === input.dialogId) {
|
|
294
|
+
continue;
|
|
295
|
+
}
|
|
296
|
+
const episodic = createMemoryItem({
|
|
297
|
+
ownerType: target.owner.ownerType,
|
|
298
|
+
ownerId: target.owner.ownerId,
|
|
299
|
+
visibility: target.visibility,
|
|
300
|
+
subjectType: target.subjectType,
|
|
301
|
+
subjectId: target.subjectId,
|
|
302
|
+
kind: "episodic",
|
|
303
|
+
content: candidate.content,
|
|
304
|
+
facet: candidate.facet,
|
|
305
|
+
importance: candidate.importance,
|
|
306
|
+
confidence: candidate.confidence,
|
|
307
|
+
tags: candidate.tags,
|
|
308
|
+
patternKey: candidate.patternKey,
|
|
309
|
+
sourceDialogId: input.dialogId
|
|
310
|
+
});
|
|
311
|
+
await writeMemoryItemWithIndexesToDb(input.db, episodic);
|
|
312
|
+
existing.push(episodic);
|
|
313
|
+
}
|
|
314
|
+
};
|
|
315
|
+
export {
|
|
316
|
+
captureUnderstandingMemoryFromDialog,
|
|
317
|
+
extractUnderstandingMemoryCandidates
|
|
318
|
+
};
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import {
|
|
2
|
+
buildCliDoctorText,
|
|
3
|
+
buildCliVersionText,
|
|
4
|
+
buildNpmSelfUpdateCommand,
|
|
5
|
+
buildSelfUpdateCommand,
|
|
6
|
+
getCliInstallChannel,
|
|
7
|
+
readPackageInfo,
|
|
8
|
+
renderProgressBar,
|
|
9
|
+
resolveSelfUpdateServerUrl,
|
|
10
|
+
runSelfUpdate
|
|
11
|
+
} from "./chunk-CKOJQDKR.js";
|
|
12
|
+
import "./chunk-ROWQEJRP.js";
|
|
13
|
+
import "./chunk-IDZTNRP2.js";
|
|
14
|
+
import "./chunk-ISNCLGUZ.js";
|
|
15
|
+
import "./chunk-OLZBQWZU.js";
|
|
16
|
+
import "./chunk-4SN6J65J.js";
|
|
17
|
+
import "./chunk-LCBAMY2M.js";
|
|
18
|
+
import "./chunk-CF7PE763.js";
|
|
19
|
+
import "./chunk-G3SUCT4W.js";
|
|
20
|
+
import "./chunk-4VNS5WPM.js";
|
|
21
|
+
export {
|
|
22
|
+
buildCliDoctorText,
|
|
23
|
+
buildCliVersionText,
|
|
24
|
+
buildNpmSelfUpdateCommand,
|
|
25
|
+
buildSelfUpdateCommand,
|
|
26
|
+
getCliInstallChannel,
|
|
27
|
+
readPackageInfo,
|
|
28
|
+
renderProgressBar,
|
|
29
|
+
resolveSelfUpdateServerUrl,
|
|
30
|
+
runSelfUpdate
|
|
31
|
+
};
|
|
@@ -0,0 +1,185 @@
|
|
|
1
|
+
import {
|
|
2
|
+
buildDialogFallbackTitleFromMessages,
|
|
3
|
+
resolveDialogTitle
|
|
4
|
+
} from "./chunk-OWOHNGCN.js";
|
|
5
|
+
import {
|
|
6
|
+
BUILTIN_TITLE_LLM_CONFIG,
|
|
7
|
+
isAssistantToolStub,
|
|
8
|
+
selectAllMsgs,
|
|
9
|
+
serializeMessageContent,
|
|
10
|
+
updateContentTitle
|
|
11
|
+
} from "./chunk-KTI2WDDG.js";
|
|
12
|
+
import "./chunk-MRC4Q34M.js";
|
|
13
|
+
import "./chunk-OVGXXUVI.js";
|
|
14
|
+
import "./chunk-CWMSB67P.js";
|
|
15
|
+
import {
|
|
16
|
+
runLlm
|
|
17
|
+
} from "./chunk-543C7RDK.js";
|
|
18
|
+
import "./chunk-IYQV26RA.js";
|
|
19
|
+
import "./chunk-Z4NR32XR.js";
|
|
20
|
+
import {
|
|
21
|
+
require_date_fns
|
|
22
|
+
} from "./chunk-M76ECQRD.js";
|
|
23
|
+
import "./chunk-AUGHVUFE.js";
|
|
24
|
+
import "./chunk-H2RMRZJE.js";
|
|
25
|
+
import {
|
|
26
|
+
normalizeSpaceId
|
|
27
|
+
} from "./chunk-UAD2WT54.js";
|
|
28
|
+
import "./chunk-USZMK5UT.js";
|
|
29
|
+
import "./chunk-5MMAK75Q.js";
|
|
30
|
+
import "./chunk-572EKYLF.js";
|
|
31
|
+
import "./chunk-TDIQFT2F.js";
|
|
32
|
+
import "./chunk-JZPBVBIY.js";
|
|
33
|
+
import "./chunk-BR2WP3DF.js";
|
|
34
|
+
import {
|
|
35
|
+
extractCustomId
|
|
36
|
+
} from "./chunk-DFFIZ25G.js";
|
|
37
|
+
import "./chunk-3ASDTTEI.js";
|
|
38
|
+
import "./chunk-DWLEOOGR.js";
|
|
39
|
+
import "./chunk-HNMXYYJR.js";
|
|
40
|
+
import "./chunk-VEJLAVTC.js";
|
|
41
|
+
import "./chunk-Y5GCAMGP.js";
|
|
42
|
+
import {
|
|
43
|
+
patch,
|
|
44
|
+
selectById
|
|
45
|
+
} from "./chunk-G5H7RNFL.js";
|
|
46
|
+
import "./chunk-AZPCASRE.js";
|
|
47
|
+
import "./chunk-2EISRLRC.js";
|
|
48
|
+
import "./chunk-KX6YBIHG.js";
|
|
49
|
+
import "./chunk-PN7AFLOK.js";
|
|
50
|
+
import "./chunk-WWC7I6TA.js";
|
|
51
|
+
import "./chunk-QSJ3HFEF.js";
|
|
52
|
+
import "./chunk-ELRRLDWI.js";
|
|
53
|
+
import {
|
|
54
|
+
selectIdentityUserId
|
|
55
|
+
} from "./chunk-EYEEHCU4.js";
|
|
56
|
+
import "./chunk-QYXLLLGL.js";
|
|
57
|
+
import "./chunk-GBRG75BQ.js";
|
|
58
|
+
import "./chunk-4SN6J65J.js";
|
|
59
|
+
import "./chunk-LCBAMY2M.js";
|
|
60
|
+
import {
|
|
61
|
+
asTrimmedString
|
|
62
|
+
} from "./chunk-3EUW3WEO.js";
|
|
63
|
+
import "./chunk-U6VC4MU4.js";
|
|
64
|
+
import "./chunk-CF7PE763.js";
|
|
65
|
+
import "./chunk-G3SUCT4W.js";
|
|
66
|
+
import "./chunk-KUG52IAP.js";
|
|
67
|
+
import {
|
|
68
|
+
__toESM
|
|
69
|
+
} from "./chunk-4VNS5WPM.js";
|
|
70
|
+
|
|
71
|
+
// packages/chat/dialog/actions/updateDialogTitleAction.ts
|
|
72
|
+
var import_date_fns2 = __toESM(require_date_fns());
|
|
73
|
+
|
|
74
|
+
// packages/chat/dialog/actions/updateDialogTitlePolicy.ts
|
|
75
|
+
var import_date_fns = __toESM(require_date_fns());
|
|
76
|
+
var TITLE_UPDATE_INTERVAL_MINUTES = 30;
|
|
77
|
+
var FORCE_UPDATE_FOR_TEST = false;
|
|
78
|
+
var shouldUpdateTitle = (createdAt, lastUpdatedAt, now = /* @__PURE__ */ new Date()) => {
|
|
79
|
+
if (FORCE_UPDATE_FOR_TEST) return true;
|
|
80
|
+
const lastUpdate = lastUpdatedAt ? new Date(lastUpdatedAt) : null;
|
|
81
|
+
const creation = createdAt ? new Date(createdAt) : null;
|
|
82
|
+
if (!lastUpdate || !creation || Number.isNaN(lastUpdate.getTime()) || Number.isNaN(creation.getTime())) {
|
|
83
|
+
return true;
|
|
84
|
+
}
|
|
85
|
+
return (0, import_date_fns.differenceInMinutes)(now, creation) <= TITLE_UPDATE_INTERVAL_MINUTES || (0, import_date_fns.differenceInMinutes)(now, lastUpdate) >= TITLE_UPDATE_INTERVAL_MINUTES;
|
|
86
|
+
};
|
|
87
|
+
|
|
88
|
+
// packages/chat/dialog/actions/updateDialogTitleAction.ts
|
|
89
|
+
var MAX_MESSAGES_FOR_CONTEXT = 20;
|
|
90
|
+
var dedupeById = (messages) => {
|
|
91
|
+
const seen = /* @__PURE__ */ new Set();
|
|
92
|
+
return messages.filter((message) => {
|
|
93
|
+
const id = typeof message.id === "string" ? message.id : "";
|
|
94
|
+
if (!id || seen.has(id)) return false;
|
|
95
|
+
seen.add(id);
|
|
96
|
+
return true;
|
|
97
|
+
});
|
|
98
|
+
};
|
|
99
|
+
var getMessageContextForTitle = (state, dialogKey, selectAllMessages = selectAllMsgs) => {
|
|
100
|
+
const allMsgs = selectAllMessages(state, extractCustomId(dialogKey));
|
|
101
|
+
const flattened = Array.isArray(allMsgs) ? typeof allMsgs.flat === "function" ? allMsgs.flat() : allMsgs.reduce(
|
|
102
|
+
(acc, cur) => acc.concat(cur),
|
|
103
|
+
[]
|
|
104
|
+
) : [];
|
|
105
|
+
const normalized = flattened.filter((msg) => msg?.role !== "tool" && !isAssistantToolStub(msg)).map((msg) => {
|
|
106
|
+
const textContent = serializeMessageContent(msg?.content, "\u8FD9\u91CC\u662F\u4E00\u4E2A\u56FE\u7247");
|
|
107
|
+
if (!textContent) return null;
|
|
108
|
+
return {
|
|
109
|
+
...msg,
|
|
110
|
+
content: textContent
|
|
111
|
+
// 之后只会用到 role + content
|
|
112
|
+
};
|
|
113
|
+
}).filter(Boolean);
|
|
114
|
+
const earlyUserTurns = normalized.filter((msg) => msg.role === "user").slice(0, 3);
|
|
115
|
+
const recentTurns = normalized.slice(-12);
|
|
116
|
+
return dedupeById([...earlyUserTurns, ...recentTurns]).slice(
|
|
117
|
+
0,
|
|
118
|
+
MAX_MESSAGES_FOR_CONTEXT
|
|
119
|
+
);
|
|
120
|
+
};
|
|
121
|
+
var shouldSkipPlatformTitleLlm = (args) => {
|
|
122
|
+
const current = asTrimmedString(args.currentUserId);
|
|
123
|
+
const loggedOut = !current || current === "local";
|
|
124
|
+
if (!loggedOut) return false;
|
|
125
|
+
const dialogUserId = asTrimmedString(args.dialogConfig?.userId);
|
|
126
|
+
const agentUserId = asTrimmedString(args.agentConfig?.userId);
|
|
127
|
+
const hasLocalCredentialRef = typeof args.agentConfig?.credentialRef === "string" && args.agentConfig.credentialRef.trim().length > 0;
|
|
128
|
+
const dialogKey = typeof args.dialogKey === "string" ? args.dialogKey : "";
|
|
129
|
+
return dialogUserId === "local" || agentUserId === "local" || hasLocalCredentialRef || dialogKey.startsWith("dialog-local-");
|
|
130
|
+
};
|
|
131
|
+
var updateDialogTitleActionWithDeps = async (args, thunkApi, deps = {}) => {
|
|
132
|
+
const {
|
|
133
|
+
runLlmAction = runLlm,
|
|
134
|
+
patchAction = patch,
|
|
135
|
+
selectDialogById = selectById,
|
|
136
|
+
selectAllMessages = selectAllMsgs,
|
|
137
|
+
updateSpaceContentTitle = updateContentTitle,
|
|
138
|
+
selectCurrentUserId = selectIdentityUserId
|
|
139
|
+
} = deps;
|
|
140
|
+
const { dialogKey, agentConfig } = args;
|
|
141
|
+
const { dispatch, getState } = thunkApi;
|
|
142
|
+
const state = getState();
|
|
143
|
+
const dialogConfig = selectDialogById(state, dialogKey);
|
|
144
|
+
if (!dialogConfig || !shouldUpdateTitle(dialogConfig.createdAt, dialogConfig.updatedAt)) {
|
|
145
|
+
return dialogConfig;
|
|
146
|
+
}
|
|
147
|
+
const messageContext = getMessageContextForTitle(state, dialogKey, selectAllMessages);
|
|
148
|
+
if (messageContext.length === 0) {
|
|
149
|
+
return dialogConfig;
|
|
150
|
+
}
|
|
151
|
+
const fallbackTitle = buildDialogFallbackTitleFromMessages(messageContext) || `Conversation on ${(0, import_date_fns2.format)(/* @__PURE__ */ new Date(), "MMM d")}`;
|
|
152
|
+
let generatedTitle = "";
|
|
153
|
+
const currentUserId = selectCurrentUserId(state);
|
|
154
|
+
if (!shouldSkipPlatformTitleLlm({
|
|
155
|
+
currentUserId,
|
|
156
|
+
dialogKey,
|
|
157
|
+
dialogConfig,
|
|
158
|
+
agentConfig
|
|
159
|
+
})) {
|
|
160
|
+
const content = JSON.stringify(
|
|
161
|
+
messageContext.map((msg) => ({ role: msg.role, content: msg.content }))
|
|
162
|
+
);
|
|
163
|
+
generatedTitle = await dispatch(
|
|
164
|
+
runLlmAction({
|
|
165
|
+
llmConfig: BUILTIN_TITLE_LLM_CONFIG,
|
|
166
|
+
content,
|
|
167
|
+
billingDialogKey: dialogKey
|
|
168
|
+
})
|
|
169
|
+
).unwrap();
|
|
170
|
+
}
|
|
171
|
+
const title = resolveDialogTitle(generatedTitle, fallbackTitle);
|
|
172
|
+
const spaceId = dialogConfig?.spaceId && normalizeSpaceId(dialogConfig.spaceId);
|
|
173
|
+
if (spaceId) {
|
|
174
|
+
dispatch(updateSpaceContentTitle({ spaceId, contentKey: dialogKey, title }));
|
|
175
|
+
}
|
|
176
|
+
return await dispatch(
|
|
177
|
+
patchAction({ dbKey: dialogKey, changes: { title } })
|
|
178
|
+
).unwrap();
|
|
179
|
+
};
|
|
180
|
+
var updateDialogTitleAction = async (args, thunkApi) => updateDialogTitleActionWithDeps(args, thunkApi);
|
|
181
|
+
export {
|
|
182
|
+
shouldSkipPlatformTitleLlm,
|
|
183
|
+
updateDialogTitleAction,
|
|
184
|
+
updateDialogTitleActionWithDeps
|
|
185
|
+
};
|