@webex/plugin-meetings 3.12.0-auth-prejoin-fetch.1 → 3.12.0-llmrefactor.10

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.
Files changed (63) hide show
  1. package/dist/aiEnableRequest/index.js +1 -1
  2. package/dist/annotation/index.js +53 -17
  3. package/dist/annotation/index.js.map +1 -1
  4. package/dist/breakouts/breakout.js +1 -1
  5. package/dist/breakouts/index.js +35 -9
  6. package/dist/breakouts/index.js.map +1 -1
  7. package/dist/hashTree/hashTreeParser.js +101 -48
  8. package/dist/hashTree/hashTreeParser.js.map +1 -1
  9. package/dist/interceptors/dataChannelAuthToken.js +41 -59
  10. package/dist/interceptors/dataChannelAuthToken.js.map +1 -1
  11. package/dist/interpretation/index.js +1 -1
  12. package/dist/interpretation/siLanguage.js +1 -1
  13. package/dist/locus-info/index.js +27 -2
  14. package/dist/locus-info/index.js.map +1 -1
  15. package/dist/locus-info/types.js +2 -1
  16. package/dist/locus-info/types.js.map +1 -1
  17. package/dist/meeting/index.js +913 -921
  18. package/dist/meeting/index.js.map +1 -1
  19. package/dist/meeting/util.js +5 -1
  20. package/dist/meeting/util.js.map +1 -1
  21. package/dist/meeting/voicea-meeting.js +2 -1
  22. package/dist/meeting/voicea-meeting.js.map +1 -1
  23. package/dist/meeting-info/meeting-info-v2.js +36 -92
  24. package/dist/meeting-info/meeting-info-v2.js.map +1 -1
  25. package/dist/meetings/index.js +33 -93
  26. package/dist/meetings/index.js.map +1 -1
  27. package/dist/meetings/meetings.types.js.map +1 -1
  28. package/dist/types/annotation/index.d.ts +19 -0
  29. package/dist/types/hashTree/hashTreeParser.d.ts +12 -0
  30. package/dist/types/locus-info/index.d.ts +6 -0
  31. package/dist/types/locus-info/types.d.ts +1 -0
  32. package/dist/types/meeting/index.d.ts +47 -20
  33. package/dist/types/meeting/util.d.ts +3 -1
  34. package/dist/types/meeting-info/meeting-info-v2.d.ts +1 -24
  35. package/dist/types/meetings/index.d.ts +2 -13
  36. package/dist/types/meetings/meetings.types.d.ts +1 -15
  37. package/dist/webinar/index.js +298 -255
  38. package/dist/webinar/index.js.map +1 -1
  39. package/package.json +21 -21
  40. package/src/annotation/index.ts +55 -25
  41. package/src/breakouts/index.ts +33 -11
  42. package/src/hashTree/hashTreeParser.ts +67 -3
  43. package/src/interceptors/dataChannelAuthToken.ts +48 -77
  44. package/src/locus-info/index.ts +20 -0
  45. package/src/locus-info/types.ts +1 -0
  46. package/src/meeting/index.ts +318 -332
  47. package/src/meeting/util.ts +2 -2
  48. package/src/meeting/voicea-meeting.ts +1 -1
  49. package/src/meeting-info/meeting-info-v2.ts +18 -74
  50. package/src/meetings/index.ts +6 -70
  51. package/src/meetings/meetings.types.ts +1 -17
  52. package/src/webinar/index.ts +168 -188
  53. package/test/unit/spec/annotation/index.ts +214 -182
  54. package/test/unit/spec/breakouts/index.ts +126 -25
  55. package/test/unit/spec/hashTree/hashTreeParser.ts +212 -1
  56. package/test/unit/spec/interceptors/dataChannelAuthToken.ts +81 -99
  57. package/test/unit/spec/locus-info/index.js +79 -0
  58. package/test/unit/spec/meeting/index.js +979 -701
  59. package/test/unit/spec/meeting/utils.js +16 -2
  60. package/test/unit/spec/meeting/voicea-meeting.ts +85 -1
  61. package/test/unit/spec/meeting-info/meetinginfov2.js +0 -210
  62. package/test/unit/spec/meetings/index.js +5 -231
  63. package/test/unit/spec/webinar/index.ts +886 -718
@@ -195,6 +195,38 @@ describe('plugin-meetings', () => {
195
195
  );
196
196
  });
197
197
 
198
+ it('passes an isLlmExpected callback that is true when current device is joined', async () => {
199
+ locusInfo.parsedLocus.self = {
200
+ state: 'LEFT',
201
+ joinedWith: {state: 'JOINED'},
202
+ };
203
+
204
+ await locusInfo.initialSetup({
205
+ trigger: 'locus-message',
206
+ hashTreeMessage: createHashTreeMessage(['dataset1']),
207
+ });
208
+
209
+ const {isLlmExpected} = HashTreeParserStub.firstCall.args[0].callbacks;
210
+
211
+ assert.equal(isLlmExpected(), true);
212
+ });
213
+
214
+ it('passes an isLlmExpected callback that is false when self is joined but current device is not joined', async () => {
215
+ locusInfo.parsedLocus.self = {
216
+ state: 'JOINED',
217
+ joinedWith: {state: 'LEFT'},
218
+ };
219
+
220
+ await locusInfo.initialSetup({
221
+ trigger: 'locus-message',
222
+ hashTreeMessage: createHashTreeMessage(['dataset1']),
223
+ });
224
+
225
+ const {isLlmExpected} = HashTreeParserStub.firstCall.args[0].callbacks;
226
+
227
+ assert.equal(isLlmExpected(), false);
228
+ });
229
+
198
230
  it('should not initialize the hash tree when triggered from a non-hash tree locus message', async () => {
199
231
  const locus = {url: 'http://locus-url.com', participants: []};
200
232
 
@@ -2023,6 +2055,53 @@ describe('plugin-meetings', () => {
2023
2055
  });
2024
2056
 
2025
2057
  describe('#updateSelf', () => {
2058
+ describe('LLM watchdog re-evaluation', () => {
2059
+ it('re-evaluates LLM watchdogs on all hash tree parsers when self transitions to joined', () => {
2060
+ const parserA = {reevaluateLlmWatchdogs: sinon.stub()};
2061
+ const parserB = {reevaluateLlmWatchdogs: sinon.stub()};
2062
+ locusInfo.hashTreeParsers.set('urlA', {parser: parserA});
2063
+ locusInfo.hashTreeParsers.set('urlB', {parser: parserB});
2064
+
2065
+ // start with LLM not expected (no self yet)
2066
+ locusInfo.parsedLocus.self = undefined;
2067
+ locusInfo.webex.internal.device.url = self.deviceUrl;
2068
+
2069
+ // the self fixture's joined device has state JOINED -> isLlmExpected becomes true
2070
+ locusInfo.updateSelf(cloneDeep(self));
2071
+
2072
+ assert.calledOnceWithExactly(parserA.reevaluateLlmWatchdogs);
2073
+ assert.calledOnceWithExactly(parserB.reevaluateLlmWatchdogs);
2074
+ });
2075
+
2076
+ it('does not re-evaluate LLM watchdogs when LLM was already expected before the update', () => {
2077
+ const parser = {reevaluateLlmWatchdogs: sinon.stub()};
2078
+ locusInfo.hashTreeParsers.set('urlA', {parser});
2079
+ locusInfo.webex.internal.device.url = self.deviceUrl;
2080
+
2081
+ // first update establishes the JOINED state (LLM already expected)
2082
+ locusInfo.updateSelf(cloneDeep(self));
2083
+ parser.reevaluateLlmWatchdogs.resetHistory();
2084
+
2085
+ // second update while already joined must not re-trigger re-evaluation
2086
+ locusInfo.updateSelf(cloneDeep(self));
2087
+
2088
+ assert.notCalled(parser.reevaluateLlmWatchdogs);
2089
+ });
2090
+
2091
+ it('does not re-evaluate LLM watchdogs when the self update does not make LLM expected', () => {
2092
+ const parser = {reevaluateLlmWatchdogs: sinon.stub()};
2093
+ locusInfo.hashTreeParsers.set('urlA', {parser});
2094
+
2095
+ locusInfo.parsedLocus.self = undefined;
2096
+ // device url does not match any of self's devices -> joinedWith is undefined -> not expected
2097
+ locusInfo.webex.internal.device.url = 'https://some-other-device-url.com';
2098
+
2099
+ locusInfo.updateSelf(cloneDeep(self));
2100
+
2101
+ assert.notCalled(parser.reevaluateLlmWatchdogs);
2102
+ });
2103
+ });
2104
+
2026
2105
  it('should trigger SELF_MEETING_BRB_CHANGED when brb state changed', () => {
2027
2106
  locusInfo.self = undefined;
2028
2107