@rimori/client 2.5.40-next.1 → 2.5.40-next.2

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.
@@ -35,7 +35,7 @@ export class RimoriClient {
35
35
  });
36
36
  this.event = new EventModule(info.pluginId, this.ai, this.eventBus);
37
37
  this.db = new DbModule(supabase, controller, info);
38
- this.plugin = new PluginModule(supabase, controller, info, this.ai);
38
+ this.plugin = new PluginModule(supabase, controller, info, this.ai, this.eventBus);
39
39
  this.exercise = new ExerciseModule(supabase, controller, info, this.event);
40
40
  this.storage = new StorageModule(controller);
41
41
  this.assets = new AssetsModule(controller);
@@ -3,6 +3,7 @@ import { SupabaseClient } from '../CommunicationHandler';
3
3
  import { LanguageLevel } from '../../utils/difficultyConverter';
4
4
  import { Translator } from '../../controller/TranslationController';
5
5
  import { ActivePlugin, Plugin } from '../../fromRimori/PluginTypes';
6
+ import { EventBusHandler } from '../../fromRimori/EventBus';
6
7
  import { RimoriCommunicationHandler, RimoriInfo } from '../CommunicationHandler';
7
8
  export type Theme = 'light' | 'dark' | 'system';
8
9
  export type ApplicationMode = 'main' | 'sidebar' | 'settings';
@@ -16,6 +17,7 @@ export declare class PluginModule {
16
17
  private translator;
17
18
  private supabase;
18
19
  private communicationHandler;
20
+ private eventBus;
19
21
  /**
20
22
  * The release channel of this plugin installation.
21
23
  * Determines which database schema is used for plugin tables.
@@ -28,7 +30,7 @@ export declare class PluginModule {
28
30
  * Updated automatically when the user toggles TTS.
29
31
  */
30
32
  ttsEnabled: boolean;
31
- constructor(supabase: SupabaseClient, communicationHandler: RimoriCommunicationHandler, info: RimoriInfo, ai: AIModule);
33
+ constructor(supabase: SupabaseClient, communicationHandler: RimoriCommunicationHandler, info: RimoriInfo, ai: AIModule, eventBus: EventBusHandler);
32
34
  /**
33
35
  * Fetches settings based on guild configuration.
34
36
  * If guild doesn't allow user settings, fetches guild-level settings.
@@ -1,5 +1,4 @@
1
1
  import { Translator } from '../../controller/TranslationController';
2
- import { EventBus } from '../../fromRimori/EventBus';
3
2
  /**
4
3
  * Controller for plugin-related operations.
5
4
  * Provides access to plugin settings, user info, and plugin information.
@@ -10,6 +9,7 @@ export class PluginModule {
10
9
  translator;
11
10
  supabase;
12
11
  communicationHandler;
12
+ eventBus;
13
13
  /**
14
14
  * The release channel of this plugin installation.
15
15
  * Determines which database schema is used for plugin tables.
@@ -22,12 +22,13 @@ export class PluginModule {
22
22
  * Updated automatically when the user toggles TTS.
23
23
  */
24
24
  ttsEnabled = true;
25
- constructor(supabase, communicationHandler, info, ai) {
25
+ constructor(supabase, communicationHandler, info, ai, eventBus) {
26
26
  this.rimoriInfo = info;
27
27
  this.supabase = supabase;
28
28
  this.pluginId = info.pluginId;
29
29
  this.releaseChannel = info.releaseChannel;
30
30
  this.communicationHandler = communicationHandler;
31
+ this.eventBus = eventBus;
31
32
  const currentPlugin = info.installedPlugins.find((plugin) => plugin.id === info.pluginId);
32
33
  this.translator = new Translator(info.interfaceLanguage, currentPlugin?.endpoint || '', ai);
33
34
  this.ttsEnabled = info.ttsEnabled ?? true;
@@ -195,7 +196,7 @@ export class PluginModule {
195
196
  * whose tier is below `requiredTier`.
196
197
  */
197
198
  requestUpgrade(requiredTier) {
198
- EventBus.emit(this.pluginId, 'global.subscription.triggerUpgrade', { requiredTier });
199
+ this.eventBus.emit(this.pluginId, 'global.subscription.triggerUpgrade', { requiredTier });
199
200
  }
200
201
  }
201
202
  /** Ordered tiers from lowest to highest access level */
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rimori/client",
3
- "version": "2.5.40-next.1",
3
+ "version": "2.5.40-next.2",
4
4
  "main": "dist/index.js",
5
5
  "types": "dist/index.d.ts",
6
6
  "repository": {