@ai-matrx/meet 0.11.37 → 0.11.38

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/CHANGELOG.md CHANGED
@@ -1,5 +1,11 @@
1
1
  # Changelog — `@ai-matrx/meet`
2
2
 
3
+ ## 0.11.38
4
+
5
+ Automatic changed-only republish (docs/metadata drift since the last tag — see
6
+ `git diff npm/meet/v0.11.37..npm/meet/v0.11.38 -- apps/shared/meet`).
7
+ No source changes intended and no consumer action required.
8
+
3
9
  ## 0.11.37
4
10
 
5
11
  Automatic changed-only republish (docs/metadata drift since the last tag — see
package/dist/core.cjs CHANGED
@@ -966,6 +966,12 @@ var MEET_ROUTES = {
966
966
  state: "/api/v1/meet/state",
967
967
  /** S4: `withdraw` (stop waiting) or `leave` (close this tab); the pass may ride in the body. */
968
968
  leave: "/api/v1/meet/leave",
969
+ /**
970
+ * S8: a host's browser just called an admission DOOR (`meet_admit` · `meet_deny` ·
971
+ * `meet_undeny` · `meet_admit_all`). Payload-free: the server republishes the room's
972
+ * replicated state (the People badge's waiting count) from the database truth.
973
+ */
974
+ admissionChanged: "/api/v1/meet/admission/changed",
969
975
  /** S4: a pass holder (guests included) saw the recording notice, for this run. */
970
976
  consent: "/api/v1/meet/consent"
971
977
  };
@@ -5265,6 +5271,34 @@ function createMeetingSession(options) {
5265
5271
  function hint() {
5266
5272
  channel?.send(MEET_EVENTS.stateChanged, { v: null });
5267
5273
  }
5274
+ async function tellServerAdmissionChanged(operation) {
5275
+ const meeting = store.snapshot().meeting;
5276
+ if (meeting === null) return;
5277
+ const pass = options.resolvePass?.() ?? null;
5278
+ try {
5279
+ const response = await options.api.request({
5280
+ path: MEET_ROUTES.admissionChanged,
5281
+ method: "POST",
5282
+ requireAuth: false,
5283
+ operation,
5284
+ body: { meeting_id: meeting.id },
5285
+ ...pass !== null ? { headers: { [MEETING_PASS_HEADER]: pass } } : {}
5286
+ });
5287
+ if (!response.ok) {
5288
+ report(
5289
+ "warn",
5290
+ `${operation}: the server answered ${response.status} when told about the admission change`,
5291
+ "The decision was saved. The waiting count in the room may lag until the next change."
5292
+ );
5293
+ }
5294
+ } catch (error) {
5295
+ report(
5296
+ "warn",
5297
+ `${operation}: ${String(error)}`,
5298
+ "The decision was saved. The waiting count in the room may lag until the next change."
5299
+ );
5300
+ }
5301
+ }
5268
5302
  async function refreshQueue() {
5269
5303
  const meeting = store.snapshot().meeting;
5270
5304
  if (meeting === null || isGuest(identity) || !isHostRole(effectiveRole(store.snapshot()))) return;
@@ -5420,6 +5454,7 @@ function createMeetingSession(options) {
5420
5454
  decidedAt: (/* @__PURE__ */ new Date()).toISOString(),
5421
5455
  decidedBy: by
5422
5456
  });
5457
+ await tellServerAdmissionChanged("meet.admit");
5423
5458
  hint();
5424
5459
  },
5425
5460
  async undeny(entry) {
@@ -5432,6 +5467,7 @@ function createMeetingSession(options) {
5432
5467
  byUserId: by
5433
5468
  });
5434
5469
  store.upsertLobby({ ...entry, state: decidedState(row.admissionState), decidedAt: (/* @__PURE__ */ new Date()).toISOString(), decidedBy: by });
5470
+ await tellServerAdmissionChanged("meet.undeny");
5435
5471
  hint();
5436
5472
  },
5437
5473
  async admitAll() {
@@ -5441,6 +5477,7 @@ function createMeetingSession(options) {
5441
5477
  for (const row of rows) {
5442
5478
  store.setAdmission(row.identity, row.admissionState, by);
5443
5479
  }
5480
+ await tellServerAdmissionChanged("meet.admitAll");
5444
5481
  hint();
5445
5482
  },
5446
5483
  startWaiting() {
@@ -7396,7 +7433,22 @@ function createInRoomClient(options) {
7396
7433
  function refusal2(response, operation, remedy) {
7397
7434
  return refusalFromResponse(response, operation, remedy);
7398
7435
  }
7399
- return {
7436
+ let toldPresenting = false;
7437
+ let tellChain = Promise.resolve();
7438
+ store.subscribe(() => {
7439
+ const local = store.snapshot().participants.find((p) => p.isLocal);
7440
+ const sharing = local?.screenSharing === true;
7441
+ if (sharing === toldPresenting || local === void 0) return;
7442
+ toldPresenting = sharing;
7443
+ const on = sharing;
7444
+ tellChain = tellChain.then(() => client.moderate({ action: "present", on })).then(
7445
+ () => void 0,
7446
+ (error) => {
7447
+ console.warn(`[meet] the server did not take presenter=${String(on)}: ${String(error)}`);
7448
+ }
7449
+ );
7450
+ });
7451
+ const client = {
7400
7452
  async moderate(request) {
7401
7453
  const operation = `meet.moderate(${request.action})`;
7402
7454
  const hdrs = headers();
@@ -7601,6 +7653,7 @@ function createInRoomClient(options) {
7601
7653
  });
7602
7654
  }
7603
7655
  };
7656
+ return client;
7604
7657
  }
7605
7658
 
7606
7659
  // src/core/record.ts