@cloudflare/realtimekit 2.0.5-staging.1 → 2.1.0-staging.1

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.
@@ -793,6 +793,26 @@ interface RoomInfoResponse {
793
793
  * @generated MessageType for protobuf message socket.room.RoomInfoResponse
794
794
  */
795
795
  declare const RoomInfoResponse: RoomInfoResponse$Type;
796
+ declare class ServiceError$Type extends MessageType$1<ServiceError> {
797
+ constructor();
798
+ }
799
+ /**
800
+ * @generated from protobuf message socket.room.ServiceError
801
+ */
802
+ interface ServiceError {
803
+ /**
804
+ * @generated from protobuf field: optional string message = 1;
805
+ */
806
+ message?: string;
807
+ /**
808
+ * @generated from protobuf field: optional string code = 2;
809
+ */
810
+ code?: string;
811
+ }
812
+ /**
813
+ * @generated MessageType for protobuf message socket.room.ServiceError
814
+ */
815
+ declare const ServiceError: ServiceError$Type;
796
816
  declare class CreateRoomRequestPayload$Type extends MessageType$1<CreateRoomRequestPayload> {
797
817
  constructor();
798
818
  }
@@ -2023,6 +2043,7 @@ declare class RoomSocketHandler {
2023
2043
  on(event: number, handler: (message: EventHandlerTypes) => void): void;
2024
2044
  getUserPermissions(userId: string): Promise<Pick<PresetTypeV2['permissions'], 'chat' | 'polls' | 'plugins'>>;
2025
2045
  }
2046
+ declare const ApplyRemoteTitleSync: unique symbol;
2026
2047
  type ActiveTabType = 'screenshare' | 'plugin';
2027
2048
  interface ActiveTab {
2028
2049
  type: ActiveTabType;
@@ -2046,6 +2067,9 @@ type MetaEvents = {
2046
2067
  ['meetingStartTimeUpdate']: (payload: {
2047
2068
  meetingStartedTimestamp: Date;
2048
2069
  }) => void;
2070
+ ['meetingTitleUpdate']: (payload: {
2071
+ meetingTitle: string;
2072
+ }) => void;
2049
2073
  ['activeTabUpdate']: (tab: ActiveTab) => void;
2050
2074
  ['selfTabUpdate']: (tab: ActiveTab) => void;
2051
2075
  ['broadcastTabChangesUpdate']: (broadcastTabChanges: boolean) => void;
@@ -2061,6 +2085,7 @@ declare class Meta extends TypedEventEmitter<MetaEvents> {
2061
2085
  meetingTitle: string;
2062
2086
  sessionId: string;
2063
2087
  constructor(context: Context<ContextState>, self: Self, viewType: string, roomSocketHandler: RoomSocketHandler, meetingTitle: string);
2088
+ [ApplyRemoteTitleSync](meetingTitle: string): void;
2064
2089
  readonly meetingId: string;
2065
2090
  setBroadcastTabChanges(broadcastTabChanges: boolean): void;
2066
2091
  setSelfActiveTab(spotlightTab: ActiveTab, tabChangeSource: TabChangeSource): void;
@@ -3208,7 +3233,8 @@ declare const ERROR_CODES: {
3208
3233
  };
3209
3234
  declare class ClientError extends Error {
3210
3235
  code: keyof typeof ERROR_CODES;
3211
- constructor(message: string, code?: keyof typeof ERROR_CODES, logger?: Logger | undefined, log?: boolean);
3236
+ reason?: string;
3237
+ constructor(message: string, code?: keyof typeof ERROR_CODES, logger?: Logger | undefined, log?: boolean, reason?: string | undefined);
3212
3238
  }
3213
3239
  declare class StoreManager {
3214
3240
  stores: Map<String, Store>;
@@ -3249,6 +3275,7 @@ declare class ConnectedMeetingsSocketHandler {
3249
3275
  handleConnectedRoomsUpdatedRaw({ payload }: SocketServicePayload): {
3250
3276
  id: string;
3251
3277
  title: string;
3278
+ error: ServiceError;
3252
3279
  }[];
3253
3280
  handleConnectedRoomsDeletedRaw({ payload }: SocketServicePayload): {
3254
3281
  id: string;
@@ -3260,8 +3287,13 @@ declare class ConnectedMeetingsSocketHandler {
3260
3287
  createConnectedRooms(request: CreateRoomRequestPayload[]): Promise<{
3261
3288
  id: string;
3262
3289
  title: string;
3290
+ error: ServiceError;
3291
+ }[]>;
3292
+ updateConnectedRooms(request: UpdateRoomRequestPayload[]): Promise<{
3293
+ id: string;
3294
+ title: string;
3295
+ error: ServiceError;
3263
3296
  }[]>;
3264
- updateConnectedRooms(request: UpdateRoomRequestPayload[]): Promise<void>;
3265
3297
  disableConnectedRooms(meetingIds: string[]): Promise<{
3266
3298
  id: string;
3267
3299
  }[]>;
@@ -764,6 +764,26 @@ interface RoomInfoResponse {
764
764
  * @generated MessageType for protobuf message socket.room.RoomInfoResponse
765
765
  */
766
766
  declare const RoomInfoResponse: RoomInfoResponse$Type;
767
+ declare class ServiceError$Type extends MessageType$1<ServiceError> {
768
+ constructor();
769
+ }
770
+ /**
771
+ * @generated from protobuf message socket.room.ServiceError
772
+ */
773
+ interface ServiceError {
774
+ /**
775
+ * @generated from protobuf field: optional string message = 1;
776
+ */
777
+ message?: string;
778
+ /**
779
+ * @generated from protobuf field: optional string code = 2;
780
+ */
781
+ code?: string;
782
+ }
783
+ /**
784
+ * @generated MessageType for protobuf message socket.room.ServiceError
785
+ */
786
+ declare const ServiceError: ServiceError$Type;
767
787
  declare class CreateRoomRequestPayload$Type extends MessageType$1<CreateRoomRequestPayload> {
768
788
  constructor();
769
789
  }
@@ -2060,6 +2080,7 @@ declare class RoomSocketHandler {
2060
2080
  on(event: number, handler: (message: EventHandlerTypes) => void): void;
2061
2081
  getUserPermissions(userId: string): Promise<Pick<PresetTypeV2['permissions'], 'chat' | 'polls' | 'plugins'>>;
2062
2082
  }
2083
+ declare const ApplyRemoteTitleSync: unique symbol;
2063
2084
  type ActiveTabType = 'screenshare' | 'plugin';
2064
2085
  interface ActiveTab {
2065
2086
  type: ActiveTabType;
@@ -2083,6 +2104,9 @@ type MetaEvents = {
2083
2104
  ['meetingStartTimeUpdate']: (payload: {
2084
2105
  meetingStartedTimestamp: Date;
2085
2106
  }) => void;
2107
+ ['meetingTitleUpdate']: (payload: {
2108
+ meetingTitle: string;
2109
+ }) => void;
2086
2110
  ['activeTabUpdate']: (tab: ActiveTab) => void;
2087
2111
  ['selfTabUpdate']: (tab: ActiveTab) => void;
2088
2112
  ['broadcastTabChangesUpdate']: (broadcastTabChanges: boolean) => void;
@@ -2098,6 +2122,7 @@ declare class Meta extends TypedEventEmitter$1<MetaEvents> {
2098
2122
  meetingTitle: string;
2099
2123
  sessionId: string;
2100
2124
  constructor(context: Context<ContextState>, self: Self, viewType: string, roomSocketHandler: RoomSocketHandler, meetingTitle: string);
2125
+ [ApplyRemoteTitleSync](meetingTitle: string): void;
2101
2126
  readonly meetingId: string;
2102
2127
  setBroadcastTabChanges(broadcastTabChanges: boolean): void;
2103
2128
  setSelfActiveTab(spotlightTab: ActiveTab, tabChangeSource: TabChangeSource): void;
@@ -3830,6 +3855,7 @@ declare class ConnectedMeetingsSocketHandler {
3830
3855
  handleConnectedRoomsUpdatedRaw({ payload }: SocketServicePayload): {
3831
3856
  id: string;
3832
3857
  title: string;
3858
+ error: ServiceError;
3833
3859
  }[];
3834
3860
  handleConnectedRoomsDeletedRaw({ payload }: SocketServicePayload): {
3835
3861
  id: string;
@@ -3841,8 +3867,13 @@ declare class ConnectedMeetingsSocketHandler {
3841
3867
  createConnectedRooms(request: CreateRoomRequestPayload[]): Promise<{
3842
3868
  id: string;
3843
3869
  title: string;
3870
+ error: ServiceError;
3871
+ }[]>;
3872
+ updateConnectedRooms(request: UpdateRoomRequestPayload[]): Promise<{
3873
+ id: string;
3874
+ title: string;
3875
+ error: ServiceError;
3844
3876
  }[]>;
3845
- updateConnectedRooms(request: UpdateRoomRequestPayload[]): Promise<void>;
3846
3877
  disableConnectedRooms(meetingIds: string[]): Promise<{
3847
3878
  id: string;
3848
3879
  }[]>;
@@ -4053,7 +4084,8 @@ declare const ERROR_CODES: {
4053
4084
  };
4054
4085
  declare class ClientError extends Error {
4055
4086
  code: keyof typeof ERROR_CODES;
4056
- constructor(message: string, code?: keyof typeof ERROR_CODES, logger?: Logger | undefined, log?: boolean);
4087
+ reason?: string;
4088
+ constructor(message: string, code?: keyof typeof ERROR_CODES, logger?: Logger | undefined, log?: boolean, reason?: string | undefined);
4057
4089
  }
4058
4090
  type EventMap = {
4059
4091
  [key: string]: (...args: any[]) => void;
package/package.json CHANGED
@@ -1,7 +1,11 @@
1
1
  {
2
2
  "name": "@cloudflare/realtimekit",
3
- "version": "2.0.5-staging.1",
3
+ "version": "2.1.0-staging.1",
4
4
  "description": "A real-time video and audio SDK for building custom, collaborative communication experiences.",
5
+ "license": "Apache-2.0",
6
+ "files": [
7
+ "dist"
8
+ ],
5
9
  "main": "./dist/index.cjs.js",
6
10
  "module": "./dist/index.es.js",
7
11
  "exports": {
package/AGENTS.md DELETED
@@ -1,63 +0,0 @@
1
- # CORE PACKAGE KNOWLEDGE BASE
2
-
3
- ## OVERVIEW
4
- `@cloudflare/realtimekit` — the WebRTC SDK engine; single default export `RealtimeKitClient`.
5
-
6
- ## STRUCTURE
7
- ```
8
- core/
9
- ├── .config/ # 6 Vite build configs + build-types.sh + prepublish.js
10
- ├── src/ # All source (controllers, media, roomNode, socketService, e2ee, mock, …)
11
- ├── docs/ # Node-based API reference generator (jsdoc-to-markdown)
12
- ├── samples/ # Standalone transformer examples (audio/video middleware demos)
13
- ├── __mocks__/ # Vitest manual mocks: window globals + sockrates-client
14
- └── dist/ # Build output (not committed; generated by build scripts)
15
- ```
16
-
17
- ## BUILD TARGETS
18
-
19
- | Vite config | Output file(s) | Format | Purpose |
20
- |-------------|---------------|--------|---------|
21
- | `vite.config.ts` | `dist/index.es.js`, `dist/index.cjs.js` | ESM + CJS | Main tree-shakeable + CommonJS builds |
22
- | `vite.iife.config.ts` | `dist/browser.js` | IIFE | Self-contained browser bundle; bundle diff tracked in CI |
23
- | `vite.rn.config.ts` | `dist/index.rn.js` | CJS | React Native / Metro-compatible build |
24
- | `vite.es5.config.ts` | `dist/index.es5.js` | ESM+Babel | Babel-transpiled ES5-compatible output via `@babel/preset-env` |
25
- | `vite.e2ee.es.ts` | `dist/EncryptionManager.{es,cjs}.js` | ESM + CJS | E2EE sub-module (`./e2ee` export path) |
26
- | `vite.mock.es.ts` | `dist/ClientMock.{es,cjs}.js` | ESM + CJS | Mock client for testing (`./mock` export path); polyfills `events`+`buffer` |
27
- | `build-types.sh` (tsup) | `dist/index.d.ts`, `dist/EncryptionManager.d.ts`, `dist/ClientMock.d.ts` | `.d.ts` | Type declarations via tsup `--dts-only`; strips `#private;` lines |
28
-
29
- **Build order inside `core`:** All 6 Vite targets run in parallel via `concurrently`, then `build:types` runs, then `downlevel-dts`.
30
-
31
- ## EXPORT PATHS
32
-
33
- | Export path | File | Consumers |
34
- |-------------|------|-----------|
35
- | `.` | `dist/index.es.js` / `dist/index.cjs.js` | Standard ESM/CJS imports |
36
- | `./inlined` | `dist/browser.js` | Script-tag / CDN — all deps bundled in |
37
- | `./compatible` | `dist/index.es5.js` | Legacy bundlers requiring ES5 |
38
- | `./e2ee` | `dist/EncryptionManager.{es,cjs}.js` | Apps opting into E2EE encryption |
39
- | `./mock` | `dist/ClientMock.{es,cjs}.js` | Test environments (no real WebRTC) |
40
-
41
- TypeScript `<4.0` consumers are redirected to `dist/ts3.4/` via `typesVersions`.
42
-
43
- ## WHERE TO LOOK
44
-
45
- | Task | Location |
46
- |------|----------|
47
- | Type declaration generation | `.config/build-types.sh` — temporarily removes `@cloudflare/realtimekit-proto-entities` before tsup so its types are bundled, then strips `#private;` lines from `.d.ts` |
48
- | Pre-publish package.json rewrite | `.config/prepublish.js` — removes private deps, injects `VERSION_PLACEHOLDER` into 4 dist files, sets npm tag from `ENVIRONMENT` env var |
49
- | Post-publish restore | `package.json` backed up to `package.json.bak` before publish; restored via `postpublish` script |
50
- | TS 3.4 compat types | `dist/ts3.4/` produced by `downlevel-dts dist dist/ts3.4/dist` after type build |
51
- | Bundle analyzer | `stats.html` generated by `rollup-plugin-visualizer` when `VITE_ANALYZE=1` |
52
- | Transformer samples | `samples/transformers/` — audio (low-pass, pitch, noise) + video middleware examples |
53
- | API reference generator | `docs/api-reference-generator.js` — run via `npm run docs`; outputs Markdown from JSDoc |
54
-
55
- ## NOTES
56
-
57
- - `dist/browser.js` is the IIFE bundle — CI tracks its size diff on every PR; do not add large dependencies to the main entry without expecting a size alert.
58
- - `react-native` field in `package.json` (`./dist/index.rn.js`) is read by Metro bundler and points to the CJS React Native build.
59
- - `build-types.sh` temporarily removes `@cloudflare/realtimekit-proto-entities` from `package.json` so tsup bundles its types into the output `.d.ts`; `package.json` is restored via `trap restore EXIT`.
60
- - `prepublish.js` strips `lodash-es`, `axios`, and `@cloudflare/realtimekit-*` dependencies before publishing because they are inlined in the dist; matching packages and public type dependencies are retained as development-only type dependencies.
61
- - `envPrefix: 'RTK_'` — only `RTK_*` env vars are exposed to Vite builds; use `RTK_` prefix for any new build-time flags.
62
- - `vite.mock.es.ts` adds Node polyfills (`events`, `buffer`) because `ClientMock` runs in Node test environments.
63
- - `vitest-github-coverage-provider.mts` — custom coverage reporter that emits GitHub-compatible annotations; only active in CI.
File without changes