@bilibili-notify/dynamic 0.0.1-alpha.2 → 0.0.1-alpha.3

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/lib/index.cjs CHANGED
@@ -233,6 +233,17 @@ var DynamicEngine = class {
233
233
  setAi(ai) {
234
234
  this.ai = ai;
235
235
  }
236
+ /**
237
+ * 热替换 ImageRenderer 实例。与 setAi 对称:adapter 在 image 服务上下线时
238
+ * 调用,引擎随后的卡片渲染会立即用新实例 (或回退到纯文字) ,无需重启 server。
239
+ *
240
+ * 主要给 koishi adapter 用 —— sibling service (-image) 启停时通过 ctx.inject
241
+ * 后置注入。独立端 imageRenderer 是 engine 同进程一次性 wire,不会动态消失,
242
+ * 不需要调用本方法 (cardStyle 热更走 imageRenderer.updateConfig)。
243
+ */
244
+ setImage(image) {
245
+ this.image = image;
246
+ }
236
247
  get isActive() {
237
248
  return this.dynamicJob?.running ?? false;
238
249
  }
package/lib/index.d.cts CHANGED
@@ -271,7 +271,7 @@ declare class DynamicEngine {
271
271
  private readonly bus;
272
272
  private readonly api;
273
273
  private readonly push;
274
- private readonly image?;
274
+ private image?;
275
275
  private ai?;
276
276
  private readonly logger;
277
277
  private readonly getSubs;
@@ -308,6 +308,15 @@ declare class DynamicEngine {
308
308
  * 配置后调用,引擎随后的动态点评会立即用新实例 (或回退到纯文字) ,无需重启 server。
309
309
  */
310
310
  setAi(ai: CommentaryGenerator | undefined): void;
311
+ /**
312
+ * 热替换 ImageRenderer 实例。与 setAi 对称:adapter 在 image 服务上下线时
313
+ * 调用,引擎随后的卡片渲染会立即用新实例 (或回退到纯文字) ,无需重启 server。
314
+ *
315
+ * 主要给 koishi adapter 用 —— sibling service (-image) 启停时通过 ctx.inject
316
+ * 后置注入。独立端 imageRenderer 是 engine 同进程一次性 wire,不会动态消失,
317
+ * 不需要调用本方法 (cardStyle 热更走 imageRenderer.updateConfig)。
318
+ */
319
+ setImage(image: ImageRenderer | undefined): void;
311
320
  get isActive(): boolean;
312
321
  /** 用最新订阅快照重启动态检测;保留已有 UID 的时间戳避免重推旧动态。 */
313
322
  startDynamicDetector(subs: SubscriptionsView): void;
package/lib/index.d.mts CHANGED
@@ -271,7 +271,7 @@ declare class DynamicEngine {
271
271
  private readonly bus;
272
272
  private readonly api;
273
273
  private readonly push;
274
- private readonly image?;
274
+ private image?;
275
275
  private ai?;
276
276
  private readonly logger;
277
277
  private readonly getSubs;
@@ -308,6 +308,15 @@ declare class DynamicEngine {
308
308
  * 配置后调用,引擎随后的动态点评会立即用新实例 (或回退到纯文字) ,无需重启 server。
309
309
  */
310
310
  setAi(ai: CommentaryGenerator | undefined): void;
311
+ /**
312
+ * 热替换 ImageRenderer 实例。与 setAi 对称:adapter 在 image 服务上下线时
313
+ * 调用,引擎随后的卡片渲染会立即用新实例 (或回退到纯文字) ,无需重启 server。
314
+ *
315
+ * 主要给 koishi adapter 用 —— sibling service (-image) 启停时通过 ctx.inject
316
+ * 后置注入。独立端 imageRenderer 是 engine 同进程一次性 wire,不会动态消失,
317
+ * 不需要调用本方法 (cardStyle 热更走 imageRenderer.updateConfig)。
318
+ */
319
+ setImage(image: ImageRenderer | undefined): void;
311
320
  get isActive(): boolean;
312
321
  /** 用最新订阅快照重启动态检测;保留已有 UID 的时间戳避免重推旧动态。 */
313
322
  startDynamicDetector(subs: SubscriptionsView): void;
package/lib/index.mjs CHANGED
@@ -232,6 +232,17 @@ var DynamicEngine = class {
232
232
  setAi(ai) {
233
233
  this.ai = ai;
234
234
  }
235
+ /**
236
+ * 热替换 ImageRenderer 实例。与 setAi 对称:adapter 在 image 服务上下线时
237
+ * 调用,引擎随后的卡片渲染会立即用新实例 (或回退到纯文字) ,无需重启 server。
238
+ *
239
+ * 主要给 koishi adapter 用 —— sibling service (-image) 启停时通过 ctx.inject
240
+ * 后置注入。独立端 imageRenderer 是 engine 同进程一次性 wire,不会动态消失,
241
+ * 不需要调用本方法 (cardStyle 热更走 imageRenderer.updateConfig)。
242
+ */
243
+ setImage(image) {
244
+ this.image = image;
245
+ }
235
246
  get isActive() {
236
247
  return this.dynamicJob?.running ?? false;
237
248
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@bilibili-notify/dynamic",
3
- "version": "0.0.1-alpha.2",
3
+ "version": "0.0.1-alpha.3",
4
4
  "repository": {
5
5
  "type": "git",
6
6
  "url": "https://github.com/Akokk0/bilibili-notify"
@@ -28,9 +28,9 @@
28
28
  "dependencies": {
29
29
  "cron": "^3.1.7",
30
30
  "luxon": "^3.5.0",
31
- "@bilibili-notify/api": "^0.2.0-alpha.2",
32
31
  "@bilibili-notify/ai": "^0.0.1-alpha.1",
33
32
  "@bilibili-notify/image": "^0.0.1-alpha.2",
33
+ "@bilibili-notify/api": "^0.2.0-alpha.2",
34
34
  "@bilibili-notify/internal": "^0.1.0-alpha.2"
35
35
  },
36
36
  "devDependencies": {