@shiqianjiang/ceru-plugin-core 0.2.1 → 0.3.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.
package/README.md CHANGED
@@ -4,6 +4,12 @@ Ceru Music v2 的 Host 无关 Core。它读取单文件 artifact,校验 manife
4
4
 
5
5
  Core 提供 `./node` 纯 Node worker 运行环境、`./electron` 可见页面沙箱、`./network` HTTP 代理和 `./sockets` 连接管理。后台逻辑不依赖 DOM;可见页面单独运行。播放器、歌单、账号和授权界面由澜音现有服务提供。
6
6
 
7
+ 0.3.1 支持 SDK 的播放 `requestHeaders` 结果校验。桌面 Host 应将这些请求头按完整临时媒体 URL 隔离保存在主进程,并同时用于播放、缓存和下载请求。
8
+
9
+ 0.3.0 增加 `./surface` 的 `SurfaceSession` 与 `./surface-document` 的 `createWebSurfaceDocument`。宿主将 document 放入 `sandbox="allow-scripts"` 的 iframe,只允许 session.invoke 调用已声明动作,挂载后调用 session.open,关闭/切换时调用 session.close。状态按 surface ID 路由,并在挂载后重放。宿主必须校验消息来源、session ID,并阻止 iframe 导航及新窗口;不应实现任何平台的登录 UI 或账号流程。
10
+
11
+ `./guests` 正式导出 `GuestStore`,在独立 Node worker 中运行兼容环境提供的 bootstrap 和用户导入脚本。它保留原有 Host 边界:导入确认、网络授权、私网授权、事件及私有目录由应用提供。
12
+
7
13
  Node VM 内只运行本领域的 SDK 与打包后的插件,跨边界使用 JSON,删除原生桥引用并禁用字符串代码生成;worker 设内存、运行时限和消息额度。公网请求由用户按组授权,内网另行授权。此隔离不应宣称是针对所有 V8 漏洞的安全保证。
8
14
 
9
15
  歌词统一使用 SDK `CrLyric`(`format: 'crlyric'`、`version: 1`、毫秒时间轴)。`lyricConverters` 插件负责导入各种歌词和导出 LRC/增强 LRC/YRC;Core 不包含歌词解析器。音质顺序由 Provider 的 `qualities` 数组定义,从低到高。
@@ -1831,7 +1831,6 @@
1831
1831
  this.query = result;
1832
1832
  this.changed?.(result);
1833
1833
  }
1834
- ;
1835
1834
  return result;
1836
1835
  }
1837
1836
  get(key) {
@@ -1871,7 +1870,10 @@
1871
1870
  var SafeURL = class {
1872
1871
  value;
1873
1872
  constructor(url, base) {
1874
- this.value = native("url", { url: String(url), base: base === void 0 ? void 0 : String(base) });
1873
+ this.value = native("url", {
1874
+ url: String(url),
1875
+ base: base === void 0 ? void 0 : String(base)
1876
+ });
1875
1877
  }
1876
1878
  get href() {
1877
1879
  return this.value.href;
@@ -2011,10 +2013,12 @@
2011
2013
  if (!timer.repeat) timers.delete(data.id);
2012
2014
  timer.callback(...timer.args);
2013
2015
  }
2014
- ;
2015
2016
  return;
2016
2017
  }
2017
- for (const listener of listeners) Promise.resolve(listener({ source: globalThis.parent, data })).catch((error) => native("message", { type: "log", data: { level: "error", values: [String(error)] } }));
2018
+ for (const listener of listeners)
2019
+ Promise.resolve(listener({ source: globalThis.parent, data })).catch(
2020
+ (error) => native("message", { type: "log", data: { level: "error", values: [String(error)] } })
2021
+ );
2018
2022
  }
2019
2023
  });
2020
2024
  })();