@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.
Files changed (132) hide show
  1. package/CHANGELOG.md +50 -0
  2. package/changelog/v1.json +18 -0
  3. package/locales/en-US/plugin.json +4 -0
  4. package/locales/zh-CN/plugin.json +4 -0
  5. package/package.json +2 -2
  6. package/packages/agent-runtime/src/core/__tests__/runtime.test.ts +5 -5
  7. package/packages/agent-runtime/src/utils/stepContextComputer.test.ts +5 -5
  8. package/packages/builtin-tool-gtd/src/client/Inspector/index.ts +0 -4
  9. package/packages/builtin-tool-gtd/src/client/Intervention/AddTodo.tsx +1 -1
  10. package/packages/builtin-tool-gtd/src/client/Render/TodoList/index.tsx +39 -10
  11. package/packages/builtin-tool-gtd/src/client/Render/index.ts +0 -2
  12. package/packages/builtin-tool-gtd/src/client/components/SortableTodoList/TodoItemRow.tsx +26 -12
  13. package/packages/builtin-tool-gtd/src/client/components/SortableTodoList/store/actions.ts +5 -5
  14. package/packages/builtin-tool-gtd/src/client/components/SortableTodoList/store/store.test.ts +14 -8
  15. package/packages/builtin-tool-gtd/src/executor/index.test.ts +48 -227
  16. package/packages/builtin-tool-gtd/src/executor/index.ts +15 -158
  17. package/packages/builtin-tool-gtd/src/manifest.ts +12 -42
  18. package/packages/builtin-tool-gtd/src/systemRole.ts +14 -8
  19. package/packages/builtin-tool-gtd/src/types.ts +47 -41
  20. package/packages/builtin-tool-memory/package.json +8 -0
  21. package/packages/builtin-tool-memory/src/client/Inspector/AddContextMemory/index.tsx +60 -0
  22. package/packages/builtin-tool-memory/src/client/Inspector/AddExperienceMemory/index.tsx +60 -0
  23. package/packages/builtin-tool-memory/src/client/Inspector/AddIdentityMemory/index.tsx +60 -0
  24. package/packages/builtin-tool-memory/src/client/Inspector/AddPreferenceMemory/index.tsx +60 -0
  25. package/packages/builtin-tool-memory/src/client/Inspector/RemoveIdentityMemory/index.tsx +60 -0
  26. package/packages/builtin-tool-memory/src/client/Inspector/SearchUserMemory/index.tsx +67 -0
  27. package/packages/builtin-tool-memory/src/client/Inspector/UpdateIdentityMemory/index.tsx +60 -0
  28. package/packages/builtin-tool-memory/src/client/Inspector/index.ts +35 -0
  29. package/packages/builtin-tool-memory/src/client/Intervention/AddExperienceMemory/index.tsx +17 -0
  30. package/packages/builtin-tool-memory/src/client/Intervention/index.ts +13 -0
  31. package/packages/builtin-tool-memory/src/client/Render/AddExperienceMemory/index.tsx +17 -0
  32. package/packages/builtin-tool-memory/src/client/Render/SearchUserMemory/index.tsx +217 -0
  33. package/packages/builtin-tool-memory/src/client/Render/index.ts +15 -0
  34. package/packages/builtin-tool-memory/src/client/Streaming/AddExperienceMemory/index.tsx +17 -0
  35. package/packages/builtin-tool-memory/src/client/Streaming/index.ts +18 -0
  36. package/packages/builtin-tool-memory/src/client/components/ExperienceMemoryCard.tsx +231 -0
  37. package/packages/builtin-tool-memory/src/client/components/index.ts +1 -0
  38. package/packages/builtin-tool-memory/src/client/index.ts +27 -0
  39. package/packages/builtin-tool-memory/src/executor/index.ts +9 -1
  40. package/packages/builtin-tool-memory/src/types.ts +61 -0
  41. package/packages/context-engine/src/providers/GTDTodoInjector.ts +15 -7
  42. package/packages/conversation-flow/src/__tests__/fixtures/outputs/assistantGroup/tools-with-branches.json +4 -0
  43. package/packages/conversation-flow/src/transformation/FlatListBuilder.ts +1 -0
  44. package/packages/prompts/src/prompts/gtd/index.test.ts +32 -16
  45. package/packages/prompts/src/prompts/gtd/index.ts +9 -5
  46. package/packages/types/package.json +1 -1
  47. package/packages/types/src/discover/assistants.ts +4 -0
  48. package/packages/types/src/discover/groupAgents.ts +196 -0
  49. package/packages/types/src/discover/index.ts +5 -1
  50. package/packages/types/src/stepContext.ts +4 -1
  51. package/src/app/[variants]/(main)/community/(detail)/assistant/features/Details/Versions/index.tsx +2 -2
  52. package/src/app/[variants]/(main)/community/(detail)/group_agent/features/DetailProvider.tsx +19 -0
  53. package/src/app/[variants]/(main)/community/(detail)/group_agent/features/Details/Members/index.tsx +137 -0
  54. package/src/app/[variants]/(main)/community/(detail)/group_agent/features/Details/Nav.tsx +88 -0
  55. package/src/app/[variants]/(main)/community/(detail)/group_agent/features/Details/Overview/index.tsx +213 -0
  56. package/src/app/[variants]/(main)/community/(detail)/group_agent/features/Details/Related/index.tsx +85 -0
  57. package/src/app/[variants]/(main)/community/(detail)/group_agent/features/Details/SystemRole/TagList.tsx +20 -0
  58. package/src/app/[variants]/(main)/community/(detail)/group_agent/features/Details/SystemRole/index.tsx +71 -0
  59. package/src/app/[variants]/(main)/community/(detail)/group_agent/features/Details/Versions/index.tsx +119 -0
  60. package/src/app/[variants]/(main)/community/(detail)/group_agent/features/Details/index.tsx +51 -0
  61. package/src/app/[variants]/(main)/community/(detail)/group_agent/features/Header.tsx +253 -0
  62. package/src/app/[variants]/(main)/community/(detail)/group_agent/features/Sidebar/ActionButton/AddGroupAgent.tsx +222 -0
  63. package/src/app/[variants]/(main)/community/(detail)/group_agent/features/Sidebar/ActionButton/index.tsx +34 -0
  64. package/src/app/[variants]/(main)/community/(detail)/group_agent/features/Sidebar/Summary/index.tsx +42 -0
  65. package/src/app/[variants]/(main)/community/(detail)/group_agent/features/Sidebar/index.tsx +41 -0
  66. package/src/app/[variants]/(main)/community/(detail)/group_agent/features/StatusPage/index.tsx +104 -0
  67. package/src/app/[variants]/(main)/community/(detail)/group_agent/index.tsx +103 -0
  68. package/src/app/[variants]/(main)/community/(detail)/group_agent/loading.tsx +1 -0
  69. package/src/app/[variants]/(main)/community/(detail)/user/features/DetailProvider.tsx +7 -1
  70. package/src/app/[variants]/(main)/community/(detail)/user/features/UserContent.tsx +2 -0
  71. package/src/app/[variants]/(main)/community/(detail)/user/features/UserGroupCard.tsx +186 -0
  72. package/src/app/[variants]/(main)/community/(detail)/user/features/UserGroupList.tsx +59 -0
  73. package/src/app/[variants]/(main)/community/(detail)/user/index.tsx +3 -1
  74. package/src/app/[variants]/(main)/community/(list)/assistant/features/List/Item.tsx +26 -8
  75. package/src/app/[variants]/(main)/community/(list)/assistant/index.tsx +1 -0
  76. package/src/app/[variants]/(main)/community/features/Search.tsx +1 -1
  77. package/src/app/[variants]/(main)/group/profile/features/GroupProfile/index.tsx +2 -0
  78. package/src/app/[variants]/(main)/group/profile/features/Header/AgentPublishButton/PublishResultModal.tsx +2 -1
  79. package/src/app/[variants]/(main)/group/profile/features/Header/GroupPublishButton/GroupForkConfirmModal.tsx +60 -0
  80. package/src/app/[variants]/(main)/group/profile/features/Header/GroupPublishButton/GroupPublishResultModal.tsx +62 -0
  81. package/src/app/[variants]/(main)/group/profile/features/Header/GroupPublishButton/PublishButton.tsx +122 -0
  82. package/src/app/[variants]/(main)/group/profile/features/Header/GroupPublishButton/index.tsx +46 -0
  83. package/src/app/[variants]/(main)/group/profile/features/Header/GroupPublishButton/types.ts +12 -0
  84. package/src/app/[variants]/(main)/group/profile/features/Header/GroupPublishButton/useMarketGroupPublish.ts +211 -0
  85. package/src/app/[variants]/(main)/group/profile/features/Header/GroupPublishButton/utils.ts +22 -0
  86. package/src/app/[variants]/(main)/resource/features/DndContextWrapper.tsx +4 -2
  87. package/src/app/[variants]/(main)/resource/library/_layout/Header/LibraryHead.tsx +30 -35
  88. package/src/app/[variants]/(main)/resource/library/_layout/Header/index.tsx +9 -11
  89. package/src/app/[variants]/router/desktopRouter.config.tsx +7 -0
  90. package/src/features/Conversation/Messages/AssistantGroup/Tool/Actions/index.tsx +11 -17
  91. package/src/features/Conversation/Messages/AssistantGroup/Tool/{Render → Detail}/LoadingPlaceholder/index.tsx +13 -3
  92. package/src/features/Conversation/Messages/AssistantGroup/Tool/Detail/Render/CustomRender.tsx +43 -0
  93. package/src/features/Conversation/Messages/AssistantGroup/Tool/Detail/Render/FallbacktArgumentRender.tsx +59 -0
  94. package/src/features/Conversation/Messages/AssistantGroup/Tool/Detail/Render/index.tsx +46 -0
  95. package/src/features/Conversation/Messages/AssistantGroup/Tool/{Render → Detail}/index.tsx +13 -19
  96. package/src/features/Conversation/Messages/AssistantGroup/Tool/index.tsx +17 -17
  97. package/src/features/Conversation/Messages/Tool/Tool/index.tsx +10 -9
  98. package/src/features/Conversation/TodoProgress/index.tsx +56 -23
  99. package/src/features/PluginsUI/Render/MCPType/index.tsx +1 -1
  100. package/src/features/ResourceManager/components/Explorer/Header/index.tsx +57 -4
  101. package/src/features/ResourceManager/components/Explorer/ListView/ListItem/index.tsx +6 -4
  102. package/src/features/ResourceManager/components/Explorer/ListView/index.tsx +16 -5
  103. package/src/features/ResourceManager/components/LibraryHierarchy/styles.ts +5 -4
  104. package/src/hooks/useActiveTabKey.ts +1 -2
  105. package/src/locales/default/plugin.ts +1 -0
  106. package/src/locales/default/setting.ts +12 -0
  107. package/src/server/routers/lambda/market/agentGroup.ts +296 -0
  108. package/src/server/routers/lambda/market/index.ts +134 -4
  109. package/src/server/services/discover/index.ts +123 -7
  110. package/src/services/discover.ts +55 -0
  111. package/src/store/chat/slices/message/selectors/dbMessage.test.ts +11 -11
  112. package/src/store/discover/slices/groupAgent/action.ts +80 -0
  113. package/src/store/discover/store.ts +3 -0
  114. package/src/store/file/slices/resource/action.ts +4 -2
  115. package/src/tools/inspectors.ts +2 -0
  116. package/src/tools/interventions.ts +2 -0
  117. package/src/tools/renders.ts +3 -1
  118. package/src/tools/streamings.ts +2 -0
  119. package/packages/builtin-tool-gtd/src/client/Inspector/CompleteTodos/index.tsx +0 -52
  120. package/packages/builtin-tool-gtd/src/client/Inspector/RemoveTodos/index.tsx +0 -52
  121. package/src/features/Conversation/Messages/AssistantGroup/Tool/Render/CustomRender.tsx +0 -113
  122. package/src/features/Conversation/Messages/Tool/Tool/Render.tsx +0 -47
  123. /package/src/features/Conversation/Messages/AssistantGroup/Tool/{Render → Detail}/AbortResponse.tsx +0 -0
  124. /package/src/features/Conversation/Messages/AssistantGroup/Tool/{Render → Detail}/Arguments/index.tsx +0 -0
  125. /package/src/features/Conversation/Messages/AssistantGroup/Tool/{Render → Detail}/ErrorResponse.tsx +0 -0
  126. /package/src/features/Conversation/Messages/AssistantGroup/Tool/{Render → Detail}/Intervention/ApprovalActions.tsx +0 -0
  127. /package/src/features/Conversation/Messages/AssistantGroup/Tool/{Render → Detail}/Intervention/Fallback.tsx +0 -0
  128. /package/src/features/Conversation/Messages/AssistantGroup/Tool/{Render → Detail}/Intervention/KeyValueEditor.tsx +0 -0
  129. /package/src/features/Conversation/Messages/AssistantGroup/Tool/{Render → Detail}/Intervention/ModeSelector.tsx +0 -0
  130. /package/src/features/Conversation/Messages/AssistantGroup/Tool/{Render → Detail}/Intervention/index.tsx +0 -0
  131. /package/src/features/Conversation/Messages/AssistantGroup/Tool/{Render → Detail}/PluginSettings.tsx +0 -0
  132. /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 "completed"
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/completed, "remove" and "complete" need index only.',
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
- completed: {
119
- description: 'Optional for "update" only: set completed status.',
120
- type: 'boolean',
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/completed
111
+ - \`{ "type": "update", "index": 0, "newText": "..." }\` - type + index + optional newText/status
106
112
 
107
- **Example - mark items 0 and 1 as complete:**
113
+ **Example - mark item 0 as processing, item 1 as complete:**
108
114
  \`\`\`json
109
115
  {
110
116
  "operations": [
111
- { "type": "complete", "index": 0 },
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 \`"completed": true\` for complete operations - they are ignored.
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
- /** Mark todo items as done by indices */
18
- completeTodos: 'completeTodos',
19
-
17
+
20
18
  // ==================== Planning ====================
21
- /** Create a structured plan by breaking down a goal into actionable steps */
22
- createPlan: 'createPlan',
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
- // ==================== Async Tasks ====================
28
- /** Execute a single async task */
29
- execTask: 'execTask',
39
+ /** Execute one or more async tasks */
40
+ execTasks: 'execTasks',
30
41
 
31
- /** Execute one or more async tasks */
32
- execTasks: 'execTasks',
42
+
43
+
44
+
33
45
 
34
- /** Remove todo items by indices */
35
- removeTodos: 'removeTodos',
36
46
 
37
- /** Update an existing plan */
38
- updatePlan: 'updatePlan',
47
+ /** Update an existing plan */
48
+ updatePlan: 'updatePlan',
39
49
 
40
- /** Update todo items with batch operations (add, update, remove, complete) */
41
- updateTodos: 'updateTodos',
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
- /** Whether the item is completed */
50
- completed: boolean;
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 new completed status */
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;