@arbidocs/react 0.5.77 → 0.5.78
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/README.md +31 -6
- package/dist/artifacts/index.cjs +10 -10
- package/dist/artifacts/index.js +3 -3
- package/dist/calls/livekit/index.cjs +42 -42
- package/dist/calls/livekit/index.js +3 -3
- package/dist/{chunk-2MECTZLS.js → chunk-4QON6LSH.js} +4 -4
- package/dist/{chunk-2MECTZLS.js.map → chunk-4QON6LSH.js.map} +1 -1
- package/dist/{chunk-RDERZWMO.cjs → chunk-5IN5OGBT.cjs} +33 -33
- package/dist/{chunk-RDERZWMO.cjs.map → chunk-5IN5OGBT.cjs.map} +1 -1
- package/dist/{chunk-O2HDONQE.js → chunk-5UJ4ZKJN.js} +3 -3
- package/dist/{chunk-O2HDONQE.js.map → chunk-5UJ4ZKJN.js.map} +1 -1
- package/dist/{chunk-33PVGKXT.js → chunk-DLBGBIAM.js} +231 -69
- package/dist/chunk-DLBGBIAM.js.map +1 -0
- package/dist/{chunk-PMHFLOXY.cjs → chunk-IZ3B62EN.cjs} +49 -49
- package/dist/{chunk-PMHFLOXY.cjs.map → chunk-IZ3B62EN.cjs.map} +1 -1
- package/dist/{chunk-6RSVGLQY.cjs → chunk-L2P2X6LH.cjs} +264 -98
- package/dist/chunk-L2P2X6LH.cjs.map +1 -0
- package/dist/{chunk-MWW54PY6.cjs → chunk-RW3URTNE.cjs} +20 -20
- package/dist/{chunk-MWW54PY6.cjs.map → chunk-RW3URTNE.cjs.map} +1 -1
- package/dist/{chunk-AOEJ744V.js → chunk-TK7ERJPE.js} +5 -2
- package/dist/{chunk-AOEJ744V.js.map → chunk-TK7ERJPE.js.map} +1 -1
- package/dist/{chunk-GQAXAZN7.cjs → chunk-U4PWVSCT.cjs} +5 -2
- package/dist/{chunk-GQAXAZN7.cjs.map → chunk-U4PWVSCT.cjs.map} +1 -1
- package/dist/{chunk-JHN4PKWX.js → chunk-YJEZEPUB.js} +3 -3
- package/dist/{chunk-JHN4PKWX.js.map → chunk-YJEZEPUB.js.map} +1 -1
- package/dist/document-tools/core.cjs +82 -82
- package/dist/document-tools/core.d.cts +2 -2
- package/dist/document-tools/core.d.ts +2 -2
- package/dist/document-tools/core.js +2 -2
- package/dist/document-tools/index.cjs +82 -82
- package/dist/document-tools/index.d.cts +1 -1
- package/dist/document-tools/index.d.ts +1 -1
- package/dist/document-tools/index.js +2 -2
- package/dist/index.cjs +1077 -914
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +352 -550
- package/dist/index.d.ts +352 -550
- package/dist/index.js +169 -25
- package/dist/index.js.map +1 -1
- package/dist/{query-keys.d-BFKQVevT.d.ts → query-keys.d-Dm0NL9nr.d.cts} +3 -0
- package/dist/{query-keys.d-BFKQVevT.d.cts → query-keys.d-Dm0NL9nr.d.ts} +3 -0
- package/package.json +5 -3
- package/dist/chunk-33PVGKXT.js.map +0 -1
- package/dist/chunk-6RSVGLQY.cjs.map +0 -1
package/README.md
CHANGED
|
@@ -11,11 +11,11 @@ npm install @arbidocs/react
|
|
|
11
11
|
### 1. Set up the host
|
|
12
12
|
|
|
13
13
|
```tsx
|
|
14
|
-
import {
|
|
15
|
-
import { ArbiHost } from '@arbidocs/react'
|
|
14
|
+
import { QueryClientProvider } from '@tanstack/react-query'
|
|
15
|
+
import { ArbiHost, createArbiQueryClient } from '@arbidocs/react'
|
|
16
16
|
import { Arbi } from '@arbidocs/sdk/browser'
|
|
17
17
|
|
|
18
|
-
const queryClient =
|
|
18
|
+
const { queryClient } = createArbiQueryClient()
|
|
19
19
|
const arbi = new Arbi({ url: 'https://www.arbidocs.com' })
|
|
20
20
|
|
|
21
21
|
function App() {
|
|
@@ -177,8 +177,19 @@ parseSavedChat })`) the open conversation and its line, the context, each agent
|
|
|
177
177
|
chosen model survive a reload; the drafts are kept apart, sealed to the person
|
|
178
178
|
(`createSealedDraftStorage`), and only for open tabs. `createArbiSessionStore` uses one in memory. A
|
|
179
179
|
host with state of its own composes its session from parts instead (`composeArbiSessionStore({
|
|
180
|
-
layout, workspace, chat, documents })
|
|
181
|
-
|
|
180
|
+
layout, workspace, chat, documents })`).
|
|
181
|
+
|
|
182
|
+
**Documents.** The document being viewed and the viewer's own state (its tab, a comparison, a tab
|
|
183
|
+
asked for, the text size, a Word comment to open, unsaved edits, a popped-out window), the documents
|
|
184
|
+
selected and those to select once listed, the document pinned to the chat, the drafts started on the
|
|
185
|
+
client (`startDraftDocument(kind)`, `updateDraftDocument`, `setDraftDocumentKind`,
|
|
186
|
+
`clearDraftDocument`), the citation picking passages in the viewer (`setPassageCitation`) and the
|
|
187
|
+
related documents live in a documents store (`createArbiDocumentSessionStore({ persist, showViewer
|
|
188
|
+
})`). `showViewer` is how the host shows its viewer for a document the session just got (a new
|
|
189
|
+
draft, `showNewDocument` for a chat's document). With a `persist` (`load` is synchronous, read from
|
|
190
|
+
`localStorage` for example, and checked with `parseSavedDocuments`), the viewed document and its
|
|
191
|
+
page, the pinned document, the viewer's tab and the text size come back on a reload before anything
|
|
192
|
+
renders.
|
|
182
193
|
|
|
183
194
|
**Conversation settings.** `useConversationSettings()` is the open conversation's title and sharing
|
|
184
195
|
(`saveTitle`, `share`, `unshare`: one `PATCH` of the conversation, which the server resolves from the
|
|
@@ -227,6 +238,20 @@ Pass these to `mutation.mutate()` alongside `question` and `docIds`:
|
|
|
227
238
|
| `onError(message)` | Error during streaming |
|
|
228
239
|
| `onComplete()` | Stream finished |
|
|
229
240
|
|
|
241
|
+
## The query client
|
|
242
|
+
|
|
243
|
+
`createArbiQueryClient()` is the client every ARBI host shares (ARBI-frontend, and a blocks site
|
|
244
|
+
through `defaultHost`): reads fresh for 5 minutes and kept 30, retried twice with backoff but never
|
|
245
|
+
on a 4xx (except 408/429) or a read a sign-out aborted; writes never retried; a write refused while
|
|
246
|
+
the account's deletion is pending, or dropped by the client's settings write breaker, tells the user.
|
|
247
|
+
Sign-out empties it with `queryClient.clear()` (the same instance, so every hook keeps it).
|
|
248
|
+
|
|
249
|
+
`createArbiQueryClient({ persist: true })` also returns `persistOptions` for
|
|
250
|
+
`<PersistQueryClientProvider>` (`@tanstack/react-query-persist-client`): the document metadata,
|
|
251
|
+
workspace list, settings, projects and entitlements are kept on this device for an offline start
|
|
252
|
+
(never a document's content), with writes queued offline (`registerArbiMutationDefaults`). Call
|
|
253
|
+
`claimOfflineQueue(userExtId)` at each sign-in, so a previous account's queued writes never replay.
|
|
254
|
+
|
|
230
255
|
## Cache invalidation
|
|
231
256
|
|
|
232
257
|
```tsx
|
|
@@ -252,7 +277,7 @@ const run = useRunTask() // approves a run parked for access (temporary grant),
|
|
|
252
277
|
const runs = useTaskRuns(taskId) // polls while a run is in flight
|
|
253
278
|
const save = useSaveAgentConfig() // { agentExtId, sections: { Agents: { PERSONA, ... } } }
|
|
254
279
|
const grant = useGrantAgentAccess() // { agentExtId, workspaceId, mode?: { kind: 'standing' | 'temporary' } }
|
|
255
|
-
const contacts =
|
|
280
|
+
const contacts = useContacts() // + useInviteContacts(), useCreateContact(), useUpdateContact(), useDeleteContact()
|
|
256
281
|
```
|
|
257
282
|
|
|
258
283
|
Form-to-request mappings (`taskComposerToCreateRequest`, `composePersona`, ...) are in
|
package/dist/artifacts/index.cjs
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var
|
|
4
|
-
var
|
|
3
|
+
var chunk5IN5OGBT_cjs = require('../chunk-5IN5OGBT.cjs');
|
|
4
|
+
var chunkL2P2X6LH_cjs = require('../chunk-L2P2X6LH.cjs');
|
|
5
5
|
var chunk3AADNIOK_cjs = require('../chunk-3AADNIOK.cjs');
|
|
6
|
-
var
|
|
6
|
+
var chunkU4PWVSCT_cjs = require('../chunk-U4PWVSCT.cjs');
|
|
7
7
|
var chunk5YGUBXXH_cjs = require('../chunk-5YGUBXXH.cjs');
|
|
8
8
|
require('../chunk-N73IMVFF.cjs');
|
|
9
9
|
var chunkZWFMFOGP_cjs = require('../chunk-ZWFMFOGP.cjs');
|
|
@@ -287,7 +287,7 @@ function useArtifactText(docId, options) {
|
|
|
287
287
|
const enabled = (options?.enabled ?? true) && chunkZWFMFOGP_cjs.isDocumentId(docId) && arbi.hasWorkspace;
|
|
288
288
|
const query = reactQuery.useQuery({
|
|
289
289
|
// Under the shared `parsedDoc` key, so a document's invalidation reaches it too.
|
|
290
|
-
queryKey: [...
|
|
290
|
+
queryKey: [...chunkU4PWVSCT_cjs.arbiQueryKeys.parsedDoc(docId ?? "", "marker"), "artifact-text"],
|
|
291
291
|
queryFn: async () => {
|
|
292
292
|
const { docId: plainId, version } = chunkZWFMFOGP_cjs.parseVersionRef(docId);
|
|
293
293
|
const parsed = await arbi.documents.getParsedContent(
|
|
@@ -335,12 +335,12 @@ function useArtifactText(docId, options) {
|
|
|
335
335
|
// src/artifacts/useArtifactSession.ts
|
|
336
336
|
function useArtifactVersions(workspaceId, docId) {
|
|
337
337
|
const plainId = docId ? chunkZWFMFOGP_cjs.parseVersionRef(docId).docId : null;
|
|
338
|
-
const { data: documents } =
|
|
338
|
+
const { data: documents } = chunk5IN5OGBT_cjs.useDocuments(workspaceId);
|
|
339
339
|
const listed = react.useMemo(
|
|
340
340
|
() => (documents ?? []).find((d) => d.external_id === plainId),
|
|
341
341
|
[documents, plainId]
|
|
342
342
|
);
|
|
343
|
-
const { data: history } =
|
|
343
|
+
const { data: history } = chunkL2P2X6LH_cjs.useDocumentVersionList(plainId, {
|
|
344
344
|
enabled: !!plainId && documents !== void 0 && !listed
|
|
345
345
|
});
|
|
346
346
|
return react.useMemo(
|
|
@@ -364,10 +364,10 @@ function useSaveArtifactVersion() {
|
|
|
364
364
|
}
|
|
365
365
|
);
|
|
366
366
|
const docId = result.doc_ext_ids?.[0];
|
|
367
|
-
if (docId) await
|
|
368
|
-
await queryClient.invalidateQueries({ queryKey:
|
|
367
|
+
if (docId) await chunk5IN5OGBT_cjs.refreshDocuments(queryClient, arbi, [docId]);
|
|
368
|
+
await queryClient.invalidateQueries({ queryKey: chunkU4PWVSCT_cjs.arbiQueryKeys.allDocumentVersions() });
|
|
369
369
|
if (docId)
|
|
370
|
-
await queryClient.invalidateQueries({ queryKey:
|
|
370
|
+
await queryClient.invalidateQueries({ queryKey: chunkU4PWVSCT_cjs.arbiQueryKeys.parsedDocument(docId) });
|
|
371
371
|
return { docId, version: result.version ?? void 0 };
|
|
372
372
|
}
|
|
373
373
|
});
|
|
@@ -486,7 +486,7 @@ function useArtifactSession(options) {
|
|
|
486
486
|
function useArtifactSource(documentId, enabled = true) {
|
|
487
487
|
const arbi = chunk5YGUBXXH_cjs.useArbi();
|
|
488
488
|
return reactQuery.useQuery({
|
|
489
|
-
queryKey:
|
|
489
|
+
queryKey: chunkU4PWVSCT_cjs.arbiQueryKeys.artifactSource(documentId ?? ""),
|
|
490
490
|
queryFn: async () => (await arbi.documents.download(documentId)).text(),
|
|
491
491
|
enabled: enabled && !!documentId && arbi.isLoggedIn,
|
|
492
492
|
staleTime: 5 * 60 * 1e3
|
package/dist/artifacts/index.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { useDocuments, refreshDocuments } from '../chunk-
|
|
2
|
-
import { useDocumentVersionList } from '../chunk-
|
|
1
|
+
import { useDocuments, refreshDocuments } from '../chunk-YJEZEPUB.js';
|
|
2
|
+
import { useDocumentVersionList } from '../chunk-DLBGBIAM.js';
|
|
3
3
|
import { revertRedlineRegion, buildHybridRedlineWithRegions, buildHybridRedlineMarkdown } from '../chunk-74N436VK.js';
|
|
4
4
|
export { buildHybridRedlineMarkdown, buildHybridRedlineWithRegions, revertRedlineRegion } from '../chunk-74N436VK.js';
|
|
5
|
-
import { arbiQueryKeys } from '../chunk-
|
|
5
|
+
import { arbiQueryKeys } from '../chunk-TK7ERJPE.js';
|
|
6
6
|
import { useArbi } from '../chunk-2Y6LJNWA.js';
|
|
7
7
|
import '../chunk-DPYBZDJB.js';
|
|
8
8
|
import { isDocumentId, parseVersionRef, flattenChunks, documentVersions, toArtifactVersions, findVersion, versionLabel, cleanDraftWithReport } from '../chunk-NNWMHMEC.js';
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var
|
|
4
|
-
require('../../chunk-
|
|
5
|
-
require('../../chunk-
|
|
3
|
+
var chunkIZ3B62EN_cjs = require('../../chunk-IZ3B62EN.cjs');
|
|
4
|
+
require('../../chunk-L2P2X6LH.cjs');
|
|
5
|
+
require('../../chunk-U4PWVSCT.cjs');
|
|
6
6
|
var chunk5YGUBXXH_cjs = require('../../chunk-5YGUBXXH.cjs');
|
|
7
7
|
var chunkDZUBZ45Y_cjs = require('../../chunk-DZUBZ45Y.cjs');
|
|
8
8
|
require('../../chunk-N73IMVFF.cjs');
|
|
@@ -125,8 +125,8 @@ function useCallTranscriber({
|
|
|
125
125
|
const arbi = chunk5YGUBXXH_cjs.useArbi();
|
|
126
126
|
const queryClient = reactQuery.useQueryClient();
|
|
127
127
|
const profile = arbi.isLoggedIn ? arbi.user.profile() : null;
|
|
128
|
-
const myProfileName = profile &&
|
|
129
|
-
const deploymentAvailable =
|
|
128
|
+
const myProfileName = profile && chunkIZ3B62EN_cjs.toProfileView(profile).fullName || null;
|
|
129
|
+
const deploymentAvailable = chunkIZ3B62EN_cjs.useCallTranscriptionAvailable();
|
|
130
130
|
const available = deploymentAvailable && !!callKey;
|
|
131
131
|
const [state, setState] = react.useState(null);
|
|
132
132
|
const [creatorExtId, setCreatorExtId] = react.useState(null);
|
|
@@ -169,7 +169,7 @@ function useCallTranscriber({
|
|
|
169
169
|
};
|
|
170
170
|
}, [available, callExtId]);
|
|
171
171
|
react.useEffect(
|
|
172
|
-
() =>
|
|
172
|
+
() => chunkIZ3B62EN_cjs.onCallEvent("call.transcription", (message) => {
|
|
173
173
|
if (message.call_ext_id === callExtId) applyState(message);
|
|
174
174
|
}),
|
|
175
175
|
[callExtId, applyState]
|
|
@@ -185,7 +185,7 @@ function useCallTranscriber({
|
|
|
185
185
|
const persist = react.useCallback(
|
|
186
186
|
(segment, speakerNeedsProxy) => {
|
|
187
187
|
if (!callKey || persisted.current.has(segment.segmentId)) return;
|
|
188
|
-
const role =
|
|
188
|
+
const role = chunkIZ3B62EN_cjs.transcriptPersistRole({
|
|
189
189
|
myIdentity,
|
|
190
190
|
canPost: canPost && (segment.speakerIdentity !== myIdentity || selfPosts.current),
|
|
191
191
|
hasCallKey: true,
|
|
@@ -194,7 +194,7 @@ function useCallTranscriber({
|
|
|
194
194
|
});
|
|
195
195
|
if (!role) return;
|
|
196
196
|
persisted.current.add(segment.segmentId);
|
|
197
|
-
|
|
197
|
+
chunkIZ3B62EN_cjs.persistTranscriptSegment(arbi, queryClient, callExtId, callKey, segment).catch(
|
|
198
198
|
(err) => {
|
|
199
199
|
persisted.current.delete(segment.segmentId);
|
|
200
200
|
if (role === "own" && err?.status === 403) {
|
|
@@ -214,7 +214,7 @@ function useCallTranscriber({
|
|
|
214
214
|
);
|
|
215
215
|
react.useEffect(() => {
|
|
216
216
|
const onData = (payload, participant, _kind, topic, _encryption, participantIdentity) => {
|
|
217
|
-
if (topic ===
|
|
217
|
+
if (topic === chunkIZ3B62EN_cjs.CALL_TRANSCRIPTION_TOPIC) {
|
|
218
218
|
if (participant || participantIdentity) return;
|
|
219
219
|
try {
|
|
220
220
|
const next = browser.calls.transcriptionStateFrom(JSON.parse(new TextDecoder().decode(payload)));
|
|
@@ -223,10 +223,10 @@ function useCallTranscriber({
|
|
|
223
223
|
}
|
|
224
224
|
return;
|
|
225
225
|
}
|
|
226
|
-
if (topic !==
|
|
226
|
+
if (topic !== chunkIZ3B62EN_cjs.CALL_CAPTION_TOPIC || !callKey) return;
|
|
227
227
|
const identity = participant?.identity ?? participantIdentity;
|
|
228
228
|
if (!identity || identity === myIdentity) return;
|
|
229
|
-
void
|
|
229
|
+
void chunkIZ3B62EN_cjs.decodeCaptionPacket(payload, callKey).then((packet) => {
|
|
230
230
|
if (!packet || packet.identity !== identity) return;
|
|
231
231
|
const name = participant?.name || packet.name || identity;
|
|
232
232
|
const t = Math.min(packet.t, Date.now());
|
|
@@ -266,7 +266,7 @@ function useCallTranscriber({
|
|
|
266
266
|
})) {
|
|
267
267
|
return;
|
|
268
268
|
}
|
|
269
|
-
const segmentId =
|
|
269
|
+
const segmentId = chunkIZ3B62EN_cjs.newSegmentId();
|
|
270
270
|
const startedAt = new Date(segment.startedAt).toISOString();
|
|
271
271
|
let text;
|
|
272
272
|
try {
|
|
@@ -300,7 +300,7 @@ function useCallTranscriber({
|
|
|
300
300
|
});
|
|
301
301
|
try {
|
|
302
302
|
await localParticipant.publishData(
|
|
303
|
-
await
|
|
303
|
+
await chunkIZ3B62EN_cjs.encodeCaptionPacket(
|
|
304
304
|
{
|
|
305
305
|
v: 1,
|
|
306
306
|
segment_id: segmentId,
|
|
@@ -312,7 +312,7 @@ function useCallTranscriber({
|
|
|
312
312
|
},
|
|
313
313
|
callKey
|
|
314
314
|
),
|
|
315
|
-
{ reliable: true, topic:
|
|
315
|
+
{ reliable: true, topic: chunkIZ3B62EN_cjs.CALL_CAPTION_TOPIC }
|
|
316
316
|
);
|
|
317
317
|
} catch (err) {
|
|
318
318
|
console.warn("[calls] could not broadcast a caption", err);
|
|
@@ -427,14 +427,14 @@ function useCallRecorder({
|
|
|
427
427
|
};
|
|
428
428
|
}, [callExtId]);
|
|
429
429
|
react.useEffect(
|
|
430
|
-
() =>
|
|
430
|
+
() => chunkIZ3B62EN_cjs.onCallEvent("call.recording", (message) => {
|
|
431
431
|
if (message.call_ext_id === callExtId) applyState(message);
|
|
432
432
|
}),
|
|
433
433
|
[callExtId, applyState]
|
|
434
434
|
);
|
|
435
435
|
react.useEffect(() => {
|
|
436
436
|
const onData = (payload, participant, _kind, topic, _encryption, participantIdentity) => {
|
|
437
|
-
if (topic !==
|
|
437
|
+
if (topic !== chunkIZ3B62EN_cjs.CALL_RECORDING_TOPIC) return;
|
|
438
438
|
if (participant || participantIdentity) return;
|
|
439
439
|
try {
|
|
440
440
|
const next = browser.calls.recordingStateFrom(JSON.parse(new TextDecoder().decode(payload)));
|
|
@@ -455,7 +455,7 @@ function useCallRecorder({
|
|
|
455
455
|
try {
|
|
456
456
|
const row = call ?? await arbi.calls.get(callExtId);
|
|
457
457
|
if (!row.workspace_locked && !row.chat_ext_id && callKey) {
|
|
458
|
-
const ref = await
|
|
458
|
+
const ref = await chunkIZ3B62EN_cjs.ensureMeetingChat(arbi, queryClient, callExtId, callKey);
|
|
459
459
|
if (ref.kind === "chat") setCall({ ...row, chat_ext_id: ref.chatExtId });
|
|
460
460
|
}
|
|
461
461
|
const answer = await arbi.calls.recording.start(callExtId, mode);
|
|
@@ -557,7 +557,7 @@ function useTrackUploader(recording, callKey, kind, mimeType) {
|
|
|
557
557
|
const queryClient = reactQuery.useQueryClient();
|
|
558
558
|
return react.useMemo(() => {
|
|
559
559
|
if (!shouldCapture || !recordingExtId || !call) return null;
|
|
560
|
-
return
|
|
560
|
+
return chunkIZ3B62EN_cjs.trackUploaderFor({
|
|
561
561
|
arbi,
|
|
562
562
|
callExtId: call.external_id,
|
|
563
563
|
recordingExtId,
|
|
@@ -565,7 +565,7 @@ function useTrackUploader(recording, callKey, kind, mimeType) {
|
|
|
565
565
|
mimeType,
|
|
566
566
|
recordingStartedAt: startedAt,
|
|
567
567
|
linkVersion,
|
|
568
|
-
conversationKey: () =>
|
|
568
|
+
conversationKey: () => chunkIZ3B62EN_cjs.conversationKeyForCall(arbi, queryClient, call, { callKey }),
|
|
569
569
|
// The server stopped the recording at the quota (its state event says so too).
|
|
570
570
|
onStopped: () => markStopped()
|
|
571
571
|
});
|
|
@@ -614,10 +614,10 @@ function useInCallChat({
|
|
|
614
614
|
react.useEffect(() => {
|
|
615
615
|
if (!callKey) return;
|
|
616
616
|
const onData = (payload, participant, _kind, topic, _encryption, participantIdentity) => {
|
|
617
|
-
if (topic !==
|
|
617
|
+
if (topic !== chunkIZ3B62EN_cjs.CALL_CHAT_TOPIC) return;
|
|
618
618
|
const identity = participant?.identity ?? participantIdentity;
|
|
619
619
|
if (!identity || identity === myIdentity) return;
|
|
620
|
-
void
|
|
620
|
+
void chunkIZ3B62EN_cjs.decodeCallChatPacket(payload, callKey).then((packet) => {
|
|
621
621
|
if (!packet) return;
|
|
622
622
|
const key = `${identity}:${packet.id}`;
|
|
623
623
|
if (seen.current.has(key)) return;
|
|
@@ -647,7 +647,7 @@ function useInCallChat({
|
|
|
647
647
|
if (!open || !canRead || historyRequested.current) return;
|
|
648
648
|
historyRequested.current = true;
|
|
649
649
|
setHistoryLoading(true);
|
|
650
|
-
|
|
650
|
+
chunkIZ3B62EN_cjs.loadMeetingHistory(arbi, queryClient, callExtId).then((result) => {
|
|
651
651
|
if (!result) return;
|
|
652
652
|
setMeetingChat(result.ref);
|
|
653
653
|
setHistory(result.messages);
|
|
@@ -658,13 +658,13 @@ function useInCallChat({
|
|
|
658
658
|
}, [open, canRead, callExtId]);
|
|
659
659
|
const send = react.useCallback(
|
|
660
660
|
async (raw) => {
|
|
661
|
-
const text = raw.trim().slice(0,
|
|
661
|
+
const text = raw.trim().slice(0, chunkIZ3B62EN_cjs.CALL_CHAT_MAX_CHARS);
|
|
662
662
|
if (!text || !callKey || readOnly) return;
|
|
663
|
-
const id =
|
|
663
|
+
const id = chunkIZ3B62EN_cjs.newPacketId();
|
|
664
664
|
const at = Date.now();
|
|
665
665
|
await localParticipant.publishData(
|
|
666
|
-
await
|
|
667
|
-
{ reliable: true, topic:
|
|
666
|
+
await chunkIZ3B62EN_cjs.encodeCallChatPacket({ v: 1, id, text, at }, callKey),
|
|
667
|
+
{ reliable: true, topic: chunkIZ3B62EN_cjs.CALL_CHAT_TOPIC }
|
|
668
668
|
);
|
|
669
669
|
setLive((prev) => [
|
|
670
670
|
...prev,
|
|
@@ -683,7 +683,7 @@ function useInCallChat({
|
|
|
683
683
|
(prev) => prev.map((l) => l.id === id && l.senderIdentity === myIdentity ? { ...l, status } : l)
|
|
684
684
|
);
|
|
685
685
|
try {
|
|
686
|
-
setMeetingChat(await
|
|
686
|
+
setMeetingChat(await chunkIZ3B62EN_cjs.persistMeetingMessage(arbi, queryClient, callExtId, callKey, text));
|
|
687
687
|
mark("saved");
|
|
688
688
|
} catch (err) {
|
|
689
689
|
console.warn("[calls] could not keep the message in the meeting chat", err);
|
|
@@ -695,7 +695,7 @@ function useInCallChat({
|
|
|
695
695
|
const openMeeting = react.useCallback(async () => {
|
|
696
696
|
if (!callKey) return;
|
|
697
697
|
try {
|
|
698
|
-
const ref = meetingChat ?? await
|
|
698
|
+
const ref = meetingChat ?? await chunkIZ3B62EN_cjs.ensureMeetingChat(arbi, queryClient, callExtId, callKey);
|
|
699
699
|
setMeetingChat(ref);
|
|
700
700
|
openMeetingChat?.(ref);
|
|
701
701
|
} catch (err) {
|
|
@@ -703,7 +703,7 @@ function useInCallChat({
|
|
|
703
703
|
}
|
|
704
704
|
}, [callExtId, callKey, meetingChat]);
|
|
705
705
|
const lines = react.useMemo(
|
|
706
|
-
() =>
|
|
706
|
+
() => chunkIZ3B62EN_cjs.mergeChatLines(history, live, {
|
|
707
707
|
myIdentity,
|
|
708
708
|
nameOf: (identity) => identity === myIdentity ? localParticipant.name || "You" : room.remoteParticipants.get(identity)?.name || null
|
|
709
709
|
}),
|
|
@@ -762,7 +762,7 @@ function useWebinar({
|
|
|
762
762
|
const n = ++questionsRead.current;
|
|
763
763
|
try {
|
|
764
764
|
const rows = await webinarApi().questions.list(callExtId, linkVersion);
|
|
765
|
-
const opened = await Promise.all(rows.map((q) =>
|
|
765
|
+
const opened = await Promise.all(rows.map((q) => chunkIZ3B62EN_cjs.openQuestion(q, callKey)));
|
|
766
766
|
if (n === questionsRead.current) setQuestions(opened);
|
|
767
767
|
} catch (err) {
|
|
768
768
|
console.warn("[calls] could not load the questions", err);
|
|
@@ -774,7 +774,7 @@ function useWebinar({
|
|
|
774
774
|
}, [refresh, refreshQuestions]);
|
|
775
775
|
react.useEffect(() => {
|
|
776
776
|
if (!enabled) return;
|
|
777
|
-
return
|
|
777
|
+
return chunkIZ3B62EN_cjs.onCallEvent("call.webinar", (m) => {
|
|
778
778
|
if (m.call_ext_id !== callExtId) return;
|
|
779
779
|
setState((s) => s ? { ...s, live: m.live, chat: m.chat } : s);
|
|
780
780
|
});
|
|
@@ -783,8 +783,8 @@ function useWebinar({
|
|
|
783
783
|
react.useEffect(() => {
|
|
784
784
|
if (!enabled) return;
|
|
785
785
|
const onData = (payload, participant, _kind, topic, _encryption, participantIdentity) => {
|
|
786
|
-
if (topic !==
|
|
787
|
-
const packet =
|
|
786
|
+
if (topic !== chunkIZ3B62EN_cjs.CALL_WEBINAR_TOPIC) return;
|
|
787
|
+
const packet = chunkIZ3B62EN_cjs.parseWebinarPacket(payload, !!(participant || participantIdentity));
|
|
788
788
|
if (!packet) return;
|
|
789
789
|
switch (packet.type) {
|
|
790
790
|
case "state":
|
|
@@ -805,7 +805,7 @@ function useWebinar({
|
|
|
805
805
|
return;
|
|
806
806
|
case "demoted":
|
|
807
807
|
setStageCheck(false);
|
|
808
|
-
|
|
808
|
+
chunkIZ3B62EN_cjs.markRejoining(callExtId);
|
|
809
809
|
if (fallback.current) clearTimeout(fallback.current);
|
|
810
810
|
fallback.current = setTimeout(() => void room.disconnect(), DEMOTE_REJOIN_FALLBACK_MS);
|
|
811
811
|
return;
|
|
@@ -832,12 +832,12 @@ function useWebinar({
|
|
|
832
832
|
[callExtId, linkVersion]
|
|
833
833
|
);
|
|
834
834
|
const stepDown = react.useCallback(async () => {
|
|
835
|
-
|
|
835
|
+
chunkIZ3B62EN_cjs.markRejoining(callExtId);
|
|
836
836
|
setStageCheck(false);
|
|
837
837
|
try {
|
|
838
838
|
await webinarApi().demote(callExtId, myIdentity, linkVersion);
|
|
839
839
|
} catch (err) {
|
|
840
|
-
|
|
840
|
+
chunkIZ3B62EN_cjs.markRejoining(callExtId, false);
|
|
841
841
|
failed("leave the stage")(err);
|
|
842
842
|
}
|
|
843
843
|
}, [callExtId, myIdentity, linkVersion]);
|
|
@@ -897,7 +897,7 @@ function useWebinar({
|
|
|
897
897
|
if (!callKey) throw new Error("This call has no key.");
|
|
898
898
|
await webinarApi().questions.ask(
|
|
899
899
|
callExtId,
|
|
900
|
-
await
|
|
900
|
+
await chunkIZ3B62EN_cjs.sealQuestionText(text, callKey),
|
|
901
901
|
linkVersion
|
|
902
902
|
);
|
|
903
903
|
}, "ask the question"),
|
|
@@ -911,7 +911,7 @@ function useWebinar({
|
|
|
911
911
|
await webinarApi().questions.update(
|
|
912
912
|
callExtId,
|
|
913
913
|
id,
|
|
914
|
-
{ answer: await
|
|
914
|
+
{ answer: await chunkIZ3B62EN_cjs.sealQuestionText(text, callKey) },
|
|
915
915
|
linkVersion
|
|
916
916
|
);
|
|
917
917
|
}, "answer the question"),
|
|
@@ -941,15 +941,15 @@ function useWebinar({
|
|
|
941
941
|
function useHostMuteNotice(callExtId) {
|
|
942
942
|
const room = componentsReact.useRoomContext();
|
|
943
943
|
react.useEffect(() => {
|
|
944
|
-
const notifyMuted =
|
|
944
|
+
const notifyMuted = chunkIZ3B62EN_cjs.createMutedNotifier((text) => chunkDZUBZ45Y_cjs.notify.info(text));
|
|
945
945
|
const onData = (payload, participant, _kind, topic, _encryption, participantIdentity) => {
|
|
946
|
-
if (topic !==
|
|
946
|
+
if (topic !== chunkIZ3B62EN_cjs.CALL_MODERATION_TOPIC) return;
|
|
947
947
|
if (participant || participantIdentity) return;
|
|
948
|
-
const notice =
|
|
948
|
+
const notice = chunkIZ3B62EN_cjs.mutedNoticeFromPacket(payload);
|
|
949
949
|
if (notice) notifyMuted(notice);
|
|
950
950
|
};
|
|
951
951
|
room.on(livekitClient.RoomEvent.DataReceived, onData);
|
|
952
|
-
const offWs =
|
|
952
|
+
const offWs = chunkIZ3B62EN_cjs.onCallEvent("call.muted", (message) => {
|
|
953
953
|
if (message.callExtId === callExtId) notifyMuted(message);
|
|
954
954
|
});
|
|
955
955
|
return () => {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { toProfileView, useCallTranscriptionAvailable, onCallEvent, transcriptPersistRole, persistTranscriptSegment, newSegmentId, encodeCaptionPacket, CALL_CAPTION_TOPIC, ensureMeetingChat, trackUploaderFor, conversationKeyForCall, loadMeetingHistory, CALL_CHAT_MAX_CHARS, newPacketId, encodeCallChatPacket, CALL_CHAT_TOPIC, persistMeetingMessage, mergeChatLines, openQuestion, markRejoining, sealQuestionText, createMutedNotifier, CALL_RECORDING_TOPIC, CALL_TRANSCRIPTION_TOPIC, decodeCaptionPacket, CALL_MODERATION_TOPIC, mutedNoticeFromPacket, decodeCallChatPacket, CALL_WEBINAR_TOPIC, parseWebinarPacket } from '../../chunk-
|
|
2
|
-
import '../../chunk-
|
|
3
|
-
import '../../chunk-
|
|
1
|
+
import { toProfileView, useCallTranscriptionAvailable, onCallEvent, transcriptPersistRole, persistTranscriptSegment, newSegmentId, encodeCaptionPacket, CALL_CAPTION_TOPIC, ensureMeetingChat, trackUploaderFor, conversationKeyForCall, loadMeetingHistory, CALL_CHAT_MAX_CHARS, newPacketId, encodeCallChatPacket, CALL_CHAT_TOPIC, persistMeetingMessage, mergeChatLines, openQuestion, markRejoining, sealQuestionText, createMutedNotifier, CALL_RECORDING_TOPIC, CALL_TRANSCRIPTION_TOPIC, decodeCaptionPacket, CALL_MODERATION_TOPIC, mutedNoticeFromPacket, decodeCallChatPacket, CALL_WEBINAR_TOPIC, parseWebinarPacket } from '../../chunk-4QON6LSH.js';
|
|
2
|
+
import '../../chunk-DLBGBIAM.js';
|
|
3
|
+
import '../../chunk-TK7ERJPE.js';
|
|
4
4
|
import { useArbi, useArbiHost } from '../../chunk-2Y6LJNWA.js';
|
|
5
5
|
import { notify } from '../../chunk-G4Z3IP4J.js';
|
|
6
6
|
import '../../chunk-DPYBZDJB.js';
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { clearSealedDrafts, useWorkspaces } from './chunk-
|
|
2
|
-
import { arbiQueryKeys, callQueryKeys } from './chunk-
|
|
1
|
+
import { clearSealedDrafts, useWorkspaces } from './chunk-DLBGBIAM.js';
|
|
2
|
+
import { arbiQueryKeys, callQueryKeys } from './chunk-TK7ERJPE.js';
|
|
3
3
|
import { useArbi, useArbiHost } from './chunk-2Y6LJNWA.js';
|
|
4
4
|
import { notify, clearChatArtifacts } from './chunk-G4Z3IP4J.js';
|
|
5
5
|
import { getUserDisplayName, DEFAULT_SEGMENTER_CONFIG, INITIAL_SEGMENTER_STATE, flushSegmenter, stepSegmenter, levelFromRms } from './chunk-APZZQZ6P.js';
|
|
@@ -2475,5 +2475,5 @@ function useOpenCallMeetingChat() {
|
|
|
2475
2475
|
}
|
|
2476
2476
|
|
|
2477
2477
|
export { AUDIENCE_CHOICES, CALL_CAPTION_TOPIC, CALL_CHAT_MAX_CHARS, CALL_CHAT_TOPIC, CALL_MODERATION_TOPIC, CALL_RECORDING_TOPIC, CALL_TRANSCRIPTION_TOPIC, CALL_WEBINAR_TOPIC, CAPTION_MAX_CHARS, COMPOSITE_AUDIO_BITS_PER_SECOND, COMPOSITE_VIDEO_BITS_PER_SECOND, DEFAULT_JOIN_CHOICES, EMPTY_CALL_SESSION, EXPORT_SAMPLE_RATE, HISTORY_LIMIT, LIVE_SEGMENTER, MAX_AVATAR_FILE_BYTES, MUTED_DEDUPE_MS, PLAYBACK_LOOKAHEAD_MS, READ_ONLY_MEETING_TEXT, RECORDING_CHUNK_MS, RECORDING_SEGMENTER, SEGMENT_FRAME_MS, SEGMENT_ID_PATTERN, SEGMENT_PRE_ROLL_MS, SHORT_PIECE_MERGE_GAP_MS, SPEAKER_AUDIO_BITS_PER_SECOND, TrackUploader, UPLOAD_ATTEMPTS, UPLOAD_BACKOFF_MS, acceptRing, addConversationToList, appendToThread, applyAgentDmStatus, applyCallEvent, applyChatEvent, applyChatMessage, applyChatRead, applyChatUpdated, arbiAccountClient, buildMeetingChatBody, cachedChat, cachedChats, callLink, callMemberKeys, callSession, chatByExtId, chatHasLiveCall, chatLiveCallId, chatTranscriptRef, clearMeetingChatCache, clearTrackUploaders, clockTime, compositeFiles, compositeTrack, conversationKeyForCall, createLocalFeatureStore, createMutedNotifier, createTrackCutter, cutAtPauses, declineRing, decodeCallChatPacket, decodeCaptionPacket, decodeMono16k, decryptPart, deleteChatMessage, dropFromThread, encodeCallChatPacket, encodeCaptionPacket, encodeWav, encryptPart, ensureMeetingChat, entitlementRefusal, extensionFor, fetchPart, fileSafe, findConversation, floatToWav, formatTranscriptMarkdown, getOpenChat, hasRecordingTranscript, invalidateCall, invalidateConversationDetails, invalidateConversationLists, isConversationListKey, isConversationShared, isRecordingOver, isRecordingSegmentId, isRetryable, isWorkspaceGuestOf, joinFromPreJoin, knownMeetingChat, loadMeetingHistory, markRejoining, meetingChatRefFrom, meetingRefForCall, mergeChatLines, mutedNoticeFromEvent, mutedNoticeFromPacket, mutedNoticeText, myChatId, newPacketId, newSegmentId, newTrackKey, nextSeqAfter, onCallEvent, openCall, openQuestion, openRecording, parseWebinarPacket, partKey, partOffsetMs, partsDue, patchConversation, patchConversationList, persistMeetingMessage, persistTranscriptSegment, playheadAt, postRecordingDocsToThread, postTranscriptToThread, readLocalFeature, recordingFiles, recordingWindowsOf, rejoinAsAudience, removeChat, removeConversationFromLists, resetCallSession, resolveMeetingChat, saveRecordingFilesToThread, schedulePart, sealQuestionText, serverCallsExperimental, setOpenChat, sortTranscriptMessages, sortedParts, speakerTracks, speakerWav, splitIntoFiles, standalone, startChatCall, startContactsCall, startDmCall, startThreadCall, startsMediaFile, storeTranscriptSegment, stripSpeakerPrefix, supersedeLiveTranscript, supersededTranscriptLines, threadHasLiveCall, threadLiveCallId, threadTranscriptLines, threadTranscriptRef, threadTranscriptText, timelineDurationMs, timelineOf, toProfileView, trackUploaderFor, transcribeRecording, transcriptPersistRole, transcriptSegmentOf, unwrapTrackKey, upsertChat, useAccountClient, useAvatarCrop, useCall, useCallInviteLinks, useCallRecording, useCallRecordings, useCallSession, useCallTranscriptionAvailable, useCallsConfig, useCallsEnabled, useCanHostCalls, useEntitlements, useFeature, useFeatureSwitch, useInvalidateEntitlements, useIsEntitled, useMeetingReadOnly, useNameEditor, useOpenCallMeetingChat, useProfile, useRecordingActions, useRecordingWindows, useRevokeCallInviteLink, useSaveToThread, useServerCallsEnabled, useServerCallsExperimental, useUpdateProfile, useUpdateUserSettings, useUserSettings, wrapTrackKey, writeSamples };
|
|
2478
|
-
//# sourceMappingURL=chunk-
|
|
2479
|
-
//# sourceMappingURL=chunk-
|
|
2478
|
+
//# sourceMappingURL=chunk-4QON6LSH.js.map
|
|
2479
|
+
//# sourceMappingURL=chunk-4QON6LSH.js.map
|