@lobehub/lobehub 2.0.0-next.307 → 2.0.0-next.309
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 +58 -0
- package/changelog/v1.json +21 -0
- package/locales/ar/agentGroup.json +5 -0
- package/locales/ar/chat.json +26 -0
- package/locales/ar/models.json +43 -5
- package/locales/ar/plugin.json +4 -5
- package/locales/ar/setting.json +11 -0
- package/locales/ar/subscription.json +2 -0
- package/locales/ar/tool.json +2 -0
- package/locales/bg-BG/agentGroup.json +5 -0
- package/locales/bg-BG/chat.json +26 -0
- package/locales/bg-BG/models.json +49 -3
- package/locales/bg-BG/plugin.json +4 -5
- package/locales/bg-BG/setting.json +11 -0
- package/locales/bg-BG/subscription.json +2 -0
- package/locales/bg-BG/tool.json +2 -0
- package/locales/de-DE/agentGroup.json +5 -0
- package/locales/de-DE/chat.json +26 -0
- package/locales/de-DE/models.json +48 -5
- package/locales/de-DE/plugin.json +4 -5
- package/locales/de-DE/setting.json +11 -0
- package/locales/de-DE/subscription.json +2 -0
- package/locales/de-DE/tool.json +2 -0
- package/locales/en-US/models.json +8 -6
- package/locales/en-US/plugin.json +3 -4
- package/locales/en-US/setting.json +10 -11
- package/locales/en-US/tool.json +2 -0
- package/locales/es-ES/agentGroup.json +5 -0
- package/locales/es-ES/chat.json +26 -0
- package/locales/es-ES/models.json +43 -5
- package/locales/es-ES/plugin.json +4 -5
- package/locales/es-ES/setting.json +11 -0
- package/locales/es-ES/subscription.json +2 -0
- package/locales/es-ES/tool.json +2 -0
- package/locales/fa-IR/agentGroup.json +5 -0
- package/locales/fa-IR/chat.json +26 -0
- package/locales/fa-IR/models.json +42 -5
- package/locales/fa-IR/plugin.json +4 -5
- package/locales/fa-IR/setting.json +11 -0
- package/locales/fa-IR/subscription.json +2 -0
- package/locales/fa-IR/tool.json +2 -0
- package/locales/fr-FR/agentGroup.json +5 -0
- package/locales/fr-FR/chat.json +26 -0
- package/locales/fr-FR/models.json +5 -5
- package/locales/fr-FR/plugin.json +4 -5
- package/locales/fr-FR/setting.json +11 -0
- package/locales/fr-FR/subscription.json +2 -0
- package/locales/fr-FR/tool.json +2 -0
- package/locales/it-IT/agentGroup.json +5 -0
- package/locales/it-IT/chat.json +26 -0
- package/locales/it-IT/models.json +1 -3
- package/locales/it-IT/plugin.json +4 -5
- package/locales/it-IT/setting.json +11 -0
- package/locales/it-IT/subscription.json +2 -0
- package/locales/it-IT/tool.json +2 -0
- package/locales/ja-JP/agentGroup.json +5 -0
- package/locales/ja-JP/chat.json +26 -0
- package/locales/ja-JP/models.json +1 -5
- package/locales/ja-JP/plugin.json +4 -5
- package/locales/ja-JP/setting.json +11 -0
- package/locales/ja-JP/subscription.json +2 -0
- package/locales/ja-JP/tool.json +2 -0
- package/locales/ko-KR/agentGroup.json +5 -0
- package/locales/ko-KR/chat.json +26 -0
- package/locales/ko-KR/models.json +1 -3
- package/locales/ko-KR/plugin.json +4 -5
- package/locales/ko-KR/setting.json +11 -0
- package/locales/ko-KR/subscription.json +2 -0
- package/locales/ko-KR/tool.json +2 -0
- package/locales/nl-NL/agentGroup.json +5 -0
- package/locales/nl-NL/chat.json +26 -0
- package/locales/nl-NL/models.json +35 -3
- package/locales/nl-NL/plugin.json +4 -5
- package/locales/nl-NL/setting.json +11 -0
- package/locales/nl-NL/subscription.json +2 -0
- package/locales/nl-NL/tool.json +2 -0
- package/locales/pl-PL/agentGroup.json +5 -0
- package/locales/pl-PL/chat.json +26 -0
- package/locales/pl-PL/models.json +1 -3
- package/locales/pl-PL/plugin.json +4 -5
- package/locales/pl-PL/setting.json +11 -0
- package/locales/pl-PL/subscription.json +2 -0
- package/locales/pl-PL/tool.json +2 -0
- package/locales/pt-BR/agentGroup.json +5 -0
- package/locales/pt-BR/chat.json +26 -0
- package/locales/pt-BR/models.json +50 -5
- package/locales/pt-BR/plugin.json +4 -5
- package/locales/pt-BR/setting.json +11 -0
- package/locales/pt-BR/subscription.json +2 -0
- package/locales/pt-BR/tool.json +2 -0
- package/locales/ru-RU/agentGroup.json +5 -0
- package/locales/ru-RU/chat.json +26 -0
- package/locales/ru-RU/models.json +22 -3
- package/locales/ru-RU/plugin.json +4 -5
- package/locales/ru-RU/setting.json +11 -0
- package/locales/ru-RU/subscription.json +2 -0
- package/locales/ru-RU/tool.json +2 -0
- package/locales/tr-TR/agentGroup.json +5 -0
- package/locales/tr-TR/chat.json +26 -0
- package/locales/tr-TR/models.json +36 -3
- package/locales/tr-TR/plugin.json +4 -5
- package/locales/tr-TR/setting.json +11 -0
- package/locales/tr-TR/subscription.json +2 -0
- package/locales/tr-TR/tool.json +2 -0
- package/locales/vi-VN/agentGroup.json +5 -0
- package/locales/vi-VN/chat.json +26 -0
- package/locales/vi-VN/models.json +1 -1
- package/locales/vi-VN/plugin.json +4 -5
- package/locales/vi-VN/setting.json +11 -0
- package/locales/vi-VN/subscription.json +2 -0
- package/locales/vi-VN/tool.json +2 -0
- package/locales/zh-CN/models.json +52 -5
- package/locales/zh-CN/plugin.json +6 -7
- package/locales/zh-CN/setting.json +10 -11
- package/locales/zh-CN/tool.json +2 -2
- package/locales/zh-TW/agentGroup.json +5 -0
- package/locales/zh-TW/chat.json +26 -0
- package/locales/zh-TW/models.json +54 -5
- package/locales/zh-TW/plugin.json +4 -5
- package/locales/zh-TW/setting.json +11 -0
- package/locales/zh-TW/subscription.json +2 -0
- package/locales/zh-TW/tool.json +2 -0
- package/package.json +1 -1
- package/packages/agent-runtime/src/types/state.ts +2 -0
- package/packages/builtin-tool-group-agent-builder/src/client/Inspector/GetAgentInfo/index.tsx +68 -0
- package/packages/builtin-tool-group-agent-builder/src/client/Inspector/index.ts +3 -0
- package/packages/builtin-tool-group-management/src/client/Inspector/ExecuteAgentTask/index.tsx +52 -8
- package/packages/builtin-tool-group-management/src/client/Render/ExecuteTask/index.tsx +2 -21
- package/packages/builtin-tool-group-management/src/executor.test.ts +6 -4
- package/packages/builtin-tool-group-management/src/manifest.ts +5 -1
- package/packages/builtin-tool-group-management/src/types.ts +2 -0
- package/packages/builtin-tool-local-system/src/client/Render/WriteFile/index.tsx +48 -5
- package/packages/builtin-tool-local-system/src/client/Streaming/WriteFile/index.tsx +39 -0
- package/packages/builtin-tool-local-system/src/client/Streaming/index.ts +2 -0
- package/packages/builtin-tool-memory/src/manifest.ts +581 -19
- package/packages/model-bank/src/aiModels/qiniu.ts +24 -0
- package/packages/types/src/topic/thread.ts +2 -2
- package/packages/types/src/userMemory/layers.ts +19 -8
- package/packages/types/src/userMemory/shared.ts +7 -1
- package/src/app/[variants]/(auth)/_layout/index.tsx +0 -2
- package/src/app/[variants]/(auth)/layout.tsx +0 -2
- package/src/app/[variants]/(auth)/login/[[...login]]/page.tsx +1 -3
- package/src/app/[variants]/(auth)/signup/[[...signup]]/page.tsx +1 -3
- package/src/app/[variants]/(desktop)/desktop-onboarding/_layout/index.tsx +0 -2
- package/src/app/[variants]/(main)/_layout/index.tsx +0 -2
- package/src/app/[variants]/(main)/agent/_layout/index.tsx +0 -2
- package/src/app/[variants]/(main)/agent/features/Portal/index.tsx +0 -2
- package/src/app/[variants]/(main)/community/(list)/_layout/index.tsx +0 -2
- package/src/app/[variants]/(main)/community/(list)/assistant/_layout/index.tsx +0 -2
- package/src/app/[variants]/(main)/community/(list)/mcp/_layout/index.tsx +0 -2
- package/src/app/[variants]/(main)/community/(list)/model/_layout/index.tsx +0 -2
- package/src/app/[variants]/(main)/community/_layout/index.tsx +0 -2
- package/src/app/[variants]/(main)/group/_layout/index.tsx +0 -2
- package/src/app/[variants]/(main)/group/features/Conversation/Header/index.tsx +4 -2
- package/src/app/[variants]/(main)/group/features/Portal/index.tsx +0 -2
- package/src/app/[variants]/(main)/home/_layout/index.tsx +0 -2
- package/src/app/[variants]/(main)/home/index.tsx +0 -2
- package/src/app/[variants]/(main)/image/_layout/Topics/TopicUrlSync.tsx +0 -2
- package/src/app/[variants]/(main)/image/_layout/index.tsx +0 -2
- package/src/app/[variants]/(main)/memory/_layout/index.tsx +0 -2
- package/src/app/[variants]/(main)/page/_layout/index.tsx +0 -2
- package/src/app/[variants]/(main)/resource/(home)/_layout/index.tsx +0 -2
- package/src/app/[variants]/(main)/resource/_layout/index.tsx +0 -2
- package/src/app/[variants]/(main)/resource/library/_layout/index.tsx +0 -2
- package/src/app/[variants]/(main)/resource/library/features/Container.tsx +0 -2
- package/src/app/[variants]/(main)/settings/_layout/index.tsx +0 -2
- package/src/app/[variants]/(main)/settings/about/index.tsx +0 -2
- package/src/app/[variants]/(main)/settings/agent/index.tsx +0 -2
- package/src/app/[variants]/(main)/settings/apikey/index.tsx +0 -2
- package/src/app/[variants]/(main)/settings/chat-appearance/index.tsx +0 -2
- package/src/app/[variants]/(main)/settings/common/index.tsx +0 -2
- package/src/app/[variants]/(main)/settings/hotkey/index.tsx +0 -2
- package/src/app/[variants]/(main)/settings/image/index.tsx +0 -2
- package/src/app/[variants]/(main)/settings/memory/index.tsx +0 -2
- package/src/app/[variants]/(main)/settings/provider/(list)/index.tsx +0 -2
- package/src/app/[variants]/(main)/settings/proxy/index.tsx +0 -2
- package/src/app/[variants]/(main)/settings/security/index.tsx +1 -3
- package/src/app/[variants]/(main)/settings/storage/index.tsx +0 -2
- package/src/app/[variants]/(main)/settings/tts/index.tsx +0 -2
- package/src/app/[variants]/(mobile)/(home)/_layout/index.tsx +0 -2
- package/src/app/[variants]/(mobile)/_layout/index.tsx +1 -3
- package/src/app/[variants]/(mobile)/chat/_layout/index.tsx +0 -2
- package/src/app/[variants]/(mobile)/chat/settings/_layout/index.tsx +0 -2
- package/src/app/[variants]/(mobile)/community/(detail)/_layout/index.tsx +0 -2
- package/src/app/[variants]/(mobile)/community/(list)/_layout/index.tsx +0 -2
- package/src/app/[variants]/(mobile)/community/_layout/index.tsx +0 -2
- package/src/app/[variants]/(mobile)/router/MobileClientRouter.tsx +0 -2
- package/src/app/[variants]/(mobile)/settings/index.tsx +0 -2
- package/src/app/[variants]/onboarding/_layout/index.tsx +0 -2
- package/src/app/[variants]/router/DesktopClientRouter.tsx +0 -2
- package/src/components/ModelSelect/index.tsx +6 -56
- package/src/components/server/MobileNavLayout.tsx +0 -2
- package/src/components/server/ServerLayout.tsx +0 -2
- package/src/features/ModelSwitchPanel/components/Footer.tsx +0 -2
- package/src/features/ModelSwitchPanel/components/List/MultipleProvidersModelItem.tsx +0 -1
- package/src/features/ModelSwitchPanel/components/List/SingleProviderModelItem.tsx +0 -1
- package/src/features/ModelSwitchPanel/components/List/VirtualItemRenderer.tsx +0 -1
- package/src/features/ModelSwitchPanel/components/List/index.tsx +15 -13
- package/src/features/ModelSwitchPanel/components/PanelContent.tsx +0 -2
- package/src/features/ModelSwitchPanel/index.tsx +21 -23
- package/src/features/ResourceManager/components/Explorer/MasonryView/index.tsx +0 -2
- package/src/features/User/UserAvatar.tsx +0 -2
- package/src/locales/default/plugin.ts +3 -1
- package/src/server/modules/AgentRuntime/RuntimeExecutors.ts +11 -3
- package/src/server/modules/Mecha/AgentToolsEngine/index.ts +14 -6
- package/src/server/modules/Mecha/AgentToolsEngine/types.ts +4 -3
- package/src/server/routers/lambda/aiAgent.ts +10 -0
- package/src/server/services/agent/index.test.ts +155 -0
- package/src/server/services/agent/index.ts +25 -0
- package/src/server/services/agentRuntime/AgentRuntimeService.ts +2 -0
- package/src/server/services/agentRuntime/types.ts +1 -0
- package/src/server/services/aiAgent/__tests__/execAgent.threadId.test.ts +29 -9
- package/src/server/services/aiAgent/index.ts +175 -6
- package/src/server/services/lobehubSkill/index.ts +109 -0
- package/src/server/services/toolExecution/builtin.ts +28 -2
- package/src/server/services/toolExecution/types.ts +3 -0
- package/src/store/chat/agents/GroupOrchestration/__tests__/call-supervisor.test.ts +305 -0
- package/src/store/chat/agents/GroupOrchestration/createGroupOrchestrationExecutors.ts +2 -1
- package/src/store/chat/agents/createAgentExecutors.ts +4 -2
- package/src/store/chat/slices/plugin/actions/exector.ts +92 -0
- package/src/store/chat/slices/plugin/actions/pluginTypes.ts +82 -177
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
|
|
3
|
+
import { type WriteLocalFileParams } from '@lobechat/electron-client-ipc';
|
|
4
|
+
import { type BuiltinStreamingProps } from '@lobechat/types';
|
|
5
|
+
import { Highlighter, Markdown } from '@lobehub/ui';
|
|
6
|
+
import path from 'path-browserify-esm';
|
|
7
|
+
import { memo } from 'react';
|
|
8
|
+
|
|
9
|
+
export const WriteFileStreaming = memo<BuiltinStreamingProps<WriteLocalFileParams>>(({ args }) => {
|
|
10
|
+
const { content, path: filePath } = args || {};
|
|
11
|
+
|
|
12
|
+
// Don't render if no content yet
|
|
13
|
+
if (!content) return null;
|
|
14
|
+
|
|
15
|
+
const ext = path
|
|
16
|
+
.extname(filePath || '')
|
|
17
|
+
.slice(1)
|
|
18
|
+
.toLowerCase();
|
|
19
|
+
|
|
20
|
+
// Use Markdown for .md files, Highlighter for others
|
|
21
|
+
if (ext === 'md' || ext === 'mdx') {
|
|
22
|
+
return <Markdown style={{ overflow: 'auto' }}>{content}</Markdown>;
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
return (
|
|
26
|
+
<Highlighter
|
|
27
|
+
animated
|
|
28
|
+
language={ext || 'text'}
|
|
29
|
+
showLanguage={false}
|
|
30
|
+
style={{ padding: '4px 8px' }}
|
|
31
|
+
variant={'outlined'}
|
|
32
|
+
wrap
|
|
33
|
+
>
|
|
34
|
+
{content}
|
|
35
|
+
</Highlighter>
|
|
36
|
+
);
|
|
37
|
+
});
|
|
38
|
+
|
|
39
|
+
WriteFileStreaming.displayName = 'WriteFileStreaming';
|
|
@@ -1,9 +1,11 @@
|
|
|
1
1
|
import { LocalSystemApiName } from '../..';
|
|
2
2
|
import { RunCommandStreaming } from './RunCommand';
|
|
3
|
+
import { WriteFileStreaming } from './WriteFile';
|
|
3
4
|
|
|
4
5
|
/**
|
|
5
6
|
* Local System Streaming Components Registry
|
|
6
7
|
*/
|
|
7
8
|
export const LocalSystemStreamings = {
|
|
8
9
|
[LocalSystemApiName.runCommand]: RunCommandStreaming,
|
|
10
|
+
[LocalSystemApiName.writeLocalFile]: WriteFileStreaming,
|
|
9
11
|
};
|
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
import {
|
|
2
|
-
addIdentityJsonSchema,
|
|
3
|
-
contextMemoryJsonSchema,
|
|
4
|
-
experienceMemoryJsonSchema,
|
|
5
|
-
preferenceMemoryJsonSchema,
|
|
6
|
-
removeIdentityJsonSchema,
|
|
7
|
-
searchMemoryJsonSchema,
|
|
8
|
-
updateIdentityJsonSchema,
|
|
9
|
-
} from '@lobechat/memory-user-memory/schemas';
|
|
10
1
|
import type { BuiltinToolManifest } from '@lobechat/types';
|
|
2
|
+
import {
|
|
3
|
+
CONTEXT_OBJECT_TYPES,
|
|
4
|
+
CONTEXT_STATUS,
|
|
5
|
+
CONTEXT_SUBJECT_TYPES,
|
|
6
|
+
IDENTITY_TYPES,
|
|
7
|
+
MEMORY_TYPES,
|
|
8
|
+
MERGE_STRATEGIES,
|
|
9
|
+
RELATIONSHIPS,
|
|
10
|
+
} from '@lobechat/types';
|
|
11
11
|
|
|
12
12
|
import { systemPrompt } from './systemRole';
|
|
13
13
|
import { MemoryApiName } from './types';
|
|
@@ -20,43 +20,608 @@ export const MemoryManifest: BuiltinToolManifest = {
|
|
|
20
20
|
description:
|
|
21
21
|
'Retrieve memories based on a search query. Use this to recall previously saved information.',
|
|
22
22
|
name: MemoryApiName.searchUserMemory,
|
|
23
|
-
parameters:
|
|
23
|
+
parameters: {
|
|
24
|
+
additionalProperties: false,
|
|
25
|
+
properties: {
|
|
26
|
+
query: { type: 'string' },
|
|
27
|
+
topK: {
|
|
28
|
+
additionalProperties: false,
|
|
29
|
+
properties: {
|
|
30
|
+
contexts: { minimum: 0, type: 'integer' },
|
|
31
|
+
experiences: { minimum: 0, type: 'integer' },
|
|
32
|
+
preferences: { minimum: 0, type: 'integer' },
|
|
33
|
+
},
|
|
34
|
+
required: ['contexts', 'experiences', 'preferences'],
|
|
35
|
+
type: 'object',
|
|
36
|
+
},
|
|
37
|
+
},
|
|
38
|
+
required: ['query', 'topK'],
|
|
39
|
+
type: 'object',
|
|
40
|
+
},
|
|
24
41
|
},
|
|
25
42
|
{
|
|
26
43
|
description:
|
|
27
44
|
'Create a context memory that captures ongoing situations, projects, or environments. Include actors, resources, statuses, urgency/impact, and a clear description.',
|
|
28
45
|
name: MemoryApiName.addContextMemory,
|
|
29
|
-
parameters:
|
|
46
|
+
parameters: {
|
|
47
|
+
additionalProperties: false,
|
|
48
|
+
properties: {
|
|
49
|
+
details: {
|
|
50
|
+
description: 'Optional detailed information',
|
|
51
|
+
type: 'string',
|
|
52
|
+
},
|
|
53
|
+
memoryCategory: {
|
|
54
|
+
description: 'Memory category',
|
|
55
|
+
type: 'string',
|
|
56
|
+
},
|
|
57
|
+
memoryType: {
|
|
58
|
+
description: 'Memory type',
|
|
59
|
+
enum: MEMORY_TYPES,
|
|
60
|
+
type: 'string',
|
|
61
|
+
},
|
|
62
|
+
summary: {
|
|
63
|
+
description: 'Concise overview of this specific memory',
|
|
64
|
+
type: 'string',
|
|
65
|
+
},
|
|
66
|
+
tags: {
|
|
67
|
+
description: 'User defined tags that summarize the context facets',
|
|
68
|
+
items: { type: 'string' },
|
|
69
|
+
type: 'array',
|
|
70
|
+
},
|
|
71
|
+
title: {
|
|
72
|
+
description: 'Brief descriptive title',
|
|
73
|
+
type: 'string',
|
|
74
|
+
},
|
|
75
|
+
withContext: {
|
|
76
|
+
additionalProperties: false,
|
|
77
|
+
properties: {
|
|
78
|
+
associatedObjects: {
|
|
79
|
+
description:
|
|
80
|
+
'Array of objects describing involved roles, entities, or resources, [] empty if none',
|
|
81
|
+
items: {
|
|
82
|
+
additionalProperties: false,
|
|
83
|
+
properties: {
|
|
84
|
+
extra: {
|
|
85
|
+
description:
|
|
86
|
+
'Additional metadata about the object, should always be a valid JSON string if present',
|
|
87
|
+
type: ['string', 'null'],
|
|
88
|
+
},
|
|
89
|
+
name: {
|
|
90
|
+
description: 'Name of the associated object',
|
|
91
|
+
type: 'string',
|
|
92
|
+
},
|
|
93
|
+
type: {
|
|
94
|
+
description: 'Type/category of the associated object',
|
|
95
|
+
enum: CONTEXT_OBJECT_TYPES,
|
|
96
|
+
type: 'string',
|
|
97
|
+
},
|
|
98
|
+
},
|
|
99
|
+
required: ['extra', 'name', 'type'],
|
|
100
|
+
type: 'object',
|
|
101
|
+
},
|
|
102
|
+
type: 'array',
|
|
103
|
+
},
|
|
104
|
+
associatedSubjects: {
|
|
105
|
+
description:
|
|
106
|
+
'Array of JSON objects describing involved subjects or participants, [] empty if none',
|
|
107
|
+
items: {
|
|
108
|
+
additionalProperties: false,
|
|
109
|
+
properties: {
|
|
110
|
+
extra: {
|
|
111
|
+
description:
|
|
112
|
+
'Additional metadata about the subject, should always be a valid JSON string if present',
|
|
113
|
+
type: ['string', 'null'],
|
|
114
|
+
},
|
|
115
|
+
name: {
|
|
116
|
+
description: 'Name of the associated subject',
|
|
117
|
+
type: 'string',
|
|
118
|
+
},
|
|
119
|
+
type: {
|
|
120
|
+
description: 'Type/category of the associated subject',
|
|
121
|
+
enum: CONTEXT_SUBJECT_TYPES,
|
|
122
|
+
type: 'string',
|
|
123
|
+
},
|
|
124
|
+
},
|
|
125
|
+
required: ['extra', 'name', 'type'],
|
|
126
|
+
type: 'object',
|
|
127
|
+
},
|
|
128
|
+
type: 'array',
|
|
129
|
+
},
|
|
130
|
+
currentStatus: {
|
|
131
|
+
description:
|
|
132
|
+
"High level status markers (must be one of 'planned', 'ongoing', 'completed', 'aborted', 'on_hold', 'cancelled')",
|
|
133
|
+
enum: CONTEXT_STATUS,
|
|
134
|
+
type: 'string',
|
|
135
|
+
},
|
|
136
|
+
description: {
|
|
137
|
+
description: 'Rich narrative describing the situation, timeline, or environment',
|
|
138
|
+
type: 'string',
|
|
139
|
+
},
|
|
140
|
+
labels: {
|
|
141
|
+
description: 'Model generated tags that summarize the context themes',
|
|
142
|
+
items: { type: 'string' },
|
|
143
|
+
type: 'array',
|
|
144
|
+
},
|
|
145
|
+
scoreImpact: {
|
|
146
|
+
description: 'Numeric score (0-1 (0% to 100%)) describing importance',
|
|
147
|
+
maximum: 1,
|
|
148
|
+
minimum: 0,
|
|
149
|
+
type: 'number',
|
|
150
|
+
},
|
|
151
|
+
scoreUrgency: {
|
|
152
|
+
description: 'Numeric score (0-1 (0% to 100%)) describing urgency',
|
|
153
|
+
maximum: 1,
|
|
154
|
+
minimum: 0,
|
|
155
|
+
type: 'number',
|
|
156
|
+
},
|
|
157
|
+
title: {
|
|
158
|
+
description: 'Optional synthesized context headline',
|
|
159
|
+
type: 'string',
|
|
160
|
+
},
|
|
161
|
+
type: {
|
|
162
|
+
description:
|
|
163
|
+
"High level context archetype (e.g., 'project', 'relationship', 'goal')",
|
|
164
|
+
type: 'string',
|
|
165
|
+
},
|
|
166
|
+
},
|
|
167
|
+
required: [
|
|
168
|
+
'associatedObjects',
|
|
169
|
+
'associatedSubjects',
|
|
170
|
+
'currentStatus',
|
|
171
|
+
'description',
|
|
172
|
+
'labels',
|
|
173
|
+
'scoreImpact',
|
|
174
|
+
'scoreUrgency',
|
|
175
|
+
'title',
|
|
176
|
+
'type',
|
|
177
|
+
],
|
|
178
|
+
type: 'object',
|
|
179
|
+
},
|
|
180
|
+
},
|
|
181
|
+
required: [
|
|
182
|
+
'details',
|
|
183
|
+
'memoryCategory',
|
|
184
|
+
'memoryType',
|
|
185
|
+
'summary',
|
|
186
|
+
'tags',
|
|
187
|
+
'title',
|
|
188
|
+
'withContext',
|
|
189
|
+
],
|
|
190
|
+
type: 'object',
|
|
191
|
+
},
|
|
30
192
|
},
|
|
31
193
|
{
|
|
32
194
|
description:
|
|
33
195
|
'Record an experience memory capturing situation, actions, reasoning, outcomes, and confidence. Use for lessons, playbooks, or transferable know-how.',
|
|
34
196
|
name: MemoryApiName.addExperienceMemory,
|
|
35
|
-
parameters:
|
|
197
|
+
parameters: {
|
|
198
|
+
additionalProperties: false,
|
|
199
|
+
properties: {
|
|
200
|
+
details: {
|
|
201
|
+
description: 'Optional detailed information',
|
|
202
|
+
type: 'string',
|
|
203
|
+
},
|
|
204
|
+
memoryCategory: {
|
|
205
|
+
description: 'Memory category',
|
|
206
|
+
type: 'string',
|
|
207
|
+
},
|
|
208
|
+
memoryType: {
|
|
209
|
+
description: 'Memory type',
|
|
210
|
+
enum: MEMORY_TYPES,
|
|
211
|
+
type: 'string',
|
|
212
|
+
},
|
|
213
|
+
summary: {
|
|
214
|
+
description: 'Concise overview of this specific memory',
|
|
215
|
+
type: 'string',
|
|
216
|
+
},
|
|
217
|
+
tags: {
|
|
218
|
+
description: 'Model generated tags that summarize the experience facets',
|
|
219
|
+
items: { type: 'string' },
|
|
220
|
+
type: 'array',
|
|
221
|
+
},
|
|
222
|
+
title: {
|
|
223
|
+
description: 'Brief descriptive title',
|
|
224
|
+
type: 'string',
|
|
225
|
+
},
|
|
226
|
+
withExperience: {
|
|
227
|
+
additionalProperties: false,
|
|
228
|
+
properties: {
|
|
229
|
+
action: {
|
|
230
|
+
description: 'Narrative describing actions taken or behaviors exhibited',
|
|
231
|
+
type: 'string',
|
|
232
|
+
},
|
|
233
|
+
keyLearning: {
|
|
234
|
+
description: 'Narrative describing key insights or lessons learned',
|
|
235
|
+
type: 'string',
|
|
236
|
+
},
|
|
237
|
+
knowledgeValueScore: {
|
|
238
|
+
description:
|
|
239
|
+
'Numeric score (0-1) describing how reusable and shareable this experience is',
|
|
240
|
+
maximum: 1,
|
|
241
|
+
minimum: 0,
|
|
242
|
+
type: 'number',
|
|
243
|
+
},
|
|
244
|
+
labels: {
|
|
245
|
+
description: 'Model generated tags that summarize the experience facets',
|
|
246
|
+
items: { type: 'string' },
|
|
247
|
+
type: 'array',
|
|
248
|
+
},
|
|
249
|
+
possibleOutcome: {
|
|
250
|
+
description: 'Narrative describing potential outcomes or learnings',
|
|
251
|
+
type: 'string',
|
|
252
|
+
},
|
|
253
|
+
problemSolvingScore: {
|
|
254
|
+
description:
|
|
255
|
+
'Numeric score (0-1) describing how effectively the problem was solved',
|
|
256
|
+
maximum: 1,
|
|
257
|
+
minimum: 0,
|
|
258
|
+
type: 'number',
|
|
259
|
+
},
|
|
260
|
+
reasoning: {
|
|
261
|
+
description: 'Narrative describing the thought process or motivations',
|
|
262
|
+
type: 'string',
|
|
263
|
+
},
|
|
264
|
+
scoreConfidence: {
|
|
265
|
+
description:
|
|
266
|
+
'Numeric score (0-1 (0% to 100%)) describing confidence in the experience details',
|
|
267
|
+
maximum: 1,
|
|
268
|
+
minimum: 0,
|
|
269
|
+
type: 'number',
|
|
270
|
+
},
|
|
271
|
+
situation: {
|
|
272
|
+
description: 'Narrative describing the situation or event',
|
|
273
|
+
type: 'string',
|
|
274
|
+
},
|
|
275
|
+
type: {
|
|
276
|
+
description: 'Type of experience being recorded',
|
|
277
|
+
type: 'string',
|
|
278
|
+
},
|
|
279
|
+
},
|
|
280
|
+
required: [
|
|
281
|
+
'action',
|
|
282
|
+
'keyLearning',
|
|
283
|
+
'knowledgeValueScore',
|
|
284
|
+
'labels',
|
|
285
|
+
'possibleOutcome',
|
|
286
|
+
'problemSolvingScore',
|
|
287
|
+
'reasoning',
|
|
288
|
+
'scoreConfidence',
|
|
289
|
+
'situation',
|
|
290
|
+
'type',
|
|
291
|
+
],
|
|
292
|
+
type: 'object',
|
|
293
|
+
},
|
|
294
|
+
},
|
|
295
|
+
required: [
|
|
296
|
+
'details',
|
|
297
|
+
'memoryCategory',
|
|
298
|
+
'memoryType',
|
|
299
|
+
'summary',
|
|
300
|
+
'tags',
|
|
301
|
+
'title',
|
|
302
|
+
'withExperience',
|
|
303
|
+
],
|
|
304
|
+
type: 'object',
|
|
305
|
+
},
|
|
36
306
|
},
|
|
37
307
|
{
|
|
38
308
|
description:
|
|
39
309
|
'Add an identity memory describing enduring facts about a person, their role, relationship, and supporting evidence. Use to track self/others identities.',
|
|
40
310
|
name: MemoryApiName.addIdentityMemory,
|
|
41
|
-
parameters:
|
|
311
|
+
parameters: {
|
|
312
|
+
additionalProperties: false,
|
|
313
|
+
properties: {
|
|
314
|
+
details: {
|
|
315
|
+
description: 'Optional detailed information',
|
|
316
|
+
type: ['string', 'null'],
|
|
317
|
+
},
|
|
318
|
+
memoryCategory: {
|
|
319
|
+
description: 'Memory category',
|
|
320
|
+
type: 'string',
|
|
321
|
+
},
|
|
322
|
+
memoryType: {
|
|
323
|
+
description: 'Memory type',
|
|
324
|
+
enum: MEMORY_TYPES,
|
|
325
|
+
type: 'string',
|
|
326
|
+
},
|
|
327
|
+
summary: {
|
|
328
|
+
description: 'Concise overview of this specific memory',
|
|
329
|
+
type: 'string',
|
|
330
|
+
},
|
|
331
|
+
tags: {
|
|
332
|
+
description: 'Model generated tags that summarize the identity facets',
|
|
333
|
+
items: { type: 'string' },
|
|
334
|
+
type: 'array',
|
|
335
|
+
},
|
|
336
|
+
title: {
|
|
337
|
+
description:
|
|
338
|
+
'Honorific-style, concise descriptor (strength + domain/milestone), avoid bare job titles; e.g., "Trusted open-source maintainer", "Specializes in low-latency infra", "Former Aliyun engineer", "Cares for rescue cats"',
|
|
339
|
+
type: 'string',
|
|
340
|
+
},
|
|
341
|
+
withIdentity: {
|
|
342
|
+
additionalProperties: false,
|
|
343
|
+
properties: {
|
|
344
|
+
description: { type: 'string' },
|
|
345
|
+
episodicDate: { type: ['string', 'null'] },
|
|
346
|
+
extractedLabels: {
|
|
347
|
+
items: { type: 'string' },
|
|
348
|
+
type: 'array',
|
|
349
|
+
},
|
|
350
|
+
relationship: {
|
|
351
|
+
enum: RELATIONSHIPS,
|
|
352
|
+
type: 'string',
|
|
353
|
+
},
|
|
354
|
+
role: {
|
|
355
|
+
description:
|
|
356
|
+
'Role explicitly mentioned for this identity entry (e.g., "platform engineer", "caregiver"); keep neutral and only use when evidence exists',
|
|
357
|
+
type: 'string',
|
|
358
|
+
},
|
|
359
|
+
scoreConfidence: { type: 'number' },
|
|
360
|
+
sourceEvidence: { type: ['string', 'null'] },
|
|
361
|
+
type: {
|
|
362
|
+
enum: IDENTITY_TYPES,
|
|
363
|
+
type: 'string',
|
|
364
|
+
},
|
|
365
|
+
},
|
|
366
|
+
required: [
|
|
367
|
+
'description',
|
|
368
|
+
'episodicDate',
|
|
369
|
+
'extractedLabels',
|
|
370
|
+
'relationship',
|
|
371
|
+
'role',
|
|
372
|
+
'scoreConfidence',
|
|
373
|
+
'sourceEvidence',
|
|
374
|
+
'type',
|
|
375
|
+
],
|
|
376
|
+
type: 'object',
|
|
377
|
+
},
|
|
378
|
+
},
|
|
379
|
+
required: [
|
|
380
|
+
'details',
|
|
381
|
+
'memoryCategory',
|
|
382
|
+
'memoryType',
|
|
383
|
+
'summary',
|
|
384
|
+
'tags',
|
|
385
|
+
'title',
|
|
386
|
+
'withIdentity',
|
|
387
|
+
],
|
|
388
|
+
type: 'object',
|
|
389
|
+
},
|
|
42
390
|
},
|
|
43
391
|
{
|
|
44
392
|
description:
|
|
45
393
|
'Create a preference memory that encodes durable directives or choices the assistant should follow. Include conclusionDirectives, scopes, and context.',
|
|
46
394
|
name: MemoryApiName.addPreferenceMemory,
|
|
47
|
-
parameters:
|
|
395
|
+
parameters: {
|
|
396
|
+
additionalProperties: false,
|
|
397
|
+
properties: {
|
|
398
|
+
details: {
|
|
399
|
+
description: 'Optional detailed information',
|
|
400
|
+
type: 'string',
|
|
401
|
+
},
|
|
402
|
+
memoryCategory: {
|
|
403
|
+
description: 'Memory category',
|
|
404
|
+
type: 'string',
|
|
405
|
+
},
|
|
406
|
+
memoryType: {
|
|
407
|
+
description: 'Memory type',
|
|
408
|
+
enum: MEMORY_TYPES,
|
|
409
|
+
type: 'string',
|
|
410
|
+
},
|
|
411
|
+
summary: {
|
|
412
|
+
description: 'Concise overview of this specific memory',
|
|
413
|
+
type: 'string',
|
|
414
|
+
},
|
|
415
|
+
tags: {
|
|
416
|
+
description: 'Model generated tags that summarize the preference facets',
|
|
417
|
+
items: { type: 'string' },
|
|
418
|
+
type: 'array',
|
|
419
|
+
},
|
|
420
|
+
title: {
|
|
421
|
+
description: 'Brief descriptive title',
|
|
422
|
+
type: 'string',
|
|
423
|
+
},
|
|
424
|
+
withPreference: {
|
|
425
|
+
additionalProperties: false,
|
|
426
|
+
properties: {
|
|
427
|
+
appContext: {
|
|
428
|
+
additionalProperties: false,
|
|
429
|
+
description: 'Application/surface specific preference, if any',
|
|
430
|
+
properties: {
|
|
431
|
+
app: {
|
|
432
|
+
description: 'App or product name this applies to',
|
|
433
|
+
type: ['string', 'null'],
|
|
434
|
+
},
|
|
435
|
+
feature: { type: ['string', 'null'] },
|
|
436
|
+
route: { type: ['string', 'null'] },
|
|
437
|
+
surface: {
|
|
438
|
+
description: 'e.g., chat, emails, code review, notes',
|
|
439
|
+
type: ['string', 'null'],
|
|
440
|
+
},
|
|
441
|
+
},
|
|
442
|
+
required: ['app', 'feature', 'route', 'surface'],
|
|
443
|
+
type: ['object', 'null'],
|
|
444
|
+
},
|
|
445
|
+
conclusionDirectives: {
|
|
446
|
+
description:
|
|
447
|
+
"Direct, self-contained instruction to the assistant from the user's perspective (what to do, not how to implement)",
|
|
448
|
+
type: 'string',
|
|
449
|
+
},
|
|
450
|
+
extractedLabels: {
|
|
451
|
+
description: 'Model generated tags that summarize the preference facets',
|
|
452
|
+
items: { type: 'string' },
|
|
453
|
+
type: 'array',
|
|
454
|
+
},
|
|
455
|
+
extractedScopes: {
|
|
456
|
+
description:
|
|
457
|
+
'Array of JSON strings describing preference facets and applicable scopes',
|
|
458
|
+
items: { type: 'string' },
|
|
459
|
+
type: 'array',
|
|
460
|
+
},
|
|
461
|
+
originContext: {
|
|
462
|
+
additionalProperties: false,
|
|
463
|
+
description: 'Context of how/why this preference was expressed',
|
|
464
|
+
properties: {
|
|
465
|
+
actor: {
|
|
466
|
+
description: "Who stated the preference; use 'User' for the user",
|
|
467
|
+
type: 'string',
|
|
468
|
+
},
|
|
469
|
+
applicableWhen: {
|
|
470
|
+
description: 'Conditions where this preference applies',
|
|
471
|
+
type: ['string', 'null'],
|
|
472
|
+
},
|
|
473
|
+
notApplicableWhen: {
|
|
474
|
+
description: 'Conditions where it does not apply',
|
|
475
|
+
type: ['string', 'null'],
|
|
476
|
+
},
|
|
477
|
+
scenario: {
|
|
478
|
+
description: 'Applicable scenario or use case',
|
|
479
|
+
type: ['string', 'null'],
|
|
480
|
+
},
|
|
481
|
+
trigger: {
|
|
482
|
+
description: 'What prompted this preference',
|
|
483
|
+
type: ['string', 'null'],
|
|
484
|
+
},
|
|
485
|
+
},
|
|
486
|
+
required: ['actor', 'applicableWhen', 'notApplicableWhen', 'scenario', 'trigger'],
|
|
487
|
+
type: ['object', 'null'],
|
|
488
|
+
},
|
|
489
|
+
scorePriority: {
|
|
490
|
+
description:
|
|
491
|
+
'Numeric prioritization weight (0-1 (0% to 100%)) where higher means more critical to respect',
|
|
492
|
+
maximum: 1,
|
|
493
|
+
minimum: 0,
|
|
494
|
+
type: 'number',
|
|
495
|
+
},
|
|
496
|
+
suggestions: {
|
|
497
|
+
description: 'Follow-up actions or assistant guidance derived from the preference',
|
|
498
|
+
items: { type: 'string' },
|
|
499
|
+
type: 'array',
|
|
500
|
+
},
|
|
501
|
+
type: {
|
|
502
|
+
description:
|
|
503
|
+
"High level preference classification (e.g., 'lifestyle', 'communication')",
|
|
504
|
+
type: 'string',
|
|
505
|
+
},
|
|
506
|
+
},
|
|
507
|
+
required: [
|
|
508
|
+
'appContext',
|
|
509
|
+
'conclusionDirectives',
|
|
510
|
+
'extractedLabels',
|
|
511
|
+
'extractedScopes',
|
|
512
|
+
'originContext',
|
|
513
|
+
'scorePriority',
|
|
514
|
+
'suggestions',
|
|
515
|
+
'type',
|
|
516
|
+
],
|
|
517
|
+
type: 'object',
|
|
518
|
+
},
|
|
519
|
+
},
|
|
520
|
+
required: [
|
|
521
|
+
'title',
|
|
522
|
+
'summary',
|
|
523
|
+
'tags',
|
|
524
|
+
'details',
|
|
525
|
+
'memoryCategory',
|
|
526
|
+
'memoryType',
|
|
527
|
+
'withPreference',
|
|
528
|
+
],
|
|
529
|
+
type: 'object',
|
|
530
|
+
},
|
|
48
531
|
},
|
|
49
532
|
{
|
|
50
533
|
description:
|
|
51
534
|
'Update an existing identity memory with refined details, relationships, roles, or tags. Use mergeStrategy to control replacement vs merge.',
|
|
52
535
|
name: MemoryApiName.updateIdentityMemory,
|
|
53
|
-
parameters:
|
|
536
|
+
parameters: {
|
|
537
|
+
additionalProperties: false,
|
|
538
|
+
properties: {
|
|
539
|
+
id: { type: 'string' },
|
|
540
|
+
mergeStrategy: {
|
|
541
|
+
enum: MERGE_STRATEGIES,
|
|
542
|
+
type: 'string',
|
|
543
|
+
},
|
|
544
|
+
set: {
|
|
545
|
+
additionalProperties: false,
|
|
546
|
+
properties: {
|
|
547
|
+
details: {
|
|
548
|
+
description: 'Optional detailed information, use null for omitting the field',
|
|
549
|
+
type: ['string', 'null'],
|
|
550
|
+
},
|
|
551
|
+
memoryCategory: {
|
|
552
|
+
description: 'Memory category, use null for omitting the field',
|
|
553
|
+
type: ['string', 'null'],
|
|
554
|
+
},
|
|
555
|
+
memoryType: {
|
|
556
|
+
description: 'Memory type, use null for omitting the field',
|
|
557
|
+
enum: [...MEMORY_TYPES, null],
|
|
558
|
+
},
|
|
559
|
+
summary: {
|
|
560
|
+
description:
|
|
561
|
+
'Concise overview of this specific memory, use null for omitting the field',
|
|
562
|
+
type: ['string', 'null'],
|
|
563
|
+
},
|
|
564
|
+
tags: {
|
|
565
|
+
description:
|
|
566
|
+
'Model generated tags that summarize the identity facets, use null for omitting the field',
|
|
567
|
+
items: { type: 'string' },
|
|
568
|
+
type: ['array', 'null'],
|
|
569
|
+
},
|
|
570
|
+
title: {
|
|
571
|
+
description:
|
|
572
|
+
'Honorific-style, concise descriptor (strength + domain/milestone), avoid bare job titles; e.g., "Trusted open-source maintainer", "Specializes in low-latency infra", "Former Aliyun engineer", "Cares for rescue cats"; use null for omitting the field',
|
|
573
|
+
type: ['string', 'null'],
|
|
574
|
+
},
|
|
575
|
+
withIdentity: {
|
|
576
|
+
additionalProperties: false,
|
|
577
|
+
properties: {
|
|
578
|
+
description: { type: ['string', 'null'] },
|
|
579
|
+
episodicDate: { type: ['string', 'null'] },
|
|
580
|
+
extractedLabels: {
|
|
581
|
+
items: { type: 'string' },
|
|
582
|
+
type: ['array', 'null'],
|
|
583
|
+
},
|
|
584
|
+
relationship: {
|
|
585
|
+
description: `Possible values: ${RELATIONSHIPS.join(' | ')}`,
|
|
586
|
+
type: ['string', 'null'],
|
|
587
|
+
},
|
|
588
|
+
role: {
|
|
589
|
+
description:
|
|
590
|
+
'Role explicitly mentioned for this identity entry (e.g., "platform engineer", "caregiver"); keep existing when not updated; use null for omitting the field',
|
|
591
|
+
type: ['string', 'null'],
|
|
592
|
+
},
|
|
593
|
+
scoreConfidence: { type: ['number', 'null'] },
|
|
594
|
+
sourceEvidence: { type: ['string', 'null'] },
|
|
595
|
+
type: {
|
|
596
|
+
description: `Possible values: ${IDENTITY_TYPES.join(' | ')}`,
|
|
597
|
+
type: ['string', 'null'],
|
|
598
|
+
},
|
|
599
|
+
},
|
|
600
|
+
required: ['description', 'extractedLabels', 'role'],
|
|
601
|
+
type: 'object',
|
|
602
|
+
},
|
|
603
|
+
},
|
|
604
|
+
required: ['withIdentity'],
|
|
605
|
+
type: 'object',
|
|
606
|
+
},
|
|
607
|
+
},
|
|
608
|
+
required: ['id', 'mergeStrategy', 'set'],
|
|
609
|
+
type: 'object',
|
|
610
|
+
},
|
|
54
611
|
},
|
|
55
612
|
{
|
|
56
613
|
description:
|
|
57
614
|
'Remove an identity memory when it is incorrect, obsolete, or duplicated. Always provide a concise reason.',
|
|
58
615
|
name: MemoryApiName.removeIdentityMemory,
|
|
59
|
-
parameters:
|
|
616
|
+
parameters: {
|
|
617
|
+
additionalProperties: false,
|
|
618
|
+
properties: {
|
|
619
|
+
id: { type: 'string' },
|
|
620
|
+
reason: { type: 'string' },
|
|
621
|
+
},
|
|
622
|
+
required: ['id', 'reason'],
|
|
623
|
+
type: 'object',
|
|
624
|
+
},
|
|
60
625
|
},
|
|
61
626
|
],
|
|
62
627
|
identifier: 'lobe-user-memory',
|
|
@@ -67,6 +632,3 @@ export const MemoryManifest: BuiltinToolManifest = {
|
|
|
67
632
|
systemRole: systemPrompt,
|
|
68
633
|
type: 'builtin',
|
|
69
634
|
};
|
|
70
|
-
|
|
71
|
-
/** @deprecated Use MemoryManifest instead */
|
|
72
|
-
export const UserMemoryManifest = MemoryManifest;
|