assistsx-js 0.2.3 → 0.2.4

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/dist/index.js CHANGED
@@ -149,6 +149,7 @@ var CallMethod = {
149
149
  performLinearGesture: "performLinearGesture",
150
150
  longPressGestureAutoPaste: "longPressGestureAutoPaste",
151
151
  getAppInfo: "getAppInfo",
152
+ getCurrentPlugin: "getCurrentPlugin",
152
153
  getMacAddress: "getMacAddress",
153
154
  getAndroidID: "getAndroidID",
154
155
  getUniqueDeviceId: "getUniqueDeviceId",
@@ -269,6 +270,52 @@ var AppInfo = class _AppInfo {
269
270
  }
270
271
  };
271
272
 
273
+ // src/plugin-info.ts
274
+ var PluginInfo = class _PluginInfo {
275
+ constructor(id = "", name = "", packageName = "", versionName = "", versionCode = 0, description = "", path = "", index = "", port = 0, needScreenCapture = false) {
276
+ this.id = id;
277
+ this.name = name;
278
+ this.packageName = packageName;
279
+ this.versionName = versionName;
280
+ this.versionCode = versionCode;
281
+ this.description = description;
282
+ this.path = path;
283
+ this.index = index;
284
+ this.port = port;
285
+ this.needScreenCapture = needScreenCapture;
286
+ }
287
+ static fromJSON(data) {
288
+ var _a2, _b, _c, _d, _e, _f, _g, _h, _i, _j;
289
+ const record = data != null ? data : {};
290
+ return new _PluginInfo(
291
+ String((_a2 = record.id) != null ? _a2 : ""),
292
+ String((_b = record.name) != null ? _b : ""),
293
+ String((_c = record.packageName) != null ? _c : ""),
294
+ String((_d = record.versionName) != null ? _d : ""),
295
+ Number((_e = record.versionCode) != null ? _e : 0),
296
+ String((_f = record.description) != null ? _f : ""),
297
+ String((_g = record.path) != null ? _g : ""),
298
+ String((_h = record.index) != null ? _h : ""),
299
+ Number((_i = record.port) != null ? _i : 0),
300
+ Boolean((_j = record.needScreenCapture) != null ? _j : false)
301
+ );
302
+ }
303
+ toJSON() {
304
+ return {
305
+ id: this.id,
306
+ name: this.name,
307
+ packageName: this.packageName,
308
+ versionName: this.versionName,
309
+ versionCode: this.versionCode,
310
+ description: this.description,
311
+ path: this.path,
312
+ index: this.index,
313
+ port: this.port,
314
+ needScreenCapture: this.needScreenCapture
315
+ };
316
+ }
317
+ };
318
+
272
319
  // src/device-info.ts
273
320
  var DeviceInfo = class _DeviceInfo {
274
321
  constructor(uniqueDeviceId = "", androidID = "", macAddress = "", isDeviceRooted = false, manufacturer = "", model = "", sdkVersionCode = 0, sdkVersionName = "", abiList = [], isAdbEnabled = false, isDevelopmentSettingsEnabled = false, isEmulator = false, isTablet = false) {
@@ -332,6 +379,137 @@ var DeviceInfo = class _DeviceInfo {
332
379
  }
333
380
  };
334
381
 
382
+ // src/window-flags.ts
383
+ var _WindowFlags = class _WindowFlags {
384
+ // 0x1000000
385
+ /**
386
+ * 获取标志位的十六进制表示
387
+ * @param flag 标志位值
388
+ * @returns 十六进制字符串
389
+ */
390
+ static toHex(flag) {
391
+ return `0x${flag.toString(16).toUpperCase()}`;
392
+ }
393
+ /**
394
+ * 检查是否包含指定标志位
395
+ * @param flags 当前标志位组合
396
+ * @param flag 要检查的标志位
397
+ * @returns 是否包含该标志位
398
+ */
399
+ static hasFlag(flags, flag) {
400
+ return (flags & flag) === flag;
401
+ }
402
+ /**
403
+ * 添加标志位
404
+ * @param flags 当前标志位组合
405
+ * @param flag 要添加的标志位
406
+ * @returns 新的标志位组合
407
+ */
408
+ static addFlag(flags, flag) {
409
+ return flags | flag;
410
+ }
411
+ /**
412
+ * 移除标志位
413
+ * @param flags 当前标志位组合
414
+ * @param flag 要移除的标志位
415
+ * @returns 新的标志位组合
416
+ */
417
+ static removeFlag(flags, flag) {
418
+ return flags & ~flag;
419
+ }
420
+ /** 输入框获取焦点时使用的悬浮窗 flag 组合(不含 FLAG_NOT_FOCUSABLE) */
421
+ static getOverlayInputFocusFlagList() {
422
+ return [
423
+ _WindowFlags.FLAG_WATCH_OUTSIDE_TOUCH,
424
+ _WindowFlags.FLAG_NOT_TOUCH_MODAL,
425
+ _WindowFlags.FLAG_LAYOUT_NO_LIMITS,
426
+ _WindowFlags.FLAG_LAYOUT_IN_SCREEN
427
+ ];
428
+ }
429
+ /** 输入框失去焦点时使用的悬浮窗 flag 组合(含 FLAG_NOT_FOCUSABLE) */
430
+ static getOverlayInputBlurFlagList() {
431
+ return [
432
+ _WindowFlags.FLAG_WATCH_OUTSIDE_TOUCH,
433
+ _WindowFlags.FLAG_NOT_TOUCH_MODAL,
434
+ _WindowFlags.FLAG_LAYOUT_NO_LIMITS,
435
+ _WindowFlags.FLAG_NOT_FOCUSABLE,
436
+ _WindowFlags.FLAG_LAYOUT_IN_SCREEN
437
+ ];
438
+ }
439
+ /**
440
+ * 获取所有标志位的描述信息
441
+ * @returns 标志位描述对象数组
442
+ */
443
+ static getAllFlags() {
444
+ return [
445
+ { name: "FLAG_NOT_FOCUSABLE", value: this.FLAG_NOT_FOCUSABLE, hex: this.toHex(this.FLAG_NOT_FOCUSABLE), description: "\u4E0D\u83B7\u53D6\u7126\u70B9" },
446
+ { name: "FLAG_NOT_TOUCHABLE", value: this.FLAG_NOT_TOUCHABLE, hex: this.toHex(this.FLAG_NOT_TOUCHABLE), description: "\u4E0D\u54CD\u5E94\u89E6\u6478" },
447
+ { name: "FLAG_NOT_TOUCH_MODAL", value: this.FLAG_NOT_TOUCH_MODAL, hex: this.toHex(this.FLAG_NOT_TOUCH_MODAL), description: "\u4E0D\u62E6\u622A\u89E6\u6478" },
448
+ { name: "FLAG_WATCH_OUTSIDE_TOUCH", value: this.FLAG_WATCH_OUTSIDE_TOUCH, hex: this.toHex(this.FLAG_WATCH_OUTSIDE_TOUCH), description: "\u76D1\u542C\u7A97\u5916\u70B9\u51FB" },
449
+ { name: "FLAG_LAYOUT_NO_LIMITS", value: this.FLAG_LAYOUT_NO_LIMITS, hex: this.toHex(this.FLAG_LAYOUT_NO_LIMITS), description: "\u53EF\u7ED8\u5236\u8D85\u51FA\u5C4F\u5E55" },
450
+ { name: "FLAG_LAYOUT_IN_SCREEN", value: this.FLAG_LAYOUT_IN_SCREEN, hex: this.toHex(this.FLAG_LAYOUT_IN_SCREEN), description: "\u5C4F\u5E55\u5168\u533A\u57DF\u5E03\u5C40" },
451
+ { name: "FLAG_FULLSCREEN", value: this.FLAG_FULLSCREEN, hex: this.toHex(this.FLAG_FULLSCREEN), description: "\u5168\u5C4F\u663E\u793A" },
452
+ { name: "FLAG_DIM_BEHIND", value: this.FLAG_DIM_BEHIND, hex: this.toHex(this.FLAG_DIM_BEHIND), description: "\u80CC\u666F\u53D8\u6697" },
453
+ { name: "FLAG_SECURE", value: this.FLAG_SECURE, hex: this.toHex(this.FLAG_SECURE), description: "\u9632\u5F55\u5C4F\u9632\u622A\u56FE" },
454
+ { name: "FLAG_KEEP_SCREEN_ON", value: this.FLAG_KEEP_SCREEN_ON, hex: this.toHex(this.FLAG_KEEP_SCREEN_ON), description: "\u4FDD\u6301\u5E38\u4EAE" },
455
+ { name: "FLAG_SHOW_WHEN_LOCKED", value: this.FLAG_SHOW_WHEN_LOCKED, hex: this.toHex(this.FLAG_SHOW_WHEN_LOCKED), description: "\u9501\u5C4F\u65F6\u53EF\u89C1" },
456
+ { name: "FLAG_DISMISS_KEYGUARD", value: this.FLAG_DISMISS_KEYGUARD, hex: this.toHex(this.FLAG_DISMISS_KEYGUARD), description: "\u89E3\u9501\u5C4F\u5E55" },
457
+ { name: "FLAG_TURN_SCREEN_ON", value: this.FLAG_TURN_SCREEN_ON, hex: this.toHex(this.FLAG_TURN_SCREEN_ON), description: "\u70B9\u4EAE\u5C4F\u5E55" },
458
+ { name: "FLAG_ALLOW_LOCK_WHILE_SCREEN_ON", value: this.FLAG_ALLOW_LOCK_WHILE_SCREEN_ON, hex: this.toHex(this.FLAG_ALLOW_LOCK_WHILE_SCREEN_ON), description: "\u81EA\u52A8\u9501\u5C4F\uFF08\u4E0D\u5E38\u7528\uFF09" },
459
+ { name: "FLAG_SHOW_WALLPAPER", value: this.FLAG_SHOW_WALLPAPER, hex: this.toHex(this.FLAG_SHOW_WALLPAPER), description: "\u663E\u793A\u5899\u7EB8" },
460
+ { name: "FLAG_HARDWARE_ACCELERATED", value: this.FLAG_HARDWARE_ACCELERATED, hex: this.toHex(this.FLAG_HARDWARE_ACCELERATED), description: "\u5F3A\u5236\u786C\u4EF6\u52A0\u901F" }
461
+ ];
462
+ }
463
+ };
464
+ /** 不获取焦点 */
465
+ _WindowFlags.FLAG_NOT_FOCUSABLE = 8;
466
+ // 0x08
467
+ /** 不响应触摸 */
468
+ _WindowFlags.FLAG_NOT_TOUCHABLE = 16;
469
+ // 0x10
470
+ /** 不拦截触摸 */
471
+ _WindowFlags.FLAG_NOT_TOUCH_MODAL = 32;
472
+ // 0x20
473
+ /** 监听窗外点击 */
474
+ _WindowFlags.FLAG_WATCH_OUTSIDE_TOUCH = 4;
475
+ // 0x04
476
+ /** 可绘制超出屏幕 */
477
+ _WindowFlags.FLAG_LAYOUT_NO_LIMITS = 512;
478
+ // 0x200
479
+ /** 屏幕全区域布局 */
480
+ _WindowFlags.FLAG_LAYOUT_IN_SCREEN = 256;
481
+ // 0x100
482
+ /** 全屏显示 */
483
+ _WindowFlags.FLAG_FULLSCREEN = 1024;
484
+ // 0x400
485
+ /** 背景变暗 */
486
+ _WindowFlags.FLAG_DIM_BEHIND = 2;
487
+ // 0x02
488
+ /** 防录屏防截图 */
489
+ _WindowFlags.FLAG_SECURE = 8192;
490
+ // 0x2000
491
+ /** 保持常亮 */
492
+ _WindowFlags.FLAG_KEEP_SCREEN_ON = 128;
493
+ // 0x80
494
+ /** 锁屏时可见 */
495
+ _WindowFlags.FLAG_SHOW_WHEN_LOCKED = 524288;
496
+ // 0x80000
497
+ /** 解锁屏幕 */
498
+ _WindowFlags.FLAG_DISMISS_KEYGUARD = 4194304;
499
+ // 0x400000
500
+ /** 点亮屏幕 */
501
+ _WindowFlags.FLAG_TURN_SCREEN_ON = 2097152;
502
+ // 0x200000
503
+ /** 自动锁屏(不常用) */
504
+ _WindowFlags.FLAG_ALLOW_LOCK_WHILE_SCREEN_ON = 128;
505
+ // 0x80
506
+ /** 显示墙纸 */
507
+ _WindowFlags.FLAG_SHOW_WALLPAPER = 1048576;
508
+ // 0x100000
509
+ /** 强制硬件加速 */
510
+ _WindowFlags.FLAG_HARDWARE_ACCELERATED = 16777216;
511
+ var WindowFlags = _WindowFlags;
512
+
335
513
  // src/assistsx-async.ts
336
514
  var AssistsXAsync = class {
337
515
  /**
@@ -403,6 +581,18 @@ var AssistsXAsync = class {
403
581
  });
404
582
  return response.getDataOrDefault(false);
405
583
  }
584
+ /**
585
+ * 设置悬浮窗可获取焦点(WebView 内输入框 focus 时调用)
586
+ */
587
+ static async setOverlayInputFocus(timeout) {
588
+ return this.setOverlayFlagList(WindowFlags.getOverlayInputFocusFlagList(), timeout);
589
+ }
590
+ /**
591
+ * 取消悬浮窗焦点(WebView 内输入框 blur 时调用)
592
+ */
593
+ static async clearOverlayInputFocus(timeout) {
594
+ return this.setOverlayFlagList(WindowFlags.getOverlayInputBlurFlagList(), timeout);
595
+ }
406
596
  /**
407
597
  * 获取所有符合条件的节点
408
598
  * @param filterClass 类名过滤
@@ -1168,6 +1358,22 @@ var AssistsXAsync = class {
1168
1358
  });
1169
1359
  return AppInfo.fromJSON(response.getDataOrDefault({}));
1170
1360
  }
1361
+ /**
1362
+ * 获取当前运行的 AssistsX 插件信息(仅 AssistsX 宿主有效,否则返回 null)
1363
+ */
1364
+ static async getCurrentPlugin(timeout) {
1365
+ const response = await this.asyncCall(CallMethod.getCurrentPlugin, {
1366
+ timeout
1367
+ });
1368
+ if (!response.isSuccess()) {
1369
+ return null;
1370
+ }
1371
+ const data = response.getDataOrNull();
1372
+ if (!data) {
1373
+ return null;
1374
+ }
1375
+ return PluginInfo.fromJSON(data);
1376
+ }
1171
1377
  static async getUniqueDeviceId(timeout) {
1172
1378
  const response = await this.asyncCall(CallMethod.getUniqueDeviceId, {
1173
1379
  timeout
@@ -3376,6 +3582,20 @@ var AssistsX2 = class {
3376
3582
  });
3377
3583
  return response.getDataOrDefault(false);
3378
3584
  }
3585
+ /**
3586
+ * 设置悬浮窗可获取焦点(WebView 内输入框 focus 时调用)
3587
+ * @returns 是否设置成功
3588
+ */
3589
+ static setOverlayInputFocus() {
3590
+ return this.setOverlayFlagList(WindowFlags.getOverlayInputFocusFlagList());
3591
+ }
3592
+ /**
3593
+ * 取消悬浮窗焦点(WebView 内输入框 blur 时调用)
3594
+ * @returns 是否设置成功
3595
+ */
3596
+ static clearOverlayInputFocus() {
3597
+ return this.setOverlayFlagList(WindowFlags.getOverlayInputBlurFlagList());
3598
+ }
3379
3599
  /**
3380
3600
  * 获取所有符合条件的节点
3381
3601
  * @param filterClass 类名过滤
@@ -4021,6 +4241,20 @@ var AssistsX2 = class {
4021
4241
  });
4022
4242
  return AppInfo.fromJSON(response.getDataOrDefault({}));
4023
4243
  }
4244
+ /**
4245
+ * 获取当前运行的 AssistsX 插件信息(仅 AssistsX 宿主有效,否则返回 null)
4246
+ */
4247
+ static getCurrentPlugin() {
4248
+ const response = this.call(CallMethod.getCurrentPlugin);
4249
+ if (!response.isSuccess()) {
4250
+ return null;
4251
+ }
4252
+ const data = response.getDataOrNull();
4253
+ if (!data) {
4254
+ return null;
4255
+ }
4256
+ return PluginInfo.fromJSON(data);
4257
+ }
4024
4258
  static getUniqueDeviceId() {
4025
4259
  const response = this.call(CallMethod.getUniqueDeviceId);
4026
4260
  return response.getDataOrDefault("");
@@ -4172,117 +4406,6 @@ var NodeClassValue = {
4172
4406
  FrameLayout: "android.widget.FrameLayout"
4173
4407
  };
4174
4408
 
4175
- // src/window-flags.ts
4176
- var WindowFlags = class {
4177
- // 0x1000000
4178
- /**
4179
- * 获取标志位的十六进制表示
4180
- * @param flag 标志位值
4181
- * @returns 十六进制字符串
4182
- */
4183
- static toHex(flag) {
4184
- return `0x${flag.toString(16).toUpperCase()}`;
4185
- }
4186
- /**
4187
- * 检查是否包含指定标志位
4188
- * @param flags 当前标志位组合
4189
- * @param flag 要检查的标志位
4190
- * @returns 是否包含该标志位
4191
- */
4192
- static hasFlag(flags, flag) {
4193
- return (flags & flag) === flag;
4194
- }
4195
- /**
4196
- * 添加标志位
4197
- * @param flags 当前标志位组合
4198
- * @param flag 要添加的标志位
4199
- * @returns 新的标志位组合
4200
- */
4201
- static addFlag(flags, flag) {
4202
- return flags | flag;
4203
- }
4204
- /**
4205
- * 移除标志位
4206
- * @param flags 当前标志位组合
4207
- * @param flag 要移除的标志位
4208
- * @returns 新的标志位组合
4209
- */
4210
- static removeFlag(flags, flag) {
4211
- return flags & ~flag;
4212
- }
4213
- /**
4214
- * 获取所有标志位的描述信息
4215
- * @returns 标志位描述对象数组
4216
- */
4217
- static getAllFlags() {
4218
- return [
4219
- { name: "FLAG_NOT_FOCUSABLE", value: this.FLAG_NOT_FOCUSABLE, hex: this.toHex(this.FLAG_NOT_FOCUSABLE), description: "\u4E0D\u83B7\u53D6\u7126\u70B9" },
4220
- { name: "FLAG_NOT_TOUCHABLE", value: this.FLAG_NOT_TOUCHABLE, hex: this.toHex(this.FLAG_NOT_TOUCHABLE), description: "\u4E0D\u54CD\u5E94\u89E6\u6478" },
4221
- { name: "FLAG_NOT_TOUCH_MODAL", value: this.FLAG_NOT_TOUCH_MODAL, hex: this.toHex(this.FLAG_NOT_TOUCH_MODAL), description: "\u4E0D\u62E6\u622A\u89E6\u6478" },
4222
- { name: "FLAG_WATCH_OUTSIDE_TOUCH", value: this.FLAG_WATCH_OUTSIDE_TOUCH, hex: this.toHex(this.FLAG_WATCH_OUTSIDE_TOUCH), description: "\u76D1\u542C\u7A97\u5916\u70B9\u51FB" },
4223
- { name: "FLAG_LAYOUT_NO_LIMITS", value: this.FLAG_LAYOUT_NO_LIMITS, hex: this.toHex(this.FLAG_LAYOUT_NO_LIMITS), description: "\u53EF\u7ED8\u5236\u8D85\u51FA\u5C4F\u5E55" },
4224
- { name: "FLAG_LAYOUT_IN_SCREEN", value: this.FLAG_LAYOUT_IN_SCREEN, hex: this.toHex(this.FLAG_LAYOUT_IN_SCREEN), description: "\u5C4F\u5E55\u5168\u533A\u57DF\u5E03\u5C40" },
4225
- { name: "FLAG_FULLSCREEN", value: this.FLAG_FULLSCREEN, hex: this.toHex(this.FLAG_FULLSCREEN), description: "\u5168\u5C4F\u663E\u793A" },
4226
- { name: "FLAG_DIM_BEHIND", value: this.FLAG_DIM_BEHIND, hex: this.toHex(this.FLAG_DIM_BEHIND), description: "\u80CC\u666F\u53D8\u6697" },
4227
- { name: "FLAG_SECURE", value: this.FLAG_SECURE, hex: this.toHex(this.FLAG_SECURE), description: "\u9632\u5F55\u5C4F\u9632\u622A\u56FE" },
4228
- { name: "FLAG_KEEP_SCREEN_ON", value: this.FLAG_KEEP_SCREEN_ON, hex: this.toHex(this.FLAG_KEEP_SCREEN_ON), description: "\u4FDD\u6301\u5E38\u4EAE" },
4229
- { name: "FLAG_SHOW_WHEN_LOCKED", value: this.FLAG_SHOW_WHEN_LOCKED, hex: this.toHex(this.FLAG_SHOW_WHEN_LOCKED), description: "\u9501\u5C4F\u65F6\u53EF\u89C1" },
4230
- { name: "FLAG_DISMISS_KEYGUARD", value: this.FLAG_DISMISS_KEYGUARD, hex: this.toHex(this.FLAG_DISMISS_KEYGUARD), description: "\u89E3\u9501\u5C4F\u5E55" },
4231
- { name: "FLAG_TURN_SCREEN_ON", value: this.FLAG_TURN_SCREEN_ON, hex: this.toHex(this.FLAG_TURN_SCREEN_ON), description: "\u70B9\u4EAE\u5C4F\u5E55" },
4232
- { name: "FLAG_ALLOW_LOCK_WHILE_SCREEN_ON", value: this.FLAG_ALLOW_LOCK_WHILE_SCREEN_ON, hex: this.toHex(this.FLAG_ALLOW_LOCK_WHILE_SCREEN_ON), description: "\u81EA\u52A8\u9501\u5C4F\uFF08\u4E0D\u5E38\u7528\uFF09" },
4233
- { name: "FLAG_SHOW_WALLPAPER", value: this.FLAG_SHOW_WALLPAPER, hex: this.toHex(this.FLAG_SHOW_WALLPAPER), description: "\u663E\u793A\u5899\u7EB8" },
4234
- { name: "FLAG_HARDWARE_ACCELERATED", value: this.FLAG_HARDWARE_ACCELERATED, hex: this.toHex(this.FLAG_HARDWARE_ACCELERATED), description: "\u5F3A\u5236\u786C\u4EF6\u52A0\u901F" }
4235
- ];
4236
- }
4237
- };
4238
- /** 不获取焦点 */
4239
- WindowFlags.FLAG_NOT_FOCUSABLE = 8;
4240
- // 0x08
4241
- /** 不响应触摸 */
4242
- WindowFlags.FLAG_NOT_TOUCHABLE = 16;
4243
- // 0x10
4244
- /** 不拦截触摸 */
4245
- WindowFlags.FLAG_NOT_TOUCH_MODAL = 32;
4246
- // 0x20
4247
- /** 监听窗外点击 */
4248
- WindowFlags.FLAG_WATCH_OUTSIDE_TOUCH = 4;
4249
- // 0x04
4250
- /** 可绘制超出屏幕 */
4251
- WindowFlags.FLAG_LAYOUT_NO_LIMITS = 512;
4252
- // 0x200
4253
- /** 屏幕全区域布局 */
4254
- WindowFlags.FLAG_LAYOUT_IN_SCREEN = 256;
4255
- // 0x100
4256
- /** 全屏显示 */
4257
- WindowFlags.FLAG_FULLSCREEN = 1024;
4258
- // 0x400
4259
- /** 背景变暗 */
4260
- WindowFlags.FLAG_DIM_BEHIND = 2;
4261
- // 0x02
4262
- /** 防录屏防截图 */
4263
- WindowFlags.FLAG_SECURE = 8192;
4264
- // 0x2000
4265
- /** 保持常亮 */
4266
- WindowFlags.FLAG_KEEP_SCREEN_ON = 128;
4267
- // 0x80
4268
- /** 锁屏时可见 */
4269
- WindowFlags.FLAG_SHOW_WHEN_LOCKED = 524288;
4270
- // 0x80000
4271
- /** 解锁屏幕 */
4272
- WindowFlags.FLAG_DISMISS_KEYGUARD = 4194304;
4273
- // 0x400000
4274
- /** 点亮屏幕 */
4275
- WindowFlags.FLAG_TURN_SCREEN_ON = 2097152;
4276
- // 0x200000
4277
- /** 自动锁屏(不常用) */
4278
- WindowFlags.FLAG_ALLOW_LOCK_WHILE_SCREEN_ON = 128;
4279
- // 0x80
4280
- /** 显示墙纸 */
4281
- WindowFlags.FLAG_SHOW_WALLPAPER = 1048576;
4282
- // 0x100000
4283
- /** 强制硬件加速 */
4284
- WindowFlags.FLAG_HARDWARE_ACCELERATED = 16777216;
4285
-
4286
4409
  // src/accessibility-event-filter.ts
4287
4410
  var AccessibilityEventFilter = class _AccessibilityEventFilter {
4288
4411
  constructor(config = {}) {
@@ -7075,6 +7198,342 @@ var Mlkit = class {
7075
7198
  };
7076
7199
  var mlkit = new Mlkit();
7077
7200
 
7201
+ // src/screenshot/screenshot-call-method.ts
7202
+ var ScreenshotCallMethod = {
7203
+ /** 截取全屏并返回 Base64 */
7204
+ takeScreenshotBase64: "takeScreenshotBase64",
7205
+ /** 截取指定节点区域并返回 Base64,需传 node.nodeId */
7206
+ takeNodeScreenshotBase64: "takeNodeScreenshotBase64",
7207
+ /** 批量截取节点区域并返回 Base64 数组,nodes 为空时返回全屏 */
7208
+ takeScreenshotNodesBase64: "takeScreenshotNodesBase64"
7209
+ };
7210
+
7211
+ // src/screenshot/screenshot.ts
7212
+ var callbacks10 = /* @__PURE__ */ new Map();
7213
+ if (typeof window !== "undefined" && !window.assistsxScreenshotCallback) {
7214
+ window.assistsxScreenshotCallback = (data) => {
7215
+ let callbackId;
7216
+ try {
7217
+ const json = decodeBase64UTF8(data);
7218
+ const response = JSON.parse(json);
7219
+ callbackId = response.callbackId;
7220
+ if (callbackId) {
7221
+ const callback = callbacks10.get(callbackId);
7222
+ if (callback) {
7223
+ callback(json);
7224
+ }
7225
+ }
7226
+ } catch (e) {
7227
+ console.error("Screenshot callback error:", e);
7228
+ } finally {
7229
+ if (callbackId) {
7230
+ callbacks10.delete(callbackId);
7231
+ }
7232
+ }
7233
+ };
7234
+ }
7235
+ function createNodeStub(nodeId) {
7236
+ return { nodeId };
7237
+ }
7238
+ function parseScreenshotBase64Data(data) {
7239
+ if (!data || typeof data !== "object") {
7240
+ return null;
7241
+ }
7242
+ const record = data;
7243
+ const base64 = typeof record.base64 === "string" ? record.base64 : "";
7244
+ const mimeType = typeof record.mimeType === "string" ? record.mimeType : "image/png";
7245
+ const dataUrl = typeof record.dataUrl === "string" ? record.dataUrl : `data:${mimeType};base64,${base64}`;
7246
+ if (!base64) {
7247
+ return null;
7248
+ }
7249
+ return { base64, dataUrl, mimeType };
7250
+ }
7251
+ var Screenshot = class {
7252
+ /**
7253
+ * 执行异步调用
7254
+ */
7255
+ async asyncCall(method, {
7256
+ args,
7257
+ node,
7258
+ nodes,
7259
+ timeout = 30
7260
+ } = {}) {
7261
+ const uuid = generateUUID();
7262
+ const params = {
7263
+ method,
7264
+ arguments: args ? args : void 0,
7265
+ node: node ? node : void 0,
7266
+ nodes: nodes ? nodes : void 0,
7267
+ callbackId: uuid
7268
+ };
7269
+ const promise = new Promise((resolve) => {
7270
+ callbacks10.set(uuid, (data) => {
7271
+ resolve(data);
7272
+ });
7273
+ setTimeout(() => {
7274
+ callbacks10.delete(uuid);
7275
+ resolve(JSON.stringify(new CallResponse(0, null, uuid)));
7276
+ }, timeout * 1e3);
7277
+ });
7278
+ window.assistsxScreenshot.call(JSON.stringify(params));
7279
+ const promiseResult = await promise;
7280
+ if (typeof promiseResult === "string") {
7281
+ const responseData = JSON.parse(promiseResult);
7282
+ return new CallResponse(
7283
+ responseData.code,
7284
+ responseData.data,
7285
+ responseData.callbackId
7286
+ );
7287
+ }
7288
+ throw new Error("Screenshot call failed");
7289
+ }
7290
+ buildScreenshotArgs(options = {}) {
7291
+ const {
7292
+ overlayHiddenScreenshotDelayMillis = 250,
7293
+ format = "PNG",
7294
+ withDataUrlPrefix = true
7295
+ } = options;
7296
+ return {
7297
+ overlayHiddenScreenshotDelayMillis,
7298
+ format,
7299
+ withDataUrlPrefix
7300
+ };
7301
+ }
7302
+ /**
7303
+ * 截取全屏并返回 Base64
7304
+ */
7305
+ async takeScreenshotBase64(options = {}) {
7306
+ const { timeout = 30, ...rest } = options;
7307
+ const response = await this.asyncCall(ScreenshotCallMethod.takeScreenshotBase64, {
7308
+ args: this.buildScreenshotArgs(rest),
7309
+ timeout
7310
+ });
7311
+ if (!response.isSuccess()) {
7312
+ return null;
7313
+ }
7314
+ return parseScreenshotBase64Data(response.getDataOrNull());
7315
+ }
7316
+ /**
7317
+ * 截取指定节点区域并返回 Base64
7318
+ */
7319
+ async takeNodeScreenshotBase64(nodeId, options = {}) {
7320
+ if (!nodeId) {
7321
+ throw new Error("nodeId is required");
7322
+ }
7323
+ const { timeout = 30, ...rest } = options;
7324
+ const response = await this.asyncCall(ScreenshotCallMethod.takeNodeScreenshotBase64, {
7325
+ args: this.buildScreenshotArgs(rest),
7326
+ node: createNodeStub(nodeId),
7327
+ timeout
7328
+ });
7329
+ if (!response.isSuccess()) {
7330
+ return null;
7331
+ }
7332
+ return parseScreenshotBase64Data(response.getDataOrNull());
7333
+ }
7334
+ /**
7335
+ * 批量截取节点区域;nodeIds 为空时返回全屏截图
7336
+ */
7337
+ async takeScreenshotNodesBase64(nodeIds = [], options = {}) {
7338
+ const { timeout = 30, ...rest } = options;
7339
+ const nodes = nodeIds.map((nodeId) => createNodeStub(nodeId));
7340
+ const response = await this.asyncCall(ScreenshotCallMethod.takeScreenshotNodesBase64, {
7341
+ args: this.buildScreenshotArgs(rest),
7342
+ nodes,
7343
+ timeout
7344
+ });
7345
+ if (!response.isSuccess()) {
7346
+ return [];
7347
+ }
7348
+ const data = response.getDataOrNull();
7349
+ return Array.isArray(data == null ? void 0 : data.images) ? data.images : [];
7350
+ }
7351
+ };
7352
+ var screenshot = new Screenshot();
7353
+
7354
+ // src/db/db-call-method.ts
7355
+ var DbCallMethod = {
7356
+ exec: "exec",
7357
+ query: "query",
7358
+ execBatch: "execBatch",
7359
+ close: "close"
7360
+ };
7361
+
7362
+ // src/db/db.ts
7363
+ var callbacks11 = /* @__PURE__ */ new Map();
7364
+ if (typeof window !== "undefined" && !window.assistsxDbCallback) {
7365
+ window.assistsxDbCallback = (data) => {
7366
+ let callbackId;
7367
+ try {
7368
+ const json = decodeBase64UTF8(data);
7369
+ const response = JSON.parse(json);
7370
+ callbackId = response.callbackId;
7371
+ if (callbackId) {
7372
+ const callback = callbacks11.get(callbackId);
7373
+ if (callback) {
7374
+ callback(json);
7375
+ }
7376
+ }
7377
+ } catch (e) {
7378
+ console.error("Db callback error:", e);
7379
+ } finally {
7380
+ if (callbackId) {
7381
+ callbacks11.delete(callbackId);
7382
+ }
7383
+ }
7384
+ };
7385
+ }
7386
+ function buildDbArguments(target, extra) {
7387
+ const args = { ...extra };
7388
+ if (target.dbPath) {
7389
+ args.dbPath = target.dbPath;
7390
+ }
7391
+ if (target.dbName) {
7392
+ args.dbName = target.dbName;
7393
+ }
7394
+ return args;
7395
+ }
7396
+ function normalizeBindArgs(bindArgs) {
7397
+ if (!bindArgs || bindArgs.length === 0) {
7398
+ return void 0;
7399
+ }
7400
+ return bindArgs.map((value) => {
7401
+ if (value === null) {
7402
+ return null;
7403
+ }
7404
+ return String(value);
7405
+ });
7406
+ }
7407
+ function parseExecResult(data) {
7408
+ var _a2, _b;
7409
+ const record = data != null ? data : {};
7410
+ return {
7411
+ rowsAffected: Number((_a2 = record.rowsAffected) != null ? _a2 : 0),
7412
+ lastInsertRowId: Number((_b = record.lastInsertRowId) != null ? _b : 0)
7413
+ };
7414
+ }
7415
+ function parseQueryResult(data) {
7416
+ var _a2;
7417
+ const record = data != null ? data : {};
7418
+ const columns = Array.isArray(record.columns) ? record.columns.map((item) => String(item)) : [];
7419
+ const rows = Array.isArray(record.rows) ? record.rows : [];
7420
+ return {
7421
+ columns,
7422
+ rows,
7423
+ rowCount: Number((_a2 = record.rowCount) != null ? _a2 : rows.length)
7424
+ };
7425
+ }
7426
+ function parseExecBatchResult(data) {
7427
+ var _a2;
7428
+ const record = data != null ? data : {};
7429
+ const results = Array.isArray(record.results) ? record.results.map((item) => parseExecResult(item)) : [];
7430
+ return {
7431
+ count: Number((_a2 = record.count) != null ? _a2 : results.length),
7432
+ results
7433
+ };
7434
+ }
7435
+ var Db = class {
7436
+ /**
7437
+ * 执行异步调用
7438
+ */
7439
+ async asyncCall(method, args, timeout = 30) {
7440
+ const uuid = generateUUID();
7441
+ const params = {
7442
+ method,
7443
+ arguments: args ? args : void 0,
7444
+ callbackId: uuid
7445
+ };
7446
+ const promise = new Promise((resolve) => {
7447
+ callbacks11.set(uuid, (data) => {
7448
+ resolve(data);
7449
+ });
7450
+ setTimeout(() => {
7451
+ callbacks11.delete(uuid);
7452
+ resolve(JSON.stringify(new CallResponse(0, null, uuid)));
7453
+ }, timeout * 1e3);
7454
+ });
7455
+ window.assistsxDb.call(JSON.stringify(params));
7456
+ const promiseResult = await promise;
7457
+ if (typeof promiseResult !== "string") {
7458
+ throw new Error("Db call failed");
7459
+ }
7460
+ const responseData = JSON.parse(promiseResult);
7461
+ if (responseData.code !== 0) {
7462
+ throw new Error(responseData.message || "Db call failed");
7463
+ }
7464
+ return new CallResponse(
7465
+ responseData.code,
7466
+ responseData.data,
7467
+ responseData.callbackId
7468
+ );
7469
+ }
7470
+ /**
7471
+ * 将 query 结果中的 Base64 BLOB 字段解码为 Uint8Array
7472
+ */
7473
+ decodeBlobBase64(base64) {
7474
+ const binary = atob(base64);
7475
+ const bytes = new Uint8Array(binary.length);
7476
+ for (let i = 0; i < binary.length; i++) {
7477
+ bytes[i] = binary.charCodeAt(i);
7478
+ }
7479
+ return bytes;
7480
+ }
7481
+ /**
7482
+ * 执行非查询 SQL
7483
+ */
7484
+ async exec(sql, options) {
7485
+ const { timeout = 30, bindArgs, ...target } = options;
7486
+ const response = await this.asyncCall(
7487
+ DbCallMethod.exec,
7488
+ buildDbArguments(target, {
7489
+ sql,
7490
+ bindArgs: normalizeBindArgs(bindArgs)
7491
+ }),
7492
+ timeout
7493
+ );
7494
+ return parseExecResult(response.getDataOrNull());
7495
+ }
7496
+ /**
7497
+ * 执行查询 SQL
7498
+ */
7499
+ async query(sql, options) {
7500
+ const { timeout = 30, bindArgs, ...target } = options;
7501
+ const response = await this.asyncCall(
7502
+ DbCallMethod.query,
7503
+ buildDbArguments(target, {
7504
+ sql,
7505
+ bindArgs: normalizeBindArgs(bindArgs)
7506
+ }),
7507
+ timeout
7508
+ );
7509
+ return parseQueryResult(response.getDataOrNull());
7510
+ }
7511
+ /**
7512
+ * 事务内批量执行多条 SQL
7513
+ */
7514
+ async execBatch(statements, options) {
7515
+ const { timeout = 30, ...target } = options;
7516
+ const response = await this.asyncCall(
7517
+ DbCallMethod.execBatch,
7518
+ buildDbArguments(target, { statements }),
7519
+ timeout
7520
+ );
7521
+ return parseExecBatchResult(response.getDataOrNull());
7522
+ }
7523
+ /**
7524
+ * 关闭并释放指定数据库连接
7525
+ */
7526
+ async close(options) {
7527
+ const { timeout = 30, ...target } = options;
7528
+ await this.asyncCall(
7529
+ DbCallMethod.close,
7530
+ buildDbArguments(target),
7531
+ timeout
7532
+ );
7533
+ }
7534
+ };
7535
+ var db = new Db();
7536
+
7078
7537
  // src/barutils/bar-utils-call-method.ts
7079
7538
  var BarUtilsCallMethod = {
7080
7539
  // Status bar
@@ -7100,7 +7559,7 @@ var BarUtilsCallMethod = {
7100
7559
  };
7101
7560
 
7102
7561
  // src/barutils/bar-utils.ts
7103
- var callbacks10 = /* @__PURE__ */ new Map();
7562
+ var callbacks12 = /* @__PURE__ */ new Map();
7104
7563
  if (typeof window !== "undefined" && !window.assistsxBarUtilsCallback) {
7105
7564
  window.assistsxBarUtilsCallback = (data) => {
7106
7565
  let callbackId;
@@ -7109,7 +7568,7 @@ if (typeof window !== "undefined" && !window.assistsxBarUtilsCallback) {
7109
7568
  const response = JSON.parse(json);
7110
7569
  callbackId = response.callbackId;
7111
7570
  if (callbackId) {
7112
- const callback = callbacks10.get(callbackId);
7571
+ const callback = callbacks12.get(callbackId);
7113
7572
  if (callback) {
7114
7573
  callback(json);
7115
7574
  }
@@ -7118,7 +7577,7 @@ if (typeof window !== "undefined" && !window.assistsxBarUtilsCallback) {
7118
7577
  console.error("BarUtils callback error:", e);
7119
7578
  } finally {
7120
7579
  if (callbackId) {
7121
- callbacks10.delete(callbackId);
7580
+ callbacks12.delete(callbackId);
7122
7581
  }
7123
7582
  }
7124
7583
  };
@@ -7132,11 +7591,11 @@ var BarUtils = class {
7132
7591
  callbackId: uuid
7133
7592
  };
7134
7593
  const promise = new Promise((resolve) => {
7135
- callbacks10.set(uuid, (data) => {
7594
+ callbacks12.set(uuid, (data) => {
7136
7595
  resolve(data);
7137
7596
  });
7138
7597
  setTimeout(() => {
7139
- callbacks10.delete(uuid);
7598
+ callbacks12.delete(uuid);
7140
7599
  resolve(
7141
7600
  JSON.stringify(
7142
7601
  new CallResponse(-1, { message: "Timeout" }, uuid)
@@ -7417,7 +7876,7 @@ var FloatCallMethod = {
7417
7876
  };
7418
7877
 
7419
7878
  // src/floatingwindow/float.ts
7420
- var callbacks11 = /* @__PURE__ */ new Map();
7879
+ var callbacks13 = /* @__PURE__ */ new Map();
7421
7880
  if (typeof window !== "undefined" && !window.assistsxFloatCallback) {
7422
7881
  window.assistsxFloatCallback = (data) => {
7423
7882
  let callbackId;
@@ -7426,7 +7885,7 @@ if (typeof window !== "undefined" && !window.assistsxFloatCallback) {
7426
7885
  const response = JSON.parse(json);
7427
7886
  callbackId = response.callbackId;
7428
7887
  if (callbackId) {
7429
- const callback = callbacks11.get(callbackId);
7888
+ const callback = callbacks13.get(callbackId);
7430
7889
  if (callback) {
7431
7890
  callback(json);
7432
7891
  }
@@ -7435,7 +7894,7 @@ if (typeof window !== "undefined" && !window.assistsxFloatCallback) {
7435
7894
  console.error("Float callback error:", e);
7436
7895
  } finally {
7437
7896
  if (callbackId) {
7438
- callbacks11.delete(callbackId);
7897
+ callbacks13.delete(callbackId);
7439
7898
  }
7440
7899
  }
7441
7900
  };
@@ -7449,11 +7908,11 @@ var Float = class {
7449
7908
  callbackId: uuid
7450
7909
  };
7451
7910
  const promise = new Promise((resolve) => {
7452
- callbacks11.set(uuid, (data) => {
7911
+ callbacks13.set(uuid, (data) => {
7453
7912
  resolve(data);
7454
7913
  });
7455
7914
  setTimeout(() => {
7456
- callbacks11.delete(uuid);
7915
+ callbacks13.delete(uuid);
7457
7916
  resolve(
7458
7917
  JSON.stringify(
7459
7918
  new CallResponse(-1, { message: "Timeout" }, uuid)
@@ -7615,7 +8074,9 @@ var LogCallMethod = {
7615
8074
  unsubscribe: "unsubscribe",
7616
8075
  uploadLogs: "uploadLogs",
7617
8076
  /** 获取日志服务当前域名(origin,无路径;与上传、管理后台同源),对应 AssistsLogDiagnostics.adminWebBaseUrl() */
7618
- getLogServiceBaseUrl: "getLogServiceBaseUrl"
8077
+ getLogServiceBaseUrl: "getLogServiceBaseUrl",
8078
+ /** 解析日志文件绝对路径(不创建文件) */
8079
+ resolveLogPath: "resolveLogPath"
7619
8080
  };
7620
8081
  var LogStream = {
7621
8082
  latestLine: "latestLine",
@@ -7626,6 +8087,26 @@ var LogStream = {
7626
8087
  var pendingCallbacks = /* @__PURE__ */ new Map();
7627
8088
  var streamHandlers = /* @__PURE__ */ new Map();
7628
8089
  var subscriptionIdToCallbackId = /* @__PURE__ */ new Map();
8090
+ function buildLogArguments(target, extra) {
8091
+ const args = { ...extra };
8092
+ if ((target == null ? void 0 : target.dirPath) !== void 0) {
8093
+ args.dirPath = target.dirPath;
8094
+ }
8095
+ if ((target == null ? void 0 : target.fileName) !== void 0) {
8096
+ args.fileName = target.fileName;
8097
+ }
8098
+ return Object.keys(args).length > 0 ? args : void 0;
8099
+ }
8100
+ function resolveTimeout(timeoutOrOptions, fallback = 30) {
8101
+ var _a2;
8102
+ if (typeof timeoutOrOptions === "number") {
8103
+ return { timeout: timeoutOrOptions };
8104
+ }
8105
+ return {
8106
+ timeout: (_a2 = timeoutOrOptions == null ? void 0 : timeoutOrOptions.timeout) != null ? _a2 : fallback,
8107
+ target: timeoutOrOptions
8108
+ };
8109
+ }
7629
8110
  if (typeof window !== "undefined" && !window.assistsxLogCallback) {
7630
8111
  window.assistsxLogCallback = (data) => {
7631
8112
  try {
@@ -7701,11 +8182,12 @@ var Log = class {
7701
8182
  throw new Error("Log bridge call failed");
7702
8183
  }
7703
8184
  /** 读取当前日志全文 */
7704
- async readAllText(timeout) {
8185
+ async readAllText(timeoutOrOptions) {
7705
8186
  var _a2;
8187
+ const { timeout, target } = resolveTimeout(timeoutOrOptions);
7706
8188
  const res = await this.asyncCall(
7707
8189
  LogCallMethod.readAllText,
7708
- void 0,
8190
+ buildLogArguments(target),
7709
8191
  timeout
7710
8192
  );
7711
8193
  const d = res.getDataOrNull();
@@ -7725,42 +8207,69 @@ var Log = class {
7725
8207
  const d = res.getDataOrNull();
7726
8208
  return (_a2 = d == null ? void 0 : d.baseUrl) != null ? _a2 : "";
7727
8209
  }
8210
+ /**
8211
+ * 解析日志文件绝对路径(不创建文件)。
8212
+ * AssistsX 插件环境下会经原生拦截追加 log-{packageName} 子目录。
8213
+ */
8214
+ async resolveLogPath(targetOrOptions) {
8215
+ var _a2;
8216
+ const { timeout, target } = resolveTimeout(targetOrOptions);
8217
+ const res = await this.asyncCall(
8218
+ LogCallMethod.resolveLogPath,
8219
+ buildLogArguments(target),
8220
+ timeout
8221
+ );
8222
+ const d = res.getDataOrNull();
8223
+ return (_a2 = d == null ? void 0 : d.logFilePath) != null ? _a2 : "";
8224
+ }
7728
8225
  /** 清空日志 */
7729
- async clear(timeout) {
8226
+ async clear(timeoutOrOptions) {
8227
+ const { timeout, target } = resolveTimeout(timeoutOrOptions);
7730
8228
  const res = await this.asyncCall(
7731
8229
  LogCallMethod.clear,
7732
- void 0,
8230
+ buildLogArguments(target),
7733
8231
  timeout
7734
8232
  );
7735
8233
  return res.isSuccess();
7736
8234
  }
7737
8235
  /** 从文件重新加载到内存 Flow */
7738
- async refreshFromFile(timeout) {
8236
+ async refreshFromFile(timeoutOrOptions) {
8237
+ const { timeout, target } = resolveTimeout(timeoutOrOptions);
7739
8238
  const res = await this.asyncCall(
7740
8239
  LogCallMethod.refreshFromFile,
7741
- void 0,
8240
+ buildLogArguments(target),
7742
8241
  timeout
7743
8242
  );
7744
8243
  return res.isSuccess();
7745
8244
  }
7746
8245
  /** 追加一行 */
7747
- async appendLine(line, maxLength, timeout) {
7748
- const args = { line };
7749
- if (maxLength !== void 0) {
7750
- args.maxLength = maxLength;
8246
+ async appendLine(line, maxLengthOrOptions, timeout) {
8247
+ var _a2;
8248
+ let options;
8249
+ if (typeof maxLengthOrOptions === "number") {
8250
+ options = { maxLength: maxLengthOrOptions, timeout };
8251
+ } else {
8252
+ options = maxLengthOrOptions;
8253
+ }
8254
+ const args = (_a2 = buildLogArguments(options, { line })) != null ? _a2 : { line };
8255
+ if ((options == null ? void 0 : options.maxLength) !== void 0) {
8256
+ args.maxLength = options.maxLength;
7751
8257
  }
7752
8258
  const res = await this.asyncCall(
7753
8259
  LogCallMethod.appendLine,
7754
8260
  args,
7755
- timeout
8261
+ options == null ? void 0 : options.timeout
7756
8262
  );
7757
8263
  return res.isSuccess();
7758
8264
  }
7759
8265
  /** 追加带时间戳的条目 */
7760
- async appendTimestampedEntry(message, timeout) {
8266
+ async appendTimestampedEntry(message, timeoutOrOptions) {
8267
+ var _a2;
8268
+ const { timeout, target } = resolveTimeout(timeoutOrOptions);
8269
+ const args = (_a2 = buildLogArguments(target, { message })) != null ? _a2 : { message };
7761
8270
  const res = await this.asyncCall(
7762
8271
  LogCallMethod.appendTimestampedEntry,
7763
- { message },
8272
+ args,
7764
8273
  timeout
7765
8274
  );
7766
8275
  return res.isSuccess();
@@ -7770,17 +8279,20 @@ var Log = class {
7770
8279
  * 默认带时间戳;`timestamped: false` 时走 appendLine。
7771
8280
  */
7772
8281
  async append(text, options) {
7773
- const { timestamped = true, maxLength, timeout } = options != null ? options : {};
8282
+ const { timestamped = true, maxLength, timeout, ...target } = options != null ? options : {};
7774
8283
  if (timestamped) {
7775
- return this.appendTimestampedEntry(text, timeout);
8284
+ return this.appendTimestampedEntry(text, { ...target, timeout });
7776
8285
  }
7777
- return this.appendLine(text, maxLength, timeout);
8286
+ return this.appendLine(text, { ...target, maxLength, timeout });
7778
8287
  }
7779
8288
  /** 替换全部内容 */
7780
- async replaceAll(content, timeout) {
8289
+ async replaceAll(content, timeoutOrOptions) {
8290
+ var _a2;
8291
+ const { timeout, target } = resolveTimeout(timeoutOrOptions);
8292
+ const args = (_a2 = buildLogArguments(target, { content })) != null ? _a2 : { content };
7781
8293
  const res = await this.asyncCall(
7782
8294
  LogCallMethod.replaceAll,
7783
- { content },
8295
+ args,
7784
8296
  timeout
7785
8297
  );
7786
8298
  return res.isSuccess();
@@ -7790,10 +8302,11 @@ var Log = class {
7790
8302
  * resolve 后请保留 dispose 或调用 unsubscribe(subscriptionId) 以释放原生协程与 JS 回调。
7791
8303
  */
7792
8304
  async subscribe(stream, onUpdate, options) {
7793
- var _a2;
8305
+ var _a2, _b;
7794
8306
  const self = this;
7795
8307
  const callbackId = generateUUID();
7796
8308
  const timeoutSec = (_a2 = options == null ? void 0 : options.timeout) != null ? _a2 : 30;
8309
+ const subscribeArgs = (_b = buildLogArguments(options, { stream })) != null ? _b : { stream };
7797
8310
  return new Promise((resolve, reject) => {
7798
8311
  let settled = false;
7799
8312
  const timer = setTimeout(() => {
@@ -7804,7 +8317,7 @@ var Log = class {
7804
8317
  }
7805
8318
  }, timeoutSec * 1e3);
7806
8319
  streamHandlers.set(callbackId, (raw) => {
7807
- var _a3, _b, _c;
8320
+ var _a3, _b2, _c;
7808
8321
  let response;
7809
8322
  try {
7810
8323
  response = JSON.parse(raw);
@@ -7843,9 +8356,10 @@ var Log = class {
7843
8356
  }
7844
8357
  if ((data == null ? void 0 : data.event) === "update" && data.subscriptionId) {
7845
8358
  onUpdate({
7846
- text: (_b = data.text) != null ? _b : "",
8359
+ text: (_b2 = data.text) != null ? _b2 : "",
7847
8360
  stream: (_c = data.stream) != null ? _c : stream,
7848
- subscriptionId: data.subscriptionId
8361
+ subscriptionId: data.subscriptionId,
8362
+ logFilePath: data.logFilePath
7849
8363
  });
7850
8364
  }
7851
8365
  });
@@ -7853,7 +8367,7 @@ var Log = class {
7853
8367
  this.getBridge().call(
7854
8368
  JSON.stringify({
7855
8369
  method: LogCallMethod.subscribe,
7856
- arguments: { stream },
8370
+ arguments: subscribeArgs,
7857
8371
  callbackId
7858
8372
  })
7859
8373
  );
@@ -7897,6 +8411,12 @@ var Log = class {
7897
8411
  if (args.uploadKey !== void 0) {
7898
8412
  payload.uploadKey = args.uploadKey;
7899
8413
  }
8414
+ if (args.dirPath !== void 0) {
8415
+ payload.dirPath = args.dirPath;
8416
+ }
8417
+ if (args.fileName !== void 0) {
8418
+ payload.fileName = args.fileName;
8419
+ }
7900
8420
  const uuid = generateUUID();
7901
8421
  const params = {
7902
8422
  method: LogCallMethod.uploadLogs,
@@ -7951,6 +8471,8 @@ export {
7951
8471
  Bounds,
7952
8472
  CallMethod,
7953
8473
  CallResponse,
8474
+ Db,
8475
+ DbCallMethod,
7954
8476
  DeviceInfo,
7955
8477
  FileIO,
7956
8478
  FileUtils,
@@ -7972,6 +8494,9 @@ export {
7972
8494
  NodeAsync,
7973
8495
  NodeClassValue,
7974
8496
  Path,
8497
+ PluginInfo,
8498
+ Screenshot,
8499
+ ScreenshotCallMethod,
7975
8500
  Step,
7976
8501
  StepAsync,
7977
8502
  StepError,
@@ -7980,6 +8505,7 @@ export {
7980
8505
  accessibilityEventListeners,
7981
8506
  barUtils,
7982
8507
  callbacks,
8508
+ db,
7983
8509
  decodeBase64UTF8,
7984
8510
  ensureAssistsXPinia,
7985
8511
  fileIO,
@@ -7995,6 +8521,7 @@ export {
7995
8521
  mlkit,
7996
8522
  pathUtils,
7997
8523
  screen,
8524
+ screenshot,
7998
8525
  sleep,
7999
8526
  useStepStore
8000
8527
  };