@ai-matrx/meet 0.11.27 → 0.11.28

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/react.cjs CHANGED
@@ -1404,6 +1404,8 @@ function nextPhase(from, event) {
1404
1404
  return from === "resolving" ? "prejoin" : null;
1405
1405
  case "unsupported":
1406
1406
  return from === "resolving" ? "unsupported" : null;
1407
+ case "link_state":
1408
+ return from === "resolving" && event.reason !== null && isJoinRefusalReason(event.reason) ? refusalPhase(event.reason) : null;
1407
1409
  case "join":
1408
1410
  return JOINABLE_FROM.has(from) ? "joining" : null;
1409
1411
  case "back_to_prejoin":
@@ -2166,6 +2168,8 @@ var RPCS = {
2166
2168
  getOrCreateMeeting: "meet_get_or_create_meeting",
2167
2169
  /** Resolve a durable public link, before/during/after its scheduled time. */
2168
2170
  meetingBySlug: "meet_meeting_by_slug",
2171
+ /** The current run of a durable link (open / not started / ended + next start), no pass needed. */
2172
+ linkState: "meet_link_state",
2169
2173
  /*
2170
2174
  * ── S4 ADMISSION (CORE-DESIGN §2.4). Each returns the decided row; the caller then
2171
2175
  * sends the payload-free `mx.state.changed` hint. Authorized by `who_may_admit`.
@@ -2474,6 +2478,14 @@ function createMeetRepository(options) {
2474
2478
  if (response.error !== null) throw normalizeMeetError(response.error, operation);
2475
2479
  }
2476
2480
  }
2481
+ async function readLinkRun(slug) {
2482
+ try {
2483
+ const response = await db.rpc(RPCS.linkState, { p_slug: slug });
2484
+ return projectLinkRun(response.error === null ? response.data : null);
2485
+ } catch {
2486
+ return void 0;
2487
+ }
2488
+ }
2477
2489
  async function guard(operation, run) {
2478
2490
  let response = await run();
2479
2491
  if (response.error !== null) {
@@ -2875,11 +2887,12 @@ function createMeetRepository(options) {
2875
2887
  return projectMeeting(row);
2876
2888
  },
2877
2889
  async meetingBySlug(slug) {
2878
- const row = await guard(
2879
- "meet.meetingBySlug",
2880
- () => db.rpc(RPCS.meetingBySlug, { p_slug: slug })
2881
- );
2882
- return withRunNoteTaker(projectMeeting(row));
2890
+ const [row, linkRun] = await Promise.all([
2891
+ guard("meet.meetingBySlug", () => db.rpc(RPCS.meetingBySlug, { p_slug: slug })),
2892
+ readLinkRun(slug)
2893
+ ]);
2894
+ const record = withRunNoteTaker(projectMeeting(row));
2895
+ return linkRun === void 0 ? record : { ...record, linkRun };
2883
2896
  },
2884
2897
  async meeting(id) {
2885
2898
  const response = await db.from(TABLES.meetings).select(MEETING_COLUMNS).eq("id", id).single();
@@ -3068,6 +3081,15 @@ function snippetRuns(snippet) {
3068
3081
  if (last < snippet.length) runs.push({ text: snippet.slice(last), hit: false });
3069
3082
  return runs;
3070
3083
  }
3084
+ function projectLinkRun(value) {
3085
+ if (typeof value !== "object" || value === null) return void 0;
3086
+ const row = value;
3087
+ const state = row["state"];
3088
+ if (state !== "open" && state !== "not_started" && state !== "ended" && state !== "cancelled") return void 0;
3089
+ const reason = row["reason"] === "ended" || row["reason"] === "cancelled" ? row["reason"] : null;
3090
+ const nextStart = typeof row["next_start"] === "string" ? row["next_start"] : null;
3091
+ return { state, reason, nextStart };
3092
+ }
3071
3093
 
3072
3094
  // src/core/app-panel.ts
3073
3095
  function appPanelOf(meeting) {
@@ -11882,7 +11904,7 @@ function ExitScreen({ onLeave }) {
11882
11904
  if (phase.startsWith("refused:")) {
11883
11905
  const code = phase.slice("refused:".length);
11884
11906
  title = REFUSED_TITLES[code] ?? "You can't join this meeting";
11885
- line = failure?.remedy ?? null;
11907
+ line = code === "too_early" || code === "registration_required" || code === "cancelled" ? failure?.remedy ?? null : null;
11886
11908
  actionsNode = /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)(import_jsx_runtime6.Fragment, { children: [
11887
11909
  /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(import_design_system.Button, { type: "button", variant: "outline", onClick: actions.retry, children: "Try again" }),
11888
11910
  home
@@ -11932,6 +11954,10 @@ function ExitScreen({ onLeave }) {
11932
11954
  case "ended":
11933
11955
  case "record":
11934
11956
  title = reason === "time_limit" ? "The meeting reached its time limit" : "The meeting has ended";
11957
+ if (failure?.reason === "ended" && failure.remedy.length > 0 && failure.message.startsWith("This run")) {
11958
+ title = failure.message.replace(/\.$/, "");
11959
+ line = failure.remedy;
11960
+ }
11935
11961
  notice = "meeting-ended";
11936
11962
  break;
11937
11963
  default:
@@ -12502,8 +12528,15 @@ function MeetingSkinRootBody({
12502
12528
  if (now.phase !== "resolving" && now.roomName !== null && now.roomName !== roomName && now.call === null) {
12503
12529
  host.store.dispatch({ type: "reset" });
12504
12530
  }
12505
- if (host.store.snapshot().phase === "resolving") host.store.dispatch({ type: "resolved" });
12506
- }, [host, roomName, phase]);
12531
+ if (host.store.snapshot().phase !== "resolving") return;
12532
+ const reason = given?.linkRun?.reason ?? null;
12533
+ if (reason !== null && given?.linkRun !== void 0) {
12534
+ const words = linkRunWords(given.linkRun);
12535
+ host.store.patch({ failure: { message: words.message, remedy: words.remedy, reason } });
12536
+ if (host.store.dispatch({ type: "link_state", reason })) return;
12537
+ }
12538
+ host.store.dispatch({ type: "resolved" });
12539
+ }, [host, roomName, phase, given]);
12507
12540
  (0, import_react12.useEffect)(() => {
12508
12541
  if (given === void 0) return;
12509
12542
  if (host.store.snapshot().meeting !== null) return;
@@ -12530,6 +12563,31 @@ function MeetingSkinRootBody({
12530
12563
  }
12531
12564
  );
12532
12565
  }
12566
+ function linkRunWords(run) {
12567
+ if (run.reason === "cancelled") {
12568
+ return {
12569
+ message: "This occurrence of the meeting was cancelled.",
12570
+ remedy: "The series continues; open the same link at its next time."
12571
+ };
12572
+ }
12573
+ if (run.nextStart === null) {
12574
+ return {
12575
+ message: "This meeting has ended.",
12576
+ remedy: "The link still opens its record: summary, notes and transcript. Nobody can rejoin."
12577
+ };
12578
+ }
12579
+ const when2 = new Date(run.nextStart).toLocaleString(void 0, {
12580
+ weekday: "short",
12581
+ month: "short",
12582
+ day: "numeric",
12583
+ hour: "numeric",
12584
+ minute: "2-digit"
12585
+ });
12586
+ return {
12587
+ message: "This run of the meeting has ended.",
12588
+ remedy: `The next one starts ${when2}. Open the same link then.`
12589
+ };
12590
+ }
12533
12591
 
12534
12592
  // src/react/calls-ui.tsx
12535
12593
  var import_react13 = require("react");