@arbidocs/react 0.5.162 → 0.5.164
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/dist/annotations/index.cjs +47 -47
- package/dist/annotations/useAnnotationLayer.js +7 -3
- package/dist/annotations/useAnnotationLayer.js.map +2 -2
- package/dist/chat/conversation-mentions.js +11 -1
- package/dist/chat/conversation-mentions.js.map +2 -2
- package/dist/chat/useConversation.js +2 -6
- package/dist/chat/useConversation.js.map +2 -2
- package/dist/{chunk-SUZORMAB.cjs → chunk-L5TQDBG4.cjs} +9 -5
- package/dist/chunk-L5TQDBG4.cjs.map +1 -0
- package/dist/{chunk-QV7KINWC.cjs → chunk-ZBI5AMZC.cjs} +6 -6
- package/dist/{chunk-QV7KINWC.cjs.map → chunk-ZBI5AMZC.cjs.map} +1 -1
- package/dist/document-tools/core.cjs +62 -62
- package/dist/document-tools/index.cjs +62 -62
- package/dist/index.cjs +13 -5
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.ts +6 -1
- package/package.json +3 -3
- package/dist/chunk-SUZORMAB.cjs.map +0 -1
package/dist/index.cjs
CHANGED
|
@@ -1303,6 +1303,8 @@ function clearUserInputRequest(queryClient, conversationId, messageId) {
|
|
|
1303
1303
|
}
|
|
1304
1304
|
);
|
|
1305
1305
|
}
|
|
1306
|
+
|
|
1307
|
+
// src/chat/conversation-mentions.ts
|
|
1306
1308
|
var ASSISTANT_MENTION_LABEL = "ARBI";
|
|
1307
1309
|
function assistantLabels(assistantName = ASSISTANT_MENTION_LABEL) {
|
|
1308
1310
|
return assistantName.toLowerCase() === ASSISTANT_MENTION_LABEL.toLowerCase() ? [assistantName] : [assistantName, ASSISTANT_MENTION_LABEL];
|
|
@@ -1328,6 +1330,15 @@ function cachedMentionCandidates(queryClient, workspaceId, currentUserId, assist
|
|
|
1328
1330
|
const aliases = assistantLabels(assistantName).slice(1).map((label) => ({ id: "assistant", kind: "assistant", label }));
|
|
1329
1331
|
return [...buildMentionCandidates(users, currentUserId, assistantName), ...aliases];
|
|
1330
1332
|
}
|
|
1333
|
+
async function cacheAssistantMode(queryClient, conversationId, mode) {
|
|
1334
|
+
const queryKey = getThreadsQueryKey(conversationId);
|
|
1335
|
+
await queryClient.cancelQueries({ queryKey });
|
|
1336
|
+
queryClient.setQueryData(
|
|
1337
|
+
queryKey,
|
|
1338
|
+
(old) => old ? { ...old, assistant_mode: mode } : old
|
|
1339
|
+
);
|
|
1340
|
+
void queryClient.invalidateQueries({ queryKey });
|
|
1341
|
+
}
|
|
1331
1342
|
function cachedAssistantMode(queryClient, conversationId, newMode) {
|
|
1332
1343
|
if (!conversationId) return newMode;
|
|
1333
1344
|
const threads = queryClient.getQueriesData(allConversationThreads).map(([, data]) => data).find((data) => data?.conversation_ext_id === conversationId);
|
|
@@ -5919,11 +5930,7 @@ function useConversation(options = {}) {
|
|
|
5919
5930
|
setHistoryError(null);
|
|
5920
5931
|
try {
|
|
5921
5932
|
await arbi.conversations.setAssistantMode(conversationId, mode);
|
|
5922
|
-
queryClient
|
|
5923
|
-
getThreadsQueryKey(conversationId),
|
|
5924
|
-
(old) => old ? { ...old, assistant_mode: mode } : old
|
|
5925
|
-
);
|
|
5926
|
-
void queryClient.invalidateQueries({ queryKey: getThreadsQueryKey(conversationId) });
|
|
5933
|
+
await cacheAssistantMode(queryClient, conversationId, mode);
|
|
5927
5934
|
void (agentId ? agentHistory.refetch() : ordinaryHistory.refetch());
|
|
5928
5935
|
} catch (e) {
|
|
5929
5936
|
setHistoryError(messageOf(e, "The assistant mode could not be changed."));
|
|
@@ -21222,6 +21229,7 @@ exports.buildMentionCandidates = buildMentionCandidates;
|
|
|
21222
21229
|
exports.buildPendingFirstTurn = buildPendingFirstTurn;
|
|
21223
21230
|
exports.buildPendingSyncItem = buildPendingSyncItem;
|
|
21224
21231
|
exports.buildWorkspaceArchive = buildWorkspaceArchive;
|
|
21232
|
+
exports.cacheAssistantMode = cacheAssistantMode;
|
|
21225
21233
|
exports.cacheThreadBinding = cacheThreadBinding;
|
|
21226
21234
|
exports.cachedAssistantMode = cachedAssistantMode;
|
|
21227
21235
|
exports.cachedMentionCandidates = cachedMentionCandidates;
|