cozy-search 2.8.4 → 2.9.0

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.
@@ -30,7 +30,7 @@ var AssistantDialogContent = function AssistantDialogContent(_ref) {
30
30
  case _useAssistantDialog.STEPS.BASIC_INFO:
31
31
  return /*#__PURE__*/_react.default.createElement(_BasicInfoStep.default, {
32
32
  name: formData.name,
33
- description: formData.description,
33
+ prompt: formData.prompt,
34
34
  icon: formData.icon,
35
35
  knowledgeBase: formData.knowledgeBase,
36
36
  onChange: onChange,
@@ -1,7 +1,7 @@
1
1
  export default BasicInfoStep;
2
- declare function BasicInfoStep({ name, description, icon, knowledgeBase, onChange, onAvatarChange, onKnowledgeBaseChange }: {
2
+ declare function BasicInfoStep({ name, prompt, icon, knowledgeBase, onChange, onAvatarChange, onKnowledgeBaseChange }: {
3
3
  name: any;
4
- description: any;
4
+ prompt: any;
5
5
  icon: any;
6
6
  knowledgeBase: any;
7
7
  onChange: any;
@@ -51,7 +51,7 @@ var styles = {
51
51
 
52
52
  var BasicInfoStep = function BasicInfoStep(_ref) {
53
53
  var name = _ref.name,
54
- description = _ref.description,
54
+ prompt = _ref.prompt,
55
55
  icon = _ref.icon,
56
56
  knowledgeBase = _ref.knowledgeBase,
57
57
  onChange = _ref.onChange,
@@ -161,13 +161,13 @@ var BasicInfoStep = function BasicInfoStep(_ref) {
161
161
  }, /*#__PURE__*/_react.default.createElement(_Typography.default, {
162
162
  variant: "h6",
163
163
  className: "u-mb-half"
164
- }, t('assistant_create.steps.basic_info.description_label')), /*#__PURE__*/_react.default.createElement(_TextField.default, {
164
+ }, t('assistant_create.steps.basic_info.prompt_label')), /*#__PURE__*/_react.default.createElement(_TextField.default, {
165
165
  fullWidth: true,
166
166
  multiline: true,
167
167
  rows: 6,
168
- placeholder: t('assistant_create.steps.basic_info.description_placeholder'),
169
- value: description,
170
- onChange: onChange('description'),
168
+ placeholder: t('assistant_create.steps.basic_info.prompt_placeholder'),
169
+ value: prompt,
170
+ onChange: onChange('prompt'),
171
171
  variant: "outlined"
172
172
  })), /*#__PURE__*/_react.default.createElement(_KnowledgeBaseSection.default, {
173
173
  knowledgeBase: knowledgeBase,
@@ -18,7 +18,7 @@ export function useAssistantDialog({ onClose, initialData }: {
18
18
  isPrototypeOf(v: Object): boolean;
19
19
  propertyIsEnumerable(v: PropertyKey): boolean;
20
20
  name: string;
21
- description: string;
21
+ prompt: string;
22
22
  icon: null;
23
23
  model: string;
24
24
  baseUrl: string;
@@ -34,7 +34,7 @@ export function useAssistantDialog({ onClose, initialData }: {
34
34
  isPrototypeOf(v: Object): boolean;
35
35
  propertyIsEnumerable(v: PropertyKey): boolean;
36
36
  name: string;
37
- description: string;
37
+ prompt: string;
38
38
  icon: null;
39
39
  model: string;
40
40
  baseUrl: string;
@@ -72,7 +72,7 @@ var useAssistantDialog = function useAssistantDialog(_ref) {
72
72
 
73
73
  var _useState5 = (0, _react.useState)(_objectSpread({
74
74
  name: '',
75
- description: '',
75
+ prompt: '',
76
76
  icon: null,
77
77
  model: '',
78
78
  baseUrl: '',
@@ -15,6 +15,8 @@ var _Alert = _interopRequireDefault(require("cozy-ui/transpiled/react/Alert"));
15
15
 
16
16
  var _twakeI18n = require("twake-i18n");
17
17
 
18
+ var _AssistantMessageActions = _interopRequireDefault(require("./AssistantMessageActions"));
19
+
18
20
  var _MarkdownText = _interopRequireDefault(require("./MarkdownText"));
19
21
 
20
22
  var _Sources = _interopRequireDefault(require("../Conversations/Sources/Sources"));
@@ -80,6 +82,8 @@ var AssistantMessage = function AssistantMessage() {
80
82
  }), (sources === null || sources === void 0 ? void 0 : sources.length) > 0 && /*#__PURE__*/_react2.default.createElement(_Sources.default, {
81
83
  messageId: messageId,
82
84
  sources: sources
85
+ }), !isThinking && /*#__PURE__*/_react2.default.createElement(_AssistantMessageActions.default, {
86
+ canCopy: !isError
83
87
  }));
84
88
  };
85
89
 
@@ -0,0 +1,4 @@
1
+ export default AssistantMessageActions;
2
+ declare function AssistantMessageActions({ canCopy }: {
3
+ canCopy: any;
4
+ }): JSX.Element;
@@ -0,0 +1,61 @@
1
+ "use strict";
2
+
3
+ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
4
+
5
+ Object.defineProperty(exports, "__esModule", {
6
+ value: true
7
+ });
8
+ exports.default = void 0;
9
+
10
+ var _react = require("@assistant-ui/react");
11
+
12
+ var _react2 = _interopRequireDefault(require("react"));
13
+
14
+ var _twakeIcons = require("@linagora/twake-icons");
15
+
16
+ var _IconButton = _interopRequireDefault(require("cozy-ui/transpiled/react/IconButton"));
17
+
18
+ var _twakeI18n = require("twake-i18n");
19
+
20
+ var ICON_SIZE = 16;
21
+
22
+ var AssistantMessageActions = function AssistantMessageActions(_ref) {
23
+ var canCopy = _ref.canCopy;
24
+
25
+ var _useI18n = (0, _twakeI18n.useI18n)(),
26
+ t = _useI18n.t;
27
+
28
+ var isCopied = (0, _react.useAuiState)(function (_ref2) {
29
+ var message = _ref2.message;
30
+ return message.isCopied;
31
+ }); // The stack keeps a single thread per conversation: regenerating an
32
+ // older answer would drop the following messages on screen only.
33
+
34
+ var isLast = (0, _react.useAuiState)(function (_ref3) {
35
+ var message = _ref3.message;
36
+ return message.isLast;
37
+ });
38
+ return /*#__PURE__*/_react2.default.createElement(_react.ActionBarPrimitive.Root, {
39
+ hideWhenRunning: true,
40
+ className: "u-flex u-flex-items-center u-mt-half"
41
+ }, canCopy && /*#__PURE__*/_react2.default.createElement(_react.ActionBarPrimitive.Copy, {
42
+ asChild: true
43
+ }, /*#__PURE__*/_react2.default.createElement(_IconButton.default, {
44
+ size: "small",
45
+ "aria-label": t(isCopied ? 'assistant.actions.copied' : 'assistant.actions.copy')
46
+ }, /*#__PURE__*/_react2.default.createElement(_twakeIcons.Icon, {
47
+ icon: isCopied ? _twakeIcons.Check : _twakeIcons.Copy,
48
+ size: ICON_SIZE
49
+ }))), isLast && /*#__PURE__*/_react2.default.createElement(_react.ActionBarPrimitive.Reload, {
50
+ asChild: true
51
+ }, /*#__PURE__*/_react2.default.createElement(_IconButton.default, {
52
+ size: "small",
53
+ "aria-label": t('assistant.actions.reload')
54
+ }, /*#__PURE__*/_react2.default.createElement(_twakeIcons.Icon, {
55
+ icon: _twakeIcons.Restore,
56
+ size: ICON_SIZE
57
+ }))));
58
+ };
59
+
60
+ var _default = AssistantMessageActions;
61
+ exports.default = _default;
@@ -126,7 +126,7 @@ var CreateAssistantDialog = function CreateAssistantDialog(_ref) {
126
126
  _context.next = 2;
127
127
  return (0, _assistant.createAssistant)(client, {
128
128
  name: formData.name,
129
- prompt: formData.description,
129
+ prompt: formData.prompt,
130
130
  icon: formData.icon,
131
131
  model: formData.model,
132
132
  apiKey: formData.apiKey,
@@ -143,7 +143,7 @@ var EditAssistantDialog = function EditAssistantDialog(_ref) {
143
143
  model = (provider === null || provider === void 0 ? void 0 : (_provider$data = provider.data) === null || _provider$data === void 0 ? void 0 : _provider$data.model) || (provider === null || provider === void 0 ? void 0 : (_provider$auth = provider.auth) === null || _provider$auth === void 0 ? void 0 : _provider$auth.login);
144
144
  setFormData({
145
145
  name: assistant.name || '',
146
- description: assistant.prompt || '',
146
+ prompt: assistant.prompt || '',
147
147
  icon: assistant.icon || '',
148
148
  model: model || '',
149
149
  baseUrl: (provider === null || provider === void 0 ? void 0 : (_provider$data2 = provider.data) === null || _provider$data2 === void 0 ? void 0 : _provider$data2.baseUrl) || '',
@@ -192,7 +192,7 @@ var EditAssistantDialog = function EditAssistantDialog(_ref) {
192
192
  _context2.next = 2;
193
193
  return (0, _assistant.editAssistant)(client, assistantIdInAction, {
194
194
  name: formData.name,
195
- prompt: formData.description,
195
+ prompt: formData.prompt,
196
196
  icon: formData.icon,
197
197
  model: formData.model,
198
198
  apiKey: formData.apiKey,
@@ -91,8 +91,8 @@
91
91
  "upload_photo": "Upload a photo",
92
92
  "name": "Name",
93
93
  "name_placeholder": "Name your agent",
94
- "description_label": "Description",
95
- "description_placeholder": "Optional description of this agent's role. This description will not be used by the AI",
94
+ "prompt_label": "Instructions",
95
+ "prompt_placeholder": "Set the context and customize the assistant's responses",
96
96
  "knowledge_base": "Knowledge Base (optional)",
97
97
  "knowledge_base_placeholder": "Conversations may reveal some or all of the files that have been uploaded.",
98
98
  "from_drive": "From Drive",
@@ -91,8 +91,8 @@
91
91
  "upload_photo": "Importer une photo",
92
92
  "name": "Nom",
93
93
  "name_placeholder": "Nommez votre agent",
94
- "description_label": "Description",
95
- "description_placeholder": "Description optionnelle du rôle de cet agent. Cette description ne sera pas utilisée par l'IA",
94
+ "prompt_label": "Instructions",
95
+ "prompt_placeholder": "Définir le contexte et personnaliser les réponses de l'assistant",
96
96
  "knowledge_base": "Base de connaissances (optionnel)",
97
97
  "knowledge_base_placeholder": "Les conversations peuvent révéler une partie ou l'intégralité des fichiers qui ont été téléversés.",
98
98
  "from_drive": "Depuis Drive",
@@ -97,8 +97,8 @@ var en = {
97
97
  upload_photo: "Upload a photo",
98
98
  name: "Name",
99
99
  name_placeholder: "Name your agent",
100
- description_label: "Description",
101
- description_placeholder: "Optional description of this agent's role. This description will not be used by the AI",
100
+ prompt_label: "Instructions",
101
+ prompt_placeholder: "Set the context and customize the assistant's responses",
102
102
  knowledge_base: "Knowledge Base (optional)",
103
103
  knowledge_base_placeholder: "Conversations may reveal some or all of the files that have been uploaded.",
104
104
  from_drive: "From Drive",
@@ -285,8 +285,8 @@ var fr = {
285
285
  upload_photo: "Importer une photo",
286
286
  name: "Nom",
287
287
  name_placeholder: "Nommez votre agent",
288
- description_label: "Description",
289
- description_placeholder: "Description optionnelle du r\xF4le de cet agent. Cette description ne sera pas utilis\xE9e par l'IA",
288
+ prompt_label: "Instructions",
289
+ prompt_placeholder: "D\xE9finir le contexte et personnaliser les r\xE9ponses de l'assistant",
290
290
  knowledge_base: "Base de connaissances (optionnel)",
291
291
  knowledge_base_placeholder: "Les conversations peuvent r\xE9v\xE9ler une partie ou l'int\xE9gralit\xE9 des fichiers qui ont \xE9t\xE9 t\xE9l\xE9vers\xE9s.",
292
292
  from_drive: "Depuis Drive",
@@ -490,8 +490,8 @@ var ru = {
490
490
  upload_photo: "\u0417\u0430\u0433\u0440\u0443\u0437\u0438\u0442\u044C \u0444\u043E\u0442\u043E",
491
491
  name: "\u0418\u043C\u044F",
492
492
  name_placeholder: "\u041D\u0430\u0437\u043E\u0432\u0438\u0442\u0435 \u0432\u0430\u0448\u0435\u0433\u043E \u0430\u0433\u0435\u043D\u0442\u0430",
493
- description_label: "\u041E\u043F\u0438\u0441\u0430\u043D\u0438\u0435",
494
- description_placeholder: "\u041D\u0435\u043E\u0431\u044F\u0437\u0430\u0442\u0435\u043B\u044C\u043D\u043E\u0435 \u043E\u043F\u0438\u0441\u0430\u043D\u0438\u0435 \u0440\u043E\u043B\u0438 \u044D\u0442\u043E\u0433\u043E \u0430\u0433\u0435\u043D\u0442\u0430. \u042D\u0442\u043E \u043E\u043F\u0438\u0441\u0430\u043D\u0438\u0435 \u043D\u0435 \u0431\u0443\u0434\u0435\u0442 \u0438\u0441\u043F\u043E\u043B\u044C\u0437\u043E\u0432\u0430\u0442\u044C\u0441\u044F \u0418\u0418",
493
+ prompt_label: "\u0418\u043D\u0441\u0442\u0440\u0443\u043A\u0446\u0438\u0438",
494
+ prompt_placeholder: "\u0417\u0430\u0434\u0430\u0439\u0442\u0435 \u043A\u043E\u043D\u0442\u0435\u043A\u0441\u0442 \u0438 \u043D\u0430\u0441\u0442\u0440\u043E\u0439\u0442\u0435 \u043E\u0442\u0432\u0435\u0442\u044B \u0430\u0441\u0441\u0438\u0441\u0442\u0435\u043D\u0442\u0430",
495
495
  knowledge_base: "\u0411\u0430\u0437\u0430 \u0437\u043D\u0430\u043D\u0438\u0439 (\u043D\u0435\u043E\u0431\u044F\u0437\u0430\u0442\u0435\u043B\u044C\u043D\u043E)",
496
496
  knowledge_base_placeholder: "\u0412 \u0445\u043E\u0434\u0435 \u0440\u0430\u0437\u0433\u043E\u0432\u043E\u0440\u043E\u0432 \u043C\u043E\u0433\u0443\u0442 \u0431\u044B\u0442\u044C \u0440\u0430\u0441\u043A\u0440\u044B\u0442\u044B \u043D\u0435\u043A\u043E\u0442\u043E\u0440\u044B\u0435 \u0438\u043B\u0438 \u0432\u0441\u0435 \u0437\u0430\u0433\u0440\u0443\u0436\u0435\u043D\u043D\u044B\u0435 \u0444\u0430\u0439\u043B\u044B.",
497
497
  from_drive: "\u0418\u0437 Drive",
@@ -695,8 +695,8 @@ var vi = {
695
695
  upload_photo: "T\u1EA3i \u1EA3nh l\xEAn",
696
696
  name: "T\xEAn",
697
697
  name_placeholder: "\u0110\u1EB7t t\xEAn cho t\xE1c nh\xE2n c\u1EE7a b\u1EA1n",
698
- description_label: "M\xF4 t\u1EA3",
699
- description_placeholder: "M\xF4 t\u1EA3 t\xF9y ch\u1ECDn v\u1EC1 vai tr\xF2 c\u1EE7a t\xE1c nh\xE2n n\xE0y. M\xF4 t\u1EA3 n\xE0y s\u1EBD kh\xF4ng \u0111\u01B0\u1EE3c AI s\u1EED d\u1EE5ng",
698
+ prompt_label: "H\u01B0\u1EDBng d\u1EABn",
699
+ prompt_placeholder: "X\xE1c \u0111\u1ECBnh ng\u1EEF c\u1EA3nh v\xE0 t\xF9y ch\u1EC9nh c\xE2u tr\u1EA3 l\u1EDDi c\u1EE7a tr\u1EE3 l\xFD",
700
700
  knowledge_base: "C\u01A1 s\u1EDF tri th\u1EE9c (t\xF9y ch\u1ECDn)",
701
701
  knowledge_base_placeholder: "C\xE1c cu\u1ED9c tr\xF2 chuy\u1EC7n c\xF3 th\u1EC3 l\xE0m l\u1ED9 m\u1ED9t ph\u1EA7n ho\u1EB7c to\xE0n b\u1ED9 c\xE1c t\u1EC7p \u0111\xE3 \u0111\u01B0\u1EE3c t\u1EA3i l\xEAn.",
702
702
  from_drive: "T\u1EEB Drive",
@@ -108,8 +108,8 @@
108
108
  "upload_photo": "Загрузить фото",
109
109
  "name": "Имя",
110
110
  "name_placeholder": "Назовите вашего агента",
111
- "description_label": "Описание",
112
- "description_placeholder": "Необязательное описание роли этого агента. Это описание не будет использоваться ИИ",
111
+ "prompt_label": "Инструкции",
112
+ "prompt_placeholder": "Задайте контекст и настройте ответы ассистента",
113
113
  "knowledge_base": "База знаний (необязательно)",
114
114
  "knowledge_base_placeholder": "В ходе разговоров могут быть раскрыты некоторые или все загруженные файлы.",
115
115
  "from_drive": "Из Drive",
@@ -108,8 +108,8 @@
108
108
  "upload_photo": "Tải ảnh lên",
109
109
  "name": "Tên",
110
110
  "name_placeholder": "Đặt tên cho tác nhân của bạn",
111
- "description_label": "Mô tả",
112
- "description_placeholder": "Mô tả tùy chọn về vai trò của tác nhân này. Mô tả này sẽ không được AI sử dụng",
111
+ "prompt_label": "Hướng dẫn",
112
+ "prompt_placeholder": "Xác định ngữ cảnh và tùy chỉnh câu trả lời của trợ lý",
113
113
  "knowledge_base": "Cơ sở tri thức (tùy chọn)",
114
114
  "knowledge_base_placeholder": "Các cuộc trò chuyện có thể làm lộ một phần hoặc toàn bộ các tệp đã được tải lên.",
115
115
  "from_drive": "Từ Drive",
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "cozy-search",
3
3
  "description": "UI components about search bar and IA assistant",
4
- "version": "2.8.4",
4
+ "version": "2.9.0",
5
5
  "author": {
6
6
  "name": "Cozy Cloud",
7
7
  "url": "https://github.com/cozy"
@@ -96,5 +96,5 @@
96
96
  "lint": "cd .. && yarn eslint --ext js,jsx,ts packages/cozy-search"
97
97
  },
98
98
  "types": "dist/index.d.ts",
99
- "gitHead": "cc0ea29a44cb605a2e5fa083c253153e51d4d4c4"
99
+ "gitHead": "f1f39e6b31133a31170017660eebe08c96b739c0"
100
100
  }