@lobehub/lobehub 2.0.0-next.295 → 2.0.0-next.297
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 +50 -0
- package/changelog/v1.json +18 -0
- package/locales/en-US/plugin.json +4 -0
- package/locales/zh-CN/plugin.json +4 -0
- package/package.json +2 -2
- package/packages/agent-runtime/src/core/__tests__/runtime.test.ts +5 -5
- package/packages/agent-runtime/src/utils/stepContextComputer.test.ts +5 -5
- package/packages/builtin-tool-gtd/src/client/Inspector/index.ts +0 -4
- package/packages/builtin-tool-gtd/src/client/Intervention/AddTodo.tsx +1 -1
- package/packages/builtin-tool-gtd/src/client/Render/TodoList/index.tsx +39 -10
- package/packages/builtin-tool-gtd/src/client/Render/index.ts +0 -2
- package/packages/builtin-tool-gtd/src/client/components/SortableTodoList/TodoItemRow.tsx +26 -12
- package/packages/builtin-tool-gtd/src/client/components/SortableTodoList/store/actions.ts +5 -5
- package/packages/builtin-tool-gtd/src/client/components/SortableTodoList/store/store.test.ts +14 -8
- package/packages/builtin-tool-gtd/src/executor/index.test.ts +48 -227
- package/packages/builtin-tool-gtd/src/executor/index.ts +15 -158
- package/packages/builtin-tool-gtd/src/manifest.ts +12 -42
- package/packages/builtin-tool-gtd/src/systemRole.ts +14 -8
- package/packages/builtin-tool-gtd/src/types.ts +47 -41
- package/packages/builtin-tool-memory/package.json +8 -0
- package/packages/builtin-tool-memory/src/client/Inspector/AddContextMemory/index.tsx +60 -0
- package/packages/builtin-tool-memory/src/client/Inspector/AddExperienceMemory/index.tsx +60 -0
- package/packages/builtin-tool-memory/src/client/Inspector/AddIdentityMemory/index.tsx +60 -0
- package/packages/builtin-tool-memory/src/client/Inspector/AddPreferenceMemory/index.tsx +60 -0
- package/packages/builtin-tool-memory/src/client/Inspector/RemoveIdentityMemory/index.tsx +60 -0
- package/packages/builtin-tool-memory/src/client/Inspector/SearchUserMemory/index.tsx +67 -0
- package/packages/builtin-tool-memory/src/client/Inspector/UpdateIdentityMemory/index.tsx +60 -0
- package/packages/builtin-tool-memory/src/client/Inspector/index.ts +35 -0
- package/packages/builtin-tool-memory/src/client/Intervention/AddExperienceMemory/index.tsx +17 -0
- package/packages/builtin-tool-memory/src/client/Intervention/index.ts +13 -0
- package/packages/builtin-tool-memory/src/client/Render/AddExperienceMemory/index.tsx +17 -0
- package/packages/builtin-tool-memory/src/client/Render/SearchUserMemory/index.tsx +217 -0
- package/packages/builtin-tool-memory/src/client/Render/index.ts +15 -0
- package/packages/builtin-tool-memory/src/client/Streaming/AddExperienceMemory/index.tsx +17 -0
- package/packages/builtin-tool-memory/src/client/Streaming/index.ts +18 -0
- package/packages/builtin-tool-memory/src/client/components/ExperienceMemoryCard.tsx +231 -0
- package/packages/builtin-tool-memory/src/client/components/index.ts +1 -0
- package/packages/builtin-tool-memory/src/client/index.ts +27 -0
- package/packages/builtin-tool-memory/src/executor/index.ts +9 -1
- package/packages/builtin-tool-memory/src/types.ts +61 -0
- package/packages/context-engine/src/providers/GTDTodoInjector.ts +15 -7
- package/packages/conversation-flow/src/__tests__/fixtures/outputs/assistantGroup/tools-with-branches.json +4 -0
- package/packages/conversation-flow/src/transformation/FlatListBuilder.ts +1 -0
- package/packages/prompts/src/prompts/gtd/index.test.ts +32 -16
- package/packages/prompts/src/prompts/gtd/index.ts +9 -5
- package/packages/types/package.json +1 -1
- package/packages/types/src/discover/assistants.ts +4 -0
- package/packages/types/src/discover/groupAgents.ts +196 -0
- package/packages/types/src/discover/index.ts +5 -1
- package/packages/types/src/stepContext.ts +4 -1
- package/src/app/[variants]/(main)/community/(detail)/assistant/features/Details/Versions/index.tsx +2 -2
- package/src/app/[variants]/(main)/community/(detail)/group_agent/features/DetailProvider.tsx +19 -0
- package/src/app/[variants]/(main)/community/(detail)/group_agent/features/Details/Members/index.tsx +137 -0
- package/src/app/[variants]/(main)/community/(detail)/group_agent/features/Details/Nav.tsx +88 -0
- package/src/app/[variants]/(main)/community/(detail)/group_agent/features/Details/Overview/index.tsx +213 -0
- package/src/app/[variants]/(main)/community/(detail)/group_agent/features/Details/Related/index.tsx +85 -0
- package/src/app/[variants]/(main)/community/(detail)/group_agent/features/Details/SystemRole/TagList.tsx +20 -0
- package/src/app/[variants]/(main)/community/(detail)/group_agent/features/Details/SystemRole/index.tsx +71 -0
- package/src/app/[variants]/(main)/community/(detail)/group_agent/features/Details/Versions/index.tsx +119 -0
- package/src/app/[variants]/(main)/community/(detail)/group_agent/features/Details/index.tsx +51 -0
- package/src/app/[variants]/(main)/community/(detail)/group_agent/features/Header.tsx +253 -0
- package/src/app/[variants]/(main)/community/(detail)/group_agent/features/Sidebar/ActionButton/AddGroupAgent.tsx +222 -0
- package/src/app/[variants]/(main)/community/(detail)/group_agent/features/Sidebar/ActionButton/index.tsx +34 -0
- package/src/app/[variants]/(main)/community/(detail)/group_agent/features/Sidebar/Summary/index.tsx +42 -0
- package/src/app/[variants]/(main)/community/(detail)/group_agent/features/Sidebar/index.tsx +41 -0
- package/src/app/[variants]/(main)/community/(detail)/group_agent/features/StatusPage/index.tsx +104 -0
- package/src/app/[variants]/(main)/community/(detail)/group_agent/index.tsx +103 -0
- package/src/app/[variants]/(main)/community/(detail)/group_agent/loading.tsx +1 -0
- package/src/app/[variants]/(main)/community/(detail)/user/features/DetailProvider.tsx +7 -1
- package/src/app/[variants]/(main)/community/(detail)/user/features/UserContent.tsx +2 -0
- package/src/app/[variants]/(main)/community/(detail)/user/features/UserGroupCard.tsx +186 -0
- package/src/app/[variants]/(main)/community/(detail)/user/features/UserGroupList.tsx +59 -0
- package/src/app/[variants]/(main)/community/(detail)/user/index.tsx +3 -1
- package/src/app/[variants]/(main)/community/(list)/assistant/features/List/Item.tsx +26 -8
- package/src/app/[variants]/(main)/community/(list)/assistant/index.tsx +1 -0
- package/src/app/[variants]/(main)/community/features/Search.tsx +1 -1
- package/src/app/[variants]/(main)/group/profile/features/GroupProfile/index.tsx +2 -0
- package/src/app/[variants]/(main)/group/profile/features/Header/AgentPublishButton/PublishResultModal.tsx +2 -1
- package/src/app/[variants]/(main)/group/profile/features/Header/GroupPublishButton/GroupForkConfirmModal.tsx +60 -0
- package/src/app/[variants]/(main)/group/profile/features/Header/GroupPublishButton/GroupPublishResultModal.tsx +62 -0
- package/src/app/[variants]/(main)/group/profile/features/Header/GroupPublishButton/PublishButton.tsx +122 -0
- package/src/app/[variants]/(main)/group/profile/features/Header/GroupPublishButton/index.tsx +46 -0
- package/src/app/[variants]/(main)/group/profile/features/Header/GroupPublishButton/types.ts +12 -0
- package/src/app/[variants]/(main)/group/profile/features/Header/GroupPublishButton/useMarketGroupPublish.ts +211 -0
- package/src/app/[variants]/(main)/group/profile/features/Header/GroupPublishButton/utils.ts +22 -0
- package/src/app/[variants]/(main)/resource/features/DndContextWrapper.tsx +4 -2
- package/src/app/[variants]/(main)/resource/library/_layout/Header/LibraryHead.tsx +30 -35
- package/src/app/[variants]/(main)/resource/library/_layout/Header/index.tsx +9 -11
- package/src/app/[variants]/router/desktopRouter.config.tsx +7 -0
- package/src/features/Conversation/Messages/AssistantGroup/Tool/Actions/index.tsx +11 -17
- package/src/features/Conversation/Messages/AssistantGroup/Tool/{Render → Detail}/LoadingPlaceholder/index.tsx +13 -3
- package/src/features/Conversation/Messages/AssistantGroup/Tool/Detail/Render/CustomRender.tsx +43 -0
- package/src/features/Conversation/Messages/AssistantGroup/Tool/Detail/Render/FallbacktArgumentRender.tsx +59 -0
- package/src/features/Conversation/Messages/AssistantGroup/Tool/Detail/Render/index.tsx +46 -0
- package/src/features/Conversation/Messages/AssistantGroup/Tool/{Render → Detail}/index.tsx +13 -19
- package/src/features/Conversation/Messages/AssistantGroup/Tool/index.tsx +17 -17
- package/src/features/Conversation/Messages/Tool/Tool/index.tsx +10 -9
- package/src/features/Conversation/TodoProgress/index.tsx +56 -23
- package/src/features/PluginsUI/Render/MCPType/index.tsx +1 -1
- package/src/features/ResourceManager/components/Explorer/Header/index.tsx +57 -4
- package/src/features/ResourceManager/components/Explorer/ListView/ListItem/index.tsx +6 -4
- package/src/features/ResourceManager/components/Explorer/ListView/index.tsx +16 -5
- package/src/features/ResourceManager/components/LibraryHierarchy/styles.ts +5 -4
- package/src/hooks/useActiveTabKey.ts +1 -2
- package/src/locales/default/plugin.ts +1 -0
- package/src/locales/default/setting.ts +12 -0
- package/src/server/routers/lambda/market/agentGroup.ts +296 -0
- package/src/server/routers/lambda/market/index.ts +134 -4
- package/src/server/services/discover/index.ts +123 -7
- package/src/services/discover.ts +55 -0
- package/src/store/chat/slices/message/selectors/dbMessage.test.ts +11 -11
- package/src/store/discover/slices/groupAgent/action.ts +80 -0
- package/src/store/discover/store.ts +3 -0
- package/src/store/file/slices/resource/action.ts +4 -2
- package/src/tools/inspectors.ts +2 -0
- package/src/tools/interventions.ts +2 -0
- package/src/tools/renders.ts +3 -1
- package/src/tools/streamings.ts +2 -0
- package/packages/builtin-tool-gtd/src/client/Inspector/CompleteTodos/index.tsx +0 -52
- package/packages/builtin-tool-gtd/src/client/Inspector/RemoveTodos/index.tsx +0 -52
- package/src/features/Conversation/Messages/AssistantGroup/Tool/Render/CustomRender.tsx +0 -113
- package/src/features/Conversation/Messages/Tool/Tool/Render.tsx +0 -47
- /package/src/features/Conversation/Messages/AssistantGroup/Tool/{Render → Detail}/AbortResponse.tsx +0 -0
- /package/src/features/Conversation/Messages/AssistantGroup/Tool/{Render → Detail}/Arguments/index.tsx +0 -0
- /package/src/features/Conversation/Messages/AssistantGroup/Tool/{Render → Detail}/ErrorResponse.tsx +0 -0
- /package/src/features/Conversation/Messages/AssistantGroup/Tool/{Render → Detail}/Intervention/ApprovalActions.tsx +0 -0
- /package/src/features/Conversation/Messages/AssistantGroup/Tool/{Render → Detail}/Intervention/Fallback.tsx +0 -0
- /package/src/features/Conversation/Messages/AssistantGroup/Tool/{Render → Detail}/Intervention/KeyValueEditor.tsx +0 -0
- /package/src/features/Conversation/Messages/AssistantGroup/Tool/{Render → Detail}/Intervention/ModeSelector.tsx +0 -0
- /package/src/features/Conversation/Messages/AssistantGroup/Tool/{Render → Detail}/Intervention/index.tsx +0 -0
- /package/src/features/Conversation/Messages/AssistantGroup/Tool/{Render → Detail}/PluginSettings.tsx +0 -0
- /package/src/features/Conversation/Messages/AssistantGroup/Tool/{Render → Detail}/RejectedResponse.tsx +0 -0
|
@@ -84,22 +84,23 @@ export const GTDManifest: BuiltinToolManifest = {
|
|
|
84
84
|
{
|
|
85
85
|
description: `Update todo items with batch operations. Each operation type requires specific fields:
|
|
86
86
|
- "add": requires "text" (the todo text to add)
|
|
87
|
-
- "update": requires "index", optional "newText" and/or "
|
|
87
|
+
- "update": requires "index", optional "newText" and/or "status"
|
|
88
88
|
- "remove": requires "index" only
|
|
89
|
-
- "complete": requires "index" only (marks item as completed)
|
|
89
|
+
- "complete": requires "index" only (marks item as completed)
|
|
90
|
+
- "processing": requires "index" only (marks item as in progress)`,
|
|
90
91
|
name: GTDApiName.updateTodos,
|
|
91
92
|
renderDisplayControl: 'expand',
|
|
92
93
|
parameters: {
|
|
93
94
|
properties: {
|
|
94
95
|
operations: {
|
|
95
96
|
description:
|
|
96
|
-
'Array of update operations. IMPORTANT: For "complete" and "remove" operations, only pass "type" and "index" - no other fields needed.',
|
|
97
|
+
'Array of update operations. IMPORTANT: For "complete", "processing" and "remove" operations, only pass "type" and "index" - no other fields needed.',
|
|
97
98
|
items: {
|
|
98
99
|
properties: {
|
|
99
100
|
type: {
|
|
100
101
|
description:
|
|
101
|
-
'Operation type. "add" needs text, "update" needs index + optional newText/
|
|
102
|
-
enum: ['add', 'update', 'remove', 'complete'],
|
|
102
|
+
'Operation type. "add" needs text, "update" needs index + optional newText/status, "remove", "complete" and "processing" need index only.',
|
|
103
|
+
enum: ['add', 'update', 'remove', 'complete', 'processing'],
|
|
103
104
|
type: 'string',
|
|
104
105
|
},
|
|
105
106
|
text: {
|
|
@@ -108,16 +109,18 @@ export const GTDManifest: BuiltinToolManifest = {
|
|
|
108
109
|
},
|
|
109
110
|
index: {
|
|
110
111
|
description:
|
|
111
|
-
'Required for "update", "remove", "complete": the item index (0-based).',
|
|
112
|
+
'Required for "update", "remove", "complete", "processing": the item index (0-based).',
|
|
112
113
|
type: 'number',
|
|
113
114
|
},
|
|
114
115
|
newText: {
|
|
115
116
|
description: 'Optional for "update" only: the new text.',
|
|
116
117
|
type: 'string',
|
|
117
118
|
},
|
|
118
|
-
|
|
119
|
-
description:
|
|
120
|
-
|
|
119
|
+
status: {
|
|
120
|
+
description:
|
|
121
|
+
'Optional for "update" only: set status (todo, processing, completed).',
|
|
122
|
+
enum: ['todo', 'processing', 'completed'],
|
|
123
|
+
type: 'string',
|
|
121
124
|
},
|
|
122
125
|
},
|
|
123
126
|
required: ['type'],
|
|
@@ -130,39 +133,6 @@ export const GTDManifest: BuiltinToolManifest = {
|
|
|
130
133
|
type: 'object',
|
|
131
134
|
},
|
|
132
135
|
},
|
|
133
|
-
{
|
|
134
|
-
description: 'Mark todo items as completed by their indices (0-based).',
|
|
135
|
-
name: GTDApiName.completeTodos,
|
|
136
|
-
renderDisplayControl: 'expand',
|
|
137
|
-
parameters: {
|
|
138
|
-
properties: {
|
|
139
|
-
indices: {
|
|
140
|
-
description: 'Array of item indices (0-based) to mark as completed.',
|
|
141
|
-
items: { type: 'number' },
|
|
142
|
-
type: 'array',
|
|
143
|
-
},
|
|
144
|
-
},
|
|
145
|
-
required: ['indices'],
|
|
146
|
-
type: 'object',
|
|
147
|
-
},
|
|
148
|
-
},
|
|
149
|
-
{
|
|
150
|
-
description: 'Remove todo items by their indices (0-based).',
|
|
151
|
-
name: GTDApiName.removeTodos,
|
|
152
|
-
humanIntervention: 'always',
|
|
153
|
-
renderDisplayControl: 'expand',
|
|
154
|
-
parameters: {
|
|
155
|
-
properties: {
|
|
156
|
-
indices: {
|
|
157
|
-
description: 'Array of item indices (0-based) to remove.',
|
|
158
|
-
items: { type: 'number' },
|
|
159
|
-
type: 'array',
|
|
160
|
-
},
|
|
161
|
-
},
|
|
162
|
-
required: ['indices'],
|
|
163
|
-
type: 'object',
|
|
164
|
-
},
|
|
165
|
-
},
|
|
166
136
|
{
|
|
167
137
|
description: 'Clear todo items. Can clear only completed items or all items.',
|
|
168
138
|
name: GTDApiName.clearTodos,
|
|
@@ -11,11 +11,11 @@ export const systemPrompt = `You have GTD (Getting Things Done) tools to help ma
|
|
|
11
11
|
|
|
12
12
|
**Todo Tools** - For actionable execution items:
|
|
13
13
|
- \`createTodos\`: Create new todo items from text array
|
|
14
|
-
- \`updateTodos\`: Batch update todos (add, update, remove, complete operations)
|
|
15
|
-
- \`completeTodos\`: Mark items as done by indices
|
|
16
|
-
- \`removeTodos\`: Remove items by indices
|
|
14
|
+
- \`updateTodos\`: Batch update todos (add, update, remove, complete, processing operations)
|
|
17
15
|
- \`clearTodos\`: Clear completed or all items
|
|
18
16
|
|
|
17
|
+
**Todo Status Workflow:** todo → processing → completed (use "processing" when actively working on an item)
|
|
18
|
+
|
|
19
19
|
**Async Task Tools** - For long-running background tasks:
|
|
20
20
|
- \`execTask\`: Execute a single async task in isolated context
|
|
21
21
|
- \`execTasks\`: Execute multiple async tasks in parallel
|
|
@@ -98,23 +98,29 @@ Use \`execTask\` for a single task, \`execTasks\` for multiple parallel tasks.
|
|
|
98
98
|
<updateTodos_usage>
|
|
99
99
|
When using \`updateTodos\`, each operation type requires specific fields:
|
|
100
100
|
|
|
101
|
+
**Todo Status:**
|
|
102
|
+
- \`todo\`: Not started yet
|
|
103
|
+
- \`processing\`: Currently in progress
|
|
104
|
+
- \`completed\`: Done
|
|
105
|
+
|
|
101
106
|
**Minimal required fields per operation type:**
|
|
102
107
|
- \`{ "type": "add", "text": "todo text" }\` - only type + text
|
|
103
|
-
- \`{ "type": "complete", "index": 0 }\` - only type + index
|
|
108
|
+
- \`{ "type": "complete", "index": 0 }\` - only type + index (marks as completed)
|
|
109
|
+
- \`{ "type": "processing", "index": 0 }\` - only type + index (marks as in progress)
|
|
104
110
|
- \`{ "type": "remove", "index": 0 }\` - only type + index
|
|
105
|
-
- \`{ "type": "update", "index": 0, "newText": "..." }\` - type + index + optional newText/
|
|
111
|
+
- \`{ "type": "update", "index": 0, "newText": "..." }\` - type + index + optional newText/status
|
|
106
112
|
|
|
107
|
-
**Example - mark
|
|
113
|
+
**Example - mark item 0 as processing, item 1 as complete:**
|
|
108
114
|
\`\`\`json
|
|
109
115
|
{
|
|
110
116
|
"operations": [
|
|
111
|
-
{ "type": "
|
|
117
|
+
{ "type": "processing", "index": 0 },
|
|
112
118
|
{ "type": "complete", "index": 1 }
|
|
113
119
|
]
|
|
114
120
|
}
|
|
115
121
|
\`\`\`
|
|
116
122
|
|
|
117
|
-
**DO NOT** add extra fields like \`"
|
|
123
|
+
**DO NOT** add extra fields like \`"status": "completed"\` for complete/processing operations - they are ignored.
|
|
118
124
|
</updateTodos_usage>
|
|
119
125
|
|
|
120
126
|
<todo_granularity>
|
|
@@ -14,44 +14,66 @@ export const GTDApiName = {
|
|
|
14
14
|
/** Clear completed or all todos */
|
|
15
15
|
clearTodos: 'clearTodos',
|
|
16
16
|
|
|
17
|
-
|
|
18
|
-
completeTodos: 'completeTodos',
|
|
19
|
-
|
|
17
|
+
|
|
20
18
|
// ==================== Planning ====================
|
|
21
|
-
|
|
22
|
-
|
|
19
|
+
/** Create a structured plan by breaking down a goal into actionable steps */
|
|
20
|
+
createPlan: 'createPlan',
|
|
21
|
+
|
|
22
|
+
|
|
23
|
+
|
|
24
|
+
|
|
25
|
+
/** Create new todo items */
|
|
26
|
+
createTodos: 'createTodos',
|
|
27
|
+
|
|
28
|
+
|
|
29
|
+
|
|
30
|
+
|
|
31
|
+
// ==================== Async Tasks ====================
|
|
32
|
+
/** Execute a single async task */
|
|
33
|
+
execTask: 'execTask',
|
|
34
|
+
|
|
35
|
+
|
|
36
|
+
|
|
23
37
|
|
|
24
|
-
/** Create new todo items */
|
|
25
|
-
createTodos: 'createTodos',
|
|
26
38
|
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
execTask: 'execTask',
|
|
39
|
+
/** Execute one or more async tasks */
|
|
40
|
+
execTasks: 'execTasks',
|
|
30
41
|
|
|
31
|
-
|
|
32
|
-
|
|
42
|
+
|
|
43
|
+
|
|
44
|
+
|
|
33
45
|
|
|
34
|
-
/** Remove todo items by indices */
|
|
35
|
-
removeTodos: 'removeTodos',
|
|
36
46
|
|
|
37
|
-
|
|
38
|
-
|
|
47
|
+
/** Update an existing plan */
|
|
48
|
+
updatePlan: 'updatePlan',
|
|
39
49
|
|
|
40
|
-
|
|
41
|
-
|
|
50
|
+
|
|
51
|
+
|
|
52
|
+
/** Update todo items with batch operations (add, update, remove, complete, processing) */
|
|
53
|
+
updateTodos: 'updateTodos',
|
|
42
54
|
} as const;
|
|
43
55
|
|
|
44
56
|
export type GTDApiNameType = (typeof GTDApiName)[keyof typeof GTDApiName];
|
|
45
57
|
|
|
46
58
|
// ==================== Todo Item ====================
|
|
47
59
|
|
|
60
|
+
/** Status of a todo item */
|
|
61
|
+
export type TodoStatus = 'todo' | 'processing' | 'completed';
|
|
62
|
+
|
|
48
63
|
export interface TodoItem {
|
|
49
|
-
/**
|
|
50
|
-
|
|
64
|
+
/** Status of the todo item */
|
|
65
|
+
status: TodoStatus;
|
|
51
66
|
/** The todo item text */
|
|
52
67
|
text: string;
|
|
53
68
|
}
|
|
54
69
|
|
|
70
|
+
/** Get the next status in the cycle: todo → processing → completed → todo */
|
|
71
|
+
export const getNextTodoStatus = (current: TodoStatus): TodoStatus => {
|
|
72
|
+
const cycle: TodoStatus[] = ['todo', 'processing', 'completed'];
|
|
73
|
+
const index = cycle.indexOf(current);
|
|
74
|
+
return cycle[(index + 1) % cycle.length];
|
|
75
|
+
};
|
|
76
|
+
|
|
55
77
|
export interface TodoList {
|
|
56
78
|
items: TodoItem[];
|
|
57
79
|
updatedAt: string;
|
|
@@ -77,18 +99,18 @@ export interface CreateTodosParams {
|
|
|
77
99
|
/**
|
|
78
100
|
* Update operation types for batch updates
|
|
79
101
|
*/
|
|
80
|
-
export type TodoUpdateOperationType = 'add' | 'update' | 'remove' | 'complete';
|
|
102
|
+
export type TodoUpdateOperationType = 'add' | 'update' | 'remove' | 'complete' | 'processing';
|
|
81
103
|
|
|
82
104
|
/**
|
|
83
105
|
* Single update operation
|
|
84
106
|
*/
|
|
85
107
|
export interface TodoUpdateOperation {
|
|
86
|
-
/** For 'update': the
|
|
87
|
-
completed?: boolean;
|
|
88
|
-
/** For 'update', 'remove', 'complete': the index of the item (0-based) */
|
|
108
|
+
/** For 'update', 'remove', 'complete', 'processing': the index of the item (0-based) */
|
|
89
109
|
index?: number;
|
|
90
110
|
/** For 'update': the new text */
|
|
91
111
|
newText?: string;
|
|
112
|
+
/** For 'update': the new status */
|
|
113
|
+
status?: TodoStatus;
|
|
92
114
|
/** For 'add': the text to add */
|
|
93
115
|
text?: string;
|
|
94
116
|
/** Operation type */
|
|
@@ -97,29 +119,13 @@ export interface TodoUpdateOperation {
|
|
|
97
119
|
|
|
98
120
|
/**
|
|
99
121
|
* Update todo list with batch operations
|
|
100
|
-
* Supports: add, update, remove, complete
|
|
122
|
+
* Supports: add, update, remove, complete, processing
|
|
101
123
|
*/
|
|
102
124
|
export interface UpdateTodosParams {
|
|
103
125
|
/** Array of update operations to apply */
|
|
104
126
|
operations: TodoUpdateOperation[];
|
|
105
127
|
}
|
|
106
128
|
|
|
107
|
-
/**
|
|
108
|
-
* Mark todo items as completed by indices
|
|
109
|
-
*/
|
|
110
|
-
export interface CompleteTodosParams {
|
|
111
|
-
/** Indices of items to mark as completed (0-based) */
|
|
112
|
-
indices: number[];
|
|
113
|
-
}
|
|
114
|
-
|
|
115
|
-
/**
|
|
116
|
-
* Remove todo items by indices
|
|
117
|
-
*/
|
|
118
|
-
export interface RemoveTodosParams {
|
|
119
|
-
/** Indices of items to remove (0-based) */
|
|
120
|
-
indices: number[];
|
|
121
|
-
}
|
|
122
|
-
|
|
123
129
|
/**
|
|
124
130
|
* Clear todo items
|
|
125
131
|
*/
|
|
@@ -4,6 +4,7 @@
|
|
|
4
4
|
"private": true,
|
|
5
5
|
"exports": {
|
|
6
6
|
".": "./src/index.ts",
|
|
7
|
+
"./client": "./src/client/index.ts",
|
|
7
8
|
"./executor": "./src/executor/index.ts"
|
|
8
9
|
},
|
|
9
10
|
"main": "./src/index.ts",
|
|
@@ -13,5 +14,12 @@
|
|
|
13
14
|
},
|
|
14
15
|
"devDependencies": {
|
|
15
16
|
"@lobechat/types": "workspace:*"
|
|
17
|
+
},
|
|
18
|
+
"peerDependencies": {
|
|
19
|
+
"@lobehub/ui": "^4",
|
|
20
|
+
"antd-style": "*",
|
|
21
|
+
"lucide-react": "*",
|
|
22
|
+
"react": "*",
|
|
23
|
+
"react-i18next": "*"
|
|
16
24
|
}
|
|
17
25
|
}
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
|
|
3
|
+
import type { BuiltinInspectorProps } from '@lobechat/types';
|
|
4
|
+
import { createStaticStyles, cssVar, cx } from 'antd-style';
|
|
5
|
+
import { Check } from 'lucide-react';
|
|
6
|
+
import { memo } from 'react';
|
|
7
|
+
import { useTranslation } from 'react-i18next';
|
|
8
|
+
|
|
9
|
+
import { highlightTextStyles, inspectorTextStyles, shinyTextStyles } from '@/styles';
|
|
10
|
+
|
|
11
|
+
import type { AddContextMemoryParams, AddContextMemoryState } from '../../../types';
|
|
12
|
+
|
|
13
|
+
const styles = createStaticStyles(({ css }) => ({
|
|
14
|
+
statusIcon: css`
|
|
15
|
+
margin-block-end: -2px;
|
|
16
|
+
margin-inline-start: 4px;
|
|
17
|
+
`,
|
|
18
|
+
}));
|
|
19
|
+
|
|
20
|
+
export const AddContextMemoryInspector = memo<
|
|
21
|
+
BuiltinInspectorProps<AddContextMemoryParams, AddContextMemoryState>
|
|
22
|
+
>(({ args, partialArgs, isArgumentsStreaming, isLoading, pluginState }) => {
|
|
23
|
+
const { t } = useTranslation('plugin');
|
|
24
|
+
|
|
25
|
+
const title = args?.title || partialArgs?.title;
|
|
26
|
+
|
|
27
|
+
// Initial streaming state
|
|
28
|
+
if (isArgumentsStreaming && !title) {
|
|
29
|
+
return (
|
|
30
|
+
<div className={cx(inspectorTextStyles.root, shinyTextStyles.shinyText)}>
|
|
31
|
+
<span>{t('builtins.lobe-user-memory.apiName.addContextMemory')}</span>
|
|
32
|
+
</div>
|
|
33
|
+
);
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
const isSuccess = pluginState?.memoryId;
|
|
37
|
+
|
|
38
|
+
return (
|
|
39
|
+
<div
|
|
40
|
+
className={cx(
|
|
41
|
+
inspectorTextStyles.root,
|
|
42
|
+
(isArgumentsStreaming || isLoading) && shinyTextStyles.shinyText,
|
|
43
|
+
)}
|
|
44
|
+
>
|
|
45
|
+
<span>{t('builtins.lobe-user-memory.apiName.addContextMemory')}</span>
|
|
46
|
+
{title && (
|
|
47
|
+
<>
|
|
48
|
+
: <span className={highlightTextStyles.primary}>{title}</span>
|
|
49
|
+
</>
|
|
50
|
+
)}
|
|
51
|
+
{!isLoading && isSuccess && (
|
|
52
|
+
<Check className={styles.statusIcon} color={cssVar.colorSuccess} size={14} />
|
|
53
|
+
)}
|
|
54
|
+
</div>
|
|
55
|
+
);
|
|
56
|
+
});
|
|
57
|
+
|
|
58
|
+
AddContextMemoryInspector.displayName = 'AddContextMemoryInspector';
|
|
59
|
+
|
|
60
|
+
export default AddContextMemoryInspector;
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
|
|
3
|
+
import type { BuiltinInspectorProps } from '@lobechat/types';
|
|
4
|
+
import { createStaticStyles, cssVar, cx } from 'antd-style';
|
|
5
|
+
import { Check } from 'lucide-react';
|
|
6
|
+
import { memo } from 'react';
|
|
7
|
+
import { useTranslation } from 'react-i18next';
|
|
8
|
+
|
|
9
|
+
import { highlightTextStyles, inspectorTextStyles, shinyTextStyles } from '@/styles';
|
|
10
|
+
|
|
11
|
+
import type { AddExperienceMemoryParams, AddExperienceMemoryState } from '../../../types';
|
|
12
|
+
|
|
13
|
+
const styles = createStaticStyles(({ css }) => ({
|
|
14
|
+
statusIcon: css`
|
|
15
|
+
margin-block-end: -2px;
|
|
16
|
+
margin-inline-start: 4px;
|
|
17
|
+
`,
|
|
18
|
+
}));
|
|
19
|
+
|
|
20
|
+
export const AddExperienceMemoryInspector = memo<
|
|
21
|
+
BuiltinInspectorProps<AddExperienceMemoryParams, AddExperienceMemoryState>
|
|
22
|
+
>(({ args, partialArgs, isArgumentsStreaming, isLoading, pluginState }) => {
|
|
23
|
+
const { t } = useTranslation('plugin');
|
|
24
|
+
|
|
25
|
+
const title = args?.title || partialArgs?.title;
|
|
26
|
+
|
|
27
|
+
// Initial streaming state
|
|
28
|
+
if (isArgumentsStreaming && !title) {
|
|
29
|
+
return (
|
|
30
|
+
<div className={cx(inspectorTextStyles.root, shinyTextStyles.shinyText)}>
|
|
31
|
+
<span>{t('builtins.lobe-user-memory.apiName.addExperienceMemory')}</span>
|
|
32
|
+
</div>
|
|
33
|
+
);
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
const isSuccess = pluginState?.memoryId;
|
|
37
|
+
|
|
38
|
+
return (
|
|
39
|
+
<div
|
|
40
|
+
className={cx(
|
|
41
|
+
inspectorTextStyles.root,
|
|
42
|
+
(isArgumentsStreaming || isLoading) && shinyTextStyles.shinyText,
|
|
43
|
+
)}
|
|
44
|
+
>
|
|
45
|
+
<span>{t('builtins.lobe-user-memory.apiName.addExperienceMemory')}</span>
|
|
46
|
+
{title && (
|
|
47
|
+
<>
|
|
48
|
+
: <span className={highlightTextStyles.primary}>{title}</span>
|
|
49
|
+
</>
|
|
50
|
+
)}
|
|
51
|
+
{!isLoading && isSuccess && (
|
|
52
|
+
<Check className={styles.statusIcon} color={cssVar.colorSuccess} size={14} />
|
|
53
|
+
)}
|
|
54
|
+
</div>
|
|
55
|
+
);
|
|
56
|
+
});
|
|
57
|
+
|
|
58
|
+
AddExperienceMemoryInspector.displayName = 'AddExperienceMemoryInspector';
|
|
59
|
+
|
|
60
|
+
export default AddExperienceMemoryInspector;
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
|
|
3
|
+
import type { BuiltinInspectorProps } from '@lobechat/types';
|
|
4
|
+
import { createStaticStyles, cssVar, cx } from 'antd-style';
|
|
5
|
+
import { Check } from 'lucide-react';
|
|
6
|
+
import { memo } from 'react';
|
|
7
|
+
import { useTranslation } from 'react-i18next';
|
|
8
|
+
|
|
9
|
+
import { highlightTextStyles, inspectorTextStyles, shinyTextStyles } from '@/styles';
|
|
10
|
+
|
|
11
|
+
import type { AddIdentityMemoryParams, AddIdentityMemoryState } from '../../../types';
|
|
12
|
+
|
|
13
|
+
const styles = createStaticStyles(({ css }) => ({
|
|
14
|
+
statusIcon: css`
|
|
15
|
+
margin-block-end: -2px;
|
|
16
|
+
margin-inline-start: 4px;
|
|
17
|
+
`,
|
|
18
|
+
}));
|
|
19
|
+
|
|
20
|
+
export const AddIdentityMemoryInspector = memo<
|
|
21
|
+
BuiltinInspectorProps<AddIdentityMemoryParams, AddIdentityMemoryState>
|
|
22
|
+
>(({ args, partialArgs, isArgumentsStreaming, isLoading, pluginState }) => {
|
|
23
|
+
const { t } = useTranslation('plugin');
|
|
24
|
+
|
|
25
|
+
const title = args?.title || partialArgs?.title;
|
|
26
|
+
|
|
27
|
+
// Initial streaming state
|
|
28
|
+
if (isArgumentsStreaming && !title) {
|
|
29
|
+
return (
|
|
30
|
+
<div className={cx(inspectorTextStyles.root, shinyTextStyles.shinyText)}>
|
|
31
|
+
<span>{t('builtins.lobe-user-memory.apiName.addIdentityMemory')}</span>
|
|
32
|
+
</div>
|
|
33
|
+
);
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
const isSuccess = pluginState?.memoryId;
|
|
37
|
+
|
|
38
|
+
return (
|
|
39
|
+
<div
|
|
40
|
+
className={cx(
|
|
41
|
+
inspectorTextStyles.root,
|
|
42
|
+
(isArgumentsStreaming || isLoading) && shinyTextStyles.shinyText,
|
|
43
|
+
)}
|
|
44
|
+
>
|
|
45
|
+
<span>{t('builtins.lobe-user-memory.apiName.addIdentityMemory')}</span>
|
|
46
|
+
{title && (
|
|
47
|
+
<>
|
|
48
|
+
: <span className={highlightTextStyles.primary}>{title}</span>
|
|
49
|
+
</>
|
|
50
|
+
)}
|
|
51
|
+
{!isLoading && isSuccess && (
|
|
52
|
+
<Check className={styles.statusIcon} color={cssVar.colorSuccess} size={14} />
|
|
53
|
+
)}
|
|
54
|
+
</div>
|
|
55
|
+
);
|
|
56
|
+
});
|
|
57
|
+
|
|
58
|
+
AddIdentityMemoryInspector.displayName = 'AddIdentityMemoryInspector';
|
|
59
|
+
|
|
60
|
+
export default AddIdentityMemoryInspector;
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
|
|
3
|
+
import type { BuiltinInspectorProps } from '@lobechat/types';
|
|
4
|
+
import { createStaticStyles, cssVar, cx } from 'antd-style';
|
|
5
|
+
import { Check } from 'lucide-react';
|
|
6
|
+
import { memo } from 'react';
|
|
7
|
+
import { useTranslation } from 'react-i18next';
|
|
8
|
+
|
|
9
|
+
import { highlightTextStyles, inspectorTextStyles, shinyTextStyles } from '@/styles';
|
|
10
|
+
|
|
11
|
+
import type { AddPreferenceMemoryParams, AddPreferenceMemoryState } from '../../../types';
|
|
12
|
+
|
|
13
|
+
const styles = createStaticStyles(({ css }) => ({
|
|
14
|
+
statusIcon: css`
|
|
15
|
+
margin-block-end: -2px;
|
|
16
|
+
margin-inline-start: 4px;
|
|
17
|
+
`,
|
|
18
|
+
}));
|
|
19
|
+
|
|
20
|
+
export const AddPreferenceMemoryInspector = memo<
|
|
21
|
+
BuiltinInspectorProps<AddPreferenceMemoryParams, AddPreferenceMemoryState>
|
|
22
|
+
>(({ args, partialArgs, isArgumentsStreaming, isLoading, pluginState }) => {
|
|
23
|
+
const { t } = useTranslation('plugin');
|
|
24
|
+
|
|
25
|
+
const title = args?.title || partialArgs?.title;
|
|
26
|
+
|
|
27
|
+
// Initial streaming state
|
|
28
|
+
if (isArgumentsStreaming && !title) {
|
|
29
|
+
return (
|
|
30
|
+
<div className={cx(inspectorTextStyles.root, shinyTextStyles.shinyText)}>
|
|
31
|
+
<span>{t('builtins.lobe-user-memory.apiName.addPreferenceMemory')}</span>
|
|
32
|
+
</div>
|
|
33
|
+
);
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
const isSuccess = pluginState?.memoryId;
|
|
37
|
+
|
|
38
|
+
return (
|
|
39
|
+
<div
|
|
40
|
+
className={cx(
|
|
41
|
+
inspectorTextStyles.root,
|
|
42
|
+
(isArgumentsStreaming || isLoading) && shinyTextStyles.shinyText,
|
|
43
|
+
)}
|
|
44
|
+
>
|
|
45
|
+
<span>{t('builtins.lobe-user-memory.apiName.addPreferenceMemory')}</span>
|
|
46
|
+
{title && (
|
|
47
|
+
<>
|
|
48
|
+
: <span className={highlightTextStyles.primary}>{title}</span>
|
|
49
|
+
</>
|
|
50
|
+
)}
|
|
51
|
+
{!isLoading && isSuccess && (
|
|
52
|
+
<Check className={styles.statusIcon} color={cssVar.colorSuccess} size={14} />
|
|
53
|
+
)}
|
|
54
|
+
</div>
|
|
55
|
+
);
|
|
56
|
+
});
|
|
57
|
+
|
|
58
|
+
AddPreferenceMemoryInspector.displayName = 'AddPreferenceMemoryInspector';
|
|
59
|
+
|
|
60
|
+
export default AddPreferenceMemoryInspector;
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
|
|
3
|
+
import type { BuiltinInspectorProps } from '@lobechat/types';
|
|
4
|
+
import { createStaticStyles, cssVar, cx } from 'antd-style';
|
|
5
|
+
import { Check } from 'lucide-react';
|
|
6
|
+
import { memo } from 'react';
|
|
7
|
+
import { useTranslation } from 'react-i18next';
|
|
8
|
+
|
|
9
|
+
import { highlightTextStyles, inspectorTextStyles, shinyTextStyles } from '@/styles';
|
|
10
|
+
|
|
11
|
+
import type { RemoveIdentityMemoryParams, RemoveIdentityMemoryState } from '../../../types';
|
|
12
|
+
|
|
13
|
+
const styles = createStaticStyles(({ css }) => ({
|
|
14
|
+
statusIcon: css`
|
|
15
|
+
margin-block-end: -2px;
|
|
16
|
+
margin-inline-start: 4px;
|
|
17
|
+
`,
|
|
18
|
+
}));
|
|
19
|
+
|
|
20
|
+
export const RemoveIdentityMemoryInspector = memo<
|
|
21
|
+
BuiltinInspectorProps<RemoveIdentityMemoryParams, RemoveIdentityMemoryState>
|
|
22
|
+
>(({ args, partialArgs, isArgumentsStreaming, isLoading, pluginState }) => {
|
|
23
|
+
const { t } = useTranslation('plugin');
|
|
24
|
+
|
|
25
|
+
const id = args?.id || partialArgs?.id;
|
|
26
|
+
|
|
27
|
+
// Initial streaming state
|
|
28
|
+
if (isArgumentsStreaming && !id) {
|
|
29
|
+
return (
|
|
30
|
+
<div className={cx(inspectorTextStyles.root, shinyTextStyles.shinyText)}>
|
|
31
|
+
<span>{t('builtins.lobe-user-memory.apiName.removeIdentityMemory')}</span>
|
|
32
|
+
</div>
|
|
33
|
+
);
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
const isSuccess = pluginState?.identityId;
|
|
37
|
+
|
|
38
|
+
return (
|
|
39
|
+
<div
|
|
40
|
+
className={cx(
|
|
41
|
+
inspectorTextStyles.root,
|
|
42
|
+
(isArgumentsStreaming || isLoading) && shinyTextStyles.shinyText,
|
|
43
|
+
)}
|
|
44
|
+
>
|
|
45
|
+
<span>{t('builtins.lobe-user-memory.apiName.removeIdentityMemory')}</span>
|
|
46
|
+
{id && (
|
|
47
|
+
<>
|
|
48
|
+
: <span className={highlightTextStyles.warning}>{id}</span>
|
|
49
|
+
</>
|
|
50
|
+
)}
|
|
51
|
+
{!isLoading && isSuccess && (
|
|
52
|
+
<Check className={styles.statusIcon} color={cssVar.colorSuccess} size={14} />
|
|
53
|
+
)}
|
|
54
|
+
</div>
|
|
55
|
+
);
|
|
56
|
+
});
|
|
57
|
+
|
|
58
|
+
RemoveIdentityMemoryInspector.displayName = 'RemoveIdentityMemoryInspector';
|
|
59
|
+
|
|
60
|
+
export default RemoveIdentityMemoryInspector;
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
|
|
3
|
+
import type { BuiltinInspectorProps } from '@lobechat/types';
|
|
4
|
+
import { Text } from '@lobehub/ui';
|
|
5
|
+
import { cssVar, cx } from 'antd-style';
|
|
6
|
+
import { memo } from 'react';
|
|
7
|
+
import { useTranslation } from 'react-i18next';
|
|
8
|
+
|
|
9
|
+
import { highlightTextStyles, inspectorTextStyles, shinyTextStyles } from '@/styles';
|
|
10
|
+
|
|
11
|
+
import type { SearchMemoryParams, SearchUserMemoryState } from '../../../types';
|
|
12
|
+
|
|
13
|
+
export const SearchUserMemoryInspector = memo<
|
|
14
|
+
BuiltinInspectorProps<SearchMemoryParams, SearchUserMemoryState>
|
|
15
|
+
>(({ args, partialArgs, isArgumentsStreaming, isLoading, pluginState }) => {
|
|
16
|
+
const { t } = useTranslation('plugin');
|
|
17
|
+
|
|
18
|
+
const query = args?.query || partialArgs?.query;
|
|
19
|
+
|
|
20
|
+
// Initial streaming state
|
|
21
|
+
if (isArgumentsStreaming && !query) {
|
|
22
|
+
return (
|
|
23
|
+
<div className={cx(inspectorTextStyles.root, shinyTextStyles.shinyText)}>
|
|
24
|
+
<span>{t('builtins.lobe-user-memory.apiName.searchUserMemory')}</span>
|
|
25
|
+
</div>
|
|
26
|
+
);
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
// pluginState is SearchMemoryResult directly (contexts, experiences, preferences)
|
|
30
|
+
const resultCount = pluginState
|
|
31
|
+
? (pluginState.contexts?.length ?? 0) +
|
|
32
|
+
(pluginState.experiences?.length ?? 0) +
|
|
33
|
+
(pluginState.preferences?.length ?? 0)
|
|
34
|
+
: 0;
|
|
35
|
+
const hasResults = resultCount > 0;
|
|
36
|
+
|
|
37
|
+
return (
|
|
38
|
+
<div
|
|
39
|
+
className={cx(
|
|
40
|
+
inspectorTextStyles.root,
|
|
41
|
+
(isArgumentsStreaming || isLoading) && shinyTextStyles.shinyText,
|
|
42
|
+
)}
|
|
43
|
+
>
|
|
44
|
+
<span>{t('builtins.lobe-user-memory.apiName.searchUserMemory')}: </span>
|
|
45
|
+
{query && <span className={highlightTextStyles.primary}>{query}</span>}
|
|
46
|
+
{!isLoading &&
|
|
47
|
+
!isArgumentsStreaming &&
|
|
48
|
+
pluginState &&
|
|
49
|
+
(hasResults ? (
|
|
50
|
+
<span style={{ marginInlineStart: 4 }}>({resultCount})</span>
|
|
51
|
+
) : (
|
|
52
|
+
<Text
|
|
53
|
+
as={'span'}
|
|
54
|
+
color={cssVar.colorTextDescription}
|
|
55
|
+
fontSize={12}
|
|
56
|
+
style={{ marginInlineStart: 4 }}
|
|
57
|
+
>
|
|
58
|
+
({t('builtins.lobe-user-memory.inspector.noResults')})
|
|
59
|
+
</Text>
|
|
60
|
+
))}
|
|
61
|
+
</div>
|
|
62
|
+
);
|
|
63
|
+
});
|
|
64
|
+
|
|
65
|
+
SearchUserMemoryInspector.displayName = 'SearchUserMemoryInspector';
|
|
66
|
+
|
|
67
|
+
export default SearchUserMemoryInspector;
|