node-karin 1.12.0 → 1.12.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/CHANGELOG.md CHANGED
@@ -1,5 +1,19 @@
1
1
  # 更新日志
2
2
 
3
+ ## [1.12.2](https://github.com/KarinJS/Karin/compare/core-v1.12.1...core-v1.12.2) (2025-10-20)
4
+
5
+
6
+ ### 🐛 Bug Fixes
7
+
8
+ * **update:** 增强版本比较功能,支持严格语义化版本模式 ([#568](https://github.com/KarinJS/Karin/issues/568)) ([da3843a](https://github.com/KarinJS/Karin/commit/da3843ae3c770b308583d9b0671d4dbd36ce37ec))
9
+
10
+ ## [1.12.1](https://github.com/KarinJS/Karin/compare/core-v1.12.0...core-v1.12.1) (2025-10-17)
11
+
12
+
13
+ ### 🐛 Bug Fixes
14
+
15
+ * Support all semantic versioning formats in changelog parser ([#566](https://github.com/KarinJS/Karin/issues/566)) ([de6b397](https://github.com/KarinJS/Karin/commit/de6b397ebb9fdba85d8b5999a96ed29bb1da9dd8))
16
+
3
17
  ## [1.12.0](https://github.com/KarinJS/Karin/compare/core-v1.11.6...core-v1.12.0) (2025-10-15)
4
18
 
5
19
 
package/dist/index.d.ts CHANGED
@@ -10,7 +10,7 @@ import { Readable } from 'node:stream';
10
10
  import { AxiosRequestConfig, AxiosResponse } from 'axios';
11
11
  import YAML from 'yaml';
12
12
  import { FSWatcher } from 'chokidar';
13
- import { exec as exec$2, ExecException as ExecException$1 } from 'node:child_process';
13
+ import { ExecException as ExecException$1, exec as exec$2 } from 'node:child_process';
14
14
  import { Request as Request$1, Router, Response, RequestHandler, Express } from 'express';
15
15
  import { exec as exec$1, ExecException } from 'child_process';
16
16
  export { ExecException } from 'child_process';
@@ -8325,38 +8325,298 @@ declare const lock: {
8325
8325
  };
8326
8326
  };
8327
8327
 
8328
+ /** 版本号对比模式 */
8329
+ type CompareMode = {
8330
+ /**
8331
+ * 版本号对比模式,怎么对比才算是有更新
8332
+ *
8333
+ * **xyz 模式(默认)**
8334
+ * - 只看前三段数字 `X.Y.Z`,忽略预发布/构建后缀。
8335
+ * - 示例:
8336
+ * - 本地 `2.6.7`,远程 `2.6.8` → 有更新
8337
+ * - 本地 `2.6.7-beta.1`,远程 `2.6.7` → 无更新(都视为 `2.6.7`)
8338
+ * - 本地 `1.0.0+20230101`,远程 `1.0.1` → 有更新(只看 `1.0.0` vs `1.0.1`)
8339
+ * - 本地 `3.2.0-rc.3`,远程 `3.2.0` → 无更新(都视为 `3.2.0`)
8340
+ *
8341
+ * **semver 模式(语义化版本)**
8342
+ * - 严格遵循 [SemVer](https://semver.org/) 规则。
8343
+ * - 示例:
8344
+ * - 本地 `2.6.7-beta.1`,远程 `2.6.6` → 本地更高,已最新,不提示升级
8345
+ * - 本地 `1.0.0-alpha`,远程 `1.0.0` → 远程更高,提示升级
8346
+ * - 本地 `1.0.0+20230101`,远程 `1.0.0` → 仅比较版本核心,不比较构建元数据,视为相同
8347
+ * - 本地 `2.0.0-beta.2`,远程 `2.0.0-beta.10` → 远程更高,提示升级(按预发布号逐段比较)
8348
+ * - 本地 `3.1.0-rc.1`,远程 `3.1.0` → 远程更高,提示升级(稳定版 > 预发布)
8349
+ *
8350
+ * @default 'xyz'
8351
+ */
8352
+ compare?: 'xyz' | 'semver';
8353
+ };
8354
+ /**
8355
+ * @description 传入npm包名 检查是否存在更新
8356
+ * @param name 包名
8357
+ * @param opts 额外参数
8358
+ * @returns 是否存在更新 true: 存在更新 false: 无更新
8359
+ */
8360
+ declare const checkPkgUpdate: (name: string, opts?: CompareMode) => Promise<{
8361
+ /** 存在更新 */
8362
+ status: "yes";
8363
+ /** 本地版本号 */
8364
+ local: string;
8365
+ /** 远程版本号 */
8366
+ remote: string;
8367
+ } | {
8368
+ /** 无更新 */
8369
+ status: "no";
8370
+ /** 本地版本号 */
8371
+ local: string;
8372
+ } | {
8373
+ /** 检查发生错误 */
8374
+ status: "error";
8375
+ /** 错误信息 */
8376
+ error: Error;
8377
+ }>;
8378
+ /**
8379
+ * @description 获取指定包的本地版本号 如果获取失败则会获取package.json中的版本号
8380
+ * @param name 包名
8381
+ */
8382
+ declare const getPkgVersion: (name: string) => Promise<string>;
8383
+ /**
8384
+ * @description 获取指定包的远程版本号
8385
+ * @param name 包名
8386
+ * @param tag 标签,默认为 `latest`
8387
+ */
8388
+ declare const getRemotePkgVersion: (name: string, tag?: string) => Promise<string>;
8389
+ /**
8390
+ * @description 更新指定的npm插件
8391
+ * @param name 包名
8392
+ * @param tag 标签 默认 `latest`
8393
+ */
8394
+ declare const updatePkg: (name: string, tag?: string) => Promise<{
8395
+ /** 更新失败 */
8396
+ status: "failed";
8397
+ /** 更新失败信息 */
8398
+ data: string | ExecException$1;
8399
+ } | {
8400
+ /** 更新成功 */
8401
+ status: "ok";
8402
+ /** 更新成功信息 */
8403
+ data: string;
8404
+ /** 本地版本号 */
8405
+ local: string;
8406
+ /** 远程版本号 */
8407
+ remote: string;
8408
+ }>;
8409
+ /**
8410
+ * @description 更新全部npm插件
8411
+ */
8412
+ declare const updateAllPkg: () => Promise<string>;
8413
+ /**
8414
+ * @description 检查git插件是否有更新
8415
+ * @param filePath 插件路径
8416
+ * @param time 任务执行超时时间 默认120s
8417
+ */
8418
+ declare const checkGitPluginUpdate: (filePath: string, time?: number) => Promise<{
8419
+ /** 存在更新 */
8420
+ status: "yes";
8421
+ /** 更新内容 */
8422
+ data: string;
8423
+ /** 落后次数 */
8424
+ count: number;
8425
+ } | {
8426
+ /** 无更新 */
8427
+ status: "no";
8428
+ /** 最后更新时间描述 */
8429
+ data: string;
8430
+ } | {
8431
+ /** 检查发生错误 */
8432
+ status: "error";
8433
+ data: Error;
8434
+ }>;
8435
+ /**
8436
+ * @description 获取指定仓库的提交记录
8437
+ * @param options 参数
8438
+ * @returns 提交记录
8439
+ */
8440
+ declare const getCommit: (options: {
8441
+ /** 指令命令路径 */
8442
+ path: string;
8443
+ /** 获取几次提交 默认1次 */
8444
+ count?: number;
8445
+ /** 指定哈希 */
8446
+ hash?: string;
8447
+ /** 指定分支 */
8448
+ branch?: string;
8449
+ }) => Promise<string>;
8450
+ /**
8451
+ * @description 获取指定仓库最后一次提交哈希值
8452
+ * @param filePath - 插件相对路径
8453
+ * @param short - 是否获取短哈希 默认true
8454
+ */
8455
+ declare const getHash: (filePath: string, short?: boolean) => Promise<string>;
8456
+ /**
8457
+ * 获取指定仓库最后一次提交时间日期
8458
+ * @param filePath - 插件相对路径
8459
+ * @returns 最后一次提交时间
8460
+ * @example
8461
+ * ```ts
8462
+ * console.log(await getTime('./plugins/karin-plugin-example'))
8463
+ * // -> '2021-09-01 12:00:00'
8464
+ * ```
8465
+ */
8466
+ declare const getTime: (filePath: string) => Promise<string>;
8467
+ /**
8468
+ * @description 更新指定git插件
8469
+ * @param filePath 插件路径
8470
+ * @param cmd 执行命令 默认`git pull`
8471
+ * @param time 任务执行超时时间 默认120s
8472
+ */
8473
+ declare const updateGitPlugin: (filePath: string, cmd?: string, time?: number) => Promise<{
8474
+ /** 更新失败 */
8475
+ status: "failed";
8476
+ /** 更新失败信息 */
8477
+ data: string | ExecException$1;
8478
+ } | {
8479
+ /** 更新成功 */
8480
+ status: "ok";
8481
+ /** 更新成功信息 */
8482
+ data: string;
8483
+ /** 更新详情 */
8484
+ commit: string;
8485
+ } | {
8486
+ /** 检查发生错误 */
8487
+ status: "error";
8488
+ data: Error;
8489
+ }>;
8490
+ /**
8491
+ * @description 更新所有git插件
8492
+ * @param time 任务执行超时时间 默认120s
8493
+ */
8494
+ declare const updateAllGitPlugin: (cmd?: string, time?: number) => Promise<string>;
8495
+
8328
8496
  /**
8329
8497
  * 提取指定版本号的更新日志
8330
- * @param version 版本号
8331
- * @param data `CHANGELOG.md`文件内容
8332
- * @returns 更新日志
8498
+ * @param version 版本号,可包含预发布/构建元数据(如 `-beta`)
8499
+ * @param data `CHANGELOG.md` 文件内容
8500
+ * @returns 命中的更新日志字符串;无法定位返回 `null`
8501
+ * @description
8502
+ * - 先将版本规范化为稳定版 `x.y.z`;
8503
+ * - 不存在时按新 -> 旧顺序回退到不超过目标稳定版的最新版本。
8333
8504
  */
8334
8505
  declare const log: (version: string, data: string) => string | null;
8335
8506
  /**
8336
- * 提取指定范围版本号的更新日志
8507
+ * 从指定版本开始提取连续的更新日志
8508
+ */
8509
+ declare function logs(options: LogsOptions): string;
8510
+ /**
8511
+ * 从指定版本开始提取连续的更新日志
8337
8512
  * @param version 起始版本号
8338
- * @param data `CHANGELOG.md`文件内容
8339
- * @param length 提取长度
8340
- * @param reverse 是否反向提取 默认为`false`向后提取
8513
+ * @param data `CHANGELOG.md` 文件内容
8514
+ * @param length 提取条数,默认为 1
8515
+ * @param reverse 是否反向提取;`false` 向后,`true` 向前
8516
+ * @param opts 版本号对比模式
8517
+ * @returns 拼接后的更新日志字符串;找不到起始版本返回空字符串
8518
+ * @description
8519
+ * - 起始版本会规范化并回退到不超过目标稳定版的最新版本;
8520
+ * - 切片范围将做边界裁剪以避免越界。
8521
+ * @deprecated 此调用方式将在未来版本废弃,请改用对象参数重载 logs({ ... }) 进行调用
8522
+ */
8523
+ declare function logs(version: string, data: string, length?: number, reverse?: boolean, opts?: CompareMode): string;
8524
+ /**
8525
+ * 提取指定版本区间的更新日志
8341
8526
  */
8342
- declare const logs: (version: string, data: string, length?: number, reverse?: boolean) => string;
8527
+ declare function range(options: RangeOptions): string;
8343
8528
  /**
8344
- * 提取指定版本号之间的更新日志
8345
- * @param data `CHANGELOG.md`文件内容
8346
- * @param startVersion 起始版本号
8347
- * @param endVersion 结束版本号
8529
+ * 提取指定版本区间的更新日志
8530
+ * @param data `CHANGELOG.md` 文件内容
8531
+ * @param startVersion 起始版本号(较旧)
8532
+ * @param endVersion 结束版本号(较新)
8533
+ * @param opts 版本号对比模式
8534
+ * @returns 拼接后的更新日志字符串;若任一版本无法定位返回空字符串
8348
8535
  * @description
8349
- * - `CHANGELOG.md`的版本号排序约定为从新到旧
8350
- * - 也就是说 结束版本号应该比起始版本号新
8351
- * - 举例: `range(data, '1.0.0', '2.0.0')` 提取`1.0.0`到`2.0.0`之间的更新日志
8536
+ * - CHANGELOG 的版本排序约定为从新到旧;
8537
+ * - 若传入版本不存在,将回退到不超过目标稳定版的最新版本;
8538
+ * - `start > end` 时会自动调整为有效区间。
8539
+ * @deprecated 此调用方式将在未来版本废弃,请改用对象参数重载 range({ ... }) 进行调用
8352
8540
  */
8353
- declare const range: (data: string, startVersion: string, endVersion: string) => string;
8541
+ declare function range(data: string, startVersion: string, endVersion: string, opts?: CompareMode): string;
8354
8542
  /**
8355
8543
  * 对更新日志进行解析并形成对象
8356
8544
  * @param data 更新日志内容
8357
8545
  * @returns 以版本号为键的更新日志对象
8358
8546
  */
8359
8547
  declare const parseChangelog: (data: string) => Record<string, string>;
8548
+ /** logs 方法的配置 */
8549
+ type LogsOptions = {
8550
+ /** 起始版本号 */
8551
+ version: string;
8552
+ /** CHANGELOG.md 内容 */
8553
+ data: string;
8554
+ /**
8555
+ * 提取条数
8556
+ * @default 1
8557
+ */
8558
+ length?: number;
8559
+ /**
8560
+ * 是否反向提取
8561
+ * @default false
8562
+ */
8563
+ reverse?: boolean;
8564
+ /**
8565
+ * 版本号对比模式,怎么对比才算是有更新
8566
+ *
8567
+ * **xyz 模式(默认)**
8568
+ * - 只看前三段数字 `X.Y.Z`,忽略预发布/构建后缀。
8569
+ * - 示例:
8570
+ * - 本地 `2.6.7`,远程 `2.6.8` → 有更新
8571
+ * - 本地 `2.6.7-beta.1`,远程 `2.6.7` → 无更新(都视为 `2.6.7`)
8572
+ * - 本地 `1.0.0+20230101`,远程 `1.0.1` → 有更新(只看 `1.0.0` vs `1.0.1`)
8573
+ * - 本地 `3.2.0-rc.3`,远程 `3.2.0` → 无更新(都视为 `3.2.0`)
8574
+ *
8575
+ * **semver 模式(语义化版本)**
8576
+ * - 严格遵循 [SemVer](https://semver.org/) 规则。
8577
+ * - 示例:
8578
+ * - 本地 `2.6.7-beta.1`,远程 `2.6.6` → 本地更高,已最新,不提示升级
8579
+ * - 本地 `1.0.0-alpha`,远程 `1.0.0` → 远程更高,提示升级
8580
+ * - 本地 `1.0.0+20230101`,远程 `1.0.0` → 仅比较版本核心,不比较构建元数据,视为相同
8581
+ * - 本地 `2.0.0-beta.2`,远程 `2.0.0-beta.10` → 远程更高,提示升级(按预发布号逐段比较)
8582
+ * - 本地 `3.1.0-rc.1`,远程 `3.1.0` → 远程更高,提示升级(稳定版 > 预发布)
8583
+ *
8584
+ * @default 'xyz'
8585
+ */
8586
+ compare?: CompareMode['compare'];
8587
+ };
8588
+ /** range 方法的配置 */
8589
+ type RangeOptions = {
8590
+ /** CHANGELOG.md 内容 */
8591
+ data: string;
8592
+ /** 起始版本号(较旧) */
8593
+ startVersion: string;
8594
+ /** 结束版本号(较新) */
8595
+ endVersion: string;
8596
+ /**
8597
+ * 版本号对比模式,怎么对比才算是有更新
8598
+ *
8599
+ * **xyz 模式(默认)**
8600
+ * - 只看前三段数字 `X.Y.Z`,忽略预发布/构建后缀。
8601
+ * - 示例:
8602
+ * - 本地 `2.6.7`,远程 `2.6.8` → 有更新
8603
+ * - 本地 `2.6.7-beta.1`,远程 `2.6.7` → 无更新(都视为 `2.6.7`)
8604
+ * - 本地 `1.0.0+20230101`,远程 `1.0.1` → 有更新(只看 `1.0.0` vs `1.0.1`)
8605
+ * - 本地 `3.2.0-rc.3`,远程 `3.2.0` → 无更新(都视为 `3.2.0`)
8606
+ *
8607
+ * **semver 模式(语义化版本)**
8608
+ * - 严格遵循 [SemVer](https://semver.org/) 规则。
8609
+ * - 示例:
8610
+ * - 本地 `2.6.7-beta.1`,远程 `2.6.6` → 本地更高,已最新,不提示升级
8611
+ * - 本地 `1.0.0-alpha`,远程 `1.0.0` → 远程更高,提示升级
8612
+ * - 本地 `1.0.0+20230101`,远程 `1.0.0` → 仅比较版本核心,不比较构建元数据,视为相同
8613
+ * - 本地 `2.0.0-beta.2`,远程 `2.0.0-beta.10` → 远程更高,提示升级(按预发布号逐段比较)
8614
+ * - 本地 `3.1.0-rc.1`,远程 `3.1.0` → 远程更高,提示升级(稳定版 > 预发布)
8615
+ *
8616
+ * @default 'xyz'
8617
+ */
8618
+ compare?: CompareMode['compare'];
8619
+ };
8360
8620
 
8361
8621
  declare const changelog_log: typeof log;
8362
8622
  declare const changelog_logs: typeof logs;
@@ -8861,147 +9121,6 @@ declare const isDocker: boolean;
8861
9121
  /** 是否为root用户 仅linux */
8862
9122
  declare const isRoot: boolean;
8863
9123
 
8864
- /**
8865
- * @description 传入npm包名 检查是否存在更新
8866
- * @param name 包名
8867
- * @returns 是否存在更新 true: 存在更新 false: 无更新
8868
- */
8869
- declare const checkPkgUpdate: (name: string) => Promise<{
8870
- /** 存在更新 */
8871
- status: "yes";
8872
- /** 本地版本号 */
8873
- local: string;
8874
- /** 远程版本号 */
8875
- remote: string;
8876
- } | {
8877
- /** 无更新 */
8878
- status: "no";
8879
- /** 本地版本号 */
8880
- local: string;
8881
- } | {
8882
- /** 检查发生错误 */
8883
- status: "error";
8884
- /** 错误信息 */
8885
- error: Error;
8886
- }>;
8887
- /**
8888
- * @description 获取指定包的本地版本号 如果获取失败则会获取package.json中的版本号
8889
- * @param name 包名
8890
- */
8891
- declare const getPkgVersion: (name: string) => Promise<string>;
8892
- /**
8893
- * @description 获取指定包的远程版本号
8894
- * @param name 包名
8895
- * @param tag 标签,默认为 `latest`
8896
- */
8897
- declare const getRemotePkgVersion: (name: string, tag?: string) => Promise<string>;
8898
- /**
8899
- * @description 更新指定的npm插件
8900
- * @param name 包名
8901
- * @param tag 标签 默认 `latest`
8902
- */
8903
- declare const updatePkg: (name: string, tag?: string) => Promise<{
8904
- /** 更新失败 */
8905
- status: "failed";
8906
- /** 更新失败信息 */
8907
- data: string | ExecException$1;
8908
- } | {
8909
- /** 更新成功 */
8910
- status: "ok";
8911
- /** 更新成功信息 */
8912
- data: string;
8913
- /** 本地版本号 */
8914
- local: string;
8915
- /** 远程版本号 */
8916
- remote: string;
8917
- }>;
8918
- /**
8919
- * @description 更新全部npm插件
8920
- */
8921
- declare const updateAllPkg: () => Promise<string>;
8922
- /**
8923
- * @description 检查git插件是否有更新
8924
- * @param filePath 插件路径
8925
- * @param time 任务执行超时时间 默认120s
8926
- */
8927
- declare const checkGitPluginUpdate: (filePath: string, time?: number) => Promise<{
8928
- /** 存在更新 */
8929
- status: "yes";
8930
- /** 更新内容 */
8931
- data: string;
8932
- /** 落后次数 */
8933
- count: number;
8934
- } | {
8935
- /** 无更新 */
8936
- status: "no";
8937
- /** 最后更新时间描述 */
8938
- data: string;
8939
- } | {
8940
- /** 检查发生错误 */
8941
- status: "error";
8942
- data: Error;
8943
- }>;
8944
- /**
8945
- * @description 获取指定仓库的提交记录
8946
- * @param options 参数
8947
- * @returns 提交记录
8948
- */
8949
- declare const getCommit: (options: {
8950
- /** 指令命令路径 */
8951
- path: string;
8952
- /** 获取几次提交 默认1次 */
8953
- count?: number;
8954
- /** 指定哈希 */
8955
- hash?: string;
8956
- /** 指定分支 */
8957
- branch?: string;
8958
- }) => Promise<string>;
8959
- /**
8960
- * @description 获取指定仓库最后一次提交哈希值
8961
- * @param filePath - 插件相对路径
8962
- * @param short - 是否获取短哈希 默认true
8963
- */
8964
- declare const getHash: (filePath: string, short?: boolean) => Promise<string>;
8965
- /**
8966
- * 获取指定仓库最后一次提交时间日期
8967
- * @param filePath - 插件相对路径
8968
- * @returns 最后一次提交时间
8969
- * @example
8970
- * ```ts
8971
- * console.log(await getTime('./plugins/karin-plugin-example'))
8972
- * // -> '2021-09-01 12:00:00'
8973
- * ```
8974
- */
8975
- declare const getTime: (filePath: string) => Promise<string>;
8976
- /**
8977
- * @description 更新指定git插件
8978
- * @param filePath 插件路径
8979
- * @param cmd 执行命令 默认`git pull`
8980
- * @param time 任务执行超时时间 默认120s
8981
- */
8982
- declare const updateGitPlugin: (filePath: string, cmd?: string, time?: number) => Promise<{
8983
- /** 更新失败 */
8984
- status: "failed";
8985
- /** 更新失败信息 */
8986
- data: string | ExecException$1;
8987
- } | {
8988
- /** 更新成功 */
8989
- status: "ok";
8990
- /** 更新成功信息 */
8991
- data: string;
8992
- /** 更新详情 */
8993
- commit: string;
8994
- } | {
8995
- /** 检查发生错误 */
8996
- status: "error";
8997
- data: Error;
8998
- }>;
8999
- /**
9000
- * @description 更新所有git插件
9001
- * @param time 任务执行超时时间 默认120s
9002
- */
9003
- declare const updateAllGitPlugin: (cmd?: string, time?: number) => Promise<string>;
9004
-
9005
9124
  /**
9006
9125
  * 重启Bot
9007
9126
  * @param selfId - 机器人的id 传e.self_id
@@ -9065,6 +9184,7 @@ declare const fileToUrl: FileToUrlHandler;
9065
9184
  */
9066
9185
  declare const satisfies: (satisfies: string, version: string) => boolean;
9067
9186
 
9187
+ type index$2_CompareMode = CompareMode;
9068
9188
  declare const index$2_checkGitPluginUpdate: typeof checkGitPluginUpdate;
9069
9189
  declare const index$2_checkPkgUpdate: typeof checkPkgUpdate;
9070
9190
  declare const index$2_checkPort: typeof checkPort;
@@ -9108,7 +9228,7 @@ declare const index$2_updateGitPlugin: typeof updateGitPlugin;
9108
9228
  declare const index$2_updatePkg: typeof updatePkg;
9109
9229
  declare const index$2_waitPort: typeof waitPort;
9110
9230
  declare namespace index$2 {
9111
- export { index$2_checkGitPluginUpdate as checkGitPluginUpdate, index$2_checkPkgUpdate as checkPkgUpdate, index$2_checkPort as checkPort, index$2_errorToString as errorToString, index$2_exec as exec, index$2_ffmpeg as ffmpeg, index$2_ffplay as ffplay, index$2_ffprobe as ffprobe, index$2_fileToUrl as fileToUrl, index$2_fileToUrlHandlerKey as fileToUrlHandlerKey, formatTime$1 as formatTime, index$2_getCommit as getCommit, index$2_getHash as getHash, index$2_getPid as getPid, index$2_getPkgVersion as getPkgVersion, index$2_getRemotePkgVersion as getRemotePkgVersion, index$2_getRequestIp as getRequestIp, index$2_getTime as getTime, index$2_importModule as importModule, index$2_imports as imports, index$2_isClass as isClass, index$2_isDocker as isDocker, index$2_isIPv4Loop as isIPv4Loop, index$2_isIPv6Loop as isIPv6Loop, index$2_isLinux as isLinux, index$2_isLocalRequest as isLocalRequest, index$2_isLoopback as isLoopback, index$2_isMac as isMac, index$2_isRoot as isRoot, index$2_isWin as isWin, index$2_killApp as killApp, index$2_lock as lock, index$2_lockMethod as lockMethod, index$2_lockProp as lockProp, index$2_restart as restart, index$2_restartDirect as restartDirect, index$2_satisfies as satisfies, index$2_stringifyError as stringifyError, index$2_updateAllGitPlugin as updateAllGitPlugin, index$2_updateAllPkg as updateAllPkg, index$2_updateGitPlugin as updateGitPlugin, index$2_updatePkg as updatePkg, uptime$1 as uptime, index$2_waitPort as waitPort };
9231
+ export { type index$2_CompareMode as CompareMode, index$2_checkGitPluginUpdate as checkGitPluginUpdate, index$2_checkPkgUpdate as checkPkgUpdate, index$2_checkPort as checkPort, index$2_errorToString as errorToString, index$2_exec as exec, index$2_ffmpeg as ffmpeg, index$2_ffplay as ffplay, index$2_ffprobe as ffprobe, index$2_fileToUrl as fileToUrl, index$2_fileToUrlHandlerKey as fileToUrlHandlerKey, formatTime$1 as formatTime, index$2_getCommit as getCommit, index$2_getHash as getHash, index$2_getPid as getPid, index$2_getPkgVersion as getPkgVersion, index$2_getRemotePkgVersion as getRemotePkgVersion, index$2_getRequestIp as getRequestIp, index$2_getTime as getTime, index$2_importModule as importModule, index$2_imports as imports, index$2_isClass as isClass, index$2_isDocker as isDocker, index$2_isIPv4Loop as isIPv4Loop, index$2_isIPv6Loop as isIPv6Loop, index$2_isLinux as isLinux, index$2_isLocalRequest as isLocalRequest, index$2_isLoopback as isLoopback, index$2_isMac as isMac, index$2_isRoot as isRoot, index$2_isWin as isWin, index$2_killApp as killApp, index$2_lock as lock, index$2_lockMethod as lockMethod, index$2_lockProp as lockProp, index$2_restart as restart, index$2_restartDirect as restartDirect, index$2_satisfies as satisfies, index$2_stringifyError as stringifyError, index$2_updateAllGitPlugin as updateAllGitPlugin, index$2_updateAllPkg as updateAllPkg, index$2_updateGitPlugin as updateGitPlugin, index$2_updatePkg as updatePkg, uptime$1 as uptime, index$2_waitPort as waitPort };
9112
9232
  }
9113
9233
 
9114
9234
  /**
@@ -17660,4 +17780,4 @@ type Client = RedisClientType & {
17660
17780
  */
17661
17781
  declare const start: () => Promise<void>;
17662
17782
 
17663
- export { type Accept, type AccordionItemProps, type AccordionKV, type AccordionProProps, type AccordionProResult, type AccordionProps, type AccordionResult, type AccountInfo, type Adapter, AdapterBase, type AdapterCommunication, AdapterConvertKarin, type AdapterInfo, AdapterOneBot, type AdapterOptions, type AdapterPlatform, type AdapterProtocol, type AdapterStandard, type AdapterType, type Adapters, type AddDependenciesParams, type AddTaskResult, type AfterForwardMessageCallback, type AfterMessageCallback, type AllPluginMethods, type Apps, type ArrayField, type AtElement, type Author, BASE_ROUTER, BATCH_UPDATE_PLUGINS_ROUTER, type BaseContact, BaseEvent, type BaseEventOptions, type BaseEventType, type BaseForwardCallback, type BaseMessageCallback, type BasketballElement, Bot, type BoundingBox, type BubbleFaceElement, type Button, type ButtonElement, CHECK_PLUGIN_ROUTER, CLOSE_TERMINAL_ROUTER, CONSOLE_ROUTER, CREATE_TERMINAL_ROUTER, type Cache, type CacheEntry, type CheckboxField, type CheckboxGroupProps, type CheckboxProps, type CheckboxResult, type Children, type CmdFnc, type Command, type CommandClass, type ComponentConfig, type ComponentProps, type ComponentType, type Components, type ComponentsClass, type Config, type Contact, type ContactElement, type Count, type CreateGroupFolderResponse, type CreatePty, type CreateTask, type CreateTaskParams, type CreateTaskResult, type CronProps, type CustomMusicElement, type CustomNodeElement, type DbStreamStatus, type DbStreams, type DefineConfig, type DependenciesManage, type DependenciesManageBase, type Dependency, type DiceElement, type DirectContact, DirectMessage, type DirectMessageOptions, type DirectNodeElement, type DirectSender, type DividerField, type DividerProps, type DownloadFileErrorResult, type DownloadFileOptions, type DownloadFileResponse, type DownloadFileResult, type DownloadFileSuccessResult, type DownloadFilesOptions, EVENT_COUNT, EXIT_ROUTER, type ElementTypes, type Elements, type Env, type Event, type EventCallCallback, type EventCallHookItem, type EventParent, type EventToSubEvent, type ExecOptions$1 as ExecOptions, type ExecReturn, type ExecType, type ExtendedAxiosRequestConfig, FILE_CHANGE, type FaceElement, type FieldType, type FileElement, type FileList, type FileListMap, type FileToUrlHandler, type FileToUrlResult, type FormField, type ForwardMessageCallback, type ForwardOptions, type FriendContact, type FriendData, FriendDecreaseNotice, type FriendDecreaseOptions, FriendIncreaseNotice, type FriendIncreaseOptions, FriendMessage, type FriendMessageOptions, type FriendNoticeEventMap, type FriendRequestEventMap, type FriendRequestOptions, type FriendSender, type FrontendInstalledPluginListResponse, GET_BOTS_ROUTER, GET_CONFIG_ROUTER, GET_DEPENDENCIES_LIST_ROUTER, GET_LOADED_COMMAND_PLUGIN_CACHE_LIST_ROUTER, GET_LOCAL_PLUGIN_FRONTEND_LIST_ROUTER, GET_LOCAL_PLUGIN_LIST_ROUTER, GET_LOG_FILE_LIST_ROUTER, GET_LOG_FILE_ROUTER, GET_LOG_ROUTER, GET_NETWORK_STATUS_ROUTER, GET_NPMRC_LIST_ROUTER, GET_NPM_BASE_CONFIG_ROUTER, GET_NPM_CONFIG_ROUTER, GET_ONLINE_PLUGIN_LIST_ROUTER, GET_PLUGIN_APPS_ROUTER, GET_PLUGIN_CONFIG_ROUTER, GET_PLUGIN_FILE_ROUTER, GET_PLUGIN_LIST_PLUGIN_ADMIN_ROUTER, GET_PLUGIN_LIST_ROUTER, GET_PLUGIN_MARKET_LIST_ROUTER, GET_TASK_LIST_ROUTER, GET_TASK_STATUS_ROUTER, GET_TERMINAL_LIST_ROUTER, GET_UPDATABLE_PLUGINS_ROUTER, GET_WEBUI_PLUGIN_LIST_ROUTER, GET_WEBUI_PLUGIN_VERSIONS_ROUTER, type GeneralHookCallback, type GeneralHookItem, type GetAiCharactersResponse, type GetAtAllCountResponse, type GetBot, type GetCommitHashOptions, type GetConfigRequest, type GetConfigResponse, type GetGroupFileListResponse, type GetGroupFileSystemInfoResponse, type GetGroupHighlightsResponse, type GetGroupMuteListResponse, type GetPluginLocalOptions, type GetPluginLocalReturn, type GetPluginReturn, type GetPluginType, type GetRkeyResponse, type GiftElement, type GitLocalBranches, type GitPullOptions, type GitPullResult, type GitRemoteBranches, type GithubConfig, type GoToOptions, GroupAdminChangedNotice, type GroupAdminChangedOptions, GroupApplyRequest, type GroupApplyRequestOptions, GroupCardChangedNotice, type GroupCardChangedOptions, type GroupContact, type GroupData, GroupFileUploadedNotice, type GroupFileUploadedOptions, GroupHlightsChangedNotice, type GroupHlightsChangedOptions, GroupHonorChangedNotice, type GroupHonorChangedOptions, type GroupInfo, GroupInviteRequest, type GroupInviteRequestOptions, GroupLuckKingNotice, type GroupLuckKingOptions, GroupMemberBanNotice, type GroupMemberBanOptions, type GroupMemberData, GroupMemberDecreaseNotice, type GroupMemberDecreaseOptions, GroupMemberIncreaseNotice, type GroupMemberIncreaseOptions, type GroupMemberInfo, GroupMemberTitleUpdatedNotice, type GroupMemberUniqueTitleChangedOptions, GroupMessage, type GroupMessageOptions, GroupMessageReactionNotice, type GroupMessageReactionOptions, GroupNotice, type GroupNoticeEventMap, GroupPokeNotice, type GroupPokeOptions, GroupRecallNotice, type GroupRecallOptions, type GroupRequestEventMap, type GroupSender, GroupSignInNotice, type GroupSignInOptions, type GroupTempContact, GroupTempMessage, type GroupTempMessageOptions, type GroupTempSender, GroupWholeBanNotice, type GroupWholeBanOptions, type Groups, type GroupsObjectValue, type GuildContact, GuildMessage, type GuildMessageOptions, type GuildSender, HTTPStatusCode, type Handler, type HandlerType, type HookCache, type HookCallback, type HookEmitForward, type HookEmitMessage, type HookNext, type HookOptions, type HooksType, INSTALL_PLUGIN_ROUTER, INSTALL_WEBUI_PLUGIN_ROUTER, IS_PLUGIN_CONFIG_EXIST_ROUTER, type Icon, type ImageElement, type ImportModuleResult, type InputGroupProps, type InputProps, type InputResult, type JsonElement, type JwtVerifyBase, type JwtVerifyError, type JwtVerifyExpired, type JwtVerifyResult, type JwtVerifySuccess, type JwtVerifyUnauthorized, type KarinButton, KarinConvertAdapter, type KarinPluginAppsType, type KeyboardElement, LOGIN_ROUTER, type LoadPluginResult, type LoadedPluginCacheList, type LocalApiResponse, type LocationElement, type Log, LogMethodNames, Logger, LoggerLevel, type LongMsgElement, MANAGE_DEPENDENCIES_ROUTER, type MarkdownElement, type MarkdownTplElement, type MarketFaceElement, type Message, MessageBase$1 as MessageBase, type MessageEventMap, type MessageEventSub, type MessageHookItem, type MessageOptions, type MessageResponse, type MusicElement, type MusicPlatform, type NetworkStatus, type NodeElement, type NormalMessageCallback, type Notice, type NoticeAndRequest, NoticeBase, type NoticeEventMap, type NoticeEventSub, type NoticeOptions, type NpmBaseConfigResponse, type NpmRegistryResponse, type NpmrcFileResponse, type NumberField, type ObjectArrayField, type ObjectField, createMessage as OneBotCreateMessage, createNotice as OneBotCreateNotice, createRequest as OneBotCreateRequest, type Option, type Options, PING_ROUTER, PLUGIN_ADMIN_ROUTER, type PM2, type Package, type Parser, type PasmsgElement, type Permission, type PingRequestResult, type PkgData, type PkgEnv, type PkgInfo, Plugin$1 as Plugin, type PluginAdminCustomInstall, type PluginAdminCustomInstallApp, type PluginAdminInstall, type PluginAdminListResponse, type PluginAdminMarketInstall, type PluginAdminMarketInstallApp, type PluginAdminParams, type PluginAdminResult, type PluginAdminUninstall, type PluginAdminUpdate, type PluginFile, type PluginFncTypes, type PluginLists, type PluginMarketAuthor, type PluginMarketLocalBase, type PluginMarketLocalOptions, type PluginMarketOptions, type PluginMarketRequest, type PluginMarketResponse, type PluginOptions, type PluginRule, type PluginUpdateInfo, type PnpmDependencies, type PnpmDependency, type Point, PrivateApplyRequest, type PrivateApplyRequestOptions, PrivateFileUploadedNotice, type PrivateFileUploadedOptions, PrivatePokeNotice, type PrivatePokeOptions, PrivateRecallNotice, type PrivateRecallOptions, type Privates, type PrivatesObjectValue, type PuppeteerLifeCycleEvent, type QQBotButton, type QQButtonTextType, type QQGroupFileInfo, type QQGroupFolderInfo, type QQGroupHonorInfo, RECV_MSG, REFRESH_ROUTER, RESTART_ROUTER, type RaceResult, type Radio, type RadioField, type RadioGroupProps, type RadioResult, type RawElement, type ReadyMusicElement, ReceiveLikeNotice, type ReceiveLikeOptions, type RecordElement, type Redis, type RemoveDependenciesParams, type Render, type RenderResult, Renderer, type Renders$1 as Renders, type Reply, type ReplyElement, type Request, RequestBase, type RequestEventMap, type RequestEventSub, type RequestOptions, type RequireFunction, type RequireFunctionSync, type RequireOptions, type Role, type RpsElement, SAVE_CONFIG_ROUTER, SAVE_NPMRC_ROUTER, SAVE_PLUGIN_CONFIG_ROUTER, SEND_MSG, SET_LOG_LEVEL_ROUTER, SYSTEM_INFO_ROUTER, SYSTEM_STATUS_KARIN_ROUTER, SYSTEM_STATUS_ROUTER, SYSTEM_STATUS_WS_ROUTER, type SandBoxAccountInfo, type SandboxMsgRecord, type SandboxSendApi, type SandboxSendSendFriendMsg, type SandboxSendSendGroupMsg, type SandboxSendSendMsg, type SaveConfigResponse, type SaveResult, type Scene, type ScreenshotClip, type ScreenshotOptions, type SectionField, type SelectField, type SelectItem, type SelectProps, type SendElement, type SendForwardMessageResponse, type SendMessage, type SendMsgHookItem, type SendMsgResults, type Sender, type SenderBase, type SenderGroup$1 as SenderGroup, type Sex$1 as Sex, type ShareElement, type Snapka, type SnapkaResult, type SrcReply, type StandardResult, type SwitchField, type SwitchProps, type SwitchResult, TASK_DELETE_ROUTER, TASK_LIST_ROUTER, TASK_LOGS_ROUTER, TASK_RUN_ROUTER, type Task, type TaskCallbacks, type TaskEntity, type TaskExecutor, type TaskFilter, type TaskStatus, type TaskType, type TerminalInstance, type TerminalShell, type TestNetworkRequestDetail, type TextElement, type TextField, type TitleField, UNINSTALL_PLUGIN_ROUTER, UNINSTALL_WEBUI_PLUGIN_ROUTER, UPDATE_CORE_ROUTER, UPDATE_PLUGIN_ROUTER, UPDATE_TASK_STATUS_ROUTER, UPDATE_WEBUI_PLUGIN_VERSION_ROUTER, type UnionMessage, type UnregisterBot, type UpgradeDependenciesParams, type UserInfo, type ValidationRule, type ValueType, type VideoElement, WS_CLOSE, WS_CLOSE_ONEBOT, WS_CLOSE_PUPPETEER, WS_CLOSE_SANDBOX, WS_CONNECTION, WS_CONNECTION_ONEBOT, WS_CONNECTION_PUPPETEER, WS_CONNECTION_SANDBOX, WS_CONNECTION_TERMINAL, WS_SNAPKA, type WaitForOptions, Watch, Watcher, type WeatherElement, type XmlElement, type YamlComment, YamlEditor, type YamlValue, absPath, accordion, accordionItem, accordionPro, app, applyComments, authMiddleware, base64, buffer, buildError, buildGithub, buttonHandle, cacheMap, callRender, changelog, checkGitPluginUpdate, checkPkgUpdate, checkPort, clearRequire, clearRequireFile, comment, index$1 as common, components, index as config, contact$1 as contact, contactDirect, contactFriend, contactGroup, contactGroupTemp, contactGuild, convertOneBotMessageToKarin, copyConfig, copyConfigSync, copyFiles, copyFilesSync, createAccessTokenExpiredResponse, createBadRequestResponse, createDirectMessage, createForbiddenResponse, createFriendDecreaseNotice, createFriendIncreaseNotice, createFriendMessage, createGroupAdminChangedNotice, createGroupApplyRequest, createGroupCardChangedNotice, createGroupFileUploadedNotice, createGroupHlightsChangedNotice, createGroupHonorChangedNotice, createGroupInviteRequest, createGroupLuckKingNotice, createGroupMemberAddNotice, createGroupMemberBanNotice, createGroupMemberDelNotice, createGroupMemberTitleUpdatedNotice, createGroupMessage, createGroupMessageReactionNotice, createGroupPokeNotice, createGroupRecallNotice, createGroupSignInNotice, createGroupTempMessage, createGroupWholeBanNotice, createGuildMessage, createINIParser, createMethodNotAllowedResponse, createNotFoundResponse, createOneBotClient, createOneBotHttp, createOneBotWsServer, createPayloadTooLargeResponse, createPluginDir, createPrivateApplyRequest, createPrivateFileUploadedNotice, createPrivatePokeNotice, createPrivateRecallNotice, createRawMessage, createReceiveLikeNotice, createRefreshTokenExpiredResponse, createResponse, createServerErrorResponse, createSuccessResponse, createTaskDatabase, createUnauthorizedResponse, cron, db, debug, karin as default, defineConfig, disconnectAllOneBotServer, divider, downFile, downloadFile, errorToString, exec, executeTask, existToMkdir, existToMkdirSync, exists, existsSync, ffmpeg, ffplay, ffprobe, fs as file, fileToBase64, fileToUrl, fileToUrlHandlerKey, filesByExt, formatLogString, formatPath, formatTime$1 as formatTime, index$3 as fs, getAllBot, getAllBotID, getAllBotList, getAllFiles, getAllFilesSync, getBot, getBotCount, getCommit, getDefaultBranch, getFastGithub, getFastRegistry, getFileMessage, getFiles, getHash, getLocalBranches, getLocalCommitHash, getMimeType, getPackageJson, getPid, getPkgVersion, getPluginInfo, getPlugins, getRelPath, getRemoteBranches, getRemoteCommitHash, getRemotePkgVersion, getRender, getRenderCount, getRenderList, getRequestIp, getTaskCallback, getTaskDatabase, getTime, gitPull, handler$1 as handler, hooks, importModule, imports, ini, initOneBotAdapter, initTaskSystem, input, isClass, isDir, isDirSync, isDocker, isFile, isFileSync, isIPv4Loop, isIPv6Loop, isLinux, isLocalRequest, isLoopback, isMac, isPathEqual, isPlugin, isPublic, isRoot, isSubPath, isWin, json$1 as json, karin, karinToQQBot, key, killApp, lock, lockMethod, lockProp, log, logger, logs, makeForward, makeMessage, type messageType, mkdir, mkdirSync, parseChangelog, parseGithubUrl, pingRequest, pkgRoot, qqbotToKarin, raceRequest, randomStr, range, read, readFile, readJson, readJsonSync, redis, registerBot, registerRender, removeTaskCallback, render, renderHtml, renderMultiHtml, renderTpl, requireFile, requireFileSync, restart, restartDirect, rmSync, router, satisfies, save, type screenshot, segment, select, sendMsg$1 as sendMsg, sender, senderDirect, senderFriend, senderGroup, senderGroupTemp, senderGuild, sep, server, setTaskCallback, setTaskDatabase, splitPath, start, stream, stringifyError, switchComponent, index$2 as system, taskAdd, taskExists, taskGet, taskList, taskSystem, taskUpdateLogs, taskUpdateStatus, unregisterBot, unregisterRender, updateAllGitPlugin, updateAllPkg, updateGitPlugin, updatePkg, updateTaskLogs, updateTaskStatus, uptime$1 as uptime, urlToPath, waitPort, watch, watchAndMerge, write, writeJson, writeJsonSync, yaml };
17783
+ export { type Accept, type AccordionItemProps, type AccordionKV, type AccordionProProps, type AccordionProResult, type AccordionProps, type AccordionResult, type AccountInfo, type Adapter, AdapterBase, type AdapterCommunication, AdapterConvertKarin, type AdapterInfo, AdapterOneBot, type AdapterOptions, type AdapterPlatform, type AdapterProtocol, type AdapterStandard, type AdapterType, type Adapters, type AddDependenciesParams, type AddTaskResult, type AfterForwardMessageCallback, type AfterMessageCallback, type AllPluginMethods, type Apps, type ArrayField, type AtElement, type Author, BASE_ROUTER, BATCH_UPDATE_PLUGINS_ROUTER, type BaseContact, BaseEvent, type BaseEventOptions, type BaseEventType, type BaseForwardCallback, type BaseMessageCallback, type BasketballElement, Bot, type BoundingBox, type BubbleFaceElement, type Button, type ButtonElement, CHECK_PLUGIN_ROUTER, CLOSE_TERMINAL_ROUTER, CONSOLE_ROUTER, CREATE_TERMINAL_ROUTER, type Cache, type CacheEntry, type CheckboxField, type CheckboxGroupProps, type CheckboxProps, type CheckboxResult, type Children, type CmdFnc, type Command, type CommandClass, type CompareMode, type ComponentConfig, type ComponentProps, type ComponentType, type Components, type ComponentsClass, type Config, type Contact, type ContactElement, type Count, type CreateGroupFolderResponse, type CreatePty, type CreateTask, type CreateTaskParams, type CreateTaskResult, type CronProps, type CustomMusicElement, type CustomNodeElement, type DbStreamStatus, type DbStreams, type DefineConfig, type DependenciesManage, type DependenciesManageBase, type Dependency, type DiceElement, type DirectContact, DirectMessage, type DirectMessageOptions, type DirectNodeElement, type DirectSender, type DividerField, type DividerProps, type DownloadFileErrorResult, type DownloadFileOptions, type DownloadFileResponse, type DownloadFileResult, type DownloadFileSuccessResult, type DownloadFilesOptions, EVENT_COUNT, EXIT_ROUTER, type ElementTypes, type Elements, type Env, type Event, type EventCallCallback, type EventCallHookItem, type EventParent, type EventToSubEvent, type ExecOptions$1 as ExecOptions, type ExecReturn, type ExecType, type ExtendedAxiosRequestConfig, FILE_CHANGE, type FaceElement, type FieldType, type FileElement, type FileList, type FileListMap, type FileToUrlHandler, type FileToUrlResult, type FormField, type ForwardMessageCallback, type ForwardOptions, type FriendContact, type FriendData, FriendDecreaseNotice, type FriendDecreaseOptions, FriendIncreaseNotice, type FriendIncreaseOptions, FriendMessage, type FriendMessageOptions, type FriendNoticeEventMap, type FriendRequestEventMap, type FriendRequestOptions, type FriendSender, type FrontendInstalledPluginListResponse, GET_BOTS_ROUTER, GET_CONFIG_ROUTER, GET_DEPENDENCIES_LIST_ROUTER, GET_LOADED_COMMAND_PLUGIN_CACHE_LIST_ROUTER, GET_LOCAL_PLUGIN_FRONTEND_LIST_ROUTER, GET_LOCAL_PLUGIN_LIST_ROUTER, GET_LOG_FILE_LIST_ROUTER, GET_LOG_FILE_ROUTER, GET_LOG_ROUTER, GET_NETWORK_STATUS_ROUTER, GET_NPMRC_LIST_ROUTER, GET_NPM_BASE_CONFIG_ROUTER, GET_NPM_CONFIG_ROUTER, GET_ONLINE_PLUGIN_LIST_ROUTER, GET_PLUGIN_APPS_ROUTER, GET_PLUGIN_CONFIG_ROUTER, GET_PLUGIN_FILE_ROUTER, GET_PLUGIN_LIST_PLUGIN_ADMIN_ROUTER, GET_PLUGIN_LIST_ROUTER, GET_PLUGIN_MARKET_LIST_ROUTER, GET_TASK_LIST_ROUTER, GET_TASK_STATUS_ROUTER, GET_TERMINAL_LIST_ROUTER, GET_UPDATABLE_PLUGINS_ROUTER, GET_WEBUI_PLUGIN_LIST_ROUTER, GET_WEBUI_PLUGIN_VERSIONS_ROUTER, type GeneralHookCallback, type GeneralHookItem, type GetAiCharactersResponse, type GetAtAllCountResponse, type GetBot, type GetCommitHashOptions, type GetConfigRequest, type GetConfigResponse, type GetGroupFileListResponse, type GetGroupFileSystemInfoResponse, type GetGroupHighlightsResponse, type GetGroupMuteListResponse, type GetPluginLocalOptions, type GetPluginLocalReturn, type GetPluginReturn, type GetPluginType, type GetRkeyResponse, type GiftElement, type GitLocalBranches, type GitPullOptions, type GitPullResult, type GitRemoteBranches, type GithubConfig, type GoToOptions, GroupAdminChangedNotice, type GroupAdminChangedOptions, GroupApplyRequest, type GroupApplyRequestOptions, GroupCardChangedNotice, type GroupCardChangedOptions, type GroupContact, type GroupData, GroupFileUploadedNotice, type GroupFileUploadedOptions, GroupHlightsChangedNotice, type GroupHlightsChangedOptions, GroupHonorChangedNotice, type GroupHonorChangedOptions, type GroupInfo, GroupInviteRequest, type GroupInviteRequestOptions, GroupLuckKingNotice, type GroupLuckKingOptions, GroupMemberBanNotice, type GroupMemberBanOptions, type GroupMemberData, GroupMemberDecreaseNotice, type GroupMemberDecreaseOptions, GroupMemberIncreaseNotice, type GroupMemberIncreaseOptions, type GroupMemberInfo, GroupMemberTitleUpdatedNotice, type GroupMemberUniqueTitleChangedOptions, GroupMessage, type GroupMessageOptions, GroupMessageReactionNotice, type GroupMessageReactionOptions, GroupNotice, type GroupNoticeEventMap, GroupPokeNotice, type GroupPokeOptions, GroupRecallNotice, type GroupRecallOptions, type GroupRequestEventMap, type GroupSender, GroupSignInNotice, type GroupSignInOptions, type GroupTempContact, GroupTempMessage, type GroupTempMessageOptions, type GroupTempSender, GroupWholeBanNotice, type GroupWholeBanOptions, type Groups, type GroupsObjectValue, type GuildContact, GuildMessage, type GuildMessageOptions, type GuildSender, HTTPStatusCode, type Handler, type HandlerType, type HookCache, type HookCallback, type HookEmitForward, type HookEmitMessage, type HookNext, type HookOptions, type HooksType, INSTALL_PLUGIN_ROUTER, INSTALL_WEBUI_PLUGIN_ROUTER, IS_PLUGIN_CONFIG_EXIST_ROUTER, type Icon, type ImageElement, type ImportModuleResult, type InputGroupProps, type InputProps, type InputResult, type JsonElement, type JwtVerifyBase, type JwtVerifyError, type JwtVerifyExpired, type JwtVerifyResult, type JwtVerifySuccess, type JwtVerifyUnauthorized, type KarinButton, KarinConvertAdapter, type KarinPluginAppsType, type KeyboardElement, LOGIN_ROUTER, type LoadPluginResult, type LoadedPluginCacheList, type LocalApiResponse, type LocationElement, type Log, LogMethodNames, Logger, LoggerLevel, type LongMsgElement, MANAGE_DEPENDENCIES_ROUTER, type MarkdownElement, type MarkdownTplElement, type MarketFaceElement, type Message, MessageBase$1 as MessageBase, type MessageEventMap, type MessageEventSub, type MessageHookItem, type MessageOptions, type MessageResponse, type MusicElement, type MusicPlatform, type NetworkStatus, type NodeElement, type NormalMessageCallback, type Notice, type NoticeAndRequest, NoticeBase, type NoticeEventMap, type NoticeEventSub, type NoticeOptions, type NpmBaseConfigResponse, type NpmRegistryResponse, type NpmrcFileResponse, type NumberField, type ObjectArrayField, type ObjectField, createMessage as OneBotCreateMessage, createNotice as OneBotCreateNotice, createRequest as OneBotCreateRequest, type Option, type Options, PING_ROUTER, PLUGIN_ADMIN_ROUTER, type PM2, type Package, type Parser, type PasmsgElement, type Permission, type PingRequestResult, type PkgData, type PkgEnv, type PkgInfo, Plugin$1 as Plugin, type PluginAdminCustomInstall, type PluginAdminCustomInstallApp, type PluginAdminInstall, type PluginAdminListResponse, type PluginAdminMarketInstall, type PluginAdminMarketInstallApp, type PluginAdminParams, type PluginAdminResult, type PluginAdminUninstall, type PluginAdminUpdate, type PluginFile, type PluginFncTypes, type PluginLists, type PluginMarketAuthor, type PluginMarketLocalBase, type PluginMarketLocalOptions, type PluginMarketOptions, type PluginMarketRequest, type PluginMarketResponse, type PluginOptions, type PluginRule, type PluginUpdateInfo, type PnpmDependencies, type PnpmDependency, type Point, PrivateApplyRequest, type PrivateApplyRequestOptions, PrivateFileUploadedNotice, type PrivateFileUploadedOptions, PrivatePokeNotice, type PrivatePokeOptions, PrivateRecallNotice, type PrivateRecallOptions, type Privates, type PrivatesObjectValue, type PuppeteerLifeCycleEvent, type QQBotButton, type QQButtonTextType, type QQGroupFileInfo, type QQGroupFolderInfo, type QQGroupHonorInfo, RECV_MSG, REFRESH_ROUTER, RESTART_ROUTER, type RaceResult, type Radio, type RadioField, type RadioGroupProps, type RadioResult, type RawElement, type ReadyMusicElement, ReceiveLikeNotice, type ReceiveLikeOptions, type RecordElement, type Redis, type RemoveDependenciesParams, type Render, type RenderResult, Renderer, type Renders$1 as Renders, type Reply, type ReplyElement, type Request, RequestBase, type RequestEventMap, type RequestEventSub, type RequestOptions, type RequireFunction, type RequireFunctionSync, type RequireOptions, type Role, type RpsElement, SAVE_CONFIG_ROUTER, SAVE_NPMRC_ROUTER, SAVE_PLUGIN_CONFIG_ROUTER, SEND_MSG, SET_LOG_LEVEL_ROUTER, SYSTEM_INFO_ROUTER, SYSTEM_STATUS_KARIN_ROUTER, SYSTEM_STATUS_ROUTER, SYSTEM_STATUS_WS_ROUTER, type SandBoxAccountInfo, type SandboxMsgRecord, type SandboxSendApi, type SandboxSendSendFriendMsg, type SandboxSendSendGroupMsg, type SandboxSendSendMsg, type SaveConfigResponse, type SaveResult, type Scene, type ScreenshotClip, type ScreenshotOptions, type SectionField, type SelectField, type SelectItem, type SelectProps, type SendElement, type SendForwardMessageResponse, type SendMessage, type SendMsgHookItem, type SendMsgResults, type Sender, type SenderBase, type SenderGroup$1 as SenderGroup, type Sex$1 as Sex, type ShareElement, type Snapka, type SnapkaResult, type SrcReply, type StandardResult, type SwitchField, type SwitchProps, type SwitchResult, TASK_DELETE_ROUTER, TASK_LIST_ROUTER, TASK_LOGS_ROUTER, TASK_RUN_ROUTER, type Task, type TaskCallbacks, type TaskEntity, type TaskExecutor, type TaskFilter, type TaskStatus, type TaskType, type TerminalInstance, type TerminalShell, type TestNetworkRequestDetail, type TextElement, type TextField, type TitleField, UNINSTALL_PLUGIN_ROUTER, UNINSTALL_WEBUI_PLUGIN_ROUTER, UPDATE_CORE_ROUTER, UPDATE_PLUGIN_ROUTER, UPDATE_TASK_STATUS_ROUTER, UPDATE_WEBUI_PLUGIN_VERSION_ROUTER, type UnionMessage, type UnregisterBot, type UpgradeDependenciesParams, type UserInfo, type ValidationRule, type ValueType, type VideoElement, WS_CLOSE, WS_CLOSE_ONEBOT, WS_CLOSE_PUPPETEER, WS_CLOSE_SANDBOX, WS_CONNECTION, WS_CONNECTION_ONEBOT, WS_CONNECTION_PUPPETEER, WS_CONNECTION_SANDBOX, WS_CONNECTION_TERMINAL, WS_SNAPKA, type WaitForOptions, Watch, Watcher, type WeatherElement, type XmlElement, type YamlComment, YamlEditor, type YamlValue, absPath, accordion, accordionItem, accordionPro, app, applyComments, authMiddleware, base64, buffer, buildError, buildGithub, buttonHandle, cacheMap, callRender, changelog, checkGitPluginUpdate, checkPkgUpdate, checkPort, clearRequire, clearRequireFile, comment, index$1 as common, components, index as config, contact$1 as contact, contactDirect, contactFriend, contactGroup, contactGroupTemp, contactGuild, convertOneBotMessageToKarin, copyConfig, copyConfigSync, copyFiles, copyFilesSync, createAccessTokenExpiredResponse, createBadRequestResponse, createDirectMessage, createForbiddenResponse, createFriendDecreaseNotice, createFriendIncreaseNotice, createFriendMessage, createGroupAdminChangedNotice, createGroupApplyRequest, createGroupCardChangedNotice, createGroupFileUploadedNotice, createGroupHlightsChangedNotice, createGroupHonorChangedNotice, createGroupInviteRequest, createGroupLuckKingNotice, createGroupMemberAddNotice, createGroupMemberBanNotice, createGroupMemberDelNotice, createGroupMemberTitleUpdatedNotice, createGroupMessage, createGroupMessageReactionNotice, createGroupPokeNotice, createGroupRecallNotice, createGroupSignInNotice, createGroupTempMessage, createGroupWholeBanNotice, createGuildMessage, createINIParser, createMethodNotAllowedResponse, createNotFoundResponse, createOneBotClient, createOneBotHttp, createOneBotWsServer, createPayloadTooLargeResponse, createPluginDir, createPrivateApplyRequest, createPrivateFileUploadedNotice, createPrivatePokeNotice, createPrivateRecallNotice, createRawMessage, createReceiveLikeNotice, createRefreshTokenExpiredResponse, createResponse, createServerErrorResponse, createSuccessResponse, createTaskDatabase, createUnauthorizedResponse, cron, db, debug, karin as default, defineConfig, disconnectAllOneBotServer, divider, downFile, downloadFile, errorToString, exec, executeTask, existToMkdir, existToMkdirSync, exists, existsSync, ffmpeg, ffplay, ffprobe, fs as file, fileToBase64, fileToUrl, fileToUrlHandlerKey, filesByExt, formatLogString, formatPath, formatTime$1 as formatTime, index$3 as fs, getAllBot, getAllBotID, getAllBotList, getAllFiles, getAllFilesSync, getBot, getBotCount, getCommit, getDefaultBranch, getFastGithub, getFastRegistry, getFileMessage, getFiles, getHash, getLocalBranches, getLocalCommitHash, getMimeType, getPackageJson, getPid, getPkgVersion, getPluginInfo, getPlugins, getRelPath, getRemoteBranches, getRemoteCommitHash, getRemotePkgVersion, getRender, getRenderCount, getRenderList, getRequestIp, getTaskCallback, getTaskDatabase, getTime, gitPull, handler$1 as handler, hooks, importModule, imports, ini, initOneBotAdapter, initTaskSystem, input, isClass, isDir, isDirSync, isDocker, isFile, isFileSync, isIPv4Loop, isIPv6Loop, isLinux, isLocalRequest, isLoopback, isMac, isPathEqual, isPlugin, isPublic, isRoot, isSubPath, isWin, json$1 as json, karin, karinToQQBot, key, killApp, lock, lockMethod, lockProp, log, logger, logs, makeForward, makeMessage, type messageType, mkdir, mkdirSync, parseChangelog, parseGithubUrl, pingRequest, pkgRoot, qqbotToKarin, raceRequest, randomStr, range, read, readFile, readJson, readJsonSync, redis, registerBot, registerRender, removeTaskCallback, render, renderHtml, renderMultiHtml, renderTpl, requireFile, requireFileSync, restart, restartDirect, rmSync, router, satisfies, save, type screenshot, segment, select, sendMsg$1 as sendMsg, sender, senderDirect, senderFriend, senderGroup, senderGroupTemp, senderGuild, sep, server, setTaskCallback, setTaskDatabase, splitPath, start, stream, stringifyError, switchComponent, index$2 as system, taskAdd, taskExists, taskGet, taskList, taskSystem, taskUpdateLogs, taskUpdateStatus, unregisterBot, unregisterRender, updateAllGitPlugin, updateAllPkg, updateGitPlugin, updatePkg, updateTaskLogs, updateTaskStatus, uptime$1 as uptime, urlToPath, waitPort, watch, watchAndMerge, write, writeJson, writeJsonSync, yaml };
package/dist/index.mjs CHANGED
@@ -1960,38 +1960,60 @@ __export(changelog_exports, {
1960
1960
  parseChangelog: () => parseChangelog,
1961
1961
  range: () => range
1962
1962
  });
1963
- var log, logs, range, parseChangelog;
1963
+ function logs(arg1, arg2, lengthParam = 1, reverseParam = false, optsParam) {
1964
+ if (typeof lengthParam !== "number") {
1965
+ throw new TypeError("\u63D0\u53D6\u957F\u5EA6\u5FC5\u987B\u4E3A\u6570\u5B57");
1966
+ }
1967
+ const isObj = typeof arg1 === "object";
1968
+ const version2 = isObj ? arg1.version : arg1;
1969
+ const data = isObj ? arg1.data : arg2;
1970
+ const length = isObj ? arg1.length ?? 1 : lengthParam ?? 1;
1971
+ const reverse = isObj ? arg1.reverse ?? false : reverseParam ?? false;
1972
+ const compareMode = isObj ? arg1.compare ?? "xyz" : optsParam?.compare ?? "xyz";
1973
+ const list2 = parseChangelog(data);
1974
+ const keys = Object.keys(list2);
1975
+ const startKey = findFallbackVersionKey(keys, version2, { compare: compareMode });
1976
+ if (!startKey) return "";
1977
+ const index5 = keys.indexOf(startKey);
1978
+ const start3 = reverse ? index5 - length : index5;
1979
+ const end = reverse ? index5 : index5 + length;
1980
+ const sliceStart = Math.max(0, start3);
1981
+ const sliceEnd = Math.min(keys.length, end);
1982
+ const versions = keys.slice(sliceStart, sliceEnd).map((key) => list2[key] ? list2[key] : "");
1983
+ return versions.join("");
1984
+ }
1985
+ function range(arg1, startVersionArg, endVersionArg, optsParam) {
1986
+ const isObj = typeof arg1 === "object";
1987
+ const data = isObj ? arg1.data : arg1;
1988
+ const startVersion = isObj ? arg1.startVersion : startVersionArg;
1989
+ const endVersion = isObj ? arg1.endVersion : endVersionArg;
1990
+ const compareMode = isObj ? arg1.compare ?? "xyz" : optsParam?.compare ?? "xyz";
1991
+ const list2 = parseChangelog(data);
1992
+ const keys = Object.keys(list2);
1993
+ const startKey = findFallbackVersionKey(keys, startVersion, { compare: compareMode });
1994
+ const endKey = findFallbackVersionKey(keys, endVersion, { compare: compareMode });
1995
+ if (!startKey || !endKey) return "";
1996
+ const start3 = keys.indexOf(startKey);
1997
+ const end = keys.indexOf(endKey);
1998
+ if (start3 > end) {
1999
+ const versions2 = keys.slice(end, start3).map((key) => list2[key] ? list2[key] : "");
2000
+ return versions2.join("");
2001
+ }
2002
+ const versions = keys.slice(start3, end).map((key) => list2[key] ? list2[key] : "");
2003
+ return versions.join("");
2004
+ }
2005
+ var escapeRegex, log, parseChangelog, normalizeStableVersion, parseSemverParts, compareSemver, findFallbackVersionKey, parseSemverFull, compareSemverFull, compareByMode;
1964
2006
  var init_changelog = __esm({
1965
2007
  "src/utils/fs/changelog.ts"() {
2008
+ escapeRegex = (str) => {
2009
+ return str.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
2010
+ };
1966
2011
  log = (version2, data) => {
1967
- const regex = new RegExp(`## \\[${version2}\\](.|\\n)*?(?=## \\[|$)`, "g");
2012
+ const escapedVersion = escapeRegex(version2);
2013
+ const regex = new RegExp(`## \\[${escapedVersion}\\](.|\\n)*?(?=## \\[|$)`, "g");
1968
2014
  const match = data.match(regex);
1969
2015
  return match ? match[0] : null;
1970
2016
  };
1971
- logs = (version2, data, length = 1, reverse = false) => {
1972
- if (typeof length !== "number") {
1973
- throw new TypeError("\u63D0\u53D6\u957F\u5EA6\u5FC5\u987B\u4E3A\u6570\u5B57");
1974
- }
1975
- const list2 = parseChangelog(data);
1976
- const keys = Object.keys(list2);
1977
- const index5 = keys.indexOf(version2);
1978
- const start3 = reverse ? index5 - length : index5;
1979
- const end = reverse ? index5 : index5 + length;
1980
- const versions = keys.slice(start3, end).map((key) => list2[key] ? list2[key] : "");
1981
- return versions.join("");
1982
- };
1983
- range = (data, startVersion, endVersion) => {
1984
- const list2 = parseChangelog(data);
1985
- const keys = Object.keys(list2);
1986
- const start3 = keys.indexOf(startVersion);
1987
- const end = keys.indexOf(endVersion);
1988
- if (start3 > end) {
1989
- const versions2 = keys.slice(end, start3).map((key) => list2[key] ? list2[key] : "");
1990
- return versions2.join("");
1991
- }
1992
- const versions = keys.slice(start3, end).map((key) => list2[key] ? list2[key] : "");
1993
- return versions.join("");
1994
- };
1995
2017
  parseChangelog = (data) => {
1996
2018
  const regex = /## \[(.*?)\]([\s\S]*?)(?=## \[|$)/g;
1997
2019
  const changelog = {};
@@ -2002,6 +2024,109 @@ var init_changelog = __esm({
2002
2024
  }
2003
2025
  return changelog;
2004
2026
  };
2027
+ normalizeStableVersion = (ver) => {
2028
+ const m = ver.match(/(\d+)\.(\d+)\.(\d+)/);
2029
+ return m ? `${m[1]}.${m[2]}.${m[3]}` : ver;
2030
+ };
2031
+ parseSemverParts = (ver) => {
2032
+ const v = normalizeStableVersion(ver);
2033
+ const m = v.match(/^(\d+)\.(\d+)\.(\d+)$/);
2034
+ return m ? [parseInt(m[1], 10), parseInt(m[2], 10), parseInt(m[3], 10)] : null;
2035
+ };
2036
+ compareSemver = (a, b) => {
2037
+ const pa = parseSemverParts(a);
2038
+ const pb = parseSemverParts(b);
2039
+ if (!pa && !pb) return 0;
2040
+ if (!pa) return -1;
2041
+ if (!pb) return 1;
2042
+ if (pa[0] !== pb[0]) return pa[0] - pb[0];
2043
+ if (pa[1] !== pb[1]) return pa[1] - pb[1];
2044
+ if (pa[2] !== pb[2]) return pa[2] - pb[2];
2045
+ return 0;
2046
+ };
2047
+ findFallbackVersionKey = (keys, input2, opts) => {
2048
+ const mode = opts?.compare ?? "xyz";
2049
+ if (keys.includes(input2)) return input2;
2050
+ if (mode === "xyz") {
2051
+ const target = normalizeStableVersion(input2);
2052
+ if (keys.includes(target)) return target;
2053
+ for (const key of keys) {
2054
+ const kval = normalizeStableVersion(key);
2055
+ if (compareByMode(kval, target, "xyz") <= 0) {
2056
+ return key;
2057
+ }
2058
+ }
2059
+ return null;
2060
+ }
2061
+ const parsedInput = parseSemverFull(input2);
2062
+ if (!parsedInput) {
2063
+ const target = normalizeStableVersion(input2);
2064
+ if (keys.includes(target)) return target;
2065
+ for (const key of keys) {
2066
+ const kval = normalizeStableVersion(key);
2067
+ if (compareByMode(kval, target, "xyz") <= 0) {
2068
+ return key;
2069
+ }
2070
+ }
2071
+ return null;
2072
+ }
2073
+ for (const key of keys) {
2074
+ const parsedKey = parseSemverFull(key);
2075
+ const cmp = parsedKey ? compareSemverFull(key, input2) : compareByMode(key, input2, "xyz");
2076
+ if (cmp <= 0) return key;
2077
+ }
2078
+ return null;
2079
+ };
2080
+ parseSemverFull = (input2) => {
2081
+ const core = input2.split("+")[0];
2082
+ const m = core.match(/^(\d+)\.(\d+)\.(\d+)(?:-([0-9A-Za-z-.]+))?$/);
2083
+ if (!m) return null;
2084
+ const prerelease = m[4] ? m[4].split(".").map((id) => /^\d+$/.test(id) ? Number(id) : id) : null;
2085
+ return {
2086
+ major: Number(m[1]),
2087
+ minor: Number(m[2]),
2088
+ patch: Number(m[3]),
2089
+ prerelease
2090
+ };
2091
+ };
2092
+ compareSemverFull = (a, b) => {
2093
+ const pa = parseSemverFull(a);
2094
+ const pb = parseSemverFull(b);
2095
+ if (!pa || !pb) return 0;
2096
+ if (pa.major !== pb.major) return pa.major > pb.major ? 1 : -1;
2097
+ if (pa.minor !== pb.minor) return pa.minor > pb.minor ? 1 : -1;
2098
+ if (pa.patch !== pb.patch) return pa.patch > pb.patch ? 1 : -1;
2099
+ const ra = pa.prerelease;
2100
+ const rb = pb.prerelease;
2101
+ if (!ra && !rb) return 0;
2102
+ if (!ra && rb) return 1;
2103
+ if (ra && !rb) return -1;
2104
+ const len = Math.max(ra.length, rb.length);
2105
+ for (let i = 0; i < len; i++) {
2106
+ const ai = ra[i];
2107
+ const bi = rb[i];
2108
+ if (ai === void 0) return -1;
2109
+ if (bi === void 0) return 1;
2110
+ const aNum = typeof ai === "number";
2111
+ const bNum = typeof bi === "number";
2112
+ if (aNum && bNum) {
2113
+ if (ai !== bi) return ai > bi ? 1 : -1;
2114
+ } else if (aNum !== bNum) {
2115
+ return aNum ? -1 : 1;
2116
+ } else {
2117
+ if (ai !== bi) return String(ai) > String(bi) ? 1 : -1;
2118
+ }
2119
+ }
2120
+ return 0;
2121
+ };
2122
+ compareByMode = (a, b, mode) => {
2123
+ if (mode === "xyz") {
2124
+ const an = normalizeStableVersion(a);
2125
+ const bn = normalizeStableVersion(b);
2126
+ return compareSemver(an, bn);
2127
+ }
2128
+ return compareSemverFull(a, b);
2129
+ };
2005
2130
  }
2006
2131
  });
2007
2132
 
@@ -11380,21 +11505,95 @@ var init_import = __esm({
11380
11505
  };
11381
11506
  }
11382
11507
  });
11383
- var getPkg, checkPkgUpdate, getPkgVersion, getRemotePkgVersion, updatePkg, updateAllPkg, checkGitPluginUpdate, getCommit, getHash, getTime, updateGitPlugin, updateAllGitPlugin;
11508
+ var extractSemver, escapeRegex2, normalizeStableVersion2, parseSemver, compareSemver2, getPkg, checkPkgUpdate, getPkgVersion, getRemotePkgVersion, updatePkg, updateAllPkg, checkGitPluginUpdate, getCommit, getHash, getTime, updateGitPlugin, updateAllGitPlugin;
11384
11509
  var init_update = __esm({
11385
11510
  "src/utils/system/update.ts"() {
11386
11511
  init_exec();
11387
11512
  init_require();
11388
11513
  init_list();
11514
+ extractSemver = (spec) => {
11515
+ const m = spec.match(/\d+\.\d+\.\d+(?:-[0-9A-Za-z-.]+)?(?:\+[0-9A-Za-z-.]+)?/);
11516
+ return m ? m[0] : null;
11517
+ };
11518
+ escapeRegex2 = (str) => str.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
11519
+ normalizeStableVersion2 = (ver) => {
11520
+ const m = ver.match(/^(\d+)\.(\d+)\.(\d+)/);
11521
+ return m ? m[0] : ver;
11522
+ };
11523
+ parseSemver = (input2) => {
11524
+ const core = input2.split("+")[0];
11525
+ const m = core.match(/^(\d+)\.(\d+)\.(\d+)(?:-([0-9A-Za-z-.]+))?$/);
11526
+ if (!m) return null;
11527
+ const prerelease = m[4] ? m[4].split(".").map((id) => /^\d+$/.test(id) ? Number(id) : id) : null;
11528
+ return {
11529
+ major: Number(m[1]),
11530
+ minor: Number(m[2]),
11531
+ patch: Number(m[3]),
11532
+ prerelease
11533
+ };
11534
+ };
11535
+ compareSemver2 = (a, b) => {
11536
+ const pa = parseSemver(a);
11537
+ const pb = parseSemver(b);
11538
+ if (!pa || !pb) return 0;
11539
+ if (pa.major !== pb.major) return pa.major > pb.major ? 1 : -1;
11540
+ if (pa.minor !== pb.minor) return pa.minor > pb.minor ? 1 : -1;
11541
+ if (pa.patch !== pb.patch) return pa.patch > pb.patch ? 1 : -1;
11542
+ const ra = pa.prerelease;
11543
+ const rb = pb.prerelease;
11544
+ if (!ra && !rb) return 0;
11545
+ if (!ra && rb) return 1;
11546
+ if (ra && !rb) return -1;
11547
+ const len = Math.max(ra.length, rb.length);
11548
+ for (let i = 0; i < len; i++) {
11549
+ const ai = ra[i];
11550
+ const bi = rb[i];
11551
+ if (ai === void 0) return -1;
11552
+ if (bi === void 0) return 1;
11553
+ const aNum = typeof ai === "number";
11554
+ const bNum = typeof bi === "number";
11555
+ if (aNum && bNum) {
11556
+ if (ai !== bi) return ai > bi ? 1 : -1;
11557
+ } else if (aNum !== bNum) {
11558
+ return aNum ? -1 : 1;
11559
+ } else {
11560
+ if (ai !== bi) return String(ai) > String(bi) ? 1 : -1;
11561
+ }
11562
+ }
11563
+ return 0;
11564
+ };
11389
11565
  getPkg = (isForcibly = false) => {
11390
11566
  return requireFile("package.json", { force: isForcibly });
11391
11567
  };
11392
- checkPkgUpdate = async (name) => {
11568
+ checkPkgUpdate = async (name, opts) => {
11393
11569
  const logger3 = global?.logger || console;
11394
11570
  try {
11395
11571
  const local = await getPkgVersion(name);
11396
11572
  const remote = await getRemotePkgVersion(name);
11397
- if (local === remote) return { status: "no", local };
11573
+ const mode = opts?.compare ?? "xyz";
11574
+ let noUpdate = false;
11575
+ if (mode === "xyz") {
11576
+ const l = normalizeStableVersion2(local);
11577
+ const r = normalizeStableVersion2(remote);
11578
+ const lm = parseSemver(l);
11579
+ const rm = parseSemver(r);
11580
+ if (lm && rm) {
11581
+ const cmp = compareSemver2(l, r);
11582
+ noUpdate = cmp >= 0;
11583
+ } else {
11584
+ noUpdate = l === r;
11585
+ }
11586
+ } else {
11587
+ const pl = parseSemver(local);
11588
+ const pr = parseSemver(remote);
11589
+ if (pl && pr) {
11590
+ const cmp = compareSemver2(local, remote);
11591
+ noUpdate = cmp >= 0;
11592
+ } else {
11593
+ noUpdate = local === remote;
11594
+ }
11595
+ }
11596
+ if (noUpdate) return { status: "no", local };
11398
11597
  return { status: "yes", local, remote };
11399
11598
  } catch (error) {
11400
11599
  logger3.error(error);
@@ -11408,18 +11607,24 @@ var init_update = __esm({
11408
11607
  if (data.includes("empty") || data.includes("extraneous")) {
11409
11608
  throw new Error(`\u83B7\u53D6\u5931\u8D25\uFF0C${name} \u672A\u5B89\u88C5`);
11410
11609
  }
11411
- const reg = new RegExp(`${name}@(\\d+\\.\\d+\\.\\d+)`, "gm");
11412
- const result = reg.exec(data);
11413
- if (result?.[1]) return result[1];
11610
+ const esc = escapeRegex2(name);
11611
+ const reg = new RegExp(`${esc}@([0-9A-Za-z-.+]+)`, "gm");
11612
+ const match = reg.exec(data);
11613
+ if (match?.[1]) {
11614
+ return match[1].trim();
11615
+ }
11414
11616
  }
11415
11617
  if (error) {
11416
- if (error?.stack?.toString().includes("empty") || error?.stack?.toString().includes("extraneous")) {
11618
+ const stack = error?.stack?.toString() || "";
11619
+ if (stack.includes("empty") || stack.includes("extraneous")) {
11417
11620
  throw new Error(`\u83B7\u53D6\u5931\u8D25\uFF0C${name} \u672A\u5B89\u88C5`);
11418
11621
  }
11419
11622
  throw error;
11420
11623
  }
11421
11624
  const pkg2 = await getPkg();
11422
- return pkg2?.dependencies?.[name] || pkg2?.devDependencies?.[name] || pkg2?.peerDependencies?.[name];
11625
+ const spec = pkg2?.dependencies?.[name] || pkg2?.devDependencies?.[name] || pkg2?.peerDependencies?.[name];
11626
+ if (!spec) return "";
11627
+ return extractSemver(spec) || spec;
11423
11628
  };
11424
11629
  getRemotePkgVersion = async (name, tag = "latest") => {
11425
11630
  const cmd = tag === "latest" ? `npm show ${name} version` : `npm show ${name} dist-tags.${tag}`;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "node-karin",
3
- "version": "1.12.0",
3
+ "version": "1.12.2",
4
4
  "description": "Lightweight, efficient, concise, and stable robot framework.",
5
5
  "keywords": [
6
6
  "node",