@ykurilov/agent-chat-core 0.95.2 → 0.96.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.
- package/CHANGELOG.md +10 -0
- package/README.md +9 -0
- package/dist/{chunk-J4S522IU.js → chunk-THL3LUXH.js} +17 -1
- package/dist/chunk-THL3LUXH.js.map +1 -0
- package/dist/index.js +1 -1
- package/dist/storage-contract.js +1 -1
- package/dist/types/attachments/message-attachments.d.ts +7 -0
- package/package.json +1 -1
- package/dist/chunk-J4S522IU.js.map +0 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,15 @@
|
|
|
1
1
|
# @ykurilov/agent-chat-core
|
|
2
2
|
|
|
3
|
+
## 0.96.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- c6be487: Server file drafts and a public composer helper for app panel parts; custom Oduvanchik add menus and non-file drop propagation; background notification after a new user message with attachments is stored. Existing integrations remain compatible.
|
|
8
|
+
|
|
9
|
+
## 0.95.3
|
|
10
|
+
|
|
11
|
+
No changes in this release.
|
|
12
|
+
|
|
3
13
|
## 0.95.2
|
|
4
14
|
|
|
5
15
|
No changes in this release.
|
package/README.md
CHANGED
|
@@ -161,3 +161,12 @@ docs/getting-started.md, «Значки шагов и заголовки раз
|
|
|
161
161
|
считают все виды вместе; отчёт по одному виду — `sumUsage({ source })`.
|
|
162
162
|
|
|
163
163
|
Контракты интеграции приложения: [HTTP-приветствие, текущий вопрос, номера фото, метаданные и тесты](https://github.com/ykurilov/agent-chat-sdk/blob/main/docs/app-chat-contracts.md).
|
|
164
|
+
|
|
165
|
+
## Уведомление о записанном сообщении с файлами
|
|
166
|
+
|
|
167
|
+
С 0.96.0 необязательный `MessageAttachments.userMessageStored({ userId, chatId, messageId, parts })`
|
|
168
|
+
вызывается после успешной вставки новой реплики человека, в том числе пачки мессенджера и поправки.
|
|
169
|
+
Редактирование, импорт, повтор и ошибка вставки уведомления не создают. Служба не ждёт Promise;
|
|
170
|
+
ошибка попадает в `logError(message, error)` и не отменяет запись. Встроенный плагин предоставляет
|
|
171
|
+
приложению `createAttachments.onFilesAttached` с проверенными записями `StoredAttachment[]`.
|
|
172
|
+
Это фоновое уведомление без долговечной очереди. [Контракт](../../docs/composer-attachments.md).
|
|
@@ -13454,6 +13454,20 @@ function createChatService(input) {
|
|
|
13454
13454
|
if (fileParts.length === 0) return;
|
|
13455
13455
|
await options2.attachments.confirmUserParts(fileParts);
|
|
13456
13456
|
}
|
|
13457
|
+
function filesStored(userId, chatId, messageId, parts) {
|
|
13458
|
+
if (!parts.length || !options2.attachments?.userMessageStored) return;
|
|
13459
|
+
const failed = (error) => {
|
|
13460
|
+
try {
|
|
13461
|
+
logError(`\u0423\u0432\u0435\u0434\u043E\u043C\u043B\u0435\u043D\u0438\u0435 \u043E \u0444\u0430\u0439\u043B\u0430\u0445 \u0441\u043E\u043E\u0431\u0449\u0435\u043D\u0438\u044F \u043D\u0435 \u0432\u044B\u043F\u043E\u043B\u043D\u0435\u043D\u043E: ${String(error)}`, error);
|
|
13462
|
+
} catch {
|
|
13463
|
+
}
|
|
13464
|
+
};
|
|
13465
|
+
try {
|
|
13466
|
+
void Promise.resolve(options2.attachments.userMessageStored({ userId, chatId, messageId, parts })).catch(failed);
|
|
13467
|
+
} catch (error) {
|
|
13468
|
+
failed(error);
|
|
13469
|
+
}
|
|
13470
|
+
}
|
|
13457
13471
|
async function ownChat(userId, chatId) {
|
|
13458
13472
|
const chat = await storage.getChat(chatId);
|
|
13459
13473
|
if (!chat || chat.ownerId !== userId) throw new ChatNotFoundError(chatId);
|
|
@@ -14204,6 +14218,7 @@ function createChatService(input) {
|
|
|
14204
14218
|
});
|
|
14205
14219
|
await confirmFiles(fileParts);
|
|
14206
14220
|
await storage.insertMessage(question3);
|
|
14221
|
+
filesStored(userId, chatId, question3.id, fileParts);
|
|
14207
14222
|
return question3;
|
|
14208
14223
|
});
|
|
14209
14224
|
await closeUnansweredHumanInput(branch);
|
|
@@ -14453,6 +14468,7 @@ function createChatService(input) {
|
|
|
14453
14468
|
});
|
|
14454
14469
|
await confirmFiles(fileParts);
|
|
14455
14470
|
await storage.insertMessage(correction);
|
|
14471
|
+
filesStored(userId, chatId, correction.id, fileParts);
|
|
14456
14472
|
return correction;
|
|
14457
14473
|
}, page);
|
|
14458
14474
|
if (!queued) throw new SteeringClosed();
|
|
@@ -15665,4 +15681,4 @@ export {
|
|
|
15665
15681
|
InvalidWidgetAnswerError,
|
|
15666
15682
|
createChatService
|
|
15667
15683
|
};
|
|
15668
|
-
//# sourceMappingURL=chunk-
|
|
15684
|
+
//# sourceMappingURL=chunk-THL3LUXH.js.map
|