nolo-cli 0.224.0-alpha.1 → 0.224.0-alpha.2
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-WW57SJN4.js → _executeModel-4WBUORCW.js} +13 -12
- package/{agentDeleteCommand-X2VWEKUA.js → agentDeleteCommand-BB6KU5AO.js} +10 -9
- package/{agentEmailCommands-6IE773VW.js → agentEmailCommands-KMHPL6OH.js} +11 -10
- package/{agentMachineCommands-EVWFKK6Q.js → agentMachineCommands-OC5D4YZW.js} +1 -1
- package/{agentRecordCommands-DX2WE6BH.js → agentRecordCommands-S2IVVEES.js} +11 -10
- package/{agentRunCommand-KGOT2AFB.js → agentRunCommand-M22Y3D5U.js} +12 -10
- package/{agentSlice-ACZGTZVW.js → agentSlice-AJPMMBOP.js} +1 -1
- package/{authCommand-4FDPL7WG.js → authCommand-VQP625QS.js} +6 -2
- package/{authCommands-GAJ3NIXO.js → authCommands-PAKU3CJZ.js} +5 -1
- package/{chunk-3N4ASIP6.js → chunk-53X6PS42.js} +2 -2
- package/{chunk-DVQH4BTR.js → chunk-6E2NWYT4.js} +5 -1
- package/chunk-BJF2MHJ3.js +118 -0
- package/{chunk-T3O6BLYU.js → chunk-BKJSRO66.js} +8 -8
- package/{chunk-MKQ2UTTX.js → chunk-EK7PGVPY.js} +6 -6
- package/{chunk-KAVGK4ES.js → chunk-EVYGYDPG.js} +2 -2
- package/{chunk-7UH3DGV6.js → chunk-H5LWB3D3.js} +6 -117
- package/{chunk-3ESU44FG.js → chunk-HJAGA3GR.js} +2 -2
- package/{chunk-65XXHYZ5.js → chunk-KPAFQHRT.js} +2 -2
- package/{chunk-N3J4VDGV.js → chunk-ME4XUFTD.js} +2 -2
- package/{chunk-XFJ4ZPFC.js → chunk-OK4MZRJ6.js} +5 -5
- package/{chunk-N7HVLYOY.js → chunk-PYIMOZSX.js} +2 -2
- package/{chunk-F3TQURKK.js → chunk-QG3USDTD.js} +1 -1
- package/{chunk-QWYFFHCJ.js → chunk-RXJ26SQW.js} +3 -3
- package/{chunk-FVZW66K4.js → chunk-S7RA7A4X.js} +8 -8
- package/chunk-SH3IKNCG.js +100 -0
- package/{chunk-VHPAA6MT.js → chunk-SJYK3LLP.js} +2 -2
- package/{chunk-KO63FPG3.js → chunk-ULK35M44.js} +4 -4
- package/{chunk-4NMHE7CX.js → chunk-WOIURUUV.js} +1 -1
- package/{chunk-S7SB7L2I.js → chunk-XUJZYUIM.js} +2 -2
- package/{chunk-O2CYENYJ.js → chunk-ZLNHUFOF.js} +19 -95
- package/{chunk-7WPAI5JJ.js → chunk-ZLOSGVCQ.js} +1 -1
- package/{commandRegistry-SDSYBKMC.js → commandRegistry-3JVE76K2.js} +25 -25
- package/{contentThunks-G3TRPEAU.js → contentThunks-SRKUHSBR.js} +3 -3
- package/{createAgentAutomationAction-KHA4MXUJ.js → createAgentAutomationAction-B4BQV46J.js} +3 -3
- package/{createDialogAction-KWSBNAPJ.js → createDialogAction-IONSKZIX.js} +5 -4
- package/{createPageAction-HXKJ7OFG.js → createPageAction-K75KBQOO.js} +4 -4
- package/{dialogSlice-HXPKFGRL.js → dialogSlice-GPALSBQM.js} +2 -2
- package/{docStore-A2B3GH33.js → docStore-O43KOHIX.js} +1 -1
- package/{handleSendMessageAction-NWYG3Q72.js → handleSendMessageAction-I2GHUSHZ.js} +8 -8
- package/{hostCredentialCreate-WS6D3EHT.js → hostCredentialCreate-V775SKCE.js} +11 -10
- package/index.js +3 -3
- package/{localRuntimeAdapter-TFYOA6YE.js → localRuntimeAdapter-SAMUDW5S.js} +10 -9
- package/{machineCommands-WFWV25IR.js → machineCommands-ZXZWGMFE.js} +11 -10
- package/{machineWsRunDispatch-ZGXC3F2R.js → machineWsRunDispatch-3ZEI4BEC.js} +11 -10
- package/package.json +1 -1
- package/{projectArchive-ULJDLUA6.js → projectArchive-V7EYBAX6.js} +4 -4
- package/{readlineWorkspace-LTCV2BFW.js → readlineWorkspace-S4VRNWYG.js} +17 -15
- package/{runAgentClientLoop-BVIEQUB3.js → runAgentClientLoop-MQLOUDF5.js} +11 -10
- package/{streamAgentChatTurn-DNYFHBJM.js → streamAgentChatTurn-GMNIKJVL.js} +13 -12
- package/{tools-JVOJ5HC4.js → tools-MWIF3S4T.js} +8 -7
- package/{updateDialogTitleAction-Q57BOSXG.js → updateDialogTitleAction-ZXHMZFSX.js} +3 -3
|
@@ -1,11 +1,15 @@
|
|
|
1
|
+
import {
|
|
2
|
+
chooseMemoryOwners,
|
|
3
|
+
loadMemoryCandidatesFromDb
|
|
4
|
+
} from "./chunk-BJF2MHJ3.js";
|
|
1
5
|
import {
|
|
2
6
|
addContentToSpace
|
|
3
|
-
} from "./chunk-
|
|
7
|
+
} from "./chunk-QG3USDTD.js";
|
|
4
8
|
import {
|
|
5
9
|
prepareAndPersistMessage,
|
|
6
10
|
uiAskChoiceFunc,
|
|
7
11
|
uiAskChoiceFunctionSchema
|
|
8
|
-
} from "./chunk-
|
|
12
|
+
} from "./chunk-S7RA7A4X.js";
|
|
9
13
|
import {
|
|
10
14
|
require_format
|
|
11
15
|
} from "./chunk-BUDVRYES.js";
|
|
@@ -28,11 +32,6 @@ import {
|
|
|
28
32
|
import {
|
|
29
33
|
extractCustomId
|
|
30
34
|
} from "./chunk-M2EJHDJP.js";
|
|
31
|
-
import {
|
|
32
|
-
createMemoryKey,
|
|
33
|
-
memoryOwnerRange,
|
|
34
|
-
memorySubjectKindRange
|
|
35
|
-
} from "./chunk-SYTHYBMI.js";
|
|
36
35
|
import {
|
|
37
36
|
createDialogKey,
|
|
38
37
|
dialogMessageRange
|
|
@@ -262,113 +261,6 @@ var mergeGreetingWithRelationshipRecap = (input) => {
|
|
|
262
261
|
\u5982\u679C\u4F60\u8FD8\u60F3\u63A5\u7740\u90A3\u4E2A\u70B9\u7EE7\u7EED\uFF0C\u6211\u4EEC\u53EF\u4EE5\u4ECE\u90A3\u91CC\u5F80\u4E0B\u8D70\uFF1B\u5982\u679C\u60F3\u6362\u4E2A\u65B9\u5411\u4E5F\u53EF\u4EE5\u3002`;
|
|
263
262
|
};
|
|
264
263
|
|
|
265
|
-
// packages/ai/memory/queryShared.ts
|
|
266
|
-
var chooseMemoryOwners = (input) => {
|
|
267
|
-
const owners = [];
|
|
268
|
-
if (input.userId) {
|
|
269
|
-
owners.push({ ownerType: "user", ownerId: input.userId });
|
|
270
|
-
}
|
|
271
|
-
if (input.spaceId) {
|
|
272
|
-
owners.push({ ownerType: "space", ownerId: input.spaceId });
|
|
273
|
-
}
|
|
274
|
-
return owners;
|
|
275
|
-
};
|
|
276
|
-
var loadOwnerItemsFromDb = async (db, owner, limit) => {
|
|
277
|
-
const range = memoryOwnerRange(owner.ownerType, owner.ownerId);
|
|
278
|
-
const refs = [];
|
|
279
|
-
for await (const [, value] of db.iterator({
|
|
280
|
-
gte: range.start,
|
|
281
|
-
lte: range.end,
|
|
282
|
-
reverse: true
|
|
283
|
-
})) {
|
|
284
|
-
refs.push(value ?? {});
|
|
285
|
-
if (refs.length >= limit) break;
|
|
286
|
-
}
|
|
287
|
-
const items = await Promise.all(
|
|
288
|
-
refs.map(
|
|
289
|
-
(ref) => typeof ref?.memoryId === "string" ? db.get(createMemoryKey(owner.ownerType, owner.ownerId, ref.memoryId)).catch(() => null) : Promise.resolve(null)
|
|
290
|
-
)
|
|
291
|
-
);
|
|
292
|
-
return items.filter((item) => !!item);
|
|
293
|
-
};
|
|
294
|
-
var loadSubjectKindItemsFromDb = async (db, subject, kind, limit) => {
|
|
295
|
-
const range = memorySubjectKindRange(subject.subjectType, subject.subjectId, kind);
|
|
296
|
-
const refs = [];
|
|
297
|
-
for await (const [, value] of db.iterator({
|
|
298
|
-
gte: range.start,
|
|
299
|
-
lte: range.end,
|
|
300
|
-
reverse: true
|
|
301
|
-
})) {
|
|
302
|
-
refs.push(value ?? {});
|
|
303
|
-
if (refs.length >= limit) break;
|
|
304
|
-
}
|
|
305
|
-
const items = await Promise.all(
|
|
306
|
-
refs.map(
|
|
307
|
-
(ref) => typeof ref?.memoryKey === "string" ? db.get(ref.memoryKey).catch(() => null) : Promise.resolve(null)
|
|
308
|
-
)
|
|
309
|
-
);
|
|
310
|
-
return items.filter((item) => !!item);
|
|
311
|
-
};
|
|
312
|
-
var loadMemoryCandidatesFromDb = async (db, input) => {
|
|
313
|
-
const kinds = input.kinds ?? ["episodic", "semantic", "procedural"];
|
|
314
|
-
const ownerLimit = input.ownerLimit ?? 12;
|
|
315
|
-
const ownerFallback = input.ownerFallback ?? "onSubjectMiss";
|
|
316
|
-
const reserve = Math.max(0, input.corroboratedProceduralReserve ?? 0);
|
|
317
|
-
const ownerKeySet = new Set(
|
|
318
|
-
input.owners.filter((owner) => owner.ownerId).map((owner) => `${owner.ownerType}:${owner.ownerId}`)
|
|
319
|
-
);
|
|
320
|
-
const subjects = input.subjects.filter(
|
|
321
|
-
(subject) => !!subject.subjectId
|
|
322
|
-
);
|
|
323
|
-
const subjectResults = subjects.length > 0 ? await Promise.all(
|
|
324
|
-
subjects.flatMap(
|
|
325
|
-
(subject) => kinds.map(
|
|
326
|
-
(kind) => loadSubjectKindItemsFromDb(db, subject, kind, ownerLimit)
|
|
327
|
-
)
|
|
328
|
-
)
|
|
329
|
-
) : [];
|
|
330
|
-
const subjectHitCount = subjectResults.reduce((sum, items) => sum + items.length, 0);
|
|
331
|
-
const shouldLoadOwnerFallback = ownerFallback !== "never" && (subjects.length === 0 || subjectHitCount === 0 || ownerFallback === "always");
|
|
332
|
-
const results = shouldLoadOwnerFallback ? await Promise.all(
|
|
333
|
-
[
|
|
334
|
-
...subjectResults,
|
|
335
|
-
...input.owners.map((owner) => loadOwnerItemsFromDb(db, owner, ownerLimit))
|
|
336
|
-
]
|
|
337
|
-
) : subjectResults;
|
|
338
|
-
if (reserve > 0 && kinds.includes("procedural")) {
|
|
339
|
-
const probeLimit = ownerLimit * 2;
|
|
340
|
-
const reserveResults = await Promise.all(
|
|
341
|
-
subjects.map(
|
|
342
|
-
(subject) => loadSubjectKindItemsFromDb(db, subject, "procedural", probeLimit)
|
|
343
|
-
)
|
|
344
|
-
);
|
|
345
|
-
const corroborated = reserveResults.flat().filter((item) => item && item.recurrenceEvidence).sort((a, b) => b.createdAt.localeCompare(a.createdAt)).slice(0, reserve);
|
|
346
|
-
for (const item of corroborated) {
|
|
347
|
-
results.push([item]);
|
|
348
|
-
}
|
|
349
|
-
}
|
|
350
|
-
const kindSet = new Set(kinds);
|
|
351
|
-
const seen = /* @__PURE__ */ new Set();
|
|
352
|
-
const merged = [];
|
|
353
|
-
for (const items of results) {
|
|
354
|
-
for (const item of items) {
|
|
355
|
-
if (seen.has(item.id)) continue;
|
|
356
|
-
if (!kindSet.has(item.kind)) continue;
|
|
357
|
-
if (ownerKeySet.size > 0 && !ownerKeySet.has(`${item.ownerType}:${item.ownerId}`)) {
|
|
358
|
-
continue;
|
|
359
|
-
}
|
|
360
|
-
if (!shouldLoadOwnerFallback && subjects.length > 0 && !subjects.some(
|
|
361
|
-
(subject) => subject.subjectType === item.subjectType && subject.subjectId === item.subjectId
|
|
362
|
-
)) {
|
|
363
|
-
continue;
|
|
364
|
-
}
|
|
365
|
-
seen.add(item.id);
|
|
366
|
-
merged.push(item);
|
|
367
|
-
}
|
|
368
|
-
}
|
|
369
|
-
return merged;
|
|
370
|
-
};
|
|
371
|
-
|
|
372
264
|
// packages/ai/memory/understandingGreeting.ts
|
|
373
265
|
var UNDERSTANDING_TAG = "understanding-memory";
|
|
374
266
|
var facetPriority = {
|
|
@@ -854,9 +746,6 @@ var createDialogAction = async (args, thunkApi) => {
|
|
|
854
746
|
export {
|
|
855
747
|
resolveAgentMemoryPolicy,
|
|
856
748
|
buildMemorySubjectsForAgent,
|
|
857
|
-
chooseMemoryOwners,
|
|
858
|
-
loadOwnerItemsFromDb,
|
|
859
|
-
loadMemoryCandidatesFromDb,
|
|
860
749
|
isLocalOwnerDialogAgents,
|
|
861
750
|
createDialogAction
|
|
862
751
|
};
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import {
|
|
2
2
|
fetchReferenceContents,
|
|
3
3
|
resolveReferenceAssets
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-EVYGYDPG.js";
|
|
5
5
|
import {
|
|
6
6
|
updateTokensAction
|
|
7
|
-
} from "./chunk-
|
|
7
|
+
} from "./chunk-S7RA7A4X.js";
|
|
8
8
|
import {
|
|
9
9
|
applyUpdateTokensFulfilled
|
|
10
10
|
} from "./chunk-S2NTVGA2.js";
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import {
|
|
2
2
|
createCliLocalRuntimeAdapter,
|
|
3
3
|
summarizeEndpoint
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-ULK35M44.js";
|
|
5
5
|
import {
|
|
6
6
|
clipMultilineText
|
|
7
|
-
} from "./chunk-
|
|
7
|
+
} from "./chunk-53X6PS42.js";
|
|
8
8
|
import {
|
|
9
9
|
runLocalAgentTurn
|
|
10
10
|
} from "./chunk-TVFRV3UQ.js";
|
|
@@ -7,7 +7,7 @@ import {
|
|
|
7
7
|
mergeReferences,
|
|
8
8
|
resolveReferenceAssets,
|
|
9
9
|
resolveToolsFromKeys
|
|
10
|
-
} from "./chunk-
|
|
10
|
+
} from "./chunk-EVYGYDPG.js";
|
|
11
11
|
import {
|
|
12
12
|
UI_CARD_ENVELOPE_MAX_BYTES,
|
|
13
13
|
getAllToolRuns,
|
|
@@ -18,21 +18,21 @@ import {
|
|
|
18
18
|
selectSpaceContextLevel,
|
|
19
19
|
selectUserTonePreset,
|
|
20
20
|
uiCardFallback
|
|
21
|
-
} from "./chunk-
|
|
21
|
+
} from "./chunk-53X6PS42.js";
|
|
22
22
|
import {
|
|
23
23
|
getDocState
|
|
24
|
-
} from "./chunk-
|
|
24
|
+
} from "./chunk-PYIMOZSX.js";
|
|
25
25
|
import {
|
|
26
26
|
resolveToolBaseUrl
|
|
27
27
|
} from "./chunk-4JVNURX4.js";
|
|
28
28
|
import {
|
|
29
29
|
getTableState
|
|
30
|
-
} from "./chunk-
|
|
30
|
+
} from "./chunk-QG3USDTD.js";
|
|
31
31
|
import {
|
|
32
32
|
PERSONALIZATION_DIALOG_CATEGORY,
|
|
33
33
|
buildPersonalizationDialogPolicyContext,
|
|
34
34
|
selectAllMsgs
|
|
35
|
-
} from "./chunk-
|
|
35
|
+
} from "./chunk-S7RA7A4X.js";
|
|
36
36
|
import {
|
|
37
37
|
getCurrentSpaceIdRaw,
|
|
38
38
|
getViewMode
|
|
@@ -335,7 +335,7 @@ async function saveDocState(arg, { dispatch, getState }) {
|
|
|
335
335
|
).unwrap();
|
|
336
336
|
if (dbSpaceId) {
|
|
337
337
|
try {
|
|
338
|
-
const { updateContentTitle } = await import("./contentThunks-
|
|
338
|
+
const { updateContentTitle } = await import("./contentThunks-SRKUHSBR.js");
|
|
339
339
|
await dispatch(
|
|
340
340
|
updateContentTitle({
|
|
341
341
|
spaceId: dbSpaceId,
|
|
@@ -378,7 +378,7 @@ async function saveDocState(arg, { dispatch, getState }) {
|
|
|
378
378
|
}
|
|
379
379
|
}
|
|
380
380
|
async function createDocState(args, thunkApi) {
|
|
381
|
-
const { createPageAction } = await import("./createPageAction-
|
|
381
|
+
const { createPageAction } = await import("./createPageAction-K75KBQOO.js");
|
|
382
382
|
return createPageAction(args, thunkApi);
|
|
383
383
|
}
|
|
384
384
|
function subscribe(listener) {
|
|
@@ -458,7 +458,7 @@ var slice = createSliceWithThunks({
|
|
|
458
458
|
const overrides = {};
|
|
459
459
|
if (args.systemPromptOverride !== void 0) overrides.prompt = args.systemPromptOverride;
|
|
460
460
|
if (args.toolsOverride !== void 0) overrides.tools = args.toolsOverride;
|
|
461
|
-
const { _executeModel } = await import("./_executeModel-
|
|
461
|
+
const { _executeModel } = await import("./_executeModel-4WBUORCW.js");
|
|
462
462
|
return _executeModel(
|
|
463
463
|
{
|
|
464
464
|
isStreaming: args.isStreaming ?? false,
|
|
@@ -479,7 +479,7 @@ var slice = createSliceWithThunks({
|
|
|
479
479
|
* - 循环直到无工具调用或触发其他运行时停止条件
|
|
480
480
|
*/
|
|
481
481
|
runAgent: create.asyncThunk(async (args, thunkApi) => {
|
|
482
|
-
const { runAgentClientLoop } = await import("./runAgentClientLoop-
|
|
482
|
+
const { runAgentClientLoop } = await import("./runAgentClientLoop-MQLOUDF5.js");
|
|
483
483
|
const { content: loopContent, toolCallCount } = await runAgentClientLoop(
|
|
484
484
|
{
|
|
485
485
|
agentKey: args.agentKey,
|
|
@@ -495,7 +495,7 @@ var slice = createSliceWithThunks({
|
|
|
495
495
|
* 聊天轮次流式 Agent 调用
|
|
496
496
|
*/
|
|
497
497
|
streamAgentChatTurn: create.asyncThunk(async (args, thunkApi) => {
|
|
498
|
-
const { streamAgentChatTurnHandler } = await import("./streamAgentChatTurn-
|
|
498
|
+
const { streamAgentChatTurnHandler } = await import("./streamAgentChatTurn-GMNIKJVL.js");
|
|
499
499
|
return streamAgentChatTurnHandler(args, thunkApi);
|
|
500
500
|
}),
|
|
501
501
|
/**
|
|
@@ -14,7 +14,7 @@ import {
|
|
|
14
14
|
} from "./chunk-523DITKR.js";
|
|
15
15
|
import {
|
|
16
16
|
runLlm
|
|
17
|
-
} from "./chunk-
|
|
17
|
+
} from "./chunk-RXJ26SQW.js";
|
|
18
18
|
import {
|
|
19
19
|
isMediaToolConfirmation
|
|
20
20
|
} from "./chunk-QYPE3TS3.js";
|
|
@@ -14426,7 +14426,7 @@ var messageSlice = createSliceWithThunks({
|
|
|
14426
14426
|
runtimeOptions: args.runtimeOptions
|
|
14427
14427
|
});
|
|
14428
14428
|
if (agentKeyToUse) {
|
|
14429
|
-
const { streamAgentChatTurn } = await import("./agentSlice-
|
|
14429
|
+
const { streamAgentChatTurn } = await import("./agentSlice-AJPMMBOP.js");
|
|
14430
14430
|
await dispatch(
|
|
14431
14431
|
streamAgentChatTurn({
|
|
14432
14432
|
agentKey: agentKeyToUse,
|
|
@@ -15559,7 +15559,7 @@ var deleteDialogThunk = async (payload, thunkApi) => {
|
|
|
15559
15559
|
}
|
|
15560
15560
|
if (isCurrentDialog) {
|
|
15561
15561
|
await thunkApi.dispatch(resetMsgs());
|
|
15562
|
-
const { clearPendingAttachments: clearPendingAttachments2 } = await import("./dialogSlice-
|
|
15562
|
+
const { clearPendingAttachments: clearPendingAttachments2 } = await import("./dialogSlice-GPALSBQM.js");
|
|
15563
15563
|
dispatch(clearPendingAttachments2());
|
|
15564
15564
|
}
|
|
15565
15565
|
return { dialogKey, isCurrentDialog, attachmentPlan };
|
|
@@ -15567,15 +15567,15 @@ var deleteDialogThunk = async (payload, thunkApi) => {
|
|
|
15567
15567
|
|
|
15568
15568
|
// packages/chat/dialog/dialogSlice.ts
|
|
15569
15569
|
var runCreateDialogAction = async (args, thunkApi) => {
|
|
15570
|
-
const { createDialogAction } = await import("./createDialogAction-
|
|
15570
|
+
const { createDialogAction } = await import("./createDialogAction-IONSKZIX.js");
|
|
15571
15571
|
return createDialogAction(args, thunkApi);
|
|
15572
15572
|
};
|
|
15573
15573
|
var runCreateAgentAutomationAction = async (args, thunkApi) => {
|
|
15574
|
-
const { createAgentAutomationAction } = await import("./createAgentAutomationAction-
|
|
15574
|
+
const { createAgentAutomationAction } = await import("./createAgentAutomationAction-B4BQV46J.js");
|
|
15575
15575
|
return createAgentAutomationAction(args, thunkApi);
|
|
15576
15576
|
};
|
|
15577
15577
|
var runUpdateDialogTitleAction = async (args, thunkApi) => {
|
|
15578
|
-
const { updateDialogTitleAction } = await import("./updateDialogTitleAction-
|
|
15578
|
+
const { updateDialogTitleAction } = await import("./updateDialogTitleAction-ZXHMZFSX.js");
|
|
15579
15579
|
return updateDialogTitleAction(args, thunkApi);
|
|
15580
15580
|
};
|
|
15581
15581
|
var runAddDialogAgentAction = async (args, thunkApi) => {
|
|
@@ -15599,7 +15599,7 @@ var runSetDialogExtraReferencesAction = async (args, thunkApi) => {
|
|
|
15599
15599
|
return setDialogExtraReferencesAction(args, thunkApi);
|
|
15600
15600
|
};
|
|
15601
15601
|
var runHandleSendMessageAction = async (args, thunkApi) => {
|
|
15602
|
-
const { handleSendMessageAction } = await import("./handleSendMessageAction-
|
|
15602
|
+
const { handleSendMessageAction } = await import("./handleSendMessageAction-I2GHUSHZ.js");
|
|
15603
15603
|
return handleSendMessageAction(args, thunkApi);
|
|
15604
15604
|
};
|
|
15605
15605
|
function clearDialogState() {
|
|
@@ -15612,7 +15612,7 @@ var createPageAndAddReference = createAsyncThunk(
|
|
|
15612
15612
|
async (payload, { dispatch, getState, rejectWithValue }) => {
|
|
15613
15613
|
const { slateData, jsonData, title, type, fileId, groupId, dialogKey } = payload;
|
|
15614
15614
|
try {
|
|
15615
|
-
const { createDocState } = await import("./docStore-
|
|
15615
|
+
const { createDocState } = await import("./docStore-O43KOHIX.js");
|
|
15616
15616
|
const pageKey = await createDocState(
|
|
15617
15617
|
{ slateData, title },
|
|
15618
15618
|
{ dispatch, getState }
|
|
@@ -0,0 +1,100 @@
|
|
|
1
|
+
import {
|
|
2
|
+
loadMemoryVNextCatalog
|
|
3
|
+
} from "./chunk-XI2BWJM5.js";
|
|
4
|
+
import {
|
|
5
|
+
recallMemoryVNextLocal
|
|
6
|
+
} from "./chunk-YL3EFYL3.js";
|
|
7
|
+
import {
|
|
8
|
+
DEFAULT_MEMORY_OVERLAY_TOKEN_BUDGET,
|
|
9
|
+
buildMemoryOverlay
|
|
10
|
+
} from "./chunk-EUCFKKDM.js";
|
|
11
|
+
import {
|
|
12
|
+
createMemoryKey
|
|
13
|
+
} from "./chunk-SYTHYBMI.js";
|
|
14
|
+
|
|
15
|
+
// packages/ai/memory/storeShared.ts
|
|
16
|
+
var retrievalCountOf = (item) => item.activationCount ?? 0;
|
|
17
|
+
var touchMemoryItemsInDb = async (db, items, now = (/* @__PURE__ */ new Date()).toISOString()) => {
|
|
18
|
+
if (items.length === 0) return;
|
|
19
|
+
const batch = db.batch();
|
|
20
|
+
for (const item of items) {
|
|
21
|
+
batch.put(createMemoryKey(item.ownerType, item.ownerId, item.id), {
|
|
22
|
+
...item,
|
|
23
|
+
// retrieval bookkeeping on legacy storage names — see doc comment above
|
|
24
|
+
lastActivatedAt: now,
|
|
25
|
+
activationCount: retrievalCountOf(item) + 1
|
|
26
|
+
});
|
|
27
|
+
}
|
|
28
|
+
await batch.write();
|
|
29
|
+
};
|
|
30
|
+
|
|
31
|
+
// packages/ai/memory/remember.ts
|
|
32
|
+
var RESIDENT_MAX_CONTENT_CHARS = 240;
|
|
33
|
+
|
|
34
|
+
// packages/ai/memory/vnext/pureVNextRuntime.ts
|
|
35
|
+
function deriveStateResident(state, ownerType) {
|
|
36
|
+
if (ownerType !== "user") return false;
|
|
37
|
+
if (state.text.trim().length > RESIDENT_MAX_CONTENT_CHARS) return false;
|
|
38
|
+
return state.facet === "preference" || state.facet === "style";
|
|
39
|
+
}
|
|
40
|
+
var buildSynthesizedStateItem = (state, entity, ownerType, ownerId) => ({
|
|
41
|
+
id: `vnext-state-${state.id}`,
|
|
42
|
+
ownerType,
|
|
43
|
+
ownerId,
|
|
44
|
+
visibility: "private",
|
|
45
|
+
subjectType: "user",
|
|
46
|
+
subjectId: ownerId,
|
|
47
|
+
kind: "semantic",
|
|
48
|
+
content: state.text.trim(),
|
|
49
|
+
createdAt: state.createdAt,
|
|
50
|
+
lastActivatedAt: state.createdAt,
|
|
51
|
+
activationCount: 1,
|
|
52
|
+
importance: 0.9,
|
|
53
|
+
confidence: 0.9,
|
|
54
|
+
resident: deriveStateResident(state, ownerType)
|
|
55
|
+
});
|
|
56
|
+
async function resolvePureVNextRuntime(input) {
|
|
57
|
+
const { db, owners, userInput } = input;
|
|
58
|
+
if (owners.length === 0 || !userInput.trim()) {
|
|
59
|
+
return { selectedItems: [], promptBlock: null, recalledStateCount: 0 };
|
|
60
|
+
}
|
|
61
|
+
const ownerIds = owners.map((o) => `${o.ownerType}:${encodeURIComponent(o.ownerId)}`);
|
|
62
|
+
const catalogs = await Promise.all(
|
|
63
|
+
ownerIds.map((ownerId) => loadMemoryVNextCatalog(db, ownerId))
|
|
64
|
+
);
|
|
65
|
+
const selectedItems = [];
|
|
66
|
+
const seenStateKeys = /* @__PURE__ */ new Set();
|
|
67
|
+
for (let i = 0; i < owners.length; i++) {
|
|
68
|
+
const owner = owners[i];
|
|
69
|
+
const catalog = catalogs[i];
|
|
70
|
+
const currentStates = catalog.states.filter((s) => !s.retiredAt && s.text.trim());
|
|
71
|
+
const hits = recallMemoryVNextLocal({
|
|
72
|
+
query: userInput,
|
|
73
|
+
entities: catalog.entities,
|
|
74
|
+
states: currentStates
|
|
75
|
+
});
|
|
76
|
+
const entityById = new Map(catalog.entities.map((e) => [e.id, e]));
|
|
77
|
+
for (const hit of hits) {
|
|
78
|
+
const stateKey = `${hit.state.ownerId}\0${hit.state.id}`;
|
|
79
|
+
if (seenStateKeys.has(stateKey)) continue;
|
|
80
|
+
seenStateKeys.add(stateKey);
|
|
81
|
+
selectedItems.push(
|
|
82
|
+
buildSynthesizedStateItem(hit.state, entityById.get(hit.state.entityId), owner.ownerType, owner.ownerId)
|
|
83
|
+
);
|
|
84
|
+
}
|
|
85
|
+
}
|
|
86
|
+
const promptBlock = selectedItems.length === 0 ? null : buildMemoryOverlay(selectedItems, {
|
|
87
|
+
maxTokens: input.maxTokens ?? DEFAULT_MEMORY_OVERLAY_TOKEN_BUDGET
|
|
88
|
+
});
|
|
89
|
+
return {
|
|
90
|
+
selectedItems,
|
|
91
|
+
promptBlock,
|
|
92
|
+
recalledStateCount: selectedItems.length
|
|
93
|
+
};
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
export {
|
|
97
|
+
touchMemoryItemsInDb,
|
|
98
|
+
deriveStateResident,
|
|
99
|
+
resolvePureVNextRuntime
|
|
100
|
+
};
|
|
@@ -14,10 +14,10 @@ import {
|
|
|
14
14
|
import {
|
|
15
15
|
addContentToSpace,
|
|
16
16
|
resolveCreationSpaceId
|
|
17
|
-
} from "./chunk-
|
|
17
|
+
} from "./chunk-QG3USDTD.js";
|
|
18
18
|
import {
|
|
19
19
|
runtime_default
|
|
20
|
-
} from "./chunk-
|
|
20
|
+
} from "./chunk-S7RA7A4X.js";
|
|
21
21
|
import {
|
|
22
22
|
getCurrentSpaceId
|
|
23
23
|
} from "./chunk-MOMR7NMG.js";
|
|
@@ -83,7 +83,7 @@ import {
|
|
|
83
83
|
import {
|
|
84
84
|
inlineImageUrlsForCustomProvider,
|
|
85
85
|
prepareTools
|
|
86
|
-
} from "./chunk-
|
|
86
|
+
} from "./chunk-HJAGA3GR.js";
|
|
87
87
|
import {
|
|
88
88
|
getServerProviderSecret
|
|
89
89
|
} from "./chunk-HS7MLR74.js";
|
|
@@ -106,7 +106,7 @@ import {
|
|
|
106
106
|
resolveCliLocalSpawnDispatch,
|
|
107
107
|
resolveRunContextFacts,
|
|
108
108
|
resolveStartAgentRunCwd
|
|
109
|
-
} from "./chunk-
|
|
109
|
+
} from "./chunk-BKJSRO66.js";
|
|
110
110
|
import {
|
|
111
111
|
fetchWithTransientRetry,
|
|
112
112
|
isTransientFetchError
|
|
@@ -123,7 +123,7 @@ import {
|
|
|
123
123
|
prepareTokenUsageData,
|
|
124
124
|
runKeyed,
|
|
125
125
|
validateAskChoiceInput
|
|
126
|
-
} from "./chunk-
|
|
126
|
+
} from "./chunk-S7RA7A4X.js";
|
|
127
127
|
import {
|
|
128
128
|
applyTokenUsageToDayStats,
|
|
129
129
|
require_format
|
|
@@ -134,7 +134,7 @@ import {
|
|
|
134
134
|
} from "./chunk-523DITKR.js";
|
|
135
135
|
import {
|
|
136
136
|
fetchServerSyncedCredential
|
|
137
|
-
} from "./chunk-
|
|
137
|
+
} from "./chunk-RXJ26SQW.js";
|
|
138
138
|
import {
|
|
139
139
|
getDefaultCliLocalRuntimeDb
|
|
140
140
|
} from "./chunk-N5Z2V73W.js";
|
|
@@ -3,10 +3,10 @@ import {
|
|
|
3
3
|
} from "./chunk-HS7MLR74.js";
|
|
4
4
|
import {
|
|
5
5
|
performServerProxyFetchWithRetry
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-EVYGYDPG.js";
|
|
7
7
|
import {
|
|
8
8
|
fetchServerSyncedCredential
|
|
9
|
-
} from "./chunk-
|
|
9
|
+
} from "./chunk-RXJ26SQW.js";
|
|
10
10
|
import {
|
|
11
11
|
CREDENTIAL_HYGIENE_RULE,
|
|
12
12
|
DELETE_SAFETY_RED_LINE,
|