@ai-matrx/meet 0.11.49 → 0.11.50
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 +6 -0
- package/dist/core.cjs +71 -10
- package/dist/core.cjs.map +1 -1
- package/dist/core.d.cts +7 -0
- package/dist/core.d.ts +7 -0
- package/dist/core.js +71 -10
- package/dist/core.js.map +1 -1
- package/dist/index.cjs +71 -10
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +71 -10
- package/dist/index.js.map +1 -1
- package/dist/react.cjs +83 -20
- package/dist/react.cjs.map +1 -1
- package/dist/react.js +83 -20
- package/dist/react.js.map +1 -1
- package/dist/skins/meet.cjs +12 -10
- package/dist/skins/meet.cjs.map +1 -1
- package/dist/skins/meet.js +12 -10
- package/dist/skins/meet.js.map +1 -1
- package/package.json +5 -5
package/dist/core.d.cts
CHANGED
|
@@ -246,6 +246,8 @@ interface DeviceNotice {
|
|
|
246
246
|
readonly outcome: "switched" | "lost";
|
|
247
247
|
/** The device that went away, by label (empty when the browser hid labels). */
|
|
248
248
|
readonly from: string;
|
|
249
|
+
/** The device that went away, by id, so Undo can go back to it if it is plugged in again. */
|
|
250
|
+
readonly fromId?: string | undefined;
|
|
249
251
|
/** The device now in use (`switched` only). */
|
|
250
252
|
readonly to: string | null;
|
|
251
253
|
}
|
|
@@ -2369,6 +2371,8 @@ interface MeetingSession {
|
|
|
2369
2371
|
readState(): Promise<void>;
|
|
2370
2372
|
/** One read of the meeting's rules now (chat mode, attendee lock, time limit); resolves once they are on the store. */
|
|
2371
2373
|
readLivePolicy(): Promise<void>;
|
|
2374
|
+
/** rec-consent-gate: tell the SERVER this person agreed to being recorded (a row fact; it gives publish back). */
|
|
2375
|
+
acknowledgeConsent(): Promise<void>;
|
|
2372
2376
|
/**
|
|
2373
2377
|
* §3.4 ER: what the server recorded for THIS connection's exit, and the run's phase. null =
|
|
2374
2378
|
* the read failed (offline / unreachable); undefined = no meeting or no pass to ask with.
|
|
@@ -2574,6 +2578,8 @@ interface MediaSupervisor {
|
|
|
2574
2578
|
acceptOffer(): Promise<void>;
|
|
2575
2579
|
dismissOffer(): void;
|
|
2576
2580
|
dismissNotice(): void;
|
|
2581
|
+
/** Undo on a "switched" notice: go back to the device that went away, when it is available again. */
|
|
2582
|
+
undoNotice(): Promise<void>;
|
|
2577
2583
|
}
|
|
2578
2584
|
declare function createMediaSupervisor(options: MediaSupervisorOptions): MediaSupervisor;
|
|
2579
2585
|
|
|
@@ -2766,6 +2772,7 @@ interface RoomEngine {
|
|
|
2766
2772
|
acceptDeviceOffer(): Promise<void>;
|
|
2767
2773
|
dismissDeviceOffer(): void;
|
|
2768
2774
|
dismissDeviceNotice(): void;
|
|
2775
|
+
undoDeviceNotice(): Promise<void>;
|
|
2769
2776
|
/** Choose the speaker (audio output) for this meeting. */
|
|
2770
2777
|
switchDevice(kind: "audioinput" | "videoinput" | "audiooutput", deviceId: string): Promise<void>;
|
|
2771
2778
|
pin(identity: ParticipantIdentity | null): void;
|
package/dist/core.d.ts
CHANGED
|
@@ -246,6 +246,8 @@ interface DeviceNotice {
|
|
|
246
246
|
readonly outcome: "switched" | "lost";
|
|
247
247
|
/** The device that went away, by label (empty when the browser hid labels). */
|
|
248
248
|
readonly from: string;
|
|
249
|
+
/** The device that went away, by id, so Undo can go back to it if it is plugged in again. */
|
|
250
|
+
readonly fromId?: string | undefined;
|
|
249
251
|
/** The device now in use (`switched` only). */
|
|
250
252
|
readonly to: string | null;
|
|
251
253
|
}
|
|
@@ -2369,6 +2371,8 @@ interface MeetingSession {
|
|
|
2369
2371
|
readState(): Promise<void>;
|
|
2370
2372
|
/** One read of the meeting's rules now (chat mode, attendee lock, time limit); resolves once they are on the store. */
|
|
2371
2373
|
readLivePolicy(): Promise<void>;
|
|
2374
|
+
/** rec-consent-gate: tell the SERVER this person agreed to being recorded (a row fact; it gives publish back). */
|
|
2375
|
+
acknowledgeConsent(): Promise<void>;
|
|
2372
2376
|
/**
|
|
2373
2377
|
* §3.4 ER: what the server recorded for THIS connection's exit, and the run's phase. null =
|
|
2374
2378
|
* the read failed (offline / unreachable); undefined = no meeting or no pass to ask with.
|
|
@@ -2574,6 +2578,8 @@ interface MediaSupervisor {
|
|
|
2574
2578
|
acceptOffer(): Promise<void>;
|
|
2575
2579
|
dismissOffer(): void;
|
|
2576
2580
|
dismissNotice(): void;
|
|
2581
|
+
/** Undo on a "switched" notice: go back to the device that went away, when it is available again. */
|
|
2582
|
+
undoNotice(): Promise<void>;
|
|
2577
2583
|
}
|
|
2578
2584
|
declare function createMediaSupervisor(options: MediaSupervisorOptions): MediaSupervisor;
|
|
2579
2585
|
|
|
@@ -2766,6 +2772,7 @@ interface RoomEngine {
|
|
|
2766
2772
|
acceptDeviceOffer(): Promise<void>;
|
|
2767
2773
|
dismissDeviceOffer(): void;
|
|
2768
2774
|
dismissDeviceNotice(): void;
|
|
2775
|
+
undoDeviceNotice(): Promise<void>;
|
|
2769
2776
|
/** Choose the speaker (audio output) for this meeting. */
|
|
2770
2777
|
switchDevice(kind: "audioinput" | "videoinput" | "audiooutput", deviceId: string): Promise<void>;
|
|
2771
2778
|
pin(identity: ParticipantIdentity | null): void;
|
package/dist/core.js
CHANGED
|
@@ -4078,11 +4078,10 @@ function moderationText(kind, payload) {
|
|
|
4078
4078
|
switch (kind) {
|
|
4079
4079
|
case "muted": {
|
|
4080
4080
|
const source = text2(payload["source"]) ?? "microphone";
|
|
4081
|
-
|
|
4082
|
-
return source === "microphone" ? `You've been muted by ${who}.` : source === "camera" ? `Your camera was turned off by ${who}.` : `Your screen share was stopped by ${who}.`;
|
|
4081
|
+
return source === "microphone" ? `${by} muted you.` : source === "camera" ? `${by} turned off your camera.` : `${by} stopped your screen share.`;
|
|
4083
4082
|
}
|
|
4084
4083
|
case "ask-unmute":
|
|
4085
|
-
return `${by
|
|
4084
|
+
return `${by} is asking you to unmute.`;
|
|
4086
4085
|
case "removed":
|
|
4087
4086
|
return `${by} removed you from this meeting.`;
|
|
4088
4087
|
default:
|
|
@@ -4108,7 +4107,7 @@ function applyModeration(store, payload, now) {
|
|
|
4108
4107
|
grants: { ...snapshot.grants, role },
|
|
4109
4108
|
moderationNotice: {
|
|
4110
4109
|
kind: "role",
|
|
4111
|
-
text: role === "host" ? "You are now the host." : role === "cohost" ? "You
|
|
4110
|
+
text: role === "host" ? "You are now the host." : role === "cohost" ? "You are now a co-host." : role === "presenter" ? "You are now a presenter." : snapshot.grants.role === "presenter" ? "You are now a participant: you can no longer present." : "You are no longer a co-host.",
|
|
4112
4111
|
at: now()
|
|
4113
4112
|
}
|
|
4114
4113
|
});
|
|
@@ -5368,7 +5367,10 @@ function createMeetingSession(options) {
|
|
|
5368
5367
|
const meeting = store.snapshot().meeting;
|
|
5369
5368
|
const pass = options.resolvePass?.() ?? null;
|
|
5370
5369
|
if (meeting === null || pass === null) return;
|
|
5371
|
-
if (policyReading)
|
|
5370
|
+
if (policyReading) {
|
|
5371
|
+
await (policyInFlight ?? void 0);
|
|
5372
|
+
return readLivePolicy();
|
|
5373
|
+
}
|
|
5372
5374
|
policyReading = true;
|
|
5373
5375
|
let done = () => void 0;
|
|
5374
5376
|
policyInFlight = new Promise((resolve) => done = resolve);
|
|
@@ -5389,6 +5391,9 @@ function createMeetingSession(options) {
|
|
|
5389
5391
|
if (!samePolicy(snapshot.livePolicy, next) || startedAt !== snapshot.sessionStartedAt) {
|
|
5390
5392
|
store.patch({ livePolicy: next, sessionStartedAt: startedAt });
|
|
5391
5393
|
}
|
|
5394
|
+
if (read.consent_given === true && !store.snapshot().recordingConsentGiven) {
|
|
5395
|
+
store.patch({ recordingConsentGiven: true });
|
|
5396
|
+
}
|
|
5392
5397
|
} catch {
|
|
5393
5398
|
} finally {
|
|
5394
5399
|
policyReading = false;
|
|
@@ -5693,6 +5698,21 @@ function createMeetingSession(options) {
|
|
|
5693
5698
|
stopWaiting,
|
|
5694
5699
|
readState: readState2,
|
|
5695
5700
|
readLivePolicy,
|
|
5701
|
+
async acknowledgeConsent() {
|
|
5702
|
+
const meeting = requireMeeting("meet.consent");
|
|
5703
|
+
const pass = options.resolvePass?.() ?? null;
|
|
5704
|
+
const response = await options.api.request({
|
|
5705
|
+
path: MEET_ROUTES.consent,
|
|
5706
|
+
method: "POST",
|
|
5707
|
+
requireAuth: false,
|
|
5708
|
+
operation: "meet.consent",
|
|
5709
|
+
body: { meeting_id: meeting.id },
|
|
5710
|
+
...pass !== null ? { headers: { [MEETING_PASS_HEADER]: pass } } : {}
|
|
5711
|
+
});
|
|
5712
|
+
if (!response.ok) {
|
|
5713
|
+
throw new MeetError("transport", `meet.consent: the server answered ${response.status}`, "Your agreement was not saved. Try again.");
|
|
5714
|
+
}
|
|
5715
|
+
},
|
|
5696
5716
|
async readExit(connection, held) {
|
|
5697
5717
|
const meeting = store.snapshot().meeting;
|
|
5698
5718
|
const pass = held ?? options.resolvePass?.() ?? null;
|
|
@@ -6564,7 +6584,9 @@ function createMediaSupervisor(options) {
|
|
|
6564
6584
|
const deviceKind = INPUT_KIND[kind];
|
|
6565
6585
|
const previous = inUse[deviceKind];
|
|
6566
6586
|
const track = store.snapshot().media[kind];
|
|
6567
|
-
const
|
|
6587
|
+
const aliasLabel = previous !== null && isAlias(previous) ? before[deviceKind].get(previous) : void 0;
|
|
6588
|
+
const aliasGone = previous !== null && aliasLabel !== void 0 && aliasLabel !== "" && (!now[deviceKind].has(previous) || now[deviceKind].get(previous) !== aliasLabel);
|
|
6589
|
+
const gone = aliasGone || previous !== null && !isAlias(previous) && before[deviceKind].has(previous) && !now[deviceKind].has(previous);
|
|
6568
6590
|
if (gone) {
|
|
6569
6591
|
const from = before[deviceKind].get(previous) ?? "";
|
|
6570
6592
|
const remaining = [...now[deviceKind].entries()].filter(([id]) => !isAlias(id));
|
|
@@ -6589,7 +6611,7 @@ function createMediaSupervisor(options) {
|
|
|
6589
6611
|
await driver.setCameraEnabled(true);
|
|
6590
6612
|
store.setLocalTrack("camera", { enabled: true, unavailable: null });
|
|
6591
6613
|
}
|
|
6592
|
-
setRegion({ notice: { id: ++noticeId, kind, outcome: "switched", from, to: nextLabel } });
|
|
6614
|
+
setRegion({ notice: { id: ++noticeId, kind, outcome: "switched", from, fromId: previous, to: nextLabel } });
|
|
6593
6615
|
} catch (error) {
|
|
6594
6616
|
const refused = await unavailable(error, "camera", "meet.camera(fallback)");
|
|
6595
6617
|
store.setLocalTrack("camera", { enabled: false, unavailable: refused });
|
|
@@ -6597,8 +6619,24 @@ function createMediaSupervisor(options) {
|
|
|
6597
6619
|
}
|
|
6598
6620
|
} else {
|
|
6599
6621
|
const active = driver.activeDevices().audioinput;
|
|
6600
|
-
|
|
6601
|
-
|
|
6622
|
+
let to = (active !== null && !aliasGone ? now.audioinput.get(active) : void 0) ?? now.audioinput.get("default");
|
|
6623
|
+
if (to === void 0 || aliasGone) {
|
|
6624
|
+
const [nextId, nextLabel] = remaining[0];
|
|
6625
|
+
try {
|
|
6626
|
+
await driver.switchDevice("audioinput", nextId);
|
|
6627
|
+
if (track.enabled || track.unavailable !== null) {
|
|
6628
|
+
await driver.setMicrophoneEnabled(true);
|
|
6629
|
+
store.setLocalTrack("microphone", { enabled: true, unavailable: null });
|
|
6630
|
+
}
|
|
6631
|
+
to = nextLabel;
|
|
6632
|
+
} catch (error) {
|
|
6633
|
+
const refused = await unavailable(error, "microphone", "meet.microphone(fallback)");
|
|
6634
|
+
store.setLocalTrack("microphone", { enabled: false, unavailable: refused });
|
|
6635
|
+
setRegion({ notice: { id: ++noticeId, kind, outcome: "lost", from, to: null } });
|
|
6636
|
+
continue;
|
|
6637
|
+
}
|
|
6638
|
+
}
|
|
6639
|
+
setRegion({ notice: { id: ++noticeId, kind, outcome: "switched", from, fromId: previous, to } });
|
|
6602
6640
|
}
|
|
6603
6641
|
continue;
|
|
6604
6642
|
}
|
|
@@ -6703,6 +6741,21 @@ function createMediaSupervisor(options) {
|
|
|
6703
6741
|
},
|
|
6704
6742
|
dismissNotice() {
|
|
6705
6743
|
setRegion({ notice: null });
|
|
6744
|
+
},
|
|
6745
|
+
async undoNotice() {
|
|
6746
|
+
const notice = region().notice;
|
|
6747
|
+
setRegion({ notice: null });
|
|
6748
|
+
const driver = options.driver();
|
|
6749
|
+
if (notice === null || notice.outcome !== "switched" || notice.fromId === void 0 || driver === null) return;
|
|
6750
|
+
const list = await snapshotDevices();
|
|
6751
|
+
if (!list[INPUT_KIND[notice.kind]].has(notice.fromId)) return;
|
|
6752
|
+
try {
|
|
6753
|
+
await driver.switchDevice(INPUT_KIND[notice.kind], notice.fromId);
|
|
6754
|
+
readInUse();
|
|
6755
|
+
} catch (error) {
|
|
6756
|
+
const refused = await unavailable(error, notice.kind, "meet.undoDeviceSwitch");
|
|
6757
|
+
store.setLocalTrack(notice.kind, { enabled: false, unavailable: refused });
|
|
6758
|
+
}
|
|
6706
6759
|
}
|
|
6707
6760
|
};
|
|
6708
6761
|
return api;
|
|
@@ -6917,7 +6970,14 @@ function createRoomEngine(options) {
|
|
|
6917
6970
|
const latest = store.snapshot().meeting;
|
|
6918
6971
|
if (latest === null) return;
|
|
6919
6972
|
store.patch({ meeting: { ...latest, endedAt: verified.endedAt } });
|
|
6920
|
-
|
|
6973
|
+
const connection = current?.connectionIdentity ?? current?.identity ?? store.snapshot().localIdentity ?? null;
|
|
6974
|
+
let why;
|
|
6975
|
+
try {
|
|
6976
|
+
why = options.readExit !== void 0 && connection !== null ? await options.readExit(connection, current?.meetingPass ?? null) : void 0;
|
|
6977
|
+
} catch {
|
|
6978
|
+
why = null;
|
|
6979
|
+
}
|
|
6980
|
+
store.dispatch({ type: "ended" }, { reason: why?.exitReason === "time_limit" ? "time_limit" : "ended" });
|
|
6921
6981
|
await dropRoom();
|
|
6922
6982
|
options.onLeft?.("ended");
|
|
6923
6983
|
} catch (error) {
|
|
@@ -7689,6 +7749,7 @@ function createRoomEngine(options) {
|
|
|
7689
7749
|
acceptDeviceOffer: () => media.acceptOffer(),
|
|
7690
7750
|
dismissDeviceOffer: () => media.dismissOffer(),
|
|
7691
7751
|
dismissDeviceNotice: () => media.dismissNotice(),
|
|
7752
|
+
undoDeviceNotice: () => media.undoNotice(),
|
|
7692
7753
|
pin(who) {
|
|
7693
7754
|
store.patch({ pinned: who, layout: who === null ? "grid" : "speaker" });
|
|
7694
7755
|
},
|