@arbidocs/react 0.5.161 → 0.5.163
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/artifacts/index.cjs +2 -2
- package/dist/calls/livekit/index.cjs +41 -41
- package/dist/chat/workflow-run-titles.js +6 -1
- package/dist/chat/workflow-run-titles.js.map +2 -2
- package/dist/{chunk-GVU3KYP3.cjs → chunk-42X5ZO7Y.cjs} +11 -82
- package/dist/chunk-42X5ZO7Y.cjs.map +1 -0
- package/dist/{chunk-SUZORMAB.cjs → chunk-L5TQDBG4.cjs} +9 -5
- package/dist/chunk-L5TQDBG4.cjs.map +1 -0
- package/dist/{chunk-2MGJXBBJ.cjs → chunk-SUMXDNYG.cjs} +157 -6
- package/dist/chunk-SUMXDNYG.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/conversation-list.js +32 -4
- package/dist/conversation-list.js.map +2 -2
- package/dist/directmessages/chat-cache.js +5 -0
- package/dist/directmessages/chat-cache.js.map +2 -2
- package/dist/document-tools/core.cjs +62 -62
- package/dist/document-tools/index.cjs +62 -62
- package/dist/hooks.js +7 -1
- package/dist/hooks.js.map +2 -2
- package/dist/index.cjs +625 -603
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.ts +208 -1024
- package/dist/session/conversation-panels.js +41 -0
- package/dist/session/conversation-panels.js.map +7 -0
- package/dist/session/index.js +2 -0
- package/dist/session/index.js.map +2 -2
- package/dist/session/layout.js +7 -3
- package/dist/session/layout.js.map +2 -2
- package/dist/workspaces/switch.js +7 -4
- package/dist/workspaces/switch.js.map +2 -2
- package/package.json +3 -3
- package/dist/chunk-2MGJXBBJ.cjs.map +0 -1
- package/dist/chunk-GVU3KYP3.cjs.map +0 -1
- package/dist/chunk-SUZORMAB.cjs.map +0 -1
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var
|
|
3
|
+
var chunkZBI5AMZC_cjs = require('../chunk-ZBI5AMZC.cjs');
|
|
4
4
|
var chunk6TJL4Z2F_cjs = require('../chunk-6TJL4Z2F.cjs');
|
|
5
|
-
require('../chunk-
|
|
5
|
+
require('../chunk-L5TQDBG4.cjs');
|
|
6
6
|
require('../chunk-2IJP73ZG.cjs');
|
|
7
7
|
var chunkZZBCZRA5_cjs = require('../chunk-ZZBCZRA5.cjs');
|
|
8
8
|
require('../chunk-KULS4YWP.cjs');
|
|
@@ -249,243 +249,243 @@ async function setPdfAttachment(pdf, attachment) {
|
|
|
249
249
|
|
|
250
250
|
Object.defineProperty(exports, "DEFAULT_FIELD_SIZE", {
|
|
251
251
|
enumerable: true,
|
|
252
|
-
get: function () { return
|
|
252
|
+
get: function () { return chunkZBI5AMZC_cjs.DEFAULT_FIELD_SIZE; }
|
|
253
253
|
});
|
|
254
254
|
Object.defineProperty(exports, "FIELD_TYPE_LABELS", {
|
|
255
255
|
enumerable: true,
|
|
256
|
-
get: function () { return
|
|
256
|
+
get: function () { return chunkZBI5AMZC_cjs.FIELD_TYPE_LABELS; }
|
|
257
257
|
});
|
|
258
258
|
Object.defineProperty(exports, "INFORMAL_SIGNATURE_NOTE", {
|
|
259
259
|
enumerable: true,
|
|
260
|
-
get: function () { return
|
|
260
|
+
get: function () { return chunkZBI5AMZC_cjs.INFORMAL_SIGNATURE_NOTE; }
|
|
261
261
|
});
|
|
262
262
|
Object.defineProperty(exports, "LEGACY_LAYER_PREFIX", {
|
|
263
263
|
enumerable: true,
|
|
264
|
-
get: function () { return
|
|
264
|
+
get: function () { return chunkZBI5AMZC_cjs.LEGACY_LAYER_PREFIX; }
|
|
265
265
|
});
|
|
266
266
|
Object.defineProperty(exports, "MARK_FIELD_TYPES", {
|
|
267
267
|
enumerable: true,
|
|
268
|
-
get: function () { return
|
|
268
|
+
get: function () { return chunkZBI5AMZC_cjs.MARK_FIELD_TYPES; }
|
|
269
269
|
});
|
|
270
270
|
Object.defineProperty(exports, "MAX_MERGE_ATTEMPTS", {
|
|
271
271
|
enumerable: true,
|
|
272
|
-
get: function () { return
|
|
272
|
+
get: function () { return chunkZBI5AMZC_cjs.MAX_MERGE_ATTEMPTS; }
|
|
273
273
|
});
|
|
274
274
|
Object.defineProperty(exports, "MarkupStoreError", {
|
|
275
275
|
enumerable: true,
|
|
276
|
-
get: function () { return
|
|
276
|
+
get: function () { return chunkZBI5AMZC_cjs.MarkupStoreError; }
|
|
277
277
|
});
|
|
278
278
|
Object.defineProperty(exports, "SIGNATURE_FIELD_TYPES", {
|
|
279
279
|
enumerable: true,
|
|
280
|
-
get: function () { return
|
|
280
|
+
get: function () { return chunkZBI5AMZC_cjs.SIGNATURE_FIELD_TYPES; }
|
|
281
281
|
});
|
|
282
282
|
Object.defineProperty(exports, "SIGNED_UNCHANGED", {
|
|
283
283
|
enumerable: true,
|
|
284
|
-
get: function () { return
|
|
284
|
+
get: function () { return chunkZBI5AMZC_cjs.SIGNED_UNCHANGED; }
|
|
285
285
|
});
|
|
286
286
|
Object.defineProperty(exports, "SIGNER_PROGRESS_LABELS", {
|
|
287
287
|
enumerable: true,
|
|
288
|
-
get: function () { return
|
|
288
|
+
get: function () { return chunkZBI5AMZC_cjs.SIGNER_PROGRESS_LABELS; }
|
|
289
289
|
});
|
|
290
290
|
Object.defineProperty(exports, "SignatureVerificationError", {
|
|
291
291
|
enumerable: true,
|
|
292
|
-
get: function () { return
|
|
292
|
+
get: function () { return chunkZBI5AMZC_cjs.SignatureVerificationError; }
|
|
293
293
|
});
|
|
294
294
|
Object.defineProperty(exports, "VERIFY_PATH", {
|
|
295
295
|
enumerable: true,
|
|
296
|
-
get: function () { return
|
|
296
|
+
get: function () { return chunkZBI5AMZC_cjs.VERIFY_PATH; }
|
|
297
297
|
});
|
|
298
298
|
Object.defineProperty(exports, "addToMarkup", {
|
|
299
299
|
enumerable: true,
|
|
300
|
-
get: function () { return
|
|
300
|
+
get: function () { return chunkZBI5AMZC_cjs.addToMarkup; }
|
|
301
301
|
});
|
|
302
302
|
Object.defineProperty(exports, "canAnnotate", {
|
|
303
303
|
enumerable: true,
|
|
304
|
-
get: function () { return
|
|
304
|
+
get: function () { return chunkZBI5AMZC_cjs.canAnnotate; }
|
|
305
305
|
});
|
|
306
306
|
Object.defineProperty(exports, "copyOpenThreads", {
|
|
307
307
|
enumerable: true,
|
|
308
|
-
get: function () { return
|
|
308
|
+
get: function () { return chunkZBI5AMZC_cjs.copyOpenThreads; }
|
|
309
309
|
});
|
|
310
310
|
Object.defineProperty(exports, "createMarkupStore", {
|
|
311
311
|
enumerable: true,
|
|
312
|
-
get: function () { return
|
|
312
|
+
get: function () { return chunkZBI5AMZC_cjs.createMarkupStore; }
|
|
313
313
|
});
|
|
314
314
|
Object.defineProperty(exports, "deleteSavedSignature", {
|
|
315
315
|
enumerable: true,
|
|
316
|
-
get: function () { return
|
|
316
|
+
get: function () { return chunkZBI5AMZC_cjs.deleteSavedSignature; }
|
|
317
317
|
});
|
|
318
318
|
Object.defineProperty(exports, "fetchDocumentSignatureRequests", {
|
|
319
319
|
enumerable: true,
|
|
320
|
-
get: function () { return
|
|
320
|
+
get: function () { return chunkZBI5AMZC_cjs.fetchDocumentSignatureRequests; }
|
|
321
321
|
});
|
|
322
322
|
Object.defineProperty(exports, "fetchSavedSignature", {
|
|
323
323
|
enumerable: true,
|
|
324
|
-
get: function () { return
|
|
324
|
+
get: function () { return chunkZBI5AMZC_cjs.fetchSavedSignature; }
|
|
325
325
|
});
|
|
326
326
|
Object.defineProperty(exports, "fetchSignatureVerification", {
|
|
327
327
|
enumerable: true,
|
|
328
|
-
get: function () { return
|
|
328
|
+
get: function () { return chunkZBI5AMZC_cjs.fetchSignatureVerification; }
|
|
329
329
|
});
|
|
330
330
|
Object.defineProperty(exports, "fieldsFromSuggestions", {
|
|
331
331
|
enumerable: true,
|
|
332
|
-
get: function () { return
|
|
332
|
+
get: function () { return chunkZBI5AMZC_cjs.fieldsFromSuggestions; }
|
|
333
333
|
});
|
|
334
334
|
Object.defineProperty(exports, "fieldsInSigningOrder", {
|
|
335
335
|
enumerable: true,
|
|
336
|
-
get: function () { return
|
|
336
|
+
get: function () { return chunkZBI5AMZC_cjs.fieldsInSigningOrder; }
|
|
337
337
|
});
|
|
338
338
|
Object.defineProperty(exports, "forgetLegacyLayer", {
|
|
339
339
|
enumerable: true,
|
|
340
|
-
get: function () { return
|
|
340
|
+
get: function () { return chunkZBI5AMZC_cjs.forgetLegacyLayer; }
|
|
341
341
|
});
|
|
342
342
|
Object.defineProperty(exports, "frozenCopyName", {
|
|
343
343
|
enumerable: true,
|
|
344
|
-
get: function () { return
|
|
344
|
+
get: function () { return chunkZBI5AMZC_cjs.frozenCopyName; }
|
|
345
345
|
});
|
|
346
346
|
Object.defineProperty(exports, "initialsOf", {
|
|
347
347
|
enumerable: true,
|
|
348
|
-
get: function () { return
|
|
348
|
+
get: function () { return chunkZBI5AMZC_cjs.initialsOf; }
|
|
349
349
|
});
|
|
350
350
|
Object.defineProperty(exports, "inviteSigners", {
|
|
351
351
|
enumerable: true,
|
|
352
|
-
get: function () { return
|
|
352
|
+
get: function () { return chunkZBI5AMZC_cjs.inviteSigners; }
|
|
353
353
|
});
|
|
354
354
|
Object.defineProperty(exports, "isEmailSigner", {
|
|
355
355
|
enumerable: true,
|
|
356
|
-
get: function () { return
|
|
356
|
+
get: function () { return chunkZBI5AMZC_cjs.isEmailSigner; }
|
|
357
357
|
});
|
|
358
358
|
Object.defineProperty(exports, "isSignatureReference", {
|
|
359
359
|
enumerable: true,
|
|
360
|
-
get: function () { return
|
|
360
|
+
get: function () { return chunkZBI5AMZC_cjs.isSignatureReference; }
|
|
361
361
|
});
|
|
362
362
|
Object.defineProperty(exports, "marksByVersion", {
|
|
363
363
|
enumerable: true,
|
|
364
|
-
get: function () { return
|
|
364
|
+
get: function () { return chunkZBI5AMZC_cjs.marksByVersion; }
|
|
365
365
|
});
|
|
366
366
|
Object.defineProperty(exports, "matchSignedCopy", {
|
|
367
367
|
enumerable: true,
|
|
368
|
-
get: function () { return
|
|
368
|
+
get: function () { return chunkZBI5AMZC_cjs.matchSignedCopy; }
|
|
369
369
|
});
|
|
370
370
|
Object.defineProperty(exports, "migrateLegacyLayer", {
|
|
371
371
|
enumerable: true,
|
|
372
|
-
get: function () { return
|
|
372
|
+
get: function () { return chunkZBI5AMZC_cjs.migrateLegacyLayer; }
|
|
373
373
|
});
|
|
374
374
|
Object.defineProperty(exports, "newFieldId", {
|
|
375
375
|
enumerable: true,
|
|
376
|
-
get: function () { return
|
|
376
|
+
get: function () { return chunkZBI5AMZC_cjs.newFieldId; }
|
|
377
377
|
});
|
|
378
378
|
Object.defineProperty(exports, "openThreadsOf", {
|
|
379
379
|
enumerable: true,
|
|
380
|
-
get: function () { return
|
|
380
|
+
get: function () { return chunkZBI5AMZC_cjs.openThreadsOf; }
|
|
381
381
|
});
|
|
382
382
|
Object.defineProperty(exports, "pngBytes", {
|
|
383
383
|
enumerable: true,
|
|
384
|
-
get: function () { return
|
|
384
|
+
get: function () { return chunkZBI5AMZC_cjs.pngBytes; }
|
|
385
385
|
});
|
|
386
386
|
Object.defineProperty(exports, "pngSize", {
|
|
387
387
|
enumerable: true,
|
|
388
|
-
get: function () { return
|
|
388
|
+
get: function () { return chunkZBI5AMZC_cjs.pngSize; }
|
|
389
389
|
});
|
|
390
390
|
Object.defineProperty(exports, "readLegacyLayer", {
|
|
391
391
|
enumerable: true,
|
|
392
|
-
get: function () { return
|
|
392
|
+
get: function () { return chunkZBI5AMZC_cjs.readLegacyLayer; }
|
|
393
393
|
});
|
|
394
394
|
Object.defineProperty(exports, "redactionLogName", {
|
|
395
395
|
enumerable: true,
|
|
396
|
-
get: function () { return
|
|
396
|
+
get: function () { return chunkZBI5AMZC_cjs.redactionLogName; }
|
|
397
397
|
});
|
|
398
398
|
Object.defineProperty(exports, "saveSignatureRequest", {
|
|
399
399
|
enumerable: true,
|
|
400
|
-
get: function () { return
|
|
400
|
+
get: function () { return chunkZBI5AMZC_cjs.saveSignatureRequest; }
|
|
401
401
|
});
|
|
402
402
|
Object.defineProperty(exports, "sendBlocker", {
|
|
403
403
|
enumerable: true,
|
|
404
|
-
get: function () { return
|
|
404
|
+
get: function () { return chunkZBI5AMZC_cjs.sendBlocker; }
|
|
405
405
|
});
|
|
406
406
|
Object.defineProperty(exports, "signSignatureRequest", {
|
|
407
407
|
enumerable: true,
|
|
408
|
-
get: function () { return
|
|
408
|
+
get: function () { return chunkZBI5AMZC_cjs.signSignatureRequest; }
|
|
409
409
|
});
|
|
410
410
|
Object.defineProperty(exports, "signatureFieldSuggestions", {
|
|
411
411
|
enumerable: true,
|
|
412
|
-
get: function () { return
|
|
412
|
+
get: function () { return chunkZBI5AMZC_cjs.signatureFieldSuggestions; }
|
|
413
413
|
});
|
|
414
414
|
Object.defineProperty(exports, "splitSuggestions", {
|
|
415
415
|
enumerable: true,
|
|
416
|
-
get: function () { return
|
|
416
|
+
get: function () { return chunkZBI5AMZC_cjs.splitSuggestions; }
|
|
417
417
|
});
|
|
418
418
|
Object.defineProperty(exports, "storeSavedSignature", {
|
|
419
419
|
enumerable: true,
|
|
420
|
-
get: function () { return
|
|
420
|
+
get: function () { return chunkZBI5AMZC_cjs.storeSavedSignature; }
|
|
421
421
|
});
|
|
422
422
|
Object.defineProperty(exports, "suggestSignatureFields", {
|
|
423
423
|
enumerable: true,
|
|
424
|
-
get: function () { return
|
|
424
|
+
get: function () { return chunkZBI5AMZC_cjs.suggestSignatureFields; }
|
|
425
425
|
});
|
|
426
426
|
Object.defineProperty(exports, "uploadFrozenCopy", {
|
|
427
427
|
enumerable: true,
|
|
428
|
-
get: function () { return
|
|
428
|
+
get: function () { return chunkZBI5AMZC_cjs.uploadFrozenCopy; }
|
|
429
429
|
});
|
|
430
430
|
Object.defineProperty(exports, "useDeclineSignatureRequest", {
|
|
431
431
|
enumerable: true,
|
|
432
|
-
get: function () { return
|
|
432
|
+
get: function () { return chunkZBI5AMZC_cjs.useDeclineSignatureRequest; }
|
|
433
433
|
});
|
|
434
434
|
Object.defineProperty(exports, "useDeleteSavedSignature", {
|
|
435
435
|
enumerable: true,
|
|
436
|
-
get: function () { return
|
|
436
|
+
get: function () { return chunkZBI5AMZC_cjs.useDeleteSavedSignature; }
|
|
437
437
|
});
|
|
438
438
|
Object.defineProperty(exports, "useDocumentBytes", {
|
|
439
439
|
enumerable: true,
|
|
440
|
-
get: function () { return
|
|
440
|
+
get: function () { return chunkZBI5AMZC_cjs.useDocumentBytes; }
|
|
441
441
|
});
|
|
442
442
|
Object.defineProperty(exports, "useDocumentMarkup", {
|
|
443
443
|
enumerable: true,
|
|
444
|
-
get: function () { return
|
|
444
|
+
get: function () { return chunkZBI5AMZC_cjs.useDocumentMarkup; }
|
|
445
445
|
});
|
|
446
446
|
Object.defineProperty(exports, "useDocumentSignatureRequests", {
|
|
447
447
|
enumerable: true,
|
|
448
|
-
get: function () { return
|
|
448
|
+
get: function () { return chunkZBI5AMZC_cjs.useDocumentSignatureRequests; }
|
|
449
449
|
});
|
|
450
450
|
Object.defineProperty(exports, "useInviteSigners", {
|
|
451
451
|
enumerable: true,
|
|
452
|
-
get: function () { return
|
|
452
|
+
get: function () { return chunkZBI5AMZC_cjs.useInviteSigners; }
|
|
453
453
|
});
|
|
454
454
|
Object.defineProperty(exports, "useIsOnline", {
|
|
455
455
|
enumerable: true,
|
|
456
|
-
get: function () { return
|
|
456
|
+
get: function () { return chunkZBI5AMZC_cjs.useIsOnline; }
|
|
457
457
|
});
|
|
458
458
|
Object.defineProperty(exports, "useSaveSignatureRequest", {
|
|
459
459
|
enumerable: true,
|
|
460
|
-
get: function () { return
|
|
460
|
+
get: function () { return chunkZBI5AMZC_cjs.useSaveSignatureRequest; }
|
|
461
461
|
});
|
|
462
462
|
Object.defineProperty(exports, "useSavedSignature", {
|
|
463
463
|
enumerable: true,
|
|
464
|
-
get: function () { return
|
|
464
|
+
get: function () { return chunkZBI5AMZC_cjs.useSavedSignature; }
|
|
465
465
|
});
|
|
466
466
|
Object.defineProperty(exports, "useSignSignatureRequest", {
|
|
467
467
|
enumerable: true,
|
|
468
|
-
get: function () { return
|
|
468
|
+
get: function () { return chunkZBI5AMZC_cjs.useSignSignatureRequest; }
|
|
469
469
|
});
|
|
470
470
|
Object.defineProperty(exports, "useSignatureVerification", {
|
|
471
471
|
enumerable: true,
|
|
472
|
-
get: function () { return
|
|
472
|
+
get: function () { return chunkZBI5AMZC_cjs.useSignatureVerification; }
|
|
473
473
|
});
|
|
474
474
|
Object.defineProperty(exports, "useSignerCandidates", {
|
|
475
475
|
enumerable: true,
|
|
476
|
-
get: function () { return
|
|
476
|
+
get: function () { return chunkZBI5AMZC_cjs.useSignerCandidates; }
|
|
477
477
|
});
|
|
478
478
|
Object.defineProperty(exports, "useStoreSavedSignature", {
|
|
479
479
|
enumerable: true,
|
|
480
|
-
get: function () { return
|
|
480
|
+
get: function () { return chunkZBI5AMZC_cjs.useStoreSavedSignature; }
|
|
481
481
|
});
|
|
482
482
|
Object.defineProperty(exports, "useVoidSignatureRequest", {
|
|
483
483
|
enumerable: true,
|
|
484
|
-
get: function () { return
|
|
484
|
+
get: function () { return chunkZBI5AMZC_cjs.useVoidSignatureRequest; }
|
|
485
485
|
});
|
|
486
486
|
Object.defineProperty(exports, "versionsWithMarkup", {
|
|
487
487
|
enumerable: true,
|
|
488
|
-
get: function () { return
|
|
488
|
+
get: function () { return chunkZBI5AMZC_cjs.versionsWithMarkup; }
|
|
489
489
|
});
|
|
490
490
|
Object.defineProperty(exports, "DocumentFetchError", {
|
|
491
491
|
enumerable: true,
|
package/dist/hooks.js
CHANGED
|
@@ -6,6 +6,7 @@ import { isUsageMetered } from "./usage-metered.js";
|
|
|
6
6
|
import { parseVersionRef } from "./artifacts/versions.js";
|
|
7
7
|
import { arbiQueryKeys, arbiMutationKeys } from "./query-keys.js";
|
|
8
8
|
import { arbiQueryKeys as arbiQueryKeys2 } from "./query-keys.js";
|
|
9
|
+
import { readConversationList } from "./conversation-list.js";
|
|
9
10
|
function useWorkspaces(options) {
|
|
10
11
|
const arbi = useArbi();
|
|
11
12
|
return useQuery({
|
|
@@ -24,11 +25,16 @@ function useDocumentVersionList(docId, options) {
|
|
|
24
25
|
}
|
|
25
26
|
function useConversations(workspaceId, options) {
|
|
26
27
|
const arbi = useArbi();
|
|
28
|
+
const queryClient = useQueryClient();
|
|
27
29
|
const live = options?.live === true;
|
|
28
30
|
return useQuery({
|
|
29
31
|
queryKey: arbiQueryKeys2.conversations(workspaceId ?? ""),
|
|
30
32
|
// The request names the workspace, so a switch while it runs cannot answer for another.
|
|
31
|
-
queryFn: () =>
|
|
33
|
+
queryFn: () => readConversationList(
|
|
34
|
+
queryClient,
|
|
35
|
+
workspaceId,
|
|
36
|
+
() => arbi.conversations.list({ workspaceId })
|
|
37
|
+
),
|
|
32
38
|
enabled: (options?.enabled ?? true) && !!workspaceId && arbi.hasWorkspace,
|
|
33
39
|
placeholderData: (previous) => previous,
|
|
34
40
|
...live ? {
|
package/dist/hooks.js.map
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../src/hooks.ts"],
|
|
4
|
-
"sourcesContent": ["/**\n * React Query hooks that use the Arbi instance from context.\n */\n\nimport { useEffect, useMemo, useRef } from 'react'\nimport { useInfiniteQuery, useQuery, useMutation, useQueryClient } from '@tanstack/react-query'\nimport {\n type AskHandlers,\n type AskRequest,\n type SSEStreamResult,\n type TagListQuery,\n type ThreadsResponse,\n} from '@arbidocs/sdk/browser'\nimport type { components } from '@arbidocs/client'\nimport { useArbi } from './useArbi'\nimport { useArbiSessionStore } from './session'\nimport type { ParsedDocument } from './documents/parsed-types'\nimport { isUsageMetered } from './usage-metered'\nimport { parseVersionRef } from './artifacts/versions'\n\n// \u2500\u2500 Query keys \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\n\n// The one key factory (every query and mutation key of the packages and the app): ./query-keys.\nexport { arbiQueryKeys, arbiMutationKeys } from './query-keys'\nimport { arbiQueryKeys } from './query-keys'\n\n// \u2500\u2500 Hooks \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\n\n/** List the logged-in user's workspaces. */\nexport function useWorkspaces(options?: { enabled?: boolean }) {\n const arbi = useArbi()\n return useQuery({\n queryKey: arbiQueryKeys.workspaces(),\n queryFn: () => arbi.workspaces.list(),\n enabled: (options?.enabled ?? true) && arbi.isLoggedIn,\n })\n}\n\n/** Every version of the document `docId`, oldest first (`is_current` marks the current one). */\nexport function useDocumentVersionList(\n docId: string | null | undefined,\n options?: { enabled?: boolean }\n) {\n const arbi = useArbi()\n return useQuery({\n queryKey: arbiQueryKeys.documentVersions(docId ?? ''),\n queryFn: () => arbi.documents.versions(docId as string),\n enabled: (options?.enabled ?? true) && !!docId && arbi.hasWorkspace,\n })\n}\n\n/**\n * A workspace's conversations (threads and tasks). The list is kept current by its writers and the\n * workspace's events (`conversation-list`), so it is not re-read on every mount; `live` re-reads it\n * on a timer instead, faster while something is generating, for a view that follows runs by itself.\n */\nexport function useConversations(\n workspaceId: string | undefined,\n options?: { enabled?: boolean; live?: boolean }\n) {\n const arbi = useArbi()\n const live = options?.live === true\n return useQuery({\n queryKey: arbiQueryKeys.conversations(workspaceId ?? ''),\n // The request names the workspace, so a switch while it runs cannot answer for another.\n queryFn: () => arbi.conversations.list({ workspaceId: workspaceId as string }),\n enabled: (options?.enabled ?? true) && !!workspaceId && arbi.hasWorkspace,\n placeholderData: (previous) => previous,\n ...(live\n ? {\n refetchInterval: (query: { state: { data?: Array<{ status?: string | null }> } }) =>\n query.state.data?.some((conversation) => conversation.status === 'generating')\n ? 3000\n : 15000,\n }\n : { staleTime: Infinity, refetchOnMount: false, refetchOnReconnect: false }),\n })\n}\n\n/** The backend's built-in slash commands (`/compact`, `/goal`, \u2026), for a slash menu. */\nexport function useBuiltinCommands() {\n const arbi = useArbi()\n const query = useQuery({\n queryKey: arbiQueryKeys.assistantCommands(),\n queryFn: () => arbi.assistant.commands(),\n staleTime: 30 * 1000,\n enabled: arbi.isLoggedIn,\n })\n // Stable identity so a menu's merge and filter memos do not rerun every render.\n const commands = useMemo(() => query.data ?? [], [query.data])\n return { commands, isLoading: query.isLoading }\n}\n\n/** One stored message with everything the server keeps on it (its trace and metadata). */\nexport function useMessageDetails(\n messageId: string | null | undefined,\n options?: { enabled?: boolean }\n) {\n const arbi = useArbi()\n return useQuery({\n queryKey: arbiQueryKeys.messageDetails(messageId ?? ''),\n queryFn: () => arbi.conversations.getMessage(messageId as string),\n enabled: (options?.enabled ?? true) && !!messageId && arbi.isLoggedIn,\n })\n}\n\n/**\n * A conversation's stored threads (each with its message history, citations data included). The\n * chat engine and the conversation's events keep the cache current, so it is re-read only when\n * stale (2 minutes) or when the page is shown again while this tab is not streaming the\n * conversation (a turn sent from another tab never reaches this one's socket). A conversation with\n * no messages yet (a new to-do, a workflow's task before its run) comes back with no threads. A 404\n * is a conversation this user cannot see (gone, or in a workspace they left): an error, never cached\n * as an empty conversation to write into. `live` re-reads it every few seconds.\n */\nexport function useConversationThreads(\n conversationId: string | undefined,\n options?: { enabled?: boolean; live?: boolean }\n) {\n const arbi = useArbi()\n const session = useArbiSessionStore()\n return useQuery({\n queryKey: arbiQueryKeys.conversationThreads(conversationId ?? ''),\n queryFn: (): Promise<ThreadsResponse> =>\n arbi.conversations.getThreads(conversationId as string),\n enabled: (options?.enabled ?? true) && !!conversationId && arbi.hasWorkspace,\n staleTime: 2 * 60 * 1000,\n refetchOnWindowFocus: () =>\n session.getState().generating[conversationId ?? '']?.isGenerating ? false : 'always',\n refetchInterval: options?.live ? 3000 : false,\n })\n}\n\n/** A tag list query as a stable cache key ('' for every tag). */\nconst tagListKey = (query: TagListQuery): string =>\n [\n query.kind ? `kind:${query.kind}` : '',\n query.parentId ? `parent:${query.parentId}` : '',\n query.ids?.length ? `ids:${query.ids.join(',')}` : '',\n query.include?.length ? `include:${query.include.join(',')}` : '',\n query.linksLimit !== undefined ? `links:${query.linksLimit}` : '',\n ]\n .filter(Boolean)\n .join('|')\n\n/**\n * List tags in a workspace (default: the open one) \u2014 all of them, or filtered: `{ kind: 'issue',\n * include: ['links'] }` is every issue with its documents, facts and threads (a table's rows; its\n * columns come from `useTagKindSchema`). `ids: []` asks for nothing.\n *\n * The whole list is read once and then kept current in place: the tag writes patch it\n * (`patchWorkspaceTags`), and an invalidation of the workspace's tags (a WebSocket event, a host\n * refresh) re-reads it. It is never re-read just for being mounted or the window being focused.\n */\nexport function useTags(\n workspaceId?: string | null,\n options?: TagListQuery & { enabled?: boolean }\n) {\n const arbi = useArbi()\n const { enabled, ...query } = options ?? {}\n const workspace = workspaceId ?? (arbi.hasWorkspace ? arbi.getWorkspaceId() : '')\n const key = tagListKey(query)\n return useQuery({\n queryKey: key ? arbiQueryKeys.tagList(workspace, key) : arbiQueryKeys.tags(workspace),\n // The request names the workspace (opened for this session first when it is not the current\n // one), so another workspace's tags can be listed and a switch cannot answer for it. The\n // current workspace's list is also read under the switch guard.\n queryFn: () => {\n const list = () => arbi.tags.list({ ...(key ? query : {}), workspaceId: workspace })\n return workspace === arbi.getWorkspaceId() ? arbi.readInWorkspace(workspace, list) : list()\n },\n enabled:\n (enabled ?? true) &&\n !!workspace &&\n arbi.hasWorkspace &&\n (query.ids === undefined || query.ids.length > 0),\n ...(key ? {} : { staleTime: Infinity }),\n })\n}\n\n/**\n * Batch-fetch first-page thumbnails for a set of documents. Returns a map of\n * doc external id \u2192 `data:image/webp` URI (or `null` when no thumbnail exists).\n * Cached for a few minutes since thumbnails are effectively immutable per doc.\n */\nexport function useThumbnails(docIds: string[], options?: { enabled?: boolean }) {\n const arbi = useArbi()\n return useQuery({\n queryKey: arbiQueryKeys.thumbnails(docIds),\n queryFn: () => arbi.documents.getThumbnails(docIds),\n enabled: (options?.enabled ?? true) && docIds.length > 0 && arbi.hasWorkspace,\n staleTime: 5 * 60_000,\n })\n}\n\n/**\n * Fetch a document's parsed content (chunks grouped by page) for the review\n * viewer. `stage` defaults to `final` (fully processed); `marker`/`subchunk`\n * expose earlier pipeline stages. `docId` may be a version reference (`doc-\u2026@v2`).\n */\nexport function useParsedDocument(\n docId: string | undefined,\n stage: string = 'final',\n options?: { enabled?: boolean }\n) {\n const arbi = useArbi()\n return useQuery({\n queryKey: arbiQueryKeys.parsedDoc(docId ?? '', stage),\n queryFn: () => {\n // A version reference (`doc-\u2026@v2`) reads that version's parse.\n const { docId: id, version } = parseVersionRef(docId as string)\n return arbi.documents.getParsedContent(\n id,\n stage,\n version ?? undefined\n ) as unknown as Promise<ParsedDocument>\n },\n enabled: (options?.enabled ?? true) && !!docId && arbi.hasWorkspace,\n })\n}\n\n/**\n * Ask the assistant (`arbi.assistant.ask`) as a mutation: one streaming turn, its frames to\n * `handlers`, resolving with the accumulated result.\n */\nexport function useAssistantQuery() {\n const arbi = useArbi()\n return useMutation<SSEStreamResult, Error, { request: AskRequest; handlers?: AskHandlers }>({\n mutationFn: ({ request, handlers }) => arbi.assistant.ask(request, handlers),\n })\n}\n\n/** List agents owned by the current user. */\nexport function useAgents(options?: { enabled?: boolean }) {\n const arbi = useArbi()\n return useQuery({\n queryKey: arbiQueryKeys.agents(),\n queryFn: () => arbi.agents.list(),\n enabled: (options?.enabled ?? true) && arbi.isLoggedIn,\n })\n}\n\n/**\n * Delete agents. Returns a mutation. Refreshes the agent list, the workflow list and the conversation list\n * (a deleted agent's workflows and work go with it), and drops the deleted agents' own config and workspace queries.\n */\nexport function useDeleteAgents() {\n const arbi = useArbi()\n const qc = useQueryClient()\n return useMutation<unknown, Error, { agentExtIds: string[] }>({\n mutationFn: ({ agentExtIds }) => arbi.agents.delete(agentExtIds),\n onSuccess: (_result, { agentExtIds }) => {\n for (const id of agentExtIds) {\n qc.removeQueries({ queryKey: arbiQueryKeys.agentConfig(id) })\n qc.removeQueries({ queryKey: arbiQueryKeys.agentWorkspaces(id) })\n }\n return Promise.all([\n qc.invalidateQueries({ queryKey: arbiQueryKeys.agents() }),\n qc.invalidateQueries({ queryKey: arbiQueryKeys.workflows() }),\n qc.invalidateQueries({ queryKey: arbiQueryKeys.allConversations() }),\n qc.invalidateQueries({ queryKey: arbiQueryKeys.configs() }),\n ])\n },\n })\n}\n\n/** Authorize a delegated session (generates claim code). Returns a mutation. */\n\n/** Check backend health. */\nexport function useHealth(options?: { enabled?: boolean }) {\n const arbi = useArbi()\n return useQuery({\n queryKey: arbiQueryKeys.health(),\n queryFn: () => arbi.health.check(),\n enabled: options?.enabled,\n })\n}\n\n/**\n * The deployment's models with their tags (`Standard`, `Premium`), providers and per-token costs,\n * and the default premium model. Static per deployment: read once.\n */\nexport function useAvailableModels(options?: { enabled?: boolean }) {\n const arbi = useArbi()\n return useQuery({\n queryKey: arbiQueryKeys.availableModels(),\n queryFn: () => arbi.health.models(),\n staleTime: Infinity,\n enabled: (options?.enabled ?? true) && arbi.isLoggedIn,\n })\n}\n\n// \u2500\u2500 Behaviour-template configs \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\n\n/** List the caller's saved agent configurations (behaviour templates). */\nexport function useConfigs(options?: { enabled?: boolean }) {\n const arbi = useArbi()\n return useQuery({\n queryKey: arbiQueryKeys.configVersions(),\n queryFn: () => arbi.agentConfig.list(),\n enabled: options?.enabled ?? arbi.isLoggedIn,\n })\n}\n\n/** One saved agent configuration (its models, its tools). Configs change only on a save. */\nexport function useConfig(configId: string | null | undefined, options?: { enabled?: boolean }) {\n const arbi = useArbi()\n return useQuery({\n queryKey: arbiQueryKeys.config(configId ?? ''),\n queryFn: () => arbi.agentConfig.get(configId as string),\n staleTime: 10 * 60 * 1000,\n enabled: (options?.enabled ?? true) && !!configId && arbi.isLoggedIn,\n })\n}\n\n// \u2500\u2500 Activity feed \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\n\n/**\n * List the caller's durable activity feed, newest first.\n *\n * Activity entries are backend-originated, to-self log lines that are always\n * read \u2014 they are deliberately kept out of the normal notifications/DM feed and\n * never affect the unread badge, so this is a separate, opt-in query.\n */\nexport function useActivity(options?: { enabled?: boolean; limit?: number; offset?: number }) {\n const arbi = useArbi()\n return useQuery({\n queryKey: arbiQueryKeys.activity(),\n queryFn: () => arbi.dm.listActivity({ limit: options?.limit, offset: options?.offset }),\n enabled: options?.enabled ?? arbi.isLoggedIn,\n })\n}\n\n/**\n * A workspace's activity feed, newest first, a page at a time: thread history, people posting,\n * uploads, new versions and signatures, workflow runs. Only what the caller can see. The pages\n * are `data.pages`; `fetchNextPage` reads the next one while `hasNextPage`.\n */\nexport function useWorkspaceActivity(\n workspaceId: string | null | undefined,\n options?: {\n enabled?: boolean\n limit?: number\n /** Runs before each page, e.g. to (re)open the workspace so titles and names decrypt. */\n beforeFetch?: () => Promise<unknown>\n }\n) {\n const arbi = useArbi()\n return useInfiniteQuery({\n queryKey: arbiQueryKeys.workspaceActivity(workspaceId ?? '', options?.limit),\n queryFn: async ({ pageParam }) => {\n await options?.beforeFetch?.()\n return arbi.workspaces.activity(workspaceId as string, {\n cursor: pageParam,\n limit: options?.limit,\n })\n },\n initialPageParam: null as string | null,\n getNextPageParam: (page) => page.next_cursor ?? undefined,\n enabled: (options?.enabled ?? true) && !!workspaceId && arbi.isLoggedIn,\n })\n}\n\n// \u2500\u2500 Projects, usage & spend \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\n\n/** List the logged-in user's projects (billing accounts). */\nexport function useProjects(options?: { enabled?: boolean }) {\n const arbi = useArbi()\n return useQuery({\n queryKey: arbiQueryKeys.projects(),\n queryFn: () => arbi.projects.list(),\n enabled: options?.enabled ?? arbi.isLoggedIn,\n })\n}\n\n/**\n * AI usage breakdown for a project's billing period. `monthsBack` selects the period (0 =\n * current, 1 = previous month, \u2026).\n *\n * The response's `total_spend` / `spend` fields are \u00A3 of AI usage (format with `formatGbp`).\n * `metered` is `false` when the deployment does not record usage (a `dev`-plan project with all\n * zeros): show \"usage is not metered here\" instead of zeros. It is `undefined` until the usage\n * has loaded.\n */\nexport function useProjectUsage(\n projectExtId: string | undefined,\n monthsBack: number = 0,\n options?: { enabled?: boolean }\n) {\n const arbi = useArbi()\n const usage = useQuery({\n queryKey: arbiQueryKeys.projectUsage(projectExtId ?? '', monthsBack),\n queryFn: () => arbi.projects.usage(projectExtId as string, monthsBack),\n enabled: (options?.enabled ?? true) && !!projectExtId && arbi.isLoggedIn,\n })\n const projects = useProjects({ enabled: !!projectExtId && (options?.enabled ?? true) })\n const subscription = projects.data?.find((p) => p.external_id === projectExtId)?.subscription\n const metered = usage.data ? isUsageMetered(usage.data, subscription) : undefined\n return { ...usage, metered }\n}\n\n/** List the Stripe invoices for a project's subscription. */\nexport function useProjectInvoices(\n projectExtId: string | undefined,\n options?: { enabled?: boolean }\n) {\n const arbi = useArbi()\n return useQuery({\n queryKey: arbiQueryKeys.projectInvoices(projectExtId ?? ''),\n queryFn: () => arbi.projects.invoices(projectExtId as string),\n enabled: (options?.enabled ?? true) && !!projectExtId && arbi.isLoggedIn,\n })\n}\n\n/**\n * The signed-in user from `GET /v1/user/me`. Refetched on window focus, so a role granted or\n * removed elsewhere shows up without a reload; invalidate `arbiQueryKeys.currentUser()` after a\n * change you made yourself.\n */\nexport function useCurrentUser(options?: { enabled?: boolean }) {\n const arbi = useArbi()\n return useQuery({\n queryKey: arbiQueryKeys.currentUser(),\n queryFn: () => arbi.user.me(),\n enabled: options?.enabled ?? arbi.isLoggedIn,\n refetchOnWindowFocus: true,\n staleTime: 30_000,\n })\n}\n\n/**\n * The firm's pooled monthly \u00A3 of AI usage (Box deployments). A 403 (the caller is not a firm member\n * or Box admin) is not retried: treat an error like `has_pool: false` and show nothing.\n */\nfunction useFirmPool(options?: { enabled?: boolean }) {\n const arbi = useArbi()\n return useQuery({\n queryKey: arbiQueryKeys.firmPool(),\n queryFn: () => arbi.firm.pool(),\n enabled: (options?.enabled ?? true) && arbi.isLoggedIn,\n retry: false,\n refetchOnWindowFocus: true,\n staleTime: 60_000,\n })\n}\n\n/**\n * Whether this deployment runs under a Box licence (`isBox`) and whether the user administers it in\n * the ARBI portal (`isBoxAdmin`), from the firm pool. Anyone outside the firm gets a 403 (not\n * retried), read as no Box. The API has no Box-admin flag yet: `can_top_up` is true only for a Box\n * admin of a licence central can bill, so admins of a hand-set licence read as members for now.\n */\nexport function useBoxRole(options: { enabled?: boolean } = {}): {\n isBox: boolean\n isBoxAdmin: boolean\n} {\n const { data, isError } = useFirmPool(options)\n const isBox = !isError && !!data?.has_pool\n return { isBox, isBoxAdmin: isBox && !!data?.can_top_up }\n}\n\n/** Why \"New project\" / \"New workspace\" is unavailable to someone who may not create them. */\nexport const PROJECT_CREATION_DENIED_REASON =\n 'Only members of your firm can create projects and workspaces.'\n\n/** Why the server refuses \"New project\" (`GET /v1/user/me`: `project_creation_refusal`). */\nexport type ProjectCreationRefusal = NonNullable<\n components['schemas']['CurrentUserResponse']['project_creation_refusal']\n>\n\nconst PROJECT_CREATION_REFUSAL_REASONS: Record<ProjectCreationRefusal, string> = {\n external_user: 'External users cannot create projects.',\n not_a_member: PROJECT_CREATION_DENIED_REASON,\n managers_only: 'Only managers can create projects on this deployment.',\n pro_required: 'Upgrade your personal project to Pro to create more projects.',\n}\n\n/** The signed-in user, re-read when their workspace memberships change (a role can change what they may create). */\nfunction useCreationRights() {\n const user = useCurrentUser()\n const { data: workspaces } = useWorkspaces({ enabled: user.isSuccess })\n const membership = workspaces?.map((w) => w.external_id).join(',')\n const { refetch } = user\n const seen = useRef<string | undefined>(undefined)\n useEffect(() => {\n if (membership === undefined || membership === seen.current) return\n const first = seen.current === undefined\n seen.current = membership\n if (!first) void refetch()\n }, [membership, refetch])\n return user.data\n}\n\n/**\n * Whether the signed-in user may create projects. `undefined` while the user is loading: callers\n * should neither offer nor refuse creation until it is known.\n */\nexport function useCanCreateProjects(): boolean | undefined {\n return useCreationRights()?.can_create_projects\n}\n\n/**\n * Why the signed-in user may not create projects, or `undefined` when they may (or while loading).\n * `refusal` is the server's code: `pro_required` on the hosted service means \"upgrade your personal\n * project to Pro\", so hosts can offer the plans instead of a dead button.\n */\nexport function useProjectCreationDenial():\n { refusal: ProjectCreationRefusal | undefined; reason: string } | undefined {\n const me = useCreationRights()\n if (!me || me.can_create_projects) return undefined\n const refusal = me.project_creation_refusal ?? undefined\n return {\n refusal,\n reason: refusal ? PROJECT_CREATION_REFUSAL_REASONS[refusal] : PROJECT_CREATION_DENIED_REASON,\n }\n}\n\n/**\n * Whether the signed-in user may create workspaces (in projects they own). A free hosted user may,\n * though not projects. `undefined` while loading.\n */\nexport function useCanCreateWorkspaces(): boolean | undefined {\n const me = useCreationRights()\n // An older server has no can_create_workspaces: it gated both on can_create_projects.\n return me && (me.can_create_workspaces ?? me.can_create_projects)\n}\n\n/**\n * Today's deployment-wide AI usage (\u00A3, `used_gbp`) for the signed-in user: pair it with a project's\n * `daily_cap_per_user` for a \"\u00A3 used today\" indicator. Re-read on mount and window focus, and when\n * the host invalidates it after the user's own generation; never polled.\n */\nexport function useUserUsageToday(options?: { enabled?: boolean }) {\n const arbi = useArbi()\n return useQuery({\n queryKey: arbiQueryKeys.userUsageToday(),\n queryFn: () => arbi.user.usageToday(),\n enabled: (options?.enabled ?? true) && arbi.isLoggedIn,\n refetchOnWindowFocus: true,\n refetchOnMount: 'always',\n staleTime: 15_000,\n })\n}\n"],
|
|
5
|
-
"mappings": "AAIA,SAAS,WAAW,SAAS,cAAc;AAC3C,SAAS,kBAAkB,UAAU,aAAa,sBAAsB;AASxE,SAAS,eAAe;AACxB,SAAS,2BAA2B;AAEpC,SAAS,sBAAsB;AAC/B,SAAS,uBAAuB;AAKhC,SAAS,eAAe,wBAAwB;AAChD,SAAS,iBAAAA,sBAAqB;
|
|
4
|
+
"sourcesContent": ["/**\n * React Query hooks that use the Arbi instance from context.\n */\n\nimport { useEffect, useMemo, useRef } from 'react'\nimport { useInfiniteQuery, useQuery, useMutation, useQueryClient } from '@tanstack/react-query'\nimport {\n type AskHandlers,\n type AskRequest,\n type SSEStreamResult,\n type TagListQuery,\n type ThreadsResponse,\n} from '@arbidocs/sdk/browser'\nimport type { components } from '@arbidocs/client'\nimport { useArbi } from './useArbi'\nimport { useArbiSessionStore } from './session'\nimport type { ParsedDocument } from './documents/parsed-types'\nimport { isUsageMetered } from './usage-metered'\nimport { parseVersionRef } from './artifacts/versions'\n\n// \u2500\u2500 Query keys \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\n\n// The one key factory (every query and mutation key of the packages and the app): ./query-keys.\nexport { arbiQueryKeys, arbiMutationKeys } from './query-keys'\nimport { arbiQueryKeys } from './query-keys'\nimport { readConversationList } from './conversation-list'\n\n// \u2500\u2500 Hooks \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\n\n/** List the logged-in user's workspaces. */\nexport function useWorkspaces(options?: { enabled?: boolean }) {\n const arbi = useArbi()\n return useQuery({\n queryKey: arbiQueryKeys.workspaces(),\n queryFn: () => arbi.workspaces.list(),\n enabled: (options?.enabled ?? true) && arbi.isLoggedIn,\n })\n}\n\n/** Every version of the document `docId`, oldest first (`is_current` marks the current one). */\nexport function useDocumentVersionList(\n docId: string | null | undefined,\n options?: { enabled?: boolean }\n) {\n const arbi = useArbi()\n return useQuery({\n queryKey: arbiQueryKeys.documentVersions(docId ?? ''),\n queryFn: () => arbi.documents.versions(docId as string),\n enabled: (options?.enabled ?? true) && !!docId && arbi.hasWorkspace,\n })\n}\n\n/**\n * A workspace's conversations (threads and tasks). The list is kept current by its writers and the\n * workspace's events (`conversation-list`), so it is not re-read on every mount; `live` re-reads it\n * on a timer instead, faster while something is generating, for a view that follows runs by itself.\n */\nexport function useConversations(\n workspaceId: string | undefined,\n options?: { enabled?: boolean; live?: boolean }\n) {\n const arbi = useArbi()\n const queryClient = useQueryClient()\n const live = options?.live === true\n return useQuery({\n queryKey: arbiQueryKeys.conversations(workspaceId ?? ''),\n // The request names the workspace, so a switch while it runs cannot answer for another.\n queryFn: () =>\n readConversationList(queryClient, workspaceId as string, () =>\n arbi.conversations.list({ workspaceId: workspaceId as string })\n ),\n enabled: (options?.enabled ?? true) && !!workspaceId && arbi.hasWorkspace,\n placeholderData: (previous) => previous,\n ...(live\n ? {\n refetchInterval: (query: { state: { data?: Array<{ status?: string | null }> } }) =>\n query.state.data?.some((conversation) => conversation.status === 'generating')\n ? 3000\n : 15000,\n }\n : { staleTime: Infinity, refetchOnMount: false, refetchOnReconnect: false }),\n })\n}\n\n/** The backend's built-in slash commands (`/compact`, `/goal`, \u2026), for a slash menu. */\nexport function useBuiltinCommands() {\n const arbi = useArbi()\n const query = useQuery({\n queryKey: arbiQueryKeys.assistantCommands(),\n queryFn: () => arbi.assistant.commands(),\n staleTime: 30 * 1000,\n enabled: arbi.isLoggedIn,\n })\n // Stable identity so a menu's merge and filter memos do not rerun every render.\n const commands = useMemo(() => query.data ?? [], [query.data])\n return { commands, isLoading: query.isLoading }\n}\n\n/** One stored message with everything the server keeps on it (its trace and metadata). */\nexport function useMessageDetails(\n messageId: string | null | undefined,\n options?: { enabled?: boolean }\n) {\n const arbi = useArbi()\n return useQuery({\n queryKey: arbiQueryKeys.messageDetails(messageId ?? ''),\n queryFn: () => arbi.conversations.getMessage(messageId as string),\n enabled: (options?.enabled ?? true) && !!messageId && arbi.isLoggedIn,\n })\n}\n\n/**\n * A conversation's stored threads (each with its message history, citations data included). The\n * chat engine and the conversation's events keep the cache current, so it is re-read only when\n * stale (2 minutes) or when the page is shown again while this tab is not streaming the\n * conversation (a turn sent from another tab never reaches this one's socket). A conversation with\n * no messages yet (a new to-do, a workflow's task before its run) comes back with no threads. A 404\n * is a conversation this user cannot see (gone, or in a workspace they left): an error, never cached\n * as an empty conversation to write into. `live` re-reads it every few seconds.\n */\nexport function useConversationThreads(\n conversationId: string | undefined,\n options?: { enabled?: boolean; live?: boolean }\n) {\n const arbi = useArbi()\n const session = useArbiSessionStore()\n return useQuery({\n queryKey: arbiQueryKeys.conversationThreads(conversationId ?? ''),\n queryFn: (): Promise<ThreadsResponse> =>\n arbi.conversations.getThreads(conversationId as string),\n enabled: (options?.enabled ?? true) && !!conversationId && arbi.hasWorkspace,\n staleTime: 2 * 60 * 1000,\n refetchOnWindowFocus: () =>\n session.getState().generating[conversationId ?? '']?.isGenerating ? false : 'always',\n refetchInterval: options?.live ? 3000 : false,\n })\n}\n\n/** A tag list query as a stable cache key ('' for every tag). */\nconst tagListKey = (query: TagListQuery): string =>\n [\n query.kind ? `kind:${query.kind}` : '',\n query.parentId ? `parent:${query.parentId}` : '',\n query.ids?.length ? `ids:${query.ids.join(',')}` : '',\n query.include?.length ? `include:${query.include.join(',')}` : '',\n query.linksLimit !== undefined ? `links:${query.linksLimit}` : '',\n ]\n .filter(Boolean)\n .join('|')\n\n/**\n * List tags in a workspace (default: the open one) \u2014 all of them, or filtered: `{ kind: 'issue',\n * include: ['links'] }` is every issue with its documents, facts and threads (a table's rows; its\n * columns come from `useTagKindSchema`). `ids: []` asks for nothing.\n *\n * The whole list is read once and then kept current in place: the tag writes patch it\n * (`patchWorkspaceTags`), and an invalidation of the workspace's tags (a WebSocket event, a host\n * refresh) re-reads it. It is never re-read just for being mounted or the window being focused.\n */\nexport function useTags(\n workspaceId?: string | null,\n options?: TagListQuery & { enabled?: boolean }\n) {\n const arbi = useArbi()\n const { enabled, ...query } = options ?? {}\n const workspace = workspaceId ?? (arbi.hasWorkspace ? arbi.getWorkspaceId() : '')\n const key = tagListKey(query)\n return useQuery({\n queryKey: key ? arbiQueryKeys.tagList(workspace, key) : arbiQueryKeys.tags(workspace),\n // The request names the workspace (opened for this session first when it is not the current\n // one), so another workspace's tags can be listed and a switch cannot answer for it. The\n // current workspace's list is also read under the switch guard.\n queryFn: () => {\n const list = () => arbi.tags.list({ ...(key ? query : {}), workspaceId: workspace })\n return workspace === arbi.getWorkspaceId() ? arbi.readInWorkspace(workspace, list) : list()\n },\n enabled:\n (enabled ?? true) &&\n !!workspace &&\n arbi.hasWorkspace &&\n (query.ids === undefined || query.ids.length > 0),\n ...(key ? {} : { staleTime: Infinity }),\n })\n}\n\n/**\n * Batch-fetch first-page thumbnails for a set of documents. Returns a map of\n * doc external id \u2192 `data:image/webp` URI (or `null` when no thumbnail exists).\n * Cached for a few minutes since thumbnails are effectively immutable per doc.\n */\nexport function useThumbnails(docIds: string[], options?: { enabled?: boolean }) {\n const arbi = useArbi()\n return useQuery({\n queryKey: arbiQueryKeys.thumbnails(docIds),\n queryFn: () => arbi.documents.getThumbnails(docIds),\n enabled: (options?.enabled ?? true) && docIds.length > 0 && arbi.hasWorkspace,\n staleTime: 5 * 60_000,\n })\n}\n\n/**\n * Fetch a document's parsed content (chunks grouped by page) for the review\n * viewer. `stage` defaults to `final` (fully processed); `marker`/`subchunk`\n * expose earlier pipeline stages. `docId` may be a version reference (`doc-\u2026@v2`).\n */\nexport function useParsedDocument(\n docId: string | undefined,\n stage: string = 'final',\n options?: { enabled?: boolean }\n) {\n const arbi = useArbi()\n return useQuery({\n queryKey: arbiQueryKeys.parsedDoc(docId ?? '', stage),\n queryFn: () => {\n // A version reference (`doc-\u2026@v2`) reads that version's parse.\n const { docId: id, version } = parseVersionRef(docId as string)\n return arbi.documents.getParsedContent(\n id,\n stage,\n version ?? undefined\n ) as unknown as Promise<ParsedDocument>\n },\n enabled: (options?.enabled ?? true) && !!docId && arbi.hasWorkspace,\n })\n}\n\n/**\n * Ask the assistant (`arbi.assistant.ask`) as a mutation: one streaming turn, its frames to\n * `handlers`, resolving with the accumulated result.\n */\nexport function useAssistantQuery() {\n const arbi = useArbi()\n return useMutation<SSEStreamResult, Error, { request: AskRequest; handlers?: AskHandlers }>({\n mutationFn: ({ request, handlers }) => arbi.assistant.ask(request, handlers),\n })\n}\n\n/** List agents owned by the current user. */\nexport function useAgents(options?: { enabled?: boolean }) {\n const arbi = useArbi()\n return useQuery({\n queryKey: arbiQueryKeys.agents(),\n queryFn: () => arbi.agents.list(),\n enabled: (options?.enabled ?? true) && arbi.isLoggedIn,\n })\n}\n\n/**\n * Delete agents. Returns a mutation. Refreshes the agent list, the workflow list and the conversation list\n * (a deleted agent's workflows and work go with it), and drops the deleted agents' own config and workspace queries.\n */\nexport function useDeleteAgents() {\n const arbi = useArbi()\n const qc = useQueryClient()\n return useMutation<unknown, Error, { agentExtIds: string[] }>({\n mutationFn: ({ agentExtIds }) => arbi.agents.delete(agentExtIds),\n onSuccess: (_result, { agentExtIds }) => {\n for (const id of agentExtIds) {\n qc.removeQueries({ queryKey: arbiQueryKeys.agentConfig(id) })\n qc.removeQueries({ queryKey: arbiQueryKeys.agentWorkspaces(id) })\n }\n return Promise.all([\n qc.invalidateQueries({ queryKey: arbiQueryKeys.agents() }),\n qc.invalidateQueries({ queryKey: arbiQueryKeys.workflows() }),\n qc.invalidateQueries({ queryKey: arbiQueryKeys.allConversations() }),\n qc.invalidateQueries({ queryKey: arbiQueryKeys.configs() }),\n ])\n },\n })\n}\n\n/** Authorize a delegated session (generates claim code). Returns a mutation. */\n\n/** Check backend health. */\nexport function useHealth(options?: { enabled?: boolean }) {\n const arbi = useArbi()\n return useQuery({\n queryKey: arbiQueryKeys.health(),\n queryFn: () => arbi.health.check(),\n enabled: options?.enabled,\n })\n}\n\n/**\n * The deployment's models with their tags (`Standard`, `Premium`), providers and per-token costs,\n * and the default premium model. Static per deployment: read once.\n */\nexport function useAvailableModels(options?: { enabled?: boolean }) {\n const arbi = useArbi()\n return useQuery({\n queryKey: arbiQueryKeys.availableModels(),\n queryFn: () => arbi.health.models(),\n staleTime: Infinity,\n enabled: (options?.enabled ?? true) && arbi.isLoggedIn,\n })\n}\n\n// \u2500\u2500 Behaviour-template configs \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\n\n/** List the caller's saved agent configurations (behaviour templates). */\nexport function useConfigs(options?: { enabled?: boolean }) {\n const arbi = useArbi()\n return useQuery({\n queryKey: arbiQueryKeys.configVersions(),\n queryFn: () => arbi.agentConfig.list(),\n enabled: options?.enabled ?? arbi.isLoggedIn,\n })\n}\n\n/** One saved agent configuration (its models, its tools). Configs change only on a save. */\nexport function useConfig(configId: string | null | undefined, options?: { enabled?: boolean }) {\n const arbi = useArbi()\n return useQuery({\n queryKey: arbiQueryKeys.config(configId ?? ''),\n queryFn: () => arbi.agentConfig.get(configId as string),\n staleTime: 10 * 60 * 1000,\n enabled: (options?.enabled ?? true) && !!configId && arbi.isLoggedIn,\n })\n}\n\n// \u2500\u2500 Activity feed \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\n\n/**\n * List the caller's durable activity feed, newest first.\n *\n * Activity entries are backend-originated, to-self log lines that are always\n * read \u2014 they are deliberately kept out of the normal notifications/DM feed and\n * never affect the unread badge, so this is a separate, opt-in query.\n */\nexport function useActivity(options?: { enabled?: boolean; limit?: number; offset?: number }) {\n const arbi = useArbi()\n return useQuery({\n queryKey: arbiQueryKeys.activity(),\n queryFn: () => arbi.dm.listActivity({ limit: options?.limit, offset: options?.offset }),\n enabled: options?.enabled ?? arbi.isLoggedIn,\n })\n}\n\n/**\n * A workspace's activity feed, newest first, a page at a time: thread history, people posting,\n * uploads, new versions and signatures, workflow runs. Only what the caller can see. The pages\n * are `data.pages`; `fetchNextPage` reads the next one while `hasNextPage`.\n */\nexport function useWorkspaceActivity(\n workspaceId: string | null | undefined,\n options?: {\n enabled?: boolean\n limit?: number\n /** Runs before each page, e.g. to (re)open the workspace so titles and names decrypt. */\n beforeFetch?: () => Promise<unknown>\n }\n) {\n const arbi = useArbi()\n return useInfiniteQuery({\n queryKey: arbiQueryKeys.workspaceActivity(workspaceId ?? '', options?.limit),\n queryFn: async ({ pageParam }) => {\n await options?.beforeFetch?.()\n return arbi.workspaces.activity(workspaceId as string, {\n cursor: pageParam,\n limit: options?.limit,\n })\n },\n initialPageParam: null as string | null,\n getNextPageParam: (page) => page.next_cursor ?? undefined,\n enabled: (options?.enabled ?? true) && !!workspaceId && arbi.isLoggedIn,\n })\n}\n\n// \u2500\u2500 Projects, usage & spend \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\n\n/** List the logged-in user's projects (billing accounts). */\nexport function useProjects(options?: { enabled?: boolean }) {\n const arbi = useArbi()\n return useQuery({\n queryKey: arbiQueryKeys.projects(),\n queryFn: () => arbi.projects.list(),\n enabled: options?.enabled ?? arbi.isLoggedIn,\n })\n}\n\n/**\n * AI usage breakdown for a project's billing period. `monthsBack` selects the period (0 =\n * current, 1 = previous month, \u2026).\n *\n * The response's `total_spend` / `spend` fields are \u00A3 of AI usage (format with `formatGbp`).\n * `metered` is `false` when the deployment does not record usage (a `dev`-plan project with all\n * zeros): show \"usage is not metered here\" instead of zeros. It is `undefined` until the usage\n * has loaded.\n */\nexport function useProjectUsage(\n projectExtId: string | undefined,\n monthsBack: number = 0,\n options?: { enabled?: boolean }\n) {\n const arbi = useArbi()\n const usage = useQuery({\n queryKey: arbiQueryKeys.projectUsage(projectExtId ?? '', monthsBack),\n queryFn: () => arbi.projects.usage(projectExtId as string, monthsBack),\n enabled: (options?.enabled ?? true) && !!projectExtId && arbi.isLoggedIn,\n })\n const projects = useProjects({ enabled: !!projectExtId && (options?.enabled ?? true) })\n const subscription = projects.data?.find((p) => p.external_id === projectExtId)?.subscription\n const metered = usage.data ? isUsageMetered(usage.data, subscription) : undefined\n return { ...usage, metered }\n}\n\n/** List the Stripe invoices for a project's subscription. */\nexport function useProjectInvoices(\n projectExtId: string | undefined,\n options?: { enabled?: boolean }\n) {\n const arbi = useArbi()\n return useQuery({\n queryKey: arbiQueryKeys.projectInvoices(projectExtId ?? ''),\n queryFn: () => arbi.projects.invoices(projectExtId as string),\n enabled: (options?.enabled ?? true) && !!projectExtId && arbi.isLoggedIn,\n })\n}\n\n/**\n * The signed-in user from `GET /v1/user/me`. Refetched on window focus, so a role granted or\n * removed elsewhere shows up without a reload; invalidate `arbiQueryKeys.currentUser()` after a\n * change you made yourself.\n */\nexport function useCurrentUser(options?: { enabled?: boolean }) {\n const arbi = useArbi()\n return useQuery({\n queryKey: arbiQueryKeys.currentUser(),\n queryFn: () => arbi.user.me(),\n enabled: options?.enabled ?? arbi.isLoggedIn,\n refetchOnWindowFocus: true,\n staleTime: 30_000,\n })\n}\n\n/**\n * The firm's pooled monthly \u00A3 of AI usage (Box deployments). A 403 (the caller is not a firm member\n * or Box admin) is not retried: treat an error like `has_pool: false` and show nothing.\n */\nfunction useFirmPool(options?: { enabled?: boolean }) {\n const arbi = useArbi()\n return useQuery({\n queryKey: arbiQueryKeys.firmPool(),\n queryFn: () => arbi.firm.pool(),\n enabled: (options?.enabled ?? true) && arbi.isLoggedIn,\n retry: false,\n refetchOnWindowFocus: true,\n staleTime: 60_000,\n })\n}\n\n/**\n * Whether this deployment runs under a Box licence (`isBox`) and whether the user administers it in\n * the ARBI portal (`isBoxAdmin`), from the firm pool. Anyone outside the firm gets a 403 (not\n * retried), read as no Box. The API has no Box-admin flag yet: `can_top_up` is true only for a Box\n * admin of a licence central can bill, so admins of a hand-set licence read as members for now.\n */\nexport function useBoxRole(options: { enabled?: boolean } = {}): {\n isBox: boolean\n isBoxAdmin: boolean\n} {\n const { data, isError } = useFirmPool(options)\n const isBox = !isError && !!data?.has_pool\n return { isBox, isBoxAdmin: isBox && !!data?.can_top_up }\n}\n\n/** Why \"New project\" / \"New workspace\" is unavailable to someone who may not create them. */\nexport const PROJECT_CREATION_DENIED_REASON =\n 'Only members of your firm can create projects and workspaces.'\n\n/** Why the server refuses \"New project\" (`GET /v1/user/me`: `project_creation_refusal`). */\nexport type ProjectCreationRefusal = NonNullable<\n components['schemas']['CurrentUserResponse']['project_creation_refusal']\n>\n\nconst PROJECT_CREATION_REFUSAL_REASONS: Record<ProjectCreationRefusal, string> = {\n external_user: 'External users cannot create projects.',\n not_a_member: PROJECT_CREATION_DENIED_REASON,\n managers_only: 'Only managers can create projects on this deployment.',\n pro_required: 'Upgrade your personal project to Pro to create more projects.',\n}\n\n/** The signed-in user, re-read when their workspace memberships change (a role can change what they may create). */\nfunction useCreationRights() {\n const user = useCurrentUser()\n const { data: workspaces } = useWorkspaces({ enabled: user.isSuccess })\n const membership = workspaces?.map((w) => w.external_id).join(',')\n const { refetch } = user\n const seen = useRef<string | undefined>(undefined)\n useEffect(() => {\n if (membership === undefined || membership === seen.current) return\n const first = seen.current === undefined\n seen.current = membership\n if (!first) void refetch()\n }, [membership, refetch])\n return user.data\n}\n\n/**\n * Whether the signed-in user may create projects. `undefined` while the user is loading: callers\n * should neither offer nor refuse creation until it is known.\n */\nexport function useCanCreateProjects(): boolean | undefined {\n return useCreationRights()?.can_create_projects\n}\n\n/**\n * Why the signed-in user may not create projects, or `undefined` when they may (or while loading).\n * `refusal` is the server's code: `pro_required` on the hosted service means \"upgrade your personal\n * project to Pro\", so hosts can offer the plans instead of a dead button.\n */\nexport function useProjectCreationDenial():\n { refusal: ProjectCreationRefusal | undefined; reason: string } | undefined {\n const me = useCreationRights()\n if (!me || me.can_create_projects) return undefined\n const refusal = me.project_creation_refusal ?? undefined\n return {\n refusal,\n reason: refusal ? PROJECT_CREATION_REFUSAL_REASONS[refusal] : PROJECT_CREATION_DENIED_REASON,\n }\n}\n\n/**\n * Whether the signed-in user may create workspaces (in projects they own). A free hosted user may,\n * though not projects. `undefined` while loading.\n */\nexport function useCanCreateWorkspaces(): boolean | undefined {\n const me = useCreationRights()\n // An older server has no can_create_workspaces: it gated both on can_create_projects.\n return me && (me.can_create_workspaces ?? me.can_create_projects)\n}\n\n/**\n * Today's deployment-wide AI usage (\u00A3, `used_gbp`) for the signed-in user: pair it with a project's\n * `daily_cap_per_user` for a \"\u00A3 used today\" indicator. Re-read on mount and window focus, and when\n * the host invalidates it after the user's own generation; never polled.\n */\nexport function useUserUsageToday(options?: { enabled?: boolean }) {\n const arbi = useArbi()\n return useQuery({\n queryKey: arbiQueryKeys.userUsageToday(),\n queryFn: () => arbi.user.usageToday(),\n enabled: (options?.enabled ?? true) && arbi.isLoggedIn,\n refetchOnWindowFocus: true,\n refetchOnMount: 'always',\n staleTime: 15_000,\n })\n}\n"],
|
|
5
|
+
"mappings": "AAIA,SAAS,WA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