@ai-matrx/meet 0.7.83 → 0.7.85

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js CHANGED
@@ -6304,6 +6304,207 @@ function createMeetingRecordCache(options = {}) {
6304
6304
  }
6305
6305
  };
6306
6306
  }
6307
+
6308
+ // src/core/reactions.ts
6309
+ var MEET_REACTIONS = ["\u{1F496}", "\u{1F44D}", "\u{1F389}", "\u{1F44F}", "\u{1F602}", "\u{1F62E}", "\u{1F622}", "\u{1F914}", "\u{1F44E}"];
6310
+
6311
+ // src/core/collab-state.ts
6312
+ function availableActivities(collab, isHost) {
6313
+ const settings = collab?.settings ?? null;
6314
+ if (settings === null) return [];
6315
+ const out = [];
6316
+ if (settings.whiteboardEnabled) out.push("whiteboard");
6317
+ if (settings.pollsEnabled && (isHost || (collab?.polls.length ?? 0) > 0)) out.push("polls");
6318
+ if (settings.qaEnabled) out.push("qa");
6319
+ if (settings.breakoutsEnabled && (isHost || collab?.breakout?.state === "open")) out.push("breakouts");
6320
+ return out;
6321
+ }
6322
+ function activityAttention(collab, isHost) {
6323
+ if (collab === null) return false;
6324
+ if (collab.polls.some((poll) => poll.state === "live" && poll.myVote.length === 0 && !isHost)) return true;
6325
+ if (isHost && collab.questions.some((q) => q.state === "open")) return true;
6326
+ return false;
6327
+ }
6328
+ async function performCollab(runtime, request) {
6329
+ if (runtime === null) return { ok: false, message: "This meeting is not connected." };
6330
+ try {
6331
+ const result = await runtime.inRoom.collab(request);
6332
+ return { ok: true, message: result.message, itemId: result.itemId };
6333
+ } catch (error) {
6334
+ return { ok: false, message: error.message ?? "That did not work." };
6335
+ }
6336
+ }
6337
+ async function moveToRoom(runtime, roomId) {
6338
+ if (runtime === null) return { ok: false, message: "This meeting is not connected." };
6339
+ try {
6340
+ await runtime.engine.moveToBreakout(roomId);
6341
+ return { ok: true, message: roomId === null ? "Back in the main room." : "Joined the breakout room." };
6342
+ } catch (error) {
6343
+ return { ok: false, message: error.message ?? "That room could not be joined." };
6344
+ }
6345
+ }
6346
+ function untranslatedLines(lines, translations) {
6347
+ return lines.filter((line) => line.final && translations[line.id] === void 0).map(({ id, text: text3 }) => ({ id, text: text3 }));
6348
+ }
6349
+ function nextTranslationBatch(pending, language, asked) {
6350
+ const batch = pending.filter((line) => !asked.has(`${language}:${line.id}`)).slice(-20);
6351
+ for (const line of batch) asked.add(`${language}:${line.id}`);
6352
+ return batch;
6353
+ }
6354
+ function setCaptionLanguage(store, next) {
6355
+ store.patch({
6356
+ collab: {
6357
+ ...store.snapshot().collab,
6358
+ captionLanguage: next,
6359
+ captionTranslations: {},
6360
+ captionTranslationError: null
6361
+ }
6362
+ });
6363
+ }
6364
+ function takePanelRequest(store) {
6365
+ const request = store.snapshot().collab.panelRequest;
6366
+ if (request === null) return null;
6367
+ store.patch({ collab: { ...store.snapshot().collab, panelRequest: null } });
6368
+ return request.panel;
6369
+ }
6370
+ function takeMoveRequest(store) {
6371
+ const request = store.snapshot().collab.moveRequest;
6372
+ if (request === null) return null;
6373
+ store.patch({ collab: { ...store.snapshot().collab, moveRequest: null } });
6374
+ return { roomId: request.roomId };
6375
+ }
6376
+
6377
+ // src/core/observation.ts
6378
+ function observedDevice(track) {
6379
+ if (track.enabled) return "on";
6380
+ const refused = track.unavailable;
6381
+ if (refused === null) return "muted_by_me";
6382
+ switch (refused.code) {
6383
+ case "permission-denied":
6384
+ return "unavailable:denied";
6385
+ case "device-not-found":
6386
+ return "unavailable:none";
6387
+ case "device-in-use":
6388
+ return "unavailable:busy";
6389
+ case "insecure-context":
6390
+ return "unavailable:blocked_site";
6391
+ default:
6392
+ return "unavailable:failed";
6393
+ }
6394
+ }
6395
+ function endedRecord(snapshot, given) {
6396
+ const record = snapshot?.meeting ?? given;
6397
+ return record !== null && record.endedAt !== null;
6398
+ }
6399
+ function observedPhase(input) {
6400
+ const { snapshot } = input;
6401
+ if (snapshot === null) return "resolving";
6402
+ const raw = snapshot.phase;
6403
+ const live = raw === "connected" || raw === "reconnecting";
6404
+ if (endedRecord(snapshot, input.meeting ?? null) && !live) return "ended";
6405
+ switch (raw) {
6406
+ case "idle":
6407
+ case "failed":
6408
+ case "left":
6409
+ return "prejoin";
6410
+ case "lobby":
6411
+ return "waiting:knocking";
6412
+ case "requesting-token":
6413
+ case "connecting":
6414
+ return "joining";
6415
+ case "connected":
6416
+ case "reconnecting":
6417
+ return "in_call";
6418
+ }
6419
+ }
6420
+ var ADMITTER_ROLES = /* @__PURE__ */ new Set(["host", "cohost"]);
6421
+ function observe(input) {
6422
+ const { snapshot } = input;
6423
+ const phase = observedPhase(input);
6424
+ const inCall = phase === "in_call";
6425
+ const role = inCall && snapshot !== null ? effectiveRole(snapshot) : "none";
6426
+ const canAdmit = role !== "none" && ADMITTER_ROLES.has(role);
6427
+ const deviceInPlay = phase === "joining" || inCall;
6428
+ return {
6429
+ phase,
6430
+ reason: null,
6431
+ role,
6432
+ connection: snapshot?.phase === "reconnecting" ? "reconnecting" : "stable",
6433
+ hostPresent: inCall && snapshot !== null ? snapshot.participants.some((p) => ADMITTER_ROLES.has(p.role)) : null,
6434
+ lobbyCount: canAdmit && snapshot !== null ? snapshot.lobby.filter((entry) => entry.state === "knocking").length : 0,
6435
+ recording: snapshot?.recording === "recording" || snapshot?.recording === "stopping",
6436
+ audioBlocked: null,
6437
+ camera: deviceInPlay && snapshot !== null ? observedDevice(snapshot.media.camera) : null,
6438
+ microphone: deviceInPlay && snapshot !== null ? observedDevice(snapshot.media.microphone) : null
6439
+ };
6440
+ }
6441
+ function staticObservation(phase, reason = null) {
6442
+ return {
6443
+ phase,
6444
+ reason,
6445
+ role: "none",
6446
+ connection: phase === "disconnected" ? "server_unreachable" : "stable",
6447
+ hostPresent: null,
6448
+ lobbyCount: 0,
6449
+ recording: false,
6450
+ audioBlocked: null,
6451
+ camera: null,
6452
+ microphone: null
6453
+ };
6454
+ }
6455
+ function rootAttributes(o) {
6456
+ const attrs = {
6457
+ "data-meet-root": "",
6458
+ "data-meet-phase": o.phase,
6459
+ "data-meet-role": o.role,
6460
+ "data-meet-connection": o.connection,
6461
+ "data-meet-lobby-count": String(o.lobbyCount),
6462
+ "data-meet-recording": String(o.recording)
6463
+ };
6464
+ if (o.reason !== null) attrs["data-meet-reason"] = o.reason;
6465
+ if (o.hostPresent !== null) attrs["data-meet-host-present"] = String(o.hostPresent);
6466
+ if (o.audioBlocked !== null) attrs["data-meet-audio-blocked"] = String(o.audioBlocked);
6467
+ if (o.camera !== null) attrs["data-meet-camera"] = o.camera;
6468
+ if (o.microphone !== null) attrs["data-meet-microphone"] = o.microphone;
6469
+ attrs["data-meet-regions"] = JSON.stringify({
6470
+ connection: o.connection,
6471
+ camera: o.camera,
6472
+ mic: o.microphone,
6473
+ audio_output: o.audioBlocked === null ? null : o.audioBlocked ? "blocked" : "playing",
6474
+ recording: o.recording
6475
+ });
6476
+ return attrs;
6477
+ }
6478
+ function observedQuality(quality) {
6479
+ switch (quality) {
6480
+ case "excellent":
6481
+ case "good":
6482
+ return "good";
6483
+ case "poor":
6484
+ return "poor";
6485
+ case "lost":
6486
+ return "lost";
6487
+ default:
6488
+ return null;
6489
+ }
6490
+ }
6491
+ function participantAttributes(p) {
6492
+ const attrs = {
6493
+ "data-meet-participant": "",
6494
+ "data-meet-participant-identity": p.identity,
6495
+ "data-meet-participant-name": p.displayName,
6496
+ "data-meet-participant-role": p.role,
6497
+ "data-meet-participant-self": String(p.isLocal)
6498
+ };
6499
+ const quality = observedQuality(p.quality);
6500
+ if (quality !== null) attrs["data-meet-participant-connection"] = quality;
6501
+ return attrs;
6502
+ }
6503
+ function microphoneNoticeCode(track) {
6504
+ const refused = track.unavailable;
6505
+ if (refused === null) return null;
6506
+ return refused.code === "permission-denied" || refused.code === "insecure-context" ? "mic-blocked" : "device-lost";
6507
+ }
6307
6508
  export {
6308
6509
  ATTENDANCE_CSV_HEADER,
6309
6510
  CALL_INVITE_KIND,
@@ -6329,6 +6530,7 @@ export {
6329
6530
  MEET_ANSWER_CONTEXT_EVENT,
6330
6531
  MEET_ANSWER_EVENTS,
6331
6532
  MEET_EVENTS,
6533
+ MEET_REACTIONS,
6332
6534
  MEET_ROUTES,
6333
6535
  MEET_SCHEMA,
6334
6536
  MODERATION_ACTIONS,
@@ -6351,6 +6553,7 @@ export {
6351
6553
  TRANSCRIPTION_TOPIC,
6352
6554
  absenceSentence,
6353
6555
  activeWrapUpSummary,
6556
+ activityAttention,
6354
6557
  announceMeeting,
6355
6558
  applyCollabPacket,
6356
6559
  applyRoomEvent,
@@ -6367,6 +6570,7 @@ export {
6367
6570
  attendanceTotals,
6368
6571
  attendeeKey,
6369
6572
  autoAssign,
6573
+ availableActivities,
6370
6574
  breakoutRemainingMs,
6371
6575
  callInviteAction,
6372
6576
  callInviteText,
@@ -6437,6 +6641,9 @@ export {
6437
6641
  meetingWhen,
6438
6642
  mergeCaption,
6439
6643
  mergeRecord,
6644
+ microphoneNoticeCode,
6645
+ moveToRoom,
6646
+ nextTranslationBatch,
6440
6647
  normalizeDeviceError,
6441
6648
  normalizeMeetError,
6442
6649
  normalizeSpoken,
@@ -6445,9 +6652,15 @@ export {
6445
6652
  noteTakerParticipant,
6446
6653
  noteTakerStatus,
6447
6654
  notesDocument,
6655
+ observe as observeMeeting,
6656
+ observedDevice,
6657
+ observedPhase,
6658
+ observedQuality,
6448
6659
  orderParticipants,
6449
6660
  parseRoomToken,
6661
+ participantAttributes,
6450
6662
  participantSummary,
6663
+ performCollab,
6451
6664
  playableRecordingFileId,
6452
6665
  projectInvitee,
6453
6666
  projectLibraryRecording,
@@ -6467,16 +6680,22 @@ export {
6467
6680
  recordingOffsetMs,
6468
6681
  roleOf,
6469
6682
  roomTopic,
6683
+ rootAttributes,
6470
6684
  searchTranscript,
6471
6685
  sendFollowUp,
6686
+ setCaptionLanguage,
6472
6687
  setGuestRecordAccess,
6473
6688
  settingsPatch,
6474
6689
  snapshotParticipant,
6475
6690
  snippetRuns,
6691
+ staticObservation,
6476
6692
  summarizeMeetingRecordRestrictions,
6693
+ takeMoveRequest,
6694
+ takePanelRequest,
6477
6695
  transcriptDocument,
6478
6696
  unavailableFrom,
6479
6697
  uniqueAttendees,
6698
+ untranslatedLines,
6480
6699
  userTopic,
6481
6700
  wasRefused,
6482
6701
  withItem,