@arbidocs/react 0.5.6 → 0.5.7

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/index.cjs CHANGED
@@ -5,7 +5,7 @@ var chunkKFFH2JJM_cjs = require('./chunk-KFFH2JJM.cjs');
5
5
  var chunkL3NHETSD_cjs = require('./chunk-L3NHETSD.cjs');
6
6
  var chunk2M4B4FFA_cjs = require('./chunk-2M4B4FFA.cjs');
7
7
  var chunkH4FGDXYB_cjs = require('./chunk-H4FGDXYB.cjs');
8
- var chunkTYZFRV7P_cjs = require('./chunk-TYZFRV7P.cjs');
8
+ var chunkQYUL4GQC_cjs = require('./chunk-QYUL4GQC.cjs');
9
9
  var chunkVAMPYLQ4_cjs = require('./chunk-VAMPYLQ4.cjs');
10
10
  var chunkN73IMVFF_cjs = require('./chunk-N73IMVFF.cjs');
11
11
  var chunkZWFMFOGP_cjs = require('./chunk-ZWFMFOGP.cjs');
@@ -41,7 +41,7 @@ var ReactMarkdown__default = /*#__PURE__*/_interopDefault(ReactMarkdown);
41
41
  var Cropper__default = /*#__PURE__*/_interopDefault(Cropper);
42
42
 
43
43
  // src/host/index.ts
44
- var ArbiHost2 = chunkTYZFRV7P_cjs.ArbiHost;
44
+ var ArbiHost2 = chunkQYUL4GQC_cjs.ArbiHost;
45
45
  function isActivityKey(queryKey, conversationId) {
46
46
  const [scope, resource, id, leaf] = queryKey;
47
47
  if (scope !== "arbi" || resource !== "conversations" || leaf !== "activity") return false;
@@ -1318,7 +1318,7 @@ function cachedAssistantMode(queryClient, conversationId, newMode) {
1318
1318
  return chunkZLHS3UKP_cjs.findConversation(queryClient, conversationId)?.assistant_mode ?? "always";
1319
1319
  }
1320
1320
  function isCommentToPeople(queryClient, conversationId, content, candidates) {
1321
- const mentioned = chunkTYZFRV7P_cjs.extractMentions(content, candidates);
1321
+ const mentioned = chunkQYUL4GQC_cjs.extractMentions(content, candidates);
1322
1322
  if (mentioned.some((c) => c.kind === "assistant")) return false;
1323
1323
  if (chunkZLHS3UKP_cjs.isConversationShared(queryClient, conversationId)) return true;
1324
1324
  if (mentioned.some((c) => c.kind === "user")) return true;
@@ -1497,6 +1497,67 @@ function useApplyChatModel() {
1497
1497
  [availableModels, configField, session]
1498
1498
  );
1499
1499
  }
1500
+
1501
+ // src/chat/thread-binding.ts
1502
+ function threadBinding(queryClient, conversationId) {
1503
+ if (!conversationId) return chunkQYUL4GQC_cjs.UNBOUND;
1504
+ const row = chunkZLHS3UKP_cjs.findConversation(queryClient, conversationId);
1505
+ if (row) return chunkQYUL4GQC_cjs.bindingOfRow(row);
1506
+ const threads = queryClient.getQueryData(getThreadsQueryKey(conversationId));
1507
+ return chunkQYUL4GQC_cjs.bindingOfRow(threads ? { external_id: conversationId, ...threads } : null);
1508
+ }
1509
+ function boundDocumentOf(queryClient, state) {
1510
+ return state.conversationId ? threadBinding(queryClient, state.conversationId).documentId : state.newChatDocumentId;
1511
+ }
1512
+ function cacheThreadBinding(queryClient, conversationId, binding) {
1513
+ const fields = {
1514
+ bound_document_ext_id: binding.documentId,
1515
+ bound_document_unavailable: binding.unavailable
1516
+ };
1517
+ chunkZLHS3UKP_cjs.patchConversation(queryClient, conversationId, fields);
1518
+ queryClient.setQueryData(
1519
+ getThreadsQueryKey(conversationId),
1520
+ (old) => old ? { ...old, ...fields } : old
1521
+ );
1522
+ }
1523
+ async function bindThreadDocument(arbi, queryClient, conversationId, documentId) {
1524
+ const before = threadBinding(queryClient, conversationId);
1525
+ if (before.documentId === documentId && !before.unavailable) return;
1526
+ cacheThreadBinding(queryClient, conversationId, { documentId, unavailable: false });
1527
+ try {
1528
+ const saved = await arbi.conversations.update(conversationId, {
1529
+ bound_document_ext_id: documentId
1530
+ });
1531
+ chunkZLHS3UKP_cjs.patchConversation(queryClient, conversationId, saved);
1532
+ cacheThreadBinding(queryClient, conversationId, chunkQYUL4GQC_cjs.bindingOfRow(saved));
1533
+ } catch (error) {
1534
+ cacheThreadBinding(queryClient, conversationId, before);
1535
+ throw error;
1536
+ }
1537
+ }
1538
+ function adoptNewChatDocument(session, queryClient, conversationId, documentId = session.getState().newChatDocumentId) {
1539
+ if (!documentId) return;
1540
+ cacheThreadBinding(queryClient, conversationId, { documentId, unavailable: false });
1541
+ if (session.getState().newChatDocumentId === documentId) session.setNewChatDocumentId(null);
1542
+ }
1543
+ async function migrateLegacyThreadDocuments(arbi, queryClient, conversations) {
1544
+ const legacy = chunkQYUL4GQC_cjs.readLegacyThreadDocuments();
1545
+ const listed = conversations.filter(
1546
+ (c) => c.external_id in legacy && "bound_document_unavailable" in c
1547
+ );
1548
+ if (listed.length === 0) return;
1549
+ await Promise.all(
1550
+ listed.map(async (row) => {
1551
+ const server = chunkQYUL4GQC_cjs.bindingOfRow(row);
1552
+ if (server.documentId || server.unavailable) return;
1553
+ try {
1554
+ await bindThreadDocument(arbi, queryClient, row.external_id, legacy[row.external_id]);
1555
+ } catch {
1556
+ }
1557
+ })
1558
+ );
1559
+ chunkQYUL4GQC_cjs.forgetLegacyThreadDocuments(listed.map((c) => c.external_id));
1560
+ }
1500
1561
  function resolveReplyTarget(queryClient, conversationId, parentId) {
1501
1562
  if (!parentId) return null;
1502
1563
  const data = queryClient.getQueryData(getThreadsQueryKey(conversationId));
@@ -3360,7 +3421,6 @@ function createStreamHandlers(ctx, params) {
3360
3421
  if (serverConversationId && streamState.conversationId === "new") {
3361
3422
  streamState.conversationId = serverConversationId;
3362
3423
  session.moveConversation("new", serverConversationId);
3363
- chunkTYZFRV7P_cjs.adoptNewChatDocument(session, serverConversationId, streamState.threadDocumentId ?? null);
3364
3424
  const userExtId = ctx.userId();
3365
3425
  const nowIso = (/* @__PURE__ */ new Date()).toISOString();
3366
3426
  chunkZLHS3UKP_cjs.patchConversationList(
@@ -3381,6 +3441,12 @@ function createStreamHandlers(ctx, params) {
3381
3441
  ...old
3382
3442
  ]
3383
3443
  );
3444
+ adoptNewChatDocument(
3445
+ session,
3446
+ queryClient,
3447
+ serverConversationId,
3448
+ streamState.threadDocumentId ?? null
3449
+ );
3384
3450
  }
3385
3451
  const { type: _type, ...messageData } = userMessage;
3386
3452
  const userMsg = { ...messageData, isLoading: true };
@@ -3826,10 +3892,10 @@ function useConversationActions({
3826
3892
  (content) => {
3827
3893
  const { conversationId: convId, newConversationAssistantMode } = session.getState();
3828
3894
  const candidates = mentionCandidates();
3829
- const mentioned = chunkTYZFRV7P_cjs.extractMentions(content, candidates);
3895
+ const mentioned = chunkQYUL4GQC_cjs.extractMentions(content, candidates);
3830
3896
  const assistantMode = cachedAssistantMode(queryClient, convId, newConversationAssistantMode);
3831
3897
  const isComment = isCommentToPeople(queryClient, convId, content, candidates);
3832
- const mentions = chunkTYZFRV7P_cjs.toMessageMentions(mentioned);
3898
+ const mentions = chunkQYUL4GQC_cjs.toMessageMentions(mentioned);
3833
3899
  if (!isComment && assistantMode === "mentioned" && !mentions.some((m) => m.type === "assistant")) {
3834
3900
  mentions.push({ type: "assistant" });
3835
3901
  }
@@ -3857,8 +3923,9 @@ function useConversationActions({
3857
3923
  const conversationId = saved.conversation_ext_id;
3858
3924
  const nowIso = (/* @__PURE__ */ new Date()).toISOString();
3859
3925
  if (!convId) {
3926
+ const bindTo = session.getState().newChatDocumentId;
3860
3927
  session.moveConversation("new", conversationId);
3861
- chunkTYZFRV7P_cjs.adoptNewChatDocument(session, conversationId);
3928
+ if (bindTo) session.setNewChatDocumentId(null);
3862
3929
  chunkZLHS3UKP_cjs.patchConversationList(queryClient, session.getState().workspaceId, (old) => [
3863
3930
  {
3864
3931
  external_id: conversationId,
@@ -3875,6 +3942,10 @@ function useConversationActions({
3875
3942
  },
3876
3943
  ...old
3877
3944
  ]);
3945
+ if (bindTo)
3946
+ bindThreadDocument(arbi, queryClient, conversationId, bindTo).catch(
3947
+ () => chunkVAMPYLQ4_cjs.notify.error("Could not attach the document to this thread")
3948
+ );
3878
3949
  invalidateUserWorkspaces();
3879
3950
  } else {
3880
3951
  chunkZLHS3UKP_cjs.patchConversation(queryClient, conversationId, (c) => ({
@@ -3925,9 +3996,9 @@ function useConversationActions({
3925
3996
  const lastConfigId = cachedSettings?.last_config;
3926
3997
  const resolvedConfigId = newConfigId || (agentExtId ? void 0 : lastConfigId);
3927
3998
  const isPaMode = !agentExtId && state.paMode;
3928
- const threadDocumentId2 = chunkTYZFRV7P_cjs.boundDocumentOf(state);
3929
- const activeArtifactExtId = isPaMode ? null : chunkTYZFRV7P_cjs.takeDocumentForTurn({
3930
- boundDocumentId: threadDocumentId2,
3999
+ const threadDocumentId = boundDocumentOf(queryClient, state);
4000
+ const activeArtifactExtId = isPaMode ? null : chunkQYUL4GQC_cjs.takeDocumentForTurn({
4001
+ boundDocumentId: threadDocumentId,
3931
4002
  conversationId: convId,
3932
4003
  workspaceId: selectedWorkspaceId
3933
4004
  });
@@ -3943,6 +4014,8 @@ function useConversationActions({
3943
4014
  tools: toolsOverride,
3944
4015
  personalAgent: isPaMode,
3945
4016
  activeArtifactExtId,
4017
+ // A new chat about a document is bound by its first turn, on the server (every device).
4018
+ ...!convId && threadDocumentId ? { bindDocumentId: threadDocumentId } : {},
3946
4019
  previousResponseId: parentId,
3947
4020
  agentId: agentExtId,
3948
4021
  model: resolvedConfigId,
@@ -3982,7 +4055,7 @@ function useConversationActions({
3982
4055
  // Set when a create_fact / label_facts tool runs this turn, so the Facts
3983
4056
  // table + label vocabulary refresh on completion (see handleComplete).
3984
4057
  factsTouched: false,
3985
- threadDocumentId: threadDocumentId2,
4058
+ threadDocumentId,
3986
4059
  // Set by the handlers: the server stored the question / reported its own failure.
3987
4060
  userMessageId: null,
3988
4061
  serverError: null
@@ -4156,7 +4229,7 @@ function useConversationActions({
4156
4229
  const handleSendMessage = React.useCallback(
4157
4230
  async (options) => {
4158
4231
  const currentMessage = chunkL3NHETSD_cjs.selectDraft(session.getState()).trim();
4159
- if (!selectedWorkspaceId || !chunkTYZFRV7P_cjs.hasMessageBody(currentMessage)) return;
4232
+ if (!selectedWorkspaceId || !chunkQYUL4GQC_cjs.hasMessageBody(currentMessage)) return;
4160
4233
  session.setSuggestedQuery(null);
4161
4234
  if (refuseChatWhenOffline()) return;
4162
4235
  if (isGenerating) {
@@ -5098,6 +5171,10 @@ async function applyConversationEvent(queryClient, event) {
5098
5171
  if (e.type === "conversation.title_updated" && e.conversation_ext_id) {
5099
5172
  chunkZLHS3UKP_cjs.patchConversation(queryClient, e.conversation_ext_id, { title: e.title ?? null });
5100
5173
  }
5174
+ if (e.type === "conversation.document_binding_changed" && e.conversation_ext_id) {
5175
+ void queryClient.invalidateQueries({ queryKey: getThreadsQueryKey(e.conversation_ext_id) });
5176
+ void chunkZLHS3UKP_cjs.invalidateConversationLists(queryClient);
5177
+ }
5101
5178
  }
5102
5179
  function applyRunEnded(queryClient, e) {
5103
5180
  const conversationId = e.conversation_ext_id;
@@ -5133,24 +5210,55 @@ async function applyMessagePosted(queryClient, e) {
5133
5210
  await queryClient.refetchQueries({ queryKey, type: "active" });
5134
5211
  }
5135
5212
  }
5213
+ var migratedWorkspaces = /* @__PURE__ */ new Set();
5136
5214
  function useThreadDocument() {
5215
+ const arbi = chunkQQ7SCJRY_cjs.useArbi();
5216
+ const queryClient = reactQuery.useQueryClient();
5137
5217
  const session = chunkL3NHETSD_cjs.useArbiSessionStore();
5138
5218
  const conversationId = chunkL3NHETSD_cjs.useArbiSessionState((s) => s.conversationId);
5219
+ const workspaceId = chunkL3NHETSD_cjs.useArbiSessionState((s) => s.workspaceId);
5139
5220
  const newChatDocumentId = chunkL3NHETSD_cjs.useArbiSessionState((s) => s.newChatDocumentId);
5140
- const saved = React.useSyncExternalStore(
5141
- chunkTYZFRV7P_cjs.subscribeThreadDocuments,
5142
- () => chunkTYZFRV7P_cjs.threadDocumentId(conversationId),
5221
+ const subscribe = React.useCallback(
5222
+ (onChange) => queryClient.getQueryCache().subscribe(onChange),
5223
+ [queryClient]
5224
+ );
5225
+ const savedDocumentId = React.useSyncExternalStore(
5226
+ subscribe,
5227
+ () => threadBinding(queryClient, conversationId).documentId,
5143
5228
  () => null
5144
5229
  );
5230
+ const unavailable = React.useSyncExternalStore(
5231
+ subscribe,
5232
+ () => threadBinding(queryClient, conversationId).unavailable,
5233
+ () => false
5234
+ );
5235
+ const { data: conversations, isPlaceholderData } = chunkL3NHETSD_cjs.useConversations(workspaceId ?? void 0);
5236
+ React.useEffect(() => {
5237
+ if (!workspaceId || !conversations || isPlaceholderData || migratedWorkspaces.has(workspaceId))
5238
+ return;
5239
+ migratedWorkspaces.add(workspaceId);
5240
+ void migrateLegacyThreadDocuments(arbi, queryClient, conversations);
5241
+ }, [arbi, queryClient, workspaceId, conversations, isPlaceholderData]);
5145
5242
  const bind = React.useCallback(
5146
5243
  (documentId) => {
5147
5244
  const { conversationId: open } = session.getState();
5148
- if (open) chunkTYZFRV7P_cjs.bindThreadDocument(open, documentId);
5149
- else session.setNewChatDocumentId(documentId);
5245
+ if (!open) {
5246
+ session.setNewChatDocumentId(documentId);
5247
+ return;
5248
+ }
5249
+ bindThreadDocument(arbi, queryClient, open, documentId).catch(
5250
+ () => chunkVAMPYLQ4_cjs.notify.error(
5251
+ documentId ? "Could not attach the document to this thread" : "Could not unbind the document"
5252
+ )
5253
+ );
5150
5254
  },
5151
- [session]
5255
+ [arbi, queryClient, session]
5152
5256
  );
5153
- return { documentId: conversationId ? saved : newChatDocumentId, bind };
5257
+ return {
5258
+ documentId: conversationId ? savedDocumentId : newChatDocumentId,
5259
+ unavailable: conversationId ? unavailable : false,
5260
+ bind
5261
+ };
5154
5262
  }
5155
5263
 
5156
5264
  // src/chat/config-model.ts
@@ -9294,7 +9402,7 @@ var IDLE = {
9294
9402
  };
9295
9403
  function useSemanticSearch(docIds = [], options = {}) {
9296
9404
  const arbi = chunkQQ7SCJRY_cjs.useArbi();
9297
- const [ownSession] = React.useState(chunkTYZFRV7P_cjs.createSearchSession);
9405
+ const [ownSession] = React.useState(chunkQYUL4GQC_cjs.createSearchSession);
9298
9406
  const session = options.session ?? ownSession;
9299
9407
  const { model, workspaceId } = options;
9300
9408
  const state = React.useSyncExternalStore(session.subscribe, session.getState, session.getState);
@@ -9303,7 +9411,7 @@ function useSemanticSearch(docIds = [], options = {}) {
9303
9411
  if (!workspaceId) return;
9304
9412
  const current = session.getState().workspaceId;
9305
9413
  if (current !== workspaceId) {
9306
- if (current) chunkTYZFRV7P_cjs.clearSearchSession(workspaceId, session);
9414
+ if (current) chunkQYUL4GQC_cjs.clearSearchSession(workspaceId, session);
9307
9415
  else session.setState({ workspaceId });
9308
9416
  }
9309
9417
  }, [session, workspaceId]);
@@ -9311,7 +9419,7 @@ function useSemanticSearch(docIds = [], options = {}) {
9311
9419
  async (query, mode = "hybrid") => {
9312
9420
  const trimmed = query.trim();
9313
9421
  if (!trimmed) {
9314
- chunkTYZFRV7P_cjs.clearSearchSession(void 0, session);
9422
+ chunkQYUL4GQC_cjs.clearSearchSession(void 0, session);
9315
9423
  return;
9316
9424
  }
9317
9425
  const run = session.getState().run + 1;
@@ -9340,7 +9448,7 @@ function useSemanticSearch(docIds = [], options = {}) {
9340
9448
  },
9341
9449
  [arbi, docIds, model, session, workspaceId]
9342
9450
  );
9343
- const clear = React.useCallback(() => chunkTYZFRV7P_cjs.clearSearchSession(void 0, session), [session]);
9451
+ const clear = React.useCallback(() => chunkQYUL4GQC_cjs.clearSearchSession(void 0, session), [session]);
9344
9452
  const shown = foreign ? IDLE : state;
9345
9453
  return {
9346
9454
  query: shown.query,
@@ -10829,7 +10937,7 @@ function ConversationList({
10829
10937
  children: c.subtitle ?? preview
10830
10938
  }
10831
10939
  ),
10832
- /* @__PURE__ */ jsxRuntime.jsx("span", { className: "shrink-0 text-xs text-muted-foreground", children: lastMessage ? chunkTYZFRV7P_cjs.formatRelativeTime(lastMessage.createdAt) : "" })
10940
+ /* @__PURE__ */ jsxRuntime.jsx("span", { className: "shrink-0 text-xs text-muted-foreground", children: lastMessage ? chunkQYUL4GQC_cjs.formatRelativeTime(lastMessage.createdAt) : "" })
10833
10941
  ] })
10834
10942
  ] })
10835
10943
  ] });
@@ -12871,133 +12979,125 @@ Object.defineProperty(exports, "mailQueryKeys", {
12871
12979
  enumerable: true,
12872
12980
  get: function () { return chunkH4FGDXYB_cjs.mailQueryKeys; }
12873
12981
  });
12982
+ Object.defineProperty(exports, "LEGACY_THREAD_DOCUMENTS_KEY", {
12983
+ enumerable: true,
12984
+ get: function () { return chunkQYUL4GQC_cjs.LEGACY_THREAD_DOCUMENTS_KEY; }
12985
+ });
12874
12986
  Object.defineProperty(exports, "MENTION_HREF_PREFIX", {
12875
12987
  enumerable: true,
12876
- get: function () { return chunkTYZFRV7P_cjs.MENTION_HREF_PREFIX; }
12988
+ get: function () { return chunkQYUL4GQC_cjs.MENTION_HREF_PREFIX; }
12877
12989
  });
12878
12990
  Object.defineProperty(exports, "NotificationBell", {
12879
12991
  enumerable: true,
12880
- get: function () { return chunkTYZFRV7P_cjs.NotificationBell; }
12992
+ get: function () { return chunkQYUL4GQC_cjs.NotificationBell; }
12881
12993
  });
12882
12994
  Object.defineProperty(exports, "Toaster", {
12883
12995
  enumerable: true,
12884
- get: function () { return chunkTYZFRV7P_cjs.Toaster; }
12885
- });
12886
- Object.defineProperty(exports, "adoptNewChatDocument", {
12887
- enumerable: true,
12888
- get: function () { return chunkTYZFRV7P_cjs.adoptNewChatDocument; }
12996
+ get: function () { return chunkQYUL4GQC_cjs.Toaster; }
12889
12997
  });
12890
- Object.defineProperty(exports, "bindThreadDocument", {
12998
+ Object.defineProperty(exports, "UNBOUND", {
12891
12999
  enumerable: true,
12892
- get: function () { return chunkTYZFRV7P_cjs.bindThreadDocument; }
13000
+ get: function () { return chunkQYUL4GQC_cjs.UNBOUND; }
12893
13001
  });
12894
- Object.defineProperty(exports, "boundDocumentOf", {
13002
+ Object.defineProperty(exports, "bindingOfRow", {
12895
13003
  enumerable: true,
12896
- get: function () { return chunkTYZFRV7P_cjs.boundDocumentOf; }
13004
+ get: function () { return chunkQYUL4GQC_cjs.bindingOfRow; }
12897
13005
  });
12898
13006
  Object.defineProperty(exports, "clearSearchSession", {
12899
13007
  enumerable: true,
12900
- get: function () { return chunkTYZFRV7P_cjs.clearSearchSession; }
13008
+ get: function () { return chunkQYUL4GQC_cjs.clearSearchSession; }
12901
13009
  });
12902
13010
  Object.defineProperty(exports, "createSearchSession", {
12903
13011
  enumerable: true,
12904
- get: function () { return chunkTYZFRV7P_cjs.createSearchSession; }
13012
+ get: function () { return chunkQYUL4GQC_cjs.createSearchSession; }
12905
13013
  });
12906
13014
  Object.defineProperty(exports, "extractMentions", {
12907
13015
  enumerable: true,
12908
- get: function () { return chunkTYZFRV7P_cjs.extractMentions; }
13016
+ get: function () { return chunkQYUL4GQC_cjs.extractMentions; }
12909
13017
  });
12910
13018
  Object.defineProperty(exports, "filterMentionCandidates", {
12911
13019
  enumerable: true,
12912
- get: function () { return chunkTYZFRV7P_cjs.filterMentionCandidates; }
13020
+ get: function () { return chunkQYUL4GQC_cjs.filterMentionCandidates; }
12913
13021
  });
12914
13022
  Object.defineProperty(exports, "findMentionQuery", {
12915
13023
  enumerable: true,
12916
- get: function () { return chunkTYZFRV7P_cjs.findMentionQuery; }
13024
+ get: function () { return chunkQYUL4GQC_cjs.findMentionQuery; }
13025
+ });
13026
+ Object.defineProperty(exports, "forgetLegacyThreadDocuments", {
13027
+ enumerable: true,
13028
+ get: function () { return chunkQYUL4GQC_cjs.forgetLegacyThreadDocuments; }
12917
13029
  });
12918
13030
  Object.defineProperty(exports, "formatRelativeTime", {
12919
13031
  enumerable: true,
12920
- get: function () { return chunkTYZFRV7P_cjs.formatRelativeTime; }
13032
+ get: function () { return chunkQYUL4GQC_cjs.formatRelativeTime; }
12921
13033
  });
12922
13034
  Object.defineProperty(exports, "hasMessageBody", {
12923
13035
  enumerable: true,
12924
- get: function () { return chunkTYZFRV7P_cjs.hasMessageBody; }
13036
+ get: function () { return chunkQYUL4GQC_cjs.hasMessageBody; }
12925
13037
  });
12926
13038
  Object.defineProperty(exports, "insertMention", {
12927
13039
  enumerable: true,
12928
- get: function () { return chunkTYZFRV7P_cjs.insertMention; }
13040
+ get: function () { return chunkQYUL4GQC_cjs.insertMention; }
12929
13041
  });
12930
13042
  Object.defineProperty(exports, "latestThreadOfDocument", {
12931
13043
  enumerable: true,
12932
- get: function () { return chunkTYZFRV7P_cjs.latestThreadOfDocument; }
13044
+ get: function () { return chunkQYUL4GQC_cjs.latestThreadOfDocument; }
12933
13045
  });
12934
13046
  Object.defineProperty(exports, "linkMentions", {
12935
13047
  enumerable: true,
12936
- get: function () { return chunkTYZFRV7P_cjs.linkMentions; }
13048
+ get: function () { return chunkQYUL4GQC_cjs.linkMentions; }
12937
13049
  });
12938
13050
  Object.defineProperty(exports, "mentionFromHref", {
12939
13051
  enumerable: true,
12940
- get: function () { return chunkTYZFRV7P_cjs.mentionFromHref; }
13052
+ get: function () { return chunkQYUL4GQC_cjs.mentionFromHref; }
12941
13053
  });
12942
13054
  Object.defineProperty(exports, "openDocumentId", {
12943
13055
  enumerable: true,
12944
- get: function () { return chunkTYZFRV7P_cjs.openDocumentId; }
13056
+ get: function () { return chunkQYUL4GQC_cjs.openDocumentId; }
12945
13057
  });
12946
13058
  Object.defineProperty(exports, "persistSearchSession", {
12947
13059
  enumerable: true,
12948
- get: function () { return chunkTYZFRV7P_cjs.persistSearchSession; }
13060
+ get: function () { return chunkQYUL4GQC_cjs.persistSearchSession; }
12949
13061
  });
12950
- Object.defineProperty(exports, "reloadThreadDocumentsForTests", {
13062
+ Object.defineProperty(exports, "readLegacyThreadDocuments", {
12951
13063
  enumerable: true,
12952
- get: function () { return chunkTYZFRV7P_cjs.reloadThreadDocumentsForTests; }
13064
+ get: function () { return chunkQYUL4GQC_cjs.readLegacyThreadDocuments; }
12953
13065
  });
12954
13066
  Object.defineProperty(exports, "requestSearch", {
12955
13067
  enumerable: true,
12956
- get: function () { return chunkTYZFRV7P_cjs.requestSearch; }
12957
- });
12958
- Object.defineProperty(exports, "resetThreadDocumentsForTests", {
12959
- enumerable: true,
12960
- get: function () { return chunkTYZFRV7P_cjs.resetThreadDocumentsForTests; }
13068
+ get: function () { return chunkQYUL4GQC_cjs.requestSearch; }
12961
13069
  });
12962
13070
  Object.defineProperty(exports, "savedDocumentIdFor", {
12963
13071
  enumerable: true,
12964
- get: function () { return chunkTYZFRV7P_cjs.savedDocumentIdFor; }
13072
+ get: function () { return chunkQYUL4GQC_cjs.savedDocumentIdFor; }
12965
13073
  });
12966
13074
  Object.defineProperty(exports, "sharedSearchSession", {
12967
13075
  enumerable: true,
12968
- get: function () { return chunkTYZFRV7P_cjs.sharedSearchSession; }
12969
- });
12970
- Object.defineProperty(exports, "subscribeThreadDocuments", {
12971
- enumerable: true,
12972
- get: function () { return chunkTYZFRV7P_cjs.subscribeThreadDocuments; }
13076
+ get: function () { return chunkQYUL4GQC_cjs.sharedSearchSession; }
12973
13077
  });
12974
13078
  Object.defineProperty(exports, "takeDocumentForTurn", {
12975
13079
  enumerable: true,
12976
- get: function () { return chunkTYZFRV7P_cjs.takeDocumentForTurn; }
13080
+ get: function () { return chunkQYUL4GQC_cjs.takeDocumentForTurn; }
12977
13081
  });
12978
13082
  Object.defineProperty(exports, "takePendingSearch", {
12979
13083
  enumerable: true,
12980
- get: function () { return chunkTYZFRV7P_cjs.takePendingSearch; }
12981
- });
12982
- Object.defineProperty(exports, "threadDocumentId", {
12983
- enumerable: true,
12984
- get: function () { return chunkTYZFRV7P_cjs.threadDocumentId; }
13084
+ get: function () { return chunkQYUL4GQC_cjs.takePendingSearch; }
12985
13085
  });
12986
13086
  Object.defineProperty(exports, "toMessageMentions", {
12987
13087
  enumerable: true,
12988
- get: function () { return chunkTYZFRV7P_cjs.toMessageMentions; }
13088
+ get: function () { return chunkQYUL4GQC_cjs.toMessageMentions; }
12989
13089
  });
12990
13090
  Object.defineProperty(exports, "useOpenDocumentId", {
12991
13091
  enumerable: true,
12992
- get: function () { return chunkTYZFRV7P_cjs.useOpenDocumentId; }
13092
+ get: function () { return chunkQYUL4GQC_cjs.useOpenDocumentId; }
12993
13093
  });
12994
13094
  Object.defineProperty(exports, "useRegisterOpenDocument", {
12995
13095
  enumerable: true,
12996
- get: function () { return chunkTYZFRV7P_cjs.useRegisterOpenDocument; }
13096
+ get: function () { return chunkQYUL4GQC_cjs.useRegisterOpenDocument; }
12997
13097
  });
12998
13098
  Object.defineProperty(exports, "useTurnDocumentId", {
12999
13099
  enumerable: true,
13000
- get: function () { return chunkTYZFRV7P_cjs.useTurnDocumentId; }
13100
+ get: function () { return chunkQYUL4GQC_cjs.useTurnDocumentId; }
13001
13101
  });
13002
13102
  Object.defineProperty(exports, "DEFAULT_NOTIFY_TONE", {
13003
13103
  enumerable: true,
@@ -14148,6 +14248,7 @@ exports.__resetStreamingTokenBufferForTests = __resetStreamingTokenBufferForTest
14148
14248
  exports.accountPath = accountPath;
14149
14249
  exports.addAssistantMessageToCache = addAssistantMessageToCache;
14150
14250
  exports.addUserMessageToCache = addUserMessageToCache;
14251
+ exports.adoptNewChatDocument = adoptNewChatDocument;
14151
14252
  exports.aliasTakenMessage = aliasTakenMessage;
14152
14253
  exports.allConversationThreads = allConversationThreads;
14153
14254
  exports.annotateThread = annotateThread;
@@ -14160,10 +14261,13 @@ exports.applyOutputItemToMessage = applyOutputItemToMessage;
14160
14261
  exports.arbiMailClient = arbiMailClient;
14161
14262
  exports.archiveName = archiveName;
14162
14263
  exports.archivedWorkspaceMessage = archivedWorkspaceMessage;
14264
+ exports.bindThreadDocument = bindThreadDocument;
14265
+ exports.boundDocumentOf = boundDocumentOf;
14163
14266
  exports.buildDocumentMetadataRows = buildDocumentMetadataRows;
14164
14267
  exports.buildMentionCandidates = buildMentionCandidates;
14165
14268
  exports.buildPendingFirstTurn = buildPendingFirstTurn;
14166
14269
  exports.buildWorkspaceArchive = buildWorkspaceArchive;
14270
+ exports.cacheThreadBinding = cacheThreadBinding;
14167
14271
  exports.cachedAssistantMode = cachedAssistantMode;
14168
14272
  exports.cachedMentionCandidates = cachedMentionCandidates;
14169
14273
  exports.cachedQuotaUsedUp = cachedQuotaUsedUp;
@@ -14240,6 +14344,7 @@ exports.mailDraftIdFromContent = mailDraftIdFromContent;
14240
14344
  exports.mailJson = mailJson;
14241
14345
  exports.markMessageAsFailed = markMessageAsFailed;
14242
14346
  exports.markNarrationSettled = markNarrationSettled;
14347
+ exports.migrateLegacyThreadDocuments = migrateLegacyThreadDocuments;
14243
14348
  exports.mountDiditVerification = mountDiditVerification;
14244
14349
  exports.nextAliasSuggestion = nextAliasSuggestion;
14245
14350
  exports.notificationUserName = notificationUserName;
@@ -14270,6 +14375,7 @@ exports.signatureRequestMeta = signatureRequestMeta;
14270
14375
  exports.subscribeDocumentReads = subscribeDocumentReads;
14271
14376
  exports.supportsHouseTemplates = supportsHouseTemplates;
14272
14377
  exports.textToArtifact = textToArtifact;
14378
+ exports.threadBinding = threadBinding;
14273
14379
  exports.threadEndingAtContains = threadEndingAtContains;
14274
14380
  exports.titleFromQuestion = titleFromQuestion;
14275
14381
  exports.toChatCitations = toChatCitations;