@lobehub/lobehub 2.0.0-next.336 → 2.0.0-next.338
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/CHANGELOG.md +51 -0
- package/changelog/v1.json +18 -0
- package/locales/en-US/setting.json +19 -0
- package/locales/zh-CN/auth.json +1 -0
- package/locales/zh-CN/setting.json +19 -0
- package/package.json +1 -1
- package/packages/builtin-tool-agent-builder/src/manifest.ts +0 -2
- package/packages/builtin-tool-memory/src/client/Render/AddPreferenceMemory/index.tsx +17 -0
- package/packages/builtin-tool-memory/src/client/Render/index.ts +2 -0
- package/packages/builtin-tool-memory/src/client/Streaming/AddPreferenceMemory/index.tsx +17 -0
- package/packages/builtin-tool-memory/src/client/Streaming/index.ts +4 -3
- package/packages/builtin-tool-memory/src/client/components/PreferenceMemoryCard.tsx +357 -0
- package/packages/builtin-tool-memory/src/client/components/index.ts +1 -0
- package/packages/builtin-tool-memory/src/executor/index.ts +3 -3
- package/packages/builtin-tool-memory/src/systemRole.ts +1 -0
- package/packages/database/src/models/userMemory/model.ts +1 -1
- package/packages/memory-user-memory/src/extractors/context.test.ts +0 -1
- package/packages/memory-user-memory/src/extractors/experience.test.ts +0 -1
- package/packages/memory-user-memory/src/extractors/identity.test.ts +0 -1
- package/packages/memory-user-memory/src/extractors/preference.test.ts +0 -1
- package/packages/memory-user-memory/src/schemas/context.ts +0 -2
- package/packages/memory-user-memory/src/schemas/experience.ts +0 -2
- package/packages/memory-user-memory/src/schemas/identity.ts +1 -2
- package/packages/memory-user-memory/src/schemas/preference.ts +0 -2
- package/packages/model-runtime/src/providers/google/index.ts +14 -14
- package/packages/model-runtime/src/providers/moonshot/index.ts +1 -1
- package/packages/model-runtime/src/providers/openai/index.ts +3 -3
- package/packages/types/src/discover/index.ts +1 -1
- package/src/app/[variants]/(main)/agent/cron/[cronId]/CronConfig.ts +16 -16
- package/src/app/[variants]/(main)/agent/cron/[cronId]/features/CronJobSaveButton.tsx +1 -1
- package/src/app/[variants]/(main)/agent/cron/[cronId]/features/CronJobScheduleConfig.tsx +5 -2
- package/src/app/[variants]/(main)/community/features/Search.tsx +1 -1
- package/src/app/[variants]/(mobile)/router/mobileRouter.config.tsx +27 -0
- package/src/app/[variants]/(mobile)/settings/_layout/Header.tsx +8 -17
- package/src/app/[variants]/(mobile)/settings/_layout/index.tsx +6 -1
- package/src/app/[variants]/(mobile)/settings/provider/_layout/index.tsx +22 -0
- package/src/locales/default/setting.ts +19 -0
- package/src/server/routers/lambda/userMemories/tools.ts +5 -4
- package/src/server/routers/lambda/userMemories.ts +4 -4
- package/src/server/services/memory/userMemory/extract.ts +3 -3
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,57 @@
|
|
|
2
2
|
|
|
3
3
|
# Changelog
|
|
4
4
|
|
|
5
|
+
## [Version 2.0.0-next.338](https://github.com/lobehub/lobe-chat/compare/v2.0.0-next.337...v2.0.0-next.338)
|
|
6
|
+
|
|
7
|
+
<sup>Released on **2026-01-22**</sup>
|
|
8
|
+
|
|
9
|
+
#### 🐛 Bug Fixes
|
|
10
|
+
|
|
11
|
+
- **misc**: Updata cron job ui & fixed commnuity pagenation goto error.
|
|
12
|
+
|
|
13
|
+
<br/>
|
|
14
|
+
|
|
15
|
+
<details>
|
|
16
|
+
<summary><kbd>Improvements and Fixes</kbd></summary>
|
|
17
|
+
|
|
18
|
+
#### What's fixed
|
|
19
|
+
|
|
20
|
+
- **misc**: Updata cron job ui & fixed commnuity pagenation goto error, closes [#11700](https://github.com/lobehub/lobe-chat/issues/11700) ([42ad2a0](https://github.com/lobehub/lobe-chat/commit/42ad2a0))
|
|
21
|
+
|
|
22
|
+
</details>
|
|
23
|
+
|
|
24
|
+
<div align="right">
|
|
25
|
+
|
|
26
|
+
[](#readme-top)
|
|
27
|
+
|
|
28
|
+
</div>
|
|
29
|
+
|
|
30
|
+
## [Version 2.0.0-next.337](https://github.com/lobehub/lobe-chat/compare/v2.0.0-next.336...v2.0.0-next.337)
|
|
31
|
+
|
|
32
|
+
<sup>Released on **2026-01-22**</sup>
|
|
33
|
+
|
|
34
|
+
#### 🐛 Bug Fixes
|
|
35
|
+
|
|
36
|
+
- **misc**: Fix memory schema, update the agentbuilder tools not always use humanIntervention.
|
|
37
|
+
|
|
38
|
+
<br/>
|
|
39
|
+
|
|
40
|
+
<details>
|
|
41
|
+
<summary><kbd>Improvements and Fixes</kbd></summary>
|
|
42
|
+
|
|
43
|
+
#### What's fixed
|
|
44
|
+
|
|
45
|
+
- **misc**: Fix memory schema, closes [#11645](https://github.com/lobehub/lobe-chat/issues/11645) ([3baf780](https://github.com/lobehub/lobe-chat/commit/3baf780))
|
|
46
|
+
- **misc**: Update the agentbuilder tools not always use humanIntervention, closes [#11696](https://github.com/lobehub/lobe-chat/issues/11696) ([0d3017b](https://github.com/lobehub/lobe-chat/commit/0d3017b))
|
|
47
|
+
|
|
48
|
+
</details>
|
|
49
|
+
|
|
50
|
+
<div align="right">
|
|
51
|
+
|
|
52
|
+
[](#readme-top)
|
|
53
|
+
|
|
54
|
+
</div>
|
|
55
|
+
|
|
5
56
|
## [Version 2.0.0-next.336](https://github.com/lobehub/lobe-chat/compare/v2.0.0-next.335...v2.0.0-next.336)
|
|
6
57
|
|
|
7
58
|
<sup>Released on **2026-01-22**</sup>
|
package/changelog/v1.json
CHANGED
|
@@ -1,4 +1,22 @@
|
|
|
1
1
|
[
|
|
2
|
+
{
|
|
3
|
+
"children": {
|
|
4
|
+
"fixes": [
|
|
5
|
+
"Updata cron job ui & fixed commnuity pagenation goto error."
|
|
6
|
+
]
|
|
7
|
+
},
|
|
8
|
+
"date": "2026-01-22",
|
|
9
|
+
"version": "2.0.0-next.338"
|
|
10
|
+
},
|
|
11
|
+
{
|
|
12
|
+
"children": {
|
|
13
|
+
"fixes": [
|
|
14
|
+
"Fix memory schema, update the agentbuilder tools not always use humanIntervention."
|
|
15
|
+
]
|
|
16
|
+
},
|
|
17
|
+
"date": "2026-01-22",
|
|
18
|
+
"version": "2.0.0-next.337"
|
|
19
|
+
},
|
|
2
20
|
{
|
|
3
21
|
"children": {
|
|
4
22
|
"features": [
|
|
@@ -36,7 +36,11 @@
|
|
|
36
36
|
"agentCronJobs.noExecutionResults": "No execution results",
|
|
37
37
|
"agentCronJobs.remainingExecutions": "Remaining: {{count}}",
|
|
38
38
|
"agentCronJobs.save": "Save",
|
|
39
|
+
"agentCronJobs.saveAsNew": "Save as New",
|
|
39
40
|
"agentCronJobs.schedule": "Schedule",
|
|
41
|
+
"agentCronJobs.scheduleType.daily": "Daily",
|
|
42
|
+
"agentCronJobs.scheduleType.hourly": "Hourly",
|
|
43
|
+
"agentCronJobs.scheduleType.weekly": "Weekly",
|
|
40
44
|
"agentCronJobs.status.depleted": "Depleted",
|
|
41
45
|
"agentCronJobs.status.disabled": "Disabled",
|
|
42
46
|
"agentCronJobs.status.enabled": "Enabled",
|
|
@@ -45,6 +49,20 @@
|
|
|
45
49
|
"agentCronJobs.unlimited": "Unlimited",
|
|
46
50
|
"agentCronJobs.unnamedTask": "Unnamed Task",
|
|
47
51
|
"agentCronJobs.updateSuccess": "Scheduled task updated successfully",
|
|
52
|
+
"agentCronJobs.weekday.friday": "Friday",
|
|
53
|
+
"agentCronJobs.weekday.monday": "Monday",
|
|
54
|
+
"agentCronJobs.weekday.saturday": "Saturday",
|
|
55
|
+
"agentCronJobs.weekday.short.friday": "Fri",
|
|
56
|
+
"agentCronJobs.weekday.short.monday": "Mon",
|
|
57
|
+
"agentCronJobs.weekday.short.saturday": "Sat",
|
|
58
|
+
"agentCronJobs.weekday.short.sunday": "Sun",
|
|
59
|
+
"agentCronJobs.weekday.short.thursday": "Thu",
|
|
60
|
+
"agentCronJobs.weekday.short.tuesday": "Tue",
|
|
61
|
+
"agentCronJobs.weekday.short.wednesday": "Wed",
|
|
62
|
+
"agentCronJobs.weekday.sunday": "Sunday",
|
|
63
|
+
"agentCronJobs.weekday.thursday": "Thursday",
|
|
64
|
+
"agentCronJobs.weekday.tuesday": "Tuesday",
|
|
65
|
+
"agentCronJobs.weekday.wednesday": "Wednesday",
|
|
48
66
|
"agentCronJobs.weekdays": "Weekdays",
|
|
49
67
|
"agentInfoDescription.basic.avatar": "Avatar",
|
|
50
68
|
"agentInfoDescription.basic.description": "Description",
|
|
@@ -544,6 +562,7 @@
|
|
|
544
562
|
"systemAgent.translation.title": "Message Translation Agent",
|
|
545
563
|
"tab.about": "About",
|
|
546
564
|
"tab.agent": "Agent Service",
|
|
565
|
+
"tab.all": "All",
|
|
547
566
|
"tab.apikey": "API Key Management",
|
|
548
567
|
"tab.chatAppearance": "Chat Appearance",
|
|
549
568
|
"tab.common": "Appearance",
|
package/locales/zh-CN/auth.json
CHANGED
|
@@ -36,7 +36,11 @@
|
|
|
36
36
|
"agentCronJobs.noExecutionResults": "无执行结果",
|
|
37
37
|
"agentCronJobs.remainingExecutions": "剩余:{{count}}",
|
|
38
38
|
"agentCronJobs.save": "保存",
|
|
39
|
+
"agentCronJobs.saveAsNew": "另存为新任务",
|
|
39
40
|
"agentCronJobs.schedule": "计划",
|
|
41
|
+
"agentCronJobs.scheduleType.daily": "每日",
|
|
42
|
+
"agentCronJobs.scheduleType.hourly": "每小时",
|
|
43
|
+
"agentCronJobs.scheduleType.weekly": "每周",
|
|
40
44
|
"agentCronJobs.status.depleted": "已耗尽",
|
|
41
45
|
"agentCronJobs.status.disabled": "已禁用",
|
|
42
46
|
"agentCronJobs.status.enabled": "已启用",
|
|
@@ -45,6 +49,20 @@
|
|
|
45
49
|
"agentCronJobs.unlimited": "无限",
|
|
46
50
|
"agentCronJobs.unnamedTask": "未命名任务",
|
|
47
51
|
"agentCronJobs.updateSuccess": "定时任务更新成功",
|
|
52
|
+
"agentCronJobs.weekday.friday": "星期五",
|
|
53
|
+
"agentCronJobs.weekday.monday": "星期一",
|
|
54
|
+
"agentCronJobs.weekday.saturday": "星期六",
|
|
55
|
+
"agentCronJobs.weekday.short.friday": "周五",
|
|
56
|
+
"agentCronJobs.weekday.short.monday": "周一",
|
|
57
|
+
"agentCronJobs.weekday.short.saturday": "周六",
|
|
58
|
+
"agentCronJobs.weekday.short.sunday": "周日",
|
|
59
|
+
"agentCronJobs.weekday.short.thursday": "周四",
|
|
60
|
+
"agentCronJobs.weekday.short.tuesday": "周二",
|
|
61
|
+
"agentCronJobs.weekday.short.wednesday": "周三",
|
|
62
|
+
"agentCronJobs.weekday.sunday": "星期日",
|
|
63
|
+
"agentCronJobs.weekday.thursday": "星期四",
|
|
64
|
+
"agentCronJobs.weekday.tuesday": "星期二",
|
|
65
|
+
"agentCronJobs.weekday.wednesday": "星期三",
|
|
48
66
|
"agentCronJobs.weekdays": "工作日",
|
|
49
67
|
"agentInfoDescription.basic.avatar": "头像",
|
|
50
68
|
"agentInfoDescription.basic.description": "描述",
|
|
@@ -544,6 +562,7 @@
|
|
|
544
562
|
"systemAgent.translation.title": "消息内容翻译助理",
|
|
545
563
|
"tab.about": "关于",
|
|
546
564
|
"tab.agent": "助理服务",
|
|
565
|
+
"tab.all": "全部",
|
|
547
566
|
"tab.apikey": "API Key 管理",
|
|
548
567
|
"tab.chatAppearance": "聊天外观",
|
|
549
568
|
"tab.common": "外观",
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@lobehub/lobehub",
|
|
3
|
-
"version": "2.0.0-next.
|
|
3
|
+
"version": "2.0.0-next.338",
|
|
4
4
|
"description": "LobeHub - an open-source,comprehensive AI Agent framework that supports speech synthesis, multimodal, and extensible Function Call plugin system. Supports one-click free deployment of your private ChatGPT/LLM web application.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"framework",
|
|
@@ -27,7 +27,6 @@ export const AgentBuilderManifest: BuiltinToolManifest = {
|
|
|
27
27
|
{
|
|
28
28
|
description:
|
|
29
29
|
'Search for tools (MCP plugins) in the marketplace. Users can browse and install tools directly from the search results. Use this when users want to find new tools or capabilities.',
|
|
30
|
-
humanIntervention: 'always',
|
|
31
30
|
name: AgentBuilderApiName.searchMarketTools,
|
|
32
31
|
parameters: {
|
|
33
32
|
properties: {
|
|
@@ -57,7 +56,6 @@ export const AgentBuilderManifest: BuiltinToolManifest = {
|
|
|
57
56
|
{
|
|
58
57
|
description:
|
|
59
58
|
'Install a plugin for the agent. This tool ALWAYS REQUIRES user approval before installation, even in auto-run mode. For MCP marketplace plugins, it will install and enable the plugin. For Klavis tools and LobehubSkill providers that need OAuth, it will initiate the connection flow and wait for user to complete authorization.',
|
|
60
|
-
humanIntervention: 'always',
|
|
61
59
|
name: AgentBuilderApiName.installPlugin,
|
|
62
60
|
parameters: {
|
|
63
61
|
properties: {
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
|
|
3
|
+
import type { BuiltinRenderProps } from '@lobechat/types';
|
|
4
|
+
import { memo } from 'react';
|
|
5
|
+
|
|
6
|
+
import type { AddPreferenceMemoryParams, AddPreferenceMemoryState } from '../../../types';
|
|
7
|
+
import { PreferenceMemoryCard } from '../../components';
|
|
8
|
+
|
|
9
|
+
const AddPreferenceMemoryRender = memo<
|
|
10
|
+
BuiltinRenderProps<AddPreferenceMemoryParams, AddPreferenceMemoryState>
|
|
11
|
+
>(({ args }) => {
|
|
12
|
+
return <PreferenceMemoryCard data={args} />;
|
|
13
|
+
});
|
|
14
|
+
|
|
15
|
+
AddPreferenceMemoryRender.displayName = 'AddPreferenceMemoryRender';
|
|
16
|
+
|
|
17
|
+
export default AddPreferenceMemoryRender;
|
|
@@ -2,6 +2,7 @@ import type { BuiltinRender } from '@lobechat/types';
|
|
|
2
2
|
|
|
3
3
|
import { MemoryApiName } from '../../types';
|
|
4
4
|
import AddExperienceMemoryRender from './AddExperienceMemory';
|
|
5
|
+
import AddPreferenceMemoryRender from './AddPreferenceMemory';
|
|
5
6
|
import SearchUserMemoryRender from './SearchUserMemory';
|
|
6
7
|
|
|
7
8
|
/**
|
|
@@ -11,5 +12,6 @@ import SearchUserMemoryRender from './SearchUserMemory';
|
|
|
11
12
|
*/
|
|
12
13
|
export const MemoryRenders: Record<string, BuiltinRender> = {
|
|
13
14
|
[MemoryApiName.addExperienceMemory]: AddExperienceMemoryRender as BuiltinRender,
|
|
15
|
+
[MemoryApiName.addPreferenceMemory]: AddPreferenceMemoryRender as BuiltinRender,
|
|
14
16
|
[MemoryApiName.searchUserMemory]: SearchUserMemoryRender as BuiltinRender,
|
|
15
17
|
};
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
|
|
3
|
+
import type { BuiltinStreamingProps } from '@lobechat/types';
|
|
4
|
+
import { memo } from 'react';
|
|
5
|
+
|
|
6
|
+
import type { AddPreferenceMemoryParams } from '../../../types';
|
|
7
|
+
import { PreferenceMemoryCard } from '../../components';
|
|
8
|
+
|
|
9
|
+
export const AddPreferenceMemoryStreaming = memo<BuiltinStreamingProps<AddPreferenceMemoryParams>>(
|
|
10
|
+
({ args }) => {
|
|
11
|
+
return <PreferenceMemoryCard data={args} loading />;
|
|
12
|
+
},
|
|
13
|
+
);
|
|
14
|
+
|
|
15
|
+
AddPreferenceMemoryStreaming.displayName = 'AddPreferenceMemoryStreaming';
|
|
16
|
+
|
|
17
|
+
export default AddPreferenceMemoryStreaming;
|
|
@@ -2,6 +2,7 @@ import { type BuiltinStreaming } from '@lobechat/types';
|
|
|
2
2
|
|
|
3
3
|
import { MemoryApiName } from '../../types';
|
|
4
4
|
import { AddExperienceMemoryStreaming } from './AddExperienceMemory';
|
|
5
|
+
import { AddPreferenceMemoryStreaming } from './AddPreferenceMemory';
|
|
5
6
|
|
|
6
7
|
/**
|
|
7
8
|
* Memory Streaming Components Registry
|
|
@@ -11,8 +12,8 @@ import { AddExperienceMemoryStreaming } from './AddExperienceMemory';
|
|
|
11
12
|
*/
|
|
12
13
|
export const MemoryStreamings: Record<string, BuiltinStreaming> = {
|
|
13
14
|
[MemoryApiName.addExperienceMemory]: AddExperienceMemoryStreaming as BuiltinStreaming,
|
|
15
|
+
[MemoryApiName.addPreferenceMemory]: AddPreferenceMemoryStreaming as BuiltinStreaming,
|
|
14
16
|
};
|
|
15
17
|
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
export {AddExperienceMemoryStreaming} from './AddExperienceMemory';
|
|
18
|
+
export { AddExperienceMemoryStreaming } from './AddExperienceMemory';
|
|
19
|
+
export { AddPreferenceMemoryStreaming } from './AddPreferenceMemory';
|
|
@@ -0,0 +1,357 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
|
|
3
|
+
import { Accordion, AccordionItem, Avatar, Flexbox, Tag, Text } from '@lobehub/ui';
|
|
4
|
+
import { Steps } from 'antd';
|
|
5
|
+
import { createStaticStyles, cssVar } from 'antd-style';
|
|
6
|
+
import { memo } from 'react';
|
|
7
|
+
|
|
8
|
+
import BubblesLoading from '@/components/BubblesLoading';
|
|
9
|
+
import NeuralNetworkLoading from '@/components/NeuralNetworkLoading';
|
|
10
|
+
import StreamingMarkdown from '@/components/StreamingMarkdown';
|
|
11
|
+
import { highlightTextStyles } from '@/styles';
|
|
12
|
+
|
|
13
|
+
import type { AddPreferenceMemoryParams } from '../../types';
|
|
14
|
+
|
|
15
|
+
const styles = createStaticStyles(({ css, cssVar }) => ({
|
|
16
|
+
container: css`
|
|
17
|
+
overflow: hidden;
|
|
18
|
+
|
|
19
|
+
width: 100%;
|
|
20
|
+
border: 1px solid ${cssVar.colorBorderSecondary};
|
|
21
|
+
border-radius: 16px;
|
|
22
|
+
|
|
23
|
+
background: ${cssVar.colorBgContainer};
|
|
24
|
+
`,
|
|
25
|
+
content: css`
|
|
26
|
+
padding-block: 12px;
|
|
27
|
+
padding-inline: 16px;
|
|
28
|
+
`,
|
|
29
|
+
detail: css`
|
|
30
|
+
font-size: 13px;
|
|
31
|
+
line-height: 1.6;
|
|
32
|
+
color: ${cssVar.colorTextSecondary};
|
|
33
|
+
`,
|
|
34
|
+
directive: css`
|
|
35
|
+
font-size: 14px;
|
|
36
|
+
line-height: 1.6;
|
|
37
|
+
color: ${cssVar.colorText};
|
|
38
|
+
`,
|
|
39
|
+
header: css`
|
|
40
|
+
padding-block: 10px;
|
|
41
|
+
padding-inline: 12px;
|
|
42
|
+
border-block-end: 1px solid ${cssVar.colorBorderSecondary};
|
|
43
|
+
`,
|
|
44
|
+
section: css`
|
|
45
|
+
padding: 4px;
|
|
46
|
+
border-block-start: 1px solid ${cssVar.colorBorderSecondary};
|
|
47
|
+
`,
|
|
48
|
+
stepContent: css`
|
|
49
|
+
font-size: 13px;
|
|
50
|
+
line-height: 1.6;
|
|
51
|
+
color: ${cssVar.colorTextSecondary};
|
|
52
|
+
white-space: pre-wrap;
|
|
53
|
+
`,
|
|
54
|
+
stepsContainer: css`
|
|
55
|
+
.ant-steps-item-content {
|
|
56
|
+
min-height: auto;
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
.ant-steps-item-description {
|
|
60
|
+
padding-block-end: 12px !important;
|
|
61
|
+
}
|
|
62
|
+
`,
|
|
63
|
+
suggestion: css`
|
|
64
|
+
padding-block: 8px;
|
|
65
|
+
padding-inline: 12px;
|
|
66
|
+
border-radius: 8px;
|
|
67
|
+
|
|
68
|
+
font-size: 13px;
|
|
69
|
+
line-height: 1.5;
|
|
70
|
+
color: ${cssVar.colorTextSecondary};
|
|
71
|
+
|
|
72
|
+
background: ${cssVar.colorFillQuaternary};
|
|
73
|
+
`,
|
|
74
|
+
summary: css`
|
|
75
|
+
font-size: 14px;
|
|
76
|
+
font-weight: 500;
|
|
77
|
+
color: ${cssVar.colorTextSecondary};
|
|
78
|
+
`,
|
|
79
|
+
tags: css`
|
|
80
|
+
padding-block-start: 8px;
|
|
81
|
+
border-block-start: 1px dashed ${cssVar.colorBorderSecondary};
|
|
82
|
+
`,
|
|
83
|
+
title: css`
|
|
84
|
+
overflow: hidden;
|
|
85
|
+
display: -webkit-box;
|
|
86
|
+
-webkit-box-orient: vertical;
|
|
87
|
+
-webkit-line-clamp: 1;
|
|
88
|
+
|
|
89
|
+
font-weight: 500;
|
|
90
|
+
color: ${cssVar.colorText};
|
|
91
|
+
`,
|
|
92
|
+
}));
|
|
93
|
+
|
|
94
|
+
export interface PreferenceMemoryCardProps {
|
|
95
|
+
data?: AddPreferenceMemoryParams;
|
|
96
|
+
loading?: boolean;
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
export const PreferenceMemoryCard = memo<PreferenceMemoryCardProps>(({ data, loading }) => {
|
|
100
|
+
const { summary, details, tags, title, withPreference } = data || {};
|
|
101
|
+
const { conclusionDirectives, originContext, appContext, suggestions, type } =
|
|
102
|
+
withPreference || {};
|
|
103
|
+
|
|
104
|
+
const hasContextContent =
|
|
105
|
+
originContext?.actor ||
|
|
106
|
+
originContext?.scenario ||
|
|
107
|
+
originContext?.trigger ||
|
|
108
|
+
originContext?.applicableWhen ||
|
|
109
|
+
originContext?.notApplicableWhen;
|
|
110
|
+
|
|
111
|
+
const hasAppContext = appContext?.app || appContext?.feature || appContext?.surface;
|
|
112
|
+
|
|
113
|
+
const hasSuggestions = suggestions && suggestions.length > 0;
|
|
114
|
+
|
|
115
|
+
if (
|
|
116
|
+
!summary &&
|
|
117
|
+
!details &&
|
|
118
|
+
!tags?.length &&
|
|
119
|
+
!title &&
|
|
120
|
+
!conclusionDirectives &&
|
|
121
|
+
!hasContextContent &&
|
|
122
|
+
!hasSuggestions
|
|
123
|
+
)
|
|
124
|
+
return null;
|
|
125
|
+
|
|
126
|
+
const contextItems = [
|
|
127
|
+
{ avatar: '👤', content: originContext?.actor, title: 'Actor' },
|
|
128
|
+
{ avatar: '🎯', content: originContext?.scenario, title: 'Scenario' },
|
|
129
|
+
{ avatar: '⚡', content: originContext?.trigger, title: 'Trigger' },
|
|
130
|
+
{ avatar: '✅', content: originContext?.applicableWhen, title: 'Applicable When' },
|
|
131
|
+
{ avatar: '❌', content: originContext?.notApplicableWhen, title: 'Not Applicable When' },
|
|
132
|
+
].filter((item) => item.content);
|
|
133
|
+
|
|
134
|
+
const appContextItems = [
|
|
135
|
+
{ avatar: '📱', content: appContext?.app, title: 'App' },
|
|
136
|
+
{ avatar: '🔧', content: appContext?.feature, title: 'Feature' },
|
|
137
|
+
{ avatar: '📍', content: appContext?.surface, title: 'Surface' },
|
|
138
|
+
].filter((item) => item.content);
|
|
139
|
+
|
|
140
|
+
return (
|
|
141
|
+
<Flexbox className={styles.container}>
|
|
142
|
+
{/* Header */}
|
|
143
|
+
<Flexbox align={'center'} className={styles.header} gap={8} horizontal>
|
|
144
|
+
<Flexbox flex={1}>
|
|
145
|
+
<div className={styles.title}>{title || 'Preference Memory'}</div>
|
|
146
|
+
</Flexbox>
|
|
147
|
+
{type && <Tag>{type}</Tag>}
|
|
148
|
+
{loading && <NeuralNetworkLoading size={20} />}
|
|
149
|
+
</Flexbox>
|
|
150
|
+
|
|
151
|
+
{/* When has context content: collapse summary */}
|
|
152
|
+
{hasContextContent || hasAppContext ? (
|
|
153
|
+
<>
|
|
154
|
+
{/* Collapsed Summary */}
|
|
155
|
+
{(summary || tags?.length) && (
|
|
156
|
+
<Accordion gap={0}>
|
|
157
|
+
<AccordionItem
|
|
158
|
+
itemKey="summary"
|
|
159
|
+
paddingBlock={8}
|
|
160
|
+
paddingInline={8}
|
|
161
|
+
styles={{
|
|
162
|
+
base: { marginBlock: 4, marginInline: 4 },
|
|
163
|
+
}}
|
|
164
|
+
title={
|
|
165
|
+
<Text fontSize={12} type={'secondary'} weight={500}>
|
|
166
|
+
Summary
|
|
167
|
+
</Text>
|
|
168
|
+
}
|
|
169
|
+
>
|
|
170
|
+
<Flexbox gap={8} paddingBlock={'8px 12px'} paddingInline={8}>
|
|
171
|
+
{summary && <div className={styles.summary}>{summary}</div>}
|
|
172
|
+
{details && <div className={styles.detail}>{details}</div>}
|
|
173
|
+
{tags && tags.length > 0 && (
|
|
174
|
+
<Flexbox className={styles.tags} gap={8} horizontal wrap={'wrap'}>
|
|
175
|
+
{tags.map((tag, index) => (
|
|
176
|
+
<Tag key={index}>{tag}</Tag>
|
|
177
|
+
))}
|
|
178
|
+
</Flexbox>
|
|
179
|
+
)}
|
|
180
|
+
</Flexbox>
|
|
181
|
+
</AccordionItem>
|
|
182
|
+
</Accordion>
|
|
183
|
+
)}
|
|
184
|
+
|
|
185
|
+
{/* Origin Context Steps */}
|
|
186
|
+
{hasContextContent && (
|
|
187
|
+
<Accordion className={styles.section} defaultExpandedKeys={['context']} gap={0}>
|
|
188
|
+
<AccordionItem
|
|
189
|
+
itemKey="context"
|
|
190
|
+
paddingBlock={8}
|
|
191
|
+
paddingInline={8}
|
|
192
|
+
title={
|
|
193
|
+
<Text fontSize={12} type={'secondary'} weight={500}>
|
|
194
|
+
Origin Context
|
|
195
|
+
</Text>
|
|
196
|
+
}
|
|
197
|
+
>
|
|
198
|
+
<Flexbox paddingBlock={'8px 12px'} paddingInline={8}>
|
|
199
|
+
<Steps
|
|
200
|
+
className={styles.stepsContainer}
|
|
201
|
+
current={null as any}
|
|
202
|
+
direction="vertical"
|
|
203
|
+
items={contextItems.map((item) => ({
|
|
204
|
+
description: <div className={styles.stepContent}>{item.content}</div>,
|
|
205
|
+
icon: (
|
|
206
|
+
<Avatar
|
|
207
|
+
avatar={item.avatar}
|
|
208
|
+
shadow
|
|
209
|
+
shape={'square'}
|
|
210
|
+
size={20}
|
|
211
|
+
style={{
|
|
212
|
+
border: `1px solid ${cssVar.colorBorderSecondary}`,
|
|
213
|
+
fontSize: 11,
|
|
214
|
+
}}
|
|
215
|
+
/>
|
|
216
|
+
),
|
|
217
|
+
title: (
|
|
218
|
+
<Text as={'span'} fontSize={12} type={'secondary'} weight={500}>
|
|
219
|
+
{item.title}
|
|
220
|
+
</Text>
|
|
221
|
+
),
|
|
222
|
+
}))}
|
|
223
|
+
size="small"
|
|
224
|
+
/>
|
|
225
|
+
</Flexbox>
|
|
226
|
+
</AccordionItem>
|
|
227
|
+
</Accordion>
|
|
228
|
+
)}
|
|
229
|
+
|
|
230
|
+
{/* App Context */}
|
|
231
|
+
{hasAppContext && (
|
|
232
|
+
<Accordion className={styles.section} gap={0}>
|
|
233
|
+
<AccordionItem
|
|
234
|
+
itemKey="appContext"
|
|
235
|
+
paddingBlock={8}
|
|
236
|
+
paddingInline={8}
|
|
237
|
+
title={
|
|
238
|
+
<Text fontSize={12} type={'secondary'} weight={500}>
|
|
239
|
+
App Context
|
|
240
|
+
</Text>
|
|
241
|
+
}
|
|
242
|
+
>
|
|
243
|
+
<Flexbox paddingBlock={'8px 12px'} paddingInline={8}>
|
|
244
|
+
<Steps
|
|
245
|
+
className={styles.stepsContainer}
|
|
246
|
+
current={null as any}
|
|
247
|
+
direction="vertical"
|
|
248
|
+
items={appContextItems.map((item) => ({
|
|
249
|
+
description: <div className={styles.stepContent}>{item.content}</div>,
|
|
250
|
+
icon: (
|
|
251
|
+
<Avatar
|
|
252
|
+
avatar={item.avatar}
|
|
253
|
+
shadow
|
|
254
|
+
shape={'square'}
|
|
255
|
+
size={20}
|
|
256
|
+
style={{
|
|
257
|
+
border: `1px solid ${cssVar.colorBorderSecondary}`,
|
|
258
|
+
fontSize: 11,
|
|
259
|
+
}}
|
|
260
|
+
/>
|
|
261
|
+
),
|
|
262
|
+
title: (
|
|
263
|
+
<Text as={'span'} fontSize={12} type={'secondary'} weight={500}>
|
|
264
|
+
{item.title}
|
|
265
|
+
</Text>
|
|
266
|
+
),
|
|
267
|
+
}))}
|
|
268
|
+
size="small"
|
|
269
|
+
/>
|
|
270
|
+
</Flexbox>
|
|
271
|
+
</AccordionItem>
|
|
272
|
+
</Accordion>
|
|
273
|
+
)}
|
|
274
|
+
|
|
275
|
+
{/* Conclusion Directive */}
|
|
276
|
+
{conclusionDirectives && (
|
|
277
|
+
<Flexbox
|
|
278
|
+
className={styles.section}
|
|
279
|
+
gap={8}
|
|
280
|
+
style={{ paddingBlock: 16, paddingInline: 12 }}
|
|
281
|
+
>
|
|
282
|
+
<Text fontSize={12} weight={500}>
|
|
283
|
+
<span className={highlightTextStyles.primary}>Directive</span>
|
|
284
|
+
</Text>
|
|
285
|
+
<div className={styles.directive}>{conclusionDirectives}</div>
|
|
286
|
+
</Flexbox>
|
|
287
|
+
)}
|
|
288
|
+
|
|
289
|
+
{/* Suggestions */}
|
|
290
|
+
{hasSuggestions && (
|
|
291
|
+
<Flexbox
|
|
292
|
+
className={styles.section}
|
|
293
|
+
gap={8}
|
|
294
|
+
style={{ paddingBlock: 16, paddingInline: 12 }}
|
|
295
|
+
>
|
|
296
|
+
<Text fontSize={12} weight={500}>
|
|
297
|
+
<span className={highlightTextStyles.info}>Suggestions</span>
|
|
298
|
+
</Text>
|
|
299
|
+
<Flexbox gap={8}>
|
|
300
|
+
{suggestions.map((suggestion, index) => (
|
|
301
|
+
<div className={styles.suggestion} key={index}>
|
|
302
|
+
{suggestion}
|
|
303
|
+
</div>
|
|
304
|
+
))}
|
|
305
|
+
</Flexbox>
|
|
306
|
+
</Flexbox>
|
|
307
|
+
)}
|
|
308
|
+
</>
|
|
309
|
+
) : (
|
|
310
|
+
/* When no context content: show summary and details */
|
|
311
|
+
<Flexbox className={styles.content} gap={8}>
|
|
312
|
+
{!summary && loading ? (
|
|
313
|
+
<BubblesLoading />
|
|
314
|
+
) : (
|
|
315
|
+
<>
|
|
316
|
+
{summary && <div className={styles.summary}>{summary}</div>}
|
|
317
|
+
{details && <StreamingMarkdown>{details}</StreamingMarkdown>}
|
|
318
|
+
{conclusionDirectives && (
|
|
319
|
+
<Flexbox gap={4} paddingBlock={8}>
|
|
320
|
+
<Text fontSize={12} weight={500}>
|
|
321
|
+
<span className={highlightTextStyles.primary}>Directive</span>
|
|
322
|
+
</Text>
|
|
323
|
+
<div className={styles.directive}>{conclusionDirectives}</div>
|
|
324
|
+
</Flexbox>
|
|
325
|
+
)}
|
|
326
|
+
{hasSuggestions && (
|
|
327
|
+
<Flexbox gap={8} paddingBlock={8}>
|
|
328
|
+
<Text fontSize={12} weight={500}>
|
|
329
|
+
<span className={highlightTextStyles.info}>Suggestions</span>
|
|
330
|
+
</Text>
|
|
331
|
+
<Flexbox gap={8}>
|
|
332
|
+
{suggestions.map((suggestion, index) => (
|
|
333
|
+
<div className={styles.suggestion} key={index}>
|
|
334
|
+
{suggestion}
|
|
335
|
+
</div>
|
|
336
|
+
))}
|
|
337
|
+
</Flexbox>
|
|
338
|
+
</Flexbox>
|
|
339
|
+
)}
|
|
340
|
+
{tags && tags.length > 0 && (
|
|
341
|
+
<Flexbox className={styles.tags} gap={8} horizontal wrap={'wrap'}>
|
|
342
|
+
{tags.map((tag, index) => (
|
|
343
|
+
<Tag key={index}>{tag}</Tag>
|
|
344
|
+
))}
|
|
345
|
+
</Flexbox>
|
|
346
|
+
)}
|
|
347
|
+
</>
|
|
348
|
+
)}
|
|
349
|
+
</Flexbox>
|
|
350
|
+
)}
|
|
351
|
+
</Flexbox>
|
|
352
|
+
);
|
|
353
|
+
});
|
|
354
|
+
|
|
355
|
+
PreferenceMemoryCard.displayName = 'PreferenceMemoryCard';
|
|
356
|
+
|
|
357
|
+
export default PreferenceMemoryCard;
|
|
@@ -74,7 +74,7 @@ class MemoryExecutor extends BaseExecutor<typeof MemoryApiName> {
|
|
|
74
74
|
}
|
|
75
75
|
|
|
76
76
|
return {
|
|
77
|
-
content:
|
|
77
|
+
content: `Context memory "${params.title}" saved with memoryId: "${result.memoryId}" and contextId: "${result.contextId}"`,
|
|
78
78
|
state: { contextId: result.contextId, memoryId: result.memoryId },
|
|
79
79
|
success: true,
|
|
80
80
|
};
|
|
@@ -151,7 +151,7 @@ class MemoryExecutor extends BaseExecutor<typeof MemoryApiName> {
|
|
|
151
151
|
}
|
|
152
152
|
|
|
153
153
|
return {
|
|
154
|
-
content:
|
|
154
|
+
content: `Identity memory "${params.title}" saved with memoryId: "${result.memoryId}" and identityId: "${result.identityId}"`,
|
|
155
155
|
state: { identityId: result.identityId, memoryId: result.memoryId },
|
|
156
156
|
success: true,
|
|
157
157
|
};
|
|
@@ -189,7 +189,7 @@ class MemoryExecutor extends BaseExecutor<typeof MemoryApiName> {
|
|
|
189
189
|
}
|
|
190
190
|
|
|
191
191
|
return {
|
|
192
|
-
content:
|
|
192
|
+
content: `Preference memory "${params.title}" saved with memoryId: "${result.memoryId}" and preferenceId: "${result.preferenceId}"`,
|
|
193
193
|
state: { memoryId: result.memoryId, preferenceId: result.preferenceId },
|
|
194
194
|
success: true,
|
|
195
195
|
};
|
|
@@ -54,4 +54,5 @@ Conversation language: {{language}}
|
|
|
54
54
|
- When memory activity is warranted, explain which layers are affected, cite any matching memories you found, and justify why extraction or updates are needed.
|
|
55
55
|
- When nothing qualifies, explicitly state that no memory action is required after reviewing the context.
|
|
56
56
|
- Keep your reasoning concise, structured, and aligned with the conversation language.
|
|
57
|
+
- **Never expose internal memory IDs** (e.g., mem_xxx, id: xxx) to users in your responses. Refer to memories by their descriptive titles or summaries instead.
|
|
57
58
|
</response_expectations>`;
|