@open-orpheus/plugin-api 0.0.0-stage → 0.21.0
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/LICENSE +7 -0
- package/README.md +191 -2
- package/dist/client/index.d.ts +37 -0
- package/dist/client/index.js +53 -0
- package/dist/client/index.js.map +1 -0
- package/dist/configuration/host/src/shared/plugin/configuration/index.d.ts +21 -0
- package/dist/configuration/index.d.ts +5 -0
- package/dist/host/_native/open-orpheus__database.d.ts +50 -0
- package/dist/host/_native/open-orpheus__window.d.ts +284 -0
- package/dist/host/src/constants.d.ts +6 -0
- package/dist/host/src/main/afp.d.ts +1 -0
- package/dist/host/src/main/arguments.d.ts +4 -0
- package/dist/host/src/main/assets.d.ts +2 -0
- package/dist/host/src/main/audio/ChunkTracker.d.ts +23 -0
- package/dist/host/src/main/audio/DownloadScheduler.d.ts +53 -0
- package/dist/host/src/main/audio/MediaEngine.d.ts +47 -0
- package/dist/host/src/main/audio/OnlineStreamer.d.ts +66 -0
- package/dist/host/src/main/audio/StorageManager.d.ts +18 -0
- package/dist/host/src/main/audio.d.ts +6 -0
- package/dist/host/src/main/av3a/Av3aEngine.d.ts +24 -0
- package/dist/host/src/main/av3a/Av3aM4aSession.d.ts +101 -0
- package/dist/host/src/main/av3a/Av3aPlaybackProcess.d.ts +52 -0
- package/dist/host/src/main/av3a/detect.d.ts +6 -0
- package/dist/host/src/main/av3a/sources.d.ts +13 -0
- package/dist/host/src/main/av3a/types.d.ts +54 -0
- package/dist/host/src/main/bridge/ipc-main-bridge.d.ts +24 -0
- package/dist/host/src/main/bridge/modules/inputRegion.d.ts +1 -0
- package/dist/host/src/main/bridge/modules/lyrics.d.ts +1 -0
- package/dist/host/src/main/bridge/modules/settings.d.ts +1 -0
- package/dist/host/src/main/bridge/register.d.ts +9 -0
- package/dist/host/src/main/bridge/window.d.ts +7 -0
- package/dist/host/src/main/cache/HttpCacheStorage.d.ts +10 -0
- package/dist/host/src/main/cache/LyricCahceManager.d.ts +21 -0
- package/dist/host/src/main/cache/PlayCacheManager.d.ts +72 -0
- package/dist/host/src/main/cache.d.ts +7 -0
- package/dist/host/src/main/calls/app.d.ts +1 -0
- package/dist/host/src/main/calls/audioeffect.d.ts +1 -0
- package/dist/host/src/main/calls/browser.d.ts +1 -0
- package/dist/host/src/main/calls/desktop.d.ts +2 -0
- package/dist/host/src/main/calls/desktoppet.d.ts +1 -0
- package/dist/host/src/main/calls/download.d.ts +1 -0
- package/dist/host/src/main/calls/index.d.ts +16 -0
- package/dist/host/src/main/calls/musiclibrary.d.ts +1 -0
- package/dist/host/src/main/calls/network.d.ts +1 -0
- package/dist/host/src/main/calls/os.d.ts +1 -0
- package/dist/host/src/main/calls/player.d.ts +22 -0
- package/dist/host/src/main/calls/process.d.ts +1 -0
- package/dist/host/src/main/calls/rtc.d.ts +1 -0
- package/dist/host/src/main/calls/storage.d.ts +1 -0
- package/dist/host/src/main/calls/trayicon.d.ts +1 -0
- package/dist/host/src/main/calls/update.d.ts +1 -0
- package/dist/host/src/main/calls/winhelper.d.ts +1 -0
- package/dist/host/src/main/calls.d.ts +5 -0
- package/dist/host/src/main/channel.d.ts +1 -0
- package/dist/host/src/main/cookie.d.ts +13 -0
- package/dist/host/src/main/crypto.d.ts +46 -0
- package/dist/host/src/main/database/KeyvSqliteDriver.d.ts +6 -0
- package/dist/host/src/main/database.d.ts +5 -0
- package/dist/host/src/main/dawn.d.ts +31 -0
- package/dist/host/src/main/device.d.ts +3 -0
- package/dist/host/src/main/download.d.ts +40 -0
- package/dist/host/src/main/error.d.ts +1 -0
- package/dist/host/src/main/folders.d.ts +18 -0
- package/dist/host/src/main/fonts.d.ts +1 -0
- package/dist/host/src/main/gui.d.ts +4 -0
- package/dist/host/src/main/id3.d.ts +42 -0
- package/dist/host/src/main/lifecycle.d.ts +127 -0
- package/dist/host/src/main/logger.d.ts +12 -0
- package/dist/host/src/main/lyrics/DbusLyricsService.d.ts +115 -0
- package/dist/host/src/main/lyrics/LyricsDispatcher.d.ts +26 -0
- package/dist/host/src/main/lyrics/dbus.d.ts +16 -0
- package/dist/host/src/main/lyrics/parse.d.ts +21 -0
- package/dist/host/src/main/lyrics.d.ts +2 -0
- package/dist/host/src/main/mediaSession.d.ts +42 -0
- package/dist/host/src/main/menu/AppMenu.d.ts +35 -0
- package/dist/host/src/main/menu/anchor.d.ts +13 -0
- package/dist/host/src/main/menu/backend/DesktopWindowBackend.d.ts +30 -0
- package/dist/host/src/main/menu/backend/MenuBackend.d.ts +28 -0
- package/dist/host/src/main/menu/backend/WaylandLayerShellBackend.d.ts +35 -0
- package/dist/host/src/main/menu/backend/WaylandOverlayBackend.d.ts +15 -0
- package/dist/host/src/main/menu/backend/WaylandPopupBackend.d.ts +31 -0
- package/dist/host/src/main/menu/constants.d.ts +14 -0
- package/dist/host/src/main/menu/index.d.ts +2 -0
- package/dist/host/src/main/menu/native-popup.d.ts +16 -0
- package/dist/host/src/main/menu/patch.d.ts +3 -0
- package/dist/host/src/main/menu/skin.d.ts +3 -0
- package/dist/host/src/main/menu/surface/BaseWindowMenuSurface.d.ts +81 -0
- package/dist/host/src/main/menu/surface/CaptureLayerSurface.d.ts +22 -0
- package/dist/host/src/main/menu/surface/MenuSurface.d.ts +29 -0
- package/dist/host/src/main/menu/surface/MenuSurfacePath.d.ts +29 -0
- package/dist/host/src/main/menu/surface/SurfacePool.d.ts +15 -0
- package/dist/host/src/main/menu/workaround.d.ts +12 -0
- package/dist/host/src/main/ncae.d.ts +8 -0
- package/dist/host/src/main/network/handler.d.ts +3 -0
- package/dist/host/src/main/network/interceptor.d.ts +2 -0
- package/dist/host/src/main/network/interceptors/anonymous.d.ts +2 -0
- package/dist/host/src/main/network/pipeline.d.ts +8 -0
- package/dist/host/src/main/network/types.d.ts +70 -0
- package/dist/host/src/main/orpheus.d.ts +10 -0
- package/dist/host/src/main/pack.d.ts +27 -0
- package/dist/host/src/main/packs/Pack.d.ts +12 -0
- package/dist/host/src/main/packs/SkinPack.d.ts +6 -0
- package/dist/host/src/main/packs/WebPack.d.ts +6 -0
- package/dist/host/src/main/playback/PlaybackController.d.ts +57 -0
- package/dist/host/src/main/playback/PlayerCommandRouter.d.ts +85 -0
- package/dist/host/src/main/playback/adapters/MediaSessionAdapter.d.ts +61 -0
- package/dist/host/src/main/playback/adapters/MprisAdapter.d.ts +48 -0
- package/dist/host/src/main/playback/adapters/NowPlayingAdapter.d.ts +23 -0
- package/dist/host/src/main/playback/adapters/SmtcAdapter.d.ts +23 -0
- package/dist/host/src/main/playback/artwork.d.ts +47 -0
- package/dist/host/src/main/playback/modes.d.ts +8 -0
- package/dist/host/src/main/playback/types.d.ts +59 -0
- package/dist/host/src/main/plugin/assets.d.ts +8 -0
- package/dist/host/src/main/plugin/catalog.d.ts +42 -0
- package/dist/host/src/main/plugin/discover.d.ts +33 -0
- package/dist/host/src/main/plugin/index.d.ts +15 -0
- package/dist/host/src/main/plugin/loader.d.ts +90 -0
- package/dist/host/src/main/plugin/manager.d.ts +61 -0
- package/dist/host/src/main/plugin/metadata.d.ts +34 -0
- package/dist/host/src/main/plugin/state.d.ts +27 -0
- package/dist/host/src/main/plugin/tree.d.ts +13 -0
- package/dist/host/src/main/protocol.d.ts +4 -0
- package/dist/host/src/main/request.d.ts +16 -0
- package/dist/host/src/main/settings.d.ts +21 -0
- package/dist/host/src/main/shortcuts.d.ts +10 -0
- package/dist/host/src/main/shutdown.d.ts +50 -0
- package/dist/host/src/main/skin/color.d.ts +2 -0
- package/dist/host/src/main/skin/dui.d.ts +15 -0
- package/dist/host/src/main/tray.d.ts +8 -0
- package/dist/host/src/main/update.d.ts +2 -0
- package/dist/host/src/main/util/color.d.ts +7 -0
- package/dist/host/src/main/util/display.d.ts +3 -0
- package/dist/host/src/main/util/env.d.ts +1 -0
- package/dist/host/src/main/util/fs.d.ts +21 -0
- package/dist/host/src/main/util/image.d.ts +1 -0
- package/dist/host/src/main/util/musicFile.d.ts +1 -0
- package/dist/host/src/main/util/musicPicture.d.ts +2 -0
- package/dist/host/src/main/util/path.d.ts +2 -0
- package/dist/host/src/main/util/send.d.ts +13 -0
- package/dist/host/src/main/util/url.d.ts +19 -0
- package/dist/host/src/main/util/window.d.ts +2 -0
- package/dist/host/src/main/window.d.ts +316 -0
- package/dist/host/src/main/windows/color-picker.d.ts +3 -0
- package/dist/host/src/main/windows/desktop-lyrics.d.ts +12 -0
- package/dist/host/src/main/windows/desktop-pet.d.ts +8 -0
- package/dist/host/src/main/windows/main.d.ts +6 -0
- package/dist/host/src/main/windows/manage.d.ts +2 -0
- package/dist/host/src/main/windows/mini-player.d.ts +16 -0
- package/dist/host/src/main/windows/music-desktop.d.ts +13 -0
- package/dist/host/src/main/windows/package-download.d.ts +2 -0
- package/dist/host/src/main/windows/plugin-manager-events.d.ts +7 -0
- package/dist/host/src/main/windows/plugin-manager.d.ts +5 -0
- package/dist/host/src/main/xeapi.d.ts +48 -0
- package/dist/host/src/preload/AudioEffectManager.d.ts +124 -0
- package/dist/host/src/preload/PlaybackBackend.d.ts +34 -0
- package/dist/host/src/preload/Player.d.ts +229 -0
- package/dist/host/src/preload/av3a/Av3aPcmPlayer.d.ts +84 -0
- package/dist/host/src/preload/av3a/bridge.d.ts +21 -0
- package/dist/host/src/preload/av3a/channel.d.ts +40 -0
- package/dist/host/src/preload/av3a/detect.d.ts +6 -0
- package/dist/host/src/preload/backends/Av3aPlaybackBackend.d.ts +32 -0
- package/dist/host/src/preload/backends/MediaPlaybackBackend.d.ts +25 -0
- package/dist/host/src/shared/CallDispatcher.d.ts +12 -0
- package/dist/host/src/shared/bridge/constants.d.ts +2 -0
- package/dist/host/src/shared/bridge/endpoint.d.ts +29 -0
- package/dist/host/src/shared/bridge/hub.d.ts +136 -0
- package/dist/host/src/shared/bridge/protocol.d.ts +91 -0
- package/dist/host/src/shared/bridge/realm.d.ts +14 -0
- package/dist/host/src/shared/bridge/routes.d.ts +37 -0
- package/dist/host/src/shared/contracts/av3a-api.d.ts +50 -0
- package/dist/host/src/shared/contracts/av3a-process.d.ts +56 -0
- package/dist/host/src/shared/contracts/color-picker-api.d.ts +17 -0
- package/dist/host/src/shared/contracts/desktop-lyrics-api.d.ts +22 -0
- package/dist/host/src/shared/contracts/input-region-api.d.ts +5 -0
- package/dist/host/src/shared/contracts/lyrics-api.d.ts +11 -0
- package/dist/host/src/shared/contracts/manage-api.d.ts +31 -0
- package/dist/host/src/shared/contracts/menu-surface-api.d.ts +35 -0
- package/dist/host/src/shared/contracts/mini-player-api.d.ts +19 -0
- package/dist/host/src/shared/contracts/plugin-manager-api.d.ts +223 -0
- package/dist/host/src/shared/contracts/settings-api.d.ts +15 -0
- package/dist/host/src/shared/playbackMode.d.ts +2 -0
- package/dist/host/src/shared/plugin/cache-bust.d.ts +8 -0
- package/dist/host/src/shared/plugin/lifecycle.d.ts +217 -0
- package/dist/host/src/shared/plugin/realms/main/index.d.ts +18 -0
- package/dist/host/src/shared/plugin/registry.d.ts +69 -0
- package/dist/host/src/shared/plugin/runtime-state.d.ts +4 -0
- package/dist/host/src/shared/settings/defaults.d.ts +35 -0
- package/dist/host/src/shared/settings/index.d.ts +3 -0
- package/dist/host/src/shared/settings/keys.d.ts +21 -0
- package/dist/host/src/shared/settings/values.d.ts +13 -0
- package/dist/host/src/shared/types/desktop-lyrics.d.ts +61 -0
- package/dist/host/src/shared/types/dui.d.ts +37 -0
- package/dist/host/src/shared/types/input-region.d.ts +6 -0
- package/dist/host/src/shared/types/lyrics.d.ts +15 -0
- package/dist/host/src/shared/types/manage.d.ts +14 -0
- package/dist/host/src/shared/types/menu-surface.d.ts +43 -0
- package/dist/host/src/shared/types/menu.d.ts +29 -0
- package/dist/host/src/shared/types/mini-player.d.ts +97 -0
- package/dist/host/src/shared/types/ncae.d.ts +29 -0
- package/dist/host/src/shared/types/package-download.d.ts +14 -0
- package/dist/host/src/shared/types/playback-mode.d.ts +3 -0
- package/dist/host/src/shared/types/settings.d.ts +9 -0
- package/dist/host/src/shared/types/update.d.ts +6 -0
- package/dist/host/src/shared/util.d.ts +22 -0
- package/dist/index.d.ts +7 -0
- package/dist/plugin-manager/host/src/preload/logger.d.ts +10 -0
- package/dist/plugin-manager/host/src/preload/util.d.ts +1 -0
- package/dist/plugin-manager/host/src/shared/bridge/constants.d.ts +2 -0
- package/dist/plugin-manager/host/src/shared/bridge/endpoint.d.ts +29 -0
- package/dist/plugin-manager/host/src/shared/bridge/hub.d.ts +136 -0
- package/dist/plugin-manager/host/src/shared/bridge/protocol.d.ts +91 -0
- package/dist/plugin-manager/host/src/shared/bridge/routes.d.ts +37 -0
- package/dist/plugin-manager/host/src/shared/contracts/plugin-manager-api.d.ts +223 -0
- package/dist/plugin-manager/host/src/shared/plugin/lifecycle.d.ts +217 -0
- package/dist/plugin-manager/host/src/shared/plugin/realms/common/index.d.ts +34 -0
- package/dist/plugin-manager/host/src/shared/plugin/realms/plugin-manager/index.d.ts +11 -0
- package/dist/plugin-manager/host/src/shared/plugin/registry.d.ts +69 -0
- package/dist/plugin-manager/host/src/shared/util.d.ts +22 -0
- package/dist/plugin-manager/index.d.ts +7 -0
- package/dist/plugin-manager/registry-map.d.ts +16 -0
- package/dist/preload/host/src/constants.d.ts +6 -0
- package/dist/preload/host/src/main/network/types.d.ts +70 -0
- package/dist/preload/host/src/preload/AudioEffectManager.d.ts +124 -0
- package/dist/preload/host/src/preload/MusicRecognizer.d.ts +25 -0
- package/dist/preload/host/src/preload/PlaybackBackend.d.ts +34 -0
- package/dist/preload/host/src/preload/Player.d.ts +229 -0
- package/dist/preload/host/src/preload/YunxinIM.d.ts +15 -0
- package/dist/preload/host/src/preload/audioplayer.d.ts +4 -0
- package/dist/preload/host/src/preload/av3a/Av3aPcmPlayer.d.ts +84 -0
- package/dist/preload/host/src/preload/av3a/bridge.d.ts +21 -0
- package/dist/preload/host/src/preload/av3a/channel.d.ts +40 -0
- package/dist/preload/host/src/preload/av3a/detect.d.ts +6 -0
- package/dist/preload/host/src/preload/backends/Av3aPlaybackBackend.d.ts +32 -0
- package/dist/preload/host/src/preload/backends/MediaPlaybackBackend.d.ts +25 -0
- package/dist/preload/host/src/preload/calls/app.d.ts +1 -0
- package/dist/preload/host/src/preload/calls/audioeffect.d.ts +1 -0
- package/dist/preload/host/src/preload/calls/audioplayer.d.ts +1 -0
- package/dist/preload/host/src/preload/calls/im.d.ts +1 -0
- package/dist/preload/host/src/preload/calls/index.d.ts +6 -0
- package/dist/preload/host/src/preload/calls/network.d.ts +1 -0
- package/dist/preload/host/src/preload/calls/nimsys.d.ts +1 -0
- package/dist/preload/host/src/preload/calls/os.d.ts +1 -0
- package/dist/preload/host/src/preload/calls/player.d.ts +1 -0
- package/dist/preload/host/src/preload/calls/update.d.ts +1 -0
- package/dist/preload/host/src/preload/calls.d.ts +4 -0
- package/dist/preload/host/src/preload/channel.d.ts +1 -0
- package/dist/preload/host/src/preload/logger.d.ts +10 -0
- package/dist/preload/host/src/preload/playbackMode.d.ts +13 -0
- package/dist/preload/host/src/preload/util.d.ts +1 -0
- package/dist/preload/host/src/shared/CallDispatcher.d.ts +12 -0
- package/dist/preload/host/src/shared/bridge/endpoint.d.ts +29 -0
- package/dist/preload/host/src/shared/bridge/hub.d.ts +136 -0
- package/dist/preload/host/src/shared/bridge/protocol.d.ts +91 -0
- package/dist/preload/host/src/shared/bridge/routes.d.ts +37 -0
- package/dist/preload/host/src/shared/contracts/av3a-api.d.ts +50 -0
- package/dist/preload/host/src/shared/contracts/av3a-process.d.ts +56 -0
- package/dist/preload/host/src/shared/contracts/plugin-manager-api.d.ts +223 -0
- package/dist/preload/host/src/shared/playbackMode.d.ts +2 -0
- package/dist/preload/host/src/shared/plugin/lifecycle.d.ts +217 -0
- package/dist/preload/host/src/shared/plugin/realms/common/index.d.ts +34 -0
- package/dist/preload/host/src/shared/plugin/realms/preload/index.d.ts +11 -0
- package/dist/preload/host/src/shared/plugin/registry.d.ts +69 -0
- package/dist/preload/host/src/shared/types/ncae.d.ts +29 -0
- package/dist/preload/host/src/shared/types/playback-mode.d.ts +3 -0
- package/dist/preload/host/src/shared/util.d.ts +22 -0
- package/dist/preload/index.d.ts +7 -0
- package/dist/preload/registry-map.d.ts +43 -0
- package/dist/registry-map.d.ts +164 -0
- package/package.json +73 -3
|
@@ -0,0 +1,91 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Wire protocol for the Open Orpheus bridge.
|
|
3
|
+
*
|
|
4
|
+
* A frame is a data-only message that can cross a process boundary
|
|
5
|
+
* (`ipcRenderer`/`ipcMain`), a context boundary (`contextBridge`) or an
|
|
6
|
+
* in-memory test transport. Everything is correlated by numeric ids that are
|
|
7
|
+
* owned by the hop that generated them, so relays never need global ids.
|
|
8
|
+
*/
|
|
9
|
+
export interface SerializedError {
|
|
10
|
+
readonly name: string;
|
|
11
|
+
readonly message: string;
|
|
12
|
+
readonly code?: string;
|
|
13
|
+
readonly data?: unknown;
|
|
14
|
+
}
|
|
15
|
+
export type Result = {
|
|
16
|
+
readonly ok: true;
|
|
17
|
+
readonly value: unknown;
|
|
18
|
+
} | {
|
|
19
|
+
readonly ok: false;
|
|
20
|
+
readonly error: SerializedError;
|
|
21
|
+
};
|
|
22
|
+
export type Frame = {
|
|
23
|
+
readonly t: "req";
|
|
24
|
+
readonly id: number;
|
|
25
|
+
/** Preload document identity; lets the main side reset stale state on reload. */
|
|
26
|
+
readonly session?: string;
|
|
27
|
+
readonly route: string;
|
|
28
|
+
readonly args: unknown[];
|
|
29
|
+
readonly chain: readonly string[];
|
|
30
|
+
} | {
|
|
31
|
+
readonly t: "sub";
|
|
32
|
+
readonly id: number;
|
|
33
|
+
/** Preload document identity; lets the main side reset stale state on reload. */
|
|
34
|
+
readonly session?: string;
|
|
35
|
+
readonly route: string;
|
|
36
|
+
readonly chain: readonly string[];
|
|
37
|
+
} | ({
|
|
38
|
+
readonly t: "res";
|
|
39
|
+
readonly id: number;
|
|
40
|
+
readonly session?: string;
|
|
41
|
+
} & Result) | ({
|
|
42
|
+
readonly t: "sres";
|
|
43
|
+
readonly id: number;
|
|
44
|
+
readonly session?: string;
|
|
45
|
+
} & DistributionResult) | {
|
|
46
|
+
readonly t: "evt";
|
|
47
|
+
readonly id: number;
|
|
48
|
+
readonly session?: string;
|
|
49
|
+
readonly payload: readonly unknown[];
|
|
50
|
+
} | {
|
|
51
|
+
readonly t: "unsub";
|
|
52
|
+
readonly id: number;
|
|
53
|
+
readonly session?: string;
|
|
54
|
+
} | {
|
|
55
|
+
readonly t: "cancel";
|
|
56
|
+
readonly id: number;
|
|
57
|
+
readonly session?: string;
|
|
58
|
+
};
|
|
59
|
+
export type DistributionResult = {
|
|
60
|
+
readonly ok: true;
|
|
61
|
+
} | {
|
|
62
|
+
readonly ok: false;
|
|
63
|
+
readonly error: SerializedError;
|
|
64
|
+
};
|
|
65
|
+
export type RequestFrame = Extract<Frame, {
|
|
66
|
+
t: "req";
|
|
67
|
+
}>;
|
|
68
|
+
export type SubscribeFrame = Extract<Frame, {
|
|
69
|
+
t: "sub";
|
|
70
|
+
}>;
|
|
71
|
+
export type ResponseFrame = Extract<Frame, {
|
|
72
|
+
t: "res";
|
|
73
|
+
}>;
|
|
74
|
+
export type SubscribeResultFrame = Extract<Frame, {
|
|
75
|
+
t: "sres";
|
|
76
|
+
}>;
|
|
77
|
+
export type EventFrame = Extract<Frame, {
|
|
78
|
+
t: "evt";
|
|
79
|
+
}>;
|
|
80
|
+
export declare class BridgeError extends Error {
|
|
81
|
+
readonly code: string;
|
|
82
|
+
readonly data?: unknown;
|
|
83
|
+
constructor(code: string, message: string, options?: {
|
|
84
|
+
data?: unknown;
|
|
85
|
+
cause?: unknown;
|
|
86
|
+
});
|
|
87
|
+
toSerialized(): SerializedError;
|
|
88
|
+
static from(serialized: SerializedError | undefined): BridgeError;
|
|
89
|
+
}
|
|
90
|
+
export declare function serializeError(error: unknown): SerializedError;
|
|
91
|
+
export declare function isBridgeError(error: unknown, code?: string): error is BridgeError;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Optional realm metadata for transports.
|
|
3
|
+
*
|
|
4
|
+
* The hub core is neutral: it only forwards whatever `BridgeInfo.meta` the
|
|
5
|
+
* transport supplies to `authorize` and diagnostics. Electron transports use
|
|
6
|
+
* this shape to describe the peer a port talks to.
|
|
7
|
+
*/
|
|
8
|
+
export type BridgeProcess = "main" | "renderer";
|
|
9
|
+
export type BridgeWorld = "main" | "isolated";
|
|
10
|
+
export interface Realm {
|
|
11
|
+
readonly process: BridgeProcess;
|
|
12
|
+
readonly world: BridgeWorld;
|
|
13
|
+
readonly windowId?: number;
|
|
14
|
+
}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Route pattern compilation for bridge mount ACLs and link rewrites.
|
|
3
|
+
*
|
|
4
|
+
* Patterns are dot-separated segments:
|
|
5
|
+
* - a literal segment matches itself,
|
|
6
|
+
* - `*` matches exactly one non-empty segment,
|
|
7
|
+
* - `**` matches the remainder of the route and is only valid as the last
|
|
8
|
+
* segment.
|
|
9
|
+
*
|
|
10
|
+
* Rewrite targets refer to captures with `$1`, `$2`, ... in source order.
|
|
11
|
+
*/
|
|
12
|
+
export interface RouteMatch {
|
|
13
|
+
/** The pattern that matched. */
|
|
14
|
+
readonly pattern: string;
|
|
15
|
+
/** The route the frame carried when it entered the link. */
|
|
16
|
+
readonly route: string;
|
|
17
|
+
/** The route the frame must carry when it leaves the link. */
|
|
18
|
+
readonly to: string;
|
|
19
|
+
}
|
|
20
|
+
/**
|
|
21
|
+
* Compile one pattern. Throws `InvalidRoutePattern` for empty segments and for
|
|
22
|
+
* a `**` that is not the final segment.
|
|
23
|
+
*/
|
|
24
|
+
export declare function compilePattern(pattern: string): {
|
|
25
|
+
re: RegExp;
|
|
26
|
+
captures: number;
|
|
27
|
+
};
|
|
28
|
+
/**
|
|
29
|
+
* Ordered rewrite table. The first matching rule wins; a route that matches
|
|
30
|
+
* none is not allowed through the link.
|
|
31
|
+
*/
|
|
32
|
+
export declare class RouteTable {
|
|
33
|
+
private readonly rules;
|
|
34
|
+
private constructor();
|
|
35
|
+
static from(routes: Readonly<Record<string, string>>): RouteTable;
|
|
36
|
+
rewrite(route: string): RouteMatch | null;
|
|
37
|
+
}
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
import type { AudioPlayInfo } from "../../preload/Player.js";
|
|
2
|
+
/** Track metadata reported once the AV3A track has been indexed (`moov`). */
|
|
3
|
+
export interface Av3aTrackInfo {
|
|
4
|
+
sampleRate: number;
|
|
5
|
+
channels: number;
|
|
6
|
+
frameCount: number;
|
|
7
|
+
durationSeconds: number;
|
|
8
|
+
mediaStart: number;
|
|
9
|
+
mediaEnd: number;
|
|
10
|
+
}
|
|
11
|
+
/** One decoded PCM16 frame. */
|
|
12
|
+
export interface Av3aPcmEvent {
|
|
13
|
+
/** Interleaved little-endian PCM16 (`channels * 1024` samples). */
|
|
14
|
+
data: ArrayBuffer;
|
|
15
|
+
/** 0-based AV3A frame index within the track. */
|
|
16
|
+
frameIndex: number;
|
|
17
|
+
sampleRate: number;
|
|
18
|
+
channels: number;
|
|
19
|
+
/** Presentation timestamp in milliseconds. */
|
|
20
|
+
pts: number;
|
|
21
|
+
}
|
|
22
|
+
/**
|
|
23
|
+
* Control-plane bridge between the player window and main's AV3A playback
|
|
24
|
+
* manager (which forks the decode utility process).
|
|
25
|
+
*
|
|
26
|
+
* `events.*` are pushed from main via `webContents.send("av3a.<event>", ...)`;
|
|
27
|
+
* the remaining methods are invoked by the player via
|
|
28
|
+
* `ipcRenderer.invoke("av3a.<method>", ...)`.
|
|
29
|
+
*
|
|
30
|
+
* Decode events (`opened`/`pcm`/`done`/`error`), frames, and flow control
|
|
31
|
+
* (`pause`/`resume`/`seek`) are intentionally NOT here: they travel on the
|
|
32
|
+
* direct renderer<->decode-utility channel (see `av3a-process.ts`), keeping
|
|
33
|
+
* the main process off the real-time path. Main's `error` event is kept as a
|
|
34
|
+
* fallback for terminal, main-originated failures (e.g. the decode process
|
|
35
|
+
* crashing).
|
|
36
|
+
*/
|
|
37
|
+
export interface Av3aContract {
|
|
38
|
+
events: {
|
|
39
|
+
error(callback: (message: string) => void): void;
|
|
40
|
+
/** Download progress of the encoded source. */
|
|
41
|
+
progress(callback: (loaded: number, total: number) => void): void;
|
|
42
|
+
};
|
|
43
|
+
/**
|
|
44
|
+
* Start decoding `playInfo` in the AV3A decode utility process.
|
|
45
|
+
* Currently supports URL playback (`type === 4`, `audioFormat === "av3a"`).
|
|
46
|
+
*/
|
|
47
|
+
start(playInfo: AudioPlayInfo): Promise<void>;
|
|
48
|
+
/** Stop decoding: tear down the utility process and the underlying streamer. */
|
|
49
|
+
stop(): Promise<void>;
|
|
50
|
+
}
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
import type { Av3aPcmEvent, Av3aTrackInfo } from "./av3a-api.js";
|
|
2
|
+
/**
|
|
3
|
+
* Messaging between the main process and the AV3A decode utility process
|
|
4
|
+
* (`process.parentPort` <-> `UtilityProcess.postMessage`).
|
|
5
|
+
*/
|
|
6
|
+
/** main -> utility process */
|
|
7
|
+
export type Av3aProcessMainToService = {
|
|
8
|
+
type: "init";
|
|
9
|
+
path: string;
|
|
10
|
+
totalLength: number;
|
|
11
|
+
prefixEnd: number;
|
|
12
|
+
} | {
|
|
13
|
+
type: "frontier";
|
|
14
|
+
prefixEnd: number;
|
|
15
|
+
} | {
|
|
16
|
+
type: "rangeReady";
|
|
17
|
+
id: number;
|
|
18
|
+
prefixEnd: number;
|
|
19
|
+
} | {
|
|
20
|
+
type: "rangeError";
|
|
21
|
+
id: number;
|
|
22
|
+
message: string;
|
|
23
|
+
};
|
|
24
|
+
/** utility process -> main (main only serves byte ranges; nothing else). */
|
|
25
|
+
export type Av3aProcessServiceToMain = {
|
|
26
|
+
type: "ensureRange";
|
|
27
|
+
id: number;
|
|
28
|
+
start: number;
|
|
29
|
+
end: number;
|
|
30
|
+
};
|
|
31
|
+
/**
|
|
32
|
+
* Direct channel (a `MessageChannelMain` end in each process) between the
|
|
33
|
+
* renderer and the AV3A decode utility process. Every decode event — opened,
|
|
34
|
+
* PCM frames, done, errors — plus flow control and seeks travels here, in
|
|
35
|
+
* order, without main on the path. That keeps playback flowing while main is
|
|
36
|
+
* busy (e.g. blocked by a window drag).
|
|
37
|
+
*/
|
|
38
|
+
export type Av3aChannelRendererToService = {
|
|
39
|
+
type: "pause";
|
|
40
|
+
} | {
|
|
41
|
+
type: "resume";
|
|
42
|
+
} | {
|
|
43
|
+
type: "seek";
|
|
44
|
+
frameIndex: number;
|
|
45
|
+
};
|
|
46
|
+
export type Av3aChannelServiceToRenderer = ({
|
|
47
|
+
type: "pcm";
|
|
48
|
+
} & Av3aPcmEvent) | {
|
|
49
|
+
type: "opened";
|
|
50
|
+
info: Av3aTrackInfo;
|
|
51
|
+
} | {
|
|
52
|
+
type: "done";
|
|
53
|
+
} | {
|
|
54
|
+
type: "error";
|
|
55
|
+
message: string;
|
|
56
|
+
};
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
export interface Color {
|
|
2
|
+
hexString: `#${string}`;
|
|
3
|
+
rgb: {
|
|
4
|
+
r: number;
|
|
5
|
+
g: number;
|
|
6
|
+
b: number;
|
|
7
|
+
};
|
|
8
|
+
hsl: {
|
|
9
|
+
h: number;
|
|
10
|
+
s: number;
|
|
11
|
+
l: number;
|
|
12
|
+
};
|
|
13
|
+
}
|
|
14
|
+
export interface ColorPickerContract {
|
|
15
|
+
initialValue(): Promise<`#${string}`>;
|
|
16
|
+
save(value: Color): Promise<void>;
|
|
17
|
+
}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import type { DesktopLyricsPlayInfo, LyricsStyle } from "../types/desktop-lyrics.js";
|
|
2
|
+
export interface DesktopLyricsContract {
|
|
3
|
+
events: {
|
|
4
|
+
styleUpdate(callback: (style: LyricsStyle) => void): void;
|
|
5
|
+
lockUpdate(callback: (locked: boolean) => void): void;
|
|
6
|
+
offsetUpdate(callback: (offset: number) => void): void;
|
|
7
|
+
playInfoUpdate(callback: (info: DesktopLyricsPlayInfo | null) => void): void;
|
|
8
|
+
blur(callback: () => void): void;
|
|
9
|
+
};
|
|
10
|
+
requestFullUpdate(): Promise<void>;
|
|
11
|
+
dragWindow(): Promise<void>;
|
|
12
|
+
changeOrientation(): Promise<void>;
|
|
13
|
+
performAction(action: string): Promise<void>;
|
|
14
|
+
onMouseWheel(pageX: number, pageY: number, delta: number, modifier?: number): Promise<void>;
|
|
15
|
+
}
|
|
16
|
+
export interface DesktopLyricsPreviewContract {
|
|
17
|
+
requestInit(): Promise<{
|
|
18
|
+
style: LyricsStyle;
|
|
19
|
+
text: string;
|
|
20
|
+
}>;
|
|
21
|
+
ready(): Promise<void>;
|
|
22
|
+
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { LyricsStore } from "../types/lyrics.js";
|
|
2
|
+
export interface LyricsContract {
|
|
3
|
+
events: {
|
|
4
|
+
lyricsStoreUpdate(callback: (store: LyricsStore | null) => void): void;
|
|
5
|
+
sloganUpdate(callback: (slogan: string | null) => void): void;
|
|
6
|
+
playStateUpdate(callback: (state: boolean) => void): void;
|
|
7
|
+
timeUpdate(callback: (time: number) => void): void;
|
|
8
|
+
playbackRateUpdate(callback: (rate: number) => void): void;
|
|
9
|
+
};
|
|
10
|
+
requestFullUpdate(): Promise<void>;
|
|
11
|
+
}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import type { UpdateInfo } from "../types/update.js";
|
|
2
|
+
import type { CacheGroupStats, AllCacheStats } from "../types/manage.js";
|
|
3
|
+
export type { CacheGroupStats, AllCacheStats };
|
|
4
|
+
export interface ManageContract {
|
|
5
|
+
events: {
|
|
6
|
+
setFont(callback: (font: string | null) => void): void;
|
|
7
|
+
};
|
|
8
|
+
getFont(): Promise<string | null>;
|
|
9
|
+
checkUpdate(ignoreCache?: boolean): Promise<UpdateInfo | null>;
|
|
10
|
+
openPluginManager(): Promise<void>;
|
|
11
|
+
openLogFolder(): Promise<void>;
|
|
12
|
+
pack: {
|
|
13
|
+
getWebPackCommitHash(): Promise<string>;
|
|
14
|
+
redownloadPackage(): Promise<void>;
|
|
15
|
+
};
|
|
16
|
+
cache: {
|
|
17
|
+
getStats(): Promise<AllCacheStats>;
|
|
18
|
+
clearResources(category: "http" | "http:vacuum" | "lyrics" | "wasm"): Promise<void>;
|
|
19
|
+
};
|
|
20
|
+
protocol: {
|
|
21
|
+
isClient(): Promise<boolean>;
|
|
22
|
+
getClientName(): Promise<string>;
|
|
23
|
+
setAsClient(isClient: boolean): Promise<void>;
|
|
24
|
+
};
|
|
25
|
+
gpu: {
|
|
26
|
+
openInfo(): Promise<void>;
|
|
27
|
+
};
|
|
28
|
+
menu: {
|
|
29
|
+
enableDefaultMenu(): Promise<void>;
|
|
30
|
+
};
|
|
31
|
+
}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import type { MenuChildOpenRequest, MenuMeasurement, MenuSurfaceConfig, MenuSurfaceId, MenuUpdate } from "../types/menu-surface.js";
|
|
2
|
+
export interface MenuSurfaceContract {
|
|
3
|
+
surface: {
|
|
4
|
+
ready(): Promise<boolean>;
|
|
5
|
+
getFont(): Promise<string | null>;
|
|
6
|
+
reportSize(payload: {
|
|
7
|
+
requestId: number;
|
|
8
|
+
} & MenuMeasurement): Promise<boolean>;
|
|
9
|
+
visible(payload: {
|
|
10
|
+
requestId: number;
|
|
11
|
+
}): Promise<boolean>;
|
|
12
|
+
itemClick(menuId: string | null): Promise<void>;
|
|
13
|
+
btnClick(btnId: string): Promise<void>;
|
|
14
|
+
close(): Promise<void>;
|
|
15
|
+
openChild(payload: MenuChildOpenRequest): Promise<void>;
|
|
16
|
+
closeChildren(parentId: MenuSurfaceId): Promise<void>;
|
|
17
|
+
};
|
|
18
|
+
events: {
|
|
19
|
+
surface: {
|
|
20
|
+
prepare(callback: (config: MenuSurfaceConfig & {
|
|
21
|
+
requestId: number;
|
|
22
|
+
}) => void): void;
|
|
23
|
+
update(callback: (update: MenuUpdate) => void): void;
|
|
24
|
+
show(callback: (payload: {
|
|
25
|
+
requestId: number;
|
|
26
|
+
}) => void): void;
|
|
27
|
+
cursor(callback: (payload: {
|
|
28
|
+
requestId: number;
|
|
29
|
+
x: number;
|
|
30
|
+
y: number;
|
|
31
|
+
fallback?: boolean;
|
|
32
|
+
}) => void): void;
|
|
33
|
+
};
|
|
34
|
+
};
|
|
35
|
+
}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import type { MiniPlayerPlayInfo, MiniPlayerPlayState, MiniPlayerListData, MiniPlayerFullState, MiniPlayerStyle, MiniPlayerShowVolumeRequest, MiniPlayerLikeMark, MiniPlayerTogetherStatus } from "../types/mini-player.js";
|
|
2
|
+
export interface MiniPlayerContract {
|
|
3
|
+
events: {
|
|
4
|
+
playInfoUpdate(callback: (info: MiniPlayerPlayInfo | null) => void): void;
|
|
5
|
+
coverUpdate(callback: (url: string | null) => void): void;
|
|
6
|
+
likeUpdate(callback: (liked: MiniPlayerLikeMark) => void): void;
|
|
7
|
+
favourUpdate(callback: (favourited: boolean) => void): void;
|
|
8
|
+
muteUpdate(callback: (muted: boolean) => void): void;
|
|
9
|
+
playStateUpdate(callback: (state: MiniPlayerPlayState) => void): void;
|
|
10
|
+
listUpdate(callback: (data: MiniPlayerListData) => void): void;
|
|
11
|
+
togetherStatusUpdate(callback: (status: MiniPlayerTogetherStatus) => void): void;
|
|
12
|
+
showVolume(callback: (data: MiniPlayerShowVolumeRequest) => void): void;
|
|
13
|
+
styleUpdate(callback: (style: MiniPlayerStyle | null) => void): void;
|
|
14
|
+
setFont(callback: (font: string | null) => void): void;
|
|
15
|
+
};
|
|
16
|
+
requestFullUpdate(): Promise<MiniPlayerFullState>;
|
|
17
|
+
dragWindow(): Promise<void>;
|
|
18
|
+
fireCall(cmd: string, ...args: unknown[]): Promise<void>;
|
|
19
|
+
}
|
|
@@ -0,0 +1,223 @@
|
|
|
1
|
+
/** @internal */
|
|
2
|
+
export declare const PluginKind: {
|
|
3
|
+
readonly Builtin: "builtin";
|
|
4
|
+
readonly User: "user";
|
|
5
|
+
};
|
|
6
|
+
/** @internal */
|
|
7
|
+
export type PluginKind = "builtin" | "user";
|
|
8
|
+
export declare namespace PluginKind {
|
|
9
|
+
type Builtin = "builtin";
|
|
10
|
+
type User = "user";
|
|
11
|
+
}
|
|
12
|
+
/** Plugin identity layer. Built-ins take precedence over user plugins. */
|
|
13
|
+
/** @internal */
|
|
14
|
+
export declare const PluginLayer: {
|
|
15
|
+
readonly Builtin: "builtin";
|
|
16
|
+
readonly User: "user";
|
|
17
|
+
};
|
|
18
|
+
/** Plugin identity layer. Built-ins take precedence over user plugins. */
|
|
19
|
+
/** @internal */
|
|
20
|
+
export type PluginLayer = "builtin" | "user";
|
|
21
|
+
export declare namespace PluginLayer {
|
|
22
|
+
type Builtin = "builtin";
|
|
23
|
+
type User = "user";
|
|
24
|
+
}
|
|
25
|
+
/** @internal */
|
|
26
|
+
export declare const PluginRuntimeStateKind: {
|
|
27
|
+
readonly Stopped: "stopped";
|
|
28
|
+
readonly Starting: "starting";
|
|
29
|
+
readonly Running: "running";
|
|
30
|
+
readonly Stopping: "stopping";
|
|
31
|
+
readonly Failed: "failed";
|
|
32
|
+
readonly Hung: "hung";
|
|
33
|
+
readonly Abandoned: "abandoned";
|
|
34
|
+
readonly Disposed: "disposed";
|
|
35
|
+
};
|
|
36
|
+
/** @internal */
|
|
37
|
+
export type PluginRuntimeStateKind = "stopped" | "starting" | "running" | "stopping" | "failed" | "hung" | "abandoned" | "disposed";
|
|
38
|
+
export declare namespace PluginRuntimeStateKind {
|
|
39
|
+
type Stopped = "stopped";
|
|
40
|
+
type Starting = "starting";
|
|
41
|
+
type Running = "running";
|
|
42
|
+
type Stopping = "stopping";
|
|
43
|
+
type Failed = "failed";
|
|
44
|
+
type Hung = "hung";
|
|
45
|
+
type Abandoned = "abandoned";
|
|
46
|
+
type Disposed = "disposed";
|
|
47
|
+
}
|
|
48
|
+
/** @internal */
|
|
49
|
+
export declare const PluginFailureStage: {
|
|
50
|
+
readonly Load: "load";
|
|
51
|
+
readonly Activate: "activate";
|
|
52
|
+
readonly Deactivate: "deactivate";
|
|
53
|
+
};
|
|
54
|
+
/** @internal */
|
|
55
|
+
export type PluginFailureStage = "load" | "activate" | "deactivate";
|
|
56
|
+
export declare namespace PluginFailureStage {
|
|
57
|
+
type Load = "load";
|
|
58
|
+
type Activate = "activate";
|
|
59
|
+
type Deactivate = "deactivate";
|
|
60
|
+
}
|
|
61
|
+
/** Serializable form of a runtime state, safe to cross IPC. */
|
|
62
|
+
/** @internal */
|
|
63
|
+
export interface SerializablePluginRuntimeState {
|
|
64
|
+
kind: PluginRuntimeStateKind;
|
|
65
|
+
desiredRevision: number;
|
|
66
|
+
attempt?: number;
|
|
67
|
+
stage?: PluginFailureStage;
|
|
68
|
+
error?: string;
|
|
69
|
+
retryable?: boolean;
|
|
70
|
+
since?: number;
|
|
71
|
+
startedAt?: number;
|
|
72
|
+
timedOut?: boolean;
|
|
73
|
+
}
|
|
74
|
+
/** @internal */
|
|
75
|
+
export interface PluginDesiredState {
|
|
76
|
+
enabled: boolean;
|
|
77
|
+
revision: number;
|
|
78
|
+
}
|
|
79
|
+
/** @internal */
|
|
80
|
+
export declare const PluginAvailabilityKind: {
|
|
81
|
+
readonly Available: "available";
|
|
82
|
+
readonly Conflict: "conflict";
|
|
83
|
+
readonly Invalid: "invalid";
|
|
84
|
+
};
|
|
85
|
+
/** @internal */
|
|
86
|
+
export type PluginAvailabilityKind = "available" | "conflict" | "invalid";
|
|
87
|
+
export declare namespace PluginAvailabilityKind {
|
|
88
|
+
type Available = "available";
|
|
89
|
+
type Conflict = "conflict";
|
|
90
|
+
type Invalid = "invalid";
|
|
91
|
+
}
|
|
92
|
+
/** @internal */
|
|
93
|
+
export type PluginAvailability = {
|
|
94
|
+
kind: "available";
|
|
95
|
+
} | {
|
|
96
|
+
kind: "conflict";
|
|
97
|
+
paths: string[];
|
|
98
|
+
} | {
|
|
99
|
+
kind: "invalid";
|
|
100
|
+
path: string;
|
|
101
|
+
error: string;
|
|
102
|
+
};
|
|
103
|
+
/** @internal */
|
|
104
|
+
export declare const PluginPresentationStatus: {
|
|
105
|
+
readonly Unavailable: "unavailable";
|
|
106
|
+
readonly Disabled: "disabled";
|
|
107
|
+
readonly Starting: "starting";
|
|
108
|
+
readonly Running: "running";
|
|
109
|
+
readonly Degraded: "degraded";
|
|
110
|
+
readonly Failed: "failed";
|
|
111
|
+
readonly Stopping: "stopping";
|
|
112
|
+
readonly CleanupFailed: "cleanup-failed";
|
|
113
|
+
};
|
|
114
|
+
/** @internal */
|
|
115
|
+
export type PluginPresentationStatus = "unavailable" | "disabled" | "starting" | "running" | "degraded" | "failed" | "stopping" | "cleanup-failed";
|
|
116
|
+
export declare namespace PluginPresentationStatus {
|
|
117
|
+
type Unavailable = "unavailable";
|
|
118
|
+
type Disabled = "disabled";
|
|
119
|
+
type Starting = "starting";
|
|
120
|
+
type Running = "running";
|
|
121
|
+
type Degraded = "degraded";
|
|
122
|
+
type Failed = "failed";
|
|
123
|
+
type Stopping = "stopping";
|
|
124
|
+
type CleanupFailed = "cleanup-failed";
|
|
125
|
+
}
|
|
126
|
+
/** @internal */
|
|
127
|
+
export interface PluginRealmInstanceSummary {
|
|
128
|
+
webContentsId: number;
|
|
129
|
+
state: SerializablePluginRuntimeState;
|
|
130
|
+
}
|
|
131
|
+
/** @internal */
|
|
132
|
+
export interface PluginRealmSummary {
|
|
133
|
+
declared: boolean;
|
|
134
|
+
hostCount: number;
|
|
135
|
+
instances: PluginRealmInstanceSummary[];
|
|
136
|
+
counts: Partial<Record<PluginRuntimeStateKind, number>>;
|
|
137
|
+
}
|
|
138
|
+
/** Configuration UI declared by the plugin, independent of its execution realms. */
|
|
139
|
+
/** @internal */
|
|
140
|
+
export interface PluginConfigurationSummary {
|
|
141
|
+
declared: boolean;
|
|
142
|
+
/** Resolved `assets://plugins/<id>/<path>` URL, when declared. */
|
|
143
|
+
url?: string;
|
|
144
|
+
}
|
|
145
|
+
/** @internal */
|
|
146
|
+
export interface PluginShadowedSource {
|
|
147
|
+
layer: PluginLayer;
|
|
148
|
+
path: string;
|
|
149
|
+
}
|
|
150
|
+
/** @internal */
|
|
151
|
+
export interface PluginManagerEntry {
|
|
152
|
+
id: string;
|
|
153
|
+
name: string;
|
|
154
|
+
version: string;
|
|
155
|
+
description?: string;
|
|
156
|
+
author?: string;
|
|
157
|
+
license?: string;
|
|
158
|
+
/** Resolved `assets://plugins/<id>/<path>` URL, when the plugin declares an icon. */
|
|
159
|
+
icon?: string;
|
|
160
|
+
kind: PluginKind;
|
|
161
|
+
layer: PluginLayer;
|
|
162
|
+
/** Persisted intent. */
|
|
163
|
+
desired: PluginDesiredState;
|
|
164
|
+
/** Convenience mirror of `desired.enabled`. */
|
|
165
|
+
enabled: boolean;
|
|
166
|
+
availability: PluginAvailability;
|
|
167
|
+
/** User plugins ignored because a built-in owns the same id. */
|
|
168
|
+
shadowed: PluginShadowedSource[];
|
|
169
|
+
/** Main-realm runtime state. */
|
|
170
|
+
main: SerializablePluginRuntimeState;
|
|
171
|
+
/** Per-window secondary-realm instances, keyed by realm. */
|
|
172
|
+
realms: Record<string, PluginRealmSummary>;
|
|
173
|
+
/** Declared configuration UI module. */
|
|
174
|
+
configuration: PluginConfigurationSummary;
|
|
175
|
+
/** Derived presentation category; raw state above remains authoritative. */
|
|
176
|
+
presentation: PluginPresentationStatus;
|
|
177
|
+
error?: string;
|
|
178
|
+
}
|
|
179
|
+
/** @internal */
|
|
180
|
+
export interface PluginManagerState {
|
|
181
|
+
/** False when the plugin system itself is disabled. */
|
|
182
|
+
available: boolean;
|
|
183
|
+
plugins: PluginManagerEntry[];
|
|
184
|
+
}
|
|
185
|
+
/** Revisioned desired-state notification sent to realm windows. */
|
|
186
|
+
/** @internal */
|
|
187
|
+
export interface PluginRealmDesiredChange {
|
|
188
|
+
realm: string;
|
|
189
|
+
id: string;
|
|
190
|
+
enabled: boolean;
|
|
191
|
+
revision: number;
|
|
192
|
+
}
|
|
193
|
+
/** What a newly created realm window needs to start its plugins. */
|
|
194
|
+
/** @internal */
|
|
195
|
+
export interface PluginRealmBootstrap {
|
|
196
|
+
realm: string;
|
|
197
|
+
plugins: Array<{
|
|
198
|
+
id: string;
|
|
199
|
+
desired: PluginDesiredState;
|
|
200
|
+
/** Omitted when the source could not be read; the window fetches it. */
|
|
201
|
+
source?: string;
|
|
202
|
+
}>;
|
|
203
|
+
}
|
|
204
|
+
/** Per-plugin runtime report sent from a realm window. */
|
|
205
|
+
/** @internal */
|
|
206
|
+
export interface PluginRealmReport {
|
|
207
|
+
realm: string;
|
|
208
|
+
id: string;
|
|
209
|
+
desiredRevision: number;
|
|
210
|
+
attempt: number;
|
|
211
|
+
state: SerializablePluginRuntimeState;
|
|
212
|
+
}
|
|
213
|
+
/** @internal */
|
|
214
|
+
export interface PluginManagerContract {
|
|
215
|
+
list(): Promise<PluginManagerState>;
|
|
216
|
+
setEnabled(id: string, enabled: boolean): Promise<PluginManagerState>;
|
|
217
|
+
retry(id: string): Promise<PluginManagerState>;
|
|
218
|
+
openPluginsFolder(): Promise<void>;
|
|
219
|
+
events: {
|
|
220
|
+
/** Fired when a plugin's desired state or runtime state changes. */
|
|
221
|
+
changed(callback: () => void): void;
|
|
222
|
+
};
|
|
223
|
+
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
export interface SettingsContract {
|
|
2
|
+
events: {
|
|
3
|
+
change(callback: (key: string, value: unknown) => void): Promise<void>;
|
|
4
|
+
delete(callback: (key: string) => void): Promise<void>;
|
|
5
|
+
};
|
|
6
|
+
get(key: string): Promise<unknown | undefined>;
|
|
7
|
+
get(key: string[]): Promise<(unknown | undefined)[]>;
|
|
8
|
+
set(key: string, value: unknown): Promise<boolean>;
|
|
9
|
+
setMany(entries: {
|
|
10
|
+
key: string;
|
|
11
|
+
value: unknown;
|
|
12
|
+
}[]): Promise<boolean[]>;
|
|
13
|
+
delete(key: string): Promise<boolean>;
|
|
14
|
+
deleteMany(key: string[]): Promise<boolean[]>;
|
|
15
|
+
}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Append a unique `?t=<timestamp>-<rand>` query to a module URL.
|
|
3
|
+
*
|
|
4
|
+
* Both Node's ESM loader and Chromium's module map cache by full URL, so a
|
|
5
|
+
* distinct query forces a fresh evaluation. Callers must share the returned URL
|
|
6
|
+
* for one activation epoch; otherwise the same entry evaluates twice.
|
|
7
|
+
*/
|
|
8
|
+
export declare function cacheBustUrl(url: string): string;
|